@aussieljk/forkbook 0.0.1-4 → 0.0.1-6
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/LICENSE +22 -0
- package/README.md +35 -53
- package/dist/_browser-chunks/{Color-KRDPNBZS.js → Color-2BMQTRYG.js} +3 -3
- package/dist/_browser-chunks/WithTooltip-GJACFWKM.js +196 -0
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/chunk-6EJEEII7.js +1149 -0
- package/dist/_browser-chunks/{chunk-LXQPPHMD.js → chunk-6IKB2UHQ.js} +27 -27
- package/dist/_browser-chunks/chunk-DPRGR3QP.js +5995 -0
- package/dist/_browser-chunks/{chunk-K6GRZSXS.js → chunk-EQKMUQF3.js} +4 -3
- package/dist/_browser-chunks/{chunk-GU3X2J4S.js → chunk-FRAOQJDI.js} +3 -1
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-H4ZHAXN3.js} +1 -1
- package/dist/_browser-chunks/{chunk-ZLWA5RIE.js → chunk-I4ATZPNZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-6SHRDXGF.js → chunk-IJYLSHY7.js} +173 -87
- package/dist/_browser-chunks/{chunk-SZCSXISG.js → chunk-NA4ITZTK.js} +7 -5
- package/dist/_browser-chunks/chunk-NGMQJMCY.js +53 -0
- package/dist/_browser-chunks/{chunk-K2B36HKM.js → chunk-O24AZJZ7.js} +1 -1
- package/dist/_browser-chunks/{chunk-BZGX2THJ.js → chunk-QAHDGPZ7.js} +3 -3
- package/dist/_browser-chunks/{chunk-NMRSYACM.js → chunk-SFMQDIN2.js} +4 -3
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-X7D777E6.js} +547 -1622
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-YYWKZ7O3.js} +3 -1
- package/dist/_node-chunks/{attached-runtime-CYMSKF3A.js → attached-runtime-EBWIOQZN.js} +29 -29
- package/dist/_node-chunks/{builder-manager-RMLSIO45.js → builder-manager-ETBLZ2RH.js} +288 -349
- package/dist/_node-chunks/{chunk-IR34HUSL.js → chunk-252Y5WHZ.js} +7 -7
- package/dist/_node-chunks/{chunk-VPOJCHKM.js → chunk-25PXULSJ.js} +14 -14
- package/dist/_node-chunks/chunk-2DBJWMYE.js +495 -0
- package/dist/_node-chunks/{chunk-KXDJ77EW.js → chunk-3UWWRDA5.js} +7 -7
- package/dist/_node-chunks/{chunk-DVLFCSDG.js → chunk-4KCQYJT6.js} +7 -7
- package/dist/_node-chunks/{chunk-X3E55W5S.js → chunk-4MJIPOJ5.js} +6 -6
- package/dist/_node-chunks/{chunk-5TPSYG4L.js → chunk-4WLIN3VZ.js} +8 -8
- package/dist/_node-chunks/{chunk-WBTLBIED.js → chunk-4XNPO23I.js} +6 -6
- package/dist/_node-chunks/{chunk-NHIRHARE.js → chunk-5T635FTI.js} +10 -10
- package/dist/_node-chunks/{chunk-YU2WFBFL.js → chunk-5Z6MT4RI.js} +8 -8
- package/dist/_node-chunks/{chunk-2QWFS23O.js → chunk-644CUCK5.js} +7 -7
- package/dist/_node-chunks/{chunk-7XCJ7RAJ.js → chunk-7E27CGRU.js} +7 -7
- package/dist/_node-chunks/{chunk-WS367FSJ.js → chunk-A35J7YYA.js} +6 -6
- package/dist/_node-chunks/{chunk-ILFIERUB.js → chunk-ALHPFKVB.js} +8 -8
- package/dist/_node-chunks/{chunk-SQMCVWOR.js → chunk-ANDQVXYX.js} +8 -8
- package/dist/_node-chunks/{chunk-HUFAUSEX.js → chunk-AS4SFRCZ.js} +6 -6
- package/dist/_node-chunks/{chunk-XBXGLD3K.js → chunk-BLUMKQQB.js} +6 -6
- package/dist/_node-chunks/{chunk-QU5ANYM7.js → chunk-C5JG7EKF.js} +6 -6
- package/dist/_node-chunks/{chunk-P6QAFJ5M.js → chunk-CBUQY454.js} +7 -15
- package/dist/_node-chunks/{chunk-4LPAWP5S.js → chunk-CF7KLGUW.js} +22 -20
- package/dist/_node-chunks/{chunk-MOITZTEA.js → chunk-CGVPHZVD.js} +8 -8
- package/dist/_node-chunks/{chunk-2NWHHNNI.js → chunk-DABFUVLR.js} +6 -6
- package/dist/_node-chunks/{chunk-XH6TDVML.js → chunk-DCNZ6SFN.js} +6 -6
- package/dist/_node-chunks/{chunk-F2N6BJRH.js → chunk-DDGW2EBW.js} +29843 -51588
- package/dist/_node-chunks/{chunk-OS5LQEC6.js → chunk-DRLBJM6X.js} +7 -7
- package/dist/_node-chunks/{chunk-GEMKJCEE.js → chunk-E3O7VAPG.js} +10 -10
- package/dist/_node-chunks/{chunk-4GD7MMLJ.js → chunk-FIFCNBTL.js} +7 -7
- package/dist/_node-chunks/{chunk-UMZSNFWM.js → chunk-FQWTUSYB.js} +6 -6
- package/dist/_node-chunks/{chunk-JEEXR245.js → chunk-G6YNW4FK.js} +7 -7
- package/dist/_node-chunks/{chunk-HP5UY6OY.js → chunk-GDFQQO5U.js} +6 -6
- package/dist/_node-chunks/{chunk-653BSJIX.js → chunk-GGTXOH3W.js} +6 -6
- package/dist/_node-chunks/{chunk-PDCSUZ4L.js → chunk-GIOREKIG.js} +7 -7
- package/dist/_node-chunks/{chunk-V2JDVM46.js → chunk-GOFK4EKU.js} +6 -6
- package/dist/_node-chunks/{chunk-INEYTOWF.js → chunk-GQ3HJNIH.js} +10 -13
- package/dist/_node-chunks/{chunk-2APY2YSW.js → chunk-GRTI5653.js} +7 -7
- package/dist/_node-chunks/{chunk-KN2S7JF2.js → chunk-HKL3VOYX.js} +6 -6
- package/dist/_node-chunks/{chunk-A2UMIN5B.js → chunk-HUPRQZ3I.js} +7 -7
- package/dist/_node-chunks/{chunk-7JA2DMCJ.js → chunk-HWRHYM7Z.js} +6 -6
- package/dist/_node-chunks/{chunk-SBQT3LMM.js → chunk-I7HRDCNY.js} +10 -10
- package/dist/_node-chunks/{chunk-2IJCISIB.js → chunk-IFPMZ247.js} +6 -6
- package/dist/_node-chunks/{chunk-DIUBMAMV.js → chunk-J6M5CRYZ.js} +8 -8
- package/dist/_node-chunks/{chunk-IBO346NQ.js → chunk-JPXJI6QR.js} +60 -134
- package/dist/_node-chunks/{chunk-STRSG3GT.js → chunk-JS2J2SKX.js} +6 -6
- package/dist/_node-chunks/{chunk-FNGLVURC.js → chunk-JZWF3XLN.js} +6 -6
- package/dist/_node-chunks/{chunk-KINEBDMM.js → chunk-KF3FT3NI.js} +9 -9
- package/dist/_node-chunks/chunk-KWPWQA7G.js +2609 -0
- package/dist/_node-chunks/{chunk-OIIORQX5.js → chunk-L4JGWK4K.js} +6 -6
- package/dist/_node-chunks/{chunk-MRZD5SBV.js → chunk-LFIFBDMS.js} +6 -6
- package/dist/_node-chunks/{chunk-UAALLQAQ.js → chunk-LWKLJYYQ.js} +6 -6
- package/dist/_node-chunks/{chunk-AFKKN27O.js → chunk-LXVSVTQ3.js} +6 -6
- package/dist/_node-chunks/chunk-MDW3GSU3.js +69 -0
- package/dist/_node-chunks/{chunk-UXW4I2CN.js → chunk-MFN2XBPL.js} +7 -7
- package/dist/_node-chunks/{chunk-ESZVID7Q.js → chunk-MQFB44YS.js} +7 -7
- package/dist/_node-chunks/{chunk-3XDIBUGD.js → chunk-MZ2GSR3G.js} +23 -51
- package/dist/_node-chunks/{chunk-POXTROIX.js → chunk-N7HEOGTM.js} +9 -6
- package/dist/_node-chunks/{chunk-UIFLXDUL.js → chunk-NUAQC3XP.js} +16 -13
- package/dist/_node-chunks/{chunk-BOUA7OB7.js → chunk-NX6CSWF3.js} +8 -8
- package/dist/_node-chunks/{chunk-B3LK7C7B.js → chunk-NZ7EQWYA.js} +9 -9
- package/dist/_node-chunks/{chunk-U5QMVW3H.js → chunk-OLGIDCVD.js} +650 -9
- package/dist/_node-chunks/{chunk-NAYTBC72.js → chunk-P65JVLO3.js} +8 -8
- package/dist/_node-chunks/{chunk-M2UZP5GC.js → chunk-PAN35AYX.js} +7 -7
- package/dist/_node-chunks/{chunk-GZBUCUF7.js → chunk-PLWLCVP2.js} +6 -6
- package/dist/_node-chunks/{chunk-A4YELYR3.js → chunk-Q4BEWGMK.js} +6 -6
- package/dist/_node-chunks/{chunk-YYIZ2PC4.js → chunk-QNUXGVZZ.js} +6 -6
- package/dist/_node-chunks/{chunk-WHZWLJGO.js → chunk-R5DWO2S2.js} +31 -30
- package/dist/_node-chunks/{chunk-RMLENEZC.js → chunk-SLZV7PTQ.js} +8 -8
- package/dist/_node-chunks/{chunk-B5VFV3ZW.js → chunk-TIRP5JQM.js} +11 -10
- package/dist/_node-chunks/{chunk-TLVEPWBN.js → chunk-TMXWDY2O.js} +6 -6
- package/dist/_node-chunks/{chunk-LGUMVMBA.js → chunk-TN3ULFFZ.js} +6 -6
- package/dist/_node-chunks/{chunk-5ZLOPVTG.js → chunk-TPSJW4CQ.js} +6 -6
- package/dist/_node-chunks/{chunk-RNF3Z4ZJ.js → chunk-TYBPAV3X.js} +6 -6
- package/dist/_node-chunks/chunk-UUE3PSJB.js +11 -0
- package/dist/_node-chunks/chunk-VKNRNBTB.js +18 -0
- package/dist/_node-chunks/{chunk-6Y6RBJD7.js → chunk-VPU4E7DI.js} +25 -8
- package/dist/_node-chunks/{chunk-FJDJE7XC.js → chunk-WIQ6Y3NX.js} +6 -6
- package/dist/_node-chunks/{chunk-DD2S4BFV.js → chunk-WRG3CFGS.js} +6 -6
- package/dist/_node-chunks/{chunk-FAZ3MUOI.js → chunk-X3RTVNRN.js} +7 -7
- package/dist/_node-chunks/chunk-XOGU5PWI.js +347 -0
- package/dist/_node-chunks/{chunk-AU3SF2WM.js → chunk-XWGMQW2H.js} +6 -6
- package/dist/_node-chunks/chunk-YCXTTQ7K.js +620 -0
- package/dist/_node-chunks/{chunk-KZBZYQTZ.js → chunk-YHH57LHY.js} +9 -9
- package/dist/_node-chunks/{chunk-J3M3X7GO.js → chunk-YMZ2SGFK.js} +6 -6
- package/dist/_node-chunks/{chunk-AY6B2C46.js → chunk-YNENOZRY.js} +7 -7
- package/dist/_node-chunks/{chunk-CGWACHNW.js → chunk-YPGVYNJB.js} +6 -6
- package/dist/_node-chunks/{chunk-OQ4NCWE4.js → chunk-YQDBSAXW.js} +7 -7
- package/dist/_node-chunks/{chunk-YGXJOSRU.js → chunk-Z4NZLBOX.js} +7 -7
- package/dist/_node-chunks/{chunk-74IEHSIR.js → chunk-ZC3ZZKMS.js} +8 -8
- package/dist/_node-chunks/{chunk-QDLR4JF5.js → chunk-ZCITDAV4.js} +34 -949
- package/dist/_node-chunks/chunk-ZNSGFYAT.js +25 -0
- package/dist/_node-chunks/{chunk-XD5SYXAU.js → chunk-ZSH6BUCW.js} +25 -25
- package/dist/_node-chunks/{chunk-X2KWNNFB.js → chunk-ZTFNOXZF.js} +6 -6
- package/dist/_node-chunks/dist-GGTGKXZA.js +27 -0
- package/dist/_node-chunks/dist-NS676VJR.js +16 -0
- package/dist/_node-chunks/{local-runtime-KTI3DH6X.js → local-runtime-BUTEKJYV.js} +20 -20
- package/dist/_node-chunks/{mdx-plugin-2E3SW5TL.js → mdx-plugin-7WXQIHPV.js} +2263 -130
- package/dist/_node-chunks/{monorepo-MWAMFHKY.js → monorepo-NCD3X2BR.js} +11 -11
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-MGORG6W7.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-SD3B272K.js} +11 -11
- package/dist/_node-chunks/optimized-tests-ITVOHEOA.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-QTQOY7E7.js → pattern-copy-play-3QJANDJD.js} +9 -9
- package/dist/_node-chunks/postinstallAddon-LEUHOKX6.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-T7DZNKMB.js → rehype-external-links-4LR5BDR2.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-CSHI5WYI.js → rehype-slug-PWFRGOEV.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-RAZD36YR.js → relaxed-limits-VNNWUW7X.js} +11 -11
- package/dist/_node-chunks/{run-S6XSLPEB.js → run-RUAAWEQT.js} +13 -13
- package/dist/_node-chunks/{run-KJ3Z2TTY.js → run-YK6ARCWS.js} +17 -17
- package/dist/_node-chunks/session-id-JJYVZAKO.js +23 -0
- package/dist/_node-chunks/{setup-35J66GFB.js → setup-4QKCICV6.js} +8 -8
- package/dist/_node-chunks/{vitest.config.4.template-Z7OCRDKD.js → vitest.config.4.template-WVFLIXN7.js} +7 -7
- package/dist/actions/decorator.js +2 -1
- package/dist/actions/index.js +2 -1
- package/dist/addon-a11y/index.js +2 -1
- package/dist/addon-a11y/manager.js +24 -17
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.js +2 -1
- package/dist/addon-docs/blocks.js +46 -25
- package/dist/addon-docs/manager.js +2 -2
- package/dist/addon-docs/preset.js +10 -10
- package/dist/addon-links/index.js +3 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +3 -2
- package/dist/addon-links/react/index.js +2 -1
- package/dist/addon-mcp/preset.js +8 -8
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +17 -45
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-themes/manager.js +1 -1
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +8 -8
- package/dist/addon-vitest/node/coverage-reporter.js +8 -8
- package/dist/addon-vitest/node/vitest.js +16 -16
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +15 -16
- package/dist/addon-vitest/vitest-plugin/global-setup.js +7 -7
- package/dist/addon-vitest/vitest-plugin/index.js +17 -17
- package/dist/babel/index.d.ts +91 -842
- package/dist/babel/index.js +13 -19
- package/dist/bin/core.js +61 -60
- package/dist/bin/dispatcher.js +10 -10
- package/dist/bin/loader.js +16 -15
- package/dist/builder-vite/index.js +15 -15
- package/dist/builder-vite/preset.js +13 -13
- package/dist/{chunk-DF6btpT3.d.ts → chunk-BGhyFTJO.d.ts} +2 -2
- package/dist/chunk-CV4-Z2pn.d.ts +30 -0
- package/dist/{chunk-DvufcbCc.d.ts → chunk-CVY28Ngy.d.ts} +1 -1
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-CYuvV2sR.d.ts} +11 -13
- package/dist/{chunk-BYnH2sbb.d.ts → chunk-ClI-HEh5.d.ts} +1 -1
- package/dist/{chunk-DIz17UEJ.d.ts → chunk-CzmZhVrn.d.ts} +35 -1
- package/dist/{chunk-B2xylxt5.d.ts → chunk-DROZ9oel.d.ts} +7 -271
- package/dist/cli/index.d.ts +13 -866
- package/dist/cli/index.js +42 -4952
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +1 -1
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.js +3 -1
- package/dist/common/index.d.ts +5 -4
- package/dist/common/index.js +35 -37
- package/dist/components/index.d.ts +14 -231
- package/dist/components/index.js +2518 -8365
- package/dist/core-events/index.d.ts +4 -3
- package/dist/core-events/index.js +3 -1
- package/dist/core-server/index.d.ts +2 -2
- package/dist/core-server/index.js +450 -147
- package/dist/core-server/presets/common-manager.js +96 -894
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +39 -40
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/index.d.ts +2 -2
- package/dist/csf/index.js +27 -93
- package/dist/csf-tools/index.d.ts +2 -12
- package/dist/csf-tools/index.js +14 -14
- package/dist/instrumenter/index.js +3 -1
- package/dist/manager/_manager-chunks/{globals-runtime-dKGpUUSb.js → globals-runtime-B-IeQLQu.js} +285 -61
- package/dist/manager/_manager-chunks/{globals-runtime-DuLFjsF4.js → globals-runtime-B5-0Ccbv.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-8HkdnU2F.js → globals-runtime-B71TiXST.js} +93 -2146
- package/dist/manager/_manager-chunks/globals-runtime-BMCaBukU.js +413 -0
- package/dist/manager/_manager-chunks/globals-runtime-BUP5e_t9.js +1396 -0
- package/dist/manager/_manager-chunks/globals-runtime-C7mqoHpE.js +2093 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-CYNosEiD.js} +1 -2
- package/dist/manager/_manager-chunks/globals-runtime-C_evJrEn.js +1960 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-CdgVeAbk.js} +408 -377
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-Cqn8KdSZ.js} +4 -4
- package/dist/manager/_manager-chunks/{globals-runtime-ZHrQFa3-.js → globals-runtime-CrIF09P8.js} +1246 -539
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-Ct1kY4wb.js} +638 -1731
- package/dist/manager/_manager-chunks/globals-runtime-CvyFEPIY.js +5282 -0
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DMBjo1QS.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-C9P2ZbMM.js → globals-runtime-DUK6bGcb.js} +52 -25
- package/dist/manager/_manager-chunks/globals-runtime-DedfO-DP.js +3414 -0
- package/dist/manager/_manager-chunks/{globals-runtime-q5R9dawi.js → globals-runtime-DqhIYwLp.js} +165 -152
- package/dist/manager/_manager-chunks/globals-runtime-XSxCU7PR.js +41 -0
- package/dist/manager/_manager-chunks/runtime-BR5z0WoJ.js +456 -0
- package/dist/manager/_manager-chunks/{runtime-DdCaBowH.js → runtime-BgYvp1WN.js} +15 -7
- package/dist/manager/_manager-chunks/{runtime-BGvLm94o.js → runtime-CHI-LHF1.js} +3 -3
- package/dist/manager/_manager-chunks/{runtime-BdLdsHca.js → runtime-CUymj6EY.js} +280 -288
- package/dist/manager/_manager-chunks/runtime-CaU1DSEZ.js +528 -0
- package/dist/manager/_manager-chunks/{runtime-DMig8mT7.js → runtime-CqItbdKW.js} +3 -2
- package/dist/manager/_manager-chunks/{runtime-B9QzcYO3.js → runtime-D4ZOOIV0.js} +5 -531
- package/dist/manager/_manager-chunks/{runtime-50_aob4S.js → runtime-DER98nV0.js} +3 -19
- package/dist/manager/_manager-chunks/{runtime-CE2sHVqs.js → runtime-DrTLBe7a.js} +39 -40
- package/dist/manager/_manager-chunks/runtime-MAf7Wpk5.js +692 -0
- package/dist/manager/_manager-chunks/{runtime-CKP1i0--.js → runtime-cVFIMcca.js} +1 -1
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +1 -1
- package/dist/manager/globals.js +1 -1
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +22 -28
- package/dist/manager-errors.d.ts +1 -1
- package/dist/mcp/index.js +8 -8
- package/dist/mocking-utils/index.js +16 -11
- package/dist/nextjs-vite/index.js +3 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/preset.js +11 -11
- package/dist/nextjs-vite/vite-plugin/index.js +7 -7
- package/dist/nextjs-vite-plugin/index.d.ts +1 -2
- package/dist/nextjs-vite-plugin/index.js +12 -27
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/node-logger/index.d.ts +65 -72
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +11 -13
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/preview/_chunks/{runtime-DVM_AHbR.js → runtime-6P-h06Te.js} +51 -50
- package/dist/preview/_chunks/{runtime-BoxmlDdB.js → runtime-B9KKIDGa.js} +202 -81
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-BPwAnlRx.js} +482 -334
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-BUnOhg9h.js} +2 -2
- package/dist/preview/_chunks/runtime-Bcv1hJky.js +6305 -0
- package/dist/preview/_chunks/{runtime-CqHxptiK.js → runtime-C1jgT6tJ.js} +93 -2145
- package/dist/preview/_chunks/{runtime-D7B4bVe_.js → runtime-C8QFpkFV.js} +6 -6
- package/dist/preview/_chunks/{runtime-CijtAN7R.js → runtime-DdqR8Fd0.js} +15 -6
- package/dist/preview/_chunks/{runtime-B3y8ocOg.js → runtime-DvBfMhis.js} +2 -2
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-WapFVPAh.js} +29 -29
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +2 -1
- package/dist/preview-errors.d.ts +1 -1
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.js +6 -4
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.js +3 -2
- package/dist/react-native/bin/get-stories.js +8 -8
- package/dist/react-native/index.js +25 -211
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/withStorybook.js +11 -10
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.js +7 -7
- package/dist/router/index.js +3 -1
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +1 -1
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/telemetry/index.js +43 -45
- package/dist/test/index.js +808 -573
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.js +22 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +17 -45
- package/dist/_browser-chunks/WithTooltip-523JD6VH.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-UDQ3XQFC.js +0 -108
- package/dist/_node-chunks/chunk-7XCEKQGV.js +0 -18
- package/dist/_node-chunks/chunk-EGS2SAD2.js +0 -5414
- package/dist/_node-chunks/chunk-GKTCJPLL.js +0 -36
- package/dist/_node-chunks/chunk-HENM5ZK3.js +0 -1877
- package/dist/_node-chunks/chunk-HQM4ISVU.js +0 -11
- package/dist/_node-chunks/chunk-K3I3G4VL.js +0 -4731
- package/dist/_node-chunks/chunk-MZMPFII2.js +0 -29
- package/dist/_node-chunks/chunk-NYAWUR6L.js +0 -3823
- package/dist/_node-chunks/chunk-NYRUWAL3.js +0 -23
- package/dist/_node-chunks/chunk-SSZ5REKS.js +0 -3008
- package/dist/_node-chunks/chunk-WEW23EEE.js +0 -662
- package/dist/_node-chunks/chunk-XWQEWRFD.js +0 -51
- package/dist/_node-chunks/dist-CNA633FI.js +0 -16
- package/dist/_node-chunks/globby-HRQV5N3V.js +0 -2884
- package/dist/_node-chunks/jiti-WE7NHS2Y.js +0 -3848
- package/dist/_node-chunks/lib-7MVA6CTW.js +0 -366
- package/dist/_node-chunks/optimized-tests-IAX6YURR.js +0 -22
- package/dist/_node-chunks/postinstallAddon-ROH2TBJX.js +0 -20
- package/dist/_node-chunks/session-id-GM226DGP.js +0 -23
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/runtime-89Cb0A8U.js +0 -998
- package/dist/manager/_manager-chunks/runtime-wL4UO7YO.js +0 -452
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
|
@@ -0,0 +1,1149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARROW_DOWN,
|
|
3
|
+
ARROW_LEFT,
|
|
4
|
+
ARROW_RIGHT,
|
|
5
|
+
ARROW_UP,
|
|
6
|
+
COMPOSITE_KEYS,
|
|
7
|
+
CompositeRootContext,
|
|
8
|
+
EMPTY_ARRAY,
|
|
9
|
+
EMPTY_OBJECT,
|
|
10
|
+
END,
|
|
11
|
+
HOME,
|
|
12
|
+
MODIFIER_KEYS,
|
|
13
|
+
TransitionStatusDataAttributes_exports,
|
|
14
|
+
activeElement,
|
|
15
|
+
contains,
|
|
16
|
+
createChangeEventDetails,
|
|
17
|
+
error,
|
|
18
|
+
findNonDisabledListIndex,
|
|
19
|
+
formatErrorMessage_default,
|
|
20
|
+
getCssDimensions,
|
|
21
|
+
getMaxListIndex,
|
|
22
|
+
getMinListIndex,
|
|
23
|
+
getParentNode,
|
|
24
|
+
getTarget,
|
|
25
|
+
getWindow,
|
|
26
|
+
inertValue,
|
|
27
|
+
isHTMLElement,
|
|
28
|
+
isIndexOutOfListBounds,
|
|
29
|
+
isLastTraversableNode,
|
|
30
|
+
isListIndexDisabled,
|
|
31
|
+
isNativeInput,
|
|
32
|
+
isReactVersionAtLeast,
|
|
33
|
+
ownerDocument,
|
|
34
|
+
reason_parts_exports,
|
|
35
|
+
scrollIntoViewIfNeeded,
|
|
36
|
+
transitionStatusMapping,
|
|
37
|
+
useBaseUiId,
|
|
38
|
+
useButton,
|
|
39
|
+
useCompositeRootContext,
|
|
40
|
+
useDirection,
|
|
41
|
+
useForcedRerendering,
|
|
42
|
+
useIsoLayoutEffect,
|
|
43
|
+
useMergedRefs,
|
|
44
|
+
useOpenChangeComplete,
|
|
45
|
+
useRefWithInit,
|
|
46
|
+
useRenderElement,
|
|
47
|
+
useStableCallback,
|
|
48
|
+
useTransitionStatus
|
|
49
|
+
} from "./chunk-X7D777E6.js";
|
|
50
|
+
import {
|
|
51
|
+
__export
|
|
52
|
+
} from "./chunk-IMSF75WX.js";
|
|
53
|
+
|
|
54
|
+
// ../../node_modules/@base-ui/react/tabs/index.parts.mjs
|
|
55
|
+
var index_parts_exports = {};
|
|
56
|
+
__export(index_parts_exports, {
|
|
57
|
+
Indicator: () => TabsIndicator,
|
|
58
|
+
List: () => TabsList,
|
|
59
|
+
Panel: () => TabsPanel,
|
|
60
|
+
Root: () => TabsRoot,
|
|
61
|
+
Tab: () => TabsTab
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ../../node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
|
|
65
|
+
import * as React5 from "react";
|
|
66
|
+
|
|
67
|
+
// ../../node_modules/@base-ui/utils/useControlled.mjs
|
|
68
|
+
import * as React from "react";
|
|
69
|
+
function useControlled({
|
|
70
|
+
controlled,
|
|
71
|
+
default: defaultProp,
|
|
72
|
+
name,
|
|
73
|
+
state = "value"
|
|
74
|
+
}) {
|
|
75
|
+
let {
|
|
76
|
+
current: isControlled
|
|
77
|
+
} = React.useRef(controlled !== void 0), [valueState, setValue] = React.useState(() => defaultProp), value = isControlled && controlled !== void 0 ? controlled : valueState;
|
|
78
|
+
if (process.env.NODE_ENV !== "production") {
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
isControlled !== (controlled !== void 0) && error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
81
|
+
`));
|
|
82
|
+
}, [state, name, controlled]);
|
|
83
|
+
let {
|
|
84
|
+
current: defaultValue
|
|
85
|
+
} = React.useRef(defaultProp);
|
|
86
|
+
React.useEffect(() => {
|
|
87
|
+
!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp) && error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join(`
|
|
88
|
+
`));
|
|
89
|
+
}, [defaultProp]);
|
|
90
|
+
}
|
|
91
|
+
let setValueIfUncontrolled = React.useCallback((newValue) => {
|
|
92
|
+
isControlled || setValue(newValue);
|
|
93
|
+
}, []);
|
|
94
|
+
return [value, setValueIfUncontrolled];
|
|
95
|
+
}
|
|
96
|
+
function serializeToDevModeString(input) {
|
|
97
|
+
let nextId = 0, seen = /* @__PURE__ */ new WeakMap();
|
|
98
|
+
try {
|
|
99
|
+
return JSON.stringify(input, function(key, value) {
|
|
100
|
+
if (!(key === "_owner" && this != null && typeof this == "object" && "$$typeof" in this)) {
|
|
101
|
+
if (typeof value == "bigint")
|
|
102
|
+
return `__bigint__:${value}`;
|
|
103
|
+
if (value !== null && typeof value == "object") {
|
|
104
|
+
let id = seen.get(value);
|
|
105
|
+
if (id !== void 0)
|
|
106
|
+
return `__object__:${id}`;
|
|
107
|
+
seen.set(value, nextId), nextId += 1;
|
|
108
|
+
}
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
}) ?? `__top__:${typeof input}`;
|
|
112
|
+
} catch {
|
|
113
|
+
return "__unserializable__";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ../../node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
|
|
118
|
+
import * as React3 from "react";
|
|
119
|
+
|
|
120
|
+
// ../../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
|
|
121
|
+
import * as React2 from "react";
|
|
122
|
+
var CompositeListContext = React2.createContext({
|
|
123
|
+
register: () => {
|
|
124
|
+
},
|
|
125
|
+
unregister: () => {
|
|
126
|
+
},
|
|
127
|
+
subscribeMapChange: () => () => {
|
|
128
|
+
},
|
|
129
|
+
nextIndexRef: {
|
|
130
|
+
current: 0
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
process.env.NODE_ENV !== "production" && (CompositeListContext.displayName = "CompositeListContext");
|
|
134
|
+
function useCompositeListContext() {
|
|
135
|
+
return React2.useContext(CompositeListContext);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// ../../node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
|
|
139
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
140
|
+
function CompositeList(props) {
|
|
141
|
+
let {
|
|
142
|
+
children,
|
|
143
|
+
elementsRef,
|
|
144
|
+
labelsRef,
|
|
145
|
+
onMapChange: onMapChangeProp
|
|
146
|
+
} = props, onMapChange = useStableCallback(onMapChangeProp), [, setMapTick] = React3.useState(0), listeners = useRefWithInit(createListeners).current, map = useRefWithInit(createMap).current, nextIndexRef = React3.useRef(0), isDirtyRef = React3.useRef(!0), itemsRef = React3.useRef(null), mutationObserverRef = React3.useRef(null), scheduleMapUpdate = useStableCallback(() => {
|
|
147
|
+
isDirtyRef.current || (isDirtyRef.current = !0, setMapTick((tick) => tick + 1));
|
|
148
|
+
}), register = useStableCallback((node, registration) => {
|
|
149
|
+
map.set(node, registration), scheduleMapUpdate();
|
|
150
|
+
}), unregister = useStableCallback((node) => {
|
|
151
|
+
map.delete(node), scheduleMapUpdate();
|
|
152
|
+
}), syncRefs = useStableCallback((items) => {
|
|
153
|
+
let nextMap = /* @__PURE__ */ new Map();
|
|
154
|
+
return elementsRef.current.length = 0, labelsRef && (labelsRef.current.length = 0), items.forEach((item) => {
|
|
155
|
+
nextMap.set(item.element, {
|
|
156
|
+
...item.registration.metadata ?? {},
|
|
157
|
+
index: item.index
|
|
158
|
+
}), elementsRef.current[item.index] = item.element, labelsRef && (labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent);
|
|
159
|
+
}), nextIndexRef.current = elementsRef.current.length, nextMap;
|
|
160
|
+
});
|
|
161
|
+
function observe(sortedNodes) {
|
|
162
|
+
if (mutationObserverRef.current?.disconnect(), mutationObserverRef.current = null, typeof MutationObserver != "function" || sortedNodes.length < 2)
|
|
163
|
+
return;
|
|
164
|
+
let mutationObserver = new MutationObserver((entries) => {
|
|
165
|
+
if (!hasMovedNode(entries))
|
|
166
|
+
return;
|
|
167
|
+
let previousConnectedNode = null;
|
|
168
|
+
for (let node of sortedNodes)
|
|
169
|
+
if (node.isConnected) {
|
|
170
|
+
if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
|
|
171
|
+
mutationObserver.disconnect(), scheduleMapUpdate();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
previousConnectedNode = node;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
mutationObserverRef.current = mutationObserver;
|
|
178
|
+
let roots = /* @__PURE__ */ new Set();
|
|
179
|
+
for (let i = 1; i < sortedNodes.length; i += 1) {
|
|
180
|
+
let root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
|
|
181
|
+
root && roots.add(root);
|
|
182
|
+
}
|
|
183
|
+
roots.forEach((root) => mutationObserver.observe(root, {
|
|
184
|
+
childList: !0
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
let flush = useStableCallback(() => {
|
|
188
|
+
let [items, automaticNodes] = getCompositeListSnapshot(map), nextMap = syncRefs(items), previousItems = itemsRef.current, changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
|
|
189
|
+
let previousItem = previousItems[index2];
|
|
190
|
+
return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
|
|
191
|
+
});
|
|
192
|
+
observe(automaticNodes), itemsRef.current = items, isDirtyRef.current = !1, changed && (listeners.forEach((listener) => listener(nextMap)), onMapChange(nextMap));
|
|
193
|
+
});
|
|
194
|
+
useIsoLayoutEffect(() => (!isDirtyRef.current && itemsRef.current && syncRefs(itemsRef.current), () => {
|
|
195
|
+
elementsRef.current = [], labelsRef && (labelsRef.current = []);
|
|
196
|
+
}), [elementsRef, labelsRef, syncRefs]), useIsoLayoutEffect(() => {
|
|
197
|
+
isDirtyRef.current && flush();
|
|
198
|
+
}), useIsoLayoutEffect(() => () => {
|
|
199
|
+
mutationObserverRef.current?.disconnect(), isDirtyRef.current = !0;
|
|
200
|
+
}, []);
|
|
201
|
+
let subscribeMapChange = useStableCallback((fn) => (listeners.add(fn), () => {
|
|
202
|
+
listeners.delete(fn);
|
|
203
|
+
})), contextValue = React3.useMemo(() => ({
|
|
204
|
+
register,
|
|
205
|
+
unregister,
|
|
206
|
+
subscribeMapChange,
|
|
207
|
+
nextIndexRef
|
|
208
|
+
}), [register, unregister, subscribeMapChange, nextIndexRef]);
|
|
209
|
+
return _jsx(CompositeListContext.Provider, {
|
|
210
|
+
value: contextValue,
|
|
211
|
+
children
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function createMap() {
|
|
215
|
+
return /* @__PURE__ */ new Map();
|
|
216
|
+
}
|
|
217
|
+
function createListeners() {
|
|
218
|
+
return /* @__PURE__ */ new Set();
|
|
219
|
+
}
|
|
220
|
+
function getCompositeListSnapshot(map) {
|
|
221
|
+
let reservedIndices = /* @__PURE__ */ new Set(), items = [], automaticItems = [];
|
|
222
|
+
map.forEach((registration, node) => {
|
|
223
|
+
if (!node.isConnected)
|
|
224
|
+
return;
|
|
225
|
+
let index2 = registration.index, item = {
|
|
226
|
+
index: index2 ?? -1,
|
|
227
|
+
element: node,
|
|
228
|
+
registration
|
|
229
|
+
};
|
|
230
|
+
index2 === null ? automaticItems.push(item) : index2 >= 0 && (reservedIndices.add(index2), items.push(item));
|
|
231
|
+
});
|
|
232
|
+
let nextAutomaticIndex = 0;
|
|
233
|
+
return automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element)), automaticItems.forEach((item) => {
|
|
234
|
+
for (; reservedIndices.has(nextAutomaticIndex); )
|
|
235
|
+
nextAutomaticIndex += 1;
|
|
236
|
+
item.index = nextAutomaticIndex, items.push(item), nextAutomaticIndex += 1;
|
|
237
|
+
}), reservedIndices.size > 0 && items.sort((a, b) => a.index - b.index), [items, automaticItems.map((item) => item.element)];
|
|
238
|
+
}
|
|
239
|
+
function getCommonAncestor(firstNode, lastNode) {
|
|
240
|
+
let ancestor = firstNode.parentElement;
|
|
241
|
+
for (; ancestor && !ancestor.contains(lastNode); )
|
|
242
|
+
ancestor = ancestor.parentElement;
|
|
243
|
+
return ancestor;
|
|
244
|
+
}
|
|
245
|
+
function hasMovedNode(entries) {
|
|
246
|
+
for (let entry of entries)
|
|
247
|
+
for (let i = 0; i < entry.removedNodes.length; i += 1)
|
|
248
|
+
if (entry.removedNodes[i].isConnected)
|
|
249
|
+
return !0;
|
|
250
|
+
return !1;
|
|
251
|
+
}
|
|
252
|
+
function sortByDocumentPosition(a, b) {
|
|
253
|
+
return a.nextElementSibling === b ? -1 : b.nextElementSibling === a ? 1 : a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ../../node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs
|
|
257
|
+
import * as React4 from "react";
|
|
258
|
+
var TabsRootContext = React4.createContext(void 0);
|
|
259
|
+
process.env.NODE_ENV !== "production" && (TabsRootContext.displayName = "TabsRootContext");
|
|
260
|
+
function useTabsRootContext() {
|
|
261
|
+
let context = React4.useContext(TabsRootContext);
|
|
262
|
+
if (context === void 0)
|
|
263
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64));
|
|
264
|
+
return context;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// ../../node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs
|
|
268
|
+
var activationDirection = "data-activation-direction";
|
|
269
|
+
|
|
270
|
+
// ../../node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs
|
|
271
|
+
var tabsStateAttributesMapping = {
|
|
272
|
+
tabActivationDirection: (dir) => ({
|
|
273
|
+
[activationDirection]: dir
|
|
274
|
+
})
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
// ../../node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
|
|
278
|
+
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
279
|
+
var TabsRoot = React5.forwardRef(function(componentProps, forwardedRef) {
|
|
280
|
+
let {
|
|
281
|
+
className,
|
|
282
|
+
defaultValue: defaultValueProp = 0,
|
|
283
|
+
onValueChange: onValueChangeProp,
|
|
284
|
+
orientation = "horizontal",
|
|
285
|
+
render,
|
|
286
|
+
value: valueProp,
|
|
287
|
+
style,
|
|
288
|
+
...elementProps
|
|
289
|
+
} = componentProps, hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0, tabPanelRefs = React5.useRef([]), [mountedTabPanels, setMountedTabPanels] = React5.useState(() => /* @__PURE__ */ new Map()), [value, setValue] = useControlled({
|
|
290
|
+
controlled: valueProp,
|
|
291
|
+
default: defaultValueProp,
|
|
292
|
+
name: "Tabs",
|
|
293
|
+
state: "value"
|
|
294
|
+
}), isControlled = valueProp !== void 0, [tabMap, setTabMap] = React5.useState(() => /* @__PURE__ */ new Map()), lastKnownTabElementRef = React5.useRef(void 0), getTabElementBySelectedValue = React5.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]), [activationDirectionState, setActivationDirectionState] = React5.useState(() => ({
|
|
295
|
+
previousValue: value,
|
|
296
|
+
tabActivationDirection: "none"
|
|
297
|
+
})), {
|
|
298
|
+
previousValue,
|
|
299
|
+
tabActivationDirection: committedTabActivationDirection
|
|
300
|
+
} = activationDirectionState, tabActivationDirection = committedTabActivationDirection, directionComputationIncomplete = !1;
|
|
301
|
+
previousValue !== value && (tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap), directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null);
|
|
302
|
+
let nextPreviousValue = directionComputationIncomplete ? previousValue : value, shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;
|
|
303
|
+
useIsoLayoutEffect(() => {
|
|
304
|
+
shouldSyncActivationDirectionState && setActivationDirectionState({
|
|
305
|
+
previousValue: nextPreviousValue,
|
|
306
|
+
tabActivationDirection
|
|
307
|
+
});
|
|
308
|
+
}, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);
|
|
309
|
+
let onValueChange = useStableCallback((newValue, eventDetails) => {
|
|
310
|
+
let activationDirection2 = computeActivationDirection(value, newValue, orientation, tabMap);
|
|
311
|
+
eventDetails.activationDirection = activationDirection2, onValueChangeProp?.(newValue, eventDetails), !eventDetails.isCanceled && setValue(() => newValue);
|
|
312
|
+
}), notifyAutomaticValueChange = useStableCallback((nextValue, reason) => {
|
|
313
|
+
onValueChangeProp?.(nextValue, createChangeEventDetails(reason, void 0, void 0, {
|
|
314
|
+
activationDirection: "none"
|
|
315
|
+
}));
|
|
316
|
+
}), registerMountedTabPanel = useStableCallback((panelValue, panelId) => (setMountedTabPanels((prev) => {
|
|
317
|
+
let next = new Map(prev);
|
|
318
|
+
return next.set(panelValue, panelId), next;
|
|
319
|
+
}), () => {
|
|
320
|
+
setMountedTabPanels((prev) => {
|
|
321
|
+
if (prev.get(panelValue) !== panelId)
|
|
322
|
+
return prev;
|
|
323
|
+
let next = new Map(prev);
|
|
324
|
+
return next.delete(panelValue), next;
|
|
325
|
+
});
|
|
326
|
+
})), getTabPanelIdByValue = React5.useCallback((tabValue) => mountedTabPanels.get(tabValue), [mountedTabPanels]), getTabIdByPanelValue = React5.useCallback((tabPanelValue) => {
|
|
327
|
+
for (let tabMetadata of tabMap.values())
|
|
328
|
+
if (tabPanelValue === tabMetadata.value)
|
|
329
|
+
return tabMetadata.id;
|
|
330
|
+
}, [tabMap]), tabsContextValue = React5.useMemo(() => ({
|
|
331
|
+
getTabElementBySelectedValue,
|
|
332
|
+
getTabIdByPanelValue,
|
|
333
|
+
getTabPanelIdByValue,
|
|
334
|
+
onValueChange,
|
|
335
|
+
orientation,
|
|
336
|
+
registerMountedTabPanel,
|
|
337
|
+
setTabMap,
|
|
338
|
+
tabActivationDirection,
|
|
339
|
+
value
|
|
340
|
+
}), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]), selectedTabMetadata = React5.useMemo(() => {
|
|
341
|
+
for (let tabMetadata of tabMap.values())
|
|
342
|
+
if (tabMetadata.value === value)
|
|
343
|
+
return tabMetadata;
|
|
344
|
+
}, [tabMap, value]), firstEnabledTabValue = React5.useMemo(() => {
|
|
345
|
+
for (let tabMetadata of tabMap.values())
|
|
346
|
+
if (!tabMetadata.disabled)
|
|
347
|
+
return tabMetadata.value;
|
|
348
|
+
}, [tabMap]), shouldNotifyInitialValueChangeRef = React5.useRef(!hasExplicitDefaultValueProp), initialDefaultValueRef = React5.useRef(defaultValueProp), shouldHonorDisabledDefaultValueRef = React5.useRef(hasExplicitDefaultValueProp), didRegisterTabsRef = React5.useRef(!1);
|
|
349
|
+
useIsoLayoutEffect(() => {
|
|
350
|
+
if (isControlled)
|
|
351
|
+
return;
|
|
352
|
+
function commitAutomaticValueChange(fallbackValue, fallbackReason) {
|
|
353
|
+
setValue(() => fallbackValue), setActivationDirectionState({
|
|
354
|
+
previousValue: fallbackValue,
|
|
355
|
+
tabActivationDirection: "none"
|
|
356
|
+
}), notifyAutomaticValueChange(fallbackValue, fallbackReason), shouldNotifyInitialValueChangeRef.current = !1;
|
|
357
|
+
}
|
|
358
|
+
if (tabMap.size === 0) {
|
|
359
|
+
didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected && commitAutomaticValueChange(null, reason_parts_exports.missing);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
didRegisterTabsRef.current = !0, lastKnownTabElementRef.current = tabMap.keys().next().value;
|
|
363
|
+
let selectionIsDisabled = selectedTabMetadata?.disabled, selectionIsMissing = selectedTabMetadata == null && value !== null;
|
|
364
|
+
if (!selectionIsDisabled && value === initialDefaultValueRef.current && (shouldHonorDisabledDefaultValueRef.current = !1), shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current)
|
|
365
|
+
return;
|
|
366
|
+
let shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current;
|
|
367
|
+
if (selectionIsDisabled || selectionIsMissing) {
|
|
368
|
+
let fallbackValue = firstEnabledTabValue ?? null;
|
|
369
|
+
if (value === fallbackValue) {
|
|
370
|
+
shouldNotifyInitialValueChangeRef.current = !1;
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
let fallbackReason = reason_parts_exports.missing;
|
|
374
|
+
shouldNotifyInitialValueChange ? fallbackReason = reason_parts_exports.initial : selectionIsDisabled && (fallbackReason = reason_parts_exports.disabled), commitAutomaticValueChange(fallbackValue, fallbackReason);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
shouldNotifyInitialValueChange && selectedTabMetadata != null && (notifyAutomaticValueChange(value, reason_parts_exports.initial), shouldNotifyInitialValueChangeRef.current = !1);
|
|
378
|
+
}, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]);
|
|
379
|
+
let element = useRenderElement("div", componentProps, {
|
|
380
|
+
state: {
|
|
381
|
+
orientation,
|
|
382
|
+
tabActivationDirection
|
|
383
|
+
},
|
|
384
|
+
ref: forwardedRef,
|
|
385
|
+
props: elementProps,
|
|
386
|
+
stateAttributesMapping: tabsStateAttributesMapping
|
|
387
|
+
});
|
|
388
|
+
return _jsx2(TabsRootContext.Provider, {
|
|
389
|
+
value: tabsContextValue,
|
|
390
|
+
children: _jsx2(CompositeList, {
|
|
391
|
+
elementsRef: tabPanelRefs,
|
|
392
|
+
children: element
|
|
393
|
+
})
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
process.env.NODE_ENV !== "production" && (TabsRoot.displayName = "TabsRoot");
|
|
397
|
+
function findTabElement(tabMap, value) {
|
|
398
|
+
for (let [tabElement, tabMetadata] of tabMap.entries())
|
|
399
|
+
if (value === tabMetadata.value)
|
|
400
|
+
return tabElement;
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
|
|
404
|
+
if (oldValue == null || newValue == null)
|
|
405
|
+
return "none";
|
|
406
|
+
let [positionProp, backward, forward] = orientation === "horizontal" ? ["left", "left", "right"] : ["top", "up", "down"], oldTab = findTabElement(tabMap, oldValue), newTab = findTabElement(tabMap, newValue);
|
|
407
|
+
if (oldTab == null || newTab == null)
|
|
408
|
+
return oldTab !== newTab && (typeof oldValue == "number" || typeof oldValue == "string") && typeof oldValue == typeof newValue ? newValue > oldValue ? forward : backward : "none";
|
|
409
|
+
let oldPosition = oldTab.getBoundingClientRect()[positionProp], newPosition = newTab.getBoundingClientRect()[positionProp];
|
|
410
|
+
return newPosition < oldPosition ? backward : newPosition > oldPosition ? forward : "none";
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// ../../node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
|
|
414
|
+
import * as React9 from "react";
|
|
415
|
+
|
|
416
|
+
// ../../node_modules/@base-ui/react/internals/composite/constants.mjs
|
|
417
|
+
var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
|
|
418
|
+
|
|
419
|
+
// ../../node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
|
|
420
|
+
import * as React7 from "react";
|
|
421
|
+
|
|
422
|
+
// ../../node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
|
|
423
|
+
import * as React6 from "react";
|
|
424
|
+
function useCompositeListItem(params = {}) {
|
|
425
|
+
let {
|
|
426
|
+
guess,
|
|
427
|
+
label,
|
|
428
|
+
metadata,
|
|
429
|
+
textRef,
|
|
430
|
+
index: externalIndex
|
|
431
|
+
} = params, {
|
|
432
|
+
register,
|
|
433
|
+
unregister,
|
|
434
|
+
subscribeMapChange,
|
|
435
|
+
nextIndexRef
|
|
436
|
+
} = useCompositeListContext(), indexRef = React6.useRef(-1), [internalIndex, setInternalIndex] = React6.useState(externalIndex == null && guess ? () => {
|
|
437
|
+
if (indexRef.current === -1) {
|
|
438
|
+
let newIndex = nextIndexRef.current;
|
|
439
|
+
nextIndexRef.current += 1, indexRef.current = newIndex;
|
|
440
|
+
}
|
|
441
|
+
return indexRef.current;
|
|
442
|
+
} : -1), index2 = externalIndex ?? internalIndex, componentRef = React6.useRef(null), ref = React6.useCallback((node) => {
|
|
443
|
+
let previousNode = componentRef.current;
|
|
444
|
+
previousNode && unregister(previousNode), componentRef.current = node, node && register(node, {
|
|
445
|
+
metadata: metadata ?? null,
|
|
446
|
+
index: externalIndex ?? null,
|
|
447
|
+
label,
|
|
448
|
+
textRef
|
|
449
|
+
});
|
|
450
|
+
}, [externalIndex, register, unregister, metadata, label, textRef]);
|
|
451
|
+
return useIsoLayoutEffect(() => {
|
|
452
|
+
if (externalIndex == null)
|
|
453
|
+
return subscribeMapChange((map) => {
|
|
454
|
+
let i = componentRef.current ? map.get(componentRef.current)?.index : null;
|
|
455
|
+
i != null && setInternalIndex(i);
|
|
456
|
+
});
|
|
457
|
+
}, [externalIndex, subscribeMapChange]), {
|
|
458
|
+
ref,
|
|
459
|
+
index: index2
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// ../../node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
|
|
464
|
+
function useCompositeItem(params = {}) {
|
|
465
|
+
let {
|
|
466
|
+
highlightItemOnHover,
|
|
467
|
+
highlightedIndex,
|
|
468
|
+
onHighlightedIndexChange
|
|
469
|
+
} = useCompositeRootContext(), {
|
|
470
|
+
ref,
|
|
471
|
+
index: index2
|
|
472
|
+
} = useCompositeListItem(params), isHighlighted = highlightedIndex === index2, itemRef = React7.useRef(null), mergedRef = useMergedRefs(ref, itemRef);
|
|
473
|
+
return {
|
|
474
|
+
compositeProps: {
|
|
475
|
+
tabIndex: isHighlighted ? 0 : -1,
|
|
476
|
+
onFocus() {
|
|
477
|
+
onHighlightedIndexChange(index2);
|
|
478
|
+
},
|
|
479
|
+
onMouseMove() {
|
|
480
|
+
let item = itemRef.current;
|
|
481
|
+
if (!highlightItemOnHover || !item)
|
|
482
|
+
return;
|
|
483
|
+
let disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
|
|
484
|
+
!isHighlighted && !disabled && item.focus();
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
compositeRef: mergedRef,
|
|
488
|
+
index: index2
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// ../../node_modules/@base-ui/react/tabs/list/TabsListContext.mjs
|
|
493
|
+
import * as React8 from "react";
|
|
494
|
+
var TabsListContext = React8.createContext(void 0);
|
|
495
|
+
process.env.NODE_ENV !== "production" && (TabsListContext.displayName = "TabsListContext");
|
|
496
|
+
function useTabsListContext() {
|
|
497
|
+
let context = React8.useContext(TabsListContext);
|
|
498
|
+
if (context === void 0)
|
|
499
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65));
|
|
500
|
+
return context;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// ../../node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
|
|
504
|
+
var TabsTab = React9.forwardRef(function(componentProps, forwardedRef) {
|
|
505
|
+
let {
|
|
506
|
+
className,
|
|
507
|
+
disabled = !1,
|
|
508
|
+
render,
|
|
509
|
+
value,
|
|
510
|
+
id: idProp,
|
|
511
|
+
nativeButton = !0,
|
|
512
|
+
style,
|
|
513
|
+
...elementProps
|
|
514
|
+
} = componentProps, {
|
|
515
|
+
value: activeTabValue,
|
|
516
|
+
getTabPanelIdByValue,
|
|
517
|
+
onValueChange,
|
|
518
|
+
orientation,
|
|
519
|
+
tabActivationDirection
|
|
520
|
+
} = useTabsRootContext(), {
|
|
521
|
+
activateOnFocus,
|
|
522
|
+
registerTabResizeObserverElement,
|
|
523
|
+
tabsListElement
|
|
524
|
+
} = useTabsListContext(), {
|
|
525
|
+
highlightedIndex,
|
|
526
|
+
onHighlightedIndexChange
|
|
527
|
+
} = useCompositeRootContext(), id = useBaseUiId(idProp), tabMetadata = React9.useMemo(() => ({
|
|
528
|
+
disabled,
|
|
529
|
+
id,
|
|
530
|
+
value
|
|
531
|
+
}), [disabled, id, value]), {
|
|
532
|
+
compositeProps,
|
|
533
|
+
compositeRef,
|
|
534
|
+
index: index2
|
|
535
|
+
// hook is used instead of the CompositeItem component
|
|
536
|
+
// because the index is needed for Tab internals
|
|
537
|
+
} = useCompositeItem({
|
|
538
|
+
metadata: tabMetadata
|
|
539
|
+
}), active = value === activeTabValue, isNavigatingRef = React9.useRef(!1), unobserveTabElementRef = React9.useRef(null), observeTabElement = useStableCallback((element2) => {
|
|
540
|
+
unobserveTabElementRef.current?.(), unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null;
|
|
541
|
+
});
|
|
542
|
+
useIsoLayoutEffect(() => {
|
|
543
|
+
if (isNavigatingRef.current) {
|
|
544
|
+
isNavigatingRef.current = !1;
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (!(active && index2 > -1 && highlightedIndex !== index2))
|
|
548
|
+
return;
|
|
549
|
+
let listElement = tabsListElement;
|
|
550
|
+
if (listElement != null) {
|
|
551
|
+
let activeEl = activeElement(ownerDocument(listElement));
|
|
552
|
+
if (activeEl && contains(listElement, activeEl))
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
disabled || onHighlightedIndexChange(index2);
|
|
556
|
+
}, [active, index2, highlightedIndex, onHighlightedIndexChange, disabled, tabsListElement]);
|
|
557
|
+
let {
|
|
558
|
+
getButtonProps,
|
|
559
|
+
buttonRef
|
|
560
|
+
} = useButton({
|
|
561
|
+
disabled,
|
|
562
|
+
native: nativeButton,
|
|
563
|
+
focusableWhenDisabled: !0
|
|
564
|
+
}), tabPanelId = getTabPanelIdByValue(value), isPressingRef = React9.useRef(!1), isMainButtonRef = React9.useRef(!1);
|
|
565
|
+
function activate(event) {
|
|
566
|
+
onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
|
|
567
|
+
activationDirection: "none"
|
|
568
|
+
}));
|
|
569
|
+
}
|
|
570
|
+
function onClick(event) {
|
|
571
|
+
active || disabled || activate(event);
|
|
572
|
+
}
|
|
573
|
+
function onFocus(event) {
|
|
574
|
+
active || disabled || activateOnFocus && (!isPressingRef.current || // keyboard or touch focus
|
|
575
|
+
isMainButtonRef.current) && activate(event);
|
|
576
|
+
}
|
|
577
|
+
function onPointerDown(event) {
|
|
578
|
+
if (active || disabled)
|
|
579
|
+
return;
|
|
580
|
+
isPressingRef.current = !0, isMainButtonRef.current = event.button === 0;
|
|
581
|
+
let doc = ownerDocument(event.currentTarget);
|
|
582
|
+
function handlePointerEnd() {
|
|
583
|
+
isPressingRef.current = !1, isMainButtonRef.current = !1, doc.removeEventListener("pointerup", handlePointerEnd), doc.removeEventListener("pointercancel", handlePointerEnd);
|
|
584
|
+
}
|
|
585
|
+
doc.addEventListener("pointerup", handlePointerEnd), doc.addEventListener("pointercancel", handlePointerEnd);
|
|
586
|
+
}
|
|
587
|
+
return useRenderElement("button", componentProps, {
|
|
588
|
+
state: {
|
|
589
|
+
disabled,
|
|
590
|
+
active,
|
|
591
|
+
orientation,
|
|
592
|
+
tabActivationDirection
|
|
593
|
+
},
|
|
594
|
+
ref: [forwardedRef, buttonRef, compositeRef, observeTabElement],
|
|
595
|
+
props: [compositeProps, {
|
|
596
|
+
role: "tab",
|
|
597
|
+
"aria-controls": tabPanelId,
|
|
598
|
+
"aria-selected": active,
|
|
599
|
+
id,
|
|
600
|
+
onClick,
|
|
601
|
+
onFocus,
|
|
602
|
+
onPointerDown,
|
|
603
|
+
[ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
|
|
604
|
+
onKeyDownCapture() {
|
|
605
|
+
isNavigatingRef.current = !0;
|
|
606
|
+
}
|
|
607
|
+
}, elementProps, getButtonProps],
|
|
608
|
+
stateAttributesMapping: tabsStateAttributesMapping
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
process.env.NODE_ENV !== "production" && (TabsTab.displayName = "TabsTab");
|
|
612
|
+
|
|
613
|
+
// ../../node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
|
|
614
|
+
import * as React13 from "react";
|
|
615
|
+
|
|
616
|
+
// ../../node_modules/@base-ui/react/internals/PrehydrationScript.mjs
|
|
617
|
+
import "react";
|
|
618
|
+
|
|
619
|
+
// ../../node_modules/@base-ui/utils/hydration.mjs
|
|
620
|
+
import * as React10 from "react";
|
|
621
|
+
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
|
622
|
+
var emptySubscribe = () => () => {
|
|
623
|
+
}, getTrue = () => !0, getFalse = () => !1;
|
|
624
|
+
function useIsHydratedModern() {
|
|
625
|
+
return useSyncExternalStore(emptySubscribe, getTrue, getFalse);
|
|
626
|
+
}
|
|
627
|
+
function useIsHydratedLegacy() {
|
|
628
|
+
let [hydrated, setHydrated] = React10.useState(!1);
|
|
629
|
+
return React10.useEffect(() => {
|
|
630
|
+
setHydrated(!0);
|
|
631
|
+
}, []), hydrated;
|
|
632
|
+
}
|
|
633
|
+
var useIsHydrated = isReactVersionAtLeast(18) ? useIsHydratedModern : useIsHydratedLegacy;
|
|
634
|
+
function useIsHydrating() {
|
|
635
|
+
return !useIsHydrated();
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// ../../node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs
|
|
639
|
+
import * as React11 from "react";
|
|
640
|
+
var CSPContext = React11.createContext(void 0);
|
|
641
|
+
process.env.NODE_ENV !== "production" && (CSPContext.displayName = "CSPContext");
|
|
642
|
+
var DEFAULT_CSP_CONTEXT_VALUE = {
|
|
643
|
+
disableStyleElements: !1
|
|
644
|
+
};
|
|
645
|
+
function useCSPContext() {
|
|
646
|
+
return React11.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// ../../node_modules/@base-ui/react/internals/PrehydrationScript.mjs
|
|
650
|
+
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
651
|
+
function PrehydrationScript(props) {
|
|
652
|
+
let {
|
|
653
|
+
script: script2
|
|
654
|
+
} = props, {
|
|
655
|
+
nonce
|
|
656
|
+
} = useCSPContext();
|
|
657
|
+
return useIsHydrating() ? _jsx3("script", {
|
|
658
|
+
nonce,
|
|
659
|
+
dangerouslySetInnerHTML: {
|
|
660
|
+
__html: script2
|
|
661
|
+
},
|
|
662
|
+
suppressHydrationWarning: !0
|
|
663
|
+
}) : null;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// ../../node_modules/@base-ui/react/utils/getElementTransform.mjs
|
|
667
|
+
function getElementTransform(element, computedStyle) {
|
|
668
|
+
let transform = (computedStyle ?? getWindow(element).getComputedStyle(element)).transform, translateX = 0, translateY = 0, scale = 1;
|
|
669
|
+
if (transform && transform !== "none") {
|
|
670
|
+
let matrix = transform.match(/matrix(?:3d)?\(([^)]+)\)/);
|
|
671
|
+
if (matrix) {
|
|
672
|
+
let values = matrix[1].split(", ").map(parseFloat);
|
|
673
|
+
values.length === 6 ? (translateX = values[4], translateY = values[5], scale = Math.sqrt(values[0] * values[0] + values[1] * values[1])) : values.length === 16 && (translateX = values[12], translateY = values[13], scale = values[0]);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return {
|
|
677
|
+
x: translateX,
|
|
678
|
+
y: translateY,
|
|
679
|
+
scale
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// ../../node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs
|
|
684
|
+
var activeTabLeft = "--active-tab-left", activeTabRight = "--active-tab-right", activeTabTop = "--active-tab-top", activeTabBottom = "--active-tab-bottom", activeTabWidth = "--active-tab-width", activeTabHeight = "--active-tab-height";
|
|
685
|
+
|
|
686
|
+
// ../../node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
|
|
687
|
+
import { jsx as _jsx4, jsxs as _jsxs } from "react/jsx-runtime";
|
|
688
|
+
var _PrehydrationScript, stateAttributesMapping = {
|
|
689
|
+
...tabsStateAttributesMapping,
|
|
690
|
+
activeTabPosition: () => null,
|
|
691
|
+
activeTabSize: () => null
|
|
692
|
+
}, MAX_LAYOUT_ROUNDING_ERROR = 2, TabsIndicator = React13.forwardRef(function(componentProps, forwardedRef) {
|
|
693
|
+
let {
|
|
694
|
+
className,
|
|
695
|
+
render,
|
|
696
|
+
renderBeforeHydration = !1,
|
|
697
|
+
style: styleProp,
|
|
698
|
+
...elementProps
|
|
699
|
+
} = componentProps, {
|
|
700
|
+
getTabElementBySelectedValue,
|
|
701
|
+
orientation,
|
|
702
|
+
tabActivationDirection,
|
|
703
|
+
value
|
|
704
|
+
} = useTabsRootContext(), {
|
|
705
|
+
tabsListElement,
|
|
706
|
+
registerIndicatorUpdateListener
|
|
707
|
+
} = useTabsListContext(), rerender = useForcedRerendering();
|
|
708
|
+
React13.useEffect(() => registerIndicatorUpdateListener(rerender), [registerIndicatorUpdateListener, rerender]);
|
|
709
|
+
let left = 0, right = 0, top = 0, bottom = 0, width = 0, height = 0, isTabSelected = !1;
|
|
710
|
+
if (value != null && tabsListElement != null) {
|
|
711
|
+
let activeTab = getTabElementBySelectedValue(value);
|
|
712
|
+
if (activeTab != null) {
|
|
713
|
+
isTabSelected = !0;
|
|
714
|
+
let {
|
|
715
|
+
width: computedWidth,
|
|
716
|
+
height: computedHeight
|
|
717
|
+
} = getCssDimensions(activeTab), {
|
|
718
|
+
width: tabListWidth,
|
|
719
|
+
height: tabListHeight
|
|
720
|
+
} = getCssDimensions(tabsListElement), tabRect = activeTab.getBoundingClientRect(), tabsListRect = tabsListElement.getBoundingClientRect(), scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1, scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1, layoutOffset = getLayoutOffset(activeTab, tabsListElement);
|
|
721
|
+
left = layoutOffset.left, top = layoutOffset.top;
|
|
722
|
+
let rectLeft = (tabRect.left - tabsListRect.left) / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft, rectTop = (tabRect.top - tabsListRect.top) / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop, tabTranslation = getActiveTabTranslation(activeTab);
|
|
723
|
+
Math.abs(rectLeft - tabTranslation.x - left) <= MAX_LAYOUT_ROUNDING_ERROR && Math.abs(rectTop - tabTranslation.y - top) <= MAX_LAYOUT_ROUNDING_ERROR && (left = rectLeft, top = rectTop), width = computedWidth, height = computedHeight, right = tabsListElement.scrollWidth - left - width, bottom = tabsListElement.scrollHeight - top - height;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
let activeTabPosition = isTabSelected ? {
|
|
727
|
+
left,
|
|
728
|
+
right,
|
|
729
|
+
top,
|
|
730
|
+
bottom
|
|
731
|
+
} : null, activeTabSize = isTabSelected ? {
|
|
732
|
+
width,
|
|
733
|
+
height
|
|
734
|
+
} : null, style = isTabSelected ? {
|
|
735
|
+
[activeTabLeft]: `${left}px`,
|
|
736
|
+
[activeTabRight]: `${right}px`,
|
|
737
|
+
[activeTabTop]: `${top}px`,
|
|
738
|
+
[activeTabBottom]: `${bottom}px`,
|
|
739
|
+
[activeTabWidth]: `${width}px`,
|
|
740
|
+
[activeTabHeight]: `${height}px`
|
|
741
|
+
} : void 0, displayIndicator = isTabSelected && width > 0 && height > 0, element = useRenderElement("span", componentProps, {
|
|
742
|
+
state: {
|
|
743
|
+
orientation,
|
|
744
|
+
activeTabPosition,
|
|
745
|
+
activeTabSize,
|
|
746
|
+
tabActivationDirection
|
|
747
|
+
},
|
|
748
|
+
ref: forwardedRef,
|
|
749
|
+
props: [{
|
|
750
|
+
role: "presentation",
|
|
751
|
+
style,
|
|
752
|
+
hidden: !displayIndicator
|
|
753
|
+
// do not display the indicator before the layout is settled
|
|
754
|
+
}, elementProps, {
|
|
755
|
+
suppressHydrationWarning: !0
|
|
756
|
+
}],
|
|
757
|
+
stateAttributesMapping
|
|
758
|
+
});
|
|
759
|
+
return value == null ? null : _jsxs(React13.Fragment, {
|
|
760
|
+
children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = _jsx4(PrehydrationScript, {
|
|
761
|
+
script: ""
|
|
762
|
+
})))]
|
|
763
|
+
});
|
|
764
|
+
});
|
|
765
|
+
process.env.NODE_ENV !== "production" && (TabsIndicator.displayName = "TabsIndicator");
|
|
766
|
+
function getLayoutOffset(element, ancestor) {
|
|
767
|
+
let elementOffset = getCumulativeOffset(element), ancestorOffset = getCumulativeOffset(ancestor), left = elementOffset.left - ancestorOffset.left - ancestor.clientLeft, top = elementOffset.top - ancestorOffset.top - ancestor.clientTop, node = getParentNode(element);
|
|
768
|
+
for (; isHTMLElement(node) && node !== ancestor && !isLastTraversableNode(node); )
|
|
769
|
+
left -= node.scrollLeft, top -= node.scrollTop, node = getParentNode(node);
|
|
770
|
+
return {
|
|
771
|
+
left,
|
|
772
|
+
top
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function getCumulativeOffset(element) {
|
|
776
|
+
let left = 0, top = 0, currentElement = element;
|
|
777
|
+
for (; currentElement != null; ) {
|
|
778
|
+
left += currentElement.offsetLeft, top += currentElement.offsetTop;
|
|
779
|
+
let offsetParent = currentElement.offsetParent;
|
|
780
|
+
offsetParent != null && (left += offsetParent.clientLeft, top += offsetParent.clientTop), currentElement = offsetParent;
|
|
781
|
+
}
|
|
782
|
+
return {
|
|
783
|
+
left,
|
|
784
|
+
top
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
function getActiveTabTranslation(element) {
|
|
788
|
+
let computedStyle = getWindow(element).getComputedStyle(element), {
|
|
789
|
+
x,
|
|
790
|
+
y
|
|
791
|
+
} = getElementTransform(element, computedStyle), translateX = x, translateY = y, {
|
|
792
|
+
translate
|
|
793
|
+
} = computedStyle;
|
|
794
|
+
if (translate && translate !== "none") {
|
|
795
|
+
let parts = translate.split(" ");
|
|
796
|
+
translateX += resolveTranslateLength(parts[0], element.offsetWidth), translateY += resolveTranslateLength(parts[1], element.offsetHeight);
|
|
797
|
+
}
|
|
798
|
+
return {
|
|
799
|
+
x: translateX,
|
|
800
|
+
y: translateY
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
function resolveTranslateLength(value, referenceSize) {
|
|
804
|
+
if (!value)
|
|
805
|
+
return 0;
|
|
806
|
+
let numeric = parseFloat(value);
|
|
807
|
+
return Number.isFinite(numeric) ? value.endsWith("%") ? numeric / 100 * referenceSize : numeric : 0;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
// ../../node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
|
|
811
|
+
import * as React14 from "react";
|
|
812
|
+
|
|
813
|
+
// ../../node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs
|
|
814
|
+
var index = "data-index";
|
|
815
|
+
var startingStyle = TransitionStatusDataAttributes_exports.startingStyle, endingStyle = TransitionStatusDataAttributes_exports.endingStyle;
|
|
816
|
+
|
|
817
|
+
// ../../node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
|
|
818
|
+
var stateAttributesMapping2 = {
|
|
819
|
+
...tabsStateAttributesMapping,
|
|
820
|
+
...transitionStatusMapping
|
|
821
|
+
}, TabsPanel = React14.forwardRef(function(componentProps, forwardedRef) {
|
|
822
|
+
let {
|
|
823
|
+
className,
|
|
824
|
+
value,
|
|
825
|
+
render,
|
|
826
|
+
keepMounted = !1,
|
|
827
|
+
style,
|
|
828
|
+
...elementProps
|
|
829
|
+
} = componentProps, {
|
|
830
|
+
value: selectedValue,
|
|
831
|
+
getTabIdByPanelValue,
|
|
832
|
+
orientation,
|
|
833
|
+
tabActivationDirection,
|
|
834
|
+
registerMountedTabPanel
|
|
835
|
+
} = useTabsRootContext(), id = useBaseUiId(), {
|
|
836
|
+
ref: listItemRef,
|
|
837
|
+
index: index2
|
|
838
|
+
} = useCompositeListItem(), open = value === selectedValue, {
|
|
839
|
+
mounted,
|
|
840
|
+
transitionStatus,
|
|
841
|
+
setMounted
|
|
842
|
+
} = useTransitionStatus(open), hidden = !mounted, correspondingTabId = getTabIdByPanelValue(value), state = {
|
|
843
|
+
hidden,
|
|
844
|
+
orientation,
|
|
845
|
+
tabActivationDirection,
|
|
846
|
+
transitionStatus
|
|
847
|
+
}, panelRef = React14.useRef(null), element = useRenderElement("div", componentProps, {
|
|
848
|
+
state,
|
|
849
|
+
ref: [forwardedRef, listItemRef, panelRef],
|
|
850
|
+
props: [{
|
|
851
|
+
"aria-labelledby": correspondingTabId,
|
|
852
|
+
hidden,
|
|
853
|
+
id,
|
|
854
|
+
role: "tabpanel",
|
|
855
|
+
tabIndex: open ? 0 : -1,
|
|
856
|
+
inert: inertValue(!open),
|
|
857
|
+
// Computed key: a plain literal key fails the DOM-props excess property check.
|
|
858
|
+
[index]: index2
|
|
859
|
+
}, elementProps],
|
|
860
|
+
stateAttributesMapping: stateAttributesMapping2
|
|
861
|
+
});
|
|
862
|
+
return useOpenChangeComplete({
|
|
863
|
+
open,
|
|
864
|
+
ref: panelRef,
|
|
865
|
+
onComplete() {
|
|
866
|
+
open || setMounted(!1);
|
|
867
|
+
}
|
|
868
|
+
}), useIsoLayoutEffect(() => {
|
|
869
|
+
if (!(id == null || hidden && !keepMounted))
|
|
870
|
+
return registerMountedTabPanel(value, id);
|
|
871
|
+
}, [hidden, keepMounted, value, id, registerMountedTabPanel]), keepMounted || mounted ? element : null;
|
|
872
|
+
});
|
|
873
|
+
process.env.NODE_ENV !== "production" && (TabsPanel.displayName = "TabsPanel");
|
|
874
|
+
|
|
875
|
+
// ../../node_modules/@base-ui/react/tabs/list/TabsList.mjs
|
|
876
|
+
import * as React17 from "react";
|
|
877
|
+
|
|
878
|
+
// ../../node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
|
|
879
|
+
import * as React16 from "react";
|
|
880
|
+
|
|
881
|
+
// ../../node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
|
|
882
|
+
import * as React15 from "react";
|
|
883
|
+
|
|
884
|
+
// ../../node_modules/@base-ui/utils/isElementDisabled.mjs
|
|
885
|
+
function isElementDisabled(element) {
|
|
886
|
+
return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// ../../node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
|
|
890
|
+
function useCompositeRoot(params) {
|
|
891
|
+
let {
|
|
892
|
+
loopFocus = !0,
|
|
893
|
+
orientation = "both",
|
|
894
|
+
grid,
|
|
895
|
+
onLoop,
|
|
896
|
+
direction,
|
|
897
|
+
highlightedIndex: externalHighlightedIndex,
|
|
898
|
+
onHighlightedIndexChange: externalSetHighlightedIndex,
|
|
899
|
+
rootRef: externalRef,
|
|
900
|
+
enableHomeAndEndKeys = !1,
|
|
901
|
+
stopEventPropagation,
|
|
902
|
+
disabledIndices,
|
|
903
|
+
modifierKeys = EMPTY_ARRAY
|
|
904
|
+
} = params, [internalHighlightedIndex, internalSetHighlightedIndex] = React15.useState(0), isGrid = grid != null, rootRef = React15.useRef(null), mergedRef = useMergedRefs(rootRef, externalRef), elementsRef = React15.useRef([]), hasSetDefaultIndexRef = React15.useRef(!1), highlightedElementRef = React15.useRef(null), highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex, onHighlightedIndexChange = useStableCallback((index2, shouldScrollIntoView = !1) => {
|
|
905
|
+
if (highlightedElementRef.current = elementsRef.current[index2] ?? null, (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index2), shouldScrollIntoView) {
|
|
906
|
+
let newActiveItem = elementsRef.current[index2];
|
|
907
|
+
scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
|
|
908
|
+
}
|
|
909
|
+
}), onMapChange = useStableCallback((map) => {
|
|
910
|
+
if (map.size === 0)
|
|
911
|
+
return;
|
|
912
|
+
if (hasSetDefaultIndexRef.current) {
|
|
913
|
+
let elements = elementsRef.current, nextIndex = elements.indexOf(highlightedElementRef.current);
|
|
914
|
+
if (nextIndex === -1) {
|
|
915
|
+
let replacement = elements[highlightedIndex];
|
|
916
|
+
!replacement || isListIndexDisabled(elements, highlightedIndex, disabledIndices) ? onHighlightedIndexChange(getFallbackIndex(elements, disabledIndices)) : highlightedElementRef.current = replacement;
|
|
917
|
+
} else nextIndex !== highlightedIndex && onHighlightedIndexChange(nextIndex);
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
hasSetDefaultIndexRef.current = !0;
|
|
921
|
+
let sortedElements = Array.from(map.keys()), activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null, activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;
|
|
922
|
+
if (activeIndex !== -1)
|
|
923
|
+
onHighlightedIndexChange(activeIndex);
|
|
924
|
+
else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {
|
|
925
|
+
let firstEnabledIndex = findNonDisabledListIndex(sortedElements, {
|
|
926
|
+
disabledIndices
|
|
927
|
+
});
|
|
928
|
+
isIndexOutOfListBounds(sortedElements, firstEnabledIndex) || onHighlightedIndexChange(firstEnabledIndex);
|
|
929
|
+
}
|
|
930
|
+
scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
|
|
931
|
+
});
|
|
932
|
+
useIsoLayoutEffect(() => {
|
|
933
|
+
if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current)
|
|
934
|
+
return;
|
|
935
|
+
let elements = elementsRef.current;
|
|
936
|
+
if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
|
|
937
|
+
let firstEnabledIndex = findNonDisabledListIndex(elements, {
|
|
938
|
+
disabledIndices
|
|
939
|
+
});
|
|
940
|
+
isIndexOutOfListBounds(elements, firstEnabledIndex) || onHighlightedIndexChange(firstEnabledIndex);
|
|
941
|
+
}
|
|
942
|
+
}, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]);
|
|
943
|
+
let wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => onLoop ? onLoop(event, prevIndex, nextIndex, elementsRef) : nextIndex), onKeyDown = useStableCallback((event) => {
|
|
944
|
+
let isHomeOrEnd = event.key === HOME || event.key === END;
|
|
945
|
+
if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd || isModifierKeySet(event, modifierKeys) || !rootRef.current)
|
|
946
|
+
return;
|
|
947
|
+
let isRtl = direction === "rtl", horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT, horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT, forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey, backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey, target = getTarget(event.nativeEvent);
|
|
948
|
+
if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
|
|
949
|
+
let selectionStart = target.selectionStart, selectionEnd = target.selectionEnd, textContent = target.value;
|
|
950
|
+
if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd || event.key !== backwardKey && selectionStart < textContent.length || event.key !== forwardKey && selectionStart > 0)
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
let nextIndex = highlightedIndex, minIndex = getMinListIndex(elementsRef, disabledIndices), maxIndex = getMaxListIndex(elementsRef, disabledIndices);
|
|
954
|
+
grid != null && (nextIndex = grid({
|
|
955
|
+
disabledIndices,
|
|
956
|
+
elementsRef,
|
|
957
|
+
event,
|
|
958
|
+
highlightedIndex,
|
|
959
|
+
loopFocus,
|
|
960
|
+
maxIndex,
|
|
961
|
+
minIndex,
|
|
962
|
+
onLoop: wrappedOnLoop,
|
|
963
|
+
orientation,
|
|
964
|
+
rtl: isRtl
|
|
965
|
+
}));
|
|
966
|
+
let isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === ARROW_DOWN, isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === ARROW_UP;
|
|
967
|
+
enableHomeAndEndKeys && (event.key === HOME ? nextIndex = minIndex : event.key === END && (nextIndex = maxIndex)), nextIndex === highlightedIndex && (isForwardKey || isBackwardKey) && (loopFocus && nextIndex === maxIndex && isForwardKey ? (nextIndex = minIndex, onLoop && (nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef))) : loopFocus && nextIndex === minIndex && isBackwardKey ? (nextIndex = maxIndex, onLoop && (nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef))) : nextIndex = findNonDisabledListIndex(elementsRef.current, {
|
|
968
|
+
startingIndex: nextIndex,
|
|
969
|
+
decrement: isBackwardKey,
|
|
970
|
+
disabledIndices
|
|
971
|
+
})), nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex) && (stopEventPropagation && event.stopPropagation(), (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) && event.preventDefault(), onHighlightedIndexChange(nextIndex, !0), queueMicrotask(() => {
|
|
972
|
+
elementsRef.current[nextIndex]?.focus();
|
|
973
|
+
}));
|
|
974
|
+
});
|
|
975
|
+
return {
|
|
976
|
+
props: {
|
|
977
|
+
ref: mergedRef,
|
|
978
|
+
onFocus(event) {
|
|
979
|
+
let element = rootRef.current, target = getTarget(event.nativeEvent);
|
|
980
|
+
!element || target == null || !isNativeInput(target) || target.setSelectionRange(0, target.value.length);
|
|
981
|
+
},
|
|
982
|
+
onKeyDown
|
|
983
|
+
},
|
|
984
|
+
highlightedIndex,
|
|
985
|
+
onHighlightedIndexChange,
|
|
986
|
+
elementsRef,
|
|
987
|
+
onMapChange,
|
|
988
|
+
relayKeyboardEvent: onKeyDown
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
function getFallbackIndex(elements, disabledIndices) {
|
|
992
|
+
let fallbackIndex = -1;
|
|
993
|
+
for (let index2 = 0; index2 < elements.length; index2 += 1) {
|
|
994
|
+
let element = elements[index2];
|
|
995
|
+
if (!(!element || isListIndexDisabled(elements, index2, disabledIndices))) {
|
|
996
|
+
if (element.hasAttribute(ACTIVE_COMPOSITE_ITEM))
|
|
997
|
+
return index2;
|
|
998
|
+
fallbackIndex === -1 && (fallbackIndex = index2);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
return Math.max(fallbackIndex, 0);
|
|
1002
|
+
}
|
|
1003
|
+
function isModifierKeySet(event, ignoredModifierKeys) {
|
|
1004
|
+
for (let key of MODIFIER_KEYS)
|
|
1005
|
+
if (!ignoredModifierKeys.includes(key) && event.getModifierState(key))
|
|
1006
|
+
return !0;
|
|
1007
|
+
return !1;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
// ../../node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
|
|
1011
|
+
import { jsx as _jsx5 } from "react/jsx-runtime";
|
|
1012
|
+
function CompositeRoot(componentProps) {
|
|
1013
|
+
let {
|
|
1014
|
+
render,
|
|
1015
|
+
className,
|
|
1016
|
+
style,
|
|
1017
|
+
refs = EMPTY_ARRAY,
|
|
1018
|
+
props = EMPTY_ARRAY,
|
|
1019
|
+
state = EMPTY_OBJECT,
|
|
1020
|
+
stateAttributesMapping: stateAttributesMapping3,
|
|
1021
|
+
highlightedIndex: highlightedIndexProp,
|
|
1022
|
+
onHighlightedIndexChange: onHighlightedIndexChangeProp,
|
|
1023
|
+
orientation,
|
|
1024
|
+
grid,
|
|
1025
|
+
loopFocus,
|
|
1026
|
+
onLoop,
|
|
1027
|
+
enableHomeAndEndKeys,
|
|
1028
|
+
onMapChange: onMapChangeProp,
|
|
1029
|
+
stopEventPropagation = !0,
|
|
1030
|
+
rootRef,
|
|
1031
|
+
disabledIndices,
|
|
1032
|
+
modifierKeys,
|
|
1033
|
+
highlightItemOnHover = !1,
|
|
1034
|
+
tag = "div",
|
|
1035
|
+
...elementProps
|
|
1036
|
+
} = componentProps, direction = useDirection(), {
|
|
1037
|
+
props: defaultProps,
|
|
1038
|
+
highlightedIndex,
|
|
1039
|
+
onHighlightedIndexChange,
|
|
1040
|
+
elementsRef,
|
|
1041
|
+
onMapChange: onMapChangeUnwrapped,
|
|
1042
|
+
relayKeyboardEvent
|
|
1043
|
+
} = useCompositeRoot({
|
|
1044
|
+
grid,
|
|
1045
|
+
loopFocus,
|
|
1046
|
+
onLoop,
|
|
1047
|
+
orientation,
|
|
1048
|
+
highlightedIndex: highlightedIndexProp,
|
|
1049
|
+
onHighlightedIndexChange: onHighlightedIndexChangeProp,
|
|
1050
|
+
rootRef,
|
|
1051
|
+
stopEventPropagation,
|
|
1052
|
+
enableHomeAndEndKeys,
|
|
1053
|
+
direction,
|
|
1054
|
+
disabledIndices,
|
|
1055
|
+
modifierKeys
|
|
1056
|
+
}), element = useRenderElement(tag, componentProps, {
|
|
1057
|
+
state,
|
|
1058
|
+
ref: refs,
|
|
1059
|
+
props: [defaultProps, ...props, elementProps],
|
|
1060
|
+
stateAttributesMapping: stateAttributesMapping3
|
|
1061
|
+
}), contextValue = React16.useMemo(() => ({
|
|
1062
|
+
highlightedIndex,
|
|
1063
|
+
onHighlightedIndexChange,
|
|
1064
|
+
highlightItemOnHover,
|
|
1065
|
+
relayKeyboardEvent
|
|
1066
|
+
}), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
|
|
1067
|
+
return _jsx5(CompositeRootContext.Provider, {
|
|
1068
|
+
value: contextValue,
|
|
1069
|
+
children: _jsx5(CompositeList, {
|
|
1070
|
+
elementsRef,
|
|
1071
|
+
onMapChange: (newMap) => {
|
|
1072
|
+
onMapChangeProp?.(newMap), onMapChangeUnwrapped(newMap);
|
|
1073
|
+
},
|
|
1074
|
+
children: element
|
|
1075
|
+
})
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
// ../../node_modules/@base-ui/react/tabs/list/TabsList.mjs
|
|
1080
|
+
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
1081
|
+
var TabsList = React17.forwardRef(function(componentProps, forwardedRef) {
|
|
1082
|
+
let {
|
|
1083
|
+
activateOnFocus = !1,
|
|
1084
|
+
className,
|
|
1085
|
+
loopFocus = !0,
|
|
1086
|
+
render,
|
|
1087
|
+
style,
|
|
1088
|
+
...elementProps
|
|
1089
|
+
} = componentProps, {
|
|
1090
|
+
orientation,
|
|
1091
|
+
setTabMap,
|
|
1092
|
+
tabActivationDirection
|
|
1093
|
+
} = useTabsRootContext(), [highlightedTabIndex, setHighlightedTabIndex] = React17.useState(0), [tabsListElement, setTabsListElement] = React17.useState(null), indicatorUpdateListenersRef = React17.useRef(/* @__PURE__ */ new Set()), tabResizeObserverElementsRef = React17.useRef(/* @__PURE__ */ new Set()), resizeObserverRef = React17.useRef(null);
|
|
1094
|
+
useIsoLayoutEffect(() => {
|
|
1095
|
+
if (typeof ResizeObserver > "u")
|
|
1096
|
+
return;
|
|
1097
|
+
let resizeObserver = new ResizeObserver(() => {
|
|
1098
|
+
indicatorUpdateListenersRef.current.forEach((listener) => {
|
|
1099
|
+
listener();
|
|
1100
|
+
});
|
|
1101
|
+
});
|
|
1102
|
+
return resizeObserverRef.current = resizeObserver, tabsListElement && resizeObserver.observe(tabsListElement), tabResizeObserverElementsRef.current.forEach((element) => {
|
|
1103
|
+
resizeObserver.observe(element);
|
|
1104
|
+
}), () => {
|
|
1105
|
+
resizeObserver.disconnect(), resizeObserverRef.current = null;
|
|
1106
|
+
};
|
|
1107
|
+
}, [tabsListElement]);
|
|
1108
|
+
let registerIndicatorUpdateListener = useStableCallback((listener) => (indicatorUpdateListenersRef.current.add(listener), () => {
|
|
1109
|
+
indicatorUpdateListenersRef.current.delete(listener);
|
|
1110
|
+
})), registerTabResizeObserverElement = useStableCallback((element) => (tabResizeObserverElementsRef.current.add(element), resizeObserverRef.current?.observe(element), () => {
|
|
1111
|
+
tabResizeObserverElementsRef.current.delete(element), resizeObserverRef.current?.unobserve(element);
|
|
1112
|
+
})), state = {
|
|
1113
|
+
orientation,
|
|
1114
|
+
tabActivationDirection
|
|
1115
|
+
}, defaultProps = {
|
|
1116
|
+
"aria-orientation": orientation === "vertical" ? "vertical" : void 0,
|
|
1117
|
+
role: "tablist"
|
|
1118
|
+
}, tabsListContextValue = React17.useMemo(() => ({
|
|
1119
|
+
activateOnFocus,
|
|
1120
|
+
registerIndicatorUpdateListener,
|
|
1121
|
+
registerTabResizeObserverElement,
|
|
1122
|
+
tabsListElement
|
|
1123
|
+
}), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]);
|
|
1124
|
+
return _jsx6(TabsListContext.Provider, {
|
|
1125
|
+
value: tabsListContextValue,
|
|
1126
|
+
children: _jsx6(CompositeRoot, {
|
|
1127
|
+
render,
|
|
1128
|
+
className,
|
|
1129
|
+
style,
|
|
1130
|
+
state,
|
|
1131
|
+
refs: [forwardedRef, setTabsListElement],
|
|
1132
|
+
props: [defaultProps, elementProps],
|
|
1133
|
+
stateAttributesMapping: tabsStateAttributesMapping,
|
|
1134
|
+
highlightedIndex: highlightedTabIndex,
|
|
1135
|
+
enableHomeAndEndKeys: !0,
|
|
1136
|
+
loopFocus,
|
|
1137
|
+
orientation,
|
|
1138
|
+
onHighlightedIndexChange: setHighlightedTabIndex,
|
|
1139
|
+
onMapChange: setTabMap,
|
|
1140
|
+
disabledIndices: EMPTY_ARRAY
|
|
1141
|
+
})
|
|
1142
|
+
});
|
|
1143
|
+
});
|
|
1144
|
+
process.env.NODE_ENV !== "production" && (TabsList.displayName = "TabsList");
|
|
1145
|
+
|
|
1146
|
+
export {
|
|
1147
|
+
useCSPContext,
|
|
1148
|
+
index_parts_exports
|
|
1149
|
+
};
|