@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
package/dist/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/i18n/default-dictionary.ts","../src/i18n/resolve.ts","../src/i18n/context.tsx","../src/i18n/use-translation.ts","../src/icons/default-semantic-icons.tsx","../src/icons/semantic-context.tsx","../src/icons/use-semantic-icon.ts","../src/utils/cn.ts","../src/components/Box/Box.tsx","../../tokens/build/theme.ts","../src/slot/compose-refs.ts","../src/slot/slot.tsx","../src/components/Spinner/Spinner.tsx","../src/components/Button/Button.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/HStack/HStack.tsx","../src/components/Switch/Switch.tsx","../src/components/Text/Text.tsx","../src/components/TextInput/TextInput.tsx","../src/components/TextArea/TextArea.tsx","../src/components/VStack/VStack.tsx","../src/icons/icon.tsx","../src/theme/context.tsx","../src/provider/nori-provider.tsx","../src/theme/use-theme.ts"],"names":["createContext","useMemo","jsx","useContext","View","forwardRef","Slot","isValidElement","Children","cloneElement","ActivityI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Ac,cAAA;AAOpB,SAAS,cAAc,EAAE,KAAA,EAAAwB,MAAAA,GAAQ,KAAA,EAAc,UAAS,EAAuB;AAClF,EAAA,uBAAOtB,cAAAA,CAAC,YAAA,CAAa,UAAb,EAAsB,KAAA,EAAOsB,QAAQ,QAAA,EAAS,CAAA;AAC1D;AAFgB,MAAA,CAAA,aAAA,EAAA,eAAA,CAAA;ACQT,SAAS,aAAa,EAAE,KAAA,EAAAA,QAAO,IAAA,EAAM,KAAA,EAAO,UAAS,EAAsB;AAG9E,EAAA,MAAM,aAAaA,MAAAA,KAAU,MAAA,GAAY,EAAC,GAAI,EAAE,OAAAA,MAAAA,EAAM;AACtD,EAAA,MAAM,YAAY,IAAA,KAAS,MAAA,GAAY,EAAC,GAAI,EAAE,IAAA,EAAK;AACnD,EAAA,MAAM,aAAa,KAAA,KAAU,MAAA,GAAY,EAAC,GAAI,EAAE,KAAA,EAAM;AACtD,EAAA,uBACItB,cAAAA,CAAC,aAAA,EAAA,EAAe,GAAG,UAAA,EACf,0BAAAA,cAAAA,CAAC,YAAA,EAAA,EAAc,GAAG,SAAA,EACd,0BAAAA,cAAAA,CAAC,qBAAA,EAAA,EAAuB,GAAG,UAAA,EAAa,QAAA,EAAS,GACrD,CAAA,EACJ,CAAA;AAER;AAbgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;ACjBT,SAAS,QAAA,GAAW;AACvB,EAAA,OAAOC,iBAAW,YAAY,CAAA;AAClC;AAFgB,MAAA,CAAA,QAAA,EAAA,UAAA,CAAA","file":"client.cjs","sourcesContent":["import type { Dictionary } from './types';\n\n/**\n * Default English strings used by library components.\n *\n * Key naming convention:\n * <component>.<purpose>[_plural-form]\n *\n * Plural suffixes follow i18next: `_zero`, `_one`, `_two`, `_few`, `_many`, `_other`.\n * Interpolation uses `{{name}}` — double braces, no spaces, by convention.\n */\nexport const defaultDictionary: Dictionary = {\n // generic / shared\n 'common.cancel': 'Cancel',\n 'common.confirm': 'Confirm',\n 'common.close': 'Close',\n 'common.back': 'Back',\n 'common.loading': 'Loading',\n 'common.error': 'Something went wrong',\n 'common.retry': 'Try again',\n\n // button\n 'button.loadingLabel': 'Loading',\n\n // input\n 'input.clear': 'Clear',\n 'input.passwordShow': 'Show password',\n 'input.passwordHide': 'Hide password',\n\n // checkbox / switch\n 'checkbox.checked': 'Checked',\n 'checkbox.unchecked': 'Unchecked',\n 'switch.on': 'On',\n 'switch.off': 'Off',\n};\n","import type { Dictionary, I18nInput, I18nOptions, TranslateFn } from './types';\n\n/**\n * Normalizes the consumer's i18n input (undefined | dictionary | function) into a\n * uniform TranslateFn. Internal code only calls the returned function.\n *\n * Precedence for a given key lookup:\n * 1. consumer function (if provided) — called verbatim, no further fallback\n * 2. consumer dictionary (if provided)\n * 3. library defaults\n * 4. options.defaultValue\n * 5. the key itself (so missing strings are visible in dev, not silent)\n */\nexport function resolveI18n(input: I18nInput, defaults: Dictionary): TranslateFn {\n if (typeof input === 'function') {\n // Wrap so the consumer fn is always invoked with (key, options) — enables\n // Jest `toHaveBeenCalledWith(key, undefined)` assertions and mirrors i18next's\n // own call signature exactly.\n return (keyOrKeys, options) => input(keyOrKeys, options);\n }\n\n const dict = input ?? {};\n\n return (keyOrKeys, options) => {\n const keys = Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];\n for (const rawKey of keys) {\n const key = pluralize(rawKey, options?.count);\n const template = dict[key] ?? defaults[key];\n if (template !== undefined) {\n return interpolate(template, options);\n }\n }\n // exhausted the key list\n const lastKey = keys[keys.length - 1];\n if (options?.defaultValue !== undefined) {\n return interpolate(options.defaultValue, options);\n }\n return lastKey ?? '';\n };\n}\n\nfunction pluralize(key: string, count: number | undefined): string {\n if (count === undefined) return key;\n // Minimal English pluralization — extend with ICU rules later if needed.\n if (count === 1) return `${key}_one`;\n return `${key}_other`;\n}\n\nfunction interpolate(template: string, options: I18nOptions | undefined): string {\n if (!options) return template;\n return template.replace(/\\{\\{\\s*([A-Za-z0-9_.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const value = options[name];\n return value === undefined || value === null ? '' : String(value);\n });\n}\n","'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","// default-semantic-icons — minimal built-in SVG placeholders for internal\n// library glyphs. Consumers can swap each one via the provider:\n//\n// <NoriProvider icons={{ checkmark: MyCheck, close: MyX }}>\n//\n// These defaults exist so the library renders usable UI out of the box even when\n// lucide-react(-native) is not installed. They are NOT intended to compete with\n// Lucide on style — override them to match your design system.\n\nimport type { ComponentType } from 'react';\nimport type { IconComponentProps } from './icon';\n\ntype SemanticIcon = ComponentType<IconComponentProps>;\n\nconst make = (path: string): SemanticIcon =>\n function PlaceholderIcon({ size = 20, color = 'currentColor' }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d={path} />\n </svg>\n );\n };\n\nexport type SemanticIcons = {\n checkmark: SemanticIcon;\n close: SemanticIcon;\n eye: SemanticIcon;\n eyeOff: SemanticIcon;\n chevronDown: SemanticIcon;\n chevronUp: SemanticIcon;\n alertTriangle: SemanticIcon;\n info: SemanticIcon;\n check: SemanticIcon;\n x: SemanticIcon;\n};\n\nexport const defaultSemanticIcons: SemanticIcons = {\n checkmark: make('M20 6 9 17l-5-5'),\n close: make('M18 6 6 18 M6 6l12 12'),\n eye: make('M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'),\n eyeOff: make('M17.94 17.94A10 10 0 0 1 2 12s3.5-7 10-7c2 0 3.8.6 5.4 1.5 M1 1l22 22'),\n chevronDown: make('m6 9 6 6 6-6'),\n chevronUp: make('m18 15-6-6-6 6'),\n alertTriangle: make(\n 'M12 9v4 M12 17h.01 M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'\n ),\n info: make(\n 'M12 8h.01 M11 12h1v4h1 M12 22C6.48 22 2 17.52 2 12 2 6.48 6.48 2 12 2c5.52 0 10 4.48 10 10 0 5.52-4.48 10-10 10z'\n ),\n check: make('M20 6 9 17l-5-5'),\n x: make('M18 6 6 18 M6 6l12 12'),\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext } from 'react';\nimport { defaultSemanticIcons, type SemanticIcons } from './default-semantic-icons';\n\nexport const SemanticIconsContext = createContext<SemanticIcons>(defaultSemanticIcons);\nSemanticIconsContext.displayName = 'SemanticIconsContext';\n\nexport type SemanticIconsProviderProps = {\n icons?: Partial<SemanticIcons>;\n children?: ReactNode;\n};\n\nexport function SemanticIconsProvider({ icons, children }: SemanticIconsProviderProps) {\n const merged: SemanticIcons = icons ? { ...defaultSemanticIcons, ...icons } : defaultSemanticIcons;\n return <SemanticIconsContext.Provider value={merged}>{children}</SemanticIconsContext.Provider>;\n}\n","'use client';\n\nimport { useContext } from 'react';\nimport type { SemanticIcons } from './default-semantic-icons';\nimport { SemanticIconsContext } from './semantic-context';\n\nexport function useSemanticIcon<K extends keyof SemanticIcons>(name: K): SemanticIcons[K] {\n const icons = useContext(SemanticIconsContext);\n return icons[name];\n}\n","// cn — class-name merger. clsx-compatible shape.\n//\n// Intentionally does NOT deduplicate Tailwind conflicts (e.g. \"text-sm text-lg\").\n// That's `tailwind-merge`'s job; we defer adding it until a component actually\n// needs it, to keep the core tree-shakable and the runtime zero-dep.\n\nexport type ClassInput =\n | string\n | number\n | boolean\n | null\n | undefined\n | ClassInput[]\n | Record<string, boolean | number | null | undefined>;\n\nexport function cn(...inputs: ClassInput[]): string {\n const out: string[] = [];\n for (const input of inputs) append(out, input);\n return out.join(' ');\n}\n\nfunction append(out: string[], input: ClassInput): void {\n if (!input) return;\n if (typeof input === 'string') {\n if (input.length > 0) out.push(input);\n return;\n }\n if (typeof input === 'number') return; // numbers are never class names\n if (Array.isArray(input)) {\n for (const inner of input) append(out, inner);\n return;\n }\n if (typeof input === 'object') {\n for (const key of Object.keys(input)) {\n if (input[key]) out.push(key);\n }\n }\n}\n","import type { ViewProps } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from '../../utils/cn';\n\nexport type BoxProps = ViewProps & {\n className?: string;\n testID?: string;\n};\n\n/**\n * Generic layout primitive. Wraps react-native's <View> with className support.\n * RSC-safe.\n */\nexport function Box({ className, children, ...rest }: BoxProps) {\n return (\n <View {...rest} className={cn(className)}>\n {children}\n </View>\n );\n}\n","// GENERATED by @nori-ui/tokens — DO NOT EDIT.\n// Run `yarn build:tokens` to regenerate.\n\n// Generated for light mode.\n// Do not edit — run `yarn build:tokens`.\n\nexport const theme = {\n color: {\n danger: \"#ef4444\",\n info: \"#3b82f6\",\n neutral: {\n \"100\": \"#f4f4f5\",\n \"200\": \"#e4e4e7\",\n \"300\": \"#d4d4d8\",\n \"400\": \"#a1a1aa\",\n \"50\": \"#fafafa\",\n \"500\": \"#71717a\",\n \"600\": \"#52525b\",\n \"700\": \"#3f3f46\",\n \"800\": \"#27272a\",\n \"900\": \"#18181b\",\n },\n primary: {\n \"100\": \"#dbeafe\",\n \"200\": \"#bfdbfe\",\n \"300\": \"#93c5fd\",\n \"400\": \"#60a5fa\",\n \"50\": \"#f0f7ff\",\n \"500\": \"#3b82f6\",\n \"600\": \"#2563eb\",\n \"700\": \"#1d4ed8\",\n \"800\": \"#1e40af\",\n \"900\": \"#1e3a8a\",\n },\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n fontSize: {\n \"2xl\": \"24px\",\n \"3xl\": \"30px\",\n \"4xl\": \"36px\",\n lg: \"18px\",\n md: \"16px\",\n sm: \"14px\",\n xl: \"20px\",\n xs: \"12px\",\n },\n fontWeight: {\n bold: \"700\",\n medium: \"500\",\n regular: \"400\",\n semibold: \"600\",\n },\n lineHeight: {\n normal: \"1.4\",\n relaxed: \"1.6\",\n tight: \"1.2\",\n },\n radius: {\n \"2xl\": \"16px\",\n full: \"9999px\",\n lg: \"8px\",\n md: \"6px\",\n none: \"0px\",\n sm: \"4px\",\n xl: \"12px\",\n },\n semantic: {\n background: {\n default: \"#fafafa\",\n elevated: \"#ffffff\",\n subtle: \"#f4f4f5\",\n },\n border: {\n default: \"#e4e4e7\",\n strong: \"#d4d4d8\",\n },\n interactive: {\n destructive: \"#ef4444\",\n primary: \"#2563eb\",\n primaryHover: \"#1d4ed8\",\n primaryPressed: \"#1e40af\",\n },\n text: {\n default: \"#18181b\",\n inverted: \"#fafafa\",\n muted: \"#52525b\",\n },\n },\n shadow: {\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)\",\n sm: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n },\n spacing: {\n \"0\": \"0px\",\n \"1\": \"4px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n \"2\": \"8px\",\n \"20\": \"80px\",\n \"24\": \"96px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n },\n} as const;\n\nexport type Theme = typeof theme;\n\n\n// Dark mode overrides\n// Generated for dark mode.\n// Do not edit — run `yarn build:tokens`.\n\nexport const themeDark = {\n color: {\n danger: \"#ef4444\",\n info: \"#3b82f6\",\n neutral: {\n \"100\": \"#f4f4f5\",\n \"200\": \"#e4e4e7\",\n \"300\": \"#d4d4d8\",\n \"400\": \"#a1a1aa\",\n \"50\": \"#fafafa\",\n \"500\": \"#71717a\",\n \"600\": \"#52525b\",\n \"700\": \"#3f3f46\",\n \"800\": \"#27272a\",\n \"900\": \"#18181b\",\n },\n primary: {\n \"100\": \"#dbeafe\",\n \"200\": \"#bfdbfe\",\n \"300\": \"#93c5fd\",\n \"400\": \"#60a5fa\",\n \"50\": \"#f0f7ff\",\n \"500\": \"#3b82f6\",\n \"600\": \"#2563eb\",\n \"700\": \"#1d4ed8\",\n \"800\": \"#1e40af\",\n \"900\": \"#1e3a8a\",\n },\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n fontSize: {\n \"2xl\": \"24px\",\n \"3xl\": \"30px\",\n \"4xl\": \"36px\",\n lg: \"18px\",\n md: \"16px\",\n sm: \"14px\",\n xl: \"20px\",\n xs: \"12px\",\n },\n fontWeight: {\n bold: \"700\",\n medium: \"500\",\n regular: \"400\",\n semibold: \"600\",\n },\n lineHeight: {\n normal: \"1.4\",\n relaxed: \"1.6\",\n tight: \"1.2\",\n },\n radius: {\n \"2xl\": \"16px\",\n full: \"9999px\",\n lg: \"8px\",\n md: \"6px\",\n none: \"0px\",\n sm: \"4px\",\n xl: \"12px\",\n },\n semantic: {\n background: {\n default: \"#18181b\",\n elevated: \"#3f3f46\",\n subtle: \"#27272a\",\n },\n border: {\n default: \"#3f3f46\",\n strong: \"#52525b\",\n },\n interactive: {\n destructive: \"#ef4444\",\n primary: \"#60a5fa\",\n primaryHover: \"#93c5fd\",\n primaryPressed: \"#bfdbfe\",\n },\n text: {\n default: \"#fafafa\",\n inverted: \"#18181b\",\n muted: \"#a1a1aa\",\n },\n },\n shadow: {\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)\",\n sm: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n },\n spacing: {\n \"0\": \"0px\",\n \"1\": \"4px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n \"2\": \"8px\",\n \"20\": \"80px\",\n \"24\": \"96px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n },\n} as const;\n\n","// composeRefs — merges multiple React refs (callback or object) into a single callback.\n// Derived from Radix UI's approach; reimplemented here so we don't take a Radix dependency.\n\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\nexport function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (ref == null) continue;\n if (typeof ref === 'function') {\n ref(node);\n } else {\n // React's MutableRefObject typing — we assign .current directly.\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n","import type { CSSProperties, ReactElement, Ref } from 'react';\nimport { Children, cloneElement, forwardRef, isValidElement } from 'react';\nimport { composeRefs } from './compose-refs';\n\ntype AnyProps = Record<string, unknown>;\n\nexport type SlotProps = {\n children?: React.ReactNode;\n} & AnyProps;\n\nexport const Slot = forwardRef<unknown, SlotProps>(function Slot(props, forwardedRef) {\n const { children, ...slotProps } = props;\n\n if (!isValidElement(children)) {\n return null;\n }\n\n // Assert that children is a single React element with props — we've narrowed above.\n const child = Children.only(children) as ReactElement<AnyProps> & { ref?: Ref<unknown> };\n const merged = mergeProps(slotProps, child.props);\n\n // Merge refs: Slot's forwarded ref + the child's own ref (if any).\n const childRef = (child as unknown as { ref?: Ref<unknown> }).ref;\n if (forwardedRef || childRef) {\n (merged as AnyProps).ref = composeRefs(forwardedRef, childRef);\n }\n\n return cloneElement(child, merged);\n});\nSlot.displayName = 'Slot';\n\nfunction mergeProps(outer: AnyProps, inner: AnyProps): AnyProps {\n // Inner (child) wins for everything except: className (concatenated), style (merged), and\n // event handlers (composed — outer runs first, then inner).\n const merged: AnyProps = { ...outer };\n\n for (const key of Object.keys(inner)) {\n const outerValue = outer[key];\n const innerValue = inner[key];\n\n if (key === 'className' || key === 'class') {\n merged[key] = joinClass(outerValue, innerValue);\n continue;\n }\n\n if (key === 'style') {\n merged[key] = {\n ...(outerValue as CSSProperties | undefined),\n ...(innerValue as CSSProperties | undefined),\n };\n continue;\n }\n\n if (isEventHandler(key, outerValue, innerValue)) {\n merged[key] = composeHandlers(outerValue as Fn, innerValue as Fn);\n continue;\n }\n\n merged[key] = innerValue;\n }\n\n return merged;\n}\n\nfunction joinClass(outer: unknown, inner: unknown): string | undefined {\n const a = typeof outer === 'string' ? outer : '';\n const b = typeof inner === 'string' ? inner : '';\n const joined = [a, b].filter(Boolean).join(' ');\n return joined.length > 0 ? joined : undefined;\n}\n\ntype Fn = (...args: unknown[]) => unknown;\n\nfunction isEventHandler(key: string, outer: unknown, inner: unknown): boolean {\n if (!key.startsWith('on') || key.length < 3) return false;\n if (key[2] !== key[2]?.toUpperCase()) return false;\n return typeof outer === 'function' && typeof inner === 'function';\n}\n\nfunction composeHandlers(outer: Fn, inner: Fn): Fn {\n return (...args: unknown[]) => {\n outer(...args);\n inner(...args);\n };\n}\n","import type { ActivityIndicatorProps } from 'react-native';\nimport { ActivityIndicator } from 'react-native';\n\nexport type SpinnerSize = 'sm' | 'md' | 'lg' | 'xl' | number;\n\nexport type SpinnerProps = Omit<ActivityIndicatorProps, 'size'> & {\n /** Visible (a11y) label. Defaults to the i18n \"common.loading\" default (\"Loading\"). */\n label?: string;\n size?: SpinnerSize;\n testID?: string;\n className?: string;\n};\n\nconst SIZE_MAP: Record<Exclude<SpinnerSize, number>, number> = {\n sm: 12,\n md: 16,\n lg: 24,\n xl: 32,\n};\n\n/**\n * Loading indicator.\n *\n * a11y: rendered with `role=\"progressbar\"` and an `aria-label` so screen\n * readers announce it. Respects `prefers-reduced-motion` — on web, react-native-web's\n * ActivityIndicator will render without animation when the media query matches;\n * on native, React Native's ActivityIndicator honors the OS reduce-motion setting\n * automatically.\n *\n * RSC-safe: pure render, no hooks.\n */\nexport function Spinner({ label = 'Loading', size = 'md', testID, color, style, ...rest }: SpinnerProps) {\n const px = typeof size === 'number' ? size : SIZE_MAP[size];\n return (\n <ActivityIndicator\n {...rest}\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"progressbar\"\n accessibilityLabel={label}\n {...(color !== undefined ? { color } : {})}\n size={px}\n style={[{ width: px, height: px }, style]}\n />\n );\n}\n","import { theme } from '@nori-ui/tokens';\nimport type { ComponentType, ReactNode } from 'react';\nimport { forwardRef } from 'react';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText } from 'react-native';\nimport { Slot } from '../../slot';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\n\ntype IconSlot = ComponentType<{ size?: number; color?: string }>;\n\nexport type ButtonProps = Omit<PressableProps, 'disabled' | 'children'> & {\n children?: ReactNode;\n variant?: ButtonVariant;\n size?: ButtonSize;\n disabled?: boolean;\n loading?: boolean;\n leadingIcon?: IconSlot;\n trailingIcon?: IconSlot;\n /** If true, the single child becomes the interactive element (Slot pattern). */\n asChild?: boolean;\n className?: string;\n testID?: string;\n};\n\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n primary:\n 'bg-semantic-interactive-primary hover:bg-semantic-interactive-primaryHover active:bg-semantic-interactive-primaryPressed',\n secondary: 'bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300',\n ghost: 'bg-transparent hover:bg-neutral-100 active:bg-neutral-200',\n destructive: 'bg-semantic-interactive-destructive hover:opacity-90 active:opacity-80',\n};\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-md',\n lg: 'h-12 px-5 text-lg',\n};\n\nconst ICON_SIZE: Record<ButtonSize, number> = { sm: 14, md: 16, lg: 20 };\n\nconst BASE_CLASSES = 'inline-flex flex-row items-center justify-center gap-2 rounded-md select-none';\n\n// Inline fallback styles mirror the NativeWind classes above. They ship so\n// the component renders correctly when NativeWind is NOT active (e.g. Expo\n// Snack's sandbox, or apps that don't configure NativeWind). When NativeWind\n// IS active, its compiled className styles merge with and (where intended)\n// override these defaults.\nconst VARIANT_STYLES: Record<ButtonVariant, ViewStyle> = {\n primary: { backgroundColor: theme.color.primary['600'] },\n secondary: { backgroundColor: theme.color.neutral['100'] },\n ghost: { backgroundColor: 'transparent' },\n destructive: { backgroundColor: theme.color.danger },\n};\n\nconst VARIANT_TEXT_COLOR: Record<ButtonVariant, string> = {\n primary: '#ffffff',\n secondary: theme.color.neutral['900'],\n ghost: theme.color.neutral['900'],\n destructive: '#ffffff',\n};\n\nconst SIZE_STYLES: Record<ButtonSize, { container: ViewStyle; text: { fontSize: number } }> = {\n sm: { container: { height: 32, paddingHorizontal: 12 }, text: { fontSize: 14 } },\n md: { container: { height: 40, paddingHorizontal: 16 }, text: { fontSize: 16 } },\n lg: { container: { height: 48, paddingHorizontal: 20 }, text: { fontSize: 18 } },\n};\n\nconst BASE_STYLE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n borderRadius: 6,\n};\n\nexport const Button = forwardRef<unknown, ButtonProps>(function Button(\n {\n children,\n variant = 'primary',\n size = 'md',\n disabled,\n loading,\n leadingIcon: LeadingIcon,\n trailingIcon: TrailingIcon,\n asChild,\n className,\n onPress,\n testID,\n style,\n ...rest\n },\n forwardedRef\n) {\n const isInoperative = Boolean(disabled) || Boolean(loading);\n const classes = cn(\n BASE_CLASSES,\n VARIANT_CLASSES[variant],\n SIZE_CLASSES[size],\n isInoperative ? 'opacity-60' : undefined,\n className\n );\n\n const baseInlineStyle: StyleProp<ViewStyle> = [\n BASE_STYLE,\n VARIANT_STYLES[variant],\n SIZE_STYLES[size].container,\n isInoperative ? { opacity: 0.6 } : null,\n ];\n const pressableStyle: PressableProps['style'] =\n typeof style === 'function' ? (state) => [baseInlineStyle, style(state)] : [baseInlineStyle, style];\n const slotStyle: StyleProp<ViewStyle> = [baseInlineStyle, typeof style === 'function' ? null : style];\n\n const textColor = VARIANT_TEXT_COLOR[variant];\n const textStyle = { color: textColor, fontSize: SIZE_STYLES[size].text.fontSize, fontWeight: '500' as const };\n\n const handlePress: NonNullable<PressableProps['onPress']> = (ev) => {\n if (isInoperative) return;\n onPress?.(ev);\n };\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n ref: forwardedRef,\n className: classes,\n style: slotStyle,\n onClick: handlePress as unknown as (...args: unknown[]) => unknown,\n ...rest,\n };\n if (isInoperative) slotProps['aria-disabled'] = true;\n if (loading) slotProps['aria-busy'] = true;\n if (testID !== undefined) slotProps['data-testid'] = testID;\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const pressableExtra: Record<string, unknown> = {};\n if (isInoperative) pressableExtra['aria-disabled'] = true;\n if (loading) pressableExtra['aria-busy'] = true;\n\n return (\n <Pressable\n ref={forwardedRef as never}\n {...(testID !== undefined ? { testID } : {})}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isInoperative, busy: Boolean(loading) }}\n disabled={isInoperative}\n onPress={handlePress}\n className={classes}\n style={pressableStyle}\n {...pressableExtra}\n {...rest}\n >\n {loading ? (\n <Spinner size={ICON_SIZE[size]} label=\"Loading\" color={textColor} />\n ) : LeadingIcon ? (\n <LeadingIcon size={ICON_SIZE[size]} color={textColor} />\n ) : null}\n <RNText\n className={cn('font-medium', SIZE_CLASSES[size].includes('text-') ? undefined : 'text-md')}\n style={textStyle}\n >\n {children}\n </RNText>\n {TrailingIcon ? <TrailingIcon size={ICON_SIZE[size]} color={textColor} /> : null}\n </Pressable>\n );\n});\nButton.displayName = 'Button';\n","'use client';\n\nimport { theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useSemanticIcon } from '../../icons/use-semantic-icon';\nimport { Slot } from '../../slot';\nimport { cn } from '../../utils/cn';\n\nexport type CheckboxProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n};\n\n// Inline defaults so the checkbox renders correctly without NativeWind.\nconst ROW_STYLE: ViewStyle = { flexDirection: 'row', alignItems: 'center', gap: 8 };\nconst BOX_STYLE: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 4,\n borderWidth: 1,\n borderColor: theme.color.neutral['300'],\n backgroundColor: '#ffffff',\n alignItems: 'center',\n justifyContent: 'center',\n};\nconst BOX_STYLE_CHECKED: ViewStyle = {\n backgroundColor: theme.color.primary['600'],\n borderColor: theme.color.primary['600'],\n};\n\n/**\n * Checkbox — supports controlled + uncontrolled state, indeterminate (aria-checked=\"mixed\"),\n * asChild (via Slot), and a visible label that doubles as the accessibility label.\n */\nexport function Checkbox({\n checked,\n defaultChecked = false,\n indeterminate,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n}: CheckboxProps) {\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n\n const ariaChecked: 'true' | 'false' | 'mixed' = indeterminate ? 'mixed' : value ? 'true' : 'false';\n const isMarked = value || Boolean(indeterminate);\n\n const toggle = useCallback(() => {\n if (disabled) return;\n const next = !value;\n if (!isControlled) setInner(next);\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const Check = useSemanticIcon('checkmark');\n\n const commonProps: Record<string, unknown> = {\n role: 'checkbox',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'checkbox' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (disabled) commonProps['aria-disabled'] = true;\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'checkbox',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) slotProps['aria-disabled'] = true;\n if (label !== undefined) slotProps['aria-label'] = label;\n if (testID !== undefined) slotProps['data-testid'] = testID;\n if (className !== undefined) slotProps.className = className;\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const boxClasses = cn('w-5 h-5 rounded-sm border border-semantic-border-strong items-center justify-center');\n\n return (\n <View\n className={cn('flex-row items-center gap-2', disabled ? 'opacity-60' : undefined, className)}\n style={[ROW_STYLE, disabled ? { opacity: 0.6 } : null]}\n >\n <Pressable\n onPress={toggle}\n {...commonProps}\n className={boxClasses}\n style={[BOX_STYLE, isMarked && !disabled ? BOX_STYLE_CHECKED : null]}\n >\n {isMarked && !disabled ? <Check size={14} color=\"#ffffff\" /> : null}\n </Pressable>\n {children ??\n (label !== undefined ? (\n <RNText style={{ color: theme.color.neutral['900'], fontSize: 16 }}>{label}</RNText>\n ) : null)}\n </View>\n );\n}\n","import type { ViewProps } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from '../../utils/cn';\n\nexport type StackGap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12;\nexport type StackAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';\nexport type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n\nexport type HStackProps = ViewProps & {\n gap?: StackGap;\n align?: StackAlign;\n justify?: StackJustify;\n className?: string;\n testID?: string;\n};\n\nconst ALIGN_CLASS: Record<StackAlign, string> = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n};\n\nconst JUSTIFY_CLASS: Record<StackJustify, string> = {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n};\n\n/**\n * Horizontal flex layout primitive. RSC-safe.\n */\nexport function HStack({ gap, align, justify, className, children, ...rest }: HStackProps) {\n return (\n <View\n {...rest}\n className={cn(\n 'flex-row',\n gap !== undefined && gap !== 0 ? `gap-${gap}` : undefined,\n align !== undefined ? ALIGN_CLASS[align] : undefined,\n justify !== undefined ? JUSTIFY_CLASS[justify] : undefined,\n className\n )}\n >\n {children}\n </View>\n );\n}\n","'use client';\n\nimport { theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { Slot } from '../../slot';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n};\n\nconst ROW_STYLE: ViewStyle = { flexDirection: 'row', alignItems: 'center', gap: 8 };\nconst TRACK_BASE: ViewStyle = {\n width: 40,\n height: 24,\n borderRadius: 12,\n justifyContent: 'center',\n paddingHorizontal: 2,\n};\nconst THUMB_STYLE: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 10,\n backgroundColor: '#ffffff',\n shadowColor: '#000',\n shadowOpacity: 0.15,\n shadowRadius: 2,\n shadowOffset: { width: 0, height: 1 },\n elevation: 2,\n};\n\n/**\n * Switch — a toggle control with role=\"switch\". Supports controlled + uncontrolled,\n * disabled state, asChild (via Slot), and a visible label that doubles as the\n * accessibility label.\n */\nexport function Switch({\n checked,\n defaultChecked = false,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n}: SwitchProps) {\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n\n const toggle = useCallback(() => {\n if (disabled) return;\n const next = !value;\n if (!isControlled) setInner(next);\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const ariaChecked: 'true' | 'false' = value ? 'true' : 'false';\n\n const commonProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'switch' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (disabled) commonProps['aria-disabled'] = true;\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) slotProps['aria-disabled'] = true;\n if (label !== undefined) slotProps['aria-label'] = label;\n if (testID !== undefined) slotProps['data-testid'] = testID;\n if (className !== undefined) slotProps.className = className;\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const trackClasses = cn(\n 'w-10 h-6 rounded-full justify-center px-0.5 transition-colors',\n value ? 'bg-semantic-interactive-primary' : 'bg-neutral-300',\n disabled ? 'opacity-60' : undefined\n );\n const thumbClasses = cn('w-5 h-5 rounded-full bg-white shadow-sm', value ? 'self-end' : 'self-start');\n\n const trackStyle = [\n TRACK_BASE,\n { backgroundColor: value ? theme.color.primary['600'] : theme.color.neutral['300'] },\n disabled ? { opacity: 0.6 } : null,\n ];\n const thumbStyle = [THUMB_STYLE, { alignSelf: value ? 'flex-end' : 'flex-start' } as ViewStyle];\n\n return (\n <View className={cn('flex-row items-center gap-2', className)} style={ROW_STYLE}>\n <Pressable onPress={toggle} {...commonProps} className={trackClasses} style={trackStyle}>\n <View className={thumbClasses} style={thumbStyle} />\n </Pressable>\n {label ? (\n <RNText\n className=\"text-md text-semantic-text-default\"\n style={{ color: theme.color.neutral['900'], fontSize: 16 }}\n >\n {label}\n </RNText>\n ) : null}\n {children}\n </View>\n );\n}\n","import type { TextProps as RNTextProps } from 'react-native';\nimport { Text as RNText } from 'react-native';\nimport { cn } from '../../utils/cn';\n\nexport type TextVariant = 'body-xs' | 'body-sm' | 'body-md' | 'body-lg' | 'heading-1' | 'heading-2' | 'heading-3';\n\nexport type TextProps = RNTextProps & {\n variant?: TextVariant;\n className?: string;\n testID?: string;\n};\n\nconst VARIANT_CLASSES: Record<TextVariant, string> = {\n 'body-xs': 'text-xs leading-normal',\n 'body-sm': 'text-sm leading-normal',\n 'body-md': 'text-md leading-normal',\n 'body-lg': 'text-lg leading-relaxed',\n 'heading-1': 'text-4xl leading-tight font-bold',\n 'heading-2': 'text-3xl leading-tight font-semibold',\n 'heading-3': 'text-2xl leading-tight font-semibold',\n};\n\nconst HEADING_VARIANTS: Readonly<Set<TextVariant>> = new Set(['heading-1', 'heading-2', 'heading-3']);\n\n/**\n * Typography primitive. Renders a react-native <Text>; on web via RN-Web\n * it becomes a <div role=\"...\"> with the appropriate className.\n *\n * RSC-safe: pure render, no hooks.\n */\nexport function Text({ variant = 'body-md', className, testID, children, ...rest }: TextProps) {\n const isHeading = HEADING_VARIANTS.has(variant);\n const role = isHeading ? 'header' : rest.accessibilityRole;\n return (\n <RNText\n testID={testID}\n {...rest}\n {...(role !== undefined ? { accessibilityRole: role } : {})}\n className={cn(VARIANT_CLASSES[variant], className)}\n >\n {children}\n </RNText>\n );\n}\n","import { theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { useId } from 'react';\nimport type { TextInputProps as RNTextInputProps, TextStyle, ViewStyle } from 'react-native';\nimport { Text as RNText, TextInput as RNTextInput, View } from 'react-native';\nimport { cn } from '../../utils/cn';\n\nexport type TextInputProps = Omit<RNTextInputProps, 'editable'> & {\n label?: string;\n helperText?: string;\n error?: string;\n disabled?: boolean;\n leading?: ReactNode;\n trailing?: ReactNode;\n /** Pass through a custom wrapper className */\n containerClassName?: string;\n className?: string;\n testID?: string;\n /** Controlled text handler. Optional so uncontrolled usage works too. */\n onChangeText?: (text: string) => void;\n /** Multi-line mode — flipped by TextArea. Default false. */\n multiline?: boolean;\n numberOfLines?: number;\n};\n\nconst CONTAINER_STYLE: ViewStyle = { flexDirection: 'column', gap: 4 };\nconst LABEL_STYLE: TextStyle = { fontSize: 14, fontWeight: '500', color: theme.color.neutral['900'] };\nconst FIELD_BASE_STYLE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n borderRadius: 6,\n borderWidth: 1,\n paddingHorizontal: 12,\n};\nconst INPUT_STYLE: TextStyle = {\n flex: 1,\n paddingVertical: 8,\n fontSize: 16,\n color: theme.color.neutral['900'],\n};\nconst HELPER_STYLE: TextStyle = { fontSize: 14, color: theme.color.neutral['500'] };\nconst ERROR_STYLE: TextStyle = { fontSize: 14, color: theme.color.danger };\n\n/**\n * Single-line text input with label, helper, error, and leading/trailing slots.\n *\n * a11y: label is a <label for={id}>; the input is `aria-invalid=true` + labelled\n * by the error/helper text via aria-describedby when present.\n *\n * Notionally RSC-safe — uses only useId() which React 19 guarantees is safe on\n * the server. No \"use client\" required.\n */\nexport function TextInput({\n label,\n helperText,\n error,\n disabled,\n leading,\n trailing,\n containerClassName,\n className,\n testID,\n onChangeText,\n multiline,\n numberOfLines,\n ...rest\n}: TextInputProps) {\n const reactId = useId();\n const inputId = testID ?? `nori-ui-input-${reactId}`;\n const describeId = `${inputId}-describe`;\n const hasError = Boolean(error);\n const describedBy = error || helperText ? describeId : undefined;\n\n const inputExtras: Record<string, unknown> = {};\n if (testID !== undefined) inputExtras.testID = testID;\n if (label !== undefined) inputExtras.accessibilityLabel = label;\n if (hasError) inputExtras['aria-invalid'] = true;\n if (describedBy !== undefined) inputExtras['aria-describedby'] = describedBy;\n if (multiline !== undefined) inputExtras.multiline = multiline;\n if (numberOfLines !== undefined) inputExtras.numberOfLines = numberOfLines;\n if (onChangeText !== undefined) inputExtras.onChangeText = onChangeText;\n\n const fieldStyle = [\n FIELD_BASE_STYLE,\n { borderColor: hasError ? theme.color.danger : theme.color.neutral['200'] },\n disabled ? { opacity: 0.6 } : null,\n ];\n\n return (\n <View className={cn('flex flex-col gap-1', containerClassName)} style={CONTAINER_STYLE}>\n {label !== undefined ? (\n <label\n htmlFor={inputId}\n className=\"text-sm font-medium text-semantic-text-default\"\n style={LABEL_STYLE as object}\n >\n {label}\n </label>\n ) : null}\n <View\n className={cn(\n 'flex-row items-center rounded-md border px-3',\n hasError ? 'border-semantic-interactive-destructive' : 'border-semantic-border-default',\n disabled ? 'opacity-60' : undefined\n )}\n style={fieldStyle}\n >\n {leading ? (\n <View className=\"mr-2\" style={{ marginRight: 8 }}>\n {leading}\n </View>\n ) : null}\n <RNTextInput\n nativeID={inputId}\n editable={!disabled}\n className={cn('flex-1 py-2 text-md text-semantic-text-default outline-none', className)}\n style={INPUT_STYLE}\n placeholderTextColor={theme.color.neutral['400']}\n {...inputExtras}\n {...rest}\n />\n {trailing ? (\n <View className=\"ml-2\" style={{ marginLeft: 8 }}>\n {trailing}\n </View>\n ) : null}\n </View>\n {error ? (\n <RNText\n nativeID={describeId}\n className=\"text-sm text-semantic-interactive-destructive\"\n style={ERROR_STYLE}\n >\n {error}\n </RNText>\n ) : helperText ? (\n <RNText nativeID={describeId} className=\"text-sm text-semantic-text-muted\" style={HELPER_STYLE}>\n {helperText}\n </RNText>\n ) : null}\n </View>\n );\n}\n","import type { TextInputProps } from '../TextInput';\nimport { TextInput } from '../TextInput';\n\nexport type TextAreaProps = TextInputProps;\n\n/**\n * Multi-line text input. Thin wrapper over TextInput that fixes `multiline=true`\n * and provides a sensible default for `numberOfLines`.\n */\nexport function TextArea({ numberOfLines = 4, ...rest }: TextAreaProps) {\n return <TextInput multiline numberOfLines={numberOfLines} {...rest} />;\n}\n","import type { ViewProps } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from '../../utils/cn';\nimport type { StackAlign, StackGap, StackJustify } from '../HStack/HStack';\n\nexport type VStackProps = ViewProps & {\n gap?: StackGap;\n align?: StackAlign;\n justify?: StackJustify;\n className?: string;\n testID?: string;\n};\n\nconst ALIGN_CLASS: Record<StackAlign, string> = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n};\n\nconst JUSTIFY_CLASS: Record<StackJustify, string> = {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n};\n\n/**\n * Vertical flex layout primitive. RSC-safe.\n */\nexport function VStack({ gap, align, justify, className, children, ...rest }: VStackProps) {\n return (\n <View\n {...rest}\n className={cn(\n 'flex-col',\n gap !== undefined && gap !== 0 ? `gap-${gap}` : undefined,\n align !== undefined ? ALIGN_CLASS[align] : undefined,\n justify !== undefined ? JUSTIFY_CLASS[justify] : undefined,\n className\n )}\n >\n {children}\n </View>\n );\n}\n","import type { ComponentType } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg' | 'xl' | number;\n\nexport type IconComponentProps = {\n size?: number;\n color?: string;\n};\n\nexport type IconProps = {\n as: ComponentType<IconComponentProps>;\n size?: IconSize;\n color?: string;\n};\n\nconst SIZE_MAP: Record<Exclude<IconSize, number>, number> = {\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n};\n\n/**\n * Thin wrapper around an icon component. Consumer imports the icon they want\n * from any library (e.g. lucide-react-native) and passes it as `as`. No registry,\n * no runtime lookup — tree-shaking is automatic.\n *\n * RSC-safe: pure render, no hooks, no refs.\n */\nexport function Icon({ as: IconComponent, size = 'md', color }: IconProps) {\n const numericSize = typeof size === 'number' ? size : SIZE_MAP[size];\n // Only spread color when defined — avoids passing `color: undefined` under\n // exactOptionalPropertyTypes.\n const colorProps = color === undefined ? {} : { color };\n return <IconComponent size={numericSize} {...colorProps} />;\n}\n","'use client';\n\nimport { theme as defaultTheme, type Theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { createContext } from 'react';\n\nexport const ThemeContext = createContext<Theme>(defaultTheme);\nThemeContext.displayName = 'ThemeContext';\n\nexport type ThemeProviderProps = {\n theme?: Theme;\n children?: ReactNode;\n};\n\nexport function ThemeProvider({ theme = defaultTheme, children }: ThemeProviderProps) {\n return <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>;\n}\n","'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { I18nProvider } from '../i18n/context';\nimport type { I18nInput } from '../i18n/types';\nimport type { SemanticIcons } from '../icons/default-semantic-icons';\nimport { SemanticIconsProvider } from '../icons/semantic-context';\nimport { ThemeProvider } from '../theme/context';\n\nexport type NoriProviderProps = {\n theme?: Theme;\n i18n?: I18nInput;\n icons?: Partial<SemanticIcons>;\n children?: ReactNode;\n};\n\n/**\n * Single root provider composing theme, i18n, and semantic-icons contexts.\n * Place near the root of your app. Only needed to override defaults — the\n * library works out of the box without any provider.\n */\nexport function NoriProvider({ theme, i18n, icons, children }: NoriProviderProps) {\n // Conditionally spread each optional prop — `exactOptionalPropertyTypes: true`\n // rejects passing `undefined` to a prop typed as `T | missing`.\n const themeProps = theme === undefined ? {} : { theme };\n const i18nProps = i18n === undefined ? {} : { i18n };\n const iconsProps = icons === undefined ? {} : { icons };\n return (\n <ThemeProvider {...themeProps}>\n <I18nProvider {...i18nProps}>\n <SemanticIconsProvider {...iconsProps}>{children}</SemanticIconsProvider>\n </I18nProvider>\n </ThemeProvider>\n );\n}\n","'use client';\n\nimport { useContext } from 'react';\nimport { ThemeContext } from './context';\n\nexport function useTheme() {\n return useContext(ThemeContext);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/i18n/default-dictionary.ts","../src/i18n/resolve.ts","../src/i18n/context.tsx","../src/i18n/locale.tsx","../src/i18n/use-translation.ts","../../tokens/build/theme.ts","../src/theme/context.tsx","../src/theme/use-color-scheme.tsx","../src/theme/use-theme-colors.ts","../src/icons/default-semantic-icons.tsx","../src/icons/semantic-context.tsx","../src/icons/use-semantic-icon.ts","../src/animation/animated-view.ts","../src/animation/use-animated-number.ts","../src/theme/px.ts","../src/utils/cn.ts","../src/components/Accordion/Accordion.tsx","../src/components/Alert/Alert.tsx","../src/slot/compose-refs.ts","../src/slot/slot.tsx","../src/components/Dialog/blur-backdrop.tsx","../src/components/AlertDialog/AlertDialog.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Badge/Badge.tsx","../src/components/Text/Text.tsx","../src/utils/wrap-string-children.tsx","../src/components/Box/Box.tsx","../src/components/Popover/Popover.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Spinner/Spinner.tsx","../src/components/Button/Button.tsx","../src/components/Calendar/state/locale-utils.ts","../src/components/Calendar/state/use-calendar-keyboard.ts","../src/components/Calendar/state/constraints.ts","../src/components/Calendar/state/use-calendar-state.ts","../src/components/Calendar/state/use-range-state.ts","../src/components/Select/Select.tsx","../src/components/Calendar/state/use-caption.tsx","../src/components/Calendar/view/Caption.tsx","../src/components/Calendar/view/DayCell.tsx","../src/components/Calendar/view/DayGrid.tsx","../src/components/Calendar/view/Footer.tsx","../src/components/Calendar/view/MonthGrid.tsx","../src/components/Calendar/view/YearGrid.tsx","../src/components/Calendar/Calendar.tsx","../src/components/Card/Card.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Dialog/Dialog.tsx","../../../node_modules/react-native-safe-area-context/SafeAreaContext.tsx","../src/components/FloatButton/FloatButton.tsx","../src/components/HStack/HStack.tsx","../src/components/InputGroup/InputGroup.tsx","../src/components/Pagination/use-pagination.ts","../src/components/Pagination/Pagination.tsx","../src/components/Progress/Progress.tsx","../src/components/Radio/Radio.tsx","../src/components/SegmentedControl/SegmentedControl.tsx","../src/components/Separator/Separator.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Slider/slider-gesture-context.tsx","../src/components/Slider/Slider.tsx","../src/components/Switch/Switch.tsx","../src/components/Tabs/Tabs.tsx","../src/components/TextInput/TextInput.tsx","../src/components/TextArea/TextArea.tsx","../src/components/Toast/sonner-bridge.ts","../src/components/Toast/sonner-native-bridge.tsx","../src/components/Toast/Toaster.tsx","../src/components/Toast/toast.ts","../src/components/Toggle/Toggle.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/VStack/VStack.tsx","../src/icons/icon.tsx","../src/theme/themes.ts","../src/theme/use-theme.ts","../src/provider/nori-provider.tsx"],"names":["createContext","useMemo","jsx","useContext","theme","Platform","useState","Appearance","useEffect","isWeb","RNText","Animated","Easing","useSharedValue","withTiming","useAnimatedStyle","useId","useRef","useCallback","order","View","jsxs","Pressable","forwardRef","Slot","isValidElement","Children","cloneElement","Modal","StyleSheet","RNImage","wrapStringChildren","content","Dimensions","Fragment","ScrollView","Icon","px","ActivityIndicator","VARIANT_CLASSES","today","getLocalTimeZone","useWindowDimensions","createPortal","range","startOfMonth","ROW_KEYS","useLayoutEffect","CalendarDate","initialFocus","CONTENT_LAYOUT_BASE","SCRIM_COLOR","BLUR_AMOUNT","OVERLAY_LAYOUT_BASE","FOCUSABLE_SELECTOR","isDev","process","env","NODE_ENV","SafeAreaInsetsContext","displayName","SafeAreaFrameContext","create","fill","flex","Consumer","SIZE_MAP","CONTAINER_LAYOUT_BASE","RNTextInput","next","withAlpha","SIZE_PX","ROW_LAYOUT_BASE","defaultValue","TRIGGER_LAYOUT_BASE","FIELD_LAYOUT_BASE","SonnerModule","Toaster","createElement","toast","current","GAP","MIN_WIDTH","computePosition","ALIGN_CLASS","JUSTIFY_CLASS","ALIGN_STYLE","JUSTIFY_STYLE","GAP_PX"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO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AAE,MAAAA,EAAO,aAAa,IAAA,EAAM,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAS,EAAsB;AAGnG,EAAA,MAAM,aAAaA,MAAAA,KAAU,MAAA,GAAY,EAAC,GAAI,EAAE,OAAAA,MAAAA,EAAM;AACtD,EAAA,MAAM,YAAY,IAAA,KAAS,MAAA,GAAY,EAAC,GAAI,EAAE,IAAA,EAAK;AACnD,EAAA,MAAM,aAAa,KAAA,KAAU,MAAA,GAAY,EAAC,GAAI,EAAE,KAAA,EAAM;AACtD,EAAA,MAAM,cAAc,MAAA,KAAW,MAAA,GAAY,EAAC,GAAI,EAAE,MAAA,EAAO;AAEzD,EAAA,MAAM,KAAA,mBACFF,cAAAA,CAAC,cAAA,EAAA,EAAgB,GAAG,aAChB,QAAA,kBAAAA,cAAAA,CAAC,aAAA,EAAA,EAAe,GAAG,UAAA,EACf,QAAA,kBAAAA,eAAC,YAAA,EAAA,EAAc,GAAG,SAAA,EACd,QAAA,kBAAAA,cAAAA,CAAC,qBAAA,EAAA,EAAuB,GAAG,UAAA,EAAa,QAAA,EAAS,CAAA,EACrD,CAAA,EACJ,CAAA,EACJ,CAAA;AAGJ,EAAA,OAAO,WAAA,KAAgB,SAAY,KAAA,mBAAQA,eAAC,mBAAA,EAAA,EAAoB,KAAA,EAAO,aAAc,QAAA,EAAA,KAAA,EAAM,CAAA;AAC/F;AAnBgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA","file":"client.cjs","sourcesContent":["import type { Dictionary } from './types';\n\n/**\n * Default English strings used by library components.\n *\n * Key naming convention:\n * <component>.<purpose>[_plural-form]\n *\n * Plural suffixes follow i18next: `_zero`, `_one`, `_two`, `_few`, `_many`, `_other`.\n * Interpolation uses `{{name}}` — double braces, no spaces, by convention.\n */\nexport const defaultDictionary: Dictionary = {\n // generic / shared\n 'common.cancel': 'Cancel',\n 'common.confirm': 'Confirm',\n 'common.close': 'Close',\n 'common.back': 'Back',\n 'common.loading': 'Loading',\n 'common.error': 'Something went wrong',\n 'common.retry': 'Try again',\n\n // breadcrumb\n 'breadcrumb.ariaLabel': 'Breadcrumb',\n 'breadcrumb.expandLabel': 'Show full path',\n 'breadcrumb.ellipsisLabel': 'More',\n 'breadcrumb.currentPageLabel': 'Current page',\n 'breadcrumb.siblingMenuLabel': 'Open sibling pages',\n\n // pagination\n 'pagination.ariaLabel': 'Pagination',\n 'pagination.previous': 'Previous page',\n 'pagination.next': 'Next page',\n 'pagination.first': 'First page',\n 'pagination.last': 'Last page',\n 'pagination.ellipsis': 'More pages',\n 'pagination.currentPage': 'Current page',\n 'pagination.gotoPage': 'Go to page {{page}}',\n 'pagination.range': 'Showing {{from}}–{{to}} of {{total}}',\n 'pagination.pageOf': 'Page {{page}} of {{total}}',\n 'pagination.pageSizeLabel': 'Items per page',\n 'pagination.jumperLabel': 'Go to page',\n 'pagination.jumperPlaceholder': '#',\n\n // floatButton\n 'floatButton.backToTop': 'Back to top',\n\n // calendar\n 'calendar.header.previous': 'Previous',\n 'calendar.header.next': 'Next',\n 'calendar.header.openMonthView': 'Open month picker',\n 'calendar.header.openYearView': 'Open year picker',\n 'calendar.header.openDayView': 'Open day picker',\n 'calendar.today': 'Today',\n 'calendar.clear': 'Clear',\n\n // button\n 'button.loadingLabel': 'Loading',\n\n // input\n 'input.clear': 'Clear',\n 'input.passwordShow': 'Show password',\n 'input.passwordHide': 'Hide password',\n\n // checkbox / switch\n 'checkbox.checked': 'Checked',\n 'checkbox.unchecked': 'Unchecked',\n 'switch.on': 'On',\n 'switch.off': 'Off',\n};\n","import type { Dictionary, I18nInput, I18nOptions, TranslateFn } from './types';\n\n/**\n * Normalizes the consumer's i18n input (undefined | dictionary | function) into a\n * uniform TranslateFn. Internal code only calls the returned function.\n *\n * Precedence for a given key lookup:\n * 1. consumer function (if provided) — called verbatim, no further fallback\n * 2. consumer dictionary (if provided)\n * 3. library defaults\n * 4. options.defaultValue\n * 5. the key itself (so missing strings are visible in dev, not silent)\n */\nexport function resolveI18n(input: I18nInput, defaults: Dictionary): TranslateFn {\n if (typeof input === 'function') {\n // Wrap so the consumer fn is always invoked with (key, options) — enables\n // Jest `toHaveBeenCalledWith(key, undefined)` assertions and mirrors i18next's\n // own call signature exactly.\n return (keyOrKeys, options) => input(keyOrKeys, options);\n }\n\n const dict = input ?? {};\n\n return (keyOrKeys, options) => {\n const keys = Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];\n for (const rawKey of keys) {\n const key = pluralize(rawKey, options?.count);\n const template = dict[key] ?? defaults[key];\n if (template !== undefined) {\n return interpolate(template, options);\n }\n }\n // exhausted the key list\n const lastKey = keys[keys.length - 1];\n if (options?.defaultValue !== undefined) {\n return interpolate(options.defaultValue, options);\n }\n return lastKey ?? '';\n };\n}\n\nfunction pluralize(key: string, count: number | undefined): string {\n if (count === undefined) {\n return key;\n }\n // Minimal English pluralization — extend with ICU rules later if needed.\n if (count === 1) {\n return `${key}_one`;\n }\n return `${key}_other`;\n}\n\nfunction interpolate(template: string, options: I18nOptions | undefined): string {\n if (!options) {\n return template;\n }\n return template.replace(/\\{\\{\\s*([A-Za-z0-9_.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const value = options[name];\n return value === undefined || value === null ? '' : String(value);\n });\n}\n","'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 type { ReactNode } from 'react';\nimport { createContext, useContext, useMemo } from 'react';\n\nexport type LocaleInput = string | Intl.Locale;\n\n/**\n * Resolve the runtime's default locale. Works under Hermes (which ships\n * Intl on iOS via system ICU and on Android via bundled ICU) and any\n * browser. Returns a BCP 47 tag.\n */\nexport const detectLocale = (): string => {\n try {\n return new Intl.DateTimeFormat().resolvedOptions().locale;\n } catch {\n return 'en-US';\n }\n};\n\nconst toTag = (input: LocaleInput | undefined): string =>\n input === undefined ? detectLocale() : typeof input === 'string' ? input : input.toString();\n\nconst LocaleContext = createContext<string | null>(null);\nLocaleContext.displayName = 'LocaleContext';\n\nexport type LocaleProviderProps = {\n locale?: LocaleInput;\n children?: ReactNode;\n};\n\nexport const LocaleProvider = ({ locale, children }: LocaleProviderProps) => {\n const value = useMemo(() => toTag(locale), [locale]);\n return <LocaleContext.Provider value={value}>{children}</LocaleContext.Provider>;\n};\n\nexport const useLocale = (): string => {\n const ctx = useContext(LocaleContext);\n return ctx ?? detectLocale();\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","// GENERATED by @nori-ui/tokens — DO NOT EDIT.\n// Run `yarn build:tokens` to regenerate.\n\n// Generated for light mode.\n// Do not edit — run `yarn build:tokens`.\n\nexport const theme = {\n color: {\n danger: \"#ef4444\",\n info: \"#3b82f6\",\n neutral: {\n \"100\": \"#f4f4f5\",\n \"200\": \"#e4e4e7\",\n \"300\": \"#d4d4d8\",\n \"400\": \"#a1a1aa\",\n \"50\": \"#fafafa\",\n \"500\": \"#71717a\",\n \"600\": \"#52525b\",\n \"700\": \"#3f3f46\",\n \"800\": \"#27272a\",\n \"900\": \"#18181b\",\n },\n primary: {\n \"100\": \"#ccfbf1\",\n \"200\": \"#99f6e4\",\n \"300\": \"#5eead4\",\n \"400\": \"#2dd4bf\",\n \"50\": \"#f0fdfa\",\n \"500\": \"#14b8a6\",\n \"600\": \"#0d9488\",\n \"700\": \"#0f766e\",\n \"800\": \"#115e59\",\n \"900\": \"#134e4a\",\n },\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n fontFamily: {\n body: \"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif\",\n display: \"ui-serif, Georgia, 'Times New Roman', serif\",\n mono: \"ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace\",\n },\n fontSize: {\n \"2xl\": \"24px\",\n \"3xl\": \"30px\",\n \"4xl\": \"36px\",\n lg: \"18px\",\n md: \"16px\",\n sm: \"14px\",\n xl: \"20px\",\n xs: \"12px\",\n },\n fontWeight: {\n bold: \"700\",\n medium: \"500\",\n regular: \"400\",\n semibold: \"600\",\n },\n lineHeight: {\n normal: \"1.4\",\n relaxed: \"1.6\",\n tight: \"1.2\",\n },\n radius: {\n \"2xl\": \"16px\",\n full: \"9999px\",\n lg: \"8px\",\n md: \"6px\",\n none: \"0px\",\n sm: \"4px\",\n xl: \"12px\",\n },\n semantic: {\n background: {\n default: \"#fafafa\",\n elevated: \"#ffffff\",\n subtle: \"#f4f4f5\",\n },\n border: {\n default: \"#e4e4e7\",\n strong: \"#d4d4d8\",\n },\n interactive: {\n destructive: \"#ef4444\",\n primary: \"#0d9488\",\n primaryHover: \"#0f766e\",\n primaryPressed: \"#115e59\",\n },\n text: {\n default: \"#18181b\",\n inverted: \"#fafafa\",\n muted: \"#52525b\",\n },\n },\n shadow: {\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)\",\n sm: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n },\n spacing: {\n \"0\": \"0px\",\n \"1\": \"4px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n \"2\": \"8px\",\n \"20\": \"80px\",\n \"24\": \"96px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n },\n} as const;\n\nexport type Theme = typeof theme;\n\n\n// Dark mode overrides\n// Generated for dark mode.\n// Do not edit — run `yarn build:tokens`.\n\nexport const themeDark = {\n color: {\n danger: \"#ef4444\",\n info: \"#3b82f6\",\n neutral: {\n \"100\": \"#f4f4f5\",\n \"200\": \"#e4e4e7\",\n \"300\": \"#d4d4d8\",\n \"400\": \"#a1a1aa\",\n \"50\": \"#fafafa\",\n \"500\": \"#71717a\",\n \"600\": \"#52525b\",\n \"700\": \"#3f3f46\",\n \"800\": \"#27272a\",\n \"900\": \"#18181b\",\n },\n primary: {\n \"100\": \"#ccfbf1\",\n \"200\": \"#99f6e4\",\n \"300\": \"#5eead4\",\n \"400\": \"#2dd4bf\",\n \"50\": \"#f0fdfa\",\n \"500\": \"#14b8a6\",\n \"600\": \"#0d9488\",\n \"700\": \"#0f766e\",\n \"800\": \"#115e59\",\n \"900\": \"#134e4a\",\n },\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n fontFamily: {\n body: \"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif\",\n display: \"ui-serif, Georgia, 'Times New Roman', serif\",\n mono: \"ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace\",\n },\n fontSize: {\n \"2xl\": \"24px\",\n \"3xl\": \"30px\",\n \"4xl\": \"36px\",\n lg: \"18px\",\n md: \"16px\",\n sm: \"14px\",\n xl: \"20px\",\n xs: \"12px\",\n },\n fontWeight: {\n bold: \"700\",\n medium: \"500\",\n regular: \"400\",\n semibold: \"600\",\n },\n lineHeight: {\n normal: \"1.4\",\n relaxed: \"1.6\",\n tight: \"1.2\",\n },\n radius: {\n \"2xl\": \"16px\",\n full: \"9999px\",\n lg: \"8px\",\n md: \"6px\",\n none: \"0px\",\n sm: \"4px\",\n xl: \"12px\",\n },\n semantic: {\n background: {\n default: \"#18181b\",\n elevated: \"#3f3f46\",\n subtle: \"#27272a\",\n },\n border: {\n default: \"#3f3f46\",\n strong: \"#52525b\",\n },\n interactive: {\n destructive: \"#ef4444\",\n primary: \"#2dd4bf\",\n primaryHover: \"#5eead4\",\n primaryPressed: \"#99f6e4\",\n },\n text: {\n default: \"#fafafa\",\n inverted: \"#18181b\",\n muted: \"#a1a1aa\",\n },\n },\n shadow: {\n lg: \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)\",\n md: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)\",\n sm: \"0 1px 2px 0 rgba(0, 0, 0, 0.05)\",\n },\n spacing: {\n \"0\": \"0px\",\n \"1\": \"4px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n \"2\": \"8px\",\n \"20\": \"80px\",\n \"24\": \"96px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n },\n} as const;\n\n","'use client';\n\nimport { themeDark as defaultDark, theme as defaultLight, type Theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { createContext } from 'react';\n\n/**\n * A `NoriTheme` is a paired light/dark palette. The active half is picked\n * by `useColorScheme()` so the same theme object covers both schemes.\n *\n * Build one yourself by spreading the defaults and overriding the colors\n * you care about, or pick a preset from `@nori-ui/core/themes` (see the\n * Theming docs for examples).\n */\nexport type NoriTheme = {\n light: Theme;\n dark: Theme;\n};\n\n/**\n * Default Nori palette — teal primary on a warm-paper light surface, and\n * teal-400 primary on a deep-zinc dark surface. Mirrors the `theme` /\n * `themeDark` exports from @nori-ui/tokens.\n */\nexport const defaultTheme: NoriTheme = {\n light: defaultLight,\n dark: defaultDark as unknown as Theme,\n};\n\n// Context value is the FULL pair, not the active half. `useThemeColors`\n// (the hook components reach for) resolves it to the right one based on\n// the current color scheme. Storing the pair means a parent only has to\n// declare the theme once — switching scheme is a separate concern.\nexport const ThemeContext = createContext<NoriTheme>(defaultTheme);\nThemeContext.displayName = 'ThemeContext';\n\nexport type ThemeProviderProps = {\n /**\n * The theme to apply to descendants. Pass either:\n * - a full `NoriTheme` (`{ light, dark }`) — both schemes covered\n * - a single `Theme` — used for both light and dark (rare; mostly\n * useful when you ONLY ever render in one scheme)\n * - omit — falls back to the Nori default (teal palette)\n */\n theme?: NoriTheme | Theme;\n children?: ReactNode;\n};\n\nconst isFullTheme = (t: NoriTheme | Theme): t is NoriTheme => 'light' in t && 'dark' in t;\n\nexport function ThemeProvider({ theme, children }: ThemeProviderProps) {\n const value: NoriTheme =\n theme === undefined ? defaultTheme : isFullTheme(theme) ? theme : { light: theme, dark: theme };\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n","'use client';\n\nimport { createContext, type ReactNode, useContext, useEffect, useState } from 'react';\nimport { Appearance, Platform } from 'react-native';\n\nexport type ColorScheme = 'light' | 'dark';\n\n// Override channel so a parent can force a scheme (e.g. an app shell with\n// hard-coded dark chrome that wants nested components to render against\n// the dark token half regardless of the OS Appearance). `null` means\n// \"no override — use the system signal\".\nconst ColorSchemeOverrideContext = createContext<ColorScheme | null>(null);\nColorSchemeOverrideContext.displayName = 'ColorSchemeOverrideContext';\n\nexport type ColorSchemeProviderProps = {\n /** Force a specific scheme for descendants. */\n value: ColorScheme;\n children?: ReactNode;\n};\n\n/**\n * Forces a color scheme for all descendants. Useful when a screen's chrome\n * is hard-coded to one scheme (e.g. a forced-dark editorial surface) and\n * you want library components inside it to follow that, not the OS.\n */\nexport function ColorSchemeProvider({ value, children }: ColorSchemeProviderProps) {\n return <ColorSchemeOverrideContext.Provider value={value}>{children}</ColorSchemeOverrideContext.Provider>;\n}\n\nconst isWeb = Platform.OS === 'web';\n\n// Web: a document is \"in dark mode\" when the root <html> element carries\n// the `dark` class (Tailwind / Fumadocs convention) OR a `data-theme=\"dark\"`\n// attribute (matches the `darkMode` selectors in our Tailwind preset).\n// We deliberately don't fall back to `prefers-color-scheme` — the app\n// usually owns that decision and writes it onto <html>; tracking the system\n// preference too would fight the app's chosen value.\nfunction readWebScheme(): ColorScheme {\n if (typeof document === 'undefined') {\n return 'light';\n }\n const root = document.documentElement;\n if (root.classList.contains('dark')) {\n return 'dark';\n }\n if (root.getAttribute('data-theme') === 'dark') {\n return 'dark';\n }\n return 'light';\n}\n\n/**\n * Returns the current color scheme — `'light'` or `'dark'`.\n *\n * On web: observes the root `<html>` element's `class=\"dark\"` and\n * `data-theme=\"dark\"` attribute (the same signals our Tailwind preset\n * keys on). Updates live as those flip.\n *\n * On native: delegates to `react-native`'s `Appearance` API so the hook\n * tracks the OS preference without extra wiring.\n *\n * Components consume this indirectly via `useThemeColors()`; reach for\n * this directly when you need the raw scheme (e.g. to swap an icon).\n */\nexport function useColorScheme(): ColorScheme {\n // A `<ColorSchemeProvider value=\"dark\">` ancestor (or NoriProvider's\n // `colorScheme` prop, which mounts one) wins over the OS signal — the\n // app shell knows which scheme its chrome is locked to.\n const override = useContext(ColorSchemeOverrideContext);\n\n const [scheme, setScheme] = useState<ColorScheme>(() => {\n if (isWeb) {\n return readWebScheme();\n }\n return (Appearance.getColorScheme() ?? 'light') as ColorScheme;\n });\n\n useEffect(() => {\n if (isWeb) {\n const root = document.documentElement;\n const update = () => setScheme(readWebScheme());\n const observer = new MutationObserver(update);\n observer.observe(root, { attributes: true, attributeFilter: ['class', 'data-theme'] });\n // Sync once after mount in case SSR shipped a different value.\n update();\n return () => observer.disconnect();\n }\n\n const sub = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme((colorScheme ?? 'light') as ColorScheme);\n });\n return () => sub.remove();\n }, []);\n\n return override ?? scheme;\n}\n","'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport { useContext } from 'react';\nimport { ThemeContext } from './context';\nimport { useColorScheme } from './use-color-scheme';\n\n/**\n * Returns the active token palette — `theme.light` in light mode,\n * `theme.dark` in dark mode. Resolves the theme via `ThemeContext` so\n * any ancestor `<ThemeProvider theme={...}>` flows through. With no\n * provider in the tree, the default Nori palette (teal) is used.\n *\n * Use this **inside a component** when you need a hex value for a React\n * Native `style` prop (`backgroundColor`, `borderColor`, etc.).\n *\n * Note: className-based styles (e.g. `bg-semantic-interactive-primary`)\n * compile against the @nori-ui/tokens palette at build time and don't\n * follow `<ThemeProvider>` overrides today. Inline styles via this hook\n * always do — and inline beats class on CSS specificity, so the visible\n * color you see is whatever the hook resolves to. CSS-variable theming\n * for the className path is a planned follow-up.\n */\nexport function useThemeColors(): Theme {\n const scheme = useColorScheme();\n const themePair = useContext(ThemeContext);\n return scheme === 'dark' ? themePair.dark : themePair.light;\n}\n","'use client';\n\n// default-semantic-icons — minimal built-in icon placeholders for internal\n// library glyphs. Consumers can swap each one via the provider:\n//\n// <NoriProvider icons={{ checkmark: MyCheck, close: MyX }}>\n//\n// These defaults exist so the library renders usable UI out of the box even\n// when lucide-react(-native) or any other icon set is not installed. They are\n// NOT intended to compete with Lucide on style — override them in production.\n//\n// Web ships an SVG path identical to the historical lucide-style stroke. Native\n// ships a Unicode glyph wrapped in `<Text>` because raw `<svg><path>` doesn't\n// exist on the React Native runtime — the renderer treats lowercase host names\n// as native components and crashes with \"View config getter callback for\n// component `path` must be a function\". `react-native-svg` would solve this\n// but it's an extra peer dep this library deliberately doesn't require.\n//\n// Marked `'use client'` because the native render path reads\n// `useThemeColors()` to default the glyph color to the active theme's\n// text token when no explicit color is passed. Without this the native\n// glyph would render in RNText's default (black) regardless of scheme.\n\nimport type { ComponentType } from 'react';\nimport { Platform, Text as RNText } from 'react-native';\nimport { useThemeColors } from '../theme/use-theme-colors';\nimport type { IconComponentProps } from './icon';\n\ntype SemanticIcon = ComponentType<IconComponentProps>;\n\ntype IconRecipe = {\n /** SVG `path` data — used on the web. */\n path: string;\n /** Unicode glyph rendered in `<Text>` on native. */\n glyph: string;\n};\n\nconst isWeb = Platform.OS === 'web';\n\nconst make = ({ path, glyph }: IconRecipe): SemanticIcon =>\n function PlaceholderIcon({ size = 20, color = 'currentColor' }) {\n // Always call the hook — rules-of-hooks. The native branch is the\n // only consumer of the resolved colors, but pulling them on web is\n // a cheap context read.\n const colors = useThemeColors();\n if (isWeb) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d={path} />\n </svg>\n );\n }\n // 'currentColor' is a CSS keyword without meaning on native — RNText\n // would render in its inherent default (~black). Resolve it against\n // the active theme so the glyph stays readable in both schemes.\n const resolvedColor = color === 'currentColor' ? colors.semantic.text.default : color;\n return (\n <RNText\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{ fontSize: size, lineHeight: size, color: resolvedColor }}\n >\n {glyph}\n </RNText>\n );\n };\n\nexport type SemanticIcons = {\n checkmark: SemanticIcon;\n close: SemanticIcon;\n eye: SemanticIcon;\n eyeOff: SemanticIcon;\n chevronDown: SemanticIcon;\n chevronUp: SemanticIcon;\n alertTriangle: SemanticIcon;\n info: SemanticIcon;\n check: SemanticIcon;\n x: SemanticIcon;\n};\n\nexport const defaultSemanticIcons: SemanticIcons = {\n checkmark: make({ path: 'M20 6 9 17l-5-5', glyph: '✓' }),\n close: make({ path: 'M18 6 6 18 M6 6l12 12', glyph: '✕' }),\n eye: make({\n path: 'M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z',\n glyph: '👁',\n }),\n eyeOff: make({\n path: 'M17.94 17.94A10 10 0 0 1 2 12s3.5-7 10-7c2 0 3.8.6 5.4 1.5 M1 1l22 22',\n glyph: '🙈',\n }),\n chevronDown: make({ path: 'm6 9 6 6 6-6', glyph: '⌄' }),\n chevronUp: make({ path: 'm18 15-6-6-6 6', glyph: '⌃' }),\n alertTriangle: make({\n path: 'M12 9v4 M12 17h.01 M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z',\n glyph: '⚠',\n }),\n info: make({\n path: 'M12 8h.01 M11 12h1v4h1 M12 22C6.48 22 2 17.52 2 12 2 6.48 6.48 2 12 2c5.52 0 10 4.48 10 10 0 5.52-4.48 10-10 10z',\n glyph: 'ⓘ',\n }),\n check: make({ path: 'M20 6 9 17l-5-5', glyph: '✓' }),\n x: make({ path: 'M18 6 6 18 M6 6l12 12', glyph: '✕' }),\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext } from 'react';\nimport { defaultSemanticIcons, type SemanticIcons } from './default-semantic-icons';\n\nexport const SemanticIconsContext = createContext<SemanticIcons>(defaultSemanticIcons);\nSemanticIconsContext.displayName = 'SemanticIconsContext';\n\nexport type SemanticIconsProviderProps = {\n icons?: Partial<SemanticIcons>;\n children?: ReactNode;\n};\n\nexport function SemanticIconsProvider({ icons, children }: SemanticIconsProviderProps) {\n const merged: SemanticIcons = icons ? { ...defaultSemanticIcons, ...icons } : defaultSemanticIcons;\n return <SemanticIconsContext.Provider value={merged}>{children}</SemanticIconsContext.Provider>;\n}\n","'use client';\n\nimport { useContext } from 'react';\nimport type { SemanticIcons } from './default-semantic-icons';\nimport { SemanticIconsContext } from './semantic-context';\n\nexport function useSemanticIcon<K extends keyof SemanticIcons>(name: K): SemanticIcons[K] {\n const icons = useContext(SemanticIconsContext);\n return icons[name];\n}\n","'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","'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","/**\n * Strip the `px` suffix from a CSS-flavored token value and return a\n * number, the form React Native style props expect for properties like\n * `borderRadius`, `paddingHorizontal`, `fontSize`, etc.\n *\n * The tokens package emits all dimensional tokens as `${number}px`\n * strings (it's the lingua franca for both CSS and Style Dictionary\n * consumers); inside RN we need the unitless number. RN-Web tolerates\n * both, but native is strict.\n *\n * Falls through unchanged for tokens that already came in as numbers\n * (forward-compat).\n *\n * Examples:\n * px('6px') → 6\n * px('1.5px') → 1.5\n * px(6) → 6\n * px('foo') → 0 (defensive — bad input shouldn't crash render)\n */\nexport function px(value: string | number): number {\n if (typeof value === 'number') {\n return value;\n }\n const n = Number.parseFloat(value);\n return Number.isFinite(n) ? n : 0;\n}\n","// cn — class-name merger. clsx-compatible shape.\n//\n// Intentionally does NOT deduplicate Tailwind conflicts (e.g. \"text-sm text-lg\").\n// That's `tailwind-merge`'s job; we defer adding it until a component actually\n// needs it, to keep the core tree-shakable and the runtime zero-dep.\n\nexport type ClassInput =\n | string\n | number\n | boolean\n | null\n | undefined\n | ClassInput[]\n | Record<string, boolean | number | null | undefined>;\n\nexport function cn(...inputs: ClassInput[]): string {\n const out: string[] = [];\n for (const input of inputs) {\n append(out, input);\n }\n return out.join(' ');\n}\n\nfunction append(out: string[], input: ClassInput): void {\n if (!input) {\n return;\n }\n if (typeof input === 'string') {\n if (input.length > 0) {\n out.push(input);\n }\n return;\n }\n if (typeof input === 'number') {\n return; // numbers are never class names\n }\n if (Array.isArray(input)) {\n for (const inner of input) {\n append(out, inner);\n }\n return;\n }\n if (typeof input === 'object') {\n for (const key of Object.keys(input)) {\n if (input[key]) {\n out.push(key);\n }\n }\n }\n}\n","'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AccordionType = 'single' | 'multiple';\n\ntype SingleProps = {\n /** One-at-a-time mode. */\n type: 'single';\n /** Controlled open value. Pass `null` (with `collapsible`) for \"nothing open\". */\n value?: string | null;\n /** Uncontrolled initial open value. */\n defaultValue?: string;\n /** Fires when the open value changes. Receives the new value (string), or `null` if collapsed. */\n onChange?: (next: string | null) => void;\n /** Allow closing the open item by clicking it again. @defaultValue false */\n collapsible?: boolean;\n};\n\ntype MultipleProps = {\n /** Any combination open. */\n type: 'multiple';\n /** Controlled list of open values. */\n value?: string[];\n /** Uncontrolled initial list of open values. */\n defaultValue?: string[];\n /** Fires when the open list changes. Receives the new list. */\n onChange?: (next: string[]) => void;\n /** No-op in `multiple` mode (items are always individually collapsible). */\n collapsible?: never;\n};\n\ntype CommonProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport type AccordionProps = (SingleProps | MultipleProps) & CommonProps;\n\ntype AccordionContextValue = {\n baseId: string;\n isOpen: (value: string) => boolean;\n toggle: (value: string) => void;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n moveFocus: (offset: 1 | -1, fromValue: string) => void;\n focusEdge: (edge: 'first' | 'last') => void;\n};\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nconst useAccordionContext = (label: string): AccordionContextValue => {\n const ctx = useContext(AccordionContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion>.`);\n }\n return ctx;\n};\n\ntype AccordionItemContextValue = {\n value: string;\n open: boolean;\n disabled: boolean;\n triggerId: string;\n contentId: string;\n};\n\nconst AccordionItemContext = createContext<AccordionItemContextValue | null>(null);\n\nconst useAccordionItemContext = (label: string): AccordionItemContextValue => {\n const ctx = useContext(AccordionItemContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <Accordion.Item>.`);\n }\n return ctx;\n};\n\n/**\n * Vertically stacked, individually expandable sections. Compose:\n *\n * <Accordion type=\"single\" defaultValue=\"overview\" collapsible>\n * <Accordion.Item value=\"overview\">\n * <Accordion.Trigger>Overview</Accordion.Trigger>\n * <Accordion.Content>...</Accordion.Content>\n * </Accordion.Item>\n * </Accordion>\n *\n * Modes:\n * - `single` — at most one item open. Pass `collapsible` to allow closing the\n * open item.\n * - `multiple` — any combination open. `value` / `defaultValue` are arrays.\n *\n * Controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) both\n * supported. Triggers are real `<button>`s with full keyboard nav: ArrowDown /\n * ArrowUp move focus, Home / End jump to first / last, Enter / Space toggle.\n */\nconst AccordionRoot = (props: AccordionProps) => {\n const baseId = useId();\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n const orderRef = useRef<string[]>([]);\n\n // Pull out the props we always need; the discriminated union handlers below\n // narrow on `type` for the actual state logic.\n const { type, children, className, testID } = props;\n\n // Single-mode internal state. We always allocate both state slots so the\n // hook order stays stable across re-renders regardless of `type`.\n const [singleInner, setSingleInner] = useState<string | null>(\n type === 'single' ? (props.defaultValue ?? null) : null\n );\n const [multipleInner, setMultipleInner] = useState<string[]>(type === 'multiple' ? (props.defaultValue ?? []) : []);\n\n const singleControlled = type === 'single' && props.value !== undefined;\n const multipleControlled = type === 'multiple' && props.value !== undefined;\n\n const singleCurrent = type === 'single' ? (singleControlled ? (props.value ?? null) : singleInner) : null;\n const multipleCurrent = type === 'multiple' ? (multipleControlled ? (props.value ?? []) : multipleInner) : [];\n\n const isOpen = useCallback(\n (v: string) => {\n if (type === 'single') {\n return singleCurrent === v;\n }\n return multipleCurrent.includes(v);\n },\n [type, singleCurrent, multipleCurrent]\n );\n\n const toggle = useCallback(\n (v: string) => {\n if (type === 'single') {\n const next = singleCurrent === v ? (props.collapsible ? null : singleCurrent) : v;\n if (next === singleCurrent) {\n return;\n }\n if (!singleControlled) {\n setSingleInner(next);\n }\n props.onChange?.(next);\n } else {\n const has = multipleCurrent.includes(v);\n const next = has ? multipleCurrent.filter((x) => x !== v) : [...multipleCurrent, v];\n if (!multipleControlled) {\n setMultipleInner(next);\n }\n props.onChange?.(next);\n }\n },\n // The handler needs the latest snapshot of every prop — `props` is a\n // discriminated union so spreading it into the deps is the cleanest\n // way to keep both branches honest.\n [type, singleCurrent, multipleCurrent, singleControlled, multipleControlled, props]\n );\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const moveFocus = useCallback((offset: 1 | -1, fromValue: string) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = order.indexOf(fromValue);\n const start = idx === -1 ? 0 : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (!next) {\n return;\n }\n refs.current.get(next)?.current?.focus?.();\n }, []);\n\n const focusEdge = useCallback((edge: 'first' | 'last') => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const target = edge === 'first' ? order[0] : order[order.length - 1];\n if (!target) {\n return;\n }\n refs.current.get(target)?.current?.focus?.();\n }, []);\n\n const ctxValue = useMemo<AccordionContextValue>(\n () => ({ baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge }),\n [baseId, isOpen, toggle, register, unregister, moveFocus, focusEdge]\n );\n\n return (\n <AccordionContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col w-full', className)}\n style={{ flexDirection: 'column', width: '100%' }}\n >\n {children}\n </View>\n </AccordionContext.Provider>\n );\n};\n\nexport type AccordionItemProps = {\n /** Stable identifier — links the item to `value` / `defaultValue` on the parent. */\n value: string;\n /** Disable expansion of this item. The trigger remains focusable for nav consistency. */\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nconst ITEM_BASE: ViewStyle = {\n borderBottomWidth: 1,\n flexDirection: 'column',\n};\n\n// Layout-only constants for the trigger / content; theme-driven sizes are\n// merged in inside the component below.\nconst TRIGGER_LAYOUT_BASE: ViewStyle = {\n minHeight: 44, // component-density literal — not from theme\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n};\n\nconst CONTENT_INNER_LAYOUT_BASE: ViewStyle = {\n // Padding values come from theme inside AccordionContent.\n};\n\n/** A single expandable section. Wraps an `Accordion.Trigger` and `Accordion.Content`. */\nexport const AccordionItem = ({ value, disabled = false, children, className, testID }: AccordionItemProps) => {\n const ctx = useAccordionContext('Accordion.Item');\n const colors = useThemeColors();\n const open = ctx.isOpen(value);\n\n const itemCtx = useMemo<AccordionItemContextValue>(\n () => ({\n value,\n open,\n disabled,\n triggerId: `${ctx.baseId}-trigger-${value}`,\n contentId: `${ctx.baseId}-content-${value}`,\n }),\n [value, open, disabled, ctx.baseId]\n );\n\n return (\n <AccordionItemContext.Provider value={itemCtx}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex-col border-b border-semantic-border-default', className)}\n style={[ITEM_BASE, { borderBottomColor: colors.semantic.border.default }]}\n >\n {children}\n </View>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type AccordionTriggerProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The clickable row that toggles its item open / closed. Renders a real\n * `<button>` (via Pressable) and wires `aria-expanded` + `aria-controls` to\n * the matching `Accordion.Content`.\n */\nexport const AccordionTrigger = ({ children, className, testID }: AccordionTriggerProps) => {\n const ctx = useAccordionContext('Accordion.Trigger');\n const item = useAccordionItemContext('Accordion.Trigger');\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const triggerStyle: ViewStyle = {\n ...TRIGGER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingVertical: px(colors.spacing['3']),\n gap: px(colors.spacing['3']),\n };\n\n useEffect(() => {\n ctx.register(item.value, ownRef);\n return () => ctx.unregister(item.value);\n }, [ctx, item.value]);\n\n const onPress = useCallback(() => {\n if (item.disabled) {\n return;\n }\n ctx.toggle(item.value);\n }, [ctx, item.value, item.disabled]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n ctx.moveFocus(1, item.value);\n return;\n case 'ArrowUp':\n event.preventDefault();\n ctx.moveFocus(-1, item.value);\n return;\n case 'Home':\n event.preventDefault();\n ctx.focusEdge('first');\n return;\n case 'End':\n event.preventDefault();\n ctx.focusEdge('last');\n return;\n case 'Enter':\n case ' ': {\n event.preventDefault();\n if (!item.disabled) {\n ctx.toggle(item.value);\n }\n return;\n }\n }\n },\n [ctx, item.value, item.disabled]\n );\n\n // CSS transition for the chevron rotation on web. On native, RN expects\n // an array of transform objects (`[{ rotate: '180deg' }]`), so we branch\n // by platform to keep both ends rendering correctly. The web branch also\n // adds a CSS transition for a smooth rotation; native snaps (consumers\n // who want a spring can compose their own).\n const chevronStyle =\n Platform.OS === 'web'\n ? ({\n transition: 'transform 200ms ease',\n transform: `rotate(${item.open ? 180 : 0}deg)`,\n } as unknown as ViewStyle)\n : ({ transform: [{ rotate: item.open ? '180deg' : '0deg' }] } as ViewStyle);\n\n const triggerProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'button',\n accessibilityRole: 'button',\n 'aria-expanded': item.open,\n 'aria-controls': item.contentId,\n 'aria-disabled': item.disabled || undefined,\n id: item.triggerId,\n // Every trigger sits in the tab order — pressing Tab moves through\n // the accordion sequentially, then arrow keys take over once focused.\n tabIndex: 0,\n onPress,\n onKeyDown: handleKeyDown,\n ...(item.disabled ? { disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n return (\n <Pressable\n {...triggerProps}\n className={cn(\n 'flex-row items-center justify-between gap-3 px-4 py-3 min-h-[44px] hover:bg-semantic-background-subtle',\n item.disabled ? 'opacity-50' : 'opacity-100',\n className\n )}\n style={[triggerStyle, item.disabled ? { opacity: 0.5 } : null]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n flexShrink: 1,\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n <View aria-hidden={true} style={chevronStyle}>\n <defaultSemanticIcons.chevronDown size={18} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n );\n};\n\nexport type AccordionContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n /**\n * Keep the content mounted even when collapsed. Useful for forms that\n * shouldn't lose state, or content that's expensive to mount.\n * @defaultValue false\n */\n forceMount?: boolean;\n};\n\n// Animation timing — mirrors the Switch slide and the web CSS\n// transition exactly so the accordion feels identical on web and native.\nconst ACCORDION_ANIM_DURATION_MS = 200;\n\n/**\n * The collapsible body. On web it always mounts but slides open / closed\n * via an animated max-height + opacity transition (200ms ease). On native\n * it mounts in a measure-pass on first render to capture the natural\n * content height, then animates `height` + `opacity` via the shared\n * `useAnimatedNumber` primitive (200ms, cubic-bezier(0.16, 1, 0.3, 1) —\n * matches the Switch thumb slide).\n *\n * Implementation note: the web-side height + transition styles are pushed\n * onto the outer wrapper's DOM node via a ref + useEffect rather than\n * through the View's `style` prop. Reason: rn-web's style filter drops\n * keys it doesn't recognise as RN style props (`transition`, `maxHeight`\n * shorthand, etc.), taking the whole fragment with them. Direct DOM\n * mutation bypasses that filter — same trick used by Dialog's backdrop\n * blur.\n */\nexport const AccordionContent = ({\n children,\n className,\n testID,\n forceMount: _forceMount = false,\n}: AccordionContentProps) => {\n const item = useAccordionItemContext('Accordion.Content');\n const colors = useThemeColors();\n const wrapperRef = useRef<HTMLElement | null>(null);\n const innerRef = useRef<HTMLElement | null>(null);\n // Natural (open-state) height of the content, captured on first\n // layout. Re-captured if the layout reports a different size while\n // open (e.g. dynamic content).\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\n const innerStyle: ViewStyle = {\n ...CONTENT_INNER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['4']),\n paddingTop: px(colors.spacing['1']),\n paddingBottom: px(colors.spacing['3']),\n };\n\n // Slide open/close on web. We measure the natural height of the inner\n // content each time the open state flips, then animate the wrapper's\n // maxHeight to/from 0. Setting maxHeight: 'none' after the transition\n // would let the content grow if it later changes — but for the v0\n // accordion we expect static content, so we leave maxHeight at the\n // measured value (good enough; resize observer can come later).\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const wrapper = wrapperRef.current;\n const inner = innerRef.current;\n if (!wrapper || !inner) {\n return;\n }\n\n // First-render shortcut: skip the animation when an item starts\n // already open (avoids the \"all items open then animate closed\"\n // flash on mount).\n const isFirstPaint = wrapper.dataset.noriPainted !== '1';\n wrapper.dataset.noriPainted = '1';\n\n wrapper.style.overflow = 'hidden';\n wrapper.style.transitionProperty = 'max-height, opacity';\n wrapper.style.transitionDuration = `${ACCORDION_ANIM_DURATION_MS}ms`;\n wrapper.style.transitionTimingFunction = 'cubic-bezier(0.16, 1, 0.3, 1)';\n\n if (item.open) {\n const target = inner.scrollHeight;\n if (isFirstPaint) {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n return;\n }\n // Animate from current measured 0px to the target height.\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n // Force a reflow so the start state actually applies before\n // we set the end state — otherwise the browser collapses\n // both into a single repaint and skips the animation.\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = `${target}px`;\n wrapper.style.opacity = '1';\n });\n } else {\n // Going from open → closed. Set the explicit current height\n // first so we have something to transition FROM (auto/none\n // doesn't transition).\n const current = inner.scrollHeight;\n wrapper.style.maxHeight = `${current}px`;\n wrapper.style.opacity = '1';\n void wrapper.offsetHeight;\n requestAnimationFrame(() => {\n wrapper.style.maxHeight = '0px';\n wrapper.style.opacity = '0';\n });\n }\n }, [item.open]);\n\n // Native height + opacity animation. Driven by `useAnimatedNumber`,\n // which dispatches per-property to a static-key reanimated worklet\n // (the plugin can't serialize closures over computed keys, so each\n // property gets its own static-key useAnimatedStyle inside the hook).\n //\n // Target values are derived from open + measured size. Before\n // measurement we still call the hooks (hook order must stay\n // stable); they animate to/from 0 which becomes a no-op until the\n // first onLayout fires.\n const targetHeight = item.open ? (measuredHeight ?? 0) : 0;\n const targetOpacity = item.open ? 1 : 0;\n const heightAnim = useAnimatedNumber('height', targetHeight, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n const opacityAnim = useAnimatedNumber('opacity', targetOpacity, {\n duration: ACCORDION_ANIM_DURATION_MS,\n });\n\n const onInnerLayout = useCallback(\n (e: LayoutChangeEvent) => {\n if (Platform.OS === 'web') {\n return;\n }\n const next = e.nativeEvent.layout.height;\n if (next > 0 && next !== measuredHeight) {\n setMeasuredHeight(next);\n }\n },\n [measuredHeight]\n );\n\n // Native path: always mount the inner so we can measure its natural\n // height once. Before measurement, we render with `position:\n // absolute, opacity: 0` so the layout pass runs off-screen and\n // doesn't affect the surrounding flow (avoids the \"flash of fully-\n // open content\" on first paint of an initially-closed item).\n // After measurement, the outer Animated.View drives height +\n // opacity together.\n if (Platform.OS !== 'web') {\n const animatedWrapperStyle: ViewStyle = {\n overflow: 'hidden',\n };\n // Pre-measurement: render the inner off-screen for one layout\n // pass. The wrapper claims 0 height in the flow so the next\n // sibling is positioned correctly until we know the real size.\n if (measuredHeight === null) {\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, { height: 0 }]}\n className={cn('overflow-hidden', className)}\n >\n <View\n onLayout={onInnerLayout}\n className={cn('px-4 pt-1 pb-3')}\n // Absolute + left/right:0 stretches the measurement\n // pass to the parent's full width, so wrapping text\n // measures at its REAL natural height. Without\n // left/right, Yoga gives an absolute child width 0\n // and the measurement collapses to a few pixels.\n style={[innerStyle, { position: 'absolute', left: 0, right: 0, opacity: 0 }]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n );\n }\n return (\n <AnimatedView\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"none\"\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n style={[animatedWrapperStyle, heightAnim as object]}\n className={cn('overflow-hidden', className)}\n >\n <AnimatedView style={opacityAnim as object}>\n {/* No `onLayout` on this inner — once we've captured\n the natural height in the measurement pass above,\n re-measuring here during the animation would see\n the CLIPPED height (the parent is mid-transition\n between 0 and the target) and clobber\n `measuredHeight` with that smaller value, freezing\n the open state at one line. Single-shot measurement\n is fine for static content; remeasuring on content\n change is a follow-up. */}\n <View className={cn('px-4 pt-1 pb-3')} style={innerStyle}>\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </AnimatedView>\n </AnimatedView>\n );\n }\n\n return (\n <View\n ref={(node: unknown) => {\n wrapperRef.current = node as HTMLElement | null;\n }}\n {...(testID !== undefined ? { testID } : {})}\n role=\"region\"\n accessibilityRole=\"none\"\n id={item.contentId}\n aria-labelledby={item.triggerId}\n aria-hidden={!item.open}\n className={cn('overflow-hidden', className)}\n >\n <View\n ref={(node: unknown) => {\n innerRef.current = node as HTMLElement | null;\n }}\n className={cn('px-4 pt-1 pb-3')}\n style={innerStyle}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n\n/**\n * Public `Accordion` value — the root function plus its `.Item`, `.Trigger`,\n * and `.Content` static members. `Object.assign` produces a value whose\n * inferred type carries the static properties, so `.d.ts` consumers can\n * write `<Accordion.Item>` without a separate import.\n */\nexport const Accordion = Object.assign(AccordionRoot, {\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Content: AccordionContent,\n});\n","'use client';\n\nimport type { ComponentType, ReactNode } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\nexport type AlertProps = {\n /**\n * Severity of the alert. Drives the color tone and the default icon.\n * @defaultValue 'info'\n */\n tone?: AlertTone;\n /** Bolded heading line. Optional — provide one of title or description. */\n title?: string;\n /** Body text below the title. */\n description?: string;\n /**\n * When provided, renders a close button in the top-right that calls back\n * when pressed. The Alert itself doesn't track dismissed state — the\n * parent decides whether to keep rendering.\n */\n onDismiss?: () => void;\n /**\n * Override the tone's default icon. Pass `null` to render no icon at\n * all (rare — the icon doubles as the visual severity cue).\n */\n icon?: ReactNode;\n /** Additional content below title/description. */\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\ntype IconType = ComponentType<{ size?: number; color?: string }>;\ntype TonePalette = { bg: string; border: string; fg: string; iconBg: string; defaultIcon: IconType };\n\n// Light/dark soft palettes per tone. Light variants use the familiar\n// pastel scale (Tailwind 50/200/800); dark variants use the deep 950/700/100\n// scale so the alert reads as a calm, on-tone surface against either\n// background — never a harsh white card on a dark page.\nfunction tonePalettes(\n scheme: 'light' | 'dark',\n primary: { '50': string; '200': string; '700': string; '800': string; '900': string; '100': string },\n success: string,\n warning: string,\n danger: string\n): Record<AlertTone, TonePalette> {\n if (scheme === 'dark') {\n return {\n info: {\n bg: primary['900'],\n border: primary['700'],\n fg: primary['100'],\n iconBg: primary['200'],\n defaultIcon: defaultSemanticIcons.info,\n },\n success: {\n bg: '#052e16',\n border: '#14532d',\n fg: '#bbf7d0',\n iconBg: success,\n defaultIcon: defaultSemanticIcons.checkmark,\n },\n warning: {\n bg: '#422006',\n border: '#78350f',\n fg: '#fef3c7',\n iconBg: warning,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n danger: {\n bg: '#450a0a',\n border: '#7f1d1d',\n fg: '#fecaca',\n iconBg: danger,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n };\n }\n return {\n info: {\n bg: primary['50'],\n border: primary['200'],\n fg: primary['800'],\n iconBg: primary['700'],\n defaultIcon: defaultSemanticIcons.info,\n },\n success: {\n bg: '#f0fdf4',\n border: '#bbf7d0',\n fg: '#166534',\n iconBg: success,\n defaultIcon: defaultSemanticIcons.checkmark,\n },\n warning: {\n bg: '#fefce8',\n border: '#fde68a',\n fg: '#92400e',\n iconBg: warning,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n danger: {\n bg: '#fef2f2',\n border: '#fecaca',\n fg: '#991b1b',\n iconBg: danger,\n defaultIcon: defaultSemanticIcons.alertTriangle,\n },\n };\n}\n\n// Layout-only base; theme-driven dimensions (gap/padding/radius) are merged\n// inside the component so a custom theme reshapes the alert.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'flex-start',\n borderWidth: 1,\n};\n\n/**\n * Status banner with an icon, title, optional description, optional dismiss.\n * Use for inline messages that the reader should notice but doesn't need to\n * action immediately (use a Dialog when you need a forced acknowledgement).\n *\n * Color tone flips automatically with the active color scheme — light\n * pastel surface in light mode, deep on-tone surface in dark.\n */\nexport const Alert = ({\n tone = 'info',\n title,\n description,\n onDismiss,\n icon,\n children,\n className,\n testID,\n}: AlertProps) => {\n const colors = useThemeColors();\n const scheme = useColorScheme();\n const palette = tonePalettes(\n scheme,\n colors.color.primary,\n colors.color.success,\n colors.color.warning,\n colors.color.danger\n )[tone];\n const IconComponent = palette.defaultIcon;\n const containerStyle: ViewStyle = {\n ...CONTAINER_LAYOUT_BASE,\n gap: px(colors.spacing['3']),\n padding: px(colors.spacing['3']), // closest token to legacy 14px\n borderRadius: px(colors.radius.lg),\n backgroundColor: palette.bg,\n borderColor: palette.border,\n };\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"alert\"\n accessibilityRole=\"alert\"\n className={cn('flex-row items-start gap-3 rounded-md border p-3.5', className)}\n style={containerStyle}\n >\n {icon === null ? null : icon !== undefined ? (\n icon\n ) : (\n <View\n aria-hidden={true}\n style={{\n // 20×20 icon hit area — component-density literal — not from theme\n width: 20,\n height: 20,\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: 2,\n }}\n >\n <IconComponent size={20} color={palette.iconBg} />\n </View>\n )}\n <View style={{ flex: 1, gap: 2 }}>\n {title !== undefined ? (\n <RNText\n style={{\n color: palette.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.semibold as '600',\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {title}\n </RNText>\n ) : null}\n {description !== undefined ? (\n <RNText\n style={{\n color: palette.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n opacity: 0.85,\n }}\n >\n {description}\n </RNText>\n ) : null}\n {children}\n </View>\n {onDismiss !== undefined ? (\n <Pressable\n onPress={onDismiss}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel=\"Dismiss\"\n aria-label=\"Dismiss\"\n style={{\n // 24×24 close button hit area — component-density literal — not from theme\n width: 24,\n height: 24,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: px(colors.radius.sm),\n marginTop: -2,\n }}\n >\n <defaultSemanticIcons.close size={16} color={palette.fg} />\n </Pressable>\n ) : null}\n </View>\n );\n};\n","// composeRefs — merges multiple React refs (callback or object) into a single callback.\n// Derived from Radix UI's approach; reimplemented here so we don't take a Radix dependency.\n\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\nexport function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (ref == null) {\n continue;\n }\n if (typeof ref === 'function') {\n ref(node);\n } else {\n // React's MutableRefObject typing — we assign .current directly.\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n","import type { CSSProperties, ReactElement, Ref } from 'react';\nimport { Children, cloneElement, forwardRef, isValidElement } from 'react';\nimport { composeRefs } from './compose-refs';\n\ntype AnyProps = Record<string, unknown>;\n\nexport type SlotProps = {\n children?: React.ReactNode;\n} & AnyProps;\n\nexport const Slot = forwardRef<unknown, SlotProps>(function Slot(props, forwardedRef) {\n const { children, ...slotProps } = props;\n\n if (!isValidElement(children)) {\n return null;\n }\n\n // Assert that children is a single React element with props — we've narrowed above.\n const child = Children.only(children) as ReactElement<AnyProps> & { ref?: Ref<unknown> };\n const merged = mergeProps(slotProps, child.props);\n\n // Merge refs: Slot's forwarded ref + the child's own ref (if any).\n const childRef = (child as unknown as { ref?: Ref<unknown> }).ref;\n if (forwardedRef || childRef) {\n (merged as AnyProps).ref = composeRefs(forwardedRef, childRef);\n }\n\n return cloneElement(child, merged);\n});\nSlot.displayName = 'Slot';\n\nfunction mergeProps(outer: AnyProps, inner: AnyProps): AnyProps {\n // Inner (child) wins for everything except: className (concatenated), style (merged), and\n // event handlers (composed — outer runs first, then inner).\n const merged: AnyProps = { ...outer };\n\n for (const key of Object.keys(inner)) {\n const outerValue = outer[key];\n const innerValue = inner[key];\n\n if (key === 'className' || key === 'class') {\n merged[key] = joinClass(outerValue, innerValue);\n continue;\n }\n\n if (key === 'style') {\n merged[key] = {\n ...(outerValue as CSSProperties | undefined),\n ...(innerValue as CSSProperties | undefined),\n };\n continue;\n }\n\n if (isEventHandler(key, outerValue, innerValue)) {\n merged[key] = composeHandlers(outerValue as Fn, innerValue as Fn);\n continue;\n }\n\n merged[key] = innerValue;\n }\n\n return merged;\n}\n\nfunction joinClass(outer: unknown, inner: unknown): string | undefined {\n const a = typeof outer === 'string' ? outer : '';\n const b = typeof inner === 'string' ? inner : '';\n const joined = [a, b].filter(Boolean).join(' ');\n return joined.length > 0 ? joined : undefined;\n}\n\ntype Fn = (...args: unknown[]) => unknown;\n\nfunction isEventHandler(key: string, outer: unknown, inner: unknown): boolean {\n if (!key.startsWith('on') || key.length < 3) {\n return false;\n }\n if (key[2] !== key[2]?.toUpperCase()) {\n return false;\n }\n return typeof outer === 'function' && typeof inner === 'function';\n}\n\nfunction composeHandlers(outer: Fn, inner: Fn): Fn {\n return (...args: unknown[]) => {\n outer(...args);\n inner(...args);\n };\n}\n","'use client';\n\n// Web variant of the dialog blur backdrop. On web, the overlay's CSS\n// `backdrop-filter: blur(...)` (set directly on the DOM node by\n// Dialog/AlertDialog) handles the frosted look — there's nothing extra\n// to render here.\n//\n// Metro picks `blur-backdrop.native.tsx` for native bundles, which\n// statically imports `expo-blur`. The split keeps the static import\n// off the web bundle so web consumers don't drag a native module\n// through their build.\n\nimport type { ReactElement } from 'react';\nimport type { ViewProps } from 'react-native';\n\nexport type BlurBackdropProps = {\n /** 0..100. Maps to expo-blur's `intensity`. */\n intensity?: number;\n /** Match the active color scheme so the blur tint reads naturally. */\n tint?: 'light' | 'dark' | 'default';\n /** Style passed straight through (typically StyleSheet.absoluteFill). */\n style?: ViewProps['style'];\n};\n\nexport const BlurBackdrop = (_props: BlurBackdropProps): ReactElement | null => {\n return null;\n};\n","'use client';\n\nimport {\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Modal, Platform, Pressable, Text as RNText, StyleSheet, View } from 'react-native';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { BlurBackdrop } from '../Dialog/blur-backdrop';\n\ntype AlertDialogContextValue = {\n open: boolean;\n setOpen: (next: boolean) => void;\n titleId: string;\n descriptionId: string;\n triggerRef: { current: HTMLElement | null };\n cancelRef: { current: HTMLElement | null };\n};\n\nconst AlertDialogContext = createContext<AlertDialogContextValue | null>(null);\n\nconst useAlertDialogContext = (label: string): AlertDialogContextValue => {\n const ctx = useContext(AlertDialogContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <AlertDialog>.`);\n }\n return ctx;\n};\n\nexport type AlertDialogProps = {\n /** Controlled open state. */\n open?: boolean;\n /** Uncontrolled initial open state. @defaultValue false */\n defaultOpen?: boolean;\n /** Fires with the new open state. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\n/**\n * Confirmation dialog that **forces a user response**. Use for destructive\n * or otherwise irreversible actions (\"Delete project?\", \"Sign out everyone?\").\n *\n * Differs from `Dialog` in two important ways:\n * - The backdrop click does **not** dismiss.\n * - The Escape key does **not** dismiss.\n *\n * The user must press `AlertDialogCancel` or `AlertDialogAction` to close.\n * Initial focus lands on Cancel — the less destructive choice — so a stray\n * Enter keypress doesn't fire the destructive action.\n *\n * For non-destructive content (forms, info, settings), prefer `Dialog` —\n * it allows Escape and click-outside to dismiss, which is the expected\n * affordance for forgettable interactions.\n */\nconst AlertDialogRoot = ({ open, defaultOpen = false, onOpenChange, children }: AlertDialogProps) => {\n const [inner, setInner] = useState<boolean>(defaultOpen);\n const isControlled = open !== undefined;\n const current = isControlled ? open : inner;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setInner(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange]\n );\n\n const baseId = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const cancelRef = useRef<HTMLElement | null>(null);\n\n const ctxValue: AlertDialogContextValue = {\n open: current,\n setOpen,\n titleId: `${baseId}-title`,\n descriptionId: `${baseId}-description`,\n triggerRef,\n cancelRef,\n };\n\n return <AlertDialogContext.Provider value={ctxValue}>{children}</AlertDialogContext.Provider>;\n};\n\nexport type AlertDialogTriggerProps = {\n /** Render the child as the trigger (Slot pattern). Default true. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Element that opens the alert dialog when activated. `asChild` by default\n * so any element (Button, Link, custom Pressable) becomes the trigger.\n */\nexport const AlertDialogTrigger = ({ asChild = true, children, className, testID }: AlertDialogTriggerProps) => {\n const ctx = useAlertDialogContext('AlertDialogTrigger');\n const onPress = useCallback(() => ctx.setOpen(true), [ctx]);\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n // Pass both onClick (web HTML button) and onPress (RN Pressable / our\n // own Button) so the trigger fires regardless of the wrapped child's\n // event model.\n const fire = (existing: ((e: unknown) => void) | undefined) => (event: unknown) => {\n existing?.(event);\n ctx.setOpen(true);\n };\n return (\n <Slot\n ref={(node: HTMLElement | null) => {\n ctx.triggerRef.current = node;\n }}\n onClick={fire(child.props.onClick as ((e: unknown) => void) | undefined)}\n onPress={fire(child.props.onPress as ((e: unknown) => void) | undefined)}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n return (\n <Pressable\n ref={(node) => {\n ctx.triggerRef.current = node as unknown as HTMLElement | null;\n }}\n onPress={onPress}\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n};\n\n// On native, raw strings rendered as children of a non-Text component\n// throw \"Text strings must be rendered within a <Text> component\". On\n// web, react-native-web silently tolerates it. Wrap any string/number\n// children in an RNText so the same JSX renders cleanly on both\n// platforms. Non-string children are passed through unchanged.\nfunction wrapStringChildren(children: ReactNode): ReactNode {\n if (typeof children === 'string' || typeof children === 'number') {\n return <RNText>{children}</RNText>;\n }\n return children;\n}\n\n// Same scrim + blur recipe as Dialog (see Dialog.tsx). 24% black + 4px\n// blur leaves the page text \"almost readable\" behind the dialog rather\n// than fully obscured. Native keeps a flat scrim — RN doesn't have\n// backdrop-filter and the native shim would be an extra peer dep.\nconst SCRIM_COLOR = 'rgba(0, 0, 0, 0.24)';\nconst BLUR_AMOUNT = 4;\n\n// Static overlay layout. The animatable scrim color + backdrop-filter\n// are pushed onto the overlay's DOM ref via useEffect inside the\n// component because rn-web's style filter drops keys it doesn't\n// recognise as RN style props (backdropFilter, transitionProperty).\n// See the Dialog backdrop-blur implementation for the same trick.\nconst OVERLAY_LAYOUT_BASE: ViewStyle = {\n position: Platform.OS === 'web' ? ('fixed' as unknown as 'absolute') : 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n // Native overlay stays transparent — the BlurBackdrop sibling renders\n // dim + frosted-glass via expo-blur, and a SCRIM_COLOR layer on top\n // would hide the blur. Web keeps its CSS overlay path (the imperative\n // useEffect below sets backgroundColor + backdrop-filter on web).\n ...(Platform.OS === 'web' ? ({ zIndex: 50 } as ViewStyle) : { backgroundColor: 'transparent' }),\n};\n\n// Layout / animation only; theme-driven dimensions are merged inside\n// AlertDialogContent.\nconst CONTENT_LAYOUT_BASE: ViewStyle = {\n width: '100%',\n maxWidth: 480, // component-density literal — not from theme\n ...(Platform.OS === 'web'\n ? ({\n boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n // Subtle scale-in: 0.95 → 1 over 150ms. Honors prefers-reduced-motion\n // via the media query below — set as a CSS variable so the keyframe\n // can be disabled without remounting.\n animationName: 'nori-alert-dialog-in',\n animationDuration: '150ms',\n animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n animationFillMode: 'both',\n } as ViewStyle)\n : { elevation: 24 }),\n};\n\nconst FOCUSABLE_SELECTOR =\n '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\"])';\n\n/**\n * react-native-web renders our `<Button>` (which wraps `Pressable`) as a\n * `<div role=\"button\">` without a tabindex. That's invisible to native focus\n * APIs in browsers AND jsdom. Poke a `tabindex=\"0\"` onto the node so\n * `.focus()` actually sets `document.activeElement`.\n *\n * Idempotent — only sets it when missing.\n */\nfunction ensureFocusable(node: HTMLElement | null): void {\n if (!node) {\n return;\n }\n if (node.hasAttribute('tabindex')) {\n return;\n }\n node.setAttribute('tabindex', '0');\n}\n\nconst KEYFRAMES_STYLE_ID = 'nori-alert-dialog-keyframes';\nconst KEYFRAMES_CSS = `\n@keyframes nori-alert-dialog-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n}\n@media (prefers-reduced-motion: reduce) {\n [data-nori-alert-dialog-content] { animation: none !important; }\n}\n`;\n\nfunction ensureKeyframesInjected(): void {\n if (Platform.OS !== 'web') {\n return;\n }\n if (typeof document === 'undefined') {\n return;\n }\n if (document.getElementById(KEYFRAMES_STYLE_ID)) {\n return;\n }\n const style = document.createElement('style');\n style.id = KEYFRAMES_STYLE_ID;\n style.textContent = KEYFRAMES_CSS;\n document.head.appendChild(style);\n}\n\nexport type AlertDialogContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The visible alert dialog surface — overlay + centered card. Renders only\n * while open. On web: traps focus inside, locks body scroll, restores focus\n * on close. Crucially, neither overlay click nor Escape closes — the user\n * MUST press an explicit Cancel/Action button.\n */\nexport const AlertDialogContent = ({ children, className, testID }: AlertDialogContentProps) => {\n const ctx = useAlertDialogContext('AlertDialogContent');\n const colors = useThemeColors();\n const scheme = useColorScheme();\n const contentRef = useRef<HTMLDivElement | null>(null);\n const overlayDomRef = useRef<HTMLElement | null>(null);\n const overlayStyle: ViewStyle = {\n ...OVERLAY_LAYOUT_BASE,\n padding: px(colors.spacing['4']),\n };\n const contentStyle: ViewStyle = {\n ...CONTENT_LAYOUT_BASE,\n borderRadius: px(colors.radius.xl),\n padding: px(colors.spacing['6']),\n gap: px(colors.spacing['3']),\n };\n // Two-phase mount: render overlay at scrim 0 / blur 0 first, then\n // flip to target values on the next frame so CSS transitions have a\n // start state to interpolate from. Same pattern as Dialog.\n const [entered, setEntered] = useState(false);\n useEffect(() => {\n if (Platform.OS !== 'web') {\n setEntered(true);\n return;\n }\n if (!ctx.open) {\n setEntered(false);\n return;\n }\n const id = requestAnimationFrame(() => setEntered(true));\n return () => cancelAnimationFrame(id);\n }, [ctx.open]);\n\n // Animated scrim + backdrop-filter — pushed onto the overlay's DOM\n // node directly because rn-web's style filter drops the\n // transition/backdrop-filter keys when passed via the View's `style`\n // prop. Web only; native uses the flat scrim baked into\n // OVERLAY_BASE_STYLE.\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const node = overlayDomRef.current;\n if (!node) {\n return;\n }\n node.style.transitionProperty = 'background-color, backdrop-filter, -webkit-backdrop-filter';\n node.style.transitionDuration = '150ms, 200ms, 200ms';\n node.style.transitionTimingFunction = 'ease-out';\n if (entered) {\n node.style.backgroundColor = SCRIM_COLOR;\n node.style.backdropFilter = `blur(${BLUR_AMOUNT}px)`;\n node.style.setProperty('-webkit-backdrop-filter', `blur(${BLUR_AMOUNT}px)`);\n } else {\n node.style.backgroundColor = 'rgba(0, 0, 0, 0)';\n node.style.backdropFilter = 'blur(0px)';\n node.style.setProperty('-webkit-backdrop-filter', 'blur(0px)');\n }\n }, [entered]);\n\n useEffect(() => {\n if (!ctx.open) {\n return;\n }\n if (Platform.OS !== 'web') {\n return;\n }\n if (typeof document === 'undefined') {\n return;\n }\n\n ensureKeyframesInjected();\n\n const previouslyFocused = document.activeElement as HTMLElement | null;\n\n // Lock body scroll. Preserve the previous inline value so we don't\n // clobber a consumer-set lock.\n const prevBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n\n // Initial focus: prefer the Cancel button (least destructive default).\n // Fall back to first focusable. Only fall back to the container if\n // there's nothing focusable at all (an alertdialog with no actions\n // is a misuse — we still want it to receive keydown for the trap).\n const focusInitial = () => {\n const node = contentRef.current;\n if (!node) {\n return;\n }\n // Make every focusable target reachable up front. RN-Web Pressables\n // render as `<div role=\"button\">` without tabindex; without this\n // poke, programmatic `.focus()` on them is a no-op.\n const focusable = node.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR);\n for (const el of focusable) {\n ensureFocusable(el);\n }\n const cancel = ctx.cancelRef.current;\n if (cancel?.focus) {\n ensureFocusable(cancel);\n cancel.focus();\n return;\n }\n const first = focusable[0];\n if (first) {\n first.focus();\n } else {\n node.setAttribute('tabindex', '-1');\n node.focus();\n }\n };\n focusInitial();\n\n // Focus trap only — Escape does NOT close (alert dialog contract).\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Tab') {\n return;\n }\n const node = contentRef.current;\n if (!node) {\n return;\n }\n // Don't filter by `offsetParent` here: jsdom always reports `null`\n // for it (no layout engine), which would collapse the trap to the\n // currently focused element only. AlertDialog's content surface is\n // tightly controlled; trust the selector.\n const focusable = Array.from(node.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR));\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (!first || !last) {\n return;\n }\n // Make every focusable target reachable from jsdom too.\n for (const el of focusable) {\n ensureFocusable(el);\n }\n if (event.shiftKey) {\n if (document.activeElement === first || !node.contains(document.activeElement)) {\n event.preventDefault();\n last.focus();\n }\n } else if (document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.body.style.overflow = prevBodyOverflow;\n const restoreTo = ctx.triggerRef.current ?? previouslyFocused;\n restoreTo?.focus?.();\n };\n }, [ctx.open, ctx.triggerRef, ctx.cancelRef]);\n\n // RN Modal's `onRequestClose` fires on Android hardware back. We\n // intentionally make it a no-op: an alert dialog cannot be backed out\n // of without an explicit choice. A consumer that needs Android back to\n // mean \"cancel\" should wire it via their own action.\n const onRequestClose = useCallback(() => {\n /* intentional no-op — alert dialog requires explicit action */\n }, []);\n\n return (\n <Modal\n visible={ctx.open}\n transparent\n // Web: 'none' so RN's built-in fade doesn't fight our own\n // overlay/content transitions (its layer-level fade caused\n // backdrop-filter to \"snap in\" at the end on Dialog — same\n // failure mode applies here). Native keeps 'fade' since we\n // have no CSS transition path there.\n animationType={Platform.OS === 'web' ? 'none' : 'fade'}\n onRequestClose={onRequestClose}\n >\n {/* Native blur layer; renders nothing on web (CSS handles\n it) or when expo-blur isn't installed. */}\n <BlurBackdrop intensity={60} tint={scheme === 'dark' ? 'dark' : 'light'} style={StyleSheet.absoluteFill} />\n <View\n ref={(node) => {\n overlayDomRef.current = node as unknown as HTMLElement | null;\n }}\n accessibilityRole=\"none\"\n aria-hidden={true}\n style={overlayStyle}\n // Note: this is a <View>, not a <Pressable>. The overlay must NOT\n // dismiss on click for an alert dialog.\n >\n <View\n ref={(node) => {\n contentRef.current = node as unknown as HTMLDivElement | null;\n }}\n role=\"alertdialog\"\n accessibilityRole=\"alert\"\n aria-modal={true}\n aria-labelledby={ctx.titleId}\n aria-describedby={ctx.descriptionId}\n {...(testID !== undefined ? { testID } : {})}\n {...({ 'data-nori-alert-dialog-content': 'true' } as Record<string, string>)}\n className={cn('w-full max-w-md rounded-xl bg-semantic-background-elevated p-6 gap-3', className)}\n style={[contentStyle, { backgroundColor: colors.semantic.background.elevated }]}\n >\n <View\n className=\"flex-col gap-1.5\"\n style={{ flexDirection: 'column', gap: px(colors.spacing['2']) - 2 }}\n >\n {children}\n </View>\n </View>\n </View>\n </Modal>\n );\n};\n\nexport type AlertDialogTextProps = {\n children?: ReactNode;\n className?: string;\n};\n\n/** Heading inside AlertDialogContent. Wires `aria-labelledby`. */\nexport const AlertDialogTitle = ({ children, className }: AlertDialogTextProps) => {\n const ctx = useAlertDialogContext('AlertDialogTitle');\n const colors = useThemeColors();\n return (\n <RNText\n nativeID={ctx.titleId}\n id={ctx.titleId}\n role=\"heading\"\n aria-level={2}\n className={cn('text-lg font-semibold text-semantic-text-default', className)}\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.display,\n fontSize: px(colors.fontSize.lg),\n fontWeight: colors.fontWeight.semibold as '600',\n }}\n >\n {children}\n </RNText>\n );\n};\n\n/** Body description inside AlertDialogContent. Wires `aria-describedby`. */\nexport const AlertDialogDescription = ({ children, className }: AlertDialogTextProps) => {\n const ctx = useAlertDialogContext('AlertDialogDescription');\n const colors = useThemeColors();\n return (\n <RNText\n nativeID={ctx.descriptionId}\n id={ctx.descriptionId}\n className={cn('text-sm text-semantic-text-muted', className)}\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n );\n};\n\nexport type AlertDialogActionProps = {\n /** Render the child as the action (Slot pattern). Default true. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n /** Forwarded to the wrapped child / fallback Pressable. Fires before close. */\n onPress?: (event?: unknown) => void;\n};\n\n/**\n * The destructive / confirming action. Closes the dialog AND forwards\n * `onPress` to the consumer's handler so they can run the side effect.\n */\nexport const AlertDialogAction = ({ asChild = true, children, className, testID, onPress }: AlertDialogActionProps) => {\n const ctx = useAlertDialogContext('AlertDialogAction');\n const handle = useCallback(\n (event?: unknown) => {\n onPress?.(event);\n ctx.setOpen(false);\n },\n [ctx, onPress]\n );\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n // Wrap both event names so an HTML button (onClick) and an RN\n // Pressable / Button (onPress) both fire — and both still call the\n // child's own handler if present.\n const fire = (existing: ((e: unknown) => void) | undefined) => (event: unknown) => {\n existing?.(event);\n handle(event);\n };\n return (\n <Slot\n onClick={fire(child.props.onClick as ((e: unknown) => void) | undefined)}\n onPress={fire(child.props.onPress as ((e: unknown) => void) | undefined)}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n return (\n <Pressable\n onPress={handle}\n role=\"button\"\n accessibilityRole=\"button\"\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n};\n\nexport type AlertDialogCancelProps = {\n /** Render the child as the cancel button (Slot pattern). Default true. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n /** Forwarded to the wrapped child / fallback Pressable. Fires before close. */\n onPress?: (event?: unknown) => void;\n};\n\n/**\n * The cancel / dismiss action. Closes the dialog AND forwards `onPress`.\n * Receives initial focus inside `AlertDialogContent` — Cancel is the\n * least destructive default, so a stray Enter keypress can't fire the\n * destructive action.\n */\nexport const AlertDialogCancel = ({ asChild = true, children, className, testID, onPress }: AlertDialogCancelProps) => {\n const ctx = useAlertDialogContext('AlertDialogCancel');\n const handle = useCallback(\n (event?: unknown) => {\n onPress?.(event);\n ctx.setOpen(false);\n },\n [ctx, onPress]\n );\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n const fire = (existing: ((e: unknown) => void) | undefined) => (event: unknown) => {\n existing?.(event);\n handle(event);\n };\n return (\n <Slot\n ref={(node: HTMLElement | null) => {\n ctx.cancelRef.current = node;\n }}\n onClick={fire(child.props.onClick as ((e: unknown) => void) | undefined)}\n onPress={fire(child.props.onPress as ((e: unknown) => void) | undefined)}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n return (\n <Pressable\n ref={(node) => {\n ctx.cancelRef.current = node as unknown as HTMLElement | null;\n }}\n onPress={handle}\n role=\"button\"\n accessibilityRole=\"button\"\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n};\n\nexport type AlertDialogFooterProps = {\n children?: ReactNode;\n className?: string;\n};\n\n/** Convenience row for action buttons (right-aligned). */\nexport const AlertDialogFooter = ({ children, className }: AlertDialogFooterProps) => {\n const colors = useThemeColors();\n return (\n <View\n className={cn('mt-4 flex-row items-center justify-end gap-2', className)}\n style={{\n marginTop: px(colors.spacing['4']),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: px(colors.spacing['2']),\n }}\n >\n {children}\n </View>\n );\n};\n\n/**\n * Public `AlertDialog` value — the root function plus its `.Trigger`,\n * `.Content`, `.Title`, `.Description`, `.Footer`, `.Action`, and `.Cancel`\n * static members. `Object.assign` produces a value whose inferred type carries\n * the static properties, so `.d.ts` consumers can write `<AlertDialog.Content>`\n * without a separate import.\n */\nexport const AlertDialog = Object.assign(AlertDialogRoot, {\n Trigger: AlertDialogTrigger,\n Content: AlertDialogContent,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Footer: AlertDialogFooter,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n});\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { useState } from 'react';\nimport type { ImageStyle, ViewStyle } from 'react-native';\nimport { Image as RNImage, Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';\n\nexport type AvatarProps = {\n /** Image URL. When omitted or the load fails, the fallback renders instead. */\n src?: string;\n /**\n * Person/entity name. Used to derive initials for the fallback (first\n * letter of the first word + first letter of the last word, up to 2\n * characters). Also becomes the `alt` text on the image — set this\n * even when `src` loads cleanly.\n */\n name?: string;\n /**\n * Visual size. Maps to a fixed pixel diameter.\n * @defaultValue 'md'\n */\n size?: AvatarSize;\n /**\n * Custom fallback content shown when no `src` is provided or the image\n * fails to load. When omitted, initials derived from `name` render; if\n * `name` is also missing, a neutral placeholder shows.\n */\n fallback?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n// Diameter for each size — component-density literals — not from theme\n// (avatars have a tight visual ramp that doesn't tie to the spacing scale).\nconst SIZE_PX: Record<AvatarSize, number> = {\n sm: 32,\n md: 40,\n lg: 56,\n xl: 72,\n};\n\n// Maps each avatar size to the closest fontSize token key. Resolved to px\n// inside the component so theme overrides take effect.\nconst FALLBACK_FONT_KEY: Record<AvatarSize, 'xs' | 'sm' | 'lg' | 'xl'> = {\n sm: 'xs', // 12\n md: 'sm', // 14\n lg: 'lg', // 18\n xl: 'xl', // 20 (closest to legacy 22)\n};\n\nconst initialsFromName = (name: string | undefined): string => {\n if (!name) {\n return '';\n }\n const trimmed = name.trim();\n if (!trimmed) {\n return '';\n }\n const parts = trimmed.split(/\\s+/);\n const first = parts[0]?.[0] ?? '';\n const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? '') : '';\n return (first + last).toUpperCase();\n};\n\n/**\n * Circular profile picture with graceful fallback. Renders the image when\n * `src` is provided and loads cleanly; otherwise renders the supplied\n * `fallback`, derived initials from `name`, or a neutral placeholder.\n *\n * Why a single component instead of compound (`AvatarImage` + `AvatarFallback`):\n * the common case is a one-liner — `<Avatar src name />` — and the fallback\n * decision is internal state, not consumer-driven layout.\n */\nexport const Avatar = ({ src, name, size = 'md', fallback, className, testID }: AvatarProps) => {\n const colors = useThemeColors();\n const [imageFailed, setImageFailed] = useState(false);\n const dim = SIZE_PX[size];\n const showImage = src !== undefined && src.length > 0 && !imageFailed;\n\n const containerStyle: ViewStyle = {\n width: dim,\n height: dim,\n borderRadius: dim / 2,\n backgroundColor: colors.semantic.background.subtle,\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n };\n\n const imageStyle: ImageStyle = {\n width: dim,\n height: dim,\n };\n\n const initials = initialsFromName(name);\n const accessibilityLabel = name ?? 'Avatar';\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel}\n aria-label={accessibilityLabel}\n className={cn('rounded-full overflow-hidden bg-neutral-200 items-center justify-center', className)}\n style={containerStyle}\n >\n {showImage ? (\n <RNImage\n source={{ uri: src }}\n style={imageStyle}\n accessibilityLabel={accessibilityLabel}\n onError={() => setImageFailed(true)}\n />\n ) : fallback !== undefined ? (\n fallback\n ) : initials.length > 0 ? (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize[FALLBACK_FONT_KEY[size]]),\n fontWeight: colors.fontWeight.medium as '500',\n }}\n >\n {initials}\n </RNText>\n ) : (\n <View\n style={{\n width: dim * 0.45,\n height: dim * 0.45,\n borderRadius: dim,\n backgroundColor: colors.semantic.text.muted,\n }}\n />\n )}\n </View>\n );\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TextStyle, ViewStyle } from 'react-native';\nimport { Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type BadgeTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\nexport type BadgeAppearance = 'solid' | 'outline' | 'soft';\n\nexport type BadgeProps = {\n /**\n * Semantic color of the badge.\n * @defaultValue 'neutral'\n */\n tone?: BadgeTone;\n /**\n * Visual treatment.\n * - `soft` (default) — tinted background with darker tone-colored text. Modern, calm.\n * - `solid` — filled tone background, white text. Loud, used sparingly.\n * - `outline` — border in tone, transparent background, tone-colored text.\n * @defaultValue 'soft'\n */\n appearance?: BadgeAppearance;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n// Layout-only base; theme-driven dimensions are merged inside the\n// component so a custom theme reshapes the badge.\nconst BASE_CONTAINER_LAYOUT: ViewStyle = {\n alignSelf: 'flex-start',\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: 2, // component-density literal — not from theme (no 2px spacing token)\n borderWidth: 1,\n borderColor: 'transparent',\n};\n\n/**\n * Compact pill for status, counts, or labels. Use sparingly — every badge\n * draws the eye, so a row of five is no longer a row of badges.\n *\n * Tone palettes flip with the active color scheme — light mode uses the\n * familiar pastel scale (Tailwind 50/200/800), dark mode uses the deep\n * 950/700/100 scale so a soft success badge reads as a calm tinted chip\n * on either surface, never as a glaring pastel on a dark page.\n */\nexport const Badge = ({ tone = 'neutral', appearance = 'soft', children, className, testID }: BadgeProps) => {\n const colors = useThemeColors();\n const isDark = useColorScheme() === 'dark';\n const invertedText = colors.semantic.text.inverted;\n\n let palette: {\n soft: { bg: string; fg: string };\n solid: { bg: string; fg: string };\n outline: { border: string; fg: string };\n };\n if (tone === 'neutral') {\n palette = {\n soft: isDark\n ? { bg: colors.color.neutral['800'], fg: colors.color.neutral['100'] }\n : { bg: colors.color.neutral['100'], fg: colors.color.neutral['700'] },\n solid: {\n bg: isDark ? colors.color.neutral['200'] : colors.color.neutral['700'],\n fg: isDark ? colors.color.neutral['900'] : invertedText,\n },\n outline: {\n border: isDark ? colors.color.neutral['600'] : colors.color.neutral['300'],\n fg: isDark ? colors.color.neutral['100'] : colors.color.neutral['700'],\n },\n };\n } else if (tone === 'primary') {\n palette = {\n soft: isDark\n ? { bg: colors.color.primary['900'], fg: colors.color.primary['200'] }\n : { bg: colors.color.primary['100'], fg: colors.color.primary['800'] },\n solid: {\n bg: isDark ? colors.color.primary['400'] : colors.color.primary['600'],\n fg: isDark ? colors.color.primary['900'] : invertedText,\n },\n outline: {\n border: isDark ? colors.color.primary['400'] : colors.color.primary['300'],\n fg: isDark ? colors.color.primary['200'] : colors.color.primary['700'],\n },\n };\n } else if (tone === 'success') {\n palette = {\n soft: isDark ? { bg: '#14532d', fg: '#bbf7d0' } : { bg: '#dcfce7', fg: '#166534' },\n solid: { bg: colors.color.success, fg: invertedText },\n outline: { border: colors.color.success, fg: isDark ? '#bbf7d0' : '#166534' },\n };\n } else if (tone === 'warning') {\n palette = {\n soft: isDark ? { bg: '#78350f', fg: '#fde68a' } : { bg: '#fef3c7', fg: '#92400e' },\n solid: { bg: colors.color.warning, fg: invertedText },\n outline: { border: colors.color.warning, fg: isDark ? '#fde68a' : '#92400e' },\n };\n } else {\n palette = {\n soft: isDark ? { bg: '#7f1d1d', fg: '#fecaca' } : { bg: '#fee2e2', fg: '#991b1b' },\n solid: { bg: colors.color.danger, fg: invertedText },\n outline: { border: colors.color.danger, fg: isDark ? '#fecaca' : '#991b1b' },\n };\n }\n\n const baseContainer: ViewStyle = {\n ...BASE_CONTAINER_LAYOUT,\n gap: px(colors.spacing['1']),\n paddingHorizontal: px(colors.spacing['2']),\n borderRadius: px(colors.radius.full),\n };\n const containerStyle: ViewStyle = (() => {\n if (appearance === 'solid') {\n return { ...baseContainer, backgroundColor: palette.solid.bg };\n }\n if (appearance === 'outline') {\n return { ...baseContainer, backgroundColor: 'transparent', borderColor: palette.outline.border };\n }\n return { ...baseContainer, backgroundColor: palette.soft.bg };\n })();\n const textColor = (() => {\n if (appearance === 'solid') {\n return palette.solid.fg;\n }\n if (appearance === 'outline') {\n return palette.outline.fg;\n }\n return palette.soft.fg;\n })();\n const baseText: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.xs),\n fontWeight: colors.fontWeight.medium as '500',\n lineHeight: px(colors.fontSize.xs) * Number(colors.lineHeight.normal),\n };\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('inline-flex flex-row items-center gap-1 rounded-full px-2 py-0.5 border', className)}\n style={containerStyle}\n >\n <RNText style={{ ...baseText, color: textColor }}>{children}</RNText>\n </View>\n );\n};\n","'use client';\n\nimport type { TextProps as RNTextProps, TextStyle } from 'react-native';\nimport { Text as RNText } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type TextVariant = 'body-xs' | 'body-sm' | 'body-md' | 'body-lg' | 'heading-1' | 'heading-2' | 'heading-3';\n\nexport type TextProps = RNTextProps & {\n variant?: TextVariant;\n className?: string;\n testID?: string;\n};\n\nconst VARIANT_CLASSES: Record<TextVariant, string> = {\n 'body-xs': 'text-xs leading-normal',\n 'body-sm': 'text-sm leading-normal',\n 'body-md': 'text-md leading-normal',\n 'body-lg': 'text-lg leading-relaxed',\n 'heading-1': 'text-4xl leading-tight font-bold',\n 'heading-2': 'text-3xl leading-tight font-semibold',\n 'heading-3': 'text-2xl leading-tight font-semibold',\n};\n\nconst HEADING_VARIANTS: Readonly<Set<TextVariant>> = new Set(['heading-1', 'heading-2', 'heading-3']);\n\n// Per-variant resolution from the active theme. Keys here name the\n// fontSize / fontWeight / lineHeight tokens the variant pulls from. The\n// fontFamily is picked separately (display for headings, body otherwise).\ntype VariantKeys = {\n fontSize: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';\n fontWeight: 'regular' | 'medium' | 'semibold' | 'bold';\n lineHeight: 'tight' | 'normal' | 'relaxed';\n};\nconst VARIANT_KEYS: Record<TextVariant, VariantKeys> = {\n 'body-xs': { fontSize: 'xs', fontWeight: 'regular', lineHeight: 'normal' },\n 'body-sm': { fontSize: 'sm', fontWeight: 'regular', lineHeight: 'normal' },\n 'body-md': { fontSize: 'md', fontWeight: 'regular', lineHeight: 'normal' },\n 'body-lg': { fontSize: 'lg', fontWeight: 'regular', lineHeight: 'relaxed' },\n 'heading-1': { fontSize: '4xl', fontWeight: 'bold', lineHeight: 'tight' },\n 'heading-2': {\n fontSize: '3xl',\n fontWeight: 'semibold',\n lineHeight: 'tight',\n },\n 'heading-3': {\n fontSize: '2xl',\n fontWeight: 'semibold',\n lineHeight: 'tight',\n },\n};\n\n/**\n * Typography primitive. Renders a react-native <Text>; on web via RN-Web\n * it becomes a <div role=\"...\"> with the appropriate className.\n *\n * Inline style is sourced from the active `<NoriProvider theme={...}>`:\n * font family (display for headings, body for body variants), fontSize,\n * fontWeight, lineHeight all flow through. Override the whole variant by\n * passing a custom theme; override a single instance by passing `style`.\n *\n * The `className` path keeps the Tailwind dark-mode color flip — inline\n * style provides the typographic substance, className provides the color.\n */\nexport const Text = ({ variant = 'body-md', className, testID, children, ...rest }: TextProps) => {\n const colors = useThemeColors();\n const isHeading = HEADING_VARIANTS.has(variant);\n const role = isHeading ? 'header' : rest.accessibilityRole;\n\n const keys = VARIANT_KEYS[variant];\n const sizePx = px(colors.fontSize[keys.fontSize]);\n const lhMultiplier = Number(colors.lineHeight[keys.lineHeight]);\n const themedStyle: TextStyle = {\n // Inline color is the ONLY color source. The Tailwind preset uses\n // `darkMode: ['class', '[data-theme=\"dark\"]']` — that requires a\n // DOM, so on native the `dark:` variant never fires and a\n // className-only color path would always emit the LIGHT variant\n // (near-black), invisible on a dark surface. Sourcing color from\n // `useThemeColors()` means it follows the OS scheme AND honors a\n // forced `colorScheme` override on the provider.\n color: colors.semantic.text.default,\n fontFamily: isHeading ? colors.fontFamily.display : colors.fontFamily.body,\n fontSize: sizePx,\n // RN expects lineHeight in px, not unitless. Tokens carry it as a\n // ratio (1.2 / 1.4 / 1.6) — multiply against the variant fontSize.\n lineHeight: sizePx * lhMultiplier,\n // The fontWeight token returns string literals like \"500\" / \"700\"\n // which match RN's TextStyle.fontWeight enum.\n fontWeight: colors.fontWeight[keys.fontWeight] as TextStyle['fontWeight'],\n };\n\n // Caller-provided style wins (last in the array). The themed style is\n // the source of truth, the user's `style` prop the override.\n const styleProp = (rest as { style?: TextStyle | TextStyle[] }).style;\n\n return (\n <RNText\n testID={testID}\n {...rest}\n {...(role !== undefined ? { accessibilityRole: role } : {})}\n className={cn(VARIANT_CLASSES[variant], className)}\n style={[themedStyle, styleProp]}\n >\n {children}\n </RNText>\n );\n};\n","import { Children, type ReactNode } from 'react';\nimport { Text } from '../components/Text';\n\n/**\n * Walks a `ReactNode` (single, array, or fragment) and wraps every\n * string/number child in a themed `<Text>` so the same JSX renders\n * cleanly on web AND native. Non-string children are passed through\n * unchanged.\n *\n * On native, raw strings as children of any non-Text component throw\n * \"Text strings must be rendered within a <Text> component\". On web,\n * react-native-web silently tolerates them — but the rendered string\n * inherits no theme color, so dark mode never flips.\n *\n * Both bugs collapse to the same fix: wrap. Layout primitives\n * (`<HStack>`, `<VStack>`, `<Box>`) use this so consumers can write\n * `<HStack>Hello</HStack>` and have it Just Work on both platforms\n * and across light/dark mode.\n *\n * The wrapper is the lib's own `<Text>`, which reads from\n * `useThemeColors()` — so the wrapped string flips with the active\n * scheme. Importing a `'use client'` component from an RSC-safe file\n * is allowed; React's RSC model lets server components contain client\n * children.\n */\nexport function wrapStringChildren(children: ReactNode): ReactNode {\n return Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return <Text>{child}</Text>;\n }\n return child;\n });\n}\n","import type { ViewProps, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from '../../utils/cn';\nimport { wrapStringChildren } from '../../utils/wrap-string-children';\n\nexport type BoxProps = ViewProps & {\n className?: string;\n testID?: string;\n /**\n * Flex grow factor for proportional layouts inside HStack / VStack.\n *\n * In an HStack with three children of `flex={1}`, each takes one third\n * of the available width. For a 20/60/20 split: `flex={1}`, `flex={3}`,\n * `flex={1}` — the values are ratios, not percentages.\n *\n * Maps directly to React Native / web flexbox `flex` style.\n */\n flex?: number;\n};\n\n/**\n * Generic layout primitive. Wraps react-native's `<View>` with className\n * support and a `flex` prop for proportional layouts. RSC-safe.\n */\nexport const Box = ({ className, children, flex, style, ...rest }: BoxProps) => {\n const flexStyle: ViewStyle | undefined = flex === undefined ? undefined : { flex };\n const merged = flexStyle === undefined ? style : style === undefined ? flexStyle : [flexStyle, style];\n return (\n <View {...rest} className={cn(className)} style={merged}>\n {wrapStringChildren(children)}\n </View>\n );\n};\n","'use client';\n\nimport {\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Dimensions, Modal, Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type PopoverSide = 'top' | 'right' | 'bottom' | 'left';\nexport type PopoverAlign = 'start' | 'center' | 'end';\n\ntype TriggerRect = { top: number; left: number; width: number; height: number };\n\ntype PopoverContextValue = {\n open: boolean;\n setOpen: (next: boolean) => void;\n contentId: string;\n triggerRef: { current: HTMLElement | null };\n contentRef: { current: HTMLDivElement | null };\n triggerRect: TriggerRect | null;\n measureTrigger: () => void;\n};\n\nconst PopoverContext = createContext<PopoverContextValue | null>(null);\n\nconst usePopoverContext = (label: string): PopoverContextValue => {\n const ctx = useContext(PopoverContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside a <Popover>.`);\n }\n return ctx;\n};\n\nexport type PopoverProps = {\n /** Controlled open state. */\n open?: boolean;\n /** Uncontrolled initial open state. @defaultValue false */\n defaultOpen?: boolean;\n /** Fires with the new open state. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\n/**\n * Non-modal floating panel anchored to a trigger element. Use for help\n * tooltips with rich content, color pickers, or profile previews.\n *\n * Composition: `Popover` (root, owns open state), `PopoverTrigger`\n * (forwards events to its child via Slot when `asChild`), `PopoverContent`\n * (the floating surface).\n *\n * Differences from `Dialog`: non-modal — does NOT trap focus or lock\n * scroll. Tab moves outside as normal. Differences from `Tooltip`: can\n * contain interactive content (buttons, inputs, links) and dismisses on\n * outside-click + Escape rather than mouse-leave.\n *\n * Behavior:\n * - Trigger click toggles open/close.\n * - Click outside the content (and outside the trigger) closes.\n * - Escape closes.\n *\n * Cross-platform: uses RN `<Modal>` as the visibility/portal primitive on\n * native (transparent backdrop, tap-outside-to-close). On web, the content\n * uses `position: fixed` + a measured trigger rect so it escapes any\n * ancestor `overflow: hidden`.\n */\nconst PopoverRoot = ({ open, defaultOpen = false, onOpenChange, children }: PopoverProps) => {\n const [inner, setInner] = useState<boolean>(defaultOpen);\n const isControlled = open !== undefined;\n const current = isControlled ? open : inner;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setInner(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange]\n );\n\n const baseId = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n // Measure the trigger so the content can render with `position: fixed` +\n // computed coords. position:fixed escapes any ancestor's overflow:hidden\n // (e.g. fumadocs Tabs panes, our Preview frame), which is the single\n // biggest source of \"the popup got cut off\" bugs.\n const [triggerRect, setTriggerRect] = useState<TriggerRect | null>(null);\n const measureTrigger = useCallback(() => {\n const node = triggerRef.current;\n if (!node || typeof node.getBoundingClientRect !== 'function') {\n return;\n }\n const rect = node.getBoundingClientRect();\n setTriggerRect({ top: rect.top, left: rect.left, width: rect.width, height: rect.height });\n }, []);\n\n const ctxValue: PopoverContextValue = {\n open: current,\n setOpen,\n contentId: `${baseId}-content`,\n triggerRef,\n contentRef,\n triggerRect,\n measureTrigger,\n };\n\n return <PopoverContext.Provider value={ctxValue}>{children}</PopoverContext.Provider>;\n};\n\nexport type PopoverTriggerProps = {\n /** Render the child as the trigger (Slot pattern). Default true — pass `false` for an inline pressable. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Element that toggles the popover. Uses `asChild` by default so any\n * element (Button, Link, custom Pressable) becomes the trigger.\n *\n * The trigger element gets `aria-haspopup=\"dialog\"` and `aria-expanded`\n * so assistive tech announces the relationship.\n */\nexport const PopoverTrigger = ({ asChild = true, children, className, testID }: PopoverTriggerProps) => {\n const ctx = usePopoverContext('PopoverTrigger');\n const onPress = useCallback(() => {\n ctx.measureTrigger();\n ctx.setOpen(!ctx.open);\n }, [ctx]);\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n // Pass both onClick (web HTML buttons) AND onPress (RN Pressable /\n // our own Button) so the trigger fires regardless of which event\n // model the wrapped child speaks. The child's existing handler\n // runs first, then we toggle.\n const fire = (existing: ((e: unknown) => void) | undefined) => (event: unknown) => {\n existing?.(event);\n ctx.measureTrigger();\n ctx.setOpen(!ctx.open);\n };\n return (\n <Slot\n ref={(node: HTMLElement | null) => {\n ctx.triggerRef.current = node;\n }}\n onClick={fire(child.props.onClick as ((e: unknown) => void) | undefined)}\n onPress={fire(child.props.onPress as ((e: unknown) => void) | undefined)}\n aria-haspopup=\"dialog\"\n aria-expanded={ctx.open}\n aria-controls={ctx.contentId}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n return (\n <Pressable\n ref={(node) => {\n ctx.triggerRef.current = node as unknown as HTMLElement | null;\n }}\n onPress={onPress}\n {...({\n 'aria-haspopup': 'dialog',\n 'aria-expanded': ctx.open,\n 'aria-controls': ctx.contentId,\n } as Record<string, unknown>)}\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n};\n\n// On native, raw strings rendered as children of a non-Text component\n// throw \"Text strings must be rendered within a <Text> component\". On\n// web, react-native-web silently tolerates it. Wrap any string/number\n// children in an RNText so the same JSX renders cleanly on both\n// platforms. Non-string children are passed through unchanged.\nfunction wrapStringChildren(children: ReactNode): ReactNode {\n if (typeof children === 'string' || typeof children === 'number') {\n return <RNText>{children}</RNText>;\n }\n return children;\n}\n\nconst GAP = 4; // visual gap between trigger and content\nconst MIN_WIDTH = 200;\n// Margin reserved on each side so the popover never butts against the\n// viewport edge. Matches the 8px safe-area we use for native modal pads.\nconst VIEWPORT_MARGIN = 8;\n\nfunction computePosition(\n rect: TriggerRect,\n side: PopoverSide,\n align: PopoverAlign,\n contentSize: { width: number; height: number } | null\n): { top: number; left: number } {\n const cw = contentSize?.width ?? MIN_WIDTH;\n const ch = contentSize?.height ?? 0;\n\n let top = 0;\n let left = 0;\n\n switch (side) {\n case 'top':\n top = rect.top - GAP - ch;\n break;\n case 'bottom':\n top = rect.top + rect.height + GAP;\n break;\n case 'left':\n left = rect.left - GAP - cw;\n break;\n case 'right':\n left = rect.left + rect.width + GAP;\n break;\n }\n\n if (side === 'top' || side === 'bottom') {\n switch (align) {\n case 'start':\n left = rect.left;\n break;\n case 'center':\n left = rect.left + rect.width / 2 - cw / 2;\n break;\n case 'end':\n left = rect.left + rect.width - cw;\n break;\n }\n } else {\n switch (align) {\n case 'start':\n top = rect.top;\n break;\n case 'center':\n top = rect.top + rect.height / 2 - ch / 2;\n break;\n case 'end':\n top = rect.top + rect.height - ch;\n break;\n }\n }\n\n return { top, left };\n}\n\nexport type PopoverContentProps = {\n /** Side of the trigger to anchor on. @defaultValue 'bottom' */\n side?: PopoverSide;\n /** Alignment along the trigger edge. @defaultValue 'center' */\n align?: PopoverAlign;\n children?: ReactNode;\n className?: string;\n testID?: string;\n /** Accessible label when no visible heading is present. */\n 'aria-label'?: string;\n};\n\n/**\n * The floating popover surface. Renders only while open. On web uses\n * `position: fixed` with a measured trigger rect so it escapes any\n * ancestor `overflow: hidden`. Non-modal: focus is NOT trapped inside —\n * the user can tab back out as normal.\n *\n * ARIA: `role=\"dialog\"` (without `aria-modal`) so assistive tech\n * announces it as a grouping but doesn't suppress the rest of the page.\n */\nexport const PopoverContent = ({\n side = 'bottom',\n align = 'center',\n children,\n className,\n testID,\n ...rest\n}: PopoverContentProps) => {\n const ctx = usePopoverContext('PopoverContent');\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n\n // Measure content size after first paint so we can anchor `top`-style\n // popups (which need to know content height to render above the trigger).\n const [contentSize, setContentSize] = useState<{ width: number; height: number } | null>(null);\n\n // Web-only side effects: outside-click close, Escape close, re-measure\n // on resize. RN Modal handles its own dismissal on native (tap-outside\n // is the transparent overlay's onPress).\n useEffect(() => {\n if (!ctx.open) {\n return;\n }\n if (Platform.OS !== 'web') {\n return;\n }\n if (typeof document === 'undefined') {\n return;\n }\n\n ctx.measureTrigger();\n\n const onDocMouseDown = (event: MouseEvent) => {\n const target = event.target as Node;\n const trigger = ctx.triggerRef.current;\n const content = ctx.contentRef.current;\n if (trigger?.contains(target)) {\n return;\n }\n if (content?.contains(target)) {\n return;\n }\n ctx.setOpen(false);\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n ctx.setOpen(false);\n }\n };\n const onResize = () => ctx.measureTrigger();\n const onScroll = () => ctx.measureTrigger();\n\n document.addEventListener('mousedown', onDocMouseDown);\n document.addEventListener('keydown', onKeyDown);\n window.addEventListener('resize', onResize);\n window.addEventListener('scroll', onScroll, true);\n return () => {\n document.removeEventListener('mousedown', onDocMouseDown);\n document.removeEventListener('keydown', onKeyDown);\n window.removeEventListener('resize', onResize);\n window.removeEventListener('scroll', onScroll, true);\n };\n // ctx is the provider's stable identity; we only care about open transitions.\n }, [ctx.open, ctx.measureTrigger, ctx.setOpen, ctx.triggerRef, ctx.contentRef]);\n\n // Reset measured size when popover closes so reopening re-measures fresh.\n useEffect(() => {\n if (!ctx.open) {\n setContentSize(null);\n }\n }, [ctx.open]);\n\n if (!ctx.open) {\n return null;\n }\n\n const position = ctx.triggerRect ? computePosition(ctx.triggerRect, side, align, contentSize) : null;\n\n // Viewport-aware max width. Web uses Dimensions.get('window') which\n // react-native-web maps to window.innerWidth; native uses the same API\n // for the device window. Subtract margin on both sides so content\n // doesn't kiss the screen edge.\n const viewportWidth = Dimensions.get('window').width;\n const maxContentWidth = Math.max(MIN_WIDTH, viewportWidth - VIEWPORT_MARGIN * 2);\n\n const contentBaseStyle: ViewStyle = {\n minWidth: MIN_WIDTH,\n maxWidth: maxContentWidth,\n borderRadius: px(colors.radius.lg),\n borderWidth: 1,\n borderColor: colors.semantic.border.default,\n backgroundColor: colors.semantic.background.elevated,\n padding: px(colors.spacing['4']),\n ...(Platform.OS === 'web'\n ? ({\n boxShadow: '0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)',\n // Subtle scale-in. Skipped on native (do nothing fancy there).\n transition: 'opacity 120ms ease-out, transform 120ms ease-out',\n transform: 'scale(1)',\n opacity: 1,\n } as ViewStyle)\n : { elevation: 8 }),\n };\n\n // Clamp `left` so the popover stays within the viewport even when the\n // trigger sits near the right edge. First-paint fallback uses\n // `maxContentWidth` (the cap we apply via maxWidth above) — content\n // is allowed to grow up to that size, so assuming worst-case avoids\n // a one-frame overflow before measurement settles.\n const measuredWidth = contentSize?.width ?? maxContentWidth;\n const clampedLeft = position\n ? Math.min(\n Math.max(VIEWPORT_MARGIN, position.left),\n Math.max(VIEWPORT_MARGIN, viewportWidth - measuredWidth - VIEWPORT_MARGIN)\n )\n : 0;\n\n const positionedStyle: ViewStyle =\n Platform.OS === 'web'\n ? position\n ? ({\n position: 'fixed' as unknown as 'absolute',\n top: position.top,\n left: clampedLeft,\n zIndex: 50,\n } as ViewStyle)\n : ({\n // Trigger not yet measured — render off-screen for a\n // frame to avoid a flash at (0,0).\n position: 'fixed' as unknown as 'absolute',\n top: -9999,\n left: -9999,\n zIndex: 50,\n } as ViewStyle)\n : {};\n\n const content = (\n <View\n ref={(node) => {\n ctx.contentRef.current = node as unknown as HTMLDivElement | null;\n if (Platform.OS !== 'web') {\n return;\n }\n if (!node) {\n return;\n }\n if (typeof (node as unknown as HTMLDivElement).getBoundingClientRect !== 'function') {\n return;\n }\n const rect = (node as unknown as HTMLDivElement).getBoundingClientRect();\n if (!contentSize || contentSize.width !== rect.width || contentSize.height !== rect.height) {\n setContentSize({ width: rect.width, height: rect.height });\n }\n }}\n {...({\n role: 'dialog',\n id: ctx.contentId,\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel, accessibilityLabel: ariaLabel } : {}),\n } as Record<string, unknown>)}\n {...(testID !== undefined ? { testID } : {})}\n className={cn(\n 'rounded-lg border border-semantic-border-default bg-semantic-background-elevated',\n className\n )}\n style={[contentBaseStyle, positionedStyle]}\n >\n {children}\n </View>\n );\n\n if (Platform.OS === 'web') {\n return content;\n }\n\n // Native: use Modal as the floating layer with a transparent backdrop.\n // Tap on the backdrop closes the popover.\n return (\n <Modal visible={ctx.open} transparent animationType=\"fade\" onRequestClose={() => ctx.setOpen(false)}>\n <Pressable\n accessibilityRole=\"none\"\n aria-hidden={true}\n onPress={() => ctx.setOpen(false)}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'transparent',\n }}\n >\n <Pressable\n onPress={(event) => event.stopPropagation?.()}\n style={{\n position: 'absolute',\n top: ctx.triggerRect\n ? side === 'top'\n ? Math.max(VIEWPORT_MARGIN, ctx.triggerRect.top - GAP - 80)\n : ctx.triggerRect.top + ctx.triggerRect.height + GAP\n : 80,\n // Clamp horizontally so a wide popover near the\n // right edge can still grow leftward without\n // overflowing the screen.\n left: ctx.triggerRect\n ? Math.min(\n Math.max(VIEWPORT_MARGIN, ctx.triggerRect.left),\n Math.max(VIEWPORT_MARGIN, viewportWidth - measuredWidth - VIEWPORT_MARGIN)\n )\n : VIEWPORT_MARGIN * 2,\n }}\n >\n {content}\n </Pressable>\n </Pressable>\n </Modal>\n );\n};\n\n/**\n * Public `Popover` value — the root function plus its `.Trigger` and `.Content`\n * static members. `Object.assign` produces a value whose inferred type carries\n * the static properties, so `.d.ts` consumers can write `<Popover.Trigger>`\n * without a separate import.\n */\nexport const Popover = Object.assign(PopoverRoot, {\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n});\n","'use client';\n\n// Breadcrumb — cross-platform, agent-friendly, width-aware.\n//\n// Two equivalent APIs:\n//\n// 1. Items-array (terse, agent-friendly, full-feature):\n//\n// <Breadcrumb\n// items={[\n// { label: 'Home', href: '/' },\n// { label: 'Docs', href: '/docs' },\n// { label: 'Breadcrumb', current: true },\n// ]}\n// separator=\"/\"\n// collapseOnOverflow\n// />\n//\n// 2. Compound (full JSX control):\n//\n// <Breadcrumb separator=\"/\">\n// <Breadcrumb.List>\n// <Breadcrumb.Item><Breadcrumb.Link href=\"/\">Home</Breadcrumb.Link></Breadcrumb.Item>\n// <Breadcrumb.Item><Breadcrumb.Link href=\"/docs\">Docs</Breadcrumb.Link></Breadcrumb.Item>\n// <Breadcrumb.Item><Breadcrumb.Page>Breadcrumb</Breadcrumb.Page></Breadcrumb.Item>\n// </Breadcrumb.List>\n// </Breadcrumb>\n//\n// Key design notes:\n// - Width-based collapse works on BOTH platforms via React Native's\n// `onLayout` (which react-native-web shims via ResizeObserver). A\n// hidden measurement copy of the full list reports per-item widths;\n// the visible list renders only the items that fit.\n// - Auto-`aria-current=\"page\"` on the last item or any item flagged\n// `current`.\n// - JSON-LD BreadcrumbList schema emitted on web for SEO + LLM ingest\n// (opt-out via `schemaOrg={false}`). Injected client-side via\n// `document.head`; SSR consumers can use the exported\n// `getBreadcrumbJsonLd()` helper with their framework's metadata API.\n// - Per-item `siblings` opens a sibling menu (the VSCode/file-path\n// pattern). Uses our `Popover` primitive.\n\nimport {\n Children,\n type ComponentType,\n createContext,\n Fragment,\n isValidElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, ScrollView, View } from 'react-native';\nimport { useTranslation } from '../../i18n/use-translation';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { Popover } from '../Popover';\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/** Where the ellipsis sends the user when tapped/clicked. */\nexport type BreadcrumbExpandBehavior =\n /** Replace `…` with all hidden items inline (MUI). Web default. */\n | 'inline'\n /** Open a popover/sheet listing the hidden items (Primer / iOS). Native default. */\n | 'menu'\n /** Don't collapse — fall back to a horizontal scroll container. Useful for IDE-style file paths. */\n | 'scroll'\n /** Render `…` but don't react to interaction. Pure visual hint. */\n | 'none';\n\nexport type BreadcrumbSeparatorContext = {\n /** Index of the item PRECEDING this separator. */\n fromIndex: number;\n /** Total visible items. */\n visibleCount: number;\n /** Reading direction at render time. */\n dir: 'ltr' | 'rtl';\n};\n\nexport type BreadcrumbSeparatorValue = string | ReactNode | ((ctx: BreadcrumbSeparatorContext) => ReactNode);\n\nexport type BreadcrumbIcon = ComponentType<{ size?: number; color?: string }>;\n\nexport type BreadcrumbSibling = {\n /** Visible label. */\n label: ReactNode;\n /** Link target. Omit for an `onSelect`-driven sibling. */\n href?: string;\n /** Optional leading icon. */\n icon?: BreadcrumbIcon;\n /** Click / tap handler. */\n onSelect?: () => void;\n /** Render as inactive in the sibling menu. */\n disabled?: boolean;\n};\n\nexport type BreadcrumbItemData = {\n /** Visible label. Strings are wrapped in `<Text>`; ReactNode passes through. */\n label: ReactNode;\n /** Link target. When omitted and not `current`, the item renders as a button (use with `onSelect`). */\n href?: string;\n /** Leading icon component (lucide, custom, …). Sized to the line height. */\n icon?: BreadcrumbIcon;\n /** Marks this item as the current page. The last item is auto-flagged when no item is explicitly current. */\n current?: boolean;\n /** Sibling list — when provided, the item gets a chevron and opens a popover menu of siblings on tap. */\n siblings?: BreadcrumbSibling[];\n /** Render a skeleton instead of the label — useful while async paths resolve. */\n loading?: boolean;\n /** Click / tap handler when `href` is absent. */\n onSelect?: () => void;\n /** Stable key for React's reconciler. Defaults to the item index. */\n key?: string | number;\n /** Override per-item label truncation in characters. 0 disables truncation. */\n maxLabelLength?: number;\n};\n\nexport type BreadcrumbProps = {\n /** Items-array mode. When provided, `children` is ignored. */\n items?: ReadonlyArray<BreadcrumbItemData>;\n /**\n * Visual separator between items. Strings render as plain text; nodes\n * render as-is; functions receive `(ctx)` and return a node.\n * @defaultValue a chevron glyph (auto-flips for RTL)\n */\n separator?: BreadcrumbSeparatorValue;\n /**\n * Maximum number of visible items. The middle is collapsed into a\n * single ellipsis; the first / last items are kept by default.\n * Pass `0` or `undefined` to disable count-based collapse.\n */\n maxItems?: number;\n /** How many items at the START of the list stay visible when the middle collapses. @defaultValue 1 */\n itemsBeforeCollapse?: number;\n /** How many items at the END of the list stay visible when the middle collapses. @defaultValue 1 */\n itemsAfterCollapse?: number;\n /**\n * Width-based collapse using `onLayout` (works on RN-Web via the\n * built-in ResizeObserver shim and on native via the layout system).\n * The library renders a hidden measurement copy of every item, then\n * shows only the items that fit the container — middle items are\n * folded into the ellipsis. Pass `false` to opt out and let the row\n * grow to its natural width (it will overflow its parent if the\n * parent does not provide its own scroll/clip handling).\n * @defaultValue true\n */\n collapseOnOverflow?: boolean;\n /**\n * What the ellipsis does when tapped/clicked.\n * @defaultValue 'inline' on web, 'menu' on native\n */\n expandBehavior?: BreadcrumbExpandBehavior;\n /** Override the default i18n string for the \"show full path\" SR label. */\n expandLabel?: string;\n /** Override the default i18n string for the ellipsis SR label. */\n ellipsisLabel?: string;\n /**\n * Visually-hidden prefix announced before the current page's label.\n * Helps screen readers convey \"Current page: Settings\" instead of \"Settings\".\n */\n currentPageLabel?: string;\n /** Override the SR label for sibling menus opened from a crumb. */\n siblingMenuLabel?: string;\n /** Visible aria-label on the wrapping `<nav>`. @defaultValue translated \"Breadcrumb\" */\n ariaLabel?: string;\n /**\n * Emit JSON-LD `BreadcrumbList` structured data for SEO + LLM\n * ingest. Web only; ignored on native.\n * @defaultValue true (only when `items` is provided AND on web)\n */\n schemaOrg?: boolean;\n /**\n * Reading direction. RTL flips the default chevron separator and the\n * collapse logic so the start/end stay anchored to the right edge.\n * @defaultValue 'ltr'\n */\n dir?: 'ltr' | 'rtl';\n /**\n * Truncate each item's label after this many characters. Per-item\n * `maxLabelLength` overrides this. @defaultValue 0 (no truncation)\n */\n maxLabelLength?: number;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n// =============================================================================\n// Context (compound mode only)\n// =============================================================================\n\ntype BreadcrumbContextValue = {\n separator: BreadcrumbSeparatorValue;\n dir: 'ltr' | 'rtl';\n currentPageLabel: string;\n siblingMenuLabel: string;\n maxLabelLength: number;\n};\n\nconst BreadcrumbContext = createContext<BreadcrumbContextValue | null>(null);\n\nconst useBreadcrumbContext = (label: string): BreadcrumbContextValue => {\n const ctx = useContext(BreadcrumbContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside a <Breadcrumb>.`);\n }\n return ctx;\n};\n\n// =============================================================================\n// Defaults / markers\n// =============================================================================\n\nconst DEFAULT_ITEMS_BEFORE = 1;\nconst DEFAULT_ITEMS_AFTER = 1;\n\ntype CompoundChildKind = 'item' | 'separator';\nconst COMPOUND_KIND_KEY = '__nori_breadcrumb_kind__';\n\nfunction tagComponent<T>(component: T, kind: CompoundChildKind): T {\n (component as unknown as Record<string, unknown>)[COMPOUND_KIND_KEY] = kind;\n return component;\n}\n\nfunction getCompoundKind(node: ReactNode): CompoundChildKind | undefined {\n if (!isValidElement(node)) {\n return undefined;\n }\n const type = node.type as unknown as { [k: string]: unknown };\n const tagged = type?.[COMPOUND_KIND_KEY];\n return tagged === 'item' || tagged === 'separator' ? tagged : undefined;\n}\n\n// =============================================================================\n// Default chevron separator\n// =============================================================================\n\nconst DefaultChevron = ({ dir }: { dir: 'ltr' | 'rtl' }) => {\n const colors = useThemeColors();\n const flipped = dir === 'rtl';\n if (Platform.OS === 'web') {\n return (\n <svg\n width={14}\n height={14}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={colors.semantic.text.muted}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n style={{ transform: flipped ? 'scaleX(-1)' : undefined, flexShrink: 0 }}\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n }\n return (\n <RNText\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n fontSize: 14,\n lineHeight: 20,\n color: colors.semantic.text.muted,\n transform: flipped ? [{ scaleX: -1 }] : undefined,\n }}\n >\n ›\n </RNText>\n );\n};\n\nconst SeparatorText = ({ children }: { children: ReactNode }) => {\n const colors = useThemeColors();\n return (\n <RNText\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.md) * 1.4,\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n paddingHorizontal: 2,\n }}\n >\n {children}\n </RNText>\n );\n};\n\nfunction renderSeparator(separator: BreadcrumbSeparatorValue | undefined, ctx: BreadcrumbSeparatorContext): ReactNode {\n if (separator === undefined) {\n return <DefaultChevron dir={ctx.dir} />;\n }\n if (typeof separator === 'function') {\n return separator(ctx);\n }\n if (typeof separator === 'string') {\n return <SeparatorText>{separator}</SeparatorText>;\n }\n return separator;\n}\n\n// =============================================================================\n// Width-based overflow fit\n// =============================================================================\n\ntype OverflowFitArgs = {\n enabled: boolean;\n /** Total candidate items (after count-collapse). */\n itemCount: number;\n itemsBeforeCollapse: number;\n itemsAfterCollapse: number;\n};\n\ntype OverflowFitState = {\n visibleIndices: Set<number>;\n ready: boolean;\n onContainerLayout: (event: LayoutChangeEvent) => void;\n onItemLayout: (index: number) => (event: LayoutChangeEvent) => void;\n onEllipsisLayout: (event: LayoutChangeEvent) => void;\n onSeparatorLayout: (event: LayoutChangeEvent) => void;\n};\n\nfunction useOverflowFit({\n enabled,\n itemCount,\n itemsBeforeCollapse,\n itemsAfterCollapse,\n}: OverflowFitArgs): OverflowFitState {\n const [containerWidth, setContainerWidth] = useState<number | null>(null);\n const itemWidthsRef = useRef<Map<number, number>>(new Map());\n const ellipsisWidthRef = useRef<number>(0);\n const separatorWidthRef = useRef<number>(0);\n // The widths above live in refs so we can write to them inside layout\n // callbacks without React's setState quotas. But the fit algorithm\n // depends on them — so any change has to invalidate the visibleIndices\n // memo. Bumping `widthsTick` does both: triggers a re-render AND adds\n // a memo dependency that actually changes between writes.\n const [widthsTick, setWidthsTick] = useState(0);\n\n const onContainerLayout = useCallback((event: LayoutChangeEvent) => {\n const w = event.nativeEvent.layout.width;\n setContainerWidth((prev) => (prev !== null && Math.abs(prev - w) < 0.5 ? prev : w));\n }, []);\n\n const onItemLayout = useCallback(\n (index: number) => (event: LayoutChangeEvent) => {\n const w = event.nativeEvent.layout.width;\n const prev = itemWidthsRef.current.get(index);\n if (prev === undefined || Math.abs(prev - w) >= 0.5) {\n itemWidthsRef.current.set(index, w);\n setWidthsTick((t) => t + 1);\n }\n },\n []\n );\n\n const onEllipsisLayout = useCallback((event: LayoutChangeEvent) => {\n const w = event.nativeEvent.layout.width;\n if (Math.abs(ellipsisWidthRef.current - w) >= 0.5) {\n ellipsisWidthRef.current = w;\n setWidthsTick((t) => t + 1);\n }\n }, []);\n\n const onSeparatorLayout = useCallback((event: LayoutChangeEvent) => {\n const w = event.nativeEvent.layout.width;\n if (Math.abs(separatorWidthRef.current - w) >= 0.5) {\n separatorWidthRef.current = w;\n setWidthsTick((t) => t + 1);\n }\n }, []);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: widthsTick is a manual invalidation signal for ref-stored measurements; the algorithm reads itemWidthsRef/ellipsisWidthRef/separatorWidthRef which biome can't see through\n const visibleIndices = useMemo<Set<number>>(() => {\n const all = new Set<number>();\n for (let i = 0; i < itemCount; i += 1) {\n all.add(i);\n }\n if (!enabled || containerWidth === null || itemCount === 0) {\n return all;\n }\n const widths = itemWidthsRef.current;\n // Wait for every item to report a width — incomplete measurements\n // can collapse a long item that actually fits.\n if (widths.size < itemCount) {\n return all;\n }\n const sep = separatorWidthRef.current;\n const ell = ellipsisWidthRef.current;\n\n // Total of the full list = sum(items) + sep * (count - 1).\n let total = 0;\n for (let i = 0; i < itemCount; i += 1) {\n total += widths.get(i) ?? 0;\n }\n total += sep * Math.max(0, itemCount - 1);\n if (total <= containerWidth) {\n return all;\n }\n\n const before = Math.max(0, Math.min(itemsBeforeCollapse, itemCount));\n const after = Math.max(0, Math.min(itemsAfterCollapse, itemCount - before));\n\n // Anchors are the items the user has guaranteed to keep visible.\n // Start with them, plus the ellipsis cell, then grow inward as\n // long as we have budget.\n const anchorIndices = new Set<number>();\n for (let i = 0; i < before; i += 1) {\n anchorIndices.add(i);\n }\n for (let i = itemCount - after; i < itemCount; i += 1) {\n anchorIndices.add(i);\n }\n let used = 0;\n for (const idx of anchorIndices) {\n used += widths.get(idx) ?? 0;\n }\n // ellipsis takes one cell + separators on each side that has anchors.\n used += ell;\n const sepCount = Math.max(0, anchorIndices.size + 1 - 1);\n used += sep * sepCount;\n\n if (used > containerWidth) {\n // Even the anchors don't fit — drop one anchor at a time\n // from the inner edge until the budget covers what's left\n // (always keeping at least one anchor on each side that had any).\n const beforeIdx: number[] = [];\n for (let i = 0; i < before; i += 1) {\n beforeIdx.push(i);\n }\n const afterIdx: number[] = [];\n for (let i = itemCount - after; i < itemCount; i += 1) {\n afterIdx.push(i);\n }\n const minBefore = before > 0 ? 1 : 0;\n const minAfter = after > 0 ? 1 : 0;\n while (used > containerWidth && (beforeIdx.length > minBefore || afterIdx.length > minAfter)) {\n if (beforeIdx.length > minBefore) {\n const dropped = beforeIdx.pop();\n if (dropped !== undefined) {\n used -= (widths.get(dropped) ?? 0) + sep;\n anchorIndices.delete(dropped);\n }\n }\n if (used <= containerWidth) {\n break;\n }\n if (afterIdx.length > minAfter) {\n const dropped = afterIdx.shift();\n if (dropped !== undefined) {\n used -= (widths.get(dropped) ?? 0) + sep;\n anchorIndices.delete(dropped);\n }\n }\n }\n return anchorIndices;\n }\n\n // Try to grow back: include adjacent items as long as they fit.\n // Alternate left and right so context near both edges is balanced.\n let leftCursor = before;\n let rightCursor = itemCount - after - 1;\n while (leftCursor <= rightCursor) {\n const w = widths.get(leftCursor) ?? 0;\n if (used + w + sep <= containerWidth) {\n anchorIndices.add(leftCursor);\n used += w + sep;\n leftCursor += 1;\n } else {\n break;\n }\n if (leftCursor > rightCursor) {\n break;\n }\n const w2 = widths.get(rightCursor) ?? 0;\n if (used + w2 + sep <= containerWidth) {\n anchorIndices.add(rightCursor);\n used += w2 + sep;\n rightCursor -= 1;\n } else {\n break;\n }\n }\n return anchorIndices;\n }, [containerWidth, itemCount, itemsBeforeCollapse, itemsAfterCollapse, enabled, widthsTick]);\n\n const ready = !enabled || (containerWidth !== null && itemWidthsRef.current.size >= itemCount);\n\n return {\n visibleIndices,\n ready,\n onContainerLayout,\n onItemLayout,\n onEllipsisLayout,\n onSeparatorLayout,\n };\n}\n\n// =============================================================================\n// Count-based collapse helper\n// =============================================================================\n\nfunction applyCountCollapse(\n items: ReadonlyArray<BreadcrumbItemData>,\n maxItems: number | undefined,\n before: number,\n after: number\n): { visible: ReadonlyArray<BreadcrumbItemData>; hidden: ReadonlyArray<BreadcrumbItemData>; collapseAt: number } {\n if (!maxItems || items.length <= maxItems) {\n return { visible: items, hidden: [], collapseAt: -1 };\n }\n const beforeArr = items.slice(0, Math.max(0, Math.min(before, items.length)));\n const afterArr = after > 0 ? items.slice(Math.max(beforeArr.length, items.length - after)) : [];\n const hidden = items.slice(beforeArr.length, items.length - afterArr.length);\n const visible = [...beforeArr, ...afterArr];\n return { visible, hidden, collapseAt: beforeArr.length };\n}\n\n// =============================================================================\n// JSON-LD\n// =============================================================================\n\n/**\n * Build a JSON-LD `BreadcrumbList` document from a list of items. Use it\n * with your framework's metadata API for SSR-time emission:\n *\n * ```tsx\n * // Next.js App Router metadata\n * export async function generateMetadata() {\n * return { other: { 'application/ld+json': getBreadcrumbJsonLd(items) } };\n * }\n * ```\n *\n * The component renders this client-side via `document.head` injection\n * automatically — but framework-driven SSR is preferred for reliable\n * search-engine pickup, hence this exported helper.\n */\nexport function getBreadcrumbJsonLd(items: ReadonlyArray<BreadcrumbItemData>): string {\n const elements = items\n .map((it, idx) => {\n const name = typeof it.label === 'string' ? it.label : undefined;\n if (!name) {\n return null;\n }\n const entry: Record<string, unknown> = {\n '@type': 'ListItem',\n position: idx + 1,\n name,\n };\n if (it.href) {\n entry.item = it.href;\n }\n return entry;\n })\n .filter((x): x is Record<string, unknown> => x !== null);\n return JSON.stringify({\n '@context': 'https://schema.org',\n '@type': 'BreadcrumbList',\n itemListElement: elements,\n });\n}\n\nfunction useBreadcrumbJsonLdInjection(items: ReadonlyArray<BreadcrumbItemData>, enabled: boolean) {\n useEffect(() => {\n if (!enabled || Platform.OS !== 'web' || typeof document === 'undefined') {\n return;\n }\n const json = getBreadcrumbJsonLd(items);\n // Skip emitting an empty BreadcrumbList — no items resolve to a\n // string label means nothing useful for crawlers.\n if (!json.includes('\"itemListElement\":[{')) {\n return;\n }\n const script = document.createElement('script');\n script.type = 'application/ld+json';\n // Use textContent (not innerHTML) — the browser doesn't parse it as\n // HTML, so XSS via label content can't leak out of the script tag.\n script.textContent = json;\n script.setAttribute('data-nori-breadcrumb', 'true');\n document.head.appendChild(script);\n return () => {\n if (script.parentNode === document.head) {\n document.head.removeChild(script);\n }\n };\n }, [items, enabled]);\n}\n\n// =============================================================================\n// Truncated label\n// =============================================================================\n\nfunction truncateString(input: string, max: number): string {\n if (max <= 0 || input.length <= max) {\n return input;\n }\n if (max <= 1) {\n return '…';\n }\n return `${input.slice(0, max - 1)}…`;\n}\n\n// =============================================================================\n// Root\n// =============================================================================\n\nconst BreadcrumbRoot = ({\n items,\n separator,\n maxItems,\n itemsBeforeCollapse = DEFAULT_ITEMS_BEFORE,\n itemsAfterCollapse = DEFAULT_ITEMS_AFTER,\n collapseOnOverflow,\n expandBehavior,\n expandLabel,\n ellipsisLabel,\n currentPageLabel,\n siblingMenuLabel,\n ariaLabel,\n schemaOrg,\n dir = 'ltr',\n maxLabelLength = 0,\n children,\n className,\n testID,\n}: BreadcrumbProps) => {\n const { t } = useTranslation();\n const colors = useThemeColors();\n const resolvedAriaLabel = ariaLabel ?? t('breadcrumb.ariaLabel', { defaultValue: 'Breadcrumb' });\n const resolvedExpandLabel = expandLabel ?? t('breadcrumb.expandLabel', { defaultValue: 'Show full path' });\n const resolvedEllipsisLabel = ellipsisLabel ?? t('breadcrumb.ellipsisLabel', { defaultValue: 'More' });\n const resolvedCurrentPageLabel =\n currentPageLabel ?? t('breadcrumb.currentPageLabel', { defaultValue: 'Current page' });\n const resolvedSiblingMenuLabel =\n siblingMenuLabel ?? t('breadcrumb.siblingMenuLabel', { defaultValue: 'Open sibling pages' });\n\n const resolvedExpandBehavior: BreadcrumbExpandBehavior =\n expandBehavior ?? (Platform.OS === 'web' ? 'inline' : 'menu');\n\n if (items && items.length > 0) {\n return (\n <BreadcrumbItemsRenderer\n items={items}\n separator={separator}\n maxItems={maxItems}\n itemsBeforeCollapse={itemsBeforeCollapse}\n itemsAfterCollapse={itemsAfterCollapse}\n collapseOnOverflow={collapseOnOverflow ?? true}\n expandBehavior={resolvedExpandBehavior}\n expandLabel={resolvedExpandLabel}\n ellipsisLabel={resolvedEllipsisLabel}\n currentPageLabel={resolvedCurrentPageLabel}\n siblingMenuLabel={resolvedSiblingMenuLabel}\n ariaLabel={resolvedAriaLabel}\n schemaOrg={schemaOrg}\n dir={dir}\n maxLabelLength={maxLabelLength}\n {...(className !== undefined ? { className } : {})}\n {...(testID !== undefined ? { testID } : {})}\n />\n );\n }\n\n // Compound mode — context only; the list / items render themselves.\n const ctxValue: BreadcrumbContextValue = {\n separator: separator ?? '',\n dir,\n currentPageLabel: resolvedCurrentPageLabel,\n siblingMenuLabel: resolvedSiblingMenuLabel,\n maxLabelLength,\n };\n\n return (\n <BreadcrumbContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"navigation\"\n aria-label={resolvedAriaLabel}\n accessible\n accessibilityLabel={resolvedAriaLabel}\n className={cn('flex-row items-center', className)}\n style={\n {\n flexDirection: 'row',\n alignItems: 'center',\n direction: dir as ViewStyle['direction'],\n fontFamily: colors.fontFamily.body,\n } as ViewStyle\n }\n >\n {children}\n </View>\n </BreadcrumbContext.Provider>\n );\n};\n\n// =============================================================================\n// Items-mode renderer\n// =============================================================================\n\ntype ItemsRendererProps = {\n items: ReadonlyArray<BreadcrumbItemData>;\n separator: BreadcrumbSeparatorValue | undefined;\n maxItems: number | undefined;\n itemsBeforeCollapse: number;\n itemsAfterCollapse: number;\n collapseOnOverflow: boolean;\n expandBehavior: BreadcrumbExpandBehavior;\n expandLabel: string;\n ellipsisLabel: string;\n currentPageLabel: string;\n siblingMenuLabel: string;\n ariaLabel: string;\n schemaOrg: boolean | undefined;\n dir: 'ltr' | 'rtl';\n maxLabelLength: number;\n className?: string;\n testID?: string;\n};\n\nconst BreadcrumbItemsRenderer = ({\n items,\n separator,\n maxItems,\n itemsBeforeCollapse,\n itemsAfterCollapse,\n collapseOnOverflow,\n expandBehavior,\n expandLabel,\n ellipsisLabel,\n currentPageLabel,\n siblingMenuLabel,\n ariaLabel,\n schemaOrg,\n dir,\n maxLabelLength,\n className,\n testID,\n}: ItemsRendererProps) => {\n const [inlineExpanded, setInlineExpanded] = useState(false);\n\n // Auto-flag the last item as current when nobody else claims it.\n const normalizedItems = useMemo<ReadonlyArray<BreadcrumbItemData>>(() => {\n if (items.length === 0) {\n return items;\n }\n const anyCurrent = items.some((it) => it.current);\n if (anyCurrent) {\n return items;\n }\n const last = items[items.length - 1];\n if (!last) {\n return items;\n }\n const out: BreadcrumbItemData[] = [...items];\n out[out.length - 1] = { ...last, current: true };\n return out;\n }, [items]);\n\n useBreadcrumbJsonLdInjection(normalizedItems, schemaOrg !== false);\n\n // -------- COUNT-BASED COLLAPSE --------\n const countCollapse = useMemo(\n () =>\n applyCountCollapse(\n normalizedItems,\n inlineExpanded ? undefined : maxItems,\n itemsBeforeCollapse,\n itemsAfterCollapse\n ),\n [normalizedItems, maxItems, itemsBeforeCollapse, itemsAfterCollapse, inlineExpanded]\n );\n\n // -------- WIDTH-BASED COLLAPSE --------\n // Width-based fit runs on the post-count-collapse list — count is\n // always the ceiling. Width may further shrink the visible set.\n const widthFit = useOverflowFit({\n enabled: collapseOnOverflow && expandBehavior !== 'scroll' && !inlineExpanded,\n itemCount: countCollapse.visible.length,\n itemsBeforeCollapse,\n itemsAfterCollapse,\n });\n\n const widthHiddenItems = useMemo(() => {\n if (!collapseOnOverflow || expandBehavior === 'scroll' || inlineExpanded) {\n return [] as ReadonlyArray<BreadcrumbItemData>;\n }\n return countCollapse.visible.filter((_, idx) => !widthFit.visibleIndices.has(idx));\n }, [collapseOnOverflow, expandBehavior, inlineExpanded, countCollapse.visible, widthFit.visibleIndices]);\n\n const allHiddenItems = useMemo<ReadonlyArray<BreadcrumbItemData>>(() => {\n if (inlineExpanded) {\n return [];\n }\n return [...countCollapse.hidden, ...widthHiddenItems];\n }, [countCollapse.hidden, widthHiddenItems, inlineExpanded]);\n\n const visibleItemsForRender = useMemo<ReadonlyArray<BreadcrumbItemData>>(() => {\n if (inlineExpanded) {\n return normalizedItems;\n }\n return countCollapse.visible.filter((_, idx) =>\n collapseOnOverflow && expandBehavior !== 'scroll' ? widthFit.visibleIndices.has(idx) : true\n );\n }, [\n countCollapse.visible,\n widthFit.visibleIndices,\n collapseOnOverflow,\n expandBehavior,\n inlineExpanded,\n normalizedItems,\n ]);\n\n // Where to insert the ellipsis. Heuristic: after `itemsBeforeCollapse`\n // visible items from the start (clamped to the visible length).\n const ellipsisInsertAt = useMemo(() => {\n if (inlineExpanded || allHiddenItems.length === 0) {\n return -1;\n }\n return Math.min(itemsBeforeCollapse, visibleItemsForRender.length);\n }, [allHiddenItems.length, inlineExpanded, visibleItemsForRender.length, itemsBeforeCollapse]);\n\n const renderedCells: ReactNode[] = [];\n const measurementCells: ReactNode[] = [];\n\n visibleItemsForRender.forEach((item, idx) => {\n if (idx === ellipsisInsertAt && allHiddenItems.length > 0) {\n renderedCells.push(\n <Fragment key=\"__ellipsis__\">\n <BreadcrumbEllipsisInternal\n ellipsisLabel={ellipsisLabel}\n expandLabel={expandLabel}\n expandBehavior={expandBehavior}\n hiddenItems={allHiddenItems}\n onExpandInline={() => setInlineExpanded(true)}\n />\n </Fragment>\n );\n renderedCells.push(\n <Fragment key=\"__sep_ellipsis__\">\n {renderSeparator(separator, {\n fromIndex: idx - 1,\n visibleCount: visibleItemsForRender.length + 1,\n dir,\n })}\n </Fragment>\n );\n }\n\n const itemKey = item.key ?? `item-${normalizedItems.indexOf(item)}`;\n renderedCells.push(\n <Fragment key={itemKey}>\n <BreadcrumbItemRenderer\n item={item}\n currentPageLabel={currentPageLabel}\n siblingMenuLabel={siblingMenuLabel}\n maxLabelLength={maxLabelLength}\n />\n </Fragment>\n );\n const isLast = idx === visibleItemsForRender.length - 1;\n if (!isLast) {\n renderedCells.push(\n <Fragment key={`sep-${itemKey}`}>\n {renderSeparator(separator, {\n fromIndex: idx,\n visibleCount: visibleItemsForRender.length,\n dir,\n })}\n </Fragment>\n );\n }\n });\n\n if (collapseOnOverflow && expandBehavior !== 'scroll') {\n countCollapse.visible.forEach((item, idx) => {\n const itemKey = item.key ?? `m-${idx}`;\n measurementCells.push(\n <View key={itemKey} onLayout={widthFit.onItemLayout(idx)}>\n <BreadcrumbItemRenderer\n item={item}\n currentPageLabel={currentPageLabel}\n siblingMenuLabel={siblingMenuLabel}\n maxLabelLength={maxLabelLength}\n />\n </View>\n );\n });\n measurementCells.push(\n <View key=\"__m_sep__\" onLayout={widthFit.onSeparatorLayout}>\n {renderSeparator(separator, {\n fromIndex: 0,\n visibleCount: countCollapse.visible.length,\n dir,\n })}\n </View>\n );\n measurementCells.push(\n <View key=\"__m_ellipsis__\" onLayout={widthFit.onEllipsisLayout}>\n <BreadcrumbEllipsisInternal\n ellipsisLabel={ellipsisLabel}\n expandLabel={expandLabel}\n expandBehavior=\"none\"\n hiddenItems={[]}\n onExpandInline={() => undefined}\n />\n </View>\n );\n }\n\n const list = (\n <View\n role=\"list\"\n accessibilityRole=\"list\"\n className={cn('flex-row items-center')}\n style={{ flexDirection: 'row', alignItems: 'center', flexShrink: 1, minWidth: 0 }}\n >\n {renderedCells}\n </View>\n );\n\n // When width-based collapse is on, the wrapper MUST measure the\n // available width — not its content's natural width. Without an\n // explicit `width: '100%'` (or `alignSelf: 'stretch'`) the wrapper\n // hugs its row of items on native, so `containerWidth` from\n // `onLayout` equals the items' total — and the algorithm\n // never sees an overflow. With `width: '100%'`, the wrapper fills\n // its parent's cross-axis (which is the row width in a typical\n // column-flex parent), giving us a real budget to compare against.\n const wrapperStyle: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n direction: dir as ViewStyle['direction'],\n flexShrink: 1,\n minWidth: 0,\n ...(collapseOnOverflow && expandBehavior !== 'scroll' ? { width: '100%' } : null),\n // `overflow: 'hidden'` keeps the visible row from blowing past\n // its container before the first measurement settles. Without\n // it, native renders the natural-width row briefly on the first\n // paint, even though the JS layout reports the correct measured\n // width on the very next tick.\n ...(collapseOnOverflow ? { overflow: 'hidden' as ViewStyle['overflow'] } : null),\n };\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"navigation\"\n aria-label={ariaLabel}\n accessible\n accessibilityLabel={ariaLabel}\n className={cn('flex-row items-center', className)}\n style={wrapperStyle}\n onLayout={collapseOnOverflow && expandBehavior !== 'scroll' ? widthFit.onContainerLayout : undefined}\n >\n {expandBehavior === 'scroll' ? (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ flexDirection: 'row', alignItems: 'center' }}\n style={{ flexGrow: 1 }}\n >\n {list}\n </ScrollView>\n ) : (\n list\n )}\n\n {/* Hidden measurement copy. Offscreen on both platforms. */}\n {collapseOnOverflow && expandBehavior !== 'scroll' ? (\n <View\n aria-hidden\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n position: 'absolute',\n opacity: 0,\n flexDirection: 'row',\n alignItems: 'center',\n left: -99999,\n top: 0,\n // `pointerEvents` lives on the style object now —\n // the prop form is deprecated in RN 0.71+ / RN-Web\n // 0.20+ and emits a runtime warning every render.\n pointerEvents: 'none' as ViewStyle['pointerEvents'],\n }}\n >\n {measurementCells}\n </View>\n ) : null}\n </View>\n );\n};\n\n// =============================================================================\n// Item renderer (items-mode)\n// =============================================================================\n\ntype ItemRendererProps = {\n item: BreadcrumbItemData;\n currentPageLabel: string;\n siblingMenuLabel: string;\n maxLabelLength: number;\n};\n\nconst BreadcrumbItemRenderer = ({ item, currentPageLabel, siblingMenuLabel, maxLabelLength }: ItemRendererProps) => {\n const colors = useThemeColors();\n const Icon = item.icon;\n const isLink = !item.current && (item.href !== undefined || item.onSelect !== undefined);\n\n const effectiveMax = item.maxLabelLength ?? maxLabelLength;\n const renderLabel = (): ReactNode => {\n if (item.loading) {\n return (\n <View\n style={{\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: px(colors.radius.sm),\n height: px(colors.fontSize.sm),\n width: 64,\n }}\n />\n );\n }\n if (typeof item.label === 'string' || typeof item.label === 'number') {\n const text = String(item.label);\n const truncated = effectiveMax > 0 ? truncateString(text, effectiveMax) : text;\n return (\n <RNText\n numberOfLines={1}\n ellipsizeMode=\"tail\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: item.current ? colors.semantic.text.default : colors.semantic.text.muted,\n fontWeight: item.current\n ? (colors.fontWeight.semibold as '600')\n : (colors.fontWeight.regular as '400'),\n }}\n >\n {truncated}\n </RNText>\n );\n }\n return item.label;\n };\n\n const inner = (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: px(colors.spacing['1']),\n }}\n >\n {Icon ? (\n <Icon size={14} color={item.current ? colors.semantic.text.default : colors.semantic.text.muted} />\n ) : null}\n {renderLabel()}\n </View>\n );\n\n if (item.current) {\n return (\n <View\n role=\"listitem\"\n accessibilityRole=\"text\"\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}\n >\n <RNText\n style={{\n position: 'absolute',\n width: 1,\n height: 1,\n overflow: 'hidden',\n opacity: 0,\n }}\n >\n {currentPageLabel}:{' '}\n </RNText>\n <View aria-current=\"page\">{inner}</View>\n </View>\n );\n }\n\n if (item.siblings && item.siblings.length > 0) {\n return (\n <View role=\"listitem\" style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}>\n <BreadcrumbInteractive item={item}>{inner}</BreadcrumbInteractive>\n <BreadcrumbSiblingMenu item={item} siblingMenuLabel={siblingMenuLabel} />\n </View>\n );\n }\n\n if (isLink) {\n return (\n <View role=\"listitem\" style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}>\n <BreadcrumbInteractive item={item}>{inner}</BreadcrumbInteractive>\n </View>\n );\n }\n\n return (\n <View role=\"listitem\" style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}>\n {inner}\n </View>\n );\n};\n\nconst BreadcrumbInteractive = ({ item, children }: { item: BreadcrumbItemData; children: ReactNode }) => {\n const colors = useThemeColors();\n const handlePress = useCallback(() => {\n item.onSelect?.();\n }, [item]);\n\n if (Platform.OS === 'web' && item.href) {\n // When the consumer passes `onSelect`, treat it as the action and\n // suppress the default `<a>` navigation. This is the standard\n // pattern for \"link-styled button\" use-cases (router Links,\n // analytics-only handlers, demo pseudo-links).\n const handleClick = item.onSelect\n ? (event: { preventDefault: () => void }) => {\n event.preventDefault();\n item.onSelect?.();\n }\n : undefined;\n return (\n <a\n href={item.href}\n onClick={handleClick}\n style={{\n color: colors.semantic.interactive.primary,\n textDecoration: 'none',\n fontFamily: colors.fontFamily.body,\n }}\n >\n {children}\n </a>\n );\n }\n\n return (\n <Pressable onPress={handlePress} accessibilityRole=\"link\" role=\"link\">\n {children}\n </Pressable>\n );\n};\n\nconst BreadcrumbSiblingMenu = ({ item, siblingMenuLabel }: { item: BreadcrumbItemData; siblingMenuLabel: string }) => {\n const colors = useThemeColors();\n const siblings = item.siblings ?? [];\n return (\n <Popover>\n <Popover.Trigger asChild={false}>\n <View\n accessibilityLabel={siblingMenuLabel}\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: 2,\n paddingVertical: 4,\n }}\n >\n <RNText\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{ fontSize: 10, color: colors.semantic.text.muted }}\n >\n ▾\n </RNText>\n </View>\n </Popover.Trigger>\n <Popover.Content side=\"bottom\" align=\"start\">\n <View style={{ minWidth: 200, paddingVertical: 4 }}>\n {siblings.map((sib, idx) => (\n <SiblingRow key={sib.href ?? idx} sibling={sib} />\n ))}\n </View>\n </Popover.Content>\n </Popover>\n );\n};\n\nconst SiblingRow = ({ sibling }: { sibling: BreadcrumbSibling }) => {\n const colors = useThemeColors();\n const Icon = sibling.icon;\n const handlePress = useCallback(() => {\n sibling.onSelect?.();\n }, [sibling]);\n\n const inner = (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: px(colors.spacing['2']),\n paddingVertical: px(colors.spacing['2']),\n paddingHorizontal: px(colors.spacing['3']),\n opacity: sibling.disabled ? 0.5 : 1,\n }}\n >\n {Icon ? <Icon size={14} color={colors.semantic.text.muted} /> : null}\n {typeof sibling.label === 'string' || typeof sibling.label === 'number' ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.default,\n }}\n >\n {String(sibling.label)}\n </RNText>\n ) : (\n sibling.label\n )}\n </View>\n );\n\n if (Platform.OS === 'web' && sibling.href && !sibling.disabled) {\n const handleClick = sibling.onSelect\n ? (event: { preventDefault: () => void }) => {\n event.preventDefault();\n sibling.onSelect?.();\n }\n : undefined;\n return (\n <a href={sibling.href} onClick={handleClick} style={{ textDecoration: 'none', color: 'inherit' }}>\n {inner}\n </a>\n );\n }\n return (\n <Pressable onPress={sibling.disabled ? undefined : handlePress} accessibilityRole=\"menuitem\">\n {inner}\n </Pressable>\n );\n};\n\n// =============================================================================\n// Ellipsis (internal — used by the items-mode renderer)\n// =============================================================================\n\ntype EllipsisProps = {\n ellipsisLabel: string;\n expandLabel: string;\n expandBehavior: BreadcrumbExpandBehavior;\n hiddenItems: ReadonlyArray<BreadcrumbItemData>;\n onExpandInline: () => void;\n};\n\nconst BreadcrumbEllipsisInternal = ({\n ellipsisLabel,\n expandLabel,\n expandBehavior,\n hiddenItems,\n onExpandInline,\n}: EllipsisProps) => {\n const colors = useThemeColors();\n const renderDots = () => (\n <RNText\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n paddingHorizontal: 4,\n }}\n >\n …\n </RNText>\n );\n\n if (expandBehavior === 'none' || hiddenItems.length === 0) {\n return (\n <View\n accessibilityLabel={ellipsisLabel}\n aria-label={ellipsisLabel}\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}\n >\n {renderDots()}\n </View>\n );\n }\n\n if (expandBehavior === 'inline') {\n return (\n <Pressable\n onPress={onExpandInline}\n accessibilityRole=\"button\"\n role=\"button\"\n accessibilityLabel={expandLabel}\n aria-label={expandLabel}\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}\n >\n {renderDots()}\n </Pressable>\n );\n }\n\n // Menu mode: ellipsis triggers a popover with the hidden items.\n return (\n <Popover>\n <Popover.Trigger asChild={false}>\n <View\n accessibilityLabel={expandLabel}\n aria-label={expandLabel}\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}\n >\n {renderDots()}\n </View>\n </Popover.Trigger>\n <Popover.Content side=\"bottom\" align=\"start\">\n <View style={{ minWidth: 200, paddingVertical: 4 }}>\n {hiddenItems.map((it, idx) => {\n const sib: BreadcrumbSibling = { label: it.label };\n if (it.href !== undefined) {\n sib.href = it.href;\n }\n if (it.icon !== undefined) {\n sib.icon = it.icon;\n }\n if (it.onSelect !== undefined) {\n sib.onSelect = it.onSelect;\n }\n return (\n <SiblingRow\n key={typeof it.key === 'string' || typeof it.key === 'number' ? it.key : idx}\n sibling={sib}\n />\n );\n })}\n </View>\n </Popover.Content>\n </Popover>\n );\n};\n\n// =============================================================================\n// Compound subcomponents\n// =============================================================================\n\nexport type BreadcrumbListProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport const BreadcrumbList = ({ children, className, testID }: BreadcrumbListProps) => {\n useBreadcrumbContext('Breadcrumb.List');\n // Auto-insert separators between consecutive `Breadcrumb.Item`s\n // unless the user provided their own. Lets users write the terse form:\n // <List><Item/><Item/><Item/></List>\n const childArray = Children.toArray(children);\n const out: ReactNode[] = [];\n let lastWasItem = false;\n childArray.forEach((child, idx) => {\n const kind = getCompoundKind(child);\n if (kind === 'item') {\n if (lastWasItem) {\n out.push(\n // biome-ignore lint/suspicious/noArrayIndexKey: separator position is deterministic from its preceding item index\n <Fragment key={`__autosep_${idx}`}>\n <BreadcrumbSeparator />\n </Fragment>\n );\n }\n out.push(child);\n lastWasItem = true;\n } else {\n out.push(child);\n lastWasItem = false;\n }\n });\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"list\"\n accessibilityRole=\"list\"\n className={cn('flex-row items-center', className)}\n style={{ flexDirection: 'row', alignItems: 'center', flexShrink: 1, minWidth: 0 }}\n >\n {out}\n </View>\n );\n};\n\nexport type BreadcrumbItemProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport const BreadcrumbItem = ({ children, className, testID }: BreadcrumbItemProps) => {\n useBreadcrumbContext('Breadcrumb.Item');\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"listitem\"\n accessibilityRole=\"text\"\n className={cn('flex-row items-center', className)}\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}\n >\n {children}\n </View>\n );\n};\ntagComponent(BreadcrumbItem, 'item');\n\nexport type BreadcrumbLinkProps = {\n href?: string;\n onPress?: () => void;\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport const BreadcrumbLink = ({ href, onPress, asChild, children, className, testID }: BreadcrumbLinkProps) => {\n const colors = useThemeColors();\n\n if (asChild) {\n return (\n <Slot\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {children}\n </Slot>\n );\n }\n\n if (Platform.OS === 'web' && href) {\n // `onPress` overrides the default `<a>` navigation — same pattern\n // as the items-mode `onSelect`. Lets consumers use `<Link>` from\n // a router or build pseudo-links for demos.\n const handleClick = onPress\n ? (event: { preventDefault: () => void }) => {\n event.preventDefault();\n onPress?.();\n }\n : undefined;\n return (\n <a\n href={href}\n onClick={handleClick}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n style={{\n color: colors.semantic.interactive.primary,\n textDecoration: 'none',\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n >\n {typeof children === 'string' || typeof children === 'number' ? (\n <RNText\n style={{\n color: colors.semantic.interactive.primary,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </a>\n );\n }\n\n return (\n <Pressable onPress={onPress} accessibilityRole=\"link\" role=\"link\" {...(testID !== undefined ? { testID } : {})}>\n {typeof children === 'string' || typeof children === 'number' ? (\n <RNText\n style={{\n color: colors.semantic.interactive.primary,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </Pressable>\n );\n};\n\nexport type BreadcrumbPageProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport const BreadcrumbPage = ({ children, className, testID }: BreadcrumbPageProps) => {\n const ctx = useBreadcrumbContext('Breadcrumb.Page');\n const colors = useThemeColors();\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"text\"\n aria-current=\"page\"\n className={cn('flex-row items-center', className)}\n style={{ flexDirection: 'row', alignItems: 'center' }}\n >\n <RNText\n style={{\n position: 'absolute',\n width: 1,\n height: 1,\n overflow: 'hidden',\n opacity: 0,\n }}\n >\n {ctx.currentPageLabel}:{' '}\n </RNText>\n {typeof children === 'string' || typeof children === 'number' ? (\n <RNText\n numberOfLines={1}\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.semibold as '600',\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </View>\n );\n};\n\nexport type BreadcrumbSeparatorProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport const BreadcrumbSeparator = ({ children, className, testID }: BreadcrumbSeparatorProps) => {\n const ctx = useBreadcrumbContext('Breadcrumb.Separator');\n const node = children ?? renderSeparator(ctx.separator, { fromIndex: 0, visibleCount: 0, dir: ctx.dir });\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n aria-hidden\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n role=\"presentation\"\n className={cn('flex-row items-center', className)}\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 2 }}\n >\n {node}\n </View>\n );\n};\ntagComponent(BreadcrumbSeparator, 'separator');\n\nexport type BreadcrumbEllipsisProps = {\n ellipsisLabel?: string;\n className?: string;\n testID?: string;\n};\n\nexport const BreadcrumbEllipsis = ({ ellipsisLabel, className, testID }: BreadcrumbEllipsisProps) => {\n useBreadcrumbContext('Breadcrumb.Ellipsis');\n const { t } = useTranslation();\n const colors = useThemeColors();\n const label = ellipsisLabel ?? t('breadcrumb.ellipsisLabel', { defaultValue: 'More' });\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n accessibilityLabel={label}\n aria-label={label}\n className={cn('flex-row items-center', className)}\n style={{ flexDirection: 'row', alignItems: 'center', paddingHorizontal: 4 }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n …\n </RNText>\n </View>\n );\n};\n\n// =============================================================================\n// Public surface\n// =============================================================================\n\nexport const Breadcrumb = Object.assign(BreadcrumbRoot, {\n List: BreadcrumbList,\n Item: BreadcrumbItem,\n Link: BreadcrumbLink,\n Page: BreadcrumbPage,\n Separator: BreadcrumbSeparator,\n Ellipsis: BreadcrumbEllipsis,\n});\n","import type { ActivityIndicatorProps } from 'react-native';\nimport { ActivityIndicator } from 'react-native';\n\nexport type SpinnerSize = 'sm' | 'md' | 'lg' | 'xl' | number;\n\nexport type SpinnerProps = Omit<ActivityIndicatorProps, 'size'> & {\n /** Visible (a11y) label. Defaults to the i18n \"common.loading\" default (\"Loading\"). */\n label?: string;\n size?: SpinnerSize;\n testID?: string;\n className?: string;\n};\n\nconst SIZE_MAP: Record<Exclude<SpinnerSize, number>, number> = {\n sm: 12,\n md: 16,\n lg: 24,\n xl: 32,\n};\n\n/**\n * Loading indicator.\n *\n * a11y: rendered with `role=\"progressbar\"` and an `aria-label` so screen\n * readers announce it. Respects `prefers-reduced-motion` — on web, react-native-web's\n * ActivityIndicator will render without animation when the media query matches;\n * on native, React Native's ActivityIndicator honors the OS reduce-motion setting\n * automatically.\n *\n * RSC-safe: pure render, no hooks.\n */\nexport const Spinner = ({ label = 'Loading', size = 'md', testID, color, style, ...rest }: SpinnerProps) => {\n const px = typeof size === 'number' ? size : SIZE_MAP[size];\n return (\n <ActivityIndicator\n {...rest}\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"progressbar\"\n accessibilityLabel={label}\n {...(color !== undefined ? { color } : {})}\n size={px}\n style={[{ width: px, height: px }, style]}\n />\n );\n};\n","'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport type { ComponentType, ReactNode, Ref } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { PressableProps, StyleProp, View, ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText } from 'react-native';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\n\ntype IconSlot = ComponentType<{ size?: number; color?: string }>;\n\nexport type ButtonProps = Omit<PressableProps, 'disabled' | 'children'> & {\n children?: ReactNode;\n variant?: ButtonVariant;\n size?: ButtonSize;\n disabled?: boolean;\n loading?: boolean;\n leadingIcon?: IconSlot;\n trailingIcon?: IconSlot;\n /** If true, the single child becomes the interactive element (Slot pattern). */\n asChild?: boolean;\n className?: string;\n testID?: string;\n ref?: Ref<View>;\n};\n\n// NativeWind classes — the `dark:` variants flip colors when <html> carries\n// the `dark` class (or `data-theme=\"dark\"`); see the tokens Tailwind preset.\n//\n// These act as the no-NativeWind fallback (e.g. raw JSX in Expo Snack\n// without a compile step) and the dark-mode bridge. The dimensional\n// utilities (`rounded-md`, `h-10`, `px-4`, `gap-2`, `text-*`) are kept\n// because the inline `style` array always overrides them — so when a\n// `<ThemeProvider>` widens spacing/radius/fontSize, the inline values\n// win on CSS specificity and the Tailwind class is harmless.\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n primary:\n 'bg-semantic-interactive-primary hover:bg-semantic-interactive-primaryHover active:bg-semantic-interactive-primaryPressed',\n secondary:\n 'bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:active:bg-neutral-600',\n ghost: 'bg-transparent hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700',\n destructive: 'bg-semantic-interactive-destructive hover:opacity-90 active:opacity-80',\n};\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-md',\n lg: 'h-12 px-5 text-lg',\n};\n\nconst ICON_SIZE: Record<ButtonSize, number> = { sm: 14, md: 16, lg: 20 };\n\nconst BASE_CLASSES = 'inline-flex flex-row items-center justify-center gap-2 rounded-md select-none';\n\n// Heights are intentionally hardcoded — they're tightly coupled to the\n// button's overall density (a 48px target on lg, 32px on sm). Padding and\n// fontSize are pulled from the active theme so a custom theme that scales\n// the spacing/fontSize ramps also scales the button. If you want a\n// genuinely smaller / taller button, override `theme.spacing` /\n// `theme.fontSize` rather than reach for new size literals here.\nconst HEIGHT_BY_SIZE: Record<ButtonSize, number> = {\n sm: 32,\n md: 40,\n lg: 48,\n};\ntype SizeKeys = { padX: keyof Theme['spacing']; font: keyof Theme['fontSize'] };\nconst SIZE_KEYS: Record<ButtonSize, SizeKeys> = {\n sm: { padX: '3', font: 'sm' },\n md: { padX: '4', font: 'md' },\n lg: { padX: '5', font: 'lg' },\n};\n\n// gap and borderRadius come from the theme inside the component.\nconst BASE_STYLE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n disabled,\n loading,\n leadingIcon: LeadingIcon,\n trailingIcon: TrailingIcon,\n asChild,\n className,\n onPress,\n testID,\n style,\n ref,\n ...rest\n}: ButtonProps) => {\n const colors = useThemeColors();\n const isInoperative = Boolean(disabled) || Boolean(loading);\n // rn-web's `Pressable` does not reliably apply a `style` callback's\n // returned values to the rendered DOM (the static portions get\n // dropped). We track hover/press via state and pass `style` as a\n // plain array — that path produces an inline `style=\"…\"` attribute\n // on the button, which beats the dimensional Tailwind utilities on\n // CSS specificity and lets a custom `<ThemeProvider>` flow padding,\n // radius, fontSize, fontFamily, and fontWeight all the way through.\n const [hovered, setHovered] = useState(false);\n const [pressed, setPressed] = useState(false);\n const handleHoverIn = useCallback(() => setHovered(true), []);\n const handleHoverOut = useCallback(() => {\n setHovered(false);\n setPressed(false);\n }, []);\n const handlePressIn = useCallback(() => setPressed(true), []);\n const handlePressOut = useCallback(() => setPressed(false), []);\n // When disabled, drop the variant's hover/active class fragments and\n // append `pointer-events-none cursor-not-allowed` so the className\n // path matches the inline-style path: no hover tint, no press tint,\n // and the cursor signals the control is inert. We still keep the\n // base variant bg class so the resting color is right.\n const variantClasses = isInoperative\n ? VARIANT_CLASSES[variant]\n .split(' ')\n .filter((cls) => !cls.startsWith('hover:') && !cls.startsWith('active:'))\n .join(' ')\n : VARIANT_CLASSES[variant];\n const classes = cn(\n BASE_CLASSES,\n variantClasses,\n SIZE_CLASSES[size],\n isInoperative ? 'opacity-60 pointer-events-none cursor-not-allowed' : undefined,\n className\n );\n\n // Inline-style palette per (variant × interaction state). The hook is the\n // source of truth — dark mode and theme overrides flow through it.\n //\n // Why inline (not className): a class-based `:hover { background-color }`\n // can never beat an inline `style={{ backgroundColor }}` — inline wins\n // by CSS specificity. So if we want hover to actually flip the surface\n // color, hover has to be applied inline too. We use Pressable's `style`\n // callback (`{ hovered, pressed }`) which on web is wired up by\n // react-native-web and on native exposes only `pressed`. The className\n // path keeps the same Tailwind variants for the no-NativeWind fallback\n // case (Expo Snack rendering raw JSX without compilation).\n const variantStateColors: Record<ButtonVariant, { rest: string; hover: string; pressed: string }> = {\n primary: {\n rest: colors.semantic.interactive.primary,\n hover: colors.semantic.interactive.primaryHover,\n pressed: colors.semantic.interactive.primaryPressed,\n },\n secondary: {\n rest: colors.semantic.background.subtle,\n // hover / pressed must be theme-aware. The previous version\n // pulled directly from `color.neutral.{200,300}`, which are\n // raw tokens that DON'T flip per scheme — in dark mode the\n // hovered state ended up light-gray on dark, ruining contrast.\n // `border.default` / `border.strong` invert correctly: in\n // light they read as light-gray washes (next step from\n // `background.subtle`); in dark they read as the darker grays\n // expected for hover/pressed on a dark surface.\n hover: colors.semantic.border.default,\n pressed: colors.semantic.border.strong,\n },\n ghost: {\n rest: 'transparent',\n hover: colors.semantic.background.subtle,\n pressed: colors.semantic.border.default,\n },\n destructive: {\n rest: colors.semantic.interactive.destructive,\n // No darker tone token for destructive yet — fall back to a 90% /\n // 80% opacity wash by mixing through rgba. Matches the className\n // hover:opacity-90 / active:opacity-80 fallback.\n hover: colors.semantic.interactive.destructive,\n pressed: colors.semantic.interactive.destructive,\n },\n };\n const variantTextColor: Record<ButtonVariant, string> = {\n primary: colors.semantic.text.inverted,\n secondary: colors.semantic.text.default,\n ghost: colors.semantic.text.default,\n destructive: colors.semantic.text.inverted,\n };\n\n const stateColors = variantStateColors[variant];\n // When disabled (or loading), force the rest state — disabled means\n // disabled. The control should NOT visually respond to hover/press,\n // even though the OS still fires those events. Pressable also gets\n // `disabled={true}` on the Pressable below which blocks onPress, but\n // the visual treatment is owned here.\n const stateBg = isInoperative\n ? stateColors.rest\n : pressed\n ? stateColors.pressed\n : hovered\n ? stateColors.hover\n : stateColors.rest;\n // Destructive uses opacity dim instead of a separate color (matches\n // existing className behavior; keeps the red recognisable on press).\n // Same disabled rule as bg: hover/press dim is suppressed when\n // disabled — the static 0.6 opacity below handles the disabled look.\n const stateInteractionOpacity = isInoperative || variant !== 'destructive' ? 1 : pressed ? 0.8 : hovered ? 0.9 : 1;\n\n // Resolve all dimensional + typographic values from the active theme\n // so a custom theme that scales spacing / fontSize / radius / fontWeight\n // also reshapes every Button on the page.\n const sizeKeys = SIZE_KEYS[size];\n const sizeContainer: ViewStyle = {\n height: HEIGHT_BY_SIZE[size],\n paddingHorizontal: px(colors.spacing[sizeKeys.padX]),\n gap: px(colors.spacing['2']),\n borderRadius: px(colors.radius.md),\n };\n const sizeFontSize = px(colors.fontSize[sizeKeys.font]);\n\n const inlineBase: ViewStyle[] = [\n BASE_STYLE,\n { backgroundColor: stateBg },\n sizeContainer,\n { opacity: isInoperative ? 0.6 : stateInteractionOpacity },\n ];\n // Resolve the consumer's `style` against the same hover/press state\n // we just computed — this preserves the historical contract where a\n // callback `style` receives the live interaction flags. The RN\n // upstream type only declares `pressed`; rn-web also passes\n // `hovered`. Cast through `unknown` to ship both without a type\n // assertion battle.\n const consumerStyle: StyleProp<ViewStyle> =\n typeof style === 'function' ? style({ pressed, ...({ hovered } as Record<string, unknown>) } as never) : style;\n const pressableStyle: StyleProp<ViewStyle> = [...inlineBase, consumerStyle];\n const slotStyle: StyleProp<ViewStyle> = [...inlineBase, consumerStyle];\n\n const textColor = variantTextColor[variant];\n const textStyle = {\n color: textColor,\n fontFamily: colors.fontFamily.body,\n fontSize: sizeFontSize,\n fontWeight: colors.fontWeight.medium as '500',\n };\n\n const handlePress: NonNullable<PressableProps['onPress']> = (ev) => {\n if (isInoperative) {\n return;\n }\n onPress?.(ev);\n };\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n ref,\n className: classes,\n style: slotStyle,\n onClick: handlePress as unknown as (...args: unknown[]) => unknown,\n ...rest,\n };\n if (isInoperative) {\n slotProps['aria-disabled'] = true;\n }\n if (loading) {\n slotProps['aria-busy'] = true;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const pressableExtra: Record<string, unknown> = {};\n if (isInoperative) {\n pressableExtra['aria-disabled'] = true;\n }\n if (loading) {\n pressableExtra['aria-busy'] = true;\n }\n\n return (\n <Pressable\n ref={ref}\n {...(testID !== undefined ? { testID } : {})}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isInoperative, busy: Boolean(loading) }}\n disabled={isInoperative}\n onPress={handlePress}\n onHoverIn={handleHoverIn}\n onHoverOut={handleHoverOut}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n className={classes}\n style={pressableStyle}\n {...pressableExtra}\n {...rest}\n >\n {loading ? (\n <Spinner size={ICON_SIZE[size]} label=\"Loading\" color={textColor} />\n ) : LeadingIcon ? (\n <LeadingIcon size={ICON_SIZE[size]} color={textColor} />\n ) : null}\n <RNText\n className={cn('font-medium', SIZE_CLASSES[size].includes('text-') ? undefined : 'text-md')}\n style={textStyle}\n >\n {children}\n </RNText>\n {TrailingIcon ? <TrailingIcon size={ICON_SIZE[size]} color={textColor} /> : null}\n </Pressable>\n );\n};\n","import type { CalendarDate } from '@internationalized/date';\n\n/**\n * Day of week index where 0 = Sunday, 1 = Monday, ..., 6 = Saturday.\n * Matches `Date.prototype.getDay()` semantics.\n */\nexport type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\n/**\n * The weekday a calendar week begins on for the given locale, per CLDR.\n * Examples: en-US → 0 (Sun), de-DE → 1 (Mon), fa-IR → 6 (Sat).\n *\n * Trusts `Intl.Locale#getWeekInfo` as the authoritative source. Falls back\n * to a small lookup only when CLDR data is unavailable (e.g. Hermes on\n * Android with bundled ICU gaps).\n */\nexport const getFirstDayOfWeek = (locale: string): DayOfWeek => {\n try {\n // biome-ignore lint/suspicious/noExplicitAny: weekInfo is in the spec but TS lib types lag\n const loc = new Intl.Locale(locale) as any;\n const info = loc.getWeekInfo?.() ?? loc.weekInfo;\n if (typeof info?.firstDay === 'number') {\n // CLDR uses 1=Mon..7=Sun; convert to 0=Sun..6=Sat.\n return (info.firstDay === 7 ? 0 : info.firstDay) as DayOfWeek;\n }\n } catch {\n // fall through\n }\n // Fallback for environments without CLDR weekInfo (e.g. some Hermes builds).\n return FIRST_DAY_FALLBACK[locale] ?? FIRST_DAY_FALLBACK[locale.split('-')[0] ?? ''] ?? 1;\n};\n\n/**\n * Last-resort lookup when `Intl.Locale#getWeekInfo` is unavailable. Values\n * are 0=Sun..6=Sat. Keep small — only enough to keep the calendar usable\n * if the runtime has no CLDR data at all.\n */\nconst FIRST_DAY_FALLBACK: Record<string, DayOfWeek> = {\n en: 0,\n 'en-US': 0,\n 'en-CA': 0,\n 'en-GB': 1,\n 'en-AU': 1,\n de: 1,\n fr: 1,\n ja: 0,\n ar: 0,\n he: 0,\n fa: 6,\n};\n\n/**\n * The two days CLDR considers weekend in this locale (e.g. [6, 0] for\n * en-US = Sat+Sun; [5, 6] for ar-SA = Fri+Sat).\n *\n * Falls back to a small lookup when `Intl.Locale#getWeekInfo` is unavailable\n * (notably Hermes Android in some configurations).\n */\nexport const getWeekendDays = (locale: string): [DayOfWeek, DayOfWeek] => {\n try {\n // biome-ignore lint/suspicious/noExplicitAny: weekInfo is in the spec but TS lib types lag\n const loc = new Intl.Locale(locale) as any;\n const info = loc.getWeekInfo?.() ?? loc.weekInfo;\n if (info?.weekend && Array.isArray(info.weekend) && info.weekend.length === 2) {\n // CLDR uses 1=Mon..7=Sun; convert to 0=Sun..6=Sat.\n const [a, b] = info.weekend.map((d: number) => (d === 7 ? 0 : d) as DayOfWeek);\n return [a, b];\n }\n } catch {\n // fall through\n }\n return WEEKEND_FALLBACK[locale] ?? WEEKEND_FALLBACK[locale.split('-')[0] ?? ''] ?? [6, 0];\n};\n\nconst WEEKEND_FALLBACK: Record<string, [DayOfWeek, DayOfWeek]> = {\n 'en-US': [6, 0],\n 'de-DE': [6, 0],\n 'fr-FR': [6, 0],\n 'ja-JP': [6, 0],\n 'ar-SA': [5, 6],\n 'ar-AE': [5, 6],\n 'he-IL': [5, 6],\n 'fa-IR': [4, 5],\n en: [6, 0],\n de: [6, 0],\n fr: [6, 0],\n ar: [5, 6],\n he: [5, 6],\n};\n\n/**\n * Seven weekday short names ordered to begin at the locale's firstDayOfWeek.\n * Use for the calendar grid header row.\n */\nexport const formatWeekdayNames = (locale: string, format: 'short' | 'narrow' = 'short'): string[] => {\n const fmt = new Intl.DateTimeFormat(locale, { weekday: format });\n const start = getFirstDayOfWeek(locale);\n // 2026-01-04 is a Sunday in Gregorian; offset from there.\n return Array.from({ length: 7 }, (_, i) => {\n const d = new Date(Date.UTC(2026, 0, 4 + ((start + i) % 7)));\n return fmt.format(d);\n });\n};\n\n/** \"May 2026\" / \"Mai 2026\" / \"mai 2026\" — for the calendar header. */\nexport const formatMonthYearTitle = (date: CalendarDate, locale: string): string => {\n const fmt = new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' });\n return fmt.format(date.toDate('UTC'));\n};\n\n/** Twelve full month names in the active locale. */\nexport const formatMonthNames = (locale: string): string[] => {\n const fmt = new Intl.DateTimeFormat(locale, { month: 'long' });\n return Array.from({ length: 12 }, (_, m) => fmt.format(new Date(Date.UTC(2026, m, 15))));\n};\n\n/** \"May 5, 2026\" — for screen-reader announcements of the focused date. */\nexport const formatFullDate = (date: CalendarDate, locale: string): string => {\n const fmt = new Intl.DateTimeFormat(locale, { dateStyle: 'long' });\n return fmt.format(date.toDate('UTC'));\n};\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { useCallback } from 'react';\nimport type { CalendarView, ChangeMeta } from '../Calendar.types';\nimport type { DayOfWeek } from './locale-utils';\nimport type { FocusDelta } from './use-calendar-state';\n\nexport type UseCalendarKeyboardProps = {\n focusedDate: CalendarDate;\n moveFocus: (delta: FocusDelta) => void;\n selectDate: (date: CalendarDate, source: ChangeMeta['source']) => void;\n setView: (view: CalendarView) => void;\n view: CalendarView;\n /** Default 0 (Sunday). Used by Home/End to compute week boundaries. */\n firstDayOfWeek?: DayOfWeek;\n};\n\nexport const useCalendarKeyboard = (props: UseCalendarKeyboardProps) => {\n const { focusedDate, moveFocus, selectDate, firstDayOfWeek = 0 } = props;\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const focusedDow = focusedDate.toDate('UTC').getUTCDay() as DayOfWeek;\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n moveFocus({ days: -1 });\n return;\n case 'ArrowRight':\n event.preventDefault();\n moveFocus({ days: 1 });\n return;\n case 'ArrowUp':\n event.preventDefault();\n moveFocus({ weeks: -1 });\n return;\n case 'ArrowDown':\n event.preventDefault();\n moveFocus({ weeks: 1 });\n return;\n case 'PageUp':\n event.preventDefault();\n moveFocus(event.shiftKey ? { years: -1 } : { months: -1 });\n return;\n case 'PageDown':\n event.preventDefault();\n moveFocus(event.shiftKey ? { years: 1 } : { months: 1 });\n return;\n case 'Home': {\n event.preventDefault();\n const back = (focusedDow - firstDayOfWeek + 7) % 7;\n moveFocus({ days: -back });\n return;\n }\n case 'End': {\n event.preventDefault();\n const back = (focusedDow - firstDayOfWeek + 7) % 7;\n const forward = 6 - back;\n moveFocus({ days: forward });\n return;\n }\n case 'Enter':\n case ' ':\n event.preventDefault();\n selectDate(focusedDate, 'keyboard');\n return;\n default:\n return;\n }\n },\n [focusedDate, firstDayOfWeek, moveFocus, selectDate]\n );\n\n return { onKeyDown };\n};\n","import type { CalendarDate } from '@internationalized/date';\n\nexport type Constraints = {\n minValue?: CalendarDate;\n maxValue?: CalendarDate;\n isDateUnavailable?: (date: CalendarDate) => boolean;\n};\n\nconst cmp = (a: CalendarDate, b: CalendarDate): number => a.compare(b);\n\nexport const isOutOfRange = (date: CalendarDate, bounds: Pick<Constraints, 'minValue' | 'maxValue'> = {}): boolean => {\n if (bounds.minValue && cmp(date, bounds.minValue) < 0) {\n return true;\n }\n if (bounds.maxValue && cmp(date, bounds.maxValue) > 0) {\n return true;\n }\n return false;\n};\n\n/**\n * Returns a single predicate that combines minValue/maxValue bounds and\n * a user-provided `isDateUnavailable`. The composed function is what every\n * view layer (DayCell, keyboard nav focus skip, scroll list) consults.\n */\nexport const composeUnavailable =\n (c: Constraints) =>\n (date: CalendarDate): boolean => {\n if (isOutOfRange(date, c)) {\n return true;\n }\n if (c.isDateUnavailable?.(date)) {\n return true;\n }\n return false;\n };\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { getLocalTimeZone, today } from '@internationalized/date';\nimport { useCallback, useMemo, useState } from 'react';\nimport type { CalendarMode, CalendarValue, CalendarView, ChangeMeta } from '../Calendar.types';\nimport { type Constraints, composeUnavailable } from './constraints';\n\nexport type FocusDelta = {\n days?: number;\n weeks?: number;\n months?: number;\n years?: number;\n};\n\nexport type UseCalendarStateProps<M extends CalendarMode> = Constraints & {\n mode?: M;\n locale: string;\n value?: CalendarValue<M>;\n defaultValue?: CalendarValue<M>;\n onChange?: (value: CalendarValue<M>, meta: ChangeMeta) => void;\n view?: CalendarView;\n defaultView?: CalendarView;\n onViewChange?: (view: CalendarView) => void;\n};\n\nexport type UseCalendarStateReturn<M extends CalendarMode> = {\n value: CalendarValue<M>;\n view: CalendarView;\n focusedDate: CalendarDate;\n setView: (next: CalendarView) => void;\n moveFocus: (delta: FocusDelta) => void;\n setFocusedDate: (date: CalendarDate) => void;\n selectDate: (date: CalendarDate, source: ChangeMeta['source']) => void;\n isUnavailable: (date: CalendarDate) => boolean;\n};\n\nconst initialFocus = <M extends CalendarMode>(\n mode: M,\n value: CalendarValue<M> | undefined,\n fallback: CalendarDate\n): CalendarDate => {\n if (!value) {\n return fallback;\n }\n if (mode === 'single') {\n return (value as CalendarDate | null) ?? fallback;\n }\n if (mode === 'range') {\n const r = value as { start: CalendarDate; end: CalendarDate | null };\n return r?.start ?? fallback;\n }\n const arr = value as CalendarDate[];\n return arr[0] ?? fallback;\n};\n\nexport const useCalendarState = <M extends CalendarMode = 'single'>(\n props: UseCalendarStateProps<M>\n): UseCalendarStateReturn<M> => {\n const mode = (props.mode ?? 'single') as M;\n const fallback = today(getLocalTimeZone());\n\n const [internalValue, setInternalValue] = useState<CalendarValue<M>>(() => {\n if (props.value !== undefined) {\n return props.value;\n }\n if (props.defaultValue !== undefined) {\n return props.defaultValue;\n }\n return (mode === 'multiple' ? [] : null) as CalendarValue<M>;\n });\n const isControlled = props.value !== undefined;\n const value = isControlled ? (props.value as CalendarValue<M>) : internalValue;\n\n const [internalView, setInternalView] = useState<CalendarView>(props.defaultView ?? 'day');\n const isViewControlled = props.view !== undefined;\n const view = isViewControlled ? (props.view as CalendarView) : internalView;\n\n const [focusedDate, setFocusedDate] = useState<CalendarDate>(() => initialFocus(mode, value, fallback));\n\n const isUnavailable = useMemo(\n () =>\n composeUnavailable({\n ...(props.minValue !== undefined ? { minValue: props.minValue } : {}),\n ...(props.maxValue !== undefined ? { maxValue: props.maxValue } : {}),\n ...(props.isDateUnavailable !== undefined ? { isDateUnavailable: props.isDateUnavailable } : {}),\n }),\n [props.minValue, props.maxValue, props.isDateUnavailable]\n );\n\n const setView = useCallback(\n (next: CalendarView) => {\n if (!isViewControlled) {\n setInternalView(next);\n }\n props.onViewChange?.(next);\n },\n [isViewControlled, props.onViewChange]\n );\n\n const moveFocus = useCallback(\n (delta: FocusDelta) => {\n setFocusedDate((cur) => {\n let next = cur;\n if (delta.days) {\n next = next.add({ days: delta.days });\n }\n if (delta.weeks) {\n next = next.add({ weeks: delta.weeks });\n }\n if (delta.months) {\n next = next.add({ months: delta.months });\n }\n if (delta.years) {\n next = next.add({ years: delta.years });\n }\n if (!isUnavailable(next)) {\n return next;\n }\n // Target is disabled — scan in the direction of motion for\n // the next available date. Cap at ~100 days so a wide\n // disabled range doesn't loop forever; if nothing's\n // available within the cap, leave focus where it was.\n const totalDelta =\n (delta.days ?? 0) + (delta.weeks ?? 0) * 7 + (delta.months ?? 0) * 30 + (delta.years ?? 0) * 365;\n const sign = totalDelta >= 0 ? 1 : -1;\n for (let i = 1; i <= 100; i++) {\n const candidate = next.add({ days: sign * i });\n if (!isUnavailable(candidate)) {\n return candidate;\n }\n }\n return cur;\n });\n },\n [isUnavailable]\n );\n\n const selectDate = useCallback(\n (date: CalendarDate, source: ChangeMeta['source']) => {\n if (isUnavailable(date)) {\n return;\n }\n const meta: ChangeMeta = { view, source };\n let next: CalendarValue<M>;\n if (mode === 'single') {\n next = date as CalendarValue<M>;\n } else if (mode === 'multiple') {\n const arr = (value as CalendarDate[]) ?? [];\n const exists = arr.some((d) => d.compare(date) === 0);\n next = (exists ? arr.filter((d) => d.compare(date) !== 0) : [...arr, date]) as CalendarValue<M>;\n } else {\n // range mode is delegated to useRangeState\n return;\n }\n if (!isControlled) {\n setInternalValue(next);\n }\n props.onChange?.(next, meta);\n setFocusedDate(date);\n },\n [isControlled, isUnavailable, mode, props.onChange, value, view]\n );\n\n return {\n value,\n view,\n focusedDate,\n setView,\n moveFocus,\n setFocusedDate,\n selectDate,\n isUnavailable,\n };\n};\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { useCallback, useMemo, useState } from 'react';\nimport type { ChangeMeta, DateRange } from '../Calendar.types';\nimport { type Constraints, composeUnavailable } from './constraints';\n\nexport type UseRangeStateProps = Constraints & {\n value?: DateRange | null;\n defaultValue?: DateRange | null;\n onChange?: (value: DateRange | null, meta: ChangeMeta) => void;\n minNights?: number;\n maxNights?: number;\n};\n\nexport type UseRangeStateReturn = {\n value: DateRange | null;\n previewRange: DateRange | null;\n hoveredDate: CalendarDate | null;\n selectDate: (date: CalendarDate, source?: ChangeMeta['source']) => void;\n setHoveredDate: (date: CalendarDate | null) => void;\n isUnavailable: (date: CalendarDate) => boolean;\n};\n\nconst order = (a: CalendarDate, b: CalendarDate): [CalendarDate, CalendarDate] => (a.compare(b) <= 0 ? [a, b] : [b, a]);\n\nconst nightsBetween = (a: CalendarDate, b: CalendarDate): number => {\n const [first, last] = order(a, b);\n return Math.round((last.toDate('UTC').getTime() - first.toDate('UTC').getTime()) / 86400000);\n};\n\nexport const useRangeState = (props: UseRangeStateProps): UseRangeStateReturn => {\n const [internal, setInternal] = useState<DateRange | null>(props.defaultValue ?? null);\n const isControlled = props.value !== undefined;\n const value = isControlled ? (props.value ?? null) : internal;\n\n const [hoveredDate, setHoveredDate] = useState<CalendarDate | null>(null);\n\n const isUnavailable = useMemo(\n () =>\n composeUnavailable({\n ...(props.minValue !== undefined ? { minValue: props.minValue } : {}),\n ...(props.maxValue !== undefined ? { maxValue: props.maxValue } : {}),\n ...(props.isDateUnavailable !== undefined ? { isDateUnavailable: props.isDateUnavailable } : {}),\n }),\n [props.minValue, props.maxValue, props.isDateUnavailable]\n );\n\n const commit = useCallback(\n (next: DateRange | null, source: ChangeMeta['source']) => {\n if (!isControlled) {\n setInternal(next);\n }\n props.onChange?.(next, { view: 'day', source });\n },\n [isControlled, props.onChange]\n );\n\n const selectDate = useCallback(\n (date: CalendarDate, source: ChangeMeta['source'] = 'click') => {\n if (isUnavailable(date)) {\n return;\n }\n\n // No range yet, or both endpoints set → start a fresh selection.\n if (!value || value.end !== null) {\n commit({ start: date, end: null }, source);\n setHoveredDate(null);\n return;\n }\n\n // We have a pending start, no end yet.\n const nights = nightsBetween(value.start, date);\n if (props.minNights !== undefined && nights < props.minNights) {\n return;\n }\n if (props.maxNights !== undefined && nights > props.maxNights) {\n return;\n }\n\n const [start, end] = order(value.start, date);\n commit({ start, end }, source);\n setHoveredDate(null);\n },\n [commit, isUnavailable, props.maxNights, props.minNights, value]\n );\n\n const previewRange = useMemo<DateRange | null>(() => {\n if (!value || value.end !== null || !hoveredDate) {\n return null;\n }\n const [start, end] = order(value.start, hoveredDate);\n return { start, end };\n }, [hoveredDate, value]);\n\n return {\n value,\n previewRange,\n hoveredDate,\n selectDate,\n setHoveredDate,\n isUnavailable,\n };\n};\n","'use client';\n\nimport {\n type ChangeEvent,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport type { NativeScrollEvent, NativeSyntheticEvent, ViewStyle } from 'react-native';\nimport { Modal, Platform, Pressable, Text as RNText, ScrollView, useWindowDimensions, View } from 'react-native';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SelectOption<T = unknown> = {\n /** Unique value within the select. */\n value: string;\n /** Visible text. */\n label: string;\n /** Optional group label — items with the same `group` cluster together. */\n group?: string;\n disabled?: boolean;\n /** Arbitrary payload — surfaced to `renderOption` and `onChange`. */\n data?: T;\n};\n\nexport type LoadOptionsParams = {\n /** Current search input. */\n search: string;\n /** Number of items already loaded — start of the requested window. */\n offset: number;\n /** Page size requested. */\n limit: number;\n};\n\nexport type LoadOptionsResult<T = unknown> = {\n items: ReadonlyArray<SelectOption<T>>;\n /** Total available — the picker stops requesting when offset+items.length >= total. Optional; if omitted, requests stop when items.length < limit. */\n total?: number;\n};\n\nexport type SelectRenderOptionInfo = {\n /** This option matches the current value. */\n selected: boolean;\n /** This option is the keyboard focus target. */\n active: boolean;\n};\n\ntype SelectBaseProps<T = unknown> = {\n /** Static options. Mutually exclusive with `loadOptions`. */\n options?: ReadonlyArray<SelectOption<T>>;\n /**\n * Async loader. Called with `{ search, offset, limit }` whenever the\n * search input changes (debounced) or the user scrolls near the end of\n * the loaded list. Return more items + an optional total to stop the\n * pagination loop early.\n */\n loadOptions?: (params: LoadOptionsParams) => Promise<LoadOptionsResult<T>>;\n /** Page size for `loadOptions`. @defaultValue 50 */\n pageSize?: number;\n /** Show a search input above the list. @defaultValue auto-on for static options >= 10 items, always on for loadOptions */\n searchable?: boolean;\n /** Placeholder for the search input. */\n searchPlaceholder?: string;\n /** Override the default substring filter for static options. */\n filterOption?: (option: SelectOption<T>, search: string) => boolean;\n /** Custom item renderer. Called per option in the list. */\n renderOption?: (option: SelectOption<T>, info: SelectRenderOptionInfo) => ReactNode;\n /** Trigger placeholder when no value is selected. */\n placeholder?: string;\n /**\n * BCP 47 locale — drives `Intl.Collator` sorting of options when set.\n * Re-sorts on language switch so a German list reads alphabetically in\n * German vs the same list in English.\n */\n locale?: string;\n /** When `locale` is set, sort options alphabetically. @defaultValue true */\n sortByLocale?: boolean;\n /** Message shown in the popup when there are no matching options. */\n noOptionsMessage?: string;\n /** Message shown while async results are loading. */\n loadingMessage?: string;\n /** Disable interaction. */\n disabled?: boolean;\n /** RTL flips the popup alignment + text direction. */\n dir?: 'ltr' | 'rtl';\n /**\n * Virtualize the list — only DOM-render the visible window of items.\n * Auto-on when the list has more than 100 items.\n */\n virtualized?: boolean;\n /** Pixel height of a single item — required for virtualization math. @defaultValue 36 */\n itemHeight?: number;\n /** Max popup height in px. @defaultValue 320 */\n maxMenuHeight?: number;\n className?: string;\n testID?: string;\n 'aria-label'?: string;\n};\n\nexport type SelectSingleProps<T = unknown> = SelectBaseProps<T> & {\n /** Single-select mode (default — omit or pass `false`). */\n multiple?: false;\n /** Controlled value. */\n value?: string;\n /** Uncontrolled initial value. */\n defaultValue?: string;\n /** Fires when the user picks an option. */\n onChange?: (value: string, option: SelectOption<T> | undefined) => void;\n};\n\nexport type SelectMultiProps<T = unknown> = SelectBaseProps<T> & {\n /** Multi-select mode — value/onChange become array-typed. */\n multiple: true;\n /** Controlled values. */\n value?: ReadonlyArray<string>;\n /** Uncontrolled initial values. */\n defaultValue?: ReadonlyArray<string>;\n /** Fires when the selection changes. Receives the full new array of values + their resolved options. */\n onChange?: (values: ReadonlyArray<string>, options: ReadonlyArray<SelectOption<T>>) => void;\n /** Hard cap on selected count — extra picks are ignored. */\n maxSelected?: number;\n /** Max chips to render in the trigger before collapsing to \"N selected\". @defaultValue 3 */\n maxChips?: number;\n};\n\nexport type SelectProps<T = unknown> = SelectSingleProps<T> | SelectMultiProps<T>;\n\nconst DEFAULT_PAGE_SIZE = 50;\nconst DEFAULT_ITEM_HEIGHT = 36;\nconst DEFAULT_MAX_MENU = 320;\nconst SEARCH_DEBOUNCE_MS = 150;\nconst VIRTUAL_OVERSCAN = 4;\n// Reset window for the type-ahead buffer. Matches native <select> on macOS\n// closely enough that typing \"Sep\" lands on September even without a search\n// field. Shorter than the WAI-ARIA suggested 500ms feels jumpy on slow typists.\nconst TYPE_AHEAD_RESET_MS = 500;\n\nconst defaultFilter = <T,>(option: SelectOption<T>, search: string): boolean => {\n if (!search) {\n return true;\n }\n return option.label.toLowerCase().includes(search.toLowerCase());\n};\n\n/**\n * Searchable, async-capable, optionally virtualized select. Designed for the\n * \"I have 500 items behind a paginated API\" case as easily as the \"five\n * static items\" case.\n *\n * Modes:\n * - **Static** — pass `options`. The picker filters in-memory by a\n * substring match on `label` (override via `filterOption`).\n * - **Async** — pass `loadOptions(params)`. Called on search-input change\n * (debounced) and when the list scrolls near the bottom for the next\n * page. The picker manages the loaded list, so consumers don't have to.\n *\n * Other features:\n * - Custom item renderer via `renderOption`.\n * - i18n locale-aware sorting via `Intl.Collator` when `locale` is set —\n * re-sorts when the locale changes so a German list reads\n * alphabetically in German.\n * - OptGroup support — items with the same `group` field cluster in the\n * popup with a group header.\n * - Virtualized list when item count > 100 (or set `virtualized`\n * explicitly). Only the visible window is rendered.\n * - Keyboard navigation: ArrowDown / ArrowUp move the active option,\n * Home / End jump to the first / last, Enter selects, Escape closes,\n * Tab closes. Type-ahead works whether or not a search field is shown\n * (typing \"Sep\" lands on September; repeating a single char like\n * \"m\",\"m\" cycles through M-options).\n * - RTL alignment via `dir=\"rtl\"`.\n */\nexport const Select = <T = unknown>(props: SelectProps<T>) => {\n const {\n options: staticOptions,\n loadOptions,\n pageSize = DEFAULT_PAGE_SIZE,\n searchable: searchableProp,\n searchPlaceholder = 'Search…',\n filterOption,\n renderOption,\n placeholder = 'Select…',\n locale,\n sortByLocale = true,\n noOptionsMessage = 'No options',\n loadingMessage = 'Loading…',\n disabled = false,\n dir = 'ltr',\n virtualized: virtualizedProp,\n itemHeight = DEFAULT_ITEM_HEIGHT,\n maxMenuHeight = DEFAULT_MAX_MENU,\n className,\n testID,\n } = props;\n const ariaLabel = (props as { 'aria-label'?: string })['aria-label'];\n const multiple = props.multiple === true;\n const maxSelected = multiple ? (props as SelectMultiProps<T>).maxSelected : undefined;\n const maxChips = multiple ? ((props as SelectMultiProps<T>).maxChips ?? 3) : undefined;\n\n const baseId = useId();\n const colors = useThemeColors();\n const [open, setOpen] = useState(false);\n\n // We always store values as a ReadonlyArray<string> internally so the\n // toggle / replace logic stays uniform; for single mode the array is\n // either empty or has exactly one element.\n const controlledValues: ReadonlyArray<string> | undefined = multiple\n ? (props.value as ReadonlyArray<string> | undefined)\n : props.value !== undefined\n ? [props.value as string]\n : undefined;\n const defaultValues: ReadonlyArray<string> = multiple\n ? (((props as SelectMultiProps<T>).defaultValue as ReadonlyArray<string> | undefined) ?? [])\n : (props as SelectSingleProps<T>).defaultValue !== undefined\n ? [(props as SelectSingleProps<T>).defaultValue as string]\n : [];\n const [innerValues, setInnerValues] = useState<ReadonlyArray<string>>(defaultValues);\n const isControlled = controlledValues !== undefined;\n const currentValues: ReadonlyArray<string> = isControlled\n ? (controlledValues as ReadonlyArray<string>)\n : innerValues;\n /** Single-mode legacy accessor — first selected value (or undefined). */\n const current: string | undefined = currentValues[0];\n\n const [searchInput, setSearchInput] = useState('');\n const [debouncedSearch, setDebouncedSearch] = useState('');\n const [activeIndex, setActiveIndex] = useState(0);\n\n // Debounce the search input so loadOptions / filterOption don't fire on\n // every keystroke when the work is expensive.\n useEffect(() => {\n const t = setTimeout(() => setDebouncedSearch(searchInput), SEARCH_DEBOUNCE_MS);\n return () => clearTimeout(t);\n }, [searchInput]);\n\n // Async-mode internal cache of loaded options.\n const [asyncItems, setAsyncItems] = useState<SelectOption<T>[]>([]);\n const [asyncLoading, setAsyncLoading] = useState(false);\n const [asyncTotal, setAsyncTotal] = useState<number | undefined>(undefined);\n const asyncRequestId = useRef(0);\n\n const isAsync = loadOptions !== undefined;\n\n // When the search changes in async mode, reset the loaded list and\n // refetch from offset 0. The request id guards against stale resolution.\n useEffect(() => {\n if (!isAsync || !loadOptions || !open) {\n return;\n }\n const requestId = ++asyncRequestId.current;\n setAsyncLoading(true);\n setAsyncItems([]);\n setAsyncTotal(undefined);\n loadOptions({ search: debouncedSearch, offset: 0, limit: pageSize })\n .then((result) => {\n if (requestId !== asyncRequestId.current) {\n return;\n }\n setAsyncItems(result.items.slice());\n setAsyncTotal(result.total);\n })\n .catch(() => {\n // Swallow — consumers can wrap loadOptions to handle errors.\n })\n .finally(() => {\n if (requestId === asyncRequestId.current) {\n setAsyncLoading(false);\n }\n });\n }, [debouncedSearch, isAsync, loadOptions, pageSize, open]);\n\n // Helper to load the next page in async mode.\n const loadMore = useCallback(() => {\n if (!isAsync || !loadOptions || asyncLoading) {\n return;\n }\n const haveAll = asyncTotal !== undefined && asyncItems.length >= asyncTotal;\n if (haveAll) {\n return;\n }\n const requestId = ++asyncRequestId.current;\n setAsyncLoading(true);\n loadOptions({ search: debouncedSearch, offset: asyncItems.length, limit: pageSize })\n .then((result) => {\n if (requestId !== asyncRequestId.current) {\n return;\n }\n setAsyncItems((prev) => prev.concat(result.items));\n if (result.total !== undefined) {\n setAsyncTotal(result.total);\n }\n })\n .catch(() => undefined)\n .finally(() => {\n if (requestId === asyncRequestId.current) {\n setAsyncLoading(false);\n }\n });\n }, [asyncItems.length, asyncLoading, asyncTotal, debouncedSearch, isAsync, loadOptions, pageSize]);\n\n // Build the displayed option list — filter (static) or async items, then\n // optionally locale-sort.\n const visibleOptions = useMemo<SelectOption<T>[]>(() => {\n const source = isAsync ? asyncItems : (staticOptions ?? []);\n const filtered = isAsync\n ? source.slice() // async backend already handled search\n : source.filter((opt) => (filterOption ?? defaultFilter)(opt, debouncedSearch));\n if (locale && sortByLocale) {\n const collator = new Intl.Collator(locale, { sensitivity: 'base', numeric: true });\n // Group-aware sort: stable on group, then on label.\n return filtered.slice().sort((a, b) => {\n const ga = a.group ?? '';\n const gb = b.group ?? '';\n const groupDelta = collator.compare(ga, gb);\n if (groupDelta !== 0) {\n return groupDelta;\n }\n return collator.compare(a.label, b.label);\n });\n }\n return filtered;\n }, [isAsync, asyncItems, staticOptions, filterOption, debouncedSearch, locale, sortByLocale]);\n\n const selectedOption = useMemo(() => {\n const all = isAsync ? asyncItems : (staticOptions ?? []);\n return all.find((o) => o.value === current);\n }, [asyncItems, isAsync, staticOptions, current]);\n\n /** Multi-mode: resolved options for every currently-selected value, in selection order. */\n const selectedOptions = useMemo<ReadonlyArray<SelectOption<T>>>(() => {\n if (!multiple) {\n return [];\n }\n const all = isAsync ? asyncItems : (staticOptions ?? []);\n const map = new Map(all.map((o) => [o.value, o]));\n return currentValues.map((v) => map.get(v)).filter((o): o is SelectOption<T> => o !== undefined);\n }, [multiple, currentValues, asyncItems, isAsync, staticOptions]);\n\n const searchable = searchableProp ?? (isAsync || (staticOptions !== undefined && staticOptions.length >= 10));\n const virtualized = virtualizedProp ?? visibleOptions.length > 100;\n\n // Keep activeIndex in bounds.\n useEffect(() => {\n setActiveIndex((idx) => Math.min(Math.max(0, idx), Math.max(0, visibleOptions.length - 1)));\n }, [visibleOptions.length]);\n\n const onSelect = useCallback(\n (option: SelectOption<T>) => {\n if (option.disabled) {\n return;\n }\n if (multiple) {\n const has = currentValues.includes(option.value);\n let nextValues: string[];\n if (has) {\n nextValues = currentValues.filter((v) => v !== option.value);\n } else {\n if (maxSelected !== undefined && currentValues.length >= maxSelected) {\n return; // hit the cap\n }\n nextValues = [...currentValues, option.value];\n }\n if (!isControlled) {\n setInnerValues(nextValues);\n }\n // Resolve options for callback — preserves order of nextValues.\n const allOpts: ReadonlyArray<SelectOption<T>> = [\n ...(staticOptions ?? []),\n ...(asyncItems as ReadonlyArray<SelectOption<T>>),\n ];\n const optMap = new Map(allOpts.map((o) => [o.value, o]));\n const selectedOpts = nextValues\n .map((v) => optMap.get(v))\n .filter((o): o is SelectOption<T> => o !== undefined);\n (props as SelectMultiProps<T>).onChange?.(nextValues, selectedOpts);\n // Multi mode: keep the popup open, keep the search input — the\n // user is likely picking more than one in a row.\n return;\n }\n // Single mode — replace + close.\n if (!isControlled) {\n setInnerValues([option.value]);\n }\n (props as SelectSingleProps<T>).onChange?.(option.value, option);\n setOpen(false);\n setSearchInput('');\n },\n // biome-ignore lint/correctness/useExhaustiveDependencies: `props` is the discriminated union — destructuring it would defeat the narrowing; the asyncItems / staticOptions captures intentionally re-trigger the callback when the option pool changes\n [multiple, isControlled, currentValues, maxSelected, staticOptions, asyncItems, props]\n );\n\n /** Multi-mode helper to clear all selected values. */\n const clearAll = useCallback(() => {\n if (!isControlled) {\n setInnerValues([]);\n }\n (props as SelectMultiProps<T>).onChange?.([], []);\n // biome-ignore lint/correctness/useExhaustiveDependencies: same reason as above\n }, [isControlled, props]);\n\n const moveActive = useCallback(\n (delta: 1 | -1) => {\n setActiveIndex((idx) => {\n if (visibleOptions.length === 0) {\n return 0;\n }\n let next = (idx + delta + visibleOptions.length) % visibleOptions.length;\n // Skip disabled options.\n for (let attempts = 0; attempts < visibleOptions.length; attempts += 1) {\n if (!visibleOptions[next]?.disabled) {\n return next;\n }\n next = (next + delta + visibleOptions.length) % visibleOptions.length;\n }\n return idx;\n });\n },\n [visibleOptions]\n );\n\n // Type-ahead buffer — shared across the trigger (closed state) and the\n // popup container (open without search field). Mutable ref so we don't\n // re-render on every keystroke.\n const typeAheadRef = useRef<{ buffer: string; timer: ReturnType<typeof setTimeout> | null }>({\n buffer: '',\n timer: null,\n });\n useEffect(() => {\n // Clear any pending type-ahead timer on unmount so we don't leak it.\n return () => {\n if (typeAheadRef.current.timer) {\n clearTimeout(typeAheadRef.current.timer);\n typeAheadRef.current.timer = null;\n }\n };\n }, []);\n\n const handleTypeAhead = useCallback(\n (char: string) => {\n if (visibleOptions.length === 0) {\n return;\n }\n if (typeAheadRef.current.timer) {\n clearTimeout(typeAheadRef.current.timer);\n }\n const nextBuffer = typeAheadRef.current.buffer + char.toLowerCase();\n typeAheadRef.current.buffer = nextBuffer;\n typeAheadRef.current.timer = setTimeout(() => {\n typeAheadRef.current.buffer = '';\n typeAheadRef.current.timer = null;\n }, TYPE_AHEAD_RESET_MS);\n\n // Cycle mode: a single char OR repeated same char (e.g. \"aa\") cycles\n // through options whose label starts with that char, advancing past\n // the current activeIndex. Otherwise the buffer is treated as a\n // prefix and we search from the top — refining the match as the\n // user keeps typing (\"S\" → \"Se\" → \"Sep\" → September).\n const allSame = nextBuffer.length > 1 && nextBuffer.split('').every((c) => c === nextBuffer[0]);\n const cycleMode = nextBuffer.length === 1 || allSame;\n const needle = cycleMode ? nextBuffer.charAt(0) : nextBuffer;\n const len = visibleOptions.length;\n const startFrom = cycleMode ? (activeIndex + 1) % len : 0;\n for (let i = 0; i < len; i += 1) {\n const idx = (startFrom + i) % len;\n const opt = visibleOptions[idx];\n if (!opt || opt.disabled) {\n continue;\n }\n if (opt.label.toLowerCase().startsWith(needle)) {\n setActiveIndex(idx);\n return;\n }\n }\n },\n [visibleOptions, activeIndex]\n );\n\n // Shared list-navigation handler — used by the search input, the\n // popup container (when no search field is shown), and as the basis for\n // trigger handling. Returns true if the event was consumed so callers\n // can fall through to type-ahead handling for unhandled keys.\n const handleListKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>): boolean => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n moveActive(1);\n return true;\n case 'ArrowUp':\n event.preventDefault();\n moveActive(-1);\n return true;\n case 'Home': {\n event.preventDefault();\n const idx = visibleOptions.findIndex((o) => !o.disabled);\n if (idx >= 0) {\n setActiveIndex(idx);\n }\n return true;\n }\n case 'End': {\n event.preventDefault();\n for (let i = visibleOptions.length - 1; i >= 0; i -= 1) {\n if (!visibleOptions[i]?.disabled) {\n setActiveIndex(i);\n break;\n }\n }\n return true;\n }\n case 'Enter': {\n const opt = visibleOptions[activeIndex];\n if (opt) {\n event.preventDefault();\n onSelect(opt);\n }\n return true;\n }\n case 'Escape':\n event.preventDefault();\n setOpen(false);\n // Restore focus to the trigger so the next Tab keeps the\n // user inside the same widget instead of jumping to <body>.\n if (Platform.OS === 'web') {\n const trigger = triggerRef.current as unknown as { focus?: () => void } | null;\n trigger?.focus?.();\n }\n return true;\n case 'Tab':\n setOpen(false);\n return true;\n }\n return false;\n },\n [moveActive, activeIndex, visibleOptions, onSelect]\n );\n\n const handleSearchKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n handleListKeyDown(event);\n },\n [handleListKeyDown]\n );\n\n // Popup-container handler — only attached when there's no search input,\n // so we own type-ahead here. Falls through to the shared list handler\n // for arrow keys / Enter / Escape / Tab.\n const handlePopupKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n if (handleListKeyDown(event)) {\n return;\n }\n // Single printable character without modifiers → feed the\n // type-ahead buffer. Modifier-combos (Cmd-A, Ctrl-K) are left\n // alone so browser/OS shortcuts keep working.\n if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey && event.key !== ' ') {\n event.preventDefault();\n handleTypeAhead(event.key);\n }\n },\n [handleListKeyDown, handleTypeAhead]\n );\n\n const handleTriggerKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case ' ':\n case 'Enter':\n case 'ArrowDown':\n case 'ArrowUp':\n event.preventDefault();\n setOpen(true);\n return;\n }\n // Type-ahead on the closed trigger: open the popup and jump to\n // the matching option. Mirrors native <select> behaviour where\n // typing a letter while the control has focus changes the\n // highlighted choice without an explicit \"open\" gesture.\n if (!disabled && event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault();\n setOpen(true);\n handleTypeAhead(event.key);\n }\n },\n [disabled, handleTypeAhead]\n );\n\n // Close when clicking outside (web only). The outside check considers\n // BOTH the container (trigger area) and the popup ref because the popup\n // portals out of the container's DOM subtree (position: fixed escapes\n // any overflow:hidden ancestor, but still belongs to the same logical\n // widget).\n const containerRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const popupRef = useRef<HTMLDivElement | null>(null);\n useEffect(() => {\n if (\n Platform.OS !== 'web' ||\n typeof document === 'undefined' ||\n typeof document.addEventListener !== 'function'\n ) {\n return;\n }\n if (!open) {\n return;\n }\n const onDocClick = (event: MouseEvent) => {\n const node = containerRef.current;\n const popup = popupRef.current;\n const target = event.target as Node;\n if (node?.contains(target)) {\n return;\n }\n if (popup?.contains(target)) {\n return;\n }\n setOpen(false);\n };\n document.addEventListener('mousedown', onDocClick);\n return () => document.removeEventListener('mousedown', onDocClick);\n }, [open]);\n\n // Measure the trigger so the popup can render with `position: fixed` +\n // computed coords. position:fixed escapes any ancestor's overflow:hidden\n // (e.g. fumadocs Tabs panes, our Preview frame), which is the\n // single biggest source of \"the dropdown got cut off\" bugs.\n //\n // On native we ignore the web `position:fixed` path entirely and\n // measure via `View.measure(...)` to feed an RN `<Modal>` positioned\n // absolutely below the trigger.\n const [triggerRect, setTriggerRect] = useState<{ top: number; left: number; width: number; height: number } | null>(\n null\n );\n const measureTrigger = useCallback(() => {\n const node = triggerRef.current as unknown as {\n getBoundingClientRect?: () => DOMRect;\n measure?: (cb: (x: number, y: number, w: number, h: number, pageX: number, pageY: number) => void) => void;\n } | null;\n if (!node) {\n return;\n }\n if (Platform.OS === 'web' && typeof node.getBoundingClientRect === 'function') {\n const rect = node.getBoundingClientRect();\n setTriggerRect({ top: rect.top, left: rect.left, width: rect.width, height: rect.height });\n return;\n }\n // Native path — RN's measure() reports page-relative coords on the UI thread.\n if (typeof node.measure === 'function') {\n node.measure((_x, _y, w, h, pageX, pageY) => {\n setTriggerRect({ top: pageY, left: pageX, width: w, height: h });\n });\n }\n }, []);\n useEffect(() => {\n if (!open) {\n return;\n }\n // `window` is defined on RN's Hermes/JSC runtime but `addEventListener`\n // is web-only; gate on Platform.OS to avoid the runtime crash on native.\n if (Platform.OS !== 'web' || typeof window === 'undefined' || typeof window.addEventListener !== 'function') {\n return;\n }\n measureTrigger();\n window.addEventListener('scroll', measureTrigger, true);\n window.addEventListener('resize', measureTrigger);\n return () => {\n window.removeEventListener('scroll', measureTrigger, true);\n window.removeEventListener('resize', measureTrigger);\n };\n }, [open, measureTrigger]);\n\n // Auto-focus the popup container when it opens without a search field —\n // otherwise key events have nowhere to land and the user gets a popup\n // they can only operate with the mouse. With a search field, the input's\n // own auto-focus effect already handles this.\n useEffect(() => {\n if (!open || searchable || Platform.OS !== 'web') {\n return;\n }\n const id = requestAnimationFrame(() => {\n const node = popupRef.current as unknown as { focus?: () => void } | null;\n node?.focus?.();\n });\n return () => cancelAnimationFrame(id);\n }, [open, searchable]);\n\n // Scroll handler for async pagination. ScrollView's onScroll event shape\n // works across both react-native-web (HTMLDivElement under the hood) and\n // native (RCTScrollView), so we read offsets from `nativeEvent`.\n const onListScroll = useCallback(\n (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n if (!isAsync) {\n return;\n }\n const { contentOffset, contentSize, layoutMeasurement } = event.nativeEvent;\n const remaining = contentSize.height - contentOffset.y - layoutMeasurement.height;\n if (remaining < itemHeight * 4) {\n loadMore();\n }\n },\n [isAsync, itemHeight, loadMore]\n );\n\n // ---------- visual styling ----------\n const triggerStyle: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: px(colors.spacing['2']),\n paddingHorizontal: px(colors.spacing['3']),\n paddingVertical: px(colors.spacing['2']),\n minHeight: 36, // component-density literal — not from theme\n borderWidth: 1,\n borderColor: colors.semantic.border.default,\n borderRadius: px(colors.radius.md),\n backgroundColor: colors.semantic.background.elevated,\n opacity: disabled ? 0.6 : 1,\n };\n\n // Web: position:fixed + computed coords from the trigger so the popup\n // can escape any ancestor with `overflow: hidden` (fumadocs Tabs, our\n // Preview frame, etc.). Width matches the trigger; widen to a 200px\n // floor for readability.\n //\n // Native: same coords, but on `position:'absolute'` inside the Modal —\n // RN doesn't have `position:'fixed'`, but Modal renders above all\n // content as a true overlay so absolute coords against the screen\n // window are correct.\n const winDims = useWindowDimensions();\n const popupStyle: ViewStyle = triggerRect\n ? {\n position: (Platform.OS === 'web' ? 'fixed' : 'absolute') as unknown as 'absolute',\n top: triggerRect.top + triggerRect.height + px(colors.spacing['1']),\n left: dir === 'rtl' ? undefined : triggerRect.left,\n right:\n dir === 'rtl'\n ? Platform.OS === 'web' && typeof window !== 'undefined'\n ? window.innerWidth - (triggerRect.left + triggerRect.width)\n : winDims.width - (triggerRect.left + triggerRect.width)\n : undefined,\n minWidth: Math.max(200, triggerRect.width),\n backgroundColor: colors.semantic.background.elevated,\n borderRadius: px(colors.radius.lg),\n borderWidth: 1,\n borderColor: colors.semantic.border.default,\n // 2147483646 (max int32 - 1) so we sit above any third-party\n // chrome (toasts, modals, dev banners) without picking a fight\n // for the very top slot. Combined with portaling to body below,\n // this also dodges any ancestor stacking context that would\n // otherwise trap our z-index inside a sibling preview frame.\n zIndex: 2147483646,\n ...({ boxShadow: '0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)' } as ViewStyle),\n }\n : {\n // Trigger not yet measured — render off-screen until the\n // first measurement lands. Avoids a one-frame flash at (0,0).\n position: (Platform.OS === 'web' ? 'fixed' : 'absolute') as unknown as 'absolute',\n top: -9999,\n left: -9999,\n };\n\n const containerProps: Record<string, unknown> = {\n ref: (node: HTMLDivElement | null) => {\n containerRef.current = node;\n },\n ...(testID !== undefined ? { testID } : {}),\n dir,\n };\n\n return (\n <View {...containerProps} className={cn('relative', className)} style={{ position: 'relative' }}>\n {/* RN's Pressable TS surface doesn't model onKeyDown / aria-haspopup; rn-web forwards them. Spread at the boundary. */}\n <Pressable\n ref={(node) => {\n triggerRef.current = node as unknown as HTMLElement | null;\n }}\n {...({\n onKeyDown: handleTriggerKeyDown,\n role: 'combobox',\n accessibilityRole: 'combobox',\n 'aria-expanded': open,\n 'aria-controls': `${baseId}-listbox`,\n 'aria-haspopup': 'listbox',\n tabIndex: disabled ? -1 : 0,\n ...(ariaLabel !== undefined ? { 'aria-label': ariaLabel, accessibilityLabel: ariaLabel } : {}),\n ...(disabled ? { 'aria-disabled': true, disabled: true } : {}),\n } as Record<string, unknown>)}\n onPress={() => {\n if (disabled) {\n return;\n }\n // Re-measure on every press so the popup picks up\n // post-scroll / rotation / keyboard-shifted positions.\n measureTrigger();\n setOpen((v) => !v);\n }}\n style={triggerStyle}\n >\n {multiple ? (\n <MultiTriggerLabel options={selectedOptions} placeholder={placeholder} maxChips={maxChips ?? 3} />\n ) : (\n <RNText\n style={{\n color: selectedOption ? colors.semantic.text.default : colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n flex: 1,\n }}\n numberOfLines={1}\n >\n {selectedOption?.label ?? placeholder}\n </RNText>\n )}\n <defaultSemanticIcons.chevronDown size={16} color={colors.semantic.text.muted} />\n </Pressable>\n\n {open ? renderPopup() : null}\n </View>\n );\n\n // Local helper so we can portal to <body> on web. Why: even with\n // position:fixed, an ancestor with `transform`, `filter`, or `will-change`\n // creates a containing block that traps fixed positioning AND a stacking\n // context that traps z-index. The docs preview frames trip both. Portaling\n // to body removes all ambiguity — the popup is a top-level sibling of\n // <body>'s other children. On native, RN doesn't have a portal here, so\n // we render in place; native overflow is rarely a clipping problem\n // because RN doesn't have stacking-context-creating CSS properties.\n function renderPopup(): React.ReactNode {\n const popup = (\n <View\n ref={(node) => {\n popupRef.current = node as unknown as HTMLDivElement | null;\n }}\n {...({\n role: 'listbox',\n id: `${baseId}-listbox`,\n ...(multiple ? { 'aria-multiselectable': true } : {}),\n // Without a search field there's no input to capture\n // keystrokes — make the popup itself focusable and own\n // arrow / Enter / Escape / type-ahead. With a search\n // field these belong to the input below.\n ...(searchable ? {} : { tabIndex: -1, onKeyDown: handlePopupKeyDown }),\n } as Record<string, unknown>)}\n style={popupStyle}\n >\n {searchable ? (\n <SearchInput\n value={searchInput}\n onChange={setSearchInput}\n onKeyDown={handleSearchKeyDown}\n placeholder={searchPlaceholder}\n dir={dir}\n />\n ) : null}\n {multiple && currentValues.length > 0 ? (\n <MultiSelectionHeader count={currentValues.length} onClearAll={clearAll} />\n ) : null}\n <SelectList\n options={visibleOptions}\n activeIndex={activeIndex}\n currentValue={current}\n selectedValues={currentValues}\n multiple={multiple}\n onSelect={onSelect}\n onActiveChange={setActiveIndex}\n {...(renderOption !== undefined ? { renderOption } : {})}\n itemHeight={itemHeight}\n maxHeight={maxMenuHeight}\n virtualized={virtualized}\n loading={isAsync && asyncLoading}\n loadingMessage={loadingMessage}\n noOptionsMessage={noOptionsMessage}\n listboxId={`${baseId}-listbox`}\n onScroll={onListScroll}\n />\n </View>\n );\n if (Platform.OS === 'web' && typeof document !== 'undefined') {\n return createPortal(popup, document.body);\n }\n // Native: wrap in a transparent Modal so the popup renders above\n // all in-tree content (RN has no `position:'fixed'` and an\n // absolute child can't escape its parent's overflow). The\n // Modal's onRequestClose handles Android's hardware back button;\n // a transparent backdrop Pressable closes the popup on outside\n // tap (the equivalent of the document-mousedown handler on web).\n return (\n <Modal transparent visible animationType=\"fade\" onRequestClose={() => setOpen(false)} statusBarTranslucent>\n <Pressable\n onPress={() => setOpen(false)}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n }}\n />\n {popup}\n </Modal>\n );\n }\n};\n\n// ---------- search input (web-native input wrapped in a pressable container) ----------\n\ntype SearchInputProps = {\n value: string;\n onChange: (next: string) => void;\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;\n placeholder: string;\n dir: 'ltr' | 'rtl';\n};\n\nconst SearchInput = ({ value, onChange, onKeyDown, placeholder, dir }: SearchInputProps) => {\n const colors = useThemeColors();\n const inputRef = useRef<HTMLInputElement | null>(null);\n useEffect(() => {\n // Auto-focus when the popup opens so the user can start typing.\n inputRef.current?.focus?.();\n }, []);\n return (\n <View\n style={{\n paddingHorizontal: px(colors.spacing['2']),\n paddingVertical: px(colors.spacing['2']),\n borderBottomWidth: 1,\n borderBottomColor: colors.semantic.border.default,\n }}\n >\n <input\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={(event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value)}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n dir={dir}\n aria-label=\"Search options\"\n style={{\n width: '100%',\n // Inline `padding: '6px 8px'` shorthand intentionally kept as a\n // string for the native HTML <input> — it's not an RN style prop.\n padding: `${px(colors.spacing['2']) - 2}px ${px(colors.spacing['2'])}px`,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.default,\n backgroundColor: colors.semantic.background.elevated,\n border: `1px solid ${colors.semantic.border.default}`,\n borderRadius: px(colors.radius.sm),\n outline: 'none',\n }}\n />\n </View>\n );\n};\n\n// ---------- list (with optional virtualization + group headers) ----------\n\ntype SelectListProps<T> = {\n options: ReadonlyArray<SelectOption<T>>;\n activeIndex: number;\n currentValue: string | undefined;\n selectedValues: ReadonlyArray<string>;\n multiple: boolean;\n onSelect: (option: SelectOption<T>) => void;\n onActiveChange: (index: number) => void;\n renderOption?: (option: SelectOption<T>, info: SelectRenderOptionInfo) => ReactNode;\n itemHeight: number;\n maxHeight: number;\n virtualized: boolean;\n loading: boolean;\n loadingMessage: string;\n noOptionsMessage: string;\n listboxId: string;\n onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;\n};\n\nconst SelectList = <T,>({\n options,\n activeIndex,\n currentValue,\n selectedValues,\n multiple,\n onSelect,\n onActiveChange,\n renderOption,\n itemHeight,\n maxHeight,\n virtualized,\n loading,\n loadingMessage,\n noOptionsMessage,\n listboxId,\n onScroll,\n}: SelectListProps<T>) => {\n const colors = useThemeColors();\n const [scrollTop, setScrollTop] = useState(0);\n\n const totalHeight = options.length * itemHeight;\n const visibleStart = virtualized ? Math.max(0, Math.floor(scrollTop / itemHeight) - VIRTUAL_OVERSCAN) : 0;\n const visibleEnd = virtualized\n ? Math.min(options.length, Math.ceil((scrollTop + maxHeight) / itemHeight) + VIRTUAL_OVERSCAN)\n : options.length;\n\n const handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n if (virtualized) {\n setScrollTop(event.nativeEvent.contentOffset.y);\n }\n onScroll(event);\n };\n\n if (loading && options.length === 0) {\n return (\n <View style={{ padding: px(colors.spacing['4']), alignItems: 'center' }}>\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n >\n {loadingMessage}\n </RNText>\n </View>\n );\n }\n if (options.length === 0) {\n return (\n <View style={{ padding: px(colors.spacing['4']), alignItems: 'center' }}>\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n >\n {noOptionsMessage}\n </RNText>\n </View>\n );\n }\n\n // Group headers: when consecutive options change `group`, insert a header.\n // For virtualized mode we still respect groups by including any header\n // that precedes the visible window's first item.\n const items: ReactNode[] = [];\n let lastGroup: string | undefined;\n for (let i = visibleStart; i < visibleEnd; i += 1) {\n const opt = options[i];\n if (!opt) {\n continue;\n }\n if (opt.group !== lastGroup && opt.group !== undefined) {\n items.push(\n <View\n // biome-ignore lint/suspicious/noArrayIndexKey: group header position is stable for current visible window\n key={`grp-${i}-${opt.group}`}\n style={{\n paddingHorizontal: px(colors.spacing['3']),\n paddingTop: px(colors.spacing['2']),\n paddingBottom: px(colors.spacing['1']),\n position: virtualized ? 'absolute' : 'relative',\n top: virtualized ? i * itemHeight - px(colors.spacing['4']) : undefined,\n left: 0,\n right: 0,\n }}\n >\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: 11, // group header — component-density literal — not from theme (smaller than xs)\n fontWeight: colors.fontWeight.semibold as '600',\n textTransform: 'uppercase',\n letterSpacing: 0.5,\n }}\n >\n {opt.group}\n </RNText>\n </View>\n );\n lastGroup = opt.group;\n }\n const selected = multiple ? selectedValues.includes(opt.value) : opt.value === currentValue;\n const active = i === activeIndex;\n const itemNode = renderOption ? (\n renderOption(opt, { selected, active })\n ) : (\n <DefaultOptionRow option={opt} selected={selected} active={active} multiple={multiple} />\n );\n items.push(\n <Pressable\n // biome-ignore lint/suspicious/noArrayIndexKey: option position is stable in the visible window\n key={`opt-${i}-${opt.value}`}\n {...({\n role: 'option',\n accessibilityRole: 'none',\n 'aria-selected': selected,\n onMouseEnter: () => onActiveChange(i),\n ...(opt.disabled ? { 'aria-disabled': true, disabled: true } : {}),\n } as Record<string, unknown>)}\n onPress={() => onSelect(opt)}\n style={{\n position: virtualized ? 'absolute' : 'relative',\n top: virtualized ? i * itemHeight : undefined,\n left: 0,\n right: 0,\n height: itemHeight,\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: px(colors.spacing['3']),\n backgroundColor: active ? colors.semantic.background.subtle : 'transparent',\n opacity: opt.disabled ? 0.5 : 1,\n }}\n >\n {itemNode}\n </Pressable>\n );\n }\n\n // ScrollView is the cross-platform container — react-native-web emits\n // scroll events with the same `nativeEvent.contentOffset` shape as\n // native, so the handler is identical on both. Web also gets the\n // `nativeID` prop mapped to the underlying div's `id` for a11y.\n return (\n <ScrollView\n nativeID={listboxId}\n onScroll={handleScroll}\n scrollEventThrottle={16}\n style={{ maxHeight }}\n contentContainerStyle={virtualized ? { height: totalHeight, position: 'relative' } : undefined}\n >\n {items}\n </ScrollView>\n );\n};\n\nconst DefaultOptionRow = <T,>({\n option,\n selected,\n active,\n multiple = false,\n}: {\n option: SelectOption<T>;\n selected: boolean;\n active: boolean;\n multiple?: boolean;\n}) => {\n const colors = useThemeColors();\n return (\n <View style={{ flexDirection: 'row', alignItems: 'center', flex: 1, gap: px(colors.spacing['2']) }}>\n {multiple ? (\n // Inline checkbox-style indicator. We don't reuse <Checkbox>\n // here because the row is already a Pressable — nesting two\n // pressable surfaces breaks tap handling on native; this\n // is purely visual (the Pressable parent owns the toggle).\n <View\n aria-hidden\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n width: 18,\n height: 18,\n borderWidth: 1,\n borderRadius: px(colors.radius.sm),\n borderColor: selected ? colors.semantic.interactive.primary : colors.semantic.border.strong,\n backgroundColor: selected ? colors.semantic.interactive.primary : 'transparent',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n {selected ? <defaultSemanticIcons.check size={12} color={colors.semantic.text.inverted} /> : null}\n </View>\n ) : null}\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: selected ? (colors.fontWeight.semibold as '600') : (colors.fontWeight.regular as '400'),\n flex: 1,\n }}\n numberOfLines={1}\n >\n {option.label}\n </RNText>\n {selected && !multiple ? (\n <defaultSemanticIcons.check size={16} color={colors.semantic.interactive.primary} />\n ) : null}\n {/* keep `active` referenced — it's part of the public API consumers see via renderOption */}\n {active ? null : null}\n </View>\n );\n};\n\n// ---------- multi-select trigger label (chips with overflow) ----------\n\nconst MultiTriggerLabel = <T,>({\n options,\n placeholder,\n maxChips,\n}: {\n options: ReadonlyArray<SelectOption<T>>;\n placeholder: string;\n maxChips: number;\n}) => {\n const colors = useThemeColors();\n if (options.length === 0) {\n return (\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n flex: 1,\n }}\n numberOfLines={1}\n >\n {placeholder}\n </RNText>\n );\n }\n // When the selection grows beyond `maxChips`, collapse to a counter so\n // the trigger height stays stable on narrow screens.\n if (options.length > maxChips) {\n return (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n fontVariant: ['tabular-nums'],\n flex: 1,\n }}\n numberOfLines={1}\n >\n {options.length} selected\n </RNText>\n );\n }\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n flexWrap: 'wrap',\n rowGap: px(colors.spacing['1']),\n columnGap: px(colors.spacing['1']),\n flex: 1,\n }}\n >\n {options.map((opt) => (\n <View\n key={`chip-${opt.value}`}\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: px(colors.spacing['2']),\n paddingVertical: 2,\n borderRadius: px(colors.radius.sm),\n backgroundColor: colors.semantic.background.subtle,\n borderWidth: 1,\n borderColor: colors.semantic.border.default,\n }}\n >\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n numberOfLines={1}\n >\n {opt.label}\n </RNText>\n </View>\n ))}\n </View>\n );\n};\n\n// ---------- multi-select popup header with \"Clear all\" affordance ----------\n\nconst MultiSelectionHeader = ({ count, onClearAll }: { count: number; onClearAll: () => void }) => {\n const colors = useThemeColors();\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: px(colors.spacing['3']),\n paddingVertical: px(colors.spacing['2']),\n borderBottomWidth: 1,\n borderBottomColor: colors.semantic.border.default,\n }}\n >\n <RNText\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontVariant: ['tabular-nums'],\n }}\n >\n {count} selected\n </RNText>\n <Pressable\n role=\"button\"\n accessibilityRole=\"button\"\n aria-label=\"Clear all\"\n accessibilityLabel=\"Clear all\"\n onPress={onClearAll}\n style={({ pressed }) => ({\n paddingHorizontal: px(colors.spacing['2']),\n paddingVertical: 2,\n borderRadius: px(colors.radius.sm),\n opacity: pressed ? 0.6 : 1,\n })}\n >\n <RNText\n style={{\n color: colors.semantic.interactive.primary,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n }}\n >\n Clear all\n </RNText>\n </Pressable>\n </View>\n );\n};\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { createContext, type ReactNode, useContext } from 'react';\n\nexport type CaptionOption = {\n value: number;\n label: string;\n disabled: boolean;\n};\n\nexport type CaptionContextValue = {\n /** Currently displayed month, 1..12. */\n month: number;\n /** Currently displayed year. */\n year: number;\n visibleMonth: CalendarDate;\n /** All months a, optional disabled flag derived from min/max + isDateUnavailable. */\n monthOptions: ReadonlyArray<CaptionOption>;\n /** Years inside `yearRange`, optional disabled flag. */\n yearOptions: ReadonlyArray<CaptionOption>;\n /** Set the displayed month, 1..12. */\n setMonth: (month: number) => void;\n /** Set the displayed year. */\n setYear: (year: number) => void;\n /** Move to the previous month/year/decade depending on the current view. */\n goPrev: () => void;\n /** Move to the next month/year/decade depending on the current view. */\n goNext: () => void;\n};\n\nconst CaptionContext = createContext<CaptionContextValue | null>(null);\nCaptionContext.displayName = 'CalendarCaptionContext';\n\nexport type CaptionProviderProps = {\n value: CaptionContextValue;\n children?: ReactNode;\n};\n\nexport const CaptionProvider = ({ value, children }: CaptionProviderProps) => (\n <CaptionContext.Provider value={value}>{children}</CaptionContext.Provider>\n);\n\n/**\n * Returns the current caption state and setters for a Calendar. Use inside\n * a `<Calendar.Caption>` slot (or any direct child of a Calendar with\n * `caption=\"custom\"`) to render your own dropdowns / navigation.\n *\n * @throws if called outside a Calendar with `caption=\"custom\"`.\n */\nexport const useCalendarCaption = (): CaptionContextValue => {\n const ctx = useContext(CaptionContext);\n if (!ctx) {\n throw new Error('useCalendarCaption must be called inside a <Calendar caption=\"custom\"> subtree.');\n }\n return ctx;\n};\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { type ReactNode, useMemo } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useTranslation } from '../../../i18n/use-translation';\nimport { useThemeColors } from '../../../theme/use-theme-colors';\nimport { Select } from '../../Select';\nimport type { CalendarCaption, CalendarView } from '../Calendar.types';\nimport { formatMonthNames, formatMonthYearTitle } from '../state/locale-utils';\nimport { type CaptionContextValue, type CaptionOption, CaptionProvider } from '../state/use-caption';\n\nconst ARROW_BUTTON_GAP = 8;\n\ntype CaptionProps = {\n /** All visible months, leftmost first. Always length-1 for non-day views. */\n months: ReadonlyArray<CalendarDate>;\n locale: string;\n view: CalendarView;\n caption: CalendarCaption;\n /** Width of one month grid; titles align centered above each grid. */\n gridWidth: number;\n monthGap: number;\n /** Year-dropdown bounds. */\n yearRange: [min: number, max: number];\n /** Constraint for disabling out-of-bounds options. */\n isMonthDisabled?: (year: number, month: number) => boolean;\n isYearDisabled?: (year: number) => boolean;\n onPrev: () => void;\n onNext: () => void;\n onTitlePress: (clicked: CalendarDate) => void;\n /** Mutate the anchor month for a specific visible month index. */\n onSetMonth: (slotIndex: number, month: number) => void;\n onSetYear: (slotIndex: number, year: number) => void;\n /** Children for `caption=\"custom\"` mode. */\n children?: ReactNode;\n};\n\ntype NavButtonProps = {\n label: string;\n onPress: () => void;\n children: ReactNode;\n};\n\nconst NavButton = ({ label, onPress, children }: NavButtonProps) => {\n const colors = useThemeColors();\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n onPress={onPress}\n style={({ pressed, hovered, focused }: { pressed: boolean; hovered?: boolean; focused?: boolean }) => {\n const base: ViewStyle = {\n width: 32,\n height: 32,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 8,\n };\n const transition = {\n transitionProperty: 'background-color, border-color, transform',\n transitionDuration: '140ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n outlineStyle: 'none',\n } as unknown as ViewStyle;\n const bg = pressed\n ? colors.color.primary['200']\n : hovered\n ? colors.color.primary['100']\n : 'transparent';\n const border = focused\n ? { borderWidth: 2, borderColor: colors.semantic.interactive.primary }\n : { borderWidth: 0 };\n return [base, transition, { backgroundColor: bg, transform: [{ scale: pressed ? 0.94 : 1 }] }, border];\n }}\n >\n <RNText style={{ color: colors.semantic.text.default, fontSize: 16, lineHeight: 16, fontWeight: '500' }}>\n {children}\n </RNText>\n </Pressable>\n );\n};\n\nconst TitleButton = ({\n text,\n ariaLabel,\n onPress,\n drilldown,\n}: {\n text: string;\n ariaLabel: string;\n onPress?: () => void;\n drilldown: boolean;\n}) => {\n const colors = useThemeColors();\n if (!onPress) {\n return (\n <View style={{ paddingHorizontal: 12, paddingVertical: 6, alignItems: 'center' }}>\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontSize: 15,\n fontWeight: '600',\n letterSpacing: -0.1,\n }}\n >\n {text}\n </RNText>\n </View>\n );\n }\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={ariaLabel}\n onPress={onPress}\n style={({ pressed, hovered, focused }: { pressed: boolean; hovered?: boolean; focused?: boolean }) => {\n const base: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 6,\n paddingHorizontal: 12,\n paddingVertical: 6,\n borderRadius: 8,\n };\n const transition = {\n transitionProperty: 'background-color, transform',\n transitionDuration: '140ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n outlineStyle: 'none',\n } as unknown as ViewStyle;\n const bg = pressed\n ? colors.color.primary['200']\n : hovered\n ? colors.color.primary['100']\n : 'transparent';\n const border = focused\n ? { borderWidth: 2, borderColor: colors.semantic.interactive.primary }\n : { borderWidth: 0 };\n return [base, transition, { backgroundColor: bg, transform: [{ scale: pressed ? 0.97 : 1 }] }, border];\n }}\n >\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontSize: 15,\n fontWeight: '600',\n letterSpacing: -0.1,\n }}\n >\n {text}\n </RNText>\n {drilldown ? (\n <RNText aria-hidden style={{ color: colors.semantic.text.muted, fontSize: 10, opacity: 0.7 }}>\n ▾\n </RNText>\n ) : null}\n </Pressable>\n );\n};\n\nexport const Caption = ({\n months,\n locale,\n view,\n caption,\n gridWidth,\n monthGap,\n yearRange,\n isMonthDisabled,\n isYearDisabled,\n onPrev,\n onNext,\n onTitlePress,\n onSetMonth,\n onSetYear,\n children,\n}: CaptionProps) => {\n const { t } = useTranslation();\n\n const titleText = (m: CalendarDate) => {\n if (view === 'day') {\n return formatMonthYearTitle(m, locale);\n }\n if (view === 'month') {\n return String(m.year);\n }\n const start = m.year - (m.year % 10);\n return `${start} – ${start + 11}`;\n };\n\n const titleAriaKey =\n view === 'day'\n ? 'calendar.header.openMonthView'\n : view === 'month'\n ? 'calendar.header.openYearView'\n : 'calendar.header.openDayView';\n\n // Title row width — sized to the visible grids so titles align over them.\n const showMultiTitles = view === 'day' && months.length > 1;\n const titleRowWidth = showMultiTitles ? months.length * gridWidth + (months.length - 1) * monthGap : gridWidth;\n\n // Month and year option lists — used by the dropdown / custom modes.\n const monthNames = useMemo(() => formatMonthNames(locale), [locale]);\n\n // Custom mode: provide the context for slot consumers and render their JSX.\n // We use `months[0]` (focused leftmost month) for context — when consumers\n // need per-month dropdowns they can compose multiple `Calendar.Caption`s.\n const focused = months[0] ?? undefined;\n if (!focused) {\n return null;\n }\n const ctxValue: CaptionContextValue = {\n month: focused.month,\n year: focused.year,\n visibleMonth: focused,\n monthOptions: monthNames.map((label, i) => ({\n value: i + 1,\n label,\n disabled: isMonthDisabled?.(focused.year, i + 1) ?? false,\n })),\n yearOptions: Array.from({ length: yearRange[1] - yearRange[0] + 1 }, (_, i) => ({\n value: yearRange[0] + i,\n label: String(yearRange[0] + i),\n disabled: isYearDisabled?.(yearRange[0] + i) ?? false,\n })),\n setMonth: (m) => onSetMonth(0, m),\n setYear: (y) => onSetYear(0, y),\n goPrev: onPrev,\n goNext: onNext,\n };\n\n if (caption === 'custom') {\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n paddingBottom: 10,\n gap: ARROW_BUTTON_GAP,\n alignSelf: 'center',\n }}\n >\n <CaptionProvider value={ctxValue}>{children}</CaptionProvider>\n </View>\n );\n }\n\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n paddingBottom: 10,\n gap: ARROW_BUTTON_GAP,\n alignSelf: 'center',\n }}\n >\n <NavButton label={t('calendar.header.previous', { defaultValue: 'Previous' })} onPress={onPrev}>\n ‹\n </NavButton>\n <View style={{ flexDirection: 'row', gap: monthGap, width: titleRowWidth }}>\n {showMultiTitles ? (\n months.map((m, i) => (\n <View key={`${m.year}-${m.month}`} style={{ width: gridWidth, alignItems: 'center' }}>\n {caption === 'dropdown' && view === 'day' ? (\n <DropdownPair\n month={m.month}\n year={m.year}\n monthOptions={monthNames.map((label, j) => ({\n value: j + 1,\n label,\n disabled: isMonthDisabled?.(m.year, j + 1) ?? false,\n }))}\n yearOptions={makeYearOptions(yearRange, isYearDisabled)}\n onMonthChange={(next) => onSetMonth(i, next)}\n onYearChange={(next) => onSetYear(i, next)}\n />\n ) : (\n <TitleButton\n text={titleText(m)}\n ariaLabel={t(titleAriaKey, { defaultValue: 'Change view' })}\n onPress={() => onTitlePress(m)}\n drilldown\n />\n )}\n </View>\n ))\n ) : (\n <View style={{ width: gridWidth, alignItems: 'center' }}>\n {caption === 'dropdown' && view === 'day' ? (\n <DropdownPair\n month={focused.month}\n year={focused.year}\n monthOptions={monthNames.map((label, j) => ({\n value: j + 1,\n label,\n disabled: isMonthDisabled?.(focused.year, j + 1) ?? false,\n }))}\n yearOptions={makeYearOptions(yearRange, isYearDisabled)}\n onMonthChange={(next) => onSetMonth(0, next)}\n onYearChange={(next) => onSetYear(0, next)}\n />\n ) : (\n <TitleButton\n text={titleText(focused)}\n ariaLabel={t(titleAriaKey, { defaultValue: 'Change view' })}\n onPress={() => onTitlePress(focused)}\n drilldown\n />\n )}\n </View>\n )}\n </View>\n <NavButton label={t('calendar.header.next', { defaultValue: 'Next' })} onPress={onNext}>\n ›\n </NavButton>\n </View>\n );\n};\n\nconst makeYearOptions = (\n yearRange: [number, number],\n isYearDisabled?: (year: number) => boolean\n): ReadonlyArray<CaptionOption> =>\n Array.from({ length: yearRange[1] - yearRange[0] + 1 }, (_, i) => ({\n value: yearRange[0] + i,\n label: String(yearRange[0] + i),\n disabled: isYearDisabled?.(yearRange[0] + i) ?? false,\n }));\n\ntype DropdownPairProps = {\n month: number;\n year: number;\n monthOptions: ReadonlyArray<CaptionOption>;\n yearOptions: ReadonlyArray<CaptionOption>;\n onMonthChange: (m: number) => void;\n onYearChange: (y: number) => void;\n};\n\nconst DropdownPair = ({ month, year, monthOptions, yearOptions, onMonthChange, onYearChange }: DropdownPairProps) => {\n return (\n <View style={{ flexDirection: 'row', gap: 6 }}>\n <Select\n value={String(month)}\n onChange={(v) => onMonthChange(Number(v))}\n options={monthOptions.map((o) => ({\n value: String(o.value),\n label: o.label,\n disabled: o.disabled,\n }))}\n aria-label=\"Month\"\n searchable={false}\n />\n <Select\n value={String(year)}\n onChange={(v) => onYearChange(Number(v))}\n options={yearOptions.map((o) => ({\n value: String(o.value),\n label: o.label,\n disabled: o.disabled,\n }))}\n aria-label=\"Year\"\n searchable={false}\n />\n </View>\n );\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TextStyle, ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useThemeColors } from '../../../theme/use-theme-colors';\nimport type { DayContext } from '../Calendar.types';\n\nexport type DayCellProps = {\n ctx: DayContext;\n onPress: () => void;\n onHoverIn?: () => void;\n onHoverOut?: () => void;\n /** When provided, the slot wins over default day rendering. */\n renderDay?: (ctx: DayContext) => ReactNode;\n};\n\nexport const CELL_SIZE = 40;\n\nexport const DayCell = ({ ctx, onPress, onHoverIn, onHoverOut, renderDay }: DayCellProps) => {\n const colors = useThemeColors();\n\n const isSelectedLike = ctx.isSelected || ctx.isRangeStart || ctx.isRangeEnd;\n\n // Range middle / preview cells get a flat background drawn by the\n // gridcell wrapper in DayGrid (so adjacent cells visually connect).\n // The DayCell itself is transparent in that case.\n const isInsideRange = ctx.isInRange || ctx.isInPreviewRange;\n const isRangeMiddle = isInsideRange && !isSelectedLike;\n\n const dataState = ctx.isSelected\n ? 'selected'\n : ctx.isRangeStart\n ? 'range-start'\n : ctx.isRangeEnd\n ? 'range-end'\n : ctx.isInPreviewRange\n ? 'preview'\n : ctx.isInRange\n ? 'in-range'\n : undefined;\n\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: ctx.isUnavailable }}\n disabled={ctx.isUnavailable}\n onPress={onPress}\n {...(onHoverIn ? { onHoverIn } : {})}\n {...(onHoverOut ? { onHoverOut } : {})}\n style={({ pressed, hovered, focused }: { pressed: boolean; hovered?: boolean; focused?: boolean }) => {\n const base: ViewStyle = {\n width: CELL_SIZE,\n height: CELL_SIZE,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 999, // perfect circle for endpoints/selected\n position: 'relative',\n };\n\n if (ctx.isUnavailable) {\n return [base, { opacity: 0.28 }];\n }\n\n let backgroundColor: string | undefined;\n let transform: ViewStyle['transform'];\n let borderWidth: number | undefined;\n let borderColor: string | undefined;\n\n if (isSelectedLike) {\n backgroundColor = colors.semantic.interactive.primary;\n if (pressed) {\n backgroundColor = colors.semantic.interactive.primaryPressed;\n } else if (hovered) {\n backgroundColor = colors.semantic.interactive.primaryHover;\n }\n transform = [{ scale: pressed ? 0.94 : 1 }];\n } else if (isRangeMiddle) {\n // Sits ON TOP of the gridcell range fill. Keep transparent\n // so the bar reads continuous across cells. On hover we\n // brighten with a soft circular halo.\n backgroundColor = hovered ? colors.color.primary['200'] : 'transparent';\n transform = [{ scale: pressed ? 0.94 : 1 }];\n } else {\n // Idle / hover / focus on a non-selected non-range cell.\n if (pressed) {\n backgroundColor = colors.color.primary['200'];\n } else if (hovered) {\n backgroundColor = colors.color.primary['100'];\n } else {\n backgroundColor = 'transparent';\n }\n transform = [{ scale: pressed ? 0.94 : 1 }];\n }\n\n if ((ctx.isFocused || focused) && !isSelectedLike) {\n borderWidth = 2;\n borderColor = colors.semantic.interactive.primary;\n }\n\n // RN-Web honors these as CSS transitions; native ignores silently.\n const transition: ViewStyle = {\n transitionProperty: 'background-color, transform, border-color, opacity',\n transitionDuration: '140ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n outlineStyle: 'none',\n } as unknown as ViewStyle;\n\n return [\n base,\n transition,\n {\n backgroundColor,\n ...(transform ? { transform } : {}),\n ...(borderWidth ? { borderWidth, borderColor } : {}),\n },\n ];\n }}\n {...({\n dataSet: {\n dayKey: `${ctx.date.year}-${ctx.date.month}-${ctx.date.day}`,\n ...(dataState ? { state: dataState } : {}),\n },\n } as unknown as { dataSet: Record<string, string> })}\n >\n {renderDay ? (\n renderDay(ctx)\n ) : (\n <>\n <RNText\n style={\n {\n color: isSelectedLike\n ? colors.semantic.text.inverted\n : ctx.isOutsideMonth\n ? colors.semantic.text.muted\n : colors.semantic.text.default,\n fontSize: 14,\n fontWeight: ctx.isToday ? '600' : '400',\n opacity: ctx.isOutsideMonth ? 0.55 : 1,\n transitionProperty: 'color',\n transitionDuration: '140ms',\n } as unknown as TextStyle\n }\n >\n {ctx.date.day}\n </RNText>\n {/* Today indicator: a 4px dot below the number, primary-colored,\n becomes white when the cell is selected. Subtler than a ring\n and never causes layout shift. */}\n {ctx.isToday ? (\n <View\n style={{\n position: 'absolute',\n bottom: 5,\n width: 4,\n height: 4,\n borderRadius: 999,\n backgroundColor: isSelectedLike\n ? colors.semantic.text.inverted\n : colors.semantic.interactive.primary,\n }}\n />\n ) : null}\n </>\n )}\n </Pressable>\n );\n};\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { getLocalTimeZone, startOfMonth, today } from '@internationalized/date';\nimport { type ReactNode, useMemo } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Text as RNText, View } from 'react-native';\nimport { useThemeColors } from '../../../theme/use-theme-colors';\nimport type { CalendarMode, CalendarValue, DateRange, DayContext } from '../Calendar.types';\nimport { type DayOfWeek, formatWeekdayNames, getFirstDayOfWeek } from '../state/locale-utils';\nimport { CELL_SIZE, DayCell } from './DayCell';\n\ntype DayGridProps<M extends CalendarMode> = {\n visibleMonth: CalendarDate;\n locale: string;\n mode: M;\n value: CalendarValue<M>;\n previewRange?: DateRange | null;\n focusedDate: CalendarDate;\n isUnavailable: (date: CalendarDate) => boolean;\n weekendDays: [DayOfWeek, DayOfWeek];\n firstDayOfWeek?: DayOfWeek;\n onDayPress: (date: CalendarDate) => void;\n onDayHover?: (date: CalendarDate | null) => void;\n renderDay?: (ctx: DayContext) => ReactNode;\n};\n\nconst isInRange = (date: CalendarDate, range: DateRange | null | undefined): boolean => {\n if (!range?.end) {\n return false;\n }\n return date.compare(range.start) >= 0 && date.compare(range.end) <= 0;\n};\n\nconst buildContext = <M extends CalendarMode>(\n date: CalendarDate,\n args: {\n visibleMonth: CalendarDate;\n mode: M;\n value: CalendarValue<M>;\n previewRange?: DateRange | null;\n focusedDate: CalendarDate;\n isUnavailable: (date: CalendarDate) => boolean;\n weekendDays: [DayOfWeek, DayOfWeek];\n todayDate: CalendarDate;\n }\n): DayContext => {\n const isOutsideMonth = date.month !== args.visibleMonth.month;\n const isToday = date.compare(args.todayDate) === 0;\n const dow = date.toDate('UTC').getUTCDay() as DayOfWeek;\n const isWeekend = args.weekendDays.includes(dow);\n let isSelected = false;\n let isRangeStart = false;\n let isRangeEnd = false;\n let inRange = false;\n\n if (args.mode === 'single') {\n const v = args.value as CalendarDate | null;\n isSelected = !!v && v.compare(date) === 0;\n } else if (args.mode === 'range') {\n const r = args.value as DateRange | null;\n if (r) {\n isRangeStart = r.start.compare(date) === 0;\n isRangeEnd = r.end !== null && r.end.compare(date) === 0;\n inRange = isInRange(date, r);\n }\n } else {\n const arr = args.value as CalendarDate[];\n isSelected = arr.some((x) => x.compare(date) === 0);\n }\n\n return {\n date,\n isOutsideMonth,\n isToday,\n isSelected,\n isRangeStart,\n isRangeEnd,\n isInRange: inRange,\n isInPreviewRange: isInRange(date, args.previewRange ?? null),\n isUnavailable: args.isUnavailable(date),\n isFocused: args.focusedDate.compare(date) === 0,\n isWeekend,\n };\n};\n\n// Stable row keys for the 6-row grid — never reorder, never change count.\nconst ROW_KEYS = ['row-0', 'row-1', 'row-2', 'row-3', 'row-4', 'row-5'] as const;\n\nexport const DayGrid = <M extends CalendarMode>(props: DayGridProps<M>) => {\n const {\n visibleMonth,\n locale,\n mode,\n value,\n previewRange,\n focusedDate,\n isUnavailable,\n weekendDays,\n firstDayOfWeek,\n onDayPress,\n onDayHover,\n renderDay,\n } = props;\n\n const colors = useThemeColors();\n const fdow = firstDayOfWeek ?? getFirstDayOfWeek(locale);\n\n const cells = useMemo<CalendarDate[]>(() => {\n const start = startOfMonth(visibleMonth);\n const startDow = start.toDate('UTC').getUTCDay() as DayOfWeek;\n const back = (startDow - fdow + 7) % 7;\n const first = start.subtract({ days: back });\n const total = 42; // 6 rows × 7 — handles all month layouts\n return Array.from({ length: total }, (_, i) => first.add({ days: i }));\n }, [visibleMonth, fdow]);\n\n const weekdayNames = useMemo(() => formatWeekdayNames(locale), [locale]);\n const todayDate = useMemo(() => today(getLocalTimeZone()), []);\n\n const gridWidth = 7 * CELL_SIZE;\n\n return (\n <View role=\"grid\" style={{ width: gridWidth }}>\n <View role=\"row\" style={{ flexDirection: 'row', marginBottom: 4 }}>\n {weekdayNames.map((name) => (\n <View\n key={name}\n role=\"columnheader\"\n style={{ width: CELL_SIZE, alignItems: 'center', paddingVertical: 6 }}\n >\n <RNText\n style={{\n fontSize: 11,\n fontWeight: '500',\n letterSpacing: 0.6,\n color: colors.semantic.text.muted,\n textTransform: 'uppercase',\n }}\n >\n {name}\n </RNText>\n </View>\n ))}\n </View>\n {ROW_KEYS.map((rowKey, row) => (\n <View key={rowKey} role=\"row\" style={{ flexDirection: 'row' }}>\n {cells.slice(row * 7, row * 7 + 7).map((date) => {\n const ctx = buildContext(date, {\n visibleMonth,\n mode,\n value,\n ...(previewRange !== undefined ? { previewRange } : {}),\n focusedDate,\n isUnavailable,\n weekendDays,\n todayDate,\n });\n const isSelectedLike = ctx.isSelected || ctx.isRangeStart || ctx.isRangeEnd;\n const isInsideRange = ctx.isInRange || ctx.isInPreviewRange;\n\n // Range continuity: middle cells get a flat full-width\n // background. Endpoints get a half-fill on the side\n // facing the range so the bar visually connects with\n // the adjacent cell. Single-day ranges get no spillover.\n const wrapperStyle: ViewStyle = {\n width: CELL_SIZE,\n height: CELL_SIZE,\n position: 'relative',\n };\n const rangeFillTint = colors.color.primary['100'];\n let rangeFillStyle: ViewStyle | null = null;\n\n if (ctx.isRangeStart && !ctx.isRangeEnd) {\n rangeFillStyle = {\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: '50%',\n right: 0,\n backgroundColor: rangeFillTint,\n };\n } else if (ctx.isRangeEnd && !ctx.isRangeStart) {\n rangeFillStyle = {\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: '50%',\n backgroundColor: rangeFillTint,\n };\n } else if (isInsideRange && !isSelectedLike) {\n rangeFillStyle = {\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: rangeFillTint,\n };\n }\n\n const gridcellProps = {\n role: 'gridcell' as 'cell',\n ...(isSelectedLike ? { 'aria-selected': true as const } : {}),\n };\n\n return (\n <View\n key={`${date.year}-${date.month}-${date.day}`}\n {...gridcellProps}\n style={wrapperStyle}\n >\n {rangeFillStyle ? <View style={rangeFillStyle} /> : null}\n <DayCell\n ctx={ctx}\n onPress={() => onDayPress(date)}\n {...(onDayHover\n ? {\n onHoverIn: () => onDayHover(date),\n onHoverOut: () => onDayHover(null),\n }\n : {})}\n {...(renderDay ? { renderDay } : {})}\n />\n </View>\n );\n })}\n </View>\n ))}\n </View>\n );\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { View } from 'react-native';\n\nexport const Footer = ({ children }: { children?: ReactNode }) => <View style={{ paddingTop: 12 }}>{children}</View>;\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useThemeColors } from '../../../theme/use-theme-colors';\nimport { formatMonthNames } from '../state/locale-utils';\n\ntype MonthGridProps = {\n visibleMonth: CalendarDate;\n locale: string;\n /** Width to fill (calendar inner width). Cells distribute across this. */\n availableWidth: number;\n onSelect: (month: number) => void; // 1..12\n};\n\nconst ROW_KEYS = ['r0', 'r1', 'r2', 'r3'] as const;\n\nexport const MonthGrid = ({ visibleMonth, locale, availableWidth, onSelect }: MonthGridProps) => {\n const colors = useThemeColors();\n const names = formatMonthNames(locale);\n const cellHeight = 56;\n\n return (\n <View style={{ width: availableWidth, paddingVertical: 8 }}>\n {ROW_KEYS.map((rowKey, row) => (\n <View key={rowKey} style={{ flexDirection: 'row', marginBottom: 4 }}>\n {[0, 1, 2].map((col) => {\n const idx = row * 3 + col;\n const monthNumber = idx + 1;\n const isCurrent = monthNumber === visibleMonth.month;\n const name = names[idx] ?? '';\n return (\n <View key={monthNumber} style={{ flex: 1, paddingHorizontal: 4 }}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={name}\n onPress={() => onSelect(monthNumber)}\n style={({\n pressed,\n hovered,\n focused,\n }: {\n pressed: boolean;\n hovered?: boolean;\n focused?: boolean;\n }) => {\n const base: ViewStyle = {\n height: cellHeight,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 10,\n };\n const transition = {\n transitionProperty: 'background-color, transform, border-color',\n transitionDuration: '140ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n outlineStyle: 'none',\n } as unknown as ViewStyle;\n let bg: string;\n if (isCurrent) {\n bg = pressed\n ? colors.semantic.interactive.primaryPressed\n : hovered\n ? colors.semantic.interactive.primaryHover\n : colors.semantic.interactive.primary;\n } else if (pressed) {\n bg = colors.color.primary['200'];\n } else if (hovered) {\n bg = colors.color.primary['100'];\n } else {\n bg = 'transparent';\n }\n const border =\n focused && !isCurrent\n ? { borderWidth: 2, borderColor: colors.semantic.interactive.primary }\n : { borderWidth: 0 };\n return [\n base,\n transition,\n { backgroundColor: bg, transform: [{ scale: pressed ? 0.96 : 1 }] },\n border,\n ];\n }}\n >\n <RNText\n style={{\n color: isCurrent\n ? colors.semantic.text.inverted\n : colors.semantic.text.default,\n fontSize: 14,\n fontWeight: isCurrent ? '600' : '500',\n }}\n >\n {name}\n </RNText>\n </Pressable>\n </View>\n );\n })}\n </View>\n ))}\n </View>\n );\n};\n","'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useThemeColors } from '../../../theme/use-theme-colors';\n\ntype YearGridProps = {\n visibleMonth: CalendarDate;\n /** Width to fill (calendar inner width). */\n availableWidth: number;\n onSelect: (year: number) => void;\n};\n\nconst ROW_KEYS = ['r0', 'r1', 'r2'] as const;\n\nexport const YearGrid = ({ visibleMonth, availableWidth, onSelect }: YearGridProps) => {\n const colors = useThemeColors();\n const decadeStart = visibleMonth.year - (visibleMonth.year % 10);\n const years = Array.from({ length: 12 }, (_, i) => decadeStart + i - 1);\n const cellHeight = 60;\n\n return (\n <View style={{ width: availableWidth, paddingVertical: 8 }}>\n {ROW_KEYS.map((rowKey, row) => (\n <View key={rowKey} style={{ flexDirection: 'row', marginBottom: 4 }}>\n {[0, 1, 2, 3].map((col) => {\n const year = years[row * 4 + col];\n if (year === undefined) {\n return null;\n }\n const isCurrent = year === visibleMonth.year;\n const isAdjacentDecade = year < decadeStart || year >= decadeStart + 10;\n return (\n <View key={year} style={{ flex: 1, paddingHorizontal: 4 }}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={String(year)}\n onPress={() => onSelect(year)}\n style={({\n pressed,\n hovered,\n focused,\n }: {\n pressed: boolean;\n hovered?: boolean;\n focused?: boolean;\n }) => {\n const base: ViewStyle = {\n height: cellHeight,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 10,\n };\n const transition = {\n transitionProperty: 'background-color, transform, border-color',\n transitionDuration: '140ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n outlineStyle: 'none',\n } as unknown as ViewStyle;\n let bg: string;\n if (isCurrent) {\n bg = pressed\n ? colors.semantic.interactive.primaryPressed\n : hovered\n ? colors.semantic.interactive.primaryHover\n : colors.semantic.interactive.primary;\n } else if (pressed) {\n bg = colors.color.primary['200'];\n } else if (hovered) {\n bg = colors.color.primary['100'];\n } else {\n bg = 'transparent';\n }\n const border =\n focused && !isCurrent\n ? { borderWidth: 2, borderColor: colors.semantic.interactive.primary }\n : { borderWidth: 0 };\n return [\n base,\n transition,\n { backgroundColor: bg, transform: [{ scale: pressed ? 0.96 : 1 }] },\n border,\n ];\n }}\n >\n <RNText\n style={{\n color: isCurrent\n ? colors.semantic.text.inverted\n : colors.semantic.text.default,\n fontSize: 14,\n fontWeight: isCurrent ? '600' : '500',\n opacity: isAdjacentDecade ? 0.45 : 1,\n }}\n >\n {year}\n </RNText>\n </Pressable>\n </View>\n );\n })}\n </View>\n ))}\n </View>\n );\n};\n","'use client';\n\nimport { CalendarDate, getLocalTimeZone, today } from '@internationalized/date';\nimport { type ReactNode, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\nimport { useLocale } from '../../i18n/locale';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport type { CalendarBaseProps, CalendarMode, CalendarValue, CalendarView, DateRange } from './Calendar.types';\nimport { type DayOfWeek, getFirstDayOfWeek, getWeekendDays } from './state/locale-utils';\nimport { useCalendarKeyboard } from './state/use-calendar-keyboard';\nimport { useCalendarState } from './state/use-calendar-state';\nimport { useRangeState } from './state/use-range-state';\nimport { Caption } from './view/Caption';\nimport { CELL_SIZE } from './view/DayCell';\nimport { DayGrid } from './view/DayGrid';\nimport { Footer } from './view/Footer';\nimport { MonthGrid } from './view/MonthGrid';\nimport { YearGrid } from './view/YearGrid';\n\n// Width constants used to compute the calendar's natural content width and\n// to pick a responsive `visibleMonths` based on the parent container width.\nconst GRID_WIDTH = 7 * CELL_SIZE; // single month grid (7 cols)\nconst MONTH_GAP = 16;\nconst ARROW_AREA = 32 + 8; // nav button width + gap to first/last grid edge\nconst SURFACE_PADDING = 16;\nconst SURFACE_BORDER = 1;\nconst requiredOuterWidth = (n: number) =>\n 2 * (ARROW_AREA + SURFACE_PADDING + SURFACE_BORDER) + n * GRID_WIDTH + (n - 1) * MONTH_GAP;\n\n// Body fade-up on view/month change. The wrapper's `key` flips on every\n// navigation (prev/next, drilldown), forcing a fresh mount; FadeIn starts\n// at opacity 0 + 4px down, then bumps to 1 / 0 in an effect so the inline\n// transition runs. RN-Web honors transition* style props; native ignores.\nconst focusDayCell = (root: HTMLElement | null, date: CalendarDate, force: boolean) => {\n if (!root) {\n return;\n }\n if (!force && !root.contains(document.activeElement)) {\n return;\n }\n const sel = `[data-day-key=\"${date.year}-${date.month}-${date.day}\"]`;\n const cell = root.querySelector(sel) as HTMLElement | null;\n const isDisabled = (cell as HTMLButtonElement | null)?.disabled === true;\n if (cell && !isDisabled) {\n if (cell !== document.activeElement) {\n cell.focus();\n }\n return;\n }\n // Cell is missing or disabled — fall back to focusing the calendar root\n // so subsequent keyboard navigation continues to fire onKeyDown\n // (otherwise focus drops to <body> and arrow keys go to the page).\n if (force && !root.contains(document.activeElement)) {\n root.focus();\n }\n};\n\nconst FadeIn = ({ children }: { children: ReactNode }) => {\n const [mounted, setMounted] = useState(false);\n useEffect(() => {\n const id = requestAnimationFrame(() => setMounted(true));\n return () => cancelAnimationFrame(id);\n }, []);\n return (\n <View\n style={\n {\n opacity: mounted ? 1 : 0,\n transform: [{ translateY: mounted ? 0 : 4 }],\n transitionProperty: 'opacity, transform',\n transitionDuration: '220ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n } as ViewStyle\n }\n >\n {children}\n </View>\n );\n};\n\n/**\n * Picks a responsive number of visible months from a measured container\n * width. Used when the consumer doesn't pin `visibleMonths`. Falls back\n * to 1 month while measurement is in flight (initial render) so we never\n * overflow on first paint.\n */\nconst resolveYearRange = (\n input: [number, number] | undefined,\n minValue: import('@internationalized/date').CalendarDate | undefined,\n maxValue: import('@internationalized/date').CalendarDate | undefined,\n focusedYear: number\n): [number, number] => {\n if (input) {\n return input;\n }\n if (minValue && maxValue) {\n return [minValue.year, maxValue.year];\n }\n if (minValue) {\n return [minValue.year, Math.max(minValue.year, focusedYear + 10)];\n }\n if (maxValue) {\n return [Math.min(maxValue.year, focusedYear - 100), maxValue.year];\n }\n return [focusedYear - 100, focusedYear + 10];\n};\n\nconst pickVisibleMonths = (input: number | 'auto' | undefined, measuredWidth: number | null): number => {\n // `visibleMonths` is treated as a *maximum*: when the parent container\n // is too narrow to fit `target` months side-by-side, we drop to the\n // largest count that fits. `auto` defaults to 2.\n const target = typeof input === 'number' ? input : 2;\n if (measuredWidth == null || measuredWidth === 0) {\n // Pre-measurement (e.g. SSR / jsdom). Trust an explicit number;\n // fall back to 1 for `auto` so we don't overflow on first paint.\n return typeof input === 'number' ? input : 1;\n }\n for (let n = target; n >= 1; n--) {\n if (measuredWidth >= requiredOuterWidth(n)) {\n return n;\n }\n }\n return 1;\n};\n\n/**\n * Outer wrapper that measures the available container width and renders\n * the actual Calendar root once the measurement is in. Renders nothing on\n * the first paint to avoid the 1-month → 2-month flash; this is one\n * synchronous re-render after layout, imperceptible in practice.\n */\nconst CalendarRoot = <M extends CalendarMode = 'single'>(props: CalendarBaseProps<M>) => {\n const [containerWidth, setContainerWidth] = useState<number | null>(null);\n const onLayout = useCallback((e: LayoutChangeEvent) => {\n const next = e.nativeEvent.layout.width;\n setContainerWidth((prev) => (prev === next ? prev : next));\n }, []);\n\n return (\n <View onLayout={onLayout} style={{ width: '100%' }}>\n <CalendarSurface<M> containerWidth={containerWidth ?? 0} {...props} />\n </View>\n );\n};\n\nconst CalendarSurface = <M extends CalendarMode = 'single'>(\n props: CalendarBaseProps<M> & { containerWidth: number }\n) => {\n const providerLocale = useLocale();\n const locale = props.locale ?? providerLocale;\n\n if ((props.mode ?? 'single') === 'range') {\n return (\n <RangeCalendar\n {...(props as unknown as CalendarBaseProps<'range'> & { containerWidth: number })}\n locale={locale}\n />\n );\n }\n return (\n <SingleOrMultiCalendar\n {...(props as unknown as CalendarBaseProps<Exclude<CalendarMode, 'range'>> & { containerWidth: number })}\n locale={locale}\n />\n );\n};\n\n/**\n * Computes both the inner content width (for centering the body) and the\n * outer surface width (for the bordered card). Both depend on\n * visibleMonths only.\n */\nconst surfaceMetrics = (visibleMonths: number) => {\n const innerWidth = 2 * ARROW_AREA + visibleMonths * GRID_WIDTH + (visibleMonths - 1) * MONTH_GAP;\n return {\n innerWidth,\n // Body grids row width (excludes arrow area)\n gridsRowWidth: visibleMonths * GRID_WIDTH + (visibleMonths - 1) * MONTH_GAP,\n };\n};\n\nconst SingleOrMultiCalendar = <M extends Exclude<CalendarMode, 'range'>>(\n props: CalendarBaseProps<M> & { locale: string; containerWidth: number }\n) => {\n const { locale, renderDay, containerWidth } = props;\n const colors = useThemeColors();\n const firstDayOfWeek = props.firstDayOfWeek ?? getFirstDayOfWeek(locale);\n const weekendDays = (props.weekendDays as [DayOfWeek, DayOfWeek] | undefined) ?? getWeekendDays(locale);\n\n const visibleMonths = pickVisibleMonths(props.visibleMonths, containerWidth);\n const { innerWidth, gridsRowWidth } = surfaceMetrics(visibleMonths);\n\n // Anchor month: what the user sees. Decoupled from `state.focusedDate`\n // so selecting a day in the rightmost grid does NOT shift the view.\n // Prev/Next buttons mutate this anchor; selectDate does not.\n const containerRef = useRef<HTMLElement | null>(null);\n\n const state = useCalendarState<M>({\n ...(props.mode !== undefined ? { mode: props.mode } : {}),\n locale,\n ...(props.value !== undefined ? { value: props.value } : {}),\n ...(props.defaultValue !== undefined ? { defaultValue: props.defaultValue } : {}),\n ...(props.onChange !== undefined ? { onChange: props.onChange } : {}),\n ...(props.view !== undefined ? { view: props.view } : {}),\n ...(props.defaultView !== undefined ? { defaultView: props.defaultView } : {}),\n ...(props.onViewChange !== undefined ? { onViewChange: props.onViewChange } : {}),\n ...(props.minValue !== undefined ? { minValue: props.minValue } : {}),\n ...(props.maxValue !== undefined ? { maxValue: props.maxValue } : {}),\n ...(props.isDateUnavailable !== undefined ? { isDateUnavailable: props.isDateUnavailable } : {}),\n });\n\n const [anchor, setAnchor] = useState<CalendarDate>(state.focusedDate);\n\n // Snap the anchor when the focused date moves OUTSIDE visible months\n // (only triggered by keyboard nav). We must not re-fire when the\n // anchor changes (prev/next), or arrow navigation would snap right\n // back to the focused month. anchorRef gives us the current value\n // without putting `anchor` in the dependency array.\n const anchorRef = useRef(anchor);\n useEffect(() => {\n anchorRef.current = anchor;\n }, [anchor]);\n useEffect(() => {\n const start = anchorRef.current;\n const end = start.add({ months: visibleMonths });\n if (state.focusedDate.compare(start) < 0 || state.focusedDate.compare(end) >= 0) {\n setAnchor(state.focusedDate);\n }\n }, [state.focusedDate, visibleMonths]);\n\n const keyboardNavRef = useRef(false);\n // biome-ignore lint/correctness/useExhaustiveDependencies: state.value is intentional — re-fire focus after a selection re-renders the cell\n useLayoutEffect(() => {\n focusDayCell(containerRef.current, state.focusedDate, keyboardNavRef.current);\n keyboardNavRef.current = false;\n }, [state.focusedDate, state.value]);\n\n const months = useMemo(\n () => Array.from({ length: visibleMonths }, (_, i) => anchor.add({ months: i })),\n [anchor, visibleMonths]\n );\n\n const keyboard = useCalendarKeyboard({\n focusedDate: state.focusedDate,\n moveFocus: (delta: import('./state/use-calendar-state').FocusDelta) => {\n state.moveFocus(delta);\n // PgDn/PgUp (months) and Shift+PgDn/PgUp (years) feel like\n // \"scroll the view by N\" — shift the anchor by the same delta so\n // the focused cell stays in its current slot. Day/week deltas\n // leave the anchor alone; the snap effect handles overflow.\n if (delta.months || delta.years) {\n setAnchor((a) => {\n let next = a;\n if (delta.months) {\n next = next.add({ months: delta.months });\n }\n if (delta.years) {\n next = next.add({ years: delta.years });\n }\n return next;\n });\n }\n },\n selectDate: state.selectDate,\n setView: state.setView,\n view: state.view,\n firstDayOfWeek,\n });\n\n const onPrev = () => {\n if (state.view === 'year') {\n setAnchor((a) => a.add({ years: -10 }));\n } else if (state.view === 'month') {\n setAnchor((a) => a.add({ years: -1 }));\n } else {\n setAnchor((a) => a.add({ months: -1 }));\n }\n };\n const onNext = () => {\n if (state.view === 'year') {\n setAnchor((a) => a.add({ years: 10 }));\n } else if (state.view === 'month') {\n setAnchor((a) => a.add({ years: 1 }));\n } else {\n setAnchor((a) => a.add({ months: 1 }));\n }\n };\n const onTitlePress = () => state.setView(state.view === 'day' ? 'month' : state.view === 'month' ? 'year' : 'day');\n\n return (\n <View\n ref={(node) => {\n containerRef.current = node as unknown as HTMLElement | null;\n if (typeof props.ref === 'function') {\n props.ref(node);\n } else if (props.ref) {\n (props.ref as { current: View | null }).current = node;\n }\n }}\n {...(props.testID !== undefined ? { testID: props.testID } : {})}\n // @ts-expect-error onKeyDown is supported by react-native-web on View\n onKeyDown={(e: React.KeyboardEvent) => {\n keyboardNavRef.current = true;\n keyboard.onKeyDown(e);\n }}\n tabIndex={0}\n style={{\n padding: SURFACE_PADDING,\n backgroundColor: colors.semantic.background.elevated,\n borderRadius: 16,\n borderWidth: SURFACE_BORDER,\n borderColor: colors.semantic.border.default,\n shadowColor: '#000',\n shadowOpacity: 0.04,\n shadowRadius: 12,\n shadowOffset: { width: 0, height: 4 },\n width: innerWidth + 2 * SURFACE_PADDING + 2 * SURFACE_BORDER,\n maxWidth: '100%',\n alignSelf: 'center',\n }}\n >\n <Caption\n months={months}\n locale={locale}\n view={state.view}\n caption={props.caption ?? 'title'}\n gridWidth={GRID_WIDTH}\n monthGap={MONTH_GAP}\n yearRange={resolveYearRange(props.yearRange, props.minValue, props.maxValue, anchor.year)}\n onPrev={onPrev}\n onNext={onNext}\n onTitlePress={onTitlePress}\n onSetMonth={(slot, m) => {\n const picked = (months[slot] ?? anchor).set({ month: m, day: 1 });\n // Subtract slot offset so the picked month stays in the\n // SAME visible slot the user clicked (not the leftmost).\n setAnchor(picked.subtract({ months: slot }));\n }}\n onSetYear={(slot, y) => {\n const picked = (months[slot] ?? anchor).set({ year: y, day: 1 });\n setAnchor(picked.subtract({ months: slot }));\n }}\n >\n {props.children}\n </Caption>\n <FadeIn key={`smc-${state.view}`}>\n {state.view === 'day' && (\n <View style={{ flexDirection: 'row', gap: MONTH_GAP, alignSelf: 'center', width: gridsRowWidth }}>\n {months.map((m) => (\n <DayGrid<M>\n key={`${m.year}-${m.month}`}\n visibleMonth={m}\n locale={locale}\n mode={(props.mode ?? 'single') as M}\n value={state.value as CalendarValue<M>}\n focusedDate={state.focusedDate}\n isUnavailable={state.isUnavailable}\n weekendDays={weekendDays}\n firstDayOfWeek={firstDayOfWeek}\n onDayPress={(date) => state.selectDate(date, 'click')}\n {...(renderDay ? { renderDay } : {})}\n />\n ))}\n </View>\n )}\n {state.view === 'month' && (\n <View style={{ alignItems: 'center' }}>\n <MonthGrid\n visibleMonth={anchor}\n locale={locale}\n availableWidth={gridsRowWidth}\n onSelect={(month) => {\n setAnchor(new CalendarDate(anchor.year, month, 1));\n state.setView('day');\n }}\n />\n </View>\n )}\n {state.view === 'year' && (\n <View style={{ alignItems: 'center' }}>\n <YearGrid\n visibleMonth={anchor}\n availableWidth={gridsRowWidth}\n onSelect={(year) => {\n setAnchor(new CalendarDate(year, anchor.month, 1));\n state.setView('month');\n }}\n />\n </View>\n )}\n {props.children && (props.caption ?? 'title') !== 'custom' ? <Footer>{props.children}</Footer> : null}\n </FadeIn>\n </View>\n );\n};\n\nconst RangeCalendar = (props: CalendarBaseProps<'range'> & { locale: string; containerWidth: number }) => {\n const { locale, renderDay, containerWidth } = props;\n const colors = useThemeColors();\n const firstDayOfWeek = props.firstDayOfWeek ?? getFirstDayOfWeek(locale);\n const weekendDays = (props.weekendDays as [DayOfWeek, DayOfWeek] | undefined) ?? getWeekendDays(locale);\n\n const visibleMonths = pickVisibleMonths(props.visibleMonths, containerWidth);\n const { innerWidth, gridsRowWidth } = surfaceMetrics(visibleMonths);\n\n const containerRef = useRef<HTMLElement | null>(null);\n\n const range = useRangeState({\n ...(props.value !== undefined ? { value: props.value } : {}),\n ...(props.defaultValue !== undefined ? { defaultValue: props.defaultValue } : {}),\n ...(props.onChange !== undefined ? { onChange: props.onChange } : {}),\n ...(props.minValue !== undefined ? { minValue: props.minValue } : {}),\n ...(props.maxValue !== undefined ? { maxValue: props.maxValue } : {}),\n ...(props.isDateUnavailable !== undefined ? { isDateUnavailable: props.isDateUnavailable } : {}),\n ...(props.minNights !== undefined ? { minNights: props.minNights } : {}),\n ...(props.maxNights !== undefined ? { maxNights: props.maxNights } : {}),\n });\n\n const initialFocus = range.value?.start ?? today(getLocalTimeZone());\n const [focusedDate, setFocusedDate] = useState<CalendarDate>(initialFocus);\n const keyboardNavRef = useRef(false);\n // biome-ignore lint/correctness/useExhaustiveDependencies: range.value is intentional — re-fire focus after a selection re-renders the cell\n useLayoutEffect(() => {\n focusDayCell(containerRef.current, focusedDate, keyboardNavRef.current);\n keyboardNavRef.current = false;\n }, [focusedDate, range.value]);\n const [anchor, setAnchor] = useState<CalendarDate>(initialFocus);\n\n const [internalView, setInternalView] = useState<CalendarView>(props.defaultView ?? 'day');\n const isViewControlled = props.view !== undefined;\n const view: CalendarView = isViewControlled ? (props.view as CalendarView) : internalView;\n const setView = useCallback(\n (next: CalendarView) => {\n if (!isViewControlled) {\n setInternalView(next);\n }\n props.onViewChange?.(next);\n },\n [isViewControlled, props.onViewChange]\n );\n\n const months = useMemo(\n () => Array.from({ length: visibleMonths }, (_, i) => anchor.add({ months: i })),\n [anchor, visibleMonths]\n );\n\n const keyboard = useCalendarKeyboard({\n focusedDate,\n moveFocus: (delta) => {\n setFocusedDate((f) => {\n let next = f;\n if (delta.days) {\n next = next.add({ days: delta.days });\n }\n if (delta.weeks) {\n next = next.add({ weeks: delta.weeks });\n }\n if (delta.months) {\n next = next.add({ months: delta.months });\n }\n if (delta.years) {\n next = next.add({ years: delta.years });\n }\n return next;\n });\n if (delta.months || delta.years) {\n setAnchor((a) => {\n let next = a;\n if (delta.months) {\n next = next.add({ months: delta.months });\n }\n if (delta.years) {\n next = next.add({ years: delta.years });\n }\n return next;\n });\n }\n },\n selectDate: (date) => range.selectDate(date, 'keyboard'),\n setView,\n view,\n firstDayOfWeek,\n });\n\n const onPrev = () => {\n if (view === 'year') {\n setAnchor((a) => a.add({ years: -10 }));\n } else if (view === 'month') {\n setAnchor((a) => a.add({ years: -1 }));\n } else {\n setAnchor((a) => a.add({ months: -1 }));\n }\n };\n const onNext = () => {\n if (view === 'year') {\n setAnchor((a) => a.add({ years: 10 }));\n } else if (view === 'month') {\n setAnchor((a) => a.add({ years: 1 }));\n } else {\n setAnchor((a) => a.add({ months: 1 }));\n }\n };\n const [drilldownSlot, setDrilldownSlot] = useState(0);\n const onTitlePress = (clicked: CalendarDate) => {\n const slot = months.findIndex((m) => m.year === clicked.year && m.month === clicked.month);\n setDrilldownSlot(slot >= 0 ? slot : 0);\n if (clicked.compare(anchor) !== 0) {\n setAnchor(clicked);\n }\n setView(view === 'day' ? 'month' : view === 'month' ? 'year' : 'day');\n };\n\n return (\n <View\n ref={(node) => {\n containerRef.current = node as unknown as HTMLElement | null;\n if (typeof props.ref === 'function') {\n props.ref(node);\n } else if (props.ref) {\n (props.ref as { current: View | null }).current = node;\n }\n }}\n {...(props.testID !== undefined ? { testID: props.testID } : {})}\n // @ts-expect-error onKeyDown is supported by react-native-web on View\n onKeyDown={(e: React.KeyboardEvent) => {\n keyboardNavRef.current = true;\n keyboard.onKeyDown(e);\n }}\n tabIndex={0}\n style={{\n padding: SURFACE_PADDING,\n backgroundColor: colors.semantic.background.elevated,\n borderRadius: 16,\n borderWidth: SURFACE_BORDER,\n borderColor: colors.semantic.border.default,\n shadowColor: '#000',\n shadowOpacity: 0.04,\n shadowRadius: 12,\n shadowOffset: { width: 0, height: 4 },\n width: innerWidth + 2 * SURFACE_PADDING + 2 * SURFACE_BORDER,\n maxWidth: '100%',\n alignSelf: 'center',\n }}\n >\n <Caption\n months={months}\n locale={locale}\n view={view}\n caption={props.caption ?? 'title'}\n gridWidth={GRID_WIDTH}\n monthGap={MONTH_GAP}\n yearRange={resolveYearRange(props.yearRange, props.minValue, props.maxValue, anchor.year)}\n onPrev={onPrev}\n onNext={onNext}\n onTitlePress={onTitlePress}\n onSetMonth={(slot, m) => {\n const picked = (months[slot] ?? anchor).set({ month: m, day: 1 });\n // Subtract slot offset so the picked month stays in the\n // SAME visible slot the user clicked (not the leftmost).\n setAnchor(picked.subtract({ months: slot }));\n }}\n onSetYear={(slot, y) => {\n const picked = (months[slot] ?? anchor).set({ year: y, day: 1 });\n setAnchor(picked.subtract({ months: slot }));\n }}\n >\n {props.children}\n </Caption>\n <FadeIn key={`range-${view}`}>\n {view === 'day' && (\n <View style={{ flexDirection: 'row', gap: MONTH_GAP, alignSelf: 'center', width: gridsRowWidth }}>\n {months.map((m) => (\n <DayGrid<'range'>\n key={`${m.year}-${m.month}`}\n visibleMonth={m}\n locale={locale}\n mode=\"range\"\n value={range.value as DateRange | null}\n previewRange={range.previewRange}\n focusedDate={focusedDate}\n isUnavailable={range.isUnavailable}\n weekendDays={weekendDays}\n firstDayOfWeek={firstDayOfWeek}\n onDayPress={(date) => range.selectDate(date)}\n onDayHover={(date) => range.setHoveredDate(date)}\n {...(renderDay ? { renderDay } : {})}\n />\n ))}\n </View>\n )}\n {view === 'month' && (\n <View style={{ alignItems: 'center' }}>\n <MonthGrid\n visibleMonth={anchor}\n locale={locale}\n availableWidth={gridsRowWidth}\n onSelect={(month) => {\n const picked = new CalendarDate(anchor.year, month, 1);\n setAnchor(picked.subtract({ months: drilldownSlot }));\n setView('day');\n }}\n />\n </View>\n )}\n {view === 'year' && (\n <View style={{ alignItems: 'center' }}>\n <YearGrid\n visibleMonth={anchor}\n availableWidth={gridsRowWidth}\n onSelect={(year) => {\n const picked = new CalendarDate(year, anchor.month, 1);\n setAnchor(picked.subtract({ months: drilldownSlot }));\n setView('month');\n }}\n />\n </View>\n )}\n {props.children && (props.caption ?? 'title') !== 'custom' ? <Footer>{props.children}</Footer> : null}\n </FadeIn>\n </View>\n );\n};\n\n/**\n * Slot wrapper for Calendar's `caption=\"custom\"` mode. Use it to mark the\n * subtree that renders your own month/year pickers (or any other header\n * UI). Inside, call {@link useCalendarCaption} to read the current\n * month/year and trigger changes.\n *\n * `<Calendar.Caption>` is a transparent passthrough — Calendar renders\n * any direct children when `caption=\"custom\"`. The wrapper exists to\n * make the intent explicit at call sites and to give static analysis\n * something to introspect.\n *\n * @example\n * ```tsx\n * <Calendar caption=\"custom\">\n * <Calendar.Caption>\n * <MyMonthSelect />\n * <MyYearSelect />\n * </Calendar.Caption>\n * </Calendar>\n * ```\n */\nexport const CalendarCaption = ({ children }: CalendarCaptionProps): ReactNode => <>{children}</>;\n// react-docgen-typescript keys the generated props table by displayName,\n// and dotted names like 'Calendar.Caption' would force odd index lookups\n// downstream. Keep the registered name flat; consumers still access it\n// at call sites as `Calendar.Caption`.\nCalendarCaption.displayName = 'CalendarCaption';\n\nexport type CalendarCaptionProps = {\n /** Custom caption content — typically your own month / year selects. */\n children?: ReactNode;\n};\n\ntype CalendarComponent = typeof CalendarRoot & { Caption: typeof CalendarCaption };\n\nexport const Calendar = CalendarRoot as CalendarComponent;\nCalendar.Caption = CalendarCaption;\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\n// Layout-only bases; theme-driven dimensions are merged inside each\n// component below so a custom theme reshapes the card.\nconst SURFACE_LAYOUT_BASE: ViewStyle = {\n borderWidth: 1,\n overflow: 'hidden',\n};\n\nconst HEADER_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'column',\n};\nconst CONTENT_LAYOUT_BASE: ViewStyle = {};\nconst FOOTER_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n borderTopWidth: 1,\n};\n\nexport type CardProps = Omit<ViewProps, 'children'> & {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Container surface for grouping related content. Pair with `Card.Header`,\n * `Card.Title`, `Card.Description`, `Card.Content`, and `Card.Footer` for\n * the conventional layout, or use any children directly.\n */\nconst CardRoot = ({ children, className, style, ...rest }: CardProps) => {\n const colors = useThemeColors();\n return (\n <View\n {...rest}\n className={cn(\n 'rounded-xl border border-semantic-border-default bg-semantic-background-elevated',\n className\n )}\n style={[\n SURFACE_LAYOUT_BASE,\n {\n borderRadius: px(colors.radius.xl),\n backgroundColor: colors.semantic.background.elevated,\n borderColor: colors.semantic.border.default,\n },\n style,\n ]}\n >\n {children}\n </View>\n );\n};\n\nexport type CardSectionProps = Omit<ViewProps, 'children'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/** Header section — sits flush with the card top with comfortable padding. */\nexport const CardHeader = ({ children, className, style, ...rest }: CardSectionProps) => {\n const colors = useThemeColors();\n const headerStyle: ViewStyle = {\n ...HEADER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['6']),\n paddingTop: px(colors.spacing['5']),\n paddingBottom: px(colors.spacing['3']),\n gap: px(colors.spacing['1']),\n };\n return (\n <View {...rest} className={cn('flex-col gap-1 px-6 pt-5 pb-3', className)} style={[headerStyle, style]}>\n {children}\n </View>\n );\n};\n\n/** Body content — for arbitrary content between header and footer. */\nexport const CardContent = ({ children, className, style, ...rest }: CardSectionProps) => {\n const colors = useThemeColors();\n const contentStyle: ViewStyle = {\n ...CONTENT_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['6']),\n paddingVertical: px(colors.spacing['4']),\n };\n // Auto-wrap raw string children in <Text>. RN refuses to render a\n // bare string inside a View in dev, and on rn-web it silently slips\n // through using whatever ambient color the surface has — which is\n // wrong in dark mode. Wrapping here matches the pattern other Card\n // subcomponents already follow.\n const wrapped =\n typeof children === 'string' ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n lineHeight: px(colors.fontSize.md) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n );\n return (\n <View {...rest} className={cn('px-6 py-4', className)} style={[contentStyle, style]}>\n {wrapped}\n </View>\n );\n};\n\n/** Footer with a top border and a row of actions (typically Buttons). */\nexport const CardFooter = ({ children, className, style, ...rest }: CardSectionProps) => {\n const colors = useThemeColors();\n const footerStyle: ViewStyle = {\n ...FOOTER_LAYOUT_BASE,\n paddingHorizontal: px(colors.spacing['6']),\n paddingTop: px(colors.spacing['3']),\n paddingBottom: px(colors.spacing['5']),\n gap: px(colors.spacing['2']),\n };\n return (\n <View\n {...rest}\n className={cn(\n 'flex-row items-center gap-2 px-6 pt-3 pb-5 border-t border-semantic-border-default',\n className\n )}\n style={[footerStyle, { borderTopColor: colors.semantic.border.default }, style]}\n >\n {children}\n </View>\n );\n};\n\nexport type CardTextProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/** Card title — heading-weight text. Renders as a heading on web. */\nexport const CardTitle = ({ children, className, testID }: CardTextProps) => {\n const colors = useThemeColors();\n return (\n <RNText\n {...(testID !== undefined ? { testID } : {})}\n accessibilityRole=\"header\"\n role=\"heading\"\n aria-level={3}\n className={cn('text-lg font-semibold text-semantic-text-default', className)}\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.display,\n fontSize: px(colors.fontSize.lg),\n fontWeight: colors.fontWeight.semibold as '600',\n }}\n >\n {children}\n </RNText>\n );\n};\n\n/** Muted subtitle that pairs with Card.Title. */\nexport const CardDescription = ({ children, className, testID }: CardTextProps) => {\n const colors = useThemeColors();\n return (\n <RNText\n {...(testID !== undefined ? { testID } : {})}\n className={cn('text-sm text-semantic-text-muted', className)}\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n }}\n >\n {children}\n </RNText>\n );\n};\n\n/**\n * Public `Card` value — the root function plus its `.Header`, `.Title`,\n * `.Description`, `.Content`, and `.Footer` static members. `Object.assign`\n * produces a value whose inferred type carries the static properties, so\n * `.d.ts` consumers can write `<Card.Header>` without a separate import.\n */\nexport const Card = Object.assign(CardRoot, {\n Header: CardHeader,\n Title: CardTitle,\n Description: CardDescription,\n Content: CardContent,\n Footer: CardFooter,\n});\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useSemanticIcon } from '../../icons/use-semantic-icon';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type CheckboxProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n};\n\n// Layout-only base; theme-driven dimensions are merged inside the component.\nconst ROW_LAYOUT_BASE: ViewStyle = { flexDirection: 'row', alignItems: 'center' };\nconst BOX_LAYOUT_BASE: ViewStyle = {\n // 20×20 box — component-density literal — not from theme\n width: 20,\n height: 20,\n borderWidth: 1,\n alignItems: 'center',\n justifyContent: 'center',\n};\n\n/**\n * Checkbox — supports controlled + uncontrolled state, indeterminate (aria-checked=\"mixed\"),\n * asChild (via Slot), and a visible label that doubles as the accessibility label.\n */\nexport const Checkbox = ({\n checked,\n defaultChecked = false,\n indeterminate,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n}: CheckboxProps) => {\n const colors = useThemeColors();\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n\n const ariaChecked: 'true' | 'false' | 'mixed' = indeterminate ? 'mixed' : value ? 'true' : 'false';\n const isMarked = value || Boolean(indeterminate);\n\n const toggle = useCallback(() => {\n if (disabled) {\n return;\n }\n const next = !value;\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const Check = useSemanticIcon('checkmark');\n\n const rowStyle: ViewStyle = { ...ROW_LAYOUT_BASE, gap: px(colors.spacing['2']) };\n const boxBaseStyle: ViewStyle = { ...BOX_LAYOUT_BASE, borderRadius: px(colors.radius.sm) };\n\n const commonProps: Record<string, unknown> = {\n role: 'checkbox',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'checkbox' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (disabled) {\n commonProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'checkbox',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) {\n slotProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n slotProps['aria-label'] = label;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n if (className !== undefined) {\n slotProps.className = className;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const boxClasses = cn(\n 'w-5 h-5 rounded-sm border items-center justify-center',\n isMarked && !disabled\n ? 'bg-semantic-interactive-primary border-semantic-interactive-primary'\n : 'bg-semantic-background-elevated border-semantic-border-strong'\n );\n const boxFill: ViewStyle =\n isMarked && !disabled\n ? {\n backgroundColor: colors.semantic.interactive.primary,\n borderColor: colors.semantic.interactive.primary,\n }\n : {\n backgroundColor: colors.semantic.background.elevated,\n borderColor: colors.semantic.border.strong,\n };\n\n // The whole row is the interactive element so clicking the label text\n // toggles the checkbox. The visual box is a non-interactive View — one\n // role=\"checkbox\" per logical control, not two competing hit-areas.\n // Indeterminate uses a horizontal dash (the W3C convention) rather than\n // a checkmark, so the user can tell at a glance that the state is\n // \"partial / mixed\", not \"fully checked.\" Clicking still fires onChange\n // — consumers typically toggle indeterminate off and set checked=true\n // in their handler.\n const inverted = colors.semantic.text.inverted;\n return (\n <Pressable\n onPress={toggle}\n {...commonProps}\n className={cn('flex-row items-center gap-2', disabled ? 'opacity-60' : undefined, className)}\n style={[rowStyle, disabled ? { opacity: 0.6 } : null]}\n >\n <View className={boxClasses} style={[boxBaseStyle, boxFill]}>\n {indeterminate && !disabled ? (\n <View style={{ width: 10, height: 2, borderRadius: 1, backgroundColor: inverted }} />\n ) : value && !disabled ? (\n <Check size={14} color={inverted} />\n ) : null}\n </View>\n {children ??\n (label !== undefined ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n }}\n >\n {label}\n </RNText>\n ) : null)}\n </Pressable>\n );\n};\n","'use client';\n\nimport {\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Modal, Platform, Pressable, Text as RNText, StyleSheet, View } from 'react-native';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { BlurBackdrop } from './blur-backdrop';\n\ntype DialogContextValue = {\n open: boolean;\n setOpen: (next: boolean) => void;\n titleId: string;\n descriptionId: string;\n triggerRef: { current: HTMLElement | null };\n};\n\nconst DialogContext = createContext<DialogContextValue | null>(null);\n\nconst useDialogContext = (label: string): DialogContextValue => {\n const ctx = useContext(DialogContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside a <Dialog>.`);\n }\n return ctx;\n};\n\nexport type DialogProps = {\n /** Controlled open state. */\n open?: boolean;\n /** Uncontrolled initial open state. @defaultValue false */\n defaultOpen?: boolean;\n /** Fires with the new open state. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\n/**\n * Modal dialog. Owns open state and provides context for `DialogTrigger`,\n * `DialogContent`, `DialogTitle`, `DialogDescription`, and `DialogClose`.\n *\n * Behavior:\n * - Click the trigger to open. Click outside the content, press Escape,\n * or click an explicit close to dismiss.\n * - Focus is trapped inside the content while open (web). On close, focus\n * returns to whatever opened the dialog.\n * - Background scrolling is locked while open (web).\n *\n * Cross-platform: uses RN `<Modal>` as the visibility/portal primitive. On\n * web, additional focus-trap / scroll-lock / Escape-key effects layer on\n * top via the platform check inside `DialogContent`.\n */\nconst DialogRoot = ({ open, defaultOpen = false, onOpenChange, children }: DialogProps) => {\n const [inner, setInner] = useState<boolean>(defaultOpen);\n const isControlled = open !== undefined;\n const current = isControlled ? open : inner;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setInner(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange]\n );\n\n const baseId = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n\n const ctxValue: DialogContextValue = {\n open: current,\n setOpen,\n titleId: `${baseId}-title`,\n descriptionId: `${baseId}-description`,\n triggerRef,\n };\n\n return <DialogContext.Provider value={ctxValue}>{children}</DialogContext.Provider>;\n};\n\nexport type DialogTriggerProps = {\n /** Render the child as the trigger (Slot pattern). Default true — pass `false` for an inline button. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Element that opens the dialog when activated. Uses `asChild` by default so\n * any element (Button, Link, custom Pressable) becomes the trigger.\n */\nexport const DialogTrigger = ({ asChild = true, children, className, testID }: DialogTriggerProps) => {\n const ctx = useDialogContext('DialogTrigger');\n const onPress = useCallback(() => ctx.setOpen(true), [ctx]);\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n // Pass both onClick (web HTML buttons) AND onPress (RN Pressable /\n // our own Button) so the trigger fires regardless of which event\n // model the wrapped child speaks. The child's existing handler\n // runs first, then we open.\n const fire = (existing: ((e: unknown) => void) | undefined) => (event: unknown) => {\n existing?.(event);\n ctx.setOpen(true);\n };\n return (\n <Slot\n ref={(node: HTMLElement | null) => {\n ctx.triggerRef.current = node;\n }}\n onClick={fire(child.props.onClick as ((e: unknown) => void) | undefined)}\n onPress={fire(child.props.onPress as ((e: unknown) => void) | undefined)}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n return (\n <Pressable\n ref={(node) => {\n ctx.triggerRef.current = node as unknown as HTMLElement | null;\n }}\n onPress={onPress}\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n};\n\n// On native, raw strings rendered as children of a non-Text component\n// throw \"Text strings must be rendered within a <Text> component\". On\n// web, react-native-web silently tolerates it. Wrap any string/number\n// children in an RNText so the same JSX renders cleanly on both\n// platforms. Non-string children are passed through unchanged.\nfunction wrapStringChildren(children: ReactNode): ReactNode {\n if (typeof children === 'string' || typeof children === 'number') {\n return <RNText>{children}</RNText>;\n }\n return children;\n}\n\n// Scrim + blur target values — applied at the entered state on web,\n// always on as a flat scrim on native (RN doesn't have backdrop-filter\n// and the native shim would be an extra peer dep for vanishingly little\n// visual gain on a v0 component).\n// 24% scrim + 4px blur — strong enough to push the page back but the\n// content underneath is still legible. Earlier 32%/8px felt like a frosted\n// glass slab that completely obscured the page; this lets the page show\n// through as \"behind glass, slightly out of focus.\"\nconst SCRIM_COLOR = 'rgba(0, 0, 0, 0.24)';\nconst BLUR_AMOUNT = 4;\n\n// Static overlay layout — alignment, fixed positioning. The animatable\n// bits (scrim color, backdrop-filter blur) live in a useEffect inside\n// the component that pokes them onto the DOM ref directly so rn-web's\n// style filter can't strip the non-RN keys (backdropFilter,\n// transitionProperty). On web the styles start at blur(0px) +\n// transparent and transition to the target values on the next frame.\n//\n// Why not put blur(8px) here as a constant: when blur is applied to a\n// layer that's mid-fade (e.g. RN Modal's animationType=\"fade\" fades\n// opacity from 0 → 1), Safari and Chromium GPU-composite the layer\n// without rendering backdrop-filter — so the blur appears to \"snap in\"\n// at the end of the fade. Animating blur explicitly via our own\n// transition (and disabling the Modal's fade on web) avoids the snap.\nconst OVERLAY_LAYOUT_BASE: ViewStyle = {\n position: Platform.OS === 'web' ? ('fixed' as unknown as 'absolute') : 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n // On native the BlurBackdrop sibling renders BEHIND this overlay and\n // already provides dim + frosted-glass via expo-blur's `tint`/`intensity`.\n // Painting SCRIM_COLOR on top would mask the blur entirely (the user\n // sees only a flat tint), so the overlay stays transparent and the\n // BlurView is the dominant visual on native.\n ...(Platform.OS === 'web' ? ({ zIndex: 50 } as ViewStyle) : { backgroundColor: 'transparent' }),\n};\n\n// Layout / animation only — theme-driven dimensions are merged inside\n// DialogContent below.\nconst CONTENT_LAYOUT_BASE: ViewStyle = {\n width: '100%',\n maxWidth: 480, // component-density literal — not from theme\n ...(Platform.OS === 'web'\n ? ({\n boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n } as ViewStyle)\n : { elevation: 24 }),\n};\n\nconst FOCUSABLE_SELECTOR =\n 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nexport type DialogContentProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The visible dialog surface — overlay + centered card. Renders only when\n * the parent `Dialog` is open. On web: traps focus inside, locks body\n * scroll, and dismisses on Escape or overlay click.\n */\nexport const DialogContent = ({ children, className, testID }: DialogContentProps) => {\n const ctx = useDialogContext('DialogContent');\n const colors = useThemeColors();\n const scheme = useColorScheme();\n const contentRef = useRef<HTMLDivElement | null>(null);\n const overlayStyle: ViewStyle = {\n ...OVERLAY_LAYOUT_BASE,\n padding: px(colors.spacing['4']),\n };\n const contentStyle: ViewStyle = {\n ...CONTENT_LAYOUT_BASE,\n borderRadius: px(colors.radius.xl),\n padding: px(colors.spacing['6']),\n gap: px(colors.spacing['3']),\n };\n // Scale-in: render at scale(0.96) + opacity 0 first, flip to 1 in a\n // useEffect so the CSS transition has a frame to animate from. Web\n // only; native uses `Modal animationType=\"fade\"` which is enough.\n const [entered, setEntered] = useState(false);\n useEffect(() => {\n if (Platform.OS !== 'web') {\n setEntered(true);\n return;\n }\n if (!ctx.open) {\n setEntered(false);\n return;\n }\n const id = requestAnimationFrame(() => setEntered(true));\n return () => cancelAnimationFrame(id);\n }, [ctx.open]);\n const enterStyle: ViewStyle =\n Platform.OS === 'web'\n ? ({\n opacity: entered ? 1 : 0,\n transform: [{ scale: entered ? 1 : 0.96 }],\n transitionProperty: 'opacity, transform',\n transitionDuration: '150ms',\n transitionTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n } as ViewStyle)\n : {};\n\n // Overlay's scrim + backdrop-filter share the same `entered` flag as\n // the content card, so the blur starts at 0 and the scrim at 0% on\n // the first paint, then both transition to their target values at the\n // next frame — same 150ms curve as the card. The blur duration is\n // bumped slightly (200ms) so it lands a hair AFTER the scrim instead\n // of slamming to full strength immediately, which reads more natural.\n //\n // We reach for a direct DOM ref + .style assignments here rather than\n // pass the styles through `<Pressable style={...}>`. Reason: rn-web's\n // style filter drops keys it doesn't recognize as RN style props —\n // and `backdropFilter`, `transitionProperty`, etc. fall through that\n // filter, taking the whole style fragment with them. Native gets a\n // flat scrim with no blur; RN doesn't have backdrop-filter and the\n // native shim would be an extra peer dep for negligible gain.\n const overlayDomRef = useRef<HTMLElement | null>(null);\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n const node = overlayDomRef.current;\n if (!node) {\n return;\n }\n // First paint: kick off transparent + zero blur so the next\n // assignment animates from 0 to target. We only need this on\n // the very first frame — the inline style on second frame\n // overwrites these.\n node.style.transitionProperty = 'background-color, backdrop-filter, -webkit-backdrop-filter';\n node.style.transitionDuration = '150ms, 200ms, 200ms';\n node.style.transitionTimingFunction = 'ease-out';\n if (entered) {\n node.style.backgroundColor = SCRIM_COLOR;\n node.style.backdropFilter = `blur(${BLUR_AMOUNT}px)`;\n node.style.setProperty('-webkit-backdrop-filter', `blur(${BLUR_AMOUNT}px)`);\n } else {\n node.style.backgroundColor = 'rgba(0, 0, 0, 0)';\n node.style.backdropFilter = 'blur(0px)';\n node.style.setProperty('-webkit-backdrop-filter', 'blur(0px)');\n }\n }, [entered]);\n\n // Web-only side effects: focus trap, scroll lock, Escape close,\n // initial focus on the first focusable inside the dialog. RN Modal\n // handles its own focus model on native, so the platform check keeps\n // these out of the native render path.\n useEffect(() => {\n if (!ctx.open) {\n return;\n }\n if (Platform.OS !== 'web') {\n return;\n }\n if (typeof document === 'undefined') {\n return;\n }\n\n const previouslyFocused = document.activeElement as HTMLElement | null;\n\n // Lock body scroll. Preserve any previously set inline style so\n // we don't accidentally clobber a consumer's lock from elsewhere.\n const prevBodyOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n\n // Move focus into the dialog. Prefer the first focusable element;\n // if there isn't one, focus the dialog container itself so it\n // receives the keydown events.\n const focusFirst = () => {\n const node = contentRef.current;\n if (!node) {\n return;\n }\n const focusable = node.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR);\n const first = focusable[0];\n if (first) {\n first.focus();\n } else {\n node.setAttribute('tabindex', '-1');\n node.focus();\n }\n };\n focusFirst();\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n ctx.setOpen(false);\n return;\n }\n if (event.key !== 'Tab') {\n return;\n }\n const node = contentRef.current;\n if (!node) {\n return;\n }\n const focusable = Array.from(node.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (el) => el.offsetParent !== null || el === document.activeElement\n );\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (!first || !last) {\n return;\n }\n if (event.shiftKey) {\n if (document.activeElement === first || !node.contains(document.activeElement)) {\n event.preventDefault();\n last.focus();\n }\n } else if (document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.body.style.overflow = prevBodyOverflow;\n // Restore focus to whatever opened the dialog (the trigger),\n // falling back to the previously focused node if the trigger\n // is gone.\n const restoreTo = ctx.triggerRef.current ?? previouslyFocused;\n restoreTo?.focus?.();\n };\n }, [ctx.open, ctx.setOpen, ctx.triggerRef]);\n\n const onOverlayPress = useCallback(() => ctx.setOpen(false), [ctx]);\n\n return (\n <Modal\n visible={ctx.open}\n transparent\n // Web: 'none' so RN's built-in fade doesn't fight our own\n // overlay/content transitions (its layer-level fade caused\n // backdrop-filter to \"snap in\" at the end). Native: 'fade'\n // is what users expect on iOS/Android and we don't have a\n // CSS transition path there anyway.\n animationType={Platform.OS === 'web' ? 'none' : 'fade'}\n onRequestClose={() => ctx.setOpen(false)}\n >\n {/* Native blur layer. Renders nothing on web (the overlay's\n CSS backdrop-filter handles it) and renders nothing if\n expo-blur isn't installed (graceful degrade — the scrim\n Pressable below still dims the background). */}\n <BlurBackdrop intensity={60} tint={scheme === 'dark' ? 'dark' : 'light'} style={StyleSheet.absoluteFill} />\n <Pressable\n accessibilityRole=\"none\"\n aria-hidden={true}\n ref={(node) => {\n overlayDomRef.current = node as unknown as HTMLElement | null;\n }}\n style={overlayStyle}\n onPress={onOverlayPress}\n >\n <Pressable\n onPress={(event) => event.stopPropagation?.()}\n ref={(node) => {\n contentRef.current = node as unknown as HTMLDivElement | null;\n }}\n role=\"dialog\"\n accessibilityRole=\"none\"\n aria-modal={true}\n aria-labelledby={ctx.titleId}\n aria-describedby={ctx.descriptionId}\n {...(testID !== undefined ? { testID } : {})}\n className={cn('w-full max-w-md rounded-xl bg-semantic-background-elevated p-6 gap-3', className)}\n style={[contentStyle, { backgroundColor: colors.semantic.background.elevated }, enterStyle]}\n >\n <View\n className=\"flex-col gap-1.5\"\n style={{ flexDirection: 'column', gap: px(colors.spacing['2']) - 2 }}\n >\n {children}\n </View>\n </Pressable>\n </Pressable>\n </Modal>\n );\n};\n\nexport type DialogTextProps = {\n children?: ReactNode;\n className?: string;\n};\n\n/** Heading inside DialogContent. Wires `aria-labelledby`. */\nexport const DialogTitle = ({ children, className }: DialogTextProps) => {\n const ctx = useDialogContext('DialogTitle');\n const colors = useThemeColors();\n return (\n <RNText\n nativeID={ctx.titleId}\n id={ctx.titleId}\n role=\"heading\"\n aria-level={2}\n className={cn('text-lg font-semibold text-semantic-text-default', className)}\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.display,\n fontSize: px(colors.fontSize.lg),\n fontWeight: colors.fontWeight.semibold as '600',\n }}\n >\n {children}\n </RNText>\n );\n};\n\n/** Subtitle / description inside DialogContent. Wires `aria-describedby`. */\nexport const DialogDescription = ({ children, className }: DialogTextProps) => {\n const ctx = useDialogContext('DialogDescription');\n const colors = useThemeColors();\n return (\n <RNText\n nativeID={ctx.descriptionId}\n id={ctx.descriptionId}\n className={cn('text-sm text-semantic-text-muted', className)}\n style={{\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.normal),\n }}\n >\n {children}\n </RNText>\n );\n};\n\nexport type DialogCloseProps = {\n /** Render the child as the close button (Slot pattern). Default true. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n accessibilityLabel?: string;\n};\n\n/**\n * Element that closes the dialog when activated. With `asChild` (default),\n * wraps the child. Without `asChild`, renders a default ✕ button — useful\n * for the canonical top-right corner close.\n */\nexport const DialogClose = ({\n asChild = true,\n children,\n className,\n testID,\n accessibilityLabel = 'Close',\n}: DialogCloseProps) => {\n const ctx = useDialogContext('DialogClose');\n const colors = useThemeColors();\n const onPress = useCallback(() => ctx.setOpen(false), [ctx]);\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n // Same dual-event story as DialogTrigger: pass both onClick (web\n // button) and onPress (RN Pressable / our own Button) so the\n // wrapped element fires regardless of its event model.\n const fire = (existing: ((e: unknown) => void) | undefined) => (event: unknown) => {\n existing?.(event);\n ctx.setOpen(false);\n };\n return (\n <Slot\n onClick={fire(child.props.onClick as ((e: unknown) => void) | undefined)}\n onPress={fire(child.props.onPress as ((e: unknown) => void) | undefined)}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n if (children !== undefined) {\n return (\n <Pressable\n onPress={onPress}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n aria-label={accessibilityLabel}\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n }\n\n return (\n <Pressable\n onPress={onPress}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n aria-label={accessibilityLabel}\n {...(testID !== undefined ? { testID } : {})}\n className={cn('absolute right-3 top-3 w-8 h-8 items-center justify-center rounded-md', className)}\n style={{\n position: 'absolute',\n right: px(colors.spacing['3']),\n top: px(colors.spacing['3']),\n // 32×32 close hit target — component-density literal — not from theme\n width: 32,\n height: 32,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: px(colors.radius.md),\n }}\n >\n <defaultSemanticIcons.close size={18} color={colors.semantic.text.muted} />\n </Pressable>\n );\n};\n\nexport type DialogFooterProps = {\n children?: ReactNode;\n className?: string;\n};\n\n/** Convenience row for dialog action buttons (right-aligned). */\nexport const DialogFooter = ({ children, className }: DialogFooterProps) => {\n const colors = useThemeColors();\n return (\n <View\n className={cn('mt-4 flex-row items-center justify-end gap-2', className)}\n style={{\n marginTop: px(colors.spacing['4']),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: px(colors.spacing['2']),\n }}\n >\n {children}\n </View>\n );\n};\n\n/**\n * Public `Dialog` value — the root function plus its `.Trigger`, `.Content`,\n * `.Title`, `.Description`, `.Footer`, and `.Close` static members. `Object.assign`\n * produces a value whose inferred type carries the static properties, so `.d.ts`\n * consumers can write `<Dialog.Content>` without a separate import.\n */\nexport const Dialog = Object.assign(DialogRoot, {\n Trigger: DialogTrigger,\n Content: DialogContent,\n Title: DialogTitle,\n Description: DialogDescription,\n Footer: DialogFooter,\n Close: DialogClose,\n});\n",null,"'use client';\n\n// =============================================================================\n// FloatButton — cross-platform Floating Action Button (FAB)\n//\n// Two-component public surface:\n// <FloatButton> — standalone FAB\n// <FloatButton.Group> — cluster with click/long-press expansion\n// <FloatButton.BackToTop> — preset that scrolls a target ref to top\n//\n// Design direction: restrained-editorial (Linear/Stripe energy). Two-layer\n// brand-tinted shadows, subtle hover lift, snappy press scale, no bouncy\n// physics. Cross-platform via the same Pressable + inline style pattern\n// used in Pagination.\n// =============================================================================\n\nimport {\n type ComponentProps,\n cloneElement,\n createContext,\n type FC,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { GestureResponderEvent, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, type ScrollView, useWindowDimensions, View } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { useTranslation } from '../../i18n/use-translation';\nimport { defaultSemanticIcons } from '../../icons/default-semantic-icons';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../Badge';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type FloatButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'surface';\nexport type FloatButtonShape = 'circle' | 'square' | 'extended';\nexport type FloatButtonSize = 'small' | 'medium' | 'large';\nexport type FloatButtonPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\nexport type FloatButtonGroupTrigger = 'click' | 'longPress' | 'manual';\nexport type FloatButtonGroupDirection = 'up' | 'down' | 'left' | 'right';\n\n/** Badge passthrough — same shape as our `<Badge>` accepts. */\nexport type FloatButtonBadge = {\n /** Numeric badge — render the number inside a small pill. */\n count?: number;\n /** Show a dot instead of a count (overrides `count`). */\n dot?: boolean;\n /** Badge tone — defaults to `'danger'` (the canonical \"unread\" red). */\n tone?: BadgeProps['tone'];\n};\n\ntype FloatButtonBaseProps = {\n /** Required unless `label` is set. */\n icon?: ReactNode;\n /** Inline label — turns the button extended (auto-sets `shape='extended'`). */\n label?: string;\n /** A11y label — falls back to `label`; required when icon-only. */\n accessibilityLabel?: string;\n /** Visual shape. @defaultValue 'circle' (or 'extended' when both icon + label are set) */\n shape?: FloatButtonShape;\n /** Size — sm=40, md=56, lg=72. @defaultValue 'medium' */\n size?: FloatButtonSize;\n /** Color/tone variant. @defaultValue 'primary' */\n variant?: FloatButtonVariant;\n /** Tooltip — web: hover/focus tooltip; native (in a group): always-visible label chip. */\n tooltip?: string;\n /** Badge — count, dot, or tone passthrough. */\n badge?: FloatButtonBadge;\n /** Disable interaction. */\n disabled?: boolean;\n /** Show a spinner in place of the icon. */\n loading?: boolean;\n /** Animate in/out. @defaultValue true */\n visible?: boolean;\n /** Where to anchor the FAB on the screen. @defaultValue 'bottom-right' */\n placement?: FloatButtonPlacement;\n /**\n * Positioning strategy. `'fixed'` pins to the viewport (web `position: fixed`,\n * native absolute-on-root); `'absolute'` pins to the nearest positioned\n * ancestor — useful for docs previews and any contained-canvas layout.\n * @defaultValue 'fixed'\n */\n positioning?: 'fixed' | 'absolute';\n /** Additional offset from the placement corner (px). @defaultValue { x: 24, y: 24 } web; { x: 16, y: 16 } native */\n offset?: { x?: number; y?: number };\n /**\n * On native, auto-add the device's bottom safe-area inset to the offset.\n * **Default is `false`** because RN has no `position: 'fixed'` — every\n * `FloatButton` is parent-relative, and adding the screen-bottom inset\n * to a card-relative offset pushes the button up by ~34pt for no reason.\n * Set this to `true` only when you're certain the FAB's parent reaches\n * the screen edge (e.g. a root-level container without `SafeAreaView`).\n * @defaultValue false\n */\n respectSafeArea?: boolean;\n /** Anchor link — renders as an `<a>` on web. */\n href?: string;\n /** RTL flips left/right placements. @defaultValue 'ltr' */\n dir?: 'ltr' | 'rtl';\n /** Long-press handler — native first-class, web maps to contextmenu. */\n onLongPress?: (event: GestureResponderEvent) => void;\n /** Forward ARIA attributes (used internally by Group for `aria-haspopup`/`aria-expanded`). */\n 'aria-haspopup'?: 'menu' | 'true' | boolean;\n 'aria-expanded'?: boolean;\n /**\n * Press handler. We're React-Native-first, so `onPress` is the primary\n * surface and works on both platforms. `onClick` is also accepted for\n * web-mental-model consumers; if BOTH are defined, `onPress` wins (and\n * a dev-only warning fires).\n */\n onPress?: (event: GestureResponderEvent) => void;\n /** Web-y alias for `onPress` — same handler, mapped at the call site. */\n onClick?: (event: { preventDefault?: () => void }) => void;\n className?: string;\n testID?: string;\n /** Set internally when the button lives inside a `<FloatButton.Group>`. */\n children?: ReactNode;\n};\n\nexport type FloatButtonProps = FloatButtonBaseProps;\n\n// =============================================================================\n// Context — shared by Group and its children\n// =============================================================================\n\ntype FloatButtonGroupContextValue = {\n /** Whether the group is expanded. */\n open: boolean;\n /** Close the group programmatically (used by action items after press). */\n close: () => void;\n /** Direction of expansion. */\n direction: FloatButtonGroupDirection;\n /** Whether items are inside a group — used to skip per-item positioning. */\n insideGroup: true;\n /** Index of the action item, used for staggered animation. */\n indexRef: { next: number };\n};\n\nconst FloatButtonGroupContext = createContext<FloatButtonGroupContextValue | null>(null);\n\n// =============================================================================\n// Constants\n// =============================================================================\n\nconst SIZE_MAP: Record<FloatButtonSize, { diameter: number; iconSize: number; fontSize: number; padX: number }> = {\n small: { diameter: 40, iconSize: 18, fontSize: 14, padX: 16 },\n medium: { diameter: 56, iconSize: 22, fontSize: 14, padX: 20 },\n large: { diameter: 72, iconSize: 28, fontSize: 16, padX: 28 },\n};\n\nconst DEFAULT_OFFSET_WEB = 24;\nconst DEFAULT_OFFSET_NATIVE = 16;\n\n// =============================================================================\n// Standalone FloatButton\n// =============================================================================\n\n/**\n * Floating Action Button — a fixed-position button that hovers above page\n * content. Cross-platform (web + native), badge-aware, link-capable, and\n * safe-area-aware on native.\n *\n * @example\n * <FloatButton icon={<Plus />} accessibilityLabel=\"New item\" onPress={...} />\n *\n * @example\n * <FloatButton icon={<Help />} label=\"Help\" shape=\"extended\" />\n */\n// Defined here as a plain function; the Group / BackToTop static properties\n// are attached at the bottom of the file via `Object.assign` so the dist\n// `.d.ts` surface preserves them (a bare type cast on the const doesn't\n// propagate through tsup's declaration emitter).\nconst FloatButtonRoot = (props: FloatButtonProps) => {\n const groupCtx = useContext(FloatButtonGroupContext);\n const colors = useThemeColors();\n // Read the context directly (instead of `useSafeAreaInsets()`) so the\n // component degrades silently when no `<SafeAreaProvider>` is mounted —\n // the canonical case on web. With a provider, real insets flow through;\n // without one, we get zeros and no console warning.\n const insets = useContext(SafeAreaInsetsContext) ?? { top: 0, right: 0, bottom: 0, left: 0 };\n const { width: viewportWidth } = useWindowDimensions();\n\n const {\n icon,\n label,\n accessibilityLabel,\n shape: shapeProp,\n size = groupCtx ? 'small' : 'medium',\n variant = 'primary',\n tooltip,\n badge,\n disabled = false,\n loading = false,\n visible = true,\n placement = 'bottom-right',\n positioning = 'fixed',\n offset,\n respectSafeArea = false,\n href,\n dir = 'ltr',\n onLongPress,\n className,\n testID,\n children,\n onPress,\n onClick,\n 'aria-haspopup': ariaHasPopup,\n 'aria-expanded': ariaExpanded,\n } = props;\n\n // `onPress` wins when both are defined — emit a dev-only warning so the\n // intent is unambiguous. (We can't make this a TS error because\n // exactOptionalPropertyTypes + spread in FloatButton.Group fights\n // discriminated unions.)\n if (process.env.NODE_ENV !== 'production' && onPress && onClick) {\n console.warn('<FloatButton>: both `onPress` and `onClick` defined — `onPress` will be used. Pick one.');\n }\n const onPressFn = onPress ?? onClick;\n\n // Auto-extend when both icon + label are present and shape is unset.\n const shape: FloatButtonShape = shapeProp ?? (label && icon ? 'extended' : 'circle');\n const sizeTokens = SIZE_MAP[size];\n\n // Tooltip visibility (web: hover/focus; native-in-group: always when group open)\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n // Track press-tap separately so we don't run onLongPress -> onPress.\n const longPressFiredRef = useRef(false);\n\n const handlePress = useCallback(\n (event: GestureResponderEvent) => {\n if (disabled || loading) {\n return;\n }\n if (longPressFiredRef.current) {\n longPressFiredRef.current = false;\n return;\n }\n // If we're inside a Group, close it after a press (unless this IS the\n // group's trigger — group trigger is rendered from inside Group itself,\n // not by a child FloatButton).\n if (groupCtx) {\n groupCtx.close();\n }\n (onPressFn as ((e: GestureResponderEvent) => void) | undefined)?.(event);\n },\n [disabled, loading, groupCtx, onPressFn]\n );\n\n const handleLongPress = useCallback(\n (event: GestureResponderEvent) => {\n if (disabled || loading) {\n return;\n }\n longPressFiredRef.current = true;\n onLongPress?.(event);\n },\n [disabled, loading, onLongPress]\n );\n\n // ----- variant resolution -----\n const variantStyle = useMemo(() => resolveVariantStyle(variant, colors), [variant, colors]);\n\n // ----- positioning -----\n const positionStyle: ViewStyle | null = groupCtx\n ? null // children of a group don't position themselves; the group handles layout\n : resolvePositionStyle({\n placement,\n positioning,\n offset: offset ?? {},\n dir,\n insets,\n viewportWidth,\n respectSafeArea,\n });\n\n // ----- visibility / disabled opacity -----\n const containerOpacity = visible ? (disabled ? 0.4 : 1) : 0;\n\n // ----- shape dimensions -----\n const isExtended = shape === 'extended' && Boolean(label);\n const containerDimensions: ViewStyle = isExtended\n ? {\n minWidth: sizeTokens.diameter,\n height: sizeTokens.diameter,\n paddingHorizontal: sizeTokens.padX,\n borderRadius: sizeTokens.diameter / 2,\n }\n : {\n width: sizeTokens.diameter,\n height: sizeTokens.diameter,\n borderRadius: shape === 'square' ? px(colors.radius.lg) : sizeTokens.diameter / 2,\n };\n\n const a11yLabel = accessibilityLabel ?? label ?? tooltip;\n\n if (process.env.NODE_ENV !== 'production' && !a11yLabel && icon) {\n console.warn('<FloatButton>: provide `accessibilityLabel` or `label` for icon-only buttons (WCAG 2.2).');\n }\n\n // ----- shadow tokens (brand-tinted on primary) -----\n const shadowStyle = useMemo(() => resolveShadowStyle(variant, colors), [variant, colors]);\n\n // ----- inner content (icon + optional label) -----\n const contentNode = (\n <>\n {loading ? (\n <SmallSpinner color={variantStyle.fg} size={sizeTokens.iconSize} />\n ) : (\n <View\n style={\n {\n width: sizeTokens.iconSize,\n height: sizeTokens.iconSize,\n alignItems: 'center',\n justifyContent: 'center',\n // Sets CSS `color` on the wrapper div under RN-Web\n // so any nested SVG using `stroke=\"currentColor\"`\n // or `fill=\"currentColor\"` inherits the variant fg.\n // RN ignores `color` on a View (it's only valid on\n // Text) — silently dropped on native.\n color: variantStyle.fg,\n } as unknown as ViewStyle\n }\n >\n {tintIcon(icon, variantStyle.fg)}\n </View>\n )}\n {isExtended ? (\n <RNText\n style={{\n marginLeft: px(colors.spacing['2']),\n color: variantStyle.fg,\n fontFamily: colors.fontFamily.body,\n fontSize: sizeTokens.fontSize,\n fontWeight: colors.fontWeight.medium as '500',\n letterSpacing: -0.1,\n fontVariant: ['tabular-nums'],\n }}\n numberOfLines={1}\n >\n {label}\n </RNText>\n ) : null}\n </>\n );\n\n // ----- wrapper: positioning + opacity transitions -----\n const wrapperStyle: ViewStyle = {\n ...(positionStyle ?? {}),\n opacity: containerOpacity,\n // Web-only transitions for visibility/scale (silently dropped on native).\n ...(Platform.OS === 'web'\n ? ({\n transitionProperty: 'opacity, transform',\n transitionDuration: '180ms',\n transitionTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n pointerEvents: visible ? 'auto' : 'none',\n } as ViewStyle)\n : null),\n };\n\n // ----- the button itself (Pressable + visual style) -----\n const buttonNode = (\n <Pressable\n {...(testID !== undefined ? { testID } : {})}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel={a11yLabel}\n aria-label={a11yLabel}\n disabled={disabled || loading}\n aria-disabled={disabled || undefined}\n aria-busy={loading || undefined}\n {...(ariaHasPopup !== undefined ? { 'aria-haspopup': ariaHasPopup } : {})}\n {...(ariaExpanded !== undefined ? { 'aria-expanded': ariaExpanded } : {})}\n onPress={handlePress}\n onLongPress={onLongPress ? handleLongPress : undefined}\n // Web hover/focus reveals the tooltip; rely on Pressable's hover state.\n onHoverIn={() => setTooltipVisible(true)}\n onHoverOut={() => setTooltipVisible(false)}\n onFocus={() => setTooltipVisible(true)}\n onBlur={() => setTooltipVisible(false)}\n // Pre-compute the static style; iOS's Pressable renderer was\n // observed to drop properties from function-form `style` returns\n // intermittently — same bug we hit on the Pagination selected pill.\n // The function form is web-only (where it reads `hovered`); on\n // native we pass a plain object that always renders.\n style={\n Platform.OS === 'web'\n ? (state) => {\n const { pressed, hovered } = state as { pressed: boolean; hovered?: boolean };\n return {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: pressed\n ? variantStyle.bgPressed\n : hovered\n ? variantStyle.bgHover\n : variantStyle.bg,\n ...(variantStyle.borderColor\n ? { borderWidth: 1, borderColor: variantStyle.borderColor }\n : null),\n ...containerDimensions,\n ...shadowStyle.resting,\n ...(pressed ? { transform: [{ scale: 0.96 }], ...shadowStyle.pressed } : null),\n ...(hovered && !pressed\n ? { transform: [{ translateY: -1 }], ...shadowStyle.hover }\n : null),\n ...({\n transitionProperty: 'background-color, box-shadow, transform',\n transitionDuration: '150ms',\n transitionTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n cursor: disabled || loading ? 'not-allowed' : 'pointer',\n outlineWidth: 0,\n } as object),\n } as ViewStyle;\n }\n : ({\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: variantStyle.bg,\n ...(variantStyle.borderColor\n ? { borderWidth: 1, borderColor: variantStyle.borderColor }\n : null),\n ...containerDimensions,\n ...shadowStyle.resting,\n } as ViewStyle)\n }\n >\n {contentNode}\n </Pressable>\n );\n\n // Web `<a>` wrapper for href integration. Non-anchor on native.\n const linkedButton =\n href && Platform.OS === 'web' ? (\n <a\n href={href}\n aria-label={a11yLabel}\n style={{ textDecoration: 'none', color: 'inherit', display: 'inline-flex' }}\n onClick={(e) => {\n if (onPressFn) {\n // Let consumer's handler decide; if they call preventDefault we honor it.\n (onPressFn as (e: { preventDefault?: () => void }) => void)({\n preventDefault: () => e.preventDefault(),\n });\n }\n }}\n >\n {buttonNode}\n </a>\n ) : (\n buttonNode\n );\n\n // Tooltip chip — always visible on native when inside an open group;\n // hover/focus on web. Skipped if no tooltip text.\n const showTooltip = tooltip && (Platform.OS === 'web' ? tooltipVisible : (groupCtx?.open ?? false));\n\n return (\n <View className={cn(className)} style={wrapperStyle}>\n <View style={{ flexDirection: 'row', alignItems: 'center', gap: px(colors.spacing['2']) }}>\n {showTooltip ? <TooltipChip text={tooltip!} /> : null}\n <View style={{ position: 'relative' }}>\n {linkedButton}\n {badge ? <BadgeOverlay badge={badge} size={size} /> : null}\n </View>\n </View>\n {children}\n </View>\n );\n};\n\n// =============================================================================\n// FloatButton.Group\n// =============================================================================\n\nexport type FloatButtonGroupProps = Omit<FloatButtonProps, 'onPress' | 'onClick' | 'onLongPress'> & {\n /** Trigger mode — `manual` requires `open` to be controlled. @defaultValue 'click' */\n trigger?: FloatButtonGroupTrigger;\n /** Controlled open state. */\n open?: boolean;\n /** Initial open state when uncontrolled. @defaultValue false */\n defaultOpen?: boolean;\n /** Fires whenever the group opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Direction the action items expand. @defaultValue 'up' */\n direction?: FloatButtonGroupDirection;\n /** Render a scrim/backdrop behind the open group. @defaultValue false */\n backdrop?: boolean;\n /** Override the trigger icon when collapsed. */\n expandIcon?: ReactNode;\n /** Override the trigger icon when expanded. @defaultValue rotated `expandIcon` (or `icon`) */\n collapseIcon?: ReactNode;\n /** Action items declared as data — alternative to children. */\n actions?: ReadonlyArray<FloatButtonProps>;\n};\n\nconst FloatButtonGroup: FC<FloatButtonGroupProps> = ({\n trigger = 'click',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n direction = 'up',\n backdrop = false,\n expandIcon,\n collapseIcon,\n actions,\n children,\n ...buttonProps\n}) => {\n const isControlled = openProp !== undefined;\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const open = isControlled ? (openProp as boolean) : innerOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setInnerOpen(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange]\n );\n\n const close = useCallback(() => setOpen(false), [setOpen]);\n const toggle = useCallback(() => setOpen(!open), [setOpen, open]);\n\n // Action items: flatten `actions` array into FloatButton children if given.\n const actionItems: ReactNode = actions\n ? actions.map((action, idx) => {\n // biome-ignore lint/suspicious/noArrayIndexKey: deterministic order from caller's array\n return <FloatButton key={`fab-action-${idx}`} {...(action as FloatButtonProps)} />;\n })\n : children;\n\n // The group's outer container handles positioning; children render inline.\n const groupCtxValue = useMemo<FloatButtonGroupContextValue>(\n () => ({\n open,\n close,\n direction,\n insideGroup: true as const,\n indexRef: { next: 0 },\n }),\n [open, close, direction]\n );\n\n // Trigger button (uses the same FloatButton render path but without\n // group-context positioning so it stays in the corner).\n const triggerIcon = open\n ? (collapseIcon ?? <RotatedIcon node={expandIcon ?? buttonProps.icon} />)\n : (expandIcon ?? buttonProps.icon);\n\n return (\n <FloatButtonGroupContext.Provider value={groupCtxValue}>\n {backdrop && open ? <Backdrop onPress={close} positioning={buttonProps.positioning ?? 'fixed'} /> : null}\n <GroupLayout\n direction={direction}\n placement={buttonProps.placement ?? 'bottom-right'}\n positioning={buttonProps.positioning ?? 'fixed'}\n offset={buttonProps.offset ?? {}}\n dir={buttonProps.dir ?? 'ltr'}\n >\n {open ? <View style={groupActionsLayoutStyle(direction)}>{actionItems}</View> : null}\n <FloatButton\n {...(buttonProps as FloatButtonProps)}\n icon={triggerIcon}\n {...(trigger === 'click' ? { onPress: toggle } : {})}\n {...(trigger === 'longPress' ? { onLongPress: toggle } : {})}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n />\n </GroupLayout>\n </FloatButtonGroupContext.Provider>\n );\n};\n\n// (assignment moved to the bottom-of-file Object.assign)\n\n// =============================================================================\n// FloatButton.BackToTop\n// =============================================================================\n\nexport type FloatButtonBackToTopProps = Omit<FloatButtonProps, 'icon' | 'onPress' | 'onClick' | 'visible'> & {\n /** Scroll target ref — RN ScrollView. Defaults to window on web. */\n scrollRef?: { current: ScrollView | null };\n /** Show only when the scroll target is past this many px from the top. @defaultValue 400 */\n visibilityThreshold?: number;\n};\n\nconst FloatButtonBackToTop: FC<FloatButtonBackToTopProps> = ({\n scrollRef,\n visibilityThreshold = 400,\n variant = 'surface',\n ...rest\n}) => {\n const { t } = useTranslation();\n const [visible, setVisible] = useState(false);\n\n // Web: bind to window scroll. Native: caller wires onScroll on their\n // ScrollView and updates an external state — we expose a passive read here.\n useEffect(() => {\n if (Platform.OS !== 'web' || typeof window === 'undefined') {\n return;\n }\n const onScroll = () => setVisible(window.scrollY > visibilityThreshold);\n onScroll();\n window.addEventListener('scroll', onScroll, { passive: true });\n return () => window.removeEventListener('scroll', onScroll);\n }, [visibilityThreshold]);\n\n const onPress = useCallback(() => {\n if (Platform.OS === 'web' && typeof window !== 'undefined') {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n return;\n }\n scrollRef?.current?.scrollTo?.({ y: 0, animated: true });\n }, [scrollRef]);\n\n return (\n <FloatButton\n {...(rest as FloatButtonProps)}\n variant={variant}\n visible={visible}\n icon={<defaultSemanticIcons.chevronUp size={20} />}\n accessibilityLabel={rest.accessibilityLabel ?? t('floatButton.backToTop', { defaultValue: 'Back to top' })}\n onPress={onPress}\n />\n );\n};\n\n// (assignment moved to the bottom-of-file Object.assign)\n\n/**\n * Public `FloatButton` value — the root function plus its `.Group` and\n * `.BackToTop` static members. `Object.assign` produces a value whose\n * inferred type carries the static properties, so `.d.ts` consumers can\n * write `<FloatButton.Group>` without a separate import.\n */\nexport const FloatButton = Object.assign(FloatButtonRoot, {\n Group: FloatButtonGroup,\n BackToTop: FloatButtonBackToTop,\n});\n\n// =============================================================================\n// Subcomponents\n// =============================================================================\n\nconst TooltipChip = ({ text }: { text: string }) => {\n const colors = useThemeColors();\n return (\n <View\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n backgroundColor: colors.semantic.background.elevated,\n borderRadius: px(colors.radius.sm) + 2,\n borderWidth: 1,\n borderColor: colors.semantic.border.default,\n paddingHorizontal: px(colors.spacing['2']),\n paddingVertical: 4,\n ...(Platform.OS === 'web' ? ({ boxShadow: '0 1px 2px rgba(0,0,0,0.06)' } as object) : null),\n }}\n >\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: 13,\n lineHeight: 16,\n }}\n >\n {text}\n </RNText>\n </View>\n );\n};\n\nconst BadgeOverlay = ({ badge, size }: { badge: FloatButtonBadge; size: FloatButtonSize }) => {\n const offsetTop = size === 'large' ? -6 : -4;\n const offsetRight = size === 'large' ? -6 : -4;\n return (\n <View\n pointerEvents=\"none\"\n style={{\n position: 'absolute',\n top: offsetTop,\n right: offsetRight,\n zIndex: 1,\n }}\n >\n {badge.dot ? (\n <Badge tone={badge.tone ?? 'danger'} appearance=\"solid\">\n {' '}\n </Badge>\n ) : (\n <Badge tone={badge.tone ?? 'danger'} appearance=\"solid\">\n {String(badge.count ?? 0)}\n </Badge>\n )}\n </View>\n );\n};\n\nconst SmallSpinner = ({ color, size }: { color: string; size: number }) => {\n // Tiny CSS spinner on web; on native, defer to an opacity pulse for v1\n // (avoids importing the spinner component into the FloatButton bundle).\n if (Platform.OS === 'web') {\n return (\n <View\n style={\n {\n width: size,\n height: size,\n borderRadius: size / 2,\n borderWidth: 2,\n borderColor: 'transparent',\n borderTopColor: color,\n animationName: 'fb-spin',\n animationDuration: '700ms',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n } as unknown as ViewStyle\n }\n />\n );\n }\n return (\n <View\n style={{\n width: size,\n height: size,\n borderRadius: size / 2,\n borderWidth: 2,\n borderColor: color,\n opacity: 0.6,\n }}\n />\n );\n};\n\nconst Backdrop = ({ onPress, positioning }: { onPress: () => void; positioning: 'fixed' | 'absolute' }) => {\n return (\n <Pressable\n onPress={onPress}\n accessibilityLabel=\"Close\"\n style={{\n position:\n Platform.OS === 'web' && positioning === 'fixed' ? ('fixed' as unknown as 'absolute') : 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.32)',\n zIndex: 49,\n }}\n />\n );\n};\n\nconst RotatedIcon = ({ node, color }: { node: ReactNode; color?: string }) => {\n // Forward the color from the outer `tintIcon` clone down to the inner\n // node — otherwise the morph-to-X icon stays at its default tint while\n // the surrounding FAB icons inherit the variant fg.\n const tintedNode =\n color && isValidElement(node) ? cloneElement(node as ReactElement<{ color?: string }>, { color }) : node;\n return (\n <View\n style={\n {\n transform: [{ rotate: '45deg' }],\n // CSS `color` cascades to nested `currentColor` SVGs on web.\n ...(color ? { color } : null),\n ...(Platform.OS === 'web'\n ? {\n transitionProperty: 'transform',\n transitionDuration: '200ms',\n transitionTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',\n }\n : null),\n } as unknown as ViewStyle\n }\n >\n {tintedNode}\n </View>\n );\n};\n\nconst GroupLayout = ({\n direction,\n placement,\n positioning,\n offset,\n dir,\n children,\n}: {\n direction: FloatButtonGroupDirection;\n placement: FloatButtonPlacement;\n positioning: 'fixed' | 'absolute';\n offset: { x?: number; y?: number };\n dir: 'ltr' | 'rtl';\n children: ReactNode;\n}) => {\n // Read the context directly (instead of `useSafeAreaInsets()`) so the\n // component degrades silently when no `<SafeAreaProvider>` is mounted —\n // the canonical case on web. With a provider, real insets flow through;\n // without one, we get zeros and no console warning.\n const insets = useContext(SafeAreaInsetsContext) ?? { top: 0, right: 0, bottom: 0, left: 0 };\n const { width: viewportWidth } = useWindowDimensions();\n const positionStyle = resolvePositionStyle({\n placement,\n positioning,\n offset,\n dir,\n insets,\n viewportWidth,\n respectSafeArea: false,\n });\n return (\n <View\n style={{\n ...positionStyle,\n flexDirection: direction === 'left' || direction === 'right' ? 'row' : 'column',\n alignItems: direction === 'left' || direction === 'right' ? 'center' : 'flex-end',\n justifyContent: direction === 'up' ? 'flex-end' : 'flex-start',\n }}\n >\n {direction === 'up' || direction === 'left'\n ? children\n : Array.isArray(children)\n ? [...children].reverse()\n : children}\n </View>\n );\n};\n\nfunction groupActionsLayoutStyle(direction: FloatButtonGroupDirection): ViewStyle {\n const isVertical = direction === 'up' || direction === 'down';\n return {\n flexDirection: isVertical ? 'column' : 'row',\n alignItems: 'flex-end',\n gap: 12,\n marginBottom: direction === 'up' ? 12 : 0,\n marginTop: direction === 'down' ? 12 : 0,\n marginRight: direction === 'left' ? 12 : 0,\n marginLeft: direction === 'right' ? 12 : 0,\n };\n}\n\n// =============================================================================\n// Style resolvers\n// =============================================================================\n\nfunction resolveVariantStyle(\n variant: FloatButtonVariant,\n colors: ReturnType<typeof useThemeColors>\n): { bg: string; bgHover: string; bgPressed: string; fg: string; borderColor?: string } {\n switch (variant) {\n case 'primary':\n return {\n bg: colors.semantic.interactive.primary,\n bgHover: colors.semantic.interactive.primaryHover,\n bgPressed: colors.semantic.interactive.primaryPressed,\n fg: colors.semantic.text.inverted,\n };\n case 'secondary':\n return {\n bg: colors.semantic.background.subtle,\n bgHover: colors.semantic.background.elevated,\n bgPressed: colors.semantic.background.subtle,\n fg: colors.semantic.text.default,\n borderColor: colors.semantic.border.default,\n };\n case 'tertiary':\n return {\n bg: 'transparent',\n bgHover: withAlpha(colors.semantic.interactive.primary, 0.08),\n bgPressed: withAlpha(colors.semantic.interactive.primary, 0.12),\n fg: colors.semantic.interactive.primary,\n borderColor: colors.semantic.interactive.primary,\n };\n case 'surface':\n return {\n bg: colors.semantic.background.elevated,\n bgHover: colors.semantic.background.subtle,\n bgPressed: colors.semantic.background.subtle,\n fg: colors.semantic.text.default,\n borderColor: colors.semantic.border.default,\n };\n }\n}\n\nfunction resolveShadowStyle(\n variant: FloatButtonVariant,\n colors: ReturnType<typeof useThemeColors>\n): { resting: ViewStyle; hover: ViewStyle; pressed: ViewStyle } {\n if (Platform.OS !== 'web') {\n // RN's elevation prop on Android maps via boxShadow polyfill; keep\n // it minimal to avoid the chunky M3 look. On iOS we rely on RN's\n // native shadow* props.\n return {\n resting: {\n shadowColor: variant === 'primary' ? colors.semantic.interactive.primary : '#000',\n shadowOffset: { width: 0, height: 6 },\n shadowOpacity: variant === 'primary' ? 0.25 : 0.12,\n shadowRadius: 16,\n elevation: 6,\n } as unknown as ViewStyle,\n hover: {} as ViewStyle,\n pressed: {\n shadowOffset: { width: 0, height: 2 },\n shadowRadius: 6,\n elevation: 2,\n } as unknown as ViewStyle,\n };\n }\n const tint = variant === 'primary' ? colors.semantic.interactive.primary : '#000';\n return {\n resting: {\n ...({\n boxShadow: `0 1px 2px rgba(0,0,0,0.06), 0 8px 24px -6px ${withAlpha(tint, variant === 'primary' ? 0.32 : 0.08)}`,\n } as unknown as ViewStyle),\n },\n hover: {\n ...({\n boxShadow: `0 2px 4px rgba(0,0,0,0.08), 0 12px 28px -6px ${withAlpha(tint, variant === 'primary' ? 0.4 : 0.12)}`,\n } as unknown as ViewStyle),\n },\n pressed: {\n ...({ boxShadow: `0 1px 2px rgba(0,0,0,0.06)` } as unknown as ViewStyle),\n },\n };\n}\n\nfunction resolvePositionStyle({\n placement,\n positioning = 'fixed',\n offset,\n dir,\n insets,\n viewportWidth,\n respectSafeArea,\n}: {\n placement: FloatButtonPlacement;\n positioning?: 'fixed' | 'absolute';\n offset: { x?: number; y?: number };\n dir: 'ltr' | 'rtl';\n insets: { top: number; right: number; bottom: number; left: number };\n viewportWidth: number;\n respectSafeArea: boolean;\n}): ViewStyle {\n const defaultOffset = Platform.OS === 'web' ? DEFAULT_OFFSET_WEB : DEFAULT_OFFSET_NATIVE;\n const x = offset.x ?? defaultOffset;\n const y = offset.y ?? defaultOffset;\n const safeBottom = Platform.OS !== 'web' && respectSafeArea ? insets.bottom : 0;\n const safeTop = Platform.OS !== 'web' && respectSafeArea ? insets.top : 0;\n\n // RTL flips left/right placements.\n const flippedPlacement: FloatButtonPlacement =\n dir === 'rtl'\n ? placement === 'bottom-right'\n ? 'bottom-left'\n : placement === 'bottom-left'\n ? 'bottom-right'\n : placement === 'top-right'\n ? 'top-left'\n : 'top-right'\n : placement;\n\n // RN doesn't have `position: 'fixed'` — only `'absolute'`. On web RN-Web\n // accepts the cast. The `positioning` prop also lets consumers force\n // `'absolute'` so the FAB pins to a positioned ancestor (docs previews).\n const cssPosition: ViewStyle['position'] =\n Platform.OS === 'web' && positioning === 'fixed' ? ('fixed' as unknown as 'absolute') : 'absolute';\n const base: ViewStyle = {\n position: cssPosition,\n zIndex: 50,\n };\n\n switch (flippedPlacement) {\n case 'bottom-right':\n return { ...base, bottom: y + safeBottom, right: x };\n case 'bottom-left':\n return { ...base, bottom: y + safeBottom, left: x };\n case 'top-right':\n return { ...base, top: y + safeTop, right: x };\n case 'top-left':\n return { ...base, top: y + safeTop, left: x };\n }\n // Suppress viewportWidth warning — reserved for future RTL/horizontal logic.\n void viewportWidth;\n return base;\n}\n\n/**\n * Force the icon's color to match the FAB's variant fg. Works for our\n * `IconComponentProps`-shaped icons (which accept `{ size, color }`) by\n * cloning the element with the resolved color; raw nodes pass through\n * unchanged and rely on the wrapper's CSS `color` for `currentColor`-based\n * SVGs. Consumer-supplied colors are intentionally overridden — inside a\n * primary FAB the icon should always read against the primary surface.\n */\nfunction tintIcon(icon: ReactNode, color: string): ReactNode {\n if (!isValidElement(icon)) {\n return icon;\n }\n return cloneElement(icon as ReactElement<{ color?: string }>, { color });\n}\n\nfunction withAlpha(color: string, alpha: number): string {\n if (color.startsWith('#') && (color.length === 7 || color.length === 4)) {\n const expanded =\n color.length === 4 ? `#${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}` : color;\n const r = Number.parseInt(expanded.slice(1, 3), 16);\n const g = Number.parseInt(expanded.slice(3, 5), 16);\n const b = Number.parseInt(expanded.slice(5, 7), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n return color;\n}\n\n// Suppress unused — ComponentProps reserved for future href-prop polymorphism.\ntype _Unused = ComponentProps<'button'>;\n","import type { ViewProps, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from '../../utils/cn';\nimport { wrapStringChildren } from '../../utils/wrap-string-children';\n\nexport type StackGap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12;\nexport type StackAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';\nexport type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n\nexport type HStackProps = ViewProps & {\n gap?: StackGap;\n align?: StackAlign;\n justify?: StackJustify;\n className?: string;\n testID?: string;\n};\n\nconst ALIGN_CLASS: Record<StackAlign, string> = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n};\n\nconst JUSTIFY_CLASS: Record<StackJustify, string> = {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n};\n\nconst ALIGN_STYLE: Record<StackAlign, ViewStyle['alignItems']> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n stretch: 'stretch',\n baseline: 'baseline',\n};\n\nconst JUSTIFY_STYLE: Record<StackJustify, ViewStyle['justifyContent']> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n between: 'space-between',\n around: 'space-around',\n evenly: 'space-evenly',\n};\n\n// Tailwind spacing scale → RN px. Mirrors the `gap-{n}` class output but\n// drives RN's native `gap` style, which Yoga supports directly. Inline\n// `gap` is more reliable than NativeWind's className path on native —\n// css-interop sometimes fails to apply gap classes through the static\n// extraction pipeline, leaving stacks with zero spacing.\nconst GAP_PX: Record<StackGap, number> = {\n 0: 0,\n 1: 4,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n};\n\n/**\n * Horizontal flex layout primitive. RSC-safe.\n *\n * Layout (`flexDirection`, `gap`, `alignItems`, `justifyContent`) is set\n * via inline style — NativeWind's className path doesn't reliably apply\n * these on native. The matching Tailwind classes are still emitted so\n * web tooling and consumers extending the className keep working.\n */\nexport const HStack = ({ gap, align, justify, className, children, style, ...rest }: HStackProps) => {\n const inline: ViewStyle = { flexDirection: 'row' };\n if (gap !== undefined && gap !== 0) {\n inline.gap = GAP_PX[gap];\n }\n if (align !== undefined) {\n inline.alignItems = ALIGN_STYLE[align];\n }\n if (justify !== undefined) {\n inline.justifyContent = JUSTIFY_STYLE[justify];\n }\n const merged = style === undefined ? inline : ([inline, style] as ViewStyle[]);\n return (\n <View\n {...rest}\n style={merged}\n className={cn(\n 'flex-row',\n gap !== undefined && gap !== 0 ? `gap-${gap}` : undefined,\n align !== undefined ? ALIGN_CLASS[align] : undefined,\n justify !== undefined ? JUSTIFY_CLASS[justify] : undefined,\n className\n )}\n >\n {wrapStringChildren(children)}\n </View>\n );\n};\n","'use client';\n\nimport {\n Children,\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { TextInput as RNTextInputType, TextStyle, ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, TextInput as RNTextInput, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport type { TextInputProps } from '../TextInput/TextInput';\n\n// ─── Internal context ─────────────────────────────────────────────────────\n//\n// Lets the addons + input share focus, error, and disabled state so the\n// WHOLE group's border lights up on focus and dimming cascades visually\n// without consumers having to duplicate props on every child.\ntype InputGroupContextValue = {\n inputId: string;\n describeId: string;\n setFocused: (next: boolean) => void;\n hasError: boolean;\n disabled: boolean;\n inputRef: React.MutableRefObject<RNTextInputType | null>;\n focusInput: () => void;\n};\n\nconst InputGroupContext = createContext<InputGroupContextValue | null>(null);\n\nconst useInputGroupContext = (label: string): InputGroupContextValue => {\n const ctx = useContext(InputGroupContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside an <InputGroup>.`);\n }\n return ctx;\n};\n\n// Marker symbols on the child component functions so we can split children\n// into [prefix, input, suffix] without forcing consumers to pass `position`\n// props or use named slots. Whatever sits before the InputGroupInput is a\n// prefix; whatever sits after is a suffix.\nconst ADDON_TYPE = Symbol.for('nori-ui.InputGroupAddon');\nconst INPUT_TYPE = Symbol.for('nori-ui.InputGroupInput');\n\nconst isAddon = (child: unknown): child is ReactElement =>\n isValidElement(child) && (child.type as { __noriType?: symbol })?.__noriType === ADDON_TYPE;\n\nconst isInput = (child: unknown): child is ReactElement<InputGroupInputProps> =>\n isValidElement(child) && (child.type as { __noriType?: symbol })?.__noriType === INPUT_TYPE;\n\n// ─── Container ────────────────────────────────────────────────────────────\n\n// Layout-only bases; theme-driven dimensions are merged inside the\n// component below.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = { flexDirection: 'column' };\nconst FIELD_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'stretch',\n borderWidth: 1,\n overflow: 'hidden',\n};\n\nexport type InputGroupProps = {\n children: ReactNode;\n /** Mark the entire group as disabled — cascades visually to addons + input. */\n disabled?: boolean;\n /** Mark the entire group as errored — cascades visually to addons + input. */\n error?: boolean;\n className?: string;\n containerClassName?: string;\n testID?: string;\n};\n\n/**\n * Wrapper that visually fuses prefix and/or suffix addons with a TextInput\n * into a SINGLE rounded field — one border around the whole compound, not\n * three separate boxes. Inspired by Chakra's InputGroup and shadcn's input\n * addon pattern.\n *\n * @example\n * <InputGroup>\n * <InputGroupAddon>@</InputGroupAddon>\n * <InputGroupInput placeholder=\"username\" />\n * </InputGroup>\n *\n * @example with both prefix and suffix\n * <InputGroup>\n * <InputGroupAddon>https://</InputGroupAddon>\n * <InputGroupInput defaultValue=\"example\" />\n * <InputGroupAddon>.com</InputGroupAddon>\n * </InputGroup>\n */\nconst InputGroupRoot = ({\n children,\n disabled = false,\n error: groupErrorProp = false,\n className,\n containerClassName,\n testID,\n}: InputGroupProps) => {\n const colors = useThemeColors();\n const reactId = useId();\n const inputId = `nori-ui-input-${reactId}`;\n const describeId = `${inputId}-describe`;\n const [focused, setFocused] = useState(false);\n const inputRef = useRef<RNTextInputType | null>(null);\n\n // Stable identity (does not depend on render-cycle state) so the\n // useMemo below can leave it out of the dep array without lint noise.\n const focusInput = useCallback(() => {\n inputRef.current?.focus();\n }, []);\n\n // Walk children once, split into [prefix, input, suffix]. Anything that\n // isn't a recognised marker gets dropped — the API guarantees a single\n // integrated bar, not arbitrary slots.\n const childArray = Children.toArray(children);\n const inputIndex = childArray.findIndex(isInput);\n const inputElement = inputIndex >= 0 ? (childArray[inputIndex] as ReactElement<InputGroupInputProps>) : null;\n const prefixNodes = inputIndex >= 0 ? childArray.slice(0, inputIndex).filter(isAddon) : [];\n const suffixNodes = inputIndex >= 0 ? childArray.slice(inputIndex + 1).filter(isAddon) : [];\n\n // Lift label / helperText / error from the input element so the parent\n // can render them OUTSIDE the bordered field row (a normal field layout\n // wraps the box with label above and helper/error below).\n const inputProps = inputElement?.props ?? ({} as InputGroupInputProps);\n const label = inputProps.label;\n const helperText = inputProps.helperText;\n const inputError = inputProps.error;\n\n const hasError = Boolean(groupErrorProp) || Boolean(inputError);\n\n const ctx = useMemo<InputGroupContextValue>(\n () => ({\n inputId,\n describeId,\n setFocused,\n hasError,\n disabled,\n inputRef,\n focusInput,\n }),\n [inputId, describeId, hasError, disabled, focusInput]\n );\n\n const borderColor = hasError\n ? colors.color.danger\n : focused\n ? colors.semantic.interactive.primary\n : colors.semantic.border.default;\n\n const fieldStyle = [\n FIELD_LAYOUT_BASE,\n {\n borderRadius: px(colors.radius.md),\n backgroundColor: colors.semantic.background.elevated,\n borderColor,\n },\n disabled ? { opacity: 0.6 } : null,\n ];\n\n const labelStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n color: colors.semantic.text.default,\n };\n const helperStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n };\n const errorStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.color.danger,\n };\n const containerStyle: ViewStyle = { ...CONTAINER_LAYOUT_BASE, gap: px(colors.spacing['1']) };\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('flex flex-col gap-1', containerClassName)}\n style={containerStyle}\n >\n {label !== undefined ? (\n // On web we render a real <label htmlFor> so clicking the\n // label focuses the input the standard a11y way (and so\n // jsdom-based tests can assert the label↔input\n // association via the `for` attribute).\n //\n // On native, raw <label> is not a valid host component\n // and RN crashes with \"View config getter callback for\n // component `label` must be a function\". The native\n // path renders an RNText instead — the underlying\n // RNTextInput still carries accessibilityLabel for\n // screen readers, so the visible text + the a11y name\n // remain in sync. Same web-only `<label>` story as\n // TextInput's earlier iteration; this branch is the\n // explicit native-safe fallback.\n Platform.OS === 'web' ? (\n <label\n htmlFor={inputId}\n className=\"text-sm font-medium text-semantic-text-default\"\n style={labelStyle as object}\n >\n {label}\n </label>\n ) : (\n <RNText\n nativeID={`${inputId}-label`}\n accessibilityRole=\"text\"\n className=\"text-sm font-medium text-semantic-text-default\"\n style={labelStyle}\n >\n {label}\n </RNText>\n )\n ) : null}\n <InputGroupContext.Provider value={ctx}>\n <View\n className={cn(\n 'flex-row items-stretch overflow-hidden rounded-md border focus-within:border-semantic-interactive-primary',\n hasError ? 'border-semantic-interactive-destructive' : 'border-semantic-border-default',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={fieldStyle}\n >\n {prefixNodes.map((node, i) => {\n const key = (node as ReactElement & { key?: string | null }).key ?? `prefix-${i}`;\n return (\n <AddonSlot key={key} side=\"left\">\n {node}\n </AddonSlot>\n );\n })}\n {inputElement}\n {suffixNodes.map((node, i) => {\n const key = (node as ReactElement & { key?: string | null }).key ?? `suffix-${i}`;\n return (\n <AddonSlot key={key} side=\"right\">\n {node}\n </AddonSlot>\n );\n })}\n </View>\n </InputGroupContext.Provider>\n {inputError ? (\n <RNText\n nativeID={describeId}\n className=\"text-sm text-semantic-interactive-destructive\"\n style={errorStyle}\n >\n {inputError}\n </RNText>\n ) : helperText ? (\n <RNText nativeID={describeId} className=\"text-sm text-semantic-text-muted\" style={helperStyle}>\n {helperText}\n </RNText>\n ) : null}\n </View>\n );\n};\n\n// ─── Addon slot ───────────────────────────────────────────────────────────\n//\n// Internal wrapper that paints the muted background, draws the 1px vertical\n// separator on the input-facing side, and forwards a click to the input so\n// the addon reads as decorator, not as something interactive.\nconst AddonSlot = ({ children, side }: { children: ReactNode; side: 'left' | 'right' }) => {\n const colors = useThemeColors();\n const ctx = useContext(InputGroupContext);\n const dim = ctx?.disabled ? 0.85 : 1;\n\n const baseStyle: ViewStyle = {\n backgroundColor: colors.semantic.background.subtle,\n paddingHorizontal: px(colors.spacing['3']),\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n opacity: dim,\n };\n\n const separatorStyle: ViewStyle =\n side === 'left'\n ? { borderRightWidth: 1, borderRightColor: colors.semantic.border.default }\n : { borderLeftWidth: 1, borderLeftColor: colors.semantic.border.default };\n\n const handlePress = () => {\n ctx?.focusInput();\n };\n\n return (\n <Pressable\n // Pressing the addon focuses the input — addons are decorators,\n // never tab stops. RN's `accessibilityRole` doesn't accept \"presentation\"\n // (web-only), so we set the WAI-ARIA role via the web prop instead.\n onPress={handlePress}\n role=\"none\"\n // RN web maps `focusable={false}` to `tabIndex={-1}`.\n focusable={false}\n style={[baseStyle, separatorStyle]}\n className={cn(\n 'flex-row items-center justify-center px-3 bg-semantic-background-subtle',\n side === 'right' ? 'border-l border-semantic-border-default' : 'border-r border-semantic-border-default'\n )}\n >\n {children}\n </Pressable>\n );\n};\n\n// ─── Addon (public) ───────────────────────────────────────────────────────\n\nexport type InputGroupAddonProps = {\n children: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Decorator slot inside an `<InputGroup>`. Renders a muted, non-interactive\n * box that visually fuses with the input. Place before `<InputGroupInput>`\n * for a prefix, after for a suffix. Accepts strings or `ReactNode` (icons).\n */\nexport const InputGroupAddon = ({ children, className, testID }: InputGroupAddonProps) => {\n const colors = useThemeColors();\n const textStyle: TextStyle = {\n color: colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n };\n\n // Wrap raw strings/numbers so consumers can pass `\"@\"` or `<MailIcon />`\n // and both render correctly without callers tripping over RN's \"text\n // outside of <Text>\" warning.\n if (typeof children === 'string' || typeof children === 'number') {\n return (\n <RNText\n {...(testID !== undefined ? { testID } : {})}\n className={cn('text-sm text-semantic-text-muted', className)}\n style={textStyle}\n >\n {children}\n </RNText>\n );\n }\n\n return (\n <View {...(testID !== undefined ? { testID } : {})} {...(className !== undefined ? { className } : {})}>\n {children}\n </View>\n );\n};\n\n// Brand the function so the parent can locate it via Children.toArray walk.\n(InputGroupAddon as unknown as { __noriType: symbol }).__noriType = ADDON_TYPE;\n\n// ─── Input (public) ───────────────────────────────────────────────────────\n\n// Layout-only base; theme-driven dimensions are merged inside InputGroupInput.\nconst INPUT_LAYOUT_BASE: TextStyle = {\n flex: 1,\n // RN web honours `outlineStyle: 'none'` to suppress the default browser\n // focus ring — the group's own focus-within border replaces it.\n outlineStyle: 'none' as unknown as TextStyle['outlineStyle'],\n};\n\nexport type InputGroupInputProps = TextInputProps;\n\n/**\n * The text field inside an `<InputGroup>`. Extends the full `TextInput` API\n * (label, helperText, error, disabled, etc.) so consumers don't lose any\n * functionality when reaching for the integrated layout.\n *\n * Implementation note: this renders a bare RN `TextInput` because the\n * surrounding `<InputGroup>` already paints the border + label + helper —\n * those bits are lifted to the parent so they render OUTSIDE the bordered\n * field row, the way a normal field's label/helper sits above/below the box.\n */\nexport const InputGroupInput = ({\n label: _label,\n helperText: _helperText,\n error,\n disabled,\n onChangeText,\n onFocus,\n onBlur,\n multiline,\n numberOfLines,\n leading: _leading,\n trailing: _trailing,\n containerClassName: _containerClassName,\n className,\n testID,\n ...rest\n}: InputGroupInputProps) => {\n const colors = useThemeColors();\n const ctx = useInputGroupContext('InputGroupInput');\n const inputId = ctx.inputId;\n const describeId = ctx.describeId;\n const isDisabled = disabled || ctx.disabled;\n const hasError = Boolean(error) || ctx.hasError;\n\n const inputExtras: Record<string, unknown> = {};\n if (testID !== undefined) {\n inputExtras.testID = testID;\n }\n if (_label !== undefined) {\n inputExtras.accessibilityLabel = _label;\n }\n if (hasError) {\n inputExtras['aria-invalid'] = true;\n }\n if (error || _helperText) {\n inputExtras['aria-describedby'] = describeId;\n }\n if (multiline !== undefined) {\n inputExtras.multiline = multiline;\n }\n if (numberOfLines !== undefined) {\n inputExtras.numberOfLines = numberOfLines;\n }\n if (onChangeText !== undefined) {\n inputExtras.onChangeText = onChangeText;\n }\n\n const inputStyle: TextStyle = {\n ...INPUT_LAYOUT_BASE,\n paddingVertical: px(colors.spacing['2']),\n paddingHorizontal: px(colors.spacing['3']),\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n color: colors.semantic.text.default,\n };\n\n return (\n <RNTextInput\n ref={(node) => {\n ctx.inputRef.current = node;\n }}\n nativeID={inputId}\n editable={!isDisabled}\n className={cn('flex-1 py-2 px-3 text-md text-semantic-text-default outline-none bg-transparent', className)}\n placeholderTextColor={colors.semantic.text.muted}\n onFocus={(e) => {\n ctx.setFocused(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n ctx.setFocused(false);\n onBlur?.(e);\n }}\n {...inputExtras}\n {...rest}\n style={[inputStyle, rest.style]}\n />\n );\n};\n\n(InputGroupInput as unknown as { __noriType: symbol }).__noriType = INPUT_TYPE;\n\n/**\n * Public `InputGroup` value — the root function plus its `.Addon` and `.Input`\n * static members. `Object.assign` produces a value whose inferred type carries\n * the static properties, so `.d.ts` consumers can write `<InputGroup.Addon>`\n * without a separate import.\n */\nexport const InputGroup = Object.assign(InputGroupRoot, {\n Addon: InputGroupAddon,\n Input: InputGroupInput,\n});\n","'use client';\n\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nexport type PaginationItemType = 'page' | 'prev' | 'next' | 'first' | 'last' | 'ellipsis';\n\n/**\n * One slot in the rendered pagination row, as produced by `usePagination`.\n * `page` is set on `'page'` items only; ellipsis carries no number.\n */\nexport type PaginationItemDescriptor = {\n type: PaginationItemType;\n page?: number;\n selected?: boolean;\n disabled?: boolean;\n};\n\nexport type UsePaginationArgs = {\n /** Controlled current page (1-indexed). Omit for uncontrolled. */\n page?: number;\n /** Initial page when uncontrolled (1-indexed). @defaultValue 1 */\n defaultPage?: number;\n /** Total number of pages. */\n pageCount: number;\n /** Pages on each side of the current page. @defaultValue 1 */\n siblingCount?: number;\n /** Pages always visible at start/end. @defaultValue 1 */\n boundaryCount?: number;\n /** Include first/last items in the `pages` list. @defaultValue false */\n showFirstLast?: boolean;\n /** Include prev/next items in the `pages` list. @defaultValue true */\n showPrevNext?: boolean;\n /** Fired on every page change. */\n onPageChange?: (page: number) => void;\n};\n\nexport type UsePaginationReturn = {\n /** Current page (1-indexed), clamped to [1, max(1, pageCount)]. */\n page: number;\n /** Item descriptors in render order. */\n pages: ReadonlyArray<PaginationItemDescriptor>;\n canPrev: boolean;\n canNext: boolean;\n goToPage: (page: number) => void;\n prev: () => void;\n next: () => void;\n first: () => void;\n last: () => void;\n};\n\nconst range = (from: number, to: number): number[] => {\n if (to < from) {\n return [];\n }\n const out = new Array<number>(to - from + 1);\n for (let i = 0; i < out.length; i += 1) {\n out[i] = from + i;\n }\n return out;\n};\n\n/**\n * Headless pagination math + state. Returns the items to render and the\n * actions that drive them — without a single DOM/RN element. Use this\n * directly for fully custom paginators, or let `<Pagination>` use it\n * internally.\n *\n * The math mirrors MUI's `usePagination` algorithm so its behavior is\n * predictable for anyone who has used the React ecosystem before.\n *\n * @example\n * const p = usePagination({ pageCount: 12, defaultPage: 3 });\n * p.pages.map((item) => …);\n */\nexport function usePagination(args: UsePaginationArgs): UsePaginationReturn {\n const {\n page: controlledPage,\n defaultPage = 1,\n pageCount,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstLast = false,\n showPrevNext = true,\n onPageChange,\n } = args;\n\n const isControlled = controlledPage !== undefined;\n const [uncontrolledPage, setUncontrolledPage] = useState(defaultPage);\n\n // Latest-callback ref so `goToPage` can stay referentially stable.\n const onChangeRef = useRef(onPageChange);\n onChangeRef.current = onPageChange;\n\n const safePageCount = Math.max(1, Math.floor(pageCount));\n const rawPage = isControlled ? (controlledPage as number) : uncontrolledPage;\n const currentPage = Math.min(Math.max(1, Math.floor(rawPage)), safePageCount);\n\n const goToPage = useCallback(\n (next: number) => {\n const clamped = Math.min(Math.max(1, Math.floor(next)), Math.max(1, Math.floor(pageCount)));\n if (!isControlled) {\n setUncontrolledPage(clamped);\n }\n onChangeRef.current?.(clamped);\n },\n [isControlled, pageCount]\n );\n\n const prev = useCallback(() => goToPage(currentPage - 1), [goToPage, currentPage]);\n const next = useCallback(() => goToPage(currentPage + 1), [goToPage, currentPage]);\n const first = useCallback(() => goToPage(1), [goToPage]);\n const last = useCallback(() => goToPage(safePageCount), [goToPage, safePageCount]);\n\n const pages = useMemo<ReadonlyArray<PaginationItemDescriptor>>(() => {\n const items: PaginationItemDescriptor[] = [];\n const safeSibling = Math.max(0, Math.floor(siblingCount));\n const safeBoundary = Math.max(0, Math.floor(boundaryCount));\n\n // First / Prev\n if (showFirstLast) {\n items.push({ type: 'first', disabled: currentPage <= 1 });\n }\n if (showPrevNext) {\n items.push({ type: 'prev', disabled: currentPage <= 1 });\n }\n\n // Page numbers + ellipses\n const startPages = range(1, Math.min(safeBoundary, safePageCount));\n const endPages = range(Math.max(safePageCount - safeBoundary + 1, safeBoundary + 1), safePageCount);\n\n const siblingsStart = Math.max(\n Math.min(currentPage - safeSibling, safePageCount - safeBoundary - safeSibling * 2 - 1),\n safeBoundary + 2\n );\n const siblingsEnd = Math.min(\n Math.max(currentPage + safeSibling, safeBoundary + safeSibling * 2 + 2),\n endPages.length > 0 ? endPages[0]! - 2 : safePageCount - 1\n );\n\n const middle: Array<number | 'ellipsis'> = [];\n // Start ellipsis\n if (siblingsStart > safeBoundary + 2) {\n middle.push('ellipsis');\n } else if (safeBoundary + 1 < safePageCount - safeBoundary) {\n middle.push(safeBoundary + 1);\n }\n // Middle pages\n for (const p of range(siblingsStart, siblingsEnd)) {\n middle.push(p);\n }\n // End ellipsis\n if (siblingsEnd < safePageCount - safeBoundary - 1) {\n middle.push('ellipsis');\n } else if (safePageCount - safeBoundary > safeBoundary) {\n middle.push(safePageCount - safeBoundary);\n }\n\n const seen = new Set<number>();\n const pushPage = (n: number) => {\n if (n < 1 || n > safePageCount || seen.has(n)) {\n return;\n }\n seen.add(n);\n items.push({ type: 'page', page: n, selected: n === currentPage });\n };\n\n for (const n of startPages) {\n pushPage(n);\n }\n for (const m of middle) {\n if (m === 'ellipsis') {\n items.push({ type: 'ellipsis' });\n } else {\n pushPage(m);\n }\n }\n for (const n of endPages) {\n pushPage(n);\n }\n\n // Next / Last\n if (showPrevNext) {\n items.push({ type: 'next', disabled: currentPage >= safePageCount });\n }\n if (showFirstLast) {\n items.push({ type: 'last', disabled: currentPage >= safePageCount });\n }\n\n return items;\n }, [currentPage, safePageCount, siblingCount, boundaryCount, showFirstLast, showPrevNext]);\n\n return {\n page: currentPage,\n pages,\n canPrev: currentPage > 1,\n canNext: currentPage < safePageCount,\n goToPage,\n prev,\n next,\n first,\n last,\n };\n}\n","'use client';\n\nimport {\n type ComponentProps,\n createContext,\n type FC,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, TextInput as RNTextInput, useWindowDimensions, View } from 'react-native';\nimport { useTranslation } from '../../i18n/use-translation';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { Select, type SelectOption } from '../Select';\nimport { type PaginationItemDescriptor, type PaginationItemType, usePagination } from './use-pagination';\n\n// =============================================================================\n// Public types\n// =============================================================================\n\nexport { type UsePaginationArgs, type UsePaginationReturn, usePagination } from './use-pagination';\nexport type { PaginationItemDescriptor, PaginationItemType };\n\nexport type PaginationVariant = 'auto' | 'numbered' | 'compact';\n\nexport type PaginationRenderItemArgs = {\n type: PaginationItemType;\n page?: number;\n selected: boolean;\n disabled: boolean;\n ariaLabel: string;\n ariaCurrent?: 'page';\n children: ReactNode;\n onPress: () => void;\n};\n\nexport type PaginationOnPageChange = (page: number, meta?: { pageSize?: number }) => void;\n\nexport type PaginationProps = {\n /** Controlled current page (1-indexed). */\n page?: number;\n /** Initial page when uncontrolled (1-indexed). @defaultValue 1 */\n defaultPage?: number;\n /** Total number of pages. Required. */\n pageCount: number;\n /** Pages on each side of the current page. @defaultValue 1 */\n siblingCount?: number;\n /** Pages always visible at start/end. @defaultValue 1 */\n boundaryCount?: number;\n /** Show first/last buttons. @defaultValue false */\n showFirstLast?: boolean;\n /** Hide the entire component when `pageCount <= 1`. @defaultValue true */\n hideOnSinglePage?: boolean;\n /**\n * Force a UI variant. `auto` swaps to `compact` on viewports under\n * `PAGINATION_COMPACT_BREAKPOINT` px wide.\n * @defaultValue 'auto'\n */\n variant?: PaginationVariant;\n /** Render the \"Showing X–Y of Z\" range automatically. @defaultValue false */\n showRange?: boolean;\n /** Total item count — needed by `Pagination.Range` and `Pagination.PageSize`. */\n itemCount?: number;\n /** Items per page — needed by `Pagination.Range` and `Pagination.PageSize`. */\n pageSize?: number;\n /** Fired on every page (or page-size) change. */\n onPageChange?: PaginationOnPageChange;\n /** Render-prop slot for each item. Same signature on web + native. */\n renderItem?: (args: PaginationRenderItemArgs) => ReactNode;\n /** RTL override. @defaultValue 'ltr' */\n dir?: 'ltr' | 'rtl';\n /** Override individual labels (otherwise sourced from `useTranslation`). */\n previousLabel?: string;\n nextLabel?: string;\n firstLabel?: string;\n lastLabel?: string;\n /** Override the nav landmark label. */\n ariaLabel?: string;\n className?: string;\n testID?: string;\n /** Provide compound children to opt out of the items-array shorthand. */\n children?: ReactNode;\n};\n\n/** Viewport width below which `variant=\"auto\"` switches to `compact`. */\nexport const PAGINATION_COMPACT_BREAKPOINT = 480;\n\n// =============================================================================\n// Context (used by both compound parts and the shorthand's internal layout)\n// =============================================================================\n\ntype PaginationContextValue = {\n page: number;\n pageCount: number;\n pageSize: number | undefined;\n itemCount: number | undefined;\n siblingCount: number;\n boundaryCount: number;\n showFirstLast: boolean;\n dir: 'ltr' | 'rtl';\n labels: {\n prev: string;\n next: string;\n first: string;\n last: string;\n gotoPage: (page: number) => string;\n ellipsis: string;\n currentPage: string;\n rangeFmt: (from: number, to: number, total: number) => string;\n pageOfFmt: (page: number, total: number) => string;\n pageSize: string;\n jumperLabel: string;\n jumperPlaceholder: string;\n };\n renderItem?: (args: PaginationRenderItemArgs) => ReactNode;\n goToPage: (page: number) => void;\n setPageSize: (next: number) => void;\n};\n\nconst PaginationContext = createContext<PaginationContextValue | null>(null);\n\nconst usePaginationContext = (label: string): PaginationContextValue => {\n const ctx = useContext(PaginationContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside a <Pagination> or <Pagination.Root>.`);\n }\n return ctx;\n};\n\n// =============================================================================\n// Default item button (used when `renderItem` is not provided)\n// =============================================================================\n\ntype ItemButtonProps = {\n type: PaginationItemType;\n page?: number;\n selected: boolean;\n disabled: boolean;\n ariaLabel: string;\n ariaCurrent?: 'page';\n label: ReactNode;\n onPress: () => void;\n testID?: string;\n};\n\nconst ItemButton = ({ type, selected, disabled, ariaLabel, ariaCurrent, label, onPress, testID }: ItemButtonProps) => {\n const colors = useThemeColors();\n const isChevron = type === 'prev' || type === 'next' || type === 'first' || type === 'last';\n const isInteractive = !disabled && type !== 'ellipsis';\n const size = px(colors.spacing['8']); // 32px — minimum touch target\n\n if (type === 'ellipsis') {\n // Ellipsis is presentational; no button chrome, no padding — just a\n // balanced spacer that keeps the row's rhythm intact.\n return (\n <View\n aria-hidden\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{\n minWidth: size,\n minHeight: size,\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n // Optical adjust so the dots sit on the row baseline.\n marginTop: -2,\n letterSpacing: 1,\n }}\n >\n {label}\n </RNText>\n </View>\n );\n }\n\n // Pre-compute the static style so the Pressable's function form only has\n // to overlay press/hover deltas. This is more robust on native, where\n // some renderers were observed to drop properties from the function-form\n // result intermittently — especially the selected pill's `backgroundColor`,\n // producing white text on a white background.\n const baseStyle: ViewStyle = {\n minWidth: size,\n height: size,\n paddingHorizontal: px(colors.spacing['2']),\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: px(colors.radius.md),\n // Selected: filled pill in primary. Default: transparent. Press/hover\n // deltas overlay this in the style fn below.\n backgroundColor: selected ? colors.semantic.interactive.primary : 'transparent',\n // A 1px transparent border is reserved on every item so the layout\n // stays stable when the selected one shows its accent border.\n borderWidth: 1,\n borderColor: selected ? colors.semantic.interactive.primary : 'transparent',\n opacity: disabled ? 0.35 : 1,\n };\n\n // Web-only CSS transitions; merged into the static base on web.\n const webExtras =\n Platform.OS === 'web'\n ? ({\n transitionProperty: 'background-color, color, border-color',\n transitionDuration: '120ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n } as unknown as ViewStyle)\n : null;\n const staticStyle: ViewStyle = { ...baseStyle, ...(webExtras ?? {}) };\n\n return (\n <Pressable\n {...(testID !== undefined ? { testID } : {})}\n role=\"button\"\n accessibilityRole=\"button\"\n accessibilityLabel={ariaLabel}\n aria-label={ariaLabel}\n {...(ariaCurrent ? { 'aria-current': ariaCurrent } : {})}\n disabled={disabled}\n aria-disabled={disabled || undefined}\n onPress={isInteractive ? onPress : undefined}\n // Use a function form ONLY on web so Pressable can read `hovered`.\n // On native the function form was observed to occasionally drop\n // its returned style block on iOS — so we pass a plain object,\n // which renders reliably.\n style={\n Platform.OS === 'web'\n ? (state) => {\n const { pressed, hovered } = state as { pressed: boolean; hovered?: boolean };\n const interactive =\n !selected && (pressed || hovered)\n ? colors.semantic.background.subtle\n : staticStyle.backgroundColor;\n return { ...staticStyle, backgroundColor: interactive };\n }\n : staticStyle\n }\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: isChevron ? px(colors.fontSize.md) : px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.md),\n color: selected\n ? colors.semantic.text.inverted\n : disabled\n ? colors.semantic.text.muted\n : colors.semantic.text.default,\n fontWeight: selected ? (colors.fontWeight.semibold as '600') : (colors.fontWeight.medium as '500'),\n fontVariant: ['tabular-nums'],\n // Chevron glyphs sit a hair high in most fonts.\n marginTop: isChevron ? -1 : 0,\n }}\n >\n {label}\n </RNText>\n </Pressable>\n );\n};\n\n// =============================================================================\n// Live region for screen readers (web only — RN announces via accessibilityLiveRegion)\n// =============================================================================\n\nconst LiveRegion = ({ message }: { message: string }) => {\n if (Platform.OS === 'web') {\n return (\n <View\n style={{\n position: 'absolute',\n width: 1,\n height: 1,\n overflow: 'hidden',\n opacity: 0,\n }}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic\n >\n <RNText accessibilityLiveRegion=\"polite\">{message}</RNText>\n </View>\n );\n }\n return (\n <View accessibilityLiveRegion=\"polite\" style={{ width: 0, height: 0 }}>\n <RNText>{message}</RNText>\n </View>\n );\n};\n\n// =============================================================================\n// Items renderer (the shorthand UI)\n// =============================================================================\n\ntype ItemsRendererProps = {\n items: ReadonlyArray<PaginationItemDescriptor>;\n onItemPress: (item: PaginationItemDescriptor) => void;\n};\n\nconst ItemsRenderer = ({ items, onItemPress }: ItemsRendererProps) => {\n const { labels, renderItem, dir } = usePaginationContext('Pagination.Items');\n\n const elements = items.map((item, idx) => {\n const key = `${item.type}-${item.page ?? idx}-${idx}`;\n const ariaLabel = ariaLabelFor(item, labels);\n const ariaCurrent = item.selected ? ('page' as const) : undefined;\n const display = displayLabelFor(item, labels, dir);\n const onPress = () => onItemPress(item);\n\n if (renderItem && item.type !== 'ellipsis') {\n return (\n <View key={key}>\n {renderItem({\n type: item.type,\n ...(item.page !== undefined ? { page: item.page } : {}),\n selected: item.selected ?? false,\n disabled: item.disabled ?? false,\n ariaLabel,\n ...(ariaCurrent ? { ariaCurrent } : {}),\n children: display,\n onPress,\n })}\n </View>\n );\n }\n\n return (\n <ItemButton\n key={key}\n type={item.type}\n {...(item.page !== undefined ? { page: item.page } : {})}\n selected={item.selected ?? false}\n disabled={item.disabled ?? false}\n ariaLabel={ariaLabel}\n {...(ariaCurrent ? { ariaCurrent } : {})}\n label={display}\n onPress={onPress}\n />\n );\n });\n\n return <>{elements}</>;\n};\n\nfunction ariaLabelFor(item: PaginationItemDescriptor, labels: PaginationContextValue['labels']): string {\n switch (item.type) {\n case 'first':\n return labels.first;\n case 'prev':\n return labels.prev;\n case 'next':\n return labels.next;\n case 'last':\n return labels.last;\n case 'ellipsis':\n return labels.ellipsis;\n case 'page':\n return item.selected ? labels.currentPage : labels.gotoPage(item.page ?? 0);\n }\n}\n\nfunction displayLabelFor(\n item: PaginationItemDescriptor,\n labels: PaginationContextValue['labels'],\n dir: 'ltr' | 'rtl'\n): ReactNode {\n const flip = dir === 'rtl';\n switch (item.type) {\n case 'first':\n return flip ? '»' : '«';\n case 'last':\n return flip ? '«' : '»';\n case 'prev':\n return flip ? '›' : '‹';\n case 'next':\n return flip ? '‹' : '›';\n case 'ellipsis':\n return '…';\n case 'page':\n return String(item.page ?? '');\n }\n}\n\n// =============================================================================\n// Compact variant\n// =============================================================================\n\nconst CompactView = ({\n onPrev,\n onNext,\n canPrev,\n canNext,\n pageLabel,\n}: {\n onPrev: () => void;\n onNext: () => void;\n canPrev: boolean;\n canNext: boolean;\n pageLabel: string;\n}) => {\n const colors = useThemeColors();\n const { labels, dir } = usePaginationContext('Pagination(compact)');\n const flip = dir === 'rtl';\n\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: px(colors.spacing['1']),\n flexGrow: 1,\n }}\n >\n <ItemButton\n type=\"prev\"\n selected={false}\n disabled={!canPrev}\n ariaLabel={labels.prev}\n label={flip ? '›' : '‹'}\n onPress={onPrev}\n />\n <View\n style={{\n flexGrow: 1,\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: px(colors.spacing['3']),\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.default,\n fontWeight: colors.fontWeight.medium as '500',\n fontVariant: ['tabular-nums'],\n }}\n >\n {pageLabel}\n </RNText>\n </View>\n <ItemButton\n type=\"next\"\n selected={false}\n disabled={!canNext}\n ariaLabel={labels.next}\n label={flip ? '‹' : '›'}\n onPress={onNext}\n />\n </View>\n );\n};\n\n// =============================================================================\n// Root (the `<Pagination>` symbol — also serves as the shorthand)\n// =============================================================================\n\nconst ANNOUNCE_DEBOUNCE_MS = 150;\n\nconst PaginationRoot = (props: PaginationProps) => {\n const {\n page: controlledPage,\n defaultPage = 1,\n pageCount,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstLast = false,\n hideOnSinglePage = true,\n variant = 'auto',\n showRange = false,\n itemCount,\n pageSize: pageSizeProp,\n onPageChange,\n renderItem,\n dir = 'ltr',\n previousLabel,\n nextLabel,\n firstLabel,\n lastLabel,\n ariaLabel,\n className,\n testID,\n children,\n } = props;\n\n const { t } = useTranslation();\n const colors = useThemeColors();\n const { width } = useWindowDimensions();\n\n const [internalPageSize, setInternalPageSize] = useState<number | undefined>(pageSizeProp);\n useEffect(() => {\n setInternalPageSize(pageSizeProp);\n }, [pageSizeProp]);\n const effectivePageSize = pageSizeProp ?? internalPageSize;\n\n const labels = useMemo<PaginationContextValue['labels']>(\n () => ({\n prev: previousLabel ?? t('pagination.previous', { defaultValue: 'Previous page' }),\n next: nextLabel ?? t('pagination.next', { defaultValue: 'Next page' }),\n first: firstLabel ?? t('pagination.first', { defaultValue: 'First page' }),\n last: lastLabel ?? t('pagination.last', { defaultValue: 'Last page' }),\n ellipsis: t('pagination.ellipsis', { defaultValue: 'More pages' }),\n currentPage: t('pagination.currentPage', { defaultValue: 'Current page' }),\n gotoPage: (n) => t('pagination.gotoPage', { page: n, defaultValue: `Go to page ${n}` }),\n rangeFmt: (from, to, total) =>\n t('pagination.range', {\n from,\n to,\n total,\n defaultValue: `Showing ${from}–${to} of ${total}`,\n }),\n pageOfFmt: (p, total) => t('pagination.pageOf', { page: p, total, defaultValue: `Page ${p} of ${total}` }),\n pageSize: t('pagination.pageSizeLabel', { defaultValue: 'Items per page' }),\n jumperLabel: t('pagination.jumperLabel', { defaultValue: 'Go to page' }),\n jumperPlaceholder: t('pagination.jumperPlaceholder', { defaultValue: '#' }),\n }),\n [t, previousLabel, nextLabel, firstLabel, lastLabel]\n );\n\n // Live-region message — debounced so rapid clicks don't spam SR.\n const [announcement, setAnnouncement] = useState('');\n const announceTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => {\n return () => {\n if (announceTimer.current) {\n clearTimeout(announceTimer.current);\n }\n };\n }, []);\n\n const handlePageChange = useCallback(\n (next: number) => {\n onPageChange?.(next, effectivePageSize !== undefined ? { pageSize: effectivePageSize } : undefined);\n if (announceTimer.current) {\n clearTimeout(announceTimer.current);\n }\n announceTimer.current = setTimeout(() => {\n setAnnouncement(labels.pageOfFmt(next, Math.max(1, pageCount)));\n }, ANNOUNCE_DEBOUNCE_MS);\n },\n [onPageChange, effectivePageSize, labels, pageCount]\n );\n\n const setPageSize = useCallback(\n (next: number) => {\n if (pageSizeProp === undefined) {\n setInternalPageSize(next);\n }\n onPageChange?.(1, { pageSize: next });\n },\n [onPageChange, pageSizeProp]\n );\n\n const pagination = usePagination({\n ...(controlledPage !== undefined ? { page: controlledPage } : {}),\n defaultPage,\n pageCount,\n siblingCount,\n boundaryCount,\n showFirstLast,\n onPageChange: handlePageChange,\n });\n\n if (hideOnSinglePage && Math.max(1, pageCount) <= 1) {\n return null;\n }\n\n const ctxValue: PaginationContextValue = {\n page: pagination.page,\n pageCount: Math.max(1, pageCount),\n pageSize: effectivePageSize,\n itemCount,\n siblingCount,\n boundaryCount,\n showFirstLast,\n dir,\n labels,\n ...(renderItem ? { renderItem } : {}),\n goToPage: pagination.goToPage,\n setPageSize,\n };\n\n // Compound mode — caller supplies the layout. We still wrap children in\n // a flex-row that wraps on overflow so a long compound chain\n // (Items + Range + PageSize + Jumper) doesn't blow off the right edge\n // of a phone-width container.\n if (children !== undefined) {\n return (\n <PaginationContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"navigation\"\n aria-label={ariaLabel ?? t('pagination.ariaLabel', { defaultValue: 'Pagination' })}\n accessibilityLabel={ariaLabel ?? t('pagination.ariaLabel', { defaultValue: 'Pagination' })}\n accessible\n className={cn('flex-row items-center flex-wrap', className)}\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n flexWrap: 'wrap',\n rowGap: px(colors.spacing['2']),\n columnGap: px(colors.spacing['1']),\n direction: dir as ViewStyle['direction'],\n }}\n >\n {children}\n </View>\n <LiveRegion message={announcement} />\n </PaginationContext.Provider>\n );\n }\n\n // Shorthand mode — pick variant + render the items row.\n const isCompact =\n variant === 'compact' || (variant === 'auto' && width > 0 && width < PAGINATION_COMPACT_BREAKPOINT);\n\n const onItemPress = (item: PaginationItemDescriptor) => {\n if (item.disabled) {\n return;\n }\n switch (item.type) {\n case 'first':\n pagination.first();\n return;\n case 'prev':\n pagination.prev();\n return;\n case 'next':\n pagination.next();\n return;\n case 'last':\n pagination.last();\n return;\n case 'page':\n if (item.page !== undefined) {\n pagination.goToPage(item.page);\n }\n return;\n case 'ellipsis':\n return;\n }\n };\n\n const showRangeBlock = showRange && itemCount !== undefined && effectivePageSize !== undefined;\n\n return (\n <PaginationContext.Provider value={ctxValue}>\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"navigation\"\n aria-label={ariaLabel ?? t('pagination.ariaLabel', { defaultValue: 'Pagination' })}\n accessibilityLabel={ariaLabel ?? t('pagination.ariaLabel', { defaultValue: 'Pagination' })}\n accessible\n className={cn(isCompact ? 'flex-col items-stretch' : 'flex-row items-center flex-wrap', className)}\n style={{\n // Compact mode lays out as a column so the Range/PageSize\n // block falls below the controls instead of overflowing\n // a phone-width row. Numbered mode wraps on overflow.\n flexDirection: isCompact ? 'column' : 'row',\n alignItems: isCompact ? 'stretch' : 'center',\n flexWrap: isCompact ? 'nowrap' : 'wrap',\n rowGap: px(colors.spacing['2']),\n columnGap: px(colors.spacing['1']),\n direction: dir as ViewStyle['direction'],\n }}\n >\n {isCompact ? (\n <CompactView\n onPrev={pagination.prev}\n onNext={pagination.next}\n canPrev={pagination.canPrev}\n canNext={pagination.canNext}\n pageLabel={labels.pageOfFmt(pagination.page, Math.max(1, pageCount))}\n />\n ) : (\n <ItemsRenderer items={pagination.pages} onItemPress={onItemPress} />\n )}\n {showRangeBlock ? <PaginationRange /> : null}\n </View>\n <LiveRegion message={announcement} />\n </PaginationContext.Provider>\n );\n};\n\n// =============================================================================\n// Compound parts\n// =============================================================================\n\ntype CompoundButtonProps = {\n asChild?: boolean;\n children?: ReactNode;\n testID?: string;\n};\n\nconst CompoundActionButton = ({\n actionType,\n asChild,\n children,\n testID,\n}: CompoundButtonProps & { actionType: 'prev' | 'next' | 'first' | 'last' }) => {\n const ctx = usePaginationContext(`Pagination.${actionType[0]!.toUpperCase() + actionType.slice(1)}`);\n const disabled = actionType === 'prev' || actionType === 'first' ? ctx.page <= 1 : ctx.page >= ctx.pageCount;\n const onPress = () => {\n if (disabled) {\n return;\n }\n switch (actionType) {\n case 'first':\n ctx.goToPage(1);\n return;\n case 'prev':\n ctx.goToPage(ctx.page - 1);\n return;\n case 'next':\n ctx.goToPage(ctx.page + 1);\n return;\n case 'last':\n ctx.goToPage(ctx.pageCount);\n return;\n }\n };\n const ariaLabel =\n actionType === 'prev'\n ? ctx.labels.prev\n : actionType === 'next'\n ? ctx.labels.next\n : actionType === 'first'\n ? ctx.labels.first\n : ctx.labels.last;\n\n if (asChild) {\n return (\n <Slot\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n onPress={onPress}\n onClick={onPress as unknown as ComponentProps<'button'>['onClick']}\n >\n {children}\n </Slot>\n );\n }\n const fallbackGlyph =\n actionType === 'prev' ? '‹' : actionType === 'next' ? '›' : actionType === 'first' ? '«' : '»';\n return (\n <ItemButton\n type={actionType}\n selected={false}\n disabled={disabled}\n ariaLabel={ariaLabel}\n label={children ?? fallbackGlyph}\n onPress={onPress}\n {...(testID !== undefined ? { testID } : {})}\n />\n );\n};\n\nconst PaginationPrev: FC<CompoundButtonProps> = ({ asChild, children, testID }) =>\n CompoundActionButton({\n actionType: 'prev',\n ...(asChild !== undefined ? { asChild } : {}),\n ...(children !== undefined ? { children } : {}),\n ...(testID !== undefined ? { testID } : {}),\n });\nconst PaginationNext: FC<CompoundButtonProps> = ({ asChild, children, testID }) =>\n CompoundActionButton({\n actionType: 'next',\n ...(asChild !== undefined ? { asChild } : {}),\n ...(children !== undefined ? { children } : {}),\n ...(testID !== undefined ? { testID } : {}),\n });\nconst PaginationFirst: FC<CompoundButtonProps> = ({ asChild, children, testID }) =>\n CompoundActionButton({\n actionType: 'first',\n ...(asChild !== undefined ? { asChild } : {}),\n ...(children !== undefined ? { children } : {}),\n ...(testID !== undefined ? { testID } : {}),\n });\nconst PaginationLast: FC<CompoundButtonProps> = ({ asChild, children, testID }) =>\n CompoundActionButton({\n actionType: 'last',\n ...(asChild !== undefined ? { asChild } : {}),\n ...(children !== undefined ? { children } : {}),\n ...(testID !== undefined ? { testID } : {}),\n });\n\nconst PaginationItem: FC<{ page: number; asChild?: boolean; children?: ReactNode; testID?: string }> = ({\n page,\n asChild,\n children,\n testID,\n}) => {\n const ctx = usePaginationContext('Pagination.Item');\n const selected = page === ctx.page;\n const onPress = () => ctx.goToPage(page);\n const ariaLabel = selected ? ctx.labels.currentPage : ctx.labels.gotoPage(page);\n\n if (asChild) {\n return (\n <Slot\n aria-label={ariaLabel}\n {...(selected ? { 'aria-current': 'page' as const } : {})}\n onPress={onPress}\n onClick={onPress as unknown as ComponentProps<'button'>['onClick']}\n >\n {children}\n </Slot>\n );\n }\n return (\n <ItemButton\n type=\"page\"\n page={page}\n selected={selected}\n disabled={false}\n ariaLabel={ariaLabel}\n {...(selected ? { ariaCurrent: 'page' as const } : {})}\n label={children ?? String(page)}\n onPress={onPress}\n {...(testID !== undefined ? { testID } : {})}\n />\n );\n};\n\nconst PaginationItems: FC<{ children?: ReactNode }> = ({ children }) => {\n const ctx = usePaginationContext('Pagination.Items');\n // Always run the hook so React's call order is stable across renders;\n // the result is discarded when explicit `children` were supplied.\n const result = usePagination({\n page: ctx.page,\n pageCount: ctx.pageCount,\n siblingCount: ctx.siblingCount,\n boundaryCount: ctx.boundaryCount,\n showFirstLast: false,\n showPrevNext: false,\n });\n if (children !== undefined) {\n return <>{children}</>;\n }\n return (\n <ItemsRenderer\n items={result.pages}\n onItemPress={(item) => {\n if (item.type === 'page' && item.page !== undefined) {\n ctx.goToPage(item.page);\n }\n }}\n />\n );\n};\n\nconst PaginationEllipsis: FC<{ children?: ReactNode }> = ({ children }) => {\n const ctx = usePaginationContext('Pagination.Ellipsis');\n return (\n <ItemButton\n type=\"ellipsis\"\n selected={false}\n disabled\n label={children ?? '…'}\n ariaLabel={ctx.labels.ellipsis}\n onPress={() => {}}\n />\n );\n};\n\nconst PaginationRange: FC = () => {\n const ctx = usePaginationContext('Pagination.Range');\n const colors = useThemeColors();\n if (ctx.itemCount === undefined || ctx.pageSize === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('<Pagination.Range> requires both `itemCount` and `pageSize` on <Pagination>.');\n }\n return null;\n }\n const from = (ctx.page - 1) * ctx.pageSize + 1;\n const to = Math.min(ctx.itemCount, ctx.page * ctx.pageSize);\n const message = ctx.labels.rangeFmt(from, to, ctx.itemCount);\n return (\n <RNText\n role=\"status\"\n aria-live=\"polite\"\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n fontVariant: ['tabular-nums'],\n paddingHorizontal: px(colors.spacing['2']),\n // Sits on the same baseline as the 32px buttons.\n lineHeight: px(colors.spacing['8']),\n }}\n >\n {message}\n </RNText>\n );\n};\n\nconst PaginationPageSize: FC<{ options: ReadonlyArray<number>; testID?: string }> = ({ options, testID }) => {\n const ctx = usePaginationContext('Pagination.PageSize');\n const colors = useThemeColors();\n const value = ctx.pageSize !== undefined ? String(ctx.pageSize) : '';\n const selectOptions = useMemo<SelectOption[]>(\n () => options.map((n) => ({ value: String(n), label: String(n) })),\n [options]\n );\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: px(colors.spacing['2']),\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {ctx.labels.pageSize}\n </RNText>\n <Select\n {...(testID !== undefined ? { testID } : {})}\n aria-label={ctx.labels.pageSize}\n options={selectOptions}\n value={value}\n onChange={(v) => {\n const n = Number(v);\n if (Number.isFinite(n) && n > 0) {\n ctx.setPageSize(n);\n }\n }}\n />\n </View>\n );\n};\n\ntype PaginationJumperProps = {\n /** Show a separate visible \"Go to page\" label before the input. The aria-label is always set regardless. @defaultValue false */\n showLabel?: boolean;\n /** Override the visible label / accessible name. */\n label?: string;\n /** Override the input placeholder. @defaultValue the localized \"Go to\" hint */\n placeholder?: string;\n /** Width of the input in px. @defaultValue 56 */\n inputWidth?: number;\n testID?: string;\n};\n\n/**\n * Compact, purpose-built jumper. Built directly from RN's `TextInput`\n * primitive so we can render the exact 32px-tall borderless-then-focused\n * treatment that fits in a pagination row, instead of inheriting the full\n * form-field chrome (label, helper text, error slot) of `<TextInput>`.\n */\nconst PaginationJumper: FC<PaginationJumperProps> = ({\n showLabel = false,\n label,\n placeholder,\n inputWidth = 56,\n testID,\n}) => {\n const ctx = usePaginationContext('Pagination.Jumper');\n const colors = useThemeColors();\n const [draft, setDraft] = useState('');\n const [focused, setFocused] = useState(false);\n const [hovered, setHovered] = useState(false);\n const visibleLabel = label ?? ctx.labels.jumperLabel;\n const placeholderText = placeholder ?? ctx.labels.jumperPlaceholder;\n\n const submit = () => {\n const trimmed = draft.trim();\n if (trimmed === '') {\n return;\n }\n const n = Number(trimmed);\n if (!Number.isFinite(n) || n < 1) {\n setDraft('');\n return;\n }\n const clamped = Math.min(Math.max(1, Math.floor(n)), ctx.pageCount);\n ctx.goToPage(clamped);\n setDraft('');\n };\n\n const borderColor = focused\n ? colors.semantic.interactive.primary\n : hovered\n ? colors.semantic.border.strong\n : colors.semantic.border.default;\n\n return (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n gap: px(colors.spacing['2']),\n }}\n >\n {showLabel ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {visibleLabel}\n </RNText>\n ) : null}\n <View\n // The wrapper carries the visual chrome so the bare TextInput\n // can stay completely unstyled — it's just text + caret.\n onPointerEnter={Platform.OS === 'web' ? () => setHovered(true) : undefined}\n onPointerLeave={Platform.OS === 'web' ? () => setHovered(false) : undefined}\n style={\n {\n width: inputWidth,\n height: px(colors.spacing['8']),\n borderWidth: 1,\n borderColor,\n borderRadius: px(colors.radius.md),\n backgroundColor: colors.semantic.background.elevated,\n paddingHorizontal: px(colors.spacing['2']),\n justifyContent: 'center',\n // Web-only properties (silently dropped on native).\n ...(focused\n ? {\n boxShadow: `0 0 0 3px ${withAlpha(colors.semantic.interactive.primary, 0.15)}`,\n }\n : null),\n transitionProperty: 'border-color, box-shadow',\n transitionDuration: '120ms',\n transitionTimingFunction: 'cubic-bezier(0.2, 0, 0, 1)',\n } as unknown as ViewStyle\n }\n >\n <RNTextInput\n {...(testID !== undefined ? { testID } : {})}\n value={draft}\n onChangeText={setDraft}\n onSubmitEditing={submit}\n onBlur={() => {\n setFocused(false);\n submit();\n }}\n onFocus={() => setFocused(true)}\n keyboardType=\"number-pad\"\n inputMode=\"numeric\"\n placeholder={placeholderText}\n placeholderTextColor={colors.semantic.text.muted}\n aria-label={visibleLabel}\n accessibilityLabel={visibleLabel}\n returnKeyType=\"go\"\n selectTextOnFocus\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.default,\n fontVariant: ['tabular-nums'],\n textAlign: 'center',\n // Strip the browser's default outline — we draw our own\n // focus ring on the wrapper.\n ...(Platform.OS === 'web' ? ({ outline: 'none' } as object) : null),\n }}\n />\n </View>\n </View>\n );\n};\n\n/**\n * Apply an alpha channel to any of our token color strings (hex / rgb / hsl).\n * Cheap, zero-dep helper just for the focus glow.\n */\nfunction withAlpha(color: string, alpha: number): string {\n if (color.startsWith('#') && (color.length === 7 || color.length === 4)) {\n const expanded =\n color.length === 4 ? `#${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}` : color;\n const r = Number.parseInt(expanded.slice(1, 3), 16);\n const g = Number.parseInt(expanded.slice(3, 5), 16);\n const b = Number.parseInt(expanded.slice(5, 7), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n }\n return color;\n}\n\nexport type { PaginationJumperProps };\n\n// =============================================================================\n// Public symbol — Pagination + compound parts\n// =============================================================================\n\nexport const Pagination = Object.assign(PaginationRoot, {\n Items: PaginationItems,\n Item: PaginationItem,\n Prev: PaginationPrev,\n Next: PaginationNext,\n First: PaginationFirst,\n Last: PaginationLast,\n Ellipsis: PaginationEllipsis,\n Range: PaginationRange,\n PageSize: PaginationPageSize,\n Jumper: PaginationJumper,\n});\n\n// Suppress unused — ReactElement / KeyboardEvent are reserved for future kbd-nav extension.\ntype _Unused = ReactElement | KeyboardEvent;\n","'use client';\n\nimport { useEffect, useRef } from 'react';\nimport { Animated, Easing, Text as RNText, View, type ViewStyle } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type ProgressTone = 'primary' | 'info' | 'success' | 'warning' | 'danger';\nexport type ProgressSize = 'sm' | 'md' | 'lg';\n\nexport type ProgressProps = {\n /**\n * Current progress value (`0..max`). Omit to render the indeterminate\n * marquee variant (use this when you don't know how long the work\n * will take, e.g. an initial load before headers come back).\n */\n value?: number;\n /** Upper bound for `value`. @defaultValue 100 */\n max?: number;\n /**\n * Color of the fill / shuttle. `primary` follows the theme's interactive\n * color (matches buttons + sliders); the rest map to semantic status colors.\n * @defaultValue 'primary'\n */\n tone?: ProgressTone;\n /**\n * Bar height — `sm` 4px, `md` 8px (default), `lg` 12px. The track is\n * always pill-shaped (border-radius = height/2).\n * @defaultValue 'md'\n */\n size?: ProgressSize;\n /**\n * Optional label rendered above the bar. When set, also enables a\n * percentage readout on the right side for determinate progress.\n */\n label?: string;\n /**\n * Hide the auto-rendered percentage when a `label` is provided. Useful\n * when the label itself already conveys the number (e.g. \"Step 3 of 5\").\n * @defaultValue false\n */\n hidePercentage?: boolean;\n /** Accessibility label when no visible `label` is provided. */\n 'aria-label'?: string;\n /** Reference to a labeling element by id. */\n 'aria-labelledby'?: string;\n className?: string;\n testID?: string;\n};\n\nconst SIZE_PX: Record<ProgressSize, number> = {\n sm: 4,\n md: 8,\n lg: 12,\n};\n\nconst INDETERMINATE_DURATION_MS = 1500;\nconst SHUTTLE_WIDTH_PCT = 30;\n\n/**\n * Linear progress indicator. Use the determinate form (`value` set) to\n * communicate \"we're 42% done\"; use the indeterminate form (`value`\n * omitted) for \"we're working, no ETA\". The track is always pill-shaped\n * and the fill animates smoothly between renders for the determinate\n * variant — keep updates throttled to ~10/s in the parent to avoid\n * jitter.\n *\n * Cross-platform: built on `View` + `Animated.View` so it renders\n * identically on web (rn-web) and native. Uses `useThemeColors()` to\n * pick up dark-mode flips automatically.\n *\n * Accessibility: maps to `role=\"progressbar\"` with `aria-valuemin`,\n * `aria-valuemax`, and (for determinate) `aria-valuenow`. Provide an\n * `aria-label`, `aria-labelledby`, or visible `label` so the bar is\n * named.\n */\nexport const Progress = ({\n value,\n max = 100,\n tone = 'primary',\n size = 'md',\n label,\n hidePercentage = false,\n className,\n testID,\n ...rest\n}: ProgressProps) => {\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n\n const isIndeterminate = value === undefined;\n const safeMax = max <= 0 ? 100 : max;\n const clamped = isIndeterminate ? 0 : Math.min(safeMax, Math.max(0, value));\n const pct = isIndeterminate ? 0 : (clamped / safeMax) * 100;\n\n const height = SIZE_PX[size];\n\n const fillColor =\n tone === 'primary'\n ? colors.semantic.interactive.primary\n : tone === 'success'\n ? colors.color.success\n : tone === 'warning'\n ? colors.color.warning\n : tone === 'danger'\n ? colors.color.danger\n : colors.color.info;\n\n // Indeterminate marquee — a 30%-wide shuttle that slides from -30% to\n // 100% on a continuous loop. Driven by `Animated.Value` (0..1) which we\n // interpolate to a percent string for `left`. ease-in-out keeps the\n // motion subtle so the bar never feels frantic.\n const shuttle = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n if (!isIndeterminate) {\n return;\n }\n const loop = Animated.loop(\n Animated.timing(shuttle, {\n toValue: 1,\n duration: INDETERMINATE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n // We animate `left` (a layout property), so the native driver\n // can't be used. Web (rn-web) ignores `useNativeDriver`.\n useNativeDriver: false,\n })\n );\n loop.start();\n return () => {\n loop.stop();\n };\n }, [isIndeterminate, shuttle]);\n\n const trackStyle: ViewStyle = {\n width: '100%',\n height,\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: height / 2,\n overflow: 'hidden',\n position: 'relative',\n };\n\n const determinateFillStyle: ViewStyle = {\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n // Cast at the boundary — RN's typed DimensionValue is narrower than\n // the percentage strings rn-web actually accepts.\n width: `${pct}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n\n // Build the indeterminate style only when needed — `Animated.Value.interpolate`\n // returns an animated node that RN reads at render; we keep the call inside\n // the branch so determinate renders never hit it (and so test envs that\n // stub `Animated.Value` don't choke on a missing `interpolate`).\n const buildIndeterminateStyle = () => {\n const left =\n typeof shuttle.interpolate === 'function'\n ? shuttle.interpolate({\n inputRange: [0, 1],\n outputRange: [`-${SHUTTLE_WIDTH_PCT}%`, '100%'],\n })\n : (`-${SHUTTLE_WIDTH_PCT}%` as unknown as number);\n return {\n position: 'absolute' as const,\n top: 0,\n bottom: 0,\n left: left as unknown as number,\n width: `${SHUTTLE_WIDTH_PCT}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n };\n\n // ARIA: only emit aria-valuenow when determinate so AT announces\n // \"in progress\" rather than \"0%\" while indeterminate.\n const ariaProps: Record<string, unknown> = {\n role: 'progressbar',\n accessibilityRole: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n };\n if (!isIndeterminate) {\n ariaProps['aria-valuenow'] = clamped;\n ariaProps.accessibilityValue = { min: 0, max: safeMax, now: clamped };\n }\n if (ariaLabel !== undefined) {\n ariaProps['aria-label'] = ariaLabel;\n ariaProps.accessibilityLabel = ariaLabel;\n } else if (label !== undefined) {\n ariaProps['aria-label'] = label;\n ariaProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n ariaProps['aria-labelledby'] = ariaLabelledBy;\n }\n\n const showHeader = label !== undefined;\n const showPercentage = showHeader && !hidePercentage && !isIndeterminate;\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('w-full', className)}\n style={{ width: '100%' }}\n >\n {showHeader ? (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: px(colors.spacing['2']) - 2, // closest to legacy 6\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {label}\n </RNText>\n {showPercentage ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n // Tabular numerals keep the percentage from\n // jittering as digits change width.\n fontVariant: ['tabular-nums'],\n }}\n >\n {Math.round(pct)}%\n </RNText>\n ) : null}\n </View>\n ) : null}\n <View {...ariaProps} style={trackStyle}>\n {isIndeterminate ? (\n <Animated.View style={buildIndeterminateStyle()} />\n ) : (\n <View style={determinateFillStyle} />\n )}\n </View>\n </View>\n );\n};\n","'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type RadioGroupOrientation = 'horizontal' | 'vertical';\n\ntype RadioRefMap = Map<string, RefObject<HTMLElement | null>>;\n\ntype RadioGroupContextValue = {\n value: string | undefined;\n select: (next: string) => void;\n disabled: boolean;\n orientation: RadioGroupOrientation;\n name: string | undefined;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n};\n\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\n\nconst useRadioGroupContext = (): RadioGroupContextValue => {\n const ctx = useContext(RadioGroupContext);\n if (!ctx) {\n throw new Error('<Radio> must be rendered inside a <Radio.Group>.');\n }\n return ctx;\n};\n\nexport type RadioGroupProps = {\n /** Controlled selected value. */\n value?: string;\n /** Uncontrolled initial value. */\n defaultValue?: string;\n /** Fires with the new value when the selection changes. */\n onChange?: (next: string) => void;\n /** When true, every Radio inside is non-interactive. Individual Radios can also opt in. */\n disabled?: boolean;\n /**\n * Layout orientation. Drives the keyboard nav axis (Down/Up for vertical,\n * Right/Left for horizontal — both pairs work in either orientation as a\n * usability bonus).\n * @defaultValue 'vertical'\n */\n orientation?: RadioGroupOrientation;\n /** HTML `name` for form integration on web. Optional but recommended. */\n name?: string;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\nexport type RadioProps = {\n /** Unique value within the group. Required. */\n value: string;\n /** Visible label that doubles as the accessibility label. */\n label?: string;\n /** Disable just this option. */\n disabled?: boolean;\n /** Custom content rendered next to the radio dot. Overrides `label`. */\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n// Layout-only base; theme-driven gap is merged inside Radio. The dot\n// dimensions are component-density literals — not from theme — because the\n// radio dot has a fixed visual ramp independent of the spacing scale.\nconst ROW_LAYOUT_BASE: ViewStyle = { flexDirection: 'row', alignItems: 'center' };\nconst DOT_OUTER_BASE: ViewStyle = {\n width: 18, // component-density literal — not from theme\n height: 18, // component-density literal — not from theme\n borderRadius: 9, // perfect circle of dot diameter — not from theme\n borderWidth: 1.5,\n alignItems: 'center',\n justifyContent: 'center',\n};\nconst DOT_INNER_BASE: ViewStyle = {\n width: 8, // component-density literal — not from theme\n height: 8, // component-density literal — not from theme\n borderRadius: 4, // perfect circle — not from theme\n};\n\n/**\n * Single-selection group of radio buttons. Container owns the value;\n * children declare their `value` and any extra disabled state.\n *\n * Keyboard nav follows the WAI-ARIA radiogroup pattern:\n * - Tab into the group → focus lands on the selected option (or the\n * first when nothing is selected). Tab out leaves the group.\n * - ArrowDown / ArrowRight → next option (wraps).\n * - ArrowUp / ArrowLeft → previous option (wraps).\n * - Home / End → first / last.\n * - Selection follows focus, so an arrow key both moves focus and\n * activates the option (the standard radiogroup behavior).\n */\nexport const RadioGroup = ({\n value,\n defaultValue,\n onChange,\n disabled = false,\n orientation = 'vertical',\n name,\n children,\n className,\n testID,\n}: RadioGroupProps) => {\n const [inner, setInner] = useState<string | undefined>(defaultValue);\n const isControlled = value !== undefined;\n const current = isControlled ? value : inner;\n\n const refs = useRef<RadioRefMap>(new Map());\n const orderRef = useRef<string[]>([]);\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const select = useCallback(\n (next: string) => {\n if (disabled) {\n return;\n }\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n },\n [disabled, isControlled, onChange]\n );\n\n const focusValue = useCallback((next: string) => {\n const ref = refs.current.get(next);\n ref?.current?.focus?.();\n }, []);\n\n const moveBy = useCallback(\n (offset: 1 | -1) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = current ? order.indexOf(current) : -1;\n const start = idx === -1 ? (offset === 1 ? -1 : 0) : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (!next) {\n return;\n }\n select(next);\n focusValue(next);\n },\n [current, focusValue, select]\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight': {\n event.preventDefault();\n moveBy(1);\n return;\n }\n case 'ArrowUp':\n case 'ArrowLeft': {\n event.preventDefault();\n moveBy(-1);\n return;\n }\n case 'Home': {\n event.preventDefault();\n const first = order[0];\n if (first) {\n select(first);\n focusValue(first);\n }\n return;\n }\n case 'End': {\n event.preventDefault();\n const last = order[order.length - 1];\n if (last) {\n select(last);\n focusValue(last);\n }\n return;\n }\n }\n },\n [focusValue, moveBy, select]\n );\n\n const ctxValue = useMemo<RadioGroupContextValue>(\n () => ({ value: current, select, disabled, orientation, name, register, unregister }),\n [current, select, disabled, orientation, name, register, unregister]\n );\n\n // RN's View doesn't model onKeyDown in its TS surface but RN-Web passes\n // it through to the underlying div. Cast at the spread boundary.\n const groupProps: Record<string, unknown> = {\n role: 'radiogroup',\n accessibilityRole: 'radiogroup',\n 'aria-orientation': orientation,\n 'aria-disabled': disabled || undefined,\n onKeyDown: handleKeyDown,\n ...(testID !== undefined ? { testID } : {}),\n };\n\n return (\n <RadioGroupContext.Provider value={ctxValue}>\n <RadioGroupViewport\n groupProps={groupProps}\n orientation={orientation}\n disabled={disabled}\n {...(className !== undefined ? { className } : {})}\n >\n {children}\n </RadioGroupViewport>\n </RadioGroupContext.Provider>\n );\n};\n\n// Inner view so we can call useThemeColors() to source the orientation\n// gap from the spacing token scale (the parent owns hooks for state).\nconst RadioGroupViewport = ({\n groupProps,\n orientation,\n disabled,\n className,\n children,\n}: {\n groupProps: Record<string, unknown>;\n orientation: RadioGroupOrientation;\n disabled: boolean;\n className?: string;\n children?: ReactNode;\n}) => {\n const colors = useThemeColors();\n return (\n <View\n {...groupProps}\n className={cn(\n orientation === 'horizontal' ? 'flex-row gap-4' : 'flex-col gap-3',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={[\n orientation === 'horizontal'\n ? { flexDirection: 'row', gap: px(colors.spacing['4']) }\n : { flexDirection: 'column', gap: px(colors.spacing['3']) },\n disabled ? { opacity: 0.6 } : null,\n ]}\n >\n {children}\n </View>\n );\n};\n\n/**\n * One option inside a `<Radio.Group>`. Must be rendered inside one — throws\n * with a clear message if not.\n */\nconst RadioOption = ({ value, label, disabled, children, className, testID }: RadioProps) => {\n const ctx = useRadioGroupContext();\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const selected = ctx.value === value;\n const isDisabled = disabled || ctx.disabled;\n\n useEffect(() => {\n ctx.register(value, ownRef);\n return () => ctx.unregister(value);\n }, [ctx, value]);\n\n const onPress = useCallback(() => {\n if (isDisabled) {\n return;\n }\n ctx.select(value);\n }, [ctx, value, isDisabled]);\n\n // Roving tabindex: only the selected option (or the first when nothing\n // is selected) participates in the tab order.\n const tabIndex = selected || (ctx.value === undefined && isFirstOption(ctx, value)) ? 0 : -1;\n\n const accessibilityLabel = label ?? value;\n\n const radioProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'radio',\n accessibilityRole: 'radio',\n 'aria-checked': selected,\n accessibilityState: { checked: selected, disabled: Boolean(isDisabled) },\n accessibilityLabel,\n 'aria-label': accessibilityLabel,\n tabIndex,\n onPress,\n ...(isDisabled ? { 'aria-disabled': true, disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n ...(ctx.name ? { name: ctx.name } : {}),\n };\n\n const dotOuterStyle: ViewStyle = {\n ...DOT_OUTER_BASE,\n backgroundColor: colors.semantic.background.elevated,\n borderColor: selected ? colors.semantic.interactive.primary : colors.color.neutral['400'],\n };\n const dotInnerStyle: ViewStyle = { ...DOT_INNER_BASE, backgroundColor: colors.semantic.interactive.primary };\n\n const rowStyle: ViewStyle = { ...ROW_LAYOUT_BASE, gap: px(colors.spacing['2']) };\n\n return (\n <Pressable\n {...radioProps}\n className={cn('flex-row items-center gap-2', isDisabled ? 'opacity-60' : undefined, className)}\n style={[rowStyle, isDisabled ? { opacity: 0.6 } : null]}\n >\n <View style={dotOuterStyle}>{selected ? <View style={dotInnerStyle} /> : null}</View>\n {children ??\n (label !== undefined ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n }}\n >\n {label}\n </RNText>\n ) : null)}\n </Pressable>\n );\n};\n\n// Tiny helper: when no value is selected yet, the first registered Radio is\n// the tabbable one. This is computed inside Radio (not the context) so we\n// don't have to re-render every Radio whenever the order changes.\nfunction isFirstOption(ctx: RadioGroupContextValue, value: string): boolean {\n // We only have access to register/unregister; Radio doesn't get a peek\n // at the order list. The simple-but-correct fallback: every Radio renders\n // tabIndex=0 when value is undefined, which is harmless for one-radio\n // groups and equivalent to the standard \"tab into the first\" for\n // multi-radio groups (browsers honor the first tabIndex=0 they hit).\n void ctx;\n void value;\n return true;\n}\n\n/**\n * Public `Radio` value — the per-option component plus its `.Group` static\n * member (the cluster). Use `<Radio.Group>` to wrap a list of `<Radio />`s.\n *\n * `Object.assign` produces a value whose inferred type carries the static\n * properties, so `.d.ts` consumers can write `<Radio.Group>` without a\n * separate import.\n */\nexport const Radio = Object.assign(RadioOption, {\n Group: RadioGroup,\n});\n","'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport { type KeyboardEvent, type ReactNode, useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SegmentedControlSize = 'sm' | 'md';\n\nexport type SegmentedControlOption<T extends string = string> = {\n value: T;\n label: ReactNode;\n /** Disable just this option. */\n disabled?: boolean;\n};\n\nexport type SegmentedControlProps<T extends string = string> = {\n /** Controlled value. */\n value?: T;\n /** Uncontrolled initial value. Required if you don't pass `value`. */\n defaultValue?: T;\n /** Fires when the user selects a different segment. */\n onChange?: (next: T) => void;\n /** The set of selectable segments. */\n options: ReadonlyArray<SegmentedControlOption<T>>;\n /** Group-level disable. */\n disabled?: boolean;\n /**\n * Visual size. `sm` is denser for inline filters; `md` is the default\n * for top-of-view tab switchers.\n * @defaultValue 'md'\n */\n size?: SegmentedControlSize;\n /** Hide the visible labels — when set, segments must have `aria-label`. */\n label?: string;\n className?: string;\n testID?: string;\n};\n\n// Layout-only bases; theme-driven dimensions are merged inside the component.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'stretch',\n};\n\nconst SEGMENT_LAYOUT_BASE: ViewStyle = {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n};\n\n// Token keys per size; resolved to px inside the component so theme\n// overrides take effect.\ntype SegmentSizeKeys = {\n paddingV: keyof Theme['spacing'];\n paddingH: keyof Theme['spacing'];\n font: keyof Theme['fontSize'];\n};\nconst SEGMENT_SIZE_KEYS: Record<SegmentedControlSize, SegmentSizeKeys> = {\n sm: { paddingV: '1', paddingH: '2', font: 'sm' }, // 4 / 8 / 14 — closest to legacy 4/10/13\n md: { paddingV: '2', paddingH: '3', font: 'sm' }, // 8 / 12 / 14 — closest to legacy 6/12/14\n};\n\nconst SEGMENT_SELECTED_BASE: ViewStyle = {\n // Subtle elevation that says \"this one is on\" without overshadowing\n // the unselected segments next to it. Web uses boxShadow (CSS-style);\n // native uses elevation. The legacy RN `shadow*` props were deprecated\n // by react-native-web in favor of `boxShadow`.\n ...({ boxShadow: '0 1px 2px rgba(0, 0, 0, 0.06)' } as ViewStyle),\n elevation: 1,\n};\n\n/**\n * Single-select segmented switcher — the \"beautiful UISegmentedControl\"\n * pattern. Use for binary or small (3–5 option) choices that fit inline\n * with their surrounding content. Reach for `Tabs` when each option owns\n * a distinct content region.\n *\n * Keyboard nav follows the WAI-ARIA radiogroup pattern: arrow keys move\n * between options (selection follows focus), `Home` / `End` jump to first\n * / last, with wrap-around at the edges.\n */\nexport const SegmentedControl = <T extends string>({\n value,\n defaultValue,\n onChange,\n options,\n disabled = false,\n size = 'md',\n label,\n className,\n testID,\n}: SegmentedControlProps<T>) => {\n const colors = useThemeColors();\n const [inner, setInner] = useState<T | undefined>(defaultValue);\n const isControlled = value !== undefined;\n const current = isControlled ? value : inner;\n\n const select = useCallback(\n (next: T) => {\n if (disabled) {\n return;\n }\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n },\n [disabled, isControlled, onChange]\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (options.length === 0) {\n return;\n }\n const idx = options.findIndex((o) => o.value === current);\n const start = idx === -1 ? 0 : idx;\n const offset =\n event.key === 'ArrowRight' || event.key === 'ArrowDown'\n ? 1\n : event.key === 'ArrowLeft' || event.key === 'ArrowUp'\n ? -1\n : 0;\n if (offset === 0 && event.key !== 'Home' && event.key !== 'End') {\n return;\n }\n event.preventDefault();\n let nextIdx: number;\n if (event.key === 'Home') {\n nextIdx = 0;\n } else if (event.key === 'End') {\n nextIdx = options.length - 1;\n } else {\n nextIdx = (start + offset + options.length) % options.length;\n }\n // Skip past disabled options in the chosen direction.\n const direction = offset === 0 ? 1 : offset;\n for (let attempts = 0; attempts < options.length; attempts += 1) {\n const candidate = options[nextIdx];\n if (candidate && !candidate.disabled) {\n select(candidate.value);\n return;\n }\n nextIdx = (nextIdx + direction + options.length) % options.length;\n }\n },\n [current, options, select]\n );\n\n const sizeKeys = SEGMENT_SIZE_KEYS[size];\n const segmentPadV = px(colors.spacing[sizeKeys.paddingV]);\n const segmentPadH = px(colors.spacing[sizeKeys.paddingH]);\n const segmentFontSize = px(colors.fontSize[sizeKeys.font]);\n\n const groupProps: Record<string, unknown> = {\n role: 'radiogroup',\n accessibilityRole: 'radiogroup',\n onKeyDown: handleKeyDown,\n ...(label !== undefined ? { 'aria-label': label, accessibilityLabel: label } : {}),\n ...(disabled ? { 'aria-disabled': true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n const containerStyle: ViewStyle = {\n ...CONTAINER_LAYOUT_BASE,\n borderRadius: px(colors.radius.lg),\n padding: px(colors.spacing['1']),\n gap: px(colors.spacing['1']),\n backgroundColor: colors.semantic.background.subtle,\n };\n const segmentBaseStyle: ViewStyle = {\n ...SEGMENT_LAYOUT_BASE,\n borderRadius: px(colors.radius.md),\n };\n const segmentSelectedStyle: ViewStyle = {\n ...SEGMENT_SELECTED_BASE,\n backgroundColor: colors.semantic.background.elevated,\n };\n\n return (\n <View\n {...groupProps}\n className={cn(\n 'inline-flex flex-row items-stretch rounded-lg bg-neutral-100 dark:bg-neutral-800 p-1 gap-1',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={[containerStyle, disabled ? { opacity: 0.6 } : null]}\n >\n {options.map((option) => {\n const selected = option.value === current;\n const isOptDisabled = disabled || option.disabled;\n return (\n <Pressable\n key={option.value}\n role=\"radio\"\n accessibilityRole=\"radio\"\n aria-checked={selected}\n accessibilityState={{ selected, disabled: Boolean(isOptDisabled) }}\n tabIndex={selected || (current === undefined && options[0]?.value === option.value) ? 0 : -1}\n onPress={() => {\n if (!isOptDisabled) {\n select(option.value);\n }\n }}\n {...(isOptDisabled ? { 'aria-disabled': true, disabled: true } : {})}\n className={cn(\n 'flex-1 items-center justify-center rounded-md',\n selected ? 'bg-semantic-background-elevated shadow-sm' : '',\n isOptDisabled ? 'opacity-50' : ''\n )}\n style={[\n segmentBaseStyle,\n { paddingVertical: segmentPadV, paddingHorizontal: segmentPadH },\n selected ? segmentSelectedStyle : null,\n isOptDisabled ? { opacity: 0.5 } : null,\n ]}\n >\n {typeof option.label === 'string' ? (\n <RNText\n style={{\n color: selected ? colors.semantic.text.default : colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: segmentFontSize,\n fontWeight: selected\n ? (colors.fontWeight.semibold as '600')\n : (colors.fontWeight.medium as '500'),\n }}\n >\n {option.label}\n </RNText>\n ) : (\n option.label\n )}\n </Pressable>\n );\n })}\n </View>\n );\n};\n","'use client';\n\nimport type { ViewProps, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport type SeparatorProps = Omit<ViewProps, 'children'> & {\n /**\n * Visual orientation of the rule.\n * @defaultValue 'horizontal'\n */\n orientation?: SeparatorOrientation;\n /**\n * When true (the default), the separator is purely visual and removed\n * from the accessibility tree. Set to false when the rule is meaningful\n * structure that screen readers should announce.\n * @defaultValue true\n */\n decorative?: boolean;\n className?: string;\n testID?: string;\n};\n\nconst HORIZONTAL_BASE: ViewStyle = { height: 1, width: '100%' };\n// Vertical: a delicate inline rule that sits centered against\n// surrounding text. Two design decisions worth recording:\n//\n// 1. `alignSelf: 'center'` — NOT 'stretch'. Stretch made the rule\n// fill the parent's full row height, which exceeds the visible\n// text glyph height (line-height includes leading padding above\n// and below the glyphs) and made the separator look oversized\n// and asymmetric. Centering it picks up the same visual\n// alignment as the text glyphs.\n//\n// 2. `height: 16` — matches the body fontSize (1em of body text).\n// In an inline row of body-md text (fontSize 16, lineHeight 1.4\n// → 22.4px box), a 16px-tall rule sits perfectly across the\n// visible glyph zone. Slightly shorter than the full row height\n// gives the rule a refined, intentional look rather than a\n// brutal floor-to-ceiling line.\n//\n// Consumers who need a separator that fills a taller parent (e.g.\n// inside a Card with explicit height) can pass `style={{ height,\n// alignSelf: 'stretch' }}` to override.\nconst VERTICAL_BASE: ViewStyle = {\n width: 1,\n height: 16,\n alignSelf: 'center',\n};\n\n/**\n * Visual rule between groups of content. Mirrors Radix's Separator API:\n * `orientation` controls the axis, `decorative` controls whether the rule\n * is announced to screen readers.\n */\nexport const Separator = ({\n orientation = 'horizontal',\n decorative = true,\n className,\n style,\n testID,\n ...rest\n}: SeparatorProps) => {\n const colors = useThemeColors();\n const baseStyle = orientation === 'horizontal' ? HORIZONTAL_BASE : VERTICAL_BASE;\n const a11yProps: Record<string, unknown> = decorative\n ? { role: 'none', accessibilityRole: 'none' as const }\n : {\n role: 'separator',\n accessibilityRole: 'none' as const,\n 'aria-orientation': orientation,\n };\n return (\n <View\n {...rest}\n {...a11yProps}\n {...(testID !== undefined ? { testID } : {})}\n className={cn(orientation === 'horizontal' ? 'h-px w-full' : 'w-px h-full self-stretch', className)}\n style={[baseStyle, { backgroundColor: colors.semantic.border.default }, style]}\n />\n );\n};\n","'use client';\n\nimport { useEffect, useRef } from 'react';\nimport { Animated, Easing, type ViewStyle } from 'react-native';\nimport { useColorScheme } from '../../theme/use-color-scheme';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SkeletonProps = {\n /** Width — number of px or any RN dimension string. Default `100%`. */\n width?: number | `${number}%` | 'auto';\n /** Height — number of px. Default 16. */\n height?: number;\n /**\n * Border radius. Defaults to `theme.radius.md` (6px). Use `'full'`\n * (= 9999px) for circular skeletons (avatars).\n */\n radius?: number | 'full';\n /** Disable the pulse — useful when stacking many skeletons in a list. */\n static?: boolean;\n className?: string;\n style?: ViewStyle;\n testID?: string;\n};\n\nconst PULSE_DURATION_MS = 900;\nconst PULSE_MIN = 0.55;\nconst PULSE_MAX = 1;\n\n/**\n * Subtle loading placeholder. Pulses between full and 55% opacity to signal\n * \"content is loading here, in this shape\" without flashing or distracting.\n *\n * Uses RN `Animated` for the opacity loop — works on web and native with\n * the same code. Respects the `static` prop when you want to skip the\n * animation (e.g. when stacking many skeletons in a long list).\n */\nexport const Skeleton = ({\n width = '100%' as const,\n height = 16,\n radius = 6,\n static: isStatic = false,\n className,\n style,\n testID,\n}: SkeletonProps) => {\n const colors = useThemeColors();\n const isDark = useColorScheme() === 'dark';\n const opacity = useRef(new Animated.Value(PULSE_MAX)).current;\n\n useEffect(() => {\n if (isStatic) {\n return;\n }\n const loop = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, {\n toValue: PULSE_MIN,\n duration: PULSE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: true,\n }),\n Animated.timing(opacity, {\n toValue: PULSE_MAX,\n duration: PULSE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: true,\n }),\n ])\n );\n loop.start();\n return () => {\n loop.stop();\n };\n }, [isStatic, opacity]);\n\n // Skeleton intentionally uses a stronger neutral than the generic\n // semantic.background.subtle. The previous subtle-bg skeleton washed\n // out against the warm-paper page background — barely a hint of a\n // placeholder. A loading state must read as \"something will appear\n // here\", not \"page barely loading.\"\n //\n // On dark we step the other direction (neutral.700 ≈ #3f3f46) so the\n // skeleton is clearly lighter than the page bg (#18181b) without being\n // a glaring grey block.\n const baseStyle: ViewStyle = {\n width,\n height,\n borderRadius: radius === 'full' ? 9999 : radius,\n backgroundColor: isDark ? colors.color.neutral['700'] : colors.color.neutral['200'],\n };\n\n return (\n <Animated.View\n {...(testID !== undefined ? { testID } : {})}\n aria-hidden={true}\n accessibilityElementsHidden\n importantForAccessibility=\"no\"\n className={cn('bg-neutral-200 dark:bg-neutral-700', className)}\n style={[baseStyle, isStatic ? null : { opacity }, style]}\n />\n );\n};\n","'use client';\n\n// Cross-tree gesture coordination for Slider. iOS UIScrollView's native\n// pan recognizer can't be preempted from JS-only responder capture, so\n// the canonical workaround is for the wrapping ScrollView to set\n// `scrollEnabled={false}` while a slider is actively being dragged. This\n// context lets the Slider broadcast \"I'm dragging\" up the tree without\n// the consumer having to wire `onInteractionStart`/`onInteractionEnd`\n// individually for every Slider instance — drop a `<SliderGestureProvider>`\n// above your scroll container and read `useSliderInteractionActive()`\n// inside it to drive `scrollEnabled`.\n\nimport { createContext, type ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\n\ntype Subscriber = (active: boolean) => void;\ntype Bus = {\n /** Mark the start of a drag; returns a release fn that decrements the active count. */\n begin: () => () => void;\n /** Subscribe to active-state transitions. Returns an unsubscribe fn. */\n subscribe: (s: Subscriber) => () => void;\n};\n\nconst Ctx = createContext<Bus | null>(null);\n\nexport function SliderGestureProvider({ children }: { children: ReactNode }) {\n // We track concurrent drags (theoretically multiple sliders, e.g. a\n // range with two thumbs) via a ref so begin/release are O(1) and\n // don't trigger re-renders on the provider itself.\n const activeCount = useRef(0);\n const subs = useRef(new Set<Subscriber>());\n\n const broadcast = useCallback(() => {\n const isActive = activeCount.current > 0;\n for (const s of subs.current) {\n s(isActive);\n }\n }, []);\n\n const bus = useMemo<Bus>(\n () => ({\n begin: () => {\n activeCount.current += 1;\n broadcast();\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n activeCount.current = Math.max(0, activeCount.current - 1);\n broadcast();\n };\n },\n subscribe: (s) => {\n subs.current.add(s);\n return () => {\n subs.current.delete(s);\n };\n },\n }),\n [broadcast]\n );\n\n return <Ctx.Provider value={bus}>{children}</Ctx.Provider>;\n}\n\n/**\n * Read by Slider internally — publishes drag start/end to the provider.\n * Returns { begin, end } stable across renders. No-op if no provider.\n */\nexport function useSliderGesturePublisher(): { begin: () => void; end: () => void } {\n const bus = useContext(Ctx);\n const releaseRef = useRef<null | (() => void)>(null);\n return useMemo(\n () => ({\n begin: () => {\n if (!bus) {\n return;\n }\n if (releaseRef.current) {\n return;\n }\n releaseRef.current = bus.begin();\n },\n end: () => {\n if (!bus) {\n return;\n }\n releaseRef.current?.();\n releaseRef.current = null;\n },\n }),\n [bus]\n );\n}\n\n/**\n * Read by a wrapping container (e.g. a ScrollView) to know whether any\n * descendant Slider is actively being dragged. Returns `false` when no\n * provider is mounted.\n */\nexport function useSliderInteractionActive(): boolean {\n const bus = useContext(Ctx);\n const [active, setActive] = useState(false);\n useEffect(() => {\n if (!bus) {\n return;\n }\n const unsubscribe = bus.subscribe(setActive);\n return unsubscribe;\n }, [bus]);\n return active;\n}\n","'use client';\n\nimport {\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { GestureResponderEvent, ViewStyle } from 'react-native';\nimport { Platform, View } from 'react-native';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport { useSliderGesturePublisher } from './slider-gesture-context';\n\nexport type SliderOrientation = 'horizontal' | 'vertical';\nexport type SliderDirection = 'ltr' | 'rtl';\n\nexport type SliderProps = {\n /** Controlled value(s). For a single-thumb slider pass `[n]`. */\n value?: ReadonlyArray<number>;\n /** Uncontrolled initial value(s). @defaultValue [0] */\n defaultValue?: ReadonlyArray<number>;\n /** Fires continuously while a thumb moves. */\n onChange?: (next: number[]) => void;\n /** Fires when interaction ends (pointer up, key release). */\n onValueCommit?: (next: number[]) => void;\n /**\n * Fires when a pointer/touch starts driving the slider. Pair with\n * `onInteractionEnd` to toggle a parent ScrollView's `scrollEnabled`\n * — RN's responder system can't preempt UIScrollView's native pan\n * recognizer on iOS, so the canonical fix is for the consumer to\n * disable scroll while the user is actively dragging.\n */\n onInteractionStart?: () => void;\n /** Fires when a pointer/touch releases (pair with `onInteractionStart`). */\n onInteractionEnd?: () => void;\n /** @defaultValue 0 */\n min?: number;\n /** @defaultValue 100 */\n max?: number;\n /** Step size. @defaultValue 1 */\n step?: number;\n /** Multi-thumb spacing — minimum number of `step`s required between adjacent thumbs. @defaultValue 0 */\n minStepsBetweenThumbs?: number;\n /** @defaultValue 'horizontal' */\n orientation?: SliderOrientation;\n /** Reading direction. Affects which end is min/max for horizontal sliders. @defaultValue 'ltr' */\n dir?: SliderDirection;\n /** Reverse the visual + interaction direction (useful for \"less is more\" sliders). */\n inverted?: boolean;\n /** When true, the slider is non-interactive. */\n disabled?: boolean;\n /** Group-level accessibility label. */\n 'aria-label'?: string;\n /** Per-thumb label provider — `(index) => string`. Required for multi-thumb sliders to announce sensibly. */\n ariaLabelForThumb?: (thumbIndex: number) => string;\n /** Fixed track length when orientation=\"vertical\". @defaultValue 200 */\n length?: number;\n className?: string;\n testID?: string;\n};\n\nconst TRACK_THICKNESS = 6;\nconst THUMB_SIZE = 18;\nconst THUMB_HIT_SLOP = 8;\n\n// Clamp + snap a raw value to [min, max] on the step grid.\nconst snap = (raw: number, min: number, max: number, step: number): number => {\n const clamped = Math.min(max, Math.max(min, raw));\n if (step <= 0) {\n return clamped;\n }\n const stepped = Math.round((clamped - min) / step) * step + min;\n return Math.min(max, Math.max(min, Number.parseFloat(stepped.toFixed(10))));\n};\n\n// Replace one entry in a sorted-values array, then re-sort and enforce\n// the minStepsBetweenThumbs spacing.\nconst updateAt = (values: ReadonlyArray<number>, index: number, next: number, gap: number): number[] => {\n const out = values.slice();\n out[index] = next;\n // Enforce gap by clamping against neighbors. We don't re-sort the array\n // because thumb identity matters across drags; instead each thumb is\n // bounded by its neighbors' positions.\n const left = index > 0 ? out[index - 1] : undefined;\n const right = index < out.length - 1 ? out[index + 1] : undefined;\n if (left !== undefined && next < left + gap) {\n out[index] = left + gap;\n }\n if (right !== undefined && next > right - gap) {\n out[index] = right - gap;\n }\n return out;\n};\n\n/**\n * Continuous-value slider. Single-thumb, range (two thumbs), or N-thumb\n * for multi-handle pickers. Mirrors Radix's Slider API: `value`/`defaultValue`\n * is always an array, `onChange` fires continuously while dragging,\n * and `onValueCommit` fires when interaction ends.\n *\n * Keyboard nav (per-thumb):\n * - ArrowRight/ArrowUp → +step (ArrowLeft/ArrowDown → -step). The axis\n * follows orientation; horizontal sliders honor `dir=\"rtl\"` and\n * `inverted` to flip arrow meaning.\n * - PageUp/PageDown → ±10·step (or ±10% of range, whichever is larger).\n * - Home / End → min / max.\n *\n * Pointer behavior (web): clicking the track moves the nearest thumb to\n * the click; dragging a thumb continuously updates with `pointer-capture`\n * so the cursor doesn't lose tracking when it strays off the thumb. On\n * native, tap-to-position works; long-press dragging is a future\n * enhancement.\n *\n * RTL: when `dir=\"rtl\"` (horizontal only), the visual mapping flips so\n * the higher value sits on the left, matching Radix and shadcn.\n */\nexport const Slider = ({\n value,\n defaultValue,\n onChange,\n onValueCommit,\n onInteractionStart,\n onInteractionEnd,\n min = 0,\n max = 100,\n step = 1,\n minStepsBetweenThumbs = 0,\n orientation = 'horizontal',\n dir = 'ltr',\n inverted = false,\n disabled = false,\n ariaLabelForThumb,\n length = 200,\n className,\n testID,\n ...rest\n}: SliderProps) => {\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n const isVertical = orientation === 'vertical';\n // `reversed` flips the visual mapping: default vertical sliders have\n // max at the TOP (drag UP to increase, matching audio faders / volume\n // controls / brightness sliders). Horizontal LTR has max at the\n // right; horizontal RTL flips that. The `inverted` prop opts INTO\n // the opposite direction for either axis.\n const reversed = isVertical ? Boolean(inverted) : dir === 'rtl' ? !inverted : Boolean(inverted);\n const gap = step * minStepsBetweenThumbs;\n\n const initial = (defaultValue ?? value ?? [min]).map((v) => snap(v, min, max, step));\n const [inner, setInner] = useState<number[]>(initial);\n const isControlled = value !== undefined;\n const current = isControlled ? value.map((v) => snap(v, min, max, step)) : inner;\n\n const trackRef = useRef<View | null>(null);\n const trackRectRef = useRef<{ x: number; y: number; width: number; height: number } | null>(null);\n\n // Measure the track on layout (RN onLayout), and on web also on\n // window resize, since onLayout doesn't fire for window-relative shifts.\n // On native we use `measureInWindow` to get window-relative coords that\n // line up with `event.nativeEvent.pageX/pageY` from the responder.\n const measure = useCallback(() => {\n const node = trackRef.current;\n if (!node) {\n return;\n }\n if (Platform.OS === 'web') {\n const webNode = node as unknown as HTMLElement;\n if (typeof window === 'undefined' || typeof webNode.getBoundingClientRect !== 'function') {\n return;\n }\n const rect = webNode.getBoundingClientRect();\n trackRectRef.current = { x: rect.left, y: rect.top, width: rect.width, height: rect.height };\n return;\n }\n if (typeof node.measureInWindow === 'function') {\n node.measureInWindow((x, y, width, height) => {\n trackRectRef.current = { x, y, width, height };\n });\n }\n }, []);\n\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n measure();\n window.addEventListener('resize', measure);\n return () => window.removeEventListener('resize', measure);\n }, [measure]);\n\n const setValues = useCallback(\n (next: number[]) => {\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n const commitValues = useCallback(\n (next: number[]) => {\n onValueCommit?.(next);\n },\n [onValueCommit]\n );\n\n // Convert pointer position → value. Returns the value the cursor maps to,\n // honoring orientation, RTL/inverted, and snapping to step.\n const valueFromClient = useCallback(\n (clientX: number, clientY: number): number => {\n const rect = trackRectRef.current;\n if (!rect) {\n return min;\n }\n const len = isVertical ? rect.height : rect.width;\n if (len <= 0) {\n return min;\n }\n const offset = isVertical ? clientY - rect.y : clientX - rect.x;\n let ratio = offset / len;\n ratio = Math.min(1, Math.max(0, ratio));\n // For vertical, the visual top is max (higher = up), so invert.\n if (isVertical) {\n ratio = 1 - ratio;\n }\n if (reversed) {\n ratio = 1 - ratio;\n }\n const raw = min + ratio * (max - min);\n return snap(raw, min, max, step);\n },\n [isVertical, reversed, min, max, step]\n );\n\n // Find the index of the thumb closest to a given value.\n const closestThumbIndex = useCallback(\n (target: number): number => {\n let best = 0;\n let bestDelta = Number.POSITIVE_INFINITY;\n for (let i = 0; i < current.length; i += 1) {\n const cv = current[i];\n if (cv === undefined) {\n continue;\n }\n const delta = Math.abs(cv - target);\n if (delta < bestDelta) {\n best = i;\n bestDelta = delta;\n }\n }\n return best;\n },\n [current]\n );\n\n const draggingRef = useRef<{ index: number; pointerId: number } | null>(null);\n // Auto-publishes drag state to a `<SliderGestureProvider>` ancestor\n // (no-op if none is mounted). Containers that need to disable scroll\n // during a drag read the same context via `useSliderInteractionActive`.\n const gesturePublisher = useSliderGesturePublisher();\n\n const onTrackPointerDown = useCallback(\n (event: ReactPointerEvent<HTMLElement>) => {\n if (disabled) {\n return;\n }\n measure();\n const targetValue = valueFromClient(event.clientX, event.clientY);\n const idx = closestThumbIndex(targetValue);\n const next = updateAt(current, idx, targetValue, gap);\n setValues(next);\n draggingRef.current = { index: idx, pointerId: event.pointerId };\n event.currentTarget.setPointerCapture?.(event.pointerId);\n gesturePublisher.begin();\n onInteractionStart?.();\n },\n [\n disabled,\n measure,\n valueFromClient,\n closestThumbIndex,\n current,\n gap,\n setValues,\n gesturePublisher,\n onInteractionStart,\n ]\n );\n\n const onTrackPointerMove = useCallback(\n (event: ReactPointerEvent<HTMLElement>) => {\n const drag = draggingRef.current;\n if (!drag || drag.pointerId !== event.pointerId) {\n return;\n }\n const targetValue = valueFromClient(event.clientX, event.clientY);\n const next = updateAt(current, drag.index, targetValue, gap);\n setValues(next);\n },\n [valueFromClient, current, gap, setValues]\n );\n\n const onTrackPointerUp = useCallback(\n (event: ReactPointerEvent<HTMLElement>) => {\n const drag = draggingRef.current;\n if (!drag || drag.pointerId !== event.pointerId) {\n return;\n }\n draggingRef.current = null;\n commitValues(current);\n gesturePublisher.end();\n onInteractionEnd?.();\n },\n [commitValues, current, gesturePublisher, onInteractionEnd]\n );\n\n const handleThumbKeyDown = useCallback(\n (index: number) => (event: KeyboardEvent<HTMLElement>) => {\n if (disabled) {\n return;\n }\n const cv = current[index];\n if (cv === undefined) {\n return;\n }\n const range = max - min;\n const big = Math.max(step * 10, range / 10);\n const arrowSign = (key: 'inc' | 'dec') => {\n // Arrow ↑/→ is \"increase\" in default direction; flip for RTL/inverted.\n const base = key === 'inc' ? 1 : -1;\n return reversed ? -base : base;\n };\n let nextValue = cv;\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n nextValue = cv + step * arrowSign('inc');\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n nextValue = cv + step * arrowSign('dec');\n break;\n case 'PageUp':\n nextValue = cv + big * arrowSign('inc');\n break;\n case 'PageDown':\n nextValue = cv + big * arrowSign('dec');\n break;\n case 'Home':\n nextValue = min;\n break;\n case 'End':\n nextValue = max;\n break;\n default:\n return;\n }\n event.preventDefault();\n const snapped = snap(nextValue, min, max, step);\n const next = updateAt(current, index, snapped, gap);\n setValues(next);\n commitValues(next);\n },\n [disabled, current, max, min, step, reversed, gap, setValues, commitValues]\n );\n\n // Visual layout. The thumb sits on top of the track at its value's\n // position; the range fills from the lowest thumb to the highest.\n const pctSig = (n: number) => `${Math.round(n * 10000) / 10000}%` as unknown as number;\n const thumbPositionStyle = (val: number): ViewStyle => {\n const ratio = (val - min) / (max - min || 1);\n const offset = pctSig((reversed ? 1 - ratio : ratio) * 100);\n if (isVertical) {\n // Vertical: top=max, bottom=min by default (reverse visual mapping).\n const verticalOffset = pctSig((reversed ? ratio : 1 - ratio) * 100);\n return {\n position: 'absolute',\n top: verticalOffset,\n left: pctSig(50),\n marginLeft: -THUMB_SIZE / 2,\n marginTop: -THUMB_SIZE / 2,\n };\n }\n return {\n position: 'absolute',\n left: offset,\n top: pctSig(50),\n marginLeft: -THUMB_SIZE / 2,\n marginTop: -THUMB_SIZE / 2,\n };\n };\n\n const sortedValues = useMemo(() => current.slice().sort((a, b) => a - b), [current]);\n // Fill behavior:\n // - Single thumb: fill from min → value (matches Radix / shadcn).\n // Without this, a single-thumb slider has no visible fill at all\n // because the start and end of the range are the same value.\n // - Multi thumb: fill from lowest thumb → highest thumb (range region).\n const isSingle = sortedValues.length <= 1;\n const fillStart = isSingle ? min : (sortedValues[0] ?? min);\n const fillEnd = isSingle ? (sortedValues[0] ?? min) : (sortedValues[sortedValues.length - 1] ?? min);\n const startRatio = (fillStart - min) / (max - min || 1);\n const endRatio = (fillEnd - min) / (max - min || 1);\n\n // Casts: RN-Web accepts percentage strings for inset properties, but\n // RN's TS surface (DimensionValue) is narrower. Cast at the boundary.\n // Round to 4 decimals so floating-point noise (`19.999999%`) doesn't\n // bleed into rendered styles.\n const pct = (n: number) => `${Math.round(n * 10000) / 10000}%` as unknown as number;\n const rangeStyle: ViewStyle = isVertical\n ? {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: pct((reversed ? 1 - endRatio : startRatio) * 100),\n top: pct((reversed ? startRatio : 1 - endRatio) * 100),\n backgroundColor: disabled ? colors.color.neutral['400'] : colors.semantic.interactive.primary,\n }\n : {\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: pct((reversed ? 1 - endRatio : startRatio) * 100),\n right: pct((reversed ? startRatio : 1 - endRatio) * 100),\n backgroundColor: disabled ? colors.color.neutral['400'] : colors.semantic.interactive.primary,\n };\n\n const trackStyle: ViewStyle = isVertical\n ? {\n width: TRACK_THICKNESS,\n height: length,\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: TRACK_THICKNESS / 2,\n position: 'relative',\n // No overflow: hidden here — the thumb is a child and we don't\n // want it clipped at the track's edge. The fill below sits in\n // its own absolutely-positioned slot inside the track and\n // already paints within the track's rounded corners thanks to\n // matching borderRadius, so we don't need to clip.\n }\n : {\n height: TRACK_THICKNESS,\n width: '100%',\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: TRACK_THICKNESS / 2,\n position: 'relative',\n // No overflow: hidden here — the thumb is a child and we don't\n // want it clipped at the track's edge. The fill below sits in\n // its own absolutely-positioned slot inside the track and\n // already paints within the track's rounded corners thanks to\n // matching borderRadius, so we don't need to clip.\n };\n\n const containerStyle: ViewStyle = isVertical\n ? {\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n paddingVertical: THUMB_HIT_SLOP,\n paddingHorizontal: THUMB_SIZE,\n opacity: disabled ? 0.5 : 1,\n }\n : {\n flexDirection: 'row',\n alignItems: 'center',\n paddingVertical: THUMB_HIT_SLOP,\n paddingHorizontal: THUMB_SIZE / 2,\n opacity: disabled ? 0.5 : 1,\n };\n\n // Native gesture handlers — claim the responder so a parent ScrollView\n // can't steal the drag, then drive the same value-from-coords logic\n // using `pageX`/`pageY` (window-relative, matches `measureInWindow`).\n const onTrackResponderGrant = useCallback(\n (event: GestureResponderEvent) => {\n if (disabled) {\n return;\n }\n // Re-measure on grant to capture any layout shift that happened\n // between mount and the first touch (e.g. inside an animated\n // ScrollView). Doing it here is cheap and guarantees fresh\n // coords for the upcoming move sequence.\n measure();\n const { pageX, pageY } = event.nativeEvent;\n const targetValue = valueFromClient(pageX, pageY);\n const idx = closestThumbIndex(targetValue);\n const next = updateAt(current, idx, targetValue, gap);\n setValues(next);\n draggingRef.current = { index: idx, pointerId: 0 };\n gesturePublisher.begin();\n onInteractionStart?.();\n },\n [\n disabled,\n measure,\n valueFromClient,\n closestThumbIndex,\n current,\n gap,\n setValues,\n gesturePublisher,\n onInteractionStart,\n ]\n );\n const onTrackResponderMove = useCallback(\n (event: GestureResponderEvent) => {\n if (!draggingRef.current) {\n return;\n }\n const { pageX, pageY } = event.nativeEvent;\n const targetValue = valueFromClient(pageX, pageY);\n const next = updateAt(current, draggingRef.current.index, targetValue, gap);\n setValues(next);\n },\n [valueFromClient, current, gap, setValues]\n );\n const onTrackResponderRelease = useCallback(() => {\n if (!draggingRef.current) {\n return;\n }\n draggingRef.current = null;\n commitValues(current);\n gesturePublisher.end();\n onInteractionEnd?.();\n }, [commitValues, current, gesturePublisher, onInteractionEnd]);\n\n // RN's View doesn't model pointer events in its TS surface; rn-web\n // forwards them. Cast at the spread boundary. Native uses the\n // GestureResponder system so a vertical slider inside a ScrollView\n // still wins the touch — `onMoveShouldSetResponderCapture` claims\n // the gesture before the ScrollView can.\n const trackPointerProps: Record<string, unknown> =\n Platform.OS === 'web'\n ? {\n onPointerDown: onTrackPointerDown,\n onPointerMove: onTrackPointerMove,\n onPointerUp: onTrackPointerUp,\n onPointerCancel: onTrackPointerUp,\n }\n : {\n // Capture variants run BEFORE non-capture handlers and\n // walk root → leaf, so they win the gesture against an\n // ancestor ScrollView whose own `onStartShould` would\n // otherwise claim the touch first. Without these, a\n // vertical slider inside a vertical ScrollView lets the\n // ScrollView swallow the drag.\n onStartShouldSetResponderCapture: () => !disabled,\n onMoveShouldSetResponderCapture: () => !disabled,\n onStartShouldSetResponder: () => !disabled,\n onMoveShouldSetResponder: () => !disabled,\n onResponderGrant: onTrackResponderGrant,\n onResponderMove: onTrackResponderMove,\n onResponderRelease: onTrackResponderRelease,\n onResponderTerminate: onTrackResponderRelease,\n onResponderTerminationRequest: () => false,\n };\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"group\"\n accessibilityRole=\"adjustable\"\n {...(ariaLabel !== undefined ? { 'aria-label': ariaLabel, accessibilityLabel: ariaLabel } : {})}\n {...(disabled ? { 'aria-disabled': true } : {})}\n className={cn(\n isVertical ? 'flex-col items-center' : 'flex-row items-center',\n disabled ? 'opacity-50' : undefined,\n className\n )}\n style={containerStyle}\n >\n <View\n ref={trackRef}\n onLayout={measure}\n {...trackPointerProps}\n className={cn('relative bg-neutral-200 rounded-full')}\n style={trackStyle}\n >\n {/* Inner clipper holds the range fill so its left/right\n * edges round naturally against the track's borderRadius.\n * The thumbs live OUTSIDE this clipper as direct children\n * of the track, so they aren't truncated to track height. */}\n <View\n pointerEvents=\"none\"\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: TRACK_THICKNESS / 2,\n overflow: 'hidden',\n }}\n >\n <View style={rangeStyle} />\n </View>\n {current.map((val, index) => {\n const ratio = (val - min) / (max - min || 1);\n const thumbProps: Record<string, unknown> = {\n role: 'slider',\n accessibilityRole: 'adjustable',\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuenow': val,\n 'aria-orientation': orientation,\n 'aria-label': ariaLabelForThumb?.(index) ?? ariaLabel,\n tabIndex: disabled ? -1 : 0,\n onKeyDown: handleThumbKeyDown(index),\n 'data-thumb-index': index,\n 'data-value': val,\n 'data-ratio': ratio,\n };\n return (\n <View\n // biome-ignore lint/suspicious/noArrayIndexKey: thumb identity IS its index — values preserve order across renders.\n key={`thumb-${index}`}\n {...thumbProps}\n style={[\n thumbPositionStyle(val),\n {\n width: THUMB_SIZE,\n height: THUMB_SIZE,\n borderRadius: THUMB_SIZE / 2,\n backgroundColor: colors.semantic.background.elevated,\n borderWidth: 2,\n borderColor: disabled\n ? colors.color.neutral['400']\n : colors.semantic.interactive.primary,\n ...(Platform.OS === 'web'\n ? ({ boxShadow: '0 1px 2px rgba(0,0,0,0.1)' } as ViewStyle)\n : {}),\n },\n ]}\n />\n );\n })}\n </View>\n </View>\n );\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { AnimatedView } from '../../animation/animated-view';\nimport { useAnimatedNumber } from '../../animation/use-animated-number';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n};\n\n// Layout-only base; row gap is theme-driven inside the component.\nconst ROW_LAYOUT_BASE: ViewStyle = { flexDirection: 'row', alignItems: 'center' };\n// Switch track + thumb are tightly coupled — width 40, height 24, thumb\n// 20×20, travel 18px. Component-density literals — not from theme.\nconst TRACK_BASE: ViewStyle = {\n width: 40,\n height: 24,\n borderRadius: 12,\n // Relative so the absolutely-positioned thumb anchors against the\n // track (not the page). The thumb's `left` value transitions between\n // 2 (off) and 18 (on) — see thumb style below.\n position: 'relative',\n};\nconst THUMB_BASE_STYLE: ViewStyle = {\n width: 20,\n height: 20,\n borderRadius: 10,\n // Web: boxShadow (the modern CSS-style replacement for the legacy RN\n // `shadow*` props that react-native-web has deprecated).\n // Native: elevation (Android) — RN ignores boxShadow there.\n ...({ boxShadow: '0 1px 2px rgba(0, 0, 0, 0.15)' } as ViewStyle),\n elevation: 2,\n};\n\n/**\n * Switch — a toggle control with role=\"switch\". Supports controlled + uncontrolled,\n * disabled state, asChild (via Slot), and a visible label that doubles as the\n * accessibility label.\n */\nexport const Switch = ({\n checked,\n defaultChecked = false,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n}: SwitchProps) => {\n const colors = useThemeColors();\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n // Pulled up here (above the asChild early-return) so the hook is\n // called on every render path, not conditionally. The slide isn't\n // used in the asChild branch, but the wasted work is tiny.\n const slide = useAnimatedNumber('left', value ? 18 : 2);\n\n const toggle = useCallback(() => {\n if (disabled) {\n return;\n }\n const next = !value;\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const ariaChecked: 'true' | 'false' = value ? 'true' : 'false';\n\n const commonProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'switch' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (disabled) {\n commonProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'switch',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) {\n slotProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n slotProps['aria-label'] = label;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n if (className !== undefined) {\n slotProps.className = className;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const trackClasses = cn(\n 'w-10 h-6 rounded-full justify-center px-0.5 transition-colors',\n value ? 'bg-semantic-interactive-primary' : 'bg-neutral-300 dark:bg-neutral-700',\n disabled ? 'opacity-60' : undefined\n );\n // Position is set inline below (absolute + animated `left`), so no\n // self-start/self-end classes here — they'd fight the inline position.\n const thumbClasses = cn('w-5 h-5 rounded-full bg-white dark:bg-neutral-100 shadow-sm');\n\n const trackStyle = [\n TRACK_BASE,\n {\n backgroundColor: value ? colors.semantic.interactive.primary : colors.color.neutral['600'],\n // Subtle 180ms color transition between off → on. Web only;\n // native has no equivalent for the track tint in v1.\n ...({ transitionProperty: 'background-color', transitionDuration: '180ms' } as ViewStyle),\n },\n disabled ? { opacity: 0.6 } : null,\n ];\n // Thumb stays a near-white disc — we deliberately don't go to a dark\n // grey on dark mode because the thumb needs to read as the \"moveable\n // puck\" against the track in both schemes.\n //\n // Animation: thumb slides between left:2 (off) and left:18 (on) —\n // track width 40 - padding 2 - thumb 20 = 18 px travel. The\n // useAnimatedNumber hook picks the right engine per platform (web\n // CSS transition / reanimated spring / RN Animated). The hook is\n // called once at the top of the function — see the `slide` above.\n const thumbStyle = [\n THUMB_BASE_STYLE,\n {\n backgroundColor: colors.color.neutral['50'],\n position: 'absolute' as const,\n top: 2,\n } as ViewStyle,\n slide as ViewStyle,\n ];\n\n // Whole-row Pressable so clicking the label toggles the switch. The\n // visible track is a non-interactive View — one role=\"switch\" per\n // logical control, not two competing hit-areas.\n const rowStyle: ViewStyle = { ...ROW_LAYOUT_BASE, gap: px(colors.spacing['2']) };\n\n return (\n <Pressable\n onPress={toggle}\n {...commonProps}\n className={cn('flex-row items-center gap-2', className)}\n style={rowStyle}\n >\n <View className={trackClasses} style={trackStyle}>\n {/*\n * Animated.View — the slide style fragment from\n * `useAnimatedNumber` contains an `Animated.Value` on\n * native; a plain `View` would render the value as 0\n * (no animation). On web, the same fragment is plain\n * CSS and `Animated.View` falls through to a regular\n * div via react-native-web.\n */}\n <AnimatedView className={thumbClasses} style={thumbStyle} />\n </View>\n {label ? (\n <RNText\n className=\"text-md text-semantic-text-default\"\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n }}\n >\n {label}\n </RNText>\n ) : null}\n {children}\n </Pressable>\n );\n};\n","'use client';\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type TabsOrientation = 'horizontal' | 'vertical';\nexport type TabsActivation = 'automatic' | 'manual';\n\ntype TabsContextValue = {\n value: string | undefined;\n setValue: (next: string) => void;\n baseId: string;\n orientation: TabsOrientation;\n activation: TabsActivation;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n moveFocus: (offset: 1 | -1, fromValue: string) => void;\n focusEdge: (edge: 'first' | 'last') => void;\n};\n\nconst TabsContext = createContext<TabsContextValue | null>(null);\n\nconst useTabsContext = (label: string): TabsContextValue => {\n const ctx = useContext(TabsContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside a <Tabs>.`);\n }\n return ctx;\n};\n\nexport type TabsProps = {\n /** Controlled active tab value. */\n value?: string;\n /** Uncontrolled initial value. */\n defaultValue?: string;\n /** Fires with the new value when the active tab changes. */\n onChange?: (next: string) => void;\n /**\n * Layout direction of the tablist. Drives the keyboard-nav axis.\n * @defaultValue 'horizontal'\n */\n orientation?: TabsOrientation;\n /**\n * Whether arrow keys also activate the focused tab.\n * - `automatic` (default) — selection follows focus, matching most UIs.\n * - `manual` — arrow keys move focus only; the user presses Enter or\n * Space to activate. Use when activating a tab is expensive.\n * @defaultValue 'automatic'\n */\n activation?: TabsActivation;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Tab pattern with keyboard nav, roving tabindex, and content/trigger\n * association via shared `value`s. Compose:\n *\n * <Tabs defaultValue=\"overview\">\n * <TabsList>\n * <TabsTrigger value=\"overview\">Overview</TabsTrigger>\n * <TabsTrigger value=\"settings\">Settings</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"overview\">…</TabsContent>\n * <TabsContent value=\"settings\">…</TabsContent>\n * </Tabs>\n *\n * Follows the WAI-ARIA tablist pattern: `tablist` / `tab` / `tabpanel` roles,\n * arrow-key navigation that wraps, Home/End for first/last, and roving\n * tabindex so tabbing into the group lands on the active tab.\n */\nconst TabsRoot = ({\n value,\n defaultValue,\n onChange,\n orientation = 'horizontal',\n activation = 'automatic',\n children,\n className,\n testID,\n}: TabsProps) => {\n const baseId = useId();\n const [inner, setInner] = useState<string | undefined>(defaultValue);\n const isControlled = value !== undefined;\n const current = isControlled ? value : inner;\n\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n const orderRef = useRef<string[]>([]);\n\n const setValue = useCallback(\n (next: string) => {\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n if (!orderRef.current.includes(v)) {\n orderRef.current.push(v);\n }\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n orderRef.current = orderRef.current.filter((x) => x !== v);\n }, []);\n\n const focusValue = useCallback(\n (next: string) => {\n const ref = refs.current.get(next);\n ref?.current?.focus?.();\n if (activation === 'automatic') {\n setValue(next);\n }\n },\n [activation, setValue]\n );\n\n const moveFocus = useCallback(\n (offset: 1 | -1, fromValue: string) => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const idx = order.indexOf(fromValue);\n const start = idx === -1 ? 0 : idx;\n const len = order.length;\n const next = order[(start + offset + len) % len];\n if (next) {\n focusValue(next);\n }\n },\n [focusValue]\n );\n\n const focusEdge = useCallback(\n (edge: 'first' | 'last') => {\n const order = orderRef.current;\n if (order.length === 0) {\n return;\n }\n const target = edge === 'first' ? order[0] : order[order.length - 1];\n if (target) {\n focusValue(target);\n }\n },\n [focusValue]\n );\n\n const ctxValue = useMemo<TabsContextValue>(\n () => ({\n value: current,\n setValue,\n baseId,\n orientation,\n activation,\n register,\n unregister,\n moveFocus,\n focusEdge,\n }),\n [current, setValue, baseId, orientation, activation, register, unregister, moveFocus, focusEdge]\n );\n\n return (\n <TabsContext.Provider value={ctxValue}>\n <TabsViewport\n orientation={orientation}\n {...(className !== undefined ? { className } : {})}\n {...(testID !== undefined ? { testID } : {})}\n >\n {children}\n </TabsViewport>\n </TabsContext.Provider>\n );\n};\n\n// Inner view so we can call useThemeColors() to source the orientation\n// gap from the spacing token scale.\nconst TabsViewport = ({\n orientation,\n className,\n testID,\n children,\n}: {\n orientation: TabsOrientation;\n className?: string;\n testID?: string;\n children?: ReactNode;\n}) => {\n const colors = useThemeColors();\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn(orientation === 'vertical' ? 'flex-row gap-4' : 'flex-col gap-3', className)}\n style={\n orientation === 'vertical'\n ? { flexDirection: 'row', gap: px(colors.spacing['4']) }\n : { flexDirection: 'column', gap: px(colors.spacing['3']) }\n }\n >\n {children}\n </View>\n );\n};\n\nexport type TabsListProps = {\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n// Layout-only bases; theme-driven gap is merged inside TabsList.\nconst LIST_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n borderBottomWidth: 1,\n};\n\nconst LIST_VERTICAL_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'column',\n alignItems: 'stretch',\n borderRightWidth: 1,\n};\n\n/** Container for `TabsTrigger`s. Renders the underline rule on the appropriate edge. */\nexport const TabsList = ({ children, className, testID }: TabsListProps) => {\n const ctx = useTabsContext('TabsList');\n const colors = useThemeColors();\n const gap = px(colors.spacing['1']);\n const listStyle: ViewStyle =\n ctx.orientation === 'vertical'\n ? { ...LIST_VERTICAL_LAYOUT_BASE, gap, borderRightColor: colors.semantic.border.default }\n : { ...LIST_LAYOUT_BASE, gap, borderBottomColor: colors.semantic.border.default };\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"tablist\"\n accessibilityRole=\"tablist\"\n aria-orientation={ctx.orientation}\n className={cn(\n ctx.orientation === 'vertical'\n ? 'flex-col gap-1 border-r border-semantic-border-default'\n : 'flex-row items-center gap-1 border-b border-semantic-border-default',\n className\n )}\n style={listStyle}\n >\n {children}\n </View>\n );\n};\n\nexport type TabsTriggerProps = {\n /** Value linking this trigger to a `<TabsContent>`. */\n value: string;\n /** Disable just this trigger. */\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n// Subtle 200ms ease on border + text color so the active tab indicator\n// fades in/out (and the trigger label colors smoothly between selected\n// and idle) instead of snapping. Web only — RN ignores the transition*\n// keys silently. We don't ship a true sliding magic-pill on either\n// platform yet; that would need react-native-reanimated and per-trigger\n// rect measurement, which is more complexity than this earns right now.\nconst TRIGGER_TRANSITION = {\n transitionProperty: 'border-color, color',\n transitionDuration: '200ms',\n transitionTimingFunction: 'ease',\n} as ViewStyle;\n\n// Layout / transition only; theme-driven padding is merged inside TabsTrigger.\nconst TRIGGER_LAYOUT_BASE: ViewStyle = {\n borderBottomWidth: 2,\n borderBottomColor: 'transparent',\n marginBottom: -1,\n ...TRIGGER_TRANSITION,\n};\n\nconst TRIGGER_LAYOUT_BASE_VERTICAL: ViewStyle = {\n borderRightWidth: 2,\n borderRightColor: 'transparent',\n marginRight: -1,\n ...TRIGGER_TRANSITION,\n};\n\n/** Clickable tab. Activating it shows the matching `TabsContent`. */\nexport const TabsTrigger = ({ value, disabled, children, className, testID }: TabsTriggerProps) => {\n const ctx = useTabsContext('TabsTrigger');\n const colors = useThemeColors();\n const ownRef = useRef<HTMLElement | null>(null);\n const selected = ctx.value === value;\n const isVertical = ctx.orientation === 'vertical';\n\n useEffect(() => {\n ctx.register(value, ownRef);\n return () => ctx.unregister(value);\n }, [ctx, value]);\n\n const onPress = useCallback(() => {\n if (disabled) {\n return;\n }\n ctx.setValue(value);\n }, [ctx, value, disabled]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n const nextKey = isVertical ? 'ArrowDown' : 'ArrowRight';\n const prevKey = isVertical ? 'ArrowUp' : 'ArrowLeft';\n switch (event.key) {\n case nextKey:\n event.preventDefault();\n ctx.moveFocus(1, value);\n return;\n case prevKey:\n event.preventDefault();\n ctx.moveFocus(-1, value);\n return;\n case 'Home':\n event.preventDefault();\n ctx.focusEdge('first');\n return;\n case 'End':\n event.preventDefault();\n ctx.focusEdge('last');\n return;\n case 'Enter':\n case ' ': {\n if (ctx.activation === 'manual') {\n event.preventDefault();\n if (!disabled) {\n ctx.setValue(value);\n }\n }\n return;\n }\n }\n },\n [ctx, value, disabled, isVertical]\n );\n\n const accentStyle = selected\n ? isVertical\n ? { borderRightColor: colors.semantic.interactive.primary }\n : { borderBottomColor: colors.semantic.interactive.primary }\n : null;\n\n const triggerProps: Record<string, unknown> = {\n ref: (node: HTMLElement | null) => {\n ownRef.current = node;\n },\n role: 'tab',\n accessibilityRole: 'tab',\n 'aria-selected': selected,\n 'aria-controls': `${ctx.baseId}-panel-${value}`,\n id: `${ctx.baseId}-tab-${value}`,\n tabIndex: selected ? 0 : -1,\n onPress,\n onKeyDown: handleKeyDown,\n ...(disabled ? { 'aria-disabled': true, disabled: true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n const triggerPadding: ViewStyle = {\n paddingHorizontal: px(colors.spacing['3']),\n paddingVertical: px(colors.spacing['2']),\n };\n const triggerStyle: ViewStyle = isVertical\n ? { ...TRIGGER_LAYOUT_BASE_VERTICAL, ...triggerPadding }\n : { ...TRIGGER_LAYOUT_BASE, ...triggerPadding };\n\n return (\n <Pressable\n {...triggerProps}\n className={cn(\n isVertical\n ? 'px-3 py-2 -mr-px border-r-2 border-r-transparent'\n : 'px-3 py-2 -mb-px border-b-2 border-b-transparent',\n selected ? 'border-r-semantic-interactive-primary' : '',\n disabled ? 'opacity-50' : 'opacity-100',\n className\n )}\n style={[triggerStyle, accentStyle, disabled ? { opacity: 0.5 } : null]}\n >\n {typeof children === 'string' ? (\n <RNText\n style={{\n color: selected ? colors.semantic.interactive.primary : colors.semantic.text.muted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: selected\n ? (colors.fontWeight.semibold as '600')\n : (colors.fontWeight.medium as '500'),\n }}\n >\n {children}\n </RNText>\n ) : (\n children\n )}\n </Pressable>\n );\n};\n\nexport type TabsContentProps = {\n /** Value of the trigger this panel pairs with. */\n value: string;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/** Panel content shown when its `value` matches the active tab. */\nexport const TabsContent = ({ value, children, className, testID }: TabsContentProps) => {\n const ctx = useTabsContext('TabsContent');\n const active = ctx.value === value;\n if (!active) {\n return null;\n }\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n role=\"tabpanel\"\n accessibilityRole=\"none\"\n id={`${ctx.baseId}-panel-${value}`}\n aria-labelledby={`${ctx.baseId}-tab-${value}`}\n tabIndex={0}\n className={cn('outline-none', className)}\n >\n {children}\n </View>\n );\n};\n\n/**\n * Public `Tabs` value — the root function plus its `.List`, `.Trigger`, and\n * `.Content` static members. `Object.assign` produces a value whose inferred\n * type carries the static properties, so `.d.ts` consumers can write\n * `<Tabs.List>` without a separate import.\n */\nexport const Tabs = Object.assign(TabsRoot, {\n List: TabsList,\n Trigger: TabsTrigger,\n Content: TabsContent,\n});\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { useId, useRef } from 'react';\nimport type { TextInputProps as RNTextInputProps, TextStyle, ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, TextInput as RNTextInput, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type TextInputProps = Omit<RNTextInputProps, 'editable'> & {\n label?: string;\n helperText?: string;\n error?: string;\n disabled?: boolean;\n leading?: ReactNode;\n trailing?: ReactNode;\n /** Pass through a custom wrapper className */\n containerClassName?: string;\n className?: string;\n testID?: string;\n /** Controlled text handler. Optional so uncontrolled usage works too. */\n onChangeText?: (text: string) => void;\n /** Multi-line mode — flipped by TextArea. Default false. */\n multiline?: boolean;\n numberOfLines?: number;\n};\n\n// Layout-only bases; theme-driven dimensions are merged inside the component.\nconst CONTAINER_LAYOUT_BASE: ViewStyle = { flexDirection: 'column' };\nconst FIELD_LAYOUT_BASE: ViewStyle = {\n flexDirection: 'row',\n alignItems: 'center',\n borderWidth: 1,\n // Clip the textarea's browser-drawn resize grippy inside the rounded\n // border. Without this, the grippy escapes the corner and looks like\n // it belongs to the page, not the input.\n overflow: 'hidden',\n};\n\n/**\n * Single-line text input with label, helper, error, and leading/trailing slots.\n *\n * a11y: label is a <label for={id}>; the input is `aria-invalid=true` + labelled\n * by the error/helper text via aria-describedby when present.\n *\n * Color flips with the active scheme — the field surface, border, label, and\n * placeholder all read from the resolved palette via `useThemeColors`.\n */\nexport const TextInput = ({\n label,\n helperText,\n error,\n disabled,\n leading,\n trailing,\n containerClassName,\n className,\n testID,\n onChangeText,\n multiline,\n numberOfLines,\n ...rest\n}: TextInputProps) => {\n const colors = useThemeColors();\n const reactId = useId();\n const inputId = testID ?? `nori-ui-input-${reactId}`;\n const inputRef = useRef<RNTextInput | null>(null);\n // Tap on the label → focus the input. Cross-platform: Pressable's\n // onPress fires on web (click) and native (tap), and RNTextInput's\n // imperative `.focus()` works on both. This restores the\n // `<label htmlFor>` UX without resurrecting the host-element crash\n // we hit on native (see comment near the label render).\n const focusInput = () => {\n inputRef.current?.focus();\n };\n const describeId = `${inputId}-describe`;\n const hasError = Boolean(error);\n const describedBy = error || helperText ? describeId : undefined;\n\n const inputExtras: Record<string, unknown> = {};\n if (testID !== undefined) {\n inputExtras.testID = testID;\n }\n if (label !== undefined) {\n inputExtras.accessibilityLabel = label;\n }\n if (hasError) {\n inputExtras['aria-invalid'] = true;\n }\n if (describedBy !== undefined) {\n inputExtras['aria-describedby'] = describedBy;\n }\n if (multiline !== undefined) {\n inputExtras.multiline = multiline;\n }\n if (numberOfLines !== undefined) {\n inputExtras.numberOfLines = numberOfLines;\n }\n if (onChangeText !== undefined) {\n inputExtras.onChangeText = onChangeText;\n }\n\n const labelStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n fontWeight: colors.fontWeight.medium as '500',\n color: colors.semantic.text.default,\n };\n const inputStyle: TextStyle = {\n flex: 1,\n paddingVertical: px(colors.spacing['2']),\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n color: colors.semantic.text.default,\n };\n const helperStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n };\n const errorStyle: TextStyle = {\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.color.danger,\n };\n const containerStyle: ViewStyle = { ...CONTAINER_LAYOUT_BASE, gap: px(colors.spacing['1']) };\n const fieldStyle = [\n FIELD_LAYOUT_BASE,\n {\n borderRadius: px(colors.radius.md),\n paddingHorizontal: px(colors.spacing['3']),\n backgroundColor: colors.semantic.background.elevated,\n borderColor: hasError ? colors.color.danger : colors.semantic.border.default,\n },\n disabled ? { opacity: 0.6 } : null,\n ];\n\n return (\n <View className={cn('flex flex-col gap-1', containerClassName)} style={containerStyle}>\n {/*\n * Use RNText for the label so the component renders on both\n * platforms. The previous `<label htmlFor>` worked only on\n * the web (rn-web compiled it through), but on native RN\n * tries to look up `label` as a host component and crashes\n * with \"View config getter callback for component `label`\n * must be a function\". Click-to-focus on web is a small\n * cost we accept; the underlying RNTextInput still gets\n * `accessibilityLabel={label}` (above) for screen readers.\n */}\n {label !== undefined ? (\n <Pressable onPress={focusInput} accessibilityRole=\"none\" disabled={disabled}>\n <RNText\n nativeID={`${inputId}-label`}\n accessibilityRole=\"text\"\n className=\"text-sm font-medium text-semantic-text-default\"\n style={labelStyle}\n >\n {label}\n </RNText>\n </Pressable>\n ) : null}\n <View\n className={cn(\n 'flex-row items-center rounded-md border px-3',\n hasError ? 'border-semantic-interactive-destructive' : 'border-semantic-border-default',\n disabled ? 'opacity-60' : undefined\n )}\n style={fieldStyle}\n >\n {leading ? (\n <View className=\"mr-2\" style={{ marginRight: px(colors.spacing['2']) }}>\n {leading}\n </View>\n ) : null}\n <RNTextInput\n ref={inputRef}\n nativeID={inputId}\n editable={!disabled}\n className={cn('flex-1 py-2 text-md text-semantic-text-default outline-none', className)}\n placeholderTextColor={colors.semantic.text.muted}\n {...inputExtras}\n {...rest}\n // Spread `rest` first so callers can extend the input style without\n // losing inputStyle — RN merges array styles in order, last wins.\n style={[inputStyle, rest.style]}\n />\n {trailing ? (\n <View className=\"ml-2\" style={{ marginLeft: px(colors.spacing['2']) }}>\n {trailing}\n </View>\n ) : null}\n </View>\n {error ? (\n <RNText\n nativeID={describeId}\n className=\"text-sm text-semantic-interactive-destructive\"\n style={errorStyle}\n >\n {error}\n </RNText>\n ) : helperText ? (\n <RNText nativeID={describeId} className=\"text-sm text-semantic-text-muted\" style={helperStyle}>\n {helperText}\n </RNText>\n ) : null}\n </View>\n );\n};\n","import type { TextStyle } from 'react-native';\nimport type { TextInputProps } from '../TextInput';\nimport { TextInput } from '../TextInput';\n\nexport type TextAreaResize = 'none' | 'vertical' | 'horizontal' | 'both';\n\nexport type TextAreaProps = TextInputProps & {\n /**\n * On web, controls the underlying `<textarea>`'s resize handle. Ignored\n * on native (where height is determined by `numberOfLines`).\n * @defaultValue 'vertical'\n */\n resize?: TextAreaResize;\n};\n\n/**\n * Multi-line text input. Thin wrapper over TextInput that fixes `multiline=true`\n * and provides a sensible default for `numberOfLines`.\n *\n * The web textarea is vertically resizable by default — set `resize=\"none\"`\n * to lock it. On native, the prop is a no-op since RN's `<TextInput multiline>`\n * sizes from `numberOfLines`.\n */\nexport const TextArea = ({ numberOfLines = 4, resize = 'vertical', style, ...rest }: TextAreaProps) => {\n // `resize` isn't part of RN's TextStyle but react-native-web passes\n // unknown style props through to the DOM <textarea>, so this lands\n // on the right element on web and is silently ignored on native.\n const resizeStyle = { resize } as unknown as TextStyle;\n const merged = style === undefined ? resizeStyle : [resizeStyle, style];\n return <TextInput multiline numberOfLines={numberOfLines} {...rest} style={merged} />;\n};\n","'use client';\n\n/**\n * Sonner bridge.\n *\n * Strategy: a STATIC `import` of sonner so the consumer's bundler\n * (Next.js / Vite / etc.) resolves the module the way it normally\n * would. Tsup keeps `sonner` external (see tsup.config.ts) so the\n * import survives bundling and the consumer's webpack/rollup pulls in\n * the right copy.\n *\n * `sonner` is web-only — it imports `react-dom`, which is unavailable\n * on a pure-RN Metro bundle. To keep this safe across platforms we\n * gate by `Platform.OS === 'web'` and wrap the static import in a\n * try/catch via a small async-isolated trick: the import is\n * eagerly-resolved at module load, but its identifier may resolve to\n * `undefined` if the consumer marked sonner as `false` in their\n * webpack config (e.g. an Expo + RN-only build that excludes sonner).\n *\n * Userland never branches on Platform.OS — `<Toaster />` renders the\n * sonner Toaster on web and our own Animated viewport on native; the\n * imperative `toast(...)` dispatches to the right one transparently.\n */\n\nimport { Platform } from 'react-native';\nimport * as SonnerModule from 'sonner';\n\ntype Sonner = {\n toast: typeof SonnerModule.toast;\n Toaster: typeof SonnerModule.Toaster;\n};\n\nlet cached: Sonner | null | undefined;\n\nfunction tryLoad(): Sonner | null {\n if (cached !== undefined) {\n return cached;\n }\n if (Platform.OS !== 'web') {\n cached = null;\n return null;\n }\n // `Toaster` is a `forwardRef` exotic, so `typeof === 'function'`\n // would reject a perfectly valid sonner build. Truthy + `toast`\n // callable is the actual contract we need.\n if (typeof SonnerModule.toast !== 'function' || SonnerModule.Toaster == null) {\n cached = null;\n return null;\n }\n cached = { toast: SonnerModule.toast, Toaster: SonnerModule.Toaster };\n return cached;\n}\n\n/** Returns sonner on web, `null` on native or if sonner is unavailable. */\nexport function getSonner(): Sonner | null {\n return tryLoad();\n}\n\n/** Web vs native discriminator — internal to the Toast subsystem. */\nexport const HAS_SONNER: boolean = Platform.OS === 'web';\n","'use client';\n\n// Web stub for the sonner-native bridge. Metro picks\n// `sonner-native-bridge.native.tsx` for RN bundles; web bundles get\n// this no-op so `react-native-gesture-handler` and friends don't end\n// up in the web build. The web Toaster path uses `sonner-bridge.ts`\n// instead.\n\nimport type { ComponentType, ReactNode } from 'react';\n\nexport type SonnerNativeToastOptions = Record<string, unknown>;\nexport type SonnerNativeToastFn = ((message: ReactNode, options?: SonnerNativeToastOptions) => string | number) & {\n success: (message: ReactNode, options?: SonnerNativeToastOptions) => string | number;\n error: (message: ReactNode, options?: SonnerNativeToastOptions) => string | number;\n info: (message: ReactNode, options?: SonnerNativeToastOptions) => string | number;\n warning: (message: ReactNode, options?: SonnerNativeToastOptions) => string | number;\n dismiss: (id?: string | number) => void;\n};\n\nexport type SonnerNativeToaster = ComponentType<Record<string, unknown>>;\n\nexport const HAS_SONNER_NATIVE = false;\nexport function getSonnerNative(): { toast: SonnerNativeToastFn; Toaster: SonnerNativeToaster } | null {\n return null;\n}\n","'use client';\n\nimport { createElement } from 'react';\nimport { Platform } from 'react-native';\nimport { getSonner } from './sonner-bridge';\nimport { getSonnerNative } from './sonner-native-bridge';\nimport type { ToasterPosition, ToasterProps } from './types';\n\n/**\n * Toast viewport. Mount once near the app root; the imperative\n * `toast(...)` function pushes to it.\n *\n * Implementation is platform-split:\n *\n * - Web: delegates to `sonner`'s `<Toaster>` (Emil Kowalski's original).\n * Sonner already handles stacking, expand-on-hover, swipe-to-dismiss\n * on touch screens, position, rich colors, etc.\n *\n * - Native: delegates to `sonner-native`'s `<Toaster>` (Gunnar Torfi's\n * port, built on Reanimated 3 + Gesture Handler). Same behavior:\n * stacked layering with the front toast in focus, tap-to-expand\n * (since hover doesn't exist on touch), swipe up/down to dismiss,\n * slide+fade in/out from the anchored edge. Six positions\n * (top|bottom × left|center|right) align with sonner's positions.\n *\n * Both packages share the imperative `toast(...)` API, which keeps\n * userland identical across platforms.\n */\nexport const Toaster = (props: ToasterProps): ReturnType<typeof createElement> | null => {\n const {\n position = 'top-center',\n visibleToasts = 3,\n duration = 4000,\n closeButton = false,\n richColors = false,\n expand = false,\n offset = 24,\n gap = 14,\n } = props;\n\n if (Platform.OS === 'web') {\n const sonner = getSonner();\n if (!sonner) {\n return null;\n }\n // sonner's Toaster accepts the same prop names we expose. Pass\n // through verbatim — any drift is contained here.\n return createElement(sonner.Toaster as unknown as React.ComponentType<Record<string, unknown>>, {\n position: mapPositionForSonner(position),\n visibleToasts,\n duration,\n closeButton,\n richColors,\n expand,\n offset,\n gap,\n });\n }\n\n const native = getSonnerNative();\n if (!native) {\n return null;\n }\n // sonner-native's Toaster API matches sonner's almost 1:1. The same\n // position strings work, and `visibleToasts`/`expand`/`closeButton`\n // are already wired upstream.\n return createElement(native.Toaster as unknown as React.ComponentType<Record<string, unknown>>, {\n position: mapPositionForSonner(position),\n visibleToasts,\n duration,\n closeButton,\n richColors,\n // On touch the equivalent of hover-to-expand is tap-to-expand,\n // which sonner-native already implements when `expand` is set.\n expand,\n offset,\n gap,\n });\n};\n\nfunction mapPositionForSonner(p: ToasterPosition): string {\n return p;\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { Platform } from 'react-native';\nimport { getSonner, HAS_SONNER } from './sonner-bridge';\nimport { getSonnerNative } from './sonner-native-bridge';\nimport type { ToastOptions, ToastTone } from './types';\n\n/**\n * Imperative toast API.\n *\n * - Web → delegates to `sonner` (Emil Kowalski).\n * - Native → delegates to `sonner-native` (Gunnar Torfi's port).\n *\n * Userland never branches on `Platform.OS` — `toast(...)`, `toast.success(...)`\n * and friends call the right package transparently.\n *\n * Example:\n * ```tsx\n * import { toast, Toaster } from '@nori-ui/core';\n *\n * function App() {\n * return (\n * <>\n * <Button onPress={() => toast.success('Saved')}>Save</Button>\n * <Toaster position=\"top-right\" richColors />\n * </>\n * );\n * }\n * ```\n */\n\ntype ToastId = string | number;\n// Both sonner and sonner-native expose the same callable shape on\n// their `toast` export — default callable plus `success` / `error` /\n// `warning` / `info` / `dismiss` / `promise`. The exact types differ\n// upstream (sonner ships ExternalToast options; sonner-native ships its\n// own option shape), but the runtime contract is identical for our\n// purposes. Use a structural shim and cast at the bridge boundary.\ntype ToastFn = {\n (message: ReactNode, options?: Record<string, unknown>): ToastId;\n success: (message: ReactNode, options?: Record<string, unknown>) => ToastId;\n error: (message: ReactNode, options?: Record<string, unknown>) => ToastId;\n warning: (message: ReactNode, options?: Record<string, unknown>) => ToastId;\n info: (message: ReactNode, options?: Record<string, unknown>) => ToastId;\n dismiss: (id?: ToastId) => void;\n promise: <T>(p: Promise<T>, opts: unknown) => ToastId;\n};\ntype SonnerLike = { toast: ToastFn };\n\nfunction getActive(): SonnerLike | null {\n if (HAS_SONNER) {\n return getSonner() as SonnerLike | null;\n }\n if (Platform.OS !== 'web') {\n return getSonnerNative() as SonnerLike | null;\n }\n return null;\n}\n\n/**\n * Map our cross-platform `tone` to sonner's named methods. Both sonner\n * and sonner-native expose the same `success` / `error` / `warning` /\n * `info` shortcuts plus a default callable, so a single dispatcher\n * works for both.\n */\nfunction dispatch(tone: ToastTone, title: ReactNode, options: ToastOptions): ToastId | undefined {\n const active = getActive();\n if (!active) {\n return undefined;\n }\n const mapped: Record<string, unknown> = { ...options };\n if (options.action) {\n mapped.action = { label: options.action.label, onClick: options.action.onClick };\n }\n if (options.cancel) {\n mapped.cancel = { label: options.cancel.label, onClick: options.cancel.onClick };\n }\n delete mapped.tone;\n switch (tone) {\n case 'success':\n return active.toast.success(title, mapped);\n case 'danger':\n return active.toast.error(title, mapped);\n case 'warning':\n return active.toast.warning(title, mapped);\n case 'info':\n return active.toast.info(title, mapped);\n default:\n return active.toast(title, mapped);\n }\n}\n\nfunction show(title: ReactNode, options: ToastOptions = {}): ToastId {\n const tone: ToastTone = options.tone ?? 'default';\n const id = dispatch(tone, title, options);\n // Both sonner and sonner-native return string|number ids. If the\n // active provider couldn't dispatch (e.g. the package isn't installed\n // on a particular platform), return a synthetic id so the caller's\n // chained `.dismiss(id)` still resolves cleanly.\n return id ?? `nori-toast-${Date.now()}`;\n}\n\nconst toastFn = show as ((title: ReactNode, options?: ToastOptions) => ToastId) & {\n success: (title: ReactNode, options?: ToastOptions) => ToastId;\n error: (title: ReactNode, options?: ToastOptions) => ToastId;\n warning: (title: ReactNode, options?: ToastOptions) => ToastId;\n info: (title: ReactNode, options?: ToastOptions) => ToastId;\n message: (title: ReactNode, options?: ToastOptions) => ToastId;\n dismiss: (id?: ToastId) => void;\n promise: <T>(\n promise: Promise<T> | (() => Promise<T>),\n opts: {\n loading: ReactNode;\n success: ReactNode | ((data: T) => ReactNode);\n error: ReactNode | ((err: unknown) => ReactNode);\n }\n ) => ToastId;\n};\n\ntoastFn.success = (title, options = {}) => show(title, { ...options, tone: 'success' });\ntoastFn.error = (title, options = {}) => show(title, { ...options, tone: 'danger' });\ntoastFn.warning = (title, options = {}) => show(title, { ...options, tone: 'warning' });\ntoastFn.info = (title, options = {}) => show(title, { ...options, tone: 'info' });\ntoastFn.message = (title, options = {}) => show(title, { ...options, tone: 'default' });\n\ntoastFn.dismiss = (id) => {\n const active = getActive();\n if (!active) {\n return;\n }\n if (id === undefined) {\n active.toast.dismiss();\n } else {\n active.toast.dismiss(id);\n }\n};\n\ntoastFn.promise = (promise, opts) => {\n const resolved = typeof promise === 'function' ? promise() : promise;\n const active = getActive();\n if (!active) {\n return `nori-toast-${Date.now()}`;\n }\n return active.toast.promise(resolved, opts) as ToastId;\n};\n\nexport const toast = toastFn;\n","'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type ToggleVariant = 'default' | 'outline';\nexport type ToggleSize = 'sm' | 'md' | 'lg';\n\ntype SizeTokens = {\n height: number; // component-density literal — not from theme\n paddingHKey: keyof Theme['spacing'];\n fontKey: keyof Theme['fontSize'];\n iconSize: number; // component-density literal — not from theme\n};\n\n// Heights and icon sizes are intentionally hardcoded — they're tightly\n// coupled to the toggle's overall density. PaddingH and fontSize are\n// pulled from the active theme so a custom theme that scales the\n// spacing / fontSize ramps also scales every Toggle on the page.\nconst SIZE_TOKENS: Record<ToggleSize, SizeTokens> = {\n sm: { height: 32, paddingHKey: '2', fontKey: 'sm', iconSize: 14 }, // 8px (closest to legacy 10) / fontSize sm 14\n md: { height: 40, paddingHKey: '3', fontKey: 'sm', iconSize: 16 }, // 12px / fontSize sm 14\n lg: { height: 48, paddingHKey: '4', fontKey: 'md', iconSize: 20 }, // 16px / fontSize md 16\n};\n\n// ---------- standalone <Toggle> -----------------------------------------------\n\nexport type ToggleProps = {\n /** Controlled pressed state. Pair with `onChange`. */\n pressed?: boolean;\n /** Uncontrolled initial pressed state. Ignored when `pressed` is provided. */\n defaultPressed?: boolean;\n /** Fires with the next pressed state when the user toggles. */\n onChange?: (next: boolean) => void;\n /**\n * Visual treatment.\n * - `default` — transparent when off, filled with `interactive.primary` when on.\n * - `outline` — bordered when off, tinted background + accent border when on.\n * @defaultValue 'default'\n */\n variant?: ToggleVariant;\n /** @defaultValue 'md' */\n size?: ToggleSize;\n /** Group-level disable (also forwarded by `<ToggleGroup>` to its items). */\n disabled?: boolean;\n /** Visible label or icon content. */\n children?: ReactNode;\n /** Required when `children` is icon-only. */\n 'aria-label'?: string;\n accessibilityLabel?: string;\n className?: string;\n testID?: string;\n};\n\n/**\n * A two-state button — like the bold / italic buttons in a rich-text\n * toolbar. Use `<Toggle>` standalone for a single bistable action; reach\n * for `<ToggleGroup>` when you need a clustered set with shared selection\n * semantics.\n *\n * Reach for `<Switch>` instead when the control flips a setting in a form\n * (a \"darkmode on/off\" preference). Reach for `<Checkbox>` when the\n * control selects a value inside a form. `<Toggle>` is for buttons that\n * carry an on/off visual.\n */\nconst ToggleRoot = ({\n pressed,\n defaultPressed = false,\n onChange,\n variant = 'default',\n size = 'md',\n disabled = false,\n children,\n 'aria-label': ariaLabel,\n accessibilityLabel,\n className,\n testID,\n}: ToggleProps) => {\n const [inner, setInner] = useState<boolean>(defaultPressed);\n const isControlled = pressed !== undefined;\n const isOn = isControlled ? Boolean(pressed) : inner;\n\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n const next = !isOn;\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n }, [disabled, isControlled, isOn, onChange]);\n\n return (\n <ToggleVisual\n isOn={isOn}\n disabled={disabled}\n variant={variant}\n size={size}\n onPress={handlePress}\n ariaLabel={ariaLabel ?? accessibilityLabel}\n className={className}\n testID={testID}\n >\n {children}\n </ToggleVisual>\n );\n};\n\n// ---------- shared visual -----------------------------------------------------\n\ntype ToggleVisualProps = {\n isOn: boolean;\n disabled: boolean;\n variant: ToggleVariant;\n size: ToggleSize;\n onPress: () => void;\n onKeyDown?: ((event: KeyboardEvent<HTMLElement>) => void) | undefined;\n onFocus?: (() => void) | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n testID?: string | undefined;\n children?: ReactNode | undefined;\n /**\n * Group-aware roving tabindex. `undefined` means \"the natural tab\n * stop\" (standalone Toggle); inside a group, a number is supplied.\n */\n tabIndex?: number | undefined;\n /** Border-radius override for grouped items (square middle, rounded ends). */\n borderRadius?: number | { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number } | undefined;\n /** Suppress the right border so adjacent items share a single seam. */\n suppressRightBorder?: boolean | undefined;\n /** Force the bordered look (used by grouped `default` items so the row reads as one chip). */\n forceBorder?: boolean | undefined;\n refCallback?: ((node: HTMLElement | null) => void) | undefined;\n};\n\nconst ToggleVisual = ({\n isOn,\n disabled,\n variant,\n size,\n onPress,\n onKeyDown,\n onFocus,\n ariaLabel,\n className,\n testID,\n children,\n tabIndex,\n borderRadius,\n suppressRightBorder,\n forceBorder,\n refCallback,\n}: ToggleVisualProps) => {\n const colors = useThemeColors();\n const tokens = SIZE_TOKENS[size];\n const paddingH = px(colors.spacing[tokens.paddingHKey]);\n const fontSize = px(colors.fontSize[tokens.fontKey]);\n\n const radiusEach = borderRadius && typeof borderRadius !== 'number' ? borderRadius : undefined;\n const radiusValue = typeof borderRadius === 'number' ? borderRadius : radiusEach ? undefined : px(colors.radius.md);\n\n const baseStyle: ViewStyle = {\n height: tokens.height,\n paddingHorizontal: paddingH,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: px(colors.spacing['2']) - 2, // closest theme-rooted approximation of legacy 6\n ...(radiusValue !== undefined ? { borderRadius: radiusValue } : null),\n ...(radiusEach\n ? {\n borderTopLeftRadius: radiusEach.topLeft,\n borderTopRightRadius: radiusEach.topRight,\n borderBottomLeftRadius: radiusEach.bottomLeft,\n borderBottomRightRadius: radiusEach.bottomRight,\n }\n : null),\n // 200ms color/background transition. Web only; native ignores it.\n ...({\n transitionProperty: 'background-color, border-color, color',\n transitionDuration: '200ms',\n transitionTimingFunction: 'ease',\n } as ViewStyle),\n };\n\n const surfaceFor = (hovered: boolean): ViewStyle => {\n if (variant === 'outline' || forceBorder) {\n return {\n backgroundColor: isOn\n ? variant === 'outline'\n ? colors.semantic.background.subtle\n : colors.semantic.interactive.primary\n : hovered\n ? colors.semantic.background.subtle\n : 'transparent',\n borderWidth: 1,\n borderColor: isOn ? colors.semantic.interactive.primary : colors.semantic.border.default,\n ...(suppressRightBorder ? { borderRightWidth: 0 } : null),\n };\n }\n // Default variant, standalone — give the off state a subtle\n // resting bg + 1px border so the control reads as a button. The\n // earlier \"transparent off\" look only made sense inside a group\n // where the cluster's shared seams told the eye \"this is a row of\n // buttons\"; standalone it just looked like text.\n return {\n backgroundColor: isOn\n ? colors.semantic.interactive.primary\n : hovered\n ? colors.semantic.background.subtle\n : colors.semantic.background.elevated,\n borderWidth: 1,\n borderColor: isOn ? colors.semantic.interactive.primary : colors.semantic.border.default,\n };\n };\n\n // Text color: inverted on the filled-on surface, accent-colored on the\n // outline-on surface, default text otherwise.\n const textColor =\n variant === 'outline'\n ? isOn\n ? colors.semantic.interactive.primary\n : colors.semantic.text.default\n : isOn\n ? colors.semantic.text.inverted\n : colors.semantic.text.default;\n\n const accessibilityProps: Record<string, unknown> = {\n role: 'button',\n accessibilityRole: 'button',\n 'aria-pressed': isOn,\n accessibilityState: { selected: isOn, disabled },\n ...(ariaLabel ? { 'aria-label': ariaLabel, accessibilityLabel: ariaLabel } : {}),\n ...(disabled ? { 'aria-disabled': true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n ...(tabIndex !== undefined ? { tabIndex } : {}),\n ...(onKeyDown ? { onKeyDown } : {}),\n ...(onFocus ? { onFocus } : {}),\n };\n\n // RN-Web's Pressable on web doesn't reliably invoke the style callback\n // (the hovered/pressed state isn't always wired through to a re-render\n // — at least in the version we ship against). Compute the static style\n // upfront with `hovered=false` and overlay a `:hover` color via CSS\n // class for the off-state hover. Active-state hover is for outline\n // variant only and doesn't change the look enough to justify the\n // complexity of a style-callback path here.\n const surfaceStatic = surfaceFor(false);\n\n return (\n <Pressable\n ref={(node: unknown) => {\n refCallback?.(node as HTMLElement | null);\n }}\n disabled={disabled}\n onPress={() => {\n if (!disabled) {\n onPress();\n }\n }}\n {...accessibilityProps}\n className={cn(\n 'inline-flex flex-row items-center justify-center select-none',\n disabled ? 'opacity-50' : undefined,\n className\n )}\n style={[baseStyle, surfaceStatic, disabled ? { opacity: 0.5 } : null]}\n >\n {/* Always wrap children in an RNText so the dynamic\n * `textColor` (inverted on the on-state surface, default\n * otherwise) reaches both string children and arbitrary\n * inline elements (B/I/U spans, lucide icons, etc.) via\n * CSS color inheritance. Without this wrapper, non-string\n * children render with their parent's color regardless of\n * selected state — so an italic \"I\" stays dark on the\n * dark filled-on background and disappears.\n */}\n <RNText\n style={{\n color: textColor,\n fontFamily: colors.fontFamily.body,\n fontSize,\n fontWeight: colors.fontWeight.medium as '500',\n }}\n >\n {children}\n </RNText>\n </Pressable>\n );\n};\n\n// ---------- <ToggleGroup> + context ------------------------------------------\n\ntype ToggleGroupContextValue = {\n type: 'single' | 'multiple';\n setValue: (value: string) => void;\n isPressed: (value: string) => boolean;\n disabled: boolean;\n variant: ToggleVariant;\n size: ToggleSize;\n register: (value: string, ref: RefObject<HTMLElement | null>) => void;\n unregister: (value: string) => void;\n rovingValue: string | undefined;\n setRovingValue: (next: string) => void;\n moveBy: (delta: 1 | -1, current: string) => void;\n moveTo: (position: 'first' | 'last') => void;\n /** Live ordered list of registered item values — drives border math. */\n order: string[];\n};\n\nconst ToggleGroupContext = createContext<ToggleGroupContextValue | null>(null);\n\nconst useToggleGroupContext = () => {\n const ctx = useContext(ToggleGroupContext);\n if (!ctx) {\n throw new Error('<ToggleGroupItem> must be rendered inside a <ToggleGroup>.');\n }\n return ctx;\n};\n\ntype ToggleGroupCommonProps = {\n /** Group-level disable. Each item's `disabled` is OR-ed with this. */\n disabled?: boolean;\n /** @defaultValue 'default' */\n variant?: ToggleVariant;\n /** @defaultValue 'md' */\n size?: ToggleSize;\n children?: ReactNode;\n className?: string;\n testID?: string;\n 'aria-label'?: string;\n accessibilityLabel?: string;\n};\n\nexport type ToggleGroupSingleProps = ToggleGroupCommonProps & {\n /** Multi-select gives an array; single-select gives a string (or undefined). */\n type: 'single';\n // `| undefined` is intentional under exactOptionalPropertyTypes — clicking\n // the active item clears the selection, so consumers MUST be allowed to\n // pass `undefined` as the controlled value, not just omit the prop.\n value?: string | undefined;\n defaultValue?: string | undefined;\n onChange?: (next: string | undefined) => void;\n};\n\nexport type ToggleGroupMultipleProps = ToggleGroupCommonProps & {\n type: 'multiple';\n value?: string[] | undefined;\n defaultValue?: string[] | undefined;\n onChange?: (next: string[]) => void;\n};\n\nexport type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;\n\n/**\n * Cluster of `<ToggleGroupItem>`s with shared selection semantics.\n *\n * - `type=\"multiple\"` — value is `string[]`. Clicking toggles a value\n * in/out of the array. ARIA exposes a plain `role=\"group\"`.\n * - `type=\"single\"` — value is `string | undefined`. Clicking sets it;\n * re-clicking the active one clears it. ARIA exposes `role=\"radiogroup\"`\n * so AT users hear \"1 of N selected\" semantics.\n *\n * Keyboard: `ArrowRight` / `ArrowLeft` move focus between items (roving\n * tabindex), `Home` / `End` jump to the ends, and `Space` / `Enter`\n * toggle the focused item.\n */\nexport const ToggleGroup = (props: ToggleGroupProps) => {\n const {\n type,\n disabled = false,\n variant = 'default',\n size = 'md',\n children,\n className,\n testID,\n 'aria-label': ariaLabel,\n accessibilityLabel,\n } = props;\n\n // Controlled / uncontrolled state, branching on `type`.\n const [innerSingle, setInnerSingle] = useState<string | undefined>(\n type === 'single' ? (props as ToggleGroupSingleProps).defaultValue : undefined\n );\n const [innerMultiple, setInnerMultiple] = useState<string[]>(\n type === 'multiple' ? ((props as ToggleGroupMultipleProps).defaultValue ?? []) : []\n );\n\n const isSingle = type === 'single';\n const isControlled = isSingle\n ? (props as ToggleGroupSingleProps).value !== undefined\n : (props as ToggleGroupMultipleProps).value !== undefined;\n\n const setValue = useCallback(\n (next: string) => {\n if (disabled) {\n return;\n }\n if (isSingle) {\n const current = isControlled ? (props as ToggleGroupSingleProps).value : innerSingle;\n const updated = current === next ? undefined : next;\n if (!isControlled) {\n setInnerSingle(updated);\n }\n (props as ToggleGroupSingleProps).onChange?.(updated);\n } else {\n const current: string[] =\n (isControlled ? (props as ToggleGroupMultipleProps).value : innerMultiple) ?? [];\n const updated = current.includes(next) ? current.filter((v) => v !== next) : [...current, next];\n if (!isControlled) {\n setInnerMultiple(updated);\n }\n (props as ToggleGroupMultipleProps).onChange?.(updated);\n }\n },\n [disabled, isSingle, isControlled, innerSingle, innerMultiple, props]\n );\n\n const isPressed = useCallback(\n (v: string) => {\n if (isSingle) {\n const current = isControlled ? (props as ToggleGroupSingleProps).value : innerSingle;\n return current === v;\n }\n const current = (isControlled ? (props as ToggleGroupMultipleProps).value : innerMultiple) ?? [];\n return current.includes(v);\n },\n [isSingle, isControlled, innerSingle, innerMultiple, props]\n );\n\n // --- roving tabindex order management ---\n const refs = useRef<Map<string, RefObject<HTMLElement | null>>>(new Map());\n // Live ordered list — re-render the group whenever items register so\n // border math (first/last) and roving init see the current order.\n const [order, setOrder] = useState<string[]>([]);\n const [rovingValue, setRovingValueState] = useState<string | undefined>(undefined);\n\n const register = useCallback((v: string, ref: RefObject<HTMLElement | null>) => {\n refs.current.set(v, ref);\n setOrder((prev) => (prev.includes(v) ? prev : [...prev, v]));\n setRovingValueState((current) => current ?? v);\n }, []);\n\n const unregister = useCallback((v: string) => {\n refs.current.delete(v);\n setOrder((prev) => prev.filter((x) => x !== v));\n setRovingValueState((current) => (current === v ? undefined : current));\n }, []);\n\n const focusValue = useCallback((v: string) => {\n refs.current.get(v)?.current?.focus?.();\n }, []);\n\n const setRovingValue = useCallback((v: string) => setRovingValueState(v), []);\n\n const moveBy = useCallback(\n (delta: 1 | -1, current: string) => {\n const list = order;\n if (list.length === 0) {\n return;\n }\n const idx = list.indexOf(current);\n const start = idx === -1 ? 0 : idx;\n const next = list[(start + delta + list.length) % list.length];\n if (!next) {\n return;\n }\n setRovingValueState(next);\n focusValue(next);\n },\n [order, focusValue]\n );\n\n const moveTo = useCallback(\n (position: 'first' | 'last') => {\n const list = order;\n if (list.length === 0) {\n return;\n }\n const next = position === 'first' ? list[0] : list[list.length - 1];\n if (!next) {\n return;\n }\n setRovingValueState(next);\n focusValue(next);\n },\n [order, focusValue]\n );\n\n const ctxValue = useMemo<ToggleGroupContextValue>(\n () => ({\n type,\n setValue,\n isPressed,\n disabled,\n variant,\n size,\n register,\n unregister,\n rovingValue,\n setRovingValue,\n moveBy,\n moveTo,\n order,\n }),\n [\n type,\n setValue,\n isPressed,\n disabled,\n variant,\n size,\n register,\n unregister,\n rovingValue,\n setRovingValue,\n moveBy,\n moveTo,\n order,\n ]\n );\n\n const groupRole = isSingle ? 'radiogroup' : 'group';\n const label = ariaLabel ?? accessibilityLabel;\n\n const groupProps: Record<string, unknown> = {\n role: groupRole,\n accessibilityRole: groupRole,\n ...(label ? { 'aria-label': label, accessibilityLabel: label } : {}),\n ...(disabled ? { 'aria-disabled': true } : {}),\n ...(testID !== undefined ? { testID } : {}),\n };\n\n // For the `default` variant we render items zero-gap so they share\n // borders, like a UISegmentedControl. For `outline` we keep a small\n // gap so the bordered cells don't double up their seams.\n const colors = useThemeColors();\n const containerStyle: ViewStyle =\n variant === 'default'\n ? { flexDirection: 'row', alignItems: 'stretch', gap: 0 }\n : { flexDirection: 'row', alignItems: 'stretch', gap: px(colors.spacing['1']) };\n\n return (\n <ToggleGroupContext.Provider value={ctxValue}>\n <View\n {...groupProps}\n className={cn(\n 'inline-flex flex-row items-stretch',\n variant === 'default' ? 'gap-0' : 'gap-1',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={[containerStyle, disabled ? { opacity: 0.6 } : null]}\n >\n {children}\n </View>\n </ToggleGroupContext.Provider>\n );\n};\n\nexport type ToggleGroupItemProps = {\n /** Unique identifier within the group — written into `value` when pressed. */\n value: string;\n /** Disable just this item (OR-ed with group-level `disabled`). */\n disabled?: boolean;\n children?: ReactNode;\n 'aria-label'?: string;\n accessibilityLabel?: string;\n className?: string;\n testID?: string;\n};\n\n/**\n * One toggle inside a `<ToggleGroup>`. Throws with a clear message when\n * rendered outside of one.\n */\nexport const ToggleGroupItem = ({\n value,\n disabled,\n children,\n 'aria-label': ariaLabel,\n accessibilityLabel,\n className,\n testID,\n}: ToggleGroupItemProps) => {\n const ctx = useToggleGroupContext();\n const ownRef = useRef<HTMLElement | null>(null);\n // Capture register/unregister in a ref so the effect's deps stay\n // value-only — otherwise a new context object on every render (driven\n // by setOrder inside register) would re-fire the effect → setState\n // loop → \"Maximum update depth exceeded\".\n const registryRef = useRef({ register: ctx.register, unregister: ctx.unregister });\n registryRef.current = { register: ctx.register, unregister: ctx.unregister };\n\n useEffect(() => {\n // Read-through holder so the registered ref always sees the latest node.\n const holder: RefObject<HTMLElement | null> = {\n get current() {\n return ownRef.current;\n },\n set current(_v) {\n /* no-op — read-through to ownRef */\n },\n } as unknown as RefObject<HTMLElement | null>;\n registryRef.current.register(value, holder);\n return () => registryRef.current.unregister(value);\n }, [value]);\n\n const isOn = ctx.isPressed(value);\n const isDisabled = disabled || ctx.disabled;\n const isRoving = ctx.rovingValue === value;\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown': {\n event.preventDefault();\n ctx.moveBy(1, value);\n return;\n }\n case 'ArrowLeft':\n case 'ArrowUp': {\n event.preventDefault();\n ctx.moveBy(-1, value);\n return;\n }\n case 'Home': {\n event.preventDefault();\n ctx.moveTo('first');\n return;\n }\n case 'End': {\n event.preventDefault();\n ctx.moveTo('last');\n return;\n }\n case ' ':\n case 'Enter': {\n event.preventDefault();\n if (!isDisabled) {\n ctx.setValue(value);\n }\n return;\n }\n }\n },\n [ctx, isDisabled, value]\n );\n\n const handleFocus = useCallback(() => {\n ctx.setRovingValue(value);\n }, [ctx, value]);\n\n // Items inside a `default`-variant group share borders: only the first\n // rounds the left, the last rounds the right; everything else is square.\n const colors = useThemeColors();\n const idx = ctx.order.indexOf(value);\n const isFirst = idx === 0;\n const isLast = idx === ctx.order.length - 1;\n const sharedRadius = px(colors.radius.md);\n const isClustered = ctx.order.length > 1;\n const borderRadius = isClustered\n ? {\n topLeft: isFirst ? sharedRadius : 0,\n bottomLeft: isFirst ? sharedRadius : 0,\n topRight: isLast ? sharedRadius : 0,\n bottomRight: isLast ? sharedRadius : 0,\n }\n : sharedRadius;\n\n return (\n <ToggleVisual\n isOn={isOn}\n disabled={Boolean(isDisabled)}\n variant={ctx.variant}\n size={ctx.size}\n onPress={() => ctx.setValue(value)}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n ariaLabel={ariaLabel ?? accessibilityLabel}\n className={className}\n testID={testID}\n tabIndex={isRoving ? 0 : -1}\n borderRadius={borderRadius}\n forceBorder={ctx.variant === 'default' && isClustered}\n suppressRightBorder={isClustered && !isLast}\n refCallback={(node) => {\n ownRef.current = node;\n }}\n >\n {children}\n </ToggleVisual>\n );\n};\n\n/**\n * Public `Toggle` value — the standalone toggle plus its `.Group` and `.Item`\n * static members. Use `<Toggle.Group>` to wrap a list of `<Toggle.Item>`s.\n *\n * `Object.assign` produces a value whose inferred type carries the static\n * properties, so `.d.ts` consumers can write `<Toggle.Group>` without a\n * separate import.\n */\nexport const Toggle = Object.assign(ToggleRoot, {\n Group: ToggleGroup,\n Item: ToggleGroupItem,\n});\n","'use client';\n\nimport {\n createContext,\n isValidElement,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type TooltipSide = 'top' | 'right' | 'bottom' | 'left';\nexport type TooltipAlign = 'start' | 'center' | 'end';\n\ntype TriggerRect = { top: number; left: number; width: number; height: number };\n\ntype TooltipContextValue = {\n open: boolean;\n setOpen: (next: boolean) => void;\n /** Open after `delayMs` if still hovered/focused. */\n requestOpen: () => void;\n /** Close after `closeDelayMs`; cancellable. */\n requestClose: () => void;\n /** Cancel any pending open/close timers (e.g. when re-entering). */\n cancelTimers: () => void;\n contentId: string;\n triggerRef: { current: HTMLElement | null };\n contentRef: { current: HTMLDivElement | null };\n triggerRect: TriggerRect | null;\n measureTrigger: () => void;\n};\n\nconst TooltipContext = createContext<TooltipContextValue | null>(null);\n\nconst useTooltipContext = (label: string): TooltipContextValue => {\n const ctx = useContext(TooltipContext);\n if (!ctx) {\n throw new Error(`<${label}> must be rendered inside a <Tooltip>.`);\n }\n return ctx;\n};\n\nconst DEFAULT_OPEN_DELAY_MS = 500;\nconst DEFAULT_CLOSE_DELAY_MS = 0;\n/** Long-press duration on native — matches platform defaults (iOS ~500ms). */\nconst LONG_PRESS_MS = 500;\n\nexport type TooltipProps = {\n /** Controlled open state. */\n open?: boolean;\n /** Uncontrolled initial open state. @defaultValue false */\n defaultOpen?: boolean;\n /** Fires with the new open state. */\n onOpenChange?: (open: boolean) => void;\n /**\n * Delay before the tooltip opens after hover/focus.\n * @defaultValue 500\n */\n delayMs?: number;\n /**\n * Delay before the tooltip closes after hover-out / blur. Useful for\n * giving users time to move into the tooltip if it ever becomes\n * interactive (it shouldn't — use Popover for that — but the knob is\n * here so the API matches Radix).\n * @defaultValue 0\n */\n closeDelayMs?: number;\n children?: ReactNode;\n};\n\n/**\n * Small floating label triggered by hover (web) or long-press (native).\n * Use for short contextual hints — most often on icon-only buttons. NOT\n * for rich interactive content; reach for `Popover` when the surface\n * needs to hold buttons, inputs, or links.\n *\n * Composition: `Tooltip` (root, owns open state and timers),\n * `TooltipTrigger` (forwards events to its child via Slot when\n * `asChild`), `TooltipContent` (the floating label).\n *\n * Accessibility: the trigger gets `aria-describedby` pointing at the\n * content id — tooltips augment the trigger's accessible name, they do\n * NOT replace it. The icon-only button still needs an `aria-label`.\n *\n * Behavior:\n * - Open on hover (web mouseover) or focus, after `delayMs`.\n * - Close on hover-out, blur, or Escape.\n * - Native: long-press the trigger (500ms) to reveal; tap-anywhere or\n * re-press to dismiss.\n *\n * Cross-platform: web renders the content inline with `position: fixed`\n * + a measured trigger rect so it escapes any ancestor `overflow:\n * hidden`. Native renders inline with `position: absolute` — the parent\n * needs to allow overflow for the chip to peek out.\n */\nconst TooltipRoot = ({\n open,\n defaultOpen = false,\n onOpenChange,\n delayMs = DEFAULT_OPEN_DELAY_MS,\n closeDelayMs = DEFAULT_CLOSE_DELAY_MS,\n children,\n}: TooltipProps) => {\n const [inner, setInner] = useState<boolean>(defaultOpen);\n const isControlled = open !== undefined;\n const current = isControlled ? open : inner;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) {\n setInner(next);\n }\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange]\n );\n\n // Open / close timers. Both are cleared on unmount and on every new\n // request — so rapid hover-in / hover-out doesn't leave a stale timer\n // about to flip state after the user has moved on.\n const openTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const cancelTimers = useCallback(() => {\n if (openTimer.current) {\n clearTimeout(openTimer.current);\n openTimer.current = null;\n }\n if (closeTimer.current) {\n clearTimeout(closeTimer.current);\n closeTimer.current = null;\n }\n }, []);\n\n const requestOpen = useCallback(() => {\n if (closeTimer.current) {\n clearTimeout(closeTimer.current);\n closeTimer.current = null;\n }\n if (openTimer.current) {\n return;\n }\n if (delayMs <= 0) {\n setOpen(true);\n return;\n }\n openTimer.current = setTimeout(() => {\n openTimer.current = null;\n setOpen(true);\n }, delayMs);\n }, [delayMs, setOpen]);\n\n const requestClose = useCallback(() => {\n if (openTimer.current) {\n clearTimeout(openTimer.current);\n openTimer.current = null;\n }\n if (closeTimer.current) {\n return;\n }\n if (closeDelayMs <= 0) {\n setOpen(false);\n return;\n }\n closeTimer.current = setTimeout(() => {\n closeTimer.current = null;\n setOpen(false);\n }, closeDelayMs);\n }, [closeDelayMs, setOpen]);\n\n useEffect(() => () => cancelTimers(), [cancelTimers]);\n\n const baseId = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n // Measure the trigger so the content can render with `position: fixed` +\n // computed coords. position:fixed escapes any ancestor's overflow:hidden\n // (e.g. fumadocs Tabs panes, our Preview frame), which is the single\n // biggest source of \"the tooltip got cut off\" bugs.\n const [triggerRect, setTriggerRect] = useState<TriggerRect | null>(null);\n const measureTrigger = useCallback(() => {\n const node = triggerRef.current;\n if (!node || typeof node.getBoundingClientRect !== 'function') {\n return;\n }\n const rect = node.getBoundingClientRect();\n setTriggerRect({ top: rect.top, left: rect.left, width: rect.width, height: rect.height });\n }, []);\n\n const ctxValue: TooltipContextValue = {\n open: current,\n setOpen,\n requestOpen,\n requestClose,\n cancelTimers,\n contentId: `${baseId}-content`,\n triggerRef,\n contentRef,\n triggerRect,\n measureTrigger,\n };\n\n return <TooltipContext.Provider value={ctxValue}>{children}</TooltipContext.Provider>;\n};\n\nexport type TooltipTriggerProps = {\n /** Render the child as the trigger (Slot pattern). Default true — pass `false` for an inline pressable. */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * Element that reveals the tooltip. Uses `asChild` by default so any\n * element (Button, IconButton, custom Pressable) becomes the trigger.\n *\n * Wires `aria-describedby` to the content's id — assistive tech reads\n * the tooltip text in addition to the trigger's own accessible name.\n *\n * Web: opens on `mouseEnter` and `focus`; closes on `mouseLeave` and\n * `blur`, both honoring the configured delays. Native: opens on\n * `onLongPress` (500ms hold) and closes on the next press anywhere.\n */\nexport const TooltipTrigger = ({ asChild = true, children, className, testID }: TooltipTriggerProps) => {\n const ctx = useTooltipContext('TooltipTrigger');\n\n const handleMouseEnter = useCallback(() => {\n ctx.measureTrigger();\n ctx.requestOpen();\n }, [ctx]);\n const handleMouseLeave = useCallback(() => {\n ctx.requestClose();\n }, [ctx]);\n const handleFocus = useCallback(() => {\n ctx.measureTrigger();\n ctx.requestOpen();\n }, [ctx]);\n const handleBlur = useCallback(() => {\n ctx.requestClose();\n }, [ctx]);\n const handleLongPress = useCallback(() => {\n ctx.measureTrigger();\n ctx.setOpen(true);\n }, [ctx]);\n const handlePress = useCallback(() => {\n // Native: tap (after a long-press has revealed it) dismisses.\n if (Platform.OS !== 'web' && ctx.open) {\n ctx.setOpen(false);\n }\n }, [ctx]);\n\n if (asChild && isValidElement(children)) {\n const child = children as ReactElement<Record<string, unknown>>;\n // Compose the wrapped child's existing handlers with ours so any\n // app-level onClick / onFocus / onPress still fires. The tooltip\n // event runs AFTER the child's so consumer code wins on conflict.\n const compose =\n <T,>(existing: ((e: T) => void) | undefined, next: (e: T) => void) =>\n (event: T) => {\n existing?.(event);\n next(event);\n };\n return (\n <Slot\n ref={(node: HTMLElement | null) => {\n ctx.triggerRef.current = node;\n }}\n onMouseEnter={compose(child.props.onMouseEnter as ((e: unknown) => void) | undefined, handleMouseEnter)}\n onMouseLeave={compose(child.props.onMouseLeave as ((e: unknown) => void) | undefined, handleMouseLeave)}\n onFocus={compose(child.props.onFocus as ((e: unknown) => void) | undefined, handleFocus)}\n onBlur={compose(child.props.onBlur as ((e: unknown) => void) | undefined, handleBlur)}\n {...(Platform.OS !== 'web'\n ? {\n onLongPress: compose(\n child.props.onLongPress as ((e: unknown) => void) | undefined,\n handleLongPress\n ),\n onPress: compose(child.props.onPress as ((e: unknown) => void) | undefined, handlePress),\n delayLongPress: LONG_PRESS_MS,\n }\n : {})}\n aria-describedby={ctx.open ? ctx.contentId : undefined}\n {...(testID !== undefined ? { 'data-testid': testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {child}\n </Slot>\n );\n }\n\n return (\n <Pressable\n ref={(node) => {\n ctx.triggerRef.current = node as unknown as HTMLElement | null;\n }}\n {...(Platform.OS !== 'web'\n ? { onLongPress: handleLongPress, onPress: handlePress, delayLongPress: LONG_PRESS_MS }\n : {})}\n {...({\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n 'aria-describedby': ctx.open ? ctx.contentId : undefined,\n } as Record<string, unknown>)}\n {...(testID !== undefined ? { testID } : {})}\n {...(className !== undefined ? { className } : {})}\n >\n {wrapStringChildren(children)}\n </Pressable>\n );\n};\n\n// On native, raw strings rendered as children of a non-Text component\n// throw \"Text strings must be rendered within a <Text> component\". On\n// web, react-native-web silently tolerates it. Wrap any string/number\n// children in an RNText so the same JSX renders cleanly on both\n// platforms. Non-string children are passed through unchanged.\nfunction wrapStringChildren(children: ReactNode): ReactNode {\n if (typeof children === 'string' || typeof children === 'number') {\n return <RNText>{children}</RNText>;\n }\n return children;\n}\n\nconst GAP = 4; // visual gap between trigger and content\nconst MIN_WIDTH = 0; // tooltips hug their text — no enforced minimum\n\nfunction computePosition(\n rect: TriggerRect,\n side: TooltipSide,\n align: TooltipAlign,\n contentSize: { width: number; height: number } | null\n): { top: number; left: number } {\n const cw = contentSize?.width ?? MIN_WIDTH;\n const ch = contentSize?.height ?? 0;\n\n let top = 0;\n let left = 0;\n\n switch (side) {\n case 'top':\n top = rect.top - GAP - ch;\n break;\n case 'bottom':\n top = rect.top + rect.height + GAP;\n break;\n case 'left':\n left = rect.left - GAP - cw;\n break;\n case 'right':\n left = rect.left + rect.width + GAP;\n break;\n }\n\n if (side === 'top' || side === 'bottom') {\n switch (align) {\n case 'start':\n left = rect.left;\n break;\n case 'center':\n left = rect.left + rect.width / 2 - cw / 2;\n break;\n case 'end':\n left = rect.left + rect.width - cw;\n break;\n }\n } else {\n switch (align) {\n case 'start':\n top = rect.top;\n break;\n case 'center':\n top = rect.top + rect.height / 2 - ch / 2;\n break;\n case 'end':\n top = rect.top + rect.height - ch;\n break;\n }\n }\n\n return { top, left };\n}\n\nexport type TooltipContentProps = {\n /** Side of the trigger to anchor on. @defaultValue 'top' */\n side?: TooltipSide;\n /** Alignment along the trigger edge. @defaultValue 'center' */\n align?: TooltipAlign;\n children?: ReactNode;\n className?: string;\n testID?: string;\n};\n\n/**\n * The floating tooltip surface. Renders only while open. On web uses\n * `position: fixed` with a measured trigger rect so it escapes any\n * ancestor `overflow: hidden`.\n *\n * ARIA: `role=\"tooltip\"` plus a unique id that the trigger's\n * `aria-describedby` points at.\n */\nexport const TooltipContent = ({\n side = 'top',\n align = 'center',\n children,\n className,\n testID,\n}: TooltipContentProps) => {\n const ctx = useTooltipContext('TooltipContent');\n const colors = useThemeColors();\n\n // Measure content size after first paint so we can anchor `top`-side\n // tooltips (which need to know content height to render above the trigger).\n const [contentSize, setContentSize] = useState<{ width: number; height: number } | null>(null);\n\n // Direct DOM ref for the entrance animation. We poke `transform`,\n // `opacity`, and `transition` straight onto node.style instead of\n // passing them through `<View style>`, because rn-web's style filter\n // drops keys it doesn't recognize as RN style props (`transitionProperty`,\n // `transitionDuration`, etc.) — so any style fragment containing them\n // gets discarded entirely. Same pattern as the Dialog backdrop-blur fix.\n const domRef = useRef<HTMLDivElement | null>(null);\n const [entered, setEntered] = useState(false);\n\n // Web-only: Escape closes. Re-measure trigger on resize/scroll so the\n // chip stays anchored during page motion.\n useEffect(() => {\n if (!ctx.open) {\n return;\n }\n if (Platform.OS !== 'web') {\n return;\n }\n if (typeof document === 'undefined') {\n return;\n }\n\n ctx.measureTrigger();\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n ctx.setOpen(false);\n }\n };\n const onResize = () => ctx.measureTrigger();\n const onScroll = () => ctx.measureTrigger();\n\n document.addEventListener('keydown', onKeyDown);\n window.addEventListener('resize', onResize);\n window.addEventListener('scroll', onScroll, true);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n window.removeEventListener('resize', onResize);\n window.removeEventListener('scroll', onScroll, true);\n };\n }, [ctx.open, ctx.measureTrigger, ctx.setOpen]);\n\n // Reset measured size and entrance flag when tooltip closes so a\n // reopen re-measures and re-animates fresh.\n useEffect(() => {\n if (!ctx.open) {\n setContentSize(null);\n setEntered(false);\n }\n }, [ctx.open]);\n\n // Entrance animation. On the first paint we render at scale(0.95) +\n // opacity 0; the next frame we flip the styles to scale(1) + opacity\n // 1, and the CSS transition handles the in-between. Web only —\n // native renders without animation (an animated mount on RN would\n // require Reanimated for negligible visual gain on a hint chip).\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n if (!ctx.open) {\n return;\n }\n const node = domRef.current;\n if (!node) {\n return;\n }\n // Initial values — explicitly set so the first frame is at the\n // pre-entrance state regardless of inherited styles.\n node.style.transformOrigin = 'center';\n node.style.transitionProperty = 'opacity, transform';\n node.style.transitionDuration = '100ms';\n node.style.transitionTimingFunction = 'ease-out';\n node.style.opacity = entered ? '1' : '0';\n node.style.transform = entered ? 'scale(1)' : 'scale(0.95)';\n }, [ctx.open, entered]);\n\n // Kick off the transition on the next frame after mount.\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n if (!ctx.open) {\n return;\n }\n const id = requestAnimationFrame(() => setEntered(true));\n return () => cancelAnimationFrame(id);\n }, [ctx.open]);\n\n if (!ctx.open) {\n return null;\n }\n\n const position = ctx.triggerRect ? computePosition(ctx.triggerRect, side, align, contentSize) : null;\n\n const contentBaseStyle: ViewStyle = {\n borderRadius: px(colors.radius.md),\n backgroundColor: colors.semantic.text.default,\n paddingVertical: px(colors.spacing['2']) - 2, // closest theme-rooted approximation of legacy 6\n paddingHorizontal: px(colors.spacing['2']),\n ...(Platform.OS === 'web'\n ? ({\n boxShadow: '0 4px 6px -2px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06)',\n } as ViewStyle)\n : { elevation: 4 }),\n };\n\n const positionedStyle: ViewStyle =\n Platform.OS === 'web'\n ? position\n ? ({\n position: 'fixed' as unknown as 'absolute',\n top: position.top,\n left: position.left,\n zIndex: 60,\n } as ViewStyle)\n : ({\n // Trigger not yet measured — render off-screen for a\n // frame to avoid a flash at (0,0).\n position: 'fixed' as unknown as 'absolute',\n top: -9999,\n left: -9999,\n zIndex: 60,\n } as ViewStyle)\n : ({\n // Native: rely on the parent allowing overflow. We anchor\n // by absolute positioning relative to wherever the\n // tooltip is mounted in the tree (typically right next\n // to the trigger).\n position: 'absolute',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n } as ViewStyle);\n\n return (\n <View\n ref={(node) => {\n ctx.contentRef.current = node as unknown as HTMLDivElement | null;\n domRef.current = node as unknown as HTMLDivElement | null;\n if (Platform.OS !== 'web') {\n return;\n }\n if (!node) {\n return;\n }\n if (typeof (node as unknown as HTMLDivElement).getBoundingClientRect !== 'function') {\n return;\n }\n const rect = (node as unknown as HTMLDivElement).getBoundingClientRect();\n if (!contentSize || contentSize.width !== rect.width || contentSize.height !== rect.height) {\n setContentSize({ width: rect.width, height: rect.height });\n }\n }}\n {...({\n role: 'tooltip',\n id: ctx.contentId,\n // Don't soak up pointer events — hovering the tooltip\n // itself should NOT block the trigger's mouse-leave from\n // firing. Tooltips are presentational; if you need\n // interactivity, reach for Popover.\n pointerEvents: 'none',\n } as Record<string, unknown>)}\n {...(testID !== undefined ? { testID } : {})}\n className={cn('rounded-md', className)}\n style={[contentBaseStyle, positionedStyle]}\n >\n <RNText\n className=\"text-xs\"\n style={{\n color: colors.semantic.text.inverted,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n lineHeight: px(colors.fontSize.sm) * Number(colors.lineHeight.tight),\n }}\n >\n {children}\n </RNText>\n </View>\n );\n};\n\n/**\n * Public `Tooltip` value — the root function plus its `.Trigger` and\n * `.Content` static members. `Object.assign` produces a value whose inferred\n * type carries the static properties, so `.d.ts` consumers can write\n * `<Tooltip.Trigger>` without a separate import.\n */\nexport const Tooltip = Object.assign(TooltipRoot, {\n Trigger: TooltipTrigger,\n Content: TooltipContent,\n});\n","import type { ViewProps, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\nimport { cn } from '../../utils/cn';\nimport { wrapStringChildren } from '../../utils/wrap-string-children';\nimport type { StackAlign, StackGap, StackJustify } from '../HStack/HStack';\n\nexport type VStackProps = ViewProps & {\n gap?: StackGap;\n align?: StackAlign;\n justify?: StackJustify;\n className?: string;\n testID?: string;\n};\n\nconst ALIGN_CLASS: Record<StackAlign, string> = {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n};\n\nconst JUSTIFY_CLASS: Record<StackJustify, string> = {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n};\n\nconst ALIGN_STYLE: Record<StackAlign, ViewStyle['alignItems']> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n stretch: 'stretch',\n baseline: 'baseline',\n};\n\nconst JUSTIFY_STYLE: Record<StackJustify, ViewStyle['justifyContent']> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n between: 'space-between',\n around: 'space-around',\n evenly: 'space-evenly',\n};\n\nconst GAP_PX: Record<StackGap, number> = {\n 0: 0,\n 1: 4,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n};\n\n/**\n * Vertical flex layout primitive. RSC-safe.\n *\n * Layout is driven by inline style; see HStack for the rationale.\n */\nexport const VStack = ({ gap, align, justify, className, children, style, ...rest }: VStackProps) => {\n const inline: ViewStyle = { flexDirection: 'column' };\n if (gap !== undefined && gap !== 0) {\n inline.gap = GAP_PX[gap];\n }\n if (align !== undefined) {\n inline.alignItems = ALIGN_STYLE[align];\n }\n if (justify !== undefined) {\n inline.justifyContent = JUSTIFY_STYLE[justify];\n }\n const merged = style === undefined ? inline : ([inline, style] as ViewStyle[]);\n return (\n <View\n {...rest}\n style={merged}\n className={cn(\n 'flex-col',\n gap !== undefined && gap !== 0 ? `gap-${gap}` : undefined,\n align !== undefined ? ALIGN_CLASS[align] : undefined,\n justify !== undefined ? JUSTIFY_CLASS[justify] : undefined,\n className\n )}\n >\n {wrapStringChildren(children)}\n </View>\n );\n};\n","import type { ComponentType } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg' | 'xl' | number;\n\nexport type IconComponentProps = {\n size?: number;\n color?: string;\n};\n\nexport type IconProps = {\n as: ComponentType<IconComponentProps>;\n size?: IconSize;\n color?: string;\n};\n\nconst SIZE_MAP: Record<Exclude<IconSize, number>, number> = {\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n};\n\n/**\n * Thin wrapper around an icon component. Consumer imports the icon they want\n * from any library (e.g. lucide-react-native) and passes it as `as`. No registry,\n * no runtime lookup — tree-shaking is automatic.\n *\n * RSC-safe: pure render, no hooks, no refs.\n */\nexport function Icon({ as: IconComponent, size = 'md', color }: IconProps) {\n const numericSize = typeof size === 'number' ? size : SIZE_MAP[size];\n // Only spread color when defined — avoids passing `color: undefined` under\n // exactOptionalPropertyTypes.\n const colorProps = color === undefined ? {} : { color };\n return <IconComponent size={numericSize} {...colorProps} />;\n}\n","import { themeDark as defaultDark, theme as defaultLight, type Theme } from '@nori-ui/tokens';\nimport type { NoriTheme } from './context';\n\n/**\n * Built-in theme presets. Pass any of these to `<NoriProvider theme={...}>`\n * (or `<ThemeProvider theme={...}>` directly) to swap the brand color\n * across the whole component library.\n *\n * Each preset overrides the `primary` color ramp AND the semantic\n * `interactive.primary` / `primaryHover` / `primaryPressed` derivations.\n * Backgrounds, borders, neutrals, and the destructive/warning/success\n * tones stay identical to the default — themes are about brand identity,\n * not full re-skins. (For a full re-skin, build your own NoriTheme by\n * spreading `defaultTheme` and overriding whatever you need.)\n *\n * Custom theme example:\n *\n * import { defaultTheme } from '@nori-ui/core/theme';\n * const myTheme: NoriTheme = {\n * light: { ...defaultTheme.light, color: { ...defaultTheme.light.color, primary: { ... } } },\n * dark: { ...defaultTheme.dark, color: { ...defaultTheme.dark.color, primary: { ... } } },\n * };\n */\n\n// Each ramp follows the same 50-900 step pattern as the default teal —\n// values picked from the Tailwind palette so they sit in a familiar\n// brightness scale. The \"primary 600\" step is the canonical resting\n// brand color for buttons; \"primary 700\" is the hover; \"primary 400\"\n// is the dark-mode brand color (brighter to read against #18181b).\ntype PrimaryRamp = {\n '50': string;\n '100': string;\n '200': string;\n '300': string;\n '400': string;\n '500': string;\n '600': string;\n '700': string;\n '800': string;\n '900': string;\n};\n\nconst RAMPS = {\n teal: {\n '50': '#f0fdfa',\n '100': '#ccfbf1',\n '200': '#99f6e4',\n '300': '#5eead4',\n '400': '#2dd4bf',\n '500': '#14b8a6',\n '600': '#0d9488',\n '700': '#0f766e',\n '800': '#115e59',\n '900': '#134e4a',\n },\n blue: {\n '50': '#eff6ff',\n '100': '#dbeafe',\n '200': '#bfdbfe',\n '300': '#93c5fd',\n '400': '#60a5fa',\n '500': '#3b82f6',\n '600': '#2563eb',\n '700': '#1d4ed8',\n '800': '#1e40af',\n '900': '#1e3a8a',\n },\n rose: {\n '50': '#fff1f2',\n '100': '#ffe4e6',\n '200': '#fecdd3',\n '300': '#fda4af',\n '400': '#fb7185',\n '500': '#f43f5e',\n '600': '#e11d48',\n '700': '#be123c',\n '800': '#9f1239',\n '900': '#881337',\n },\n violet: {\n '50': '#f5f3ff',\n '100': '#ede9fe',\n '200': '#ddd6fe',\n '300': '#c4b5fd',\n '400': '#a78bfa',\n '500': '#8b5cf6',\n '600': '#7c3aed',\n '700': '#6d28d9',\n '800': '#5b21b6',\n '900': '#4c1d95',\n },\n orange: {\n '50': '#fff7ed',\n '100': '#ffedd5',\n '200': '#fed7aa',\n '300': '#fdba74',\n '400': '#fb923c',\n '500': '#f97316',\n '600': '#ea580c',\n '700': '#c2410c',\n '800': '#9a3412',\n '900': '#7c2d12',\n },\n slate: {\n '50': '#f8fafc',\n '100': '#f1f5f9',\n '200': '#e2e8f0',\n '300': '#cbd5e1',\n '400': '#94a3b8',\n '500': '#64748b',\n '600': '#475569',\n '700': '#334155',\n '800': '#1e293b',\n '900': '#0f172a',\n },\n} as const satisfies Record<string, PrimaryRamp>;\n\n/**\n * Build a NoriTheme by swapping the primary ramp into the default.\n *\n * The unknown-cast is unavoidable: the generated `Theme` type narrows\n * each color hex to its specific string literal (e.g. `'#0d9488'` for\n * `primary.600`), so a generic `PrimaryRamp` ramp can't be assigned\n * structurally. The runtime shape is identical — we just convince TS.\n */\nfunction buildPreset(ramp: PrimaryRamp): NoriTheme {\n const dark = defaultDark as unknown as Theme;\n return {\n light: {\n ...defaultLight,\n color: { ...defaultLight.color, primary: ramp },\n semantic: {\n ...defaultLight.semantic,\n interactive: {\n ...defaultLight.semantic.interactive,\n primary: ramp['600'],\n primaryHover: ramp['700'],\n primaryPressed: ramp['800'],\n },\n },\n } as unknown as Theme,\n dark: {\n ...dark,\n color: { ...dark.color, primary: ramp },\n semantic: {\n ...dark.semantic,\n interactive: {\n ...dark.semantic.interactive,\n // Brighter step on dark so the brand reads against the\n // deep-zinc background — matches the default teal recipe\n // (teal-400 on dark vs teal-600 on light).\n primary: ramp['400'],\n primaryHover: ramp['300'],\n primaryPressed: ramp['200'],\n },\n },\n } as unknown as Theme,\n };\n}\n\n/** The default Nori palette — teal primary. */\nexport const tealTheme: NoriTheme = buildPreset(RAMPS.teal);\n/** Tailwind blue primary. Calm, technical. */\nexport const blueTheme: NoriTheme = buildPreset(RAMPS.blue);\n/** Tailwind rose primary. Warm, energetic. */\nexport const roseTheme: NoriTheme = buildPreset(RAMPS.rose);\n/** Tailwind violet primary. Modern, software. */\nexport const violetTheme: NoriTheme = buildPreset(RAMPS.violet);\n/** Tailwind orange primary. Lively, social. */\nexport const orangeTheme: NoriTheme = buildPreset(RAMPS.orange);\n/** Tailwind slate primary. Neutral, low-saturation — for tools that should fade into the work. */\nexport const slateTheme: NoriTheme = buildPreset(RAMPS.slate);\n\n/** All bundled presets, keyed by name. Useful for theme pickers and tests. */\nexport const presetThemes = {\n teal: tealTheme,\n blue: blueTheme,\n rose: roseTheme,\n violet: violetTheme,\n orange: orangeTheme,\n slate: slateTheme,\n} as const;\n\nexport type PresetThemeName = keyof typeof presetThemes;\n","'use client';\n\nimport { useThemeColors } from './use-theme-colors';\n\n/**\n * Returns the active token palette — equivalent to `useThemeColors()`.\n * Kept as a separate name for clarity in user code; both hooks return\n * the same `Theme` object resolved from the current `<ThemeProvider>`\n * and color scheme.\n */\nexport const useTheme = useThemeColors;\n","'use client';\n\nimport type { Theme } from '@nori-ui/tokens';\nimport type { ReactNode } from 'react';\nimport { I18nProvider } from '../i18n/context';\nimport { type LocaleInput, LocaleProvider } from '../i18n/locale';\nimport type { I18nInput } from '../i18n/types';\nimport type { SemanticIcons } from '../icons/default-semantic-icons';\nimport { SemanticIconsProvider } from '../icons/semantic-context';\nimport { type NoriTheme, ThemeProvider } from '../theme/context';\nimport { type ColorScheme, ColorSchemeProvider } from '../theme/use-color-scheme';\n\nexport type NoriProviderProps = {\n /**\n * Theme to apply to descendants. Pass:\n * - a `NoriTheme` (`{ light, dark }`) — covers both schemes\n * - a single `Theme` — used for both schemes (rare)\n * - one of the bundled presets: `tealTheme`, `blueTheme`, `roseTheme`,\n * `violetTheme`, `orangeTheme`, `slateTheme` (from `@nori-ui/core`)\n * - omit — falls back to the default Nori palette (teal)\n */\n theme?: NoriTheme | Theme;\n /**\n * Force a color scheme for descendants, overriding the OS signal. Use\n * when an app shell is hard-coded to one scheme (e.g. forced-dark\n * editorial chrome) and wants library components inside it to render\n * against the matching half of the theme.\n *\n * Omit to track the OS Appearance (native) / `<html>` `dark` class (web).\n */\n colorScheme?: ColorScheme;\n i18n?: I18nInput;\n icons?: Partial<SemanticIcons>;\n /**\n * BCP 47 locale tag (or `Intl.Locale`) used by locale-aware components\n * (Calendar, Number/Currency formatting, RelativeTime). Defaults to\n * the runtime's resolved locale (`new Intl.DateTimeFormat().resolvedOptions().locale`),\n * which mirrors what other `Intl` calls in the consumer's code use.\n */\n locale?: LocaleInput;\n children?: ReactNode;\n};\n\n/**\n * Single root provider composing theme, i18n, and semantic-icons contexts.\n * Place near the root of your app. Only needed to override defaults — the\n * library works out of the box without any provider.\n */\nexport function NoriProvider({ theme, colorScheme, i18n, icons, locale, children }: NoriProviderProps) {\n // Conditionally spread each optional prop — `exactOptionalPropertyTypes: true`\n // rejects passing `undefined` to a prop typed as `T | missing`.\n const themeProps = theme === undefined ? {} : { theme };\n const i18nProps = i18n === undefined ? {} : { i18n };\n const iconsProps = icons === undefined ? {} : { icons };\n const localeProps = locale === undefined ? {} : { locale };\n\n const inner = (\n <LocaleProvider {...localeProps}>\n <ThemeProvider {...themeProps}>\n <I18nProvider {...i18nProps}>\n <SemanticIconsProvider {...iconsProps}>{children}</SemanticIconsProvider>\n </I18nProvider>\n </ThemeProvider>\n </LocaleProvider>\n );\n\n return colorScheme === undefined ? inner : <ColorSchemeProvider value={colorScheme}>{inner}</ColorSchemeProvider>;\n}\n"]}
|