@preply/ds-docs 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{00.LayoutFlex.stories-Dxg48axa.js → 00.LayoutFlex.stories-CbDXxyuE.js} +1 -1
- package/dist/assets/{00.applications-CWPvzkb8.js → 00.applications-DrPcq5hf.js} +1 -1
- package/dist/assets/{00.favicons.guide-CioTS39P.js → 00.favicons.guide-BGlf-F09.js} +1 -1
- package/dist/assets/{00.token-explorer-Ms3A3gKw.js → 00.token-explorer-Bfc0792V.js} +1 -1
- package/dist/assets/{00.using-responsive-props-B4JXxb8B.js → 00.using-responsive-props-zAcJieHB.js} +1 -1
- package/dist/assets/{01.semantic-tokens-uwEK-alq.js → 01.semantic-tokens-Ccy3YqAg.js} +1 -1
- package/dist/assets/{01.using-shorthand-props-DVl924Oz.js → 01.using-shorthand-props-B0ANrFDR.js} +1 -1
- package/dist/assets/{10.Combinations.stories-BwVik25M.js → 10.Combinations.stories-CdNbC18z.js} +1 -1
- package/dist/assets/{10.fonts.guide-CPpSTBh5.js → 10.fonts.guide-kjxLDtt2.js} +1 -1
- package/dist/assets/{10.ssr-nIbsPyxs.js → 10.ssr-C85792Ym.js} +1 -1
- package/dist/assets/{11.languageFont.explorer-BnJaxOzB.js → 11.languageFont.explorer-C8B0RG10.js} +1 -1
- package/dist/assets/{11.ssr.app-router-D1RtbDN9.js → 11.ssr.app-router-DLGELGUU.js} +1 -1
- package/dist/assets/{20.libraries-DROERfkO.js → 20.libraries-BDQu_qts.js} +1 -1
- package/dist/assets/{30.icons.explorer-El51dKM_.js → 30.icons.explorer-Cs2BoR4M.js} +1 -1
- package/dist/assets/{30.storybook-DG4_FgeX.js → 30.storybook-Nx8Paw-6.js} +1 -1
- package/dist/assets/40.illustrations.explorer-WSD1rIjJ.js +21 -0
- package/dist/assets/{90.advanced-Bpafg85K.js → 90.advanced-DASg-ru6.js} +1 -1
- package/dist/assets/AlertDialog-Maq8_VU0.css +1 -0
- package/dist/assets/{AlertDialog.stories-DYP2Qbit.js → AlertDialog.stories-BzWTSIy8.js} +4 -4
- package/dist/assets/Avatar-DTmc5ZGN.css +1 -0
- package/dist/assets/Avatar-DncQXX7G.js +7 -0
- package/dist/assets/Avatar-ElTllycS.js +1 -0
- package/dist/assets/Avatar-l4k-u_Mp.css +1 -0
- package/dist/assets/{Avatar.stories-D7fst3_7.js → Avatar.stories-D15oouju.js} +1 -1
- package/dist/assets/AvatarWithStatus-CxEAGmUA.css +1 -0
- package/dist/assets/AvatarWithStatus.stories-DeWJ6ypF.js +42 -0
- package/dist/assets/Badge-j_a0acGK.css +1 -0
- package/dist/assets/{Badge.stories-DxY6VuVF.js → Badge.stories-CSQZXuAX.js} +1 -1
- package/dist/assets/Box-CjExCUkg.css +1 -0
- package/dist/assets/Box.stories-Vj0MUVA1.js +44 -0
- package/dist/assets/Button-BlwReLw5.js +20 -0
- package/dist/assets/Button-CB2hNkCw.css +1 -0
- package/dist/assets/Button-D7I5ig5h.js +1 -0
- package/dist/assets/Button-Do66hNtY.css +1 -0
- package/dist/assets/Button.stories-VxG3jfx5.js +252 -0
- package/dist/assets/ButtonBase-BCfmDQ_b.js +8 -0
- package/dist/assets/ButtonBase-C0CIM4Jh.css +1 -0
- package/dist/assets/Chips-DAK2so_G.css +1 -0
- package/dist/assets/{Chips.stories-B6Md1MMV.js → Chips.stories-3FQFAew8.js} +2 -2
- package/dist/assets/{Color-YHDXOIA2-4GAnzwWB.js → Color-YHDXOIA2-BYOU6QkC.js} +1 -1
- package/dist/assets/Dialog-DzqSHLus.css +1 -0
- package/dist/assets/{Dialog.stories-C7_Fdl3l.js → Dialog.stories-CjuVHAg6.js} +19 -19
- package/dist/assets/{DocsRenderer-CFRXHY34-DEKaLxr5.js → DocsRenderer-CFRXHY34-D1fchdBc.js} +1 -1
- package/dist/assets/FieldAdditionalText-BD8S7qnE.js +1 -0
- package/dist/assets/FieldAdditionalText-CuXtSnrq.css +1 -0
- package/dist/assets/{FieldAdditionalText.stories-BknKG7pn.js → FieldAdditionalText.stories-Bkm8WlSW.js} +1 -1
- package/dist/assets/FieldButton-D_5Zrlco.js +1 -0
- package/dist/assets/FieldButton-Picq604V.css +1 -0
- package/dist/assets/{FieldButton.stories-8phtWQab.js → FieldButton.stories-C33Mb60l.js} +1 -1
- package/dist/assets/FieldLayout-DHSEWaEL.js +1 -0
- package/dist/assets/FieldLayout-uwpycSl9.css +1 -0
- package/dist/assets/{FieldLayout.stories-TOLu2AYc.js → FieldLayout.stories-BNq7gZCI.js} +1 -1
- package/dist/assets/FieldLayoutBase-C_wbpu8u.css +1 -0
- package/dist/assets/FieldLayoutBase-xV81xRaV.js +12 -0
- package/dist/assets/Heading-Bj7LLgoH.js +2 -0
- package/dist/assets/Heading-C14zK0Nl.css +1 -0
- package/dist/assets/{Heading.stories-DVOG4eGs.js → Heading.stories-DUVgn-sr.js} +1 -1
- package/dist/assets/Icon-C3YgliEf.css +1 -0
- package/dist/assets/Icon-CBFs9hMA.js +1 -0
- package/dist/assets/Icon-D_HQx804.css +1 -0
- package/dist/assets/{Icon-RSC-BXbRnWp9.js → Icon-RSC-BuTFeAj0.js} +1 -1
- package/dist/assets/Icon-Wpz7-Jvg.js +8 -0
- package/dist/assets/{Icon.stories-DLdTr5b7.js → Icon.stories-DzUVuQaU.js} +1 -1
- package/dist/assets/IconButton-B7CxWK4j.js +8 -0
- package/dist/assets/InputText-m06Ec_iQ.js +5 -0
- package/dist/assets/{LayoutFlex-Bm8v-QkC.js → LayoutFlex-5ZDeW2G6.js} +1 -1
- package/dist/assets/{LayoutFlex-Cc1D09Ei.js → LayoutFlex-l6VPaSCi.js} +1 -1
- package/dist/assets/LayoutFlexItem-C4cPPR-1.css +1 -0
- package/dist/assets/LayoutFlexItem-DhCHigTj.js +1 -0
- package/dist/assets/LayoutGrid-CNwH06zf.js +1 -0
- package/dist/assets/LayoutGrid-Cm59X3OY.css +1 -0
- package/dist/assets/LayoutGrid-mQT2ikS8.css +1 -0
- package/dist/assets/LayoutGrid.stories-CJKRu44f.js +88 -0
- package/dist/assets/LayoutGridItem-BEFb1grO.css +1 -0
- package/dist/assets/LayoutGridItem-BYIEoI8K.js +1 -0
- package/dist/assets/Link-K5J3waqL.css +1 -0
- package/dist/assets/{Link.stories-EiMcdLab.js → Link.stories-DdA4w7Yi.js} +8 -7
- package/dist/assets/Loader-hjoeRutr.css +1 -0
- package/dist/assets/Loader.stories-DXv_QpEq.js +37 -0
- package/dist/assets/NumberField-BwQ_OX3b.css +1 -0
- package/dist/assets/NumberField.stories-B0au_GJa.js +203 -0
- package/dist/assets/OnboardingTooltip-CsmroJZe.css +1 -0
- package/dist/assets/{OnboardingTooltip-vUAo9ADZ.js → OnboardingTooltip-DkJtTrMv.js} +1 -1
- package/dist/assets/{OnboardingTooltip.stories-doNUnMe7.js → OnboardingTooltip.stories-CBEGxsdn.js} +1 -1
- package/dist/assets/{OnboardingTooltip.tests.stories-Bv3lHMu_.js → OnboardingTooltip.tests.stories-BVwCf3WX.js} +1 -1
- package/dist/assets/OnboardingTour-CiSAhOo4.js +4 -0
- package/dist/assets/OnboardingTour-D0hvRI8H.css +1 -0
- package/dist/assets/{OnboardingTour.stories-CoOA-ga5.js → OnboardingTour.stories-Ci2XQcpZ.js} +1 -1
- package/dist/assets/{OnboardingTour.tests.stories-Bi99nEGK.js → OnboardingTour.tests.stories-fpAsT8xG.js} +1 -1
- package/dist/assets/PasswordField-pNO2_I4U.css +1 -0
- package/dist/assets/{PasswordField.stories-DY5ogILG.js → PasswordField.stories-tMCP_-zS.js} +3 -3
- package/dist/assets/PreplyLogo-CTlTSEJp.css +1 -0
- package/dist/assets/PreplyLogo.stories-D-KuDEpf.js +98 -0
- package/dist/assets/ProgressBar-BmNYDQH3.css +1 -0
- package/dist/assets/{ProgressBar.stories-DQ2un511.js → ProgressBar.stories-RX3TC-Mj.js} +1 -1
- package/dist/assets/ProgressSteps-BdahNXrs.js +2 -0
- package/dist/assets/ProgressSteps-DOMtSbxl.css +1 -0
- package/dist/assets/{ProgressSteps.stories-CbxKZt-6.js → ProgressSteps.stories-BOqzHA8v.js} +1 -1
- package/dist/assets/RootProvider-F-KPwN7Y.js +1 -0
- package/dist/assets/SelectField-D3L7IkDZ.css +1 -0
- package/dist/assets/SelectField.stories-BiKwJ7cJ.js +182 -0
- package/dist/assets/Spinner-B2C3RkCF.js +1 -0
- package/dist/assets/Spinner-CzIq-Vt3.css +1 -0
- package/dist/assets/Steps-B_rpKUTa.css +1 -0
- package/dist/assets/Steps-cwath_9x.js +26 -0
- package/dist/assets/{Steps.stories-BhTfb1un.js → Steps.stories-BKq08-vN.js} +1 -1
- package/dist/assets/Text-BXZIkJPK.js +1 -0
- package/dist/assets/Text-BjBJEVRG.css +1 -0
- package/dist/assets/Text-CXoN02OL.js +1 -0
- package/dist/assets/Text-DWmJ-bA2.css +1 -0
- package/dist/assets/{Text.stories-CRxantTh.js → Text.stories--sqpLsAp.js} +1 -1
- package/dist/assets/TextField-BdRa6kYC.js +1 -0
- package/dist/assets/TextField-CpavA6nv.css +1 -0
- package/dist/assets/TextField-Drr2dczB.css +1 -0
- package/dist/assets/TextField.stories-Bclgc2EW.js +178 -0
- package/dist/assets/TextHighlighted-BnmI0H3i.css +1 -0
- package/dist/assets/TextHighlighted-UGbUAPIH.js +1 -0
- package/dist/assets/TextHighlighted-XaAzBaUc.css +1 -0
- package/dist/assets/TextHighlighted.stories-NdWGjEJo.js +32 -0
- package/dist/assets/TextInline-CztA0I1b.css +1 -0
- package/dist/assets/TextInline.stories-CUApO-7f.js +37 -0
- package/dist/assets/TextareaField-D7ErWnri.css +1 -0
- package/dist/assets/{TextareaField.stories-ZPt_wlMP.js → TextareaField.stories-DeszU8P5.js} +5 -5
- package/dist/assets/Toast-Bce4LWtf.css +1 -0
- package/dist/assets/{Toast.stories-DKkMHs-Q.js → Toast.stories-ddQWgL74.js} +9 -9
- package/dist/assets/Tooltip-Cm9bKrYj.css +1 -0
- package/dist/assets/{Tooltip-Ct-WqDpg.js → Tooltip-DfP6dW5t.js} +1 -1
- package/dist/assets/{Tooltip.stories-BWtp4p6F.js → Tooltip.stories-BFaVZ-KR.js} +1 -1
- package/dist/assets/{Tooltip.tests.stories-C2PZScD4.js → Tooltip.tests.stories-BdWpurqX.js} +1 -1
- package/dist/assets/{breakpoints-DrPPi6ob.js → breakpoints-DZrjMODJ.js} +1 -1
- package/dist/assets/{breakpoints-BHfQdcIJ.js → breakpoints-OMNEQfen.js} +1 -1
- package/dist/assets/{breakpoints-I4FAlX3-.js → breakpoints-nQG7mZUy.js} +1 -1
- package/dist/assets/{changelog-CHKnz4hf.js → changelog-DKkspQMC.js} +136 -124
- package/dist/assets/{entry-preview-CJqbxsdd.js → entry-preview-Di48KvWt.js} +1 -1
- package/dist/assets/{getTokenVar-BX_aqC-A.js → getTokenVar-CaVPbV9a.js} +1 -1
- package/dist/assets/{hover-BcoRLc18.js → hover-5sSVivzT.js} +1 -1
- package/dist/assets/{hover-Bn6tz5Uw.js → hover-CqG5MZbC.js} +1 -1
- package/dist/assets/{hover-DNMePSJs.js → hover-DcOblfBc.js} +1 -1
- package/dist/assets/{iframe-D0mvSgIL.js → iframe-C8qEtSwt.js} +2 -2
- package/dist/assets/{index-BsQc80lu.js → index-Ba1GaWBz.js} +3 -3
- package/dist/assets/{index-4X0Wd6c1.js → index-Cp5_iz39.js} +1 -1
- package/dist/assets/{intro-CBk5iAA3.js → intro-BsAuI9-C.js} +1 -1
- package/dist/assets/layout-relative-BGyAoF2N.css +1 -0
- package/dist/assets/layout-relative-BpJIh3YK.js +1 -0
- package/dist/assets/layout-relative-C4ATemga.css +1 -0
- package/dist/assets/layout-relative-DuJENdo5.css +1 -0
- package/dist/assets/layout-relative.module-1z75aSwo-DNAR_Nv2.js +1 -0
- package/dist/assets/layout-relative.module-ed9bC4H4.js +1 -0
- package/dist/assets/{migrating-from-less-T5R-NRLP.js → migrating-from-less-DIb86N4R.js} +1 -1
- package/dist/assets/playground-t-QHn_5x.css +1 -0
- package/dist/assets/{playground.stories-D2vZb5DU.js → playground.stories-CTz0xGuT.js} +111 -111
- package/dist/assets/{preview-DCKor9oC.js → preview-BOyk1pfY.js} +1 -1
- package/dist/assets/{preview-Vxjmr8F-.js → preview-CBMehSre.js} +1 -1
- package/dist/assets/{preview-BBPbRy6B.js → preview-DvauSVRq.js} +2 -2
- package/dist/assets/text-accent-CDvOoGdV.css +1 -0
- package/dist/assets/text-accent-CZD2Hmtq.js +1 -0
- package/dist/assets/text-accent-DZDDtpIt.js +1 -0
- package/dist/assets/text-accent-WDJkKazf.css +1 -0
- package/dist/assets/text-centered-Bk7GkK8R.js +1 -0
- package/dist/assets/text-centered-CznToR0o.js +1 -0
- package/dist/assets/text-centered-DN9XHxjM.css +1 -0
- package/dist/assets/text-centered-DxXu3Wfr.css +1 -0
- package/dist/assets/{tokens-D0BWg3AW.js → tokens-C4H21x5Y.js} +1 -1
- package/dist/assets/{tokens-BYJD7edf.js → tokens-DY9UJMme.js} +1 -1
- package/dist/assets/{tokens-ChcQAZih.js → tokens-bDgXZ1xi.js} +1 -1
- package/dist/assets/{usePortalElement-D8YB8wCj.js → usePortalElement-hM2pDsQq.js} +1 -1
- package/dist/assets/{welcome-mZ5KeQa-.js → welcome-DaVgjrPL.js} +1 -1
- package/dist/assets/{zeroheight-CLcZK6pE.js → zeroheight-D5Xa3jWw.js} +1 -1
- package/dist/iframe.html +1 -1
- package/dist/index.json +1 -1
- package/dist/preview-stats.json +1634 -1631
- package/dist/project.json +1 -1
- package/package.json +3 -3
- package/vite.config.ts +10 -0
- package/dist/assets/40.illustrations.explorer-BZO-_C_S.js +0 -21
- package/dist/assets/AlertDialog-C9BEjgkE.css +0 -1
- package/dist/assets/Avatar-DKsRQl4B.js +0 -6
- package/dist/assets/Avatar-HtycGal7.js +0 -1
- package/dist/assets/Avatar-L-715hiR.css +0 -1
- package/dist/assets/Avatar-M4k3pOBX.css +0 -1
- package/dist/assets/AvatarWithStatus-Dz0rSSHl.css +0 -1
- package/dist/assets/AvatarWithStatus.stories-NWE-3XEL.js +0 -41
- package/dist/assets/Badge-Ar4YZCqB.css +0 -1
- package/dist/assets/Box-D1WAKfTQ.css +0 -1
- package/dist/assets/Box.stories-DFh_1cIr.js +0 -44
- package/dist/assets/Button-BOyl6fPv.js +0 -20
- package/dist/assets/Button-BwBS3oEP.css +0 -1
- package/dist/assets/Button-DTjBNg_z.js +0 -1
- package/dist/assets/Button-P9yXDdEf.css +0 -1
- package/dist/assets/Button.stories-H01CJnTv.js +0 -211
- package/dist/assets/ButtonBase-CndTGqQQ.js +0 -8
- package/dist/assets/ButtonBase-Ddw6v5fn.css +0 -1
- package/dist/assets/Chips-CpylpY14.css +0 -1
- package/dist/assets/Dialog-CNTXsWOb.css +0 -1
- package/dist/assets/FieldAdditionalText-BbXsXR5V.js +0 -1
- package/dist/assets/FieldAdditionalText-DbuNvJBg.css +0 -1
- package/dist/assets/FieldButton-BJQKm6jT.css +0 -1
- package/dist/assets/FieldButton-CLS4hZRO.js +0 -1
- package/dist/assets/FieldLayout-DYbPQFAW.css +0 -1
- package/dist/assets/FieldLayout-nD5R7atd.js +0 -1
- package/dist/assets/FieldLayoutBase-B_B5-cjL.css +0 -1
- package/dist/assets/FieldLayoutBase-Ri_bjseH.js +0 -12
- package/dist/assets/Heading-BIzxWDA5.js +0 -2
- package/dist/assets/Heading-DLvxlILX.css +0 -1
- package/dist/assets/Icon-BmtvHdpX.js +0 -8
- package/dist/assets/Icon-BqDOhmd9.js +0 -1
- package/dist/assets/Icon-CQT2GKoH.css +0 -1
- package/dist/assets/Icon-CXX0nf3D.css +0 -1
- package/dist/assets/IconButton-LF952PfZ.js +0 -8
- package/dist/assets/InputText-Dtc7LpKa.js +0 -5
- package/dist/assets/LayoutFlexItem-BYTRwx_X.css +0 -1
- package/dist/assets/LayoutFlexItem-C_JBzaw-.js +0 -1
- package/dist/assets/LayoutGrid-DFWk8NB8.css +0 -1
- package/dist/assets/LayoutGrid-IDkxjZN1.js +0 -1
- package/dist/assets/LayoutGrid-L_40ixqn.css +0 -1
- package/dist/assets/LayoutGrid.stories-DPmEZkN1.js +0 -88
- package/dist/assets/LayoutGridItem-DvV7NvZa.js +0 -1
- package/dist/assets/LayoutGridItem-DwNHNpvD.css +0 -1
- package/dist/assets/Link-xQTG6qM6.css +0 -1
- package/dist/assets/Loader-BasFj5cB.css +0 -1
- package/dist/assets/Loader.stories-C9NOJXU_.js +0 -37
- package/dist/assets/NumberField-C0w7Zzcx.css +0 -1
- package/dist/assets/NumberField.stories-DpEWh-dT.js +0 -203
- package/dist/assets/OnboardingTooltip-BUE-a7PJ.css +0 -1
- package/dist/assets/OnboardingTour-BJaUVtET.css +0 -1
- package/dist/assets/OnboardingTour-i4oFa3CL.js +0 -4
- package/dist/assets/PasswordField-CW55DLIa.css +0 -1
- package/dist/assets/PreplyLogo-D50rvD8_.css +0 -1
- package/dist/assets/PreplyLogo.stories-D2YUc7Xm.js +0 -97
- package/dist/assets/ProgressBar-BoL6q8Gm.css +0 -1
- package/dist/assets/ProgressSteps-CSu6U8Oh.js +0 -2
- package/dist/assets/ProgressSteps-oRv75ID6.css +0 -1
- package/dist/assets/RootProvider-BgscvpVs.js +0 -1
- package/dist/assets/SelectField-DdoXEWJk.css +0 -1
- package/dist/assets/SelectField.stories-DXrTFOq5.js +0 -182
- package/dist/assets/Spinner-WkRCqqWl.css +0 -1
- package/dist/assets/Spinner-Yzq6CWfu.js +0 -1
- package/dist/assets/Steps-Cm49GD2O.css +0 -1
- package/dist/assets/Steps-Drw_J1pN.js +0 -26
- package/dist/assets/Text-BbTAW1HU.js +0 -1
- package/dist/assets/Text-V4TRyvtW.js +0 -1
- package/dist/assets/Text-rF1Oi742.css +0 -1
- package/dist/assets/TextField-BzR--15O.js +0 -1
- package/dist/assets/TextField-DYLqe3tJ.css +0 -1
- package/dist/assets/TextField-DnBkywp4.css +0 -1
- package/dist/assets/TextField.stories-B6ZiRnD3.js +0 -178
- package/dist/assets/TextHighlighted-Be3VqoqU.js +0 -1
- package/dist/assets/TextHighlighted-ctAnMXHo.css +0 -1
- package/dist/assets/TextHighlighted.stories-Ccl1UgGr.js +0 -32
- package/dist/assets/TextInline-zyBsYqm3.css +0 -1
- package/dist/assets/TextInline.stories-DjHRpfFb.js +0 -37
- package/dist/assets/TextareaField-CZ8v7yuT.css +0 -1
- package/dist/assets/Toast-9YYei-H6.css +0 -1
- package/dist/assets/Tooltip-CEXdeSMx.css +0 -1
- package/dist/assets/layout-relative-Bqi-eQr9.css +0 -1
- package/dist/assets/layout-relative-Brg7nCBe.css +0 -1
- package/dist/assets/layout-relative-D1P2Swpw.css +0 -1
- package/dist/assets/layout-relative-DFrOiWAE.js +0 -1
- package/dist/assets/layout-relative.module-BhIMNlTS-HdwEQarE.js +0 -1
- package/dist/assets/layout-relative.module-CDUOJ19G.js +0 -1
- package/dist/assets/playground-pPNOw9Oj.css +0 -1
- package/dist/assets/text-accent-BbDxH1tz.css +0 -1
- package/dist/assets/text-accent-C7pEavfl.js +0 -1
- package/dist/assets/text-accent-Pc_gtAUU.js +0 -1
- package/dist/assets/text-centered-Bf8j8BI4.js +0 -1
- package/dist/assets/text-centered-BsBBnlcu.css +0 -1
- package/dist/assets/text-centered-CCAvmLGC.css +0 -1
- package/dist/assets/text-centered-CEVxj3Ji.js +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{T as
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{T as n}from"./Text-BXZIkJPK.js";import{r as k}from"./index-Cb9e4tly.js";import{f as Q}from"./filterHTMLAttributes-DYdLqcvH.js";import{g as Z}from"./defaults-B1rzzf6M.js";import{u as ee}from"./useHostname-Y3PlXofY.js";import{m as ae,s as f,b as x}from"./classNames-BUL1Zq7e.js";import{w as y}from"./componentNames-Bwls0I02.js";import{a as ne,g as te}from"./index-DdzHuZ-Y.js";import{g as d}from"./getTokenVar-DU_DEzTd.js";import{c as u}from"./tokens-Di5DrZN4.js";import"./index-ChsGqxH_.js";import"./text-accent-DZDDtpIt.js";import"./text-centered-CznToR0o.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./constants-BgBLeZzp.js";const re="Link__Jw0hc",ie={Link:re,"Link--inline":"Link--inline__aWJxC","Link--noUnderline":"Link--noUnderline__vuCBO","Link--variant-accentDark":"Link--variant-accentDark__5RCSd","Link--variant-accentDark--dsInternalSimulation-hover":"Link--variant-accentDark--dsInternalSimulation-hover__5vv1U","Link--variant-accentDark--dsInternalSimulation-active":"Link--variant-accentDark--dsInternalSimulation-active__-PYgd","Link--variant-accentDarkInverted":"Link--variant-accentDarkInverted__5GVfk","Link--variant-accentDarkInverted--dsInternalSimulation-hover":"Link--variant-accentDarkInverted--dsInternalSimulation-hover__u7g4B","Link--variant-accentDarkInverted--dsInternalSimulation-active":"Link--variant-accentDarkInverted--dsInternalSimulation-active__4bGgk","Link--variant-neutral":"Link--variant-neutral__v0PFp","Link--variant-neutral--dsInternalSimulation-hover":"Link--variant-neutral--dsInternalSimulation-hover__L-hBv","Link--variant-neutral--dsInternalSimulation-active":"Link--variant-neutral--dsInternalSimulation-active__5rs0z","Link--variant-neutralInverted":"Link--variant-neutralInverted__t9Ijl","Link--variant-neutralInverted--dsInternalSimulation-hover":"Link--variant-neutralInverted--dsInternalSimulation-hover__H50Xt","Link--variant-neutralInverted--dsInternalSimulation-active":"Link--variant-neutralInverted--dsInternalSimulation-active__Irr0h","Link--variant-unsetColors":"Link--variant-unsetColors__EEbF5","Link--variant-unsetColors--dsInternalSimulation-hover":"Link--variant-unsetColors--dsInternalSimulation-hover__vMIu6","Link--variant-unsetColors--dsInternalSimulation-active":"Link--variant-unsetColors--dsInternalSimulation-active__wlGTN"},a=k.forwardRef(function(E,P){const{variant:v=Z,href:A,download:H,opensInNewTab:R,nofollow:M,assistiveText:O,onClick:B,as:p,url:F,dataset:G,children:m,inline:J,dsInternalSimulation:z,noUnderline:W,...X}=E,$=ee(),K=ae(ie,y.Link,[f(`variant-${v}--dsInternalSimulation`,z),f("variant",v),x("inline",void 0,J),x("noUnderline",void 0,W)]),c=A||F,Y=c?ne($,c,R,M):{},h={...Q(X),ref:P,href:c,download:H,"aria-label":O,onClick:B,className:K.join(" "),...te(G,{preplyDsComponent:y.Link})};return p?k.cloneElement(p,{...h},m):e.jsx("a",{...h,...Y,children:m})});try{a.displayName="Link",a.__docgenInfo={description:`This is an inline element and will inherit font-size, line-height and
|
|
2
2
|
font-weight from the parent context. If you need to customise any of these
|
|
3
3
|
styles, all you have to do is wrap the <Link> in a Text or TextInline
|
|
4
|
-
component.`,displayName:"Link",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"accentDark"'},{value:'"
|
|
4
|
+
component.`,displayName:"Link",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"accentDark"'},{value:'"neutral"'},{value:'"accentDarkInverted"'},{value:'"neutralInverted"'},{value:'"unsetColors"'}]}},href:{defaultValue:null,description:"",name:"href",required:!1,type:{name:"enum",value:[{value:"string"}]}},download:{defaultValue:null,description:`When provided, instructs the browser to download the target (the file
|
|
5
5
|
specified in the href attribute) when a user clicks on the hyperlink,
|
|
6
6
|
rather than display it in the browser.`,name:"download",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},opensInNewTab:{defaultValue:null,description:"If `true`, forces internal link to open in a new tab.",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"}]}},assistiveText:{defaultValue:null,description:"Provide an `aria-label` to the link.\nThis is useful if the link wraps non-textual elements, eg. an `img`.",name:"assistiveText",required:!1,type:{name:"enum",value:[{value:"string"}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler<Element>"}]}},as:{defaultValue:null,description:"",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"}]}},dataset:{defaultValue:null,description:`Provide dataset to set data attributes on the DOM element for the purpose
|
|
7
|
-
of e2e tests or integrating with external libraries
|
|
7
|
+
of e2e tests or integrating with external libraries.
|
|
8
|
+
@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"}]}},inline:{defaultValue:null,description:"If `true`, allows the link to wrap within text.",name:"inline",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},noUnderline:{defaultValue:null,description:"",name:"noUnderline",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | null) => void"},{value:"RefObject<HTMLAnchorElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const Ie={title:"components/Link",component:a},r=()=>{const t=d(u.background.primaryInverted);return e.jsxs("div",{style:{display:"flex",gap:"16px"},children:[e.jsx(a,{href:"https://preply.com",variant:"neutral",children:"neutral"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"neutralInverted",children:"neutralInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"accentDark",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"accentDarkInverted",children:"accentDarkInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"unsetColors",children:"unsetColors"})]})},i=()=>{const t=d(u.background.primaryInverted);return e.jsxs("div",{style:{display:"flex",gap:"16px",flexDirection:"column"},children:[e.jsx(n,{variant:"default-regular-italic",children:"(use the `unsetColors` variant)"}),e.jsxs("div",{children:[e.jsx(n,{variant:"large-semibold-italic",children:"primary"}),e.jsx(n,{variant:"default-regular-italic",children:"normal"}),e.jsxs(n,{accent:"primary",children:["Lorem ipsum ",e.jsx(a,{variant:"unsetColors",children:"dolor sit amet"})," amet."]}),e.jsx(n,{variant:"default-regular-italic",children:"active"}),e.jsxs(n,{accent:"primary",children:["Lorem ipsum"," ",e.jsx(a,{variant:"unsetColors",dsInternalSimulation:"active",children:"dolor sit amet"})," ","amet."]})]}),e.jsxs("div",{style:{backgroundColor:t},children:[e.jsx(n,{variant:"large-semibold-italic",accent:"inverted",children:"inverted"}),e.jsx(n,{variant:"default-regular-italic",accent:"inverted",children:"normal"}),e.jsxs(n,{accent:"inverted",children:["Lorem ipsum ",e.jsx(a,{variant:"unsetColors",children:"dolor sit amet"})," amet."]}),e.jsx(n,{variant:"default-regular-italic",accent:"inverted",children:"active"}),e.jsxs(n,{accent:"inverted",children:["Lorem ipsum"," ",e.jsx(a,{variant:"unsetColors",dsInternalSimulation:"active",children:"dolor sit amet"})," ","amet."]})]}),e.jsxs("div",{children:[e.jsx(n,{variant:"large-semibold-italic",children:"positive"}),e.jsx(n,{variant:"default-regular-italic",children:"normal"}),e.jsxs(n,{accent:"positive",children:["Lorem ipsum ",e.jsx(a,{variant:"unsetColors",children:"dolor sit amet"})," amet."]}),e.jsx(n,{variant:"default-regular-italic",children:"active"}),e.jsxs(n,{accent:"positive",children:["Lorem ipsum"," ",e.jsx(a,{variant:"unsetColors",dsInternalSimulation:"active",children:"dolor sit amet"})," ","amet."]})]}),e.jsxs("div",{children:[e.jsx(n,{variant:"large-semibold-italic",children:"critical"}),e.jsx(n,{variant:"default-regular-italic",children:"normal"}),e.jsxs(n,{accent:"critical",children:["Lorem ipsum ",e.jsx(a,{variant:"unsetColors",children:"dolor sit amet"})," amet."]}),e.jsx(n,{variant:"default-regular-italic",children:"active"}),e.jsxs(n,{accent:"critical",children:["Lorem ipsum"," ",e.jsx(a,{variant:"unsetColors",dsInternalSimulation:"active",children:"dolor sit amet"})," ","amet."]})]})]})},l=()=>{const t=d(u.background.primaryInverted);return e.jsxs("div",{style:{display:"flex",gap:"16px",flexDirection:"column"},children:[e.jsx(n,{variant:"default-regular-italic",children:"normal"}),e.jsxs("div",{style:{display:"flex",gap:"16px"},children:[e.jsx(a,{href:"https://preply.com",variant:"neutral",children:"neutral"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"neutralInverted",children:"neutralInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"accentDark",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"accentDarkInverted",children:"accentDarkInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"unsetColors",children:"unsetColors"})]}),e.jsx(n,{variant:"default-regular-italic",children:"hover"}),e.jsxs("div",{style:{display:"flex",gap:"16px"},children:[e.jsx(a,{href:"https://preply.com",variant:"neutral",dsInternalSimulation:"hover",children:"neutral"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"neutralInverted",dsInternalSimulation:"hover",children:"neutralInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"accentDark",dsInternalSimulation:"hover",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"accentDarkInverted",dsInternalSimulation:"hover",children:"accentDarkInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"unsetColors",dsInternalSimulation:"hover",children:"unsetColors"})]}),e.jsx(n,{variant:"default-regular-italic",children:"active"}),e.jsxs("div",{style:{display:"flex",gap:"16px"},children:[e.jsx(a,{href:"https://preply.com",variant:"neutral",dsInternalSimulation:"active",children:"neutral"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"neutralInverted",dsInternalSimulation:"active",children:"neutralInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"accentDark",dsInternalSimulation:"active",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:t},children:e.jsx(a,{href:"https://preply.com",variant:"accentDarkInverted",dsInternalSimulation:"active",children:"accentDarkInverted"})}),e.jsx(a,{href:"https://preply.com",variant:"unsetColors",dsInternalSimulation:"active",children:"unsetColors"})]})]})},s=()=>e.jsxs("p",{style:{width:"12ch"},children:["Unlock your potential;"," ",e.jsx(a,{href:"https://preply.com",variant:"unsetColors",inline:!0,children:"visit Preply"}),"."]}),o={parameters:{chromatic:{disableSnapshot:!0}},args:{children:"Click me",href:"https://preply.com",variant:"neutral",dataset:{qaid:"link"}},argTypes:{dataset:{control:"object"},inline:{control:"boolean"},noUnderline:{control:"boolean"},opensInNewTab:{control:"boolean"},nofollow:{control:"boolean"},download:{control:"boolean"},assistiveText:{control:"text"},href:{control:"text"},url:{table:{disable:!0}}}};var g,L,I;r.parameters={...r.parameters,docs:{...(g=r.parameters)==null?void 0:g.docs,source:{originalSource:`() => {
|
|
8
9
|
const grey = getTokenVar(color.background.primaryInverted);
|
|
9
10
|
return <div style={{
|
|
10
11
|
display: 'flex',
|
|
@@ -119,7 +120,7 @@ of e2e tests or integrating with external libraries.`,name:"dataset",required:!1
|
|
|
119
120
|
</Text>
|
|
120
121
|
</div>
|
|
121
122
|
</div>;
|
|
122
|
-
}`,...(C=(T=i.parameters)==null?void 0:T.docs)==null?void 0:C.source}}};var b,
|
|
123
|
+
}`,...(C=(T=i.parameters)==null?void 0:T.docs)==null?void 0:C.source}}};var b,S,D;l.parameters={...l.parameters,docs:{...(b=l.parameters)==null?void 0:b.docs,source:{originalSource:`() => {
|
|
123
124
|
const grey = getTokenVar(color.background.primaryInverted);
|
|
124
125
|
return <div style={{
|
|
125
126
|
display: 'flex',
|
|
@@ -214,7 +215,7 @@ of e2e tests or integrating with external libraries.`,name:"dataset",required:!1
|
|
|
214
215
|
</Link>
|
|
215
216
|
</div>
|
|
216
217
|
</div>;
|
|
217
|
-
}`,...(
|
|
218
|
+
}`,...(D=(S=l.parameters)==null?void 0:S.docs)==null?void 0:D.source}}};var _,w,V;s.parameters={...s.parameters,docs:{...(_=s.parameters)==null?void 0:_.docs,source:{originalSource:`() => <p style={{
|
|
218
219
|
width: '12ch'
|
|
219
220
|
}}>
|
|
220
221
|
Unlock your potential;{' '}
|
|
@@ -222,7 +223,7 @@ of e2e tests or integrating with external libraries.`,name:"dataset",required:!1
|
|
|
222
223
|
visit Preply
|
|
223
224
|
</Link>
|
|
224
225
|
.
|
|
225
|
-
</p>`,...(
|
|
226
|
+
</p>`,...(V=(w=s.parameters)==null?void 0:w.docs)==null?void 0:V.source}}};var q,N,U;o.parameters={...o.parameters,docs:{...(q=o.parameters)==null?void 0:q.docs,source:{originalSource:`{
|
|
226
227
|
parameters: {
|
|
227
228
|
chromatic: {
|
|
228
229
|
disableSnapshot: true
|
|
@@ -268,4 +269,4 @@ of e2e tests or integrating with external libraries.`,name:"dataset",required:!1
|
|
|
268
269
|
}
|
|
269
270
|
}
|
|
270
271
|
}
|
|
271
|
-
}`,...(U=(N=
|
|
272
|
+
}`,...(U=(N=o.parameters)==null?void 0:N.docs)==null?void 0:U.source}}};const je=["Variants","TextVariants","States","Inline","Playground"];export{s as Inline,o as Playground,l as States,i as TextVariants,r as Variants,je as __namedExportsOrder,Ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Loader__Ya6Xk{display:inline-flex;width:fit-content;height:fit-content}.Loader--normal__41Xzt{color:var(--19bcb6)}.Loader--inverted__NULSk{color:var(--38413d)}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as h}from"./index-Cb9e4tly.js";import{f as z}from"./filterHTMLAttributes-DYdLqcvH.js";import{S as j}from"./Spinner-B2C3RkCF.js";import{m as k,b as N}from"./classNames-BUL1Zq7e.js";import{w as l}from"./componentNames-Bwls0I02.js";import{g as C}from"./index-DdzHuZ-Y.js";import{S as E}from"./consts-KAYct7Gj.js";import{g as R}from"./getTokenVar-DU_DEzTd.js";import{c as T}from"./tokens-Di5DrZN4.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./defaults-B1rzzf6M.js";import"./constants-BgBLeZzp.js";const V="Loader__Ya6Xk",q={Loader:V,"Loader--normal":"Loader--normal__41Xzt","Loader--inverted":"Loader--inverted__NULSk"},a=h.forwardRef(function({size:t,inverted:y=!1,dataset:L,...b},S){const _=k(q,l.Loader,[N("inverted","normal",y)]),x={...z(b),ref:S,className:_.join(" "),...C(L,{preplyDsComponent:l.Loader})};return e.jsx("span",{...x,children:e.jsx(j,{size:t})})});try{a.displayName="Loader",a.__docgenInfo={description:"",displayName:"Loader",props:{size:{defaultValue:null,description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"large"'},{value:'"default"'},{value:"ResponsiveProp<SpinnerSize>"}]}},inverted:{defaultValue:{value:"false"},description:"",name:"inverted",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLSpanElement | null) => void"},{value:"RefObject<HTMLSpanElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const G={title:"components/Loader",component:a,argTypes:{size:{description:E}}},o=()=>e.jsxs("div",{style:{display:"flex",alignItems:"end",gap:"8px"},children:[e.jsx(a,{size:"default"}),e.jsx(a,{size:"large"})]}),n=()=>e.jsx(a,{inverted:!0});n.decorators=[r=>{const t=R(T.background.primaryInverted);return e.jsx("div",{style:{backgroundColor:t},children:r()})}];const s={parameters:{chromatic:{disableSnapshot:!0}},decorators:[(r,{args:t})=>e.jsx("div",{style:{backgroundColor:t.inverted?"black":void 0},children:r()})],args:{size:"default",inverted:!1,dataset:{qaid:"loader"}},argTypes:{dataset:{control:"object"},size:{control:"select"},inverted:{control:"boolean"}}};var d,i,c;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => <div style={{
|
|
2
|
+
display: 'flex',
|
|
3
|
+
alignItems: 'end',
|
|
4
|
+
gap: '8px'
|
|
5
|
+
}}>
|
|
6
|
+
<Loader size="default" />
|
|
7
|
+
<Loader size="large" />
|
|
8
|
+
</div>`,...(c=(i=o.parameters)==null?void 0:i.docs)==null?void 0:c.source}}};var u,m,p;n.parameters={...n.parameters,docs:{...(u=n.parameters)==null?void 0:u.docs,source:{originalSource:"() => <Loader inverted />",...(p=(m=n.parameters)==null?void 0:m.docs)==null?void 0:p.source}}};var f,v,g;s.parameters={...s.parameters,docs:{...(f=s.parameters)==null?void 0:f.docs,source:{originalSource:`{
|
|
9
|
+
parameters: {
|
|
10
|
+
chromatic: {
|
|
11
|
+
disableSnapshot: true
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
decorators: [(story, {
|
|
15
|
+
args
|
|
16
|
+
}) => <div style={{
|
|
17
|
+
backgroundColor: args.inverted ? 'black' : undefined
|
|
18
|
+
}}>{story()}</div>],
|
|
19
|
+
args: {
|
|
20
|
+
size: 'default',
|
|
21
|
+
inverted: false,
|
|
22
|
+
dataset: {
|
|
23
|
+
qaid: 'loader'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
dataset: {
|
|
28
|
+
control: 'object'
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
control: 'select'
|
|
32
|
+
},
|
|
33
|
+
inverted: {
|
|
34
|
+
control: 'boolean'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}`,...(g=(v=s.parameters)==null?void 0:v.docs)==null?void 0:g.source}}};const J=["Sizes","Inverted","Playground"];export{n as Inverted,s as Playground,o as Sizes,J as __namedExportsOrder,G as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.NumberField__BbKr0{display:flex}.NumberField__BbKr0 input::-webkit-outer-spin-button,.NumberField__BbKr0 input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.NumberField__BbKr0 input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as s}from"./index-Cb9e4tly.js";import{a as u}from"./chunk-D5ZWXAHU-BhFjjRSl.js";import{e as S,u as xe,w as qe}from"./index-BVDq5o4N.js";import{F as Ee}from"./TokyoUIPhone-CvuBM6jb.js";import{B as R}from"./Button-BlwReLw5.js";import{I as we}from"./Icon-Wpz7-Jvg.js";import{F as He}from"./FieldLayout-DHSEWaEL.js";import{u as Se,I as Fe,s as Ne}from"./FieldLayoutBase-xV81xRaV.js";import{m as Ie}from"./classNames-BUL1Zq7e.js";import{w as m}from"./componentNames-Bwls0I02.js";import{u as Te}from"./useForcedRef--iGFM41p.js";import{u as Re}from"./useNumberField-AJNQGstL.js";import{T as ke}from"./Text-BXZIkJPK.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./v4-CtRu48qb.js";import"./render-icon-BT0Aq7PA.js";import"./ButtonBase-BCfmDQ_b.js";import"./Spinner-B2C3RkCF.js";import"./defaults-B1rzzf6M.js";import"./filterHTMLAttributes-DYdLqcvH.js";import"./useHostname-Y3PlXofY.js";import"./index-DdzHuZ-Y.js";import"./index-CC6DAVyL.js";import"./text-accent-DZDDtpIt.js";import"./FieldAdditionalText-BD8S7qnE.js";import"./constants-DL6gdbsq.js";import"./index-D1pfvbUR.js";import"./tslib.es6-BntfKcQG.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./message-B1DLZQ1U.js";import"./text-centered-CznToR0o.js";const Be=({onChange:e,onValueChange:a,...n},r)=>{const i=Ie(Ne,m.InputNumber),d=Se(o=>o.target.value?Number(o.target.value):void 0,e,a);return t.jsx(Fe,{...n,type:"number",ref:r,className:i.join(" "),onChange:d,preplyDsComponent:m.InputNumber})},N=s.forwardRef(Be);try{N.displayName="InputNumber",N.__docgenInfo={description:"",displayName:"InputNumber",props:{onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler<Element>"}]}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},placeholder:{defaultValue:null,description:"",name:"placeholder",required:!1,type:{name:"enum",value:[{value:"string"}]}},id:{defaultValue:null,description:"",name:"id",required:!0,type:{name:"string"}},required:{defaultValue:null,description:"",name:"required",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},hasError:{defaultValue:null,description:"",name:"hasError",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},"aria-describedby":{defaultValue:null,description:`Identifies the element (or elements) that describes the object.
|
|
2
|
+
@see aria-labelledby`,name:"aria-describedby",required:!1,type:{name:"enum",value:[{value:"string"}]}},"aria-disabled":{defaultValue:null,description:`Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
|
|
3
|
+
@see aria-hidden
|
|
4
|
+
@see aria-readonly.`,name:"aria-disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:'"true"'},{value:'"false"'}]}},"aria-invalid":{defaultValue:null,description:`Indicates the entered value does not conform to the format expected by the application.
|
|
5
|
+
@see aria-errormessage.`,name:"aria-invalid",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:'"true"'},{value:'"false"'},{value:'"grammar"'},{value:'"spelling"'}]}},"aria-required":{defaultValue:null,description:"Indicates that user input is required on the element before a form may be submitted.",name:"aria-required",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:'"true"'},{value:'"false"'}]}},maxLength:{defaultValue:null,description:"",name:"maxLength",required:!1,type:{name:"enum",value:[{value:"number"}]}},name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"enum",value:[{value:"string"}]}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"enum",value:[{value:"ChangeEventHandler<Element>"}]}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"enum",value:[{value:"FocusEventHandler<Element>"}]}},onBlur:{defaultValue:null,description:"",name:"onBlur",required:!1,type:{name:"enum",value:[{value:"FocusEventHandler<Element>"}]}},onKeyDown:{defaultValue:null,description:"",name:"onKeyDown",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler<Element>"}]}},onKeyUp:{defaultValue:null,description:"",name:"onKeyUp",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler<Element>"}]}},onCopy:{defaultValue:null,description:"",name:"onCopy",required:!1,type:{name:"enum",value:[{value:"ClipboardEventHandler<Element>"}]}},onPaste:{defaultValue:null,description:"",name:"onPaste",required:!1,type:{name:"enum",value:[{value:"ClipboardEventHandler<Element>"}]}},readOnly:{defaultValue:null,description:"",name:"readOnly",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"enum",value:[{value:"number"}]}},min:{defaultValue:null,description:"",name:"min",required:!1,type:{name:"enum",value:[{value:"number"}]}},max:{defaultValue:null,description:"",name:"max",required:!1,type:{name:"enum",value:[{value:"number"}]}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"enum",value:[{value:"number"}]}},onValueChange:{defaultValue:null,description:"",name:"onValueChange",required:!1,type:{name:"enum",value:[{value:"ValueChangeEventHandler<number | undefined>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: InputImperativeHandle | null) => void"},{value:"RefObject<InputImperativeHandle>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const je="NumberField__BbKr0",Pe={NumberField:je},Le=({id:e,...a},n)=>{const r=s.useRef(null),i=Te();s.useImperativeHandle(n,()=>({setFocus:()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.setFocus()},scrollIntoView:()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.scrollIntoView()}}));const d=Re({id:e,...a},m.NumberField),{layoutProps:o,inputProps:F}=d,l=Ie(Pe,m.NumberField),Ce=t.jsx(N,{...F,ref:i});return t.jsx(He,{...o,className:l.join(" "),input:Ce,inputHandle:i.current,ref:r,preplyDsComponent:m.NumberField})},p=s.forwardRef(Le);try{p.displayName="NumberField",p.__docgenInfo={description:"By default, this field acts as a controlled field and expects the parent\ncomponent to manage the state, by reacting to user input via the `onChange` or\n`onValueChange` props, and providing the latest state via the `value` prop.\n\nAlternatively, you can use it as an uncontrolled field using the\n`defaultValue` prop instead of the `value` prop.",displayName:"NumberField",props:{id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"enum",value:[{value:"string"}]}},label:{defaultValue:null,description:"The field label. This is needed for accessibility purposes, but can be\nhidden using the `hideLabel` prop.",name:"label",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"}]}},requiredLabel:{defaultValue:null,description:"",name:"requiredLabel",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"}]}},hideLabel:{defaultValue:null,description:"Use this to hide the `label` visually, but keep it in the accessibility\ntree.",name:"hideLabel",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},wrapLabel:{defaultValue:null,description:"",name:"wrapLabel",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},additionalText:{defaultValue:null,description:"",name:"additionalText",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"}]}},preserveSpace:{defaultValue:null,description:"",name:"preserveSpace",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},hasError:{defaultValue:null,description:"",name:"hasError",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},errorMessage:{defaultValue:null,description:"",name:"errorMessage",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"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},inputDataset:{defaultValue:null,description:"",name:"inputDataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler<Element>"}]}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},placeholder:{defaultValue:null,description:"",name:"placeholder",required:!1,type:{name:"enum",value:[{value:"string"}]}},required:{defaultValue:null,description:"",name:"required",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},maxLength:{defaultValue:null,description:"",name:"maxLength",required:!1,type:{name:"enum",value:[{value:"number"}]}},name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"enum",value:[{value:"string"}]}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"enum",value:[{value:"number"}]}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"enum",value:[{value:"number"}]}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"enum",value:[{value:"ChangeEventHandler<Element>"}]}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"enum",value:[{value:"FocusEventHandler<Element>"}]}},onBlur:{defaultValue:null,description:"",name:"onBlur",required:!1,type:{name:"enum",value:[{value:"FocusEventHandler<Element>"}]}},onKeyDown:{defaultValue:null,description:"",name:"onKeyDown",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler<Element>"}]}},onKeyUp:{defaultValue:null,description:"",name:"onKeyUp",required:!1,type:{name:"enum",value:[{value:"KeyboardEventHandler<Element>"}]}},onCopy:{defaultValue:null,description:"",name:"onCopy",required:!1,type:{name:"enum",value:[{value:"ClipboardEventHandler<Element>"}]}},onPaste:{defaultValue:null,description:"",name:"onPaste",required:!1,type:{name:"enum",value:[{value:"ClipboardEventHandler<Element>"}]}},readOnly:{defaultValue:null,description:"",name:"readOnly",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},onValueChange:{defaultValue:null,description:"",name:"onValueChange",required:!1,type:{name:"enum",value:[{value:"ValueChangeEventHandler<number | undefined>"}]}},min:{defaultValue:null,description:"",name:"min",required:!1,type:{name:"enum",value:[{value:"number"}]}},max:{defaultValue:null,description:"",name:"max",required:!1,type:{name:"enum",value:[{value:"number"}]}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"enum",value:[{value:"ReactElement<IconProps, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: InputImperativeHandle | null) => void"},{value:"RefObject<InputImperativeHandle>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const ha={title:"components/NumberField",component:p,args:{label:"Number",placeholder:"Enter a number",inputDataset:{testid:"input"},onChange:u("onChange"),onBlur:u("onBlur"),onFocus:u("onFocus"),onClick:u("onClick"),onCopy:u("onCopy"),onKeyDown:u("onKeyDown"),onKeyUp:u("onKeyUp"),onPaste:u("onPaste"),onValueChange:u("onValueChange")},render:function(a){const n=s.useRef(null);return a.ref=n,t.jsx(p,{...a})}},v={parameters:{docs:{description:{story:"An empty field with a `label` and a `placeholder`."}}}},f={args:{defaultValue:100},play:async({canvas:e,step:a})=>{await a("Validate defaultValue",async()=>{const n=e.getByTestId("input");await S(n).toHaveValue(100)}),await a("Type to value",async()=>{const n=e.getByTestId("input");await xe.type(n,",500"),await S(n).toHaveValue(100500)})}},y={args:{icon:t.jsx(we,{svg:Ee})}},h={args:{additionalText:"This is additional text"}},b={args:{required:!0}},g={args:{required:!0,requiredLabel:t.jsx(ke,{accent:"critical",variant:"m-bold",children:"Needed"})}},V={args:{hideLabel:!0}},x={args:{hasError:!0}},q={args:{hasError:!0,errorMessage:"This is an error message"}},E={args:{disabled:!0}},w={args:{readOnly:!0}},I={decorators:[(e,{args:a})=>t.jsxs("div",{style:{padding:"8px",margin:"8px"},children:[t.jsxs("p",{children:["You can"," ",t.jsx(R,{variant:"secondary",dataset:{testid:"focus-button"},onClick:()=>{var n,r;return(r=(n=a.ref)==null?void 0:n.current)==null?void 0:r.setFocus()},children:"Focus"})," ","the input imperatively."]}),t.jsx(e,{})]})],play:async({args:e,canvas:a})=>{if(!T(e.ref))throw new Error("Expected ref.current to be an InputImperativeHandle");const n=a.getByTestId("input");await xe.click(a.getByTestId("focus-button")),await qe(()=>S(n).toHaveFocus())}},C={decorators:[(e,{args:a})=>t.jsxs("div",{style:{height:"300px",overflow:"scroll",padding:"8px",margin:"8px"},children:[t.jsxs("p",{children:["You can"," ",t.jsx(R,{variant:"secondary",dataset:{testid:"scroll-button"},onClick:()=>{if(!T(a.ref))throw new Error("Expected ref.current to be an InputImperativeHandle");a.ref.current.scrollIntoView()},children:"Scroll"})," ","the input into view imperatively."]}),t.jsx("div",{style:{height:"1000px",display:"flex",flexDirection:"column",justifyContent:"end",border:"2px dashed lightgray",padding:"16px"},children:t.jsx(e,{})})]})],play:async({args:e,canvas:a})=>{if(!T(e.ref))throw new Error("Expected ref.current to be an InputImperativeHandle");const n=a.getByTestId("input");e.ref.current.scrollIntoView(),await qe(()=>S(n).toBeVisible())}};function T(e){return typeof e=="object"&&e!==null&&"current"in e&&e.current!==null&&typeof e.current=="object"&&"setFocus"in e.current}const H={tags:["!test"],parameters:{docs:{description:{story:'\nThe following code renders a `Numberfield` with the `required` flag, a `min`\nand `max` value, an `icon`, a `placeholder`, and some `additionalText`.\n\nWhen you click the "Submit" button and the input value is empty\n- it displays feedback via the `errorMessage` prop;\n- and uses the `setFocus()` API to bring the focus back to the field.\n\nIt uses the `value` and `onValueChange` props to react to the user input.\n'}},chromatic:{disableSnapshot:!0}},render:function(){const a=s.useRef(null),[n,r]=s.useState(void 0),[i,d]=s.useState(!1),o=l=>{if(l===void 0)return"Please provide a number";if(l!==Math.round(l))return"Please provide a whole number";if(l<10)return"Please book at least 10 lessons";if(l>99)return"Please book less than 100 lessons"},F=()=>{var l;d(!0),n||(l=a==null?void 0:a.current)==null||l.setFocus()};return t.jsxs("div",{style:{maxWidth:"500px",display:"flex",flexDirection:"column"},children:[t.jsx(p,{id:"lessons",name:"lessons",label:"Number of lessons",icon:t.jsx(we,{svg:Ee}),placeholder:"How about 3?",value:n,additionalText:"These lessons will be scheduled automatically",onValueChange:r,errorMessage:i?o(n):void 0,min:10,max:99,ref:a,required:!0}),t.jsx(R,{onClick:F,children:"Submit"})]})}};var k,B,j;v.parameters={...v.parameters,docs:{...(k=v.parameters)==null?void 0:k.docs,source:{originalSource:`{
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
story: \`An empty field with a \\\`label\\\` and a \\\`placeholder\\\`.\`
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}`,...(j=(B=v.parameters)==null?void 0:B.docs)==null?void 0:j.source}}};var P,L,D;f.parameters={...f.parameters,docs:{...(P=f.parameters)==null?void 0:P.docs,source:{originalSource:`{
|
|
14
|
+
args: {
|
|
15
|
+
defaultValue: 100
|
|
16
|
+
},
|
|
17
|
+
play: async ({
|
|
18
|
+
canvas,
|
|
19
|
+
step
|
|
20
|
+
}) => {
|
|
21
|
+
await step('Validate defaultValue', async () => {
|
|
22
|
+
const input = canvas.getByTestId<HTMLInputElement>('input');
|
|
23
|
+
await expect(input).toHaveValue(100);
|
|
24
|
+
});
|
|
25
|
+
await step('Type to value', async () => {
|
|
26
|
+
const input = canvas.getByTestId<HTMLInputElement>('input');
|
|
27
|
+
await userEvent.type(input, ',500');
|
|
28
|
+
await expect(input).toHaveValue(100_500);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}`,...(D=(L=f.parameters)==null?void 0:L.docs)==null?void 0:D.source}}};var _,M,K;y.parameters={...y.parameters,docs:{...(_=y.parameters)==null?void 0:_.docs,source:{originalSource:`{
|
|
32
|
+
args: {
|
|
33
|
+
icon: <Icon svg={PhoneSvg} />
|
|
34
|
+
}
|
|
35
|
+
}`,...(K=(M=y.parameters)==null?void 0:M.docs)==null?void 0:K.source}}};var W,O,A;h.parameters={...h.parameters,docs:{...(W=h.parameters)==null?void 0:W.docs,source:{originalSource:`{
|
|
36
|
+
args: {
|
|
37
|
+
additionalText: 'This is additional text'
|
|
38
|
+
}
|
|
39
|
+
}`,...(A=(O=h.parameters)==null?void 0:O.docs)==null?void 0:A.source}}};var U,J,X;b.parameters={...b.parameters,docs:{...(U=b.parameters)==null?void 0:U.docs,source:{originalSource:`{
|
|
40
|
+
args: {
|
|
41
|
+
required: true
|
|
42
|
+
}
|
|
43
|
+
}`,...(X=(J=b.parameters)==null?void 0:J.docs)==null?void 0:X.source}}};var Y,$,z;g.parameters={...g.parameters,docs:{...(Y=g.parameters)==null?void 0:Y.docs,source:{originalSource:`{
|
|
44
|
+
args: {
|
|
45
|
+
required: true,
|
|
46
|
+
requiredLabel: <Text accent="critical" variant="m-bold">
|
|
47
|
+
Needed
|
|
48
|
+
</Text>
|
|
49
|
+
}
|
|
50
|
+
}`,...(z=($=g.parameters)==null?void 0:$.docs)==null?void 0:z.source}}};var G,Q,Z;V.parameters={...V.parameters,docs:{...(G=V.parameters)==null?void 0:G.docs,source:{originalSource:`{
|
|
51
|
+
args: {
|
|
52
|
+
hideLabel: true
|
|
53
|
+
}
|
|
54
|
+
}`,...(Z=(Q=V.parameters)==null?void 0:Q.docs)==null?void 0:Z.source}}};var ee,ae,ne;x.parameters={...x.parameters,docs:{...(ee=x.parameters)==null?void 0:ee.docs,source:{originalSource:`{
|
|
55
|
+
args: {
|
|
56
|
+
hasError: true
|
|
57
|
+
}
|
|
58
|
+
}`,...(ne=(ae=x.parameters)==null?void 0:ae.docs)==null?void 0:ne.source}}};var te,re,le;q.parameters={...q.parameters,docs:{...(te=q.parameters)==null?void 0:te.docs,source:{originalSource:`{
|
|
59
|
+
args: {
|
|
60
|
+
hasError: true,
|
|
61
|
+
errorMessage: 'This is an error message'
|
|
62
|
+
}
|
|
63
|
+
}`,...(le=(re=q.parameters)==null?void 0:re.docs)==null?void 0:le.source}}};var ue,se,ie;E.parameters={...E.parameters,docs:{...(ue=E.parameters)==null?void 0:ue.docs,source:{originalSource:`{
|
|
64
|
+
args: {
|
|
65
|
+
disabled: true
|
|
66
|
+
}
|
|
67
|
+
}`,...(ie=(se=E.parameters)==null?void 0:se.docs)==null?void 0:ie.source}}};var oe,de,ce;w.parameters={...w.parameters,docs:{...(oe=w.parameters)==null?void 0:oe.docs,source:{originalSource:`{
|
|
68
|
+
args: {
|
|
69
|
+
readOnly: true
|
|
70
|
+
}
|
|
71
|
+
}`,...(ce=(de=w.parameters)==null?void 0:de.docs)==null?void 0:ce.source}}};var me,pe,ve;I.parameters={...I.parameters,docs:{...(me=I.parameters)==null?void 0:me.docs,source:{originalSource:`{
|
|
72
|
+
decorators: [(Story, {
|
|
73
|
+
args
|
|
74
|
+
}) => <div style={{
|
|
75
|
+
padding: '8px',
|
|
76
|
+
margin: '8px'
|
|
77
|
+
}}>
|
|
78
|
+
<p>
|
|
79
|
+
You can{' '}
|
|
80
|
+
<Button variant="secondary" dataset={{
|
|
81
|
+
testid: 'focus-button'
|
|
82
|
+
}} onClick={() =>
|
|
83
|
+
// @ts-expect-error - This will fail gracefully,
|
|
84
|
+
// and the \`play\` function will assert it properly
|
|
85
|
+
args.ref?.current?.setFocus()}>
|
|
86
|
+
Focus
|
|
87
|
+
</Button>{' '}
|
|
88
|
+
the input imperatively.
|
|
89
|
+
</p>
|
|
90
|
+
<Story />
|
|
91
|
+
</div>],
|
|
92
|
+
play: async ({
|
|
93
|
+
args,
|
|
94
|
+
canvas
|
|
95
|
+
}) => {
|
|
96
|
+
if (!isImperativeHandleRef(args.ref)) {
|
|
97
|
+
throw new Error('Expected ref.current to be an InputImperativeHandle');
|
|
98
|
+
}
|
|
99
|
+
const input = canvas.getByTestId('input');
|
|
100
|
+
await userEvent.click(canvas.getByTestId('focus-button'));
|
|
101
|
+
await waitFor(() => expect(input).toHaveFocus());
|
|
102
|
+
}
|
|
103
|
+
}`,...(ve=(pe=I.parameters)==null?void 0:pe.docs)==null?void 0:ve.source}}};var fe,ye,he;C.parameters={...C.parameters,docs:{...(fe=C.parameters)==null?void 0:fe.docs,source:{originalSource:`{
|
|
104
|
+
decorators: [(Story, {
|
|
105
|
+
args
|
|
106
|
+
}) => <div style={{
|
|
107
|
+
height: '300px',
|
|
108
|
+
overflow: 'scroll',
|
|
109
|
+
padding: '8px',
|
|
110
|
+
margin: '8px'
|
|
111
|
+
}}>
|
|
112
|
+
<p>
|
|
113
|
+
You can{' '}
|
|
114
|
+
<Button variant="secondary" dataset={{
|
|
115
|
+
testid: 'scroll-button'
|
|
116
|
+
}} onClick={() => {
|
|
117
|
+
if (!isImperativeHandleRef(args.ref)) {
|
|
118
|
+
throw new Error('Expected ref.current to be an InputImperativeHandle');
|
|
119
|
+
}
|
|
120
|
+
args.ref.current.scrollIntoView();
|
|
121
|
+
}}>
|
|
122
|
+
Scroll
|
|
123
|
+
</Button>{' '}
|
|
124
|
+
the input into view imperatively.
|
|
125
|
+
</p>
|
|
126
|
+
<div style={{
|
|
127
|
+
height: '1000px',
|
|
128
|
+
display: 'flex',
|
|
129
|
+
flexDirection: 'column',
|
|
130
|
+
justifyContent: 'end',
|
|
131
|
+
border: '2px dashed lightgray',
|
|
132
|
+
padding: '16px'
|
|
133
|
+
}}>
|
|
134
|
+
<Story />
|
|
135
|
+
</div>
|
|
136
|
+
</div>],
|
|
137
|
+
play: async ({
|
|
138
|
+
args,
|
|
139
|
+
canvas
|
|
140
|
+
}) => {
|
|
141
|
+
if (!isImperativeHandleRef(args.ref)) {
|
|
142
|
+
throw new Error('Expected ref.current to be an InputImperativeHandle');
|
|
143
|
+
}
|
|
144
|
+
const input = canvas.getByTestId('input');
|
|
145
|
+
args.ref.current.scrollIntoView();
|
|
146
|
+
await waitFor(() => expect(input).toBeVisible());
|
|
147
|
+
}
|
|
148
|
+
}`,...(he=(ye=C.parameters)==null?void 0:ye.docs)==null?void 0:he.source}}};var be,ge,Ve;H.parameters={...H.parameters,docs:{...(be=H.parameters)==null?void 0:be.docs,source:{originalSource:`{
|
|
149
|
+
tags: ['!test'],
|
|
150
|
+
parameters: {
|
|
151
|
+
docs: {
|
|
152
|
+
description: {
|
|
153
|
+
story: \`
|
|
154
|
+
The following code renders a \\\`Numberfield\\\` with the \\\`required\\\` flag, a \\\`min\\\`
|
|
155
|
+
and \\\`max\\\` value, an \\\`icon\\\`, a \\\`placeholder\\\`, and some \\\`additionalText\\\`.
|
|
156
|
+
|
|
157
|
+
When you click the "Submit" button and the input value is empty
|
|
158
|
+
- it displays feedback via the \\\`errorMessage\\\` prop;
|
|
159
|
+
- and uses the \\\`setFocus()\\\` API to bring the focus back to the field.
|
|
160
|
+
|
|
161
|
+
It uses the \\\`value\\\` and \\\`onValueChange\\\` props to react to the user input.
|
|
162
|
+
\`
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
chromatic: {
|
|
166
|
+
disableSnapshot: true
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
render: function Story() {
|
|
170
|
+
const fieldRef = useRef<InputImperativeHandle>(null);
|
|
171
|
+
const [value, setValue] = useState<number | undefined>(undefined);
|
|
172
|
+
const [submited, setSubmitted] = useState(false);
|
|
173
|
+
const getErrorMessage = (attempt?: number) => {
|
|
174
|
+
if (attempt === undefined) {
|
|
175
|
+
return 'Please provide a number';
|
|
176
|
+
}
|
|
177
|
+
if (attempt !== Math.round(attempt)) {
|
|
178
|
+
return 'Please provide a whole number';
|
|
179
|
+
}
|
|
180
|
+
if (attempt < 10) {
|
|
181
|
+
return 'Please book at least 10 lessons';
|
|
182
|
+
}
|
|
183
|
+
if (attempt > 99) {
|
|
184
|
+
return 'Please book less than 100 lessons';
|
|
185
|
+
}
|
|
186
|
+
return undefined;
|
|
187
|
+
};
|
|
188
|
+
const handleClick = () => {
|
|
189
|
+
setSubmitted(true);
|
|
190
|
+
if (!value) {
|
|
191
|
+
fieldRef?.current?.setFocus();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
return <div style={{
|
|
195
|
+
maxWidth: '500px',
|
|
196
|
+
display: 'flex',
|
|
197
|
+
flexDirection: 'column'
|
|
198
|
+
}}>
|
|
199
|
+
<NumberField id="lessons" name="lessons" label="Number of lessons" icon={<Icon svg={PhoneSvg} />} placeholder="How about 3?" value={value} additionalText="These lessons will be scheduled automatically" onValueChange={setValue} errorMessage={submited ? getErrorMessage(value) : undefined} min={10} max={99} ref={fieldRef} required />
|
|
200
|
+
<Button onClick={handleClick}>Submit</Button>
|
|
201
|
+
</div>;
|
|
202
|
+
}
|
|
203
|
+
}`,...(Ve=(ge=H.parameters)==null?void 0:ge.docs)==null?void 0:Ve.source}}};const ba=["Basic","WithValue","WithIcon","WithAdditionalText","Required","RequiredWithCustomLabel","WithHiddenLabel","HasError","HasErrorWithMessage","Disabled","ReadOnly","ImperativeSetFocus","ImperativeScrollIntoView","Example"];export{v as Basic,E as Disabled,H as Example,x as HasError,q as HasErrorWithMessage,C as ImperativeScrollIntoView,I as ImperativeSetFocus,w as ReadOnly,b as Required,g as RequiredWithCustomLabel,h as WithAdditionalText,V as WithHiddenLabel,y as WithIcon,f as WithValue,ba as __namedExportsOrder,ha as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.content__KHgp9{background-color:var(--79dffb);border-radius:var(--fa4b1a);padding:var(--558c4c);box-shadow:var(--df7dbb);width:304px;display:flex;flex-direction:column;gap:var(--813599);z-index:var(--ds-onboarding-tooltip-z-index-override, auto);animation-duration:.15s;animation-timing-function:cubic-bezier(.25,0,.5,1.3);transform-origin:var(--radix-popover-content-transform-origin);will-change:transform,opacity}.content__KHgp9[data-state=open]{animation-name:appear__G8agi}.content__KHgp9[data-state=closed]{animation-name:disappear__OWVSJ}.header__CaLti{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:flex-start}.close__3s-VD{background:none;border:none;border-radius:var(--5e8be4);padding:0;margin:0;cursor:pointer}.close__3s-VD:focus-visible{outline-style:solid;outline-color:var(--603ec6);outline-width:var(--99d31f);outline-offset:var(--c0b12c)}.footer__X5qXF{display:flex;justify-content:flex-end;gap:var(--813599);align-items:center}.arrow__0pg-s{fill:var(--79dffb)}@keyframes appear__G8agi{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes disappear__OWVSJ{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0)}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{r as n}from"./index-Cb9e4tly.js";import{R
|
|
1
|
+
import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{r as n}from"./index-Cb9e4tly.js";import{R,A as _,P as q,C as x,a as O,b as N}from"./index-BOrXX8UK.js";import{F as E}from"./TokyoUIClose-thK8sk63.js";import{I as k}from"./Icon-Wpz7-Jvg.js";import{T as P}from"./Text-BXZIkJPK.js";import{B as j}from"./Button-BlwReLw5.js";import{H as T}from"./Heading-Bj7LLgoH.js";import{u as D}from"./index-D1pfvbUR.js";import{g as S}from"./shared-strings-Biv7UF3M.js";import{i as L}from"./PortalElementProvider-BRcRijdp.js";import{g as M}from"./index-DdzHuZ-Y.js";import{w as H}from"./componentNames-Bwls0I02.js";import{M as X}from"./message-B1DLZQ1U.js";const J="content__KHgp9",B="header__CaLti",F="close__3s-VD",U="footer__X5qXF",A="arrow__0pg-s",o={content:J,header:B,close:F,footer:U,arrow:A},G=e=>{e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})},m=({open:e,onOpenChange:i,disabled:r,title:u,text:s,children:t,side:l,dataset:h,actionLabel:b=a.jsx(X,{id:"preply-ds.onboardingTooltip.actionLabel",defaultMessage:"Got it",description:"Default onboarding tooltip action label. Used to acknowledge and close the tooltip."}),actionOnClick:g,actionHref:y,counter:C,autoScroll:v=!0})=>{const{formatMessage:I}=D(),w=L(),f=n.useId(),V=n.useId(),d=n.useId(),c=n.useRef(null);return n.useEffect(()=>{e&&c.current&&v&&G(c.current)},[v,e]),r?t:a.jsxs(R,{open:e,onOpenChange:i,children:[a.jsx(_,{ref:c,id:d,asChild:!0,children:t}),a.jsx(q,{container:w,children:a.jsxs(x,{side:l,className:o.content,"aria-labelledby":f,"aria-describedby":`${d} ${V}`,...M(h,{preplyDsComponent:H.OnboardingTooltip}),children:[a.jsxs("div",{className:o.header,children:[a.jsx(O,{className:o.close,"aria-label":I(S.close),"data-testid":"close",children:a.jsx(k,{accent:"inverted",svg:E})}),a.jsx(T,{tag:"h1",variant:"small",accent:"inverted",id:f,"aria-describedby":d,children:u})]}),a.jsx(P,{variant:"default-regular",accent:"inverted",children:s}),a.jsxs("div",{className:o.footer,children:[C,a.jsx(j,{variant:"inverted",size:"small",onClick:g,href:y,dataset:{testid:"action"},wrap:!0,children:b})]}),a.jsx(N,{"aria-hidden":!0,className:o.arrow,width:18,height:11})]})})]})},p=e=>{const[i,r]=n.useState(!0),u=t=>{var l;t||(l=e.onClose)==null||l.call(e),r(t)},s=()=>{var t,l;(t=e.actionOnClick)==null||t.call(e),r(!1),(l=e.onClose)==null||l.call(e)};return a.jsx(m,{...e,open:i,onOpenChange:u,actionOnClick:s})};try{m.displayName="InternalOnboardingTooltip",m.__docgenInfo={description:"",displayName:"InternalOnboardingTooltip",props:{title:{defaultValue:null,description:"",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"}]}},text:{defaultValue:null,description:"",name:"text",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"}]}},disabled:{defaultValue:null,description:"Disables tooltip completely",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},onClose:{defaultValue:null,description:"Called when the tooltip is closed",name:"onClose",required:!1,type:{name:"enum",value:[{value:"() => void"}]}},actionLabel:{defaultValue:{value:`(
|
|
2
2
|
<FormattedMessage
|
|
3
3
|
id="preply-ds.onboardingTooltip.actionLabel"
|
|
4
4
|
defaultMessage="Got it"
|
package/dist/assets/{OnboardingTooltip.stories-doNUnMe7.js → OnboardingTooltip.stories-CBEGxsdn.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{O as u}from"./OnboardingTooltip-
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{O as u}from"./OnboardingTooltip-DkJtTrMv.js";import{I as g}from"./IconButton-B7CxWK4j.js";import{F as x}from"./TokyoUIFav-DOVerCtW.js";import"./index-ChsGqxH_.js";import"./index-Cb9e4tly.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-BOrXX8UK.js";import"./PortalElementProvider-BRcRijdp.js";import"./index-BPrLDK9Y.js";import"./index-C7hTFOIV.js";import"./index-M3hvtcRE.js";import"./tslib.es6-BntfKcQG.js";import"./index-DOA2-rRC.js";import"./TokyoUIClose-thK8sk63.js";import"./Icon-Wpz7-Jvg.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterHTMLAttributes-DYdLqcvH.js";import"./render-icon-BT0Aq7PA.js";import"./componentNames-Bwls0I02.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";import"./Text-BXZIkJPK.js";import"./text-centered-CznToR0o.js";import"./Button-BlwReLw5.js";import"./ButtonBase-BCfmDQ_b.js";import"./Spinner-B2C3RkCF.js";import"./useHostname-Y3PlXofY.js";import"./index-CC6DAVyL.js";import"./Heading-Bj7LLgoH.js";import"./index-D1pfvbUR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./shared-strings-Biv7UF3M.js";import"./message-B1DLZQ1U.js";const ee={title:"Components/OnboardingTooltip",component:u,parameters:{docs:{story:{inline:!1,height:250},description:{component:"Are you looking for a step-by-step tour? Check out [OnboardingTour](/docs/components-onboardingtour--docs)"}},a11y:{config:{rules:[{id:"color-contrast",enabled:!1}]}}},decorators:[t=>e.jsx("div",{style:{margin:"auto",width:"max-content"},children:t()})]},f=t=>[!1,!1],h=t=>a=>{},o=()=>{const[t,a]=f(),v=h();return e.jsx(u,{title:"New Feature Available!",text:"We've added an exciting new feature to enhance your experience.",disabled:a||t,onClose:()=>v(!0),children:e.jsx(g,{variant:"ghost",svg:e.jsx(x,{}),assistiveText:"Favorite"})})};o.storyName="OnboardingTooltip";const r={tags:["!autodocs"],args:{title:"New Feature Available!",text:"We've added an exciting new feature to enhance your experience.",disabled:!1,onClose:()=>{},children:e.jsx(g,{variant:"ghost",svg:e.jsx(x,{}),assistiveText:"Favorite"})},argTypes:{title:{control:"text"},text:{control:"text"},actionLabel:{control:"text"},actionOnClick:{control:!1},actionHref:{control:"text"},disabled:{control:"boolean"},dataset:{control:"object"},onClose:{control:!1},children:{control:!1}},parameters:{docs:{story:{height:450}},chromatic:{disableSnapshot:!0}},decorators:[t=>e.jsx("div",{style:{minHeight:"100vh",display:"flex"},children:e.jsx("div",{style:{margin:"auto",width:"max-content"},children:t()})})]};var i,n,s,l,c;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`() => {
|
|
2
2
|
const [wasTooltipSeen, loading] = useIsFeatureActive('new-feature');
|
|
3
3
|
const setTooltipSeen = useToggleFeature('new-feature');
|
|
4
4
|
return <OnboardingTooltip title="New Feature Available!" text="We've added an exciting new feature to enhance your experience." disabled={loading || wasTooltipSeen} onClose={() => setTooltipSeen(true)}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as c}from"./jsx-runtime-BTJTZTIL.js";import{O as b}from"./OnboardingTooltip-
|
|
1
|
+
import{j as c}from"./jsx-runtime-BTJTZTIL.js";import{O as b}from"./OnboardingTooltip-DkJtTrMv.js";import{I as T}from"./IconButton-B7CxWK4j.js";import{F as g}from"./TokyoUIFav-DOVerCtW.js";import{a as s,w as r,e as p,u as v}from"./index-BVDq5o4N.js";import"./index-ChsGqxH_.js";import"./index-Cb9e4tly.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-BOrXX8UK.js";import"./PortalElementProvider-BRcRijdp.js";import"./index-BPrLDK9Y.js";import"./index-C7hTFOIV.js";import"./index-M3hvtcRE.js";import"./tslib.es6-BntfKcQG.js";import"./index-DOA2-rRC.js";import"./TokyoUIClose-thK8sk63.js";import"./Icon-Wpz7-Jvg.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterHTMLAttributes-DYdLqcvH.js";import"./render-icon-BT0Aq7PA.js";import"./componentNames-Bwls0I02.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";import"./Text-BXZIkJPK.js";import"./text-centered-CznToR0o.js";import"./Button-BlwReLw5.js";import"./ButtonBase-BCfmDQ_b.js";import"./Spinner-B2C3RkCF.js";import"./useHostname-Y3PlXofY.js";import"./index-CC6DAVyL.js";import"./Heading-Bj7LLgoH.js";import"./index-D1pfvbUR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./shared-strings-Biv7UF3M.js";import"./message-B1DLZQ1U.js";const et={title:"Components/OnboardingTooltip/Tests",component:b,parameters:{layout:"centered",controls:{disable:!0},chromatic:{disableSnapshot:!0}},tags:["!autodocs","!a11y-test","test"],decorators:[e=>c.jsx("div",{style:{margin:"100px 0"},children:e()})],args:{title:"Title",text:"Body text",actionLabel:"Action label",disabled:!1,onClose:()=>{},dataset:{testid:"tooltip"},children:c.jsx(T,{svg:c.jsx(g,{}),assistiveText:"Favorite"})}},n={play:async({canvasElement:e,step:o})=>{const i=s(e);await o("wait for tooltip to be visible",async()=>{await r(()=>{const t=i.getByTestId("tooltip");return p(t).toBeVisible()})}),await o("close the tooltip",()=>{const l=s(i.getByTestId("tooltip")).getByTestId("close");return v.click(l)}),await o("wait for tooltip to be hidden",async()=>{await r(()=>{const t=i.queryByTestId("tooltip");return p(t).toBeNull()})})}},a={play:async({canvasElement:e,step:o})=>{const i=s(e);await o("wait for tooltip to be visible",async()=>{await r(()=>{const t=i.getByTestId("tooltip");return p(t).toBeVisible()})}),await o("close the tooltip",()=>{const l=s(i.getByTestId("tooltip")).getByTestId("action");return v.click(l)}),await o("wait for tooltip to be hidden",async()=>{await r(()=>{const t=i.queryByTestId("tooltip");return p(t).toBeNull()})})}};var m,d,u;n.parameters={...n.parameters,docs:{...(m=n.parameters)==null?void 0:m.docs,source:{originalSource:`{
|
|
2
2
|
play: async ({
|
|
3
3
|
canvasElement,
|
|
4
4
|
step
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{j as o}from"./jsx-runtime-BTJTZTIL.js";import{r as l}from"./index-Cb9e4tly.js";import{I as A}from"./OnboardingTooltip-DkJtTrMv.js";import"./index-D1pfvbUR.js";import{M as f}from"./message-B1DLZQ1U.js";const T="counter__ArBS-",j={counter:T},v=({totalSteps:n,nextActionLabel:e=o.jsx(f,{id:"preply-ds.onboardingTour.nextActionLabel",defaultMessage:"Next",description:"Onboarding tour next action label"}),completeActionLabel:a=o.jsx(f,{id:"preply-ds.onboardingTour.completeActionLabel",defaultMessage:"Got it",description:"Onboarding tour complete action label"}),onClose:t,onComplete:r,onStepChange:i,disabled:s,children:p,ctx:x})=>{const[b,u]=l.useState(!0),[d,g]=l.useState(0),c={totalSteps:n,nextActionLabel:e,completeActionLabel:a,onClose:()=>{u(!1),t==null||t()},active:!s&&b,currentStep:d,onActionClick:()=>{if(d===n-1)r==null||r(),u(!1);else{const h=d+1;g(h),i==null||i(h)}}};return o.jsx(x.Provider,{value:c,children:p})},_=({ctx:n,...e})=>{const a=l.useContext(n);if(!a)throw new Error("OnboardingTourContext not found");const{currentStep:t,totalSteps:r,onActionClick:i,onClose:s,active:p,nextActionLabel:x,completeActionLabel:b}=a,u=e.step===r-1,d=e.step===t,g=u?b:x,m=()=>{var c;(c=e.actionOnClick)==null||c.call(e),i()},O=c=>{c||s==null||s()};return o.jsx(A,{...e,counter:o.jsx("p",{className:j.counter,children:o.jsx(f,{id:"preply-ds.onboardingTour.counter",defaultMessage:"{currentStep} of {totalSteps}",description:"Onboarding tour step counter, e.g. '1 of 3'",values:{currentStep:t+1,totalSteps:r}})}),open:p&&d,onOpenChange:O,actionLabel:g,actionOnClick:m})},S=()=>{const n=l.createContext(null);return{Provider:t=>o.jsx(v,{...t,ctx:n}),Step:t=>o.jsx(_,{...t,ctx:n})}};try{S.displayName="createOnboardingTour",S.__docgenInfo={description:`Creates a new onboarding tour.
|
|
2
|
+
|
|
3
|
+
This factory pattern allows multiple independent tours to be nested within each other
|
|
4
|
+
without context conflicts, as each tour maintains its own separate context and state.`,displayName:"createOnboardingTour",props:{}}}catch{}export{S as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.counter__ArBS-{flex:1;min-width:max-content;color:var(--a924f9);font-size:var(--f7d879);font-weight:var(--87a7e3);line-height:var(--1cb31f)}
|
package/dist/assets/{OnboardingTour.stories-CoOA-ga5.js → OnboardingTour.stories-Ci2XQcpZ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as b}from"./index-Cb9e4tly.js";import{c as x}from"./OnboardingTour-
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as b}from"./index-Cb9e4tly.js";import{c as x}from"./OnboardingTour-CiSAhOo4.js";import{T as n}from"./Text-BXZIkJPK.js";import{L as y}from"./LayoutFlex-5ZDeW2G6.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./OnboardingTooltip-DkJtTrMv.js";import"./index-BOrXX8UK.js";import"./PortalElementProvider-BRcRijdp.js";import"./index-BPrLDK9Y.js";import"./index-C7hTFOIV.js";import"./index-M3hvtcRE.js";import"./tslib.es6-BntfKcQG.js";import"./index-DOA2-rRC.js";import"./TokyoUIClose-thK8sk63.js";import"./Icon-Wpz7-Jvg.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterHTMLAttributes-DYdLqcvH.js";import"./render-icon-BT0Aq7PA.js";import"./componentNames-Bwls0I02.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";import"./Button-BlwReLw5.js";import"./ButtonBase-BCfmDQ_b.js";import"./Spinner-B2C3RkCF.js";import"./useHostname-Y3PlXofY.js";import"./index-CC6DAVyL.js";import"./Heading-Bj7LLgoH.js";import"./text-centered-CznToR0o.js";import"./index-D1pfvbUR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./shared-strings-Biv7UF3M.js";import"./message-B1DLZQ1U.js";import"./layout-relative.module-ed9bC4H4.js";const l=t=>null,s=t=>null;try{l.displayName="OnboardingTourProvider",l.__docgenInfo={description:`For some reason, storybook fails to render arg tables for the components
|
|
2
2
|
when they're created with the \`createOnboardingTour\` function.
|
|
3
3
|
|
|
4
4
|
As a workaround, we're manually defining fake components with the same
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as g}from"./index-Cb9e4tly.js";import{c as h}from"./OnboardingTour-
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as g}from"./index-Cb9e4tly.js";import{c as h}from"./OnboardingTour-CiSAhOo4.js";import{T}from"./Text-BXZIkJPK.js";import{B as S}from"./Button-BlwReLw5.js";import{f as m,a as p,w as c,e as n,u as l}from"./index-BVDq5o4N.js";import{L as V}from"./LayoutFlex-5ZDeW2G6.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./OnboardingTooltip-DkJtTrMv.js";import"./index-BOrXX8UK.js";import"./PortalElementProvider-BRcRijdp.js";import"./index-BPrLDK9Y.js";import"./index-C7hTFOIV.js";import"./index-M3hvtcRE.js";import"./tslib.es6-BntfKcQG.js";import"./index-DOA2-rRC.js";import"./TokyoUIClose-thK8sk63.js";import"./Icon-Wpz7-Jvg.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterHTMLAttributes-DYdLqcvH.js";import"./render-icon-BT0Aq7PA.js";import"./componentNames-Bwls0I02.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";import"./Heading-Bj7LLgoH.js";import"./text-centered-CznToR0o.js";import"./index-D1pfvbUR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./shared-strings-Biv7UF3M.js";import"./message-B1DLZQ1U.js";import"./ButtonBase-BCfmDQ_b.js";import"./Spinner-B2C3RkCF.js";import"./useHostname-Y3PlXofY.js";import"./index-CC6DAVyL.js";import"./layout-relative.module-ed9bC4H4.js";const d=h(),vt={title:"Components/OnboardingTour/Tests",parameters:{layout:"centered",controls:{disable:!0},chromatic:{disableSnapshot:!0}},tags:["!autodocs","!a11y-test","test"],decorators:[i=>e.jsx("div",{style:{margin:"100px 0"},children:i()})],args:{onComplete:m(),onClose:m(),onStepChange:m()}},y={render:({onComplete:i,onStepChange:s})=>e.jsx(d.Provider,{totalSteps:3,nextActionLabel:"Next",completeActionLabel:"Got it",onComplete:i,onStepChange:s,children:e.jsxs(V,{gap:"24",direction:"column",children:[e.jsx(d.Step,{step:0,title:"Title",text:"Text",dataset:{testid:"step-1"},children:e.jsx(T,{children:"Step 1 Content"})}),e.jsx(d.Step,{step:1,title:"Title",text:"Text",dataset:{testid:"step-2"},children:e.jsx(T,{children:"Step 2 Content"})}),e.jsx(d.Step,{step:2,title:"Title",text:"Text",dataset:{testid:"step-3"},children:e.jsx(T,{children:"Step 3 Content"})})]})}),play:async({canvasElement:i,step:s,args:t})=>{const a=p(i);await s("First step should be visible initially",async()=>{await c(()=>{const o=a.getByTestId("step-1");n(o).toBeVisible()})}),await s("Click Next to advance to second step",async()=>{const r=p(a.getByTestId("step-1")).getByTestId("action");await l.click(r),await c(()=>{const u=a.getByTestId("step-2");n(u).toBeVisible(),n(t.onStepChange).toHaveBeenCalledWith(1)})}),await s("Click Next to advance to final step",async()=>{const r=p(a.getByTestId("step-2")).getByTestId("action");await l.click(r),await c(()=>{const u=a.getByTestId("step-3");n(u).toBeVisible(),n(t.onStepChange).toHaveBeenCalledWith(2)})}),await s("Complete tour",async()=>{const r=p(a.getByTestId("step-3")).getByTestId("action");await l.click(r),await c(()=>{const u=a.queryByTestId("step",{exact:!1});n(u).toBeNull(),n(t.onComplete).toHaveBeenCalled()})})}},x={render:({onClose:i})=>e.jsx(d.Provider,{totalSteps:2,nextActionLabel:"Next",completeActionLabel:"Got it",onClose:i,children:e.jsx(d.Step,{step:0,title:"First step",text:"Try closing this step",dataset:{testid:"step-1"},children:e.jsx(T,{children:"Step 1 Content"})})}),play:async({canvasElement:i,step:s})=>{const t=p(i);await s("Step should be initially visible",async()=>{await c(()=>{const a=t.getByTestId("step-1");n(a).toBeVisible()})}),await s("Click close button to close tour",async({args:a})=>{const r=p(t.getByTestId("step-1")).getByTestId("close");await l.click(r),await c(()=>{const u=t.queryByTestId("step",{exact:!1});n(u).toBeNull(),n(a.onClose).toHaveBeenCalled()})})}},B={render:function(){const[s,t]=g.useState(!0);return e.jsxs(V,{gap:"24",direction:"column",children:[e.jsx(S,{onClick:()=>t(!s),dataset:{testid:"toggle-button"},children:s?"Enable Tour":"Disable Tour"}),e.jsx(d.Provider,{totalSteps:2,nextActionLabel:"Next",completeActionLabel:"Got it",disabled:s,children:e.jsx(d.Step,{step:0,title:"First step",text:"This step should be hidden when disabled",dataset:{testid:"step-1"},children:e.jsx(T,{children:"Step 1 Content"})})})]})},play:async({canvasElement:i,step:s})=>{const t=p(i);await s("Tour should be initially disabled",async()=>{const a=t.queryByTestId("step-1");n(a).toBeNull()}),await s("Click enable button to show tour",async()=>{const a=t.getByTestId("toggle-button");await l.click(a),await c(()=>{const o=t.getByTestId("step-1");n(o).toBeVisible()})})}},b=h(),v=h(),w={render:function(){const[s,t]=g.useState(!1),[a,o]=g.useState(!1);return e.jsxs(b.Provider,{totalSteps:2,disabled:!s,nextActionLabel:"Next",completeActionLabel:"Got it",children:[e.jsx(b.Step,{step:0,title:"Title",text:"Text",dataset:{testid:"outer-step-1"},children:e.jsx(S,{onClick:()=>t(!0),dataset:{testid:"start-outer-tour"},children:"Start outer tour"})}),e.jsxs(v.Provider,{totalSteps:2,disabled:!a,nextActionLabel:"Next",completeActionLabel:"Done",children:[e.jsx(b.Step,{step:1,title:"Title",text:"Text",dataset:{testid:"outer-step-2"},children:e.jsx(T,{children:"Outer Tour Step"})}),e.jsx(v.Step,{step:0,title:"Title",text:"Text",dataset:{testid:"inner-step-1"},children:e.jsx(S,{onClick:()=>o(!0),dataset:{testid:"start-inner-tour"},children:"Start inner tour"})}),e.jsx(v.Step,{step:1,title:"Title",text:"Text",dataset:{testid:"inner-step-2"},children:e.jsx(T,{children:"Inner Tour Step"})})]})]})},play:async({canvasElement:i,step:s})=>{const t=p(i);await s("Start inner tour, step 1 should be visible",async()=>{const a=t.getByTestId("start-inner-tour");await l.click(a),await c(async()=>{const o=t.queryByTestId("inner-step-1");n(o).toBeVisible()})}),await s("Advance inner tour, step 2 should be visible",async()=>{const o=p(t.getByTestId("inner-step-1")).getByTestId("action");await l.click(o),await c(async()=>{const r=t.queryByTestId("inner-step-2");n(r).toBeVisible()})}),await s("Complete inner tour",async()=>{const o=p(t.getByTestId("inner-step-2")).getByTestId("action");await l.click(o),await c(async()=>{const r=t.queryByTestId("inner-step-1",{exact:!1});n(r).toBeNull()})}),await s("Start outer tour, step 1 should be visible",async()=>{const a=t.getByTestId("start-outer-tour");await l.click(a),await c(async()=>{const o=t.queryByTestId("outer-step-1");n(o).toBeVisible()})}),await s("Advance outer tour, step 2 should be visible",async()=>{const o=p(t.getByTestId("outer-step-1")).getByTestId("action");await l.click(o),await c(async()=>{const r=t.queryByTestId("outer-step-2");n(r).toBeVisible()})}),await s("Complete outer tour",async()=>{const o=p(t.getByTestId("outer-step-2")).getByTestId("action");await l.click(o),await c(async()=>{const r=t.queryByTestId("-step-",{exact:!1});n(r).toBeNull()})})}};var I,C,k;y.parameters={...y.parameters,docs:{...(I=y.parameters)==null?void 0:I.docs,source:{originalSource:`{
|
|
2
2
|
render: ({
|
|
3
3
|
onComplete,
|
|
4
4
|
onStepChange
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.PasswordField__j0q2B{display:flex}
|