@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.
Files changed (220) hide show
  1. package/README.md +3 -5
  2. package/compiler-assets/nextjs/defaults/app/globals.css +6 -0
  3. package/compiler-assets/nextjs/defaults/group/layout.tsx +23 -0
  4. package/compiler-assets/nextjs/defaults/group/leaf.tsx +48 -0
  5. package/compiler-assets/nextjs/defaults/group/page.tsx +50 -0
  6. package/compiler-assets/nextjs/defaults/project/next.config.mjs +45 -0
  7. package/compiler-assets/nextjs/defaults/project/postcss.config.mjs +5 -0
  8. package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +41 -0
  9. package/compiler-assets/nextjs/defaults/root/css/animation.css +90 -0
  10. package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +21 -0
  11. package/compiler-assets/nextjs/defaults/root/css/components/drawer.css +21 -0
  12. package/compiler-assets/nextjs/defaults/root/css/components/menu.css +23 -0
  13. package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +25 -0
  14. package/compiler-assets/nextjs/defaults/root/css/components/popover.css +17 -0
  15. package/compiler-assets/nextjs/defaults/root/css/components/select.css +23 -0
  16. package/compiler-assets/nextjs/defaults/root/css/components/toast.css +19 -0
  17. package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +15 -0
  18. package/compiler-assets/nextjs/defaults/root/css/layout.css +22 -0
  19. package/compiler-assets/nextjs/defaults/root/css/media.css +81 -0
  20. package/compiler-assets/nextjs/defaults/root/css/radius.css +49 -0
  21. package/compiler-assets/nextjs/defaults/root/css/scrollbar.css +43 -0
  22. package/compiler-assets/nextjs/defaults/root/css/shadow.css +145 -0
  23. package/compiler-assets/nextjs/defaults/root/css/typography.css +607 -0
  24. package/compiler-assets/nextjs/defaults/root/css/zindex.css +39 -0
  25. package/compiler-assets/nextjs/defaults/root/globals.css +191 -0
  26. package/compiler-assets/nextjs/defaults/root/layout.tsx +19 -0
  27. package/compiler-assets/nextjs/defaults/root/page.tsx +61 -0
  28. package/compiler-assets/nextjs/defaults/root/theme.css +50 -0
  29. package/compiler-assets/nextjs/defaults/source/_internal/logger.ts +21 -0
  30. package/compiler-assets/nextjs/shims/generated-group-layout.tsx +19 -0
  31. package/compiler-assets/nextjs/shims/generated-group-page.tsx +18 -0
  32. package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +21 -0
  33. package/compiler-assets/nextjs/shims/global-layout.tsx +134 -0
  34. package/compiler-assets/nextjs/shims/markdown-route.ts +29 -0
  35. package/compiler-assets/nextjs/shims/og-image-route.ts +18 -0
  36. package/compiler-assets/nextjs/shims/powered-by-footer.tsx +40 -0
  37. package/compiler-assets/nextjs/shims/providers.tsx +13 -0
  38. package/compiler-assets/nextjs/shims/proxy.ts +317 -0
  39. package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +77 -0
  40. package/compiler-assets/nextjs/shims/root-page.tsx +13 -0
  41. package/compiler-assets/nextjs/shims/theme-defaults.css +177 -0
  42. package/dist/button-CFdx-ohV.d.ts +20 -0
  43. package/dist/cache/tags.js +6 -14
  44. package/dist/compiler.d.ts +100 -0
  45. package/dist/compiler.js +13379 -0
  46. package/dist/config/createNextConfig.d.ts +2 -1
  47. package/dist/config/createNextConfig.js +16 -12
  48. package/dist/icons.d.ts +1 -0
  49. package/dist/icons.js +2 -0
  50. package/dist/index.d.ts +303 -15
  51. package/dist/index.js +30 -1198
  52. package/dist/kernel/components/blocks/AgentActions.d.ts +9 -3
  53. package/dist/kernel/components/blocks/AgentActions.js +114 -200
  54. package/dist/kernel/components/blocks/animated-icon-swap.js +4 -25
  55. package/dist/kernel/components/blocks/color-palette.js +88 -169
  56. package/dist/kernel/components/blocks/design-system-preview.d.ts +38 -6
  57. package/dist/kernel/components/blocks/design-system-preview.js +44 -52
  58. package/dist/kernel/components/blocks/link-playground.js +23 -71
  59. package/dist/kernel/components/blocks/logo-block.js +18 -47
  60. package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +1 -1
  61. package/dist/kernel/components/blocks/nav-breadcrumb.js +28 -42
  62. package/dist/kernel/components/blocks/navbar.d.ts +1 -1
  63. package/dist/kernel/components/blocks/navbar.js +14 -41
  64. package/dist/kernel/components/blocks/navigation-progress-playground.js +56 -149
  65. package/dist/kernel/components/blocks/navigation-progress.js +53 -157
  66. package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
  67. package/dist/kernel/components/blocks/next-prev.js +16 -42
  68. package/dist/kernel/components/blocks/page-list.d.ts +1 -1
  69. package/dist/kernel/components/blocks/page-list.js +11 -16
  70. package/dist/kernel/components/blocks/search.d.ts +13 -2
  71. package/dist/kernel/components/blocks/search.js +116 -247
  72. package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
  73. package/dist/kernel/components/blocks/sidebar-node.js +56 -95
  74. package/dist/kernel/components/blocks/sidebar.d.ts +5 -23
  75. package/dist/kernel/components/blocks/sidebar.js +35 -103
  76. package/dist/kernel/components/blocks/theme-toggle.d.ts +7 -3
  77. package/dist/kernel/components/blocks/theme-toggle.js +2 -2
  78. package/dist/kernel/components/blocks/toc.js +42 -178
  79. package/dist/kernel/components/mdx/components/blockquote.js +3 -24
  80. package/dist/kernel/components/mdx/components/callout.d.ts +1 -1
  81. package/dist/kernel/components/mdx/components/callout.js +15 -47
  82. package/dist/kernel/components/mdx/components/code-block.js +2 -2
  83. package/dist/kernel/components/mdx/components/figure-caption.js +6 -24
  84. package/dist/kernel/components/mdx/components/figure.js +9 -36
  85. package/dist/kernel/components/mdx/components/footnotes.js +3 -24
  86. package/dist/kernel/components/mdx/components/heading-copy-link.js +13 -37
  87. package/dist/kernel/components/mdx/components/heading.d.ts +8 -3
  88. package/dist/kernel/components/mdx/components/heading.js +32 -116
  89. package/dist/kernel/components/mdx/components/hr.d.ts +5 -3
  90. package/dist/kernel/components/mdx/components/hr.js +2 -2
  91. package/dist/kernel/components/mdx/components/image-zoom.js +2 -3
  92. package/dist/kernel/components/mdx/components/image.js +22 -62
  93. package/dist/kernel/components/mdx/components/inline-code.js +3 -24
  94. package/dist/kernel/components/mdx/components/kbd.d.ts +9 -4
  95. package/dist/kernel/components/mdx/components/kbd.js +2 -2
  96. package/dist/kernel/components/mdx/components/link.d.ts +1 -2
  97. package/dist/kernel/components/mdx/components/link.js +2 -2
  98. package/dist/kernel/components/mdx/components/paragraph.js +13 -41
  99. package/dist/kernel/components/mdx/components/pre.js +3 -24
  100. package/dist/kernel/components/mdx/components/strikethrough.js +6 -24
  101. package/dist/kernel/components/mdx/components/table.js +2 -2
  102. package/dist/kernel/components/mdx/components/task-list.js +6 -28
  103. package/dist/kernel/components/mdx/components/video-player.js +53 -88
  104. package/dist/kernel/components/mdx/components/video.js +27 -75
  105. package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
  106. package/dist/kernel/components/mdx/error-boundary.js +12 -15
  107. package/dist/kernel/components/mdx/error-fallback.js +4 -4
  108. package/dist/kernel/components/mdx/mdx.d.ts +68 -11
  109. package/dist/kernel/components/mdx/mdx.js +29 -29
  110. package/dist/kernel/components/mdx/rehype-heading-ids.js +11 -67
  111. package/dist/kernel/components/mdx/types.d.ts +1 -1
  112. package/dist/kernel/components/ui/accordion.js +3 -26
  113. package/dist/kernel/components/ui/breadcrumb-trail.d.ts +23 -7
  114. package/dist/kernel/components/ui/breadcrumb-trail.js +32 -80
  115. package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
  116. package/dist/kernel/components/ui/breadcrumb.js +20 -54
  117. package/dist/kernel/components/ui/button-group.d.ts +4 -3
  118. package/dist/kernel/components/ui/button-group.js +7 -30
  119. package/dist/kernel/components/ui/button.js +13 -36
  120. package/dist/kernel/components/ui/card.d.ts +2 -2
  121. package/dist/kernel/components/ui/card.js +2 -23
  122. package/dist/kernel/components/ui/dialog.d.ts +9 -9
  123. package/dist/kernel/components/ui/dialog.js +15 -33
  124. package/dist/kernel/components/ui/drawer.d.ts +10 -10
  125. package/dist/kernel/components/ui/drawer.js +15 -33
  126. package/dist/kernel/components/ui/input.js +6 -30
  127. package/dist/kernel/components/ui/kbd.js +10 -31
  128. package/dist/kernel/components/ui/link.d.ts +1 -1
  129. package/dist/kernel/components/ui/link.js +53 -104
  130. package/dist/kernel/components/ui/menu.d.ts +21 -21
  131. package/dist/kernel/components/ui/menu.js +10 -32
  132. package/dist/kernel/components/ui/meta-key.d.ts +9 -4
  133. package/dist/kernel/components/ui/meta-key.js +2 -2
  134. package/dist/kernel/components/ui/navigation-menu.d.ts +14 -14
  135. package/dist/kernel/components/ui/navigation-menu.js +9 -30
  136. package/dist/kernel/components/ui/popover.d.ts +10 -10
  137. package/dist/kernel/components/ui/popover.js +19 -34
  138. package/dist/kernel/components/ui/progress.js +2 -25
  139. package/dist/kernel/components/ui/scroll-area.js +39 -118
  140. package/dist/kernel/components/ui/select.d.ts +15 -15
  141. package/dist/kernel/components/ui/select.js +19 -35
  142. package/dist/kernel/components/ui/separator.js +2 -25
  143. package/dist/kernel/components/ui/table.js +2 -23
  144. package/dist/kernel/components/ui/tabs.js +39 -99
  145. package/dist/kernel/components/ui/tag.d.ts +2 -2
  146. package/dist/kernel/components/ui/tag.js +4 -25
  147. package/dist/kernel/components/ui/text.d.ts +2 -2
  148. package/dist/kernel/components/ui/text.js +3 -25
  149. package/dist/kernel/components/ui/theme-toggle.d.ts +18 -4
  150. package/dist/kernel/components/ui/theme-toggle.js +18 -44
  151. package/dist/kernel/components/ui/toast.d.ts +10 -10
  152. package/dist/kernel/components/ui/toast.js +13 -35
  153. package/dist/kernel/components/ui/tooltip.d.ts +8 -8
  154. package/dist/kernel/components/ui/tooltip.js +8 -29
  155. package/dist/kernel/defaults.registry.d.ts +1 -1
  156. package/dist/kernel/defaults.registry.js +2 -2
  157. package/dist/kernel/framework-icons.d.ts +1 -0
  158. package/dist/kernel/framework-icons.js +39 -0
  159. package/dist/kernel/routes/agent/markdown.js +36 -65
  160. package/dist/kernel/routes/layouts/group.d.ts +1 -1
  161. package/dist/kernel/routes/layouts/group.js +20 -109
  162. package/dist/kernel/routes/metadata/feed.d.ts +1 -2
  163. package/dist/kernel/routes/metadata/feed.js +46 -127
  164. package/dist/kernel/routes/metadata/llms.d.ts +1 -2
  165. package/dist/kernel/routes/metadata/llms.js +40 -120
  166. package/dist/kernel/routes/metadata/og-image.d.ts +10 -0
  167. package/dist/kernel/routes/metadata/og-image.js +264 -198
  168. package/dist/kernel/routes/metadata/robots.d.ts +1 -2
  169. package/dist/kernel/routes/metadata/robots.js +21 -90
  170. package/dist/kernel/routes/metadata/sitemap.d.ts +1 -2
  171. package/dist/kernel/routes/metadata/sitemap.js +36 -102
  172. package/dist/kernel/routes/pages/group.d.ts +1 -1
  173. package/dist/kernel/routes/pages/group.js +42 -137
  174. package/dist/kernel/routes/pages/leaf.d.ts +1 -1
  175. package/dist/kernel/routes/pages/leaf.js +74 -213
  176. package/dist/kernel/routes/pages/root.d.ts +1 -1
  177. package/dist/kernel/routes/pages/root.js +37 -108
  178. package/dist/keyboard-shortcuts.js +69 -141
  179. package/dist/link-CYaCRDb6.d.ts +35 -0
  180. package/dist/resolvers/manifest-resolver.d.ts +3 -3
  181. package/dist/resolvers/manifest-resolver.js +15 -21
  182. package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
  183. package/dist/search.d.ts +81 -4
  184. package/dist/search.js +124 -195
  185. package/dist/sidebar-types-Bgchdfd6.d.ts +25 -0
  186. package/dist/theme-scope.d.ts +15 -0
  187. package/dist/theme-scope.js +23 -0
  188. package/dist/types-B_b3C0U6.d.ts +63 -0
  189. package/dist/types-CIwwieNw.d.ts +127 -0
  190. package/dist/types-DHBm7-j6.d.ts +57 -0
  191. package/dist/types-sM2g9nW0.d.ts +12 -0
  192. package/dist/types.d.ts +0 -1
  193. package/dist/types.js +1 -1
  194. package/dist/utils/cn.d.ts +5 -9
  195. package/dist/utils/cn.js +13 -7
  196. package/dist/utils/heading-ids.js +20 -47
  197. package/dist/utils/pretty-date.js +7 -13
  198. package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.dark.png +0 -0
  199. package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.png +0 -0
  200. package/init/seed/minimal/publish.os/docs/content/get-started.mdx +54 -0
  201. package/init/seed/minimal/publish.os/docs/content/groups.mdx +31 -0
  202. package/init/seed/minimal/publish.os/docs/content/theme.mdx +64 -0
  203. package/init/seed/minimal/publish.os/publish.os.config.json +21 -0
  204. package/init/seed/minimal/publish.os/theme.css +47 -0
  205. package/init/seed/minimal/seed.json +13 -0
  206. package/package.json +469 -35
  207. package/release/{package.json → app/lucide/package.json} +11 -5
  208. package/release/app/lucide/pnpm-lock.yaml.template +2905 -0
  209. package/release/app/lucide/pnpm-workspace.yaml +11 -0
  210. package/release/app/phosphor/package.json +30 -0
  211. package/release/app/phosphor/pnpm-lock.yaml.template +2908 -0
  212. package/release/app/phosphor/pnpm-workspace.yaml +11 -0
  213. package/release/app/tabler/package.json +30 -0
  214. package/release/app/tabler/pnpm-lock.yaml.template +2911 -0
  215. package/release/app/tabler/pnpm-workspace.yaml +11 -0
  216. package/release/compiler/package.json +20 -0
  217. package/release/compiler/pnpm-lock.yaml.template +2432 -0
  218. package/release/compiler/pnpm-workspace.yaml +11 -0
  219. package/release/release.json +29 -5
  220. package/release/runtime-pnpm-lock.yaml +0 -1316
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LogoBlockLogo, LogoBlockAsset } from './logo-block.js';
3
- import { SiteData, TreeNode } from '@publish.os/nextjs/types';
3
+ import { S as SiteData, T as TreeNode } from '../../../types-B_b3C0U6.js';
4
4
 
5
5
  type NavbarProps = {
6
6
  logo?: NavbarLogo;
@@ -1,58 +1,32 @@
1
1
  "use client";
2
2
 
3
- // src/kernel/components/blocks/navbar.tsx
3
+ // src/components/block/navigation/navbar.tsx
4
4
  import {
5
5
  LogoBlock
6
- } from "./logo-block.js";
7
- import { NavBreadcrumb } from "./nav-breadcrumb.js";
8
- import { Search } from "./search.js";
9
- import { ThemeToggle } from "./theme-toggle.js";
10
- import { Link } from "../ui/link.js";
11
-
12
- // src/utils/cn.ts
13
- import { clsx } from "clsx";
14
- import { extendTailwindMerge } from "tailwind-merge";
15
- var twMerge = extendTailwindMerge({
16
- extend: {
17
- classGroups: {
18
- z: [
19
- "z-content",
20
- "z-nav",
21
- "z-overlay",
22
- "z-modal",
23
- "z-search",
24
- "z-toast",
25
- "z-progress"
26
- ]
27
- }
28
- }
29
- });
30
- function cn(...inputs) {
31
- return twMerge(clsx(inputs));
32
- }
33
-
34
- // src/kernel/components/blocks/navbar.tsx
35
- import { ArrowRight } from "lucide-react";
6
+ } from "@publish.os/nextjs/kernel/components/blocks/logo-block";
7
+ import { NavBreadcrumb } from "@publish.os/nextjs/kernel/components/blocks/nav-breadcrumb";
8
+ import { Search } from "@publish.os/nextjs/kernel/components/blocks/search";
9
+ import { ThemeToggle } from "@publish.os/nextjs/kernel/components/blocks/theme-toggle";
10
+ import { Link } from "@publish.os/nextjs/kernel/components/ui/link";
11
+ import { FrameworkArrowRightIcon as ArrowRight } from "@publish.os/nextjs/kernel/framework-icons";
12
+ import { cn } from "@publish.os/nextjs/utils/cn";
36
13
  import NextLink from "next/link";
37
14
  import { usePathname } from "next/navigation";
38
15
  import { jsx, jsxs } from "react/jsx-runtime";
39
16
  function hasPath(node) {
40
- return "path" in node && typeof node.path === "string";
17
+ return "path" in node && typeof node.path == "string";
41
18
  }
42
19
  function isTopLevelGroup(node) {
43
- return node.type === "section" && typeof node.group === "string" && !node.group.includes("/");
20
+ return node.type === "section" && typeof node.group == "string" && !node.group.includes("/");
44
21
  }
45
22
  function Navbar({
46
23
  logo,
47
24
  site,
48
25
  siteTitle,
49
- showThemeToggle = true,
26
+ showThemeToggle = !0,
50
27
  tree
51
28
  }) {
52
- const pathname = usePathname() || "/";
53
- const headerSite = site ?? { name: siteTitle ?? "Site" };
54
- const groups = tree.filter(hasPath).filter(isTopLevelGroup);
55
- const activeGroupPath = groups.map((group) => group.path).filter((path) => pathname === path || pathname.startsWith(`${path}/`)).sort((a, b) => b.length - a.length)[0];
29
+ let pathname = usePathname() || "/", headerSite = site ?? { name: siteTitle ?? "Site" }, groups = tree.filter(hasPath).filter(isTopLevelGroup), activeGroupPath = groups.map((group) => group.path).filter((path) => pathname === path || pathname.startsWith(`${path}/`)).sort((a, b) => b.length - a.length)[0];
56
30
  return /* @__PURE__ */ jsx("header", { className: "sticky top-0 z-nav border-b border-stroke-3 bg-surface-2 [anchor-name:--global-navbar]", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex min-h-[var(--layout-global-nav-height)] w-full max-w-(--layout-site-max-width) flex-col gap-3 border-x border-stroke-3 px-5 py-3 md:flex-row md:items-center md:gap-4 md:py-2 lg:px-6", children: [
57
31
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
58
32
  /* @__PURE__ */ jsx(
@@ -69,7 +43,7 @@ function Navbar({
69
43
  NavBreadcrumb,
70
44
  {
71
45
  currentPath: pathname,
72
- showRoot: false,
46
+ showRoot: !1,
73
47
  site: headerSite,
74
48
  tree
75
49
  }
@@ -82,8 +56,7 @@ function Navbar({
82
56
  "aria-label": "Groups",
83
57
  className: "flex min-w-0 flex-wrap items-center gap-2 text-sm",
84
58
  children: groups.map((group) => {
85
- const path = group.path;
86
- const active = path === activeGroupPath;
59
+ let path = group.path, active = path === activeGroupPath;
87
60
  return /* @__PURE__ */ jsx(
88
61
  Link,
89
62
  {
@@ -1,37 +1,14 @@
1
1
  "use client";
2
2
 
3
- // src/kernel/components/blocks/navigation-progress-playground.tsx
4
- import { Button } from "../ui/button.js";
3
+ // src/modules/design-system/navigation-progress-playground.tsx
4
+ import { Button } from "@publish.os/nextjs/kernel/components/ui/button";
5
5
  import {
6
6
  Progress,
7
7
  ProgressIndicator,
8
8
  ProgressTrack
9
- } from "../ui/progress.js";
10
- import { Tabs, TabsList, TabsPanel, TabsTab } from "../ui/tabs.js";
11
-
12
- // src/utils/cn.ts
13
- import { clsx } from "clsx";
14
- import { extendTailwindMerge } from "tailwind-merge";
15
- var twMerge = extendTailwindMerge({
16
- extend: {
17
- classGroups: {
18
- z: [
19
- "z-content",
20
- "z-nav",
21
- "z-overlay",
22
- "z-modal",
23
- "z-search",
24
- "z-toast",
25
- "z-progress"
26
- ]
27
- }
28
- }
29
- });
30
- function cn(...inputs) {
31
- return twMerge(clsx(inputs));
32
- }
33
-
34
- // src/kernel/components/blocks/navigation-progress-playground.tsx
9
+ } from "@publish.os/nextjs/kernel/components/ui/progress";
10
+ import { Tabs, TabsList, TabsPanel, TabsTab } from "@publish.os/nextjs/kernel/components/ui/tabs";
11
+ import { cn } from "@publish.os/nextjs/utils/cn";
35
12
  import {
36
13
  useCallback,
37
14
  useEffect,
@@ -59,8 +36,8 @@ var presets = {
59
36
  transitionDuration: 320,
60
37
  curvePower: 3,
61
38
  height: 2,
62
- fill: "var(--progress-bar-fill, var(--accent-1, #111111))",
63
- track: "var(--progress-bar-background, transparent)",
39
+ fill: "var(--progress-indicator-surface)",
40
+ track: "var(--progress-track-surface)",
64
41
  progressEase: "cubic-bezier(0.21, 0.65, 0.35, 1)",
65
42
  exitEase: "cubic-bezier(0.55, 0.06, 0.68, 0.19)",
66
43
  transformOrigin: "left",
@@ -109,16 +86,15 @@ var presets = {
109
86
  transitionDuration: 180,
110
87
  curvePower: 2.6,
111
88
  height: 2,
112
- fill: "var(--progress-bar-fill, var(--accent-1, #111111))",
113
- track: "var(--progress-bar-background, transparent)",
89
+ fill: "var(--progress-indicator-surface)",
90
+ track: "var(--progress-track-surface)",
114
91
  progressEase: "cubic-bezier(0.12, 0.72, 0, 1)",
115
92
  exitEase: "cubic-bezier(0.2, 0, 0, 1)",
116
93
  transformOrigin: "left",
117
94
  exitTransformOrigin: "right"
118
95
  }
119
96
  }
120
- };
121
- var presetOrder = ["current", "aave", "tuned"];
97
+ }, presetOrder = ["current", "aave", "tuned"];
122
98
  function clamp({
123
99
  max,
124
100
  min,
@@ -145,7 +121,7 @@ const sampleDuration =
145
121
  :root {
146
122
  --animation-ease-progress: ${settings.progressEase};
147
123
  --animation-ease-progress-exit: ${settings.exitEase};
148
- --progress-bar-height: ${settings.height}px;
124
+ --progress-height: ${settings.height}px;
149
125
  }
150
126
 
151
127
  /* NavigationProgress indicator */
@@ -157,12 +133,11 @@ style={{
157
133
  }}
158
134
 
159
135
  /* Theme tokens */
160
- --progress-bar-fill: ${settings.fill};
161
- --progress-bar-background: ${settings.track};`;
136
+ --progress-indicator-surface: ${settings.fill};
137
+ --progress-track-surface: ${settings.track};`;
162
138
  }
163
139
  function randomDuration({ max, min }) {
164
- const lower = Math.min(min, max);
165
- const upper = Math.max(min, max);
140
+ let lower = Math.min(min, max), upper = Math.max(min, max);
166
141
  return Math.round(lower + Math.random() * (upper - lower));
167
142
  }
168
143
  function NumberControl({
@@ -174,8 +149,7 @@ function NumberControl({
174
149
  unit,
175
150
  value
176
151
  }) {
177
- const id = useId();
178
- const handleChange = (event) => {
152
+ let id = useId(), handleChange = (event) => {
179
153
  onChange(Number(event.target.value));
180
154
  };
181
155
  return /* @__PURE__ */ jsxs("div", { className: "grid gap-2", children: [
@@ -197,7 +171,7 @@ function NumberControl({
197
171
  /* @__PURE__ */ jsx(
198
172
  "input",
199
173
  {
200
- className: "h-1 w-full accent-foreground-1",
174
+ className: "h-1 w-full accent-1-foreground-1",
201
175
  id,
202
176
  max,
203
177
  min,
@@ -227,7 +201,7 @@ function TextControl({
227
201
  onChange,
228
202
  value
229
203
  }) {
230
- const id = useId();
204
+ let id = useId();
231
205
  return /* @__PURE__ */ jsxs(
232
206
  "label",
233
207
  {
@@ -241,7 +215,7 @@ function TextControl({
241
215
  className: "h-8 rounded-button border border-stroke-2 bg-surface-1 px-2 font-mono text-xs text-foreground-1 outline-none focus:border-accent-1",
242
216
  id,
243
217
  onChange: (event) => onChange(event.target.value),
244
- spellCheck: false,
218
+ spellCheck: !1,
245
219
  value
246
220
  }
247
221
  )
@@ -285,9 +259,7 @@ function ProgressPreview({
285
259
  progress,
286
260
  settings
287
261
  }) {
288
- const isVisible = progress > 0;
289
- const boundedProgress = clamp({ max: 100, min: 0, value: progress });
290
- const indicatorStyle = {
262
+ let isVisible = progress > 0, boundedProgress = clamp({ max: 100, min: 0, value: progress }), indicatorStyle = {
291
263
  background: settings.fill,
292
264
  transform: isExiting ? "scaleX(0)" : `scaleX(${boundedProgress / 100})`,
293
265
  transformOrigin: isExiting ? settings.exitTransformOrigin : settings.transformOrigin,
@@ -321,125 +293,60 @@ function ProgressPreview({
321
293
  );
322
294
  }
323
295
  function NavigationProgressPlayground() {
324
- const [settings, setSettings] = useState(
296
+ let [settings, setSettings] = useState(
325
297
  presets.tuned.settings
326
- );
327
- const [activePreset, setActivePreset] = useState("tuned");
328
- const [progress, setProgress] = useState(0);
329
- const [isExiting, setIsExiting] = useState(false);
330
- const [isRunning, setIsRunning] = useState(false);
331
- const [copyState, setCopyState] = useState("idle");
332
- const [sampleDuration, setSampleDuration] = useState(null);
333
- const animationFrame = useRef(null);
334
- const completionTimer = useRef(null);
335
- const settleTimer = useRef(null);
336
- const exitTimer = useRef(null);
337
- const activeNavigation = useRef(false);
338
- const output = useMemo(() => buildOutput(settings), [settings]);
339
- const clearTimers = useCallback(() => {
340
- if (animationFrame.current) cancelAnimationFrame(animationFrame.current);
341
- if (completionTimer.current) clearTimeout(completionTimer.current);
342
- if (settleTimer.current) clearTimeout(settleTimer.current);
343
- if (exitTimer.current) clearTimeout(exitTimer.current);
344
- animationFrame.current = null;
345
- completionTimer.current = null;
346
- settleTimer.current = null;
347
- exitTimer.current = null;
348
- }, []);
349
- const resetSample = useCallback(() => {
350
- clearTimers();
351
- activeNavigation.current = false;
352
- setProgress(0);
353
- setIsExiting(false);
354
- setIsRunning(false);
355
- setSampleDuration(null);
356
- }, [clearTimers]);
357
- const completeSample = useCallback(() => {
358
- if (!activeNavigation.current) return;
359
- if (animationFrame.current) {
360
- cancelAnimationFrame(animationFrame.current);
361
- animationFrame.current = null;
362
- }
363
- if (completionTimer.current) {
364
- clearTimeout(completionTimer.current);
365
- completionTimer.current = null;
366
- }
367
- setProgress(100);
368
- settleTimer.current = setTimeout(() => {
369
- if (!activeNavigation.current) return;
370
- setIsExiting(true);
371
- exitTimer.current = setTimeout(() => {
372
- setProgress(0);
373
- setIsExiting(false);
374
- setIsRunning(false);
375
- activeNavigation.current = false;
376
- exitTimer.current = null;
377
- }, settings.exitDuration);
378
- }, settings.settleDelay);
379
- }, [settings.exitDuration, settings.settleDelay]);
380
- const startSample = useCallback(() => {
381
- resetSample();
382
- activeNavigation.current = true;
383
- setIsRunning(true);
384
- setIsExiting(false);
385
- setProgress(settings.initialProgress);
386
- const startTime = performance.now();
387
- const routeDuration = randomDuration({
298
+ ), [activePreset, setActivePreset] = useState("tuned"), [progress, setProgress] = useState(0), [isExiting, setIsExiting] = useState(!1), [isRunning, setIsRunning] = useState(!1), [copyState, setCopyState] = useState("idle"), [sampleDuration, setSampleDuration] = useState(null), animationFrame = useRef(null), completionTimer = useRef(null), settleTimer = useRef(null), exitTimer = useRef(null), activeNavigation = useRef(!1), output = useMemo(() => buildOutput(settings), [settings]), clearTimers = useCallback(() => {
299
+ animationFrame.current && cancelAnimationFrame(animationFrame.current), completionTimer.current && clearTimeout(completionTimer.current), settleTimer.current && clearTimeout(settleTimer.current), exitTimer.current && clearTimeout(exitTimer.current), animationFrame.current = null, completionTimer.current = null, settleTimer.current = null, exitTimer.current = null;
300
+ }, []), resetSample = useCallback(() => {
301
+ clearTimers(), activeNavigation.current = !1, setProgress(0), setIsExiting(!1), setIsRunning(!1), setSampleDuration(null);
302
+ }, [clearTimers]), completeSample = useCallback(() => {
303
+ activeNavigation.current && (animationFrame.current && (cancelAnimationFrame(animationFrame.current), animationFrame.current = null), completionTimer.current && (clearTimeout(completionTimer.current), completionTimer.current = null), setProgress(100), settleTimer.current = setTimeout(() => {
304
+ activeNavigation.current && (setIsExiting(!0), exitTimer.current = setTimeout(() => {
305
+ setProgress(0), setIsExiting(!1), setIsRunning(!1), activeNavigation.current = !1, exitTimer.current = null;
306
+ }, settings.exitDuration));
307
+ }, settings.settleDelay));
308
+ }, [settings.exitDuration, settings.settleDelay]), startSample = useCallback(() => {
309
+ resetSample(), activeNavigation.current = !0, setIsRunning(!0), setIsExiting(!1), setProgress(settings.initialProgress);
310
+ let startTime = performance.now(), routeDuration = randomDuration({
388
311
  max: settings.sampleMaxDuration,
389
312
  min: settings.sampleMinDuration
390
313
  });
391
314
  setSampleDuration(routeDuration);
392
- const animate = () => {
315
+ let animate = () => {
393
316
  if (!activeNavigation.current) return;
394
- const elapsed = performance.now() - startTime;
395
- let progressValue;
396
- if (elapsed < settings.minDuration) {
317
+ let elapsed = performance.now() - startTime, progressValue;
318
+ if (elapsed < settings.minDuration)
397
319
  progressValue = settings.initialProgress + elapsed / settings.minDuration * (settings.fastPhaseEnd - settings.initialProgress);
398
- } else {
399
- const remainingProgress = settings.targetProgress - settings.fastPhaseEnd;
400
- const normalizedTime = clamp({
320
+ else {
321
+ let remainingProgress = settings.targetProgress - settings.fastPhaseEnd, easedTime = 1 - (1 - clamp({
401
322
  max: 1,
402
323
  min: 0,
403
324
  value: (elapsed - settings.minDuration) / (settings.maxDuration - settings.minDuration)
404
- });
405
- const easedTime = 1 - (1 - normalizedTime) ** settings.curvePower;
325
+ })) ** settings.curvePower;
406
326
  progressValue = settings.fastPhaseEnd + easedTime * remainingProgress;
407
327
  }
408
328
  setProgress(
409
329
  clamp({ max: settings.targetProgress, min: 0, value: progressValue })
410
- );
411
- animationFrame.current = requestAnimationFrame(animate);
330
+ ), animationFrame.current = requestAnimationFrame(animate);
412
331
  };
413
- animationFrame.current = requestAnimationFrame(animate);
414
- completionTimer.current = setTimeout(completeSample, routeDuration);
332
+ animationFrame.current = requestAnimationFrame(animate), completionTimer.current = setTimeout(completeSample, routeDuration);
415
333
  }, [completeSample, resetSample, settings]);
416
334
  useEffect(() => resetSample, [resetSample]);
417
- const updateNumber = (key, value) => {
418
- setActivePreset("custom");
419
- setSettings((current) => ({ ...current, [key]: value }));
420
- };
421
- const updateText = (key, value) => {
422
- setActivePreset("custom");
423
- setSettings((current) => ({ ...current, [key]: value }));
424
- };
425
- const updateOrigin = (key, value) => {
426
- setActivePreset("custom");
427
- setSettings((current) => ({ ...current, [key]: value }));
428
- };
429
- const applyPreset = (preset) => {
430
- resetSample();
431
- setActivePreset(preset);
432
- setSettings(presets[preset].settings);
433
- };
434
- const copyOutput = async () => {
435
- await navigator.clipboard.writeText(output);
436
- setCopyState("copied");
437
- window.setTimeout(() => setCopyState("idle"), 1200);
335
+ let updateNumber = (key, value) => {
336
+ setActivePreset("custom"), setSettings((current) => ({ ...current, [key]: value }));
337
+ }, updateText = (key, value) => {
338
+ setActivePreset("custom"), setSettings((current) => ({ ...current, [key]: value }));
339
+ }, updateOrigin = (key, value) => {
340
+ setActivePreset("custom"), setSettings((current) => ({ ...current, [key]: value }));
341
+ }, applyPreset = (preset) => {
342
+ resetSample(), setActivePreset(preset), setSettings(presets[preset].settings);
343
+ }, copyOutput = async () => {
344
+ await navigator.clipboard.writeText(output), setCopyState("copied"), window.setTimeout(() => setCopyState("idle"), 1200);
438
345
  };
439
- return /* @__PURE__ */ jsx("div", { className: "min-h-screen bg-[#fafafa] text-foreground-1", children: /* @__PURE__ */ jsxs("div", { className: "grid min-h-screen lg:grid-cols-[1fr_23rem]", children: [
346
+ return /* @__PURE__ */ jsx("div", { className: "min-h-screen bg-surface-page text-foreground-1", children: /* @__PURE__ */ jsxs("div", { className: "grid min-h-screen lg:grid-cols-[1fr_23rem]", children: [
440
347
  /* @__PURE__ */ jsxs("main", { className: "relative min-h-screen overflow-hidden", children: [
441
- /* @__PURE__ */ jsx("div", { className: "absolute left-5 top-5 text-sm font-medium text-[#b4b4b4]", children: "Inline" }),
442
- /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center px-8 py-20", children: /* @__PURE__ */ jsxs("section", { className: "relative flex h-[15rem] w-full max-w-4xl flex-col items-center justify-center overflow-hidden bg-white shadow-[0_0_28px_rgba(0,0,0,0.012)]", children: [
348
+ /* @__PURE__ */ jsx("div", { className: "absolute left-5 top-5 text-sm font-medium text-foreground-4", children: "Inline" }),
349
+ /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center px-8 py-20", children: /* @__PURE__ */ jsxs("section", { className: "border-shadow-3 relative flex h-[15rem] w-full max-w-4xl flex-col items-center justify-center overflow-hidden bg-surface-1", children: [
443
350
  /* @__PURE__ */ jsx(
444
351
  ProgressPreview,
445
352
  {
@@ -449,7 +356,7 @@ function NavigationProgressPlayground() {
449
356
  }
450
357
  ),
451
358
  /* @__PURE__ */ jsxs("div", { className: "grid justify-items-center gap-6", children: [
452
- /* @__PURE__ */ jsx("div", { className: "text-center text-base font-semibold text-black", children: "put progress bars here" }),
359
+ /* @__PURE__ */ jsx("div", { className: "text-center text-base font-semibold text-foreground-1", children: "put progress bars here" }),
453
360
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
454
361
  /* @__PURE__ */ jsx(Button, { onClick: startSample, size: "sm", children: "Trigger navigation" }),
455
362
  /* @__PURE__ */ jsx(Button, { onClick: resetSample, size: "sm", variant: "outline", children: "Reset" })
@@ -706,7 +613,7 @@ function NavigationProgressPlayground() {
706
613
  "textarea",
707
614
  {
708
615
  className: "min-h-[26rem] resize-none rounded-panel border border-stroke-2 bg-surface-2 p-3 font-mono text-xs leading-5 text-foreground-1 outline-none focus:border-accent-1",
709
- readOnly: true,
616
+ readOnly: !0,
710
617
  value: output
711
618
  }
712
619
  ),