@publish.os/nextjs 0.0.1-alpha.6 → 0.0.1-alpha.7
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 +3 -5
- package/compiler-assets/nextjs/defaults/app/globals.css +6 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +23 -0
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +48 -0
- package/compiler-assets/nextjs/defaults/group/page.tsx +50 -0
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +45 -0
- package/compiler-assets/nextjs/defaults/project/postcss.config.mjs +5 -0
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +41 -0
- package/compiler-assets/nextjs/defaults/root/css/animation.css +90 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/drawer.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +25 -0
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +17 -0
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/toast.css +19 -0
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +15 -0
- package/compiler-assets/nextjs/defaults/root/css/layout.css +22 -0
- package/compiler-assets/nextjs/defaults/root/css/media.css +81 -0
- package/compiler-assets/nextjs/defaults/root/css/radius.css +49 -0
- package/compiler-assets/nextjs/defaults/root/css/scrollbar.css +43 -0
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +145 -0
- package/compiler-assets/nextjs/defaults/root/css/typography.css +607 -0
- package/compiler-assets/nextjs/defaults/root/css/zindex.css +39 -0
- package/compiler-assets/nextjs/defaults/root/globals.css +191 -0
- package/compiler-assets/nextjs/defaults/root/layout.tsx +19 -0
- package/compiler-assets/nextjs/defaults/root/page.tsx +61 -0
- package/compiler-assets/nextjs/defaults/root/theme.css +50 -0
- package/compiler-assets/nextjs/defaults/source/_internal/logger.ts +21 -0
- package/compiler-assets/nextjs/shims/generated-group-layout.tsx +19 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +18 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +21 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +134 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +29 -0
- package/compiler-assets/nextjs/shims/og-image-route.ts +18 -0
- package/compiler-assets/nextjs/shims/powered-by-footer.tsx +40 -0
- package/compiler-assets/nextjs/shims/providers.tsx +13 -0
- package/compiler-assets/nextjs/shims/proxy.ts +317 -0
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +77 -0
- package/compiler-assets/nextjs/shims/root-page.tsx +13 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +177 -0
- package/dist/button-CFdx-ohV.d.ts +20 -0
- package/dist/cache/tags.js +6 -14
- package/dist/compiler.d.ts +100 -0
- package/dist/compiler.js +13379 -0
- package/dist/config/createNextConfig.d.ts +2 -1
- package/dist/config/createNextConfig.js +16 -12
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +303 -15
- package/dist/index.js +30 -1198
- package/dist/kernel/components/blocks/AgentActions.d.ts +9 -3
- package/dist/kernel/components/blocks/AgentActions.js +114 -200
- package/dist/kernel/components/blocks/animated-icon-swap.js +4 -25
- package/dist/kernel/components/blocks/color-palette.js +88 -169
- package/dist/kernel/components/blocks/design-system-preview.d.ts +38 -6
- package/dist/kernel/components/blocks/design-system-preview.js +44 -52
- package/dist/kernel/components/blocks/link-playground.js +23 -71
- package/dist/kernel/components/blocks/logo-block.js +18 -47
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +28 -42
- package/dist/kernel/components/blocks/navbar.d.ts +1 -1
- package/dist/kernel/components/blocks/navbar.js +14 -41
- package/dist/kernel/components/blocks/navigation-progress-playground.js +56 -149
- package/dist/kernel/components/blocks/navigation-progress.js +53 -157
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +16 -42
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +11 -16
- package/dist/kernel/components/blocks/search.d.ts +13 -2
- package/dist/kernel/components/blocks/search.js +116 -247
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +56 -95
- package/dist/kernel/components/blocks/sidebar.d.ts +5 -23
- package/dist/kernel/components/blocks/sidebar.js +35 -103
- package/dist/kernel/components/blocks/theme-toggle.d.ts +7 -3
- package/dist/kernel/components/blocks/theme-toggle.js +2 -2
- package/dist/kernel/components/blocks/toc.js +42 -178
- package/dist/kernel/components/mdx/components/blockquote.js +3 -24
- package/dist/kernel/components/mdx/components/callout.d.ts +1 -1
- package/dist/kernel/components/mdx/components/callout.js +15 -47
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/figure-caption.js +6 -24
- package/dist/kernel/components/mdx/components/figure.js +9 -36
- package/dist/kernel/components/mdx/components/footnotes.js +3 -24
- package/dist/kernel/components/mdx/components/heading-copy-link.js +13 -37
- package/dist/kernel/components/mdx/components/heading.d.ts +8 -3
- package/dist/kernel/components/mdx/components/heading.js +32 -116
- package/dist/kernel/components/mdx/components/hr.d.ts +5 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +2 -3
- package/dist/kernel/components/mdx/components/image.js +22 -62
- package/dist/kernel/components/mdx/components/inline-code.js +3 -24
- package/dist/kernel/components/mdx/components/kbd.d.ts +9 -4
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +1 -2
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +13 -41
- package/dist/kernel/components/mdx/components/pre.js +3 -24
- package/dist/kernel/components/mdx/components/strikethrough.js +6 -24
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +6 -28
- package/dist/kernel/components/mdx/components/video-player.js +53 -88
- package/dist/kernel/components/mdx/components/video.js +27 -75
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/error-boundary.js +12 -15
- package/dist/kernel/components/mdx/error-fallback.js +4 -4
- package/dist/kernel/components/mdx/mdx.d.ts +68 -11
- package/dist/kernel/components/mdx/mdx.js +29 -29
- package/dist/kernel/components/mdx/rehype-heading-ids.js +11 -67
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/ui/accordion.js +3 -26
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +23 -7
- package/dist/kernel/components/ui/breadcrumb-trail.js +32 -80
- package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb.js +20 -54
- package/dist/kernel/components/ui/button-group.d.ts +4 -3
- package/dist/kernel/components/ui/button-group.js +7 -30
- package/dist/kernel/components/ui/button.js +13 -36
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +2 -23
- package/dist/kernel/components/ui/dialog.d.ts +9 -9
- package/dist/kernel/components/ui/dialog.js +15 -33
- package/dist/kernel/components/ui/drawer.d.ts +10 -10
- package/dist/kernel/components/ui/drawer.js +15 -33
- package/dist/kernel/components/ui/input.js +6 -30
- package/dist/kernel/components/ui/kbd.js +10 -31
- package/dist/kernel/components/ui/link.d.ts +1 -1
- package/dist/kernel/components/ui/link.js +53 -104
- package/dist/kernel/components/ui/menu.d.ts +21 -21
- package/dist/kernel/components/ui/menu.js +10 -32
- package/dist/kernel/components/ui/meta-key.d.ts +9 -4
- package/dist/kernel/components/ui/meta-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +14 -14
- package/dist/kernel/components/ui/navigation-menu.js +9 -30
- package/dist/kernel/components/ui/popover.d.ts +10 -10
- package/dist/kernel/components/ui/popover.js +19 -34
- package/dist/kernel/components/ui/progress.js +2 -25
- package/dist/kernel/components/ui/scroll-area.js +39 -118
- package/dist/kernel/components/ui/select.d.ts +15 -15
- package/dist/kernel/components/ui/select.js +19 -35
- package/dist/kernel/components/ui/separator.js +2 -25
- package/dist/kernel/components/ui/table.js +2 -23
- package/dist/kernel/components/ui/tabs.js +39 -99
- package/dist/kernel/components/ui/tag.d.ts +2 -2
- package/dist/kernel/components/ui/tag.js +4 -25
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/text.js +3 -25
- package/dist/kernel/components/ui/theme-toggle.d.ts +18 -4
- package/dist/kernel/components/ui/theme-toggle.js +18 -44
- package/dist/kernel/components/ui/toast.d.ts +10 -10
- package/dist/kernel/components/ui/toast.js +13 -35
- package/dist/kernel/components/ui/tooltip.d.ts +8 -8
- package/dist/kernel/components/ui/tooltip.js +8 -29
- package/dist/kernel/defaults.registry.d.ts +1 -1
- package/dist/kernel/defaults.registry.js +2 -2
- package/dist/kernel/framework-icons.d.ts +1 -0
- package/dist/kernel/framework-icons.js +39 -0
- package/dist/kernel/routes/agent/markdown.js +36 -65
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +20 -109
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +46 -127
- package/dist/kernel/routes/metadata/llms.d.ts +1 -2
- package/dist/kernel/routes/metadata/llms.js +40 -120
- package/dist/kernel/routes/metadata/og-image.d.ts +10 -0
- package/dist/kernel/routes/metadata/og-image.js +264 -198
- package/dist/kernel/routes/metadata/robots.d.ts +1 -2
- package/dist/kernel/routes/metadata/robots.js +21 -90
- package/dist/kernel/routes/metadata/sitemap.d.ts +1 -2
- package/dist/kernel/routes/metadata/sitemap.js +36 -102
- package/dist/kernel/routes/pages/group.d.ts +1 -1
- package/dist/kernel/routes/pages/group.js +42 -137
- package/dist/kernel/routes/pages/leaf.d.ts +1 -1
- package/dist/kernel/routes/pages/leaf.js +74 -213
- package/dist/kernel/routes/pages/root.d.ts +1 -1
- package/dist/kernel/routes/pages/root.js +37 -108
- package/dist/keyboard-shortcuts.js +69 -141
- package/dist/link-CYaCRDb6.d.ts +35 -0
- package/dist/resolvers/manifest-resolver.d.ts +3 -3
- package/dist/resolvers/manifest-resolver.js +15 -21
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +81 -4
- package/dist/search.js +124 -195
- package/dist/sidebar-types-Bgchdfd6.d.ts +25 -0
- package/dist/theme-scope.d.ts +15 -0
- package/dist/theme-scope.js +23 -0
- package/dist/types-B_b3C0U6.d.ts +63 -0
- package/dist/types-CIwwieNw.d.ts +127 -0
- package/dist/types-DHBm7-j6.d.ts +57 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.js +1 -1
- package/dist/utils/cn.d.ts +5 -9
- package/dist/utils/cn.js +13 -7
- package/dist/utils/heading-ids.js +20 -47
- package/dist/utils/pretty-date.js +7 -13
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.png +0 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +54 -0
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +31 -0
- package/init/seed/minimal/publish.os/docs/content/theme.mdx +64 -0
- package/init/seed/minimal/publish.os/publish.os.config.json +21 -0
- package/init/seed/minimal/publish.os/theme.css +47 -0
- package/init/seed/minimal/seed.json +13 -0
- package/package.json +469 -35
- package/release/{package.json → app/lucide/package.json} +11 -5
- package/release/app/lucide/pnpm-lock.yaml.template +2905 -0
- package/release/app/lucide/pnpm-workspace.yaml +11 -0
- package/release/app/phosphor/package.json +30 -0
- package/release/app/phosphor/pnpm-lock.yaml.template +2908 -0
- package/release/app/phosphor/pnpm-workspace.yaml +11 -0
- package/release/app/tabler/package.json +30 -0
- package/release/app/tabler/pnpm-lock.yaml.template +2911 -0
- package/release/app/tabler/pnpm-workspace.yaml +11 -0
- package/release/compiler/package.json +20 -0
- package/release/compiler/pnpm-lock.yaml.template +2432 -0
- package/release/compiler/pnpm-workspace.yaml +11 -0
- package/release/release.json +29 -5
- package/release/runtime-pnpm-lock.yaml +0 -1316
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
3
|
+
// src/components/ui/tabs.tsx
|
|
4
4
|
import { Tabs as BaseTabs } from "@base-ui/react/tabs";
|
|
5
|
-
|
|
6
|
-
// src/utils/cn.ts
|
|
7
|
-
import { clsx } from "clsx";
|
|
8
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
9
|
-
var twMerge = extendTailwindMerge({
|
|
10
|
-
extend: {
|
|
11
|
-
classGroups: {
|
|
12
|
-
z: [
|
|
13
|
-
"z-content",
|
|
14
|
-
"z-nav",
|
|
15
|
-
"z-overlay",
|
|
16
|
-
"z-modal",
|
|
17
|
-
"z-search",
|
|
18
|
-
"z-toast",
|
|
19
|
-
"z-progress"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function cn(...inputs) {
|
|
25
|
-
return twMerge(clsx(inputs));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// src/kernel/components/ui/tabs.tsx
|
|
5
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
29
6
|
import { cva } from "class-variance-authority";
|
|
30
7
|
import NextLink from "next/link";
|
|
31
8
|
import {
|
|
@@ -46,12 +23,11 @@ var tabsListVariants = cva("relative inline-flex items-center", {
|
|
|
46
23
|
defaultVariants: {
|
|
47
24
|
variant: "base"
|
|
48
25
|
}
|
|
49
|
-
})
|
|
50
|
-
var tabsTabVariants = cva(
|
|
26
|
+
}), tabsTabVariants = cva(
|
|
51
27
|
[
|
|
52
28
|
"relative inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap text-sm font-medium leading-none outline-none",
|
|
53
29
|
"!no-underline hover:!no-underline active:!no-underline",
|
|
54
|
-
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-
|
|
30
|
+
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-stroke",
|
|
55
31
|
"disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
56
32
|
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
|
|
57
33
|
].join(" "),
|
|
@@ -69,8 +45,8 @@ var tabsTabVariants = cva(
|
|
|
69
45
|
"h-8 rounded-button border border-transparent bg-transparent px-3 text-foreground-2 transition-[background-color,border-color,color,box-shadow] duration-150 ease-out",
|
|
70
46
|
"hover:not-data-disabled:bg-surface-hover hover:not-data-disabled:text-foreground-1",
|
|
71
47
|
"active:not-data-disabled:bg-surface-active",
|
|
72
|
-
"data-active:bg-accent-
|
|
73
|
-
"data-[state=path-active]:bg-accent-
|
|
48
|
+
"data-active:bg-accent-2-hover data-active:text-accent-1",
|
|
49
|
+
"data-[state=path-active]:bg-accent-2-hover data-[state=path-active]:text-accent-1"
|
|
74
50
|
].join(" "),
|
|
75
51
|
underline: [
|
|
76
52
|
"rounded-button px-0 py-2 text-foreground-3 transition-colors duration-150 ease-out",
|
|
@@ -84,8 +60,7 @@ var tabsTabVariants = cva(
|
|
|
84
60
|
variant: "base"
|
|
85
61
|
}
|
|
86
62
|
}
|
|
87
|
-
)
|
|
88
|
-
var tabsIndicatorVariants = cva("pointer-events-none absolute", {
|
|
63
|
+
), tabsIndicatorVariants = cva("pointer-events-none absolute", {
|
|
89
64
|
variants: {
|
|
90
65
|
animation: {
|
|
91
66
|
grow: "",
|
|
@@ -121,13 +96,11 @@ var tabsIndicatorVariants = cva("pointer-events-none absolute", {
|
|
|
121
96
|
animation: "slide",
|
|
122
97
|
variant: "base"
|
|
123
98
|
}
|
|
124
|
-
})
|
|
125
|
-
var tabsGrowIndicatorClassName = [
|
|
99
|
+
}), tabsGrowIndicatorClassName = [
|
|
126
100
|
"absolute rounded-full bg-[var(--tabs-indicator-color,var(--accent-1))]",
|
|
127
101
|
"data-[orientation=horizontal]:bottom-0 data-[orientation=horizontal]:h-full",
|
|
128
102
|
"data-[orientation=vertical]:right-0 data-[orientation=vertical]:w-full"
|
|
129
|
-
].join(" ");
|
|
130
|
-
var TabsStyleContext = createContext(null);
|
|
103
|
+
].join(" "), TabsStyleContext = createContext(null);
|
|
131
104
|
function useTabsStyle() {
|
|
132
105
|
return use(TabsStyleContext) ?? {
|
|
133
106
|
indicatorAnimation: "slide",
|
|
@@ -138,76 +111,49 @@ function resolveTabsVariant(variant) {
|
|
|
138
111
|
return variant ?? "base";
|
|
139
112
|
}
|
|
140
113
|
function mergeBaseUiClassName(className, ...classes) {
|
|
141
|
-
|
|
142
|
-
return (state) => cn(...classes, className(state));
|
|
143
|
-
}
|
|
144
|
-
return cn(...classes, className);
|
|
114
|
+
return typeof className == "function" ? (state) => cn(...classes, className(state)) : cn(...classes, className);
|
|
145
115
|
}
|
|
146
116
|
function cssColorValue(color) {
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
if (color === "current") return "currentColor";
|
|
150
|
-
if (color === "foreground") return "var(--foreground-1)";
|
|
151
|
-
if (color.startsWith("var(")) return color;
|
|
152
|
-
if (color.startsWith("--")) return `var(${color})`;
|
|
153
|
-
return color;
|
|
117
|
+
if (color)
|
|
118
|
+
return color === "accent" ? "var(--accent-1)" : color === "current" ? "currentColor" : color === "foreground" ? "var(--foreground-1)" : color.startsWith("var(") ? color : color.startsWith("--") ? `var(${color})` : color;
|
|
154
119
|
}
|
|
155
120
|
function mergeTabsStyle(style, indicatorColor) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
"--tabs-indicator-color": color
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
121
|
+
let color = cssColorValue(indicatorColor);
|
|
122
|
+
return color ? typeof style == "function" ? (state) => ({
|
|
123
|
+
...style(state),
|
|
124
|
+
"--tabs-indicator-color": color
|
|
125
|
+
}) : {
|
|
165
126
|
...style,
|
|
166
127
|
"--tabs-indicator-color": color
|
|
167
|
-
};
|
|
128
|
+
} : style;
|
|
168
129
|
}
|
|
169
130
|
function tabsSlideClipPath(orientation) {
|
|
170
|
-
|
|
171
|
-
return "inset(var(--active-tab-top) 0 calc(100% - var(--active-tab-top) - var(--active-tab-height)) 0)";
|
|
172
|
-
}
|
|
173
|
-
return "inset(0 calc(100% - var(--active-tab-left) - var(--active-tab-width)) 0 var(--active-tab-left))";
|
|
131
|
+
return orientation === "vertical" ? "inset(var(--active-tab-top) 0 calc(100% - var(--active-tab-top) - var(--active-tab-height)) 0)" : "inset(0 calc(100% - var(--active-tab-left) - var(--active-tab-width)) 0 var(--active-tab-left))";
|
|
174
132
|
}
|
|
175
133
|
function mergeTabsIndicatorStyle(style, indicatorColor, indicatorAnimation) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
clipPath: tabsSlideClipPath(state.orientation)
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
return (state) => ({
|
|
134
|
+
let mergedStyle = mergeTabsStyle(style, indicatorColor);
|
|
135
|
+
return indicatorAnimation !== "slide" ? mergedStyle : typeof mergedStyle == "function" ? (state) => ({
|
|
136
|
+
...mergedStyle(state),
|
|
137
|
+
clipPath: tabsSlideClipPath(state.orientation)
|
|
138
|
+
}) : (state) => ({
|
|
185
139
|
...mergedStyle,
|
|
186
140
|
clipPath: tabsSlideClipPath(state.orientation)
|
|
187
141
|
});
|
|
188
142
|
}
|
|
189
143
|
function mergeRel(rel) {
|
|
190
|
-
|
|
191
|
-
values.add("noopener");
|
|
192
|
-
values.add("noreferrer");
|
|
193
|
-
return Array.from(values).join(" ");
|
|
144
|
+
let values = new Set((rel ?? "").split(/\s+/).filter(Boolean));
|
|
145
|
+
return values.add("noopener"), values.add("noreferrer"), Array.from(values).join(" ");
|
|
194
146
|
}
|
|
195
147
|
function TabsGrowIndicator({
|
|
196
148
|
indicatorProps,
|
|
197
149
|
state
|
|
198
150
|
}) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const activeHeight = state.activeTabSize?.height;
|
|
204
|
-
useLayoutEffect(() => {
|
|
205
|
-
const indicator = indicatorRef.current;
|
|
206
|
-
if (!indicator || activeLeft == null || activeTop == null || activeWidth == null || activeHeight == null || typeof indicator.animate !== "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
151
|
+
let indicatorRef = useRef(null), activeLeft = state.activeTabPosition?.left, activeTop = state.activeTabPosition?.top, activeWidth = state.activeTabSize?.width, activeHeight = state.activeTabSize?.height;
|
|
152
|
+
return useLayoutEffect(() => {
|
|
153
|
+
let indicator = indicatorRef.current;
|
|
154
|
+
if (!indicator || activeLeft == null || activeTop == null || activeWidth == null || activeHeight == null || typeof indicator.animate != "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
207
155
|
return;
|
|
208
|
-
|
|
209
|
-
const isVertical = state.orientation === "vertical";
|
|
210
|
-
const animation = indicator.animate(
|
|
156
|
+
let isVertical = state.orientation === "vertical", animation = indicator.animate(
|
|
211
157
|
[
|
|
212
158
|
{
|
|
213
159
|
opacity: 0.7,
|
|
@@ -226,8 +172,7 @@ function TabsGrowIndicator({
|
|
|
226
172
|
return () => {
|
|
227
173
|
animation.cancel();
|
|
228
174
|
};
|
|
229
|
-
}, [activeHeight, activeLeft, activeTop, activeWidth, state.orientation])
|
|
230
|
-
return /* @__PURE__ */ jsx("span", { ...indicatorProps, children: /* @__PURE__ */ jsx(
|
|
175
|
+
}, [activeHeight, activeLeft, activeTop, activeWidth, state.orientation]), /* @__PURE__ */ jsx("span", { ...indicatorProps, children: /* @__PURE__ */ jsx(
|
|
231
176
|
"span",
|
|
232
177
|
{
|
|
233
178
|
"aria-hidden": "true",
|
|
@@ -255,7 +200,7 @@ function Tabs({
|
|
|
255
200
|
variant = "base",
|
|
256
201
|
...props
|
|
257
202
|
}) {
|
|
258
|
-
|
|
203
|
+
let resolvedVariant = resolveTabsVariant(variant);
|
|
259
204
|
return /* @__PURE__ */ jsx(
|
|
260
205
|
TabsStyleContext,
|
|
261
206
|
{
|
|
@@ -274,8 +219,7 @@ function Tabs({
|
|
|
274
219
|
);
|
|
275
220
|
}
|
|
276
221
|
function TabsList({ className, variant, ...props }) {
|
|
277
|
-
|
|
278
|
-
const resolvedVariant = variant ?? styleContext.variant;
|
|
222
|
+
let styleContext = useTabsStyle(), resolvedVariant = variant ?? styleContext.variant;
|
|
279
223
|
return /* @__PURE__ */ jsx(
|
|
280
224
|
BaseTabs.List,
|
|
281
225
|
{
|
|
@@ -289,8 +233,7 @@ function TabsList({ className, variant, ...props }) {
|
|
|
289
233
|
);
|
|
290
234
|
}
|
|
291
235
|
function TabsTab({ className, variant, ...props }) {
|
|
292
|
-
|
|
293
|
-
const resolvedVariant = variant ?? styleContext.variant;
|
|
236
|
+
let styleContext = useTabsStyle(), resolvedVariant = variant ?? styleContext.variant;
|
|
294
237
|
return /* @__PURE__ */ jsx(
|
|
295
238
|
BaseTabs.Tab,
|
|
296
239
|
{
|
|
@@ -309,7 +252,7 @@ function TabsPanel({ className, ...props }) {
|
|
|
309
252
|
{
|
|
310
253
|
className: mergeBaseUiClassName(
|
|
311
254
|
className,
|
|
312
|
-
"outline-none focus-visible:outline-2 focus-visible:outline-focus-
|
|
255
|
+
"outline-none focus-visible:outline-2 focus-visible:outline-focus-stroke"
|
|
313
256
|
),
|
|
314
257
|
"data-slot": "tabs-panel",
|
|
315
258
|
...props
|
|
@@ -325,10 +268,7 @@ function TabsIndicator({
|
|
|
325
268
|
variant,
|
|
326
269
|
...props
|
|
327
270
|
}) {
|
|
328
|
-
|
|
329
|
-
const resolvedVariant = variant ?? styleContext.variant;
|
|
330
|
-
const resolvedAnimation = indicatorAnimation ?? styleContext.indicatorAnimation;
|
|
331
|
-
const indicatorRender = render ?? (resolvedVariant === "underline" && resolvedAnimation === "grow" ? (indicatorProps, state) => /* @__PURE__ */ jsx(TabsGrowIndicator, { indicatorProps, state }) : void 0);
|
|
271
|
+
let styleContext = useTabsStyle(), resolvedVariant = variant ?? styleContext.variant, resolvedAnimation = indicatorAnimation ?? styleContext.indicatorAnimation, indicatorRender = render ?? (resolvedVariant === "underline" && resolvedAnimation === "grow" ? (indicatorProps, state) => /* @__PURE__ */ jsx(TabsGrowIndicator, { indicatorProps, state }) : void 0);
|
|
332
272
|
return /* @__PURE__ */ jsx(
|
|
333
273
|
BaseTabs.Indicator,
|
|
334
274
|
{
|
|
@@ -368,14 +308,14 @@ function NavigationTabsLink({
|
|
|
368
308
|
target,
|
|
369
309
|
...props
|
|
370
310
|
}) {
|
|
371
|
-
|
|
311
|
+
let { "aria-current": ariaCurrent, ...tabProps } = props;
|
|
372
312
|
return /* @__PURE__ */ jsx(
|
|
373
313
|
TabsTab,
|
|
374
314
|
{
|
|
375
315
|
"aria-current": active ? "page" : ariaCurrent,
|
|
376
316
|
"data-slot": "navigation-tabs-link",
|
|
377
317
|
"data-state": active ? "path-active" : void 0,
|
|
378
|
-
nativeButton:
|
|
318
|
+
nativeButton: !1,
|
|
379
319
|
render: render ?? /* @__PURE__ */ jsx(
|
|
380
320
|
NextLink,
|
|
381
321
|
{
|
|
@@ -4,9 +4,9 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { HTMLAttributes } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const tagVariants: (props?: ({
|
|
7
|
-
borderStyle?: "
|
|
7
|
+
borderStyle?: "dotted" | "solid" | null | undefined;
|
|
8
8
|
tone?: "accent" | "neutral" | null | undefined;
|
|
9
|
-
variant?: "solid" | "
|
|
9
|
+
variant?: "solid" | "outline" | "soft" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
type TagProps = HTMLAttributes<HTMLSpanElement> & VariantProps<typeof tagVariants>;
|
|
12
12
|
declare function Tag({ borderStyle, className, tone, variant, ...props }: TagProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/ui/tag.tsx
|
|
1
|
+
// src/components/ui/tag.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { cva } from "class-variance-authority";
|
|
25
4
|
import { jsx } from "react/jsx-runtime";
|
|
26
5
|
var tagVariants = cva(
|
|
@@ -32,13 +11,13 @@ var tagVariants = cva(
|
|
|
32
11
|
solid: ""
|
|
33
12
|
},
|
|
34
13
|
tone: {
|
|
35
|
-
accent: "[--tag-color:var(--accent-1)] [--tag-solid-background:var(--accent-
|
|
14
|
+
accent: "[--tag-color:var(--accent-1)] [--tag-solid-background:var(--accent-1)] [--tag-solid-foreground:var(--accent-1-foreground)]",
|
|
36
15
|
neutral: "[--tag-color:var(--foreground-2)] [--tag-solid-background:var(--foreground-1)] [--tag-solid-foreground:var(--surface-1)]"
|
|
37
16
|
},
|
|
38
17
|
variant: {
|
|
39
18
|
outline: "border-[color-mix(in_oklch,var(--tag-color)_48%,transparent)] bg-transparent text-[var(--tag-color)]",
|
|
40
19
|
soft: "border-[color-mix(in_oklch,var(--tag-color)_20%,transparent)] bg-[color-mix(in_oklch,var(--tag-color)_9%,transparent)] text-[var(--tag-color)]",
|
|
41
|
-
solid: "border-[color-mix(in_oklch,var(--tag-solid-foreground)_12%,transparent)] bg-[var(--tag-solid-background)] text-[var(--tag-solid-foreground)]
|
|
20
|
+
solid: "border-shadow-4 border-[color-mix(in_oklch,var(--tag-solid-foreground)_12%,transparent)] bg-[var(--tag-solid-background)] text-[var(--tag-solid-foreground)]"
|
|
42
21
|
}
|
|
43
22
|
},
|
|
44
23
|
compoundVariants: [
|
|
@@ -5,8 +5,8 @@ import { ElementType, ComponentPropsWithoutRef } from 'react';
|
|
|
5
5
|
|
|
6
6
|
declare const textVariants: (props?: ({
|
|
7
7
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null | undefined;
|
|
8
|
-
variant?: "body" | "
|
|
9
|
-
weight?: "
|
|
8
|
+
variant?: "body" | "headline" | "label" | "overline" | null | undefined;
|
|
9
|
+
weight?: "default" | "medium" | "semibold" | "bold" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
type TextProps<T extends ElementType = "p"> = {
|
|
12
12
|
as?: T;
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
|
-
var twMerge = extendTailwindMerge({
|
|
5
|
-
extend: {
|
|
6
|
-
classGroups: {
|
|
7
|
-
z: [
|
|
8
|
-
"z-content",
|
|
9
|
-
"z-nav",
|
|
10
|
-
"z-overlay",
|
|
11
|
-
"z-modal",
|
|
12
|
-
"z-search",
|
|
13
|
-
"z-toast",
|
|
14
|
-
"z-progress"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return twMerge(clsx(inputs));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/kernel/components/ui/text.tsx
|
|
1
|
+
// src/components/ui/text.tsx
|
|
2
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
24
3
|
import { cva } from "class-variance-authority";
|
|
25
4
|
import { jsx } from "react/jsx-runtime";
|
|
26
5
|
var textVariants = cva(
|
|
@@ -144,9 +123,8 @@ function Text({
|
|
|
144
123
|
weight,
|
|
145
124
|
...props
|
|
146
125
|
}) {
|
|
147
|
-
const Component = as ?? "p";
|
|
148
126
|
return /* @__PURE__ */ jsx(
|
|
149
|
-
|
|
127
|
+
as ?? "p",
|
|
150
128
|
{
|
|
151
129
|
className: cn(textVariants({ size, variant, weight }), className),
|
|
152
130
|
...props
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import 'class-variance-authority
|
|
4
|
-
import '
|
|
5
|
-
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
5
|
+
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "solid" | "soft" | "outline" | "ghost" | null | undefined;
|
|
8
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
9
|
+
iconOnly?: boolean | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
12
|
+
type ButtonProps = {
|
|
13
|
+
active?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
leftIcon?: ReactNode;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
rightIcon?: ReactNode;
|
|
19
|
+
} & ButtonVariantProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className">;
|
|
6
20
|
|
|
7
21
|
type ThemeToggleProps = Omit<ButtonProps, "children" | "iconOnly" | "leftIcon" | "loading" | "rightIcon">;
|
|
8
22
|
declare function ThemeToggle({ className, onClick, size, title, type, variant, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,44 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
4
|
-
import { Button } from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
classGroups: {
|
|
12
|
-
z: [
|
|
13
|
-
"z-content",
|
|
14
|
-
"z-nav",
|
|
15
|
-
"z-overlay",
|
|
16
|
-
"z-modal",
|
|
17
|
-
"z-search",
|
|
18
|
-
"z-toast",
|
|
19
|
-
"z-progress"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function cn(...inputs) {
|
|
25
|
-
return twMerge(clsx(inputs));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// src/kernel/components/ui/theme-toggle.tsx
|
|
29
|
-
import { Monitor, Moon, Sun } from "lucide-react";
|
|
3
|
+
// src/components/ui/theme-toggle.tsx
|
|
4
|
+
import { Button } from "@publish.os/nextjs/kernel/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
FrameworkMonitorIcon as Monitor,
|
|
7
|
+
FrameworkMoonIcon as Moon,
|
|
8
|
+
FrameworkSunIcon as Sun
|
|
9
|
+
} from "@publish.os/nextjs/kernel/framework-icons";
|
|
10
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
30
11
|
import { useTheme } from "next-themes";
|
|
31
12
|
import { useEffect, useMemo, useState } from "react";
|
|
32
13
|
import { jsx } from "react/jsx-runtime";
|
|
33
14
|
var themeOrder = ["system", "light", "dark"];
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
if (theme === "dark") return /* @__PURE__ */ jsx(Moon, { "aria-hidden": "true", size: 16 });
|
|
37
|
-
return /* @__PURE__ */ jsx(Monitor, { "aria-hidden": "true", size: 16 });
|
|
15
|
+
function ThemeIcon({ theme }) {
|
|
16
|
+
return theme === "light" ? /* @__PURE__ */ jsx(Sun, { "aria-hidden": "true", size: 16 }) : theme === "dark" ? /* @__PURE__ */ jsx(Moon, { "aria-hidden": "true", size: 16 }) : /* @__PURE__ */ jsx(Monitor, { "aria-hidden": "true", size: 16 });
|
|
38
17
|
}
|
|
39
18
|
function normalizeTheme(theme) {
|
|
40
|
-
|
|
41
|
-
return "system";
|
|
19
|
+
return theme === "light" || theme === "dark" ? theme : "system";
|
|
42
20
|
}
|
|
43
21
|
function ThemeToggle({
|
|
44
22
|
className,
|
|
@@ -49,33 +27,29 @@ function ThemeToggle({
|
|
|
49
27
|
variant = "soft",
|
|
50
28
|
...props
|
|
51
29
|
}) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const activeTheme = normalizeTheme(theme);
|
|
55
|
-
const nextTheme = useMemo(() => {
|
|
56
|
-
const index = themeOrder.indexOf(activeTheme);
|
|
30
|
+
let { theme, setTheme } = useTheme(), [mounted, setMounted] = useState(!1), activeTheme = normalizeTheme(theme), nextTheme = useMemo(() => {
|
|
31
|
+
let index = themeOrder.indexOf(activeTheme);
|
|
57
32
|
return themeOrder[(index + 1) % themeOrder.length] ?? "system";
|
|
58
33
|
}, [activeTheme]);
|
|
59
34
|
useEffect(() => {
|
|
60
|
-
setMounted(
|
|
35
|
+
setMounted(!0);
|
|
61
36
|
}, []);
|
|
62
|
-
|
|
37
|
+
let label = mounted ? `Switch to ${nextTheme} theme` : "Theme preference";
|
|
63
38
|
return /* @__PURE__ */ jsx(
|
|
64
39
|
Button,
|
|
65
40
|
{
|
|
66
41
|
"aria-label": props["aria-label"] ?? label,
|
|
67
42
|
className: cn("hover:border-stroke-1", className),
|
|
68
|
-
iconOnly:
|
|
43
|
+
iconOnly: !0,
|
|
69
44
|
onClick: (event) => {
|
|
70
|
-
onClick?.(event);
|
|
71
|
-
if (!event.defaultPrevented) setTheme(nextTheme);
|
|
45
|
+
onClick?.(event), event.defaultPrevented || setTheme(nextTheme);
|
|
72
46
|
},
|
|
73
47
|
size,
|
|
74
48
|
title: title ?? label,
|
|
75
49
|
type,
|
|
76
50
|
variant,
|
|
77
51
|
...props,
|
|
78
|
-
children: /* @__PURE__ */ jsx(
|
|
52
|
+
children: /* @__PURE__ */ jsx(ThemeIcon, { theme: mounted ? activeTheme : "system" })
|
|
79
53
|
}
|
|
80
54
|
);
|
|
81
55
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Toast as Toast$1 } from '@base-ui/react/toast';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentPropsWithRef } from 'react';
|
|
4
4
|
|
|
5
5
|
declare const createToastManager: typeof Toast$1.createToastManager;
|
|
6
6
|
declare const useToastManager: typeof Toast$1.useToastManager;
|
|
7
|
-
type ToastProviderProps =
|
|
8
|
-
type ToastViewportProps =
|
|
9
|
-
type ToastProps =
|
|
10
|
-
type ToastContentProps =
|
|
11
|
-
type ToastTitleProps =
|
|
12
|
-
type ToastDescriptionProps =
|
|
13
|
-
type ToastCloseProps =
|
|
14
|
-
type ToastPortalProps =
|
|
15
|
-
type ToastPositionerProps =
|
|
7
|
+
type ToastProviderProps = ComponentPropsWithRef<typeof Toast$1.Provider>;
|
|
8
|
+
type ToastViewportProps = ComponentPropsWithRef<typeof Toast$1.Viewport>;
|
|
9
|
+
type ToastProps = ComponentPropsWithRef<typeof Toast$1.Root>;
|
|
10
|
+
type ToastContentProps = ComponentPropsWithRef<typeof Toast$1.Content>;
|
|
11
|
+
type ToastTitleProps = ComponentPropsWithRef<typeof Toast$1.Title>;
|
|
12
|
+
type ToastDescriptionProps = ComponentPropsWithRef<typeof Toast$1.Description>;
|
|
13
|
+
type ToastCloseProps = ComponentPropsWithRef<typeof Toast$1.Close>;
|
|
14
|
+
type ToastPortalProps = ComponentPropsWithRef<typeof Toast$1.Portal>;
|
|
15
|
+
type ToastPositionerProps = ComponentPropsWithRef<typeof Toast$1.Positioner>;
|
|
16
16
|
declare function ToastProvider(props: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
17
17
|
declare function ToastViewport({ className, ...props }: ToastViewportProps): react_jsx_runtime.JSX.Element;
|
|
18
18
|
declare function Toast({ className, ...props }: ToastProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/
|
|
3
|
+
// src/components/ui/toast.tsx
|
|
4
4
|
import { Toast as BaseToast } from "@base-ui/react/toast";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { clsx } from "clsx";
|
|
8
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
9
|
-
var twMerge = extendTailwindMerge({
|
|
10
|
-
extend: {
|
|
11
|
-
classGroups: {
|
|
12
|
-
z: [
|
|
13
|
-
"z-content",
|
|
14
|
-
"z-nav",
|
|
15
|
-
"z-overlay",
|
|
16
|
-
"z-modal",
|
|
17
|
-
"z-search",
|
|
18
|
-
"z-toast",
|
|
19
|
-
"z-progress"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
function cn(...inputs) {
|
|
25
|
-
return twMerge(clsx(inputs));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// src/kernel/components/ui/toast.tsx
|
|
5
|
+
import { useThemeScope } from "@publish.os/nextjs/theme-scope";
|
|
6
|
+
import { cn } from "@publish.os/nextjs/utils/cn";
|
|
29
7
|
import { jsx } from "react/jsx-runtime";
|
|
30
|
-
var createToastManager = BaseToast.createToastManager;
|
|
31
|
-
var useToastManager = BaseToast.useToastManager;
|
|
8
|
+
var createToastManager = BaseToast.createToastManager, useToastManager = BaseToast.useToastManager;
|
|
32
9
|
function ToastProvider(props) {
|
|
33
10
|
return /* @__PURE__ */ jsx(BaseToast.Provider, { ...props });
|
|
34
11
|
}
|
|
@@ -37,7 +14,7 @@ function ToastViewport({ className, ...props }) {
|
|
|
37
14
|
BaseToast.Viewport,
|
|
38
15
|
{
|
|
39
16
|
className: cn(
|
|
40
|
-
"fixed bottom-4 right-4 z-
|
|
17
|
+
"fixed bottom-4 right-4 z-toast grid w-[min(92vw,24rem)] gap-2",
|
|
41
18
|
className
|
|
42
19
|
),
|
|
43
20
|
...props
|
|
@@ -49,7 +26,7 @@ function Toast({ className, ...props }) {
|
|
|
49
26
|
BaseToast.Root,
|
|
50
27
|
{
|
|
51
28
|
className: cn(
|
|
52
|
-
"rounded-dialog border border-stroke-2 bg-surface-1 p-4 text-foreground-1 shadow-
|
|
29
|
+
"rounded-dialog border border-toast-stroke-2 bg-toast-surface-1 p-4 text-toast-foreground-1 shadow-toast outline-none",
|
|
53
30
|
className
|
|
54
31
|
),
|
|
55
32
|
...props
|
|
@@ -63,7 +40,7 @@ function ToastTitle({ className, ...props }) {
|
|
|
63
40
|
return /* @__PURE__ */ jsx(
|
|
64
41
|
BaseToast.Title,
|
|
65
42
|
{
|
|
66
|
-
className: cn("text-sm font-semibold text-foreground-1", className),
|
|
43
|
+
className: cn("text-sm font-semibold text-toast-foreground-1", className),
|
|
67
44
|
...props
|
|
68
45
|
}
|
|
69
46
|
);
|
|
@@ -75,7 +52,7 @@ function ToastDescription({
|
|
|
75
52
|
return /* @__PURE__ */ jsx(
|
|
76
53
|
BaseToast.Description,
|
|
77
54
|
{
|
|
78
|
-
className: cn("text-sm leading-6 text-foreground-2", className),
|
|
55
|
+
className: cn("text-sm leading-6 text-toast-foreground-2", className),
|
|
79
56
|
...props
|
|
80
57
|
}
|
|
81
58
|
);
|
|
@@ -85,8 +62,8 @@ function ToastClose({ className, ...props }) {
|
|
|
85
62
|
BaseToast.Close,
|
|
86
63
|
{
|
|
87
64
|
className: cn(
|
|
88
|
-
"inline-flex size-8 items-center justify-center rounded-button text-foreground-3 transition-colors hover:bg-surface-
|
|
89
|
-
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-
|
|
65
|
+
"inline-flex size-8 items-center justify-center rounded-button text-toast-foreground-3 transition-colors hover:bg-toast-surface-3 hover:text-toast-foreground-1",
|
|
66
|
+
"focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-stroke",
|
|
90
67
|
className
|
|
91
68
|
),
|
|
92
69
|
...props
|
|
@@ -94,13 +71,14 @@ function ToastClose({ className, ...props }) {
|
|
|
94
71
|
);
|
|
95
72
|
}
|
|
96
73
|
function ToastPortal(props) {
|
|
97
|
-
|
|
74
|
+
let themeScope = useThemeScope();
|
|
75
|
+
return /* @__PURE__ */ jsx(BaseToast.Portal, { ...props, ...themeScope });
|
|
98
76
|
}
|
|
99
77
|
function ToastPositioner({ className, ...props }) {
|
|
100
78
|
return /* @__PURE__ */ jsx(
|
|
101
79
|
BaseToast.Positioner,
|
|
102
80
|
{
|
|
103
|
-
className: cn("z-
|
|
81
|
+
className: cn("z-toast outline-none", className),
|
|
104
82
|
...props
|
|
105
83
|
}
|
|
106
84
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentPropsWithRef } from 'react';
|
|
4
4
|
|
|
5
|
-
type TooltipProviderProps =
|
|
6
|
-
type TooltipProps =
|
|
7
|
-
type TooltipTriggerProps =
|
|
8
|
-
type TooltipPortalProps =
|
|
9
|
-
type TooltipPositionerProps =
|
|
10
|
-
type TooltipPopupProps =
|
|
11
|
-
type TooltipArrowProps =
|
|
5
|
+
type TooltipProviderProps = ComponentPropsWithRef<typeof Tooltip$1.Provider>;
|
|
6
|
+
type TooltipProps = ComponentPropsWithRef<typeof Tooltip$1.Root>;
|
|
7
|
+
type TooltipTriggerProps = ComponentPropsWithRef<typeof Tooltip$1.Trigger>;
|
|
8
|
+
type TooltipPortalProps = ComponentPropsWithRef<typeof Tooltip$1.Portal>;
|
|
9
|
+
type TooltipPositionerProps = ComponentPropsWithRef<typeof Tooltip$1.Positioner>;
|
|
10
|
+
type TooltipPopupProps = ComponentPropsWithRef<typeof Tooltip$1.Popup>;
|
|
11
|
+
type TooltipArrowProps = ComponentPropsWithRef<typeof Tooltip$1.Arrow>;
|
|
12
12
|
declare function TooltipProvider(props: TooltipProviderProps): react_jsx_runtime.JSX.Element;
|
|
13
13
|
declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
14
14
|
declare function TooltipTrigger({ className, ...props }: TooltipTriggerProps): react_jsx_runtime.JSX.Element;
|