@preply/ds-docs 5.2.0 → 5.2.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.
Files changed (134) hide show
  1. package/dist/assets/{00.LayoutFlex.stories-CU_PBheh.js → 00.LayoutFlex.stories-DziNsvND.js} +1 -1
  2. package/dist/assets/{00.applications-k4E6Kp9W.js → 00.applications-CfdAX6zp.js} +1 -1
  3. package/dist/assets/{00.favicons.guide-li3I_F6g.js → 00.favicons.guide-TFQ_QGH8.js} +1 -1
  4. package/dist/assets/{00.token-explorer-DPyy8Qse.js → 00.token-explorer-Dih-Pw-i.js} +1 -1
  5. package/dist/assets/{00.using-responsive-props-DvJjPn4l.js → 00.using-responsive-props-CiPSgnLs.js} +1 -1
  6. package/dist/assets/{01.semantic-tokens-BJFCWksP.js → 01.semantic-tokens-BilArNNI.js} +1 -1
  7. package/dist/assets/{01.using-shorthand-props-7TTqmP-1.js → 01.using-shorthand-props-Sbq3I8ie.js} +1 -1
  8. package/dist/assets/{10.Combinations.stories-DSSBuYKH.js → 10.Combinations.stories-BA2P_--4.js} +1 -1
  9. package/dist/assets/{10.fonts.guide-DkLccLAL.js → 10.fonts.guide-6c2twxLe.js} +1 -1
  10. package/dist/assets/{10.ssr-CefkGBfp.js → 10.ssr-DsFrbjyY.js} +1 -1
  11. package/dist/assets/{11.ssr.app-router-Dl5IwciZ.js → 11.ssr.app-router-Bq0XjlUK.js} +1 -1
  12. package/dist/assets/{20.libraries-Df17azd4.js → 20.libraries-DuLqrS-7.js} +1 -1
  13. package/dist/assets/{30.icons.explorer-BcmjbQML.js → 30.icons.explorer-DZ7hOOqz.js} +1 -1
  14. package/dist/assets/{30.storybook-Bj0tQN0r.js → 30.storybook-C6QKDTCh.js} +1 -1
  15. package/dist/assets/{40.illustrations.explorer-DuUnaQJ6.js → 40.illustrations.explorer-CEF2Fc0h.js} +1 -1
  16. package/dist/assets/{90.advanced-DMVmfSdF.js → 90.advanced-DXMNWOcI.js} +1 -1
  17. package/dist/assets/{Accordion-D1vIqcq0.js → Accordion-VvNDKvME.js} +3 -3
  18. package/dist/assets/{Accordion.stories-DRHVlfh4.js → Accordion.stories-D8YFD-5m.js} +1 -1
  19. package/dist/assets/{Accordion.tests.stories-D0LPcnLm.js → Accordion.tests.stories-BMXcHw7d.js} +1 -1
  20. package/dist/assets/{AlertDialog.stories-t7rvOrIt.js → AlertDialog.stories-soyDmIgZ.js} +1 -1
  21. package/dist/assets/{Avatar-pYo4pD9f.js → Avatar-CDcgvepQ.js} +1 -1
  22. package/dist/assets/{Avatar.stories-DW2TYQqg.js → Avatar.stories-Bk7IcP2V.js} +1 -1
  23. package/dist/assets/{AvatarWithStatus.stories-DJHFLq1b.js → AvatarWithStatus.stories-ChuxFeXX.js} +4 -4
  24. package/dist/assets/{Badge.stories-BDgXsOQ3.js → Badge.stories-BlE7-5jC.js} +2 -2
  25. package/dist/assets/{Box.stories-CvBcavQ9.js → Box.stories-D3HsHvGa.js} +1 -1
  26. package/dist/assets/{BubbleCounter.stories-DRndNMcM.js → BubbleCounter.stories-CSP0211x.js} +1 -1
  27. package/dist/assets/{Button-r7N6Ff_n.js → Button-CV3MrNle.js} +2 -2
  28. package/dist/assets/{Button.stories-Cbyv5GRx.js → Button.stories-EH59ZSFw.js} +1 -1
  29. package/dist/assets/{ButtonBase-zwYgfoSw.js → ButtonBase-BpIWpxNP.js} +1 -1
  30. package/dist/assets/{Checkbox.stories-eRtAlYcC.js → Checkbox.stories-CmK5oHX3.js} +1 -1
  31. package/dist/assets/{Chips.stories-BR1h8Ayk.js → Chips.stories-CM5mElYE.js} +1 -1
  32. package/dist/assets/{Color-YHDXOIA2-9NBVO4CO.js → Color-YHDXOIA2-BjHwp_w2.js} +1 -1
  33. package/dist/assets/{ComposingPopovers.stories-CKLHzgB4.js → ComposingPopovers.stories-OVc6plo8.js} +1 -1
  34. package/dist/assets/{CountryFlag-ykx10eak.js → CountryFlag-DeifQHMo.js} +5 -5
  35. package/dist/assets/{CountryFlag.stories-Dsk1y884.js → CountryFlag.stories-8PMPd0Et.js} +1 -1
  36. package/dist/assets/{CountryFlag.test.stories-kaPfZDPu.js → CountryFlag.test.stories-CnmUo893.js} +1 -1
  37. package/dist/assets/{Dialog.stories-BgVBHEFn.js → Dialog.stories-e9MB7jV5.js} +1 -1
  38. package/dist/assets/DismissibleChips-gzmntal_.js +1 -0
  39. package/dist/assets/{DismissibleChips.stories-BDH4JLAT.js → DismissibleChips.stories-Cv9T1z5x.js} +1 -1
  40. package/dist/assets/{Divider-BPgGsji3.js → Divider-nt4GwjWS.js} +1 -1
  41. package/dist/assets/{Divider.stories-D0XhMPpe.js → Divider.stories-DD0t6A5Y.js} +1 -1
  42. package/dist/assets/{DocsRenderer-CFRXHY34-CrRewIwS.js → DocsRenderer-CFRXHY34-CJvyJnri.js} +1 -1
  43. package/dist/assets/{DropdownMenu-BVJcXVVs.js → DropdownMenu-CB-FxkIk.js} +95 -95
  44. package/dist/assets/{DropdownMenu.stories-DDZTqgtd.js → DropdownMenu.stories-DQ9Anz0c.js} +1 -1
  45. package/dist/assets/{FormControl.stories-By_j4CEK.js → FormControl.stories-BuYWW2sc.js} +1 -1
  46. package/dist/assets/{Heading-D-ou4j7h.js → Heading-CTiQg0ko.js} +2 -2
  47. package/dist/assets/{Heading.stories-DBQ5k_Gi.js → Heading.stories-CdaUOFTO.js} +1 -1
  48. package/dist/assets/{Icon-C9LCNP6i.js → Icon-5QESEDp5.js} +1 -1
  49. package/dist/assets/{Icon-RSC-CV1ghZyJ.js → Icon-RSC-CY2tw9Wa.js} +1 -1
  50. package/dist/assets/{Icon.stories-BY7I3NYo.js → Icon.stories-BDsCeC5v.js} +1 -1
  51. package/dist/assets/IconButton-DSKTwXgX.js +8 -0
  52. package/dist/assets/{Input-CkgW02B0.js → Input-CBd7qXZ8.js} +3 -3
  53. package/dist/assets/{IntegrationWithReactHookForm.stories-CBT754Nh.js → IntegrationWithReactHookForm.stories-CAgsKvvy.js} +1 -1
  54. package/dist/assets/{IntlFormattedCurrency.stories-DFu7hp1T.js → IntlFormattedCurrency.stories-a__ae3r7.js} +1 -1
  55. package/dist/assets/{IntlFormattedDateTime.stories-BNffxVaH.js → IntlFormattedDateTime.stories-BhfMf2LB.js} +1 -1
  56. package/dist/assets/{LayoutFlex-CnhOGGxA.js → LayoutFlex--W1D5e-w.js} +1 -1
  57. package/dist/assets/{LayoutFlexItem-BLtc7R2u.js → LayoutFlexItem-ZIv-8Mnt.js} +1 -1
  58. package/dist/assets/{LayoutGrid-CMfLnkDN.js → LayoutGrid-C__NlCjJ.js} +1 -1
  59. package/dist/assets/{LayoutGrid.stories-BeDPVs_l.js → LayoutGrid.stories-D9GOaVZa.js} +1 -1
  60. package/dist/assets/{LayoutGridItem-BTIocUYE.js → LayoutGridItem-BntIYIDx.js} +1 -1
  61. package/dist/assets/{Link-8C9V_O3w.js → Link-CLsuYZJn.js} +1 -1
  62. package/dist/assets/{Link.stories-Bvgdk63v.js → Link.stories-Bm06h16e.js} +1 -1
  63. package/dist/assets/MultiSelectChips-Dmul2me6.js +2 -0
  64. package/dist/assets/{MultiSelectChips.stories-CJG_1hO1.js → MultiSelectChips.stories-BIwP1d4r.js} +1 -1
  65. package/dist/assets/{NumberField-DfV-lQqS.js → NumberField-D5dekhTb.js} +3 -3
  66. package/dist/assets/{NumberField.stories-DcvvImGB.js → NumberField.stories-Bc9Kjkqe.js} +1 -1
  67. package/dist/assets/{ObserveIntersection-BUhLMAXT.js → ObserveIntersection-Br5mb_ve.js} +1 -1
  68. package/dist/assets/{ObserveIntersection.stories-D8LWmltK.js → ObserveIntersection.stories-DTWHq7aC.js} +1 -1
  69. package/dist/assets/{OnboardingTooltip-B_kaIqZr.js → OnboardingTooltip-DcTHydZd.js} +1 -1
  70. package/dist/assets/{OnboardingTooltip.stories-Bbi-solo.js → OnboardingTooltip.stories-DtaV_dGv.js} +1 -1
  71. package/dist/assets/{OnboardingTooltip.tests.stories-CYJGgVQH.js → OnboardingTooltip.tests.stories-DqEJ2MTQ.js} +1 -1
  72. package/dist/assets/{OnboardingTour-Es9ODo5R.js → OnboardingTour-CrSpwDGC.js} +1 -1
  73. package/dist/assets/{OnboardingTour.stories-DguX1Np1.js → OnboardingTour.stories-D4yQxcXy.js} +2 -2
  74. package/dist/assets/{OnboardingTour.tests.stories-DBl43DS_.js → OnboardingTour.tests.stories-DDBfv2IC.js} +1 -1
  75. package/dist/assets/{PasswordField-BDzBq_8p.js → PasswordField-Lp2RJZ3t.js} +3 -3
  76. package/dist/assets/{PasswordField.stories-Bq-oxqio.js → PasswordField.stories-D3KsJza4.js} +1 -1
  77. package/dist/assets/{ProgressBar.stories-69KylHTx.js → ProgressBar.stories-CqUc5VLs.js} +1 -1
  78. package/dist/assets/{ProgressSteps.stories-DsPOksS0.js → ProgressSteps.stories-BLE6dvhX.js} +1 -1
  79. package/dist/assets/{PromoDialog-CKvE5moH.js → PromoDialog-RBlASd4W.js} +1 -1
  80. package/dist/assets/{Rating.stories-CC-5R6ut.js → Rating.stories-byG85-k9.js} +1 -1
  81. package/dist/assets/{RatingInput.stories-f1yAaZGs.js → RatingInput.stories-C9V8kWiR.js} +4 -4
  82. package/dist/assets/{SelectField-x9rQw_qg.js → SelectField-B4nF6kxi.js} +7 -7
  83. package/dist/assets/{SelectField.stories-9fJay7bY.js → SelectField.stories-Bgx9QjPD.js} +1 -1
  84. package/dist/assets/{ShowOnIntersection.stories-CxzKz2ZJ.js → ShowOnIntersection.stories-B4Kohl7q.js} +1 -1
  85. package/dist/assets/SingleSelectChips-lFqKstcf.js +2 -0
  86. package/dist/assets/{SingleSelectChips.stories-DfIbVrTi.js → SingleSelectChips.stories-CT8m0Khv.js} +1 -1
  87. package/dist/assets/{Steps-B7JLI9QK.js → Steps-hoco_XFq.js} +1 -1
  88. package/dist/assets/{Steps.stories-BcrOvHDe.js → Steps.stories-BLjFxkm8.js} +1 -1
  89. package/dist/assets/{Switch.stories-Cacj1dlb.js → Switch.stories-BrXh5o7h.js} +1 -1
  90. package/dist/assets/{Text-Buodaus4.js → Text-DiDZp_C4.js} +1 -1
  91. package/dist/assets/{Text.stories-C4F4F5Y-.js → Text.stories-CHanMmn2.js} +1 -1
  92. package/dist/assets/{TextField-C027_iFa.js → TextField-I1Ozm_fM.js} +4 -4
  93. package/dist/assets/{TextField.stories-CFdxit85.js → TextField.stories-DzmVCGmV.js} +1 -1
  94. package/dist/assets/{TextHighlighted.stories-DXCnsEZ4.js → TextHighlighted.stories-SE_qwldO.js} +1 -1
  95. package/dist/assets/{TextInline.stories-CPQmYfGF.js → TextInline.stories-XOqnn55z.js} +1 -1
  96. package/dist/assets/{TextareaField-BRiidKHZ.js → TextareaField-DZaZgXE3.js} +7 -7
  97. package/dist/assets/{TextareaField.stories-B-fLDxxr.js → TextareaField.stories-Bop1BBMR.js} +1 -1
  98. package/dist/assets/{Toast.stories-Dbx35nSt.js → Toast.stories-DjwfNkJX.js} +1 -1
  99. package/dist/assets/{Tooltip.stories-BSZlgXSs.js → Tooltip.stories-X2KKbRdJ.js} +1 -1
  100. package/dist/assets/{Tooltip.tests.stories-DnDi6-EL.js → Tooltip.tests.stories-BSKY5lTA.js} +1 -1
  101. package/dist/assets/{breakpoints-Bah-hNxA.js → breakpoints-CRoLRYm8.js} +1 -1
  102. package/dist/assets/{breakpoints-Do1NjSIT.js → breakpoints-CSXuAMje.js} +1 -1
  103. package/dist/assets/{breakpoints-Dfsi11Gg.js → breakpoints-s1hUa0ib.js} +1 -1
  104. package/dist/assets/{changelog-Bvah7OoK.js → changelog-CCRp7HoV.js} +103 -98
  105. package/dist/assets/{createRequiredContext-WvHlx5O0.js → createRequiredContext-lKWDx2_a.js} +16 -16
  106. package/dist/assets/{entry-preview-RKdecZOE.js → entry-preview-B0kLH5we.js} +1 -1
  107. package/dist/assets/{getTokenVar-1iagfhaI.js → getTokenVar-BoTPwDbX.js} +1 -1
  108. package/dist/assets/{hover-Cxyn84A5.js → hover-Ci0ZRqat.js} +1 -1
  109. package/dist/assets/{hover-CO_99kGU.js → hover-DJXL0vF9.js} +1 -1
  110. package/dist/assets/{hover-BVO949eG.js → hover-DdQpVUkU.js} +1 -1
  111. package/dist/assets/{iframe-DQObBSoc.js → iframe-DD8HN-R1.js} +2 -2
  112. package/dist/assets/{index-DxHKJR-z.js → index-BHMtmy2B.js} +1 -1
  113. package/dist/assets/{index-CTTzR4gE.js → index-CBngXnat.js} +6 -6
  114. package/dist/assets/{index-xzr6a2UN.js → index-GU-yTW76.js} +3 -3
  115. package/dist/assets/{intro-BzWH3M5J.js → intro-_Rp3da5v.js} +1 -1
  116. package/dist/assets/{migrating-from-less-XegNzzRn.js → migrating-from-less-7B_k9xkW.js} +1 -1
  117. package/dist/assets/{playground.stories-C74S27QD.js → playground.stories-_pKinBuZ.js} +3 -3
  118. package/dist/assets/{preview-Ce0VhXT1.js → preview-BHe8pYRs.js} +1 -1
  119. package/dist/assets/{preview-Qml5zPPk.js → preview-BgJF9ES2.js} +1 -1
  120. package/dist/assets/{preview-BiTm_q9n.js → preview-oumS3SOc.js} +2 -2
  121. package/dist/assets/{tokens-8Z2xvrm4.js → tokens-BAlLdf8n.js} +1 -1
  122. package/dist/assets/{tokens-CUGnBuZf.js → tokens-CU9aPd3t.js} +1 -1
  123. package/dist/assets/{tokens-CNLWJPB5.js → tokens-DFy6-Ct0.js} +1 -1
  124. package/dist/assets/{usePortalElement-uiGuyCei.js → usePortalElement-BYgT_G5d.js} +1 -1
  125. package/dist/assets/{welcome-QbRFW5S1.js → welcome-DZoOoKok.js} +1 -1
  126. package/dist/assets/{zeroheight-DsJLIFDJ.js → zeroheight-T8hJ2BSR.js} +1 -1
  127. package/dist/iframe.html +1 -1
  128. package/dist/preview-stats.json +11623 -11623
  129. package/dist/project.json +1 -1
  130. package/package.json +3 -3
  131. package/dist/assets/DismissibleChips-CHGpXEIb.js +0 -1
  132. package/dist/assets/IconButton-DN6fzHUD.js +0 -8
  133. package/dist/assets/MultiSelectChips-mwYseEmZ.js +0 -2
  134. package/dist/assets/SingleSelectChips-Cnz0IZSs.js +0 -2
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as n}from"./index-Cb9e4tly.js";import{e as z}from"./index-Dk_MCKuE.js";import{c as h,C as p,g as u}from"./CountryFlag-ykx10eak.js";import{L as te}from"./LayoutFlex-CnhOGGxA.js";import{L as V}from"./LayoutGrid-CMfLnkDN.js";import{L as i}from"./LayoutGridItem-BTIocUYE.js";import{T as t}from"./Text-Buodaus4.js";import{L as ie}from"./Link-8C9V_O3w.js";import{F as m}from"./FormControl-BEOVVHxt.js";import{C as g}from"./Checkbox-DQjB3F7F.js";import{T as le}from"./TextField-C027_iFa.js";import{A as ne,a as de,b as ce,c as ue}from"./Accordion-D1vIqcq0.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-qlqSh81O.js";import"./componentNames-k0j3gHgH.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./layout-relative.module-uOnIKnjS.js";import"./classNames-9hsFPPZv.js";import"./defaults-czRWsFkX.js";import"./breakpoints-BfMlrtxE.js";import"./layout-relative-C9i8Tz-b.js";import"./constants-DYYVurUY.js";import"./align-self-Cj4aclWl.js";import"./text-accent-DvyJpEME.js";import"./text-centered-BFb64PJw.js";import"./useHostname-PsilflFC.js";import"./index-Cc-bXjHe.js";import"./index-DWSmmBvQ.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./message-CSdaKtIj.js";import"./render-icon-BT0Aq7PA.js";import"./useMergeRefs-SFH7Mw4x.js";import"./Input-CkgW02B0.js";import"./InputContainer-B1hqJyx0.js";import"./TokyoUIExpand-oMdXmNcg.js";import"./Icon-C9LCNP6i.js";const Ke={title:"components/CountryFlag",component:p,args:{code:"ua",alt:h.ua}},j={render:function(){return e.jsxs("div",{style:{maxWidth:"1000px"},children:[e.jsx(t,{variant:"default-semibold",children:"For some countries, simplified flags are automatically used (unless `simplified` is set to `false`)"}),e.jsxs(V,{columns:4,children:[e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Code"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Country name"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"4x3"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"4x3 (with `simplified=false`)"})}),["es","mx"].map(r=>e.jsxs(n.Fragment,{children:[e.jsx(i,{children:r}),e.jsx(i,{children:h[r]}),e.jsx(i,{children:e.jsx(p,{code:r,alt:h[r],size:"large"})}),e.jsx(i,{children:e.jsx(p,{code:r,alt:h[r],size:"large",simplified:!1})})]},r))]}),e.jsx("br",{}),e.jsx(t,{variant:"default-semibold",children:"All countries"}),e.jsxs(V,{columns:3,children:[e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Code"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Country name"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"4x3"})}),Object.keys(h).map(r=>e.jsxs(n.Fragment,{children:[e.jsx(i,{children:r}),e.jsx(i,{children:h[r]}),e.jsx(i,{children:e.jsx(p,{code:r,alt:h[r],size:"large"})})]},r))]})]})}};function l({src:d,alt:r,square:a=!1}){return e.jsxs("div",{children:[e.jsx("img",{src:d,alt:r,style:{width:a?"96px":"128px",height:"96px"}}),e.jsx("img",{src:d,alt:r,style:{width:a?"24px":"32px",height:"24px"}})]})}const G={tags:["!test","!a11y-test"],parameters:{chromatic:{disableSnapshot:!0}},render:function(){const r="https://static.staging.preply.org/groot/country_flags/",a="https://static.preply.com/ds/country-flags/",[y,P]=n.useState(!1),[f,D]=n.useState(!1),[S,q]=n.useState(!0),[C,L]=n.useState(!0),[v,N]=n.useState(!1),[b,A]=n.useState(!0),[w,I]=n.useState(!0),[re,J]=n.useState(!0),[x,oe]=n.useState(a),$=Number(y)+Number(f)+Number(S)+Number(C)+Number(v)+Number(b)+Number(w)+2,se=y&&f&&S&&C&&v&&b&&w;return e.jsxs("div",{style:{maxWidth:"100%"},children:[e.jsx(ne,{children:e.jsxs(de,{children:[e.jsx(ce,{children:"How to read the following table?"}),e.jsxs(ue,{children:[e.jsxs(t,{children:["- All the flags have bee imported from"," ",e.jsx(ie,{href:"https://github.com/lipis/flag-icons",children:"flag-icons"})]}),e.jsx(t,{children:"- Some flags have been manually replaced because they were wrong"}),e.jsx(t,{children:"- The design system contains more flags compared to Groot (the original apollo's application that contained all the static assets)"}),e.jsx(t,{children:"- Some flags have simplified versions (ex. Spain, Mexico) to reduce their size"}),e.jsx(t,{children:"- All the flags are a available in JPG, mainly to reduce the computation on the native application"}),e.jsx(t,{children:"- You are supposed to gather the assets URL through the `getCountryFlagUrl` utility"}),e.jsx(t,{children:"- For local testing, use `npx serve` launched in the `static-assets/country-flags` directory, and replace the path in the below field."}),e.jsx(t,{children:"- For PR testing, look at `deploy-static-assets.sh` to find the PR URL for static assets."})]})]})}),e.jsxs(te,{gap:"16",padding:["32","0","0","0"],children:[e.jsx(m,{label:"Groot 4x3 SVG",required:!0,children:e.jsx(g,{checked:y,onCheckedChange:P})}),e.jsx(m,{label:"Groot 4x3 PNG",required:!0,children:e.jsx(g,{checked:f,onCheckedChange:D})}),e.jsx(m,{label:"DS 4x3 SVG",required:!0,children:e.jsx(g,{checked:S,onCheckedChange:q})}),e.jsx(m,{label:"DS 4x3 JPG",required:!0,children:e.jsx(g,{checked:C,onCheckedChange:L})}),e.jsx(m,{label:"Groot 1x1 SVG",required:!0,children:e.jsx(g,{checked:v,onCheckedChange:N})}),e.jsx(m,{label:"DS 1x1 SVG",required:!0,children:e.jsx(g,{checked:b,onCheckedChange:A})}),e.jsx(m,{label:"DS 1x1 JPG",required:!0,children:e.jsx(g,{checked:w,onCheckedChange:I})}),e.jsx(m,{label:"Product size",required:!0,children:e.jsx(g,{checked:re,onCheckedChange:J})}),e.jsx(m,{label:"All",required:!0,children:e.jsx(g,{checked:se,onCheckedChange:o=>{P(o),D(o),q(o),L(o),N(o),A(o),I(o),J(o)}})}),e.jsx(le,{value:x,onValueChange:oe,label:"Assets path",required:!0})]}),e.jsx("div",{style:{position:"sticky",top:"0px",background:"white"},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:`repeat(${$}, 1fr)`,gap:"4px",padding:"16px 0 0 0"},children:[e.jsx("div",{style:{alignSelf:"start"},children:e.jsx(t,{variant:"default-semibold",children:"Code"})}),e.jsx(t,{variant:"default-semibold",children:"Country name"}),y&&e.jsx(t,{variant:"default-semibold",children:"Show Groot 4x3 SVG"}),f&&e.jsx(t,{variant:"default-semibold",children:"Show Groot 4x3 PNG"}),S&&e.jsx(t,{variant:"default-semibold",children:"Show DS 4x3 SVG"}),C&&e.jsx(t,{variant:"default-semibold",children:"Show DS 4x3 JPG"}),v&&e.jsx(t,{variant:"default-semibold",children:"Show Groot 1x1 SVG"}),b&&e.jsx(t,{variant:"default-semibold",children:"Show DS 1x1 SVG"}),w&&e.jsx(t,{variant:"default-semibold",children:"Show DS 1x1 JPG"})]})}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${$}, 1fr)`,gap:"4px",padding:"16px 0 0 0"},children:Object.keys(h).map(o=>{const c=o,s=h[o],ae=u({requester:"",countryCode:c,simplified:!0})!==u({requester:"",countryCode:c,simplified:!1});return e.jsxs(n.Fragment,{children:[e.jsx(t,{children:o}),e.jsx(t,{children:s}),y&&e.jsx(l,{src:`${r}4x3/${o}.svg`,alt:s}),f&&e.jsx(l,{src:`${r}pngs/${o}.png`,alt:s}),S&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1}).replace(a,x),alt:s}),C&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1,graphic:"raster"}).replace(a,x),alt:s}),v&&e.jsx(l,{src:`${r}1x1/${o}.svg`,square:!0,alt:s}),b&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1,square:!0}).replace(a,x),square:!0,alt:s}),w&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1,square:!0,graphic:"raster"}).replace(a,x),square:!0,alt:s}),ae&&e.jsxs(n.Fragment,{children:[e.jsxs(t,{children:[o," (simplified version)"]}),e.jsx(t,{children:h[o]}),y&&e.jsx(l,{src:`${r}4x3/${o}.svg`,alt:s}),f&&e.jsx(l,{src:`${r}pngs/${o}.png`,alt:s}),S&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0}).replace(a,x),alt:s}),C&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0,graphic:"raster"}).replace(a,x),alt:s}),v&&e.jsx(l,{src:`${r}1x1/${o}.svg`,square:!0,alt:s}),b&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0,square:!0}).replace(a,x),square:!0,alt:s}),w&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0,square:!0,graphic:"raster"}).replace(a,x),square:!0,alt:s})]},o+"simplified")]},o)})})]})}},F={render:d=>e.jsxs(te,{gap:"16",children:[e.jsx(p,{...d,size:"small"}),e.jsx(p,{...d,size:"medium"}),e.jsx(p,{...d,size:"large"})]})},T={render:function(){return e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"default-regular-italic",children:"Invalid country code"}),e.jsx(p,{code:"invalidCountryCode",alt:"Invalid country code"}),e.jsx(t,{variant:"default-regular-italic",children:"`undefined` country code"}),e.jsx(p,{code:void 0,alt:"Undefined country code"})]})},play:async({canvas:d})=>{const r=d.getByAltText("Invalid country code");z(r).toBeVisible();const a=d.getByAltText("Undefined country code");z(a).toBeVisible()}},k={parameters:{chromatic:{disableSnapshot:!0}},args:{dataset:{qaid:"flag"}},argTypes:{dataset:{control:"object"}}};var U,R,B;j.parameters={...j.parameters,docs:{...(U=j.parameters)==null?void 0:U.docs,source:{originalSource:`{
1
+ import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as n}from"./index-Cb9e4tly.js";import{e as z}from"./index-Dk_MCKuE.js";import{c as h,C as p,g as u}from"./CountryFlag-DeifQHMo.js";import{L as te}from"./LayoutFlex--W1D5e-w.js";import{L as V}from"./LayoutGrid-C__NlCjJ.js";import{L as i}from"./LayoutGridItem-BntIYIDx.js";import{T as t}from"./Text-DiDZp_C4.js";import{L as ie}from"./Link-CLsuYZJn.js";import{F as m}from"./FormControl-BEOVVHxt.js";import{C as g}from"./Checkbox-DQjB3F7F.js";import{T as le}from"./TextField-I1Ozm_fM.js";import{A as ne,a as de,b as ce,c as ue}from"./Accordion-VvNDKvME.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-qlqSh81O.js";import"./componentNames-k0j3gHgH.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./layout-relative.module-uOnIKnjS.js";import"./classNames-9hsFPPZv.js";import"./defaults-czRWsFkX.js";import"./breakpoints-BfMlrtxE.js";import"./layout-relative-C9i8Tz-b.js";import"./constants-DYYVurUY.js";import"./align-self-Cj4aclWl.js";import"./text-accent-DvyJpEME.js";import"./text-centered-BFb64PJw.js";import"./useHostname-PsilflFC.js";import"./index-Cc-bXjHe.js";import"./index-DWSmmBvQ.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./message-CSdaKtIj.js";import"./render-icon-BT0Aq7PA.js";import"./useMergeRefs-SFH7Mw4x.js";import"./Input-CBd7qXZ8.js";import"./InputContainer-B1hqJyx0.js";import"./TokyoUIExpand-oMdXmNcg.js";import"./Icon-5QESEDp5.js";const Ke={title:"components/CountryFlag",component:p,args:{code:"ua",alt:h.ua}},j={render:function(){return e.jsxs("div",{style:{maxWidth:"1000px"},children:[e.jsx(t,{variant:"default-semibold",children:"For some countries, simplified flags are automatically used (unless `simplified` is set to `false`)"}),e.jsxs(V,{columns:4,children:[e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Code"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Country name"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"4x3"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"4x3 (with `simplified=false`)"})}),["es","mx"].map(r=>e.jsxs(n.Fragment,{children:[e.jsx(i,{children:r}),e.jsx(i,{children:h[r]}),e.jsx(i,{children:e.jsx(p,{code:r,alt:h[r],size:"large"})}),e.jsx(i,{children:e.jsx(p,{code:r,alt:h[r],size:"large",simplified:!1})})]},r))]}),e.jsx("br",{}),e.jsx(t,{variant:"default-semibold",children:"All countries"}),e.jsxs(V,{columns:3,children:[e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Code"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"Country name"})}),e.jsx(i,{children:e.jsx(t,{variant:"default-semibold",children:"4x3"})}),Object.keys(h).map(r=>e.jsxs(n.Fragment,{children:[e.jsx(i,{children:r}),e.jsx(i,{children:h[r]}),e.jsx(i,{children:e.jsx(p,{code:r,alt:h[r],size:"large"})})]},r))]})]})}};function l({src:d,alt:r,square:a=!1}){return e.jsxs("div",{children:[e.jsx("img",{src:d,alt:r,style:{width:a?"96px":"128px",height:"96px"}}),e.jsx("img",{src:d,alt:r,style:{width:a?"24px":"32px",height:"24px"}})]})}const G={tags:["!test","!a11y-test"],parameters:{chromatic:{disableSnapshot:!0}},render:function(){const r="https://static.staging.preply.org/groot/country_flags/",a="https://static.preply.com/ds/country-flags/",[y,P]=n.useState(!1),[f,D]=n.useState(!1),[S,q]=n.useState(!0),[C,L]=n.useState(!0),[v,N]=n.useState(!1),[b,A]=n.useState(!0),[w,I]=n.useState(!0),[re,J]=n.useState(!0),[x,oe]=n.useState(a),$=Number(y)+Number(f)+Number(S)+Number(C)+Number(v)+Number(b)+Number(w)+2,se=y&&f&&S&&C&&v&&b&&w;return e.jsxs("div",{style:{maxWidth:"100%"},children:[e.jsx(ne,{children:e.jsxs(de,{children:[e.jsx(ce,{children:"How to read the following table?"}),e.jsxs(ue,{children:[e.jsxs(t,{children:["- All the flags have bee imported from"," ",e.jsx(ie,{href:"https://github.com/lipis/flag-icons",children:"flag-icons"})]}),e.jsx(t,{children:"- Some flags have been manually replaced because they were wrong"}),e.jsx(t,{children:"- The design system contains more flags compared to Groot (the original apollo's application that contained all the static assets)"}),e.jsx(t,{children:"- Some flags have simplified versions (ex. Spain, Mexico) to reduce their size"}),e.jsx(t,{children:"- All the flags are a available in JPG, mainly to reduce the computation on the native application"}),e.jsx(t,{children:"- You are supposed to gather the assets URL through the `getCountryFlagUrl` utility"}),e.jsx(t,{children:"- For local testing, use `npx serve` launched in the `static-assets/country-flags` directory, and replace the path in the below field."}),e.jsx(t,{children:"- For PR testing, look at `deploy-static-assets.sh` to find the PR URL for static assets."})]})]})}),e.jsxs(te,{gap:"16",padding:["32","0","0","0"],children:[e.jsx(m,{label:"Groot 4x3 SVG",required:!0,children:e.jsx(g,{checked:y,onCheckedChange:P})}),e.jsx(m,{label:"Groot 4x3 PNG",required:!0,children:e.jsx(g,{checked:f,onCheckedChange:D})}),e.jsx(m,{label:"DS 4x3 SVG",required:!0,children:e.jsx(g,{checked:S,onCheckedChange:q})}),e.jsx(m,{label:"DS 4x3 JPG",required:!0,children:e.jsx(g,{checked:C,onCheckedChange:L})}),e.jsx(m,{label:"Groot 1x1 SVG",required:!0,children:e.jsx(g,{checked:v,onCheckedChange:N})}),e.jsx(m,{label:"DS 1x1 SVG",required:!0,children:e.jsx(g,{checked:b,onCheckedChange:A})}),e.jsx(m,{label:"DS 1x1 JPG",required:!0,children:e.jsx(g,{checked:w,onCheckedChange:I})}),e.jsx(m,{label:"Product size",required:!0,children:e.jsx(g,{checked:re,onCheckedChange:J})}),e.jsx(m,{label:"All",required:!0,children:e.jsx(g,{checked:se,onCheckedChange:o=>{P(o),D(o),q(o),L(o),N(o),A(o),I(o),J(o)}})}),e.jsx(le,{value:x,onValueChange:oe,label:"Assets path",required:!0})]}),e.jsx("div",{style:{position:"sticky",top:"0px",background:"white"},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:`repeat(${$}, 1fr)`,gap:"4px",padding:"16px 0 0 0"},children:[e.jsx("div",{style:{alignSelf:"start"},children:e.jsx(t,{variant:"default-semibold",children:"Code"})}),e.jsx(t,{variant:"default-semibold",children:"Country name"}),y&&e.jsx(t,{variant:"default-semibold",children:"Show Groot 4x3 SVG"}),f&&e.jsx(t,{variant:"default-semibold",children:"Show Groot 4x3 PNG"}),S&&e.jsx(t,{variant:"default-semibold",children:"Show DS 4x3 SVG"}),C&&e.jsx(t,{variant:"default-semibold",children:"Show DS 4x3 JPG"}),v&&e.jsx(t,{variant:"default-semibold",children:"Show Groot 1x1 SVG"}),b&&e.jsx(t,{variant:"default-semibold",children:"Show DS 1x1 SVG"}),w&&e.jsx(t,{variant:"default-semibold",children:"Show DS 1x1 JPG"})]})}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${$}, 1fr)`,gap:"4px",padding:"16px 0 0 0"},children:Object.keys(h).map(o=>{const c=o,s=h[o],ae=u({requester:"",countryCode:c,simplified:!0})!==u({requester:"",countryCode:c,simplified:!1});return e.jsxs(n.Fragment,{children:[e.jsx(t,{children:o}),e.jsx(t,{children:s}),y&&e.jsx(l,{src:`${r}4x3/${o}.svg`,alt:s}),f&&e.jsx(l,{src:`${r}pngs/${o}.png`,alt:s}),S&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1}).replace(a,x),alt:s}),C&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1,graphic:"raster"}).replace(a,x),alt:s}),v&&e.jsx(l,{src:`${r}1x1/${o}.svg`,square:!0,alt:s}),b&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1,square:!0}).replace(a,x),square:!0,alt:s}),w&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!1,square:!0,graphic:"raster"}).replace(a,x),square:!0,alt:s}),ae&&e.jsxs(n.Fragment,{children:[e.jsxs(t,{children:[o," (simplified version)"]}),e.jsx(t,{children:h[o]}),y&&e.jsx(l,{src:`${r}4x3/${o}.svg`,alt:s}),f&&e.jsx(l,{src:`${r}pngs/${o}.png`,alt:s}),S&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0}).replace(a,x),alt:s}),C&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0,graphic:"raster"}).replace(a,x),alt:s}),v&&e.jsx(l,{src:`${r}1x1/${o}.svg`,square:!0,alt:s}),b&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0,square:!0}).replace(a,x),square:!0,alt:s}),w&&e.jsx(l,{src:u({requester:"storybook",countryCode:c,simplified:!0,square:!0,graphic:"raster"}).replace(a,x),square:!0,alt:s})]},o+"simplified")]},o)})})]})}},F={render:d=>e.jsxs(te,{gap:"16",children:[e.jsx(p,{...d,size:"small"}),e.jsx(p,{...d,size:"medium"}),e.jsx(p,{...d,size:"large"})]})},T={render:function(){return e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"default-regular-italic",children:"Invalid country code"}),e.jsx(p,{code:"invalidCountryCode",alt:"Invalid country code"}),e.jsx(t,{variant:"default-regular-italic",children:"`undefined` country code"}),e.jsx(p,{code:void 0,alt:"Undefined country code"})]})},play:async({canvas:d})=>{const r=d.getByAltText("Invalid country code");z(r).toBeVisible();const a=d.getByAltText("Undefined country code");z(a).toBeVisible()}},k={parameters:{chromatic:{disableSnapshot:!0}},args:{dataset:{qaid:"flag"}},argTypes:{dataset:{control:"object"}}};var U,R,B;j.parameters={...j.parameters,docs:{...(U=j.parameters)==null?void 0:U.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-BTJTZTIL.js";import{e as o}from"./index-Dk_MCKuE.js";import{C as s}from"./CountryFlag-ykx10eak.js";import"./index-ChsGqxH_.js";import"./index-Cb9e4tly.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-qlqSh81O.js";import"./componentNames-k0j3gHgH.js";const T={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,i;a.parameters={...a.parameters,docs:{...(n=a.parameters)==null?void 0:n.docs,source:{originalSource:`{
1
+ import{j as d}from"./jsx-runtime-BTJTZTIL.js";import{e as o}from"./index-Dk_MCKuE.js";import{C as s}from"./CountryFlag-DeifQHMo.js";import"./index-ChsGqxH_.js";import"./index-Cb9e4tly.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-qlqSh81O.js";import"./componentNames-k0j3gHgH.js";const T={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,i;a.parameters={...a.parameters,docs:{...(n=a.parameters)==null?void 0:n.docs,source:{originalSource:`{
2
2
  render: function Story() {
3
3
  return <CountryFlag code="ua" alt="Ukraine" dataset={{
4
4
  foo: 1,
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as E}from"./index-Cb9e4tly.js";import{a as p}from"./index-B-lxVbXh.js";import{f as W,u as d,a as g,e as n,w as A}from"./index-Dk_MCKuE.js";import{D as l}from"./index-CTTzR4gE.js";import{B as c}from"./Button-r7N6Ff_n.js";import{A as et}from"./Avatar-pYo4pD9f.js";import{F as tt}from"./TokyoUIInfo-DbkQBubr.js";import{N as ot}from"./NumberField-DfV-lQqS.js";import{I as at}from"./Icon-C9LCNP6i.js";import{O as F}from"./OnboardingTooltip-B_kaIqZr.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./v4-CtRu48qb.js";import"./Steps-B7JLI9QK.js";import"./index-DWSmmBvQ.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./Heading-D-ou4j7h.js";import"./text-accent-DvyJpEME.js";import"./classNames-9hsFPPZv.js";import"./text-centered-BFb64PJw.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./componentNames-k0j3gHgH.js";import"./index-qlqSh81O.js";import"./ProgressSteps-BfCnfM68.js";import"./Text-Buodaus4.js";import"./defaults-czRWsFkX.js";import"./message-CSdaKtIj.js";import"./TokyoUIClose-thK8sk63.js";import"./IconButton-DN6fzHUD.js";import"./render-icon-BT0Aq7PA.js";import"./ButtonBase-zwYgfoSw.js";import"./Spinner-CUtAzzFK.js";import"./useMergeRefs-SFH7Mw4x.js";import"./useHostname-PsilflFC.js";import"./index-CC6DAVyL.js";import"./shared-strings-DFzxd8lM.js";import"./useOpenInteractionType-BkuUI9ak.js";import"./index-s7KTOhR7.js";import"./index-BPCsOyHr.js";import"./PortalElementProvider-C7eyjaTY.js";import"./index-CBNx_T-u.js";import"./index-Cc-bXjHe.js";import"./constants-5om8Ptru.js";import"./FormControl-BEOVVHxt.js";import"./Input-CkgW02B0.js";import"./InputContainer-B1hqJyx0.js";import"./Combination-5zjsB4UY.js";import"./index-DPv9hOkP.js";import"./index-CAVIhQtL.js";const u=()=>e.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}});let $e=()=>{};const nt=(o,t)=>{const[a,r]=E.useState(t.args.open);$e=()=>r(!1);const s=()=>{var y,q;r(!1),(q=(y=t.args).onClose)==null||q.call(y)};return e.jsxs(e.Fragment,{children:[e.jsx(c,{dataset:{testid:"trigger"},onClick:()=>r(!0),children:"Open"}),e.jsx(o,{args:{...t.args,open:a,onClose:s}})]})},i={title:"Components/Dialog",component:l,parameters:{preventIframeFromScrollingParent:!0,docs:{story:{inline:!1,height:600}}},decorators:[nt],args:{onClose:W(),children:e.jsx(u,{}),dataset:{testid:"dialog"}},play:async({canvas:o,step:t})=>{await t("Open dialog",async()=>{const a=o.getByTestId("trigger");return await d.click(a),g(()=>{n(o.getByTestId("dialog")).toBeVisible()})})}},B={args:{title:"Dialog title",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:()=>{p("Primary button clicked"),$e()},children:"Primary"}),secondaryButton:e.jsx(c,{size:"medium",variant:"tertiary",onClick:p("Secondary button clicked"),children:"Secondary"})})]})}},w={tags:["!autodocs","!dev"],args:{size:"xs",title:"Extra Small Dialog"}},C={tags:["!autodocs","!dev"],args:{size:"sm",title:"Small Dialog"}},T={tags:["!autodocs","!dev"],args:{size:"md",title:"Medium Dialog"}},k={tags:["!autodocs","!dev"],args:{size:"lg",title:"Large Dialog"}},h={tags:["!autodocs","!dev"],args:{size:{_:"xs","medium-l":"lg"},title:"Width Responsiveness",description:"Change the window width to see the Dialog width respond to it"}},rt=()=>{const[o,t]=E.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Child count",value:o,onChange:a=>t(parseInt(a.target.value)),required:!0}),e.jsx("br",{}),Array.from({length:o},(a,r)=>e.jsx(u,{},r))]})},S={args:{title:"Height Responsiveness",description:"Change the number of children to see the Dialog style respond to the height change",children:e.jsxs(e.Fragment,{children:[e.jsx(rt,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(c,{size:"medium",variant:"tertiary",onClick:p("Secondary button clicked"),children:"Secondary"})})]})}},D={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},args:{title:"Mobile Full Height",mobileFullHeight:!0}},I={args:{title:"Visually Hidden Title",description:"This header is hidden visually but still accessible to screen readers",hideHeader:!0}},f={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"})})]})}},j={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(c,{size:"medium",variant:"tertiary",onClick:p("Secondary button clicked"),children:"Secondary"})})]})}},v={args:{title:"Hidden Dialog Title",hideHeader:!0,children:e.jsx(e.Fragment,{children:e.jsxs(l.Steps,{"aria-label":"Onboarding Steps",children:[e.jsx(l.Step,{title:"Profile",description:"Tell us more about yourself",children:e.jsx(u,{})}),e.jsx(l.Step,{title:"Subject",description:"What do you want to learn?",children:e.jsx(u,{})}),e.jsx(l.Step,{title:"Availability",description:"When are you available?",children:e.jsx(u,{})}),e.jsx(l.StepsActions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"})})]})})},play:async o=>{var r;await((r=i.play)==null?void 0:r.call(i,o));const{canvas:t,step:a}=o;await a("Initially, only next button is present",async()=>{n(t.queryByRole("button",{name:"Next"})).toBeVisible(),n(t.queryByRole("button",{name:"Previous"})).not.toBeInTheDocument(),n(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the next step. Previous/Next buttons are visible",async()=>{await d.click(t.getByRole("button",{name:"Next"})),n(t.queryByRole("button",{name:"Previous"})).toBeVisible(),n(t.queryByRole("button",{name:"Next"})).toBeVisible(),n(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the last step. Previous/Primary buttons are visible",async()=>{await d.click(t.getByRole("button",{name:"Next"})),n(t.queryByRole("button",{name:"Previous"})).toBeVisible(),n(t.queryByRole("button",{name:"Primary"})).toBeVisible(),n(t.queryByRole("button",{name:"Next"})).not.toBeInTheDocument()})}},b={args:{leadingElement:e.jsx(at,{size:"32",svg:tt}),title:"Information Dialog"}},x={args:{leadingElement:e.jsx(et,{size:"48",alt:"User"}),title:"User Profile",description:"This dialog shows a user profile with an avatar in the title"}},m=o=>(E.useEffect(()=>(document.body.style.setProperty("--ds-dialog-overlay-z-index-override","88"),document.body.style.setProperty("--ds-dialog-content-z-index-override","77"),()=>{document.body.style.removeProperty("--ds-dialog-overlay-z-index-override"),document.body.style.removeProperty("--ds-dialog-content-z-index-override")}),[]),e.jsx("div",{style:{position:"relative",zIndex:99},children:e.jsx(l,{...o,title:"ZIndex Override"})}));m.parameters={docs:{source:{type:"code"}}};m.play=async({canvas:o,step:t})=>{await t("Open alert",async()=>(await d.click(o.getByTestId("trigger")),g(()=>{const a=o.getByTestId("dialog");n(a).toBeVisible()}))),await t("Check content's computed z-index",async()=>{const a=o.getByTestId("dialog"),r=getComputedStyle(a);n(r.zIndex).toBe("77")}),await t("Check overlay's computed z-index",async()=>{const a=o.getByTestId("dialog-overlay");if(!a)throw new Error("The overlay happened to be the previous sibling of the dialog content, but it isn't anymore. Please update the test.");const r=getComputedStyle(a);n(r.zIndex).toBe("88")})};const P={tags:["!autodocs","!dev"],args:{title:"Test Close Button"},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a,args:r}=o;await a("Close dialog using close button",async()=>{const y=t.getByTestId("dialog-close");return await d.click(y),g(async()=>(await n(t.queryByTestId("dialog")).not.toBeInTheDocument(),n(r.onClose).toHaveBeenCalledOnce()))})}},z={tags:["!autodocs","!dev"],args:{title:"Test Close Overlay"},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a,args:r}=o;await a("Close dialog by clicking overlay",async()=>{const y=t.getByTestId("dialog-overlay");return await d.click(y),g(async()=>(await n(t.queryByTestId("dialog")).not.toBeInTheDocument(),n(r.onClose).toHaveBeenCalledOnce()))})}},O={tags:["!autodocs","!dev"],args:{title:"Test Close Keyboard"},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a,args:r}=o;await a("Close dialog using escape key",async()=>(await d.keyboard("{Escape}"),g(()=>{n(t.queryByTestId("dialog")).not.toBeInTheDocument(),n(r.onClose).toHaveBeenCalledOnce()})))}},H={uncontrolled:W(p("uncontrolled")),controlled:W(p("controlled"))},it=()=>{const[o,t]=E.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(F,{dataset:{testid:"uncontrolled-tooltip"},actionOnClick:H.uncontrolled,title:"Uncontrolled",text:"text",children:e.jsx(c,{children:"Uncontrolled"})}),e.jsx(F,{dataset:{testid:"controlled-tooltip"},actionOnClick:H.controlled,title:"Controlled",text:"text",disabled:!o,onClose:()=>t(!1),children:e.jsx(c,{onClick:()=>t(!0),children:"Open tooltip"})})]})},R={tags:["!autodocs","!dev"],args:{children:e.jsx(it,{})},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a}=o,r=t.getByTestId("uncontrolled-tooltip");await a("Uncontrolled tooltip should be visible",async()=>{n(r).toBeVisible()}),await a("Click on uncontrolled tooltip action",async()=>{await d.click(A(r).getByTestId("action")),n(H.uncontrolled).toHaveBeenCalledOnce()}),await a("Open controlled tooltip",async()=>{await d.click(t.getByRole("button",{name:"Open tooltip"})),await g(()=>{n(t.getByTestId("controlled-tooltip")).toBeVisible()})}),await a("Click on controlled tooltip action",async()=>{await d.click(A(t.getByTestId("controlled-tooltip")).getByTestId("action")),n(H.controlled).toHaveBeenCalledOnce()})}};var N,V,U;B.parameters={...B.parameters,docs:{...(N=B.parameters)==null?void 0:N.docs,source:{originalSource:`{
1
+ import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as E}from"./index-Cb9e4tly.js";import{a as p}from"./index-B-lxVbXh.js";import{f as W,u as d,a as g,e as n,w as A}from"./index-Dk_MCKuE.js";import{D as l}from"./index-CBngXnat.js";import{B as c}from"./Button-CV3MrNle.js";import{A as et}from"./Avatar-CDcgvepQ.js";import{F as tt}from"./TokyoUIInfo-DbkQBubr.js";import{N as ot}from"./NumberField-D5dekhTb.js";import{I as at}from"./Icon-5QESEDp5.js";import{O as F}from"./OnboardingTooltip-DcTHydZd.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./v4-CtRu48qb.js";import"./Steps-hoco_XFq.js";import"./index-DWSmmBvQ.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./Heading-CTiQg0ko.js";import"./text-accent-DvyJpEME.js";import"./classNames-9hsFPPZv.js";import"./text-centered-BFb64PJw.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./componentNames-k0j3gHgH.js";import"./index-qlqSh81O.js";import"./ProgressSteps-BfCnfM68.js";import"./Text-DiDZp_C4.js";import"./defaults-czRWsFkX.js";import"./message-CSdaKtIj.js";import"./TokyoUIClose-thK8sk63.js";import"./IconButton-DSKTwXgX.js";import"./render-icon-BT0Aq7PA.js";import"./ButtonBase-BpIWpxNP.js";import"./Spinner-CUtAzzFK.js";import"./useMergeRefs-SFH7Mw4x.js";import"./useHostname-PsilflFC.js";import"./index-CC6DAVyL.js";import"./shared-strings-DFzxd8lM.js";import"./useOpenInteractionType-BkuUI9ak.js";import"./index-s7KTOhR7.js";import"./index-BPCsOyHr.js";import"./PortalElementProvider-C7eyjaTY.js";import"./index-CBNx_T-u.js";import"./index-Cc-bXjHe.js";import"./constants-5om8Ptru.js";import"./FormControl-BEOVVHxt.js";import"./Input-CBd7qXZ8.js";import"./InputContainer-B1hqJyx0.js";import"./Combination-5zjsB4UY.js";import"./index-DPv9hOkP.js";import"./index-CAVIhQtL.js";const u=()=>e.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}});let $e=()=>{};const nt=(o,t)=>{const[a,r]=E.useState(t.args.open);$e=()=>r(!1);const s=()=>{var y,q;r(!1),(q=(y=t.args).onClose)==null||q.call(y)};return e.jsxs(e.Fragment,{children:[e.jsx(c,{dataset:{testid:"trigger"},onClick:()=>r(!0),children:"Open"}),e.jsx(o,{args:{...t.args,open:a,onClose:s}})]})},i={title:"Components/Dialog",component:l,parameters:{preventIframeFromScrollingParent:!0,docs:{story:{inline:!1,height:600}}},decorators:[nt],args:{onClose:W(),children:e.jsx(u,{}),dataset:{testid:"dialog"}},play:async({canvas:o,step:t})=>{await t("Open dialog",async()=>{const a=o.getByTestId("trigger");return await d.click(a),g(()=>{n(o.getByTestId("dialog")).toBeVisible()})})}},B={args:{title:"Dialog title",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:()=>{p("Primary button clicked"),$e()},children:"Primary"}),secondaryButton:e.jsx(c,{size:"medium",variant:"tertiary",onClick:p("Secondary button clicked"),children:"Secondary"})})]})}},w={tags:["!autodocs","!dev"],args:{size:"xs",title:"Extra Small Dialog"}},C={tags:["!autodocs","!dev"],args:{size:"sm",title:"Small Dialog"}},T={tags:["!autodocs","!dev"],args:{size:"md",title:"Medium Dialog"}},k={tags:["!autodocs","!dev"],args:{size:"lg",title:"Large Dialog"}},h={tags:["!autodocs","!dev"],args:{size:{_:"xs","medium-l":"lg"},title:"Width Responsiveness",description:"Change the window width to see the Dialog width respond to it"}},rt=()=>{const[o,t]=E.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Child count",value:o,onChange:a=>t(parseInt(a.target.value)),required:!0}),e.jsx("br",{}),Array.from({length:o},(a,r)=>e.jsx(u,{},r))]})},S={args:{title:"Height Responsiveness",description:"Change the number of children to see the Dialog style respond to the height change",children:e.jsxs(e.Fragment,{children:[e.jsx(rt,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(c,{size:"medium",variant:"tertiary",onClick:p("Secondary button clicked"),children:"Secondary"})})]})}},D={parameters:{chromatic:{modes:{"narrow-l":{viewport:"narrow-l"},"medium-s":{viewport:"medium-s"},"medium-l":{viewport:"medium-l"}}}},args:{title:"Mobile Full Height",mobileFullHeight:!0}},I={args:{title:"Visually Hidden Title",description:"This header is hidden visually but still accessible to screen readers",hideHeader:!0}},f={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"})})]})}},j={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(l.Actions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(c,{size:"medium",variant:"tertiary",onClick:p("Secondary button clicked"),children:"Secondary"})})]})}},v={args:{title:"Hidden Dialog Title",hideHeader:!0,children:e.jsx(e.Fragment,{children:e.jsxs(l.Steps,{"aria-label":"Onboarding Steps",children:[e.jsx(l.Step,{title:"Profile",description:"Tell us more about yourself",children:e.jsx(u,{})}),e.jsx(l.Step,{title:"Subject",description:"What do you want to learn?",children:e.jsx(u,{})}),e.jsx(l.Step,{title:"Availability",description:"When are you available?",children:e.jsx(u,{})}),e.jsx(l.StepsActions,{primaryButton:e.jsx(c,{size:"medium",variant:"primary",onClick:p("Primary button clicked"),children:"Primary"})})]})})},play:async o=>{var r;await((r=i.play)==null?void 0:r.call(i,o));const{canvas:t,step:a}=o;await a("Initially, only next button is present",async()=>{n(t.queryByRole("button",{name:"Next"})).toBeVisible(),n(t.queryByRole("button",{name:"Previous"})).not.toBeInTheDocument(),n(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the next step. Previous/Next buttons are visible",async()=>{await d.click(t.getByRole("button",{name:"Next"})),n(t.queryByRole("button",{name:"Previous"})).toBeVisible(),n(t.queryByRole("button",{name:"Next"})).toBeVisible(),n(t.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await a("Navigate to the last step. Previous/Primary buttons are visible",async()=>{await d.click(t.getByRole("button",{name:"Next"})),n(t.queryByRole("button",{name:"Previous"})).toBeVisible(),n(t.queryByRole("button",{name:"Primary"})).toBeVisible(),n(t.queryByRole("button",{name:"Next"})).not.toBeInTheDocument()})}},b={args:{leadingElement:e.jsx(at,{size:"32",svg:tt}),title:"Information Dialog"}},x={args:{leadingElement:e.jsx(et,{size:"48",alt:"User"}),title:"User Profile",description:"This dialog shows a user profile with an avatar in the title"}},m=o=>(E.useEffect(()=>(document.body.style.setProperty("--ds-dialog-overlay-z-index-override","88"),document.body.style.setProperty("--ds-dialog-content-z-index-override","77"),()=>{document.body.style.removeProperty("--ds-dialog-overlay-z-index-override"),document.body.style.removeProperty("--ds-dialog-content-z-index-override")}),[]),e.jsx("div",{style:{position:"relative",zIndex:99},children:e.jsx(l,{...o,title:"ZIndex Override"})}));m.parameters={docs:{source:{type:"code"}}};m.play=async({canvas:o,step:t})=>{await t("Open alert",async()=>(await d.click(o.getByTestId("trigger")),g(()=>{const a=o.getByTestId("dialog");n(a).toBeVisible()}))),await t("Check content's computed z-index",async()=>{const a=o.getByTestId("dialog"),r=getComputedStyle(a);n(r.zIndex).toBe("77")}),await t("Check overlay's computed z-index",async()=>{const a=o.getByTestId("dialog-overlay");if(!a)throw new Error("The overlay happened to be the previous sibling of the dialog content, but it isn't anymore. Please update the test.");const r=getComputedStyle(a);n(r.zIndex).toBe("88")})};const P={tags:["!autodocs","!dev"],args:{title:"Test Close Button"},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a,args:r}=o;await a("Close dialog using close button",async()=>{const y=t.getByTestId("dialog-close");return await d.click(y),g(async()=>(await n(t.queryByTestId("dialog")).not.toBeInTheDocument(),n(r.onClose).toHaveBeenCalledOnce()))})}},z={tags:["!autodocs","!dev"],args:{title:"Test Close Overlay"},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a,args:r}=o;await a("Close dialog by clicking overlay",async()=>{const y=t.getByTestId("dialog-overlay");return await d.click(y),g(async()=>(await n(t.queryByTestId("dialog")).not.toBeInTheDocument(),n(r.onClose).toHaveBeenCalledOnce()))})}},O={tags:["!autodocs","!dev"],args:{title:"Test Close Keyboard"},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a,args:r}=o;await a("Close dialog using escape key",async()=>(await d.keyboard("{Escape}"),g(()=>{n(t.queryByTestId("dialog")).not.toBeInTheDocument(),n(r.onClose).toHaveBeenCalledOnce()})))}},H={uncontrolled:W(p("uncontrolled")),controlled:W(p("controlled"))},it=()=>{const[o,t]=E.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(F,{dataset:{testid:"uncontrolled-tooltip"},actionOnClick:H.uncontrolled,title:"Uncontrolled",text:"text",children:e.jsx(c,{children:"Uncontrolled"})}),e.jsx(F,{dataset:{testid:"controlled-tooltip"},actionOnClick:H.controlled,title:"Controlled",text:"text",disabled:!o,onClose:()=>t(!1),children:e.jsx(c,{onClick:()=>t(!0),children:"Open tooltip"})})]})},R={tags:["!autodocs","!dev"],args:{children:e.jsx(it,{})},play:async o=>{var s;await((s=i.play)==null?void 0:s.call(i,o));const{canvas:t,step:a}=o,r=t.getByTestId("uncontrolled-tooltip");await a("Uncontrolled tooltip should be visible",async()=>{n(r).toBeVisible()}),await a("Click on uncontrolled tooltip action",async()=>{await d.click(A(r).getByTestId("action")),n(H.uncontrolled).toHaveBeenCalledOnce()}),await a("Open controlled tooltip",async()=>{await d.click(t.getByRole("button",{name:"Open tooltip"})),await g(()=>{n(t.getByTestId("controlled-tooltip")).toBeVisible()})}),await a("Click on controlled tooltip action",async()=>{await d.click(A(t.getByTestId("controlled-tooltip")).getByTestId("action")),n(H.controlled).toHaveBeenCalledOnce()})}};var N,V,U;B.parameters={...B.parameters,docs:{...(N=B.parameters)==null?void 0:N.docs,source:{originalSource:`{
2
2
  args: {
3
3
  title: 'Dialog title',
4
4
  children: <>
@@ -0,0 +1 @@
1
+ import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as k}from"./index-Cb9e4tly.js";import{u as x}from"./useControllableState-DKskwY-e.js";import{c as j,$ as R,C as I,a as z,b as _,d as E,e as L}from"./createRequiredContext-lKWDx2_a.js";import{F as N}from"./TokyoUIClose-thK8sk63.js";import{V as A}from"./VisuallyHidden-CZd13GOS.js";import"./index-DWSmmBvQ.js";import{g as S}from"./shared-strings-DFzxd8lM.js";import{f as V}from"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import{I as T}from"./Icon-5QESEDp5.js";import{g as w}from"./index-qlqSh81O.js";import{M as F}from"./message-CSdaKtIj.js";import{w as q}from"./componentNames-k0j3gHgH.js";const[M,B]=j("DismissibleChips"),C=k.forwardRef(function({items:l,children:r,orientation:t,"aria-label":o,"aria-controls":m,value:c,onValueChange:d,defaultValue:p,dataset:f,...h},b){const[n,g]=x({value:c,onValueChange:d,defaultValue:p??[]}),u=v=>{g(n.filter(a=>a!==v))},i=l?l.map(({label:v,value:a,...D})=>e.jsx(y,{value:a,...D,children:v},a)):r;return e.jsx(M,{value:{values:n,onRemove:u,ariaControls:m},children:e.jsx(E,{orientation:t,children:e.jsx(L,{...V(h),ref:b,orientation:t,"aria-label":o,...w(f,{preplyDsComponent:q.DismissibleChips}),children:i})})})}),y=k.forwardRef(function({value:l,children:r,icon:t,countryFlagCode:o,disabled:m,counter:c,dataset:d,dsInternalSimulation:p,...f},h){const{values:b,onRemove:n,ariaControls:g}=B(),u=R(),i=()=>{n(l),u==null||u.focusNext({wrap:!0})},v=a=>{switch(a.key){case"Delete":case"Backspace":i();break}};return b.includes(l)?e.jsx(I,{children:e.jsxs(z,{...V(f),ref:h,variant:"dismissible",onClick:i,onKeyDown:v,icon:t,countryFlagCode:o,disabled:m,"aria-controls":g,dsInternalSimulation:p,...w(d,{preplyDsComponent:q.DismissibleChipsItem}),children:[e.jsx(A,{children:e.jsx(F,{...S.remove})}),e.jsx(_,{counter:c,children:r}),e.jsx(T,{svg:N})]})}):null});try{C.displayName="DismissibleChips",C.__docgenInfo={description:"A chips component for displaying dismissible/removable items.",displayName:"DismissibleChips",props:{value:{defaultValue:null,description:"Current value of the chips. When provided, the component operates in controlled mode",name:"value",required:!1,type:{name:"enum",value:[{value:"T[]"}]}},defaultValue:{defaultValue:null,description:"Default value for uncontrolled usage. Will be ignored if `value` is provided",name:"defaultValue",required:!1,type:{name:"enum",value:[{value:"T[]"}]}},"aria-controls":{defaultValue:null,description:"If the chips control other elements on the page, use `aria-controls` with the target element's ID.",name:"aria-controls",required:!1,type:{name:"enum",value:[{value:"string"}]}},"aria-label":{defaultValue:null,description:"Accessible label for the chips group. Required for screen reader users",name:"aria-label",required:!0,type:{name:"string"}},onValueChange:{defaultValue:null,description:"Callback fired when the value changes. Receives the new value as an argument",name:"onValueChange",required:!1,type:{name:"enum",value:[{value:"(value: T[]) => void"}]}},orientation:{defaultValue:{value:"'horizontal'"},description:"Layout orientation of the chips group.",name:"orientation",required:!1,type:{name:"enum",value:[{value:'"horizontal"'},{value:'"vertical"'}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},items:{defaultValue:null,description:"",name:"items",required:!1,type:{name:"enum",value:[{value:'(Omit<ChipsItemProps, "value" | "children" | "dsInternalSimulation"> & { value: NonNullable<T>; label: ReactNode; })[]'}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"(instance: HTMLUListElement | null) => void"},{value:"RefObject<HTMLUListElement>"}]}}}}}catch{}try{y.displayName="DismissibleChipsItem",y.__docgenInfo={description:"Individual dismissible chip item for use within DismissibleChips.",displayName:"DismissibleChipsItem",props:{disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},countryFlagCode:{defaultValue:null,description:"",name:"countryFlagCode",required:!1,type:{name:"enum",value:[{value:'"id"'},{value:'"is"'},{value:'"af"'},{value:'"ax"'},{value:'"al"'},{value:'"dz"'},{value:'"as"'},{value:'"ad"'},{value:'"ao"'},{value:'"ai"'},{value:'"aq"'},{value:'"ag"'},{value:'"ar"'},{value:'"am"'},{value:'"aw"'},{value:'"sh-ac"'},{value:'"asean"'},{value:'"au"'},{value:'"at"'},{value:'"az"'},{value:'"bs"'},{value:'"bh"'},{value:'"bd"'},{value:'"bb"'},{value:'"es-pv"'},{value:'"by"'},{value:'"be"'},{value:'"bz"'},{value:'"bj"'},{value:'"bm"'},{value:'"bt"'},{value:'"bo"'},{value:'"bq"'},{value:'"ba"'},{value:'"bw"'},{value:'"bv"'},{value:'"br"'},{value:'"io"'},{value:'"bn"'},{value:'"bg"'},{value:'"bf"'},{value:'"bi"'},{value:'"cv"'},{value:'"kh"'},{value:'"cm"'},{value:'"ca"'},{value:'"ic"'},{value:'"es-ct"'},{value:'"ky"'},{value:'"cf"'},{value:'"cefta"'},{value:'"td"'},{value:'"cl"'},{value:'"cn"'},{value:'"cx"'},{value:'"cp"'},{value:'"cc"'},{value:'"co"'},{value:'"km"'},{value:'"ck"'},{value:'"cr"'},{value:'"hr"'},{value:'"cu"'},{value:'"cw"'},{value:'"cy"'},{value:'"cz"'},{value:'"ci"'},{value:'"cd"'},{value:'"dk"'},{value:'"dg"'},{value:'"dj"'},{value:'"dm"'},{value:'"do"'},{value:'"eac"'},{value:'"ec"'},{value:'"eg"'},{value:'"sv"'},{value:'"gb-eng"'},{value:'"gq"'},{value:'"er"'},{value:'"ee"'},{value:'"sz"'},{value:'"et"'},{value:'"eu"'},{value:'"fk"'},{value:'"fo"'},{value:'"fm"'},{value:'"fj"'},{value:'"fi"'},{value:'"fr"'},{value:'"gf"'},{value:'"pf"'},{value:'"tf"'},{value:'"ga"'},{value:'"es-ga"'},{value:'"gm"'},{value:'"ge"'},{value:'"de"'},{value:'"gh"'},{value:'"gi"'},{value:'"gr"'},{value:'"gl"'},{value:'"gd"'},{value:'"gp"'},{value:'"gu"'},{value:'"gt"'},{value:'"gg"'},{value:'"gn"'},{value:'"gw"'},{value:'"gy"'},{value:'"ht"'},{value:'"hm"'},{value:'"va"'},{value:'"hn"'},{value:'"hk"'},{value:'"hu"'},{value:'"in"'},{value:'"ir"'},{value:'"iq"'},{value:'"ie"'},{value:'"im"'},{value:'"il"'},{value:'"it"'},{value:'"jm"'},{value:'"jp"'},{value:'"je"'},{value:'"jo"'},{value:'"kz"'},{value:'"ke"'},{value:'"ki"'},{value:'"xk"'},{value:'"kw"'},{value:'"kg"'},{value:'"la"'},{value:'"lv"'},{value:'"arab"'},{value:'"lb"'},{value:'"ls"'},{value:'"lr"'},{value:'"ly"'},{value:'"li"'},{value:'"lt"'},{value:'"lu"'},{value:'"mo"'},{value:'"mg"'},{value:'"mw"'},{value:'"my"'},{value:'"mv"'},{value:'"ml"'},{value:'"mt"'},{value:'"mh"'},{value:'"mq"'},{value:'"mr"'},{value:'"mu"'},{value:'"yt"'},{value:'"mx"'},{value:'"md"'},{value:'"mc"'},{value:'"mn"'},{value:'"me"'},{value:'"ms"'},{value:'"ma"'},{value:'"mz"'},{value:'"mm"'},{value:'"na"'},{value:'"nr"'},{value:'"np"'},{value:'"nl"'},{value:'"nc"'},{value:'"nz"'},{value:'"ni"'},{value:'"ne"'},{value:'"ng"'},{value:'"nu"'},{value:'"nf"'},{value:'"kp"'},{value:'"mk"'},{value:'"gb-nir"'},{value:'"mp"'},{value:'"no"'},{value:'"om"'},{value:'"pc"'},{value:'"pk"'},{value:'"pw"'},{value:'"pa"'},{value:'"pg"'},{value:'"py"'},{value:'"pe"'},{value:'"ph"'},{value:'"pn"'},{value:'"pl"'},{value:'"pt"'},{value:'"pr"'},{value:'"qa"'},{value:'"cg"'},{value:'"ro"'},{value:'"ru"'},{value:'"rw"'},{value:'"re"'},{value:'"bl"'},{value:'"sh-hl"'},{value:'"sh"'},{value:'"kn"'},{value:'"lc"'},{value:'"mf"'},{value:'"pm"'},{value:'"vc"'},{value:'"ws"'},{value:'"sm"'},{value:'"st"'},{value:'"sa"'},{value:'"gb-sct"'},{value:'"sn"'},{value:'"rs"'},{value:'"sc"'},{value:'"sl"'},{value:'"sg"'},{value:'"sx"'},{value:'"sk"'},{value:'"si"'},{value:'"sb"'},{value:'"so"'},{value:'"za"'},{value:'"gs"'},{value:'"kr"'},{value:'"ss"'},{value:'"es"'},{value:'"lk"'},{value:'"ps"'},{value:'"sd"'},{value:'"sr"'},{value:'"sj"'},{value:'"se"'},{value:'"ch"'},{value:'"sy"'},{value:'"tw"'},{value:'"tj"'},{value:'"tz"'},{value:'"th"'},{value:'"tl"'},{value:'"tg"'},{value:'"tk"'},{value:'"to"'},{value:'"tt"'},{value:'"sh-ta"'},{value:'"tn"'},{value:'"tm"'},{value:'"tc"'},{value:'"tv"'},{value:'"tr"'},{value:'"ug"'},{value:'"ua"'},{value:'"ae"'},{value:'"gb"'},{value:'"un"'},{value:'"um"'},{value:'"us"'},{value:'"uy"'},{value:'"uz"'},{value:'"vu"'},{value:'"ve"'},{value:'"vn"'},{value:'"vg"'},{value:'"vi"'},{value:'"gb-wls"'},{value:'"wf"'},{value:'"eh"'},{value:'"ye"'},{value:'"zm"'},{value:'"zw"'}]}},value:{defaultValue:null,description:"Unique identifier for this chip. Used for selection tracking",name:"value",required:!0,type:{name:"string"}},children:{defaultValue:null,description:"Content to display inside the chip",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"}]}},counter:{defaultValue:null,description:"Optional numeric counter to display alongside the chip label",name:"counter",required:!1,type:{name:"enum",value:[{value:"number"}]}},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: HTMLButtonElement | null) => void"},{value:"RefObject<HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}export{y as D,C as a};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as j}from"./index-Cb9e4tly.js";import{D as p,a as m}from"./DismissibleChips-CHGpXEIb.js";import{F as L,a as Qe,b as Xe,c as na}from"./TokyoUIAvailability7LateNight-TgMFD5Or.js";import{F as ia}from"./TokyoUIEmojiFrowning-DwuiVRut.js";import{F as sa}from"./index-DWSmmBvQ.js";import{L as g}from"./LayoutFlex-CnhOGGxA.js";import{T as E}from"./Text-Buodaus4.js";import{L as oa}from"./Link-8C9V_O3w.js";import{H as la}from"./Heading-D-ou4j7h.js";import{d as ra}from"./styled-components.browser.esm-COuAnjOv.js";import{f as ca,r as ea,w as u,e as a,u as l,a as A}from"./index-Dk_MCKuE.js";import{B as H}from"./Button-r7N6Ff_n.js";import{T as S}from"./Tooltip-VpC3ybJe.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./useControllableState-DKskwY-e.js";import"./createRequiredContext-WvHlx5O0.js";import"./Icon-C9LCNP6i.js";import"./text-accent-DvyJpEME.js";import"./classNames-9hsFPPZv.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./render-icon-BT0Aq7PA.js";import"./componentNames-k0j3gHgH.js";import"./index-qlqSh81O.js";import"./defaults-czRWsFkX.js";import"./CountryFlag-ykx10eak.js";import"./useMergeRefs-D_RfOOSs.js";import"./TokyoUIClose-thK8sk63.js";import"./VisuallyHidden-CZd13GOS.js";import"./shared-strings-DFzxd8lM.js";import"./message-CSdaKtIj.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./layout-relative.module-uOnIKnjS.js";import"./text-centered-BFb64PJw.js";import"./useHostname-PsilflFC.js";import"./ButtonBase-zwYgfoSw.js";import"./Spinner-CUtAzzFK.js";import"./useMergeRefs-SFH7Mw4x.js";import"./index-CC6DAVyL.js";import"./index-B2TaWKj4.js";import"./index-CBNx_T-u.js";import"./index-s7KTOhR7.js";import"./index-BPCsOyHr.js";import"./index-Cc-bXjHe.js";import"./PortalElementProvider-C7eyjaTY.js";import"./index-DPv9hOkP.js";import"./index-CAVIhQtL.js";const rt={title:"components/Chips/DismissibleChips",component:m,subcomponents:{DismissibleChipsItem:p},parameters:{layout:"padded",remountable:!0},args:{"aria-label":"Selected skills",defaultValue:["vocabulary","speaking","listening","reading"],onValueChange:ca(),items:[{value:"vocabulary",label:"Vocabulary"},{value:"speaking",label:"Speaking"},{value:"listening",label:"Listening"},{value:"reading",label:"Reading"}]},decorators:[function(t,{parameters:n}){const[s,o]=j.useState(0),r=()=>o(c=>c+1);return n.remountable?e.jsxs(g,{gap:"12",justifyContent:"space-between",children:[e.jsx(t,{},s),e.jsx(H,{variant:"ghost",size:"small",onClick:r,dataset:{testid:"reset"},children:"Reset story"})]}):e.jsx(t,{})}],beforeEach:()=>()=>{ea()}},b={play:async({canvasElement:i,step:t,args:n})=>{const s=u(i),o=s.getByRole("button",{name:/Remove Vocabulary/}),r=s.getByRole("button",{name:/Remove Speaking/}),c=s.getByRole("button",{name:/Remove Listening/}),d=s.getByRole("button",{name:/Remove Reading/});await t("Render chips with default values",async()=>{a(o).toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Chip should have accessible name",async()=>{a(o).toHaveAccessibleName("Remove Vocabulary")}),await t("Dismiss chip by clicking dismiss button",async()=>{await l.click(o),a(n.onValueChange).toHaveBeenCalledWith(["speaking","listening","reading"]),a(o).not.toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Dismiss another chip",async()=>{await l.click(r),a(n.onValueChange).toHaveBeenCalledWith(["listening","reading"]),a(o).not.toBeVisible(),a(r).not.toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await l.click(s.getByTestId("reset")),await l.click(i)}};let D;const y={render:function({defaultValue:t,...n}){const[s,o]=j.useState(t);D=o;const r=c=>{var d;o(c),(d=n.onValueChange)==null||d.call(n,c)};return e.jsx(m,{...n,value:s,onValueChange:r})},play:async({canvasElement:i,step:t,args:n})=>{const s=u(i),o=s.getByRole("button",{name:/Remove Vocabulary/}),r=s.getByRole("button",{name:/Remove Speaking/}),c=s.getByRole("button",{name:/Remove Listening/}),d=s.getByRole("button",{name:/Remove Reading/});await t("Render chips with default values",async()=>{a(o).toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Dismiss chip by clicking dismiss button",async()=>{await l.click(o),a(n.onValueChange).toHaveBeenCalledWith(["speaking","listening","reading"]),a(o).not.toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Change the value externally",async()=>{ea(),D(["listening","reading"]),await A(()=>{a(n.onValueChange).not.toHaveBeenCalled(),a(o).not.toBeVisible(),a(r).not.toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()})}),await l.click(s.getByTestId("reset")),await l.click(i)}},h={args:{items:[{value:"vocabulary",label:"Vocabulary"},{value:"speaking",label:"Speaking",disabled:!0},{value:"listening",label:"Listening",disabled:!0},{value:"reading",label:"Reading"}]},play:async({canvasElement:i,step:t,args:n})=>{const o=u(i).getByRole("button",{name:/Remove Speaking/});await t("Disabled chip must have disabled attribute",async()=>{a(o).toBeDisabled()}),await t("Disabled chip must not be clickable",async()=>{await l.click(o),a(n.onValueChange).not.toHaveBeenCalled(),a(o).toBeVisible()})}},v={args:{"aria-label":"Selected availabilities",defaultValue:["morning","afternoon","evening"],items:[{value:"morning",label:"Morning",icon:e.jsx(L,{})},{value:"afternoon",label:"Afternoon",icon:e.jsx(Qe,{})},{value:"evening",label:"Evening",icon:e.jsx(Xe,{})}]},play:async({canvasElement:i,step:t})=>{const s=u(i).getByRole("button",{name:/Remove Morning/}),o=u(s).getByTestId("chip-icon");await t("Chip should render an icon when `icon` prop is passed",async()=>{a(o).toBeVisible()})}},w={args:{"aria-label":"Selected languages",defaultValue:["english"],items:[{value:"english",label:"English",counter:1247},{value:"spanish",label:"Spanish",counter:892},{value:"french",label:"French",counter:534},{value:"german",label:"German",counter:421},{value:"italian",label:"Italian",counter:287},{value:"portuguese",label:"Portuguese",counter:156}]},play:async({canvasElement:i,step:t})=>{const s=u(i).getByRole("button",{name:/Remove English/}),o=u(s).getByTestId("chip-counter");await t("Chip should render a counter when `counter` prop is passed",async()=>{a(o).toBeVisible(),a(o).toHaveTextContent("1247")})}},f={args:{"aria-label":"Selected countries",defaultValue:["ua","gb","it","es","au","br","eg"],items:[{value:"ua",label:"Ukraine",countryFlagCode:"ua"},{value:"gb",label:"United Kingdom",countryFlagCode:"gb"},{value:"it",label:"Italy",countryFlagCode:"it"},{value:"es",label:"Spain",countryFlagCode:"es"},{value:"au",label:"Australia",countryFlagCode:"au"},{value:"br",label:"Brazil",countryFlagCode:"br"},{value:"eg",label:"Egypt",countryFlagCode:"eg"}]},play:async({canvasElement:i,step:t})=>{const s=u(i).getByRole("button",{name:/Remove Ukraine/}),o=u(s).getByTestId("chip-country-flag");await t("Chip should render a flag when `flagCountryCode` prop is passed",async()=>{a(o).toBeVisible()})}},k={args:{"aria-label":"Fancy chips",defaultValue:["counter+icon","counter+flag","icon+flag"],items:[{value:"counter+icon",label:"Icon + Counter",icon:e.jsx(L,{}),counter:1247},{value:"counter+flag",label:"Flag + Counter",countryFlagCode:"ua",counter:1247},{value:"icon+flag",label:"Icon + Flag",icon:e.jsx(L,{}),countryFlagCode:"ua"}]},play:async({canvasElement:i})=>{const t=u(i),n=u(t.getByRole("button",{name:"Remove Icon + Flag"}));a(n.getByTestId("chip-icon")).toBeVisible(),a(n.queryByTestId("chip-country-flag")).not.toBeInTheDocument()}},x=["2025-08-15T10:00Z","2025-08-16T12:00Z","2025-08-17T14:00Z"],B={args:{orientation:"vertical","aria-label":"Selected time slots",defaultValue:x,items:x.map(i=>({value:i,label:e.jsx(sa,{weekday:"short",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit",value:i}),dataset:{testid:i}}))},decorators:[i=>e.jsx("div",{style:{width:300,margin:"0 auto"},children:e.jsx(i,{})})],play:async({canvasElement:i,step:t})=>{const n=u(i),s=n.getByTestId(x[0]),o=n.getByTestId(x[1]),r=n.getByTestId(x[2]);await t("Focus first chip",async()=>{s.focus()}),await t("Arrow down should focus second chip",async()=>{await l.keyboard("{ArrowDown}"),a(o).toHaveFocus()}),await t("Arrow down should focus third chip",async()=>{await l.keyboard("{ArrowDown}"),a(r).toHaveFocus()}),await t("Arrow down should focus first chip",async()=>{await l.keyboard("{ArrowDown}"),a(s).toHaveFocus()}),await t("Arrow up should focus third chip",async()=>{await l.keyboard("{ArrowUp}"),a(r).toHaveFocus()})}},R={render:i=>e.jsxs(g,{gap:"12",children:[e.jsx(m,{...i}),e.jsx(H,{variant:"tertiary",size:"small",onClick:()=>alert("Show all"),children:"Show all"})]})},aa=[{value:"vocabulary",label:"Vocabulary"},{value:"speaking",label:"Speaking"},{value:"listening",label:"Listening"},{value:"reading",label:"Reading"},{value:"writing",label:"Writing"},{value:"grammar",label:"Grammar"}],ua=[{value:"monday",label:"Monday"},{value:"tuesday",label:"Tuesday"},{value:"wednesday",label:"Wednesday"},{value:"thursday",label:"Thursday"},{value:"friday",label:"Friday"},{value:"saturday",label:"Saturday"},{value:"sunday",label:"Sunday"}],da=[{value:"morning",label:"Morning (6-12)",icon:e.jsx(L,{})},{value:"afternoon",label:"Afternoon (12-18)",icon:e.jsx(Qe,{})},{value:"evening",label:"Evening (18-0)",icon:e.jsx(Xe,{})},{value:"night",label:"Night (0-6)",icon:e.jsx(na,{})}],C={render:function(t){return e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"64",children:[e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"16",children:[e.jsx(E,{variant:"large-semibold",children:"What skills do you want to focus on?"}),e.jsx(m,{"aria-label":"Selected skills",defaultValue:["vocabulary","speaking","listening"],items:aa})]}),e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"16",children:[e.jsx(E,{variant:"large-semibold",children:"Which days work best for you?"}),e.jsx(m,{"aria-label":"Selected days",defaultValue:["monday","wednesday","friday"],items:ua})]}),e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"16",children:[e.jsx(E,{variant:"large-semibold",children:"What times of day work for you?"}),e.jsx(m,{"aria-label":"Selected times",defaultValue:["morning","afternoon"],items:da})]})]})},play:async({canvasElement:i,step:t})=>{const n=u(i),s=n.getByRole("button",{name:/Remove Vocabulary/}),o=n.getByRole("button",{name:/Remove Speaking/}),r=n.getByRole("button",{name:/Remove Listening/}),c=n.getByRole("button",{name:/Remove Monday/});await t("Tab once to enter the component",async()=>{await l.tab(),a(s).toHaveFocus()}),await t("Next tab should focus second chips group",async()=>{await l.tab(),a(c).toHaveFocus()}),await t("Shift+Tab should focus first chips group again",async()=>{await l.tab({shift:!0}),a(s).toHaveFocus()}),await t("Right arrow should focus next chip in the group",async()=>{await l.keyboard("{ArrowRight}"),a(o).toHaveFocus()}),await t("Left arrow should focus previous chip in the group",async()=>{await l.keyboard("{ArrowLeft}"),a(s).toHaveFocus()}),await t("Left arrow should focus last chip if first chip is focused",async()=>{await l.keyboard("{ArrowLeft}"),a(r).toHaveFocus()}),await t("Right arrow should focus first chip if last chip is focused",async()=>{await l.keyboard("{ArrowRight}"),a(s).toHaveFocus()}),await t("Focus last chip",async()=>{await l.keyboard("{ArrowLeft}")}),await t("Tab to the next group",async()=>{await l.tab()}),await t("Shift+Tab to return to the first group, the last focused chip should be focused",async()=>{await l.tab({shift:!0}),a(r).toHaveFocus()})}},pa=ra.ul`
1
+ import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as j}from"./index-Cb9e4tly.js";import{D as p,a as m}from"./DismissibleChips-gzmntal_.js";import{F as L,a as Qe,b as Xe,c as na}from"./TokyoUIAvailability7LateNight-TgMFD5Or.js";import{F as ia}from"./TokyoUIEmojiFrowning-DwuiVRut.js";import{F as sa}from"./index-DWSmmBvQ.js";import{L as g}from"./LayoutFlex--W1D5e-w.js";import{T as E}from"./Text-DiDZp_C4.js";import{L as oa}from"./Link-CLsuYZJn.js";import{H as la}from"./Heading-CTiQg0ko.js";import{d as ra}from"./styled-components.browser.esm-COuAnjOv.js";import{f as ca,r as ea,w as u,e as a,u as l,a as A}from"./index-Dk_MCKuE.js";import{B as H}from"./Button-CV3MrNle.js";import{T as S}from"./Tooltip-VpC3ybJe.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./useControllableState-DKskwY-e.js";import"./createRequiredContext-lKWDx2_a.js";import"./Icon-5QESEDp5.js";import"./text-accent-DvyJpEME.js";import"./classNames-9hsFPPZv.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./render-icon-BT0Aq7PA.js";import"./componentNames-k0j3gHgH.js";import"./index-qlqSh81O.js";import"./defaults-czRWsFkX.js";import"./CountryFlag-DeifQHMo.js";import"./useMergeRefs-D_RfOOSs.js";import"./TokyoUIClose-thK8sk63.js";import"./VisuallyHidden-CZd13GOS.js";import"./shared-strings-DFzxd8lM.js";import"./message-CSdaKtIj.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./layout-relative.module-uOnIKnjS.js";import"./text-centered-BFb64PJw.js";import"./useHostname-PsilflFC.js";import"./ButtonBase-BpIWpxNP.js";import"./Spinner-CUtAzzFK.js";import"./useMergeRefs-SFH7Mw4x.js";import"./index-CC6DAVyL.js";import"./index-B2TaWKj4.js";import"./index-CBNx_T-u.js";import"./index-s7KTOhR7.js";import"./index-BPCsOyHr.js";import"./index-Cc-bXjHe.js";import"./PortalElementProvider-C7eyjaTY.js";import"./index-DPv9hOkP.js";import"./index-CAVIhQtL.js";const rt={title:"components/Chips/DismissibleChips",component:m,subcomponents:{DismissibleChipsItem:p},parameters:{layout:"padded",remountable:!0},args:{"aria-label":"Selected skills",defaultValue:["vocabulary","speaking","listening","reading"],onValueChange:ca(),items:[{value:"vocabulary",label:"Vocabulary"},{value:"speaking",label:"Speaking"},{value:"listening",label:"Listening"},{value:"reading",label:"Reading"}]},decorators:[function(t,{parameters:n}){const[s,o]=j.useState(0),r=()=>o(c=>c+1);return n.remountable?e.jsxs(g,{gap:"12",justifyContent:"space-between",children:[e.jsx(t,{},s),e.jsx(H,{variant:"ghost",size:"small",onClick:r,dataset:{testid:"reset"},children:"Reset story"})]}):e.jsx(t,{})}],beforeEach:()=>()=>{ea()}},b={play:async({canvasElement:i,step:t,args:n})=>{const s=u(i),o=s.getByRole("button",{name:/Remove Vocabulary/}),r=s.getByRole("button",{name:/Remove Speaking/}),c=s.getByRole("button",{name:/Remove Listening/}),d=s.getByRole("button",{name:/Remove Reading/});await t("Render chips with default values",async()=>{a(o).toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Chip should have accessible name",async()=>{a(o).toHaveAccessibleName("Remove Vocabulary")}),await t("Dismiss chip by clicking dismiss button",async()=>{await l.click(o),a(n.onValueChange).toHaveBeenCalledWith(["speaking","listening","reading"]),a(o).not.toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Dismiss another chip",async()=>{await l.click(r),a(n.onValueChange).toHaveBeenCalledWith(["listening","reading"]),a(o).not.toBeVisible(),a(r).not.toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await l.click(s.getByTestId("reset")),await l.click(i)}};let D;const y={render:function({defaultValue:t,...n}){const[s,o]=j.useState(t);D=o;const r=c=>{var d;o(c),(d=n.onValueChange)==null||d.call(n,c)};return e.jsx(m,{...n,value:s,onValueChange:r})},play:async({canvasElement:i,step:t,args:n})=>{const s=u(i),o=s.getByRole("button",{name:/Remove Vocabulary/}),r=s.getByRole("button",{name:/Remove Speaking/}),c=s.getByRole("button",{name:/Remove Listening/}),d=s.getByRole("button",{name:/Remove Reading/});await t("Render chips with default values",async()=>{a(o).toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Dismiss chip by clicking dismiss button",async()=>{await l.click(o),a(n.onValueChange).toHaveBeenCalledWith(["speaking","listening","reading"]),a(o).not.toBeVisible(),a(r).toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()}),await t("Change the value externally",async()=>{ea(),D(["listening","reading"]),await A(()=>{a(n.onValueChange).not.toHaveBeenCalled(),a(o).not.toBeVisible(),a(r).not.toBeVisible(),a(c).toBeVisible(),a(d).toBeVisible()})}),await l.click(s.getByTestId("reset")),await l.click(i)}},h={args:{items:[{value:"vocabulary",label:"Vocabulary"},{value:"speaking",label:"Speaking",disabled:!0},{value:"listening",label:"Listening",disabled:!0},{value:"reading",label:"Reading"}]},play:async({canvasElement:i,step:t,args:n})=>{const o=u(i).getByRole("button",{name:/Remove Speaking/});await t("Disabled chip must have disabled attribute",async()=>{a(o).toBeDisabled()}),await t("Disabled chip must not be clickable",async()=>{await l.click(o),a(n.onValueChange).not.toHaveBeenCalled(),a(o).toBeVisible()})}},v={args:{"aria-label":"Selected availabilities",defaultValue:["morning","afternoon","evening"],items:[{value:"morning",label:"Morning",icon:e.jsx(L,{})},{value:"afternoon",label:"Afternoon",icon:e.jsx(Qe,{})},{value:"evening",label:"Evening",icon:e.jsx(Xe,{})}]},play:async({canvasElement:i,step:t})=>{const s=u(i).getByRole("button",{name:/Remove Morning/}),o=u(s).getByTestId("chip-icon");await t("Chip should render an icon when `icon` prop is passed",async()=>{a(o).toBeVisible()})}},w={args:{"aria-label":"Selected languages",defaultValue:["english"],items:[{value:"english",label:"English",counter:1247},{value:"spanish",label:"Spanish",counter:892},{value:"french",label:"French",counter:534},{value:"german",label:"German",counter:421},{value:"italian",label:"Italian",counter:287},{value:"portuguese",label:"Portuguese",counter:156}]},play:async({canvasElement:i,step:t})=>{const s=u(i).getByRole("button",{name:/Remove English/}),o=u(s).getByTestId("chip-counter");await t("Chip should render a counter when `counter` prop is passed",async()=>{a(o).toBeVisible(),a(o).toHaveTextContent("1247")})}},f={args:{"aria-label":"Selected countries",defaultValue:["ua","gb","it","es","au","br","eg"],items:[{value:"ua",label:"Ukraine",countryFlagCode:"ua"},{value:"gb",label:"United Kingdom",countryFlagCode:"gb"},{value:"it",label:"Italy",countryFlagCode:"it"},{value:"es",label:"Spain",countryFlagCode:"es"},{value:"au",label:"Australia",countryFlagCode:"au"},{value:"br",label:"Brazil",countryFlagCode:"br"},{value:"eg",label:"Egypt",countryFlagCode:"eg"}]},play:async({canvasElement:i,step:t})=>{const s=u(i).getByRole("button",{name:/Remove Ukraine/}),o=u(s).getByTestId("chip-country-flag");await t("Chip should render a flag when `flagCountryCode` prop is passed",async()=>{a(o).toBeVisible()})}},k={args:{"aria-label":"Fancy chips",defaultValue:["counter+icon","counter+flag","icon+flag"],items:[{value:"counter+icon",label:"Icon + Counter",icon:e.jsx(L,{}),counter:1247},{value:"counter+flag",label:"Flag + Counter",countryFlagCode:"ua",counter:1247},{value:"icon+flag",label:"Icon + Flag",icon:e.jsx(L,{}),countryFlagCode:"ua"}]},play:async({canvasElement:i})=>{const t=u(i),n=u(t.getByRole("button",{name:"Remove Icon + Flag"}));a(n.getByTestId("chip-icon")).toBeVisible(),a(n.queryByTestId("chip-country-flag")).not.toBeInTheDocument()}},x=["2025-08-15T10:00Z","2025-08-16T12:00Z","2025-08-17T14:00Z"],B={args:{orientation:"vertical","aria-label":"Selected time slots",defaultValue:x,items:x.map(i=>({value:i,label:e.jsx(sa,{weekday:"short",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit",value:i}),dataset:{testid:i}}))},decorators:[i=>e.jsx("div",{style:{width:300,margin:"0 auto"},children:e.jsx(i,{})})],play:async({canvasElement:i,step:t})=>{const n=u(i),s=n.getByTestId(x[0]),o=n.getByTestId(x[1]),r=n.getByTestId(x[2]);await t("Focus first chip",async()=>{s.focus()}),await t("Arrow down should focus second chip",async()=>{await l.keyboard("{ArrowDown}"),a(o).toHaveFocus()}),await t("Arrow down should focus third chip",async()=>{await l.keyboard("{ArrowDown}"),a(r).toHaveFocus()}),await t("Arrow down should focus first chip",async()=>{await l.keyboard("{ArrowDown}"),a(s).toHaveFocus()}),await t("Arrow up should focus third chip",async()=>{await l.keyboard("{ArrowUp}"),a(r).toHaveFocus()})}},R={render:i=>e.jsxs(g,{gap:"12",children:[e.jsx(m,{...i}),e.jsx(H,{variant:"tertiary",size:"small",onClick:()=>alert("Show all"),children:"Show all"})]})},aa=[{value:"vocabulary",label:"Vocabulary"},{value:"speaking",label:"Speaking"},{value:"listening",label:"Listening"},{value:"reading",label:"Reading"},{value:"writing",label:"Writing"},{value:"grammar",label:"Grammar"}],ua=[{value:"monday",label:"Monday"},{value:"tuesday",label:"Tuesday"},{value:"wednesday",label:"Wednesday"},{value:"thursday",label:"Thursday"},{value:"friday",label:"Friday"},{value:"saturday",label:"Saturday"},{value:"sunday",label:"Sunday"}],da=[{value:"morning",label:"Morning (6-12)",icon:e.jsx(L,{})},{value:"afternoon",label:"Afternoon (12-18)",icon:e.jsx(Qe,{})},{value:"evening",label:"Evening (18-0)",icon:e.jsx(Xe,{})},{value:"night",label:"Night (0-6)",icon:e.jsx(na,{})}],C={render:function(t){return e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"64",children:[e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"16",children:[e.jsx(E,{variant:"large-semibold",children:"What skills do you want to focus on?"}),e.jsx(m,{"aria-label":"Selected skills",defaultValue:["vocabulary","speaking","listening"],items:aa})]}),e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"16",children:[e.jsx(E,{variant:"large-semibold",children:"Which days work best for you?"}),e.jsx(m,{"aria-label":"Selected days",defaultValue:["monday","wednesday","friday"],items:ua})]}),e.jsxs(g,{direction:"column",alignItems:"stretch",gap:"16",children:[e.jsx(E,{variant:"large-semibold",children:"What times of day work for you?"}),e.jsx(m,{"aria-label":"Selected times",defaultValue:["morning","afternoon"],items:da})]})]})},play:async({canvasElement:i,step:t})=>{const n=u(i),s=n.getByRole("button",{name:/Remove Vocabulary/}),o=n.getByRole("button",{name:/Remove Speaking/}),r=n.getByRole("button",{name:/Remove Listening/}),c=n.getByRole("button",{name:/Remove Monday/});await t("Tab once to enter the component",async()=>{await l.tab(),a(s).toHaveFocus()}),await t("Next tab should focus second chips group",async()=>{await l.tab(),a(c).toHaveFocus()}),await t("Shift+Tab should focus first chips group again",async()=>{await l.tab({shift:!0}),a(s).toHaveFocus()}),await t("Right arrow should focus next chip in the group",async()=>{await l.keyboard("{ArrowRight}"),a(o).toHaveFocus()}),await t("Left arrow should focus previous chip in the group",async()=>{await l.keyboard("{ArrowLeft}"),a(s).toHaveFocus()}),await t("Left arrow should focus last chip if first chip is focused",async()=>{await l.keyboard("{ArrowLeft}"),a(r).toHaveFocus()}),await t("Right arrow should focus first chip if last chip is focused",async()=>{await l.keyboard("{ArrowRight}"),a(s).toHaveFocus()}),await t("Focus last chip",async()=>{await l.keyboard("{ArrowLeft}")}),await t("Tab to the next group",async()=>{await l.tab()}),await t("Shift+Tab to return to the first group, the last focused chip should be focused",async()=>{await l.tab({shift:!0}),a(r).toHaveFocus()})}},pa=ra.ul`
2
2
  all: unset;
3
3
  list-style: none;
4
4
  display: flex;
@@ -1 +1 @@
1
- import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{w as r}from"./componentNames-k0j3gHgH.js";const l="Divider__o9--B",i={Divider:l,"size-small":"size-small__QrAgV","size-large":"size-large__agPv9"},s=({size:e="small"})=>a.jsx("hr",{className:`${i.Divider} ${i[`size-${e}`]}`,"data-preply-ds-component":r.Divider});try{s.displayName="Divider",s.__docgenInfo={description:"",displayName:"Divider",props:{size:{defaultValue:{value:"small"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"large"'},{value:'"small"'}]}}}}}catch{}export{s as D};
1
+ import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{w as r}from"./componentNames-k0j3gHgH.js";const l="Divider__o9--B",i={Divider:l,"size-small":"size-small__QrAgV","size-large":"size-large__agPv9"},s=({size:e="small"})=>a.jsx("hr",{className:`${i.Divider} ${i[`size-${e}`]}`,"data-preply-ds-component":r.Divider});try{s.displayName="Divider",s.__docgenInfo={description:"",displayName:"Divider",props:{size:{defaultValue:{value:"small"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"small"'},{value:'"large"'}]}}}}}catch{}export{s as D};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./jsx-runtime-BTJTZTIL.js";import{D as p}from"./Divider-BPgGsji3.js";import"./index-ChsGqxH_.js";import"./componentNames-k0j3gHgH.js";const u={title:"Components/Divider",component:p,decorators:[n=>s.jsx("div",{style:{padding:"24px 12px 48px"},children:s.jsx(n,{})})],argTypes:{size:{control:{type:"select",labels:["small","large"]}}}},r={args:{size:"small"}},e={args:{size:"large"}};var a,o,t;r.parameters={...r.parameters,docs:{...(a=r.parameters)==null?void 0:a.docs,source:{originalSource:`{
1
+ import{j as s}from"./jsx-runtime-BTJTZTIL.js";import{D as p}from"./Divider-nt4GwjWS.js";import"./index-ChsGqxH_.js";import"./componentNames-k0j3gHgH.js";const u={title:"Components/Divider",component:p,decorators:[n=>s.jsx("div",{style:{padding:"24px 12px 48px"},children:s.jsx(n,{})})],argTypes:{size:{control:{type:"select",labels:["small","large"]}}}},r={args:{size:"small"}},e={args:{size:"large"}};var a,o,t;r.parameters={...r.parameters,docs:{...(a=r.parameters)==null?void 0:a.docs,source:{originalSource:`{
2
2
  args: {
3
3
  size: 'small'
4
4
  }
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BN6VMYqa.js","./index-Cb9e4tly.js","./_commonjsHelpers-Cpj98o6Y.js","./index-ChsGqxH_.js"])))=>i.map(i=>d[i]);
2
- import{_ as c}from"./iframe-DQObBSoc.js";import{r as s,e as n}from"./index-Cb9e4tly.js";import{H as p,A as h,C as E,e as d}from"./index-xzr6a2UN.js";import{c as v}from"./client-CYxxc9KC.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-ChsGqxH_.js";import"./jsx-runtime-BTJTZTIL.js";import"./index-s7KTOhR7.js";import"./index-BPCsOyHr.js";import"./index-CA5R8PN9.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,l)=>{c(async()=>{const{MDXProvider:u}=await import("./index-BN6VMYqa.js");return{MDXProvider:u}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({MDXProvider:u})=>w(n.createElement(y,{showException:l,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};
2
+ import{_ as c}from"./iframe-DD8HN-R1.js";import{r as s,e as n}from"./index-Cb9e4tly.js";import{H as p,A as h,C as E,e as d}from"./index-GU-yTW76.js";import{c as v}from"./client-CYxxc9KC.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-ChsGqxH_.js";import"./jsx-runtime-BTJTZTIL.js";import"./index-s7KTOhR7.js";import"./index-BPCsOyHr.js";import"./index-CA5R8PN9.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,l)=>{c(async()=>{const{MDXProvider:u}=await import("./index-BN6VMYqa.js");return{MDXProvider:u}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({MDXProvider:u})=>w(n.createElement(y,{showException:l,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};