@preply/ds-docs 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{00.LayoutFlex.stories-DB9Y25qw.js → 00.LayoutFlex.stories-lllooXjc.js} +1 -1
- package/dist/assets/{00.applications-C7qyvM1y.js → 00.applications-ApRgtzMF.js} +1 -1
- package/dist/assets/{00.favicons.guide-BmYhSQZH.js → 00.favicons.guide-4ivqvu_K.js} +1 -1
- package/dist/assets/{00.token-explorer-zaz4V88E.js → 00.token-explorer-DCBSOdHJ.js} +6 -6
- package/dist/assets/{00.using-responsive-props-DKW-uWVH.js → 00.using-responsive-props-BhAkr9Gn.js} +1 -1
- package/dist/assets/{01.semantic-tokens-Qf9qY_Sk.js → 01.semantic-tokens-BBQKcQ5o.js} +1 -1
- package/dist/assets/{01.using-shorthand-props-BedWZyE3.js → 01.using-shorthand-props-SxccG8oR.js} +1 -1
- package/dist/assets/{10.Combinations.stories-DL8TmNJ4.js → 10.Combinations.stories-D3XySbv3.js} +1 -1
- package/dist/assets/{10.fonts.guide-DWCtIfPx.js → 10.fonts.guide-p4vZ2TE8.js} +1 -1
- package/dist/assets/{10.ssr-FDyVDtdm.js → 10.ssr-BLS5aGYV.js} +1 -1
- package/dist/assets/11.fonts.explorer-BMm1rcuE.js +2 -0
- package/dist/assets/{11.ssr.app-router-C5TwsO2T.js → 11.ssr.app-router-B_LdKMuw.js} +1 -1
- package/dist/assets/{20.libraries-Cnl2_NKK.js → 20.libraries-Uutk1t-k.js} +1 -1
- package/dist/assets/{2025-q4-ds-cleanup-Bpa9AZ8j.js → 2025-q4-ds-cleanup-D2AonoQX.js} +1 -1
- package/dist/assets/30.icons.explorer-D63Br7GU.js +72 -0
- package/dist/assets/{30.storybook-C9GpdY6w.js → 30.storybook-B_OtmSNE.js} +1 -1
- package/dist/assets/{40.illustrations.explorer-BRtj5sFB.js → 40.illustrations.explorer-Pi9iaQwM.js} +1 -1
- package/dist/assets/{90.advanced-hNSc64rO.js → 90.advanced-tEkbHxcl.js} +1 -1
- package/dist/assets/{Accordion-CedlUpYk.js → Accordion-2avWtqXz.js} +4 -4
- package/dist/assets/{Accordion.stories-K6mzrdt8.js → Accordion.stories-CLwah67K.js} +1 -1
- package/dist/assets/{Accordion.tests.stories-B6lTbT6X.js → Accordion.tests.stories-CFH7p1Jq.js} +1 -1
- package/dist/assets/{AlertBanner.primitives.stories-CX03Ob-5.js → AlertBanner.primitives.stories-DpA-of6O.js} +1 -1
- package/dist/assets/{AlertBanner.stories-Cla7i7qF.js → AlertBanner.stories-B7xxyCn2.js} +2 -2
- package/dist/assets/{AlertBannerAction-CW-WBC-Q.js → AlertBannerAction-D14MnnIA.js} +33 -33
- package/dist/assets/AlertDialog-B5rRXSxb.js +4 -0
- package/dist/assets/AlertDialog.stories-BKT7nitb.js +232 -0
- package/dist/assets/{Avatar-Dlo9b83e.js → Avatar-Die_4zu0.js} +1 -1
- package/dist/assets/{Avatar.stories-B27rtxK8.js → Avatar.stories-DJHK0lEC.js} +1 -1
- package/dist/assets/{AvatarWithStatus.stories-DBeEaQQL.js → AvatarWithStatus.stories-E9QQr3Dr.js} +1 -1
- package/dist/assets/{Badge-CEZW6Ww4.js → Badge-BSDHZ3bI.js} +2 -2
- package/dist/assets/{Badge.stories-ioY8q4d7.js → Badge.stories-6FOVA96I.js} +1 -1
- package/dist/assets/{Box.stories-udfSjNu1.js → Box.stories-DAVs5Qmd.js} +1 -1
- package/dist/assets/{BubbleCounter.stories-D2G7jKKI.js → BubbleCounter.stories-DHv_hrNV.js} +1 -1
- package/dist/assets/{Button-DS2bg8PO.js → Button-C0Um_QuO.js} +2 -2
- package/dist/assets/{Button.stories-VD5Bx8BA.js → Button.stories-CTSwUwYJ.js} +1 -1
- package/dist/assets/{ButtonBase-CPJxprWJ.js → ButtonBase-DGinnt2u.js} +1 -1
- package/dist/assets/{ButtonBase-sV1YoG7h.js → ButtonBase-HkSfLFbE.js} +1 -1
- package/dist/assets/{CalloutBanner.stories-Cda3BZCl.js → CalloutBanner.stories-C62ApsKt.js} +19 -19
- package/dist/assets/{Checkbox-Cmmcg7FL.js → Checkbox-U8uzIr-e.js} +3 -3
- package/dist/assets/{Checkbox.stories-B0kQw-sr.js → Checkbox.stories-ClI-ZBnj.js} +1 -1
- package/dist/assets/{Checkbox.tests.stories-DDyVlpZg.js → Checkbox.tests.stories-CrLxNZ2d.js} +1 -1
- package/dist/assets/{Chips.stories-DcxW_jqF.js → Chips.stories-BMxD1fH1.js} +1 -1
- package/dist/assets/{Color-ASIRERSW-9q9Af87o.js → Color-ASIRERSW-BsR8auWQ.js} +1 -1
- package/dist/assets/ComposingDialogs.stories-DwVqal9K.js +111 -0
- package/dist/assets/{ComposingPopovers.stories-Co69SyGH.js → ComposingPopovers.stories-DtmTbsU_.js} +1 -1
- package/dist/assets/CountryFlag-D40CtNEa.js +49 -0
- package/dist/assets/{CountryFlag.stories-o-8kmOZA.js → CountryFlag.stories-hf40f81N.js} +1 -1
- package/dist/assets/{CountryFlag.test.stories-CKkoBStk.js → CountryFlag.test.stories-Bde0Okud.js} +1 -1
- package/dist/assets/{Dialog-DaLOtRn0.js → Dialog-CJQmu6iz.js} +1 -1
- package/dist/assets/{Dialog.primitives.stories-CDU4GhAO.js → Dialog.primitives.stories-BRGfipHO.js} +2 -2
- package/dist/assets/{Dialog.stories-N8LTxdNu.js → Dialog.stories-D4tyIGD0.js} +27 -22
- package/dist/assets/Dialog.test.stories-xCqInD69.js +146 -0
- package/dist/assets/{DialogActions-_9FMsJ9P.js → DialogActions-GLMqsJfB.js} +30 -30
- package/dist/assets/{DialogCloseButton-CDDeMFIL.js → DialogCloseButton-D5YliaRd.js} +47 -55
- package/dist/assets/{DismissibleChips-X4A9KOxs.js → DismissibleChips-YCE2ttV-.js} +1 -1
- package/dist/assets/{DismissibleChips.stories-DbnvLIw0.js → DismissibleChips.stories-Cx3sJ6UG.js} +1 -1
- package/dist/assets/{Divider-WS0wDfQZ.js → Divider-j3vJV734.js} +1 -1
- package/dist/assets/{Divider.stories-BO1cg142.js → Divider.stories-CK-PipZt.js} +1 -1
- package/dist/assets/{DocsRenderer-GHJI37HO-CzsXSkAO.js → DocsRenderer-GHJI37HO-WuLZQEsz.js} +2 -2
- package/dist/assets/{DropdownMenu-CB6xg9YD.js → DropdownMenu-CgNvtJ2F.js} +409 -409
- package/dist/assets/{DropdownMenu.stories-E-6mIs-U.js → DropdownMenu.stories-DpmKDI1Q.js} +82 -56
- package/dist/assets/{FieldButton-CYcQXg37.js → FieldButton-DpHF49o_.js} +1 -1
- package/dist/assets/{FieldButton.stories-UNjMUuGT.js → FieldButton.stories-C7v9WweE.js} +1 -1
- package/dist/assets/{FormControl-DgD7Nr_L.js → FormControl-Zqf1cIwP.js} +1 -1
- package/dist/assets/{FormControl.stories-DlqjswdS.js → FormControl.stories-D4xKaMaA.js} +1 -1
- package/dist/assets/{Heading-BPJGe0Bg.js → Heading-Cj8Si45g.js} +1 -1
- package/dist/assets/{Heading.stories-B9_Jr0z3.js → Heading.stories-BG_kLNJz.js} +1 -1
- package/dist/assets/{Icon-kphbe0CE.js → Icon-CC0yjdx9.js} +2 -2
- package/dist/assets/{Icon-RSC-BcGoz5Ez.js → Icon-RSC-Cl0H44C3.js} +1 -1
- package/dist/assets/{Icon.stories-CKAjKBCa.js → Icon.stories-DAIYY4Bp.js} +1 -1
- package/dist/assets/IconButton-BpjNyYgD.js +8 -0
- package/dist/assets/IconTile-CAnlU9ss.js +1 -0
- package/dist/assets/IconTile-DDvHA75S.css +1 -0
- package/dist/assets/IconTile.stories-DnUYn3Id.js +88 -0
- package/dist/assets/{Input-Cp2OkxN8.js → Input-DuW1_5SG.js} +16 -16
- package/dist/assets/{InputContainer-BlXlJbfJ.js → InputContainer-Cmdo_xyq.js} +1 -1
- package/dist/assets/{IntegrationWithReactHookForm.stories-BstJWvGF.js → IntegrationWithReactHookForm.stories-9EImL3zR.js} +1 -1
- package/dist/assets/{IntlFormattedCurrency.stories-CXBsKa8I.js → IntlFormattedCurrency.stories-j1D4xFto.js} +9 -9
- package/dist/assets/{IntlFormattedDateTime.stories-m5rFuyxv.js → IntlFormattedDateTime.stories-BCwbTrw1.js} +7 -7
- package/dist/assets/{LayoutFlex-Drgj-jqd.js → LayoutFlex-CTH6ELdm.js} +1 -1
- package/dist/assets/{LayoutFlex-p_p7LCCd.js → LayoutFlex-DXRMJ9FH.js} +1 -1
- package/dist/assets/{LayoutFlexItem-DrxhQlf5.js → LayoutFlexItem-lmgCv4Y9.js} +1 -1
- package/dist/assets/{LayoutGrid-DZv08iKe.js → LayoutGrid-CUGRXgEO.js} +1 -1
- package/dist/assets/{LayoutGrid-eROIp1sZ.js → LayoutGrid-SAztDD7Z.js} +1 -1
- package/dist/assets/{LayoutGrid.stories-DAnbCvD6.js → LayoutGrid.stories-2dbzhVi7.js} +1 -1
- package/dist/assets/{LayoutGridItem-DiU_IdjQ.js → LayoutGridItem-UTn4G6JO.js} +1 -1
- package/dist/assets/{Link-BHV5DCu-.js → Link-BAFCJR3T.js} +1 -1
- package/dist/assets/{Link.stories-CFRsbzfM.js → Link.stories-6gHkl5xC.js} +1 -1
- package/dist/assets/{Loader.stories-bvaq9oGD.js → Loader.stories-CG-Eo8vg.js} +1 -1
- package/dist/assets/{MultiSelectChips-CVg9kaKd.js → MultiSelectChips-CBnEtn4N.js} +2 -2
- package/dist/assets/{MultiSelectChips.stories-DOiIDnhX.js → MultiSelectChips.stories-Ch4FxGM2.js} +1 -1
- package/dist/assets/{NativeSelectField.stories-DojmcjvT.js → NativeSelectField.stories-Pj5dm9hL.js} +21 -21
- package/dist/assets/NumberField-klmIiQAi.js +6 -0
- package/dist/assets/{NumberField.stories-BEVJXeBn.js → NumberField.stories-D740jISy.js} +1 -1
- package/dist/assets/{ObserveIntersection-MtxhRIzU.js → ObserveIntersection-Dx2gD1CU.js} +2 -2
- package/dist/assets/{ObserveIntersection.stories-0f-z6V25.js → ObserveIntersection.stories-JJPEw5oG.js} +1 -1
- package/dist/assets/{OnboardingTooltip-DdKwzkB-.js → OnboardingTooltip-DzQhJzWc.js} +1 -1
- package/dist/assets/OnboardingTooltip-X4QjsIe6.css +1 -0
- package/dist/assets/{OnboardingTooltip.stories-DV2yAiRE.js → OnboardingTooltip.stories-BDgRgbzO.js} +1 -1
- package/dist/assets/{OnboardingTooltip.tests.stories-32a4fLzf.js → OnboardingTooltip.tests.stories-DrqovP8T.js} +1 -1
- package/dist/assets/{OnboardingTour-m4V6QT-X.js → OnboardingTour-B5gEod5H.js} +1 -1
- package/dist/assets/OnboardingTour-DoEbirUE.css +1 -0
- package/dist/assets/{OnboardingTour.stories-dLZBYgbr.js → OnboardingTour.stories-BzHBS52z.js} +2 -2
- package/dist/assets/{OnboardingTour.tests.stories-BnPXyzmi.js → OnboardingTour.tests.stories-CHMykq2a.js} +1 -1
- package/dist/assets/PasswordField-BjqiXySY.js +6 -0
- package/dist/assets/{PasswordField.stories-BxnBBn2_.js → PasswordField.stories-YCTP14pU.js} +1 -1
- package/dist/assets/{PreplyLogo.stories-BuK8vK1R.js → PreplyLogo.stories-lPBmn_E2.js} +1 -1
- package/dist/assets/{ProgressBar.stories-CwpXa86g.js → ProgressBar.stories-DqvDJEeF.js} +1 -1
- package/dist/assets/{ProgressSteps-DCVAFT7X.js → ProgressSteps-Dce_SjLt.js} +1 -1
- package/dist/assets/{ProgressSteps.stories--reXlzAk.js → ProgressSteps.stories-BMDqz7-Z.js} +1 -1
- package/dist/assets/{PromoDialog-BPWEGGGS.js → PromoDialog-DdnXVfH8.js} +2 -2
- package/dist/assets/{RangeSlider-BKIG-XfV.js → RangeSlider-MZqvjtBp.js} +1 -1
- package/dist/assets/{RangeSlider.stories-Dr7UfAUm.js → RangeSlider.stories-BS4-l1u4.js} +1 -1
- package/dist/assets/{Rating.stories-Cmpcr64W.js → Rating.stories-wHsrBw3w.js} +1 -1
- package/dist/assets/{RatingInput.stories-DWxrhIwu.js → RatingInput.stories-BKAXF4Qv.js} +2 -2
- package/dist/assets/{SelectField-BRicVVj7.js → SelectField-DU60q2LU.js} +13 -13
- package/dist/assets/{SelectField.stories-D6sJHBcs.js → SelectField.stories-BKCyFPQa.js} +2 -2
- package/dist/assets/{ShowOnIntersection.stories-DT94aTYJ.js → ShowOnIntersection.stories-BdO_3n9P.js} +1 -1
- package/dist/assets/{SingleSelectChips-B1d9MkC-.js → SingleSelectChips-CDtny-H7.js} +2 -2
- package/dist/assets/{SingleSelectChips.stories-QdsPQJO8.js → SingleSelectChips.stories-CTAvW0Y9.js} +1 -1
- package/dist/assets/{Slider-CVM0huNa.js → Slider-B8ndK7PX.js} +1 -1
- package/dist/assets/{Slider.stories-UCLuhto1.js → Slider.stories-CBV0fePJ.js} +1 -1
- package/dist/assets/{Spinner-BG27lVzS.js → Spinner-8-RB4YZR.js} +1 -1
- package/dist/assets/{Stars-St7ZRTZK.js → Stars-BSTkfC0i.js} +1 -1
- package/dist/assets/{Steps-CBqiqb-6.js → Steps-DUeCVcxV.js} +1 -1
- package/dist/assets/{Steps.stories-DOWMlpTM.js → Steps.stories-DqOo6fKy.js} +1 -1
- package/dist/assets/{Switch-DJROHOKs.js → Switch-Dyoj_Z1P.js} +1 -1
- package/dist/assets/{Switch.stories-C9cCCv8l.js → Switch.stories-CDVDjU2B.js} +1 -1
- package/dist/assets/{Text-FXv4P3JX.js → Text-DJTKRzSb.js} +1 -1
- package/dist/assets/{Text-C8DrHLQF.js → Text-DvShrljd.js} +1 -1
- package/dist/assets/{Text.stories-Cmn2Kn0h.js → Text.stories-DRuLuJwb.js} +1 -1
- package/dist/assets/TextField-BSJgR_zK.js +6 -0
- package/dist/assets/{TextField.stories-Bly_tLuN.js → TextField.stories-rtu-asgN.js} +1 -1
- package/dist/assets/{TextHighlighted.stories-CdIzDMMS.js → TextHighlighted.stories-Bc0bMLCv.js} +1 -1
- package/dist/assets/{TextInline.stories-NWWAzVY1.js → TextInline.stories-DKWvwjg6.js} +1 -1
- package/dist/assets/{TextareaField-DDEIieQg.js → TextareaField-DUqOyVK5.js} +21 -21
- package/dist/assets/{TextareaField.stories-CyuOlu4z.js → TextareaField.stories-CiRYJL_j.js} +1 -1
- package/dist/assets/{Toast.stories-BFWVkg8-.js → Toast.stories-S5qFLRPf.js} +1 -1
- package/dist/assets/{TokyoUIAttach-Bj2xsZ5E.js → TokyoUIAttach-BsMlsNHQ.js} +1 -1
- package/dist/assets/{TokyoUIAvailability7LateNight-CyPCBR0g.js → TokyoUIAvailability7LateNight-BUCnoHXS.js} +1 -1
- package/dist/assets/{TokyoUICheck-Cg3ZJnmD.js → TokyoUICheck-DQLX_x10.js} +1 -1
- package/dist/assets/{TokyoUICheckmark-CPDgq6wU.js → TokyoUICheckmark-BHJrELn_.js} +1 -1
- package/dist/assets/{TokyoUIChevronDown-CqAWFBEe.js → TokyoUIChevronDown-DiBNbDdz.js} +1 -1
- package/dist/assets/{TokyoUIChevronRight-UHMBQAxX.js → TokyoUIChevronRight-DRhJYmWB.js} +1 -1
- package/dist/assets/{TokyoUIClose-DoJfpCh8.js → TokyoUIClose-BfMyMrDa.js} +1 -1
- package/dist/assets/{TokyoUIEmojiFrowning-Bztw_WuD.js → TokyoUIEmojiFrowning-DkxcBN-M.js} +1 -1
- package/dist/assets/{TokyoUIErrorWarning-CE6C7y8g.js → TokyoUIErrorWarning-GuwQvo24.js} +1 -1
- package/dist/assets/{TokyoUIExerciseClosedGapsJumble-OGZLJcQZ.js → TokyoUIExerciseClosedGapsJumble-C8roFqfh.js} +1 -1
- package/dist/assets/{TokyoUIEye-BRl8T4Ci.js → TokyoUIEye-oyrTN--k.js} +1 -1
- package/dist/assets/{TokyoUIFav-w08HsdRu.js → TokyoUIFav-C-stY9U_.js} +1 -1
- package/dist/assets/{TokyoUIInfo-BoGHBgEW.js → TokyoUIInfo-BSNbI4Gr.js} +1 -1
- package/dist/assets/{TokyoUILanguage-Bd98PINi.js → TokyoUILanguage-BcrymOo9.js} +1 -1
- package/dist/assets/{TokyoUILibraryExplore-C-3tnEbW.js → TokyoUILibraryExplore-DvvKpWd6.js} +1 -1
- package/dist/assets/{TokyoUILock-d81cInRU.js → TokyoUILock-B22xkFQW.js} +1 -1
- package/dist/assets/{TokyoUIMessages-0is9ybHR.js → TokyoUIMessages-hZLnK87p.js} +1 -1
- package/dist/assets/{TokyoUIMinus-DPJ4shry.js → TokyoUIMinus-C6TctZRw.js} +1 -1
- package/dist/assets/{TokyoUINotebook-DLrYm4si.js → TokyoUINotebook-mwleX-o1.js} +1 -1
- package/dist/assets/TokyoUINotesWithPad-CG0gLTYm.js +1 -0
- package/dist/assets/{TokyoUIPhone-bFlwEn-_.js → TokyoUIPhone-CFykqUer.js} +1 -1
- package/dist/assets/{TokyoUISettings-DhHyIlWv.js → TokyoUISettings-BbgnUEy1.js} +1 -1
- package/dist/assets/{TokyoUISparkle-B1jtDvOV.js → TokyoUISparkle-DPOw7W2T.js} +1 -1
- package/dist/assets/{TokyoUIStarFilled-Cj894376.js → TokyoUIStarFilled-CF0iG37X.js} +1 -1
- package/dist/assets/{TokyoUITag-fMAL09F9.js → TokyoUITag-B1Xueyd7.js} +1 -1
- package/dist/assets/{TokyoUIUpload-DM2TbvbX.js → TokyoUIUpload-CrasJ02A.js} +1 -1
- package/dist/assets/{TokyoUIUser-Ba7_NA45.js → TokyoUIUser-XhPCF9-5.js} +1 -1
- package/dist/assets/{Tooltip-DDtzGgNm.js → Tooltip-BiqKWYpo.js} +1 -1
- package/dist/assets/{Tooltip.stories-j1bsH2PP.js → Tooltip.stories-DCB24NyS.js} +1 -1
- package/dist/assets/{Tooltip.tests.stories-DFas0O9K.js → Tooltip.tests.stories-B3iLlPPq.js} +1 -1
- package/dist/assets/{VisuallyHidden-GZBFKPVs.js → VisuallyHidden-fvo3PSUE.js} +1 -1
- package/dist/assets/{WithTooltip-IO6J4KBT-2Wz16aqd.js → WithTooltip-IO6J4KBT-BUV9ELqr.js} +1 -1
- package/dist/assets/{align-self-D0ug8REo.js → align-self-BYi8giLn.js} +1 -1
- package/dist/assets/{axe-BcoLkzU-.js → axe-BG-rWtCi.js} +1 -1
- package/dist/assets/{breakpoints-CIy8w3Dv.js → breakpoints-CBpJ5xgl.js} +1 -1
- package/dist/assets/{breakpoints-BDFtAvFy.js → breakpoints-Cu9uEe0J.js} +1 -1
- package/dist/assets/{breakpoints-BBwYud6y.js → breakpoints-CuJuvIR9.js} +1 -1
- package/dist/assets/{changelog-DIkUnuOo.js → changelog-BoskfpJ8.js} +24 -1
- package/dist/assets/{client-oIdhQPH3.js → client-BN2KdiJY.js} +1 -1
- package/dist/assets/{constants-Cwb-3GQ_.js → constants-DDJ2G0OO.js} +47 -47
- package/dist/assets/createRequiredContext-B3Arn9-D.js +241 -0
- package/dist/assets/fonts-explorer.stories-CeMUwBuQ.js +130 -0
- package/dist/assets/{formatter-QJ4M4OGQ-D2xZe9AO.js → formatter-QJ4M4OGQ-B2Vljo6_.js} +1 -1
- package/dist/assets/getTokenVar-CVkrm5Qs.js +1 -0
- package/dist/assets/{getTokenVar-B7BEyIpS.js → getTokenVar-DmUJH1GU.js} +1 -1
- package/dist/assets/{gradientBorders-B12ps1Or.js → gradientBorders-Q_ip9Ojv.js} +1 -1
- package/dist/assets/{hover-5BxL9d9v.js → hover-C8NhPbjk.js} +1 -1
- package/dist/assets/{hover-CG8OgvC5.js → hover-C9fsErpn.js} +1 -1
- package/dist/assets/{hover-gsGL4vVH.js → hover-D55mJaWK.js} +1 -1
- package/dist/assets/{iframe-DjYTJz7A.js → iframe-B_74HtSc.js} +12 -12
- package/dist/assets/{index-DHDwwoCu.js → index-BJaBvJhB.js} +1 -1
- package/dist/assets/{index-BII7aPfQ.js → index-BW8FBNWq.js} +1 -1
- package/dist/assets/{index-C_O4jEc0.js → index-Cnv20V_M.js} +1 -1
- package/dist/assets/{index-CUvrBGJo.js → index-DIqvfT2b.js} +1 -1
- package/dist/assets/{index-cpi3YaXo.js → index-DWFFXgf1.js} +1 -1
- package/dist/assets/{index-DOwxXd3L.js → index-W3BB_3go.js} +1 -1
- package/dist/assets/{intro-BXKxOrdm.js → intro-DOuARa_Y.js} +1 -1
- package/dist/assets/{layout-relative-DQF7VcUK.js → layout-relative-B9CiYPwj.js} +1 -1
- package/dist/assets/{layout-relative.module-1z75aSwo-CsvB7_pT.js → layout-relative.module-1z75aSwo-Dcy7i8oK.js} +1 -1
- package/dist/assets/{layout-relative.module-BM7yIsEb.js → layout-relative.module-BIZVul8q.js} +1 -1
- package/dist/assets/{mcp-X-VhpP6n.js → mcp-D2eIYE7x.js} +1 -1
- package/dist/assets/{message-DiUVdAQd.js → message-DJT5rp5J.js} +1 -1
- package/dist/assets/{migrating-from-less-8Nm2XYdW.js → migrating-from-less-CxT_5hNC.js} +1 -1
- package/dist/assets/{playground.stories-B4hfD_Uq.js → playground.stories-DqwdOX0P.js} +1 -1
- package/dist/assets/{react-18-B4n119qZ.js → react-18-DoE4ZK8O.js} +1 -1
- package/dist/assets/{render-icon-DlE4AZJV.js → render-icon-DSbVIpCz.js} +1 -1
- package/dist/assets/{render-icon-DZ6hllTG.js → render-icon-MT6RlyNs.js} +1 -1
- package/dist/assets/{shared-strings-ZccoNgto.js → shared-strings-ThL9KyH0.js} +1 -1
- package/dist/assets/store-B0wM9Zg8.js +9 -0
- package/dist/assets/{styled-components.browser.esm-3T8u8x7l.js → styled-components.browser.esm-BHxIJD2_.js} +1 -1
- package/dist/assets/{styled-components.browser.esm-DegKtid9.js → styled-components.browser.esm-rrOBirU4.js} +1 -1
- package/dist/assets/{syntaxhighlighter-IQDEPFLK-B-ddKj4v.js → syntaxhighlighter-IQDEPFLK-BakL6JIW.js} +1 -1
- package/dist/assets/{text-accent-C5-m5mrW.js → text-accent-BQ9POoE5.js} +1 -1
- package/dist/assets/{text-centered-D70wah8Y.js → text-centered-BEaaxMgl.js} +1 -1
- package/dist/assets/{text-centered-CqZrbSb_.js → text-centered-CYnBFi3a.js} +1 -1
- package/dist/assets/{tokens-ChCvx9cz.js → tokens-BEyO2LY-.js} +1 -1
- package/dist/assets/{tokens-BXEYWkXR.js → tokens-Cg01svK-.js} +1 -1
- package/dist/assets/{tokens-CBFYFIpi.js → tokens-CmSwgWJ8.js} +1 -1
- package/dist/assets/{tokens-Cp4gIGSO.js → tokens-im-qJUCZ.js} +1 -1
- package/dist/assets/{useControllableState-DQg81cp5.js → useControllableState-BB4EHwEp.js} +1 -1
- package/dist/assets/useHostname-CbpnzdHv.js +1 -0
- package/dist/assets/{useMergeRefs-jFGYKOXz.js → useMergeRefs-CFhXCqbA.js} +1 -1
- package/dist/assets/{useMergeRefs-CL5DIjXV.js → useMergeRefs-Caz9hOck.js} +1 -1
- package/dist/assets/{useOpenInteractionType-B976GY1b.js → useOpenInteractionType-D3sASQWj.js} +3 -3
- package/dist/assets/{usePortalElement-B3bWjUcx.js → usePortalElement-Cbyb850w.js} +1 -1
- package/dist/assets/{useStableCallback-662ysKf2.js → useStableCallback-D5P5kDx5.js} +1 -1
- package/dist/assets/{useToken-CJ7hsZh9.js → useToken-OSVftwxQ.js} +1 -1
- package/dist/assets/{welcome-bR5y4uLm.js → welcome-QqBTVkpV.js} +1 -1
- package/dist/assets/{zeroheight-D-Xst36e.js → zeroheight-BXMq4jvo.js} +1 -1
- package/dist/iframe.html +1 -1
- package/dist/index.json +1 -1
- package/dist/preview-stats.json +10562 -10490
- package/dist/project.json +1 -1
- package/package.json +5 -5
- package/pages/30.guides/70.assets/constants/icon-imports.ts +2 -0
- package/dist/assets/11.fonts.explorer-Bh_GOQIH.js +0 -2
- package/dist/assets/30.icons.explorer-BBtz-vBk.js +0 -72
- package/dist/assets/AlertDialog.stories-BKmaZZoo.js +0 -243
- package/dist/assets/CountryFlag-BKEpYyWK.js +0 -49
- package/dist/assets/Dialog.test.stories-tViVBTuF.js +0 -127
- package/dist/assets/IconButton-D4lbFOKH.js +0 -8
- package/dist/assets/IconTile-CanD5Ibh.css +0 -1
- package/dist/assets/IconTile.stories-BlATLdyV.js +0 -88
- package/dist/assets/NumberField-FWK2ErPL.js +0 -6
- package/dist/assets/OnboardingTooltip-CsmroJZe.css +0 -1
- package/dist/assets/OnboardingTour-D0hvRI8H.css +0 -1
- package/dist/assets/PasswordField-Bp2beBoD.js +0 -6
- package/dist/assets/TextField--Ctd_eHi.js +0 -6
- package/dist/assets/TokyoUINotesWithPad-D6VO7CbF.js +0 -1
- package/dist/assets/createRequiredContext-5BPDYgIa.js +0 -241
- package/dist/assets/fonts-explorer.stories-Bp_9af2z.js +0 -130
- package/dist/assets/getTokenVar-B8jDl0Ui.js +0 -1
- package/dist/assets/useHostname-By9vNKnQ.js +0 -1
package/dist/assets/{CountryFlag.test.stories-CKkoBStk.js → CountryFlag.test.stories-Bde0Okud.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as m}from"./iframe-
|
|
1
|
+
import{j as m}from"./iframe-B_74HtSc.js";import{C as s}from"./CountryFlag-D40CtNEa.js";import"./preload-helper-Dp1pzeXC.js";import"./componentNames-hc9KR2nX.js";const{expect:o}=__STORYBOOK_MODULE_TEST__,A={title:"components/CountryFlag/Tests",component:s,args:{},tags:["!autodocs","!a11y-test","test"]},a={render:function(){return m.jsx(s,{code:"ua",alt:"Ukraine",dataset:{foo:1,bar:"2",baz:!1}})},play:async({canvas:t})=>{const e=t.getByAltText("Ukraine");o(e).toHaveAttribute("data-foo","1"),o(e).toHaveAttribute("data-bar","2"),o(e).toHaveAttribute("data-baz","false")}},r={render:function(){return m.jsx(s,{code:"ua",alt:"Ukraine",loading:"lazy"})},play:async({canvas:t})=>{const e=t.getByAltText("Ukraine");o(e).toHaveAttribute("loading","lazy")}};var n,c,l;a.parameters={...a.parameters,docs:{...(n=a.parameters)==null?void 0:n.docs,source:{originalSource:`{
|
|
2
2
|
render: function Story() {
|
|
3
3
|
return <CountryFlag code="ua" alt="Ukraine" dataset={{
|
|
4
4
|
foo: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./iframe-
|
|
1
|
+
import{j as e}from"./iframe-B_74HtSc.js";import{D as p,a as v,s as f,b as g,c as h}from"./DialogCloseButton-D5YliaRd.js";import{w as l}from"./componentNames-hc9KR2nX.js";const t=({open:a,title:n,description:u,leadingElement:o,children:i,size:r="md",hideHeader:s,onClose:d,mobileFullHeight:m,dataset:c})=>e.jsxs(p,{open:a,onClose:d,size:r,mobileFullHeight:m,dataset:c,"data-preply-ds-component":l.Dialog,children:[e.jsx(v,{}),e.jsxs("header",{className:f.header,"data-preply-ds-component":l.DialogHeader,children:[o,!s&&e.jsxs("hgroup",{children:[e.jsx(g,{children:n}),e.jsx(h,{children:u})]})]}),i]});try{t.displayName="Dialog",t.__docgenInfo={description:`A modal dialog component that can be used to show content in an overlay.
|
|
2
2
|
|
|
3
3
|
Composed of:
|
|
4
4
|
- Dialog: The main component
|
package/dist/assets/{Dialog.primitives.stories-CDU4GhAO.js → Dialog.primitives.stories-BRGfipHO.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as s,j as t}from"./iframe-
|
|
1
|
+
import{r as s,j as t}from"./iframe-B_74HtSc.js";import{u as q,w as K,e as H}from"./index-BW8FBNWq.js";import{F as V}from"./TokyoUIInfo-BSNbI4Gr.js";import{B as o}from"./Button-C0Um_QuO.js";import{I as X}from"./Icon-CC0yjdx9.js";import{c,b as d,a as g,D as r}from"./DialogCloseButton-D5YliaRd.js";import{D as j,a as G,b as p}from"./DialogActions-GLMqsJfB.js";import{B as J}from"./Badge-BSDHZ3bI.js";import"./preload-helper-Dp1pzeXC.js";import"./render-icon-MT6RlyNs.js";import"./ButtonBase-HkSfLFbE.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./Spinner-8-RB4YZR.js";import"./useMergeRefs-Caz9hOck.js";import"./useHostname-CbpnzdHv.js";import"./index-CC6DAVyL.js";import"./componentNames-hc9KR2nX.js";import"./text-accent-BQ9POoE5.js";import"./useOpenInteractionType-D3sASQWj.js";import"./store-B0wM9Zg8.js";import"./index-DIqvfT2b.js";import"./TokyoUIClose-BfMyMrDa.js";import"./IconButton-BpjNyYgD.js";import"./shared-strings-ThL9KyH0.js";const U="content__4abpn",Y="close__yXHzM",Z="title__L2rvR",$="description__FdpTb",tt="footer__5lWIE",et="buttonStack__eh-Q7",l={content:U,close:Y,title:Z,description:$,footer:tt,buttonStack:et},bt={title:"Components/Dialog/Primitives",component:r,subcomponents:{DialogCloseButton:g,DialogFooter:p,DialogTitle:d,DialogDescription:c,DialogActions:G,DialogButtonStack:j},parameters:{preventIframeFromScrollingParent:!0,docs:{story:{inline:!1,height:600}}},play:async({canvas:n,step:a})=>{await a("Open dialog",async()=>{const e=n.getByTestId("trigger");return await q.click(e),K(()=>{H(n.getByTestId("dialog")).toBeVisible()})})}},i=({style:n={}})=>t.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #ffe8f7, transparent), #ffe8f7)",...n}}),u={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsx(r,{dataset:{testid:"dialog"},open:a,onClose:()=>e(!1),children:t.jsx(i,{})})]})}},m={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsx(r,{dataset:{testid:"dialog"},open:a,onClose:()=>e(!1),overlay:!1,children:t.jsx(i,{})})]})}},x={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsx(r,{dataset:{testid:"dialog"},open:a,onClose:()=>e(!1),children:t.jsx(p,{children:t.jsxs(j,{children:[t.jsx(o,{variant:"quaternary",children:"Quaternary"}),t.jsx(o,{variant:"tertiary",children:"Tertiary"}),t.jsx(o,{variant:"secondary",children:"Secondary"}),t.jsx(o,{variant:"primary",children:"Primary"})]})})})]})}},D={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsxs(r,{dataset:{testid:"dialog"},open:a,onClose:()=>e(!1),children:[t.jsx(g,{}),t.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"20px",marginBottom:"24px"},children:[t.jsx(X,{size:"32",svg:V}),t.jsxs("hgroup",{children:[t.jsx(d,{children:"Dialog"}),t.jsx(c,{children:"AKA Task Dialog"})]})]}),t.jsx(i,{}),t.jsx(p,{children:t.jsxs(j,{children:[t.jsx(o,{variant:"tertiary",children:"Cancel"}),t.jsx(o,{variant:"primary",children:"Confirm"})]})})]})]})}},y={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsxs(r,{open:a,onClose:()=>e(!1),dataset:{testid:"dialog"},children:[t.jsx(g,{}),t.jsx(i,{style:{backgroundColor:"pink",marginInline:"calc(-1 * var(--dialog-padding))",marginTop:"calc(-1 * var(--dialog-padding))",marginBottom:"var(--dialog-padding)",width:"calc-size(auto)"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",alignItems:"center"},children:[t.jsx(d,{children:"Promo Dialog"}),t.jsx(c,{children:"For all your promotional needs"})]}),t.jsx(p,{children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",width:"fit-content",marginInline:"auto"},children:[t.jsx(o,{variant:"primary",children:"Confirm"}),t.jsx(o,{variant:"tertiary",children:"Cancel"})]})})]})]})}},f={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsxs(r,{dataset:{testid:"dialog"},open:a,onClose:()=>e(!1),children:[t.jsx(g,{children:t.jsx(o,{variant:"ghost",children:"Not Now"})}),t.jsx(i,{style:{background:"color-mix(in srgb, #ffe8f7, transparent)",position:"absolute",inset:0,height:"100%",zIndex:"-1"}}),t.jsx(i,{style:{marginInline:"calc(-1 * var(--dialog-padding))",marginTop:"calc(-1 * var(--dialog-padding))",marginBottom:"var(--dialog-padding)",width:"calc-size(auto)"}}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",alignItems:"center"},children:[t.jsx(J,{type:"ai",children:"Beta"}),t.jsx(d,{children:"Promo Dialog 2.0"}),t.jsx(c,{children:"Now with a longer button"})]}),t.jsx("div",{style:{marginTop:"var(--dialog-padding)"},children:t.jsx(o,{variant:"onColor",fullWidth:!0,children:"Let's go!"})})]})]})}},h={render:function(){const[a,e]=s.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(o,{dataset:{testid:"trigger"},onClick:()=>e(!0),children:"Open"}),t.jsxs(r,{open:a,onClose:()=>e(!1),dataset:{testid:"dialog"},className:l.content,children:[t.jsx(g,{className:l.close}),t.jsx(d,{className:l.title,children:"Custom Title"}),t.jsx(c,{className:l.description,children:"Custom Description"}),t.jsx("br",{}),Array.from({length:5}).map((ot,Q)=>t.jsx(i,{},Q)),t.jsx(p,{className:l.footer,children:t.jsxs(j,{className:l.buttonStack,children:[t.jsx(o,{variant:"primary",children:"Custom Primary"}),t.jsx(o,{variant:"secondary",children:"Custom Secondary"})]})})]})]})}};var B,C,S;u.parameters={...u.parameters,docs:{...(B=u.parameters)==null?void 0:B.docs,source:{originalSource:`{
|
|
2
2
|
render: function Story() {
|
|
3
3
|
const [open, setOpen] = useState(false);
|
|
4
4
|
return <>
|
|
@@ -210,4 +210,4 @@ import{r as s,j as t}from"./iframe-DjYTJz7A.js";import{u as q,w as K,e as H}from
|
|
|
210
210
|
</DialogRoot>
|
|
211
211
|
</>;
|
|
212
212
|
}
|
|
213
|
-
}`,...(M=(L=h.parameters)==null?void 0:L.docs)==null?void 0:M.source}}};const
|
|
213
|
+
}`,...(M=(L=h.parameters)==null?void 0:L.docs)==null?void 0:M.source}}};const Tt=["Default","WithoutOverlay","ButtonStackMultiple","TaskDialog","PromoDialog","PromoDialogExperiment","CustomStyles"];export{x as ButtonStackMultiple,h as CustomStyles,u as Default,y as PromoDialog,f as PromoDialogExperiment,D as TaskDialog,m as WithoutOverlay,Tt as __namedExportsOrder,bt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as
|
|
1
|
+
import{j as e,r as b}from"./iframe-B_74HtSc.js";import{D as H}from"./Dialog-CJQmu6iz.js";import{s as P,D as We,a as Le}from"./DialogCloseButton-D5YliaRd.js";import{B as r}from"./Button-C0Um_QuO.js";import{A as Ge}from"./Avatar-Die_4zu0.js";import{F as Fe}from"./TokyoUIInfo-BSNbI4Gr.js";import{N as Ke}from"./NumberField-klmIiQAi.js";import{I as Je}from"./Icon-CC0yjdx9.js";import{O as F}from"./OnboardingTooltip-DzQhJzWc.js";import{S as q,u as Xe}from"./Steps-DUeCVcxV.js";import{b as Ze,a as x}from"./DialogActions-GLMqsJfB.js";import{w as R}from"./componentNames-hc9KR2nX.js";import{C as w}from"./Checkbox-U8uzIr-e.js";import{I as $e}from"./IconTile-CAnlU9ss.js";import"./preload-helper-Dp1pzeXC.js";import"./useOpenInteractionType-D3sASQWj.js";import"./store-B0wM9Zg8.js";import"./index-DIqvfT2b.js";import"./TokyoUIClose-BfMyMrDa.js";import"./IconButton-BpjNyYgD.js";import"./render-icon-MT6RlyNs.js";import"./ButtonBase-HkSfLFbE.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./Spinner-8-RB4YZR.js";import"./useMergeRefs-Caz9hOck.js";import"./useHostname-CbpnzdHv.js";import"./index-CC6DAVyL.js";import"./shared-strings-ThL9KyH0.js";import"./constants-5om8Ptru.js";import"./FormControl-Zqf1cIwP.js";import"./message-DJT5rp5J.js";import"./Input-DuW1_5SG.js";import"./InputContainer-Cmdo_xyq.js";import"./text-accent-BQ9POoE5.js";import"./Text-DvShrljd.js";import"./text-centered-BEaaxMgl.js";import"./Heading-Cj8Si45g.js";import"./index-W3BB_3go.js";import"./ProgressSteps-Dce_SjLt.js";const _=q,f=q.Step,N=q.Next,z=q.Previous;function M({primaryButton:n,nextButton:t=e.jsx(N,{}),previousButton:a=e.jsx(z,{})}){const{currentStep:i,totalSteps:m}=Xe(),S=i===1,B=i===m;return e.jsx(Ze,{children:e.jsxs("div",{className:P.stepControls,"data-preply-ds-component":R.DialogSteps,children:[!S&&e.jsx("div",{className:P.previous,"data-preply-ds-component":R.DialogStepsPreviousContainer,children:a}),e.jsx("div",{className:P.next,"data-preply-ds-component":R.DialogStepsNextContainer,children:B?n:t})]})})}try{M.displayName="DialogStepsActions",M.__docgenInfo={description:"Wrapper around the Steps actions for usage in Dialog.",displayName:"DialogStepsActions",props:{primaryButton:{defaultValue:null,description:`Primary action button.
|
|
2
2
|
|
|
3
3
|
This button will be displayed on the last step.
|
|
4
4
|
@example <DialogStepsActions
|
|
@@ -13,7 +13,7 @@ This button will be used on all steps except the last one. When not provided, a
|
|
|
13
13
|
This button will be used on all steps except the first one. When not provided, a default button will be used.
|
|
14
14
|
@example <DialogStepsActions
|
|
15
15
|
previousButton={<DialogStepsPrevious onClick={() => {}}>Previous</DialogStepsPrevious>}
|
|
16
|
-
/>`,name:"previousButton",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}try{
|
|
16
|
+
/>`,name:"previousButton",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}try{_.displayName="DialogSteps",_.__docgenInfo={description:"",displayName:"DialogSteps",props:{"aria-label":{defaultValue:null,description:`A description of the step flow and its content for screen readers.
|
|
17
17
|
@example 'Onboarding Steps', 'Checkout Steps', 'Survey Steps', etc.`,name:"aria-label",required:!0,type:{name:"string"}},initialStep:{defaultValue:{value:"1"},description:"The initial step to start at (from `1` to `children.length`).",name:"initialStep",required:!1,type:{name:"enum",value:[{value:"number"}]}},onStepChange:{defaultValue:null,description:`Optional callback to control navigation between steps.
|
|
18
18
|
|
|
19
19
|
This is triggered either by using the \`Steps.Previous\` and \`Steps.Next\`
|
|
@@ -38,14 +38,14 @@ return next;
|
|
|
38
38
|
const handleStepChange = async (current, next) => {
|
|
39
39
|
if (next === 2) return 3; // Skip step 2
|
|
40
40
|
return next;
|
|
41
|
-
};`,name:"onStepChange",required:!1,type:{name:"enum",value:[{value:"(currentStep: number, nextStep: number) => number | Promise<number | undefined> | undefined"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}try{
|
|
41
|
+
};`,name:"onStepChange",required:!1,type:{name:"enum",value:[{value:"(currentStep: number, nextStep: number) => number | Promise<number | undefined> | undefined"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}try{f.displayName="DialogStep",f.__docgenInfo={description:"",displayName:"DialogStep",props:{title:{defaultValue:null,description:"Main heading for the step.",name:"title",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},description:{defaultValue:null,description:"Optional description text displayed below the title.",name:"description",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},hideHeader:{defaultValue:null,description:"If true, hides the step title and description.",name:"hideHeader",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},children:{defaultValue:null,description:"Step content.",name:"children",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}try{N.displayName="DialogStepsNext",N.__docgenInfo={description:"",displayName:"DialogStepsNext",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"inverted"'},{value:'"critical"'},{value:'"quaternary"'},{value:'"ghost"'},{value:'"onColor"'},{value:'"classroom"'},{value:'"primaryB2b"'},{value:'"primaryTutor"'},{value:'"newFeature"'},{value:'"ai"'}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"enum",value:[{value:"string"}]}},size:{defaultValue:null,description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"large"'},{value:'"medium"'},{value:'"small"'},{value:"ResponsiveProp<ButtonSize>"}]}},fullWidth:{defaultValue:null,description:"",name:"fullWidth",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},wrap:{defaultValue:null,description:"",name:"wrap",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},href:{defaultValue:null,description:"",name:"href",required:!1,type:{name:"enum",value:[{value:"string"}]}},download:{defaultValue:null,description:"",name:"download",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},opensInNewTab:{defaultValue:null,description:"",name:"opensInNewTab",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},nofollow:{defaultValue:null,description:"",name:"nofollow",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},submitsForm:{defaultValue:null,description:"",name:"submitsForm",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},assistiveText:{defaultValue:null,description:"",name:"assistiveText",required:!1,type:{name:"enum",value:[{value:"string"}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onKeyDown:{defaultValue:null,description:"",name:"onKeyDown",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler"}]}},onKeyUp:{defaultValue:null,description:"",name:"onKeyUp",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler"}]}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onMouseEnter:{defaultValue:null,description:"",name:"onMouseEnter",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onMouseMove:{defaultValue:null,description:"",name:"onMouseMove",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onPointerDown:{defaultValue:null,description:"",name:"onPointerDown",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onPointerEnter:{defaultValue:null,description:"",name:"onPointerEnter",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},busy:{defaultValue:null,description:"Replaces the content with a loading indicator.",name:"busy",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},as:{defaultValue:null,description:`Custom element to render the button.
|
|
42
42
|
|
|
43
43
|
Allows rendering the button using a different React element or component.
|
|
44
44
|
This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
|
|
45
45
|
@example // Render as a react router link component
|
|
46
46
|
import { Link } from 'react-router-dom';
|
|
47
47
|
|
|
48
|
-
<ButtonBase as={<Link to="/home" />} />`,name:"as",required:!1,type:{name:"enum",value:[{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},url:{defaultValue:null,description:"@deprecated Use `href` instead",name:"url",required:!1,type:{name:"enum",value:[{value:"string"}]}},
|
|
48
|
+
<ButtonBase as={<Link to="/home" />} />`,name:"as",required:!1,type:{name:"enum",value:[{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},url:{defaultValue:null,description:"@deprecated Use `href` instead",name:"url",required:!1,type:{name:"enum",value:[{value:"string"}]}},a11yLabel:{defaultValue:null,description:"@deprecated Use `assistiveText` instead",name:"a11yLabel",required:!1,type:{name:"enum",value:[{value:"string"}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
|
|
49
49
|
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
50
50
|
|
|
51
51
|
<Button leadingSvgIcon={TokyoUITag}>Button</Button>
|
|
@@ -55,14 +55,14 @@ or
|
|
|
55
55
|
|
|
56
56
|
<Button trailingSvgIcon={TokyoUITag}>Button</Button>
|
|
57
57
|
or
|
|
58
|
-
<Button trailingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"trailingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | HTMLButtonElement | null) => void"},{value:"RefObject<HTMLAnchorElement | HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}try{
|
|
58
|
+
<Button trailingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"trailingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | HTMLButtonElement | null) => void"},{value:"RefObject<HTMLAnchorElement | HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}try{z.displayName="DialogStepsPrevious",z.__docgenInfo={description:"",displayName:"DialogStepsPrevious",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"inverted"'},{value:'"critical"'},{value:'"quaternary"'},{value:'"ghost"'},{value:'"onColor"'},{value:'"classroom"'},{value:'"primaryB2b"'},{value:'"primaryTutor"'},{value:'"newFeature"'},{value:'"ai"'}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"enum",value:[{value:"string"}]}},size:{defaultValue:null,description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"large"'},{value:'"medium"'},{value:'"small"'},{value:"ResponsiveProp<ButtonSize>"}]}},fullWidth:{defaultValue:null,description:"",name:"fullWidth",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},wrap:{defaultValue:null,description:"",name:"wrap",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},href:{defaultValue:null,description:"",name:"href",required:!1,type:{name:"enum",value:[{value:"string"}]}},download:{defaultValue:null,description:"",name:"download",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},opensInNewTab:{defaultValue:null,description:"",name:"opensInNewTab",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},nofollow:{defaultValue:null,description:"",name:"nofollow",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},submitsForm:{defaultValue:null,description:"",name:"submitsForm",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},assistiveText:{defaultValue:null,description:"",name:"assistiveText",required:!1,type:{name:"enum",value:[{value:"string"}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onKeyDown:{defaultValue:null,description:"",name:"onKeyDown",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler"}]}},onKeyUp:{defaultValue:null,description:"",name:"onKeyUp",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler"}]}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onMouseEnter:{defaultValue:null,description:"",name:"onMouseEnter",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onMouseMove:{defaultValue:null,description:"",name:"onMouseMove",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onPointerDown:{defaultValue:null,description:"",name:"onPointerDown",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},onPointerEnter:{defaultValue:null,description:"",name:"onPointerEnter",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},busy:{defaultValue:null,description:"Replaces the content with a loading indicator.",name:"busy",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},as:{defaultValue:null,description:`Custom element to render the button.
|
|
59
59
|
|
|
60
60
|
Allows rendering the button using a different React element or component.
|
|
61
61
|
This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
|
|
62
62
|
@example // Render as a react router link component
|
|
63
63
|
import { Link } from 'react-router-dom';
|
|
64
64
|
|
|
65
|
-
<ButtonBase as={<Link to="/home" />} />`,name:"as",required:!1,type:{name:"enum",value:[{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},url:{defaultValue:null,description:"@deprecated Use `href` instead",name:"url",required:!1,type:{name:"enum",value:[{value:"string"}]}},
|
|
65
|
+
<ButtonBase as={<Link to="/home" />} />`,name:"as",required:!1,type:{name:"enum",value:[{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},url:{defaultValue:null,description:"@deprecated Use `href` instead",name:"url",required:!1,type:{name:"enum",value:[{value:"string"}]}},a11yLabel:{defaultValue:null,description:"@deprecated Use `assistiveText` instead",name:"a11yLabel",required:!1,type:{name:"enum",value:[{value:"string"}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
|
|
66
66
|
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
67
67
|
|
|
68
68
|
<Button leadingSvgIcon={TokyoUITag}>Button</Button>
|
|
@@ -72,7 +72,7 @@ or
|
|
|
72
72
|
|
|
73
73
|
<Button trailingSvgIcon={TokyoUITag}>Button</Button>
|
|
74
74
|
or
|
|
75
|
-
<Button trailingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"trailingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | HTMLButtonElement | null) => void"},{value:"RefObject<HTMLAnchorElement | HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const{action:l}=__STORYBOOK_MODULE_ACTIONS__,{expect:o,fn:M,userEvent:s,waitFor:d,within:F}=__STORYBOOK_MODULE_TEST__,u=()=>e.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}});let _e=()=>{};const Le=(n,t)=>{const[a,i]=f.useState(t.args.open);_e=()=>i(!1);const m=()=>{var x,S;i(!1),(S=(x=t.args).onClose)==null||S.call(x)};return e.jsxs(e.Fragment,{children:[e.jsx(r,{dataset:{testid:"trigger"},onClick:()=>i(!0),children:"Open"}),e.jsx(n,{args:{...t.args,open:a,onClose:m}})]})},R={title:"Components/Dialog",component:H,parameters:{preventIframeFromScrollingParent:!0,docs:{story:{inline:!1,height:600}}},decorators:[Le],args:{open:!1,onClose:M(),children:e.jsx(u,{}),dataset:{testid:"dialog"}},play:async({canvas:n,step:t})=>{await t("Open dialog",async()=>{const a=n.getByTestId("trigger");return await s.click(a),d(()=>{o(n.getByTestId("dialog")).toBeVisible()})})}},w={args:{title:"Dialog title",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(b,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:()=>{l("Primary button clicked"),_e()},children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},Ge=()=>{const[n,t]=f.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{label:"Child count",value:n,onChange:a=>t(parseInt(a.target.value)),required:!0}),e.jsx("br",{}),Array.from({length:n},(a,i)=>e.jsx(u,{},i))]})},T={args:{title:"Height Responsiveness",description:"Change the number of children to see the Dialog style respond to the height change",children:e.jsxs(e.Fragment,{children:[e.jsx(Ge,{}),e.jsx(b,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},k={args:{title:"Height Respects Component Outlines",description:"Height respect, by leaving space for , components' outline created through the dedicated outline tokens.",children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx(B,{checked:!0,dsInternalSimulation:"focus"}),e.jsx(B,{checked:!0,dsInternalSimulation:"focus"})]}),e.jsx(u,{}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx(B,{checked:!0,dsInternalSimulation:"focus"}),e.jsx(B,{checked:!0,dsInternalSimulation:"focus"})]}),e.jsx(b,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},C={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},args:{title:"Mobile Full Height",mobileFullHeight:!0}},D={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(b,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"})})]})}},I={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(b,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},p=()=>e.jsxs(Ne,{open:!0,dataset:{testid:"dialog"},children:[e.jsx(ze,{}),e.jsx(e.Fragment,{children:e.jsxs(O,{"aria-label":"Onboarding Steps",children:[e.jsx(h,{title:"Profile",description:"Tell us more about yourself",children:e.jsx(u,{})}),e.jsx(h,{title:"Subject",description:"What do you want to learn?",children:e.jsx(u,{})}),e.jsx(h,{title:"Availability",description:"When are you available?",children:e.jsx(u,{})}),e.jsx(z,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"})})]})})]});p.play=async n=>{const{canvas:t,step:a}=n;await a("Dialog should be visible",async()=>{await d(()=>{o(t.getByTestId("dialog")).toBeVisible()})}),await a("Initially, only next button is present",async()=>{o(t.queryByRole("button",{name:"Next"})).toBeVisible(),o(t.queryByRole("button",{name:"Previous"})).not.toBeInTheDocument(),o(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the next step. Previous/Next buttons are visible",async()=>{await s.click(t.getByRole("button",{name:"Next"})),o(t.queryByRole("button",{name:"Previous"})).toBeVisible(),o(t.queryByRole("button",{name:"Next"})).toBeVisible(),o(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the last step. Previous/Primary buttons are visible",async()=>{await s.click(t.getByRole("button",{name:"Next"})),o(t.queryByRole("button",{name:"Previous"})).toBeVisible(),o(t.queryByRole("button",{name:"Primary"})).toBeVisible(),o(t.queryByRole("button",{name:"Next"})).not.toBeInTheDocument()})};const v={args:{leadingElement:e.jsx(Fe,{size:"32",svg:He}),title:"Information Dialog"}},y={args:{leadingElement:e.jsx(Me,{size:"48",alt:"User"}),title:"User Profile",description:"This dialog shows a user profile with an avatar in the title"}},c=n=>(f.useEffect(()=>(document.body.style.setProperty("--ds-dialog-overlay-z-index-override","88"),document.body.style.setProperty("--ds-dialog-content-z-index-override","77"),()=>{document.body.style.removeProperty("--ds-dialog-overlay-z-index-override"),document.body.style.removeProperty("--ds-dialog-content-z-index-override")}),[]),e.jsx("div",{style:{position:"relative",zIndex:99},children:e.jsx(H,{...n,title:"ZIndex Override"})}));c.parameters={docs:{source:{type:"code"}}};c.play=async({canvas:n,step:t})=>{await t("Open alert",async()=>(await s.click(n.getByTestId("trigger")),d(()=>{const a=n.getByTestId("dialog");o(a).toBeVisible()}))),await t("Check content's computed z-index",async()=>{const a=n.getByTestId("dialog"),i=getComputedStyle(a);o(i.zIndex).toBe("77")}),await t("Check overlay's computed z-index",async()=>{const a=n.getByTestId("dialog-overlay");if(!a)throw new Error("The overlay happened to be the previous sibling of the dialog content, but it isn't anymore. Please update the test.");const i=getComputedStyle(a);o(i.zIndex).toBe("88")})};const E={uncontrolled:M(l("uncontrolled")),controlled:M(l("controlled"))},Ke=()=>{const[n,t]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(A,{dataset:{testid:"uncontrolled-tooltip"},actionOnClick:E.uncontrolled,title:"Uncontrolled",text:"text",children:e.jsx(r,{children:"Uncontrolled"})}),e.jsx(A,{dataset:{testid:"controlled-tooltip"},actionOnClick:E.controlled,title:"Controlled",text:"text",disabled:!n,onClose:()=>t(!1),children:e.jsx(r,{onClick:()=>t(!0),children:"Open tooltip"})})]})},V={tags:["!autodocs"],args:{children:e.jsx(Ke,{})},play:async n=>{var m;await((m=R.play)==null?void 0:m.call(R,n));const{canvas:t,step:a}=n,i=t.getByTestId("uncontrolled-tooltip");await a("Uncontrolled tooltip should be visible",async()=>{await d(()=>{o(i).toBeVisible()})}),await a("Click on uncontrolled tooltip action",async()=>{await s.click(F(i).getByTestId("action")),o(E.uncontrolled).toHaveBeenCalledOnce()}),await a("Open controlled tooltip",async()=>{await s.click(t.getByRole("button",{name:"Open tooltip"})),await d(()=>{o(t.getByTestId("controlled-tooltip")).toBeVisible()})}),await a("Click on controlled tooltip action",async()=>{await s.click(F(t.getByTestId("controlled-tooltip")).getByTestId("action")),o(E.controlled).toHaveBeenCalledOnce()})}},U=({number:n,children:t})=>{const[a,i]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(r,{onClick:()=>i(!0),dataset:{testid:`trigger-${n}`},children:"Open"}),e.jsx(H,{open:a,onClose:()=>i(!1),title:`Dialog ${n}`,description:void 0,leadingElement:void 0,dataset:{testid:`dialog-${n}`},children:t})]})},g={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},args:{title:"Dialog 1",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx("br",{}),e.jsx(U,{number:2,children:e.jsx(U,{number:3})})]})},play:async({canvas:n,step:t})=>{await t("Open dialog",async()=>{const a=n.getByTestId("trigger");return await s.click(a),d(()=>{o(n.getByTestId("dialog")).toBeVisible()})}),await t("Open dialog 2",async()=>{const a=n.getByTestId("trigger-2");return await s.click(a),d(()=>{o(n.getByTestId("dialog-2")).toBeVisible()})}),await t("Open dialog 3",async()=>{const a=n.getByTestId("trigger-3");return await s.click(a),d(()=>{o(n.getByTestId("dialog-3")).toBeVisible()})})}};var W,L,G;w.parameters={...w.parameters,docs:{...(W=w.parameters)==null?void 0:W.docs,source:{originalSource:`{
|
|
75
|
+
<Button trailingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"trailingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | HTMLButtonElement | null) => void"},{value:"RefObject<HTMLAnchorElement | HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const{action:l}=__STORYBOOK_MODULE_ACTIONS__,{expect:o,fn:A,userEvent:s,waitFor:d,within:U}=__STORYBOOK_MODULE_TEST__,u=()=>e.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}});let Ue=()=>{};const Ye=(n,t)=>{const[a,i]=b.useState(t.args.open);Ue=()=>i(!1);const m=()=>{var S,B;i(!1),(B=(S=t.args).onClose)==null||B.call(S)};return e.jsxs(e.Fragment,{children:[e.jsx(r,{dataset:{testid:"trigger"},onClick:()=>i(!0),children:"Open"}),e.jsx(n,{args:{...t.args,open:a,onClose:m}})]})},O={title:"Components/Dialog",component:H,parameters:{preventIframeFromScrollingParent:!0,docs:{story:{inline:!1,height:600}}},decorators:[Ye],args:{open:!1,onClose:A(),children:e.jsx(u,{}),dataset:{testid:"dialog"}},play:async({canvas:n,step:t})=>{await t("Open dialog",async()=>{const a=n.getByTestId("trigger");return await s.click(a),d(()=>{o(n.getByTestId("dialog")).toBeVisible()})})}},T={args:{title:"Dialog title",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(x,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:()=>{l("Primary button clicked"),Ue()},children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},Qe=()=>{const[n,t]=b.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(Ke,{label:"Child count",value:n,onChange:a=>t(parseInt(a.target.value)),required:!0}),e.jsx("br",{}),Array.from({length:n},(a,i)=>e.jsx(u,{},i))]})},k={args:{title:"Height Responsiveness",description:"Change the number of children to see the Dialog style respond to the height change",children:e.jsxs(e.Fragment,{children:[e.jsx(Qe,{}),e.jsx(x,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},C={args:{title:"Height Respects Component Outlines",description:"Height respect, by leaving space for , components' outline created through the dedicated outline tokens.",children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx(w,{checked:!0,dsInternalSimulation:"focus"}),e.jsx(w,{checked:!0,dsInternalSimulation:"focus"})]}),e.jsx(u,{}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx(w,{checked:!0,dsInternalSimulation:"focus"}),e.jsx(w,{checked:!0,dsInternalSimulation:"focus"})]}),e.jsx(x,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},I={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},args:{title:"Mobile Full Height",mobileFullHeight:!0}},D={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(x,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"})})]})}},V={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(x,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(r,{size:"medium",variant:"tertiary",onClick:l("Secondary button clicked"),children:"Secondary"})})]})}},p=()=>e.jsxs(We,{open:!0,dataset:{testid:"dialog"},children:[e.jsx(Le,{}),e.jsx(e.Fragment,{children:e.jsxs(_,{"aria-label":"Onboarding Steps",children:[e.jsx(f,{title:"Profile",description:"Tell us more about yourself",children:e.jsx(u,{})}),e.jsx(f,{title:"Subject",description:"What do you want to learn?",children:e.jsx(u,{})}),e.jsx(f,{title:"Availability",description:"When are you available?",children:e.jsx(u,{})}),e.jsx(M,{primaryButton:e.jsx(r,{size:"medium",variant:"primary",onClick:l("Primary button clicked"),children:"Primary"})})]})})]});p.play=async n=>{const{canvas:t,step:a}=n;await a("Dialog should be visible",async()=>{await d(()=>{o(t.getByTestId("dialog")).toBeVisible()})}),await a("Initially, only next button is present",async()=>{o(t.queryByRole("button",{name:"Next"})).toBeVisible(),o(t.queryByRole("button",{name:"Previous"})).not.toBeInTheDocument(),o(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the next step. Previous/Next buttons are visible",async()=>{await s.click(t.getByRole("button",{name:"Next"})),o(t.queryByRole("button",{name:"Previous"})).toBeVisible(),o(t.queryByRole("button",{name:"Next"})).toBeVisible(),o(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the last step. Previous/Primary buttons are visible",async()=>{await s.click(t.getByRole("button",{name:"Next"})),o(t.queryByRole("button",{name:"Previous"})).toBeVisible(),o(t.queryByRole("button",{name:"Primary"})).toBeVisible(),o(t.queryByRole("button",{name:"Next"})).not.toBeInTheDocument()})};const v={args:{leadingElement:e.jsx(Je,{size:"32",svg:Fe}),title:"Information Dialog"}},y={args:{leadingElement:e.jsx($e,{size:"medium",svg:Fe}),title:"Information Dialog"}},g={args:{leadingElement:e.jsx(Ge,{size:"48",alt:"User"}),title:"User Profile",description:"This dialog shows a user profile with an avatar in the title"}},c=n=>(b.useEffect(()=>(document.body.style.setProperty("--ds-dialog-overlay-z-index-override","88"),document.body.style.setProperty("--ds-dialog-content-z-index-override","77"),()=>{document.body.style.removeProperty("--ds-dialog-overlay-z-index-override"),document.body.style.removeProperty("--ds-dialog-content-z-index-override")}),[]),e.jsx("div",{style:{position:"relative",zIndex:99},children:e.jsx(H,{...n,title:"ZIndex Override"})}));c.parameters={docs:{source:{type:"code"}}};c.play=async({canvas:n,step:t})=>{await t("Open alert",async()=>(await s.click(n.getByTestId("trigger")),d(()=>{const a=n.getByTestId("dialog");o(a).toBeVisible()}))),await t("Check content's computed z-index",async()=>{const a=n.getByTestId("dialog"),i=getComputedStyle(a);o(i.zIndex).toBe("77")}),await t("Check overlay's computed z-index",async()=>{const a=n.getByTestId("dialog-overlay");if(!a)throw new Error("The overlay happened to be the previous sibling of the dialog content, but it isn't anymore. Please update the test.");const i=getComputedStyle(a);o(i.zIndex).toBe("88")})};const j={uncontrolled:A(l("uncontrolled")),controlled:A(l("controlled"))},et=()=>{const[n,t]=b.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(F,{dataset:{testid:"uncontrolled-tooltip"},actionOnClick:j.uncontrolled,title:"Uncontrolled",text:"text",children:e.jsx(r,{children:"Uncontrolled"})}),e.jsx(F,{dataset:{testid:"controlled-tooltip"},actionOnClick:j.controlled,title:"Controlled",text:"text",disabled:!n,onClose:()=>t(!1),children:e.jsx(r,{onClick:()=>t(!0),children:"Open tooltip"})})]})},E={tags:["!autodocs"],args:{children:e.jsx(et,{})},play:async n=>{var m;await((m=O.play)==null?void 0:m.call(O,n));const{canvas:t,step:a}=n,i=t.getByTestId("uncontrolled-tooltip");await a("Uncontrolled tooltip should be visible",async()=>{await d(()=>{o(i).toBeVisible()})}),await a("Click on uncontrolled tooltip action",async()=>{await s.click(U(i).getByTestId("action")),o(j.uncontrolled).toHaveBeenCalledOnce()}),await a("Open controlled tooltip",async()=>{await s.click(t.getByRole("button",{name:"Open tooltip"})),await d(()=>{o(t.getByTestId("controlled-tooltip")).toBeVisible()})}),await a("Click on controlled tooltip action",async()=>{await s.click(U(t.getByTestId("controlled-tooltip")).getByTestId("action")),o(j.controlled).toHaveBeenCalledOnce()})}},W=({number:n,children:t})=>{const[a,i]=b.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(r,{onClick:()=>i(!0),dataset:{testid:`trigger-${n}`},children:"Open"}),e.jsx(H,{open:a,onClose:()=>i(!1),title:`Dialog ${n}`,description:void 0,leadingElement:void 0,dataset:{testid:`dialog-${n}`},children:t})]})},h={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},args:{title:"Dialog 1",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx("br",{}),e.jsx(W,{number:2,children:e.jsx(W,{number:3})})]})},play:async({canvas:n,step:t})=>{await t("Open dialog",async()=>{const a=n.getByTestId("trigger");return await s.click(a),d(()=>{o(n.getByTestId("dialog")).toBeVisible()})}),await t("Open dialog 2",async()=>{const a=n.getByTestId("trigger-2");return await s.click(a),d(()=>{o(n.getByTestId("dialog-2")).toBeVisible()})}),await t("Open dialog 3",async()=>{const a=n.getByTestId("trigger-3");return await s.click(a),d(()=>{o(n.getByTestId("dialog-3")).toBeVisible()})})}};var L,G,K;T.parameters={...T.parameters,docs:{...(L=T.parameters)==null?void 0:L.docs,source:{originalSource:`{
|
|
76
76
|
args: {
|
|
77
77
|
title: 'Dialog title',
|
|
78
78
|
children: <>
|
|
@@ -87,7 +87,7 @@ or
|
|
|
87
87
|
</Button>} />
|
|
88
88
|
</>
|
|
89
89
|
}
|
|
90
|
-
}`,...(
|
|
90
|
+
}`,...(K=(G=T.parameters)==null?void 0:G.docs)==null?void 0:K.source}}};var J,X,Z;k.parameters={...k.parameters,docs:{...(J=k.parameters)==null?void 0:J.docs,source:{originalSource:`{
|
|
91
91
|
args: {
|
|
92
92
|
title: 'Height Responsiveness',
|
|
93
93
|
description: 'Change the number of children to see the Dialog style respond to the height change',
|
|
@@ -100,7 +100,7 @@ or
|
|
|
100
100
|
</Button>} />
|
|
101
101
|
</>
|
|
102
102
|
}
|
|
103
|
-
}`,...(
|
|
103
|
+
}`,...(Z=(X=k.parameters)==null?void 0:X.docs)==null?void 0:Z.source}}};var $,Y,Q;C.parameters={...C.parameters,docs:{...($=C.parameters)==null?void 0:$.docs,source:{originalSource:`{
|
|
104
104
|
args: {
|
|
105
105
|
title: \`Height Respects Component Outlines\`,
|
|
106
106
|
description: \`Height respect, by leaving space for , components' outline created through the dedicated outline tokens.\`,
|
|
@@ -127,7 +127,7 @@ or
|
|
|
127
127
|
</Button>} />
|
|
128
128
|
</>
|
|
129
129
|
}
|
|
130
|
-
}`,...(Y=
|
|
130
|
+
}`,...(Q=(Y=C.parameters)==null?void 0:Y.docs)==null?void 0:Q.source}}};var ee,te,ne;I.parameters={...I.parameters,docs:{...(ee=I.parameters)==null?void 0:ee.docs,source:{originalSource:`{
|
|
131
131
|
parameters: {
|
|
132
132
|
chromatic: {
|
|
133
133
|
modes: {
|
|
@@ -147,7 +147,7 @@ or
|
|
|
147
147
|
title: 'Mobile Full Height',
|
|
148
148
|
mobileFullHeight: true
|
|
149
149
|
}
|
|
150
|
-
}`,...(
|
|
150
|
+
}`,...(ne=(te=I.parameters)==null?void 0:te.docs)==null?void 0:ne.source}}};var ae,oe,ie;D.parameters={...D.parameters,docs:{...(ae=D.parameters)==null?void 0:ae.docs,source:{originalSource:`{
|
|
151
151
|
args: {
|
|
152
152
|
title: 'Dialog Title',
|
|
153
153
|
description: 'This is the dialog description.',
|
|
@@ -158,7 +158,7 @@ or
|
|
|
158
158
|
</Button>} />
|
|
159
159
|
</>
|
|
160
160
|
}
|
|
161
|
-
}`,...(
|
|
161
|
+
}`,...(ie=(oe=D.parameters)==null?void 0:oe.docs)==null?void 0:ie.source}}};var re,le,se;V.parameters={...V.parameters,docs:{...(re=V.parameters)==null?void 0:re.docs,source:{originalSource:`{
|
|
162
162
|
args: {
|
|
163
163
|
title: 'Dialog Title',
|
|
164
164
|
description: 'This is the dialog description.',
|
|
@@ -171,7 +171,7 @@ or
|
|
|
171
171
|
</Button>} />
|
|
172
172
|
</>
|
|
173
173
|
}
|
|
174
|
-
}`,...(
|
|
174
|
+
}`,...(se=(le=V.parameters)==null?void 0:le.docs)==null?void 0:se.source}}};var ue,de,ce,me,pe;p.parameters={...p.parameters,docs:{...(ue=p.parameters)==null?void 0:ue.docs,source:{originalSource:`() => {
|
|
175
175
|
return <DialogRoot open={true} dataset={{
|
|
176
176
|
testid: \`dialog\`
|
|
177
177
|
}}>
|
|
@@ -194,19 +194,24 @@ or
|
|
|
194
194
|
</DialogSteps>
|
|
195
195
|
</>
|
|
196
196
|
</DialogRoot>;
|
|
197
|
-
}`,...(
|
|
198
|
-
demonstrates how to use DialogRoot to build custom dialogs (in this case, a header-free dialog).`,...(
|
|
197
|
+
}`,...(ce=(de=p.parameters)==null?void 0:de.docs)==null?void 0:ce.source},description:{story:`The Dialog component can be used with the Steps component to create multi-step flows. This
|
|
198
|
+
demonstrates how to use DialogRoot to build custom dialogs (in this case, a header-free dialog).`,...(pe=(me=p.parameters)==null?void 0:me.docs)==null?void 0:pe.description}}};var ve,ye,ge,he,fe;v.parameters={...v.parameters,docs:{...(ve=v.parameters)==null?void 0:ve.docs,source:{originalSource:`{
|
|
199
199
|
args: {
|
|
200
200
|
leadingElement: <Icon size="32" svg={InfoIcon} />,
|
|
201
201
|
title: 'Information Dialog'
|
|
202
202
|
}
|
|
203
|
-
}`,...(
|
|
203
|
+
}`,...(ge=(ye=v.parameters)==null?void 0:ye.docs)==null?void 0:ge.source},description:{story:"A dialog with an Icon component in the title. This demonstrates how to use React elements in the title.",...(fe=(he=v.parameters)==null?void 0:he.docs)==null?void 0:fe.description}}};var be,xe,Se,Be,we;y.parameters={...y.parameters,docs:{...(be=y.parameters)==null?void 0:be.docs,source:{originalSource:`{
|
|
204
|
+
args: {
|
|
205
|
+
leadingElement: <IconTile size="medium" svg={InfoIcon} />,
|
|
206
|
+
title: 'Information Dialog'
|
|
207
|
+
}
|
|
208
|
+
}`,...(Se=(xe=y.parameters)==null?void 0:xe.docs)==null?void 0:Se.source},description:{story:"A dialog with an IconTile component in the title. This demonstrates how to use React elements in the title.",...(we=(Be=y.parameters)==null?void 0:Be.docs)==null?void 0:we.description}}};var Te,ke,Ce,Ie,De;g.parameters={...g.parameters,docs:{...(Te=g.parameters)==null?void 0:Te.docs,source:{originalSource:`{
|
|
204
209
|
args: {
|
|
205
210
|
leadingElement: <Avatar size="48" alt="User" />,
|
|
206
211
|
title: 'User Profile',
|
|
207
212
|
description: 'This dialog shows a user profile with an avatar in the title'
|
|
208
213
|
}
|
|
209
|
-
}`,...(
|
|
214
|
+
}`,...(Ce=(ke=g.parameters)==null?void 0:ke.docs)==null?void 0:Ce.source},description:{story:"A dialog with an Avatar component in the title. This demonstrates how to use compound components in the title.",...(De=(Ie=g.parameters)==null?void 0:Ie.docs)==null?void 0:De.description}}};var Ve,Ee,je,qe,Pe;c.parameters={...c.parameters,docs:{...(Ve=c.parameters)==null?void 0:Ve.docs,source:{originalSource:`args => {
|
|
210
215
|
useEffect(() => {
|
|
211
216
|
document.body.style.setProperty('--ds-dialog-overlay-z-index-override', '88');
|
|
212
217
|
document.body.style.setProperty('--ds-dialog-content-z-index-override', '77');
|
|
@@ -221,7 +226,7 @@ demonstrates how to use DialogRoot to build custom dialogs (in this case, a head
|
|
|
221
226
|
}}>
|
|
222
227
|
<Dialog {...args} title="ZIndex Override" />
|
|
223
228
|
</div>;
|
|
224
|
-
}`,...(
|
|
229
|
+
}`,...(je=(Ee=c.parameters)==null?void 0:Ee.docs)==null?void 0:je.source},description:{story:`The Dialog component provides CSS property escape hatches for controlling the z-index of both the overlay and content:
|
|
225
230
|
|
|
226
231
|
- \\\`--ds-dialog-overlay-z-index-override\\\`: Controls the overlay's z-index
|
|
227
232
|
- \\\`--ds-dialog-content-z-index-override\\\`: Controls the content's z-index
|
|
@@ -231,7 +236,7 @@ These should only be used when necessary, as proper stacking context isolation i
|
|
|
231
236
|
In the following example, the stacking order of the dialog trigger, overlay, and content are
|
|
232
237
|
reveresed using the above CSS properties.
|
|
233
238
|
|
|
234
|
-
Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In a real-world scenario, this should ideally be done in a global stylesheet or a theme provider.`,...(
|
|
239
|
+
Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In a real-world scenario, this should ideally be done in a global stylesheet or a theme provider.`,...(Pe=(qe=c.parameters)==null?void 0:qe.docs)==null?void 0:Pe.description}}};var Re,Oe,_e;E.parameters={...E.parameters,docs:{...(Re=E.parameters)==null?void 0:Re.docs,source:{originalSource:`{
|
|
235
240
|
tags: ['!autodocs'],
|
|
236
241
|
args: {
|
|
237
242
|
children: <ContentWithOnboardingTooltip />
|
|
@@ -265,7 +270,7 @@ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In
|
|
|
265
270
|
expect(onboardingTooltipCallbacks.controlled).toHaveBeenCalledOnce();
|
|
266
271
|
});
|
|
267
272
|
}
|
|
268
|
-
}`,...(
|
|
273
|
+
}`,...(_e=(Oe=E.parameters)==null?void 0:Oe.docs)==null?void 0:_e.source}}};var Ne,ze,Me,Ae,He;h.parameters={...h.parameters,docs:{...(Ne=h.parameters)==null?void 0:Ne.docs,source:{originalSource:`{
|
|
269
274
|
parameters: {
|
|
270
275
|
chromatic: {
|
|
271
276
|
modes: {
|
|
@@ -317,8 +322,8 @@ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In
|
|
|
317
322
|
});
|
|
318
323
|
});
|
|
319
324
|
}
|
|
320
|
-
}`,...(
|
|
325
|
+
}`,...(Me=(ze=h.parameters)==null?void 0:ze.docs)==null?void 0:Me.source},description:{story:`Each nested \`Dialog\` will be opened in a new stacking context, meaning that
|
|
321
326
|
they will maintain their own focus, keyboard navigation, and light dismiss
|
|
322
327
|
behavior without affecting the parent dialog
|
|
323
328
|
|
|
324
|
-
They will each also have their own backdrop overlay.`,...(
|
|
329
|
+
They will each also have their own backdrop overlay.`,...(He=(Ae=h.parameters)==null?void 0:Ae.docs)==null?void 0:He.description}}};const At=["Default","HeightResponsiveness","HeightRespectsComponentOutlines","MobileFullHeight","WithPrimaryAction","WithSecondaryAction","WithSteps","WithIcon","WithIconTile","WithAvatar","WithZIndexOverride","WithOnboardingTooltipInside","NestedDialogs"];export{T as Default,C as HeightRespectsComponentOutlines,k as HeightResponsiveness,I as MobileFullHeight,h as NestedDialogs,g as WithAvatar,v as WithIcon,y as WithIconTile,E as WithOnboardingTooltipInside,D as WithPrimaryAction,V as WithSecondaryAction,p as WithSteps,c as WithZIndexOverride,At as __namedExportsOrder,O as default};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import{j as i,r as ee}from"./iframe-B_74HtSc.js";import{B as te}from"./Button-C0Um_QuO.js";import{D as se}from"./Dialog-CJQmu6iz.js";import"./preload-helper-Dp1pzeXC.js";import"./render-icon-MT6RlyNs.js";import"./ButtonBase-HkSfLFbE.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./Spinner-8-RB4YZR.js";import"./useMergeRefs-Caz9hOck.js";import"./useHostname-CbpnzdHv.js";import"./index-CC6DAVyL.js";import"./componentNames-hc9KR2nX.js";import"./DialogCloseButton-D5YliaRd.js";import"./useOpenInteractionType-D3sASQWj.js";import"./store-B0wM9Zg8.js";import"./index-DIqvfT2b.js";import"./TokyoUIClose-BfMyMrDa.js";import"./IconButton-BpjNyYgD.js";import"./shared-strings-ThL9KyH0.js";const{expect:r,fn:ae,userEvent:l,waitFor:d}=__STORYBOOK_MODULE_TEST__,oe=()=>i.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}}),ne=(e,t)=>{const[o,n]=ee.useState(t.args.open),s=()=>{var c,x;n(!1),(x=(c=t.args).onClose)==null||x.call(c)};return i.jsxs(i.Fragment,{children:[i.jsx(te,{dataset:{testid:"trigger"},onClick:()=>n(!0),children:"Open"}),i.jsx(e,{args:{...t.args,open:o,onClose:s}})]})},a={title:"Components/Dialog/Tests",component:se,parameters:{preventIframeFromScrollingParent:!0,docs:{story:{inline:!1,height:600}}},decorators:[ne],args:{open:!1,onClose:ae(),children:i.jsx(oe,{}),dataset:{testid:"dialog"}},play:async({canvas:e,step:t})=>{await t("Open dialog",async()=>{const o=e.getByTestId("trigger");return await l.click(o),d(()=>{r(e.getByTestId("dialog")).toBeVisible()})})}},p={tags:["!autodocs"],args:{size:"xs",title:"Extra Small Dialog"}},u={tags:["!autodocs"],args:{size:"sm",title:"Small Dialog"}},y={tags:["!autodocs"],args:{size:"md",title:"Medium Dialog"}},m={tags:["!autodocs"],args:{size:"lg",title:"Large Dialog"}},g={tags:["!autodocs"],args:{size:{_:"lg","wide-s":"xs"},title:"Width Responsiveness",description:"Change the window width to see the Dialog width respond to it"}},w={tags:["!autodocs"],args:{title:"Test Close Overlay"},play:async e=>{var s;await((s=a.play)==null?void 0:s.call(a,e));const{canvas:t,step:o,args:n}=e;await o("Close dialog by clicking overlay",async()=>{const c=t.getByTestId("dialog-overlay");return await l.click(c),d(async()=>(await r(t.queryByTestId("dialog")).not.toBeInTheDocument(),r(n.onClose).toHaveBeenCalledOnce()))})}},B={tags:["!autodocs"],args:{title:"Test Close Focus"},play:async e=>{var s;await((s=a.play)==null?void 0:s.call(a,e));const{canvas:t,step:o,args:n}=e;await o("Close dialog by pressing space",async()=>(await l.keyboard("{Enter}"),d(async()=>(await r(t.queryByTestId("dialog")).not.toBeInTheDocument(),r(n.onClose).toHaveBeenCalledOnce()))))}},C={tags:["!autodocs"],args:{title:"Test Close Keyboard"},play:async e=>{var s;await((s=a.play)==null?void 0:s.call(a,e));const{canvas:t,step:o,args:n}=e;await o("Close dialog using escape key",async()=>(await l.keyboard("{Escape}"),d(()=>{r(t.queryByTestId("dialog")).not.toBeInTheDocument(),r(n.onClose).toHaveBeenCalledOnce()})))}},T={tags:["!autodocs"],args:{title:"Test Close Button"},play:async e=>{var s;await((s=a.play)==null?void 0:s.call(a,e));const{canvas:t,step:o,args:n}=e;await o("Close dialog using close button",async()=>{const c=await t.findByLabelText("Close");return await l.click(c),d(async()=>(await r(t.queryByTestId("dialog")).not.toBeInTheDocument(),r(n.onClose).toHaveBeenCalledOnce()))})}},v={tags:["!autodocs"],args:{title:"Test Close Button"},play:async e=>{var n;await((n=a.play)==null?void 0:n.call(a,e));const{canvas:t,step:o}=e;await o("Close dialog using close button",async()=>{const s=await t.findByTestId("dialog-close");return await l.click(s),d(async()=>{await r(t.queryByTestId("dialog")).not.toBeInTheDocument()})})}};var h,D,I;p.parameters={...p.parameters,docs:{...(h=p.parameters)==null?void 0:h.docs,source:{originalSource:`{
|
|
2
|
+
tags: ['!autodocs'],
|
|
3
|
+
args: {
|
|
4
|
+
size: 'xs',
|
|
5
|
+
title: 'Extra Small Dialog'
|
|
6
|
+
}
|
|
7
|
+
}`,...(I=(D=p.parameters)==null?void 0:D.docs)==null?void 0:I.source}}};var b,S,f;u.parameters={...u.parameters,docs:{...(b=u.parameters)==null?void 0:b.docs,source:{originalSource:`{
|
|
8
|
+
tags: ['!autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
size: 'sm',
|
|
11
|
+
title: 'Small Dialog'
|
|
12
|
+
}
|
|
13
|
+
}`,...(f=(S=u.parameters)==null?void 0:S.docs)==null?void 0:f.source}}};var O,k,E;y.parameters={...y.parameters,docs:{...(O=y.parameters)==null?void 0:O.docs,source:{originalSource:`{
|
|
14
|
+
tags: ['!autodocs'],
|
|
15
|
+
args: {
|
|
16
|
+
size: 'md',
|
|
17
|
+
title: 'Medium Dialog'
|
|
18
|
+
}
|
|
19
|
+
}`,...(E=(k=y.parameters)==null?void 0:k.docs)==null?void 0:E.source}}};var z,F,_;m.parameters={...m.parameters,docs:{...(z=m.parameters)==null?void 0:z.docs,source:{originalSource:`{
|
|
20
|
+
tags: ['!autodocs'],
|
|
21
|
+
args: {
|
|
22
|
+
size: 'lg',
|
|
23
|
+
title: 'Large Dialog'
|
|
24
|
+
}
|
|
25
|
+
}`,...(_=(F=m.parameters)==null?void 0:F.docs)==null?void 0:_.source}}};var q,j,H,L,R;g.parameters={...g.parameters,docs:{...(q=g.parameters)==null?void 0:q.docs,source:{originalSource:`{
|
|
26
|
+
tags: ['!autodocs'],
|
|
27
|
+
args: {
|
|
28
|
+
size: {
|
|
29
|
+
_: 'lg',
|
|
30
|
+
'wide-s': 'xs'
|
|
31
|
+
},
|
|
32
|
+
title: 'Width Responsiveness',
|
|
33
|
+
description: 'Change the window width to see the Dialog width respond to it'
|
|
34
|
+
}
|
|
35
|
+
}`,...(H=(j=g.parameters)==null?void 0:j.docs)==null?void 0:H.source},description:{story:`The Dialog component adapts to different screen sizes through responsive size props.
|
|
36
|
+
Use an object with breakpoints as keys to specify different sizes at different viewport widths:
|
|
37
|
+
|
|
38
|
+
\`\`\`tsx
|
|
39
|
+
<Dialog
|
|
40
|
+
size={{
|
|
41
|
+
_: 'lg',
|
|
42
|
+
'wide-s': 'xs',
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
\`\`\``,...(R=(L=g.parameters)==null?void 0:L.docs)==null?void 0:R.description}}};var K,M,W;w.parameters={...w.parameters,docs:{...(K=w.parameters)==null?void 0:K.docs,source:{originalSource:`{
|
|
46
|
+
tags: ['!autodocs'],
|
|
47
|
+
args: {
|
|
48
|
+
title: 'Test Close Overlay'
|
|
49
|
+
},
|
|
50
|
+
play: async ctx => {
|
|
51
|
+
await meta.play?.(ctx);
|
|
52
|
+
const {
|
|
53
|
+
canvas,
|
|
54
|
+
step,
|
|
55
|
+
args
|
|
56
|
+
} = ctx;
|
|
57
|
+
await step('Close dialog by clicking overlay', async () => {
|
|
58
|
+
const overlay = canvas.getByTestId('dialog-overlay');
|
|
59
|
+
await userEvent.click(overlay);
|
|
60
|
+
return waitFor(async () => {
|
|
61
|
+
await expect(canvas.queryByTestId('dialog')).not.toBeInTheDocument();
|
|
62
|
+
return expect(args.onClose).toHaveBeenCalledOnce();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}`,...(W=(M=w.parameters)==null?void 0:M.docs)==null?void 0:W.source}}};var U,P,V;B.parameters={...B.parameters,docs:{...(U=B.parameters)==null?void 0:U.docs,source:{originalSource:`{
|
|
67
|
+
tags: ['!autodocs'],
|
|
68
|
+
args: {
|
|
69
|
+
title: 'Test Close Focus'
|
|
70
|
+
},
|
|
71
|
+
play: async ctx => {
|
|
72
|
+
await meta.play?.(ctx);
|
|
73
|
+
const {
|
|
74
|
+
canvas,
|
|
75
|
+
step,
|
|
76
|
+
args
|
|
77
|
+
} = ctx;
|
|
78
|
+
await step('Close dialog by pressing space', async () => {
|
|
79
|
+
await userEvent.keyboard('{Enter}');
|
|
80
|
+
return waitFor(async () => {
|
|
81
|
+
await expect(canvas.queryByTestId('dialog')).not.toBeInTheDocument();
|
|
82
|
+
return expect(args.onClose).toHaveBeenCalledOnce();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}`,...(V=(P=B.parameters)==null?void 0:P.docs)==null?void 0:V.source}}};var Y,A,G;C.parameters={...C.parameters,docs:{...(Y=C.parameters)==null?void 0:Y.docs,source:{originalSource:`{
|
|
87
|
+
tags: ['!autodocs'],
|
|
88
|
+
args: {
|
|
89
|
+
title: 'Test Close Keyboard'
|
|
90
|
+
},
|
|
91
|
+
play: async ctx => {
|
|
92
|
+
await meta.play?.(ctx);
|
|
93
|
+
const {
|
|
94
|
+
canvas,
|
|
95
|
+
step,
|
|
96
|
+
args
|
|
97
|
+
} = ctx;
|
|
98
|
+
await step('Close dialog using escape key', async () => {
|
|
99
|
+
await userEvent.keyboard('{Escape}');
|
|
100
|
+
return waitFor(() => {
|
|
101
|
+
expect(canvas.queryByTestId('dialog')).not.toBeInTheDocument();
|
|
102
|
+
expect(args.onClose).toHaveBeenCalledOnce();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}`,...(G=(A=C.parameters)==null?void 0:A.docs)==null?void 0:G.source}}};var J,N,Q;T.parameters={...T.parameters,docs:{...(J=T.parameters)==null?void 0:J.docs,source:{originalSource:`{
|
|
107
|
+
tags: ['!autodocs'],
|
|
108
|
+
args: {
|
|
109
|
+
title: 'Test Close Button'
|
|
110
|
+
},
|
|
111
|
+
play: async ctx => {
|
|
112
|
+
await meta.play?.(ctx);
|
|
113
|
+
const {
|
|
114
|
+
canvas,
|
|
115
|
+
step,
|
|
116
|
+
args
|
|
117
|
+
} = ctx;
|
|
118
|
+
await step('Close dialog using close button', async () => {
|
|
119
|
+
const closeButton = await canvas.findByLabelText('Close');
|
|
120
|
+
await userEvent.click(closeButton);
|
|
121
|
+
return waitFor(async () => {
|
|
122
|
+
await expect(canvas.queryByTestId('dialog')).not.toBeInTheDocument();
|
|
123
|
+
return expect(args.onClose).toHaveBeenCalledOnce();
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}`,...(Q=(N=T.parameters)==null?void 0:N.docs)==null?void 0:Q.source}}};var X,Z,$;v.parameters={...v.parameters,docs:{...(X=v.parameters)==null?void 0:X.docs,source:{originalSource:`{
|
|
128
|
+
tags: ['!autodocs'],
|
|
129
|
+
args: {
|
|
130
|
+
title: 'Test Close Button'
|
|
131
|
+
},
|
|
132
|
+
play: async ctx => {
|
|
133
|
+
await meta.play?.(ctx);
|
|
134
|
+
const {
|
|
135
|
+
canvas,
|
|
136
|
+
step
|
|
137
|
+
} = ctx;
|
|
138
|
+
await step('Close dialog using close button', async () => {
|
|
139
|
+
const closeButton = await canvas.findByTestId('dialog-close');
|
|
140
|
+
await userEvent.click(closeButton);
|
|
141
|
+
return waitFor(async () => {
|
|
142
|
+
await expect(canvas.queryByTestId('dialog')).not.toBeInTheDocument();
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}`,...($=(Z=v.parameters)==null?void 0:Z.docs)==null?void 0:$.source}}};const be=["ExtraSmall","Small","Medium","Large","WidthResponsiveness","TestCloseOverlay","TestCloseFocus","TestCloseKeyboard","TestCloseButton","TestCloseButtonTestId"];export{p as ExtraSmall,m as Large,y as Medium,u as Small,T as TestCloseButton,v as TestCloseButtonTestId,B as TestCloseFocus,C as TestCloseKeyboard,w as TestCloseOverlay,g as WidthResponsiveness,be as __namedExportsOrder,a as default};
|