@preply/ds-docs 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/assets/{00.LayoutFlex.stories-I1L9KcKN.js → 00.LayoutFlex.stories-D-VczObO.js} +1 -1
  2. package/dist/assets/{00.applications-DVA0eR_5.js → 00.applications-CzYSGmEf.js} +1 -1
  3. package/dist/assets/{00.favicons.guide-BA4TBs8A.js → 00.favicons.guide-B-CARcAk.js} +1 -1
  4. package/dist/assets/00.token-explorer-hV-uX2Ww.js +345 -0
  5. package/dist/assets/{00.using-responsive-props-DvWa2hX7.js → 00.using-responsive-props-q9jDxHWy.js} +1 -1
  6. package/dist/assets/{01.semantic-tokens-CMnyPCuB.js → 01.semantic-tokens-phY-TgD0.js} +1 -1
  7. package/dist/assets/{01.using-shorthand-props-DfgZvMPF.js → 01.using-shorthand-props-CUZbQwLg.js} +1 -1
  8. package/dist/assets/{10.Combinations.stories-Zk1vUvHN.js → 10.Combinations.stories-BDDl05Hz.js} +1 -1
  9. package/dist/assets/{10.fonts.guide-4nDXerbt.js → 10.fonts.guide-hytCpjSP.js} +1 -1
  10. package/dist/assets/{10.ssr-BBOII78K.js → 10.ssr-CXQLuZOI.js} +1 -1
  11. package/dist/assets/{11.languageFont.explorer.stories-B4Vdpt9q.js → 11.languageFont.explorer.stories-Dkv9M5eT.js} +1 -1
  12. package/dist/assets/{11.ssr.app-router-v52x2FyK.js → 11.ssr.app-router-bEmxNK6u.js} +1 -1
  13. package/dist/assets/{20.libraries-BIoBeRPw.js → 20.libraries-Dz7mgu2C.js} +1 -1
  14. package/dist/assets/30.icons.explorer-oiyfLcQp.js +73 -0
  15. package/dist/assets/{30.storybook-DhzFfbyl.js → 30.storybook-BGbx9nQ-.js} +1 -1
  16. package/dist/assets/{40.illustrations.explorer-7gHbzv6D.js → 40.illustrations.explorer-BuiSr8c3.js} +1 -1
  17. package/dist/assets/{90.advanced-C_nJm0ZM.js → 90.advanced-BoZM3QR8.js} +1 -1
  18. package/dist/assets/{Accordion-Bi0GzCYO.js → Accordion-CxiCI4Rz.js} +3 -3
  19. package/dist/assets/{Accordion.stories-AuiZJ4NQ.js → Accordion.stories-D7Cw24sj.js} +1 -1
  20. package/dist/assets/{Accordion.tests.stories-CFXQ7lMz.js → Accordion.tests.stories-DtE9udvN.js} +1 -1
  21. package/dist/assets/{AlertDialog.stories-BqN0gz7W.js → AlertDialog.stories-Crl9ra0W.js} +1 -1
  22. package/dist/assets/Badge-BMWjsGzx.css +1 -0
  23. package/dist/assets/Badge.stories-CkGzqxM7.js +66 -0
  24. package/dist/assets/{Box.stories-CpizOdtP.js → Box.stories-Tx-88Owx.js} +1 -1
  25. package/dist/assets/{BubbleCounter.stories-CPQE-nOi.js → BubbleCounter.stories-DCyCDG7S.js} +1 -1
  26. package/dist/assets/{Button-DhteO3C6.js → Button-B80XIKcv.js} +1 -1
  27. package/dist/assets/{Button-DqlzCI4z.css → Button-Cd0upysu.css} +1 -1
  28. package/dist/assets/{Button.stories-DmzVQ1VL.js → Button.stories-BWsh38ts.js} +1 -1
  29. package/dist/assets/{ButtonBase-B_gwKVAa.js → ButtonBase-BS1Kc_U5.js} +1 -1
  30. package/dist/assets/{ButtonBase-HxlpSDVr.css → ButtonBase-Cv8JsBJE.css} +1 -1
  31. package/dist/assets/{Checkbox-BNGbflsm.js → Checkbox-0Rr3azkZ.js} +2 -2
  32. package/dist/assets/{Checkbox.stories-C_K-2uYm.js → Checkbox.stories-CklDbW2-.js} +1 -1
  33. package/dist/assets/{Checkbox.tests.stories-CsxFaHsD.js → Checkbox.tests.stories-dtDQPZYm.js} +1 -1
  34. package/dist/assets/{Chips.stories-BwZ71-HV.js → Chips.stories-CLRPrNOW.js} +1 -1
  35. package/dist/assets/Color-YHDXOIA2-CPoUziDM.js +1 -0
  36. package/dist/assets/CountryFlag-2OfagIL-.js +49 -0
  37. package/dist/assets/{CountryFlag.stories-UhDU5aPp.js → CountryFlag.stories-B9rUoQXw.js} +1 -1
  38. package/dist/assets/{CountryFlag.test.stories-kJ9jqJTG.js → CountryFlag.test.stories-C3Hz7_Cq.js} +1 -1
  39. package/dist/assets/Dialog-5t3Rt4HF.css +1 -0
  40. package/dist/assets/Dialog.stories-zkSlU40W.js +405 -0
  41. package/dist/assets/{DismissibleChips-jYvlTjTA.js → DismissibleChips-DbEsCC0J.js} +1 -1
  42. package/dist/assets/{DismissibleChips.stories-CpdIBN_g.js → DismissibleChips.stories-Bv47ROIC.js} +1 -1
  43. package/dist/assets/{Divider.stories-Dt8b4I0I.js → Divider.stories-BlFQRFSK.js} +1 -1
  44. package/dist/assets/{DocsRenderer-CFRXHY34-DHd29E9v.js → DocsRenderer-CFRXHY34-CVrIvO9U.js} +1 -1
  45. package/dist/assets/{FormControl-D9rxeKMc.js → FormControl-CPKPJ97_.js} +1 -1
  46. package/dist/assets/{FormControl.stories-Drzur_Xo.js → FormControl.stories-C6dT1HUz.js} +1 -1
  47. package/dist/assets/{Heading-BLxyLk9f.js → Heading-BKJX3nsJ.js} +2 -2
  48. package/dist/assets/{Heading.stories-DcyjKmJn.js → Heading.stories-D2N4ywNt.js} +1 -1
  49. package/dist/assets/{Icon-BkmQyVqb.js → Icon-CkCFpqfD.js} +1 -1
  50. package/dist/assets/{Icon-RSC-Cwt4AD8I.js → Icon-RSC-DeEnUUcz.js} +1 -1
  51. package/dist/assets/{Icon.stories-Dh3KvtM-.js → Icon.stories-CexhJHbi.js} +1 -1
  52. package/dist/assets/{IconButton-CqTm2jIV.js → IconButton-B-3o70a9.js} +1 -1
  53. package/dist/assets/{Input-UdhYxppR.js → Input-DeHbbC7g.js} +3 -3
  54. package/dist/assets/{IntegrationWithReactHookForm.stories-C02oiA5w.js → IntegrationWithReactHookForm.stories-DxrZ050E.js} +1 -1
  55. package/dist/assets/{IntlFormattedCurrency.stories-D09rXQbZ.js → IntlFormattedCurrency.stories-BLxRgJWU.js} +1 -1
  56. package/dist/assets/{IntlFormattedDateTime.stories-BuOwAp8C.js → IntlFormattedDateTime.stories-hYtatyHE.js} +1 -1
  57. package/dist/assets/{LayoutFlex-JDgK8BCr.js → LayoutFlex-DvBktCUC.js} +1 -1
  58. package/dist/assets/{LayoutFlexItem-bGRFvGp6.js → LayoutFlexItem-Cm3OI9f2.js} +1 -1
  59. package/dist/assets/{LayoutGrid-CGatrPKO.js → LayoutGrid-Dm6EcI-G.js} +1 -1
  60. package/dist/assets/{LayoutGrid.stories-DyBN7RV8.js → LayoutGrid.stories-CKn4Vg30.js} +1 -1
  61. package/dist/assets/{LayoutGridItem-BdIUwiuA.js → LayoutGridItem-DWhZMKvq.js} +1 -1
  62. package/dist/assets/{Link-DdFAEBXD.js → Link-D3ljGEp4.js} +1 -1
  63. package/dist/assets/{Link.stories-WQCe-o4N.js → Link.stories-DOzq9sNs.js} +1 -1
  64. package/dist/assets/{Loader.stories-Ceu9fTo6.js → Loader.stories-C53ODmdL.js} +1 -1
  65. package/dist/assets/{MultiSelectChips-Crsz1TpK.js → MultiSelectChips-RUBRF3C_.js} +2 -2
  66. package/dist/assets/{MultiSelectChips.stories-D94TLaMf.js → MultiSelectChips.stories-DbfKSXnF.js} +1 -1
  67. package/dist/assets/{NumberField-BClPzJbf.js → NumberField-B95TvbPY.js} +5 -5
  68. package/dist/assets/{NumberField.stories-Cl5bAyRn.js → NumberField.stories-CEV8efH2.js} +1 -1
  69. package/dist/assets/{ObserveIntersection-B2ZY3pJT.js → ObserveIntersection-Ds88YwOI.js} +1 -1
  70. package/dist/assets/{ObserveIntersection.stories-C8C2l5zu.js → ObserveIntersection.stories-DAfiJTnQ.js} +1 -1
  71. package/dist/assets/{OnboardingTooltip-Bc-Jj706.js → OnboardingTooltip-C5HCJ0E7.js} +1 -1
  72. package/dist/assets/{OnboardingTooltip.stories-1_99oJ2j.js → OnboardingTooltip.stories-Cn1uymI0.js} +1 -1
  73. package/dist/assets/{OnboardingTooltip.tests.stories-CIUh12pG.js → OnboardingTooltip.tests.stories-DLvBh09g.js} +1 -1
  74. package/dist/assets/{OnboardingTour-BnYumvD2.js → OnboardingTour-Cye6iUC2.js} +1 -1
  75. package/dist/assets/{OnboardingTour.stories-CaCYuehO.js → OnboardingTour.stories-D_A2LFco.js} +1 -1
  76. package/dist/assets/{OnboardingTour.tests.stories-C9M7Z4vy.js → OnboardingTour.tests.stories-D0hNfgv6.js} +1 -1
  77. package/dist/assets/{PasswordField-CFjBYGMS.js → PasswordField-DHlrM2-7.js} +5 -5
  78. package/dist/assets/{PasswordField.stories-CWrYRKg3.js → PasswordField.stories-BJWCj1u3.js} +1 -1
  79. package/dist/assets/{PreplyLogo.stories-DbHXRqIe.js → PreplyLogo.stories-dfSPndrY.js} +1 -1
  80. package/dist/assets/{ProgressBar.stories-Bj7JgZUL.js → ProgressBar.stories-BV6Y9Nyi.js} +1 -1
  81. package/dist/assets/{ProgressSteps-CwDoZPp7.js → ProgressSteps-DQE6Rlvo.js} +1 -1
  82. package/dist/assets/{ProgressSteps.stories-Eo_YRUQQ.js → ProgressSteps.stories-BKC2XSoe.js} +1 -1
  83. package/dist/assets/PromoDialog-BrI3UbB4.js +3 -0
  84. package/dist/assets/{RangeSlider-CNeCUMy9.js → RangeSlider-BXIcGg3R.js} +1 -1
  85. package/dist/assets/{RangeSlider.stories-DjAvKpFH.js → RangeSlider.stories-BNeMiH_1.js} +1 -1
  86. package/dist/assets/RootProvider-D0tv2ED1.js +1 -0
  87. package/dist/assets/{SelectField-B0-aTIgP.js → SelectField-DOoh2Y5k.js} +8 -8
  88. package/dist/assets/{SelectField.stories-YbuvDmfl.js → SelectField.stories-BiuvF5Yg.js} +1 -1
  89. package/dist/assets/{ShowOnIntersection.stories-q8aTxrQs.js → ShowOnIntersection.stories-C4LXhIWf.js} +1 -1
  90. package/dist/assets/{SingleSelectChips-CAjBrNcu.js → SingleSelectChips-BRlD7T8V.js} +2 -2
  91. package/dist/assets/{SingleSelectChips.stories-BL3YG_kg.js → SingleSelectChips.stories-dgLjjU24.js} +1 -1
  92. package/dist/assets/{Slider-CUGM3UNz.js → Slider-eGOchL2V.js} +1 -1
  93. package/dist/assets/{Slider.stories-B_pnnXYh.js → Slider.stories-C5BY4PbW.js} +1 -1
  94. package/dist/assets/Steps-hgwULI7z.js +26 -0
  95. package/dist/assets/Steps-nUB2CDHz.css +1 -0
  96. package/dist/assets/{Steps.stories-BZsILE5g.js → Steps.stories-DX7zuse4.js} +7 -5
  97. package/dist/assets/{StorybookGlobalStyle-CQSpwvw3.js → StorybookGlobalStyle-BBqRFe5S.js} +1 -1
  98. package/dist/assets/{Switch.stories-CAuFyq9X.js → Switch.stories-DU5uZxfg.js} +1 -1
  99. package/dist/assets/{Text-CjpUlaH0.js → Text-D3i9pJx6.js} +1 -1
  100. package/dist/assets/{Text.stories-C6McCecj.js → Text.stories-4sHiU0p1.js} +1 -1
  101. package/dist/assets/{TextField-DqiXpdlZ.js → TextField-BxOrYHxj.js} +5 -5
  102. package/dist/assets/{TextField-CdxeFYRX.js → TextField-DHg6sqdw.js} +1 -1
  103. package/dist/assets/{TextField.stories-gNIPEGLY.js → TextField.stories-BsanVpHj.js} +1 -1
  104. package/dist/assets/{TextHighlighted.stories-CprNxXTt.js → TextHighlighted.stories-DzvaApjE.js} +1 -1
  105. package/dist/assets/{TextInline.stories-DBDcLVOT.js → TextInline.stories-CcrREeIa.js} +1 -1
  106. package/dist/assets/{TextareaField-Bi-A9wP4.js → TextareaField-Di3uMtNN.js} +8 -8
  107. package/dist/assets/{TextareaField.stories-IC9YRmct.js → TextareaField.stories-DFrVVMtN.js} +1 -1
  108. package/dist/assets/{Toast.stories-Ce2zHmWW.js → Toast.stories-D4rvr5mq.js} +1 -1
  109. package/dist/assets/TokyoUILock-CUE2UpP8.js +1 -0
  110. package/dist/assets/{Tooltip-BbMZ4t9q.js → Tooltip--j8DCmLJ.js} +1 -1
  111. package/dist/assets/{Tooltip.stories-BH7-gDwn.js → Tooltip.stories-mWHRlqv8.js} +1 -1
  112. package/dist/assets/{Tooltip.tests.stories-YLVx7b98.js → Tooltip.tests.stories-xaUpyGEE.js} +1 -1
  113. package/dist/assets/axe-KozDj-05.js +30 -0
  114. package/dist/assets/{breakpoints-BfkEfMbw.js → breakpoints-C1DZdkak.js} +1 -1
  115. package/dist/assets/{breakpoints-CSOwlhiU.js → breakpoints-CKMjlF3s.js} +1 -1
  116. package/dist/assets/{breakpoints-2fMSmAVi.js → breakpoints-DXv9ifNm.js} +1 -1
  117. package/dist/assets/{changelog-D4Z9gpAU.js → changelog-DXlzZtLa.js} +164 -131
  118. package/dist/assets/{client-C1fTPCwG.js → client-CYxxc9KC.js} +1 -1
  119. package/dist/assets/{constants-2_-agSe-.js → constants-DVNhGTwE.js} +2 -2
  120. package/dist/assets/createRequiredContext-DqKkrhDd.js +241 -0
  121. package/dist/assets/entry-preview-Bj3Y8agB.js +10 -0
  122. package/dist/assets/{entry-preview-docs-BANZ_DRs.js → entry-preview-docs-BPlzFJFG.js} +2 -2
  123. package/dist/assets/{floating-ui.react-dom-CHDTbv7n.js → floating-ui.react-dom-B6FmGF3s.js} +1 -1
  124. package/dist/assets/{getTokenVar-BZgwkSp8.js → getTokenVar-BRt2X5rO.js} +1 -1
  125. package/dist/assets/{hover-hzsLb0mP.js → hover-COs8KLUI.js} +1 -1
  126. package/dist/assets/{hover-DNwEbkOR.js → hover-CfJVruTK.js} +1 -1
  127. package/dist/assets/{hover-CsTVkgV1.js → hover-Cy7Eox3Y.js} +1 -1
  128. package/dist/assets/{iframe-CWj9OKjo.js → iframe-CQTVRvvH.js} +18 -18
  129. package/dist/assets/index-BPCsOyHr.js +24 -0
  130. package/dist/assets/{index-DPGIb77J.js → index-Bch4g0SK.js} +1 -1
  131. package/dist/assets/index-C5uDgNEj.js +12 -0
  132. package/dist/assets/index-C6EASpUg.js +1 -0
  133. package/dist/assets/index-C9ZJlqdI.js +1 -0
  134. package/dist/assets/index-CA5R8PN9.js +8 -0
  135. package/dist/assets/{index-Ctq3gFTp.js → index-CY08ZUhp.js} +7 -7
  136. package/dist/assets/{index-DUXnyn-Y.js → index-CebKVvqm.js} +16 -16
  137. package/dist/assets/{index-Cxag6636.js → index-D21-dwfw.js} +1 -1
  138. package/dist/assets/index-DWSmmBvQ.js +12 -0
  139. package/dist/assets/{index-BPrLDK9Y.js → index-De-a_lfy.js} +1 -1
  140. package/dist/assets/{index-Y0mVPtHg.js → index-Djnd5IhU.js} +1 -1
  141. package/dist/assets/index-DrcC8Jul.js +7 -0
  142. package/dist/assets/{index-fALSPXxe.js → index-ZUOsecCC.js} +1 -1
  143. package/dist/assets/{intro-DgdQQN2S.js → intro-Cd9_GCdy.js} +1 -1
  144. package/dist/assets/{message-CToTEy-z.js → message-CSdaKtIj.js} +1 -1
  145. package/dist/assets/{migrating-from-less-CypRwYq3.js → migrating-from-less-B5ahFv2d.js} +1 -1
  146. package/dist/assets/playground-WZK9WFDf.css +1 -0
  147. package/dist/assets/playground.stories-LsAgjZgU.js +857 -0
  148. package/dist/assets/{preview-BTjEYo28.js → preview-D4qLoCiE.js} +1 -1
  149. package/dist/assets/preview-DA7QUfdZ.js +2 -0
  150. package/dist/assets/{preview-B3PTUHS7.js → preview-DPj7IDPD.js} +1 -1
  151. package/dist/assets/{preview-4uuOvD3n.js → preview-Rh2RpxtQ.js} +2 -2
  152. package/dist/assets/{preview-DnWcdrEZ.js → preview-qRpPiuhm.js} +2 -2
  153. package/dist/assets/{react-18-DfUnyR7e.js → react-18-vqCHxTgY.js} +1 -1
  154. package/dist/assets/{shared-strings-Bg7tW4tm.js → shared-strings-DFzxd8lM.js} +1 -1
  155. package/dist/assets/styled-components.browser.esm-BJAH3Qnc.js +2 -0
  156. package/dist/assets/{tokens-D0M6e07K.js → tokens-1GbBeOTN.js} +1 -1
  157. package/dist/assets/tokens-BoC65r7p.js +1 -0
  158. package/dist/assets/{tokens-D7bwo39d.js → tokens-CSYR8_6W.js} +1 -1
  159. package/dist/assets/{tokens-DbuzM4u9.js → tokens-DboIZ2E4.js} +1 -1
  160. package/dist/assets/{useIntlFormattedAggregatedDateTime-Zx_bxtfa.js → useIntlFormattedAggregatedDateTime-CTOxZyaF.js} +1 -1
  161. package/dist/assets/{useIntlFormattedCurrency-DbgTU34E.js → useIntlFormattedCurrency-CKTbRfXd.js} +1 -1
  162. package/dist/assets/{useIntlFormattedTime-ulNPTGyu.js → useIntlFormattedTime-D6quNZKT.js} +1 -1
  163. package/dist/assets/{usePortalElement-D8WArtaz.js → usePortalElement-BK-0FBHw.js} +1 -1
  164. package/dist/assets/{welcome-Cf7_knMk.js → welcome-B7wFifhG.js} +1 -1
  165. package/dist/assets/{zeroheight-BvaCHUX_.js → zeroheight-C2QkqLMf.js} +1 -1
  166. package/dist/iframe.html +1 -1
  167. package/dist/index.json +1 -1
  168. package/dist/preview-stats.json +3343 -3073
  169. package/dist/project.json +1 -1
  170. package/package.json +4 -4
  171. package/dist/assets/00.token-explorer-KIhVhPp7.js +0 -344
  172. package/dist/assets/30.icons.explorer-C3PdGI__.js +0 -73
  173. package/dist/assets/Badge-DXnHyVME.css +0 -1
  174. package/dist/assets/Badge.stories-Bk1jXWtz.js +0 -65
  175. package/dist/assets/Color-YHDXOIA2-BhKKyrEM.js +0 -1
  176. package/dist/assets/CountryFlag-BYnc9DA7.js +0 -49
  177. package/dist/assets/Dialog-B2G1UrP1.css +0 -1
  178. package/dist/assets/Dialog.stories-CI7zov84.js +0 -515
  179. package/dist/assets/RootProvider-CWDV9QnL.js +0 -1
  180. package/dist/assets/Steps-B_rpKUTa.css +0 -1
  181. package/dist/assets/Steps-IgJnFF2g.js +0 -26
  182. package/dist/assets/TokyoUILock-CENLMUf4.js +0 -1
  183. package/dist/assets/axe-mzYAM-sz.js +0 -30
  184. package/dist/assets/createRequiredContext-9__lNQrK.js +0 -241
  185. package/dist/assets/entry-preview-DFXqIYZm.js +0 -10
  186. package/dist/assets/index-BSV-0FpC.js +0 -1
  187. package/dist/assets/index-BnjE-6lp.js +0 -12
  188. package/dist/assets/index-C7hTFOIV.js +0 -24
  189. package/dist/assets/index-CXQShRbs.js +0 -8
  190. package/dist/assets/index-Cu4lwwaE.js +0 -1
  191. package/dist/assets/index-DhCCT3uz.js +0 -12
  192. package/dist/assets/index-p7qngmDT.js +0 -7
  193. package/dist/assets/playground-Dg8A_Ftj.css +0 -1
  194. package/dist/assets/playground.stories-C9cW4jxN.js +0 -857
  195. package/dist/assets/preview-BLkg3UNz.js +0 -2
  196. package/dist/assets/styled-components.browser.esm-BgpGX317.js +0 -2
  197. package/dist/assets/tokens-Xet-VKqC.js +0 -1
  198. /package/dist/assets/{Button-DwGJHj7Y.js → Button-CpB2zJ_2.js} +0 -0
@@ -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-Ctq3gFTp.js";import{C as p}from"./CountryFlag-BYnc9DA7.js";import{L as te}from"./LayoutFlex-JDgK8BCr.js";import{L as V}from"./LayoutGrid-CGatrPKO.js";import{L as i}from"./LayoutGridItem-BdIUwiuA.js";import{T as t}from"./Text-CjpUlaH0.js";import{L as ie}from"./Link-DdFAEBXD.js";import{F as m}from"./FormControl-D9rxeKMc.js";import{C as g}from"./Checkbox-BNGbflsm.js";import{T as le}from"./TextField-DqiXpdlZ.js";import{A as ne,a as de,b as ce,c as ue}from"./Accordion-Bi0GzCYO.js";import{c as h,g as u}from"./getCountryFlagUrl-CP-PpZV_.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./componentNames-NXEPEzbR.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./layout-relative.module-f40KabMD.js";import"./classNames-BUL1Zq7e.js";import"./defaults-hwJNw1bK.js";import"./breakpoints-BfMlrtxE.js";import"./layout-relative-JyjknPiU.js";import"./constants-DYYVurUY.js";import"./align-self-BpB1y0Rx.js";import"./text-accent-DZDDtpIt.js";import"./text-centered-CznToR0o.js";import"./useHostname-Y3PlXofY.js";import"./index-BlMeVLsf.js";import"./index-DhCCT3uz.js";import"./tslib.es6-C7pnyCjR.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./message-CToTEy-z.js";import"./render-icon-BT0Aq7PA.js";import"./useMergeRefs-SFH7Mw4x.js";import"./Input-UdhYxppR.js";import"./InputContainer-B1hqJyx0.js";import"./TokyoUIExpand-oMdXmNcg.js";import"./Icon-BkmQyVqb.js";const Xe={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-CY08ZUhp.js";import{C as p}from"./CountryFlag-2OfagIL-.js";import{L as te}from"./LayoutFlex-DvBktCUC.js";import{L as V}from"./LayoutGrid-Dm6EcI-G.js";import{L as i}from"./LayoutGridItem-DWhZMKvq.js";import{T as t}from"./Text-D3i9pJx6.js";import{L as ie}from"./Link-D3ljGEp4.js";import{F as m}from"./FormControl-CPKPJ97_.js";import{C as g}from"./Checkbox-0Rr3azkZ.js";import{T as le}from"./TextField-BxOrYHxj.js";import{A as ne,a as de,b as ce,c as ue}from"./Accordion-CxiCI4Rz.js";import{c as h,g as u}from"./getCountryFlagUrl-CP-PpZV_.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./componentNames-NXEPEzbR.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./layout-relative.module-f40KabMD.js";import"./classNames-BUL1Zq7e.js";import"./defaults-hwJNw1bK.js";import"./breakpoints-BfMlrtxE.js";import"./layout-relative-JyjknPiU.js";import"./constants-DYYVurUY.js";import"./align-self-BpB1y0Rx.js";import"./text-accent-DZDDtpIt.js";import"./text-centered-CznToR0o.js";import"./useHostname-Y3PlXofY.js";import"./index-BlMeVLsf.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-DeHbbC7g.js";import"./InputContainer-B1hqJyx0.js";import"./TokyoUIExpand-oMdXmNcg.js";import"./Icon-CkCFpqfD.js";const Xe={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-Ctq3gFTp.js";import{C as s}from"./CountryFlag-BYnc9DA7.js";import"./index-ChsGqxH_.js";import"./index-Cb9e4tly.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./getCountryFlagUrl-CP-PpZV_.js";import"./componentNames-NXEPEzbR.js";const k={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-CY08ZUhp.js";import{C as s}from"./CountryFlag-2OfagIL-.js";import"./index-ChsGqxH_.js";import"./index-Cb9e4tly.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./index-DdzHuZ-Y.js";import"./getCountryFlagUrl-CP-PpZV_.js";import"./componentNames-NXEPEzbR.js";const k={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,
@@ -0,0 +1 @@
1
+ .overlay__NM-kk{background-color:var(--02a0d5);position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--ds-dialog-overlay-z-index-override, auto)}@media (prefers-reduced-motion: no-preference){.overlay__NM-kk{animation-duration:var(--970975);animation-timing-function:var(--1f4492)}.overlay__NM-kk[data-state=open]{animation-name:opacityIn__ilHLV}.overlay__NM-kk[data-state=closed]{animation-name:opacityOut__YzYTK}}.Dialog__GqDxV{--dialog-padding: var(--1e685c);--slide-animation-distance: 100%;--show-animation-name: slideInUp__rqAX4;--hide-animation-name: slideOutDown__gIYOK;--content-padding-adjustment-for-close-button: calc(calc(var(--5eca09) + var(--813599) + var(--590b8d)) - var(--dialog-padding));box-sizing:border-box;background-color:var(--3546c3);position:fixed;right:0;bottom:0;left:0;top:auto;margin:auto;width:100%;max-height:100%;overflow-y:auto;overflow-x:hidden;border-top-left-radius:var(--fa4b1a);border-top-right-radius:var(--fa4b1a);box-shadow:var(--df7dbb);padding:var(--dialog-padding);z-index:var(--ds-dialog-content-z-index-override, auto)}.Dialog--fullheight__2W7sp{height:100%}.Dialog__GqDxV.no-border-radius__G2Oo3{border-radius:0}@media (prefers-reduced-motion: no-preference){.Dialog__GqDxV{animation-duration:.3s;animation-timing-function:cubic-bezier(.22,1,.36,1)}.Dialog__GqDxV[data-state=open]{animation-name:var(--show-animation-name)}.Dialog__GqDxV[data-state=closed]{animation-name:var(--hide-animation-name)}}@media (min-width: 880px){.Dialog__GqDxV{--dialog-padding: var(--f1b498);--slide-animation-distance: 40px;--show-animation-name: slideInUp__rqAX4, opacityIn__ilHLV;--hide-animation-name: slideOutDown__gIYOK, opacityOut__YzYTK;top:0;height:fit-content;border-radius:var(--fa4b1a);max-height:calc(100% - var(--42fccf))}.Dialog__GqDxV.slidesUp__YIWbY{--hide-animation-name: slideOutUp__h8Uo-, opacityOut__YzYTK}.Dialog--size-xs__W0yGm{width:440px;height:fit-content}.Dialog--size-sm__rE3Y-{width:520px;height:fit-content}.Dialog--size-md__HWxI4{width:640px;height:fit-content}.Dialog--size-lg__Lis4-{width:840px;height:fit-content}}@media (min-width: 880px) and (min-width: 400px){.Dialog--narrow-l--size-xs__ljCvr{width:440px;height:fit-content}}@media (min-width: 880px) and (min-width: 700px){.Dialog--medium-s--size-xs__t-4Ow{width:440px;height:fit-content}}@media (min-width: 880px) and (min-width: 880px){.Dialog--medium-l--size-xs__yc1ae{width:440px;height:fit-content}}@media (min-width: 880px) and (min-width: 1200px){.Dialog--wide-s--size-xs__Id0f5{width:440px;height:fit-content}}@media (min-width: 880px) and (min-width: 1900px){.Dialog--wide-l--size-xs__Pnlyp{width:440px;height:fit-content}}@media (min-width: 880px) and (min-width: 400px){.Dialog--narrow-l--size-sm__M8-BH{width:520px;height:fit-content}}@media (min-width: 880px) and (min-width: 700px){.Dialog--medium-s--size-sm__UPlli{width:520px;height:fit-content}}@media (min-width: 880px) and (min-width: 880px){.Dialog--medium-l--size-sm__nAW8A{width:520px;height:fit-content}}@media (min-width: 880px) and (min-width: 1200px){.Dialog--wide-s--size-sm__i0pbj{width:520px;height:fit-content}}@media (min-width: 880px) and (min-width: 1900px){.Dialog--wide-l--size-sm__PghJ-{width:520px;height:fit-content}}@media (min-width: 880px) and (min-width: 400px){.Dialog--narrow-l--size-md__8jZY3{width:640px;height:fit-content}}@media (min-width: 880px) and (min-width: 700px){.Dialog--medium-s--size-md__dQ1TZ{width:640px;height:fit-content}}@media (min-width: 880px) and (min-width: 880px){.Dialog--medium-l--size-md__kcNF8{width:640px;height:fit-content}}@media (min-width: 880px) and (min-width: 1200px){.Dialog--wide-s--size-md__KDVax{width:640px;height:fit-content}}@media (min-width: 880px) and (min-width: 1900px){.Dialog--wide-l--size-md__mV57k{width:640px;height:fit-content}}@media (min-width: 880px) and (min-width: 400px){.Dialog--narrow-l--size-lg__h5Tdx{width:840px;height:fit-content}}@media (min-width: 880px) and (min-width: 700px){.Dialog--medium-s--size-lg__qci5k{width:840px;height:fit-content}}@media (min-width: 880px) and (min-width: 880px){.Dialog--medium-l--size-lg__JCkaM{width:840px;height:fit-content}}@media (min-width: 880px) and (min-width: 1200px){.Dialog--wide-s--size-lg__eJlxf{width:840px;height:fit-content}}@media (min-width: 880px) and (min-width: 1900px){.Dialog--wide-l--size-lg__mo796{width:840px;height:fit-content}}.Dialog__GqDxV>.close__e4axJ{position:absolute;top:var(--813599);right:var(--813599);z-index:1}.Dialog__GqDxV:has(.footer__9qu1N){padding-bottom:0}.scrollEndDetector__gqxi-{height:1px;margin-top:-1px}.header__2EPvy{padding-right:var(--content-padding-adjustment-for-close-button, unset);margin-bottom:var(--b53873);display:flex;flex-direction:column;gap:var(--558c4c)}.header__2EPvy>hgroup{display:flex;flex-direction:column;gap:var(--590b8d);flex:1}@media (min-width: 880px){.header__2EPvy>hgroup{gap:var(--66b80b)}}.header__2EPvy[hidden]{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (min-width: 880px){.header__2EPvy{margin-bottom:var(--1e685c);gap:var(--b53873)}}.footer__9qu1N{padding:var(--dialog-padding);margin-inline:calc(-1 * var(--dialog-padding));background-color:var(--3546c3);position:sticky;bottom:0;border-top:1px solid transparent;transition:border-color var(--970975) var(--1f4492)}.footer__9qu1N.sticky__04F4C{border-color:var(--c03289)}.actions__hIL-J{display:flex;flex-direction:column-reverse;gap:var(--813599)}@media (min-width: 400px){.actions__hIL-J{flex-direction:row;justify-content:flex-end}}.stepsActions__PtYxS{display:flex;flex-wrap:wrap-reverse;gap:var(--813599)}.stepsActions__PtYxS .previous__0eong{flex:1}.stepsActions__PtYxS .previous__0eong [data-preply-ds-component=Button]{padding-inline:var(--558c4c)}@media (min-width: 700px){.stepsActions__PtYxS .previous__0eong{margin-left:calc(-1 * (var(--0b1b71) + var(--558c4c)))}}.stepsActions__PtYxS .next__r4NuY{flex:666}.stepsActions__PtYxS .next__r4NuY:only-child{margin-left:auto}@media (min-width: 700px){.stepsActions__PtYxS{justify-content:space-between}.stepsActions__PtYxS .previous__0eong,.stepsActions__PtYxS .next__r4NuY{flex:unset}}@keyframes opacityIn__ilHLV{0%{opacity:0}to{opacity:1}}@keyframes opacityOut__YzYTK{0%{opacity:1}to{opacity:0}}@keyframes slideInUp__rqAX4{0%{transform:translateY(var(--slide-animation-distance))}to{transform:translateY(0)}}@keyframes slideOutDown__gIYOK{0%{transform:translateY(0)}to{transform:translateY(var(--slide-animation-distance))}}@keyframes slideOutUp__h8Uo-{0%{transform:translateY(0)}to{transform:translateY(calc(-1 * var(--slide-animation-distance)))}}
@@ -0,0 +1,405 @@
1
+ import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{r as m}from"./index-Cb9e4tly.js";import{a as y}from"./chunk-D5ZWXAHU-BhFjjRSl.js";import{f as vt,u as f,a as B,e as r}from"./index-CY08ZUhp.js";import{S as O,u as gt}from"./Steps-hgwULI7z.js";import{T as yt,D as ht,R as ft,P as bt,O as xt,C as St,a as Dt}from"./index-D21-dwfw.js";import{F as Bt}from"./TokyoUIClose-thK8sk63.js";import{I as wt}from"./IconButton-B-3o70a9.js";import{g as _t}from"./shared-strings-DFzxd8lM.js";import{u as Ct}from"./index-DWSmmBvQ.js";import{H as Tt}from"./Heading-BKJX3nsJ.js";import{T as kt}from"./Text-D3i9pJx6.js";import{u as It}from"./PortalElementProvider-CxdFl3yP.js";import{g as zt}from"./index-DdzHuZ-Y.js";import{w as X}from"./componentNames-NXEPEzbR.js";import{m as Vt,s as Rt,b as Pt}from"./classNames-BUL1Zq7e.js";import{B as v}from"./Button-B80XIKcv.js";import{A as Et}from"./Avatar-B08JWd24.js";import{F as qt}from"./TokyoUIInfo-DbkQBubr.js";import{N as Nt}from"./NumberField-B95TvbPY.js";import{I as jt}from"./Icon-CkCFpqfD.js";import"./index-ChsGqxH_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./v4-CtRu48qb.js";import"./ProgressSteps-DQE6Rlvo.js";import"./message-CSdaKtIj.js";import"./tslib.es6-C7pnyCjR.js";import"./index-De-a_lfy.js";import"./index-BPCsOyHr.js";import"./index-BlMeVLsf.js";import"./Combination-IIMvWCmY.js";import"./render-icon-BT0Aq7PA.js";import"./ButtonBase-BS1Kc_U5.js";import"./filterAttributesPassedByRadixUIAtRuntime-B7QTVwVw.js";import"./Spinner-BcQ2TyFf.js";import"./defaults-hwJNw1bK.js";import"./useMergeRefs-SFH7Mw4x.js";import"./useHostname-Y3PlXofY.js";import"./index-CC6DAVyL.js";import"./hoist-non-react-statics.cjs-C-Qo8PK8.js";import"./text-accent-DZDDtpIt.js";import"./text-centered-CznToR0o.js";import"./constants--ewUoBsO.js";import"./FormControl-CPKPJ97_.js";import"./Input-DeHbbC7g.js";import"./InputContainer-B1hqJyx0.js";const At="overlay__NM-kk",Ht="opacityIn__ilHLV",Ot="opacityOut__YzYTK",Ft="Dialog__GqDxV",Ut="slideInUp__rqAX4",Wt="slideOutDown__gIYOK",Lt="slidesUp__YIWbY",Mt="slideOutUp__h8Uo-",Jt="close__e4axJ",Gt="footer__9qu1N",Xt="scrollEndDetector__gqxi-",Yt="header__2EPvy",Kt="sticky__04F4C",Zt="actions__hIL-J",$t="stepsActions__PtYxS",Qt="previous__0eong",ea="next__r4NuY",s={overlay:At,opacityIn:Ht,opacityOut:Ot,Dialog:Ft,slideInUp:Ut,slideOutDown:Wt,"Dialog--fullheight":"Dialog--fullheight__2W7sp","no-border-radius":"no-border-radius__G2Oo3",slidesUp:Lt,slideOutUp:Mt,"Dialog--size-xs":"Dialog--size-xs__W0yGm","Dialog--size-sm":"Dialog--size-sm__rE3Y-","Dialog--size-md":"Dialog--size-md__HWxI4","Dialog--size-lg":"Dialog--size-lg__Lis4-","Dialog--narrow-l--size-xs":"Dialog--narrow-l--size-xs__ljCvr","Dialog--medium-s--size-xs":"Dialog--medium-s--size-xs__t-4Ow","Dialog--medium-l--size-xs":"Dialog--medium-l--size-xs__yc1ae","Dialog--wide-s--size-xs":"Dialog--wide-s--size-xs__Id0f5","Dialog--wide-l--size-xs":"Dialog--wide-l--size-xs__Pnlyp","Dialog--narrow-l--size-sm":"Dialog--narrow-l--size-sm__M8-BH","Dialog--medium-s--size-sm":"Dialog--medium-s--size-sm__UPlli","Dialog--medium-l--size-sm":"Dialog--medium-l--size-sm__nAW8A","Dialog--wide-s--size-sm":"Dialog--wide-s--size-sm__i0pbj","Dialog--wide-l--size-sm":"Dialog--wide-l--size-sm__PghJ-","Dialog--narrow-l--size-md":"Dialog--narrow-l--size-md__8jZY3","Dialog--medium-s--size-md":"Dialog--medium-s--size-md__dQ1TZ","Dialog--medium-l--size-md":"Dialog--medium-l--size-md__kcNF8","Dialog--wide-s--size-md":"Dialog--wide-s--size-md__KDVax","Dialog--wide-l--size-md":"Dialog--wide-l--size-md__mV57k","Dialog--narrow-l--size-lg":"Dialog--narrow-l--size-lg__h5Tdx","Dialog--medium-s--size-lg":"Dialog--medium-s--size-lg__qci5k","Dialog--medium-l--size-lg":"Dialog--medium-l--size-lg__JCkaM","Dialog--wide-s--size-lg":"Dialog--wide-s--size-lg__eJlxf","Dialog--wide-l--size-lg":"Dialog--wide-l--size-lg__mo796",close:Jt,footer:Gt,scrollEndDetector:Xt,header:Yt,sticky:Kt,actions:Zt,stepsActions:$t,previous:Qt,next:ea},j=({className:t="",children:a})=>{const n=m.useRef(null),l=m.useRef(null);return m.useLayoutEffect(()=>{if(!l.current||!n.current)return;const i=new IntersectionObserver(([o])=>{var d,p;o.isIntersecting?(d=l.current)==null||d.classList.remove(s.sticky):(p=l.current)==null||p.classList.add(s.sticky)},{root:l.current.closest("[role=dialog]"),rootMargin:`0px 0px -${l.current.offsetHeight}px 0px`});return i.observe(n.current),()=>i.disconnect()},[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:s.scrollEndDetector,ref:n}),e.jsx("div",{className:`${s.footer} ${t}`,ref:l,children:a})]})};try{j.displayName="DialogFooter",j.__docgenInfo={description:"",displayName:"DialogFooter",props:{className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"enum",value:[{value:"string"}]}}}}}catch{}const U=({primaryButton:t,secondaryButton:a})=>{const n=m.useCallback(l=>{var i;(i=l.currentTarget.closest("[role=dialog]"))==null||i.classList.add(s.slidesUp)},[]);return e.jsxs(j,{className:s.actions,children:[a,e.jsx("div",{style:{display:"contents"},onClick:n,children:t})]})};try{U.displayName="DialogActions",U.__docgenInfo={description:"",displayName:"DialogActions",props:{primaryButton:{defaultValue:null,description:`Primary action button.
2
+ @example <DialogActions
3
+ primaryButton={<Button size="medium" variant="primary" onClick={() => {}}>Let's go</Button>}
4
+ />`,name:"primaryButton",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},secondaryButton:{defaultValue:null,description:`Secondary action button.
5
+ @example <DialogActions
6
+ secondaryButton={<Button size="medium" variant="tertiary" onClick={() => {}}>Cancel</Button>}
7
+ />`,name:"secondaryButton",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}const W=O,L=O.Step,A=O.Next,H=O.Previous;function M({primaryButton:t,nextButton:a=e.jsx(A,{}),previousButton:n=e.jsx(H,{})}){const{currentStep:l,totalSteps:i}=gt(),o=l===1,d=l===i;return e.jsxs(j,{className:s.stepsActions,children:[!o&&e.jsx("div",{className:s.previous,children:n}),e.jsx("div",{className:s.next,children:d?t:a})]})}try{M.displayName="DialogStepsActions",M.__docgenInfo={description:"Wrapper around the Steps actions for usage in Dialog.",displayName:"DialogStepsActions",props:{primaryButton:{defaultValue:null,description:`Primary action button.
8
+
9
+ This button will be displayed on the last step.
10
+ @example <DialogStepsActions
11
+ primaryButton={<Button size="medium" variant="primary" onClick={() => {}}>Finish</Button>}
12
+ />`,name:"primaryButton",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},nextButton:{defaultValue:{value:"<DialogStepsNext />"},description:`Next step button.
13
+
14
+ This button will be used on all steps except the last one. When not provided, a default button will be used.
15
+ @example <DialogStepsActions
16
+ nextButton={<DialogStepsNext onClick={() => {}}>Next</DialogStepsNext>}
17
+ />`,name:"nextButton",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},previousButton:{defaultValue:{value:"<DialogStepsPrevious />"},description:`Previous step button.
18
+
19
+ This button will be used on all steps except the first one. When not provided, a default button will be used.
20
+ @example <DialogStepsActions
21
+ previousButton={<DialogStepsPrevious onClick={() => {}}>Previous</DialogStepsPrevious>}
22
+ />`,name:"previousButton",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}try{W.displayName="DialogSteps",W.__docgenInfo={description:"",displayName:"DialogSteps",props:{"aria-label":{defaultValue:null,description:`A description of the step flow and its content for screen readers.
23
+ @example 'Onboarding Steps', 'Checkout Steps', 'Survey Steps', etc.`,name:"aria-label",required:!0,type:{name:"string"}},initialStep:{defaultValue:{value:"1"},description:"The initial step to start at (from `1` to `children.length`).",name:"initialStep",required:!1,type:{name:"enum",value:[{value:"number"}]}},onStepChange:{defaultValue:null,description:`Optional callback to control navigation between steps.
24
+
25
+ This is triggered either by using the \`Steps.Previous\` and \`Steps.Next\`
26
+ components, or by calling \`goToPreviousStep\`, \`goToNextStep\`, or
27
+ \`goToStep\` from the \`StepsContext\`.
28
+
29
+ Can be used to:
30
+ - Skip/redirect steps conditionally
31
+ - Perform async process (e.g. validation) on step changes, marking the
32
+ element as busy/loading
33
+ @param currentStep The current step (1-based)
34
+ @param nextStep The next, incoming step
35
+ @returns Promise that resolves to:
36
+ - \`undefined\`: proceed with default navigation
37
+ - \`number\`: override the destination step
38
+ @example Add async validation
39
+ const handleStepChange = async (current, next) => {
40
+ await validateStep(current);
41
+ return next;
42
+ };
43
+ @example Skip a step
44
+ const handleStepChange = async (current, next) => {
45
+ if (next === 2) return 3; // Skip step 2
46
+ return next;
47
+ };`,name:"onStepChange",required:!1,type:{name:"enum",value:[{value:"(currentStep: number, nextStep: number) => number | Promise<number | undefined> | undefined"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}try{L.displayName="DialogStep",L.__docgenInfo={description:"",displayName:"DialogStep",props:{title:{defaultValue:null,description:"Main heading for the step.",name:"title",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},description:{defaultValue:null,description:"Optional description text displayed below the title.",name:"description",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},hideHeader:{defaultValue:null,description:"If true, hides the step title and description.",name:"hideHeader",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},children:{defaultValue:null,description:"Step content.",name:"children",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}try{A.displayName="DialogStepsNext",A.__docgenInfo={description:"",displayName:"DialogStepsNext",props:{size:{defaultValue:null,description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"small"'},{value:'"medium"'},{value:'"large"'},{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"xl"'},{value:"ResponsiveProp<ButtonSize>"}]}},variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"quaternary"'},{value:'"ghost"'},{value:'"plain"'},{value:'"dangerous"'},{value:'"critical"'},{value:'"onColor"'},{value:'"classroom"'},{value:'"primaryB2b"'},{value:'"primaryTutor"'},{value:'"inverted"'},{value:'"newFeature"'},{value:'"ai"'}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"enum",value:[{value:"string"}]}},fullWidth:{defaultValue:null,description:"",name:"fullWidth",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},wrap:{defaultValue:null,description:"",name:"wrap",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},href:{defaultValue:null,description:"",name:"href",required:!1,type:{name:"enum",value:[{value:"string"}]}},download:{defaultValue:null,description:"",name:"download",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},opensInNewTab:{defaultValue:null,description:"",name:"opensInNewTab",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},nofollow:{defaultValue:null,description:"",name:"nofollow",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},submitsForm:{defaultValue:null,description:"",name:"submitsForm",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},assistiveText:{defaultValue:null,description:"",name:"assistiveText",required:!1,type:{name:"enum",value:[{value:"string"}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},busy:{defaultValue:null,description:"Replaces the content with a loading indicator.",name:"busy",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},as:{defaultValue:null,description:`Custom element to render the button.
48
+
49
+ Allows rendering the button using a different React element or component.
50
+ This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
51
+ @example // Render as a react router link component
52
+ import { Link } from 'react-router-dom';
53
+
54
+ <ButtonBase as={<Link to="/home" />} />`,name:"as",required:!1,type:{name:"enum",value:[{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},url:{defaultValue:null,description:"@deprecated Use `href` instead",name:"url",required:!1,type:{name:"enum",value:[{value:"string"}]}},a11yLabel:{defaultValue:null,description:"@deprecated Use `assistiveText` instead",name:"a11yLabel",required:!1,type:{name:"enum",value:[{value:"string"}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
55
+ @example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
56
+
57
+ <Button leadingSvgIcon={TokyoUITag}>Button</Button>
58
+ or
59
+ <Button leadingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"leadingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},trailingSvgIcon:{defaultValue:null,description:`@deprecated Trailing icons have been removed from the platform.
60
+
61
+ The trailing SVG icon.
62
+ @example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
63
+
64
+ <Button trailingSvgIcon={TokyoUITag}>Button</Button>
65
+ or
66
+ <Button trailingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"trailingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | HTMLButtonElement | null) => void"},{value:"RefObject<HTMLAnchorElement | HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}try{H.displayName="DialogStepsPrevious",H.__docgenInfo={description:"",displayName:"DialogStepsPrevious",props:{size:{defaultValue:null,description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"small"'},{value:'"medium"'},{value:'"large"'},{value:'"xs"'},{value:'"s"'},{value:'"m"'},{value:'"l"'},{value:'"xl"'},{value:"ResponsiveProp<ButtonSize>"}]}},variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"quaternary"'},{value:'"ghost"'},{value:'"plain"'},{value:'"dangerous"'},{value:'"critical"'},{value:'"onColor"'},{value:'"classroom"'},{value:'"primaryB2b"'},{value:'"primaryTutor"'},{value:'"inverted"'},{value:'"newFeature"'},{value:'"ai"'}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"enum",value:[{value:"string"}]}},fullWidth:{defaultValue:null,description:"",name:"fullWidth",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"},{value:"ResponsiveProp<boolean>"}]}},wrap:{defaultValue:null,description:"",name:"wrap",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},href:{defaultValue:null,description:"",name:"href",required:!1,type:{name:"enum",value:[{value:"string"}]}},download:{defaultValue:null,description:"",name:"download",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},opensInNewTab:{defaultValue:null,description:"",name:"opensInNewTab",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},nofollow:{defaultValue:null,description:"",name:"nofollow",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},submitsForm:{defaultValue:null,description:"",name:"submitsForm",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},assistiveText:{defaultValue:null,description:"",name:"assistiveText",required:!1,type:{name:"enum",value:[{value:"string"}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"enum",value:[{value:"MouseEventHandler"}]}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},busy:{defaultValue:null,description:"Replaces the content with a loading indicator.",name:"busy",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},as:{defaultValue:null,description:`Custom element to render the button.
67
+
68
+ Allows rendering the button using a different React element or component.
69
+ This is particularly useful for integrating with router libraries like \`react-router\` or \`next/router\`.
70
+ @example // Render as a react router link component
71
+ import { Link } from 'react-router-dom';
72
+
73
+ <ButtonBase as={<Link to="/home" />} />`,name:"as",required:!1,type:{name:"enum",value:[{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},url:{defaultValue:null,description:"@deprecated Use `href` instead",name:"url",required:!1,type:{name:"enum",value:[{value:"string"}]}},a11yLabel:{defaultValue:null,description:"@deprecated Use `assistiveText` instead",name:"a11yLabel",required:!1,type:{name:"enum",value:[{value:"string"}]}},leadingSvgIcon:{defaultValue:null,description:`The leading SVG icon.
74
+ @example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
75
+
76
+ <Button leadingSvgIcon={TokyoUITag}>Button</Button>
77
+ or
78
+ <Button leadingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"leadingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},trailingSvgIcon:{defaultValue:null,description:`@deprecated Trailing icons have been removed from the platform.
79
+
80
+ The trailing SVG icon.
81
+ @example import TokyoUITag from '@preply/ds-media-icons/dist/24/TokyoUITag.svg';
82
+
83
+ <Button trailingSvgIcon={TokyoUITag}>Button</Button>
84
+ or
85
+ <Button trailingSvgIcon={<TokyoUITag />}>Button</Button>`,name:"trailingSvgIcon",required:!1,type:{name:"enum",value:[{value:"ComponentClass<SVGAttributes<SVGElement>, any>"},{value:"FunctionComponent<SVGAttributes<SVGElement>>"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"}]}},ref:{defaultValue:null,description:"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}",name:"ref",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"(instance: HTMLAnchorElement | HTMLButtonElement | null) => void"},{value:"RefObject<HTMLAnchorElement | HTMLButtonElement>"}]}},key:{defaultValue:null,description:"",name:"key",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"bigint"}]}}}}}catch{}const J=({title:t,description:a,hidden:n,leadingElement:l=null})=>e.jsxs("header",{className:s.header,hidden:n,children:[l,e.jsxs("hgroup",{children:[e.jsx(yt,{asChild:!0,children:e.jsx(Tt,{tag:"h3",variant:{_:"medium","medium-l":"large"},children:t})}),a&&e.jsx(ht,{asChild:!0,children:e.jsx(kt,{variant:"default-regular",accent:"secondary",children:a})})]})]});try{J.displayName="DialogHeader",J.__docgenInfo={description:"",displayName:"DialogHeader",props:{title:{defaultValue:null,description:"Title displayed in the dialog header",name:"title",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},description:{defaultValue:null,description:"Optional description displayed below the title",name:"description",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},hidden:{defaultValue:{value:"false"},description:`When true, visually hides the header (title and description) while
86
+ keeping it accessible to screen readers`,name:"hidden",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},leadingElement:{defaultValue:{value:"null"},description:`Optional leading element displayed above the title.
87
+ Might be an icon or an avatar.
88
+ @example import TokyoUINotesWithPad from '@preply/ds-media-icons/dist/24/TokyoUINotesWithPad.svg';
89
+
90
+ <Dialog
91
+ leadingElement={
92
+ <Icon size="32" svg={TokyoUINotesWithPad} />
93
+ }
94
+ />
95
+ @example <Dialog
96
+ leadingElement={
97
+ <Avatar size="48" src="https://example.com/avatar.jpg" />
98
+ }
99
+ />`,name:"leadingElement",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}}}}}catch{}const G=({open:t,title:a,description:n,leadingElement:l,children:i,size:o="md",hideHeader:d,onClose:p,mobileFullHeight:F,dataset:rt})=>{const{formatMessage:ot}=Ct(),st=It(),ut=ta(t),dt=zt(rt,{preplyDsComponent:X.Dialog}),ct=Vt(s,X.Dialog,[Rt("size",o),Pt("fullheight",void 0,F)]).join(" "),mt=m.useCallback(pt=>{pt||p==null||p()},[p]);return e.jsx(ft,{open:t,onOpenChange:mt,children:e.jsxs(bt,{container:st,children:[e.jsx(xt,{className:s.overlay,"data-testid":"dialog-overlay"}),e.jsxs(St,{...dt,ref:ut,className:ct,children:[e.jsx(J,{title:a,description:n,hidden:d,leadingElement:l}),e.jsx("div",{className:s.close,children:e.jsx(Dt,{asChild:!0,children:e.jsx(wt,{size:"small",variant:"ghost",dataset:{testid:"dialog-close"},assistiveText:ot(_t.close),svg:Bt})})}),i]})]})})};function ta(t){const[a,n]=m.useState(null),l=m.useCallback(i=>n(i),[]);return m.useEffect(()=>{if(!t||!a)return;const i=async()=>{const d=a.getAnimations().map(F=>F.finished);await Promise.allSettled(d);const{y:p}=a.getBoundingClientRect();a.classList.toggle(s["no-border-radius"],p===0)};i(),window.addEventListener("resize",i);const o=new ResizeObserver(i);return o.observe(a),()=>{window.removeEventListener("resize",i),o.disconnect()}},[t,a]),l}try{G.displayName="Dialog",G.__docgenInfo={description:"",displayName:"Dialog",props:{title:{defaultValue:null,description:"Title displayed in the dialog header",name:"title",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},description:{defaultValue:null,description:"Optional description displayed below the title",name:"description",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},leadingElement:{defaultValue:null,description:`Optional leading element displayed above the title.
100
+ Might be an icon or an avatar.
101
+ @example import TokyoUINotesWithPad from '@preply/ds-media-icons/dist/24/TokyoUINotesWithPad.svg';
102
+
103
+ <Dialog
104
+ leadingElement={
105
+ <Icon size="32" svg={TokyoUINotesWithPad} />
106
+ }
107
+ />
108
+ @example <Dialog
109
+ leadingElement={
110
+ <Avatar size="48" src="https://example.com/avatar.jpg" />
111
+ }
112
+ />`,name:"leadingElement",required:!1,type:{name:"enum",value:[{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},open:{defaultValue:null,description:"Controls the visibility of the dialog",name:"open",required:!0,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},children:{defaultValue:null,description:"Content to be rendered inside the dialog",name:"children",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:"null"},{value:"string"},{value:"number"},{value:"false"},{value:"true"},{value:"ReactElement<any, string | JSXElementConstructor<any>>"},{value:"Iterable<ReactNode>"},{value:"ReactPortal"}]}},size:{defaultValue:{value:"md"},description:`Controls the width of the dialog on desktop
113
+ @deprecated use default size for all dialogs`,name:"size",required:!1,type:{name:"enum",value:[{value:'"xs"'},{value:'"md"'},{value:'"sm"'},{value:'"lg"'},{value:'ResponsiveProp<"xs" | "md" | "sm" | "lg">'}]}},hideHeader:{defaultValue:{value:"false"},description:`When true, visually hides the header (title and description) while
114
+ keeping it accessible to screen readers`,name:"hideHeader",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},onClose:{defaultValue:null,description:`Callback fired when the user tries to close the dialog (via escape
115
+ key, overlay click, or close button).`,name:"onClose",required:!1,type:{name:"enum",value:[{value:"() => void"}]}},mobileFullHeight:{defaultValue:null,description:"Makes the Dialog take up the full screen height on mobile screens, i.e.\nscreens under the `medium-l` breakpoint.",name:"mobileFullHeight",required:!1,type:{name:"enum",value:[{value:"false"},{value:"true"}]}},dataset:{defaultValue:null,description:"",name:"dataset",required:!1,type:{name:"enum",value:[{value:"Dataset"}]}}}}}catch{}const c=Object.assign(G,{Actions:U,Steps:W,Step:L,StepsActions:M,StepsNext:A,StepsPrevious:H}),g=()=>e.jsx("div",{style:{width:"100%",height:"200px",background:"linear-gradient(to bottom, color-mix(in srgb, #e0e0e0, transparent), #e0e0e0)"}});let it=()=>{};const aa=(t,a)=>{const[n,l]=m.useState(a.args.open);it=()=>l(!1);const i=()=>{var o,d;l(!1),(d=(o=a.args).onClose)==null||d.call(o)};return e.jsxs(e.Fragment,{children:[e.jsx(v,{dataset:{testid:"trigger"},onClick:()=>l(!0),children:"Open"}),e.jsx(t,{args:{...a.args,open:n,onClose:i}})]})},u={title:"Components/Dialog",component:c,parameters:{docs:{story:{inline:!1,height:600}}},decorators:[aa],args:{onClose:vt(),children:e.jsx(g,{}),dataset:{testid:"dialog"}},play:async({canvas:t,step:a})=>{await a("Open dialog",async()=>{const n=t.getByTestId("trigger");return await f.click(n),B(()=>{r(t.getByTestId("dialog")).toBeVisible()})})}},w={args:{title:"Dialog title",children:e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(c.Actions,{primaryButton:e.jsx(v,{size:"medium",variant:"primary",onClick:()=>{y("Primary button clicked"),it()},children:"Primary"}),secondaryButton:e.jsx(v,{size:"medium",variant:"tertiary",onClick:y("Secondary button clicked"),children:"Secondary"})})]})}},_={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"}},b={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"}},na=()=>{const[t,a]=m.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(Nt,{label:"Child count",value:t,onChange:n=>a(parseInt(n.target.value)),required:!0}),e.jsx("br",{}),Array.from({length:t},(n,l)=>e.jsx(g,{},l))]})},I={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(na,{}),e.jsx(c.Actions,{primaryButton:e.jsx(v,{size:"medium",variant:"primary",onClick:y("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(v,{size:"medium",variant:"tertiary",onClick:y("Secondary button clicked"),children:"Secondary"})})]})}},z={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}},V={args:{title:"Visually Hidden Title",description:"This header is hidden visually but still accessible to screen readers",hideHeader:!0}},R={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(c.Actions,{primaryButton:e.jsx(v,{size:"medium",variant:"primary",onClick:y("Primary button clicked"),children:"Primary"})})]})}},P={args:{title:"Dialog Title",description:"This is the dialog description.",children:e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(c.Actions,{primaryButton:e.jsx(v,{size:"medium",variant:"primary",onClick:y("Primary button clicked"),children:"Primary"}),secondaryButton:e.jsx(v,{size:"medium",variant:"tertiary",onClick:y("Secondary button clicked"),children:"Secondary"})})]})}},x={args:{title:"Hidden Dialog Title",hideHeader:!0,children:e.jsx(e.Fragment,{children:e.jsxs(c.Steps,{"aria-label":"Onboarding Steps",children:[e.jsx(c.Step,{title:"Profile",description:"Tell us more about yourself",children:e.jsx(g,{})}),e.jsx(c.Step,{title:"Subject",description:"What do you want to learn?",children:e.jsx(g,{})}),e.jsx(c.Step,{title:"Availability",description:"When are you available?",children:e.jsx(g,{})}),e.jsx(c.StepsActions,{primaryButton:e.jsx(v,{size:"medium",variant:"primary",onClick:y("Primary button clicked"),children:"Primary"})})]})})},play:async t=>{var l;await((l=u.play)==null?void 0:l.call(u,t));const{canvas:a,step:n}=t;await n("Initially, only next button is present",async()=>{r(a.queryByRole("button",{name:"Next"})).toBeVisible(),r(a.queryByRole("button",{name:"Previous"})).not.toBeInTheDocument(),r(a.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await n("Navigate to the next step. Previous/Next buttons are visible",async()=>{await f.click(a.getByRole("button",{name:"Next"})),r(a.queryByRole("button",{name:"Previous"})).toBeVisible(),r(a.queryByRole("button",{name:"Next"})).toBeVisible(),r(a.queryByRole("button",{name:"Primary"})).not.toBeInTheDocument()}),await n("Navigate to the last step. Previous/Primary buttons are visible",async()=>{await f.click(a.getByRole("button",{name:"Next"})),r(a.queryByRole("button",{name:"Previous"})).toBeVisible(),r(a.queryByRole("button",{name:"Primary"})).toBeVisible(),r(a.queryByRole("button",{name:"Next"})).not.toBeInTheDocument()})}},S={args:{leadingElement:e.jsx(jt,{size:"32",svg:qt}),title:"Information Dialog"}},D={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"}},h=t=>(m.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(c,{...t,title:"ZIndex Override"})}));h.parameters={docs:{source:{type:"code"}}};h.play=async({canvas:t,step:a})=>{await a("Open alert",async()=>(await f.click(t.getByTestId("trigger")),B(()=>{const n=t.getByTestId("dialog");r(n).toBeVisible()}))),await a("Check content's computed z-index",async()=>{const n=t.getByTestId("dialog"),l=getComputedStyle(n);r(l.zIndex).toBe("77")}),await a("Check overlay's computed z-index",async()=>{const n=t.getByTestId("dialog").previousElementSibling;if(!n)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 l=getComputedStyle(n);r(l.zIndex).toBe("88")})};const E={tags:["!autodocs","!dev"],args:{title:"Test Close Button"},play:async t=>{var i;await((i=u.play)==null?void 0:i.call(u,t));const{canvas:a,step:n,args:l}=t;await n("Close dialog using close button",async()=>{const o=a.getByTestId("dialog-close");return await f.click(o),B(async()=>(await r(a.getByTestId("dialog")).not.toBeVisible(),r(l.onClose).toHaveBeenCalledOnce()))})}},q={tags:["!autodocs","!dev"],args:{title:"Test Close Overlay"},play:async t=>{var i;await((i=u.play)==null?void 0:i.call(u,t));const{canvas:a,step:n,args:l}=t;await n("Close dialog by clicking overlay",async()=>{const o=a.getByTestId("dialog-overlay");return await f.click(o),B(async()=>(await r(a.getByTestId("dialog")).not.toBeVisible(),r(l.onClose).toHaveBeenCalledOnce()))})}},N={tags:["!autodocs","!dev"],args:{title:"Test Close Keyboard"},play:async t=>{var i;await((i=u.play)==null?void 0:i.call(u,t));const{canvas:a,step:n,args:l}=t;await n("Close dialog using escape key",async()=>(await f.keyboard("{Escape}"),B(async()=>(await r(a.getByTestId("dialog")).not.toBeVisible(),r(l.onClose).toHaveBeenCalledOnce()))))}};var Y,K,Z;w.parameters={...w.parameters,docs:{...(Y=w.parameters)==null?void 0:Y.docs,source:{originalSource:`{
116
+ args: {
117
+ title: 'Dialog title',
118
+ children: <>
119
+ <DummyContent />
120
+ <Dialog.Actions primaryButton={<Button size="medium" variant="primary" onClick={() => {
121
+ action('Primary button clicked');
122
+ closeDialog();
123
+ }}>
124
+ Primary
125
+ </Button>} secondaryButton={<Button size="medium" variant="tertiary" onClick={action('Secondary button clicked')}>
126
+ Secondary
127
+ </Button>} />
128
+ </>
129
+ }
130
+ }`,...(Z=(K=w.parameters)==null?void 0:K.docs)==null?void 0:Z.source}}};var $,Q,ee;_.parameters={..._.parameters,docs:{...($=_.parameters)==null?void 0:$.docs,source:{originalSource:`{
131
+ tags: ['!autodocs', '!dev'],
132
+ args: {
133
+ size: 'xs',
134
+ title: 'Extra Small Dialog'
135
+ }
136
+ }`,...(ee=(Q=_.parameters)==null?void 0:Q.docs)==null?void 0:ee.source}}};var te,ae,ne;C.parameters={...C.parameters,docs:{...(te=C.parameters)==null?void 0:te.docs,source:{originalSource:`{
137
+ tags: ['!autodocs', '!dev'],
138
+ args: {
139
+ size: 'sm',
140
+ title: 'Small Dialog'
141
+ }
142
+ }`,...(ne=(ae=C.parameters)==null?void 0:ae.docs)==null?void 0:ne.source}}};var le,ie,re;T.parameters={...T.parameters,docs:{...(le=T.parameters)==null?void 0:le.docs,source:{originalSource:`{
143
+ tags: ['!autodocs', '!dev'],
144
+ args: {
145
+ size: 'md',
146
+ title: 'Medium Dialog'
147
+ }
148
+ }`,...(re=(ie=T.parameters)==null?void 0:ie.docs)==null?void 0:re.source}}};var oe,se,ue;k.parameters={...k.parameters,docs:{...(oe=k.parameters)==null?void 0:oe.docs,source:{originalSource:`{
149
+ tags: ['!autodocs', '!dev'],
150
+ args: {
151
+ size: 'lg',
152
+ title: 'Large Dialog'
153
+ }
154
+ }`,...(ue=(se=k.parameters)==null?void 0:se.docs)==null?void 0:ue.source}}};var de,ce,me,pe,ve;b.parameters={...b.parameters,docs:{...(de=b.parameters)==null?void 0:de.docs,source:{originalSource:`{
155
+ tags: ['!autodocs', '!dev'],
156
+ args: {
157
+ size: {
158
+ _: 'xs',
159
+ 'medium-l': 'lg'
160
+ },
161
+ title: 'Width Responsiveness',
162
+ description: 'Change the window width to see the Dialog width respond to it'
163
+ }
164
+ }`,...(me=(ce=b.parameters)==null?void 0:ce.docs)==null?void 0:me.source},description:{story:`The Dialog component adapts to different screen sizes through responsive size props.
165
+ Use an object with breakpoints as keys to specify different sizes at different viewport widths:
166
+
167
+ \`\`\`tsx
168
+ <Dialog
169
+ size={{
170
+ _: 'xs',
171
+ 'medium-l': 'lg'
172
+ }}
173
+ />
174
+ \`\`\``,...(ve=(pe=b.parameters)==null?void 0:pe.docs)==null?void 0:ve.description}}};var ge,ye,he;I.parameters={...I.parameters,docs:{...(ge=I.parameters)==null?void 0:ge.docs,source:{originalSource:`{
175
+ args: {
176
+ title: 'Height Responsiveness',
177
+ description: 'Change the number of children to see the Dialog style respond to the height change',
178
+ children: <>
179
+ <DynamicChildren />
180
+ <Dialog.Actions primaryButton={<Button size="medium" variant="primary" onClick={action('Primary button clicked')}>
181
+ Primary
182
+ </Button>} secondaryButton={<Button size="medium" variant="tertiary" onClick={action('Secondary button clicked')}>
183
+ Secondary
184
+ </Button>} />
185
+ </>
186
+ }
187
+ }`,...(he=(ye=I.parameters)==null?void 0:ye.docs)==null?void 0:he.source}}};var fe,be,xe;z.parameters={...z.parameters,docs:{...(fe=z.parameters)==null?void 0:fe.docs,source:{originalSource:`{
188
+ parameters: {
189
+ chromatic: {
190
+ modes: {
191
+ 'narrow-l': {
192
+ viewport: 'narrow-l'
193
+ },
194
+ 'medium-s': {
195
+ viewport: 'medium-s'
196
+ },
197
+ 'medium-l': {
198
+ viewport: 'medium-l'
199
+ }
200
+ }
201
+ }
202
+ },
203
+ args: {
204
+ title: 'Mobile Full Height',
205
+ mobileFullHeight: true
206
+ }
207
+ }`,...(xe=(be=z.parameters)==null?void 0:be.docs)==null?void 0:xe.source}}};var Se,De,Be;V.parameters={...V.parameters,docs:{...(Se=V.parameters)==null?void 0:Se.docs,source:{originalSource:`{
208
+ args: {
209
+ title: 'Visually Hidden Title',
210
+ description: 'This header is hidden visually but still accessible to screen readers',
211
+ hideHeader: true
212
+ }
213
+ }`,...(Be=(De=V.parameters)==null?void 0:De.docs)==null?void 0:Be.source}}};var we,_e,Ce;R.parameters={...R.parameters,docs:{...(we=R.parameters)==null?void 0:we.docs,source:{originalSource:`{
214
+ args: {
215
+ title: 'Dialog Title',
216
+ description: 'This is the dialog description.',
217
+ children: <>
218
+ <DummyContent />
219
+ <Dialog.Actions primaryButton={<Button size="medium" variant="primary" onClick={action('Primary button clicked')}>
220
+ Primary
221
+ </Button>} />
222
+ </>
223
+ }
224
+ }`,...(Ce=(_e=R.parameters)==null?void 0:_e.docs)==null?void 0:Ce.source}}};var Te,ke,Ie;P.parameters={...P.parameters,docs:{...(Te=P.parameters)==null?void 0:Te.docs,source:{originalSource:`{
225
+ args: {
226
+ title: 'Dialog Title',
227
+ description: 'This is the dialog description.',
228
+ children: <>
229
+ <DummyContent />
230
+ <Dialog.Actions primaryButton={<Button size="medium" variant="primary" onClick={action('Primary button clicked')}>
231
+ Primary
232
+ </Button>} secondaryButton={<Button size="medium" variant="tertiary" onClick={action('Secondary button clicked')}>
233
+ Secondary
234
+ </Button>} />
235
+ </>
236
+ }
237
+ }`,...(Ie=(ke=P.parameters)==null?void 0:ke.docs)==null?void 0:Ie.source}}};var ze,Ve,Re,Pe,Ee;x.parameters={...x.parameters,docs:{...(ze=x.parameters)==null?void 0:ze.docs,source:{originalSource:`{
238
+ args: {
239
+ title: 'Hidden Dialog Title',
240
+ hideHeader: true,
241
+ children: <>
242
+ <Dialog.Steps aria-label="Onboarding Steps">
243
+ <Dialog.Step title="Profile" description="Tell us more about yourself">
244
+ <DummyContent />
245
+ </Dialog.Step>
246
+ <Dialog.Step title="Subject" description="What do you want to learn?">
247
+ <DummyContent />
248
+ </Dialog.Step>
249
+ <Dialog.Step title="Availability" description="When are you available?">
250
+ <DummyContent />
251
+ </Dialog.Step>
252
+ <Dialog.StepsActions primaryButton={<Button size="medium" variant="primary" onClick={action('Primary button clicked')}>
253
+ Primary
254
+ </Button>} />
255
+ </Dialog.Steps>
256
+ </>
257
+ },
258
+ /**
259
+ * This story only tests dialog-specific behavior. See \`Steps\` stories for more comprehensive tests.
260
+ */
261
+ play: async ctx => {
262
+ await meta.play?.(ctx);
263
+ const {
264
+ canvas,
265
+ step
266
+ } = ctx;
267
+ await step('Initially, only next button is present', async () => {
268
+ expect(canvas.queryByRole('button', {
269
+ name: 'Next'
270
+ })).toBeVisible();
271
+ expect(canvas.queryByRole('button', {
272
+ name: 'Previous'
273
+ })).not.toBeInTheDocument();
274
+ expect(canvas.queryByRole('button', {
275
+ name: 'Primary'
276
+ })).not.toBeInTheDocument();
277
+ });
278
+ await step('Navigate to the next step. Previous/Next buttons are visible', async () => {
279
+ await userEvent.click(canvas.getByRole('button', {
280
+ name: 'Next'
281
+ }));
282
+ expect(canvas.queryByRole('button', {
283
+ name: 'Previous'
284
+ })).toBeVisible();
285
+ expect(canvas.queryByRole('button', {
286
+ name: 'Next'
287
+ })).toBeVisible();
288
+ expect(canvas.queryByRole('button', {
289
+ name: 'Primary'
290
+ })).not.toBeInTheDocument();
291
+ });
292
+ await step('Navigate to the last step. Previous/Primary buttons are visible', async () => {
293
+ await userEvent.click(canvas.getByRole('button', {
294
+ name: 'Next'
295
+ }));
296
+ expect(canvas.queryByRole('button', {
297
+ name: 'Previous'
298
+ })).toBeVisible();
299
+ expect(canvas.queryByRole('button', {
300
+ name: 'Primary'
301
+ })).toBeVisible();
302
+ expect(canvas.queryByRole('button', {
303
+ name: 'Next'
304
+ })).not.toBeInTheDocument();
305
+ });
306
+ }
307
+ }`,...(Re=(Ve=x.parameters)==null?void 0:Ve.docs)==null?void 0:Re.source},description:{story:"The Dialog component can be used with the Steps component to create multi-step flows.\nYou can hide the Dialog's header using \\`hideHeader\\` and add your own headers to each step,\nlike in this story.",...(Ee=(Pe=x.parameters)==null?void 0:Pe.docs)==null?void 0:Ee.description}}};var qe,Ne,je,Ae,He;S.parameters={...S.parameters,docs:{...(qe=S.parameters)==null?void 0:qe.docs,source:{originalSource:`{
308
+ args: {
309
+ leadingElement: <Icon size="32" svg={InfoIcon} />,
310
+ title: 'Information Dialog'
311
+ }
312
+ }`,...(je=(Ne=S.parameters)==null?void 0:Ne.docs)==null?void 0:je.source},description:{story:"A dialog with an Icon component in the title. This demonstrates how to use React elements in the title.",...(He=(Ae=S.parameters)==null?void 0:Ae.docs)==null?void 0:He.description}}};var Oe,Fe,Ue,We,Le;D.parameters={...D.parameters,docs:{...(Oe=D.parameters)==null?void 0:Oe.docs,source:{originalSource:`{
313
+ args: {
314
+ leadingElement: <Avatar size="48" alt="User" />,
315
+ title: 'User Profile',
316
+ description: 'This dialog shows a user profile with an avatar in the title'
317
+ }
318
+ }`,...(Ue=(Fe=D.parameters)==null?void 0:Fe.docs)==null?void 0:Ue.source},description:{story:"A dialog with an Avatar component in the title. This demonstrates how to use compound components in the title.",...(Le=(We=D.parameters)==null?void 0:We.docs)==null?void 0:Le.description}}};var Me,Je,Ge,Xe,Ye;h.parameters={...h.parameters,docs:{...(Me=h.parameters)==null?void 0:Me.docs,source:{originalSource:`args => {
319
+ useEffect(() => {
320
+ document.body.style.setProperty('--ds-dialog-overlay-z-index-override', '88');
321
+ document.body.style.setProperty('--ds-dialog-content-z-index-override', '77');
322
+ return () => {
323
+ document.body.style.removeProperty('--ds-dialog-overlay-z-index-override');
324
+ document.body.style.removeProperty('--ds-dialog-content-z-index-override');
325
+ };
326
+ }, []);
327
+ return <div style={{
328
+ position: 'relative',
329
+ zIndex: 99
330
+ }}>
331
+ <Dialog {...args} title="ZIndex Override" />
332
+ </div>;
333
+ }`,...(Ge=(Je=h.parameters)==null?void 0:Je.docs)==null?void 0:Ge.source},description:{story:`The Dialog component provides CSS property escape hatches for controlling the z-index of both the overlay and content:
334
+
335
+ - \\\`--ds-dialog-overlay-z-index-override\\\`: Controls the overlay's z-index
336
+ - \\\`--ds-dialog-content-z-index-override\\\`: Controls the content's z-index
337
+
338
+ These should only be used when necessary, as proper stacking context isolation is preferred.
339
+
340
+ In the following example, the stacking order of the dialog trigger, overlay, and content are
341
+ reveresed using the above CSS properties.
342
+
343
+ Note: This is done using a \\\`useEffect\\\` just for the sake of the story. In a real-world scenario, this should ideally be done in a global stylesheet or a theme provider.`,...(Ye=(Xe=h.parameters)==null?void 0:Xe.docs)==null?void 0:Ye.description}}};var Ke,Ze,$e;E.parameters={...E.parameters,docs:{...(Ke=E.parameters)==null?void 0:Ke.docs,source:{originalSource:`{
344
+ tags: ['!autodocs', '!dev'],
345
+ args: {
346
+ title: 'Test Close Button'
347
+ },
348
+ play: async ctx => {
349
+ await meta.play?.(ctx);
350
+ const {
351
+ canvas,
352
+ step,
353
+ args
354
+ } = ctx;
355
+ await step('Close dialog using close button', async () => {
356
+ const closeButton = canvas.getByTestId('dialog-close');
357
+ await userEvent.click(closeButton);
358
+ return waitFor(async () => {
359
+ await expect(canvas.getByTestId('dialog')).not.toBeVisible();
360
+ return expect(args.onClose).toHaveBeenCalledOnce();
361
+ });
362
+ });
363
+ }
364
+ }`,...($e=(Ze=E.parameters)==null?void 0:Ze.docs)==null?void 0:$e.source}}};var Qe,et,tt;q.parameters={...q.parameters,docs:{...(Qe=q.parameters)==null?void 0:Qe.docs,source:{originalSource:`{
365
+ tags: ['!autodocs', '!dev'],
366
+ args: {
367
+ title: 'Test Close Overlay'
368
+ },
369
+ play: async ctx => {
370
+ await meta.play?.(ctx);
371
+ const {
372
+ canvas,
373
+ step,
374
+ args
375
+ } = ctx;
376
+ await step('Close dialog by clicking overlay', async () => {
377
+ const overlay = canvas.getByTestId('dialog-overlay');
378
+ await userEvent.click(overlay);
379
+ return waitFor(async () => {
380
+ await expect(canvas.getByTestId('dialog')).not.toBeVisible();
381
+ return expect(args.onClose).toHaveBeenCalledOnce();
382
+ });
383
+ });
384
+ }
385
+ }`,...(tt=(et=q.parameters)==null?void 0:et.docs)==null?void 0:tt.source}}};var at,nt,lt;N.parameters={...N.parameters,docs:{...(at=N.parameters)==null?void 0:at.docs,source:{originalSource:`{
386
+ tags: ['!autodocs', '!dev'],
387
+ args: {
388
+ title: 'Test Close Keyboard'
389
+ },
390
+ play: async ctx => {
391
+ await meta.play?.(ctx);
392
+ const {
393
+ canvas,
394
+ step,
395
+ args
396
+ } = ctx;
397
+ await step('Close dialog using escape key', async () => {
398
+ await userEvent.keyboard('{Escape}');
399
+ return waitFor(async () => {
400
+ await expect(canvas.getByTestId('dialog')).not.toBeVisible();
401
+ return expect(args.onClose).toHaveBeenCalledOnce();
402
+ });
403
+ });
404
+ }
405
+ }`,...(lt=(nt=N.parameters)==null?void 0:nt.docs)==null?void 0:lt.source}}};const Ka=["Default","ExtraSmall","Small","Medium","Large","WidthResponsiveness","HeightResponsiveness","MobileFullHeight","WithHiddenHeader","WithPrimaryAction","WithSecondaryAction","WithSteps","WithIcon","WithAvatar","WithZIndexOverride","TestCloseButton","TestCloseOverlay","TestCloseKeyboard"];export{w as Default,_ as ExtraSmall,I as HeightResponsiveness,k as Large,T as Medium,z as MobileFullHeight,C as Small,E as TestCloseButton,N as TestCloseKeyboard,q as TestCloseOverlay,b as WidthResponsiveness,D as WithAvatar,V as WithHiddenHeader,S as WithIcon,R as WithPrimaryAction,P as WithSecondaryAction,x as WithSteps,h as WithZIndexOverride,Ka as __namedExportsOrder,u as default};