@42-central/ui-react 0.19.2 → 0.20.1
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-2HIX6DKN.js +85 -0
- package/dist/chunk-2HIX6DKN.js.map +1 -0
- package/dist/chunk-2LI3VPDP.js +39 -0
- package/dist/chunk-2LI3VPDP.js.map +1 -0
- package/dist/{chunk-VZH6TS7M.js → chunk-2MXWEIMD.js} +12 -6
- package/dist/chunk-2MXWEIMD.js.map +1 -0
- package/dist/{chunk-SVKU3GUN.js → chunk-3BXKTWWD.js} +14 -14
- package/dist/chunk-3BXKTWWD.js.map +1 -0
- package/dist/{chunk-Z6RPMRFH.js → chunk-45QRQKRC.js} +10 -9
- package/dist/chunk-45QRQKRC.js.map +1 -0
- package/dist/chunk-47LEAR6G.js +437 -0
- package/dist/chunk-47LEAR6G.js.map +1 -0
- package/dist/chunk-4ASNIDV7.js +17 -0
- package/dist/chunk-4ASNIDV7.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-LM6F6DLR.js → chunk-5HUEBSIS.js} +19 -10
- package/dist/chunk-5HUEBSIS.js.map +1 -0
- package/dist/{chunk-RKYXG6X7.js → chunk-6M6YZ3PQ.js} +17 -14
- package/dist/chunk-6M6YZ3PQ.js.map +1 -0
- package/dist/chunk-6N6J2DOE.js +27 -0
- package/dist/chunk-6N6J2DOE.js.map +1 -0
- package/dist/{chunk-CYWMES5P.js → chunk-6VYGK3Q3.js} +24 -12
- package/dist/chunk-6VYGK3Q3.js.map +1 -0
- package/dist/{chunk-IG7FBZVM.js → chunk-6YNLRQ25.js} +13 -12
- package/dist/chunk-6YNLRQ25.js.map +1 -0
- package/dist/{chunk-A6MYJTJI.js → chunk-7AQ4MN4M.js} +8 -9
- package/dist/chunk-7AQ4MN4M.js.map +1 -0
- package/dist/chunk-7BOSX65U.js +176 -0
- package/dist/chunk-7BOSX65U.js.map +1 -0
- package/dist/{chunk-BTFBBNRW.js → chunk-7CNDZZZ6.js} +6 -6
- package/dist/{chunk-BTFBBNRW.js.map → chunk-7CNDZZZ6.js.map} +1 -1
- 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-RIP5G47F.js → chunk-BE2LWUHY.js} +14 -12
- package/dist/chunk-BE2LWUHY.js.map +1 -0
- package/dist/{chunk-YW6Q6ERX.js → chunk-BNWQ7IAZ.js} +49 -56
- package/dist/chunk-BNWQ7IAZ.js.map +1 -0
- package/dist/{chunk-HCYULRWT.js → chunk-C4NFRSOR.js} +39 -35
- package/dist/chunk-C4NFRSOR.js.map +1 -0
- package/dist/chunk-C6NVU4F7.js +89 -0
- package/dist/chunk-C6NVU4F7.js.map +1 -0
- package/dist/chunk-CQ4M4BSF.js +12 -0
- package/dist/chunk-CQ4M4BSF.js.map +1 -0
- package/dist/chunk-D2QIPQ74.js +80 -0
- package/dist/chunk-D2QIPQ74.js.map +1 -0
- package/dist/chunk-DA4QII2N.js +104 -0
- package/dist/chunk-DA4QII2N.js.map +1 -0
- package/dist/chunk-DHM4IG2O.js +13 -0
- package/dist/chunk-DHM4IG2O.js.map +1 -0
- package/dist/chunk-DJLNGWMM.js +140 -0
- package/dist/chunk-DJLNGWMM.js.map +1 -0
- package/dist/chunk-DT6LKNZF.js +148 -0
- package/dist/chunk-DT6LKNZF.js.map +1 -0
- package/dist/chunk-E5H3YWZV.js +337 -0
- package/dist/chunk-E5H3YWZV.js.map +1 -0
- package/dist/{chunk-K5UWVH6P.js → chunk-E63VD25L.js} +36 -27
- package/dist/chunk-E63VD25L.js.map +1 -0
- package/dist/chunk-EIBDLRAR.js +30 -0
- package/dist/chunk-EIBDLRAR.js.map +1 -0
- package/dist/chunk-F342ZT7O.js +104 -0
- package/dist/chunk-F342ZT7O.js.map +1 -0
- package/dist/chunk-FUNTJZX7.js +217 -0
- package/dist/chunk-FUNTJZX7.js.map +1 -0
- package/dist/chunk-GIPQUKCN.js +44 -0
- package/dist/chunk-GIPQUKCN.js.map +1 -0
- package/dist/{chunk-IRXZHLUL.js → chunk-H3PYSAWN.js} +5 -5
- package/dist/chunk-H3PYSAWN.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-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-HDYORQZN.js +23 -0
- package/dist/chunk-HDYORQZN.js.map +1 -0
- package/dist/{chunk-4NNGTNPV.js → chunk-HRNWWL3Y.js} +49 -35
- package/dist/chunk-HRNWWL3Y.js.map +1 -0
- package/dist/chunk-HX3LNK26.js +193 -0
- package/dist/chunk-HX3LNK26.js.map +1 -0
- package/dist/chunk-IOYZC7SA.js +948 -0
- package/dist/chunk-IOYZC7SA.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-JQJ23YQX.js +38 -0
- package/dist/chunk-JQJ23YQX.js.map +1 -0
- package/dist/{chunk-WJOHNCYY.js → chunk-JVG5ISPT.js} +38 -91
- package/dist/chunk-JVG5ISPT.js.map +1 -0
- package/dist/chunk-JYKP4RSG.js +304 -0
- package/dist/chunk-JYKP4RSG.js.map +1 -0
- package/dist/chunk-K6YASO4L.js +25 -0
- package/dist/chunk-K6YASO4L.js.map +1 -0
- package/dist/{chunk-GCGX4FEF.js → chunk-KMZENCEP.js} +28 -42
- package/dist/chunk-KMZENCEP.js.map +1 -0
- package/dist/{chunk-UJZIF2BA.js → chunk-LBAE6FP6.js} +41 -55
- package/dist/chunk-LBAE6FP6.js.map +1 -0
- package/dist/{chunk-YQHOKMSV.js → chunk-LKFHUDEW.js} +61 -54
- package/dist/chunk-LKFHUDEW.js.map +1 -0
- package/dist/{chunk-PINENGML.js → chunk-MKKQE3TM.js} +16 -9
- package/dist/chunk-MKKQE3TM.js.map +1 -0
- package/dist/{chunk-2SVX3MQQ.js → chunk-MW42XVPD.js} +3 -3
- package/dist/{chunk-2SVX3MQQ.js.map → chunk-MW42XVPD.js.map} +1 -1
- package/dist/{chunk-VZBUQNLX.js → chunk-MXAACRWE.js} +52 -41
- package/dist/chunk-MXAACRWE.js.map +1 -0
- package/dist/{chunk-OGJFDNIS.js → chunk-NJPHZBLI.js} +86 -55
- package/dist/chunk-NJPHZBLI.js.map +1 -0
- package/dist/{chunk-WSIVRDRB.js → chunk-NKOTA5TM.js} +4 -4
- package/dist/{chunk-WSIVRDRB.js.map → chunk-NKOTA5TM.js.map} +1 -1
- package/dist/{chunk-FOMR74VE.js → chunk-NLOBBJAA.js} +6 -6
- package/dist/chunk-NLOBBJAA.js.map +1 -0
- package/dist/{chunk-YWRBG23W.js → chunk-NS6RGPWR.js} +7 -4
- package/dist/chunk-NS6RGPWR.js.map +1 -0
- package/dist/{chunk-FAOBC4IS.js → chunk-O5W3QWJ6.js} +39 -29
- package/dist/chunk-O5W3QWJ6.js.map +1 -0
- package/dist/chunk-O7LS6OZR.js +309 -0
- package/dist/chunk-O7LS6OZR.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-Z43YWH4R.js → chunk-POKLPMSB.js} +48 -26
- package/dist/chunk-POKLPMSB.js.map +1 -0
- package/dist/chunk-QKSLDQM2.js +120 -0
- package/dist/chunk-QKSLDQM2.js.map +1 -0
- package/dist/chunk-QNKD2SQM.js +340 -0
- package/dist/chunk-QNKD2SQM.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-64T6Z7BA.js → chunk-RCF7HTG5.js} +108 -96
- package/dist/chunk-RCF7HTG5.js.map +1 -0
- package/dist/{chunk-CTSO6V72.js → chunk-RLOWPCGG.js} +12 -6
- package/dist/chunk-RLOWPCGG.js.map +1 -0
- package/dist/chunk-RNRD6ER5.js +32 -0
- package/dist/chunk-RNRD6ER5.js.map +1 -0
- package/dist/chunk-SDVZFXQ2.js +21 -0
- package/dist/chunk-SDVZFXQ2.js.map +1 -0
- package/dist/{chunk-CZEKZ5HR.js → chunk-SVKN5ZHX.js} +33 -12
- package/dist/chunk-SVKN5ZHX.js.map +1 -0
- package/dist/{chunk-QIDAXFKK.js → chunk-SWVUXEBT.js} +53 -19
- package/dist/chunk-SWVUXEBT.js.map +1 -0
- package/dist/chunk-SXNAUSEB.js +62 -0
- package/dist/chunk-SXNAUSEB.js.map +1 -0
- package/dist/chunk-TCFB23JT.js +354 -0
- package/dist/chunk-TCFB23JT.js.map +1 -0
- package/dist/chunk-TWLJQE75.js +345 -0
- package/dist/chunk-TWLJQE75.js.map +1 -0
- package/dist/{chunk-CHTN5AHI.js → chunk-TWNIAF7K.js} +4 -4
- package/dist/chunk-TWNIAF7K.js.map +1 -0
- package/dist/chunk-UAYENYS2.js +293 -0
- package/dist/chunk-UAYENYS2.js.map +1 -0
- package/dist/chunk-UT3TOV2Q.js +93 -0
- package/dist/chunk-UT3TOV2Q.js.map +1 -0
- package/dist/{chunk-YKUCSV34.js → chunk-UXPINIDN.js} +8 -14
- package/dist/chunk-UXPINIDN.js.map +1 -0
- package/dist/{chunk-TBTSEPGP.js → chunk-VD6PB3VA.js} +10 -8
- package/dist/chunk-VD6PB3VA.js.map +1 -0
- package/dist/{chunk-2NNZHVKD.js → chunk-VTDBWU6H.js} +23 -19
- package/dist/chunk-VTDBWU6H.js.map +1 -0
- package/dist/chunk-WG3BCIU4.js +20 -0
- package/dist/chunk-WG3BCIU4.js.map +1 -0
- package/dist/chunk-XFEPUGUZ.js +15 -0
- package/dist/chunk-XFEPUGUZ.js.map +1 -0
- package/dist/{chunk-CSCVTESP.js → chunk-XKDL4QS6.js} +5 -12
- package/dist/chunk-XKDL4QS6.js.map +1 -0
- package/dist/chunk-XXOR34T4.js +10 -0
- package/dist/chunk-XXOR34T4.js.map +1 -0
- package/dist/chunk-Y57NW6G7.js +316 -0
- package/dist/chunk-Y57NW6G7.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 +28 -16
- 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 +6 -5
- 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 +23 -11
- 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 +39 -28
- 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 +47 -19
- 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 +17 -20
- 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 +27 -14
- 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 +31 -7
- 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 +6 -5
- package/dist/components/button-group/index.js +2 -2
- package/dist/components/button-multi-select/index.js +11 -9
- 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 +11 -9
- 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 +11 -9
- 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 +3 -2
- 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 +12 -2
- 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 +8 -6
- 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 +51 -49
- 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 +13 -2
- 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 +61 -24
- 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 +4 -3
- 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 +11 -9
- 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 +12 -10
- 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 +4 -1
- package/dist/components/code-block/static.js.map +1 -1
- package/dist/components/collapse/index.js +3 -3
- 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 +11 -9
- 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 +14 -11
- 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 +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 +282 -199
- 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 +24 -21
- 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 +3 -2
- 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 +11 -7
- 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 +3 -2
- 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 +206 -102
- 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 +3 -2
- 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 +3 -11
- package/dist/components/grid/index.js.map +1 -1
- package/dist/components/hover-card/index.js +5 -4
- 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 +11 -4
- 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 +4 -3
- 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 +2 -2
- 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 +13 -7
- 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 +11 -7
- 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 +16 -13
- 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 +26 -20
- 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 +10 -7
- 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 +10 -7
- 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 +60 -22
- 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 +11 -9
- 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 +29 -32
- 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 +14 -6
- 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 +6 -4
- 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 +13 -7
- 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 +40 -13
- 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 +5 -4
- 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 +12 -6
- 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 +17 -7
- 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 +3315 -2730
- 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 +9 -7
- 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 +14 -12
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +3 -2
- 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 +3 -2
- 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 +8 -7
- 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 +4 -2
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +6 -5
- 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 +42 -25
- 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 +3 -3
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/text-input/index.js +4 -3
- package/dist/components/text-input/index.js.map +1 -1
- package/dist/components/textarea/index.js +4 -3
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/theme-icon/index.js +3 -3
- 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 +22 -21
- 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 +44 -31
- 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 +3 -3
- package/dist/components/title/title.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +4 -3
- 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 +112 -248
- 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 +105 -321
- 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 +60 -113
- package/dist/index.js.map +1 -1
- package/dist/lib/as-child.d.ts +1 -1
- package/dist/lib/cn.d.ts.map +1 -1
- package/dist/lib/cn.js +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 +80 -0
- package/src/components/card/card.tsx +9 -3
- 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 +23 -2
- package/src/lib/cn.ts +9 -1
- 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-QP4I37PA.js +0 -14
- package/dist/chunk-QP4I37PA.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 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/mark/mark.tsx"],"names":[],"mappings":";;;;AAqDO,IAAM,IAAA,GAAO,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,YAAY,QAAA,EAAU,MAAA,EAAQ,GAAG,IAAA,EAAK,KAAiB;AAG9F,EAAA,MAAM,cAAA,GAAiB,UAAA,KAAe,MAAA,IAAa,KAAA,KAAU,MAAA;AAC7D,EAAA,MAAM,KAAK,UAAA,IAAc,QAAA;AAWzB,EAAA,MAAM,IAAA,GACJ,EAAA,KAAO,SAAA,IAAa,EAAA,KAAO,SAAS,eAAA,GAAkB,0CAAA;AACxD,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAY,iBAAiB,EAAA,GAAK,MAAA;AAAA,MACjC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOA,cAAA,GAAiB,CAAC,IAAA,EAAM,cAAc,CAAA,GAAI,gBAAA;AAAA,QAC1C;AAAA,OACF;AAAA,MAEA,8BAAC,MAAA,EAAA,EAAK,YAAA,EAAY,SAAS,SAAA,EAAW,SAAA,EAAU,mBAC7C,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-NS6RGPWR.js","sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Mark — an inline `<mark>` highlighter. Pure React Server Component.\n *\n * `background` and `color` are fully independent — `background` only ever\n * changes the highlight, `color` only ever changes the text, neither leaks\n * into the other: `background` alone (no `color`) tints the highlight with\n * *neutral* text, not text matching the highlight; `color` alone (no\n * `background`) renders as tinted text with no highlight at all —\n * `background` only defaults to `\"yellow\"` when it's unset, regardless of\n * `color`. This needs two DOM nodes rather than one: `--c-soft`/`--c-text`\n * are both defined together inside the same `[data-color=\"X\"]` block in\n * `colors.css`, so a single `data-color` attribute can only ever scope one\n * color's worth of both vars at once. Letting background and text pick\n * *different* color names — and stay theme-aware, the whole reason\n * `--c-soft`/`--c-text` exist instead of a fixed shade — means they need two\n * independently-scoped `data-color` attributes. The outer `<mark>` scopes\n * `--c-soft` for the background; the inner `<span>` scopes its own `--c-text`\n * for the text, independent of the outer scope.\n *\n * The inner span's `text-(--c-text)` class is unconditional — never gated\n * behind an `if (color)` branch — so it always declares its own explicit\n * `color`, never inheriting one. That's what makes nesting a colored `<Mark>`\n * inside a colored `<Code>` (or any other colored ancestor) \"just work\": an\n * ancestor's `color` only reaches a descendant by inheritance, the\n * lowest-priority source of a property's value, so the inner span's own\n * declaration always wins, no `!important` or descendant-selector games\n * needed.\n *\n * No `asChild` (plain `ComponentPropsWithoutRef<\"mark\">`, not `HTMLArkProps`):\n * the inner span above already repurposes `children` as \"the highlighted\n * content,\" which collides with `asChild`'s usual meaning (the one child to\n * render as root) — the same reasoning `Skeleton`'s wrap mode uses to skip it.\n */\nexport type MarkProps = ComponentPropsWithoutRef<\"mark\"> &\n WithTestId & {\n /**\n * Text color. Independent of `background` — never falls back to it.\n * @default \"neutral\"\n */\n color?: Color\n /**\n * Background/highlight tint. Re-exported as `Color` from `@42/ui-react`.\n * @default \"yellow\"\n */\n background?: Color\n }\n\nexport const Mark = ({ className, color, background, children, testId, ...rest }: MarkProps) => {\n // A background only defaults to \"yellow\" when neither prop is given —\n // `color` alone must render as tinted text with no highlight at all.\n const showBackground = background !== undefined || color === undefined\n const bg = background ?? \"yellow\"\n // A chromatic highlight is a translucent `--c-solid` wash (the recipe\n // Alert uses), so it reads at the same strength on the page and on a\n // tinted popover. `--c-soft` can't do it: in light it is a palette's\n // near-white 50 step, and in dark its 950 step matches the brand-950\n // surface, so brand vanished there. Dark takes a lighter wash because the\n // 500 steps stand out more against a dark surface than a light one.\n // `neutral`'s solid is pure black or white, which at the chromatic\n // strength would be the heaviest highlight and pull its gray text under\n // AA in light, so it takes its own `--c-soft`: that slot is already\n // black or white at 16%, the same visual weight as the other hues.\n const tint =\n bg === \"neutral\" || bg === \"gray\" ? \"bg-(--c-soft)\" : \"bg-(--c-solid)/35 dark:bg-(--c-solid)/25\"\n return (\n <mark\n data-color={showBackground ? bg : undefined}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(\n \"rounded-xs\",\n // Browsers ship a UA-stylesheet default for `<mark>` (a solid yellow\n // background, historically with black text) — an explicit\n // `bg-transparent` is required in the no-background branch, or that\n // default bleeds through instead of \"no highlight at all\".\n // `dark:` adds no specificity, so it overrides the light tint by\n // source order, which Tailwind always emits after the base utility.\n showBackground ? [tint, \"px-0.5 py-px\"] : \"bg-transparent\",\n className,\n )}\n >\n <span data-color={color ?? \"neutral\"} className=\"text-(--c-text)\">\n {children}\n </span>\n </mark>\n )\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { PillGroupContext, pill } from './chunk-
|
|
2
|
-
import { inputSlot, inputShell, inputControlClasses } from './chunk-
|
|
1
|
+
import { PillGroupContext, pill } from './chunk-6M6YZ3PQ.js';
|
|
2
|
+
import { inputSlot, inputShell, inputControlClasses } from './chunk-45QRQKRC.js';
|
|
3
|
+
import { useElementSize } from './chunk-2LI3VPDP.js';
|
|
4
|
+
import { useLocale } from './chunk-IPYHTCFL.js';
|
|
3
5
|
import { props } from './chunk-WYCMIIRR.js';
|
|
4
|
-
import { cn } from './chunk-
|
|
6
|
+
import { cn } from './chunk-4ASNIDV7.js';
|
|
5
7
|
import { ark } from '@ark-ui/react';
|
|
6
8
|
import { cva } from 'class-variance-authority';
|
|
7
9
|
import { Children, isValidElement, cloneElement, useRef, useState, useLayoutEffect, useEffect } from 'react';
|
|
@@ -36,7 +38,7 @@ function visiblePillCount(offsetTops, maxLines) {
|
|
|
36
38
|
}
|
|
37
39
|
return offsetTops.length;
|
|
38
40
|
}
|
|
39
|
-
function pillCountWithField(pills, maxLines,
|
|
41
|
+
function pillCountWithField(pills, maxLines, rowEnd, trailing) {
|
|
40
42
|
const total = pills.length;
|
|
41
43
|
const { fieldMinWidth, counterWidth, gap } = trailing;
|
|
42
44
|
let visible = visiblePillCount(
|
|
@@ -48,7 +50,7 @@ function pillCountWithField(pills, maxLines, rowRight, trailing) {
|
|
|
48
50
|
if (last == null) break;
|
|
49
51
|
const needsCounter = visible < total;
|
|
50
52
|
const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0);
|
|
51
|
-
if (last.
|
|
53
|
+
if (last.end + trailingWidth <= rowEnd) break;
|
|
52
54
|
visible--;
|
|
53
55
|
}
|
|
54
56
|
return visible;
|
|
@@ -87,33 +89,27 @@ function usePillOverflow({
|
|
|
87
89
|
}
|
|
88
90
|
const style = getComputedStyle(container);
|
|
89
91
|
const gap = Number.parseFloat(style.columnGap || style.gap) || 0;
|
|
90
|
-
const
|
|
92
|
+
const row = container.getBoundingClientRect();
|
|
93
|
+
const rtl = style.direction === "rtl";
|
|
94
|
+
const inlineEnd = (rect) => rtl ? row.right - rect.left : rect.right - row.left;
|
|
91
95
|
const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0;
|
|
92
96
|
const counterEl = container.querySelector("[data-overflow-counter]");
|
|
93
97
|
const counterWidth = counterEl?.getBoundingClientRect().width ?? 0;
|
|
94
98
|
const pills = items.map((el) => {
|
|
95
99
|
const rect = el.getBoundingClientRect();
|
|
96
|
-
return { top: rect.top,
|
|
100
|
+
return { top: rect.top, end: inlineEnd(rect) };
|
|
97
101
|
});
|
|
98
102
|
setVisibleCount(
|
|
99
|
-
pillCountWithField(pills, maxLines,
|
|
103
|
+
pillCountWithField(pills, maxLines, row.width, { fieldMinWidth, counterWidth, gap })
|
|
100
104
|
);
|
|
101
105
|
setMeasuring(false);
|
|
102
106
|
}, [measuring, count, maxLines]);
|
|
107
|
+
const width = useElementSize(containerRef, { enabled: maxLines != null })?.width;
|
|
103
108
|
useIsoLayoutEffect(() => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const observer = new ResizeObserver((entries) => {
|
|
109
|
-
const width = entries[0]?.contentRect.width ?? 0;
|
|
110
|
-
if (Math.abs(width - lastWidth.current) < 1) return;
|
|
111
|
-
lastWidth.current = width;
|
|
112
|
-
setMeasuring(true);
|
|
113
|
-
});
|
|
114
|
-
observer.observe(container);
|
|
115
|
-
return () => observer.disconnect();
|
|
116
|
-
}, [maxLines]);
|
|
109
|
+
if (width === void 0 || Math.abs(width - lastWidth.current) < 1) return;
|
|
110
|
+
lastWidth.current = width;
|
|
111
|
+
setMeasuring(true);
|
|
112
|
+
}, [width]);
|
|
117
113
|
const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count);
|
|
118
114
|
return {
|
|
119
115
|
containerRef,
|
|
@@ -122,14 +118,26 @@ function usePillOverflow({
|
|
|
122
118
|
measuring
|
|
123
119
|
};
|
|
124
120
|
}
|
|
121
|
+
var englishPlural = new Intl.PluralRules("en-US");
|
|
122
|
+
var PILLS_INPUT_DEFAULT_TRANSLATIONS = {
|
|
123
|
+
overflowCount: (count, formatted) => `${formatted} more ${englishPlural.select(count) === "one" ? "item" : "items"}`
|
|
124
|
+
};
|
|
125
125
|
var PillOverflowCounter = ({
|
|
126
126
|
count,
|
|
127
127
|
size = "md",
|
|
128
|
-
className
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
className,
|
|
129
|
+
translations
|
|
130
|
+
}) => {
|
|
131
|
+
const locale = useLocale();
|
|
132
|
+
const overflowCount = translations?.overflowCount ?? PILLS_INPUT_DEFAULT_TRANSLATIONS.overflowCount;
|
|
133
|
+
return (
|
|
134
|
+
// `relative`: contains the absolutely positioned `sr-only` text.
|
|
135
|
+
/* @__PURE__ */ jsxs("span", { "data-overflow-counter": true, className: cn(pill({ size }), "relative tabular-nums", className), children: [
|
|
136
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: new Intl.NumberFormat(locale, { signDisplay: "always" }).format(count) }),
|
|
137
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: overflowCount(count, new Intl.NumberFormat(locale).format(count)) })
|
|
138
|
+
] })
|
|
139
|
+
);
|
|
140
|
+
};
|
|
133
141
|
var PillsInputBase = ({
|
|
134
142
|
size = "md",
|
|
135
143
|
variant = "default",
|
|
@@ -144,6 +152,7 @@ var PillsInputBase = ({
|
|
|
144
152
|
classNames,
|
|
145
153
|
children,
|
|
146
154
|
testId,
|
|
155
|
+
translations,
|
|
147
156
|
asChild: _asChild,
|
|
148
157
|
...rest
|
|
149
158
|
}) => {
|
|
@@ -184,7 +193,8 @@ var PillsInputBase = ({
|
|
|
184
193
|
{
|
|
185
194
|
count: measuring ? pills.length : hiddenCount,
|
|
186
195
|
size,
|
|
187
|
-
className: measuring ? "invisible" : void 0
|
|
196
|
+
className: measuring ? "invisible" : void 0,
|
|
197
|
+
translations
|
|
188
198
|
}
|
|
189
199
|
),
|
|
190
200
|
field
|
|
@@ -220,5 +230,5 @@ var PillsInput = Object.assign(PillsInputBase, {
|
|
|
220
230
|
});
|
|
221
231
|
|
|
222
232
|
export { PillOverflowCounter, PillsInput, pillsContent, pillsShell, usePillOverflow };
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
224
|
-
//# sourceMappingURL=chunk-
|
|
233
|
+
//# sourceMappingURL=chunk-O5W3QWJ6.js.map
|
|
234
|
+
//# sourceMappingURL=chunk-O5W3QWJ6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/pills-input/pills-input.tsx"],"names":[],"mappings":";;;;;;;;;;;AAsDO,IAAM,UAAA,GAAa,GAAG,aAAa;AAMnC,IAAM,YAAA,GAAe,IAAI,2DAAA,EAA6D;AAAA,EAC3F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,OAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAC3B,CAAC;AAKD,IAAM,kBAAA,GAAqB,OAAO,QAAA,KAAa,WAAA,GAAc,eAAA,GAAkB,SAAA;AAWxE,SAAS,gBAAA,CAAiB,YAAsB,QAAA,EAA0B;AAC/E,EAAA,IAAI,IAAA,GAAO,CAAA;AACX,EAAA,IAAI,UAAU,MAA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5W3QWJ6.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n Children,\n type ComponentPropsWithoutRef,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useLocale } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useElementSize } from \"../../lib/use-element-size\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { PillGroupContext, type PillSize, pill } from \"../pill/pill\"\n\n/**\n * PillsInput — a multi-line input shell that lays out `Pill`s alongside a search\n * field. Same chrome as `Input` (border, focus ring, invalid / disabled states)\n * but it wraps as values accumulate. It's the visual `MultiSelect` and\n * `TagsInput` mount as their target.\n *\n * - It reuses `Input`'s slot layout: a `startSlot` / `endSlot` flank a\n * `pillsContent` region that holds the `Pill`s + the field and is the only\n * thing that wraps, so a trailing control (chevron, clear) pins to the edge\n * instead of wrapping inline with the pills.\n * - Host `Pill`s + a single `PillsInputField` inside it (pills first, field\n * last). The shell sets the pill `size` / `disabled` through context, so the\n * pills match with no prop drilling.\n * - `maxLines` caps the pills at N rows and collapses the rest into a static\n * \"+N\" counter (measured, since pills have variable widths).\n *\n * Presentational by design: the value state lives with the consumer.\n */\n\n/** The pills *row*: same single-line flex shell as `inputShell`, just text-cursor\n * for the click-to-focus affordance. Layout/wrap live on `pillsContent`. */\nexport const pillsShell = cn(\"cursor-text\")\n\n/** The wrapping region inside a pills shell — holds the pills + field, grows to\n * fill the row (`flex-1`), and is the only element that wraps, so the shell's\n * start/end slots stay pinned as `shrink-0` siblings. Gap tracks `inputShell`'s\n * per-size gap so pill spacing is unchanged from the flat layout. */\nexport const pillsContent = cva(\"flex min-w-0 flex-1 flex-wrap items-center py-1 gap-y-0.5\", {\n variants: {\n size: {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// `useLayoutEffect` measures before paint (no flash); fall back to `useEffect`\n// on the server so SSR doesn't warn. Measurement is client-only anyway — the\n// server render shows every pill, which is the correct no-cap fallback.\nconst useIsoLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect\n\n/**\n * Pure row-grouping math behind `usePillOverflow` (exported for testing).\n *\n * Given each measured pill's `offsetTop` (in document order), count how many\n * fit within `maxLines` wrapped rows. A jump in `offsetTop` (beyond a sub-pixel\n * epsilon) marks a new row. When the pills overflow, reserve one slot on the\n * last visible row for the \"+N\" counter (it's narrower than a typical pill, so\n * dropping one always makes room).\n */\nexport function visiblePillCount(offsetTops: number[], maxLines: number): number {\n let rows = 0\n let lastTop = Number.NEGATIVE_INFINITY\n for (let i = 0; i < offsetTops.length; i++) {\n const top = offsetTops[i] ?? lastTop\n if (top - lastTop > 1) {\n rows += 1\n lastTop = top\n if (rows > maxLines) {\n // `i` begins the row past the cap — keep the rows before it, minus one\n // for the counter.\n return Math.max(0, i - 1)\n }\n }\n }\n return offsetTops.length\n}\n\n/**\n * Like `visiblePillCount`, but also keeps the trailing input field on the last\n * visible row (exported for testing).\n *\n * `visiblePillCount` only reasons about pills, so when the last visible row is\n * packed, the field — which is `min-w-16` and the last flex child — can't claim\n * its minimum width and wraps onto a new line. A flex item wraps exactly when\n * the space left on its row drops below its `min-width`, so we drop pills until\n * the last visible pill leaves room on its row for `gap + fieldMinWidth` (plus\n * the `+N` counter, once anything is hidden). Pills are passed as `{ top, end }`,\n * where `end` is how far the pill's inline-end edge sits from the row's\n * inline-start edge, and `rowEnd` is the row's inline length — logical, so the\n * same math holds in RTL, where the free space is on the pill's left. Removing a\n * trailing pill never reflows the ones before it, so each drop is checked\n * against real geometry.\n */\nexport function pillCountWithField(\n pills: { top: number; end: number }[],\n maxLines: number,\n rowEnd: number,\n trailing: { fieldMinWidth: number; counterWidth: number; gap: number },\n): number {\n const total = pills.length\n const { fieldMinWidth, counterWidth, gap } = trailing\n // Start from the pill-only cap (already reserves one slot for the counter on\n // overflow), then back off until the field's minimum fits on the last row.\n let visible = visiblePillCount(\n pills.map((p) => p.top),\n maxLines,\n )\n while (visible > 0) {\n const last = pills[visible - 1]\n if (last == null) break\n // Hiding any pill surfaces the \"+N\" counter, which shares the last row.\n const needsCounter = visible < total\n const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0)\n if (last.end + trailingWidth <= rowEnd) break\n visible--\n }\n return visible\n}\n\n/**\n * Measure how many pills fit within `maxLines` rows and how many overflow.\n *\n * Line caps are width-dependent (pills vary in width), so this measures the DOM.\n * Pills to be measured must carry `data-overflow-item`; the trailing field and\n * the counter must NOT (they would corrupt row detection) — instead the field\n * carries `data-overflow-field` and the counter `data-overflow-counter` so the\n * hook can locate and measure them without mistaking them for pills. The hook\n * renders the full set during a pre-paint \"measuring\" pass, groups pills into\n * rows, then settles on a `visibleCount` — reserving the last row for the \"+N\"\n * chip and, when a field is present, its `min-width` too, so the field never\n * wraps onto a new line (see `pillCountWithField`). Re-measures on width change\n * only (ignoring the height change our own slicing causes, which would loop).\n *\n * `measuring` is exposed so consumers can render the counter during the\n * measuring pass (it is otherwise hidden when nothing overflows), letting the\n * hook measure its real width for the last-row reservation.\n */\nexport function usePillOverflow({\n maxLines,\n count,\n}: {\n /** Cap the rendered pills at this many rows. Omit to render every pill. */\n maxLines?: number\n /** Total number of pills — drives re-measurement on add / remove. */\n count: number\n}): {\n containerRef: RefObject<HTMLDivElement | null>\n visibleCount: number\n hiddenCount: number\n measuring: boolean\n} {\n const containerRef = useRef<HTMLDivElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n // While true, every pill is rendered so the DOM reflects the full set; flipped\n // off (pre-paint) once the cutoff is computed.\n const [measuring, setMeasuring] = useState(true)\n const lastWidth = useRef(0)\n\n // Any change to the inputs re-enters a full-render measuring pass.\n useIsoLayoutEffect(() => {\n setMeasuring(true)\n }, [count, maxLines])\n\n useIsoLayoutEffect(() => {\n if (!measuring) return\n const container = containerRef.current\n if (maxLines == null || container == null) {\n setVisibleCount(count)\n setMeasuring(false)\n return\n }\n const items = Array.from(container.querySelectorAll<HTMLElement>(\"[data-overflow-item]\"))\n lastWidth.current = container.clientWidth\n\n const fieldEl = container.querySelector<HTMLElement>(\"[data-overflow-field]\")\n if (fieldEl == null) {\n // No trailing field (e.g. TreeMultiSelect's read-only trigger) — pills +\n // counter only, the original behavior.\n setVisibleCount(\n visiblePillCount(\n items.map((el) => el.offsetTop),\n maxLines,\n ),\n )\n setMeasuring(false)\n return\n }\n\n // Field-aware: reserve the field's min width (and the counter slot) on the\n // last visible row. Measure in viewport coords via `getBoundingClientRect`\n // so pill edges and the row's edges share one coordinate space regardless\n // of `offsetParent` (the positioned shell, not this container), then turn\n // them into inline offsets from the row's start: under RTL the row fills\n // from the right, and a physical `right` would read every pill as already\n // touching the row's end.\n const style = getComputedStyle(container)\n const gap = Number.parseFloat(style.columnGap || style.gap) || 0\n const row = container.getBoundingClientRect()\n const rtl = style.direction === \"rtl\"\n const inlineEnd = (rect: DOMRect) => (rtl ? row.right - rect.left : rect.right - row.left)\n const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0\n const counterEl = container.querySelector<HTMLElement>(\"[data-overflow-counter]\")\n const counterWidth = counterEl?.getBoundingClientRect().width ?? 0\n const pills = items.map((el) => {\n const rect = el.getBoundingClientRect()\n return { top: rect.top, end: inlineEnd(rect) }\n })\n setVisibleCount(\n pillCountWithField(pills, maxLines, row.width, { fieldMinWidth, counterWidth, gap }),\n )\n setMeasuring(false)\n }, [measuring, count, maxLines])\n\n // Re-measure when the field's width changes (a wider field reveals more\n // pills again). Ignore height-only changes — our own slicing shrinks the\n // height and would otherwise feed back into an infinite measure loop.\n const width = useElementSize(containerRef, { enabled: maxLines != null })?.width\n useIsoLayoutEffect(() => {\n if (width === undefined || Math.abs(width - lastWidth.current) < 1) return\n lastWidth.current = width\n setMeasuring(true)\n }, [width])\n\n const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count)\n return {\n containerRef,\n visibleCount: resolved,\n hiddenCount: Math.max(0, count - resolved),\n measuring,\n }\n}\n\n/** The wording of the pill controls' \"+N\" counter — shared by `PillsInput`, `MultiSelect`,\n * `TagsInput` and `TreeMultiSelect`, each taking it on its own `translations`. */\nexport type PillsInputTranslations = {\n /** What a screen reader hears for the \"+N\" counter, instead of \"plus 3\". Gets the hidden\n * count (for plural rules) and that count formatted for the locale.\n * Default `(count, n) => \\`${n} more items\\`` (\"item\" for one). */\n overflowCount?: (count: number, formatted: string) => string\n}\n\nconst englishPlural = new Intl.PluralRules(\"en-US\")\n\nexport const PILLS_INPUT_DEFAULT_TRANSLATIONS = {\n overflowCount: (count, formatted) =>\n `${formatted} more ${englishPlural.select(count) === \"one\" ? \"item\" : \"items\"}`,\n} as const satisfies Required<PillsInputTranslations>\n\nexport type PillOverflowCounterProps = {\n /** How many pills are hidden. */\n count: number\n size?: PillSize\n className?: string\n /** The owning control's `translations`; only `overflowCount` is read. */\n translations?: PillsInputTranslations\n}\n\n/** Static \"+N\" chip the pill controls render at the end of the visible rows.\n * Non-interactive: the \"+N\" is drawn in the locale's digits and sign (`+٣` in\n * `ar-EG`) and hidden from screen readers, which read `overflowCount` instead.\n * The full set stays reachable via the dropdown (where one exists) or the\n * consumer's own state. */\nexport const PillOverflowCounter = ({\n count,\n size = \"md\",\n className,\n translations,\n}: PillOverflowCounterProps) => {\n const locale = useLocale()\n // The one key it reads; an owner forwarding `{ overflowCount: undefined }` keeps the default.\n const overflowCount =\n translations?.overflowCount ?? PILLS_INPUT_DEFAULT_TRANSLATIONS.overflowCount\n return (\n // `relative`: contains the absolutely positioned `sr-only` text.\n <span data-overflow-counter className={cn(pill({ size }), \"relative tabular-nums\", className)}>\n <span aria-hidden>\n {new Intl.NumberFormat(locale, { signDisplay: \"always\" }).format(count)}\n </span>\n <span className=\"sr-only\">\n {overflowCount(count, new Intl.NumberFormat(locale).format(count))}\n </span>\n </span>\n )\n}\n\ntype PillsInputClassNames = {\n root?: string\n content?: string\n startSlot?: string\n endSlot?: string\n}\n\nexport type PillsInputProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n WithTestId & {\n size?: InputSize\n variant?: InputVariant\n color?: Color\n invalid?: boolean\n disabled?: boolean\n pointer?: boolean\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before any trailing control. */\n endSlot?: ReactNode\n classNames?: PillsInputClassNames\n /** The \"+N\" counter's screen-reader wording — see `PillsInputTranslations`. */\n translations?: PillsInputTranslations\n }\n\n/**\n * PillsInput — the wrapping input shell for multi-value fields. Host `Pill`s\n * and a single `PillsInput.Field` inside; the shell sizes and disables them\n * through context. Presentational by design: it holds no value state.\n *\n * `testId` here lands on the shell `<div>` itself — useful when `PillsInput`\n * is used bare. `PillsInput.Field` has its own `testId`, landing on the real\n * focusable `<input>`; prefer that one when targeting the field.\n */\nconst PillsInputBase = ({\n size = \"md\",\n variant = \"default\",\n color,\n invalid,\n disabled,\n pointer,\n maxLines,\n startSlot,\n endSlot,\n className,\n classNames,\n children,\n testId,\n translations,\n asChild: _asChild,\n ...rest\n}: PillsInputProps) => {\n // Convention: pills first, the field last. Only the pills feed the line cap;\n // the field always stays visible (it is never sliced away).\n const items = Children.toArray(children)\n const field = items.length > 0 ? items[items.length - 1] : null\n const pills = items.length > 0 ? items.slice(0, -1) : []\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: pills.length,\n })\n\n const renderedPills = (maxLines == null ? pills : pills.slice(0, visibleCount)).map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<Record<string, unknown>>, {\n key: child.key ?? i,\n \"data-overflow-item\": true,\n })\n : child,\n )\n\n return (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n data-color={color}\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-pointer\": pointer,\n // Slot-aware padding in `inputShell` — see InputBase for the rationale.\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), pillsShell, className, classNames?.root)}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={cn(pillsContent({ size }), classNames?.content)}>\n {renderedPills}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? pills.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n translations={translations}\n />\n )}\n {field}\n </div>\n {endSlot != null && <span className={cn(inputSlot, classNames?.endSlot)}>{endSlot}</span>}\n </ark.div>\n </PillGroupContext.Provider>\n )\n}\n\nexport type PillsInputFieldProps = ComponentPropsWithoutRef<\"input\"> &\n WithTestId & {\n /** Fired on Backspace when the field is empty — pop the last value. */\n onRemoveLast?: () => void\n }\n\nconst PillsInputField = ({\n className,\n onRemoveLast,\n onKeyDown,\n testId,\n ...rest\n}: PillsInputFieldProps) => (\n <input\n // The trailing field the overflow hook keeps on the last visible row.\n data-overflow-field\n // Grow to fill the line, but keep a clickable minimum when empty. Overrides\n // `inputControlClasses`' `w-full min-w-0` so pills can share the row.\n className={cn(inputControlClasses, \"w-auto min-w-16\", className)}\n onKeyDown={(event) => {\n if (onRemoveLast && event.key === \"Backspace\" && event.currentTarget.value === \"\") {\n onRemoveLast()\n }\n onKeyDown?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const PillsInput = Object.assign(PillsInputBase, {\n Field: PillsInputField,\n})\n"]}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-DA4QII2N.js';
|
|
2
|
+
import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
|
|
3
|
+
import { useLayerGuard, NestedLayer } from './chunk-H7WOMZXO.js';
|
|
4
|
+
import { props } from './chunk-WYCMIIRR.js';
|
|
5
|
+
import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
|
|
6
|
+
import { cn } from './chunk-4ASNIDV7.js';
|
|
7
|
+
import { Drawer as Drawer$1 } from '@ark-ui/react/drawer';
|
|
8
|
+
import { Portal } from '@ark-ui/react/portal';
|
|
9
|
+
import { cva } from 'class-variance-authority';
|
|
10
|
+
import { createContext, useContext, useRef } from 'react';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var PLACEMENT_TO_SWIPE = {
|
|
14
|
+
start: "start",
|
|
15
|
+
end: "end",
|
|
16
|
+
top: "up",
|
|
17
|
+
bottom: "down"
|
|
18
|
+
};
|
|
19
|
+
var DrawerPlacementContext = createContext("end");
|
|
20
|
+
var drawerBackdrop = cva([
|
|
21
|
+
"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none",
|
|
22
|
+
"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out"
|
|
23
|
+
]);
|
|
24
|
+
var drawerPositioner = cva(
|
|
25
|
+
"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip",
|
|
26
|
+
{
|
|
27
|
+
variants: {
|
|
28
|
+
placement: {
|
|
29
|
+
start: "items-stretch justify-start",
|
|
30
|
+
end: "items-stretch justify-end",
|
|
31
|
+
top: "items-start justify-stretch",
|
|
32
|
+
bottom: "items-end justify-stretch"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: { placement: "end" }
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
var DrawerPositioner = ({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
testId,
|
|
42
|
+
asChild: _asChild,
|
|
43
|
+
...rest
|
|
44
|
+
}) => {
|
|
45
|
+
const placement = useContext(DrawerPlacementContext);
|
|
46
|
+
const positioner = useRef(null);
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
Drawer$1.Positioner,
|
|
49
|
+
{
|
|
50
|
+
ref: positioner,
|
|
51
|
+
className: cn(drawerPositioner({ placement }), className),
|
|
52
|
+
...props({ "data-testid": testId }),
|
|
53
|
+
...rest,
|
|
54
|
+
"data-placement": placement,
|
|
55
|
+
children: /* @__PURE__ */ jsx(OverlayContainerProvider, { value: positioner, children })
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
var drawerContent = cva(
|
|
60
|
+
[
|
|
61
|
+
"relative flex flex-col overflow-hidden",
|
|
62
|
+
"bg-brand-50 text-brand-950 shadow-2xl",
|
|
63
|
+
"dark:bg-brand-950 dark:text-white",
|
|
64
|
+
"focus:outline-none",
|
|
65
|
+
// border on the docked edge only — keyed by data-placement in theme.css
|
|
66
|
+
"data-[placement=start]:border-e data-[placement=end]:border-s",
|
|
67
|
+
"data-[placement=top]:border-b data-[placement=bottom]:border-t",
|
|
68
|
+
"border-brand-900/20 dark:border-white/15",
|
|
69
|
+
"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out"
|
|
70
|
+
],
|
|
71
|
+
{
|
|
72
|
+
variants: {
|
|
73
|
+
// Internal: Content reads it from the root's context.
|
|
74
|
+
placement: {
|
|
75
|
+
start: "h-full max-w-[90vw]",
|
|
76
|
+
end: "h-full max-w-[90vw]",
|
|
77
|
+
top: "w-full max-h-[90dvh]",
|
|
78
|
+
bottom: "w-full max-h-[90dvh]"
|
|
79
|
+
},
|
|
80
|
+
// Width for inline placements, height for block ones: see compoundVariants.
|
|
81
|
+
size: { xs: "", sm: "", md: "", lg: "", xl: "" },
|
|
82
|
+
// Only the two corners away from the docked edge round: see compoundVariants.
|
|
83
|
+
radius: { none: "", sm: "", md: "", lg: "", xl: "" }
|
|
84
|
+
},
|
|
85
|
+
compoundVariants: [
|
|
86
|
+
{ placement: ["start", "end"], size: "xs", class: "w-[18rem]" },
|
|
87
|
+
{ placement: ["start", "end"], size: "sm", class: "w-[22rem]" },
|
|
88
|
+
{ placement: ["start", "end"], size: "md", class: "w-[28rem]" },
|
|
89
|
+
{ placement: ["start", "end"], size: "lg", class: "w-[34rem]" },
|
|
90
|
+
{ placement: ["start", "end"], size: "xl", class: "w-[42rem]" },
|
|
91
|
+
{ placement: ["top", "bottom"], size: "xs", class: "h-[30dvh]" },
|
|
92
|
+
{ placement: ["top", "bottom"], size: "sm", class: "h-[40dvh]" },
|
|
93
|
+
{ placement: ["top", "bottom"], size: "md", class: "h-[55dvh]" },
|
|
94
|
+
{ placement: ["top", "bottom"], size: "lg", class: "h-[70dvh]" },
|
|
95
|
+
{ placement: ["top", "bottom"], size: "xl", class: "h-[85dvh]" },
|
|
96
|
+
// Logical corners, so `start`/`end` mirror under RTL with the panel.
|
|
97
|
+
{ placement: "start", radius: "sm", class: "rounded-e-sm" },
|
|
98
|
+
{ placement: "start", radius: "md", class: "rounded-e-md" },
|
|
99
|
+
{ placement: "start", radius: "lg", class: "rounded-e-xl" },
|
|
100
|
+
{ placement: "start", radius: "xl", class: "rounded-e-2xl" },
|
|
101
|
+
{ placement: "end", radius: "sm", class: "rounded-s-sm" },
|
|
102
|
+
{ placement: "end", radius: "md", class: "rounded-s-md" },
|
|
103
|
+
{ placement: "end", radius: "lg", class: "rounded-s-xl" },
|
|
104
|
+
{ placement: "end", radius: "xl", class: "rounded-s-2xl" },
|
|
105
|
+
{ placement: "top", radius: "sm", class: "rounded-b-sm" },
|
|
106
|
+
{ placement: "top", radius: "md", class: "rounded-b-md" },
|
|
107
|
+
{ placement: "top", radius: "lg", class: "rounded-b-xl" },
|
|
108
|
+
{ placement: "top", radius: "xl", class: "rounded-b-2xl" },
|
|
109
|
+
{ placement: "bottom", radius: "sm", class: "rounded-t-sm" },
|
|
110
|
+
{ placement: "bottom", radius: "md", class: "rounded-t-md" },
|
|
111
|
+
{ placement: "bottom", radius: "lg", class: "rounded-t-xl" },
|
|
112
|
+
{ placement: "bottom", radius: "xl", class: "rounded-t-2xl" }
|
|
113
|
+
],
|
|
114
|
+
defaultVariants: { placement: "end", size: "md", radius: "none" }
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
var DrawerRoot = ({
|
|
118
|
+
placement = "end",
|
|
119
|
+
swipeDirection,
|
|
120
|
+
onPointerDownOutside,
|
|
121
|
+
icons,
|
|
122
|
+
children,
|
|
123
|
+
...rest
|
|
124
|
+
}) => {
|
|
125
|
+
const guard = useLayerGuard(onPointerDownOutside);
|
|
126
|
+
return /* @__PURE__ */ jsxs(
|
|
127
|
+
Drawer$1.Root,
|
|
128
|
+
{
|
|
129
|
+
swipeDirection: swipeDirection ?? PLACEMENT_TO_SWIPE[placement],
|
|
130
|
+
onPointerDownOutside: guard.onPointerDownOutside,
|
|
131
|
+
...rest,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsx(Drawer$1.Context, { children: (api) => /* @__PURE__ */ jsx(NestedLayer, { open: api.open }) }),
|
|
134
|
+
/* @__PURE__ */ jsx(DrawerPlacementContext, { value: placement, children: /* @__PURE__ */ jsx(DialogRootProviders, { icons, layers: guard.layers, children }) })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
var DrawerTrigger = Drawer$1.Trigger;
|
|
140
|
+
var DrawerContext = Drawer$1.Context;
|
|
141
|
+
var DrawerBackdrop = ({ className, testId, ...rest }) => /* @__PURE__ */ jsx(
|
|
142
|
+
Drawer$1.Backdrop,
|
|
143
|
+
{
|
|
144
|
+
className: cn(drawerBackdrop(), className),
|
|
145
|
+
...props({ "data-testid": testId }),
|
|
146
|
+
...rest
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
var DrawerTitle = ({ className, testId, ...rest }) => /* @__PURE__ */ jsx(
|
|
150
|
+
Drawer$1.Title,
|
|
151
|
+
{
|
|
152
|
+
className: cn("text-xl font-semibold leading-tight", className),
|
|
153
|
+
...props({ "data-testid": testId }),
|
|
154
|
+
...rest
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
var DrawerDescription = ({ className, testId, ...rest }) => /* @__PURE__ */ jsx(
|
|
158
|
+
Drawer$1.Description,
|
|
159
|
+
{
|
|
160
|
+
className: cn("text-sm", TEXT_COLOR_CLASSES.muted, className),
|
|
161
|
+
...props({ "data-testid": testId }),
|
|
162
|
+
...rest
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
var DrawerContent = ({ className, size, radius, testId, ...rest }) => {
|
|
166
|
+
const placement = useContext(DrawerPlacementContext);
|
|
167
|
+
const nameCheck = useDialogNameCheck("Drawer");
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
Drawer$1.Content,
|
|
170
|
+
{
|
|
171
|
+
ref: nameCheck,
|
|
172
|
+
className: cn(drawerContent({ placement, size, radius }), className),
|
|
173
|
+
...props({ "data-testid": testId }),
|
|
174
|
+
...rest,
|
|
175
|
+
"data-placement": placement
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
var {
|
|
180
|
+
CloseTrigger: DrawerCloseTrigger,
|
|
181
|
+
Header: DrawerHeader,
|
|
182
|
+
Body: DrawerBody,
|
|
183
|
+
Footer: DrawerFooter
|
|
184
|
+
} = createDialogParts("drawer", Drawer$1.CloseTrigger);
|
|
185
|
+
var DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }) => /* @__PURE__ */ jsx(
|
|
186
|
+
Drawer$1.Grabber,
|
|
187
|
+
{
|
|
188
|
+
className: cn(
|
|
189
|
+
"flex shrink-0 cursor-grab touch-none items-center justify-center py-2",
|
|
190
|
+
className
|
|
191
|
+
),
|
|
192
|
+
...props({ "data-testid": testId }),
|
|
193
|
+
...rest,
|
|
194
|
+
children: /* @__PURE__ */ jsx(Drawer$1.GrabberIndicator, { className: "h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16" })
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
var DrawerComponent = ({
|
|
198
|
+
open,
|
|
199
|
+
defaultOpen,
|
|
200
|
+
onOpenChange,
|
|
201
|
+
onClose,
|
|
202
|
+
placement = "end",
|
|
203
|
+
size,
|
|
204
|
+
radius,
|
|
205
|
+
title,
|
|
206
|
+
description,
|
|
207
|
+
"aria-label": ariaLabel,
|
|
208
|
+
"aria-labelledby": ariaLabelledby,
|
|
209
|
+
withCloseButton = true,
|
|
210
|
+
withGrabber = false,
|
|
211
|
+
withBackdrop = true,
|
|
212
|
+
padding = "md",
|
|
213
|
+
closeOnEscape,
|
|
214
|
+
closeOnInteractOutside,
|
|
215
|
+
role,
|
|
216
|
+
onExitComplete,
|
|
217
|
+
container,
|
|
218
|
+
children,
|
|
219
|
+
className,
|
|
220
|
+
classNames,
|
|
221
|
+
testId,
|
|
222
|
+
translations,
|
|
223
|
+
icons,
|
|
224
|
+
...rest
|
|
225
|
+
}) => {
|
|
226
|
+
const hasHeader = title != null || description != null || withCloseButton;
|
|
227
|
+
return /* @__PURE__ */ jsx(
|
|
228
|
+
DrawerRoot,
|
|
229
|
+
{
|
|
230
|
+
open,
|
|
231
|
+
defaultOpen,
|
|
232
|
+
onOpenChange: ({ open: next }) => {
|
|
233
|
+
onOpenChange?.(next);
|
|
234
|
+
if (!next) onClose?.();
|
|
235
|
+
},
|
|
236
|
+
placement,
|
|
237
|
+
closeOnEscape,
|
|
238
|
+
closeOnInteractOutside: closeOnInteractOutside ?? role !== "alertdialog",
|
|
239
|
+
role,
|
|
240
|
+
lazyMount: true,
|
|
241
|
+
unmountOnExit: true,
|
|
242
|
+
modal: withBackdrop,
|
|
243
|
+
onExitComplete,
|
|
244
|
+
icons,
|
|
245
|
+
...rest,
|
|
246
|
+
children: /* @__PURE__ */ jsxs(Portal, { container: container ? { current: container } : void 0, children: [
|
|
247
|
+
withBackdrop && /* @__PURE__ */ jsx(DrawerBackdrop, { className: classNames?.backdrop }),
|
|
248
|
+
/* @__PURE__ */ jsx(DrawerPositioner, { className: classNames?.positioner, children: /* @__PURE__ */ jsxs(
|
|
249
|
+
DrawerContent,
|
|
250
|
+
{
|
|
251
|
+
size,
|
|
252
|
+
radius,
|
|
253
|
+
style: { ["--drawer-px"]: DIALOG_PADDING[padding] },
|
|
254
|
+
className: cn(className, classNames?.content),
|
|
255
|
+
testId,
|
|
256
|
+
"aria-label": ariaLabel,
|
|
257
|
+
"aria-labelledby": ariaLabelledby,
|
|
258
|
+
children: [
|
|
259
|
+
withGrabber && /* @__PURE__ */ jsx(DrawerGrabber, { className: classNames?.grabber }),
|
|
260
|
+
hasHeader && /* @__PURE__ */ jsxs(DrawerHeader, { className: classNames?.header, children: [
|
|
261
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
262
|
+
title != null && /* @__PURE__ */ jsx(DrawerTitle, { className: classNames?.title, children: title }),
|
|
263
|
+
description != null && /* @__PURE__ */ jsx(DrawerDescription, { className: classNames?.description, children: description })
|
|
264
|
+
] }),
|
|
265
|
+
withCloseButton && /* @__PURE__ */ jsx(
|
|
266
|
+
DrawerCloseTrigger,
|
|
267
|
+
{
|
|
268
|
+
"aria-label": translations?.closeTriggerLabel,
|
|
269
|
+
className: classNames?.closeButton
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ jsx(
|
|
274
|
+
DrawerBody,
|
|
275
|
+
{
|
|
276
|
+
className: cn(
|
|
277
|
+
!hasHeader && !withGrabber && "pt-(--drawer-px,1.25rem)",
|
|
278
|
+
"pb-(--drawer-px,1.25rem)",
|
|
279
|
+
classNames?.body
|
|
280
|
+
),
|
|
281
|
+
children
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
) })
|
|
287
|
+
] })
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
};
|
|
291
|
+
var Drawer = Object.assign(DrawerComponent, {
|
|
292
|
+
Root: DrawerRoot,
|
|
293
|
+
Trigger: DrawerTrigger,
|
|
294
|
+
Context: DrawerContext,
|
|
295
|
+
Backdrop: DrawerBackdrop,
|
|
296
|
+
Positioner: DrawerPositioner,
|
|
297
|
+
Content: DrawerContent,
|
|
298
|
+
Title: DrawerTitle,
|
|
299
|
+
Description: DrawerDescription,
|
|
300
|
+
CloseTrigger: DrawerCloseTrigger,
|
|
301
|
+
Grabber: DrawerGrabber,
|
|
302
|
+
Header: DrawerHeader,
|
|
303
|
+
Body: DrawerBody,
|
|
304
|
+
Footer: DrawerFooter
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
export { Drawer };
|
|
308
|
+
//# sourceMappingURL=chunk-O7LS6OZR.js.map
|
|
309
|
+
//# sourceMappingURL=chunk-O7LS6OZR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,EACzB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;A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0BAAA;AAAA,oBAC9B,0BAAA;AAAA,oBACA,UAAA,EAAY;AAAA,mBACd;AAAA,kBAEC;AAAA;AAAA;AACH;AAAA;AAAA,SACF,EACF;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-O7LS6OZR.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from './chunk-BUIHQJGE.js';
|
|
1
2
|
import { useState, useRef } from 'react';
|
|
2
3
|
|
|
3
|
-
// src/lib/use-uncontrolled.ts
|
|
4
4
|
var resolveUpdater = (updater, previous) => typeof updater === "function" ? updater(previous) : updater;
|
|
5
5
|
function useUncontrolled({
|
|
6
6
|
value,
|
|
@@ -13,7 +13,9 @@ function useUncontrolled({
|
|
|
13
13
|
defaultValue !== void 0 ? defaultValue : finalValue
|
|
14
14
|
);
|
|
15
15
|
const uncontrolledRef = useRef(uncontrolledValue);
|
|
16
|
-
|
|
16
|
+
useIsomorphicLayoutEffect(() => {
|
|
17
|
+
uncontrolledRef.current = uncontrolledValue;
|
|
18
|
+
}, [uncontrolledValue]);
|
|
17
19
|
const handleUncontrolledChange = (updater, ...payload) => {
|
|
18
20
|
const resolved = resolveUpdater(updater, uncontrolledRef.current);
|
|
19
21
|
uncontrolledRef.current = resolved;
|
|
@@ -31,5 +33,5 @@ function useUncontrolled({
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export { useUncontrolled };
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-PMUCGFY5.js.map
|
|
37
|
+
//# sourceMappingURL=chunk-PMUCGFY5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/use-uncontrolled.ts"],"names":[],"mappings":";;;AAyBA,IAAM,cAAA,GAAiB,CAAI,OAAA,EAAqB,QAAA,KAC9C,OAAO,OAAA,KAAY,UAAA,GAAc,OAAA,CAA+B,QAAQ,CAAA,GAAI,OAAA;AAsBvE,SAAS,eAAA,CAAoD;AAAA,EAClE,KAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AACpB,CAAA,EAAmE;AACjE,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,QAAA;AAAA,IAChD,YAAA,KAAiB,SAAY,YAAA,GAAe;AAAA,GAC9C;AAMA,EAAA,MAAM,eAAA,GAAkB,OAAO,iBAAiB,CAAA;AAChD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,eAAA,CAAgB,OAAA,GAAU,iBAAA;AAAA,EAC5B,CAAA,EAAG,CAAC,iBAAiB,CAAC,CAAA;AAEtB,EAAA,MAAM,wBAAA,GAA2B,CAAC,OAAA,EAAA,GAAwB,OAAA,KAAe;AACvE,IAAA,MAAM,QAAA,GAAW,cAAA,CAAe,OAAA,EAAS,eAAA,CAAgB,OAAY,CAAA;AACrE,IAAA,eAAA,CAAgB,OAAA,GAAU,QAAA;AAC1B,IAAA,oBAAA,CAAqB,QAAQ,CAAA;AAC7B,IAAA,QAAA,GAAW,QAAA,EAAU,GAAG,OAAO,CAAA;AAAA,EACjC,CAAA;AAEA,EAAA,IAAI,UAAU,MAAA,EAAW;AACvB,IAAA,OAAO;AAAA,MACL,KAAA;AAAA,MACA,CAAC,YAAwB,OAAA,KACvB,QAAA,GAAW,eAAe,OAAA,EAAS,KAAU,CAAA,EAAG,GAAG,OAAO,CAAA;AAAA,MAC5D;AAAA,KACF;AAAA,EACF;AAEA,EAAA,OAAO,CAAC,iBAAA,EAAwB,wBAAA,EAA0B,KAAK,CAAA;AACjE","file":"chunk-PMUCGFY5.js","sourcesContent":["import { useRef, useState } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-layout-effect\"\n\nexport interface UseUncontrolledOptions<T, P extends unknown[]> {\n /** Value for controlled state */\n value?: T\n /** Initial value for uncontrolled state */\n defaultValue?: T\n /**\n * Final value for uncontrolled state when value and defaultValue are not provided\n * This is used as the initial value for uncontrolled state where the component is uncontrolled,\n * but the author of the component has provided a default value to be used as the initial value.\n * This avoids the default value being used as the initial value for controlled state for components authors.\n */\n finalValue?: T\n /** Controlled state onChange handler */\n onChange?: (value: T, ...payload: P) => void\n}\n\n/** A value, or a function deriving the next value from the previous one —\n * the same shape React's own `useState` setter (and react-table's\n * `Updater<T>`) accepts. Supporting it here means every consumer of\n * `useUncontrolled` gets functional updates for free. */\nexport type Updater<T> = T | ((previous: T) => T)\n\nconst resolveUpdater = <T>(updater: Updater<T>, previous: T): T =>\n typeof updater === \"function\" ? (updater as (previous: T) => T)(previous) : updater\n\nexport type UseUncontrolledReturnValue<T, P extends unknown[] = unknown[]> = [\n T,\n /** Handler to update the state. Accepts a value or an updater function,\n * resolves it against the current value, then passes the resolved value\n * and `payload` to `onChange`. */\n (updater: Updater<T>, ...payload: P) => void,\n /** True if the state is controlled, false if uncontrolled */\n boolean,\n]\n\n/**\n * A hook that manages the state of a value, either controlled or uncontrolled.\n *\n * Note: When `value` is provided, the state is controlled and `defaultValue` is ignored.\n * state is uncontrolled only when `value` is undefined.\n * `null` is treated as a valid value and should be used instead of `undefined` when the value is optional.\n *\n * @param options - The options for the hook.\n * @returns A tuple containing the value, a handler to update the state, and a boolean indicating if the state is controlled.\n */\nexport function useUncontrolled<T, P extends unknown[] = unknown[]>({\n value,\n defaultValue,\n finalValue,\n onChange = () => {},\n}: UseUncontrolledOptions<T, P>): UseUncontrolledReturnValue<T, P> {\n const [uncontrolledValue, setUncontrolledValue] = useState(\n defaultValue !== undefined ? defaultValue : finalValue,\n )\n // Mirrors uncontrolledValue outside of React's state timing, so a setter\n // called more than once in the same tick resolves each updater against the\n // previous call's result rather than a stale render-time value. Synced after\n // commit, never during render: a render React throws away (concurrent\n // rendering, a suspended transition) must not rewind it.\n const uncontrolledRef = useRef(uncontrolledValue)\n useIsomorphicLayoutEffect(() => {\n uncontrolledRef.current = uncontrolledValue\n }, [uncontrolledValue])\n\n const handleUncontrolledChange = (updater: Updater<T>, ...payload: P) => {\n const resolved = resolveUpdater(updater, uncontrolledRef.current as T)\n uncontrolledRef.current = resolved\n setUncontrolledValue(resolved)\n onChange?.(resolved, ...payload)\n }\n\n if (value !== undefined) {\n return [\n value as T,\n (updater: Updater<T>, ...payload: P) =>\n onChange?.(resolveUpdater(updater, value as T), ...payload),\n true,\n ]\n }\n\n return [uncontrolledValue as T, handleUncontrolledChange, false]\n}\n\nexport namespace useUncontrolled {\n export type Options<T, P extends unknown[] = unknown[]> = UseUncontrolledOptions<T, P>\n export type ReturnValue<T, P extends unknown[] = unknown[]> = UseUncontrolledReturnValue<T, P>\n}\n"]}
|