@react-spectrum/s2 0.3.0 → 0.3.1
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/dist/ActionButton.cjs +1 -1
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +3 -3
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +1 -1
- package/dist/Avatar.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs +3 -0
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +3 -0
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Dialog.cjs +5 -1
- package/dist/Dialog.cjs.map +1 -1
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +7 -3
- package/dist/Dialog.mjs.map +1 -1
- package/dist/Meter.cjs +1 -1
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +1 -1
- package/dist/Meter.mjs.map +1 -1
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TagGroup.cjs +1 -1
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +1 -1
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/types.d.ts +9 -4
- package/dist/types.d.ts.map +1 -1
- package/icons/3D.d.ts +1 -13
- package/icons/3DAsset.d.ts +1 -13
- package/icons/3DMaterial.d.ts +1 -13
- package/icons/Accessibility.d.ts +1 -13
- package/icons/Add.d.ts +1 -13
- package/icons/AddCircle.d.ts +1 -13
- package/icons/AddContent.d.ts +1 -13
- package/icons/AlertDiamond.d.ts +1 -13
- package/icons/AlertTriangle.d.ts +1 -13
- package/icons/AlignBottom.d.ts +1 -13
- package/icons/AlignCenter.d.ts +1 -13
- package/icons/AlignLeft.d.ts +1 -13
- package/icons/AlignMiddle.d.ts +1 -13
- package/icons/AlignRight.d.ts +1 -13
- package/icons/AlignTop.d.ts +1 -13
- package/icons/Animation.d.ts +1 -13
- package/icons/AnimationNo.d.ts +1 -13
- package/icons/Apps.d.ts +1 -13
- package/icons/AppsAll.d.ts +1 -13
- package/icons/Archive.d.ts +1 -13
- package/icons/ArrowHeadTool.d.ts +1 -13
- package/icons/Artboard.d.ts +1 -13
- package/icons/AspectRatio.d.ts +1 -13
- package/icons/Asset.d.ts +1 -13
- package/icons/Attach.d.ts +1 -13
- package/icons/AudioWave.d.ts +1 -13
- package/icons/AutoSelectSubject.d.ts +1 -13
- package/icons/Background.d.ts +1 -13
- package/icons/BadgeVerified.d.ts +1 -13
- package/icons/Bell.d.ts +1 -13
- package/icons/BellRotated.d.ts +1 -13
- package/icons/BetaApp.d.ts +1 -13
- package/icons/Binoculars.d.ts +1 -13
- package/icons/Blur.d.ts +1 -13
- package/icons/Brand.d.ts +1 -13
- package/icons/Briefcase.d.ts +1 -13
- package/icons/BrightnessContrast.d.ts +1 -13
- package/icons/Brush.d.ts +1 -13
- package/icons/Bug.d.ts +1 -13
- package/icons/Buildings.d.ts +1 -13
- package/icons/CCLibrary.d.ts +1 -13
- package/icons/Calendar.d.ts +1 -13
- package/icons/CalendarAdd.d.ts +1 -13
- package/icons/CalendarDay.d.ts +1 -13
- package/icons/CalendarEdit.d.ts +1 -13
- package/icons/CalendarWeek.d.ts +1 -13
- package/icons/Camera.d.ts +1 -13
- package/icons/CameraProperties.d.ts +1 -13
- package/icons/Cancel.d.ts +1 -13
- package/icons/CheckBox.d.ts +1 -13
- package/icons/CheckmarkCircle.d.ts +1 -13
- package/icons/Circle.d.ts +1 -13
- package/icons/Clock.d.ts +1 -13
- package/icons/ClockPending.d.ts +1 -13
- package/icons/CloseCaptions.d.ts +1 -13
- package/icons/Cloud.d.ts +1 -13
- package/icons/CloudStateDefault.d.ts +1 -13
- package/icons/CloudStateDisconnected.d.ts +1 -13
- package/icons/CloudStateError.d.ts +1 -13
- package/icons/CloudStateErrorRed.d.ts +1 -13
- package/icons/CloudStateInProgress.d.ts +1 -13
- package/icons/CloudStatePaused.d.ts +1 -13
- package/icons/CloudStatePending.d.ts +1 -13
- package/icons/CloudStateSlowConnection.d.ts +1 -13
- package/icons/Collection.d.ts +1 -13
- package/icons/Color.d.ts +1 -13
- package/icons/ColorFill.d.ts +1 -13
- package/icons/ColorHarmony.d.ts +1 -13
- package/icons/Comment.d.ts +1 -13
- package/icons/CommentShow.d.ts +1 -13
- package/icons/CommentText.d.ts +1 -13
- package/icons/Community.d.ts +1 -13
- package/icons/ContextualTaskBar.d.ts +1 -13
- package/icons/Contrast.d.ts +1 -13
- package/icons/Copy.d.ts +1 -13
- package/icons/CornerRadius.d.ts +1 -13
- package/icons/CornerRadiusBottomLeft.d.ts +1 -13
- package/icons/CornerRadiusBottomRight.d.ts +1 -13
- package/icons/CornerRadiusEach.d.ts +1 -13
- package/icons/CornerRadiusTopLeft.d.ts +1 -13
- package/icons/CornerRadiusTopRight.d.ts +1 -13
- package/icons/Crop.d.ts +1 -13
- package/icons/CropRotate.d.ts +1 -13
- package/icons/Cut.d.ts +1 -13
- package/icons/Delete.d.ts +1 -13
- package/icons/DeviceAll.d.ts +1 -13
- package/icons/DeviceDesktop.d.ts +1 -13
- package/icons/DeviceDesktopMobile.d.ts +1 -13
- package/icons/DeviceLaptop.d.ts +1 -13
- package/icons/DeviceMobile.d.ts +1 -13
- package/icons/DeviceMultiscreen.d.ts +1 -13
- package/icons/DevicePhone.d.ts +1 -13
- package/icons/DeviceTablet.d.ts +1 -13
- package/icons/DirectSelect.d.ts +1 -13
- package/icons/Discover.d.ts +1 -13
- package/icons/DistributeBottomEdge.d.ts +1 -13
- package/icons/DistributeHorizontalCenter.d.ts +1 -13
- package/icons/DistributeLeftEdge.d.ts +1 -13
- package/icons/DistributeRightEdge.d.ts +1 -13
- package/icons/DistributeSpaceHorizontally.d.ts +1 -13
- package/icons/DistributeSpaceVertically.d.ts +1 -13
- package/icons/DistributeTopEdge.d.ts +1 -13
- package/icons/DistributeVerticalCenter.d.ts +1 -13
- package/icons/Download.d.ts +1 -13
- package/icons/Draw.d.ts +1 -13
- package/icons/Duplicate.d.ts +1 -13
- package/icons/Edit.d.ts +1 -13
- package/icons/EditNo.d.ts +1 -13
- package/icons/Education.d.ts +1 -13
- package/icons/Effects.d.ts +1 -13
- package/icons/Email.d.ts +1 -13
- package/icons/Emoji.d.ts +1 -13
- package/icons/Erase.d.ts +1 -13
- package/icons/ExportTo.d.ts +1 -13
- package/icons/Exposure.d.ts +1 -13
- package/icons/Eyedropper.d.ts +1 -13
- package/icons/File.d.ts +1 -13
- package/icons/FileAdd.d.ts +1 -13
- package/icons/FileConvert.d.ts +1 -13
- package/icons/FileText.d.ts +1 -13
- package/icons/FileUser.d.ts +1 -13
- package/icons/Files.d.ts +1 -13
- package/icons/Filmstrip.d.ts +1 -13
- package/icons/Filter.d.ts +1 -13
- package/icons/Filters.d.ts +1 -13
- package/icons/FindAndReplace.d.ts +1 -13
- package/icons/Flag.d.ts +1 -13
- package/icons/FlipHorizontal.d.ts +1 -13
- package/icons/FlipVertical.d.ts +1 -13
- package/icons/Folder.d.ts +1 -13
- package/icons/FolderAdd.d.ts +1 -13
- package/icons/FolderBreadcrumb.d.ts +1 -13
- package/icons/FolderClock.d.ts +1 -13
- package/icons/FolderOpen.d.ts +1 -13
- package/icons/FontPicker.d.ts +1 -13
- package/icons/FullScreen.d.ts +1 -13
- package/icons/FullScreenExit.d.ts +1 -13
- package/icons/Gift.d.ts +1 -13
- package/icons/GlobeGrid.d.ts +1 -13
- package/icons/GridTypeDots.d.ts +1 -13
- package/icons/GridTypeLines.d.ts +1 -13
- package/icons/GridsAndRulers.d.ts +1 -13
- package/icons/Group.d.ts +1 -13
- package/icons/GroupNo.d.ts +1 -13
- package/icons/Hand.d.ts +1 -13
- package/icons/Heart.d.ts +1 -13
- package/icons/HelpCircle.d.ts +1 -13
- package/icons/History.d.ts +1 -13
- package/icons/Home.d.ts +1 -13
- package/icons/Icon.d.ts +1 -13
- package/icons/Image.d.ts +1 -13
- package/icons/ImageAdd.d.ts +1 -13
- package/icons/ImageBackgroundRemove.d.ts +1 -13
- package/icons/Images.d.ts +1 -13
- package/icons/InfoCircle.d.ts +1 -13
- package/icons/Interaction.d.ts +1 -13
- package/icons/Invert.d.ts +1 -13
- package/icons/Invite.d.ts +1 -13
- package/icons/Keyboard.d.ts +1 -13
- package/icons/LassoSelect.d.ts +1 -13
- package/icons/Layers.d.ts +1 -13
- package/icons/Layout.d.ts +1 -13
- package/icons/Leave.d.ts +1 -13
- package/icons/Lightbulb.d.ts +1 -13
- package/icons/Lighten.d.ts +1 -13
- package/icons/Line.d.ts +1 -13
- package/icons/LineHeight.d.ts +1 -13
- package/icons/Link.d.ts +1 -13
- package/icons/LinkVertical.d.ts +1 -13
- package/icons/ListBulleted.d.ts +1 -13
- package/icons/ListMultiSelect.d.ts +1 -13
- package/icons/ListNumbered.d.ts +1 -13
- package/icons/Location.d.ts +1 -13
- package/icons/Lock.d.ts +1 -13
- package/icons/LockOpen.d.ts +1 -13
- package/icons/Logo.d.ts +1 -13
- package/icons/MagicWand.d.ts +1 -13
- package/icons/Market.d.ts +1 -13
- package/icons/Mask.d.ts +1 -13
- package/icons/MaskDisable.d.ts +1 -13
- package/icons/Maximize.d.ts +1 -13
- package/icons/Mention.d.ts +1 -13
- package/icons/MenuHamburger.d.ts +1 -13
- package/icons/Microphone.d.ts +1 -13
- package/icons/MicrophoneOff.d.ts +1 -13
- package/icons/Minimize.d.ts +1 -13
- package/icons/More.d.ts +1 -13
- package/icons/Move.d.ts +1 -13
- package/icons/MovieCamera.d.ts +1 -13
- package/icons/MusicNote.d.ts +1 -13
- package/icons/New.d.ts +1 -13
- package/icons/Nudge.d.ts +1 -13
- package/icons/OpenIn.d.ts +1 -13
- package/icons/Order.d.ts +1 -13
- package/icons/OrderBottom.d.ts +1 -13
- package/icons/OrderOneDown.d.ts +1 -13
- package/icons/OrderOneUp.d.ts +1 -13
- package/icons/OrderTop.d.ts +1 -13
- package/icons/OrientationLandscape.d.ts +1 -13
- package/icons/OrientationPortrait.d.ts +1 -13
- package/icons/Paste.d.ts +1 -13
- package/icons/Path.d.ts +1 -13
- package/icons/Pattern.d.ts +1 -13
- package/icons/Pause.d.ts +1 -13
- package/icons/PenBrush.d.ts +1 -13
- package/icons/People.d.ts +1 -13
- package/icons/Percentage.d.ts +1 -13
- package/icons/Play.d.ts +1 -13
- package/icons/Plugin.d.ts +1 -13
- package/icons/PluginGear.d.ts +1 -13
- package/icons/Polygon3.d.ts +1 -13
- package/icons/Polygon4.d.ts +1 -13
- package/icons/Polygon5.d.ts +1 -13
- package/icons/Polygon6.d.ts +1 -13
- package/icons/Preview.d.ts +1 -13
- package/icons/Print.d.ts +1 -13
- package/icons/Project.d.ts +1 -13
- package/icons/ProjectAddInto.d.ts +1 -13
- package/icons/ProjectCreate.d.ts +1 -13
- package/icons/Promote.d.ts +1 -13
- package/icons/Prompt.d.ts +1 -13
- package/icons/Properties.d.ts +1 -13
- package/icons/Prototyping.d.ts +1 -13
- package/icons/Publish.d.ts +1 -13
- package/icons/PublishNo.d.ts +1 -13
- package/icons/RadioButton.d.ts +1 -13
- package/icons/RectangleHoriz.d.ts +1 -13
- package/icons/Redo.d.ts +1 -13
- package/icons/Refresh.d.ts +1 -13
- package/icons/RemoveCircle.d.ts +1 -13
- package/icons/Rename.d.ts +1 -13
- package/icons/Replace.d.ts +1 -13
- package/icons/ReportAbuse.d.ts +1 -13
- package/icons/Resize.d.ts +1 -13
- package/icons/Revert.d.ts +1 -13
- package/icons/ReviewLink.d.ts +1 -13
- package/icons/Ribbon.d.ts +1 -13
- package/icons/RocketQuickActions.d.ts +1 -13
- package/icons/RotateCCW.d.ts +1 -13
- package/icons/RotateCW.d.ts +1 -13
- package/icons/RotateOrientation.d.ts +1 -13
- package/icons/S2_Icon_MediaOffline_N.d.ts +1 -13
- package/icons/Saturation.d.ts +1 -13
- package/icons/Search.d.ts +1 -13
- package/icons/Select.d.ts +1 -13
- package/icons/SelectAllItems.d.ts +1 -13
- package/icons/SelectAndMove.d.ts +1 -13
- package/icons/SelectNo.d.ts +1 -13
- package/icons/SelectRectangle.d.ts +1 -13
- package/icons/Send.d.ts +1 -13
- package/icons/Settings.d.ts +1 -13
- package/icons/Shapes.d.ts +1 -13
- package/icons/Share.d.ts +1 -13
- package/icons/ShareAndroid.d.ts +1 -13
- package/icons/ShoppingCart.d.ts +1 -13
- package/icons/Shuffle.d.ts +1 -13
- package/icons/Similar.d.ts +1 -13
- package/icons/Slideshow.d.ts +1 -13
- package/icons/SocialNetwork.d.ts +1 -13
- package/icons/Sort.d.ts +1 -13
- package/icons/SortDown.d.ts +1 -13
- package/icons/SortUp.d.ts +1 -13
- package/icons/StampClone.d.ts +1 -13
- package/icons/Star.d.ts +1 -13
- package/icons/StarFilled.d.ts +1 -13
- package/icons/StepBackward.d.ts +1 -13
- package/icons/StepForward.d.ts +1 -13
- package/icons/StickyNote.d.ts +1 -13
- package/icons/StrokeDotted.d.ts +1 -13
- package/icons/StrokeSolid.d.ts +1 -13
- package/icons/StrokeWidth.d.ts +1 -13
- package/icons/Switch.d.ts +1 -13
- package/icons/SwitchVertical.d.ts +1 -13
- package/icons/Tag.d.ts +1 -13
- package/icons/Target.d.ts +1 -13
- package/icons/Temperature.d.ts +1 -13
- package/icons/Template.d.ts +1 -13
- package/icons/Text.d.ts +1 -13
- package/icons/TextAdd.d.ts +1 -13
- package/icons/TextAlignCenter.d.ts +1 -13
- package/icons/TextAlignJustify.d.ts +1 -13
- package/icons/TextAlignJustifyLastCenter.d.ts +1 -13
- package/icons/TextAlignJustifyLastLeft.d.ts +1 -13
- package/icons/TextAlignJustifyLastRight.d.ts +1 -13
- package/icons/TextAlignLeft.d.ts +1 -13
- package/icons/TextAlignRight.d.ts +1 -13
- package/icons/TextBold.d.ts +1 -13
- package/icons/TextItalic.d.ts +1 -13
- package/icons/TextNumbers.d.ts +1 -13
- package/icons/TextParagraph.d.ts +1 -13
- package/icons/TextSize.d.ts +1 -13
- package/icons/TextStrikeThrough.d.ts +1 -13
- package/icons/TextSubscript.d.ts +1 -13
- package/icons/TextSuperscript.d.ts +1 -13
- package/icons/TextUnderline.d.ts +1 -13
- package/icons/TextVariableFontSettings.d.ts +1 -13
- package/icons/ThumbDown.d.ts +1 -13
- package/icons/ThumbUp.d.ts +1 -13
- package/icons/Toggle.d.ts +1 -13
- package/icons/TouchOneFingerSwipeLeftRight.d.ts +1 -13
- package/icons/Transcript.d.ts +1 -13
- package/icons/TransformDistort.d.ts +1 -13
- package/icons/TransformGeneric.d.ts +1 -13
- package/icons/TransformPerspective.d.ts +1 -13
- package/icons/TransformSkew.d.ts +1 -13
- package/icons/TransformWarp.d.ts +1 -13
- package/icons/Translate.d.ts +1 -13
- package/icons/Tutorials.d.ts +1 -13
- package/icons/UnLink.d.ts +1 -13
- package/icons/Undo.d.ts +1 -13
- package/icons/UnlinkHoriz.d.ts +1 -13
- package/icons/UnlinkVertical.d.ts +1 -13
- package/icons/Upload.d.ts +1 -13
- package/icons/UploadToCloud.d.ts +1 -13
- package/icons/User.d.ts +1 -13
- package/icons/UserAdd.d.ts +1 -13
- package/icons/UserAvatar.d.ts +1 -13
- package/icons/UserEdit.d.ts +1 -13
- package/icons/UserFollowing.d.ts +1 -13
- package/icons/UserGroup.d.ts +1 -13
- package/icons/UserLock.d.ts +1 -13
- package/icons/UsersLock.d.ts +1 -13
- package/icons/VectorDraw.d.ts +1 -13
- package/icons/Video.d.ts +1 -13
- package/icons/ViewGrid.d.ts +1 -13
- package/icons/ViewList.d.ts +1 -13
- package/icons/Visibility.d.ts +1 -13
- package/icons/VisibilityOff.d.ts +1 -13
- package/icons/VolumeOff.d.ts +1 -13
- package/icons/VolumeOne.d.ts +1 -13
- package/icons/VolumeTwo.d.ts +1 -13
- package/icons/WebNavBar.d.ts +1 -13
- package/icons/WebPage.d.ts +1 -13
- package/icons/ZoomIn.d.ts +1 -13
- package/icons/ZoomOut.d.ts +1 -13
- package/illustrations/gradient/generic1/Apps.d.ts +1 -13
- package/illustrations/gradient/generic1/Artboard.d.ts +1 -13
- package/illustrations/gradient/generic1/Bell.d.ts +1 -13
- package/illustrations/gradient/generic1/Bolt.d.ts +1 -13
- package/illustrations/gradient/generic1/Brand.d.ts +1 -13
- package/illustrations/gradient/generic1/Briefcase.d.ts +1 -13
- package/illustrations/gradient/generic1/Browser.d.ts +1 -13
- package/illustrations/gradient/generic1/BuildTable.d.ts +1 -13
- package/illustrations/gradient/generic1/Buildings.d.ts +1 -13
- package/illustrations/gradient/generic1/Calendar.d.ts +1 -13
- package/illustrations/gradient/generic1/Camera.d.ts +1 -13
- package/illustrations/gradient/generic1/Chatbubble.d.ts +1 -13
- package/illustrations/gradient/generic1/Checkmark.d.ts +1 -13
- package/illustrations/gradient/generic1/Clipboard.d.ts +1 -13
- package/illustrations/gradient/generic1/Clock.d.ts +1 -13
- package/illustrations/gradient/generic1/Cloud.d.ts +1 -13
- package/illustrations/gradient/generic1/CloudUpload.d.ts +1 -13
- package/illustrations/gradient/generic1/CodeBrackets.d.ts +1 -13
- package/illustrations/gradient/generic1/Confetti.d.ts +1 -13
- package/illustrations/gradient/generic1/Conversationbubbles.d.ts +1 -13
- package/illustrations/gradient/generic1/Cursor.d.ts +1 -13
- package/illustrations/gradient/generic1/Desktop.d.ts +1 -13
- package/illustrations/gradient/generic1/Document.d.ts +1 -13
- package/illustrations/gradient/generic1/DropToUpload.d.ts +1 -13
- package/illustrations/gradient/generic1/EmptyStateExport.d.ts +1 -13
- package/illustrations/gradient/generic1/Error.d.ts +1 -13
- package/illustrations/gradient/generic1/FileImage.d.ts +1 -13
- package/illustrations/gradient/generic1/FileText.d.ts +1 -13
- package/illustrations/gradient/generic1/FileVideo.d.ts +1 -13
- package/illustrations/gradient/generic1/FileZip.d.ts +1 -13
- package/illustrations/gradient/generic1/Filmstrip.d.ts +1 -13
- package/illustrations/gradient/generic1/Filter.d.ts +1 -13
- package/illustrations/gradient/generic1/Fireworks.d.ts +1 -13
- package/illustrations/gradient/generic1/FolderClose.d.ts +1 -13
- package/illustrations/gradient/generic1/FolderOpen.d.ts +1 -13
- package/illustrations/gradient/generic1/GearSetting.d.ts +1 -13
- package/illustrations/gradient/generic1/GraphBarChart.d.ts +1 -13
- package/illustrations/gradient/generic1/Handshake.d.ts +1 -13
- package/illustrations/gradient/generic1/Heart.d.ts +1 -13
- package/illustrations/gradient/generic1/Image.d.ts +1 -13
- package/illustrations/gradient/generic1/ImageStack.d.ts +1 -13
- package/illustrations/gradient/generic1/Information.d.ts +1 -13
- package/illustrations/gradient/generic1/Laptop.d.ts +1 -13
- package/illustrations/gradient/generic1/Layers.d.ts +1 -13
- package/illustrations/gradient/generic1/Libraries.d.ts +1 -13
- package/illustrations/gradient/generic1/Lightbulb.d.ts +1 -13
- package/illustrations/gradient/generic1/LightbulbRays.d.ts +1 -13
- package/illustrations/gradient/generic1/Link.d.ts +1 -13
- package/illustrations/gradient/generic1/Location.d.ts +1 -13
- package/illustrations/gradient/generic1/LockClose.d.ts +1 -13
- package/illustrations/gradient/generic1/LockOpen.d.ts +1 -13
- package/illustrations/gradient/generic1/Logo.d.ts +1 -13
- package/illustrations/gradient/generic1/MailClose.d.ts +1 -13
- package/illustrations/gradient/generic1/MegaphonePromote.d.ts +1 -13
- package/illustrations/gradient/generic1/MegaphonePromoteExpressive.d.ts +1 -13
- package/illustrations/gradient/generic1/Paperairplane.d.ts +1 -13
- package/illustrations/gradient/generic1/Paperclip.d.ts +1 -13
- package/illustrations/gradient/generic1/Phone.d.ts +1 -13
- package/illustrations/gradient/generic1/PieChart.d.ts +1 -13
- package/illustrations/gradient/generic1/Pin.d.ts +1 -13
- package/illustrations/gradient/generic1/Play.d.ts +1 -13
- package/illustrations/gradient/generic1/Plugin.d.ts +1 -13
- package/illustrations/gradient/generic1/Rocket.d.ts +1 -13
- package/illustrations/gradient/generic1/Search.d.ts +1 -13
- package/illustrations/gradient/generic1/Server.d.ts +1 -13
- package/illustrations/gradient/generic1/Sparkles.d.ts +1 -13
- package/illustrations/gradient/generic1/Star.d.ts +1 -13
- package/illustrations/gradient/generic1/Tablet.d.ts +1 -13
- package/illustrations/gradient/generic1/Tag.d.ts +1 -13
- package/illustrations/gradient/generic1/Trash.d.ts +1 -13
- package/illustrations/gradient/generic1/Trophy.d.ts +1 -13
- package/illustrations/gradient/generic1/Update.d.ts +1 -13
- package/illustrations/gradient/generic1/User.d.ts +1 -13
- package/illustrations/gradient/generic1/UserGroup.d.ts +1 -13
- package/illustrations/gradient/generic1/Video.d.ts +1 -13
- package/illustrations/gradient/generic2/Apps.d.ts +1 -13
- package/illustrations/gradient/generic2/Artboard.d.ts +1 -13
- package/illustrations/gradient/generic2/Bell.d.ts +1 -13
- package/illustrations/gradient/generic2/Bolt.d.ts +1 -13
- package/illustrations/gradient/generic2/Brand.d.ts +1 -13
- package/illustrations/gradient/generic2/Briefcase.d.ts +1 -13
- package/illustrations/gradient/generic2/Browser.d.ts +1 -13
- package/illustrations/gradient/generic2/BuildTable.d.ts +1 -13
- package/illustrations/gradient/generic2/Buildings.d.ts +1 -13
- package/illustrations/gradient/generic2/Calendar.d.ts +1 -13
- package/illustrations/gradient/generic2/Camera.d.ts +1 -13
- package/illustrations/gradient/generic2/Chatbubble.d.ts +1 -13
- package/illustrations/gradient/generic2/Checkmark.d.ts +1 -13
- package/illustrations/gradient/generic2/Clipboard.d.ts +1 -13
- package/illustrations/gradient/generic2/Clock.d.ts +1 -13
- package/illustrations/gradient/generic2/Cloud.d.ts +1 -13
- package/illustrations/gradient/generic2/CloudUpload.d.ts +1 -13
- package/illustrations/gradient/generic2/CodeBrackets.d.ts +1 -13
- package/illustrations/gradient/generic2/Confetti.d.ts +1 -13
- package/illustrations/gradient/generic2/Conversationbubbles.d.ts +1 -13
- package/illustrations/gradient/generic2/Cursor.d.ts +1 -13
- package/illustrations/gradient/generic2/Desktop.d.ts +1 -13
- package/illustrations/gradient/generic2/Document.d.ts +1 -13
- package/illustrations/gradient/generic2/DropToUpload.d.ts +1 -13
- package/illustrations/gradient/generic2/EmptyStateExport.d.ts +1 -13
- package/illustrations/gradient/generic2/Error.d.ts +1 -13
- package/illustrations/gradient/generic2/FileImage.d.ts +1 -13
- package/illustrations/gradient/generic2/FileText.d.ts +1 -13
- package/illustrations/gradient/generic2/FileVideo.d.ts +1 -13
- package/illustrations/gradient/generic2/FileZip.d.ts +1 -13
- package/illustrations/gradient/generic2/Filmstrip.d.ts +1 -13
- package/illustrations/gradient/generic2/Filter.d.ts +1 -13
- package/illustrations/gradient/generic2/Fireworks.d.ts +1 -13
- package/illustrations/gradient/generic2/FolderClose.d.ts +1 -13
- package/illustrations/gradient/generic2/FolderOpen.d.ts +1 -13
- package/illustrations/gradient/generic2/GearSetting.d.ts +1 -13
- package/illustrations/gradient/generic2/GraphBarChart.d.ts +1 -13
- package/illustrations/gradient/generic2/Handshake.d.ts +1 -13
- package/illustrations/gradient/generic2/Heart.d.ts +1 -13
- package/illustrations/gradient/generic2/Image.d.ts +1 -13
- package/illustrations/gradient/generic2/ImageStack.d.ts +1 -13
- package/illustrations/gradient/generic2/Information.d.ts +1 -13
- package/illustrations/gradient/generic2/Laptop.d.ts +1 -13
- package/illustrations/gradient/generic2/Layers.d.ts +1 -13
- package/illustrations/gradient/generic2/Libraries.d.ts +1 -13
- package/illustrations/gradient/generic2/Lightbulb.d.ts +1 -13
- package/illustrations/gradient/generic2/LightbulbRays.d.ts +1 -13
- package/illustrations/gradient/generic2/Link.d.ts +1 -13
- package/illustrations/gradient/generic2/Location.d.ts +1 -13
- package/illustrations/gradient/generic2/LockClose.d.ts +1 -13
- package/illustrations/gradient/generic2/LockOpen.d.ts +1 -13
- package/illustrations/gradient/generic2/Logo.d.ts +1 -13
- package/illustrations/gradient/generic2/MailClose.d.ts +1 -13
- package/illustrations/gradient/generic2/MegaphonePromote.d.ts +1 -13
- package/illustrations/gradient/generic2/MegaphonePromoteExpressive.d.ts +1 -13
- package/illustrations/gradient/generic2/Paperairplane.d.ts +1 -13
- package/illustrations/gradient/generic2/Paperclip.d.ts +1 -13
- package/illustrations/gradient/generic2/Phone.d.ts +1 -13
- package/illustrations/gradient/generic2/PieChart.d.ts +1 -13
- package/illustrations/gradient/generic2/Pin.d.ts +1 -13
- package/illustrations/gradient/generic2/Play.d.ts +1 -13
- package/illustrations/gradient/generic2/Plugin.d.ts +1 -13
- package/illustrations/gradient/generic2/Rocket.d.ts +1 -13
- package/illustrations/gradient/generic2/Search.d.ts +1 -13
- package/illustrations/gradient/generic2/Server.d.ts +1 -13
- package/illustrations/gradient/generic2/Sparkles.d.ts +1 -13
- package/illustrations/gradient/generic2/Star.d.ts +1 -13
- package/illustrations/gradient/generic2/Tablet.d.ts +1 -13
- package/illustrations/gradient/generic2/Tag.d.ts +1 -13
- package/illustrations/gradient/generic2/Trash.d.ts +1 -13
- package/illustrations/gradient/generic2/Trophy.d.ts +1 -13
- package/illustrations/gradient/generic2/Update.d.ts +1 -13
- package/illustrations/gradient/generic2/User.d.ts +1 -13
- package/illustrations/gradient/generic2/UserGroup.d.ts +1 -13
- package/illustrations/gradient/generic2/Video.d.ts +1 -13
- package/illustrations/linear/AlertNotice.d.ts +1 -13
- package/illustrations/linear/Apps.d.ts +1 -13
- package/illustrations/linear/ArrowDown.d.ts +1 -13
- package/illustrations/linear/ArrowLeft.d.ts +1 -13
- package/illustrations/linear/ArrowRight.d.ts +1 -13
- package/illustrations/linear/ArrowUp.d.ts +1 -13
- package/illustrations/linear/Artboard.d.ts +1 -13
- package/illustrations/linear/Bell.d.ts +1 -13
- package/illustrations/linear/Bolt.d.ts +1 -13
- package/illustrations/linear/Brand.d.ts +1 -13
- package/illustrations/linear/Briefcase.d.ts +1 -13
- package/illustrations/linear/Browser.d.ts +1 -13
- package/illustrations/linear/BrowserError.d.ts +1 -13
- package/illustrations/linear/BrowserNotCompatible.d.ts +1 -13
- package/illustrations/linear/BuildTable.d.ts +1 -13
- package/illustrations/linear/Buildings.d.ts +1 -13
- package/illustrations/linear/Calendar.d.ts +1 -13
- package/illustrations/linear/Camera.d.ts +1 -13
- package/illustrations/linear/Chatbubble.d.ts +1 -13
- package/illustrations/linear/Check.d.ts +1 -13
- package/illustrations/linear/Clipboard.d.ts +1 -13
- package/illustrations/linear/Clock.d.ts +1 -13
- package/illustrations/linear/Close.d.ts +1 -13
- package/illustrations/linear/Cloud.d.ts +1 -13
- package/illustrations/linear/CloudStateDisconnected.d.ts +1 -13
- package/illustrations/linear/CloudStateError.d.ts +1 -13
- package/illustrations/linear/CloudUpload.d.ts +1 -13
- package/illustrations/linear/CodeBrackets.d.ts +1 -13
- package/illustrations/linear/ConfettiCelebration.d.ts +1 -13
- package/illustrations/linear/Conversationbubbles.d.ts +1 -13
- package/illustrations/linear/Cursor.d.ts +1 -13
- package/illustrations/linear/Desktop.d.ts +1 -13
- package/illustrations/linear/Document.d.ts +1 -13
- package/illustrations/linear/DropToUpload.d.ts +1 -13
- package/illustrations/linear/EmptyStateExport.d.ts +1 -13
- package/illustrations/linear/Error.d.ts +1 -13
- package/illustrations/linear/FileAlert.d.ts +1 -13
- package/illustrations/linear/FileImage.d.ts +1 -13
- package/illustrations/linear/FileText.d.ts +1 -13
- package/illustrations/linear/FileVideo.d.ts +1 -13
- package/illustrations/linear/FileZip.d.ts +1 -13
- package/illustrations/linear/Filmstrip.d.ts +1 -13
- package/illustrations/linear/Filter.d.ts +1 -13
- package/illustrations/linear/Fireworks.d.ts +1 -13
- package/illustrations/linear/FolderClose.d.ts +1 -13
- package/illustrations/linear/FolderOpen.d.ts +1 -13
- package/illustrations/linear/GearSetting.d.ts +1 -13
- package/illustrations/linear/GraphBarChart.d.ts +1 -13
- package/illustrations/linear/Handshake.d.ts +1 -13
- package/illustrations/linear/Heart.d.ts +1 -13
- package/illustrations/linear/Image.d.ts +1 -13
- package/illustrations/linear/ImageStack.d.ts +1 -13
- package/illustrations/linear/Information.d.ts +1 -13
- package/illustrations/linear/Laptop.d.ts +1 -13
- package/illustrations/linear/Layers.d.ts +1 -13
- package/illustrations/linear/Libraries.d.ts +1 -13
- package/illustrations/linear/Lightbulb.d.ts +1 -13
- package/illustrations/linear/LightbulbRays.d.ts +1 -13
- package/illustrations/linear/Link.d.ts +1 -13
- package/illustrations/linear/Location.d.ts +1 -13
- package/illustrations/linear/LockClose.d.ts +1 -13
- package/illustrations/linear/LockOpen.d.ts +1 -13
- package/illustrations/linear/Logo.d.ts +1 -13
- package/illustrations/linear/MailClose.d.ts +1 -13
- package/illustrations/linear/MegaphonePromote.d.ts +1 -13
- package/illustrations/linear/MegaphonePromoteExpressive.d.ts +1 -13
- package/illustrations/linear/Paperairplane.d.ts +1 -13
- package/illustrations/linear/Paperclip.d.ts +1 -13
- package/illustrations/linear/Phone.d.ts +1 -13
- package/illustrations/linear/PieChart.d.ts +1 -13
- package/illustrations/linear/Pin.d.ts +1 -13
- package/illustrations/linear/Play.d.ts +1 -13
- package/illustrations/linear/Plugin.d.ts +1 -13
- package/illustrations/linear/Rocket.d.ts +1 -13
- package/illustrations/linear/Search.d.ts +1 -13
- package/illustrations/linear/Server.d.ts +1 -13
- package/illustrations/linear/Sparkles.d.ts +1 -13
- package/illustrations/linear/Star.d.ts +1 -13
- package/illustrations/linear/Tablet.d.ts +1 -13
- package/illustrations/linear/Tag.d.ts +1 -13
- package/illustrations/linear/Trash.d.ts +1 -13
- package/illustrations/linear/Trophy.d.ts +1 -13
- package/illustrations/linear/Update.d.ts +1 -13
- package/illustrations/linear/User.d.ts +1 -13
- package/illustrations/linear/UserGroup.d.ts +1 -13
- package/illustrations/linear/Video.d.ts +1 -13
- package/illustrations/linear/Warning.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_alertNotice_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_alertNotice_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_alertNotice_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_apps_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_apps_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_apps_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowDown_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowDown_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowDown_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowLeft_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowLeft_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowLeft_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowRight_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowRight_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowRight_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowUp_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowUp_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_arrowUp_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_artboard_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_artboard_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_artboard_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_bell_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_bell_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_bell_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_bolt_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_bolt_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_bolt_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_brand_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_brand_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_brand_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_briefcase_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_briefcase_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_briefcase_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browserError_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browserError_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browserError_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browserNotCompatible_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browserNotCompatible_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browserNotCompatible_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browser_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browser_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_browser_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_buildTable_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_buildTable_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_buildTable_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_buildings_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_buildings_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_buildings_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_calendar_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_calendar_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_calendar_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_camera_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_camera_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_camera_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_chatbubble_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_chatbubble_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_chatbubble_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_check_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_check_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_check_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_clipboard_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_clipboard_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_clipboard_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_clock_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_clock_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_clock_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_close_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_close_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_close_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudStateDisconnected_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudStateDisconnected_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudStateDisconnected_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudStateError_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudStateError_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudStateError_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudUpload_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudUpload_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloudUpload_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloud_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloud_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cloud_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_codeBrackets_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_codeBrackets_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_codeBrackets_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_confettiCelebration_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_confettiCelebration_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_confettiCelebration_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_conversationbubbles_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_conversationbubbles_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_conversationbubbles_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cursor_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cursor_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_cursor_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_desktop_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_desktop_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_desktop_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_document_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_document_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_document_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_dropToUpload_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_dropToUpload_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_dropToUpload_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_emptyStateExport_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_emptyStateExport_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_emptyStateExport_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_error_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_error_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_error_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileAlert_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileAlert_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileAlert_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileImage_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileImage_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileImage_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileText_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileText_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileText_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileVideo_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileVideo_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileVideo_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileZip_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileZip_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fileZip_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_filmstrip_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_filmstrip_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_filmstrip_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_filter_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_filter_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_filter_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fireworks_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fireworks_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_fireworks_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_folderClose_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_folderClose_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_folderClose_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_folderOpen_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_folderOpen_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_folderOpen_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_gearSetting_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_gearSetting_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_gearSetting_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_graphBarChart_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_graphBarChart_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_graphBarChart_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_handshake_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_handshake_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_handshake_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_heart_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_heart_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_heart_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_imageStack_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_imageStack_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_imageStack_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_image_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_image_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_image_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_information_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_information_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_information_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_laptop_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_laptop_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_laptop_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_layers_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_layers_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_layers_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_libraries_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_libraries_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_libraries_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lightbulbRays_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lightbulbRays_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lightbulbRays_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lightbulb_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lightbulb_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lightbulb_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_link_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_link_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_link_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_location_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_location_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_location_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lockClose_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lockClose_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lockClose_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lockOpen_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lockOpen_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_lockOpen_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_logo_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_logo_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_logo_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_mailClose_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_mailClose_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_mailClose_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_megaphonePromote_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_megaphonePromote_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_megaphonePromote_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_megaphonePromote_Expressive_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_megaphonePromote_Expressive_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_megaphonePromote_Expressive_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_paperairplane_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_paperairplane_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_paperairplane_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_paperclip_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_paperclip_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_paperclip_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_phone_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_phone_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_phone_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_pieChart_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_pieChart_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_pieChart_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_pin_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_pin_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_pin_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_play_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_play_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_play_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_plugin_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_plugin_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_plugin_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_rocket_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_rocket_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_rocket_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_search_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_search_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_search_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_server_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_server_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_server_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_sparkles_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_sparkles_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_sparkles_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_star_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_star_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_star_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_tablet_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_tablet_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_tablet_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_tag_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_tag_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_tag_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_trash_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_trash_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_trash_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_trophy_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_trophy_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_trophy_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_update_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_update_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_update_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_userGroup_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_userGroup_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_userGroup_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_user_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_user_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_user_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_video_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_video_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_video_96.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_warning_160.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_warning_48.d.ts +1 -13
- package/illustrations/linear/internal/S2_lin_warning_96.d.ts +1 -13
- package/package.json +4 -4
- package/src/ActionButton.tsx +2 -2
- package/src/Avatar.tsx +1 -1
- package/src/Breadcrumbs.tsx +3 -1
- package/src/Dialog.tsx +105 -104
- package/src/Meter.tsx +5 -3
- package/src/Tabs.tsx +4 -1
- package/src/TagGroup.tsx +1 -1
package/dist/TagGroup.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AAuEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAiE;AAE5G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM,8DAA0B,CAAA,GAAA,0BAAY,EAAsB,CAAC;AAEnE,SAAS,+BAA2B,KAAuB,EAAE,GAA2B;IACtF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,qBACE,gCAAC,8CAAwB,QAAQ;QAAC,OAAO;sBAAC;QAAQ;kBAChD,cAAA,gCAAC,CAAA,GAAA,6CAAgB;YAAE,uBAAS,gCAAC,CAAA,GAAA,sCAAS;gBAAG,GAAG,KAAK;;sBAC9C,CAAA,2BAAc,gCAAC;o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A,GAAA,uBAAS,EAAqB;AAGxD,SAAS,iCAAW,YAAC,QAAQ,cAAE,UAAU,kBAAE,cAAc,eAAE,WAAW,EAAC;IACrE,IAAI,QAAC,IAAI,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE,8CAAoB,CAAC;IACpD,qBACE;;YACG,6BACD,gCAAC;gBACC,SAAS;0BAQT,cAAA,gCAAC,CAAA,GAAA,mCAAO;oBACN,QAAQ;wBACN;4BAAC,CAAA,GAAA,qCAAU;4BAAG;gCAAC,MAAM;4BAAmC;yBAAE;wBAC1D;4BAAC,CAAA,GAAA,qCAAU;4BAAG;gCACZ,QAAQ,CAAA,GAAA,wCAAa,EAAE;oCAAC,MAAM;oCAAQ,MAAM;gCAAmB;gCAC/D,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,uCAAY;4BAAG;gCACd,MAAM,gCAAU,CAAC,KAAK;gCACtB,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,sCAAW;4BAAG;gCACb,SAAS;4BAQX;yBAAE;qBACH;8BACA;;;YAIJ,CAAC,eAAe;YAChB,kBAAkB,6BACjB,gCAAC,CAAA,GAAA,qCAAU;gBACT,MAAK;gBACL,MAAM;gBACN,YAAY;;;;AAItB","sources":["packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {fontRelative, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext, Text, TextContext} from './Content';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children?: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\nfunction TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nlet _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n // possibly should render a tag look alike instead though, so i don't call the hooks either or add id's to elements etc\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <_Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style({\n ...focusRing(),\n display: 'inline-flex',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\nfunction Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n}\n\n\n/** An individual Tag for TagGroups. */\nlet _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);\nexport {_Tag as Tag};\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n className: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AAuEM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAiE;AAE5G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM,8DAA0B,CAAA,GAAA,0BAAY,EAAsB,CAAC;AAEnE,SAAS,+BAA2B,KAAuB,EAAE,GAA2B;IACtF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,qBACE,gCAAC,8CAAwB,QAAQ;QAAC,OAAO;sBAAC;QAAQ;kBAChD,cAAA,gC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yBAAW,gCAAC,CAAA,GAAA,8BAAG;8BAAG;qBAAmB;;;AAIzH;AAGA,qCAAqC,GACrC,IAAI,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAGxD,SAAS,iCAAW,YAAC,QAAQ,cAAE,UAAU,kBAAE,cAAc,eAAE,WAAW,EAAC;IACrE,IAAI,QAAC,OAAO,KAAI,GAAG,CAAA,GAAA,4CAAgB,EAAE,8CAAoB,CAAC;IAC1D,qBACE;;YACG,6BACD,gCAAC;gBACC,SAAS;0BAQT,cAAA,gCAAC,CAAA,GAAA,mCAAO;oBACN,QAAQ;wBACN;4BAAC,CAAA,GAAA,qCAAU;4BAAG;gCAAC,MAAM;4BAAmC;yBAAE;wBAC1D;4BAAC,CAAA,GAAA,qCAAU;4BAAG;gCACZ,QAAQ,CAAA,GAAA,wCAAa,EAAE;oCAAC,MAAM;oCAAQ,MAAM;gCAAmB;gCAC/D,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,uCAAY;4BAAG;gCACd,MAAM,gCAAU,CAAC,KAAK;gCACtB,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,sCAAW;4BAAG;gCACb,SAAS;4BAQX;yBAAE;qBACH;8BACA;;;YAIJ,CAAC,eAAe;YAChB,kBAAkB,6BACjB,gCAAC,CAAA,GAAA,qCAAU;gBACT,MAAK;gBACL,MAAM;gBACN,YAAY;;;;AAItB","sources":["packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {fontRelative, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext, Text, TextContext} from './Content';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children?: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\nfunction TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nlet _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n // possibly should render a tag look alike instead though, so i don't call the hooks either or add id's to elements etc\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <_Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style({\n ...focusRing(),\n display: 'inline-flex',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\nfunction Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n}\n\n\n/** An individual Tag for TagGroups. */\nlet _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);\nexport {_Tag as Tag};\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n className: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.cjs.map"}
|
package/dist/TagGroup.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACmFuB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2Ma;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAcjB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;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;;IAAA;;;;;;AAgHC","sources":["b7ca70995960d034","packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["@import \"53ec8c3f8184f13f\";\n@import \"39511c3f261b5ed5\";\n@import \"0adf7c6cbf3a1f42\";\n@import \"05f90dba9e9f901e\";\n@import \"76f74241f914b430\";\n@import \"0ef2aba34cf241d8\";\n@import \"f86d9fb495210c39\";\n@import \"24a7cd4eab7f1ba0\";\n@import \"ce1f7d95b3ccf3fd\";\n@import \"70bbf6109092559b\";\n@import \"07833edfdb3bfcff\";\n@import \"ffbc1ae1f89af4e1\";\n@import \"c340d154a58b1eb0\";\n@import \"27e38777e711f6a4\";\n@import \"39f1002cc14ab33a\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {fontRelative, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext, Text, TextContext} from './Content';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children?: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\nfunction TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nlet _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n // possibly should render a tag look alike instead though, so i don't call the hooks either or add id's to elements etc\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <_Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style({\n ...focusRing(),\n display: 'inline-flex',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\nfunction Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n}\n\n\n/** An individual Tag for TagGroups. */\nlet _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);\nexport {_Tag as Tag};\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n className: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.css.map"}
|
|
1
|
+
{"mappings":"ACmFuB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2Ma;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAcjB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAgCF;;;;EAwDR;;;;EA6BC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAgHC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUgB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAOG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA3eF;EAuWL;;;;EAAA;;;;;AAvWK;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IA2Ma;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAuEX;;;;IAqFP;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAgHC;;;;IAAA;;;;IAAA;;;;;;AAhHD;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAgHC","sources":["b7ca70995960d034","packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["@import \"53ec8c3f8184f13f\";\n@import \"39511c3f261b5ed5\";\n@import \"0adf7c6cbf3a1f42\";\n@import \"05f90dba9e9f901e\";\n@import \"76f74241f914b430\";\n@import \"0ef2aba34cf241d8\";\n@import \"f86d9fb495210c39\";\n@import \"24a7cd4eab7f1ba0\";\n@import \"ce1f7d95b3ccf3fd\";\n@import \"70bbf6109092559b\";\n@import \"07833edfdb3bfcff\";\n@import \"ffbc1ae1f89af4e1\";\n@import \"c340d154a58b1eb0\";\n@import \"27e38777e711f6a4\";\n@import \"39f1002cc14ab33a\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {fontRelative, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext, Text, TextContext} from './Content';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children?: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\nfunction TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nlet _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n // possibly should render a tag look alike instead though, so i don't call the hooks either or add id's to elements etc\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <_Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style({\n ...focusRing(),\n display: 'inline-flex',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\nfunction Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n}\n\n\n/** An individual Tag for TagGroups. */\nlet _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);\nexport {_Tag as Tag};\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n className: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.css.map"}
|
package/dist/TagGroup.mjs
CHANGED
|
@@ -629,7 +629,7 @@ function $1d63bfab43d9ffe1$var$Tag({ children: children, textValue: textValue, .
|
|
|
629
629
|
}
|
|
630
630
|
/** An individual Tag for TagGroups. */ let $1d63bfab43d9ffe1$export$3288d34c523a1192 = /*#__PURE__*/ (0, $kY5I6$forwardRef)($1d63bfab43d9ffe1$var$Tag);
|
|
631
631
|
function $1d63bfab43d9ffe1$var$TagWrapper({ children: children, isDisabled: isDisabled, allowsRemoving: allowsRemoving, isInRealDOM: isInRealDOM }) {
|
|
632
|
-
let { size: size } = (0, $kY5I6$useSlottedContext)($1d63bfab43d9ffe1$export$5b07b5dd2cbd96e3) ?? {};
|
|
632
|
+
let { size: size = 'M' } = (0, $kY5I6$useSlottedContext)($1d63bfab43d9ffe1$export$5b07b5dd2cbd96e3) ?? {};
|
|
633
633
|
return /*#__PURE__*/ (0, $kY5I6$jsxs)((0, $kY5I6$Fragment), {
|
|
634
634
|
children: [
|
|
635
635
|
isInRealDOM && /*#__PURE__*/ (0, $kY5I6$jsx)("div", {
|
package/dist/TagGroup.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AAuEM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAiE;AAE5G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM,8DAA0B,CAAA,GAAA,oBAAY,EAAsB,CAAC;AAEnE,SAAS,+BAA2B,KAAuB,EAAE,GAA2B;IACtF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,qBACE,gBAAC,8CAAwB,QAAQ;QAAC,OAAO;sBAAC;QAAQ;kBAChD,cAAA,gBAAC,CAAA,GAAA,wBAAgB;YAAE,uBAAS,gBAAC,CAAA,GAAA,iBAAS;gBAAG,GAAG,KAAK;;sBAC9C,CAAA,2BAAc,gBAAC;oBAAc,OAAO;oBAAO,cAAc;oBAAK,YAAY;;;;AAInF;AAEA,4IAA4I,GAC5I,IAAI,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAG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BAAgB,EAAE,8CAAoB,CAAC;IACpD,qBACE;;YACG,6BACD,gBAAC;gBACC,SAAS;0BAQT,cAAA,gBAAC,CAAA,GAAA,eAAO;oBACN,QAAQ;wBACN;4BAAC,CAAA,GAAA,yCAAU;4BAAG;gCAAC,MAAM;4BAAmC;yBAAE;wBAC1D;4BAAC,CAAA,GAAA,yCAAU;4BAAG;gCACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;oCAAC,MAAM;oCAAQ,MAAM;gCAAmB;gCAC/D,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,yCAAY;4BAAG;gCACd,MAAM,gCAAU,CAAC,KAAK;gCACtB,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,yCAAW;4BAAG;gCACb,SAAS;4BAQX;yBAAE;qBACH;8BACA;;;YAIJ,CAAC,eAAe;YAChB,kBAAkB,6BACjB,gBAAC,CAAA,GAAA,yCAAU;gBACT,MAAK;gBACL,MAAM;gBACN,YAAY;;;;AAItB","sources":["packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {fontRelative, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext, Text, TextContext} from './Content';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children?: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\nfunction TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nlet _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n // possibly should render a tag look alike instead though, so i don't call the hooks either or add id's to elements etc\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <_Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style({\n ...focusRing(),\n display: 'inline-flex',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\nfunction Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n}\n\n\n/** An individual Tag for TagGroups. */\nlet _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);\nexport {_Tag as Tag};\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n className: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AAuEM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAiE;AAE5G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN,MAAM,8DAA0B,CAAA,GAAA,oBAAY,EAAsB,CAAC;AAEnE,SAAS,+BAA2B,KAAuB,EAAE,GAA2B;IACtF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,qBACE,gBAAC,8CAAwB,QAAQ;QAAC,OAAO;sBAAC;QAAQ;kBAChD,cAAA,gBAAC,CAAA,GAAA,wBAAgB;YAAE,uBAAS,gBAAC,CAAA,GAAA,iBAAS;gBAAG,GAAG,KAAK;;sBAC9C,CAAA,2BAAc,gBAAC;oBAAc,OAAO;oBAAO,cAAc;oBAAK,YAAY;;;;AA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,UAAU,kBAAE,cAAc,eAAE,WAAW,EAAC;IACrE,IAAI,QAAC,OAAO,KAAI,GAAG,CAAA,GAAA,wBAAgB,EAAE,8CAAoB,CAAC;IAC1D,qBACE;;YACG,6BACD,gBAAC;gBACC,SAAS;0BAQT,cAAA,gBAAC,CAAA,GAAA,eAAO;oBACN,QAAQ;wBACN;4BAAC,CAAA,GAAA,yCAAU;4BAAG;gCAAC,MAAM;4BAAmC;yBAAE;wBAC1D;4BAAC,CAAA,GAAA,yCAAU;4BAAG;gCACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;oCAAC,MAAM;oCAAQ,MAAM;gCAAmB;gCAC/D,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,yCAAY;4BAAG;gCACd,MAAM,gCAAU,CAAC,KAAK;gCACtB,MAAM;4BACR;yBAAE;wBACF;4BAAC,CAAA,GAAA,yCAAW;4BAAG;gCACb,SAAS;4BAQX;yBAAE;qBACH;8BACA;;;YAIJ,CAAC,eAAe;YAChB,kBAAkB,6BACjB,gBAAC,CAAA,GAAA,yCAAU;gBACT,MAAK;gBACL,MAAM;gBACN,YAAY;;;;AAItB","sources":["packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, focusRing, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {fontRelative, style} from '../style/spectrum-theme' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext, Text, TextContext} from './Content';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children?: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps<any>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\nfunction TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n}\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nlet _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n // possibly should render a tag look alike instead though, so i don't call the hooks either or add id's to elements etc\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <_Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style({\n ...focusRing(),\n display: 'inline-flex',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\nfunction Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n}\n\n\n/** An individual Tag for TagGroups. */\nlet _Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(Tag);\nexport {_Tag as Tag};\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n className: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.mjs.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -450,7 +450,7 @@ export interface BreadcrumbsProps<T> extends Omit<_BreadcrumbsProps1<T>, 'childr
|
|
|
450
450
|
/** The children of the Breadcrumbs. */
|
|
451
451
|
children?: ReactNode;
|
|
452
452
|
}
|
|
453
|
-
export const BreadcrumbsContext: Context<ContextValue<BreadcrumbsProps<any>, DOMRefValue<
|
|
453
|
+
export const BreadcrumbsContext: Context<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>;
|
|
454
454
|
/** Breadcrumbs show hierarchy and navigational context for a user’s location within an application. */
|
|
455
455
|
export let Breadcrumbs: <T extends object>(props: BreadcrumbsProps<T> & RefAttributes<DOMRefValue<HTMLOListElement>>) => ReactElement | null;
|
|
456
456
|
export interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus'>, LinkDOMProps {
|
|
@@ -809,8 +809,10 @@ export const LinkContext: Context<ContextValue<LinkProps, FocusableRefValue<HTML
|
|
|
809
809
|
*/
|
|
810
810
|
export const Link: ForwardRefExoticComponent<LinkProps & RefAttributes<FocusableRefValue<HTMLAnchorElement, HTMLAnchorElement>>>;
|
|
811
811
|
interface MeterStyleProps {
|
|
812
|
-
/** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter.
|
|
813
|
-
|
|
812
|
+
/** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter.
|
|
813
|
+
* @default 'informative'
|
|
814
|
+
*/
|
|
815
|
+
variant?: 'informative' | 'positive' | 'notice' | 'negative';
|
|
814
816
|
/**
|
|
815
817
|
* The size of the Meter.
|
|
816
818
|
*
|
|
@@ -1048,7 +1050,10 @@ export interface TabsProps extends Omit<_TabsProps1, 'className' | 'style' | 'ch
|
|
|
1048
1050
|
styles?: StylesPropWithHeight;
|
|
1049
1051
|
/** The content to display in the tabs. */
|
|
1050
1052
|
children?: ReactNode;
|
|
1051
|
-
/**
|
|
1053
|
+
/**
|
|
1054
|
+
* The amount of space between the tabs.
|
|
1055
|
+
* @default "regular"
|
|
1056
|
+
*/
|
|
1052
1057
|
density?: 'compact' | 'regular';
|
|
1053
1058
|
}
|
|
1054
1059
|
export interface TabProps extends Omit<_TabProps1, 'children' | 'style' | 'className'>, StyleProps {
|