@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,967 @@
|
|
|
1
|
+
import { Select } from './chunk-ZQMNGPLE.js';
|
|
2
|
+
import { useTranslation } from './chunk-RFW5SRZA.js';
|
|
3
|
+
import { Slot } from './chunk-ZIBNLXIV.js';
|
|
4
|
+
import { px } from './chunk-5A2QOOVN.js';
|
|
5
|
+
import { cn } from './chunk-CHXHRJNZ.js';
|
|
6
|
+
import { useThemeColors } from './chunk-R5JMDDCB.js';
|
|
7
|
+
import { __name } from './chunk-WCQVDF3K.js';
|
|
8
|
+
import { createContext, useState, useRef, useCallback, useMemo, useEffect, useContext } from 'react';
|
|
9
|
+
import { useWindowDimensions, View, Text, TextInput, Platform, Pressable } from 'react-native';
|
|
10
|
+
import { jsxs, jsx, Fragment } from 'nativewind/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var range = /* @__PURE__ */ __name((from, to) => {
|
|
13
|
+
if (to < from) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const out = new Array(to - from + 1);
|
|
17
|
+
for (let i = 0; i < out.length; i += 1) {
|
|
18
|
+
out[i] = from + i;
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}, "range");
|
|
22
|
+
function usePagination(args) {
|
|
23
|
+
const {
|
|
24
|
+
page: controlledPage,
|
|
25
|
+
defaultPage = 1,
|
|
26
|
+
pageCount,
|
|
27
|
+
siblingCount = 1,
|
|
28
|
+
boundaryCount = 1,
|
|
29
|
+
showFirstLast = false,
|
|
30
|
+
showPrevNext = true,
|
|
31
|
+
onPageChange
|
|
32
|
+
} = args;
|
|
33
|
+
const isControlled = controlledPage !== void 0;
|
|
34
|
+
const [uncontrolledPage, setUncontrolledPage] = useState(defaultPage);
|
|
35
|
+
const onChangeRef = useRef(onPageChange);
|
|
36
|
+
onChangeRef.current = onPageChange;
|
|
37
|
+
const safePageCount = Math.max(1, Math.floor(pageCount));
|
|
38
|
+
const rawPage = isControlled ? controlledPage : uncontrolledPage;
|
|
39
|
+
const currentPage = Math.min(Math.max(1, Math.floor(rawPage)), safePageCount);
|
|
40
|
+
const goToPage = useCallback(
|
|
41
|
+
(next2) => {
|
|
42
|
+
const clamped = Math.min(Math.max(1, Math.floor(next2)), Math.max(1, Math.floor(pageCount)));
|
|
43
|
+
if (!isControlled) {
|
|
44
|
+
setUncontrolledPage(clamped);
|
|
45
|
+
}
|
|
46
|
+
onChangeRef.current?.(clamped);
|
|
47
|
+
},
|
|
48
|
+
[isControlled, pageCount]
|
|
49
|
+
);
|
|
50
|
+
const prev = useCallback(() => goToPage(currentPage - 1), [goToPage, currentPage]);
|
|
51
|
+
const next = useCallback(() => goToPage(currentPage + 1), [goToPage, currentPage]);
|
|
52
|
+
const first = useCallback(() => goToPage(1), [goToPage]);
|
|
53
|
+
const last = useCallback(() => goToPage(safePageCount), [goToPage, safePageCount]);
|
|
54
|
+
const pages = useMemo(() => {
|
|
55
|
+
const items = [];
|
|
56
|
+
const safeSibling = Math.max(0, Math.floor(siblingCount));
|
|
57
|
+
const safeBoundary = Math.max(0, Math.floor(boundaryCount));
|
|
58
|
+
if (showFirstLast) {
|
|
59
|
+
items.push({ type: "first", disabled: currentPage <= 1 });
|
|
60
|
+
}
|
|
61
|
+
if (showPrevNext) {
|
|
62
|
+
items.push({ type: "prev", disabled: currentPage <= 1 });
|
|
63
|
+
}
|
|
64
|
+
const startPages = range(1, Math.min(safeBoundary, safePageCount));
|
|
65
|
+
const endPages = range(Math.max(safePageCount - safeBoundary + 1, safeBoundary + 1), safePageCount);
|
|
66
|
+
const siblingsStart = Math.max(
|
|
67
|
+
Math.min(currentPage - safeSibling, safePageCount - safeBoundary - safeSibling * 2 - 1),
|
|
68
|
+
safeBoundary + 2
|
|
69
|
+
);
|
|
70
|
+
const siblingsEnd = Math.min(
|
|
71
|
+
Math.max(currentPage + safeSibling, safeBoundary + safeSibling * 2 + 2),
|
|
72
|
+
endPages.length > 0 ? endPages[0] - 2 : safePageCount - 1
|
|
73
|
+
);
|
|
74
|
+
const middle = [];
|
|
75
|
+
if (siblingsStart > safeBoundary + 2) {
|
|
76
|
+
middle.push("ellipsis");
|
|
77
|
+
} else if (safeBoundary + 1 < safePageCount - safeBoundary) {
|
|
78
|
+
middle.push(safeBoundary + 1);
|
|
79
|
+
}
|
|
80
|
+
for (const p of range(siblingsStart, siblingsEnd)) {
|
|
81
|
+
middle.push(p);
|
|
82
|
+
}
|
|
83
|
+
if (siblingsEnd < safePageCount - safeBoundary - 1) {
|
|
84
|
+
middle.push("ellipsis");
|
|
85
|
+
} else if (safePageCount - safeBoundary > safeBoundary) {
|
|
86
|
+
middle.push(safePageCount - safeBoundary);
|
|
87
|
+
}
|
|
88
|
+
const seen = /* @__PURE__ */ new Set();
|
|
89
|
+
const pushPage = /* @__PURE__ */ __name((n) => {
|
|
90
|
+
if (n < 1 || n > safePageCount || seen.has(n)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
seen.add(n);
|
|
94
|
+
items.push({ type: "page", page: n, selected: n === currentPage });
|
|
95
|
+
}, "pushPage");
|
|
96
|
+
for (const n of startPages) {
|
|
97
|
+
pushPage(n);
|
|
98
|
+
}
|
|
99
|
+
for (const m of middle) {
|
|
100
|
+
if (m === "ellipsis") {
|
|
101
|
+
items.push({ type: "ellipsis" });
|
|
102
|
+
} else {
|
|
103
|
+
pushPage(m);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const n of endPages) {
|
|
107
|
+
pushPage(n);
|
|
108
|
+
}
|
|
109
|
+
if (showPrevNext) {
|
|
110
|
+
items.push({ type: "next", disabled: currentPage >= safePageCount });
|
|
111
|
+
}
|
|
112
|
+
if (showFirstLast) {
|
|
113
|
+
items.push({ type: "last", disabled: currentPage >= safePageCount });
|
|
114
|
+
}
|
|
115
|
+
return items;
|
|
116
|
+
}, [currentPage, safePageCount, siblingCount, boundaryCount, showFirstLast, showPrevNext]);
|
|
117
|
+
return {
|
|
118
|
+
page: currentPage,
|
|
119
|
+
pages,
|
|
120
|
+
canPrev: currentPage > 1,
|
|
121
|
+
canNext: currentPage < safePageCount,
|
|
122
|
+
goToPage,
|
|
123
|
+
prev,
|
|
124
|
+
next,
|
|
125
|
+
first,
|
|
126
|
+
last
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
__name(usePagination, "usePagination");
|
|
130
|
+
var PAGINATION_COMPACT_BREAKPOINT = 480;
|
|
131
|
+
var PaginationContext = createContext(null);
|
|
132
|
+
var usePaginationContext = /* @__PURE__ */ __name((label) => {
|
|
133
|
+
const ctx = useContext(PaginationContext);
|
|
134
|
+
if (!ctx) {
|
|
135
|
+
throw new Error(`<${label}> must be rendered inside a <Pagination> or <Pagination.Root>.`);
|
|
136
|
+
}
|
|
137
|
+
return ctx;
|
|
138
|
+
}, "usePaginationContext");
|
|
139
|
+
var ItemButton = /* @__PURE__ */ __name(({ type, selected, disabled, ariaLabel, ariaCurrent, label, onPress, testID }) => {
|
|
140
|
+
const colors = useThemeColors();
|
|
141
|
+
const isChevron = type === "prev" || type === "next" || type === "first" || type === "last";
|
|
142
|
+
const isInteractive = !disabled && type !== "ellipsis";
|
|
143
|
+
const size = px(colors.spacing["8"]);
|
|
144
|
+
if (type === "ellipsis") {
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
View,
|
|
147
|
+
{
|
|
148
|
+
"aria-hidden": true,
|
|
149
|
+
accessibilityElementsHidden: true,
|
|
150
|
+
importantForAccessibility: "no-hide-descendants",
|
|
151
|
+
style: {
|
|
152
|
+
minWidth: size,
|
|
153
|
+
minHeight: size,
|
|
154
|
+
alignItems: "center",
|
|
155
|
+
justifyContent: "center"
|
|
156
|
+
},
|
|
157
|
+
children: /* @__PURE__ */ jsx(
|
|
158
|
+
Text,
|
|
159
|
+
{
|
|
160
|
+
style: {
|
|
161
|
+
fontFamily: colors.fontFamily.body,
|
|
162
|
+
fontSize: px(colors.fontSize.sm),
|
|
163
|
+
color: colors.semantic.text.muted,
|
|
164
|
+
// Optical adjust so the dots sit on the row baseline.
|
|
165
|
+
marginTop: -2,
|
|
166
|
+
letterSpacing: 1
|
|
167
|
+
},
|
|
168
|
+
children: label
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
const baseStyle = {
|
|
175
|
+
minWidth: size,
|
|
176
|
+
height: size,
|
|
177
|
+
paddingHorizontal: px(colors.spacing["2"]),
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
justifyContent: "center",
|
|
180
|
+
borderRadius: px(colors.radius.md),
|
|
181
|
+
// Selected: filled pill in primary. Default: transparent. Press/hover
|
|
182
|
+
// deltas overlay this in the style fn below.
|
|
183
|
+
backgroundColor: selected ? colors.semantic.interactive.primary : "transparent",
|
|
184
|
+
// A 1px transparent border is reserved on every item so the layout
|
|
185
|
+
// stays stable when the selected one shows its accent border.
|
|
186
|
+
borderWidth: 1,
|
|
187
|
+
borderColor: selected ? colors.semantic.interactive.primary : "transparent",
|
|
188
|
+
opacity: disabled ? 0.35 : 1
|
|
189
|
+
};
|
|
190
|
+
const webExtras = Platform.OS === "web" ? {
|
|
191
|
+
transitionProperty: "background-color, color, border-color",
|
|
192
|
+
transitionDuration: "120ms",
|
|
193
|
+
transitionTimingFunction: "cubic-bezier(0.2, 0, 0, 1)"
|
|
194
|
+
} : null;
|
|
195
|
+
const staticStyle = { ...baseStyle, ...webExtras ?? {} };
|
|
196
|
+
return /* @__PURE__ */ jsx(
|
|
197
|
+
Pressable,
|
|
198
|
+
{
|
|
199
|
+
...testID !== void 0 ? { testID } : {},
|
|
200
|
+
role: "button",
|
|
201
|
+
accessibilityRole: "button",
|
|
202
|
+
accessibilityLabel: ariaLabel,
|
|
203
|
+
"aria-label": ariaLabel,
|
|
204
|
+
...ariaCurrent ? { "aria-current": ariaCurrent } : {},
|
|
205
|
+
disabled,
|
|
206
|
+
"aria-disabled": disabled || void 0,
|
|
207
|
+
onPress: isInteractive ? onPress : void 0,
|
|
208
|
+
style: Platform.OS === "web" ? (state) => {
|
|
209
|
+
const { pressed, hovered } = state;
|
|
210
|
+
const interactive = !selected && (pressed || hovered) ? colors.semantic.background.subtle : staticStyle.backgroundColor;
|
|
211
|
+
return { ...staticStyle, backgroundColor: interactive };
|
|
212
|
+
} : staticStyle,
|
|
213
|
+
children: /* @__PURE__ */ jsx(
|
|
214
|
+
Text,
|
|
215
|
+
{
|
|
216
|
+
style: {
|
|
217
|
+
fontFamily: colors.fontFamily.body,
|
|
218
|
+
fontSize: isChevron ? px(colors.fontSize.md) : px(colors.fontSize.sm),
|
|
219
|
+
lineHeight: px(colors.fontSize.md),
|
|
220
|
+
color: selected ? colors.semantic.text.inverted : disabled ? colors.semantic.text.muted : colors.semantic.text.default,
|
|
221
|
+
fontWeight: selected ? colors.fontWeight.semibold : colors.fontWeight.medium,
|
|
222
|
+
fontVariant: ["tabular-nums"],
|
|
223
|
+
// Chevron glyphs sit a hair high in most fonts.
|
|
224
|
+
marginTop: isChevron ? -1 : 0
|
|
225
|
+
},
|
|
226
|
+
children: label
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}, "ItemButton");
|
|
232
|
+
var LiveRegion = /* @__PURE__ */ __name(({ message }) => {
|
|
233
|
+
if (Platform.OS === "web") {
|
|
234
|
+
return /* @__PURE__ */ jsx(
|
|
235
|
+
View,
|
|
236
|
+
{
|
|
237
|
+
style: {
|
|
238
|
+
position: "absolute",
|
|
239
|
+
width: 1,
|
|
240
|
+
height: 1,
|
|
241
|
+
overflow: "hidden",
|
|
242
|
+
opacity: 0
|
|
243
|
+
},
|
|
244
|
+
role: "status",
|
|
245
|
+
"aria-live": "polite",
|
|
246
|
+
"aria-atomic": true,
|
|
247
|
+
children: /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", children: message })
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
return /* @__PURE__ */ jsx(View, { accessibilityLiveRegion: "polite", style: { width: 0, height: 0 }, children: /* @__PURE__ */ jsx(Text, { children: message }) });
|
|
252
|
+
}, "LiveRegion");
|
|
253
|
+
var ItemsRenderer = /* @__PURE__ */ __name(({ items, onItemPress }) => {
|
|
254
|
+
const { labels, renderItem, dir } = usePaginationContext("Pagination.Items");
|
|
255
|
+
const elements = items.map((item, idx) => {
|
|
256
|
+
const key = `${item.type}-${item.page ?? idx}-${idx}`;
|
|
257
|
+
const ariaLabel = ariaLabelFor(item, labels);
|
|
258
|
+
const ariaCurrent = item.selected ? "page" : void 0;
|
|
259
|
+
const display = displayLabelFor(item, labels, dir);
|
|
260
|
+
const onPress = /* @__PURE__ */ __name(() => onItemPress(item), "onPress");
|
|
261
|
+
if (renderItem && item.type !== "ellipsis") {
|
|
262
|
+
return /* @__PURE__ */ jsx(View, { children: renderItem({
|
|
263
|
+
type: item.type,
|
|
264
|
+
...item.page !== void 0 ? { page: item.page } : {},
|
|
265
|
+
selected: item.selected ?? false,
|
|
266
|
+
disabled: item.disabled ?? false,
|
|
267
|
+
ariaLabel,
|
|
268
|
+
...ariaCurrent ? { ariaCurrent } : {},
|
|
269
|
+
children: display,
|
|
270
|
+
onPress
|
|
271
|
+
}) }, key);
|
|
272
|
+
}
|
|
273
|
+
return /* @__PURE__ */ jsx(
|
|
274
|
+
ItemButton,
|
|
275
|
+
{
|
|
276
|
+
type: item.type,
|
|
277
|
+
...item.page !== void 0 ? { page: item.page } : {},
|
|
278
|
+
selected: item.selected ?? false,
|
|
279
|
+
disabled: item.disabled ?? false,
|
|
280
|
+
ariaLabel,
|
|
281
|
+
...ariaCurrent ? { ariaCurrent } : {},
|
|
282
|
+
label: display,
|
|
283
|
+
onPress
|
|
284
|
+
},
|
|
285
|
+
key
|
|
286
|
+
);
|
|
287
|
+
});
|
|
288
|
+
return /* @__PURE__ */ jsx(Fragment, { children: elements });
|
|
289
|
+
}, "ItemsRenderer");
|
|
290
|
+
function ariaLabelFor(item, labels) {
|
|
291
|
+
switch (item.type) {
|
|
292
|
+
case "first":
|
|
293
|
+
return labels.first;
|
|
294
|
+
case "prev":
|
|
295
|
+
return labels.prev;
|
|
296
|
+
case "next":
|
|
297
|
+
return labels.next;
|
|
298
|
+
case "last":
|
|
299
|
+
return labels.last;
|
|
300
|
+
case "ellipsis":
|
|
301
|
+
return labels.ellipsis;
|
|
302
|
+
case "page":
|
|
303
|
+
return item.selected ? labels.currentPage : labels.gotoPage(item.page ?? 0);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
__name(ariaLabelFor, "ariaLabelFor");
|
|
307
|
+
function displayLabelFor(item, labels, dir) {
|
|
308
|
+
const flip = dir === "rtl";
|
|
309
|
+
switch (item.type) {
|
|
310
|
+
case "first":
|
|
311
|
+
return flip ? "\xBB" : "\xAB";
|
|
312
|
+
case "last":
|
|
313
|
+
return flip ? "\xAB" : "\xBB";
|
|
314
|
+
case "prev":
|
|
315
|
+
return flip ? "\u203A" : "\u2039";
|
|
316
|
+
case "next":
|
|
317
|
+
return flip ? "\u2039" : "\u203A";
|
|
318
|
+
case "ellipsis":
|
|
319
|
+
return "\u2026";
|
|
320
|
+
case "page":
|
|
321
|
+
return String(item.page ?? "");
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
__name(displayLabelFor, "displayLabelFor");
|
|
325
|
+
var CompactView = /* @__PURE__ */ __name(({
|
|
326
|
+
onPrev,
|
|
327
|
+
onNext,
|
|
328
|
+
canPrev,
|
|
329
|
+
canNext,
|
|
330
|
+
pageLabel
|
|
331
|
+
}) => {
|
|
332
|
+
const colors = useThemeColors();
|
|
333
|
+
const { labels, dir } = usePaginationContext("Pagination(compact)");
|
|
334
|
+
const flip = dir === "rtl";
|
|
335
|
+
return /* @__PURE__ */ jsxs(
|
|
336
|
+
View,
|
|
337
|
+
{
|
|
338
|
+
style: {
|
|
339
|
+
flexDirection: "row",
|
|
340
|
+
alignItems: "center",
|
|
341
|
+
justifyContent: "space-between",
|
|
342
|
+
gap: px(colors.spacing["1"]),
|
|
343
|
+
flexGrow: 1
|
|
344
|
+
},
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ jsx(
|
|
347
|
+
ItemButton,
|
|
348
|
+
{
|
|
349
|
+
type: "prev",
|
|
350
|
+
selected: false,
|
|
351
|
+
disabled: !canPrev,
|
|
352
|
+
ariaLabel: labels.prev,
|
|
353
|
+
label: flip ? "\u203A" : "\u2039",
|
|
354
|
+
onPress: onPrev
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ jsx(
|
|
358
|
+
View,
|
|
359
|
+
{
|
|
360
|
+
style: {
|
|
361
|
+
flexGrow: 1,
|
|
362
|
+
alignItems: "center",
|
|
363
|
+
justifyContent: "center",
|
|
364
|
+
paddingHorizontal: px(colors.spacing["3"])
|
|
365
|
+
},
|
|
366
|
+
children: /* @__PURE__ */ jsx(
|
|
367
|
+
Text,
|
|
368
|
+
{
|
|
369
|
+
style: {
|
|
370
|
+
fontFamily: colors.fontFamily.body,
|
|
371
|
+
fontSize: px(colors.fontSize.sm),
|
|
372
|
+
color: colors.semantic.text.default,
|
|
373
|
+
fontWeight: colors.fontWeight.medium,
|
|
374
|
+
fontVariant: ["tabular-nums"]
|
|
375
|
+
},
|
|
376
|
+
children: pageLabel
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
/* @__PURE__ */ jsx(
|
|
382
|
+
ItemButton,
|
|
383
|
+
{
|
|
384
|
+
type: "next",
|
|
385
|
+
selected: false,
|
|
386
|
+
disabled: !canNext,
|
|
387
|
+
ariaLabel: labels.next,
|
|
388
|
+
label: flip ? "\u2039" : "\u203A",
|
|
389
|
+
onPress: onNext
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
}, "CompactView");
|
|
396
|
+
var ANNOUNCE_DEBOUNCE_MS = 150;
|
|
397
|
+
var PaginationRoot = /* @__PURE__ */ __name((props) => {
|
|
398
|
+
const {
|
|
399
|
+
page: controlledPage,
|
|
400
|
+
defaultPage = 1,
|
|
401
|
+
pageCount,
|
|
402
|
+
siblingCount = 1,
|
|
403
|
+
boundaryCount = 1,
|
|
404
|
+
showFirstLast = false,
|
|
405
|
+
hideOnSinglePage = true,
|
|
406
|
+
variant = "auto",
|
|
407
|
+
showRange = false,
|
|
408
|
+
itemCount,
|
|
409
|
+
pageSize: pageSizeProp,
|
|
410
|
+
onPageChange,
|
|
411
|
+
renderItem,
|
|
412
|
+
dir = "ltr",
|
|
413
|
+
previousLabel,
|
|
414
|
+
nextLabel,
|
|
415
|
+
firstLabel,
|
|
416
|
+
lastLabel,
|
|
417
|
+
ariaLabel,
|
|
418
|
+
className,
|
|
419
|
+
testID,
|
|
420
|
+
children
|
|
421
|
+
} = props;
|
|
422
|
+
const { t } = useTranslation();
|
|
423
|
+
const colors = useThemeColors();
|
|
424
|
+
const { width } = useWindowDimensions();
|
|
425
|
+
const [internalPageSize, setInternalPageSize] = useState(pageSizeProp);
|
|
426
|
+
useEffect(() => {
|
|
427
|
+
setInternalPageSize(pageSizeProp);
|
|
428
|
+
}, [pageSizeProp]);
|
|
429
|
+
const effectivePageSize = pageSizeProp ?? internalPageSize;
|
|
430
|
+
const labels = useMemo(
|
|
431
|
+
() => ({
|
|
432
|
+
prev: previousLabel ?? t("pagination.previous", { defaultValue: "Previous page" }),
|
|
433
|
+
next: nextLabel ?? t("pagination.next", { defaultValue: "Next page" }),
|
|
434
|
+
first: firstLabel ?? t("pagination.first", { defaultValue: "First page" }),
|
|
435
|
+
last: lastLabel ?? t("pagination.last", { defaultValue: "Last page" }),
|
|
436
|
+
ellipsis: t("pagination.ellipsis", { defaultValue: "More pages" }),
|
|
437
|
+
currentPage: t("pagination.currentPage", { defaultValue: "Current page" }),
|
|
438
|
+
gotoPage: /* @__PURE__ */ __name((n) => t("pagination.gotoPage", { page: n, defaultValue: `Go to page ${n}` }), "gotoPage"),
|
|
439
|
+
rangeFmt: /* @__PURE__ */ __name((from, to, total) => t("pagination.range", {
|
|
440
|
+
from,
|
|
441
|
+
to,
|
|
442
|
+
total,
|
|
443
|
+
defaultValue: `Showing ${from}\u2013${to} of ${total}`
|
|
444
|
+
}), "rangeFmt"),
|
|
445
|
+
pageOfFmt: /* @__PURE__ */ __name((p, total) => t("pagination.pageOf", { page: p, total, defaultValue: `Page ${p} of ${total}` }), "pageOfFmt"),
|
|
446
|
+
pageSize: t("pagination.pageSizeLabel", { defaultValue: "Items per page" }),
|
|
447
|
+
jumperLabel: t("pagination.jumperLabel", { defaultValue: "Go to page" }),
|
|
448
|
+
jumperPlaceholder: t("pagination.jumperPlaceholder", { defaultValue: "#" })
|
|
449
|
+
}),
|
|
450
|
+
[t, previousLabel, nextLabel, firstLabel, lastLabel]
|
|
451
|
+
);
|
|
452
|
+
const [announcement, setAnnouncement] = useState("");
|
|
453
|
+
const announceTimer = useRef(null);
|
|
454
|
+
useEffect(() => {
|
|
455
|
+
return () => {
|
|
456
|
+
if (announceTimer.current) {
|
|
457
|
+
clearTimeout(announceTimer.current);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
}, []);
|
|
461
|
+
const handlePageChange = useCallback(
|
|
462
|
+
(next) => {
|
|
463
|
+
onPageChange?.(next, effectivePageSize !== void 0 ? { pageSize: effectivePageSize } : void 0);
|
|
464
|
+
if (announceTimer.current) {
|
|
465
|
+
clearTimeout(announceTimer.current);
|
|
466
|
+
}
|
|
467
|
+
announceTimer.current = setTimeout(() => {
|
|
468
|
+
setAnnouncement(labels.pageOfFmt(next, Math.max(1, pageCount)));
|
|
469
|
+
}, ANNOUNCE_DEBOUNCE_MS);
|
|
470
|
+
},
|
|
471
|
+
[onPageChange, effectivePageSize, labels, pageCount]
|
|
472
|
+
);
|
|
473
|
+
const setPageSize = useCallback(
|
|
474
|
+
(next) => {
|
|
475
|
+
if (pageSizeProp === void 0) {
|
|
476
|
+
setInternalPageSize(next);
|
|
477
|
+
}
|
|
478
|
+
onPageChange?.(1, { pageSize: next });
|
|
479
|
+
},
|
|
480
|
+
[onPageChange, pageSizeProp]
|
|
481
|
+
);
|
|
482
|
+
const pagination = usePagination({
|
|
483
|
+
...controlledPage !== void 0 ? { page: controlledPage } : {},
|
|
484
|
+
defaultPage,
|
|
485
|
+
pageCount,
|
|
486
|
+
siblingCount,
|
|
487
|
+
boundaryCount,
|
|
488
|
+
showFirstLast,
|
|
489
|
+
onPageChange: handlePageChange
|
|
490
|
+
});
|
|
491
|
+
if (hideOnSinglePage && Math.max(1, pageCount) <= 1) {
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
|
+
const ctxValue = {
|
|
495
|
+
page: pagination.page,
|
|
496
|
+
pageCount: Math.max(1, pageCount),
|
|
497
|
+
pageSize: effectivePageSize,
|
|
498
|
+
itemCount,
|
|
499
|
+
siblingCount,
|
|
500
|
+
boundaryCount,
|
|
501
|
+
showFirstLast,
|
|
502
|
+
dir,
|
|
503
|
+
labels,
|
|
504
|
+
...renderItem ? { renderItem } : {},
|
|
505
|
+
goToPage: pagination.goToPage,
|
|
506
|
+
setPageSize
|
|
507
|
+
};
|
|
508
|
+
if (children !== void 0) {
|
|
509
|
+
return /* @__PURE__ */ jsxs(PaginationContext.Provider, { value: ctxValue, children: [
|
|
510
|
+
/* @__PURE__ */ jsx(
|
|
511
|
+
View,
|
|
512
|
+
{
|
|
513
|
+
...testID !== void 0 ? { testID } : {},
|
|
514
|
+
role: "navigation",
|
|
515
|
+
"aria-label": ariaLabel ?? t("pagination.ariaLabel", { defaultValue: "Pagination" }),
|
|
516
|
+
accessibilityLabel: ariaLabel ?? t("pagination.ariaLabel", { defaultValue: "Pagination" }),
|
|
517
|
+
accessible: true,
|
|
518
|
+
className: cn("flex-row items-center flex-wrap", className),
|
|
519
|
+
style: {
|
|
520
|
+
flexDirection: "row",
|
|
521
|
+
alignItems: "center",
|
|
522
|
+
flexWrap: "wrap",
|
|
523
|
+
rowGap: px(colors.spacing["2"]),
|
|
524
|
+
columnGap: px(colors.spacing["1"]),
|
|
525
|
+
direction: dir
|
|
526
|
+
},
|
|
527
|
+
children
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
/* @__PURE__ */ jsx(LiveRegion, { message: announcement })
|
|
531
|
+
] });
|
|
532
|
+
}
|
|
533
|
+
const isCompact = variant === "compact" || variant === "auto" && width > 0 && width < PAGINATION_COMPACT_BREAKPOINT;
|
|
534
|
+
const onItemPress = /* @__PURE__ */ __name((item) => {
|
|
535
|
+
if (item.disabled) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
switch (item.type) {
|
|
539
|
+
case "first":
|
|
540
|
+
pagination.first();
|
|
541
|
+
return;
|
|
542
|
+
case "prev":
|
|
543
|
+
pagination.prev();
|
|
544
|
+
return;
|
|
545
|
+
case "next":
|
|
546
|
+
pagination.next();
|
|
547
|
+
return;
|
|
548
|
+
case "last":
|
|
549
|
+
pagination.last();
|
|
550
|
+
return;
|
|
551
|
+
case "page":
|
|
552
|
+
if (item.page !== void 0) {
|
|
553
|
+
pagination.goToPage(item.page);
|
|
554
|
+
}
|
|
555
|
+
return;
|
|
556
|
+
case "ellipsis":
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
}, "onItemPress");
|
|
560
|
+
const showRangeBlock = showRange && itemCount !== void 0 && effectivePageSize !== void 0;
|
|
561
|
+
return /* @__PURE__ */ jsxs(PaginationContext.Provider, { value: ctxValue, children: [
|
|
562
|
+
/* @__PURE__ */ jsxs(
|
|
563
|
+
View,
|
|
564
|
+
{
|
|
565
|
+
...testID !== void 0 ? { testID } : {},
|
|
566
|
+
role: "navigation",
|
|
567
|
+
"aria-label": ariaLabel ?? t("pagination.ariaLabel", { defaultValue: "Pagination" }),
|
|
568
|
+
accessibilityLabel: ariaLabel ?? t("pagination.ariaLabel", { defaultValue: "Pagination" }),
|
|
569
|
+
accessible: true,
|
|
570
|
+
className: cn(isCompact ? "flex-col items-stretch" : "flex-row items-center flex-wrap", className),
|
|
571
|
+
style: {
|
|
572
|
+
// Compact mode lays out as a column so the Range/PageSize
|
|
573
|
+
// block falls below the controls instead of overflowing
|
|
574
|
+
// a phone-width row. Numbered mode wraps on overflow.
|
|
575
|
+
flexDirection: isCompact ? "column" : "row",
|
|
576
|
+
alignItems: isCompact ? "stretch" : "center",
|
|
577
|
+
flexWrap: isCompact ? "nowrap" : "wrap",
|
|
578
|
+
rowGap: px(colors.spacing["2"]),
|
|
579
|
+
columnGap: px(colors.spacing["1"]),
|
|
580
|
+
direction: dir
|
|
581
|
+
},
|
|
582
|
+
children: [
|
|
583
|
+
isCompact ? /* @__PURE__ */ jsx(
|
|
584
|
+
CompactView,
|
|
585
|
+
{
|
|
586
|
+
onPrev: pagination.prev,
|
|
587
|
+
onNext: pagination.next,
|
|
588
|
+
canPrev: pagination.canPrev,
|
|
589
|
+
canNext: pagination.canNext,
|
|
590
|
+
pageLabel: labels.pageOfFmt(pagination.page, Math.max(1, pageCount))
|
|
591
|
+
}
|
|
592
|
+
) : /* @__PURE__ */ jsx(ItemsRenderer, { items: pagination.pages, onItemPress }),
|
|
593
|
+
showRangeBlock ? /* @__PURE__ */ jsx(PaginationRange, {}) : null
|
|
594
|
+
]
|
|
595
|
+
}
|
|
596
|
+
),
|
|
597
|
+
/* @__PURE__ */ jsx(LiveRegion, { message: announcement })
|
|
598
|
+
] });
|
|
599
|
+
}, "PaginationRoot");
|
|
600
|
+
var CompoundActionButton = /* @__PURE__ */ __name(({
|
|
601
|
+
actionType,
|
|
602
|
+
asChild,
|
|
603
|
+
children,
|
|
604
|
+
testID
|
|
605
|
+
}) => {
|
|
606
|
+
const ctx = usePaginationContext(`Pagination.${actionType[0].toUpperCase() + actionType.slice(1)}`);
|
|
607
|
+
const disabled = actionType === "prev" || actionType === "first" ? ctx.page <= 1 : ctx.page >= ctx.pageCount;
|
|
608
|
+
const onPress = /* @__PURE__ */ __name(() => {
|
|
609
|
+
if (disabled) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
switch (actionType) {
|
|
613
|
+
case "first":
|
|
614
|
+
ctx.goToPage(1);
|
|
615
|
+
return;
|
|
616
|
+
case "prev":
|
|
617
|
+
ctx.goToPage(ctx.page - 1);
|
|
618
|
+
return;
|
|
619
|
+
case "next":
|
|
620
|
+
ctx.goToPage(ctx.page + 1);
|
|
621
|
+
return;
|
|
622
|
+
case "last":
|
|
623
|
+
ctx.goToPage(ctx.pageCount);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
}, "onPress");
|
|
627
|
+
const ariaLabel = actionType === "prev" ? ctx.labels.prev : actionType === "next" ? ctx.labels.next : actionType === "first" ? ctx.labels.first : ctx.labels.last;
|
|
628
|
+
if (asChild) {
|
|
629
|
+
return /* @__PURE__ */ jsx(
|
|
630
|
+
Slot,
|
|
631
|
+
{
|
|
632
|
+
"aria-label": ariaLabel,
|
|
633
|
+
"aria-disabled": disabled || void 0,
|
|
634
|
+
onPress,
|
|
635
|
+
onClick: onPress,
|
|
636
|
+
children
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
const fallbackGlyph = actionType === "prev" ? "\u2039" : actionType === "next" ? "\u203A" : actionType === "first" ? "\xAB" : "\xBB";
|
|
641
|
+
return /* @__PURE__ */ jsx(
|
|
642
|
+
ItemButton,
|
|
643
|
+
{
|
|
644
|
+
type: actionType,
|
|
645
|
+
selected: false,
|
|
646
|
+
disabled,
|
|
647
|
+
ariaLabel,
|
|
648
|
+
label: children ?? fallbackGlyph,
|
|
649
|
+
onPress,
|
|
650
|
+
...testID !== void 0 ? { testID } : {}
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
}, "CompoundActionButton");
|
|
654
|
+
var PaginationPrev = /* @__PURE__ */ __name(({ asChild, children, testID }) => CompoundActionButton({
|
|
655
|
+
actionType: "prev",
|
|
656
|
+
...asChild !== void 0 ? { asChild } : {},
|
|
657
|
+
...children !== void 0 ? { children } : {},
|
|
658
|
+
...testID !== void 0 ? { testID } : {}
|
|
659
|
+
}), "PaginationPrev");
|
|
660
|
+
var PaginationNext = /* @__PURE__ */ __name(({ asChild, children, testID }) => CompoundActionButton({
|
|
661
|
+
actionType: "next",
|
|
662
|
+
...asChild !== void 0 ? { asChild } : {},
|
|
663
|
+
...children !== void 0 ? { children } : {},
|
|
664
|
+
...testID !== void 0 ? { testID } : {}
|
|
665
|
+
}), "PaginationNext");
|
|
666
|
+
var PaginationFirst = /* @__PURE__ */ __name(({ asChild, children, testID }) => CompoundActionButton({
|
|
667
|
+
actionType: "first",
|
|
668
|
+
...asChild !== void 0 ? { asChild } : {},
|
|
669
|
+
...children !== void 0 ? { children } : {},
|
|
670
|
+
...testID !== void 0 ? { testID } : {}
|
|
671
|
+
}), "PaginationFirst");
|
|
672
|
+
var PaginationLast = /* @__PURE__ */ __name(({ asChild, children, testID }) => CompoundActionButton({
|
|
673
|
+
actionType: "last",
|
|
674
|
+
...asChild !== void 0 ? { asChild } : {},
|
|
675
|
+
...children !== void 0 ? { children } : {},
|
|
676
|
+
...testID !== void 0 ? { testID } : {}
|
|
677
|
+
}), "PaginationLast");
|
|
678
|
+
var PaginationItem = /* @__PURE__ */ __name(({
|
|
679
|
+
page,
|
|
680
|
+
asChild,
|
|
681
|
+
children,
|
|
682
|
+
testID
|
|
683
|
+
}) => {
|
|
684
|
+
const ctx = usePaginationContext("Pagination.Item");
|
|
685
|
+
const selected = page === ctx.page;
|
|
686
|
+
const onPress = /* @__PURE__ */ __name(() => ctx.goToPage(page), "onPress");
|
|
687
|
+
const ariaLabel = selected ? ctx.labels.currentPage : ctx.labels.gotoPage(page);
|
|
688
|
+
if (asChild) {
|
|
689
|
+
return /* @__PURE__ */ jsx(
|
|
690
|
+
Slot,
|
|
691
|
+
{
|
|
692
|
+
"aria-label": ariaLabel,
|
|
693
|
+
...selected ? { "aria-current": "page" } : {},
|
|
694
|
+
onPress,
|
|
695
|
+
onClick: onPress,
|
|
696
|
+
children
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
}
|
|
700
|
+
return /* @__PURE__ */ jsx(
|
|
701
|
+
ItemButton,
|
|
702
|
+
{
|
|
703
|
+
type: "page",
|
|
704
|
+
page,
|
|
705
|
+
selected,
|
|
706
|
+
disabled: false,
|
|
707
|
+
ariaLabel,
|
|
708
|
+
...selected ? { ariaCurrent: "page" } : {},
|
|
709
|
+
label: children ?? String(page),
|
|
710
|
+
onPress,
|
|
711
|
+
...testID !== void 0 ? { testID } : {}
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
}, "PaginationItem");
|
|
715
|
+
var PaginationItems = /* @__PURE__ */ __name(({ children }) => {
|
|
716
|
+
const ctx = usePaginationContext("Pagination.Items");
|
|
717
|
+
const result = usePagination({
|
|
718
|
+
page: ctx.page,
|
|
719
|
+
pageCount: ctx.pageCount,
|
|
720
|
+
siblingCount: ctx.siblingCount,
|
|
721
|
+
boundaryCount: ctx.boundaryCount,
|
|
722
|
+
showFirstLast: false,
|
|
723
|
+
showPrevNext: false
|
|
724
|
+
});
|
|
725
|
+
if (children !== void 0) {
|
|
726
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
727
|
+
}
|
|
728
|
+
return /* @__PURE__ */ jsx(
|
|
729
|
+
ItemsRenderer,
|
|
730
|
+
{
|
|
731
|
+
items: result.pages,
|
|
732
|
+
onItemPress: (item) => {
|
|
733
|
+
if (item.type === "page" && item.page !== void 0) {
|
|
734
|
+
ctx.goToPage(item.page);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
);
|
|
739
|
+
}, "PaginationItems");
|
|
740
|
+
var PaginationEllipsis = /* @__PURE__ */ __name(({ children }) => {
|
|
741
|
+
const ctx = usePaginationContext("Pagination.Ellipsis");
|
|
742
|
+
return /* @__PURE__ */ jsx(
|
|
743
|
+
ItemButton,
|
|
744
|
+
{
|
|
745
|
+
type: "ellipsis",
|
|
746
|
+
selected: false,
|
|
747
|
+
disabled: true,
|
|
748
|
+
label: children ?? "\u2026",
|
|
749
|
+
ariaLabel: ctx.labels.ellipsis,
|
|
750
|
+
onPress: () => {
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
}, "PaginationEllipsis");
|
|
755
|
+
var PaginationRange = /* @__PURE__ */ __name(() => {
|
|
756
|
+
const ctx = usePaginationContext("Pagination.Range");
|
|
757
|
+
const colors = useThemeColors();
|
|
758
|
+
if (ctx.itemCount === void 0 || ctx.pageSize === void 0) {
|
|
759
|
+
if (process.env.NODE_ENV !== "production") {
|
|
760
|
+
console.warn("<Pagination.Range> requires both `itemCount` and `pageSize` on <Pagination>.");
|
|
761
|
+
}
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
const from = (ctx.page - 1) * ctx.pageSize + 1;
|
|
765
|
+
const to = Math.min(ctx.itemCount, ctx.page * ctx.pageSize);
|
|
766
|
+
const message = ctx.labels.rangeFmt(from, to, ctx.itemCount);
|
|
767
|
+
return /* @__PURE__ */ jsx(
|
|
768
|
+
Text,
|
|
769
|
+
{
|
|
770
|
+
role: "status",
|
|
771
|
+
"aria-live": "polite",
|
|
772
|
+
style: {
|
|
773
|
+
fontFamily: colors.fontFamily.body,
|
|
774
|
+
fontSize: px(colors.fontSize.sm),
|
|
775
|
+
color: colors.semantic.text.muted,
|
|
776
|
+
fontVariant: ["tabular-nums"],
|
|
777
|
+
paddingHorizontal: px(colors.spacing["2"]),
|
|
778
|
+
// Sits on the same baseline as the 32px buttons.
|
|
779
|
+
lineHeight: px(colors.spacing["8"])
|
|
780
|
+
},
|
|
781
|
+
children: message
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
}, "PaginationRange");
|
|
785
|
+
var PaginationPageSize = /* @__PURE__ */ __name(({ options, testID }) => {
|
|
786
|
+
const ctx = usePaginationContext("Pagination.PageSize");
|
|
787
|
+
const colors = useThemeColors();
|
|
788
|
+
const value = ctx.pageSize !== void 0 ? String(ctx.pageSize) : "";
|
|
789
|
+
const selectOptions = useMemo(
|
|
790
|
+
() => options.map((n) => ({ value: String(n), label: String(n) })),
|
|
791
|
+
[options]
|
|
792
|
+
);
|
|
793
|
+
return /* @__PURE__ */ jsxs(
|
|
794
|
+
View,
|
|
795
|
+
{
|
|
796
|
+
style: {
|
|
797
|
+
flexDirection: "row",
|
|
798
|
+
alignItems: "center",
|
|
799
|
+
gap: px(colors.spacing["2"])
|
|
800
|
+
},
|
|
801
|
+
children: [
|
|
802
|
+
/* @__PURE__ */ jsx(
|
|
803
|
+
Text,
|
|
804
|
+
{
|
|
805
|
+
style: {
|
|
806
|
+
fontFamily: colors.fontFamily.body,
|
|
807
|
+
fontSize: px(colors.fontSize.sm),
|
|
808
|
+
color: colors.semantic.text.muted
|
|
809
|
+
},
|
|
810
|
+
children: ctx.labels.pageSize
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
/* @__PURE__ */ jsx(
|
|
814
|
+
Select,
|
|
815
|
+
{
|
|
816
|
+
...testID !== void 0 ? { testID } : {},
|
|
817
|
+
"aria-label": ctx.labels.pageSize,
|
|
818
|
+
options: selectOptions,
|
|
819
|
+
value,
|
|
820
|
+
onChange: (v) => {
|
|
821
|
+
const n = Number(v);
|
|
822
|
+
if (Number.isFinite(n) && n > 0) {
|
|
823
|
+
ctx.setPageSize(n);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
)
|
|
828
|
+
]
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
}, "PaginationPageSize");
|
|
832
|
+
var PaginationJumper = /* @__PURE__ */ __name(({
|
|
833
|
+
showLabel = false,
|
|
834
|
+
label,
|
|
835
|
+
placeholder,
|
|
836
|
+
inputWidth = 56,
|
|
837
|
+
testID
|
|
838
|
+
}) => {
|
|
839
|
+
const ctx = usePaginationContext("Pagination.Jumper");
|
|
840
|
+
const colors = useThemeColors();
|
|
841
|
+
const [draft, setDraft] = useState("");
|
|
842
|
+
const [focused, setFocused] = useState(false);
|
|
843
|
+
const [hovered, setHovered] = useState(false);
|
|
844
|
+
const visibleLabel = label ?? ctx.labels.jumperLabel;
|
|
845
|
+
const placeholderText = placeholder ?? ctx.labels.jumperPlaceholder;
|
|
846
|
+
const submit = /* @__PURE__ */ __name(() => {
|
|
847
|
+
const trimmed = draft.trim();
|
|
848
|
+
if (trimmed === "") {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const n = Number(trimmed);
|
|
852
|
+
if (!Number.isFinite(n) || n < 1) {
|
|
853
|
+
setDraft("");
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
const clamped = Math.min(Math.max(1, Math.floor(n)), ctx.pageCount);
|
|
857
|
+
ctx.goToPage(clamped);
|
|
858
|
+
setDraft("");
|
|
859
|
+
}, "submit");
|
|
860
|
+
const borderColor = focused ? colors.semantic.interactive.primary : hovered ? colors.semantic.border.strong : colors.semantic.border.default;
|
|
861
|
+
return /* @__PURE__ */ jsxs(
|
|
862
|
+
View,
|
|
863
|
+
{
|
|
864
|
+
style: {
|
|
865
|
+
flexDirection: "row",
|
|
866
|
+
alignItems: "center",
|
|
867
|
+
gap: px(colors.spacing["2"])
|
|
868
|
+
},
|
|
869
|
+
children: [
|
|
870
|
+
showLabel ? /* @__PURE__ */ jsx(
|
|
871
|
+
Text,
|
|
872
|
+
{
|
|
873
|
+
style: {
|
|
874
|
+
fontFamily: colors.fontFamily.body,
|
|
875
|
+
fontSize: px(colors.fontSize.sm),
|
|
876
|
+
color: colors.semantic.text.muted
|
|
877
|
+
},
|
|
878
|
+
children: visibleLabel
|
|
879
|
+
}
|
|
880
|
+
) : null,
|
|
881
|
+
/* @__PURE__ */ jsx(
|
|
882
|
+
View,
|
|
883
|
+
{
|
|
884
|
+
onPointerEnter: Platform.OS === "web" ? () => setHovered(true) : void 0,
|
|
885
|
+
onPointerLeave: Platform.OS === "web" ? () => setHovered(false) : void 0,
|
|
886
|
+
style: {
|
|
887
|
+
width: inputWidth,
|
|
888
|
+
height: px(colors.spacing["8"]),
|
|
889
|
+
borderWidth: 1,
|
|
890
|
+
borderColor,
|
|
891
|
+
borderRadius: px(colors.radius.md),
|
|
892
|
+
backgroundColor: colors.semantic.background.elevated,
|
|
893
|
+
paddingHorizontal: px(colors.spacing["2"]),
|
|
894
|
+
justifyContent: "center",
|
|
895
|
+
// Web-only properties (silently dropped on native).
|
|
896
|
+
...focused ? {
|
|
897
|
+
boxShadow: `0 0 0 3px ${withAlpha(colors.semantic.interactive.primary, 0.15)}`
|
|
898
|
+
} : null,
|
|
899
|
+
transitionProperty: "border-color, box-shadow",
|
|
900
|
+
transitionDuration: "120ms",
|
|
901
|
+
transitionTimingFunction: "cubic-bezier(0.2, 0, 0, 1)"
|
|
902
|
+
},
|
|
903
|
+
children: /* @__PURE__ */ jsx(
|
|
904
|
+
TextInput,
|
|
905
|
+
{
|
|
906
|
+
...testID !== void 0 ? { testID } : {},
|
|
907
|
+
value: draft,
|
|
908
|
+
onChangeText: setDraft,
|
|
909
|
+
onSubmitEditing: submit,
|
|
910
|
+
onBlur: () => {
|
|
911
|
+
setFocused(false);
|
|
912
|
+
submit();
|
|
913
|
+
},
|
|
914
|
+
onFocus: () => setFocused(true),
|
|
915
|
+
keyboardType: "number-pad",
|
|
916
|
+
inputMode: "numeric",
|
|
917
|
+
placeholder: placeholderText,
|
|
918
|
+
placeholderTextColor: colors.semantic.text.muted,
|
|
919
|
+
"aria-label": visibleLabel,
|
|
920
|
+
accessibilityLabel: visibleLabel,
|
|
921
|
+
returnKeyType: "go",
|
|
922
|
+
selectTextOnFocus: true,
|
|
923
|
+
style: {
|
|
924
|
+
fontFamily: colors.fontFamily.body,
|
|
925
|
+
fontSize: px(colors.fontSize.sm),
|
|
926
|
+
color: colors.semantic.text.default,
|
|
927
|
+
fontVariant: ["tabular-nums"],
|
|
928
|
+
textAlign: "center",
|
|
929
|
+
// Strip the browser's default outline — we draw our own
|
|
930
|
+
// focus ring on the wrapper.
|
|
931
|
+
...Platform.OS === "web" ? { outline: "none" } : null
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
)
|
|
935
|
+
}
|
|
936
|
+
)
|
|
937
|
+
]
|
|
938
|
+
}
|
|
939
|
+
);
|
|
940
|
+
}, "PaginationJumper");
|
|
941
|
+
function withAlpha(color, alpha) {
|
|
942
|
+
if (color.startsWith("#") && (color.length === 7 || color.length === 4)) {
|
|
943
|
+
const expanded = color.length === 4 ? `#${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}` : color;
|
|
944
|
+
const r = Number.parseInt(expanded.slice(1, 3), 16);
|
|
945
|
+
const g = Number.parseInt(expanded.slice(3, 5), 16);
|
|
946
|
+
const b = Number.parseInt(expanded.slice(5, 7), 16);
|
|
947
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
948
|
+
}
|
|
949
|
+
return color;
|
|
950
|
+
}
|
|
951
|
+
__name(withAlpha, "withAlpha");
|
|
952
|
+
var Pagination = Object.assign(PaginationRoot, {
|
|
953
|
+
Items: PaginationItems,
|
|
954
|
+
Item: PaginationItem,
|
|
955
|
+
Prev: PaginationPrev,
|
|
956
|
+
Next: PaginationNext,
|
|
957
|
+
First: PaginationFirst,
|
|
958
|
+
Last: PaginationLast,
|
|
959
|
+
Ellipsis: PaginationEllipsis,
|
|
960
|
+
Range: PaginationRange,
|
|
961
|
+
PageSize: PaginationPageSize,
|
|
962
|
+
Jumper: PaginationJumper
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
export { PAGINATION_COMPACT_BREAKPOINT, Pagination, usePagination };
|
|
966
|
+
//# sourceMappingURL=chunk-7GPDNQSX.js.map
|
|
967
|
+
//# sourceMappingURL=chunk-7GPDNQSX.js.map
|