@primer/react 0.0.0-20260428150519 → 0.0.0-20260428191209
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.
- package/CHANGELOG.md +5 -1
- package/dist/ActionBar/ActionBar.js +705 -502
- package/dist/ActionBar/ActionBar.module.css.js +5 -10
- package/dist/ActionBar/index.js +8 -8
- package/dist/ActionList/{ActionList-53389912.css → ActionList-09f5c4a8.css} +2 -2
- package/dist/ActionList/ActionList-09f5c4a8.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +5 -31
- package/dist/ActionList/ActionListContainerContext.js +5 -4
- package/dist/ActionList/Description.js +133 -117
- package/dist/ActionList/Divider.js +38 -31
- package/dist/ActionList/Group.js +349 -292
- package/dist/ActionList/Group.module.css.js +5 -10
- package/dist/ActionList/Heading.js +106 -88
- package/dist/ActionList/Heading.module.css.js +5 -5
- package/dist/ActionList/Item.js +811 -668
- package/dist/ActionList/LinkItem.js +56 -36
- package/dist/ActionList/List.js +210 -168
- package/dist/ActionList/Selection.d.ts +2 -3
- package/dist/ActionList/Selection.d.ts.map +1 -1
- package/dist/ActionList/Selection.js +112 -83
- package/dist/ActionList/TrailingAction.js +112 -97
- package/dist/ActionList/Visuals.js +191 -143
- package/dist/ActionList/index.d.ts +7 -0
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/ActionList/index.js +38 -33
- package/dist/ActionList/shared.js +9 -5
- package/dist/ActionMenu/ActionMenu.js +310 -223
- package/dist/ActionMenu/ActionMenu.module.css.js +5 -5
- package/dist/AnchoredOverlay/AnchoredOverlay.js +280 -206
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +5 -9
- package/dist/Autocomplete/Autocomplete.js +141 -125
- package/dist/Autocomplete/AutocompleteContext.js +20 -18
- package/dist/Autocomplete/AutocompleteInput.js +146 -108
- package/dist/Autocomplete/AutocompleteMenu.js +238 -201
- package/dist/Autocomplete/AutocompleteMenu.module.css.js +5 -8
- package/dist/Autocomplete/AutocompleteOverlay.js +79 -54
- package/dist/Autocomplete/AutocompleteOverlay.module.css.js +5 -5
- package/dist/Avatar/Avatar.js +133 -106
- package/dist/Avatar/Avatar.module.css.js +5 -5
- package/dist/AvatarStack/AvatarStack.js +143 -102
- package/dist/AvatarStack/AvatarStack.module.css.js +5 -9
- package/dist/Banner/Banner.js +186 -133
- package/dist/Banner/Banner.module.css.js +5 -14
- package/dist/Banner/index.js +7 -7
- package/dist/BaseStyles.js +91 -74
- package/dist/BaseStyles.module.css.js +5 -5
- package/dist/Blankslate/Blankslate.js +328 -266
- package/dist/Blankslate/Blankslate.module.css.js +5 -12
- package/dist/Blankslate/BlankslateContext.js +9 -7
- package/dist/Blankslate/index.js +9 -9
- package/dist/BranchName/BranchName.js +59 -49
- package/dist/BranchName/BranchName.module.css.js +5 -5
- package/dist/Breadcrumbs/Breadcrumbs.js +431 -371
- package/dist/Breadcrumbs/Breadcrumbs.module.css.js +5 -15
- package/dist/Button/Button.js +18 -15
- package/dist/Button/ButtonBase.js +139 -76
- package/dist/Button/ButtonBase.module.css.js +5 -16
- package/dist/Button/IconButton.js +74 -42
- package/dist/Button/LinkButton.js +17 -13
- package/dist/ButtonGroup/ButtonGroup.js +97 -80
- package/dist/ButtonGroup/ButtonGroup.module.css.js +5 -5
- package/dist/Card/Card.js +491 -401
- package/dist/Card/Card.module.css.js +5 -18
- package/dist/Card/index.js +9 -9
- package/dist/Checkbox/Checkbox.js +71 -52
- package/dist/Checkbox/Checkbox.module.css.js +5 -9
- package/dist/Checkbox/shared.module.css.js +5 -5
- package/dist/CheckboxGroup/CheckboxGroup.js +132 -111
- package/dist/CheckboxGroup/CheckboxGroupContext.js +4 -4
- package/dist/CircleBadge/CircleBadge.js +90 -77
- package/dist/CircleBadge/CircleBadge.module.css.js +5 -8
- package/dist/ConfirmationDialog/ConfirmationDialog.js +92 -68
- package/dist/CounterLabel/CounterLabel.js +99 -83
- package/dist/CounterLabel/CounterLabel.module.css.js +5 -5
- package/dist/DataTable/DataTable.js +140 -100
- package/dist/DataTable/ErrorDialog.js +45 -33
- package/dist/DataTable/Pagination.js +592 -464
- package/dist/DataTable/Pagination.module.css.js +5 -13
- package/dist/DataTable/Table.js +710 -527
- package/dist/DataTable/Table.module.css.js +5 -26
- package/dist/DataTable/column.js +11 -10
- package/dist/DataTable/index.js +20 -22
- package/dist/DataTable/sorting.js +103 -65
- package/dist/DataTable/useTable.js +290 -207
- package/dist/Details/Details.js +126 -100
- package/dist/Details/Details.module.css.js +5 -5
- package/dist/Dialog/Dialog.js +351 -259
- package/dist/Dialog/Dialog.module.css.js +5 -22
- package/dist/FeatureFlags/DefaultFeatureFlags.js +7 -7
- package/dist/FeatureFlags/FeatureFlagContext.js +5 -5
- package/dist/FeatureFlags/FeatureFlagScope.js +44 -36
- package/dist/FeatureFlags/FeatureFlags.js +37 -29
- package/dist/FeatureFlags/useFeatureFlag.js +19 -17
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +559 -454
- package/dist/FilteredActionList/FilteredActionList.module.css.js +5 -15
- package/dist/FilteredActionList/FilteredActionListInput.d.ts +15 -0
- package/dist/FilteredActionList/FilteredActionListInput.d.ts.map +1 -0
- package/dist/FilteredActionList/FilteredActionListInput.js +119 -0
- package/dist/FilteredActionList/FilteredActionListLoaders.js +150 -119
- package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +5 -9
- package/dist/FilteredActionList/index.d.ts +9 -1
- package/dist/FilteredActionList/index.d.ts.map +1 -1
- package/dist/FilteredActionList/index.js +11 -0
- package/dist/FilteredActionList/useAnnouncements.js +180 -167
- package/dist/Flash/Flash.js +69 -57
- package/dist/Flash/Flash.module.css.js +5 -5
- package/dist/FormControl/FormControl.js +227 -211
- package/dist/FormControl/FormControl.module.css.js +5 -11
- package/dist/FormControl/FormControlCaption.js +49 -37
- package/dist/FormControl/FormControlCaption.module.css.js +5 -5
- package/dist/FormControl/FormControlLabel.js +115 -95
- package/dist/FormControl/FormControlLeadingVisual.js +37 -29
- package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -5
- package/dist/FormControl/_FormControlContext.js +48 -41
- package/dist/FormControl/_FormControlValidation.js +39 -29
- package/dist/Header/Header.js +165 -138
- package/dist/Header/Header.module.css.js +5 -9
- package/dist/Heading/Heading.js +37 -26
- package/dist/Heading/Heading.module.css.js +5 -5
- package/dist/Hidden/Hidden.js +77 -54
- package/dist/Hidden/Hidden.module.css.js +5 -5
- package/dist/InlineMessage/InlineMessage.js +116 -88
- package/dist/InlineMessage/InlineMessage.module.css.js +5 -8
- package/dist/KeybindingHint/KeybindingHint.js +88 -70
- package/dist/KeybindingHint/KeybindingHint.module.css.js +5 -5
- package/dist/KeybindingHint/components/Chord.js +93 -81
- package/dist/KeybindingHint/components/Chord.module.css.js +5 -11
- package/dist/KeybindingHint/components/Key.js +66 -49
- package/dist/KeybindingHint/components/Sequence.js +24 -12
- package/dist/KeybindingHint/key-names.js +114 -99
- package/dist/Label/Label.js +66 -56
- package/dist/Label/Label.module.css.js +5 -5
- package/dist/Label/index.js +5 -5
- package/dist/LabelGroup/LabelGroup.js +344 -260
- package/dist/LabelGroup/LabelGroup.module.css.js +5 -12
- package/dist/Link/Link.js +47 -31
- package/dist/Link/Link.module.css.js +5 -5
- package/dist/NavList/NavList.js +614 -424
- package/dist/NavList/NavList.module.css.js +5 -5
- package/dist/Octicon/Octicon.js +37 -35
- package/dist/Overlay/Overlay.js +318 -264
- package/dist/Overlay/Overlay.module.css.js +5 -8
- package/dist/PageHeader/PageHeader.js +823 -579
- package/dist/PageHeader/PageHeader.module.css.js +5 -21
- package/dist/PageLayout/PageLayout.js +913 -631
- package/dist/PageLayout/PageLayout.module.css.js +5 -31
- package/dist/PageLayout/paneUtils.js +29 -15
- package/dist/PageLayout/usePaneWidth.js +437 -334
- package/dist/Pagehead/Pagehead.js +14 -10
- package/dist/Pagehead/Pagehead.module.css.js +5 -5
- package/dist/Pagination/Pagination.js +114 -84
- package/dist/Pagination/Pagination.module.css.js +5 -9
- package/dist/Pagination/index.js +5 -5
- package/dist/Pagination/model.js +194 -118
- package/dist/Popover/Popover.js +151 -126
- package/dist/Popover/Popover.module.css.js +5 -8
- package/dist/Portal/Portal.js +85 -65
- package/dist/Portal/index.js +6 -5
- package/dist/ProgressBar/ProgressBar.js +255 -210
- package/dist/ProgressBar/ProgressBar.module.css.js +5 -9
- package/dist/ProgressBar/index.js +8 -6
- package/dist/Radio/Radio.js +115 -97
- package/dist/Radio/Radio.module.css.js +5 -5
- package/dist/RadioGroup/RadioGroup.js +118 -99
- package/dist/RelativeTime/RelativeTime.js +76 -64
- package/dist/ScrollableRegion/ScrollableRegion.js +79 -67
- package/dist/ScrollableRegion/ScrollableRegion.module.css.js +5 -5
- package/dist/SegmentedControl/SegmentedControl.js +287 -238
- package/dist/SegmentedControl/SegmentedControl.module.css.js +5 -15
- package/dist/SegmentedControl/SegmentedControlButton.js +187 -156
- package/dist/SegmentedControl/SegmentedControlIconButton.js +161 -133
- package/dist/Select/Select.js +234 -185
- package/dist/Select/Select.module.css.js +5 -10
- package/dist/SelectPanel/SelectPanel.d.ts +1 -0
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +829 -620
- package/dist/SelectPanel/SelectPanel.module.css.js +5 -27
- package/dist/SelectPanel/SelectPanelMessage.js +39 -37
- package/dist/SelectPanel/index.d.ts +1 -0
- package/dist/SelectPanel/index.d.ts.map +1 -1
- package/dist/SideNav.js +47 -24
- package/dist/SideNav.module.css.js +5 -12
- package/dist/Skeleton/SkeletonBox.js +111 -94
- package/dist/Skeleton/SkeletonBox.module.css.js +5 -8
- package/dist/SkeletonAvatar/SkeletonAvatar.js +120 -95
- package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +5 -5
- package/dist/SkeletonText/SkeletonText.js +137 -114
- package/dist/SkeletonText/SkeletonText.module.css.js +5 -8
- package/dist/Spinner/Spinner.js +211 -183
- package/dist/Spinner/Spinner.module.css.js +5 -9
- package/dist/SplitPageLayout/SplitPageLayout.js +276 -215
- package/dist/Stack/Stack.js +255 -207
- package/dist/Stack/Stack.module.css.js +5 -8
- package/dist/Stack/index.js +6 -4
- package/dist/StateLabel/StateLabel.js +123 -110
- package/dist/StateLabel/StateLabel.module.css.js +5 -8
- package/dist/SubNav/SubNav.js +197 -159
- package/dist/SubNav/SubNav.module.css.js +5 -11
- package/dist/TabNav/TabNav.js +199 -167
- package/dist/TabNav/TabNav.module.css.js +5 -10
- package/dist/Text/Text.js +67 -56
- package/dist/Text/Text.module.css.js +5 -5
- package/dist/TextInput/TextInput.js +228 -195
- package/dist/TextInput/TextInput.module.css.js +5 -8
- package/dist/TextInputWithTokens/TextInputWithTokens.js +673 -567
- package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +5 -14
- package/dist/Textarea/TextArea.module.css.js +5 -9
- package/dist/Textarea/Textarea.js +294 -264
- package/dist/ThemeProvider.js +257 -199
- package/dist/Timeline/Timeline.js +247 -204
- package/dist/Timeline/Timeline.module.css.js +5 -12
- package/dist/ToggleSwitch/ToggleSwitch.js +471 -403
- package/dist/ToggleSwitch/ToggleSwitch.module.css.js +5 -16
- package/dist/Token/IssueLabelToken.js +297 -256
- package/dist/Token/IssueLabelToken.module.css.js +5 -8
- package/dist/Token/Token.js +280 -232
- package/dist/Token/Token.module.css.js +5 -9
- package/dist/Token/TokenBase.js +126 -99
- package/dist/Token/TokenBase.module.css.js +5 -5
- package/dist/Token/_RemoveTokenButton.js +48 -27
- package/dist/Token/_RemoveTokenButton.module.css.js +5 -5
- package/dist/Token/_TokenTextContainer.js +65 -54
- package/dist/Token/_TokenTextContainer.module.css.js +5 -5
- package/dist/Tooltip/Tooltip.js +56 -49
- package/dist/Tooltip/Tooltip.module.css.js +5 -20
- package/dist/TooltipV2/Tooltip.js +305 -222
- package/dist/TooltipV2/Tooltip.module.css.js +5 -11
- package/dist/TopicTag/TopicTag.js +55 -46
- package/dist/TopicTag/TopicTag.module.css.js +5 -5
- package/dist/TopicTag/TopicTagGroup.js +48 -40
- package/dist/TopicTag/TopicTagGroup.module.css.js +5 -5
- package/dist/TopicTag/index.js +7 -5
- package/dist/TreeView/TreeView.js +1414 -1082
- package/dist/TreeView/TreeView.module.css.js +5 -24
- package/dist/TreeView/shared.js +9 -10
- package/dist/TreeView/useRovingTabIndex.js +203 -129
- package/dist/TreeView/useTreeItemCache.js +79 -64
- package/dist/TreeView/useTypeahead.js +112 -90
- package/dist/Truncate/Truncate.js +33 -21
- package/dist/Truncate/Truncate.module.css.js +5 -5
- package/dist/UnderlineNav/UnderlineNav.js +375 -278
- package/dist/UnderlineNav/UnderlineNav.module.css.js +5 -8
- package/dist/UnderlineNav/UnderlineNavContext.js +8 -8
- package/dist/UnderlineNav/UnderlineNavItem.js +72 -56
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +5 -5
- package/dist/UnderlineNav/index.js +7 -5
- package/dist/UnderlineNav/styles.js +15 -11
- package/dist/VisuallyHidden/VisuallyHidden.js +49 -51
- package/dist/VisuallyHidden/VisuallyHidden.module.css.js +5 -5
- package/dist/_VisuallyHidden.js +62 -50
- package/dist/_VisuallyHidden.module.css.js +5 -5
- package/dist/deprecated/ActionList/Divider.js +23 -23
- package/dist/deprecated/ActionList/Divider.module.css.js +5 -5
- package/dist/deprecated/ActionList/Group.js +50 -43
- package/dist/deprecated/ActionList/Header.js +81 -69
- package/dist/deprecated/ActionList/Header.module.css.js +5 -5
- package/dist/deprecated/ActionList/Item.js +352 -308
- package/dist/deprecated/ActionList/Item.module.css.js +5 -18
- package/dist/deprecated/ActionList/List.js +196 -157
- package/dist/deprecated/ActionList/List.module.css.js +5 -5
- package/dist/deprecated/ActionList/index.js +14 -14
- package/dist/deprecated/ActionMenu.js +190 -159
- package/dist/deprecated/DialogV1/Dialog.js +200 -166
- package/dist/deprecated/DialogV1/Dialog.module.css.js +5 -11
- package/dist/deprecated/FilteredSearch/FilteredSearch.js +51 -43
- package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +5 -5
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +160 -132
- package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -14
- package/dist/deprecated/index.js +9 -20
- package/dist/experimental/IssueLabel/IssueLabel.js +158 -134
- package/dist/experimental/IssueLabel/IssueLabel.module.css.js +5 -5
- package/dist/experimental/SelectPanel2/SelectPanel.js +567 -419
- package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +5 -32
- package/dist/experimental/Tabs/Tabs.js +297 -234
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +215 -165
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +5 -5
- package/dist/experimental/index.d.ts +2 -2
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/experimental/index.js +34 -44
- package/dist/hooks/useAnchoredPosition.js +144 -123
- package/dist/hooks/useControllableState.js +59 -34
- package/dist/hooks/useDetails.js +99 -84
- package/dist/hooks/useDialog.js +178 -140
- package/dist/hooks/useFocusTrap.js +71 -57
- package/dist/hooks/useFocusZone.js +38 -32
- package/dist/hooks/useId.js +16 -14
- package/dist/hooks/useIsMacOS.js +26 -21
- package/dist/hooks/useMedia.js +68 -54
- package/dist/hooks/useMenuInitialFocus.js +62 -65
- package/dist/hooks/useMenuKeyboardNavigation.js +126 -129
- package/dist/hooks/useMergedRefs.js +78 -63
- package/dist/hooks/useMnemonics.js +107 -77
- package/dist/hooks/useOnEscapePress.js +56 -45
- package/dist/hooks/useOnOutsideClick.js +63 -32
- package/dist/hooks/useOpenAndCloseFocus.js +43 -40
- package/dist/hooks/useOverflow.js +36 -32
- package/dist/hooks/useOverlay.js +75 -56
- package/dist/hooks/useProvidedRefOrCreate.js +24 -24
- package/dist/hooks/useProvidedStateOrCreate.js +39 -33
- package/dist/hooks/useRefObjectAsForwardedRef.js +32 -30
- package/dist/hooks/useRenderForcingRef.js +46 -42
- package/dist/hooks/useResizeObserver.js +43 -32
- package/dist/hooks/useResponsiveValue.js +57 -37
- package/dist/hooks/useSafeTimeout.js +29 -26
- package/dist/hooks/useScrollFlash.js +23 -16
- package/dist/hooks/useSlots.js +136 -102
- package/dist/hooks/useSyncedState.js +37 -31
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -88
- package/dist/internal/components/ButtonReset.js +50 -45
- package/dist/internal/components/ButtonReset.module.css.js +5 -5
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +105 -79
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +5 -12
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +21 -16
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +4 -4
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +35 -26
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +19 -14
- package/dist/internal/components/ConditionalWrapper.js +51 -41
- package/dist/internal/components/InputLabel.js +113 -92
- package/dist/internal/components/InputLabel.module.css.js +5 -8
- package/dist/internal/components/InputValidation.js +87 -67
- package/dist/internal/components/InputValidation.module.css.js +5 -9
- package/dist/internal/components/TextInputInnerAction.js +173 -134
- package/dist/internal/components/TextInputInnerAction.module.css.js +5 -9
- package/dist/internal/components/TextInputInnerVisualSlot.js +110 -89
- package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +5 -11
- package/dist/internal/components/TextInputWrapper.js +230 -187
- package/dist/internal/components/TextInputWrapper.module.css.js +5 -8
- package/dist/internal/components/UnderlineTabbedInterface.js +238 -191
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +5 -11
- package/dist/internal/components/UnstyledTextInput.js +47 -40
- package/dist/internal/components/UnstyledTextInput.module.css.js +5 -5
- package/dist/internal/components/ValidationAnimationContainer.js +66 -55
- package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -8
- package/dist/internal/hooks/useEffectCallback.js +38 -35
- package/dist/internal/hooks/useEffectOnce.js +25 -23
- package/dist/internal/utils/getResponsiveAttributes.js +26 -23
- package/dist/internal/utils/hasInteractiveNodes.js +46 -34
- package/dist/legacy-theme/ts/color-schemes.js +4732 -4250
- package/dist/live-region/Announce.js +183 -144
- package/dist/live-region/AriaAlert.js +22 -20
- package/dist/live-region/AriaStatus.js +22 -20
- package/dist/next/index.js +1 -3
- package/dist/test-helpers.js +62 -40
- package/dist/theme.js +47 -83
- package/dist/utils/character-counter.js +63 -45
- package/dist/utils/create-component.js +16 -15
- package/dist/utils/descendant-registry.js +218 -182
- package/dist/utils/environment.js +7 -7
- package/dist/utils/getBreakpointDeclarations.js +10 -9
- package/dist/utils/invariant.js +23 -17
- package/dist/utils/is-slot.js +11 -10
- package/dist/utils/isNumeric.js +3 -3
- package/dist/utils/modern-polymorphic.js +20 -12
- package/dist/utils/scroll.js +11 -8
- package/dist/utils/theme.js +10 -5
- package/dist/utils/useIsomorphicLayoutEffect.js +9 -4
- package/dist/utils/warning.js +21 -14
- package/package.json +10 -5
- package/dist/ActionList/ActionList-53389912.css.map +0 -1
|
@@ -1,582 +1,688 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import Token from
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated
|
|
21
|
-
*/
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { FocusKeys } from '@primer/behaviors';
|
|
3
|
+
import { isFocusable } from '@primer/behaviors/utils';
|
|
4
|
+
import React, { useRef, useState } from 'react';
|
|
5
|
+
import { isValidElementType } from 'react-is';
|
|
6
|
+
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
7
|
+
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
8
|
+
import { useId } from '../hooks/useId.js';
|
|
9
|
+
import Token from '../Token/Token.js';
|
|
10
|
+
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
11
|
+
import { TextInputWrapper } from '../internal/components/TextInputWrapper.js';
|
|
12
|
+
import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
|
|
13
|
+
import TextInputInnerVisualSlot from '../internal/components/TextInputInnerVisualSlot.js';
|
|
14
|
+
import styles from './TextInputWithTokens.module.css.js';
|
|
15
|
+
import { clsx } from 'clsx';
|
|
16
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
|
+
import Text from '../Text/Text.js';
|
|
18
|
+
|
|
22
19
|
const overflowCountClassMap = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
small: styles.OverflowCountSmall,
|
|
21
|
+
medium: styles.OverflowCountMedium,
|
|
22
|
+
large: styles.OverflowCountLarge,
|
|
23
|
+
xlarge: styles.OverflowCountXLarge
|
|
27
24
|
};
|
|
25
|
+
|
|
26
|
+
// using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
|
28
27
|
function TextInputWithTokensInnerComponent(t0, forwardedRef) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
28
|
+
const $ = c(151);
|
|
29
|
+
let IconComponent;
|
|
30
|
+
let LeadingVisual;
|
|
31
|
+
let TrailingVisual;
|
|
32
|
+
let block;
|
|
33
|
+
let className;
|
|
34
|
+
let contrast;
|
|
35
|
+
let disabled;
|
|
36
|
+
let loading;
|
|
37
|
+
let maxHeight;
|
|
38
|
+
let maxWidthProp;
|
|
39
|
+
let minWidthProp;
|
|
40
|
+
let onTokenRemove;
|
|
41
|
+
let rest;
|
|
42
|
+
let style;
|
|
43
|
+
let t1;
|
|
44
|
+
let t2;
|
|
45
|
+
let t3;
|
|
46
|
+
let t4;
|
|
47
|
+
let t5;
|
|
48
|
+
let tokens;
|
|
49
|
+
let validationStatus;
|
|
50
|
+
let variantProp;
|
|
51
|
+
let visibleTokenCount;
|
|
52
|
+
let widthProp;
|
|
53
|
+
if ($[0] !== t0) {
|
|
54
|
+
({
|
|
55
|
+
icon: IconComponent,
|
|
56
|
+
leadingVisual: LeadingVisual,
|
|
57
|
+
trailingVisual: TrailingVisual,
|
|
58
|
+
loading,
|
|
59
|
+
loaderPosition: t1,
|
|
60
|
+
contrast,
|
|
61
|
+
className,
|
|
62
|
+
block,
|
|
63
|
+
disabled,
|
|
64
|
+
tokens,
|
|
65
|
+
onTokenRemove,
|
|
66
|
+
tokenComponent: t2,
|
|
67
|
+
preventTokenWrapping: t3,
|
|
68
|
+
size: t4,
|
|
69
|
+
hideTokenRemoveButtons: t5,
|
|
70
|
+
maxHeight,
|
|
71
|
+
width: widthProp,
|
|
72
|
+
minWidth: minWidthProp,
|
|
73
|
+
maxWidth: maxWidthProp,
|
|
74
|
+
validationStatus,
|
|
75
|
+
variant: variantProp,
|
|
76
|
+
visibleTokenCount,
|
|
77
|
+
style,
|
|
78
|
+
...rest
|
|
79
|
+
} = t0);
|
|
80
|
+
$[0] = t0;
|
|
81
|
+
$[1] = IconComponent;
|
|
82
|
+
$[2] = LeadingVisual;
|
|
83
|
+
$[3] = TrailingVisual;
|
|
84
|
+
$[4] = block;
|
|
85
|
+
$[5] = className;
|
|
86
|
+
$[6] = contrast;
|
|
87
|
+
$[7] = disabled;
|
|
88
|
+
$[8] = loading;
|
|
89
|
+
$[9] = maxHeight;
|
|
90
|
+
$[10] = maxWidthProp;
|
|
91
|
+
$[11] = minWidthProp;
|
|
92
|
+
$[12] = onTokenRemove;
|
|
93
|
+
$[13] = rest;
|
|
94
|
+
$[14] = style;
|
|
95
|
+
$[15] = t1;
|
|
96
|
+
$[16] = t2;
|
|
97
|
+
$[17] = t3;
|
|
98
|
+
$[18] = t4;
|
|
99
|
+
$[19] = t5;
|
|
100
|
+
$[20] = tokens;
|
|
101
|
+
$[21] = validationStatus;
|
|
102
|
+
$[22] = variantProp;
|
|
103
|
+
$[23] = visibleTokenCount;
|
|
104
|
+
$[24] = widthProp;
|
|
105
|
+
} else {
|
|
106
|
+
IconComponent = $[1];
|
|
107
|
+
LeadingVisual = $[2];
|
|
108
|
+
TrailingVisual = $[3];
|
|
109
|
+
block = $[4];
|
|
110
|
+
className = $[5];
|
|
111
|
+
contrast = $[6];
|
|
112
|
+
disabled = $[7];
|
|
113
|
+
loading = $[8];
|
|
114
|
+
maxHeight = $[9];
|
|
115
|
+
maxWidthProp = $[10];
|
|
116
|
+
minWidthProp = $[11];
|
|
117
|
+
onTokenRemove = $[12];
|
|
118
|
+
rest = $[13];
|
|
119
|
+
style = $[14];
|
|
120
|
+
t1 = $[15];
|
|
121
|
+
t2 = $[16];
|
|
122
|
+
t3 = $[17];
|
|
123
|
+
t4 = $[18];
|
|
124
|
+
t5 = $[19];
|
|
125
|
+
tokens = $[20];
|
|
126
|
+
validationStatus = $[21];
|
|
127
|
+
variantProp = $[22];
|
|
128
|
+
visibleTokenCount = $[23];
|
|
129
|
+
widthProp = $[24];
|
|
130
|
+
}
|
|
131
|
+
const loaderPosition = t1 === undefined ? "auto" : t1;
|
|
132
|
+
const TokenComponent = t2 === undefined ? Token : t2;
|
|
133
|
+
const preventTokenWrapping = t3 === undefined ? false : t3;
|
|
134
|
+
const size = t4 === undefined ? "xlarge" : t4;
|
|
135
|
+
const hideTokenRemoveButtons = t5 === undefined ? false : t5;
|
|
136
|
+
let ariaDescribedByProp;
|
|
137
|
+
let inputPropsRest;
|
|
138
|
+
let onBlur;
|
|
139
|
+
let onFocus;
|
|
140
|
+
let onKeyDown;
|
|
141
|
+
let role;
|
|
142
|
+
if ($[25] !== rest) {
|
|
143
|
+
({
|
|
144
|
+
onBlur,
|
|
145
|
+
onFocus,
|
|
146
|
+
onKeyDown,
|
|
147
|
+
"aria-describedby": ariaDescribedByProp,
|
|
148
|
+
role,
|
|
149
|
+
...inputPropsRest
|
|
150
|
+
} = rest);
|
|
151
|
+
$[25] = rest;
|
|
152
|
+
$[26] = ariaDescribedByProp;
|
|
153
|
+
$[27] = inputPropsRest;
|
|
154
|
+
$[28] = onBlur;
|
|
155
|
+
$[29] = onFocus;
|
|
156
|
+
$[30] = onKeyDown;
|
|
157
|
+
$[31] = role;
|
|
158
|
+
} else {
|
|
159
|
+
ariaDescribedByProp = $[26];
|
|
160
|
+
inputPropsRest = $[27];
|
|
161
|
+
onBlur = $[28];
|
|
162
|
+
onFocus = $[29];
|
|
163
|
+
onKeyDown = $[30];
|
|
164
|
+
role = $[31];
|
|
165
|
+
}
|
|
166
|
+
const ref = useRef(null);
|
|
167
|
+
const selectedValuesDescriptionId = useId();
|
|
168
|
+
useRefObjectAsForwardedRef(forwardedRef, ref);
|
|
169
|
+
const [selectedTokenIndex, setSelectedTokenIndex] = useState();
|
|
170
|
+
const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
|
|
171
|
+
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;
|
|
177
|
+
} 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];
|
|
200
|
+
}
|
|
201
|
+
const {
|
|
202
|
+
containerRef: t10
|
|
203
|
+
} = useFocusZone({
|
|
204
|
+
focusOutBehavior: "wrap",
|
|
205
|
+
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
206
|
+
focusableElementFilter: _temp3,
|
|
207
|
+
getNextFocusable: direction => {
|
|
208
|
+
var _containerRef$current;
|
|
209
|
+
if (!selectedTokenIndex && selectedTokenIndex !== 0) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
let nextIndex = selectedTokenIndex + 1;
|
|
213
|
+
if (direction === "next") {
|
|
214
|
+
nextIndex = nextIndex + 1;
|
|
215
|
+
}
|
|
216
|
+
if (direction === "previous") {
|
|
217
|
+
nextIndex = nextIndex - 1;
|
|
218
|
+
}
|
|
219
|
+
if (nextIndex > tokens.length || nextIndex < 1) {
|
|
220
|
+
return ref.current || undefined;
|
|
221
|
+
}
|
|
222
|
+
return (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
|
|
223
|
+
}
|
|
224
|
+
}, t9);
|
|
225
|
+
const containerRef = t10;
|
|
226
|
+
let t11;
|
|
227
|
+
if ($[39] !== containerRef || $[40] !== onTokenRemove || $[41] !== selectedTokenIndex) {
|
|
228
|
+
t11 = tokenId => {
|
|
229
|
+
onTokenRemove(tokenId);
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
var _containerRef$current2, _containerRef$current3;
|
|
232
|
+
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);
|
|
234
|
+
if (firstFocusable) {
|
|
235
|
+
firstFocusable.focus();
|
|
236
|
+
} else {
|
|
237
|
+
var _ref$current;
|
|
238
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
|
239
|
+
}
|
|
240
|
+
}, 0);
|
|
241
|
+
};
|
|
242
|
+
$[39] = containerRef;
|
|
243
|
+
$[40] = onTokenRemove;
|
|
244
|
+
$[41] = selectedTokenIndex;
|
|
245
|
+
$[42] = t11;
|
|
246
|
+
} else {
|
|
247
|
+
t11 = $[42];
|
|
248
|
+
}
|
|
249
|
+
const handleTokenRemove = t11;
|
|
250
|
+
let t12;
|
|
251
|
+
if ($[43] !== disabled) {
|
|
252
|
+
t12 = tokenIndex => () => {
|
|
253
|
+
if (!disabled) {
|
|
254
|
+
setSelectedTokenIndex(tokenIndex);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
$[43] = disabled;
|
|
258
|
+
$[44] = t12;
|
|
259
|
+
} else {
|
|
260
|
+
t12 = $[44];
|
|
261
|
+
}
|
|
262
|
+
const handleTokenFocus = t12;
|
|
263
|
+
let t13;
|
|
264
|
+
if ($[45] !== containerRef || $[46] !== visibleTokenCount) {
|
|
265
|
+
t13 = () => {
|
|
266
|
+
setSelectedTokenIndex(undefined);
|
|
267
|
+
setTimeout(() => {
|
|
268
|
+
var _containerRef$current4;
|
|
269
|
+
if (!((_containerRef$current4 = containerRef.current) !== null && _containerRef$current4 !== void 0 && _containerRef$current4.contains(document.activeElement)) && visibleTokenCount) {
|
|
270
|
+
setTokensAreTruncated(true);
|
|
271
|
+
}
|
|
272
|
+
}, 0);
|
|
273
|
+
};
|
|
274
|
+
$[45] = containerRef;
|
|
275
|
+
$[46] = visibleTokenCount;
|
|
276
|
+
$[47] = t13;
|
|
277
|
+
} else {
|
|
278
|
+
t13 = $[47];
|
|
279
|
+
}
|
|
280
|
+
const handleTokenBlur = t13;
|
|
281
|
+
let t14;
|
|
282
|
+
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
283
|
+
t14 = event => {
|
|
284
|
+
if (event.key === "Escape") {
|
|
285
|
+
var _ref$current2;
|
|
286
|
+
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
$[48] = t14;
|
|
290
|
+
} else {
|
|
291
|
+
t14 = $[48];
|
|
292
|
+
}
|
|
293
|
+
const handleTokenKeyUp = t14;
|
|
294
|
+
let t15;
|
|
295
|
+
if ($[49] !== onFocus || $[50] !== visibleTokenCount) {
|
|
296
|
+
t15 = event_0 => {
|
|
297
|
+
onFocus && onFocus(event_0);
|
|
298
|
+
setSelectedTokenIndex(undefined);
|
|
299
|
+
visibleTokenCount && setTokensAreTruncated(false);
|
|
300
|
+
};
|
|
301
|
+
$[49] = onFocus;
|
|
302
|
+
$[50] = visibleTokenCount;
|
|
303
|
+
$[51] = t15;
|
|
304
|
+
} else {
|
|
305
|
+
t15 = $[51];
|
|
306
|
+
}
|
|
307
|
+
const handleInputFocus = t15;
|
|
308
|
+
let t16;
|
|
309
|
+
if ($[52] !== containerRef || $[53] !== onBlur || $[54] !== visibleTokenCount) {
|
|
310
|
+
t16 = event_1 => {
|
|
311
|
+
onBlur && onBlur(event_1);
|
|
312
|
+
setTimeout(() => {
|
|
313
|
+
var _containerRef$current5;
|
|
314
|
+
if (!((_containerRef$current5 = containerRef.current) !== null && _containerRef$current5 !== void 0 && _containerRef$current5.contains(document.activeElement)) && visibleTokenCount) {
|
|
315
|
+
setTokensAreTruncated(true);
|
|
316
|
+
}
|
|
317
|
+
}, 0);
|
|
318
|
+
};
|
|
319
|
+
$[52] = containerRef;
|
|
320
|
+
$[53] = onBlur;
|
|
321
|
+
$[54] = visibleTokenCount;
|
|
322
|
+
$[55] = t16;
|
|
323
|
+
} else {
|
|
324
|
+
t16 = $[55];
|
|
325
|
+
}
|
|
326
|
+
const handleInputBlur = t16;
|
|
327
|
+
let t17;
|
|
328
|
+
if ($[56] !== handleTokenRemove || $[57] !== onKeyDown || $[58] !== tokens) {
|
|
329
|
+
t17 = e => {
|
|
330
|
+
var _ref$current3;
|
|
331
|
+
if (onKeyDown) {
|
|
332
|
+
onKeyDown(e);
|
|
333
|
+
}
|
|
334
|
+
if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const lastToken = tokens[tokens.length - 1];
|
|
338
|
+
if (e.key === "Backspace" && lastToken) {
|
|
339
|
+
handleTokenRemove(lastToken.id);
|
|
340
|
+
if (ref.current) {
|
|
341
|
+
ref.current.value = `${lastToken.text} `;
|
|
342
|
+
}
|
|
343
|
+
setTimeout(() => {
|
|
344
|
+
var _ref$current4;
|
|
345
|
+
(_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
|
|
346
|
+
}, 0);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
$[56] = handleTokenRemove;
|
|
350
|
+
$[57] = onKeyDown;
|
|
351
|
+
$[58] = tokens;
|
|
352
|
+
$[59] = t17;
|
|
353
|
+
} else {
|
|
354
|
+
t17 = $[59];
|
|
355
|
+
}
|
|
356
|
+
const handleInputKeyDown = t17;
|
|
357
|
+
let t18;
|
|
358
|
+
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
359
|
+
t18 = () => {
|
|
360
|
+
var _ref$current5;
|
|
361
|
+
(_ref$current5 = ref.current) === null || _ref$current5 === void 0 ? void 0 : _ref$current5.focus();
|
|
362
|
+
};
|
|
363
|
+
$[60] = t18;
|
|
364
|
+
} else {
|
|
365
|
+
t18 = $[60];
|
|
366
|
+
}
|
|
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;
|
|
376
|
+
} else {
|
|
377
|
+
t19 = $[64];
|
|
378
|
+
}
|
|
379
|
+
const visibleTokens = t19;
|
|
380
|
+
let t20;
|
|
381
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
|
382
|
+
t20 = {
|
|
383
|
+
small: "small",
|
|
384
|
+
medium: "small",
|
|
385
|
+
large: "medium",
|
|
386
|
+
xlarge: "medium"
|
|
387
|
+
};
|
|
388
|
+
$[65] = t20;
|
|
389
|
+
} else {
|
|
390
|
+
t20 = $[65];
|
|
391
|
+
}
|
|
392
|
+
const inputSizeMap = t20;
|
|
393
|
+
const showLeadingLoadingIndicator = loading && (loaderPosition === "leading" || Boolean(LeadingVisual && loaderPosition !== "trailing"));
|
|
394
|
+
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;
|
|
404
|
+
} else {
|
|
405
|
+
t25 = $[67];
|
|
406
|
+
}
|
|
407
|
+
let t26;
|
|
408
|
+
if ($[68] !== maxHeight || $[69] !== style) {
|
|
409
|
+
t26 = maxHeight ? {
|
|
410
|
+
maxHeight,
|
|
411
|
+
...style
|
|
412
|
+
} : style;
|
|
413
|
+
$[68] = maxHeight;
|
|
414
|
+
$[69] = style;
|
|
415
|
+
$[70] = t26;
|
|
416
|
+
} else {
|
|
417
|
+
t26 = $[70];
|
|
418
|
+
}
|
|
419
|
+
let t27;
|
|
420
|
+
if ($[71] !== IconComponent || $[72] !== LeadingVisual) {
|
|
421
|
+
t27 = IconComponent && !LeadingVisual && /*#__PURE__*/jsx(IconComponent, {
|
|
422
|
+
className: "TextInput-icon",
|
|
423
|
+
"data-component": "TextInputWithTokens.Icon"
|
|
424
|
+
});
|
|
425
|
+
$[71] = IconComponent;
|
|
426
|
+
$[72] = LeadingVisual;
|
|
427
|
+
$[73] = t27;
|
|
428
|
+
} else {
|
|
429
|
+
t27 = $[73];
|
|
430
|
+
}
|
|
431
|
+
const t28 = typeof loading === "boolean";
|
|
432
|
+
let t29;
|
|
433
|
+
if ($[74] !== LeadingVisual) {
|
|
434
|
+
t29 = typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual;
|
|
435
|
+
$[74] = LeadingVisual;
|
|
436
|
+
$[75] = t29;
|
|
437
|
+
} else {
|
|
438
|
+
t29 = $[75];
|
|
439
|
+
}
|
|
440
|
+
let t30;
|
|
441
|
+
if ($[76] !== showLeadingLoadingIndicator || $[77] !== t28 || $[78] !== t29) {
|
|
442
|
+
t30 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
|
|
443
|
+
hasLoadingIndicator: t28,
|
|
444
|
+
visualPosition: "leading",
|
|
445
|
+
showLoadingIndicator: showLeadingLoadingIndicator,
|
|
446
|
+
componentPrefix: "TextInputWithTokens",
|
|
447
|
+
children: t29
|
|
448
|
+
});
|
|
449
|
+
$[76] = showLeadingLoadingIndicator;
|
|
450
|
+
$[77] = t28;
|
|
451
|
+
$[78] = t29;
|
|
452
|
+
$[79] = t30;
|
|
453
|
+
} else {
|
|
454
|
+
t30 = $[79];
|
|
455
|
+
}
|
|
456
|
+
const t31 = containerRef;
|
|
457
|
+
const t32 = validationStatus === "error" ? "true" : "false";
|
|
458
|
+
const t33 = ariaDescribedBy || undefined;
|
|
459
|
+
let t34;
|
|
460
|
+
if ($[80] !== disabled || $[81] !== handleInputBlur || $[82] !== handleInputFocus || $[83] !== handleInputKeyDown || $[84] !== inputPropsRest || $[85] !== role || $[86] !== t32 || $[87] !== t33) {
|
|
461
|
+
t34 = /*#__PURE__*/jsx(UnstyledTextInput, {
|
|
462
|
+
ref: ref,
|
|
463
|
+
disabled: disabled,
|
|
464
|
+
onFocus: handleInputFocus,
|
|
465
|
+
onBlur: handleInputBlur,
|
|
466
|
+
onKeyDown: handleInputKeyDown,
|
|
467
|
+
type: "text",
|
|
468
|
+
className: styles.UnstyledTextInput,
|
|
469
|
+
"aria-invalid": t32,
|
|
470
|
+
role: role,
|
|
471
|
+
"aria-describedby": t33,
|
|
472
|
+
"data-component": "TextInputWithTokens.Input",
|
|
473
|
+
...inputPropsRest
|
|
474
|
+
});
|
|
475
|
+
$[80] = disabled;
|
|
476
|
+
$[81] = handleInputBlur;
|
|
477
|
+
$[82] = handleInputFocus;
|
|
478
|
+
$[83] = handleInputKeyDown;
|
|
479
|
+
$[84] = inputPropsRest;
|
|
480
|
+
$[85] = role;
|
|
481
|
+
$[86] = t32;
|
|
482
|
+
$[87] = t33;
|
|
483
|
+
$[88] = t34;
|
|
484
|
+
} else {
|
|
485
|
+
t34 = $[88];
|
|
486
|
+
}
|
|
487
|
+
let t35;
|
|
488
|
+
if ($[89] !== selectedValuesDescription || $[90] !== selectedValuesDescriptionId || $[91] !== shouldExposeSelectedValuesDescription) {
|
|
489
|
+
t35 = shouldExposeSelectedValuesDescription ? /*#__PURE__*/jsx(VisuallyHidden, {
|
|
490
|
+
id: selectedValuesDescriptionId,
|
|
491
|
+
children: selectedValuesDescription
|
|
492
|
+
}) : null;
|
|
493
|
+
$[89] = selectedValuesDescription;
|
|
494
|
+
$[90] = selectedValuesDescriptionId;
|
|
495
|
+
$[91] = shouldExposeSelectedValuesDescription;
|
|
496
|
+
$[92] = t35;
|
|
497
|
+
} else {
|
|
498
|
+
t35 = $[92];
|
|
499
|
+
}
|
|
500
|
+
let t36;
|
|
501
|
+
if ($[93] !== t34 || $[94] !== t35) {
|
|
502
|
+
t36 = /*#__PURE__*/jsxs("div", {
|
|
503
|
+
className: styles.InputWrapper,
|
|
504
|
+
children: [t34, t35]
|
|
505
|
+
});
|
|
506
|
+
$[93] = t34;
|
|
507
|
+
$[94] = t35;
|
|
508
|
+
$[95] = t36;
|
|
509
|
+
} else {
|
|
510
|
+
t36 = $[95];
|
|
511
|
+
}
|
|
512
|
+
let t37;
|
|
513
|
+
if ($[96] !== TokenComponent || $[97] !== disabled || $[98] !== handleTokenBlur || $[99] !== handleTokenFocus || $[100] !== handleTokenRemove || $[101] !== hideTokenRemoveButtons || $[102] !== selectedTokenIndex || $[103] !== size || $[104] !== visibleTokens) {
|
|
514
|
+
let t38;
|
|
515
|
+
if ($[106] !== TokenComponent || $[107] !== disabled || $[108] !== handleTokenBlur || $[109] !== handleTokenFocus || $[110] !== handleTokenRemove || $[111] !== hideTokenRemoveButtons || $[112] !== selectedTokenIndex || $[113] !== size) {
|
|
516
|
+
t38 = (t39, i) => {
|
|
517
|
+
const {
|
|
518
|
+
id,
|
|
519
|
+
...tokenRest
|
|
520
|
+
} = t39;
|
|
521
|
+
return /*#__PURE__*/jsx(TokenComponent, {
|
|
522
|
+
disabled: disabled,
|
|
523
|
+
onFocus: handleTokenFocus(i),
|
|
524
|
+
onBlur: handleTokenBlur,
|
|
525
|
+
onKeyUp: handleTokenKeyUp,
|
|
526
|
+
onClick: preventTokenClickPropagation,
|
|
527
|
+
isSelected: selectedTokenIndex === i,
|
|
528
|
+
onRemove: () => {
|
|
529
|
+
handleTokenRemove(id);
|
|
530
|
+
},
|
|
531
|
+
hideRemoveButton: disabled || hideTokenRemoveButtons,
|
|
532
|
+
size: size,
|
|
533
|
+
tabIndex: 0,
|
|
534
|
+
"data-component": "TextInputWithTokens.Token",
|
|
535
|
+
...tokenRest
|
|
536
|
+
}, id);
|
|
537
|
+
};
|
|
538
|
+
$[106] = TokenComponent;
|
|
539
|
+
$[107] = disabled;
|
|
540
|
+
$[108] = handleTokenBlur;
|
|
541
|
+
$[109] = handleTokenFocus;
|
|
542
|
+
$[110] = handleTokenRemove;
|
|
543
|
+
$[111] = hideTokenRemoveButtons;
|
|
544
|
+
$[112] = selectedTokenIndex;
|
|
545
|
+
$[113] = size;
|
|
546
|
+
$[114] = t38;
|
|
547
|
+
} else {
|
|
548
|
+
t38 = $[114];
|
|
549
|
+
}
|
|
550
|
+
t37 = visibleTokens.map(t38);
|
|
551
|
+
$[96] = TokenComponent;
|
|
552
|
+
$[97] = disabled;
|
|
553
|
+
$[98] = handleTokenBlur;
|
|
554
|
+
$[99] = handleTokenFocus;
|
|
555
|
+
$[100] = handleTokenRemove;
|
|
556
|
+
$[101] = hideTokenRemoveButtons;
|
|
557
|
+
$[102] = selectedTokenIndex;
|
|
558
|
+
$[103] = size;
|
|
559
|
+
$[104] = visibleTokens;
|
|
560
|
+
$[105] = t37;
|
|
561
|
+
} else {
|
|
562
|
+
t37 = $[105];
|
|
563
|
+
}
|
|
564
|
+
let t38;
|
|
565
|
+
if ($[115] !== size || $[116] !== tokens.length || $[117] !== tokensAreTruncated || $[118] !== visibleTokens.length) {
|
|
566
|
+
t38 = tokensAreTruncated && tokens.length - visibleTokens.length ? /*#__PURE__*/jsxs(Text, {
|
|
567
|
+
className: overflowCountClassMap[size],
|
|
568
|
+
"data-component": "TextInputWithTokens.OverflowCount",
|
|
569
|
+
children: ["+", tokens.length - visibleTokens.length]
|
|
570
|
+
}) : null;
|
|
571
|
+
$[115] = size;
|
|
572
|
+
$[116] = tokens.length;
|
|
573
|
+
$[117] = tokensAreTruncated;
|
|
574
|
+
$[118] = visibleTokens.length;
|
|
575
|
+
$[119] = t38;
|
|
576
|
+
} else {
|
|
577
|
+
t38 = $[119];
|
|
578
|
+
}
|
|
579
|
+
let t39;
|
|
580
|
+
if ($[120] !== preventTokenWrapping || $[121] !== t31 || $[122] !== t36 || $[123] !== t37 || $[124] !== t38) {
|
|
581
|
+
t39 = /*#__PURE__*/jsxs("div", {
|
|
582
|
+
ref: t31,
|
|
583
|
+
className: styles.Container,
|
|
584
|
+
"data-prevent-token-wrapping": preventTokenWrapping,
|
|
585
|
+
children: [t36, t37, t38]
|
|
586
|
+
});
|
|
587
|
+
$[120] = preventTokenWrapping;
|
|
588
|
+
$[121] = t31;
|
|
589
|
+
$[122] = t36;
|
|
590
|
+
$[123] = t37;
|
|
591
|
+
$[124] = t38;
|
|
592
|
+
$[125] = t39;
|
|
593
|
+
} else {
|
|
594
|
+
t39 = $[125];
|
|
595
|
+
}
|
|
596
|
+
const t40 = typeof loading === "boolean";
|
|
597
|
+
let t41;
|
|
598
|
+
if ($[126] !== TrailingVisual) {
|
|
599
|
+
t41 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual;
|
|
600
|
+
$[126] = TrailingVisual;
|
|
601
|
+
$[127] = t41;
|
|
602
|
+
} else {
|
|
603
|
+
t41 = $[127];
|
|
604
|
+
}
|
|
605
|
+
let t42;
|
|
606
|
+
if ($[128] !== showTrailingLoadingIndicator || $[129] !== t40 || $[130] !== t41) {
|
|
607
|
+
t42 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
|
|
608
|
+
hasLoadingIndicator: t40,
|
|
609
|
+
visualPosition: "trailing",
|
|
610
|
+
showLoadingIndicator: showTrailingLoadingIndicator,
|
|
611
|
+
componentPrefix: "TextInputWithTokens",
|
|
612
|
+
children: t41
|
|
613
|
+
});
|
|
614
|
+
$[128] = showTrailingLoadingIndicator;
|
|
615
|
+
$[129] = t40;
|
|
616
|
+
$[130] = t41;
|
|
617
|
+
$[131] = t42;
|
|
618
|
+
} else {
|
|
619
|
+
t42 = $[131];
|
|
620
|
+
}
|
|
621
|
+
let t43;
|
|
622
|
+
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) {
|
|
623
|
+
t43 = /*#__PURE__*/jsxs(TextInputWrapper, {
|
|
624
|
+
block: block,
|
|
625
|
+
contrast: contrast,
|
|
626
|
+
disabled: disabled,
|
|
627
|
+
hasLeadingVisual: t21,
|
|
628
|
+
hasTrailingVisual: t22,
|
|
629
|
+
width: widthProp,
|
|
630
|
+
minWidth: minWidthProp,
|
|
631
|
+
maxWidth: maxWidthProp,
|
|
632
|
+
size: t23,
|
|
633
|
+
validationStatus: validationStatus,
|
|
634
|
+
variant: variantProp,
|
|
635
|
+
onClick: focusInput,
|
|
636
|
+
"data-token-wrapping": t24,
|
|
637
|
+
className: t25,
|
|
638
|
+
style: t26,
|
|
639
|
+
"data-component": "TextInputWithTokens",
|
|
640
|
+
children: [t27, t30, t39, t42]
|
|
641
|
+
});
|
|
642
|
+
$[132] = block;
|
|
643
|
+
$[133] = contrast;
|
|
644
|
+
$[134] = disabled;
|
|
645
|
+
$[135] = maxWidthProp;
|
|
646
|
+
$[136] = minWidthProp;
|
|
647
|
+
$[137] = t21;
|
|
648
|
+
$[138] = t22;
|
|
649
|
+
$[139] = t23;
|
|
650
|
+
$[140] = t24;
|
|
651
|
+
$[141] = t25;
|
|
652
|
+
$[142] = t26;
|
|
653
|
+
$[143] = t27;
|
|
654
|
+
$[144] = t30;
|
|
655
|
+
$[145] = t39;
|
|
656
|
+
$[146] = t42;
|
|
657
|
+
$[147] = validationStatus;
|
|
658
|
+
$[148] = variantProp;
|
|
659
|
+
$[149] = widthProp;
|
|
660
|
+
$[150] = t43;
|
|
661
|
+
} else {
|
|
662
|
+
t43 = $[150];
|
|
663
|
+
}
|
|
664
|
+
return t43;
|
|
561
665
|
}
|
|
562
666
|
function _temp5(event_2) {
|
|
563
|
-
|
|
667
|
+
event_2.stopPropagation();
|
|
564
668
|
}
|
|
565
669
|
function _temp4(el) {
|
|
566
|
-
|
|
670
|
+
return isFocusable(el);
|
|
567
671
|
}
|
|
568
672
|
function _temp3(element) {
|
|
569
|
-
|
|
673
|
+
return !element.getAttributeNames().includes("aria-hidden");
|
|
570
674
|
}
|
|
571
675
|
function _temp2(tokenText) {
|
|
572
|
-
|
|
676
|
+
return tokenText !== null;
|
|
573
677
|
}
|
|
574
678
|
function _temp(token) {
|
|
575
|
-
|
|
576
|
-
|
|
679
|
+
if ("text" in token && typeof token.text === "string" && token.text.trim().length) {
|
|
680
|
+
return token.text;
|
|
681
|
+
}
|
|
682
|
+
return null;
|
|
577
683
|
}
|
|
578
|
-
const TextInputWithTokens =
|
|
579
|
-
TextInputWithTokens.displayName =
|
|
580
|
-
TextInputWithTokens.__SLOT__ = Symbol(
|
|
581
|
-
|
|
684
|
+
const TextInputWithTokens = /*#__PURE__*/React.forwardRef(TextInputWithTokensInnerComponent);
|
|
685
|
+
TextInputWithTokens.displayName = 'TextInputWithTokens';
|
|
686
|
+
TextInputWithTokens.__SLOT__ = Symbol('TextInputWithTokens');
|
|
687
|
+
|
|
582
688
|
export { TextInputWithTokens as default };
|