@publish.os/nextjs 0.0.1-alpha.81 → 0.0.1-alpha.91
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/compiler-assets/nextjs/defaults/app/globals.css +1 -0
- package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +8 -8
- package/compiler-assets/nextjs/defaults/group/page.tsx +44 -43
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +33 -13
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -3
- package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +4 -1
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +6 -25
- package/compiler-assets/nextjs/defaults/root/css/typography.css +51 -68
- package/compiler-assets/nextjs/defaults/root/globals.css +25 -0
- package/compiler-assets/nextjs/defaults/root/{page.tsx → index.tsx} +6 -2
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -1
- package/compiler-assets/nextjs/defaults/root/theme.css +22 -22
- package/compiler-assets/nextjs/shims/document.tsx +38 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +18 -2
- package/compiler-assets/nextjs/shims/global-layout.tsx +19 -85
- package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
- package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
- package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
- package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
- package/compiler-assets/nextjs/shims/proxy.ts +143 -65
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +76 -15
- package/compiler-assets/nextjs/shims/root-page.tsx +7 -1
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +30 -0
- package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +112 -0
- package/compiler-assets/nextjs/shims/site-mdx.tsx +17 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
- package/dist/build-operation-5QMLXF7N.js +89 -0
- package/dist/{button-CFdx-ohV.d.ts → button-BdCScEKi.d.ts} +6 -6
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-4BC2L2KA.js +620 -0
- package/dist/chunk-5J3YUNRY.js +121 -0
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/chunk-6C65KV7O.js +142 -0
- package/dist/chunk-6D2E6UMD.js +695 -0
- package/dist/chunk-7NY22B5U.js +161 -0
- package/dist/chunk-AI2UULNX.js +9 -0
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-F3AGNDF4.js +2377 -0
- package/dist/chunk-GBPLER5H.js +426 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/chunk-NNBJZPFM.js +193 -0
- package/dist/chunk-ORIUWJBQ.js +58 -0
- package/dist/chunk-OXOFRXEI.js +7129 -0
- package/dist/chunk-UYGCOWRF.js +1709 -0
- package/dist/chunk-WL75GQ5M.js +80 -0
- package/dist/compiler.d.ts +54 -7
- package/dist/compiler.js +121 -13147
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +594 -0
- package/dist/components/blocks/toc.d.ts +43 -0
- package/dist/components/blocks/toc.js +136 -0
- package/dist/components/ui/button.d.ts +5 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-CVBJRAF6.js +16 -0
- package/dist/config/createNextConfig.js +27 -0
- package/dist/dev-operation-OSHHWRWK.js +1095 -0
- package/dist/framework-selection-ZVO323PK.js +11 -0
- package/dist/ide-support-CU6Z5PVR.js +16 -0
- package/dist/index.d.ts +55 -4
- package/dist/jsx-dev-runtime.d.ts +6 -0
- package/dist/jsx-dev-runtime.js +100 -0
- package/dist/jsx-runtime.d.ts +7 -0
- package/dist/jsx-runtime.js +97 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +35 -6
- package/dist/kernel/components/blocks/AgentActions.js +401 -150
- package/dist/kernel/components/blocks/agent-actions.d.ts +5 -0
- package/dist/kernel/components/blocks/agent-actions.js +594 -0
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.js +3 -3
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.js +22 -7
- package/dist/kernel/components/blocks/navbar.d.ts +2 -2
- package/dist/kernel/components/blocks/navbar.js +406 -65
- package/dist/kernel/components/blocks/navigation-progress.js +6 -3
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +12 -24
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +7 -6
- package/dist/kernel/components/blocks/search.d.ts +83 -58
- package/dist/kernel/components/blocks/search.js +554 -428
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +12 -10
- package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
- package/dist/kernel/components/blocks/sidebar.js +24 -14
- package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
- package/dist/kernel/components/blocks/theme-toggle.js +47 -1
- package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
- package/dist/kernel/components/blocks/toc-client.js +495 -0
- package/dist/kernel/components/blocks/toc.d.ts +19 -1
- package/dist/kernel/components/blocks/toc.js +122 -180
- package/dist/kernel/components/mdx/components/blockquote.js +2 -2
- package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
- package/dist/kernel/components/mdx/components/callout.js +67 -36
- package/dist/kernel/components/mdx/components/code-block.d.ts +5 -2
- package/dist/kernel/components/mdx/components/code-block.js +106 -5
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +8 -0
- package/dist/kernel/components/mdx/components/copy-code-button.js +61 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
- package/dist/kernel/components/mdx/components/figure-caption.js +4 -3
- package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
- package/dist/kernel/components/mdx/components/figure.js +24 -14
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +4 -4
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +2 -2
- package/dist/kernel/components/mdx/components/image.d.ts +1 -1
- package/dist/kernel/components/mdx/components/image.js +94 -68
- package/dist/kernel/components/mdx/components/inline-code.js +2 -2
- package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.js +5 -4
- package/dist/kernel/components/mdx/components/link.d.ts +35 -4
- package/dist/kernel/components/mdx/components/link.js +3 -3
- package/dist/kernel/components/mdx/components/paragraph.js +2 -5
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +2 -2
- package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
- package/dist/kernel/components/mdx/components/video-player.js +8 -4
- package/dist/kernel/components/mdx/components/video.d.ts +5 -3
- package/dist/kernel/components/mdx/components/video.js +8 -6
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +28 -14
- package/dist/kernel/components/mdx/mdx.js +336 -63
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +6 -4
- package/dist/kernel/components/next-image.d.ts +12 -0
- package/dist/kernel/components/next-image.js +61 -0
- package/dist/kernel/components/ui/accordion.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +6 -23
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
- package/dist/kernel/components/ui/breadcrumb.js +10 -8
- package/dist/kernel/components/ui/button-group.js +8 -7
- package/dist/kernel/components/ui/button.d.ts +58 -6
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +3 -1
- package/dist/kernel/components/ui/drawer.js +6 -2
- package/dist/kernel/components/ui/input.d.ts +2 -2
- package/dist/kernel/components/ui/input.js +1 -1
- package/dist/kernel/components/ui/kbd.js +10 -17
- package/dist/kernel/components/ui/link.d.ts +11 -3
- package/dist/kernel/components/ui/link.js +12 -11
- package/dist/kernel/components/ui/menu.js +6 -6
- package/dist/kernel/components/ui/mod-key.d.ts +10 -0
- package/dist/kernel/components/ui/mod-key.js +36 -0
- package/dist/kernel/components/ui/navigation-menu.js +3 -3
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.js +2 -2
- package/dist/kernel/components/ui/scroll-area.js +5 -5
- package/dist/kernel/components/ui/select.js +8 -11
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +11 -24
- package/dist/kernel/defaults.registry.js +11 -26
- package/dist/kernel/routes/agent/markdown.d.ts +3 -1
- package/dist/kernel/routes/agent/markdown.js +219 -48
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +5 -7
- package/dist/kernel/routes/metadata/feed.d.ts +1 -1
- package/dist/kernel/routes/metadata/feed.js +111 -81
- package/dist/kernel/routes/metadata/llms.d.ts +12 -3
- package/dist/kernel/routes/metadata/llms.js +156 -59
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +1 -1
- package/dist/kernel/routes/metadata/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.d.ts +26 -4
- package/dist/kernel/routes/metadata/sitemap.js +206 -38
- package/dist/kernel/routes/not-found.d.ts +34 -0
- package/dist/kernel/routes/not-found.js +213 -0
- package/dist/kernel/routes/pages/group.d.ts +2 -2
- package/dist/kernel/routes/pages/group.js +21 -13
- package/dist/kernel/routes/pages/leaf.d.ts +28 -1
- package/dist/kernel/routes/pages/leaf.js +25 -16
- package/dist/kernel/routes/pages/root.js +19 -13
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/resolvers/manifest-resolver.js +29 -6
- package/dist/search.d.ts +6 -7
- package/dist/search.js +52 -29
- package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/{types-DHBm7-j6.d.ts → types-CJWRG05y.d.ts} +20 -1
- package/dist/{types-B_b3C0U6.d.ts → types-CUtrppxt.d.ts} +8 -2
- package/dist/{types-CIwwieNw.d.ts → types-J2w_puPF.d.ts} +11 -10
- package/dist/types.d.ts +15 -6
- package/dist/utils/heading-ids.js +30 -11
- package/dist/utils/toc-selection.d.ts +7 -0
- package/dist/utils/toc-selection.js +14 -0
- package/dist/validate-local-source-SV44DBQT.js +16 -0
- package/dist/validate-publish-os-source-NZJF3TB2.js +14 -0
- package/init/seed/minimal/.gitignore +1 -0
- package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
- package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
- package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
- package/init/seed/minimal/publish.os/blog/index.tsx +82 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +76 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +6 -11
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +6 -7
- package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
- package/init/seed/minimal/publish.os/publish.os.config.json +7 -7
- package/init/seed/minimal/publish.os/theme.css +52 -24
- package/init/seed/minimal/publish.os/tsconfig.json +3 -0
- package/init/seed/minimal/seed.json +12 -2
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +6 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +4 -0
- package/init/seed/scratch/seed.json +5 -0
- package/package.json +55 -44
- package/release/app/phosphor/package.json +5 -5
- package/release/app/phosphor/pnpm-lock.yaml.template +553 -377
- package/release/app/phosphor/pnpm-workspace.yaml +3 -0
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +500 -303
- package/release/compiler/pnpm-workspace.yaml +3 -0
- package/release/release.json +8 -37
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +0 -48
- package/dist/icons.d.ts +0 -1
- package/dist/icons.js +0 -2
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -648
- package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/link-playground.js +0 -744
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
- package/dist/kernel/components/mdx/components/pre.d.ts +0 -6
- package/dist/kernel/components/mdx/components/pre.js +0 -18
- package/dist/kernel/components/ui/meta-key.d.ts +0 -17
- package/dist/kernel/components/ui/meta-key.js +0 -9
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -58
- package/dist/kernel/framework-icons.d.ts +0 -1
- package/dist/kernel/framework-icons.js +0 -39
- package/dist/link-CYaCRDb6.d.ts +0 -35
- package/release/app/lucide/package.json +0 -30
- package/release/app/lucide/pnpm-lock.yaml.template +0 -2905
- package/release/app/lucide/pnpm-workspace.yaml +0 -11
- package/release/app/tabler/package.json +0 -30
- package/release/app/tabler/pnpm-lock.yaml.template +0 -2911
- package/release/app/tabler/pnpm-workspace.yaml +0 -11
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/mdx/code-block/copy-code-button.tsx
|
|
4
|
+
import { AnimatedIconSwap } from "@components/blocks/animated-icon-swap";
|
|
5
|
+
import { Button } from "@components/ui/button";
|
|
6
|
+
import { CheckIcon, CopyIcon } from "@phosphor-icons/react/ssr";
|
|
7
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
8
|
+
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
10
|
+
function CopyCodeButton({
|
|
11
|
+
className,
|
|
12
|
+
code
|
|
13
|
+
}) {
|
|
14
|
+
let [copied, setCopied] = useState(!1), resetTimer = useRef(null);
|
|
15
|
+
useEffect(
|
|
16
|
+
() => () => {
|
|
17
|
+
resetTimer.current !== null && window.clearTimeout(resetTimer.current);
|
|
18
|
+
},
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
async function copy() {
|
|
22
|
+
try {
|
|
23
|
+
await navigator.clipboard.writeText(code), setCopied(!0), resetTimer.current !== null && window.clearTimeout(resetTimer.current), resetTimer.current = window.setTimeout(() => setCopied(!1), 2e3);
|
|
24
|
+
} catch {
|
|
25
|
+
setCopied(!1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
29
|
+
Button,
|
|
30
|
+
{
|
|
31
|
+
"aria-label": copied ? "Copied code" : "Copy code",
|
|
32
|
+
className: cn(
|
|
33
|
+
"relative z-content touch-manipulation after:absolute after:-inset-2 after:content-['']",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
"data-copied": copied ? "true" : void 0,
|
|
37
|
+
"data-slot": "copy-code-button",
|
|
38
|
+
iconOnly: !0,
|
|
39
|
+
onClick: copy,
|
|
40
|
+
size: "sm",
|
|
41
|
+
type: "button",
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
AnimatedIconSwap,
|
|
46
|
+
{
|
|
47
|
+
active: copied,
|
|
48
|
+
activeIcon: /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true", size: 16 }),
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
defaultIcon: /* @__PURE__ */ jsx(CopyIcon, { "aria-hidden": "true", size: 16 }),
|
|
51
|
+
size: 16
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? "Copied" : "" })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
CopyCodeButton
|
|
61
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
type FigureCaptionProps = React.
|
|
3
|
+
type FigureCaptionProps = React.ComponentProps<"figcaption">;
|
|
4
4
|
declare function FigureCaption({ className, ...props }: FigureCaptionProps): react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
6
6
|
export { FigureCaption, type FigureCaptionProps };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
// src/components/mdx/figure-caption.tsx
|
|
1
|
+
// src/components/mdx/figure/figure-caption.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
|
-
import { jsx } from "
|
|
3
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function FigureCaption({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(
|
|
6
6
|
"figcaption",
|
|
7
7
|
{
|
|
8
|
+
"data-slot": "figure-caption",
|
|
8
9
|
className: cn(
|
|
9
|
-
"
|
|
10
|
+
"my-2 px-1 text-start text-xs leading-relaxed text-foreground-3 first:mt-0 last:mb-0 [&>p]:my-0 [&>p]:text-inherit [&>p+p]:mt-2",
|
|
10
11
|
className
|
|
11
12
|
),
|
|
12
13
|
...props
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FigureCaption } from './figure-caption.js';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
3
4
|
|
|
4
|
-
type FigureProps = React.
|
|
5
|
+
type FigureProps = React.ComponentProps<"figure"> & {
|
|
6
|
+
/** A fallback caption after the children. An authored caption takes precedence. */
|
|
5
7
|
caption?: ReactNode;
|
|
6
|
-
frame?: boolean | "default" | "none";
|
|
7
8
|
};
|
|
8
9
|
declare function Figure({ caption, children, className, ...props }: FigureProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare namespace Figure {
|
|
11
|
+
var Caption: typeof FigureCaption;
|
|
12
|
+
}
|
|
9
13
|
|
|
10
14
|
export { Figure, type FigureProps };
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
// src/components/mdx/figure.tsx
|
|
2
|
-
import { FigureCaption } from "@
|
|
1
|
+
// src/components/mdx/figure/figure.tsx
|
|
2
|
+
import { FigureCaption } from "@components/mdx/components/figure-caption";
|
|
3
3
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
|
-
import { Children, isValidElement } from "react";
|
|
5
|
-
import { jsx, jsxs } from "
|
|
4
|
+
import { Children, Fragment, isValidElement } from "react";
|
|
5
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
6
|
+
function containsCaption(children) {
|
|
7
|
+
return Children.toArray(children).some(
|
|
8
|
+
(child) => isValidElement(child) && (child.type === "figcaption" || child.type === FigureCaption || child.type === Fragment && containsCaption(child.props.children))
|
|
9
|
+
);
|
|
10
|
+
}
|
|
6
11
|
function Figure({
|
|
7
12
|
caption,
|
|
8
13
|
children,
|
|
9
14
|
className,
|
|
10
15
|
...props
|
|
11
16
|
}) {
|
|
12
|
-
let
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
let showFallbackCaption = caption != null && caption !== !1 && !containsCaption(children);
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
"figure",
|
|
20
|
+
{
|
|
21
|
+
className: cn(
|
|
22
|
+
"not-markdown-prose my-8 [&>*:has(+figcaption)]:mb-0 [&>figcaption+*]:mt-0",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
...props,
|
|
26
|
+
children: [
|
|
27
|
+
children,
|
|
28
|
+
showFallbackCaption ? /* @__PURE__ */ jsx(FigureCaption, { children: caption }) : null
|
|
29
|
+
]
|
|
17
30
|
}
|
|
18
|
-
|
|
19
|
-
}), /* @__PURE__ */ jsxs("figure", { className: cn("not-markdown-prose my-8", className), ...props, children: [
|
|
20
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-center gap-3", children: mediaChildren }),
|
|
21
|
-
authoredCaption ? /* @__PURE__ */ jsx(FigureCaption, { className: "mx-auto max-w-prose text-center", children: authoredCaption }) : null
|
|
22
|
-
] });
|
|
31
|
+
);
|
|
23
32
|
}
|
|
33
|
+
Figure.Caption = FigureCaption;
|
|
24
34
|
export {
|
|
25
35
|
Figure
|
|
26
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/mdx/footnotes.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
|
-
import { jsx } from "
|
|
3
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function Footnotes({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(
|
|
6
6
|
"section",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/components/mdx/heading-copy-link.tsx
|
|
4
|
-
import {
|
|
4
|
+
import { LinkIcon } from "@phosphor-icons/react/ssr";
|
|
5
5
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
6
|
-
import { jsx, jsxs } from "
|
|
6
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
7
7
|
function headingCopyUrl({ href, id }) {
|
|
8
8
|
let url = new URL(href);
|
|
9
9
|
return url.hash = id, url.toString();
|
|
@@ -35,7 +35,7 @@ function HeadingCopyLink({
|
|
|
35
35
|
className
|
|
36
36
|
),
|
|
37
37
|
children: [
|
|
38
|
-
children ? /* @__PURE__ */ jsx("span", { className: "relative inline no-underline after:pointer-events-none after:absolute after:bottom-
|
|
38
|
+
children ? /* @__PURE__ */ jsx("span", { className: "relative inline no-underline after:pointer-events-none after:absolute after:bottom-(--link-underline-offset) after:left-0 after:h-(--link-underline-thickness) after:w-full after:rounded-inline-code after:bg-transparent after:transition-colors after:duration-100 after:ease-out after:content-[''] group-hover/heading-link:after:bg-[color-mix(in_oklch,currentColor_38%,transparent)] group-focus-visible/heading-link:after:bg-[color-mix(in_oklch,currentColor_38%,transparent)]", children }) : null,
|
|
39
39
|
/* @__PURE__ */ jsx(
|
|
40
40
|
"span",
|
|
41
41
|
{
|
|
@@ -44,7 +44,7 @@ function HeadingCopyLink({
|
|
|
44
44
|
"inline-flex h-[1em] items-center align-[-0.06em] text-typography-caption-foreground transition-[color,opacity] duration-150 group-hover/heading-link:text-typography-body-foreground group-focus-visible/heading-link:text-typography-body-foreground",
|
|
45
45
|
iconOnly ? "opacity-100" : "ml-1.5 opacity-0 group-hover/heading-link:opacity-100 group-focus-visible/heading-link:opacity-100"
|
|
46
46
|
),
|
|
47
|
-
children: /* @__PURE__ */ jsx(
|
|
47
|
+
children: /* @__PURE__ */ jsx(LinkIcon, { "aria-hidden": "true", className: "block size-[0.8em] shrink-0" })
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/components/mdx/heading.tsx
|
|
2
|
-
import { HeadingCopyLink } from "@
|
|
2
|
+
import { HeadingCopyLink } from "@components/mdx/components/heading-copy-link";
|
|
3
3
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
4
|
import { headingToHTMLId } from "@publish.os/nextjs/utils/heading-ids";
|
|
5
5
|
import {
|
|
6
6
|
Children,
|
|
7
7
|
isValidElement
|
|
8
8
|
} from "react";
|
|
9
|
-
import { jsx, jsxs } from "
|
|
9
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
10
10
|
function isBrElement(node) {
|
|
11
11
|
return isValidElement(node) && node.type === "br";
|
|
12
12
|
}
|
|
@@ -33,7 +33,10 @@ function Heading({
|
|
|
33
33
|
id,
|
|
34
34
|
...props
|
|
35
35
|
}) {
|
|
36
|
-
let cleaned = cleanHeadingChildren(children), headingId = id ?? headingToHTMLId(cleaned), isEmpty = !headingId || headingId === "empty-heading", classes = cn(
|
|
36
|
+
let cleaned = cleanHeadingChildren(children), headingId = id ?? headingToHTMLId(cleaned), isEmpty = !headingId || headingId === "empty-heading", classes = cn(
|
|
37
|
+
"scroll-mt-[calc(var(--layout-global-nav-height)_+_1.5rem)] supports-[scroll-margin-top:anchor-size(--global-navbar_height)]:scroll-mt-[calc(anchor-size(--global-navbar_height,3.5rem)_+_1.5rem)]",
|
|
38
|
+
className
|
|
39
|
+
);
|
|
37
40
|
return isEmpty ? (
|
|
38
41
|
// @ts-expect-error — polymorphic `as` prop with spread is safe at runtime
|
|
39
42
|
/* @__PURE__ */ jsx(Tag, { className, ...props, children: cleaned })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/mdx/hr.tsx
|
|
2
|
-
import { Separator } from "@
|
|
3
|
-
import { jsx } from "
|
|
2
|
+
import { Separator } from "@components/ui/separator";
|
|
3
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function Hr({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(Separator, { className, ...props });
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/components/mdx/image-zoom.tsx
|
|
3
|
+
// src/components/mdx/image/image-zoom.tsx
|
|
4
4
|
import Zoom from "react-medium-image-zoom";
|
|
5
|
-
import { jsx } from "
|
|
5
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
6
6
|
function ImageZoom({
|
|
7
7
|
children,
|
|
8
8
|
enabled
|
|
@@ -16,6 +16,6 @@ type ImageProps = Omit<React.ComponentPropsWithoutRef<"img">, "height" | "sizes"
|
|
|
16
16
|
width?: number;
|
|
17
17
|
zoom?: boolean;
|
|
18
18
|
};
|
|
19
|
-
declare function Image({ alt, aspect, caption, className, decorative, fill, frame, height, intrinsicHeight, intrinsicWidth, optimized, priority, quality, sizes, src, width, zoom, ...props }: ImageProps): react_jsx_runtime.JSX.Element | null;
|
|
19
|
+
declare function Image({ alt, aspect, caption, className, decorative: authoredDecorative, fill: authoredFill, frame, height, intrinsicHeight, intrinsicWidth, optimized: authoredOptimized, priority: authoredPriority, quality, sizes, src, width, zoom: authoredZoom, ...props }: ImageProps): react_jsx_runtime.JSX.Element | null;
|
|
20
20
|
|
|
21
21
|
export { Image, type ImageProps };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
// src/components/mdx/image.tsx
|
|
2
|
-
import { FigureCaption } from "@
|
|
3
|
-
import { ImageZoom } from "@
|
|
1
|
+
// src/components/mdx/image/image.tsx
|
|
2
|
+
import { FigureCaption } from "@components/mdx/components/figure-caption";
|
|
3
|
+
import { ImageZoom } from "@components/mdx/components/image-zoom";
|
|
4
4
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
5
5
|
import NextImage from "next/image";
|
|
6
|
-
import { jsx, jsxs } from "
|
|
6
|
+
import { jsx, jsxs } from "@publish.os/nextjs/jsx-runtime";
|
|
7
|
+
function resolveImageBoolean(value) {
|
|
8
|
+
if (value === !0 || value === "true") return !0;
|
|
9
|
+
if (value === !1 || value === "false") return !1;
|
|
10
|
+
}
|
|
7
11
|
function parseAspect(value) {
|
|
8
12
|
if (typeof value == "number" && Number.isFinite(value) && value > 0)
|
|
9
13
|
return value;
|
|
@@ -12,105 +16,127 @@ function parseAspect(value) {
|
|
|
12
16
|
if (!(!width || !height || !Number.isFinite(width) || !Number.isFinite(height)))
|
|
13
17
|
return width / height;
|
|
14
18
|
}
|
|
19
|
+
function resolveImageLayout({
|
|
20
|
+
aspect,
|
|
21
|
+
fill,
|
|
22
|
+
height,
|
|
23
|
+
intrinsicHeight,
|
|
24
|
+
intrinsicWidth,
|
|
25
|
+
width
|
|
26
|
+
}) {
|
|
27
|
+
let resolvedWidth = width ?? intrinsicWidth, resolvedHeight = height ?? intrinsicHeight, resolvedAspect = parseAspect(aspect) ?? (resolvedWidth && resolvedHeight ? resolvedWidth / resolvedHeight : void 0), style = {
|
|
28
|
+
...resolvedAspect ? { aspectRatio: String(resolvedAspect) } : {},
|
|
29
|
+
width: fill ? "100%" : resolvedWidth ? `min(100%, ${resolvedWidth}px)` : "100%"
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
width: resolvedWidth,
|
|
33
|
+
height: resolvedHeight,
|
|
34
|
+
canOptimizeWithFill: !!(fill && resolvedAspect),
|
|
35
|
+
style
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function renderImage({
|
|
39
|
+
imageProps,
|
|
40
|
+
fill,
|
|
41
|
+
height,
|
|
42
|
+
optimized,
|
|
43
|
+
priority,
|
|
44
|
+
quality,
|
|
45
|
+
sizes,
|
|
46
|
+
width
|
|
47
|
+
}) {
|
|
48
|
+
if (optimized && imageProps.src && (fill || width && height)) {
|
|
49
|
+
let maxWidth = fill ? "var(--publish-content-width, 72rem)" : `${width}px`;
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
NextImage,
|
|
52
|
+
{
|
|
53
|
+
...fill ? { fill } : { width, height },
|
|
54
|
+
priority,
|
|
55
|
+
quality,
|
|
56
|
+
sizes: sizes ?? `(max-width: 768px) 100vw, min(${maxWidth}, 100vw)`,
|
|
57
|
+
...imageProps,
|
|
58
|
+
src: imageProps.src
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
let { alt, ...nativeProps } = imageProps;
|
|
63
|
+
return (
|
|
64
|
+
// biome-ignore lint/performance/noImgElement: remote and dimensionless MDX images do not require Next image optimizer configuration.
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"img",
|
|
67
|
+
{
|
|
68
|
+
alt,
|
|
69
|
+
height: optimized ? void 0 : height,
|
|
70
|
+
loading: priority ? "eager" : "lazy",
|
|
71
|
+
width: optimized ? void 0 : width,
|
|
72
|
+
...nativeProps
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
15
77
|
function Image({
|
|
16
78
|
alt,
|
|
17
79
|
aspect,
|
|
18
80
|
caption,
|
|
19
81
|
className,
|
|
20
|
-
decorative
|
|
21
|
-
fill
|
|
82
|
+
decorative: authoredDecorative,
|
|
83
|
+
fill: authoredFill,
|
|
22
84
|
frame = "default",
|
|
23
85
|
height,
|
|
24
86
|
intrinsicHeight,
|
|
25
87
|
intrinsicWidth,
|
|
26
|
-
optimized
|
|
27
|
-
priority,
|
|
88
|
+
optimized: authoredOptimized,
|
|
89
|
+
priority: authoredPriority,
|
|
28
90
|
quality,
|
|
29
91
|
sizes,
|
|
30
92
|
src,
|
|
31
93
|
width,
|
|
32
|
-
zoom
|
|
94
|
+
zoom: authoredZoom,
|
|
33
95
|
...props
|
|
34
96
|
}) {
|
|
35
|
-
if (!src) return null;
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
97
|
+
if (!src && !props.srcSet) return null;
|
|
98
|
+
let decorative = resolveImageBoolean(authoredDecorative) ?? !1, fill = resolveImageBoolean(authoredFill) ?? !1, optimized = resolveImageBoolean(authoredOptimized) ?? !1, priority = resolveImageBoolean(authoredPriority), zoom = resolveImageBoolean(authoredZoom) ?? !0, layout = resolveImageLayout({
|
|
99
|
+
aspect,
|
|
100
|
+
fill,
|
|
101
|
+
height,
|
|
102
|
+
intrinsicHeight,
|
|
103
|
+
intrinsicWidth,
|
|
104
|
+
width
|
|
105
|
+
}), imageAlt = decorative ? "" : alt ?? "", framed = resolveImageBoolean(frame) ?? frame !== "none", stringSrc = src ? String(src) : void 0, useNextImage = !!(optimized && stringSrc?.startsWith("/")), imageClassName = cn(
|
|
40
106
|
"block h-full w-full transition-opacity duration-200",
|
|
41
107
|
fill ? "object-cover" : "object-contain",
|
|
42
108
|
zoom && "cursor-zoom-in hover:opacity-90",
|
|
43
109
|
className
|
|
44
|
-
), image =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
sizes: sizes ?? "(max-width: 768px) 100vw, min(var(--publish-content-width, 72rem), 100vw)",
|
|
54
|
-
src: stringSrc,
|
|
55
|
-
...props
|
|
56
|
-
}
|
|
57
|
-
) : resolvedWidth && resolvedHeight ? /* @__PURE__ */ jsx(
|
|
58
|
-
NextImage,
|
|
59
|
-
{
|
|
110
|
+
), image = renderImage({
|
|
111
|
+
fill: layout.canOptimizeWithFill,
|
|
112
|
+
height: layout.height,
|
|
113
|
+
optimized: useNextImage,
|
|
114
|
+
priority,
|
|
115
|
+
quality,
|
|
116
|
+
sizes,
|
|
117
|
+
width: layout.width,
|
|
118
|
+
imageProps: {
|
|
60
119
|
alt: imageAlt,
|
|
61
120
|
"aria-hidden": decorative || void 0,
|
|
62
121
|
className: imageClassName,
|
|
63
|
-
height: resolvedHeight,
|
|
64
|
-
priority,
|
|
65
|
-
quality,
|
|
66
|
-
sizes: sizes ?? `(max-width: 768px) 100vw, min(${resolvedWidth}px, 100vw)`,
|
|
67
122
|
src: stringSrc,
|
|
68
|
-
width: resolvedWidth,
|
|
69
123
|
...props
|
|
70
124
|
}
|
|
71
|
-
)
|
|
72
|
-
// biome-ignore lint/performance/noImgElement: remote and non-manifest images may not have dimensions available at runtime.
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
"img",
|
|
75
|
-
{
|
|
76
|
-
alt: imageAlt,
|
|
77
|
-
"aria-hidden": decorative || void 0,
|
|
78
|
-
className: imageClassName,
|
|
79
|
-
loading: priority ? "eager" : "lazy",
|
|
80
|
-
src: stringSrc,
|
|
81
|
-
...props
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
) : (
|
|
85
|
-
// biome-ignore lint/performance/noImgElement: MDX media supports generated project assets, SVGs, and remote CDN images without requiring Next image optimizer configuration.
|
|
86
|
-
/* @__PURE__ */ jsx(
|
|
87
|
-
"img",
|
|
88
|
-
{
|
|
89
|
-
alt: imageAlt,
|
|
90
|
-
"aria-hidden": decorative || void 0,
|
|
91
|
-
className: imageClassName,
|
|
92
|
-
height: resolvedHeight,
|
|
93
|
-
loading: priority ? "eager" : "lazy",
|
|
94
|
-
src: stringSrc,
|
|
95
|
-
width: resolvedWidth,
|
|
96
|
-
...props
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
), content = /* @__PURE__ */ jsx(
|
|
125
|
+
}), content = /* @__PURE__ */ jsx(
|
|
100
126
|
"div",
|
|
101
127
|
{
|
|
102
128
|
className: cn(
|
|
103
129
|
"relative mx-auto max-w-full overflow-hidden",
|
|
104
130
|
framed && "rounded-media border border-stroke-2 bg-surface-2"
|
|
105
131
|
),
|
|
106
|
-
style:
|
|
132
|
+
style: layout.style,
|
|
107
133
|
children: /* @__PURE__ */ jsx(ImageZoom, { enabled: zoom, children: image })
|
|
108
134
|
}
|
|
109
135
|
);
|
|
110
|
-
return caption ? /* @__PURE__ */ jsxs("figure", { className: "not-markdown-prose my-8", children: [
|
|
136
|
+
return caption ? /* @__PURE__ */ jsxs("figure", { className: "not-markdown-prose my-8 w-full", children: [
|
|
111
137
|
content,
|
|
112
|
-
/* @__PURE__ */ jsx(FigureCaption, {
|
|
113
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "not-markdown-prose my-6 flex justify-center", children: content });
|
|
138
|
+
/* @__PURE__ */ jsx(FigureCaption, { children: caption })
|
|
139
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "not-markdown-prose my-6 flex w-full justify-center", children: content });
|
|
114
140
|
}
|
|
115
141
|
export {
|
|
116
142
|
Image
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/components/mdx/inline-code.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
|
-
import { jsx } from "
|
|
3
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function InlineCode({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(
|
|
6
6
|
"code",
|
|
7
7
|
{
|
|
8
8
|
className: cn(
|
|
9
|
-
"not-markdown-prose
|
|
9
|
+
"not-markdown-prose mx-[0.08em] inline-block rounded-inline-code bg-typography-code-surface px-[0.2em] py-[0.05em] font-mono text-[0.875em] font-normal leading-[1.4] text-typography-code-foreground in-[pre]:m-0 in-[pre]:bg-transparent in-[pre]:p-0 in-[pre]:text-[1em] in-[pre]:leading-[inherit] in-[pre]:text-inherit",
|
|
10
10
|
className
|
|
11
11
|
),
|
|
12
12
|
...props
|
|
@@ -9,7 +9,7 @@ declare const kbdVariants: (props?: ({
|
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
type KbdProps$1 = HTMLAttributes<HTMLElement> & VariantProps<typeof kbdVariants>;
|
|
11
11
|
|
|
12
|
-
type KbdProps = KbdProps$1
|
|
13
|
-
declare function Kbd(props: KbdProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
type KbdProps = Omit<KbdProps$1, "size">;
|
|
13
|
+
declare function Kbd({ className, ...props }: KbdProps): react_jsx_runtime.JSX.Element;
|
|
14
14
|
|
|
15
15
|
export { Kbd, type KbdProps };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// src/components/mdx/kbd.tsx
|
|
2
|
-
import { Kbd as UiKbd } from "@
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Kbd as UiKbd } from "@components/ui/kbd";
|
|
3
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
4
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
5
|
+
function Kbd({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(UiKbd, { ...props, size: null, className: cn("text-[0.75em]", className) });
|
|
6
7
|
}
|
|
7
8
|
export {
|
|
8
9
|
Kbd
|
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import 'class-variance-authority
|
|
4
|
-
import '
|
|
5
|
-
import 'react';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { LinkProps as LinkProps$1 } from 'next/link';
|
|
5
|
+
import { ReactNode, AnchorHTMLAttributes } from 'react';
|
|
6
|
+
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
readonly variant?: "solid" | "soft" | "outline" | "ghost" | null | undefined;
|
|
9
|
+
readonly size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
|
+
readonly iconOnly?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
13
|
+
|
|
14
|
+
declare const linkVariants: (props?: ({
|
|
15
|
+
color?: "accent" | "default" | null | undefined;
|
|
16
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
17
|
+
variant?: "inline" | "standalone" | null | undefined;
|
|
18
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
19
|
+
type LinkVariantProps = VariantProps<typeof linkVariants>;
|
|
20
|
+
type LinkStyleVariant = NonNullable<LinkVariantProps["variant"]>;
|
|
21
|
+
type LinkButtonVariant = `button.${NonNullable<ButtonVariantProps["variant"]>}`;
|
|
22
|
+
type LinkVariant = `link.${LinkStyleVariant}` | LinkButtonVariant;
|
|
23
|
+
type NamedLinkColor = "accent" | "default";
|
|
24
|
+
type LinkColor = NamedLinkColor | (string & {});
|
|
25
|
+
type LinkProps = {
|
|
26
|
+
active?: boolean;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
color?: LinkColor;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
href?: string;
|
|
31
|
+
iconOnly?: ButtonVariantProps["iconOnly"];
|
|
32
|
+
leftIcon?: ReactNode;
|
|
33
|
+
prefetch?: LinkProps$1["prefetch"];
|
|
34
|
+
rightIcon?: ReactNode;
|
|
35
|
+
variant?: LinkVariant;
|
|
36
|
+
} & Omit<LinkVariantProps, "color" | "variant"> & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "color" | "href">;
|
|
6
37
|
|
|
7
38
|
type MdxLinkProps = LinkProps;
|
|
8
39
|
declare function Link({ color, href, size, variant, ...props }: MdxLinkProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/components/mdx/link.tsx
|
|
2
2
|
import {
|
|
3
3
|
Link as UiLink
|
|
4
|
-
} from "@
|
|
5
|
-
import { jsx } from "
|
|
4
|
+
} from "@components/ui/link";
|
|
5
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
6
6
|
function Link({
|
|
7
7
|
color = "accent",
|
|
8
8
|
href = "#",
|
|
@@ -15,7 +15,7 @@ function Link({
|
|
|
15
15
|
{
|
|
16
16
|
color,
|
|
17
17
|
href,
|
|
18
|
-
size,
|
|
18
|
+
size: size ?? null,
|
|
19
19
|
variant,
|
|
20
20
|
...props
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/mdx/paragraph.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
3
|
import { Children, isValidElement } from "react";
|
|
4
|
-
import { Fragment, jsx } from "
|
|
4
|
+
import { Fragment, jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
5
5
|
function isBlockMediaChild(child) {
|
|
6
6
|
if (!isValidElement(child)) return !1;
|
|
7
7
|
let props = child.props;
|
|
@@ -18,10 +18,7 @@ function Paragraph({
|
|
|
18
18
|
return childArray.length === 1 && isBlockMediaChild(childArray[0]) ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(
|
|
19
19
|
"p",
|
|
20
20
|
{
|
|
21
|
-
className: cn(
|
|
22
|
-
"my-5 text-base leading-7 text-typography-body-foreground",
|
|
23
|
-
className
|
|
24
|
-
),
|
|
21
|
+
className: cn("my-5 text-typography-body-foreground", className),
|
|
25
22
|
...props,
|
|
26
23
|
children
|
|
27
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/mdx/strikethrough.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
|
-
import { jsx } from "
|
|
3
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function Strikethrough({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(
|
|
6
6
|
"del",
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
TableHeader,
|
|
7
7
|
TableRow,
|
|
8
8
|
Table as UiTable
|
|
9
|
-
} from "@
|
|
10
|
-
import { jsx } from "
|
|
9
|
+
} from "@components/ui/table";
|
|
10
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
11
11
|
function Table(props) {
|
|
12
12
|
return /* @__PURE__ */ jsx(UiTable, { ...props });
|
|
13
13
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/components/mdx/task-list.tsx
|
|
2
2
|
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
3
|
-
import { jsx } from "
|
|
3
|
+
import { jsx } from "@publish.os/nextjs/jsx-runtime";
|
|
4
4
|
function TaskList({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx(
|
|
6
6
|
"ul",
|
|
7
7
|
{
|
|
8
8
|
className: cn(
|
|
9
|
-
"my-5 space-y-2 pl-6 text-
|
|
9
|
+
"my-5 space-y-2 pl-6 text-typography-body-foreground [&>li]:pl-1",
|
|
10
10
|
className
|
|
11
11
|
),
|
|
12
12
|
...props
|