@mieweb/ui 0.7.3 → 0.8.0-dev.1
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/README.md +45 -24
- package/agent/README.md +20 -0
- package/agent/init-agent.mjs +61 -0
- package/agent/mieweb-ui.instructions.md +169 -0
- package/dist/ag-grid.cjs +11 -0
- package/dist/ag-grid.cjs.map +1 -1
- package/dist/ag-grid.d.cts +4 -0
- package/dist/ag-grid.d.ts +4 -0
- package/dist/ag-grid.js +11 -0
- package/dist/ag-grid.js.map +1 -1
- package/dist/brands/index.cjs +12 -12
- package/dist/brands/index.js +3 -3
- package/dist/{chunk-EGWWTIWS.js → chunk-2AB4PQYL.js} +126 -96
- package/dist/chunk-2AB4PQYL.js.map +1 -0
- package/dist/{chunk-NQ2D2V6O.cjs → chunk-2PEVRI26.cjs} +37 -37
- package/dist/{chunk-NQ2D2V6O.cjs.map → chunk-2PEVRI26.cjs.map} +1 -1
- package/dist/{chunk-6J7UGYT5.cjs → chunk-2SSAAE3I.cjs} +49 -9
- package/dist/chunk-2SSAAE3I.cjs.map +1 -0
- package/dist/chunk-3IMM2PM4.js +259 -0
- package/dist/chunk-3IMM2PM4.js.map +1 -0
- package/dist/{chunk-SYIFEJSF.cjs → chunk-3RADKLLD.cjs} +13 -13
- package/dist/{chunk-SYIFEJSF.cjs.map → chunk-3RADKLLD.cjs.map} +1 -1
- package/dist/chunk-3SHLOF4V.cjs +128 -0
- package/dist/chunk-3SHLOF4V.cjs.map +1 -0
- package/dist/chunk-3TXOFAXP.cjs +139 -0
- package/dist/chunk-3TXOFAXP.cjs.map +1 -0
- package/dist/{chunk-LJDBD2DD.cjs → chunk-5BPUZK2B.cjs} +386 -4
- package/dist/chunk-5BPUZK2B.cjs.map +1 -0
- package/dist/chunk-5JZIDILK.cjs +164 -0
- package/dist/chunk-5JZIDILK.cjs.map +1 -0
- package/dist/chunk-5MXO6PEV.cjs +78 -0
- package/dist/chunk-5MXO6PEV.cjs.map +1 -0
- package/dist/chunk-5QZ73PZC.js +62 -0
- package/dist/chunk-5QZ73PZC.js.map +1 -0
- package/dist/chunk-6GKX36JX.js +269 -0
- package/dist/chunk-6GKX36JX.js.map +1 -0
- package/dist/chunk-6NZXWKUE.js +3 -0
- package/dist/chunk-6NZXWKUE.js.map +1 -0
- package/dist/chunk-6SCQ7FKT.js +115 -0
- package/dist/chunk-6SCQ7FKT.js.map +1 -0
- package/dist/{chunk-KFLDXJEE.js → chunk-753Z3NXL.js} +46 -15
- package/dist/chunk-753Z3NXL.js.map +1 -0
- package/dist/{chunk-S3MKIDYG.cjs → chunk-7AECNMYV.cjs} +46 -15
- package/dist/chunk-7AECNMYV.cjs.map +1 -0
- package/dist/chunk-7IKLGH3Z.cjs +92 -0
- package/dist/chunk-7IKLGH3Z.cjs.map +1 -0
- package/dist/chunk-7RV6CAP6.cjs +106 -0
- package/dist/chunk-7RV6CAP6.cjs.map +1 -0
- package/dist/chunk-AHHFFXJR.cjs +230 -0
- package/dist/chunk-AHHFFXJR.cjs.map +1 -0
- package/dist/{chunk-HIDV32ZX.js → chunk-AHUYW673.js} +168 -9
- package/dist/chunk-AHUYW673.js.map +1 -0
- package/dist/{chunk-MYFZYUPR.cjs → chunk-AOHJILLU.cjs} +38 -3
- package/dist/chunk-AOHJILLU.cjs.map +1 -0
- package/dist/{chunk-DLBV42JD.js → chunk-ATOWMVZH.js} +157 -40
- package/dist/chunk-ATOWMVZH.js.map +1 -0
- package/dist/{chunk-WUNWHOLA.cjs → chunk-BSDBI6H7.cjs} +116 -26
- package/dist/chunk-BSDBI6H7.cjs.map +1 -0
- package/dist/chunk-CG4ZKJLE.js +84 -0
- package/dist/chunk-CG4ZKJLE.js.map +1 -0
- package/dist/{chunk-4PIW3Y5M.js → chunk-DJ4JPFWI.js} +3 -3
- package/dist/{chunk-4PIW3Y5M.js.map → chunk-DJ4JPFWI.js.map} +1 -1
- package/dist/{chunk-Z4PECE5S.js → chunk-DX64KLSN.js} +2 -2
- package/dist/{chunk-Z4PECE5S.js.map → chunk-DX64KLSN.js.map} +1 -1
- package/dist/{chunk-FDV7EQWH.js → chunk-EK6DYGFG.js} +3 -3
- package/dist/{chunk-FDV7EQWH.js.map → chunk-EK6DYGFG.js.map} +1 -1
- package/dist/{chunk-QUUBTNMH.js → chunk-EPSB4WTL.js} +45 -15
- package/dist/chunk-EPSB4WTL.js.map +1 -0
- package/dist/{chunk-KRGKPUJH.js → chunk-F2S6NV5N.js} +8 -8
- package/dist/{chunk-KRGKPUJH.js.map → chunk-F2S6NV5N.js.map} +1 -1
- package/dist/chunk-F57VRLKP.js +708 -0
- package/dist/chunk-F57VRLKP.js.map +1 -0
- package/dist/{chunk-26DPQUSB.cjs → chunk-G52YRAJC.cjs} +4 -4
- package/dist/{chunk-26DPQUSB.cjs.map → chunk-G52YRAJC.cjs.map} +1 -1
- package/dist/{chunk-5IDYOJHO.cjs → chunk-G7EQ3JPX.cjs} +45 -15
- package/dist/chunk-G7EQ3JPX.cjs.map +1 -0
- package/dist/{chunk-FKLUSYFP.cjs → chunk-GQVL2JKQ.cjs} +4 -4
- package/dist/{chunk-FKLUSYFP.cjs.map → chunk-GQVL2JKQ.cjs.map} +1 -1
- package/dist/{chunk-3D4ITDLO.js → chunk-GXODR6V4.js} +3 -3
- package/dist/{chunk-3D4ITDLO.js.map → chunk-GXODR6V4.js.map} +1 -1
- package/dist/{chunk-AFGADE3B.js → chunk-H3YO5GBM.js} +117 -27
- package/dist/chunk-H3YO5GBM.js.map +1 -0
- package/dist/chunk-HK3AMH3Q.cjs +151 -0
- package/dist/chunk-HK3AMH3Q.cjs.map +1 -0
- package/dist/chunk-HQ3XPCHG.js +114 -0
- package/dist/chunk-HQ3XPCHG.js.map +1 -0
- package/dist/chunk-I44YNYI6.cjs +4 -0
- package/dist/chunk-I44YNYI6.cjs.map +1 -0
- package/dist/chunk-JHZW3Y62.js +142 -0
- package/dist/chunk-JHZW3Y62.js.map +1 -0
- package/dist/{chunk-FTRGZOVJ.js → chunk-JQQABHDN.js} +3 -3
- package/dist/{chunk-FTRGZOVJ.js.map → chunk-JQQABHDN.js.map} +1 -1
- package/dist/chunk-JR4QIU54.cjs +291 -0
- package/dist/chunk-JR4QIU54.cjs.map +1 -0
- package/dist/{chunk-JDHIBJ5K.cjs → chunk-JWTCEWQ4.cjs} +2 -2
- package/dist/{chunk-JDHIBJ5K.cjs.map → chunk-JWTCEWQ4.cjs.map} +1 -1
- package/dist/{chunk-ZBI52NP2.cjs → chunk-K5GQPTTA.cjs} +158 -41
- package/dist/chunk-K5GQPTTA.cjs.map +1 -0
- package/dist/chunk-KFEN2SRZ.js +208 -0
- package/dist/chunk-KFEN2SRZ.js.map +1 -0
- package/dist/chunk-L6MDULYB.js +87 -0
- package/dist/chunk-L6MDULYB.js.map +1 -0
- package/dist/{chunk-RYQ3S3KO.cjs → chunk-LDCFNWJC.cjs} +5 -5
- package/dist/{chunk-RYQ3S3KO.cjs.map → chunk-LDCFNWJC.cjs.map} +1 -1
- package/dist/{chunk-LC7YHZXM.js → chunk-LDQ2T27A.js} +5 -5
- package/dist/{chunk-LC7YHZXM.js.map → chunk-LDQ2T27A.js.map} +1 -1
- package/dist/chunk-N5O47VGS.cjs +109 -0
- package/dist/chunk-N5O47VGS.cjs.map +1 -0
- package/dist/chunk-NGSDBWKA.cjs +84 -0
- package/dist/chunk-NGSDBWKA.cjs.map +1 -0
- package/dist/chunk-NMBYU7D7.cjs +31 -0
- package/dist/chunk-NMBYU7D7.cjs.map +1 -0
- package/dist/{chunk-SPWVKDGC.cjs → chunk-QMKYJ4AT.cjs} +4 -4
- package/dist/{chunk-SPWVKDGC.cjs.map → chunk-QMKYJ4AT.cjs.map} +1 -1
- package/dist/{chunk-RBS3GHDZ.cjs → chunk-QOJ4V7YX.cjs} +170 -10
- package/dist/chunk-QOJ4V7YX.cjs.map +1 -0
- package/dist/chunk-RUGHNFQG.js +28 -0
- package/dist/chunk-RUGHNFQG.js.map +1 -0
- package/dist/{chunk-P6L74SKG.js → chunk-SVZ4MQVQ.js} +48 -8
- package/dist/chunk-SVZ4MQVQ.js.map +1 -0
- package/dist/{chunk-URHXR5SC.cjs → chunk-TQZPYDUL.cjs} +7 -7
- package/dist/{chunk-URHXR5SC.cjs.map → chunk-TQZPYDUL.cjs.map} +1 -1
- package/dist/{chunk-MO65V64I.js → chunk-TXRQQMG5.js} +2 -2
- package/dist/{chunk-MO65V64I.js.map → chunk-TXRQQMG5.js.map} +1 -1
- package/dist/{chunk-EKRT7K2K.js → chunk-UJS3JTVT.js} +3 -3
- package/dist/{chunk-EKRT7K2K.js.map → chunk-UJS3JTVT.js.map} +1 -1
- package/dist/{chunk-6MMIWE7H.js → chunk-VQ5HJCTP.js} +386 -4
- package/dist/chunk-VQ5HJCTP.js.map +1 -0
- package/dist/chunk-WBGUYSWY.js +90 -0
- package/dist/chunk-WBGUYSWY.js.map +1 -0
- package/dist/{chunk-LJBWCUKP.cjs → chunk-WIYQI35R.cjs} +2 -2
- package/dist/{chunk-LJBWCUKP.cjs.map → chunk-WIYQI35R.cjs.map} +1 -1
- package/dist/chunk-WKSUL2ZN.js +56 -0
- package/dist/chunk-WKSUL2ZN.js.map +1 -0
- package/dist/{chunk-BOOJDRJO.js → chunk-WSNMQQ4P.js} +38 -3
- package/dist/chunk-WSNMQQ4P.js.map +1 -0
- package/dist/chunk-X5ZPYYMS.js +105 -0
- package/dist/chunk-X5ZPYYMS.js.map +1 -0
- package/dist/{chunk-XB54G7WS.cjs → chunk-XJTFZLWH.cjs} +2 -86
- package/dist/chunk-XJTFZLWH.cjs.map +1 -0
- package/dist/{chunk-GTHNWP4P.js → chunk-XUVEF2RQ.js} +4 -87
- package/dist/chunk-XUVEF2RQ.js.map +1 -0
- package/dist/chunk-Y6YSJPVC.js +129 -0
- package/dist/chunk-Y6YSJPVC.js.map +1 -0
- package/dist/{chunk-OAHORW4N.cjs → chunk-YRLCR76L.cjs} +129 -99
- package/dist/chunk-YRLCR76L.cjs.map +1 -0
- package/dist/chunk-YVIH26FG.cjs +736 -0
- package/dist/chunk-YVIH26FG.cjs.map +1 -0
- package/dist/chunk-Z5S5JEJD.cjs +286 -0
- package/dist/chunk-Z5S5JEJD.cjs.map +1 -0
- package/dist/chunk-ZO4L6C2Y.cjs +137 -0
- package/dist/chunk-ZO4L6C2Y.cjs.map +1 -0
- package/dist/{collabKit-QZL4P5T5.js → collabKit-A643VH2I.js} +7 -3
- package/dist/collabKit-A643VH2I.js.map +1 -0
- package/dist/{collabKit-UF7E6V3N.cjs → collabKit-Q4A36LDA.cjs} +7 -3
- package/dist/collabKit-Q4A36LDA.cjs.map +1 -0
- package/dist/components/Accordion/index.cjs +13 -0
- package/dist/components/Accordion/index.cjs.map +1 -0
- package/dist/components/Accordion/index.d.cts +50 -0
- package/dist/components/Accordion/index.d.ts +50 -0
- package/dist/components/Accordion/index.js +4 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Autocomplete/index.cjs +5 -4
- package/dist/components/Autocomplete/index.d.cts +20 -3
- package/dist/components/Autocomplete/index.d.ts +20 -3
- package/dist/components/Autocomplete/index.js +4 -3
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Card/index.d.cts +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Checkbox/index.cjs +5 -4
- package/dist/components/Checkbox/index.d.cts +9 -1
- package/dist/components/Checkbox/index.d.ts +9 -1
- package/dist/components/Checkbox/index.js +2 -1
- package/dist/components/ClampedText/index.cjs +13 -0
- package/dist/components/ClampedText/index.cjs.map +1 -0
- package/dist/components/ClampedText/index.d.cts +33 -0
- package/dist/components/ClampedText/index.d.ts +33 -0
- package/dist/components/ClampedText/index.js +4 -0
- package/dist/components/ClampedText/index.js.map +1 -0
- package/dist/components/CopyButton/index.cjs +13 -0
- package/dist/components/CopyButton/index.cjs.map +1 -0
- package/dist/components/CopyButton/index.d.cts +29 -0
- package/dist/components/CopyButton/index.d.ts +29 -0
- package/dist/components/CopyButton/index.js +4 -0
- package/dist/components/CopyButton/index.js.map +1 -0
- package/dist/components/CountryCodeDropdown/index.cjs +5 -5
- package/dist/components/CountryCodeDropdown/index.js +2 -2
- package/dist/components/CustomizableDashboard/index.cjs +43 -0
- package/dist/components/CustomizableDashboard/index.cjs.map +1 -0
- package/dist/components/CustomizableDashboard/index.d.cts +195 -0
- package/dist/components/CustomizableDashboard/index.d.ts +195 -0
- package/dist/components/CustomizableDashboard/index.js +10 -0
- package/dist/components/CustomizableDashboard/index.js.map +1 -0
- package/dist/components/DateInput/index.cjs +5 -4
- package/dist/components/DateInput/index.d.cts +1 -0
- package/dist/components/DateInput/index.d.ts +1 -0
- package/dist/components/DateInput/index.js +4 -3
- package/dist/components/Dropdown/index.cjs +14 -9
- package/dist/components/Dropdown/index.d.cts +38 -2
- package/dist/components/Dropdown/index.d.ts +38 -2
- package/dist/components/Dropdown/index.js +4 -3
- package/dist/components/FilterSummaryBar/index.cjs +13 -0
- package/dist/components/FilterSummaryBar/index.cjs.map +1 -0
- package/dist/components/FilterSummaryBar/index.d.cts +53 -0
- package/dist/components/FilterSummaryBar/index.d.ts +53 -0
- package/dist/components/FilterSummaryBar/index.js +4 -0
- package/dist/components/FilterSummaryBar/index.js.map +1 -0
- package/dist/components/FreshnessBadge/index.cjs +25 -0
- package/dist/components/FreshnessBadge/index.cjs.map +1 -0
- package/dist/components/FreshnessBadge/index.d.cts +49 -0
- package/dist/components/FreshnessBadge/index.d.ts +49 -0
- package/dist/components/FreshnessBadge/index.js +4 -0
- package/dist/components/FreshnessBadge/index.js.map +1 -0
- package/dist/components/GlossaryTooltip/index.cjs +15 -0
- package/dist/components/GlossaryTooltip/index.cjs.map +1 -0
- package/dist/components/GlossaryTooltip/index.d.cts +64 -0
- package/dist/components/GlossaryTooltip/index.d.ts +64 -0
- package/dist/components/GlossaryTooltip/index.js +6 -0
- package/dist/components/GlossaryTooltip/index.js.map +1 -0
- package/dist/components/Input/index.cjs +20 -3
- package/dist/components/Input/index.d.cts +37 -2
- package/dist/components/Input/index.d.ts +37 -2
- package/dist/components/Input/index.js +2 -1
- package/dist/components/KeyboardShortcutsOverlay/index.cjs +21 -0
- package/dist/components/KeyboardShortcutsOverlay/index.cjs.map +1 -0
- package/dist/components/KeyboardShortcutsOverlay/index.d.cts +54 -0
- package/dist/components/KeyboardShortcutsOverlay/index.d.ts +54 -0
- package/dist/components/KeyboardShortcutsOverlay/index.js +8 -0
- package/dist/components/KeyboardShortcutsOverlay/index.js.map +1 -0
- package/dist/components/Markdown/index.cjs +10 -10
- package/dist/components/Markdown/index.js +2 -2
- package/dist/components/MediaEditor/index.cjs +11 -10
- package/dist/components/MediaEditor/index.js +6 -5
- package/dist/components/PhoneInput/index.cjs +5 -4
- package/dist/components/PhoneInput/index.js +3 -2
- package/dist/components/Progress/index.d.cts +1 -1
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/Radio/index.cjs +5 -4
- package/dist/components/Radio/index.d.cts +9 -1
- package/dist/components/Radio/index.d.ts +9 -1
- package/dist/components/Radio/index.js +2 -1
- package/dist/components/ReadingProgressBar/index.cjs +13 -0
- package/dist/components/ReadingProgressBar/index.cjs.map +1 -0
- package/dist/components/ReadingProgressBar/index.d.cts +20 -0
- package/dist/components/ReadingProgressBar/index.d.ts +20 -0
- package/dist/components/ReadingProgressBar/index.js +4 -0
- package/dist/components/ReadingProgressBar/index.js.map +1 -0
- package/dist/components/RichTextEditor/index.cjs +8 -7
- package/dist/components/RichTextEditor/index.js +5 -4
- package/dist/components/SectionSpyNav/index.cjs +15 -0
- package/dist/components/SectionSpyNav/index.cjs.map +1 -0
- package/dist/components/SectionSpyNav/index.d.cts +63 -0
- package/dist/components/SectionSpyNav/index.d.ts +63 -0
- package/dist/components/SectionSpyNav/index.js +6 -0
- package/dist/components/SectionSpyNav/index.js.map +1 -0
- package/dist/components/Select/index.cjs +6 -4
- package/dist/components/Select/index.d.cts +56 -9
- package/dist/components/Select/index.d.ts +56 -9
- package/dist/components/Select/index.js +4 -2
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/SourceTip/index.cjs +15 -0
- package/dist/components/SourceTip/index.cjs.map +1 -0
- package/dist/components/SourceTip/index.d.cts +58 -0
- package/dist/components/SourceTip/index.d.ts +58 -0
- package/dist/components/SourceTip/index.js +6 -0
- package/dist/components/SourceTip/index.js.map +1 -0
- package/dist/components/Sparkline/index.cjs +13 -0
- package/dist/components/Sparkline/index.cjs.map +1 -0
- package/dist/components/Sparkline/index.d.cts +53 -0
- package/dist/components/Sparkline/index.d.ts +53 -0
- package/dist/components/Sparkline/index.js +4 -0
- package/dist/components/Sparkline/index.js.map +1 -0
- package/dist/components/Spinner/index.d.cts +1 -1
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/SuperChat/index.cjs +252 -93
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.d.cts +13 -5
- package/dist/components/SuperChat/index.d.ts +13 -5
- package/dist/components/SuperChat/index.js +249 -90
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +6 -26
- package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
- package/dist/components/SuperChat/plugins/index.d.cts +2 -2
- package/dist/components/SuperChat/plugins/index.d.ts +2 -2
- package/dist/components/SuperChat/plugins/index.js +4 -24
- package/dist/components/SuperChat/plugins/index.js.map +1 -1
- package/dist/components/Text/index.d.cts +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Textarea/index.cjs +5 -3
- package/dist/components/Textarea/index.d.cts +19 -1
- package/dist/components/Textarea/index.d.ts +19 -1
- package/dist/components/Textarea/index.js +3 -1
- package/dist/datavis.cjs +1 -1
- package/dist/datavis.js +1 -1
- package/dist/esheet.cjs +12 -11
- package/dist/esheet.cjs.map +1 -1
- package/dist/esheet.js +9 -8
- package/dist/esheet.js.map +1 -1
- package/dist/hooks/index.cjs +29 -19
- package/dist/hooks/index.d.cts +17 -2
- package/dist/hooks/index.d.ts +17 -2
- package/dist/hooks/index.js +4 -2
- package/dist/index.cjs +2965 -2043
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +193 -48
- package/dist/index.d.ts +193 -48
- package/dist/index.js +2135 -1330
- package/dist/index.js.map +1 -1
- package/dist/kerebron.cjs +200 -68
- package/dist/kerebron.cjs.map +1 -1
- package/dist/kerebron.css +129 -0
- package/dist/kerebron.d.cts +52 -3
- package/dist/kerebron.d.ts +52 -3
- package/dist/kerebron.js +201 -69
- package/dist/kerebron.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/{types-BoTeTPdH.d.ts → types-9vK_YdEb.d.ts} +12 -1
- package/dist/{types-DyIB9HYT.d.cts → types-DZDroUW8.d.cts} +12 -1
- package/dist/{useAnchoredPosition-C7PNglzD.d.cts → useAnchoredPosition-CKwLSQW8.d.cts} +10 -3
- package/dist/{useAnchoredPosition-C7PNglzD.d.ts → useAnchoredPosition-CKwLSQW8.d.ts} +10 -3
- package/dist/utils/index.cjs +9 -9
- package/dist/utils/index.js +1 -1
- package/package.json +13 -4
- package/dist/chunk-5IDYOJHO.cjs.map +0 -1
- package/dist/chunk-6ECKH4DJ.cjs +0 -147
- package/dist/chunk-6ECKH4DJ.cjs.map +0 -1
- package/dist/chunk-6J7UGYT5.cjs.map +0 -1
- package/dist/chunk-6MMIWE7H.js.map +0 -1
- package/dist/chunk-AFGADE3B.js.map +0 -1
- package/dist/chunk-BOOJDRJO.js.map +0 -1
- package/dist/chunk-DLBV42JD.js.map +0 -1
- package/dist/chunk-EGWWTIWS.js.map +0 -1
- package/dist/chunk-GTHNWP4P.js.map +0 -1
- package/dist/chunk-HIDV32ZX.js.map +0 -1
- package/dist/chunk-KFLDXJEE.js.map +0 -1
- package/dist/chunk-LJDBD2DD.cjs.map +0 -1
- package/dist/chunk-MYFZYUPR.cjs.map +0 -1
- package/dist/chunk-OAHORW4N.cjs.map +0 -1
- package/dist/chunk-P6L74SKG.js.map +0 -1
- package/dist/chunk-QUUBTNMH.js.map +0 -1
- package/dist/chunk-RBS3GHDZ.cjs.map +0 -1
- package/dist/chunk-S3MKIDYG.cjs.map +0 -1
- package/dist/chunk-WUNWHOLA.cjs.map +0 -1
- package/dist/chunk-XB54G7WS.cjs.map +0 -1
- package/dist/chunk-YXCE2HSK.js +0 -124
- package/dist/chunk-YXCE2HSK.js.map +0 -1
- package/dist/chunk-ZBI52NP2.cjs.map +0 -1
- package/dist/collabKit-QZL4P5T5.js.map +0 -1
- package/dist/collabKit-UF7E6V3N.cjs.map +0 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkRDGRKYQ5_cjs = require('./chunk-RDGRKYQ5.cjs');
|
|
4
|
+
var chunk7IKLGH3Z_cjs = require('./chunk-7IKLGH3Z.cjs');
|
|
5
|
+
var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var lucideReact = require('lucide-react');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
+
|
|
30
|
+
function CtaArrow({ href }) {
|
|
31
|
+
const Icon = href.startsWith("#") ? lucideReact.ArrowDown : href.startsWith("/") ? lucideReact.ArrowRight : lucideReact.ArrowUpRight;
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true", className: "h-3.5 w-3.5" });
|
|
33
|
+
}
|
|
34
|
+
var CTA_TIER_VARIANT = {
|
|
35
|
+
explore: "ghost",
|
|
36
|
+
evaluate: "outline",
|
|
37
|
+
commit: "primary"
|
|
38
|
+
};
|
|
39
|
+
function SectionSpyNav({
|
|
40
|
+
items,
|
|
41
|
+
cta,
|
|
42
|
+
label = "On this page",
|
|
43
|
+
tone = "surface",
|
|
44
|
+
rootMargin = "-22% 0px -68% 0px",
|
|
45
|
+
onItemClick,
|
|
46
|
+
onCtaClick,
|
|
47
|
+
className
|
|
48
|
+
}) {
|
|
49
|
+
const ids = React__namespace.useMemo(() => items.map((it) => it.id), [items]);
|
|
50
|
+
const { activeId } = chunk7IKLGH3Z_cjs.useScrollSpy({ ids, rootMargin });
|
|
51
|
+
const active = activeId ?? items[0]?.id ?? "";
|
|
52
|
+
const railRef = React__namespace.useRef(null);
|
|
53
|
+
const markRef = React__namespace.useRef(null);
|
|
54
|
+
const findActiveLink = React__namespace.useCallback(() => {
|
|
55
|
+
const links = railRef.current?.querySelectorAll("a");
|
|
56
|
+
if (!links) return null;
|
|
57
|
+
for (const link of links) {
|
|
58
|
+
if (link.dataset.id === active) return link;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}, [active]);
|
|
62
|
+
const syncMarker = React__namespace.useCallback(() => {
|
|
63
|
+
const link = findActiveLink();
|
|
64
|
+
const mark = markRef.current;
|
|
65
|
+
if (!link || !mark) return;
|
|
66
|
+
mark.style.left = `${link.offsetLeft}px`;
|
|
67
|
+
mark.style.width = `${link.offsetWidth}px`;
|
|
68
|
+
}, [findActiveLink]);
|
|
69
|
+
React__namespace.useEffect(() => {
|
|
70
|
+
const link = findActiveLink();
|
|
71
|
+
link?.scrollIntoView?.({ inline: "center", block: "nearest" });
|
|
72
|
+
syncMarker();
|
|
73
|
+
}, [findActiveLink, syncMarker]);
|
|
74
|
+
React__namespace.useEffect(() => {
|
|
75
|
+
window.addEventListener("resize", syncMarker);
|
|
76
|
+
return () => window.removeEventListener("resize", syncMarker);
|
|
77
|
+
}, [syncMarker]);
|
|
78
|
+
const brand = tone === "brand";
|
|
79
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
"nav",
|
|
81
|
+
{
|
|
82
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
83
|
+
"sticky top-0 z-30 w-full",
|
|
84
|
+
brand ? "bg-primary-900 text-white" : "border-border bg-card/95 border-b backdrop-blur",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
"aria-label": label,
|
|
88
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 px-4 py-0.5", children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
93
|
+
"shrink-0 text-[11px] font-semibold tracking-wide uppercase max-md:hidden",
|
|
94
|
+
brand ? "text-white/85" : "text-muted-foreground"
|
|
95
|
+
),
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
children: label
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
ref: railRef,
|
|
104
|
+
className: "relative flex min-w-0 flex-1 gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
105
|
+
children: [
|
|
106
|
+
items.map((it) => {
|
|
107
|
+
const isActive = active === it.id;
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
"a",
|
|
110
|
+
{
|
|
111
|
+
href: `#${it.id}`,
|
|
112
|
+
"data-id": it.id,
|
|
113
|
+
onClick: () => onItemClick?.(it.id),
|
|
114
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
115
|
+
"shrink-0 rounded px-2.5 py-2 text-sm whitespace-nowrap transition-colors",
|
|
116
|
+
brand ? isActive ? "font-semibold text-white" : "text-white/85 hover:text-white" : isActive ? "text-foreground font-semibold" : "text-muted-foreground hover:text-foreground"
|
|
117
|
+
),
|
|
118
|
+
"aria-current": isActive ? "location" : void 0,
|
|
119
|
+
children: it.label
|
|
120
|
+
},
|
|
121
|
+
it.id
|
|
122
|
+
);
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
125
|
+
"span",
|
|
126
|
+
{
|
|
127
|
+
ref: markRef,
|
|
128
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
129
|
+
"absolute bottom-0 h-0.5 rounded-full transition-[left,width] duration-300",
|
|
130
|
+
brand ? "bg-primary-400" : "bg-primary-500"
|
|
131
|
+
),
|
|
132
|
+
"aria-hidden": "true"
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
cta && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
139
|
+
"a",
|
|
140
|
+
{
|
|
141
|
+
href: cta.href,
|
|
142
|
+
onClick: () => onCtaClick?.(cta),
|
|
143
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
144
|
+
chunkRDGRKYQ5_cjs.buttonVariants({
|
|
145
|
+
variant: CTA_TIER_VARIANT[cta.tier ?? "explore"],
|
|
146
|
+
size: "sm"
|
|
147
|
+
}),
|
|
148
|
+
"shrink-0",
|
|
149
|
+
brand && (cta.tier ?? "explore") !== "commit" && "text-white hover:bg-white/10 hover:text-white"
|
|
150
|
+
),
|
|
151
|
+
children: [
|
|
152
|
+
cta.label,
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(CtaArrow, { href: cta.href })
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
] })
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
exports.SectionSpyNav = SectionSpyNav;
|
|
163
|
+
//# sourceMappingURL=chunk-5JZIDILK.cjs.map
|
|
164
|
+
//# sourceMappingURL=chunk-5JZIDILK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/SectionSpyNav/SectionSpyNav.tsx"],"names":["ArrowDown","ArrowRight","ArrowUpRight","jsx","React","useScrollSpy","cn","jsxs","buttonVariants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,SAAS,QAAA,CAAS,EAAE,IAAA,EAAK,EAAqB;AAC5C,EAAA,MAAM,IAAA,GAAO,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,GAC5BA,wBACA,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,GACjBC,sBAAA,GACAC,wBAAA;AACN,EAAA,uBAAOC,cAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAY,MAAA,EAAO,WAAU,aAAA,EAAc,CAAA;AAC1D;AAEA,IAAM,gBAAA,GAAmB;AAAA,EACvB,OAAA,EAAS,OAAA;AAAA,EACT,QAAA,EAAU,SAAA;AAAA,EACV,MAAA,EAAQ;AACV,CAAA;AA2BO,SAAS,aAAA,CAAc;AAAA,EAC5B,KAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA,GAAQ,cAAA;AAAA,EACR,IAAA,GAAO,SAAA;AAAA,EACP,UAAA,GAAa,mBAAA;AAAA,EACb,WAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAAuB;AACrB,EAAA,MAAM,GAAA,GAAYC,gBAAA,CAAA,OAAA,CAAQ,MAAM,KAAA,C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EAAA,EAAS,IAAA,EAAM,GAAA,CAAI,IAAA,EAAM;AAAA;AAAA;AAAA;AAC5B,OAAA,EAEJ;AAAA;AAAA,GACF;AAEJ","file":"chunk-5JZIDILK.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ArrowDown, ArrowRight, ArrowUpRight } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { useScrollSpy } from '../../hooks/useScrollSpy';\nimport { buttonVariants } from '../Button';\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/** One section the nav links to. The id must match a `section[id]` on the page. */\nexport interface SectionSpyItem {\n id: string;\n label: string;\n}\n\n/**\n * Funnel intent for the bar's single contextual CTA — drives its visual\n * weight so the in-page strip never out-shouts a page's primary CTA:\n * `explore` (quiet next step) → `evaluate` (sales-ready ask) → `commit`\n * (high-intent action).\n */\nexport type SectionSpyCtaTier = 'explore' | 'evaluate' | 'commit';\n\nexport interface SectionSpyCta {\n label: string;\n href: string;\n tier?: SectionSpyCtaTier;\n}\n\nexport interface SectionSpyNavProps {\n /** Sections to link to, in page order. */\n items: SectionSpyItem[];\n /** Optional single page-specific next-step CTA at the end of the bar. */\n cta?: SectionSpyCta;\n /** Eyebrow before the links (default \"On this page\"). */\n label?: string;\n /**\n * Visual tone: `surface` sits on the page background; `brand` renders the\n * inverted primary band.\n */\n tone?: 'surface' | 'brand';\n /** IntersectionObserver root margin tuning for the scroll spy. */\n rootMargin?: string;\n /** Called with the section id when a nav link is clicked. */\n onItemClick?: (id: string) => void;\n /** Called when the CTA is clicked (e.g. for analytics). */\n onCtaClick?: (cta: SectionSpyCta) => void;\n className?: string;\n}\n\n// =============================================================================\n// Internals\n// =============================================================================\n\n/** Directional glyph inferred from the destination. */\nfunction CtaArrow({ href }: { href: string }) {\n const Icon = href.startsWith('#')\n ? ArrowDown\n : href.startsWith('/')\n ? ArrowRight\n : ArrowUpRight;\n return <Icon aria-hidden=\"true\" className=\"h-3.5 w-3.5\" />;\n}\n\nconst CTA_TIER_VARIANT = {\n explore: 'ghost',\n evaluate: 'outline',\n commit: 'primary',\n} as const;\n\n// =============================================================================\n// SectionSpyNav\n// =============================================================================\n\n/**\n * Sticky horizontal in-page wayfinding: jumps between a page's major\n * sections, highlights the one in view with a sliding underline, and can\n * carry a single page-specific next-step CTA. Pure anchor links, so it\n * still works if the scroll spy never runs.\n *\n * The horizontal complement to `TableOfContents` — use that for a sidebar\n * outline, this for a band under the page header. Section elements need\n * matching `id`s.\n *\n * @example\n * ```tsx\n * <SectionSpyNav\n * items={[\n * { id: 'overview', label: 'Overview' },\n * { id: 'pricing', label: 'Pricing' },\n * ]}\n * cta={{ label: 'Book a demo', href: '/demo', tier: 'evaluate' }}\n * />\n * ```\n */\nexport function SectionSpyNav({\n items,\n cta,\n label = 'On this page',\n tone = 'surface',\n rootMargin = '-22% 0px -68% 0px',\n onItemClick,\n onCtaClick,\n className,\n}: SectionSpyNavProps) {\n const ids = React.useMemo(() => items.map((it) => it.id), [items]);\n const { activeId } = useScrollSpy({ ids, rootMargin });\n const active = activeId ?? items[0]?.id ?? '';\n\n const railRef = React.useRef<HTMLDivElement>(null);\n const markRef = React.useRef<HTMLSpanElement>(null);\n\n // Find the active link by dataset rather than a CSS selector, so ids\n // never need escaping and CSS.escape availability doesn't matter.\n const findActiveLink = React.useCallback((): HTMLAnchorElement | null => {\n const links = railRef.current?.querySelectorAll<HTMLAnchorElement>('a');\n if (!links) return null;\n for (const link of links) {\n if (link.dataset.id === active) return link;\n }\n return null;\n }, [active]);\n\n // Slide the underline beneath the active link. offsetLeft/offsetWidth are\n // physical and measured against the rail, so the marker tracks the link\n // in both directions and while the rail is scrolled horizontally.\n const syncMarker = React.useCallback(() => {\n const link = findActiveLink();\n const mark = markRef.current;\n if (!link || !mark) return;\n mark.style.left = `${link.offsetLeft}px`;\n mark.style.width = `${link.offsetWidth}px`;\n }, [findActiveLink]);\n\n React.useEffect(() => {\n const link = findActiveLink();\n link?.scrollIntoView?.({ inline: 'center', block: 'nearest' });\n syncMarker();\n }, [findActiveLink, syncMarker]);\n\n React.useEffect(() => {\n window.addEventListener('resize', syncMarker);\n return () => window.removeEventListener('resize', syncMarker);\n }, [syncMarker]);\n\n const brand = tone === 'brand';\n\n return (\n <nav\n className={cn(\n 'sticky top-0 z-30 w-full',\n brand\n ? 'bg-primary-900 text-white'\n : 'border-border bg-card/95 border-b backdrop-blur',\n className\n )}\n aria-label={label}\n >\n <div className=\"flex items-center gap-4 px-4 py-0.5\">\n <span\n className={cn(\n 'shrink-0 text-[11px] font-semibold tracking-wide uppercase max-md:hidden',\n brand ? 'text-white/85' : 'text-muted-foreground'\n )}\n aria-hidden=\"true\"\n >\n {label}\n </span>\n <div\n ref={railRef}\n className=\"relative flex min-w-0 flex-1 gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n >\n {items.map((it) => {\n const isActive = active === it.id;\n return (\n <a\n key={it.id}\n href={`#${it.id}`}\n data-id={it.id}\n onClick={() => onItemClick?.(it.id)}\n className={cn(\n 'shrink-0 rounded px-2.5 py-2 text-sm whitespace-nowrap transition-colors',\n brand\n ? isActive\n ? 'font-semibold text-white'\n : 'text-white/85 hover:text-white'\n : isActive\n ? 'text-foreground font-semibold'\n : 'text-muted-foreground hover:text-foreground'\n )}\n aria-current={isActive ? 'location' : undefined}\n >\n {it.label}\n </a>\n );\n })}\n <span\n ref={markRef}\n className={cn(\n 'absolute bottom-0 h-0.5 rounded-full transition-[left,width] duration-300',\n brand ? 'bg-primary-400' : 'bg-primary-500'\n )}\n aria-hidden=\"true\"\n />\n </div>\n {cta && (\n <a\n href={cta.href}\n onClick={() => onCtaClick?.(cta)}\n className={cn(\n buttonVariants({\n variant: CTA_TIER_VARIANT[cta.tier ?? 'explore'],\n size: 'sm',\n }),\n 'shrink-0',\n brand &&\n (cta.tier ?? 'explore') !== 'commit' &&\n 'text-white hover:bg-white/10 hover:text-white'\n )}\n >\n {cta.label}\n <CtaArrow href={cta.href} />\n </a>\n )}\n </div>\n </nav>\n );\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkS5RVSXDV_cjs = require('./chunk-S5RVSXDV.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var ReadingProgressBar = React__namespace.forwardRef(function ReadingProgressBar2({ className, barClassName, ...props }, ref) {
|
|
28
|
+
const [pct, setPct] = React__namespace.useState(0);
|
|
29
|
+
React__namespace.useEffect(() => {
|
|
30
|
+
let rafId = 0;
|
|
31
|
+
const update = () => {
|
|
32
|
+
const el = document.documentElement;
|
|
33
|
+
const max = el.scrollHeight - el.clientHeight;
|
|
34
|
+
setPct(
|
|
35
|
+
max > 0 ? Math.min(100, Math.max(0, el.scrollTop / max * 100)) : 0
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const schedule = () => {
|
|
39
|
+
cancelAnimationFrame(rafId);
|
|
40
|
+
rafId = requestAnimationFrame(update);
|
|
41
|
+
};
|
|
42
|
+
update();
|
|
43
|
+
window.addEventListener("scroll", schedule, { passive: true });
|
|
44
|
+
window.addEventListener("resize", schedule);
|
|
45
|
+
return () => {
|
|
46
|
+
cancelAnimationFrame(rafId);
|
|
47
|
+
window.removeEventListener("scroll", schedule);
|
|
48
|
+
window.removeEventListener("resize", schedule);
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
...props,
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
58
|
+
"pointer-events-none fixed inset-x-0 top-0 z-50 h-1 bg-transparent",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "reading-progress-fill",
|
|
65
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
66
|
+
"h-full transition-[width] duration-150",
|
|
67
|
+
barClassName ?? "bg-primary-500"
|
|
68
|
+
),
|
|
69
|
+
style: { width: `${pct}%` }
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
exports.ReadingProgressBar = ReadingProgressBar;
|
|
77
|
+
//# sourceMappingURL=chunk-5MXO6PEV.cjs.map
|
|
78
|
+
//# sourceMappingURL=chunk-5MXO6PEV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ReadingProgressBar/ReadingProgressBar.tsx"],"names":["React","ReadingProgressBar","jsx","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,IAAM,kBAAA,GAA2BA,gBAAA,CAAA,UAAA,CAGtC,SAASC,mBAAAA,CAAmB,EAAE,WAAW,YAAA,EAAc,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACxE,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAUD,0BAAS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A;AAAA,UACC,WAAA,EAAU,uBAAA;AAAA,UACV,SAAA,EAAWC,oBAAA;AAAA,YACT,wCAAA;AAAA,YACA,YAAA,IAAgB;AAAA,WAClB;AAAA,UACA,KAAA,EAAO,EAAE,KAAA,EAAO,CAAA,EAAG,GAAG,CAAA,CAAA,CAAA;AAAI;AAAA;AAC5B;AAAA,GACF;AAEJ,CAAC","file":"chunk-5MXO6PEV.cjs","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface ReadingProgressBarProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** Class for the filled bar (default `bg-primary-500`). */\n barClassName?: string;\n}\n\n/**\n * A thin progress bar pinned to the top of the viewport, tracking how far\n * the reader has scrolled through the document. Purely decorative\n * (`aria-hidden`) — long-form articles, guides, reports.\n *\n * @example\n * ```tsx\n * <ReadingProgressBar />\n * <ReadingProgressBar barClassName=\"bg-warning\" className=\"h-0.5\" />\n * ```\n */\nexport const ReadingProgressBar = React.forwardRef<\n HTMLDivElement,\n ReadingProgressBarProps\n>(function ReadingProgressBar({ className, barClassName, ...props }, ref) {\n const [pct, setPct] = React.useState(0);\n\n React.useEffect(() => {\n let rafId = 0;\n\n const update = () => {\n const el = document.documentElement;\n const max = el.scrollHeight - el.clientHeight;\n setPct(\n max > 0 ? Math.min(100, Math.max(0, (el.scrollTop / max) * 100)) : 0\n );\n };\n\n // Coalesce bursty scroll events to one state update per frame\n const schedule = () => {\n cancelAnimationFrame(rafId);\n rafId = requestAnimationFrame(update);\n };\n\n update();\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule);\n return () => {\n cancelAnimationFrame(rafId);\n window.removeEventListener('scroll', schedule);\n window.removeEventListener('resize', schedule);\n };\n }, []);\n\n return (\n <div\n ref={ref}\n {...props}\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none fixed inset-x-0 top-0 z-50 h-1 bg-transparent',\n className\n )}\n >\n <div\n data-slot=\"reading-progress-fill\"\n className={cn(\n 'h-full transition-[width] duration-150',\n barClassName ?? 'bg-primary-500'\n )}\n style={{ width: `${pct}%` }}\n />\n </div>\n );\n});\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cn } from './chunk-TQONQSJO.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Check, Copy } from 'lucide-react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var CopyButton = React.forwardRef(
|
|
7
|
+
function CopyButton2({
|
|
8
|
+
value,
|
|
9
|
+
label = "Copy",
|
|
10
|
+
copiedLabel = "Copied",
|
|
11
|
+
timeout = 1200,
|
|
12
|
+
onCopied,
|
|
13
|
+
className,
|
|
14
|
+
onClick,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
const [copied, setCopied] = React.useState(false);
|
|
18
|
+
const timer = React.useRef(null);
|
|
19
|
+
React.useEffect(
|
|
20
|
+
() => () => {
|
|
21
|
+
if (timer.current) clearTimeout(timer.current);
|
|
22
|
+
},
|
|
23
|
+
[]
|
|
24
|
+
);
|
|
25
|
+
const handleClick = async (e) => {
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
onClick?.(e);
|
|
29
|
+
try {
|
|
30
|
+
await navigator.clipboard.writeText(value);
|
|
31
|
+
setCopied(true);
|
|
32
|
+
onCopied?.(value);
|
|
33
|
+
if (timer.current) clearTimeout(timer.current);
|
|
34
|
+
timer.current = setTimeout(() => setCopied(false), timeout);
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
type: "button",
|
|
43
|
+
onClick: handleClick,
|
|
44
|
+
title: copied ? copiedLabel : label,
|
|
45
|
+
"aria-label": copied ? copiedLabel : label,
|
|
46
|
+
className: cn(
|
|
47
|
+
"inline-flex shrink-0 items-center justify-center rounded p-1 transition-colors",
|
|
48
|
+
"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none",
|
|
49
|
+
copied ? "text-success" : "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props,
|
|
53
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(Copy, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
CopyButton.displayName = "CopyButton";
|
|
59
|
+
|
|
60
|
+
export { CopyButton };
|
|
61
|
+
//# sourceMappingURL=chunk-5QZ73PZC.js.map
|
|
62
|
+
//# sourceMappingURL=chunk-5QZ73PZC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/CopyButton/CopyButton.tsx"],"names":["CopyButton"],"mappings":";;;;;AAkCO,IAAM,UAAA,GAAmB,KAAA,CAAA,UAAA;AAAA,EAC9B,SAASA,WAAAA,CACP;AAAA,IACE,KAAA;AAAA,IACA,KAAA,GAAQ,MAAA;AAAA,IACR,WAAA,GAAc,QAAA;AAAA,IACd,OAAA,GAAU,IAAA;AAAA,IACV,QAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,EACA;AACA,IAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAU,eAAS,KAAK,CAAA;AAChD,IAAA,MAAM,KAAA,GAAc,aAA6C,IAAI,CAAA;AAErE,IAAM,KAAA,CAAA,SAAA;AAAA,MACJ,MAAM,MAAM;AACV,QAAA,IAAI,KAAA,CAAM,OAAA,EAAS,YAAA,CAAa,KAAA,CAAM,OAAO,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA;AAAC,KACH;A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nimport { Check, Copy } from 'lucide-react';\nimport { cn } from '../../utils/cn';\n\nexport interface CopyButtonProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n 'value'\n> {\n /** Text written to the clipboard. */\n value: string;\n /** Accessible label / tooltip (default \"Copy\"). */\n label?: string;\n /** Label while the copied state shows (default \"Copied\"). */\n copiedLabel?: string;\n /** How long the copied state shows, in ms (default 1200). */\n timeout?: number;\n /** Called after a successful copy. */\n onCopied?: (value: string) => void;\n}\n\n/**\n * An inline copy-to-clipboard icon button with a brief success check.\n * Copied state is isolated per instance — safe to drop into table rows,\n * ID chips, and detail fields.\n *\n * @example\n * ```tsx\n * <span className=\"flex items-center gap-1\">\n * MRN WC-10382 <CopyButton value=\"WC-10382\" label=\"Copy MRN\" />\n * </span>\n * ```\n */\nexport const CopyButton = React.forwardRef<HTMLButtonElement, CopyButtonProps>(\n function CopyButton(\n {\n value,\n label = 'Copy',\n copiedLabel = 'Copied',\n timeout = 1200,\n onCopied,\n className,\n onClick,\n ...props\n },\n ref\n ) {\n const [copied, setCopied] = React.useState(false);\n const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n React.useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n []\n );\n\n const handleClick = async (e: React.MouseEvent<HTMLButtonElement>) => {\n // Inside clickable rows/links the copy must not trigger the row action\n e.stopPropagation();\n e.preventDefault();\n onClick?.(e);\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopied?.(value);\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setCopied(false), timeout);\n } catch {\n /* clipboard access denied — silent */\n }\n };\n\n return (\n <button\n ref={ref}\n type=\"button\"\n onClick={handleClick}\n title={copied ? copiedLabel : label}\n aria-label={copied ? copiedLabel : label}\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded p-1 transition-colors',\n 'focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none',\n copied\n ? 'text-success'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n className\n )}\n {...props}\n >\n {copied ? (\n <Check aria-hidden=\"true\" className=\"h-3.5 w-3.5\" />\n ) : (\n <Copy aria-hidden=\"true\" className=\"h-3.5 w-3.5\" />\n )}\n </button>\n );\n }\n);\n\nCopyButton.displayName = 'CopyButton';\n"]}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { useEscapeKey } from './chunk-T4ME7QCT.js';
|
|
2
|
+
import { useAnchoredPosition } from './chunk-WSNMQQ4P.js';
|
|
3
|
+
import { cn } from './chunk-TQONQSJO.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
6
|
+
import { X, Diamond, ArrowRight } from 'lucide-react';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var HIDE_GRACE_MS = 180;
|
|
10
|
+
function GlossaryTooltip({
|
|
11
|
+
children,
|
|
12
|
+
term,
|
|
13
|
+
definition,
|
|
14
|
+
category,
|
|
15
|
+
keyFact,
|
|
16
|
+
source,
|
|
17
|
+
related,
|
|
18
|
+
href,
|
|
19
|
+
maxDefinitionLength = 190,
|
|
20
|
+
underline = true,
|
|
21
|
+
className
|
|
22
|
+
}) {
|
|
23
|
+
const [open, setOpen] = React.useState(false);
|
|
24
|
+
const [pinned, setPinned] = React.useState(false);
|
|
25
|
+
const timer = React.useRef(null);
|
|
26
|
+
const suppressFocusShow = React.useRef(false);
|
|
27
|
+
const { anchorRef, floatingRef, style } = useAnchoredPosition({
|
|
28
|
+
open,
|
|
29
|
+
placement: "top",
|
|
30
|
+
offset: 10,
|
|
31
|
+
viewportPadding: 8,
|
|
32
|
+
allowFlip: true
|
|
33
|
+
});
|
|
34
|
+
const clearHideTimer = () => {
|
|
35
|
+
if (timer.current) {
|
|
36
|
+
clearTimeout(timer.current);
|
|
37
|
+
timer.current = null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const show = React.useCallback(() => {
|
|
41
|
+
clearHideTimer();
|
|
42
|
+
setOpen(true);
|
|
43
|
+
}, []);
|
|
44
|
+
const scheduleHide = React.useCallback(() => {
|
|
45
|
+
if (pinned) return;
|
|
46
|
+
clearHideTimer();
|
|
47
|
+
timer.current = setTimeout(() => setOpen(false), HIDE_GRACE_MS);
|
|
48
|
+
}, [pinned]);
|
|
49
|
+
const close = React.useCallback(() => {
|
|
50
|
+
clearHideTimer();
|
|
51
|
+
setPinned(false);
|
|
52
|
+
setOpen(false);
|
|
53
|
+
if (floatingRef.current?.contains(document.activeElement)) {
|
|
54
|
+
suppressFocusShow.current = true;
|
|
55
|
+
anchorRef.current?.querySelector("a,button")?.focus();
|
|
56
|
+
}
|
|
57
|
+
}, [anchorRef, floatingRef]);
|
|
58
|
+
React.useEffect(() => () => clearHideTimer(), []);
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
if (pinned) floatingRef.current?.focus();
|
|
61
|
+
}, [pinned, floatingRef]);
|
|
62
|
+
useEscapeKey(close, open);
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (!open || !pinned) return;
|
|
65
|
+
const onPointer = (e) => {
|
|
66
|
+
const t = e.target;
|
|
67
|
+
if (anchorRef.current?.contains(t) || floatingRef.current?.contains(t))
|
|
68
|
+
return;
|
|
69
|
+
close();
|
|
70
|
+
};
|
|
71
|
+
document.addEventListener("mousedown", onPointer);
|
|
72
|
+
document.addEventListener("touchstart", onPointer);
|
|
73
|
+
return () => {
|
|
74
|
+
document.removeEventListener("mousedown", onPointer);
|
|
75
|
+
document.removeEventListener("touchstart", onPointer);
|
|
76
|
+
};
|
|
77
|
+
}, [open, pinned, close, anchorRef, floatingRef]);
|
|
78
|
+
const togglePin = React.useCallback(() => {
|
|
79
|
+
if (pinned) close();
|
|
80
|
+
else {
|
|
81
|
+
setPinned(true);
|
|
82
|
+
show();
|
|
83
|
+
}
|
|
84
|
+
}, [pinned, close, show]);
|
|
85
|
+
const onTriggerClick = (e) => {
|
|
86
|
+
const coarse = typeof window !== "undefined" && window.matchMedia("(hover: none)").matches;
|
|
87
|
+
if (href) {
|
|
88
|
+
if (!coarse) return;
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
}
|
|
91
|
+
togglePin();
|
|
92
|
+
};
|
|
93
|
+
const onTriggerKeyDown = (e) => {
|
|
94
|
+
if (href) return;
|
|
95
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
togglePin();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const onDialogKeyDown = (e) => {
|
|
101
|
+
if (e.target !== e.currentTarget) return;
|
|
102
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
close();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const onTriggerFocus = () => {
|
|
108
|
+
if (suppressFocusShow.current) {
|
|
109
|
+
suppressFocusShow.current = false;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
show();
|
|
113
|
+
};
|
|
114
|
+
const onBlurCapture = (e) => {
|
|
115
|
+
const next = e.relatedTarget;
|
|
116
|
+
if (next && (anchorRef.current?.contains(next) || floatingRef.current?.contains(next)))
|
|
117
|
+
return;
|
|
118
|
+
scheduleHide();
|
|
119
|
+
};
|
|
120
|
+
const limit = Math.max(1, maxDefinitionLength);
|
|
121
|
+
const short = definition.length > limit ? `${definition.slice(0, limit - 1).trimEnd()}\u2026` : definition;
|
|
122
|
+
const triggerClasses = cn(
|
|
123
|
+
"cursor-help",
|
|
124
|
+
underline && "decoration-primary-400/70 underline decoration-dashed underline-offset-4",
|
|
125
|
+
className
|
|
126
|
+
);
|
|
127
|
+
const triggerProps = {
|
|
128
|
+
onClick: onTriggerClick,
|
|
129
|
+
className: cn(
|
|
130
|
+
triggerClasses,
|
|
131
|
+
href && "text-primary-800 dark:text-primary-400 font-medium"
|
|
132
|
+
)
|
|
133
|
+
};
|
|
134
|
+
return /* @__PURE__ */ jsxs(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
ref: anchorRef,
|
|
138
|
+
className: "relative inline",
|
|
139
|
+
onMouseEnter: show,
|
|
140
|
+
onMouseLeave: scheduleHide,
|
|
141
|
+
onFocus: onTriggerFocus,
|
|
142
|
+
onBlur: onBlurCapture,
|
|
143
|
+
children: [
|
|
144
|
+
href ? /* @__PURE__ */ jsx(
|
|
145
|
+
"a",
|
|
146
|
+
{
|
|
147
|
+
href,
|
|
148
|
+
"aria-expanded": open,
|
|
149
|
+
"aria-haspopup": "dialog",
|
|
150
|
+
...triggerProps,
|
|
151
|
+
children
|
|
152
|
+
}
|
|
153
|
+
) : /* @__PURE__ */ jsx(
|
|
154
|
+
"button",
|
|
155
|
+
{
|
|
156
|
+
type: "button",
|
|
157
|
+
"aria-expanded": open,
|
|
158
|
+
"aria-haspopup": "dialog",
|
|
159
|
+
"aria-label": `${term} \u2014 show definition`,
|
|
160
|
+
onKeyDown: onTriggerKeyDown,
|
|
161
|
+
...triggerProps,
|
|
162
|
+
className: cn(
|
|
163
|
+
"inline appearance-none border-0 bg-transparent p-0 text-inherit [font:inherit]",
|
|
164
|
+
triggerProps.className
|
|
165
|
+
),
|
|
166
|
+
children
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
open && createPortal(
|
|
170
|
+
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- keyboard dismissal on a focused non-modal dialog container is the WAI-ARIA pattern; links inside keep their own semantics */
|
|
171
|
+
/* @__PURE__ */ jsx(
|
|
172
|
+
"span",
|
|
173
|
+
{
|
|
174
|
+
ref: floatingRef,
|
|
175
|
+
role: "dialog",
|
|
176
|
+
"aria-label": term,
|
|
177
|
+
tabIndex: -1,
|
|
178
|
+
onMouseEnter: show,
|
|
179
|
+
onMouseLeave: scheduleHide,
|
|
180
|
+
onBlurCapture,
|
|
181
|
+
onKeyDown: onDialogKeyDown,
|
|
182
|
+
className: "focus-visible:ring-ring z-50 block w-80 rounded-lg outline-none focus-visible:ring-2",
|
|
183
|
+
style,
|
|
184
|
+
children: /* @__PURE__ */ jsxs("span", { className: "border-border bg-card block overflow-hidden rounded-lg border text-start font-normal tracking-normal normal-case shadow-xl ring-1 ring-black/5 dark:ring-white/10", children: [
|
|
185
|
+
/* @__PURE__ */ jsx("span", { className: "from-primary-700 to-primary-600 block bg-gradient-to-br px-3.5 py-2.5", children: /* @__PURE__ */ jsxs("span", { className: "flex items-start justify-between gap-2", children: [
|
|
186
|
+
/* @__PURE__ */ jsxs("span", { className: "block min-w-0", children: [
|
|
187
|
+
category && /* @__PURE__ */ jsx("span", { className: "mb-1 inline-flex rounded-full bg-white/15 px-2 py-0.5 text-[10px] font-bold tracking-wide text-white uppercase", children: category }),
|
|
188
|
+
/* @__PURE__ */ jsx("span", { className: "block text-sm leading-snug font-semibold text-white", children: term })
|
|
189
|
+
] }),
|
|
190
|
+
pinned && /* @__PURE__ */ jsx(
|
|
191
|
+
"button",
|
|
192
|
+
{
|
|
193
|
+
type: "button",
|
|
194
|
+
onClick: close,
|
|
195
|
+
"aria-label": "Close definition",
|
|
196
|
+
className: "shrink-0 rounded p-0.5 text-white/70 hover:bg-white/10 hover:text-white",
|
|
197
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] }) }),
|
|
201
|
+
/* @__PURE__ */ jsxs("span", { className: "block px-3.5 py-2.5", children: [
|
|
202
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground block text-[13px] leading-relaxed", children: short }),
|
|
203
|
+
keyFact && /* @__PURE__ */ jsxs("span", { className: "mt-2 flex items-start gap-1.5", children: [
|
|
204
|
+
/* @__PURE__ */ jsx(
|
|
205
|
+
Diamond,
|
|
206
|
+
{
|
|
207
|
+
"aria-hidden": "true",
|
|
208
|
+
className: "text-primary-500 mt-0.5 h-3 w-3 shrink-0"
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground min-w-0 text-xs leading-relaxed font-medium", children: keyFact })
|
|
212
|
+
] })
|
|
213
|
+
] }),
|
|
214
|
+
(source || related && related.length > 0 || href) && /* @__PURE__ */ jsxs("span", { className: "border-border bg-muted/50 block border-t px-3.5 py-2", children: [
|
|
215
|
+
related && related.length > 0 && /* @__PURE__ */ jsx("span", { className: "mb-1.5 flex flex-wrap gap-1", children: related.map(
|
|
216
|
+
(r) => r.href ? /* @__PURE__ */ jsx(
|
|
217
|
+
"a",
|
|
218
|
+
{
|
|
219
|
+
href: r.href,
|
|
220
|
+
className: "border-border bg-card text-foreground hover:border-primary-400 hover:text-primary-800 dark:hover:text-primary-400 rounded-full border px-2 py-0.5 text-[11px] font-medium",
|
|
221
|
+
children: r.term
|
|
222
|
+
},
|
|
223
|
+
r.term
|
|
224
|
+
) : /* @__PURE__ */ jsx(
|
|
225
|
+
"span",
|
|
226
|
+
{
|
|
227
|
+
className: "border-border bg-card text-muted-foreground rounded-full border px-2 py-0.5 text-[11px] font-medium",
|
|
228
|
+
children: r.term
|
|
229
|
+
},
|
|
230
|
+
r.term
|
|
231
|
+
)
|
|
232
|
+
) }),
|
|
233
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center justify-between gap-2", children: [
|
|
234
|
+
source ? /* @__PURE__ */ jsx(
|
|
235
|
+
"a",
|
|
236
|
+
{
|
|
237
|
+
href: source.url,
|
|
238
|
+
target: "_blank",
|
|
239
|
+
rel: "noopener noreferrer",
|
|
240
|
+
className: "text-primary-800 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 min-w-0 truncate text-[11px] font-semibold",
|
|
241
|
+
children: source.label
|
|
242
|
+
}
|
|
243
|
+
) : /* @__PURE__ */ jsx("span", {}),
|
|
244
|
+
href && /* @__PURE__ */ jsxs(
|
|
245
|
+
"a",
|
|
246
|
+
{
|
|
247
|
+
href,
|
|
248
|
+
className: "text-muted-foreground hover:text-foreground inline-flex shrink-0 items-center gap-0.5 text-[11px] font-medium",
|
|
249
|
+
children: [
|
|
250
|
+
"Full definition",
|
|
251
|
+
/* @__PURE__ */ jsx(ArrowRight, { "aria-hidden": "true", className: "h-3 w-3" })
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] })
|
|
256
|
+
] })
|
|
257
|
+
] })
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
document.body
|
|
261
|
+
)
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export { GlossaryTooltip };
|
|
268
|
+
//# sourceMappingURL=chunk-6GKX36JX.js.map
|
|
269
|
+
//# sourceMappingURL=chunk-6GKX36JX.js.map
|