@cargo-ai/ui 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +58 -0
- package/README.md +116 -2
- package/build/blocks/Banner/Banner.d.ts +19 -0
- package/build/blocks/Banner/Banner.d.ts.map +1 -0
- package/build/blocks/Banner/Banner.js +7 -0
- package/build/blocks/BeforeAfter/BeforeAfter.d.ts +21 -0
- package/build/blocks/BeforeAfter/BeforeAfter.d.ts.map +1 -0
- package/build/blocks/BeforeAfter/BeforeAfter.js +13 -0
- package/build/blocks/CardGrid/CardGrid.d.ts +19 -0
- package/build/blocks/CardGrid/CardGrid.d.ts.map +1 -0
- package/build/blocks/CardGrid/CardGrid.js +17 -0
- package/build/blocks/CtaBand/CtaBand.d.ts +18 -0
- package/build/blocks/CtaBand/CtaBand.d.ts.map +1 -0
- package/build/blocks/CtaBand/CtaBand.js +13 -0
- package/build/blocks/Faq/Faq.d.ts +25 -0
- package/build/blocks/Faq/Faq.d.ts.map +1 -0
- package/build/blocks/Faq/Faq.js +20 -0
- package/build/blocks/FeatureGrid/FeatureGrid.d.ts +23 -0
- package/build/blocks/FeatureGrid/FeatureGrid.d.ts.map +1 -0
- package/build/blocks/FeatureGrid/FeatureGrid.js +12 -0
- package/build/blocks/FeatureRows/FeatureRows.d.ts +22 -0
- package/build/blocks/FeatureRows/FeatureRows.d.ts.map +1 -0
- package/build/blocks/FeatureRows/FeatureRows.js +14 -0
- package/build/blocks/HeroCentered/HeroCentered.d.ts +27 -0
- package/build/blocks/HeroCentered/HeroCentered.d.ts.map +1 -0
- package/build/blocks/HeroCentered/HeroCentered.js +13 -0
- package/build/blocks/HeroSplit/HeroSplit.d.ts +28 -0
- package/build/blocks/HeroSplit/HeroSplit.d.ts.map +1 -0
- package/build/blocks/HeroSplit/HeroSplit.js +18 -0
- package/build/blocks/LogoCloud/LogoCloud.d.ts +17 -0
- package/build/blocks/LogoCloud/LogoCloud.d.ts.map +1 -0
- package/build/blocks/LogoCloud/LogoCloud.js +8 -0
- package/build/blocks/Pricing/Pricing.d.ts +33 -0
- package/build/blocks/Pricing/Pricing.d.ts.map +1 -0
- package/build/blocks/Pricing/Pricing.js +33 -0
- package/build/blocks/Showcase/Showcase.d.ts +27 -0
- package/build/blocks/Showcase/Showcase.d.ts.map +1 -0
- package/build/blocks/Showcase/Showcase.js +40 -0
- package/build/blocks/SiteFooter/SiteFooter.d.ts +25 -0
- package/build/blocks/SiteFooter/SiteFooter.d.ts.map +1 -0
- package/build/blocks/SiteFooter/SiteFooter.js +14 -0
- package/build/blocks/SiteHeader/SiteHeader.d.ts +27 -0
- package/build/blocks/SiteHeader/SiteHeader.d.ts.map +1 -0
- package/build/blocks/SiteHeader/SiteHeader.js +101 -0
- package/build/blocks/Stats/Stats.d.ts +17 -0
- package/build/blocks/Stats/Stats.d.ts.map +1 -0
- package/build/blocks/Stats/Stats.js +9 -0
- package/build/blocks/Steps/Steps.d.ts +26 -0
- package/build/blocks/Steps/Steps.d.ts.map +1 -0
- package/build/blocks/Steps/Steps.js +23 -0
- package/build/blocks/Testimonials/Testimonials.d.ts +26 -0
- package/build/blocks/Testimonials/Testimonials.d.ts.map +1 -0
- package/build/blocks/Testimonials/Testimonials.js +30 -0
- package/build/blocks/types.d.ts +44 -0
- package/build/blocks/types.d.ts.map +1 -0
- package/build/blocks/types.js +1 -0
- package/build/components/CargoMark/CargoMark.d.ts +7 -0
- package/build/components/CargoMark/CargoMark.d.ts.map +1 -0
- package/build/components/CargoMark/CargoMark.js +16 -0
- package/build/components/CheckList/CheckList.d.ts +9 -0
- package/build/components/CheckList/CheckList.d.ts.map +1 -0
- package/build/components/CheckList/CheckList.js +8 -0
- package/build/components/CodeWindow/CodeWindow.d.ts +15 -0
- package/build/components/CodeWindow/CodeWindow.d.ts.map +1 -0
- package/build/components/CodeWindow/CodeWindow.js +53 -0
- package/build/components/CodeWindow/highlight.d.ts +4 -0
- package/build/components/CodeWindow/highlight.d.ts.map +1 -0
- package/build/components/CodeWindow/highlight.js +48 -0
- package/build/components/ComparisonTable/ComparisonTable.d.ts +62 -0
- package/build/components/ComparisonTable/ComparisonTable.d.ts.map +1 -0
- package/build/components/ComparisonTable/ComparisonTable.js +60 -0
- package/build/components/CountUp/CountUp.d.ts +13 -0
- package/build/components/CountUp/CountUp.d.ts.map +1 -0
- package/build/components/CountUp/CountUp.js +52 -0
- package/build/components/Eyebrow/Eyebrow.d.ts +21 -0
- package/build/components/Eyebrow/Eyebrow.d.ts.map +1 -0
- package/build/components/Eyebrow/Eyebrow.js +29 -0
- package/build/components/FeatureCard/FeatureCard.d.ts +12 -0
- package/build/components/FeatureCard/FeatureCard.d.ts.map +1 -0
- package/build/components/FeatureCard/FeatureCard.js +8 -0
- package/build/components/GlowCard/GlowCard.d.ts +11 -0
- package/build/components/GlowCard/GlowCard.d.ts.map +1 -0
- package/build/components/GlowCard/GlowCard.js +14 -0
- package/build/components/Highlight/Highlight.d.ts +12 -0
- package/build/components/Highlight/Highlight.d.ts.map +1 -0
- package/build/components/Highlight/Highlight.js +10 -0
- package/build/components/InstallCommand/InstallCommand.d.ts +9 -0
- package/build/components/InstallCommand/InstallCommand.d.ts.map +1 -0
- package/build/components/InstallCommand/InstallCommand.js +30 -0
- package/build/components/Logo/Logo.d.ts +16 -0
- package/build/components/Logo/Logo.d.ts.map +1 -0
- package/build/components/Logo/Logo.js +7 -0
- package/build/components/Marquee/Marquee.d.ts +17 -0
- package/build/components/Marquee/Marquee.d.ts.map +1 -0
- package/build/components/Marquee/Marquee.js +19 -0
- package/build/components/Marquee/index.d.ts +3 -0
- package/build/components/Marquee/index.d.ts.map +1 -0
- package/build/components/Marquee/index.js +1 -0
- package/build/components/Marquee/types.d.ts +9 -0
- package/build/components/Marquee/types.d.ts.map +1 -0
- package/build/components/Marquee/types.js +1 -0
- package/build/components/MaskedHeadline/MaskedHeadline.d.ts +10 -0
- package/build/components/MaskedHeadline/MaskedHeadline.d.ts.map +1 -0
- package/build/components/MaskedHeadline/MaskedHeadline.js +8 -0
- package/build/components/MediaFrame/MediaFrame.d.ts +17 -0
- package/build/components/MediaFrame/MediaFrame.d.ts.map +1 -0
- package/build/components/MediaFrame/MediaFrame.js +15 -0
- package/build/components/Prose/Prose.d.ts +23 -0
- package/build/components/Prose/Prose.d.ts.map +1 -0
- package/build/components/Prose/Prose.js +15 -0
- package/build/components/ResourceCard/ResourceCard.d.ts +31 -0
- package/build/components/ResourceCard/ResourceCard.d.ts.map +1 -0
- package/build/components/ResourceCard/ResourceCard.js +20 -0
- package/build/components/Reveal/Reveal.d.ts +14 -0
- package/build/components/Reveal/Reveal.d.ts.map +1 -0
- package/build/components/Reveal/Reveal.js +26 -0
- package/build/components/Terminal/Terminal.d.ts +11 -0
- package/build/components/Terminal/Terminal.d.ts.map +1 -0
- package/build/components/Terminal/Terminal.js +69 -0
- package/build/components/Terminal/index.d.ts +3 -0
- package/build/components/Terminal/index.d.ts.map +1 -0
- package/build/components/Terminal/index.js +1 -0
- package/build/components/Terminal/types.d.ts +10 -0
- package/build/components/Terminal/types.d.ts.map +1 -0
- package/build/components/Terminal/types.js +1 -0
- package/build/components/ThemeIsland/ThemeIsland.d.ts +22 -0
- package/build/components/ThemeIsland/ThemeIsland.d.ts.map +1 -0
- package/build/components/ThemeIsland/ThemeIsland.js +25 -0
- package/build/components/ThemeIsland/context.d.ts +5 -0
- package/build/components/ThemeIsland/context.d.ts.map +1 -0
- package/build/components/ThemeIsland/context.js +4 -0
- package/build/components/ThemeIsland/index.d.ts +3 -0
- package/build/components/ThemeIsland/index.d.ts.map +1 -0
- package/build/components/ThemeIsland/index.js +1 -0
- package/build/foundations/type-scale.d.ts +12 -0
- package/build/foundations/type-scale.d.ts.map +1 -0
- package/build/foundations/type-scale.js +11 -0
- package/build/hooks/use-mobile.d.ts +2 -0
- package/build/hooks/use-mobile.d.ts.map +1 -0
- package/build/hooks/use-mobile.js +15 -0
- package/build/hooks/use-reduced-motion.d.ts +6 -0
- package/build/hooks/use-reduced-motion.d.ts.map +1 -0
- package/build/hooks/use-reduced-motion.js +14 -0
- package/build/layout/Container/Container.d.ts +10 -0
- package/build/layout/Container/Container.d.ts.map +1 -0
- package/build/layout/Container/Container.js +7 -0
- package/build/layout/Page/Page.d.ts +9 -0
- package/build/layout/Page/Page.d.ts.map +1 -0
- package/build/layout/Page/Page.js +7 -0
- package/build/layout/Section/Section.d.ts +12 -0
- package/build/layout/Section/Section.d.ts.map +1 -0
- package/build/layout/Section/Section.js +9 -0
- package/build/layout/SectionHeading/SectionHeading.d.ts +18 -0
- package/build/layout/SectionHeading/SectionHeading.d.ts.map +1 -0
- package/build/layout/SectionHeading/SectionHeading.js +14 -0
- package/build/lib/utils.d.ts +2 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +1 -0
- package/build/primitives/accordion.d.ts +8 -0
- package/build/primitives/accordion.d.ts.map +1 -0
- package/build/primitives/accordion.js +18 -0
- package/build/primitives/alert-dialog.d.ts +19 -0
- package/build/primitives/alert-dialog.d.ts.map +1 -0
- package/build/primitives/alert-dialog.js +43 -0
- package/build/primitives/alert.d.ts +10 -0
- package/build/primitives/alert.d.ts.map +1 -0
- package/build/primitives/alert.js +24 -0
- package/build/primitives/aspect-ratio.d.ts +5 -0
- package/build/primitives/aspect-ratio.d.ts.map +1 -0
- package/build/primitives/aspect-ratio.js +6 -0
- package/build/primitives/avatar.d.ts +12 -0
- package/build/primitives/avatar.d.ts.map +1 -0
- package/build/primitives/avatar.js +22 -0
- package/build/primitives/badge.d.ts +10 -0
- package/build/primitives/badge.d.ts.map +1 -0
- package/build/primitives/badge.js +28 -0
- package/build/primitives/breadcrumb.d.ts +12 -0
- package/build/primitives/breadcrumb.d.ts.map +1 -0
- package/build/primitives/breadcrumb.js +27 -0
- package/build/primitives/button-group.d.ts +13 -0
- package/build/primitives/button-group.d.ts.map +1 -0
- package/build/primitives/button-group.js +27 -0
- package/build/primitives/button.d.ts +11 -0
- package/build/primitives/button.d.ts.map +1 -0
- package/build/primitives/button.js +37 -0
- package/build/primitives/calendar.d.ts +9 -0
- package/build/primitives/calendar.d.ts.map +1 -0
- package/build/primitives/calendar.js +77 -0
- package/build/primitives/card.d.ts +10 -0
- package/build/primitives/card.d.ts.map +1 -0
- package/build/primitives/card.js +24 -0
- package/build/primitives/carousel.d.ts +20 -0
- package/build/primitives/carousel.d.ts.map +1 -0
- package/build/primitives/carousel.js +91 -0
- package/build/primitives/chart.d.ts +45 -0
- package/build/primitives/chart.d.ts.map +1 -0
- package/build/primitives/chart.js +136 -0
- package/build/primitives/checkbox.d.ts +5 -0
- package/build/primitives/checkbox.d.ts.map +1 -0
- package/build/primitives/checkbox.js +8 -0
- package/build/primitives/collapsible.d.ts +7 -0
- package/build/primitives/collapsible.d.ts.map +1 -0
- package/build/primitives/collapsible.js +13 -0
- package/build/primitives/command.d.ts +19 -0
- package/build/primitives/command.d.ts.map +1 -0
- package/build/primitives/command.js +33 -0
- package/build/primitives/context-menu.d.ts +26 -0
- package/build/primitives/context-menu.d.ts.map +1 -0
- package/build/primitives/context-menu.js +51 -0
- package/build/primitives/dialog.d.ts +18 -0
- package/build/primitives/dialog.d.ts.map +1 -0
- package/build/primitives/dialog.js +37 -0
- package/build/primitives/drawer.d.ts +14 -0
- package/build/primitives/drawer.d.ts.map +1 -0
- package/build/primitives/drawer.js +36 -0
- package/build/primitives/dropdown-menu.d.ts +26 -0
- package/build/primitives/dropdown-menu.d.ts.map +1 -0
- package/build/primitives/dropdown-menu.js +51 -0
- package/build/primitives/empty.d.ts +13 -0
- package/build/primitives/empty.d.ts.map +1 -0
- package/build/primitives/empty.js +33 -0
- package/build/primitives/field.d.ts +26 -0
- package/build/primitives/field.d.ts.map +1 -0
- package/build/primitives/field.js +76 -0
- package/build/primitives/form.d.ts +25 -0
- package/build/primitives/form.d.ts.map +1 -0
- package/build/primitives/form.js +59 -0
- package/build/primitives/hover-card.d.ts +7 -0
- package/build/primitives/hover-card.d.ts.map +1 -0
- package/build/primitives/hover-card.js +14 -0
- package/build/primitives/input-group.d.ts +17 -0
- package/build/primitives/input-group.d.ts.map +1 -0
- package/build/primitives/input-group.js +63 -0
- package/build/primitives/input-otp.d.ts +12 -0
- package/build/primitives/input-otp.d.ts.map +1 -0
- package/build/primitives/input-otp.js +21 -0
- package/build/primitives/input.d.ts +4 -0
- package/build/primitives/input.d.ts.map +1 -0
- package/build/primitives/input.js +6 -0
- package/build/primitives/item.d.ts +24 -0
- package/build/primitives/item.d.ts.map +1 -0
- package/build/primitives/item.js +66 -0
- package/build/primitives/kbd.d.ts +5 -0
- package/build/primitives/kbd.d.ts.map +1 -0
- package/build/primitives/kbd.js +9 -0
- package/build/primitives/label.d.ts +5 -0
- package/build/primitives/label.d.ts.map +1 -0
- package/build/primitives/label.js +7 -0
- package/build/primitives/menubar.d.ts +27 -0
- package/build/primitives/menubar.d.ts.map +1 -0
- package/build/primitives/menubar.js +55 -0
- package/build/primitives/navigation-menu.d.ts +15 -0
- package/build/primitives/navigation-menu.d.ts.map +1 -0
- package/build/primitives/navigation-menu.js +31 -0
- package/build/primitives/pagination.d.ts +14 -0
- package/build/primitives/pagination.d.ts.map +1 -0
- package/build/primitives/pagination.js +29 -0
- package/build/primitives/popover.d.ts +11 -0
- package/build/primitives/popover.d.ts.map +1 -0
- package/build/primitives/popover.js +27 -0
- package/build/primitives/progress.d.ts +5 -0
- package/build/primitives/progress.d.ts.map +1 -0
- package/build/primitives/progress.js +7 -0
- package/build/primitives/radio-group.d.ts +6 -0
- package/build/primitives/radio-group.d.ts.map +1 -0
- package/build/primitives/radio-group.js +12 -0
- package/build/primitives/resizable.d.ts +9 -0
- package/build/primitives/resizable.d.ts.map +1 -0
- package/build/primitives/resizable.js +14 -0
- package/build/primitives/scroll-area.d.ts +6 -0
- package/build/primitives/scroll-area.d.ts.map +1 -0
- package/build/primitives/scroll-area.js +13 -0
- package/build/primitives/select.d.ts +16 -0
- package/build/primitives/select.d.ts.map +1 -0
- package/build/primitives/select.js +39 -0
- package/build/primitives/separator.d.ts +5 -0
- package/build/primitives/separator.d.ts.map +1 -0
- package/build/primitives/separator.js +8 -0
- package/build/primitives/sheet.d.ts +15 -0
- package/build/primitives/sheet.d.ts.map +1 -0
- package/build/primitives/sheet.js +41 -0
- package/build/primitives/sidebar.d.ts +70 -0
- package/build/primitives/sidebar.d.ts.map +1 -0
- package/build/primitives/sidebar.js +212 -0
- package/build/primitives/skeleton.d.ts +4 -0
- package/build/primitives/skeleton.d.ts.map +1 -0
- package/build/primitives/skeleton.js +6 -0
- package/build/primitives/slider.d.ts +5 -0
- package/build/primitives/slider.d.ts.map +1 -0
- package/build/primitives/slider.js +14 -0
- package/build/primitives/sonner.d.ts +5 -0
- package/build/primitives/sonner.d.ts.map +1 -0
- package/build/primitives/sonner.js +19 -0
- package/build/primitives/spinner.d.ts +4 -0
- package/build/primitives/spinner.d.ts.map +1 -0
- package/build/primitives/spinner.js +7 -0
- package/build/primitives/switch.d.ts +7 -0
- package/build/primitives/switch.d.ts.map +1 -0
- package/build/primitives/switch.js +8 -0
- package/build/primitives/table.d.ts +11 -0
- package/build/primitives/table.d.ts.map +1 -0
- package/build/primitives/table.js +28 -0
- package/build/primitives/tabs.d.ts +12 -0
- package/build/primitives/tabs.d.ts.map +1 -0
- package/build/primitives/tabs.js +28 -0
- package/build/primitives/textarea.d.ts +4 -0
- package/build/primitives/textarea.d.ts.map +1 -0
- package/build/primitives/textarea.js +6 -0
- package/build/primitives/toggle-group.d.ts +10 -0
- package/build/primitives/toggle-group.d.ts.map +1 -0
- package/build/primitives/toggle-group.js +22 -0
- package/build/primitives/toggle.d.ts +10 -0
- package/build/primitives/toggle.d.ts.map +1 -0
- package/build/primitives/toggle.js +25 -0
- package/build/primitives/tooltip.d.ts +8 -0
- package/build/primitives/tooltip.d.ts.map +1 -0
- package/build/primitives/tooltip.js +18 -0
- package/build/shadcn.css +650 -0
- package/build/styles.css +699 -0
- package/package.json +188 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type CodeTab = {
|
|
3
|
+
label: string;
|
|
4
|
+
code: string;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
tabs: CodeTab[];
|
|
8
|
+
/** Milliseconds per tab. Walks through the tabs on its own until someone picks one. */
|
|
9
|
+
autoplayMs?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
/** The Terminal's frame with tabs for files and commands, code highlighted line by line. */
|
|
13
|
+
export declare const CodeWindow: React.FC<Props>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=CodeWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeWindow.d.ts","sourceRoot":"","sources":["../../../src/components/CodeWindow/CodeWindow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoHtC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Copy } from "lucide-react";
|
|
4
|
+
import { motion } from "motion/react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { useReducedMotion } from "../../hooks/use-reduced-motion";
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
import { Button } from "../../primitives/button";
|
|
9
|
+
import { highlight } from "./highlight";
|
|
10
|
+
const COPIED_DURATION_MS = 1400;
|
|
11
|
+
/** The Terminal's frame with tabs for files and commands, code highlighted line by line. */
|
|
12
|
+
export const CodeWindow = (props) => {
|
|
13
|
+
const { tabs, autoplayMs, className } = props;
|
|
14
|
+
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
15
|
+
const [isHeld, setIsHeld] = React.useState(false);
|
|
16
|
+
const [isCopied, setIsCopied] = React.useState(false);
|
|
17
|
+
const timerRef = React.useRef(undefined);
|
|
18
|
+
const isReducedMotion = useReducedMotion();
|
|
19
|
+
const tab = tabs[activeIndex];
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (autoplayMs === undefined ||
|
|
22
|
+
isHeld === true ||
|
|
23
|
+
isReducedMotion === true) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const interval = setInterval(() => setActiveIndex((index) => (index + 1) % tabs.length), autoplayMs);
|
|
27
|
+
return () => clearInterval(interval);
|
|
28
|
+
}, [autoplayMs, isHeld, isReducedMotion, tabs.length]);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
return () => clearTimeout(timerRef.current);
|
|
31
|
+
}, []);
|
|
32
|
+
if (tab === undefined) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const onPick = (index) => {
|
|
36
|
+
setIsHeld(true);
|
|
37
|
+
setActiveIndex(index);
|
|
38
|
+
};
|
|
39
|
+
// same contract as InstallCommand: "copied" only once the clipboard has it
|
|
40
|
+
const onCopy = () => {
|
|
41
|
+
if (navigator.clipboard === undefined) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
navigator.clipboard.writeText(tab.code).then(() => {
|
|
45
|
+
setIsCopied(true);
|
|
46
|
+
clearTimeout(timerRef.current);
|
|
47
|
+
timerRef.current = setTimeout(() => setIsCopied(false), COPIED_DURATION_MS);
|
|
48
|
+
}, () => undefined);
|
|
49
|
+
};
|
|
50
|
+
return (_jsxs("div", { className: cn("bg-card cui-shadow-object overflow-hidden rounded-[22px] border", className), children: [_jsxs("div", { className: "flex items-center gap-1.5 border-b px-3 py-2", children: [_jsx("i", { className: "bg-line size-2.5 rounded-full" }), _jsx("i", { className: "bg-line size-2.5 rounded-full" }), _jsx("i", { className: "bg-line size-2.5 rounded-full" }), _jsx("div", { className: "ml-2 flex min-w-0 gap-0.5 overflow-x-auto", role: "tablist", children: tabs.map((item, index) => (_jsx("button", { type: "button", role: "tab", "aria-selected": index === activeIndex, onClick: () => onPick(index), className: cn("h-7 shrink-0 rounded-md px-2.5 font-mono text-xs transition-colors", index === activeIndex
|
|
51
|
+
? "bg-accent text-foreground"
|
|
52
|
+
: "text-muted-foreground hover:text-foreground"), children: item.label }, item.label))) }), _jsx(Button, { variant: "ghost", size: "icon-sm", className: "ml-auto size-7 shrink-0 rounded-md", "aria-label": "Copy", onClick: onCopy, children: isCopied === true ? _jsx(Check, { className: "text-brand" }) : _jsx(Copy, {}) })] }), _jsx("pre", { className: "min-h-[300px] overflow-x-auto px-5 py-4 font-mono text-[13.5px] leading-7", children: tab.code.split("\n").map((line, index) => (_jsx(motion.div, { className: "whitespace-pre", initial: isReducedMotion === true ? false : { opacity: 0, x: -6 }, animate: { opacity: 1, x: 0 }, transition: { delay: index * 0.035, duration: 0.25 }, children: line.length > 0 ? highlight(line) : " " }, `${activeIndex}-${index}`))) })] }));
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../src/components/CodeWindow/highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wHAAwH;AACxH,eAAO,MAAM,SAAS,SAAU,MAAM,KAAG,MAAM,SAAS,EA6BvD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// comments, strings, a few keywords, calls, the leading mark of a CLI line (+ ~ = ✓ ← $), numbers
|
|
3
|
+
const TOKEN = /(\/\/.*$|#.*$|"[^"]*"|\b(?:import|export|const|from|true|false)\b|\b[A-Za-z_]\w*(?=\()|^[+~=✓←$](?= )|\b\d+\b)/g;
|
|
4
|
+
/** Colours one line of TypeScript or CLI output with the house tokens. Not a parser: enough for a marketing snippet. */
|
|
5
|
+
export const highlight = (line) => {
|
|
6
|
+
const out = [];
|
|
7
|
+
let last = 0;
|
|
8
|
+
for (const match of line.matchAll(TOKEN)) {
|
|
9
|
+
const token = match[0];
|
|
10
|
+
const index = match.index;
|
|
11
|
+
if (index === undefined) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (index > last) {
|
|
15
|
+
out.push(line.slice(last, index));
|
|
16
|
+
}
|
|
17
|
+
out.push(_jsx("span", { className: tokenClass(token), children: token }, index));
|
|
18
|
+
last = index + token.length;
|
|
19
|
+
}
|
|
20
|
+
if (last < line.length) {
|
|
21
|
+
out.push(line.slice(last));
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
};
|
|
25
|
+
const tokenClass = (token) => {
|
|
26
|
+
if (token.startsWith("#") || token.startsWith("//")) {
|
|
27
|
+
return "text-faint";
|
|
28
|
+
}
|
|
29
|
+
if (token.startsWith('"')) {
|
|
30
|
+
return "text-brand-text";
|
|
31
|
+
}
|
|
32
|
+
if (/^(import|export|const|from)$/.test(token)) {
|
|
33
|
+
return "text-brand";
|
|
34
|
+
}
|
|
35
|
+
if (/^(true|false|\d+)$/.test(token)) {
|
|
36
|
+
return "text-foreground";
|
|
37
|
+
}
|
|
38
|
+
if (token === "+" || token === "✓") {
|
|
39
|
+
return "text-brand";
|
|
40
|
+
}
|
|
41
|
+
if (token === "~" || token === "←") {
|
|
42
|
+
return "text-warning";
|
|
43
|
+
}
|
|
44
|
+
if (token === "=" || token === "$") {
|
|
45
|
+
return "text-faint";
|
|
46
|
+
}
|
|
47
|
+
return "font-semibold text-foreground";
|
|
48
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/** What one cell says: yes, no, partly, or words. */
|
|
3
|
+
export type ComparisonCell = {
|
|
4
|
+
type: "check";
|
|
5
|
+
} | {
|
|
6
|
+
type: "cross";
|
|
7
|
+
} | {
|
|
8
|
+
type: "partial";
|
|
9
|
+
note?: React.ReactNode;
|
|
10
|
+
} | {
|
|
11
|
+
type: "text";
|
|
12
|
+
text: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export type ComparisonColumn = {
|
|
15
|
+
/** A logo and a name, a plan: whatever heads the column. */
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
/** The column that is "us": tinted, its text in full contrast. One per table. */
|
|
18
|
+
isHighlighted?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type ComparisonRow = {
|
|
21
|
+
/** What the row compares, read out as the row's header. */
|
|
22
|
+
label: React.ReactNode;
|
|
23
|
+
/** One per column, in the columns' order. */
|
|
24
|
+
cells: ComparisonCell[];
|
|
25
|
+
};
|
|
26
|
+
/** A heading across the table that opens a group of rows. */
|
|
27
|
+
export type ComparisonGroup = {
|
|
28
|
+
group: React.ReactNode;
|
|
29
|
+
};
|
|
30
|
+
type Props = {
|
|
31
|
+
columns: ComparisonColumn[];
|
|
32
|
+
rows: (ComparisonRow | ComparisonGroup)[];
|
|
33
|
+
/** The corner cell, over the row labels: what the rows are. Left out, the corner stays empty. */
|
|
34
|
+
rowHeader?: React.ReactNode;
|
|
35
|
+
/** The id of the heading that names the table, such as the section's `<h2>`. */
|
|
36
|
+
labelledBy?: string;
|
|
37
|
+
/** Names the table for screen readers when no heading on the page does. Not shown. */
|
|
38
|
+
caption?: string;
|
|
39
|
+
/** What a screen reader hears for each mark, since the marks are icons. */
|
|
40
|
+
labels?: {
|
|
41
|
+
check?: string;
|
|
42
|
+
cross?: string;
|
|
43
|
+
partial?: string;
|
|
44
|
+
};
|
|
45
|
+
/** Centres the cells, for a table of marks and short values such as plans. Words read better from the left. */
|
|
46
|
+
isCentered?: boolean;
|
|
47
|
+
/** The narrowest a value column gets, on a page wide enough for the table layout, before it scrolls in its box. */
|
|
48
|
+
minColumnWidthPx?: number;
|
|
49
|
+
className?: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A comparison as a real `<table>`: a header row of columns, one highlighted as "us", and rows of checks, crosses,
|
|
53
|
+
* partials or words, optionally split by group headings. Every header is a `<th>` with its `scope`, and the marks are
|
|
54
|
+
* named for screen readers.
|
|
55
|
+
*
|
|
56
|
+
* On a narrow page (under 672px of page width) each row becomes a block: its label, then the highlighted column's
|
|
57
|
+
* cell, then the others, every cell carrying its column's label. "Us" is never the column cut off at the edge, and the
|
|
58
|
+
* page never scrolls sideways. It is the same table, restyled, so the HTML and its text do not change with the width.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ComparisonTable: React.FC<Props>;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=ComparisonTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComparisonTable.d.ts","sourceRoot":"","sources":["../../../src/components/ComparisonTable/ComparisonTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,qDAAqD;AACrD,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4DAA4D;IAC5D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,iFAAiF;IACjF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,2DAA2D;IAC3D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,6CAA6C;IAC7C,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB,CAAC;AAEF,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,aAAa,GAAG,eAAe,CAAC,EAAE,CAAC;IAC1C,iGAAiG;IACjG,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,+GAA+G;IAC/G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mHAAmH;IACnH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+I3C,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, Minus, X } from "lucide-react";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
const ROW_HEADER_MIN_WIDTH_PX = 132;
|
|
5
|
+
/**
|
|
6
|
+
* A comparison as a real `<table>`: a header row of columns, one highlighted as "us", and rows of checks, crosses,
|
|
7
|
+
* partials or words, optionally split by group headings. Every header is a `<th>` with its `scope`, and the marks are
|
|
8
|
+
* named for screen readers.
|
|
9
|
+
*
|
|
10
|
+
* On a narrow page (under 672px of page width) each row becomes a block: its label, then the highlighted column's
|
|
11
|
+
* cell, then the others, every cell carrying its column's label. "Us" is never the column cut off at the edge, and the
|
|
12
|
+
* page never scrolls sideways. It is the same table, restyled, so the HTML and its text do not change with the width.
|
|
13
|
+
*/
|
|
14
|
+
export const ComparisonTable = (props) => {
|
|
15
|
+
const { columns, rows, rowHeader, labelledBy, caption, labels, isCentered = false, minColumnWidthPx = 150, className, } = props;
|
|
16
|
+
const hasName = labelledBy !== undefined || caption !== undefined;
|
|
17
|
+
const minWidth = ROW_HEADER_MIN_WIDTH_PX + columns.length * minColumnWidthPx;
|
|
18
|
+
return (_jsx("div", {
|
|
19
|
+
// a box that scrolls is reachable by keyboard, and named, when the table has a name to give it
|
|
20
|
+
role: hasName === true ? "region" : undefined, "aria-labelledby": labelledBy, "aria-label": labelledBy === undefined ? caption : undefined, tabIndex: hasName === true ? 0 : undefined, className: cn("bg-card focus-visible:ring-ring/50 w-full overflow-x-auto rounded-2xl border outline-none focus-visible:ring-[3px]", className), children: _jsxs("table", { className: "w-full border-separate border-spacing-0 text-left text-sm @max-2xl/page:block @2xl/page:min-w-(--cui-table-min)", style: { "--cui-table-min": `${minWidth}px` }, children: [caption !== undefined ? (_jsx("caption", { className: "sr-only", children: caption })) : null, _jsx("thead", { className: "@max-2xl/page:hidden", children: _jsxs("tr", { children: [rowHeader !== undefined ? (_jsx("th", { scope: "col", className: "bg-card text-muted-foreground sticky left-0 z-10 border-b px-5 py-4 align-middle text-xs font-semibold", children: rowHeader })) : (_jsx("td", { className: "bg-card sticky left-0 z-10 border-b px-5 py-4" })), columns.map((column, index) => (_jsx("th", { scope: "col", className: cn("border-b px-5 py-4 align-middle text-xs font-semibold", column.isHighlighted === true
|
|
21
|
+
? "bg-brand-subtle text-brand-text dark:text-brand"
|
|
22
|
+
: "text-muted-foreground", isCentered === true && "text-center"), children: _jsx("span", { className: cn("inline-flex items-center gap-2.5", isCentered === true && "justify-center"), children: column.label }) }, index)))] }) }), _jsx("tbody", { className: "@max-2xl/page:block", children: rows.map((row, rowIndex) => {
|
|
23
|
+
if ("group" in row) {
|
|
24
|
+
return (_jsx("tr", { className: "@max-2xl/page:block", children: _jsx("th", { scope: "colgroup", colSpan: columns.length + 1, className: "bg-stage border-b px-5 pt-6 pb-3 text-[13px] font-semibold @max-2xl/page:block", children: row.group }) }, rowIndex));
|
|
25
|
+
}
|
|
26
|
+
const isLast = rowIndex === rows.length - 1;
|
|
27
|
+
return (_jsxs("tr", { className: cn("@max-2xl/page:flex @max-2xl/page:flex-col @max-2xl/page:gap-2 @max-2xl/page:px-4 @max-2xl/page:py-4", isLast === false && "@max-2xl/page:border-b"), children: [_jsx("th", { scope: "row", className: cn("bg-card text-muted-foreground @max-2xl/page:text-foreground sticky left-0 z-10 px-5 py-4 align-top font-normal @max-2xl/page:static @max-2xl/page:order-first @max-2xl/page:p-0 @max-2xl/page:font-semibold @2xl/page:min-w-40", isLast === false && "@2xl/page:border-b"), children: row.label }), columns.map((column, cellIndex) => (_jsxs("td", { className: cn("px-5 py-4 align-top leading-relaxed @max-2xl/page:block @max-2xl/page:rounded-lg @max-2xl/page:px-3 @max-2xl/page:py-2.5 @max-2xl/page:text-left", isLast === false && "@2xl/page:border-b", column.isHighlighted === true
|
|
28
|
+
? "bg-brand-subtle text-foreground @max-2xl/page:order-1"
|
|
29
|
+
: "text-muted-foreground @max-2xl/page:order-2", isCentered === true && "text-center"), children: [_jsx("span", { "aria-hidden": true, className: cn("mb-1 flex items-center gap-2 text-xs font-semibold @2xl/page:hidden", column.isHighlighted === true
|
|
30
|
+
? "text-brand-text dark:text-brand"
|
|
31
|
+
: "text-muted-foreground"), children: column.label }), _jsx(CellContent, { cell: row.cells[cellIndex], labels: labels, isCentered: isCentered })] }, cellIndex)))] }, rowIndex));
|
|
32
|
+
}) })] }) }));
|
|
33
|
+
};
|
|
34
|
+
const CellContent = (props) => {
|
|
35
|
+
const { cell, labels, isCentered } = props;
|
|
36
|
+
if (cell === undefined) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (cell.type === "text") {
|
|
40
|
+
return cell.text;
|
|
41
|
+
}
|
|
42
|
+
if (cell.type === "check") {
|
|
43
|
+
return (_jsx(Mark, { label: labels !== undefined && labels.check !== undefined
|
|
44
|
+
? labels.check
|
|
45
|
+
: "Yes", isCentered: isCentered, children: _jsx(Check, { className: "text-brand size-[18px]", strokeWidth: 2.25 }) }));
|
|
46
|
+
}
|
|
47
|
+
if (cell.type === "cross") {
|
|
48
|
+
return (_jsx(Mark, { label: labels !== undefined && labels.cross !== undefined
|
|
49
|
+
? labels.cross
|
|
50
|
+
: "No", isCentered: isCentered, children: _jsx(X, { className: "text-faint size-[18px]", strokeWidth: 2.25 }) }));
|
|
51
|
+
}
|
|
52
|
+
return (_jsxs("span", { className: cn("inline-flex items-center gap-2", isCentered === true && "justify-center"), children: [_jsx(Mark, { label: labels !== undefined && labels.partial !== undefined
|
|
53
|
+
? labels.partial
|
|
54
|
+
: "Partly", isCentered: isCentered, children: _jsx(Minus, { className: "text-muted-foreground size-[18px]", strokeWidth: 2.25 }) }), cell.note] }));
|
|
55
|
+
};
|
|
56
|
+
/** An icon named for screen readers by `aria-label`, so the table's text stays the words on the page. */
|
|
57
|
+
const Mark = (props) => {
|
|
58
|
+
const { label, isCentered, children } = props;
|
|
59
|
+
return (_jsx("span", { role: "img", "aria-label": label, className: cn("inline-flex align-middle", isCentered === true && "justify-center"), children: children }));
|
|
60
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
to: number;
|
|
4
|
+
suffix?: string;
|
|
5
|
+
decimals?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Counts from zero to `to` the first time it scrolls into view. Renders the final value first, for no-JS and SEO, and
|
|
9
|
+
* keeps it under reduced motion and when it is already on screen at load.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CountUp: React.FC<Props>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=CountUp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountUp.d.ts","sourceRoot":"","sources":["../../../src/components/CountUp/CountUp.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwDnC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { animate, motion, useInView, useMotionValue, useTransform, } from "motion/react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { useReducedMotion } from "../../hooks/use-reduced-motion";
|
|
6
|
+
/**
|
|
7
|
+
* Counts from zero to `to` the first time it scrolls into view. Renders the final value first, for no-JS and SEO, and
|
|
8
|
+
* keeps it under reduced motion and when it is already on screen at load.
|
|
9
|
+
*/
|
|
10
|
+
export const CountUp = (props) => {
|
|
11
|
+
const { to, suffix = "", decimals = 0 } = props;
|
|
12
|
+
const ref = React.useRef(null);
|
|
13
|
+
const isInView = useInView(ref, { once: true });
|
|
14
|
+
const isReducedMotion = useReducedMotion();
|
|
15
|
+
// the number lives in a motion value that the span renders, so Motion updates the text and React never overwrites a
|
|
16
|
+
// frame of the count; it starts at the final value, which is what the server renders
|
|
17
|
+
const count = useMotionValue(to);
|
|
18
|
+
const text = useTransform(count, (value) => formatCount(value, decimals) + suffix);
|
|
19
|
+
// whether it may count at all: only when it starts off screen. One already in view on load keeps the final value it
|
|
20
|
+
// was rendered with, because counting would mean snapping it to zero in front of the reader.
|
|
21
|
+
const canCountRef = React.useRef(false);
|
|
22
|
+
React.useLayoutEffect(() => {
|
|
23
|
+
if (ref.current === null) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const box = ref.current.getBoundingClientRect();
|
|
27
|
+
if (box.bottom > 0 && box.top < window.innerHeight) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
canCountRef.current = true;
|
|
31
|
+
count.jump(0);
|
|
32
|
+
}, [count]);
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (canCountRef.current === false || isReducedMotion === true) {
|
|
35
|
+
count.jump(to);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (isInView === false) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const controls = animate(count, to, {
|
|
42
|
+
duration: 1.4,
|
|
43
|
+
ease: [0.16, 1, 0.3, 1],
|
|
44
|
+
});
|
|
45
|
+
return () => controls.stop();
|
|
46
|
+
}, [count, isInView, isReducedMotion, to]);
|
|
47
|
+
return (_jsx(motion.span, { ref: ref, className: "tabular-nums", children: text }));
|
|
48
|
+
};
|
|
49
|
+
const formatCount = (value, decimals) => value.toLocaleString("en-US", {
|
|
50
|
+
maximumFractionDigits: decimals,
|
|
51
|
+
minimumFractionDigits: decimals,
|
|
52
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type EyebrowVariant = "path" | "plain" | "label";
|
|
3
|
+
type Props = {
|
|
4
|
+
children: string;
|
|
5
|
+
/**
|
|
6
|
+
* `path` reads as a folder of the repo, `~/cookbooks/`. `plain` is the words in the brand colour. `label` is the small
|
|
7
|
+
* mono label of a menu's group titles. Each works on dark and light; the theme only sets the colours.
|
|
8
|
+
*/
|
|
9
|
+
variant?: EyebrowVariant;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
/** The label above a section title. */
|
|
13
|
+
export declare const Eyebrow: React.FC<Props>;
|
|
14
|
+
type SlotProps = {
|
|
15
|
+
/** Words, shown as the default eyebrow, or an `<Eyebrow>` with another variant. */
|
|
16
|
+
eyebrow: React.ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/** What a block renders for its `eyebrow` prop. */
|
|
19
|
+
export declare const EyebrowSlot: React.FC<SlotProps>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=Eyebrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Eyebrow.d.ts","sourceRoot":"","sources":["../../../src/components/Eyebrow/Eyebrow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAExD,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA6BnC,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,mFAAmF;IACnF,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAQ3C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
/** The label above a section title. */
|
|
4
|
+
export const Eyebrow = (props) => {
|
|
5
|
+
const { children, variant = "path", className } = props;
|
|
6
|
+
if (variant === "label") {
|
|
7
|
+
return _jsx("span", { className: cn("cui-eyebrow", className), children: children });
|
|
8
|
+
}
|
|
9
|
+
if (variant === "plain") {
|
|
10
|
+
return (_jsx("span", { className: cn("text-brand-text dark:text-brand text-[15px] font-medium tracking-[-0.01em]", className), children: children }));
|
|
11
|
+
}
|
|
12
|
+
return (_jsxs("span", { className: cn("font-mono text-sm", className), children: [_jsx("span", { className: "text-faint", children: "~/" }), _jsx("span", { className: "text-brand-text dark:text-brand", children: toPath(children) }), _jsx("span", { className: "text-faint", children: "/" })] }));
|
|
13
|
+
};
|
|
14
|
+
/** What a block renders for its `eyebrow` prop. */
|
|
15
|
+
export const EyebrowSlot = (props) => {
|
|
16
|
+
const { eyebrow } = props;
|
|
17
|
+
if (typeof eyebrow === "string") {
|
|
18
|
+
return _jsx(Eyebrow, { children: eyebrow });
|
|
19
|
+
}
|
|
20
|
+
return eyebrow;
|
|
21
|
+
};
|
|
22
|
+
/** "Security & compliance" becomes "security-compliance", "Own it, don't rent it" becomes "own-it-dont-rent-it". */
|
|
23
|
+
const toPath = (label) => {
|
|
24
|
+
return label
|
|
25
|
+
.toLowerCase()
|
|
26
|
+
.replace(/['’]/g, "")
|
|
27
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
28
|
+
.replace(/^-|-$/g, "");
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
type Props = {
|
|
4
|
+
icon: LucideIcon;
|
|
5
|
+
title: string;
|
|
6
|
+
description: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
/** A small icon before the title, then two lines: the site's bento card. The title is a bare `<h3>`, its type on a wrapper. */
|
|
10
|
+
export declare const FeatureCard: React.FC<Props>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=FeatureCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureCard.d.ts","sourceRoot":"","sources":["../../../src/components/FeatureCard/FeatureCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,+HAA+H;AAC/H,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqBvC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
import { Card } from "../../primitives/card";
|
|
4
|
+
/** A small icon before the title, then two lines: the site's bento card. The title is a bare `<h3>`, its type on a wrapper. */
|
|
5
|
+
export const FeatureCard = (props) => {
|
|
6
|
+
const { icon: Icon, title, description, className } = props;
|
|
7
|
+
return (_jsxs(Card, { className: cn("h-full gap-1.5 rounded-[22px] p-6 shadow-none @4xl/page:p-7", className), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Icon, { className: "text-brand size-4 shrink-0" }), _jsx("div", { className: "text-[17px] leading-6 font-semibold tracking-tight", children: _jsx("h3", { children: title }) })] }), _jsx("p", { className: "text-muted-foreground line-clamp-2 min-h-12 text-[15px] leading-6 text-pretty", children: description })] }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Brightens the border on hover, for a card that is a link. The light that follows the pointer is always on. */
|
|
6
|
+
isInteractive?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** A card under which a soft brand light follows the pointer. */
|
|
9
|
+
export declare const GlowCard: React.FC<Props>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=GlowCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlowCard.d.ts","sourceRoot":"","sources":["../../../src/components/GlowCard/GlowCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iHAAiH;IACjH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4BpC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
/** A card under which a soft brand light follows the pointer. */
|
|
5
|
+
export const GlowCard = (props) => {
|
|
6
|
+
const { children, className, isInteractive = true } = props;
|
|
7
|
+
const onPointerMove = (event) => {
|
|
8
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
9
|
+
event.currentTarget.style.setProperty("--mx", `${event.clientX - box.left}px`);
|
|
10
|
+
event.currentTarget.style.setProperty("--my", `${event.clientY - box.top}px`);
|
|
11
|
+
};
|
|
12
|
+
return (_jsx("div", { className: cn("cui-glow-follow bg-card text-card-foreground relative rounded-2xl border", isInteractive === true &&
|
|
13
|
+
"hover:border-foreground/20 transition-[border-color] duration-200", className), onPointerMove: onPointerMove, children: children }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The phrase of a title set in the brand colour, such as "Running on Cargo." after "Built with Claude Code." The deep
|
|
8
|
+
* shade on light pages, where the bright one falls under 3:1 against the cream; the bright one on dark.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Highlight: React.FC<Props>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=Highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Highlight.d.ts","sourceRoot":"","sources":["../../../src/components/Highlight/Highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAQrC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
/**
|
|
4
|
+
* The phrase of a title set in the brand colour, such as "Running on Cargo." after "Built with Claude Code." The deep
|
|
5
|
+
* shade on light pages, where the bright one falls under 3:1 against the cream; the bright one on dark.
|
|
6
|
+
*/
|
|
7
|
+
export const Highlight = (props) => {
|
|
8
|
+
const { children, className } = props;
|
|
9
|
+
return (_jsx("span", { className: cn("text-brand-text dark:text-brand", className), children: children }));
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstallCommand.d.ts","sourceRoot":"","sources":["../../../src/components/InstallCommand/InstallCommand.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA0D1C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Copy } from "lucide-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
import { Button } from "../../primitives/button";
|
|
7
|
+
const COPIED_DURATION_MS = 1600;
|
|
8
|
+
/** A one-line shell command with a copy button. */
|
|
9
|
+
export const InstallCommand = (props) => {
|
|
10
|
+
const { command, className } = props;
|
|
11
|
+
const [isCopied, setIsCopied] = React.useState(false);
|
|
12
|
+
const timerRef = React.useRef(undefined);
|
|
13
|
+
// "Copied" only once the clipboard has it: the API is missing outside HTTPS and can be refused in an iframe. A second
|
|
14
|
+
// click restarts the countdown rather than letting the first one cut it short.
|
|
15
|
+
const onCopy = () => {
|
|
16
|
+
// the DOM types claim it always exists; outside a secure context it does not
|
|
17
|
+
if (navigator.clipboard === undefined) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
navigator.clipboard.writeText(command).then(() => {
|
|
21
|
+
setIsCopied(true);
|
|
22
|
+
clearTimeout(timerRef.current);
|
|
23
|
+
timerRef.current = setTimeout(() => setIsCopied(false), COPIED_DURATION_MS);
|
|
24
|
+
}, () => undefined);
|
|
25
|
+
};
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
return () => clearTimeout(timerRef.current);
|
|
28
|
+
}, []);
|
|
29
|
+
return (_jsxs("span", { className: cn("bg-card inline-flex h-12 max-w-full min-w-0 items-center gap-3 rounded-xl border pr-1.5 pl-4 font-mono text-[13.5px]", className), children: [_jsxs("code", { className: "min-w-0 truncate", children: [_jsx("span", { className: "text-faint", children: "$ " }), command] }), _jsxs(Button, { size: "sm", variant: isCopied === true ? "secondary" : "ghost", className: cn("h-9 rounded-lg", isCopied === true && "bg-brand-subtle text-brand-text"), onClick: onCopy, children: [isCopied === true ? _jsx(Check, {}) : _jsx(Copy, {}), isCopied === true ? "Copied" : "Copy"] }), _jsx("span", { className: "sr-only", "aria-live": "polite", children: isCopied === true ? "Copied to clipboard" : "" })] }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
/** The brand's mark, such as `<CargoMark />`. */
|
|
4
|
+
mark: React.ReactNode;
|
|
5
|
+
name: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Adds a "by Cargo" pill, for a product that is not called Cargo. */
|
|
8
|
+
by?: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
/** What the link renders with, such as the app's router link, so going home is not a full page load. */
|
|
11
|
+
linkComponent?: React.ElementType;
|
|
12
|
+
};
|
|
13
|
+
/** The mark and a product name. */
|
|
14
|
+
export declare const Logo: React.FC<Props>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=Logo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/components/Logo/Logo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,KAAK,GAAG;IACX,iDAAiD;IACjD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,aAAa,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACnC,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4BhC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
/** The mark and a product name. */
|
|
4
|
+
export const Logo = (props) => {
|
|
5
|
+
const { mark, name, className, by, href = "/", linkComponent: Link = "a", } = props;
|
|
6
|
+
return (_jsxs(Link, { href: href, className: cn("inline-flex items-center gap-2 text-lg font-bold tracking-[-0.035em]", className), "aria-label": `${by !== undefined ? `${name} by ${by}` : name} home`, children: [_jsx("span", { className: "inline-flex", children: mark }), name, by !== undefined ? (_jsxs("span", { className: "text-muted-foreground ml-0.5 rounded-full border px-2 py-0.5 text-[11px] font-medium tracking-normal", children: ["by ", by] })) : null] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MarqueeItem } from "./types";
|
|
3
|
+
type Props = {
|
|
4
|
+
items: MarqueeItem[];
|
|
5
|
+
/** Milliseconds for one full loop. */
|
|
6
|
+
durationMs?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
/** An endless row of names, paused on hover. The row is drawn twice so the loop has no seam. */
|
|
10
|
+
export declare const Marquee: React.FC<Props>;
|
|
11
|
+
type MarqueeLabelProps = {
|
|
12
|
+
item: MarqueeItem;
|
|
13
|
+
};
|
|
14
|
+
/** A logo alone, or the tile and the name. Shared by the scrolling row and `LogoCloud`'s still grid. */
|
|
15
|
+
export declare const MarqueeLabel: React.FC<MarqueeLabelProps>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=Marquee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marquee.d.ts","sourceRoot":"","sources":["../../../src/components/Marquee/Marquee.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAcnC,CAAC;AAsBF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAsBpD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
/** An endless row of names, paused on hover. The row is drawn twice so the loop has no seam. */
|
|
4
|
+
export const Marquee = (props) => {
|
|
5
|
+
const { items, durationMs = 40000, className } = props;
|
|
6
|
+
return (_jsx("div", { className: cn("cui-marquee", className), style: { "--dur": `${durationMs}ms` }, children: _jsxs("div", { className: "cui-track", children: [_jsx(MarqueeRow, { items: items, isCopy: false }), _jsx(MarqueeRow, { items: items, isCopy: true })] }) }));
|
|
7
|
+
};
|
|
8
|
+
const MarqueeRow = (props) => {
|
|
9
|
+
const { items, isCopy } = props;
|
|
10
|
+
return items.map((item, index) => (_jsx("span", { "aria-hidden": isCopy === true ? true : undefined, className: "text-faint hover:text-foreground inline-flex items-center gap-2.5 text-[17px] font-semibold tracking-[-0.02em] whitespace-nowrap transition-colors", children: _jsx(MarqueeLabel, { item: item }) }, `${index}-${item.name}`)));
|
|
11
|
+
};
|
|
12
|
+
/** A logo alone, or the tile and the name. Shared by the scrolling row and `LogoCloud`'s still grid. */
|
|
13
|
+
export const MarqueeLabel = (props) => {
|
|
14
|
+
const { item } = props;
|
|
15
|
+
if (item.logo !== undefined) {
|
|
16
|
+
return (_jsxs(_Fragment, { children: [item.logo, _jsx("span", { className: "sr-only", children: item.name })] }));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs(_Fragment, { children: [item.tile !== undefined ? (_jsx("span", { className: "cui-tile size-7 rounded-lg text-[11px]", children: item.tile })) : null, item.name] }));
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Marquee/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Marquee, MarqueeLabel } from "./Marquee";
|