@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/Dialog.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACyCc;EAAA;;;;EAAA;;;;EAAA;;;;EAME;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAMD;;;;EAIE;;;;EAiBF;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAKK;;;;EAAA;;;;EAwEO;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwDF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiBE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqC8E;;;;EAiBhF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA7OX;EAME;;;;;;EAAA;;;;EA2BD;;;;EA6EY;;;;EAyEA;;;;EAAA;;;;EAsDF;;;;;AA7OX;;AAME;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAMD;;;;IAIE;;;;;;AAAA;EAAA;IAAA;;;;;;AAuKU;EAAA;IAAA;;;;IAAA;;;;;;AAqC8E","sources":["ebf76300d207adbd","packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["@import \"41c4aa1296799ea1\";\n@import \"b6cb6ab59865bde8\";\n@import \"c2aa69bcd8dab7fb\";\n@import \"e9cdd4f3ada8c5d9\";\n@import \"722603297b70d86b\";\n@import \"d1b118504b390ed5\";\n@import \"a59d0f5a0e9cb2ac\";\n@import \"26ac236cb46f8555\";\n@import \"8b070308c4891c21\";\n@import \"5ec9bfe5eed7daff\";\n@import \"7eb24a82f7ffd3c6\";\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 {PopoverProps as AriaPopoverProps, composeRenderProps, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) =>\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n (<>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </>)\n )}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.css.map"}
|
|
1
|
+
{"mappings":"ACyCc;EAAA;;;;EAAA;;;;EAAA;;;;EAME;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAMD;;;;EAIE;;;;EAiBF;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAKK;;;;EAAA;;;;EAwEO;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyDJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiBE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAqC8E;;;;EAiBhF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9OT;EAME;;;;;;EAAA;;;;EA2BD;;;;EA6EY;;;;EA0EF;;;;EAAA;;;;EAsDF;;;;;AA9OT;;AAME;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAMD;;;;IAIE;;;;;;AAAA;EAAA;IAAA;;;;;;AAwKQ;EAAA;IAAA;;;;IAAA;;;;;;AAqC8E","sources":["ebf76300d207adbd","packages/@react-spectrum/s2/src/Dialog.tsx"],"sourcesContent":["@import \"41c4aa1296799ea1\";\n@import \"b6cb6ab59865bde8\";\n@import \"c2aa69bcd8dab7fb\";\n@import \"e9cdd4f3ada8c5d9\";\n@import \"722603297b70d86b\";\n@import \"d1b118504b390ed5\";\n@import \"a59d0f5a0e9cb2ac\";\n@import \"26ac236cb46f8555\";\n@import \"8b070308c4891c21\";\n@import \"5ec9bfe5eed7daff\";\n@import \"7eb24a82f7ffd3c6\";\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 {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.css.map"}
|
package/dist/Dialog.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import {ContentContext as $8e847109a6ab556d$export$1cbdd774077931b4, FooterConte
|
|
|
5
5
|
import $9Rtwv$intlStringsmjs from "./intlStrings.mjs";
|
|
6
6
|
import {Modal as $c46d159bd615e407$export$2b77a92f1a5ad772} from "./Modal.mjs";
|
|
7
7
|
import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
|
|
8
|
-
import {jsx as $9Rtwv$jsx, jsxs as $9Rtwv$jsxs
|
|
9
|
-
import {Dialog as $9Rtwv$Dialog, composeRenderProps as $9Rtwv$composeRenderProps, Provider as $9Rtwv$Provider} from "react-aria-components";
|
|
8
|
+
import {jsx as $9Rtwv$jsx, jsxs as $9Rtwv$jsxs} from "react/jsx-runtime";
|
|
9
|
+
import {Dialog as $9Rtwv$Dialog, composeRenderProps as $9Rtwv$composeRenderProps, OverlayTriggerStateContext as $9Rtwv$OverlayTriggerStateContext, Provider as $9Rtwv$Provider} from "react-aria-components";
|
|
10
10
|
import {createContext as $9Rtwv$createContext, useContext as $9Rtwv$useContext, forwardRef as $9Rtwv$forwardRef} from "react";
|
|
11
11
|
import {useDOMRef as $9Rtwv$useDOMRef, useMediaQuery as $9Rtwv$useMediaQuery} from "@react-spectrum/utils";
|
|
12
12
|
import {useLocalizedStringFormatter as $9Rtwv$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
@@ -139,7 +139,11 @@ function $9bbc115952dac5a6$var$DialogInner(props1) {
|
|
|
139
139
|
ref: props1.dialogRef,
|
|
140
140
|
style: props1.UNSAFE_style,
|
|
141
141
|
className: (props1.UNSAFE_className || '') + $9bbc115952dac5a6$export$6af31f836f9aa6f2,
|
|
142
|
-
children: (0, $9Rtwv$composeRenderProps)(props1.children, (children, { close: close })
|
|
142
|
+
children: (0, $9Rtwv$composeRenderProps)(props1.children, (children, { close: close })=>// Render the children multiple times inside the wrappers we need to implement the layout.
|
|
143
|
+
// Each instance hides certain children so that they are all rendered in the correct locations.
|
|
144
|
+
// Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.
|
|
145
|
+
/*#__PURE__*/ (0, $9Rtwv$jsxs)((0, $9Rtwv$OverlayTriggerStateContext).Provider, {
|
|
146
|
+
value: null,
|
|
143
147
|
children: [
|
|
144
148
|
/*#__PURE__*/ (0, $9Rtwv$jsx)((0, $9Rtwv$Provider), {
|
|
145
149
|
values: [
|
package/dist/Dialog.mjs.map
CHANGED
|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AA,GAAA,eAAO;4BACN,QAAQ;gCACN;oCAAC,CAAA,GAAA,yCAAW;oCAAG;wCAAC,QAAQ;oCAAI;iCAAE;gCAC9B;oCAAC,CAAA,GAAA,yCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,yCAAY;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAa;oCAAG;wCAAC,UAAU;oCAAI;iCAAE;gCAClC;oCAAC,CAAA,GAAA,yCAAY;oCAAG;wCAAC,QAAQ;oCAAM;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAiB;oCAAG;wCAAC,UAAU,yBAAyB;wCAAU,QAAQ;wCAAa,OAAO;oCAAK;iCAAE;6BACvG;sCACA;;;;;;AAOjB","sources":["packages/@react-spectrum/s2/src/Dialog.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 {PopoverProps as AriaPopoverProps, composeRenderProps, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) =>\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n (<>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </>)\n )}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA+BD,MAAM;AAMN,MAAM;AAMN,MAAM;AAIN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBN,MAAM;AAKN,MAAM;AAwBC,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAsB;IAC7D,MAAM;IACN,eAAe;IACf,WAAW;IACX,YAAY;IACZ,2BAA2B;AAC7B;AAEA,SAAS,6BAAO,KAAkB,EAAE,GAAW;IAC7C,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,aAAa;IAC5D,IAAI,4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CAAM;iCAAE;gCACjC;oCAAC,CAAA,GAAA,yCAAiB;oCAAG;wCAAC,UAAU,yBAAyB;wCAAU,QAAQ;wCAAa,OAAO;oCAAK;iCAAE;6BACvG;sCACA;;;;;;AAOf","sources":["packages/@react-spectrum/s2/src/Dialog.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 {PopoverProps as AriaPopoverProps, composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components';\nimport {ButtonGroupContext} from './ButtonGroup';\nimport {CloseButton} from './CloseButton';\nimport {ContentContext, FooterContext, HeaderContext, HeadingContext, ImageContext} from './Content';\nimport {createContext, forwardRef, RefObject, useContext} from 'react';\nimport {DOMRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Modal} from './Modal';\nimport {Popover} from './Popover';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {StyleProps} from './style-utils';\nimport {useDOMRef, useMediaQuery} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n// TODO: what style overrides should be allowed?\nexport interface DialogProps extends Omit<RACDialogProps, 'className' | 'style'>, StyleProps {\n /**\n * Whether the Dialog is dismissable.\n */\n isDismissable?: boolean,\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst image = style({\n width: 'full',\n height: '[140px]',\n objectFit: 'cover'\n});\n\nconst heading = style({\n flexGrow: 1,\n marginY: 0,\n font: 'heading'\n});\n\nconst header = style({\n font: 'body-lg'\n});\n\nconst content = style({\n flexGrow: 1,\n overflowY: {\n default: 'auto',\n // Make the whole dialog scroll rather than only the content when the height it small.\n '@media (height < 400)': 'visible',\n type: {\n popover: 'visible'\n }\n },\n font: 'body',\n // TODO: adjust margin on mobile?\n marginX: {\n default: 32\n }\n});\n\nconst footer = style({\n flexGrow: 1,\n font: 'body'\n});\n\nconst buttonGroup = style({\n marginStart: 'auto',\n maxWidth: 'full'\n});\n\ninterface DialogContextValue extends Pick<AriaPopoverProps, 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /**\n * The type of Dialog that should be rendered.\n */\n type?: 'modal' | 'popover' | 'fullscreen' | 'fullscreenTakeover', // TODO: add tray back in\n /**\n * Whether a modal type Dialog should be dismissable.\n */\n isDismissable?: boolean,\n /**\n * Whether a popover type Dialog's arrow should be hidden.\n */\n hideArrow?: boolean,\n /**\n * Whether pressing the escape key to close the dialog should be disabled.\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport const DialogContext = createContext<DialogContextValue>({\n type: 'modal',\n isDismissable: false,\n hideArrow: false,\n shouldFlip: true,\n isKeyboardDismissDisabled: false\n});\n\nfunction Dialog(props: DialogProps, ref: DOMRef) {\n let ctx = useContext(DialogContext);\n let isDismissable = ctx.isDismissable || props.isDismissable;\n let isKeyboardDismissDisabled = ctx.isKeyboardDismissDisabled;\n let domRef = useDOMRef(ref);\n\n switch (ctx.type) {\n case 'modal':\n case 'fullscreen':\n case 'fullscreenTakeover': {\n let size = ctx.type === 'modal' ? props.size : ctx.type;\n return (\n <Modal size={size} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Modal>\n );\n }\n case 'popover':\n // get hideArrow from dialog instead?\n return (\n <Popover size={props.size || 'M'} hideArrow={ctx.hideArrow} placement={ctx.placement} shouldFlip={ctx.shouldFlip} containerPadding={ctx.containerPadding} offset={ctx.offset} crossOffset={ctx.crossOffset}>\n <DialogInner {...props} {...ctx} dialogRef={domRef} isDismissable={isDismissable} />\n </Popover>\n );\n\n // TODO: popover/tray\n // how do we want to do popover, v3 dialogtrigger rendered it, not the dialog\n // in addition, how do we want to handle the margins that dialog currently imposes, just change them to 0 for popover?\n // in order for the dialog to contain scrolling behavior, we'd need to follow what i did for menu otherwise the internal padding\n // of the popover will squish the scrollable content area and the scroll bar will appear to be inside instead of part of the popover\n }\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nlet _Dialog = forwardRef(Dialog);\nexport {_Dialog as Dialog};\n\nexport const dialogInner = style({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n maxHeight: '[inherit]',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n fontFamily: 'sans',\n borderRadius: '[inherit]',\n overflow: 'auto'\n});\n\nfunction DialogInner(props: DialogProps & DialogContextValue & {dialogRef: RefObject<HTMLElement | null>}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n // The button group in fullscreen dialogs usually goes at the top, but\n // when the window is small, it moves to the bottom. We could do this in\n // pure CSS with display: none, but then the ref would go to two places.\n // With JS we can actually unmount on of them to ensure there is only one at a time.\n // Hopefully apps don't SSR render a dialog that's already open, because this means\n // we don't evaluate the media query until JS loads.\n let isSmall = useMediaQuery('(max-width: 640px)');\n let buttonGroupPlacement = 'bottom';\n if (props.type === 'fullscreen' || props.type === 'fullscreenTakeover') {\n buttonGroupPlacement = isSmall ? 'bottom' : 'top';\n }\n\n if (props.isDismissable) {\n buttonGroupPlacement = 'none';\n }\n\n // TODO: manage focus when the button group placement changes and focus was on one of the buttons?\n\n return (\n <RACDialog\n {...props}\n ref={props.dialogRef}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + dialogInner}>\n {composeRenderProps(props.children, (children, {close}) => (\n // Render the children multiple times inside the wrappers we need to implement the layout.\n // Each instance hides certain children so that they are all rendered in the correct locations.\n // Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.\n <OverlayTriggerStateContext.Provider value={null}>\n {/* Hero image */}\n <Provider\n values={[\n [ImageContext, {className: image}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Top header: heading, header, dismiss button, and button group (in fullscreen dialogs). */}\n <div\n className={style({\n // Wrapper that creates the margin for the dismiss button.\n display: 'flex',\n alignItems: 'start',\n columnGap: 12,\n marginStart: {\n default: 32\n },\n marginEnd: {\n default: 32,\n isDismissable: 12\n },\n marginTop: {\n default: 12 // margin to dismiss button\n }\n })({isDismissable: props.isDismissable, type: props.type})}>\n <div\n className={style({\n // Wrapper for heading, header, and button group.\n // This swaps orientation from horizontal to vertical at small screen sizes.\n display: 'flex',\n flexGrow: 1,\n marginTop: {\n default: 20, // 32 - 12 (handled above)\n ':empty': 0\n },\n marginBottom: {\n default: 16,\n ':empty': 0\n },\n columnGap: 24,\n rowGap: 8,\n flexDirection: {\n default: 'column',\n sm: 'row'\n },\n alignItems: {\n default: 'start',\n sm: 'center'\n }\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {styles: heading}],\n [HeaderContext, {styles: header}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'top'}]\n ]}>\n {children}\n </Provider>\n </div>\n {props.isDismissable &&\n <CloseButton aria-label={stringFormatter.format('dialog.dismiss')} onPress={close} styles={style({marginBottom: 12})} />\n }\n </div>\n {/* Main content */}\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {styles: content({type: props.type})}],\n [FooterContext, {isHidden: true}],\n [ButtonGroupContext, {isHidden: true}]\n ]}>\n {children}\n </Provider>\n {/* Footer and button group */}\n <div\n className={style({\n display: 'flex',\n paddingX: {\n default: 32\n },\n paddingBottom: {\n default: 32\n },\n paddingTop: {\n default: 32,\n ':empty': 0\n },\n gap: 24,\n alignItems: 'center',\n flexWrap: 'wrap'\n })}>\n <Provider\n values={[\n [ImageContext, {hidden: true}],\n [HeadingContext, {isHidden: true}],\n [HeaderContext, {isHidden: true}],\n [ContentContext, {isHidden: true}],\n [FooterContext, {styles: footer}],\n [ButtonGroupContext, {isHidden: buttonGroupPlacement !== 'bottom', styles: buttonGroup, align: 'end'}]\n ]}>\n {children}\n </Provider>\n </div>\n </OverlayTriggerStateContext.Provider>\n ))}\n </RACDialog>\n );\n}\n"],"names":[],"version":3,"file":"Dialog.mjs.map"}
|
package/dist/Meter.cjs
CHANGED
|
@@ -211,7 +211,7 @@ const $f53cdf036c04454a$var$fillStyles = function anonymous(props) {
|
|
|
211
211
|
function $f53cdf036c04454a$var$Meter(props, ref) {
|
|
212
212
|
[props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $f53cdf036c04454a$export$8b645da15a96b44f);
|
|
213
213
|
let domRef = (0, $aQdtU$reactspectrumutils.useDOMRef)(ref);
|
|
214
|
-
let { label: label, size: size = 'M', staticColor: staticColor, styles: styles, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, variant: variant, ...groupProps } = props;
|
|
214
|
+
let { label: label, size: size = 'M', staticColor: staticColor, styles: styles, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, variant: variant = 'informative', ...groupProps } = props;
|
|
215
215
|
return /*#__PURE__*/ (0, $aQdtU$reactjsxruntime.jsx)((0, $aQdtU$reactariacomponents.Meter), {
|
|
216
216
|
...groupProps,
|
|
217
217
|
ref: domRef,
|
package/dist/Meter.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{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AAG;;;;;;AAM/F;AAEA;;;CAGC,GACD,IAAI,0DAAS,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Meter.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 {\n Meter as AriaMeter,\n MeterProps as AriaMeterProps,\n ContextValue\n} from 'react-aria-components';\nimport {bar, track} from './bar-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {size, style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface MeterStyleProps {\n /** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter.\n * @default 'informative'\n */\n variant?: 'informative' | 'positive' | 'notice' | 'negative',\n /**\n * The size of the Meter.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the button appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'children' | 'className' | 'style'>, MeterStyleProps, StyleProps {\n /** The content to display as the label. */\n label?: ReactNode\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<MeterStyleProps>({\n ...bar(),\n width: {\n default: 208,\n size: {\n S: 192,\n L: 224,\n XL: 240\n }\n }\n}, getAllowedOverrides());\n\nconst valueStyles = style({\n ...fieldLabel(),\n gridArea: 'value'\n});\n\nconst trackStyles = style({\n ...track(),\n height: {\n default: size(6),\n size: {\n S: 4, // progress-bar-thickness-small\n M: size(6), // progress-bar-thickness-medium\n L: 8, // progress-bar-thickness-large\n XL: size(10) // progress-bar-thickness-extra-large\n }\n }\n});\n\nconst fillStyles = style<MeterStyleProps>({\n height: 'full',\n borderStyle: 'none',\n borderRadius: 'full',\n backgroundColor: {\n default: 'informative',\n variant: {\n positive: 'positive',\n notice: 'notice',\n negative: 'negative'\n },\n staticColor: {\n white: {\n default: 'transparent-white-900'\n },\n // TODO: Is there a black static color in S2?\n black: {\n default: 'transparent-black-900'\n }\n },\n forcedColors: 'ButtonText'\n }\n});\n\nfunction Meter(props: MeterProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, MeterContext);\n let domRef = useDOMRef(ref);\n\n let {\n label,\n size = 'M',\n staticColor,\n styles,\n UNSAFE_className = '',\n UNSAFE_style,\n variant = 'informative',\n ...groupProps\n } = props;\n\n return (\n <AriaMeter\n {...groupProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size,\n variant,\n staticColor\n }, styles)}>\n {({percentage, valueText}) => (\n <>\n {label && <FieldLabel size={size} labelAlign=\"start\" labelPosition=\"top\" staticColor={staticColor}>{label}</FieldLabel>}\n {label && <span className={valueStyles({size, labelAlign: 'end', staticColor})}>{valueText}</span>}\n <div className={trackStyles({staticColor, size})}>\n <div className={fillStyles({staticColor, variant})} style={{width: percentage + '%'}} />\n </div>\n </>\n )}\n </AriaMeter>\n );\n}\n\n/**\n * Meters are visual representations of a quantity or an achievement.\n * Their progress is determined by user actions, rather than system actions.\n */\nlet _Meter = forwardRef(Meter);\nexport {_Meter as Meter};\n"],"names":[],"version":3,"file":"Meter.cjs.map"}
|
package/dist/Meter.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
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";\n@import \"ae93cf6195cc0b20\";\n@import \"c4a3f6bd0d23c6e6\";\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 {\n Meter as AriaMeter,\n MeterProps as AriaMeterProps,\n ContextValue\n} from 'react-aria-components';\nimport {bar, track} from './bar-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {size, style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface MeterStyleProps {\n /** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter.\n * @default 'informative'\n */\n variant?: 'informative' | 'positive' | 'notice' | 'negative',\n /**\n * The size of the Meter.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the button appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'children' | 'className' | 'style'>, MeterStyleProps, StyleProps {\n /** The content to display as the label. */\n label?: ReactNode\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<MeterStyleProps>({\n ...bar(),\n width: {\n default: 208,\n size: {\n S: 192,\n L: 224,\n XL: 240\n }\n }\n}, getAllowedOverrides());\n\nconst valueStyles = style({\n ...fieldLabel(),\n gridArea: 'value'\n});\n\nconst trackStyles = style({\n ...track(),\n height: {\n default: size(6),\n size: {\n S: 4, // progress-bar-thickness-small\n M: size(6), // progress-bar-thickness-medium\n L: 8, // progress-bar-thickness-large\n XL: size(10) // progress-bar-thickness-extra-large\n }\n }\n});\n\nconst fillStyles = style<MeterStyleProps>({\n height: 'full',\n borderStyle: 'none',\n borderRadius: 'full',\n backgroundColor: {\n default: 'informative',\n variant: {\n positive: 'positive',\n notice: 'notice',\n negative: 'negative'\n },\n staticColor: {\n white: {\n default: 'transparent-white-900'\n },\n // TODO: Is there a black static color in S2?\n black: {\n default: 'transparent-black-900'\n }\n },\n forcedColors: 'ButtonText'\n }\n});\n\nfunction Meter(props: MeterProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, MeterContext);\n let domRef = useDOMRef(ref);\n\n let {\n label,\n size = 'M',\n staticColor,\n styles,\n UNSAFE_className = '',\n UNSAFE_style,\n variant = 'informative',\n ...groupProps\n } = props;\n\n return (\n <AriaMeter\n {...groupProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size,\n variant,\n staticColor\n }, styles)}>\n {({percentage, valueText}) => (\n <>\n {label && <FieldLabel size={size} labelAlign=\"start\" labelPosition=\"top\" staticColor={staticColor}>{label}</FieldLabel>}\n {label && <span className={valueStyles({size, labelAlign: 'end', staticColor})}>{valueText}</span>}\n <div className={trackStyles({staticColor, size})}>\n <div className={fillStyles({staticColor, variant})} style={{width: percentage + '%'}} />\n </div>\n </>\n )}\n </AriaMeter>\n );\n}\n\n/**\n * Meters are visual representations of a quantity or an achievement.\n * Their progress is determined by user actions, rather than system actions.\n */\nlet _Meter = forwardRef(Meter);\nexport {_Meter as Meter};\n"],"names":[],"version":3,"file":"Meter.css.map"}
|
package/dist/Meter.mjs
CHANGED
|
@@ -204,7 +204,7 @@ const $bb56943300b294c6$var$fillStyles = function anonymous(props) {
|
|
|
204
204
|
function $bb56943300b294c6$var$Meter(props, ref) {
|
|
205
205
|
[props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $bb56943300b294c6$export$8b645da15a96b44f);
|
|
206
206
|
let domRef = (0, $blcZa$useDOMRef)(ref);
|
|
207
|
-
let { label: label, size: size = 'M', staticColor: staticColor, styles: styles, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, variant: variant, ...groupProps } = props;
|
|
207
|
+
let { label: label, size: size = 'M', staticColor: staticColor, styles: styles, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style, variant: variant = 'informative', ...groupProps } = props;
|
|
208
208
|
return /*#__PURE__*/ (0, $blcZa$jsx)((0, $blcZa$Meter), {
|
|
209
209
|
...groupProps,
|
|
210
210
|
ref: domRef,
|
package/dist/Meter.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAoCM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAyD;AAEjG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBN,SAAS,4BAAM,KAAiB,EAAE,GAA2B;IAC3D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,SACF,KAAK,QACL,OAAO,kBACP,WAAW,UACX,MAAM,oBACN,mBAAmB,kBACnB,YAAY,WACZ,UAAU,eACV,GAAG,YACJ,GAAG;IAEJ,qBACE,gBAAC,CAAA,GAAA,YAAQ;QACN,GAAG,UAAU;QACd,KAAK;QACL,OAAO;QACP,WAAW,mBAAmB,8BAAQ;kBACpC;qBACA;yBACA;QACF,GAAG;kBACF,CAAC,cAAC,UAAU,aAAE,SAAS,EAAC,iBACvB;;oBACG,uBAAS,gBAAC,CAAA,GAAA,yCAAS;wBAAE,MAAM;wBAAM,YAAW;wBAAQ,eAAc;wBAAM,aAAa;kCAAc;;oBACnG,uBAAS,gBAAC;wBAAK,WAAW,kCAAY;kCAAC;4BAAM,YAAY;yCAAO;wBAAW;kCAAK;;kCACjF,gBAAC;wBAAI,WAAW,kCAAY;yCAAC;kCAAa;wBAAI;kCAC5C,cAAA,gBAAC;4BAAI,WAAW,iCAAW;6CAAC;yCAAa;4BAAO;4BAAI,OAAO;gCAAC,OAAO,aAAa;4BAAG;;;;;;AAM/F;AAEA;;;CAGC,GACD,IAAI,0DAAS,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Meter.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 {\n Meter as AriaMeter,\n MeterProps as AriaMeterProps,\n ContextValue\n} from 'react-aria-components';\nimport {bar, track} from './bar-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {size, style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface MeterStyleProps {\n /** The [visual style](https://spectrum.adobe.com/page/meter/#-Options) of the Meter.\n * @default 'informative'\n */\n variant?: 'informative' | 'positive' | 'notice' | 'negative',\n /**\n * The size of the Meter.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the button appears over a color background. */\n staticColor?: 'white' | 'black'\n}\n\nexport interface MeterProps extends Omit<AriaMeterProps, 'children' | 'className' | 'style'>, MeterStyleProps, StyleProps {\n /** The content to display as the label. */\n label?: ReactNode\n}\n\nexport const MeterContext = createContext<ContextValue<MeterProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<MeterStyleProps>({\n ...bar(),\n width: {\n default: 208,\n size: {\n S: 192,\n L: 224,\n XL: 240\n }\n }\n}, getAllowedOverrides());\n\nconst valueStyles = style({\n ...fieldLabel(),\n gridArea: 'value'\n});\n\nconst trackStyles = style({\n ...track(),\n height: {\n default: size(6),\n size: {\n S: 4, // progress-bar-thickness-small\n M: size(6), // progress-bar-thickness-medium\n L: 8, // progress-bar-thickness-large\n XL: size(10) // progress-bar-thickness-extra-large\n }\n }\n});\n\nconst fillStyles = style<MeterStyleProps>({\n height: 'full',\n borderStyle: 'none',\n borderRadius: 'full',\n backgroundColor: {\n default: 'informative',\n variant: {\n positive: 'positive',\n notice: 'notice',\n negative: 'negative'\n },\n staticColor: {\n white: {\n default: 'transparent-white-900'\n },\n // TODO: Is there a black static color in S2?\n black: {\n default: 'transparent-black-900'\n }\n },\n forcedColors: 'ButtonText'\n }\n});\n\nfunction Meter(props: MeterProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, MeterContext);\n let domRef = useDOMRef(ref);\n\n let {\n label,\n size = 'M',\n staticColor,\n styles,\n UNSAFE_className = '',\n UNSAFE_style,\n variant = 'informative',\n ...groupProps\n } = props;\n\n return (\n <AriaMeter\n {...groupProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size,\n variant,\n staticColor\n }, styles)}>\n {({percentage, valueText}) => (\n <>\n {label && <FieldLabel size={size} labelAlign=\"start\" labelPosition=\"top\" staticColor={staticColor}>{label}</FieldLabel>}\n {label && <span className={valueStyles({size, labelAlign: 'end', staticColor})}>{valueText}</span>}\n <div className={trackStyles({staticColor, size})}>\n <div className={fillStyles({staticColor, variant})} style={{width: percentage + '%'}} />\n </div>\n </>\n )}\n </AriaMeter>\n );\n}\n\n/**\n * Meters are visual representations of a quantity or an achievement.\n * Their progress is determined by user actions, rather than system actions.\n */\nlet _Meter = forwardRef(Meter);\nexport {_Meter as Meter};\n"],"names":[],"version":3,"file":"Meter.mjs.map"}
|
package/dist/Tabs.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAqDM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAwD;AAE/F,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASC,SAAS,0CAAS,KAAoB;IAC3C,qBACE,gCAAC,CAAA,GAAA,mCAAW;QACT,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,+BAAS,MAAM,MAAM,MAAM;;AAE7E;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BN,MAAM;AAQC,SAAS,0CAAI,KAAe;IACjC,IAAI,WAAC,OAAO,EAAC,GAAG,CAAA,GAAA,4CAAgB,EAAE;IAElC,qBACE,gCAAC,CAAA,GAAA,8BAAK;QACH,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0BAAI;gBAAC,G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AAG,MAAM,MAAM;kBAC9F,cAAA,gCAAC,CAAA,GAAA,mCAAO;YACN,QAAQ;gBACN;oBAAC;oBAAa;iCAAC;oCAAS;sCAAY;qCAAc;oBAAW;iBAAE;aAChE;sBACA,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Tabs.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 {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps, \n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /** The amount of space between the tabs. */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles { \n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext);\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext);\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\nfunction Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nconst _Tabs = forwardRef(Tabs);\nexport {_Tabs as Tabs};\n"],"names":[],"version":3,"file":"Tabs.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAwDM,MAAM,0DAAc,CAAA,GAAA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AC;QAAU,OAAO,cAAc;QAAK;QAAW;QAAa;KAAQ;IAExE,qBACE,gCAAC;QAAI,OAAO;YAAC,GAAG,KAAK;QAAA;QAAG,WAAW,wCAAkB;wBAAC;yBAAY;QAAW;;AAEjF;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;AAYN,SAAS,2BAAK,KAAgB,EAAE,GAA2B;IACzD,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,WACF,UAAU,uBACV,UAAU,gBACV,YAAY,eACZ,cAAc,cACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,+BAAM;QACJ,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,2BAAK;gBAAC,GAAG,WAAW;YAAA,GAAG,MAAM,MAAM;kBAC9F,cAAA,gCAAC,CAAA,GAAA,mCAAO;YACN,QAAQ;gBACN;oBAAC;oBAAa;iCAAC;oCAAS;sCAAY;qCAAc;oBAAW;iBAAE;aAChE;sBACA,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Tabs.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 {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps, \n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /**\n * The amount of space between the tabs.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles { \n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext);\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext);\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\nfunction Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nconst _Tabs = forwardRef(Tabs);\nexport {_Tabs as Tabs};\n"],"names":[],"version":3,"file":"Tabs.cjs.map"}
|
package/dist/Tabs.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACiEiB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkBL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA4BC;;;;EAkBoB;;;;EAEyB;;;;EAU1C;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkDkC;;;;EAyCxB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuFb;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;AA9PI;EA8PJ;;;;;AA9PI;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAkBL;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAqJc;;;;IAAA;;;;;;AAzHb;;;;AAgNA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA","sources":["d333cabc54201ea1","packages/@react-spectrum/s2/src/Tabs.tsx"],"sourcesContent":["@import \"575a5a16650d7070\";\n@import \"7a0058ba44ec735a\";\n@import \"ea0c0ad20f1e1c01\";\n@import \"1a91a7d853a67795\";\n@import \"b645d7882760dc18\";\n@import \"5aa00674bbf9e612\";\n@import \"9d65793a05791106\";\n@import \"2976d7d1f8a0759d\";\n@import \"713e94facc5ee3f3\";\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 {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps, \n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /** The amount of space between the tabs. */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles { \n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext);\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext);\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\nfunction Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nconst _Tabs = forwardRef(Tabs);\nexport {_Tabs as Tabs};\n"],"names":[],"version":3,"file":"Tabs.css.map"}
|
|
1
|
+
{"mappings":"ACoEiB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkBL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA4BC;;;;EAkBoB;;;;EAEyB;;;;EAU1C;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkDkC;;;;EAyCxB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuFb;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;AA9PI;EA8PJ;;;;;AA9PI;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAkBL;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAqJc;;;;IAAA;;;;;;AAzHb;;;;AAgNA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA","sources":["d333cabc54201ea1","packages/@react-spectrum/s2/src/Tabs.tsx"],"sourcesContent":["@import \"575a5a16650d7070\";\n@import \"7a0058ba44ec735a\";\n@import \"ea0c0ad20f1e1c01\";\n@import \"1a91a7d853a67795\";\n@import \"b645d7882760dc18\";\n@import \"5aa00674bbf9e612\";\n@import \"9d65793a05791106\";\n@import \"2976d7d1f8a0759d\";\n@import \"713e94facc5ee3f3\";\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 {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps, \n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /**\n * The amount of space between the tabs.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles { \n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext);\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext);\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\nfunction Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nconst _Tabs = forwardRef(Tabs);\nexport {_Tabs as Tabs};\n"],"names":[],"version":3,"file":"Tabs.css.map"}
|
package/dist/Tabs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAqDM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwD;AAE/F,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASC,SAAS,0CAAS,KAAoB;IAC3C,qBACE,gBAAC,CAAA,GAAA,eAAW;QACT,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,+BAAS,MAAM,MAAM,MAAM;;AAE7E;AAEA,MAAM;;;;;;;;;;;;;;;;;;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,IAAI,WACF,UAAU,uBACV,UAAU,gBACV,YAAY,eACZ,cAAc,cACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,WAAM;QACJ,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,2BAAK;gBAAC,GAAG,WAAW;YAAA,GAAG,MAAM,MAAM;kBAC9F,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC;oBAAa;iCAAC;oCAAS;sCAAY;qCAAc;oBAAW;iBAAE;aAChE;sBACA,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Tabs.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 {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps, \n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /** The amount of space between the tabs. */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles { \n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext);\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext);\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\nfunction Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nconst _Tabs = forwardRef(Tabs);\nexport {_Tabs as Tabs};\n"],"names":[],"version":3,"file":"Tabs.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAwDM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwD;AAE/F,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASC,SAAS,0CAAS,KAAoB;IAC3C,qBACE,gBAAC,CAAA,GAAA,eAAW;QACT,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,+BAAS,MAAM,MAAM,MAAM;;AAE7E;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BN,MAAM;AAQC,SAAS,0CAAI,KAAe;IACjC,IAAI,WAAC,OAAO,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;IAElC,qBACE,gBAAC,CAAA,GAAA,UAAK;QACH,GAAG,KAAK;QACT,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0BAAI;gBAAC,GAAG,WAAW;yBAAE;YAAO,GAAG,MAAM,MAAM;kBACtG,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBAAC,MAAM;oBAAmB;iBAAE;gBAC1C;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,QAAQ;oBACV;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK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O,GAAG,CAAC;YAE7B,IAAI,gBAAgB,cAClB,SAAS,KAAK,GAAG,CAAC,EAAE,YAAY,WAAW,CAAC,EAAE,CAAC;iBAE/C,SAAS,MAAM,GAAG,CAAC,EAAE,YAAY,YAAY,CAAC,EAAE,CAAC;YAEnD,SAAS;QACX;IACF,GAAG;QAAC;QAAW;QAAU;QAAa;KAAY;IAElD,CAAA,GAAA,sBAAc,EAAE;QACd;IACF,GAAG;QAAC;QAAU,OAAO,cAAc;QAAK;QAAW;QAAa;KAAQ;IAExE,qBACE,gBAAC;QAAI,OAAO;YAAC,GAAG,KAAK;QAAA;QAAG,WAAW,wCAAkB;wBAAC;yBAAY;QAAW;;AAEjF;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;AAYN,SAAS,2BAAK,KAAgB,EAAE,GAA2B;IACzD,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,WACF,UAAU,uBACV,UAAU,gBACV,YAAY,eACZ,cAAc,cACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gBAAC,CAAA,GAAA,WAAM;QACJ,GAAG,KAAK;QACT,KAAK;QACL,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,2BAAK;gBAAC,GAAG,WAAW;YAAA,GAAG,MAAM,MAAM;kBAC9F,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC;oBAAa;iCAAC;oCAAS;sCAAY;qCAAc;oBAAW;iBAAE;aAChE;sBACA,MAAM,QAAQ;;;AAIvB;AAEA;;CAEC,GACD,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Tabs.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 {\n TabListProps as AriaTabListProps,\n TabPanel as AriaTabPanel,\n TabPanelProps as AriaTabPanelProps,\n TabProps as AriaTabProps,\n TabsProps as AriaTabsProps, \n ContextValue,\n Provider,\n Tab as RACTab,\n TabList as RACTabList,\n Tabs as RACTabs,\n TabListStateContext,\n useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {Collection, DOMRef, DOMRefValue, Key, Node, Orientation} from '@react-types/shared';\nimport {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useRef, useState} from 'react';\nimport {focusRing, getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TabsProps extends Omit<AriaTabsProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tabs. */\n children?: ReactNode,\n /**\n * The amount of space between the tabs.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular'\n}\n\nexport interface TabProps extends Omit<AriaTabProps, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tab. */\n children?: ReactNode\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps<T>, 'children' | 'style' | 'className'>, StyleProps {\n /** The content to display in the tablist. */\n children?: ReactNode\n}\n\nexport interface TabPanelProps extends Omit<AriaTabPanelProps, 'children' | 'style' | 'className'>, UnsafeStyles { \n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The content to display in the tab panels. */\n children?: ReactNode\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst tabPanel = style({\n marginTop: 4,\n color: 'gray-800',\n flexGrow: 1,\n flexBasis: '[0%]',\n minHeight: 0,\n minWidth: 0\n}, getAllowedOverrides({height: true}));\n\nexport function TabPanel(props: TabPanelProps) {\n return (\n <AriaTabPanel\n {...props}\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + tabPanel(null, props.styles)} />\n );\n}\n\nconst tab = style({\n ...focusRing(),\n display: 'flex',\n color: {\n default: 'neutral-subdued',\n isSelected: 'neutral',\n isHovered: 'neutral-subdued',\n isDisabled: 'disabled',\n forcedColors: {\n isSelected: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'sm',\n gap: 'text-to-visual',\n height: {\n density: {\n compact: 32,\n regular: 48\n }\n },\n alignItems: 'center',\n position: 'relative',\n cursor: 'default',\n flexShrink: 0,\n transition: 'default'\n}, getAllowedOverrides());\n\nconst icon = style({\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nexport function Tab(props: TabProps) {\n let {density} = useSlottedContext(TabsContext);\n\n return (\n <RACTab\n {...props}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tab({...renderProps, density}, props.styles)}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: icon\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACTab>\n );\n}\n\nconst tablist = style({\n display: 'flex',\n gap: {\n orientation: {\n horizontal: {\n density: {\n compact: 24,\n regular: 32\n }\n }\n }\n },\n flexDirection: {\n orientation: {\n vertical: 'column'\n }\n },\n paddingEnd: {\n orientation: {\n vertical: 20\n }\n },\n paddingStart: {\n orientation: {\n vertical: 12\n }\n },\n flexShrink: 0,\n flexBasis: '[0%]'\n});\n\nexport function TabList<T extends object>(props: TabListProps<T>) {\n let {density, isDisabled, disabledKeys, orientation} = useSlottedContext(TabsContext);\n let state = useContext(TabListStateContext);\n let [selectedTab, setSelectedTab] = useState<HTMLElement | undefined>(undefined);\n let tablistRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n if (tablistRef?.current) {\n let tab: HTMLElement | null = tablistRef.current.querySelector('[role=tab][data-selected=true]');\n\n if (tab != null) {\n setSelectedTab(tab);\n }\n }\n }, [tablistRef, state?.selectedItem?.key]);\n\n return (\n <div\n style={props.UNSAFE_style}\n className={(props.UNSAFE_className || '') + style({position: 'relative'}, getAllowedOverrides())(null, props.styles)}>\n {orientation === 'vertical' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n <RACTabList\n {...props}\n ref={tablistRef}\n className={renderProps => tablist({...renderProps, density})} />\n {orientation === 'horizontal' &&\n <TabLine disabledKeys={disabledKeys} isDisabled={isDisabled} selectedTab={selectedTab} orientation={orientation} density={density} />}\n </div>\n );\n}\n\nfunction isAllTabsDisabled<T>(collection: Collection<Node<T>> | null, disabledKeys: Set<Key>) {\n let testKey: Key | null = null;\n if (collection && collection.size > 0) {\n testKey = collection.getFirstKey();\n\n let index = 0;\n while (testKey && index < collection.size) {\n // We have to check if the item in the collection has a key in disabledKeys or has the isDisabled prop set directly on it\n if (!disabledKeys.has(testKey) && !collection.getItem(testKey)?.props?.isDisabled) {\n return false;\n }\n\n testKey = collection.getKeyAfter(testKey);\n index++;\n }\n return true;\n }\n return false;\n}\n\ninterface TabLineProps {\n disabledKeys: Iterable<Key> | undefined,\n isDisabled: boolean | undefined,\n selectedTab: HTMLElement | undefined,\n orientation?: Orientation,\n density?: 'compact' | 'regular'\n}\n\nconst selectedIndicator = style({\n position: 'absolute',\n backgroundColor: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n height: {\n orientation: {\n horizontal: '[2px]'\n }\n },\n width: {\n orientation: {\n vertical: '[2px]'\n }\n },\n bottom: {\n orientation: {\n horizontal: 0\n }\n },\n borderStyle: 'none',\n borderRadius: 'full',\n transitionDuration: 130,\n transitionTimingFunction: 'in-out'\n});\n\nfunction TabLine(props: TabLineProps) {\n let {\n disabledKeys,\n isDisabled: isTabsDisabled,\n selectedTab,\n orientation,\n density\n } = props;\n let {direction} = useLocale();\n let state = useContext(TabListStateContext);\n\n // We want to add disabled styling to the selection indicator only if all the Tabs are disabled\n let [isDisabled, setIsDisabled] = useState<boolean>(false);\n useEffect(() => {\n let isDisabled = isTabsDisabled || isAllTabsDisabled(state?.collection || null, disabledKeys ? new Set(disabledKeys) : new Set(null));\n setIsDisabled(isDisabled);\n }, [state?.collection, disabledKeys, isTabsDisabled, setIsDisabled]);\n\n let [style, setStyle] = useState<{transform: string | undefined, width: string | undefined, height: string | undefined}>({\n transform: undefined,\n width: undefined,\n height: undefined\n });\n\n let onResize = useCallback(() => {\n if (selectedTab) {\n let styleObj: { transform: string | undefined, width: string | undefined, height: string | undefined } = {\n transform: undefined,\n width: undefined,\n height: undefined\n };\n\n // In RTL, calculate the transform from the right edge of the tablist so that resizing the window doesn't break the Tabline position due to offsetLeft changes\n let offset = direction === 'rtl' ? -1 * ((selectedTab.offsetParent as HTMLElement)?.offsetWidth - selectedTab.offsetWidth - selectedTab.offsetLeft) : selectedTab.offsetLeft;\n styleObj.transform = orientation === 'vertical'\n ? `translateY(${selectedTab.offsetTop}px)`\n : `translateX(${offset}px)`;\n\n if (orientation === 'horizontal') {\n styleObj.width = `${selectedTab.offsetWidth}px`;\n } else {\n styleObj.height = `${selectedTab.offsetHeight}px`;\n }\n setStyle(styleObj);\n }\n }, [direction, setStyle, selectedTab, orientation]);\n\n useLayoutEffect(() => {\n onResize();\n }, [onResize, state?.selectedItem?.key, direction, orientation, density]);\n\n return (\n <div style={{...style}} className={selectedIndicator({isDisabled, orientation})} />\n );\n}\n\nconst tabs = style({\n display: 'flex',\n flexShrink: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n flexDirection: {\n orientation: {\n horizontal: 'column'\n }\n }\n}, getAllowedOverrides({height: true}));\n\nfunction Tabs(props: TabsProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TabsContext);\n let {\n density = 'regular',\n isDisabled,\n disabledKeys,\n orientation = 'horizontal'\n } = props;\n let domRef = useDOMRef(ref);\n\n return (\n <RACTabs\n {...props}\n ref={domRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + tabs({...renderProps}, props.styles)}>\n <Provider\n values={[\n [TabsContext, {density, isDisabled, disabledKeys, orientation}]\n ]}>\n {props.children}\n </Provider>\n </RACTabs>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.\n */\nconst _Tabs = forwardRef(Tabs);\nexport {_Tabs as Tabs};\n"],"names":[],"version":3,"file":"Tabs.mjs.map"}
|
package/dist/TagGroup.cjs
CHANGED
|
@@ -637,7 +637,7 @@ function $2e3ddd7543f4a901$var$Tag({ children: children, textValue: textValue, .
|
|
|
637
637
|
}
|
|
638
638
|
/** An individual Tag for TagGroups. */ let $2e3ddd7543f4a901$export$3288d34c523a1192 = /*#__PURE__*/ (0, $chbGa$react.forwardRef)($2e3ddd7543f4a901$var$Tag);
|
|
639
639
|
function $2e3ddd7543f4a901$var$TagWrapper({ children: children, isDisabled: isDisabled, allowsRemoving: allowsRemoving, isInRealDOM: isInRealDOM }) {
|
|
640
|
-
let { size: size } = (0, $chbGa$reactariacomponents.useSlottedContext)($2e3ddd7543f4a901$export$5b07b5dd2cbd96e3) ?? {};
|
|
640
|
+
let { size: size = 'M' } = (0, $chbGa$reactariacomponents.useSlottedContext)($2e3ddd7543f4a901$export$5b07b5dd2cbd96e3) ?? {};
|
|
641
641
|
return /*#__PURE__*/ (0, $chbGa$reactjsxruntime.jsxs)((0, $chbGa$reactjsxruntime.Fragment), {
|
|
642
642
|
children: [
|
|
643
643
|
isInRealDOM && /*#__PURE__*/ (0, $chbGa$reactjsxruntime.jsx)("div", {
|