@nori-ui/core 0.0.5 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/animated-view.cjs +13 -0
- package/dist/animation/animated-view.cjs.map +1 -0
- package/dist/animation/animated-view.d.cts +6 -0
- package/dist/animation/animated-view.d.ts +6 -0
- package/dist/animation/animated-view.js +4 -0
- package/dist/animation/animated-view.js.map +1 -0
- package/dist/animation/animated-view.web.cjs +9 -0
- package/dist/animation/animated-view.web.cjs.map +1 -0
- package/dist/animation/animated-view.web.d.cts +5 -0
- package/dist/animation/animated-view.web.d.ts +5 -0
- package/dist/animation/animated-view.web.js +8 -0
- package/dist/animation/animated-view.web.js.map +1 -0
- package/dist/animation/use-animated-number.cjs +80 -0
- package/dist/animation/use-animated-number.cjs.map +1 -0
- package/dist/animation/use-animated-number.d.cts +8 -0
- package/dist/animation/use-animated-number.d.ts +8 -0
- package/dist/animation/use-animated-number.js +4 -0
- package/dist/animation/use-animated-number.js.map +1 -0
- package/dist/animation/use-animated-number.web.cjs +28 -0
- package/dist/animation/use-animated-number.web.cjs.map +1 -0
- package/dist/animation/use-animated-number.web.d.cts +8 -0
- package/dist/animation/use-animated-number.web.d.ts +8 -0
- package/dist/animation/use-animated-number.web.js +25 -0
- package/dist/animation/use-animated-number.web.js.map +1 -0
- package/dist/{chunk-RX7UULY3.js → chunk-33S7ADWM.js} +3 -3
- package/dist/{chunk-RX7UULY3.js.map → chunk-33S7ADWM.js.map} +1 -1
- package/dist/chunk-3BDDPFCI.js +108 -0
- package/dist/chunk-3BDDPFCI.js.map +1 -0
- package/dist/chunk-3F4TXKDY.js +314 -0
- package/dist/chunk-3F4TXKDY.js.map +1 -0
- package/dist/chunk-5A2QOOVN.js +15 -0
- package/dist/chunk-5A2QOOVN.js.map +1 -0
- package/dist/chunk-5XEGZFG5.js +208 -0
- package/dist/chunk-5XEGZFG5.js.map +1 -0
- package/dist/chunk-6AD6KCVB.js +178 -0
- package/dist/chunk-6AD6KCVB.js.map +1 -0
- package/dist/chunk-7GPDNQSX.js +967 -0
- package/dist/chunk-7GPDNQSX.js.map +1 -0
- package/dist/chunk-7UKRN73P.js +42 -0
- package/dist/chunk-7UKRN73P.js.map +1 -0
- package/dist/chunk-7Z4NMNX6.js +64 -0
- package/dist/chunk-7Z4NMNX6.js.map +1 -0
- package/dist/chunk-ACLHDHX3.js +29 -0
- package/dist/chunk-ACLHDHX3.js.map +1 -0
- package/dist/chunk-BZLT6R62.js +80 -0
- package/dist/chunk-BZLT6R62.js.map +1 -0
- package/dist/chunk-CCUXO2HN.js +450 -0
- package/dist/chunk-CCUXO2HN.js.map +1 -0
- package/dist/chunk-CHXHRJNZ.js +43 -0
- package/dist/chunk-CHXHRJNZ.js.map +1 -0
- package/dist/chunk-DDGMLLS3.js +188 -0
- package/dist/chunk-DDGMLLS3.js.map +1 -0
- package/dist/chunk-EWWQQ5DB.js +654 -0
- package/dist/chunk-EWWQQ5DB.js.map +1 -0
- package/dist/chunk-FEPTH5RV.js +169 -0
- package/dist/chunk-FEPTH5RV.js.map +1 -0
- package/dist/{chunk-SSTXLK5I.js → chunk-FT2XBBQJ.js} +42 -6
- package/dist/chunk-FT2XBBQJ.js.map +1 -0
- package/dist/chunk-IKLA2CVQ.js +260 -0
- package/dist/chunk-IKLA2CVQ.js.map +1 -0
- package/dist/chunk-JQQ3FBN7.js +18 -0
- package/dist/chunk-JQQ3FBN7.js.map +1 -0
- package/dist/chunk-JSAG5YO7.js +69 -0
- package/dist/chunk-JSAG5YO7.js.map +1 -0
- package/dist/chunk-JZ774T7U.js +76 -0
- package/dist/chunk-JZ774T7U.js.map +1 -0
- package/dist/chunk-KWRDJPP3.js +10 -0
- package/dist/chunk-KWRDJPP3.js.map +1 -0
- package/dist/chunk-LVWNMQGR.js +1106 -0
- package/dist/chunk-LVWNMQGR.js.map +1 -0
- package/dist/chunk-LWLK6HSW.js +143 -0
- package/dist/chunk-LWLK6HSW.js.map +1 -0
- package/dist/chunk-MDOZGILD.js +134 -0
- package/dist/chunk-MDOZGILD.js.map +1 -0
- package/dist/chunk-MKSDYRWQ.js +446 -0
- package/dist/chunk-MKSDYRWQ.js.map +1 -0
- package/dist/chunk-MRJWPRCX.js +80 -0
- package/dist/chunk-MRJWPRCX.js.map +1 -0
- package/dist/chunk-NRYWNOG5.js +410 -0
- package/dist/chunk-NRYWNOG5.js.map +1 -0
- package/dist/chunk-OMU4R4Y5.js +144 -0
- package/dist/chunk-OMU4R4Y5.js.map +1 -0
- package/dist/chunk-PNP7L4TA.js +103 -0
- package/dist/chunk-PNP7L4TA.js.map +1 -0
- package/dist/chunk-QI6646JZ.js +3 -0
- package/dist/{chunk-UAKFCMWK.js.map → chunk-QI6646JZ.js.map} +1 -1
- package/dist/chunk-QJNV7YQP.js +138 -0
- package/dist/chunk-QJNV7YQP.js.map +1 -0
- package/dist/chunk-R5JMDDCB.js +292 -0
- package/dist/chunk-R5JMDDCB.js.map +1 -0
- package/dist/chunk-RB3YBWQ4.js +77 -0
- package/dist/chunk-RB3YBWQ4.js.map +1 -0
- package/dist/chunk-RFW5SRZA.js +23 -0
- package/dist/chunk-RFW5SRZA.js.map +1 -0
- package/dist/chunk-RGJ3NBKE.js +8 -0
- package/dist/chunk-RGJ3NBKE.js.map +1 -0
- package/dist/chunk-SFNDR6DI.js +485 -0
- package/dist/chunk-SFNDR6DI.js.map +1 -0
- package/dist/chunk-SWC5CNKE.js +13 -0
- package/dist/chunk-SWC5CNKE.js.map +1 -0
- package/dist/chunk-TLS54G6Y.js +15 -0
- package/dist/chunk-TLS54G6Y.js.map +1 -0
- package/dist/chunk-WCQVDF3K.js +12 -0
- package/dist/{chunk-7QVYU63E.js.map → chunk-WCQVDF3K.js.map} +1 -1
- package/dist/chunk-WGT345SV.js +427 -0
- package/dist/chunk-WGT345SV.js.map +1 -0
- package/dist/chunk-X7APG7G2.js +1566 -0
- package/dist/chunk-X7APG7G2.js.map +1 -0
- package/dist/chunk-XALU6LOT.js +306 -0
- package/dist/chunk-XALU6LOT.js.map +1 -0
- package/dist/chunk-YNKKEO2A.js +336 -0
- package/dist/chunk-YNKKEO2A.js.map +1 -0
- package/dist/chunk-ZBW3BA5R.js +148 -0
- package/dist/chunk-ZBW3BA5R.js.map +1 -0
- package/dist/{chunk-FXKIWONG.js → chunk-ZIBNLXIV.js} +12 -6
- package/dist/chunk-ZIBNLXIV.js.map +1 -0
- package/dist/chunk-ZMSIYLSI.js +563 -0
- package/dist/chunk-ZMSIYLSI.js.map +1 -0
- package/dist/chunk-ZQMNGPLE.js +981 -0
- package/dist/chunk-ZQMNGPLE.js.map +1 -0
- package/dist/chunk-ZRD4FQBT.js +153 -0
- package/dist/chunk-ZRD4FQBT.js.map +1 -0
- package/dist/client.cjs +11289 -439
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +68 -117
- package/dist/client.d.ts +68 -117
- package/dist/client.js +58 -40
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/index.cjs +900 -0
- package/dist/components/Accordion/index.cjs.map +1 -0
- package/dist/components/Accordion/index.d.cts +72 -0
- package/dist/components/Accordion/index.d.ts +72 -0
- package/dist/components/Accordion/index.js +10 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/Alert/index.cjs +567 -0
- package/dist/components/Alert/index.cjs.map +1 -0
- package/dist/components/Alert/index.d.cts +41 -0
- package/dist/components/Alert/index.d.ts +41 -0
- package/dist/components/Alert/index.js +8 -0
- package/dist/components/Alert/index.js.map +1 -0
- package/dist/components/AlertDialog/index.cjs +892 -0
- package/dist/components/AlertDialog/index.cjs.map +1 -0
- package/dist/components/AlertDialog/index.d.cts +68 -0
- package/dist/components/AlertDialog/index.d.ts +68 -0
- package/dist/components/AlertDialog/index.js +9 -0
- package/dist/components/AlertDialog/index.js.map +1 -0
- package/dist/components/Avatar/index.cjs +427 -0
- package/dist/components/Avatar/index.cjs.map +1 -0
- package/dist/components/Avatar/index.d.cts +40 -0
- package/dist/components/Avatar/index.d.ts +40 -0
- package/dist/components/Avatar/index.js +7 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Badge/index.cjs +433 -0
- package/dist/components/Badge/index.cjs.map +1 -0
- package/dist/components/Badge/index.d.cts +35 -0
- package/dist/components/Badge/index.d.ts +35 -0
- package/dist/components/Badge/index.js +7 -0
- package/dist/components/Badge/index.js.map +1 -0
- package/dist/components/Box/index.cjs +415 -0
- package/dist/components/Box/index.cjs.map +1 -0
- package/dist/components/Box/index.d.cts +24 -0
- package/dist/components/Box/index.d.ts +24 -0
- package/dist/components/Box/index.js +9 -0
- package/dist/components/Box/index.js.map +1 -0
- package/dist/components/Breadcrumb/index.cjs +1939 -0
- package/dist/components/Breadcrumb/index.cjs.map +1 -0
- package/dist/components/Breadcrumb/index.d.cts +186 -0
- package/dist/components/Breadcrumb/index.d.ts +186 -0
- package/dist/components/Breadcrumb/index.js +11 -0
- package/dist/components/Breadcrumb/index.js.map +1 -0
- package/dist/components/Button/index.cjs +631 -0
- package/dist/components/Button/index.cjs.map +1 -0
- package/dist/components/Button/index.d.cts +27 -0
- package/dist/components/Button/index.d.ts +27 -0
- package/dist/components/Button/index.js +9 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Calendar/index.cjs +3017 -0
- package/dist/components/Calendar/index.cjs.map +1 -0
- package/dist/components/Calendar/index.d.cts +169 -0
- package/dist/components/Calendar/index.d.ts +169 -0
- package/dist/components/Calendar/index.js +11 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Card/index.cjs +469 -0
- package/dist/components/Card/index.cjs.map +1 -0
- package/dist/components/Card/index.d.cts +33 -0
- package/dist/components/Card/index.d.ts +33 -0
- package/dist/components/Card/index.js +7 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Checkbox/index.cjs +590 -0
- package/dist/components/Checkbox/index.cjs.map +1 -0
- package/dist/components/Checkbox/index.d.cts +22 -0
- package/dist/components/Checkbox/index.d.ts +22 -0
- package/dist/components/Checkbox/index.js +9 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Dialog/index.cjs +888 -0
- package/dist/components/Dialog/index.cjs.map +1 -0
- package/dist/components/Dialog/index.d.cts +56 -0
- package/dist/components/Dialog/index.d.ts +56 -0
- package/dist/components/Dialog/index.js +10 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/FloatButton/index.cjs +1254 -0
- package/dist/components/FloatButton/index.cjs.map +1 -0
- package/dist/components/FloatButton/index.d.cts +133 -0
- package/dist/components/FloatButton/index.d.ts +133 -0
- package/dist/components/FloatButton/index.js +11 -0
- package/dist/components/FloatButton/index.js.map +1 -0
- package/dist/components/HStack/index.cjs +480 -0
- package/dist/components/HStack/index.cjs.map +1 -0
- package/dist/components/HStack/index.d.cts +24 -0
- package/dist/components/HStack/index.d.ts +24 -0
- package/dist/components/HStack/index.js +9 -0
- package/dist/components/HStack/index.js.map +1 -0
- package/dist/components/InputGroup/index.cjs +638 -0
- package/dist/components/InputGroup/index.cjs.map +1 -0
- package/dist/components/InputGroup/index.d.cts +33 -0
- package/dist/components/InputGroup/index.d.ts +33 -0
- package/dist/components/InputGroup/index.js +7 -0
- package/dist/components/InputGroup/index.js.map +1 -0
- package/dist/components/Pagination/index.cjs +2501 -0
- package/dist/components/Pagination/index.cjs.map +1 -0
- package/dist/components/Pagination/index.d.cts +164 -0
- package/dist/components/Pagination/index.d.ts +164 -0
- package/dist/components/Pagination/index.js +12 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Popover/index.cjs +739 -0
- package/dist/components/Popover/index.cjs.map +1 -0
- package/dist/components/Popover/index.d.cts +44 -0
- package/dist/components/Popover/index.d.ts +44 -0
- package/dist/components/Popover/index.js +8 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Progress/index.cjs +493 -0
- package/dist/components/Progress/index.cjs.map +1 -0
- package/dist/components/Progress/index.d.cts +63 -0
- package/dist/components/Progress/index.d.ts +63 -0
- package/dist/components/Progress/index.js +7 -0
- package/dist/components/Progress/index.js.map +1 -0
- package/dist/components/Radio/index.cjs +584 -0
- package/dist/components/Radio/index.cjs.map +1 -0
- package/dist/components/Radio/index.d.cts +51 -0
- package/dist/components/Radio/index.d.ts +51 -0
- package/dist/components/Radio/index.js +7 -0
- package/dist/components/Radio/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.cjs +502 -0
- package/dist/components/SegmentedControl/index.cjs.map +1 -0
- package/dist/components/SegmentedControl/index.d.cts +45 -0
- package/dist/components/SegmentedControl/index.d.ts +45 -0
- package/dist/components/SegmentedControl/index.js +7 -0
- package/dist/components/SegmentedControl/index.js.map +1 -0
- package/dist/components/Select/index.cjs +1359 -0
- package/dist/components/Select/index.cjs.map +1 -0
- package/dist/components/Select/index.d.cts +140 -0
- package/dist/components/Select/index.d.ts +140 -0
- package/dist/components/Select/index.js +8 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Separator/index.cjs +358 -0
- package/dist/components/Separator/index.cjs.map +1 -0
- package/dist/components/Separator/index.d.cts +28 -0
- package/dist/components/Separator/index.d.ts +28 -0
- package/dist/components/Separator/index.js +6 -0
- package/dist/components/Separator/index.js.map +1 -0
- package/dist/components/Skeleton/index.cjs +384 -0
- package/dist/components/Skeleton/index.cjs.map +1 -0
- package/dist/components/Skeleton/index.d.cts +30 -0
- package/dist/components/Skeleton/index.d.ts +30 -0
- package/dist/components/Skeleton/index.js +6 -0
- package/dist/components/Skeleton/index.js.map +1 -0
- package/dist/components/Slider/index.cjs +880 -0
- package/dist/components/Slider/index.cjs.map +1 -0
- package/dist/components/Slider/index.d.cts +84 -0
- package/dist/components/Slider/index.d.ts +84 -0
- package/dist/components/Slider/index.js +6 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/Spinner/index.cjs +32 -0
- package/dist/components/Spinner/index.cjs.map +1 -0
- package/dist/components/Spinner/index.d.cts +25 -0
- package/dist/components/Spinner/index.d.ts +25 -0
- package/dist/components/Spinner/index.js +4 -0
- package/dist/components/Spinner/index.js.map +1 -0
- package/dist/components/Switch/index.cjs +623 -0
- package/dist/components/Switch/index.cjs.map +1 -0
- package/dist/components/Switch/index.d.cts +22 -0
- package/dist/components/Switch/index.d.ts +22 -0
- package/dist/components/Switch/index.js +10 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tabs/index.cjs +630 -0
- package/dist/components/Tabs/index.cjs.map +1 -0
- package/dist/components/Tabs/index.d.cts +63 -0
- package/dist/components/Tabs/index.d.ts +63 -0
- package/dist/components/Tabs/index.js +7 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Text/index.cjs +401 -0
- package/dist/components/Text/index.cjs.map +1 -0
- package/dist/components/Text/index.d.cts +24 -0
- package/dist/components/Text/index.d.ts +24 -0
- package/dist/components/Text/index.js +7 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/TextArea/index.cjs +482 -0
- package/dist/components/TextArea/index.cjs.map +1 -0
- package/dist/components/TextArea/index.d.cts +25 -0
- package/dist/components/TextArea/index.d.ts +25 -0
- package/dist/components/TextArea/index.js +8 -0
- package/dist/components/TextArea/index.js.map +1 -0
- package/dist/components/TextInput/index.cjs +477 -0
- package/dist/components/TextInput/index.cjs.map +1 -0
- package/dist/components/TextInput/index.d.cts +33 -0
- package/dist/components/TextInput/index.d.ts +33 -0
- package/dist/components/TextInput/index.js +7 -0
- package/dist/components/TextInput/index.js.map +1 -0
- package/dist/components/Toast/index.cjs +167 -0
- package/dist/components/Toast/index.cjs.map +1 -0
- package/dist/components/Toast/index.d.cts +143 -0
- package/dist/components/Toast/index.d.ts +143 -0
- package/dist/components/Toast/index.js +4 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/Toggle/index.cjs +770 -0
- package/dist/components/Toggle/index.cjs.map +1 -0
- package/dist/components/Toggle/index.d.cts +83 -0
- package/dist/components/Toggle/index.d.ts +83 -0
- package/dist/components/Toggle/index.js +7 -0
- package/dist/components/Toggle/index.js.map +1 -0
- package/dist/components/Tooltip/index.cjs +813 -0
- package/dist/components/Tooltip/index.cjs.map +1 -0
- package/dist/components/Tooltip/index.d.cts +55 -0
- package/dist/components/Tooltip/index.d.ts +55 -0
- package/dist/components/Tooltip/index.js +8 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/VStack/index.cjs +480 -0
- package/dist/components/VStack/index.cjs.map +1 -0
- package/dist/components/VStack/index.d.cts +19 -0
- package/dist/components/VStack/index.d.ts +19 -0
- package/dist/components/VStack/index.js +9 -0
- package/dist/components/VStack/index.js.map +1 -0
- package/dist/i18n/index.cjs +39 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +4 -60
- package/dist/i18n/index.d.ts +4 -60
- package/dist/i18n/index.js +3 -2
- package/dist/icons/index.cjs +326 -26
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.js +4 -3
- package/dist/index-D3_M3G6U.d.ts +19 -0
- package/dist/index-uXPK_Rg8.d.cts +19 -0
- package/dist/index.cjs +11176 -463
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -183
- package/dist/index.d.ts +39 -183
- package/dist/index.js +49 -9
- package/dist/resolve-D-GOaxZy.d.cts +60 -0
- package/dist/resolve-D-GOaxZy.d.ts +60 -0
- package/dist/slot/index.cjs +9 -3
- package/dist/slot/index.cjs.map +1 -1
- package/dist/slot/index.js +2 -2
- package/dist/stories/index.cjs +108 -0
- package/dist/stories/index.cjs.map +1 -0
- package/dist/stories/index.d.cts +46 -0
- package/dist/stories/index.d.ts +46 -0
- package/dist/stories/index.js +94 -0
- package/dist/stories/index.js.map +1 -0
- package/dist/theme/index.cjs +259 -26
- package/dist/theme/index.cjs.map +1 -1
- package/dist/theme/index.d.cts +26 -0
- package/dist/theme/index.d.ts +26 -0
- package/dist/theme/index.js +4 -3
- package/dist/use-theme-CoqfnvRs.d.cts +112 -0
- package/dist/use-theme-CoqfnvRs.d.ts +112 -0
- package/dist/utils/cn.cjs +18 -6
- package/dist/utils/cn.cjs.map +1 -1
- package/dist/utils/cn.js +2 -2
- package/package.json +41 -10
- package/dist/chunk-6OABNXBY.js +0 -213
- package/dist/chunk-6OABNXBY.js.map +0 -1
- package/dist/chunk-7QVYU63E.js +0 -6
- package/dist/chunk-FXKIWONG.js.map +0 -1
- package/dist/chunk-NDEDMCHT.js +0 -40
- package/dist/chunk-NDEDMCHT.js.map +0 -1
- package/dist/chunk-SSTXLK5I.js.map +0 -1
- package/dist/chunk-UAKFCMWK.js +0 -3
- package/dist/chunk-X3AJNNF6.js +0 -539
- package/dist/chunk-X3AJNNF6.js.map +0 -1
- package/dist/chunk-XGM2K4TT.js +0 -31
- package/dist/chunk-XGM2K4TT.js.map +0 -1
- package/dist/stories/story-registry.cjs +0 -776
- package/dist/stories/story-registry.cjs.map +0 -1
- package/dist/stories/story-registry.d.cts +0 -13
- package/dist/stories/story-registry.d.ts +0 -13
- package/dist/stories/story-registry.js +0 -106
- package/dist/stories/story-registry.js.map +0 -1
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var reactNative = require('react-native');
|
|
5
|
+
var jsxRuntime = require('nativewind/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
|
|
10
|
+
// src/theme/px.ts
|
|
11
|
+
function px(value) {
|
|
12
|
+
if (typeof value === "number") {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
const n = Number.parseFloat(value);
|
|
16
|
+
return Number.isFinite(n) ? n : 0;
|
|
17
|
+
}
|
|
18
|
+
__name(px, "px");
|
|
19
|
+
|
|
20
|
+
// ../tokens/build/theme.ts
|
|
21
|
+
var theme = {
|
|
22
|
+
color: {
|
|
23
|
+
danger: "#ef4444",
|
|
24
|
+
info: "#3b82f6",
|
|
25
|
+
neutral: {
|
|
26
|
+
"100": "#f4f4f5",
|
|
27
|
+
"200": "#e4e4e7",
|
|
28
|
+
"300": "#d4d4d8",
|
|
29
|
+
"400": "#a1a1aa",
|
|
30
|
+
"50": "#fafafa",
|
|
31
|
+
"500": "#71717a",
|
|
32
|
+
"600": "#52525b",
|
|
33
|
+
"700": "#3f3f46",
|
|
34
|
+
"800": "#27272a",
|
|
35
|
+
"900": "#18181b"
|
|
36
|
+
},
|
|
37
|
+
primary: {
|
|
38
|
+
"100": "#ccfbf1",
|
|
39
|
+
"200": "#99f6e4",
|
|
40
|
+
"300": "#5eead4",
|
|
41
|
+
"400": "#2dd4bf",
|
|
42
|
+
"50": "#f0fdfa",
|
|
43
|
+
"500": "#14b8a6",
|
|
44
|
+
"600": "#0d9488",
|
|
45
|
+
"700": "#0f766e",
|
|
46
|
+
"800": "#115e59",
|
|
47
|
+
"900": "#134e4a"
|
|
48
|
+
},
|
|
49
|
+
success: "#22c55e",
|
|
50
|
+
warning: "#f59e0b"
|
|
51
|
+
},
|
|
52
|
+
fontFamily: {
|
|
53
|
+
body: "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
|
|
54
|
+
display: "ui-serif, Georgia, 'Times New Roman', serif",
|
|
55
|
+
mono: "ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
|
56
|
+
},
|
|
57
|
+
fontSize: {
|
|
58
|
+
"2xl": "24px",
|
|
59
|
+
"3xl": "30px",
|
|
60
|
+
"4xl": "36px",
|
|
61
|
+
lg: "18px",
|
|
62
|
+
md: "16px",
|
|
63
|
+
sm: "14px",
|
|
64
|
+
xl: "20px",
|
|
65
|
+
xs: "12px"
|
|
66
|
+
},
|
|
67
|
+
fontWeight: {
|
|
68
|
+
bold: "700",
|
|
69
|
+
medium: "500",
|
|
70
|
+
regular: "400",
|
|
71
|
+
semibold: "600"
|
|
72
|
+
},
|
|
73
|
+
lineHeight: {
|
|
74
|
+
normal: "1.4",
|
|
75
|
+
relaxed: "1.6",
|
|
76
|
+
tight: "1.2"
|
|
77
|
+
},
|
|
78
|
+
radius: {
|
|
79
|
+
"2xl": "16px",
|
|
80
|
+
full: "9999px",
|
|
81
|
+
lg: "8px",
|
|
82
|
+
md: "6px",
|
|
83
|
+
none: "0px",
|
|
84
|
+
sm: "4px",
|
|
85
|
+
xl: "12px"
|
|
86
|
+
},
|
|
87
|
+
semantic: {
|
|
88
|
+
background: {
|
|
89
|
+
default: "#fafafa",
|
|
90
|
+
elevated: "#ffffff",
|
|
91
|
+
subtle: "#f4f4f5"
|
|
92
|
+
},
|
|
93
|
+
border: {
|
|
94
|
+
default: "#e4e4e7",
|
|
95
|
+
strong: "#d4d4d8"
|
|
96
|
+
},
|
|
97
|
+
interactive: {
|
|
98
|
+
destructive: "#ef4444",
|
|
99
|
+
primary: "#0d9488",
|
|
100
|
+
primaryHover: "#0f766e",
|
|
101
|
+
primaryPressed: "#115e59"
|
|
102
|
+
},
|
|
103
|
+
text: {
|
|
104
|
+
default: "#18181b",
|
|
105
|
+
inverted: "#fafafa",
|
|
106
|
+
muted: "#52525b"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
shadow: {
|
|
110
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
111
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
112
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
113
|
+
},
|
|
114
|
+
spacing: {
|
|
115
|
+
"0": "0px",
|
|
116
|
+
"1": "4px",
|
|
117
|
+
"10": "40px",
|
|
118
|
+
"12": "48px",
|
|
119
|
+
"16": "64px",
|
|
120
|
+
"2": "8px",
|
|
121
|
+
"20": "80px",
|
|
122
|
+
"24": "96px",
|
|
123
|
+
"3": "12px",
|
|
124
|
+
"4": "16px",
|
|
125
|
+
"5": "20px",
|
|
126
|
+
"6": "24px",
|
|
127
|
+
"8": "32px"
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
var themeDark = {
|
|
131
|
+
color: {
|
|
132
|
+
danger: "#ef4444",
|
|
133
|
+
info: "#3b82f6",
|
|
134
|
+
neutral: {
|
|
135
|
+
"100": "#f4f4f5",
|
|
136
|
+
"200": "#e4e4e7",
|
|
137
|
+
"300": "#d4d4d8",
|
|
138
|
+
"400": "#a1a1aa",
|
|
139
|
+
"50": "#fafafa",
|
|
140
|
+
"500": "#71717a",
|
|
141
|
+
"600": "#52525b",
|
|
142
|
+
"700": "#3f3f46",
|
|
143
|
+
"800": "#27272a",
|
|
144
|
+
"900": "#18181b"
|
|
145
|
+
},
|
|
146
|
+
primary: {
|
|
147
|
+
"100": "#ccfbf1",
|
|
148
|
+
"200": "#99f6e4",
|
|
149
|
+
"300": "#5eead4",
|
|
150
|
+
"400": "#2dd4bf",
|
|
151
|
+
"50": "#f0fdfa",
|
|
152
|
+
"500": "#14b8a6",
|
|
153
|
+
"600": "#0d9488",
|
|
154
|
+
"700": "#0f766e",
|
|
155
|
+
"800": "#115e59",
|
|
156
|
+
"900": "#134e4a"
|
|
157
|
+
},
|
|
158
|
+
success: "#22c55e",
|
|
159
|
+
warning: "#f59e0b"
|
|
160
|
+
},
|
|
161
|
+
fontFamily: {
|
|
162
|
+
body: "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
|
|
163
|
+
display: "ui-serif, Georgia, 'Times New Roman', serif",
|
|
164
|
+
mono: "ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
|
165
|
+
},
|
|
166
|
+
fontSize: {
|
|
167
|
+
"2xl": "24px",
|
|
168
|
+
"3xl": "30px",
|
|
169
|
+
"4xl": "36px",
|
|
170
|
+
lg: "18px",
|
|
171
|
+
md: "16px",
|
|
172
|
+
sm: "14px",
|
|
173
|
+
xl: "20px",
|
|
174
|
+
xs: "12px"
|
|
175
|
+
},
|
|
176
|
+
fontWeight: {
|
|
177
|
+
bold: "700",
|
|
178
|
+
medium: "500",
|
|
179
|
+
regular: "400",
|
|
180
|
+
semibold: "600"
|
|
181
|
+
},
|
|
182
|
+
lineHeight: {
|
|
183
|
+
normal: "1.4",
|
|
184
|
+
relaxed: "1.6",
|
|
185
|
+
tight: "1.2"
|
|
186
|
+
},
|
|
187
|
+
radius: {
|
|
188
|
+
"2xl": "16px",
|
|
189
|
+
full: "9999px",
|
|
190
|
+
lg: "8px",
|
|
191
|
+
md: "6px",
|
|
192
|
+
none: "0px",
|
|
193
|
+
sm: "4px",
|
|
194
|
+
xl: "12px"
|
|
195
|
+
},
|
|
196
|
+
semantic: {
|
|
197
|
+
background: {
|
|
198
|
+
default: "#18181b",
|
|
199
|
+
elevated: "#3f3f46",
|
|
200
|
+
subtle: "#27272a"
|
|
201
|
+
},
|
|
202
|
+
border: {
|
|
203
|
+
default: "#3f3f46",
|
|
204
|
+
strong: "#52525b"
|
|
205
|
+
},
|
|
206
|
+
interactive: {
|
|
207
|
+
destructive: "#ef4444",
|
|
208
|
+
primary: "#2dd4bf",
|
|
209
|
+
primaryHover: "#5eead4",
|
|
210
|
+
primaryPressed: "#99f6e4"
|
|
211
|
+
},
|
|
212
|
+
text: {
|
|
213
|
+
default: "#fafafa",
|
|
214
|
+
inverted: "#18181b",
|
|
215
|
+
muted: "#a1a1aa"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
shadow: {
|
|
219
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
220
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
221
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
222
|
+
},
|
|
223
|
+
spacing: {
|
|
224
|
+
"0": "0px",
|
|
225
|
+
"1": "4px",
|
|
226
|
+
"10": "40px",
|
|
227
|
+
"12": "48px",
|
|
228
|
+
"16": "64px",
|
|
229
|
+
"2": "8px",
|
|
230
|
+
"20": "80px",
|
|
231
|
+
"24": "96px",
|
|
232
|
+
"3": "12px",
|
|
233
|
+
"4": "16px",
|
|
234
|
+
"5": "20px",
|
|
235
|
+
"6": "24px",
|
|
236
|
+
"8": "32px"
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var defaultTheme = {
|
|
240
|
+
light: theme,
|
|
241
|
+
dark: themeDark
|
|
242
|
+
};
|
|
243
|
+
var ThemeContext = react.createContext(defaultTheme);
|
|
244
|
+
ThemeContext.displayName = "ThemeContext";
|
|
245
|
+
var ColorSchemeOverrideContext = react.createContext(null);
|
|
246
|
+
ColorSchemeOverrideContext.displayName = "ColorSchemeOverrideContext";
|
|
247
|
+
var isWeb = reactNative.Platform.OS === "web";
|
|
248
|
+
function readWebScheme() {
|
|
249
|
+
if (typeof document === "undefined") {
|
|
250
|
+
return "light";
|
|
251
|
+
}
|
|
252
|
+
const root = document.documentElement;
|
|
253
|
+
if (root.classList.contains("dark")) {
|
|
254
|
+
return "dark";
|
|
255
|
+
}
|
|
256
|
+
if (root.getAttribute("data-theme") === "dark") {
|
|
257
|
+
return "dark";
|
|
258
|
+
}
|
|
259
|
+
return "light";
|
|
260
|
+
}
|
|
261
|
+
__name(readWebScheme, "readWebScheme");
|
|
262
|
+
function useColorScheme() {
|
|
263
|
+
const override = react.useContext(ColorSchemeOverrideContext);
|
|
264
|
+
const [scheme, setScheme] = react.useState(() => {
|
|
265
|
+
if (isWeb) {
|
|
266
|
+
return readWebScheme();
|
|
267
|
+
}
|
|
268
|
+
return reactNative.Appearance.getColorScheme() ?? "light";
|
|
269
|
+
});
|
|
270
|
+
react.useEffect(() => {
|
|
271
|
+
if (isWeb) {
|
|
272
|
+
const root = document.documentElement;
|
|
273
|
+
const update = /* @__PURE__ */ __name(() => setScheme(readWebScheme()), "update");
|
|
274
|
+
const observer = new MutationObserver(update);
|
|
275
|
+
observer.observe(root, { attributes: true, attributeFilter: ["class", "data-theme"] });
|
|
276
|
+
update();
|
|
277
|
+
return () => observer.disconnect();
|
|
278
|
+
}
|
|
279
|
+
const sub = reactNative.Appearance.addChangeListener(({ colorScheme }) => {
|
|
280
|
+
setScheme(colorScheme ?? "light");
|
|
281
|
+
});
|
|
282
|
+
return () => sub.remove();
|
|
283
|
+
}, []);
|
|
284
|
+
return override ?? scheme;
|
|
285
|
+
}
|
|
286
|
+
__name(useColorScheme, "useColorScheme");
|
|
287
|
+
|
|
288
|
+
// src/theme/use-theme-colors.ts
|
|
289
|
+
function useThemeColors() {
|
|
290
|
+
const scheme = useColorScheme();
|
|
291
|
+
const themePair = react.useContext(ThemeContext);
|
|
292
|
+
return scheme === "dark" ? themePair.dark : themePair.light;
|
|
293
|
+
}
|
|
294
|
+
__name(useThemeColors, "useThemeColors");
|
|
295
|
+
|
|
296
|
+
// src/utils/cn.ts
|
|
297
|
+
function cn(...inputs) {
|
|
298
|
+
const out = [];
|
|
299
|
+
for (const input of inputs) {
|
|
300
|
+
append(out, input);
|
|
301
|
+
}
|
|
302
|
+
return out.join(" ");
|
|
303
|
+
}
|
|
304
|
+
__name(cn, "cn");
|
|
305
|
+
function append(out, input) {
|
|
306
|
+
if (!input) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (typeof input === "string") {
|
|
310
|
+
if (input.length > 0) {
|
|
311
|
+
out.push(input);
|
|
312
|
+
}
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
if (typeof input === "number") {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (Array.isArray(input)) {
|
|
319
|
+
for (const inner of input) {
|
|
320
|
+
append(out, inner);
|
|
321
|
+
}
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (typeof input === "object") {
|
|
325
|
+
for (const key of Object.keys(input)) {
|
|
326
|
+
if (input[key]) {
|
|
327
|
+
out.push(key);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
__name(append, "append");
|
|
333
|
+
var TabsContext = react.createContext(null);
|
|
334
|
+
var useTabsContext = /* @__PURE__ */ __name((label) => {
|
|
335
|
+
const ctx = react.useContext(TabsContext);
|
|
336
|
+
if (!ctx) {
|
|
337
|
+
throw new Error(`<${label}> must be rendered inside a <Tabs>.`);
|
|
338
|
+
}
|
|
339
|
+
return ctx;
|
|
340
|
+
}, "useTabsContext");
|
|
341
|
+
var TabsRoot = /* @__PURE__ */ __name(({
|
|
342
|
+
value,
|
|
343
|
+
defaultValue,
|
|
344
|
+
onChange,
|
|
345
|
+
orientation = "horizontal",
|
|
346
|
+
activation = "automatic",
|
|
347
|
+
children,
|
|
348
|
+
className,
|
|
349
|
+
testID
|
|
350
|
+
}) => {
|
|
351
|
+
const baseId = react.useId();
|
|
352
|
+
const [inner, setInner] = react.useState(defaultValue);
|
|
353
|
+
const isControlled = value !== void 0;
|
|
354
|
+
const current = isControlled ? value : inner;
|
|
355
|
+
const refs = react.useRef(/* @__PURE__ */ new Map());
|
|
356
|
+
const orderRef = react.useRef([]);
|
|
357
|
+
const setValue = react.useCallback(
|
|
358
|
+
(next) => {
|
|
359
|
+
if (!isControlled) {
|
|
360
|
+
setInner(next);
|
|
361
|
+
}
|
|
362
|
+
onChange?.(next);
|
|
363
|
+
},
|
|
364
|
+
[isControlled, onChange]
|
|
365
|
+
);
|
|
366
|
+
const register = react.useCallback((v, ref) => {
|
|
367
|
+
refs.current.set(v, ref);
|
|
368
|
+
if (!orderRef.current.includes(v)) {
|
|
369
|
+
orderRef.current.push(v);
|
|
370
|
+
}
|
|
371
|
+
}, []);
|
|
372
|
+
const unregister = react.useCallback((v) => {
|
|
373
|
+
refs.current.delete(v);
|
|
374
|
+
orderRef.current = orderRef.current.filter((x) => x !== v);
|
|
375
|
+
}, []);
|
|
376
|
+
const focusValue = react.useCallback(
|
|
377
|
+
(next) => {
|
|
378
|
+
const ref = refs.current.get(next);
|
|
379
|
+
ref?.current?.focus?.();
|
|
380
|
+
if (activation === "automatic") {
|
|
381
|
+
setValue(next);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
[activation, setValue]
|
|
385
|
+
);
|
|
386
|
+
const moveFocus = react.useCallback(
|
|
387
|
+
(offset, fromValue) => {
|
|
388
|
+
const order = orderRef.current;
|
|
389
|
+
if (order.length === 0) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const idx = order.indexOf(fromValue);
|
|
393
|
+
const start = idx === -1 ? 0 : idx;
|
|
394
|
+
const len = order.length;
|
|
395
|
+
const next = order[(start + offset + len) % len];
|
|
396
|
+
if (next) {
|
|
397
|
+
focusValue(next);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
[focusValue]
|
|
401
|
+
);
|
|
402
|
+
const focusEdge = react.useCallback(
|
|
403
|
+
(edge) => {
|
|
404
|
+
const order = orderRef.current;
|
|
405
|
+
if (order.length === 0) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const target = edge === "first" ? order[0] : order[order.length - 1];
|
|
409
|
+
if (target) {
|
|
410
|
+
focusValue(target);
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
[focusValue]
|
|
414
|
+
);
|
|
415
|
+
const ctxValue = react.useMemo(
|
|
416
|
+
() => ({
|
|
417
|
+
value: current,
|
|
418
|
+
setValue,
|
|
419
|
+
baseId,
|
|
420
|
+
orientation,
|
|
421
|
+
activation,
|
|
422
|
+
register,
|
|
423
|
+
unregister,
|
|
424
|
+
moveFocus,
|
|
425
|
+
focusEdge
|
|
426
|
+
}),
|
|
427
|
+
[current, setValue, baseId, orientation, activation, register, unregister, moveFocus, focusEdge]
|
|
428
|
+
);
|
|
429
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
430
|
+
TabsViewport,
|
|
431
|
+
{
|
|
432
|
+
orientation,
|
|
433
|
+
...className !== void 0 ? { className } : {},
|
|
434
|
+
...testID !== void 0 ? { testID } : {},
|
|
435
|
+
children
|
|
436
|
+
}
|
|
437
|
+
) });
|
|
438
|
+
}, "TabsRoot");
|
|
439
|
+
var TabsViewport = /* @__PURE__ */ __name(({
|
|
440
|
+
orientation,
|
|
441
|
+
className,
|
|
442
|
+
testID,
|
|
443
|
+
children
|
|
444
|
+
}) => {
|
|
445
|
+
const colors = useThemeColors();
|
|
446
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
447
|
+
reactNative.View,
|
|
448
|
+
{
|
|
449
|
+
...testID !== void 0 ? { testID } : {},
|
|
450
|
+
className: cn(orientation === "vertical" ? "flex-row gap-4" : "flex-col gap-3", className),
|
|
451
|
+
style: orientation === "vertical" ? { flexDirection: "row", gap: px(colors.spacing["4"]) } : { flexDirection: "column", gap: px(colors.spacing["3"]) },
|
|
452
|
+
children
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
}, "TabsViewport");
|
|
456
|
+
var LIST_LAYOUT_BASE = {
|
|
457
|
+
flexDirection: "row",
|
|
458
|
+
alignItems: "center",
|
|
459
|
+
borderBottomWidth: 1
|
|
460
|
+
};
|
|
461
|
+
var LIST_VERTICAL_LAYOUT_BASE = {
|
|
462
|
+
flexDirection: "column",
|
|
463
|
+
alignItems: "stretch",
|
|
464
|
+
borderRightWidth: 1
|
|
465
|
+
};
|
|
466
|
+
var TabsList = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
467
|
+
const ctx = useTabsContext("TabsList");
|
|
468
|
+
const colors = useThemeColors();
|
|
469
|
+
const gap = px(colors.spacing["1"]);
|
|
470
|
+
const listStyle = ctx.orientation === "vertical" ? { ...LIST_VERTICAL_LAYOUT_BASE, gap, borderRightColor: colors.semantic.border.default } : { ...LIST_LAYOUT_BASE, gap, borderBottomColor: colors.semantic.border.default };
|
|
471
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
472
|
+
reactNative.View,
|
|
473
|
+
{
|
|
474
|
+
...testID !== void 0 ? { testID } : {},
|
|
475
|
+
role: "tablist",
|
|
476
|
+
accessibilityRole: "tablist",
|
|
477
|
+
"aria-orientation": ctx.orientation,
|
|
478
|
+
className: cn(
|
|
479
|
+
ctx.orientation === "vertical" ? "flex-col gap-1 border-r border-semantic-border-default" : "flex-row items-center gap-1 border-b border-semantic-border-default",
|
|
480
|
+
className
|
|
481
|
+
),
|
|
482
|
+
style: listStyle,
|
|
483
|
+
children
|
|
484
|
+
}
|
|
485
|
+
);
|
|
486
|
+
}, "TabsList");
|
|
487
|
+
var TRIGGER_TRANSITION = {
|
|
488
|
+
transitionProperty: "border-color, color",
|
|
489
|
+
transitionDuration: "200ms",
|
|
490
|
+
transitionTimingFunction: "ease"
|
|
491
|
+
};
|
|
492
|
+
var TRIGGER_LAYOUT_BASE = {
|
|
493
|
+
borderBottomWidth: 2,
|
|
494
|
+
borderBottomColor: "transparent",
|
|
495
|
+
marginBottom: -1,
|
|
496
|
+
...TRIGGER_TRANSITION
|
|
497
|
+
};
|
|
498
|
+
var TRIGGER_LAYOUT_BASE_VERTICAL = {
|
|
499
|
+
borderRightWidth: 2,
|
|
500
|
+
borderRightColor: "transparent",
|
|
501
|
+
marginRight: -1,
|
|
502
|
+
...TRIGGER_TRANSITION
|
|
503
|
+
};
|
|
504
|
+
var TabsTrigger = /* @__PURE__ */ __name(({ value, disabled, children, className, testID }) => {
|
|
505
|
+
const ctx = useTabsContext("TabsTrigger");
|
|
506
|
+
const colors = useThemeColors();
|
|
507
|
+
const ownRef = react.useRef(null);
|
|
508
|
+
const selected = ctx.value === value;
|
|
509
|
+
const isVertical = ctx.orientation === "vertical";
|
|
510
|
+
react.useEffect(() => {
|
|
511
|
+
ctx.register(value, ownRef);
|
|
512
|
+
return () => ctx.unregister(value);
|
|
513
|
+
}, [ctx, value]);
|
|
514
|
+
const onPress = react.useCallback(() => {
|
|
515
|
+
if (disabled) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
ctx.setValue(value);
|
|
519
|
+
}, [ctx, value, disabled]);
|
|
520
|
+
const handleKeyDown = react.useCallback(
|
|
521
|
+
(event) => {
|
|
522
|
+
const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
|
|
523
|
+
const prevKey = isVertical ? "ArrowUp" : "ArrowLeft";
|
|
524
|
+
switch (event.key) {
|
|
525
|
+
case nextKey:
|
|
526
|
+
event.preventDefault();
|
|
527
|
+
ctx.moveFocus(1, value);
|
|
528
|
+
return;
|
|
529
|
+
case prevKey:
|
|
530
|
+
event.preventDefault();
|
|
531
|
+
ctx.moveFocus(-1, value);
|
|
532
|
+
return;
|
|
533
|
+
case "Home":
|
|
534
|
+
event.preventDefault();
|
|
535
|
+
ctx.focusEdge("first");
|
|
536
|
+
return;
|
|
537
|
+
case "End":
|
|
538
|
+
event.preventDefault();
|
|
539
|
+
ctx.focusEdge("last");
|
|
540
|
+
return;
|
|
541
|
+
case "Enter":
|
|
542
|
+
case " ": {
|
|
543
|
+
if (ctx.activation === "manual") {
|
|
544
|
+
event.preventDefault();
|
|
545
|
+
if (!disabled) {
|
|
546
|
+
ctx.setValue(value);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
[ctx, value, disabled, isVertical]
|
|
554
|
+
);
|
|
555
|
+
const accentStyle = selected ? isVertical ? { borderRightColor: colors.semantic.interactive.primary } : { borderBottomColor: colors.semantic.interactive.primary } : null;
|
|
556
|
+
const triggerProps = {
|
|
557
|
+
ref: /* @__PURE__ */ __name((node) => {
|
|
558
|
+
ownRef.current = node;
|
|
559
|
+
}, "ref"),
|
|
560
|
+
role: "tab",
|
|
561
|
+
accessibilityRole: "tab",
|
|
562
|
+
"aria-selected": selected,
|
|
563
|
+
"aria-controls": `${ctx.baseId}-panel-${value}`,
|
|
564
|
+
id: `${ctx.baseId}-tab-${value}`,
|
|
565
|
+
tabIndex: selected ? 0 : -1,
|
|
566
|
+
onPress,
|
|
567
|
+
onKeyDown: handleKeyDown,
|
|
568
|
+
...disabled ? { "aria-disabled": true, disabled: true } : {},
|
|
569
|
+
...testID !== void 0 ? { testID } : {}
|
|
570
|
+
};
|
|
571
|
+
const triggerPadding = {
|
|
572
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
573
|
+
paddingVertical: px(colors.spacing["2"])
|
|
574
|
+
};
|
|
575
|
+
const triggerStyle = isVertical ? { ...TRIGGER_LAYOUT_BASE_VERTICAL, ...triggerPadding } : { ...TRIGGER_LAYOUT_BASE, ...triggerPadding };
|
|
576
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
577
|
+
reactNative.Pressable,
|
|
578
|
+
{
|
|
579
|
+
...triggerProps,
|
|
580
|
+
className: cn(
|
|
581
|
+
isVertical ? "px-3 py-2 -mr-px border-r-2 border-r-transparent" : "px-3 py-2 -mb-px border-b-2 border-b-transparent",
|
|
582
|
+
selected ? "border-r-semantic-interactive-primary" : "",
|
|
583
|
+
disabled ? "opacity-50" : "opacity-100",
|
|
584
|
+
className
|
|
585
|
+
),
|
|
586
|
+
style: [triggerStyle, accentStyle, disabled ? { opacity: 0.5 } : null],
|
|
587
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
588
|
+
reactNative.Text,
|
|
589
|
+
{
|
|
590
|
+
style: {
|
|
591
|
+
color: selected ? colors.semantic.interactive.primary : colors.semantic.text.muted,
|
|
592
|
+
fontFamily: colors.fontFamily.body,
|
|
593
|
+
fontSize: px(colors.fontSize.sm),
|
|
594
|
+
fontWeight: selected ? colors.fontWeight.semibold : colors.fontWeight.medium
|
|
595
|
+
},
|
|
596
|
+
children
|
|
597
|
+
}
|
|
598
|
+
) : children
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
}, "TabsTrigger");
|
|
602
|
+
var TabsContent = /* @__PURE__ */ __name(({ value, children, className, testID }) => {
|
|
603
|
+
const ctx = useTabsContext("TabsContent");
|
|
604
|
+
const active = ctx.value === value;
|
|
605
|
+
if (!active) {
|
|
606
|
+
return null;
|
|
607
|
+
}
|
|
608
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
609
|
+
reactNative.View,
|
|
610
|
+
{
|
|
611
|
+
...testID !== void 0 ? { testID } : {},
|
|
612
|
+
role: "tabpanel",
|
|
613
|
+
accessibilityRole: "none",
|
|
614
|
+
id: `${ctx.baseId}-panel-${value}`,
|
|
615
|
+
"aria-labelledby": `${ctx.baseId}-tab-${value}`,
|
|
616
|
+
tabIndex: 0,
|
|
617
|
+
className: cn("outline-none", className),
|
|
618
|
+
children
|
|
619
|
+
}
|
|
620
|
+
);
|
|
621
|
+
}, "TabsContent");
|
|
622
|
+
var Tabs = Object.assign(TabsRoot, {
|
|
623
|
+
List: TabsList,
|
|
624
|
+
Trigger: TabsTrigger,
|
|
625
|
+
Content: TabsContent
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
exports.Tabs = Tabs;
|
|
629
|
+
//# sourceMappingURL=index.cjs.map
|
|
630
|
+
//# sourceMappingURL=index.cjs.map
|