@42-central/ui-react 0.19.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/biome/no-gray-scale-class.grit +27 -0
- package/dist/{chunk-HCYULRWT.js → chunk-2KN3MI7I.js} +38 -34
- package/dist/chunk-2KN3MI7I.js.map +1 -0
- package/dist/chunk-2LI3VPDP.js +39 -0
- package/dist/chunk-2LI3VPDP.js.map +1 -0
- package/dist/{chunk-2NNZHVKD.js → chunk-2OQP7UY4.js} +22 -18
- package/dist/chunk-2OQP7UY4.js.map +1 -0
- package/dist/{chunk-RKYXG6X7.js → chunk-2TM7UVM2.js} +16 -13
- package/dist/chunk-2TM7UVM2.js.map +1 -0
- package/dist/chunk-3REFDGOM.js +89 -0
- package/dist/chunk-3REFDGOM.js.map +1 -0
- package/dist/{chunk-TBTSEPGP.js → chunk-45DFYIK5.js} +9 -7
- package/dist/chunk-45DFYIK5.js.map +1 -0
- package/dist/{chunk-CYWMES5P.js → chunk-4BGU2UQB.js} +23 -11
- package/dist/chunk-4BGU2UQB.js.map +1 -0
- package/dist/chunk-4EU6FGGB.js +104 -0
- package/dist/chunk-4EU6FGGB.js.map +1 -0
- package/dist/{chunk-P3XMBETI.js → chunk-4G3N7UMJ.js} +4 -7
- package/dist/chunk-4G3N7UMJ.js.map +1 -0
- package/dist/chunk-4TCTMRR5.js +293 -0
- package/dist/chunk-4TCTMRR5.js.map +1 -0
- package/dist/chunk-5337N3FE.js +176 -0
- package/dist/chunk-5337N3FE.js.map +1 -0
- package/dist/{chunk-GCGX4FEF.js → chunk-6KER77RS.js} +27 -41
- package/dist/chunk-6KER77RS.js.map +1 -0
- package/dist/chunk-6N6J2DOE.js +27 -0
- package/dist/chunk-6N6J2DOE.js.map +1 -0
- package/dist/{chunk-A6MYJTJI.js → chunk-6OV6EJQ2.js} +6 -7
- package/dist/chunk-6OV6EJQ2.js.map +1 -0
- package/dist/chunk-7AWOMWCQ.js +345 -0
- package/dist/chunk-7AWOMWCQ.js.map +1 -0
- package/dist/{chunk-Z6RPMRFH.js → chunk-7R4CDHBK.js} +9 -8
- package/dist/chunk-7R4CDHBK.js.map +1 -0
- package/dist/chunk-7TDHT3QD.js +62 -0
- package/dist/chunk-7TDHT3QD.js.map +1 -0
- package/dist/chunk-AHM6SGEU.js +15 -0
- package/dist/chunk-AHM6SGEU.js.map +1 -0
- package/dist/chunk-AZ2VUAGX.js +3 -0
- package/dist/chunk-AZ2VUAGX.js.map +1 -0
- package/dist/chunk-BUFALAEK.js +337 -0
- package/dist/chunk-BUFALAEK.js.map +1 -0
- package/dist/chunk-CDHIF2NV.js +340 -0
- package/dist/chunk-CDHIF2NV.js.map +1 -0
- package/dist/chunk-CQ4M4BSF.js +12 -0
- package/dist/chunk-CQ4M4BSF.js.map +1 -0
- package/dist/chunk-DHM4IG2O.js +13 -0
- package/dist/chunk-DHM4IG2O.js.map +1 -0
- package/dist/chunk-DHTSVJ4G.js +948 -0
- package/dist/chunk-DHTSVJ4G.js.map +1 -0
- package/dist/{chunk-WSIVRDRB.js → chunk-DUPE2CRU.js} +3 -3
- package/dist/{chunk-WSIVRDRB.js.map → chunk-DUPE2CRU.js.map} +1 -1
- package/dist/chunk-EIBDLRAR.js +30 -0
- package/dist/chunk-EIBDLRAR.js.map +1 -0
- package/dist/chunk-FUNTJZX7.js +217 -0
- package/dist/chunk-FUNTJZX7.js.map +1 -0
- package/dist/{chunk-YWRBG23W.js → chunk-FXDLS23K.js} +6 -3
- package/dist/chunk-FXDLS23K.js.map +1 -0
- package/dist/chunk-FZNPJAGJ.js +62 -0
- package/dist/chunk-FZNPJAGJ.js.map +1 -0
- package/dist/{chunk-CHTN5AHI.js → chunk-GGT4GJD6.js} +3 -3
- package/dist/chunk-GGT4GJD6.js.map +1 -0
- package/dist/chunk-GIPQUKCN.js +44 -0
- package/dist/chunk-GIPQUKCN.js.map +1 -0
- package/dist/chunk-H26K66EU.js +316 -0
- package/dist/chunk-H26K66EU.js.map +1 -0
- package/dist/chunk-H7INUXZD.js +104 -0
- package/dist/chunk-H7INUXZD.js.map +1 -0
- package/dist/{chunk-AIQG7IIT.js → chunk-H7WOMZXO.js} +10 -5
- package/dist/chunk-H7WOMZXO.js.map +1 -0
- package/dist/{chunk-WJOHNCYY.js → chunk-HBFN5W7Q.js} +37 -90
- package/dist/chunk-HBFN5W7Q.js.map +1 -0
- package/dist/chunk-HBWV5EPU.js +31 -0
- package/dist/chunk-HBWV5EPU.js.map +1 -0
- package/dist/chunk-HC4XVBP2.js +118 -0
- package/dist/chunk-HC4XVBP2.js.map +1 -0
- package/dist/chunk-HDRC6ITF.js +93 -0
- package/dist/chunk-HDRC6ITF.js.map +1 -0
- package/dist/chunk-HDYORQZN.js +23 -0
- package/dist/chunk-HDYORQZN.js.map +1 -0
- package/dist/chunk-HEQ2H6VO.js +148 -0
- package/dist/chunk-HEQ2H6VO.js.map +1 -0
- package/dist/chunk-HVOEVB4E.js +80 -0
- package/dist/chunk-HVOEVB4E.js.map +1 -0
- package/dist/chunk-HX3LNK26.js +193 -0
- package/dist/chunk-HX3LNK26.js.map +1 -0
- package/dist/{chunk-CSCVTESP.js → chunk-IMP5VHEN.js} +4 -11
- package/dist/chunk-IMP5VHEN.js.map +1 -0
- package/dist/{chunk-57BTVRRB.js → chunk-IPYHTCFL.js} +3 -3
- package/dist/{chunk-57BTVRRB.js.map → chunk-IPYHTCFL.js.map} +1 -1
- package/dist/chunk-J2WSKRJW.js +3 -0
- package/dist/chunk-J2WSKRJW.js.map +1 -0
- package/dist/chunk-J43LSYQO.js +14 -0
- package/dist/chunk-J43LSYQO.js.map +1 -0
- package/dist/{chunk-Z43YWH4R.js → chunk-JL4QMM46.js} +47 -25
- package/dist/chunk-JL4QMM46.js.map +1 -0
- package/dist/chunk-JQJ23YQX.js +38 -0
- package/dist/chunk-JQJ23YQX.js.map +1 -0
- package/dist/{chunk-SVKU3GUN.js → chunk-JYK6JVR3.js} +13 -13
- package/dist/chunk-JYK6JVR3.js.map +1 -0
- package/dist/chunk-JYKP4RSG.js +304 -0
- package/dist/chunk-JYKP4RSG.js.map +1 -0
- package/dist/chunk-K6BHDFX3.js +120 -0
- package/dist/chunk-K6BHDFX3.js.map +1 -0
- package/dist/chunk-K6YASO4L.js +25 -0
- package/dist/chunk-K6YASO4L.js.map +1 -0
- package/dist/{chunk-64T6Z7BA.js → chunk-KOT4PWGE.js} +107 -95
- package/dist/chunk-KOT4PWGE.js.map +1 -0
- package/dist/{chunk-RIP5G47F.js → chunk-LJ3GHC4V.js} +13 -11
- package/dist/chunk-LJ3GHC4V.js.map +1 -0
- package/dist/{chunk-YW6Q6ERX.js → chunk-LSIX2PVU.js} +49 -56
- package/dist/chunk-LSIX2PVU.js.map +1 -0
- package/dist/chunk-LZWA7V62.js +140 -0
- package/dist/chunk-LZWA7V62.js.map +1 -0
- package/dist/chunk-MKJKCBRE.js +437 -0
- package/dist/chunk-MKJKCBRE.js.map +1 -0
- package/dist/{chunk-QIDAXFKK.js → chunk-NJ4RO3CT.js} +52 -18
- package/dist/chunk-NJ4RO3CT.js.map +1 -0
- package/dist/{chunk-PINENGML.js → chunk-P276SCCV.js} +15 -8
- package/dist/chunk-P276SCCV.js.map +1 -0
- package/dist/chunk-PAFS7TED.js +85 -0
- package/dist/chunk-PAFS7TED.js.map +1 -0
- package/dist/chunk-PD4FX34E.js +309 -0
- package/dist/chunk-PD4FX34E.js.map +1 -0
- package/dist/{chunk-BEL75C7N.js → chunk-PMUCGFY5.js} +6 -4
- package/dist/chunk-PMUCGFY5.js.map +1 -0
- package/dist/{chunk-4NNGTNPV.js → chunk-Q5ZO2O25.js} +48 -34
- package/dist/chunk-Q5ZO2O25.js.map +1 -0
- package/dist/{chunk-YKUCSV34.js → chunk-R52P43LZ.js} +7 -13
- package/dist/chunk-R52P43LZ.js.map +1 -0
- package/dist/{chunk-CZEKZ5HR.js → chunk-R57QP43T.js} +32 -11
- package/dist/chunk-R57QP43T.js.map +1 -0
- package/dist/{chunk-I4SQQIP5.js → chunk-R5LYFTHA.js} +2 -2
- package/dist/chunk-R5LYFTHA.js.map +1 -0
- package/dist/{chunk-FOMR74VE.js → chunk-RGLNH7A5.js} +6 -6
- package/dist/chunk-RGLNH7A5.js.map +1 -0
- package/dist/chunk-RNRD6ER5.js +32 -0
- package/dist/chunk-RNRD6ER5.js.map +1 -0
- package/dist/{chunk-VZBUQNLX.js → chunk-S4TRYMCU.js} +51 -40
- package/dist/chunk-S4TRYMCU.js.map +1 -0
- package/dist/chunk-SDVZFXQ2.js +21 -0
- package/dist/chunk-SDVZFXQ2.js.map +1 -0
- package/dist/{chunk-CTSO6V72.js → chunk-SE3CGQRO.js} +11 -5
- package/dist/chunk-SE3CGQRO.js.map +1 -0
- package/dist/chunk-TCFB23JT.js +354 -0
- package/dist/chunk-TCFB23JT.js.map +1 -0
- package/dist/{chunk-BTFBBNRW.js → chunk-THLMW5IU.js} +5 -5
- package/dist/{chunk-BTFBBNRW.js.map → chunk-THLMW5IU.js.map} +1 -1
- package/dist/{chunk-YQHOKMSV.js → chunk-U2PNMMDB.js} +60 -53
- package/dist/chunk-U2PNMMDB.js.map +1 -0
- package/dist/{chunk-IRXZHLUL.js → chunk-VALQ2XVA.js} +4 -4
- package/dist/chunk-VALQ2XVA.js.map +1 -0
- package/dist/{chunk-UJZIF2BA.js → chunk-VVM7JMZS.js} +40 -54
- package/dist/chunk-VVM7JMZS.js.map +1 -0
- package/dist/{chunk-OGJFDNIS.js → chunk-WFHY6NRQ.js} +85 -54
- package/dist/chunk-WFHY6NRQ.js.map +1 -0
- package/dist/chunk-WG3BCIU4.js +20 -0
- package/dist/chunk-WG3BCIU4.js.map +1 -0
- package/dist/{chunk-K5UWVH6P.js → chunk-WR444JRU.js} +35 -26
- package/dist/chunk-WR444JRU.js.map +1 -0
- package/dist/chunk-XFEPUGUZ.js +15 -0
- package/dist/chunk-XFEPUGUZ.js.map +1 -0
- package/dist/chunk-XXOR34T4.js +10 -0
- package/dist/chunk-XXOR34T4.js.map +1 -0
- package/dist/{chunk-VZH6TS7M.js → chunk-Z5WYYDG2.js} +7 -4
- package/dist/chunk-Z5WYYDG2.js.map +1 -0
- package/dist/{chunk-IG7FBZVM.js → chunk-ZFUTGBJC.js} +13 -12
- package/dist/chunk-ZFUTGBJC.js.map +1 -0
- package/dist/{chunk-LM6F6DLR.js → chunk-ZN3WYGIQ.js} +18 -9
- package/dist/chunk-ZN3WYGIQ.js.map +1 -0
- package/dist/{chunk-FAOBC4IS.js → chunk-ZWOZL4XX.js} +38 -28
- package/dist/chunk-ZWOZL4XX.js.map +1 -0
- package/dist/chunk-ZYX564HO.js +27 -0
- package/dist/chunk-ZYX564HO.js.map +1 -0
- package/dist/colors.css +16 -8
- package/dist/components/accordion/accordion.d.ts +13 -4
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.d.ts.map +1 -1
- package/dist/components/accordion/index.js +27 -15
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -4
- package/dist/components/alert/alert.d.ts +20 -8
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert/index.d.ts.map +1 -1
- package/dist/components/alert/index.js +22 -10
- package/dist/components/alert/index.js.map +1 -1
- package/dist/components/ambient-background/ambient-background.d.ts +13 -3
- package/dist/components/ambient-background/ambient-background.d.ts.map +1 -1
- package/dist/components/ambient-background/index.js +38 -27
- package/dist/components/ambient-background/index.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +68 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.d.ts +1 -1
- package/dist/components/app-shell/index.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +46 -18
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +39 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.d.ts.map +1 -0
- package/dist/components/aspect-ratio/index.js +33 -0
- package/dist/components/aspect-ratio/index.js.map +1 -0
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +16 -19
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +14 -2
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/avatar/index.d.ts.map +1 -1
- package/dist/components/avatar/index.js +26 -13
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +6 -100
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +21 -5
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.d.ts +1 -1
- package/dist/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +30 -6
- package/dist/components/breadcrumb/index.js.map +1 -1
- package/dist/components/button/button.d.ts +37 -16
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -4
- package/dist/components/button-multi-select/index.js +9 -7
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +9 -7
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/calendar-body.d.ts +10 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +24 -7
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +10 -8
- package/dist/components/camera/camera-machine.d.ts +131 -0
- package/dist/components/camera/camera-machine.d.ts.map +1 -0
- package/dist/components/camera/camera.d.ts +230 -0
- package/dist/components/camera/camera.d.ts.map +1 -0
- package/dist/components/camera/fake-camera.d.ts +77 -0
- package/dist/components/camera/fake-camera.d.ts.map +1 -0
- package/dist/components/camera/index.d.ts +5 -0
- package/dist/components/camera/index.d.ts.map +1 -0
- package/dist/components/camera/index.js +38 -0
- package/dist/components/camera/index.js.map +1 -0
- package/dist/components/camera/platform.d.ts +21 -0
- package/dist/components/camera/platform.d.ts.map +1 -0
- package/dist/components/camera/use-camera.d.ts +98 -0
- package/dist/components/camera/use-camera.d.ts.map +1 -0
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/index.js +2 -1
- package/dist/components/carousel/carousel.d.ts +270 -0
- package/dist/components/carousel/carousel.d.ts.map +1 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.d.ts.map +1 -0
- package/dist/components/carousel/index.js +666 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chart/chart.d.ts +20 -2
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +11 -1
- package/dist/components/chart/index.js.map +1 -1
- package/dist/components/chart/styles.css +12 -10
- package/dist/components/checkbox/checkbox.d.ts +8 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +7 -5
- package/dist/components/choice-card-group/choice-card-group.d.ts +1 -1
- package/dist/components/choice-card-group/choice-card-group.d.ts.map +1 -1
- package/dist/components/choice-card-group/index.js +50 -48
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +9 -1
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +12 -1
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts +17 -8
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/copy.d.ts +19 -5
- package/dist/components/clipboard/copy.d.ts.map +1 -1
- package/dist/components/clipboard/index.d.ts +1 -1
- package/dist/components/clipboard/index.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +60 -23
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +3 -2
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.d.ts +10 -9
- package/dist/components/code-block/chrome.d.ts.map +1 -1
- package/dist/components/code-block/chrome.js +10 -8
- package/dist/components/code-block/code-block.d.ts +6 -11
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/index.d.ts +2 -2
- package/dist/components/code-block/index.d.ts.map +1 -1
- package/dist/components/code-block/index.js +11 -9
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/code-block/static.d.ts +3 -5
- package/dist/components/code-block/static.d.ts.map +1 -1
- package/dist/components/code-block/static.js.map +1 -1
- package/dist/components/collapse/index.js +2 -2
- package/dist/components/combobox/combobox.d.ts +2 -2
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +10 -8
- package/dist/components/combobox-list/combobox-list.d.ts +10 -2
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/combobox-search-row.d.ts +31 -0
- package/dist/components/combobox-list/combobox-search-row.d.ts.map +1 -0
- package/dist/components/combobox-list/index.d.ts +1 -1
- package/dist/components/combobox-list/index.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +13 -10
- package/dist/components/compare/compare.d.ts +45 -0
- package/dist/components/compare/compare.d.ts.map +1 -0
- package/dist/components/compare/index.d.ts +2 -0
- package/dist/components/compare/index.d.ts.map +1 -0
- package/dist/components/compare/index.js +206 -0
- package/dist/components/compare/index.js.map +1 -0
- package/dist/components/container/container.d.ts +7 -1
- package/dist/components/container/container.d.ts.map +1 -1
- package/dist/components/container/index.js.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts +13 -12
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/index.d.ts +8 -4
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
- package/dist/components/data-table/data-table-header-cell.d.ts +6 -9
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
- package/dist/components/data-table/data-table-icons.d.ts +27 -0
- package/dist/components/data-table/data-table-icons.d.ts.map +1 -0
- package/dist/components/data-table/data-table-pagination.d.ts +18 -3
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +5 -2
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-state.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +7 -2
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +11 -2
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +12 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +1 -0
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +281 -198
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +7 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +15 -6
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-time-text.d.ts +2 -2
- package/dist/components/date-picker/date-time-text.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +23 -20
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/divider/divider.d.ts +12 -3
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/index.js +2 -1
- package/dist/components/download-button/download-button.d.ts +69 -0
- package/dist/components/download-button/download-button.d.ts.map +1 -0
- package/dist/components/download-button/index.d.ts +2 -0
- package/dist/components/download-button/index.d.ts.map +1 -0
- package/dist/components/download-button/index.js +13 -0
- package/dist/components/download-button/index.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +79 -44
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.d.ts.map +1 -1
- package/dist/components/drawer/index.js +10 -6
- package/dist/components/field/field.d.ts +8 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +2 -1
- package/dist/components/figure/figure.d.ts +27 -0
- package/dist/components/figure/figure.d.ts.map +1 -0
- package/dist/components/figure/index.d.ts +2 -0
- package/dist/components/figure/index.d.ts.map +1 -0
- package/dist/components/figure/index.js +7 -0
- package/dist/components/figure/index.js.map +1 -0
- package/dist/components/file-item/file-item.d.ts +178 -0
- package/dist/components/file-item/file-item.d.ts.map +1 -0
- package/dist/components/file-item/index.d.ts +2 -0
- package/dist/components/file-item/index.d.ts.map +1 -0
- package/dist/components/file-item/index.js +25 -0
- package/dist/components/file-item/index.js.map +1 -0
- package/dist/components/file-preview/file-preview.d.ts +189 -0
- package/dist/components/file-preview/file-preview.d.ts.map +1 -0
- package/dist/components/file-preview/index.d.ts +2 -0
- package/dist/components/file-preview/index.d.ts.map +1 -0
- package/dist/components/file-preview/index.js +572 -0
- package/dist/components/file-preview/index.js.map +1 -0
- package/dist/components/file-queue-summary/file-queue-summary.d.ts +35 -0
- package/dist/components/file-queue-summary/file-queue-summary.d.ts.map +1 -0
- package/dist/components/file-queue-summary/index.d.ts +3 -0
- package/dist/components/file-queue-summary/index.d.ts.map +1 -0
- package/dist/components/file-queue-summary/index.js +7 -0
- package/dist/components/file-queue-summary/index.js.map +1 -0
- package/dist/components/file-trigger/file-trigger.d.ts +40 -0
- package/dist/components/file-trigger/file-trigger.d.ts.map +1 -0
- package/dist/components/file-trigger/index.d.ts +2 -0
- package/dist/components/file-trigger/index.d.ts.map +1 -0
- package/dist/components/file-trigger/index.js +11 -0
- package/dist/components/file-trigger/index.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +102 -14
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +205 -101
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/flex/flex.d.ts +14 -2
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/index.js +2 -1
- package/dist/components/gallery/gallery.d.ts +77 -0
- package/dist/components/gallery/gallery.d.ts.map +1 -0
- package/dist/components/gallery/index.d.ts +3 -0
- package/dist/components/gallery/index.d.ts.map +1 -0
- package/dist/components/gallery/index.js +272 -0
- package/dist/components/gallery/index.js.map +1 -0
- package/dist/components/gallery/layout.d.ts +96 -0
- package/dist/components/gallery/layout.d.ts.map +1 -0
- package/dist/components/grid/grid.d.ts +7 -1
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/index.js +2 -10
- package/dist/components/grid/index.js.map +1 -1
- package/dist/components/hover-card/index.js +4 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/blur-svg.d.ts +11 -0
- package/dist/components/image/blur-svg.d.ts.map +1 -0
- package/dist/components/image/image.d.ts +126 -0
- package/dist/components/image/image.d.ts.map +1 -0
- package/dist/components/image/index.d.ts +3 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +12 -0
- package/dist/components/image/index.js.map +1 -0
- package/dist/components/image/srcset.d.ts +47 -0
- package/dist/components/image/srcset.d.ts.map +1 -0
- package/dist/components/image-cropper/image-cropper.d.ts +208 -0
- package/dist/components/image-cropper/image-cropper.d.ts.map +1 -0
- package/dist/components/image-cropper/index.d.ts +2 -0
- package/dist/components/image-cropper/index.d.ts.map +1 -0
- package/dist/components/image-cropper/index.js +22 -0
- package/dist/components/image-cropper/index.js.map +1 -0
- package/dist/components/indicator/index.js +10 -3
- package/dist/components/indicator/index.js.map +1 -1
- package/dist/components/indicator/indicator.d.ts +21 -8
- package/dist/components/indicator/indicator.d.ts.map +1 -1
- package/dist/components/input/index.js +3 -2
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/index.d.ts.map +1 -1
- package/dist/components/kbd/index.js +10 -78
- package/dist/components/kbd/index.js.map +1 -1
- package/dist/components/kbd/kbd.d.ts +45 -3
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.d.ts +2 -0
- package/dist/components/lightbox/index.d.ts.map +1 -0
- package/dist/components/lightbox/index.js +1922 -0
- package/dist/components/lightbox/index.js.map +1 -0
- package/dist/components/lightbox/lightbox-controller.d.ts +97 -0
- package/dist/components/lightbox/lightbox-controller.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox-machine.d.ts +165 -0
- package/dist/components/lightbox/lightbox-machine.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox-zoom.d.ts +72 -0
- package/dist/components/lightbox/lightbox-zoom.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.d.ts +297 -0
- package/dist/components/lightbox/lightbox.d.ts.map +1 -0
- package/dist/components/mark/index.js +1 -1
- package/dist/components/mark/mark.d.ts.map +1 -1
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/index.d.ts.map +1 -1
- package/dist/components/menu/index.js +12 -6
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu-data.d.ts +5 -8
- package/dist/components/menu/menu-data.d.ts.map +1 -1
- package/dist/components/menu/menu.d.ts +40 -18
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +10 -6
- package/dist/components/modal/modal.d.ts +25 -19
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.d.ts +1 -1
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +15 -12
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +10 -2
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +25 -19
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +5 -2
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +9 -6
- package/dist/components/nav-link/nav-link.d.ts +5 -2
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/navigation.d.ts +8 -1
- package/dist/components/nav-link/navigation.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +9 -6
- package/dist/components/nav-link/tanstack.js.map +1 -1
- package/dist/components/notification/create-notifier.d.ts +4 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/notification/index.d.ts.map +1 -1
- package/dist/components/notification/index.js +59 -21
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +41 -11
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +10 -8
- package/dist/components/number-input/number-input.d.ts +9 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/create-overlays.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +59 -0
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -0
- package/dist/components/overlays/index.js +28 -31
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/overlays/renderer.d.ts.map +1 -1
- package/dist/components/overlays/store.d.ts.map +1 -1
- package/dist/components/password-input/index.d.ts +1 -1
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +13 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +10 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.d.ts +4 -0
- package/dist/components/photo-capture/index.d.ts.map +1 -0
- package/dist/components/photo-capture/index.js +519 -0
- package/dist/components/photo-capture/index.js.map +1 -0
- package/dist/components/photo-capture/photo-capture-machine.d.ts +74 -0
- package/dist/components/photo-capture/photo-capture-machine.d.ts.map +1 -0
- package/dist/components/photo-capture/photo-capture.d.ts +192 -0
- package/dist/components/photo-capture/photo-capture.d.ts.map +1 -0
- package/dist/components/photo-capture/use-photo-capture.d.ts +92 -0
- package/dist/components/photo-capture/use-photo-capture.d.ts.map +1 -0
- package/dist/components/pill/index.js +5 -3
- package/dist/components/pill/pill.d.ts +4 -3
- package/dist/components/pill/pill.d.ts.map +1 -1
- package/dist/components/pills-input/index.d.ts +1 -1
- package/dist/components/pills-input/index.d.ts.map +1 -1
- package/dist/components/pills-input/index.js +12 -6
- package/dist/components/pills-input/pills-input.d.ts +29 -10
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.d.ts +1 -1
- package/dist/components/pin-input/index.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +39 -12
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts +14 -2
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/icons.d.ts +9 -4
- package/dist/components/popover/icons.d.ts.map +1 -1
- package/dist/components/popover/index.js +4 -3
- package/dist/components/popover/popover.d.ts +12 -8
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -109
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts +9 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +11 -5
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +3 -3
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/icons.d.ts +0 -10
- package/dist/components/rating/icons.d.ts.map +1 -1
- package/dist/components/rating/index.d.ts +1 -1
- package/dist/components/rating/index.d.ts.map +1 -1
- package/dist/components/rating/index.js +16 -6
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts +18 -8
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.d.ts +6 -23
- package/dist/components/schedule/index.d.ts.map +1 -1
- package/dist/components/schedule/index.js +3314 -2729
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/now-cursor-line.d.ts +11 -3
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
- package/dist/components/schedule/schedule-agenda-list.d.ts +1 -1
- package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
- package/dist/components/schedule/schedule-agenda-view.d.ts +3 -4
- package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-all-day-row.d.ts +3 -1
- package/dist/components/schedule/schedule-all-day-row.d.ts.map +1 -1
- package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts +42 -19
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-day-column.d.ts +111 -0
- package/dist/components/schedule/schedule-day-column.d.ts.map +1 -0
- package/dist/components/schedule/schedule-days-view.d.ts +2 -2
- package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts +31 -2
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-details-popover.d.ts +57 -0
- package/dist/components/schedule/schedule-event-details-popover.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-list-popover-content.d.ts +4 -1
- package/dist/components/schedule/schedule-event-list-popover-content.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-pill.d.ts +68 -0
- package/dist/components/schedule/schedule-event-pill.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-styles.d.ts +54 -0
- package/dist/components/schedule/schedule-event-styles.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +10 -8
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +24 -2
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-icons.d.ts +20 -0
- package/dist/components/schedule/schedule-icons.d.ts.map +1 -0
- package/dist/components/schedule/schedule-month-view.d.ts +1 -1
- package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-overflow-chip.d.ts +4 -2
- package/dist/components/schedule/schedule-overflow-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-overflow-popover.d.ts +4 -1
- package/dist/components/schedule/schedule-overflow-popover.d.ts.map +1 -1
- package/dist/components/schedule/schedule-slot-cursor.d.ts +36 -0
- package/dist/components/schedule/schedule-slot-cursor.d.ts.map +1 -0
- package/dist/components/schedule/schedule-timed-grid-chrome.d.ts +86 -0
- package/dist/components/schedule/schedule-timed-grid-chrome.d.ts.map +1 -0
- package/dist/components/schedule/schedule-timed-grid.d.ts +3 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts +33 -10
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
- package/dist/components/schedule/schedule-types.d.ts +103 -15
- package/dist/components/schedule/schedule-types.d.ts.map +1 -1
- package/dist/components/schedule/schedule-view-pagination-chrome.d.ts +36 -0
- package/dist/components/schedule/schedule-view-pagination-chrome.d.ts.map +1 -0
- package/dist/components/schedule/schedule-year-view.d.ts +1 -1
- package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule.d.ts +0 -18
- package/dist/components/schedule/schedule.d.ts.map +1 -1
- package/dist/components/schedule/use-chip-keyboard-move.d.ts +45 -0
- package/dist/components/schedule/use-chip-keyboard-move.d.ts.map +1 -0
- package/dist/components/schedule/use-chip-motion.d.ts +28 -0
- package/dist/components/schedule/use-chip-motion.d.ts.map +1 -0
- package/dist/components/schedule/use-date-grid-navigation.d.ts +59 -0
- package/dist/components/schedule/use-date-grid-navigation.d.ts.map +1 -0
- package/dist/components/schedule/use-event-drag.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts +10 -2
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/schedule/use-schedule-reveal.d.ts +29 -0
- package/dist/components/schedule/use-schedule-reveal.d.ts.map +1 -0
- package/dist/components/schedule/use-schedule-selection.d.ts +3 -1
- package/dist/components/schedule/use-schedule-selection.d.ts.map +1 -1
- package/dist/components/schedule/use-timed-grid-announcer.d.ts +21 -0
- package/dist/components/schedule/use-timed-grid-announcer.d.ts.map +1 -0
- package/dist/components/schedule/use-timed-grid-paging.d.ts +36 -0
- package/dist/components/schedule/use-timed-grid-paging.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +8 -6
- package/dist/components/segment-group/segment-group.d.ts +1 -1
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +13 -11
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +2 -1
- package/dist/components/slider/index.js +6 -256
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/slider.d.ts +18 -10
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/spinner/index.js +2 -1
- package/dist/components/spinner/spinner.d.ts +7 -36
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spotlight/context.d.ts +50 -0
- package/dist/components/spotlight/context.d.ts.map +1 -0
- package/dist/components/spotlight/create-spotlight.d.ts +193 -0
- package/dist/components/spotlight/create-spotlight.d.ts.map +1 -0
- package/dist/components/spotlight/highlight.d.ts +23 -0
- package/dist/components/spotlight/highlight.d.ts.map +1 -0
- package/dist/components/spotlight/icons.d.ts +14 -0
- package/dist/components/spotlight/icons.d.ts.map +1 -0
- package/dist/components/spotlight/index.d.ts +12 -0
- package/dist/components/spotlight/index.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +1695 -0
- package/dist/components/spotlight/index.js.map +1 -0
- package/dist/components/spotlight/label.d.ts +9 -0
- package/dist/components/spotlight/label.d.ts.map +1 -0
- package/dist/components/spotlight/recents.d.ts +29 -0
- package/dist/components/spotlight/recents.d.ts.map +1 -0
- package/dist/components/spotlight/spotlight-engine.d.ts +86 -0
- package/dist/components/spotlight/spotlight-engine.d.ts.map +1 -0
- package/dist/components/spotlight/spotlight.d.ts +233 -0
- package/dist/components/spotlight/spotlight.d.ts.map +1 -0
- package/dist/components/spotlight/static-source.d.ts +32 -0
- package/dist/components/spotlight/static-source.d.ts.map +1 -0
- package/dist/components/spotlight/store.d.ts +39 -0
- package/dist/components/spotlight/store.d.ts.map +1 -0
- package/dist/components/spotlight/translations.d.ts +90 -0
- package/dist/components/spotlight/translations.d.ts.map +1 -0
- package/dist/components/spotlight/types.d.ts +297 -0
- package/dist/components/spotlight/types.d.ts.map +1 -0
- package/dist/components/spotlight/view.d.ts +139 -0
- package/dist/components/spotlight/view.d.ts.map +1 -0
- package/dist/components/switch/index.js +7 -6
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts +3 -2
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table/index.js +3 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +5 -4
- package/dist/components/tabs/tabs-data.d.ts +6 -2
- package/dist/components/tabs/tabs-data.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +55 -34
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +41 -24
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +12 -5
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text/index.js +2 -2
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/text-input/index.js +3 -2
- package/dist/components/text-input/index.js.map +1 -1
- package/dist/components/textarea/index.js +3 -2
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/theme-icon/index.js +2 -2
- package/dist/components/theme-script/index.js.map +1 -1
- package/dist/components/theme-script/theme-script.d.ts +2 -2
- package/dist/components/theme-script/theme-script.d.ts.map +1 -1
- package/dist/components/time-input/hour-cycle.d.ts +17 -7
- package/dist/components/time-input/hour-cycle.d.ts.map +1 -1
- package/dist/components/time-input/index.js +21 -20
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/time-input/time-input.d.ts +2 -1
- package/dist/components/time-input/time-input.d.ts.map +1 -1
- package/dist/components/time-input/time-row.d.ts +20 -1
- package/dist/components/time-input/time-row.d.ts.map +1 -1
- package/dist/components/timeline/index.d.ts +1 -1
- package/dist/components/timeline/index.d.ts.map +1 -1
- package/dist/components/timeline/index.js +43 -30
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts +16 -2
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/title/index.js +2 -2
- package/dist/components/title/title.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +3 -2
- package/dist/components/tooltip/tooltip.d.ts +6 -4
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +111 -247
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +12 -5
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +104 -320
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +126 -0
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -0
- package/dist/components/tree-select/tree-select.d.ts +24 -2
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -112
- package/dist/index.js.map +1 -1
- package/dist/lib/as-child.d.ts +1 -1
- package/dist/lib/cutout.d.ts +34 -0
- package/dist/lib/cutout.d.ts.map +1 -0
- package/dist/lib/dev-warn.d.ts +11 -0
- package/dist/lib/dev-warn.d.ts.map +1 -1
- package/dist/lib/file-kind-icons.d.ts +5 -0
- package/dist/lib/file-kind-icons.d.ts.map +1 -0
- package/dist/lib/file-queue-summary.d.ts +89 -0
- package/dist/lib/file-queue-summary.d.ts.map +1 -0
- package/dist/lib/file-queue.d.ts +147 -0
- package/dist/lib/file-queue.d.ts.map +1 -0
- package/dist/lib/files.d.ts +29 -0
- package/dist/lib/files.d.ts.map +1 -0
- package/dist/lib/focus-styles.d.ts +46 -7
- package/dist/lib/focus-styles.d.ts.map +1 -1
- package/dist/lib/gap.d.ts +17 -0
- package/dist/lib/gap.d.ts.map +1 -0
- package/dist/lib/graphemes.d.ts +10 -0
- package/dist/lib/graphemes.d.ts.map +1 -0
- package/dist/lib/icons.d.ts +34 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/image-file.d.ts +9 -0
- package/dist/lib/image-file.d.ts.map +1 -0
- package/dist/lib/merge-refs.d.ts +34 -7
- package/dist/lib/merge-refs.d.ts.map +1 -1
- package/dist/lib/motion/animate.d.ts +42 -0
- package/dist/lib/motion/animate.d.ts.map +1 -0
- package/dist/lib/motion/easing.d.ts +33 -0
- package/dist/lib/motion/easing.d.ts.map +1 -0
- package/dist/lib/motion/gesture.d.ts +127 -0
- package/dist/lib/motion/gesture.d.ts.map +1 -0
- package/dist/lib/motion/morph.d.ts +61 -0
- package/dist/lib/motion/morph.d.ts.map +1 -0
- package/dist/lib/motion/physics.d.ts +44 -0
- package/dist/lib/motion/physics.d.ts.map +1 -0
- package/dist/lib/motion/rect.d.ts +39 -0
- package/dist/lib/motion/rect.d.ts.map +1 -0
- package/dist/lib/motion/reduced-motion.d.ts +23 -0
- package/dist/lib/motion/reduced-motion.d.ts.map +1 -0
- package/dist/lib/motion/spring.d.ts +80 -0
- package/dist/lib/motion/spring.d.ts.map +1 -0
- package/dist/lib/motion/tokens.d.ts +43 -0
- package/dist/lib/motion/tokens.d.ts.map +1 -0
- package/dist/lib/motion/use-gesture.d.ts +36 -0
- package/dist/lib/motion/use-gesture.d.ts.map +1 -0
- package/dist/lib/open-file.d.ts +82 -0
- package/dist/lib/open-file.d.ts.map +1 -0
- package/dist/lib/open-index.d.ts +59 -0
- package/dist/lib/open-index.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +15 -1
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/radius.d.ts +17 -0
- package/dist/lib/radius.d.ts.map +1 -0
- package/dist/lib/ratio.d.ts +16 -0
- package/dist/lib/ratio.d.ts.map +1 -0
- package/dist/lib/save-file.d.ts +52 -0
- package/dist/lib/save-file.d.ts.map +1 -0
- package/dist/lib/select-data.d.ts +57 -24
- package/dist/lib/select-data.d.ts.map +1 -1
- package/dist/lib/tree-data.d.ts +7 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/typography-size.d.ts +27 -8
- package/dist/lib/typography-size.d.ts.map +1 -1
- package/dist/lib/use-debounced.d.ts +17 -0
- package/dist/lib/use-debounced.d.ts.map +1 -0
- package/dist/lib/use-disclosure.d.ts.map +1 -1
- package/dist/lib/use-document-visibility.d.ts +16 -0
- package/dist/lib/use-document-visibility.d.ts.map +1 -0
- package/dist/lib/use-element-size.d.ts +42 -0
- package/dist/lib/use-element-size.d.ts.map +1 -0
- package/dist/lib/use-file-queue.d.ts +62 -0
- package/dist/lib/use-file-queue.d.ts.map +1 -0
- package/dist/lib/use-hotkey.d.ts +240 -0
- package/dist/lib/use-hotkey.d.ts.map +1 -0
- package/dist/lib/use-hydrated.d.ts +16 -0
- package/dist/lib/use-hydrated.d.ts.map +1 -0
- package/dist/lib/use-in-view.d.ts +37 -0
- package/dist/lib/use-in-view.d.ts.map +1 -0
- package/dist/lib/use-now.d.ts +34 -3
- package/dist/lib/use-now.d.ts.map +1 -1
- package/dist/lib/use-object-url.d.ts +61 -0
- package/dist/lib/use-object-url.d.ts.map +1 -0
- package/dist/lib/use-uncontrolled.d.ts.map +1 -1
- package/dist/theme.css +184 -16
- package/package.json +4 -2
- package/src/as-child.contract.test.tsx +221 -6
- package/src/biome-plugins.test.ts +34 -4
- package/src/colors.css +16 -8
- package/src/components/accordion/accordion.test.tsx +45 -2
- package/src/components/accordion/accordion.tsx +38 -17
- package/src/components/accordion/index.ts +2 -0
- package/src/components/action-icon/action-icon.tsx +8 -6
- package/src/components/alert/alert.test.tsx +49 -2
- package/src/components/alert/alert.tsx +47 -14
- package/src/components/alert/index.ts +8 -1
- package/src/components/ambient-background/ambient-background.test.tsx +21 -7
- package/src/components/ambient-background/ambient-background.tsx +49 -28
- package/src/components/app-shell/app-shell.test.tsx +58 -8
- package/src/components/app-shell/app-shell.tsx +69 -17
- package/src/components/app-shell/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.test.tsx +82 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +63 -0
- package/src/components/aspect-ratio/index.ts +1 -0
- package/src/components/autocomplete/autocomplete.tsx +9 -14
- package/src/components/avatar/avatar.test.tsx +101 -2
- package/src/components/avatar/avatar.tsx +65 -15
- package/src/components/avatar/index.ts +2 -0
- package/src/components/badge/badge.tsx +3 -1
- package/src/components/breadcrumb/breadcrumb.test.tsx +46 -0
- package/src/components/breadcrumb/breadcrumb.tsx +51 -10
- package/src/components/breadcrumb/index.ts +2 -0
- package/src/components/button/button.test.tsx +65 -12
- package/src/components/button/button.tsx +119 -29
- package/src/components/button-select/button-select.tsx +1 -2
- package/src/components/calendar/calendar-body.tsx +42 -28
- package/src/components/calendar/calendar.test.tsx +89 -0
- package/src/components/calendar/calendar.tsx +42 -4
- package/src/components/calendar/index.ts +2 -0
- package/src/components/camera/camera-machine.test.ts +188 -0
- package/src/components/camera/camera-machine.ts +274 -0
- package/src/components/camera/camera.test.tsx +580 -0
- package/src/components/camera/camera.tsx +938 -0
- package/src/components/camera/fake-camera.ts +153 -0
- package/src/components/camera/index.ts +36 -0
- package/src/components/camera/platform.test.ts +40 -0
- package/src/components/camera/platform.ts +53 -0
- package/src/components/camera/use-camera.ts +428 -0
- package/src/components/card/card.test.tsx +70 -0
- package/src/components/card/card.tsx +5 -2
- package/src/components/carousel/carousel.test.tsx +757 -0
- package/src/components/carousel/carousel.tsx +1115 -0
- package/src/components/carousel/index.ts +24 -0
- package/src/components/chart/chart.test.tsx +26 -0
- package/src/components/chart/chart.tsx +33 -3
- package/src/components/chart/styles.css +12 -10
- package/src/components/checkbox/checkbox.test.tsx +38 -1
- package/src/components/checkbox/checkbox.tsx +34 -10
- package/src/components/checkbox/control.ts +3 -3
- package/src/components/checkbox/index.ts +6 -1
- package/src/components/choice-card-group/choice-card-group.test.tsx +18 -0
- package/src/components/choice-card-group/choice-card-group.tsx +78 -58
- package/src/components/circular-progress/circular-progress.test.tsx +24 -5
- package/src/components/circular-progress/circular-progress.tsx +26 -3
- package/src/components/clipboard/clipboard.test.tsx +64 -5
- package/src/components/clipboard/clipboard.tsx +62 -16
- package/src/components/clipboard/copy.tsx +35 -20
- package/src/components/clipboard/index.ts +7 -1
- package/src/components/code/code.test.tsx +1 -1
- package/src/components/code/code.tsx +2 -1
- package/src/components/code-block/chrome.tsx +49 -53
- package/src/components/code-block/code-block.test.tsx +34 -13
- package/src/components/code-block/code-block.tsx +8 -9
- package/src/components/code-block/index.ts +4 -0
- package/src/components/code-block/static.tsx +8 -5
- package/src/components/combobox/combobox.tsx +14 -6
- package/src/components/combobox-list/combobox-list.test.tsx +54 -0
- package/src/components/combobox-list/combobox-list.tsx +57 -61
- package/src/components/combobox-list/combobox-search-row.tsx +92 -0
- package/src/components/combobox-list/index.ts +2 -0
- package/src/components/compare/compare.test.tsx +291 -0
- package/src/components/compare/compare.tsx +300 -0
- package/src/components/compare/index.ts +3 -0
- package/src/components/container/container.test.tsx +47 -0
- package/src/components/container/container.tsx +8 -2
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +24 -18
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +6 -3
- package/src/components/data-table/data-table-filter/index.tsx +34 -9
- package/src/components/data-table/data-table-filter.test.tsx +72 -0
- package/src/components/data-table/data-table-header-cell.tsx +75 -68
- package/src/components/data-table/data-table-icons.tsx +79 -0
- package/src/components/data-table/data-table-pagination.tsx +55 -19
- package/src/components/data-table/data-table-placeholder.tsx +2 -2
- package/src/components/data-table/data-table-stack.tsx +19 -25
- package/src/components/data-table/data-table-state.ts +4 -5
- package/src/components/data-table/data-table-toolbar.tsx +10 -3
- package/src/components/data-table/data-table-translations.ts +15 -3
- package/src/components/data-table/data-table.test.tsx +300 -13
- package/src/components/data-table/data-table.tsx +54 -21
- package/src/components/data-table/index.ts +5 -0
- package/src/components/date-picker/aliases.tsx +8 -0
- package/src/components/date-picker/date-picker.test.tsx +75 -0
- package/src/components/date-picker/date-picker.tsx +102 -51
- package/src/components/date-picker/date-time-text.test.ts +9 -0
- package/src/components/date-picker/date-time-text.ts +12 -4
- package/src/components/date-picker/index.ts +1 -0
- package/src/components/divider/divider.test.tsx +34 -5
- package/src/components/divider/divider.tsx +23 -6
- package/src/components/download-button/download-button.test.tsx +253 -0
- package/src/components/download-button/download-button.tsx +236 -0
- package/src/components/download-button/index.ts +11 -0
- package/src/components/drawer/drawer.test.tsx +287 -0
- package/src/components/drawer/drawer.tsx +238 -172
- package/src/components/drawer/index.ts +4 -11
- package/src/components/field/field.test.tsx +115 -0
- package/src/components/field/field.tsx +13 -4
- package/src/components/figure/figure.test.tsx +133 -0
- package/src/components/figure/figure.tsx +137 -0
- package/src/components/figure/index.ts +6 -0
- package/src/components/file-item/file-item.test.tsx +395 -0
- package/src/components/file-item/file-item.tsx +625 -0
- package/src/components/file-item/index.ts +22 -0
- package/src/components/file-preview/file-preview.test.tsx +479 -0
- package/src/components/file-preview/file-preview.tsx +953 -0
- package/src/components/file-preview/index.ts +22 -0
- package/src/components/file-queue-summary/file-queue-summary.test.tsx +285 -0
- package/src/components/file-queue-summary/file-queue-summary.tsx +121 -0
- package/src/components/file-queue-summary/index.ts +12 -0
- package/src/components/file-trigger/file-trigger.test.tsx +138 -0
- package/src/components/file-trigger/file-trigger.tsx +135 -0
- package/src/components/file-trigger/index.ts +3 -0
- package/src/components/file-upload/file-upload.test.tsx +416 -2
- package/src/components/file-upload/file-upload.tsx +391 -136
- package/src/components/file-upload/index.ts +11 -1
- package/src/components/flex/flex.test.tsx +15 -0
- package/src/components/flex/flex.tsx +20 -12
- package/src/components/gallery/gallery.test.tsx +436 -0
- package/src/components/gallery/gallery.tsx +367 -0
- package/src/components/gallery/index.ts +16 -0
- package/src/components/gallery/layout.test.ts +158 -0
- package/src/components/gallery/layout.ts +168 -0
- package/src/components/grid/grid.test.tsx +46 -0
- package/src/components/grid/grid.tsx +11 -11
- package/src/components/image/blur-svg.ts +54 -0
- package/src/components/image/image.test.tsx +481 -0
- package/src/components/image/image.tsx +424 -0
- package/src/components/image/index.ts +14 -0
- package/src/components/image/srcset.test.ts +73 -0
- package/src/components/image/srcset.ts +70 -0
- package/src/components/image-cropper/image-cropper.test.tsx +446 -0
- package/src/components/image-cropper/image-cropper.tsx +745 -0
- package/src/components/image-cropper/index.ts +24 -0
- package/src/components/indicator/indicator.test.tsx +73 -6
- package/src/components/indicator/indicator.tsx +38 -10
- package/src/components/input/input.tsx +6 -5
- package/src/components/kbd/index.ts +6 -0
- package/src/components/kbd/kbd.test.tsx +239 -2
- package/src/components/kbd/kbd.tsx +130 -6
- package/src/components/lightbox/index.ts +25 -0
- package/src/components/lightbox/lightbox-controller.ts +796 -0
- package/src/components/lightbox/lightbox-machine.test.ts +460 -0
- package/src/components/lightbox/lightbox-machine.ts +285 -0
- package/src/components/lightbox/lightbox-zoom.test.ts +130 -0
- package/src/components/lightbox/lightbox-zoom.ts +142 -0
- package/src/components/lightbox/lightbox.test.tsx +821 -0
- package/src/components/lightbox/lightbox.tsx +1301 -0
- package/src/components/mark/mark.test.tsx +21 -2
- package/src/components/mark/mark.tsx +15 -1
- package/src/components/menu/index.ts +4 -0
- package/src/components/menu/menu-data.tsx +20 -17
- package/src/components/menu/menu.test.tsx +123 -19
- package/src/components/menu/menu.tsx +150 -102
- package/src/components/modal/close-trigger.test.tsx +49 -0
- package/src/components/modal/index.ts +2 -0
- package/src/components/modal/modal.test.tsx +101 -0
- package/src/components/modal/modal.tsx +64 -103
- package/src/components/multi-combobox-list/index.ts +2 -0
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +45 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +45 -62
- package/src/components/multi-select/multi-select.test.tsx +10 -2
- package/src/components/multi-select/multi-select.tsx +20 -18
- package/src/components/nav-link/nav-link.test.tsx +43 -0
- package/src/components/nav-link/nav-link.tsx +34 -15
- package/src/components/nav-link/navigation.test.tsx +29 -1
- package/src/components/nav-link/navigation.tsx +45 -22
- package/src/components/notification/create-notifier.tsx +79 -13
- package/src/components/notification/index.ts +2 -0
- package/src/components/notification/notification.test.tsx +252 -1
- package/src/components/notification/notification.tsx +102 -58
- package/src/components/number-input/index.ts +7 -1
- package/src/components/number-input/number-input.test.tsx +45 -0
- package/src/components/number-input/number-input.tsx +34 -27
- package/src/components/overlays/create-overlays.tsx +18 -21
- package/src/components/overlays/dialog-parts.tsx +201 -0
- package/src/components/overlays/overlays.test.tsx +170 -0
- package/src/components/overlays/renderer.tsx +2 -9
- package/src/components/overlays/store.ts +4 -1
- package/src/components/password-input/index.ts +2 -0
- package/src/components/password-input/password-input.test.tsx +30 -0
- package/src/components/password-input/password-input.tsx +17 -3
- package/src/components/photo-capture/index.ts +35 -0
- package/src/components/photo-capture/photo-capture-machine.test.ts +147 -0
- package/src/components/photo-capture/photo-capture-machine.ts +112 -0
- package/src/components/photo-capture/photo-capture.test.tsx +375 -0
- package/src/components/photo-capture/photo-capture.tsx +665 -0
- package/src/components/photo-capture/use-photo-capture.ts +199 -0
- package/src/components/pill/pill.test.tsx +58 -1
- package/src/components/pill/pill.tsx +34 -16
- package/src/components/pills-input/index.ts +1 -0
- package/src/components/pills-input/pills-input.test.ts +14 -14
- package/src/components/pills-input/pills-input.test.tsx +39 -0
- package/src/components/pills-input/pills-input.tsx +70 -32
- package/src/components/pin-input/index.ts +1 -1
- package/src/components/pin-input/pin-input.test.tsx +28 -0
- package/src/components/pin-input/pin-input.tsx +64 -16
- package/src/components/popover/icons.tsx +16 -12
- package/src/components/popover/popover.test.tsx +11 -0
- package/src/components/popover/popover.tsx +21 -11
- package/src/components/progress/progress.test.tsx +17 -5
- package/src/components/progress/progress.tsx +23 -7
- package/src/components/radio-group/radio-group.test.tsx +21 -1
- package/src/components/radio-group/radio-group.tsx +66 -48
- package/src/components/rating/icons.tsx +4 -2
- package/src/components/rating/index.ts +2 -0
- package/src/components/rating/rating.test.tsx +43 -4
- package/src/components/rating/rating.tsx +29 -13
- package/src/components/schedule/index.ts +4 -1
- package/src/components/schedule/now-cursor-line.test.tsx +6 -6
- package/src/components/schedule/now-cursor-line.tsx +29 -15
- package/src/components/schedule/schedule-a11y.test.tsx +847 -0
- package/src/components/schedule/schedule-agenda-list.tsx +25 -44
- package/src/components/schedule/schedule-agenda-view.test.tsx +2 -2
- package/src/components/schedule/schedule-agenda-view.tsx +22 -37
- package/src/components/schedule/schedule-all-day-row.tsx +35 -96
- package/src/components/schedule/schedule-create-draft.tsx +23 -90
- package/src/components/schedule/schedule-dates.test.ts +64 -20
- package/src/components/schedule/schedule-dates.ts +65 -27
- package/src/components/schedule/schedule-day-column.tsx +607 -0
- package/src/components/schedule/schedule-days-view.tsx +40 -49
- package/src/components/schedule/schedule-details-popover.test.tsx +97 -0
- package/src/components/schedule/schedule-drag-ghost.tsx +30 -98
- package/src/components/schedule/schedule-event-chip.tsx +120 -262
- package/src/components/schedule/schedule-event-details-popover.tsx +132 -0
- package/src/components/schedule/schedule-event-details.tsx +6 -7
- package/src/components/schedule/schedule-event-list-popover-content.tsx +9 -5
- package/src/components/schedule/schedule-event-pill.tsx +159 -0
- package/src/components/schedule/schedule-event-styles.ts +71 -0
- package/src/components/schedule/schedule-geometry.test.ts +5 -5
- package/src/components/schedule/schedule-geometry.ts +16 -13
- package/src/components/schedule/schedule-grid-gesture.test.ts +99 -0
- package/src/components/schedule/schedule-grid-gesture.ts +50 -12
- package/src/components/schedule/schedule-icons.test.tsx +105 -0
- package/src/components/schedule/schedule-icons.tsx +40 -0
- package/src/components/schedule/schedule-month-view.test.tsx +118 -2
- package/src/components/schedule/schedule-month-view.tsx +258 -200
- package/src/components/schedule/schedule-overflow-chip.tsx +9 -4
- package/src/components/schedule/schedule-overflow-popover.tsx +5 -0
- package/src/components/schedule/schedule-slot-cursor.tsx +422 -0
- package/src/components/schedule/schedule-timed-grid-chrome.tsx +330 -0
- package/src/components/schedule/schedule-timed-grid.tsx +222 -893
- package/src/components/schedule/schedule-toolbar.tsx +108 -60
- package/src/components/schedule/schedule-types.test.ts +43 -2
- package/src/components/schedule/schedule-types.ts +164 -17
- package/src/components/schedule/schedule-view-pagination-chrome.tsx +101 -0
- package/src/components/schedule/schedule-year-view.test.tsx +86 -1
- package/src/components/schedule/schedule-year-view.tsx +163 -136
- package/src/components/schedule/schedule.test.tsx +275 -7
- package/src/components/schedule/schedule.tsx +36 -242
- package/src/components/schedule/use-chip-keyboard-move.ts +109 -0
- package/src/components/schedule/use-chip-motion.ts +71 -0
- package/src/components/schedule/use-date-grid-navigation.ts +120 -0
- package/src/components/schedule/use-event-drag.ts +1 -23
- package/src/components/schedule/use-event-resize.ts +27 -22
- package/src/components/schedule/use-schedule-reveal.ts +259 -0
- package/src/components/schedule/use-schedule-selection.ts +14 -2
- package/src/components/schedule/use-timed-grid-announcer.test.ts +72 -0
- package/src/components/schedule/use-timed-grid-announcer.ts +42 -0
- package/src/components/schedule/use-timed-grid-paging.ts +118 -0
- package/src/components/segment-group/segment-group.test.tsx +27 -5
- package/src/components/segment-group/segment-group.tsx +35 -28
- package/src/components/select/select.tsx +8 -8
- package/src/components/skeleton/skeleton.tsx +1 -1
- package/src/components/slider/slider.test.tsx +56 -5
- package/src/components/slider/slider.tsx +93 -31
- package/src/components/spinner/spinner.test.tsx +34 -10
- package/src/components/spinner/spinner.tsx +52 -49
- package/src/components/spotlight/context.ts +62 -0
- package/src/components/spotlight/create-spotlight.test.tsx +252 -0
- package/src/components/spotlight/create-spotlight.tsx +515 -0
- package/src/components/spotlight/highlight.test.ts +57 -0
- package/src/components/spotlight/highlight.ts +86 -0
- package/src/components/spotlight/icons.tsx +27 -0
- package/src/components/spotlight/index.ts +68 -0
- package/src/components/spotlight/label.ts +10 -0
- package/src/components/spotlight/recents.test.ts +46 -0
- package/src/components/spotlight/recents.ts +54 -0
- package/src/components/spotlight/spotlight-engine.test.ts +836 -0
- package/src/components/spotlight/spotlight-engine.ts +525 -0
- package/src/components/spotlight/spotlight.test.tsx +2532 -0
- package/src/components/spotlight/spotlight.tsx +1429 -0
- package/src/components/spotlight/static-source.test.ts +71 -0
- package/src/components/spotlight/static-source.ts +62 -0
- package/src/components/spotlight/store.test.ts +122 -0
- package/src/components/spotlight/store.ts +130 -0
- package/src/components/spotlight/translations.ts +124 -0
- package/src/components/spotlight/types.ts +308 -0
- package/src/components/spotlight/view.test.ts +216 -0
- package/src/components/spotlight/view.ts +350 -0
- package/src/components/switch/switch.test.tsx +8 -0
- package/src/components/switch/switch.tsx +12 -8
- package/src/components/table/table.test.tsx +35 -0
- package/src/components/table/table.tsx +28 -4
- package/src/components/tabs/tabs-data.tsx +7 -2
- package/src/components/tabs/tabs.test.tsx +211 -50
- package/src/components/tabs/tabs.tsx +309 -120
- package/src/components/tags-input/tags-input.test.tsx +116 -2
- package/src/components/tags-input/tags-input.tsx +51 -31
- package/src/components/text/text.test.tsx +1 -1
- package/src/components/text/text.tsx +1 -4
- package/src/components/theme-icon/theme-icon.tsx +2 -2
- package/src/components/theme-script/theme-script.test.tsx +52 -0
- package/src/components/theme-script/theme-script.tsx +1 -1
- package/src/components/time-input/hour-cycle.test.ts +37 -0
- package/src/components/time-input/hour-cycle.ts +37 -10
- package/src/components/time-input/time-input.test.tsx +34 -0
- package/src/components/time-input/time-input.tsx +12 -14
- package/src/components/time-input/time-row.test.ts +10 -0
- package/src/components/time-input/time-row.tsx +39 -19
- package/src/components/timeline/index.ts +1 -0
- package/src/components/timeline/timeline.test.tsx +39 -4
- package/src/components/timeline/timeline.tsx +43 -7
- package/src/components/title/title.test.tsx +3 -3
- package/src/components/title/title.tsx +2 -1
- package/src/components/tooltip/tooltip.test.tsx +38 -5
- package/src/components/tooltip/tooltip.tsx +17 -17
- package/src/components/tree-multi-select/index.ts +2 -0
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +137 -3
- package/src/components/tree-multi-select/tree-multi-select.tsx +130 -332
- package/src/components/tree-select/index.ts +7 -1
- package/src/components/tree-select/tree-popover.tsx +484 -0
- package/src/components/tree-select/tree-select.test.tsx +93 -1
- package/src/components/tree-select/tree-select.tsx +117 -415
- package/src/icon-stroke.test.tsx +114 -0
- package/src/index.ts +71 -0
- package/src/lib/as-child.ts +1 -1
- package/src/lib/cn.test.ts +14 -2
- package/src/lib/cutout.test.ts +37 -0
- package/src/lib/cutout.ts +56 -0
- package/src/lib/dev-warn.test.ts +89 -0
- package/src/lib/dev-warn.ts +61 -12
- package/src/lib/file-kind-icons.tsx +29 -0
- package/src/lib/file-queue-summary.test.ts +323 -0
- package/src/lib/file-queue-summary.ts +239 -0
- package/src/lib/file-queue.ts +493 -0
- package/src/lib/files.test.ts +72 -0
- package/src/lib/files.ts +211 -0
- package/src/lib/focus-styles.test.ts +97 -1
- package/src/lib/focus-styles.ts +153 -9
- package/src/lib/gap.ts +17 -0
- package/src/lib/graphemes.test.ts +26 -0
- package/src/lib/graphemes.ts +19 -0
- package/src/lib/icons.test.ts +22 -0
- package/src/lib/icons.ts +40 -0
- package/src/lib/image-file.test.ts +18 -0
- package/src/lib/image-file.ts +21 -0
- package/src/lib/merge-refs.test.tsx +79 -0
- package/src/lib/merge-refs.ts +58 -11
- package/src/lib/motion/animate.test.ts +114 -0
- package/src/lib/motion/animate.ts +88 -0
- package/src/lib/motion/easing.test.ts +57 -0
- package/src/lib/motion/easing.ts +107 -0
- package/src/lib/motion/gesture.test.ts +183 -0
- package/src/lib/motion/gesture.ts +300 -0
- package/src/lib/motion/morph.test.ts +93 -0
- package/src/lib/motion/morph.ts +88 -0
- package/src/lib/motion/physics.test.ts +75 -0
- package/src/lib/motion/physics.ts +61 -0
- package/src/lib/motion/rect.test.ts +52 -0
- package/src/lib/motion/rect.ts +67 -0
- package/src/lib/motion/reduced-motion.test.ts +57 -0
- package/src/lib/motion/reduced-motion.ts +34 -0
- package/src/lib/motion/spring.test.ts +93 -0
- package/src/lib/motion/spring.ts +143 -0
- package/src/lib/motion/tokens.ts +48 -0
- package/src/lib/motion/use-gesture.test.tsx +111 -0
- package/src/lib/motion/use-gesture.ts +133 -0
- package/src/lib/open-file.test.ts +275 -0
- package/src/lib/open-file.ts +351 -0
- package/src/lib/open-index.test.tsx +95 -0
- package/src/lib/open-index.tsx +90 -0
- package/src/lib/overlay-layer.test.tsx +32 -13
- package/src/lib/overlay-layer.tsx +25 -3
- package/src/lib/radius.ts +17 -0
- package/src/lib/ratio.test.ts +31 -0
- package/src/lib/ratio.ts +26 -0
- package/src/lib/save-file.test.ts +91 -0
- package/src/lib/save-file.ts +91 -0
- package/src/lib/select-data.test.tsx +123 -0
- package/src/lib/select-data.ts +130 -44
- package/src/lib/tree-data.ts +9 -4
- package/src/lib/typography-size.ts +28 -8
- package/src/lib/use-container-query.ts +4 -4
- package/src/lib/use-debounced.test.ts +105 -0
- package/src/lib/use-debounced.ts +44 -0
- package/src/lib/use-disclosure.ts +6 -1
- package/src/lib/use-document-visibility.test.tsx +46 -0
- package/src/lib/use-document-visibility.ts +37 -0
- package/src/lib/use-element-size.test.ts +142 -0
- package/src/lib/use-element-size.ts +87 -0
- package/src/lib/use-file-queue.test.tsx +774 -0
- package/src/lib/use-file-queue.ts +114 -0
- package/src/lib/use-hotkey.test.tsx +667 -0
- package/src/lib/use-hotkey.ts +562 -0
- package/src/lib/use-hydrated.test.tsx +43 -0
- package/src/lib/use-hydrated.ts +27 -0
- package/src/lib/use-in-view.test.ts +113 -0
- package/src/lib/use-in-view.ts +69 -0
- package/src/lib/use-now.test.tsx +65 -0
- package/src/lib/use-now.ts +37 -14
- package/src/lib/use-object-url.test.ts +195 -0
- package/src/lib/use-object-url.ts +108 -0
- package/src/lib/use-uncontrolled.test.ts +34 -2
- package/src/lib/use-uncontrolled.ts +7 -2
- package/src/test-setup.ts +65 -1
- package/src/theme.css +184 -16
- package/src/theme.forced-colors.test.tsx +152 -0
- package/src/theme.test.ts +34 -0
- package/src/visually-hidden-containment.test.tsx +32 -0
- package/dist/chunk-2GILNBZW.js +0 -31
- package/dist/chunk-2GILNBZW.js.map +0 -1
- package/dist/chunk-2NNZHVKD.js.map +0 -1
- package/dist/chunk-4NNGTNPV.js.map +0 -1
- package/dist/chunk-64T6Z7BA.js.map +0 -1
- package/dist/chunk-A6MYJTJI.js.map +0 -1
- package/dist/chunk-AIQG7IIT.js.map +0 -1
- package/dist/chunk-BEL75C7N.js.map +0 -1
- package/dist/chunk-CHTN5AHI.js.map +0 -1
- package/dist/chunk-CSCVTESP.js.map +0 -1
- package/dist/chunk-CTSO6V72.js.map +0 -1
- package/dist/chunk-CYWMES5P.js.map +0 -1
- package/dist/chunk-CZEKZ5HR.js.map +0 -1
- package/dist/chunk-DBTJEBMO.js +0 -291
- package/dist/chunk-DBTJEBMO.js.map +0 -1
- package/dist/chunk-FAOBC4IS.js.map +0 -1
- package/dist/chunk-FOMR74VE.js.map +0 -1
- package/dist/chunk-GCGX4FEF.js.map +0 -1
- package/dist/chunk-HCYULRWT.js.map +0 -1
- package/dist/chunk-I4SQQIP5.js.map +0 -1
- package/dist/chunk-IG7FBZVM.js.map +0 -1
- package/dist/chunk-INJUILCN.js +0 -31
- package/dist/chunk-INJUILCN.js.map +0 -1
- package/dist/chunk-IRXZHLUL.js.map +0 -1
- package/dist/chunk-K5UWVH6P.js.map +0 -1
- package/dist/chunk-LM6F6DLR.js.map +0 -1
- package/dist/chunk-MQO42HZL.js +0 -223
- package/dist/chunk-MQO42HZL.js.map +0 -1
- package/dist/chunk-OC7I2CTA.js +0 -8
- package/dist/chunk-OC7I2CTA.js.map +0 -1
- package/dist/chunk-OGJFDNIS.js.map +0 -1
- package/dist/chunk-P3XMBETI.js.map +0 -1
- package/dist/chunk-PINENGML.js.map +0 -1
- package/dist/chunk-PS2PZFXH.js +0 -84
- package/dist/chunk-PS2PZFXH.js.map +0 -1
- package/dist/chunk-QIDAXFKK.js.map +0 -1
- package/dist/chunk-RIP5G47F.js.map +0 -1
- package/dist/chunk-RKYXG6X7.js.map +0 -1
- package/dist/chunk-SVKU3GUN.js.map +0 -1
- package/dist/chunk-TBTSEPGP.js.map +0 -1
- package/dist/chunk-TWGCWKRV.js +0 -44
- package/dist/chunk-TWGCWKRV.js.map +0 -1
- package/dist/chunk-UJZIF2BA.js.map +0 -1
- package/dist/chunk-UVYTJQTJ.js +0 -14
- package/dist/chunk-UVYTJQTJ.js.map +0 -1
- package/dist/chunk-VZBUQNLX.js.map +0 -1
- package/dist/chunk-VZH6TS7M.js.map +0 -1
- package/dist/chunk-WJOHNCYY.js.map +0 -1
- package/dist/chunk-WZB6LPQI.js +0 -47
- package/dist/chunk-WZB6LPQI.js.map +0 -1
- package/dist/chunk-YKUCSV34.js.map +0 -1
- package/dist/chunk-YQHOKMSV.js.map +0 -1
- package/dist/chunk-YW6Q6ERX.js.map +0 -1
- package/dist/chunk-YWRBG23W.js.map +0 -1
- package/dist/chunk-Z43YWH4R.js.map +0 -1
- package/dist/chunk-Z6RPMRFH.js.map +0 -1
- package/dist/components/slider/sliderThumb.d.ts +0 -1
- package/dist/components/slider/sliderThumb.d.ts.map +0 -1
- package/src/components/slider/sliderThumb.tsx +0 -0
|
@@ -0,0 +1,1695 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Modal } from '../../chunk-HBFN5W7Q.js';
|
|
3
|
+
import { Kbd } from '../../chunk-HEQ2H6VO.js';
|
|
4
|
+
import { Pill } from '../../chunk-2TM7UVM2.js';
|
|
5
|
+
import { Mark } from '../../chunk-FXDLS23K.js';
|
|
6
|
+
import { Skeleton } from '../../chunk-GGT4GJD6.js';
|
|
7
|
+
import '../../chunk-4EU6FGGB.js';
|
|
8
|
+
import { Combobox } from '../../chunk-P276SCCV.js';
|
|
9
|
+
import '../../chunk-7R4CDHBK.js';
|
|
10
|
+
import '../../chunk-45DFYIK5.js';
|
|
11
|
+
import { useLocalStorage, useInView } from '../../chunk-HC4XVBP2.js';
|
|
12
|
+
import { useHotkey, KBD_DEFAULT_TRANSLATIONS } from '../../chunk-FUNTJZX7.js';
|
|
13
|
+
import { observeResize } from '../../chunk-2LI3VPDP.js';
|
|
14
|
+
import { useLinkComponent } from '../../chunk-GTKKRV5N.js';
|
|
15
|
+
import { popoverOption, popoverGroupLabel, popoverEmpty } from '../../chunk-ZN3WYGIQ.js';
|
|
16
|
+
import '../../chunk-7P32XCEU.js';
|
|
17
|
+
import '../../chunk-H7WOMZXO.js';
|
|
18
|
+
import '../../chunk-LJ3GHC4V.js';
|
|
19
|
+
import { devWarn } from '../../chunk-6N6J2DOE.js';
|
|
20
|
+
import '../../chunk-PMUCGFY5.js';
|
|
21
|
+
import { useIsomorphicLayoutEffect } from '../../chunk-BUIHQJGE.js';
|
|
22
|
+
import '../../chunk-ZFUTGBJC.js';
|
|
23
|
+
import { iconStroke, mergeIcons } from '../../chunk-XXOR34T4.js';
|
|
24
|
+
import '../../chunk-HVOEVB4E.js';
|
|
25
|
+
import { composeChildren } from '../../chunk-R5LYFTHA.js';
|
|
26
|
+
import { props } from '../../chunk-WYCMIIRR.js';
|
|
27
|
+
import '../../chunk-3REFDGOM.js';
|
|
28
|
+
import { TEXT_COLOR_CLASSES } from '../../chunk-GIPQUKCN.js';
|
|
29
|
+
import { cn } from '../../chunk-QP4I37PA.js';
|
|
30
|
+
import { createContext, useMemo, useRef, useState, useEffect, Fragment as Fragment$1, useSyncExternalStore, useContext } from 'react';
|
|
31
|
+
import { ChevronRightIcon, SearchXIcon, SearchIcon } from 'lucide-react';
|
|
32
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
33
|
+
import { ark } from '@ark-ui/react';
|
|
34
|
+
import { createListCollection, Combobox as Combobox$1, useComboboxContext } from '@ark-ui/react/combobox';
|
|
35
|
+
|
|
36
|
+
var SpotlightContext = createContext(null);
|
|
37
|
+
var useSpotlightContext = () => {
|
|
38
|
+
const context = useContext(SpotlightContext);
|
|
39
|
+
if (!context) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
"[Spotlight] The Spotlight parts render inside the <SpotlightProvider> that createSpotlight returns."
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return context;
|
|
45
|
+
};
|
|
46
|
+
var chevron = /* @__PURE__ */ jsx(ChevronRightIcon, { "aria-hidden": true, className: cn(iconStroke, "size-4 rtl:-scale-x-100") });
|
|
47
|
+
var DEFAULT_ICONS = {
|
|
48
|
+
search: /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true, className: iconStroke }),
|
|
49
|
+
enter: chevron,
|
|
50
|
+
seeAll: chevron,
|
|
51
|
+
empty: /* @__PURE__ */ jsx(SearchXIcon, { "aria-hidden": true, className: iconStroke })
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// src/components/spotlight/recents.ts
|
|
55
|
+
var toRecent = (source, item) => {
|
|
56
|
+
const listed = source.items?.some(({ id }) => id === item.id) ?? false;
|
|
57
|
+
if (!listed && item.link === void 0) return void 0;
|
|
58
|
+
const recent = {
|
|
59
|
+
source: source.id,
|
|
60
|
+
id: item.id,
|
|
61
|
+
title: item.title,
|
|
62
|
+
...item.group !== void 0 && { group: item.group }
|
|
63
|
+
};
|
|
64
|
+
return item.link === void 0 ? recent : { ...recent, link: item.link };
|
|
65
|
+
};
|
|
66
|
+
var fromRecent = (recent, sources) => {
|
|
67
|
+
const listed = sources.find(({ id: id2 }) => id2 === recent.source)?.items?.find(({ id: id2 }) => id2 === recent.id);
|
|
68
|
+
if (listed) return listed;
|
|
69
|
+
const { id, title, link } = recent;
|
|
70
|
+
return link === void 0 ? void 0 : { id, title, link };
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// src/components/spotlight/highlight.ts
|
|
74
|
+
var fold = (text) => text.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase();
|
|
75
|
+
var foldWithOffsets = (text) => Array.from(text).reduce(
|
|
76
|
+
(acc, char) => {
|
|
77
|
+
const folded = fold(char);
|
|
78
|
+
return {
|
|
79
|
+
folded: acc.folded + folded,
|
|
80
|
+
starts: [...acc.starts, ...Array.from(folded, () => acc.offset)],
|
|
81
|
+
offset: acc.offset + char.length
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
{ folded: "", starts: [], offset: 0 }
|
|
85
|
+
);
|
|
86
|
+
var escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
87
|
+
var mergeRanges = (ranges, length) => ranges.map(([start, end]) => [Math.max(0, start), Math.min(length, end)]).filter(([start, end]) => start < end).sort((a, b) => a[0] - b[0]).reduce((merged, range) => {
|
|
88
|
+
const last = merged.at(-1);
|
|
89
|
+
if (last && range[0] <= last[1]) merged.splice(-1, 1, [last[0], Math.max(last[1], range[1])]);
|
|
90
|
+
else merged.push(range);
|
|
91
|
+
return merged;
|
|
92
|
+
}, []);
|
|
93
|
+
var matchRanges = (text, query) => {
|
|
94
|
+
const words = fold(query).split(/\s+/).filter(Boolean);
|
|
95
|
+
if (words.length === 0) return [];
|
|
96
|
+
const { folded, starts } = foldWithOffsets(text);
|
|
97
|
+
const ranges = words.flatMap(
|
|
98
|
+
(word) => [...folded.matchAll(new RegExp(escapeRegExp(word), "g"))].map(
|
|
99
|
+
({ index }) => [
|
|
100
|
+
starts[index] ?? text.length,
|
|
101
|
+
starts[index + word.length] ?? text.length
|
|
102
|
+
]
|
|
103
|
+
)
|
|
104
|
+
);
|
|
105
|
+
return mergeRanges(ranges, text.length);
|
|
106
|
+
};
|
|
107
|
+
var segment = (text, ranges) => {
|
|
108
|
+
const merged = mergeRanges(ranges, text.length);
|
|
109
|
+
const { segments, end } = merged.reduce(
|
|
110
|
+
(acc, [start, stop]) => ({
|
|
111
|
+
segments: [
|
|
112
|
+
...acc.segments,
|
|
113
|
+
...start > acc.end ? [{ text: text.slice(acc.end, start), marked: false }] : [],
|
|
114
|
+
{ text: text.slice(start, stop), marked: true }
|
|
115
|
+
],
|
|
116
|
+
end: stop
|
|
117
|
+
}),
|
|
118
|
+
{ segments: [], end: 0 }
|
|
119
|
+
);
|
|
120
|
+
return end < text.length ? [...segments, { text: text.slice(end), marked: false }] : segments;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/components/spotlight/label.ts
|
|
124
|
+
var resolveLabel = (label) => typeof label === "function" ? label() : label;
|
|
125
|
+
|
|
126
|
+
// src/components/spotlight/store.ts
|
|
127
|
+
var groupsOf = ({
|
|
128
|
+
source,
|
|
129
|
+
status,
|
|
130
|
+
error,
|
|
131
|
+
items
|
|
132
|
+
}) => {
|
|
133
|
+
const configOf = (key) => key === void 0 ? void 0 : source.groups?.[key];
|
|
134
|
+
const group = (key) => ({
|
|
135
|
+
key: key === void 0 ? source.id : `${source.id}:${key}`,
|
|
136
|
+
...key !== void 0 && { group: key },
|
|
137
|
+
label: configOf(key)?.label ?? key ?? source.label,
|
|
138
|
+
icon: configOf(key)?.icon ?? source.icon,
|
|
139
|
+
source,
|
|
140
|
+
status,
|
|
141
|
+
error,
|
|
142
|
+
items: items.filter((item) => item.group === key)
|
|
143
|
+
});
|
|
144
|
+
const keys = [...new Set(items.map((item) => item.group))].map((key) => ({ key, order: configOf(key)?.order ?? 0 })).sort((a, b) => a.order - b.order);
|
|
145
|
+
if (keys.length > 0) return keys.map(({ key }) => group(key));
|
|
146
|
+
return status === "loading" || status === "error" ? [group()] : [];
|
|
147
|
+
};
|
|
148
|
+
var nextFrame = (fn) => {
|
|
149
|
+
if (typeof requestAnimationFrame === "function") {
|
|
150
|
+
const id2 = requestAnimationFrame(fn);
|
|
151
|
+
return () => cancelAnimationFrame(id2);
|
|
152
|
+
}
|
|
153
|
+
const id = setTimeout(fn, 16);
|
|
154
|
+
return () => clearTimeout(id);
|
|
155
|
+
};
|
|
156
|
+
function createSpotlightStore(initial) {
|
|
157
|
+
const groups = /* @__PURE__ */ new WeakMap();
|
|
158
|
+
const snapshots = /* @__PURE__ */ new WeakMap();
|
|
159
|
+
const derive = (draft2) => {
|
|
160
|
+
const cached = snapshots.get(draft2);
|
|
161
|
+
if (cached) return cached;
|
|
162
|
+
const snapshot2 = {
|
|
163
|
+
...draft2,
|
|
164
|
+
groups: draft2.sources.flatMap((state) => {
|
|
165
|
+
const own = groups.get(state) ?? groupsOf(state);
|
|
166
|
+
groups.set(state, own);
|
|
167
|
+
return own;
|
|
168
|
+
})
|
|
169
|
+
};
|
|
170
|
+
snapshots.set(draft2, snapshot2);
|
|
171
|
+
return snapshot2;
|
|
172
|
+
};
|
|
173
|
+
let draft = initial;
|
|
174
|
+
let snapshot = derive(initial);
|
|
175
|
+
const server = snapshot;
|
|
176
|
+
let cancel;
|
|
177
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
178
|
+
const publish = () => {
|
|
179
|
+
cancel?.();
|
|
180
|
+
cancel = void 0;
|
|
181
|
+
const next = derive(draft);
|
|
182
|
+
if (next === snapshot) return;
|
|
183
|
+
snapshot = next;
|
|
184
|
+
listeners.forEach((listener) => {
|
|
185
|
+
listener();
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
return {
|
|
189
|
+
subscribe(listener) {
|
|
190
|
+
listeners.add(listener);
|
|
191
|
+
return () => {
|
|
192
|
+
listeners.delete(listener);
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
getSnapshot: () => snapshot,
|
|
196
|
+
getServerSnapshot: () => server,
|
|
197
|
+
peek: () => derive(draft),
|
|
198
|
+
get: () => draft,
|
|
199
|
+
set(next) {
|
|
200
|
+
draft = next;
|
|
201
|
+
cancel ??= nextFrame(publish);
|
|
202
|
+
},
|
|
203
|
+
flush: publish
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// src/components/spotlight/spotlight-engine.ts
|
|
208
|
+
var LIMIT = { unscoped: 5, scoped: 20 };
|
|
209
|
+
var DEBOUNCE = 150;
|
|
210
|
+
var sourceLimit = (source, kind, defaults) => (typeof source.limit === "number" ? source.limit : source.limit?.[kind]) ?? defaults?.[kind] ?? LIMIT[kind];
|
|
211
|
+
var scopeOf = (path) => {
|
|
212
|
+
const last = path.at(-1);
|
|
213
|
+
return last?.item === void 0 ? last : void 0;
|
|
214
|
+
};
|
|
215
|
+
var sameFrame = (a, b) => a.source === b.source && a.group === b.group && a.item?.id === b.item?.id;
|
|
216
|
+
var idle = (source) => ({
|
|
217
|
+
source,
|
|
218
|
+
status: "idle",
|
|
219
|
+
items: []
|
|
220
|
+
});
|
|
221
|
+
var isStream = (value) => Symbol.asyncIterator in value;
|
|
222
|
+
var isPromise = (value) => "then" in value;
|
|
223
|
+
var assign = (link) => {
|
|
224
|
+
if (typeof link !== "object" || link === null || !("href" in link)) return;
|
|
225
|
+
if (typeof link.href === "string" && typeof window !== "undefined")
|
|
226
|
+
window.location.assign(link.href);
|
|
227
|
+
};
|
|
228
|
+
var compare = (a, b) => (a.source.order ?? 0) - (b.source.order ?? 0) || Number(b.contextual) - Number(a.contextual) || a.seq - b.seq;
|
|
229
|
+
var levelOf = (sources) => new Map(sources.map((source, seq) => [source.id, { source, contextual: false, seq }]));
|
|
230
|
+
var samePath = (a, b) => a.length === b.length && a.every((frame, index) => {
|
|
231
|
+
const other = b[index];
|
|
232
|
+
return other !== void 0 && sameFrame(frame, other);
|
|
233
|
+
});
|
|
234
|
+
function createSpotlightEngine(sources, options = {}) {
|
|
235
|
+
const root = levelOf(sources);
|
|
236
|
+
let seq = root.size;
|
|
237
|
+
let level = root;
|
|
238
|
+
const levels = /* @__PURE__ */ new WeakMap();
|
|
239
|
+
const presets = [];
|
|
240
|
+
const store = createSpotlightStore({
|
|
241
|
+
open: false,
|
|
242
|
+
query: "",
|
|
243
|
+
path: [],
|
|
244
|
+
trail: [],
|
|
245
|
+
sources: [...root.values()].sort(compare).map(({ source }) => idle(source))
|
|
246
|
+
});
|
|
247
|
+
const write = (recipe) => {
|
|
248
|
+
const draft = store.get();
|
|
249
|
+
store.set({ ...draft, ...recipe(draft) });
|
|
250
|
+
};
|
|
251
|
+
const patch = (id, partial) => {
|
|
252
|
+
write(({ sources: sources2 }) => ({
|
|
253
|
+
sources: sources2.map((state) => state.source.id === id ? { ...state, ...partial } : state)
|
|
254
|
+
}));
|
|
255
|
+
};
|
|
256
|
+
const stateOf = (id) => store.get().sources.find((state) => state.source.id === id);
|
|
257
|
+
const searched = (id) => {
|
|
258
|
+
const scope = scopeOf(store.get().path);
|
|
259
|
+
return scope === void 0 || scope.source === id;
|
|
260
|
+
};
|
|
261
|
+
const levelFor = (frame, source) => {
|
|
262
|
+
const cached = levels.get(frame);
|
|
263
|
+
if (cached?.source === source) return cached.level;
|
|
264
|
+
const next = levelOf(frame.item === void 0 ? [] : source.within?.(frame.item) ?? []);
|
|
265
|
+
levels.set(frame, { source, level: next });
|
|
266
|
+
return next;
|
|
267
|
+
};
|
|
268
|
+
const resolve = (path) => {
|
|
269
|
+
const walk = { level: root, path: [], trail: [] };
|
|
270
|
+
path.every((frame) => {
|
|
271
|
+
const source = walk.level.get(frame.source)?.source;
|
|
272
|
+
if (!source || frame.item !== void 0 && !source.within) return false;
|
|
273
|
+
if (frame.item !== void 0) {
|
|
274
|
+
const last = walk.path.at(-1);
|
|
275
|
+
if (last?.item === void 0 && last?.source === frame.source) {
|
|
276
|
+
walk.path.pop();
|
|
277
|
+
walk.trail.pop();
|
|
278
|
+
}
|
|
279
|
+
walk.level = levelFor(frame, source);
|
|
280
|
+
}
|
|
281
|
+
walk.path.push(frame);
|
|
282
|
+
walk.trail.push(source);
|
|
283
|
+
return true;
|
|
284
|
+
});
|
|
285
|
+
return walk;
|
|
286
|
+
};
|
|
287
|
+
const warned = /* @__PURE__ */ new Set();
|
|
288
|
+
const checkGroups = (source, items) => {
|
|
289
|
+
const missing = items.flatMap(
|
|
290
|
+
({ group }) => group === void 0 || source.groups?.[group] ? [] : [group]
|
|
291
|
+
);
|
|
292
|
+
new Set(missing).forEach((group) => {
|
|
293
|
+
const key = `${source.id}:${group}`;
|
|
294
|
+
if (warned.has(key)) return;
|
|
295
|
+
warned.add(key);
|
|
296
|
+
devWarn(
|
|
297
|
+
`[Spotlight] The source "${source.id}" has items in the group "${group}", which its \`groups\` doesn't declare; the key is shown as its label.`
|
|
298
|
+
);
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
const live = (entry, run) => entry.run === run;
|
|
302
|
+
const reorder = () => {
|
|
303
|
+
write(({ sources: states }) => ({
|
|
304
|
+
sources: [...level.values()].sort(compare).map(({ source }) => states.find((state) => state.source === source) ?? idle(source))
|
|
305
|
+
}));
|
|
306
|
+
};
|
|
307
|
+
const cancel = (entry) => {
|
|
308
|
+
clearTimeout(entry.timer);
|
|
309
|
+
entry.timer = void 0;
|
|
310
|
+
const { run } = entry;
|
|
311
|
+
if (!run) return;
|
|
312
|
+
entry.run = void 0;
|
|
313
|
+
run.controller.abort();
|
|
314
|
+
new Promise((resolve2) => resolve2(run.iterator?.return?.())).catch(() => {
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
const receive = (entry, run, chunk) => {
|
|
318
|
+
if (!live(entry, run)) return;
|
|
319
|
+
const received = Array.isArray(chunk) ? chunk : "items" in chunk ? chunk.items : [chunk];
|
|
320
|
+
if (!Array.isArray(chunk) && "items" in chunk) run.cursor = chunk.nextCursor;
|
|
321
|
+
checkGroups(entry.source, received);
|
|
322
|
+
const items = run.group === void 0 ? received : received.filter(({ group }) => group === run.group);
|
|
323
|
+
const previous = run.replace ? [] : stateOf(entry.source.id)?.items ?? [];
|
|
324
|
+
run.replace = false;
|
|
325
|
+
patch(entry.source.id, {
|
|
326
|
+
status: "streaming",
|
|
327
|
+
items: [...previous, ...items],
|
|
328
|
+
nextCursor: run.cursor
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
const settle = (entry, run, failure) => {
|
|
332
|
+
if (!live(entry, run)) return;
|
|
333
|
+
entry.run = void 0;
|
|
334
|
+
patch(entry.source.id, {
|
|
335
|
+
status: failure ? "error" : "success",
|
|
336
|
+
error: failure?.error,
|
|
337
|
+
nextCursor: run.cursor,
|
|
338
|
+
// A run that received nothing still replaces the previous query's items.
|
|
339
|
+
...run.replace && { items: [] }
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
const stream = (entry, run, iterable) => {
|
|
343
|
+
const iterator = iterable[Symbol.asyncIterator]();
|
|
344
|
+
run.iterator = iterator;
|
|
345
|
+
const pump = async () => {
|
|
346
|
+
const step = await iterator.next();
|
|
347
|
+
if (!live(entry, run)) return;
|
|
348
|
+
if (step.done) return settle(entry, run);
|
|
349
|
+
receive(entry, run, step.value);
|
|
350
|
+
return pump();
|
|
351
|
+
};
|
|
352
|
+
pump().catch((error) => settle(entry, run, { error }));
|
|
353
|
+
};
|
|
354
|
+
const start = (entry, cursor) => {
|
|
355
|
+
cancel(entry);
|
|
356
|
+
const { source } = entry;
|
|
357
|
+
const { query, path } = store.get();
|
|
358
|
+
const scope = scopeOf(path);
|
|
359
|
+
const scoped = scope?.source === source.id;
|
|
360
|
+
const group = scoped ? scope.group : void 0;
|
|
361
|
+
const run = { controller: new AbortController(), replace: cursor === void 0, group };
|
|
362
|
+
entry.run = run;
|
|
363
|
+
patch(source.id, {
|
|
364
|
+
status: cursor === void 0 ? "loading" : "streaming",
|
|
365
|
+
error: void 0,
|
|
366
|
+
debounced: void 0
|
|
367
|
+
});
|
|
368
|
+
try {
|
|
369
|
+
const result = source.search(query, {
|
|
370
|
+
signal: run.controller.signal,
|
|
371
|
+
limit: sourceLimit(source, scoped ? "scoped" : "unscoped", options.limit),
|
|
372
|
+
scoped,
|
|
373
|
+
group,
|
|
374
|
+
cursor
|
|
375
|
+
});
|
|
376
|
+
if (isStream(result)) return stream(entry, run, result);
|
|
377
|
+
if (!isPromise(result)) {
|
|
378
|
+
receive(entry, run, result);
|
|
379
|
+
return settle(entry, run);
|
|
380
|
+
}
|
|
381
|
+
result.then(
|
|
382
|
+
(page) => {
|
|
383
|
+
receive(entry, run, page);
|
|
384
|
+
settle(entry, run);
|
|
385
|
+
},
|
|
386
|
+
(error) => settle(entry, run, { error })
|
|
387
|
+
);
|
|
388
|
+
} catch (error) {
|
|
389
|
+
settle(entry, run, { error });
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
const schedule = (entry, debounced) => {
|
|
393
|
+
cancel(entry);
|
|
394
|
+
const { source } = entry;
|
|
395
|
+
const { open: open2, query } = store.get();
|
|
396
|
+
if (!open2 || !searched(source.id) || query.trim().length < (source.minQueryLength ?? 1)) {
|
|
397
|
+
return patch(source.id, { ...idle(source), debounced: void 0 });
|
|
398
|
+
}
|
|
399
|
+
const wait = debounced ? source.debounce ?? DEBOUNCE : 0;
|
|
400
|
+
if (wait === 0) return start(entry);
|
|
401
|
+
patch(source.id, { status: "loading", error: void 0, debounced: true });
|
|
402
|
+
entry.timer = setTimeout(() => start(entry), wait);
|
|
403
|
+
};
|
|
404
|
+
const rerun = (debounced) => {
|
|
405
|
+
level.forEach((entry) => {
|
|
406
|
+
schedule(entry, debounced);
|
|
407
|
+
});
|
|
408
|
+
};
|
|
409
|
+
const go = (path) => {
|
|
410
|
+
level.forEach(cancel);
|
|
411
|
+
const walk = resolve(path);
|
|
412
|
+
level = walk.level;
|
|
413
|
+
write(() => ({ path: walk.path, trail: walk.trail }));
|
|
414
|
+
reorder();
|
|
415
|
+
rerun(false);
|
|
416
|
+
};
|
|
417
|
+
const register = (source, contextual) => {
|
|
418
|
+
const replaced = root.get(source.id);
|
|
419
|
+
if (replaced) cancel(replaced);
|
|
420
|
+
const entry = { source, contextual, seq: seq++ };
|
|
421
|
+
root.set(source.id, entry);
|
|
422
|
+
if (store.get().path[0]?.source === source.id) go(store.get().path);
|
|
423
|
+
else if (level === root) {
|
|
424
|
+
reorder();
|
|
425
|
+
schedule(entry, false);
|
|
426
|
+
}
|
|
427
|
+
store.flush();
|
|
428
|
+
return () => {
|
|
429
|
+
if (root.get(source.id) !== entry) return;
|
|
430
|
+
cancel(entry);
|
|
431
|
+
root.delete(source.id);
|
|
432
|
+
if (store.get().path[0]?.source === source.id) go([]);
|
|
433
|
+
else if (level === root) reorder();
|
|
434
|
+
store.flush();
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
const open = (target = {}) => {
|
|
438
|
+
const draft = store.get();
|
|
439
|
+
const query = target.query ?? draft.query;
|
|
440
|
+
const path = target.path ?? (draft.open ? draft.path : presets.at(-1) ?? []);
|
|
441
|
+
if (draft.open && query === draft.query && samePath(path, draft.path)) return;
|
|
442
|
+
write(() => ({ open: true, query }));
|
|
443
|
+
go(path);
|
|
444
|
+
store.flush();
|
|
445
|
+
};
|
|
446
|
+
const close = () => {
|
|
447
|
+
level.forEach(cancel);
|
|
448
|
+
level = root;
|
|
449
|
+
write(() => ({ open: false, query: "", path: [], trail: [], sources: [] }));
|
|
450
|
+
reorder();
|
|
451
|
+
store.flush();
|
|
452
|
+
};
|
|
453
|
+
const setPath = (path) => {
|
|
454
|
+
const draft = store.get();
|
|
455
|
+
if (!draft.open || samePath(path, draft.path)) return;
|
|
456
|
+
go(path);
|
|
457
|
+
store.flush();
|
|
458
|
+
};
|
|
459
|
+
return {
|
|
460
|
+
subscribe: store.subscribe,
|
|
461
|
+
getSnapshot: store.getSnapshot,
|
|
462
|
+
getServerSnapshot: store.getServerSnapshot,
|
|
463
|
+
getState: store.peek,
|
|
464
|
+
open,
|
|
465
|
+
close,
|
|
466
|
+
toggle: (options2) => store.get().open ? close() : open(options2),
|
|
467
|
+
setQuery(query) {
|
|
468
|
+
if (query === store.get().query) return;
|
|
469
|
+
write(() => ({ query }));
|
|
470
|
+
rerun(true);
|
|
471
|
+
store.flush();
|
|
472
|
+
},
|
|
473
|
+
setPath,
|
|
474
|
+
push: (frame) => setPath([...store.get().path, frame]),
|
|
475
|
+
pop: () => setPath(store.get().path.slice(0, -1)),
|
|
476
|
+
preset(path) {
|
|
477
|
+
presets.push(path);
|
|
478
|
+
return () => {
|
|
479
|
+
const index = presets.lastIndexOf(path);
|
|
480
|
+
if (index !== -1) presets.splice(index, 1);
|
|
481
|
+
};
|
|
482
|
+
},
|
|
483
|
+
refresh(id) {
|
|
484
|
+
if (!store.get().open) return;
|
|
485
|
+
const targets = id === void 0 ? [...level.values()] : [level.get(id)];
|
|
486
|
+
targets.forEach((entry) => {
|
|
487
|
+
if (entry) schedule(entry, false);
|
|
488
|
+
});
|
|
489
|
+
store.flush();
|
|
490
|
+
},
|
|
491
|
+
loadMore(id) {
|
|
492
|
+
const entry = level.get(id);
|
|
493
|
+
const cursor = stateOf(id)?.nextCursor;
|
|
494
|
+
if (!entry || entry.run || cursor === void 0 || !store.get().open || !searched(id)) return;
|
|
495
|
+
start(entry, cursor);
|
|
496
|
+
store.flush();
|
|
497
|
+
},
|
|
498
|
+
register,
|
|
499
|
+
select(item, { navigate = options.navigate } = {}) {
|
|
500
|
+
item.onSelect?.({ close, query: store.get().query });
|
|
501
|
+
if (item.link !== void 0) (navigate ?? assign)(item.link);
|
|
502
|
+
if (item.closeOnSelect !== false && store.get().open) close();
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// src/components/spotlight/view.ts
|
|
508
|
+
var itemValue = (source, id) => JSON.stringify(["item", source, id]);
|
|
509
|
+
var recentValue = (source, id) => JSON.stringify(["recent", source, id]);
|
|
510
|
+
var retryValue = (source) => JSON.stringify(["retry", source]);
|
|
511
|
+
var seeAllValue = (group) => JSON.stringify(["see-all", group]);
|
|
512
|
+
var scopeValue = (source) => JSON.stringify(["scope", source]);
|
|
513
|
+
var viewPath = (state) => state.path.flatMap((frame, index) => {
|
|
514
|
+
const source = state.trail[index];
|
|
515
|
+
if (!source) return [];
|
|
516
|
+
const group = frame.group === void 0 ? void 0 : source.groups?.[frame.group];
|
|
517
|
+
return [
|
|
518
|
+
{
|
|
519
|
+
frame,
|
|
520
|
+
source,
|
|
521
|
+
label: group?.label ?? frame.group ?? source.label,
|
|
522
|
+
icon: group?.icon ?? source.icon,
|
|
523
|
+
...frame.item && { title: frame.item.title }
|
|
524
|
+
}
|
|
525
|
+
];
|
|
526
|
+
});
|
|
527
|
+
var prefixFrame = (query, state) => {
|
|
528
|
+
if (scopeOf(state.path)) return void 0;
|
|
529
|
+
const source = state.sources.find(
|
|
530
|
+
({ source: { prefix } }) => prefix !== void 0 && query.startsWith(`${prefix} `)
|
|
531
|
+
)?.source;
|
|
532
|
+
return source?.prefix === void 0 ? void 0 : { frame: { source: source.id }, query: query.slice(source.prefix.length + 1) };
|
|
533
|
+
};
|
|
534
|
+
var enter = (source, item, category) => source.within ? { source: source.id, item } : category;
|
|
535
|
+
var startsWord = (label, query) => ` ${fold(label)}`.includes(` ${fold(query)}`);
|
|
536
|
+
var scopesOf = (sources, path, query) => scopeOf(path) !== void 0 || sources.length < 2 ? [] : sources.filter(
|
|
537
|
+
({ prefix, label }) => query === "" || prefix === query || startsWord(resolveLabel(label), query)
|
|
538
|
+
);
|
|
539
|
+
var RECENTS = "recents";
|
|
540
|
+
var SCOPES = "scopes";
|
|
541
|
+
function buildView(state, recents, { recents: recentsLabel, recentsIn, scopes: scopesLabel, limit }) {
|
|
542
|
+
const sources = state.sources.map(({ source }) => source);
|
|
543
|
+
const query = state.query.trim();
|
|
544
|
+
const path = viewPath(state);
|
|
545
|
+
const category = scopeOf(state.path) && path.at(-1)?.label;
|
|
546
|
+
const recentItems = recents.flatMap((recent) => {
|
|
547
|
+
const item = fromRecent(recent, sources);
|
|
548
|
+
const source = sources.find(({ id }) => id === recent.source);
|
|
549
|
+
if (!item) return [];
|
|
550
|
+
return [
|
|
551
|
+
{
|
|
552
|
+
value: recentValue(recent.source, recent.id),
|
|
553
|
+
item: { ...item, icon: item.icon ?? source?.icon },
|
|
554
|
+
source,
|
|
555
|
+
recent,
|
|
556
|
+
...source && { frame: enter(source, item, { source: source.id }) }
|
|
557
|
+
}
|
|
558
|
+
];
|
|
559
|
+
});
|
|
560
|
+
const recentGroup = recentItems.length === 0 ? [] : [
|
|
561
|
+
{
|
|
562
|
+
key: RECENTS,
|
|
563
|
+
label: category === void 0 ? recentsLabel : () => recentsIn(resolveLabel(category)),
|
|
564
|
+
status: "success",
|
|
565
|
+
debounced: false,
|
|
566
|
+
items: recentItems,
|
|
567
|
+
last: true
|
|
568
|
+
}
|
|
569
|
+
];
|
|
570
|
+
const debounced = new Map(state.sources.map((s) => [s.source.id, s.debounced === true]));
|
|
571
|
+
const cursors = new Map(state.sources.map((s) => [s.source.id, s.nextCursor]));
|
|
572
|
+
const scopes = scopesOf(sources, state.path, query);
|
|
573
|
+
const scopeGroup = scopesLabel === false || scopes.length === 0 ? [] : [
|
|
574
|
+
{
|
|
575
|
+
key: SCOPES,
|
|
576
|
+
label: scopesLabel,
|
|
577
|
+
status: "success",
|
|
578
|
+
debounced: false,
|
|
579
|
+
items: [],
|
|
580
|
+
scopes: scopes.map((source) => ({ value: scopeValue(source.id), source })),
|
|
581
|
+
last: true
|
|
582
|
+
}
|
|
583
|
+
];
|
|
584
|
+
const unscoped = scopeOf(state.path) === void 0;
|
|
585
|
+
const groups = state.groups.map((group, index) => {
|
|
586
|
+
const last = state.groups[index + 1]?.source.id !== group.source.id;
|
|
587
|
+
const full = cursors.get(group.source.id) !== void 0 || group.items.length >= sourceLimit(group.source, "unscoped", limit);
|
|
588
|
+
const more = unscoped && group.status !== "loading" && full;
|
|
589
|
+
const frame = {
|
|
590
|
+
source: group.source.id,
|
|
591
|
+
...group.group !== void 0 && { group: group.group }
|
|
592
|
+
};
|
|
593
|
+
return {
|
|
594
|
+
key: group.key,
|
|
595
|
+
label: group.label,
|
|
596
|
+
icon: group.icon,
|
|
597
|
+
status: group.status,
|
|
598
|
+
debounced: debounced.get(group.source.id) ?? false,
|
|
599
|
+
source: group.source,
|
|
600
|
+
items: group.items.map((item) => ({
|
|
601
|
+
value: itemValue(group.source.id, item.id),
|
|
602
|
+
item,
|
|
603
|
+
source: group.source,
|
|
604
|
+
frame: enter(group.source, item, frame)
|
|
605
|
+
})),
|
|
606
|
+
last,
|
|
607
|
+
...last && group.status === "error" && { retry: retryValue(group.source.id) },
|
|
608
|
+
...more && { seeAll: seeAllValue(group.key) },
|
|
609
|
+
...unscoped && group.source.prefix !== void 0 && { prefix: group.source.prefix },
|
|
610
|
+
frame
|
|
611
|
+
};
|
|
612
|
+
});
|
|
613
|
+
const all = query === "" ? [...recentGroup, ...scopeGroup, ...groups] : [...scopeGroup, ...recentGroup, ...groups];
|
|
614
|
+
const scope = scopeOf(state.path);
|
|
615
|
+
const scoped = state.sources.find(({ source }) => source.id === scope?.source);
|
|
616
|
+
return {
|
|
617
|
+
groups: all,
|
|
618
|
+
values: all.flatMap((group) => [
|
|
619
|
+
...group.items.map(({ value }) => value),
|
|
620
|
+
...(group.scopes ?? []).map(({ value }) => value),
|
|
621
|
+
...group.retry === void 0 ? [] : [group.retry],
|
|
622
|
+
...group.seeAll === void 0 ? [] : [group.seeAll]
|
|
623
|
+
]),
|
|
624
|
+
busy: state.sources.some(({ status }) => status === "loading" || status === "streaming"),
|
|
625
|
+
count: all.reduce((sum, group) => sum + group.items.length + (group.scopes?.length ?? 0), 0),
|
|
626
|
+
path,
|
|
627
|
+
more: scoped?.status === "success" && scoped.nextCursor !== void 0 ? scoped.source.id : void 0
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
var findValue = (view, value) => {
|
|
631
|
+
const group = view.groups.find(
|
|
632
|
+
(candidate) => candidate.retry === value || candidate.seeAll === value || candidate.items.some((entry2) => entry2.value === value) || candidate.scopes?.some((scope2) => scope2.value === value)
|
|
633
|
+
);
|
|
634
|
+
if (!group) return void 0;
|
|
635
|
+
if (group.retry === value && group.source) return { kind: "retry", source: group.source };
|
|
636
|
+
if (group.seeAll === value && group.frame) return { kind: "see-all", frame: group.frame };
|
|
637
|
+
const scope = group.scopes?.find((candidate) => candidate.value === value);
|
|
638
|
+
if (scope) return { kind: "scope", frame: { source: scope.source.id } };
|
|
639
|
+
const entry = group.items.find((candidate) => candidate.value === value);
|
|
640
|
+
return entry && { kind: "item", entry };
|
|
641
|
+
};
|
|
642
|
+
var tabFrame = (view, value) => {
|
|
643
|
+
const found = value === null ? void 0 : findValue(view, value);
|
|
644
|
+
const frame = found?.kind === "item" ? found.entry.frame : found?.kind === "retry" ? void 0 : found?.frame;
|
|
645
|
+
const last = view.path.at(-1)?.frame;
|
|
646
|
+
return frame && last && sameFrame(frame, last) ? void 0 : frame;
|
|
647
|
+
};
|
|
648
|
+
var hairline = "border-brand-900/20 dark:border-white/15";
|
|
649
|
+
var muted = TEXT_COLOR_CLASSES.muted;
|
|
650
|
+
var contentStroke = "[&_svg]:stroke-[1.5] [&_svg_*]:[vector-effect:non-scaling-stroke]";
|
|
651
|
+
var NO_VALUE = [];
|
|
652
|
+
var Root = ({ className, testId, children }) => {
|
|
653
|
+
const {
|
|
654
|
+
open,
|
|
655
|
+
query,
|
|
656
|
+
view,
|
|
657
|
+
translations: t,
|
|
658
|
+
highlighted,
|
|
659
|
+
highlight,
|
|
660
|
+
setQuery,
|
|
661
|
+
pop,
|
|
662
|
+
close,
|
|
663
|
+
finalFocus,
|
|
664
|
+
modalProps
|
|
665
|
+
} = useSpotlightContext();
|
|
666
|
+
const collection = useMemo(
|
|
667
|
+
() => createListCollection({
|
|
668
|
+
items: view.groups.flatMap((group) => [
|
|
669
|
+
...group.items.map(({ value, item }) => ({ value, label: item.title })),
|
|
670
|
+
...(group.scopes ?? []).map(({ value, source }) => ({
|
|
671
|
+
value,
|
|
672
|
+
label: t.searchIn(resolveLabel(source.label))
|
|
673
|
+
})),
|
|
674
|
+
...group.retry === void 0 ? [] : [{ value: group.retry, label: t.retry }],
|
|
675
|
+
...group.seeAll === void 0 ? [] : [{ value: group.seeAll, label: t.seeAll(resolveLabel(group.label)) }]
|
|
676
|
+
])
|
|
677
|
+
}),
|
|
678
|
+
[view, t]
|
|
679
|
+
);
|
|
680
|
+
const labels = view.path.map((frame) => frameLabel(frame, t));
|
|
681
|
+
const scrolledTo = useRef(null);
|
|
682
|
+
const scrollToHighlight = ({ getElement }) => {
|
|
683
|
+
const row = getElement();
|
|
684
|
+
const key = JSON.stringify([query, labels, row?.getAttribute("data-value")]);
|
|
685
|
+
if (key === scrolledTo.current) return;
|
|
686
|
+
scrolledTo.current = key;
|
|
687
|
+
row?.scrollIntoView({ block: "nearest" });
|
|
688
|
+
};
|
|
689
|
+
const [entered, setEntered] = useState(false);
|
|
690
|
+
const nextEntered = open && (entered || labels.length > 0);
|
|
691
|
+
if (nextEntered !== entered) setEntered(nextEntered);
|
|
692
|
+
const scopeAnnouncement = labels.length > 0 ? t.scopeLabel(labels) : entered ? t.scopeCleared : "";
|
|
693
|
+
const announcement = view.busy || query.trim() === "" ? "" : view.count > 0 ? t.results(view.count) : t.noResults(query.trim());
|
|
694
|
+
return /* @__PURE__ */ jsxs(
|
|
695
|
+
Modal,
|
|
696
|
+
{
|
|
697
|
+
position: "top",
|
|
698
|
+
size: "lg",
|
|
699
|
+
radius: "lg",
|
|
700
|
+
withCloseButton: false,
|
|
701
|
+
...modalProps,
|
|
702
|
+
open,
|
|
703
|
+
onOpenChange: (next) => {
|
|
704
|
+
if (!next) close();
|
|
705
|
+
},
|
|
706
|
+
finalFocusEl: finalFocus,
|
|
707
|
+
onEscapeKeyDown: (event) => {
|
|
708
|
+
modalProps?.onEscapeKeyDown?.(event);
|
|
709
|
+
if (event.defaultPrevented || view.path.length === 0) return;
|
|
710
|
+
event.preventDefault();
|
|
711
|
+
pop();
|
|
712
|
+
},
|
|
713
|
+
testId: testId ?? modalProps?.testId,
|
|
714
|
+
className: cn(modalProps?.className, className),
|
|
715
|
+
classNames: {
|
|
716
|
+
...modalProps?.classNames,
|
|
717
|
+
body: cn("flex min-h-0 flex-col overflow-hidden p-0", modalProps?.classNames?.body)
|
|
718
|
+
},
|
|
719
|
+
children: [
|
|
720
|
+
/* @__PURE__ */ jsx(Modal.Title, { className: "sr-only", children: t.inputLabel }),
|
|
721
|
+
/* @__PURE__ */ jsxs(
|
|
722
|
+
Combobox.Root,
|
|
723
|
+
{
|
|
724
|
+
collection,
|
|
725
|
+
open: true,
|
|
726
|
+
onOpenChange: () => {
|
|
727
|
+
},
|
|
728
|
+
disableLayer: true,
|
|
729
|
+
closeOnSelect: false,
|
|
730
|
+
selectionBehavior: "preserve",
|
|
731
|
+
value: NO_VALUE,
|
|
732
|
+
inputValue: query,
|
|
733
|
+
onInputValueChange: ({ inputValue }) => setQuery(inputValue),
|
|
734
|
+
highlightedValue: highlighted,
|
|
735
|
+
onHighlightChange: ({ highlightedValue }) => {
|
|
736
|
+
if (highlightedValue !== null) highlight(highlightedValue);
|
|
737
|
+
},
|
|
738
|
+
navigate: null,
|
|
739
|
+
scrollToIndexFn: scrollToHighlight,
|
|
740
|
+
loopFocus: true,
|
|
741
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
742
|
+
children: [
|
|
743
|
+
children,
|
|
744
|
+
/* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "sr-only", children: announcement }),
|
|
745
|
+
/* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "sr-only", children: scopeAnnouncement })
|
|
746
|
+
]
|
|
747
|
+
}
|
|
748
|
+
)
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
};
|
|
753
|
+
var highlightedAnchor = (input) => {
|
|
754
|
+
const id = input.getAttribute("aria-activedescendant");
|
|
755
|
+
const row = id ? input.ownerDocument.getElementById(id) : null;
|
|
756
|
+
return row instanceof HTMLAnchorElement ? row : void 0;
|
|
757
|
+
};
|
|
758
|
+
var placeholderOf = (frame, root, t) => {
|
|
759
|
+
if (!frame) return root;
|
|
760
|
+
const own = frame.title === void 0 ? frame.source.placeholder : void 0;
|
|
761
|
+
return own === void 0 ? t.searchPlaceholder(resolveLabel(frame.label), frame.title) : resolveLabel(own);
|
|
762
|
+
};
|
|
763
|
+
var bare = (event) => !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
764
|
+
var Input = ({
|
|
765
|
+
className,
|
|
766
|
+
classNames,
|
|
767
|
+
testId,
|
|
768
|
+
startSlot = /* @__PURE__ */ jsx(Path, {}),
|
|
769
|
+
children
|
|
770
|
+
}) => {
|
|
771
|
+
const {
|
|
772
|
+
highlighted,
|
|
773
|
+
select,
|
|
774
|
+
placeholder,
|
|
775
|
+
view,
|
|
776
|
+
tabbable,
|
|
777
|
+
enter: enter2,
|
|
778
|
+
pop,
|
|
779
|
+
translations: t,
|
|
780
|
+
icons
|
|
781
|
+
} = useSpotlightContext();
|
|
782
|
+
const inputRef = useRef(null);
|
|
783
|
+
useEffect(() => {
|
|
784
|
+
const win = inputRef.current?.ownerDocument.defaultView;
|
|
785
|
+
if (!win) return;
|
|
786
|
+
const onTab = (event) => {
|
|
787
|
+
if (event.key !== "Tab" || event.target !== inputRef.current || event.isComposing) return;
|
|
788
|
+
if (!bare(event) || !tabbable || highlighted === null) return;
|
|
789
|
+
event.preventDefault();
|
|
790
|
+
event.stopPropagation();
|
|
791
|
+
enter2(highlighted);
|
|
792
|
+
};
|
|
793
|
+
win.addEventListener("keydown", onTab, true);
|
|
794
|
+
return () => win.removeEventListener("keydown", onTab, true);
|
|
795
|
+
}, [tabbable, highlighted, enter2]);
|
|
796
|
+
const onKeyDownCapture = (event) => {
|
|
797
|
+
if (event.nativeEvent.isComposing) return;
|
|
798
|
+
if (event.key === "Backspace" && event.currentTarget.value === "" && view.path.length > 0) {
|
|
799
|
+
event.preventDefault();
|
|
800
|
+
event.stopPropagation();
|
|
801
|
+
return pop();
|
|
802
|
+
}
|
|
803
|
+
if (event.key !== "Enter") return;
|
|
804
|
+
event.preventDefault();
|
|
805
|
+
event.stopPropagation();
|
|
806
|
+
if (event.metaKey || event.ctrlKey) {
|
|
807
|
+
const anchor = highlightedAnchor(event.currentTarget);
|
|
808
|
+
if (anchor) window.open(anchor.href, "_blank", "noopener,noreferrer");
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
if (highlighted !== null) select(highlighted);
|
|
812
|
+
};
|
|
813
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex h-14 shrink-0 items-center gap-3 border-b px-4", hairline, className), children: [
|
|
814
|
+
icons.search != null && /* @__PURE__ */ jsx(
|
|
815
|
+
"span",
|
|
816
|
+
{
|
|
817
|
+
"aria-hidden": true,
|
|
818
|
+
className: cn("flex shrink-0 [&_svg]:size-5 [&_svg]:shrink-0", muted, classNames?.icon),
|
|
819
|
+
children: icons.search
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
startSlot,
|
|
823
|
+
/* @__PURE__ */ jsx(
|
|
824
|
+
Combobox$1.Input,
|
|
825
|
+
{
|
|
826
|
+
ref: inputRef,
|
|
827
|
+
placeholder: placeholderOf(view.path.at(-1), placeholder, t),
|
|
828
|
+
"aria-label": t.inputLabel,
|
|
829
|
+
onKeyDownCapture,
|
|
830
|
+
...props({ "data-testid": testId }),
|
|
831
|
+
className: cn(
|
|
832
|
+
"h-full w-0 min-w-0 flex-1 bg-transparent text-lg outline-none",
|
|
833
|
+
"placeholder:text-black/50 dark:placeholder:text-white/50",
|
|
834
|
+
classNames?.input
|
|
835
|
+
)
|
|
836
|
+
}
|
|
837
|
+
),
|
|
838
|
+
children
|
|
839
|
+
] });
|
|
840
|
+
};
|
|
841
|
+
var frameLabel = (frame, t) => frame.title === void 0 ? resolveLabel(frame.label) : t.itemLabel(resolveLabel(frame.label), frame.title);
|
|
842
|
+
var Scope = ({
|
|
843
|
+
index,
|
|
844
|
+
className,
|
|
845
|
+
classNames,
|
|
846
|
+
testId,
|
|
847
|
+
asChild,
|
|
848
|
+
children,
|
|
849
|
+
...rest
|
|
850
|
+
}) => {
|
|
851
|
+
const { view, truncate, translations: t } = useSpotlightContext();
|
|
852
|
+
const combobox = useComboboxContext();
|
|
853
|
+
const frame = view.path[index];
|
|
854
|
+
if (!frame) return null;
|
|
855
|
+
const label = frameLabel(frame, t);
|
|
856
|
+
return /* @__PURE__ */ jsx(
|
|
857
|
+
Pill,
|
|
858
|
+
{
|
|
859
|
+
asChild,
|
|
860
|
+
size: "lg",
|
|
861
|
+
withRemoveButton: true,
|
|
862
|
+
removeLabel: t.leaveScope(label),
|
|
863
|
+
onRemove: () => {
|
|
864
|
+
truncate(index);
|
|
865
|
+
combobox.focus();
|
|
866
|
+
},
|
|
867
|
+
testId,
|
|
868
|
+
className: cn("min-w-0 max-w-48 shrink last:shrink-0", className),
|
|
869
|
+
classNames: {
|
|
870
|
+
label: cn("flex min-w-0 items-center gap-1", classNames?.label),
|
|
871
|
+
remove: classNames?.remove
|
|
872
|
+
},
|
|
873
|
+
...rest,
|
|
874
|
+
children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
875
|
+
frame.icon != null && /* @__PURE__ */ jsx(
|
|
876
|
+
"span",
|
|
877
|
+
{
|
|
878
|
+
"aria-hidden": true,
|
|
879
|
+
className: cn("flex shrink-0 [&_svg]:size-3.5", contentStroke, classNames?.icon),
|
|
880
|
+
children: frame.icon
|
|
881
|
+
}
|
|
882
|
+
),
|
|
883
|
+
/* @__PURE__ */ jsx("span", { dir: "auto", className: "truncate", children: own ?? label })
|
|
884
|
+
] }))
|
|
885
|
+
}
|
|
886
|
+
);
|
|
887
|
+
};
|
|
888
|
+
var Path = ({ className, classNames, testId }) => {
|
|
889
|
+
const { view } = useSpotlightContext();
|
|
890
|
+
if (view.path.length === 0) return null;
|
|
891
|
+
return /* @__PURE__ */ jsx(
|
|
892
|
+
"div",
|
|
893
|
+
{
|
|
894
|
+
...props({ "data-testid": testId }),
|
|
895
|
+
className: cn("flex min-w-0 max-w-[70%] shrink items-center gap-1", className),
|
|
896
|
+
children: view.path.map((_frame, index) => /* @__PURE__ */ jsx(
|
|
897
|
+
Scope,
|
|
898
|
+
{
|
|
899
|
+
index,
|
|
900
|
+
className: classNames?.scope,
|
|
901
|
+
testId: testId && `${testId}-${index}`
|
|
902
|
+
},
|
|
903
|
+
index
|
|
904
|
+
))
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
};
|
|
908
|
+
var isEmpty = (query, view) => query.trim() !== "" && !view.busy && view.groups.length === 0;
|
|
909
|
+
var isPrompt = (query, view) => query.trim() === "" && view.path.length > 0 && !view.busy && view.groups.length === 0;
|
|
910
|
+
var isBare = (view) => view.busy && view.groups.every(
|
|
911
|
+
(group) => group.status === "loading" && group.items.length === 0 && (group.scopes?.length ?? 0) === 0
|
|
912
|
+
);
|
|
913
|
+
var Sentinel = ({ source, root }) => {
|
|
914
|
+
const { loadMore } = useSpotlightContext();
|
|
915
|
+
const ref = useRef(null);
|
|
916
|
+
const inView = useInView(ref, { root, margin: "0px 0px 160px 0px" });
|
|
917
|
+
useEffect(() => {
|
|
918
|
+
if (inView) loadMore(source);
|
|
919
|
+
}, [inView, source, loadMore]);
|
|
920
|
+
return /* @__PURE__ */ jsx("div", { ref, "aria-hidden": true, className: "pointer-events-none absolute inset-x-0 bottom-0 h-px" });
|
|
921
|
+
};
|
|
922
|
+
var List = ({ className, testId, children }) => {
|
|
923
|
+
const { query, view, skeletonDelay } = useSpotlightContext();
|
|
924
|
+
const { more } = view;
|
|
925
|
+
const frame = useRef(null);
|
|
926
|
+
const content = useRef(null);
|
|
927
|
+
const [scroller] = useState(() => ({
|
|
928
|
+
get current() {
|
|
929
|
+
return frame.current?.parentElement ?? null;
|
|
930
|
+
}
|
|
931
|
+
}));
|
|
932
|
+
const height = useRef({ measured: -1, shown: -1, busy: view.busy, free: true });
|
|
933
|
+
const write = (next) => {
|
|
934
|
+
const state = height.current;
|
|
935
|
+
const list = scroller.current;
|
|
936
|
+
if (!list || next === state.shown) return;
|
|
937
|
+
state.shown = next;
|
|
938
|
+
list.style.setProperty("--spotlight-list-height", `${next}px`);
|
|
939
|
+
};
|
|
940
|
+
const path = JSON.stringify(
|
|
941
|
+
view.path.map(({ frame: frame2 }) => [frame2.source, frame2.group, frame2.item?.id])
|
|
942
|
+
);
|
|
943
|
+
const search = JSON.stringify([query.trim() === "", path]);
|
|
944
|
+
const before = useRef({ path, prompt: false });
|
|
945
|
+
useIsomorphicLayoutEffect(() => {
|
|
946
|
+
height.current.free = !(before.current.prompt && before.current.path === path);
|
|
947
|
+
}, [search]);
|
|
948
|
+
useIsomorphicLayoutEffect(() => {
|
|
949
|
+
before.current = { path, prompt: isPrompt(query, view) };
|
|
950
|
+
});
|
|
951
|
+
useIsomorphicLayoutEffect(() => {
|
|
952
|
+
const wrapper = content.current;
|
|
953
|
+
if (!wrapper) return;
|
|
954
|
+
return observeResize(
|
|
955
|
+
wrapper,
|
|
956
|
+
(entry) => {
|
|
957
|
+
const [size] = entry?.borderBoxSize ?? [];
|
|
958
|
+
if (!size) return;
|
|
959
|
+
const state = height.current;
|
|
960
|
+
state.measured = size.blockSize;
|
|
961
|
+
const grow = state.busy && !state.free;
|
|
962
|
+
state.free = false;
|
|
963
|
+
write(grow ? Math.max(size.blockSize, state.shown) : size.blockSize);
|
|
964
|
+
},
|
|
965
|
+
"border"
|
|
966
|
+
);
|
|
967
|
+
}, []);
|
|
968
|
+
useIsomorphicLayoutEffect(() => {
|
|
969
|
+
const state = height.current;
|
|
970
|
+
state.busy = view.busy;
|
|
971
|
+
if (!view.busy && state.measured >= 0) write(state.measured);
|
|
972
|
+
}, [view.busy]);
|
|
973
|
+
return /* @__PURE__ */ jsx(
|
|
974
|
+
Combobox.Panel,
|
|
975
|
+
{
|
|
976
|
+
...props({ "data-testid": testId }),
|
|
977
|
+
withPaddingTop: false,
|
|
978
|
+
className: cn(
|
|
979
|
+
"max-h-[min(28rem,60dvh)] scroll-py-2 p-0",
|
|
980
|
+
// Capped in the height itself, so shrinking from a long list eases
|
|
981
|
+
// from where it shows, not from its full length. Until the first
|
|
982
|
+
// measurement the variable is unset, which leaves the height `auto`.
|
|
983
|
+
"h-[min(var(--spotlight-list-height),28rem,60dvh)]",
|
|
984
|
+
"transition-[height] duration-(--duration-normal) ease-standard motion-reduce:transition-none",
|
|
985
|
+
className
|
|
986
|
+
),
|
|
987
|
+
children: /* @__PURE__ */ jsxs("div", { ref: frame, className: "flex min-h-full shrink-0 flex-col", children: [
|
|
988
|
+
/* @__PURE__ */ jsxs(
|
|
989
|
+
"div",
|
|
990
|
+
{
|
|
991
|
+
ref: content,
|
|
992
|
+
className: "peer relative flex shrink-0 flex-col gap-0.5 px-2 pt-1 pb-2 empty:hidden",
|
|
993
|
+
children: [
|
|
994
|
+
children ? children(view.groups) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
995
|
+
view.groups.map((group) => /* @__PURE__ */ jsx(Group, { group }, group.key)),
|
|
996
|
+
/* @__PURE__ */ jsx(Empty, {}),
|
|
997
|
+
/* @__PURE__ */ jsx(Prompt, {})
|
|
998
|
+
] }),
|
|
999
|
+
more !== void 0 && /* @__PURE__ */ jsx(Sentinel, { source: more, root: scroller }, view.count)
|
|
1000
|
+
]
|
|
1001
|
+
}
|
|
1002
|
+
),
|
|
1003
|
+
view.busy && // Mounted only while busy, the only time the height is held over
|
|
1004
|
+
// the rows, after the skeleton delay, so a source answering within
|
|
1005
|
+
// it never flashes skeletons under its results. Unlike a group's
|
|
1006
|
+
// skeleton, the debounce counts: typing re-debounces every source
|
|
1007
|
+
// on each key, so a filler waiting for a search to run would never
|
|
1008
|
+
// show while typing, the very time the height is held. Once shown,
|
|
1009
|
+
// it stays until every source has settled, and the next busy spell
|
|
1010
|
+
// mounts a fresh one, which waits again.
|
|
1011
|
+
/* @__PURE__ */ jsx(Delayed, { delay: skeletonDelay, active: true, children: /* @__PURE__ */ jsx(Filler, {}) })
|
|
1012
|
+
] })
|
|
1013
|
+
}
|
|
1014
|
+
);
|
|
1015
|
+
};
|
|
1016
|
+
var Delayed = ({
|
|
1017
|
+
delay,
|
|
1018
|
+
active,
|
|
1019
|
+
children
|
|
1020
|
+
}) => {
|
|
1021
|
+
const now = active && delay <= 0;
|
|
1022
|
+
const [shown, setShown] = useState(now);
|
|
1023
|
+
if (now && !shown) setShown(true);
|
|
1024
|
+
useEffect(() => {
|
|
1025
|
+
if (shown || !active) return;
|
|
1026
|
+
const timer = setTimeout(() => setShown(true), delay);
|
|
1027
|
+
return () => clearTimeout(timer);
|
|
1028
|
+
}, [shown, active, delay]);
|
|
1029
|
+
return shown || now ? children : null;
|
|
1030
|
+
};
|
|
1031
|
+
var rowClass = cn(popoverOption({ size: "sm" }), "min-h-11 gap-3 px-2.5 py-1.5");
|
|
1032
|
+
var SKELETON_WIDTHS = [
|
|
1033
|
+
[60, 40],
|
|
1034
|
+
[48, 34],
|
|
1035
|
+
[36, 28],
|
|
1036
|
+
[54, 38],
|
|
1037
|
+
[42, 30]
|
|
1038
|
+
];
|
|
1039
|
+
var SKELETON_ROWS = [0, 1, 2];
|
|
1040
|
+
var FILLER_ROWS = Array.from({ length: 10 }, (_, index) => index + SKELETON_ROWS.length);
|
|
1041
|
+
var SkeletonRows = ({
|
|
1042
|
+
className,
|
|
1043
|
+
rows = SKELETON_ROWS
|
|
1044
|
+
}) => rows.map((index) => {
|
|
1045
|
+
const [title, description] = SKELETON_WIDTHS[index % SKELETON_WIDTHS.length] ?? [60, 40];
|
|
1046
|
+
return /* @__PURE__ */ jsxs("div", { "aria-hidden": true, className: cn(rowClass, "pointer-events-none", className), children: [
|
|
1047
|
+
/* @__PURE__ */ jsx("span", { className: "flex size-8 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx(Skeleton, { shape: "circular", width: 32, height: 32 }) }),
|
|
1048
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
1049
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-5 items-center", children: /* @__PURE__ */ jsx(Skeleton, { width: `${title}%`, height: 10 }) }),
|
|
1050
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-4 items-center", children: /* @__PURE__ */ jsx(Skeleton, { width: `${description}%`, height: 8 }) })
|
|
1051
|
+
] })
|
|
1052
|
+
] }, index);
|
|
1053
|
+
});
|
|
1054
|
+
var Filler = () => /* @__PURE__ */ jsx(
|
|
1055
|
+
"div",
|
|
1056
|
+
{
|
|
1057
|
+
"aria-hidden": true,
|
|
1058
|
+
"data-spotlight-filler": "",
|
|
1059
|
+
className: cn(
|
|
1060
|
+
"pointer-events-none flex min-h-0 grow basis-0 flex-col gap-0.5 overflow-hidden px-2 peer-empty:pt-1",
|
|
1061
|
+
"[mask-image:linear-gradient(to_bottom,black_70%,transparent)]"
|
|
1062
|
+
),
|
|
1063
|
+
children: /* @__PURE__ */ jsx(SkeletonRows, { rows: FILLER_ROWS })
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
var ScopeRow = ({
|
|
1067
|
+
scope,
|
|
1068
|
+
className
|
|
1069
|
+
}) => {
|
|
1070
|
+
const { query, select, translations: t } = useSpotlightContext();
|
|
1071
|
+
const { value, source } = scope;
|
|
1072
|
+
const label = resolveLabel(source.label);
|
|
1073
|
+
return /* @__PURE__ */ jsxs(
|
|
1074
|
+
Combobox$1.Item,
|
|
1075
|
+
{
|
|
1076
|
+
item: { value, label: t.searchIn(label) },
|
|
1077
|
+
"aria-label": t.searchIn(label),
|
|
1078
|
+
onClick: () => select(value),
|
|
1079
|
+
className: cn(rowClass, className),
|
|
1080
|
+
...props({ "data-testid": `spotlight-scope-${source.id}` }),
|
|
1081
|
+
children: [
|
|
1082
|
+
/* @__PURE__ */ jsx(
|
|
1083
|
+
"span",
|
|
1084
|
+
{
|
|
1085
|
+
className: cn(
|
|
1086
|
+
"flex size-8 shrink-0 items-center justify-center [&_svg]:size-4",
|
|
1087
|
+
muted,
|
|
1088
|
+
contentStroke
|
|
1089
|
+
),
|
|
1090
|
+
children: source.icon
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: /* @__PURE__ */ jsx("bdi", { children: /* @__PURE__ */ jsx(Title, { item: { id: source.id, title: label }, query }) }) }),
|
|
1094
|
+
source.prefix !== void 0 && /* @__PURE__ */ jsx(Kbd, { size: "sm", dir: "ltr", className: "shrink-0", children: source.prefix })
|
|
1095
|
+
]
|
|
1096
|
+
}
|
|
1097
|
+
);
|
|
1098
|
+
};
|
|
1099
|
+
var Group = ({ group, className, classNames, testId, children }) => {
|
|
1100
|
+
const { skeletonDelay, select, view, translations: t, icons } = useSpotlightContext();
|
|
1101
|
+
const { retry, seeAll } = group;
|
|
1102
|
+
const pending = group.status === "loading" && group.items.length === 0;
|
|
1103
|
+
const stale = group.status === "loading" && group.items.length > 0;
|
|
1104
|
+
const more = view.more !== void 0 && view.more === group.source?.id;
|
|
1105
|
+
const busy = group.last && (group.status === "streaming" || more);
|
|
1106
|
+
const label = resolveLabel(group.label);
|
|
1107
|
+
const body = /* @__PURE__ */ jsxs(
|
|
1108
|
+
Combobox$1.ItemGroup,
|
|
1109
|
+
{
|
|
1110
|
+
...props({ "data-testid": testId, "data-status": group.status, "data-stale": stale }),
|
|
1111
|
+
className: cn(
|
|
1112
|
+
"flex flex-col gap-0.5 pt-1",
|
|
1113
|
+
// Stale rows dim after a beat, so a quick answer doesn't blink them,
|
|
1114
|
+
// and come back at once when it lands.
|
|
1115
|
+
"[&>[data-part=item]]:transition-opacity [&>[data-part=item]]:duration-(--duration-normal) [&>[data-part=item]]:ease-standard motion-reduce:[&>[data-part=item]]:transition-none",
|
|
1116
|
+
"data-stale:[&>[data-part=item]]:opacity-60 data-stale:[&>[data-part=item]]:delay-(--duration-fast)",
|
|
1117
|
+
// A group's first row keeps its heading in view when ↑ or ↓ scrolls
|
|
1118
|
+
// to it (the heading's 28px and the gap), so a wrap shows it too.
|
|
1119
|
+
"[&>[data-part=item]:nth-child(2)]:scroll-mt-7.5",
|
|
1120
|
+
className
|
|
1121
|
+
),
|
|
1122
|
+
children: [
|
|
1123
|
+
/* @__PURE__ */ jsxs(
|
|
1124
|
+
Combobox$1.ItemGroupLabel,
|
|
1125
|
+
{
|
|
1126
|
+
className: cn(
|
|
1127
|
+
popoverGroupLabel,
|
|
1128
|
+
"flex items-center gap-1.5 [&_svg]:size-3.5",
|
|
1129
|
+
contentStroke,
|
|
1130
|
+
classNames?.label
|
|
1131
|
+
),
|
|
1132
|
+
children: [
|
|
1133
|
+
group.icon,
|
|
1134
|
+
label,
|
|
1135
|
+
group.prefix !== void 0 && /* @__PURE__ */ jsx(
|
|
1136
|
+
Kbd,
|
|
1137
|
+
{
|
|
1138
|
+
size: "sm",
|
|
1139
|
+
"aria-hidden": true,
|
|
1140
|
+
dir: "ltr",
|
|
1141
|
+
className: cn("h-4 min-w-4 px-1", classNames?.prefix),
|
|
1142
|
+
children: group.prefix
|
|
1143
|
+
}
|
|
1144
|
+
)
|
|
1145
|
+
]
|
|
1146
|
+
}
|
|
1147
|
+
),
|
|
1148
|
+
pending ? /* @__PURE__ */ jsx(SkeletonRows, { className: classNames?.skeleton }) : group.items.map(
|
|
1149
|
+
(item) => children ? /* @__PURE__ */ jsx(Fragment$1, { children: children(item) }, item.value) : /* @__PURE__ */ jsx(Item, { item }, item.value)
|
|
1150
|
+
),
|
|
1151
|
+
group.scopes?.map((scope) => /* @__PURE__ */ jsx(ScopeRow, { scope, className: classNames?.scope }, scope.value)),
|
|
1152
|
+
busy && // Gated like a pending group, so a stream that ends within the delay
|
|
1153
|
+
// never flashes it. A next page is no flash: it shows at once, and a
|
|
1154
|
+
// tail already shown stays shown while that page loads.
|
|
1155
|
+
/* @__PURE__ */ jsx(Delayed, { delay: more ? 0 : skeletonDelay, active: true, children: /* @__PURE__ */ jsx(SkeletonRows, { className: classNames?.skeleton }) }),
|
|
1156
|
+
retry !== void 0 && /* @__PURE__ */ jsxs(
|
|
1157
|
+
Combobox$1.Item,
|
|
1158
|
+
{
|
|
1159
|
+
item: { value: retry, label: t.retry },
|
|
1160
|
+
className: cn(
|
|
1161
|
+
popoverOption({ size: "sm" }),
|
|
1162
|
+
// Figma has no destructive-row variable, so the error row reads `text-error-primary`.
|
|
1163
|
+
"gap-3 px-2.5 py-2",
|
|
1164
|
+
TEXT_COLOR_CLASSES.error,
|
|
1165
|
+
classNames?.error
|
|
1166
|
+
),
|
|
1167
|
+
onClick: () => select(retry),
|
|
1168
|
+
children: [
|
|
1169
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: t.error(label) }),
|
|
1170
|
+
/* @__PURE__ */ jsx(
|
|
1171
|
+
"span",
|
|
1172
|
+
{
|
|
1173
|
+
className: cn(
|
|
1174
|
+
"shrink-0 rounded-md border px-2 py-0.5 text-xs font-medium",
|
|
1175
|
+
TEXT_COLOR_CLASSES.secondary,
|
|
1176
|
+
hairline
|
|
1177
|
+
),
|
|
1178
|
+
children: t.retry
|
|
1179
|
+
}
|
|
1180
|
+
)
|
|
1181
|
+
]
|
|
1182
|
+
}
|
|
1183
|
+
),
|
|
1184
|
+
seeAll !== void 0 && /* @__PURE__ */ jsxs(
|
|
1185
|
+
Combobox$1.Item,
|
|
1186
|
+
{
|
|
1187
|
+
item: { value: seeAll, label: t.seeAll(label) },
|
|
1188
|
+
className: cn(popoverOption({ size: "sm" }), "gap-3 px-2.5 py-2", classNames?.seeAll),
|
|
1189
|
+
onClick: () => select(seeAll),
|
|
1190
|
+
...props({ "data-testid": `spotlight-see-all-${group.key}` }),
|
|
1191
|
+
children: [
|
|
1192
|
+
icons.seeAll != null && /* @__PURE__ */ jsx(
|
|
1193
|
+
"span",
|
|
1194
|
+
{
|
|
1195
|
+
"aria-hidden": true,
|
|
1196
|
+
className: cn(
|
|
1197
|
+
"flex size-8 shrink-0 items-center justify-center [&_svg]:size-4",
|
|
1198
|
+
muted
|
|
1199
|
+
),
|
|
1200
|
+
children: icons.seeAll
|
|
1201
|
+
}
|
|
1202
|
+
),
|
|
1203
|
+
/* @__PURE__ */ jsx("span", { className: cn("min-w-0 flex-1 truncate text-sm", muted), children: t.seeAll(label) })
|
|
1204
|
+
]
|
|
1205
|
+
}
|
|
1206
|
+
)
|
|
1207
|
+
]
|
|
1208
|
+
}
|
|
1209
|
+
);
|
|
1210
|
+
const bare2 = pending && isBare(view);
|
|
1211
|
+
return pending ? /* @__PURE__ */ jsx(Delayed, { delay: bare2 ? 0 : skeletonDelay, active: bare2 || !group.debounced, children: body }) : body;
|
|
1212
|
+
};
|
|
1213
|
+
var linkProps = (link) => typeof link === "object" && link !== null ? link : void 0;
|
|
1214
|
+
var Title = ({ item, query }) => {
|
|
1215
|
+
const ranges = item.highlights ?? matchRanges(item.title, query);
|
|
1216
|
+
return segment(item.title, ranges).map(
|
|
1217
|
+
(part, index) => part.marked ? (
|
|
1218
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: segments are positional
|
|
1219
|
+
/* @__PURE__ */ jsx(Mark, { className: "px-0", children: part.text }, index)
|
|
1220
|
+
) : part.text
|
|
1221
|
+
);
|
|
1222
|
+
};
|
|
1223
|
+
var Item = ({ item: row, className, classNames, testId }) => {
|
|
1224
|
+
const { query, highlighted, select, enter: enter2, translations: t, icons } = useSpotlightContext();
|
|
1225
|
+
const Link = useLinkComponent() ?? "a";
|
|
1226
|
+
const { item, source, recent, value } = row;
|
|
1227
|
+
const link = linkProps(item.link);
|
|
1228
|
+
const onClick = (event) => {
|
|
1229
|
+
if (link && (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey))
|
|
1230
|
+
return;
|
|
1231
|
+
event.preventDefault();
|
|
1232
|
+
select(value);
|
|
1233
|
+
};
|
|
1234
|
+
const content = source?.render ? source.render(item, { highlighted: highlighted === value, query }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1235
|
+
item.icon != null && /* @__PURE__ */ jsx(
|
|
1236
|
+
"span",
|
|
1237
|
+
{
|
|
1238
|
+
className: cn(
|
|
1239
|
+
"flex size-8 shrink-0 items-center justify-center [&_svg]:size-4",
|
|
1240
|
+
muted,
|
|
1241
|
+
contentStroke,
|
|
1242
|
+
classNames?.icon
|
|
1243
|
+
),
|
|
1244
|
+
children: item.icon
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
1248
|
+
/* @__PURE__ */ jsx("span", { className: cn("truncate text-sm font-medium", classNames?.title), children: /* @__PURE__ */ jsx("bdi", { children: /* @__PURE__ */ jsx(Title, { item, query: recent ? "" : query }) }) }),
|
|
1249
|
+
item.description != null && /* @__PURE__ */ jsx("span", { className: cn("truncate text-xs", muted, classNames?.description), children: /* @__PURE__ */ jsx("bdi", { children: item.description }) })
|
|
1250
|
+
] }),
|
|
1251
|
+
item.badge,
|
|
1252
|
+
item.shortcut && item.shortcut.length > 0 && // A chord reads left to right in either direction.
|
|
1253
|
+
/* @__PURE__ */ jsx("span", { dir: "ltr", className: cn("flex shrink-0 gap-1", classNames?.shortcut), children: item.shortcut.map((key) => /* @__PURE__ */ jsx(Kbd, { size: "sm", children: key }, key)) })
|
|
1254
|
+
] });
|
|
1255
|
+
const rowTestId = testId ?? item.testId ?? `spotlight-${recent ? "recent" : "item"}-${recent?.source ?? source?.id}-${item.id}`;
|
|
1256
|
+
const enterButton = row.frame?.item !== void 0 && /* @__PURE__ */ jsx(
|
|
1257
|
+
"button",
|
|
1258
|
+
{
|
|
1259
|
+
type: "button",
|
|
1260
|
+
tabIndex: -1,
|
|
1261
|
+
"aria-label": t.enter(item.title),
|
|
1262
|
+
title: t.enter(item.title),
|
|
1263
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1264
|
+
onClick: (event) => {
|
|
1265
|
+
event.preventDefault();
|
|
1266
|
+
event.stopPropagation();
|
|
1267
|
+
enter2(value);
|
|
1268
|
+
},
|
|
1269
|
+
className: cn(
|
|
1270
|
+
"flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md [&_svg]:size-4",
|
|
1271
|
+
"transition-colors hover:bg-black/5 dark:hover:bg-white/10",
|
|
1272
|
+
muted,
|
|
1273
|
+
classNames?.enter
|
|
1274
|
+
),
|
|
1275
|
+
...props({ "data-testid": `${rowTestId}-enter` }),
|
|
1276
|
+
children: icons.enter
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
const rowProps = {
|
|
1280
|
+
item: { value, label: item.title },
|
|
1281
|
+
onClick,
|
|
1282
|
+
className: cn(rowClass, className),
|
|
1283
|
+
...props({ "data-testid": rowTestId })
|
|
1284
|
+
};
|
|
1285
|
+
return link ? /* @__PURE__ */ jsx(Combobox$1.Item, { asChild: true, ...rowProps, children: /* @__PURE__ */ jsxs(Link, { ...link, children: [
|
|
1286
|
+
content,
|
|
1287
|
+
enterButton
|
|
1288
|
+
] }) }) : /* @__PURE__ */ jsxs(Combobox$1.Item, { ...rowProps, children: [
|
|
1289
|
+
content,
|
|
1290
|
+
enterButton
|
|
1291
|
+
] });
|
|
1292
|
+
};
|
|
1293
|
+
var Empty = ({ className, children, asChild, testId, ...rest }) => {
|
|
1294
|
+
const { query, view, translations: t, icons } = useSpotlightContext();
|
|
1295
|
+
if (!isEmpty(query, view)) return null;
|
|
1296
|
+
return /* @__PURE__ */ jsx(
|
|
1297
|
+
ark.div,
|
|
1298
|
+
{
|
|
1299
|
+
asChild,
|
|
1300
|
+
className: cn(popoverEmpty, "flex flex-col items-center gap-1", className),
|
|
1301
|
+
...props({ "data-testid": testId }),
|
|
1302
|
+
...rest,
|
|
1303
|
+
children: composeChildren(
|
|
1304
|
+
asChild,
|
|
1305
|
+
children,
|
|
1306
|
+
(own) => own ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1307
|
+
icons.empty != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mb-2 flex [&_svg]:size-6", children: icons.empty }),
|
|
1308
|
+
/* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium", TEXT_COLOR_CLASSES.primary), children: t.noResults(query.trim()) }),
|
|
1309
|
+
view.path.length > 0 ? (
|
|
1310
|
+
// The key drawn as the footer draws it: an icon on Apple, a word elsewhere.
|
|
1311
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs", children: [
|
|
1312
|
+
/* @__PURE__ */ jsx(Kbd, { size: "sm", hotkey: "backspace", translations: t.kbd }),
|
|
1313
|
+
t.noResultsScopedHint
|
|
1314
|
+
] })
|
|
1315
|
+
) : /* @__PURE__ */ jsx("span", { className: "text-xs", children: t.noResultsHint })
|
|
1316
|
+
] })
|
|
1317
|
+
)
|
|
1318
|
+
}
|
|
1319
|
+
);
|
|
1320
|
+
};
|
|
1321
|
+
var Prompt = ({ className, children, asChild, testId, ...rest }) => {
|
|
1322
|
+
const { query, view, translations: t, icons } = useSpotlightContext();
|
|
1323
|
+
const frame = view.path.at(-1);
|
|
1324
|
+
if (!frame || !isPrompt(query, view)) return null;
|
|
1325
|
+
const icon = frame.icon ?? icons.search;
|
|
1326
|
+
const hint = frame.title === void 0 ? frame.source.hint : void 0;
|
|
1327
|
+
return /* @__PURE__ */ jsx(
|
|
1328
|
+
ark.div,
|
|
1329
|
+
{
|
|
1330
|
+
asChild,
|
|
1331
|
+
className: cn(popoverEmpty, "flex flex-col items-center gap-1", className),
|
|
1332
|
+
...props({ "data-testid": testId }),
|
|
1333
|
+
...rest,
|
|
1334
|
+
children: composeChildren(
|
|
1335
|
+
asChild,
|
|
1336
|
+
children,
|
|
1337
|
+
(own) => own ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1338
|
+
icon != null && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("mb-2 flex [&_svg]:size-6", contentStroke), children: icon }),
|
|
1339
|
+
/* @__PURE__ */ jsx("span", { className: cn("text-sm font-medium", TEXT_COLOR_CLASSES.primary), children: /* @__PURE__ */ jsx("bdi", { children: t.promptTitle(resolveLabel(frame.label), frame.title) }) }),
|
|
1340
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: hint === void 0 ? t.promptHint : resolveLabel(hint) }),
|
|
1341
|
+
/* @__PURE__ */ jsxs("span", { className: "mt-2 inline-flex items-center gap-1.5 text-xs", children: [
|
|
1342
|
+
/* @__PURE__ */ jsx(Kbd, { size: "sm", hotkey: "backspace", translations: t.kbd }),
|
|
1343
|
+
t.promptBack
|
|
1344
|
+
] })
|
|
1345
|
+
] })
|
|
1346
|
+
)
|
|
1347
|
+
}
|
|
1348
|
+
);
|
|
1349
|
+
};
|
|
1350
|
+
var Footer = ({ className, classNames, testId }) => {
|
|
1351
|
+
const { view, highlighted, tabbable, translations: t } = useSpotlightContext();
|
|
1352
|
+
const found = highlighted === null ? void 0 : findValue(view, highlighted);
|
|
1353
|
+
const linked = found?.kind === "item" && found.entry.item.link !== void 0;
|
|
1354
|
+
const kbd = {
|
|
1355
|
+
...t.kbd,
|
|
1356
|
+
ctrl: t.kbd.ctrl ?? t.keyCtrl,
|
|
1357
|
+
escape: t.kbd.escape ?? t.keyEsc
|
|
1358
|
+
};
|
|
1359
|
+
const hints = [
|
|
1360
|
+
{ keys: ["arrowup", "arrowdown"], label: t.hintNavigate },
|
|
1361
|
+
{ keys: ["enter"], label: t.hintSelect },
|
|
1362
|
+
// ⌘ is a symbol; off Apple the modifier is a word, which a keyboard
|
|
1363
|
+
// layout may spell differently ("Strg").
|
|
1364
|
+
...linked ? [{ keys: ["mod+enter"], label: t.hintNewTab }] : [],
|
|
1365
|
+
...tabbable ? [{ keys: ["tab"], label: t.hintScope }] : [],
|
|
1366
|
+
view.path.length > 0 ? { keys: ["backspace", "escape"], label: t.hintLeaveScope, either: true } : { keys: ["escape"], label: t.hintClose }
|
|
1367
|
+
];
|
|
1368
|
+
return /* @__PURE__ */ jsx(
|
|
1369
|
+
"div",
|
|
1370
|
+
{
|
|
1371
|
+
...props({ "data-testid": testId }),
|
|
1372
|
+
className: cn(
|
|
1373
|
+
"flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-t px-4 py-2.5 text-xs max-sm:hidden",
|
|
1374
|
+
hairline,
|
|
1375
|
+
muted,
|
|
1376
|
+
className
|
|
1377
|
+
),
|
|
1378
|
+
children: hints.map(({ keys, label, either }) => (
|
|
1379
|
+
// A hint is one unit: the footer wraps between hints, never inside one
|
|
1380
|
+
// (between its caps and its label, or inside a translated label).
|
|
1381
|
+
/* @__PURE__ */ jsxs(
|
|
1382
|
+
"span",
|
|
1383
|
+
{
|
|
1384
|
+
className: cn("inline-flex items-center gap-1.5 whitespace-nowrap", classNames?.hint),
|
|
1385
|
+
children: [
|
|
1386
|
+
/* @__PURE__ */ jsx("span", { dir: "ltr", className: "inline-flex items-center gap-0.5", children: keys.map((key, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1387
|
+
either && index > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "/" }),
|
|
1388
|
+
/* @__PURE__ */ jsx(Kbd, { size: "sm", hotkey: key, translations: kbd })
|
|
1389
|
+
] }, key)) }),
|
|
1390
|
+
label
|
|
1391
|
+
]
|
|
1392
|
+
},
|
|
1393
|
+
label
|
|
1394
|
+
)
|
|
1395
|
+
))
|
|
1396
|
+
}
|
|
1397
|
+
);
|
|
1398
|
+
};
|
|
1399
|
+
var Layout = ({ classNames, testId }) => /* @__PURE__ */ jsxs(Root, { className: classNames?.root, testId, children: [
|
|
1400
|
+
/* @__PURE__ */ jsx(
|
|
1401
|
+
Input,
|
|
1402
|
+
{
|
|
1403
|
+
className: classNames?.input,
|
|
1404
|
+
testId: testId && `${testId}-input`,
|
|
1405
|
+
startSlot: /* @__PURE__ */ jsx(Path, { classNames: { scope: classNames?.scope }, testId: testId && `${testId}-path` })
|
|
1406
|
+
}
|
|
1407
|
+
),
|
|
1408
|
+
/* @__PURE__ */ jsx(List, { className: classNames?.list, testId: testId && `${testId}-list` }),
|
|
1409
|
+
/* @__PURE__ */ jsx(Footer, { className: classNames?.footer, testId: testId && `${testId}-footer` })
|
|
1410
|
+
] });
|
|
1411
|
+
var Spotlight = {
|
|
1412
|
+
Root,
|
|
1413
|
+
Input,
|
|
1414
|
+
Path,
|
|
1415
|
+
Scope,
|
|
1416
|
+
List,
|
|
1417
|
+
Group,
|
|
1418
|
+
Item,
|
|
1419
|
+
Empty,
|
|
1420
|
+
Prompt,
|
|
1421
|
+
Footer,
|
|
1422
|
+
Layout
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
// src/components/spotlight/translations.ts
|
|
1426
|
+
var SPOTLIGHT_TRANSLATIONS = {
|
|
1427
|
+
inputLabel: "Search",
|
|
1428
|
+
recents: "Recent",
|
|
1429
|
+
recentsIn: (label) => `Recent in ${label}`,
|
|
1430
|
+
noResults: (query) => `No results for \u201C${query}\u201D`,
|
|
1431
|
+
noResultsHint: "Try fewer or different words",
|
|
1432
|
+
noResultsScopedHint: "to widen the search",
|
|
1433
|
+
promptTitle: (label, title) => title === void 0 ? `Search ${label}` : `Search in ${title}`,
|
|
1434
|
+
promptHint: "Type to search",
|
|
1435
|
+
promptBack: "to go back",
|
|
1436
|
+
searchPlaceholder: (label, title) => title === void 0 ? `Search ${label}\u2026` : `Search in ${title}\u2026`,
|
|
1437
|
+
error: (group) => `Couldn't load ${group}`,
|
|
1438
|
+
retry: "Retry",
|
|
1439
|
+
results: (count) => count === 1 ? "1 result" : `${count} results`,
|
|
1440
|
+
scopes: "Search in",
|
|
1441
|
+
searchIn: (label) => `Search in ${label}`,
|
|
1442
|
+
seeAll: (group) => `See all in ${group}`,
|
|
1443
|
+
scopeLabel: (path) => `Searching in ${path.join(", ")}`,
|
|
1444
|
+
scopeCleared: "Searching everywhere",
|
|
1445
|
+
itemLabel: (source, title) => `${source}: ${title}`,
|
|
1446
|
+
enter: (title) => `Search in ${title}`,
|
|
1447
|
+
leaveScope: (chip) => `Leave ${chip}`,
|
|
1448
|
+
hintNavigate: "navigate",
|
|
1449
|
+
hintSelect: "select",
|
|
1450
|
+
hintNewTab: "new tab",
|
|
1451
|
+
hintScope: "search within",
|
|
1452
|
+
hintLeaveScope: "back",
|
|
1453
|
+
hintClose: "close",
|
|
1454
|
+
kbd: {},
|
|
1455
|
+
keyCtrl: "Ctrl",
|
|
1456
|
+
keyTab: "Tab",
|
|
1457
|
+
keyEsc: "Esc"
|
|
1458
|
+
};
|
|
1459
|
+
var RECENTS_KEY = "42-spotlight-recents";
|
|
1460
|
+
var TRANSLATION_KEYS = Object.keys(SPOTLIGHT_TRANSLATIONS);
|
|
1461
|
+
var KBD_KEYS = Object.keys(KBD_DEFAULT_TRANSLATIONS);
|
|
1462
|
+
var ICON_SLOTS = Object.keys(DEFAULT_ICONS);
|
|
1463
|
+
var SKELETON_DELAY = 120;
|
|
1464
|
+
var isRecent = (value) => typeof value === "object" && value !== null && "id" in value && "title" in value && "source" in value && typeof value.id === "string" && typeof value.title === "string" && typeof value.source === "string";
|
|
1465
|
+
function createSpotlight(config) {
|
|
1466
|
+
const engine = createSpotlightEngine(config.sources, {
|
|
1467
|
+
navigate: config.navigate,
|
|
1468
|
+
limit: config.limit
|
|
1469
|
+
});
|
|
1470
|
+
const spotlight = {
|
|
1471
|
+
open: engine.open,
|
|
1472
|
+
close: engine.close,
|
|
1473
|
+
toggle: engine.toggle,
|
|
1474
|
+
setQuery: engine.setQuery,
|
|
1475
|
+
setPath: engine.setPath,
|
|
1476
|
+
push: engine.push,
|
|
1477
|
+
pop: engine.pop,
|
|
1478
|
+
refresh: engine.refresh,
|
|
1479
|
+
loadMore: engine.loadMore,
|
|
1480
|
+
register: (source) => engine.register(source, true),
|
|
1481
|
+
select: engine.select,
|
|
1482
|
+
subscribe: engine.subscribe,
|
|
1483
|
+
getState: engine.getState
|
|
1484
|
+
};
|
|
1485
|
+
const useSpotlight = () => {
|
|
1486
|
+
const state = useSyncExternalStore(
|
|
1487
|
+
engine.subscribe,
|
|
1488
|
+
engine.getSnapshot,
|
|
1489
|
+
engine.getServerSnapshot
|
|
1490
|
+
);
|
|
1491
|
+
return useMemo(() => [state, spotlight], [state]);
|
|
1492
|
+
};
|
|
1493
|
+
const useSpotlightSource = (source) => {
|
|
1494
|
+
useEffect(() => engine.register(source, true), [source]);
|
|
1495
|
+
const { id } = source;
|
|
1496
|
+
return useMemo(
|
|
1497
|
+
() => ({ open: (query) => engine.open({ query, path: [{ source: id }] }) }),
|
|
1498
|
+
[id]
|
|
1499
|
+
);
|
|
1500
|
+
};
|
|
1501
|
+
const Registration = ({ source }) => {
|
|
1502
|
+
useSpotlightSource(source);
|
|
1503
|
+
return null;
|
|
1504
|
+
};
|
|
1505
|
+
const SpotlightSources = ({ sources }) => sources.map((source) => /* @__PURE__ */ jsx(Registration, { source }, source.id));
|
|
1506
|
+
const useSpotlightPath = (path) => {
|
|
1507
|
+
useEffect(() => engine.preset(path), [path]);
|
|
1508
|
+
};
|
|
1509
|
+
const SpotlightPath = ({ path }) => {
|
|
1510
|
+
useSpotlightPath(path);
|
|
1511
|
+
return null;
|
|
1512
|
+
};
|
|
1513
|
+
const recents = config.recents === false ? void 0 : config.recents ?? {};
|
|
1514
|
+
const SpotlightProvider = ({
|
|
1515
|
+
navigate,
|
|
1516
|
+
scopes = config.scopes ?? true,
|
|
1517
|
+
translations,
|
|
1518
|
+
icons,
|
|
1519
|
+
placeholder,
|
|
1520
|
+
classNames,
|
|
1521
|
+
testId,
|
|
1522
|
+
children
|
|
1523
|
+
}) => {
|
|
1524
|
+
const state = useSyncExternalStore(
|
|
1525
|
+
engine.subscribe,
|
|
1526
|
+
engine.getSnapshot,
|
|
1527
|
+
engine.getServerSnapshot
|
|
1528
|
+
);
|
|
1529
|
+
useHotkey(config.hotkey ?? "mod+k", () => engine.toggle(), { layer: false });
|
|
1530
|
+
const [stored, setStored] = useLocalStorage({
|
|
1531
|
+
key: recents?.storageKey ?? RECENTS_KEY,
|
|
1532
|
+
defaultValue: []
|
|
1533
|
+
});
|
|
1534
|
+
const t = useMemo(
|
|
1535
|
+
() => ({
|
|
1536
|
+
...SPOTLIGHT_TRANSLATIONS,
|
|
1537
|
+
...config.translations,
|
|
1538
|
+
...translations,
|
|
1539
|
+
// One level deeper for the Kbd words, so the provider's add to the factory's.
|
|
1540
|
+
kbd: { ...config.translations?.kbd, ...translations?.kbd }
|
|
1541
|
+
}),
|
|
1542
|
+
[
|
|
1543
|
+
...TRANSLATION_KEYS.filter((key) => key !== "kbd").map((key) => translations?.[key]),
|
|
1544
|
+
...KBD_KEYS.map((key) => translations?.kbd?.[key])
|
|
1545
|
+
]
|
|
1546
|
+
);
|
|
1547
|
+
const mergedIcons = useMemo(
|
|
1548
|
+
() => mergeIcons(mergeIcons(DEFAULT_ICONS, config.icons), icons),
|
|
1549
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: deps are the overrides' values
|
|
1550
|
+
ICON_SLOTS.map((slot) => icons?.[slot])
|
|
1551
|
+
);
|
|
1552
|
+
const navigateRef = useRef(navigate);
|
|
1553
|
+
useIsomorphicLayoutEffect(() => {
|
|
1554
|
+
navigateRef.current = navigate;
|
|
1555
|
+
}, [navigate]);
|
|
1556
|
+
const empty = state.query.trim() === "";
|
|
1557
|
+
const category = state.path.length === 1 ? scopeOf(state.path) : void 0;
|
|
1558
|
+
const at = state.path.length === 0 || category !== void 0;
|
|
1559
|
+
const scopedTo = category?.source;
|
|
1560
|
+
const scopedGroup = category?.group;
|
|
1561
|
+
const shown = useMemo(() => {
|
|
1562
|
+
if (!recents || !empty || !at) return [];
|
|
1563
|
+
const kept = (Array.isArray(stored) ? stored : []).filter(isRecent);
|
|
1564
|
+
const own = scopedTo === void 0 ? kept : kept.filter(
|
|
1565
|
+
({ source, group }) => source === scopedTo && (scopedGroup === void 0 || group === scopedGroup)
|
|
1566
|
+
);
|
|
1567
|
+
return own.slice(0, recents.limit ?? 5);
|
|
1568
|
+
}, [empty, at, scopedTo, scopedGroup, stored]);
|
|
1569
|
+
const scopesLabel = scopes && t.scopes;
|
|
1570
|
+
const view = useMemo(
|
|
1571
|
+
() => buildView(state, shown, {
|
|
1572
|
+
recents: t.recents,
|
|
1573
|
+
recentsIn: t.recentsIn,
|
|
1574
|
+
scopes: scopesLabel,
|
|
1575
|
+
limit: config.limit
|
|
1576
|
+
}),
|
|
1577
|
+
[state, shown, t.recents, t.recentsIn, scopesLabel]
|
|
1578
|
+
);
|
|
1579
|
+
const [highlight, setHighlight] = useState(null);
|
|
1580
|
+
const highlighted = highlight !== null && view.values.includes(highlight) ? highlight : view.values[0] ?? null;
|
|
1581
|
+
if (highlighted !== highlight) setHighlight(highlighted);
|
|
1582
|
+
const navigated = useRef(false);
|
|
1583
|
+
useEffect(() => {
|
|
1584
|
+
if (state.open) navigated.current = false;
|
|
1585
|
+
}, [state.open]);
|
|
1586
|
+
const context = useMemo(() => {
|
|
1587
|
+
const record = (recent) => {
|
|
1588
|
+
if (!recents || !recent) return;
|
|
1589
|
+
setStored(
|
|
1590
|
+
(previous) => [
|
|
1591
|
+
recent,
|
|
1592
|
+
...(Array.isArray(previous) ? previous : []).filter(
|
|
1593
|
+
(other) => other.source !== recent.source || other.id !== recent.id
|
|
1594
|
+
)
|
|
1595
|
+
].slice(0, recents.limit ?? 5)
|
|
1596
|
+
);
|
|
1597
|
+
};
|
|
1598
|
+
const select = (value) => {
|
|
1599
|
+
const found = findValue(view, value);
|
|
1600
|
+
if (!found) return;
|
|
1601
|
+
if (found.kind === "retry") return engine.refresh(found.source.id);
|
|
1602
|
+
if (found.kind === "see-all") return engine.push(found.frame);
|
|
1603
|
+
if (found.kind === "scope") {
|
|
1604
|
+
setHighlight(null);
|
|
1605
|
+
return engine.open({ path: [...engine.getState().path, found.frame], query: "" });
|
|
1606
|
+
}
|
|
1607
|
+
const { item, source, recent } = found.entry;
|
|
1608
|
+
record(recent ?? (source && toRecent(source, item)));
|
|
1609
|
+
navigated.current = item.link !== void 0;
|
|
1610
|
+
engine.select(item, { navigate: navigateRef.current });
|
|
1611
|
+
};
|
|
1612
|
+
return {
|
|
1613
|
+
open: state.open,
|
|
1614
|
+
query: state.query,
|
|
1615
|
+
view,
|
|
1616
|
+
translations: t,
|
|
1617
|
+
icons: mergedIcons,
|
|
1618
|
+
placeholder: placeholder ?? config.placeholder ?? "Search\u2026",
|
|
1619
|
+
skeletonDelay: config.skeletonDelay ?? SKELETON_DELAY,
|
|
1620
|
+
highlighted,
|
|
1621
|
+
highlight: setHighlight,
|
|
1622
|
+
setQuery: (query) => {
|
|
1623
|
+
setHighlight(null);
|
|
1624
|
+
const current = engine.getState();
|
|
1625
|
+
const prefixed = prefixFrame(query, current);
|
|
1626
|
+
if (prefixed)
|
|
1627
|
+
engine.open({ query: prefixed.query, path: [...current.path, prefixed.frame] });
|
|
1628
|
+
else engine.setQuery(query);
|
|
1629
|
+
},
|
|
1630
|
+
enter: (value) => {
|
|
1631
|
+
if (findValue(view, value)?.kind === "scope") return select(value);
|
|
1632
|
+
const frame = tabFrame(view, value);
|
|
1633
|
+
if (!frame) return;
|
|
1634
|
+
const current = engine.getState();
|
|
1635
|
+
if (frame.item !== void 0) setHighlight(null);
|
|
1636
|
+
engine.open({
|
|
1637
|
+
path: [...current.path, frame],
|
|
1638
|
+
query: frame.item === void 0 ? current.query : ""
|
|
1639
|
+
});
|
|
1640
|
+
},
|
|
1641
|
+
tabbable: tabFrame(view, highlighted) !== void 0,
|
|
1642
|
+
truncate: (length) => engine.setPath(engine.getState().path.slice(0, length)),
|
|
1643
|
+
pop: engine.pop,
|
|
1644
|
+
loadMore: engine.loadMore,
|
|
1645
|
+
close: () => {
|
|
1646
|
+
navigated.current = false;
|
|
1647
|
+
engine.close();
|
|
1648
|
+
},
|
|
1649
|
+
select,
|
|
1650
|
+
finalFocus: () => navigated.current ? document.body : null,
|
|
1651
|
+
modalProps: config.modalProps
|
|
1652
|
+
};
|
|
1653
|
+
}, [state.open, state.query, view, t, mergedIcons, placeholder, highlighted, setStored]);
|
|
1654
|
+
return /* @__PURE__ */ jsx(SpotlightContext.Provider, { value: context, children: children ?? /* @__PURE__ */ jsx(Spotlight.Layout, { classNames, testId }) });
|
|
1655
|
+
};
|
|
1656
|
+
return {
|
|
1657
|
+
spotlight,
|
|
1658
|
+
SpotlightProvider,
|
|
1659
|
+
useSpotlight,
|
|
1660
|
+
useSpotlightSource,
|
|
1661
|
+
SpotlightSources,
|
|
1662
|
+
useSpotlightPath,
|
|
1663
|
+
SpotlightPath
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
// src/components/spotlight/static-source.ts
|
|
1668
|
+
function staticSource({
|
|
1669
|
+
items,
|
|
1670
|
+
...source
|
|
1671
|
+
}) {
|
|
1672
|
+
const indexed = items.map((item) => ({
|
|
1673
|
+
item,
|
|
1674
|
+
text: fold([item.title, ...item.keywords ?? []].join(" "))
|
|
1675
|
+
}));
|
|
1676
|
+
return {
|
|
1677
|
+
debounce: 0,
|
|
1678
|
+
...source,
|
|
1679
|
+
items,
|
|
1680
|
+
search(query, { limit, cursor }) {
|
|
1681
|
+
const words = fold(query).split(/\s+/).filter(Boolean);
|
|
1682
|
+
const matches = indexed.filter(({ text }) => words.every((word) => text.includes(word))).map(({ item }) => item);
|
|
1683
|
+
const offset = Number(cursor ?? 0);
|
|
1684
|
+
const end = offset + limit;
|
|
1685
|
+
return {
|
|
1686
|
+
items: matches.slice(offset, end),
|
|
1687
|
+
nextCursor: end < matches.length ? String(end) : void 0
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
};
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
export { SPOTLIGHT_TRANSLATIONS, Spotlight, createSpotlight, fromRecent, matchRanges, resolveLabel, segment, staticSource, toRecent };
|
|
1694
|
+
//# sourceMappingURL=index.js.map
|
|
1695
|
+
//# sourceMappingURL=index.js.map
|