twenty-ui 2.48.0 → 2.50.0
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 +18 -0
- package/README.md +27 -2
- package/dist/Button-CU8BS-Yd.js +75 -0
- package/dist/Button-iVyxlrwO.cjs +1 -0
- package/dist/Dropdown-ChTVyesF.js +1018 -0
- package/dist/Dropdown-DlItz8Gh.cjs +1 -0
- package/dist/Heading-CHvEXL6n.cjs +1 -0
- package/dist/{Heading-pXllCJCO.js → Heading-Nj5BlPqB.js} +3 -3
- package/dist/{ListItem-CHTR-GLd.cjs → ListItem-C6Xl00m1.cjs} +1 -1
- package/dist/{ListItem-CjnrSbka.js → ListItem-C84ANa76.js} +2 -2
- package/dist/{OverflowingTextWithTooltip-Z2daM0_x.cjs → OverflowingTextWithTooltip-BQmpPObX.cjs} +1 -1
- package/dist/{OverflowingTextWithTooltip-BmUROIah.js → OverflowingTextWithTooltip-BtB9cGdJ.js} +20 -21
- package/dist/ProgressBar-CzGs7cuE.cjs +1 -0
- package/dist/ProgressBar-D4tKQ7OA.js +84 -0
- package/dist/{Radio-DMI1B7o5.js → Radio-BwBZ4e8g.js} +29 -29
- package/dist/{Radio-xmHgGHQO.cjs → Radio-sIYxZnR_.cjs} +1 -1
- package/dist/ResizeHandle-B1MuHTNA.cjs +1 -0
- package/dist/{ResizeHandle-C1kQ3MYR.js → ResizeHandle-B30OYZxS.js} +56 -55
- package/dist/Shortcut-Bp9iDdQg.js +73 -0
- package/dist/Shortcut-N8TELGPI.cjs +1 -0
- package/dist/TabsTabContent-6rkARU9F.cjs +1 -0
- package/dist/TabsTabContent-DPkLTBi2.js +39 -0
- package/dist/Tooltip-6uS8_wdA.js +132 -0
- package/dist/Tooltip-DL3sfbuw.cjs +1 -0
- package/dist/components/__stories__/reading-direction/DirectionalLayoutExample.d.ts +3 -1
- package/dist/components/code-editor.cjs +1 -1
- package/dist/components/code-editor.mjs +52 -51
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +6 -7
- package/dist/components/feedback/InlineBanner/InlineBanner.d.ts +2 -2
- package/dist/components/feedback/InlineBanner/internal/InlineBannerComponent.d.ts +1 -1
- package/dist/components/feedback/InlineBanner/types/InlineBannerProps.d.ts +1 -0
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/CountrySelect/CountrySelect.d.ts +5 -2
- package/dist/components/input/CountrySelect/__stories__/CountrySelectPartsExample.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectComponent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContext.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContextValue.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectDropdown.d.ts +4 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectOptions.d.ts +2 -11
- package/dist/components/input/CountrySelect/internal/CountrySelectOptionsContent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectRoot.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectTrigger.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/NO_COUNTRY_SELECTION_VALUE.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/PreparedCountryChoice.d.ts +5 -0
- package/dist/components/input/CountrySelect/internal/getCountrySelectionValue.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/useCountrySelectContextOrThrow.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountryChoice.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsProps.d.ts +10 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsState.d.ts +4 -0
- package/dist/components/input/CountrySelect/types/CountrySelectProps.d.ts +7 -13
- package/dist/components/input/CountrySelect/types/CountrySelectRootProps.d.ts +12 -0
- package/dist/components/input/CountrySelect/types/CountrySelectTriggerProps.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/CurrencyPicker.d.ts +4 -3
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerChangingDefaultExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledSearchExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerExample.d.ts +3 -4
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerListLabelExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerRootStateExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerContext.d.ts +11 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerOptions.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerRoot.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerShorthand.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerTrigger.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/PreparedCurrencyPickerOption.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/internal/getCurrencyPickerSearchText.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/useCurrencyPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerChangeEventDetails.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOption.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOptionsProps.d.ts +6 -5
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerProps.d.ts +10 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerRootProps.d.ts +17 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerState.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerTriggerProps.d.ts +3 -2
- package/dist/components/input/IconButton/__stories__/IconButtonExample.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/PhoneCountryPicker.d.ts +5 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/PhoneCountryPickerExample.d.ts +7 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/testDisabledPhoneCountryPicker.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryCallingCodeDirection.d.ts +3 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryNullSelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountrySelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerContext.d.ts +9 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerOptions.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerRoot.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerTrigger.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PreparedPhoneCountryOption.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/getPhoneCountryOptionTooltipLabel.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/matchesPhoneCountrySearch.d.ts +6 -0
- package/dist/components/input/PhoneCountryPicker/internal/usePhoneCountryPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryOption.d.ts +1 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerOptionsProps.d.ts +4 -5
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerProps.d.ts +10 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerRootProps.d.ts +12 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerTriggerProps.d.ts +1 -3
- package/dist/components/input/SegmentedControl/types/SegmentedControlProps.d.ts +1 -1
- package/dist/components/input/index.d.ts +10 -0
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +13 -13
- package/dist/components/layout/OverflowingList/internal/measureItemWidths.d.ts +1 -2
- package/dist/components/layout/OverflowingList/internal/measureOverflowingListLayout.d.ts +1 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +3 -2
- package/dist/components/navigation/Dropdown/__stories__/DropdownIconGridExample.d.ts +3 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownSelectionGroupsExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +6 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItem.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItemOwner.d.ts +7 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSearch.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownSearchEffect.d.ts +8 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContext.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContextValue.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroup.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroupEffect.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/createDropdownSelectionEventDetails.d.ts +5 -0
- package/dist/components/navigation/Dropdown/internal/dropdownItemActivation.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownItemExplicitId.d.ts +2 -2
- package/dist/components/navigation/Dropdown/internal/getDropdownOptionItemRole.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownSelectionGroupState.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/getTrailingFocusGuard.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/isDropdownOptionItemSelected.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/useDropdownSelections.d.ts +12 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemProps.d.ts +7 -2
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemSelectEventDetails.d.ts +2 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemState.d.ts +5 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupChangeEventDetails.d.ts +7 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupProps.d.ts +21 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupState.d.ts +7 -0
- package/dist/components/navigation/index.d.ts +5 -11
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +6 -11
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +37 -43
- package/dist/data-display-C-eoJ5En.js +378 -0
- package/dist/data-display-CM1yXpnE.cjs +2 -0
- package/dist/data-display-CXw-mxeS.js +252 -0
- package/dist/data-display-DdES9XqZ.cjs +1 -0
- package/dist/doNotTranslate-BSVT8Xyd.js +4 -0
- package/dist/doNotTranslate-CHE7WmRS.cjs +1 -0
- package/dist/feedback-4HKPcMRs.js +666 -0
- package/dist/feedback-BSOWDBI0.js +38 -0
- package/dist/feedback-DBRXDPSP.cjs +1 -0
- package/dist/feedback-DspXawf9.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +625 -631
- package/dist/input-CWWp7cqL.cjs +1 -0
- package/dist/input-CvZ_uB_9.cjs +1 -0
- package/dist/input-Qn5_aFYU.js +785 -0
- package/dist/input-k5cMhFI_.js +428 -0
- package/dist/layout-DDqeMgFv.js +439 -0
- package/dist/layout-iSfGrMrH.cjs +1 -0
- package/dist/navigation-7Y6gHFlj.cjs +1 -0
- package/dist/navigation-BY8X2w04.js +132 -0
- package/dist/navigation-BcXCiLE1.js +86 -0
- package/dist/navigation-ByYN6NgX.cjs +1 -0
- package/dist/normalizeSearchText-DLmPiBUZ.js +19 -0
- package/dist/normalizeSearchText-Do0MELpQ.cjs +1 -0
- package/dist/preventDismissingClickActivation-BEBrL9aB.cjs +1 -0
- package/dist/preventDismissingClickActivation-BQFMKRey.js +29 -0
- package/dist/primitives/accessibility.cjs +1 -1
- package/dist/primitives/accessibility.mjs +1 -1
- package/dist/primitives/data-display/Avatar/constants/AvatarPropertiesBySize.d.ts +4 -0
- package/dist/primitives/data-display/Avatar/types/AvatarSize.d.ts +1 -1
- package/dist/primitives/data-display/Badge/types/BadgeColor.d.ts +1 -1
- package/dist/primitives/data-display/Chip/types/ChipVariant.d.ts +1 -1
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +7 -8
- package/dist/primitives/feedback/Banner/Banner.d.ts +1 -1
- package/dist/primitives/feedback/Banner/internal/BannerAction.d.ts +1 -1
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +2 -2
- package/dist/primitives/input/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/internal/AutocompleteInput.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/types/AutocompleteInputProps.d.ts +8 -1
- package/dist/primitives/input/Button/types/ButtonColor.d.ts +1 -1
- package/dist/primitives/input/Radio/__stories__/RadioCardContent.d.ts +8 -0
- package/dist/primitives/input/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/types/RadioGroupProps.d.ts +3 -1
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +3 -3
- package/dist/primitives/layout/ResizeHandle/__stories__/ResizableNotesExample.d.ts +2 -0
- package/dist/primitives/layout.cjs +1 -1
- package/dist/primitives/layout.mjs +1 -1
- package/dist/primitives/navigation/Tabs/types/TabsSize.d.ts +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/surfaces/Card/Card.d.ts +1 -1
- package/dist/primitives/surfaces/Card/internal/CardRoot.d.ts +1 -1
- package/dist/primitives/surfaces/Card/types/CardRootProps.d.ts +0 -1
- package/dist/primitives/surfaces/Tooltip/Tooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/__stories__/findTooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/internal/TooltipBody.d.ts +2 -8
- package/dist/primitives/surfaces/Tooltip/types/TooltipBodyProps.d.ts +6 -0
- package/dist/primitives/surfaces/index.d.ts +1 -0
- package/dist/primitives/surfaces.cjs +1 -1
- package/dist/primitives/surfaces.mjs +2 -2
- package/dist/primitives/typography/Heading/types/HeadingProps.d.ts +1 -1
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +4 -4
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +46 -47
- package/dist/{settings-BAYsnlZJ.cjs → settings-DT5bEO6A.cjs} +1 -1
- package/dist/{settings-BjEZiHXE.js → settings-XGSJtobU.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/surfaces-q8voTXEJ.cjs +1 -0
- package/dist/{surfaces-BLsR5ka0.js → surfaces-vhSZBmbz.js} +77 -78
- package/dist/testing/GroupedCatalog.d.ts +14 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/utils/waitForStorybookFontsLoaded.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +102 -62
- package/dist/{typography-fOTFr0jS.js → typography-BPdXzW2T.js} +2 -2
- package/dist/{typography-B5QEuPaL.cjs → typography-CWtuNruY.cjs} +1 -1
- package/dist/useIsMobile-Byp9AIq-.cjs +1 -0
- package/dist/useIsMobile-D1ImfQnE.js +38 -0
- package/dist/utilities/internal/doNotTranslate.d.ts +1 -0
- package/dist/utilities-BKCMZyqZ.js +53 -0
- package/dist/utilities-xZh8D2gd.cjs +1 -0
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +11 -10
- package/package.json +3 -3
- package/dist/Avatar-CQhIEazb.cjs +0 -1
- package/dist/Avatar-D-QA0RE5.js +0 -72
- package/dist/Button-D5enZ0Qz.js +0 -72
- package/dist/Button-Dbi5P05r.cjs +0 -1
- package/dist/Dropdown-BKjAaZS0.cjs +0 -1
- package/dist/Dropdown-C2hXrjvD.js +0 -820
- package/dist/Heading-CTRYClCO.cjs +0 -1
- package/dist/ProgressBar-BvT1dyFo.js +0 -84
- package/dist/ProgressBar-DfFz0fFB.cjs +0 -1
- package/dist/ResizeHandle-DI4LHIQm.cjs +0 -1
- package/dist/Shortcut-BvWUZ3pb.js +0 -72
- package/dist/Shortcut-CgrdLv_L.cjs +0 -1
- package/dist/TabsTabContent-Co27Y2TU.cjs +0 -1
- package/dist/TabsTabContent-DVcObDp6.js +0 -39
- package/dist/TintedIconTile-4BGa8g8n.js +0 -40
- package/dist/TintedIconTile-CU2hCerq.cjs +0 -1
- package/dist/Tooltip-Bg9Uk01p.cjs +0 -1
- package/dist/Tooltip-cLCgtFBF.js +0 -124
- package/dist/components/navigation/MenuItem/MenuItem.d.ts +0 -2
- package/dist/components/navigation/MenuItem/parts/MenuItemIcon.d.ts +0 -9
- package/dist/components/navigation/MenuItem/parts/MenuItemIconBoxContainer.d.ts +0 -7
- package/dist/components/navigation/MenuItem/parts/MenuItemIconWithGripSwap.d.ts +0 -8
- package/dist/components/navigation/MenuItem/parts/MenuItemLeftContent.d.ts +0 -19
- package/dist/components/navigation/MenuItem/parts/StyledMenuItemBase.d.ts +0 -25
- package/dist/components/navigation/MenuItem/types/MenuItemDraggableGripMode.d.ts +0 -1
- package/dist/components/navigation/MenuItem/types/MenuItemProps.d.ts +0 -33
- package/dist/components/navigation/MenuItemAvatar/MenuItemAvatar.d.ts +0 -2
- package/dist/components/navigation/MenuItemAvatar/types/MenuItemAvatarProps.d.ts +0 -18
- package/dist/components/navigation/MenuItemDraggable/MenuItemDraggable.d.ts +0 -2
- package/dist/components/navigation/MenuItemDraggable/types/MenuItemDraggableProps.d.ts +0 -20
- package/dist/components/navigation/MenuItemSuggestion/MenuItemSuggestion.d.ts +0 -2
- package/dist/components/navigation/MenuItemSuggestion/types/MenuItemSuggestionProps.d.ts +0 -12
- package/dist/components/navigation/MenuPicker/MenuPicker.d.ts +0 -2
- package/dist/components/navigation/MenuPicker/types/MenuPickerProps.d.ts +0 -15
- package/dist/data-display-0QO_WDSs.js +0 -183
- package/dist/data-display-CPmTJAWJ.cjs +0 -1
- package/dist/data-display-DjhAHvj1.cjs +0 -2
- package/dist/data-display-KyZbLLy-.js +0 -344
- package/dist/feedback-CM6fatE8.js +0 -664
- package/dist/feedback-DA-AU5z5.js +0 -38
- package/dist/feedback-DNLERYY9.cjs +0 -1
- package/dist/feedback-ybO4n69s.cjs +0 -1
- package/dist/input-3D2lXywH.cjs +0 -1
- package/dist/input-CJDYNwoO.cjs +0 -1
- package/dist/input-DRpDiMRi.js +0 -421
- package/dist/input-TM3nUdu6.js +0 -554
- package/dist/layout-BszCDxAO.js +0 -441
- package/dist/layout-VaIq7Sjr.cjs +0 -1
- package/dist/navigation-B1SRvzKK.js +0 -403
- package/dist/navigation-CYAs2LnR.js +0 -131
- package/dist/navigation-CthkGHJ8.cjs +0 -1
- package/dist/navigation-DrOV5E67.cjs +0 -1
- package/dist/preventDismissingClickActivation-CzWqpjiX.js +0 -44
- package/dist/preventDismissingClickActivation-DZxTSLV3.cjs +0 -1
- package/dist/surfaces-0rL5DoHt.cjs +0 -1
- package/dist/useIsMobile-DxOPI2_E.cjs +0 -1
- package/dist/useIsMobile-nrufFzMb.js +0 -37
- package/dist/utilities-BeLfNQ0Q.cjs +0 -1
- package/dist/utilities-CEi9I09B.js +0 -52
- /package/dist/{handleClickableElementKeyDown-C8Uz61XJ.js → accessibility-C8Uz61XJ.js} +0 -0
- /package/dist/{handleClickableElementKeyDown-CByqtBhO.cjs → accessibility-CByqtBhO.cjs} +0 -0
package/dist/layout-BszCDxAO.js
DELETED
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
import { t as v } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
-
import { r as we, t as Fe } from "./OverflowingTextWithTooltip-BmUROIah.js";
|
|
3
|
-
import { t as V } from "./Popover-CWeCV7X9.js";
|
|
4
|
-
import { t as Ce } from "./Heading-pXllCJCO.js";
|
|
5
|
-
import { useRender as Y } from "@base-ui/react/use-render";
|
|
6
|
-
import { isFunction as Q, isNonEmptyString as Ie, isString as J, isUndefined as Oe } from "@sniptt/guards";
|
|
7
|
-
import { clsx as D } from "clsx";
|
|
8
|
-
import { cloneElement as Le, isValidElement as Ee, memo as ce, useCallback as j, useId as Ne, useLayoutEffect as X, useRef as W, useState as $ } from "react";
|
|
9
|
-
import { Fragment as G, jsx as m, jsxs as U } from "react/jsx-runtime";
|
|
10
|
-
import { mergeProps as Se } from "@base-ui/react/merge-props";
|
|
11
|
-
import { useMergedRefs as H } from "@base-ui/utils/useMergedRefs";
|
|
12
|
-
import { useStableCallback as k } from "@base-ui/utils/useStableCallback";
|
|
13
|
-
import { useControlled as Me } from "@base-ui/utils/useControlled";
|
|
14
|
-
var De = "_container_1hm4x_1", Te = "_layer_1hm4x_9", xe = "_visible_1hm4x_23", Ae = "_hidden_1hm4x_28", R = {
|
|
15
|
-
container: De,
|
|
16
|
-
layer: Te,
|
|
17
|
-
visible: xe,
|
|
18
|
-
hidden: Ae
|
|
19
|
-
}, _t = ({ isActive: t, activeIcon: e, inactiveIcon: n, className: r, render: s, ref: a, ...l }) => Y({
|
|
20
|
-
defaultTagName: "span",
|
|
21
|
-
render: s,
|
|
22
|
-
ref: a,
|
|
23
|
-
props: {
|
|
24
|
-
...l,
|
|
25
|
-
className: D(R.container, r),
|
|
26
|
-
children: /* @__PURE__ */ U(G, { children: [/* @__PURE__ */ m("span", {
|
|
27
|
-
"aria-hidden": "true",
|
|
28
|
-
className: D(R.layer, t ? R.hidden : R.visible),
|
|
29
|
-
children: n
|
|
30
|
-
}), /* @__PURE__ */ m("span", {
|
|
31
|
-
"aria-hidden": "true",
|
|
32
|
-
className: D(R.layer, t ? R.visible : R.hidden),
|
|
33
|
-
children: e
|
|
34
|
-
})] })
|
|
35
|
-
}
|
|
36
|
-
}), Re = "_root_eheyl_1", We = "_items_eheyl_11", Ue = "_item_eheyl_11", ke = "_popupItem_eheyl_45", ze = "_trigger_eheyl_49", Ke = "_popup_eheyl_45", K = {
|
|
37
|
-
root: Re,
|
|
38
|
-
items: We,
|
|
39
|
-
item: Ue,
|
|
40
|
-
popupItem: ke,
|
|
41
|
-
trigger: ze,
|
|
42
|
-
popup: Ke
|
|
43
|
-
}, Ve = ({ props: t, state: e, render: n }) => {
|
|
44
|
-
const r = Ee(n) ? n : void 0, s = H(t.ref, r?.props.ref);
|
|
45
|
-
if (Q(n)) return n(t, e);
|
|
46
|
-
const a = {
|
|
47
|
-
...Se(t, r?.props),
|
|
48
|
-
children: t.children,
|
|
49
|
-
ref: s
|
|
50
|
-
};
|
|
51
|
-
return v(r) ? Le(r, a) : /* @__PURE__ */ m("div", { ...a });
|
|
52
|
-
}, Be = ce(({ elementRef: t, isHidden: e, onFocusLost: n }) => (X(() => {
|
|
53
|
-
const r = t.current, s = v(r) && r.contains(r.ownerDocument.activeElement);
|
|
54
|
-
e && s && n(r);
|
|
55
|
-
}, [
|
|
56
|
-
t,
|
|
57
|
-
e,
|
|
58
|
-
n
|
|
59
|
-
]), null)), le = (t) => j((e) => {
|
|
60
|
-
if (v(e))
|
|
61
|
-
return () => {
|
|
62
|
-
const n = e.ownerDocument, r = e.contains(n.activeElement);
|
|
63
|
-
queueMicrotask(() => {
|
|
64
|
-
const s = n.activeElement === n.body;
|
|
65
|
-
r && !e.isConnected && s && t(e);
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
}, [t]), oe = ({ children: t, index: e, isHidden: n, isLastVisible: r, isInPopup: s, onFocusLost: a }) => {
|
|
69
|
-
const l = W(null), i = k((o) => {
|
|
70
|
-
a({
|
|
71
|
-
index: e,
|
|
72
|
-
element: o,
|
|
73
|
-
isInPopup: s
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return /* @__PURE__ */ U(G, { children: [/* @__PURE__ */ m("div", {
|
|
77
|
-
ref: H(l, le(i)),
|
|
78
|
-
className: s ? K.popupItem : K.item,
|
|
79
|
-
"data-item-index": e,
|
|
80
|
-
"data-hidden": n || void 0,
|
|
81
|
-
"data-last-visible": r || void 0,
|
|
82
|
-
"aria-hidden": n || void 0,
|
|
83
|
-
inert: n,
|
|
84
|
-
children: t
|
|
85
|
-
}), /* @__PURE__ */ m(Be, {
|
|
86
|
-
elementRef: l,
|
|
87
|
-
isHidden: n,
|
|
88
|
-
onFocusLost: i
|
|
89
|
-
})] });
|
|
90
|
-
}, se = ({ itemWidths: t, availableWidth: e, gap: n, includePartialItem: r }) => {
|
|
91
|
-
let s = 0, a = 0;
|
|
92
|
-
for (const l of t) {
|
|
93
|
-
const i = s + l + (a > 0 ? n : 0);
|
|
94
|
-
if (a !== 0 && i > e) {
|
|
95
|
-
const o = s + n < e;
|
|
96
|
-
return r && o ? a + 1 : a;
|
|
97
|
-
}
|
|
98
|
-
s = i, a += 1;
|
|
99
|
-
}
|
|
100
|
-
return a;
|
|
101
|
-
}, He = ({ items: t, itemElements: e, supportsSynchronousLayout: n }) => {
|
|
102
|
-
if (!n) return e.map((s) => s.scrollWidth);
|
|
103
|
-
t.setAttribute("data-measuring", "");
|
|
104
|
-
const r = e.map((s) => s.clientWidth);
|
|
105
|
-
return t.removeAttribute("data-measuring"), r;
|
|
106
|
-
}, $e = ({ container: t, items: e, trigger: n, itemElements: r, itemCount: s, reserveCountSpace: a, supportsSynchronousLayout: l }) => {
|
|
107
|
-
const i = He({
|
|
108
|
-
items: e,
|
|
109
|
-
itemElements: r,
|
|
110
|
-
supportsSynchronousLayout: l
|
|
111
|
-
}), o = parseFloat(getComputedStyle(e).columnGap) || 0, u = t.clientWidth, p = s > se({
|
|
112
|
-
itemWidths: i,
|
|
113
|
-
availableWidth: u,
|
|
114
|
-
gap: o,
|
|
115
|
-
includePartialItem: !1
|
|
116
|
-
}), F = n?.offsetWidth ?? 0;
|
|
117
|
-
return {
|
|
118
|
-
visibleItemCount: se({
|
|
119
|
-
itemWidths: i,
|
|
120
|
-
availableWidth: a && p ? Math.max(0, u - F - o) : u,
|
|
121
|
-
gap: o,
|
|
122
|
-
includePartialItem: !0
|
|
123
|
-
}),
|
|
124
|
-
hasOverflow: p
|
|
125
|
-
};
|
|
126
|
-
}, qe = 100, je = ce(({ containerRef: t, itemsRef: e, triggerRef: n, itemCount: r, inlineItemCount: s, reserveCountSpace: a, isMeasurementEnabled: l, isOpen: i, onLayoutChange: o, onOverflowUnavailable: u }) => {
|
|
127
|
-
const p = W(void 0), F = W(void 0), I = k(() => ({
|
|
128
|
-
itemCount: r,
|
|
129
|
-
inlineItemCount: s,
|
|
130
|
-
reserveCountSpace: a,
|
|
131
|
-
isOpen: i
|
|
132
|
-
})), C = k(o), N = k(u);
|
|
133
|
-
return X(() => {
|
|
134
|
-
const y = t.current, O = e.current;
|
|
135
|
-
if (!l || !v(y) || !v(O)) {
|
|
136
|
-
F.current = void 0;
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
const T = v(globalThis.ResizeObserver), E = /* @__PURE__ */ new Set(), g = () => {
|
|
140
|
-
const M = Array.from(O.children), z = /* @__PURE__ */ new Set([y, ...M]);
|
|
141
|
-
v(n.current) && z.add(n.current);
|
|
142
|
-
for (const b of E) z.has(b) || (S?.unobserve(b), E.delete(b));
|
|
143
|
-
for (const b of z) E.has(b) || (S?.observe(b), E.add(b));
|
|
144
|
-
const c = I();
|
|
145
|
-
if (M.length !== c.inlineItemCount) return;
|
|
146
|
-
const h = $e({
|
|
147
|
-
container: y,
|
|
148
|
-
items: O,
|
|
149
|
-
trigger: n.current,
|
|
150
|
-
itemElements: M,
|
|
151
|
-
itemCount: c.itemCount,
|
|
152
|
-
reserveCountSpace: c.reserveCountSpace,
|
|
153
|
-
supportsSynchronousLayout: T
|
|
154
|
-
}), d = F.current, x = v(d) && d.isOpen && !d.layout.hasOverflow, A = c.isOpen && !h.hasOverflow;
|
|
155
|
-
F.current = {
|
|
156
|
-
layout: h,
|
|
157
|
-
isOpen: c.isOpen
|
|
158
|
-
}, C(h), A && !x && N();
|
|
159
|
-
}, S = T ? new ResizeObserver(g) : void 0;
|
|
160
|
-
p.current = g, g();
|
|
161
|
-
const _ = new MutationObserver(g);
|
|
162
|
-
if (_.observe(O, {
|
|
163
|
-
attributes: !0,
|
|
164
|
-
attributeFilter: [
|
|
165
|
-
"class",
|
|
166
|
-
"style",
|
|
167
|
-
"hidden"
|
|
168
|
-
],
|
|
169
|
-
characterData: !0,
|
|
170
|
-
childList: !0,
|
|
171
|
-
subtree: !0
|
|
172
|
-
}), _.observe(y, { childList: !0 }), !v(S)) {
|
|
173
|
-
const M = setInterval(g, qe);
|
|
174
|
-
return window.addEventListener("resize", g), () => {
|
|
175
|
-
p.current = void 0, clearInterval(M), _.disconnect(), window.removeEventListener("resize", g);
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
return () => {
|
|
179
|
-
p.current = void 0, _.disconnect(), S.disconnect();
|
|
180
|
-
};
|
|
181
|
-
}, [
|
|
182
|
-
t,
|
|
183
|
-
e,
|
|
184
|
-
n,
|
|
185
|
-
l,
|
|
186
|
-
I,
|
|
187
|
-
C,
|
|
188
|
-
N
|
|
189
|
-
]), X(() => {
|
|
190
|
-
p.current?.();
|
|
191
|
-
}, [
|
|
192
|
-
r,
|
|
193
|
-
s,
|
|
194
|
-
a,
|
|
195
|
-
i
|
|
196
|
-
]), null;
|
|
197
|
-
}), Ge = ({ itemCount: t, inlineItemCount: e }) => {
|
|
198
|
-
const n = W(null), r = W(null), s = W(null), [a, l] = $({
|
|
199
|
-
visibleItemCount: e,
|
|
200
|
-
hasOverflow: t > e
|
|
201
|
-
});
|
|
202
|
-
return {
|
|
203
|
-
containerRef: n,
|
|
204
|
-
itemsRef: r,
|
|
205
|
-
triggerRef: s,
|
|
206
|
-
updateLayout: j((i) => {
|
|
207
|
-
l((o) => o.visibleItemCount !== i.visibleItemCount || o.hasOverflow !== i.hasOverflow ? i : o);
|
|
208
|
-
}, []),
|
|
209
|
-
...a
|
|
210
|
-
};
|
|
211
|
-
}, Je = "button, a[href], input, select, textarea, [tabindex]", ae = ({ items: t, popup: e, trigger: n, root: r, removedIndex: s, excludedItem: a }) => {
|
|
212
|
-
const l = [...Array.from(t?.children ?? []), ...Array.from(e?.children ?? [])].filter((i) => i !== a).sort((i, o) => Math.abs(Number(i.getAttribute("data-item-index")) - s) - Math.abs(Number(o.getAttribute("data-item-index")) - s) || Number(o.getAttribute("data-item-index")) - Number(i.getAttribute("data-item-index")));
|
|
213
|
-
for (const i of l)
|
|
214
|
-
if (!i.hasAttribute("inert")) {
|
|
215
|
-
for (const o of Array.from(i.querySelectorAll(Je))) if (!o.matches(":disabled") && !v(o.closest("[inert]")) && (o.focus(), o.ownerDocument.activeElement === o))
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
n?.focus(), !(v(n) && n.ownerDocument.activeElement === n) && r?.focus();
|
|
219
|
-
}, Qe = ({ containerRef: t, itemsRef: e, triggerRef: n, popup: r, itemCount: s, canExpand: a, isPopupOpen: l, isOpen: i, isHovered: o, showOverflowCount: u, onFocusCapture: p, onBlurCapture: F }) => {
|
|
220
|
-
const [I, C] = $(!1), [N, y] = $(), O = u ?? N ?? (o || I || i), T = k(({ index: c, element: h, isInPopup: d }) => {
|
|
221
|
-
ae({
|
|
222
|
-
items: d && a ? null : e.current,
|
|
223
|
-
popup: d && l ? r : null,
|
|
224
|
-
trigger: n.current,
|
|
225
|
-
root: t.current,
|
|
226
|
-
removedIndex: c,
|
|
227
|
-
excludedItem: h
|
|
228
|
-
});
|
|
229
|
-
}), E = j(() => {
|
|
230
|
-
const c = t.current;
|
|
231
|
-
c?.focus(), C(c?.ownerDocument.activeElement === c), y(void 0);
|
|
232
|
-
}, [t]), g = k(() => {
|
|
233
|
-
if (l) return;
|
|
234
|
-
const c = t.current, h = c?.ownerDocument, d = h?.activeElement, x = v(d) && e.current?.contains(d) && !v(d.closest("[inert]")), A = v(d) && d !== h?.body && !c?.contains(d) && !r?.contains(d);
|
|
235
|
-
if (x || A) return;
|
|
236
|
-
if (!a) {
|
|
237
|
-
ae({
|
|
238
|
-
items: e.current,
|
|
239
|
-
popup: null,
|
|
240
|
-
trigger: null,
|
|
241
|
-
root: c,
|
|
242
|
-
removedIndex: s
|
|
243
|
-
});
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
const b = n.current;
|
|
247
|
-
if (v(b) && !b.matches(":disabled")) {
|
|
248
|
-
b.focus({ preventScroll: !0 });
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
c?.focus({ preventScroll: !0 });
|
|
252
|
-
}), S = j(() => (queueMicrotask(g), !1), [g]), _ = le(E);
|
|
253
|
-
return {
|
|
254
|
-
hasFocus: I,
|
|
255
|
-
isCountVisible: O,
|
|
256
|
-
restoreItemFocus: T,
|
|
257
|
-
schedulePopupFocusRestoration: S,
|
|
258
|
-
resetFocusWhenFocusedTriggerUnmounts: _,
|
|
259
|
-
handleFocusCapture: (c) => {
|
|
260
|
-
C(!0), e.current?.contains(c.target) && y((h) => h ?? O), p?.(c);
|
|
261
|
-
},
|
|
262
|
-
handleBlurCapture: (c) => {
|
|
263
|
-
C(c.currentTarget.contains(c.relatedTarget) || (r?.contains(c.relatedTarget) ?? !1)), e.current?.contains(c.relatedTarget) || y(void 0), F?.(c);
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
}, L = (t) => t.stopPropagation(), yt = ({ children: t, showOverflowCount: e, maxInlineCount: n, overflowLabel: r = "Show all items", open: s, defaultOpen: a = !1, onOpenChange: l, actionsRef: i, triggerProps: o, popupProps: u, className: p, onMouseEnter: F, onMouseLeave: I, onFocusCapture: C, onBlurCapture: N, ref: y, ...O }) => {
|
|
267
|
-
const [T, E] = $(!1), [g, S] = $(null), [_, M] = Me({
|
|
268
|
-
controlled: s,
|
|
269
|
-
default: a,
|
|
270
|
-
name: "OverflowingList",
|
|
271
|
-
state: "open"
|
|
272
|
-
}), z = W(null), c = i ?? z, h = v(n) && Number.isFinite(n) ? Math.min(t.length, Math.max(0, Math.floor(n))) : t.length, { containerRef: d, itemsRef: x, triggerRef: A, visibleItemCount: b, hasOverflow: ue, updateLayout: de } = Ge({
|
|
273
|
-
itemCount: t.length,
|
|
274
|
-
inlineItemCount: h
|
|
275
|
-
}), q = ue && (_ || e !== !1), Z = _ && q, { hasFocus: me, isCountVisible: P, restoreItemFocus: ee, schedulePopupFocusRestoration: fe, resetFocusWhenFocusedTriggerUnmounts: ve, handleFocusCapture: he, handleBlurCapture: be } = Qe({
|
|
276
|
-
containerRef: d,
|
|
277
|
-
itemsRef: x,
|
|
278
|
-
triggerRef: A,
|
|
279
|
-
popup: g,
|
|
280
|
-
itemCount: t.length,
|
|
281
|
-
canExpand: q,
|
|
282
|
-
isPopupOpen: Z,
|
|
283
|
-
isOpen: _,
|
|
284
|
-
isHovered: T,
|
|
285
|
-
showOverflowCount: e,
|
|
286
|
-
onFocusCapture: C,
|
|
287
|
-
onBlurCapture: N
|
|
288
|
-
}), te = (e ?? (T || me)) || _, pe = H(d, y), _e = H(A, ve, o?.ref), ye = H(S, u?.ref), ne = te && e !== !1 ? b : h, re = t.length - b, ge = k(() => {
|
|
289
|
-
c.current?.close();
|
|
290
|
-
});
|
|
291
|
-
return /* @__PURE__ */ U(G, { children: [/* @__PURE__ */ U("div", {
|
|
292
|
-
...O,
|
|
293
|
-
ref: pe,
|
|
294
|
-
tabIndex: O.tabIndex ?? -1,
|
|
295
|
-
className: D(K.root, p),
|
|
296
|
-
onMouseEnter: (f) => {
|
|
297
|
-
E(!0), F?.(f);
|
|
298
|
-
},
|
|
299
|
-
onMouseLeave: (f) => {
|
|
300
|
-
E(!1), I?.(f);
|
|
301
|
-
},
|
|
302
|
-
onFocusCapture: he,
|
|
303
|
-
onBlurCapture: be,
|
|
304
|
-
children: [/* @__PURE__ */ m("div", {
|
|
305
|
-
ref: x,
|
|
306
|
-
className: K.items,
|
|
307
|
-
children: t.slice(0, h).map((f, w) => /* @__PURE__ */ m(oe, {
|
|
308
|
-
index: w,
|
|
309
|
-
isHidden: w >= ne,
|
|
310
|
-
isLastVisible: e !== !1 && w === ne - 1,
|
|
311
|
-
isInPopup: !1,
|
|
312
|
-
onFocusLost: ee,
|
|
313
|
-
children: f
|
|
314
|
-
}, f.key ?? w))
|
|
315
|
-
}), (q || _) && /* @__PURE__ */ U(V.Root, {
|
|
316
|
-
open: Z,
|
|
317
|
-
actionsRef: c,
|
|
318
|
-
onOpenChange: (f, w) => {
|
|
319
|
-
l?.(f, w), w.isCanceled || M(f);
|
|
320
|
-
},
|
|
321
|
-
children: [q && /* @__PURE__ */ m(V.Trigger, {
|
|
322
|
-
type: "button",
|
|
323
|
-
"aria-label": `+${re} ${r}`,
|
|
324
|
-
...o,
|
|
325
|
-
onClick: o?.onClick ?? L,
|
|
326
|
-
onMouseDown: o?.onMouseDown ?? L,
|
|
327
|
-
onPointerDown: o?.onPointerDown ?? L,
|
|
328
|
-
onKeyDown: o?.onKeyDown ?? L,
|
|
329
|
-
onKeyUp: o?.onKeyUp ?? L,
|
|
330
|
-
ref: _e,
|
|
331
|
-
className: (f) => D(K.trigger, Q(o?.className) ? o.className(f) : o?.className),
|
|
332
|
-
"data-visible": P || void 0,
|
|
333
|
-
children: Oe(o?.children) ? `+${re}` : o.children
|
|
334
|
-
}), /* @__PURE__ */ m(V.Portal, { children: /* @__PURE__ */ m(V.Positioner, {
|
|
335
|
-
anchor: d,
|
|
336
|
-
align: "start",
|
|
337
|
-
sideOffset: -9,
|
|
338
|
-
alignOffset: -7,
|
|
339
|
-
children: /* @__PURE__ */ m(V.Popup, {
|
|
340
|
-
"aria-label": r,
|
|
341
|
-
...u,
|
|
342
|
-
onClick: u?.onClick ?? L,
|
|
343
|
-
onMouseDown: u?.onMouseDown ?? L,
|
|
344
|
-
onPointerDown: u?.onPointerDown ?? L,
|
|
345
|
-
onKeyDown: u?.onKeyDown ?? L,
|
|
346
|
-
onKeyUp: u?.onKeyUp ?? L,
|
|
347
|
-
ref: ye,
|
|
348
|
-
render: (f, w) => /* @__PURE__ */ m(Ve, {
|
|
349
|
-
props: f,
|
|
350
|
-
state: w,
|
|
351
|
-
render: u?.render
|
|
352
|
-
}),
|
|
353
|
-
finalFocus: u?.finalFocus ?? fe,
|
|
354
|
-
className: (f) => D(K.popup, Q(u?.className) ? u.className(f) : u?.className),
|
|
355
|
-
"data-overflowing-list-popup": "",
|
|
356
|
-
children: t.map((f, w) => /* @__PURE__ */ m(oe, {
|
|
357
|
-
index: w,
|
|
358
|
-
isHidden: !1,
|
|
359
|
-
isLastVisible: !1,
|
|
360
|
-
isInPopup: !0,
|
|
361
|
-
onFocusLost: ee,
|
|
362
|
-
children: f
|
|
363
|
-
}, f.key ?? w))
|
|
364
|
-
})
|
|
365
|
-
}) })]
|
|
366
|
-
})]
|
|
367
|
-
}), /* @__PURE__ */ m(je, {
|
|
368
|
-
containerRef: d,
|
|
369
|
-
itemsRef: x,
|
|
370
|
-
triggerRef: A,
|
|
371
|
-
itemCount: t.length,
|
|
372
|
-
inlineItemCount: h,
|
|
373
|
-
reserveCountSpace: P,
|
|
374
|
-
isMeasurementEnabled: te,
|
|
375
|
-
isOpen: _,
|
|
376
|
-
onLayoutChange: de,
|
|
377
|
-
onOverflowUnavailable: ge
|
|
378
|
-
})] });
|
|
379
|
-
}, Xe = "_header_1dz7y_1", Ye = "_titleRow_1dz7y_8", Ze = "_title_1dz7y_8", Pe = "_actions_1dz7y_21", et = "_description_1dz7y_27", B = {
|
|
380
|
-
header: Xe,
|
|
381
|
-
titleRow: Ye,
|
|
382
|
-
title: Ze,
|
|
383
|
-
actions: Pe,
|
|
384
|
-
description: et
|
|
385
|
-
}, tt = ({ title: t, description: e, actions: n, level: r = 2, size: s = "md", color: a = "primary", descriptionLineClamp: l = 5, isDescriptionFocusable: i = !1, render: o, ref: u, className: p, ...F }) => {
|
|
386
|
-
const I = Ne(), C = J(e) ? Ie(e) : v(e) && e !== !1, N = J(e) && l !== !1, y = J(e) ? /* @__PURE__ */ m(we, {
|
|
387
|
-
style: { whiteSpace: "pre-wrap" },
|
|
388
|
-
children: e
|
|
389
|
-
}) : e;
|
|
390
|
-
return Y({
|
|
391
|
-
render: o,
|
|
392
|
-
ref: u,
|
|
393
|
-
props: {
|
|
394
|
-
...F,
|
|
395
|
-
className: D(B.header, p),
|
|
396
|
-
children: /* @__PURE__ */ U(G, { children: [/* @__PURE__ */ U("div", {
|
|
397
|
-
className: B.titleRow,
|
|
398
|
-
children: [/* @__PURE__ */ m(Ce, {
|
|
399
|
-
level: r,
|
|
400
|
-
size: s,
|
|
401
|
-
color: a,
|
|
402
|
-
className: B.title,
|
|
403
|
-
"aria-describedby": C ? I : void 0,
|
|
404
|
-
children: t
|
|
405
|
-
}), v(n) && /* @__PURE__ */ m("div", {
|
|
406
|
-
className: B.actions,
|
|
407
|
-
children: n
|
|
408
|
-
})]
|
|
409
|
-
}), C && /* @__PURE__ */ m("div", {
|
|
410
|
-
id: I,
|
|
411
|
-
className: B.description,
|
|
412
|
-
children: N ? /* @__PURE__ */ m(Fe, {
|
|
413
|
-
text: e,
|
|
414
|
-
lineClamp: l,
|
|
415
|
-
isTooltipMultiline: !0,
|
|
416
|
-
isFocusable: i
|
|
417
|
-
}) : y
|
|
418
|
-
})] })
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
}, nt = "_root_ztxxm_1", rt = "_fullWidth_ztxxm_20", ie = {
|
|
422
|
-
root: nt,
|
|
423
|
-
fullWidth: rt
|
|
424
|
-
}, ot = ({ align: t = "left", color: e = "primary", fullWidth: n = !0, className: r, render: s, ref: a, ...l }) => Y({
|
|
425
|
-
render: s,
|
|
426
|
-
ref: a,
|
|
427
|
-
props: {
|
|
428
|
-
...l,
|
|
429
|
-
"data-align": t,
|
|
430
|
-
"data-color": e,
|
|
431
|
-
className: D(ie.root, n && ie.fullWidth, r)
|
|
432
|
-
}
|
|
433
|
-
}), gt = {
|
|
434
|
-
Root: ot,
|
|
435
|
-
Header: tt
|
|
436
|
-
};
|
|
437
|
-
export {
|
|
438
|
-
yt as n,
|
|
439
|
-
_t as r,
|
|
440
|
-
gt as t
|
|
441
|
-
};
|
package/dist/layout-VaIq7Sjr.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const h=require("./isDefined-DS2Q42p5.cjs"),Y=require("./OverflowingTextWithTooltip-Z2daM0_x.cjs"),z=require("./Popover-CneCJTvD.cjs"),he=require("./Heading-CTRYClCO.cjs");let H=require("@base-ui/react/use-render"),j=require("@sniptt/guards"),N=require("clsx"),d=require("react"),i=require("react/jsx-runtime"),be=require("@base-ui/react/merge-props"),V=require("@base-ui/utils/useMergedRefs"),q=require("@base-ui/utils/useStableCallback"),_e=require("@base-ui/utils/useControlled");var ge="_container_1hm4x_1",pe="_layer_1hm4x_9",ye="_visible_1hm4x_23",xe="_hidden_1hm4x_28",A={container:ge,layer:pe,visible:ye,hidden:xe},Ce=({isActive:t,activeIcon:e,inactiveIcon:n,className:s,render:o,ref:a,...u})=>(0,H.useRender)({defaultTagName:"span",render:o,ref:a,props:{...u,className:(0,N.clsx)(A.container,s),children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{"aria-hidden":"true",className:(0,N.clsx)(A.layer,t?A.hidden:A.visible),children:n}),(0,i.jsx)("span",{"aria-hidden":"true",className:(0,N.clsx)(A.layer,t?A.visible:A.hidden),children:e})]})}}),we="_root_eheyl_1",Fe="_items_eheyl_11",De="_item_eheyl_11",Ie="_popupItem_eheyl_45",Oe="_trigger_eheyl_49",Se="_popup_eheyl_45",U={root:we,items:Fe,item:De,popupItem:Ie,trigger:Oe,popup:Se},Le=({props:t,state:e,render:n})=>{const s=(0,d.isValidElement)(n)?n:void 0,o=(0,V.useMergedRefs)(t.ref,s?.props.ref);if((0,j.isFunction)(n))return n(t,e);const a={...(0,be.mergeProps)(t,s?.props),children:t.children,ref:o};return h.isDefined(s)?(0,d.cloneElement)(s,a):(0,i.jsx)("div",{...a})},Re=(0,d.memo)(({elementRef:t,isHidden:e,onFocusLost:n})=>((0,d.useLayoutEffect)(()=>{const s=t.current,o=h.isDefined(s)&&s.contains(s.ownerDocument.activeElement);e&&o&&n(s)},[t,e,n]),null)),se=t=>(0,d.useCallback)(e=>{if(h.isDefined(e))return()=>{const n=e.ownerDocument,s=e.contains(n.activeElement);queueMicrotask(()=>{const o=n.activeElement===n.body;s&&!e.isConnected&&o&&t(e)})}},[t]),Z=({children:t,index:e,isHidden:n,isLastVisible:s,isInPopup:o,onFocusLost:a})=>{const u=(0,d.useRef)(null),l=(0,q.useStableCallback)(r=>{a({index:e,element:r,isInPopup:o})});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:(0,V.useMergedRefs)(u,se(l)),className:o?U.popupItem:U.item,"data-item-index":e,"data-hidden":n||void 0,"data-last-visible":s||void 0,"aria-hidden":n||void 0,inert:n,children:t}),(0,i.jsx)(Re,{elementRef:u,isHidden:n,onFocusLost:l})]})},ee=({itemWidths:t,availableWidth:e,gap:n,includePartialItem:s})=>{let o=0,a=0;for(const u of t){const l=o+u+(a>0?n:0);if(a!==0&&l>e){const r=o+n<e;return s&&r?a+1:a}o=l,a+=1}return a},Ee=({items:t,itemElements:e,supportsSynchronousLayout:n})=>{if(!n)return e.map(o=>o.scrollWidth);t.setAttribute("data-measuring","");const s=e.map(o=>o.clientWidth);return t.removeAttribute("data-measuring"),s},je=({container:t,items:e,trigger:n,itemElements:s,itemCount:o,reserveCountSpace:a,supportsSynchronousLayout:u})=>{const l=Ee({items:e,itemElements:s,supportsSynchronousLayout:u}),r=parseFloat(getComputedStyle(e).columnGap)||0,f=t.clientWidth,g=o>ee({itemWidths:l,availableWidth:f,gap:r,includePartialItem:!1}),w=n?.offsetWidth??0;return{visibleItemCount:ee({itemWidths:l,availableWidth:a&&g?Math.max(0,f-w-r):f,gap:r,includePartialItem:!0}),hasOverflow:g}},Ne=100,Me=(0,d.memo)(({containerRef:t,itemsRef:e,triggerRef:n,itemCount:s,inlineItemCount:o,reserveCountSpace:a,isMeasurementEnabled:u,isOpen:l,onLayoutChange:r,onOverflowUnavailable:f})=>{const g=(0,d.useRef)(void 0),w=(0,d.useRef)(void 0),D=(0,q.useStableCallback)(()=>({itemCount:s,inlineItemCount:o,reserveCountSpace:a,isOpen:l})),F=(0,q.useStableCallback)(r),L=(0,q.useStableCallback)(f);return(0,d.useLayoutEffect)(()=>{const y=t.current,I=e.current;if(!u||!h.isDefined(y)||!h.isDefined(I)){w.current=void 0;return}const M=h.isDefined(globalThis.ResizeObserver),S=new Set,x=()=>{const E=Array.from(I.children),W=new Set([y,...E]);h.isDefined(n.current)&&W.add(n.current);for(const _ of S)W.has(_)||(R?.unobserve(_),S.delete(_));for(const _ of W)S.has(_)||(R?.observe(_),S.add(_));const c=D();if(E.length!==c.inlineItemCount)return;const b=je({container:y,items:I,trigger:n.current,itemElements:E,itemCount:c.itemCount,reserveCountSpace:c.reserveCountSpace,supportsSynchronousLayout:M}),m=w.current,T=h.isDefined(m)&&m.isOpen&&!m.layout.hasOverflow,k=c.isOpen&&!b.hasOverflow;w.current={layout:b,isOpen:c.isOpen},F(b),k&&!T&&L()},R=M?new ResizeObserver(x):void 0;g.current=x,x();const p=new MutationObserver(x);if(p.observe(I,{attributes:!0,attributeFilter:["class","style","hidden"],characterData:!0,childList:!0,subtree:!0}),p.observe(y,{childList:!0}),!h.isDefined(R)){const E=setInterval(x,Ne);return window.addEventListener("resize",x),()=>{g.current=void 0,clearInterval(E),p.disconnect(),window.removeEventListener("resize",x)}}return()=>{g.current=void 0,p.disconnect(),R.disconnect()}},[t,e,n,u,D,F,L]),(0,d.useLayoutEffect)(()=>{g.current?.()},[s,o,a,l]),null}),Te=({itemCount:t,inlineItemCount:e})=>{const n=(0,d.useRef)(null),s=(0,d.useRef)(null),o=(0,d.useRef)(null),[a,u]=(0,d.useState)({visibleItemCount:e,hasOverflow:t>e});return{containerRef:n,itemsRef:s,triggerRef:o,updateLayout:(0,d.useCallback)(l=>{u(r=>r.visibleItemCount!==l.visibleItemCount||r.hasOverflow!==l.hasOverflow?l:r)},[]),...a}},ke="button, a[href], input, select, textarea, [tabindex]",te=({items:t,popup:e,trigger:n,root:s,removedIndex:o,excludedItem:a})=>{const u=[...Array.from(t?.children??[]),...Array.from(e?.children??[])].filter(l=>l!==a).sort((l,r)=>Math.abs(Number(l.getAttribute("data-item-index"))-o)-Math.abs(Number(r.getAttribute("data-item-index"))-o)||Number(r.getAttribute("data-item-index"))-Number(l.getAttribute("data-item-index")));for(const l of u)if(!l.hasAttribute("inert")){for(const r of Array.from(l.querySelectorAll(ke)))if(!r.matches(":disabled")&&!h.isDefined(r.closest("[inert]"))&&(r.focus(),r.ownerDocument.activeElement===r))return}n?.focus(),!(h.isDefined(n)&&n.ownerDocument.activeElement===n)&&s?.focus()},Ae=({containerRef:t,itemsRef:e,triggerRef:n,popup:s,itemCount:o,canExpand:a,isPopupOpen:u,isOpen:l,isHovered:r,showOverflowCount:f,onFocusCapture:g,onBlurCapture:w})=>{const[D,F]=(0,d.useState)(!1),[L,y]=(0,d.useState)(),I=f??L??(r||D||l),M=(0,q.useStableCallback)(({index:c,element:b,isInPopup:m})=>{te({items:m&&a?null:e.current,popup:m&&u?s:null,trigger:n.current,root:t.current,removedIndex:c,excludedItem:b})}),S=(0,d.useCallback)(()=>{const c=t.current;c?.focus(),F(c?.ownerDocument.activeElement===c),y(void 0)},[t]),x=(0,q.useStableCallback)(()=>{if(u)return;const c=t.current,b=c?.ownerDocument,m=b?.activeElement,T=h.isDefined(m)&&e.current?.contains(m)&&!h.isDefined(m.closest("[inert]")),k=h.isDefined(m)&&m!==b?.body&&!c?.contains(m)&&!s?.contains(m);if(T||k)return;if(!a){te({items:e.current,popup:null,trigger:null,root:c,removedIndex:o});return}const _=n.current;if(h.isDefined(_)&&!_.matches(":disabled")){_.focus({preventScroll:!0});return}c?.focus({preventScroll:!0})}),R=(0,d.useCallback)(()=>(queueMicrotask(x),!1),[x]),p=se(S);return{hasFocus:D,isCountVisible:I,restoreItemFocus:M,schedulePopupFocusRestoration:R,resetFocusWhenFocusedTriggerUnmounts:p,handleFocusCapture:c=>{F(!0),e.current?.contains(c.target)&&y(b=>b??I),g?.(c)},handleBlurCapture:c=>{F(c.currentTarget.contains(c.relatedTarget)||(s?.contains(c.relatedTarget)??!1)),e.current?.contains(c.relatedTarget)||y(void 0),w?.(c)}}},O=t=>t.stopPropagation(),qe=({children:t,showOverflowCount:e,maxInlineCount:n,overflowLabel:s="Show all items",open:o,defaultOpen:a=!1,onOpenChange:u,actionsRef:l,triggerProps:r,popupProps:f,className:g,onMouseEnter:w,onMouseLeave:D,onFocusCapture:F,onBlurCapture:L,ref:y,...I})=>{const[M,S]=(0,d.useState)(!1),[x,R]=(0,d.useState)(null),[p,E]=(0,_e.useControlled)({controlled:o,default:a,name:"OverflowingList",state:"open"}),W=(0,d.useRef)(null),c=l??W,b=h.isDefined(n)&&Number.isFinite(n)?Math.min(t.length,Math.max(0,Math.floor(n))):t.length,{containerRef:m,itemsRef:T,triggerRef:k,visibleItemCount:_,hasOverflow:re,updateLayout:oe}=Te({itemCount:t.length,inlineItemCount:b}),B=re&&(p||e!==!1),P=p&&B,{hasFocus:ae,isCountVisible:$,restoreItemFocus:G,schedulePopupFocusRestoration:ie,resetFocusWhenFocusedTriggerUnmounts:le,handleFocusCapture:ce,handleBlurCapture:ue}=Ae({containerRef:m,itemsRef:T,triggerRef:k,popup:x,itemCount:t.length,canExpand:B,isPopupOpen:P,isOpen:p,isHovered:M,showOverflowCount:e,onFocusCapture:F,onBlurCapture:L}),J=(e??(M||ae))||p,de=(0,V.useMergedRefs)(m,y),fe=(0,V.useMergedRefs)(k,le,r?.ref),me=(0,V.useMergedRefs)(R,f?.ref),Q=J&&e!==!1?_:b,X=t.length-_,ve=(0,q.useStableCallback)(()=>{c.current?.close()});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{...I,ref:de,tabIndex:I.tabIndex??-1,className:(0,N.clsx)(U.root,g),onMouseEnter:v=>{S(!0),w?.(v)},onMouseLeave:v=>{S(!1),D?.(v)},onFocusCapture:ce,onBlurCapture:ue,children:[(0,i.jsx)("div",{ref:T,className:U.items,children:t.slice(0,b).map((v,C)=>(0,i.jsx)(Z,{index:C,isHidden:C>=Q,isLastVisible:e!==!1&&C===Q-1,isInPopup:!1,onFocusLost:G,children:v},v.key??C))}),(B||p)&&(0,i.jsxs)(z.Popover.Root,{open:P,actionsRef:c,onOpenChange:(v,C)=>{u?.(v,C),C.isCanceled||E(v)},children:[B&&(0,i.jsx)(z.Popover.Trigger,{type:"button","aria-label":`+${X} ${s}`,...r,onClick:r?.onClick??O,onMouseDown:r?.onMouseDown??O,onPointerDown:r?.onPointerDown??O,onKeyDown:r?.onKeyDown??O,onKeyUp:r?.onKeyUp??O,ref:fe,className:v=>(0,N.clsx)(U.trigger,(0,j.isFunction)(r?.className)?r.className(v):r?.className),"data-visible":$||void 0,children:(0,j.isUndefined)(r?.children)?`+${X}`:r.children}),(0,i.jsx)(z.Popover.Portal,{children:(0,i.jsx)(z.Popover.Positioner,{anchor:m,align:"start",sideOffset:-9,alignOffset:-7,children:(0,i.jsx)(z.Popover.Popup,{"aria-label":s,...f,onClick:f?.onClick??O,onMouseDown:f?.onMouseDown??O,onPointerDown:f?.onPointerDown??O,onKeyDown:f?.onKeyDown??O,onKeyUp:f?.onKeyUp??O,ref:me,render:(v,C)=>(0,i.jsx)(Le,{props:v,state:C,render:f?.render}),finalFocus:f?.finalFocus??ie,className:v=>(0,N.clsx)(U.popup,(0,j.isFunction)(f?.className)?f.className(v):f?.className),"data-overflowing-list-popup":"",children:t.map((v,C)=>(0,i.jsx)(Z,{index:C,isHidden:!1,isLastVisible:!1,isInPopup:!0,onFocusLost:G,children:v},v.key??C))})})})]})]}),(0,i.jsx)(Me,{containerRef:m,itemsRef:T,triggerRef:k,itemCount:t.length,inlineItemCount:b,reserveCountSpace:$,isMeasurementEnabled:J,isOpen:p,onLayoutChange:oe,onOverflowUnavailable:ve})]})},We="_header_1dz7y_1",Ue="_titleRow_1dz7y_8",ze="_title_1dz7y_8",Ke="_actions_1dz7y_21",Ve="_description_1dz7y_27",K={header:We,titleRow:Ue,title:ze,actions:Ke,description:Ve},Be=({title:t,description:e,actions:n,level:s=2,size:o="md",color:a="primary",descriptionLineClamp:u=5,isDescriptionFocusable:l=!1,render:r,ref:f,className:g,...w})=>{const D=(0,d.useId)(),F=(0,j.isString)(e)?(0,j.isNonEmptyString)(e):h.isDefined(e)&&e!==!1,L=(0,j.isString)(e)&&u!==!1,y=(0,j.isString)(e)?(0,i.jsx)(Y.Text,{style:{whiteSpace:"pre-wrap"},children:e}):e;return(0,H.useRender)({render:r,ref:f,props:{...w,className:(0,N.clsx)(K.header,g),children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:K.titleRow,children:[(0,i.jsx)(he.Heading,{level:s,size:o,color:a,className:K.title,"aria-describedby":F?D:void 0,children:t}),h.isDefined(n)&&(0,i.jsx)("div",{className:K.actions,children:n})]}),F&&(0,i.jsx)("div",{id:D,className:K.description,children:L?(0,i.jsx)(Y.OverflowingTextWithTooltip,{text:e,lineClamp:u,isTooltipMultiline:!0,isFocusable:l}):y})]})}})},He="_root_ztxxm_1",Pe="_fullWidth_ztxxm_20",ne={root:He,fullWidth:Pe},$e=({align:t="left",color:e="primary",fullWidth:n=!0,className:s,render:o,ref:a,...u})=>(0,H.useRender)({render:o,ref:a,props:{...u,"data-align":t,"data-color":e,className:(0,N.clsx)(ne.root,n&&ne.fullWidth,s)}}),Ge={Root:$e,Header:Be};Object.defineProperty(exports,"AnimatedIconCrossfade",{enumerable:!0,get:function(){return Ce}});Object.defineProperty(exports,"OverflowingList",{enumerable:!0,get:function(){return qe}});Object.defineProperty(exports,"Section",{enumerable:!0,get:function(){return Ge}});
|