@bethinkpl/design-system 26.16.0 → 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.
- package/dist/RadioButton-BWi6jLxx.js +63 -0
- package/dist/RadioButton-BWi6jLxx.js.map +1 -0
- package/dist/RadioButton-DSmKwvPr.js +63 -0
- package/dist/RadioButton-DSmKwvPr.js.map +1 -0
- package/dist/design-system.js +266 -0
- package/dist/design-system.js.map +1 -0
- package/dist/design-system.umd.cjs +18 -18
- package/dist/design-system.umd.cjs.map +1 -1
- package/dist/index-BzPDEKft.js +24356 -0
- package/dist/index-BzPDEKft.js.map +1 -0
- package/dist/index-Oq81NaeJ.js +1388 -0
- package/dist/index-Oq81NaeJ.js.map +1 -0
- package/dist/index-UMXgzRbZ.js +24356 -0
- package/dist/index-UMXgzRbZ.js.map +1 -0
- package/dist/lib/js/components/Banner/Banner.consts.d.ts +4 -4
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +49 -1824
- package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +41 -443
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +77 -427
- package/dist/lib/js/components/Cards/Card/Card.consts.d.ts +5 -0
- package/dist/lib/js/components/Cards/Card/Card.vue.d.ts +52 -175
- package/dist/lib/js/components/Cards/Card/index.d.ts +1 -0
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +116 -154
- package/dist/lib/js/components/Chip/Chip.vue.d.ts +77 -427
- package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +2 -0
- package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +507 -1557
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +77 -426
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +1 -0
- package/dist/lib/js/components/Form/Checkbox/Checkbox.vue.d.ts +1 -0
- package/dist/lib/js/components/Form/InputField/InputField.types.d.ts +1 -0
- package/dist/lib/js/components/Form/InputField/InputField.vue.d.ts +6 -0
- package/dist/lib/js/components/Form/InputField/useInputFieldWithinForm.d.ts +8 -0
- package/dist/lib/js/components/Form/PasswordField/PasswordField.vue.d.ts +6 -0
- package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +1 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +77 -426
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +76 -426
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.consts.d.ts +17 -11
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue.d.ts +22 -138
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +1 -0
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +1 -0
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +266 -1079
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +270 -1082
- package/dist/lib/js/components/Outline/OutlineItem/OutlineItem.vue.d.ts +1 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +78 -426
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +2 -1
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +1 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +6 -4
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +4 -2
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue.d.ts +1 -0
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +1 -0
- package/dist/lib/js/components/SelectionTile/SelectionTile.vue.d.ts +3 -0
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +1 -0
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +1 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +262 -1002
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +268 -1008
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +1 -0
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +104 -1806
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +1 -0
- package/dist/lib/js/components/Toast/Toast.vue.d.ts +188 -579
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +1 -0
- package/dist/lib/js/icons/fontawesome.d.ts +1 -0
- package/dist/lib/js/index.d.ts +3 -1
- package/dist/lib/js/tests/helpers.d.ts +1 -0
- package/dist/pl-C3BEVRTZ.js +91 -0
- package/dist/pl-C3BEVRTZ.js.map +1 -0
- package/docs/assets/{AccessStatus-DW-L4l_0.js → AccessStatus-DGd8XBwr.js} +1 -1
- package/docs/assets/{AccessStatus.stories-DwCxxAOP.js → AccessStatus.stories-BUpfD_Uw.js} +1 -1
- package/docs/assets/{Avatar-CRVC-fPA.js → Avatar-DJEZDpOI.js} +1 -1
- package/docs/assets/{Avatar.stories-D7i8UwP9.js → Avatar.stories-D40fYcFF.js} +1 -1
- package/docs/assets/{Badge-h4Z2ZKD4.js → Badge-B8eFbzRx.js} +1 -1
- package/docs/assets/{Badge.stories-Bl04pHS_.js → Badge.stories-DxdwaS-k.js} +3 -3
- package/docs/assets/{BadgeScore-CuteYyZb.js → BadgeScore-ByouU1Eu.js} +1 -1
- package/docs/assets/{BadgeScore.stories-BvHEI0pW.js → BadgeScore.stories-DsodV82W.js} +1 -1
- package/docs/assets/Banner-D5riYdGJ.js +1 -0
- package/docs/assets/Banner.stories-Ch0_NPk4.js +64 -0
- package/docs/assets/{BasicRichListItem-C93Qb4K6.js → BasicRichListItem-NMNh0Xfo.js} +1 -1
- package/docs/assets/{BasicRichListItem.stories-B2smX5s7.js → BasicRichListItem.stories-Gu9n5wvW.js} +2 -2
- package/docs/assets/{BlockadeStatus-B0FY65_h.js → BlockadeStatus-Dqr_LSfC.js} +1 -1
- package/docs/assets/{BlockedeStatus.stories-DZ1mfq2q.js → BlockedeStatus.stories-BKblKF33.js} +1 -1
- package/docs/assets/Button-XuK8IxnR.js +1 -0
- package/docs/assets/{Button.stories-BOpQOZ6x.js → Button.stories-UiGEsaro.js} +5 -3
- package/docs/assets/Card-BhK1CiCP.js +1 -0
- package/docs/assets/Card.stories-BfWbSV_u.js +33 -0
- package/docs/assets/{CardExpandable-BMUVeR31.js → CardExpandable-CPuSx_lW.js} +1 -1
- package/docs/assets/{CardExpandable.stories-CPAZ4mof.js → CardExpandable.stories-mHnNt6zg.js} +1 -1
- package/docs/assets/{Checkbox-CIfSektM.js → Checkbox-g1Bvy8z-.js} +1 -1
- package/docs/assets/{Checkbox.stories-Dt5C89R2.js → Checkbox.stories-DdJRLzJy.js} +1 -1
- package/docs/assets/{Chip-Bi-iKYH0.js → Chip-CGm2pLPD.js} +1 -1
- package/docs/assets/{Chip.stories-BukfI_wY.js → Chip.stories-CnHjkDSI.js} +1 -1
- package/docs/assets/Color-ERTF36HU-8BveRk6J.js +1 -0
- package/docs/assets/{Colors.stories-yICh_E96.js → Colors.stories-BtNgjWxi.js} +1 -1
- package/docs/assets/{ColorsThemes.stories-CKiphr3E.js → ColorsThemes.stories-Ct0Ai41o.js} +1 -1
- package/docs/assets/{ColorsTokensLms.stories-C_hRq1fa.js → ColorsTokensLms.stories-BP-WMJrS.js} +1 -1
- package/docs/assets/{ColorsTokensPrimaryBodywork.stories-TzJMcnGg.js → ColorsTokensPrimaryBodywork.stories-zdX-tf4x.js} +1 -1
- package/docs/assets/{ColorsTokensPrimaryWnl.stories-CCArJaTw.js → ColorsTokensPrimaryWnl.stories-DFVUj_99.js} +1 -1
- package/docs/assets/{CounterToggle-D3jTLdlU.js → CounterToggle-B9hjjWpv.js} +1 -1
- package/docs/assets/{CounterToggle.stories-BZAgprZf.js → CounterToggle.stories-BtS63BEz.js} +1 -1
- package/docs/assets/{DateBox.stories-CNTaIflE.js → DateBox.stories-B7PTVLxc.js} +1 -1
- package/docs/assets/{DatePicker-aMS5YOMW.js → DatePicker-70Dj0lsn.js} +1 -1
- package/docs/assets/{DatePicker.stories-DnojtGGT.js → DatePicker.stories-DZN51CwX.js} +1 -1
- package/docs/assets/{DateRangePicker-B25oMOoU.js → DateRangePicker-D5bqKMMk.js} +1 -1
- package/docs/assets/{DateRangePicker.stories-CaIkM98h.js → DateRangePicker.stories-WhCXoUeh.js} +1 -1
- package/docs/assets/{Divider-BNN8PhWF.js → Divider-NOTDPuJ1.js} +1 -1
- package/docs/assets/{Divider.stories-DQGq5WIM.js → Divider.stories-Cjyx7utt.js} +1 -1
- package/docs/assets/{DocsRenderer-CFRXHY34-DsMNfqFA.js → DocsRenderer-CFRXHY34-BThTLMHt.js} +72 -72
- package/docs/assets/{Drawer-CgEP8-bU.js → Drawer-CrAn35Yo.js} +1 -1
- package/docs/assets/{Drawer.stories-CetCbwOV.js → Drawer.stories-iInS0JV5.js} +1 -1
- package/docs/assets/{DrawerContent-Dna0k_5V.js → DrawerContent-DAIzyQNz.js} +1 -1
- package/docs/assets/{DrawerContent.stories-BqJ3zitz.js → DrawerContent.stories-CBpbbVk_.js} +1 -1
- package/docs/assets/{DrawerDivider-BjBlvEOJ.js → DrawerDivider-CKRXkKRz.js} +1 -1
- package/docs/assets/{DrawerDivider.stories-BN_G8JML.js → DrawerDivider.stories-iQ2J_ExP.js} +1 -1
- package/docs/assets/DrawerHeader-DPBlervR.js +1 -0
- package/docs/assets/{DrawerHeader.stories-CsM4PkKY.js → DrawerHeader.stories-ugFv_siA.js} +1 -1
- package/docs/assets/{DrawerListItem-BOEqjnvB.js → DrawerListItem-ClOcwiVc.js} +1 -1
- package/docs/assets/{DrawerListItem.stories-Br_BBZTl.js → DrawerListItem.stories-BMZ35_qS.js} +1 -1
- package/docs/assets/{DrawerListItemGroup-qG_7CJ2Z.js → DrawerListItemGroup-SEWltKLJ.js} +1 -1
- package/docs/assets/{DrawerListItemGroup.stories-Dj7XnOfZ.js → DrawerListItemGroup.stories-Bn2TyQLH.js} +1 -1
- package/docs/assets/DrawerSection-ByJjEPPu.js +1 -0
- package/docs/assets/{DrawerSection.stories-bac3ulNN.js → DrawerSection.stories-DuLphbcs.js} +1 -1
- package/docs/assets/{DrawerTile-3UrW0AGT.js → DrawerTile-BGQvQQSp.js} +1 -1
- package/docs/assets/DrawerTile.stories-DCe2L4Tv.js +10 -0
- package/docs/assets/{Dropdown-vkyblifO.js → Dropdown-Bdrd2ZIh.js} +1 -1
- package/docs/assets/{Dropdown.stories-Bvkxpx3n.js → Dropdown.stories-DnkREwa1.js} +2 -2
- package/docs/assets/FeatureIcon-DY5WvpPf.js +1 -0
- package/docs/assets/{FeatureIcon.stories-D1igtEZB.js → FeatureIcon.stories-BqYqiSzM.js} +1 -1
- package/docs/assets/FormField-BjLFip7T.js +1 -0
- package/docs/assets/{FormField.stories-DXTo4Z_Y.js → FormField.stories-DY8Mz4YE.js} +1 -1
- package/docs/assets/{FormField.stories.shared-D4ktxakv.js → FormField.stories.shared-3_36NKi_.js} +1 -1
- package/docs/assets/{FormFieldMessage-JNi0OUbH.js → FormFieldMessage-B4Oy2QBT.js} +1 -1
- package/docs/assets/{FormFieldMessage.stories-lK_yWKrc.js → FormFieldMessage.stories-BD7JfJNj.js} +1 -1
- package/docs/assets/{GroupRichListItem-D8nu5Fv9.js → GroupRichListItem-CHiSrcou.js} +1 -1
- package/docs/assets/{GroupRichListItem.stories-DKL_YGxk.js → GroupRichListItem.stories-C3EubvlY.js} +1 -1
- package/docs/assets/HelpButton-BStTtLsz.js +1 -0
- package/docs/assets/{HelpButton.stories-D4-sk1wV.js → HelpButton.stories-C3-CU20F.js} +1 -1
- package/docs/assets/Icon-DUeXRUm6.js +761 -0
- package/docs/assets/{Icon.stories-DaFYO7BK.js → Icon.stories-ClzUno-E.js} +1 -1
- package/docs/assets/IconButton-Cn83Zk5-.js +1 -0
- package/docs/assets/{IconButton.stories-BB9x50r9.js → IconButton.stories-CwZts8kF.js} +6 -6
- package/docs/assets/{IconText-Bl-DK5dv.js → IconText-Colreg4i.js} +1 -1
- package/docs/assets/{IconText.stories-BbDEYbhY.js → IconText.stories-DSZffl3k.js} +1 -1
- package/docs/assets/{Image-DXVGtCU-.js → Image-B7PRENWe.js} +1 -1
- package/docs/assets/{Image.stories-CmX0xWLp.js → Image.stories-DkYrm30P.js} +1 -1
- package/docs/assets/InputField-CplPTgjC.js +5 -0
- package/docs/assets/{InputField.stories-B6VUcIZA.js → InputField.stories-K675XZL5.js} +1 -1
- package/docs/assets/{ItemsList-BT-ch5Ki.js → ItemsList-nTRSgJDP.js} +1 -1
- package/docs/assets/{LoadingBar-CoXHVlvM.js → LoadingBar-DGNrwKu4.js} +1 -1
- package/docs/assets/{LoadingBar.stories-B_l4HaQT.js → LoadingBar.stories-owR_6Oqy.js} +1 -1
- package/docs/assets/{Modal-xuXnp0B3.js → Modal-ByQBkOMU.js} +1 -1
- package/docs/assets/{Modal.stories-BSYz4NUn.js → Modal.stories-DlxDxfN1.js} +1 -1
- package/docs/assets/{ModalDialog-D6jipNV9.js → ModalDialog-Cr21J58H.js} +1 -1
- package/docs/assets/{ModalDialog.stories-y0DTZLJ9.js → ModalDialog.stories-DP4FjijI.js} +1 -1
- package/docs/assets/{NumberInCircle-iJQYZsfG.js → NumberInCircle-CE28_Nsz.js} +1 -1
- package/docs/assets/{NumberInCircle.stories-BL7R6Ey9.js → NumberInCircle.stories-DFdUVSKM.js} +1 -1
- package/docs/assets/{OutlineDivider-DpgF_2B_.js → OutlineDivider-DJ9pnpJN.js} +1 -1
- package/docs/assets/{OutlineDivider.stories-CoI8u05k.js → OutlineDivider.stories-Dzpei9KR.js} +1 -1
- package/docs/assets/{OutlineItem-COSzRi1t.js → OutlineItem-CApzlES7.js} +1 -1
- package/docs/assets/{OutlineItem.stories-DPbUVNt7.js → OutlineItem.stories-DtEAJjzy.js} +1 -1
- package/docs/assets/{OutlineSectionHeader-C7vAvTfl.js → OutlineSectionHeader-CSNr7XVB.js} +1 -1
- package/docs/assets/{OutlineSectionHeader.stories-DTI32viO.js → OutlineSectionHeader.stories-CuJwkOKg.js} +1 -1
- package/docs/assets/OverlayHeader-B5ajrI4B.js +1 -0
- package/docs/assets/{OverlayHeader.stories-Daj1gEMT.js → OverlayHeader.stories-Zed9WXER.js} +2 -2
- package/docs/assets/{PageHeader-BKDJxn58.js → PageHeader-Cy-UHuRb.js} +1 -1
- package/docs/assets/{PageHeader.stories-BRdESIfF.js → PageHeader.stories-DlW4dler.js} +1 -1
- package/docs/assets/Pagination-D34dUtsQ.js +1 -0
- package/docs/assets/{Pagination.stories-pk1h1NdC.js → Pagination.stories-IDi5nqa_.js} +2 -2
- package/docs/assets/PasswordField-Bkc6j8ri.js +1 -0
- package/docs/assets/{PasswordField.stories-BMwEm_DO.js → PasswordField.stories-CklmsmJF.js} +1 -1
- package/docs/assets/{PopOver-BjBlXVwF.js → PopOver-DVj1_TNg.js} +1 -1
- package/docs/assets/{PopOver.stories-3QX4Ga4o.js → PopOver.stories-BljOgM3Z.js} +2 -2
- package/docs/assets/{ProgressBar-VrWJHC2p.js → ProgressBar-D2hkMeQ0.js} +1 -1
- package/docs/assets/{ProgressBar.stories-CrZ2zJwI.js → ProgressBar.stories-BDHI6-tO.js} +1 -1
- package/docs/assets/{ProgressDonutChart-CJlokRW-.js → ProgressDonutChart-CBO-vy-E.js} +1 -1
- package/docs/assets/{ProgressDonutChart.stories-BRxY2dWI.js → ProgressDonutChart.stories-CGwlVICI.js} +1 -1
- package/docs/assets/{RadioButton-DO6I2WfN.js → RadioButton-Bd-D-2PY.js} +1 -1
- package/docs/assets/{RadioButton.stories-C80hUDbi.js → RadioButton.stories-BkCwnbIp.js} +1 -1
- package/docs/assets/{RichListItem.stories-_8Hp41y-.js → RichListItem.stories-Bls_aY12.js} +2 -2
- package/docs/assets/SectionHeader-isKXGfjn.js +1 -0
- package/docs/assets/{SectionHeader.stories-BjccJa_1.js → SectionHeader.stories-Bj3scOLc.js} +1 -1
- package/docs/assets/{SectionTitle-DElPh1Y0.js → SectionTitle-wTuJZZVS.js} +1 -1
- package/docs/assets/{SectionTitle.stories-BOEziRr6.js → SectionTitle.stories-Dr3KOvIl.js} +1 -1
- package/docs/assets/{SelectList-IYj9X3z5.js → SelectList-YMQ8rEMc.js} +1 -1
- package/docs/assets/{SelectList.stories-B0jlx1dv.js → SelectList.stories-ETdEOJ81.js} +1 -1
- package/docs/assets/{SelectListItem-DxlYAAqR.js → SelectListItem-BqKhIPSO.js} +1 -1
- package/docs/assets/{SelectListItem.stories-Cbgqd3q6.js → SelectListItem.stories-ClyL-djS.js} +1 -1
- package/docs/assets/{SelectListItemDivider-Bt5LuCh6.js → SelectListItemDivider-CTU7_4OL.js} +1 -1
- package/docs/assets/{SelectListItemDivider.stories-BFdzCK8L.js → SelectListItemDivider.stories-rGpk0Yeg.js} +1 -1
- package/docs/assets/{SelectListItemTile-Ci7UUkBi.js → SelectListItemTile-BhOwBFIO.js} +1 -1
- package/docs/assets/SelectListItemTile.stories-BXFfuX9q.js +19 -0
- package/docs/assets/{SelectListItemToggle-uyZKP9l-.js → SelectListItemToggle-C0lffqeC.js} +1 -1
- package/docs/assets/{SelectListItemToggle.stories-CHKImbbO.js → SelectListItemToggle.stories-D39XrmtN.js} +1 -1
- package/docs/assets/{SelectListSectionTitle-CytprfLI.js → SelectListSectionTitle-B9Dj10G9.js} +1 -1
- package/docs/assets/{SelectListSectionTitle.stories-CHaM0ezF.js → SelectListSectionTitle.stories-DCZ-Sq6v.js} +1 -1
- package/docs/assets/{SelectionControl-D6-Q7FjJ.js → SelectionControl-DIC2vtGo.js} +1 -1
- package/docs/assets/{SelectionTile-BXjJtuZK.js → SelectionTile-D7fhj7-I.js} +2 -2
- package/docs/assets/{SelectionTile.stories-Cdv1DqAb.js → SelectionTile.stories-Cato0iSj.js} +1 -1
- package/docs/assets/{Skeleton-a6juZJ74.js → Skeleton-D5xhZMQa.js} +5 -5
- package/docs/assets/{Skeleton.stories-CU_bwj6g.js → Skeleton.stories-ll-E-sPN.js} +1 -1
- package/docs/assets/{SurveyQuestionOpenEnded-CU362h7V.js → SurveyQuestionOpenEnded-DDdPQe2b.js} +1 -1
- package/docs/assets/{SurveyQuestionOpenEnded.stories-DTfe-q_l.js → SurveyQuestionOpenEnded.stories-mHTUclXK.js} +1 -1
- package/docs/assets/{SurveyQuestionScale-BFW9EZtg.js → SurveyQuestionScale-BKZbW5q7.js} +1 -1
- package/docs/assets/{SurveyQuestionScale.stories-I6PfDZOp.js → SurveyQuestionScale.stories-Cczg5QpY.js} +1 -1
- package/docs/assets/SurveyToggle-Sid2a-IO.js +1 -0
- package/docs/assets/{SurveyToggle.stories-DJz0MG-Y.js → SurveyToggle.stories-Dv7PJARv.js} +1 -1
- package/docs/assets/{Switch-DsNVsFhH.js → Switch-B8xEwHO8.js} +1 -1
- package/docs/assets/{Switch.stories-C1-OEnaq.js → Switch.stories-RbY8wA55.js} +1 -1
- package/docs/assets/{TabItem-KyXcr_5Z.js → TabItem-Ci3vrkRH.js} +1 -1
- package/docs/assets/{TabItem.stories-BfCXfirX.js → TabItem.stories-relncwaI.js} +1 -1
- package/docs/assets/{TextGroup-BGFapzPu.js → TextGroup-dzR19lzs.js} +1 -1
- package/docs/assets/{TextGroup.stories-WgHYdmrz.js → TextGroup.stories-bCLjp0Xb.js} +1 -1
- package/docs/assets/{ThreeColumnLayout-DLj9ww3X.js → ThreeColumnLayout-LVzDOKfj.js} +1 -1
- package/docs/assets/{ThreeColumnLayout.stories-BD0ZEOam.js → ThreeColumnLayout.stories-CkgbTH3p.js} +1 -1
- package/docs/assets/{Tile-CV9qCJCf.js → Tile-ByL6drhn.js} +1 -1
- package/docs/assets/{Tile.sb.shared-CYs-5pZ0.js → Tile.sb.shared-D3LxXPDs.js} +1 -1
- package/docs/assets/Tile.stories-BhXwnkKz.js +12 -0
- package/docs/assets/{Toast-p9LnCPmL.js → Toast-ukLuB2Qi.js} +1 -1
- package/docs/assets/{Toast.stories-zF82pwwv.js → Toast.stories-D3PagUcH.js} +1 -1
- package/docs/assets/{ToggleButton-D_HZ-8jw.js → ToggleButton-YUVnfx-x.js} +1 -1
- package/docs/assets/{ToggleButton.stories-CV-iGLoy.js → ToggleButton.stories-C18YYEsJ.js} +1 -1
- package/docs/assets/{Tooltip-DKqXTPwf.js → Tooltip-BvaJ_K9_.js} +1 -1
- package/docs/assets/{Tooltip.stories-D_SR7U8f.js → Tooltip.stories-o7f8wLv_.js} +4 -4
- package/docs/assets/{TypographyTokensLms.stories-qRJAJdvd.js → TypographyTokensLms.stories-Cm_y52b6.js} +1 -1
- package/docs/assets/{TypographyVariables.stories-B6W3MuIN.js → TypographyVariables.stories-DTHJ_1UO.js} +1 -1
- package/docs/assets/{Well-Di8wsKpw.js → Well-iUOt2HEx.js} +1 -1
- package/docs/assets/{Well.stories-D3CQkZun.js → Well.stories-4VLIlu-l.js} +3 -3
- package/docs/assets/entry-preview-CAn2_StQ.js +1 -0
- package/docs/assets/{entry-preview-docs-Cs1P1b8z.js → entry-preview-docs-Y_6rrjxM.js} +1 -1
- package/docs/assets/{iframe-BH6Q2yq5.js → iframe-D_RvUlhr.js} +11 -11
- package/docs/assets/index-BtMHnMz0.js +1 -0
- package/docs/assets/index-Cpsdq_ip.js +1 -0
- package/docs/assets/preview-B_G3dFbe.js +2 -0
- package/docs/assets/preview-vzvQxRBZ.js +64 -0
- package/docs/assets/string--hkylObx.js +1 -0
- package/docs/assets/vue-popper-m_ujT3wC.js +24 -0
- package/docs/assets/vue.esm-bundler-DcRN7CPI.js +36 -0
- package/docs/iframe.html +1 -1
- package/docs/project.json +1 -1
- package/lib/js/components/Banner/Banner.consts.ts +5 -5
- package/lib/js/components/Banner/Banner.spec.ts +148 -0
- package/lib/js/components/Banner/Banner.stories.ts +13 -8
- package/lib/js/components/Banner/Banner.vue +215 -196
- package/lib/js/components/Buttons/Button/Button.spec.ts +15 -0
- package/lib/js/components/Buttons/Button/Button.stories.ts +6 -0
- package/lib/js/components/Buttons/Button/Button.vue +63 -114
- package/lib/js/components/Cards/Card/Card.consts.ts +7 -0
- package/lib/js/components/Cards/Card/Card.spec.ts +86 -41
- package/lib/js/components/Cards/Card/Card.stories.ts +21 -18
- package/lib/js/components/Cards/Card/Card.vue +128 -88
- package/lib/js/components/Cards/Card/index.ts +1 -0
- package/lib/js/components/Form/InputField/InputField.spec.ts +140 -1
- package/lib/js/components/Form/InputField/InputField.types.ts +1 -0
- package/lib/js/components/Form/InputField/InputField.vue +31 -7
- package/lib/js/components/Form/InputField/useInputFieldWithinForm.ts +54 -0
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.consts.ts +10 -2
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.spec.ts +18 -0
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.stories.ts +1 -1
- package/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue +44 -58
- package/lib/js/components/Modals/Modal/Modal.vue +2 -2
- package/lib/js/components/Modals/ModalDialog/ModalDialog.vue +2 -2
- package/lib/js/icons/fontawesome.ts +2 -0
- package/lib/js/index.ts +4 -1
- package/lib/js/tests/helpers.ts +5 -0
- package/package.json +10 -4
- package/vite.config.ts +2 -7
- package/docs/assets/Banner-sTfmX99M.js +0 -1
- package/docs/assets/Banner.stories-qhUSAG8g.js +0 -62
- package/docs/assets/Button-CRTJWjWJ.js +0 -1
- package/docs/assets/Card-C2-UB9KC.js +0 -1
- package/docs/assets/Card.stories-CI8H4t9g.js +0 -49
- package/docs/assets/Color-ERTF36HU-Cor5XXAu.js +0 -1
- package/docs/assets/DrawerHeader-CYgh5yLP.js +0 -1
- package/docs/assets/DrawerSection-Bk-qjO-U.js +0 -1
- package/docs/assets/DrawerTile.stories-AeySW4m1.js +0 -10
- package/docs/assets/FeatureIcon-DClL1vj4.js +0 -1
- package/docs/assets/FormField-u4PxhF2k.js +0 -1
- package/docs/assets/HelpButton-Lb2k2yp9.js +0 -1
- package/docs/assets/Icon-BxW-ny3A.js +0 -761
- package/docs/assets/IconButton-C0_vxVJn.js +0 -1
- package/docs/assets/InputField-CjqHh5Cm.js +0 -1
- package/docs/assets/OverlayHeader-DYU6A8e-.js +0 -1
- package/docs/assets/Pagination-CruPXU6i.js +0 -1
- package/docs/assets/PasswordField-D2k9x-t0.js +0 -1
- package/docs/assets/SectionHeader-BvZF_uZR.js +0 -1
- package/docs/assets/SelectListItemTile.stories-D53QYgoj.js +0 -19
- package/docs/assets/SurveyToggle-BeOR_ZKx.js +0 -1
- package/docs/assets/Tile.stories-32aU_anv.js +0 -12
- package/docs/assets/_commonjsHelpers-CDR5Xrri.js +0 -1
- package/docs/assets/entry-preview-B1UVjA37.js +0 -1
- package/docs/assets/index-7TY-LtbS.js +0 -1
- package/docs/assets/index-BncE9pY5.js +0 -1
- package/docs/assets/preview-CQnQ4kXS.js +0 -2
- package/docs/assets/preview-RZnfww4F.js +0 -64
- package/docs/assets/string-DZMRm3DC.js +0 -1
- package/docs/assets/vue-popper-CgJSQDC2.js +0 -24
- package/docs/assets/vue.esm-bundler-CC_vsnCp.js +0 -36
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="
|
|
4
|
-
'ds-card'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
:class="[
|
|
4
|
+
'ds-card',
|
|
5
|
+
borderColorClass,
|
|
6
|
+
borderSizeClass,
|
|
7
|
+
{
|
|
8
|
+
'-ds-top-border': hasTopBoarder,
|
|
9
|
+
'-ds-left-border': hasLeftBoarder,
|
|
10
|
+
'-ds-paddingLarge': paddingSize === CARD_PADDING_SIZES.LARGE,
|
|
11
|
+
'-ds-flat': isFlat,
|
|
12
|
+
},
|
|
13
|
+
]"
|
|
10
14
|
>
|
|
11
15
|
<ds-loading-bar
|
|
12
16
|
v-if="hasLoadingBar"
|
|
@@ -30,7 +34,13 @@
|
|
|
30
34
|
<div v-if="$slots.content" class="ds-card__content">
|
|
31
35
|
<slot name="content" />
|
|
32
36
|
</div>
|
|
33
|
-
<
|
|
37
|
+
<div
|
|
38
|
+
v-if="$slots.footer"
|
|
39
|
+
class="ds-card__footer"
|
|
40
|
+
:class="{ '-ds-withPadding': footerHasPadding }"
|
|
41
|
+
>
|
|
42
|
+
<slot name="footer" />
|
|
43
|
+
</div>
|
|
34
44
|
</div>
|
|
35
45
|
</template>
|
|
36
46
|
|
|
@@ -44,12 +54,15 @@
|
|
|
44
54
|
.ds-card {
|
|
45
55
|
$root: &;
|
|
46
56
|
|
|
47
|
-
background-color: $color-default-background;
|
|
48
|
-
border-radius: $radius-m;
|
|
49
|
-
box-shadow: $shadow-s;
|
|
50
57
|
position: relative;
|
|
51
58
|
width: inherit;
|
|
52
59
|
|
|
60
|
+
&:not(.-ds-flat) {
|
|
61
|
+
background-color: $color-default-background;
|
|
62
|
+
border-radius: $radius-m;
|
|
63
|
+
box-shadow: $shadow-s;
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
&.-ds-top-border {
|
|
54
67
|
border-top: $border-l transparent solid;
|
|
55
68
|
}
|
|
@@ -59,32 +72,50 @@
|
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
&.-ds-border-size-small {
|
|
62
|
-
border-radius: $radius-xs;
|
|
63
75
|
border-top-width: $border-s;
|
|
64
76
|
|
|
77
|
+
#{$root}:not(.-ds-flat) & {
|
|
78
|
+
border-radius: $radius-xs;
|
|
79
|
+
}
|
|
80
|
+
|
|
65
81
|
#{$root}__loadingBar {
|
|
66
|
-
border-radius: $radius-xs $radius-xs 0 0;
|
|
67
82
|
top: -$border-s;
|
|
83
|
+
|
|
84
|
+
#{$root}:not(.-ds-flat) & {
|
|
85
|
+
border-radius: $radius-xs $radius-xs 0 0;
|
|
86
|
+
}
|
|
68
87
|
}
|
|
69
88
|
}
|
|
70
89
|
|
|
71
90
|
&.-ds-border-size-medium {
|
|
72
|
-
border-radius: $radius-s;
|
|
73
91
|
border-top-width: $border-m;
|
|
74
92
|
|
|
93
|
+
#{$root}:not(.-ds-flat) & {
|
|
94
|
+
border-radius: $radius-s;
|
|
95
|
+
}
|
|
96
|
+
|
|
75
97
|
#{$root}__loadingBar {
|
|
76
|
-
border-radius: $radius-s $radius-s 0 0;
|
|
77
98
|
top: -$border-m;
|
|
99
|
+
|
|
100
|
+
#{$root}:not(.-ds-flat) & {
|
|
101
|
+
border-radius: $radius-s $radius-s 0 0;
|
|
102
|
+
}
|
|
78
103
|
}
|
|
79
104
|
}
|
|
80
105
|
|
|
81
106
|
&.-ds-border-size-large {
|
|
82
|
-
border-radius: $radius-m;
|
|
83
107
|
border-top-width: $border-l;
|
|
84
108
|
|
|
109
|
+
#{$root}:not(.-ds-flat) & {
|
|
110
|
+
border-radius: $radius-m;
|
|
111
|
+
}
|
|
112
|
+
|
|
85
113
|
#{$root}__loadingBar {
|
|
86
|
-
border-radius: $radius-m $radius-m 0 0;
|
|
87
114
|
top: -$border-l;
|
|
115
|
+
|
|
116
|
+
#{$root}:not(.-ds-flat) & {
|
|
117
|
+
border-radius: $radius-m $radius-m 0 0;
|
|
118
|
+
}
|
|
88
119
|
}
|
|
89
120
|
}
|
|
90
121
|
|
|
@@ -121,23 +152,45 @@
|
|
|
121
152
|
&__header {
|
|
122
153
|
&.-ds-withPadding {
|
|
123
154
|
padding: $space-s;
|
|
155
|
+
|
|
156
|
+
#{$root}.-ds-paddingLarge & {
|
|
157
|
+
padding: $space-l $space-l $space-s;
|
|
158
|
+
}
|
|
124
159
|
}
|
|
125
160
|
}
|
|
126
161
|
|
|
127
162
|
&__headerDivider {
|
|
128
163
|
&.-ds-withHorizontalMargin {
|
|
129
164
|
margin: 0 $space-s;
|
|
165
|
+
|
|
166
|
+
#{$root}.-ds-paddingLarge & {
|
|
167
|
+
margin: 0 $space-l;
|
|
168
|
+
}
|
|
130
169
|
}
|
|
131
170
|
}
|
|
132
171
|
|
|
133
172
|
&__content {
|
|
134
173
|
padding: $space-s;
|
|
174
|
+
|
|
175
|
+
#{$root}.-ds-paddingLarge & {
|
|
176
|
+
padding: $space-s $space-l;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__footer {
|
|
181
|
+
&.-ds-withPadding {
|
|
182
|
+
padding: 0 $space-s $space-s;
|
|
183
|
+
|
|
184
|
+
#{$root}.-ds-paddingLarge & {
|
|
185
|
+
padding: 0 $space-l $space-l;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
135
188
|
}
|
|
136
189
|
}
|
|
137
190
|
</style>
|
|
138
191
|
|
|
139
|
-
<script lang="ts">
|
|
140
|
-
import {
|
|
192
|
+
<script lang="ts" setup>
|
|
193
|
+
import { computed } from 'vue';
|
|
141
194
|
|
|
142
195
|
import DsDivider from '../../Divider/Divider.vue';
|
|
143
196
|
import DsLoadingBar, { LOADING_BAR_COLORS, LoadingBarColors } from '../../LoadingBar';
|
|
@@ -145,79 +198,66 @@ import {
|
|
|
145
198
|
CARD_BORDER_COLORS,
|
|
146
199
|
CARD_BORDER_POSITIONS,
|
|
147
200
|
CARD_BORDER_SIZES,
|
|
201
|
+
CARD_PADDING_SIZES,
|
|
148
202
|
CardBorderColors,
|
|
149
203
|
CardBorderPositions,
|
|
150
204
|
CardBorderSizes,
|
|
205
|
+
CardPaddingSize,
|
|
151
206
|
} from './Card.consts';
|
|
152
207
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
208
|
-
},
|
|
209
|
-
borderColorClass() {
|
|
210
|
-
if (this.hasLoadingBar) {
|
|
211
|
-
return '-ds-border-color-transparent';
|
|
212
|
-
}
|
|
213
|
-
return `-ds-border-color-${this.borderColor}`;
|
|
214
|
-
},
|
|
215
|
-
borderSizeClass() {
|
|
216
|
-
if (!this.hasBorder && !this.hasLoadingBar) {
|
|
217
|
-
return '';
|
|
218
|
-
}
|
|
219
|
-
return `-ds-border-size-${this.borderSize}`;
|
|
220
|
-
},
|
|
221
|
-
},
|
|
208
|
+
const {
|
|
209
|
+
headerHasPadding = false,
|
|
210
|
+
footerHasPadding = false,
|
|
211
|
+
paddingSize = CARD_PADDING_SIZES.SMALL,
|
|
212
|
+
dividerUnderHeader = false,
|
|
213
|
+
hasBorder = false,
|
|
214
|
+
borderPosition = CARD_BORDER_POSITIONS.TOP,
|
|
215
|
+
borderSize = CARD_BORDER_SIZES.LARGE,
|
|
216
|
+
borderColor = CARD_BORDER_COLORS.NEUTRAL_HEAVY,
|
|
217
|
+
hasLoadingBar = false,
|
|
218
|
+
loadingBarColor = LOADING_BAR_COLORS.NEUTRAL_HEAVY,
|
|
219
|
+
loadingBarTime = '0',
|
|
220
|
+
isFlat = false,
|
|
221
|
+
} = defineProps<{
|
|
222
|
+
headerHasPadding?: boolean;
|
|
223
|
+
footerHasPadding?: boolean;
|
|
224
|
+
paddingSize?: CardPaddingSize;
|
|
225
|
+
dividerUnderHeader?: boolean;
|
|
226
|
+
hasBorder?: boolean;
|
|
227
|
+
borderPosition?: CardBorderPositions;
|
|
228
|
+
borderSize?: CardBorderSizes;
|
|
229
|
+
borderColor?: CardBorderColors;
|
|
230
|
+
hasLoadingBar?: boolean;
|
|
231
|
+
loadingBarColor?: LoadingBarColors;
|
|
232
|
+
loadingBarTime?: string;
|
|
233
|
+
isFlat?: boolean;
|
|
234
|
+
}>();
|
|
235
|
+
|
|
236
|
+
defineSlots<{
|
|
237
|
+
header?: () => any;
|
|
238
|
+
content?: () => any;
|
|
239
|
+
footer?: () => any;
|
|
240
|
+
}>();
|
|
241
|
+
|
|
242
|
+
const hasLeftBoarder = computed(() => {
|
|
243
|
+
return hasBorder && borderPosition === CARD_BORDER_POSITIONS.LEFT && !hasLoadingBar;
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
const hasTopBoarder = computed(() => {
|
|
247
|
+
return (hasBorder && borderPosition === CARD_BORDER_POSITIONS.TOP) || hasLoadingBar;
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const borderColorClass = computed(() => {
|
|
251
|
+
if (hasLoadingBar) {
|
|
252
|
+
return '-ds-border-color-transparent';
|
|
253
|
+
}
|
|
254
|
+
return `-ds-border-color-${borderColor}`;
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
const borderSizeClass = computed(() => {
|
|
258
|
+
if (!hasBorder && !hasLoadingBar) {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
return `-ds-border-size-${borderSize}`;
|
|
222
262
|
});
|
|
223
263
|
</script>
|
|
@@ -2,9 +2,11 @@ import { describe, it, expect, vi } from 'vitest';
|
|
|
2
2
|
import { mount } from '@vue/test-utils';
|
|
3
3
|
import InputField from './InputField.vue';
|
|
4
4
|
import Icon, { ICONS } from '../../Icons/Icon';
|
|
5
|
-
import { h } from 'vue';
|
|
5
|
+
import { ComputedRef, h, Ref } from 'vue';
|
|
6
6
|
import { FORM_FIELD_STATES } from '../FormField';
|
|
7
7
|
import { ComponentProps, ComponentSlots } from 'vue-component-type-helpers';
|
|
8
|
+
import { FormMeta, useForm } from 'vee-validate';
|
|
9
|
+
import { waitForExpectShort } from '../../../tests/helpers';
|
|
8
10
|
|
|
9
11
|
const fieldId = 'form-field-v-0';
|
|
10
12
|
const messageId = `${fieldId}-message`;
|
|
@@ -132,4 +134,141 @@ describe('InputField', () => {
|
|
|
132
134
|
const input = wrapper.find('input');
|
|
133
135
|
expect(input.attributes('disabled')).toBeDefined();
|
|
134
136
|
});
|
|
137
|
+
|
|
138
|
+
describe('with vee-validate', () => {
|
|
139
|
+
const fieldName = 'siema';
|
|
140
|
+
const initialValue = 'siemanko!';
|
|
141
|
+
function setupWithForm(props?: ComponentProps<typeof InputField>) {
|
|
142
|
+
let controlledValuesRef: Ref<{ siema: string }> | undefined;
|
|
143
|
+
let errorsRef: ComputedRef<Partial<Record<'siema', string | undefined>>> | undefined;
|
|
144
|
+
let metaRef: Ref<FormMeta<{ siema: string }>> | undefined;
|
|
145
|
+
|
|
146
|
+
const FormComponent = {
|
|
147
|
+
template: `
|
|
148
|
+
<form>
|
|
149
|
+
<InputField
|
|
150
|
+
v-bind="props"
|
|
151
|
+
:name="name"
|
|
152
|
+
/>
|
|
153
|
+
</form>
|
|
154
|
+
`,
|
|
155
|
+
components: { InputField },
|
|
156
|
+
setup() {
|
|
157
|
+
const { controlledValues, errors, meta } = useForm({
|
|
158
|
+
initialValues: {
|
|
159
|
+
[fieldName]: initialValue,
|
|
160
|
+
},
|
|
161
|
+
validationSchema: {
|
|
162
|
+
siema: (val: string) => (val.length < 5 ? 'Too short' : true),
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
controlledValuesRef = controlledValues;
|
|
167
|
+
errorsRef = errors;
|
|
168
|
+
metaRef = meta;
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
name: fieldName,
|
|
172
|
+
props,
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
wrapper: mount(FormComponent),
|
|
179
|
+
controlledValuesRef,
|
|
180
|
+
errorsRef,
|
|
181
|
+
metaRef,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
it('should bind input value with vee-validate form values', async () => {
|
|
186
|
+
const { wrapper, controlledValuesRef } = setupWithForm();
|
|
187
|
+
|
|
188
|
+
const input = wrapper.find('input');
|
|
189
|
+
|
|
190
|
+
expect(input.element.value).toBe(initialValue);
|
|
191
|
+
expect(controlledValuesRef?.value[fieldName]).toBe(initialValue);
|
|
192
|
+
|
|
193
|
+
const newValue = 'no cześć!';
|
|
194
|
+
await input.setValue(newValue);
|
|
195
|
+
|
|
196
|
+
expect(input.element.value).toBe(newValue);
|
|
197
|
+
expect(controlledValuesRef?.value[fieldName]).toBe(newValue);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('should call onBlur and mark form as touched on blur', async () => {
|
|
201
|
+
const onBlur = vi.fn();
|
|
202
|
+
const { wrapper, metaRef } = setupWithForm({
|
|
203
|
+
inputProps: {
|
|
204
|
+
onBlur,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
expect(metaRef?.value.touched).toBe(false);
|
|
208
|
+
|
|
209
|
+
const input = wrapper.find('input');
|
|
210
|
+
await input.trigger('blur');
|
|
211
|
+
|
|
212
|
+
expect(onBlur).toHaveBeenCalled();
|
|
213
|
+
expect(metaRef?.value.touched).toBe(true);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it('should call onInput and show error message', async () => {
|
|
217
|
+
const onInput = vi.fn();
|
|
218
|
+
const { wrapper, errorsRef } = setupWithForm({
|
|
219
|
+
inputProps: {
|
|
220
|
+
onInput,
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
const input = wrapper.find('input');
|
|
225
|
+
await input.setValue('test');
|
|
226
|
+
|
|
227
|
+
expect(onInput).toHaveBeenCalled();
|
|
228
|
+
|
|
229
|
+
await input.trigger('blur');
|
|
230
|
+
|
|
231
|
+
await waitForExpectShort(() => {
|
|
232
|
+
expect(errorsRef?.value?.siema).toBeDefined();
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
expect(wrapper.find('.ds-inputField').classes()).toContain('-ds-error');
|
|
236
|
+
expect(wrapper.find(`#${messageId}`).text()).toBe('Too short');
|
|
237
|
+
|
|
238
|
+
await input.setValue('valid value');
|
|
239
|
+
|
|
240
|
+
await waitForExpectShort(() => {
|
|
241
|
+
expect(errorsRef?.value?.siema).toBeUndefined();
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('should throw an error if used outside of a form context', () => {
|
|
246
|
+
expect(() => {
|
|
247
|
+
setup({
|
|
248
|
+
props: {
|
|
249
|
+
name: 'siema',
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
}).toThrowError();
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('overrides state and message on vee-validate form error', async () => {
|
|
256
|
+
const { wrapper, errorsRef } = setupWithForm({
|
|
257
|
+
state: FORM_FIELD_STATES.SUCCESS,
|
|
258
|
+
messageText: 'Success message',
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const input = wrapper.find('input');
|
|
262
|
+
await input.setValue('test');
|
|
263
|
+
|
|
264
|
+
await input.trigger('blur');
|
|
265
|
+
|
|
266
|
+
await waitForExpectShort(() => {
|
|
267
|
+
expect(errorsRef?.value?.siema).toBeDefined();
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
expect(wrapper.find(`#${messageId}`).classes()).toContain('-ds-success');
|
|
271
|
+
expect(wrapper.find(`#${messageId}`).text()).toBe('Success message');
|
|
272
|
+
});
|
|
273
|
+
});
|
|
135
274
|
});
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
&__input {
|
|
101
|
-
@include
|
|
101
|
+
@include formText-s-default-regular;
|
|
102
102
|
|
|
103
103
|
background: transparent;
|
|
104
104
|
// hacky solution to override default browser styles for autofill
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
&__suffixText {
|
|
124
|
-
@include
|
|
124
|
+
@include formText-s-default-regular;
|
|
125
125
|
|
|
126
126
|
color: $color-neutral-text;
|
|
127
127
|
}
|
|
@@ -130,22 +130,46 @@
|
|
|
130
130
|
|
|
131
131
|
<script lang="ts" setup>
|
|
132
132
|
import { computed, InputHTMLAttributes } from 'vue';
|
|
133
|
-
import FormField, { FORM_FIELD_STATES } from '../FormField';
|
|
133
|
+
import FormField, { FORM_FIELD_STATES, FormFieldProps } from '../FormField';
|
|
134
134
|
import Icon, { ICON_SIZES } from '../../Icons/Icon';
|
|
135
135
|
import { extractFormFieldProps } from '../FormField/FormField.utils';
|
|
136
136
|
import { InputFieldProps, InputFieldSlots } from './InputField.types';
|
|
137
|
+
import { useInputFieldWithinForm } from './useInputFieldWithinForm';
|
|
137
138
|
|
|
138
|
-
const { inputProps, leftIcon, suffixText, ...rest } = defineProps<InputFieldProps>();
|
|
139
|
+
const { inputProps, leftIcon, suffixText, name, ...rest } = defineProps<InputFieldProps>();
|
|
139
140
|
defineSlots<InputFieldSlots>();
|
|
140
|
-
const
|
|
141
|
+
const modelValue = defineModel<string>();
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
const {
|
|
144
|
+
value,
|
|
145
|
+
errors,
|
|
146
|
+
onInput: onFormFieldInput,
|
|
147
|
+
onBlur: onFormFieldBlur,
|
|
148
|
+
} = useInputFieldWithinForm(() => name, modelValue);
|
|
149
|
+
|
|
150
|
+
const formFieldProps = computed<FormFieldProps>(() => {
|
|
151
|
+
// this is needed to avoid passing modelValue to FormField as prop
|
|
152
|
+
const extractedProps = extractFormFieldProps(rest);
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
...extractedProps,
|
|
156
|
+
messageText: extractedProps.messageText ?? errors.value[0],
|
|
157
|
+
state: extractedProps.state ?? (errors.value[0] ? FORM_FIELD_STATES.ERROR : undefined),
|
|
158
|
+
};
|
|
159
|
+
});
|
|
144
160
|
|
|
145
161
|
const finalInputProps = computed<InputHTMLAttributes>(() => {
|
|
146
162
|
return {
|
|
147
163
|
disabled: formFieldProps.value.state === FORM_FIELD_STATES.DISABLED,
|
|
148
164
|
...inputProps,
|
|
165
|
+
onInput: (event: Event) => {
|
|
166
|
+
onFormFieldInput();
|
|
167
|
+
inputProps?.onInput?.(event);
|
|
168
|
+
},
|
|
169
|
+
onBlur: (event: FocusEvent) => {
|
|
170
|
+
onFormFieldBlur(event);
|
|
171
|
+
inputProps?.onBlur?.(event);
|
|
172
|
+
},
|
|
149
173
|
};
|
|
150
174
|
});
|
|
151
175
|
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { computed, inject, MaybeRefOrGetter, ref, Ref, toValue } from 'vue';
|
|
2
|
+
import { FormContextKey, useField } from 'vee-validate';
|
|
3
|
+
|
|
4
|
+
export function useInputFieldWithinForm(
|
|
5
|
+
name: MaybeRefOrGetter<string | undefined>,
|
|
6
|
+
modelValue: Ref<string | undefined>,
|
|
7
|
+
) {
|
|
8
|
+
const form = inject(FormContextKey, null);
|
|
9
|
+
const nameValue = toValue(name);
|
|
10
|
+
|
|
11
|
+
// this computed property was created only for type safety so we can use it with `useField`
|
|
12
|
+
const nameString = computed(() => {
|
|
13
|
+
const value = toValue(name);
|
|
14
|
+
|
|
15
|
+
if (value === undefined) {
|
|
16
|
+
throw new Error('fieldName is required');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return value;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (nameValue && !form) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`InputField with name "${nameValue}" must be used within a component that provides a FormContext, e.g. by using useForm()`,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const field = nameValue
|
|
29
|
+
? useField(nameString, undefined, {
|
|
30
|
+
validateOnValueUpdate: false,
|
|
31
|
+
})
|
|
32
|
+
: null;
|
|
33
|
+
|
|
34
|
+
const value = field ? field.value : modelValue;
|
|
35
|
+
const blurred = ref(false);
|
|
36
|
+
|
|
37
|
+
const onBlur = (event: Event) => {
|
|
38
|
+
field?.handleBlur(event, true);
|
|
39
|
+
blurred.value = true;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const onInput = () => {
|
|
43
|
+
if (blurred.value) {
|
|
44
|
+
field?.validate();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
onBlur,
|
|
50
|
+
onInput,
|
|
51
|
+
value,
|
|
52
|
+
errors: field?.errors ?? ref<Array<string>>([]),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { Value } from '../../../utils/type.utils';
|
|
2
|
+
|
|
1
3
|
export const FEATURE_ICON_SIZES = {
|
|
4
|
+
X_SMALL: 'xSmall',
|
|
2
5
|
SMALL: 'small',
|
|
3
6
|
MEDIUM: 'medium',
|
|
4
7
|
LARGE: 'large',
|
|
5
8
|
X_LARGE: 'xLarge',
|
|
6
|
-
};
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export type FeatureIconSize = Value<typeof FEATURE_ICON_SIZES>;
|
|
7
12
|
|
|
8
13
|
export const FEATURE_ICON_COLOR = {
|
|
9
14
|
DANGER: 'danger',
|
|
@@ -13,4 +18,7 @@ export const FEATURE_ICON_COLOR = {
|
|
|
13
18
|
PRIMARY: 'primary',
|
|
14
19
|
SUCCESS: 'success',
|
|
15
20
|
WARNING: 'warning',
|
|
16
|
-
|
|
21
|
+
FAIL: 'fail',
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export type FeatureIconColor = Value<typeof FEATURE_ICON_COLOR>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import FeatureIcon from './FeatureIcon.vue';
|
|
4
|
+
import { FEATURE_ICON_COLOR } from './FeatureIcon.consts';
|
|
5
|
+
import Icon, { ICONS } from '../Icon';
|
|
6
|
+
|
|
7
|
+
describe('FeatureIcon', () => {
|
|
8
|
+
it('should render', () => {
|
|
9
|
+
const wrapper = mount(FeatureIcon, {
|
|
10
|
+
props: {
|
|
11
|
+
color: FEATURE_ICON_COLOR.PRIMARY,
|
|
12
|
+
icon: ICONS.FA_TAG,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
expect(wrapper.findComponent<typeof Icon>('.ds-icon').props().icon).toEqual(ICONS.FA_TAG);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -56,6 +56,6 @@ Interactive.args = args;
|
|
|
56
56
|
Interactive.parameters = {
|
|
57
57
|
design: {
|
|
58
58
|
type: 'figma',
|
|
59
|
-
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS---Components?node-id=
|
|
59
|
+
url: 'https://www.figma.com/file/izQdYyiBR1GQgFkaOIfIJI/LMS---DS---Components?node-id=5604-96259',
|
|
60
60
|
},
|
|
61
61
|
};
|