@bison-lab/ui 4.32.0 → 4.37.0
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/index.d.mts +80 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +348 -70
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -8414,7 +8414,7 @@ function toValues(fields, data) {
|
|
|
8414
8414
|
* `success` are the three states of a send; on success the form is replaced
|
|
8415
8415
|
* by a status message that takes focus, so a screen reader hears the result.
|
|
8416
8416
|
*/
|
|
8417
|
-
const InquiryFormBlock = React.forwardRef(({ eyebrow, title, description, headingLevel = "h2", fields, submitLabel = "Send", onSubmit, loading = false, error, errors, disabled = false, success = false, successTitle = "Thanks, your message is on its way", successMessage = "We will get back to you soon.", formMode = "native", register, trigger, containerClassName, className, ...props }, ref) => {
|
|
8417
|
+
const InquiryFormBlock = React.forwardRef(({ eyebrow, title, description, headingLevel = "h2", fields, submitLabel = "Send", beforeSubmit, onSubmit, loading = false, error, errors, disabled = false, success = false, successTitle = "Thanks, your message is on its way", successMessage = "We will get back to you soon.", formMode = "native", register, trigger, containerClassName, className, ...props }, ref) => {
|
|
8418
8418
|
const headingId = React.useId();
|
|
8419
8419
|
const formId = React.useId();
|
|
8420
8420
|
const statusRef = React.useRef(null);
|
|
@@ -8504,6 +8504,7 @@ const InquiryFormBlock = React.forwardRef(({ eyebrow, title, description, headin
|
|
|
8504
8504
|
register: rhf ? register : void 0
|
|
8505
8505
|
})
|
|
8506
8506
|
}, field.key)),
|
|
8507
|
+
beforeSubmit,
|
|
8507
8508
|
/* @__PURE__ */ jsx(Button, {
|
|
8508
8509
|
type: "submit",
|
|
8509
8510
|
className: "self-start",
|
|
@@ -8951,7 +8952,7 @@ const TICK_MS = 100;
|
|
|
8951
8952
|
function inertWhen(hidden) {
|
|
8952
8953
|
return { inert: hidden };
|
|
8953
8954
|
}
|
|
8954
|
-
const
|
|
8955
|
+
const ProcessStepsStage = React.forwardRef(({ items, defaultActiveIndex = 0, activeIndex: activeIndexProp, onActiveIndexChange, autoAdvance = true, autoAdvanceDuration = 6e3, pauseOnHover = true, renderImage, ariaLabel = "Process steps", stepLabel = (item, i) => `Step ${item.step ?? i + 1}`, labels, className, ...props }, ref) => {
|
|
8955
8956
|
const [activeIndexState, setActiveIndexState] = React.useState(defaultActiveIndex);
|
|
8956
8957
|
const activeIndex = activeIndexProp ?? activeIndexState;
|
|
8957
8958
|
const [progress, setProgress] = React.useState(0);
|
|
@@ -9024,8 +9025,8 @@ const ProcessStepsBlock = React.forwardRef(({ items, defaultActiveIndex = 0, act
|
|
|
9024
9025
|
};
|
|
9025
9026
|
const total = items.length;
|
|
9026
9027
|
const defaultImage = (item) => /* @__PURE__ */ jsx("img", {
|
|
9027
|
-
src: item.image
|
|
9028
|
-
alt: item.image
|
|
9028
|
+
src: item.image?.src,
|
|
9029
|
+
alt: item.image?.alt ?? "",
|
|
9029
9030
|
className: cn("size-full object-cover", item.imageClassName)
|
|
9030
9031
|
});
|
|
9031
9032
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -9047,7 +9048,7 @@ const ProcessStepsBlock = React.forwardRef(({ items, defaultActiveIndex = 0, act
|
|
|
9047
9048
|
className: "absolute inset-0 motion-safe:transition-[clip-path] motion-safe:duration-700 motion-safe:ease-out",
|
|
9048
9049
|
style: { clipPath: isActive ? "inset(0% 0% 0% 0%)" : "inset(0% 0% 0% 100%)" },
|
|
9049
9050
|
...inertWhen(!isActive),
|
|
9050
|
-
children: (renderImage ?? defaultImage)(item, i)
|
|
9051
|
+
children: item.image ? (renderImage ?? defaultImage)(item, i) : null
|
|
9051
9052
|
}, item.id);
|
|
9052
9053
|
}),
|
|
9053
9054
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -9156,6 +9157,143 @@ const ProcessStepsBlock = React.forwardRef(({ items, defaultActiveIndex = 0, act
|
|
|
9156
9157
|
})]
|
|
9157
9158
|
});
|
|
9158
9159
|
});
|
|
9160
|
+
ProcessStepsStage.displayName = "ProcessStepsStage";
|
|
9161
|
+
/**
|
|
9162
|
+
* Every step at once, down a number rail: a filled numeral per step joined
|
|
9163
|
+
* by a hairline, so the order reads at a glance and nothing is hidden. With
|
|
9164
|
+
* a heading, the intro takes a sticky column beside the list from `lg` up.
|
|
9165
|
+
*/
|
|
9166
|
+
const ProcessStepsNumbered = React.forwardRef(({ items, renderImage, ariaLabel = "Process steps", eyebrow, title, description, headingLevel: Heading = "h2", className, ...props }, ref) => {
|
|
9167
|
+
const hasIntro = title != null || eyebrow != null || description != null;
|
|
9168
|
+
const list = /* @__PURE__ */ jsx("ol", {
|
|
9169
|
+
"aria-label": title != null ? void 0 : ariaLabel,
|
|
9170
|
+
children: items.map((item, index) => {
|
|
9171
|
+
const last = index === items.length - 1;
|
|
9172
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
9173
|
+
className: "relative flex gap-5 sm:gap-6",
|
|
9174
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
9175
|
+
className: "flex flex-col items-center",
|
|
9176
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
9177
|
+
className: "z-10 inline-flex size-11 shrink-0 items-center justify-center rounded-full bg-secondary font-heading text-lg font-bold text-secondary-foreground",
|
|
9178
|
+
children: item.step ?? index + 1
|
|
9179
|
+
}), !last && /* @__PURE__ */ jsx("span", {
|
|
9180
|
+
"aria-hidden": true,
|
|
9181
|
+
className: "w-px flex-1 bg-border"
|
|
9182
|
+
})]
|
|
9183
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
9184
|
+
className: last ? "pb-2" : "pb-10",
|
|
9185
|
+
children: [
|
|
9186
|
+
/* @__PURE__ */ jsx("h3", {
|
|
9187
|
+
className: "pt-2 font-heading text-xl font-bold",
|
|
9188
|
+
children: item.title
|
|
9189
|
+
}),
|
|
9190
|
+
/* @__PURE__ */ jsx("p", {
|
|
9191
|
+
className: "mt-2 leading-relaxed text-muted-foreground",
|
|
9192
|
+
children: item.description
|
|
9193
|
+
}),
|
|
9194
|
+
item.image ? /* @__PURE__ */ jsx("div", {
|
|
9195
|
+
className: "relative mt-5 aspect-[2/1] w-full overflow-hidden rounded-xl border border-border",
|
|
9196
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
9197
|
+
className: "absolute inset-0",
|
|
9198
|
+
children: renderImage ? renderImage(item, index) : /* @__PURE__ */ jsx("img", {
|
|
9199
|
+
src: item.image.src,
|
|
9200
|
+
alt: item.image.alt ?? "",
|
|
9201
|
+
className: cn("size-full object-cover", item.imageClassName)
|
|
9202
|
+
})
|
|
9203
|
+
})
|
|
9204
|
+
}) : null
|
|
9205
|
+
]
|
|
9206
|
+
})]
|
|
9207
|
+
}, item.id);
|
|
9208
|
+
})
|
|
9209
|
+
});
|
|
9210
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9211
|
+
ref,
|
|
9212
|
+
"data-layout": "numbered",
|
|
9213
|
+
className,
|
|
9214
|
+
...props,
|
|
9215
|
+
children: hasIntro ? /* @__PURE__ */ jsxs("div", {
|
|
9216
|
+
className: "grid gap-10 lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)] lg:gap-16",
|
|
9217
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
9218
|
+
className: "lg:sticky lg:top-28 lg:self-start",
|
|
9219
|
+
children: [
|
|
9220
|
+
typeof eyebrow === "string" ? /* @__PURE__ */ jsx("p", {
|
|
9221
|
+
className: "text-sm font-semibold tracking-wide text-secondary uppercase",
|
|
9222
|
+
children: eyebrow
|
|
9223
|
+
}) : eyebrow,
|
|
9224
|
+
title != null && /* @__PURE__ */ jsx(Heading, {
|
|
9225
|
+
className: "mt-3 font-heading text-3xl font-bold tracking-tight text-balance sm:text-4xl",
|
|
9226
|
+
children: title
|
|
9227
|
+
}),
|
|
9228
|
+
description != null && /* @__PURE__ */ jsx("p", {
|
|
9229
|
+
className: "mt-4 text-lg text-muted-foreground",
|
|
9230
|
+
children: description
|
|
9231
|
+
})
|
|
9232
|
+
]
|
|
9233
|
+
}), list]
|
|
9234
|
+
}) : list
|
|
9235
|
+
});
|
|
9236
|
+
});
|
|
9237
|
+
ProcessStepsNumbered.displayName = "ProcessStepsNumbered";
|
|
9238
|
+
/**
|
|
9239
|
+
* An ordered walkthrough: the stage (one step at a time over its photo,
|
|
9240
|
+
* advancing on its own) or the numbered list (every step down a number
|
|
9241
|
+
* rail). Either takes an optional section heading.
|
|
9242
|
+
*/
|
|
9243
|
+
const ProcessStepsBlock = React.forwardRef(({ layout = "stage", eyebrow, title, description, headingLevel, ...props }, ref) => {
|
|
9244
|
+
if (layout === "numbered") {
|
|
9245
|
+
const { defaultActiveIndex: _defaultActiveIndex, activeIndex: _activeIndex, onActiveIndexChange: _onActiveIndexChange, autoAdvance: _autoAdvance, autoAdvanceDuration: _autoAdvanceDuration, pauseOnHover: _pauseOnHover, labels: _labels, stepLabel: _stepLabel, ...rest } = props;
|
|
9246
|
+
return /* @__PURE__ */ jsx(ProcessStepsNumbered, {
|
|
9247
|
+
ref,
|
|
9248
|
+
eyebrow,
|
|
9249
|
+
title,
|
|
9250
|
+
description,
|
|
9251
|
+
headingLevel,
|
|
9252
|
+
...rest
|
|
9253
|
+
});
|
|
9254
|
+
}
|
|
9255
|
+
if (title == null && eyebrow == null && description == null) return /* @__PURE__ */ jsx(ProcessStepsStage, {
|
|
9256
|
+
ref,
|
|
9257
|
+
...props
|
|
9258
|
+
});
|
|
9259
|
+
const { items, defaultActiveIndex, activeIndex, onActiveIndexChange, autoAdvance, autoAdvanceDuration, pauseOnHover, renderImage, ariaLabel, stepLabel, labels, className, ...wrapper } = props;
|
|
9260
|
+
const Heading = headingLevel ?? "h2";
|
|
9261
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
9262
|
+
ref,
|
|
9263
|
+
className,
|
|
9264
|
+
...wrapper,
|
|
9265
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
9266
|
+
className: "mb-10",
|
|
9267
|
+
children: [
|
|
9268
|
+
typeof eyebrow === "string" ? /* @__PURE__ */ jsx(Badge, {
|
|
9269
|
+
variant: "outline",
|
|
9270
|
+
className: "h-7 rounded-full px-3 font-medium",
|
|
9271
|
+
children: eyebrow
|
|
9272
|
+
}) : eyebrow,
|
|
9273
|
+
title != null && /* @__PURE__ */ jsx(Heading, {
|
|
9274
|
+
className: cn("text-3xl leading-[1.05] font-light tracking-tight md:text-4xl", eyebrow != null && "mt-6"),
|
|
9275
|
+
children: title
|
|
9276
|
+
}),
|
|
9277
|
+
description != null && /* @__PURE__ */ jsx("p", {
|
|
9278
|
+
className: "mt-4 max-w-2xl text-base leading-relaxed text-muted-foreground",
|
|
9279
|
+
children: description
|
|
9280
|
+
})
|
|
9281
|
+
]
|
|
9282
|
+
}), /* @__PURE__ */ jsx(ProcessStepsStage, {
|
|
9283
|
+
items,
|
|
9284
|
+
defaultActiveIndex,
|
|
9285
|
+
activeIndex,
|
|
9286
|
+
onActiveIndexChange,
|
|
9287
|
+
autoAdvance,
|
|
9288
|
+
autoAdvanceDuration,
|
|
9289
|
+
pauseOnHover,
|
|
9290
|
+
renderImage,
|
|
9291
|
+
ariaLabel,
|
|
9292
|
+
stepLabel,
|
|
9293
|
+
labels
|
|
9294
|
+
})]
|
|
9295
|
+
});
|
|
9296
|
+
});
|
|
9159
9297
|
ProcessStepsBlock.displayName = "ProcessStepsBlock";
|
|
9160
9298
|
//#endregion
|
|
9161
9299
|
//#region src/blocks/marketing/stats-band-block.tsx
|
|
@@ -9181,10 +9319,10 @@ const TABLET_SPAN = {
|
|
|
9181
9319
|
* down and leave a bordered hole in the row above; the flag is ignored there
|
|
9182
9320
|
* rather than reordering the stats to fill the hole.
|
|
9183
9321
|
*/
|
|
9184
|
-
function wideIndex(items) {
|
|
9322
|
+
function wideIndex(items, fallbackToFirst = true) {
|
|
9185
9323
|
if (items.length % 2 === 0) return -1;
|
|
9186
9324
|
const flagged = items.findIndex((item, i) => item.wide && i % 2 === 0);
|
|
9187
|
-
return Math.max(flagged, 0);
|
|
9325
|
+
return fallbackToFirst ? Math.max(flagged, 0) : flagged;
|
|
9188
9326
|
}
|
|
9189
9327
|
/**
|
|
9190
9328
|
* Tablets: three per row on a six-track grid, so a short last row can
|
|
@@ -9210,19 +9348,45 @@ const StatsBandBlock = React.forwardRef(({ items, columns, tone = "card", align
|
|
|
9210
9348
|
const headingId = `${uid}-heading`;
|
|
9211
9349
|
if (items.length < 2) return null;
|
|
9212
9350
|
const desktopColumns = Math.min(columns ?? items.length, items.length, 6);
|
|
9213
|
-
const
|
|
9351
|
+
const open = tone === "open";
|
|
9352
|
+
const wide = wideIndex(items, !open);
|
|
9214
9353
|
const tablet = tabletSpans(items.length);
|
|
9215
9354
|
const centered = align === "center";
|
|
9216
9355
|
const hasHeader = title != null;
|
|
9356
|
+
const renderValue = (item, labelId) => item.href ? renderLink({
|
|
9357
|
+
href: item.href,
|
|
9358
|
+
...newTabAttributes(item.newTab),
|
|
9359
|
+
"aria-describedby": labelId,
|
|
9360
|
+
className: "outline-none after:absolute after:inset-0 focus-visible:after:ring-2 focus-visible:after:ring-ring focus-visible:after:ring-inset",
|
|
9361
|
+
children: item.value
|
|
9362
|
+
}) : item.value;
|
|
9217
9363
|
return /* @__PURE__ */ jsx("section", {
|
|
9218
9364
|
ref,
|
|
9219
9365
|
"aria-labelledby": hasHeader ? headingId : void 0,
|
|
9220
9366
|
"aria-label": hasHeader ? void 0 : ariaLabel,
|
|
9367
|
+
"data-tone": tone,
|
|
9221
9368
|
className: cn("relative", className),
|
|
9222
9369
|
...props,
|
|
9223
9370
|
children: /* @__PURE__ */ jsxs("div", {
|
|
9224
9371
|
className: cn("mx-auto max-w-6xl px-4 sm:px-6", containerClassName),
|
|
9225
|
-
children: [(hasHeader || eyebrow != null || description != null) && /* @__PURE__ */ jsxs("div", {
|
|
9372
|
+
children: [(hasHeader || eyebrow != null || description != null) && (open ? /* @__PURE__ */ jsxs("div", {
|
|
9373
|
+
className: cn("mb-10 max-w-2xl", centered && "mx-auto text-center"),
|
|
9374
|
+
children: [
|
|
9375
|
+
typeof eyebrow === "string" ? /* @__PURE__ */ jsx("p", {
|
|
9376
|
+
className: "text-sm font-semibold tracking-wide text-secondary uppercase",
|
|
9377
|
+
children: eyebrow
|
|
9378
|
+
}) : eyebrow,
|
|
9379
|
+
hasHeader && /* @__PURE__ */ jsx(Heading, {
|
|
9380
|
+
id: headingId,
|
|
9381
|
+
className: "mt-3 font-heading text-3xl font-bold tracking-tight text-balance sm:text-4xl",
|
|
9382
|
+
children: title
|
|
9383
|
+
}),
|
|
9384
|
+
description != null && /* @__PURE__ */ jsx("p", {
|
|
9385
|
+
className: "mt-4 text-lg text-muted-foreground",
|
|
9386
|
+
children: description
|
|
9387
|
+
})
|
|
9388
|
+
]
|
|
9389
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
9226
9390
|
className: cn("mb-10", centered && "text-center"),
|
|
9227
9391
|
children: [
|
|
9228
9392
|
typeof eyebrow === "string" ? /* @__PURE__ */ jsx(Badge, {
|
|
@@ -9240,7 +9404,30 @@ const StatsBandBlock = React.forwardRef(({ items, columns, tone = "card", align
|
|
|
9240
9404
|
children: description
|
|
9241
9405
|
})
|
|
9242
9406
|
]
|
|
9243
|
-
}), /* @__PURE__ */ jsx("
|
|
9407
|
+
})), open ? /* @__PURE__ */ jsx("dl", {
|
|
9408
|
+
className: cn("grid grid-cols-2 gap-x-6 gap-y-8 sm:gap-x-8 sm:gap-y-10", DESKTOP_COLUMNS[desktopColumns]),
|
|
9409
|
+
children: items.map((item, i) => {
|
|
9410
|
+
const labelId = `${uid}-label-${i}`;
|
|
9411
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9412
|
+
className: cn("relative flex flex-col", centered && "items-center text-center", i === wide && "col-span-2 lg:col-span-1"),
|
|
9413
|
+
children: renderItem ? renderItem(item, i) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9414
|
+
/* @__PURE__ */ jsx("dt", {
|
|
9415
|
+
id: labelId,
|
|
9416
|
+
className: "order-2 mt-2 font-heading text-base font-semibold sm:mt-3 sm:text-lg",
|
|
9417
|
+
children: item.label
|
|
9418
|
+
}),
|
|
9419
|
+
/* @__PURE__ */ jsx("dd", {
|
|
9420
|
+
className: "order-1 font-heading text-4xl font-bold tracking-tight text-primary sm:text-6xl",
|
|
9421
|
+
children: renderValue(item, labelId)
|
|
9422
|
+
}),
|
|
9423
|
+
item.detail != null && item.detail !== "" && /* @__PURE__ */ jsx("dd", {
|
|
9424
|
+
className: "order-3 mt-1 text-sm text-muted-foreground",
|
|
9425
|
+
children: item.detail
|
|
9426
|
+
})
|
|
9427
|
+
] })
|
|
9428
|
+
}, item.id);
|
|
9429
|
+
})
|
|
9430
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
9244
9431
|
className: cn("overflow-hidden", tone === "card" && "rounded-xl border border-border bg-card shadow-md"),
|
|
9245
9432
|
children: /* @__PURE__ */ jsx("dl", {
|
|
9246
9433
|
className: cn("-mr-px -mb-px grid grid-cols-2 md:grid-cols-6", DESKTOP_COLUMNS[desktopColumns]),
|
|
@@ -9248,21 +9435,22 @@ const StatsBandBlock = React.forwardRef(({ items, columns, tone = "card", align
|
|
|
9248
9435
|
const labelId = `${uid}-label-${i}`;
|
|
9249
9436
|
const linked = Boolean(item.href);
|
|
9250
9437
|
return /* @__PURE__ */ jsx("div", {
|
|
9251
|
-
className: cn("relative flex
|
|
9252
|
-
children: renderItem ? renderItem(item, i) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9438
|
+
className: cn("relative flex gap-2 border-r border-b border-border px-6 py-8 last:border-r-0 sm:px-8", renderItem ? "flex-col-reverse justify-end" : "flex-col", centered && "items-center text-center", linked && "transition-colors hover:bg-muted/40", i === wide && "col-span-2", TABLET_SPAN[tablet[i]], "lg:col-span-1"),
|
|
9439
|
+
children: renderItem ? renderItem(item, i) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9440
|
+
/* @__PURE__ */ jsx("dt", {
|
|
9441
|
+
id: labelId,
|
|
9442
|
+
className: "order-2 max-w-[24ch] text-sm leading-relaxed text-muted-foreground",
|
|
9443
|
+
children: item.label
|
|
9444
|
+
}),
|
|
9445
|
+
/* @__PURE__ */ jsx("dd", {
|
|
9446
|
+
className: "order-1 font-heading text-3xl font-bold tracking-tight text-primary sm:text-4xl",
|
|
9447
|
+
children: renderValue(item, labelId)
|
|
9448
|
+
}),
|
|
9449
|
+
item.detail != null && item.detail !== "" && /* @__PURE__ */ jsx("dd", {
|
|
9450
|
+
className: "order-3 max-w-[24ch] text-xs leading-relaxed text-muted-foreground",
|
|
9451
|
+
children: item.detail
|
|
9452
|
+
})
|
|
9453
|
+
] })
|
|
9266
9454
|
}, item.id);
|
|
9267
9455
|
})
|
|
9268
9456
|
})
|
|
@@ -11141,60 +11329,150 @@ const CTA_BAND_MAX_ACTIONS = 2;
|
|
|
11141
11329
|
*/
|
|
11142
11330
|
const SCRIM = "bg-[rgb(0_0_0/0.6)]";
|
|
11143
11331
|
/**
|
|
11144
|
-
* The
|
|
11145
|
-
*
|
|
11332
|
+
* The gradient tone's surface: the darkest secondary step with a glow of a
|
|
11333
|
+
* lighter one from the top-left corner.
|
|
11146
11334
|
*/
|
|
11147
|
-
const
|
|
11335
|
+
const GRADIENT = "bg-[radial-gradient(120%_120%_at_0%_0%,hsl(var(--secondary-800))_0%,hsl(var(--secondary-950))_55%)]";
|
|
11336
|
+
/** The panel's own padding, inside the card. */
|
|
11337
|
+
const PANEL_PADDING = "px-6 py-14 sm:px-10 lg:px-14 lg:py-20";
|
|
11338
|
+
/**
|
|
11339
|
+
* The closing band at the end of a page: an optional kicker, a heading, an
|
|
11340
|
+
* optional line and up to two buttons, with an optional image. Edge to edge
|
|
11341
|
+
* or as a rounded panel, on the page's surface or a dark gradient.
|
|
11342
|
+
*/
|
|
11343
|
+
const CtaBandBlock = React.forwardRef(function CtaBandBlock({ eyebrow, heading, description, actions, media, align = "center", layout = "band", tone = "plain", renderLink = renderPlainLink, containerClassName, className, ...rest }, ref) {
|
|
11148
11344
|
const centered = align === "center";
|
|
11345
|
+
const panel = layout === "panel";
|
|
11346
|
+
const gradient = tone === "gradient";
|
|
11149
11347
|
const shown = (actions ?? []).slice(0, 2);
|
|
11150
|
-
|
|
11348
|
+
const hasEyebrow = eyebrow != null && eyebrow !== "";
|
|
11349
|
+
const buttons = shown.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
11350
|
+
className: cn("mt-8 flex flex-wrap items-center gap-3", centered && "justify-center"),
|
|
11351
|
+
children: shown.map((action, i) => {
|
|
11352
|
+
const variant = i === 0 ? "default" : "outline";
|
|
11353
|
+
if (!action.href) return /* @__PURE__ */ jsx("span", {
|
|
11354
|
+
className: "px-2 text-base font-medium",
|
|
11355
|
+
children: action.label
|
|
11356
|
+
}, i);
|
|
11357
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: renderLink({
|
|
11358
|
+
href: action.href,
|
|
11359
|
+
...newTabAttributes(action.newTab),
|
|
11360
|
+
"data-variant": variant,
|
|
11361
|
+
className: cn(buttonVariants({
|
|
11362
|
+
variant,
|
|
11363
|
+
size: action.size ?? "lg"
|
|
11364
|
+
}), "rounded-full"),
|
|
11365
|
+
children: action.label
|
|
11366
|
+
}) }, i);
|
|
11367
|
+
})
|
|
11368
|
+
}) : null;
|
|
11369
|
+
if (gradient) {
|
|
11370
|
+
const photo = media ? /* @__PURE__ */ jsx("div", {
|
|
11371
|
+
className: "pointer-events-none absolute inset-y-0 right-0 hidden [mask-image:linear-gradient(to_right,transparent,black_45%)] lg:block lg:w-[72%]",
|
|
11372
|
+
"data-cta-band-media": "",
|
|
11373
|
+
children: media
|
|
11374
|
+
}) : null;
|
|
11375
|
+
const copy = /* @__PURE__ */ jsxs("div", {
|
|
11376
|
+
className: cn(centered ? "mx-auto max-w-3xl text-center" : "lg:w-1/2 lg:pr-8", panel && PANEL_PADDING),
|
|
11377
|
+
children: [
|
|
11378
|
+
hasEyebrow ? /* @__PURE__ */ jsx("p", {
|
|
11379
|
+
className: "font-medium text-secondary-300",
|
|
11380
|
+
children: eyebrow
|
|
11381
|
+
}) : null,
|
|
11382
|
+
/* @__PURE__ */ jsx("h2", {
|
|
11383
|
+
className: cn("font-heading text-3xl font-bold tracking-tight text-balance text-secondary-50 sm:text-4xl lg:text-5xl", hasEyebrow && "mt-4"),
|
|
11384
|
+
children: heading
|
|
11385
|
+
}),
|
|
11386
|
+
description ? /* @__PURE__ */ jsx("p", {
|
|
11387
|
+
className: cn("mt-5 max-w-xl text-lg text-secondary-100/80", centered && "mx-auto"),
|
|
11388
|
+
children: description
|
|
11389
|
+
}) : null,
|
|
11390
|
+
buttons
|
|
11391
|
+
]
|
|
11392
|
+
});
|
|
11393
|
+
if (panel) return /* @__PURE__ */ jsx("section", {
|
|
11394
|
+
ref,
|
|
11395
|
+
"data-align": align,
|
|
11396
|
+
"data-layout": layout,
|
|
11397
|
+
"data-tone": tone,
|
|
11398
|
+
className: cn("py-16 lg:py-24", className),
|
|
11399
|
+
...rest,
|
|
11400
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
11401
|
+
className: cn(DEFAULT_CONTAINER, containerClassName),
|
|
11402
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
11403
|
+
className: cn("relative overflow-hidden rounded-3xl", GRADIENT),
|
|
11404
|
+
"data-cta-band-panel": "",
|
|
11405
|
+
children: [photo, /* @__PURE__ */ jsx("div", {
|
|
11406
|
+
className: "relative",
|
|
11407
|
+
children: copy
|
|
11408
|
+
})]
|
|
11409
|
+
})
|
|
11410
|
+
})
|
|
11411
|
+
});
|
|
11412
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
11413
|
+
ref,
|
|
11414
|
+
"data-align": align,
|
|
11415
|
+
"data-layout": layout,
|
|
11416
|
+
"data-tone": tone,
|
|
11417
|
+
className: cn("relative overflow-hidden py-16 lg:py-24", GRADIENT, className),
|
|
11418
|
+
...rest,
|
|
11419
|
+
children: [photo, /* @__PURE__ */ jsx("div", {
|
|
11420
|
+
className: cn(DEFAULT_CONTAINER, containerClassName, "relative"),
|
|
11421
|
+
children: copy
|
|
11422
|
+
})]
|
|
11423
|
+
});
|
|
11424
|
+
}
|
|
11425
|
+
const backdrop = media ? /* @__PURE__ */ jsxs("div", {
|
|
11426
|
+
className: "absolute inset-0 -z-10",
|
|
11427
|
+
"data-cta-band-media": "",
|
|
11428
|
+
children: [media, /* @__PURE__ */ jsx("div", {
|
|
11429
|
+
"aria-hidden": true,
|
|
11430
|
+
className: cn("absolute inset-0", SCRIM)
|
|
11431
|
+
})]
|
|
11432
|
+
}) : null;
|
|
11433
|
+
const copy = /* @__PURE__ */ jsxs("div", {
|
|
11434
|
+
"data-theme": media ? "dark" : void 0,
|
|
11435
|
+
className: cn("max-w-3xl", centered && "mx-auto text-center", media && "text-foreground", panel && PANEL_PADDING),
|
|
11436
|
+
children: [
|
|
11437
|
+
hasEyebrow ? /* @__PURE__ */ jsx("p", {
|
|
11438
|
+
className: cn("text-sm font-semibold tracking-wide uppercase", media ? "text-foreground" : "text-muted-foreground"),
|
|
11439
|
+
children: eyebrow
|
|
11440
|
+
}) : null,
|
|
11441
|
+
/* @__PURE__ */ jsx("h2", {
|
|
11442
|
+
className: cn("font-heading text-3xl font-bold tracking-tight text-balance sm:text-4xl", hasEyebrow && "mt-3"),
|
|
11443
|
+
children: heading
|
|
11444
|
+
}),
|
|
11445
|
+
description ? /* @__PURE__ */ jsx("p", {
|
|
11446
|
+
className: cn("mt-4 max-w-2xl text-lg leading-relaxed", centered && "mx-auto", media ? "text-foreground" : "text-muted-foreground"),
|
|
11447
|
+
children: description
|
|
11448
|
+
}) : null,
|
|
11449
|
+
buttons
|
|
11450
|
+
]
|
|
11451
|
+
});
|
|
11452
|
+
if (panel) return /* @__PURE__ */ jsx("section", {
|
|
11151
11453
|
ref,
|
|
11152
11454
|
"data-align": align,
|
|
11153
|
-
|
|
11455
|
+
"data-layout": layout,
|
|
11456
|
+
"data-tone": tone,
|
|
11457
|
+
className: cn("py-16 lg:py-24", className),
|
|
11154
11458
|
...rest,
|
|
11155
|
-
children:
|
|
11156
|
-
className: "absolute inset-0 -z-10",
|
|
11157
|
-
"data-cta-band-media": "",
|
|
11158
|
-
children: [media, /* @__PURE__ */ jsx("div", {
|
|
11159
|
-
"aria-hidden": true,
|
|
11160
|
-
className: cn("absolute inset-0", SCRIM)
|
|
11161
|
-
})]
|
|
11162
|
-
}) : null, /* @__PURE__ */ jsx("div", {
|
|
11459
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
11163
11460
|
className: cn(DEFAULT_CONTAINER, containerClassName),
|
|
11164
11461
|
children: /* @__PURE__ */ jsxs("div", {
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
children: [
|
|
11168
|
-
/* @__PURE__ */ jsx("h2", {
|
|
11169
|
-
className: "font-heading text-3xl font-bold tracking-tight text-balance sm:text-4xl",
|
|
11170
|
-
children: heading
|
|
11171
|
-
}),
|
|
11172
|
-
description ? /* @__PURE__ */ jsx("p", {
|
|
11173
|
-
className: cn("mt-4 max-w-2xl text-lg leading-relaxed", centered && "mx-auto", media ? "text-foreground" : "text-muted-foreground"),
|
|
11174
|
-
children: description
|
|
11175
|
-
}) : null,
|
|
11176
|
-
shown.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
11177
|
-
className: cn("mt-8 flex flex-wrap items-center gap-3", centered && "justify-center"),
|
|
11178
|
-
children: shown.map((action, i) => {
|
|
11179
|
-
const variant = i === 0 ? "default" : "outline";
|
|
11180
|
-
if (!action.href) return /* @__PURE__ */ jsx("span", {
|
|
11181
|
-
className: "px-2 text-base font-medium",
|
|
11182
|
-
children: action.label
|
|
11183
|
-
}, i);
|
|
11184
|
-
return /* @__PURE__ */ jsx(React.Fragment, { children: renderLink({
|
|
11185
|
-
href: action.href,
|
|
11186
|
-
...newTabAttributes(action.newTab),
|
|
11187
|
-
"data-variant": variant,
|
|
11188
|
-
className: cn(buttonVariants({
|
|
11189
|
-
variant,
|
|
11190
|
-
size: "lg"
|
|
11191
|
-
}), "rounded-full"),
|
|
11192
|
-
children: action.label
|
|
11193
|
-
}) }, i);
|
|
11194
|
-
})
|
|
11195
|
-
}) : null
|
|
11196
|
-
]
|
|
11462
|
+
className: "relative isolate overflow-hidden rounded-3xl border border-border bg-card",
|
|
11463
|
+
"data-cta-band-panel": "",
|
|
11464
|
+
children: [backdrop, copy]
|
|
11197
11465
|
})
|
|
11466
|
+
})
|
|
11467
|
+
});
|
|
11468
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
11469
|
+
ref,
|
|
11470
|
+
"data-align": align,
|
|
11471
|
+
className: cn("relative isolate overflow-hidden py-16 lg:py-24", className),
|
|
11472
|
+
...rest,
|
|
11473
|
+
children: [backdrop, /* @__PURE__ */ jsx("div", {
|
|
11474
|
+
className: cn(DEFAULT_CONTAINER, containerClassName),
|
|
11475
|
+
children: copy
|
|
11198
11476
|
})]
|
|
11199
11477
|
});
|
|
11200
11478
|
});
|