@feugene/granularity 0.4.0 → 0.4.2
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/chunks/_plugin-vue_export-helper-BG_EqiDU.js +8 -0
- package/dist/chunks/adapter-K6zZTzBi.js +4 -0
- package/dist/chunks/adapter-K6zZTzBi.js.map +1 -0
- package/dist/chunks/arrow-up-DNXrMoAI.js +23 -0
- package/dist/chunks/arrow-up-DNXrMoAI.js.map +1 -0
- package/dist/chunks/classTokens-BPeBXNzu.js +6 -0
- package/dist/chunks/classTokens-BPeBXNzu.js.map +1 -0
- package/dist/chunks/config-1I95Zy4V.js +14 -0
- package/dist/chunks/config-1I95Zy4V.js.map +1 -0
- package/dist/chunks/config-2wgwWaAB.js +8 -0
- package/dist/chunks/config-2wgwWaAB.js.map +1 -0
- package/dist/chunks/config-BA0BWYzs.js +8 -0
- package/dist/chunks/config-BA0BWYzs.js.map +1 -0
- package/dist/chunks/config-BCPyma1I.js +8 -0
- package/dist/chunks/config-BCPyma1I.js.map +1 -0
- package/dist/chunks/config-BDlh6iNz.js +24 -0
- package/dist/chunks/config-BDlh6iNz.js.map +1 -0
- package/dist/chunks/config-BKRmlivc.js +8 -0
- package/dist/chunks/config-BKRmlivc.js.map +1 -0
- package/dist/chunks/config-BN-B2K4r.js +17 -0
- package/dist/chunks/config-BN-B2K4r.js.map +1 -0
- package/dist/chunks/config-BNOf_qjD.js +40 -0
- package/dist/chunks/config-BNOf_qjD.js.map +1 -0
- package/dist/chunks/config-BaMO9dQh.js +20 -0
- package/dist/chunks/config-BaMO9dQh.js.map +1 -0
- package/dist/chunks/config-Bv2G0OU6.js +8 -0
- package/dist/chunks/config-Bv2G0OU6.js.map +1 -0
- package/dist/chunks/config-BvuQUBtZ.js +21 -0
- package/dist/chunks/config-BvuQUBtZ.js.map +1 -0
- package/dist/chunks/config-BzZGpWsj.js +9 -0
- package/dist/chunks/config-BzZGpWsj.js.map +1 -0
- package/dist/chunks/config-C0j836dC.js +8 -0
- package/dist/chunks/config-C0j836dC.js.map +1 -0
- package/dist/chunks/config-C2iI7_QX.js +9 -0
- package/dist/chunks/config-C2iI7_QX.js.map +1 -0
- package/dist/chunks/config-C4AlNm912.js +13 -0
- package/dist/chunks/config-C4AlNm912.js.map +1 -0
- package/dist/chunks/config-C5SJXHQ4.js +9 -0
- package/dist/chunks/config-C5SJXHQ4.js.map +1 -0
- package/dist/chunks/config-C6SBJxcH.js +8 -0
- package/dist/chunks/config-C6SBJxcH.js.map +1 -0
- package/dist/chunks/config-CByfsV-z2.js +9 -0
- package/dist/chunks/config-CByfsV-z2.js.map +1 -0
- package/dist/chunks/config-CM7nbATU2.js +78 -0
- package/dist/chunks/config-CM7nbATU2.js.map +1 -0
- package/dist/chunks/config-CMZE2fu0.js +9 -0
- package/dist/chunks/config-CMZE2fu0.js.map +1 -0
- package/dist/chunks/config-CU_CBd0k.js +22 -0
- package/dist/chunks/config-CU_CBd0k.js.map +1 -0
- package/dist/chunks/config-CUgvsjZx.js +171 -0
- package/dist/chunks/config-CUgvsjZx.js.map +1 -0
- package/dist/chunks/config-CWvHiaqr2.js +23 -0
- package/dist/chunks/config-CWvHiaqr2.js.map +1 -0
- package/dist/chunks/config-Cf0J6wCX.js +58 -0
- package/dist/chunks/config-Cf0J6wCX.js.map +1 -0
- package/dist/chunks/config-CgAY2WP9.js +9 -0
- package/dist/chunks/config-CgAY2WP9.js.map +1 -0
- package/dist/chunks/config-Cgc-D1K4.js +9 -0
- package/dist/chunks/config-Cgc-D1K4.js.map +1 -0
- package/dist/chunks/config-D19pyP4D.js +35 -0
- package/dist/chunks/config-D19pyP4D.js.map +1 -0
- package/dist/chunks/config-DCQO6H6h.js +11 -0
- package/dist/chunks/config-DCQO6H6h.js.map +1 -0
- package/dist/chunks/config-DEv4m-ZP.js +58 -0
- package/dist/chunks/config-DEv4m-ZP.js.map +1 -0
- package/dist/chunks/config-DFRYOcrP.js +9 -0
- package/dist/chunks/config-DFRYOcrP.js.map +1 -0
- package/dist/chunks/config-DTpwUHgF.js +9 -0
- package/dist/chunks/config-DTpwUHgF.js.map +1 -0
- package/dist/chunks/config-DW_RqmUp.js +8 -0
- package/dist/chunks/config-DW_RqmUp.js.map +1 -0
- package/dist/chunks/config-Da90XGsi.js +38 -0
- package/dist/chunks/config-Da90XGsi.js.map +1 -0
- package/dist/chunks/config-DgRJlF00.js +53 -0
- package/dist/chunks/config-DgRJlF00.js.map +1 -0
- package/dist/chunks/config-Dkq0HeLe.js +9 -0
- package/dist/chunks/config-Dkq0HeLe.js.map +1 -0
- package/dist/chunks/config-DmI1IQvI2.js +8 -0
- package/dist/chunks/config-DmI1IQvI2.js.map +1 -0
- package/dist/chunks/config-Dnu4VuO0.js +8 -0
- package/dist/chunks/config-Dnu4VuO0.js.map +1 -0
- package/dist/chunks/config-DxqpV-KM.js +45 -0
- package/dist/chunks/config-DxqpV-KM.js.map +1 -0
- package/dist/chunks/config-TyzU6gLf.js +8 -0
- package/dist/chunks/config-TyzU6gLf.js.map +1 -0
- package/dist/chunks/config-XwI6t8cn.js +39 -0
- package/dist/chunks/config-XwI6t8cn.js.map +1 -0
- package/dist/chunks/config-bpQYM5O-.js +44 -0
- package/dist/chunks/config-bpQYM5O-.js.map +1 -0
- package/dist/chunks/config-etXh7Bsr2.js +9 -0
- package/dist/chunks/config-etXh7Bsr2.js.map +1 -0
- package/dist/chunks/config-fCcRwjIB.js +13 -0
- package/dist/chunks/config-fCcRwjIB.js.map +1 -0
- package/dist/chunks/config-nfOMJXVs.js +9 -0
- package/dist/chunks/config-nfOMJXVs.js.map +1 -0
- package/dist/chunks/config-qJXIIY1E.js +8 -0
- package/dist/chunks/config-qJXIIY1E.js.map +1 -0
- package/dist/chunks/config-r6hzn2Bn2.js +9 -0
- package/dist/chunks/config-r6hzn2Bn2.js.map +1 -0
- package/dist/chunks/config-rQlbnEKn.js +8 -0
- package/dist/chunks/config-rQlbnEKn.js.map +1 -0
- package/dist/chunks/dialogShared-BtXUk6Zc.js +32 -0
- package/dist/chunks/dialogShared-BtXUk6Zc.js.map +1 -0
- package/dist/chunks/en-BeJa78lP.js +48 -0
- package/dist/chunks/en-BeJa78lP.js.map +1 -0
- package/dist/chunks/es-BPqm7rLm.js +20 -0
- package/dist/chunks/es-BPqm7rLm.js.map +1 -0
- package/dist/chunks/es-axYOwwWD.js +48 -0
- package/dist/chunks/es-axYOwwWD.js.map +1 -0
- package/dist/chunks/fileValidation-CwJA8Vmn.js +219 -0
- package/dist/chunks/fileValidation-CwJA8Vmn.js.map +1 -0
- package/dist/chunks/{grBadgeStyles-Bu4H8bFc.js → grBadgeStyles-pqqbVgLk.js} +18 -13
- package/dist/chunks/grBadgeStyles-pqqbVgLk.js.map +1 -0
- package/dist/chunks/{grButtonStyles-C5k0bN2e.js → grButtonStyles-BxZW2x0-.js} +60 -52
- package/dist/chunks/grButtonStyles-BxZW2x0-.js.map +1 -0
- package/dist/chunks/{grDropdownStyles-149X1NeB.js → grDropdownStyles-DMp7RrI9.js} +10 -9
- package/dist/chunks/grDropdownStyles-DMp7RrI9.js.map +1 -0
- package/dist/chunks/grLoadingStyles-CrxZHFL0.js +17 -0
- package/dist/chunks/grLoadingStyles-CrxZHFL0.js.map +1 -0
- package/dist/chunks/{grModalStyles-Dmd4havY.js → grModalStyles-Dv2NXBKi.js} +20 -11
- package/dist/chunks/grModalStyles-Dv2NXBKi.js.map +1 -0
- package/dist/chunks/grSelectStyles-B7doeAQp.js +50 -0
- package/dist/chunks/grSelectStyles-B7doeAQp.js.map +1 -0
- package/dist/chunks/granularityI18n-GCqUz_lo.js +26 -0
- package/dist/chunks/granularityI18n-GCqUz_lo.js.map +1 -0
- package/dist/chunks/info-C0bHmdZq.js +26 -0
- package/dist/chunks/info-C0bHmdZq.js.map +1 -0
- package/dist/chunks/loader-circle-B2rWDk5u.js +23 -0
- package/dist/chunks/loader-circle-B2rWDk5u.js.map +1 -0
- package/dist/chunks/ru-Dqh-2C00.js +48 -0
- package/dist/chunks/ru-Dqh-2C00.js.map +1 -0
- package/dist/chunks/safelist-BF822K15.js +13 -0
- package/dist/chunks/safelist-BF822K15.js.map +1 -0
- package/dist/chunks/safelist-BY7z8fOl.js +24 -0
- package/dist/chunks/safelist-BY7z8fOl.js.map +1 -0
- package/dist/chunks/{shared-BqUqjuxn.js → shared-Cu5QkNmt.js} +149 -111
- package/dist/chunks/shared-Cu5QkNmt.js.map +1 -0
- package/dist/chunks/transition-mJ3PZCHH.js +1692 -0
- package/dist/chunks/transition-mJ3PZCHH.js.map +1 -0
- package/dist/chunks/x-Pa6C2hwi.js +23 -0
- package/dist/chunks/x-Pa6C2hwi.js.map +1 -0
- package/dist/chunks/x-circle-DQSlBLmX.js +67 -0
- package/dist/chunks/x-circle-DQSlBLmX.js.map +1 -0
- package/dist/components/GrAlert/chunks/GrAlert-BjerGcU8.js +146 -0
- package/dist/components/GrAlert/chunks/GrAlert-BjerGcU8.js.map +1 -0
- package/dist/components/GrAlert/index.js +3 -3
- package/dist/components/GrAvatar/chunks/GrAvatar-BjnPKNAL.js +41 -0
- package/dist/components/GrAvatar/chunks/GrAvatar-BjnPKNAL.js.map +1 -0
- package/dist/components/GrAvatar/index.js +3 -3
- package/dist/components/GrBadge/chunks/GrBadge-wuIb4_2K.js +32 -0
- package/dist/components/GrBadge/chunks/GrBadge-wuIb4_2K.js.map +1 -0
- package/dist/components/GrBadge/index.js +3 -3
- package/dist/components/GrBadgeWrap/chunks/GrBadgeWrap-CxtamOZ-.js +33 -0
- package/dist/components/GrBadgeWrap/chunks/GrBadgeWrap-CxtamOZ-.js.map +1 -0
- package/dist/components/GrBadgeWrap/index.js +3 -3
- package/dist/components/GrBottomNav/chunks/GrBottomNav-CsmQ7mTJ.js +31 -0
- package/dist/components/GrBottomNav/chunks/GrBottomNav-CsmQ7mTJ.js.map +1 -0
- package/dist/components/GrBottomNav/index.js +3 -3
- package/dist/components/GrButton/chunks/GrButton-BmGdp8-4.js +83 -0
- package/dist/components/GrButton/chunks/GrButton-BmGdp8-4.js.map +1 -0
- package/dist/components/GrButton/index.js +5 -5
- package/dist/components/GrButtonGroup/chunks/GrButtonGroup-CBj4tpms.js +21 -0
- package/dist/components/GrButtonGroup/chunks/GrButtonGroup-CBj4tpms.js.map +1 -0
- package/dist/components/GrButtonGroup/index.js +3 -3
- package/dist/components/GrCard/chunks/GrCard-xtDcXBr7.js +11 -0
- package/dist/components/GrCard/chunks/GrCard-xtDcXBr7.js.map +1 -0
- package/dist/components/GrCard/index.js +3 -3
- package/dist/components/GrCheckbox/chunks/GrCheckbox-Bt3d7ckE.js +134 -0
- package/dist/components/GrCheckbox/chunks/GrCheckbox-Bt3d7ckE.js.map +1 -0
- package/dist/components/GrCheckbox/index.js +3 -3
- package/dist/components/GrCollapse/chunks/GrCollapse-HU20VTVn.js +205 -0
- package/dist/components/GrCollapse/chunks/GrCollapse-HU20VTVn.js.map +1 -0
- package/dist/components/GrCollapse/index.js +3 -3
- package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-DjGOX9Hd.js +131 -0
- package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-DjGOX9Hd.js.map +1 -0
- package/dist/components/GrConfirmDialog/index.js +3 -3
- package/dist/components/GrDataTable/chunks/GrDataTable-QDOJWmdY.js +179 -0
- package/dist/components/GrDataTable/chunks/GrDataTable-QDOJWmdY.js.map +1 -0
- package/dist/components/GrDataTable/index.js +3 -3
- package/dist/components/GrDialog/chunks/GrDialog-gObmaVEl.js +221 -0
- package/dist/components/GrDialog/chunks/GrDialog-gObmaVEl.js.map +1 -0
- package/dist/components/GrDialog/index.js +4 -4
- package/dist/components/GrDrawer/chunks/GrDrawer-BJL_gTxI.js +156 -0
- package/dist/components/GrDrawer/chunks/GrDrawer-BJL_gTxI.js.map +1 -0
- package/dist/components/GrDrawer/index.js +3 -3
- package/dist/components/GrDropdown/chunks/GrDropdown-BkACCXdp.js +151 -0
- package/dist/components/GrDropdown/chunks/GrDropdown-BkACCXdp.js.map +1 -0
- package/dist/components/GrDropdown/index.js +3 -3
- package/dist/components/GrDropdownMenu/chunks/GrDropdownMenu-BEenXrJw.js +309 -0
- package/dist/components/GrDropdownMenu/chunks/GrDropdownMenu-BEenXrJw.js.map +1 -0
- package/dist/components/GrDropdownMenu/index.js +3 -3
- package/dist/components/GrEmptyState/chunks/GrEmptyState-BLbMJFW-.js +62 -0
- package/dist/components/GrEmptyState/chunks/GrEmptyState-BLbMJFW-.js.map +1 -0
- package/dist/components/GrEmptyState/index.js +3 -3
- package/dist/components/GrFileUpload/chunks/GrFileUpload-u01j9S0t.js +368 -0
- package/dist/components/GrFileUpload/chunks/GrFileUpload-u01j9S0t.js.map +1 -0
- package/dist/components/GrFileUpload/index.js +4 -4
- package/dist/components/GrFormField/chunks/GrFormField-C6PfAs4u.js +35 -0
- package/dist/components/GrFormField/chunks/GrFormField-C6PfAs4u.js.map +1 -0
- package/dist/components/GrFormField/index.js +3 -3
- package/dist/components/GrFormFile/chunks/GrFormFile-DdM8Bc2B.js +313 -0
- package/dist/components/GrFormFile/chunks/GrFormFile-DdM8Bc2B.js.map +1 -0
- package/dist/components/GrFormFile/index.js +3 -3
- package/dist/components/GrFormSection/chunks/GrFormSection-5djEaQZQ.js +35 -0
- package/dist/components/GrFormSection/chunks/GrFormSection-5djEaQZQ.js.map +1 -0
- package/dist/components/GrFormSection/index.js +3 -3
- package/dist/components/GrIcon/chunks/GrIcon-BV7RBU_0.js +32 -0
- package/dist/components/GrIcon/chunks/GrIcon-BV7RBU_0.js.map +1 -0
- package/dist/components/GrIcon/index.js +3 -3
- package/dist/components/GrImageViewer/chunks/GrImageViewer-CjSnohW7.js +397 -0
- package/dist/components/GrImageViewer/chunks/GrImageViewer-CjSnohW7.js.map +1 -0
- package/dist/components/GrImageViewer/index.js +3 -3
- package/dist/components/GrInput/chunks/GrInput-ghxaTf6d.js +211 -0
- package/dist/components/GrInput/chunks/GrInput-ghxaTf6d.js.map +1 -0
- package/dist/components/GrInput/index.js +3 -3
- package/dist/components/GrInputTag/chunks/GrInputTag-B0x4U0Yk.js +257 -0
- package/dist/components/GrInputTag/chunks/GrInputTag-B0x4U0Yk.js.map +1 -0
- package/dist/components/GrInputTag/index.js +3 -3
- package/dist/components/GrLink/chunks/GrLink-C7-Y1u88.js +80 -0
- package/dist/components/GrLink/chunks/GrLink-C7-Y1u88.js.map +1 -0
- package/dist/components/GrLink/index.js +3 -3
- package/dist/components/GrList/chunks/GrList--Ib4zLNw.js +77 -0
- package/dist/components/GrList/chunks/GrList--Ib4zLNw.js.map +1 -0
- package/dist/components/GrList/index.js +3 -3
- package/dist/components/GrLoading/chunks/GrLoading-C3QZKwE-.js +69 -0
- package/dist/components/GrLoading/chunks/GrLoading-C3QZKwE-.js.map +1 -0
- package/dist/components/GrLoading/index.js +3 -3
- package/dist/components/GrModal/chunks/GrModal-gvfvlp7k.js +168 -0
- package/dist/components/GrModal/chunks/GrModal-gvfvlp7k.js.map +1 -0
- package/dist/components/GrModal/index.js +4 -4
- package/dist/components/GrNavbar/chunks/GrNavbar-nIyuiVj1.js +75 -0
- package/dist/components/GrNavbar/chunks/GrNavbar-nIyuiVj1.js.map +1 -0
- package/dist/components/GrNavbar/index.js +3 -3
- package/dist/components/GrNumberInput/chunks/GrNumberInput-B0mPLjdv.js +397 -0
- package/dist/components/GrNumberInput/chunks/GrNumberInput-B0mPLjdv.js.map +1 -0
- package/dist/components/GrNumberInput/index.js +3 -3
- package/dist/components/GrPagination/chunks/GrPagination-BSTO6flk.js +114 -0
- package/dist/components/GrPagination/chunks/GrPagination-BSTO6flk.js.map +1 -0
- package/dist/components/GrPagination/index.js +3 -3
- package/dist/components/GrProgressBar/chunks/GrProgressBar-MvMnzsJl.js +39 -0
- package/dist/components/GrProgressBar/chunks/GrProgressBar-MvMnzsJl.js.map +1 -0
- package/dist/components/GrProgressBar/index.js +3 -3
- package/dist/components/GrPromptDialog/chunks/GrPromptDialog-DKhbN6ji.js +190 -0
- package/dist/components/GrPromptDialog/chunks/GrPromptDialog-DKhbN6ji.js.map +1 -0
- package/dist/components/GrPromptDialog/index.js +3 -3
- package/dist/components/GrRadio/chunks/GrRadio-BxBs3WHq.js +184 -0
- package/dist/components/GrRadio/chunks/GrRadio-BxBs3WHq.js.map +1 -0
- package/dist/components/GrRadio/index.js +3 -3
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-CEAfJQ6A.js +80 -0
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-CEAfJQ6A.js.map +1 -0
- package/dist/components/GrRadioGroup/index.js +3 -3
- package/dist/components/GrSegmented/chunks/GrSegmented-Bwn2qOY4.js +323 -0
- package/dist/components/GrSegmented/chunks/GrSegmented-Bwn2qOY4.js.map +1 -0
- package/dist/components/GrSegmented/index.js +3 -3
- package/dist/components/GrSelect/chunks/GrSelect-9wRWAu2R.js +443 -0
- package/dist/components/GrSelect/chunks/GrSelect-9wRWAu2R.js.map +1 -0
- package/dist/components/GrSelect/index.js +3 -3
- package/dist/components/GrSidebar/chunks/GrSidebar-CSZ3RpFB.js +44 -0
- package/dist/components/GrSidebar/chunks/GrSidebar-CSZ3RpFB.js.map +1 -0
- package/dist/components/GrSidebar/index.js +3 -3
- package/dist/components/GrSkeleton/chunks/GrSkeleton-DKXkqWDa.js +33 -0
- package/dist/components/GrSkeleton/chunks/GrSkeleton-DKXkqWDa.js.map +1 -0
- package/dist/components/GrSkeleton/index.js +3 -3
- package/dist/components/GrSwitch/chunks/GrSwitch-CdBxwV3k.js +79 -0
- package/dist/components/GrSwitch/chunks/GrSwitch-CdBxwV3k.js.map +1 -0
- package/dist/components/GrSwitch/index.js +3 -3
- package/dist/components/GrTable/chunks/GrTable-CyQ9uw8A.js +57 -0
- package/dist/components/GrTable/chunks/GrTable-CyQ9uw8A.js.map +1 -0
- package/dist/components/GrTable/index.js +3 -3
- package/dist/components/GrTabs/chunks/GrTabs-BpF8AAUz.js +118 -0
- package/dist/components/GrTabs/chunks/GrTabs-BpF8AAUz.js.map +1 -0
- package/dist/components/GrTabs/index.js +3 -3
- package/dist/components/GrTextarea/chunks/GrTextarea-DFS9ZkrA.js +71 -0
- package/dist/components/GrTextarea/chunks/GrTextarea-DFS9ZkrA.js.map +1 -0
- package/dist/components/GrTextarea/index.js +3 -3
- package/dist/components/GrToaster/chunks/GrToaster-3Mf0Moxt.js +171 -0
- package/dist/components/GrToaster/chunks/GrToaster-3Mf0Moxt.js.map +1 -0
- package/dist/components/GrToaster/index.js +3 -3
- package/dist/components/GrTooltip/chunks/GrTooltip-BvmsukLW.js +55 -0
- package/dist/components/GrTooltip/chunks/GrTooltip-BvmsukLW.js.map +1 -0
- package/dist/components/GrTooltip/index.js +3 -3
- package/dist/components/GrTree/chunks/GrTree-C2kN-O4Q.js +734 -0
- package/dist/components/GrTree/chunks/GrTree-C2kN-O4Q.js.map +1 -0
- package/dist/components/GrTree/index.js +3 -3
- package/dist/components/GrTreeSelect/chunks/GrTreeSelect-Da-CpRqm.js +454 -0
- package/dist/components/GrTreeSelect/chunks/GrTreeSelect-Da-CpRqm.js.map +1 -0
- package/dist/components/GrTreeSelect/index.js +3 -3
- package/dist/composables/useTheme.js +39 -30
- package/dist/composables/useTheme.js.map +1 -0
- package/dist/composables/useToast.js +41 -34
- package/dist/composables/useToast.js.map +1 -0
- package/dist/directives/autofocus.js +55 -0
- package/dist/directives/autofocus.js.map +1 -0
- package/dist/directives/autosize.js +117 -0
- package/dist/directives/autosize.js.map +1 -0
- package/dist/directives/clickOutside.js +96 -0
- package/dist/directives/clickOutside.js.map +1 -0
- package/dist/directives/dropzone.js +164 -0
- package/dist/directives/dropzone.js.map +1 -0
- package/dist/directives/hotkey.js +138 -0
- package/dist/directives/hotkey.js.map +1 -0
- package/dist/directives/index.js +7 -2
- package/dist/directives/loading.js +163 -0
- package/dist/directives/loading.js.map +1 -0
- package/dist/fileValidation/index.js +2 -2
- package/dist/granular-provider-node.js +23 -14
- package/dist/granular-provider-node.js.map +1 -0
- package/dist/granular-provider.js +3 -3
- package/dist/granular-provider.js.map +1 -0
- package/dist/i18n/all.js +6 -6
- package/dist/i18n/all.js.map +1 -0
- package/dist/i18n/index.js +3 -3
- package/dist/index.js +110 -105
- package/dist/vue/index.js +64 -26
- package/dist/vue/index.js.map +1 -0
- package/package.json +25 -1
- package/dist/chunks/_plugin-vue_export-helper-CHO2XVys.js +0 -8
- package/dist/chunks/adapter-D5uYoOZj.js +0 -4
- package/dist/chunks/arrow-up-Dv3dC3hu.js +0 -23
- package/dist/chunks/classTokens-CT1tqF2j.js +0 -6
- package/dist/chunks/config-B5JCvHys.js +0 -13
- package/dist/chunks/config-BDXa5Sna2.js +0 -9
- package/dist/chunks/config-BG5_FuZ-.js +0 -34
- package/dist/chunks/config-BMYKG1oB.js +0 -10
- package/dist/chunks/config-BQREEXFD.js +0 -8
- package/dist/chunks/config-BUZtbeTr.js +0 -40
- package/dist/chunks/config-BVXycfiO.js +0 -9
- package/dist/chunks/config-BZW-RL6E.js +0 -14
- package/dist/chunks/config-BhbfV-Is.js +0 -48
- package/dist/chunks/config-BmYFupZh.js +0 -8
- package/dist/chunks/config-BsZc_QQ-2.js +0 -20
- package/dist/chunks/config-C1Sn7mn-.js +0 -27
- package/dist/chunks/config-C4_REX-3.js +0 -9
- package/dist/chunks/config-CBFllZZ4.js +0 -9
- package/dist/chunks/config-CDyD_fCt.js +0 -8
- package/dist/chunks/config-CJeG727i.js +0 -149
- package/dist/chunks/config-CLawBqde.js +0 -21
- package/dist/chunks/config-CMz46RPG.js +0 -8
- package/dist/chunks/config-CO-7HRZd2.js +0 -8
- package/dist/chunks/config-CS7E7LME.js +0 -9
- package/dist/chunks/config-CVy124Xj.js +0 -8
- package/dist/chunks/config-CcixQGaN.js +0 -47
- package/dist/chunks/config-CiVXZxyQ.js +0 -9
- package/dist/chunks/config-CoMQmunP.js +0 -8
- package/dist/chunks/config-Cq6ufYtp.js +0 -9
- package/dist/chunks/config-D8CIEWcb.js +0 -8
- package/dist/chunks/config-D8hKc39m.js +0 -18
- package/dist/chunks/config-D9MxGwCJ.js +0 -8
- package/dist/chunks/config-DBXTZE36.js +0 -15
- package/dist/chunks/config-DK9C8O7L.js +0 -9
- package/dist/chunks/config-DTegOmx2.js +0 -8
- package/dist/chunks/config-DYI8XADo.js +0 -47
- package/dist/chunks/config-DlidGf7P.js +0 -8
- package/dist/chunks/config-DtNe7EIX.js +0 -35
- package/dist/chunks/config-EdWeK_ge.js +0 -17
- package/dist/chunks/config-FGAkxHFh.js +0 -8
- package/dist/chunks/config-M76gNxd2.js +0 -37
- package/dist/chunks/config-NuqoO_Of.js +0 -33
- package/dist/chunks/config-QsovJrku2.js +0 -66
- package/dist/chunks/config-R6F6zRJk.js +0 -9
- package/dist/chunks/config-SLwkDc4Q2.js +0 -9
- package/dist/chunks/config-aJ7sb62Y.js +0 -8
- package/dist/chunks/config-b9nc87Oc.js +0 -9
- package/dist/chunks/config-dSI8RttH2.js +0 -8
- package/dist/chunks/config-im2VHeSM.js +0 -9
- package/dist/chunks/config-vKeQ035f.js +0 -9
- package/dist/chunks/config-vMcxHlWi.js +0 -14
- package/dist/chunks/dialogShared-CONROtU2.js +0 -26
- package/dist/chunks/directives-Dr5NPOT8.js +0 -530
- package/dist/chunks/en-j3simI0h.js +0 -41
- package/dist/chunks/es-CIT9s_vo.js +0 -4
- package/dist/chunks/es-CLpJj7KP.js +0 -41
- package/dist/chunks/fileValidation-LFD-vwil.js +0 -193
- package/dist/chunks/grLoadingStyles-Bjo7ylmq.js +0 -15
- package/dist/chunks/grSelectStyles-C3QKIn1J.js +0 -40
- package/dist/chunks/granularityI18n-8_v1B11L.js +0 -24
- package/dist/chunks/info-CNJnuTYC.js +0 -26
- package/dist/chunks/loader-circle-C5vCCMfB.js +0 -23
- package/dist/chunks/ru-CiOZPnBu.js +0 -41
- package/dist/chunks/safelist-Bq32hAXc.js +0 -13
- package/dist/chunks/safelist-CLcTRYB-.js +0 -22
- package/dist/chunks/transition-BJXMi52x.js +0 -1617
- package/dist/chunks/x--kxrj3ez.js +0 -23
- package/dist/chunks/x-circle-ChJ87u1v.js +0 -61
- package/dist/components/GrAlert/chunks/GrAlert-DLHkusb-.js +0 -129
- package/dist/components/GrAvatar/chunks/GrAvatar-BFYH3HJw.js +0 -32
- package/dist/components/GrBadge/chunks/GrBadge-D_AoqGrn.js +0 -27
- package/dist/components/GrBadgeWrap/chunks/GrBadgeWrap-C_N0QJfA.js +0 -26
- package/dist/components/GrBottomNav/chunks/GrBottomNav-Chpu3SVd.js +0 -21
- package/dist/components/GrButton/chunks/GrButton-BXVVt6Od.js +0 -67
- package/dist/components/GrButtonGroup/chunks/GrButtonGroup-CmnYHVH7.js +0 -16
- package/dist/components/GrCard/chunks/GrCard-DEpN6Ptf.js +0 -10
- package/dist/components/GrCheckbox/chunks/GrCheckbox-DF3vJApB.js +0 -111
- package/dist/components/GrCollapse/chunks/GrCollapse-D7QYRqNa.js +0 -150
- package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-C7Eh8-Vn.js +0 -111
- package/dist/components/GrDataTable/chunks/GrDataTable-Dxsg1NMP.js +0 -142
- package/dist/components/GrDialog/chunks/GrDialog-BSd4-uP5.js +0 -169
- package/dist/components/GrDrawer/chunks/GrDrawer-DBBSwe1s.js +0 -135
- package/dist/components/GrDropdown/chunks/GrDropdown-BELyRP4A.js +0 -110
- package/dist/components/GrDropdownMenu/chunks/GrDropdownMenu-B8fuk7iP.js +0 -233
- package/dist/components/GrEmptyState/chunks/GrEmptyState-BPGoafJI.js +0 -49
- package/dist/components/GrFileUpload/chunks/GrFileUpload-BPzx3LEM.js +0 -294
- package/dist/components/GrFormField/chunks/GrFormField-Cn8g9eFP.js +0 -28
- package/dist/components/GrFormFile/chunks/GrFormFile-DfinD5Iv.js +0 -248
- package/dist/components/GrFormSection/chunks/GrFormSection-dKpQw-vh.js +0 -27
- package/dist/components/GrIcon/chunks/GrIcon-CXIHuG7L.js +0 -25
- package/dist/components/GrImageViewer/chunks/GrImageViewer-CQSNx-D7.js +0 -322
- package/dist/components/GrInput/chunks/GrInput-CLKX1inm.js +0 -158
- package/dist/components/GrInputTag/chunks/GrInputTag-BAtLody2.js +0 -214
- package/dist/components/GrLink/chunks/GrLink-BpXnly-Y.js +0 -59
- package/dist/components/GrList/chunks/GrList-BrFc7VdS.js +0 -55
- package/dist/components/GrLoading/chunks/GrLoading-dFuoryMY.js +0 -53
- package/dist/components/GrModal/chunks/GrModal-uaWXH08K.js +0 -136
- package/dist/components/GrNavbar/chunks/GrNavbar-KzLHgdjX.js +0 -62
- package/dist/components/GrNumberInput/chunks/GrNumberInput-rENn1802.js +0 -315
- package/dist/components/GrPagination/chunks/GrPagination-DP0x3rx6.js +0 -93
- package/dist/components/GrProgressBar/chunks/GrProgressBar-DpW93sOi.js +0 -29
- package/dist/components/GrPromptDialog/chunks/GrPromptDialog-ASfBwyzQ.js +0 -158
- package/dist/components/GrRadio/chunks/GrRadio-8BOo97XV.js +0 -147
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-BymbUmqI.js +0 -66
- package/dist/components/GrSegmented/chunks/GrSegmented-CK5C_lN7.js +0 -250
- package/dist/components/GrSelect/chunks/GrSelect-BMfc1-vs.js +0 -314
- package/dist/components/GrSidebar/chunks/GrSidebar-C4SXXhfO.js +0 -29
- package/dist/components/GrSkeleton/chunks/GrSkeleton-QlieOdpY.js +0 -25
- package/dist/components/GrSwitch/chunks/GrSwitch-Cefiutzu.js +0 -64
- package/dist/components/GrTable/chunks/GrTable-k_FUiJQk.js +0 -44
- package/dist/components/GrTabs/chunks/GrTabs-B46P-lUc.js +0 -98
- package/dist/components/GrTextarea/chunks/GrTextarea-BX7L1MJk.js +0 -57
- package/dist/components/GrToaster/chunks/GrToaster-C4l_BjOh.js +0 -139
- package/dist/components/GrTooltip/chunks/GrTooltip-BqRAzuLT.js +0 -37
- package/dist/components/GrTree/chunks/GrTree-C2CXR_vW.js +0 -614
- package/dist/components/GrTreeSelect/chunks/GrTreeSelect-DAAay-QB.js +0 -353
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
//#region src/fileValidation/FileValidationError.ts
|
|
2
|
+
var FileValidationError = class extends Error {
|
|
3
|
+
code;
|
|
4
|
+
file;
|
|
5
|
+
issues;
|
|
6
|
+
constructor(issues, files, message) {
|
|
7
|
+
super(message ?? issues[0]?.message ?? "File validation failed");
|
|
8
|
+
this.name = "FileValidationError";
|
|
9
|
+
this.issues = issues;
|
|
10
|
+
this.code = issues[0]?.code ?? "accept";
|
|
11
|
+
const firstFileName = issues[0]?.fileName;
|
|
12
|
+
this.file = (firstFileName && files ? files.find((f) => f.name === firstFileName) : void 0) ?? files?.[0];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/fileValidation/runFileValidators.ts
|
|
17
|
+
function normalizeFiles(files, multiple) {
|
|
18
|
+
const list = [...files];
|
|
19
|
+
return multiple ? list : list.slice(0, 1);
|
|
20
|
+
}
|
|
21
|
+
function isPromiseLike(value) {
|
|
22
|
+
return !!value && typeof value.then === "function";
|
|
23
|
+
}
|
|
24
|
+
function runFileValidators(files, validators, context) {
|
|
25
|
+
const picked = normalizeFiles(files, context.multiple);
|
|
26
|
+
const issues = [];
|
|
27
|
+
const list = validators ?? [];
|
|
28
|
+
for (let i = 0; i < list.length; i++) {
|
|
29
|
+
const validator = list[i];
|
|
30
|
+
if (!validator) continue;
|
|
31
|
+
const res = validator({
|
|
32
|
+
files: picked,
|
|
33
|
+
context
|
|
34
|
+
});
|
|
35
|
+
if (isPromiseLike(res)) return (async () => {
|
|
36
|
+
const first = await res;
|
|
37
|
+
if (Array.isArray(first) && first.length > 0) issues.push(...first);
|
|
38
|
+
for (let j = i + 1; j < list.length; j++) {
|
|
39
|
+
const nextValidator = list[j];
|
|
40
|
+
if (!nextValidator) continue;
|
|
41
|
+
const nextRes = nextValidator({
|
|
42
|
+
files: picked,
|
|
43
|
+
context
|
|
44
|
+
});
|
|
45
|
+
const next = isPromiseLike(nextRes) ? await nextRes : nextRes;
|
|
46
|
+
if (Array.isArray(next) && next.length > 0) issues.push(...next);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
files: picked,
|
|
50
|
+
issues
|
|
51
|
+
};
|
|
52
|
+
})();
|
|
53
|
+
if (Array.isArray(res) && res.length > 0) issues.push(...res);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
files: picked,
|
|
57
|
+
issues
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/fileValidation/matchAccept.ts
|
|
62
|
+
function parseAccept(accept) {
|
|
63
|
+
if (!accept) return [];
|
|
64
|
+
return accept.split(",").map((s) => s.trim()).filter(Boolean);
|
|
65
|
+
}
|
|
66
|
+
function matchAccept(file, accept) {
|
|
67
|
+
const tokens = parseAccept(accept);
|
|
68
|
+
if (!tokens.length) return true;
|
|
69
|
+
const fileName = file.name.toLowerCase();
|
|
70
|
+
const fileType = (file.type || "").toLowerCase();
|
|
71
|
+
for (const rawToken of tokens) {
|
|
72
|
+
const token = rawToken.toLowerCase();
|
|
73
|
+
if (token.startsWith(".")) {
|
|
74
|
+
if (fileName.endsWith(token)) return true;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (token.endsWith("/*")) {
|
|
78
|
+
if (!fileType) continue;
|
|
79
|
+
const prefix = token.slice(0, -1);
|
|
80
|
+
if (fileType.startsWith(prefix)) return true;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (!fileType) continue;
|
|
84
|
+
if (fileType === token) return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/fileValidation/acceptValidator.ts
|
|
90
|
+
function acceptValidator(accept) {
|
|
91
|
+
if (!accept) return () => [];
|
|
92
|
+
return ({ files }) => {
|
|
93
|
+
const issues = [];
|
|
94
|
+
for (const file of files) {
|
|
95
|
+
if (matchAccept(file, accept)) continue;
|
|
96
|
+
issues.push({
|
|
97
|
+
fileName: file.name,
|
|
98
|
+
code: "accept",
|
|
99
|
+
message: `File "${file.name}" does not match accept="${accept}"`
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return issues;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/fileValidation/allowedExtensionsValidator.ts
|
|
107
|
+
function normalizeExtensions(exts) {
|
|
108
|
+
return (exts ?? []).map((s) => s.trim().toLowerCase()).filter(Boolean).map((s) => s.startsWith(".") ? s.slice(1) : s);
|
|
109
|
+
}
|
|
110
|
+
function fileExtensionLower(fileName) {
|
|
111
|
+
const i = fileName.lastIndexOf(".");
|
|
112
|
+
if (i < 0) return "";
|
|
113
|
+
return fileName.slice(i + 1).toLowerCase();
|
|
114
|
+
}
|
|
115
|
+
function allowedExtensionsValidator(exts) {
|
|
116
|
+
const allowedExt = normalizeExtensions(exts);
|
|
117
|
+
if (allowedExt.length === 0) return () => [];
|
|
118
|
+
return ({ files }) => {
|
|
119
|
+
const issues = [];
|
|
120
|
+
for (const file of files) {
|
|
121
|
+
const ext = fileExtensionLower(file.name);
|
|
122
|
+
if (!ext) continue;
|
|
123
|
+
if (!allowedExt.includes(ext)) issues.push({
|
|
124
|
+
fileName: file.name,
|
|
125
|
+
code: "extension",
|
|
126
|
+
message: `File "${file.name}" has disallowed extension ".${ext}"`
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return issues;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/fileValidation/allowedMimeTypesValidator.ts
|
|
134
|
+
function isFallbackType(type) {
|
|
135
|
+
return type === "" || type === "application/octet-stream";
|
|
136
|
+
}
|
|
137
|
+
function allowedMimeTypesValidator(allowed, options = {}) {
|
|
138
|
+
const allowedMime = (allowed ?? []).map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
139
|
+
if (allowedMime.length === 0) return () => [];
|
|
140
|
+
return ({ files }) => {
|
|
141
|
+
const issues = [];
|
|
142
|
+
for (const file of files) {
|
|
143
|
+
const fileType = (file.type || "").toLowerCase();
|
|
144
|
+
if (isFallbackType(fileType)) {
|
|
145
|
+
if (options.allowFallbackByExtension === false) issues.push({
|
|
146
|
+
fileName: file.name,
|
|
147
|
+
code: "mimeType",
|
|
148
|
+
message: `File "${file.name}" has fallback mime type "${fileType}"`
|
|
149
|
+
});
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (!allowedMime.includes(fileType)) issues.push({
|
|
153
|
+
fileName: file.name,
|
|
154
|
+
code: "mimeType",
|
|
155
|
+
message: `File "${file.name}" has disallowed mime type "${fileType}"`
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return issues;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/fileValidation/maxFileSizeBytesValidator.ts
|
|
163
|
+
function maxFileSizeBytesValidator(maxBytes) {
|
|
164
|
+
if (typeof maxBytes !== "number" || !Number.isFinite(maxBytes) || maxBytes <= 0) return () => [];
|
|
165
|
+
return ({ files }) => {
|
|
166
|
+
const issues = [];
|
|
167
|
+
for (const file of files) {
|
|
168
|
+
if (file.size <= maxBytes) continue;
|
|
169
|
+
issues.push({
|
|
170
|
+
fileName: file.name,
|
|
171
|
+
code: "maxFileSize",
|
|
172
|
+
message: `File "${file.name}" is too large (${file.size} bytes), maxBytes=${maxBytes}`,
|
|
173
|
+
meta: { maxBytes }
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return issues;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/fileValidation/maxSizeMbValidator.ts
|
|
181
|
+
function maxSizeMbValidator(maxSizeMb) {
|
|
182
|
+
if (typeof maxSizeMb !== "number" || !Number.isFinite(maxSizeMb) || maxSizeMb <= 0) return () => [];
|
|
183
|
+
const maxBytes = maxSizeMb * 1024 * 1024;
|
|
184
|
+
return ({ files }) => {
|
|
185
|
+
const issues = [];
|
|
186
|
+
for (const file of files) {
|
|
187
|
+
if (file.size <= maxBytes) continue;
|
|
188
|
+
issues.push({
|
|
189
|
+
fileName: file.name,
|
|
190
|
+
code: "maxSize",
|
|
191
|
+
message: `File "${file.name}" is too large (${file.size} bytes), maxBytes=${maxBytes}`,
|
|
192
|
+
meta: {
|
|
193
|
+
maxBytes,
|
|
194
|
+
maxSizeMb
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return issues;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/fileValidation/maxTotalSizeBytesValidator.ts
|
|
203
|
+
function maxTotalSizeBytesValidator(maxBytes) {
|
|
204
|
+
if (typeof maxBytes !== "number" || !Number.isFinite(maxBytes) || maxBytes <= 0) return () => [];
|
|
205
|
+
return ({ files }) => {
|
|
206
|
+
const total = files.reduce((acc, f) => acc + (Number(f.size) || 0), 0);
|
|
207
|
+
if (total <= maxBytes) return [];
|
|
208
|
+
return [{
|
|
209
|
+
code: "maxTotalSize",
|
|
210
|
+
message: `Total files size is too large (${total} bytes), maxTotalSizeBytes=${maxBytes}`,
|
|
211
|
+
meta: {
|
|
212
|
+
total,
|
|
213
|
+
maxBytes
|
|
214
|
+
}
|
|
215
|
+
}];
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { allowedExtensionsValidator as a, normalizeFiles as c, allowedMimeTypesValidator as i, runFileValidators as l, maxSizeMbValidator as n, acceptValidator as o, maxFileSizeBytesValidator as r, matchAccept as s, maxTotalSizeBytesValidator as t, FileValidationError as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileValidation-CwJA8Vmn.js","names":[],"sources":["../../src/fileValidation/FileValidationError.ts","../../src/fileValidation/runFileValidators.ts","../../src/fileValidation/matchAccept.ts","../../src/fileValidation/acceptValidator.ts","../../src/fileValidation/allowedExtensionsValidator.ts","../../src/fileValidation/allowedMimeTypesValidator.ts","../../src/fileValidation/maxFileSizeBytesValidator.ts","../../src/fileValidation/maxSizeMbValidator.ts","../../src/fileValidation/maxTotalSizeBytesValidator.ts"],"sourcesContent":["import type { FileValidationIssue, FileValidationIssueCode } from './types'\n\nexport class FileValidationError extends Error {\n code: FileValidationIssueCode\n file?: File\n issues: FileValidationIssue[]\n\n constructor(issues: FileValidationIssue[], files?: File[], message?: string) {\n super(message ?? issues[0]?.message ?? 'File validation failed')\n this.name = 'FileValidationError'\n\n this.issues = issues\n this.code = issues[0]?.code ?? 'accept'\n\n const firstFileName = issues[0]?.fileName\n const byName = firstFileName && files ? files.find(f => f.name === firstFileName) : undefined\n // Fallback to the first file if the named one isn't present in `files`\n // (e.g. aggregate issue like `maxTotalSize` has no `fileName`, or names diverged).\n this.file = byName ?? files?.[0]\n }\n}","import type { FileValidationIssue, FileValidator, FileValidatorContext } from './types'\n\nexport function normalizeFiles(files: File[], multiple: boolean): File[] {\n const list = [...files]\n return multiple ? list : list.slice(0, 1)\n}\n\nfunction isPromiseLike<T>(value: unknown): value is PromiseLike<T> {\n return !!value && typeof (value as any).then === 'function'\n}\n\nexport type RunFileValidatorsResult = { files: File[]; issues: FileValidationIssue[] }\n\nexport function runFileValidators(\n files: File[],\n validators: FileValidator[] | undefined,\n context: FileValidatorContext,\n): RunFileValidatorsResult | Promise<RunFileValidatorsResult> {\n const picked = normalizeFiles(files, context.multiple)\n\n const issues: FileValidationIssue[] = []\n\n const list = validators ?? []\n for (let i = 0; i < list.length; i++) {\n const validator = list[i]\n if (!validator) continue\n\n const res = validator({ files: picked, context })\n\n if (isPromiseLike<FileValidationIssue[]>(res)) {\n return (async () => {\n const first = await res\n if (Array.isArray(first) && first.length > 0) issues.push(...first)\n\n for (let j = i + 1; j < list.length; j++) {\n const nextValidator = list[j]\n if (!nextValidator) continue\n\n const nextRes = nextValidator({ files: picked, context })\n const next = isPromiseLike<FileValidationIssue[]>(nextRes) ? await nextRes : nextRes\n if (Array.isArray(next) && next.length > 0) issues.push(...next)\n }\n\n return { files: picked, issues }\n })()\n }\n\n if (Array.isArray(res) && res.length > 0) issues.push(...res)\n }\n\n return { files: picked, issues }\n}","function parseAccept(accept: string | undefined): string[] {\n if (!accept) return []\n\n return accept\n .split(',')\n .map(s => s.trim())\n .filter(Boolean)\n}\n\nexport function matchAccept(file: File, accept: string | undefined): boolean {\n const tokens = parseAccept(accept)\n if (!tokens.length) return true\n\n const fileName = file.name.toLowerCase()\n const fileType = (file.type || '').toLowerCase()\n\n for (const rawToken of tokens) {\n const token = rawToken.toLowerCase()\n\n // Extension match, e.g. \".png\".\n if (token.startsWith('.')) {\n if (fileName.endsWith(token)) return true\n continue\n }\n\n // Mime group match, e.g. \"image/*\".\n if (token.endsWith('/*')) {\n if (!fileType) continue\n const prefix = token.slice(0, -1) // keep trailing '/'\n if (fileType.startsWith(prefix)) return true\n continue\n }\n\n // Exact mime match, e.g. \"image/png\".\n if (!fileType) continue\n if (fileType === token) return true\n }\n\n return false\n}","import type { FileValidationIssue, FileValidator } from './types'\n\nimport { matchAccept } from './matchAccept'\n\nexport function acceptValidator(accept: string | undefined): FileValidator {\n if (!accept) return () => []\n\n return ({ files }): FileValidationIssue[] => {\n const issues: FileValidationIssue[] = []\n\n for (const file of files) {\n if (matchAccept(file, accept)) continue\n\n issues.push({\n fileName: file.name,\n code: 'accept',\n message: `File \"${file.name}\" does not match accept=\"${accept}\"`,\n })\n }\n\n return issues\n }\n}","import type { FileValidationIssue, FileValidator } from './types'\n\nfunction normalizeExtensions(exts: string[] | undefined): string[] {\n return (exts ?? [])\n .map(s => s.trim().toLowerCase())\n .filter(Boolean)\n .map(s => (s.startsWith('.') ? s.slice(1) : s))\n}\n\nfunction fileExtensionLower(fileName: string): string {\n const i = fileName.lastIndexOf('.')\n if (i < 0) return ''\n return fileName.slice(i + 1).toLowerCase()\n}\n\nexport function allowedExtensionsValidator(exts: string[]): FileValidator {\n const allowedExt = normalizeExtensions(exts)\n if (allowedExt.length === 0) return () => []\n\n return ({ files }): FileValidationIssue[] => {\n const issues: FileValidationIssue[] = []\n\n for (const file of files) {\n const ext = fileExtensionLower(file.name)\n if (!ext) continue\n\n if (!allowedExt.includes(ext)) {\n issues.push({\n fileName: file.name,\n code: 'extension',\n message: `File \"${file.name}\" has disallowed extension \".${ext}\"`,\n })\n }\n }\n\n return issues\n }\n}","import type { FileValidationIssue, FileValidator } from './types'\n\nexport type AllowedMimeTypesValidatorOptions = {\n /**\n * Если `true`, то для fallback-типа (`''`/`application/octet-stream`) валидация по MIME пропускается,\n * предполагая проверку расширения отдельным валидатором.\n */\n allowFallbackByExtension?: boolean\n}\n\nfunction isFallbackType(type: string): boolean {\n return type === '' || type === 'application/octet-stream'\n}\n\nexport function allowedMimeTypesValidator(\n allowed: string[],\n options: AllowedMimeTypesValidatorOptions = {},\n): FileValidator {\n const allowedMime = (allowed ?? []).map(s => s.trim().toLowerCase()).filter(Boolean)\n if (allowedMime.length === 0) return () => []\n\n return ({ files }): FileValidationIssue[] => {\n const issues: FileValidationIssue[] = []\n\n for (const file of files) {\n const fileType = (file.type || '').toLowerCase()\n\n if (isFallbackType(fileType)) {\n // Legacy behavior in DS: fallback types are not rejected by MIME allow-list.\n // If consumer needs strictness, it can explicitly forbid fallback types.\n if (options.allowFallbackByExtension === false) {\n issues.push({\n fileName: file.name,\n code: 'mimeType',\n message: `File \"${file.name}\" has fallback mime type \"${fileType}\"`,\n })\n }\n\n continue\n }\n\n if (!allowedMime.includes(fileType)) {\n issues.push({\n fileName: file.name,\n code: 'mimeType',\n message: `File \"${file.name}\" has disallowed mime type \"${fileType}\"`,\n })\n }\n }\n\n return issues\n }\n}","import type { FileValidationIssue, FileValidator } from './types'\n\nexport function maxFileSizeBytesValidator(maxBytes: number | undefined): FileValidator {\n if (typeof maxBytes !== 'number' || !Number.isFinite(maxBytes) || maxBytes <= 0) return () => []\n\n return ({ files }): FileValidationIssue[] => {\n const issues: FileValidationIssue[] = []\n\n for (const file of files) {\n if (file.size <= maxBytes) continue\n\n issues.push({\n fileName: file.name,\n code: 'maxFileSize',\n message: `File \"${file.name}\" is too large (${file.size} bytes), maxBytes=${maxBytes}`,\n meta: { maxBytes },\n })\n }\n\n return issues\n }\n}","import type { FileValidationIssue, FileValidator } from './types'\n\nexport function maxSizeMbValidator(maxSizeMb: number | undefined): FileValidator {\n if (typeof maxSizeMb !== 'number' || !Number.isFinite(maxSizeMb) || maxSizeMb <= 0) return () => []\n const maxBytes = maxSizeMb * 1024 * 1024\n\n return ({ files }): FileValidationIssue[] => {\n const issues: FileValidationIssue[] = []\n\n for (const file of files) {\n if (file.size <= maxBytes) continue\n\n issues.push({\n fileName: file.name,\n code: 'maxSize',\n message: `File \"${file.name}\" is too large (${file.size} bytes), maxBytes=${maxBytes}`,\n meta: { maxBytes, maxSizeMb },\n })\n }\n\n return issues\n }\n}","import type { FileValidationIssue, FileValidator } from './types'\n\nexport function maxTotalSizeBytesValidator(maxBytes: number | undefined): FileValidator {\n if (typeof maxBytes !== 'number' || !Number.isFinite(maxBytes) || maxBytes <= 0) return () => []\n\n return ({ files }): FileValidationIssue[] => {\n const total = files.reduce((acc, f) => acc + (Number(f.size) || 0), 0)\n if (total <= maxBytes) return []\n\n const issue: FileValidationIssue = {\n code: 'maxTotalSize',\n message: `Total files size is too large (${total} bytes), maxTotalSizeBytes=${maxBytes}`,\n meta: { total, maxBytes },\n }\n\n return [issue]\n }\n}"],"mappings":";AAEA,IAAa,sBAAb,cAAyC,MAAM;CAC7C;CACA;CACA;CAEA,YAAY,QAA+B,OAAgB,SAAkB;AAC3E,QAAM,WAAW,OAAO,IAAI,WAAW,yBAAyB;AAChE,OAAK,OAAO;AAEZ,OAAK,SAAS;AACd,OAAK,OAAO,OAAO,IAAI,QAAQ;EAE/B,MAAM,gBAAgB,OAAO,IAAI;AAIjC,OAAK,QAHU,iBAAiB,QAAQ,MAAM,MAAK,MAAK,EAAE,SAAS,cAAc,GAAG,KAAA,MAG9D,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0.4 text-[11px]",
|
|
4
4
|
md: "px-2.5 py-0.5 text-[12px]",
|
|
5
5
|
lg: "px-3 py-1 text-[13px]"
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
var semiRadiusClassBySize = {
|
|
7
8
|
sm: "rounded-[3px]",
|
|
8
9
|
md: "rounded-[3px]",
|
|
9
10
|
lg: "rounded-[5px]"
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
var lightToneClassByTone = {
|
|
11
13
|
neutral: "bg-[var(--muted)] text-[var(--fg)] border-[var(--brd)]",
|
|
12
14
|
primary: "bg-[var(--accent)] text-[var(--accent-fg)] border-[color-mix(in_srgb,var(--primary)_30%,var(--accent))]",
|
|
13
15
|
success: "bg-[var(--ds-success-light)] text-[var(--ds-success)] border-[color-mix(in_srgb,var(--ds-success)_30%,var(--ds-success-light))]",
|
|
@@ -16,7 +18,8 @@ var e = {
|
|
|
16
18
|
info: "bg-[var(--ds-info-light)] text-[var(--ds-info)] border-[color-mix(in_srgb,var(--ds-info)_30%,var(--ds-info-light))]",
|
|
17
19
|
slate: "bg-[var(--ds-slate-light)] text-[var(--ds-slate-text)] border-[color-mix(in_srgb,var(--ds-slate)_30%,var(--ds-slate-light))]",
|
|
18
20
|
azure: "bg-[var(--ds-azure-light)] text-[var(--ds-azure-text)] border-[color-mix(in_srgb,var(--ds-azure)_30%,var(--ds-azure-light))]"
|
|
19
|
-
}
|
|
21
|
+
};
|
|
22
|
+
var darkToneClassByTone = {
|
|
20
23
|
neutral: "bg-[var(--fg)] text-[var(--bg)] border-[color-mix(in_srgb,var(--fg)_35%,var(--brd))]",
|
|
21
24
|
primary: "bg-[var(--primary)] text-[var(--primary-fg)] border-[var(--primary)]",
|
|
22
25
|
success: "bg-[var(--ds-success)] text-white border-[var(--ds-success)]",
|
|
@@ -26,18 +29,20 @@ var e = {
|
|
|
26
29
|
slate: "bg-[var(--ds-slate)] text-[var(--ds-slate-fg)] border-[var(--ds-slate)]",
|
|
27
30
|
azure: "bg-[var(--ds-azure)] text-[var(--ds-azure-fg)] border-[var(--ds-azure)]"
|
|
28
31
|
};
|
|
29
|
-
function
|
|
30
|
-
|
|
32
|
+
function radiusClass(radius, size) {
|
|
33
|
+
if (radius === "square") return "rounded-[var(--ds-radius-none)]";
|
|
34
|
+
if (radius === "semi") return semiRadiusClassBySize[size];
|
|
35
|
+
return "rounded-full";
|
|
31
36
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
37
|
+
function toneClass(tone, dark) {
|
|
38
|
+
return dark ? darkToneClassByTone[tone] : lightToneClassByTone[tone];
|
|
34
39
|
}
|
|
35
|
-
function
|
|
40
|
+
function grBadgeClass(options) {
|
|
36
41
|
return [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
radiusClass(options.radius, options.size),
|
|
43
|
+
sizeClassBySize[options.size],
|
|
44
|
+
toneClass(options.tone, options.dark)
|
|
40
45
|
].join(" ");
|
|
41
46
|
}
|
|
42
47
|
//#endregion
|
|
43
|
-
export {
|
|
48
|
+
export { sizeClassBySize as a, semiRadiusClassBySize as i, grBadgeClass as n, lightToneClassByTone as r, darkToneClassByTone as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grBadgeStyles-pqqbVgLk.js","names":[],"sources":["../../src/components/GrBadge/grBadgeStyles.ts"],"sourcesContent":["export type GrBadgeTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'slate' | 'azure'\nexport type GrBadgeSize = 'sm' | 'md' | 'lg'\nexport type GrBadgeRadius = 'square' | 'semi' | 'round'\nexport const sizeClassBySize: Record<GrBadgeSize, string> = {\n sm: 'px-2 py-0.4 text-[11px]',\n md: 'px-2.5 py-0.5 text-[12px]',\n lg: 'px-3 py-1 text-[13px]',\n}\nexport const semiRadiusClassBySize: Record<GrBadgeSize, string> = {\n sm: 'rounded-[3px]',\n md: 'rounded-[3px]',\n lg: 'rounded-[5px]',\n}\nexport const lightToneClassByTone: Record<GrBadgeTone, string> = {\n neutral: 'bg-[var(--muted)] text-[var(--fg)] border-[var(--brd)]',\n primary:\n 'bg-[var(--accent)] text-[var(--accent-fg)] border-[color-mix(in_srgb,var(--primary)_30%,var(--accent))]',\n success: 'bg-[var(--ds-success-light)] text-[var(--ds-success)] border-[color-mix(in_srgb,var(--ds-success)_30%,var(--ds-success-light))]',\n warning: 'bg-[var(--ds-warning-light)] text-[var(--ds-warning)] border-[color-mix(in_srgb,var(--ds-warning)_30%,var(--ds-warning-light))]',\n danger: 'bg-[var(--ds-danger-light)] text-[var(--ds-danger)] border-[color-mix(in_srgb,var(--ds-danger)_30%,var(--ds-danger-light))]',\n info: 'bg-[var(--ds-info-light)] text-[var(--ds-info)] border-[color-mix(in_srgb,var(--ds-info)_30%,var(--ds-info-light))]',\n slate: 'bg-[var(--ds-slate-light)] text-[var(--ds-slate-text)] border-[color-mix(in_srgb,var(--ds-slate)_30%,var(--ds-slate-light))]',\n azure: 'bg-[var(--ds-azure-light)] text-[var(--ds-azure-text)] border-[color-mix(in_srgb,var(--ds-azure)_30%,var(--ds-azure-light))]',\n}\nexport const darkToneClassByTone: Record<GrBadgeTone, string> = {\n neutral: 'bg-[var(--fg)] text-[var(--bg)] border-[color-mix(in_srgb,var(--fg)_35%,var(--brd))]',\n primary: 'bg-[var(--primary)] text-[var(--primary-fg)] border-[var(--primary)]',\n success: 'bg-[var(--ds-success)] text-white border-[var(--ds-success)]',\n warning: 'bg-[var(--ds-warning)] text-white border-[var(--ds-warning)]',\n danger: 'bg-[var(--ds-danger)] text-white border-[var(--ds-danger)]',\n info: 'bg-[var(--ds-info)] text-white border-[var(--ds-info)]',\n slate: 'bg-[var(--ds-slate)] text-[var(--ds-slate-fg)] border-[var(--ds-slate)]',\n azure: 'bg-[var(--ds-azure)] text-[var(--ds-azure-fg)] border-[var(--ds-azure)]',\n}\nfunction radiusClass(radius: GrBadgeRadius, size: GrBadgeSize): string {\n if (radius === 'square') return 'rounded-[var(--ds-radius-none)]'\n if (radius === 'semi') return semiRadiusClassBySize[size]\n return 'rounded-full'\n}\nfunction toneClass(tone: GrBadgeTone, dark: boolean): string {\n return dark ? darkToneClassByTone[tone] : lightToneClassByTone[tone]\n}\nexport function grBadgeClass(options: { tone: GrBadgeTone, dark: boolean, size: GrBadgeSize, radius: GrBadgeRadius }): string {\n return [\n radiusClass(options.radius, options.size),\n sizeClassBySize[options.size],\n toneClass(options.tone, options.dark),\n ].join(' ')\n}\n"],"mappings":";AAGA,IAAa,kBAA+C;CAC1D,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AACD,IAAa,wBAAqD;CAChE,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AACD,IAAa,uBAAoD;CAC/D,SAAS;CACT,SACE;CACF,SAAS;CACT,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;CACP,OAAO;CACR;AACD,IAAa,sBAAmD;CAC9D,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;CACP,OAAO;CACR;AACD,SAAS,YAAY,QAAuB,MAA2B;AACrE,KAAI,WAAW,SAAU,QAAO;AAChC,KAAI,WAAW,OAAQ,QAAO,sBAAsB;AACpD,QAAO;;AAET,SAAS,UAAU,MAAmB,MAAuB;AAC3D,QAAO,OAAO,oBAAoB,QAAQ,qBAAqB;;AAEjE,SAAgB,aAAa,SAAiG;AAC5H,QAAO;EACL,YAAY,QAAQ,QAAQ,QAAQ,KAAK;EACzC,gBAAgB,QAAQ;EACxB,UAAU,QAAQ,MAAM,QAAQ,KAAK;EACtC,CAAC,KAAK,IAAI"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
//#region src/components/GrButton/grButtonStyles.ts
|
|
2
|
-
var
|
|
2
|
+
var base = "inline-flex items-center justify-center gap-2 select-none whitespace-nowrap rounded-md transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:opacity-50 disabled:cursor-not-allowed";
|
|
3
|
+
var grButtonBaseClass = base;
|
|
4
|
+
var sizes = {
|
|
3
5
|
xs: "h-7 text-xs px-2.5",
|
|
4
6
|
sm: "h-8 text-sm px-3",
|
|
5
7
|
md: "h-10 text-sm px-4",
|
|
6
8
|
lg: "h-11 text-base px-5"
|
|
7
|
-
}
|
|
9
|
+
};
|
|
10
|
+
var squareSizes = {
|
|
8
11
|
xs: "h-7 w-7 p-0",
|
|
9
12
|
sm: "h-8 w-8 p-0",
|
|
10
13
|
md: "h-10 w-10 p-0",
|
|
11
14
|
lg: "h-11 w-11 p-0"
|
|
12
|
-
}
|
|
15
|
+
};
|
|
16
|
+
var tones = {
|
|
13
17
|
primary: {
|
|
14
18
|
solidBackground: "var(--ds-button-primary-bg,var(--primary))",
|
|
15
19
|
solidBackgroundHover: "var(--ds-button-primary-bg-hover,var(--primary-hover))",
|
|
@@ -123,61 +127,65 @@ var e = "inline-flex items-center justify-center gap-2 select-none whitespace-no
|
|
|
123
127
|
borderActive: "var(--ds-azure-active)"
|
|
124
128
|
}
|
|
125
129
|
};
|
|
126
|
-
function
|
|
127
|
-
return `[${
|
|
130
|
+
function withVar(token) {
|
|
131
|
+
return `[${token}]`;
|
|
128
132
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
`bg-${
|
|
133
|
-
`text-${
|
|
134
|
-
`border border-${
|
|
135
|
-
`hover:bg-${
|
|
136
|
-
`hover:border-${
|
|
137
|
-
`active:bg-${
|
|
138
|
-
`hover:active:bg-${
|
|
139
|
-
`active:border-${
|
|
140
|
-
`hover:active:border-${
|
|
141
|
-
].join(" ")
|
|
142
|
-
|
|
143
|
-
`
|
|
144
|
-
`
|
|
145
|
-
`
|
|
146
|
-
`hover:
|
|
147
|
-
`
|
|
148
|
-
`
|
|
149
|
-
`active:
|
|
150
|
-
`
|
|
151
|
-
|
|
133
|
+
function variantClass(variant, tone) {
|
|
134
|
+
const tokens = tones[tone];
|
|
135
|
+
if (variant === "primary") return [
|
|
136
|
+
`bg-${withVar(tokens.solidBackground)}`,
|
|
137
|
+
`text-${withVar(tokens.solidForeground)}`,
|
|
138
|
+
`border border-${withVar(tokens.solidBackground)}`,
|
|
139
|
+
`hover:bg-${withVar(tokens.solidBackgroundHover)}`,
|
|
140
|
+
`hover:border-${withVar(tokens.solidBackgroundHover)}`,
|
|
141
|
+
`active:bg-${withVar(tokens.solidBackgroundActive)}`,
|
|
142
|
+
`hover:active:bg-${withVar(tokens.solidBackgroundActive)}`,
|
|
143
|
+
`active:border-${withVar(tokens.solidBackgroundActive)}`,
|
|
144
|
+
`hover:active:border-${withVar(tokens.solidBackgroundActive)}`
|
|
145
|
+
].join(" ");
|
|
146
|
+
if (variant === "secondary") return [
|
|
147
|
+
`bg-${withVar(tokens.softBackground)}`,
|
|
148
|
+
`text-${withVar(tokens.softForeground)}`,
|
|
149
|
+
`border border-${withVar(tokens.border)}`,
|
|
150
|
+
`hover:bg-${withVar(tokens.softBackgroundHover)}`,
|
|
151
|
+
`hover:border-${withVar(tokens.borderHover)}`,
|
|
152
|
+
`active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
153
|
+
`hover:active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
154
|
+
`active:border-${withVar(tokens.borderActive)}`,
|
|
155
|
+
`hover:active:border-${withVar(tokens.borderActive)}`
|
|
156
|
+
].join(" ");
|
|
157
|
+
if (variant === "outline") return [
|
|
152
158
|
"bg-transparent",
|
|
153
|
-
`text-${
|
|
154
|
-
`border border-${
|
|
155
|
-
`hover:bg-${
|
|
156
|
-
`hover:border-${
|
|
157
|
-
`active:bg-${
|
|
158
|
-
`hover:active:bg-${
|
|
159
|
-
`active:border-${
|
|
160
|
-
`hover:active:border-${
|
|
161
|
-
].join(" ")
|
|
159
|
+
`text-${withVar(tokens.accentText)}`,
|
|
160
|
+
`border border-${withVar(tokens.border)}`,
|
|
161
|
+
`hover:bg-${withVar(tokens.softBackgroundHover)}`,
|
|
162
|
+
`hover:border-${withVar(tokens.borderHover)}`,
|
|
163
|
+
`active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
164
|
+
`hover:active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
165
|
+
`active:border-${withVar(tokens.borderActive)}`,
|
|
166
|
+
`hover:active:border-${withVar(tokens.borderActive)}`
|
|
167
|
+
].join(" ");
|
|
168
|
+
if (variant === "ghost") return [
|
|
162
169
|
"bg-transparent",
|
|
163
|
-
`text-${
|
|
164
|
-
`hover:bg-${
|
|
165
|
-
`active:bg-${
|
|
166
|
-
`hover:active:bg-${
|
|
167
|
-
].join(" ")
|
|
170
|
+
`text-${withVar(tokens.accentText)}`,
|
|
171
|
+
`hover:bg-${withVar(tokens.softBackgroundHover)}`,
|
|
172
|
+
`active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
173
|
+
`hover:active:bg-${withVar(tokens.softBackgroundActive)}`
|
|
174
|
+
].join(" ");
|
|
175
|
+
return [
|
|
168
176
|
"bg-transparent",
|
|
169
|
-
`text-${
|
|
177
|
+
`text-${withVar(tokens.accentText)}`,
|
|
170
178
|
"border border-transparent",
|
|
171
|
-
`hover:bg-${
|
|
172
|
-
`hover:border-${
|
|
173
|
-
`active:bg-${
|
|
174
|
-
`hover:active:bg-${
|
|
175
|
-
`active:border-${
|
|
176
|
-
`hover:active:border-${
|
|
179
|
+
`hover:bg-${withVar(tokens.softBackgroundHover)}`,
|
|
180
|
+
`hover:border-${withVar(tokens.borderHover)}`,
|
|
181
|
+
`active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
182
|
+
`hover:active:bg-${withVar(tokens.softBackgroundActive)}`,
|
|
183
|
+
`active:border-${withVar(tokens.borderActive)}`,
|
|
184
|
+
`hover:active:border-${withVar(tokens.borderActive)}`
|
|
177
185
|
].join(" ");
|
|
178
186
|
}
|
|
179
|
-
function
|
|
180
|
-
return [
|
|
187
|
+
function grButtonClass(options) {
|
|
188
|
+
return [options.square ? squareSizes[options.size] : sizes[options.size], variantClass(options.variant, options.tone)].join(" ");
|
|
181
189
|
}
|
|
182
190
|
//#endregion
|
|
183
|
-
export {
|
|
191
|
+
export { squareSizes as a, sizes as i, grButtonBaseClass as n, tones as o, grButtonClass as r, variantClass as s, base as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grButtonStyles-BxZW2x0-.js","names":[],"sources":["../../src/components/GrButton/grButtonStyles.ts"],"sourcesContent":["export type GrButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'ghost-border'\nexport type GrButtonTone = 'primary' | 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'slate' | 'azure'\nexport type GrButtonSize = 'xs' | 'sm' | 'md' | 'lg'\n\nexport type GrButtonClassOptions = {\n variant: GrButtonVariant\n tone: GrButtonTone\n size: GrButtonSize\n square: boolean\n}\n\nexport type GrButtonToneTokens = {\n solidBackground: string\n solidBackgroundHover: string\n solidBackgroundActive: string\n solidForeground: string\n accentText: string\n softBackground: string\n softBackgroundHover: string\n softBackgroundActive: string\n softForeground: string\n border: string\n borderHover: string\n borderActive: string\n}\n\nexport const base =\n 'inline-flex items-center justify-center gap-2 select-none whitespace-nowrap rounded-md transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:opacity-50 disabled:cursor-not-allowed'\n\nexport const grButtonBaseClass = base\n\nexport const sizes: Record<GrButtonSize, string> = {\n xs: 'h-7 text-xs px-2.5',\n sm: 'h-8 text-sm px-3',\n md: 'h-10 text-sm px-4',\n lg: 'h-11 text-base px-5',\n}\n\nexport const squareSizes: Record<GrButtonSize, string> = {\n xs: 'h-7 w-7 p-0',\n sm: 'h-8 w-8 p-0',\n md: 'h-10 w-10 p-0',\n lg: 'h-11 w-11 p-0',\n}\n\nexport const tones: Record<GrButtonTone, GrButtonToneTokens> = {\n primary: {\n solidBackground: 'var(--ds-button-primary-bg,var(--primary))',\n solidBackgroundHover: 'var(--ds-button-primary-bg-hover,var(--primary-hover))',\n solidBackgroundActive: 'var(--ds-button-primary-bg-active,var(--primary-active))',\n solidForeground: 'var(--ds-button-primary-fg,var(--primary-fg))',\n accentText: 'var(--accent-fg)',\n softBackground: 'var(--ds-button-primary-soft-bg)',\n softBackgroundHover: 'var(--ds-button-primary-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-primary-soft-bg-active)',\n softForeground: 'var(--accent-fg)',\n border: 'var(--primary)',\n borderHover: 'var(--primary-hover)',\n borderActive: 'var(--primary-active)',\n },\n neutral: {\n solidBackground: 'var(--secondary)',\n solidBackgroundHover: 'var(--secondary-hover)',\n solidBackgroundActive: 'var(--secondary-active)',\n solidForeground: 'var(--secondary-fg)',\n accentText: 'var(--fg)',\n softBackground: 'var(--secondary)',\n softBackgroundHover: 'var(--secondary-hover)',\n softBackgroundActive: 'var(--secondary-active)',\n softForeground: 'var(--secondary-fg)',\n border: 'var(--brd)',\n borderHover: 'var(--brd-hover,var(--brd))',\n borderActive: 'var(--brd-active,var(--brd))',\n },\n success: {\n solidBackground: 'var(--ds-button-success-bg,var(--ds-success))',\n solidBackgroundHover: 'var(--ds-button-success-bg-hover,var(--ds-success-hover))',\n solidBackgroundActive: 'var(--ds-button-success-bg-active,var(--ds-success-active))',\n solidForeground: 'var(--ds-button-success-fg,var(--ds-success-fg,var(--fg)))',\n accentText: 'var(--ds-success-text,var(--ds-success))',\n softBackground: 'var(--ds-button-success-soft-bg)',\n softBackgroundHover: 'var(--ds-button-success-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-success-soft-bg-active)',\n softForeground: 'var(--ds-success-text,var(--ds-success))',\n border: 'var(--ds-success)',\n borderHover: 'var(--ds-success-hover)',\n borderActive: 'var(--ds-success-active)',\n },\n warning: {\n solidBackground: 'var(--ds-button-warning-bg,var(--ds-warning))',\n solidBackgroundHover: 'var(--ds-button-warning-bg-hover,var(--ds-warning-hover))',\n solidBackgroundActive: 'var(--ds-button-warning-bg-active,var(--ds-warning-active))',\n solidForeground: 'var(--ds-button-warning-fg,var(--ds-warning-fg,var(--fg)))',\n accentText: 'var(--ds-warning-text,var(--ds-warning))',\n softBackground: 'var(--ds-button-warning-soft-bg)',\n softBackgroundHover: 'var(--ds-button-warning-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-warning-soft-bg-active)',\n softForeground: 'var(--ds-warning-text,var(--ds-warning))',\n border: 'var(--ds-warning)',\n borderHover: 'var(--ds-warning-hover)',\n borderActive: 'var(--ds-warning-active)',\n },\n danger: {\n solidBackground: 'var(--ds-button-danger-bg,var(--ds-danger))',\n solidBackgroundHover: 'var(--ds-button-danger-bg-hover,var(--ds-danger-hover))',\n solidBackgroundActive: 'var(--ds-button-danger-bg-active,var(--ds-danger-active))',\n solidForeground: 'var(--ds-button-danger-fg,var(--ds-danger-fg,var(--fg)))',\n accentText: 'var(--ds-danger-text,var(--ds-danger))',\n softBackground: 'var(--ds-button-danger-soft-bg)',\n softBackgroundHover: 'var(--ds-button-danger-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-danger-soft-bg-active)',\n softForeground: 'var(--ds-danger-text,var(--ds-danger))',\n border: 'var(--ds-danger)',\n borderHover: 'var(--ds-danger-hover)',\n borderActive: 'var(--ds-danger-active)',\n },\n info: {\n solidBackground: 'var(--ds-button-info-bg,var(--ds-info))',\n solidBackgroundHover: 'var(--ds-button-info-bg-hover,var(--ds-info-hover))',\n solidBackgroundActive: 'var(--ds-button-info-bg-active,var(--ds-info-active))',\n solidForeground: 'var(--ds-button-info-fg,var(--ds-info-fg,var(--fg)))',\n accentText: 'var(--ds-info-text,var(--ds-info))',\n softBackground: 'var(--ds-button-info-soft-bg)',\n softBackgroundHover: 'var(--ds-button-info-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-info-soft-bg-active)',\n softForeground: 'var(--ds-info-text,var(--ds-info))',\n border: 'var(--ds-info)',\n borderHover: 'var(--ds-info-hover)',\n borderActive: 'var(--ds-info-active)',\n },\n slate: {\n solidBackground: 'var(--ds-button-slate-bg,var(--ds-slate))',\n solidBackgroundHover: 'var(--ds-button-slate-bg-hover,var(--ds-slate-hover))',\n solidBackgroundActive: 'var(--ds-button-slate-bg-active,var(--ds-slate-active))',\n solidForeground: 'var(--ds-button-slate-fg,var(--ds-slate-fg,var(--fg)))',\n accentText: 'var(--ds-slate-text,var(--ds-slate))',\n softBackground: 'var(--ds-button-slate-soft-bg)',\n softBackgroundHover: 'var(--ds-button-slate-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-slate-soft-bg-active)',\n softForeground: 'var(--ds-slate-text,var(--ds-slate))',\n border: 'var(--ds-slate)',\n borderHover: 'var(--ds-slate-hover)',\n borderActive: 'var(--ds-slate-active)',\n },\n azure: {\n solidBackground: 'var(--ds-button-azure-bg,var(--ds-azure))',\n solidBackgroundHover: 'var(--ds-button-azure-bg-hover,var(--ds-azure-hover))',\n solidBackgroundActive: 'var(--ds-button-azure-bg-active,var(--ds-azure-active))',\n solidForeground: 'var(--ds-button-azure-fg,var(--ds-azure-fg,var(--fg)))',\n accentText: 'var(--ds-azure-text,var(--ds-azure))',\n softBackground: 'var(--ds-button-azure-soft-bg)',\n softBackgroundHover: 'var(--ds-button-azure-soft-bg-hover)',\n softBackgroundActive: 'var(--ds-button-azure-soft-bg-active)',\n softForeground: 'var(--ds-azure-text,var(--ds-azure))',\n border: 'var(--ds-azure)',\n borderHover: 'var(--ds-azure-hover)',\n borderActive: 'var(--ds-azure-active)',\n },\n}\n\nfunction withVar(token: string): string {\n return `[${token}]`\n}\n\nexport function variantClass(variant: GrButtonVariant, tone: GrButtonTone): string {\n const tokens = tones[tone]\n\n if (variant === 'primary') {\n return [\n `bg-${withVar(tokens.solidBackground)}`,\n `text-${withVar(tokens.solidForeground)}`,\n `border border-${withVar(tokens.solidBackground)}`,\n `hover:bg-${withVar(tokens.solidBackgroundHover)}`,\n `hover:border-${withVar(tokens.solidBackgroundHover)}`,\n `active:bg-${withVar(tokens.solidBackgroundActive)}`,\n `hover:active:bg-${withVar(tokens.solidBackgroundActive)}`,\n `active:border-${withVar(tokens.solidBackgroundActive)}`,\n `hover:active:border-${withVar(tokens.solidBackgroundActive)}`,\n ].join(' ')\n }\n\n if (variant === 'secondary') {\n return [\n `bg-${withVar(tokens.softBackground)}`,\n `text-${withVar(tokens.softForeground)}`,\n `border border-${withVar(tokens.border)}`,\n `hover:bg-${withVar(tokens.softBackgroundHover)}`,\n `hover:border-${withVar(tokens.borderHover)}`,\n `active:bg-${withVar(tokens.softBackgroundActive)}`,\n `hover:active:bg-${withVar(tokens.softBackgroundActive)}`,\n `active:border-${withVar(tokens.borderActive)}`,\n `hover:active:border-${withVar(tokens.borderActive)}`,\n ].join(' ')\n }\n\n if (variant === 'outline') {\n return [\n 'bg-transparent',\n `text-${withVar(tokens.accentText)}`,\n `border border-${withVar(tokens.border)}`,\n `hover:bg-${withVar(tokens.softBackgroundHover)}`,\n `hover:border-${withVar(tokens.borderHover)}`,\n `active:bg-${withVar(tokens.softBackgroundActive)}`,\n `hover:active:bg-${withVar(tokens.softBackgroundActive)}`,\n `active:border-${withVar(tokens.borderActive)}`,\n `hover:active:border-${withVar(tokens.borderActive)}`,\n ].join(' ')\n }\n\n if (variant === 'ghost') {\n return [\n 'bg-transparent',\n `text-${withVar(tokens.accentText)}`,\n `hover:bg-${withVar(tokens.softBackgroundHover)}`,\n `active:bg-${withVar(tokens.softBackgroundActive)}`,\n `hover:active:bg-${withVar(tokens.softBackgroundActive)}`,\n ].join(' ')\n }\n\n return [\n 'bg-transparent',\n `text-${withVar(tokens.accentText)}`,\n 'border border-transparent',\n `hover:bg-${withVar(tokens.softBackgroundHover)}`,\n `hover:border-${withVar(tokens.borderHover)}`,\n `active:bg-${withVar(tokens.softBackgroundActive)}`,\n `hover:active:bg-${withVar(tokens.softBackgroundActive)}`,\n `active:border-${withVar(tokens.borderActive)}`,\n `hover:active:border-${withVar(tokens.borderActive)}`,\n ].join(' ')\n}\n\nexport function grButtonClass(options: GrButtonClassOptions): string {\n return [\n options.square ? squareSizes[options.size] : sizes[options.size],\n variantClass(options.variant, options.tone),\n ].join(' ')\n}\n"],"mappings":";AA0BA,IAAa,OACX;AAEF,IAAa,oBAAoB;AAEjC,IAAa,QAAsC;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAa,cAA4C;CACvD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAa,QAAkD;CAC7D,SAAS;EACP,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,cAAc;EACf;CACD,SAAS;EACP,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,cAAc;EACf;CACD,SAAS;EACP,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,cAAc;EACf;CACD,SAAS;EACP,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,cAAc;EACf;CACD,QAAQ;EACN,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,sBAAsB;EACtB,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,cAAc;EACf;CACD,MAAM;EACJ,iBAAiB;EACjB,sBAAsB;EACtB,uBAAuB;EACvB,iBAAiB;EACjB,YAAY;EACZ,gBAAgB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|
|
8
8
|
80: "w-80"
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
|
+
var alignmentClassByAlign = {
|
|
10
11
|
left: "origin-top-left",
|
|
11
12
|
right: "origin-top-right -translate-x-full",
|
|
12
13
|
center: "origin-top -translate-x-1/2"
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
return
|
|
15
|
+
function grDropdownWidthClass(width) {
|
|
16
|
+
return widthClassByWidth[width];
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
18
|
+
function grDropdownAlignmentClass(align) {
|
|
19
|
+
return alignmentClassByAlign[align];
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function grDropdownContentClass(contentClass) {
|
|
21
22
|
return [
|
|
22
23
|
"rounded-[var(--ds-radius-xl)]",
|
|
23
24
|
"border border-[var(--brd)]",
|
|
24
25
|
"bg-[var(--card)] text-[var(--card-fg)]",
|
|
25
26
|
"shadow-[var(--ds-shadow-2)]",
|
|
26
27
|
"p-1",
|
|
27
|
-
|
|
28
|
+
contentClass
|
|
28
29
|
].filter(Boolean).join(" ");
|
|
29
30
|
}
|
|
30
31
|
//#endregion
|
|
31
|
-
export {
|
|
32
|
+
export { widthClassByWidth as a, grDropdownWidthClass as i, grDropdownAlignmentClass as n, grDropdownContentClass as r, alignmentClassByAlign as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grDropdownStyles-DMp7RrI9.js","names":[],"sources":["../../src/components/GrDropdown/grDropdownStyles.ts"],"sourcesContent":["export type GrDropdownAlign = 'left' | 'right' | 'center'\nexport type GrDropdownWidth = 'auto' | '20' | '48' | '60' | '64' | '80'\n\nexport const widthClassByWidth: Record<GrDropdownWidth, string> = {\n auto: '',\n 20: 'w-20',\n 48: 'w-48',\n 60: 'w-60',\n 64: 'w-64',\n 80: 'w-80',\n}\n\nexport const alignmentClassByAlign: Record<GrDropdownAlign, string> = {\n left: 'origin-top-left',\n right: 'origin-top-right -translate-x-full',\n center: 'origin-top -translate-x-1/2',\n}\n\nexport function grDropdownWidthClass(width: GrDropdownWidth): string {\n return widthClassByWidth[width]\n}\n\nexport function grDropdownAlignmentClass(align: GrDropdownAlign): string {\n return alignmentClassByAlign[align]\n}\n\nexport function grDropdownContentClass(contentClass?: string): string {\n return [\n 'rounded-[var(--ds-radius-xl)]',\n 'border border-[var(--brd)]',\n 'bg-[var(--card)] text-[var(--card-fg)]',\n 'shadow-[var(--ds-shadow-2)]',\n 'p-1',\n contentClass,\n ].filter(Boolean).join(' ')\n}\n"],"mappings":";AAGA,IAAa,oBAAqD;CAChE,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,IAAa,wBAAyD;CACpE,MAAM;CACN,OAAO;CACP,QAAQ;CACT;AAED,SAAgB,qBAAqB,OAAgC;AACnE,QAAO,kBAAkB;;AAG3B,SAAgB,yBAAyB,OAAgC;AACvE,QAAO,sBAAsB;;AAG/B,SAAgB,uBAAuB,cAA+B;AACpE,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/GrLoading/grLoadingStyles.ts
|
|
2
|
+
var rootModeClass = {
|
|
3
|
+
fullscreen: "fixed inset-0 z-50",
|
|
4
|
+
inline: "absolute inset-0 z-10"
|
|
5
|
+
};
|
|
6
|
+
var rootBackgroundClass = "bg-black/25";
|
|
7
|
+
var rootBackdropBlurClass = "backdrop-blur-sm";
|
|
8
|
+
function grLoadingRootClass(options) {
|
|
9
|
+
return [
|
|
10
|
+
options.fullscreen ? rootModeClass.fullscreen : rootModeClass.inline,
|
|
11
|
+
!options.hasBackground ? rootBackgroundClass : "",
|
|
12
|
+
rootBackdropBlurClass,
|
|
13
|
+
options.customClass
|
|
14
|
+
].filter(Boolean).join(" ");
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { rootModeClass as i, rootBackdropBlurClass as n, rootBackgroundClass as r, grLoadingRootClass as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grLoadingStyles-CrxZHFL0.js","names":[],"sources":["../../src/components/GrLoading/grLoadingStyles.ts"],"sourcesContent":["export const rootModeClass = {\n fullscreen: 'fixed inset-0 z-50',\n inline: 'absolute inset-0 z-10',\n} as const\nexport const rootBackgroundClass = 'bg-black/25'\nexport const rootBackdropBlurClass = 'backdrop-blur-sm'\n\nexport function grLoadingRootClass(options: {\n fullscreen: boolean,\n hasBackground: boolean,\n customClass?: string\n}): string {\n return [\n options.fullscreen ? rootModeClass.fullscreen : rootModeClass.inline,\n !options.hasBackground ? rootBackgroundClass : '',\n rootBackdropBlurClass,\n options.customClass,\n ]\n .filter(Boolean)\n .join(' ')\n}\n"],"mappings":";AAAA,IAAa,gBAAgB;CACzB,YAAY;CACZ,QAAQ;CACX;AACD,IAAa,sBAAsB;AACnC,IAAa,wBAAwB;AAErC,SAAgB,mBAAmB,SAIxB;AACP,QAAO;EACH,QAAQ,aAAa,cAAc,aAAa,cAAc;EAC9D,CAAC,QAAQ,gBAAgB,sBAAsB;EAC/C;EACA,QAAQ;EACX,CACI,OAAO,QAAQ,CACf,KAAK,IAAI"}
|
|
@@ -1,38 +1,47 @@
|
|
|
1
1
|
//#region src/components/GrModal/grModalStyles.ts
|
|
2
|
-
var
|
|
2
|
+
var root = "fixed inset-0 z-50";
|
|
3
|
+
var shell = "fixed inset-0 overflow-y-auto p-4 sm:p-6";
|
|
4
|
+
var layout = "min-h-full flex items-center justify-center";
|
|
5
|
+
var overlay = "fixed inset-0 z-0 bg-black/40";
|
|
6
|
+
var overlayTransition = {
|
|
3
7
|
enter: "duration-200 ease-out",
|
|
4
8
|
enterFrom: "opacity-0",
|
|
5
9
|
enterTo: "opacity-100",
|
|
6
10
|
leave: "duration-150 ease-in",
|
|
7
11
|
leaveFrom: "opacity-100",
|
|
8
12
|
leaveTo: "opacity-0"
|
|
9
|
-
}
|
|
13
|
+
};
|
|
14
|
+
var panelTransition = {
|
|
10
15
|
enter: "duration-200 ease-out",
|
|
11
16
|
enterFrom: "opacity-0 translate-y-2 sm:translate-y-0 sm:scale-95",
|
|
12
17
|
enterTo: "opacity-100 translate-y-0 sm:scale-100",
|
|
13
18
|
leave: "duration-150 ease-in",
|
|
14
19
|
leaveFrom: "opacity-100 translate-y-0 sm:scale-100",
|
|
15
20
|
leaveTo: "opacity-0 translate-y-2 sm:translate-y-0 sm:scale-95"
|
|
16
|
-
}
|
|
21
|
+
};
|
|
22
|
+
var panelBase = "w-full overflow-hidden relative z-10 border border-[var(--brd)] bg-[var(--card)] text-[var(--card-fg)] shadow-[var(--ds-shadow-2)] outline-none";
|
|
23
|
+
var panelWidthBySize = {
|
|
17
24
|
sm: "max-w-[420px]",
|
|
18
25
|
md: "max-w-[560px]",
|
|
19
26
|
lg: "max-w-[720px]",
|
|
20
27
|
xl: "max-w-[920px]",
|
|
21
28
|
full: "max-w-none"
|
|
22
|
-
}
|
|
29
|
+
};
|
|
30
|
+
var panelRadiusBySize = {
|
|
23
31
|
sm: "rounded-[var(--ds-radius-xl)]",
|
|
24
32
|
md: "rounded-[var(--ds-radius-xl)]",
|
|
25
33
|
lg: "rounded-[var(--ds-radius-xl)]",
|
|
26
34
|
xl: "rounded-[var(--ds-radius-xl)]",
|
|
27
35
|
full: "rounded-none sm:rounded-[var(--ds-radius-xl)]"
|
|
28
|
-
}
|
|
29
|
-
|
|
36
|
+
};
|
|
37
|
+
var panelHeightBySize = { full: "h-[100svh] sm:h-auto" };
|
|
38
|
+
function getGrModalPanelClass(size) {
|
|
30
39
|
return [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
panelBase,
|
|
41
|
+
panelWidthBySize[size],
|
|
42
|
+
panelHeightBySize[size],
|
|
43
|
+
panelRadiusBySize[size]
|
|
35
44
|
].filter(Boolean).join(" ");
|
|
36
45
|
}
|
|
37
46
|
//#endregion
|
|
38
|
-
export {
|
|
47
|
+
export { panelBase as a, panelTransition as c, shell as d, overlayTransition as i, panelWidthBySize as l, layout as n, panelHeightBySize as o, overlay as r, panelRadiusBySize as s, getGrModalPanelClass as t, root as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grModalStyles-Dv2NXBKi.js","names":[],"sources":["../../src/components/GrModal/grModalStyles.ts"],"sourcesContent":["export type GrModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'\n\n// Корневые утилитарные классы, используемые шаблоном `GrModal.vue`.\n// Они же являются единственным источником истины для safelist.\nexport const root = 'fixed inset-0 z-50'\nexport const shell = 'fixed inset-0 overflow-y-auto p-4 sm:p-6'\nexport const layout = 'min-h-full flex items-center justify-center'\nexport const overlay = 'fixed inset-0 z-0 bg-black/40'\n\n// Классы для `<TransitionChild :enter=\"...\" :enter-from=\"...\" ...>`.\n// Разбиты по фазам транзишна, чтобы не склеивать их в «мешок токенов».\nexport const overlayTransition = {\n enter: 'duration-200 ease-out',\n enterFrom: 'opacity-0',\n enterTo: 'opacity-100',\n leave: 'duration-150 ease-in',\n leaveFrom: 'opacity-100',\n leaveTo: 'opacity-0',\n} as const\n\nexport const panelTransition = {\n enter: 'duration-200 ease-out',\n enterFrom: 'opacity-0 translate-y-2 sm:translate-y-0 sm:scale-95',\n enterTo: 'opacity-100 translate-y-0 sm:scale-100',\n leave: 'duration-150 ease-in',\n leaveFrom: 'opacity-100 translate-y-0 sm:scale-100',\n leaveTo: 'opacity-0 translate-y-2 sm:translate-y-0 sm:scale-95',\n} as const\n\nexport const panelBase\n = 'w-full overflow-hidden relative z-10 border border-[var(--brd)] bg-[var(--card)] text-[var(--card-fg)] shadow-[var(--ds-shadow-2)] outline-none'\n\nexport const panelWidthBySize: Record<GrModalSize, string> = {\n sm: 'max-w-[420px]',\n md: 'max-w-[560px]',\n lg: 'max-w-[720px]',\n xl: 'max-w-[920px]',\n full: 'max-w-none',\n}\n\nexport const panelRadiusBySize: Record<GrModalSize, string> = {\n sm: 'rounded-[var(--ds-radius-xl)]',\n md: 'rounded-[var(--ds-radius-xl)]',\n lg: 'rounded-[var(--ds-radius-xl)]',\n xl: 'rounded-[var(--ds-radius-xl)]',\n full: 'rounded-none sm:rounded-[var(--ds-radius-xl)]',\n}\n\n// Для большинства размеров высота не задаётся — `Partial` + фильтрация пустых\n// значений в `getGrModalPanelClass` избавляют от двойных пробелов.\nexport const panelHeightBySize: Partial<Record<GrModalSize, string>> = {\n full: 'h-[100svh] sm:h-auto',\n}\n\nexport function getGrModalPanelClass(size: GrModalSize): string {\n return [\n panelBase,\n panelWidthBySize[size],\n panelHeightBySize[size],\n panelRadiusBySize[size],\n ]\n .filter(Boolean)\n .join(' ')\n}\n"],"mappings":";AAIA,IAAa,OAAO;AACpB,IAAa,QAAQ;AACrB,IAAa,SAAS;AACtB,IAAa,UAAU;AAIvB,IAAa,oBAAoB;CAC/B,OAAO;CACP,WAAW;CACX,SAAS;CACT,OAAO;CACP,WAAW;CACX,SAAS;CACV;AAED,IAAa,kBAAkB;CAC7B,OAAO;CACP,WAAW;CACX,SAAS;CACT,OAAO;CACP,WAAW;CACX,SAAS;CACV;AAED,IAAa,YACT;AAEJ,IAAa,mBAAgD;CAC3D,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAED,IAAa,oBAAiD;CAC5D,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP;AAID,IAAa,oBAA0D,EACrE,MAAM,wBACP;AAED,SAAgB,qBAAqB,MAA2B;AAC9D,QAAO;EACL;EACA,iBAAiB;EACjB,kBAAkB;EAClB,kBAAkB;EACnB,CACE,OAAO,QAAQ,CACf,KAAK,IAAI"}
|