@bethinkpl/design-system 26.15.1 → 27.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 (358) hide show
  1. package/.eslintrc.cjs +9 -0
  2. package/dist/RadioButton-BWi6jLxx.js +63 -0
  3. package/dist/RadioButton-BWi6jLxx.js.map +1 -0
  4. package/dist/RadioButton-DSmKwvPr.js +63 -0
  5. package/dist/RadioButton-DSmKwvPr.js.map +1 -0
  6. package/dist/design-system.js +266 -0
  7. package/dist/design-system.js.map +1 -0
  8. package/dist/design-system.umd.cjs +18 -18
  9. package/dist/design-system.umd.cjs.map +1 -1
  10. package/dist/index-BzPDEKft.js +24356 -0
  11. package/dist/index-BzPDEKft.js.map +1 -0
  12. package/dist/index-Oq81NaeJ.js +1388 -0
  13. package/dist/index-Oq81NaeJ.js.map +1 -0
  14. package/dist/index-UMXgzRbZ.js +24356 -0
  15. package/dist/index-UMXgzRbZ.js.map +1 -0
  16. package/dist/lib/js/components/Banner/Banner.consts.d.ts +4 -4
  17. package/dist/lib/js/components/Banner/Banner.vue.d.ts +49 -1824
  18. package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +41 -443
  19. package/dist/lib/js/components/Buttons/HelpButton/HelpButton.vue.d.ts +40 -0
  20. package/dist/lib/js/components/Buttons/HelpButton/index.d.ts +3 -0
  21. package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +77 -427
  22. package/dist/lib/js/components/Cards/Card/Card.consts.d.ts +5 -0
  23. package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +52 -175
  24. package/dist/lib/js/components/Cards/Card/index.d.ts +1 -0
  25. package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +116 -154
  26. package/dist/lib/js/components/Chip/Chip.vue.d.ts +79 -430
  27. package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +2 -1
  28. package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +4 -2
  29. package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +2 -1
  30. package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +507 -1557
  31. package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +1 -0
  32. package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +77 -426
  33. package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +1 -0
  34. package/dist/lib/js/components/Form/Checkbox/Checkbox.vue.d.ts +1 -0
  35. package/dist/lib/js/components/Form/FormField/FormField.consts.d.ts +9 -0
  36. package/dist/lib/js/components/Form/FormField/FormField.stories.shared.d.ts +5 -0
  37. package/dist/lib/js/components/Form/FormField/FormField.types.d.ts +21 -0
  38. package/dist/lib/js/components/Form/FormField/FormField.utils.d.ts +11 -0
  39. package/dist/lib/js/components/Form/FormField/FormField.vue.d.ts +20 -0
  40. package/dist/lib/js/components/Form/FormField/FormFieldMessage/FormFieldMessage.vue.d.ts +30 -0
  41. package/dist/lib/js/components/Form/FormField/FormFieldMessage/index.d.ts +3 -0
  42. package/dist/lib/js/components/Form/FormField/index.d.ts +5 -0
  43. package/dist/lib/js/components/Form/InputField/InputField.types.d.ts +13 -0
  44. package/dist/lib/js/components/Form/InputField/InputField.vue.d.ts +78 -0
  45. package/dist/lib/js/components/Form/InputField/index.d.ts +3 -0
  46. package/dist/lib/js/components/Form/InputField/useInputFieldWithinForm.d.ts +8 -0
  47. package/dist/lib/js/components/Form/PasswordField/PasswordField.vue.d.ts +76 -0
  48. package/dist/lib/js/components/Form/PasswordField/index.d.ts +3 -0
  49. package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +1 -0
  50. package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +77 -426
  51. package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +76 -426
  52. package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.consts.d.ts +17 -11
  53. package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue.d.ts +22 -138
  54. package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +1 -0
  55. package/dist/lib/js/components/Modal/Modal.vue.d.ts +1 -0
  56. package/dist/lib/js/components/Modals/Modal/Modal.consts.d.ts +8 -4
  57. package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +281 -1093
  58. package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +288 -1100
  59. package/dist/lib/js/components/Outline/OutlineItem/OutlineItem.vue.d.ts +1 -0
  60. package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +78 -426
  61. package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +2 -1
  62. package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +1 -0
  63. package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +6 -4
  64. package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +4 -2
  65. package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +1 -0
  66. package/dist/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue.d.ts +1 -0
  67. package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +1 -0
  68. package/dist/lib/js/components/SelectionTile/SelectionTile.vue.d.ts +3 -0
  69. package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +1 -0
  70. package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +1 -0
  71. package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +262 -1002
  72. package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +268 -1008
  73. package/dist/lib/js/components/Switch/Switch.vue.d.ts +1 -0
  74. package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +104 -1806
  75. package/dist/lib/js/components/Tile/Tile.vue.d.ts +1 -0
  76. package/dist/lib/js/components/Toast/Toast.vue.d.ts +190 -581
  77. package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +1 -0
  78. package/dist/lib/js/icons/fontawesome.d.ts +1 -0
  79. package/dist/lib/js/index.d.ts +10 -1
  80. package/dist/lib/js/tests/helpers.d.ts +1 -0
  81. package/dist/pl-C3BEVRTZ.js +91 -0
  82. package/dist/pl-C3BEVRTZ.js.map +1 -0
  83. package/docs/assets/{AccessStatus-plchnY0B.js → AccessStatus-DGd8XBwr.js} +1 -1
  84. package/docs/assets/{AccessStatus.stories-DIIoog2Q.js → AccessStatus.stories-BUpfD_Uw.js} +1 -1
  85. package/docs/assets/Avatar-DJEZDpOI.js +1 -0
  86. package/docs/assets/{Avatar.stories-9Vth29zT.js → Avatar.stories-D40fYcFF.js} +1 -1
  87. package/docs/assets/{Badge-BbvNKG41.js → Badge-B8eFbzRx.js} +1 -1
  88. package/docs/assets/{Badge.stories-CKPGT_pt.js → Badge.stories-DxdwaS-k.js} +3 -3
  89. package/docs/assets/{BadgeScore-BOOWTi6N.js → BadgeScore-ByouU1Eu.js} +1 -1
  90. package/docs/assets/{BadgeScore.stories-ERFMPhhE.js → BadgeScore.stories-DsodV82W.js} +1 -1
  91. package/docs/assets/Banner-D5riYdGJ.js +1 -0
  92. package/docs/assets/Banner.stories-Ch0_NPk4.js +64 -0
  93. package/docs/assets/BasicRichListItem-NMNh0Xfo.js +1 -0
  94. package/docs/assets/{BasicRichListItem.stories-BJZo9YF9.js → BasicRichListItem.stories-Gu9n5wvW.js} +2 -2
  95. package/docs/assets/{BlockadeStatus-D1j0ZWIW.js → BlockadeStatus-Dqr_LSfC.js} +1 -1
  96. package/docs/assets/{BlockedeStatus.stories-BKi05Ndl.js → BlockedeStatus.stories-BKblKF33.js} +1 -1
  97. package/docs/assets/Button-XuK8IxnR.js +1 -0
  98. package/docs/assets/{Button.stories-Da2LsOLk.js → Button.stories-UiGEsaro.js} +5 -3
  99. package/docs/assets/Card-BhK1CiCP.js +1 -0
  100. package/docs/assets/Card.stories-BfWbSV_u.js +33 -0
  101. package/docs/assets/CardExpandable-CPuSx_lW.js +1 -0
  102. package/docs/assets/{CardExpandable.stories-DtC5egGK.js → CardExpandable.stories-mHnNt6zg.js} +1 -1
  103. package/docs/assets/Checkbox-g1Bvy8z-.js +1 -0
  104. package/docs/assets/{Checkbox.stories-BUIzgcCC.js → Checkbox.stories-DdJRLzJy.js} +1 -1
  105. package/docs/assets/{Chip-BJcjfD8j.js → Chip-CGm2pLPD.js} +1 -1
  106. package/docs/assets/{Chip.stories-Dgmetn8m.js → Chip.stories-CnHjkDSI.js} +1 -1
  107. package/docs/assets/Color-ERTF36HU-8BveRk6J.js +1 -0
  108. package/docs/assets/{Colors.stories-BrNisWwH.js → Colors.stories-BtNgjWxi.js} +1 -1
  109. package/docs/assets/{ColorsThemes.stories-DvZl0m40.js → ColorsThemes.stories-Ct0Ai41o.js} +1 -1
  110. package/docs/assets/{ColorsTokensLms.stories-D3nA1ro1.js → ColorsTokensLms.stories-BP-WMJrS.js} +1 -1
  111. package/docs/assets/{ColorsTokensPrimaryBodywork.stories-w4A7RjpQ.js → ColorsTokensPrimaryBodywork.stories-zdX-tf4x.js} +1 -1
  112. package/docs/assets/{ColorsTokensPrimaryWnl.stories-CncgXEG5.js → ColorsTokensPrimaryWnl.stories-DFVUj_99.js} +1 -1
  113. package/docs/assets/{CounterToggle-DKRrZ9t2.js → CounterToggle-B9hjjWpv.js} +1 -1
  114. package/docs/assets/{CounterToggle.stories-DEP60zRp.js → CounterToggle.stories-BtS63BEz.js} +1 -1
  115. package/docs/assets/{DateBox.stories-y5_2vs0g.js → DateBox.stories-B7PTVLxc.js} +3 -3
  116. package/docs/assets/{DatePicker-QHo-i7qh.js → DatePicker-70Dj0lsn.js} +1 -1
  117. package/docs/assets/{DatePicker.stories-4hPgpb1-.js → DatePicker.stories-DZN51CwX.js} +1 -1
  118. package/docs/assets/{DateRangePicker-B0NAwdsr.js → DateRangePicker-D5bqKMMk.js} +1 -1
  119. package/docs/assets/{DateRangePicker.stories-BXQLC6L-.js → DateRangePicker.stories-WhCXoUeh.js} +1 -1
  120. package/docs/assets/{Divider-9o-i_zKL.js → Divider-NOTDPuJ1.js} +1 -1
  121. package/docs/assets/{Divider.stories-IQKEznYT.js → Divider.stories-Cjyx7utt.js} +1 -1
  122. package/docs/assets/{DocsRenderer-CFRXHY34-rC6r6xBG.js → DocsRenderer-CFRXHY34-BThTLMHt.js} +72 -72
  123. package/docs/assets/{Drawer-ClrSDwUZ.js → Drawer-CrAn35Yo.js} +1 -1
  124. package/docs/assets/{Drawer.stories-DR-CXra3.js → Drawer.stories-iInS0JV5.js} +1 -1
  125. package/docs/assets/{DrawerContent-D6Bl5GA-.js → DrawerContent-DAIzyQNz.js} +1 -1
  126. package/docs/assets/{DrawerContent.stories-BR11egKi.js → DrawerContent.stories-CBpbbVk_.js} +1 -1
  127. package/docs/assets/{DrawerDivider-DMhjaSPk.js → DrawerDivider-CKRXkKRz.js} +1 -1
  128. package/docs/assets/{DrawerDivider.stories-DdcVRbtO.js → DrawerDivider.stories-iQ2J_ExP.js} +1 -1
  129. package/docs/assets/DrawerHeader-DPBlervR.js +1 -0
  130. package/docs/assets/{DrawerHeader.stories-DnPlkGmI.js → DrawerHeader.stories-ugFv_siA.js} +1 -1
  131. package/docs/assets/{DrawerListItem-dizQZUbe.js → DrawerListItem-ClOcwiVc.js} +1 -1
  132. package/docs/assets/{DrawerListItem.stories-pVTEuckG.js → DrawerListItem.stories-BMZ35_qS.js} +1 -1
  133. package/docs/assets/{DrawerListItemGroup-B5XadRVV.js → DrawerListItemGroup-SEWltKLJ.js} +1 -1
  134. package/docs/assets/{DrawerListItemGroup.stories-pOGG952w.js → DrawerListItemGroup.stories-Bn2TyQLH.js} +1 -1
  135. package/docs/assets/DrawerSection-ByJjEPPu.js +1 -0
  136. package/docs/assets/{DrawerSection.stories-tQT_zWBt.js → DrawerSection.stories-DuLphbcs.js} +1 -1
  137. package/docs/assets/DrawerTile-BGQvQQSp.js +1 -0
  138. package/docs/assets/DrawerTile.stories-DCe2L4Tv.js +10 -0
  139. package/docs/assets/Dropdown-Bdrd2ZIh.js +1 -0
  140. package/docs/assets/{Dropdown.stories-DLo-4_G3.js → Dropdown.stories-DnkREwa1.js} +2 -2
  141. package/docs/assets/FeatureIcon-DY5WvpPf.js +1 -0
  142. package/docs/assets/{FeatureIcon.stories-H_yUD4i4.js → FeatureIcon.stories-BqYqiSzM.js} +1 -1
  143. package/docs/assets/FormField-BjLFip7T.js +1 -0
  144. package/docs/assets/FormField.stories-DY8Mz4YE.js +40 -0
  145. package/docs/assets/FormField.stories.shared-3_36NKi_.js +1 -0
  146. package/docs/assets/FormFieldMessage-B4Oy2QBT.js +1 -0
  147. package/docs/assets/FormFieldMessage.stories-BD7JfJNj.js +32 -0
  148. package/docs/assets/GroupRichListItem-CHiSrcou.js +1 -0
  149. package/docs/assets/{GroupRichListItem.stories-C25AujXP.js → GroupRichListItem.stories-C3EubvlY.js} +1 -1
  150. package/docs/assets/HelpButton-BStTtLsz.js +1 -0
  151. package/docs/assets/HelpButton.stories-C3-CU20F.js +17 -0
  152. package/docs/assets/Icon-DUeXRUm6.js +761 -0
  153. package/docs/assets/{Icon.stories-BhnUVRrV.js → Icon.stories-ClzUno-E.js} +1 -1
  154. package/docs/assets/IconButton-Cn83Zk5-.js +1 -0
  155. package/docs/assets/{IconButton.stories-B8QjmTyV.js → IconButton.stories-CwZts8kF.js} +6 -6
  156. package/docs/assets/{IconText-CKJ4jGzm.js → IconText-Colreg4i.js} +1 -1
  157. package/docs/assets/{IconText.stories-B5zjHqug.js → IconText.stories-DSZffl3k.js} +1 -1
  158. package/docs/assets/{Image-Dbv2u4ta.js → Image-B7PRENWe.js} +1 -1
  159. package/docs/assets/{Image.stories-CUWPBT5K.js → Image.stories-DkYrm30P.js} +1 -1
  160. package/docs/assets/InputField-CplPTgjC.js +5 -0
  161. package/docs/assets/InputField.stories-K675XZL5.js +44 -0
  162. package/docs/assets/{ItemsList-CJTCYbgI.js → ItemsList-nTRSgJDP.js} +1 -1
  163. package/docs/assets/{LoadingBar-Dc_eLNsl.js → LoadingBar-DGNrwKu4.js} +1 -1
  164. package/docs/assets/{LoadingBar.stories-DWH4VmcD.js → LoadingBar.stories-owR_6Oqy.js} +1 -1
  165. package/docs/assets/Modal-ByQBkOMU.js +1 -0
  166. package/docs/assets/{Modal.stories-0zzyLX_Z.js → Modal.stories-DlxDxfN1.js} +1 -1
  167. package/docs/assets/{ModalDialog-BuO78uuh.js → ModalDialog-Cr21J58H.js} +1 -1
  168. package/docs/assets/{ModalDialog.stories-lBI09xqp.js → ModalDialog.stories-DP4FjijI.js} +1 -1
  169. package/docs/assets/{NumberInCircle-DnPE2szs.js → NumberInCircle-CE28_Nsz.js} +1 -1
  170. package/docs/assets/{NumberInCircle.stories-Tn0v6S_I.js → NumberInCircle.stories-DFdUVSKM.js} +1 -1
  171. package/docs/assets/OutlineDivider-DJ9pnpJN.js +1 -0
  172. package/docs/assets/{OutlineDivider.stories-D9Hzkdbe.js → OutlineDivider.stories-Dzpei9KR.js} +1 -1
  173. package/docs/assets/{OutlineItem-1BOyMbS2.js → OutlineItem-CApzlES7.js} +1 -1
  174. package/docs/assets/{OutlineItem.stories-DZ_RXCGO.js → OutlineItem.stories-DtEAJjzy.js} +1 -1
  175. package/docs/assets/{OutlineSectionHeader-LGOAi424.js → OutlineSectionHeader-CSNr7XVB.js} +1 -1
  176. package/docs/assets/{OutlineSectionHeader.stories-PPIsaHhR.js → OutlineSectionHeader.stories-CuJwkOKg.js} +1 -1
  177. package/docs/assets/OverlayHeader-B5ajrI4B.js +1 -0
  178. package/docs/assets/{OverlayHeader.stories-D0TRoa1n.js → OverlayHeader.stories-Zed9WXER.js} +2 -2
  179. package/docs/assets/{PageHeader-DkHlb7_P.js → PageHeader-Cy-UHuRb.js} +1 -1
  180. package/docs/assets/{PageHeader.stories-WThxfLse.js → PageHeader.stories-DlW4dler.js} +1 -1
  181. package/docs/assets/Pagination-D34dUtsQ.js +1 -0
  182. package/docs/assets/{Pagination.stories-CL9tb6Sx.js → Pagination.stories-IDi5nqa_.js} +2 -2
  183. package/docs/assets/PasswordField-Bkc6j8ri.js +1 -0
  184. package/docs/assets/PasswordField.stories-CklmsmJF.js +42 -0
  185. package/docs/assets/{PopOver-BDVCOkO6.js → PopOver-DVj1_TNg.js} +1 -1
  186. package/docs/assets/{PopOver.stories-CmDQPumC.js → PopOver.stories-BljOgM3Z.js} +2 -2
  187. package/docs/assets/{ProgressBar-q_I44DQc.js → ProgressBar-D2hkMeQ0.js} +1 -1
  188. package/docs/assets/{ProgressBar.stories-Df10tpd-.js → ProgressBar.stories-BDHI6-tO.js} +1 -1
  189. package/docs/assets/{ProgressDonutChart-DP55sH2Q.js → ProgressDonutChart-CBO-vy-E.js} +1 -1
  190. package/docs/assets/{ProgressDonutChart.stories-CXJhJ1AH.js → ProgressDonutChart.stories-CGwlVICI.js} +1 -1
  191. package/docs/assets/RadioButton-Bd-D-2PY.js +1 -0
  192. package/docs/assets/{RadioButton.stories-NVFxjqN4.js → RadioButton.stories-BkCwnbIp.js} +1 -1
  193. package/docs/assets/{RichListItem.stories-B3NGpkHT.js → RichListItem.stories-Bls_aY12.js} +2 -2
  194. package/docs/assets/SectionHeader-isKXGfjn.js +1 -0
  195. package/docs/assets/{SectionHeader.stories-CTANEOdf.js → SectionHeader.stories-Bj3scOLc.js} +1 -1
  196. package/docs/assets/{SectionTitle-DLcFKzRH.js → SectionTitle-wTuJZZVS.js} +1 -1
  197. package/docs/assets/{SectionTitle.stories-Dybq4paM.js → SectionTitle.stories-Dr3KOvIl.js} +1 -1
  198. package/docs/assets/{SelectList-B323Y2el.js → SelectList-YMQ8rEMc.js} +1 -1
  199. package/docs/assets/{SelectList.stories-BCS6zdJ9.js → SelectList.stories-ETdEOJ81.js} +1 -1
  200. package/docs/assets/{SelectListItem-DfLqJR-_.js → SelectListItem-BqKhIPSO.js} +1 -1
  201. package/docs/assets/{SelectListItem.stories-m8BTHS53.js → SelectListItem.stories-ClyL-djS.js} +1 -1
  202. package/docs/assets/{SelectListItemDivider-lDLIwtP8.js → SelectListItemDivider-CTU7_4OL.js} +1 -1
  203. package/docs/assets/{SelectListItemDivider.stories-BZ6_HOBG.js → SelectListItemDivider.stories-rGpk0Yeg.js} +1 -1
  204. package/docs/assets/{SelectListItemTile-DzAuBa66.js → SelectListItemTile-BhOwBFIO.js} +1 -1
  205. package/docs/assets/SelectListItemTile.stories-BXFfuX9q.js +19 -0
  206. package/docs/assets/{SelectListItemToggle-DJ_P6PIB.js → SelectListItemToggle-C0lffqeC.js} +1 -1
  207. package/docs/assets/{SelectListItemToggle.stories-yej5J6y8.js → SelectListItemToggle.stories-D39XrmtN.js} +1 -2
  208. package/docs/assets/SelectListSectionTitle-B9Dj10G9.js +1 -0
  209. package/docs/assets/{SelectListSectionTitle.stories-NKPegok4.js → SelectListSectionTitle.stories-DCZ-Sq6v.js} +1 -1
  210. package/docs/assets/{SelectionControl-CwdtLuOD.js → SelectionControl-DIC2vtGo.js} +1 -1
  211. package/docs/assets/{SelectionTile-hjRK7Lwc.js → SelectionTile-D7fhj7-I.js} +2 -2
  212. package/docs/assets/{SelectionTile.stories-DRdGcDuJ.js → SelectionTile.stories-Cato0iSj.js} +1 -1
  213. package/docs/assets/{Skeleton-DhyJ4ZKG.js → Skeleton-D5xhZMQa.js} +5 -5
  214. package/docs/assets/{Skeleton.stories-CsZjBoj1.js → Skeleton.stories-ll-E-sPN.js} +1 -1
  215. package/docs/assets/SurveyQuestionOpenEnded-DDdPQe2b.js +1 -0
  216. package/docs/assets/{SurveyQuestionOpenEnded.stories-Is_s49TT.js → SurveyQuestionOpenEnded.stories-mHTUclXK.js} +1 -1
  217. package/docs/assets/SurveyQuestionScale-BKZbW5q7.js +1 -0
  218. package/docs/assets/{SurveyQuestionScale.stories-BqOjFThb.js → SurveyQuestionScale.stories-Cczg5QpY.js} +1 -1
  219. package/docs/assets/SurveyToggle-Sid2a-IO.js +1 -0
  220. package/docs/assets/{SurveyToggle.stories-DySS4Jzx.js → SurveyToggle.stories-Dv7PJARv.js} +1 -1
  221. package/docs/assets/Switch-B8xEwHO8.js +1 -0
  222. package/docs/assets/{Switch.stories-Bq6_6t39.js → Switch.stories-RbY8wA55.js} +1 -1
  223. package/docs/assets/{TabItem-Bn_qIbPX.js → TabItem-Ci3vrkRH.js} +1 -1
  224. package/docs/assets/{TabItem.stories-ZPYw1uH1.js → TabItem.stories-relncwaI.js} +1 -1
  225. package/docs/assets/{TextGroup-AUUBIFJZ.js → TextGroup-dzR19lzs.js} +1 -1
  226. package/docs/assets/{TextGroup.stories-CqwkdBAO.js → TextGroup.stories-bCLjp0Xb.js} +1 -1
  227. package/docs/assets/{ThreeColumnLayout-DXA1815_.js → ThreeColumnLayout-LVzDOKfj.js} +1 -1
  228. package/docs/assets/{ThreeColumnLayout.stories-BA08mTZ7.js → ThreeColumnLayout.stories-CkgbTH3p.js} +1 -1
  229. package/docs/assets/{Tile-3fvrXM7M.js → Tile-ByL6drhn.js} +1 -1
  230. package/docs/assets/{Tile.sb.shared-Crj50ugV.js → Tile.sb.shared-D3LxXPDs.js} +1 -1
  231. package/docs/assets/Tile.stories-BhXwnkKz.js +12 -0
  232. package/docs/assets/{Toast-CTbKhm1i.js → Toast-ukLuB2Qi.js} +1 -1
  233. package/docs/assets/{Toast.stories-hUEtnOQn.js → Toast.stories-D3PagUcH.js} +1 -1
  234. package/docs/assets/{ToggleButton-D-t1sDTL.js → ToggleButton-YUVnfx-x.js} +1 -1
  235. package/docs/assets/{ToggleButton.stories-CaAweKdC.js → ToggleButton.stories-C18YYEsJ.js} +1 -1
  236. package/docs/assets/{Tooltip-DZi9yXjr.js → Tooltip-BvaJ_K9_.js} +1 -1
  237. package/docs/assets/{Tooltip.stories-D-DHfToA.js → Tooltip.stories-o7f8wLv_.js} +4 -4
  238. package/docs/assets/{TypographyTokensLms.stories-CZpPPUwu.js → TypographyTokensLms.stories-Cm_y52b6.js} +1 -1
  239. package/docs/assets/{TypographyVariables.stories-B4Lg96R3.js → TypographyVariables.stories-DTHJ_1UO.js} +1 -1
  240. package/docs/assets/{Well-D1j9q3W3.js → Well-iUOt2HEx.js} +1 -1
  241. package/docs/assets/{Well.stories-wgg6f6S7.js → Well.stories-4VLIlu-l.js} +3 -3
  242. package/docs/assets/entry-preview-CAn2_StQ.js +1 -0
  243. package/docs/assets/{entry-preview-docs-Bz8Se46p.js → entry-preview-docs-Y_6rrjxM.js} +1 -1
  244. package/docs/assets/{iframe-CKOJ9wC7.js → iframe-D_RvUlhr.js} +18 -15
  245. package/docs/assets/index-BtMHnMz0.js +1 -0
  246. package/docs/assets/index-Cpsdq_ip.js +1 -0
  247. package/docs/assets/preview-B_G3dFbe.js +2 -0
  248. package/docs/assets/preview-vzvQxRBZ.js +64 -0
  249. package/docs/assets/string--hkylObx.js +1 -0
  250. package/docs/assets/vue-popper-m_ujT3wC.js +24 -0
  251. package/docs/assets/vue.esm-bundler-DcRN7CPI.js +36 -0
  252. package/docs/iframe.html +1 -1
  253. package/docs/index.json +1 -1
  254. package/docs/project.json +1 -1
  255. package/lib/js/components/Badge/Badge.vue +6 -5
  256. package/lib/js/components/Banner/Banner.consts.ts +5 -5
  257. package/lib/js/components/Banner/Banner.spec.ts +148 -0
  258. package/lib/js/components/Banner/Banner.stories.ts +13 -8
  259. package/lib/js/components/Banner/Banner.vue +215 -196
  260. package/lib/js/components/Buttons/Button/Button.spec.ts +18 -3
  261. package/lib/js/components/Buttons/Button/Button.stories.ts +6 -0
  262. package/lib/js/components/Buttons/Button/Button.vue +63 -114
  263. package/lib/js/components/Buttons/HelpButton/HelpButton.spec.ts +87 -0
  264. package/lib/js/components/Buttons/HelpButton/HelpButton.stories.ts +70 -0
  265. package/lib/js/components/Buttons/HelpButton/HelpButton.vue +52 -0
  266. package/lib/js/components/Buttons/HelpButton/index.ts +3 -0
  267. package/lib/js/components/Cards/Card/Card.consts.ts +7 -0
  268. package/lib/js/components/Cards/Card/Card.spec.ts +86 -41
  269. package/lib/js/components/Cards/Card/Card.stories.ts +21 -18
  270. package/lib/js/components/Cards/Card/Card.vue +128 -88
  271. package/lib/js/components/Cards/Card/index.ts +1 -0
  272. package/lib/js/components/Chip/Chip.spec.ts +3 -2
  273. package/lib/js/components/Chip/Chip.vue +0 -1
  274. package/lib/js/components/DatePickers/DateBox/DateBox.stories.ts +0 -3
  275. package/lib/js/components/Form/FormField/FormField.consts.ts +10 -0
  276. package/lib/js/components/Form/FormField/FormField.spec.ts +138 -0
  277. package/lib/js/components/Form/FormField/FormField.stories.shared.ts +53 -0
  278. package/lib/js/components/Form/FormField/FormField.stories.ts +81 -0
  279. package/lib/js/components/Form/FormField/FormField.types.ts +17 -0
  280. package/lib/js/components/Form/FormField/FormField.utils.ts +24 -0
  281. package/lib/js/components/Form/FormField/FormField.vue +192 -0
  282. package/lib/js/components/Form/FormField/FormFieldMessage/FormFieldMessage.spec.ts +53 -0
  283. package/lib/js/components/Form/FormField/FormFieldMessage/FormFieldMessage.stories.ts +74 -0
  284. package/lib/js/components/Form/FormField/FormFieldMessage/FormFieldMessage.vue +89 -0
  285. package/lib/js/components/Form/FormField/FormFieldMessage/index.ts +2 -0
  286. package/lib/js/components/Form/FormField/index.ts +6 -0
  287. package/lib/js/components/Form/InputField/InputField.spec.ts +274 -0
  288. package/lib/js/components/Form/InputField/InputField.stories.ts +98 -0
  289. package/lib/js/components/Form/InputField/InputField.types.ts +14 -0
  290. package/lib/js/components/Form/InputField/InputField.vue +175 -0
  291. package/lib/js/components/Form/InputField/index.ts +3 -0
  292. package/lib/js/components/Form/InputField/useInputFieldWithinForm.ts +54 -0
  293. package/lib/js/components/Form/PasswordField/PasswordField.spec.ts +73 -0
  294. package/lib/js/components/Form/PasswordField/PasswordField.stories.ts +88 -0
  295. package/lib/js/components/Form/PasswordField/PasswordField.vue +55 -0
  296. package/lib/js/components/Form/PasswordField/index.ts +3 -0
  297. package/lib/js/components/Icons/FeatureIcon/FeatureIcon.consts.ts +10 -2
  298. package/lib/js/components/Icons/FeatureIcon/FeatureIcon.spec.ts +18 -0
  299. package/lib/js/components/Icons/FeatureIcon/FeatureIcon.stories.ts +1 -1
  300. package/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue +44 -58
  301. package/lib/js/components/Modals/Modal/Modal.consts.ts +8 -2
  302. package/lib/js/components/Modals/Modal/Modal.vue +12 -5
  303. package/lib/js/components/Modals/ModalDialog/ModalDialog.vue +2 -2
  304. package/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.stories.ts +0 -1
  305. package/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue +43 -47
  306. package/lib/js/components/TabItem/TabItem.spec.ts +0 -1
  307. package/lib/js/components/Toast/Toast.vue +0 -2
  308. package/lib/js/icons/fontawesome.ts +2 -0
  309. package/lib/js/index.ts +11 -1
  310. package/lib/js/styles/Borders/BorderSizes.stories.ts +1 -1
  311. package/lib/js/styles/ItemsList.vue +1 -1
  312. package/lib/js/tests/helpers.ts +5 -0
  313. package/package.json +13 -7
  314. package/tsconfig.base.json +1 -2
  315. package/tsconfig.build.json +8 -0
  316. package/tsconfig.json +1 -6
  317. package/vite.config.ts +11 -8
  318. package/docs/assets/Avatar-CM7iogZ3.js +0 -1
  319. package/docs/assets/Banner-DXAd9x-3.js +0 -1
  320. package/docs/assets/Banner.stories-BC2VxrMC.js +0 -62
  321. package/docs/assets/BasicRichListItem-quALUWxY.js +0 -1
  322. package/docs/assets/Button-C5dr6u6F.js +0 -1
  323. package/docs/assets/Card-KSW_Q55y.js +0 -1
  324. package/docs/assets/Card.stories-Bqmd77lg.js +0 -49
  325. package/docs/assets/CardExpandable-yMDr4_fF.js +0 -1
  326. package/docs/assets/Checkbox-DAOkXx1R.js +0 -1
  327. package/docs/assets/Color-ERTF36HU-DaHgyI5V.js +0 -1
  328. package/docs/assets/DrawerHeader-AkG6Jq7W.js +0 -1
  329. package/docs/assets/DrawerSection-HBM59yvF.js +0 -1
  330. package/docs/assets/DrawerTile-0-CB5w9j.js +0 -1
  331. package/docs/assets/DrawerTile.stories-6JDnzzyo.js +0 -10
  332. package/docs/assets/Dropdown-CYFZ3OvV.js +0 -1
  333. package/docs/assets/FeatureIcon-BoUhuGOr.js +0 -1
  334. package/docs/assets/GroupRichListItem-C_Gsy7fK.js +0 -1
  335. package/docs/assets/Icon-I3Cniv10.js +0 -761
  336. package/docs/assets/IconButton-BPKB5gT7.js +0 -1
  337. package/docs/assets/Modal-Cy1kzNhG.js +0 -1
  338. package/docs/assets/OutlineDivider-UaRb6wKt.js +0 -1
  339. package/docs/assets/OverlayHeader-u9AeOezr.js +0 -1
  340. package/docs/assets/Pagination-CgO9MoPY.js +0 -1
  341. package/docs/assets/RadioButton-DISpvFOt.js +0 -1
  342. package/docs/assets/SectionHeader-ByewlGaG.js +0 -1
  343. package/docs/assets/SelectListItemTile.stories-n2MJqr9U.js +0 -19
  344. package/docs/assets/SelectListSectionTitle-BFbrwNgw.js +0 -1
  345. package/docs/assets/SurveyQuestionOpenEnded-B_HbDRQs.js +0 -1
  346. package/docs/assets/SurveyQuestionScale-CiKDA0ax.js +0 -1
  347. package/docs/assets/SurveyToggle-CCF4WE7n.js +0 -1
  348. package/docs/assets/Switch-Du-uh84v.js +0 -1
  349. package/docs/assets/Tile.stories-0SQaiGz7.js +0 -12
  350. package/docs/assets/_commonjsHelpers-CDR5Xrri.js +0 -1
  351. package/docs/assets/entry-preview-lHccVHf5.js +0 -1
  352. package/docs/assets/index-0M4xY6Fw.js +0 -1
  353. package/docs/assets/index-Be4sB5Yj.js +0 -1
  354. package/docs/assets/preview-BIPjgpxe.js +0 -2
  355. package/docs/assets/preview-BQvHXGdy.js +0 -64
  356. package/docs/assets/string-B1AGRR5v.js +0 -1
  357. package/docs/assets/vue-popper-DoPHnofs.js +0 -24
  358. package/docs/assets/vue.esm-bundler-DD4BrEtS.js +0 -36
@@ -1,24 +1,25 @@
1
1
  <template>
2
- <span
2
+ <component
3
+ :is="as"
3
4
  class="ds-button"
4
5
  :class="{
5
6
  '-ds-outlined': type === BUTTON_TYPES.OUTLINED,
6
7
  '-ds-text': type === BUTTON_TYPES.TEXT,
7
8
 
8
- '-ds-small': size === SIZES.SMALL,
9
- '-ds-large': size === SIZES.LARGE,
9
+ '-ds-small': size === BUTTON_SIZES.SMALL,
10
+ '-ds-large': size === BUTTON_SIZES.LARGE,
10
11
 
11
- '-ds-rounded': type !== BUTTON_TYPES.TEXT && radius === RADIUSES.ROUNDED,
12
+ '-ds-rounded': type !== BUTTON_TYPES.TEXT && radius === BUTTON_RADIUSES.ROUNDED,
12
13
 
13
- '-ds-hovered': state === STATES.HOVERED,
14
- '-ds-focused': state === STATES.FOCUSED,
15
- '-ds-loading': state === STATES.LOADING,
16
- '-ds-disabled': state === STATES.DISABLED,
14
+ '-ds-hovered': state === BUTTON_STATES.HOVERED,
15
+ '-ds-focused': state === BUTTON_STATES.FOCUSED,
16
+ '-ds-loading': state === BUTTON_STATES.LOADING,
17
+ '-ds-disabled': state === BUTTON_STATES.DISABLED,
17
18
 
18
19
  [colorClassName]: true,
19
20
 
20
- '-ds-elevation-x-small': elevation === ELEVATIONS.X_SMALL,
21
- '-ds-elevation-small': elevation === ELEVATIONS.SMALL,
21
+ '-ds-elevation-x-small': elevation === BUTTON_ELEVATIONS.X_SMALL,
22
+ '-ds-elevation-small': elevation === BUTTON_ELEVATIONS.SMALL,
22
23
  }"
23
24
  >
24
25
  <span class="ds-button__content">
@@ -37,20 +38,18 @@
37
38
  />
38
39
  </span>
39
40
  <wnl-icon
40
- v-if="state === STATES.LOADING"
41
+ v-if="state === BUTTON_STATES.LOADING"
41
42
  class="ds-button__loadingIcon"
42
43
  :icon="ICONS.FAD_SPINNER_THIRD"
43
44
  :size="loadingIconSize"
44
45
  />
45
- </span>
46
+ </component>
46
47
  </template>
47
48
 
48
49
  <!-- Looking for styles? These are defined in the global styles file: design-system.scss > _buttons.scss -->
49
50
 
50
- <script lang="ts">
51
- import { Value } from '../../../utils/type.utils';
52
-
53
- import WnlIcon, { ICON_SIZES, ICONS } from '../../Icons/Icon';
51
+ <script lang="ts" setup>
52
+ import WnlIcon, { ICON_SIZES, IconItem, ICONS, IconSize } from '../../Icons/Icon';
54
53
  import {
55
54
  BUTTON_COLORS,
56
55
  BUTTON_ELEVATIONS,
@@ -58,108 +57,58 @@ import {
58
57
  BUTTON_SIZES,
59
58
  BUTTON_STATES,
60
59
  BUTTON_TYPES,
60
+ ButtonColor,
61
+ ButtonRadius,
62
+ ButtonSize,
63
+ ButtonState,
64
+ ButtonType,
65
+ ButtonElevation,
61
66
  } from './Button.consts';
67
+ import { computed } from 'vue';
68
+
69
+ const {
70
+ size = BUTTON_SIZES.MEDIUM,
71
+ type = BUTTON_TYPES.FILLED,
72
+ color = BUTTON_COLORS.PRIMARY,
73
+ radius = BUTTON_RADIUSES.CAPSULE,
74
+ state = BUTTON_STATES.DEFAULT,
75
+ iconLeft = null,
76
+ iconRight = null,
77
+ elevation = BUTTON_ELEVATIONS.NONE,
78
+ as = 'span',
79
+ } = defineProps<{
80
+ // Fixme - remove `string` from types - it is used only to avoid breaking changes for now
81
+ size?: ButtonSize | string;
82
+ type?: ButtonType | string;
83
+ color?: ButtonColor | null | string;
84
+ radius?: ButtonRadius | string;
85
+ state?: ButtonState | string;
86
+ iconLeft?: IconItem | null;
87
+ iconRight?: IconItem | null;
88
+ elevation?: ButtonElevation | string;
89
+ as?: 'button' | 'a' | 'span';
90
+ }>();
62
91
 
63
- import { ICON_BUTTON_COLORS } from '../IconButton/IconButton.consts';
64
- import { defineComponent, toRaw } from 'vue';
92
+ const iconSize = computed((): IconSize => {
93
+ if (size === BUTTON_SIZES.SMALL || size === BUTTON_SIZES.MEDIUM) {
94
+ return ICON_SIZES.XX_SMALL;
95
+ }
96
+ return ICON_SIZES.X_SMALL;
97
+ });
98
+
99
+ const colorClassName = computed((): string => {
100
+ return `-ds-color-${color}`;
101
+ });
65
102
 
66
- export default defineComponent({
67
- // eslint-disable-next-line vue/no-reserved-component-names
68
- name: 'Button',
69
- components: {
70
- WnlIcon,
71
- },
72
- props: {
73
- size: {
74
- type: String,
75
- default: BUTTON_SIZES.MEDIUM,
76
- validator(value: Value<typeof BUTTON_SIZES>) {
77
- return Object.values(BUTTON_SIZES).includes(value);
78
- },
79
- },
80
- type: {
81
- type: String,
82
- default: BUTTON_TYPES.FILLED,
83
- validator(value: Value<typeof BUTTON_TYPES>) {
84
- return Object.values(BUTTON_TYPES).includes(value);
85
- },
86
- },
87
- color: {
88
- type: [String, null],
89
- default: BUTTON_COLORS.PRIMARY,
90
- validator(value: Value<typeof ICON_BUTTON_COLORS>) {
91
- return Object.values(ICON_BUTTON_COLORS).includes(value);
92
- },
93
- },
94
- radius: {
95
- type: String,
96
- default: BUTTON_RADIUSES.CAPSULE,
97
- validator(value: Value<typeof BUTTON_RADIUSES>) {
98
- return Object.values(BUTTON_RADIUSES).includes(value);
99
- },
100
- },
101
- state: {
102
- type: String,
103
- default: BUTTON_STATES.DEFAULT,
104
- validator(value: Value<typeof BUTTON_STATES>) {
105
- return Object.values(BUTTON_STATES).includes(value);
106
- },
107
- },
108
- iconLeft: {
109
- type: Object,
110
- default: null,
111
- validator(icon) {
112
- return Object.values(ICONS).includes(toRaw(icon));
113
- },
114
- },
115
- iconRight: {
116
- type: Object,
117
- default: null,
118
- validator(icon) {
119
- return Object.values(ICONS).includes(toRaw(icon));
120
- },
121
- },
122
- elevation: {
123
- type: String,
124
- default: BUTTON_ELEVATIONS.NONE,
125
- validator(value: Value<typeof BUTTON_ELEVATIONS>) {
126
- return Object.values(BUTTON_ELEVATIONS).includes(value);
127
- },
128
- },
129
- },
130
- data() {
131
- return {
132
- ICONS: Object.freeze(ICONS),
133
- ICON_SIZES: Object.freeze(ICON_SIZES),
134
- BUTTON_TYPES: Object.freeze(BUTTON_TYPES),
135
- COLORS: Object.freeze(BUTTON_COLORS),
136
- RADIUSES: Object.freeze(BUTTON_RADIUSES),
137
- SIZES: Object.freeze(BUTTON_SIZES),
138
- STATES: Object.freeze(BUTTON_STATES),
139
- ELEVATIONS: Object.freeze(BUTTON_ELEVATIONS),
140
- };
141
- },
142
- computed: {
143
- iconSize(): string {
144
- if (this.size === this.SIZES.SMALL || this.size === this.SIZES.MEDIUM) {
145
- return ICON_SIZES.XX_SMALL;
146
- }
147
- return ICON_SIZES.X_SMALL;
148
- },
149
- colorClassName(): string {
150
- return `-ds-color-${this.color}`;
151
- },
152
- loadingIconSize(): string {
153
- if (this.size === BUTTON_SIZES.LARGE) {
154
- return ICON_SIZES.MEDIUM;
155
- }
103
+ const loadingIconSize = computed((): IconSize => {
104
+ if (size === BUTTON_SIZES.LARGE) {
105
+ return ICON_SIZES.MEDIUM;
106
+ }
156
107
 
157
- if (this.size === BUTTON_SIZES.SMALL) {
158
- return ICON_SIZES.X_SMALL;
159
- }
108
+ if (size === BUTTON_SIZES.SMALL) {
109
+ return ICON_SIZES.X_SMALL;
110
+ }
160
111
 
161
- return ICON_SIZES.SMALL;
162
- },
163
- },
112
+ return ICON_SIZES.SMALL;
164
113
  });
165
114
  </script>
@@ -0,0 +1,87 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { mount } from '@vue/test-utils';
3
+ import { h } from 'vue';
4
+ import HelpButton from './HelpButton.vue';
5
+ import Modal from '../../Modals/Modal';
6
+ import { ComponentProps, ComponentSlots } from 'vue-component-type-helpers';
7
+ import Tooltip from '../../Tooltip';
8
+
9
+ function setup(
10
+ props: ComponentProps<typeof HelpButton> = {},
11
+ slots: ComponentSlots<typeof HelpButton> = {
12
+ modal: ({ onClose }) => [h(Modal, { onCloseModal: onClose }, () => 'Test')],
13
+ },
14
+ attrs?: Record<string, unknown>,
15
+ ) {
16
+ return mount(HelpButton, {
17
+ props,
18
+ // @ts-expect-error - it looks like a bug in vue-component-type-helpers or vue-test-utils
19
+ slots,
20
+ attrs,
21
+ global: {
22
+ directives: {
23
+ pvTooltip: () => {},
24
+ },
25
+ stubs: {
26
+ teleport: true,
27
+ },
28
+ },
29
+ });
30
+ }
31
+
32
+ describe('HelpButton', () => {
33
+ it('should render', () => {
34
+ const wrapper = setup();
35
+
36
+ expect(wrapper.exists()).toBe(true);
37
+ });
38
+
39
+ it('should pass attributes to the button', () => {
40
+ const wrapper = setup({}, undefined, {
41
+ class: 'customClass',
42
+ id: 'testId',
43
+ });
44
+
45
+ expect(wrapper.find('.ds-iconButton').classes()).toContain('customClass');
46
+ expect(wrapper.find('.ds-iconButton').attributes('id')).toContain('testId');
47
+ });
48
+
49
+ it('should open and close the modal', async () => {
50
+ const wrapper = setup();
51
+
52
+ expect(wrapper.find('.ds-modal').exists()).toBe(false);
53
+
54
+ await wrapper.find('.ds-iconButton').trigger('click');
55
+
56
+ expect(wrapper.find('.ds-modal').exists()).toBe(true);
57
+
58
+ const closeButton = wrapper.find('[data-test-selector="ds-modal__closeButton"]');
59
+ await closeButton.trigger('click');
60
+
61
+ expect(wrapper.find('.ds-modal').exists()).toBe(false);
62
+ });
63
+
64
+ it('renders with tooltip', () => {
65
+ const wrapper = setup({
66
+ tooltipText: 'Tooltip text',
67
+ });
68
+
69
+ expect(wrapper.findComponent(Tooltip).props().text).toBe('Tooltip text');
70
+ });
71
+
72
+ it('should accept modalTitle prop and modalContent slot', async () => {
73
+ const wrapper = setup(
74
+ {
75
+ modalTitle: 'Test Title',
76
+ },
77
+ {
78
+ modalContent: () => [h('div', 'Test Content')],
79
+ },
80
+ );
81
+
82
+ await wrapper.find('.ds-iconButton').trigger('click');
83
+
84
+ expect(wrapper.find('.ds-modal__headerTitle').text()).toBe('Test Title');
85
+ expect(wrapper.find('.ds-modal__slotContent').text()).toBe('Test Content');
86
+ });
87
+ });
@@ -0,0 +1,70 @@
1
+ import { toRefs } from 'vue';
2
+ import { Meta, StoryObj } from '@storybook/vue3';
3
+ import HelpButton from './HelpButton.vue';
4
+ import Modal, { MODAL_SIZES } from '../../Modals/Modal';
5
+ import { ComponentProps, ComponentSlots } from 'vue-component-type-helpers';
6
+ import DsBanner, { BANNER_COLORS } from '../../Banner';
7
+
8
+ const meta: Meta<ComponentProps<typeof HelpButton> & ComponentSlots<typeof HelpButton>> = {
9
+ title: 'Components/Buttons/HelpButton',
10
+ component: HelpButton,
11
+ render: (args) => ({
12
+ components: { HelpButton, Modal, DsBanner },
13
+ setup() {
14
+ const { tooltipText, modalTitle, modalContent, modalSize, isDisabled } = toRefs(args);
15
+
16
+ return {
17
+ tooltipText,
18
+ isDisabled,
19
+ modalTitle,
20
+ modalContent,
21
+ modalSize,
22
+ BANNER_COLORS,
23
+ };
24
+ },
25
+ template: `<HelpButton :tooltip-text="tooltipText" :modal-title="modalTitle" :modal-size="modalSize" :is-disabled="isDisabled">
26
+ <template v-if="modalContent || modalTitle" #modalContent>
27
+ <div v-html="modalContent" />
28
+ </template>
29
+ <template v-else #modal="{onClose}">
30
+ <modal @close-modal="onClose">test</modal>
31
+ </template>
32
+ </HelpButton>
33
+ <ds-banner style="margin-top: 20px;" :color="BANNER_COLORS.WARNING" title="Uwaga, z uwagi na brak lokalizacji w DS, na Modalu (tworzonym za pomocą propsa modalTitle i slota modalContent) nie wyświetla się Button w footerze do zamykania modala. Poprawimy to w ramach LMS-2762. Jako alternatywa można skorzystać ze slota modal i wstawić do modala co się chce ;)" />`,
34
+ }),
35
+ argTypes: {
36
+ modalTitle: {
37
+ control: 'text',
38
+ },
39
+ modalContent: {
40
+ control: 'text',
41
+ },
42
+ modalSize: {
43
+ control: 'select',
44
+ options: Object.values(MODAL_SIZES),
45
+ },
46
+ isDisabled: {
47
+ control: 'boolean',
48
+ },
49
+ },
50
+ };
51
+ export default meta;
52
+
53
+ type Story = StoryObj<typeof HelpButton>;
54
+
55
+ export const Interactive: Story = {
56
+ args: {
57
+ tooltipText: 'Tooltip text',
58
+ isDisabled: false,
59
+ modalContent: '',
60
+ modalTitle: '',
61
+ modalSize: MODAL_SIZES.MEDIUM,
62
+ },
63
+ };
64
+
65
+ Interactive.parameters = {
66
+ design: {
67
+ type: 'figma',
68
+ url: 'https://www.figma.com/design/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=13519-192453',
69
+ },
70
+ };
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <tooltip :text="tooltipText" :inline="true">
3
+ <icon-button
4
+ :icon="ICONS.FA_CIRCLE_QUESTION"
5
+ :color="ICON_BUTTON_COLORS.NEUTRAL_WEAK"
6
+ :size="ICON_BUTTON_SIZES.X_SMALL"
7
+ :state="isDisabled ? ICON_BUTTON_STATES.DISABLED : ICON_BUTTON_STATES.DEFAULT"
8
+ :touchable="false"
9
+ v-bind="$attrs"
10
+ @click="isOpen = true"
11
+ />
12
+ </tooltip>
13
+ <slot v-if="isOpen" name="modal" :on-close="onClose">
14
+ <modal :header-title="modalTitle" :size="modalSize" @close-modal="onClose">
15
+ <slot name="modalContent" />
16
+ </modal>
17
+ </slot>
18
+ </template>
19
+
20
+ <script lang="ts" setup>
21
+ import { ref } from 'vue';
22
+ import IconButton, {
23
+ ICON_BUTTON_COLORS,
24
+ ICON_BUTTON_SIZES,
25
+ ICON_BUTTON_STATES,
26
+ } from '../IconButton';
27
+ import Tooltip from '../../Tooltip';
28
+ import { ICONS } from '../../Icons/Icon';
29
+ import Modal, { ModalSize } from '../../Modals/Modal';
30
+
31
+ defineProps<{
32
+ tooltipText?: string;
33
+ isDisabled?: boolean;
34
+ modalTitle?: string;
35
+ modalSize?: ModalSize;
36
+ }>();
37
+
38
+ defineSlots<{
39
+ modal?: (props: { onClose: () => void }) => any;
40
+ modalContent?: () => any;
41
+ }>();
42
+
43
+ defineOptions({
44
+ inheritAttrs: false,
45
+ });
46
+
47
+ const isOpen = ref(false);
48
+
49
+ const onClose = () => {
50
+ isOpen.value = false;
51
+ };
52
+ </script>
@@ -0,0 +1,3 @@
1
+ import HelpButton from './HelpButton.vue';
2
+
3
+ export default HelpButton;
@@ -1,5 +1,12 @@
1
1
  import { Value } from '../../../utils/type.utils';
2
2
 
3
+ export const CARD_PADDING_SIZES = {
4
+ SMALL: 'small',
5
+ LARGE: 'large',
6
+ };
7
+
8
+ export type CardPaddingSize = Value<typeof CARD_PADDING_SIZES>;
9
+
3
10
  export const CARD_BORDER_COLORS = {
4
11
  NEUTRAL_HEAVY: 'neutralHeavy',
5
12
  NEUTRAL_STRONG: 'neutralStrong',
@@ -1,36 +1,13 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { shallowMount } from '@vue/test-utils';
2
+ import { ComponentMountingOptions, mount } from '@vue/test-utils';
3
+ import { h } from 'vue';
3
4
 
4
5
  import Card from './Card.vue';
5
- import { CARD_BORDER_COLORS, CARD_BORDER_POSITIONS, CARD_BORDER_SIZES } from './Card.consts';
6
- import { LOADING_BAR_COLORS } from '../../LoadingBar';
6
+ import { CARD_PADDING_SIZES } from './Card.consts';
7
7
 
8
8
  describe('Card', () => {
9
- const createComponent = ({
10
- headerSlot = '',
11
- contentSlot = '',
12
- footerSlot = '',
13
- headerHasPadding = false,
14
- dividerUnderHeader = false,
15
- } = {}) => {
16
- return shallowMount(Card, {
17
- props: {
18
- headerHasPadding,
19
- dividerUnderHeader,
20
- hasBorder: false,
21
- borderSize: CARD_BORDER_SIZES.MEDIUM,
22
- borderColor: CARD_BORDER_COLORS.NEUTRAL_HEAVY,
23
- borderPosition: CARD_BORDER_POSITIONS.TOP,
24
- hasLoadingBar: false,
25
- loadingBarColor: LOADING_BAR_COLORS.NEUTRAL_HEAVY,
26
- loadingBarTime: '0',
27
- },
28
- slots: {
29
- ...(headerSlot !== '' && { header: headerSlot }),
30
- ...(contentSlot !== '' && { content: contentSlot }),
31
- ...(footerSlot !== '' && { footer: footerSlot }),
32
- },
33
- });
9
+ const createComponent = (options: ComponentMountingOptions<typeof Card> = {}) => {
10
+ return mount(Card, options);
34
11
  };
35
12
 
36
13
  it('should create', () => {
@@ -47,51 +24,85 @@ describe('Card', () => {
47
24
 
48
25
  it('should render content slot', () => {
49
26
  const content = 'Wpłynąlem na suchego przestwór oceanu';
50
- const component = createComponent({ contentSlot: content });
27
+ const component = createComponent({
28
+ slots: {
29
+ content: () => [h('span', content)],
30
+ },
31
+ });
51
32
 
52
33
  expect(component.find('.ds-card__content').text()).toContain(content);
53
34
  });
54
35
 
55
36
  it('should render header slot', () => {
56
37
  const header = 'Wpłynąlem na suchego przestwór oceanu';
57
- const component = createComponent({ headerSlot: header });
38
+ const component = createComponent({
39
+ slots: {
40
+ header: () => [h('span', header)],
41
+ },
42
+ });
58
43
 
59
44
  expect(component.text()).toContain(header);
60
45
  });
61
46
 
62
47
  it('should render footer slot', () => {
63
48
  const footer = 'Wpłynąlem na suchego przestwór oceanu';
64
- const component = createComponent({ footerSlot: footer });
49
+ const component = createComponent({
50
+ slots: {
51
+ footer: () => [h('span', footer)],
52
+ },
53
+ });
65
54
 
66
55
  expect(component.text()).toContain(footer);
67
56
  });
68
57
 
69
58
  it('should render header slot with padding', () => {
70
59
  const header = 'Wpłynąlem na suchego przestwór oceanu';
71
- const component = createComponent({ headerSlot: header, headerHasPadding: true });
60
+ const component = createComponent({
61
+ props: { headerHasPadding: true },
62
+ slots: { header: () => [h('span', header)] },
63
+ });
72
64
 
73
65
  expect(component.find('.ds-card__header').classes()).toContain('-ds-withPadding');
74
66
  });
75
67
 
68
+ it('should render footer slot with padding', () => {
69
+ const footer = 'Wpłynąlem na suchego przestwór oceanu';
70
+ const component = createComponent({
71
+ props: { footerHasPadding: true },
72
+ slots: {
73
+ footer: () => [h('span', footer)],
74
+ },
75
+ });
76
+
77
+ expect(component.find('.ds-card__footer').classes()).toContain('-ds-withPadding');
78
+ });
79
+
76
80
  it('should render divider', () => {
77
81
  const header = 'Wpłynąlem na suchego przestwór oceanu';
78
82
  const component = createComponent({
79
- headerSlot: header,
80
- contentSlot: 'asd',
81
- dividerUnderHeader: true,
83
+ props: {
84
+ dividerUnderHeader: true,
85
+ },
86
+ slots: {
87
+ header: () => [h('span', header)],
88
+ content: () => [h('span', 'asd')],
89
+ },
82
90
  });
83
91
 
84
92
  expect(component.find('.ds-card__headerDivider').exists()).toBe(true);
85
93
  });
86
94
 
87
95
  it("doesn't render divider when no header", () => {
88
- const component = createComponent({ dividerUnderHeader: true });
96
+ const component = createComponent({ props: { dividerUnderHeader: true } });
89
97
 
90
98
  expect(component.find('.ds-card__headerDivider').exists()).toBe(false);
91
99
  });
92
100
 
93
101
  it("doesn't render divider when no content", () => {
94
- const component = createComponent({ headerSlot: 'test', dividerUnderHeader: true });
102
+ const component = createComponent({
103
+ props: { dividerUnderHeader: true },
104
+ slots: { header: () => [h('span', 'test')] },
105
+ });
95
106
 
96
107
  expect(component.find('.ds-card__headerDivider').exists()).toBe(false);
97
108
  });
@@ -99,14 +110,48 @@ describe('Card', () => {
99
110
  it('should render divider with margin if headerHasPadding', () => {
100
111
  const header = 'Wpłynąlem na suchego przestwór oceanu';
101
112
  const component = createComponent({
102
- headerSlot: header,
103
- contentSlot: 'asd',
104
- dividerUnderHeader: true,
105
- headerHasPadding: true,
113
+ props: {
114
+ dividerUnderHeader: true,
115
+ headerHasPadding: true,
116
+ },
117
+ slots: {
118
+ header: () => [h('span', header)],
119
+ content: () => [h('span', 'asd')],
120
+ },
106
121
  });
107
122
 
108
123
  expect(component.find('.ds-card__headerDivider').classes()).toContain(
109
124
  '-ds-withHorizontalMargin',
110
125
  );
111
126
  });
127
+
128
+ it('should set large padding class', () => {
129
+ const component = createComponent({
130
+ props: { paddingSize: CARD_PADDING_SIZES.LARGE },
131
+ });
132
+
133
+ expect(component.find('.ds-card').classes()).toContain('-ds-paddingLarge');
134
+ });
135
+
136
+ it('should not set large padding class', () => {
137
+ const component = createComponent({
138
+ props: { paddingSize: CARD_PADDING_SIZES.SMALL },
139
+ });
140
+
141
+ expect(component.find('.ds-card').classes()).not.toContain('-ds-paddingLarge');
142
+ });
143
+
144
+ it('should not set flat class by default', () => {
145
+ const component = createComponent();
146
+
147
+ expect(component.find('.ds-card').classes()).not.toContain('-ds-flat');
148
+ });
149
+
150
+ it('should set flat class', () => {
151
+ const component = createComponent({
152
+ props: { isFlat: true },
153
+ });
154
+
155
+ expect(component.find('.ds-card').classes()).toContain('-ds-flat');
156
+ });
112
157
  });