@preply/ds-docs 3.4.1 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{00.LayoutFlex.stories-D84fczbX.js → 00.LayoutFlex.stories-DsoQ41ru.js} +1 -1
- package/dist/assets/{00.applications-BvovHGQR.js → 00.applications-CtD17Uvc.js} +1 -1
- package/dist/assets/{00.favicons.guide-BSQU2_Yt.js → 00.favicons.guide-rDY-MoXZ.js} +1 -1
- package/dist/assets/{00.token-explorer-Bt1vV4kl.js → 00.token-explorer-CedppzBQ.js} +1 -1
- package/dist/assets/{00.using-responsive-props-I5lu88cl.js → 00.using-responsive-props-CXXBchqR.js} +1 -1
- package/dist/assets/{01.semantic-tokens-Dm1mMy40.js → 01.semantic-tokens-DA4N50sn.js} +1 -1
- package/dist/assets/{01.using-shorthand-props-D0jpz6Q2.js → 01.using-shorthand-props-eZLJFDHj.js} +1 -1
- package/dist/assets/{10.Combinations.stories-DlYW3Fqp.js → 10.Combinations.stories-D5C6zeLo.js} +1 -1
- package/dist/assets/{10.fonts.guide-C-rIO9vi.js → 10.fonts.guide-DW9ufzTF.js} +1 -1
- package/dist/assets/{10.ssr-DbviWPo-.js → 10.ssr-DwlffmrT.js} +1 -1
- package/dist/assets/{11.languageFont.explorer-Ciu0KtCs.js → 11.languageFont.explorer.stories-Crh2l5Jm.js} +10 -11
- package/dist/assets/{11.ssr.app-router-R7gD_04h.js → 11.ssr.app-router-BZ07Enlf.js} +1 -1
- package/dist/assets/{20.libraries-DhNPVODF.js → 20.libraries-lbSLR9_7.js} +1 -1
- package/dist/assets/{30.icons.explorer-BnRymPNL.js → 30.icons.explorer-gDqz6aGC.js} +2 -2
- package/dist/assets/{30.storybook-BvMvy9Jb.js → 30.storybook-C4NNn5Fv.js} +1 -1
- package/dist/assets/{40.illustrations.explorer-DddH2kt3.js → 40.illustrations.explorer-Cw6qUJFV.js} +3 -3
- package/dist/assets/{90.advanced-C7xLR8dd.js → 90.advanced-bdiRxPCx.js} +1 -1
- package/dist/assets/{Accordion-BY3hCxwU.js → Accordion-BMkC4Xny.js} +1 -1
- package/dist/assets/{Accordion.stories-BS-Yu9rI.js → Accordion.stories-SU6sgvYh.js} +1 -1
- package/dist/assets/{Accordion.tests.stories-gOuYjtWu.js → Accordion.tests.stories-CxVZnGoY.js} +1 -1
- package/dist/assets/{AlertDialog.stories-ZTX4V2Mg.js → AlertDialog.stories-Z5ooiuoO.js} +1 -1
- package/dist/assets/{AvatarWithStatus.stories-B86Dnj1_.js → AvatarWithStatus.stories-CiIZ7860.js} +3 -3
- package/dist/assets/{Badge.stories-C3kdJIrD.js → Badge.stories-B2OoKd78.js} +1 -1
- package/dist/assets/{Box.stories-Dq0UsJq1.js → Box.stories-Bj6O093l.js} +1 -1
- package/dist/assets/Checkbox-Bq_sNuXJ.js +10 -0
- package/dist/assets/Checkbox.stories-BI-3q1SR.js +187 -0
- package/dist/assets/Checkbox.tests.stories-Bn3p5No-.js +64 -0
- package/dist/assets/{Chips.stories-BW4NFkEW.js → Chips.stories-FqjAsoAI.js} +1 -1
- package/dist/assets/{Color-YHDXOIA2-BnVst_jE.js → Color-YHDXOIA2-Brn_ueLX.js} +1 -1
- package/dist/assets/CountryFlag-ClC7kEHn.js +49 -0
- package/dist/assets/Dialog-B2G1UrP1.css +1 -0
- package/dist/assets/{Dialog.stories-Cii2x2YO.js → Dialog.stories-ColOPVoz.js} +53 -21
- package/dist/assets/{DocsRenderer-CFRXHY34-DyeBV0z3.js → DocsRenderer-CFRXHY34-Drp94F88.js} +1 -1
- package/dist/assets/{Flag.stories-CuHMLwKy.js → Flag.stories-hPDFXFLs.js} +1 -1
- package/dist/assets/{Flag.test.stories-Da1de2sS.js → Flag.test.stories-Dn7xe9kp.js} +1 -1
- package/dist/assets/{FormControl.stories-BaSJbnE1.js → FormControl.stories-DekxQG9a.js} +1 -1
- package/dist/assets/{Heading-B0rTmnad.js → Heading-ese4_5Hg.js} +1 -1
- package/dist/assets/{Heading.stories-Cs64JgS0.js → Heading.stories-Pcuq78-p.js} +1 -1
- package/dist/assets/{Icon-RSC-B7Up3SXG.js → Icon-RSC-DHJisRIw.js} +1 -1
- package/dist/assets/{Icon-BLj2hNSU.js → Icon-ZIxauYsE.js} +1 -1
- package/dist/assets/{Icon.stories-BJZek2zN.js → Icon.stories-Cv6aq9BI.js} +1 -1
- package/dist/assets/{Input-GBJ_wz6j.js → Input-C1hZX5_o.js} +6 -6
- package/dist/assets/{IntegrationWithReactHookForm.stories-JlCorX6_.js → IntegrationWithReactHookForm.stories-DjhZzsb9.js} +1 -1
- package/dist/assets/{LayoutFlex-BPtL2qZR.js → LayoutFlex-BBGvSVMb.js} +1 -1
- package/dist/assets/{LayoutFlexItem-DeLvTHsT.js → LayoutFlexItem-C2t_4vHD.js} +1 -1
- package/dist/assets/{LayoutGrid.stories-D4EbVKvB.js → LayoutGrid.stories-CNvZbuzu.js} +1 -1
- package/dist/assets/{LayoutGridItem-BtAwiDLY.js → LayoutGridItem-CZ6SKl8g.js} +1 -1
- package/dist/assets/{Link.stories-OhrveYjE.js → Link.stories-DQx9wq8H.js} +1 -1
- package/dist/assets/{NumberField-5gideZr4.js → NumberField-D6cbX2hK.js} +4 -4
- package/dist/assets/{NumberField.stories-CzXnU4jM.js → NumberField.stories-BHt2ErAX.js} +1 -1
- package/dist/assets/{ObserveIntersection-DIzoqV0M.js → ObserveIntersection-DsqqXq5n.js} +1 -1
- package/dist/assets/{ObserveIntersection.stories-9LGsv3hq.js → ObserveIntersection.stories-BabE9srq.js} +1 -1
- package/dist/assets/{OnboardingTooltip-B7DJFxqL.js → OnboardingTooltip-DVNAQjDc.js} +1 -1
- package/dist/assets/{OnboardingTooltip.stories-BkLBUio8.js → OnboardingTooltip.stories-BGQM-hLj.js} +1 -1
- package/dist/assets/{OnboardingTooltip.tests.stories-Djs6JZIl.js → OnboardingTooltip.tests.stories-4LRVGnuI.js} +1 -1
- package/dist/assets/{OnboardingTour-Bim14xn7.js → OnboardingTour-DdV7TN6M.js} +1 -1
- package/dist/assets/{OnboardingTour.stories-CCcZk5b2.js → OnboardingTour.stories-D0ScuFD6.js} +2 -2
- package/dist/assets/{OnboardingTour.tests.stories-BYe9rU93.js → OnboardingTour.tests.stories-DAxdPYEp.js} +1 -1
- package/dist/assets/{PasswordField-Bzl_2mAR.js → PasswordField-C_KRyf9k.js} +4 -4
- package/dist/assets/{PasswordField.stories-hLk1hfiF.js → PasswordField.stories-3X4JtcLm.js} +1 -1
- package/dist/assets/{ProgressBar.stories-CU05tsA8.js → ProgressBar.stories-Dpro8fzG.js} +1 -1
- package/dist/assets/{ProgressSteps.stories-DwNpdgEm.js → ProgressSteps.stories-DDhuAaz0.js} +1 -1
- package/dist/assets/{SelectField-De3TaFOp.js → SelectField-CuzFFPz0.js} +9 -9
- package/dist/assets/{SelectField.stories-BaiubhSn.js → SelectField.stories-wb_cAtCV.js} +1 -1
- package/dist/assets/{ShowOnIntersection.stories-CQ4u9OFv.js → ShowOnIntersection.stories-ipu84fct.js} +1 -1
- package/dist/assets/{Steps-BIsSinlU.js → Steps-CCm9vCgl.js} +1 -1
- package/dist/assets/{Steps.stories-DE0eTWot.js → Steps.stories-BLFM3WRM.js} +1 -1
- package/dist/assets/{TextField-BXps0nA6.js → TextField-CMgzC3bX.js} +4 -4
- package/dist/assets/{TextField.stories-yhzbx_LG.js → TextField.stories-CAcPkm_s.js} +1 -1
- package/dist/assets/{TextareaField-BO9wkLtB.js → TextareaField-CCM1C6lK.js} +8 -8
- package/dist/assets/{TextareaField.stories-BAgexHv3.js → TextareaField.stories-DKNFN3f4.js} +1 -1
- package/dist/assets/{Toast.stories-SEfC31g_.js → Toast.stories-BzEpckjh.js} +1 -1
- package/dist/assets/TokyoUIUser-DG6LLnJu.js +1 -0
- package/dist/assets/{Tooltip.stories-Cyqt0sT4.js → Tooltip.stories-DHYG0ggY.js} +1 -1
- package/dist/assets/{breakpoints-B9vRpLBl.js → breakpoints-3Mi8ztBx.js} +1 -1
- package/dist/assets/{breakpoints-DnCq-6-0.js → breakpoints-BPZAI3l-.js} +1 -1
- package/dist/assets/{breakpoints-CLtErfFX.js → breakpoints-DxEeOfvq.js} +1 -1
- package/dist/assets/{changelog-Cqpfft6P.js → changelog-BvX8uMXW.js} +250 -229
- package/dist/assets/{entry-preview-Dl_7Oprh.js → entry-preview-Cgr68VmN.js} +1 -1
- package/dist/assets/{getTokenVar-CXcD0do5.js → getTokenVar-CXvtPVqa.js} +1 -1
- package/dist/assets/{hover-dT-SAeRH.js → hover-BJ9rZrzg.js} +1 -1
- package/dist/assets/{hover-B17ti4Lo.js → hover-CeDdAnNA.js} +1 -1
- package/dist/assets/{hover-Dd6KFQfe.js → hover-sR2377QI.js} +1 -1
- package/dist/assets/{iframe-D3RLzFNO.js → iframe-BE13K_u-.js} +2 -2
- package/dist/assets/{index-Dbtw7LqJ.js → index-CjMmneJr.js} +3 -3
- package/dist/assets/{index-CC-LIRn3.js → index-DUJ9kiQB.js} +1 -1
- package/dist/assets/{intro-DfT2Ym8w.js → intro-BQxazeZ4.js} +1 -1
- package/dist/assets/{migrating-from-less-BUfkUEQP.js → migrating-from-less-_WbBpNno.js} +1 -1
- package/dist/assets/{playground-DMLi4ken.css → playground-DJaUjyzx.css} +1 -1
- package/dist/assets/{playground.stories-CUEZbHDL.js → playground.stories-DNP6DMoh.js} +89 -89
- package/dist/assets/{preview-DVfrkQyA.js → preview-DFIaQ6pR.js} +2 -2
- package/dist/assets/{preview-DVRjAUOe.js → preview-Dlcr0l4_.js} +1 -1
- package/dist/assets/{preview-Ce1cncS-.js → preview-DqZVArh_.js} +1 -1
- package/dist/assets/{tokens-cPImG8x7.js → tokens-BpVbkeg9.js} +1 -1
- package/dist/assets/{tokens-zRSosqpq.js → tokens-Do5DDIVZ.js} +1 -1
- package/dist/assets/{tokens-DPvZO0cX.js → tokens-rA5iljxB.js} +1 -1
- package/dist/assets/{usePortalElement-Dk_Dl7MA.js → usePortalElement-D-MBkGYE.js} +1 -1
- package/dist/assets/{welcome-COfgBrdG.js → welcome-CjdlfIE9.js} +1 -1
- package/dist/assets/{zeroheight-CBC9Z2q4.js → zeroheight-COTIl-YQ.js} +1 -1
- package/dist/iframe.html +1 -1
- package/dist/index.json +1 -1
- package/dist/preview-stats.json +916 -916
- package/dist/project.json +1 -1
- package/package.json +3 -3
- package/dist/assets/Checkbox-ChNXL1_S.js +0 -10
- package/dist/assets/Checkbox.stories-giN0iuB9.js +0 -99
- package/dist/assets/Checkbox.tests.stories-CWt_7Len.js +0 -100
- package/dist/assets/CountryFlag-B5buLFPp.js +0 -49
- package/dist/assets/Dialog-C41Mvr8T.css +0 -1
- package/dist/assets/TokyoUIUser-CEt_udNR.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BYouaCF_.js";import{r as a}from"./index-B3evPFBL.js";import{a as
|
|
1
|
+
import{j as e}from"./jsx-runtime-BYouaCF_.js";import{r as a}from"./index-B3evPFBL.js";import{a as F}from"./chunk-D5ZWXAHU-BhFjjRSl.js";import{f as Le,u as f,a as v,e as g}from"./index-DDyIDR-R.js";import{R as We,P as Ne,O as Ve,C as Me,T as qe,D as Ue,a as Je}from"./index-wFyje0se.js";import{B as d}from"./Button-BSyqsKC5.js";import{I as Ze}from"./IconButton-BqwVuKH2.js";import{H as Ke}from"./Heading-ese4_5Hg.js";import{g as Ye}from"./shared-strings-CcWGHelY.js";import{u as Ge}from"./index-BfBdt3zW.js";import{g as Xe}from"./PortalElementProvider-D4ltrA8j.js";import{g as Qe}from"./index-DdzHuZ-Y.js";import{w as R}from"./componentNames-CpCJzpB9.js";import{m as $e,s as et,b as tt}from"./classNames-BUL1Zq7e.js";import{S as m}from"./Steps-CCm9vCgl.js";import{I as ot}from"./Icon-ZIxauYsE.js";import{A as st}from"./Avatar-B2H0W8KL.js";import{F as nt}from"./TokyoUIInfo-nHX2jpp7.js";import{L as at}from"./LayoutFlex-BBGvSVMb.js";import{N as it}from"./NumberField-D6cbX2hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./v4-CtRu48qb.js";import"./index-DRKYGVyc.js";import"./Combination-CCYtWL8C.js";import"./tslib.es6-BntfKcQG.js";import"./render-icon-CVTdrNe-.js";import"./ButtonBase-Bdtn25V2.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./Spinner-BCTJunNM.js";import"./defaults-B1rzzf6M.js";import"./useMergeRefs-CeyIhNgY.js";import"./useHostname-CH18gHFj.js";import"./index-CC6DAVyL.js";import"./text-accent-DZDDtpIt.js";import"./text-centered-CznToR0o.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./index-jEDObK_5.js";import"./index-C66nt8TK.js";import"./ProgressSteps-BBrWCYks.js";import"./message-BraTJ16C.js";import"./constants--ewUoBsO.js";import"./layout-relative.module-ed9bC4H4.js";import"./FormControl-CeIJk4_Z.js";import"./Input-C1hZX5_o.js";import"./InputContainer-Bk0tgFnW.js";const rt=({title:s,titleId:o,...t},n)=>a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",ref:n,"aria-labelledby":o,...t},s?a.createElement("title",{id:o},s):null,a.createElement("path",{fillRule:"evenodd",d:"M7.207 5.793a1 1 0 0 0-1.414 1.414L10.586 12l-4.793 4.793a1 1 0 1 0 1.414 1.414L12 13.414l4.793 4.793a1 1 0 0 0 1.414-1.414L13.414 12l4.793-4.793a1 1 0 0 0-1.414-1.414L12 10.586 7.207 5.793Z",clipRule:"evenodd"})),lt=a.forwardRef(rt),dt="overlay__NM-kk",ct="overlayShow__SQuh9",pt="overlayHide__UA0Uh",ut="Dialog__GqDxV",gt="mobileContentShow__1akQp",mt="mobileContentHide__GXooF",yt="contentShow__RpFHp",ht="contentHide__Y-gr5",ft="header__2EPvy",vt="description__0f9xh",Ct="actions__hIL-J",y={overlay:dt,overlayShow:ct,overlayHide:pt,Dialog:ut,"Dialog--fullheight":"Dialog--fullheight__2W7sp","no-border-radius":"no-border-radius__G2Oo3",mobileContentShow:gt,mobileContentHide:mt,"Dialog--size-xs":"Dialog--size-xs__W0yGm","Dialog--size-sm":"Dialog--size-sm__rE3Y-","Dialog--size-md":"Dialog--size-md__HWxI4","Dialog--size-lg":"Dialog--size-lg__Lis4-",contentShow:yt,contentHide:ht,"Dialog--narrow-l--size-xs":"Dialog--narrow-l--size-xs__ljCvr","Dialog--medium-s--size-xs":"Dialog--medium-s--size-xs__t-4Ow","Dialog--medium-l--size-xs":"Dialog--medium-l--size-xs__yc1ae","Dialog--wide-s--size-xs":"Dialog--wide-s--size-xs__Id0f5","Dialog--wide-l--size-xs":"Dialog--wide-l--size-xs__Pnlyp","Dialog--narrow-l--size-sm":"Dialog--narrow-l--size-sm__M8-BH","Dialog--medium-s--size-sm":"Dialog--medium-s--size-sm__UPlli","Dialog--medium-l--size-sm":"Dialog--medium-l--size-sm__nAW8A","Dialog--wide-s--size-sm":"Dialog--wide-s--size-sm__i0pbj","Dialog--wide-l--size-sm":"Dialog--wide-l--size-sm__PghJ-","Dialog--narrow-l--size-md":"Dialog--narrow-l--size-md__8jZY3","Dialog--medium-s--size-md":"Dialog--medium-s--size-md__dQ1TZ","Dialog--medium-l--size-md":"Dialog--medium-l--size-md__kcNF8","Dialog--wide-s--size-md":"Dialog--wide-s--size-md__KDVax","Dialog--wide-l--size-md":"Dialog--wide-l--size-md__mV57k","Dialog--narrow-l--size-lg":"Dialog--narrow-l--size-lg__h5Tdx","Dialog--medium-s--size-lg":"Dialog--medium-s--size-lg__qci5k","Dialog--medium-l--size-lg":"Dialog--medium-l--size-lg__JCkaM","Dialog--wide-s--size-lg":"Dialog--wide-s--size-lg__eJlxf","Dialog--wide-l--size-lg":"Dialog--wide-l--size-lg__mo796",header:ft,description:vt,actions:Ct},xt=({open:s,title:o,description:t,children:n,size:i="md",hideHeader:u,onClose:p,mobileFullHeight:h,dataset:E})=>{const{formatMessage:Ie}=Ge(),Pe=Xe(),He=St(s),Fe=Qe(E,{preplyDsComponent:R.Dialog}),Ee=$e(y,R.Dialog,[et("size",i),tt("fullheight",void 0,h)]).join(" "),Re=a.useCallback(Ae=>{Ae||p==null||p()},[p]);return e.jsx(We,{open:s,onOpenChange:Re,children:e.jsxs(Ne,{container:Pe,children:[e.jsx(Ve,{className:y.overlay,"data-testid":"dialog-overlay"}),e.jsxs(Me,{...Fe,ref:He,className:Ee,children:[e.jsxs("header",{className:y.header,children:[e.jsxs("hgroup",{hidden:u,children:[e.jsx(qe,{asChild:!0,children:e.jsx(Ke,{tag:"h3",variant:"medium",children:o})}),t&&e.jsx(Ue,{asChild:!0,children:e.jsx("p",{className:y.description,children:t})})]}),e.jsx(Je,{asChild:!0,children:e.jsx(Ze,{variant:"ghost",dataset:{testid:"dialog-close"},assistiveText:Ie(Ye.close),svg:lt})})]}),n]})]})})},Dt=({primaryLabel:s,secondaryLabel:o,onPrimaryClick:t,onSecondaryClick:n})=>e.jsxs("div",{className:y.actions,children:[e.jsx(d,{variant:"secondary",onClick:n,children:o}),e.jsx(d,{variant:"primary",onClick:t,children:s})]}),r=Object.assign(xt,{Actions:Dt});function St(s){const[o,t]=a.useState(null),n=a.useCallback(i=>t(i),[]);return a.useEffect(()=>{if(!s||!o)return;const i=async()=>{const p=o.getAnimations().map(E=>E.finished);await Promise.allSettled(p);const{y:h}=o.getBoundingClientRect();o.classList.toggle(y["no-border-radius"],h===0)};i(),window.addEventListener("resize",i);const u=new ResizeObserver(i);return u.observe(o),()=>{window.removeEventListener("resize",i),u.disconnect()}},[s,o]),n}try{r.displayName="Dialog",r.__docgenInfo={description:`A modal dialog component that can be used to show content in an overlay.
|
|
2
2
|
|
|
3
3
|
Composed of:
|
|
4
4
|
- Dialog: The main component
|
|
5
|
-
- Dialog.Actions: Footer actions with primary and secondary buttons`,displayName:"Dialog",props:{open:{defaultValue:null,description:"Controls the visibility of the dialog",name:"open",required:!0,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},title:{defaultValue:null,description:"Title displayed in the dialog header",name:"title",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},description:{defaultValue:null,description:"Optional description displayed below the title",name:"description",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},children:{defaultValue:null,description:"Content to be rendered inside the dialog",name:"children",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},size:{defaultValue:{value:"md"},description:"Controls the width of the dialog on desktop and height on mobile",name:"size",required:!1,type:{name:"enum",value:[{value:'"xs"'},{value:'"
|
|
5
|
+
- Dialog.Actions: Footer actions with primary and secondary buttons`,displayName:"Dialog",props:{open:{defaultValue:null,description:"Controls the visibility of the dialog",name:"open",required:!0,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},title:{defaultValue:null,description:"Title displayed in the dialog header",name:"title",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},description:{defaultValue:null,description:"Optional description displayed below the title",name:"description",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},children:{defaultValue:null,description:"Content to be rendered inside the dialog",name:"children",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},size:{defaultValue:{value:"md"},description:"Controls the width of the dialog on desktop and height on mobile",name:"size",required:!1,type:{name:"enum",value:[{value:'"xs"'},{value:'"md"'},{value:'"sm"'},{value:'"lg"'},{value:'ResponsiveProp<"xs" | "md" | "sm" | "lg">'}]}},hideHeader:{defaultValue:{value:"false"},description:`When true, visually hides the header (title and description) while
|
|
6
6
|
keeping it accessible to screen readers`,name:"hideHeader",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},onClose:{defaultValue:null,description:`Callback fired when the user tries to close the dialog (via escape
|
|
7
|
-
key, overlay click, or close button).`,name:"onClose",required:!1,type:{name:"enum",value:[{value:"() => void"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}const
|
|
7
|
+
key, overlay click, or close button).`,name:"onClose",required:!1,type:{name:"enum",value:[{value:"() => void"}]}},mobileFullHeight:{defaultValue:null,description:"Makes the Dialog take up the full screen height on mobile screens, i.e.\nscreens under the `medium-l` breakpoint.",name:"mobileFullHeight",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}const yo={title:"Components/Dialog",component:r,parameters:{docs:{story:{inline:!1,height:600}},a11y:{config:{rules:[{id:"color-contrast",enabled:!1}]}}},args:{onClose:Le()}},l=e.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}}),c=async({canvas:s,step:o})=>{let t;return await o("Open dialog",async()=>{const n=s.getByTestId("trigger");return await f.click(n),v(()=>(t=s.getByTestId("dialog"),g(t).toBeVisible()))}),t},C={render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"xs",title:"Extra Small Dialog",dataset:{testid:"dialog"},children:l})]})},play:c},x={render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"sm",title:"Small Dialog",dataset:{testid:"dialog"},children:l})]})},play:c},D={render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"md",title:"Medium Dialog",dataset:{testid:"dialog"},children:l})]})},play:c},S={render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"lg",title:"Large Dialog",dataset:{testid:"dialog"},children:l})]})},play:c},w={parameters:{docs:{description:{story:`
|
|
8
8
|
The Dialog component adapts to different screen sizes through responsive size props.
|
|
9
9
|
Use an object with breakpoints as keys to specify different sizes at different viewport widths:
|
|
10
10
|
|
|
@@ -16,11 +16,11 @@ Use an object with breakpoints as keys to specify different sizes at different v
|
|
|
16
16
|
}}
|
|
17
17
|
/>
|
|
18
18
|
\`\`\`
|
|
19
|
-
`}}},render:function(){const[
|
|
19
|
+
`}}},render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:{_:"xs","medium-l":"lg"},title:"Width Responsivness",description:"Change the window width to see the Dialog width respond to it",dataset:{testid:"dialog"},children:l})]})},play:c},b={render:function(o){const[t,n]=a.useState(!1),[i,u]=a.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>n(!0),children:"Open"}),e.jsxs(r,{open:t,onClose:()=>{var p;n(!1),(p=o.onClose)==null||p.call(o)},size:"md",title:"Height Responsiveness",description:"Change the number of children to see the Dialog style respond to the height change",dataset:{testid:"dialog"},children:[e.jsx(it,{label:"Child count",value:i,onChange:p=>u(parseInt(p.target.value)),required:!0}),e.jsx("br",{}),Array.from({length:i},(p,h)=>e.jsx(a.Fragment,{children:l},h)),e.jsx(r.Actions,{primaryLabel:"Primary",secondaryLabel:"Secondary",onPrimaryClick:F("Primary button clicked"),onSecondaryClick:F("Secondary button clicked")})]})]})},play:c},z={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"md",title:"Mobile Full Height",dataset:{testid:"dialog"},mobileFullHeight:!0,children:l})]})},play:c},O={render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"md",title:"Visually Hidden Title",description:"This header is hidden visually but still accessible to screen readers",hideHeader:!0,dataset:{testid:"dialog"},children:l})]})},play:c},j={render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsxs(r,{open:o,onClose:()=>t(!1),size:"md",title:"Dialog Title",description:"This is the dialog description.",dataset:{testid:"dialog"},children:[l,e.jsx(r.Actions,{primaryLabel:"Primary",secondaryLabel:"Secondary",onPrimaryClick:F("Primary button clicked"),onSecondaryClick:F("Secondary button clicked")})]})]})},play:c},k={parameters:{docs:{description:{story:`
|
|
20
20
|
The Dialog component can be used with the Steps component to create multi-step flows.
|
|
21
21
|
You can hide the Dialog's header using \`hideHeader\` and add your own headers to each step,
|
|
22
22
|
like in this story.
|
|
23
|
-
`}}},render:function(){const[
|
|
23
|
+
`}}},render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"md",title:"Hidden Dialog Title",hideHeader:!0,dataset:{testid:"dialog"},children:e.jsxs(m,{"aria-label":"Onboarding Steps",children:[e.jsx(m.Step,{title:"Profile",description:"Tell us more about yourself",children:l}),e.jsx(m.Step,{title:"Subject",description:"What do you want to learn?",children:l}),e.jsx(m.Step,{title:"Availability",description:"When are you available?",children:l}),e.jsx("br",{}),e.jsxs(at,{justifyContent:"space-between",children:[e.jsx(m.Previous,{}),e.jsx(m.Next,{})]})]})})]})},play:c},_={parameters:{docs:{description:{story:"A dialog with an Icon component in the title. This demonstrates how to use React elements in the title."}}},render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"md",title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(ot,{svg:nt}),e.jsx("span",{children:"Information Dialog"})]}),description:"This dialog title includes an icon component",dataset:{testid:"dialog"},children:l})]})},play:c},B={parameters:{docs:{description:{story:"A dialog with an Avatar component in the title. This demonstrates how to use compound components in the title."}}},render:function(){const[o,t]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,onClose:()=>t(!1),size:"md",title:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx(st,{size:"s",alt:"User"}),e.jsx("span",{children:"User Profile"})]}),description:"This dialog shows a user profile with an avatar in the title",dataset:{testid:"dialog"},children:l})]})},play:c},T={parameters:{docs:{description:{story:`
|
|
24
24
|
The Dialog component provides CSS property escape hatches for controlling the z-index of both the overlay and content:
|
|
25
25
|
|
|
26
26
|
- \`--ds-dialog-overlay-z-index-override\`: Controls the overlay's z-index
|
|
@@ -32,7 +32,7 @@ In the following example, the stacking order of the dialog trigger, overlay, and
|
|
|
32
32
|
reveresed using the above CSS properties.
|
|
33
33
|
|
|
34
34
|
Note: This is done using a \`useEffect\` just for the sake of the story. In a real-world scenario, this should ideally be done in a global stylesheet or a theme provider.
|
|
35
|
-
`}}},render:function(){const[
|
|
35
|
+
`}}},render:function(){const[o,t]=a.useState(!1);return a.useEffect(()=>(document.body.style.setProperty("--ds-dialog-overlay-z-index-override","88"),document.body.style.setProperty("--ds-dialog-content-z-index-override","77"),()=>{document.body.style.removeProperty("--ds-dialog-overlay-z-index-override"),document.body.style.removeProperty("--ds-dialog-content-z-index-override")}),[]),e.jsxs("div",{style:{position:"relative",zIndex:99},children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>t(!0),children:"Open"}),e.jsx(r,{open:o,title:"ZIndex Override",size:"md",onClose:()=>t(!1),dataset:{testid:"dialog"},children:l})]})},play:async({canvas:s,step:o})=>{await o("Open alert",async()=>(await f.click(s.getByTestId("trigger")),v(()=>{const t=s.getByTestId("dialog");g(t).toBeVisible()}))),await o("Check content's computed z-index",async()=>{const t=s.getByTestId("dialog"),n=getComputedStyle(t);g(n.zIndex).toBe("77")}),await o("Check overlay's computed z-index",async()=>{const t=s.getByTestId("dialog").previousElementSibling;if(!t)throw new Error("The overlay happened to be the previous sibling of the dialog content, but it isn't anymore. Please update the test.");const n=getComputedStyle(t);g(n.zIndex).toBe("88")})}},I={tags:["!autodocs"],render:function(o){const[t,n]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>n(!0),children:"Open"}),e.jsx(r,{open:t,onClose:()=>{var i;n(!1),(i=o.onClose)==null||i.call(o)},size:"md",title:"Test Close Button",dataset:{testid:"dialog"},children:l})]})},play:async s=>{const o=await c(s),{canvas:t,step:n,args:i}=s;await n("Close dialog using close button",async()=>{const u=t.getByTestId("dialog-close");return await f.click(u),v(async()=>(await g(o).not.toBeVisible(),g(i.onClose).toHaveBeenCalledOnce()))})}},P={tags:["!autodocs"],render:function(o){const[t,n]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>n(!0),children:"Open"}),e.jsx(r,{open:t,onClose:()=>{var i;n(!1),(i=o.onClose)==null||i.call(o)},size:"md",title:"Test Close Overlay",dataset:{testid:"dialog"},children:l})]})},play:async s=>{const o=await c(s),{canvas:t,step:n,args:i}=s;await n("Close dialog by clicking overlay",async()=>{const u=t.getByTestId("dialog-overlay");return await f.click(u),v(async()=>(await g(o).not.toBeVisible(),g(i.onClose).toHaveBeenCalledOnce()))})}},H={tags:["!autodocs"],render:function(o){const[t,n]=a.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d,{dataset:{testid:"trigger"},onClick:()=>n(!0),children:"Open"}),e.jsx(r,{open:t,onClose:()=>{var i;n(!1),(i=o.onClose)==null||i.call(o)},size:"md",title:"Test Close Keyboard",dataset:{testid:"dialog"},children:l})]})},play:async s=>{const o=await c(s),{step:t,args:n}=s;await t("Close dialog using escape key",async()=>(await f.keyboard("{Escape}"),v(async()=>(await g(o).not.toBeVisible(),g(n.onClose).toHaveBeenCalledOnce()))))}};var A,L,W;C.parameters={...C.parameters,docs:{...(A=C.parameters)==null?void 0:A.docs,source:{originalSource:`{
|
|
36
36
|
render: function Story() {
|
|
37
37
|
const [open, setOpen] = useState(false);
|
|
38
38
|
return <>
|
|
@@ -49,7 +49,7 @@ Note: This is done using a \`useEffect\` just for the sake of the story. In a re
|
|
|
49
49
|
</>;
|
|
50
50
|
},
|
|
51
51
|
play: openDialogPlay
|
|
52
|
-
}`,...(
|
|
52
|
+
}`,...(W=(L=C.parameters)==null?void 0:L.docs)==null?void 0:W.source}}};var N,V,M;x.parameters={...x.parameters,docs:{...(N=x.parameters)==null?void 0:N.docs,source:{originalSource:`{
|
|
53
53
|
render: function Story() {
|
|
54
54
|
const [open, setOpen] = useState(false);
|
|
55
55
|
return <>
|
|
@@ -66,7 +66,7 @@ Note: This is done using a \`useEffect\` just for the sake of the story. In a re
|
|
|
66
66
|
</>;
|
|
67
67
|
},
|
|
68
68
|
play: openDialogPlay
|
|
69
|
-
}`,...(
|
|
69
|
+
}`,...(M=(V=x.parameters)==null?void 0:V.docs)==null?void 0:M.source}}};var q,U,J;D.parameters={...D.parameters,docs:{...(q=D.parameters)==null?void 0:q.docs,source:{originalSource:`{
|
|
70
70
|
render: function Story() {
|
|
71
71
|
const [open, setOpen] = useState(false);
|
|
72
72
|
return <>
|
|
@@ -83,7 +83,7 @@ Note: This is done using a \`useEffect\` just for the sake of the story. In a re
|
|
|
83
83
|
</>;
|
|
84
84
|
},
|
|
85
85
|
play: openDialogPlay
|
|
86
|
-
}`,...(
|
|
86
|
+
}`,...(J=(U=D.parameters)==null?void 0:U.docs)==null?void 0:J.source}}};var Z,K,Y;S.parameters={...S.parameters,docs:{...(Z=S.parameters)==null?void 0:Z.docs,source:{originalSource:`{
|
|
87
87
|
render: function Story() {
|
|
88
88
|
const [open, setOpen] = useState(false);
|
|
89
89
|
return <>
|
|
@@ -100,7 +100,7 @@ Note: This is done using a \`useEffect\` just for the sake of the story. In a re
|
|
|
100
100
|
</>;
|
|
101
101
|
},
|
|
102
102
|
play: openDialogPlay
|
|
103
|
-
}`,...(
|
|
103
|
+
}`,...(Y=(K=S.parameters)==null?void 0:K.docs)==null?void 0:Y.source}}};var G,X,Q;w.parameters={...w.parameters,docs:{...(G=w.parameters)==null?void 0:G.docs,source:{originalSource:`{
|
|
104
104
|
parameters: {
|
|
105
105
|
docs: {
|
|
106
106
|
description: {
|
|
@@ -139,7 +139,7 @@ Use an object with breakpoints as keys to specify different sizes at different v
|
|
|
139
139
|
</>;
|
|
140
140
|
},
|
|
141
141
|
play: openDialogPlay
|
|
142
|
-
}`,...(
|
|
142
|
+
}`,...(Q=(X=w.parameters)==null?void 0:X.docs)==null?void 0:Q.source}}};var $,ee,te;b.parameters={...b.parameters,docs:{...($=b.parameters)==null?void 0:$.docs,source:{originalSource:`{
|
|
143
143
|
render: function Story(args) {
|
|
144
144
|
const [open, setOpen] = useState(false);
|
|
145
145
|
const [count, setCount] = useState(1);
|
|
@@ -165,7 +165,39 @@ Use an object with breakpoints as keys to specify different sizes at different v
|
|
|
165
165
|
</>;
|
|
166
166
|
},
|
|
167
167
|
play: openDialogPlay
|
|
168
|
-
}`,...(ee=
|
|
168
|
+
}`,...(te=(ee=b.parameters)==null?void 0:ee.docs)==null?void 0:te.source}}};var oe,se,ne;z.parameters={...z.parameters,docs:{...(oe=z.parameters)==null?void 0:oe.docs,source:{originalSource:`{
|
|
169
|
+
parameters: {
|
|
170
|
+
chromatic: {
|
|
171
|
+
modes: {
|
|
172
|
+
'narrow-l': {
|
|
173
|
+
viewport: 'narrow-l'
|
|
174
|
+
},
|
|
175
|
+
'medium-s': {
|
|
176
|
+
viewport: 'medium-s'
|
|
177
|
+
},
|
|
178
|
+
'medium-l': {
|
|
179
|
+
viewport: 'medium-l'
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
render: function Story() {
|
|
185
|
+
const [open, setOpen] = useState(false);
|
|
186
|
+
return <>
|
|
187
|
+
<Button dataset={{
|
|
188
|
+
testid: 'trigger'
|
|
189
|
+
}} onClick={() => setOpen(true)}>
|
|
190
|
+
Open
|
|
191
|
+
</Button>
|
|
192
|
+
<Dialog open={open} onClose={() => setOpen(false)} size="md" title="Mobile Full Height" dataset={{
|
|
193
|
+
testid: 'dialog'
|
|
194
|
+
}} mobileFullHeight>
|
|
195
|
+
{DummyContent}
|
|
196
|
+
</Dialog>
|
|
197
|
+
</>;
|
|
198
|
+
},
|
|
199
|
+
play: openDialogPlay
|
|
200
|
+
}`,...(ne=(se=z.parameters)==null?void 0:se.docs)==null?void 0:ne.source}}};var ae,ie,re;O.parameters={...O.parameters,docs:{...(ae=O.parameters)==null?void 0:ae.docs,source:{originalSource:`{
|
|
169
201
|
render: function Story() {
|
|
170
202
|
const [open, setOpen] = useState(false);
|
|
171
203
|
return <>
|
|
@@ -182,7 +214,7 @@ Use an object with breakpoints as keys to specify different sizes at different v
|
|
|
182
214
|
</>;
|
|
183
215
|
},
|
|
184
216
|
play: openDialogPlay
|
|
185
|
-
}`,...(
|
|
217
|
+
}`,...(re=(ie=O.parameters)==null?void 0:ie.docs)==null?void 0:re.source}}};var le,de,ce;j.parameters={...j.parameters,docs:{...(le=j.parameters)==null?void 0:le.docs,source:{originalSource:`{
|
|
186
218
|
render: function Story() {
|
|
187
219
|
const [open, setOpen] = useState(false);
|
|
188
220
|
return <>
|
|
@@ -200,7 +232,7 @@ Use an object with breakpoints as keys to specify different sizes at different v
|
|
|
200
232
|
</>;
|
|
201
233
|
},
|
|
202
234
|
play: openDialogPlay
|
|
203
|
-
}`,...(
|
|
235
|
+
}`,...(ce=(de=j.parameters)==null?void 0:de.docs)==null?void 0:ce.source}}};var pe,ue,ge;k.parameters={...k.parameters,docs:{...(pe=k.parameters)==null?void 0:pe.docs,source:{originalSource:`{
|
|
204
236
|
parameters: {
|
|
205
237
|
docs: {
|
|
206
238
|
description: {
|
|
@@ -243,7 +275,7 @@ like in this story.
|
|
|
243
275
|
</>;
|
|
244
276
|
},
|
|
245
277
|
play: openDialogPlay
|
|
246
|
-
}`,...(
|
|
278
|
+
}`,...(ge=(ue=k.parameters)==null?void 0:ue.docs)==null?void 0:ge.source}}};var me,ye,he;_.parameters={..._.parameters,docs:{...(me=_.parameters)==null?void 0:me.docs,source:{originalSource:`{
|
|
247
279
|
parameters: {
|
|
248
280
|
docs: {
|
|
249
281
|
description: {
|
|
@@ -274,7 +306,7 @@ like in this story.
|
|
|
274
306
|
</>;
|
|
275
307
|
},
|
|
276
308
|
play: openDialogPlay
|
|
277
|
-
}`,...(
|
|
309
|
+
}`,...(he=(ye=_.parameters)==null?void 0:ye.docs)==null?void 0:he.source}}};var fe,ve,Ce;B.parameters={...B.parameters,docs:{...(fe=B.parameters)==null?void 0:fe.docs,source:{originalSource:`{
|
|
278
310
|
parameters: {
|
|
279
311
|
docs: {
|
|
280
312
|
description: {
|
|
@@ -305,7 +337,7 @@ like in this story.
|
|
|
305
337
|
</>;
|
|
306
338
|
},
|
|
307
339
|
play: openDialogPlay
|
|
308
|
-
}`,...(
|
|
340
|
+
}`,...(Ce=(ve=B.parameters)==null?void 0:ve.docs)==null?void 0:Ce.source}}};var xe,De,Se;T.parameters={...T.parameters,docs:{...(xe=T.parameters)==null?void 0:xe.docs,source:{originalSource:`{
|
|
309
341
|
parameters: {
|
|
310
342
|
docs: {
|
|
311
343
|
description: {
|
|
@@ -374,7 +406,7 @@ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In
|
|
|
374
406
|
expect(styles.zIndex).toBe('88');
|
|
375
407
|
});
|
|
376
408
|
}
|
|
377
|
-
}`,...(
|
|
409
|
+
}`,...(Se=(De=T.parameters)==null?void 0:De.docs)==null?void 0:Se.source}}};var we,be,ze;I.parameters={...I.parameters,docs:{...(we=I.parameters)==null?void 0:we.docs,source:{originalSource:`{
|
|
378
410
|
tags: ['!autodocs'],
|
|
379
411
|
render: function Story(args) {
|
|
380
412
|
const [open, setOpen] = useState(false);
|
|
@@ -410,7 +442,7 @@ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In
|
|
|
410
442
|
});
|
|
411
443
|
});
|
|
412
444
|
}
|
|
413
|
-
}`,...(
|
|
445
|
+
}`,...(ze=(be=I.parameters)==null?void 0:be.docs)==null?void 0:ze.source}}};var Oe,je,ke;P.parameters={...P.parameters,docs:{...(Oe=P.parameters)==null?void 0:Oe.docs,source:{originalSource:`{
|
|
414
446
|
tags: ['!autodocs'],
|
|
415
447
|
render: function Story(args) {
|
|
416
448
|
const [open, setOpen] = useState(false);
|
|
@@ -446,7 +478,7 @@ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In
|
|
|
446
478
|
});
|
|
447
479
|
});
|
|
448
480
|
}
|
|
449
|
-
}`,...(
|
|
481
|
+
}`,...(ke=(je=P.parameters)==null?void 0:je.docs)==null?void 0:ke.source}}};var _e,Be,Te;H.parameters={...H.parameters,docs:{...(_e=H.parameters)==null?void 0:_e.docs,source:{originalSource:`{
|
|
450
482
|
tags: ['!autodocs'],
|
|
451
483
|
render: function Story(args) {
|
|
452
484
|
const [open, setOpen] = useState(false);
|
|
@@ -480,4 +512,4 @@ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In
|
|
|
480
512
|
});
|
|
481
513
|
});
|
|
482
514
|
}
|
|
483
|
-
}`,...(
|
|
515
|
+
}`,...(Te=(Be=H.parameters)==null?void 0:Be.docs)==null?void 0:Te.source}}};const ho=["ExtraSmall","Small","Medium","Large","WidthResponsiveness","HeightResponsiveness","MobileFullHeight","WithHiddenHeader","WithActions","WithSteps","WithIconInTitle","WithAvatarInTitle","WithZIndexOverride","TestCloseButton","TestCloseOverlay","TestCloseKeyboard"];export{C as ExtraSmall,b as HeightResponsiveness,S as Large,D as Medium,z as MobileFullHeight,x as Small,I as TestCloseButton,H as TestCloseKeyboard,P as TestCloseOverlay,w as WidthResponsiveness,j as WithActions,B as WithAvatarInTitle,O as WithHiddenHeader,_ as WithIconInTitle,k as WithSteps,T as WithZIndexOverride,ho as __namedExportsOrder,yo as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-uOP2uDdf.js","./index-B3evPFBL.js","./_commonjsHelpers-Cpj98o6Y.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as l}from"./iframe-
|
|
2
|
+
import{_ as l}from"./iframe-BE13K_u-.js";import{r as s,e as n}from"./index-B3evPFBL.js";import{H as p,A as h,C as E,c as d}from"./index-CjMmneJr.js";import{c as v}from"./client-DXF5tT0h.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./jsx-runtime-BYouaCF_.js";import"./index-jEDObK_5.js";import"./index-C66nt8TK.js";import"./index-Cu4lwwaE.js";import"./index-CXQShRbs.js";import"./index-DrFu-skq.js";var i=new Map;function R(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var f=({callback:e,children:t})=>{let r=s.useRef();return s.useLayoutEffect(()=>{r.current!==e&&(r.current=e,e())},[e]),t};typeof Promise.withResolvers>"u"&&(Promise.withResolvers=()=>{let e=null,t=null;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}});var w=async(e,t,r)=>{let o=await x(t,r);if(R()){o.render(e);return}let{promise:a,resolve:m}=Promise.withResolvers();return o.render(s.createElement(f,{callback:m},e)),a},_=(e,t)=>{let r=i.get(e);r&&(r.unmount(),i.delete(e))},x=async(e,t)=>{let r=i.get(e);return r||(r=v.createRoot(e,t),i.set(e,r)),r},g={code:E,a:h,...p},y=class extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){let{showException:t}=this.props;t(e)}render(){let{hasError:e}=this.state,{children:t}=this.props;return e?null:n.createElement(n.Fragment,null,t)}},H=class{constructor(){this.render=async(e,t,r)=>{let o={...g,...t==null?void 0:t.components},a=d;return new Promise((m,c)=>{l(async()=>{const{MDXProvider:u}=await import("./index-uOP2uDdf.js");return{MDXProvider:u}},__vite__mapDeps([0,1,2]),import.meta.url).then(({MDXProvider:u})=>w(n.createElement(y,{showException:c,key:Math.random()},n.createElement(u,{components:o},n.createElement(a,{context:e,docsParameter:t}))),r)).then(()=>m())})},this.unmount=e=>{_(e)}}};export{H as DocsRenderer,g as defaultComponents};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BYouaCF_.js";import{r as u}from"./index-B3evPFBL.js";import{e as m}from"./index-DDyIDR-R.js";import{c as n,C as o}from"./CountryFlag-
|
|
1
|
+
import{j as e}from"./jsx-runtime-BYouaCF_.js";import{r as u}from"./index-B3evPFBL.js";import{e as m}from"./index-DDyIDR-R.js";import{c as n,C as o}from"./CountryFlag-ClC7kEHn.js";import{L as F}from"./LayoutFlex-BBGvSVMb.js";import{L as y,a as r}from"./LayoutGridItem-CZ6SKl8g.js";import{T as a}from"./Text-BmdJVr9v.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./componentNames-CpCJzpB9.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./layout-relative.module-ed9bC4H4.js";import"./classNames-BUL1Zq7e.js";import"./defaults-B1rzzf6M.js";import"./breakpoints-BfMlrtxE.js";import"./align-self-BM6l9H5Z.js";import"./constants-DYYVurUY.js";import"./text-accent-DZDDtpIt.js";import"./text-centered-CznToR0o.js";const J={title:"components/CountryFlag",component:o,args:{code:"ua",alt:n.ua}},s={render:function(){return e.jsxs("div",{style:{maxWidth:"1000px"},children:[e.jsx(a,{variant:"default-semibold",children:"For some countries, simplified flags are automatically used (unless `simplified` is set to `false`)"}),e.jsxs(y,{columns:4,children:[e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"Code"})}),e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"Country name"})}),e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"4x3"})}),e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"4x3 (with `simplified=false`)"})}),["es","mx"].map(t=>e.jsxs(u.Fragment,{children:[e.jsx(r,{children:t}),e.jsx(r,{children:n[t]}),e.jsx(r,{children:e.jsx(o,{code:t,alt:n[t],size:"large"})}),e.jsx(r,{children:e.jsx(o,{code:t,alt:n[t],size:"large",simplified:!1})})]},t))]}),e.jsx("br",{}),e.jsx(a,{variant:"default-semibold",children:"All countries"}),e.jsxs(y,{columns:3,children:[e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"Code"})}),e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"Country name"})}),e.jsx(r,{children:e.jsx(a,{variant:"default-semibold",children:"4x3"})}),Object.keys(n).map(t=>e.jsxs(u.Fragment,{children:[e.jsx(r,{children:t}),e.jsx(r,{children:n[t]}),e.jsx(r,{children:e.jsx(o,{code:t,alt:n[t],size:"large"})})]},t))]})]})}},d={render:i=>e.jsxs(F,{gap:"16",children:[e.jsx(o,{...i,size:"small"}),e.jsx(o,{...i,size:"medium"}),e.jsx(o,{...i,size:"large"})]})},l={render:function(){return e.jsxs(e.Fragment,{children:[e.jsx(a,{variant:"default-regular-italic",children:"Invalid country code"}),e.jsx(o,{code:"invalidCountryCode",alt:"Invalid country code"}),e.jsx(a,{variant:"default-regular-italic",children:"`undefined` country code"}),e.jsx(o,{code:void 0,alt:"Undefined country code"})]})},play:async({canvas:i})=>{const t=i.getByAltText("Invalid country code");m(t).toBeVisible();const b=i.getByAltText("Undefined country code");m(b).toBeVisible()}},c={parameters:{chromatic:{disableSnapshot:!0}},args:{dataset:{qaid:"flag"}},argTypes:{dataset:{control:"object"}}};var x,p,f;s.parameters={...s.parameters,docs:{...(x=s.parameters)==null?void 0:x.docs,source:{originalSource:`{
|
|
2
2
|
render: function Story() {
|
|
3
3
|
return <div style={{
|
|
4
4
|
maxWidth: '1000px'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./jsx-runtime-BYouaCF_.js";import{e as o}from"./index-DDyIDR-R.js";import{C as s}from"./CountryFlag-
|
|
1
|
+
import{j as d}from"./jsx-runtime-BYouaCF_.js";import{e as o}from"./index-DDyIDR-R.js";import{C as s}from"./CountryFlag-ClC7kEHn.js";import"./index-B3evPFBL.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./componentNames-CpCJzpB9.js";const v={title:"components/CountryFlag/Tests",component:s,args:{},tags:["!autodocs","!a11y-test","test"]},a={render:function(){return d.jsx(s,{code:"ua",alt:"Ukraine",dataset:{foo:1,bar:"2",baz:!1}})},play:async({canvas:t})=>{const e=t.getByAltText("Ukraine");o(e).toHaveAttribute("data-foo","1"),o(e).toHaveAttribute("data-bar","2"),o(e).toHaveAttribute("data-baz","false")}},r={render:function(){return d.jsx(s,{code:"ua",alt:"Ukraine",loading:"lazy"})},play:async({canvas:t})=>{const e=t.getByAltText("Ukraine");o(e).toHaveAttribute("loading","lazy")}};var n,c,l;a.parameters={...a.parameters,docs:{...(n=a.parameters)==null?void 0:n.docs,source:{originalSource:`{
|
|
2
2
|
render: function Story() {
|
|
3
3
|
return <CountryFlag code="ua" alt="Ukraine" dataset={{
|
|
4
4
|
foo: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./jsx-runtime-BYouaCF_.js";import{F as x}from"./FormControl-CeIJk4_Z.js";import{d as r}from"./styled-components.browser.esm-CwsnEFnS.js";import{r as j}from"./index-B3evPFBL.js";import{I as k}from"./Icon-
|
|
1
|
+
import{j as t}from"./jsx-runtime-BYouaCF_.js";import{F as x}from"./FormControl-CeIJk4_Z.js";import{d as r}from"./styled-components.browser.esm-CwsnEFnS.js";import{r as j}from"./index-B3evPFBL.js";import{I as k}from"./Icon-ZIxauYsE.js";import{F as $}from"./TokyoUIUpload-Bi3CuQzX.js";import{T as L}from"./Text-BmdJVr9v.js";import{g as e}from"./getTokenVar-DU_DEzTd.js";import{c as d,s as p,r as S}from"./tokens-ZvFzTwDp.js";import"./index-DRKYGVyc.js";import"./index-BfBdt3zW.js";import"./tslib.es6-BntfKcQG.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./index-DdzHuZ-Y.js";import"./message-BraTJ16C.js";import"./componentNames-CpCJzpB9.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./render-icon-CVTdrNe-.js";import"./defaults-B1rzzf6M.js";import"./text-centered-CznToR0o.js";import"./constants-BgBLeZzp.js";const tt={title:"Components/FormControl",component:x,parameters:{layout:"padded"}},o=()=>{const b=r.input.attrs({type:"file"})`
|
|
2
2
|
visibility: hidden;
|
|
3
3
|
position: absolute;
|
|
4
4
|
width: 0;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{j as x}from"./jsx-runtime-BYouaCF_.js";import{r as N}from"./index-B3evPFBL.js";import{g as b,a as C}from"./text-accent-DZDDtpIt.js";import{g as L}from"./text-centered-CznToR0o.js";import{f as T}from"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import{m as k,s as q,b as E}from"./classNames-BUL1Zq7e.js";import{w as i}from"./componentNames-CpCJzpB9.js";import{g as U}from"./index-DdzHuZ-Y.js";const V="Heading__Erkb1",I={Heading:V,"Heading--level-h1-normal":"Heading--level-h1-normal__t2Kqc","Heading--level-h1-large":"Heading--level-h1-large__2-ENi","Heading--level-h2-normal":"Heading--level-h2-normal__VzetR","Heading--level-h2-large":"Heading--level-h2-large__NxpiQ","Heading--level-h3-normal":"Heading--level-h3-normal__vCnMS","Heading--level-h3-large":"Heading--level-h3-large__Vs-gN","Heading--level-h4-normal":"Heading--level-h4-normal__O6PPx","Heading--level-h4-large":"Heading--level-h4-large__fNZXP","Heading--level-h5-normal":"Heading--level-h5-normal__IMKhU","Heading--level-h5-large":"Heading--level-h5-large__G40j-","Heading--narrow-l--level-h1-normal":"Heading--narrow-l--level-h1-normal__1qZxP","Heading--narrow-l--level-h1-large":"Heading--narrow-l--level-h1-large__vhit5","Heading--narrow-l--level-h2-normal":"Heading--narrow-l--level-h2-normal__a2FJF","Heading--narrow-l--level-h2-large":"Heading--narrow-l--level-h2-large__qFLdx","Heading--narrow-l--level-h3-normal":"Heading--narrow-l--level-h3-normal__D2GNa","Heading--narrow-l--level-h3-large":"Heading--narrow-l--level-h3-large__xeciI","Heading--narrow-l--level-h4-normal":"Heading--narrow-l--level-h4-normal__G7nUl","Heading--narrow-l--level-h4-large":"Heading--narrow-l--level-h4-large__cL6he","Heading--narrow-l--level-h5-normal":"Heading--narrow-l--level-h5-normal__UNw3s","Heading--narrow-l--level-h5-large":"Heading--narrow-l--level-h5-large__o76Fo","Heading--medium-s--level-h1-normal":"Heading--medium-s--level-h1-normal__IGwXF","Heading--medium-s--level-h1-large":"Heading--medium-s--level-h1-large__y2QjY","Heading--medium-s--level-h2-normal":"Heading--medium-s--level-h2-normal__T5nXA","Heading--medium-s--level-h2-large":"Heading--medium-s--level-h2-large__FbGid","Heading--medium-s--level-h3-normal":"Heading--medium-s--level-h3-normal__dcenB","Heading--medium-s--level-h3-large":"Heading--medium-s--level-h3-large__AR-Fa","Heading--medium-s--level-h4-normal":"Heading--medium-s--level-h4-normal__-NI8n","Heading--medium-s--level-h4-large":"Heading--medium-s--level-h4-large__AE93N","Heading--medium-s--level-h5-normal":"Heading--medium-s--level-h5-normal__ZJEJ-","Heading--medium-s--level-h5-large":"Heading--medium-s--level-h5-large__GJ8sd","Heading--medium-l--level-h1-normal":"Heading--medium-l--level-h1-normal__UG7oa","Heading--medium-l--level-h1-large":"Heading--medium-l--level-h1-large__hJgJ9","Heading--medium-l--level-h2-normal":"Heading--medium-l--level-h2-normal__sf7Py","Heading--medium-l--level-h2-large":"Heading--medium-l--level-h2-large__iYIZ9","Heading--medium-l--level-h3-normal":"Heading--medium-l--level-h3-normal__32eny","Heading--medium-l--level-h3-large":"Heading--medium-l--level-h3-large__kuCwB","Heading--medium-l--level-h4-normal":"Heading--medium-l--level-h4-normal__TE1Eh","Heading--medium-l--level-h4-large":"Heading--medium-l--level-h4-large__zZfdz","Heading--medium-l--level-h5-normal":"Heading--medium-l--level-h5-normal__7HYFE","Heading--medium-l--level-h5-large":"Heading--medium-l--level-h5-large__NkY03","Heading--wide-s--level-h1-normal":"Heading--wide-s--level-h1-normal__kqRcj","Heading--wide-s--level-h1-large":"Heading--wide-s--level-h1-large__yzHzL","Heading--wide-s--level-h2-normal":"Heading--wide-s--level-h2-normal__b9MXd","Heading--wide-s--level-h2-large":"Heading--wide-s--level-h2-large__q0kXc","Heading--wide-s--level-h3-normal":"Heading--wide-s--level-h3-normal__Ziuj8","Heading--wide-s--level-h3-large":"Heading--wide-s--level-h3-large__Q4111","Heading--wide-s--level-h4-normal":"Heading--wide-s--level-h4-normal__TxCtT","Heading--wide-s--level-h4-large":"Heading--wide-s--level-h4-large__cQQZf","Heading--wide-s--level-h5-normal":"Heading--wide-s--level-h5-normal__ZSrD7","Heading--wide-s--level-h5-large":"Heading--wide-s--level-h5-large__ZuCIn","Heading--wide-l--level-h1-normal":"Heading--wide-l--level-h1-normal__MavHI","Heading--wide-l--level-h1-large":"Heading--wide-l--level-h1-large__rE1tu","Heading--wide-l--level-h2-normal":"Heading--wide-l--level-h2-normal__YUYcX","Heading--wide-l--level-h2-large":"Heading--wide-l--level-h2-large__v5ssH","Heading--wide-l--level-h3-normal":"Heading--wide-l--level-h3-normal__kQBs2","Heading--wide-l--level-h3-large":"Heading--wide-l--level-h3-large__pU-wX","Heading--wide-l--level-h4-normal":"Heading--wide-l--level-h4-normal__WvWGX","Heading--wide-l--level-h4-large":"Heading--wide-l--level-h4-large__TeFQp","Heading--wide-l--level-h5-normal":"Heading--wide-l--level-h5-normal__1yKda","Heading--wide-l--level-h5-large":"Heading--wide-l--level-h5-large__Uadr4","Heading--variant-massive":"Heading--variant-massive__JFGji","Heading--variant-huge":"Heading--variant-huge__47FQz","Heading--variant-extraLarge":"Heading--variant-extraLarge__xRrqx","Heading--variant-large":"Heading--variant-large__wNK6S","Heading--variant-medium":"Heading--variant-medium__bCNZ-","Heading--variant-small":"Heading--variant-small__308Nb","Heading--narrow-l--variant-massive":"Heading--narrow-l--variant-massive__yg4AJ","Heading--narrow-l--variant-huge":"Heading--narrow-l--variant-huge__y9b4N","Heading--narrow-l--variant-extraLarge":"Heading--narrow-l--variant-extraLarge__XgyJu","Heading--narrow-l--variant-large":"Heading--narrow-l--variant-large__tzTo6","Heading--narrow-l--variant-medium":"Heading--narrow-l--variant-medium__iP3sG","Heading--narrow-l--variant-small":"Heading--narrow-l--variant-small__KeKjn","Heading--medium-s--variant-massive":"Heading--medium-s--variant-massive__L-b4J","Heading--medium-s--variant-huge":"Heading--medium-s--variant-huge__2o5EA","Heading--medium-s--variant-extraLarge":"Heading--medium-s--variant-extraLarge__eHmYu","Heading--medium-s--variant-large":"Heading--medium-s--variant-large__AI3KL","Heading--medium-s--variant-medium":"Heading--medium-s--variant-medium__t5dUK","Heading--medium-s--variant-small":"Heading--medium-s--variant-small__fCdNa","Heading--medium-l--variant-massive":"Heading--medium-l--variant-massive__jI3FW","Heading--medium-l--variant-huge":"Heading--medium-l--variant-huge__k0UpW","Heading--medium-l--variant-extraLarge":"Heading--medium-l--variant-extraLarge__yfai7","Heading--medium-l--variant-large":"Heading--medium-l--variant-large__65QTG","Heading--medium-l--variant-medium":"Heading--medium-l--variant-medium__UvxHB","Heading--medium-l--variant-small":"Heading--medium-l--variant-small__QI2p2","Heading--wide-s--variant-massive":"Heading--wide-s--variant-massive__B1S84","Heading--wide-s--variant-huge":"Heading--wide-s--variant-huge__KvYrn","Heading--wide-s--variant-extraLarge":"Heading--wide-s--variant-extraLarge__TJs8l","Heading--wide-s--variant-large":"Heading--wide-s--variant-large__Wcc0E","Heading--wide-s--variant-medium":"Heading--wide-s--variant-medium__mONpk","Heading--wide-s--variant-small":"Heading--wide-s--variant-small__oRKSN","Heading--wide-l--variant-massive":"Heading--wide-l--variant-massive__twgw-","Heading--wide-l--variant-huge":"Heading--wide-l--variant-huge__DBuNF","Heading--wide-l--variant-extraLarge":"Heading--wide-l--variant-extraLarge__H9nEI","Heading--wide-l--variant-large":"Heading--wide-l--variant-large__kJarT","Heading--wide-l--variant-medium":"Heading--wide-l--variant-medium__VN27E","Heading--wide-l--variant-small":"Heading--wide-l--variant-small__Skmxk"},r=N.forwardRef(function({children:g,variant:a,accent:l,level:e,large:v=!1,tag:m,color:n,centered:u,dataset:t,id:s,...o},H){const _=m||e||"h1",h=k(I,i.Heading,a?q("variant",a):E(`level-${e}-large`,`level-${e}-normal`,v)),w=L(u),c=b(!(l?void 0:n),l),p=C(n),f=["preply-ds-heading",...h,...w,...c,...p],y={...T(o),className:f.join(" "),...U(t,{preplyDsComponent:i.Heading}),id:s,ref:H};return x.jsx(_,{...y,children:g})});try{r.displayName="Heading",r.__docgenInfo={description:"",displayName:"Heading",props:{strong:{defaultValue:null,description:"@deprecated The appropriate `font-weight` is automatically set",name:"strong",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},accent:{defaultValue:null,description:"",name:"accent",required:!1,type:{name:"enum",value:[{value:'"accent"'},{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"accentDark"'},{value:'"placeholder"'},{value:'"inverted"'},{value:'"positive"'},{value:'"info"'},{value:'"warning"'},{value:'"critical"'},{value:'"disabled"'},{value:'"branded"'},{value:'"selected"'},{value:'"error"'}]}},color:{defaultValue:null,description:"@deprecated Use `accent` instead.",name:"color",required:!1,type:{name:"enum",value:[{value:'"white"'},{value:'"gray-100"'},{value:'"gray-200"'},{value:'"gray-300"'},{value:'"gray-400"'},{value:'"gray-500"'},{value:'"gray-600"'},{value:'"teal-100"'},{value:'"teal-200"'},{value:'"teal-300"'},{value:'"teal-400"'},{value:'"teal-500"'},{value:'"green-100"'},{value:'"green-200"'},{value:'"green-300"'},{value:'"green-400"'},{value:'"green-500"'},{value:'"yellow-100"'},{value:'"yellow-200"'},{value:'"yellow-300"'},{value:'"yellow-400"'},{value:'"yellow-500"'},{value:'"red-100"'},{value:'"red-200"'},{value:'"red-300"'},{value:'"red-400"'},{value:'"red-500"'},{value:'"blue-100"'},{value:'"blue-200"'},{value:'"blue-300"'},{value:'"blue-400"'},{value:'"blue-500"'},{value:'"magenta-100"'},{value:'"magenta-200"'},{value:'"magenta-300"'},{value:'"magenta-400"'},{value:'"magenta-500"'}]}},centered:{defaultValue:null,description:"",name:"centered",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"}]}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"enum",value:[{value:"string"}]}},level:{defaultValue:null,description:"@deprecated Use `variant` instead\n@deprecated Use `variant` instead",name:"level",required:!1,type:{name:"enum",value:[{value:'"h1"'},{value:'"h2"'},{value:'"h3"'},{value:'"h4"'},{value:'"h5"'}]}},large:{defaultValue:{value:"false"},description:`@deprecated There is no large version in Tokyo UI.
|
|
2
|
-
@deprecated There is no large version in Tokyo UI.`,name:"large",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"p"'},{value:'"div"'},{value:'"span"'},{value:'"h1"'},{value:'"h2"'},{value:'"h3"'},{value:'"h4"'},{value:'"h5"'}]}},variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"large"'},{value:'"
|
|
2
|
+
@deprecated There is no large version in Tokyo UI.`,name:"large",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},tag:{defaultValue:null,description:"",name:"tag",required:!1,type:{name:"enum",value:[{value:'"p"'},{value:'"div"'},{value:'"span"'},{value:'"h1"'},{value:'"h2"'},{value:'"h3"'},{value:'"h4"'},{value:'"h5"'}]}},variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"large"'},{value:'"medium"'},{value:'"small"'},{value:'"massive"'},{value:'"huge"'},{value:'"extraLarge"'},{value:"ResponsiveProp<HeadingVariant>"}]}},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: HTMLHeadingElement | null) => void"},{value:"RefObject<HTMLHeadingElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}export{r as H};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-BYouaCF_.js";import{H as e}from"./Heading-
|
|
1
|
+
import{j as a}from"./jsx-runtime-BYouaCF_.js";import{H as e}from"./Heading-ese4_5Hg.js";import{S as s}from"./consts-KAYct7Gj.js";import"./index-B3evPFBL.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./text-centered-CznToR0o.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./componentNames-CpCJzpB9.js";import"./index-DdzHuZ-Y.js";const T={title:"components/Heading",component:e,argTypes:{centered:{description:s},variant:{description:s}}},r=()=>a.jsxs("div",{style:{padding:"16px",display:"grid",gridTemplateColumns:"auto 3fr",alignItems:"center",gap:"16px"},children:[a.jsx("span",{children:"h1 / massive"}),a.jsx(e,{tag:"h1",variant:"massive",children:"Lorem ipsum"}),a.jsx("span",{children:"h2 / huge"}),a.jsx(e,{tag:"h2",variant:"huge",children:"Lorem ipsum"}),a.jsx("span",{children:"h3 / extraLarge"}),a.jsx(e,{tag:"h3",variant:"extraLarge",children:"Lorem ipsum"}),a.jsx("span",{children:"h4 / large"}),a.jsx(e,{tag:"h4",variant:"large",children:"Lorem ipsum"}),a.jsx("span",{children:"h5 / medium"}),a.jsx(e,{tag:"h5",variant:"medium",children:"Lorem ipsum"}),a.jsx("span",{children:"p / small"}),a.jsx(e,{tag:"p",variant:"small",children:"Lorem ipsum"})]}),n={parameters:{chromatic:{disableSnapshot:!0}},decorators:[(m,{args:g})=>a.jsx("div",{style:{backgroundColor:g.accent==="inverted"?"black":void 0},children:m()})],args:{tag:"h1",variant:"massive",children:"Lorem ipsum",dataset:{qaid:"heading"}},argTypes:{centered:{control:"boolean"},dataset:{control:"object"},strong:{table:{disable:!0}},level:{table:{disable:!0}},color:{table:{disable:!0}},large:{table:{disable:!0}}}};var t,i,o;r.parameters={...r.parameters,docs:{...(t=r.parameters)==null?void 0:t.docs,source:{originalSource:`() => <div style={{
|
|
2
2
|
padding: '16px',
|
|
3
3
|
display: 'grid',
|
|
4
4
|
gridTemplateColumns: 'auto 3fr',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-BYouaCF_.js";import{useMDXComponents as n}from"./index-uOP2uDdf.js";import{M as m,S as s}from"./index-
|
|
1
|
+
import{j as o}from"./jsx-runtime-BYouaCF_.js";import{useMDXComponents as n}from"./index-uOP2uDdf.js";import{M as m,S as s}from"./index-CjMmneJr.js";import{ServerComponent as i}from"./Icon.stories-Cv6aq9BI.js";import"./index-B3evPFBL.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./iframe-BE13K_u-.js";import"./index-jEDObK_5.js";import"./index-C66nt8TK.js";import"./index-Cu4lwwaE.js";import"./index-CXQShRbs.js";import"./index-DrFu-skq.js";import"./TokyoUINotesWithPad-Bqcca_-M.js";import"./Icon-ZIxauYsE.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./render-icon-CVTdrNe-.js";import"./componentNames-CpCJzpB9.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";import"./options-Dn0Ts6qK.js";function r(t){const e={code:"code",h1:"h1",p:"p",pre:"pre",...n(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(m,{title:"components/Icon/Server Component"}),`
|
|
2
2
|
`,o.jsx(e.h1,{id:"use-icon-as-react-server-component",children:"Use Icon as react server component"}),`
|
|
3
3
|
`,o.jsxs(e.p,{children:["To use Icon as react server component, provide ",o.jsx(e.code,{children:"svg"})," as element:"]}),`
|
|
4
4
|
`,o.jsx(s,{of:i}),`
|
|
@@ -5,4 +5,4 @@ import{j as b}from"./jsx-runtime-BYouaCF_.js";import{r as w}from"./index-B3evPFB
|
|
|
5
5
|
@example <caption>Using as react server component</caption>
|
|
6
6
|
import TokyoUINotesWithPad from '@preply/ds-media-icons/dist/24/TokyoUINotesWithPad.svg';
|
|
7
7
|
|
|
8
|
-
<Icon svg={<TokyoUINotesWithPad />} />`,name:"svg",required:!0,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},size:{defaultValue:{value:"s"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"2xs"'},{value:'"
|
|
8
|
+
<Icon svg={<TokyoUINotesWithPad />} />`,name:"svg",required:!0,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},size:{defaultValue:{value:"s"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"2xs"'},{value:'"16"'},{value:'"24"'},{value:'"32"'},{value:'"48"'}]}},accent:{defaultValue:null,description:"",name:"accent",required:!1,type:{name:"enum",value:[{value:'"accent"'},{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"accentDark"'},{value:'"placeholder"'},{value:'"inverted"'},{value:'"positive"'},{value:'"info"'},{value:'"warning"'},{value:'"critical"'},{value:'"disabled"'},{value:'"branded"'},{value:'"selected"'},{value:'"error"'}]}},expColor:{defaultValue:null,description:"If passed along with `accent`, `accent` takes precedence.",name:"expColor",required:!1,type:{name:"enum",value:[{value:'"teal-100"'},{value:'"teal-200"'},{value:'"teal-300"'},{value:'"teal-400"'},{value:'"teal-500"'},{value:'"yellow-100"'},{value:'"yellow-200"'},{value:'"yellow-300"'},{value:'"yellow-400"'},{value:'"yellow-500"'},{value:'"red-100"'},{value:'"red-200"'},{value:'"red-300"'},{value:'"red-400"'},{value:'"red-500"'},{value:'"blue-100"'},{value:'"blue-200"'},{value:'"blue-300"'},{value:'"blue-400"'},{value:'"blue-500"'},{value:'"grey-0"'},{value:'"grey-50"'},{value:'"grey-100"'},{value:'"grey-200"'},{value:'"grey-300"'},{value:'"grey-400"'},{value:'"grey-500"'},{value:'"grey-600"'},{value:'"grey-700"'},{value:'"grey-800"'},{value:'"grey-900"'},{value:'"pink-50"'},{value:'"pink-100"'},{value:'"pink-200"'},{value:'"pink-300"'},{value:'"pink-400"'},{value:'"pink-500"'},{value:'"pink-600"'},{value:'"pink-700"'},{value:'"pink-800"'},{value:'"yellow-50"'},{value:'"yellow-600"'},{value:'"yellow-700"'},{value:'"yellow-800"'},{value:'"blue-50"'},{value:'"blue-600"'},{value:'"blue-700"'},{value:'"blue-800"'},{value:'"teal-50"'},{value:'"teal-600"'},{value:'"teal-700"'},{value:'"teal-800"'},{value:'"red-50"'},{value:'"red-600"'},{value:'"red-700"'},{value:'"red-800"'}]}},color:{defaultValue:null,description:"@deprecated Use accent instead.",name:"color",required:!1,type:{name:"enum",value:[{value:'"white"'},{value:'"gray-100"'},{value:'"gray-200"'},{value:'"gray-300"'},{value:'"gray-400"'},{value:'"gray-500"'},{value:'"gray-600"'},{value:'"teal-100"'},{value:'"teal-200"'},{value:'"teal-300"'},{value:'"teal-400"'},{value:'"teal-500"'},{value:'"green-100"'},{value:'"green-200"'},{value:'"green-300"'},{value:'"green-400"'},{value:'"green-500"'},{value:'"yellow-100"'},{value:'"yellow-200"'},{value:'"yellow-300"'},{value:'"yellow-400"'},{value:'"yellow-500"'},{value:'"red-100"'},{value:'"red-200"'},{value:'"red-300"'},{value:'"red-400"'},{value:'"red-500"'},{value:'"blue-100"'},{value:'"blue-200"'},{value:'"blue-300"'},{value:'"blue-400"'},{value:'"blue-500"'},{value:'"magenta-100"'},{value:'"magenta-200"'},{value:'"magenta-300"'},{value:'"magenta-400"'},{value:'"magenta-500"'}]}},label:{defaultValue:null,description:"If using the icon without any adjacent descriptive text, use this prop to\nprovide an `aria-label` for assistive technologies.",name:"label",required:!1,type:{name:"enum",value:[{value:"string"}]}},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{}export{x as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BYouaCF_.js";import{F as o}from"./TokyoUINotesWithPad-Bqcca_-M.js";import{I as s}from"./Icon-
|
|
1
|
+
import{j as e}from"./jsx-runtime-BYouaCF_.js";import{F as o}from"./TokyoUINotesWithPad-Bqcca_-M.js";import{I as s}from"./Icon-ZIxauYsE.js";import{E as h}from"./options-Dn0Ts6qK.js";import"./index-B3evPFBL.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./text-accent-DZDDtpIt.js";import"./classNames-BUL1Zq7e.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./render-icon-CVTdrNe-.js";import"./componentNames-CpCJzpB9.js";import"./index-DdzHuZ-Y.js";import"./defaults-B1rzzf6M.js";const W={title:"components/Icon",component:s,parameters:{docs:{description:{component:"To browse all available icons, visit the [Icon Explorer](/story/guides-assets-icon-explorer--page)."}}}},t=()=>e.jsxs("div",{style:{display:"flex",alignItems:"end",gap:"4px"},children:[e.jsx(s,{svg:o,size:"16"}),e.jsx(s,{svg:o,size:"24"}),e.jsx(s,{svg:o,size:"32"}),e.jsx(s,{svg:o,size:"48"})]}),n=()=>e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:h.map(a=>e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(s,{svg:o,expColor:a.id},a.id),e.jsx("span",{children:a.id})]},a.id))}),r=()=>e.jsx(s,{svg:e.jsx(o,{})});r.tags=["!dev","!autodocs"];const i={parameters:{chromatic:{disableSnapshot:!0}},args:{svg:o,dataset:{qaid:"icon"}},argTypes:{svg:{control:!1},dataset:{control:"object"},label:{control:"text"},color:{table:{disable:!0}}}};var p,c,d;t.parameters={...t.parameters,docs:{...(p=t.parameters)==null?void 0:p.docs,source:{originalSource:`() => <div style={{
|
|
2
2
|
display: 'flex',
|
|
3
3
|
alignItems: 'end',
|
|
4
4
|
gap: '4px'
|