react-marketing-ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- 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/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
|
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
import { useReducedMotion, AnimatePresence, motion, useInView,
|
|
6
|
+
import { useReducedMotion, AnimatePresence, motion, useInView, useScroll, useTransform, useSpring } from 'framer-motion';
|
|
7
7
|
import { createContext, useRef, useState, useLayoutEffect, useId, useEffect, useMemo, useCallback, useContext, useSyncExternalStore } from 'react';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import { Renderer, Triangle, Mesh, Program } from 'ogl';
|
|
@@ -1183,6 +1183,105 @@ function FlowDiamond({ label, sub, className }) {
|
|
|
1183
1183
|
] })
|
|
1184
1184
|
] });
|
|
1185
1185
|
}
|
|
1186
|
+
var VB_W = 1270;
|
|
1187
|
+
var VB_H = 600;
|
|
1188
|
+
var BAND_TOP = 0;
|
|
1189
|
+
var OVERHANG = "0.5rem";
|
|
1190
|
+
var OVERSHOOT = 60;
|
|
1191
|
+
var BAND_X = -OVERSHOOT;
|
|
1192
|
+
var BAND_W = VB_W + OVERSHOOT * 2;
|
|
1193
|
+
var BAND_H = VB_H + OVERSHOOT;
|
|
1194
|
+
var HUES = [188, 210, 232, 250, 262, 285, 308, 330, 350];
|
|
1195
|
+
var ARCH_RX = VB_W * 1.35;
|
|
1196
|
+
var FADE_STOPS = [
|
|
1197
|
+
{ offset: 0, opacity: 1 },
|
|
1198
|
+
{ offset: 0.62, opacity: 1 },
|
|
1199
|
+
{ offset: 0.81, opacity: 0.8 },
|
|
1200
|
+
{ offset: 0.93, opacity: 0.35 },
|
|
1201
|
+
{ offset: 1, opacity: 0 }
|
|
1202
|
+
];
|
|
1203
|
+
var MAX_OPACITY = 0.85;
|
|
1204
|
+
function FadeStops() {
|
|
1205
|
+
return FADE_STOPS.map(({ offset, opacity }) => /* @__PURE__ */ jsx("stop", { offset, style: { stopColor: "#fff", stopOpacity: opacity } }, offset));
|
|
1206
|
+
}
|
|
1207
|
+
function FooterGlow() {
|
|
1208
|
+
const ref = useRef(null);
|
|
1209
|
+
const reduce = useReducedMotion();
|
|
1210
|
+
const uid = useId();
|
|
1211
|
+
const hueId = `footer-glow-hue-${uid}`;
|
|
1212
|
+
const flatFadeId = `footer-glow-fade-flat-${uid}`;
|
|
1213
|
+
const archFadeId = `footer-glow-fade-arch-${uid}`;
|
|
1214
|
+
const flatMaskId = `footer-glow-mask-flat-${uid}`;
|
|
1215
|
+
const archMaskId = `footer-glow-mask-arch-${uid}`;
|
|
1216
|
+
const { scrollYProgress } = useScroll({ target: ref, offset: ["start end", "start center"] });
|
|
1217
|
+
const y = useTransform(scrollYProgress, [0, 0.7, 1], ["55%", "5%", "2%"]);
|
|
1218
|
+
const opacity = useTransform(scrollYProgress, [0, 0.65], [0, MAX_OPACITY]);
|
|
1219
|
+
return /* @__PURE__ */ jsx(
|
|
1220
|
+
"div",
|
|
1221
|
+
{
|
|
1222
|
+
ref,
|
|
1223
|
+
"aria-hidden": "true",
|
|
1224
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 overflow-hidden",
|
|
1225
|
+
style: { height: `calc(100% + ${OVERHANG})` },
|
|
1226
|
+
children: /* @__PURE__ */ jsxs(
|
|
1227
|
+
motion.svg,
|
|
1228
|
+
{
|
|
1229
|
+
viewBox: `0 0 ${VB_W} ${VB_H}`,
|
|
1230
|
+
preserveAspectRatio: "none",
|
|
1231
|
+
className: "h-full w-full",
|
|
1232
|
+
overflow: "visible",
|
|
1233
|
+
style: reduce ? { opacity: MAX_OPACITY } : { y, opacity },
|
|
1234
|
+
children: [
|
|
1235
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
1236
|
+
/* @__PURE__ */ jsx("linearGradient", { id: hueId, x1: "0", y1: "0", x2: "1", y2: "0", children: HUES.map((hue, i) => /* @__PURE__ */ jsx("stop", { offset: i / (HUES.length - 1), style: { stopColor: `hsl(${hue} 95% 55%)` } }, hue)) }),
|
|
1237
|
+
/* @__PURE__ */ jsx("linearGradient", { id: flatFadeId, gradientUnits: "userSpaceOnUse", x1: "0", y1: VB_H, x2: "0", y2: BAND_TOP, children: /* @__PURE__ */ jsx(FadeStops, {}) }),
|
|
1238
|
+
/* @__PURE__ */ jsx(
|
|
1239
|
+
"radialGradient",
|
|
1240
|
+
{
|
|
1241
|
+
id: archFadeId,
|
|
1242
|
+
gradientUnits: "userSpaceOnUse",
|
|
1243
|
+
cx: VB_W / 2,
|
|
1244
|
+
cy: VB_H,
|
|
1245
|
+
r: VB_H - BAND_TOP,
|
|
1246
|
+
gradientTransform: `translate(${VB_W / 2} 0) scale(${ARCH_RX / (VB_H - BAND_TOP)} 1) translate(${-VB_W / 2} 0)`,
|
|
1247
|
+
children: /* @__PURE__ */ jsx(FadeStops, {})
|
|
1248
|
+
}
|
|
1249
|
+
),
|
|
1250
|
+
[
|
|
1251
|
+
{ id: flatMaskId, fill: flatFadeId },
|
|
1252
|
+
{ id: archMaskId, fill: archFadeId }
|
|
1253
|
+
].map(({ id, fill }) => /* @__PURE__ */ jsx("mask", { id, maskUnits: "userSpaceOnUse", x: BAND_X, y: "0", width: BAND_W, height: BAND_H, children: /* @__PURE__ */ jsx("rect", { x: BAND_X, y: "0", width: BAND_W, height: BAND_H, fill: `url(#${fill})` }) }, id))
|
|
1254
|
+
] }),
|
|
1255
|
+
/* @__PURE__ */ jsx(
|
|
1256
|
+
"rect",
|
|
1257
|
+
{
|
|
1258
|
+
x: BAND_X,
|
|
1259
|
+
y: "0",
|
|
1260
|
+
width: BAND_W,
|
|
1261
|
+
height: BAND_H,
|
|
1262
|
+
fill: `url(#${hueId})`,
|
|
1263
|
+
mask: `url(#${flatMaskId})`,
|
|
1264
|
+
className: "md:hidden"
|
|
1265
|
+
}
|
|
1266
|
+
),
|
|
1267
|
+
/* @__PURE__ */ jsx(
|
|
1268
|
+
"rect",
|
|
1269
|
+
{
|
|
1270
|
+
x: BAND_X,
|
|
1271
|
+
y: "0",
|
|
1272
|
+
width: BAND_W,
|
|
1273
|
+
height: BAND_H,
|
|
1274
|
+
fill: `url(#${hueId})`,
|
|
1275
|
+
mask: `url(#${archMaskId})`,
|
|
1276
|
+
className: "hidden md:block"
|
|
1277
|
+
}
|
|
1278
|
+
)
|
|
1279
|
+
]
|
|
1280
|
+
}
|
|
1281
|
+
)
|
|
1282
|
+
}
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1186
1285
|
var glossLayer = cn(
|
|
1187
1286
|
"pointer-events-none absolute inset-0 z-[-1] rounded-[inherit]",
|
|
1188
1287
|
"[background-color:var(--btn-face)] [box-shadow:var(--shadow-button)]",
|
|
@@ -2639,6 +2738,6 @@ function useBreakpoint() {
|
|
|
2639
2738
|
return useSyncExternalStore(subscribe2, getBreakpoint2, getBreakpointServer);
|
|
2640
2739
|
}
|
|
2641
2740
|
|
|
2642
|
-
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, ActionSwapRollIcon, ActionSwapRollText, AnimatedBeam, ArrowLeft, ArrowRight, ArrowSvg, BREAKPOINTS2 as BREAKPOINTS, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChevronDownIcon2 as ChevronDownIcon, ChevronRightIcon, DiaTextReveal, EASE_OUT, EASE_OUT_CSS, ElevatedInput, FadeIn, FeatureCard, FlowDiamond, FlowNode, FlowPill, GlossyButton, grainient_default as Grainient, Highlighter, Input, JoinArrow, LiquidMetal, NavigationMenu, NavigationMenuArrow, NavigationMenuBackdrop, NavigationMenuContent, NavigationMenuIcon, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPortal, NavigationMenuSub, NavigationMenuSubTrigger, NavigationMenuTrigger, NavigationMenuViewport, PasswordInput, RainbowButton, RangeSlider, RollingBadge, SPRING_SWAP, SavingsBadge, ShineBorder, SparklesText, SplitArrow, Stagger, StaggerItem, Tabs, ThemeToggle, TurnDown, cn, easeOut, easeOutBack, getBreakpoint2 as getBreakpoint, glossyButtonVariants, hasKey, navigationMenuSubTriggerStyle, navigationMenuTriggerStyle, noop, onBreakpointChange2 as onBreakpointChange, rainbowButtonVariants, solidSurface, useBreakpoint, validCssVars };
|
|
2741
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, ActionSwapRollIcon, ActionSwapRollText, AnimatedBeam, ArrowLeft, ArrowRight, ArrowSvg, BREAKPOINTS2 as BREAKPOINTS, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChevronDownIcon2 as ChevronDownIcon, ChevronRightIcon, DiaTextReveal, EASE_OUT, EASE_OUT_CSS, ElevatedInput, FadeIn, FeatureCard, FlowDiamond, FlowNode, FlowPill, FooterGlow, GlossyButton, grainient_default as Grainient, Highlighter, Input, JoinArrow, LiquidMetal, NavigationMenu, NavigationMenuArrow, NavigationMenuBackdrop, NavigationMenuContent, NavigationMenuIcon, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPortal, NavigationMenuSub, NavigationMenuSubTrigger, NavigationMenuTrigger, NavigationMenuViewport, PasswordInput, RainbowButton, RangeSlider, RollingBadge, SPRING_SWAP, SavingsBadge, ShineBorder, SparklesText, SplitArrow, Stagger, StaggerItem, Tabs, ThemeToggle, TurnDown, cn, easeOut, easeOutBack, getBreakpoint2 as getBreakpoint, glossyButtonVariants, hasKey, navigationMenuSubTriggerStyle, navigationMenuTriggerStyle, noop, onBreakpointChange2 as onBreakpointChange, rainbowButtonVariants, solidSurface, useBreakpoint, validCssVars };
|
|
2643
2742
|
//# sourceMappingURL=index.mjs.map
|
|
2644
2743
|
//# sourceMappingURL=index.mjs.map
|