@preply/ds-docs 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{00.LayoutFlex.stories-CQZmIU-U.js → 00.LayoutFlex.stories-DoLb1LoS.js} +1 -1
- package/dist/assets/{00.applications-Di7jQEUP.js → 00.applications-CodmhfzP.js} +1 -1
- package/dist/assets/{00.favicons.guide-BqtgcOst.js → 00.favicons.guide-CB7otDce.js} +1 -1
- package/dist/assets/{00.token-explorer-B-hoQtAZ.js → 00.token-explorer-iUebypoy.js} +1 -1
- package/dist/assets/{00.using-responsive-props-yIiNVrjH.js → 00.using-responsive-props-t2wHUu8m.js} +1 -1
- package/dist/assets/{01.semantic-tokens-Bszt1twO.js → 01.semantic-tokens-BRVBqUiT.js} +1 -1
- package/dist/assets/{01.using-shorthand-props-w8U5wYm4.js → 01.using-shorthand-props-DEJgBvzq.js} +1 -1
- package/dist/assets/{10.Combinations.stories-BJzVfaWu.js → 10.Combinations.stories-DLSgJgrw.js} +1 -1
- package/dist/assets/{10.fonts.guide-NBYHGpZG.js → 10.fonts.guide-D12lSwgH.js} +1 -1
- package/dist/assets/{10.ssr-CjoJSokY.js → 10.ssr-DlFRK64e.js} +1 -1
- package/dist/assets/{11.languageFont.explorer-7dsvANIs.js → 11.languageFont.explorer-C5k8-Jz1.js} +1 -1
- package/dist/assets/{11.ssr.app-router-D7ufx5p4.js → 11.ssr.app-router-Dhu4kN2c.js} +1 -1
- package/dist/assets/{20.libraries-BgURMzec.js → 20.libraries-B0n8gJVD.js} +1 -1
- package/dist/assets/{30.icons.explorer-GCwQhgUE.js → 30.icons.explorer-Crh_uKlY.js} +1 -1
- package/dist/assets/{30.storybook-6u3F3eKp.js → 30.storybook-BAO0l6SZ.js} +1 -1
- package/dist/assets/{40.illustrations.explorer-DQ5Oemtc.js → 40.illustrations.explorer-SD9H4gQS.js} +1 -1
- package/dist/assets/{90.advanced-CfRw5q9D.js → 90.advanced-CeKbZzoq.js} +1 -1
- package/dist/assets/AlertDialog-CNsqqwq6.css +1 -0
- package/dist/assets/{AlertDialog.stories-YL-e1X-5.js → AlertDialog.stories-CqAVOJ5x.js} +2 -2
- package/dist/assets/Avatar-BWVdwHlY.js +6 -0
- package/dist/assets/Avatar-BaeMEqzB.js +1 -0
- package/dist/assets/Avatar-DELee2ui.css +1 -0
- package/dist/assets/Avatar-SizFbjOh.css +1 -0
- package/dist/assets/{Avatar.stories-Bok7S-hP.js → Avatar.stories-DPuesOBK.js} +1 -1
- package/dist/assets/AvatarWithStatus-B8ohNruV.css +1 -0
- package/dist/assets/{AvatarWithStatus.stories-CEZSwfci.js → AvatarWithStatus.stories-CKhKeqbK.js} +4 -4
- package/dist/assets/Badge-BTktKAv_.css +1 -0
- package/dist/assets/{Badge.stories-CvhsYu7L.js → Badge.stories-BY6I7UQ6.js} +2 -2
- package/dist/assets/Box-Ci4ycgSn.css +1 -0
- package/dist/assets/Box.stories-DF2h791P.js +44 -0
- package/dist/assets/{Button-Dy26oY0t.js → Button-CWNujLtP.js} +1 -1
- package/dist/assets/Button-Cjld0T4n.css +1 -0
- package/dist/assets/{Button-CjrFqtK6.css → Button-NXZW8cHc.css} +1 -1
- package/dist/assets/Button-itdvNgOg.js +1 -0
- package/dist/assets/{Button.stories-C3ImqpQo.js → Button.stories-DUHAAHTV.js} +1 -1
- package/dist/assets/ButtonBase-CJjNfOwu.js +8 -0
- package/dist/assets/{ButtonBase-CZ1X_2UT.css → ButtonBase-ixkzvA2i.css} +1 -1
- package/dist/assets/Chips-2wQm6zLU.css +1 -0
- package/dist/assets/{Chips.stories-DvnrQpsy.js → Chips.stories-C4g0ajtC.js} +6 -6
- package/dist/assets/{Color-YHDXOIA2-Dz3WhSmf.js → Color-YHDXOIA2-n0bEiukQ.js} +1 -1
- package/dist/assets/Dialog-BKWHIlGs.css +1 -0
- package/dist/assets/{Dialog.stories-DFaL3AMR.js → Dialog.stories-D74D9Tdn.js} +10 -10
- package/dist/assets/{DocsRenderer-CFRXHY34-rpqlGaZf.js → DocsRenderer-CFRXHY34-BhNva4nY.js} +1 -1
- package/dist/assets/{FieldAdditionalText-BCMB8JHW.js → FieldAdditionalText-BiaO_Yss.js} +1 -1
- package/dist/assets/FieldAdditionalText-tbMWNWhN.css +1 -0
- package/dist/assets/{FieldAdditionalText.stories-BTKc3XUo.js → FieldAdditionalText.stories-CgNnZYRi.js} +1 -1
- package/dist/assets/{FieldButton-BK6nCNDL.css → FieldButton-B_tn3Eq6.css} +1 -1
- package/dist/assets/{FieldButton-BbLI1MM0.js → FieldButton-D0MgvwIU.js} +1 -1
- package/dist/assets/{FieldButton.stories-vpLl5qi7.js → FieldButton.stories-ChS0IeCP.js} +1 -1
- package/dist/assets/FieldLayout-6dPZQnKP.css +1 -0
- package/dist/assets/{FieldLayout-zG6DP4fD.js → FieldLayout-BbLKeSmh.js} +1 -1
- package/dist/assets/{FieldLayout.stories-BcIZKltP.js → FieldLayout.stories-C5bw8Efg.js} +1 -1
- package/dist/assets/{FieldLayoutBase-CbZWkNI7.js → FieldLayoutBase-DhKLFBcH.js} +3 -3
- package/dist/assets/FieldLayoutBase-_Sj6YO8M.css +1 -0
- package/dist/assets/{Heading-B_ZQCeib.css → Heading-Ba64-F3t.css} +1 -1
- package/dist/assets/Heading-DcJnmvUa.js +2 -0
- package/dist/assets/{Heading.stories-MSLqIH2n.js → Heading.stories-D9Zye7km.js} +1 -1
- package/dist/assets/Icon-BQSXaoh3.css +1 -0
- package/dist/assets/Icon-ByBuC1kf.css +1 -0
- package/dist/assets/Icon-DbIHupWZ.js +8 -0
- package/dist/assets/{Icon-RSC-Z5MLssxb.js → Icon-RSC-YupbVJQy.js} +1 -1
- package/dist/assets/Icon-pHhBCzBO.js +1 -0
- package/dist/assets/{Icon.stories-DoZhZVXF.js → Icon.stories-jVWnmDlZ.js} +1 -1
- package/dist/assets/{IconButton-DMtc1AqT.js → IconButton-C3AcGEY7.js} +1 -1
- package/dist/assets/InputText-CL5Snaht.js +5 -0
- package/dist/assets/{LayoutFlex-DJgUW3tI.js → LayoutFlex-BOiDmozK.js} +1 -1
- package/dist/assets/{LayoutFlex-Cj8q1bY9.js → LayoutFlex-D2upWEjL.js} +1 -1
- package/dist/assets/LayoutFlexItem-BWKgsCDT.css +1 -0
- package/dist/assets/{LayoutFlexItem-C1qrSn1R.js → LayoutFlexItem-Su5RvuQk.js} +1 -1
- package/dist/assets/LayoutGrid-BG29rjrt.js +1 -0
- package/dist/assets/LayoutGrid-BId9Yglz.css +1 -0
- package/dist/assets/LayoutGrid-Cw_n5H21.css +1 -0
- package/dist/assets/{LayoutGrid.stories-BNUhVFei.js → LayoutGrid.stories-DKw5d1ZE.js} +3 -3
- package/dist/assets/LayoutGridItem-C-iUb7WL.css +1 -0
- package/dist/assets/LayoutGridItem-D5Hb9kQy.js +1 -0
- package/dist/assets/Link-LMW4jOcv.css +1 -0
- package/dist/assets/{Link.stories-KUuvoGXv.js → Link.stories-BSLk0Pem.js} +5 -5
- package/dist/assets/Loader-Bx87E7sh.css +1 -0
- package/dist/assets/{Loader.stories-C7oYgr7U.js → Loader.stories-DUgJSe87.js} +1 -1
- package/dist/assets/NumberField.stories-DzaH3Pwj.js +203 -0
- package/dist/assets/{ObserveIntersection-Ccn6ggRl.js → ObserveIntersection-D396wl1Z.js} +1 -1
- package/dist/assets/{ObserveIntersection.stories-CK5RwCMK.js → ObserveIntersection.stories-DIe0cEvy.js} +1 -1
- package/dist/assets/{OnboardingTooltip-DuoU0OG7.js → OnboardingTooltip-Bl0XDogf.js} +1 -1
- package/dist/assets/OnboardingTooltip-DceGOXFO.css +1 -0
- package/dist/assets/{OnboardingTooltip.stories-C7TCPsRd.js → OnboardingTooltip.stories-B0FIL9CU.js} +1 -1
- package/dist/assets/{OnboardingTooltip.tests.stories-CR7peq2A.js → OnboardingTooltip.tests.stories-JJZpRwk6.js} +1 -1
- package/dist/assets/{OnboardingTour-a1foGtP0.css → OnboardingTour-DaxzhhRL.css} +1 -1
- package/dist/assets/{OnboardingTour-D5pUyw-H.js → OnboardingTour-pR_NmiBL.js} +1 -1
- package/dist/assets/{OnboardingTour.stories-CHE5u2N9.js → OnboardingTour.stories--g6PQm9S.js} +1 -1
- package/dist/assets/{OnboardingTour.tests.stories-L1SItA_o.js → OnboardingTour.tests.stories-QS0jiTXB.js} +1 -1
- package/dist/assets/PasswordField.stories-BPdZcEeu.js +203 -0
- package/dist/assets/PreplyLogo-DnbCD6MN.css +1 -0
- package/dist/assets/{PreplyLogo.stories-U59VXeLV.js → PreplyLogo.stories-DyGEUhO3.js} +4 -4
- package/dist/assets/{ProgressBar-wu_9uvGg.css → ProgressBar-BHaYRC97.css} +1 -1
- package/dist/assets/{ProgressBar.stories-CJHzGMBI.js → ProgressBar.stories-C3Hx8JBS.js} +1 -1
- package/dist/assets/{ProgressSteps-D0sRQY_x.js → ProgressSteps-7jb0rnSw.js} +1 -1
- package/dist/assets/ProgressSteps-HPd6w_Nr.css +1 -0
- package/dist/assets/{ProgressSteps.stories-C_1GQ6Wk.js → ProgressSteps.stories-C4sfVcPt.js} +1 -1
- package/dist/assets/SelectField-DMcbwWwy.css +1 -0
- package/dist/assets/SelectField.stories-C3X-5JHt.js +182 -0
- package/dist/assets/{ShowOnIntersection.stories-D4B8EpSn.js → ShowOnIntersection.stories-BYz5GE4A.js} +1 -1
- package/dist/assets/Spinner-CixbAVEL.css +1 -0
- package/dist/assets/{Spinner-DgGnJd2k.js → Spinner-Iaah9nUJ.js} +1 -1
- package/dist/assets/Steps-CRCACZIC.css +1 -0
- package/dist/assets/{Steps-BC67AT21.js → Steps-CfdqlU3Q.js} +2 -2
- package/dist/assets/{Steps.stories-Croh-b85.js → Steps.stories-D3jWUCfp.js} +1 -1
- package/dist/assets/{Text-j7spMxpW.css → Text-CxaHmdy3.css} +1 -1
- package/dist/assets/Text-i5U7-KMF.js +1 -0
- package/dist/assets/Text-nWyCR02l.js +1 -0
- package/dist/assets/{Text.stories-D2QDcBIa.js → Text.stories-MU-T7clI.js} +1 -1
- package/dist/assets/TextField-CVWDg_y4.css +1 -0
- package/dist/assets/TextField-DFm3O-Tl.js +1 -0
- package/dist/assets/{TextField.stories-BlZcgyOD.js → TextField.stories-CXDhM8SN.js} +1 -1
- package/dist/assets/TextHighlighted-CgBvDnFO.css +1 -0
- package/dist/assets/TextHighlighted-LVoJ79mt.js +1 -0
- package/dist/assets/{TextHighlighted.stories-D5eTvy-x.js → TextHighlighted.stories-Db5JA9US.js} +3 -3
- package/dist/assets/TextInline-BWC2_5IX.css +1 -0
- package/dist/assets/{TextInline.stories-4RVYUyo7.js → TextInline.stories-DGBhhF71.js} +3 -3
- package/dist/assets/TextareaField.stories-8FWfbQuv.js +221 -0
- package/dist/assets/Toast-BrvHWUik.css +1 -0
- package/dist/assets/{Toast.stories-C1rwf1P4.js → Toast.stories-D7QEZPb5.js} +2 -2
- package/dist/assets/Tooltip-xWfAzqNZ.css +1 -0
- package/dist/assets/{Tooltip-BcWLgQdz.js → Tooltip-zv_6ckj2.js} +1 -1
- package/dist/assets/{Tooltip.stories-C_eulyA8.js → Tooltip.stories-qNBQgLBX.js} +1 -1
- package/dist/assets/{Tooltip.tests.stories-CNSvrg-a.js → Tooltip.tests.stories-DdHKI1ve.js} +1 -1
- package/dist/assets/{breakpoints-DD1YjD9M.js → breakpoints-DTrgfqbR.js} +1 -1
- package/dist/assets/{breakpoints-Owi7Squn.js → breakpoints-LpH7GcYD.js} +1 -1
- package/dist/assets/{breakpoints-C8FPGqgF.js → breakpoints-zK4Z5SKD.js} +1 -1
- package/dist/assets/{changelog-BDm_gPnt.js → changelog-kNvLUHOz.js} +8 -3
- package/dist/assets/{entry-preview-Djan81pS.js → entry-preview-DjAFPLGc.js} +1 -1
- package/dist/assets/{getTokenVar-D087RqJE.js → getTokenVar-BIGy16TO.js} +1 -1
- package/dist/assets/{hover-CrLn2ebs.js → hover-CRiTDNhR.js} +1 -1
- package/dist/assets/{hover-Bacj4cI5.js → hover-CaTImSM4.js} +1 -1
- package/dist/assets/{hover-C9JcRjWU.js → hover-p3QJEZw5.js} +1 -1
- package/dist/assets/{iframe-CDRtj9ru.js → iframe-9Hj_MNfh.js} +2 -2
- package/dist/assets/{index-CvmVTRnc.js → index-BXfuwMTe.js} +1 -1
- package/dist/assets/{index-CV8DVSiW.js → index-DRVMKRNe.js} +3 -3
- package/dist/assets/{intro-BVNrHHEI.js → intro-DzWewgwc.js} +1 -1
- package/dist/assets/layout-relative-BCl7bwOR.css +1 -0
- package/dist/assets/layout-relative-DIZ6zNub.css +1 -0
- package/dist/assets/layout-relative-PI7LimOc.css +1 -0
- package/dist/assets/layout-relative-UGlXPWqj.js +1 -0
- package/dist/assets/layout-relative.module-C63T27Fr.js +1 -0
- package/dist/assets/layout-relative.module-DIaUqnvq-DH_OPu7E.js +1 -0
- package/dist/assets/{migrating-from-less-Dr8tG-us.js → migrating-from-less-tN-JFjco.js} +1 -1
- package/dist/assets/playground-D77Ee-EK.css +1 -0
- package/dist/assets/{playground.stories-BLiukQbS.js → playground.stories-DMK1ZcmP.js} +2 -2
- package/dist/assets/{preview-CfQRgEmh.js → preview-BCYWUPon.js} +1 -1
- package/dist/assets/{preview-1ef74z28.js → preview-BI7kN1TP.js} +2 -2
- package/dist/assets/{preview-EanVfwSK.js → preview-CvW0gOh5.js} +1 -1
- package/dist/assets/text-accent-BBah0rth.js +1 -0
- package/dist/assets/text-accent-BMdpzlaC.js +1 -0
- package/dist/assets/text-accent-Co1hrpvA.css +1 -0
- package/dist/assets/text-centered-DWGGTNIZ.css +1 -0
- package/dist/assets/text-centered-NqfVCsvd.css +1 -0
- package/dist/assets/text-centered-VuFsr_qt.js +1 -0
- package/dist/assets/text-centered-gMYE7PWw.js +1 -0
- package/dist/assets/{tokens-DX2Hf4qt.js → tokens-C0oPORlF.js} +1 -1
- package/dist/assets/{tokens-noSXbqGF.js → tokens-d5jI-VhO.js} +1 -1
- package/dist/assets/{tokens-BtYQ8W_y.js → tokens-kLWqWJLR.js} +1 -1
- package/dist/assets/{usePortalElement-o38kz4UN.js → usePortalElement-D3vRKAB1.js} +1 -1
- package/dist/assets/{welcome-CnT01hD4.js → welcome-CvEfK4A3.js} +1 -1
- package/dist/assets/{zeroheight-BUMgok6n.js → zeroheight-wKcu_QWZ.js} +1 -1
- package/dist/iframe.html +1 -1
- package/dist/preview-stats.json +1175 -1175
- package/dist/project.json +1 -1
- package/package.json +3 -3
- package/dist/assets/AlertDialog-DSR7lwcr.css +0 -1
- package/dist/assets/Avatar-CY8LENR_.css +0 -1
- package/dist/assets/Avatar-DBYAA8jq.js +0 -6
- package/dist/assets/Avatar-Vaj5CZzo.js +0 -1
- package/dist/assets/Avatar-yGngrFRe.css +0 -1
- package/dist/assets/AvatarWithStatus-C-I9yxMp.css +0 -1
- package/dist/assets/Badge-BDfgu9OD.css +0 -1
- package/dist/assets/Box-Dl-QnUHN.css +0 -1
- package/dist/assets/Box.stories-nJvB5AvT.js +0 -44
- package/dist/assets/Button-CDbUPX5z.css +0 -1
- package/dist/assets/Button-DoDXFggu.js +0 -1
- package/dist/assets/ButtonBase-C6zIOZ7w.js +0 -8
- package/dist/assets/Chips-D3NfThf2.css +0 -1
- package/dist/assets/Dialog-DHOGtHBQ.css +0 -1
- package/dist/assets/FieldAdditionalText-BtVADuTn.css +0 -1
- package/dist/assets/FieldLayout-DC-YB5tP.css +0 -1
- package/dist/assets/FieldLayoutBase-Dv-ccXqK.css +0 -1
- package/dist/assets/Heading-DPPEK9A1.js +0 -2
- package/dist/assets/Icon-BNvtTXpG.js +0 -8
- package/dist/assets/Icon-DaYbmtvu.css +0 -1
- package/dist/assets/Icon-DdGCYYnw.css +0 -1
- package/dist/assets/Icon-wXkY19lJ.js +0 -1
- package/dist/assets/InputText-DAMAB4Tc.js +0 -5
- package/dist/assets/LayoutFlexItem-BIkIcH4n.css +0 -1
- package/dist/assets/LayoutGrid-DLuh585c.js +0 -1
- package/dist/assets/LayoutGrid-DMbtqKwQ.css +0 -1
- package/dist/assets/LayoutGrid-DqCfK2vN.css +0 -1
- package/dist/assets/LayoutGridItem-BissFQZa.css +0 -1
- package/dist/assets/LayoutGridItem-Cl02VDid.js +0 -1
- package/dist/assets/Link-CZvqSjA-.css +0 -1
- package/dist/assets/Loader-CPdt-2H5.css +0 -1
- package/dist/assets/NumberField.stories-EBr9TWOu.js +0 -203
- package/dist/assets/OnboardingTooltip-ih2-H7aT.css +0 -1
- package/dist/assets/PasswordField.stories-BbIVWXCg.js +0 -203
- package/dist/assets/PreplyLogo-DzP78T2L.css +0 -1
- package/dist/assets/ProgressSteps-e3-CbmW-.css +0 -1
- package/dist/assets/SelectField-DtmQqReE.css +0 -1
- package/dist/assets/SelectField.stories-Dbbnnm8r.js +0 -182
- package/dist/assets/Spinner-CXZtxZbo.css +0 -1
- package/dist/assets/Steps-BemYpgTr.css +0 -1
- package/dist/assets/Text-BQv_D3Xd.js +0 -1
- package/dist/assets/Text-C4DBPFZ_.js +0 -1
- package/dist/assets/TextField-4eAvmy7R.js +0 -1
- package/dist/assets/TextField-QAPIvMQf.css +0 -1
- package/dist/assets/TextHighlighted-D1Eq_O3M.js +0 -1
- package/dist/assets/TextHighlighted-Kfu8Cikz.css +0 -1
- package/dist/assets/TextInline-CieB8GiR.css +0 -1
- package/dist/assets/TextareaField.stories-Bp5XBUFn.js +0 -221
- package/dist/assets/Toast-BxY7edbh.css +0 -1
- package/dist/assets/Tooltip-C4RcESB2.css +0 -1
- package/dist/assets/layout-relative-ByAioz3N.css +0 -1
- package/dist/assets/layout-relative-DL5GCYL3.css +0 -1
- package/dist/assets/layout-relative-DX2HhfVy.css +0 -1
- package/dist/assets/layout-relative-vwhQiHRS.js +0 -1
- package/dist/assets/layout-relative.module-BIEPDZE2-CYlDcUGJ.js +0 -1
- package/dist/assets/layout-relative.module-Cmd2g7hD.js +0 -1
- package/dist/assets/playground-66zMGCdb.css +0 -1
- package/dist/assets/text-accent-BbQDH9df.js +0 -1
- package/dist/assets/text-accent-DwQPHwM2.js +0 -1
- package/dist/assets/text-accent-UmsGcNvp.css +0 -1
- package/dist/assets/text-centered-BwHG-She.js +0 -1
- package/dist/assets/text-centered-Do6zdubZ.css +0 -1
- package/dist/assets/text-centered-J90FiEm7.css +0 -1
- package/dist/assets/text-centered-zQ_girwR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as N}from"./index-Cb9e4tly.js";import{g as E,a as P,b as R}from"./layout-relative-vwhQiHRS.js";import{f as A}from"./filterHTMLAttributes-DYdLqcvH.js";import{m as w,a as H,s as f}from"./classNames-BUL1Zq7e.js";import{g as T}from"./index-DdzHuZ-Y.js";import{L as V,k as U,f as $}from"./defaults-B1rzzf6M.js";import{w as h}from"./componentNames-Bwls0I02.js";import{B as W}from"./breakpoints-BfMlrtxE.js";import{s as Y,g as M}from"./layout-relative.module-Cmd2g7hD.js";import{S as o,a as z}from"./consts-KAYct7Gj.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./constants-DYYVurUY.js";const F="_LayoutGridItem_2tq6r_1",B={LayoutGridItem:F},L=N.forwardRef(function({children:u,alignSelf:n,tag:a,hide:r,relative:i,dataset:s,...d},l){const m=w(B,h.LayoutGridItem,[]),y=E(n),c=P(r),G=R(i),g=[...m,...y,...c,...G],O=a??V,D={...A(d),ref:l,className:g.join(" "),...T(s,{preplyDsComponent:h.LayoutGridItem})};return t.jsx(O,{...D,children:u})});try{L.displayName="LayoutGridItem",L.__docgenInfo={description:"",displayName:"LayoutGridItem",props:{alignSelf:{defaultValue:null,description:"",name:"alignSelf",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"stretch"'},{value:"ResponsiveProp<LayoutAlignSelf>"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"p"'},{value:'"div"'},{value:'"span"'},{value:'"main"'},{value:'"header"'},{value:'"footer"'},{value:'"article"'},{value:'"section"'},{value:'"ul"'},{value:'"ol"'},{value:'"li"'},{value:'"fieldset"'},{value:'"table"'},{value:'"th"'},{value:'"tr"'},{value:'"td"'},{value:'"thead"'},{value:'"tfoot"'},{value:'"tbody"'},{value:'"caption"'},{value:'"figure"'},{value:'"figcaption"'}]}},hide:{defaultValue:null,description:"",name:"hide",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},relative:{defaultValue:null,description:"",name:"relative",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},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: HTMLElement | null) => void"},{value:"RefObject<HTMLElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const J="_LayoutGrid_1uu3d_4",q={LayoutGrid:J,"LayoutGrid--justify-content-center":"_LayoutGrid--justify-content-center_1uu3d_14","LayoutGrid--justify-content-start":"_LayoutGrid--justify-content-start_1uu3d_17","LayoutGrid--justify-content-end":"_LayoutGrid--justify-content-end_1uu3d_20","LayoutGrid--justify-content-space-between":"_LayoutGrid--justify-content-space-between_1uu3d_23","LayoutGrid--justify-content-space-around":"_LayoutGrid--justify-content-space-around_1uu3d_26","LayoutGrid--justify-content-space-evenly":"_LayoutGrid--justify-content-space-evenly_1uu3d_29","LayoutGrid--narrow-l--justify-content-center":"_LayoutGrid--narrow-l--justify-content-center_1uu3d_33","LayoutGrid--narrow-l--justify-content-start":"_LayoutGrid--narrow-l--justify-content-start_1uu3d_36","LayoutGrid--narrow-l--justify-content-end":"_LayoutGrid--narrow-l--justify-content-end_1uu3d_39","LayoutGrid--narrow-l--justify-content-space-between":"_LayoutGrid--narrow-l--justify-content-space-between_1uu3d_42","LayoutGrid--narrow-l--justify-content-space-around":"_LayoutGrid--narrow-l--justify-content-space-around_1uu3d_45","LayoutGrid--narrow-l--justify-content-space-evenly":"_LayoutGrid--narrow-l--justify-content-space-evenly_1uu3d_48","LayoutGrid--medium-s--justify-content-center":"_LayoutGrid--medium-s--justify-content-center_1uu3d_53","LayoutGrid--medium-s--justify-content-start":"_LayoutGrid--medium-s--justify-content-start_1uu3d_56","LayoutGrid--medium-s--justify-content-end":"_LayoutGrid--medium-s--justify-content-end_1uu3d_59","LayoutGrid--medium-s--justify-content-space-between":"_LayoutGrid--medium-s--justify-content-space-between_1uu3d_62","LayoutGrid--medium-s--justify-content-space-around":"_LayoutGrid--medium-s--justify-content-space-around_1uu3d_65","LayoutGrid--medium-s--justify-content-space-evenly":"_LayoutGrid--medium-s--justify-content-space-evenly_1uu3d_68","LayoutGrid--medium-l--justify-content-center":"_LayoutGrid--medium-l--justify-content-center_1uu3d_73","LayoutGrid--medium-l--justify-content-start":"_LayoutGrid--medium-l--justify-content-start_1uu3d_76","LayoutGrid--medium-l--justify-content-end":"_LayoutGrid--medium-l--justify-content-end_1uu3d_79","LayoutGrid--medium-l--justify-content-space-between":"_LayoutGrid--medium-l--justify-content-space-between_1uu3d_82","LayoutGrid--medium-l--justify-content-space-around":"_LayoutGrid--medium-l--justify-content-space-around_1uu3d_85","LayoutGrid--medium-l--justify-content-space-evenly":"_LayoutGrid--medium-l--justify-content-space-evenly_1uu3d_88","LayoutGrid--wide-s--justify-content-center":"_LayoutGrid--wide-s--justify-content-center_1uu3d_93","LayoutGrid--wide-s--justify-content-start":"_LayoutGrid--wide-s--justify-content-start_1uu3d_96","LayoutGrid--wide-s--justify-content-end":"_LayoutGrid--wide-s--justify-content-end_1uu3d_99","LayoutGrid--wide-s--justify-content-space-between":"_LayoutGrid--wide-s--justify-content-space-between_1uu3d_102","LayoutGrid--wide-s--justify-content-space-around":"_LayoutGrid--wide-s--justify-content-space-around_1uu3d_105","LayoutGrid--wide-s--justify-content-space-evenly":"_LayoutGrid--wide-s--justify-content-space-evenly_1uu3d_108","LayoutGrid--wide-l--justify-content-center":"_LayoutGrid--wide-l--justify-content-center_1uu3d_113","LayoutGrid--wide-l--justify-content-start":"_LayoutGrid--wide-l--justify-content-start_1uu3d_116","LayoutGrid--wide-l--justify-content-end":"_LayoutGrid--wide-l--justify-content-end_1uu3d_119","LayoutGrid--wide-l--justify-content-space-between":"_LayoutGrid--wide-l--justify-content-space-between_1uu3d_122","LayoutGrid--wide-l--justify-content-space-around":"_LayoutGrid--wide-l--justify-content-space-around_1uu3d_125","LayoutGrid--wide-l--justify-content-space-evenly":"_LayoutGrid--wide-l--justify-content-space-evenly_1uu3d_128","LayoutGrid--align-items-center":"_LayoutGrid--align-items-center_1uu3d_132","LayoutGrid--align-items-start":"_LayoutGrid--align-items-start_1uu3d_135","LayoutGrid--align-items-end":"_LayoutGrid--align-items-end_1uu3d_138","LayoutGrid--align-items-stretch":"_LayoutGrid--align-items-stretch_1uu3d_141","LayoutGrid--align-items-baseline":"_LayoutGrid--align-items-baseline_1uu3d_144","LayoutGrid--narrow-l--align-items-center":"_LayoutGrid--narrow-l--align-items-center_1uu3d_148","LayoutGrid--narrow-l--align-items-start":"_LayoutGrid--narrow-l--align-items-start_1uu3d_151","LayoutGrid--narrow-l--align-items-end":"_LayoutGrid--narrow-l--align-items-end_1uu3d_154","LayoutGrid--narrow-l--align-items-stretch":"_LayoutGrid--narrow-l--align-items-stretch_1uu3d_157","LayoutGrid--narrow-l--align-items-baseline":"_LayoutGrid--narrow-l--align-items-baseline_1uu3d_160","LayoutGrid--medium-s--align-items-center":"_LayoutGrid--medium-s--align-items-center_1uu3d_165","LayoutGrid--medium-s--align-items-start":"_LayoutGrid--medium-s--align-items-start_1uu3d_168","LayoutGrid--medium-s--align-items-end":"_LayoutGrid--medium-s--align-items-end_1uu3d_171","LayoutGrid--medium-s--align-items-stretch":"_LayoutGrid--medium-s--align-items-stretch_1uu3d_174","LayoutGrid--medium-s--align-items-baseline":"_LayoutGrid--medium-s--align-items-baseline_1uu3d_177","LayoutGrid--medium-l--align-items-center":"_LayoutGrid--medium-l--align-items-center_1uu3d_182","LayoutGrid--medium-l--align-items-start":"_LayoutGrid--medium-l--align-items-start_1uu3d_185","LayoutGrid--medium-l--align-items-end":"_LayoutGrid--medium-l--align-items-end_1uu3d_188","LayoutGrid--medium-l--align-items-stretch":"_LayoutGrid--medium-l--align-items-stretch_1uu3d_191","LayoutGrid--medium-l--align-items-baseline":"_LayoutGrid--medium-l--align-items-baseline_1uu3d_194","LayoutGrid--wide-s--align-items-center":"_LayoutGrid--wide-s--align-items-center_1uu3d_199","LayoutGrid--wide-s--align-items-start":"_LayoutGrid--wide-s--align-items-start_1uu3d_202","LayoutGrid--wide-s--align-items-end":"_LayoutGrid--wide-s--align-items-end_1uu3d_205","LayoutGrid--wide-s--align-items-stretch":"_LayoutGrid--wide-s--align-items-stretch_1uu3d_208","LayoutGrid--wide-s--align-items-baseline":"_LayoutGrid--wide-s--align-items-baseline_1uu3d_211","LayoutGrid--wide-l--align-items-center":"_LayoutGrid--wide-l--align-items-center_1uu3d_216","LayoutGrid--wide-l--align-items-start":"_LayoutGrid--wide-l--align-items-start_1uu3d_219","LayoutGrid--wide-l--align-items-end":"_LayoutGrid--wide-l--align-items-end_1uu3d_222","LayoutGrid--wide-l--align-items-stretch":"_LayoutGrid--wide-l--align-items-stretch_1uu3d_225","LayoutGrid--wide-l--align-items-baseline":"_LayoutGrid--wide-l--align-items-baseline_1uu3d_228","LayoutGrid--justify-items-stretch":"_LayoutGrid--justify-items-stretch_1uu3d_232","LayoutGrid--justify-items-center":"_LayoutGrid--justify-items-center_1uu3d_235","LayoutGrid--justify-items-start":"_LayoutGrid--justify-items-start_1uu3d_238","LayoutGrid--justify-items-end":"_LayoutGrid--justify-items-end_1uu3d_241","LayoutGrid--narrow-l--justify-items-stretch":"_LayoutGrid--narrow-l--justify-items-stretch_1uu3d_245","LayoutGrid--narrow-l--justify-items-center":"_LayoutGrid--narrow-l--justify-items-center_1uu3d_248","LayoutGrid--narrow-l--justify-items-start":"_LayoutGrid--narrow-l--justify-items-start_1uu3d_251","LayoutGrid--narrow-l--justify-items-end":"_LayoutGrid--narrow-l--justify-items-end_1uu3d_254","LayoutGrid--medium-s--justify-items-stretch":"_LayoutGrid--medium-s--justify-items-stretch_1uu3d_259","LayoutGrid--medium-s--justify-items-center":"_LayoutGrid--medium-s--justify-items-center_1uu3d_262","LayoutGrid--medium-s--justify-items-start":"_LayoutGrid--medium-s--justify-items-start_1uu3d_265","LayoutGrid--medium-s--justify-items-end":"_LayoutGrid--medium-s--justify-items-end_1uu3d_268","LayoutGrid--medium-l--justify-items-stretch":"_LayoutGrid--medium-l--justify-items-stretch_1uu3d_273","LayoutGrid--medium-l--justify-items-center":"_LayoutGrid--medium-l--justify-items-center_1uu3d_276","LayoutGrid--medium-l--justify-items-start":"_LayoutGrid--medium-l--justify-items-start_1uu3d_279","LayoutGrid--medium-l--justify-items-end":"_LayoutGrid--medium-l--justify-items-end_1uu3d_282","LayoutGrid--wide-s--justify-items-stretch":"_LayoutGrid--wide-s--justify-items-stretch_1uu3d_287","LayoutGrid--wide-s--justify-items-center":"_LayoutGrid--wide-s--justify-items-center_1uu3d_290","LayoutGrid--wide-s--justify-items-start":"_LayoutGrid--wide-s--justify-items-start_1uu3d_293","LayoutGrid--wide-s--justify-items-end":"_LayoutGrid--wide-s--justify-items-end_1uu3d_296","LayoutGrid--wide-l--justify-items-stretch":"_LayoutGrid--wide-l--justify-items-stretch_1uu3d_301","LayoutGrid--wide-l--justify-items-center":"_LayoutGrid--wide-l--justify-items-center_1uu3d_304","LayoutGrid--wide-l--justify-items-start":"_LayoutGrid--wide-l--justify-items-start_1uu3d_307","LayoutGrid--wide-l--justify-items-end":"_LayoutGrid--wide-l--justify-items-end_1uu3d_310","LayoutGrid--columns":"_LayoutGrid--columns_1uu3d_314","LayoutGrid--columns-narrow-l":"_LayoutGrid--columns-narrow-l_1uu3d_318","LayoutGrid--columns-medium-s":"_LayoutGrid--columns-medium-s_1uu3d_323","LayoutGrid--columns-medium-l":"_LayoutGrid--columns-medium-l_1uu3d_328","LayoutGrid--columns-wide-s":"_LayoutGrid--columns-wide-s_1uu3d_333","LayoutGrid--columns-wide-l":"_LayoutGrid--columns-wide-l_1uu3d_338"},K="LayoutGrid",Q=Object.keys(W),j=e=>typeof e=="number"?`repeat(${e}, 1fr)`:e.join(" "),X=e=>typeof e=="object"&&!Array.isArray(e)?Object.entries(e).reduce((u,[n,a])=>({...u,...a?{[n]:j(a)}:{}}),{_:j(e._)}):{_:j(e)},Z=e=>{if(!e)return{classNames:[],style:{}};const u=X(e),n=Q.filter(i=>u[i]),a=H(q,K,["columns",...n.map(i=>`columns-${i}`)]),r=n.reduce((i,s)=>({...i,[`--columns-${s}`]:u[s]}),{"--columns":u._});return{classNames:a,style:r}},ee="LayoutGap",te=e=>w(Y,ee,[f("gap",e)]),ae="LayoutGrid",ue=(e,u)=>{const{gap:n=U,padding:a=$,justifyContent:r,alignItems:i,justifyItems:s,hide:d,relative:l}=u||{},m=w(q,ae,[f("justify-content",r),f("align-items",i),f("justify-items",s)]),y=te(n),c=M(a),G=P(d,"grid"),g=R(l);return[...m,...y,...c,...G,...g]},v=N.forwardRef(function({dataset:u,children:n,...a},r){const{tag:i=V,columns:s}=a,d=ue("grid",a),{style:l,classNames:m}=Z(s),y=[...d,...m],c={...A(a),ref:r,className:y.join(" "),style:l,...T(u,{preplyDsComponent:h.LayoutGrid})};return t.jsx(i,{...c,children:n})});try{v.displayName="LayoutGrid",v.__docgenInfo={description:"A CSS `grid` wrapper.",displayName:"LayoutGrid",props:{gap:{defaultValue:null,description:"",name:"gap",required:!1,type:{name:"enum",value:[{value:'"2xs"'},{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"xl"'},{value:'"24"'},{value:'"32"'},{value:'"48"'},{value:'"64"'},{value:'"96"'},{value:'"160"'},{value:'"16"'},{value:'"none"'},{value:'"3xs"'},{value:"ResponsiveProp<LayoutGap>"},{value:'"0"'},{value:'"1"'},{value:'"2"'},{value:'"4"'},{value:'"8"'},{value:'"12"'},{value:'"20"'},{value:"ResponsiveProp<Spacing>"}]}},padding:{defaultValue:null,description:"",name:"padding",required:!1,type:{name:"enum",value:[{value:'"2xs"'},{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"xl"'},{value:'"24"'},{value:'"32"'},{value:'"48"'},{value:'"64"'},{value:'"96"'},{value:'"160"'},{value:'"16"'},{value:'"none"'},{value:'"3xs"'},{value:'"0"'},{value:'"1"'},{value:'"2"'},{value:'"4"'},{value:'"8"'},{value:'"12"'},{value:'"20"'},{value:"[LayoutPadding, LayoutPadding]"},{value:"[LayoutPadding, LayoutPadding, LayoutPadding]"},{value:"[LayoutPadding, LayoutPadding, LayoutPadding, LayoutPadding]"},{value:"[Spacing, Spacing]"},{value:"[Spacing, Spacing, Spacing]"},{value:"[Spacing, Spacing, Spacing, Spacing]"},{value:"ResponsiveProp<ShortHand<LayoutPadding> | ShortHand<Spacing>>"}]}},columns:{defaultValue:null,description:"The `number` of columns, or a `string[]` of `grid-template-columns`.\n@see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns}",name:"columns",required:!1,type:{name:"enum",value:[{value:"number"},{value:"string[]"},{value:"ResponsiveProp<number | string[]>"}]}},justifyContent:{defaultValue:null,description:"",name:"justifyContent",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"space-between"'},{value:'"space-around"'},{value:'"space-evenly"'},{value:"ResponsiveProp<LayoutJustifyContent>"}]}},alignItems:{defaultValue:null,description:"",name:"alignItems",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"stretch"'},{value:'"baseline"'},{value:"ResponsiveProp<LayoutAlignItems>"}]}},justifyItems:{defaultValue:null,description:"",name:"justifyItems",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"stretch"'},{value:"ResponsiveProp<LayoutJustifyItems>"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"p"'},{value:'"div"'},{value:'"span"'},{value:'"main"'},{value:'"header"'},{value:'"footer"'},{value:'"article"'},{value:'"section"'},{value:'"ul"'},{value:'"ol"'},{value:'"li"'},{value:'"fieldset"'},{value:'"table"'},{value:'"th"'},{value:'"tr"'},{value:'"td"'},{value:'"thead"'},{value:'"tfoot"'},{value:'"tbody"'},{value:'"caption"'},{value:'"figure"'},{value:'"figcaption"'}]}},hide:{defaultValue:null,description:"",name:"hide",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},relative:{defaultValue:null,description:"",name:"relative",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},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: HTMLElement | null) => void"},{value:"RefObject<HTMLElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const ve={title:"components/LayoutGrid",component:v,subcomponents:{LayoutGridItem:L},argTypes:{gap:{description:o},padding:{description:z},columns:{description:o},justifyContent:{description:o},alignItems:{description:o},justifyItems:{description:o},hide:{description:o},relative:{description:o}}},_=()=>t.jsxs(v,{columns:4,alignItems:"start",gap:"xs",children:[t.jsx(L,{children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem"},children:[t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}}),t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}})]})}),t.jsx(L,{alignSelf:"end",children:t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}})}),t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}}),t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}})]});_.storyName="LayoutGrid";const p={parameters:{chromatic:{disableSnapshot:!0}},args:{gap:"16",columns:3,alignItems:"start",children:t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{minWidth:"100px",minHeight:50,backgroundColor:"hotpink"},children:" "}),t.jsx("div",{style:{minWidth:"100px",minHeight:75,backgroundColor:"hotpink"},children:" "}),t.jsx("div",{style:{minWidth:"100px",minHeight:100,backgroundColor:"hotpink",textAlign:"center"}})]}),dataset:{qaid:"layout-grid"}},argTypes:{dataset:{control:"object"},columns:{control:"number"},justifyItems:{control:"select"},hide:{control:"boolean"},relative:{control:"boolean"},children:{control:!1}}};var b,C,k;_.parameters={..._.parameters,docs:{...(b=_.parameters)==null?void 0:b.docs,source:{originalSource:`() => <LayoutGrid columns={4} alignItems="start" gap="xs">
|
|
1
|
+
import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as N}from"./index-Cb9e4tly.js";import{g as E,a as P,b as R}from"./layout-relative-UGlXPWqj.js";import{f as A}from"./filterHTMLAttributes-DYdLqcvH.js";import{m as w,a as H,s as L}from"./classNames-BUL1Zq7e.js";import{g as T}from"./index-DdzHuZ-Y.js";import{L as V,k as U,f as $}from"./defaults-B1rzzf6M.js";import{w as h}from"./componentNames-Bwls0I02.js";import{B as W}from"./breakpoints-BfMlrtxE.js";import{s as Y,g as M}from"./layout-relative.module-C63T27Fr.js";import{S as o,a as z}from"./consts-KAYct7Gj.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./constants-DYYVurUY.js";const F="_LayoutGridItem_2tq6r_1",B={LayoutGridItem:F},f=N.forwardRef(function({children:i,alignSelf:s,tag:a,hide:r,relative:n,dataset:u,...l},d){const m=w(B,h.LayoutGridItem,[]),y=E(s),v=P(r),G=R(n),g=[...m,...y,...v,...G],O=a??V,D={...A(l),ref:d,className:g.join(" "),...T(u,{preplyDsComponent:h.LayoutGridItem})};return t.jsx(O,{...D,children:i})});try{f.displayName="LayoutGridItem",f.__docgenInfo={description:"",displayName:"LayoutGridItem",props:{alignSelf:{defaultValue:null,description:"",name:"alignSelf",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"stretch"'},{value:"ResponsiveProp<LayoutAlignSelf>"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"div"'},{value:'"main"'},{value:'"header"'},{value:'"footer"'},{value:'"article"'},{value:'"section"'},{value:'"ul"'},{value:'"ol"'},{value:'"li"'},{value:'"p"'},{value:'"span"'},{value:'"fieldset"'},{value:'"table"'},{value:'"th"'},{value:'"tr"'},{value:'"td"'},{value:'"thead"'},{value:'"tfoot"'},{value:'"tbody"'},{value:'"caption"'},{value:'"figure"'},{value:'"figcaption"'}]}},hide:{defaultValue:null,description:"",name:"hide",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},relative:{defaultValue:null,description:"",name:"relative",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},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: HTMLElement | null) => void"},{value:"RefObject<HTMLElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const J="_LayoutGrid_f03vv_4",q={LayoutGrid:J,"LayoutGrid--justify-content-center":"_LayoutGrid--justify-content-center_f03vv_14","LayoutGrid--justify-content-start":"_LayoutGrid--justify-content-start_f03vv_17","LayoutGrid--justify-content-end":"_LayoutGrid--justify-content-end_f03vv_20","LayoutGrid--justify-content-space-between":"_LayoutGrid--justify-content-space-between_f03vv_23","LayoutGrid--justify-content-space-around":"_LayoutGrid--justify-content-space-around_f03vv_26","LayoutGrid--justify-content-space-evenly":"_LayoutGrid--justify-content-space-evenly_f03vv_29","LayoutGrid--narrow-l--justify-content-center":"_LayoutGrid--narrow-l--justify-content-center_f03vv_33","LayoutGrid--narrow-l--justify-content-start":"_LayoutGrid--narrow-l--justify-content-start_f03vv_36","LayoutGrid--narrow-l--justify-content-end":"_LayoutGrid--narrow-l--justify-content-end_f03vv_39","LayoutGrid--narrow-l--justify-content-space-between":"_LayoutGrid--narrow-l--justify-content-space-between_f03vv_42","LayoutGrid--narrow-l--justify-content-space-around":"_LayoutGrid--narrow-l--justify-content-space-around_f03vv_45","LayoutGrid--narrow-l--justify-content-space-evenly":"_LayoutGrid--narrow-l--justify-content-space-evenly_f03vv_48","LayoutGrid--medium-s--justify-content-center":"_LayoutGrid--medium-s--justify-content-center_f03vv_53","LayoutGrid--medium-s--justify-content-start":"_LayoutGrid--medium-s--justify-content-start_f03vv_56","LayoutGrid--medium-s--justify-content-end":"_LayoutGrid--medium-s--justify-content-end_f03vv_59","LayoutGrid--medium-s--justify-content-space-between":"_LayoutGrid--medium-s--justify-content-space-between_f03vv_62","LayoutGrid--medium-s--justify-content-space-around":"_LayoutGrid--medium-s--justify-content-space-around_f03vv_65","LayoutGrid--medium-s--justify-content-space-evenly":"_LayoutGrid--medium-s--justify-content-space-evenly_f03vv_68","LayoutGrid--medium-l--justify-content-center":"_LayoutGrid--medium-l--justify-content-center_f03vv_73","LayoutGrid--medium-l--justify-content-start":"_LayoutGrid--medium-l--justify-content-start_f03vv_76","LayoutGrid--medium-l--justify-content-end":"_LayoutGrid--medium-l--justify-content-end_f03vv_79","LayoutGrid--medium-l--justify-content-space-between":"_LayoutGrid--medium-l--justify-content-space-between_f03vv_82","LayoutGrid--medium-l--justify-content-space-around":"_LayoutGrid--medium-l--justify-content-space-around_f03vv_85","LayoutGrid--medium-l--justify-content-space-evenly":"_LayoutGrid--medium-l--justify-content-space-evenly_f03vv_88","LayoutGrid--wide-s--justify-content-center":"_LayoutGrid--wide-s--justify-content-center_f03vv_93","LayoutGrid--wide-s--justify-content-start":"_LayoutGrid--wide-s--justify-content-start_f03vv_96","LayoutGrid--wide-s--justify-content-end":"_LayoutGrid--wide-s--justify-content-end_f03vv_99","LayoutGrid--wide-s--justify-content-space-between":"_LayoutGrid--wide-s--justify-content-space-between_f03vv_102","LayoutGrid--wide-s--justify-content-space-around":"_LayoutGrid--wide-s--justify-content-space-around_f03vv_105","LayoutGrid--wide-s--justify-content-space-evenly":"_LayoutGrid--wide-s--justify-content-space-evenly_f03vv_108","LayoutGrid--wide-l--justify-content-center":"_LayoutGrid--wide-l--justify-content-center_f03vv_113","LayoutGrid--wide-l--justify-content-start":"_LayoutGrid--wide-l--justify-content-start_f03vv_116","LayoutGrid--wide-l--justify-content-end":"_LayoutGrid--wide-l--justify-content-end_f03vv_119","LayoutGrid--wide-l--justify-content-space-between":"_LayoutGrid--wide-l--justify-content-space-between_f03vv_122","LayoutGrid--wide-l--justify-content-space-around":"_LayoutGrid--wide-l--justify-content-space-around_f03vv_125","LayoutGrid--wide-l--justify-content-space-evenly":"_LayoutGrid--wide-l--justify-content-space-evenly_f03vv_128","LayoutGrid--align-items-center":"_LayoutGrid--align-items-center_f03vv_132","LayoutGrid--align-items-start":"_LayoutGrid--align-items-start_f03vv_135","LayoutGrid--align-items-end":"_LayoutGrid--align-items-end_f03vv_138","LayoutGrid--align-items-stretch":"_LayoutGrid--align-items-stretch_f03vv_141","LayoutGrid--align-items-baseline":"_LayoutGrid--align-items-baseline_f03vv_144","LayoutGrid--narrow-l--align-items-center":"_LayoutGrid--narrow-l--align-items-center_f03vv_148","LayoutGrid--narrow-l--align-items-start":"_LayoutGrid--narrow-l--align-items-start_f03vv_151","LayoutGrid--narrow-l--align-items-end":"_LayoutGrid--narrow-l--align-items-end_f03vv_154","LayoutGrid--narrow-l--align-items-stretch":"_LayoutGrid--narrow-l--align-items-stretch_f03vv_157","LayoutGrid--narrow-l--align-items-baseline":"_LayoutGrid--narrow-l--align-items-baseline_f03vv_160","LayoutGrid--medium-s--align-items-center":"_LayoutGrid--medium-s--align-items-center_f03vv_165","LayoutGrid--medium-s--align-items-start":"_LayoutGrid--medium-s--align-items-start_f03vv_168","LayoutGrid--medium-s--align-items-end":"_LayoutGrid--medium-s--align-items-end_f03vv_171","LayoutGrid--medium-s--align-items-stretch":"_LayoutGrid--medium-s--align-items-stretch_f03vv_174","LayoutGrid--medium-s--align-items-baseline":"_LayoutGrid--medium-s--align-items-baseline_f03vv_177","LayoutGrid--medium-l--align-items-center":"_LayoutGrid--medium-l--align-items-center_f03vv_182","LayoutGrid--medium-l--align-items-start":"_LayoutGrid--medium-l--align-items-start_f03vv_185","LayoutGrid--medium-l--align-items-end":"_LayoutGrid--medium-l--align-items-end_f03vv_188","LayoutGrid--medium-l--align-items-stretch":"_LayoutGrid--medium-l--align-items-stretch_f03vv_191","LayoutGrid--medium-l--align-items-baseline":"_LayoutGrid--medium-l--align-items-baseline_f03vv_194","LayoutGrid--wide-s--align-items-center":"_LayoutGrid--wide-s--align-items-center_f03vv_199","LayoutGrid--wide-s--align-items-start":"_LayoutGrid--wide-s--align-items-start_f03vv_202","LayoutGrid--wide-s--align-items-end":"_LayoutGrid--wide-s--align-items-end_f03vv_205","LayoutGrid--wide-s--align-items-stretch":"_LayoutGrid--wide-s--align-items-stretch_f03vv_208","LayoutGrid--wide-s--align-items-baseline":"_LayoutGrid--wide-s--align-items-baseline_f03vv_211","LayoutGrid--wide-l--align-items-center":"_LayoutGrid--wide-l--align-items-center_f03vv_216","LayoutGrid--wide-l--align-items-start":"_LayoutGrid--wide-l--align-items-start_f03vv_219","LayoutGrid--wide-l--align-items-end":"_LayoutGrid--wide-l--align-items-end_f03vv_222","LayoutGrid--wide-l--align-items-stretch":"_LayoutGrid--wide-l--align-items-stretch_f03vv_225","LayoutGrid--wide-l--align-items-baseline":"_LayoutGrid--wide-l--align-items-baseline_f03vv_228","LayoutGrid--justify-items-stretch":"_LayoutGrid--justify-items-stretch_f03vv_232","LayoutGrid--justify-items-center":"_LayoutGrid--justify-items-center_f03vv_235","LayoutGrid--justify-items-start":"_LayoutGrid--justify-items-start_f03vv_238","LayoutGrid--justify-items-end":"_LayoutGrid--justify-items-end_f03vv_241","LayoutGrid--narrow-l--justify-items-stretch":"_LayoutGrid--narrow-l--justify-items-stretch_f03vv_245","LayoutGrid--narrow-l--justify-items-center":"_LayoutGrid--narrow-l--justify-items-center_f03vv_248","LayoutGrid--narrow-l--justify-items-start":"_LayoutGrid--narrow-l--justify-items-start_f03vv_251","LayoutGrid--narrow-l--justify-items-end":"_LayoutGrid--narrow-l--justify-items-end_f03vv_254","LayoutGrid--medium-s--justify-items-stretch":"_LayoutGrid--medium-s--justify-items-stretch_f03vv_259","LayoutGrid--medium-s--justify-items-center":"_LayoutGrid--medium-s--justify-items-center_f03vv_262","LayoutGrid--medium-s--justify-items-start":"_LayoutGrid--medium-s--justify-items-start_f03vv_265","LayoutGrid--medium-s--justify-items-end":"_LayoutGrid--medium-s--justify-items-end_f03vv_268","LayoutGrid--medium-l--justify-items-stretch":"_LayoutGrid--medium-l--justify-items-stretch_f03vv_273","LayoutGrid--medium-l--justify-items-center":"_LayoutGrid--medium-l--justify-items-center_f03vv_276","LayoutGrid--medium-l--justify-items-start":"_LayoutGrid--medium-l--justify-items-start_f03vv_279","LayoutGrid--medium-l--justify-items-end":"_LayoutGrid--medium-l--justify-items-end_f03vv_282","LayoutGrid--wide-s--justify-items-stretch":"_LayoutGrid--wide-s--justify-items-stretch_f03vv_287","LayoutGrid--wide-s--justify-items-center":"_LayoutGrid--wide-s--justify-items-center_f03vv_290","LayoutGrid--wide-s--justify-items-start":"_LayoutGrid--wide-s--justify-items-start_f03vv_293","LayoutGrid--wide-s--justify-items-end":"_LayoutGrid--wide-s--justify-items-end_f03vv_296","LayoutGrid--wide-l--justify-items-stretch":"_LayoutGrid--wide-l--justify-items-stretch_f03vv_301","LayoutGrid--wide-l--justify-items-center":"_LayoutGrid--wide-l--justify-items-center_f03vv_304","LayoutGrid--wide-l--justify-items-start":"_LayoutGrid--wide-l--justify-items-start_f03vv_307","LayoutGrid--wide-l--justify-items-end":"_LayoutGrid--wide-l--justify-items-end_f03vv_310","LayoutGrid--columns":"_LayoutGrid--columns_f03vv_314","LayoutGrid--columns-narrow-l":"_LayoutGrid--columns-narrow-l_f03vv_318","LayoutGrid--columns-medium-s":"_LayoutGrid--columns-medium-s_f03vv_323","LayoutGrid--columns-medium-l":"_LayoutGrid--columns-medium-l_f03vv_328","LayoutGrid--columns-wide-s":"_LayoutGrid--columns-wide-s_f03vv_333","LayoutGrid--columns-wide-l":"_LayoutGrid--columns-wide-l_f03vv_338"},K="LayoutGrid",Q=Object.keys(W),j=e=>typeof e=="number"?`repeat(${e}, 1fr)`:e.join(" "),X=e=>typeof e=="object"&&!Array.isArray(e)?Object.entries(e).reduce((i,[s,a])=>({...i,...a?{[s]:j(a)}:{}}),{_:j(e._)}):{_:j(e)},Z=e=>{if(!e)return{classNames:[],style:{}};const i=X(e),s=Q.filter(n=>i[n]),a=H(q,K,["columns",...s.map(n=>`columns-${n}`)]),r=s.reduce((n,u)=>({...n,[`--columns-${u}`]:i[u]}),{"--columns":i._});return{classNames:a,style:r}},ee="LayoutGap",te=e=>w(Y,ee,[L("gap",e)]),ae="LayoutGrid",ie=(e,i)=>{const{gap:s=U,padding:a=$,justifyContent:r,alignItems:n,justifyItems:u,hide:l,relative:d}=i||{},m=w(q,ae,[L("justify-content",r),L("align-items",n),L("justify-items",u)]),y=te(s),v=M(a),G=P(l,"grid"),g=R(d);return[...m,...y,...v,...G,...g]},p=N.forwardRef(function({dataset:i,children:s,...a},r){const{tag:n=V,columns:u}=a,l=ie("grid",a),{style:d,classNames:m}=Z(u),y=[...l,...m],v={...A(a),ref:r,className:y.join(" "),style:d,...T(i,{preplyDsComponent:h.LayoutGrid})};return t.jsx(n,{...v,children:s})});try{p.displayName="LayoutGrid",p.__docgenInfo={description:"A CSS `grid` wrapper.",displayName:"LayoutGrid",props:{gap:{defaultValue:null,description:"",name:"gap",required:!1,type:{name:"enum",value:[{value:'"2xs"'},{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"xl"'},{value:'"24"'},{value:'"32"'},{value:'"48"'},{value:'"64"'},{value:'"96"'},{value:'"160"'},{value:'"none"'},{value:'"3xs"'},{value:"ResponsiveProp<LayoutGap>"},{value:'"0"'},{value:'"1"'},{value:'"2"'},{value:'"4"'},{value:'"8"'},{value:'"12"'},{value:'"16"'},{value:'"20"'},{value:"ResponsiveProp<Spacing>"}]}},padding:{defaultValue:null,description:"",name:"padding",required:!1,type:{name:"enum",value:[{value:'"2xs"'},{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"xl"'},{value:'"24"'},{value:'"32"'},{value:'"48"'},{value:'"64"'},{value:'"96"'},{value:'"160"'},{value:'"none"'},{value:'"3xs"'},{value:'"0"'},{value:'"1"'},{value:'"2"'},{value:'"4"'},{value:'"8"'},{value:'"12"'},{value:'"16"'},{value:'"20"'},{value:"[LayoutPadding, LayoutPadding]"},{value:"[LayoutPadding, LayoutPadding, LayoutPadding]"},{value:"[LayoutPadding, LayoutPadding, LayoutPadding, LayoutPadding]"},{value:"[Spacing, Spacing]"},{value:"[Spacing, Spacing, Spacing]"},{value:"[Spacing, Spacing, Spacing, Spacing]"},{value:"ResponsiveProp<ShortHand<LayoutPadding> | ShortHand<Spacing>>"}]}},columns:{defaultValue:null,description:"The `number` of columns, or a `string[]` of `grid-template-columns`.\n@see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns}",name:"columns",required:!1,type:{name:"enum",value:[{value:"number"},{value:"string[]"},{value:"ResponsiveProp<number | string[]>"}]}},justifyContent:{defaultValue:null,description:"",name:"justifyContent",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"space-between"'},{value:'"space-around"'},{value:'"space-evenly"'},{value:"ResponsiveProp<LayoutJustifyContent>"}]}},alignItems:{defaultValue:null,description:"",name:"alignItems",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"stretch"'},{value:'"baseline"'},{value:"ResponsiveProp<LayoutAlignItems>"}]}},justifyItems:{defaultValue:null,description:"",name:"justifyItems",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"start"'},{value:'"end"'},{value:'"stretch"'},{value:"ResponsiveProp<LayoutJustifyItems>"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"div"'},{value:'"main"'},{value:'"header"'},{value:'"footer"'},{value:'"article"'},{value:'"section"'},{value:'"ul"'},{value:'"ol"'},{value:'"li"'},{value:'"p"'},{value:'"span"'},{value:'"fieldset"'},{value:'"table"'},{value:'"th"'},{value:'"tr"'},{value:'"td"'},{value:'"thead"'},{value:'"tfoot"'},{value:'"tbody"'},{value:'"caption"'},{value:'"figure"'},{value:'"figcaption"'}]}},hide:{defaultValue:null,description:"",name:"hide",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},relative:{defaultValue:null,description:"",name:"relative",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},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: HTMLElement | null) => void"},{value:"RefObject<HTMLElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const pe={title:"components/LayoutGrid",component:p,subcomponents:{LayoutGridItem:f},argTypes:{gap:{description:o},padding:{description:z},columns:{description:o},justifyContent:{description:o},alignItems:{description:o},justifyItems:{description:o},hide:{description:o},relative:{description:o}}},c=()=>t.jsxs(p,{columns:4,alignItems:"start",gap:"xs",children:[t.jsx(f,{children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem"},children:[t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}}),t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}})]})}),t.jsx(f,{alignSelf:"end",children:t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}})}),t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}}),t.jsx("div",{style:{height:"2ch",backgroundColor:"hotpink"}})]});c.storyName="LayoutGrid";const _={parameters:{chromatic:{disableSnapshot:!0}},args:{gap:"16",columns:3,alignItems:"start",children:t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{minWidth:"100px",minHeight:50,backgroundColor:"hotpink"},children:" "}),t.jsx("div",{style:{minWidth:"100px",minHeight:75,backgroundColor:"hotpink"},children:" "}),t.jsx("div",{style:{minWidth:"100px",minHeight:100,backgroundColor:"hotpink",textAlign:"center"}})]}),dataset:{qaid:"layout-grid"}},argTypes:{dataset:{control:"object"},columns:{control:"number"},justifyItems:{control:"select"},hide:{control:"boolean"},relative:{control:"boolean"},children:{control:!1}}};var b,C,k;c.parameters={...c.parameters,docs:{...(b=c.parameters)==null?void 0:b.docs,source:{originalSource:`() => <LayoutGrid columns={4} alignItems="start" gap="xs">
|
|
2
2
|
<LayoutGridItem>
|
|
3
3
|
<div style={{
|
|
4
4
|
display: 'flex',
|
|
@@ -29,7 +29,7 @@ import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as N}from"./index-Cb9e4tl
|
|
|
29
29
|
height: '2ch',
|
|
30
30
|
backgroundColor: 'hotpink'
|
|
31
31
|
}} />
|
|
32
|
-
</LayoutGrid>`,...(k=(C=
|
|
32
|
+
</LayoutGrid>`,...(k=(C=c.parameters)==null?void 0:C.docs)==null?void 0:k.source}}};var S,x,I;_.parameters={..._.parameters,docs:{...(S=_.parameters)==null?void 0:S.docs,source:{originalSource:`{
|
|
33
33
|
parameters: {
|
|
34
34
|
chromatic: {
|
|
35
35
|
disableSnapshot: true
|
|
@@ -85,4 +85,4 @@ import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as N}from"./index-Cb9e4tl
|
|
|
85
85
|
control: false
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
}`,...(I=(x=
|
|
88
|
+
}`,...(I=(x=_.parameters)==null?void 0:x.docs)==null?void 0:I.source}}};const Ge=["Base","Playground"];export{c as Base,_ as Playground,Ge as __namedExportsOrder,pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._AlignSelf_1gwki_2._AlignSelf--align-self-start_1gwki_2{-ms-flex-item-align:start;align-self:start}._AlignSelf_1gwki_2._AlignSelf--align-self-center_1gwki_5{-ms-flex-item-align:center;align-self:center}._AlignSelf_1gwki_2._AlignSelf--align-self-end_1gwki_8{-ms-flex-item-align:end;align-self:end}._AlignSelf_1gwki_2._AlignSelf--align-self-stretch_1gwki_11{-ms-flex-item-align:stretch;align-self:stretch}@media (min-width: 400px){._AlignSelf_1gwki_2._AlignSelf--narrow-l--align-self-start_1gwki_15{-ms-flex-item-align:start;align-self:start}._AlignSelf_1gwki_2._AlignSelf--narrow-l--align-self-center_1gwki_18{-ms-flex-item-align:center;align-self:center}._AlignSelf_1gwki_2._AlignSelf--narrow-l--align-self-end_1gwki_21{-ms-flex-item-align:end;align-self:end}._AlignSelf_1gwki_2._AlignSelf--narrow-l--align-self-stretch_1gwki_24{-ms-flex-item-align:stretch;align-self:stretch}}@media (min-width: 700px){._AlignSelf_1gwki_2._AlignSelf--medium-s--align-self-start_1gwki_29{-ms-flex-item-align:start;align-self:start}._AlignSelf_1gwki_2._AlignSelf--medium-s--align-self-center_1gwki_32{-ms-flex-item-align:center;align-self:center}._AlignSelf_1gwki_2._AlignSelf--medium-s--align-self-end_1gwki_35{-ms-flex-item-align:end;align-self:end}._AlignSelf_1gwki_2._AlignSelf--medium-s--align-self-stretch_1gwki_38{-ms-flex-item-align:stretch;align-self:stretch}}@media (min-width: 880px){._AlignSelf_1gwki_2._AlignSelf--medium-l--align-self-start_1gwki_43{-ms-flex-item-align:start;align-self:start}._AlignSelf_1gwki_2._AlignSelf--medium-l--align-self-center_1gwki_46{-ms-flex-item-align:center;align-self:center}._AlignSelf_1gwki_2._AlignSelf--medium-l--align-self-end_1gwki_49{-ms-flex-item-align:end;align-self:end}._AlignSelf_1gwki_2._AlignSelf--medium-l--align-self-stretch_1gwki_52{-ms-flex-item-align:stretch;align-self:stretch}}@media (min-width: 1200px){._AlignSelf_1gwki_2._AlignSelf--wide-s--align-self-start_1gwki_57{-ms-flex-item-align:start;align-self:start}._AlignSelf_1gwki_2._AlignSelf--wide-s--align-self-center_1gwki_60{-ms-flex-item-align:center;align-self:center}._AlignSelf_1gwki_2._AlignSelf--wide-s--align-self-end_1gwki_63{-ms-flex-item-align:end;align-self:end}._AlignSelf_1gwki_2._AlignSelf--wide-s--align-self-stretch_1gwki_66{-ms-flex-item-align:stretch;align-self:stretch}}@media (min-width: 1900px){._AlignSelf_1gwki_2._AlignSelf--wide-l--align-self-start_1gwki_71{-ms-flex-item-align:start;align-self:start}._AlignSelf_1gwki_2._AlignSelf--wide-l--align-self-center_1gwki_74{-ms-flex-item-align:center;align-self:center}._AlignSelf_1gwki_2._AlignSelf--wide-l--align-self-end_1gwki_77{-ms-flex-item-align:end;align-self:end}._AlignSelf_1gwki_2._AlignSelf--wide-l--align-self-stretch_1gwki_80{-ms-flex-item-align:stretch;align-self:stretch}}._LayoutGridItem_2tq6r_1{margin:0;list-style:none;font-weight:inherit;border:none;text-align:inherit;border-spacing:0;padding:0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u}from"./jsx-runtime-BTJTZTIL.js";import{r as k}from"./index-Cb9e4tly.js";import{m as n,s as p}from"./classNames-BUL1Zq7e.js";import{g as L,a as h}from"./LayoutGrid-BG29rjrt.js";import{f as y}from"./filterHTMLAttributes-UOns5Q7s.js";import{w as i}from"./componentNames-Bwls0I02.js";import{g as C}from"./index-DdzHuZ-Y.js";import{L as N}from"./defaults-B1rzzf6M.js";const G="_AlignSelf_1gwki_2",I={AlignSelf:G,"AlignSelf--align-self-start":"_AlignSelf--align-self-start_1gwki_2","AlignSelf--align-self-center":"_AlignSelf--align-self-center_1gwki_5","AlignSelf--align-self-end":"_AlignSelf--align-self-end_1gwki_8","AlignSelf--align-self-stretch":"_AlignSelf--align-self-stretch_1gwki_11","AlignSelf--narrow-l--align-self-start":"_AlignSelf--narrow-l--align-self-start_1gwki_15","AlignSelf--narrow-l--align-self-center":"_AlignSelf--narrow-l--align-self-center_1gwki_18","AlignSelf--narrow-l--align-self-end":"_AlignSelf--narrow-l--align-self-end_1gwki_21","AlignSelf--narrow-l--align-self-stretch":"_AlignSelf--narrow-l--align-self-stretch_1gwki_24","AlignSelf--medium-s--align-self-start":"_AlignSelf--medium-s--align-self-start_1gwki_29","AlignSelf--medium-s--align-self-center":"_AlignSelf--medium-s--align-self-center_1gwki_32","AlignSelf--medium-s--align-self-end":"_AlignSelf--medium-s--align-self-end_1gwki_35","AlignSelf--medium-s--align-self-stretch":"_AlignSelf--medium-s--align-self-stretch_1gwki_38","AlignSelf--medium-l--align-self-start":"_AlignSelf--medium-l--align-self-start_1gwki_43","AlignSelf--medium-l--align-self-center":"_AlignSelf--medium-l--align-self-center_1gwki_46","AlignSelf--medium-l--align-self-end":"_AlignSelf--medium-l--align-self-end_1gwki_49","AlignSelf--medium-l--align-self-stretch":"_AlignSelf--medium-l--align-self-stretch_1gwki_52","AlignSelf--wide-s--align-self-start":"_AlignSelf--wide-s--align-self-start_1gwki_57","AlignSelf--wide-s--align-self-center":"_AlignSelf--wide-s--align-self-center_1gwki_60","AlignSelf--wide-s--align-self-end":"_AlignSelf--wide-s--align-self-end_1gwki_63","AlignSelf--wide-s--align-self-stretch":"_AlignSelf--wide-s--align-self-stretch_1gwki_66","AlignSelf--wide-l--align-self-start":"_AlignSelf--wide-l--align-self-start_1gwki_71","AlignSelf--wide-l--align-self-center":"_AlignSelf--wide-l--align-self-center_1gwki_74","AlignSelf--wide-l--align-self-end":"_AlignSelf--wide-l--align-self-end_1gwki_77","AlignSelf--wide-l--align-self-stretch":"_AlignSelf--wide-l--align-self-stretch_1gwki_80"},x="AlignSelf",T=l=>n(I,x,[p("align-self",l)]),j="_LayoutGridItem_2tq6r_1",E={LayoutGridItem:j},D=k.forwardRef(function({children:s,alignSelf:g,tag:e,hide:t,relative:a,dataset:f,...r},_){const m=n(E,i.LayoutGridItem,[]),o=T(g),d=L(t),A=h(a),S=[...m,...o,...d,...A],w=e??N,c={...y(r),ref:_,className:S.join(" "),...C(f,{preplyDsComponent:i.LayoutGridItem})};return u.jsx(w,{...c,children:s})});D.__docgenInfo={description:"",methods:[],displayName:"LayoutGridItem"};export{D as L,T as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Link_1tkj3_4{display:inline-block;border-radius:var(--5eeb28);text-decoration:var(--f13872);cursor:pointer;-webkit-tap-highlight-color:transparent;outline:none;-ms-touch-action:manipulation;touch-action:manipulation}._Link_1tkj3_4:focus-visible{outline-style:solid;outline-color:var(--603ec6);outline-width:var(--99d31f);outline-offset:var(--c0b12c)}._Link--inline_1tkj3_20{display:inline}._Link--noUnderline_1tkj3_23{text-decoration:none}._Link--variant-accentDark_1tkj3_26{color:var(--c6b68f)}._Link--variant-accentDark_1tkj3_26:hover,._Link--variant-accentDark--dsInternalSimulation-hover_1tkj3_30{color:var(--65e1ef)}._Link--variant-accentDark_1tkj3_26:active,._Link--variant-accentDark--dsInternalSimulation-active_1tkj3_34{color:var(--179b80)}._Link--variant-accentDarkInverted_1tkj3_37{color:var(--7cbffc)}._Link--variant-accentDarkInverted_1tkj3_37:hover,._Link--variant-accentDarkInverted--dsInternalSimulation-hover_1tkj3_41{color:var(--47fcde)}._Link--variant-accentDarkInverted_1tkj3_37:active,._Link--variant-accentDarkInverted--dsInternalSimulation-active_1tkj3_45{color:var(--1253e2)}._Link--variant-neutral_1tkj3_48{color:var(--19fdf0)}._Link--variant-neutral_1tkj3_48:hover,._Link--variant-neutral--dsInternalSimulation-hover_1tkj3_52{color:var(--ce5fb9)}._Link--variant-neutral_1tkj3_48:active,._Link--variant-neutral--dsInternalSimulation-active_1tkj3_56{color:var(--1d39ac)}._Link--variant-neutralInverted_1tkj3_59{color:var(--883d0f)}._Link--variant-neutralInverted_1tkj3_59:hover,._Link--variant-neutralInverted--dsInternalSimulation-hover_1tkj3_63{color:var(--065570)}._Link--variant-neutralInverted_1tkj3_59:active,._Link--variant-neutralInverted--dsInternalSimulation-active_1tkj3_67{color:var(--be41c4)}._Link--variant-unsetColors_1tkj3_70{color:var(--e66f2a)}._Link--variant-unsetColors_1tkj3_70:hover,._Link--variant-unsetColors--dsInternalSimulation-hover_1tkj3_74{color:var(--468ceb)}._Link--variant-unsetColors_1tkj3_70:active,._Link--variant-unsetColors--dsInternalSimulation-active_1tkj3_78{color:var(--a5fc76)}
|
|
@@ -1,10 +1,10 @@
|
|
|
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-nWyCR02l.js";import{r as k}from"./index-Cb9e4tly.js";import{f as Y}from"./filterHTMLAttributes-DYdLqcvH.js";import{g as Z}from"./defaults-B1rzzf6M.js";import{u as ee}from"./useHostname-Y3PlXofY.js";import{m as te,s as f,b as x}from"./classNames-BUL1Zq7e.js";import{w as y}from"./componentNames-Bwls0I02.js";import{a as ne,g as ae}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-BMdpzlaC.js";import"./text-centered-VuFsr_qt.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./constants-BgBLeZzp.js";const re="_Link_1tkj3_4",ie={Link:re,"Link--inline":"_Link--inline_1tkj3_20","Link--noUnderline":"_Link--noUnderline_1tkj3_23","Link--variant-accentDark":"_Link--variant-accentDark_1tkj3_26","Link--variant-accentDark--dsInternalSimulation-hover":"_Link--variant-accentDark--dsInternalSimulation-hover_1tkj3_30","Link--variant-accentDark--dsInternalSimulation-active":"_Link--variant-accentDark--dsInternalSimulation-active_1tkj3_34","Link--variant-accentDarkInverted":"_Link--variant-accentDarkInverted_1tkj3_37","Link--variant-accentDarkInverted--dsInternalSimulation-hover":"_Link--variant-accentDarkInverted--dsInternalSimulation-hover_1tkj3_41","Link--variant-accentDarkInverted--dsInternalSimulation-active":"_Link--variant-accentDarkInverted--dsInternalSimulation-active_1tkj3_45","Link--variant-neutral":"_Link--variant-neutral_1tkj3_48","Link--variant-neutral--dsInternalSimulation-hover":"_Link--variant-neutral--dsInternalSimulation-hover_1tkj3_52","Link--variant-neutral--dsInternalSimulation-active":"_Link--variant-neutral--dsInternalSimulation-active_1tkj3_56","Link--variant-neutralInverted":"_Link--variant-neutralInverted_1tkj3_59","Link--variant-neutralInverted--dsInternalSimulation-hover":"_Link--variant-neutralInverted--dsInternalSimulation-hover_1tkj3_63","Link--variant-neutralInverted--dsInternalSimulation-active":"_Link--variant-neutralInverted--dsInternalSimulation-active_1tkj3_67","Link--variant-unsetColors":"_Link--variant-unsetColors_1tkj3_70","Link--variant-unsetColors--dsInternalSimulation-hover":"_Link--variant-unsetColors--dsInternalSimulation-hover_1tkj3_74","Link--variant-unsetColors--dsInternalSimulation-active":"_Link--variant-unsetColors--dsInternalSimulation-active_1tkj3_78"},t=k.forwardRef(function(E,P){const{variant:p=Z,href:A,download:R,opensInNewTab:H,nofollow:M,assistiveText:O,onClick:$,as:v,url:z,dataset:F,children:m,inline:J,dsInternalSimulation:K,noUnderline:W,...X}=E,B=ee(),G=te(ie,y.Link,[f(`variant-${p}--dsInternalSimulation`,K),f("variant",p),x("inline",void 0,J),x("noUnderline",void 0,W)]),c=A||z,Q=c?ne(B,c,H,M):{},h={...Y(X),ref:P,href:c,download:R,"aria-label":O,onClick:$,className:G.join(" "),...ae(F,{preplyDsComponent:y.Link})};return v?k.cloneElement(v,{...h},m):e.jsx("a",{...h,...Q,children:m})});try{t.displayName="Link",t.__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:'"
|
|
4
|
+
component.`,displayName:"Link",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"neutral"'},{value:'"accentDark"'},{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.`,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:
|
|
7
|
+
of e2e tests or integrating with external libraries.`,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:t},r=()=>{const a=d(u.background.primaryInverted);return e.jsxs("div",{style:{display:"flex",gap:"16px"},children:[e.jsx(t,{href:"https://preply.com",variant:"neutral",children:"neutral"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"neutralInverted",children:"neutralInverted"})}),e.jsx(t,{href:"https://preply.com",variant:"accentDark",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"accentDarkInverted",children:"accentDarkInverted"})}),e.jsx(t,{href:"https://preply.com",variant:"unsetColors",children:"unsetColors"})]})},i=()=>{const a=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(t,{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(t,{variant:"unsetColors",dsInternalSimulation:"active",children:"dolor sit amet"})," ","amet."]})]}),e.jsxs("div",{style:{backgroundColor:a},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(t,{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(t,{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(t,{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(t,{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(t,{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(t,{variant:"unsetColors",dsInternalSimulation:"active",children:"dolor sit amet"})," ","amet."]})]})]})},l=()=>{const a=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(t,{href:"https://preply.com",variant:"neutral",children:"neutral"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"neutralInverted",children:"neutralInverted"})}),e.jsx(t,{href:"https://preply.com",variant:"accentDark",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"accentDarkInverted",children:"accentDarkInverted"})}),e.jsx(t,{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(t,{href:"https://preply.com",variant:"neutral",dsInternalSimulation:"hover",children:"neutral"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"neutralInverted",dsInternalSimulation:"hover",children:"neutralInverted"})}),e.jsx(t,{href:"https://preply.com",variant:"accentDark",dsInternalSimulation:"hover",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"accentDarkInverted",dsInternalSimulation:"hover",children:"accentDarkInverted"})}),e.jsx(t,{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(t,{href:"https://preply.com",variant:"neutral",dsInternalSimulation:"active",children:"neutral"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"neutralInverted",dsInternalSimulation:"active",children:"neutralInverted"})}),e.jsx(t,{href:"https://preply.com",variant:"accentDark",dsInternalSimulation:"active",children:"accentDark"}),e.jsx("span",{style:{backgroundColor:a},children:e.jsx(t,{href:"https://preply.com",variant:"accentDarkInverted",dsInternalSimulation:"active",children:"accentDarkInverted"})}),e.jsx(t,{href:"https://preply.com",variant:"unsetColors",dsInternalSimulation:"active",children:"unsetColors"})]})]})},o=()=>e.jsxs("p",{style:{width:"12ch"},children:["Unlock your potential;"," ",e.jsx(t,{href:"https://preply.com",variant:"unsetColors",inline:!0,children:"visit Preply"}),"."]}),s={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
8
|
const grey = getTokenVar(color.background.primaryInverted);
|
|
9
9
|
return <div style={{
|
|
10
10
|
display: 'flex',
|
|
@@ -34,7 +34,7 @@ of e2e tests or integrating with external libraries.`,name:"dataset",required:!1
|
|
|
34
34
|
unsetColors
|
|
35
35
|
</Link>
|
|
36
36
|
</div>;
|
|
37
|
-
}`,...(I=(L=r.parameters)==null?void 0:L.docs)==null?void 0:I.source}}};var j,
|
|
37
|
+
}`,...(I=(L=r.parameters)==null?void 0:L.docs)==null?void 0:I.source}}};var j,T,C;i.parameters={...i.parameters,docs:{...(j=i.parameters)==null?void 0:j.docs,source:{originalSource:`() => {
|
|
38
38
|
const grey = getTokenVar(color.background.primaryInverted);
|
|
39
39
|
return <div style={{
|
|
40
40
|
display: 'flex',
|
|
@@ -119,7 +119,7 @@ of e2e tests or integrating with external libraries.`,name:"dataset",required:!1
|
|
|
119
119
|
</Text>
|
|
120
120
|
</div>
|
|
121
121
|
</div>;
|
|
122
|
-
}`,...(
|
|
122
|
+
}`,...(C=(T=i.parameters)==null?void 0:T.docs)==null?void 0:C.source}}};var b,_,S;l.parameters={...l.parameters,docs:{...(b=l.parameters)==null?void 0:b.docs,source:{originalSource:`() => {
|
|
123
123
|
const grey = getTokenVar(color.background.primaryInverted);
|
|
124
124
|
return <div style={{
|
|
125
125
|
display: 'flex',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Loader_5yfhg_2{display:inline-flex;width:fit-content;height:fit-content}._Loader--normal_5yfhg_7{color:var(--19bcb6)}._Loader--inverted_5yfhg_10{color:var(--38413d)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as x}from"./index-Cb9e4tly.js";import{f as j}from"./filterHTMLAttributes-DYdLqcvH.js";import{S as z}from"./Spinner-Iaah9nUJ.js";import{m as k,b as C}from"./classNames-BUL1Zq7e.js";import{w as l}from"./componentNames-Bwls0I02.js";import{g as E}from"./index-DdzHuZ-Y.js";import{S as N}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_5yfhg_2",q={Loader:V,"Loader--normal":"_Loader--normal_5yfhg_7","Loader--inverted":"_Loader--inverted_5yfhg_10"},r=x.forwardRef(function({size:t,inverted:y=!1,dataset:L,..._},b){const h=k(q,l.Loader,[C("inverted","normal",y)]),S={...j(_),ref:b,className:h.join(" "),...E(L,{preplyDsComponent:l.Loader})};return e.jsx("span",{...S,children:e.jsx(z,{size:t})})});try{r.displayName="Loader",r.__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 K={title:"components/Loader",component:r,argTypes:{size:{description:N}}},o=()=>e.jsxs("div",{style:{display:"flex",alignItems:"end",gap:"8px"},children:[e.jsx(r,{size:"default"}),e.jsx(r,{size:"large"})]}),n=()=>e.jsx(r,{inverted:!0});n.decorators=[a=>{const t=R(T.background.primaryInverted);return e.jsx("div",{style:{backgroundColor:t},children:a()})}];const s={parameters:{chromatic:{disableSnapshot:!0}},decorators:[(a,{args:t})=>e.jsx("div",{style:{backgroundColor:t.inverted?"black":void 0},children:a()})],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
2
|
display: 'flex',
|
|
3
3
|
alignItems: 'end',
|
|
4
4
|
gap: '8px'
|
|
@@ -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-CWNujLtP.js";import{I as we}from"./Icon-DbIHupWZ.js";import{F as He}from"./FieldLayout-BbLKeSmh.js";import{u as Se,I as Fe,s as Ne}from"./FieldLayoutBase-DhKLFBcH.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-nWyCR02l.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./v4-CtRu48qb.js";import"./render-icon-BT0Aq7PA.js";import"./ButtonBase-CJjNfOwu.js";import"./Spinner-Iaah9nUJ.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-BMdpzlaC.js";import"./FieldAdditionalText-BiaO_Yss.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-VuFsr_qt.js";const je=({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(je);try{N.displayName="InputNumber",N.__docgenInfo={description:"",displayName:"InputNumber",props:{dataset:{defaultValue:null,description:"",name:"dataset",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"}]}},id:{defaultValue:null,description:"",name:"id",required:!0,type:{name:"string"}},"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"'}]}},placeholder:{defaultValue:null,description:"",name:"placeholder",required:!1,type:{name:"enum",value:[{value:"string"}]}},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>"}]}},required:{defaultValue:null,description:"",name:"required",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},readOnly:{defaultValue:null,description:"",name:"readOnly",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"}]}},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 Be="_NumberField_kx5jx_1",Pe={NumberField:Be},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"}]}},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>"}]}},required:{defaultValue:null,description:"",name:"required",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},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,j,B;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
|
+
}`,...(B=(j=v.parameters)==null?void 0:j.docs)==null?void 0:B.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};
|
|
@@ -5,4 +5,4 @@ Triggers a callback when the wrapped component intersects with the viewport.
|
|
|
5
5
|
This can be useful in several use cases. Examples:
|
|
6
6
|
|
|
7
7
|
- Track an experiment, once a certain component scrolls into view.
|
|
8
|
-
- Trigger an animation, or a feature (e.g.: onboarding instructions).`,displayName:"ObserveIntersection",props:{onIntersect:{defaultValue:null,description:"",name:"onIntersect",required:!0,type:{name:"() => void"}},once:{defaultValue:null,description:"",name:"once",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},threshold:{defaultValue:null,description:"",name:"threshold",required:!1,type:{name:"enum",value:[{value:"number"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"
|
|
8
|
+
- Trigger an animation, or a feature (e.g.: onboarding instructions).`,displayName:"ObserveIntersection",props:{onIntersect:{defaultValue:null,description:"",name:"onIntersect",required:!0,type:{name:"() => void"}},once:{defaultValue:null,description:"",name:"once",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},threshold:{defaultValue:null,description:"",name:"threshold",required:!1,type:{name:"enum",value:[{value:"number"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"div"'},{value:'"main"'},{value:'"header"'},{value:'"footer"'},{value:'"article"'},{value:'"section"'},{value:'"ul"'},{value:'"ol"'},{value:'"li"'},{value:'"p"'},{value:'"span"'},{value:'"fieldset"'},{value:'"table"'},{value:'"th"'},{value:'"tr"'},{value:'"td"'},{value:'"thead"'},{value:'"tfoot"'},{value:'"tbody"'},{value:'"caption"'},{value:'"figure"'},{value:'"figcaption"'}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}export{o as O};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as a}from"./index-Cb9e4tly.js";import{O as i}from"./ObserveIntersection-
|
|
1
|
+
import{j as t}from"./jsx-runtime-BTJTZTIL.js";import{r as a}from"./index-Cb9e4tly.js";import{O as i}from"./ObserveIntersection-D396wl1Z.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";import"./componentNames-Bwls0I02.js";const g={title:"components/ObserveIntersection",component:i,parameters:{tags:["!test"],chromatic:{disableSnapshot:!0}}},e=()=>{const[o,c]=a.useState(!1);return t.jsxs("div",{tabIndex:0,style:{height:"200px",overflowY:"scroll",position:"relative"},children:[t.jsx("div",{style:{position:"sticky",top:"2px"},children:o?"Intersected":"Scroll down to intersect"}),t.jsx("div",{style:{height:"400px",display:"flex",alignItems:"end"},children:t.jsx(i,{onIntersect:()=>c(!0),children:"Observer"})})]})};e.storyName="ObserveIntersection";var s,n,r;e.parameters={...e.parameters,docs:{...(s=e.parameters)==null?void 0:s.docs,source:{originalSource:`() => {
|
|
2
2
|
const [isIntersecting, setIsIntersecting] = useState(false);
|
|
3
3
|
return (
|
|
4
4
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- This element is interactive; it's scrollable.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{r as n}from"./index-Cb9e4tly.js";import{R,A as V,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-
|
|
1
|
+
import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{r as n}from"./index-Cb9e4tly.js";import{R,A as V,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-DbIHupWZ.js";import{T as P}from"./Text-nWyCR02l.js";import{B as j}from"./Button-CWNujLtP.js";import{H as T}from"./Heading-DcJnmvUa.js";import{u as S}from"./index-D1pfvbUR.js";import{g as D}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 J}from"./message-B1DLZQ1U.js";const X="_content_1eee8_2",B="_header_1eee8_23",U="_close_1eee8_29",A="_footer_1eee8_43",F="_arrow_1eee8_49",o={content:X,header:B,close:U,footer:A,arrow:F},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(J,{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}=S(),_=L(),f=n.useId(),w=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(V,{ref:c,id:d,asChild:!0,children:t}),a.jsx(q,{container:_,children:a.jsxs(x,{side:l,className:o.content,"aria-labelledby":f,"aria-describedby":`${d} ${w}`,...M(h,{preplyDsComponent:H.OnboardingTooltip}),children:[a.jsxs("div",{className:o.header,children:[a.jsx(O,{className:o.close,"aria-label":I(D.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"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._content_1eee8_2{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_1eee8_2[data-state=open]{animation-name:_appear_1eee8_1}._content_1eee8_2[data-state=closed]{animation-name:_disappear_1eee8_1}._header_1eee8_23{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:flex-start}._close_1eee8_29{background:none;border:none;border-radius:var(--5e8be4);padding:0;margin:0;cursor:pointer}._close_1eee8_29:focus-visible{outline-style:solid;outline-color:var(--603ec6);outline-width:var(--99d31f);outline-offset:var(--c0b12c)}._footer_1eee8_43{display:flex;justify-content:flex-end;gap:var(--813599);align-items:center}._arrow_1eee8_49{fill:var(--79dffb)}@keyframes _appear_1eee8_1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes _disappear_1eee8_1{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0)}}
|