@preply/ds-docs 11.2.0 → 11.3.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/.storybook/main.ts +1 -3
- package/dist/assets/{00.LayoutFlex.stories-CZeeSnID.js → 00.LayoutFlex.stories-oDygdYoI.js} +1 -1
- package/dist/assets/{00.applications-D-6PcdWy.js → 00.applications-CYsULPew.js} +1 -1
- package/dist/assets/{00.favicons.guide-BOqZ5Z1x.js → 00.favicons.guide-CH6Gi2mg.js} +1 -1
- package/dist/assets/{00.token-explorer-Bk0wBfni.js → 00.token-explorer-C_Go53CA.js} +1 -1
- package/dist/assets/{00.using-responsive-props-BsEiJlqE.js → 00.using-responsive-props-JIrga6ab.js} +1 -1
- package/dist/assets/{01.semantic-tokens-DElwA412.js → 01.semantic-tokens-3BaDr39t.js} +1 -1
- package/dist/assets/{01.using-shorthand-props-Bg-Oi5_v.js → 01.using-shorthand-props-BXu4Nck4.js} +1 -1
- package/dist/assets/10.Combinations.stories-SaJOx9D-.js +128 -0
- package/dist/assets/{10.fonts.guide-CHasKWis.js → 10.fonts.guide-DkOyZCNQ.js} +1 -1
- package/dist/assets/{10.ssr-DpNJW1W0.js → 10.ssr-D-0bM4ee.js} +1 -1
- package/dist/assets/{11.fonts.explorer-CTqkQ8Jk.js → 11.fonts.explorer-D6KIcb2q.js} +1 -1
- package/dist/assets/{11.ssr.app-router-FQQ4sEjM.js → 11.ssr.app-router-DWtYqFlx.js} +1 -1
- package/dist/assets/{20.libraries-BTCk2DJX.js → 20.libraries-BlqbfWjy.js} +1 -1
- package/dist/assets/{2025-q4-ds-cleanup-BRN8Tdfv.js → 2025-q4-ds-cleanup-BUrvo7oQ.js} +1 -1
- package/dist/assets/30.icons.explorer-BKujlrNJ.js +72 -0
- package/dist/assets/{30.storybook-DKSi7vdi.js → 30.storybook-CNvYWdc7.js} +1 -1
- package/dist/assets/{40.illustrations.explorer-CGBqfl2k.js → 40.illustrations.explorer-CAYAdo7r.js} +1 -1
- package/dist/assets/{60.components-6MJdvrRn.js → 60.components-odtQau37.js} +1 -1
- package/dist/assets/{90.advanced-B9pO5FKL.js → 90.advanced-nCsVunZT.js} +1 -1
- package/dist/assets/Accordion-D95NvT0Z.css +1 -0
- package/dist/assets/Accordion-grHCnfbZ.js +21 -0
- package/dist/assets/{Accordion.stories-B7zpGc3N.js → Accordion.stories-CTbvRFnt.js} +10 -3
- package/dist/assets/{Accordion.tests.stories-TuJItmwi.js → Accordion.tests.stories-B6g6Kr6m.js} +17 -10
- package/dist/assets/{AlertBanner.primitives.stories-C0FNaxJR.js → AlertBanner.primitives.stories-D4-bo1JS.js} +1 -1
- package/dist/assets/{AlertBanner.stories-BeZGLz-f.js → AlertBanner.stories-BrNGGvfj.js} +1 -1
- package/dist/assets/AlertBannerAction-DvbUWtiW.js +127 -0
- package/dist/assets/{AlertDialog-Dk5PtknG.js → AlertDialog-Da2sPT1D.js} +1 -1
- package/dist/assets/{AlertDialog.stories-CwxQZyTF.js → AlertDialog.stories-D7ALUucQ.js} +1 -1
- package/dist/assets/{Avatar.stories-Dp9pDU6q.js → Avatar.stories-BICCl1VI.js} +1 -1
- package/dist/assets/{AvatarWithStatus-Cfv2-J8U.js → AvatarWithStatus-D02yNzQm.js} +3 -3
- package/dist/assets/{AvatarWithStatus.stories-9MJ13xVu.js → AvatarWithStatus.stories-CxBQAt3x.js} +1 -1
- package/dist/assets/{Badge-BPd-gr8r.js → Badge-Ba7-qf6a.js} +2 -2
- package/dist/assets/{Badge.stories-DIgYXyBb.js → Badge.stories-Dzxsvo2o.js} +1 -1
- package/dist/assets/{Box-G2_C7Jeq.js → Box--iQMFWAl.js} +2 -2
- package/dist/assets/{Box.stories-_HS5gmLH.js → Box.stories-D0JGgXyX.js} +1 -1
- package/dist/assets/{BubbleCounter-DNO8aNBu.js → BubbleCounter-C7jrl0BR.js} +1 -1
- package/dist/assets/{BubbleCounter.stories-CyzNA0Bp.js → BubbleCounter.stories-C28ZYRgB.js} +1 -1
- package/dist/assets/Button-DagS5hxP.js +19 -0
- package/dist/assets/{Button.stories-5MZ_eXfn.js → Button.stories-CTvHtk-S.js} +19 -7
- package/dist/assets/{ButtonBase-C22oeCEB.js → ButtonBase-CMR6iWFG.js} +3 -2
- package/dist/assets/{CalloutBanner.stories-RwI1z0sm.js → CalloutBanner.stories-BbHi-g9a.js} +1 -1
- package/dist/assets/CalloutBannerText-DP2O2LqI.js +28 -0
- package/dist/assets/Checkbox-BV4Be-fH.js +7 -0
- package/dist/assets/{Checkbox-B_qY1TUo.css → Checkbox-DIfWwwEC.css} +1 -1
- package/dist/assets/{Checkbox.stories-CQsCp6Jy.js → Checkbox.stories-BWfWlkM3.js} +8 -8
- package/dist/assets/{Checkbox.tests.stories-05uWFXz_.js → Checkbox.tests.stories-iLD_cClo.js} +1 -1
- package/dist/assets/{Chips.stories-DSuVc2t5.js → Chips.stories-BikTAQab.js} +1 -1
- package/dist/assets/{Color-6BZIO3FS-CMeY9l9b.js → Color-6BZIO3FS-BqH2EFjf.js} +1 -1
- package/dist/assets/{ComposingDialogs.stories-DM7_H9s_.js → ComposingDialogs.stories-ei_TWBhw.js} +1 -1
- package/dist/assets/{ComposingPopovers.stories-BfWmolPD.js → ComposingPopovers.stories-DEmACL7_.js} +1 -1
- package/dist/assets/CountryFlag-DXTijnBa.js +3 -0
- package/dist/assets/{CountryFlag.stories-BbEBSjOp.js → CountryFlag.stories-r9szKDdv.js} +1 -1
- package/dist/assets/{CountryFlag.test.stories-BEKGdJSA.js → CountryFlag.test.stories-DS8v3a4U.js} +1 -1
- package/dist/assets/{Dialog-CGhOTWSt.js → Dialog-a74MpEoC.js} +2 -2
- package/dist/assets/{Dialog.primitives.stories-B-OAqhJT.js → Dialog.primitives.stories-CkKykon1.js} +1 -1
- package/dist/assets/{Dialog.stories-B6xtR1zI.js → Dialog.stories-CoTCFYpz.js} +18 -5
- package/dist/assets/{Dialog.test.stories-9Ct6h0zZ.js → Dialog.test.stories-aF_5M6-z.js} +1 -1
- package/dist/assets/DialogActions-BsCqS7W7.js +9 -0
- package/dist/assets/DialogCloseButton-Df1XDsMW.js +12 -0
- package/dist/assets/DismissibleChips-QUmF1DlO.js +1 -0
- package/dist/assets/{DismissibleChips.stories-vx1F9ELx.js → DismissibleChips.stories-BbLkTYXP.js} +17 -6
- package/dist/assets/{Divider.stories-CMbQ5L3q.js → Divider.stories-r49aSANX.js} +1 -1
- package/dist/assets/{DocsRenderer-LL677BLK-D6wCD5Bw.js → DocsRenderer-LL677BLK-D55zMWRu.js} +1 -1
- package/dist/assets/DropdownMenu-CEFQwkft.js +142 -0
- package/dist/assets/{DropdownMenu.stories-DC585dGe.js → DropdownMenu.stories-Bwd2yU64.js} +1 -1
- package/dist/assets/{FieldButton-DjbyU7Ud.js → FieldButton-SkKd22gq.js} +1 -1
- package/dist/assets/{FieldButton.stories-mgMXy6g8.js → FieldButton.stories-CeUnTuE8.js} +1 -1
- package/dist/assets/{FormControl-N0zmQNS2.js → FormControl-C_Mh5dfi.js} +1 -1
- package/dist/assets/{FormControl-DX3yRMc2.css → FormControl-C_byGyqD.css} +1 -1
- package/dist/assets/{FormControl.stories-B8Ne0MLq.js → FormControl.stories-Bs2ISm2I.js} +4 -4
- package/dist/assets/{Heading-Bmekm9VQ.js → Heading-Xmy4HTvU.js} +1 -1
- package/dist/assets/{Heading.stories-Bkr_umIZ.js → Heading.stories-6Dgn_J8U.js} +1 -1
- package/dist/assets/{Icon-DwVTLcDP.js → Icon-C-oDFSRH.js} +1 -1
- package/dist/assets/{Icon-RSC-Dn9e0iAh.js → Icon-RSC-Ch-QtBFc.js} +1 -1
- package/dist/assets/{Icon.stories-D9JEL0Hx.js → Icon.stories-DA2UaTGv.js} +1 -1
- package/dist/assets/IconButton-Qo4r7KAR.js +9 -0
- package/dist/assets/{IconTile.stories-B5GBHpUh.js → IconTile.stories-C4MpGbZs.js} +1 -1
- package/dist/assets/Input-D6_jI5Uh.js +3 -0
- package/dist/assets/{IntegrationWithReactHookForm.stories-CCDlaJxi.js → IntegrationWithReactHookForm.stories-6kdmvmQr.js} +1 -1
- package/dist/assets/IntlFormattedAggregatedDateTime-Ai802ecy.js +1 -0
- package/dist/assets/IntlFormattedCurrency-DUrW8wq9.js +1 -0
- package/dist/assets/{IntlFormattedCurrency.stories-BuMkiJd6.js → IntlFormattedCurrency.stories-DFdfoYCv.js} +1 -1
- package/dist/assets/{IntlFormattedDateTime.stories-DMN58d8q.js → IntlFormattedDateTime.stories-CHRJCN68.js} +1 -1
- package/dist/assets/IntlFormattedTime-BOUEN1XF.js +2 -0
- package/dist/assets/{LayoutFlex-CEr_Bd5T.js → LayoutFlex-CpktYRVX.js} +1 -1
- package/dist/assets/{LayoutFlexItem-DCUGpEDU.js → LayoutFlexItem-Dvv_cK8l.js} +1 -1
- package/dist/assets/{LayoutGrid-DCLStsDr.js → LayoutGrid-DvHLpq-e.js} +1 -1
- package/dist/assets/{LayoutGrid.stories-DaY7nZ2z.js → LayoutGrid.stories-DCTuVuVw.js} +1 -1
- package/dist/assets/{LayoutGridItem-BRLJDeYd.js → LayoutGridItem-n0bW9yG3.js} +1 -1
- package/dist/assets/Link-Cu3kBnvE.css +1 -0
- package/dist/assets/Link-DLL8OonN.js +5 -0
- package/dist/assets/{Link.stories-kXGLhYoc.js → Link.stories-D_FvQngK.js} +43 -15
- package/dist/assets/{Loader-qd0Q5Uz_.js → Loader-raMoSfHx.js} +1 -1
- package/dist/assets/{Loader.stories-m379tb7j.js → Loader.stories-7tG1NS7B.js} +1 -1
- package/dist/assets/MultiSelectChips-DSeV2AIy.js +2 -0
- package/dist/assets/{MultiSelectChips.stories-DfyHnHHY.js → MultiSelectChips.stories-CKax5hXL.js} +27 -8
- package/dist/assets/NativeSelectField.stories-D3-RNzbp.js +249 -0
- package/dist/assets/NumberField-CNBfsJCY.js +6 -0
- package/dist/assets/{NumberField.stories-BUxd-7gq.js → NumberField.stories-CHVQ_b9k.js} +1 -1
- package/dist/assets/{ObserveIntersection-ClJrn-sk.js → ObserveIntersection-CR4IhuYz.js} +1 -1
- package/dist/assets/{ObserveIntersection.stories-CisY8E_w.js → ObserveIntersection.stories-D1FkxcMY.js} +1 -1
- package/dist/assets/{OnboardingTooltip-DkrwDHv3.js → OnboardingTooltip-BNwId6Jx.js} +3 -3
- package/dist/assets/{OnboardingTooltip.stories-DDVYxEt5.js → OnboardingTooltip.stories-npBmAhu4.js} +1 -1
- package/dist/assets/{OnboardingTooltip.tests.stories-BVUaM-wO.js → OnboardingTooltip.tests.stories-oxLHDwgd.js} +1 -1
- package/dist/assets/{OnboardingTour-CGa-836f.js → OnboardingTour-RWyquFZd.js} +1 -1
- package/dist/assets/{OnboardingTour.stories-yLGZ0dlp.js → OnboardingTour.stories-CsdqirC3.js} +1 -1
- package/dist/assets/{OnboardingTour.tests.stories-DxxzBEuR.js → OnboardingTour.tests.stories-DkBfD2kH.js} +1 -1
- package/dist/assets/PasswordField-B2PnHIH1.js +6 -0
- package/dist/assets/{PasswordField.stories-CBcIKnYx.js → PasswordField.stories-CcnDrvIB.js} +1 -1
- package/dist/assets/{PreplyLogo-BzNZ8wpS.js → PreplyLogo-EsNyTV4m.js} +2 -2
- package/dist/assets/{PreplyLogo.stories-8kPZdvbV.js → PreplyLogo.stories-Bm6-o3h8.js} +10 -2
- package/dist/assets/{ProgressBar.stories-BD3OKmoy.js → ProgressBar.stories-DtKBuyeU.js} +1 -1
- package/dist/assets/{ProgressSteps.stories-Bb7wnDFB.js → ProgressSteps.stories-CCDOfqG3.js} +1 -1
- package/dist/assets/{PromoDialog-Bx4wrVnI.js → PromoDialog-CdaXJHkH.js} +1 -1
- package/dist/assets/{RangeSlider-gznGiBxe.js → RangeSlider-Eo2dw_WW.js} +2 -2
- package/dist/assets/{RangeSlider.stories-Bj82Tme8.js → RangeSlider.stories-DAd-xGsP.js} +1 -1
- package/dist/assets/{Rating-CDQpKKfm.js → Rating-CAaFjEvZ.js} +1 -1
- package/dist/assets/{Rating.stories-440yo9nU.js → Rating.stories-8F2e8UDj.js} +1 -1
- package/dist/assets/{RatingInput-S42sTjma.js → RatingInput-BNKHainW.js} +2 -2
- package/dist/assets/{RatingInput.stories-BJ91kNqc.js → RatingInput.stories-0bwrwiHs.js} +20 -6
- package/dist/assets/{SelectField-C9fy_QpQ.css → SelectField-hr5YRqjg.css} +1 -1
- package/dist/assets/SelectField-qBhGOYdK.js +7 -0
- package/dist/assets/{SelectField.stories-CDA-sJca.js → SelectField.stories-Iz2YZ_Bs.js} +1 -1
- package/dist/assets/{ShowOnIntersection-BIc8Ks2O.js → ShowOnIntersection-BMR5nazA.js} +2 -2
- package/dist/assets/{ShowOnIntersection.stories-COT8LZNV.js → ShowOnIntersection.stories-CSSgxbfv.js} +1 -1
- package/dist/assets/SingleSelectChips-CFj7aR84.js +2 -0
- package/dist/assets/{SingleSelectChips.stories-D96yFWLY.js → SingleSelectChips.stories-CJ3zaafZ.js} +27 -8
- package/dist/assets/{Slider-cjoP1Fs6.js → Slider-Bxzp79ts.js} +2 -2
- package/dist/assets/{Slider.stories-zcp8qoUB.js → Slider.stories-C872-jZV.js} +1 -1
- package/dist/assets/{Spinner-DGdYqKak.js → Spinner-B-14zfoF.js} +1 -1
- package/dist/assets/{Stars-C54j1o92.js → Stars-BU2A8ygV.js} +1 -1
- package/dist/assets/{Stars-DRmASRCW.css → Stars-BqHYDCKx.css} +1 -1
- package/dist/assets/{Steps-B9DWysMC.js → Steps-CNOQ424q.js} +1 -1
- package/dist/assets/{Steps.stories-_6S1E6ef.js → Steps.stories-GHgF9EAg.js} +1 -1
- package/dist/assets/{Switch-CpclSBFz.js → Switch-DyKTsO1c.js} +1 -1
- package/dist/assets/{Switch.stories-BJ_jGNoM.js → Switch.stories-Dz3BYhCT.js} +1 -1
- package/dist/assets/{Text-B288uCKD.js → Text-Bj49UVGS.js} +1 -1
- package/dist/assets/{Text.stories-C8gR83BJ.js → Text.stories-DjSvZaCW.js} +1 -1
- package/dist/assets/TextField-B4F8szIu.js +6 -0
- package/dist/assets/{TextField.stories-kWIuQbVk.js → TextField.stories-ZNn7FBmC.js} +1 -1
- package/dist/assets/{TextHighlighted-D0RJV5JS.js → TextHighlighted-DPLkdIhv.js} +1 -1
- package/dist/assets/{TextHighlighted.stories-3U6i5jBR.js → TextHighlighted.stories-CEPLsjw4.js} +1 -1
- package/dist/assets/{TextInline-CKVi4m4-.js → TextInline-DVOlWF4R.js} +1 -1
- package/dist/assets/{TextInline.stories-BOaBqgcv.js → TextInline.stories-DVE70fjR.js} +1 -1
- package/dist/assets/TextareaField-G733luKs.js +6 -0
- package/dist/assets/{TextareaField.stories-d5yoJlrM.js → TextareaField.stories-Bqzxd-3e.js} +1 -1
- package/dist/assets/{Toast-IjHsw63R.js → Toast-CTlQ5Kx4.js} +1 -1
- package/dist/assets/{Toast.stories-1KDAj2_0.js → Toast.stories-DcPkMFFv.js} +1 -1
- package/dist/assets/{Tooltip-DGa6B2Md.js → Tooltip-DCzQmBi_.js} +2 -2
- package/dist/assets/Tooltip.stories-duE4AOVl.js +91 -0
- package/dist/assets/{Tooltip.tests.stories-CRehoOBJ.js → Tooltip.tests.stories-BsQ0I33Q.js} +1 -1
- package/dist/assets/{ai-integration-Cs38H8gd.js → ai-integration-CUld8nBB.js} +1 -1
- package/dist/assets/{breakpoints-CvEPhO_a.js → breakpoints-CDLTCEqT.js} +1 -1
- package/dist/assets/{breakpoints-CdgVhtfb.js → breakpoints-D3C_qtqX.js} +1 -1
- package/dist/assets/{breakpoints-QD8InWGt.js → breakpoints-DyVmNUf9.js} +1 -1
- package/dist/assets/{changelog-DF2IN9rv.js → changelog-CY7pOlLk.js} +27 -1
- package/dist/assets/{constants-DZ53IKPx.js → constants-Ce2rgJrk.js} +7 -7
- package/dist/assets/{createRequiredContext-rvejDfGq.css → createRequiredContext-Dp6R3H4g.css} +1 -1
- package/dist/assets/createRequiredContext-dSBuii-4.js +11 -0
- package/dist/assets/{dist-C0mWr2n-.css → dist-CKzY_Ph_.css} +1 -1
- package/dist/assets/{dist-Czl5bXKQ.js → dist-nghRgjCb.js} +1 -1
- package/dist/assets/{esm-CwnA5ofl.js → esm-BYGpffIq.js} +1 -1
- package/dist/assets/{fonts-explorer.stories-qeCxz5m7.js → fonts-explorer.stories-DpO5HxZ3.js} +1 -1
- package/dist/assets/{getTokenVar-B1giJATd.js → getTokenVar-DG0TGXYc.js} +1 -1
- package/dist/assets/{gradientBorders-Cm8R3nbh.js → gradientBorders-C2jt5p-C.js} +1 -1
- package/dist/assets/{hover-CvX1r1hU.js → hover-BCzGbPFV.js} +1 -1
- package/dist/assets/{hover-_bHqheK2.js → hover-D6mzisaD.js} +1 -1
- package/dist/assets/{hover-BDYlYavU.js → hover-DfbppVmU.js} +1 -1
- package/dist/assets/{iframe-Ddp8AsMq.js → iframe-kBDSpxRI.js} +196 -196
- package/dist/assets/{intro-BzGH4Z_0.js → intro-DQpyhoTG.js} +1 -1
- package/dist/assets/{layout-relative-DXMXPMmM.js → layout-relative-BOsTfett.js} +1 -1
- package/dist/assets/{migrating-from-less-C2EXSVYH.js → migrating-from-less-V1oeKlSf.js} +1 -1
- package/dist/assets/{styled-components.browser.esm-48-sXnz9.js → styled-components.browser.esm-BF2I7YPU.js} +1 -1
- package/dist/assets/{styled-components.browser.esm-qDVQO-j_.js → styled-components.browser.esm-C-pLV-H4.js} +1 -1
- package/dist/assets/{tokens-BCTbazjg.js → tokens-Bw3658eU.js} +1 -1
- package/dist/assets/{tokens-CuiP8hOR.js → tokens-D1eOr0iV.js} +1 -1
- package/dist/assets/{tokens-Be7KYpgq.js → tokens-Yf07x_wA.js} +1 -1
- package/dist/assets/{useControllableState-DQx2v_AU.js → useControllableState-B6dCOM10.js} +1 -1
- package/dist/assets/{usePortalElement-D7u5urLa.js → usePortalElement-CzAPYwMj.js} +1 -1
- package/dist/assets/{welcome-Cj1ZSZQe.js → welcome-CCU104Dv.js} +1 -1
- package/dist/assets/{zeroheight-d0Ov-C_Q.js → zeroheight-I34niHYD.js} +1 -1
- package/dist/iframe.html +1 -1
- package/dist/index.html +6 -2
- package/dist/index.json +1 -1
- package/dist/preview-stats.json +13652 -13601
- package/dist/project.json +1 -1
- package/dist/sb-addons/pseudo-states-6/manager-bundle.js +3 -0
- package/package.json +6 -5
- package/pages/30.guides/70.assets/components/IllustrationsList.tsx +1 -0
- package/pages/30.guides/70.assets/constants/icon-imports.ts +2 -0
- package/dist/assets/10.Combinations.stories-CJFPYaPG.js +0 -128
- package/dist/assets/30.icons.explorer-J8Rr_F6c.js +0 -72
- package/dist/assets/Accordion-BVDqu0gO.js +0 -25
- package/dist/assets/Accordion-bbEcwV1l.css +0 -1
- package/dist/assets/AlertBannerAction-Ul2Z9Ycf.js +0 -216
- package/dist/assets/Button-a57MCiDO.js +0 -18
- package/dist/assets/CalloutBannerText-DJ3eTwo4.js +0 -75
- package/dist/assets/Checkbox-Bchk1blw.js +0 -10
- package/dist/assets/CountryFlag-Coh5YEUl.js +0 -49
- package/dist/assets/DialogActions-BbTn22Uy.js +0 -101
- package/dist/assets/DialogCloseButton-CMOrMiok.js +0 -149
- package/dist/assets/DismissibleChips-Dc4tbb9S.js +0 -1
- package/dist/assets/DropdownMenu-C_t43Tvd.js +0 -1258
- package/dist/assets/IconButton-D218WESp.js +0 -8
- package/dist/assets/Input-XupGAuRo.js +0 -95
- package/dist/assets/IntlFormattedAggregatedDateTime-9V1gJxcg.js +0 -379
- package/dist/assets/IntlFormattedCurrency-loMkSk5h.js +0 -505
- package/dist/assets/IntlFormattedTime-DykXrEe3.js +0 -2900
- package/dist/assets/Link-D75aReRI.js +0 -5
- package/dist/assets/Link-DZ7eineG.css +0 -1
- package/dist/assets/MultiSelectChips-HRY_a-9f.js +0 -2
- package/dist/assets/NativeSelectField.stories-DFN4NN7z.js +0 -295
- package/dist/assets/NumberField-BmPC7HUo.js +0 -6
- package/dist/assets/PasswordField-DSRq_bhg.js +0 -6
- package/dist/assets/SelectField-u1424VWi.js +0 -19
- package/dist/assets/SingleSelectChips-BOJ8NDnY.js +0 -2
- package/dist/assets/TextField-Ch_1Y9U9.js +0 -6
- package/dist/assets/TextareaField-FzIH0QHs.js +0 -6
- package/dist/assets/Tooltip.stories-BG331mYm.js +0 -93
- package/dist/assets/createRequiredContext-CfIj7m5a.js +0 -241
- /package/dist/assets/{Avatar-C37O_UDH.js → Avatar-D6oXWjq1.js} +0 -0
- /package/dist/assets/{Divider-By80O4iG.js → Divider-Nv1279vj.js} +0 -0
- /package/dist/assets/{InputContainer-DSGASCBR.js → InputContainer-xfDpQQNl.js} +0 -0
- /package/dist/assets/{ProgressBar-Crf4SgkT.js → ProgressBar-CRitEeQk.js} +0 -0
- /package/dist/assets/{ProgressSteps-Cl7OdN1S.js → ProgressSteps-B2AXEKFJ.js} +0 -0
- /package/dist/assets/{TokyoUIAvailability7LateNight-BKvXBfeB.js → TokyoUIAvailability7LateNight-Bho17X1G.js} +0 -0
- /package/dist/assets/{TokyoUICheck-DAIMkBqJ.js → TokyoUICheck-BxTDosuA.js} +0 -0
- /package/dist/assets/{TokyoUICheckmark-FfHUfu5K.js → TokyoUICheckmark-BgAaFb6V.js} +0 -0
- /package/dist/assets/{TokyoUIChevronRight-DWF5Wc42.js → TokyoUIChevronRight-C__gngF1.js} +0 -0
- /package/dist/assets/{TokyoUIEmojiFrowning-CyL90GhY.js → TokyoUIEmojiFrowning-rSnD4TX2.js} +0 -0
- /package/dist/assets/{TokyoUIErrorWarning-aLVlh8HS.js → TokyoUIErrorWarning-BH93ehx8.js} +0 -0
- /package/dist/assets/{TokyoUIEye-DPcSixPI.js → TokyoUIEye-B3okJSKv.js} +0 -0
- /package/dist/assets/{TokyoUIFav-CdvVuNHN.js → TokyoUIFav-B1g1wYYK.js} +0 -0
- /package/dist/assets/{TokyoUIInfo-BTRd4tvr.js → TokyoUIInfo-CL0Zo7ru.js} +0 -0
- /package/dist/assets/{TokyoUIMessages-DiuUQ-OO.js → TokyoUIMessages-BO3EETWj.js} +0 -0
- /package/dist/assets/{TokyoUISparkle-Ckr14xJ9.js → TokyoUISparkle-5ta_MRge.js} +0 -0
- /package/dist/assets/{TokyoUIStarFilled-BKIQgn1I.js → TokyoUIStarFilled-DiQeedTx.js} +0 -0
- /package/dist/assets/{TokyoUITag-BmP85Jya.js → TokyoUITag-C8mbO1a7.js} +0 -0
- /package/dist/assets/{VisuallyHidden-DjFrTdW3.js → VisuallyHidden-CpMYtDeS.js} +0 -0
- /package/dist/assets/{align-self-CArWUz5E.js → align-self-DPOkDP3u.js} +0 -0
- /package/dist/assets/{emotion-unitless.esm-CznjPqRE.js → emotion-unitless.esm-DCJ5qRdW.js} +0 -0
- /package/dist/assets/{layout-relative.module-BMQDPKP6.js → layout-relative.module-C0ke0xP4.js} +0 -0
- /package/dist/assets/{storybook-utils-Dnw8-7zP.js → storybook-utils-BfrlMSeG.js} +0 -0
- /package/dist/assets/{useBreakpointMatch-D4lYvPbF.js → useBreakpointMatch-CmOkxQJ1.js} +0 -0
- /package/dist/assets/{useStableCallback-DRmyBaAs.js → useStableCallback-BRGKkp0I.js} +0 -0
- /package/dist/sb-addons/{storybook-6 → storybook-7}/manager-bundle.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-
|
|
1
|
+
import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-kBDSpxRI.js";import{r as i}from"./react-B8jdHdWa.js";import{t as a}from"./mdx-react-shim-BUTq3l7l.js";function o(e){let t={a:`a`,code:`code`,h1:`h1`,h2:`h2`,p:`p`,pre:`pre`,...i(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{title:`Guides/Installation/Storybook`}),`
|
|
2
2
|
`,(0,c.jsx)(t.h1,{id:`installation-storybook`,children:`Installation: Storybook`}),`
|
|
3
3
|
`,(0,c.jsxs)(t.p,{children:[`This guide applies to Storybook setups that document Preply components libraries, and assumes you have read and followed the steps outlined in the `,(0,c.jsx)(t.a,{href:`/story/guides-installation-libraries--page`,children:`Installation: Libaries`}),` guide.`]}),`
|
|
4
4
|
`,(0,c.jsx)(t.h2,{id:`packages`,children:`Packages`}),`
|
package/dist/assets/{40.illustrations.explorer-CGBqfl2k.js → 40.illustrations.explorer-CAYAdo7r.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{C as r,Y as i,et as a,t as o,w as s}from"./dist-DtfJeYQK.js";import{t as c}from"./jsx-runtime-C2wGStra.js";import{l,o as u}from"./iframe-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{C as r,Y as i,et as a,t as o,w as s}from"./dist-DtfJeYQK.js";import{t as c}from"./jsx-runtime-C2wGStra.js";import{l,o as u}from"./iframe-kBDSpxRI.js";import{r as d}from"./react-B8jdHdWa.js";import{t as f}from"./mdx-react-shim-BUTq3l7l.js";import{a as p,t as m}from"./dist-nghRgjCb.js";import{r as h,t as g}from"./styled-components.browser.esm-C-pLV-H4.js";var _,v,y,b,x,S=t((()=>{s(),o(),m(),e(n()),h(),_=c(),v=`https://static.preply.com/ds/illustrations/tokyo-ui/airplain.svg,https://static.preply.com/ds/illustrations/tokyo-ui/arrow.svg,https://static.preply.com/ds/illustrations/tokyo-ui/arrows-multiple.svg,https://static.preply.com/ds/illustrations/tokyo-ui/arrows-upwards.svg,https://static.preply.com/ds/illustrations/tokyo-ui/artist.svg,https://static.preply.com/ds/illustrations/tokyo-ui/awesome.svg,https://static.preply.com/ds/illustrations/tokyo-ui/back-to-school.svg,https://static.preply.com/ds/illustrations/tokyo-ui/bar-graph.svg,https://static.preply.com/ds/illustrations/tokyo-ui/bell.svg,https://static.preply.com/ds/illustrations/tokyo-ui/booking-a-lesson.svg,https://static.preply.com/ds/illustrations/tokyo-ui/books.svg,https://static.preply.com/ds/illustrations/tokyo-ui/books-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/books-3.svg,https://static.preply.com/ds/illustrations/tokyo-ui/brain.svg,https://static.preply.com/ds/illustrations/tokyo-ui/browser-permissions-chromium.svg,https://static.preply.com/ds/illustrations/tokyo-ui/browser-permissions-safari.svg,https://static.preply.com/ds/illustrations/tokyo-ui/bubbles.svg,https://static.preply.com/ds/illustrations/tokyo-ui/calendar.svg,https://static.preply.com/ds/illustrations/tokyo-ui/calendar-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/checkmark.svg,https://static.preply.com/ds/illustrations/tokyo-ui/clock.svg,https://static.preply.com/ds/illustrations/tokyo-ui/clock-yellow.svg,https://static.preply.com/ds/illustrations/tokyo-ui/clocks.svg,https://static.preply.com/ds/illustrations/tokyo-ui/coins.svg,https://static.preply.com/ds/illustrations/tokyo-ui/committed.svg,https://static.preply.com/ds/illustrations/tokyo-ui/confetti.svg,https://static.preply.com/ds/illustrations/tokyo-ui/cosmopolite.svg,https://static.preply.com/ds/illustrations/tokyo-ui/desk.svg,https://static.preply.com/ds/illustrations/tokyo-ui/desk-supplies.svg,https://static.preply.com/ds/illustrations/tokyo-ui/discount-badge.svg,https://static.preply.com/ds/illustrations/tokyo-ui/disco-ball.svg,https://static.preply.com/ds/illustrations/tokyo-ui/dog.svg,https://static.preply.com/ds/illustrations/tokyo-ui/first-steps.svg,https://static.preply.com/ds/illustrations/tokyo-ui/game-on.svg,https://static.preply.com/ds/illustrations/tokyo-ui/getting-started-down.svg,https://static.preply.com/ds/illustrations/tokyo-ui/getting-started.svg,https://static.preply.com/ds/illustrations/tokyo-ui/globe-spot.svg,https://static.preply.com/ds/illustrations/tokyo-ui/great-homework.svg,https://static.preply.com/ds/illustrations/tokyo-ui/growth.svg,https://static.preply.com/ds/illustrations/tokyo-ui/guitar.svg,https://static.preply.com/ds/illustrations/tokyo-ui/hard-work-1.svg,https://static.preply.com/ds/illustrations/tokyo-ui/hard-work-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/heart.svg,https://static.preply.com/ds/illustrations/tokyo-ui/it-guru.svg,https://static.preply.com/ds/illustrations/tokyo-ui/lamp-and-books.svg,https://static.preply.com/ds/illustrations/tokyo-ui/language-flash-cards.svg,https://static.preply.com/ds/illustrations/tokyo-ui/laptop.svg,https://static.preply.com/ds/illustrations/tokyo-ui/laptop-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/magnifying-glass.svg,https://static.preply.com/ds/illustrations/tokyo-ui/making-progress.svg,https://static.preply.com/ds/illustrations/tokyo-ui/map.svg,https://static.preply.com/ds/illustrations/tokyo-ui/meeting-with-tutor-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/meeting-with-tutor.svg,https://static.preply.com/ds/illustrations/tokyo-ui/messages.svg,https://static.preply.com/ds/illustrations/tokyo-ui/messaging.svg,https://static.preply.com/ds/illustrations/tokyo-ui/mobile-app.svg,https://static.preply.com/ds/illustrations/tokyo-ui/notes.svg,https://static.preply.com/ds/illustrations/tokyo-ui/open-book.svg,https://static.preply.com/ds/illustrations/tokyo-ui/pause-button.svg,https://static.preply.com/ds/illustrations/tokyo-ui/pencil-and-pen-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/pencil-and-pen.svg,https://static.preply.com/ds/illustrations/tokyo-ui/pig.svg,https://static.preply.com/ds/illustrations/tokyo-ui/play-button.svg,https://static.preply.com/ds/illustrations/tokyo-ui/polyglot-2.svg,https://static.preply.com/ds/illustrations/tokyo-ui/polyglot-pink.svg,https://static.preply.com/ds/illustrations/tokyo-ui/polyglot.svg,https://static.preply.com/ds/illustrations/tokyo-ui/present.svg,https://static.preply.com/ds/illustrations/tokyo-ui/professional.svg,https://static.preply.com/ds/illustrations/tokyo-ui/progress-steps.svg,https://static.preply.com/ds/illustrations/tokyo-ui/quote.svg,https://static.preply.com/ds/illustrations/tokyo-ui/rising-arrows.svg,https://static.preply.com/ds/illustrations/tokyo-ui/rock-on.svg,https://static.preply.com/ds/illustrations/tokyo-ui/routine-master.svg,https://static.preply.com/ds/illustrations/tokyo-ui/serious-learner.svg,https://static.preply.com/ds/illustrations/tokyo-ui/sheet.svg,https://static.preply.com/ds/illustrations/tokyo-ui/smiley.svg,https://static.preply.com/ds/illustrations/tokyo-ui/speech-bubble.svg,https://static.preply.com/ds/illustrations/tokyo-ui/star_coin.svg,https://static.preply.com/ds/illustrations/tokyo-ui/stop-button.svg,https://static.preply.com/ds/illustrations/tokyo-ui/stopwatch.svg,https://static.preply.com/ds/illustrations/tokyo-ui/system-permissions.svg,https://static.preply.com/ds/illustrations/tokyo-ui/testing-the-water.svg,https://static.preply.com/ds/illustrations/tokyo-ui/three-arrows.svg,https://static.preply.com/ds/illustrations/tokyo-ui/thumbs-up.svg,https://static.preply.com/ds/illustrations/tokyo-ui/you-did-great-today.svg,https://static.preply.com/ds/illustrations/tokyo-ui/warning.svg,https://static.preply.com/ds/illustrations/tokyo-ui/flashcards.svg,https://static.preply.com/ds/illustrations/tokyo-ui/abc-dice.svg,https://static.preply.com/ds/illustrations/tokyo-ui/rocket.svg`.split(`,`),y=g.div`
|
|
2
2
|
padding: ${r(a[12])};
|
|
3
3
|
-webkit-background-size: 50px 50px;
|
|
4
4
|
-moz-background-size: 50px 50px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-
|
|
1
|
+
import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-kBDSpxRI.js";import{r as i}from"./react-B8jdHdWa.js";import{t as a}from"./mdx-react-shim-BUTq3l7l.js";function o(e){let t={a:`a`,h1:`h1`,li:`li`,p:`p`,ul:`ul`,...i(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{title:`Guides/Custom Components/Introduction`}),`
|
|
2
2
|
`,(0,c.jsx)(t.h1,{id:`developing-custom-components-with-ds-primitives`,children:`Developing custom components with DS primitives`}),`
|
|
3
3
|
`,(0,c.jsx)(t.p,{children:`The DS provides lower level primitives for building custom components that you can use
|
|
4
4
|
if existing DS components are not enough to implement complex or unique designs.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-
|
|
1
|
+
import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-kBDSpxRI.js";import{r as i}from"./react-B8jdHdWa.js";import{t as a}from"./mdx-react-shim-BUTq3l7l.js";function o(e){let t={a:`a`,code:`code`,h1:`h1`,p:`p`,pre:`pre`,...i(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{title:`Guides/Installation/Advanced`}),`
|
|
2
2
|
`,(0,c.jsx)(t.h1,{id:`installation-advanced`,children:`Installation: Advanced`}),`
|
|
3
3
|
`,(0,c.jsxs)(t.p,{children:[`This page is about rolling out your own alternative to `,(0,c.jsx)(t.code,{children:`<RootProvider/>`}),` (advanced usage).`]}),`
|
|
4
4
|
`,(0,c.jsxs)(t.p,{children:[`If you are looking for how to install, refer to the `,(0,c.jsx)(t.a,{href:`/story/guides-installation-applications--page`,children:`installation guides`}),` instead.`]}),`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.accordion__OKb-C{box-sizing:border-box;min-width:100%}.accordion__OKb-C details{border-bottom:solid 1px var(--c03289)}.accordion__OKb-C details>summary{padding-top:var(--558c4c);padding-bottom:var(--558c4c);padding-right:var(--66b80b);list-style:none}.accordion__OKb-C details summary::-webkit-details-marker{display:none}.accordion__OKb-C details :focus-visible{outline-style:solid;outline-color:var(--603ec6);outline-width:var(--99d31f);outline-offset:var(--c0b12c)}.accordion__OKb-C summary{cursor:pointer;gap:var(--66b80b);display:flex}.accordion__OKb-C summary>[data-preply-ds-component=Text]{flex:1}.accordion__OKb-C summary>[data-preply-ds-component=Icon]{-webkit-user-select:none;user-select:none;transition:transform var(--018058);transform:rotate(0)}.accordion__OKb-C details[open] summary>[data-preply-ds-component=Icon]{transform:rotate(180deg)}.accordion__OKb-C details::details-content{block-size:0;transition-property:block-size,content-visibility,opacity;transition-duration:var(--970975);transition-timing-function:var(--1f4492);transition-behavior:allow-discrete;opacity:0;overflow:hidden}.accordion__OKb-C details[open]::details-content{padding-bottom:var(--813599);block-size:calc-size(auto, size);opacity:1}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i}from"./dist-DtfJeYQK.js";import{t as a}from"./jsx-runtime-C2wGStra.js";import{n as o,t as s}from"./TokyoUIChevronDown-CS0lTt7n.js";import{n as c,t as l}from"./dist-Cc1j9Pjk.js";import{n as u,t as d}from"./Icon-C-oDFSRH.js";import{n as f,t as p}from"./Text-Bj49UVGS.js";import{n as m,t as h}from"./useMergeRefs-BZP37fIn.js";var g,_,v=t((()=>{g=`accordion__OKb-C`,_={accordion:g}}));function y({ref:e,onOpenChange:t}){let n=(0,b.useRef)(null),r=m(n,e);return(0,b.useEffect)(()=>{if(!n.current)return;let e=n.current,r=()=>{t?.(e.open)};return e&&e.addEventListener(`toggle`,r),()=>{e&&e.removeEventListener(`toggle`,r)}},[t]),{mergedRef:t||e?r:null}}var b,x=t((()=>{b=e(n(),1),h()})),S,C,w,T,E,D,O=t((()=>{S=e(n(),1),i(),o(),l(),u(),f(),v(),x(),C=a(),w=({dataset:e,children:t,"aria-label":n})=>(0,C.jsx)(`div`,{className:_.accordion,"aria-label":n,...r(e),"data-preply-ds-component":c.Accordion,children:t}),T=(0,S.forwardRef)(function({open:e,name:t,dataset:n,children:i,onOpenChange:a},o){let{mergedRef:s}=y({ref:o,onOpenChange:a});return(0,C.jsx)(`details`,{ref:s,name:t,open:e,...r(n),children:i})}),E=(0,S.forwardRef)(function({dataset:e,children:t,onClick:n},i){return(0,C.jsxs)(`summary`,{ref:i,...r(e),onClick:n,children:[(0,C.jsx)(p,{variant:`default-semibold`,children:t}),(0,C.jsx)(d,{svg:s})]})}),D=(0,S.forwardRef)(function({dataset:e,children:t},n){return(0,C.jsx)(p,{tag:`div`,variant:`small-regular`,ref:n,...r(e),children:t})});try{w.displayName=`Accordion`,w.__docgenInfo={description:`An Accordion container.
|
|
2
|
+
|
|
3
|
+
Add \`AccordionItem\` children to render a list of disclosable contents.`,displayName:`Accordion`,props:{dataset:{defaultValue:null,description:`Sets data attributes on the DOM element.
|
|
4
|
+
@example <Accordion dataset={{ 'qa-id': 'benefits' }} /> // will add data-qa-id="benefits" to the HTML element.`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}try{T.displayName=`AccordionItem`,T.__docgenInfo={description:"A single `Accordion` item, the wrapper of AccordionHeader and AccordionContent.",displayName:`AccordionItem`,props:{onOpenChange:{defaultValue:null,description:"Called whenever the users open/close the Accordion item (mapped to the internal HTML Details's\n`toggle` event).",name:`onOpenChange`,required:!1,type:{name:`enum`,value:[{value:`(open: boolean) => void`}]}},name:{defaultValue:null,description:`Allows to create exclusive Accordions. Just pass the same \`name\` to all the AccordionItem
|
|
5
|
+
instances to make the whole Accordion exclusive.
|
|
6
|
+
@example <Accordion>
|
|
7
|
+
<AccordionItem name="choose-subscription-duration">
|
|
8
|
+
<AccordionHeader>
|
|
9
|
+
Two-week subscription
|
|
10
|
+
</AccordionHeader>
|
|
11
|
+
<AccordionContent>We will charge you every two weeks.</AccordionContent>
|
|
12
|
+
</AccordionItem>
|
|
13
|
+
<AccordionItem name="choose-subscription-duration">
|
|
14
|
+
<AccordionHeader>
|
|
15
|
+
Four-week subscription
|
|
16
|
+
</AccordionHeader>
|
|
17
|
+
<AccordionContent>We will charge you every four weeks.</AccordionContent>
|
|
18
|
+
</AccordionItem>
|
|
19
|
+
</Accordion>`,name:`name`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},dataset:{defaultValue:null,description:`Sets data attributes on the DOM element.
|
|
20
|
+
@example <AccordionItem dataset={{ 'qa-id': 'best-tutor-platform' }} /> // will add data-qa-id="best-tutor-platform" to the HTML element.`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}try{E.displayName=`AccordionHeader`,E.__docgenInfo={description:"The header of a single `Accordion` item, to be used in conjunction with AccordionItem and wrapped inside AccordionContent.",displayName:`AccordionHeader`,props:{dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}try{D.displayName=`AccordionContent`,D.__docgenInfo={description:"The content of a single `Accordion` item, to be used in conjunction with AccordionHeader wrapped inside AccordionContent.",displayName:`AccordionContent`,props:{dataset:{defaultValue:null,description:`Sets data attributes on the DOM element.
|
|
21
|
+
@example <AccordionItem dataset={{ 'qa-id': 'best-tutor-platform' }} /> // will add data-qa-id="best-tutor-platform" to the HTML element.`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}}));export{O as a,T as i,D as n,E as r,w as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./Text-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./Text-Bj49UVGS.js";import{a as o,i as s,n as c,r as l,t as u}from"./Accordion-grHCnfbZ.js";import{n as d,t as f}from"./Heading-Xmy4HTvU.js";import{n as p,t as m}from"./Button-DagS5hxP.js";var h,g,_,v,y,b,x,S,C;t((()=>{e(n(),1),o(),i(),d(),p(),h=r(),g={title:`components/Accordion`,component:u,args:{}},_={render:function(){return(0,h.jsxs)(u,{children:[(0,h.jsxs)(s,{children:[(0,h.jsx)(l,{children:`Is Preply the best platform for learning a language?`}),(0,h.jsx)(c,{children:`Of course it is!`})]}),(0,h.jsxs)(s,{children:[(0,h.jsx)(l,{children:`Why?`}),(0,h.jsx)(c,{children:`If you are wondering, it means you have not tried it out yet!`})]})]})}},v={render:function(){return(0,h.jsxs)(u,{children:[(0,h.jsxs)(s,{open:!0,children:[(0,h.jsx)(l,{children:`Is Preply the best platform for learning a language?`}),(0,h.jsx)(c,{children:`Of course it is!`})]}),(0,h.jsxs)(s,{open:!0,children:[(0,h.jsx)(l,{children:`Why?`}),(0,h.jsx)(c,{children:`If you are wondering, it means you have not tried it out yet!`})]})]})}},y={render:function(){return(0,h.jsxs)(u,{children:[(0,h.jsxs)(s,{children:[(0,h.jsx)(l,{children:`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`}),(0,h.jsx)(c,{children:`Lorem ipsum`})]}),(0,h.jsxs)(s,{children:[(0,h.jsx)(l,{children:`Lorem ipsum`}),(0,h.jsx)(c,{children:`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`})]}),(0,h.jsxs)(s,{open:!0,children:[(0,h.jsx)(l,{children:`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`}),(0,h.jsx)(c,{children:`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`})]})]})}},b={render:function(){return(0,h.jsx)(u,{children:(0,h.jsxs)(s,{open:!0,children:[(0,h.jsx)(l,{children:`Is Preply the best platform for learning a language?`}),(0,h.jsxs)(c,{children:[(0,h.jsx)(f,{variant:`large`,tag:`div`,children:`Yes!`}),(0,h.jsx)(a,{variant:`large-regular-italic`,children:`What are you waiting for?`}),(0,h.jsx)(m,{children:`Book a lesson now!`})]})]})})}},x={render:function(){return(0,h.jsxs)(u,{children:[(0,h.jsxs)(s,{name:`choose-subscription-duration`,children:[(0,h.jsx)(l,{children:`Two-week subscription`}),(0,h.jsx)(c,{children:`We will charge you every two weeks.`})]}),(0,h.jsxs)(s,{name:`choose-subscription-duration`,children:[(0,h.jsx)(l,{children:`Four-week subscription`}),(0,h.jsx)(c,{children:`We will charge you every four weeks.`})]})]})}},S={parameters:{pseudo:{focusVisible:`[data-focus="true"]`}},render:function(){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{style:{display:`flex`,gap:`16px`,flexDirection:`column`},children:[(0,h.jsx)(a,{variant:`default-regular-italic`,children:`closed`}),(0,h.jsx)(`div`,{style:{display:`flex`,gap:`16px`},children:(0,h.jsx)(u,{children:(0,h.jsxs)(s,{children:[(0,h.jsx)(l,{children:`Header`}),(0,h.jsx)(c,{children:`Content`})]})})})]}),(0,h.jsxs)(`div`,{style:{display:`flex`,gap:`16px`,flexDirection:`column`},children:[(0,h.jsx)(a,{variant:`default-regular-italic`,children:`open`}),(0,h.jsx)(`div`,{style:{display:`flex`,gap:`16px`},children:(0,h.jsx)(u,{children:(0,h.jsxs)(s,{open:!0,children:[(0,h.jsx)(l,{children:`Header`}),(0,h.jsx)(c,{children:`Content`})]})})})]}),(0,h.jsxs)(`div`,{style:{display:`flex`,gap:`16px`,flexDirection:`column`},children:[(0,h.jsx)(a,{variant:`default-regular-italic`,children:`focus`}),(0,h.jsx)(`div`,{style:{display:`flex`,gap:`16px`},children:(0,h.jsx)(u,{children:(0,h.jsxs)(s,{children:[(0,h.jsx)(l,{dataset:{focus:!0},children:`Header`}),(0,h.jsx)(c,{children:`Content`})]})})})]})]})}},_.parameters={..._.parameters,docs:{..._.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
render: function Story() {
|
|
3
3
|
return <Accordion>
|
|
4
4
|
<AccordionItem>
|
|
@@ -116,6 +116,11 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
116
116
|
</Accordion>;
|
|
117
117
|
}
|
|
118
118
|
}`,...x.parameters?.docs?.source}}},S.parameters={...S.parameters,docs:{...S.parameters?.docs,source:{originalSource:`{
|
|
119
|
+
parameters: {
|
|
120
|
+
pseudo: {
|
|
121
|
+
focusVisible: '[data-focus="true"]'
|
|
122
|
+
}
|
|
123
|
+
},
|
|
119
124
|
render: function Story() {
|
|
120
125
|
return <>
|
|
121
126
|
<div style={{
|
|
@@ -165,8 +170,10 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
165
170
|
gap: '16px'
|
|
166
171
|
}}>
|
|
167
172
|
<Accordion>
|
|
168
|
-
<AccordionItem
|
|
169
|
-
<AccordionHeader
|
|
173
|
+
<AccordionItem>
|
|
174
|
+
<AccordionHeader dataset={{
|
|
175
|
+
focus: true
|
|
176
|
+
}}>Header</AccordionHeader>
|
|
170
177
|
<AccordionContent>Content</AccordionContent>
|
|
171
178
|
</AccordionItem>
|
|
172
179
|
</Accordion>
|
package/dist/assets/{Accordion.tests.stories-TuJItmwi.js → Accordion.tests.stories-B6g6Kr6m.js}
RENAMED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{a as i,i as a,n as o,r as s,t as c}from"./Accordion-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{a as i,i as a,n as o,r as s,t as c}from"./Accordion-grHCnfbZ.js";import{n as l,t as u}from"./OnboardingTour-RWyquFZd.js";import{r as d,t as f}from"./styled-components.browser.esm-BF2I7YPU.js";var p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k;t((()=>{e(n(),1),i(),l(),d(),p=r(),{userEvent:m,expect:h,within:g,waitFor:_,fn:v}=__STORYBOOK_MODULE_TEST__,y={title:`Components/Accordion/Tests`,component:c,parameters:{controls:{disable:!0},chromatic:{disableSnapshot:!0}},tags:[`!autodocs`,`!a11y-test`,`test`]},b={render:function(){return(0,p.jsx)(c,{"aria-label":`accordionLabel`,children:(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{children:`Of course it is!`})]})})},play:async({canvasElement:e})=>{h(g(e).getByLabelText(`accordionLabel`)).toBeVisible()}},x={args:{},render:function(){return(0,p.jsxs)(c,{children:[(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{children:`Of course it is!`})]}),(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{children:`Why?`}),(0,p.jsx)(o,{children:`If you are wondering, it means you have not tried it out yet!`})]})]})},play:async({canvas:e,step:t})=>{let n=e.getByText(`Is Preply the best platform for learning a language?`),r=e.getByText(`Of course it is!`),i=e.getByText(`Why?`),a=e.getByText(`If you are wondering, it means you have not tried it out yet!`);await t(`Contents are hidden`,async()=>{h(r).not.toBeVisible(),h(a).not.toBeVisible()}),await t(`Content 1 is revelable`,async()=>{await m.click(n),h(r).toBeVisible()}),await t(`Content 2 is revelable`,async()=>{await m.click(i),h(a).toBeVisible()}),await t(`Both contents are visible (non-exclusivity check)`,async()=>{h(r).toBeVisible(),h(a).toBeVisible()}),await t(`Item 1 is hidable`,async()=>{await m.click(n),h(r).not.toBeVisible()}),await t(`Item 2 is hidable`,async()=>{await m.click(i),h(a).not.toBeVisible()})}},S=f.div`
|
|
2
|
+
details[open]::details-content {
|
|
3
|
+
block-size: initial;
|
|
4
|
+
}
|
|
5
|
+
`,C={args:{},decorators:[e=>(0,p.jsx)(S,{children:(0,p.jsx)(e,{})})],render:function(){return(0,p.jsx)(c,{children:(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{children:`Of course it is!`})]})})},play:async({canvas:e,step:t})=>{let n=e.getByText(`Is Preply the best platform for learning a language?`),r=e.getByText(`Of course it is!`);await t(`Contents are hidden`,async()=>{h(r).not.toBeVisible()}),await t(`Content is revelable`,async()=>{await m.click(n),h(r).toBeVisible()}),await t(`Content is hidable`,async()=>{await m.click(n),h(r).not.toBeVisible()})}},w={args:{},render:function(){return(0,p.jsxs)(c,{children:[(0,p.jsxs)(a,{name:`choose-subscription-duration`,children:[(0,p.jsx)(s,{children:`Two-week subscription`}),(0,p.jsx)(o,{children:`We will charge you every two weeks.`})]}),(0,p.jsxs)(a,{name:`choose-subscription-duration`,children:[(0,p.jsx)(s,{children:`Four-week subscription`}),(0,p.jsx)(o,{children:`We will charge you every four weeks.`})]})]})},play:async({canvas:e,step:t})=>{let n=e.getByText(`Two-week subscription`),r=e.getByText(`We will charge you every two weeks.`),i=e.getByText(`Four-week subscription`),a=e.getByText(`We will charge you every four weeks.`);await t(`Contents are hidden`,async()=>{h(r).not.toBeVisible(),h(a).not.toBeVisible()}),await t(`Content 1 is revelable`,async()=>{await m.click(n),h(r).toBeVisible()}),await t(`Content 2 is revelable`,async()=>{await m.click(i),h(a).toBeVisible()}),await t(`Item 1 is hidden`,async()=>{h(r).not.toBeVisible()})}},T={args:{onOpenChange:v()},render:function(e){return(0,p.jsx)(c,{children:(0,p.jsxs)(a,{onOpenChange:e.onOpenChange,children:[(0,p.jsx)(s,{children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{children:`Of course it is!`})]})})},play:async({canvas:e,args:t,step:n})=>{let r=e.getByText(`Is Preply the best platform for learning a language?`);await n(`onOpenChange is not called`,async()=>{h(t.onOpenChange).not.toBeCalled()}),await n(`onOpenChange is called with true`,async()=>{await m.click(r),h(t.onOpenChange).toBeCalledWith(!0)}),await n(`onOpenChange is called with false`,async()=>{await m.click(r),h(t.onOpenChange).toBeCalledWith(!1)})}},E={args:{onClick:v()},render:function(e){return(0,p.jsx)(c,{children:(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{onClick:e.onClick,children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{children:`Of course it is!`})]})})},play:async({canvas:e,args:t,step:n})=>{let r=e.getByText(`Is Preply the best platform for learning a language?`);await n(`onClick is not called`,async()=>{h(t.onClick).not.toBeCalled()}),await n(`onClick is called`,async()=>{await m.click(r),h(t.onClick).toBeCalled()})}},D={render:function(){return(0,p.jsx)(c,{"aria-label":`accordion`,dataset:{foo:1},children:(0,p.jsxs)(a,{dataset:{"qa-id":`firstItem`},children:[(0,p.jsx)(s,{dataset:{"qa-id":`firstItemHeader`},children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{dataset:{"qa-id":`firstItemContent`},children:`Yes!`})]})})},play:async({canvas:e})=>{h(e.getByLabelText(`accordion`)).toHaveAttribute(`data-foo`,`1`)}},O={render:function(){let e=u();return(0,p.jsx)(e.Provider,{totalSteps:2,children:(0,p.jsxs)(c,{children:[(0,p.jsx)(e.Step,{step:0,title:`Step 1`,text:`Ensure you can answer this question`,children:(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{children:`Is Preply the best platform for learning a language?`}),(0,p.jsx)(o,{children:`Of course it is!`})]})}),(0,p.jsx)(e.Step,{step:1,title:`Step 2`,text:`Push them to try Preply out!`,children:(0,p.jsxs)(a,{children:[(0,p.jsx)(s,{children:`Why?`}),(0,p.jsx)(o,{children:`If you are wondering, it means you have not tried it out yet!`})]})})]})})},play:async({canvasElement:e,step:t})=>{let n=g(e);await t(`Step 1 should be visible`,async()=>{await _(()=>{h(n.getByText(`Ensure you can answer this question`)).toBeVisible()})}),await t(`Click Next`,async()=>{let e=n.getByRole(`button`,{name:`Next`});await m.click(e)}),await t(`Step 2 should be visible`,async()=>{await _(()=>{h(n.getByText(`Push them to try Preply out!`)).toBeVisible()})})}},b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
|
|
2
6
|
render: function Story() {
|
|
3
7
|
return <Accordion aria-label="accordionLabel">
|
|
4
8
|
<AccordionItem>
|
|
@@ -16,7 +20,7 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
16
20
|
const accordion = canvas.getByLabelText('accordionLabel');
|
|
17
21
|
expect(accordion).toBeVisible();
|
|
18
22
|
}
|
|
19
|
-
}`,...
|
|
23
|
+
}`,...b.parameters?.docs?.source}}},x.parameters={...x.parameters,docs:{...x.parameters?.docs,source:{originalSource:`{
|
|
20
24
|
args: {},
|
|
21
25
|
render: function Story() {
|
|
22
26
|
return <Accordion>
|
|
@@ -67,11 +71,14 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
67
71
|
expect(item2Content).not.toBeVisible();
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
|
-
}`,...
|
|
74
|
+
}`,...x.parameters?.docs?.source}}},C.parameters={...C.parameters,docs:{...C.parameters?.docs,source:{originalSource:`{
|
|
71
75
|
args: {},
|
|
76
|
+
decorators: [Story => <SimulateNoAnimationSupport>
|
|
77
|
+
<Story />
|
|
78
|
+
</SimulateNoAnimationSupport>],
|
|
72
79
|
render: function Story() {
|
|
73
80
|
return <Accordion>
|
|
74
|
-
<AccordionItem
|
|
81
|
+
<AccordionItem>
|
|
75
82
|
<AccordionHeader>
|
|
76
83
|
Is Preply the best platform for learning a language?
|
|
77
84
|
</AccordionHeader>
|
|
@@ -97,7 +104,7 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
97
104
|
expect(item1Content).not.toBeVisible();
|
|
98
105
|
});
|
|
99
106
|
}
|
|
100
|
-
}`,...
|
|
107
|
+
}`,...C.parameters?.docs?.source}}},w.parameters={...w.parameters,docs:{...w.parameters?.docs,source:{originalSource:`{
|
|
101
108
|
args: {},
|
|
102
109
|
render: function Story() {
|
|
103
110
|
return <Accordion>
|
|
@@ -135,7 +142,7 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
135
142
|
expect(item1Content).not.toBeVisible();
|
|
136
143
|
});
|
|
137
144
|
}
|
|
138
|
-
}`,...
|
|
145
|
+
}`,...w.parameters?.docs?.source}}},T.parameters={...T.parameters,docs:{...T.parameters?.docs,source:{originalSource:`{
|
|
139
146
|
args: {
|
|
140
147
|
onOpenChange: fn()
|
|
141
148
|
},
|
|
@@ -167,7 +174,7 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
167
174
|
expect(args.onOpenChange).toBeCalledWith(false);
|
|
168
175
|
});
|
|
169
176
|
}
|
|
170
|
-
}`,...
|
|
177
|
+
}`,...T.parameters?.docs?.source}}},E.parameters={...E.parameters,docs:{...E.parameters?.docs,source:{originalSource:`{
|
|
171
178
|
args: {
|
|
172
179
|
onClick: fn()
|
|
173
180
|
},
|
|
@@ -195,7 +202,7 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
195
202
|
expect(args.onClick).toBeCalled();
|
|
196
203
|
});
|
|
197
204
|
}
|
|
198
|
-
}`,...
|
|
205
|
+
}`,...E.parameters?.docs?.source}}},D.parameters={...D.parameters,docs:{...D.parameters?.docs,source:{originalSource:`{
|
|
199
206
|
render: function Story() {
|
|
200
207
|
return <Accordion aria-label="accordion" dataset={{
|
|
201
208
|
foo: 1
|
|
@@ -222,7 +229,7 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
222
229
|
const accordion = canvas.getByLabelText('accordion');
|
|
223
230
|
expect(accordion).toHaveAttribute('data-foo', '1');
|
|
224
231
|
}
|
|
225
|
-
}`,...
|
|
232
|
+
}`,...D.parameters?.docs?.source}}},O.parameters={...O.parameters,docs:{...O.parameters?.docs,source:{originalSource:`{
|
|
226
233
|
render: function Story() {
|
|
227
234
|
const Tour = createOnboardingTour();
|
|
228
235
|
return <Tour.Provider totalSteps={2}>
|
|
@@ -270,4 +277,4 @@ import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2
|
|
|
270
277
|
});
|
|
271
278
|
});
|
|
272
279
|
}
|
|
273
|
-
}`,...
|
|
280
|
+
}`,...O.parameters?.docs?.source}}},k=[`AriaAttributesAreSet`,`TestDisclosableContent`,`TestWithoutAnimation`,`TestExclusiveAccordion`,`TestItemOnOpenChange`,`TestHeaderOnClick`,`TestDataset`,`IntegrationWithOnboardingTour`]}))();export{b as AriaAttributesAreSet,O as IntegrationWithOnboardingTour,D as TestDataset,x as TestDisclosableContent,w as TestExclusiveAccordion,E as TestHeaderOnClick,T as TestItemOnOpenChange,C as TestWithoutAnimation,k as __namedExportsOrder,y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{t as i}from"./Button-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{t as i}from"./Button-DagS5hxP.js";import{n as a,t as o}from"./TokyoUISparkle-5ta_MRge.js";import{_ as s,f as c,g as l,h as u,m as d,n as f,p,r as m,t as h,v as g}from"./AlertBannerAction-DvbUWtiW.js";var _,v,y=t((()=>{_=`customBanner__WPfsi`,v={customBanner:_}})),b,x,S,C;t((()=>{e(n(),1),a(),f(),u(),s(),p(),y(),m(),b=r(),x={title:`Components/AlertBanner/Primitives`,component:l,subcomponents:{AlertBannerIcon:d,AlertBannerRoot:l,AlertBannerAction:h,AlertBannerText:c},parameters:{layout:`padded`,docs:{source:{type:`dynamic`}}},decorators:[e=>(0,b.jsx)(`div`,{style:{width:`500px`},children:(0,b.jsx)(e,{})})]},S=()=>(0,b.jsx)(g,{children:(0,b.jsxs)(l,{variant:`critical`,className:v.customBanner,children:[(0,b.jsx)(d,{svg:o}),(0,b.jsx)(c,{children:`Custom banner built with primitives.`}),(0,b.jsx)(h,{children:(0,b.jsx)(i,{variant:`onColor`,size:`large`,children:`Custom action`})})]})}),S.parameters={...S.parameters,docs:{...S.parameters?.docs,source:{originalSource:`() => {
|
|
2
2
|
const variant: AlertBannerVariant = 'critical';
|
|
3
3
|
return <AlertBannerProvider>
|
|
4
4
|
<AlertBannerRoot variant={variant} className={customStyles.customBanner}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{t as i}from"./Button-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{t as i}from"./Button-DagS5hxP.js";import{d as a,r as o,u as s,v as c,y as l}from"./AlertBannerAction-DvbUWtiW.js";var u,d,f,p,m,h,g,_,v,y,b,x,S,C;t((()=>{e(n(),1),a(),l(),o(),u=r(),{action:d}=__STORYBOOK_MODULE_ACTIONS__,{userEvent:f,expect:p,fn:m}=__STORYBOOK_MODULE_TEST__,h={title:`components/AlertBanner`,component:s,subcomponents:{AlertBannerProvider:c},args:{}},g={actionOnClick:m(d(`onCLicked`))},_={args:{},parameters:{chromatic:{modes:{"narrow-l":{viewport:`narrow-l`},"medium-l":{viewport:`medium-l`}}}},render:function(){return(0,u.jsxs)(c,{children:[(0,u.jsx)(s,{variant:`critical`,description:`We can't renew your subscription.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Try again`})}),(0,u.jsx)(s,{variant:`warning`,description:`Your credit card is about to expire.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Change payment method`})}),(0,u.jsx)(s,{variant:`positive`,description:`Your subscription has been renewed successfully.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Book the next lesson`})})]})},play:async({canvas:e,step:t})=>{let n=await e.findByRole(`button`,{name:/Try again/});await t(`actionOnClick is not called`,async()=>{p(g.actionOnClick).not.toBeCalled()}),await t(`actionOnClick is called`,async()=>{await f.click(n),p(g.actionOnClick).toBeCalled()})}},v={render:function(){return(0,u.jsxs)(c,{children:[(0,u.jsx)(s,{variant:`critical`,description:`We can't renew your subscription.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Try again`}),dataset:{testId:`subscriptionAlert`}}),(0,u.jsx)(s,{variant:`warning`,description:`Your credit card is about to expire.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Change payment method`}),dataset:{testid:`paymentWarning`}}),(0,u.jsx)(s,{variant:`positive`,description:`Your subscription has been renewed successfully.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Book the next lesson`}),dataset:{testid:`subscriptionRenewed`}})]})},play:async({canvas:e,step:t})=>{await t(`Alert banners are prefixed with "Alert:" to allow screen reader users to recall the alerts region`,async()=>{await p(await e.findByTestId(`subscriptionAlert`)).toHaveTextContent(`Alert: We can't renew your subscription.Try again`)}),await t(`Warning banners are prefixed with "Warning:" to allow screen reader users to recall the alerts region`,async()=>{await p(await e.findByTestId(`paymentWarning`)).toHaveTextContent(`Warning: Your credit card is about to expire.Change payment method`)}),await t(`Positive banners are prefixed with "Update:" to allow screen reader users to recall the updates region`,async()=>{await p(await e.findByTestId(`subscriptionRenewed`)).toHaveTextContent(`Update: Your subscription has been renewed successfully.Book the next lesson`)})}},y={render:function(){return(0,u.jsxs)(c,{"data-testid":`alertBannerHostId`,children:[(0,u.jsx)(`div`,{id:`pageContents`,children:`Page contents`}),(0,u.jsx)(s,{variant:`critical`,description:`We can't renew your subscription.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Try again`}),dataset:{testId:`subscriptionAlert`}})]})},play:async({canvas:e,step:t})=>{let n=e.getByTestId(`alertBannerHostId`);await t(`The host is announced as "Alerts, warnings, and updates"`,async()=>{await p(n).toHaveAccessibleName(`Alerts, warnings, and updates`)}),await t(`The host renders an aria-live region`,async()=>{await p(n).toHaveAttribute(`aria-live`),await p(n).toHaveAttribute(`aria-atomic`,`false`),await p(n).toHaveRole(`region`)}),await t(`Alert banners are rendered at the top of the page`,async()=>{let t=document.getElementById(`pageContents`);if(!t)throw Error(`Page contents element not found`);let n=await e.findByTestId(`subscriptionAlert`);p(!!(n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)).toBe(!0)})}},b=`Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`,x=`Lorem ipsum dolor sit amet, consectetur adipiscing elit. sed do eiusmod tempor incididunt.`,S={render:function(){return(0,u.jsxs)(c,{children:[(0,u.jsx)(s,{variant:`warning`,description:b,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:`Try again`})}),(0,u.jsx)(s,{variant:`warning`,description:`We can't renew your subscription.`,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:x})}),(0,u.jsx)(s,{variant:`warning`,description:b,action:(0,u.jsx)(i,{onClick:g.actionOnClick,children:x})})]})}},_.parameters={..._.parameters,docs:{..._.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
args: {},
|
|
3
3
|
parameters: {
|
|
4
4
|
chromatic: {
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i,y as a}from"./dist-DtfJeYQK.js";import{t as o}from"./react-dom-CLuuWI32.js";import{t as s}from"./jsx-runtime-C2wGStra.js";import{n as c,t as l}from"./dist-Cc1j9Pjk.js";import{n as ee,t as u}from"./Icon-C-oDFSRH.js";import{n as te,t as ne}from"./Text-Bj49UVGS.js";import{n as re}from"./Heading-Xmy4HTvU.js";import{n as ie,t as ae}from"./Button-DagS5hxP.js";import{r as oe}from"./OnboardingTooltip-BNwId6Jx.js";import{i as d,o as se,r as ce}from"./lib-8ue2PVWI.js";import{n as le}from"./AlertDialog-Da2sPT1D.js";import{n as ue,t as de}from"./TokyoUICheck-BxTDosuA.js";import{i as fe,n as pe,r as me,t as he}from"./TokyoUIErrorWarning-BH93ehx8.js";import{n as ge,t as _e}from"./VisuallyHidden-CpMYtDeS.js";import{n as ve,t as ye}from"./IconButton-Qo4r7KAR.js";import{n as be}from"./Checkbox-BV4Be-fH.js";import{r as xe}from"./SingleSelectChips-CFj7aR84.js";import{r as Se}from"./MultiSelectChips-DSeV2AIy.js";import{r as Ce}from"./DismissibleChips-QUmF1DlO.js";import{l as f,u as we}from"./DialogCloseButton-Df1XDsMW.js";import{n as Te}from"./Dialog-a74MpEoC.js";import{a as Ee,o as De}from"./DialogActions-BsCqS7W7.js";import{n as Oe,r as ke,t as p}from"./Steps-CNOQ424q.js";import{u as Ae}from"./DropdownMenu-CEFQwkft.js";import{n as je}from"./FormControl-C_Mh5dfi.js";import{n as Me}from"./LayoutFlex-CpktYRVX.js";import{n as Ne}from"./NumberField-CNBfsJCY.js";import{n as Pe}from"./PasswordField-B2PnHIH1.js";import{i as Fe}from"./SelectField-qBhGOYdK.js";import{r as Ie}from"./Slider-Bxzp79ts.js";import{n as Le}from"./RangeSlider-Eo2dw_WW.js";import{n as Re}from"./Switch-DyKTsO1c.js";import{n as ze}from"./TextareaField-G733luKs.js";import{n as Be}from"./TextField-B4F8szIu.js";import{n as Ve}from"./Tooltip-DCzQmBi_.js";var m,h,He,Ue,g,_,v=t((()=>{m=`alertBannerHost__NKFyB`,h=`alertBanner__Dje2u`,He=`icon__xEAyT`,Ue=`description__4PDHP`,g=`action__0gYZG`,_={alertBannerHost:m,alertBanner:h,icon:He,description:Ue,action:g}}));function y(){let e=(0,x.useContext)(C);if(!e)throw Error(`useAlertBannerHost must be used within AlertBannerHostContext`);return e.hostEl}function b({children:e,...t}){let[n,r]=(0,x.useState)(null),{formatMessage:i}=se();return(0,S.jsxs)(C.Provider,{value:{hostEl:n},children:[(0,S.jsx)(`div`,{className:_.alertBannerHost,role:`region`,"aria-live":`polite`,"aria-atomic":`false`,"aria-label":i({id:`preply-ds.alert-banner.host-region`,defaultMessage:`Alerts, warnings, and updates`,description:`It's announced by screen readers when they scan the content of the page, and they find the alert banners container.`}),ref:r,...t}),e]})}var x,S,C,w=t((()=>{x=e(n(),1),v(),ce(),S=s(),C=(0,x.createContext)({hostEl:null});try{y.displayName=`useAlertBannerHost`,y.__docgenInfo={description:"If you have issues with AlertBannerHostContext, ensures `AlertBannerProvider` is put at the top of\nyour app component tree",displayName:`useAlertBannerHost`,props:{}}}catch{}try{b.displayName=`AlertBannerProvider`,b.__docgenInfo={description:`A region where all the \`AlertBanner\`s will be rendered into, and announced accordingly. It should
|
|
2
|
+
be the first element of the page.
|
|
3
|
+
|
|
4
|
+
From an affordance perspective:
|
|
5
|
+
1. Sighted users can see the page-wide banner with their eyes. The visual prominence ensures the
|
|
6
|
+
alerts are noticed.
|
|
7
|
+
2. Screen readers announce the banners when they are added, and the text content of the banner
|
|
8
|
+
help the users to understand the level of importance.
|
|
9
|
+
|
|
10
|
+
For blind users readers, it's important that AlertBannerProvider wraps the whole app so its DOM
|
|
11
|
+
element is put at the top of the page, because:
|
|
12
|
+
1. Screen readers announce the banner contents, but don't allow users to navigate to them and
|
|
13
|
+
interact with them.
|
|
14
|
+
2. So, if this element is put on the top of the page, screen readers wil read the label ("Alerts,
|
|
15
|
+
warnings, and updates") as the first element, so the users are aware since the beginning that
|
|
16
|
+
there is a dedicated region for alerts.
|
|
17
|
+
3. When an alert appears, it's announced with something like "Alert: we can't renew your
|
|
18
|
+
subscription", and they can connect the initially announced region with the newly appeared alert.
|
|
19
|
+
4. They can then navigate to the alerts region, and interact with the alert actions.`,displayName:`AlertBannerProvider`,props:{}}}catch{}})),T,We,E,D,O,Ge,k=t((()=>{T=e(n(),1),v(),We=e(o(),1),w(),E=s(),D=(0,T.createContext)({variant:`positive`}),O=(0,T.forwardRef)(function(e,t){let n=y();return n?(0,We.createPortal)((0,E.jsx)(Ge,{ref:t,...e}),n):null}),Ge=(0,T.forwardRef)(function({className:e,variant:t,...n},r){let i=[_.alertBanner,e].filter(Boolean).join(` `);return(0,E.jsx)(D.Provider,{value:{variant:t},children:(0,E.jsx)(`div`,{ref:r,className:i,"data-preply-ds-component":`AlertBannerRoot`,"data-variant":t,...n})})});try{O.displayName=`AlertBannerRoot`,O.__docgenInfo={description:``,displayName:`AlertBannerRoot`,props:{variant:{defaultValue:null,description:``,name:`variant`,required:!0,type:{name:`enum`,value:[{value:`"critical"`},{value:`"positive"`},{value:`"warning"`}]}},dataset:{defaultValue:null,description:"@deprecated Pass data attributes as regular props instead (`data-testid` for instance)",name:`dataset`,required:!1,type:{name:`undefined`}}}}}catch{}})),A,j,M,N,P,F,I,Ke=t((()=>{A=e(n(),1),ue(),fe(),pe(),ee(),v(),k(),j=s(),M=()=>(0,j.jsx)(u,{svg:de,size:`24`}),N=()=>(0,j.jsx)(u,{svg:he,size:`24`}),P=()=>(0,j.jsx)(u,{svg:me,size:`24`}),F={positive:M,warning:N,critical:P},I=(0,A.forwardRef)(function({svg:e,children:t,className:n=``},r){let{variant:i}=(0,A.useContext)(D),a=[_.icon,n].join(` `),o=null;return t?o=t:e?o=(0,j.jsx)(u,{svg:e,size:`24`}):i&&i in F&&(o=F[i]()),o?(0,j.jsx)(`div`,{ref:r,className:a,children:o}):null});try{M.displayName=`AlertBannerPositiveIcon`,M.__docgenInfo={description:`Positive icon for the AlertBanner.`,displayName:`AlertBannerPositiveIcon`,props:{}}}catch{}try{N.displayName=`AlertBannerWarningIcon`,N.__docgenInfo={description:`Warning icon for the AlertBanner.`,displayName:`AlertBannerWarningIcon`,props:{}}}catch{}try{P.displayName=`AlertBannerCriticalIcon`,P.__docgenInfo={description:`Critical icon for the AlertBanner.`,displayName:`AlertBannerCriticalIcon`,props:{}}}catch{}try{I.displayName=`AlertBannerIcon`,I.__docgenInfo={description:"An icon for the alert banner.\n\nThis component will render the appropriate icon based on the parent\n`AlertBannerRoot` component's `variant` prop — these semantic icons are also\nexported for the following variants:\n- `positive` -> `<AlertBannerPositiveIcon />`\n- `warning` -> `<AlertBannerWarningIcon />`\n- `critical` -> `<AlertBannerCriticalIcon />`\n\nThe icon can be overridden by passing a custom SVG icon via the `svg` prop.\n\nIf you want to place any leading element inside of the `AlertBanner`,\nwith the same spacing as the icon, you can pass it as a child element.\n\nNote: The root of this component is a `div` element. You can use the\n`className` prop to override the default styles for the **container**.",displayName:`AlertBannerIcon`,props:{svg:{defaultValue:null,description:``,name:`svg`,required:!1,type:{name:`enum`,value:[{value:`ComponentClass<SVGAttributes<SVGElement>, any>`},{value:`FunctionComponent<SVGAttributes<SVGElement>>`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`}]}},className:{defaultValue:{value:``},description:``,name:`className`,required:!1,type:{name:`enum`,value:[{value:`string`}]}}}}}catch{}})),L,R,qe,z,Je=t((()=>{L=e(n(),1),ce(),X(),ge(),v(),k(),R=s(),qe={critical:(0,R.jsx)(d,{id:`preply-ds.alert-banner.critical-prefix`,defaultMessage:`Alert:`,description:`Prefix every alert banner shown to the user. It's announced by screen readers as 'Alert: 'the alert message (for instance: 'Alert: We can't renew your subscription.').`}),warning:(0,R.jsx)(d,{id:`preply-ds.alert-banner.warning-prefix`,defaultMessage:`Warning:`,description:`Prefix every warning banner shown to the user. It's announced by screen readers as 'Warning: 'the alert message (for instance: 'Warning: Your credit card is about to expire.').`}),positive:(0,R.jsx)(d,{id:`preply-ds.alert-banner.positive-prefix`,defaultMessage:`Update:`,description:`Prefix every positive banner shown to the user. It's announced by screen readers as 'Warning: 'the alert message (for instance: 'Warning: Your subscription has been renewed successfully.').`})},z=(0,L.forwardRef)(function({className:e,children:t,...n},r){let{variant:i}=(0,L.useContext)(D);return(0,R.jsxs)(ne,{ref:r,variant:`default-regular`,accent:`primary`,className:[_.description,e].filter(Boolean).join(` `),...n,children:[(0,R.jsx)(_e,{children:qe[i]}),` `,t]})});try{z.displayName=`AlertBannerText`,z.__docgenInfo={description:"The AlertBannerText is a container which defaults to displaying a `Text` child with a\n`default-regular` variant, which can be overridden with the `children` prop. The passed text is\nalso prefixed with a visually hidden text to allow screen reader user to remind of the existence\nof the region rendered by `AlertBannerProvider`.",displayName:`AlertBannerText`,props:{variant:{defaultValue:null,description:``,name:`variant`,required:!1,type:{name:`enum`,value:[{value:`"caption-regular"`},{value:`"caption-semibold"`},{value:`"small-regular"`},{value:`"small-regular-italic"`},{value:`"small-semibold"`},{value:`"small-semibold-italic"`},{value:`"default-regular"`},{value:`"default-regular-italic"`},{value:`"default-semibold"`},{value:`"default-semibold-italic"`},{value:`"large-regular"`},{value:`"large-regular-italic"`},{value:`"large-semibold"`},{value:`"large-semibold-italic"`},{value:`ResponsiveProp<TextVariant>`}]}},accent:{defaultValue:null,description:``,name:`accent`,required:!1,type:{name:`enum`,value:[{value:`"primary"`},{value:`"secondary"`},{value:`"tertiary"`},{value:`"critical"`},{value:`"inverted"`},{value:`"info"`},{value:`"positive"`},{value:`"warning"`},{value:`"accentDark"`},{value:`"placeholder"`}]}},strong:{defaultValue:null,description:``,name:`strong`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},centered:{defaultValue:null,description:``,name:`centered`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`},{value:`ResponsiveProp<boolean>`}]}},tag:{defaultValue:null,description:``,name:`tag`,required:!1,type:{name:`enum`,value:[{value:`"div"`},{value:`"p"`},{value:`"span"`}]}},dataset:{defaultValue:null,description:"@deprecated Pass data attributes as regular props instead (`data-testid` for instance)",name:`dataset`,required:!1,type:{name:`undefined`}},className:{defaultValue:null,description:``,name:`className`,required:!1,type:{name:`enum`,value:[{value:`string`}]}}}}}catch{}})),B,V,Ye=t((()=>{e(n(),1),i(),l(),k(),Ke(),Je(),$(),B=s(),V=e=>{let{variant:t,description:n,action:i,dataset:a}=e;return(0,B.jsxs)(O,{variant:t,...r(a,{preplyDsComponent:c.AlertBanner}),children:[(0,B.jsx)(I,{}),(0,B.jsx)(z,{children:n}),(0,B.jsx)(Q,{children:i})]})};try{V.displayName=`AlertBanner`,V.__docgenInfo={description:`The Alert Banner communicates important and time-sensitive messages that require user attention.
|
|
20
|
+
|
|
21
|
+
From an accessibility perspective, the description is prefixed to announce the importance of the
|
|
22
|
+
banner.`,displayName:`AlertBanner`,props:{variant:{defaultValue:null,description:"Impact the visualized icon, the background color, and how the banner is announced by screen\nreaders.\n\nSemantic icons are also exported for the following variants:\n- `warning` -> `<AlertBannerWarningIcon />`\n- `critical` -> `<AlertBannerCriticalIcon />`\n- `positive` -> `<AlertBannerPositiveIcon />`",name:`variant`,required:!0,type:{name:`enum`,value:[{value:`"critical"`},{value:`"positive"`},{value:`"warning"`}]}},description:{defaultValue:null,description:`The banner's message content.`,name:`description`,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`}]}},action:{defaultValue:null,description:`The banner' action.
|
|
23
|
+
|
|
24
|
+
To build a DS compliant banner, use:
|
|
25
|
+
- \`CalloutBannerIcon\` to add an icon to the banner
|
|
26
|
+
- \`CalloutBannerText\` to add a text to the banner
|
|
27
|
+
- \`CalloutBannerDismissButton\` to add a dismiss button to the banner
|
|
28
|
+
|
|
29
|
+
Alternatively, to diverge from the DS, you're able to:
|
|
30
|
+
- Add your own custom content to break away from the inner content
|
|
31
|
+
styling and structure.
|
|
32
|
+
- Use the \`CalloutBannerRoot\` primitive to customize the banner
|
|
33
|
+
container (e.g. colour).`,name:`action`,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`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}}));function H({primaryButton:e,nextButton:t=(0,U.jsx)(K,{}),previousButton:n=(0,U.jsx)(q,{})}){let{currentStep:r,totalSteps:i}=ke(),a=r===1,o=r===i;return(0,U.jsx)(Ee,{children:(0,U.jsxs)(`div`,{className:f.stepControls,"data-preply-ds-component":c.DialogSteps,children:[!a&&(0,U.jsx)(`div`,{className:f.previous,"data-preply-ds-component":c.DialogStepsPreviousContainer,children:n}),(0,U.jsx)(`div`,{className:f.next,"data-preply-ds-component":c.DialogStepsNextContainer,children:o?e:t})]})})}var U,W,G,K,q,Xe=t((()=>{e(n(),1),Oe(),we(),De(),l(),U=s(),W=p,G=p.Step,K=p.Next,q=p.Previous;try{H.displayName=`DialogStepsActions`,H.__docgenInfo={description:`Wrapper around the Steps actions for usage in Dialog.`,displayName:`DialogStepsActions`,props:{primaryButton:{defaultValue:null,description:`Primary action button.
|
|
34
|
+
|
|
35
|
+
This button will be displayed on the last step.
|
|
36
|
+
@example <DialogStepsActions
|
|
37
|
+
primaryButton={<Button size="medium" variant="primary" onClick={() => {}}>Finish</Button>}
|
|
38
|
+
/>`,name:`primaryButton`,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`}]}},nextButton:{defaultValue:{value:`<DialogStepsNext />`},description:`Next step button.
|
|
39
|
+
|
|
40
|
+
This button will be used on all steps except the last one. When not provided, a default button will be used.
|
|
41
|
+
@example <DialogStepsActions
|
|
42
|
+
nextButton={<DialogStepsNext onClick={() => {}}>Next</DialogStepsNext>}
|
|
43
|
+
/>`,name:`nextButton`,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`}]}},previousButton:{defaultValue:{value:`<DialogStepsPrevious />`},description:`Previous step button.
|
|
44
|
+
|
|
45
|
+
This button will be used on all steps except the first one. When not provided, a default button will be used.
|
|
46
|
+
@example <DialogStepsActions
|
|
47
|
+
previousButton={<DialogStepsPrevious onClick={() => {}}>Previous</DialogStepsPrevious>}
|
|
48
|
+
/>`,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{W.displayName=`DialogSteps`,W.__docgenInfo={description:``,displayName:`DialogSteps`,props:{"aria-label":{defaultValue:null,description:`A description of the step flow and its content for screen readers.
|
|
49
|
+
@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.
|
|
50
|
+
|
|
51
|
+
This is triggered either by using the \`Steps.Previous\` and \`Steps.Next\`
|
|
52
|
+
components, or by calling \`goToPreviousStep\`, \`goToNextStep\`, or
|
|
53
|
+
\`goToStep\` from the \`StepsContext\`.
|
|
54
|
+
|
|
55
|
+
Can be used to:
|
|
56
|
+
- Skip/redirect steps conditionally
|
|
57
|
+
- Perform async process (e.g. validation) on step changes, marking the
|
|
58
|
+
element as busy/loading
|
|
59
|
+
@param currentStep The current step (1-based)
|
|
60
|
+
@param nextStep The next, incoming step
|
|
61
|
+
@returns Promise that resolves to:
|
|
62
|
+
- \`undefined\`: proceed with default navigation
|
|
63
|
+
- \`number\`: override the destination step
|
|
64
|
+
@example Add async validation
|
|
65
|
+
const handleStepChange = async (current, next) => {
|
|
66
|
+
await validateStep(current);
|
|
67
|
+
return next;
|
|
68
|
+
};
|
|
69
|
+
@example Skip a step
|
|
70
|
+
const handleStepChange = async (current, next) => {
|
|
71
|
+
if (next === 2) return 3; // Skip step 2
|
|
72
|
+
return next;
|
|
73
|
+
};`,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{G.displayName=`DialogStep`,G.__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{K.displayName=`DialogStepsNext`,K.__docgenInfo={description:``,displayName:`DialogStepsNext`,props:{size:{defaultValue:null,description:``,name:`size`,required:!1,type:{name:`enum`,value:[{value:`"small"`},{value:`"large"`},{value:`"medium"`},{value:`ResponsiveProp<ButtonSize>`}]}},id:{defaultValue:null,description:``,name:`id`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},variant:{defaultValue:null,description:``,name:`variant`,required:!1,type:{name:`enum`,value:[{value:`"primary"`},{value:`"secondary"`},{value:`"tertiary"`},{value:`"quaternary"`},{value:`"ghost"`},{value:`"critical"`},{value:`"onColor"`},{value:`"classroom"`},{value:`"primaryB2b"`},{value:`"primaryTutor"`},{value:`"inverted"`},{value:`"newFeature"`},{value:`"ai"`}]}},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`}]}},disabled:{defaultValue:null,description:``,name:`disabled`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},busy:{defaultValue:null,description:`Replaces the content with a loading indicator.`,name:`busy`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},selected:{defaultValue:null,description:`Used only for classroom and ghost variants`,name:`selected`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},as:{defaultValue:null,description:`Custom element to render the button.
|
|
74
|
+
|
|
75
|
+
Allows rendering the button using a different React element or component.
|
|
76
|
+
This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
|
|
77
|
+
@example // Render as a react router link component
|
|
78
|
+
import { Link } from 'react-router-dom';
|
|
79
|
+
|
|
80
|
+
<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`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},dsInternalSimulation:{defaultValue:null,description:`@deprecated This is meant for internal DS usage only. Do not use it in your code.
|
|
81
|
+
@ignore`,name:`dsInternalSimulation`,required:!1,type:{name:`enum`,value:[{value:`"hover"`},{value:`"focus"`},{value:`"active"`}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
|
|
82
|
+
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
83
|
+
|
|
84
|
+
<Button leadingSvgIcon={TokyoUITag}>Button</Button>
|
|
85
|
+
or
|
|
86
|
+
<Button leadingSvgIcon={<TokyoUITag />}>Button</Button>`,name:`leadingSvgIcon`,required:!1,type:{name:`enum`,value:[{value:`ComponentClass<SVGAttributes<SVGElement>, any>`},{value:`FunctionComponent<SVGAttributes<SVGElement>>`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`}]}},trailingSvgIcon:{defaultValue:null,description:`The trailing SVG icon.
|
|
87
|
+
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
88
|
+
|
|
89
|
+
<Button trailingSvgIcon={TokyoUITag}>Button</Button>
|
|
90
|
+
or
|
|
91
|
+
<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>>`}]}}}}}catch{}try{q.displayName=`DialogStepsPrevious`,q.__docgenInfo={description:``,displayName:`DialogStepsPrevious`,props:{size:{defaultValue:null,description:``,name:`size`,required:!1,type:{name:`enum`,value:[{value:`"small"`},{value:`"large"`},{value:`"medium"`},{value:`ResponsiveProp<ButtonSize>`}]}},id:{defaultValue:null,description:``,name:`id`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},variant:{defaultValue:null,description:``,name:`variant`,required:!1,type:{name:`enum`,value:[{value:`"primary"`},{value:`"secondary"`},{value:`"tertiary"`},{value:`"quaternary"`},{value:`"ghost"`},{value:`"critical"`},{value:`"onColor"`},{value:`"classroom"`},{value:`"primaryB2b"`},{value:`"primaryTutor"`},{value:`"inverted"`},{value:`"newFeature"`},{value:`"ai"`}]}},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`}]}},disabled:{defaultValue:null,description:``,name:`disabled`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},busy:{defaultValue:null,description:`Replaces the content with a loading indicator.`,name:`busy`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},selected:{defaultValue:null,description:`Used only for classroom and ghost variants`,name:`selected`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},as:{defaultValue:null,description:`Custom element to render the button.
|
|
92
|
+
|
|
93
|
+
Allows rendering the button using a different React element or component.
|
|
94
|
+
This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
|
|
95
|
+
@example // Render as a react router link component
|
|
96
|
+
import { Link } from 'react-router-dom';
|
|
97
|
+
|
|
98
|
+
<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`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},dsInternalSimulation:{defaultValue:null,description:`@deprecated This is meant for internal DS usage only. Do not use it in your code.
|
|
99
|
+
@ignore`,name:`dsInternalSimulation`,required:!1,type:{name:`enum`,value:[{value:`"hover"`},{value:`"focus"`},{value:`"active"`}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
|
|
100
|
+
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
101
|
+
|
|
102
|
+
<Button leadingSvgIcon={TokyoUITag}>Button</Button>
|
|
103
|
+
or
|
|
104
|
+
<Button leadingSvgIcon={<TokyoUITag />}>Button</Button>`,name:`leadingSvgIcon`,required:!1,type:{name:`enum`,value:[{value:`ComponentClass<SVGAttributes<SVGElement>, any>`},{value:`FunctionComponent<SVGAttributes<SVGElement>>`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`}]}},trailingSvgIcon:{defaultValue:null,description:`The trailing SVG icon.
|
|
105
|
+
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
106
|
+
|
|
107
|
+
<Button trailingSvgIcon={TokyoUITag}>Button</Button>
|
|
108
|
+
or
|
|
109
|
+
<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>>`}]}}}}}catch{}})),Ze,Qe,$e=t((()=>{Ze=`IconTile__XlzW3`,Qe={IconTile:Ze,"IconTile--size-small":`IconTile--size-small__brJck`,"IconTile--size-base":`IconTile--size-base__gPIDE`,"IconTile--size-medium":`IconTile--size-medium__gAwOs`,"IconTile--size-large":`IconTile--size-large__M35fc`,"IconTile--tone-neutral":`IconTile--tone-neutral__IVJ2Y`,"IconTile--tone-info":`IconTile--tone-info__o2x-M`,"IconTile--tone-ai":`IconTile--tone-ai__dJp9n`,"IconTile--tone-positive":`IconTile--tone-positive__yJsa9`,"IconTile--tone-warning":`IconTile--tone-warning__q8yaj`,"IconTile--tone-critical":`IconTile--tone-critical__iAjl0`}}));function et(e){switch(e){case`small`:return`16`;case`medium`:return`32`;case`large`:return`48`}return`24`}var tt,J,Y,nt=t((()=>{i(),tt=e(n(),1),$e(),l(),X(),J=s(),Y=(0,tt.forwardRef)(function({size:e=`base`,tone:t=`neutral`,dataset:n,...i},o){return(0,J.jsx)(`span`,{className:a(Qe,c.IconTile,[`size-${e}`,`tone-${t}`]).join(` `),...r(n,{preplyDsComponent:c.IconTile}),children:(0,J.jsx)(u,{...i,accent:`primary`,size:et(e),ref:o})})});try{Y.displayName=`IconTile`,Y.__docgenInfo={description:``,displayName:`IconTile`,props:{dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},label:{defaultValue:null,description:"If using the icon without any adjacent descriptive text, use this prop to\nprovide an `aria-label` for assistive technologies.",name:`label`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},svg:{defaultValue:null,description:``,name:`svg`,required:!0,type:{name:`enum`,value:[{value:`ComponentClass<SVGAttributes<SVGElement>, any>`},{value:`FunctionComponent<SVGAttributes<SVGElement>>`}]}},size:{defaultValue:{value:`base`},description:``,name:`size`,required:!1,type:{name:`enum`,value:[{value:`"small"`},{value:`"large"`},{value:`"base"`},{value:`"medium"`}]}},tone:{defaultValue:{value:`neutral`},description:``,name:`tone`,required:!1,type:{name:`enum`,value:[{value:`"critical"`},{value:`"ai"`},{value:`"neutral"`},{value:`"info"`},{value:`"positive"`},{value:`"warning"`}]}}}}}catch{}})),X=t((()=>{le(),w(),ie(),be(),xe(),Se(),Ce(),Te(),Ae(),je(),re(),ee(),nt(),ve(),Me(),Ne(),oe(),Pe(),Fe(),Ie(),Le(),Re(),te(),ze(),Be(),Ve()}));function rt(e){return(0,Z.isValidElement)(e)?e.type===ae||e.type===ye:!1}var Z,it,at,Q,$=t((()=>{Z=e(n(),1),X(),v(),l(),it=s(),at={variant:`secondary`,size:`small`,wrap:!0,fullWidth:{_:!0,"medium-l":!1}},Q=(0,Z.forwardRef)(function({className:e,children:t,...n},r){let i=[_.action,e].filter(Boolean).join(` `),a=Z.Children.map(t,e=>rt(e)?(0,Z.cloneElement)(e,{...at,...e.props,ref:r,...n}):e);return(0,it.jsx)(`div`,{className:i,"data-preply-ds-component":c.AlertBannerAction,children:a})});try{Q.displayName=`AlertBannerAction`,Q.__docgenInfo={description:`The AlertBannerAction is a container that sets defaults when Button or IconButton are passed.`,displayName:`AlertBannerAction`,props:{size:{defaultValue:null,description:``,name:`size`,required:!1,type:{name:`enum`,value:[{value:`"small"`},{value:`"large"`},{value:`"medium"`},{value:`ResponsiveProp<ButtonSize>`}]}},id:{defaultValue:null,description:``,name:`id`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},variant:{defaultValue:null,description:``,name:`variant`,required:!1,type:{name:`enum`,value:[{value:`"primary"`},{value:`"secondary"`},{value:`"tertiary"`},{value:`"quaternary"`},{value:`"ghost"`},{value:`"critical"`},{value:`"onColor"`},{value:`"classroom"`},{value:`"primaryB2b"`},{value:`"primaryTutor"`},{value:`"inverted"`},{value:`"newFeature"`},{value:`"ai"`}]}},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`}]}},disabled:{defaultValue:null,description:``,name:`disabled`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},busy:{defaultValue:null,description:`Replaces the content with a loading indicator.`,name:`busy`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},selected:{defaultValue:null,description:`Used only for classroom and ghost variants`,name:`selected`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},as:{defaultValue:null,description:`Custom element to render the button.
|
|
110
|
+
|
|
111
|
+
Allows rendering the button using a different React element or component.
|
|
112
|
+
This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
|
|
113
|
+
@example // Render as a react router link component
|
|
114
|
+
import { Link } from 'react-router-dom';
|
|
115
|
+
|
|
116
|
+
<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`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},dsInternalSimulation:{defaultValue:null,description:`@deprecated This is meant for internal DS usage only. Do not use it in your code.
|
|
117
|
+
@ignore`,name:`dsInternalSimulation`,required:!1,type:{name:`enum`,value:[{value:`"hover"`},{value:`"focus"`},{value:`"active"`}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
|
|
118
|
+
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
119
|
+
|
|
120
|
+
<Button leadingSvgIcon={TokyoUITag}>Button</Button>
|
|
121
|
+
or
|
|
122
|
+
<Button leadingSvgIcon={<TokyoUITag />}>Button</Button>`,name:`leadingSvgIcon`,required:!1,type:{name:`enum`,value:[{value:`ComponentClass<SVGAttributes<SVGElement>, any>`},{value:`FunctionComponent<SVGAttributes<SVGElement>>`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`}]}},trailingSvgIcon:{defaultValue:null,description:`The trailing SVG icon.
|
|
123
|
+
@example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
|
|
124
|
+
|
|
125
|
+
<Button trailingSvgIcon={TokyoUITag}>Button</Button>
|
|
126
|
+
or
|
|
127
|
+
<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>>`}]}},className:{defaultValue:null,description:``,name:`className`,required:!1,type:{name:`enum`,value:[{value:`string`}]}}}}}catch{}}));export{k as _,nt as a,H as c,Ye as d,z as f,O as g,Ke as h,Y as i,Xe as l,I as m,$ as n,G as o,Je as p,X as r,W as s,Q as t,V as u,b as v,w as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i}from"./dist-DtfJeYQK.js";import{t as a}from"./jsx-runtime-C2wGStra.js";import{g as o,m as s}from"./iframe-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i}from"./dist-DtfJeYQK.js";import{t as a}from"./jsx-runtime-C2wGStra.js";import{g as o,m as s}from"./iframe-kBDSpxRI.js";import{n as c,t as l}from"./dist-Cc1j9Pjk.js";import{n as u,t as d}from"./Heading-Xmy4HTvU.js";import{n as f,t as p}from"./Button-DagS5hxP.js";import{A as m,D as h,E as g,M as _,N as v,O as y,j as b,k as x,t as S}from"./esm-BYGpffIq.js";var C,w,T,E,D,O,k,A=t((()=>{C=`overlay__vG-Gu`,w=`overlayShow__TBIKv`,T=`content__Nk-Ib`,E=`contentShow__wWPJX`,D=`description__1dRpy`,O=`actions__FsX-e`,k={overlay:C,overlayShow:w,content:T,contentShow:E,description:D,actions:O}})),j,M,N,P,F,I,L,R=t((()=>{j=e(n(),1),S(),s(),A(),u(),i(),l(),f(),M=a(),N=(0,j.forwardRef)(function(e,t){let n=j.Children.only(e.children);return(0,j.isValidElement)(n)?(0,M.jsx)(g,{render:e=>(0,j.cloneElement)(n,{...e,ref:t})}):null}),P=(0,j.forwardRef)(function(e,t){return(0,M.jsx)(_,{ref:t,render:(0,M.jsx)(p,{}),...e})}),F=(0,j.forwardRef)(function(e,t){return(0,M.jsx)(_,{ref:t,render:(0,M.jsx)(p,{}),...e})}),I=({open:e,title:t,description:n,dataset:i,children:a})=>{let s=o(),l=r(i,{preplyDsComponent:c.AlertDialog}),u,f=[];return j.Children.forEach(a,e=>{(0,j.isValidElement)(e)&&(e.type===N?u=e:f.push(e))}),(0,M.jsxs)(y,{open:e,children:[u,(0,M.jsxs)(x,{container:s,children:[(0,M.jsx)(v,{className:k.overlay}),(0,M.jsxs)(m,{...l,className:k.content,children:[(0,M.jsx)(h,{render:(0,M.jsx)(d,{tag:`h3`,variant:`medium`,children:t})}),(0,M.jsx)(b,{className:k.description,children:n}),(0,M.jsx)(`div`,{className:k.actions,children:f})]})]})]})},L=Object.assign(I,{Trigger:N,Action:P,Cancel:F});try{L.displayName=`AlertDialog`,L.__docgenInfo={description:`A modal alertdialog that interrupts the user with important content and expects a response.
|
|
2
2
|
|
|
3
3
|
Unlike a \`Dialog\`, it cannot be dismissed by clicking outside or pressing escape.`,displayName:`AlertDialog`,props:{title:{defaultValue:null,description:`The alert's title, describing what the user needs to confirm`,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:`Details about the action and its consequences`,name:`description`,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`}]}},children:{defaultValue:null,description:"The AlertDialog actions.\n@see `AlertDialog.Actions` for a common actions convenience wrapper.",name:`children`,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`}]}},open:{defaultValue:null,description:`Controls the visibility of the alert.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./Button-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./Button-DagS5hxP.js";import{n as o,t as s}from"./AlertDialog-Da2sPT1D.js";var c,l,u,d,f,p,m,h,g,_,v,y,b;t((()=>{c=e(n(),1),o(),i(),l=r(),{expect:u,userEvent:d,waitFor:f}=__STORYBOOK_MODULE_TEST__,{action:p}=__STORYBOOK_MODULE_ACTIONS__,m={title:`Components/AlertDialog`,component:s,parameters:{preventIframeFromScrollingParent:!0,docs:{description:{component:`A modal alert dialog for confirming destructive or important actions.`},story:{inline:!1,height:300}}},play:async({canvas:e,step:t})=>{await t(`Open alert`,async()=>(await d.click(e.getByTestId(`alert-trigger`)),f(()=>{u(e.getByTestId(`alert-dialog`)).toBeVisible()})))}},h={parameters:{docs:{description:{story:"Uncontrolled alert using the `Trigger`, `Cancel`, and `Action` subcomponents."}}},args:{title:`Confirm`,description:`This action cannot be undone.`,dataset:{testid:`alert-dialog`}},render:function(e){return(0,l.jsxs)(s,{...e,children:[(0,l.jsx)(s.Trigger,{children:(0,l.jsx)(a,{dataset:{testid:`alert-trigger`},children:`Action`})}),(0,l.jsx)(s.Cancel,{variant:`tertiary`,onClick:p(`cancel`),children:`Cancel`}),(0,l.jsx)(s.Action,{onClick:p(`confirm`),children:`Confirm`})]})}},g={parameters:{docs:{description:{story:`Uncontrolled alert using the \`Trigger\`, and two \`Action\` subcomponents.
|
|
2
2
|
|
|
3
3
|
The two actions are styled differently to suggest a preferred action to the one the user has requested.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./Avatar-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./Avatar-D6oXWjq1.js";import{r as o,t as s}from"./storybook-utils-BfrlMSeG.js";var c,l,u,d,f;t((()=>{e(n(),1),i(),s(),c=r(),l={title:`components/Avatar`,component:a,argTypes:{size:{description:o}}},u=()=>(0,c.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`end`},children:[(0,c.jsx)(a,{size:`160`}),(0,c.jsx)(a,{src:`./assets/avatar-1.png`,size:`96`}),(0,c.jsx)(a,{src:`./assets/avatar-2.png`,size:`64`}),(0,c.jsx)(a,{src:`./assets/avatar-3.png`,size:`48`}),(0,c.jsx)(a,{src:`./assets/avatar-4.png`,size:`32`}),(0,c.jsx)(a,{src:`./assets/avatar-5.png`,size:`24`})]}),d={parameters:{chromatic:{disableSnapshot:!0}},args:{size:`32`,src:`./assets/avatar-1.png`,dataset:{qaid:`avatar`}},argTypes:{src:{control:`text`},dataset:{control:`object`},alt:{control:`text`},round:{table:{disable:!0}}}},u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`() => <div style={{
|
|
2
2
|
display: 'flex',
|
|
3
3
|
gap: '8px',
|
|
4
4
|
alignItems: 'end'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{_ as r,b as i,ht as a,t as o,w as s,x as c,y as l}from"./dist-DtfJeYQK.js";import{t as u}from"./jsx-runtime-C2wGStra.js";import{n as d,t as f}from"./dist-Cc1j9Pjk.js";import{n as p,t as m}from"./filterAttributesPassedByRadixUIAtRuntime-CGiuUnR2.js";import{n as h,t as g}from"./Avatar-
|
|
2
|
-
@example <Avatar dataset={{ 'qa-id': 'user-avatar' }} /> // will add data-qa-id="user-avatar" to the HTML element`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},alt:{defaultValue:null,description:`A description of the image.
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{_ as r,b as i,ht as a,t as o,w as s,x as c,y as l}from"./dist-DtfJeYQK.js";import{t as u}from"./jsx-runtime-C2wGStra.js";import{n as d,t as f}from"./dist-Cc1j9Pjk.js";import{n as p,t as m}from"./filterAttributesPassedByRadixUIAtRuntime-CGiuUnR2.js";import{n as h,t as g}from"./Avatar-D6oXWjq1.js";var _,v,y=t((()=>{_=`AvatarWithStatus__z8Zik`,v={AvatarWithStatus:_,"AvatarWithStatus--indicator":`AvatarWithStatus--indicator__dsdXa`,"AvatarWithStatus--online":`AvatarWithStatus--online__pGAFw`,"AvatarWithStatus--size-64":`AvatarWithStatus--size-64__vG-kB`,"AvatarWithStatus--size-96":`AvatarWithStatus--size-96__Dgqc1`,"AvatarWithStatus--size-160":`AvatarWithStatus--size-160__7gCR7`}})),b,x,S,C=t((()=>{s(),f(),o(),b=e(n(),1),p(),h(),y(),x=u(),S=(0,b.forwardRef)(function({online:e=!1,size:t=`64`,dataset:n,alt:o,crossOrigin:s,src:u,...f},p){let h=l(v,d.AvatarWithStatus,[r(`online`,void 0,e),c(`size`,t)]),_=[...i(v,d.AvatarWithStatus,[`indicator`])];return(0,x.jsxs)(`div`,{...m(f),ref:p,className:h.join(` `),...a(n,{preplyDsComponent:d.AvatarWithStatus}),children:[(0,x.jsx)(`span`,{className:_.join(` `)}),(0,x.jsx)(`div`,{children:(0,x.jsx)(g,{alt:o,crossOrigin:s,src:u,size:t??`32`})})]})});try{S.displayName=`AvatarWithStatus`,S.__docgenInfo={description:``,displayName:`AvatarWithStatus`,props:{dataset:{defaultValue:null,description:`Sets data attributes on the DOM element.
|
|
2
|
+
@example <Avatar dataset={{ 'qa-id': 'user-avatar' }} /> // will add data-qa-id="user-avatar" to the HTML element`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}},crossOrigin:{defaultValue:null,description:`CORS policy for the image.`,name:`crossOrigin`,required:!1,type:{name:`enum`,value:[{value:`""`},{value:`"anonymous"`},{value:`"use-credentials"`}]}},alt:{defaultValue:null,description:`A description of the image.
|
|
3
3
|
This is recommended for accessibility purposes, specifically for users
|
|
4
4
|
of screen readers.
|
|
5
|
-
@example <Avatar src={...} alt="Foobar's profile" />`,name:`alt`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},
|
|
5
|
+
@example <Avatar src={...} alt="Foobar's profile" />`,name:`alt`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},src:{defaultValue:null,description:`The avatar image URL.
|
|
6
6
|
If not provided, the default placeholder image is used instead.`,name:`src`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},online:{defaultValue:{value:`false`},description:`Controls the status of the visual indicator.`,name:`online`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},size:{defaultValue:{value:`64`},description:``,name:`size`,required:!1,type:{name:`enum`,value:[{value:`"64"`},{value:`"96"`},{value:`"160"`},{value:`ResponsiveProp<AvatarWithStatusSize>`}]}}}}}catch{}}));export{C as n,S as t};
|
package/dist/assets/{AvatarWithStatus.stories-9MJ13xVu.js → AvatarWithStatus.stories-CxBQAt3x.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./AvatarWithStatus-
|
|
1
|
+
import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{t as r}from"./jsx-runtime-C2wGStra.js";import{n as i,t as a}from"./AvatarWithStatus-D02yNzQm.js";var o,s,c,l,u;t((()=>{e(n(),1),i(),o=r(),s={title:`components/AvatarWithStatus`,component:a},c=()=>(0,o.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,o.jsx)(a,{size:`64`,online:!0}),(0,o.jsx)(a,{size:`64`,online:!1})]}),l={parameters:{chromatic:{disableSnapshot:!0}},args:{size:`64`,src:`./assets/avatar-1.png`,online:!1,dataset:{qaid:`avatar-with-status`}},argTypes:{src:{control:`text`},dataset:{control:`object`},alt:{control:`text`},online:{control:`boolean`}}},c.parameters={...c.parameters,docs:{...c.parameters?.docs,source:{originalSource:`() => <div style={{
|
|
2
2
|
display: 'flex',
|
|
3
3
|
gap: '8px'
|
|
4
4
|
}}>
|