@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,1106 @@
|
|
|
1
|
+
import { Popover } from './chunk-YNKKEO2A.js';
|
|
2
|
+
import { useTranslation } from './chunk-RFW5SRZA.js';
|
|
3
|
+
import { Slot } from './chunk-ZIBNLXIV.js';
|
|
4
|
+
import { px } from './chunk-5A2QOOVN.js';
|
|
5
|
+
import { cn } from './chunk-CHXHRJNZ.js';
|
|
6
|
+
import { useThemeColors } from './chunk-R5JMDDCB.js';
|
|
7
|
+
import { __name } from './chunk-WCQVDF3K.js';
|
|
8
|
+
import { createContext, isValidElement, useState, useRef, useCallback, useMemo, useEffect, Children, Fragment, useContext } from 'react';
|
|
9
|
+
import { Platform, View, Text, Pressable, ScrollView } from 'react-native';
|
|
10
|
+
import { jsx, jsxs } from 'nativewind/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var BreadcrumbContext = createContext(null);
|
|
13
|
+
var useBreadcrumbContext = /* @__PURE__ */ __name((label) => {
|
|
14
|
+
const ctx = useContext(BreadcrumbContext);
|
|
15
|
+
if (!ctx) {
|
|
16
|
+
throw new Error(`<${label}> must be rendered inside a <Breadcrumb>.`);
|
|
17
|
+
}
|
|
18
|
+
return ctx;
|
|
19
|
+
}, "useBreadcrumbContext");
|
|
20
|
+
var DEFAULT_ITEMS_BEFORE = 1;
|
|
21
|
+
var DEFAULT_ITEMS_AFTER = 1;
|
|
22
|
+
var COMPOUND_KIND_KEY = "__nori_breadcrumb_kind__";
|
|
23
|
+
function tagComponent(component, kind) {
|
|
24
|
+
component[COMPOUND_KIND_KEY] = kind;
|
|
25
|
+
return component;
|
|
26
|
+
}
|
|
27
|
+
__name(tagComponent, "tagComponent");
|
|
28
|
+
function getCompoundKind(node) {
|
|
29
|
+
if (!isValidElement(node)) {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
const type = node.type;
|
|
33
|
+
const tagged = type?.[COMPOUND_KIND_KEY];
|
|
34
|
+
return tagged === "item" || tagged === "separator" ? tagged : void 0;
|
|
35
|
+
}
|
|
36
|
+
__name(getCompoundKind, "getCompoundKind");
|
|
37
|
+
var DefaultChevron = /* @__PURE__ */ __name(({ dir }) => {
|
|
38
|
+
const colors = useThemeColors();
|
|
39
|
+
const flipped = dir === "rtl";
|
|
40
|
+
if (Platform.OS === "web") {
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"svg",
|
|
43
|
+
{
|
|
44
|
+
width: 14,
|
|
45
|
+
height: 14,
|
|
46
|
+
viewBox: "0 0 24 24",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: colors.semantic.text.muted,
|
|
49
|
+
strokeWidth: 2,
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round",
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
style: { transform: flipped ? "scaleX(-1)" : void 0, flexShrink: 0 },
|
|
54
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
Text,
|
|
60
|
+
{
|
|
61
|
+
accessibilityElementsHidden: true,
|
|
62
|
+
importantForAccessibility: "no-hide-descendants",
|
|
63
|
+
style: {
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
lineHeight: 20,
|
|
66
|
+
color: colors.semantic.text.muted,
|
|
67
|
+
transform: flipped ? [{ scaleX: -1 }] : void 0
|
|
68
|
+
},
|
|
69
|
+
children: "\u203A"
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}, "DefaultChevron");
|
|
73
|
+
var SeparatorText = /* @__PURE__ */ __name(({ children }) => {
|
|
74
|
+
const colors = useThemeColors();
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
Text,
|
|
77
|
+
{
|
|
78
|
+
accessibilityElementsHidden: true,
|
|
79
|
+
importantForAccessibility: "no-hide-descendants",
|
|
80
|
+
style: {
|
|
81
|
+
fontSize: px(colors.fontSize.sm),
|
|
82
|
+
lineHeight: px(colors.fontSize.md) * 1.4,
|
|
83
|
+
color: colors.semantic.text.muted,
|
|
84
|
+
fontFamily: colors.fontFamily.body,
|
|
85
|
+
paddingHorizontal: 2
|
|
86
|
+
},
|
|
87
|
+
children
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}, "SeparatorText");
|
|
91
|
+
function renderSeparator(separator, ctx) {
|
|
92
|
+
if (separator === void 0) {
|
|
93
|
+
return /* @__PURE__ */ jsx(DefaultChevron, { dir: ctx.dir });
|
|
94
|
+
}
|
|
95
|
+
if (typeof separator === "function") {
|
|
96
|
+
return separator(ctx);
|
|
97
|
+
}
|
|
98
|
+
if (typeof separator === "string") {
|
|
99
|
+
return /* @__PURE__ */ jsx(SeparatorText, { children: separator });
|
|
100
|
+
}
|
|
101
|
+
return separator;
|
|
102
|
+
}
|
|
103
|
+
__name(renderSeparator, "renderSeparator");
|
|
104
|
+
function useOverflowFit({
|
|
105
|
+
enabled,
|
|
106
|
+
itemCount,
|
|
107
|
+
itemsBeforeCollapse,
|
|
108
|
+
itemsAfterCollapse
|
|
109
|
+
}) {
|
|
110
|
+
const [containerWidth, setContainerWidth] = useState(null);
|
|
111
|
+
const itemWidthsRef = useRef(/* @__PURE__ */ new Map());
|
|
112
|
+
const ellipsisWidthRef = useRef(0);
|
|
113
|
+
const separatorWidthRef = useRef(0);
|
|
114
|
+
const [widthsTick, setWidthsTick] = useState(0);
|
|
115
|
+
const onContainerLayout = useCallback((event) => {
|
|
116
|
+
const w = event.nativeEvent.layout.width;
|
|
117
|
+
setContainerWidth((prev) => prev !== null && Math.abs(prev - w) < 0.5 ? prev : w);
|
|
118
|
+
}, []);
|
|
119
|
+
const onItemLayout = useCallback(
|
|
120
|
+
(index) => (event) => {
|
|
121
|
+
const w = event.nativeEvent.layout.width;
|
|
122
|
+
const prev = itemWidthsRef.current.get(index);
|
|
123
|
+
if (prev === void 0 || Math.abs(prev - w) >= 0.5) {
|
|
124
|
+
itemWidthsRef.current.set(index, w);
|
|
125
|
+
setWidthsTick((t) => t + 1);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
[]
|
|
129
|
+
);
|
|
130
|
+
const onEllipsisLayout = useCallback((event) => {
|
|
131
|
+
const w = event.nativeEvent.layout.width;
|
|
132
|
+
if (Math.abs(ellipsisWidthRef.current - w) >= 0.5) {
|
|
133
|
+
ellipsisWidthRef.current = w;
|
|
134
|
+
setWidthsTick((t) => t + 1);
|
|
135
|
+
}
|
|
136
|
+
}, []);
|
|
137
|
+
const onSeparatorLayout = useCallback((event) => {
|
|
138
|
+
const w = event.nativeEvent.layout.width;
|
|
139
|
+
if (Math.abs(separatorWidthRef.current - w) >= 0.5) {
|
|
140
|
+
separatorWidthRef.current = w;
|
|
141
|
+
setWidthsTick((t) => t + 1);
|
|
142
|
+
}
|
|
143
|
+
}, []);
|
|
144
|
+
const visibleIndices = useMemo(() => {
|
|
145
|
+
const all = /* @__PURE__ */ new Set();
|
|
146
|
+
for (let i = 0; i < itemCount; i += 1) {
|
|
147
|
+
all.add(i);
|
|
148
|
+
}
|
|
149
|
+
if (!enabled || containerWidth === null || itemCount === 0) {
|
|
150
|
+
return all;
|
|
151
|
+
}
|
|
152
|
+
const widths = itemWidthsRef.current;
|
|
153
|
+
if (widths.size < itemCount) {
|
|
154
|
+
return all;
|
|
155
|
+
}
|
|
156
|
+
const sep = separatorWidthRef.current;
|
|
157
|
+
const ell = ellipsisWidthRef.current;
|
|
158
|
+
let total = 0;
|
|
159
|
+
for (let i = 0; i < itemCount; i += 1) {
|
|
160
|
+
total += widths.get(i) ?? 0;
|
|
161
|
+
}
|
|
162
|
+
total += sep * Math.max(0, itemCount - 1);
|
|
163
|
+
if (total <= containerWidth) {
|
|
164
|
+
return all;
|
|
165
|
+
}
|
|
166
|
+
const before = Math.max(0, Math.min(itemsBeforeCollapse, itemCount));
|
|
167
|
+
const after = Math.max(0, Math.min(itemsAfterCollapse, itemCount - before));
|
|
168
|
+
const anchorIndices = /* @__PURE__ */ new Set();
|
|
169
|
+
for (let i = 0; i < before; i += 1) {
|
|
170
|
+
anchorIndices.add(i);
|
|
171
|
+
}
|
|
172
|
+
for (let i = itemCount - after; i < itemCount; i += 1) {
|
|
173
|
+
anchorIndices.add(i);
|
|
174
|
+
}
|
|
175
|
+
let used = 0;
|
|
176
|
+
for (const idx of anchorIndices) {
|
|
177
|
+
used += widths.get(idx) ?? 0;
|
|
178
|
+
}
|
|
179
|
+
used += ell;
|
|
180
|
+
const sepCount = Math.max(0, anchorIndices.size + 1 - 1);
|
|
181
|
+
used += sep * sepCount;
|
|
182
|
+
if (used > containerWidth) {
|
|
183
|
+
const beforeIdx = [];
|
|
184
|
+
for (let i = 0; i < before; i += 1) {
|
|
185
|
+
beforeIdx.push(i);
|
|
186
|
+
}
|
|
187
|
+
const afterIdx = [];
|
|
188
|
+
for (let i = itemCount - after; i < itemCount; i += 1) {
|
|
189
|
+
afterIdx.push(i);
|
|
190
|
+
}
|
|
191
|
+
const minBefore = before > 0 ? 1 : 0;
|
|
192
|
+
const minAfter = after > 0 ? 1 : 0;
|
|
193
|
+
while (used > containerWidth && (beforeIdx.length > minBefore || afterIdx.length > minAfter)) {
|
|
194
|
+
if (beforeIdx.length > minBefore) {
|
|
195
|
+
const dropped = beforeIdx.pop();
|
|
196
|
+
if (dropped !== void 0) {
|
|
197
|
+
used -= (widths.get(dropped) ?? 0) + sep;
|
|
198
|
+
anchorIndices.delete(dropped);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (used <= containerWidth) {
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
if (afterIdx.length > minAfter) {
|
|
205
|
+
const dropped = afterIdx.shift();
|
|
206
|
+
if (dropped !== void 0) {
|
|
207
|
+
used -= (widths.get(dropped) ?? 0) + sep;
|
|
208
|
+
anchorIndices.delete(dropped);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return anchorIndices;
|
|
213
|
+
}
|
|
214
|
+
let leftCursor = before;
|
|
215
|
+
let rightCursor = itemCount - after - 1;
|
|
216
|
+
while (leftCursor <= rightCursor) {
|
|
217
|
+
const w = widths.get(leftCursor) ?? 0;
|
|
218
|
+
if (used + w + sep <= containerWidth) {
|
|
219
|
+
anchorIndices.add(leftCursor);
|
|
220
|
+
used += w + sep;
|
|
221
|
+
leftCursor += 1;
|
|
222
|
+
} else {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
if (leftCursor > rightCursor) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
const w2 = widths.get(rightCursor) ?? 0;
|
|
229
|
+
if (used + w2 + sep <= containerWidth) {
|
|
230
|
+
anchorIndices.add(rightCursor);
|
|
231
|
+
used += w2 + sep;
|
|
232
|
+
rightCursor -= 1;
|
|
233
|
+
} else {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return anchorIndices;
|
|
238
|
+
}, [containerWidth, itemCount, itemsBeforeCollapse, itemsAfterCollapse, enabled, widthsTick]);
|
|
239
|
+
const ready = !enabled || containerWidth !== null && itemWidthsRef.current.size >= itemCount;
|
|
240
|
+
return {
|
|
241
|
+
visibleIndices,
|
|
242
|
+
ready,
|
|
243
|
+
onContainerLayout,
|
|
244
|
+
onItemLayout,
|
|
245
|
+
onEllipsisLayout,
|
|
246
|
+
onSeparatorLayout
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
__name(useOverflowFit, "useOverflowFit");
|
|
250
|
+
function applyCountCollapse(items, maxItems, before, after) {
|
|
251
|
+
if (!maxItems || items.length <= maxItems) {
|
|
252
|
+
return { visible: items, hidden: [], collapseAt: -1 };
|
|
253
|
+
}
|
|
254
|
+
const beforeArr = items.slice(0, Math.max(0, Math.min(before, items.length)));
|
|
255
|
+
const afterArr = after > 0 ? items.slice(Math.max(beforeArr.length, items.length - after)) : [];
|
|
256
|
+
const hidden = items.slice(beforeArr.length, items.length - afterArr.length);
|
|
257
|
+
const visible = [...beforeArr, ...afterArr];
|
|
258
|
+
return { visible, hidden, collapseAt: beforeArr.length };
|
|
259
|
+
}
|
|
260
|
+
__name(applyCountCollapse, "applyCountCollapse");
|
|
261
|
+
function getBreadcrumbJsonLd(items) {
|
|
262
|
+
const elements = items.map((it, idx) => {
|
|
263
|
+
const name = typeof it.label === "string" ? it.label : void 0;
|
|
264
|
+
if (!name) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
const entry = {
|
|
268
|
+
"@type": "ListItem",
|
|
269
|
+
position: idx + 1,
|
|
270
|
+
name
|
|
271
|
+
};
|
|
272
|
+
if (it.href) {
|
|
273
|
+
entry.item = it.href;
|
|
274
|
+
}
|
|
275
|
+
return entry;
|
|
276
|
+
}).filter((x) => x !== null);
|
|
277
|
+
return JSON.stringify({
|
|
278
|
+
"@context": "https://schema.org",
|
|
279
|
+
"@type": "BreadcrumbList",
|
|
280
|
+
itemListElement: elements
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
__name(getBreadcrumbJsonLd, "getBreadcrumbJsonLd");
|
|
284
|
+
function useBreadcrumbJsonLdInjection(items, enabled) {
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (!enabled || Platform.OS !== "web" || typeof document === "undefined") {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
const json = getBreadcrumbJsonLd(items);
|
|
290
|
+
if (!json.includes('"itemListElement":[{')) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const script = document.createElement("script");
|
|
294
|
+
script.type = "application/ld+json";
|
|
295
|
+
script.textContent = json;
|
|
296
|
+
script.setAttribute("data-nori-breadcrumb", "true");
|
|
297
|
+
document.head.appendChild(script);
|
|
298
|
+
return () => {
|
|
299
|
+
if (script.parentNode === document.head) {
|
|
300
|
+
document.head.removeChild(script);
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
}, [items, enabled]);
|
|
304
|
+
}
|
|
305
|
+
__name(useBreadcrumbJsonLdInjection, "useBreadcrumbJsonLdInjection");
|
|
306
|
+
function truncateString(input, max) {
|
|
307
|
+
if (max <= 0 || input.length <= max) {
|
|
308
|
+
return input;
|
|
309
|
+
}
|
|
310
|
+
if (max <= 1) {
|
|
311
|
+
return "\u2026";
|
|
312
|
+
}
|
|
313
|
+
return `${input.slice(0, max - 1)}\u2026`;
|
|
314
|
+
}
|
|
315
|
+
__name(truncateString, "truncateString");
|
|
316
|
+
var BreadcrumbRoot = /* @__PURE__ */ __name(({
|
|
317
|
+
items,
|
|
318
|
+
separator,
|
|
319
|
+
maxItems,
|
|
320
|
+
itemsBeforeCollapse = DEFAULT_ITEMS_BEFORE,
|
|
321
|
+
itemsAfterCollapse = DEFAULT_ITEMS_AFTER,
|
|
322
|
+
collapseOnOverflow,
|
|
323
|
+
expandBehavior,
|
|
324
|
+
expandLabel,
|
|
325
|
+
ellipsisLabel,
|
|
326
|
+
currentPageLabel,
|
|
327
|
+
siblingMenuLabel,
|
|
328
|
+
ariaLabel,
|
|
329
|
+
schemaOrg,
|
|
330
|
+
dir = "ltr",
|
|
331
|
+
maxLabelLength = 0,
|
|
332
|
+
children,
|
|
333
|
+
className,
|
|
334
|
+
testID
|
|
335
|
+
}) => {
|
|
336
|
+
const { t } = useTranslation();
|
|
337
|
+
const colors = useThemeColors();
|
|
338
|
+
const resolvedAriaLabel = ariaLabel ?? t("breadcrumb.ariaLabel", { defaultValue: "Breadcrumb" });
|
|
339
|
+
const resolvedExpandLabel = expandLabel ?? t("breadcrumb.expandLabel", { defaultValue: "Show full path" });
|
|
340
|
+
const resolvedEllipsisLabel = ellipsisLabel ?? t("breadcrumb.ellipsisLabel", { defaultValue: "More" });
|
|
341
|
+
const resolvedCurrentPageLabel = currentPageLabel ?? t("breadcrumb.currentPageLabel", { defaultValue: "Current page" });
|
|
342
|
+
const resolvedSiblingMenuLabel = siblingMenuLabel ?? t("breadcrumb.siblingMenuLabel", { defaultValue: "Open sibling pages" });
|
|
343
|
+
const resolvedExpandBehavior = expandBehavior ?? (Platform.OS === "web" ? "inline" : "menu");
|
|
344
|
+
if (items && items.length > 0) {
|
|
345
|
+
return /* @__PURE__ */ jsx(
|
|
346
|
+
BreadcrumbItemsRenderer,
|
|
347
|
+
{
|
|
348
|
+
items,
|
|
349
|
+
separator,
|
|
350
|
+
maxItems,
|
|
351
|
+
itemsBeforeCollapse,
|
|
352
|
+
itemsAfterCollapse,
|
|
353
|
+
collapseOnOverflow: collapseOnOverflow ?? true,
|
|
354
|
+
expandBehavior: resolvedExpandBehavior,
|
|
355
|
+
expandLabel: resolvedExpandLabel,
|
|
356
|
+
ellipsisLabel: resolvedEllipsisLabel,
|
|
357
|
+
currentPageLabel: resolvedCurrentPageLabel,
|
|
358
|
+
siblingMenuLabel: resolvedSiblingMenuLabel,
|
|
359
|
+
ariaLabel: resolvedAriaLabel,
|
|
360
|
+
schemaOrg,
|
|
361
|
+
dir,
|
|
362
|
+
maxLabelLength,
|
|
363
|
+
...className !== void 0 ? { className } : {},
|
|
364
|
+
...testID !== void 0 ? { testID } : {}
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
const ctxValue = {
|
|
369
|
+
separator: separator ?? "",
|
|
370
|
+
dir,
|
|
371
|
+
currentPageLabel: resolvedCurrentPageLabel,
|
|
372
|
+
siblingMenuLabel: resolvedSiblingMenuLabel,
|
|
373
|
+
maxLabelLength
|
|
374
|
+
};
|
|
375
|
+
return /* @__PURE__ */ jsx(BreadcrumbContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx(
|
|
376
|
+
View,
|
|
377
|
+
{
|
|
378
|
+
...testID !== void 0 ? { testID } : {},
|
|
379
|
+
role: "navigation",
|
|
380
|
+
"aria-label": resolvedAriaLabel,
|
|
381
|
+
accessible: true,
|
|
382
|
+
accessibilityLabel: resolvedAriaLabel,
|
|
383
|
+
className: cn("flex-row items-center", className),
|
|
384
|
+
style: {
|
|
385
|
+
flexDirection: "row",
|
|
386
|
+
alignItems: "center",
|
|
387
|
+
direction: dir,
|
|
388
|
+
fontFamily: colors.fontFamily.body
|
|
389
|
+
},
|
|
390
|
+
children
|
|
391
|
+
}
|
|
392
|
+
) });
|
|
393
|
+
}, "BreadcrumbRoot");
|
|
394
|
+
var BreadcrumbItemsRenderer = /* @__PURE__ */ __name(({
|
|
395
|
+
items,
|
|
396
|
+
separator,
|
|
397
|
+
maxItems,
|
|
398
|
+
itemsBeforeCollapse,
|
|
399
|
+
itemsAfterCollapse,
|
|
400
|
+
collapseOnOverflow,
|
|
401
|
+
expandBehavior,
|
|
402
|
+
expandLabel,
|
|
403
|
+
ellipsisLabel,
|
|
404
|
+
currentPageLabel,
|
|
405
|
+
siblingMenuLabel,
|
|
406
|
+
ariaLabel,
|
|
407
|
+
schemaOrg,
|
|
408
|
+
dir,
|
|
409
|
+
maxLabelLength,
|
|
410
|
+
className,
|
|
411
|
+
testID
|
|
412
|
+
}) => {
|
|
413
|
+
const [inlineExpanded, setInlineExpanded] = useState(false);
|
|
414
|
+
const normalizedItems = useMemo(() => {
|
|
415
|
+
if (items.length === 0) {
|
|
416
|
+
return items;
|
|
417
|
+
}
|
|
418
|
+
const anyCurrent = items.some((it) => it.current);
|
|
419
|
+
if (anyCurrent) {
|
|
420
|
+
return items;
|
|
421
|
+
}
|
|
422
|
+
const last = items[items.length - 1];
|
|
423
|
+
if (!last) {
|
|
424
|
+
return items;
|
|
425
|
+
}
|
|
426
|
+
const out = [...items];
|
|
427
|
+
out[out.length - 1] = { ...last, current: true };
|
|
428
|
+
return out;
|
|
429
|
+
}, [items]);
|
|
430
|
+
useBreadcrumbJsonLdInjection(normalizedItems, schemaOrg !== false);
|
|
431
|
+
const countCollapse = useMemo(
|
|
432
|
+
() => applyCountCollapse(
|
|
433
|
+
normalizedItems,
|
|
434
|
+
inlineExpanded ? void 0 : maxItems,
|
|
435
|
+
itemsBeforeCollapse,
|
|
436
|
+
itemsAfterCollapse
|
|
437
|
+
),
|
|
438
|
+
[normalizedItems, maxItems, itemsBeforeCollapse, itemsAfterCollapse, inlineExpanded]
|
|
439
|
+
);
|
|
440
|
+
const widthFit = useOverflowFit({
|
|
441
|
+
enabled: collapseOnOverflow && expandBehavior !== "scroll" && !inlineExpanded,
|
|
442
|
+
itemCount: countCollapse.visible.length,
|
|
443
|
+
itemsBeforeCollapse,
|
|
444
|
+
itemsAfterCollapse
|
|
445
|
+
});
|
|
446
|
+
const widthHiddenItems = useMemo(() => {
|
|
447
|
+
if (!collapseOnOverflow || expandBehavior === "scroll" || inlineExpanded) {
|
|
448
|
+
return [];
|
|
449
|
+
}
|
|
450
|
+
return countCollapse.visible.filter((_, idx) => !widthFit.visibleIndices.has(idx));
|
|
451
|
+
}, [collapseOnOverflow, expandBehavior, inlineExpanded, countCollapse.visible, widthFit.visibleIndices]);
|
|
452
|
+
const allHiddenItems = useMemo(() => {
|
|
453
|
+
if (inlineExpanded) {
|
|
454
|
+
return [];
|
|
455
|
+
}
|
|
456
|
+
return [...countCollapse.hidden, ...widthHiddenItems];
|
|
457
|
+
}, [countCollapse.hidden, widthHiddenItems, inlineExpanded]);
|
|
458
|
+
const visibleItemsForRender = useMemo(() => {
|
|
459
|
+
if (inlineExpanded) {
|
|
460
|
+
return normalizedItems;
|
|
461
|
+
}
|
|
462
|
+
return countCollapse.visible.filter(
|
|
463
|
+
(_, idx) => collapseOnOverflow && expandBehavior !== "scroll" ? widthFit.visibleIndices.has(idx) : true
|
|
464
|
+
);
|
|
465
|
+
}, [
|
|
466
|
+
countCollapse.visible,
|
|
467
|
+
widthFit.visibleIndices,
|
|
468
|
+
collapseOnOverflow,
|
|
469
|
+
expandBehavior,
|
|
470
|
+
inlineExpanded,
|
|
471
|
+
normalizedItems
|
|
472
|
+
]);
|
|
473
|
+
const ellipsisInsertAt = useMemo(() => {
|
|
474
|
+
if (inlineExpanded || allHiddenItems.length === 0) {
|
|
475
|
+
return -1;
|
|
476
|
+
}
|
|
477
|
+
return Math.min(itemsBeforeCollapse, visibleItemsForRender.length);
|
|
478
|
+
}, [allHiddenItems.length, inlineExpanded, visibleItemsForRender.length, itemsBeforeCollapse]);
|
|
479
|
+
const renderedCells = [];
|
|
480
|
+
const measurementCells = [];
|
|
481
|
+
visibleItemsForRender.forEach((item, idx) => {
|
|
482
|
+
if (idx === ellipsisInsertAt && allHiddenItems.length > 0) {
|
|
483
|
+
renderedCells.push(
|
|
484
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
485
|
+
BreadcrumbEllipsisInternal,
|
|
486
|
+
{
|
|
487
|
+
ellipsisLabel,
|
|
488
|
+
expandLabel,
|
|
489
|
+
expandBehavior,
|
|
490
|
+
hiddenItems: allHiddenItems,
|
|
491
|
+
onExpandInline: () => setInlineExpanded(true)
|
|
492
|
+
}
|
|
493
|
+
) }, "__ellipsis__")
|
|
494
|
+
);
|
|
495
|
+
renderedCells.push(
|
|
496
|
+
/* @__PURE__ */ jsx(Fragment, { children: renderSeparator(separator, {
|
|
497
|
+
fromIndex: idx - 1,
|
|
498
|
+
visibleCount: visibleItemsForRender.length + 1,
|
|
499
|
+
dir
|
|
500
|
+
}) }, "__sep_ellipsis__")
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
const itemKey = item.key ?? `item-${normalizedItems.indexOf(item)}`;
|
|
504
|
+
renderedCells.push(
|
|
505
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
506
|
+
BreadcrumbItemRenderer,
|
|
507
|
+
{
|
|
508
|
+
item,
|
|
509
|
+
currentPageLabel,
|
|
510
|
+
siblingMenuLabel,
|
|
511
|
+
maxLabelLength
|
|
512
|
+
}
|
|
513
|
+
) }, itemKey)
|
|
514
|
+
);
|
|
515
|
+
const isLast = idx === visibleItemsForRender.length - 1;
|
|
516
|
+
if (!isLast) {
|
|
517
|
+
renderedCells.push(
|
|
518
|
+
/* @__PURE__ */ jsx(Fragment, { children: renderSeparator(separator, {
|
|
519
|
+
fromIndex: idx,
|
|
520
|
+
visibleCount: visibleItemsForRender.length,
|
|
521
|
+
dir
|
|
522
|
+
}) }, `sep-${itemKey}`)
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
if (collapseOnOverflow && expandBehavior !== "scroll") {
|
|
527
|
+
countCollapse.visible.forEach((item, idx) => {
|
|
528
|
+
const itemKey = item.key ?? `m-${idx}`;
|
|
529
|
+
measurementCells.push(
|
|
530
|
+
/* @__PURE__ */ jsx(View, { onLayout: widthFit.onItemLayout(idx), children: /* @__PURE__ */ jsx(
|
|
531
|
+
BreadcrumbItemRenderer,
|
|
532
|
+
{
|
|
533
|
+
item,
|
|
534
|
+
currentPageLabel,
|
|
535
|
+
siblingMenuLabel,
|
|
536
|
+
maxLabelLength
|
|
537
|
+
}
|
|
538
|
+
) }, itemKey)
|
|
539
|
+
);
|
|
540
|
+
});
|
|
541
|
+
measurementCells.push(
|
|
542
|
+
/* @__PURE__ */ jsx(View, { onLayout: widthFit.onSeparatorLayout, children: renderSeparator(separator, {
|
|
543
|
+
fromIndex: 0,
|
|
544
|
+
visibleCount: countCollapse.visible.length,
|
|
545
|
+
dir
|
|
546
|
+
}) }, "__m_sep__")
|
|
547
|
+
);
|
|
548
|
+
measurementCells.push(
|
|
549
|
+
/* @__PURE__ */ jsx(View, { onLayout: widthFit.onEllipsisLayout, children: /* @__PURE__ */ jsx(
|
|
550
|
+
BreadcrumbEllipsisInternal,
|
|
551
|
+
{
|
|
552
|
+
ellipsisLabel,
|
|
553
|
+
expandLabel,
|
|
554
|
+
expandBehavior: "none",
|
|
555
|
+
hiddenItems: [],
|
|
556
|
+
onExpandInline: () => void 0
|
|
557
|
+
}
|
|
558
|
+
) }, "__m_ellipsis__")
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
const list = /* @__PURE__ */ jsx(
|
|
562
|
+
View,
|
|
563
|
+
{
|
|
564
|
+
role: "list",
|
|
565
|
+
accessibilityRole: "list",
|
|
566
|
+
className: cn("flex-row items-center"),
|
|
567
|
+
style: { flexDirection: "row", alignItems: "center", flexShrink: 1, minWidth: 0 },
|
|
568
|
+
children: renderedCells
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
const wrapperStyle = {
|
|
572
|
+
flexDirection: "row",
|
|
573
|
+
alignItems: "center",
|
|
574
|
+
direction: dir,
|
|
575
|
+
flexShrink: 1,
|
|
576
|
+
minWidth: 0,
|
|
577
|
+
...collapseOnOverflow && expandBehavior !== "scroll" ? { width: "100%" } : null,
|
|
578
|
+
// `overflow: 'hidden'` keeps the visible row from blowing past
|
|
579
|
+
// its container before the first measurement settles. Without
|
|
580
|
+
// it, native renders the natural-width row briefly on the first
|
|
581
|
+
// paint, even though the JS layout reports the correct measured
|
|
582
|
+
// width on the very next tick.
|
|
583
|
+
...collapseOnOverflow ? { overflow: "hidden" } : null
|
|
584
|
+
};
|
|
585
|
+
return /* @__PURE__ */ jsxs(
|
|
586
|
+
View,
|
|
587
|
+
{
|
|
588
|
+
...testID !== void 0 ? { testID } : {},
|
|
589
|
+
role: "navigation",
|
|
590
|
+
"aria-label": ariaLabel,
|
|
591
|
+
accessible: true,
|
|
592
|
+
accessibilityLabel: ariaLabel,
|
|
593
|
+
className: cn("flex-row items-center", className),
|
|
594
|
+
style: wrapperStyle,
|
|
595
|
+
onLayout: collapseOnOverflow && expandBehavior !== "scroll" ? widthFit.onContainerLayout : void 0,
|
|
596
|
+
children: [
|
|
597
|
+
expandBehavior === "scroll" ? /* @__PURE__ */ jsx(
|
|
598
|
+
ScrollView,
|
|
599
|
+
{
|
|
600
|
+
horizontal: true,
|
|
601
|
+
showsHorizontalScrollIndicator: false,
|
|
602
|
+
contentContainerStyle: { flexDirection: "row", alignItems: "center" },
|
|
603
|
+
style: { flexGrow: 1 },
|
|
604
|
+
children: list
|
|
605
|
+
}
|
|
606
|
+
) : list,
|
|
607
|
+
collapseOnOverflow && expandBehavior !== "scroll" ? /* @__PURE__ */ jsx(
|
|
608
|
+
View,
|
|
609
|
+
{
|
|
610
|
+
"aria-hidden": true,
|
|
611
|
+
accessibilityElementsHidden: true,
|
|
612
|
+
importantForAccessibility: "no-hide-descendants",
|
|
613
|
+
style: {
|
|
614
|
+
position: "absolute",
|
|
615
|
+
opacity: 0,
|
|
616
|
+
flexDirection: "row",
|
|
617
|
+
alignItems: "center",
|
|
618
|
+
left: -99999,
|
|
619
|
+
top: 0,
|
|
620
|
+
// `pointerEvents` lives on the style object now —
|
|
621
|
+
// the prop form is deprecated in RN 0.71+ / RN-Web
|
|
622
|
+
// 0.20+ and emits a runtime warning every render.
|
|
623
|
+
pointerEvents: "none"
|
|
624
|
+
},
|
|
625
|
+
children: measurementCells
|
|
626
|
+
}
|
|
627
|
+
) : null
|
|
628
|
+
]
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
}, "BreadcrumbItemsRenderer");
|
|
632
|
+
var BreadcrumbItemRenderer = /* @__PURE__ */ __name(({ item, currentPageLabel, siblingMenuLabel, maxLabelLength }) => {
|
|
633
|
+
const colors = useThemeColors();
|
|
634
|
+
const Icon = item.icon;
|
|
635
|
+
const isLink = !item.current && (item.href !== void 0 || item.onSelect !== void 0);
|
|
636
|
+
const effectiveMax = item.maxLabelLength ?? maxLabelLength;
|
|
637
|
+
const renderLabel = /* @__PURE__ */ __name(() => {
|
|
638
|
+
if (item.loading) {
|
|
639
|
+
return /* @__PURE__ */ jsx(
|
|
640
|
+
View,
|
|
641
|
+
{
|
|
642
|
+
style: {
|
|
643
|
+
backgroundColor: colors.semantic.background.subtle,
|
|
644
|
+
borderRadius: px(colors.radius.sm),
|
|
645
|
+
height: px(colors.fontSize.sm),
|
|
646
|
+
width: 64
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
if (typeof item.label === "string" || typeof item.label === "number") {
|
|
652
|
+
const text = String(item.label);
|
|
653
|
+
const truncated = effectiveMax > 0 ? truncateString(text, effectiveMax) : text;
|
|
654
|
+
return /* @__PURE__ */ jsx(
|
|
655
|
+
Text,
|
|
656
|
+
{
|
|
657
|
+
numberOfLines: 1,
|
|
658
|
+
ellipsizeMode: "tail",
|
|
659
|
+
style: {
|
|
660
|
+
fontFamily: colors.fontFamily.body,
|
|
661
|
+
fontSize: px(colors.fontSize.sm),
|
|
662
|
+
color: item.current ? colors.semantic.text.default : colors.semantic.text.muted,
|
|
663
|
+
fontWeight: item.current ? colors.fontWeight.semibold : colors.fontWeight.regular
|
|
664
|
+
},
|
|
665
|
+
children: truncated
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
return item.label;
|
|
670
|
+
}, "renderLabel");
|
|
671
|
+
const inner = /* @__PURE__ */ jsxs(
|
|
672
|
+
View,
|
|
673
|
+
{
|
|
674
|
+
style: {
|
|
675
|
+
flexDirection: "row",
|
|
676
|
+
alignItems: "center",
|
|
677
|
+
gap: px(colors.spacing["1"])
|
|
678
|
+
},
|
|
679
|
+
children: [
|
|
680
|
+
Icon ? /* @__PURE__ */ jsx(Icon, { size: 14, color: item.current ? colors.semantic.text.default : colors.semantic.text.muted }) : null,
|
|
681
|
+
renderLabel()
|
|
682
|
+
]
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
if (item.current) {
|
|
686
|
+
return /* @__PURE__ */ jsxs(
|
|
687
|
+
View,
|
|
688
|
+
{
|
|
689
|
+
role: "listitem",
|
|
690
|
+
accessibilityRole: "text",
|
|
691
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
692
|
+
children: [
|
|
693
|
+
/* @__PURE__ */ jsxs(
|
|
694
|
+
Text,
|
|
695
|
+
{
|
|
696
|
+
style: {
|
|
697
|
+
position: "absolute",
|
|
698
|
+
width: 1,
|
|
699
|
+
height: 1,
|
|
700
|
+
overflow: "hidden",
|
|
701
|
+
opacity: 0
|
|
702
|
+
},
|
|
703
|
+
children: [
|
|
704
|
+
currentPageLabel,
|
|
705
|
+
":",
|
|
706
|
+
" "
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
/* @__PURE__ */ jsx(View, { "aria-current": "page", children: inner })
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
if (item.siblings && item.siblings.length > 0) {
|
|
716
|
+
return /* @__PURE__ */ jsxs(View, { role: "listitem", style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 }, children: [
|
|
717
|
+
/* @__PURE__ */ jsx(BreadcrumbInteractive, { item, children: inner }),
|
|
718
|
+
/* @__PURE__ */ jsx(BreadcrumbSiblingMenu, { item, siblingMenuLabel })
|
|
719
|
+
] });
|
|
720
|
+
}
|
|
721
|
+
if (isLink) {
|
|
722
|
+
return /* @__PURE__ */ jsx(View, { role: "listitem", style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 }, children: /* @__PURE__ */ jsx(BreadcrumbInteractive, { item, children: inner }) });
|
|
723
|
+
}
|
|
724
|
+
return /* @__PURE__ */ jsx(View, { role: "listitem", style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 }, children: inner });
|
|
725
|
+
}, "BreadcrumbItemRenderer");
|
|
726
|
+
var BreadcrumbInteractive = /* @__PURE__ */ __name(({ item, children }) => {
|
|
727
|
+
const colors = useThemeColors();
|
|
728
|
+
const handlePress = useCallback(() => {
|
|
729
|
+
item.onSelect?.();
|
|
730
|
+
}, [item]);
|
|
731
|
+
if (Platform.OS === "web" && item.href) {
|
|
732
|
+
const handleClick = item.onSelect ? (event) => {
|
|
733
|
+
event.preventDefault();
|
|
734
|
+
item.onSelect?.();
|
|
735
|
+
} : void 0;
|
|
736
|
+
return /* @__PURE__ */ jsx(
|
|
737
|
+
"a",
|
|
738
|
+
{
|
|
739
|
+
href: item.href,
|
|
740
|
+
onClick: handleClick,
|
|
741
|
+
style: {
|
|
742
|
+
color: colors.semantic.interactive.primary,
|
|
743
|
+
textDecoration: "none",
|
|
744
|
+
fontFamily: colors.fontFamily.body
|
|
745
|
+
},
|
|
746
|
+
children
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: handlePress, accessibilityRole: "link", role: "link", children });
|
|
751
|
+
}, "BreadcrumbInteractive");
|
|
752
|
+
var BreadcrumbSiblingMenu = /* @__PURE__ */ __name(({ item, siblingMenuLabel }) => {
|
|
753
|
+
const colors = useThemeColors();
|
|
754
|
+
const siblings = item.siblings ?? [];
|
|
755
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
756
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: false, children: /* @__PURE__ */ jsx(
|
|
757
|
+
View,
|
|
758
|
+
{
|
|
759
|
+
accessibilityLabel: siblingMenuLabel,
|
|
760
|
+
style: {
|
|
761
|
+
flexDirection: "row",
|
|
762
|
+
alignItems: "center",
|
|
763
|
+
paddingHorizontal: 2,
|
|
764
|
+
paddingVertical: 4
|
|
765
|
+
},
|
|
766
|
+
children: /* @__PURE__ */ jsx(
|
|
767
|
+
Text,
|
|
768
|
+
{
|
|
769
|
+
accessibilityElementsHidden: true,
|
|
770
|
+
importantForAccessibility: "no-hide-descendants",
|
|
771
|
+
style: { fontSize: 10, color: colors.semantic.text.muted },
|
|
772
|
+
children: "\u25BE"
|
|
773
|
+
}
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
) }),
|
|
777
|
+
/* @__PURE__ */ jsx(Popover.Content, { side: "bottom", align: "start", children: /* @__PURE__ */ jsx(View, { style: { minWidth: 200, paddingVertical: 4 }, children: siblings.map((sib, idx) => /* @__PURE__ */ jsx(SiblingRow, { sibling: sib }, sib.href ?? idx)) }) })
|
|
778
|
+
] });
|
|
779
|
+
}, "BreadcrumbSiblingMenu");
|
|
780
|
+
var SiblingRow = /* @__PURE__ */ __name(({ sibling }) => {
|
|
781
|
+
const colors = useThemeColors();
|
|
782
|
+
const Icon = sibling.icon;
|
|
783
|
+
const handlePress = useCallback(() => {
|
|
784
|
+
sibling.onSelect?.();
|
|
785
|
+
}, [sibling]);
|
|
786
|
+
const inner = /* @__PURE__ */ jsxs(
|
|
787
|
+
View,
|
|
788
|
+
{
|
|
789
|
+
style: {
|
|
790
|
+
flexDirection: "row",
|
|
791
|
+
alignItems: "center",
|
|
792
|
+
gap: px(colors.spacing["2"]),
|
|
793
|
+
paddingVertical: px(colors.spacing["2"]),
|
|
794
|
+
paddingHorizontal: px(colors.spacing["3"]),
|
|
795
|
+
opacity: sibling.disabled ? 0.5 : 1
|
|
796
|
+
},
|
|
797
|
+
children: [
|
|
798
|
+
Icon ? /* @__PURE__ */ jsx(Icon, { size: 14, color: colors.semantic.text.muted }) : null,
|
|
799
|
+
typeof sibling.label === "string" || typeof sibling.label === "number" ? /* @__PURE__ */ jsx(
|
|
800
|
+
Text,
|
|
801
|
+
{
|
|
802
|
+
style: {
|
|
803
|
+
fontFamily: colors.fontFamily.body,
|
|
804
|
+
fontSize: px(colors.fontSize.sm),
|
|
805
|
+
color: colors.semantic.text.default
|
|
806
|
+
},
|
|
807
|
+
children: String(sibling.label)
|
|
808
|
+
}
|
|
809
|
+
) : sibling.label
|
|
810
|
+
]
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
if (Platform.OS === "web" && sibling.href && !sibling.disabled) {
|
|
814
|
+
const handleClick = sibling.onSelect ? (event) => {
|
|
815
|
+
event.preventDefault();
|
|
816
|
+
sibling.onSelect?.();
|
|
817
|
+
} : void 0;
|
|
818
|
+
return /* @__PURE__ */ jsx("a", { href: sibling.href, onClick: handleClick, style: { textDecoration: "none", color: "inherit" }, children: inner });
|
|
819
|
+
}
|
|
820
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: sibling.disabled ? void 0 : handlePress, accessibilityRole: "menuitem", children: inner });
|
|
821
|
+
}, "SiblingRow");
|
|
822
|
+
var BreadcrumbEllipsisInternal = /* @__PURE__ */ __name(({
|
|
823
|
+
ellipsisLabel,
|
|
824
|
+
expandLabel,
|
|
825
|
+
expandBehavior,
|
|
826
|
+
hiddenItems,
|
|
827
|
+
onExpandInline
|
|
828
|
+
}) => {
|
|
829
|
+
const colors = useThemeColors();
|
|
830
|
+
const renderDots = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsx(
|
|
831
|
+
Text,
|
|
832
|
+
{
|
|
833
|
+
accessibilityElementsHidden: true,
|
|
834
|
+
importantForAccessibility: "no-hide-descendants",
|
|
835
|
+
style: {
|
|
836
|
+
fontFamily: colors.fontFamily.body,
|
|
837
|
+
fontSize: px(colors.fontSize.sm),
|
|
838
|
+
color: colors.semantic.text.muted,
|
|
839
|
+
paddingHorizontal: 4
|
|
840
|
+
},
|
|
841
|
+
children: "\u2026"
|
|
842
|
+
}
|
|
843
|
+
), "renderDots");
|
|
844
|
+
if (expandBehavior === "none" || hiddenItems.length === 0) {
|
|
845
|
+
return /* @__PURE__ */ jsx(
|
|
846
|
+
View,
|
|
847
|
+
{
|
|
848
|
+
accessibilityLabel: ellipsisLabel,
|
|
849
|
+
"aria-label": ellipsisLabel,
|
|
850
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
851
|
+
children: renderDots()
|
|
852
|
+
}
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
if (expandBehavior === "inline") {
|
|
856
|
+
return /* @__PURE__ */ jsx(
|
|
857
|
+
Pressable,
|
|
858
|
+
{
|
|
859
|
+
onPress: onExpandInline,
|
|
860
|
+
accessibilityRole: "button",
|
|
861
|
+
role: "button",
|
|
862
|
+
accessibilityLabel: expandLabel,
|
|
863
|
+
"aria-label": expandLabel,
|
|
864
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
865
|
+
children: renderDots()
|
|
866
|
+
}
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
870
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: false, children: /* @__PURE__ */ jsx(
|
|
871
|
+
View,
|
|
872
|
+
{
|
|
873
|
+
accessibilityLabel: expandLabel,
|
|
874
|
+
"aria-label": expandLabel,
|
|
875
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
876
|
+
children: renderDots()
|
|
877
|
+
}
|
|
878
|
+
) }),
|
|
879
|
+
/* @__PURE__ */ jsx(Popover.Content, { side: "bottom", align: "start", children: /* @__PURE__ */ jsx(View, { style: { minWidth: 200, paddingVertical: 4 }, children: hiddenItems.map((it, idx) => {
|
|
880
|
+
const sib = { label: it.label };
|
|
881
|
+
if (it.href !== void 0) {
|
|
882
|
+
sib.href = it.href;
|
|
883
|
+
}
|
|
884
|
+
if (it.icon !== void 0) {
|
|
885
|
+
sib.icon = it.icon;
|
|
886
|
+
}
|
|
887
|
+
if (it.onSelect !== void 0) {
|
|
888
|
+
sib.onSelect = it.onSelect;
|
|
889
|
+
}
|
|
890
|
+
return /* @__PURE__ */ jsx(
|
|
891
|
+
SiblingRow,
|
|
892
|
+
{
|
|
893
|
+
sibling: sib
|
|
894
|
+
},
|
|
895
|
+
typeof it.key === "string" || typeof it.key === "number" ? it.key : idx
|
|
896
|
+
);
|
|
897
|
+
}) }) })
|
|
898
|
+
] });
|
|
899
|
+
}, "BreadcrumbEllipsisInternal");
|
|
900
|
+
var BreadcrumbList = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
901
|
+
useBreadcrumbContext("Breadcrumb.List");
|
|
902
|
+
const childArray = Children.toArray(children);
|
|
903
|
+
const out = [];
|
|
904
|
+
let lastWasItem = false;
|
|
905
|
+
childArray.forEach((child, idx) => {
|
|
906
|
+
const kind = getCompoundKind(child);
|
|
907
|
+
if (kind === "item") {
|
|
908
|
+
if (lastWasItem) {
|
|
909
|
+
out.push(
|
|
910
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: separator position is deterministic from its preceding item index
|
|
911
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(BreadcrumbSeparator, {}) }, `__autosep_${idx}`)
|
|
912
|
+
);
|
|
913
|
+
}
|
|
914
|
+
out.push(child);
|
|
915
|
+
lastWasItem = true;
|
|
916
|
+
} else {
|
|
917
|
+
out.push(child);
|
|
918
|
+
lastWasItem = false;
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
return /* @__PURE__ */ jsx(
|
|
922
|
+
View,
|
|
923
|
+
{
|
|
924
|
+
...testID !== void 0 ? { testID } : {},
|
|
925
|
+
role: "list",
|
|
926
|
+
accessibilityRole: "list",
|
|
927
|
+
className: cn("flex-row items-center", className),
|
|
928
|
+
style: { flexDirection: "row", alignItems: "center", flexShrink: 1, minWidth: 0 },
|
|
929
|
+
children: out
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}, "BreadcrumbList");
|
|
933
|
+
var BreadcrumbItem = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
934
|
+
useBreadcrumbContext("Breadcrumb.Item");
|
|
935
|
+
return /* @__PURE__ */ jsx(
|
|
936
|
+
View,
|
|
937
|
+
{
|
|
938
|
+
...testID !== void 0 ? { testID } : {},
|
|
939
|
+
role: "listitem",
|
|
940
|
+
accessibilityRole: "text",
|
|
941
|
+
className: cn("flex-row items-center", className),
|
|
942
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
943
|
+
children
|
|
944
|
+
}
|
|
945
|
+
);
|
|
946
|
+
}, "BreadcrumbItem");
|
|
947
|
+
tagComponent(BreadcrumbItem, "item");
|
|
948
|
+
var BreadcrumbLink = /* @__PURE__ */ __name(({ href, onPress, asChild, children, className, testID }) => {
|
|
949
|
+
const colors = useThemeColors();
|
|
950
|
+
if (asChild) {
|
|
951
|
+
return /* @__PURE__ */ jsx(
|
|
952
|
+
Slot,
|
|
953
|
+
{
|
|
954
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
955
|
+
...className !== void 0 ? { className } : {},
|
|
956
|
+
children
|
|
957
|
+
}
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
if (Platform.OS === "web" && href) {
|
|
961
|
+
const handleClick = onPress ? (event) => {
|
|
962
|
+
event.preventDefault();
|
|
963
|
+
onPress?.();
|
|
964
|
+
} : void 0;
|
|
965
|
+
return /* @__PURE__ */ jsx(
|
|
966
|
+
"a",
|
|
967
|
+
{
|
|
968
|
+
href,
|
|
969
|
+
onClick: handleClick,
|
|
970
|
+
...testID !== void 0 ? { "data-testid": testID } : {},
|
|
971
|
+
...className !== void 0 ? { className } : {},
|
|
972
|
+
style: {
|
|
973
|
+
color: colors.semantic.interactive.primary,
|
|
974
|
+
textDecoration: "none",
|
|
975
|
+
fontFamily: colors.fontFamily.body,
|
|
976
|
+
fontSize: px(colors.fontSize.sm)
|
|
977
|
+
},
|
|
978
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx(
|
|
979
|
+
Text,
|
|
980
|
+
{
|
|
981
|
+
style: {
|
|
982
|
+
color: colors.semantic.interactive.primary,
|
|
983
|
+
fontFamily: colors.fontFamily.body,
|
|
984
|
+
fontSize: px(colors.fontSize.sm)
|
|
985
|
+
},
|
|
986
|
+
children
|
|
987
|
+
}
|
|
988
|
+
) : children
|
|
989
|
+
}
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress, accessibilityRole: "link", role: "link", ...testID !== void 0 ? { testID } : {}, children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx(
|
|
993
|
+
Text,
|
|
994
|
+
{
|
|
995
|
+
style: {
|
|
996
|
+
color: colors.semantic.interactive.primary,
|
|
997
|
+
fontFamily: colors.fontFamily.body,
|
|
998
|
+
fontSize: px(colors.fontSize.sm)
|
|
999
|
+
},
|
|
1000
|
+
children
|
|
1001
|
+
}
|
|
1002
|
+
) : children });
|
|
1003
|
+
}, "BreadcrumbLink");
|
|
1004
|
+
var BreadcrumbPage = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
1005
|
+
const ctx = useBreadcrumbContext("Breadcrumb.Page");
|
|
1006
|
+
const colors = useThemeColors();
|
|
1007
|
+
return /* @__PURE__ */ jsxs(
|
|
1008
|
+
View,
|
|
1009
|
+
{
|
|
1010
|
+
...testID !== void 0 ? { testID } : {},
|
|
1011
|
+
accessibilityRole: "text",
|
|
1012
|
+
"aria-current": "page",
|
|
1013
|
+
className: cn("flex-row items-center", className),
|
|
1014
|
+
style: { flexDirection: "row", alignItems: "center" },
|
|
1015
|
+
children: [
|
|
1016
|
+
/* @__PURE__ */ jsxs(
|
|
1017
|
+
Text,
|
|
1018
|
+
{
|
|
1019
|
+
style: {
|
|
1020
|
+
position: "absolute",
|
|
1021
|
+
width: 1,
|
|
1022
|
+
height: 1,
|
|
1023
|
+
overflow: "hidden",
|
|
1024
|
+
opacity: 0
|
|
1025
|
+
},
|
|
1026
|
+
children: [
|
|
1027
|
+
ctx.currentPageLabel,
|
|
1028
|
+
":",
|
|
1029
|
+
" "
|
|
1030
|
+
]
|
|
1031
|
+
}
|
|
1032
|
+
),
|
|
1033
|
+
typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx(
|
|
1034
|
+
Text,
|
|
1035
|
+
{
|
|
1036
|
+
numberOfLines: 1,
|
|
1037
|
+
style: {
|
|
1038
|
+
color: colors.semantic.text.default,
|
|
1039
|
+
fontFamily: colors.fontFamily.body,
|
|
1040
|
+
fontSize: px(colors.fontSize.sm),
|
|
1041
|
+
fontWeight: colors.fontWeight.semibold
|
|
1042
|
+
},
|
|
1043
|
+
children
|
|
1044
|
+
}
|
|
1045
|
+
) : children
|
|
1046
|
+
]
|
|
1047
|
+
}
|
|
1048
|
+
);
|
|
1049
|
+
}, "BreadcrumbPage");
|
|
1050
|
+
var BreadcrumbSeparator = /* @__PURE__ */ __name(({ children, className, testID }) => {
|
|
1051
|
+
const ctx = useBreadcrumbContext("Breadcrumb.Separator");
|
|
1052
|
+
const node = children ?? renderSeparator(ctx.separator, { fromIndex: 0, visibleCount: 0, dir: ctx.dir });
|
|
1053
|
+
return /* @__PURE__ */ jsx(
|
|
1054
|
+
View,
|
|
1055
|
+
{
|
|
1056
|
+
...testID !== void 0 ? { testID } : {},
|
|
1057
|
+
"aria-hidden": true,
|
|
1058
|
+
accessibilityElementsHidden: true,
|
|
1059
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1060
|
+
role: "presentation",
|
|
1061
|
+
className: cn("flex-row items-center", className),
|
|
1062
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 2 },
|
|
1063
|
+
children: node
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
}, "BreadcrumbSeparator");
|
|
1067
|
+
tagComponent(BreadcrumbSeparator, "separator");
|
|
1068
|
+
var BreadcrumbEllipsis = /* @__PURE__ */ __name(({ ellipsisLabel, className, testID }) => {
|
|
1069
|
+
useBreadcrumbContext("Breadcrumb.Ellipsis");
|
|
1070
|
+
const { t } = useTranslation();
|
|
1071
|
+
const colors = useThemeColors();
|
|
1072
|
+
const label = ellipsisLabel ?? t("breadcrumb.ellipsisLabel", { defaultValue: "More" });
|
|
1073
|
+
return /* @__PURE__ */ jsx(
|
|
1074
|
+
View,
|
|
1075
|
+
{
|
|
1076
|
+
...testID !== void 0 ? { testID } : {},
|
|
1077
|
+
accessibilityLabel: label,
|
|
1078
|
+
"aria-label": label,
|
|
1079
|
+
className: cn("flex-row items-center", className),
|
|
1080
|
+
style: { flexDirection: "row", alignItems: "center", paddingHorizontal: 4 },
|
|
1081
|
+
children: /* @__PURE__ */ jsx(
|
|
1082
|
+
Text,
|
|
1083
|
+
{
|
|
1084
|
+
style: {
|
|
1085
|
+
fontFamily: colors.fontFamily.body,
|
|
1086
|
+
fontSize: px(colors.fontSize.sm),
|
|
1087
|
+
color: colors.semantic.text.muted
|
|
1088
|
+
},
|
|
1089
|
+
children: "\u2026"
|
|
1090
|
+
}
|
|
1091
|
+
)
|
|
1092
|
+
}
|
|
1093
|
+
);
|
|
1094
|
+
}, "BreadcrumbEllipsis");
|
|
1095
|
+
var Breadcrumb = Object.assign(BreadcrumbRoot, {
|
|
1096
|
+
List: BreadcrumbList,
|
|
1097
|
+
Item: BreadcrumbItem,
|
|
1098
|
+
Link: BreadcrumbLink,
|
|
1099
|
+
Page: BreadcrumbPage,
|
|
1100
|
+
Separator: BreadcrumbSeparator,
|
|
1101
|
+
Ellipsis: BreadcrumbEllipsis
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
export { Breadcrumb, getBreadcrumbJsonLd };
|
|
1105
|
+
//# sourceMappingURL=chunk-LVWNMQGR.js.map
|
|
1106
|
+
//# sourceMappingURL=chunk-LVWNMQGR.js.map
|