ivt 0.7.2 → 0.7.4
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/accordion/index.mjs +13 -15
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/accordion-table/index.mjs +26 -28
- package/dist/accordion-table/index.mjs.map +1 -1
- package/dist/alert/index.mjs +3 -3
- package/dist/alert-dialog/index.mjs +15 -17
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/aspect-ratio/index.mjs +42 -3
- package/dist/aspect-ratio/index.mjs.map +1 -1
- package/dist/auto-complete-multi-select/index.mjs +31 -33
- package/dist/auto-complete-multi-select/index.mjs.map +1 -1
- package/dist/avatar/index.mjs +130 -8
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.mjs +3 -3
- package/dist/base/index.mjs +57 -142
- package/dist/base/index.mjs.map +1 -1
- package/dist/breadcrumb/index.mjs +5 -5
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.mjs +3 -3
- package/dist/button-group/index.mjs +3 -4
- package/dist/button-group/index.mjs.map +1 -1
- package/dist/calendar/index.mjs +9 -9
- package/dist/card/index.mjs +3 -3
- package/dist/carousel/index.mjs +4 -4
- package/dist/chart/index.mjs +2869 -1282
- package/dist/chart/index.mjs.map +1 -1
- package/dist/checkbox/index.mjs +12 -14
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chunks/AutoComplete-qFuwmV53.mjs +95 -0
- package/dist/chunks/AutoComplete-qFuwmV53.mjs.map +1 -0
- package/dist/chunks/{CalendarRange-k63hDccF.mjs → CalendarRange-Ce7PiNfq.mjs} +8 -8
- package/dist/chunks/{CalendarRange-k63hDccF.mjs.map → CalendarRange-Ce7PiNfq.mjs.map} +1 -1
- package/dist/chunks/{ComboboxField-5Glf1Ozh.mjs → ComboboxField-DaRpRraW.mjs} +9 -9
- package/dist/chunks/{ComboboxField-5Glf1Ozh.mjs.map → ComboboxField-DaRpRraW.mjs.map} +1 -1
- package/dist/chunks/{Container-Cv6NG9kb.mjs → Container-DwaAaEiC.mjs} +2 -2
- package/dist/chunks/{Container-Cv6NG9kb.mjs.map → Container-DwaAaEiC.mjs.map} +1 -1
- package/dist/chunks/{DeleteConfirmationModal-DRseBzq7.mjs → DeleteConfirmationModal-BwTbbBAw.mjs} +4 -4
- package/dist/chunks/{DeleteConfirmationModal-DRseBzq7.mjs.map → DeleteConfirmationModal-BwTbbBAw.mjs.map} +1 -1
- package/dist/chunks/{ListItem-eGWDX0GP.mjs → ListItem-zxS4CZdq.mjs} +4 -4
- package/dist/chunks/{ListItem-eGWDX0GP.mjs.map → ListItem-zxS4CZdq.mjs.map} +1 -1
- package/dist/chunks/{TooltipIndicator-BjtHYQzo.mjs → TooltipIndicator-CwGGAeRz.mjs} +4 -4
- package/dist/chunks/{TooltipIndicator-BjtHYQzo.mjs.map → TooltipIndicator-CwGGAeRz.mjs.map} +1 -1
- package/dist/chunks/{_commonjsHelpers-D3vrMN3C.mjs → _commonjsHelpers-B2Be7UYW.mjs} +1 -1
- package/dist/chunks/_commonjsHelpers-B2Be7UYW.mjs.map +1 -0
- package/dist/chunks/{accordion-BsbSmZP2.mjs → accordion-D4JVALAO.mjs} +9 -11
- package/dist/chunks/{accordion-BsbSmZP2.mjs.map → accordion-D4JVALAO.mjs.map} +1 -1
- package/dist/chunks/{alert-Cw-E3eta.mjs → alert-D-E6nsVK.mjs} +2 -2
- package/dist/chunks/{alert-Cw-E3eta.mjs.map → alert-D-E6nsVK.mjs.map} +1 -1
- package/dist/chunks/{badge-DTn1AQbT.mjs → badge-C6mkl9yr.mjs} +2 -2
- package/dist/chunks/{badge-DTn1AQbT.mjs.map → badge-C6mkl9yr.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-Lvc-Dri9.mjs → bundle-mjs-B1dpl-bk.mjs} +228 -154
- package/dist/chunks/bundle-mjs-B1dpl-bk.mjs.map +1 -0
- package/dist/chunks/{button-Cve1c7GQ.mjs → button-DsgJkgEz.mjs} +2 -2
- package/dist/chunks/{button-Cve1c7GQ.mjs.map → button-DsgJkgEz.mjs.map} +1 -1
- package/dist/chunks/{calendar-BTfcQ69r.mjs → calendar-Co99lCn4.mjs} +550 -166
- package/dist/chunks/calendar-Co99lCn4.mjs.map +1 -0
- package/dist/chunks/{calendar-days-D95Vh8Id.mjs → calendar-days-BF4GDmMr.mjs} +2 -2
- package/dist/chunks/{calendar-days-D95Vh8Id.mjs.map → calendar-days-BF4GDmMr.mjs.map} +1 -1
- package/dist/chunks/{card-BCce9vjU.mjs → card-Cuo7NL8y.mjs} +2 -2
- package/dist/chunks/{card-BCce9vjU.mjs.map → card-Cuo7NL8y.mjs.map} +1 -1
- package/dist/chunks/{check-F6R3Zyjv.mjs → check-CzKqQLNR.mjs} +2 -2
- package/dist/chunks/{check-F6R3Zyjv.mjs.map → check-CzKqQLNR.mjs.map} +1 -1
- package/dist/chunks/{checkbox-BONbXOR8.mjs → checkbox-C7RUdsIS.mjs} +9 -11
- package/dist/chunks/{checkbox-BONbXOR8.mjs.map → checkbox-C7RUdsIS.mjs.map} +1 -1
- package/dist/chunks/{chevron-down-CAAkkaxH.mjs → chevron-down-CZjN_vyX.mjs} +2 -2
- package/dist/chunks/{chevron-down-CAAkkaxH.mjs.map → chevron-down-CZjN_vyX.mjs.map} +1 -1
- package/dist/chunks/{chevron-left-D9H1SFsq.mjs → chevron-left-BpfBwM4S.mjs} +2 -2
- package/dist/chunks/{chevron-left-D9H1SFsq.mjs.map → chevron-left-BpfBwM4S.mjs.map} +1 -1
- package/dist/chunks/{chevron-right-BBzqWfgU.mjs → chevron-right-uq-O8rwC.mjs} +2 -2
- package/dist/chunks/{chevron-right-BBzqWfgU.mjs.map → chevron-right-uq-O8rwC.mjs.map} +1 -1
- package/dist/chunks/{chevrons-up-down-qNyleCLF.mjs → chevrons-up-down-DKM8h8j_.mjs} +2 -2
- package/dist/chunks/{chevrons-up-down-qNyleCLF.mjs.map → chevrons-up-down-DKM8h8j_.mjs.map} +1 -1
- package/dist/chunks/{command-IbA1nxIb.mjs → command-CAS791lb.mjs} +8 -8
- package/dist/chunks/{command-IbA1nxIb.mjs.map → command-CAS791lb.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-0uwxvfEG.mjs → createLucideIcon-xkRZC0aJ.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-0uwxvfEG.mjs.map → createLucideIcon-xkRZC0aJ.mjs.map} +1 -1
- package/dist/chunks/{date-BBTPAd8S.mjs → date-DYEUxjwi.mjs} +2 -2
- package/dist/chunks/{date-BBTPAd8S.mjs.map → date-DYEUxjwi.mjs.map} +1 -1
- package/dist/chunks/{dialog-B2DUrpTa.mjs → dialog-Dt_M700u.mjs} +4 -4
- package/dist/chunks/{dialog-B2DUrpTa.mjs.map → dialog-Dt_M700u.mjs.map} +1 -1
- package/dist/chunks/{ellipsis-DvX337aw.mjs → ellipsis-BcRZkfZw.mjs} +2 -2
- package/dist/chunks/{ellipsis-DvX337aw.mjs.map → ellipsis-BcRZkfZw.mjs.map} +1 -1
- package/dist/chunks/{form-CChLO9RR.mjs → form-CJnoOgoH.mjs} +299 -150
- package/dist/chunks/form-CJnoOgoH.mjs.map +1 -0
- package/dist/chunks/{format-4Jz4C5tC.mjs → format-BSPAt__h.mjs} +1 -1
- package/dist/chunks/{format-4Jz4C5tC.mjs.map → format-BSPAt__h.mjs.map} +1 -1
- package/dist/chunks/{format-numbers-BhgU0ZHz.mjs → format-numbers-BpGX211b.mjs} +2 -6
- package/dist/chunks/format-numbers-BpGX211b.mjs.map +1 -0
- package/dist/chunks/{hover-card-DX4d068Z.mjs → hover-card-DKMcpBnt.mjs} +9 -11
- package/dist/chunks/{hover-card-DX4d068Z.mjs.map → hover-card-DKMcpBnt.mjs.map} +1 -1
- package/dist/chunks/{index-6TVIC1_R.mjs → index-0DBJW078.mjs} +2 -2
- package/dist/chunks/{index-6TVIC1_R.mjs.map → index-0DBJW078.mjs.map} +1 -1
- package/dist/chunks/{index-Bx0xXTid.mjs → index-7wUPkpwA.mjs} +9 -11
- package/dist/chunks/{index-Bx0xXTid.mjs.map → index-7wUPkpwA.mjs.map} +1 -1
- package/dist/chunks/{index-Bewwph0a.mjs → index-9921_a2g.mjs} +1 -1
- package/dist/chunks/{index-Bewwph0a.mjs.map → index-9921_a2g.mjs.map} +1 -1
- package/dist/chunks/{index-CkRZ2gKz.mjs → index-B49Rv10M.mjs} +1 -1
- package/dist/chunks/{index-CkRZ2gKz.mjs.map → index-B49Rv10M.mjs.map} +1 -1
- package/dist/chunks/{index-na6H-GCB.mjs → index-B8pOe-bI.mjs} +13 -15
- package/dist/chunks/{index-na6H-GCB.mjs.map → index-B8pOe-bI.mjs.map} +1 -1
- package/dist/chunks/{index-DpW61g8q.mjs → index-B8zlei3I.mjs} +1 -1
- package/dist/chunks/{index-DpW61g8q.mjs.map → index-B8zlei3I.mjs.map} +1 -1
- package/dist/chunks/{index-CWI00LgK.mjs → index-BpZD69GD.mjs} +2 -2
- package/dist/chunks/{index-CWI00LgK.mjs.map → index-BpZD69GD.mjs.map} +1 -1
- package/dist/chunks/{index-BSGOnYAL.mjs → index-BtdTgi0_.mjs} +1 -1
- package/dist/chunks/{index-BSGOnYAL.mjs.map → index-BtdTgi0_.mjs.map} +1 -1
- package/dist/chunks/{index-YaCKvBnb.mjs → index-Cm5-jAR7.mjs} +38 -2
- package/dist/chunks/index-Cm5-jAR7.mjs.map +1 -0
- package/dist/chunks/{index-Ch8cepWA.mjs → index-CsC-dafu.mjs} +3 -3
- package/dist/chunks/{index-Ch8cepWA.mjs.map → index-CsC-dafu.mjs.map} +1 -1
- package/dist/chunks/{index-DR3ok_zE.mjs → index-CuEeN4AG.mjs} +6 -7
- package/dist/chunks/{index-DR3ok_zE.mjs.map → index-CuEeN4AG.mjs.map} +1 -1
- package/dist/chunks/{index-CO3WOWY2.mjs → index-CvWc6WZ4.mjs} +7 -9
- package/dist/chunks/{index-CO3WOWY2.mjs.map → index-CvWc6WZ4.mjs.map} +1 -1
- package/dist/chunks/{index-CYpZ8qGv.mjs → index-DSBOi0JP.mjs} +4 -5
- package/dist/chunks/{index-CYpZ8qGv.mjs.map → index-DSBOi0JP.mjs.map} +1 -1
- package/dist/chunks/{index-F1Vay3hL.mjs → index-DWtzT31F.mjs} +2 -2
- package/dist/chunks/{index-F1Vay3hL.mjs.map → index-DWtzT31F.mjs.map} +1 -1
- package/dist/chunks/{index-DCv7HM9c.mjs → index-DaifcY5X.mjs} +7 -9
- package/dist/chunks/{index-DCv7HM9c.mjs.map → index-DaifcY5X.mjs.map} +1 -1
- package/dist/chunks/{index-BrfogwJw.mjs → index-DjoMuta5.mjs} +1 -1
- package/dist/chunks/{index-BrfogwJw.mjs.map → index-DjoMuta5.mjs.map} +1 -1
- package/dist/chunks/{index-utzX5BKz.mjs → index-Dn87UbZu.mjs} +2 -2
- package/dist/chunks/{index-utzX5BKz.mjs.map → index-Dn87UbZu.mjs.map} +1 -1
- package/dist/chunks/{index-CrXpydfv.mjs → index-G8uUqzC7.mjs} +12 -2
- package/dist/chunks/index-G8uUqzC7.mjs.map +1 -0
- package/dist/chunks/{index-D2G_PixC.mjs → index-SJQIKyxi.mjs} +1 -1
- package/dist/chunks/{index-D2G_PixC.mjs.map → index-SJQIKyxi.mjs.map} +1 -1
- package/dist/chunks/{index-Dw0VFoXM.mjs → index-fcmnzZn6.mjs} +12 -5
- package/dist/chunks/index-fcmnzZn6.mjs.map +1 -0
- package/dist/chunks/{index-cxmuS08t.mjs → index-zv8c0UAU.mjs} +3 -3
- package/dist/chunks/{index-cxmuS08t.mjs.map → index-zv8c0UAU.mjs.map} +1 -1
- package/dist/chunks/index.module-B_Z75X1e.mjs +73 -0
- package/dist/chunks/index.module-B_Z75X1e.mjs.map +1 -0
- package/dist/chunks/{input-DA9gkhwB.mjs → input-NILUGijL.mjs} +2 -2
- package/dist/chunks/{input-DA9gkhwB.mjs.map → input-NILUGijL.mjs.map} +1 -1
- package/dist/chunks/input-otp-b-7MmY2H.mjs +455 -0
- package/dist/chunks/input-otp-b-7MmY2H.mjs.map +1 -0
- package/dist/chunks/{label-BgC413_9.mjs → label-81mjh4Q4.mjs} +44 -3
- package/dist/chunks/label-81mjh4Q4.mjs.map +1 -0
- package/dist/chunks/{loader-circle-CmQoMw39.mjs → loader-circle-sGBNpyP3.mjs} +2 -2
- package/dist/chunks/{loader-circle-CmQoMw39.mjs.map → loader-circle-sGBNpyP3.mjs.map} +1 -1
- package/dist/chunks/{menubar-DU7jMSAY.mjs → menubar-Dz5biTZv.mjs} +11 -13
- package/dist/chunks/{menubar-DU7jMSAY.mjs.map → menubar-Dz5biTZv.mjs.map} +1 -1
- package/dist/chunks/{multi-select-QKfLMC0m.mjs → multi-select-DeW-tL6j.mjs} +13 -13
- package/dist/chunks/{multi-select-QKfLMC0m.mjs.map → multi-select-DeW-tL6j.mjs.map} +1 -1
- package/dist/chunks/{pagination-zyJ5vFmL.mjs → pagination-0W2Kek6Z.mjs} +6 -6
- package/dist/chunks/{pagination-zyJ5vFmL.mjs.map → pagination-0W2Kek6Z.mjs.map} +1 -1
- package/dist/chunks/{popover-RcJ808cy.mjs → popover-ChoMUAP9.mjs} +11 -13
- package/dist/chunks/{popover-RcJ808cy.mjs.map → popover-ChoMUAP9.mjs.map} +1 -1
- package/dist/chunks/progress-zrBdDKEV.mjs +223 -0
- package/dist/chunks/progress-zrBdDKEV.mjs.map +1 -0
- package/dist/chunks/radio-group-r3ejuIom.mjs +258 -0
- package/dist/chunks/radio-group-r3ejuIom.mjs.map +1 -0
- package/dist/chunks/{react-number-format.es-CyaQTuwn.mjs → react-number-format.es-rRpdCutF.mjs} +1 -1
- package/dist/chunks/{react-number-format.es-CyaQTuwn.mjs.map → react-number-format.es-rRpdCutF.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DUSbQJic.mjs → scroll-area-DjtXX0pm.mjs} +9 -11
- package/dist/chunks/{scroll-area-DUSbQJic.mjs.map → scroll-area-DjtXX0pm.mjs.map} +1 -1
- package/dist/chunks/{select-DqpIJliN.mjs → select-CICQavYx.mjs} +5 -5
- package/dist/chunks/{select-DqpIJliN.mjs.map → select-CICQavYx.mjs.map} +1 -1
- package/dist/chunks/{separator-h4204yqZ.mjs → separator-CL28DVoA.mjs} +44 -3
- package/dist/chunks/separator-CL28DVoA.mjs.map +1 -0
- package/dist/chunks/{sheet-ChrvUpAV.mjs → sheet-BIN5Bwkz.mjs} +4 -4
- package/dist/chunks/{sheet-ChrvUpAV.mjs.map → sheet-BIN5Bwkz.mjs.map} +1 -1
- package/dist/chunks/{skeleton-DYRcDQga.mjs → skeleton-DEo09dsp.mjs} +2 -2
- package/dist/chunks/{skeleton-DYRcDQga.mjs.map → skeleton-DEo09dsp.mjs.map} +1 -1
- package/dist/chunks/slider-C_afdOBq.mjs +588 -0
- package/dist/chunks/slider-C_afdOBq.mjs.map +1 -0
- package/dist/chunks/{sortable-B9EKkKQQ.mjs → sortable-Hz2p-hG_.mjs} +3 -3
- package/dist/chunks/{sortable-B9EKkKQQ.mjs.map → sortable-Hz2p-hG_.mjs.map} +1 -1
- package/dist/chunks/styles-DQr_CtBg.mjs +6 -0
- package/dist/chunks/styles-DQr_CtBg.mjs.map +1 -0
- package/dist/chunks/switch-CoxjUYji.mjs +138 -0
- package/dist/chunks/switch-CoxjUYji.mjs.map +1 -0
- package/dist/chunks/{table-Bf_4RiC6.mjs → table-CaTzvnGO.mjs} +2 -2
- package/dist/chunks/{table-Bf_4RiC6.mjs.map → table-CaTzvnGO.mjs.map} +1 -1
- package/dist/chunks/{tabs-BH56W9Uk.mjs → tabs-DbcqE74l.mjs} +9 -10
- package/dist/chunks/{tabs-BH56W9Uk.mjs.map → tabs-DbcqE74l.mjs.map} +1 -1
- package/dist/chunks/{textarea-D1VTvn_8.mjs → textarea-C99bTFre.mjs} +2 -2
- package/dist/chunks/{textarea-D1VTvn_8.mjs.map → textarea-C99bTFre.mjs.map} +1 -1
- package/dist/chunks/{toggle-DPn3fWo1.mjs → toggle-x7-6JYvP.mjs} +4 -5
- package/dist/chunks/{toggle-DPn3fWo1.mjs.map → toggle-x7-6JYvP.mjs.map} +1 -1
- package/dist/chunks/{tooltip-DL6xVJHi.mjs → tooltip-aCFcTWvT.mjs} +11 -13
- package/dist/chunks/{tooltip-DL6xVJHi.mjs.map → tooltip-aCFcTWvT.mjs.map} +1 -1
- package/dist/chunks/{trash-2-B6-kuqxf.mjs → trash-2-BRTBRPsE.mjs} +2 -2
- package/dist/chunks/{trash-2-B6-kuqxf.mjs.map → trash-2-BRTBRPsE.mjs.map} +1 -1
- package/dist/chunks/{triangle-alert-Gr8soT6b.mjs → triangle-alert-DEr_0gbo.mjs} +2 -2
- package/dist/chunks/{triangle-alert-Gr8soT6b.mjs.map → triangle-alert-DEr_0gbo.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-Bf7t9JE-.mjs → tslib.es6-9fTryOSE.mjs} +1 -1
- package/dist/chunks/{tslib.es6-Bf7t9JE-.mjs.map → tslib.es6-9fTryOSE.mjs.map} +1 -1
- package/dist/chunks/{utils-BOlqGJrg.mjs → utils-M7D-rn0u.mjs} +2 -2
- package/dist/chunks/{utils-BOlqGJrg.mjs.map → utils-M7D-rn0u.mjs.map} +1 -1
- package/dist/chunks/{wand-sparkles-BOLdCXYe.mjs → wand-sparkles-cr6EaHA_.mjs} +2 -2
- package/dist/chunks/{wand-sparkles-BOLdCXYe.mjs.map → wand-sparkles-cr6EaHA_.mjs.map} +1 -1
- package/dist/chunks/{x-DWHixXf6.mjs → x-Heb3hHKJ.mjs} +2 -2
- package/dist/chunks/{x-DWHixXf6.mjs.map → x-Heb3hHKJ.mjs.map} +1 -1
- package/dist/collapsible/index.mjs +8 -10
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.mjs +25 -27
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.mjs +19 -21
- package/dist/command/index.mjs.map +1 -1
- package/dist/context-menu/index.mjs +21 -23
- package/dist/context-menu/index.mjs.map +1 -1
- package/dist/dash/index.mjs +25 -26
- package/dist/dash/index.mjs.map +1 -1
- package/dist/data-table/index.mjs +33 -35
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/date-picker/index.mjs +26 -28
- package/dist/date-picker/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +18 -20
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/drawer/index.mjs +15 -17
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown-menu/index.mjs +21 -23
- package/dist/dropdown-menu/index.mjs.map +1 -1
- package/dist/dropzone/index.mjs +16 -18
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/editable-table/index.mjs +52 -30
- package/dist/editable-table/index.mjs.map +1 -1
- package/dist/empty/index.mjs +2 -2
- package/dist/field/index.mjs +4 -5
- package/dist/field/index.mjs.map +1 -1
- package/dist/form/index.mjs +4 -5
- package/dist/form/index.mjs.map +1 -1
- package/dist/form-fields/index.mjs +27 -29
- package/dist/form-fields/index.mjs.map +1 -1
- package/dist/form-layout/index.d.ts +85 -0
- package/dist/form-layout/index.mjs +534 -0
- package/dist/form-layout/index.mjs.map +1 -0
- package/dist/hover-card/index.mjs +14 -16
- package/dist/hover-card/index.mjs.map +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +3 -3
- package/dist/input-group/index.mjs +5 -5
- package/dist/input-otp/index.mjs +5 -455
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/item/index.mjs +3 -4
- package/dist/item/index.mjs.map +1 -1
- package/dist/ivt.css +1 -1
- package/dist/kbd/index.mjs +2 -2
- package/dist/label/index.mjs +3 -4
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.mjs +22 -24
- package/dist/layout/index.mjs.map +1 -1
- package/dist/menubar/index.mjs +22 -24
- package/dist/menubar/index.mjs.map +1 -1
- package/dist/multi-input-list/index.d.ts +0 -1
- package/dist/multi-input-list/index.mjs +31 -39
- package/dist/multi-input-list/index.mjs.map +1 -1
- package/dist/multi-select/index.mjs +32 -34
- package/dist/multi-select/index.mjs.map +1 -1
- package/dist/navigation-menu/index.mjs +15 -17
- package/dist/navigation-menu/index.mjs.map +1 -1
- package/dist/pagination/index.mjs +8 -8
- package/dist/popover/index.mjs +17 -19
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.mjs +3 -5
- package/dist/progress/index.mjs.map +1 -1
- package/dist/radio-group/index.mjs +18 -264
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/resizable/index.mjs +3 -3
- package/dist/scroll-area/index.mjs +10 -12
- package/dist/scroll-area/index.mjs.map +1 -1
- package/dist/select/index.mjs +6 -6
- package/dist/separator/index.mjs +3 -4
- package/dist/separator/index.mjs.map +1 -1
- package/dist/shared/index.mjs +5 -5
- package/dist/sheet/index.mjs +18 -20
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.mjs +26 -28
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/skeleton/index.mjs +3 -3
- package/dist/skeleton-component/index.mjs +4 -4
- package/dist/slider/index.mjs +14 -591
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sortable/index.mjs +4 -4
- package/dist/spinner/index.mjs +4 -4
- package/dist/switch/index.mjs +11 -141
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.mjs +3 -3
- package/dist/table-filter/index.mjs +53 -54
- package/dist/table-filter/index.mjs.map +1 -1
- package/dist/tabs/index.mjs +14 -16
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.mjs +3 -3
- package/dist/toast/index.mjs +13 -15
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toggle/index.mjs +6 -7
- package/dist/toggle/index.mjs.map +1 -1
- package/dist/toggle-group/index.mjs +11 -13
- package/dist/toggle-group/index.mjs.map +1 -1
- package/dist/tooltip/index.mjs +16 -18
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +475 -470
- package/dist/chunks/_commonjsHelpers-D3vrMN3C.mjs.map +0 -1
- package/dist/chunks/bundle-mjs-Lvc-Dri9.mjs.map +0 -1
- package/dist/chunks/calendar-BTfcQ69r.mjs.map +0 -1
- package/dist/chunks/form-CChLO9RR.mjs.map +0 -1
- package/dist/chunks/format-numbers-BhgU0ZHz.mjs.map +0 -1
- package/dist/chunks/index-BeWMIyGj.mjs +0 -12
- package/dist/chunks/index-BeWMIyGj.mjs.map +0 -1
- package/dist/chunks/index-CrXpydfv.mjs.map +0 -1
- package/dist/chunks/index-D5BJ_0bf.mjs +0 -40
- package/dist/chunks/index-D5BJ_0bf.mjs.map +0 -1
- package/dist/chunks/index-Dw0VFoXM.mjs.map +0 -1
- package/dist/chunks/index-YaCKvBnb.mjs.map +0 -1
- package/dist/chunks/index.module-DOV7zOvH.mjs +0 -68
- package/dist/chunks/index.module-DOV7zOvH.mjs.map +0 -1
- package/dist/chunks/label-BgC413_9.mjs.map +0 -1
- package/dist/chunks/progress-BcHalZVV.mjs +0 -99
- package/dist/chunks/progress-BcHalZVV.mjs.map +0 -1
- package/dist/chunks/separator-h4204yqZ.mjs.map +0 -1
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { c as clamp } from './index-B8zlei3I.mjs';
|
|
3
|
+
import { c as composeEventHandlers, P as Primitive } from './index-G8uUqzC7.mjs';
|
|
4
|
+
import { c as createContextScope, u as useComposedRefs } from './index-Cm5-jAR7.mjs';
|
|
5
|
+
import { u as useControllableState } from './index-BpZD69GD.mjs';
|
|
6
|
+
import { u as useDirection } from './index-B49Rv10M.mjs';
|
|
7
|
+
import { u as usePrevious } from './index-SJQIKyxi.mjs';
|
|
8
|
+
import { u as useSize } from './index-DWtzT31F.mjs';
|
|
9
|
+
import { createCollection } from '@radix-ui/react-collection';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
import { c as cn } from './utils-M7D-rn0u.mjs';
|
|
12
|
+
|
|
13
|
+
var PAGE_KEYS = [
|
|
14
|
+
"PageUp",
|
|
15
|
+
"PageDown"
|
|
16
|
+
];
|
|
17
|
+
var ARROW_KEYS = [
|
|
18
|
+
"ArrowUp",
|
|
19
|
+
"ArrowDown",
|
|
20
|
+
"ArrowLeft",
|
|
21
|
+
"ArrowRight"
|
|
22
|
+
];
|
|
23
|
+
var BACK_KEYS = {
|
|
24
|
+
"from-left": [
|
|
25
|
+
"Home",
|
|
26
|
+
"PageDown",
|
|
27
|
+
"ArrowDown",
|
|
28
|
+
"ArrowLeft"
|
|
29
|
+
],
|
|
30
|
+
"from-right": [
|
|
31
|
+
"Home",
|
|
32
|
+
"PageDown",
|
|
33
|
+
"ArrowDown",
|
|
34
|
+
"ArrowRight"
|
|
35
|
+
],
|
|
36
|
+
"from-bottom": [
|
|
37
|
+
"Home",
|
|
38
|
+
"PageDown",
|
|
39
|
+
"ArrowDown",
|
|
40
|
+
"ArrowLeft"
|
|
41
|
+
],
|
|
42
|
+
"from-top": [
|
|
43
|
+
"Home",
|
|
44
|
+
"PageDown",
|
|
45
|
+
"ArrowUp",
|
|
46
|
+
"ArrowLeft"
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
var SLIDER_NAME = "Slider";
|
|
50
|
+
var [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);
|
|
51
|
+
var [createSliderContext] = createContextScope(SLIDER_NAME, [
|
|
52
|
+
createCollectionScope
|
|
53
|
+
]);
|
|
54
|
+
var [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);
|
|
55
|
+
var Slider$1 = React.forwardRef((props, forwardedRef)=>{
|
|
56
|
+
const { name, min = 0, max = 100, step = 1, orientation = "horizontal", disabled = false, minStepsBetweenThumbs = 0, defaultValue = [
|
|
57
|
+
min
|
|
58
|
+
], value, onValueChange = ()=>{}, onValueCommit = ()=>{}, inverted = false, form, ...sliderProps } = props;
|
|
59
|
+
const thumbRefs = React.useRef(/* @__PURE__ */ new Set());
|
|
60
|
+
const valueIndexToChangeRef = React.useRef(0);
|
|
61
|
+
const isHorizontal = orientation === "horizontal";
|
|
62
|
+
const SliderOrientation = isHorizontal ? SliderHorizontal : SliderVertical;
|
|
63
|
+
const [values = [], setValues] = useControllableState({
|
|
64
|
+
prop: value,
|
|
65
|
+
defaultProp: defaultValue,
|
|
66
|
+
onChange: (value2)=>{
|
|
67
|
+
const thumbs = [
|
|
68
|
+
...thumbRefs.current
|
|
69
|
+
];
|
|
70
|
+
thumbs[valueIndexToChangeRef.current]?.focus();
|
|
71
|
+
onValueChange(value2);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const valuesBeforeSlideStartRef = React.useRef(values);
|
|
75
|
+
function handleSlideStart(value2) {
|
|
76
|
+
const closestIndex = getClosestValueIndex(values, value2);
|
|
77
|
+
updateValues(value2, closestIndex);
|
|
78
|
+
}
|
|
79
|
+
function handleSlideMove(value2) {
|
|
80
|
+
updateValues(value2, valueIndexToChangeRef.current);
|
|
81
|
+
}
|
|
82
|
+
function handleSlideEnd() {
|
|
83
|
+
const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];
|
|
84
|
+
const nextValue = values[valueIndexToChangeRef.current];
|
|
85
|
+
const hasChanged = nextValue !== prevValue;
|
|
86
|
+
if (hasChanged) onValueCommit(values);
|
|
87
|
+
}
|
|
88
|
+
function updateValues(value2, atIndex, { commit } = {
|
|
89
|
+
commit: false
|
|
90
|
+
}) {
|
|
91
|
+
const decimalCount = getDecimalCount(step);
|
|
92
|
+
const snapToStep = roundValue(Math.round((value2 - min) / step) * step + min, decimalCount);
|
|
93
|
+
const nextValue = clamp(snapToStep, [
|
|
94
|
+
min,
|
|
95
|
+
max
|
|
96
|
+
]);
|
|
97
|
+
setValues((prevValues = [])=>{
|
|
98
|
+
const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);
|
|
99
|
+
if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {
|
|
100
|
+
valueIndexToChangeRef.current = nextValues.indexOf(nextValue);
|
|
101
|
+
const hasChanged = String(nextValues) !== String(prevValues);
|
|
102
|
+
if (hasChanged && commit) onValueCommit(nextValues);
|
|
103
|
+
return hasChanged ? nextValues : prevValues;
|
|
104
|
+
} else {
|
|
105
|
+
return prevValues;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ jsx(SliderProvider, {
|
|
110
|
+
scope: props.__scopeSlider,
|
|
111
|
+
name,
|
|
112
|
+
disabled,
|
|
113
|
+
min,
|
|
114
|
+
max,
|
|
115
|
+
valueIndexToChangeRef,
|
|
116
|
+
thumbs: thumbRefs.current,
|
|
117
|
+
values,
|
|
118
|
+
orientation,
|
|
119
|
+
form,
|
|
120
|
+
children: /* @__PURE__ */ jsx(Collection.Provider, {
|
|
121
|
+
scope: props.__scopeSlider,
|
|
122
|
+
children: /* @__PURE__ */ jsx(Collection.Slot, {
|
|
123
|
+
scope: props.__scopeSlider,
|
|
124
|
+
children: /* @__PURE__ */ jsx(SliderOrientation, {
|
|
125
|
+
"aria-disabled": disabled,
|
|
126
|
+
"data-disabled": disabled ? "" : void 0,
|
|
127
|
+
...sliderProps,
|
|
128
|
+
ref: forwardedRef,
|
|
129
|
+
onPointerDown: composeEventHandlers(sliderProps.onPointerDown, ()=>{
|
|
130
|
+
if (!disabled) valuesBeforeSlideStartRef.current = values;
|
|
131
|
+
}),
|
|
132
|
+
min,
|
|
133
|
+
max,
|
|
134
|
+
inverted,
|
|
135
|
+
onSlideStart: disabled ? void 0 : handleSlideStart,
|
|
136
|
+
onSlideMove: disabled ? void 0 : handleSlideMove,
|
|
137
|
+
onSlideEnd: disabled ? void 0 : handleSlideEnd,
|
|
138
|
+
onHomeKeyDown: ()=>!disabled && updateValues(min, 0, {
|
|
139
|
+
commit: true
|
|
140
|
+
}),
|
|
141
|
+
onEndKeyDown: ()=>!disabled && updateValues(max, values.length - 1, {
|
|
142
|
+
commit: true
|
|
143
|
+
}),
|
|
144
|
+
onStepKeyDown: ({ event, direction: stepDirection })=>{
|
|
145
|
+
if (!disabled) {
|
|
146
|
+
const isPageKey = PAGE_KEYS.includes(event.key);
|
|
147
|
+
const isSkipKey = isPageKey || event.shiftKey && ARROW_KEYS.includes(event.key);
|
|
148
|
+
const multiplier = isSkipKey ? 10 : 1;
|
|
149
|
+
const atIndex = valueIndexToChangeRef.current;
|
|
150
|
+
const value2 = values[atIndex];
|
|
151
|
+
const stepInDirection = step * multiplier * stepDirection;
|
|
152
|
+
updateValues(value2 + stepInDirection, atIndex, {
|
|
153
|
+
commit: true
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
Slider$1.displayName = SLIDER_NAME;
|
|
163
|
+
var [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext(SLIDER_NAME, {
|
|
164
|
+
startEdge: "left",
|
|
165
|
+
endEdge: "right",
|
|
166
|
+
size: "width",
|
|
167
|
+
direction: 1
|
|
168
|
+
});
|
|
169
|
+
var SliderHorizontal = React.forwardRef((props, forwardedRef)=>{
|
|
170
|
+
const { min, max, dir, inverted, onSlideStart, onSlideMove, onSlideEnd, onStepKeyDown, ...sliderProps } = props;
|
|
171
|
+
const [slider, setSlider] = React.useState(null);
|
|
172
|
+
const composedRefs = useComposedRefs(forwardedRef, (node)=>setSlider(node));
|
|
173
|
+
const rectRef = React.useRef(void 0);
|
|
174
|
+
const direction = useDirection(dir);
|
|
175
|
+
const isDirectionLTR = direction === "ltr";
|
|
176
|
+
const isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;
|
|
177
|
+
function getValueFromPointer(pointerPosition) {
|
|
178
|
+
const rect = rectRef.current || slider.getBoundingClientRect();
|
|
179
|
+
const input = [
|
|
180
|
+
0,
|
|
181
|
+
rect.width
|
|
182
|
+
];
|
|
183
|
+
const output = isSlidingFromLeft ? [
|
|
184
|
+
min,
|
|
185
|
+
max
|
|
186
|
+
] : [
|
|
187
|
+
max,
|
|
188
|
+
min
|
|
189
|
+
];
|
|
190
|
+
const value = linearScale(input, output);
|
|
191
|
+
rectRef.current = rect;
|
|
192
|
+
return value(pointerPosition - rect.left);
|
|
193
|
+
}
|
|
194
|
+
return /* @__PURE__ */ jsx(SliderOrientationProvider, {
|
|
195
|
+
scope: props.__scopeSlider,
|
|
196
|
+
startEdge: isSlidingFromLeft ? "left" : "right",
|
|
197
|
+
endEdge: isSlidingFromLeft ? "right" : "left",
|
|
198
|
+
direction: isSlidingFromLeft ? 1 : -1,
|
|
199
|
+
size: "width",
|
|
200
|
+
children: /* @__PURE__ */ jsx(SliderImpl, {
|
|
201
|
+
dir: direction,
|
|
202
|
+
"data-orientation": "horizontal",
|
|
203
|
+
...sliderProps,
|
|
204
|
+
ref: composedRefs,
|
|
205
|
+
style: {
|
|
206
|
+
...sliderProps.style,
|
|
207
|
+
["--radix-slider-thumb-transform"]: "translateX(-50%)"
|
|
208
|
+
},
|
|
209
|
+
onSlideStart: (event)=>{
|
|
210
|
+
const value = getValueFromPointer(event.clientX);
|
|
211
|
+
onSlideStart?.(value);
|
|
212
|
+
},
|
|
213
|
+
onSlideMove: (event)=>{
|
|
214
|
+
const value = getValueFromPointer(event.clientX);
|
|
215
|
+
onSlideMove?.(value);
|
|
216
|
+
},
|
|
217
|
+
onSlideEnd: ()=>{
|
|
218
|
+
rectRef.current = void 0;
|
|
219
|
+
onSlideEnd?.();
|
|
220
|
+
},
|
|
221
|
+
onStepKeyDown: (event)=>{
|
|
222
|
+
const slideDirection = isSlidingFromLeft ? "from-left" : "from-right";
|
|
223
|
+
const isBackKey = BACK_KEYS[slideDirection].includes(event.key);
|
|
224
|
+
onStepKeyDown?.({
|
|
225
|
+
event,
|
|
226
|
+
direction: isBackKey ? -1 : 1
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
var SliderVertical = React.forwardRef((props, forwardedRef)=>{
|
|
233
|
+
const { min, max, inverted, onSlideStart, onSlideMove, onSlideEnd, onStepKeyDown, ...sliderProps } = props;
|
|
234
|
+
const sliderRef = React.useRef(null);
|
|
235
|
+
const ref = useComposedRefs(forwardedRef, sliderRef);
|
|
236
|
+
const rectRef = React.useRef(void 0);
|
|
237
|
+
const isSlidingFromBottom = !inverted;
|
|
238
|
+
function getValueFromPointer(pointerPosition) {
|
|
239
|
+
const rect = rectRef.current || sliderRef.current.getBoundingClientRect();
|
|
240
|
+
const input = [
|
|
241
|
+
0,
|
|
242
|
+
rect.height
|
|
243
|
+
];
|
|
244
|
+
const output = isSlidingFromBottom ? [
|
|
245
|
+
max,
|
|
246
|
+
min
|
|
247
|
+
] : [
|
|
248
|
+
min,
|
|
249
|
+
max
|
|
250
|
+
];
|
|
251
|
+
const value = linearScale(input, output);
|
|
252
|
+
rectRef.current = rect;
|
|
253
|
+
return value(pointerPosition - rect.top);
|
|
254
|
+
}
|
|
255
|
+
return /* @__PURE__ */ jsx(SliderOrientationProvider, {
|
|
256
|
+
scope: props.__scopeSlider,
|
|
257
|
+
startEdge: isSlidingFromBottom ? "bottom" : "top",
|
|
258
|
+
endEdge: isSlidingFromBottom ? "top" : "bottom",
|
|
259
|
+
size: "height",
|
|
260
|
+
direction: isSlidingFromBottom ? 1 : -1,
|
|
261
|
+
children: /* @__PURE__ */ jsx(SliderImpl, {
|
|
262
|
+
"data-orientation": "vertical",
|
|
263
|
+
...sliderProps,
|
|
264
|
+
ref,
|
|
265
|
+
style: {
|
|
266
|
+
...sliderProps.style,
|
|
267
|
+
["--radix-slider-thumb-transform"]: "translateY(50%)"
|
|
268
|
+
},
|
|
269
|
+
onSlideStart: (event)=>{
|
|
270
|
+
const value = getValueFromPointer(event.clientY);
|
|
271
|
+
onSlideStart?.(value);
|
|
272
|
+
},
|
|
273
|
+
onSlideMove: (event)=>{
|
|
274
|
+
const value = getValueFromPointer(event.clientY);
|
|
275
|
+
onSlideMove?.(value);
|
|
276
|
+
},
|
|
277
|
+
onSlideEnd: ()=>{
|
|
278
|
+
rectRef.current = void 0;
|
|
279
|
+
onSlideEnd?.();
|
|
280
|
+
},
|
|
281
|
+
onStepKeyDown: (event)=>{
|
|
282
|
+
const slideDirection = isSlidingFromBottom ? "from-bottom" : "from-top";
|
|
283
|
+
const isBackKey = BACK_KEYS[slideDirection].includes(event.key);
|
|
284
|
+
onStepKeyDown?.({
|
|
285
|
+
event,
|
|
286
|
+
direction: isBackKey ? -1 : 1
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
var SliderImpl = React.forwardRef((props, forwardedRef)=>{
|
|
293
|
+
const { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props;
|
|
294
|
+
const context = useSliderContext(SLIDER_NAME, __scopeSlider);
|
|
295
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
296
|
+
...sliderProps,
|
|
297
|
+
ref: forwardedRef,
|
|
298
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event)=>{
|
|
299
|
+
if (event.key === "Home") {
|
|
300
|
+
onHomeKeyDown(event);
|
|
301
|
+
event.preventDefault();
|
|
302
|
+
} else if (event.key === "End") {
|
|
303
|
+
onEndKeyDown(event);
|
|
304
|
+
event.preventDefault();
|
|
305
|
+
} else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {
|
|
306
|
+
onStepKeyDown(event);
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
}
|
|
309
|
+
}),
|
|
310
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event)=>{
|
|
311
|
+
const target = event.target;
|
|
312
|
+
target.setPointerCapture(event.pointerId);
|
|
313
|
+
event.preventDefault();
|
|
314
|
+
if (context.thumbs.has(target)) {
|
|
315
|
+
target.focus();
|
|
316
|
+
} else {
|
|
317
|
+
onSlideStart(event);
|
|
318
|
+
}
|
|
319
|
+
}),
|
|
320
|
+
onPointerMove: composeEventHandlers(props.onPointerMove, (event)=>{
|
|
321
|
+
const target = event.target;
|
|
322
|
+
if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);
|
|
323
|
+
}),
|
|
324
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, (event)=>{
|
|
325
|
+
const target = event.target;
|
|
326
|
+
if (target.hasPointerCapture(event.pointerId)) {
|
|
327
|
+
target.releasePointerCapture(event.pointerId);
|
|
328
|
+
onSlideEnd(event);
|
|
329
|
+
}
|
|
330
|
+
})
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
var TRACK_NAME = "SliderTrack";
|
|
334
|
+
var SliderTrack = React.forwardRef((props, forwardedRef)=>{
|
|
335
|
+
const { __scopeSlider, ...trackProps } = props;
|
|
336
|
+
const context = useSliderContext(TRACK_NAME, __scopeSlider);
|
|
337
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
338
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
339
|
+
"data-orientation": context.orientation,
|
|
340
|
+
...trackProps,
|
|
341
|
+
ref: forwardedRef
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
SliderTrack.displayName = TRACK_NAME;
|
|
345
|
+
var RANGE_NAME = "SliderRange";
|
|
346
|
+
var SliderRange = React.forwardRef((props, forwardedRef)=>{
|
|
347
|
+
const { __scopeSlider, ...rangeProps } = props;
|
|
348
|
+
const context = useSliderContext(RANGE_NAME, __scopeSlider);
|
|
349
|
+
const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);
|
|
350
|
+
const ref = React.useRef(null);
|
|
351
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
352
|
+
const valuesCount = context.values.length;
|
|
353
|
+
const percentages = context.values.map((value)=>convertValueToPercentage(value, context.min, context.max));
|
|
354
|
+
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
|
355
|
+
const offsetEnd = 100 - Math.max(...percentages);
|
|
356
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
357
|
+
"data-orientation": context.orientation,
|
|
358
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
359
|
+
...rangeProps,
|
|
360
|
+
ref: composedRefs,
|
|
361
|
+
style: {
|
|
362
|
+
...props.style,
|
|
363
|
+
[orientation.startEdge]: offsetStart + "%",
|
|
364
|
+
[orientation.endEdge]: offsetEnd + "%"
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
SliderRange.displayName = RANGE_NAME;
|
|
369
|
+
var THUMB_NAME = "SliderThumb";
|
|
370
|
+
var SliderThumb = React.forwardRef((props, forwardedRef)=>{
|
|
371
|
+
const getItems = useCollection(props.__scopeSlider);
|
|
372
|
+
const [thumb, setThumb] = React.useState(null);
|
|
373
|
+
const composedRefs = useComposedRefs(forwardedRef, (node)=>setThumb(node));
|
|
374
|
+
const index = React.useMemo(()=>thumb ? getItems().findIndex((item)=>item.ref.current === thumb) : -1, [
|
|
375
|
+
getItems,
|
|
376
|
+
thumb
|
|
377
|
+
]);
|
|
378
|
+
return /* @__PURE__ */ jsx(SliderThumbImpl, {
|
|
379
|
+
...props,
|
|
380
|
+
ref: composedRefs,
|
|
381
|
+
index
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
var SliderThumbImpl = React.forwardRef((props, forwardedRef)=>{
|
|
385
|
+
const { __scopeSlider, index, name, ...thumbProps } = props;
|
|
386
|
+
const context = useSliderContext(THUMB_NAME, __scopeSlider);
|
|
387
|
+
const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);
|
|
388
|
+
const [thumb, setThumb] = React.useState(null);
|
|
389
|
+
const composedRefs = useComposedRefs(forwardedRef, (node)=>setThumb(node));
|
|
390
|
+
const isFormControl = thumb ? context.form || !!thumb.closest("form") : true;
|
|
391
|
+
const size = useSize(thumb);
|
|
392
|
+
const value = context.values[index];
|
|
393
|
+
const percent = value === void 0 ? 0 : convertValueToPercentage(value, context.min, context.max);
|
|
394
|
+
const label = getLabel(index, context.values.length);
|
|
395
|
+
const orientationSize = size?.[orientation.size];
|
|
396
|
+
const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
|
|
397
|
+
React.useEffect(()=>{
|
|
398
|
+
if (thumb) {
|
|
399
|
+
context.thumbs.add(thumb);
|
|
400
|
+
return ()=>{
|
|
401
|
+
context.thumbs.delete(thumb);
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
}, [
|
|
405
|
+
thumb,
|
|
406
|
+
context.thumbs
|
|
407
|
+
]);
|
|
408
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
409
|
+
style: {
|
|
410
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
411
|
+
position: "absolute",
|
|
412
|
+
[orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`
|
|
413
|
+
},
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsx(Collection.ItemSlot, {
|
|
416
|
+
scope: props.__scopeSlider,
|
|
417
|
+
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
418
|
+
role: "slider",
|
|
419
|
+
"aria-label": props["aria-label"] || label,
|
|
420
|
+
"aria-valuemin": context.min,
|
|
421
|
+
"aria-valuenow": value,
|
|
422
|
+
"aria-valuemax": context.max,
|
|
423
|
+
"aria-orientation": context.orientation,
|
|
424
|
+
"data-orientation": context.orientation,
|
|
425
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
426
|
+
tabIndex: context.disabled ? void 0 : 0,
|
|
427
|
+
...thumbProps,
|
|
428
|
+
ref: composedRefs,
|
|
429
|
+
style: value === void 0 ? {
|
|
430
|
+
display: "none"
|
|
431
|
+
} : props.style,
|
|
432
|
+
onFocus: composeEventHandlers(props.onFocus, ()=>{
|
|
433
|
+
context.valueIndexToChangeRef.current = index;
|
|
434
|
+
})
|
|
435
|
+
})
|
|
436
|
+
}),
|
|
437
|
+
isFormControl && /* @__PURE__ */ jsx(SliderBubbleInput, {
|
|
438
|
+
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
439
|
+
form: context.form,
|
|
440
|
+
value
|
|
441
|
+
}, index)
|
|
442
|
+
]
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
SliderThumb.displayName = THUMB_NAME;
|
|
446
|
+
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
|
447
|
+
var SliderBubbleInput = React.forwardRef(({ __scopeSlider, value, ...props }, forwardedRef)=>{
|
|
448
|
+
const ref = React.useRef(null);
|
|
449
|
+
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
450
|
+
const prevValue = usePrevious(value);
|
|
451
|
+
React.useEffect(()=>{
|
|
452
|
+
const input = ref.current;
|
|
453
|
+
if (!input) return;
|
|
454
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
455
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
|
|
456
|
+
const setValue = descriptor.set;
|
|
457
|
+
if (prevValue !== value && setValue) {
|
|
458
|
+
const event = new Event("input", {
|
|
459
|
+
bubbles: true
|
|
460
|
+
});
|
|
461
|
+
setValue.call(input, value);
|
|
462
|
+
input.dispatchEvent(event);
|
|
463
|
+
}
|
|
464
|
+
}, [
|
|
465
|
+
prevValue,
|
|
466
|
+
value
|
|
467
|
+
]);
|
|
468
|
+
return /* @__PURE__ */ jsx(Primitive.input, {
|
|
469
|
+
style: {
|
|
470
|
+
display: "none"
|
|
471
|
+
},
|
|
472
|
+
...props,
|
|
473
|
+
ref: composedRefs,
|
|
474
|
+
defaultValue: value
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
478
|
+
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
479
|
+
const nextValues = [
|
|
480
|
+
...prevValues
|
|
481
|
+
];
|
|
482
|
+
nextValues[atIndex] = nextValue;
|
|
483
|
+
return nextValues.sort((a, b)=>a - b);
|
|
484
|
+
}
|
|
485
|
+
function convertValueToPercentage(value, min, max) {
|
|
486
|
+
const maxSteps = max - min;
|
|
487
|
+
const percentPerStep = 100 / maxSteps;
|
|
488
|
+
const percentage = percentPerStep * (value - min);
|
|
489
|
+
return clamp(percentage, [
|
|
490
|
+
0,
|
|
491
|
+
100
|
|
492
|
+
]);
|
|
493
|
+
}
|
|
494
|
+
function getLabel(index, totalValues) {
|
|
495
|
+
if (totalValues > 2) {
|
|
496
|
+
return `Value ${index + 1} of ${totalValues}`;
|
|
497
|
+
} else if (totalValues === 2) {
|
|
498
|
+
return [
|
|
499
|
+
"Minimum",
|
|
500
|
+
"Maximum"
|
|
501
|
+
][index];
|
|
502
|
+
} else {
|
|
503
|
+
return void 0;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function getClosestValueIndex(values, nextValue) {
|
|
507
|
+
if (values.length === 1) return 0;
|
|
508
|
+
const distances = values.map((value)=>Math.abs(value - nextValue));
|
|
509
|
+
const closestDistance = Math.min(...distances);
|
|
510
|
+
return distances.indexOf(closestDistance);
|
|
511
|
+
}
|
|
512
|
+
function getThumbInBoundsOffset(width, left, direction) {
|
|
513
|
+
const halfWidth = width / 2;
|
|
514
|
+
const halfPercent = 50;
|
|
515
|
+
const offset = linearScale([
|
|
516
|
+
0,
|
|
517
|
+
halfPercent
|
|
518
|
+
], [
|
|
519
|
+
0,
|
|
520
|
+
halfWidth
|
|
521
|
+
]);
|
|
522
|
+
return (halfWidth - offset(left) * direction) * direction;
|
|
523
|
+
}
|
|
524
|
+
function getStepsBetweenValues(values) {
|
|
525
|
+
return values.slice(0, -1).map((value, index)=>values[index + 1] - value);
|
|
526
|
+
}
|
|
527
|
+
function hasMinStepsBetweenValues(values, minStepsBetweenValues) {
|
|
528
|
+
if (minStepsBetweenValues > 0) {
|
|
529
|
+
const stepsBetweenValues = getStepsBetweenValues(values);
|
|
530
|
+
const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues);
|
|
531
|
+
return actualMinStepsBetweenValues >= minStepsBetweenValues;
|
|
532
|
+
}
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
function linearScale(input, output) {
|
|
536
|
+
return (value)=>{
|
|
537
|
+
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
538
|
+
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
539
|
+
return output[0] + ratio * (value - input[0]);
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
function getDecimalCount(value) {
|
|
543
|
+
return (String(value).split(".")[1] || "").length;
|
|
544
|
+
}
|
|
545
|
+
function roundValue(value, decimalCount) {
|
|
546
|
+
const rounder = Math.pow(10, decimalCount);
|
|
547
|
+
return Math.round(value * rounder) / rounder;
|
|
548
|
+
}
|
|
549
|
+
var Root = Slider$1;
|
|
550
|
+
var Track = SliderTrack;
|
|
551
|
+
var Range = SliderRange;
|
|
552
|
+
var Thumb = SliderThumb;
|
|
553
|
+
|
|
554
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
555
|
+
const _values = React.useMemo(()=>Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [
|
|
556
|
+
min,
|
|
557
|
+
max
|
|
558
|
+
], [
|
|
559
|
+
value,
|
|
560
|
+
defaultValue,
|
|
561
|
+
min,
|
|
562
|
+
max
|
|
563
|
+
]);
|
|
564
|
+
return /*#__PURE__*/ React.createElement(Root, {
|
|
565
|
+
"data-slot": "slider",
|
|
566
|
+
defaultValue: defaultValue,
|
|
567
|
+
value: value,
|
|
568
|
+
min: min,
|
|
569
|
+
max: max,
|
|
570
|
+
className: cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className),
|
|
571
|
+
...props
|
|
572
|
+
}, /*#__PURE__*/ React.createElement(Track, {
|
|
573
|
+
"data-slot": "slider-track",
|
|
574
|
+
className: cn("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5")
|
|
575
|
+
}, /*#__PURE__*/ React.createElement(Range, {
|
|
576
|
+
"data-slot": "slider-range",
|
|
577
|
+
className: cn("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")
|
|
578
|
+
})), Array.from({
|
|
579
|
+
length: _values.length
|
|
580
|
+
}, (_, index)=>/*#__PURE__*/ React.createElement(Thumb, {
|
|
581
|
+
"data-slot": "slider-thumb",
|
|
582
|
+
key: index,
|
|
583
|
+
className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
584
|
+
})));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export { Slider as S };
|
|
588
|
+
//# sourceMappingURL=slider-C_afdOBq.mjs.map
|