@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,77 @@
|
|
|
1
|
+
import { __name } from './chunk-WCQVDF3K.js';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { Easing, useSharedValue, withTiming, useAnimatedStyle } from 'react-native-reanimated';
|
|
5
|
+
|
|
6
|
+
var IS_WEB = Platform.OS === "web";
|
|
7
|
+
function useAnimatedNumber(property, target, options = {}) {
|
|
8
|
+
const { duration = 180 } = options;
|
|
9
|
+
if (IS_WEB) {
|
|
10
|
+
return webStyle(property, target, duration);
|
|
11
|
+
}
|
|
12
|
+
return useReanimatedTiming(property, target, duration);
|
|
13
|
+
}
|
|
14
|
+
__name(useAnimatedNumber, "useAnimatedNumber");
|
|
15
|
+
function webStyle(property, target, duration) {
|
|
16
|
+
if (property === "translateX" || property === "translateY") {
|
|
17
|
+
return {
|
|
18
|
+
transform: [{ [property]: target }],
|
|
19
|
+
transitionProperty: "transform",
|
|
20
|
+
transitionDuration: `${duration}ms`,
|
|
21
|
+
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
[property]: target,
|
|
26
|
+
transitionProperty: property,
|
|
27
|
+
transitionDuration: `${duration}ms`,
|
|
28
|
+
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
__name(webStyle, "webStyle");
|
|
32
|
+
function useReanimatedTiming(property, target, duration) {
|
|
33
|
+
const easing = Easing.bezier(0.16, 1, 0.3, 1);
|
|
34
|
+
const shared = useSharedValue(target);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
shared.value = withTiming(target, { duration, easing });
|
|
37
|
+
}, [target, shared, duration, easing]);
|
|
38
|
+
const translateXStyle = useAnimatedStyle(() => ({
|
|
39
|
+
transform: [{ translateX: shared.value }]
|
|
40
|
+
}));
|
|
41
|
+
const translateYStyle = useAnimatedStyle(() => ({
|
|
42
|
+
transform: [{ translateY: shared.value }]
|
|
43
|
+
}));
|
|
44
|
+
const leftStyle = useAnimatedStyle(() => ({ left: shared.value }));
|
|
45
|
+
const topStyle = useAnimatedStyle(() => ({ top: shared.value }));
|
|
46
|
+
const rightStyle = useAnimatedStyle(() => ({ right: shared.value }));
|
|
47
|
+
const bottomStyle = useAnimatedStyle(() => ({ bottom: shared.value }));
|
|
48
|
+
const opacityStyle = useAnimatedStyle(() => ({ opacity: shared.value }));
|
|
49
|
+
const heightStyle = useAnimatedStyle(() => ({ height: shared.value }));
|
|
50
|
+
if (property === "translateX") {
|
|
51
|
+
return translateXStyle;
|
|
52
|
+
}
|
|
53
|
+
if (property === "translateY") {
|
|
54
|
+
return translateYStyle;
|
|
55
|
+
}
|
|
56
|
+
if (property === "left") {
|
|
57
|
+
return leftStyle;
|
|
58
|
+
}
|
|
59
|
+
if (property === "top") {
|
|
60
|
+
return topStyle;
|
|
61
|
+
}
|
|
62
|
+
if (property === "right") {
|
|
63
|
+
return rightStyle;
|
|
64
|
+
}
|
|
65
|
+
if (property === "bottom") {
|
|
66
|
+
return bottomStyle;
|
|
67
|
+
}
|
|
68
|
+
if (property === "opacity") {
|
|
69
|
+
return opacityStyle;
|
|
70
|
+
}
|
|
71
|
+
return heightStyle;
|
|
72
|
+
}
|
|
73
|
+
__name(useReanimatedTiming, "useReanimatedTiming");
|
|
74
|
+
|
|
75
|
+
export { useAnimatedNumber };
|
|
76
|
+
//# sourceMappingURL=chunk-RB3YBWQ4.js.map
|
|
77
|
+
//# sourceMappingURL=chunk-RB3YBWQ4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animation/use-animated-number.ts"],"names":[],"mappings":";;;;;AAqBA,IAAM,MAAA,GAAS,SAAS,EAAA,KAAO,KAAA;AAExB,SAAS,iBAAA,CACZ,QAAA,EACA,MAAA,EACA,OAAA,GAAiC,EAAC,EAC5B;AACN,EAAA,MAAM,EAAE,QAAA,GAAW,GAAA,EAAI,GAAI,OAAA;AAC3B,EAAA,IAAI,MAAA,EAAQ;AACR,IAAA,OAAO,QAAA,CAAS,QAAA,EAAU,MAAA,EAAQ,QAAQ,CAAA;AAAA,EAC9C;AAEA,EAAA,OAAO,mBAAA,CAAoB,QAAA,EAAU,MAAA,EAAQ,QAAQ,CAAA;AACzD;AAXgB,MAAA,CAAA,iBAAA,EAAA,mBAAA,CAAA;AAahB,SAAS,QAAA,CAAS,QAAA,EAA4B,MAAA,EAAgB,QAAA,EAA0B;AACpF,EAAA,IAAI,QAAA,KAAa,YAAA,IAAgB,QAAA,KAAa,YAAA,EAAc;AACxD,IAAA,OAAO;AAAA,MACH,WAAW,CAAC,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAAA,MAClC,kBAAA,EAAoB,WAAA;AAAA,MACpB,kBAAA,EAAoB,GAAG,QAAQ,CAAA,EAAA,CAAA;AAAA,MAC/B,wBAAA,EAA0B;AAAA,KAC9B;AAAA,EACJ;AACA,EAAA,OAAO;AAAA,IACH,CAAC,QAAQ,GAAG,MAAA;AAAA,IACZ,kBAAA,EAAoB,QAAA;AAAA,IACpB,kBAAA,EAAoB,GAAG,QAAQ,CAAA,EAAA,CAAA;AAAA,IAC/B,wBAAA,EAA0B;AAAA,GAC9B;AACJ;AAfS,MAAA,CAAA,QAAA,EAAA,UAAA,CAAA;AA4BT,SAAS,mBAAA,CAAoB,QAAA,EAA4B,MAAA,EAAgB,QAAA,EAA0B;AAC/F,EAAA,MAAM,SAAS,MAAA,CAAO,MAAA,CAAO,IAAA,EAAM,CAAA,EAAG,KAAK,CAAC,CAAA;AAE5C,EAAA,MAAM,MAAA,GAAS,eAAe,MAAM,CAAA;AAEpC,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,MAAA,CAAO,QAAQ,UAAA,CAAW,MAAA,EAAQ,EAAE,QAAA,EAAU,QAAQ,CAAA;AAAA,EAC1D,GAAG,CAAC,MAAA,EAAQ,MAAA,EAAQ,QAAA,EAAU,MAAM,CAAC,CAAA;AAErC,EAAA,MAAM,eAAA,GAAkB,iBAAiB,OAAO;AAAA,IAC5C,WAAW,CAAC,EAAE,UAAA,EAAY,MAAA,CAAO,OAAO;AAAA,GAC5C,CAAE,CAAA;AAEF,EAAA,MAAM,eAAA,GAAkB,iBAAiB,OAAO;AAAA,IAC5C,WAAW,CAAC,EAAE,UAAA,EAAY,MAAA,CAAO,OAAO;AAAA,GAC5C,CAAE,CAAA;AAEF,EAAA,MAAM,YAAY,gBAAA,CAAiB,OAAO,EAAE,IAAA,EAAM,MAAA,CAAO,OAAM,CAAE,CAAA;AAEjE,EAAA,MAAM,WAAW,gBAAA,CAAiB,OAAO,EAAE,GAAA,EAAK,MAAA,CAAO,OAAM,CAAE,CAAA;AAE/D,EAAA,MAAM,aAAa,gBAAA,CAAiB,OAAO,EAAE,KAAA,EAAO,MAAA,CAAO,OAAM,CAAE,CAAA;AAEnE,EAAA,MAAM,cAAc,gBAAA,CAAiB,OAAO,EAAE,MAAA,EAAQ,MAAA,CAAO,OAAM,CAAE,CAAA;AAErE,EAAA,MAAM,eAAe,gBAAA,CAAiB,OAAO,EAAE,OAAA,EAAS,MAAA,CAAO,OAAM,CAAE,CAAA;AAEvE,EAAA,MAAM,cAAc,gBAAA,CAAiB,OAAO,EAAE,MAAA,EAAQ,MAAA,CAAO,OAAM,CAAE,CAAA;AACrE,EAAA,IAAI,aAAa,YAAA,EAAc;AAC3B,IAAA,OAAO,eAAA;AAAA,EACX;AACA,EAAA,IAAI,aAAa,YAAA,EAAc;AAC3B,IAAA,OAAO,eAAA;AAAA,EACX;AACA,EAAA,IAAI,aAAa,MAAA,EAAQ;AACrB,IAAA,OAAO,SAAA;AAAA,EACX;AACA,EAAA,IAAI,aAAa,KAAA,EAAO;AACpB,IAAA,OAAO,QAAA;AAAA,EACX;AACA,EAAA,IAAI,aAAa,OAAA,EAAS;AACtB,IAAA,OAAO,UAAA;AAAA,EACX;AACA,EAAA,IAAI,aAAa,QAAA,EAAU;AACvB,IAAA,OAAO,WAAA;AAAA,EACX;AACA,EAAA,IAAI,aAAa,SAAA,EAAW;AACxB,IAAA,OAAO,YAAA;AAAA,EACX;AACA,EAAA,OAAO,WAAA;AACX;AAlDS,MAAA,CAAA,mBAAA,EAAA,qBAAA,CAAA","file":"chunk-RB3YBWQ4.js","sourcesContent":["'use client';\n\n// Native build (Metro picks this `.ts` over the `.web.ts` sibling\n// when present — for monorepo workspaces and any consumer that pre-\n// orders `.native.ts` / `.ts` / `.web.ts` resolution properly). Web\n// consumers (Next.js etc.) that don't honor the extension split\n// should alias `react-native-reanimated` to a noop in their bundler\n// config — the IS_WEB early-return below means we never call\n// reanimated APIs on web, so a stub satisfies the import.\n\nimport { useEffect } from 'react';\nimport { Platform } from 'react-native';\nimport { Easing, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nexport type AnimatedProperty = 'left' | 'top' | 'right' | 'bottom' | 'translateX' | 'translateY' | 'opacity' | 'height';\n\nexport type AnimatedNumberOptions = {\n /** Animation duration in ms. @defaultValue 180 */\n duration?: number;\n};\n\nconst IS_WEB = Platform.OS === 'web';\n\nexport function useAnimatedNumber(\n property: AnimatedProperty,\n target: number,\n options: AnimatedNumberOptions = {}\n): object {\n const { duration = 180 } = options;\n if (IS_WEB) {\n return webStyle(property, target, duration);\n }\n // biome-ignore lint/correctness/useHookAtTopLevel: IS_WEB is module-init constant; same path every render\n return useReanimatedTiming(property, target, duration);\n}\n\nfunction webStyle(property: AnimatedProperty, target: number, duration: number): object {\n if (property === 'translateX' || property === 'translateY') {\n return {\n transform: [{ [property]: target }],\n transitionProperty: 'transform',\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n };\n }\n return {\n [property]: target,\n transitionProperty: property,\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n };\n}\n\n// `opacity` and `height` aren't transforms or position props but follow\n// the exact same animated-shared-value pattern. Adding them here keeps\n// the cross-platform API consistent — Accordion content fades + slides\n// open with the same easing as a Switch thumb.\n\n// Reanimated worklets can't reliably serialize closures over computed\n// keys (`{ [property]: value }`). Static-key paths per property work\n// fine. Six tiny worklets — one per AnimatedProperty — give the plugin\n// the static AST it expects without losing the cross-platform API.\n// The bezier curve mirrors the web CSS transition exactly so a Switch\n// thumb feels identical on both platforms.\nfunction useReanimatedTiming(property: AnimatedProperty, target: number, duration: number): object {\n const easing = Easing.bezier(0.16, 1, 0.3, 1);\n // biome-ignore lint/correctness/useHookAtTopLevel: dispatcher branch is module-init constant; this function only runs when IS_WEB is false\n const shared = useSharedValue(target);\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n useEffect(() => {\n shared.value = withTiming(target, { duration, easing });\n }, [target, shared, duration, easing]);\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const translateXStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: shared.value }],\n }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const translateYStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: shared.value }],\n }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const leftStyle = useAnimatedStyle(() => ({ left: shared.value }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const topStyle = useAnimatedStyle(() => ({ top: shared.value }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const rightStyle = useAnimatedStyle(() => ({ right: shared.value }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const bottomStyle = useAnimatedStyle(() => ({ bottom: shared.value }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const opacityStyle = useAnimatedStyle(() => ({ opacity: shared.value }));\n // biome-ignore lint/correctness/useHookAtTopLevel: same\n const heightStyle = useAnimatedStyle(() => ({ height: shared.value }));\n if (property === 'translateX') {\n return translateXStyle;\n }\n if (property === 'translateY') {\n return translateYStyle;\n }\n if (property === 'left') {\n return leftStyle;\n }\n if (property === 'top') {\n return topStyle;\n }\n if (property === 'right') {\n return rightStyle;\n }\n if (property === 'bottom') {\n return bottomStyle;\n }\n if (property === 'opacity') {\n return opacityStyle;\n }\n return heightStyle;\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolveI18n, defaultDictionary } from './chunk-FT2XBBQJ.js';
|
|
2
|
+
import { __name } from './chunk-WCQVDF3K.js';
|
|
3
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
4
|
+
import { jsx } from 'nativewind/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var defaultValue = {
|
|
7
|
+
t: resolveI18n(void 0, defaultDictionary)
|
|
8
|
+
};
|
|
9
|
+
var I18nContext = createContext(defaultValue);
|
|
10
|
+
I18nContext.displayName = "I18nContext";
|
|
11
|
+
function I18nProvider({ i18n, children }) {
|
|
12
|
+
const value = useMemo(() => ({ t: resolveI18n(i18n, defaultDictionary) }), [i18n]);
|
|
13
|
+
return /* @__PURE__ */ jsx(I18nContext.Provider, { value, children });
|
|
14
|
+
}
|
|
15
|
+
__name(I18nProvider, "I18nProvider");
|
|
16
|
+
function useTranslation() {
|
|
17
|
+
return useContext(I18nContext);
|
|
18
|
+
}
|
|
19
|
+
__name(useTranslation, "useTranslation");
|
|
20
|
+
|
|
21
|
+
export { I18nProvider, useTranslation };
|
|
22
|
+
//# sourceMappingURL=chunk-RFW5SRZA.js.map
|
|
23
|
+
//# sourceMappingURL=chunk-RFW5SRZA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/context.tsx","../src/i18n/use-translation.ts"],"names":[],"mappings":";;;;;AAcA,IAAM,YAAA,GAAiC;AAAA,EACnC,CAAA,EAAG,WAAA,CAAY,MAAA,EAAW,iBAAiB;AAC/C,CAAA;AAEO,IAAM,WAAA,GAAc,cAAgC,YAAY,CAAA;AACvE,WAAA,CAAY,WAAA,GAAc,aAAA;AAOnB,SAAS,YAAA,CAAa,EAAE,IAAA,EAAM,QAAA,EAAS,EAAsB;AAChE,EAAA,MAAM,KAAA,GAAQ,OAAA,CAA0B,OAAO,EAAE,CAAA,EAAG,WAAA,CAAY,IAAA,EAAM,iBAAiB,CAAA,EAAE,CAAA,EAAI,CAAC,IAAI,CAAC,CAAA;AACnG,EAAA,uBAAO,GAAA,CAAC,WAAA,CAAY,QAAA,EAAZ,EAAqB,OAAe,QAAA,EAAS,CAAA;AACzD;AAHgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;ACrBT,SAAS,cAAA,GAAmC;AAC/C,EAAA,OAAO,WAAW,WAAW,CAAA;AACjC;AAFgB,MAAA,CAAA,cAAA,EAAA,gBAAA,CAAA","file":"chunk-RFW5SRZA.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext, useMemo } from 'react';\nimport { defaultDictionary } from './default-dictionary';\nimport { resolveI18n } from './resolve';\nimport type { I18nInput, TranslateFn } from './types';\n\nexport type I18nContextValue = {\n t: TranslateFn;\n};\n\n// Default context value uses the built-in English dictionary; consumers without\n// a provider still get a working t().\nconst defaultValue: I18nContextValue = {\n t: resolveI18n(undefined, defaultDictionary),\n};\n\nexport const I18nContext = createContext<I18nContextValue>(defaultValue);\nI18nContext.displayName = 'I18nContext';\n\nexport type I18nProviderProps = {\n i18n?: I18nInput;\n children?: ReactNode;\n};\n\nexport function I18nProvider({ i18n, children }: I18nProviderProps) {\n const value = useMemo<I18nContextValue>(() => ({ t: resolveI18n(i18n, defaultDictionary) }), [i18n]);\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n","'use client';\n\nimport { useContext } from 'react';\nimport { I18nContext, type I18nContextValue } from './context';\n\nexport function useTranslation(): I18nContextValue {\n return useContext(I18nContext);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animation/animated-view.ts"],"names":[],"mappings":";;;AAOO,IAAM,eAAe,QAAA,CAAS","file":"chunk-RGJ3NBKE.js","sourcesContent":["'use client';\n\n// Native build: reanimated's `Animated.View` consumes the worklet\n// styles produced by `useAnimatedStyle`. A regular `View` would\n// render the shared values' default frame and never animate.\nimport Animated from 'react-native-reanimated';\n\nexport const AnimatedView = Animated.View;\n"]}
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { BlurBackdrop } from './chunk-KWRDJPP3.js';
|
|
2
|
+
import { Slot } from './chunk-ZIBNLXIV.js';
|
|
3
|
+
import { px } from './chunk-5A2QOOVN.js';
|
|
4
|
+
import { cn } from './chunk-CHXHRJNZ.js';
|
|
5
|
+
import { useThemeColors, useColorScheme } from './chunk-R5JMDDCB.js';
|
|
6
|
+
import { __name } from './chunk-WCQVDF3K.js';
|
|
7
|
+
import { createContext, useState, useCallback, useId, useRef, isValidElement, useEffect, useContext } from 'react';
|
|
8
|
+
import { Platform, Text, Pressable, View, Modal, StyleSheet } from 'react-native';
|
|
9
|
+
import { jsx, jsxs } from 'nativewind/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var AlertDialogContext = createContext(null);
|
|
12
|
+
var useAlertDialogContext = /* @__PURE__ */ __name((label) => {
|
|
13
|
+
const ctx = useContext(AlertDialogContext);
|
|
14
|
+
if (!ctx) {
|
|
15
|
+
throw new Error(`<${label}> must be rendered inside an <AlertDialog>.`);
|
|
16
|
+
}
|
|
17
|
+
return ctx;
|
|
18
|
+
}, "useAlertDialogContext");
|
|
19
|
+
var AlertDialogRoot = /* @__PURE__ */ __name(({ open, defaultOpen = false, onOpenChange, children }) => {
|
|
20
|
+
const [inner, setInner] = useState(defaultOpen);
|
|
21
|
+
const isControlled = open !== void 0;
|
|
22
|
+
const current = isControlled ? open : inner;
|
|
23
|
+
const setOpen = useCallback(
|
|
24
|
+
(next) => {
|
|
25
|
+
if (!isControlled) {
|
|
26
|
+
setInner(next);
|
|
27
|
+
}
|
|
28
|
+
onOpenChange?.(next);
|
|
29
|
+
},
|
|
30
|
+
[isControlled, onOpenChange]
|
|
31
|
+
);
|
|
32
|
+
const baseId = useId();
|
|
33
|
+
const triggerRef = useRef(null);
|
|
34
|
+
const cancelRef = useRef(null);
|
|
35
|
+
const ctxValue = {
|
|
36
|
+
open: current,
|
|
37
|
+
setOpen,
|
|
38
|
+
titleId: `${baseId}-title`,
|
|
39
|
+
descriptionId: `${baseId}-description`,
|
|
40
|
+
triggerRef,
|
|
41
|
+
cancelRef
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsx(AlertDialogContext.Provider, { value: ctxValue, children });
|
|
44
|
+
}, "AlertDialogRoot");
|
|
45
|
+
var AlertDialogTrigger = /* @__PURE__ */ __name(({ asChild = true, children, className, testID }) => {
|
|
46
|
+
const ctx = useAlertDialogContext("AlertDialogTrigger");
|
|
47
|
+
const onPress = useCallback(() => ctx.setOpen(true), [ctx]);
|
|
48
|
+
if (asChild && isValidElement(children)) {
|
|
49
|
+
const child = children;
|
|
50
|
+
const fire = /* @__PURE__ */ __name((existing) => (event) => {
|
|
51
|
+
existing?.(event);
|
|
52
|
+
ctx.setOpen(true);
|
|
53
|
+
}, "fire");
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
Slot,
|
|
56
|
+
{
|
|
57
|
+
ref: (node) => {
|
|
58
|
+
ctx.triggerRef.current = node;
|
|
59
|
+
},
|
|
60
|
+
onClick: fire(child.props.onClick),
|
|
61
|
+
onPress: fire(child.props.onPress),
|
|
62
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
63
|
+
...className !== void 0 ? { className } : {},
|
|
64
|
+
children: child
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
Pressable,
|
|
70
|
+
{
|
|
71
|
+
ref: (node) => {
|
|
72
|
+
ctx.triggerRef.current = node;
|
|
73
|
+
},
|
|
74
|
+
onPress,
|
|
75
|
+
...testID !== void 0 ? { testID } : {},
|
|
76
|
+
...className !== void 0 ? { className } : {},
|
|
77
|
+
children: wrapStringChildren(children)
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}, "AlertDialogTrigger");
|
|
81
|
+
function wrapStringChildren(children) {
|
|
82
|
+
if (typeof children === "string" || typeof children === "number") {
|
|
83
|
+
return /* @__PURE__ */ jsx(Text, { children });
|
|
84
|
+
}
|
|
85
|
+
return children;
|
|
86
|
+
}
|
|
87
|
+
__name(wrapStringChildren, "wrapStringChildren");
|
|
88
|
+
var SCRIM_COLOR = "rgba(0, 0, 0, 0.24)";
|
|
89
|
+
var BLUR_AMOUNT = 4;
|
|
90
|
+
var OVERLAY_LAYOUT_BASE = {
|
|
91
|
+
position: Platform.OS === "web" ? "fixed" : "absolute",
|
|
92
|
+
top: 0,
|
|
93
|
+
left: 0,
|
|
94
|
+
right: 0,
|
|
95
|
+
bottom: 0,
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
justifyContent: "center",
|
|
98
|
+
// Native overlay stays transparent — the BlurBackdrop sibling renders
|
|
99
|
+
// dim + frosted-glass via expo-blur, and a SCRIM_COLOR layer on top
|
|
100
|
+
// would hide the blur. Web keeps its CSS overlay path (the imperative
|
|
101
|
+
// useEffect below sets backgroundColor + backdrop-filter on web).
|
|
102
|
+
...Platform.OS === "web" ? { zIndex: 50 } : { backgroundColor: "transparent" }
|
|
103
|
+
};
|
|
104
|
+
var CONTENT_LAYOUT_BASE = {
|
|
105
|
+
width: "100%",
|
|
106
|
+
maxWidth: 480,
|
|
107
|
+
// component-density literal — not from theme
|
|
108
|
+
...Platform.OS === "web" ? {
|
|
109
|
+
boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
|
|
110
|
+
// Subtle scale-in: 0.95 → 1 over 150ms. Honors prefers-reduced-motion
|
|
111
|
+
// via the media query below — set as a CSS variable so the keyframe
|
|
112
|
+
// can be disabled without remounting.
|
|
113
|
+
animationName: "nori-alert-dialog-in",
|
|
114
|
+
animationDuration: "150ms",
|
|
115
|
+
animationTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
116
|
+
animationFillMode: "both"
|
|
117
|
+
} : { elevation: 24 }
|
|
118
|
+
};
|
|
119
|
+
var FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), [role="button"]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])';
|
|
120
|
+
function ensureFocusable(node) {
|
|
121
|
+
if (!node) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (node.hasAttribute("tabindex")) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
node.setAttribute("tabindex", "0");
|
|
128
|
+
}
|
|
129
|
+
__name(ensureFocusable, "ensureFocusable");
|
|
130
|
+
var KEYFRAMES_STYLE_ID = "nori-alert-dialog-keyframes";
|
|
131
|
+
var KEYFRAMES_CSS = `
|
|
132
|
+
@keyframes nori-alert-dialog-in {
|
|
133
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
134
|
+
to { opacity: 1; transform: scale(1); }
|
|
135
|
+
}
|
|
136
|
+
@media (prefers-reduced-motion: reduce) {
|
|
137
|
+
[data-nori-alert-dialog-content] { animation: none !important; }
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
function ensureKeyframesInjected() {
|
|
141
|
+
if (Platform.OS !== "web") {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (typeof document === "undefined") {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (document.getElementById(KEYFRAMES_STYLE_ID)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const style = document.createElement("style");
|
|
151
|
+
style.id = KEYFRAMES_STYLE_ID;
|
|
152
|
+
style.textContent = KEYFRAMES_CSS;
|
|
153
|
+
document.head.appendChild(style);
|
|
154
|
+
}
|
|
155
|
+
__name(ensureKeyframesInjected, "ensureKeyframesInjected");
|
|
156
|
+
var AlertDialogContent = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
157
|
+
const ctx = useAlertDialogContext("AlertDialogContent");
|
|
158
|
+
const colors = useThemeColors();
|
|
159
|
+
const scheme = useColorScheme();
|
|
160
|
+
const contentRef = useRef(null);
|
|
161
|
+
const overlayDomRef = useRef(null);
|
|
162
|
+
const overlayStyle = {
|
|
163
|
+
...OVERLAY_LAYOUT_BASE,
|
|
164
|
+
padding: px(colors.spacing["4"])
|
|
165
|
+
};
|
|
166
|
+
const contentStyle = {
|
|
167
|
+
...CONTENT_LAYOUT_BASE,
|
|
168
|
+
borderRadius: px(colors.radius.xl),
|
|
169
|
+
padding: px(colors.spacing["6"]),
|
|
170
|
+
gap: px(colors.spacing["3"])
|
|
171
|
+
};
|
|
172
|
+
const [entered, setEntered] = useState(false);
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
if (Platform.OS !== "web") {
|
|
175
|
+
setEntered(true);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (!ctx.open) {
|
|
179
|
+
setEntered(false);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const id = requestAnimationFrame(() => setEntered(true));
|
|
183
|
+
return () => cancelAnimationFrame(id);
|
|
184
|
+
}, [ctx.open]);
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
if (Platform.OS !== "web") {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const node = overlayDomRef.current;
|
|
190
|
+
if (!node) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
node.style.transitionProperty = "background-color, backdrop-filter, -webkit-backdrop-filter";
|
|
194
|
+
node.style.transitionDuration = "150ms, 200ms, 200ms";
|
|
195
|
+
node.style.transitionTimingFunction = "ease-out";
|
|
196
|
+
if (entered) {
|
|
197
|
+
node.style.backgroundColor = SCRIM_COLOR;
|
|
198
|
+
node.style.backdropFilter = `blur(${BLUR_AMOUNT}px)`;
|
|
199
|
+
node.style.setProperty("-webkit-backdrop-filter", `blur(${BLUR_AMOUNT}px)`);
|
|
200
|
+
} else {
|
|
201
|
+
node.style.backgroundColor = "rgba(0, 0, 0, 0)";
|
|
202
|
+
node.style.backdropFilter = "blur(0px)";
|
|
203
|
+
node.style.setProperty("-webkit-backdrop-filter", "blur(0px)");
|
|
204
|
+
}
|
|
205
|
+
}, [entered]);
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
if (!ctx.open) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (Platform.OS !== "web") {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (typeof document === "undefined") {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
ensureKeyframesInjected();
|
|
217
|
+
const previouslyFocused = document.activeElement;
|
|
218
|
+
const prevBodyOverflow = document.body.style.overflow;
|
|
219
|
+
document.body.style.overflow = "hidden";
|
|
220
|
+
const focusInitial = /* @__PURE__ */ __name(() => {
|
|
221
|
+
const node = contentRef.current;
|
|
222
|
+
if (!node) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const focusable = node.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
226
|
+
for (const el of focusable) {
|
|
227
|
+
ensureFocusable(el);
|
|
228
|
+
}
|
|
229
|
+
const cancel = ctx.cancelRef.current;
|
|
230
|
+
if (cancel?.focus) {
|
|
231
|
+
ensureFocusable(cancel);
|
|
232
|
+
cancel.focus();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const first = focusable[0];
|
|
236
|
+
if (first) {
|
|
237
|
+
first.focus();
|
|
238
|
+
} else {
|
|
239
|
+
node.setAttribute("tabindex", "-1");
|
|
240
|
+
node.focus();
|
|
241
|
+
}
|
|
242
|
+
}, "focusInitial");
|
|
243
|
+
focusInitial();
|
|
244
|
+
const onKeyDown = /* @__PURE__ */ __name((event) => {
|
|
245
|
+
if (event.key !== "Tab") {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const node = contentRef.current;
|
|
249
|
+
if (!node) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const focusable = Array.from(node.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
253
|
+
if (focusable.length === 0) {
|
|
254
|
+
event.preventDefault();
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const first = focusable[0];
|
|
258
|
+
const last = focusable[focusable.length - 1];
|
|
259
|
+
if (!first || !last) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
for (const el of focusable) {
|
|
263
|
+
ensureFocusable(el);
|
|
264
|
+
}
|
|
265
|
+
if (event.shiftKey) {
|
|
266
|
+
if (document.activeElement === first || !node.contains(document.activeElement)) {
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
last.focus();
|
|
269
|
+
}
|
|
270
|
+
} else if (document.activeElement === last) {
|
|
271
|
+
event.preventDefault();
|
|
272
|
+
first.focus();
|
|
273
|
+
}
|
|
274
|
+
}, "onKeyDown");
|
|
275
|
+
document.addEventListener("keydown", onKeyDown);
|
|
276
|
+
return () => {
|
|
277
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
278
|
+
document.body.style.overflow = prevBodyOverflow;
|
|
279
|
+
const restoreTo = ctx.triggerRef.current ?? previouslyFocused;
|
|
280
|
+
restoreTo?.focus?.();
|
|
281
|
+
};
|
|
282
|
+
}, [ctx.open, ctx.triggerRef, ctx.cancelRef]);
|
|
283
|
+
const onRequestClose = useCallback(() => {
|
|
284
|
+
}, []);
|
|
285
|
+
return /* @__PURE__ */ jsxs(
|
|
286
|
+
Modal,
|
|
287
|
+
{
|
|
288
|
+
visible: ctx.open,
|
|
289
|
+
transparent: true,
|
|
290
|
+
animationType: Platform.OS === "web" ? "none" : "fade",
|
|
291
|
+
onRequestClose,
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ jsx(BlurBackdrop, { intensity: 60, tint: scheme === "dark" ? "dark" : "light", style: StyleSheet.absoluteFill }),
|
|
294
|
+
/* @__PURE__ */ jsx(
|
|
295
|
+
View,
|
|
296
|
+
{
|
|
297
|
+
ref: (node) => {
|
|
298
|
+
overlayDomRef.current = node;
|
|
299
|
+
},
|
|
300
|
+
accessibilityRole: "none",
|
|
301
|
+
"aria-hidden": true,
|
|
302
|
+
style: overlayStyle,
|
|
303
|
+
children: /* @__PURE__ */ jsx(
|
|
304
|
+
View,
|
|
305
|
+
{
|
|
306
|
+
ref: (node) => {
|
|
307
|
+
contentRef.current = node;
|
|
308
|
+
},
|
|
309
|
+
role: "alertdialog",
|
|
310
|
+
accessibilityRole: "alert",
|
|
311
|
+
"aria-modal": true,
|
|
312
|
+
"aria-labelledby": ctx.titleId,
|
|
313
|
+
"aria-describedby": ctx.descriptionId,
|
|
314
|
+
...testID !== void 0 ? { testID } : {},
|
|
315
|
+
...{ "data-nori-alert-dialog-content": "true" },
|
|
316
|
+
className: cn("w-full max-w-md rounded-xl bg-semantic-background-elevated p-6 gap-3", className),
|
|
317
|
+
style: [contentStyle, { backgroundColor: colors.semantic.background.elevated }],
|
|
318
|
+
children: /* @__PURE__ */ jsx(
|
|
319
|
+
View,
|
|
320
|
+
{
|
|
321
|
+
className: "flex-col gap-1.5",
|
|
322
|
+
style: { flexDirection: "column", gap: px(colors.spacing["2"]) - 2 },
|
|
323
|
+
children
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}, "AlertDialogContent");
|
|
334
|
+
var AlertDialogTitle = /* @__PURE__ */ __name(({ children, className }) => {
|
|
335
|
+
const ctx = useAlertDialogContext("AlertDialogTitle");
|
|
336
|
+
const colors = useThemeColors();
|
|
337
|
+
return /* @__PURE__ */ jsx(
|
|
338
|
+
Text,
|
|
339
|
+
{
|
|
340
|
+
nativeID: ctx.titleId,
|
|
341
|
+
id: ctx.titleId,
|
|
342
|
+
role: "heading",
|
|
343
|
+
"aria-level": 2,
|
|
344
|
+
className: cn("text-lg font-semibold text-semantic-text-default", className),
|
|
345
|
+
style: {
|
|
346
|
+
color: colors.semantic.text.default,
|
|
347
|
+
fontFamily: colors.fontFamily.display,
|
|
348
|
+
fontSize: px(colors.fontSize.lg),
|
|
349
|
+
fontWeight: colors.fontWeight.semibold
|
|
350
|
+
},
|
|
351
|
+
children
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}, "AlertDialogTitle");
|
|
355
|
+
var AlertDialogDescription = /* @__PURE__ */ __name(({ children, className }) => {
|
|
356
|
+
const ctx = useAlertDialogContext("AlertDialogDescription");
|
|
357
|
+
const colors = useThemeColors();
|
|
358
|
+
return /* @__PURE__ */ jsx(
|
|
359
|
+
Text,
|
|
360
|
+
{
|
|
361
|
+
nativeID: ctx.descriptionId,
|
|
362
|
+
id: ctx.descriptionId,
|
|
363
|
+
className: cn("text-sm text-semantic-text-muted", className),
|
|
364
|
+
style: {
|
|
365
|
+
color: colors.semantic.text.muted,
|
|
366
|
+
fontFamily: colors.fontFamily.body,
|
|
367
|
+
fontSize: px(colors.fontSize.sm),
|
|
368
|
+
lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal)
|
|
369
|
+
},
|
|
370
|
+
children
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
}, "AlertDialogDescription");
|
|
374
|
+
var AlertDialogAction = /* @__PURE__ */ __name(({ asChild = true, children, className, testID, onPress }) => {
|
|
375
|
+
const ctx = useAlertDialogContext("AlertDialogAction");
|
|
376
|
+
const handle = useCallback(
|
|
377
|
+
(event) => {
|
|
378
|
+
onPress?.(event);
|
|
379
|
+
ctx.setOpen(false);
|
|
380
|
+
},
|
|
381
|
+
[ctx, onPress]
|
|
382
|
+
);
|
|
383
|
+
if (asChild && isValidElement(children)) {
|
|
384
|
+
const child = children;
|
|
385
|
+
const fire = /* @__PURE__ */ __name((existing) => (event) => {
|
|
386
|
+
existing?.(event);
|
|
387
|
+
handle(event);
|
|
388
|
+
}, "fire");
|
|
389
|
+
return /* @__PURE__ */ jsx(
|
|
390
|
+
Slot,
|
|
391
|
+
{
|
|
392
|
+
onClick: fire(child.props.onClick),
|
|
393
|
+
onPress: fire(child.props.onPress),
|
|
394
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
395
|
+
...className !== void 0 ? { className } : {},
|
|
396
|
+
children: child
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
return /* @__PURE__ */ jsx(
|
|
401
|
+
Pressable,
|
|
402
|
+
{
|
|
403
|
+
onPress: handle,
|
|
404
|
+
role: "button",
|
|
405
|
+
accessibilityRole: "button",
|
|
406
|
+
...testID !== void 0 ? { testID } : {},
|
|
407
|
+
...className !== void 0 ? { className } : {},
|
|
408
|
+
children: wrapStringChildren(children)
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
}, "AlertDialogAction");
|
|
412
|
+
var AlertDialogCancel = /* @__PURE__ */ __name(({ asChild = true, children, className, testID, onPress }) => {
|
|
413
|
+
const ctx = useAlertDialogContext("AlertDialogCancel");
|
|
414
|
+
const handle = useCallback(
|
|
415
|
+
(event) => {
|
|
416
|
+
onPress?.(event);
|
|
417
|
+
ctx.setOpen(false);
|
|
418
|
+
},
|
|
419
|
+
[ctx, onPress]
|
|
420
|
+
);
|
|
421
|
+
if (asChild && isValidElement(children)) {
|
|
422
|
+
const child = children;
|
|
423
|
+
const fire = /* @__PURE__ */ __name((existing) => (event) => {
|
|
424
|
+
existing?.(event);
|
|
425
|
+
handle(event);
|
|
426
|
+
}, "fire");
|
|
427
|
+
return /* @__PURE__ */ jsx(
|
|
428
|
+
Slot,
|
|
429
|
+
{
|
|
430
|
+
ref: (node) => {
|
|
431
|
+
ctx.cancelRef.current = node;
|
|
432
|
+
},
|
|
433
|
+
onClick: fire(child.props.onClick),
|
|
434
|
+
onPress: fire(child.props.onPress),
|
|
435
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
436
|
+
...className !== void 0 ? { className } : {},
|
|
437
|
+
children: child
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
return /* @__PURE__ */ jsx(
|
|
442
|
+
Pressable,
|
|
443
|
+
{
|
|
444
|
+
ref: (node) => {
|
|
445
|
+
ctx.cancelRef.current = node;
|
|
446
|
+
},
|
|
447
|
+
onPress: handle,
|
|
448
|
+
role: "button",
|
|
449
|
+
accessibilityRole: "button",
|
|
450
|
+
...testID !== void 0 ? { testID } : {},
|
|
451
|
+
...className !== void 0 ? { className } : {},
|
|
452
|
+
children: wrapStringChildren(children)
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
}, "AlertDialogCancel");
|
|
456
|
+
var AlertDialogFooter = /* @__PURE__ */ __name(({ children, className }) => {
|
|
457
|
+
const colors = useThemeColors();
|
|
458
|
+
return /* @__PURE__ */ jsx(
|
|
459
|
+
View,
|
|
460
|
+
{
|
|
461
|
+
className: cn("mt-4 flex-row items-center justify-end gap-2", className),
|
|
462
|
+
style: {
|
|
463
|
+
marginTop: px(colors.spacing["4"]),
|
|
464
|
+
flexDirection: "row",
|
|
465
|
+
alignItems: "center",
|
|
466
|
+
justifyContent: "flex-end",
|
|
467
|
+
gap: px(colors.spacing["2"])
|
|
468
|
+
},
|
|
469
|
+
children
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}, "AlertDialogFooter");
|
|
473
|
+
var AlertDialog = Object.assign(AlertDialogRoot, {
|
|
474
|
+
Trigger: AlertDialogTrigger,
|
|
475
|
+
Content: AlertDialogContent,
|
|
476
|
+
Title: AlertDialogTitle,
|
|
477
|
+
Description: AlertDialogDescription,
|
|
478
|
+
Footer: AlertDialogFooter,
|
|
479
|
+
Action: AlertDialogAction,
|
|
480
|
+
Cancel: AlertDialogCancel
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
export { AlertDialog };
|
|
484
|
+
//# sourceMappingURL=chunk-SFNDR6DI.js.map
|
|
485
|
+
//# sourceMappingURL=chunk-SFNDR6DI.js.map
|