@nori-ui/core 0.0.5 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/animated-view.cjs +13 -0
- package/dist/animation/animated-view.cjs.map +1 -0
- package/dist/animation/animated-view.d.cts +6 -0
- package/dist/animation/animated-view.d.ts +6 -0
- package/dist/animation/animated-view.js +4 -0
- package/dist/animation/animated-view.js.map +1 -0
- package/dist/animation/animated-view.web.cjs +9 -0
- package/dist/animation/animated-view.web.cjs.map +1 -0
- package/dist/animation/animated-view.web.d.cts +5 -0
- package/dist/animation/animated-view.web.d.ts +5 -0
- package/dist/animation/animated-view.web.js +8 -0
- package/dist/animation/animated-view.web.js.map +1 -0
- package/dist/animation/use-animated-number.cjs +80 -0
- package/dist/animation/use-animated-number.cjs.map +1 -0
- package/dist/animation/use-animated-number.d.cts +8 -0
- package/dist/animation/use-animated-number.d.ts +8 -0
- package/dist/animation/use-animated-number.js +4 -0
- package/dist/animation/use-animated-number.js.map +1 -0
- package/dist/animation/use-animated-number.web.cjs +28 -0
- package/dist/animation/use-animated-number.web.cjs.map +1 -0
- package/dist/animation/use-animated-number.web.d.cts +8 -0
- package/dist/animation/use-animated-number.web.d.ts +8 -0
- package/dist/animation/use-animated-number.web.js +25 -0
- package/dist/animation/use-animated-number.web.js.map +1 -0
- package/dist/{chunk-RX7UULY3.js → chunk-33S7ADWM.js} +3 -3
- package/dist/{chunk-RX7UULY3.js.map → chunk-33S7ADWM.js.map} +1 -1
- package/dist/chunk-3BDDPFCI.js +108 -0
- package/dist/chunk-3BDDPFCI.js.map +1 -0
- package/dist/chunk-3F4TXKDY.js +314 -0
- package/dist/chunk-3F4TXKDY.js.map +1 -0
- package/dist/chunk-5A2QOOVN.js +15 -0
- package/dist/chunk-5A2QOOVN.js.map +1 -0
- package/dist/chunk-5XEGZFG5.js +208 -0
- package/dist/chunk-5XEGZFG5.js.map +1 -0
- package/dist/chunk-6AD6KCVB.js +178 -0
- package/dist/chunk-6AD6KCVB.js.map +1 -0
- package/dist/chunk-7GPDNQSX.js +967 -0
- package/dist/chunk-7GPDNQSX.js.map +1 -0
- package/dist/chunk-7UKRN73P.js +42 -0
- package/dist/chunk-7UKRN73P.js.map +1 -0
- package/dist/chunk-7Z4NMNX6.js +64 -0
- package/dist/chunk-7Z4NMNX6.js.map +1 -0
- package/dist/chunk-ACLHDHX3.js +29 -0
- package/dist/chunk-ACLHDHX3.js.map +1 -0
- package/dist/chunk-BZLT6R62.js +80 -0
- package/dist/chunk-BZLT6R62.js.map +1 -0
- package/dist/chunk-CCUXO2HN.js +450 -0
- package/dist/chunk-CCUXO2HN.js.map +1 -0
- package/dist/chunk-CHXHRJNZ.js +43 -0
- package/dist/chunk-CHXHRJNZ.js.map +1 -0
- package/dist/chunk-DDGMLLS3.js +188 -0
- package/dist/chunk-DDGMLLS3.js.map +1 -0
- package/dist/chunk-EWWQQ5DB.js +654 -0
- package/dist/chunk-EWWQQ5DB.js.map +1 -0
- package/dist/chunk-FEPTH5RV.js +169 -0
- package/dist/chunk-FEPTH5RV.js.map +1 -0
- package/dist/{chunk-SSTXLK5I.js → chunk-FT2XBBQJ.js} +42 -6
- package/dist/chunk-FT2XBBQJ.js.map +1 -0
- package/dist/chunk-IKLA2CVQ.js +260 -0
- package/dist/chunk-IKLA2CVQ.js.map +1 -0
- package/dist/chunk-JQQ3FBN7.js +18 -0
- package/dist/chunk-JQQ3FBN7.js.map +1 -0
- package/dist/chunk-JSAG5YO7.js +69 -0
- package/dist/chunk-JSAG5YO7.js.map +1 -0
- package/dist/chunk-JZ774T7U.js +76 -0
- package/dist/chunk-JZ774T7U.js.map +1 -0
- package/dist/chunk-KWRDJPP3.js +10 -0
- package/dist/chunk-KWRDJPP3.js.map +1 -0
- package/dist/chunk-LVWNMQGR.js +1106 -0
- package/dist/chunk-LVWNMQGR.js.map +1 -0
- package/dist/chunk-LWLK6HSW.js +143 -0
- package/dist/chunk-LWLK6HSW.js.map +1 -0
- package/dist/chunk-MDOZGILD.js +134 -0
- package/dist/chunk-MDOZGILD.js.map +1 -0
- package/dist/chunk-MKSDYRWQ.js +446 -0
- package/dist/chunk-MKSDYRWQ.js.map +1 -0
- package/dist/chunk-MRJWPRCX.js +80 -0
- package/dist/chunk-MRJWPRCX.js.map +1 -0
- package/dist/chunk-NRYWNOG5.js +410 -0
- package/dist/chunk-NRYWNOG5.js.map +1 -0
- package/dist/chunk-OMU4R4Y5.js +144 -0
- package/dist/chunk-OMU4R4Y5.js.map +1 -0
- package/dist/chunk-PNP7L4TA.js +103 -0
- package/dist/chunk-PNP7L4TA.js.map +1 -0
- package/dist/chunk-QI6646JZ.js +3 -0
- package/dist/{chunk-UAKFCMWK.js.map → chunk-QI6646JZ.js.map} +1 -1
- package/dist/chunk-QJNV7YQP.js +138 -0
- package/dist/chunk-QJNV7YQP.js.map +1 -0
- package/dist/chunk-R5JMDDCB.js +292 -0
- package/dist/chunk-R5JMDDCB.js.map +1 -0
- package/dist/chunk-RB3YBWQ4.js +77 -0
- package/dist/chunk-RB3YBWQ4.js.map +1 -0
- package/dist/chunk-RFW5SRZA.js +23 -0
- package/dist/chunk-RFW5SRZA.js.map +1 -0
- package/dist/chunk-RGJ3NBKE.js +8 -0
- package/dist/chunk-RGJ3NBKE.js.map +1 -0
- package/dist/chunk-SFNDR6DI.js +485 -0
- package/dist/chunk-SFNDR6DI.js.map +1 -0
- package/dist/chunk-SWC5CNKE.js +13 -0
- package/dist/chunk-SWC5CNKE.js.map +1 -0
- package/dist/chunk-TLS54G6Y.js +15 -0
- package/dist/chunk-TLS54G6Y.js.map +1 -0
- package/dist/chunk-WCQVDF3K.js +12 -0
- package/dist/{chunk-7QVYU63E.js.map → chunk-WCQVDF3K.js.map} +1 -1
- package/dist/chunk-WGT345SV.js +427 -0
- package/dist/chunk-WGT345SV.js.map +1 -0
- package/dist/chunk-X7APG7G2.js +1566 -0
- package/dist/chunk-X7APG7G2.js.map +1 -0
- package/dist/chunk-XALU6LOT.js +306 -0
- package/dist/chunk-XALU6LOT.js.map +1 -0
- package/dist/chunk-YNKKEO2A.js +336 -0
- package/dist/chunk-YNKKEO2A.js.map +1 -0
- package/dist/chunk-ZBW3BA5R.js +148 -0
- package/dist/chunk-ZBW3BA5R.js.map +1 -0
- package/dist/{chunk-FXKIWONG.js → chunk-ZIBNLXIV.js} +12 -6
- package/dist/chunk-ZIBNLXIV.js.map +1 -0
- package/dist/chunk-ZMSIYLSI.js +563 -0
- package/dist/chunk-ZMSIYLSI.js.map +1 -0
- package/dist/chunk-ZQMNGPLE.js +981 -0
- package/dist/chunk-ZQMNGPLE.js.map +1 -0
- package/dist/chunk-ZRD4FQBT.js +153 -0
- package/dist/chunk-ZRD4FQBT.js.map +1 -0
- package/dist/client.cjs +11289 -439
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +68 -117
- package/dist/client.d.ts +68 -117
- package/dist/client.js +58 -40
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/index.cjs +900 -0
- package/dist/components/Accordion/index.cjs.map +1 -0
- package/dist/components/Accordion/index.d.cts +72 -0
- package/dist/components/Accordion/index.d.ts +72 -0
- package/dist/components/Accordion/index.js +10 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/Alert/index.cjs +567 -0
- package/dist/components/Alert/index.cjs.map +1 -0
- package/dist/components/Alert/index.d.cts +41 -0
- package/dist/components/Alert/index.d.ts +41 -0
- package/dist/components/Alert/index.js +8 -0
- package/dist/components/Alert/index.js.map +1 -0
- package/dist/components/AlertDialog/index.cjs +892 -0
- package/dist/components/AlertDialog/index.cjs.map +1 -0
- package/dist/components/AlertDialog/index.d.cts +68 -0
- package/dist/components/AlertDialog/index.d.ts +68 -0
- package/dist/components/AlertDialog/index.js +9 -0
- package/dist/components/AlertDialog/index.js.map +1 -0
- package/dist/components/Avatar/index.cjs +427 -0
- package/dist/components/Avatar/index.cjs.map +1 -0
- package/dist/components/Avatar/index.d.cts +40 -0
- package/dist/components/Avatar/index.d.ts +40 -0
- package/dist/components/Avatar/index.js +7 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Badge/index.cjs +433 -0
- package/dist/components/Badge/index.cjs.map +1 -0
- package/dist/components/Badge/index.d.cts +35 -0
- package/dist/components/Badge/index.d.ts +35 -0
- package/dist/components/Badge/index.js +7 -0
- package/dist/components/Badge/index.js.map +1 -0
- package/dist/components/Box/index.cjs +415 -0
- package/dist/components/Box/index.cjs.map +1 -0
- package/dist/components/Box/index.d.cts +24 -0
- package/dist/components/Box/index.d.ts +24 -0
- package/dist/components/Box/index.js +9 -0
- package/dist/components/Box/index.js.map +1 -0
- package/dist/components/Breadcrumb/index.cjs +1939 -0
- package/dist/components/Breadcrumb/index.cjs.map +1 -0
- package/dist/components/Breadcrumb/index.d.cts +186 -0
- package/dist/components/Breadcrumb/index.d.ts +186 -0
- package/dist/components/Breadcrumb/index.js +11 -0
- package/dist/components/Breadcrumb/index.js.map +1 -0
- package/dist/components/Button/index.cjs +631 -0
- package/dist/components/Button/index.cjs.map +1 -0
- package/dist/components/Button/index.d.cts +27 -0
- package/dist/components/Button/index.d.ts +27 -0
- package/dist/components/Button/index.js +9 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Calendar/index.cjs +3017 -0
- package/dist/components/Calendar/index.cjs.map +1 -0
- package/dist/components/Calendar/index.d.cts +169 -0
- package/dist/components/Calendar/index.d.ts +169 -0
- package/dist/components/Calendar/index.js +11 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Card/index.cjs +469 -0
- package/dist/components/Card/index.cjs.map +1 -0
- package/dist/components/Card/index.d.cts +33 -0
- package/dist/components/Card/index.d.ts +33 -0
- package/dist/components/Card/index.js +7 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Checkbox/index.cjs +590 -0
- package/dist/components/Checkbox/index.cjs.map +1 -0
- package/dist/components/Checkbox/index.d.cts +22 -0
- package/dist/components/Checkbox/index.d.ts +22 -0
- package/dist/components/Checkbox/index.js +9 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Dialog/index.cjs +888 -0
- package/dist/components/Dialog/index.cjs.map +1 -0
- package/dist/components/Dialog/index.d.cts +56 -0
- package/dist/components/Dialog/index.d.ts +56 -0
- package/dist/components/Dialog/index.js +10 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/FloatButton/index.cjs +1254 -0
- package/dist/components/FloatButton/index.cjs.map +1 -0
- package/dist/components/FloatButton/index.d.cts +133 -0
- package/dist/components/FloatButton/index.d.ts +133 -0
- package/dist/components/FloatButton/index.js +11 -0
- package/dist/components/FloatButton/index.js.map +1 -0
- package/dist/components/HStack/index.cjs +480 -0
- package/dist/components/HStack/index.cjs.map +1 -0
- package/dist/components/HStack/index.d.cts +24 -0
- package/dist/components/HStack/index.d.ts +24 -0
- package/dist/components/HStack/index.js +9 -0
- package/dist/components/HStack/index.js.map +1 -0
- package/dist/components/InputGroup/index.cjs +638 -0
- package/dist/components/InputGroup/index.cjs.map +1 -0
- package/dist/components/InputGroup/index.d.cts +33 -0
- package/dist/components/InputGroup/index.d.ts +33 -0
- package/dist/components/InputGroup/index.js +7 -0
- package/dist/components/InputGroup/index.js.map +1 -0
- package/dist/components/Pagination/index.cjs +2501 -0
- package/dist/components/Pagination/index.cjs.map +1 -0
- package/dist/components/Pagination/index.d.cts +164 -0
- package/dist/components/Pagination/index.d.ts +164 -0
- package/dist/components/Pagination/index.js +12 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Popover/index.cjs +739 -0
- package/dist/components/Popover/index.cjs.map +1 -0
- package/dist/components/Popover/index.d.cts +44 -0
- package/dist/components/Popover/index.d.ts +44 -0
- package/dist/components/Popover/index.js +8 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Progress/index.cjs +493 -0
- package/dist/components/Progress/index.cjs.map +1 -0
- package/dist/components/Progress/index.d.cts +63 -0
- package/dist/components/Progress/index.d.ts +63 -0
- package/dist/components/Progress/index.js +7 -0
- package/dist/components/Progress/index.js.map +1 -0
- package/dist/components/Radio/index.cjs +584 -0
- package/dist/components/Radio/index.cjs.map +1 -0
- package/dist/components/Radio/index.d.cts +51 -0
- package/dist/components/Radio/index.d.ts +51 -0
- package/dist/components/Radio/index.js +7 -0
- package/dist/components/Radio/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.cjs +502 -0
- package/dist/components/SegmentedControl/index.cjs.map +1 -0
- package/dist/components/SegmentedControl/index.d.cts +45 -0
- package/dist/components/SegmentedControl/index.d.ts +45 -0
- package/dist/components/SegmentedControl/index.js +7 -0
- package/dist/components/SegmentedControl/index.js.map +1 -0
- package/dist/components/Select/index.cjs +1359 -0
- package/dist/components/Select/index.cjs.map +1 -0
- package/dist/components/Select/index.d.cts +140 -0
- package/dist/components/Select/index.d.ts +140 -0
- package/dist/components/Select/index.js +8 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Separator/index.cjs +358 -0
- package/dist/components/Separator/index.cjs.map +1 -0
- package/dist/components/Separator/index.d.cts +28 -0
- package/dist/components/Separator/index.d.ts +28 -0
- package/dist/components/Separator/index.js +6 -0
- package/dist/components/Separator/index.js.map +1 -0
- package/dist/components/Skeleton/index.cjs +384 -0
- package/dist/components/Skeleton/index.cjs.map +1 -0
- package/dist/components/Skeleton/index.d.cts +30 -0
- package/dist/components/Skeleton/index.d.ts +30 -0
- package/dist/components/Skeleton/index.js +6 -0
- package/dist/components/Skeleton/index.js.map +1 -0
- package/dist/components/Slider/index.cjs +880 -0
- package/dist/components/Slider/index.cjs.map +1 -0
- package/dist/components/Slider/index.d.cts +84 -0
- package/dist/components/Slider/index.d.ts +84 -0
- package/dist/components/Slider/index.js +6 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/Spinner/index.cjs +32 -0
- package/dist/components/Spinner/index.cjs.map +1 -0
- package/dist/components/Spinner/index.d.cts +25 -0
- package/dist/components/Spinner/index.d.ts +25 -0
- package/dist/components/Spinner/index.js +4 -0
- package/dist/components/Spinner/index.js.map +1 -0
- package/dist/components/Switch/index.cjs +623 -0
- package/dist/components/Switch/index.cjs.map +1 -0
- package/dist/components/Switch/index.d.cts +22 -0
- package/dist/components/Switch/index.d.ts +22 -0
- package/dist/components/Switch/index.js +10 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tabs/index.cjs +630 -0
- package/dist/components/Tabs/index.cjs.map +1 -0
- package/dist/components/Tabs/index.d.cts +63 -0
- package/dist/components/Tabs/index.d.ts +63 -0
- package/dist/components/Tabs/index.js +7 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Text/index.cjs +401 -0
- package/dist/components/Text/index.cjs.map +1 -0
- package/dist/components/Text/index.d.cts +24 -0
- package/dist/components/Text/index.d.ts +24 -0
- package/dist/components/Text/index.js +7 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/TextArea/index.cjs +482 -0
- package/dist/components/TextArea/index.cjs.map +1 -0
- package/dist/components/TextArea/index.d.cts +25 -0
- package/dist/components/TextArea/index.d.ts +25 -0
- package/dist/components/TextArea/index.js +8 -0
- package/dist/components/TextArea/index.js.map +1 -0
- package/dist/components/TextInput/index.cjs +477 -0
- package/dist/components/TextInput/index.cjs.map +1 -0
- package/dist/components/TextInput/index.d.cts +33 -0
- package/dist/components/TextInput/index.d.ts +33 -0
- package/dist/components/TextInput/index.js +7 -0
- package/dist/components/TextInput/index.js.map +1 -0
- package/dist/components/Toast/index.cjs +167 -0
- package/dist/components/Toast/index.cjs.map +1 -0
- package/dist/components/Toast/index.d.cts +143 -0
- package/dist/components/Toast/index.d.ts +143 -0
- package/dist/components/Toast/index.js +4 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/Toggle/index.cjs +770 -0
- package/dist/components/Toggle/index.cjs.map +1 -0
- package/dist/components/Toggle/index.d.cts +83 -0
- package/dist/components/Toggle/index.d.ts +83 -0
- package/dist/components/Toggle/index.js +7 -0
- package/dist/components/Toggle/index.js.map +1 -0
- package/dist/components/Tooltip/index.cjs +813 -0
- package/dist/components/Tooltip/index.cjs.map +1 -0
- package/dist/components/Tooltip/index.d.cts +55 -0
- package/dist/components/Tooltip/index.d.ts +55 -0
- package/dist/components/Tooltip/index.js +8 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/VStack/index.cjs +480 -0
- package/dist/components/VStack/index.cjs.map +1 -0
- package/dist/components/VStack/index.d.cts +19 -0
- package/dist/components/VStack/index.d.ts +19 -0
- package/dist/components/VStack/index.js +9 -0
- package/dist/components/VStack/index.js.map +1 -0
- package/dist/i18n/index.cjs +39 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +4 -60
- package/dist/i18n/index.d.ts +4 -60
- package/dist/i18n/index.js +3 -2
- package/dist/icons/index.cjs +326 -26
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +4 -3
- package/dist/index-D3_M3G6U.d.ts +19 -0
- package/dist/index-uXPK_Rg8.d.cts +19 -0
- package/dist/index.cjs +11176 -463
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -183
- package/dist/index.d.ts +39 -183
- package/dist/index.js +49 -9
- package/dist/resolve-D-GOaxZy.d.cts +60 -0
- package/dist/resolve-D-GOaxZy.d.ts +60 -0
- package/dist/slot/index.cjs +9 -3
- package/dist/slot/index.cjs.map +1 -1
- package/dist/slot/index.js +2 -2
- package/dist/stories/index.cjs +108 -0
- package/dist/stories/index.cjs.map +1 -0
- package/dist/stories/index.d.cts +46 -0
- package/dist/stories/index.d.ts +46 -0
- package/dist/stories/index.js +94 -0
- package/dist/stories/index.js.map +1 -0
- package/dist/theme/index.cjs +259 -26
- package/dist/theme/index.cjs.map +1 -1
- package/dist/theme/index.d.cts +26 -0
- package/dist/theme/index.d.ts +26 -0
- package/dist/theme/index.js +4 -3
- package/dist/use-theme-CoqfnvRs.d.cts +112 -0
- package/dist/use-theme-CoqfnvRs.d.ts +112 -0
- package/dist/utils/cn.cjs +18 -6
- package/dist/utils/cn.cjs.map +1 -1
- package/dist/utils/cn.js +2 -2
- package/package.json +41 -10
- package/dist/chunk-6OABNXBY.js +0 -213
- package/dist/chunk-6OABNXBY.js.map +0 -1
- package/dist/chunk-7QVYU63E.js +0 -6
- package/dist/chunk-FXKIWONG.js.map +0 -1
- package/dist/chunk-NDEDMCHT.js +0 -40
- package/dist/chunk-NDEDMCHT.js.map +0 -1
- package/dist/chunk-SSTXLK5I.js.map +0 -1
- package/dist/chunk-UAKFCMWK.js +0 -3
- package/dist/chunk-X3AJNNF6.js +0 -539
- package/dist/chunk-X3AJNNF6.js.map +0 -1
- package/dist/chunk-XGM2K4TT.js +0 -31
- package/dist/chunk-XGM2K4TT.js.map +0 -1
- package/dist/stories/story-registry.cjs +0 -776
- package/dist/stories/story-registry.cjs.map +0 -1
- package/dist/stories/story-registry.d.cts +0 -13
- package/dist/stories/story-registry.d.ts +0 -13
- package/dist/stories/story-registry.js +0 -106
- package/dist/stories/story-registry.js.map +0 -1
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { defaultSemanticIcons } from './chunk-7Z4NMNX6.js';
|
|
2
|
+
import { px } from './chunk-5A2QOOVN.js';
|
|
3
|
+
import { cn } from './chunk-CHXHRJNZ.js';
|
|
4
|
+
import { useThemeColors } from './chunk-R5JMDDCB.js';
|
|
5
|
+
import { __name } from './chunk-WCQVDF3K.js';
|
|
6
|
+
import { useId, useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
7
|
+
import { createPortal } from 'react-dom';
|
|
8
|
+
import { Platform, useWindowDimensions, View, Pressable, Text, Modal, ScrollView } from 'react-native';
|
|
9
|
+
import { jsxs, jsx } from 'nativewind/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var DEFAULT_PAGE_SIZE = 50;
|
|
12
|
+
var DEFAULT_ITEM_HEIGHT = 36;
|
|
13
|
+
var DEFAULT_MAX_MENU = 320;
|
|
14
|
+
var SEARCH_DEBOUNCE_MS = 150;
|
|
15
|
+
var VIRTUAL_OVERSCAN = 4;
|
|
16
|
+
var TYPE_AHEAD_RESET_MS = 500;
|
|
17
|
+
var defaultFilter = /* @__PURE__ */ __name((option, search) => {
|
|
18
|
+
if (!search) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return option.label.toLowerCase().includes(search.toLowerCase());
|
|
22
|
+
}, "defaultFilter");
|
|
23
|
+
var Select = /* @__PURE__ */ __name((props) => {
|
|
24
|
+
const {
|
|
25
|
+
options: staticOptions,
|
|
26
|
+
loadOptions,
|
|
27
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
28
|
+
searchable: searchableProp,
|
|
29
|
+
searchPlaceholder = "Search\u2026",
|
|
30
|
+
filterOption,
|
|
31
|
+
renderOption,
|
|
32
|
+
placeholder = "Select\u2026",
|
|
33
|
+
locale,
|
|
34
|
+
sortByLocale = true,
|
|
35
|
+
noOptionsMessage = "No options",
|
|
36
|
+
loadingMessage = "Loading\u2026",
|
|
37
|
+
disabled = false,
|
|
38
|
+
dir = "ltr",
|
|
39
|
+
virtualized: virtualizedProp,
|
|
40
|
+
itemHeight = DEFAULT_ITEM_HEIGHT,
|
|
41
|
+
maxMenuHeight = DEFAULT_MAX_MENU,
|
|
42
|
+
className,
|
|
43
|
+
testID
|
|
44
|
+
} = props;
|
|
45
|
+
const ariaLabel = props["aria-label"];
|
|
46
|
+
const multiple = props.multiple === true;
|
|
47
|
+
const maxSelected = multiple ? props.maxSelected : void 0;
|
|
48
|
+
const maxChips = multiple ? props.maxChips ?? 3 : void 0;
|
|
49
|
+
const baseId = useId();
|
|
50
|
+
const colors = useThemeColors();
|
|
51
|
+
const [open, setOpen] = useState(false);
|
|
52
|
+
const controlledValues = multiple ? props.value : props.value !== void 0 ? [props.value] : void 0;
|
|
53
|
+
const defaultValues = multiple ? props.defaultValue ?? [] : props.defaultValue !== void 0 ? [props.defaultValue] : [];
|
|
54
|
+
const [innerValues, setInnerValues] = useState(defaultValues);
|
|
55
|
+
const isControlled = controlledValues !== void 0;
|
|
56
|
+
const currentValues = isControlled ? controlledValues : innerValues;
|
|
57
|
+
const current = currentValues[0];
|
|
58
|
+
const [searchInput, setSearchInput] = useState("");
|
|
59
|
+
const [debouncedSearch, setDebouncedSearch] = useState("");
|
|
60
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const t = setTimeout(() => setDebouncedSearch(searchInput), SEARCH_DEBOUNCE_MS);
|
|
63
|
+
return () => clearTimeout(t);
|
|
64
|
+
}, [searchInput]);
|
|
65
|
+
const [asyncItems, setAsyncItems] = useState([]);
|
|
66
|
+
const [asyncLoading, setAsyncLoading] = useState(false);
|
|
67
|
+
const [asyncTotal, setAsyncTotal] = useState(void 0);
|
|
68
|
+
const asyncRequestId = useRef(0);
|
|
69
|
+
const isAsync = loadOptions !== void 0;
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!isAsync || !loadOptions || !open) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const requestId = ++asyncRequestId.current;
|
|
75
|
+
setAsyncLoading(true);
|
|
76
|
+
setAsyncItems([]);
|
|
77
|
+
setAsyncTotal(void 0);
|
|
78
|
+
loadOptions({ search: debouncedSearch, offset: 0, limit: pageSize }).then((result) => {
|
|
79
|
+
if (requestId !== asyncRequestId.current) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
setAsyncItems(result.items.slice());
|
|
83
|
+
setAsyncTotal(result.total);
|
|
84
|
+
}).catch(() => {
|
|
85
|
+
}).finally(() => {
|
|
86
|
+
if (requestId === asyncRequestId.current) {
|
|
87
|
+
setAsyncLoading(false);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}, [debouncedSearch, isAsync, loadOptions, pageSize, open]);
|
|
91
|
+
const loadMore = useCallback(() => {
|
|
92
|
+
if (!isAsync || !loadOptions || asyncLoading) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const haveAll = asyncTotal !== void 0 && asyncItems.length >= asyncTotal;
|
|
96
|
+
if (haveAll) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const requestId = ++asyncRequestId.current;
|
|
100
|
+
setAsyncLoading(true);
|
|
101
|
+
loadOptions({ search: debouncedSearch, offset: asyncItems.length, limit: pageSize }).then((result) => {
|
|
102
|
+
if (requestId !== asyncRequestId.current) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
setAsyncItems((prev) => prev.concat(result.items));
|
|
106
|
+
if (result.total !== void 0) {
|
|
107
|
+
setAsyncTotal(result.total);
|
|
108
|
+
}
|
|
109
|
+
}).catch(() => void 0).finally(() => {
|
|
110
|
+
if (requestId === asyncRequestId.current) {
|
|
111
|
+
setAsyncLoading(false);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}, [asyncItems.length, asyncLoading, asyncTotal, debouncedSearch, isAsync, loadOptions, pageSize]);
|
|
115
|
+
const visibleOptions = useMemo(() => {
|
|
116
|
+
const source = isAsync ? asyncItems : staticOptions ?? [];
|
|
117
|
+
const filtered = isAsync ? source.slice() : source.filter((opt) => (filterOption ?? defaultFilter)(opt, debouncedSearch));
|
|
118
|
+
if (locale && sortByLocale) {
|
|
119
|
+
const collator = new Intl.Collator(locale, { sensitivity: "base", numeric: true });
|
|
120
|
+
return filtered.slice().sort((a, b) => {
|
|
121
|
+
const ga = a.group ?? "";
|
|
122
|
+
const gb = b.group ?? "";
|
|
123
|
+
const groupDelta = collator.compare(ga, gb);
|
|
124
|
+
if (groupDelta !== 0) {
|
|
125
|
+
return groupDelta;
|
|
126
|
+
}
|
|
127
|
+
return collator.compare(a.label, b.label);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return filtered;
|
|
131
|
+
}, [isAsync, asyncItems, staticOptions, filterOption, debouncedSearch, locale, sortByLocale]);
|
|
132
|
+
const selectedOption = useMemo(() => {
|
|
133
|
+
const all = isAsync ? asyncItems : staticOptions ?? [];
|
|
134
|
+
return all.find((o) => o.value === current);
|
|
135
|
+
}, [asyncItems, isAsync, staticOptions, current]);
|
|
136
|
+
const selectedOptions = useMemo(() => {
|
|
137
|
+
if (!multiple) {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
const all = isAsync ? asyncItems : staticOptions ?? [];
|
|
141
|
+
const map = new Map(all.map((o) => [o.value, o]));
|
|
142
|
+
return currentValues.map((v) => map.get(v)).filter((o) => o !== void 0);
|
|
143
|
+
}, [multiple, currentValues, asyncItems, isAsync, staticOptions]);
|
|
144
|
+
const searchable = searchableProp ?? (isAsync || staticOptions !== void 0 && staticOptions.length >= 10);
|
|
145
|
+
const virtualized = virtualizedProp ?? visibleOptions.length > 100;
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
setActiveIndex((idx) => Math.min(Math.max(0, idx), Math.max(0, visibleOptions.length - 1)));
|
|
148
|
+
}, [visibleOptions.length]);
|
|
149
|
+
const onSelect = useCallback(
|
|
150
|
+
(option) => {
|
|
151
|
+
if (option.disabled) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (multiple) {
|
|
155
|
+
const has = currentValues.includes(option.value);
|
|
156
|
+
let nextValues;
|
|
157
|
+
if (has) {
|
|
158
|
+
nextValues = currentValues.filter((v) => v !== option.value);
|
|
159
|
+
} else {
|
|
160
|
+
if (maxSelected !== void 0 && currentValues.length >= maxSelected) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
nextValues = [...currentValues, option.value];
|
|
164
|
+
}
|
|
165
|
+
if (!isControlled) {
|
|
166
|
+
setInnerValues(nextValues);
|
|
167
|
+
}
|
|
168
|
+
const allOpts = [
|
|
169
|
+
...staticOptions ?? [],
|
|
170
|
+
...asyncItems
|
|
171
|
+
];
|
|
172
|
+
const optMap = new Map(allOpts.map((o) => [o.value, o]));
|
|
173
|
+
const selectedOpts = nextValues.map((v) => optMap.get(v)).filter((o) => o !== void 0);
|
|
174
|
+
props.onChange?.(nextValues, selectedOpts);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (!isControlled) {
|
|
178
|
+
setInnerValues([option.value]);
|
|
179
|
+
}
|
|
180
|
+
props.onChange?.(option.value, option);
|
|
181
|
+
setOpen(false);
|
|
182
|
+
setSearchInput("");
|
|
183
|
+
},
|
|
184
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: `props` is the discriminated union — destructuring it would defeat the narrowing; the asyncItems / staticOptions captures intentionally re-trigger the callback when the option pool changes
|
|
185
|
+
[multiple, isControlled, currentValues, maxSelected, staticOptions, asyncItems, props]
|
|
186
|
+
);
|
|
187
|
+
const clearAll = useCallback(() => {
|
|
188
|
+
if (!isControlled) {
|
|
189
|
+
setInnerValues([]);
|
|
190
|
+
}
|
|
191
|
+
props.onChange?.([], []);
|
|
192
|
+
}, [isControlled, props]);
|
|
193
|
+
const moveActive = useCallback(
|
|
194
|
+
(delta) => {
|
|
195
|
+
setActiveIndex((idx) => {
|
|
196
|
+
if (visibleOptions.length === 0) {
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
let next = (idx + delta + visibleOptions.length) % visibleOptions.length;
|
|
200
|
+
for (let attempts = 0; attempts < visibleOptions.length; attempts += 1) {
|
|
201
|
+
if (!visibleOptions[next]?.disabled) {
|
|
202
|
+
return next;
|
|
203
|
+
}
|
|
204
|
+
next = (next + delta + visibleOptions.length) % visibleOptions.length;
|
|
205
|
+
}
|
|
206
|
+
return idx;
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
[visibleOptions]
|
|
210
|
+
);
|
|
211
|
+
const typeAheadRef = useRef({
|
|
212
|
+
buffer: "",
|
|
213
|
+
timer: null
|
|
214
|
+
});
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
return () => {
|
|
217
|
+
if (typeAheadRef.current.timer) {
|
|
218
|
+
clearTimeout(typeAheadRef.current.timer);
|
|
219
|
+
typeAheadRef.current.timer = null;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}, []);
|
|
223
|
+
const handleTypeAhead = useCallback(
|
|
224
|
+
(char) => {
|
|
225
|
+
if (visibleOptions.length === 0) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (typeAheadRef.current.timer) {
|
|
229
|
+
clearTimeout(typeAheadRef.current.timer);
|
|
230
|
+
}
|
|
231
|
+
const nextBuffer = typeAheadRef.current.buffer + char.toLowerCase();
|
|
232
|
+
typeAheadRef.current.buffer = nextBuffer;
|
|
233
|
+
typeAheadRef.current.timer = setTimeout(() => {
|
|
234
|
+
typeAheadRef.current.buffer = "";
|
|
235
|
+
typeAheadRef.current.timer = null;
|
|
236
|
+
}, TYPE_AHEAD_RESET_MS);
|
|
237
|
+
const allSame = nextBuffer.length > 1 && nextBuffer.split("").every((c) => c === nextBuffer[0]);
|
|
238
|
+
const cycleMode = nextBuffer.length === 1 || allSame;
|
|
239
|
+
const needle = cycleMode ? nextBuffer.charAt(0) : nextBuffer;
|
|
240
|
+
const len = visibleOptions.length;
|
|
241
|
+
const startFrom = cycleMode ? (activeIndex + 1) % len : 0;
|
|
242
|
+
for (let i = 0; i < len; i += 1) {
|
|
243
|
+
const idx = (startFrom + i) % len;
|
|
244
|
+
const opt = visibleOptions[idx];
|
|
245
|
+
if (!opt || opt.disabled) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (opt.label.toLowerCase().startsWith(needle)) {
|
|
249
|
+
setActiveIndex(idx);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
[visibleOptions, activeIndex]
|
|
255
|
+
);
|
|
256
|
+
const handleListKeyDown = useCallback(
|
|
257
|
+
(event) => {
|
|
258
|
+
switch (event.key) {
|
|
259
|
+
case "ArrowDown":
|
|
260
|
+
event.preventDefault();
|
|
261
|
+
moveActive(1);
|
|
262
|
+
return true;
|
|
263
|
+
case "ArrowUp":
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
moveActive(-1);
|
|
266
|
+
return true;
|
|
267
|
+
case "Home": {
|
|
268
|
+
event.preventDefault();
|
|
269
|
+
const idx = visibleOptions.findIndex((o) => !o.disabled);
|
|
270
|
+
if (idx >= 0) {
|
|
271
|
+
setActiveIndex(idx);
|
|
272
|
+
}
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
case "End": {
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
for (let i = visibleOptions.length - 1; i >= 0; i -= 1) {
|
|
278
|
+
if (!visibleOptions[i]?.disabled) {
|
|
279
|
+
setActiveIndex(i);
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
case "Enter": {
|
|
286
|
+
const opt = visibleOptions[activeIndex];
|
|
287
|
+
if (opt) {
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
onSelect(opt);
|
|
290
|
+
}
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
case "Escape":
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
setOpen(false);
|
|
296
|
+
if (Platform.OS === "web") {
|
|
297
|
+
const trigger = triggerRef.current;
|
|
298
|
+
trigger?.focus?.();
|
|
299
|
+
}
|
|
300
|
+
return true;
|
|
301
|
+
case "Tab":
|
|
302
|
+
setOpen(false);
|
|
303
|
+
return true;
|
|
304
|
+
}
|
|
305
|
+
return false;
|
|
306
|
+
},
|
|
307
|
+
[moveActive, activeIndex, visibleOptions, onSelect]
|
|
308
|
+
);
|
|
309
|
+
const handleSearchKeyDown = useCallback(
|
|
310
|
+
(event) => {
|
|
311
|
+
handleListKeyDown(event);
|
|
312
|
+
},
|
|
313
|
+
[handleListKeyDown]
|
|
314
|
+
);
|
|
315
|
+
const handlePopupKeyDown = useCallback(
|
|
316
|
+
(event) => {
|
|
317
|
+
if (handleListKeyDown(event)) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey && event.key !== " ") {
|
|
321
|
+
event.preventDefault();
|
|
322
|
+
handleTypeAhead(event.key);
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
[handleListKeyDown, handleTypeAhead]
|
|
326
|
+
);
|
|
327
|
+
const handleTriggerKeyDown = useCallback(
|
|
328
|
+
(event) => {
|
|
329
|
+
switch (event.key) {
|
|
330
|
+
case " ":
|
|
331
|
+
case "Enter":
|
|
332
|
+
case "ArrowDown":
|
|
333
|
+
case "ArrowUp":
|
|
334
|
+
event.preventDefault();
|
|
335
|
+
setOpen(true);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (!disabled && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
339
|
+
event.preventDefault();
|
|
340
|
+
setOpen(true);
|
|
341
|
+
handleTypeAhead(event.key);
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
[disabled, handleTypeAhead]
|
|
345
|
+
);
|
|
346
|
+
const containerRef = useRef(null);
|
|
347
|
+
const triggerRef = useRef(null);
|
|
348
|
+
const popupRef = useRef(null);
|
|
349
|
+
useEffect(() => {
|
|
350
|
+
if (Platform.OS !== "web" || typeof document === "undefined" || typeof document.addEventListener !== "function") {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
if (!open) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const onDocClick = /* @__PURE__ */ __name((event) => {
|
|
357
|
+
const node = containerRef.current;
|
|
358
|
+
const popup = popupRef.current;
|
|
359
|
+
const target = event.target;
|
|
360
|
+
if (node?.contains(target)) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
if (popup?.contains(target)) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
setOpen(false);
|
|
367
|
+
}, "onDocClick");
|
|
368
|
+
document.addEventListener("mousedown", onDocClick);
|
|
369
|
+
return () => document.removeEventListener("mousedown", onDocClick);
|
|
370
|
+
}, [open]);
|
|
371
|
+
const [triggerRect, setTriggerRect] = useState(
|
|
372
|
+
null
|
|
373
|
+
);
|
|
374
|
+
const measureTrigger = useCallback(() => {
|
|
375
|
+
const node = triggerRef.current;
|
|
376
|
+
if (!node) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
if (Platform.OS === "web" && typeof node.getBoundingClientRect === "function") {
|
|
380
|
+
const rect = node.getBoundingClientRect();
|
|
381
|
+
setTriggerRect({ top: rect.top, left: rect.left, width: rect.width, height: rect.height });
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (typeof node.measure === "function") {
|
|
385
|
+
node.measure((_x, _y, w, h, pageX, pageY) => {
|
|
386
|
+
setTriggerRect({ top: pageY, left: pageX, width: w, height: h });
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}, []);
|
|
390
|
+
useEffect(() => {
|
|
391
|
+
if (!open) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
if (Platform.OS !== "web" || typeof window === "undefined" || typeof window.addEventListener !== "function") {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
measureTrigger();
|
|
398
|
+
window.addEventListener("scroll", measureTrigger, true);
|
|
399
|
+
window.addEventListener("resize", measureTrigger);
|
|
400
|
+
return () => {
|
|
401
|
+
window.removeEventListener("scroll", measureTrigger, true);
|
|
402
|
+
window.removeEventListener("resize", measureTrigger);
|
|
403
|
+
};
|
|
404
|
+
}, [open, measureTrigger]);
|
|
405
|
+
useEffect(() => {
|
|
406
|
+
if (!open || searchable || Platform.OS !== "web") {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const id = requestAnimationFrame(() => {
|
|
410
|
+
const node = popupRef.current;
|
|
411
|
+
node?.focus?.();
|
|
412
|
+
});
|
|
413
|
+
return () => cancelAnimationFrame(id);
|
|
414
|
+
}, [open, searchable]);
|
|
415
|
+
const onListScroll = useCallback(
|
|
416
|
+
(event) => {
|
|
417
|
+
if (!isAsync) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
const { contentOffset, contentSize, layoutMeasurement } = event.nativeEvent;
|
|
421
|
+
const remaining = contentSize.height - contentOffset.y - layoutMeasurement.height;
|
|
422
|
+
if (remaining < itemHeight * 4) {
|
|
423
|
+
loadMore();
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
[isAsync, itemHeight, loadMore]
|
|
427
|
+
);
|
|
428
|
+
const triggerStyle = {
|
|
429
|
+
flexDirection: "row",
|
|
430
|
+
alignItems: "center",
|
|
431
|
+
justifyContent: "space-between",
|
|
432
|
+
gap: px(colors.spacing["2"]),
|
|
433
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
434
|
+
paddingVertical: px(colors.spacing["2"]),
|
|
435
|
+
minHeight: 36,
|
|
436
|
+
// component-density literal — not from theme
|
|
437
|
+
borderWidth: 1,
|
|
438
|
+
borderColor: colors.semantic.border.default,
|
|
439
|
+
borderRadius: px(colors.radius.md),
|
|
440
|
+
backgroundColor: colors.semantic.background.elevated,
|
|
441
|
+
opacity: disabled ? 0.6 : 1
|
|
442
|
+
};
|
|
443
|
+
const winDims = useWindowDimensions();
|
|
444
|
+
const popupStyle = triggerRect ? {
|
|
445
|
+
position: Platform.OS === "web" ? "fixed" : "absolute",
|
|
446
|
+
top: triggerRect.top + triggerRect.height + px(colors.spacing["1"]),
|
|
447
|
+
left: dir === "rtl" ? void 0 : triggerRect.left,
|
|
448
|
+
right: dir === "rtl" ? Platform.OS === "web" && typeof window !== "undefined" ? window.innerWidth - (triggerRect.left + triggerRect.width) : winDims.width - (triggerRect.left + triggerRect.width) : void 0,
|
|
449
|
+
minWidth: Math.max(200, triggerRect.width),
|
|
450
|
+
backgroundColor: colors.semantic.background.elevated,
|
|
451
|
+
borderRadius: px(colors.radius.lg),
|
|
452
|
+
borderWidth: 1,
|
|
453
|
+
borderColor: colors.semantic.border.default,
|
|
454
|
+
// 2147483646 (max int32 - 1) so we sit above any third-party
|
|
455
|
+
// chrome (toasts, modals, dev banners) without picking a fight
|
|
456
|
+
// for the very top slot. Combined with portaling to body below,
|
|
457
|
+
// this also dodges any ancestor stacking context that would
|
|
458
|
+
// otherwise trap our z-index inside a sibling preview frame.
|
|
459
|
+
zIndex: 2147483646,
|
|
460
|
+
...{ boxShadow: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)" }
|
|
461
|
+
} : {
|
|
462
|
+
// Trigger not yet measured — render off-screen until the
|
|
463
|
+
// first measurement lands. Avoids a one-frame flash at (0,0).
|
|
464
|
+
position: Platform.OS === "web" ? "fixed" : "absolute",
|
|
465
|
+
top: -9999,
|
|
466
|
+
left: -9999
|
|
467
|
+
};
|
|
468
|
+
const containerProps = {
|
|
469
|
+
ref: /* @__PURE__ */ __name((node) => {
|
|
470
|
+
containerRef.current = node;
|
|
471
|
+
}, "ref"),
|
|
472
|
+
...testID !== void 0 ? { testID } : {},
|
|
473
|
+
dir
|
|
474
|
+
};
|
|
475
|
+
return /* @__PURE__ */ jsxs(View, { ...containerProps, className: cn("relative", className), style: { position: "relative" }, children: [
|
|
476
|
+
/* @__PURE__ */ jsxs(
|
|
477
|
+
Pressable,
|
|
478
|
+
{
|
|
479
|
+
ref: (node) => {
|
|
480
|
+
triggerRef.current = node;
|
|
481
|
+
},
|
|
482
|
+
...{
|
|
483
|
+
onKeyDown: handleTriggerKeyDown,
|
|
484
|
+
role: "combobox",
|
|
485
|
+
accessibilityRole: "combobox",
|
|
486
|
+
"aria-expanded": open,
|
|
487
|
+
"aria-controls": `${baseId}-listbox`,
|
|
488
|
+
"aria-haspopup": "listbox",
|
|
489
|
+
tabIndex: disabled ? -1 : 0,
|
|
490
|
+
...ariaLabel !== void 0 ? { "aria-label": ariaLabel, accessibilityLabel: ariaLabel } : {},
|
|
491
|
+
...disabled ? { "aria-disabled": true, disabled: true } : {}
|
|
492
|
+
},
|
|
493
|
+
onPress: () => {
|
|
494
|
+
if (disabled) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
measureTrigger();
|
|
498
|
+
setOpen((v) => !v);
|
|
499
|
+
},
|
|
500
|
+
style: triggerStyle,
|
|
501
|
+
children: [
|
|
502
|
+
multiple ? /* @__PURE__ */ jsx(MultiTriggerLabel, { options: selectedOptions, placeholder, maxChips: maxChips ?? 3 }) : /* @__PURE__ */ jsx(
|
|
503
|
+
Text,
|
|
504
|
+
{
|
|
505
|
+
style: {
|
|
506
|
+
color: selectedOption ? colors.semantic.text.default : colors.semantic.text.muted,
|
|
507
|
+
fontFamily: colors.fontFamily.body,
|
|
508
|
+
fontSize: px(colors.fontSize.sm),
|
|
509
|
+
flex: 1
|
|
510
|
+
},
|
|
511
|
+
numberOfLines: 1,
|
|
512
|
+
children: selectedOption?.label ?? placeholder
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
/* @__PURE__ */ jsx(defaultSemanticIcons.chevronDown, { size: 16, color: colors.semantic.text.muted })
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
),
|
|
519
|
+
open ? renderPopup() : null
|
|
520
|
+
] });
|
|
521
|
+
function renderPopup() {
|
|
522
|
+
const popup = /* @__PURE__ */ jsxs(
|
|
523
|
+
View,
|
|
524
|
+
{
|
|
525
|
+
ref: (node) => {
|
|
526
|
+
popupRef.current = node;
|
|
527
|
+
},
|
|
528
|
+
...{
|
|
529
|
+
role: "listbox",
|
|
530
|
+
id: `${baseId}-listbox`,
|
|
531
|
+
...multiple ? { "aria-multiselectable": true } : {},
|
|
532
|
+
// Without a search field there's no input to capture
|
|
533
|
+
// keystrokes — make the popup itself focusable and own
|
|
534
|
+
// arrow / Enter / Escape / type-ahead. With a search
|
|
535
|
+
// field these belong to the input below.
|
|
536
|
+
...searchable ? {} : { tabIndex: -1, onKeyDown: handlePopupKeyDown }
|
|
537
|
+
},
|
|
538
|
+
style: popupStyle,
|
|
539
|
+
children: [
|
|
540
|
+
searchable ? /* @__PURE__ */ jsx(
|
|
541
|
+
SearchInput,
|
|
542
|
+
{
|
|
543
|
+
value: searchInput,
|
|
544
|
+
onChange: setSearchInput,
|
|
545
|
+
onKeyDown: handleSearchKeyDown,
|
|
546
|
+
placeholder: searchPlaceholder,
|
|
547
|
+
dir
|
|
548
|
+
}
|
|
549
|
+
) : null,
|
|
550
|
+
multiple && currentValues.length > 0 ? /* @__PURE__ */ jsx(MultiSelectionHeader, { count: currentValues.length, onClearAll: clearAll }) : null,
|
|
551
|
+
/* @__PURE__ */ jsx(
|
|
552
|
+
SelectList,
|
|
553
|
+
{
|
|
554
|
+
options: visibleOptions,
|
|
555
|
+
activeIndex,
|
|
556
|
+
currentValue: current,
|
|
557
|
+
selectedValues: currentValues,
|
|
558
|
+
multiple,
|
|
559
|
+
onSelect,
|
|
560
|
+
onActiveChange: setActiveIndex,
|
|
561
|
+
...renderOption !== void 0 ? { renderOption } : {},
|
|
562
|
+
itemHeight,
|
|
563
|
+
maxHeight: maxMenuHeight,
|
|
564
|
+
virtualized,
|
|
565
|
+
loading: isAsync && asyncLoading,
|
|
566
|
+
loadingMessage,
|
|
567
|
+
noOptionsMessage,
|
|
568
|
+
listboxId: `${baseId}-listbox`,
|
|
569
|
+
onScroll: onListScroll
|
|
570
|
+
}
|
|
571
|
+
)
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
if (Platform.OS === "web" && typeof document !== "undefined") {
|
|
576
|
+
return createPortal(popup, document.body);
|
|
577
|
+
}
|
|
578
|
+
return /* @__PURE__ */ jsxs(Modal, { transparent: true, visible: true, animationType: "fade", onRequestClose: () => setOpen(false), statusBarTranslucent: true, children: [
|
|
579
|
+
/* @__PURE__ */ jsx(
|
|
580
|
+
Pressable,
|
|
581
|
+
{
|
|
582
|
+
onPress: () => setOpen(false),
|
|
583
|
+
style: {
|
|
584
|
+
position: "absolute",
|
|
585
|
+
top: 0,
|
|
586
|
+
left: 0,
|
|
587
|
+
right: 0,
|
|
588
|
+
bottom: 0
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
),
|
|
592
|
+
popup
|
|
593
|
+
] });
|
|
594
|
+
}
|
|
595
|
+
}, "Select");
|
|
596
|
+
var SearchInput = /* @__PURE__ */ __name(({ value, onChange, onKeyDown, placeholder, dir }) => {
|
|
597
|
+
const colors = useThemeColors();
|
|
598
|
+
const inputRef = useRef(null);
|
|
599
|
+
useEffect(() => {
|
|
600
|
+
inputRef.current?.focus?.();
|
|
601
|
+
}, []);
|
|
602
|
+
return /* @__PURE__ */ jsx(
|
|
603
|
+
View,
|
|
604
|
+
{
|
|
605
|
+
style: {
|
|
606
|
+
paddingHorizontal: px(colors.spacing["2"]),
|
|
607
|
+
paddingVertical: px(colors.spacing["2"]),
|
|
608
|
+
borderBottomWidth: 1,
|
|
609
|
+
borderBottomColor: colors.semantic.border.default
|
|
610
|
+
},
|
|
611
|
+
children: /* @__PURE__ */ jsx(
|
|
612
|
+
"input",
|
|
613
|
+
{
|
|
614
|
+
ref: inputRef,
|
|
615
|
+
type: "text",
|
|
616
|
+
value,
|
|
617
|
+
onChange: (event) => onChange(event.target.value),
|
|
618
|
+
onKeyDown,
|
|
619
|
+
placeholder,
|
|
620
|
+
dir,
|
|
621
|
+
"aria-label": "Search options",
|
|
622
|
+
style: {
|
|
623
|
+
width: "100%",
|
|
624
|
+
// Inline `padding: '6px 8px'` shorthand intentionally kept as a
|
|
625
|
+
// string for the native HTML <input> — it's not an RN style prop.
|
|
626
|
+
padding: `${px(colors.spacing["2"]) - 2}px ${px(colors.spacing["2"])}px`,
|
|
627
|
+
fontFamily: colors.fontFamily.body,
|
|
628
|
+
fontSize: px(colors.fontSize.sm),
|
|
629
|
+
color: colors.semantic.text.default,
|
|
630
|
+
backgroundColor: colors.semantic.background.elevated,
|
|
631
|
+
border: `1px solid ${colors.semantic.border.default}`,
|
|
632
|
+
borderRadius: px(colors.radius.sm),
|
|
633
|
+
outline: "none"
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
)
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
}, "SearchInput");
|
|
640
|
+
var SelectList = /* @__PURE__ */ __name(({
|
|
641
|
+
options,
|
|
642
|
+
activeIndex,
|
|
643
|
+
currentValue,
|
|
644
|
+
selectedValues,
|
|
645
|
+
multiple,
|
|
646
|
+
onSelect,
|
|
647
|
+
onActiveChange,
|
|
648
|
+
renderOption,
|
|
649
|
+
itemHeight,
|
|
650
|
+
maxHeight,
|
|
651
|
+
virtualized,
|
|
652
|
+
loading,
|
|
653
|
+
loadingMessage,
|
|
654
|
+
noOptionsMessage,
|
|
655
|
+
listboxId,
|
|
656
|
+
onScroll
|
|
657
|
+
}) => {
|
|
658
|
+
const colors = useThemeColors();
|
|
659
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
660
|
+
const totalHeight = options.length * itemHeight;
|
|
661
|
+
const visibleStart = virtualized ? Math.max(0, Math.floor(scrollTop / itemHeight) - VIRTUAL_OVERSCAN) : 0;
|
|
662
|
+
const visibleEnd = virtualized ? Math.min(options.length, Math.ceil((scrollTop + maxHeight) / itemHeight) + VIRTUAL_OVERSCAN) : options.length;
|
|
663
|
+
const handleScroll = /* @__PURE__ */ __name((event) => {
|
|
664
|
+
if (virtualized) {
|
|
665
|
+
setScrollTop(event.nativeEvent.contentOffset.y);
|
|
666
|
+
}
|
|
667
|
+
onScroll(event);
|
|
668
|
+
}, "handleScroll");
|
|
669
|
+
if (loading && options.length === 0) {
|
|
670
|
+
return /* @__PURE__ */ jsx(View, { style: { padding: px(colors.spacing["4"]), alignItems: "center" }, children: /* @__PURE__ */ jsx(
|
|
671
|
+
Text,
|
|
672
|
+
{
|
|
673
|
+
style: {
|
|
674
|
+
color: colors.semantic.text.muted,
|
|
675
|
+
fontFamily: colors.fontFamily.body,
|
|
676
|
+
fontSize: px(colors.fontSize.sm)
|
|
677
|
+
},
|
|
678
|
+
children: loadingMessage
|
|
679
|
+
}
|
|
680
|
+
) });
|
|
681
|
+
}
|
|
682
|
+
if (options.length === 0) {
|
|
683
|
+
return /* @__PURE__ */ jsx(View, { style: { padding: px(colors.spacing["4"]), alignItems: "center" }, children: /* @__PURE__ */ jsx(
|
|
684
|
+
Text,
|
|
685
|
+
{
|
|
686
|
+
style: {
|
|
687
|
+
color: colors.semantic.text.muted,
|
|
688
|
+
fontFamily: colors.fontFamily.body,
|
|
689
|
+
fontSize: px(colors.fontSize.sm)
|
|
690
|
+
},
|
|
691
|
+
children: noOptionsMessage
|
|
692
|
+
}
|
|
693
|
+
) });
|
|
694
|
+
}
|
|
695
|
+
const items = [];
|
|
696
|
+
let lastGroup;
|
|
697
|
+
for (let i = visibleStart; i < visibleEnd; i += 1) {
|
|
698
|
+
const opt = options[i];
|
|
699
|
+
if (!opt) {
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
if (opt.group !== lastGroup && opt.group !== void 0) {
|
|
703
|
+
items.push(
|
|
704
|
+
/* @__PURE__ */ jsx(
|
|
705
|
+
View,
|
|
706
|
+
{
|
|
707
|
+
style: {
|
|
708
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
709
|
+
paddingTop: px(colors.spacing["2"]),
|
|
710
|
+
paddingBottom: px(colors.spacing["1"]),
|
|
711
|
+
position: virtualized ? "absolute" : "relative",
|
|
712
|
+
top: virtualized ? i * itemHeight - px(colors.spacing["4"]) : void 0,
|
|
713
|
+
left: 0,
|
|
714
|
+
right: 0
|
|
715
|
+
},
|
|
716
|
+
children: /* @__PURE__ */ jsx(
|
|
717
|
+
Text,
|
|
718
|
+
{
|
|
719
|
+
style: {
|
|
720
|
+
color: colors.semantic.text.muted,
|
|
721
|
+
fontFamily: colors.fontFamily.body,
|
|
722
|
+
fontSize: 11,
|
|
723
|
+
// group header — component-density literal — not from theme (smaller than xs)
|
|
724
|
+
fontWeight: colors.fontWeight.semibold,
|
|
725
|
+
textTransform: "uppercase",
|
|
726
|
+
letterSpacing: 0.5
|
|
727
|
+
},
|
|
728
|
+
children: opt.group
|
|
729
|
+
}
|
|
730
|
+
)
|
|
731
|
+
},
|
|
732
|
+
`grp-${i}-${opt.group}`
|
|
733
|
+
)
|
|
734
|
+
);
|
|
735
|
+
lastGroup = opt.group;
|
|
736
|
+
}
|
|
737
|
+
const selected = multiple ? selectedValues.includes(opt.value) : opt.value === currentValue;
|
|
738
|
+
const active = i === activeIndex;
|
|
739
|
+
const itemNode = renderOption ? renderOption(opt, { selected, active }) : /* @__PURE__ */ jsx(DefaultOptionRow, { option: opt, selected, active, multiple });
|
|
740
|
+
items.push(
|
|
741
|
+
/* @__PURE__ */ jsx(
|
|
742
|
+
Pressable,
|
|
743
|
+
{
|
|
744
|
+
...{
|
|
745
|
+
role: "option",
|
|
746
|
+
accessibilityRole: "none",
|
|
747
|
+
"aria-selected": selected,
|
|
748
|
+
onMouseEnter: /* @__PURE__ */ __name(() => onActiveChange(i), "onMouseEnter"),
|
|
749
|
+
...opt.disabled ? { "aria-disabled": true, disabled: true } : {}
|
|
750
|
+
},
|
|
751
|
+
onPress: () => onSelect(opt),
|
|
752
|
+
style: {
|
|
753
|
+
position: virtualized ? "absolute" : "relative",
|
|
754
|
+
top: virtualized ? i * itemHeight : void 0,
|
|
755
|
+
left: 0,
|
|
756
|
+
right: 0,
|
|
757
|
+
height: itemHeight,
|
|
758
|
+
flexDirection: "row",
|
|
759
|
+
alignItems: "center",
|
|
760
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
761
|
+
backgroundColor: active ? colors.semantic.background.subtle : "transparent",
|
|
762
|
+
opacity: opt.disabled ? 0.5 : 1
|
|
763
|
+
},
|
|
764
|
+
children: itemNode
|
|
765
|
+
},
|
|
766
|
+
`opt-${i}-${opt.value}`
|
|
767
|
+
)
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
return /* @__PURE__ */ jsx(
|
|
771
|
+
ScrollView,
|
|
772
|
+
{
|
|
773
|
+
nativeID: listboxId,
|
|
774
|
+
onScroll: handleScroll,
|
|
775
|
+
scrollEventThrottle: 16,
|
|
776
|
+
style: { maxHeight },
|
|
777
|
+
contentContainerStyle: virtualized ? { height: totalHeight, position: "relative" } : void 0,
|
|
778
|
+
children: items
|
|
779
|
+
}
|
|
780
|
+
);
|
|
781
|
+
}, "SelectList");
|
|
782
|
+
var DefaultOptionRow = /* @__PURE__ */ __name(({
|
|
783
|
+
option,
|
|
784
|
+
selected,
|
|
785
|
+
active,
|
|
786
|
+
multiple = false
|
|
787
|
+
}) => {
|
|
788
|
+
const colors = useThemeColors();
|
|
789
|
+
return /* @__PURE__ */ jsxs(View, { style: { flexDirection: "row", alignItems: "center", flex: 1, gap: px(colors.spacing["2"]) }, children: [
|
|
790
|
+
multiple ? (
|
|
791
|
+
// Inline checkbox-style indicator. We don't reuse <Checkbox>
|
|
792
|
+
// here because the row is already a Pressable — nesting two
|
|
793
|
+
// pressable surfaces breaks tap handling on native; this
|
|
794
|
+
// is purely visual (the Pressable parent owns the toggle).
|
|
795
|
+
/* @__PURE__ */ jsx(
|
|
796
|
+
View,
|
|
797
|
+
{
|
|
798
|
+
"aria-hidden": true,
|
|
799
|
+
accessibilityElementsHidden: true,
|
|
800
|
+
importantForAccessibility: "no-hide-descendants",
|
|
801
|
+
style: {
|
|
802
|
+
width: 18,
|
|
803
|
+
height: 18,
|
|
804
|
+
borderWidth: 1,
|
|
805
|
+
borderRadius: px(colors.radius.sm),
|
|
806
|
+
borderColor: selected ? colors.semantic.interactive.primary : colors.semantic.border.strong,
|
|
807
|
+
backgroundColor: selected ? colors.semantic.interactive.primary : "transparent",
|
|
808
|
+
alignItems: "center",
|
|
809
|
+
justifyContent: "center"
|
|
810
|
+
},
|
|
811
|
+
children: selected ? /* @__PURE__ */ jsx(defaultSemanticIcons.check, { size: 12, color: colors.semantic.text.inverted }) : null
|
|
812
|
+
}
|
|
813
|
+
)
|
|
814
|
+
) : null,
|
|
815
|
+
/* @__PURE__ */ jsx(
|
|
816
|
+
Text,
|
|
817
|
+
{
|
|
818
|
+
style: {
|
|
819
|
+
color: colors.semantic.text.default,
|
|
820
|
+
fontFamily: colors.fontFamily.body,
|
|
821
|
+
fontSize: px(colors.fontSize.sm),
|
|
822
|
+
fontWeight: selected ? colors.fontWeight.semibold : colors.fontWeight.regular,
|
|
823
|
+
flex: 1
|
|
824
|
+
},
|
|
825
|
+
numberOfLines: 1,
|
|
826
|
+
children: option.label
|
|
827
|
+
}
|
|
828
|
+
),
|
|
829
|
+
selected && !multiple ? /* @__PURE__ */ jsx(defaultSemanticIcons.check, { size: 16, color: colors.semantic.interactive.primary }) : null,
|
|
830
|
+
active ? null : null
|
|
831
|
+
] });
|
|
832
|
+
}, "DefaultOptionRow");
|
|
833
|
+
var MultiTriggerLabel = /* @__PURE__ */ __name(({
|
|
834
|
+
options,
|
|
835
|
+
placeholder,
|
|
836
|
+
maxChips
|
|
837
|
+
}) => {
|
|
838
|
+
const colors = useThemeColors();
|
|
839
|
+
if (options.length === 0) {
|
|
840
|
+
return /* @__PURE__ */ jsx(
|
|
841
|
+
Text,
|
|
842
|
+
{
|
|
843
|
+
style: {
|
|
844
|
+
color: colors.semantic.text.muted,
|
|
845
|
+
fontFamily: colors.fontFamily.body,
|
|
846
|
+
fontSize: px(colors.fontSize.sm),
|
|
847
|
+
flex: 1
|
|
848
|
+
},
|
|
849
|
+
numberOfLines: 1,
|
|
850
|
+
children: placeholder
|
|
851
|
+
}
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
if (options.length > maxChips) {
|
|
855
|
+
return /* @__PURE__ */ jsxs(
|
|
856
|
+
Text,
|
|
857
|
+
{
|
|
858
|
+
style: {
|
|
859
|
+
color: colors.semantic.text.default,
|
|
860
|
+
fontFamily: colors.fontFamily.body,
|
|
861
|
+
fontSize: px(colors.fontSize.sm),
|
|
862
|
+
fontWeight: colors.fontWeight.medium,
|
|
863
|
+
fontVariant: ["tabular-nums"],
|
|
864
|
+
flex: 1
|
|
865
|
+
},
|
|
866
|
+
numberOfLines: 1,
|
|
867
|
+
children: [
|
|
868
|
+
options.length,
|
|
869
|
+
" selected"
|
|
870
|
+
]
|
|
871
|
+
}
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
return /* @__PURE__ */ jsx(
|
|
875
|
+
View,
|
|
876
|
+
{
|
|
877
|
+
style: {
|
|
878
|
+
flexDirection: "row",
|
|
879
|
+
alignItems: "center",
|
|
880
|
+
flexWrap: "wrap",
|
|
881
|
+
rowGap: px(colors.spacing["1"]),
|
|
882
|
+
columnGap: px(colors.spacing["1"]),
|
|
883
|
+
flex: 1
|
|
884
|
+
},
|
|
885
|
+
children: options.map((opt) => /* @__PURE__ */ jsx(
|
|
886
|
+
View,
|
|
887
|
+
{
|
|
888
|
+
style: {
|
|
889
|
+
flexDirection: "row",
|
|
890
|
+
alignItems: "center",
|
|
891
|
+
paddingHorizontal: px(colors.spacing["2"]),
|
|
892
|
+
paddingVertical: 2,
|
|
893
|
+
borderRadius: px(colors.radius.sm),
|
|
894
|
+
backgroundColor: colors.semantic.background.subtle,
|
|
895
|
+
borderWidth: 1,
|
|
896
|
+
borderColor: colors.semantic.border.default
|
|
897
|
+
},
|
|
898
|
+
children: /* @__PURE__ */ jsx(
|
|
899
|
+
Text,
|
|
900
|
+
{
|
|
901
|
+
style: {
|
|
902
|
+
color: colors.semantic.text.default,
|
|
903
|
+
fontFamily: colors.fontFamily.body,
|
|
904
|
+
fontSize: px(colors.fontSize.sm)
|
|
905
|
+
},
|
|
906
|
+
numberOfLines: 1,
|
|
907
|
+
children: opt.label
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
},
|
|
911
|
+
`chip-${opt.value}`
|
|
912
|
+
))
|
|
913
|
+
}
|
|
914
|
+
);
|
|
915
|
+
}, "MultiTriggerLabel");
|
|
916
|
+
var MultiSelectionHeader = /* @__PURE__ */ __name(({ count, onClearAll }) => {
|
|
917
|
+
const colors = useThemeColors();
|
|
918
|
+
return /* @__PURE__ */ jsxs(
|
|
919
|
+
View,
|
|
920
|
+
{
|
|
921
|
+
style: {
|
|
922
|
+
flexDirection: "row",
|
|
923
|
+
alignItems: "center",
|
|
924
|
+
justifyContent: "space-between",
|
|
925
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
926
|
+
paddingVertical: px(colors.spacing["2"]),
|
|
927
|
+
borderBottomWidth: 1,
|
|
928
|
+
borderBottomColor: colors.semantic.border.default
|
|
929
|
+
},
|
|
930
|
+
children: [
|
|
931
|
+
/* @__PURE__ */ jsxs(
|
|
932
|
+
Text,
|
|
933
|
+
{
|
|
934
|
+
style: {
|
|
935
|
+
color: colors.semantic.text.muted,
|
|
936
|
+
fontFamily: colors.fontFamily.body,
|
|
937
|
+
fontSize: px(colors.fontSize.sm),
|
|
938
|
+
fontVariant: ["tabular-nums"]
|
|
939
|
+
},
|
|
940
|
+
children: [
|
|
941
|
+
count,
|
|
942
|
+
" selected"
|
|
943
|
+
]
|
|
944
|
+
}
|
|
945
|
+
),
|
|
946
|
+
/* @__PURE__ */ jsx(
|
|
947
|
+
Pressable,
|
|
948
|
+
{
|
|
949
|
+
role: "button",
|
|
950
|
+
accessibilityRole: "button",
|
|
951
|
+
"aria-label": "Clear all",
|
|
952
|
+
accessibilityLabel: "Clear all",
|
|
953
|
+
onPress: onClearAll,
|
|
954
|
+
style: ({ pressed }) => ({
|
|
955
|
+
paddingHorizontal: px(colors.spacing["2"]),
|
|
956
|
+
paddingVertical: 2,
|
|
957
|
+
borderRadius: px(colors.radius.sm),
|
|
958
|
+
opacity: pressed ? 0.6 : 1
|
|
959
|
+
}),
|
|
960
|
+
children: /* @__PURE__ */ jsx(
|
|
961
|
+
Text,
|
|
962
|
+
{
|
|
963
|
+
style: {
|
|
964
|
+
color: colors.semantic.interactive.primary,
|
|
965
|
+
fontFamily: colors.fontFamily.body,
|
|
966
|
+
fontSize: px(colors.fontSize.sm),
|
|
967
|
+
fontWeight: colors.fontWeight.medium
|
|
968
|
+
},
|
|
969
|
+
children: "Clear all"
|
|
970
|
+
}
|
|
971
|
+
)
|
|
972
|
+
}
|
|
973
|
+
)
|
|
974
|
+
]
|
|
975
|
+
}
|
|
976
|
+
);
|
|
977
|
+
}, "MultiSelectionHeader");
|
|
978
|
+
|
|
979
|
+
export { Select };
|
|
980
|
+
//# sourceMappingURL=chunk-ZQMNGPLE.js.map
|
|
981
|
+
//# sourceMappingURL=chunk-ZQMNGPLE.js.map
|