react-marketing-ui 0.0.3 → 0.0.5
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/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.mjs +222 -2
- package/dist/accordion.mjs.map +1 -1
- package/dist/action-swap.js +1 -0
- package/dist/action-swap.mjs +77 -3
- package/dist/action-swap.mjs.map +1 -1
- package/dist/animated-beam.js +1 -0
- package/dist/animated-beam.mjs +127 -2
- package/dist/animated-beam.mjs.map +1 -1
- package/dist/button.js +1 -1
- package/dist/button.js.map +1 -1
- package/dist/button.mjs +115 -2
- package/dist/button.mjs.map +1 -1
- package/dist/card.js +1 -2
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +135 -3
- package/dist/card.mjs.map +1 -1
- package/dist/dia-text-reveal.js +1 -0
- package/dist/dia-text-reveal.mjs +331 -2
- package/dist/dia-text-reveal.mjs.map +1 -1
- package/dist/elevated-input.js +1 -1
- package/dist/elevated-input.js.map +1 -1
- package/dist/elevated-input.mjs +48 -2
- package/dist/elevated-input.mjs.map +1 -1
- package/dist/fade-in.js +1 -0
- package/dist/fade-in.mjs +84 -2
- package/dist/fade-in.mjs.map +1 -1
- package/dist/feature-card.js +1 -1
- package/dist/feature-card.js.map +1 -1
- package/dist/feature-card.mjs +34 -2
- package/dist/feature-card.mjs.map +1 -1
- package/dist/flowchart-parts.js +1 -1
- package/dist/flowchart-parts.js.map +1 -1
- package/dist/flowchart-parts.mjs +91 -2
- package/dist/flowchart-parts.mjs.map +1 -1
- package/dist/footer-glow.d.cts +2 -0
- package/dist/footer-glow.d.ts +2 -0
- package/dist/footer-glow.d.ts.map +1 -0
- package/dist/footer-glow.js +110 -0
- package/dist/footer-glow.js.map +1 -0
- package/dist/footer-glow.mjs +108 -0
- package/dist/footer-glow.mjs.map +1 -0
- package/dist/glossy-button.js +1 -1
- package/dist/glossy-button.js.map +1 -1
- package/dist/glossy-button.mjs +82 -2
- package/dist/glossy-button.mjs.map +1 -1
- package/dist/grainient.js +1 -0
- package/dist/grainient.mjs +327 -2
- package/dist/grainient.mjs.map +1 -1
- package/dist/highlighter.js +1 -0
- package/dist/highlighter.mjs +122 -3
- package/dist/highlighter.mjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2741 -32
- package/dist/index.mjs.map +1 -1
- package/dist/input.js +1 -0
- package/dist/input.mjs +107 -2
- package/dist/input.mjs.map +1 -1
- package/dist/lib/breakpoints.js +1 -1
- package/dist/lib/breakpoints.js.map +1 -1
- package/dist/lib/breakpoints.mjs +34 -1
- package/dist/lib/breakpoints.mjs.map +1 -1
- package/dist/lib/cn.js +1 -1
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/cn.mjs +17 -1
- package/dist/lib/cn.mjs.map +1 -1
- package/dist/lib/ease.js +1 -0
- package/dist/lib/ease.mjs +9 -1
- package/dist/lib/ease.mjs.map +1 -1
- package/dist/lib/surface.js +1 -0
- package/dist/lib/surface.mjs +37 -1
- package/dist/lib/surface.mjs.map +1 -1
- package/dist/lib/use-media-query.js +1 -0
- package/dist/lib/use-media-query.mjs +16 -1
- package/dist/lib/use-media-query.mjs.map +1 -1
- package/dist/liquid-metal.js +1 -0
- package/dist/liquid-metal.mjs +40 -2
- package/dist/liquid-metal.mjs.map +1 -1
- package/dist/navigation-menu-icons.js +1 -1
- package/dist/navigation-menu-icons.js.map +1 -1
- package/dist/navigation-menu-icons.mjs +36 -1
- package/dist/navigation-menu-icons.mjs.map +1 -1
- package/dist/navigation-menu-styles.js +1 -1
- package/dist/navigation-menu-styles.js.map +1 -1
- package/dist/navigation-menu-styles.mjs +11 -1
- package/dist/navigation-menu-styles.mjs.map +1 -1
- package/dist/navigation-menu.js +1 -2
- package/dist/navigation-menu.js.map +1 -1
- package/dist/navigation-menu.mjs +350 -5
- package/dist/navigation-menu.mjs.map +1 -1
- package/dist/password-input.js +1 -0
- package/dist/password-input.mjs +171 -3
- package/dist/password-input.mjs.map +1 -1
- package/dist/rainbow-button.js +1 -0
- package/dist/rainbow-button.mjs +45 -2
- package/dist/rainbow-button.mjs.map +1 -1
- package/dist/range-slider.js +1 -0
- package/dist/range-slider.mjs +82 -1
- package/dist/range-slider.mjs.map +1 -1
- package/dist/rolling-badge.js +1 -0
- package/dist/rolling-badge.mjs +68 -2
- package/dist/rolling-badge.mjs.map +1 -1
- package/dist/savings-badge.js +1 -1
- package/dist/savings-badge.js.map +1 -1
- package/dist/savings-badge.mjs +22 -2
- package/dist/savings-badge.mjs.map +1 -1
- package/dist/shine-border.js +1 -0
- package/dist/shine-border.mjs +44 -2
- package/dist/shine-border.mjs.map +1 -1
- package/dist/sparkles-text.js +1 -0
- package/dist/sparkles-text.mjs +84 -3
- package/dist/sparkles-text.mjs.map +1 -1
- package/dist/tabs.js +1 -0
- package/dist/tabs.mjs +118 -2
- package/dist/tabs.mjs.map +1 -1
- package/dist/theme-toggle.js +1 -0
- package/dist/theme-toggle.mjs +248 -5
- package/dist/theme-toggle.mjs.map +1 -1
- package/package.json +12 -2
- package/dist/chunk-3SB6HUBA.mjs +0 -31
- package/dist/chunk-3SB6HUBA.mjs.map +0 -1
- package/dist/chunk-4PBVBXGY.mjs +0 -84
- package/dist/chunk-4PBVBXGY.mjs.map +0 -1
- package/dist/chunk-4VCFWVSJ.mjs +0 -42
- package/dist/chunk-4VCFWVSJ.mjs.map +0 -1
- package/dist/chunk-5QQAPGR2.mjs +0 -109
- package/dist/chunk-5QQAPGR2.mjs.map +0 -1
- package/dist/chunk-6MB4UKRX.mjs +0 -19
- package/dist/chunk-6MB4UKRX.mjs.map +0 -1
- package/dist/chunk-6T5LR34O.mjs +0 -45
- package/dist/chunk-6T5LR34O.mjs.map +0 -1
- package/dist/chunk-AYLCYDUM.mjs +0 -275
- package/dist/chunk-AYLCYDUM.mjs.map +0 -1
- package/dist/chunk-AYY7D2RJ.mjs +0 -112
- package/dist/chunk-AYY7D2RJ.mjs.map +0 -1
- package/dist/chunk-CTZEI2YS.mjs +0 -324
- package/dist/chunk-CTZEI2YS.mjs.map +0 -1
- package/dist/chunk-DA3I3Y5O.mjs +0 -71
- package/dist/chunk-DA3I3Y5O.mjs.map +0 -1
- package/dist/chunk-EYHT2EWJ.mjs +0 -18
- package/dist/chunk-EYHT2EWJ.mjs.map +0 -1
- package/dist/chunk-IHLGCS63.mjs +0 -36
- package/dist/chunk-IHLGCS63.mjs.map +0 -1
- package/dist/chunk-JVXJ6SFX.mjs +0 -38
- package/dist/chunk-JVXJ6SFX.mjs.map +0 -1
- package/dist/chunk-KBHYXLRG.mjs +0 -13
- package/dist/chunk-KBHYXLRG.mjs.map +0 -1
- package/dist/chunk-KMXUQYR3.mjs +0 -74
- package/dist/chunk-KMXUQYR3.mjs.map +0 -1
- package/dist/chunk-KNPOZ34H.mjs +0 -88
- package/dist/chunk-KNPOZ34H.mjs.map +0 -1
- package/dist/chunk-KRNWCJ4D.mjs +0 -219
- package/dist/chunk-KRNWCJ4D.mjs.map +0 -1
- package/dist/chunk-M5MESV26.mjs +0 -124
- package/dist/chunk-M5MESV26.mjs.map +0 -1
- package/dist/chunk-MJYBPJBA.mjs +0 -115
- package/dist/chunk-MJYBPJBA.mjs.map +0 -1
- package/dist/chunk-NNHPQ67J.mjs +0 -10
- package/dist/chunk-NNHPQ67J.mjs.map +0 -1
- package/dist/chunk-OCZFHVVD.mjs +0 -71
- package/dist/chunk-OCZFHVVD.mjs.map +0 -1
- package/dist/chunk-QAWSH567.mjs +0 -19
- package/dist/chunk-QAWSH567.mjs.map +0 -1
- package/dist/chunk-R2E2J42H.mjs +0 -38
- package/dist/chunk-R2E2J42H.mjs.map +0 -1
- package/dist/chunk-TPGLLSYV.mjs +0 -65
- package/dist/chunk-TPGLLSYV.mjs.map +0 -1
- package/dist/chunk-VJENJHXJ.mjs +0 -72
- package/dist/chunk-VJENJHXJ.mjs.map +0 -1
- package/dist/chunk-W22G7XHR.mjs +0 -104
- package/dist/chunk-W22G7XHR.mjs.map +0 -1
- package/dist/chunk-WDR5VPZJ.mjs +0 -79
- package/dist/chunk-WDR5VPZJ.mjs.map +0 -1
- package/dist/chunk-WLUGKBH7.mjs +0 -37
- package/dist/chunk-WLUGKBH7.mjs.map +0 -1
- package/dist/chunk-WYJYLDUA.mjs +0 -84
- package/dist/chunk-WYJYLDUA.mjs.map +0 -1
- package/dist/chunk-XZEDZVXT.mjs +0 -38
- package/dist/chunk-XZEDZVXT.mjs.map +0 -1
- package/dist/chunk-YKGP5JIL.mjs +0 -328
- package/dist/chunk-YKGP5JIL.mjs.map +0 -1
- package/dist/chunk-YM3U2OBE.mjs +0 -99
- package/dist/chunk-YM3U2OBE.mjs.map +0 -1
package/dist/chunk-3SB6HUBA.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-QAWSH567.mjs';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
function FeatureCard({ icon, title, body, iconColor, className }) {
|
|
5
|
-
return /* @__PURE__ */ jsxs(
|
|
6
|
-
"div",
|
|
7
|
-
{
|
|
8
|
-
className: cn(
|
|
9
|
-
"flex w-full flex-col justify-between gap-6 rounded-[20px] bg-(--muted) p-6 lg:gap-8 lg:rounded-3xl lg:p-8 xl:gap-10 xl:p-10",
|
|
10
|
-
className
|
|
11
|
-
),
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ jsx("div", { className: "flex size-10 items-center justify-center rounded-[10px] bg-(--surface) shadow-(--shadow-sm) lg:size-12 lg:rounded-md", children: /* @__PURE__ */ jsx(
|
|
14
|
-
"span",
|
|
15
|
-
{
|
|
16
|
-
className: cn("flex h-5 w-5 items-center justify-center lg:h-6 lg:w-6", iconColor ?? "text-(--foreground-secondary)"),
|
|
17
|
-
children: icon
|
|
18
|
-
}
|
|
19
|
-
) }),
|
|
20
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
21
|
-
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-[15px] text-foreground lg:text-base", children: title }),
|
|
22
|
-
/* @__PURE__ */ jsx("p", { className: "text-(--foreground-secondary) text-[13px] leading-relaxed lg:text-sm", children: body })
|
|
23
|
-
] })
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { FeatureCard };
|
|
30
|
-
//# sourceMappingURL=chunk-3SB6HUBA.mjs.map
|
|
31
|
-
//# sourceMappingURL=chunk-3SB6HUBA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/feature-card.tsx"],"names":[],"mappings":";;;AAwBO,SAAS,YAAY,EAAE,IAAA,EAAM,OAAO,IAAA,EAAM,SAAA,EAAW,WAAU,EAAqB;AACzF,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA;AAAA,QACT,6HAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,sHAAA,EACb,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAW,EAAA,CAAG,wDAAA,EAA0D,SAAA,IAAa,+BAA+B,CAAA;AAAA,YAEnH,QAAA,EAAA;AAAA;AAAA,SACH,EACF,CAAA;AAAA,wBACA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,qBAAA,EACb,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,wDAAA,EAA0D,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,0BAC9E,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,sEAAA,EAAwE,QAAA,EAAA,IAAA,EAAK;AAAA,SAAA,EAC5F;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-3SB6HUBA.mjs","sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from '../lib/utils.js';\n\nexport type FeatureCardProps = {\n /** Icon rendered in the elevated top-left box. Pass any ReactNode (e.g. an\n * inlined SVG or an iconify <Icon icon={...} />). */\n icon: ReactNode;\n title: string;\n body: string;\n /** Icon colour class, e.g. `text-violet-500`. Defaults to the secondary foreground tone. */\n iconColor?: string;\n /** Extra classes merged onto the card root. */\n className?: string;\n};\n\n/**\n * Shared marketing feature card: a soft-filled panel with an elevated icon box\n * above a title + body. Used across the /security, /syncing, /web-access pages\n * and future copy pages.\n *\n * Geometry mirrors the design-system reference (p-6 → lg:p-8 → xl:p-10, icon box\n * size-10 → lg:size-12); the design tokens are mapped onto this library's own\n * variables so both themes stay in sync.\n */\nexport function FeatureCard({ icon, title, body, iconColor, className }: FeatureCardProps) {\n return (\n <div\n className={cn(\n 'flex w-full flex-col justify-between gap-6 rounded-[20px] bg-(--muted) p-6 lg:gap-8 lg:rounded-3xl lg:p-8 xl:gap-10 xl:p-10',\n className,\n )}\n >\n <div className=\"flex size-10 items-center justify-center rounded-[10px] bg-(--surface) shadow-(--shadow-sm) lg:size-12 lg:rounded-md\">\n <span\n className={cn('flex h-5 w-5 items-center justify-center lg:h-6 lg:w-6', iconColor ?? 'text-(--foreground-secondary)')}\n >\n {icon}\n </span>\n </div>\n <div className=\"flex flex-col gap-2\">\n <h3 className=\"font-semibold text-[15px] text-foreground lg:text-base\">{title}</h3>\n <p className=\"text-(--foreground-secondary) text-[13px] leading-relaxed lg:text-sm\">{body}</p>\n </div>\n </div>\n );\n}\n"]}
|
package/dist/chunk-4PBVBXGY.mjs
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
// src/components/range-slider.tsx
|
|
5
|
-
function nearestIndex(steps, value) {
|
|
6
|
-
return steps.reduce((best, s, i) => Math.abs(s - value) < Math.abs(steps[best] - value) ? i : best, 0);
|
|
7
|
-
}
|
|
8
|
-
function RangeSlider({ label, value, steps, ticks, valueLabel, onChange }) {
|
|
9
|
-
const min = steps[0];
|
|
10
|
-
const max = steps.at(-1) ?? min;
|
|
11
|
-
const pct = (value - min) / (max - min) * 100;
|
|
12
|
-
const index = nearestIndex(steps, value);
|
|
13
|
-
const handleChange = useCallback(
|
|
14
|
-
(event_) => onChange(steps[Number(event_.target.value)]),
|
|
15
|
-
[onChange, steps]
|
|
16
|
-
);
|
|
17
|
-
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
18
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-5 flex items-baseline justify-between gap-2", children: [
|
|
19
|
-
/* @__PURE__ */ jsx("p", { className: "font-semibold text-[15px] text-(--color-foreground)", children: label }),
|
|
20
|
-
/* @__PURE__ */ jsx("p", { className: "font-bold font-numeric text-[20px] text-(--color-foreground) tabular-nums", children: valueLabel })
|
|
21
|
-
] }),
|
|
22
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", style: { height: 20 }, children: [
|
|
23
|
-
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-(--color-border)" }),
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
className: "pointer-events-none absolute top-1/2 left-0 h-1.5 -translate-y-1/2 rounded-full bg-(--color-foreground)",
|
|
28
|
-
style: { width: `${pct}%` }
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
"input",
|
|
33
|
-
{
|
|
34
|
-
type: "range",
|
|
35
|
-
min: 0,
|
|
36
|
-
max: steps.length - 1,
|
|
37
|
-
step: 1,
|
|
38
|
-
value: index,
|
|
39
|
-
onChange: handleChange,
|
|
40
|
-
className: "peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0",
|
|
41
|
-
"aria-label": label,
|
|
42
|
-
"aria-valuetext": valueLabel
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
className: "pointer-events-none absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-(--color-foreground) peer-focus-visible:outline-2 peer-focus-visible:outline-(--color-foreground) peer-focus-visible:outline-offset-2",
|
|
49
|
-
style: {
|
|
50
|
-
left: `${pct}%`,
|
|
51
|
-
width: 16,
|
|
52
|
-
height: 16,
|
|
53
|
-
boxShadow: "0 2px 8px rgba(0,0,0,0.15)"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ jsx("div", { className: "relative mt-2", style: { height: 16 }, children: ticks.map((tick, i) => {
|
|
59
|
-
const tp = (tick.value - min) / (max - min) * 100;
|
|
60
|
-
const isFirst = i === 0;
|
|
61
|
-
const isLast = i === ticks.length - 1;
|
|
62
|
-
let left = `${tp}%`;
|
|
63
|
-
if (isFirst) left = 0;
|
|
64
|
-
else if (isLast) left = void 0;
|
|
65
|
-
return /* @__PURE__ */ jsx(
|
|
66
|
-
"span",
|
|
67
|
-
{
|
|
68
|
-
className: "absolute font-numeric text-(--color-muted-foreground) text-[11px] tabular-nums",
|
|
69
|
-
style: {
|
|
70
|
-
left,
|
|
71
|
-
right: isLast ? 0 : void 0,
|
|
72
|
-
transform: isFirst || isLast ? void 0 : "translateX(-50%)"
|
|
73
|
-
},
|
|
74
|
-
children: tick.label
|
|
75
|
-
},
|
|
76
|
-
tick.value
|
|
77
|
-
);
|
|
78
|
-
}) })
|
|
79
|
-
] });
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { RangeSlider };
|
|
83
|
-
//# sourceMappingURL=chunk-4PBVBXG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CAAM,GAAA,CAAI,CAAC,MAAM,CAAA,KAAM;AACtB,MAAA,MAAM,EAAA,GAAA,CAAO,IAAA,CAAK,KAAA,GAAQ,GAAA,KAAQ,MAAM,GAAA,CAAA,GAAQ,GAAA;AAChD,MAAA,MAAM,UAAU,CAAA,KAAM,CAAA;AACtB,MAAA,MAAM,MAAA,GAAS,CAAA,KAAM,KAAA,CAAM,MAAA,GAAS,CAAA;AACpC,MAAA,IAAI,IAAA,GAAoC,GAAG,EAAE,CAAA,CAAA,CAAA;AAC7C,MAAA,IAAI,SAAS,IAAA,GAAO,CAAA;AAAA,WAAA,IACX,QAAQ,IAAA,GAAO,MAAA;AACxB,MAAA,uBACE,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UAEC,SAAA,EAAU,gFAAA;AAAA,UACV,KAAA,EAAO;AAAA,YACL,IAAA;AAAA,YACA,KAAA,EAAO,SAAS,CAAA,GAAI,MAAA;AAAA,YACpB,SAAA,EAAW,OAAA,IAAW,MAAA,GAAS,MAAA,GAAY;AAAA,WAC7C;AAAA,UAEC,QAAA,EAAA,IAAA,CAAK;AAAA,SAAA;AAAA,QARD,IAAA,CAAK;AAAA,OASZ;AAAA,IAEJ,CAAC,CAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ","file":"chunk-4PBVBXGY.mjs","sourcesContent":["'use client';\n\nimport type { ChangeEvent } from 'react';\nimport { useCallback } from 'react';\n\nexport type Tick = { value: number; label: string };\n\nexport type RangeSliderProps = {\n label: string;\n value: number;\n /** Allowed values, ascending. The first and last double as the bounds. */\n steps: number[];\n ticks: Tick[];\n valueLabel: string;\n onChange: (v: number) => void;\n};\n\n/** Index of the grid step nearest `value`, so an off-grid value still resolves. */\nfunction nearestIndex(steps: number[], value: number) {\n return steps.reduce((best, s, i) => (Math.abs(s - value) < Math.abs(steps[best]! - value) ? i : best), 0);\n}\n\n/**\n * Slider over an explicit list of allowed values rather than a uniform `step`,\n * so a grid whose span isn't a whole multiple of its increment can still reach\n * its stated ceiling.\n */\nexport function RangeSlider({ label, value, steps, ticks, valueLabel, onChange }: RangeSliderProps) {\n const min = steps[0]!;\n const max = steps.at(-1) ?? min;\n const pct = ((value - min) / (max - min)) * 100;\n const index = nearestIndex(steps, value);\n\n const handleChange = useCallback(\n (event_: ChangeEvent<HTMLInputElement>) => onChange(steps[Number(event_.target.value)]!),\n [onChange, steps],\n );\n\n return (\n <div className=\"w-full\">\n <div className=\"mb-5 flex items-baseline justify-between gap-2\">\n <p className=\"font-semibold text-[15px] text-(--color-foreground)\">{label}</p>\n <p className=\"font-bold font-numeric text-[20px] text-(--color-foreground) tabular-nums\">{valueLabel}</p>\n </div>\n\n <div className=\"relative\" style={{ height: 20 }}>\n <div className=\"absolute inset-x-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-(--color-border)\" />\n <div\n className=\"pointer-events-none absolute top-1/2 left-0 h-1.5 -translate-y-1/2 rounded-full bg-(--color-foreground)\"\n style={{ width: `${pct}%` }}\n />\n <input\n type=\"range\"\n min={0}\n max={steps.length - 1}\n step={1}\n value={index}\n onChange={handleChange}\n className=\"peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0\"\n aria-label={label}\n aria-valuetext={valueLabel}\n />\n <div\n className=\"pointer-events-none absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-(--color-foreground) peer-focus-visible:outline-2 peer-focus-visible:outline-(--color-foreground) peer-focus-visible:outline-offset-2\"\n style={{\n left: `${pct}%`,\n width: 16,\n height: 16,\n boxShadow: '0 2px 8px rgba(0,0,0,0.15)',\n }}\n />\n </div>\n\n <div className=\"relative mt-2\" style={{ height: 16 }}>\n {ticks.map((tick, i) => {\n const tp = ((tick.value - min) / (max - min)) * 100;\n const isFirst = i === 0;\n const isLast = i === ticks.length - 1;\n let left: number | string | undefined = `${tp}%`;\n if (isFirst) left = 0;\n else if (isLast) left = undefined;\n return (\n <span\n key={tick.value}\n className=\"absolute font-numeric text-(--color-muted-foreground) text-[11px] tabular-nums\"\n style={{\n left,\n right: isLast ? 0 : undefined,\n transform: isFirst || isLast ? undefined : 'translateX(-50%)',\n }}\n >\n {tick.label}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n"]}
|
package/dist/chunk-4VCFWVSJ.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-QAWSH567.mjs';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { cva } from 'class-variance-authority';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var rainbowButtonVariants = cva(
|
|
7
|
-
cn(
|
|
8
|
-
"relative cursor-pointer group transition-transform animate-rainbow",
|
|
9
|
-
"inline-flex items-center justify-center gap-2 shrink-0",
|
|
10
|
-
"rounded-sm outline-none focus-visible:ring-[3px] aria-invalid:border-destructive",
|
|
11
|
-
"text-sm font-medium whitespace-nowrap",
|
|
12
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
13
|
-
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"
|
|
14
|
-
),
|
|
15
|
-
{
|
|
16
|
-
variants: {
|
|
17
|
-
variant: {
|
|
18
|
-
default: "border-0 bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] bg-[length:200%] text-primary-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))]",
|
|
19
|
-
outline: "border border-input border-b-transparent bg-[linear-gradient(#ffffff,#ffffff),linear-gradient(#ffffff_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] bg-[length:200%] text-accent-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#0a0a0a,#0a0a0a),linear-gradient(#0a0a0a_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))]"
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
default: "h-9 px-4 py-2",
|
|
23
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
24
|
-
lg: "h-11 rounded-md px-8",
|
|
25
|
-
icon: "size-9"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
variant: "default",
|
|
30
|
-
size: "default"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
function RainbowButton({ className, variant, size, asChild = false, ref, ...props }) {
|
|
35
|
-
const Comp = asChild ? Slot : "button";
|
|
36
|
-
return /* @__PURE__ */ jsx(Comp, { "data-slot": "button", className: cn(rainbowButtonVariants({ variant, size, className })), ref, ...props });
|
|
37
|
-
}
|
|
38
|
-
RainbowButton.displayName = "RainbowButton";
|
|
39
|
-
|
|
40
|
-
export { RainbowButton, rainbowButtonVariants };
|
|
41
|
-
//# sourceMappingURL=chunk-4VCFWVSJ.mjs.map
|
|
42
|
-
//# sourceMappingURL=chunk-4VCFWVSJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/rainbow-button.tsx"],"names":[],"mappings":";;;;;AAOA,IAAM,qBAAA,GAAwB,GAAA;AAAA,EAC5B,EAAA;AAAA,IACE,oEAAA;AAAA,IACA,wDAAA;AAAA,IACA,kFAAA;AAAA,IACA,uCAAA;AAAA,IACA,kDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EACE,2+BAAA;AAAA,QACF,OAAA,EACE;AAAA,OACJ;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,eAAA;AAAA,QACT,EAAA,EAAI,6BAAA;AAAA,QACJ,EAAA,EAAI,sBAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAOO,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,OAAA,EAAS,IAAA,EAAM,UAAU,KAAA,EAAO,GAAA,EAAK,GAAG,KAAA,EAAM,EAAuB;AAC9G,EAAA,MAAM,IAAA,GAAO,UAAU,IAAA,GAAO,QAAA;AAC9B,EAAA,2BAAQ,IAAA,EAAA,EAAK,WAAA,EAAU,QAAA,EAAS,SAAA,EAAW,GAAG,qBAAA,CAAsB,EAAE,OAAA,EAAS,IAAA,EAAM,WAAW,CAAC,CAAA,EAAG,GAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AAC3H;AAEA,aAAA,CAAc,WAAA,GAAc,eAAA","file":"chunk-4VCFWVSJ.mjs","sourcesContent":["'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ButtonHTMLAttributes, RefObject } from 'react';\nimport { cn } from '../lib/utils.js';\n\nconst rainbowButtonVariants = cva(\n cn(\n 'relative cursor-pointer group transition-transform animate-rainbow',\n 'inline-flex items-center justify-center gap-2 shrink-0',\n 'rounded-sm outline-none focus-visible:ring-[3px] aria-invalid:border-destructive',\n 'text-sm font-medium whitespace-nowrap',\n 'disabled:pointer-events-none disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0\",\n ),\n {\n variants: {\n variant: {\n default:\n 'border-0 bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] bg-[length:200%] text-primary-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))]',\n outline:\n 'border border-input border-b-transparent bg-[linear-gradient(#ffffff,#ffffff),linear-gradient(#ffffff_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] bg-[length:200%] text-accent-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#0a0a0a,#0a0a0a),linear-gradient(#0a0a0a_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-rainbow-1),var(--color-rainbow-5),var(--color-rainbow-3),var(--color-rainbow-4),var(--color-rainbow-2))]',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-11 rounded-md px-8',\n icon: 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport interface RainbowButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof rainbowButtonVariants> {\n asChild?: boolean;\n ref?: RefObject<HTMLButtonElement | null>;\n}\n\nexport function RainbowButton({ className, variant, size, asChild = false, ref, ...props }: RainbowButtonProps) {\n const Comp = asChild ? Slot : 'button';\n return <Comp data-slot=\"button\" className={cn(rainbowButtonVariants({ variant, size, className }))} ref={ref} {...props} />;\n}\n\nRainbowButton.displayName = 'RainbowButton';\n\nexport { rainbowButtonVariants };\n"]}
|
package/dist/chunk-5QQAPGR2.mjs
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { useMediaQuery } from './chunk-EYHT2EWJ.mjs';
|
|
2
|
-
import { cn } from './chunk-QAWSH567.mjs';
|
|
3
|
-
import { useInView } from 'framer-motion';
|
|
4
|
-
import { useRef, useState, useLayoutEffect } from 'react';
|
|
5
|
-
import { annotate } from 'rough-notation';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function resolveColor(element, color) {
|
|
9
|
-
if (!color.startsWith("var(")) return color;
|
|
10
|
-
const token = color.slice(4, -1).trim();
|
|
11
|
-
return globalThis.getComputedStyle(element).getPropertyValue(token).trim() || color;
|
|
12
|
-
}
|
|
13
|
-
var BREAKPOINTS = [
|
|
14
|
-
["xs", 30],
|
|
15
|
-
["sm", 40],
|
|
16
|
-
["md", 50],
|
|
17
|
-
["lg", 64],
|
|
18
|
-
["xl", 80],
|
|
19
|
-
["2xl", 96]
|
|
20
|
-
];
|
|
21
|
-
function getBreakpoint() {
|
|
22
|
-
let current = "base";
|
|
23
|
-
for (const [name, rem] of BREAKPOINTS) {
|
|
24
|
-
if (globalThis.matchMedia(`(min-width: ${rem}rem)`).matches) current = name;
|
|
25
|
-
}
|
|
26
|
-
return current;
|
|
27
|
-
}
|
|
28
|
-
function onBreakpointChange(listener) {
|
|
29
|
-
const queries = BREAKPOINTS.map(([, rem]) => globalThis.matchMedia(`(min-width: ${rem}rem)`));
|
|
30
|
-
for (const query of queries) query.addEventListener("change", listener);
|
|
31
|
-
return () => {
|
|
32
|
-
for (const query of queries) query.removeEventListener("change", listener);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function Highlighter({
|
|
36
|
-
children,
|
|
37
|
-
className,
|
|
38
|
-
action = "highlight",
|
|
39
|
-
color = "var(--marker-highlight)",
|
|
40
|
-
strokeWidth = 1.5,
|
|
41
|
-
animationDuration = 600,
|
|
42
|
-
delay = 0,
|
|
43
|
-
iterations = 2,
|
|
44
|
-
padding = 2,
|
|
45
|
-
multiline = true,
|
|
46
|
-
isView = false
|
|
47
|
-
}) {
|
|
48
|
-
const elementRef = useRef(null);
|
|
49
|
-
const isInView = useInView(elementRef, { once: true, margin: "-10%" });
|
|
50
|
-
const reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
51
|
-
const [themeVersion, setThemeVersion] = useState(0);
|
|
52
|
-
const shouldShow = !isView || isInView;
|
|
53
|
-
useLayoutEffect(() => {
|
|
54
|
-
const observer = new MutationObserver(() => setThemeVersion((v) => v + 1));
|
|
55
|
-
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
|
|
56
|
-
return () => observer.disconnect();
|
|
57
|
-
}, []);
|
|
58
|
-
useLayoutEffect(() => {
|
|
59
|
-
const element = elementRef.current;
|
|
60
|
-
if (!(shouldShow && element)) return;
|
|
61
|
-
let annotation;
|
|
62
|
-
let untrack;
|
|
63
|
-
const draw = () => {
|
|
64
|
-
annotation = annotate(element, {
|
|
65
|
-
type: action,
|
|
66
|
-
color: resolveColor(element, color),
|
|
67
|
-
strokeWidth,
|
|
68
|
-
animationDuration,
|
|
69
|
-
animate: !reducedMotion,
|
|
70
|
-
iterations,
|
|
71
|
-
padding,
|
|
72
|
-
multiline
|
|
73
|
-
});
|
|
74
|
-
annotation.show();
|
|
75
|
-
let drawnAt = getBreakpoint();
|
|
76
|
-
untrack = onBreakpointChange(() => {
|
|
77
|
-
const current = getBreakpoint();
|
|
78
|
-
if (current === drawnAt) return;
|
|
79
|
-
drawnAt = current;
|
|
80
|
-
annotation?.show();
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
const startDelay = reducedMotion ? 0 : delay;
|
|
84
|
-
const timer = startDelay > 0 ? globalThis.setTimeout(draw, startDelay) : void 0;
|
|
85
|
-
if (timer === void 0) draw();
|
|
86
|
-
return () => {
|
|
87
|
-
globalThis.clearTimeout(timer);
|
|
88
|
-
untrack?.();
|
|
89
|
-
annotation?.remove();
|
|
90
|
-
};
|
|
91
|
-
}, [
|
|
92
|
-
shouldShow,
|
|
93
|
-
action,
|
|
94
|
-
color,
|
|
95
|
-
strokeWidth,
|
|
96
|
-
animationDuration,
|
|
97
|
-
delay,
|
|
98
|
-
iterations,
|
|
99
|
-
padding,
|
|
100
|
-
multiline,
|
|
101
|
-
reducedMotion,
|
|
102
|
-
themeVersion
|
|
103
|
-
]);
|
|
104
|
-
return /* @__PURE__ */ jsx("span", { className: cn("relative inline-block bg-transparent", className), children: /* @__PURE__ */ jsx("span", { ref: elementRef, children }) });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { Highlighter };
|
|
108
|
-
//# sourceMappingURL=chunk-5QQAPGR2.mjs.map
|
|
109
|
-
//# sourceMappingURL=chunk-5QQAPGR2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/highlighter.tsx"],"names":[],"mappings":";;;;;;;AAgBA,SAAS,YAAA,CAAa,SAAkB,KAAA,EAAuB;AAC7D,EAAA,IAAI,CAAC,KAAA,CAAM,UAAA,CAAW,MAAM,GAAG,OAAO,KAAA;AACtC,EAAA,MAAM,QAAQ,KAAA,CAAM,KAAA,CAAM,CAAA,EAAG,EAAE,EAAE,IAAA,EAAK;AACtC,EAAA,OAAO,UAAA,CAAW,iBAAiB,OAAO,CAAA,CAAE,iBAAiB,KAAK,CAAA,CAAE,MAAK,IAAK,KAAA;AAChF;AAOA,IAAM,WAAA,GAAc;AAAA,EAClB,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,MAAM,EAAE,CAAA;AAAA,EACT,CAAC,OAAO,EAAE;AACZ,CAAA;AAKA,SAAS,aAAA,GAA4B;AACnC,EAAA,IAAI,OAAA,GAAsB,MAAA;AAC1B,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,GAAG,CAAA,IAAK,WAAA,EAAa;AACrC,IAAA,IAAI,WAAW,UAAA,CAAW,CAAA,YAAA,EAAe,GAAG,CAAA,IAAA,CAAM,CAAA,CAAE,SAAS,OAAA,GAAU,IAAA;AAAA,EACzE;AACA,EAAA,OAAO,OAAA;AACT;AAYA,SAAS,mBAAmB,Q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OAAA,IAAU;AACV,MAAA,UAAA,EAAY,MAAA,EAAO;AAAA,IACrB,CAAA;AAAA,EACF,CAAA,EAAG;AAAA,IACD,UAAA;AAAA,IACA,MAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACD,CAAA;AAgBD,EAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,EAAA,CAAG,sCAAA,EAAwC,SAAS,CAAA,EACnE,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,GAAA,EAAK,UAAA,EAAa,QAAA,EAAS,CAAA,EACnC,CAAA;AAEJ","file":"chunk-5QQAPGR2.mjs","sourcesContent":["'use client';\n\nimport { useInView } from 'framer-motion';\nimport { type ReactNode, useLayoutEffect, useRef, useState } from 'react';\nimport { annotate } from 'rough-notation';\nimport type { RoughAnnotation } from 'rough-notation/lib/model';\nimport { useMediaQuery } from '../lib/use-media-query.js';\nimport { cn } from '../lib/utils.js';\n\ntype AnnotationAction = 'highlight' | 'underline' | 'box' | 'circle' | 'strike-through' | 'crossed-off' | 'bracket';\n\n/**\n * rough-notation writes the colour straight into the SVG's `stroke` presentation\n * attribute, where `var()` is never substituted — so a design token has to be\n * resolved against the live element before it is handed over.\n */\nfunction resolveColor(element: Element, color: string): string {\n if (!color.startsWith('var(')) return color;\n const token = color.slice(4, -1).trim();\n return globalThis.getComputedStyle(element).getPropertyValue(token).trim() || color;\n}\n\n/**\n * The site's breakpoints, ascending, in the `rem` units Tailwind emits them in —\n * so they keep tracking the root font size the way the CSS does. Mirrored from\n * the library's `@theme` block (`xs` and `md` are custom, the rest are defaults).\n */\nconst BREAKPOINTS = [\n ['xs', 30],\n ['sm', 40],\n ['md', 50],\n ['lg', 64],\n ['xl', 80],\n ['2xl', 96],\n] as const;\n\ntype Breakpoint = 'base' | (typeof BREAKPOINTS)[number][0];\n\n/** `'base'` is the implicit below-`xs` band — the widths no `min-width` query claims. */\nfunction getBreakpoint(): Breakpoint {\n let current: Breakpoint = 'base';\n for (const [name, rem] of BREAKPOINTS) {\n if (globalThis.matchMedia(`(min-width: ${rem}rem)`).matches) current = name;\n }\n return current;\n}\n\n/**\n * Call `listener` whenever the viewport crosses a breakpoint. Returns the\n * unsubscribe.\n *\n * The imperative counterpart to a `useBreakpoint` hook, for work that has to land\n * in the *same frame* as the layout change. Media-query change events fire during\n * the rendering steps, before `requestAnimationFrame` and before paint, so a\n * listener that writes to the DOM here is painted with the new layout rather than\n * one frame behind it.\n */\nfunction onBreakpointChange(listener: () => void): () => void {\n const queries = BREAKPOINTS.map(([, rem]) => globalThis.matchMedia(`(min-width: ${rem}rem)`));\n for (const query of queries) query.addEventListener('change', listener);\n return () => {\n for (const query of queries) query.removeEventListener('change', listener);\n };\n}\n\ntype HighlighterProps = {\n /** The words to annotate. Rendered inline, so they inherit the surrounding type. */\n children: ReactNode;\n className?: string;\n /**\n * Which marker stroke to draw.\n * @default 'highlight'\n */\n action?: AnnotationAction;\n /**\n * Stroke colour. Accepts a `var(--token)` string, which is resolved against\n * the live element and re-resolved whenever the theme flips.\n * @default 'var(--marker-highlight)'\n */\n color?: string;\n /** @default 1.5 */\n strokeWidth?: number;\n /** Milliseconds the stroke takes to draw itself on. @default 600 */\n animationDuration?: number;\n /**\n * Milliseconds to hold the stroke back before it starts drawing. Ignored under\n * reduced motion, where there is no draw-on to stagger.\n * @default 0\n */\n delay?: number;\n /** Passes over the same stroke, which is what makes it read as hand-drawn. @default 2 */\n iterations?: number;\n /** Pixels of slack between the text box and the stroke. @default 2 */\n padding?: number;\n /** Annotate every line the text wraps onto, rather than one box around all of them. @default true */\n multiline?: boolean;\n /** Hold the stroke back until the text scrolls into view. @default false */\n isView?: boolean;\n};\n\n/**\n * Draws a hand-drawn marker stroke over a word or phrase.\n *\n * The stroke is an SVG that rough-notation injects on the client, so the\n * exported HTML ships the bare text and nothing about the layout depends on JS\n * having run. Readers who ask for reduced motion get the stroke without the\n * draw-on animation.\n */\nexport function Highlighter({\n children,\n className,\n action = 'highlight',\n color = 'var(--marker-highlight)',\n strokeWidth = 1.5,\n animationDuration = 600,\n delay = 0,\n iterations = 2,\n padding = 2,\n multiline = true,\n isView = false,\n}: HighlighterProps) {\n const elementRef = useRef<HTMLSpanElement>(null);\n const isInView = useInView(elementRef, { once: true, margin: '-10%' });\n const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n // Only a re-run trigger: the colour itself comes from the computed style, which\n // is already correct on first paint because the theme class is set before\n // hydration. The observer below bumps this whenever the class attribute flips.\n const [themeVersion, setThemeVersion] = useState(0);\n\n const shouldShow = !isView || isInView;\n\n // Theme flips land as a class swap on <html> (the `.dark` class toggled by the\n // theme provider), and rough-notation bakes the *resolved* token into the\n // SVG's stroke attribute — which does not track var(). Re-running the draw\n // effect with a freshly resolved colour is what repaints the stroke.\n useLayoutEffect(() => {\n const observer = new MutationObserver(() => setThemeVersion((v) => v + 1));\n observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });\n return () => observer.disconnect();\n }, []);\n\n // Imperatively injects and tears down a rough-notation SVG measured off live\n // DOM layout — a post-render side effect with no render-time equivalent.\n // biome-ignore lint/correctness/useExhaustiveDependencies: `themeVersion` is a redraw trigger, not a read value — the token resolves to a different colour per theme, so a flip has to repaint the stroke.\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!(shouldShow && element)) return;\n\n let annotation: RoughAnnotation | undefined;\n let untrack: (() => void) | undefined;\n\n const draw = () => {\n annotation = annotate(element, {\n type: action,\n color: resolveColor(element, color),\n strokeWidth,\n animationDuration,\n animate: !reducedMotion,\n iterations,\n padding,\n multiline,\n });\n annotation.show();\n\n // The wrapper below already carries the stroke wherever the page moves the\n // text, so the only thing left that can stale it is a change in the text's\n // own shape — which on a breakpoint-driven layout means a breakpoint. This\n // is subscribed directly rather than through a `useBreakpoint` hook because\n // a React state round-trip commits a frame or more after the browser has\n // painted the new layout, which is exactly the lag being chased out.\n // `show()` on a still-showing annotation re-renders un-animated, so the\n // stroke resizes without replaying the draw-on.\n let drawnAt = getBreakpoint();\n untrack = onBreakpointChange(() => {\n const current = getBreakpoint();\n if (current === drawnAt) return;\n drawnAt = current;\n annotation?.show();\n });\n };\n\n const startDelay = reducedMotion ? 0 : delay;\n const timer = startDelay > 0 ? globalThis.setTimeout(draw, startDelay) : undefined;\n if (timer === undefined) draw();\n\n return () => {\n globalThis.clearTimeout(timer);\n untrack?.();\n annotation?.remove();\n };\n }, [\n shouldShow,\n action,\n color,\n strokeWidth,\n animationDuration,\n delay,\n iterations,\n padding,\n multiline,\n reducedMotion,\n themeVersion,\n ]);\n\n // Two spans, and both earn their place.\n //\n // rough-notation injects its SVG as a *sibling* of the annotated element, laid\n // out `position: absolute; top: 0; left: 0`, with the stroke's coordinates baked\n // as offsets from wherever that SVG lands. Left alone it resolves against\n // whatever positioned ancestor it happens to find — for a centred, shrink-wrapped\n // page section, effectively the viewport — so every reflow that slid the text\n // sideways slid it out from under its own stroke, and only a redraw put it back.\n // The `relative` wrapper makes the SVG resolve against a box the text sits\n // inside instead, so the two now move as one and no listener is involved.\n //\n // The inner span stays plain `inline`, which is what makes `multiline` work:\n // `getClientRects()` on an inline reports one box per line, so wrapped text gets\n // a stroke per line rather than one slab drawn around the whole paragraph.\n return (\n <span className={cn('relative inline-block bg-transparent', className)}>\n <span ref={elementRef}>{children}</span>\n </span>\n );\n}\n\nexport type { AnnotationAction, HighlighterProps };\n"]}
|
package/dist/chunk-6MB4UKRX.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-QAWSH567.mjs';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
function SavingsBadge({ className, ...props }) {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
-
"span",
|
|
7
|
-
{
|
|
8
|
-
className: cn(
|
|
9
|
-
"rounded-full bg-emerald-500/15 px-2.5 py-0.5 font-numeric font-semibold text-[11px] text-emerald-500 tabular-nums",
|
|
10
|
-
className
|
|
11
|
-
),
|
|
12
|
-
...props
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { SavingsBadge };
|
|
18
|
-
//# sourceMappingURL=chunk-6MB4UKRX.mjs.map
|
|
19
|
-
//# sourceMappingURL=chunk-6MB4UKRX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/savings-badge.tsx"],"names":[],"mappings":";;;AAUO,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAiC;AAClF,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA;AAAA,QACT,mHAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-6MB4UKRX.mjs","sourcesContent":["import type * as React from 'react';\nimport { cn } from '../lib/utils.js';\n\n/**\n * Soft emerald pill for money-saved callouts — the per-provider delta in the\n * estimate chart.\n *\n * The wording differs per call site, so the label stays in `children`; only the\n * pill treatment is shared.\n */\nexport function SavingsBadge({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n className={cn(\n 'rounded-full bg-emerald-500/15 px-2.5 py-0.5 font-numeric font-semibold text-[11px] text-emerald-500 tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n"]}
|
package/dist/chunk-6T5LR34O.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-QAWSH567.mjs';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
function ElevatedInput({
|
|
5
|
-
className,
|
|
6
|
-
type = "text",
|
|
7
|
-
ref,
|
|
8
|
-
...props
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
11
|
-
"input",
|
|
12
|
-
{
|
|
13
|
-
ref,
|
|
14
|
-
type,
|
|
15
|
-
className: cn(
|
|
16
|
-
// Layout & shape
|
|
17
|
-
"relative w-full overflow-hidden rounded-lg",
|
|
18
|
-
// Typography
|
|
19
|
-
"text-(--color-foreground) text-sm placeholder:text-(--color-muted-foreground)",
|
|
20
|
-
// Sizing
|
|
21
|
-
"h-9 px-3",
|
|
22
|
-
// Reset native input chrome
|
|
23
|
-
"appearance-none border-none outline-none",
|
|
24
|
-
// Background — a barely-there top darkening that reads as cavity depth.
|
|
25
|
-
"bg-[linear-gradient(to_bottom,oklch(0_0_0/0.04),transparent)]",
|
|
26
|
-
"dark:bg-[linear-gradient(to_bottom,oklch(1_0_0/0.04),transparent)]",
|
|
27
|
-
// Shadow stack — light mode
|
|
28
|
-
"shadow-[inset_0_1px_0_0_oklch(1_0_0/0.08),inset_0_2px_2px_-1px_oklch(0_0_0/0.08),inset_0_4px_4px_-2px_oklch(0_0_0/0.08),0_1px_0_0_oklch(0_0_0/0.12),inset_0_0_0_1px_oklch(0_0_0/0.16)]",
|
|
29
|
-
// Shadow stack — dark mode
|
|
30
|
-
"dark:shadow-[inset_0_1px_0_0_oklch(1_0_0/0.1),inset_0_2px_2px_-1px_oklch(0_0_0/0.28),inset_0_4px_4px_-2px_oklch(0_0_0/0.22),0_1px_0_0_oklch(0_0_0/0.36),inset_0_0_0_1px_oklch(1_0_0/0.16)]",
|
|
31
|
-
// Focus
|
|
32
|
-
"focus-visible:shadow-[inset_0_1px_0_0_oklch(1_0_0/0.08),inset_0_2px_2px_-1px_oklch(0_0_0/0.04),inset_0_4px_4px_-2px_oklch(0_0_0/0.04),0_0_0_3px_oklch(0_0_0/0.08),inset_0_0_0_1.5px_oklch(0_0_0/0.36)]",
|
|
33
|
-
"dark:focus-visible:shadow-[inset_0_1px_0_0_oklch(1_0_0/0.12),inset_0_2px_2px_-1px_oklch(0_0_0/0.16),inset_0_4px_4px_-2px_oklch(0_0_0/0.12),0_0_0_3px_oklch(1_0_0/0.08),inset_0_0_0_1.5px_oklch(1_0_0/0.28)]",
|
|
34
|
-
"transition-shadow duration-150",
|
|
35
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
36
|
-
className
|
|
37
|
-
),
|
|
38
|
-
...props
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { ElevatedInput };
|
|
44
|
-
//# sourceMappingURL=chunk-6T5LR34O.mjs.map
|
|
45
|
-
//# sourceMappingURL=chunk-6T5LR34O.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/elevated-input.tsx"],"names":[],"mappings":";;;AASO,SAAS,aAAA,CAAc;AAAA,EAC5B,SAAA;AAAA,EACA,IAAA,GAAO,MAAA;AAAA,EACP,GAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA,EAAW,EAAA;AAAA;AAAA,QAET,4CAAA;AAAA;AAAA,QAEA,+EAAA;AAAA;AAAA,QAEA,UAAA;AAAA;AAAA,QAEA,0CAAA;AAAA;AAAA,QAGA,+DAAA;AAAA,QACA,oEAAA;AAAA;AAAA,QAGA,wLAAA;AAAA;AAAA,QAEA,4LAAA;AAAA;AAAA,QAGA,wMAAA;AAAA,QACA,6MAAA;AAAA,QAEA,gCAAA;AAAA,QACA,iDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-6T5LR34O.mjs","sourcesContent":["import type { InputHTMLAttributes, RefObject } from 'react';\nimport { cn } from '../lib/utils.js';\n\n/**\n * Physically-recessed input: the inverse read of GlossyButton.\n * The illusion is built entirely from `box-shadow` layers (no wrapper div).\n *\n * Server-renderable: no browser APIs are used.\n */\nexport function ElevatedInput({\n className,\n type = 'text',\n ref,\n ...props\n}: InputHTMLAttributes<HTMLInputElement> & {\n ref?: RefObject<HTMLInputElement | null>;\n}) {\n return (\n <input\n ref={ref}\n type={type}\n className={cn(\n // Layout & shape\n 'relative w-full overflow-hidden rounded-lg',\n // Typography\n 'text-(--color-foreground) text-sm placeholder:text-(--color-muted-foreground)',\n // Sizing\n 'h-9 px-3',\n // Reset native input chrome\n 'appearance-none border-none outline-none',\n\n // Background — a barely-there top darkening that reads as cavity depth.\n 'bg-[linear-gradient(to_bottom,oklch(0_0_0/0.04),transparent)]',\n 'dark:bg-[linear-gradient(to_bottom,oklch(1_0_0/0.04),transparent)]',\n\n // Shadow stack — light mode\n 'shadow-[inset_0_1px_0_0_oklch(1_0_0/0.08),inset_0_2px_2px_-1px_oklch(0_0_0/0.08),inset_0_4px_4px_-2px_oklch(0_0_0/0.08),0_1px_0_0_oklch(0_0_0/0.12),inset_0_0_0_1px_oklch(0_0_0/0.16)]',\n // Shadow stack — dark mode\n 'dark:shadow-[inset_0_1px_0_0_oklch(1_0_0/0.1),inset_0_2px_2px_-1px_oklch(0_0_0/0.28),inset_0_4px_4px_-2px_oklch(0_0_0/0.22),0_1px_0_0_oklch(0_0_0/0.36),inset_0_0_0_1px_oklch(1_0_0/0.16)]',\n\n // Focus\n 'focus-visible:shadow-[inset_0_1px_0_0_oklch(1_0_0/0.08),inset_0_2px_2px_-1px_oklch(0_0_0/0.04),inset_0_4px_4px_-2px_oklch(0_0_0/0.04),0_0_0_3px_oklch(0_0_0/0.08),inset_0_0_0_1.5px_oklch(0_0_0/0.36)]',\n 'dark:focus-visible:shadow-[inset_0_1px_0_0_oklch(1_0_0/0.12),inset_0_2px_2px_-1px_oklch(0_0_0/0.16),inset_0_4px_4px_-2px_oklch(0_0_0/0.12),0_0_0_3px_oklch(1_0_0/0.08),inset_0_0_0_1.5px_oklch(1_0_0/0.28)]',\n\n 'transition-shadow duration-150',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n"]}
|