@gemologic/sheen 0.1.0-rc.0 → 0.1.0-rc.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/README.md +11 -1
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/dist/primitives/Accordion.js +1 -1
- package/dist/primitives/Collapsible.js +1 -1
- package/dist/primitives/Combobox.js +1 -1
- package/dist/primitives/CommandPalette.js +2 -2
- package/dist/primitives/ContextMenu.js +2 -2
- package/dist/primitives/Dialog.js +1 -1
- package/dist/primitives/DropdownMenu.js +2 -2
- package/dist/primitives/LinkTooltip.js +1 -1
- package/dist/primitives/Popover.js +1 -1
- package/dist/primitives/Select.js +1 -1
- package/dist/primitives/Tabs.js +1 -1
- package/dist/primitives/Tooltip.js +1 -1
- package/dist/primitives/tooltip-layer.js +1 -1
- package/dist/theme/ThemeProvider.js +30 -30
- package/dist/theme/intl.js +4 -4
- package/dist/utils/polymorphic.d.ts +1 -1
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +54 -0
- package/package.json +71 -5
- package/src/primitives/Accordion.tsx +1 -1
- package/src/primitives/Collapsible.tsx +1 -1
- package/src/primitives/Combobox.tsx +1 -1
- package/src/primitives/CommandPalette.tsx +2 -2
- package/src/primitives/ContextMenu.tsx +2 -2
- package/src/primitives/Dialog.tsx +1 -1
- package/src/primitives/DropdownMenu.tsx +2 -2
- package/src/primitives/LinkTooltip.tsx +1 -1
- package/src/primitives/Popover.tsx +1 -1
- package/src/primitives/Select.tsx +1 -1
- package/src/primitives/Tabs.tsx +1 -1
- package/src/primitives/Tooltip.tsx +1 -1
- package/src/primitives/tooltip-layer.tsx +1 -1
- package/src/theme/ThemeProvider.tsx +7 -3
- package/src/theme/intl.ts +4 -2
- package/src/utils/polymorphic.ts +1 -1
- package/src/vite.ts +51 -0
- package/vendor/cmdk-solid/LICENSE +14 -0
- package/vendor/cmdk-solid/chunk/5WIGIOAJ.jsx +98 -0
- package/vendor/cmdk-solid/chunk/IOVUHIGA.js +96 -0
- package/vendor/cmdk-solid/command-score.cjs +98 -0
- package/vendor/cmdk-solid/command-score.d.cts +4 -0
- package/vendor/cmdk-solid/command-score.d.ts +4 -0
- package/vendor/cmdk-solid/command-score.js +2 -0
- package/vendor/cmdk-solid/command-score.jsx +7 -0
- package/vendor/cmdk-solid/index.cjs +827 -0
- package/vendor/cmdk-solid/index.d.cts +184 -0
- package/vendor/cmdk-solid/index.d.ts +184 -0
- package/vendor/cmdk-solid/index.js +729 -0
- package/vendor/cmdk-solid/index.jsx +666 -0
- package/vendor/integrity.json +450 -0
- package/vendor/kobalte-core/LICENSE.md +21 -0
- package/vendor/kobalte-core/NOTICE.txt +231 -0
- package/vendor/kobalte-core/accordion/index.d.ts +10 -0
- package/vendor/kobalte-core/accordion/index.js +2 -0
- package/vendor/kobalte-core/accordion/index.jsx +33 -0
- package/vendor/kobalte-core/alert/index.d.ts +5 -0
- package/vendor/kobalte-core/alert/index.js +2 -0
- package/vendor/kobalte-core/alert/index.jsx +11 -0
- package/vendor/kobalte-core/alert-dialog/index.d.ts +10 -0
- package/vendor/kobalte-core/alert-dialog/index.js +3 -0
- package/vendor/kobalte-core/alert-dialog/index.jsx +40 -0
- package/vendor/kobalte-core/badge/index.d.ts +23 -0
- package/vendor/kobalte-core/badge/index.js +24 -0
- package/vendor/kobalte-core/badge/index.jsx +24 -0
- package/vendor/kobalte-core/breadcrumbs/index.d.ts +5 -0
- package/vendor/kobalte-core/breadcrumbs/index.js +2 -0
- package/vendor/kobalte-core/breadcrumbs/index.jsx +19 -0
- package/vendor/kobalte-core/button/index.d.ts +6 -0
- package/vendor/kobalte-core/button/index.js +2 -0
- package/vendor/kobalte-core/button/index.jsx +12 -0
- package/vendor/kobalte-core/button-root-da654b3e.d.ts +28 -0
- package/vendor/kobalte-core/checkbox/index.d.ts +8 -0
- package/vendor/kobalte-core/checkbox/index.js +2 -0
- package/vendor/kobalte-core/checkbox/index.jsx +35 -0
- package/vendor/kobalte-core/chunk/272QBW42.js +712 -0
- package/vendor/kobalte-core/chunk/27MLNS66.js +353 -0
- package/vendor/kobalte-core/chunk/2RVGL3MU.js +45 -0
- package/vendor/kobalte-core/chunk/2UV3VFID.jsx +431 -0
- package/vendor/kobalte-core/chunk/2X5XWQIS.js +19 -0
- package/vendor/kobalte-core/chunk/2YCOH52P.js +81 -0
- package/vendor/kobalte-core/chunk/3565MS4H.jsx +127 -0
- package/vendor/kobalte-core/chunk/3ARTUDH2.jsx +1633 -0
- package/vendor/kobalte-core/chunk/3D6FM2PJ.js +1001 -0
- package/vendor/kobalte-core/chunk/3DLZMX4Z.jsx +81 -0
- package/vendor/kobalte-core/chunk/3DZKSKAQ.jsx +366 -0
- package/vendor/kobalte-core/chunk/3JA5IX2L.jsx +52 -0
- package/vendor/kobalte-core/chunk/3NGA46QE.js +116 -0
- package/vendor/kobalte-core/chunk/3QQCO6IA.js +46 -0
- package/vendor/kobalte-core/chunk/3T74IGH6.js +860 -0
- package/vendor/kobalte-core/chunk/3XNSRO2W.jsx +226 -0
- package/vendor/kobalte-core/chunk/43XIKO67.js +99 -0
- package/vendor/kobalte-core/chunk/4VWIKJ7Q.jsx +842 -0
- package/vendor/kobalte-core/chunk/53Y5XP3B.js +61 -0
- package/vendor/kobalte-core/chunk/5WXHJDCZ.jsx +10 -0
- package/vendor/kobalte-core/chunk/5ZKAE4VZ.js +8 -0
- package/vendor/kobalte-core/chunk/66KLKSW3.js +36 -0
- package/vendor/kobalte-core/chunk/6TDKM7BK.jsx +815 -0
- package/vendor/kobalte-core/chunk/6Y7B2NEO.js +21 -0
- package/vendor/kobalte-core/chunk/7ABWW5DT.jsx +483 -0
- package/vendor/kobalte-core/chunk/7CVNMTYF.js +171 -0
- package/vendor/kobalte-core/chunk/7DPKSDZL.js +447 -0
- package/vendor/kobalte-core/chunk/7I44E2QD.js +190 -0
- package/vendor/kobalte-core/chunk/7LCANGHD.js +29 -0
- package/vendor/kobalte-core/chunk/7OVKXYPU.js +90 -0
- package/vendor/kobalte-core/chunk/7TPOQ36Z.js +202 -0
- package/vendor/kobalte-core/chunk/7ZHN3PYD.js +30 -0
- package/vendor/kobalte-core/chunk/ANN3A2QM.js +29 -0
- package/vendor/kobalte-core/chunk/AT6SKIG6.js +119 -0
- package/vendor/kobalte-core/chunk/AWVDBFMO.jsx +280 -0
- package/vendor/kobalte-core/chunk/B2CSS4CB.js +36 -0
- package/vendor/kobalte-core/chunk/BDJEWKR2.jsx +153 -0
- package/vendor/kobalte-core/chunk/BK63AFY4.js +348 -0
- package/vendor/kobalte-core/chunk/BLN63FDC.js +40 -0
- package/vendor/kobalte-core/chunk/BU4OFZP5.jsx +146 -0
- package/vendor/kobalte-core/chunk/CLZZ2KZC.js +152 -0
- package/vendor/kobalte-core/chunk/CODJDE4S.jsx +131 -0
- package/vendor/kobalte-core/chunk/CWAEFUDR.js +732 -0
- package/vendor/kobalte-core/chunk/DBKNBLZP.js +395 -0
- package/vendor/kobalte-core/chunk/DTAYBJDT.jsx +339 -0
- package/vendor/kobalte-core/chunk/DX4MAOJL.js +653 -0
- package/vendor/kobalte-core/chunk/E4R2EMM4.js +10 -0
- package/vendor/kobalte-core/chunk/E53DB7BS.jsx +34 -0
- package/vendor/kobalte-core/chunk/EHGSTO6V.jsx +138 -0
- package/vendor/kobalte-core/chunk/EJ5I5XML.jsx +1 -0
- package/vendor/kobalte-core/chunk/ET5T45DO.js +17 -0
- package/vendor/kobalte-core/chunk/EYO4IMPK.jsx +867 -0
- package/vendor/kobalte-core/chunk/FINWO3A5.jsx +21 -0
- package/vendor/kobalte-core/chunk/FKUFPCQ6.jsx +120 -0
- package/vendor/kobalte-core/chunk/FLVHQV4A.jsx +22 -0
- package/vendor/kobalte-core/chunk/FN6EICGO.jsx +44 -0
- package/vendor/kobalte-core/chunk/FOXVCQFV.jsx +48 -0
- package/vendor/kobalte-core/chunk/G3KI2B4X.js +228 -0
- package/vendor/kobalte-core/chunk/G4JQYERT.jsx +1 -0
- package/vendor/kobalte-core/chunk/GAVSAJBM.jsx +86 -0
- package/vendor/kobalte-core/chunk/GIRHAWVP.jsx +46 -0
- package/vendor/kobalte-core/chunk/GROIIANN.jsx +32 -0
- package/vendor/kobalte-core/chunk/GSF7SFRW.jsx +98 -0
- package/vendor/kobalte-core/chunk/GXANOQ5B.jsx +66 -0
- package/vendor/kobalte-core/chunk/H7BK6JF7.jsx +489 -0
- package/vendor/kobalte-core/chunk/HGKTPMYY.js +1332 -0
- package/vendor/kobalte-core/chunk/HWIPVJ7H.js +121 -0
- package/vendor/kobalte-core/chunk/I2LBZHJH.js +144 -0
- package/vendor/kobalte-core/chunk/ICNSTULC.js +33 -0
- package/vendor/kobalte-core/chunk/IGYOA2ZZ.jsx +33 -0
- package/vendor/kobalte-core/chunk/IN725QRS.js +175 -0
- package/vendor/kobalte-core/chunk/INFLGCRV.js +123 -0
- package/vendor/kobalte-core/chunk/JEP7F7FN.js +89 -0
- package/vendor/kobalte-core/chunk/JGNXQB3J.js +140 -0
- package/vendor/kobalte-core/chunk/JHMNWOLY.jsx +87 -0
- package/vendor/kobalte-core/chunk/JNCCF6MP.jsx +12 -0
- package/vendor/kobalte-core/chunk/K6ON3K7Z.js +93 -0
- package/vendor/kobalte-core/chunk/K6P57S75.js +23 -0
- package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +244 -0
- package/vendor/kobalte-core/chunk/KQVCPTCE.js +316 -0
- package/vendor/kobalte-core/chunk/KR2RRKPK.jsx +197 -0
- package/vendor/kobalte-core/chunk/KVL5CS3M.jsx +37 -0
- package/vendor/kobalte-core/chunk/LP6E37CW.jsx +228 -0
- package/vendor/kobalte-core/chunk/LUHKRAPV.js +129 -0
- package/vendor/kobalte-core/chunk/LV6CC6HJ.js +226 -0
- package/vendor/kobalte-core/chunk/MUDPLHYE.js +56 -0
- package/vendor/kobalte-core/chunk/NEFPNRTI.jsx +426 -0
- package/vendor/kobalte-core/chunk/NY67XGGP.js +216 -0
- package/vendor/kobalte-core/chunk/OGE3DKII.jsx +413 -0
- package/vendor/kobalte-core/chunk/OK5BA5VH.jsx +533 -0
- package/vendor/kobalte-core/chunk/OPHDMVQK.jsx +217 -0
- package/vendor/kobalte-core/chunk/OPRD3XHK.js +207 -0
- package/vendor/kobalte-core/chunk/OU7DYFTQ.jsx +191 -0
- package/vendor/kobalte-core/chunk/OYES4GOP.jsx +21 -0
- package/vendor/kobalte-core/chunk/P6IXTWXS.jsx +197 -0
- package/vendor/kobalte-core/chunk/PBBM7A6R.jsx +113 -0
- package/vendor/kobalte-core/chunk/PKWJSNR5.js +474 -0
- package/vendor/kobalte-core/chunk/PTVG6YKC.js +148 -0
- package/vendor/kobalte-core/chunk/PTWD4LYA.jsx +537 -0
- package/vendor/kobalte-core/chunk/PYSNB6I6.jsx +324 -0
- package/vendor/kobalte-core/chunk/Q2T3QQUA.js +419 -0
- package/vendor/kobalte-core/chunk/QEMPLYZX.js +28 -0
- package/vendor/kobalte-core/chunk/QIRIOMOH.js +338 -0
- package/vendor/kobalte-core/chunk/QJIB6BDF.jsx +30 -0
- package/vendor/kobalte-core/chunk/QJK6CGTE.js +293 -0
- package/vendor/kobalte-core/chunk/R4V3527Z.js +130 -0
- package/vendor/kobalte-core/chunk/R5JXRO27.js +1 -0
- package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +1058 -0
- package/vendor/kobalte-core/chunk/SD3NY4DU.js +344 -0
- package/vendor/kobalte-core/chunk/SLRA6PIF.jsx +263 -0
- package/vendor/kobalte-core/chunk/SOM3K36D.jsx +191 -0
- package/vendor/kobalte-core/chunk/STGRFJHZ.js +43 -0
- package/vendor/kobalte-core/chunk/T4C3DMHT.jsx +52 -0
- package/vendor/kobalte-core/chunk/TDH5Z2ZB.js +263 -0
- package/vendor/kobalte-core/chunk/TP2BLHDF.jsx +284 -0
- package/vendor/kobalte-core/chunk/TS4C47MF.js +22 -0
- package/vendor/kobalte-core/chunk/TSB6MOZK.jsx +242 -0
- package/vendor/kobalte-core/chunk/TVVHJCOX.js +204 -0
- package/vendor/kobalte-core/chunk/TY22MKYR.jsx +996 -0
- package/vendor/kobalte-core/chunk/UEEZAKDC.js +1 -0
- package/vendor/kobalte-core/chunk/UESR3MKV.jsx +743 -0
- package/vendor/kobalte-core/chunk/UGE6PPGT.jsx +220 -0
- package/vendor/kobalte-core/chunk/UKTBL2JL.jsx +88 -0
- package/vendor/kobalte-core/chunk/V25KEN4T.jsx +399 -0
- package/vendor/kobalte-core/chunk/VI7QYH27.jsx +33 -0
- package/vendor/kobalte-core/chunk/W4MWOWKG.js +310 -0
- package/vendor/kobalte-core/chunk/WAUM5GOD.jsx +68 -0
- package/vendor/kobalte-core/chunk/WHII6HHI.js +145 -0
- package/vendor/kobalte-core/chunk/WKVBAVXH.jsx +378 -0
- package/vendor/kobalte-core/chunk/WR5BIFYV.js +780 -0
- package/vendor/kobalte-core/chunk/XLBXJFYN.js +108 -0
- package/vendor/kobalte-core/chunk/XNF3WGZ2.jsx +176 -0
- package/vendor/kobalte-core/chunk/XOC6SOOC.jsx +53 -0
- package/vendor/kobalte-core/chunk/XTJD7L6B.jsx +101 -0
- package/vendor/kobalte-core/chunk/XUUROM4M.jsx +120 -0
- package/vendor/kobalte-core/chunk/YA7DCYMB.js +80 -0
- package/vendor/kobalte-core/chunk/YFEENJN5.jsx +41 -0
- package/vendor/kobalte-core/chunk/YGDQXQ2B.js +28 -0
- package/vendor/kobalte-core/chunk/YKGT7A57.js +85 -0
- package/vendor/kobalte-core/chunk/YPUNLYJC.js +268 -0
- package/vendor/kobalte-core/chunk/YSW4UOAR.js +40 -0
- package/vendor/kobalte-core/chunk/ZAGMEN2K.jsx +152 -0
- package/vendor/kobalte-core/chunk/ZG3NR5OC.jsx +120 -0
- package/vendor/kobalte-core/chunk/ZZYKR3VO.jsx +42 -0
- package/vendor/kobalte-core/collapsible/index.d.ts +7 -0
- package/vendor/kobalte-core/collapsible/index.js +2 -0
- package/vendor/kobalte-core/collapsible/index.jsx +23 -0
- package/vendor/kobalte-core/collapsible-trigger-6358fcd4.d.ts +84 -0
- package/vendor/kobalte-core/color-area/index.d.ts +189 -0
- package/vendor/kobalte-core/color-area/index.js +724 -0
- package/vendor/kobalte-core/color-area/index.jsx +777 -0
- package/vendor/kobalte-core/color-channel-field/index.d.ts +49 -0
- package/vendor/kobalte-core/color-channel-field/index.js +72 -0
- package/vendor/kobalte-core/color-channel-field/index.jsx +117 -0
- package/vendor/kobalte-core/color-field/index.d.ts +48 -0
- package/vendor/kobalte-core/color-field/index.js +114 -0
- package/vendor/kobalte-core/color-field/index.jsx +155 -0
- package/vendor/kobalte-core/color-mode/index.d.ts +78 -0
- package/vendor/kobalte-core/color-mode/index.js +2 -0
- package/vendor/kobalte-core/color-mode/index.jsx +28 -0
- package/vendor/kobalte-core/color-slider/index.d.ts +109 -0
- package/vendor/kobalte-core/color-slider/index.js +183 -0
- package/vendor/kobalte-core/color-slider/index.jsx +255 -0
- package/vendor/kobalte-core/color-swatch/index.d.ts +39 -0
- package/vendor/kobalte-core/color-swatch/index.js +48 -0
- package/vendor/kobalte-core/color-swatch/index.jsx +64 -0
- package/vendor/kobalte-core/color-wheel/index.d.ts +166 -0
- package/vendor/kobalte-core/color-wheel/index.js +620 -0
- package/vendor/kobalte-core/color-wheel/index.jsx +640 -0
- package/vendor/kobalte-core/colors/index.d.ts +15 -0
- package/vendor/kobalte-core/colors/index.js +2 -0
- package/vendor/kobalte-core/colors/index.jsx +17 -0
- package/vendor/kobalte-core/combobox/index.d.ts +20 -0
- package/vendor/kobalte-core/combobox/index.js +8 -0
- package/vendor/kobalte-core/combobox/index.jsx +80 -0
- package/vendor/kobalte-core/combobox-root-3702d1f6.d.ts +382 -0
- package/vendor/kobalte-core/context-menu/index.d.ts +15 -0
- package/vendor/kobalte-core/context-menu/index.js +5 -0
- package/vendor/kobalte-core/context-menu/index.jsx +75 -0
- package/vendor/kobalte-core/create-list-state-d9a0f1f2.d.ts +232 -0
- package/vendor/kobalte-core/dialog/index.d.ts +10 -0
- package/vendor/kobalte-core/dialog/index.js +2 -0
- package/vendor/kobalte-core/dialog/index.jsx +40 -0
- package/vendor/kobalte-core/dialog-trigger-f415bd9b.d.ts +184 -0
- package/vendor/kobalte-core/dismissable-layer/index.d.ts +51 -0
- package/vendor/kobalte-core/dismissable-layer/index.js +2 -0
- package/vendor/kobalte-core/dismissable-layer/index.jsx +12 -0
- package/vendor/kobalte-core/dropdown-menu/index.d.ts +18 -0
- package/vendor/kobalte-core/dropdown-menu/index.js +5 -0
- package/vendor/kobalte-core/dropdown-menu/index.jsx +73 -0
- package/vendor/kobalte-core/file-field/index.d.ts +221 -0
- package/vendor/kobalte-core/file-field/index.js +539 -0
- package/vendor/kobalte-core/file-field/index.jsx +564 -0
- package/vendor/kobalte-core/form-control-description-330657bc.d.ts +49 -0
- package/vendor/kobalte-core/form-control-error-message-9efcbea8.d.ts +25 -0
- package/vendor/kobalte-core/form-control-label-2a5ca7a3.d.ts +22 -0
- package/vendor/kobalte-core/hover-card/index.d.ts +11 -0
- package/vendor/kobalte-core/hover-card/index.js +3 -0
- package/vendor/kobalte-core/hover-card/index.jsx +33 -0
- package/vendor/kobalte-core/i18n/index.d.ts +81 -0
- package/vendor/kobalte-core/i18n/index.js +2 -0
- package/vendor/kobalte-core/i18n/index.jsx +28 -0
- package/vendor/kobalte-core/image/index.d.ts +5 -0
- package/vendor/kobalte-core/image/index.js +2 -0
- package/vendor/kobalte-core/image/index.jsx +17 -0
- package/vendor/kobalte-core/index-19a0ff67.d.ts +180 -0
- package/vendor/kobalte-core/index-1a4410b1.d.ts +184 -0
- package/vendor/kobalte-core/index-29c57b8d.d.ts +90 -0
- package/vendor/kobalte-core/index-2a97f0d5.d.ts +259 -0
- package/vendor/kobalte-core/index-339032c6.d.ts +24 -0
- package/vendor/kobalte-core/index-3a4165aa.d.ts +38 -0
- package/vendor/kobalte-core/index-45d19411.d.ts +181 -0
- package/vendor/kobalte-core/index-47114d4c.d.ts +153 -0
- package/vendor/kobalte-core/index-4933558f.d.ts +22 -0
- package/vendor/kobalte-core/index-4cb1a0c7.d.ts +178 -0
- package/vendor/kobalte-core/index-544033ad.d.ts +148 -0
- package/vendor/kobalte-core/index-5eae1bf9.d.ts +145 -0
- package/vendor/kobalte-core/index-64ed0578.d.ts +47 -0
- package/vendor/kobalte-core/index-68c6e688.d.ts +125 -0
- package/vendor/kobalte-core/index-71913923.d.ts +107 -0
- package/vendor/kobalte-core/index-774e18fb.d.ts +155 -0
- package/vendor/kobalte-core/index-78f1e72b.d.ts +22 -0
- package/vendor/kobalte-core/index-79050fd4.d.ts +22 -0
- package/vendor/kobalte-core/index-82a3d7cf.d.ts +76 -0
- package/vendor/kobalte-core/index-839e646d.d.ts +308 -0
- package/vendor/kobalte-core/index-8b78f50e.d.ts +96 -0
- package/vendor/kobalte-core/index-8dfcce13.d.ts +49 -0
- package/vendor/kobalte-core/index-929e4c7c.d.ts +109 -0
- package/vendor/kobalte-core/index-a6cbe732.d.ts +267 -0
- package/vendor/kobalte-core/index-a8504bc6.d.ts +105 -0
- package/vendor/kobalte-core/index-d652f235.d.ts +234 -0
- package/vendor/kobalte-core/index-d734f7ac.d.ts +120 -0
- package/vendor/kobalte-core/index-e3628d61.d.ts +405 -0
- package/vendor/kobalte-core/index-e8f9edc7.d.ts +484 -0
- package/vendor/kobalte-core/index-e96454a3.d.ts +113 -0
- package/vendor/kobalte-core/index-ed2fe8c4.d.ts +176 -0
- package/vendor/kobalte-core/index-f3e15e6a.d.ts +107 -0
- package/vendor/kobalte-core/index.d.ts +333 -0
- package/vendor/kobalte-core/index.js +56 -0
- package/vendor/kobalte-core/index.jsx +322 -0
- package/vendor/kobalte-core/link/index.d.ts +6 -0
- package/vendor/kobalte-core/link/index.js +2 -0
- package/vendor/kobalte-core/link/index.jsx +12 -0
- package/vendor/kobalte-core/link-root-bf54d4f3.d.ts +26 -0
- package/vendor/kobalte-core/listbox/index.d.ts +10 -0
- package/vendor/kobalte-core/listbox/index.js +2 -0
- package/vendor/kobalte-core/listbox/index.jsx +30 -0
- package/vendor/kobalte-core/listbox-item-indicator-b8390ce9.d.ts +27 -0
- package/vendor/kobalte-core/listbox-section-58338bda.d.ts +172 -0
- package/vendor/kobalte-core/menu/index.d.ts +41 -0
- package/vendor/kobalte-core/menu/index.js +2 -0
- package/vendor/kobalte-core/menu/index.jsx +72 -0
- package/vendor/kobalte-core/menu-sub-trigger-29a7ad75.d.ts +462 -0
- package/vendor/kobalte-core/menubar/index.d.ts +19 -0
- package/vendor/kobalte-core/menubar/index.js +6 -0
- package/vendor/kobalte-core/menubar/index.jsx +79 -0
- package/vendor/kobalte-core/menubar-context-c1a81ca0.d.ts +73 -0
- package/vendor/kobalte-core/meter/index.d.ts +15 -0
- package/vendor/kobalte-core/meter/index.js +2 -0
- package/vendor/kobalte-core/meter/index.jsx +23 -0
- package/vendor/kobalte-core/meter-value-label-797727cd.d.ts +117 -0
- package/vendor/kobalte-core/navigation-menu/index.d.ts +191 -0
- package/vendor/kobalte-core/navigation-menu/index.js +432 -0
- package/vendor/kobalte-core/navigation-menu/index.jsx +571 -0
- package/vendor/kobalte-core/number-field/index.d.ts +11 -0
- package/vendor/kobalte-core/number-field/index.js +5 -0
- package/vendor/kobalte-core/number-field/index.jsx +42 -0
- package/vendor/kobalte-core/number-field-root-3524531f.d.ts +128 -0
- package/vendor/kobalte-core/pagination/index.d.ts +6 -0
- package/vendor/kobalte-core/pagination/index.js +2 -0
- package/vendor/kobalte-core/pagination/index.jsx +26 -0
- package/vendor/kobalte-core/polymorphic/index.d.ts +29 -0
- package/vendor/kobalte-core/polymorphic/index.js +2 -0
- package/vendor/kobalte-core/polymorphic/index.jsx +8 -0
- package/vendor/kobalte-core/popover/index.d.ts +11 -0
- package/vendor/kobalte-core/popover/index.js +3 -0
- package/vendor/kobalte-core/popover/index.jsx +45 -0
- package/vendor/kobalte-core/popper/index.d.ts +42 -0
- package/vendor/kobalte-core/popper/index.js +2 -0
- package/vendor/kobalte-core/popper/index.jsx +20 -0
- package/vendor/kobalte-core/popper-arrow-89a19127.d.ts +24 -0
- package/vendor/kobalte-core/popper-root-c2da235c.d.ts +81 -0
- package/vendor/kobalte-core/primitives/create-collection/index.d.ts +16 -0
- package/vendor/kobalte-core/primitives/create-collection/index.js +3 -0
- package/vendor/kobalte-core/primitives/create-collection/index.jsx +12 -0
- package/vendor/kobalte-core/primitives/create-controllable-signal/index.d.ts +33 -0
- package/vendor/kobalte-core/primitives/create-controllable-signal/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-controllable-signal/index.jsx +15 -0
- package/vendor/kobalte-core/primitives/create-disclosure-state/index.d.ts +31 -0
- package/vendor/kobalte-core/primitives/create-disclosure-state/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-disclosure-state/index.jsx +10 -0
- package/vendor/kobalte-core/primitives/create-dom-collection/index.d.ts +32 -0
- package/vendor/kobalte-core/primitives/create-dom-collection/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-dom-collection/index.jsx +17 -0
- package/vendor/kobalte-core/primitives/create-escape-key-down/index.d.ts +18 -0
- package/vendor/kobalte-core/primitives/create-escape-key-down/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-escape-key-down/index.jsx +8 -0
- package/vendor/kobalte-core/primitives/create-focus-scope/index.d.ts +21 -0
- package/vendor/kobalte-core/primitives/create-focus-scope/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-focus-scope/index.jsx +9 -0
- package/vendor/kobalte-core/primitives/create-form-reset-listener/index.d.ts +9 -0
- package/vendor/kobalte-core/primitives/create-form-reset-listener/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-form-reset-listener/index.jsx +8 -0
- package/vendor/kobalte-core/primitives/create-hide-outside/index.d.ts +29 -0
- package/vendor/kobalte-core/primitives/create-hide-outside/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-hide-outside/index.jsx +12 -0
- package/vendor/kobalte-core/primitives/create-interact-outside/index.d.ts +39 -0
- package/vendor/kobalte-core/primitives/create-interact-outside/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-interact-outside/index.jsx +9 -0
- package/vendor/kobalte-core/primitives/create-register-id/index.d.ts +9 -0
- package/vendor/kobalte-core/primitives/create-register-id/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-register-id/index.jsx +8 -0
- package/vendor/kobalte-core/primitives/create-size/index.d.ts +9 -0
- package/vendor/kobalte-core/primitives/create-size/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-size/index.jsx +8 -0
- package/vendor/kobalte-core/primitives/create-tag-name/index.d.ts +15 -0
- package/vendor/kobalte-core/primitives/create-tag-name/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-tag-name/index.jsx +9 -0
- package/vendor/kobalte-core/primitives/create-toggle-state/index.d.ts +33 -0
- package/vendor/kobalte-core/primitives/create-toggle-state/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-toggle-state/index.jsx +10 -0
- package/vendor/kobalte-core/primitives/create-transition/index.d.ts +52 -0
- package/vendor/kobalte-core/primitives/create-transition/index.js +2 -0
- package/vendor/kobalte-core/primitives/create-transition/index.jsx +8 -0
- package/vendor/kobalte-core/progress/index.d.ts +6 -0
- package/vendor/kobalte-core/progress/index.js +2 -0
- package/vendor/kobalte-core/progress/index.jsx +24 -0
- package/vendor/kobalte-core/radio-group/index.d.ts +8 -0
- package/vendor/kobalte-core/radio-group/index.js +4 -0
- package/vendor/kobalte-core/radio-group/index.jsx +40 -0
- package/vendor/kobalte-core/radio-group-root-0af7f9b9.d.ts +195 -0
- package/vendor/kobalte-core/rating/index.d.ts +172 -0
- package/vendor/kobalte-core/rating/index.js +464 -0
- package/vendor/kobalte-core/rating/index.jsx +540 -0
- package/vendor/kobalte-core/search/index.d.ts +85 -0
- package/vendor/kobalte-core/search/index.js +177 -0
- package/vendor/kobalte-core/search/index.jsx +227 -0
- package/vendor/kobalte-core/segmented-control/index.d.ts +69 -0
- package/vendor/kobalte-core/segmented-control/index.js +162 -0
- package/vendor/kobalte-core/segmented-control/index.jsx +217 -0
- package/vendor/kobalte-core/select/index.d.ts +19 -0
- package/vendor/kobalte-core/select/index.js +6 -0
- package/vendor/kobalte-core/select/index.jsx +75 -0
- package/vendor/kobalte-core/separator/index.d.ts +6 -0
- package/vendor/kobalte-core/separator/index.js +2 -0
- package/vendor/kobalte-core/separator/index.jsx +12 -0
- package/vendor/kobalte-core/separator-root-cb685406.d.ts +25 -0
- package/vendor/kobalte-core/skeleton/index.d.ts +5 -0
- package/vendor/kobalte-core/skeleton/index.js +2 -0
- package/vendor/kobalte-core/skeleton/index.jsx +11 -0
- package/vendor/kobalte-core/slider/index.d.ts +11 -0
- package/vendor/kobalte-core/slider/index.js +5 -0
- package/vendor/kobalte-core/slider/index.jsx +43 -0
- package/vendor/kobalte-core/slider-value-label-2be90f59.d.ts +211 -0
- package/vendor/kobalte-core/spin-button/index.d.ts +10 -0
- package/vendor/kobalte-core/spin-button/index.js +2 -0
- package/vendor/kobalte-core/spin-button/index.jsx +12 -0
- package/vendor/kobalte-core/spin-button-root-3a44420a.d.ts +63 -0
- package/vendor/kobalte-core/switch/index.d.ts +8 -0
- package/vendor/kobalte-core/switch/index.js +2 -0
- package/vendor/kobalte-core/switch/index.jsx +35 -0
- package/vendor/kobalte-core/tabs/index.d.ts +8 -0
- package/vendor/kobalte-core/tabs/index.js +2 -0
- package/vendor/kobalte-core/tabs/index.jsx +27 -0
- package/vendor/kobalte-core/text-field/index.d.ts +9 -0
- package/vendor/kobalte-core/text-field/index.js +5 -0
- package/vendor/kobalte-core/text-field/index.jsx +34 -0
- package/vendor/kobalte-core/text-field-root-0b8dfa5a.d.ts +73 -0
- package/vendor/kobalte-core/time-field/index.d.ts +165 -0
- package/vendor/kobalte-core/time-field/index.js +818 -0
- package/vendor/kobalte-core/time-field/index.jsx +824 -0
- package/vendor/kobalte-core/toast/index.d.ts +6 -0
- package/vendor/kobalte-core/toast/index.js +2 -0
- package/vendor/kobalte-core/toast/index.jsx +33 -0
- package/vendor/kobalte-core/toggle-button/index.d.ts +7 -0
- package/vendor/kobalte-core/toggle-button/index.js +2 -0
- package/vendor/kobalte-core/toggle-button/index.jsx +16 -0
- package/vendor/kobalte-core/toggle-button-root-1cfacf95.d.ts +42 -0
- package/vendor/kobalte-core/toggle-group/index.d.ts +10 -0
- package/vendor/kobalte-core/toggle-group/index.js +2 -0
- package/vendor/kobalte-core/toggle-group/index.jsx +26 -0
- package/vendor/kobalte-core/tooltip/index.d.ts +10 -0
- package/vendor/kobalte-core/tooltip/index.js +3 -0
- package/vendor/kobalte-core/tooltip/index.jsx +32 -0
- package/vendor/kobalte-core/types-6adf33e1.d.ts +8 -0
- package/vendor/kobalte-core/types-877adc4a.d.ts +125 -0
- package/vendor/kobalte-core/types-f8ae18e5.d.ts +72 -0
- package/vendor/kobalte-core/utils-45fb8d63.d.ts +11 -0
- package/vendor/kobalte-utils/LICENSE.md +21 -0
- package/vendor/kobalte-utils/NOTICE.txt +231 -0
- package/vendor/kobalte-utils/index.cjs +878 -0
- package/vendor/kobalte-utils/index.d.cts +227 -0
- package/vendor/kobalte-utils/index.d.ts +227 -0
- package/vendor/kobalte-utils/index.js +791 -0
- package/vendor/origins.json +33 -0
- package/vendor/solid-web/LICENSE +21 -0
- package/vendor/solid-web/dev.cjs +896 -0
- package/vendor/solid-web/dev.js +784 -0
- package/vendor/solid-web/server.cjs +2 -0
- package/vendor/solid-web/server.js +2 -0
- package/vendor/solid-web/types/client.d.ts +93 -0
- package/vendor/solid-web/types/core.d.ts +2 -0
- package/vendor/solid-web/types/index.d.ts +50 -0
- package/vendor/solid-web/types/jsx.d.ts +1 -0
- package/vendor/solid-web/types/server-mock.d.ts +65 -0
- package/vendor/solid-web/types/server.d.ts +187 -0
- package/vendor/solid-web/web.cjs +885 -0
- package/vendor/solid-web/web.js +773 -0
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
// Vendored and modified by Gemologic Sheen from @kobalte/core@0.13.13; see package THIRD_PARTY_NOTICES.md.
|
|
2
|
+
import {
|
|
3
|
+
getClosestValueIndex,
|
|
4
|
+
getNextSortedValues,
|
|
5
|
+
hasMinStepsBetweenValues,
|
|
6
|
+
linearScale,
|
|
7
|
+
stopEventDefaultAndPropagation
|
|
8
|
+
} from "./GIRHAWVP.jsx";
|
|
9
|
+
import {
|
|
10
|
+
createDomCollection,
|
|
11
|
+
createDomCollectionItem
|
|
12
|
+
} from "./SOM3K36D.jsx";
|
|
13
|
+
import {
|
|
14
|
+
createNumberFormatter,
|
|
15
|
+
useLocale
|
|
16
|
+
} from "./LP6E37CW.jsx";
|
|
17
|
+
import {
|
|
18
|
+
FORM_CONTROL_FIELD_PROP_NAMES,
|
|
19
|
+
createFormControlField
|
|
20
|
+
} from "./YFEENJN5.jsx";
|
|
21
|
+
import {
|
|
22
|
+
FormControlLabel
|
|
23
|
+
} from "./FOXVCQFV.jsx";
|
|
24
|
+
import {
|
|
25
|
+
createFormResetListener
|
|
26
|
+
} from "./QJIB6BDF.jsx";
|
|
27
|
+
import {
|
|
28
|
+
FormControlErrorMessage
|
|
29
|
+
} from "./ZZYKR3VO.jsx";
|
|
30
|
+
import {
|
|
31
|
+
FORM_CONTROL_PROP_NAMES,
|
|
32
|
+
FormControlContext,
|
|
33
|
+
FormControlDescription,
|
|
34
|
+
createFormControl,
|
|
35
|
+
useFormControlContext
|
|
36
|
+
} from "./XUUROM4M.jsx";
|
|
37
|
+
import {
|
|
38
|
+
createControllableArraySignal
|
|
39
|
+
} from "./FN6EICGO.jsx";
|
|
40
|
+
import {
|
|
41
|
+
Polymorphic
|
|
42
|
+
} from "./FLVHQV4A.jsx";
|
|
43
|
+
import {
|
|
44
|
+
__export
|
|
45
|
+
} from "./5WXHJDCZ.jsx";
|
|
46
|
+
|
|
47
|
+
// src/slider/index.tsx
|
|
48
|
+
var slider_exports = {};
|
|
49
|
+
__export(slider_exports, {
|
|
50
|
+
Description: () => FormControlDescription,
|
|
51
|
+
ErrorMessage: () => FormControlErrorMessage,
|
|
52
|
+
Fill: () => SliderFill,
|
|
53
|
+
Input: () => SliderInput,
|
|
54
|
+
Label: () => FormControlLabel,
|
|
55
|
+
Root: () => SliderRoot,
|
|
56
|
+
Slider: () => Slider,
|
|
57
|
+
Thumb: () => SliderThumb,
|
|
58
|
+
Track: () => SliderTrack,
|
|
59
|
+
ValueLabel: () => SliderValueLabel,
|
|
60
|
+
useSliderContext: () => useSliderContext
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// src/slider/slider-fill.tsx
|
|
64
|
+
import { splitProps } from "solid-js";
|
|
65
|
+
import { combineStyle } from "@solid-primitives/props";
|
|
66
|
+
|
|
67
|
+
// src/slider/slider-context.tsx
|
|
68
|
+
import {
|
|
69
|
+
createContext,
|
|
70
|
+
useContext
|
|
71
|
+
} from "solid-js";
|
|
72
|
+
var SliderContext = createContext();
|
|
73
|
+
function useSliderContext() {
|
|
74
|
+
const context = useContext(SliderContext);
|
|
75
|
+
if (context === void 0) {
|
|
76
|
+
throw new Error(
|
|
77
|
+
"[kobalte]: `useSliderContext` must be used within a `Slider.Root` component"
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return context;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// src/slider/slider-fill.tsx
|
|
84
|
+
function SliderFill(props) {
|
|
85
|
+
const context = useSliderContext();
|
|
86
|
+
const [local, others] = splitProps(props, ["style"]);
|
|
87
|
+
const percentages = () => {
|
|
88
|
+
return context.state.values().map((value) => context.state.getValuePercent(value) * 100);
|
|
89
|
+
};
|
|
90
|
+
const offsetStart = () => {
|
|
91
|
+
return context.state.values().length > 1 ? Math.min(...percentages()) : 0;
|
|
92
|
+
};
|
|
93
|
+
const offsetEnd = () => {
|
|
94
|
+
return 100 - Math.max(...percentages());
|
|
95
|
+
};
|
|
96
|
+
return <Polymorphic
|
|
97
|
+
as="div"
|
|
98
|
+
style={combineStyle(
|
|
99
|
+
{
|
|
100
|
+
[context.startEdge()]: `${offsetStart()}%`,
|
|
101
|
+
[context.endEdge()]: `${offsetEnd()}%`
|
|
102
|
+
},
|
|
103
|
+
local.style
|
|
104
|
+
)}
|
|
105
|
+
{...context.dataset()}
|
|
106
|
+
{...others}
|
|
107
|
+
/>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/slider/slider-input.tsx
|
|
111
|
+
import {
|
|
112
|
+
callHandler as callHandler2,
|
|
113
|
+
mergeDefaultProps as mergeDefaultProps2,
|
|
114
|
+
visuallyHiddenStyles
|
|
115
|
+
} from "#sheen-kobalte-utils";
|
|
116
|
+
import {
|
|
117
|
+
createEffect,
|
|
118
|
+
createSignal,
|
|
119
|
+
splitProps as splitProps3
|
|
120
|
+
} from "solid-js";
|
|
121
|
+
import { combineStyle as combineStyle3 } from "@solid-primitives/props";
|
|
122
|
+
|
|
123
|
+
// src/slider/slider-thumb.tsx
|
|
124
|
+
import {
|
|
125
|
+
callHandler,
|
|
126
|
+
mergeDefaultProps,
|
|
127
|
+
mergeRefs
|
|
128
|
+
} from "#sheen-kobalte-utils";
|
|
129
|
+
import {
|
|
130
|
+
createContext as createContext2,
|
|
131
|
+
createUniqueId,
|
|
132
|
+
onMount,
|
|
133
|
+
splitProps as splitProps2,
|
|
134
|
+
useContext as useContext2
|
|
135
|
+
} from "solid-js";
|
|
136
|
+
import { combineStyle as combineStyle2 } from "@solid-primitives/props";
|
|
137
|
+
function SliderThumb(props) {
|
|
138
|
+
let ref;
|
|
139
|
+
const context = useSliderContext();
|
|
140
|
+
const mergedProps = mergeDefaultProps(
|
|
141
|
+
{
|
|
142
|
+
id: context.generateId(`thumb-${createUniqueId()}`)
|
|
143
|
+
},
|
|
144
|
+
props
|
|
145
|
+
);
|
|
146
|
+
const [local, formControlFieldProps, others] = splitProps2(
|
|
147
|
+
mergedProps,
|
|
148
|
+
[
|
|
149
|
+
"ref",
|
|
150
|
+
"style",
|
|
151
|
+
"onKeyDown",
|
|
152
|
+
"onPointerDown",
|
|
153
|
+
"onPointerMove",
|
|
154
|
+
"onPointerUp",
|
|
155
|
+
"onFocus",
|
|
156
|
+
"onBlur"
|
|
157
|
+
],
|
|
158
|
+
FORM_CONTROL_FIELD_PROP_NAMES
|
|
159
|
+
);
|
|
160
|
+
const { fieldProps } = createFormControlField(formControlFieldProps);
|
|
161
|
+
createDomCollectionItem({
|
|
162
|
+
getItem: () => ({
|
|
163
|
+
ref: () => ref,
|
|
164
|
+
disabled: context.state.isDisabled(),
|
|
165
|
+
key: fieldProps.id(),
|
|
166
|
+
textValue: "",
|
|
167
|
+
type: "item"
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
const index = () => ref ? context.thumbs().findIndex((v) => v.ref() === ref) : -1;
|
|
171
|
+
const value = () => context.state.getThumbValue(index());
|
|
172
|
+
const position = () => {
|
|
173
|
+
return context.state.getThumbPercent(index());
|
|
174
|
+
};
|
|
175
|
+
const transform = () => {
|
|
176
|
+
if (context.state.orientation() === "vertical") {
|
|
177
|
+
return context.inverted() ? "translateY(-50%)" : "translateY(50%)";
|
|
178
|
+
}
|
|
179
|
+
return context.inverted() ? "translateX(50%)" : "translateX(-50%)";
|
|
180
|
+
};
|
|
181
|
+
let startPosition = 0;
|
|
182
|
+
const onKeyDown = (e) => {
|
|
183
|
+
callHandler(e, local.onKeyDown);
|
|
184
|
+
context.onStepKeyDown(e, index());
|
|
185
|
+
};
|
|
186
|
+
const onPointerDown = (e) => {
|
|
187
|
+
callHandler(e, local.onPointerDown);
|
|
188
|
+
const target = e.currentTarget;
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
target.setPointerCapture(e.pointerId);
|
|
192
|
+
target.focus();
|
|
193
|
+
startPosition = context.state.orientation() === "horizontal" ? e.clientX : e.clientY;
|
|
194
|
+
if (value() !== void 0) {
|
|
195
|
+
context.onSlideStart?.(index(), value());
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const onPointerMove = (e) => {
|
|
199
|
+
e.stopPropagation();
|
|
200
|
+
callHandler(e, local.onPointerMove);
|
|
201
|
+
const target = e.currentTarget;
|
|
202
|
+
if (target.hasPointerCapture(e.pointerId)) {
|
|
203
|
+
const delta = {
|
|
204
|
+
deltaX: e.clientX - startPosition,
|
|
205
|
+
deltaY: e.clientY - startPosition
|
|
206
|
+
};
|
|
207
|
+
context.onSlideMove?.(delta);
|
|
208
|
+
startPosition = context.state.orientation() === "horizontal" ? e.clientX : e.clientY;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const onPointerUp = (e) => {
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
callHandler(e, local.onPointerUp);
|
|
214
|
+
const target = e.currentTarget;
|
|
215
|
+
if (target.hasPointerCapture(e.pointerId)) {
|
|
216
|
+
target.releasePointerCapture(e.pointerId);
|
|
217
|
+
context.onSlideEnd?.();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const onFocus = (e) => {
|
|
221
|
+
callHandler(e, local.onFocus);
|
|
222
|
+
context.state.setFocusedThumb(index());
|
|
223
|
+
};
|
|
224
|
+
const onBlur = (e) => {
|
|
225
|
+
callHandler(e, local.onBlur);
|
|
226
|
+
context.state.setFocusedThumb(void 0);
|
|
227
|
+
};
|
|
228
|
+
onMount(() => {
|
|
229
|
+
context.state.setThumbEditable(index(), !context.state.isDisabled());
|
|
230
|
+
});
|
|
231
|
+
return <ThumbContext.Provider value={{ index }}><Polymorphic
|
|
232
|
+
as="span"
|
|
233
|
+
ref={mergeRefs((el) => ref = el, local.ref)}
|
|
234
|
+
role="slider"
|
|
235
|
+
id={fieldProps.id()}
|
|
236
|
+
tabIndex={context.state.isDisabled() ? void 0 : 0}
|
|
237
|
+
style={combineStyle2(
|
|
238
|
+
{
|
|
239
|
+
display: value() === void 0 ? "none" : void 0,
|
|
240
|
+
position: "absolute",
|
|
241
|
+
[context.startEdge()]: `calc(${position() * 100}%)`,
|
|
242
|
+
transform: transform(),
|
|
243
|
+
"touch-action": "none"
|
|
244
|
+
},
|
|
245
|
+
local.style
|
|
246
|
+
)}
|
|
247
|
+
aria-valuetext={context.state.getThumbValueLabel(index())}
|
|
248
|
+
aria-valuemin={context.minValue()}
|
|
249
|
+
aria-valuenow={value()}
|
|
250
|
+
aria-valuemax={context.maxValue()}
|
|
251
|
+
aria-orientation={context.state.orientation()}
|
|
252
|
+
aria-label={fieldProps.ariaLabel()}
|
|
253
|
+
aria-labelledby={fieldProps.ariaLabelledBy()}
|
|
254
|
+
aria-describedby={fieldProps.ariaDescribedBy()}
|
|
255
|
+
onKeyDown={onKeyDown}
|
|
256
|
+
onPointerDown={onPointerDown}
|
|
257
|
+
onPointerMove={onPointerMove}
|
|
258
|
+
onPointerUp={onPointerUp}
|
|
259
|
+
onFocus={onFocus}
|
|
260
|
+
onBlur={onBlur}
|
|
261
|
+
{...context.dataset()}
|
|
262
|
+
{...others}
|
|
263
|
+
/></ThumbContext.Provider>;
|
|
264
|
+
}
|
|
265
|
+
var ThumbContext = createContext2();
|
|
266
|
+
function useThumbContext() {
|
|
267
|
+
const context = useContext2(ThumbContext);
|
|
268
|
+
if (context === void 0) {
|
|
269
|
+
throw new Error(
|
|
270
|
+
"[kobalte]: `useThumbContext` must be used within a `Slider.Thumb` component"
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
return context;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/slider/slider-input.tsx
|
|
277
|
+
function SliderInput(props) {
|
|
278
|
+
const formControlContext = useFormControlContext();
|
|
279
|
+
const context = useSliderContext();
|
|
280
|
+
const thumb = useThumbContext();
|
|
281
|
+
const mergedProps = mergeDefaultProps2(
|
|
282
|
+
{
|
|
283
|
+
id: context.generateId("input")
|
|
284
|
+
},
|
|
285
|
+
props
|
|
286
|
+
);
|
|
287
|
+
const [local, formControlFieldProps, others] = splitProps3(
|
|
288
|
+
mergedProps,
|
|
289
|
+
["style", "onChange"],
|
|
290
|
+
FORM_CONTROL_FIELD_PROP_NAMES
|
|
291
|
+
);
|
|
292
|
+
const { fieldProps } = createFormControlField(formControlFieldProps);
|
|
293
|
+
const [valueText, setValueText] = createSignal("");
|
|
294
|
+
const onChange = (e) => {
|
|
295
|
+
callHandler2(
|
|
296
|
+
e,
|
|
297
|
+
local.onChange
|
|
298
|
+
);
|
|
299
|
+
const target = e.target;
|
|
300
|
+
context.state.setThumbValue(thumb.index(), Number.parseFloat(target.value));
|
|
301
|
+
target.value = String(context.state.values()[thumb.index()]) ?? "";
|
|
302
|
+
};
|
|
303
|
+
createEffect(() => {
|
|
304
|
+
setValueText(
|
|
305
|
+
thumb.index() === -1 ? "" : context.state.getThumbValueLabel(thumb.index())
|
|
306
|
+
);
|
|
307
|
+
});
|
|
308
|
+
return <input
|
|
309
|
+
type="range"
|
|
310
|
+
id={fieldProps.id()}
|
|
311
|
+
name={formControlContext.name()}
|
|
312
|
+
tabIndex={context.state.isDisabled() ? void 0 : -1}
|
|
313
|
+
min={context.state.getThumbMinValue(thumb.index())}
|
|
314
|
+
max={context.state.getThumbMaxValue(thumb.index())}
|
|
315
|
+
step={context.state.step()}
|
|
316
|
+
value={context.state.values()[thumb.index()]}
|
|
317
|
+
required={formControlContext.isRequired()}
|
|
318
|
+
disabled={formControlContext.isDisabled()}
|
|
319
|
+
readonly={formControlContext.isReadOnly()}
|
|
320
|
+
style={combineStyle3({ ...visuallyHiddenStyles }, local.style)}
|
|
321
|
+
aria-orientation={context.state.orientation()}
|
|
322
|
+
aria-valuetext={valueText()}
|
|
323
|
+
aria-label={fieldProps.ariaLabel()}
|
|
324
|
+
aria-labelledby={fieldProps.ariaLabelledBy()}
|
|
325
|
+
aria-describedby={fieldProps.ariaDescribedBy()}
|
|
326
|
+
aria-invalid={formControlContext.validationState() === "invalid" || void 0}
|
|
327
|
+
aria-required={formControlContext.isRequired() || void 0}
|
|
328
|
+
aria-disabled={formControlContext.isDisabled() || void 0}
|
|
329
|
+
aria-readonly={formControlContext.isReadOnly() || void 0}
|
|
330
|
+
onChange={onChange}
|
|
331
|
+
{...context.dataset()}
|
|
332
|
+
{...others}
|
|
333
|
+
/>;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// src/slider/slider-root.tsx
|
|
337
|
+
import {
|
|
338
|
+
access,
|
|
339
|
+
clamp as clamp2,
|
|
340
|
+
createGenerateId,
|
|
341
|
+
mergeDefaultProps as mergeDefaultProps4,
|
|
342
|
+
mergeRefs as mergeRefs2
|
|
343
|
+
} from "#sheen-kobalte-utils";
|
|
344
|
+
import {
|
|
345
|
+
createMemo as createMemo2,
|
|
346
|
+
createSignal as createSignal3,
|
|
347
|
+
createUniqueId as createUniqueId2,
|
|
348
|
+
splitProps as splitProps4
|
|
349
|
+
} from "solid-js";
|
|
350
|
+
|
|
351
|
+
// src/slider/create-slider-state.ts
|
|
352
|
+
import { clamp, mergeDefaultProps as mergeDefaultProps3, snapValueToStep } from "#sheen-kobalte-utils";
|
|
353
|
+
import { createMemo, createSignal as createSignal2 } from "solid-js";
|
|
354
|
+
function createSliderState(props) {
|
|
355
|
+
let dirty = false;
|
|
356
|
+
const mergedProps = mergeDefaultProps3(
|
|
357
|
+
{
|
|
358
|
+
minValue: () => 0,
|
|
359
|
+
maxValue: () => 100,
|
|
360
|
+
step: () => 1,
|
|
361
|
+
minStepsBetweenThumbs: () => 0,
|
|
362
|
+
orientation: () => "horizontal",
|
|
363
|
+
isDisabled: () => false
|
|
364
|
+
},
|
|
365
|
+
props
|
|
366
|
+
);
|
|
367
|
+
const pageSize = createMemo(() => {
|
|
368
|
+
let calcPageSize = (mergedProps.maxValue() - mergedProps.minValue()) / 10;
|
|
369
|
+
calcPageSize = snapValueToStep(
|
|
370
|
+
calcPageSize,
|
|
371
|
+
0,
|
|
372
|
+
calcPageSize + mergedProps.step(),
|
|
373
|
+
mergedProps.step()
|
|
374
|
+
);
|
|
375
|
+
return Math.max(calcPageSize, mergedProps.step());
|
|
376
|
+
});
|
|
377
|
+
const defaultValue = createMemo(() => {
|
|
378
|
+
return mergedProps.defaultValue() ?? [mergedProps.minValue()];
|
|
379
|
+
});
|
|
380
|
+
const [values, setValues] = createControllableArraySignal({
|
|
381
|
+
value: () => mergedProps.value(),
|
|
382
|
+
defaultValue,
|
|
383
|
+
onChange: (values2) => mergedProps.onChange?.(values2)
|
|
384
|
+
});
|
|
385
|
+
const [isDragging, setIsDragging] = createSignal2(
|
|
386
|
+
new Array(values().length).fill(false)
|
|
387
|
+
);
|
|
388
|
+
const [isEditables, setEditables] = createSignal2(
|
|
389
|
+
new Array(values().length).fill(false)
|
|
390
|
+
);
|
|
391
|
+
const [focusedIndex, setFocusedIndex] = createSignal2(
|
|
392
|
+
void 0
|
|
393
|
+
);
|
|
394
|
+
const resetValues = () => {
|
|
395
|
+
setValues(defaultValue());
|
|
396
|
+
};
|
|
397
|
+
const getValuePercent = (value) => {
|
|
398
|
+
return (value - mergedProps.minValue()) / (mergedProps.maxValue() - mergedProps.minValue());
|
|
399
|
+
};
|
|
400
|
+
const getThumbMinValue = (index) => {
|
|
401
|
+
return index === 0 ? props.minValue() : values()[index - 1] + props.minStepsBetweenThumbs() * props.step();
|
|
402
|
+
};
|
|
403
|
+
const getThumbMaxValue = (index) => {
|
|
404
|
+
return index === values().length - 1 ? props.maxValue() : values()[index + 1] - props.minStepsBetweenThumbs() * props.step();
|
|
405
|
+
};
|
|
406
|
+
const isThumbEditable = (index) => {
|
|
407
|
+
return isEditables()[index];
|
|
408
|
+
};
|
|
409
|
+
const setThumbEditable = (index) => {
|
|
410
|
+
setEditables((p) => {
|
|
411
|
+
p[index] = true;
|
|
412
|
+
return p;
|
|
413
|
+
});
|
|
414
|
+
};
|
|
415
|
+
const updateValue = (index, value) => {
|
|
416
|
+
if (mergedProps.isDisabled() || !isThumbEditable(index))
|
|
417
|
+
return;
|
|
418
|
+
const snappedValue = snapValueToStep(
|
|
419
|
+
value,
|
|
420
|
+
getThumbMinValue(index),
|
|
421
|
+
getThumbMaxValue(index),
|
|
422
|
+
mergedProps.step()
|
|
423
|
+
);
|
|
424
|
+
const nextValues = getNextSortedValues(values(), snappedValue, index);
|
|
425
|
+
if (!hasMinStepsBetweenValues(
|
|
426
|
+
nextValues,
|
|
427
|
+
mergedProps.minStepsBetweenThumbs() * mergedProps.step()
|
|
428
|
+
)) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
setValues((prev) => [...replaceIndex(prev, index, snappedValue)]);
|
|
432
|
+
};
|
|
433
|
+
const updateDragging = (index, dragging) => {
|
|
434
|
+
if (mergedProps.isDisabled() || !isThumbEditable(index))
|
|
435
|
+
return;
|
|
436
|
+
const wasDragging = isDragging()[index];
|
|
437
|
+
setIsDragging((p) => [...replaceIndex(p, index, dragging)]);
|
|
438
|
+
if (wasDragging && !isDragging().some(Boolean)) {
|
|
439
|
+
mergedProps.onChangeEnd?.(values());
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
const getFormattedValue = (value) => {
|
|
443
|
+
return mergedProps.numberFormatter.format(value);
|
|
444
|
+
};
|
|
445
|
+
const setThumbPercent = (index, percent) => {
|
|
446
|
+
updateValue(index, getPercentValue(percent));
|
|
447
|
+
};
|
|
448
|
+
const getRoundedValue = (value) => {
|
|
449
|
+
return Math.round((value - mergedProps.minValue()) / mergedProps.step()) * mergedProps.step() + mergedProps.minValue();
|
|
450
|
+
};
|
|
451
|
+
const getPercentValue = (percent) => {
|
|
452
|
+
const val = percent * (mergedProps.maxValue() - mergedProps.minValue()) + mergedProps.minValue();
|
|
453
|
+
return clamp(
|
|
454
|
+
getRoundedValue(val),
|
|
455
|
+
mergedProps.minValue(),
|
|
456
|
+
mergedProps.maxValue()
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
const snapThumbValue = (index, value) => {
|
|
460
|
+
const nextValue = values()[index] + value;
|
|
461
|
+
const nextValues = getNextSortedValues(values(), nextValue, index);
|
|
462
|
+
if (hasMinStepsBetweenValues(
|
|
463
|
+
nextValues,
|
|
464
|
+
mergedProps.minStepsBetweenThumbs() * mergedProps.step()
|
|
465
|
+
)) {
|
|
466
|
+
updateValue(
|
|
467
|
+
index,
|
|
468
|
+
snapValueToStep(
|
|
469
|
+
nextValue,
|
|
470
|
+
mergedProps.minValue(),
|
|
471
|
+
mergedProps.maxValue(),
|
|
472
|
+
mergedProps.step()
|
|
473
|
+
)
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
const incrementThumb = (index, stepSize = 1) => {
|
|
478
|
+
dirty = true;
|
|
479
|
+
snapThumbValue(index, Math.max(stepSize, props.step()));
|
|
480
|
+
};
|
|
481
|
+
const decrementThumb = (index, stepSize = 1) => {
|
|
482
|
+
dirty = true;
|
|
483
|
+
snapThumbValue(index, -Math.max(stepSize, props.step()));
|
|
484
|
+
};
|
|
485
|
+
return {
|
|
486
|
+
values,
|
|
487
|
+
getThumbValue: (index) => values()[index],
|
|
488
|
+
setThumbValue: updateValue,
|
|
489
|
+
setThumbPercent,
|
|
490
|
+
isThumbDragging: (index) => isDragging()[index],
|
|
491
|
+
setThumbDragging: updateDragging,
|
|
492
|
+
focusedThumb: focusedIndex,
|
|
493
|
+
setFocusedThumb: (index) => {
|
|
494
|
+
if (index === void 0 && dirty) {
|
|
495
|
+
dirty = false;
|
|
496
|
+
mergedProps.onChangeEnd?.(values());
|
|
497
|
+
}
|
|
498
|
+
setFocusedIndex(index);
|
|
499
|
+
},
|
|
500
|
+
getThumbPercent: (index) => getValuePercent(values()[index]),
|
|
501
|
+
getValuePercent,
|
|
502
|
+
getThumbValueLabel: (index) => getFormattedValue(values()[index]),
|
|
503
|
+
getFormattedValue,
|
|
504
|
+
getThumbMinValue,
|
|
505
|
+
getThumbMaxValue,
|
|
506
|
+
getPercentValue,
|
|
507
|
+
isThumbEditable,
|
|
508
|
+
setThumbEditable,
|
|
509
|
+
incrementThumb,
|
|
510
|
+
decrementThumb,
|
|
511
|
+
step: mergedProps.step,
|
|
512
|
+
pageSize,
|
|
513
|
+
orientation: mergedProps.orientation,
|
|
514
|
+
isDisabled: mergedProps.isDisabled,
|
|
515
|
+
setValues,
|
|
516
|
+
resetValues
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function replaceIndex(array, index, value) {
|
|
520
|
+
if (array[index] === value) {
|
|
521
|
+
return array;
|
|
522
|
+
}
|
|
523
|
+
return [...array.slice(0, index), value, ...array.slice(index + 1)];
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// src/slider/slider-root.tsx
|
|
527
|
+
function SliderRoot(props) {
|
|
528
|
+
let ref;
|
|
529
|
+
const defaultId = `slider-${createUniqueId2()}`;
|
|
530
|
+
const mergedProps = mergeDefaultProps4(
|
|
531
|
+
{
|
|
532
|
+
id: defaultId,
|
|
533
|
+
minValue: 0,
|
|
534
|
+
maxValue: 100,
|
|
535
|
+
step: 1,
|
|
536
|
+
minStepsBetweenThumbs: 0,
|
|
537
|
+
orientation: "horizontal",
|
|
538
|
+
disabled: false,
|
|
539
|
+
inverted: false,
|
|
540
|
+
getValueLabel: (params) => params.values.join(", ")
|
|
541
|
+
},
|
|
542
|
+
props
|
|
543
|
+
);
|
|
544
|
+
const [local, formControlProps, others] = splitProps4(
|
|
545
|
+
mergedProps,
|
|
546
|
+
[
|
|
547
|
+
"ref",
|
|
548
|
+
"value",
|
|
549
|
+
"defaultValue",
|
|
550
|
+
"onChange",
|
|
551
|
+
"onChangeEnd",
|
|
552
|
+
"inverted",
|
|
553
|
+
"minValue",
|
|
554
|
+
"maxValue",
|
|
555
|
+
"step",
|
|
556
|
+
"minStepsBetweenThumbs",
|
|
557
|
+
"getValueLabel",
|
|
558
|
+
"orientation"
|
|
559
|
+
],
|
|
560
|
+
FORM_CONTROL_PROP_NAMES
|
|
561
|
+
);
|
|
562
|
+
const { formControlContext } = createFormControl(formControlProps);
|
|
563
|
+
const defaultFormatter = createNumberFormatter(() => ({ style: "decimal" }));
|
|
564
|
+
const { direction } = useLocale();
|
|
565
|
+
const state = createSliderState({
|
|
566
|
+
value: () => local.value,
|
|
567
|
+
defaultValue: () => local.defaultValue ?? [local.minValue],
|
|
568
|
+
maxValue: () => local.maxValue,
|
|
569
|
+
minValue: () => local.minValue,
|
|
570
|
+
minStepsBetweenThumbs: () => local.minStepsBetweenThumbs,
|
|
571
|
+
isDisabled: () => formControlContext.isDisabled() ?? false,
|
|
572
|
+
orientation: () => local.orientation,
|
|
573
|
+
step: () => local.step,
|
|
574
|
+
numberFormatter: defaultFormatter(),
|
|
575
|
+
onChange: local.onChange,
|
|
576
|
+
onChangeEnd: local.onChangeEnd
|
|
577
|
+
});
|
|
578
|
+
const [thumbs, setThumbs] = createSignal3([]);
|
|
579
|
+
const { DomCollectionProvider } = createDomCollection({
|
|
580
|
+
items: thumbs,
|
|
581
|
+
onItemsChange: setThumbs
|
|
582
|
+
});
|
|
583
|
+
createFormResetListener(
|
|
584
|
+
() => ref,
|
|
585
|
+
() => state.resetValues()
|
|
586
|
+
);
|
|
587
|
+
const isLTR = () => direction() === "ltr";
|
|
588
|
+
const isSlidingFromLeft = () => {
|
|
589
|
+
return isLTR() && !local.inverted || !isLTR() && local.inverted;
|
|
590
|
+
};
|
|
591
|
+
const isSlidingFromBottom = () => !local.inverted;
|
|
592
|
+
const isVertical = () => state.orientation() === "vertical";
|
|
593
|
+
const dataset = createMemo2(() => {
|
|
594
|
+
return {
|
|
595
|
+
...formControlContext.dataset(),
|
|
596
|
+
"data-orientation": local.orientation
|
|
597
|
+
};
|
|
598
|
+
});
|
|
599
|
+
const [trackRef, setTrackRef] = createSignal3();
|
|
600
|
+
let currentPosition = null;
|
|
601
|
+
const onSlideStart = (index, value) => {
|
|
602
|
+
state.setFocusedThumb(index);
|
|
603
|
+
state.setThumbDragging(index, true);
|
|
604
|
+
state.setThumbValue(index, value);
|
|
605
|
+
currentPosition = null;
|
|
606
|
+
};
|
|
607
|
+
const onSlideMove = ({
|
|
608
|
+
deltaX,
|
|
609
|
+
deltaY
|
|
610
|
+
}) => {
|
|
611
|
+
const active = state.focusedThumb();
|
|
612
|
+
if (active === void 0) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const { width, height } = trackRef().getBoundingClientRect();
|
|
616
|
+
const size = isVertical() ? height : width;
|
|
617
|
+
if (currentPosition === null) {
|
|
618
|
+
currentPosition = state.getThumbPercent(state.focusedThumb()) * size;
|
|
619
|
+
}
|
|
620
|
+
let delta = isVertical() ? deltaY : deltaX;
|
|
621
|
+
if (!isVertical() && local.inverted || isVertical() && isSlidingFromBottom()) {
|
|
622
|
+
delta = -delta;
|
|
623
|
+
}
|
|
624
|
+
currentPosition += delta;
|
|
625
|
+
const percent = clamp2(currentPosition / size, 0, 1);
|
|
626
|
+
const nextValues = getNextSortedValues(
|
|
627
|
+
state.values(),
|
|
628
|
+
currentPosition,
|
|
629
|
+
active
|
|
630
|
+
);
|
|
631
|
+
if (hasMinStepsBetweenValues(
|
|
632
|
+
nextValues,
|
|
633
|
+
local.minStepsBetweenThumbs * state.step()
|
|
634
|
+
)) {
|
|
635
|
+
state.setThumbPercent(state.focusedThumb(), percent);
|
|
636
|
+
local.onChange?.(state.values());
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
const onSlideEnd = () => {
|
|
640
|
+
const activeThumb = state.focusedThumb();
|
|
641
|
+
if (activeThumb !== void 0) {
|
|
642
|
+
state.setThumbDragging(activeThumb, false);
|
|
643
|
+
thumbs()[activeThumb].ref().focus();
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
const onHomeKeyDown = (event) => {
|
|
647
|
+
const focusedThumb = state.focusedThumb();
|
|
648
|
+
if (!formControlContext.isDisabled() && focusedThumb !== void 0) {
|
|
649
|
+
stopEventDefaultAndPropagation(event);
|
|
650
|
+
state.setThumbValue(focusedThumb, state.getThumbMinValue(focusedThumb));
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
const onEndKeyDown = (event) => {
|
|
654
|
+
const focusedThumb = state.focusedThumb();
|
|
655
|
+
if (!formControlContext.isDisabled() && focusedThumb !== void 0) {
|
|
656
|
+
stopEventDefaultAndPropagation(event);
|
|
657
|
+
state.setThumbValue(focusedThumb, state.getThumbMaxValue(focusedThumb));
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
const onStepKeyDown = (event, index) => {
|
|
661
|
+
if (!formControlContext.isDisabled()) {
|
|
662
|
+
switch (event.key) {
|
|
663
|
+
case "Left":
|
|
664
|
+
case "ArrowLeft":
|
|
665
|
+
case "Down":
|
|
666
|
+
case "ArrowDown":
|
|
667
|
+
stopEventDefaultAndPropagation(event);
|
|
668
|
+
if (!isLTR()) {
|
|
669
|
+
state.incrementThumb(
|
|
670
|
+
index,
|
|
671
|
+
event.shiftKey ? state.pageSize() : state.step()
|
|
672
|
+
);
|
|
673
|
+
} else {
|
|
674
|
+
state.decrementThumb(
|
|
675
|
+
index,
|
|
676
|
+
event.shiftKey ? state.pageSize() : state.step()
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
break;
|
|
680
|
+
case "Right":
|
|
681
|
+
case "ArrowRight":
|
|
682
|
+
case "Up":
|
|
683
|
+
case "ArrowUp":
|
|
684
|
+
stopEventDefaultAndPropagation(event);
|
|
685
|
+
if (!isLTR()) {
|
|
686
|
+
state.decrementThumb(
|
|
687
|
+
index,
|
|
688
|
+
event.shiftKey ? state.pageSize() : state.step()
|
|
689
|
+
);
|
|
690
|
+
} else {
|
|
691
|
+
state.incrementThumb(
|
|
692
|
+
index,
|
|
693
|
+
event.shiftKey ? state.pageSize() : state.step()
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
break;
|
|
697
|
+
case "Home":
|
|
698
|
+
onHomeKeyDown(event);
|
|
699
|
+
break;
|
|
700
|
+
case "End":
|
|
701
|
+
onEndKeyDown(event);
|
|
702
|
+
break;
|
|
703
|
+
case "PageUp":
|
|
704
|
+
stopEventDefaultAndPropagation(event);
|
|
705
|
+
state.incrementThumb(index, state.pageSize());
|
|
706
|
+
break;
|
|
707
|
+
case "PageDown":
|
|
708
|
+
stopEventDefaultAndPropagation(event);
|
|
709
|
+
state.decrementThumb(index, state.pageSize());
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
const startEdge = createMemo2(() => {
|
|
715
|
+
if (isVertical()) {
|
|
716
|
+
return isSlidingFromBottom() ? "bottom" : "top";
|
|
717
|
+
}
|
|
718
|
+
return isSlidingFromLeft() ? "left" : "right";
|
|
719
|
+
});
|
|
720
|
+
const endEdge = createMemo2(() => {
|
|
721
|
+
if (isVertical()) {
|
|
722
|
+
return isSlidingFromBottom() ? "top" : "bottom";
|
|
723
|
+
}
|
|
724
|
+
return isSlidingFromLeft() ? "right" : "left";
|
|
725
|
+
});
|
|
726
|
+
const context = {
|
|
727
|
+
dataset,
|
|
728
|
+
state,
|
|
729
|
+
thumbs,
|
|
730
|
+
setThumbs,
|
|
731
|
+
onSlideStart,
|
|
732
|
+
onSlideMove,
|
|
733
|
+
onSlideEnd,
|
|
734
|
+
onStepKeyDown,
|
|
735
|
+
isSlidingFromLeft,
|
|
736
|
+
isSlidingFromBottom,
|
|
737
|
+
trackRef,
|
|
738
|
+
minValue: () => local.minValue,
|
|
739
|
+
maxValue: () => local.maxValue,
|
|
740
|
+
inverted: () => local.inverted,
|
|
741
|
+
startEdge,
|
|
742
|
+
endEdge,
|
|
743
|
+
registerTrack: (ref2) => setTrackRef(ref2),
|
|
744
|
+
generateId: createGenerateId(() => access(formControlProps.id)),
|
|
745
|
+
getValueLabel: local.getValueLabel
|
|
746
|
+
};
|
|
747
|
+
return <DomCollectionProvider><FormControlContext.Provider value={formControlContext}><SliderContext.Provider value={context}><Polymorphic
|
|
748
|
+
as="div"
|
|
749
|
+
ref={mergeRefs2((el) => ref = el, local.ref)}
|
|
750
|
+
role="group"
|
|
751
|
+
id={access(formControlProps.id)}
|
|
752
|
+
{...dataset()}
|
|
753
|
+
{...others}
|
|
754
|
+
/></SliderContext.Provider></FormControlContext.Provider></DomCollectionProvider>;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// src/slider/slider-track.tsx
|
|
758
|
+
import { callHandler as callHandler3, mergeRefs as mergeRefs3 } from "#sheen-kobalte-utils";
|
|
759
|
+
import {
|
|
760
|
+
createSignal as createSignal4,
|
|
761
|
+
splitProps as splitProps5
|
|
762
|
+
} from "solid-js";
|
|
763
|
+
function SliderTrack(props) {
|
|
764
|
+
const context = useSliderContext();
|
|
765
|
+
const [local, others] = splitProps5(props, [
|
|
766
|
+
"onPointerDown",
|
|
767
|
+
"onPointerMove",
|
|
768
|
+
"onPointerUp"
|
|
769
|
+
]);
|
|
770
|
+
const [sRect, setRect] = createSignal4();
|
|
771
|
+
function getValueFromPointer(pointerPosition) {
|
|
772
|
+
const rect = sRect() || context.trackRef().getBoundingClientRect();
|
|
773
|
+
const input = [
|
|
774
|
+
0,
|
|
775
|
+
context.state.orientation() === "vertical" ? rect.height : rect.width
|
|
776
|
+
];
|
|
777
|
+
let output = context.isSlidingFromLeft() ? [context.minValue(), context.maxValue()] : [context.maxValue(), context.minValue()];
|
|
778
|
+
if (context.state.orientation() === "vertical") {
|
|
779
|
+
output = context.isSlidingFromBottom() ? [context.maxValue(), context.minValue()] : [context.minValue(), context.maxValue()];
|
|
780
|
+
}
|
|
781
|
+
const value = linearScale(input, output);
|
|
782
|
+
setRect(rect);
|
|
783
|
+
return value(
|
|
784
|
+
pointerPosition - (context.state.orientation() === "vertical" ? rect.top : rect.left)
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
let startPosition = 0;
|
|
788
|
+
const onPointerDown = (e) => {
|
|
789
|
+
callHandler3(e, local.onPointerDown);
|
|
790
|
+
const target = e.target;
|
|
791
|
+
target.setPointerCapture(e.pointerId);
|
|
792
|
+
e.preventDefault();
|
|
793
|
+
const value = getValueFromPointer(
|
|
794
|
+
context.state.orientation() === "horizontal" ? e.clientX : e.clientY
|
|
795
|
+
);
|
|
796
|
+
startPosition = context.state.orientation() === "horizontal" ? e.clientX : e.clientY;
|
|
797
|
+
const closestIndex = getClosestValueIndex(context.state.values(), value);
|
|
798
|
+
context.onSlideStart?.(closestIndex, value);
|
|
799
|
+
};
|
|
800
|
+
const onPointerMove = (e) => {
|
|
801
|
+
callHandler3(e, local.onPointerMove);
|
|
802
|
+
const target = e.target;
|
|
803
|
+
if (target.hasPointerCapture(e.pointerId)) {
|
|
804
|
+
context.onSlideMove?.({
|
|
805
|
+
deltaX: e.clientX - startPosition,
|
|
806
|
+
deltaY: e.clientY - startPosition
|
|
807
|
+
});
|
|
808
|
+
startPosition = context.state.orientation() === "horizontal" ? e.clientX : e.clientY;
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
const onPointerUp = (e) => {
|
|
812
|
+
callHandler3(e, local.onPointerUp);
|
|
813
|
+
const target = e.target;
|
|
814
|
+
if (target.hasPointerCapture(e.pointerId)) {
|
|
815
|
+
target.releasePointerCapture(e.pointerId);
|
|
816
|
+
setRect(void 0);
|
|
817
|
+
context.onSlideEnd?.();
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
return <Polymorphic
|
|
821
|
+
as="div"
|
|
822
|
+
ref={mergeRefs3(context.registerTrack, props.ref)}
|
|
823
|
+
onPointerDown={onPointerDown}
|
|
824
|
+
onPointerMove={onPointerMove}
|
|
825
|
+
onPointerUp={onPointerUp}
|
|
826
|
+
{...context.dataset()}
|
|
827
|
+
{...others}
|
|
828
|
+
/>;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// src/slider/slider-value-label.tsx
|
|
832
|
+
function SliderValueLabel(props) {
|
|
833
|
+
const context = useSliderContext();
|
|
834
|
+
return <Polymorphic
|
|
835
|
+
as="div"
|
|
836
|
+
{...context.dataset()}
|
|
837
|
+
{...props}
|
|
838
|
+
>{context.getValueLabel?.({
|
|
839
|
+
values: context.state.values(),
|
|
840
|
+
max: context.maxValue(),
|
|
841
|
+
min: context.minValue()
|
|
842
|
+
})}</Polymorphic>;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// src/slider/index.tsx
|
|
846
|
+
var Slider = Object.assign(SliderRoot, {
|
|
847
|
+
Description: FormControlDescription,
|
|
848
|
+
ErrorMessage: FormControlErrorMessage,
|
|
849
|
+
Fill: SliderFill,
|
|
850
|
+
Input: SliderInput,
|
|
851
|
+
Label: FormControlLabel,
|
|
852
|
+
Thumb: SliderThumb,
|
|
853
|
+
Track: SliderTrack,
|
|
854
|
+
ValueLabel: SliderValueLabel
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
export {
|
|
858
|
+
useSliderContext,
|
|
859
|
+
SliderFill,
|
|
860
|
+
SliderThumb,
|
|
861
|
+
SliderInput,
|
|
862
|
+
SliderRoot,
|
|
863
|
+
SliderTrack,
|
|
864
|
+
SliderValueLabel,
|
|
865
|
+
Slider,
|
|
866
|
+
slider_exports
|
|
867
|
+
};
|