@vllnt/ui 0.1.4 → 0.1.7-canary.2c4792f

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 (225) hide show
  1. package/dist/components/accordion/accordion.js +172 -0
  2. package/dist/components/accordion/index.js +12 -0
  3. package/dist/components/alert/alert.js +53 -0
  4. package/dist/components/alert/index.js +7 -0
  5. package/dist/components/alert-dialog/alert-dialog.js +117 -0
  6. package/dist/components/alert-dialog/index.js +26 -0
  7. package/dist/components/aspect-ratio/aspect-ratio.js +6 -0
  8. package/dist/components/aspect-ratio/index.js +4 -0
  9. package/dist/components/avatar/avatar.js +43 -0
  10. package/dist/components/avatar/index.js +6 -0
  11. package/dist/components/badge/badge.js +26 -0
  12. package/dist/components/badge/index.js +5 -0
  13. package/dist/components/blog-card/blog-card.js +50 -0
  14. package/dist/components/blog-card/index.js +5 -0
  15. package/dist/components/breadcrumb/breadcrumb.js +61 -0
  16. package/dist/components/breadcrumb/index.js +4 -0
  17. package/dist/components/button/button.js +48 -0
  18. package/dist/components/button/index.js +5 -0
  19. package/dist/components/calendar/calendar.js +71 -0
  20. package/dist/components/calendar/index.js +4 -0
  21. package/dist/components/callout/callout.js +59 -0
  22. package/dist/components/callout/index.js +4 -0
  23. package/dist/components/card/card.js +64 -0
  24. package/dist/components/card/index.js +16 -0
  25. package/dist/components/carousel/carousel.js +239 -0
  26. package/dist/components/carousel/index.js +14 -0
  27. package/dist/components/category-filter/category-filter.js +34 -0
  28. package/dist/components/category-filter/index.js +4 -0
  29. package/dist/components/chart/area-chart.js +99 -0
  30. package/dist/components/chart/bar-chart.js +80 -0
  31. package/dist/components/chart/index.js +3 -0
  32. package/dist/components/chart/line-chart.js +97 -0
  33. package/dist/components/checkbox/checkbox.js +28 -0
  34. package/dist/components/checkbox/index.js +4 -0
  35. package/dist/components/checklist/checklist.js +181 -0
  36. package/dist/components/checklist/index.js +6 -0
  37. package/dist/components/code-block/code-block.js +126 -0
  38. package/dist/components/code-block/index.js +4 -0
  39. package/dist/components/code-playground/code-playground.js +86 -0
  40. package/dist/components/code-playground/index.js +8 -0
  41. package/dist/components/collapsible/collapsible.js +10 -0
  42. package/dist/components/collapsible/index.js +10 -0
  43. package/dist/components/command/command.js +123 -0
  44. package/dist/components/command/index.js +22 -0
  45. package/dist/components/comparison/comparison.js +121 -0
  46. package/dist/components/comparison/index.js +8 -0
  47. package/dist/components/completion-dialog/completion-dialog.js +173 -0
  48. package/dist/components/completion-dialog/index.js +6 -0
  49. package/dist/components/content-intro/content-intro.js +144 -0
  50. package/dist/components/content-intro/index.js +6 -0
  51. package/dist/components/context-menu/context-menu.js +154 -0
  52. package/dist/components/context-menu/index.js +34 -0
  53. package/dist/components/cookie-consent/cookie-consent.js +175 -0
  54. package/dist/components/cookie-consent/index.js +8 -0
  55. package/dist/components/dialog/dialog.js +105 -0
  56. package/dist/components/dialog/index.js +24 -0
  57. package/dist/components/drawer/drawer.js +102 -0
  58. package/dist/components/drawer/index.js +24 -0
  59. package/dist/components/dropdown-menu/dropdown-menu.js +151 -0
  60. package/dist/components/dropdown-menu/index.js +34 -0
  61. package/dist/components/exercise/exercise.js +112 -0
  62. package/dist/components/exercise/index.js +4 -0
  63. package/dist/components/faq/faq.js +56 -0
  64. package/dist/components/faq/index.js +5 -0
  65. package/dist/components/filter-bar/filter-bar.js +244 -0
  66. package/dist/components/filter-bar/index.js +6 -0
  67. package/dist/components/floating-action-button/floating-action-button.js +35 -0
  68. package/dist/components/floating-action-button/index.js +6 -0
  69. package/dist/components/flow-diagram/flow-canvas.js +109 -0
  70. package/dist/components/flow-diagram/flow-controls.js +140 -0
  71. package/dist/components/flow-diagram/flow-diagram.js +114 -0
  72. package/dist/components/flow-diagram/flow-error-boundary.js +63 -0
  73. package/dist/components/flow-diagram/flow-fullscreen.js +58 -0
  74. package/dist/components/flow-diagram/index.js +12 -0
  75. package/dist/components/flow-diagram/types.js +0 -0
  76. package/dist/components/flow-diagram/use-flow-diagram.js +146 -0
  77. package/dist/components/horizontal-scroll-row/horizontal-scroll-row.js +66 -0
  78. package/dist/components/horizontal-scroll-row/index.js +6 -0
  79. package/dist/components/hover-card/hover-card.js +26 -0
  80. package/dist/components/hover-card/index.js +6 -0
  81. package/dist/components/index.js +641 -0
  82. package/dist/components/inline-input/index.js +4 -0
  83. package/dist/components/inline-input/inline-input.js +42 -0
  84. package/dist/components/input/index.js +4 -0
  85. package/dist/components/input/input.js +23 -0
  86. package/dist/components/input-otp/index.js +12 -0
  87. package/dist/components/input-otp/input-otp.js +54 -0
  88. package/dist/components/key-concept/index.js +8 -0
  89. package/dist/components/key-concept/key-concept.js +79 -0
  90. package/dist/components/keyboard-shortcuts-help/index.js +6 -0
  91. package/dist/components/keyboard-shortcuts-help/keyboard-shortcuts-help.js +121 -0
  92. package/dist/components/label/index.js +4 -0
  93. package/dist/components/label/label.js +21 -0
  94. package/dist/components/lang-provider/index.js +4 -0
  95. package/dist/components/lang-provider/lang-provider.js +18 -0
  96. package/dist/components/learning-objectives/index.js +10 -0
  97. package/dist/components/learning-objectives/learning-objectives.js +76 -0
  98. package/dist/components/mdx-content/index.js +4 -0
  99. package/dist/components/mdx-content/mdx-content.js +151 -0
  100. package/dist/components/menubar/index.js +36 -0
  101. package/dist/components/menubar/menubar.js +183 -0
  102. package/dist/components/model-selector/index.js +6 -0
  103. package/dist/components/model-selector/model-selector.js +374 -0
  104. package/dist/components/navbar-saas/index.js +6 -0
  105. package/dist/components/navbar-saas/navbar-saas.js +68 -0
  106. package/dist/components/navbar-saas/use-mobile.js +19 -0
  107. package/dist/components/navigation-menu/index.js +22 -0
  108. package/dist/components/navigation-menu/navigation-menu.js +108 -0
  109. package/dist/components/pagination/index.js +4 -0
  110. package/dist/components/pagination/pagination.js +44 -0
  111. package/dist/components/popover/index.js +12 -0
  112. package/dist/components/popover/popover.js +28 -0
  113. package/dist/components/pro-tip/index.js +8 -0
  114. package/dist/components/pro-tip/pro-tip.js +139 -0
  115. package/dist/components/profile-section/index.js +4 -0
  116. package/dist/components/profile-section/profile-section.js +45 -0
  117. package/dist/components/progress-bar/index.js +4 -0
  118. package/dist/components/progress-bar/progress-bar.js +56 -0
  119. package/dist/components/progress-card/index.js +6 -0
  120. package/dist/components/progress-card/progress-card.js +71 -0
  121. package/dist/components/quiz/index.js +4 -0
  122. package/dist/components/quiz/quiz.js +210 -0
  123. package/dist/components/radio-group/index.js +5 -0
  124. package/dist/components/radio-group/radio-group.js +36 -0
  125. package/dist/components/resizable/index.js +10 -0
  126. package/dist/components/resizable/resizable.js +39 -0
  127. package/dist/components/scroll-area/index.js +5 -0
  128. package/dist/components/scroll-area/scroll-area.js +39 -0
  129. package/dist/components/search-bar/index.js +4 -0
  130. package/dist/components/search-bar/search-bar.js +122 -0
  131. package/dist/components/search-dialog/index.js +4 -0
  132. package/dist/components/search-dialog/search-dialog.js +102 -0
  133. package/dist/components/select/index.js +24 -0
  134. package/dist/components/select/select.js +125 -0
  135. package/dist/components/separator/index.js +4 -0
  136. package/dist/components/separator/separator.js +25 -0
  137. package/dist/components/share-dialog/index.js +6 -0
  138. package/dist/components/share-dialog/share-dialog.js +121 -0
  139. package/dist/components/share-section/index.js +6 -0
  140. package/dist/components/share-section/share-section.js +57 -0
  141. package/dist/components/sheet/index.js +24 -0
  142. package/dist/components/sheet/sheet.js +116 -0
  143. package/dist/components/sidebar/index.js +4 -0
  144. package/dist/components/sidebar/sidebar.js +188 -0
  145. package/dist/components/sidebar-provider/index.js +5 -0
  146. package/dist/components/sidebar-provider/sidebar-provider.js +25 -0
  147. package/dist/components/sidebar-toggle/index.js +4 -0
  148. package/dist/components/sidebar-toggle/sidebar-toggle.js +36 -0
  149. package/dist/components/skeleton/index.js +4 -0
  150. package/dist/components/skeleton/skeleton.js +17 -0
  151. package/dist/components/slider/index.js +4 -0
  152. package/dist/components/slider/slider.js +24 -0
  153. package/dist/components/slideshow/index.js +6 -0
  154. package/dist/components/slideshow/slideshow.js +440 -0
  155. package/dist/components/social-fab/index.js +6 -0
  156. package/dist/components/social-fab/social-fab.js +211 -0
  157. package/dist/components/social-fab/use-social-fab.js +111 -0
  158. package/dist/components/spinner/index.js +4 -0
  159. package/dist/components/spinner/spinner.js +23 -0
  160. package/dist/components/step-by-step/index.js +8 -0
  161. package/dist/components/step-by-step/step-by-step.js +194 -0
  162. package/dist/components/step-navigation/index.js +4 -0
  163. package/dist/components/step-navigation/step-navigation.js +119 -0
  164. package/dist/components/switch/index.js +4 -0
  165. package/dist/components/switch/switch.js +28 -0
  166. package/dist/components/table/index.js +20 -0
  167. package/dist/components/table/table.js +87 -0
  168. package/dist/components/table-of-contents/index.js +4 -0
  169. package/dist/components/table-of-contents/table-of-contents.js +71 -0
  170. package/dist/components/table-of-contents-panel/index.js +6 -0
  171. package/dist/components/table-of-contents-panel/table-of-contents-panel.js +202 -0
  172. package/dist/components/tabs/index.js +12 -0
  173. package/dist/components/tabs/tabs.js +84 -0
  174. package/dist/components/terminal/index.js +8 -0
  175. package/dist/components/terminal/terminal.js +119 -0
  176. package/dist/components/textarea/index.js +4 -0
  177. package/dist/components/textarea/textarea.js +22 -0
  178. package/dist/components/theme-provider/index.js +4 -0
  179. package/dist/components/theme-provider/theme-provider.js +11 -0
  180. package/dist/components/theme-toggle/index.js +4 -0
  181. package/dist/components/theme-toggle/theme-toggle.js +170 -0
  182. package/dist/components/thinking-block/index.js +4 -0
  183. package/dist/components/thinking-block/thinking-block.js +56 -0
  184. package/dist/components/tldr-section/index.js +4 -0
  185. package/dist/components/tldr-section/tldr-section.js +101 -0
  186. package/dist/components/toast/index.js +18 -0
  187. package/dist/components/toast/toast.js +84 -0
  188. package/dist/components/toast/toaster.js +38 -0
  189. package/dist/components/toggle/index.js +5 -0
  190. package/dist/components/toggle/toggle.js +39 -0
  191. package/dist/components/toggle-group/index.js +5 -0
  192. package/dist/components/toggle-group/toggle-group.js +46 -0
  193. package/dist/components/tooltip/index.js +12 -0
  194. package/dist/components/tooltip/tooltip.js +27 -0
  195. package/dist/components/truncated-text/index.js +4 -0
  196. package/dist/components/truncated-text/truncated-text.js +25 -0
  197. package/dist/components/tutorial-card/index.js +6 -0
  198. package/dist/components/tutorial-card/tutorial-card.js +78 -0
  199. package/dist/components/tutorial-complete/index.js +6 -0
  200. package/dist/components/tutorial-complete/tutorial-complete.js +134 -0
  201. package/dist/components/tutorial-filters/index.js +6 -0
  202. package/dist/components/tutorial-filters/tutorial-filters.js +205 -0
  203. package/dist/components/tutorial-intro-content/index.js +6 -0
  204. package/dist/components/tutorial-intro-content/tutorial-intro-content.js +141 -0
  205. package/dist/components/tutorial-mdx/index.js +8 -0
  206. package/dist/components/tutorial-mdx/tutorial-mdx.js +219 -0
  207. package/dist/components/video-embed/index.js +4 -0
  208. package/dist/components/video-embed/video-embed.js +77 -0
  209. package/dist/components/view-switcher/index.js +6 -0
  210. package/dist/components/view-switcher/view-switcher.js +92 -0
  211. package/dist/index.d.ts +44 -2
  212. package/dist/index.js +14 -8556
  213. package/dist/lib/types.js +11 -0
  214. package/dist/lib/use-debounce.js +17 -0
  215. package/dist/lib/use-horizontal-scroll.js +60 -0
  216. package/dist/lib/use-mounted.js +17 -0
  217. package/dist/lib/utils.js +8 -0
  218. package/dist/tailwind-preset.d.ts +5 -0
  219. package/dist/tailwind-preset.js +9 -10
  220. package/dist/types/content.js +0 -0
  221. package/dist/types/index.js +0 -0
  222. package/package.json +42 -23
  223. package/LICENSE +0 -21
  224. package/dist/chunk-XRV5RSYH.js +0 -569
  225. package/dist/flow-diagram-N3EHM6VB.js +0 -2
@@ -0,0 +1,125 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as SelectPrimitive from "@radix-ui/react-select";
5
+ import { Check, ChevronDown, ChevronUp } from "lucide-react";
6
+ import { cn } from "../../lib/utils";
7
+ const Select = SelectPrimitive.Root;
8
+ const SelectGroup = SelectPrimitive.Group;
9
+ const SelectValue = SelectPrimitive.Value;
10
+ const SelectTrigger = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs(
11
+ SelectPrimitive.Trigger,
12
+ {
13
+ className: cn(
14
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
15
+ className
16
+ ),
17
+ ref,
18
+ ...props,
19
+ children: [
20
+ children,
21
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
22
+ ]
23
+ }
24
+ ));
25
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
26
+ const SelectScrollUpButton = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
27
+ SelectPrimitive.ScrollUpButton,
28
+ {
29
+ className: cn(
30
+ "flex cursor-default items-center justify-center py-1",
31
+ className
32
+ ),
33
+ ref,
34
+ ...props,
35
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
36
+ }
37
+ ));
38
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
39
+ const SelectScrollDownButton = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
40
+ SelectPrimitive.ScrollDownButton,
41
+ {
42
+ className: cn(
43
+ "flex cursor-default items-center justify-center py-1",
44
+ className
45
+ ),
46
+ ref,
47
+ ...props,
48
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
49
+ }
50
+ ));
51
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
52
+ const SelectContent = forwardRef(({ children, className, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
53
+ SelectPrimitive.Content,
54
+ {
55
+ className: cn(
56
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
57
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
58
+ className
59
+ ),
60
+ position,
61
+ ref,
62
+ ...props,
63
+ children: [
64
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
65
+ /* @__PURE__ */ jsx(
66
+ SelectPrimitive.Viewport,
67
+ {
68
+ className: cn(
69
+ "p-1",
70
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
71
+ ),
72
+ children
73
+ }
74
+ ),
75
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
76
+ ]
77
+ }
78
+ ) }));
79
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
80
+ const SelectLabel = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
81
+ SelectPrimitive.Label,
82
+ {
83
+ className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
84
+ ref,
85
+ ...props
86
+ }
87
+ ));
88
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
89
+ const SelectItem = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs(
90
+ SelectPrimitive.Item,
91
+ {
92
+ className: cn(
93
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
94
+ className
95
+ ),
96
+ ref,
97
+ ...props,
98
+ children: [
99
+ /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
100
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
101
+ ]
102
+ }
103
+ ));
104
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
105
+ const SelectSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
106
+ SelectPrimitive.Separator,
107
+ {
108
+ className: cn("-mx-1 my-1 h-px bg-muted", className),
109
+ ref,
110
+ ...props
111
+ }
112
+ ));
113
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
114
+ export {
115
+ Select,
116
+ SelectContent,
117
+ SelectGroup,
118
+ SelectItem,
119
+ SelectLabel,
120
+ SelectScrollDownButton,
121
+ SelectScrollUpButton,
122
+ SelectSeparator,
123
+ SelectTrigger,
124
+ SelectValue
125
+ };
@@ -0,0 +1,4 @@
1
+ import { Separator } from "./separator";
2
+ export {
3
+ Separator
4
+ };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
5
+ import { cn } from "../../lib/utils";
6
+ const Separator = forwardRef(
7
+ ({ className, decorative = true, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ jsx(
8
+ SeparatorPrimitive.Root,
9
+ {
10
+ className: cn(
11
+ "shrink-0 bg-border",
12
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
13
+ className
14
+ ),
15
+ decorative,
16
+ orientation,
17
+ ref,
18
+ ...props
19
+ }
20
+ )
21
+ );
22
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
23
+ export {
24
+ Separator
25
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ ShareDialog
3
+ } from "./share-dialog";
4
+ export {
5
+ ShareDialog
6
+ };
@@ -0,0 +1,121 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../lib/utils";
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogHeader,
10
+ DialogTitle
11
+ } from "../dialog/dialog";
12
+ function PlatformButton({
13
+ onClick,
14
+ platform
15
+ }) {
16
+ const handleClick = () => {
17
+ onClick(platform.key);
18
+ };
19
+ return /* @__PURE__ */ jsx(
20
+ "button",
21
+ {
22
+ className: cn(
23
+ "w-full rounded-md border border-border bg-background px-4 py-3",
24
+ "text-sm font-medium text-foreground",
25
+ "transition-colors duration-150",
26
+ "hover:bg-accent hover:text-accent-foreground",
27
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
28
+ ),
29
+ onClick: handleClick,
30
+ type: "button",
31
+ children: platform.label
32
+ }
33
+ );
34
+ }
35
+ function CopyButton({
36
+ buildCopyUrl,
37
+ labels,
38
+ onCopy
39
+ }) {
40
+ const [copied, setCopied] = React.useState(false);
41
+ const handleCopy = React.useCallback(async () => {
42
+ const url = buildCopyUrl ? buildCopyUrl(window.location.href) : window.location.href;
43
+ const text = `${document.title} - ${url}`;
44
+ await navigator.clipboard.writeText(text);
45
+ setCopied(true);
46
+ onCopy?.();
47
+ setTimeout(() => {
48
+ setCopied(false);
49
+ }, 2e3);
50
+ }, [buildCopyUrl, onCopy]);
51
+ return /* @__PURE__ */ jsx(
52
+ "button",
53
+ {
54
+ className: cn(
55
+ "col-span-2 w-full rounded-md border px-4 py-3",
56
+ "text-sm font-medium",
57
+ "transition-colors duration-150",
58
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
59
+ copied ? "border-green-500 bg-green-500/10 text-green-600 dark:text-green-400" : "border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground"
60
+ ),
61
+ onClick: handleCopy,
62
+ type: "button",
63
+ children: copied ? labels.copied : labels.copyLink
64
+ }
65
+ );
66
+ }
67
+ const defaultLabels = {
68
+ copied: "Copied!",
69
+ copyLink: "Copy link"
70
+ };
71
+ function ShareDialog({
72
+ buildCopyUrl,
73
+ description,
74
+ labels = defaultLabels,
75
+ onCopy,
76
+ onOpenChange,
77
+ onShare,
78
+ open,
79
+ platforms,
80
+ title = "Share"
81
+ }) {
82
+ const handlePlatformClick = React.useCallback(
83
+ (key) => {
84
+ const platform = platforms.find((p) => p.key === key);
85
+ if (platform) {
86
+ const url = platform.buildUrl(window.location.href, document.title);
87
+ window.open(url, "_blank", "noopener,noreferrer");
88
+ onShare?.(key);
89
+ onOpenChange?.(false);
90
+ }
91
+ },
92
+ [platforms, onShare, onOpenChange]
93
+ );
94
+ return /* @__PURE__ */ jsx(Dialog, { onOpenChange, open, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-sm", children: [
95
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
96
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
97
+ description ? /* @__PURE__ */ jsx(DialogDescription, { children: description }) : null
98
+ ] }),
99
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
100
+ platforms.map((platform) => /* @__PURE__ */ jsx(
101
+ PlatformButton,
102
+ {
103
+ onClick: handlePlatformClick,
104
+ platform
105
+ },
106
+ platform.key
107
+ )),
108
+ /* @__PURE__ */ jsx(
109
+ CopyButton,
110
+ {
111
+ buildCopyUrl,
112
+ labels,
113
+ onCopy
114
+ }
115
+ )
116
+ ] })
117
+ ] }) });
118
+ }
119
+ export {
120
+ ShareDialog
121
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ ShareSection
3
+ } from "./share-section";
4
+ export {
5
+ ShareSection
6
+ };
@@ -0,0 +1,57 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ const defaultPlatforms = [
3
+ { key: "x", label: "X" },
4
+ { key: "linkedin", label: "LinkedIn" },
5
+ { key: "facebook", label: "Facebook" },
6
+ { key: "mastodon", label: "Mastodon" },
7
+ { key: "bluesky", label: "Bluesky" },
8
+ { key: "threads", label: "Threads" }
9
+ ];
10
+ function buildShareUrl(platform, url, title) {
11
+ const encodedUrl = encodeURIComponent(url);
12
+ const encodedTitle = encodeURIComponent(title);
13
+ switch (platform) {
14
+ case "x":
15
+ return `https://twitter.com/intent/tweet?url=${encodedUrl}&text=${encodedTitle}`;
16
+ case "linkedin":
17
+ return `https://www.linkedin.com/sharing/share-offsite/?url=${encodedUrl}`;
18
+ case "facebook":
19
+ return `https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`;
20
+ case "mastodon":
21
+ return `https://mastodon.social/share?text=${encodedTitle}%20${encodedUrl}`;
22
+ case "bluesky":
23
+ return `https://bsky.app/intent/compose?text=${encodedTitle}%20${encodedUrl}`;
24
+ case "threads":
25
+ return `https://www.threads.net/intent/post?text=${encodedTitle}%20${encodedUrl}`;
26
+ }
27
+ }
28
+ function ShareSection({
29
+ buildUrl: buildUrlFunction = buildShareUrl,
30
+ platforms = defaultPlatforms,
31
+ shareOn,
32
+ shareTitle,
33
+ title,
34
+ url
35
+ }) {
36
+ return /* @__PURE__ */ jsxs("div", { className: "border-t border-border pt-6 mt-8", children: [
37
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: shareTitle }),
38
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3", children: platforms.map((platform) => /* @__PURE__ */ jsxs(
39
+ "a",
40
+ {
41
+ className: "text-sm text-muted-foreground hover:text-foreground transition-colors border border-border px-3 py-1.5 hover:bg-accent rounded-md",
42
+ href: buildUrlFunction(platform.key, url, title),
43
+ rel: "noopener noreferrer",
44
+ target: "_blank",
45
+ children: [
46
+ shareOn,
47
+ " ",
48
+ platform.label
49
+ ]
50
+ },
51
+ platform.key
52
+ )) })
53
+ ] });
54
+ }
55
+ export {
56
+ ShareSection
57
+ };
@@ -0,0 +1,24 @@
1
+ import {
2
+ Sheet,
3
+ SheetClose,
4
+ SheetContent,
5
+ SheetDescription,
6
+ SheetFooter,
7
+ SheetHeader,
8
+ SheetOverlay,
9
+ SheetPortal,
10
+ SheetTitle,
11
+ SheetTrigger
12
+ } from "./sheet";
13
+ export {
14
+ Sheet,
15
+ SheetClose,
16
+ SheetContent,
17
+ SheetDescription,
18
+ SheetFooter,
19
+ SheetHeader,
20
+ SheetOverlay,
21
+ SheetPortal,
22
+ SheetTitle,
23
+ SheetTrigger
24
+ };
@@ -0,0 +1,116 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
5
+ import { cva } from "class-variance-authority";
6
+ import { X } from "lucide-react";
7
+ import { cn } from "../../lib/utils";
8
+ const Sheet = SheetPrimitive.Root;
9
+ const SheetTrigger = SheetPrimitive.Trigger;
10
+ const SheetClose = SheetPrimitive.Close;
11
+ const SheetPortal = SheetPrimitive.Portal;
12
+ const SheetOverlay = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
13
+ SheetPrimitive.Overlay,
14
+ {
15
+ className: cn(
16
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
17
+ className
18
+ ),
19
+ ...props,
20
+ ref
21
+ }
22
+ ));
23
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
24
+ const sheetVariants = cva(
25
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
26
+ {
27
+ defaultVariants: {
28
+ side: "right"
29
+ },
30
+ variants: {
31
+ side: {
32
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
33
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
34
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
35
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"
36
+ }
37
+ }
38
+ }
39
+ );
40
+ const SheetContent = forwardRef(({ children, className, side = "right", ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
41
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
42
+ /* @__PURE__ */ jsxs(
43
+ SheetPrimitive.Content,
44
+ {
45
+ className: cn(sheetVariants({ side }), className),
46
+ ref,
47
+ ...props,
48
+ children: [
49
+ /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
50
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
51
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
52
+ ] }),
53
+ children
54
+ ]
55
+ }
56
+ )
57
+ ] }));
58
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
59
+ const SheetHeader = ({
60
+ className,
61
+ ...props
62
+ }) => /* @__PURE__ */ jsx(
63
+ "div",
64
+ {
65
+ className: cn(
66
+ "flex flex-col space-y-2 text-center sm:text-left",
67
+ className
68
+ ),
69
+ ...props
70
+ }
71
+ );
72
+ SheetHeader.displayName = "SheetHeader";
73
+ const SheetFooter = ({
74
+ className,
75
+ ...props
76
+ }) => /* @__PURE__ */ jsx(
77
+ "div",
78
+ {
79
+ className: cn(
80
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
81
+ className
82
+ ),
83
+ ...props
84
+ }
85
+ );
86
+ SheetFooter.displayName = "SheetFooter";
87
+ const SheetTitle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
88
+ SheetPrimitive.Title,
89
+ {
90
+ className: cn("text-lg font-semibold text-foreground", className),
91
+ ref,
92
+ ...props
93
+ }
94
+ ));
95
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
96
+ const SheetDescription = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
97
+ SheetPrimitive.Description,
98
+ {
99
+ className: cn("text-sm text-muted-foreground", className),
100
+ ref,
101
+ ...props
102
+ }
103
+ ));
104
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
105
+ export {
106
+ Sheet,
107
+ SheetClose,
108
+ SheetContent,
109
+ SheetDescription,
110
+ SheetFooter,
111
+ SheetHeader,
112
+ SheetOverlay,
113
+ SheetPortal,
114
+ SheetTitle,
115
+ SheetTrigger
116
+ };
@@ -0,0 +1,4 @@
1
+ import { Sidebar } from "./sidebar";
2
+ export {
3
+ Sidebar
4
+ };
@@ -0,0 +1,188 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { ChevronDown } from "lucide-react";
5
+ import Link from "next/link";
6
+ import { usePathname } from "next/navigation";
7
+ import { cn } from "../../lib/utils";
8
+ import { useSidebar } from "../sidebar-provider";
9
+ function useMobile(setOpen) {
10
+ const [isMobile, setIsMobile] = useState(false);
11
+ useEffect(() => {
12
+ const checkMobile = () => {
13
+ const mobile = window.innerWidth < 1024;
14
+ setIsMobile(mobile);
15
+ if (mobile) {
16
+ setOpen(false);
17
+ } else {
18
+ setOpen(true);
19
+ }
20
+ };
21
+ checkMobile();
22
+ window.addEventListener("resize", checkMobile);
23
+ return () => {
24
+ window.removeEventListener("resize", checkMobile);
25
+ };
26
+ }, [setOpen]);
27
+ return isMobile;
28
+ }
29
+ function useScrollFade(containerReference) {
30
+ const [showTopFade, setShowTopFade] = useState(false);
31
+ const [showBottomFade, setShowBottomFade] = useState(false);
32
+ useEffect(() => {
33
+ const container = containerReference.current;
34
+ if (!container) return;
35
+ const checkScroll = () => {
36
+ const { clientHeight, scrollHeight, scrollTop } = container;
37
+ setShowTopFade(scrollTop > 0);
38
+ setShowBottomFade(scrollTop < scrollHeight - clientHeight - 1);
39
+ };
40
+ checkScroll();
41
+ container.addEventListener("scroll", checkScroll);
42
+ return () => {
43
+ container.removeEventListener("scroll", checkScroll);
44
+ };
45
+ }, [containerReference]);
46
+ return { showBottomFade, showTopFade };
47
+ }
48
+ function CollapsibleSection({
49
+ children,
50
+ collapsible = false,
51
+ defaultOpen = true,
52
+ title
53
+ }) {
54
+ const [isOpen, setIsOpen] = useState(defaultOpen);
55
+ if (!collapsible) {
56
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: title }),
58
+ children
59
+ ] });
60
+ }
61
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
62
+ /* @__PURE__ */ jsxs(
63
+ "button",
64
+ {
65
+ className: "flex w-full items-center justify-between px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors",
66
+ onClick: () => {
67
+ setIsOpen(!isOpen);
68
+ },
69
+ type: "button",
70
+ children: [
71
+ /* @__PURE__ */ jsx("span", { children: title }),
72
+ /* @__PURE__ */ jsx(
73
+ ChevronDown,
74
+ {
75
+ className: cn(
76
+ "h-3 w-3 transition-transform duration-200",
77
+ isOpen && "rotate-180"
78
+ )
79
+ }
80
+ )
81
+ ]
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ className: cn(
88
+ "grid transition-all duration-200 ease-in-out",
89
+ isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
90
+ ),
91
+ children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children })
92
+ }
93
+ )
94
+ ] });
95
+ }
96
+ function Sidebar({ sections }) {
97
+ const pathname = usePathname();
98
+ const { open, setOpen } = useSidebar();
99
+ const isMobile = useMobile(setOpen);
100
+ const scrollContainerReference = useRef(null);
101
+ const { showBottomFade, showTopFade } = useScrollFade(
102
+ scrollContainerReference
103
+ );
104
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
105
+ isMobile && open ? /* @__PURE__ */ jsx(
106
+ "div",
107
+ {
108
+ className: "fixed inset-0 bg-black/50 z-40 lg:hidden",
109
+ onClick: () => {
110
+ setOpen(false);
111
+ },
112
+ onKeyDown: (event) => {
113
+ if (event.key === "Escape") {
114
+ setOpen(false);
115
+ }
116
+ },
117
+ role: "button",
118
+ tabIndex: 0
119
+ }
120
+ ) : null,
121
+ /* @__PURE__ */ jsx(
122
+ "aside",
123
+ {
124
+ className: cn(
125
+ "fixed lg:relative top-16 lg:top-0 bottom-0 lg:bottom-auto left-0 z-40 lg:h-full border-r bg-background transition-transform duration-300 ease-in-out",
126
+ "flex flex-col",
127
+ "overflow-hidden",
128
+ "shrink-0",
129
+ isMobile ? "w-full" : "w-64",
130
+ isMobile && !open && "-translate-x-full",
131
+ isMobile && open && "translate-x-0",
132
+ !isMobile && !open && "-translate-x-full lg:translate-x-0",
133
+ !isMobile && "lg:translate-x-0"
134
+ ),
135
+ children: /* @__PURE__ */ jsxs("div", { className: "relative flex-1 overflow-hidden", children: [
136
+ showTopFade ? /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 right-0 h-8 bg-gradient-to-b from-background to-transparent pointer-events-none z-20" }) : null,
137
+ showBottomFade ? /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-background to-transparent pointer-events-none z-20" }) : null,
138
+ /* @__PURE__ */ jsx(
139
+ "nav",
140
+ {
141
+ className: "flex-1 p-4 overflow-y-auto h-full",
142
+ ref: scrollContainerReference,
143
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: sections.map((section, sectionIndex) => {
144
+ const sectionItems = /* @__PURE__ */ jsx("div", { className: section.title ? "space-y-0.5" : "space-y-1", children: section.items.map((item) => /* @__PURE__ */ jsx(
145
+ Link,
146
+ {
147
+ className: cn(
148
+ section.title ? "block px-3 py-1.5 rounded-md text-sm transition-colors" : "flex items-center px-3 py-2 rounded-md text-sm font-medium transition-colors",
149
+ pathname === item.href || item.href === "/" && pathname === "/" ? "bg-accent text-accent-foreground" : section.title ? "text-muted-foreground hover:bg-accent hover:text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
150
+ section.title && pathname === item.href && "font-medium"
151
+ ),
152
+ href: item.href,
153
+ onClick: () => {
154
+ if (isMobile) {
155
+ setOpen(false);
156
+ }
157
+ },
158
+ children: item.title
159
+ },
160
+ item.href
161
+ )) });
162
+ return /* @__PURE__ */ jsx(
163
+ "div",
164
+ {
165
+ className: "space-y-1",
166
+ children: section.title ? /* @__PURE__ */ jsx(
167
+ CollapsibleSection,
168
+ {
169
+ collapsible: section.collapsible,
170
+ defaultOpen: section.defaultOpen ?? true,
171
+ title: section.title,
172
+ children: sectionItems
173
+ }
174
+ ) : sectionItems
175
+ },
176
+ section.title || sectionIndex
177
+ );
178
+ }) })
179
+ }
180
+ )
181
+ ] })
182
+ }
183
+ )
184
+ ] });
185
+ }
186
+ export {
187
+ Sidebar
188
+ };
@@ -0,0 +1,5 @@
1
+ import { SidebarProvider, useSidebar } from "./sidebar-provider";
2
+ export {
3
+ SidebarProvider,
4
+ useSidebar
5
+ };