@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,1939 @@
|
|
|
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/i18n/default-dictionary.ts
|
|
11
|
+
var defaultDictionary = {
|
|
12
|
+
// generic / shared
|
|
13
|
+
"common.cancel": "Cancel",
|
|
14
|
+
"common.confirm": "Confirm",
|
|
15
|
+
"common.close": "Close",
|
|
16
|
+
"common.back": "Back",
|
|
17
|
+
"common.loading": "Loading",
|
|
18
|
+
"common.error": "Something went wrong",
|
|
19
|
+
"common.retry": "Try again",
|
|
20
|
+
// breadcrumb
|
|
21
|
+
"breadcrumb.ariaLabel": "Breadcrumb",
|
|
22
|
+
"breadcrumb.expandLabel": "Show full path",
|
|
23
|
+
"breadcrumb.ellipsisLabel": "More",
|
|
24
|
+
"breadcrumb.currentPageLabel": "Current page",
|
|
25
|
+
"breadcrumb.siblingMenuLabel": "Open sibling pages",
|
|
26
|
+
// pagination
|
|
27
|
+
"pagination.ariaLabel": "Pagination",
|
|
28
|
+
"pagination.previous": "Previous page",
|
|
29
|
+
"pagination.next": "Next page",
|
|
30
|
+
"pagination.first": "First page",
|
|
31
|
+
"pagination.last": "Last page",
|
|
32
|
+
"pagination.ellipsis": "More pages",
|
|
33
|
+
"pagination.currentPage": "Current page",
|
|
34
|
+
"pagination.gotoPage": "Go to page {{page}}",
|
|
35
|
+
"pagination.range": "Showing {{from}}\u2013{{to}} of {{total}}",
|
|
36
|
+
"pagination.pageOf": "Page {{page}} of {{total}}",
|
|
37
|
+
"pagination.pageSizeLabel": "Items per page",
|
|
38
|
+
"pagination.jumperLabel": "Go to page",
|
|
39
|
+
"pagination.jumperPlaceholder": "#",
|
|
40
|
+
// floatButton
|
|
41
|
+
"floatButton.backToTop": "Back to top",
|
|
42
|
+
// calendar
|
|
43
|
+
"calendar.header.previous": "Previous",
|
|
44
|
+
"calendar.header.next": "Next",
|
|
45
|
+
"calendar.header.openMonthView": "Open month picker",
|
|
46
|
+
"calendar.header.openYearView": "Open year picker",
|
|
47
|
+
"calendar.header.openDayView": "Open day picker",
|
|
48
|
+
"calendar.today": "Today",
|
|
49
|
+
"calendar.clear": "Clear",
|
|
50
|
+
// button
|
|
51
|
+
"button.loadingLabel": "Loading",
|
|
52
|
+
// input
|
|
53
|
+
"input.clear": "Clear",
|
|
54
|
+
"input.passwordShow": "Show password",
|
|
55
|
+
"input.passwordHide": "Hide password",
|
|
56
|
+
// checkbox / switch
|
|
57
|
+
"checkbox.checked": "Checked",
|
|
58
|
+
"checkbox.unchecked": "Unchecked",
|
|
59
|
+
"switch.on": "On",
|
|
60
|
+
"switch.off": "Off"
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/i18n/resolve.ts
|
|
64
|
+
function resolveI18n(input, defaults) {
|
|
65
|
+
if (typeof input === "function") {
|
|
66
|
+
return (keyOrKeys, options) => input(keyOrKeys, options);
|
|
67
|
+
}
|
|
68
|
+
const dict = input ?? {};
|
|
69
|
+
return (keyOrKeys, options) => {
|
|
70
|
+
const keys = Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];
|
|
71
|
+
for (const rawKey of keys) {
|
|
72
|
+
const key = pluralize(rawKey, options?.count);
|
|
73
|
+
const template = dict[key] ?? defaults[key];
|
|
74
|
+
if (template !== void 0) {
|
|
75
|
+
return interpolate(template, options);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const lastKey = keys[keys.length - 1];
|
|
79
|
+
if (options?.defaultValue !== void 0) {
|
|
80
|
+
return interpolate(options.defaultValue, options);
|
|
81
|
+
}
|
|
82
|
+
return lastKey ?? "";
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
__name(resolveI18n, "resolveI18n");
|
|
86
|
+
function pluralize(key, count) {
|
|
87
|
+
if (count === void 0) {
|
|
88
|
+
return key;
|
|
89
|
+
}
|
|
90
|
+
if (count === 1) {
|
|
91
|
+
return `${key}_one`;
|
|
92
|
+
}
|
|
93
|
+
return `${key}_other`;
|
|
94
|
+
}
|
|
95
|
+
__name(pluralize, "pluralize");
|
|
96
|
+
function interpolate(template, options) {
|
|
97
|
+
if (!options) {
|
|
98
|
+
return template;
|
|
99
|
+
}
|
|
100
|
+
return template.replace(/\{\{\s*([A-Za-z0-9_.-]+)\s*\}\}/g, (_match, name) => {
|
|
101
|
+
const value = options[name];
|
|
102
|
+
return value === void 0 || value === null ? "" : String(value);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
__name(interpolate, "interpolate");
|
|
106
|
+
var defaultValue = {
|
|
107
|
+
t: resolveI18n(void 0, defaultDictionary)
|
|
108
|
+
};
|
|
109
|
+
var I18nContext = react.createContext(defaultValue);
|
|
110
|
+
I18nContext.displayName = "I18nContext";
|
|
111
|
+
|
|
112
|
+
// src/i18n/use-translation.ts
|
|
113
|
+
function useTranslation() {
|
|
114
|
+
return react.useContext(I18nContext);
|
|
115
|
+
}
|
|
116
|
+
__name(useTranslation, "useTranslation");
|
|
117
|
+
|
|
118
|
+
// src/slot/compose-refs.ts
|
|
119
|
+
function composeRefs(...refs) {
|
|
120
|
+
return (node) => {
|
|
121
|
+
for (const ref of refs) {
|
|
122
|
+
if (ref == null) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (typeof ref === "function") {
|
|
126
|
+
ref(node);
|
|
127
|
+
} else {
|
|
128
|
+
ref.current = node;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
__name(composeRefs, "composeRefs");
|
|
134
|
+
var Slot = react.forwardRef(/* @__PURE__ */ __name(function Slot2(props, forwardedRef) {
|
|
135
|
+
const { children, ...slotProps } = props;
|
|
136
|
+
if (!react.isValidElement(children)) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
const child = react.Children.only(children);
|
|
140
|
+
const merged = mergeProps(slotProps, child.props);
|
|
141
|
+
const childRef = child.ref;
|
|
142
|
+
if (forwardedRef || childRef) {
|
|
143
|
+
merged.ref = composeRefs(forwardedRef, childRef);
|
|
144
|
+
}
|
|
145
|
+
return react.cloneElement(child, merged);
|
|
146
|
+
}, "Slot"));
|
|
147
|
+
Slot.displayName = "Slot";
|
|
148
|
+
function mergeProps(outer, inner) {
|
|
149
|
+
const merged = { ...outer };
|
|
150
|
+
for (const key of Object.keys(inner)) {
|
|
151
|
+
const outerValue = outer[key];
|
|
152
|
+
const innerValue = inner[key];
|
|
153
|
+
if (key === "className" || key === "class") {
|
|
154
|
+
merged[key] = joinClass(outerValue, innerValue);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (key === "style") {
|
|
158
|
+
merged[key] = {
|
|
159
|
+
...outerValue,
|
|
160
|
+
...innerValue
|
|
161
|
+
};
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (isEventHandler(key, outerValue, innerValue)) {
|
|
165
|
+
merged[key] = composeHandlers(outerValue, innerValue);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
merged[key] = innerValue;
|
|
169
|
+
}
|
|
170
|
+
return merged;
|
|
171
|
+
}
|
|
172
|
+
__name(mergeProps, "mergeProps");
|
|
173
|
+
function joinClass(outer, inner) {
|
|
174
|
+
const a = typeof outer === "string" ? outer : "";
|
|
175
|
+
const b = typeof inner === "string" ? inner : "";
|
|
176
|
+
const joined = [a, b].filter(Boolean).join(" ");
|
|
177
|
+
return joined.length > 0 ? joined : void 0;
|
|
178
|
+
}
|
|
179
|
+
__name(joinClass, "joinClass");
|
|
180
|
+
function isEventHandler(key, outer, inner) {
|
|
181
|
+
if (!key.startsWith("on") || key.length < 3) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
if (key[2] !== key[2]?.toUpperCase()) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
return typeof outer === "function" && typeof inner === "function";
|
|
188
|
+
}
|
|
189
|
+
__name(isEventHandler, "isEventHandler");
|
|
190
|
+
function composeHandlers(outer, inner) {
|
|
191
|
+
return (...args) => {
|
|
192
|
+
outer(...args);
|
|
193
|
+
inner(...args);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
__name(composeHandlers, "composeHandlers");
|
|
197
|
+
|
|
198
|
+
// src/theme/px.ts
|
|
199
|
+
function px(value) {
|
|
200
|
+
if (typeof value === "number") {
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
203
|
+
const n = Number.parseFloat(value);
|
|
204
|
+
return Number.isFinite(n) ? n : 0;
|
|
205
|
+
}
|
|
206
|
+
__name(px, "px");
|
|
207
|
+
|
|
208
|
+
// ../tokens/build/theme.ts
|
|
209
|
+
var theme = {
|
|
210
|
+
color: {
|
|
211
|
+
danger: "#ef4444",
|
|
212
|
+
info: "#3b82f6",
|
|
213
|
+
neutral: {
|
|
214
|
+
"100": "#f4f4f5",
|
|
215
|
+
"200": "#e4e4e7",
|
|
216
|
+
"300": "#d4d4d8",
|
|
217
|
+
"400": "#a1a1aa",
|
|
218
|
+
"50": "#fafafa",
|
|
219
|
+
"500": "#71717a",
|
|
220
|
+
"600": "#52525b",
|
|
221
|
+
"700": "#3f3f46",
|
|
222
|
+
"800": "#27272a",
|
|
223
|
+
"900": "#18181b"
|
|
224
|
+
},
|
|
225
|
+
primary: {
|
|
226
|
+
"100": "#ccfbf1",
|
|
227
|
+
"200": "#99f6e4",
|
|
228
|
+
"300": "#5eead4",
|
|
229
|
+
"400": "#2dd4bf",
|
|
230
|
+
"50": "#f0fdfa",
|
|
231
|
+
"500": "#14b8a6",
|
|
232
|
+
"600": "#0d9488",
|
|
233
|
+
"700": "#0f766e",
|
|
234
|
+
"800": "#115e59",
|
|
235
|
+
"900": "#134e4a"
|
|
236
|
+
},
|
|
237
|
+
success: "#22c55e",
|
|
238
|
+
warning: "#f59e0b"
|
|
239
|
+
},
|
|
240
|
+
fontFamily: {
|
|
241
|
+
body: "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
|
|
242
|
+
display: "ui-serif, Georgia, 'Times New Roman', serif",
|
|
243
|
+
mono: "ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
|
244
|
+
},
|
|
245
|
+
fontSize: {
|
|
246
|
+
"2xl": "24px",
|
|
247
|
+
"3xl": "30px",
|
|
248
|
+
"4xl": "36px",
|
|
249
|
+
lg: "18px",
|
|
250
|
+
md: "16px",
|
|
251
|
+
sm: "14px",
|
|
252
|
+
xl: "20px",
|
|
253
|
+
xs: "12px"
|
|
254
|
+
},
|
|
255
|
+
fontWeight: {
|
|
256
|
+
bold: "700",
|
|
257
|
+
medium: "500",
|
|
258
|
+
regular: "400",
|
|
259
|
+
semibold: "600"
|
|
260
|
+
},
|
|
261
|
+
lineHeight: {
|
|
262
|
+
normal: "1.4",
|
|
263
|
+
relaxed: "1.6",
|
|
264
|
+
tight: "1.2"
|
|
265
|
+
},
|
|
266
|
+
radius: {
|
|
267
|
+
"2xl": "16px",
|
|
268
|
+
full: "9999px",
|
|
269
|
+
lg: "8px",
|
|
270
|
+
md: "6px",
|
|
271
|
+
none: "0px",
|
|
272
|
+
sm: "4px",
|
|
273
|
+
xl: "12px"
|
|
274
|
+
},
|
|
275
|
+
semantic: {
|
|
276
|
+
background: {
|
|
277
|
+
default: "#fafafa",
|
|
278
|
+
elevated: "#ffffff",
|
|
279
|
+
subtle: "#f4f4f5"
|
|
280
|
+
},
|
|
281
|
+
border: {
|
|
282
|
+
default: "#e4e4e7",
|
|
283
|
+
strong: "#d4d4d8"
|
|
284
|
+
},
|
|
285
|
+
interactive: {
|
|
286
|
+
destructive: "#ef4444",
|
|
287
|
+
primary: "#0d9488",
|
|
288
|
+
primaryHover: "#0f766e",
|
|
289
|
+
primaryPressed: "#115e59"
|
|
290
|
+
},
|
|
291
|
+
text: {
|
|
292
|
+
default: "#18181b",
|
|
293
|
+
inverted: "#fafafa",
|
|
294
|
+
muted: "#52525b"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
shadow: {
|
|
298
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
299
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
300
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
301
|
+
},
|
|
302
|
+
spacing: {
|
|
303
|
+
"0": "0px",
|
|
304
|
+
"1": "4px",
|
|
305
|
+
"10": "40px",
|
|
306
|
+
"12": "48px",
|
|
307
|
+
"16": "64px",
|
|
308
|
+
"2": "8px",
|
|
309
|
+
"20": "80px",
|
|
310
|
+
"24": "96px",
|
|
311
|
+
"3": "12px",
|
|
312
|
+
"4": "16px",
|
|
313
|
+
"5": "20px",
|
|
314
|
+
"6": "24px",
|
|
315
|
+
"8": "32px"
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
var themeDark = {
|
|
319
|
+
color: {
|
|
320
|
+
danger: "#ef4444",
|
|
321
|
+
info: "#3b82f6",
|
|
322
|
+
neutral: {
|
|
323
|
+
"100": "#f4f4f5",
|
|
324
|
+
"200": "#e4e4e7",
|
|
325
|
+
"300": "#d4d4d8",
|
|
326
|
+
"400": "#a1a1aa",
|
|
327
|
+
"50": "#fafafa",
|
|
328
|
+
"500": "#71717a",
|
|
329
|
+
"600": "#52525b",
|
|
330
|
+
"700": "#3f3f46",
|
|
331
|
+
"800": "#27272a",
|
|
332
|
+
"900": "#18181b"
|
|
333
|
+
},
|
|
334
|
+
primary: {
|
|
335
|
+
"100": "#ccfbf1",
|
|
336
|
+
"200": "#99f6e4",
|
|
337
|
+
"300": "#5eead4",
|
|
338
|
+
"400": "#2dd4bf",
|
|
339
|
+
"50": "#f0fdfa",
|
|
340
|
+
"500": "#14b8a6",
|
|
341
|
+
"600": "#0d9488",
|
|
342
|
+
"700": "#0f766e",
|
|
343
|
+
"800": "#115e59",
|
|
344
|
+
"900": "#134e4a"
|
|
345
|
+
},
|
|
346
|
+
success: "#22c55e",
|
|
347
|
+
warning: "#f59e0b"
|
|
348
|
+
},
|
|
349
|
+
fontFamily: {
|
|
350
|
+
body: "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
|
|
351
|
+
display: "ui-serif, Georgia, 'Times New Roman', serif",
|
|
352
|
+
mono: "ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
|
|
353
|
+
},
|
|
354
|
+
fontSize: {
|
|
355
|
+
"2xl": "24px",
|
|
356
|
+
"3xl": "30px",
|
|
357
|
+
"4xl": "36px",
|
|
358
|
+
lg: "18px",
|
|
359
|
+
md: "16px",
|
|
360
|
+
sm: "14px",
|
|
361
|
+
xl: "20px",
|
|
362
|
+
xs: "12px"
|
|
363
|
+
},
|
|
364
|
+
fontWeight: {
|
|
365
|
+
bold: "700",
|
|
366
|
+
medium: "500",
|
|
367
|
+
regular: "400",
|
|
368
|
+
semibold: "600"
|
|
369
|
+
},
|
|
370
|
+
lineHeight: {
|
|
371
|
+
normal: "1.4",
|
|
372
|
+
relaxed: "1.6",
|
|
373
|
+
tight: "1.2"
|
|
374
|
+
},
|
|
375
|
+
radius: {
|
|
376
|
+
"2xl": "16px",
|
|
377
|
+
full: "9999px",
|
|
378
|
+
lg: "8px",
|
|
379
|
+
md: "6px",
|
|
380
|
+
none: "0px",
|
|
381
|
+
sm: "4px",
|
|
382
|
+
xl: "12px"
|
|
383
|
+
},
|
|
384
|
+
semantic: {
|
|
385
|
+
background: {
|
|
386
|
+
default: "#18181b",
|
|
387
|
+
elevated: "#3f3f46",
|
|
388
|
+
subtle: "#27272a"
|
|
389
|
+
},
|
|
390
|
+
border: {
|
|
391
|
+
default: "#3f3f46",
|
|
392
|
+
strong: "#52525b"
|
|
393
|
+
},
|
|
394
|
+
interactive: {
|
|
395
|
+
destructive: "#ef4444",
|
|
396
|
+
primary: "#2dd4bf",
|
|
397
|
+
primaryHover: "#5eead4",
|
|
398
|
+
primaryPressed: "#99f6e4"
|
|
399
|
+
},
|
|
400
|
+
text: {
|
|
401
|
+
default: "#fafafa",
|
|
402
|
+
inverted: "#18181b",
|
|
403
|
+
muted: "#a1a1aa"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
shadow: {
|
|
407
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
408
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
409
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
410
|
+
},
|
|
411
|
+
spacing: {
|
|
412
|
+
"0": "0px",
|
|
413
|
+
"1": "4px",
|
|
414
|
+
"10": "40px",
|
|
415
|
+
"12": "48px",
|
|
416
|
+
"16": "64px",
|
|
417
|
+
"2": "8px",
|
|
418
|
+
"20": "80px",
|
|
419
|
+
"24": "96px",
|
|
420
|
+
"3": "12px",
|
|
421
|
+
"4": "16px",
|
|
422
|
+
"5": "20px",
|
|
423
|
+
"6": "24px",
|
|
424
|
+
"8": "32px"
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
var defaultTheme = {
|
|
428
|
+
light: theme,
|
|
429
|
+
dark: themeDark
|
|
430
|
+
};
|
|
431
|
+
var ThemeContext = react.createContext(defaultTheme);
|
|
432
|
+
ThemeContext.displayName = "ThemeContext";
|
|
433
|
+
var ColorSchemeOverrideContext = react.createContext(null);
|
|
434
|
+
ColorSchemeOverrideContext.displayName = "ColorSchemeOverrideContext";
|
|
435
|
+
var isWeb = reactNative.Platform.OS === "web";
|
|
436
|
+
function readWebScheme() {
|
|
437
|
+
if (typeof document === "undefined") {
|
|
438
|
+
return "light";
|
|
439
|
+
}
|
|
440
|
+
const root = document.documentElement;
|
|
441
|
+
if (root.classList.contains("dark")) {
|
|
442
|
+
return "dark";
|
|
443
|
+
}
|
|
444
|
+
if (root.getAttribute("data-theme") === "dark") {
|
|
445
|
+
return "dark";
|
|
446
|
+
}
|
|
447
|
+
return "light";
|
|
448
|
+
}
|
|
449
|
+
__name(readWebScheme, "readWebScheme");
|
|
450
|
+
function useColorScheme() {
|
|
451
|
+
const override = react.useContext(ColorSchemeOverrideContext);
|
|
452
|
+
const [scheme, setScheme] = react.useState(() => {
|
|
453
|
+
if (isWeb) {
|
|
454
|
+
return readWebScheme();
|
|
455
|
+
}
|
|
456
|
+
return reactNative.Appearance.getColorScheme() ?? "light";
|
|
457
|
+
});
|
|
458
|
+
react.useEffect(() => {
|
|
459
|
+
if (isWeb) {
|
|
460
|
+
const root = document.documentElement;
|
|
461
|
+
const update = /* @__PURE__ */ __name(() => setScheme(readWebScheme()), "update");
|
|
462
|
+
const observer = new MutationObserver(update);
|
|
463
|
+
observer.observe(root, { attributes: true, attributeFilter: ["class", "data-theme"] });
|
|
464
|
+
update();
|
|
465
|
+
return () => observer.disconnect();
|
|
466
|
+
}
|
|
467
|
+
const sub = reactNative.Appearance.addChangeListener(({ colorScheme }) => {
|
|
468
|
+
setScheme(colorScheme ?? "light");
|
|
469
|
+
});
|
|
470
|
+
return () => sub.remove();
|
|
471
|
+
}, []);
|
|
472
|
+
return override ?? scheme;
|
|
473
|
+
}
|
|
474
|
+
__name(useColorScheme, "useColorScheme");
|
|
475
|
+
|
|
476
|
+
// src/theme/use-theme-colors.ts
|
|
477
|
+
function useThemeColors() {
|
|
478
|
+
const scheme = useColorScheme();
|
|
479
|
+
const themePair = react.useContext(ThemeContext);
|
|
480
|
+
return scheme === "dark" ? themePair.dark : themePair.light;
|
|
481
|
+
}
|
|
482
|
+
__name(useThemeColors, "useThemeColors");
|
|
483
|
+
|
|
484
|
+
// src/utils/cn.ts
|
|
485
|
+
function cn(...inputs) {
|
|
486
|
+
const out = [];
|
|
487
|
+
for (const input of inputs) {
|
|
488
|
+
append(out, input);
|
|
489
|
+
}
|
|
490
|
+
return out.join(" ");
|
|
491
|
+
}
|
|
492
|
+
__name(cn, "cn");
|
|
493
|
+
function append(out, input) {
|
|
494
|
+
if (!input) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (typeof input === "string") {
|
|
498
|
+
if (input.length > 0) {
|
|
499
|
+
out.push(input);
|
|
500
|
+
}
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
if (typeof input === "number") {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
if (Array.isArray(input)) {
|
|
507
|
+
for (const inner of input) {
|
|
508
|
+
append(out, inner);
|
|
509
|
+
}
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (typeof input === "object") {
|
|
513
|
+
for (const key of Object.keys(input)) {
|
|
514
|
+
if (input[key]) {
|
|
515
|
+
out.push(key);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
__name(append, "append");
|
|
521
|
+
var PopoverContext = react.createContext(null);
|
|
522
|
+
var usePopoverContext = /* @__PURE__ */ __name((label) => {
|
|
523
|
+
const ctx = react.useContext(PopoverContext);
|
|
524
|
+
if (!ctx) {
|
|
525
|
+
throw new Error(`<${label}> must be rendered inside a <Popover>.`);
|
|
526
|
+
}
|
|
527
|
+
return ctx;
|
|
528
|
+
}, "usePopoverContext");
|
|
529
|
+
var PopoverRoot = /* @__PURE__ */ __name(({ open, defaultOpen = false, onOpenChange, children }) => {
|
|
530
|
+
const [inner, setInner] = react.useState(defaultOpen);
|
|
531
|
+
const isControlled = open !== void 0;
|
|
532
|
+
const current = isControlled ? open : inner;
|
|
533
|
+
const setOpen = react.useCallback(
|
|
534
|
+
(next) => {
|
|
535
|
+
if (!isControlled) {
|
|
536
|
+
setInner(next);
|
|
537
|
+
}
|
|
538
|
+
onOpenChange?.(next);
|
|
539
|
+
},
|
|
540
|
+
[isControlled, onOpenChange]
|
|
541
|
+
);
|
|
542
|
+
const baseId = react.useId();
|
|
543
|
+
const triggerRef = react.useRef(null);
|
|
544
|
+
const contentRef = react.useRef(null);
|
|
545
|
+
const [triggerRect, setTriggerRect] = react.useState(null);
|
|
546
|
+
const measureTrigger = react.useCallback(() => {
|
|
547
|
+
const node = triggerRef.current;
|
|
548
|
+
if (!node || typeof node.getBoundingClientRect !== "function") {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
const rect = node.getBoundingClientRect();
|
|
552
|
+
setTriggerRect({ top: rect.top, left: rect.left, width: rect.width, height: rect.height });
|
|
553
|
+
}, []);
|
|
554
|
+
const ctxValue = {
|
|
555
|
+
open: current,
|
|
556
|
+
setOpen,
|
|
557
|
+
contentId: `${baseId}-content`,
|
|
558
|
+
triggerRef,
|
|
559
|
+
contentRef,
|
|
560
|
+
triggerRect,
|
|
561
|
+
measureTrigger
|
|
562
|
+
};
|
|
563
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PopoverContext.Provider, { value: ctxValue, children });
|
|
564
|
+
}, "PopoverRoot");
|
|
565
|
+
var PopoverTrigger = /* @__PURE__ */ __name(({ asChild = true, children, className, testID }) => {
|
|
566
|
+
const ctx = usePopoverContext("PopoverTrigger");
|
|
567
|
+
const onPress = react.useCallback(() => {
|
|
568
|
+
ctx.measureTrigger();
|
|
569
|
+
ctx.setOpen(!ctx.open);
|
|
570
|
+
}, [ctx]);
|
|
571
|
+
if (asChild && react.isValidElement(children)) {
|
|
572
|
+
const child = children;
|
|
573
|
+
const fire = /* @__PURE__ */ __name((existing) => (event) => {
|
|
574
|
+
existing?.(event);
|
|
575
|
+
ctx.measureTrigger();
|
|
576
|
+
ctx.setOpen(!ctx.open);
|
|
577
|
+
}, "fire");
|
|
578
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
+
Slot,
|
|
580
|
+
{
|
|
581
|
+
ref: (node) => {
|
|
582
|
+
ctx.triggerRef.current = node;
|
|
583
|
+
},
|
|
584
|
+
onClick: fire(child.props.onClick),
|
|
585
|
+
onPress: fire(child.props.onPress),
|
|
586
|
+
"aria-haspopup": "dialog",
|
|
587
|
+
"aria-expanded": ctx.open,
|
|
588
|
+
"aria-controls": ctx.contentId,
|
|
589
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
590
|
+
...className !== void 0 ? { className } : {},
|
|
591
|
+
children: child
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
596
|
+
reactNative.Pressable,
|
|
597
|
+
{
|
|
598
|
+
ref: (node) => {
|
|
599
|
+
ctx.triggerRef.current = node;
|
|
600
|
+
},
|
|
601
|
+
onPress,
|
|
602
|
+
...{
|
|
603
|
+
"aria-haspopup": "dialog",
|
|
604
|
+
"aria-expanded": ctx.open,
|
|
605
|
+
"aria-controls": ctx.contentId
|
|
606
|
+
},
|
|
607
|
+
...testID !== void 0 ? { testID } : {},
|
|
608
|
+
...className !== void 0 ? { className } : {},
|
|
609
|
+
children: wrapStringChildren(children)
|
|
610
|
+
}
|
|
611
|
+
);
|
|
612
|
+
}, "PopoverTrigger");
|
|
613
|
+
function wrapStringChildren(children) {
|
|
614
|
+
if (typeof children === "string" || typeof children === "number") {
|
|
615
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { children });
|
|
616
|
+
}
|
|
617
|
+
return children;
|
|
618
|
+
}
|
|
619
|
+
__name(wrapStringChildren, "wrapStringChildren");
|
|
620
|
+
var GAP = 4;
|
|
621
|
+
var MIN_WIDTH = 200;
|
|
622
|
+
var VIEWPORT_MARGIN = 8;
|
|
623
|
+
function computePosition(rect, side, align, contentSize) {
|
|
624
|
+
const cw = contentSize?.width ?? MIN_WIDTH;
|
|
625
|
+
const ch = contentSize?.height ?? 0;
|
|
626
|
+
let top = 0;
|
|
627
|
+
let left = 0;
|
|
628
|
+
switch (side) {
|
|
629
|
+
case "top":
|
|
630
|
+
top = rect.top - GAP - ch;
|
|
631
|
+
break;
|
|
632
|
+
case "bottom":
|
|
633
|
+
top = rect.top + rect.height + GAP;
|
|
634
|
+
break;
|
|
635
|
+
case "left":
|
|
636
|
+
left = rect.left - GAP - cw;
|
|
637
|
+
break;
|
|
638
|
+
case "right":
|
|
639
|
+
left = rect.left + rect.width + GAP;
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
if (side === "top" || side === "bottom") {
|
|
643
|
+
switch (align) {
|
|
644
|
+
case "start":
|
|
645
|
+
left = rect.left;
|
|
646
|
+
break;
|
|
647
|
+
case "center":
|
|
648
|
+
left = rect.left + rect.width / 2 - cw / 2;
|
|
649
|
+
break;
|
|
650
|
+
case "end":
|
|
651
|
+
left = rect.left + rect.width - cw;
|
|
652
|
+
break;
|
|
653
|
+
}
|
|
654
|
+
} else {
|
|
655
|
+
switch (align) {
|
|
656
|
+
case "start":
|
|
657
|
+
top = rect.top;
|
|
658
|
+
break;
|
|
659
|
+
case "center":
|
|
660
|
+
top = rect.top + rect.height / 2 - ch / 2;
|
|
661
|
+
break;
|
|
662
|
+
case "end":
|
|
663
|
+
top = rect.top + rect.height - ch;
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return { top, left };
|
|
668
|
+
}
|
|
669
|
+
__name(computePosition, "computePosition");
|
|
670
|
+
var PopoverContent = /* @__PURE__ */ __name(({
|
|
671
|
+
side = "bottom",
|
|
672
|
+
align = "center",
|
|
673
|
+
children,
|
|
674
|
+
className,
|
|
675
|
+
testID,
|
|
676
|
+
...rest
|
|
677
|
+
}) => {
|
|
678
|
+
const ctx = usePopoverContext("PopoverContent");
|
|
679
|
+
const colors = useThemeColors();
|
|
680
|
+
const ariaLabel = rest["aria-label"];
|
|
681
|
+
const [contentSize, setContentSize] = react.useState(null);
|
|
682
|
+
react.useEffect(() => {
|
|
683
|
+
if (!ctx.open) {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
if (reactNative.Platform.OS !== "web") {
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
if (typeof document === "undefined") {
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
ctx.measureTrigger();
|
|
693
|
+
const onDocMouseDown = /* @__PURE__ */ __name((event) => {
|
|
694
|
+
const target = event.target;
|
|
695
|
+
const trigger = ctx.triggerRef.current;
|
|
696
|
+
const content2 = ctx.contentRef.current;
|
|
697
|
+
if (trigger?.contains(target)) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
if (content2?.contains(target)) {
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
ctx.setOpen(false);
|
|
704
|
+
}, "onDocMouseDown");
|
|
705
|
+
const onKeyDown = /* @__PURE__ */ __name((event) => {
|
|
706
|
+
if (event.key === "Escape") {
|
|
707
|
+
event.preventDefault();
|
|
708
|
+
ctx.setOpen(false);
|
|
709
|
+
}
|
|
710
|
+
}, "onKeyDown");
|
|
711
|
+
const onResize = /* @__PURE__ */ __name(() => ctx.measureTrigger(), "onResize");
|
|
712
|
+
const onScroll = /* @__PURE__ */ __name(() => ctx.measureTrigger(), "onScroll");
|
|
713
|
+
document.addEventListener("mousedown", onDocMouseDown);
|
|
714
|
+
document.addEventListener("keydown", onKeyDown);
|
|
715
|
+
window.addEventListener("resize", onResize);
|
|
716
|
+
window.addEventListener("scroll", onScroll, true);
|
|
717
|
+
return () => {
|
|
718
|
+
document.removeEventListener("mousedown", onDocMouseDown);
|
|
719
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
720
|
+
window.removeEventListener("resize", onResize);
|
|
721
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
722
|
+
};
|
|
723
|
+
}, [ctx.open, ctx.measureTrigger, ctx.setOpen, ctx.triggerRef, ctx.contentRef]);
|
|
724
|
+
react.useEffect(() => {
|
|
725
|
+
if (!ctx.open) {
|
|
726
|
+
setContentSize(null);
|
|
727
|
+
}
|
|
728
|
+
}, [ctx.open]);
|
|
729
|
+
if (!ctx.open) {
|
|
730
|
+
return null;
|
|
731
|
+
}
|
|
732
|
+
const position = ctx.triggerRect ? computePosition(ctx.triggerRect, side, align, contentSize) : null;
|
|
733
|
+
const viewportWidth = reactNative.Dimensions.get("window").width;
|
|
734
|
+
const maxContentWidth = Math.max(MIN_WIDTH, viewportWidth - VIEWPORT_MARGIN * 2);
|
|
735
|
+
const contentBaseStyle = {
|
|
736
|
+
minWidth: MIN_WIDTH,
|
|
737
|
+
maxWidth: maxContentWidth,
|
|
738
|
+
borderRadius: px(colors.radius.lg),
|
|
739
|
+
borderWidth: 1,
|
|
740
|
+
borderColor: colors.semantic.border.default,
|
|
741
|
+
backgroundColor: colors.semantic.background.elevated,
|
|
742
|
+
padding: px(colors.spacing["4"]),
|
|
743
|
+
...reactNative.Platform.OS === "web" ? {
|
|
744
|
+
boxShadow: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
|
|
745
|
+
// Subtle scale-in. Skipped on native (do nothing fancy there).
|
|
746
|
+
transition: "opacity 120ms ease-out, transform 120ms ease-out",
|
|
747
|
+
transform: "scale(1)",
|
|
748
|
+
opacity: 1
|
|
749
|
+
} : { elevation: 8 }
|
|
750
|
+
};
|
|
751
|
+
const measuredWidth = contentSize?.width ?? maxContentWidth;
|
|
752
|
+
const clampedLeft = position ? Math.min(
|
|
753
|
+
Math.max(VIEWPORT_MARGIN, position.left),
|
|
754
|
+
Math.max(VIEWPORT_MARGIN, viewportWidth - measuredWidth - VIEWPORT_MARGIN)
|
|
755
|
+
) : 0;
|
|
756
|
+
const positionedStyle = reactNative.Platform.OS === "web" ? position ? {
|
|
757
|
+
position: "fixed",
|
|
758
|
+
top: position.top,
|
|
759
|
+
left: clampedLeft,
|
|
760
|
+
zIndex: 50
|
|
761
|
+
} : {
|
|
762
|
+
// Trigger not yet measured — render off-screen for a
|
|
763
|
+
// frame to avoid a flash at (0,0).
|
|
764
|
+
position: "fixed",
|
|
765
|
+
top: -9999,
|
|
766
|
+
left: -9999,
|
|
767
|
+
zIndex: 50
|
|
768
|
+
} : {};
|
|
769
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
770
|
+
reactNative.View,
|
|
771
|
+
{
|
|
772
|
+
ref: (node) => {
|
|
773
|
+
ctx.contentRef.current = node;
|
|
774
|
+
if (reactNative.Platform.OS !== "web") {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
if (!node) {
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (typeof node.getBoundingClientRect !== "function") {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
const rect = node.getBoundingClientRect();
|
|
784
|
+
if (!contentSize || contentSize.width !== rect.width || contentSize.height !== rect.height) {
|
|
785
|
+
setContentSize({ width: rect.width, height: rect.height });
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
...{
|
|
789
|
+
role: "dialog",
|
|
790
|
+
id: ctx.contentId,
|
|
791
|
+
...ariaLabel !== void 0 ? { "aria-label": ariaLabel, accessibilityLabel: ariaLabel } : {}
|
|
792
|
+
},
|
|
793
|
+
...testID !== void 0 ? { testID } : {},
|
|
794
|
+
className: cn(
|
|
795
|
+
"rounded-lg border border-semantic-border-default bg-semantic-background-elevated",
|
|
796
|
+
className
|
|
797
|
+
),
|
|
798
|
+
style: [contentBaseStyle, positionedStyle],
|
|
799
|
+
children
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
if (reactNative.Platform.OS === "web") {
|
|
803
|
+
return content;
|
|
804
|
+
}
|
|
805
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Modal, { visible: ctx.open, transparent: true, animationType: "fade", onRequestClose: () => ctx.setOpen(false), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
806
|
+
reactNative.Pressable,
|
|
807
|
+
{
|
|
808
|
+
accessibilityRole: "none",
|
|
809
|
+
"aria-hidden": true,
|
|
810
|
+
onPress: () => ctx.setOpen(false),
|
|
811
|
+
style: {
|
|
812
|
+
position: "absolute",
|
|
813
|
+
top: 0,
|
|
814
|
+
left: 0,
|
|
815
|
+
right: 0,
|
|
816
|
+
bottom: 0,
|
|
817
|
+
backgroundColor: "transparent"
|
|
818
|
+
},
|
|
819
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
820
|
+
reactNative.Pressable,
|
|
821
|
+
{
|
|
822
|
+
onPress: (event) => event.stopPropagation?.(),
|
|
823
|
+
style: {
|
|
824
|
+
position: "absolute",
|
|
825
|
+
top: ctx.triggerRect ? side === "top" ? Math.max(VIEWPORT_MARGIN, ctx.triggerRect.top - GAP - 80) : ctx.triggerRect.top + ctx.triggerRect.height + GAP : 80,
|
|
826
|
+
// Clamp horizontally so a wide popover near the
|
|
827
|
+
// right edge can still grow leftward without
|
|
828
|
+
// overflowing the screen.
|
|
829
|
+
left: ctx.triggerRect ? Math.min(
|
|
830
|
+
Math.max(VIEWPORT_MARGIN, ctx.triggerRect.left),
|
|
831
|
+
Math.max(VIEWPORT_MARGIN, viewportWidth - measuredWidth - VIEWPORT_MARGIN)
|
|
832
|
+
) : VIEWPORT_MARGIN * 2
|
|
833
|
+
},
|
|
834
|
+
children: content
|
|
835
|
+
}
|
|
836
|
+
)
|
|
837
|
+
}
|
|
838
|
+
) });
|
|
839
|
+
}, "PopoverContent");
|
|
840
|
+
var Popover = Object.assign(PopoverRoot, {
|
|
841
|
+
Trigger: PopoverTrigger,
|
|
842
|
+
Content: PopoverContent
|
|
843
|
+
});
|
|
844
|
+
var BreadcrumbContext = react.createContext(null);
|
|
845
|
+
var useBreadcrumbContext = /* @__PURE__ */ __name((label) => {
|
|
846
|
+
const ctx = react.useContext(BreadcrumbContext);
|
|
847
|
+
if (!ctx) {
|
|
848
|
+
throw new Error(`<${label}> must be rendered inside a <Breadcrumb>.`);
|
|
849
|
+
}
|
|
850
|
+
return ctx;
|
|
851
|
+
}, "useBreadcrumbContext");
|
|
852
|
+
var DEFAULT_ITEMS_BEFORE = 1;
|
|
853
|
+
var DEFAULT_ITEMS_AFTER = 1;
|
|
854
|
+
var COMPOUND_KIND_KEY = "__nori_breadcrumb_kind__";
|
|
855
|
+
function tagComponent(component, kind) {
|
|
856
|
+
component[COMPOUND_KIND_KEY] = kind;
|
|
857
|
+
return component;
|
|
858
|
+
}
|
|
859
|
+
__name(tagComponent, "tagComponent");
|
|
860
|
+
function getCompoundKind(node) {
|
|
861
|
+
if (!react.isValidElement(node)) {
|
|
862
|
+
return void 0;
|
|
863
|
+
}
|
|
864
|
+
const type = node.type;
|
|
865
|
+
const tagged = type?.[COMPOUND_KIND_KEY];
|
|
866
|
+
return tagged === "item" || tagged === "separator" ? tagged : void 0;
|
|
867
|
+
}
|
|
868
|
+
__name(getCompoundKind, "getCompoundKind");
|
|
869
|
+
var DefaultChevron = /* @__PURE__ */ __name(({ dir }) => {
|
|
870
|
+
const colors = useThemeColors();
|
|
871
|
+
const flipped = dir === "rtl";
|
|
872
|
+
if (reactNative.Platform.OS === "web") {
|
|
873
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
874
|
+
"svg",
|
|
875
|
+
{
|
|
876
|
+
width: 14,
|
|
877
|
+
height: 14,
|
|
878
|
+
viewBox: "0 0 24 24",
|
|
879
|
+
fill: "none",
|
|
880
|
+
stroke: colors.semantic.text.muted,
|
|
881
|
+
strokeWidth: 2,
|
|
882
|
+
strokeLinecap: "round",
|
|
883
|
+
strokeLinejoin: "round",
|
|
884
|
+
"aria-hidden": "true",
|
|
885
|
+
style: { transform: flipped ? "scaleX(-1)" : void 0, flexShrink: 0 },
|
|
886
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
891
|
+
reactNative.Text,
|
|
892
|
+
{
|
|
893
|
+
accessibilityElementsHidden: true,
|
|
894
|
+
importantForAccessibility: "no-hide-descendants",
|
|
895
|
+
style: {
|
|
896
|
+
fontSize: 14,
|
|
897
|
+
lineHeight: 20,
|
|
898
|
+
color: colors.semantic.text.muted,
|
|
899
|
+
transform: flipped ? [{ scaleX: -1 }] : void 0
|
|
900
|
+
},
|
|
901
|
+
children: "\u203A"
|
|
902
|
+
}
|
|
903
|
+
);
|
|
904
|
+
}, "DefaultChevron");
|
|
905
|
+
var SeparatorText = /* @__PURE__ */ __name(({ children }) => {
|
|
906
|
+
const colors = useThemeColors();
|
|
907
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
908
|
+
reactNative.Text,
|
|
909
|
+
{
|
|
910
|
+
accessibilityElementsHidden: true,
|
|
911
|
+
importantForAccessibility: "no-hide-descendants",
|
|
912
|
+
style: {
|
|
913
|
+
fontSize: px(colors.fontSize.sm),
|
|
914
|
+
lineHeight: px(colors.fontSize.md) * 1.4,
|
|
915
|
+
color: colors.semantic.text.muted,
|
|
916
|
+
fontFamily: colors.fontFamily.body,
|
|
917
|
+
paddingHorizontal: 2
|
|
918
|
+
},
|
|
919
|
+
children
|
|
920
|
+
}
|
|
921
|
+
);
|
|
922
|
+
}, "SeparatorText");
|
|
923
|
+
function renderSeparator(separator, ctx) {
|
|
924
|
+
if (separator === void 0) {
|
|
925
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DefaultChevron, { dir: ctx.dir });
|
|
926
|
+
}
|
|
927
|
+
if (typeof separator === "function") {
|
|
928
|
+
return separator(ctx);
|
|
929
|
+
}
|
|
930
|
+
if (typeof separator === "string") {
|
|
931
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SeparatorText, { children: separator });
|
|
932
|
+
}
|
|
933
|
+
return separator;
|
|
934
|
+
}
|
|
935
|
+
__name(renderSeparator, "renderSeparator");
|
|
936
|
+
function useOverflowFit({
|
|
937
|
+
enabled,
|
|
938
|
+
itemCount,
|
|
939
|
+
itemsBeforeCollapse,
|
|
940
|
+
itemsAfterCollapse
|
|
941
|
+
}) {
|
|
942
|
+
const [containerWidth, setContainerWidth] = react.useState(null);
|
|
943
|
+
const itemWidthsRef = react.useRef(/* @__PURE__ */ new Map());
|
|
944
|
+
const ellipsisWidthRef = react.useRef(0);
|
|
945
|
+
const separatorWidthRef = react.useRef(0);
|
|
946
|
+
const [widthsTick, setWidthsTick] = react.useState(0);
|
|
947
|
+
const onContainerLayout = react.useCallback((event) => {
|
|
948
|
+
const w = event.nativeEvent.layout.width;
|
|
949
|
+
setContainerWidth((prev) => prev !== null && Math.abs(prev - w) < 0.5 ? prev : w);
|
|
950
|
+
}, []);
|
|
951
|
+
const onItemLayout = react.useCallback(
|
|
952
|
+
(index) => (event) => {
|
|
953
|
+
const w = event.nativeEvent.layout.width;
|
|
954
|
+
const prev = itemWidthsRef.current.get(index);
|
|
955
|
+
if (prev === void 0 || Math.abs(prev - w) >= 0.5) {
|
|
956
|
+
itemWidthsRef.current.set(index, w);
|
|
957
|
+
setWidthsTick((t) => t + 1);
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
[]
|
|
961
|
+
);
|
|
962
|
+
const onEllipsisLayout = react.useCallback((event) => {
|
|
963
|
+
const w = event.nativeEvent.layout.width;
|
|
964
|
+
if (Math.abs(ellipsisWidthRef.current - w) >= 0.5) {
|
|
965
|
+
ellipsisWidthRef.current = w;
|
|
966
|
+
setWidthsTick((t) => t + 1);
|
|
967
|
+
}
|
|
968
|
+
}, []);
|
|
969
|
+
const onSeparatorLayout = react.useCallback((event) => {
|
|
970
|
+
const w = event.nativeEvent.layout.width;
|
|
971
|
+
if (Math.abs(separatorWidthRef.current - w) >= 0.5) {
|
|
972
|
+
separatorWidthRef.current = w;
|
|
973
|
+
setWidthsTick((t) => t + 1);
|
|
974
|
+
}
|
|
975
|
+
}, []);
|
|
976
|
+
const visibleIndices = react.useMemo(() => {
|
|
977
|
+
const all = /* @__PURE__ */ new Set();
|
|
978
|
+
for (let i = 0; i < itemCount; i += 1) {
|
|
979
|
+
all.add(i);
|
|
980
|
+
}
|
|
981
|
+
if (!enabled || containerWidth === null || itemCount === 0) {
|
|
982
|
+
return all;
|
|
983
|
+
}
|
|
984
|
+
const widths = itemWidthsRef.current;
|
|
985
|
+
if (widths.size < itemCount) {
|
|
986
|
+
return all;
|
|
987
|
+
}
|
|
988
|
+
const sep = separatorWidthRef.current;
|
|
989
|
+
const ell = ellipsisWidthRef.current;
|
|
990
|
+
let total = 0;
|
|
991
|
+
for (let i = 0; i < itemCount; i += 1) {
|
|
992
|
+
total += widths.get(i) ?? 0;
|
|
993
|
+
}
|
|
994
|
+
total += sep * Math.max(0, itemCount - 1);
|
|
995
|
+
if (total <= containerWidth) {
|
|
996
|
+
return all;
|
|
997
|
+
}
|
|
998
|
+
const before = Math.max(0, Math.min(itemsBeforeCollapse, itemCount));
|
|
999
|
+
const after = Math.max(0, Math.min(itemsAfterCollapse, itemCount - before));
|
|
1000
|
+
const anchorIndices = /* @__PURE__ */ new Set();
|
|
1001
|
+
for (let i = 0; i < before; i += 1) {
|
|
1002
|
+
anchorIndices.add(i);
|
|
1003
|
+
}
|
|
1004
|
+
for (let i = itemCount - after; i < itemCount; i += 1) {
|
|
1005
|
+
anchorIndices.add(i);
|
|
1006
|
+
}
|
|
1007
|
+
let used = 0;
|
|
1008
|
+
for (const idx of anchorIndices) {
|
|
1009
|
+
used += widths.get(idx) ?? 0;
|
|
1010
|
+
}
|
|
1011
|
+
used += ell;
|
|
1012
|
+
const sepCount = Math.max(0, anchorIndices.size + 1 - 1);
|
|
1013
|
+
used += sep * sepCount;
|
|
1014
|
+
if (used > containerWidth) {
|
|
1015
|
+
const beforeIdx = [];
|
|
1016
|
+
for (let i = 0; i < before; i += 1) {
|
|
1017
|
+
beforeIdx.push(i);
|
|
1018
|
+
}
|
|
1019
|
+
const afterIdx = [];
|
|
1020
|
+
for (let i = itemCount - after; i < itemCount; i += 1) {
|
|
1021
|
+
afterIdx.push(i);
|
|
1022
|
+
}
|
|
1023
|
+
const minBefore = before > 0 ? 1 : 0;
|
|
1024
|
+
const minAfter = after > 0 ? 1 : 0;
|
|
1025
|
+
while (used > containerWidth && (beforeIdx.length > minBefore || afterIdx.length > minAfter)) {
|
|
1026
|
+
if (beforeIdx.length > minBefore) {
|
|
1027
|
+
const dropped = beforeIdx.pop();
|
|
1028
|
+
if (dropped !== void 0) {
|
|
1029
|
+
used -= (widths.get(dropped) ?? 0) + sep;
|
|
1030
|
+
anchorIndices.delete(dropped);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
if (used <= containerWidth) {
|
|
1034
|
+
break;
|
|
1035
|
+
}
|
|
1036
|
+
if (afterIdx.length > minAfter) {
|
|
1037
|
+
const dropped = afterIdx.shift();
|
|
1038
|
+
if (dropped !== void 0) {
|
|
1039
|
+
used -= (widths.get(dropped) ?? 0) + sep;
|
|
1040
|
+
anchorIndices.delete(dropped);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
return anchorIndices;
|
|
1045
|
+
}
|
|
1046
|
+
let leftCursor = before;
|
|
1047
|
+
let rightCursor = itemCount - after - 1;
|
|
1048
|
+
while (leftCursor <= rightCursor) {
|
|
1049
|
+
const w = widths.get(leftCursor) ?? 0;
|
|
1050
|
+
if (used + w + sep <= containerWidth) {
|
|
1051
|
+
anchorIndices.add(leftCursor);
|
|
1052
|
+
used += w + sep;
|
|
1053
|
+
leftCursor += 1;
|
|
1054
|
+
} else {
|
|
1055
|
+
break;
|
|
1056
|
+
}
|
|
1057
|
+
if (leftCursor > rightCursor) {
|
|
1058
|
+
break;
|
|
1059
|
+
}
|
|
1060
|
+
const w2 = widths.get(rightCursor) ?? 0;
|
|
1061
|
+
if (used + w2 + sep <= containerWidth) {
|
|
1062
|
+
anchorIndices.add(rightCursor);
|
|
1063
|
+
used += w2 + sep;
|
|
1064
|
+
rightCursor -= 1;
|
|
1065
|
+
} else {
|
|
1066
|
+
break;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
return anchorIndices;
|
|
1070
|
+
}, [containerWidth, itemCount, itemsBeforeCollapse, itemsAfterCollapse, enabled, widthsTick]);
|
|
1071
|
+
const ready = !enabled || containerWidth !== null && itemWidthsRef.current.size >= itemCount;
|
|
1072
|
+
return {
|
|
1073
|
+
visibleIndices,
|
|
1074
|
+
ready,
|
|
1075
|
+
onContainerLayout,
|
|
1076
|
+
onItemLayout,
|
|
1077
|
+
onEllipsisLayout,
|
|
1078
|
+
onSeparatorLayout
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
__name(useOverflowFit, "useOverflowFit");
|
|
1082
|
+
function applyCountCollapse(items, maxItems, before, after) {
|
|
1083
|
+
if (!maxItems || items.length <= maxItems) {
|
|
1084
|
+
return { visible: items, hidden: [], collapseAt: -1 };
|
|
1085
|
+
}
|
|
1086
|
+
const beforeArr = items.slice(0, Math.max(0, Math.min(before, items.length)));
|
|
1087
|
+
const afterArr = after > 0 ? items.slice(Math.max(beforeArr.length, items.length - after)) : [];
|
|
1088
|
+
const hidden = items.slice(beforeArr.length, items.length - afterArr.length);
|
|
1089
|
+
const visible = [...beforeArr, ...afterArr];
|
|
1090
|
+
return { visible, hidden, collapseAt: beforeArr.length };
|
|
1091
|
+
}
|
|
1092
|
+
__name(applyCountCollapse, "applyCountCollapse");
|
|
1093
|
+
function getBreadcrumbJsonLd(items) {
|
|
1094
|
+
const elements = items.map((it, idx) => {
|
|
1095
|
+
const name = typeof it.label === "string" ? it.label : void 0;
|
|
1096
|
+
if (!name) {
|
|
1097
|
+
return null;
|
|
1098
|
+
}
|
|
1099
|
+
const entry = {
|
|
1100
|
+
"@type": "ListItem",
|
|
1101
|
+
position: idx + 1,
|
|
1102
|
+
name
|
|
1103
|
+
};
|
|
1104
|
+
if (it.href) {
|
|
1105
|
+
entry.item = it.href;
|
|
1106
|
+
}
|
|
1107
|
+
return entry;
|
|
1108
|
+
}).filter((x) => x !== null);
|
|
1109
|
+
return JSON.stringify({
|
|
1110
|
+
"@context": "https://schema.org",
|
|
1111
|
+
"@type": "BreadcrumbList",
|
|
1112
|
+
itemListElement: elements
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
__name(getBreadcrumbJsonLd, "getBreadcrumbJsonLd");
|
|
1116
|
+
function useBreadcrumbJsonLdInjection(items, enabled) {
|
|
1117
|
+
react.useEffect(() => {
|
|
1118
|
+
if (!enabled || reactNative.Platform.OS !== "web" || typeof document === "undefined") {
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
const json = getBreadcrumbJsonLd(items);
|
|
1122
|
+
if (!json.includes('"itemListElement":[{')) {
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
const script = document.createElement("script");
|
|
1126
|
+
script.type = "application/ld+json";
|
|
1127
|
+
script.textContent = json;
|
|
1128
|
+
script.setAttribute("data-nori-breadcrumb", "true");
|
|
1129
|
+
document.head.appendChild(script);
|
|
1130
|
+
return () => {
|
|
1131
|
+
if (script.parentNode === document.head) {
|
|
1132
|
+
document.head.removeChild(script);
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
}, [items, enabled]);
|
|
1136
|
+
}
|
|
1137
|
+
__name(useBreadcrumbJsonLdInjection, "useBreadcrumbJsonLdInjection");
|
|
1138
|
+
function truncateString(input, max) {
|
|
1139
|
+
if (max <= 0 || input.length <= max) {
|
|
1140
|
+
return input;
|
|
1141
|
+
}
|
|
1142
|
+
if (max <= 1) {
|
|
1143
|
+
return "\u2026";
|
|
1144
|
+
}
|
|
1145
|
+
return `${input.slice(0, max - 1)}\u2026`;
|
|
1146
|
+
}
|
|
1147
|
+
__name(truncateString, "truncateString");
|
|
1148
|
+
var BreadcrumbRoot = /* @__PURE__ */ __name(({
|
|
1149
|
+
items,
|
|
1150
|
+
separator,
|
|
1151
|
+
maxItems,
|
|
1152
|
+
itemsBeforeCollapse = DEFAULT_ITEMS_BEFORE,
|
|
1153
|
+
itemsAfterCollapse = DEFAULT_ITEMS_AFTER,
|
|
1154
|
+
collapseOnOverflow,
|
|
1155
|
+
expandBehavior,
|
|
1156
|
+
expandLabel,
|
|
1157
|
+
ellipsisLabel,
|
|
1158
|
+
currentPageLabel,
|
|
1159
|
+
siblingMenuLabel,
|
|
1160
|
+
ariaLabel,
|
|
1161
|
+
schemaOrg,
|
|
1162
|
+
dir = "ltr",
|
|
1163
|
+
maxLabelLength = 0,
|
|
1164
|
+
children,
|
|
1165
|
+
className,
|
|
1166
|
+
testID
|
|
1167
|
+
}) => {
|
|
1168
|
+
const { t } = useTranslation();
|
|
1169
|
+
const colors = useThemeColors();
|
|
1170
|
+
const resolvedAriaLabel = ariaLabel ?? t("breadcrumb.ariaLabel", { defaultValue: "Breadcrumb" });
|
|
1171
|
+
const resolvedExpandLabel = expandLabel ?? t("breadcrumb.expandLabel", { defaultValue: "Show full path" });
|
|
1172
|
+
const resolvedEllipsisLabel = ellipsisLabel ?? t("breadcrumb.ellipsisLabel", { defaultValue: "More" });
|
|
1173
|
+
const resolvedCurrentPageLabel = currentPageLabel ?? t("breadcrumb.currentPageLabel", { defaultValue: "Current page" });
|
|
1174
|
+
const resolvedSiblingMenuLabel = siblingMenuLabel ?? t("breadcrumb.siblingMenuLabel", { defaultValue: "Open sibling pages" });
|
|
1175
|
+
const resolvedExpandBehavior = expandBehavior ?? (reactNative.Platform.OS === "web" ? "inline" : "menu");
|
|
1176
|
+
if (items && items.length > 0) {
|
|
1177
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1178
|
+
BreadcrumbItemsRenderer,
|
|
1179
|
+
{
|
|
1180
|
+
items,
|
|
1181
|
+
separator,
|
|
1182
|
+
maxItems,
|
|
1183
|
+
itemsBeforeCollapse,
|
|
1184
|
+
itemsAfterCollapse,
|
|
1185
|
+
collapseOnOverflow: collapseOnOverflow ?? true,
|
|
1186
|
+
expandBehavior: resolvedExpandBehavior,
|
|
1187
|
+
expandLabel: resolvedExpandLabel,
|
|
1188
|
+
ellipsisLabel: resolvedEllipsisLabel,
|
|
1189
|
+
currentPageLabel: resolvedCurrentPageLabel,
|
|
1190
|
+
siblingMenuLabel: resolvedSiblingMenuLabel,
|
|
1191
|
+
ariaLabel: resolvedAriaLabel,
|
|
1192
|
+
schemaOrg,
|
|
1193
|
+
dir,
|
|
1194
|
+
maxLabelLength,
|
|
1195
|
+
...className !== void 0 ? { className } : {},
|
|
1196
|
+
...testID !== void 0 ? { testID } : {}
|
|
1197
|
+
}
|
|
1198
|
+
);
|
|
1199
|
+
}
|
|
1200
|
+
const ctxValue = {
|
|
1201
|
+
separator: separator ?? "",
|
|
1202
|
+
dir,
|
|
1203
|
+
currentPageLabel: resolvedCurrentPageLabel,
|
|
1204
|
+
siblingMenuLabel: resolvedSiblingMenuLabel,
|
|
1205
|
+
maxLabelLength
|
|
1206
|
+
};
|
|
1207
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1208
|
+
reactNative.View,
|
|
1209
|
+
{
|
|
1210
|
+
...testID !== void 0 ? { testID } : {},
|
|
1211
|
+
role: "navigation",
|
|
1212
|
+
"aria-label": resolvedAriaLabel,
|
|
1213
|
+
accessible: true,
|
|
1214
|
+
accessibilityLabel: resolvedAriaLabel,
|
|
1215
|
+
className: cn("flex-row items-center", className),
|
|
1216
|
+
style: {
|
|
1217
|
+
flexDirection: "row",
|
|
1218
|
+
alignItems: "center",
|
|
1219
|
+
direction: dir,
|
|
1220
|
+
fontFamily: colors.fontFamily.body
|
|
1221
|
+
},
|
|
1222
|
+
children
|
|
1223
|
+
}
|
|
1224
|
+
) });
|
|
1225
|
+
}, "BreadcrumbRoot");
|
|
1226
|
+
var BreadcrumbItemsRenderer = /* @__PURE__ */ __name(({
|
|
1227
|
+
items,
|
|
1228
|
+
separator,
|
|
1229
|
+
maxItems,
|
|
1230
|
+
itemsBeforeCollapse,
|
|
1231
|
+
itemsAfterCollapse,
|
|
1232
|
+
collapseOnOverflow,
|
|
1233
|
+
expandBehavior,
|
|
1234
|
+
expandLabel,
|
|
1235
|
+
ellipsisLabel,
|
|
1236
|
+
currentPageLabel,
|
|
1237
|
+
siblingMenuLabel,
|
|
1238
|
+
ariaLabel,
|
|
1239
|
+
schemaOrg,
|
|
1240
|
+
dir,
|
|
1241
|
+
maxLabelLength,
|
|
1242
|
+
className,
|
|
1243
|
+
testID
|
|
1244
|
+
}) => {
|
|
1245
|
+
const [inlineExpanded, setInlineExpanded] = react.useState(false);
|
|
1246
|
+
const normalizedItems = react.useMemo(() => {
|
|
1247
|
+
if (items.length === 0) {
|
|
1248
|
+
return items;
|
|
1249
|
+
}
|
|
1250
|
+
const anyCurrent = items.some((it) => it.current);
|
|
1251
|
+
if (anyCurrent) {
|
|
1252
|
+
return items;
|
|
1253
|
+
}
|
|
1254
|
+
const last = items[items.length - 1];
|
|
1255
|
+
if (!last) {
|
|
1256
|
+
return items;
|
|
1257
|
+
}
|
|
1258
|
+
const out = [...items];
|
|
1259
|
+
out[out.length - 1] = { ...last, current: true };
|
|
1260
|
+
return out;
|
|
1261
|
+
}, [items]);
|
|
1262
|
+
useBreadcrumbJsonLdInjection(normalizedItems, schemaOrg !== false);
|
|
1263
|
+
const countCollapse = react.useMemo(
|
|
1264
|
+
() => applyCountCollapse(
|
|
1265
|
+
normalizedItems,
|
|
1266
|
+
inlineExpanded ? void 0 : maxItems,
|
|
1267
|
+
itemsBeforeCollapse,
|
|
1268
|
+
itemsAfterCollapse
|
|
1269
|
+
),
|
|
1270
|
+
[normalizedItems, maxItems, itemsBeforeCollapse, itemsAfterCollapse, inlineExpanded]
|
|
1271
|
+
);
|
|
1272
|
+
const widthFit = useOverflowFit({
|
|
1273
|
+
enabled: collapseOnOverflow && expandBehavior !== "scroll" && !inlineExpanded,
|
|
1274
|
+
itemCount: countCollapse.visible.length,
|
|
1275
|
+
itemsBeforeCollapse,
|
|
1276
|
+
itemsAfterCollapse
|
|
1277
|
+
});
|
|
1278
|
+
const widthHiddenItems = react.useMemo(() => {
|
|
1279
|
+
if (!collapseOnOverflow || expandBehavior === "scroll" || inlineExpanded) {
|
|
1280
|
+
return [];
|
|
1281
|
+
}
|
|
1282
|
+
return countCollapse.visible.filter((_, idx) => !widthFit.visibleIndices.has(idx));
|
|
1283
|
+
}, [collapseOnOverflow, expandBehavior, inlineExpanded, countCollapse.visible, widthFit.visibleIndices]);
|
|
1284
|
+
const allHiddenItems = react.useMemo(() => {
|
|
1285
|
+
if (inlineExpanded) {
|
|
1286
|
+
return [];
|
|
1287
|
+
}
|
|
1288
|
+
return [...countCollapse.hidden, ...widthHiddenItems];
|
|
1289
|
+
}, [countCollapse.hidden, widthHiddenItems, inlineExpanded]);
|
|
1290
|
+
const visibleItemsForRender = react.useMemo(() => {
|
|
1291
|
+
if (inlineExpanded) {
|
|
1292
|
+
return normalizedItems;
|
|
1293
|
+
}
|
|
1294
|
+
return countCollapse.visible.filter(
|
|
1295
|
+
(_, idx) => collapseOnOverflow && expandBehavior !== "scroll" ? widthFit.visibleIndices.has(idx) : true
|
|
1296
|
+
);
|
|
1297
|
+
}, [
|
|
1298
|
+
countCollapse.visible,
|
|
1299
|
+
widthFit.visibleIndices,
|
|
1300
|
+
collapseOnOverflow,
|
|
1301
|
+
expandBehavior,
|
|
1302
|
+
inlineExpanded,
|
|
1303
|
+
normalizedItems
|
|
1304
|
+
]);
|
|
1305
|
+
const ellipsisInsertAt = react.useMemo(() => {
|
|
1306
|
+
if (inlineExpanded || allHiddenItems.length === 0) {
|
|
1307
|
+
return -1;
|
|
1308
|
+
}
|
|
1309
|
+
return Math.min(itemsBeforeCollapse, visibleItemsForRender.length);
|
|
1310
|
+
}, [allHiddenItems.length, inlineExpanded, visibleItemsForRender.length, itemsBeforeCollapse]);
|
|
1311
|
+
const renderedCells = [];
|
|
1312
|
+
const measurementCells = [];
|
|
1313
|
+
visibleItemsForRender.forEach((item, idx) => {
|
|
1314
|
+
if (idx === ellipsisInsertAt && allHiddenItems.length > 0) {
|
|
1315
|
+
renderedCells.push(
|
|
1316
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1317
|
+
BreadcrumbEllipsisInternal,
|
|
1318
|
+
{
|
|
1319
|
+
ellipsisLabel,
|
|
1320
|
+
expandLabel,
|
|
1321
|
+
expandBehavior,
|
|
1322
|
+
hiddenItems: allHiddenItems,
|
|
1323
|
+
onExpandInline: () => setInlineExpanded(true)
|
|
1324
|
+
}
|
|
1325
|
+
) }, "__ellipsis__")
|
|
1326
|
+
);
|
|
1327
|
+
renderedCells.push(
|
|
1328
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: renderSeparator(separator, {
|
|
1329
|
+
fromIndex: idx - 1,
|
|
1330
|
+
visibleCount: visibleItemsForRender.length + 1,
|
|
1331
|
+
dir
|
|
1332
|
+
}) }, "__sep_ellipsis__")
|
|
1333
|
+
);
|
|
1334
|
+
}
|
|
1335
|
+
const itemKey = item.key ?? `item-${normalizedItems.indexOf(item)}`;
|
|
1336
|
+
renderedCells.push(
|
|
1337
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1338
|
+
BreadcrumbItemRenderer,
|
|
1339
|
+
{
|
|
1340
|
+
item,
|
|
1341
|
+
currentPageLabel,
|
|
1342
|
+
siblingMenuLabel,
|
|
1343
|
+
maxLabelLength
|
|
1344
|
+
}
|
|
1345
|
+
) }, itemKey)
|
|
1346
|
+
);
|
|
1347
|
+
const isLast = idx === visibleItemsForRender.length - 1;
|
|
1348
|
+
if (!isLast) {
|
|
1349
|
+
renderedCells.push(
|
|
1350
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: renderSeparator(separator, {
|
|
1351
|
+
fromIndex: idx,
|
|
1352
|
+
visibleCount: visibleItemsForRender.length,
|
|
1353
|
+
dir
|
|
1354
|
+
}) }, `sep-${itemKey}`)
|
|
1355
|
+
);
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
if (collapseOnOverflow && expandBehavior !== "scroll") {
|
|
1359
|
+
countCollapse.visible.forEach((item, idx) => {
|
|
1360
|
+
const itemKey = item.key ?? `m-${idx}`;
|
|
1361
|
+
measurementCells.push(
|
|
1362
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { onLayout: widthFit.onItemLayout(idx), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1363
|
+
BreadcrumbItemRenderer,
|
|
1364
|
+
{
|
|
1365
|
+
item,
|
|
1366
|
+
currentPageLabel,
|
|
1367
|
+
siblingMenuLabel,
|
|
1368
|
+
maxLabelLength
|
|
1369
|
+
}
|
|
1370
|
+
) }, itemKey)
|
|
1371
|
+
);
|
|
1372
|
+
});
|
|
1373
|
+
measurementCells.push(
|
|
1374
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { onLayout: widthFit.onSeparatorLayout, children: renderSeparator(separator, {
|
|
1375
|
+
fromIndex: 0,
|
|
1376
|
+
visibleCount: countCollapse.visible.length,
|
|
1377
|
+
dir
|
|
1378
|
+
}) }, "__m_sep__")
|
|
1379
|
+
);
|
|
1380
|
+
measurementCells.push(
|
|
1381
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { onLayout: widthFit.onEllipsisLayout, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1382
|
+
BreadcrumbEllipsisInternal,
|
|
1383
|
+
{
|
|
1384
|
+
ellipsisLabel,
|
|
1385
|
+
expandLabel,
|
|
1386
|
+
expandBehavior: "none",
|
|
1387
|
+
hiddenItems: [],
|
|
1388
|
+
onExpandInline: () => void 0
|
|
1389
|
+
}
|
|
1390
|
+
) }, "__m_ellipsis__")
|
|
1391
|
+
);
|
|
1392
|
+
}
|
|
1393
|
+
const list = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1394
|
+
reactNative.View,
|
|
1395
|
+
{
|
|
1396
|
+
role: "list",
|
|
1397
|
+
accessibilityRole: "list",
|
|
1398
|
+
className: cn("flex-row items-center"),
|
|
1399
|
+
style: { flexDirection: "row", alignItems: "center", flexShrink: 1, minWidth: 0 },
|
|
1400
|
+
children: renderedCells
|
|
1401
|
+
}
|
|
1402
|
+
);
|
|
1403
|
+
const wrapperStyle = {
|
|
1404
|
+
flexDirection: "row",
|
|
1405
|
+
alignItems: "center",
|
|
1406
|
+
direction: dir,
|
|
1407
|
+
flexShrink: 1,
|
|
1408
|
+
minWidth: 0,
|
|
1409
|
+
...collapseOnOverflow && expandBehavior !== "scroll" ? { width: "100%" } : null,
|
|
1410
|
+
// `overflow: 'hidden'` keeps the visible row from blowing past
|
|
1411
|
+
// its container before the first measurement settles. Without
|
|
1412
|
+
// it, native renders the natural-width row briefly on the first
|
|
1413
|
+
// paint, even though the JS layout reports the correct measured
|
|
1414
|
+
// width on the very next tick.
|
|
1415
|
+
...collapseOnOverflow ? { overflow: "hidden" } : null
|
|
1416
|
+
};
|
|
1417
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1418
|
+
reactNative.View,
|
|
1419
|
+
{
|
|
1420
|
+
...testID !== void 0 ? { testID } : {},
|
|
1421
|
+
role: "navigation",
|
|
1422
|
+
"aria-label": ariaLabel,
|
|
1423
|
+
accessible: true,
|
|
1424
|
+
accessibilityLabel: ariaLabel,
|
|
1425
|
+
className: cn("flex-row items-center", className),
|
|
1426
|
+
style: wrapperStyle,
|
|
1427
|
+
onLayout: collapseOnOverflow && expandBehavior !== "scroll" ? widthFit.onContainerLayout : void 0,
|
|
1428
|
+
children: [
|
|
1429
|
+
expandBehavior === "scroll" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1430
|
+
reactNative.ScrollView,
|
|
1431
|
+
{
|
|
1432
|
+
horizontal: true,
|
|
1433
|
+
showsHorizontalScrollIndicator: false,
|
|
1434
|
+
contentContainerStyle: { flexDirection: "row", alignItems: "center" },
|
|
1435
|
+
style: { flexGrow: 1 },
|
|
1436
|
+
children: list
|
|
1437
|
+
}
|
|
1438
|
+
) : list,
|
|
1439
|
+
collapseOnOverflow && expandBehavior !== "scroll" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1440
|
+
reactNative.View,
|
|
1441
|
+
{
|
|
1442
|
+
"aria-hidden": true,
|
|
1443
|
+
accessibilityElementsHidden: true,
|
|
1444
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1445
|
+
style: {
|
|
1446
|
+
position: "absolute",
|
|
1447
|
+
opacity: 0,
|
|
1448
|
+
flexDirection: "row",
|
|
1449
|
+
alignItems: "center",
|
|
1450
|
+
left: -99999,
|
|
1451
|
+
top: 0,
|
|
1452
|
+
// `pointerEvents` lives on the style object now —
|
|
1453
|
+
// the prop form is deprecated in RN 0.71+ / RN-Web
|
|
1454
|
+
// 0.20+ and emits a runtime warning every render.
|
|
1455
|
+
pointerEvents: "none"
|
|
1456
|
+
},
|
|
1457
|
+
children: measurementCells
|
|
1458
|
+
}
|
|
1459
|
+
) : null
|
|
1460
|
+
]
|
|
1461
|
+
}
|
|
1462
|
+
);
|
|
1463
|
+
}, "BreadcrumbItemsRenderer");
|
|
1464
|
+
var BreadcrumbItemRenderer = /* @__PURE__ */ __name(({ item, currentPageLabel, siblingMenuLabel, maxLabelLength }) => {
|
|
1465
|
+
const colors = useThemeColors();
|
|
1466
|
+
const Icon = item.icon;
|
|
1467
|
+
const isLink = !item.current && (item.href !== void 0 || item.onSelect !== void 0);
|
|
1468
|
+
const effectiveMax = item.maxLabelLength ?? maxLabelLength;
|
|
1469
|
+
const renderLabel = /* @__PURE__ */ __name(() => {
|
|
1470
|
+
if (item.loading) {
|
|
1471
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1472
|
+
reactNative.View,
|
|
1473
|
+
{
|
|
1474
|
+
style: {
|
|
1475
|
+
backgroundColor: colors.semantic.background.subtle,
|
|
1476
|
+
borderRadius: px(colors.radius.sm),
|
|
1477
|
+
height: px(colors.fontSize.sm),
|
|
1478
|
+
width: 64
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
if (typeof item.label === "string" || typeof item.label === "number") {
|
|
1484
|
+
const text = String(item.label);
|
|
1485
|
+
const truncated = effectiveMax > 0 ? truncateString(text, effectiveMax) : text;
|
|
1486
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1487
|
+
reactNative.Text,
|
|
1488
|
+
{
|
|
1489
|
+
numberOfLines: 1,
|
|
1490
|
+
ellipsizeMode: "tail",
|
|
1491
|
+
style: {
|
|
1492
|
+
fontFamily: colors.fontFamily.body,
|
|
1493
|
+
fontSize: px(colors.fontSize.sm),
|
|
1494
|
+
color: item.current ? colors.semantic.text.default : colors.semantic.text.muted,
|
|
1495
|
+
fontWeight: item.current ? colors.fontWeight.semibold : colors.fontWeight.regular
|
|
1496
|
+
},
|
|
1497
|
+
children: truncated
|
|
1498
|
+
}
|
|
1499
|
+
);
|
|
1500
|
+
}
|
|
1501
|
+
return item.label;
|
|
1502
|
+
}, "renderLabel");
|
|
1503
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1504
|
+
reactNative.View,
|
|
1505
|
+
{
|
|
1506
|
+
style: {
|
|
1507
|
+
flexDirection: "row",
|
|
1508
|
+
alignItems: "center",
|
|
1509
|
+
gap: px(colors.spacing["1"])
|
|
1510
|
+
},
|
|
1511
|
+
children: [
|
|
1512
|
+
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 14, color: item.current ? colors.semantic.text.default : colors.semantic.text.muted }) : null,
|
|
1513
|
+
renderLabel()
|
|
1514
|
+
]
|
|
1515
|
+
}
|
|
1516
|
+
);
|
|
1517
|
+
if (item.current) {
|
|
1518
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1519
|
+
reactNative.View,
|
|
1520
|
+
{
|
|
1521
|
+
role: "listitem",
|
|
1522
|
+
accessibilityRole: "text",
|
|
1523
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1524
|
+
children: [
|
|
1525
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1526
|
+
reactNative.Text,
|
|
1527
|
+
{
|
|
1528
|
+
style: {
|
|
1529
|
+
position: "absolute",
|
|
1530
|
+
width: 1,
|
|
1531
|
+
height: 1,
|
|
1532
|
+
overflow: "hidden",
|
|
1533
|
+
opacity: 0
|
|
1534
|
+
},
|
|
1535
|
+
children: [
|
|
1536
|
+
currentPageLabel,
|
|
1537
|
+
":",
|
|
1538
|
+
" "
|
|
1539
|
+
]
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-current": "page", children: inner })
|
|
1543
|
+
]
|
|
1544
|
+
}
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
if (item.siblings && item.siblings.length > 0) {
|
|
1548
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "listitem", style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 }, children: [
|
|
1549
|
+
/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbInteractive, { item, children: inner }),
|
|
1550
|
+
/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSiblingMenu, { item, siblingMenuLabel })
|
|
1551
|
+
] });
|
|
1552
|
+
}
|
|
1553
|
+
if (isLink) {
|
|
1554
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { role: "listitem", style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 }, children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbInteractive, { item, children: inner }) });
|
|
1555
|
+
}
|
|
1556
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { role: "listitem", style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 }, children: inner });
|
|
1557
|
+
}, "BreadcrumbItemRenderer");
|
|
1558
|
+
var BreadcrumbInteractive = /* @__PURE__ */ __name(({ item, children }) => {
|
|
1559
|
+
const colors = useThemeColors();
|
|
1560
|
+
const handlePress = react.useCallback(() => {
|
|
1561
|
+
item.onSelect?.();
|
|
1562
|
+
}, [item]);
|
|
1563
|
+
if (reactNative.Platform.OS === "web" && item.href) {
|
|
1564
|
+
const handleClick = item.onSelect ? (event) => {
|
|
1565
|
+
event.preventDefault();
|
|
1566
|
+
item.onSelect?.();
|
|
1567
|
+
} : void 0;
|
|
1568
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1569
|
+
"a",
|
|
1570
|
+
{
|
|
1571
|
+
href: item.href,
|
|
1572
|
+
onClick: handleClick,
|
|
1573
|
+
style: {
|
|
1574
|
+
color: colors.semantic.interactive.primary,
|
|
1575
|
+
textDecoration: "none",
|
|
1576
|
+
fontFamily: colors.fontFamily.body
|
|
1577
|
+
},
|
|
1578
|
+
children
|
|
1579
|
+
}
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: handlePress, accessibilityRole: "link", role: "link", children });
|
|
1583
|
+
}, "BreadcrumbInteractive");
|
|
1584
|
+
var BreadcrumbSiblingMenu = /* @__PURE__ */ __name(({ item, siblingMenuLabel }) => {
|
|
1585
|
+
const colors = useThemeColors();
|
|
1586
|
+
const siblings = item.siblings ?? [];
|
|
1587
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
1588
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover.Trigger, { asChild: false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1589
|
+
reactNative.View,
|
|
1590
|
+
{
|
|
1591
|
+
accessibilityLabel: siblingMenuLabel,
|
|
1592
|
+
style: {
|
|
1593
|
+
flexDirection: "row",
|
|
1594
|
+
alignItems: "center",
|
|
1595
|
+
paddingHorizontal: 2,
|
|
1596
|
+
paddingVertical: 4
|
|
1597
|
+
},
|
|
1598
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1599
|
+
reactNative.Text,
|
|
1600
|
+
{
|
|
1601
|
+
accessibilityElementsHidden: true,
|
|
1602
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1603
|
+
style: { fontSize: 10, color: colors.semantic.text.muted },
|
|
1604
|
+
children: "\u25BE"
|
|
1605
|
+
}
|
|
1606
|
+
)
|
|
1607
|
+
}
|
|
1608
|
+
) }),
|
|
1609
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { side: "bottom", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { minWidth: 200, paddingVertical: 4 }, children: siblings.map((sib, idx) => /* @__PURE__ */ jsxRuntime.jsx(SiblingRow, { sibling: sib }, sib.href ?? idx)) }) })
|
|
1610
|
+
] });
|
|
1611
|
+
}, "BreadcrumbSiblingMenu");
|
|
1612
|
+
var SiblingRow = /* @__PURE__ */ __name(({ sibling }) => {
|
|
1613
|
+
const colors = useThemeColors();
|
|
1614
|
+
const Icon = sibling.icon;
|
|
1615
|
+
const handlePress = react.useCallback(() => {
|
|
1616
|
+
sibling.onSelect?.();
|
|
1617
|
+
}, [sibling]);
|
|
1618
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1619
|
+
reactNative.View,
|
|
1620
|
+
{
|
|
1621
|
+
style: {
|
|
1622
|
+
flexDirection: "row",
|
|
1623
|
+
alignItems: "center",
|
|
1624
|
+
gap: px(colors.spacing["2"]),
|
|
1625
|
+
paddingVertical: px(colors.spacing["2"]),
|
|
1626
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
1627
|
+
opacity: sibling.disabled ? 0.5 : 1
|
|
1628
|
+
},
|
|
1629
|
+
children: [
|
|
1630
|
+
Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 14, color: colors.semantic.text.muted }) : null,
|
|
1631
|
+
typeof sibling.label === "string" || typeof sibling.label === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1632
|
+
reactNative.Text,
|
|
1633
|
+
{
|
|
1634
|
+
style: {
|
|
1635
|
+
fontFamily: colors.fontFamily.body,
|
|
1636
|
+
fontSize: px(colors.fontSize.sm),
|
|
1637
|
+
color: colors.semantic.text.default
|
|
1638
|
+
},
|
|
1639
|
+
children: String(sibling.label)
|
|
1640
|
+
}
|
|
1641
|
+
) : sibling.label
|
|
1642
|
+
]
|
|
1643
|
+
}
|
|
1644
|
+
);
|
|
1645
|
+
if (reactNative.Platform.OS === "web" && sibling.href && !sibling.disabled) {
|
|
1646
|
+
const handleClick = sibling.onSelect ? (event) => {
|
|
1647
|
+
event.preventDefault();
|
|
1648
|
+
sibling.onSelect?.();
|
|
1649
|
+
} : void 0;
|
|
1650
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: sibling.href, onClick: handleClick, style: { textDecoration: "none", color: "inherit" }, children: inner });
|
|
1651
|
+
}
|
|
1652
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: sibling.disabled ? void 0 : handlePress, accessibilityRole: "menuitem", children: inner });
|
|
1653
|
+
}, "SiblingRow");
|
|
1654
|
+
var BreadcrumbEllipsisInternal = /* @__PURE__ */ __name(({
|
|
1655
|
+
ellipsisLabel,
|
|
1656
|
+
expandLabel,
|
|
1657
|
+
expandBehavior,
|
|
1658
|
+
hiddenItems,
|
|
1659
|
+
onExpandInline
|
|
1660
|
+
}) => {
|
|
1661
|
+
const colors = useThemeColors();
|
|
1662
|
+
const renderDots = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1663
|
+
reactNative.Text,
|
|
1664
|
+
{
|
|
1665
|
+
accessibilityElementsHidden: true,
|
|
1666
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1667
|
+
style: {
|
|
1668
|
+
fontFamily: colors.fontFamily.body,
|
|
1669
|
+
fontSize: px(colors.fontSize.sm),
|
|
1670
|
+
color: colors.semantic.text.muted,
|
|
1671
|
+
paddingHorizontal: 4
|
|
1672
|
+
},
|
|
1673
|
+
children: "\u2026"
|
|
1674
|
+
}
|
|
1675
|
+
), "renderDots");
|
|
1676
|
+
if (expandBehavior === "none" || hiddenItems.length === 0) {
|
|
1677
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1678
|
+
reactNative.View,
|
|
1679
|
+
{
|
|
1680
|
+
accessibilityLabel: ellipsisLabel,
|
|
1681
|
+
"aria-label": ellipsisLabel,
|
|
1682
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1683
|
+
children: renderDots()
|
|
1684
|
+
}
|
|
1685
|
+
);
|
|
1686
|
+
}
|
|
1687
|
+
if (expandBehavior === "inline") {
|
|
1688
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1689
|
+
reactNative.Pressable,
|
|
1690
|
+
{
|
|
1691
|
+
onPress: onExpandInline,
|
|
1692
|
+
accessibilityRole: "button",
|
|
1693
|
+
role: "button",
|
|
1694
|
+
accessibilityLabel: expandLabel,
|
|
1695
|
+
"aria-label": expandLabel,
|
|
1696
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1697
|
+
children: renderDots()
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
}
|
|
1701
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
1702
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover.Trigger, { asChild: false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1703
|
+
reactNative.View,
|
|
1704
|
+
{
|
|
1705
|
+
accessibilityLabel: expandLabel,
|
|
1706
|
+
"aria-label": expandLabel,
|
|
1707
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1708
|
+
children: renderDots()
|
|
1709
|
+
}
|
|
1710
|
+
) }),
|
|
1711
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover.Content, { side: "bottom", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { minWidth: 200, paddingVertical: 4 }, children: hiddenItems.map((it, idx) => {
|
|
1712
|
+
const sib = { label: it.label };
|
|
1713
|
+
if (it.href !== void 0) {
|
|
1714
|
+
sib.href = it.href;
|
|
1715
|
+
}
|
|
1716
|
+
if (it.icon !== void 0) {
|
|
1717
|
+
sib.icon = it.icon;
|
|
1718
|
+
}
|
|
1719
|
+
if (it.onSelect !== void 0) {
|
|
1720
|
+
sib.onSelect = it.onSelect;
|
|
1721
|
+
}
|
|
1722
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1723
|
+
SiblingRow,
|
|
1724
|
+
{
|
|
1725
|
+
sibling: sib
|
|
1726
|
+
},
|
|
1727
|
+
typeof it.key === "string" || typeof it.key === "number" ? it.key : idx
|
|
1728
|
+
);
|
|
1729
|
+
}) }) })
|
|
1730
|
+
] });
|
|
1731
|
+
}, "BreadcrumbEllipsisInternal");
|
|
1732
|
+
var BreadcrumbList = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
1733
|
+
useBreadcrumbContext("Breadcrumb.List");
|
|
1734
|
+
const childArray = react.Children.toArray(children);
|
|
1735
|
+
const out = [];
|
|
1736
|
+
let lastWasItem = false;
|
|
1737
|
+
childArray.forEach((child, idx) => {
|
|
1738
|
+
const kind = getCompoundKind(child);
|
|
1739
|
+
if (kind === "item") {
|
|
1740
|
+
if (lastWasItem) {
|
|
1741
|
+
out.push(
|
|
1742
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: separator position is deterministic from its preceding item index
|
|
1743
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}) }, `__autosep_${idx}`)
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
out.push(child);
|
|
1747
|
+
lastWasItem = true;
|
|
1748
|
+
} else {
|
|
1749
|
+
out.push(child);
|
|
1750
|
+
lastWasItem = false;
|
|
1751
|
+
}
|
|
1752
|
+
});
|
|
1753
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1754
|
+
reactNative.View,
|
|
1755
|
+
{
|
|
1756
|
+
...testID !== void 0 ? { testID } : {},
|
|
1757
|
+
role: "list",
|
|
1758
|
+
accessibilityRole: "list",
|
|
1759
|
+
className: cn("flex-row items-center", className),
|
|
1760
|
+
style: { flexDirection: "row", alignItems: "center", flexShrink: 1, minWidth: 0 },
|
|
1761
|
+
children: out
|
|
1762
|
+
}
|
|
1763
|
+
);
|
|
1764
|
+
}, "BreadcrumbList");
|
|
1765
|
+
var BreadcrumbItem = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
1766
|
+
useBreadcrumbContext("Breadcrumb.Item");
|
|
1767
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1768
|
+
reactNative.View,
|
|
1769
|
+
{
|
|
1770
|
+
...testID !== void 0 ? { testID } : {},
|
|
1771
|
+
role: "listitem",
|
|
1772
|
+
accessibilityRole: "text",
|
|
1773
|
+
className: cn("flex-row items-center", className),
|
|
1774
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1775
|
+
children
|
|
1776
|
+
}
|
|
1777
|
+
);
|
|
1778
|
+
}, "BreadcrumbItem");
|
|
1779
|
+
tagComponent(BreadcrumbItem, "item");
|
|
1780
|
+
var BreadcrumbLink = /* @__PURE__ */ __name(({ href, onPress, asChild, children, className, testID }) => {
|
|
1781
|
+
const colors = useThemeColors();
|
|
1782
|
+
if (asChild) {
|
|
1783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1784
|
+
Slot,
|
|
1785
|
+
{
|
|
1786
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
1787
|
+
...className !== void 0 ? { className } : {},
|
|
1788
|
+
children
|
|
1789
|
+
}
|
|
1790
|
+
);
|
|
1791
|
+
}
|
|
1792
|
+
if (reactNative.Platform.OS === "web" && href) {
|
|
1793
|
+
const handleClick = onPress ? (event) => {
|
|
1794
|
+
event.preventDefault();
|
|
1795
|
+
onPress?.();
|
|
1796
|
+
} : void 0;
|
|
1797
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1798
|
+
"a",
|
|
1799
|
+
{
|
|
1800
|
+
href,
|
|
1801
|
+
onClick: handleClick,
|
|
1802
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
1803
|
+
...className !== void 0 ? { className } : {},
|
|
1804
|
+
style: {
|
|
1805
|
+
color: colors.semantic.interactive.primary,
|
|
1806
|
+
textDecoration: "none",
|
|
1807
|
+
fontFamily: colors.fontFamily.body,
|
|
1808
|
+
fontSize: px(colors.fontSize.sm)
|
|
1809
|
+
},
|
|
1810
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1811
|
+
reactNative.Text,
|
|
1812
|
+
{
|
|
1813
|
+
style: {
|
|
1814
|
+
color: colors.semantic.interactive.primary,
|
|
1815
|
+
fontFamily: colors.fontFamily.body,
|
|
1816
|
+
fontSize: px(colors.fontSize.sm)
|
|
1817
|
+
},
|
|
1818
|
+
children
|
|
1819
|
+
}
|
|
1820
|
+
) : children
|
|
1821
|
+
}
|
|
1822
|
+
);
|
|
1823
|
+
}
|
|
1824
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress, accessibilityRole: "link", role: "link", ...testID !== void 0 ? { testID } : {}, children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1825
|
+
reactNative.Text,
|
|
1826
|
+
{
|
|
1827
|
+
style: {
|
|
1828
|
+
color: colors.semantic.interactive.primary,
|
|
1829
|
+
fontFamily: colors.fontFamily.body,
|
|
1830
|
+
fontSize: px(colors.fontSize.sm)
|
|
1831
|
+
},
|
|
1832
|
+
children
|
|
1833
|
+
}
|
|
1834
|
+
) : children });
|
|
1835
|
+
}, "BreadcrumbLink");
|
|
1836
|
+
var BreadcrumbPage = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
1837
|
+
const ctx = useBreadcrumbContext("Breadcrumb.Page");
|
|
1838
|
+
const colors = useThemeColors();
|
|
1839
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1840
|
+
reactNative.View,
|
|
1841
|
+
{
|
|
1842
|
+
...testID !== void 0 ? { testID } : {},
|
|
1843
|
+
accessibilityRole: "text",
|
|
1844
|
+
"aria-current": "page",
|
|
1845
|
+
className: cn("flex-row items-center", className),
|
|
1846
|
+
style: { flexDirection: "row", alignItems: "center" },
|
|
1847
|
+
children: [
|
|
1848
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1849
|
+
reactNative.Text,
|
|
1850
|
+
{
|
|
1851
|
+
style: {
|
|
1852
|
+
position: "absolute",
|
|
1853
|
+
width: 1,
|
|
1854
|
+
height: 1,
|
|
1855
|
+
overflow: "hidden",
|
|
1856
|
+
opacity: 0
|
|
1857
|
+
},
|
|
1858
|
+
children: [
|
|
1859
|
+
ctx.currentPageLabel,
|
|
1860
|
+
":",
|
|
1861
|
+
" "
|
|
1862
|
+
]
|
|
1863
|
+
}
|
|
1864
|
+
),
|
|
1865
|
+
typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1866
|
+
reactNative.Text,
|
|
1867
|
+
{
|
|
1868
|
+
numberOfLines: 1,
|
|
1869
|
+
style: {
|
|
1870
|
+
color: colors.semantic.text.default,
|
|
1871
|
+
fontFamily: colors.fontFamily.body,
|
|
1872
|
+
fontSize: px(colors.fontSize.sm),
|
|
1873
|
+
fontWeight: colors.fontWeight.semibold
|
|
1874
|
+
},
|
|
1875
|
+
children
|
|
1876
|
+
}
|
|
1877
|
+
) : children
|
|
1878
|
+
]
|
|
1879
|
+
}
|
|
1880
|
+
);
|
|
1881
|
+
}, "BreadcrumbPage");
|
|
1882
|
+
var BreadcrumbSeparator = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
1883
|
+
const ctx = useBreadcrumbContext("Breadcrumb.Separator");
|
|
1884
|
+
const node = children ?? renderSeparator(ctx.separator, { fromIndex: 0, visibleCount: 0, dir: ctx.dir });
|
|
1885
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1886
|
+
reactNative.View,
|
|
1887
|
+
{
|
|
1888
|
+
...testID !== void 0 ? { testID } : {},
|
|
1889
|
+
"aria-hidden": true,
|
|
1890
|
+
accessibilityElementsHidden: true,
|
|
1891
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1892
|
+
role: "presentation",
|
|
1893
|
+
className: cn("flex-row items-center", className),
|
|
1894
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 2 },
|
|
1895
|
+
children: node
|
|
1896
|
+
}
|
|
1897
|
+
);
|
|
1898
|
+
}, "BreadcrumbSeparator");
|
|
1899
|
+
tagComponent(BreadcrumbSeparator, "separator");
|
|
1900
|
+
var BreadcrumbEllipsis = /* @__PURE__ */ __name(({ ellipsisLabel, className, testID }) => {
|
|
1901
|
+
useBreadcrumbContext("Breadcrumb.Ellipsis");
|
|
1902
|
+
const { t } = useTranslation();
|
|
1903
|
+
const colors = useThemeColors();
|
|
1904
|
+
const label = ellipsisLabel ?? t("breadcrumb.ellipsisLabel", { defaultValue: "More" });
|
|
1905
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1906
|
+
reactNative.View,
|
|
1907
|
+
{
|
|
1908
|
+
...testID !== void 0 ? { testID } : {},
|
|
1909
|
+
accessibilityLabel: label,
|
|
1910
|
+
"aria-label": label,
|
|
1911
|
+
className: cn("flex-row items-center", className),
|
|
1912
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1913
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1914
|
+
reactNative.Text,
|
|
1915
|
+
{
|
|
1916
|
+
style: {
|
|
1917
|
+
fontFamily: colors.fontFamily.body,
|
|
1918
|
+
fontSize: px(colors.fontSize.sm),
|
|
1919
|
+
color: colors.semantic.text.muted
|
|
1920
|
+
},
|
|
1921
|
+
children: "\u2026"
|
|
1922
|
+
}
|
|
1923
|
+
)
|
|
1924
|
+
}
|
|
1925
|
+
);
|
|
1926
|
+
}, "BreadcrumbEllipsis");
|
|
1927
|
+
var Breadcrumb = Object.assign(BreadcrumbRoot, {
|
|
1928
|
+
List: BreadcrumbList,
|
|
1929
|
+
Item: BreadcrumbItem,
|
|
1930
|
+
Link: BreadcrumbLink,
|
|
1931
|
+
Page: BreadcrumbPage,
|
|
1932
|
+
Separator: BreadcrumbSeparator,
|
|
1933
|
+
Ellipsis: BreadcrumbEllipsis
|
|
1934
|
+
});
|
|
1935
|
+
|
|
1936
|
+
exports.Breadcrumb = Breadcrumb;
|
|
1937
|
+
exports.getBreadcrumbJsonLd = getBreadcrumbJsonLd;
|
|
1938
|
+
//# sourceMappingURL=index.cjs.map
|
|
1939
|
+
//# sourceMappingURL=index.cjs.map
|