@riverbankcms/sdk 0.108.0 → 0.109.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/README.md +21 -1
- package/dist/{PreviewEditorSidebar-BBT-kZAM.mjs → PreviewEditorSidebar-DWqwfy3_.mjs} +7 -22
- package/dist/{PreviewEditorUI-D69xNKT2.mjs → PreviewEditorUI-B7OL4sfR.mjs} +3 -3
- package/dist/{PreviewQueryProvider-RRu7wyQ5.mjs → PreviewQueryProvider-D0y2l8JN.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-CuDjXH6o.mjs → SdkPreviewModeRuntime-D8Gt9Gbe.mjs} +212 -153
- package/dist/{SiteChromeCustomizeContext-BQUY2dEk.mjs → SiteChromeCustomizeContext-DUpalEdL.mjs} +1919 -1032
- package/dist/_dts/ai/src/contracts/proposals.d.ts +11244 -10741
- package/dist/_dts/api/src/bookingAdjustments.d.ts +5 -0
- package/dist/_dts/api/src/bookingOperations.d.ts +4 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +2 -17
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
- package/dist/_dts/api/src/common/envelope.d.ts +7 -0
- package/dist/_dts/api/src/courses.d.ts +1 -0
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/endpoints.d.ts +35 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/participantMessaging.d.ts +18 -12
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +1 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +247 -1
- package/dist/_dts/api/src/siteInfrastructure.d.ts +13 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +1 -5
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +29 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +33 -27
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientField.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientWidget.d.ts +3 -4
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -4
- package/dist/_dts/blocks/src/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/audio-player.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/body-text.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/course-registration.d.ts +1 -22
- package/dist/_dts/blocks/src/system/blocks/cta-full.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -22
- package/dist/_dts/blocks/src/system/blocks/file-download.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/form.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/video-grid.d.ts +3 -0
- package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +16 -6
- package/dist/_dts/blocks/src/system/defineBlock.d.ts +9 -1
- package/dist/_dts/blocks/src/system/fields/ctas.d.ts +8 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +1 -1
- package/dist/_dts/content-model/src/content-types/entryValidation.d.ts +31 -0
- package/dist/_dts/content-model/src/content-types/scaffold.d.ts +58 -0
- package/dist/_dts/content-model/src/content-types/sentinels.d.ts +36 -0
- package/dist/_dts/content-model/src/index.d.ts +3 -0
- package/dist/_dts/core/src/booking-date-time.d.ts +8 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +3071 -3157
- package/dist/_dts/media-core/src/fileMimeDetection.d.ts +16 -0
- package/dist/_dts/media-core/src/fileStorage.d.ts +8 -0
- package/dist/_dts/media-core/src/storagePathDomain.d.ts +2 -0
- package/dist/_dts/media-core/src/uploadVerificationContract.d.ts +3 -0
- package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/audit.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/compare.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/deploy.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/drafts.d.ts +18 -0
- package/dist/_dts/sdk/src/cli/commands/entry.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/commands/init-docs.d.ts +2 -2
- package/dist/_dts/sdk/src/cli/commands/publish-all.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/pull.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +12 -1
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/verify.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/helpers.d.ts +22 -1
- package/dist/_dts/sdk/src/cli/index.d.ts +4 -0
- package/dist/_dts/sdk/src/cli/output.d.ts +88 -0
- package/dist/_dts/sdk/src/cli/program.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/push-config.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/catalog.d.ts +10 -0
- package/dist/_dts/sdk/src/client/management/http.d.ts +7 -1
- package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +43 -19
- package/dist/_dts/sdk/src/date-time/index.d.ts +68 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +893 -823
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/core.d.ts +15 -46
- package/dist/_dts/theme-core/src/buttons/effectClassification.d.ts +147 -0
- package/dist/_dts/theme-core/src/buttons/effects/types.d.ts +2 -3
- package/dist/_dts/theme-core/src/buttons/generateDefaultButtonSystem.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +44 -32
- package/dist/_dts/theme-core/src/buttons/presets.d.ts +4 -25
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +100 -0
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +16 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +101 -83
- package/dist/_dts/theme-core/src/cards/types.d.ts +16 -16
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/gradients/presets.d.ts +200 -8
- package/dist/_dts/theme-core/src/gradients/utils.d.ts +6 -2
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +87 -126
- package/dist/_dts/theme-core/src/mock-themes/modern-minimal.d.ts +1 -1
- package/dist/_dts/theme-core/src/navigation/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -2
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +5 -8
- package/dist/_dts/theme-core/src/palette/index.d.ts +0 -1
- package/dist/_dts/theme-core/src/schema.d.ts +112 -138
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +10 -10
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +3 -2
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +13 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +29 -8
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +2 -2
- package/dist/cli/index.mjs +67956 -66745
- package/dist/cli/init-docs/content/cli-reference.md +50 -7
- package/dist/cli/init-docs/content/content-management.md +7 -4
- package/dist/cli/init-docs/content/workflow-publish.md +5 -1
- package/dist/client/{DiscountCodeDisclosure-D6TOf6Hi.mjs → DiscountCodeDisclosure-DU1ygxU2.mjs} +1 -1
- package/dist/client/{EventCombined.client-Dao3zxRk.mjs → EventCombined.client-DB5zagCo.mjs} +3 -3
- package/dist/client/{EventListing.client-B2NNt4y1.mjs → EventListing.client-CTX9JHBL.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-BhwFo16w.mjs → LeafletStaticMap-BYImhgiB.mjs} +1 -1
- package/dist/client/{MagicLinkForm-BWnB7cMR.mjs → MagicLinkForm-CRkw_M3l.mjs} +2 -2
- package/dist/client/{StepIndicator-TzRiQ0BY.mjs → StepIndicator-BnmVBJJh.mjs} +2 -2
- package/dist/client/{accordion-BPy-AJ4_.mjs → accordion-CeGreumd.mjs} +1 -1
- package/dist/client/{bookingForm-BL4PGZds.mjs → bookingForm-CSzFNrpN.mjs} +6 -6
- package/dist/client/bookings.mjs +512 -252
- package/dist/client/{buttons-EBjyslaX.mjs → buttons-DoFV7KDL.mjs} +493 -230
- package/dist/client/{carousel-C2b7Cn9-.mjs → carousel-B2jDtogf.mjs} +1 -1
- package/dist/client/{cart-BQcbXIVD.mjs → cart-D-jZ-vaY.mjs} +3 -3
- package/dist/client/{checkout-DEmpGRJu.mjs → checkout-Dza-LA7N.mjs} +3 -3
- package/dist/client/client.mjs +1673 -785
- package/dist/client/{colorStyles-jZS6KfkP.mjs → colorStyles-CrgzoXsm.mjs} +1 -30
- package/dist/client/{courseRegistration-BqRZPmsq.mjs → courseRegistration-TYkNychb.mjs} +7 -7
- package/dist/client/{eventCalendar-B8N_tSl5.mjs → eventCalendar-BI_90SsT.mjs} +5 -5
- package/dist/client/{eventCombined-Gjn6gtq7.mjs → eventCombined-mNrpryE9.mjs} +2 -2
- package/dist/client/{eventDetails-M-VCxA-r.mjs → eventDetails-D4GVlCIY.mjs} +3 -3
- package/dist/client/{eventListing-DR19hqYi.mjs → eventListing-YhKN018y.mjs} +2 -2
- package/dist/client/{eventRegistration-BR02a0k3.mjs → eventRegistration-CdHGtilr.mjs} +7 -7
- package/dist/client/foregroundContract-xICPq59x.mjs +31 -0
- package/dist/client/{form-LY2xIbwg.mjs → form-AcAL45rA.mjs} +2 -2
- package/dist/client/{headerSection-CYwwXJfh.mjs → headerSection-uEC52ueD.mjs} +3 -3
- package/dist/client/hooks.mjs +890 -497
- package/dist/client/{locationMap-DWnBXrFq.mjs → locationMap-_wJDSUYe.mjs} +3 -3
- package/dist/client/{media-DHtSxS5V.mjs → media-BK0O3b-U.mjs} +3 -2
- package/dist/client/{newsletterForm-D9s-fQ2P.mjs → newsletterForm-DrArsb2B.mjs} +2 -2
- package/dist/client/{pricing-DDq80oYc.mjs → pricing-BSYVghwo.mjs} +1 -1
- package/dist/client/{productDetail-B0SbWd45.mjs → productDetail-Dyk90sMs.mjs} +3 -3
- package/dist/client/{productList-PwYlZn0y.mjs → productList-BCKThwAI.mjs} +3 -3
- package/dist/client/{propsDecoder-BRWBiH7i.mjs → propsDecoder-CkXxkdSR.mjs} +63 -24
- package/dist/client/rendering/client.mjs +1034 -486
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +1832 -760
- package/dist/client/{shop-CMwZPYME.mjs → shop-DeltVH10.mjs} +6 -6
- package/dist/client/{shop-commerce-BuxsFate.mjs → shop-commerce-BD9Jsm2Z.mjs} +6 -6
- package/dist/client/{shop-commerce-store-boYlEJ91.mjs → shop-commerce-store-CmXD6FDS.mjs} +1 -1
- package/dist/client/{shopShared-D2naaOes.mjs → shopShared-B8v-lH_F.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-D9RHpVoj.mjs → useDiscountCodeUi-DbWJN8ld.mjs} +1 -1
- package/dist/client/{useEventFilters-igGiK1re.mjs → useEventFilters-EJIMUnqT.mjs} +46 -69
- package/dist/client/{usePolling-CI7MbsFB.mjs → usePolling-Cmh14fc7.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +35 -0
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +35 -0
- package/dist/{previewAuthStore-a_cBD28m.mjs → previewAuthStore-CTO7CRPk.mjs} +35 -0
- package/dist/{sdk-runtime-MBzD-GmP.mjs → sdk-runtime-Dou0GAav.mjs} +2 -2
- package/dist/{separator-5ahRBC85.mjs → separator-CI5wZNXT.mjs} +1 -1
- package/dist/server/components.mjs +1832 -784
- package/dist/server/config-validation.mjs +890 -497
- package/dist/server/config.mjs +890 -497
- package/dist/server/data.mjs +890 -497
- package/dist/server/date-time.mjs +386 -0
- package/dist/server/index.mjs +36 -1
- package/dist/server/next.mjs +1868 -785
- package/dist/server/page-converter.mjs +849 -285
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1553 -718
- package/dist/server/rendering.mjs +1832 -784
- package/dist/server/routing.mjs +933 -522
- package/dist/server/server.mjs +929 -501
- package/dist/server/theme-bridge.mjs +1408 -392
- package/dist/server/theme.mjs +471 -228
- package/dist/styles/index.css +5 -0
- package/package.json +7 -1
- package/dist/_dts/theme-core/src/buttons/presets/types.d.ts +0 -88
- package/dist/_dts/theme-core/src/buttons/utils/contrast.d.ts +0 -38
- package/dist/_dts/theme-core/src/palette/themePaletteCompatibility.d.ts +0 -57
|
@@ -275,19 +275,29 @@ function isRecord$33(value) {
|
|
|
275
275
|
//#region ../core/src/booking-date-time.ts
|
|
276
276
|
const DEFAULT_LOCALE = "en-US";
|
|
277
277
|
const FALLBACK_TIMEZONE = "UTC";
|
|
278
|
+
const DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
|
|
279
|
+
const dateTimeFormatterCache = /* @__PURE__ */ new Map();
|
|
280
|
+
const timeZoneValidityCache = /* @__PURE__ */ new Map();
|
|
278
281
|
function isValidTimeZone$1(timeZone) {
|
|
282
|
+
const cached = timeZoneValidityCache.get(timeZone);
|
|
283
|
+
if (cached !== void 0) return cached;
|
|
284
|
+
let isValid;
|
|
279
285
|
try {
|
|
280
286
|
new Intl.DateTimeFormat(DEFAULT_LOCALE, { timeZone }).format(/* @__PURE__ */ new Date());
|
|
281
|
-
|
|
287
|
+
isValid = true;
|
|
282
288
|
} catch {
|
|
283
|
-
|
|
289
|
+
isValid = false;
|
|
284
290
|
}
|
|
291
|
+
if (timeZoneValidityCache.size >= DATE_TIME_FORMATTER_CACHE_LIMIT) timeZoneValidityCache.clear();
|
|
292
|
+
timeZoneValidityCache.set(timeZone, isValid);
|
|
293
|
+
return isValid;
|
|
285
294
|
}
|
|
286
295
|
function getSafeTimeZone(timeZone) {
|
|
287
296
|
const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
|
|
288
297
|
return normalized.length > 0 && isValidTimeZone$1(normalized) ? normalized : FALLBACK_TIMEZONE;
|
|
289
298
|
}
|
|
290
299
|
function parseStrictBookingTimeZone(timeZone) {
|
|
300
|
+
if (typeof timeZone !== "string") return null;
|
|
291
301
|
const normalized = timeZone.trim();
|
|
292
302
|
if (normalized.length === 0 || !isValidTimeZone$1(normalized)) return null;
|
|
293
303
|
return normalized;
|
|
@@ -300,10 +310,19 @@ function formatParseError(error) {
|
|
|
300
310
|
}
|
|
301
311
|
}
|
|
302
312
|
function formatToPartsLookup(date, locale, timeZone, format) {
|
|
303
|
-
return new Map(
|
|
313
|
+
return new Map(getCachedDateTimeFormatter(locale, timeZone, format).formatToParts(date).map((part) => [part.type, part.value]));
|
|
314
|
+
}
|
|
315
|
+
function getCachedDateTimeFormatter(locale, timeZone, format) {
|
|
316
|
+
const key = `${locale}\u0000${timeZone}\u0000${JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)))}`;
|
|
317
|
+
const cached = dateTimeFormatterCache.get(key);
|
|
318
|
+
if (cached !== void 0) return cached;
|
|
319
|
+
const formatter = new Intl.DateTimeFormat(locale, {
|
|
304
320
|
...format,
|
|
305
321
|
timeZone
|
|
306
|
-
})
|
|
322
|
+
});
|
|
323
|
+
if (dateTimeFormatterCache.size >= DATE_TIME_FORMATTER_CACHE_LIMIT) dateTimeFormatterCache.clear();
|
|
324
|
+
dateTimeFormatterCache.set(key, formatter);
|
|
325
|
+
return formatter;
|
|
307
326
|
}
|
|
308
327
|
function getZonedDateTimeParts(date, timeZone) {
|
|
309
328
|
const parts = formatToPartsLookup(date, "en-GB", timeZone, {
|
|
@@ -349,23 +368,9 @@ function toUtcIsoDateTimeString(value) {
|
|
|
349
368
|
return parsed.value;
|
|
350
369
|
}
|
|
351
370
|
function parseScheduledBookingDateTime(input) {
|
|
371
|
+
let startsAt;
|
|
352
372
|
try {
|
|
353
|
-
|
|
354
|
-
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
355
|
-
if (timeZone === null) return {
|
|
356
|
-
ok: false,
|
|
357
|
-
field: "timeZone",
|
|
358
|
-
reason: "invalid_time_zone",
|
|
359
|
-
value: input.timeZone
|
|
360
|
-
};
|
|
361
|
-
return {
|
|
362
|
-
ok: true,
|
|
363
|
-
value: {
|
|
364
|
-
startsAt,
|
|
365
|
-
timeZone,
|
|
366
|
-
locale: input.locale
|
|
367
|
-
}
|
|
368
|
-
};
|
|
373
|
+
startsAt = toUtcIsoDateTimeString(input.startsAt);
|
|
369
374
|
} catch {
|
|
370
375
|
return {
|
|
371
376
|
ok: false,
|
|
@@ -374,6 +379,21 @@ function parseScheduledBookingDateTime(input) {
|
|
|
374
379
|
value: input.startsAt
|
|
375
380
|
};
|
|
376
381
|
}
|
|
382
|
+
const timeZone = parseStrictBookingTimeZone(input.timeZone);
|
|
383
|
+
if (timeZone === null) return {
|
|
384
|
+
ok: false,
|
|
385
|
+
field: "timeZone",
|
|
386
|
+
reason: "invalid_time_zone",
|
|
387
|
+
value: typeof input.timeZone === "string" ? input.timeZone : ""
|
|
388
|
+
};
|
|
389
|
+
return {
|
|
390
|
+
ok: true,
|
|
391
|
+
value: {
|
|
392
|
+
startsAt,
|
|
393
|
+
timeZone,
|
|
394
|
+
locale: input.locale
|
|
395
|
+
}
|
|
396
|
+
};
|
|
377
397
|
}
|
|
378
398
|
function parseScheduledBookingDateRange(input) {
|
|
379
399
|
const start = parseScheduledBookingDateTime(input);
|
|
@@ -412,10 +432,7 @@ function toScheduledBookingDateRange(input) {
|
|
|
412
432
|
function formatBookingInstant(isoString, options) {
|
|
413
433
|
const date = new Date(isoString);
|
|
414
434
|
if (Number.isNaN(date.getTime())) return isoString;
|
|
415
|
-
return
|
|
416
|
-
...options.format,
|
|
417
|
-
timeZone: getSafeTimeZone(options.timeZone)
|
|
418
|
-
}).format(date);
|
|
435
|
+
return getCachedDateTimeFormatter(options.locale ?? DEFAULT_LOCALE, getSafeTimeZone(options.timeZone), options.format).format(date);
|
|
419
436
|
}
|
|
420
437
|
function formatBookingDate(input, format = {
|
|
421
438
|
weekday: "long",
|
|
@@ -578,7 +595,8 @@ function validateRelativeStoragePath(value) {
|
|
|
578
595
|
if (value.startsWith("sites/")) return fail({ tag: "SITE_SCOPED_PATH" });
|
|
579
596
|
if (value.startsWith("/")) return fail({ tag: "LEADING_SLASH" });
|
|
580
597
|
if (value.includes("//")) return fail({ tag: "DOUBLE_SLASH" });
|
|
581
|
-
if (value.
|
|
598
|
+
if (value.includes("%")) return fail({ tag: "PERCENT_ENCODING" });
|
|
599
|
+
if (value.split("/").some((segment) => segment === "." || segment === "..")) return fail({ tag: "TRAVERSAL" });
|
|
582
600
|
return ok$2(value);
|
|
583
601
|
}
|
|
584
602
|
function brandRelativeStoragePath(value) {
|
|
@@ -1895,6 +1913,20 @@ const blockCategoryEnum = z$1.enum([
|
|
|
1895
1913
|
"layout",
|
|
1896
1914
|
"interactive"
|
|
1897
1915
|
]);
|
|
1916
|
+
const blockContentSourceSchema = z$1.object({
|
|
1917
|
+
kind: z$1.enum([
|
|
1918
|
+
"inline",
|
|
1919
|
+
"entries",
|
|
1920
|
+
"mixed"
|
|
1921
|
+
]),
|
|
1922
|
+
contentType: z$1.string().min(1).optional()
|
|
1923
|
+
}).superRefine((value, ctx) => {
|
|
1924
|
+
if (value.kind === "inline" && value.contentType) ctx.addIssue({
|
|
1925
|
+
code: z$1.ZodIssueCode.custom,
|
|
1926
|
+
path: ["contentType"],
|
|
1927
|
+
message: "contentType is not allowed when contentSource.kind is \"inline\""
|
|
1928
|
+
});
|
|
1929
|
+
});
|
|
1898
1930
|
z$1.object({
|
|
1899
1931
|
name: z$1.string().min(1),
|
|
1900
1932
|
version: z$1.string().min(1),
|
|
@@ -1925,6 +1957,12 @@ z$1.object({
|
|
|
1925
1957
|
}).optional()).optional(),
|
|
1926
1958
|
category: blockCategoryEnum.optional(),
|
|
1927
1959
|
contentTypes: z$1.array(z$1.string()).optional(),
|
|
1960
|
+
/**
|
|
1961
|
+
* Explicit content-source classification (inline / entries / mixed). Optional at the
|
|
1962
|
+
* schema level for backward compatibility with SDK-defined custom blocks, but every
|
|
1963
|
+
* registered SYSTEM block must declare it (enforced by a registry-wide test).
|
|
1964
|
+
*/
|
|
1965
|
+
contentSource: blockContentSourceSchema.optional(),
|
|
1928
1966
|
tags: z$1.array(z$1.string()).optional(),
|
|
1929
1967
|
icon: z$1.string().optional()
|
|
1930
1968
|
});
|
|
@@ -3468,7 +3506,7 @@ function normalizeStoredObjectChildren(children, value, ctx) {
|
|
|
3468
3506
|
return normalized;
|
|
3469
3507
|
}
|
|
3470
3508
|
function normalizeStoredRepeaterItems(plan, value, ctx) {
|
|
3471
|
-
if (!isUnknownArray$
|
|
3509
|
+
if (!isUnknownArray$3(value)) return value;
|
|
3472
3510
|
return value.map((item) => {
|
|
3473
3511
|
if (!item || typeof item !== "object" || Array.isArray(item)) return item;
|
|
3474
3512
|
const itemRecord = item;
|
|
@@ -3527,7 +3565,7 @@ function getAtFieldPath(source, path) {
|
|
|
3527
3565
|
}, source);
|
|
3528
3566
|
}
|
|
3529
3567
|
function normalizeRepeaterItems(plan, value, ctx) {
|
|
3530
|
-
if (!isUnknownArray$
|
|
3568
|
+
if (!isUnknownArray$3(value)) return value;
|
|
3531
3569
|
return value.map((item) => {
|
|
3532
3570
|
if (!item || typeof item !== "object" || Array.isArray(item)) return item;
|
|
3533
3571
|
const itemRecord = item;
|
|
@@ -3555,7 +3593,7 @@ function validateNormalizedFieldValue(plan, value, ctx) {
|
|
|
3555
3593
|
case "select": return validateSelectPlan(plan, value);
|
|
3556
3594
|
case "richText": return isValidRichTextDoc(value) ? [] : [issue(plan, "invalidRichText")];
|
|
3557
3595
|
case "inlineText": return validateInlineTextPlan(plan, value);
|
|
3558
|
-
case "media": return isPlainObject$
|
|
3596
|
+
case "media": return isPlainObject$5(value) ? [] : [issue(plan, "invalidMedia")];
|
|
3559
3597
|
case "link": return linkSchema.safeParse(value).success ? [] : [issue(plan, "invalidLink")];
|
|
3560
3598
|
case "repeater": return validateRepeaterPlan(plan, value, ctx);
|
|
3561
3599
|
case "group": return validateGroupPlan(plan, value, ctx);
|
|
@@ -3648,7 +3686,7 @@ function validateRepeaterPlan(plan, value, ctx) {
|
|
|
3648
3686
|
}), ...value.flatMap((item, index) => validateRepeaterItem(plan, item, index, ctx))];
|
|
3649
3687
|
}
|
|
3650
3688
|
function validateRepeaterItem(plan, item, index, ctx) {
|
|
3651
|
-
if (!isPlainObject$
|
|
3689
|
+
if (!isPlainObject$5(item)) return [];
|
|
3652
3690
|
const itemType = item._type;
|
|
3653
3691
|
const fields = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === itemType)?.fields : plan.repeatedItemPlan;
|
|
3654
3692
|
if (!fields) return [];
|
|
@@ -3657,7 +3695,7 @@ function validateRepeaterItem(plan, item, index, ctx) {
|
|
|
3657
3695
|
});
|
|
3658
3696
|
}
|
|
3659
3697
|
function validateGroupPlan(plan, value, ctx) {
|
|
3660
|
-
if (!isPlainObject$
|
|
3698
|
+
if (!isPlainObject$5(value)) return [issue(plan, "wrongType", { expected: "an object" })];
|
|
3661
3699
|
const childCtx = childValidationContext(plan, ctx);
|
|
3662
3700
|
return plan.children.flatMap((childPlan) => validateNormalizedFieldValue(childPlan, value[childPlan.fieldId], childCtx));
|
|
3663
3701
|
}
|
|
@@ -3854,7 +3892,7 @@ function sameFieldPath(left, right) {
|
|
|
3854
3892
|
return left.length === right.length && left.every((segment, index) => segment === right[index]);
|
|
3855
3893
|
}
|
|
3856
3894
|
function validateExplicitNullsForPush(plans, content, ctx) {
|
|
3857
|
-
if (!isPlainObject$
|
|
3895
|
+
if (!isPlainObject$5(content)) return [];
|
|
3858
3896
|
return plans.flatMap((plan) => validateExplicitNullForPushPlan(plan, content[plan.fieldId], ctx));
|
|
3859
3897
|
}
|
|
3860
3898
|
function validateExplicitNullForPushPlan(plan, value, ctx) {
|
|
@@ -3875,9 +3913,9 @@ function validateExplicitNullForPushPlan(plan, value, ctx) {
|
|
|
3875
3913
|
}
|
|
3876
3914
|
}
|
|
3877
3915
|
function validateExplicitNullsForPushRepeater(plan, value, ctx) {
|
|
3878
|
-
if (!isUnknownArray$
|
|
3916
|
+
if (!isUnknownArray$3(value)) return [];
|
|
3879
3917
|
return value.flatMap((item, index) => {
|
|
3880
|
-
if (!isPlainObject$
|
|
3918
|
+
if (!isPlainObject$5(item)) return [];
|
|
3881
3919
|
const childPlans = plan.repeatedItemVariants ? plan.repeatedItemVariants.find((variant) => variant.typeId === item._type)?.fields : plan.repeatedItemPlan;
|
|
3882
3920
|
if (!childPlans) return [];
|
|
3883
3921
|
return childPlans.flatMap((childPlan) => validateExplicitNullForPushPlan(materializeRepeaterItemPlan(childPlan, plan.path, index), item[childPlan.fieldId], ctx));
|
|
@@ -3960,19 +3998,19 @@ function isEmptyValue$1(value) {
|
|
|
3960
3998
|
if (isEmptyRichTextDoc(value)) return true;
|
|
3961
3999
|
return false;
|
|
3962
4000
|
}
|
|
3963
|
-
function isPlainObject$
|
|
4001
|
+
function isPlainObject$5(value) {
|
|
3964
4002
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
3965
4003
|
}
|
|
3966
|
-
function isUnknownArray$
|
|
4004
|
+
function isUnknownArray$3(value) {
|
|
3967
4005
|
return Array.isArray(value);
|
|
3968
4006
|
}
|
|
3969
4007
|
function isValidRichTextDoc(value) {
|
|
3970
4008
|
const doc = richTextDoc(value);
|
|
3971
|
-
return Boolean(isPlainObject$
|
|
4009
|
+
return Boolean(isPlainObject$5(doc) && doc.type === "doc");
|
|
3972
4010
|
}
|
|
3973
4011
|
function isEmptyRichTextDoc(value) {
|
|
3974
4012
|
const doc = richTextDoc(value);
|
|
3975
|
-
if (!isPlainObject$
|
|
4013
|
+
if (!isPlainObject$5(doc)) return false;
|
|
3976
4014
|
if (doc.type !== "doc") return false;
|
|
3977
4015
|
const content = doc.content;
|
|
3978
4016
|
if (!Array.isArray(content) || content.length === 0) return true;
|
|
@@ -3981,8 +4019,8 @@ function isEmptyRichTextDoc(value) {
|
|
|
3981
4019
|
return first?.type === "paragraph" && (!Array.isArray(first.content) || first.content.length === 0);
|
|
3982
4020
|
}
|
|
3983
4021
|
function richTextDoc(value) {
|
|
3984
|
-
if (!isPlainObject$
|
|
3985
|
-
return isPlainObject$
|
|
4022
|
+
if (!isPlainObject$5(value)) return value;
|
|
4023
|
+
return isPlainObject$5(value.doc) ? value.doc : value;
|
|
3986
4024
|
}
|
|
3987
4025
|
//#endregion
|
|
3988
4026
|
//#region ../blocks/src/system/manifest/registry.ts
|
|
@@ -4050,7 +4088,7 @@ function resolveVariantKey(manifest, content) {
|
|
|
4050
4088
|
const clamp01$3 = (x) => Math.max(0, Math.min(1, x));
|
|
4051
4089
|
const mod = (a, n) => (a % n + n) % n;
|
|
4052
4090
|
const deg = (x) => mod(x, 360);
|
|
4053
|
-
function hexToRgb$
|
|
4091
|
+
function hexToRgb$1(hex) {
|
|
4054
4092
|
const h = hex.replace(/^#/, "");
|
|
4055
4093
|
const m = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
|
|
4056
4094
|
if (m.length !== 6) throw new Error("Bad hex");
|
|
@@ -4159,7 +4197,7 @@ function oklchToHexGamut(L, C, h) {
|
|
|
4159
4197
|
return rgbToHex$1(r, g, bb);
|
|
4160
4198
|
}
|
|
4161
4199
|
function featuresFromHex(hex) {
|
|
4162
|
-
const { r, g, b } = hexToRgb$
|
|
4200
|
+
const { r, g, b } = hexToRgb$1(hex);
|
|
4163
4201
|
const { h, s, l } = rgbToHsl$1(r, g, b);
|
|
4164
4202
|
const { L, a, b: b2 } = srgbToOklab(r, g, b);
|
|
4165
4203
|
const { L: okL, C: okC, h: okH } = oklabToOklch(L, a, b2);
|
|
@@ -4186,8 +4224,8 @@ function relativeLuminance(r, g, b) {
|
|
|
4186
4224
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
4187
4225
|
}
|
|
4188
4226
|
function contrastRatio(hex1, hex2) {
|
|
4189
|
-
const { r: r1, g: g1, b: b1 } = hexToRgb$
|
|
4190
|
-
const { r: r2, g: g2, b: b2 } = hexToRgb$
|
|
4227
|
+
const { r: r1, g: g1, b: b1 } = hexToRgb$1(hex1);
|
|
4228
|
+
const { r: r2, g: g2, b: b2 } = hexToRgb$1(hex2);
|
|
4191
4229
|
const L1 = relativeLuminance(r1, g1, b1);
|
|
4192
4230
|
const L2 = relativeLuminance(r2, g2, b2);
|
|
4193
4231
|
const [hi, lo] = L1 >= L2 ? [L1, L2] : [L2, L1];
|
|
@@ -5209,6 +5247,10 @@ const modernMinimalTheme = {
|
|
|
5209
5247
|
name: "primary",
|
|
5210
5248
|
hex: "#1f2937"
|
|
5211
5249
|
},
|
|
5250
|
+
{
|
|
5251
|
+
name: "primaryForeground",
|
|
5252
|
+
hex: "#ffffff"
|
|
5253
|
+
},
|
|
5212
5254
|
{
|
|
5213
5255
|
name: "secondary",
|
|
5214
5256
|
hex: "#6b7280"
|
|
@@ -5237,6 +5279,14 @@ const modernMinimalTheme = {
|
|
|
5237
5279
|
name: "surface",
|
|
5238
5280
|
hex: "#ffffff"
|
|
5239
5281
|
},
|
|
5282
|
+
{
|
|
5283
|
+
name: "surfaceAlt",
|
|
5284
|
+
hex: "#f9fafb"
|
|
5285
|
+
},
|
|
5286
|
+
{
|
|
5287
|
+
name: "muted",
|
|
5288
|
+
hex: "#f3f4f6"
|
|
5289
|
+
},
|
|
5240
5290
|
{
|
|
5241
5291
|
name: "text",
|
|
5242
5292
|
hex: "#1f2937"
|
|
@@ -5345,7 +5395,7 @@ function generateCssVars(palette) {
|
|
|
5345
5395
|
const cssVars = {};
|
|
5346
5396
|
Object.entries(palette).forEach(([key, value]) => {
|
|
5347
5397
|
if (key === "meta" || value === null || value === void 0 || typeof value !== "string") return;
|
|
5348
|
-
const { r, g, b } = hexToRgb$
|
|
5398
|
+
const { r, g, b } = hexToRgb$1(value);
|
|
5349
5399
|
cssVars[`--tb-${key}`] = `${r} ${g} ${b}`;
|
|
5350
5400
|
});
|
|
5351
5401
|
return cssVars;
|
|
@@ -5412,7 +5462,7 @@ function getTextColorForBackground(background) {
|
|
|
5412
5462
|
}
|
|
5413
5463
|
function parseColorToRgb(input) {
|
|
5414
5464
|
const trimmed = input.trim();
|
|
5415
|
-
if (trimmed.startsWith("#")) return hexToRgb$
|
|
5465
|
+
if (trimmed.startsWith("#")) return hexToRgb$1(trimmed);
|
|
5416
5466
|
const rgbMatch = trimmed.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/i);
|
|
5417
5467
|
if (rgbMatch?.[1] && rgbMatch[2] && rgbMatch[3]) return {
|
|
5418
5468
|
r: clamp255(Number(rgbMatch[1])),
|
|
@@ -8636,6 +8686,111 @@ function boundaryKey$1(previousBlockId, nextBlockId) {
|
|
|
8636
8686
|
return makeBoundaryId(previousBlockId, nextBlockId);
|
|
8637
8687
|
}
|
|
8638
8688
|
//#endregion
|
|
8689
|
+
//#region ../theme-core/src/buttons/effectClassification.ts
|
|
8690
|
+
/**
|
|
8691
|
+
* Exhaustive live policy for every registered effect id.
|
|
8692
|
+
*
|
|
8693
|
+
* The resolver consumes the transition payload directly, so adding an effect
|
|
8694
|
+
* cannot update classification without also defining its runtime behavior.
|
|
8695
|
+
*/
|
|
8696
|
+
const BUTTON_EFFECT_POLICIES = {
|
|
8697
|
+
"darken-background": {
|
|
8698
|
+
classification: "colour-transition",
|
|
8699
|
+
transition: {
|
|
8700
|
+
kind: "adjust-shade",
|
|
8701
|
+
direction: "darker"
|
|
8702
|
+
}
|
|
8703
|
+
},
|
|
8704
|
+
"lighten-background": {
|
|
8705
|
+
classification: "colour-transition",
|
|
8706
|
+
transition: {
|
|
8707
|
+
kind: "adjust-shade",
|
|
8708
|
+
direction: "lighter"
|
|
8709
|
+
}
|
|
8710
|
+
},
|
|
8711
|
+
"background-on-hover": {
|
|
8712
|
+
classification: "colour-transition",
|
|
8713
|
+
transition: { kind: "replace-background" }
|
|
8714
|
+
},
|
|
8715
|
+
"background-on-hover-alpha": {
|
|
8716
|
+
classification: "unsupported-colour",
|
|
8717
|
+
reason: "alpha_requires_surface"
|
|
8718
|
+
},
|
|
8719
|
+
"fade-background": {
|
|
8720
|
+
classification: "unsupported-colour",
|
|
8721
|
+
reason: "changes_element_opacity"
|
|
8722
|
+
},
|
|
8723
|
+
"opacity-reduce": {
|
|
8724
|
+
classification: "unsupported-colour",
|
|
8725
|
+
reason: "changes_element_opacity"
|
|
8726
|
+
},
|
|
8727
|
+
"gradient-text": {
|
|
8728
|
+
classification: "unsupported-colour",
|
|
8729
|
+
reason: "changes_foreground"
|
|
8730
|
+
},
|
|
8731
|
+
"text-color-change": {
|
|
8732
|
+
classification: "unsupported-colour",
|
|
8733
|
+
reason: "changes_foreground"
|
|
8734
|
+
},
|
|
8735
|
+
"border-color-change": {
|
|
8736
|
+
classification: "unsupported-colour",
|
|
8737
|
+
reason: "changes_border"
|
|
8738
|
+
},
|
|
8739
|
+
"aurora-glow": {
|
|
8740
|
+
classification: "unsupported-background-overlay",
|
|
8741
|
+
reason: "unresolved_background_overlay"
|
|
8742
|
+
},
|
|
8743
|
+
"cosmic-stardust": {
|
|
8744
|
+
classification: "unsupported-background-overlay",
|
|
8745
|
+
reason: "unresolved_background_overlay"
|
|
8746
|
+
},
|
|
8747
|
+
"gradient-border-fill": {
|
|
8748
|
+
classification: "unsupported-background-overlay",
|
|
8749
|
+
reason: "unresolved_background_overlay"
|
|
8750
|
+
},
|
|
8751
|
+
"animated-gradient-border-fill": {
|
|
8752
|
+
classification: "unsupported-background-overlay",
|
|
8753
|
+
reason: "unresolved_background_overlay"
|
|
8754
|
+
},
|
|
8755
|
+
"nav-underline": {
|
|
8756
|
+
classification: "not-button",
|
|
8757
|
+
reason: "not_button_effect"
|
|
8758
|
+
},
|
|
8759
|
+
"nav-frosted-base": {
|
|
8760
|
+
classification: "not-button",
|
|
8761
|
+
reason: "not_button_effect"
|
|
8762
|
+
},
|
|
8763
|
+
"nav-frosted-hover": {
|
|
8764
|
+
classification: "not-button",
|
|
8765
|
+
reason: "not_button_effect"
|
|
8766
|
+
},
|
|
8767
|
+
"nav-frosted-active": {
|
|
8768
|
+
classification: "not-button",
|
|
8769
|
+
reason: "not_button_effect"
|
|
8770
|
+
},
|
|
8771
|
+
"animated-gradient": { classification: "non-colour" },
|
|
8772
|
+
"border-glow": { classification: "non-colour" },
|
|
8773
|
+
"drop-shadow": { classification: "non-colour" },
|
|
8774
|
+
"inner-shadow": { classification: "non-colour" },
|
|
8775
|
+
"neumorphic-shadow": { classification: "non-colour" },
|
|
8776
|
+
"outer-glow": { classification: "non-colour" },
|
|
8777
|
+
"retro-3d-shadow": { classification: "non-colour" },
|
|
8778
|
+
"scale-up": { classification: "non-colour" },
|
|
8779
|
+
"scale-down": { classification: "non-colour" },
|
|
8780
|
+
lift: { classification: "non-colour" },
|
|
8781
|
+
"press-down": { classification: "non-colour" },
|
|
8782
|
+
pop: { classification: "non-colour" },
|
|
8783
|
+
"border-bottom-grow": { classification: "non-colour" },
|
|
8784
|
+
"sketchy-border": { classification: "non-colour" },
|
|
8785
|
+
"pulse-animation": { classification: "non-colour" }
|
|
8786
|
+
};
|
|
8787
|
+
function getButtonEffectPolicy(effectId) {
|
|
8788
|
+
return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
|
|
8789
|
+
}
|
|
8790
|
+
function classifyButtonEffectId(effectId) {
|
|
8791
|
+
return getButtonEffectPolicy(effectId)?.classification ?? "unknown";
|
|
8792
|
+
}
|
|
8793
|
+
//#endregion
|
|
8639
8794
|
//#region ../theme-core/src/buttons/types.ts
|
|
8640
8795
|
/**
|
|
8641
8796
|
* Standard semantic variant roles a theme exposes.
|
|
@@ -8665,6 +8820,20 @@ function asSpecialVariantId(value) {
|
|
|
8665
8820
|
* Shared between generator and renderer so neither side hard-codes the string.
|
|
8666
8821
|
*/
|
|
8667
8822
|
const DEFAULT_VARIANT_ALIAS_ID = "default";
|
|
8823
|
+
function parseOpaqueButtonColourToken(value) {
|
|
8824
|
+
const token = parseThemeColorToken(value);
|
|
8825
|
+
if (token === null) return null;
|
|
8826
|
+
const parts = parseColorTokenParts(token);
|
|
8827
|
+
return parts.kind === "token" && parts.opacityPercent === null ? token : null;
|
|
8828
|
+
}
|
|
8829
|
+
function unsafeAsOpaqueButtonColourToken(value) {
|
|
8830
|
+
return value;
|
|
8831
|
+
}
|
|
8832
|
+
const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
|
|
8833
|
+
const token = parseOpaqueButtonColourToken(value);
|
|
8834
|
+
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
8835
|
+
return token;
|
|
8836
|
+
});
|
|
8668
8837
|
const cornerStyleSchema = z$1.enum([
|
|
8669
8838
|
"square",
|
|
8670
8839
|
"rounded",
|
|
@@ -8766,7 +8935,7 @@ const buttonSizesSchema = z$1.object({
|
|
|
8766
8935
|
lg,
|
|
8767
8936
|
xl: xl ?? lg
|
|
8768
8937
|
}));
|
|
8769
|
-
const
|
|
8938
|
+
const canonicalButtonGlobalSettingsSchema = z$1.object({
|
|
8770
8939
|
cornerStyle: cornerStyleSchema,
|
|
8771
8940
|
cornerRadius: z$1.number().min(0).max(24).optional(),
|
|
8772
8941
|
/**
|
|
@@ -8797,11 +8966,12 @@ const buttonGlobalSettingsSchema = z$1.object({
|
|
|
8797
8966
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
8798
8967
|
hoverTransform: hoverTransformSchema,
|
|
8799
8968
|
hoverColor: hoverColorSchema,
|
|
8800
|
-
hoverColorToken:
|
|
8969
|
+
hoverColorToken: opaqueButtonColourTokenSchema.optional(),
|
|
8801
8970
|
gradientStyle: gradientStyleSchema.optional(),
|
|
8802
8971
|
gradientAngle: z$1.number().min(0).max(360).optional(),
|
|
8803
8972
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
8804
8973
|
});
|
|
8974
|
+
const buttonGlobalSettingsSchema = z$1.preprocess(normalizeLegacyButtonGlobalInput, canonicalButtonGlobalSettingsSchema);
|
|
8805
8975
|
const gradientDirectionSchema$1 = z$1.enum([
|
|
8806
8976
|
"to-r",
|
|
8807
8977
|
"to-l",
|
|
@@ -8815,27 +8985,33 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
8815
8985
|
const buttonBackgroundSchema = z$1.discriminatedUnion("type", [
|
|
8816
8986
|
z$1.object({
|
|
8817
8987
|
type: z$1.literal("solid"),
|
|
8818
|
-
colorToken:
|
|
8988
|
+
colorToken: opaqueButtonColourTokenSchema
|
|
8819
8989
|
}),
|
|
8820
8990
|
z$1.object({
|
|
8821
8991
|
type: z$1.literal("gradient"),
|
|
8822
|
-
stops: z$1.array(
|
|
8823
|
-
|
|
8992
|
+
stops: z$1.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
8993
|
+
const [first, second, ...rest] = stops;
|
|
8994
|
+
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
8995
|
+
return [
|
|
8996
|
+
first,
|
|
8997
|
+
second,
|
|
8998
|
+
...rest
|
|
8999
|
+
];
|
|
9000
|
+
}),
|
|
9001
|
+
direction: gradientDirectionSchema$1,
|
|
9002
|
+
foregroundToken: opaqueButtonColourTokenSchema
|
|
8824
9003
|
}),
|
|
8825
|
-
z$1.object({
|
|
9004
|
+
z$1.object({
|
|
9005
|
+
type: z$1.literal("surface"),
|
|
9006
|
+
role: z$1.literal("link")
|
|
9007
|
+
})
|
|
8826
9008
|
]);
|
|
8827
9009
|
const effectApplicationSchema$1 = z$1.object({
|
|
8828
9010
|
effectId: z$1.string(),
|
|
8829
|
-
options: z$1.record(z$1.string(), z$1.
|
|
8830
|
-
});
|
|
8831
|
-
const buttonBorderSchema = z$1.object({
|
|
8832
|
-
widthClass: z$1.string(),
|
|
8833
|
-
colorToken: themeColorTokenSchema
|
|
8834
|
-
});
|
|
8835
|
-
const buttonVariantAffordanceSchema = z$1.object({
|
|
8836
|
-
iconId: z$1.string().min(1),
|
|
8837
|
-
colorToken: themeColorTokenSchema.optional()
|
|
9011
|
+
options: z$1.record(z$1.string(), z$1.json()).optional()
|
|
8838
9012
|
});
|
|
9013
|
+
const buttonBorderSchema = z$1.object({ widthClass: z$1.string() });
|
|
9014
|
+
const buttonVariantAffordanceSchema = z$1.object({ iconId: z$1.string().min(1) });
|
|
8839
9015
|
const variantShadowSchema = z$1.object({
|
|
8840
9016
|
elevation: z$1.enum([
|
|
8841
9017
|
"none",
|
|
@@ -8876,27 +9052,170 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
8876
9052
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
8877
9053
|
* every size).
|
|
8878
9054
|
*/
|
|
8879
|
-
const
|
|
9055
|
+
const canonicalButtonVariantSchema = z$1.object({
|
|
8880
9056
|
id: z$1.string(),
|
|
8881
9057
|
name: z$1.string().min(1).max(20),
|
|
8882
9058
|
enabled: z$1.boolean(),
|
|
8883
9059
|
priority: prioritySchema,
|
|
8884
9060
|
background: buttonBackgroundSchema,
|
|
8885
|
-
textColorToken: themeColorTokenSchema,
|
|
8886
9061
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
8887
9062
|
borderRadius: z$1.string().optional(),
|
|
8888
9063
|
shadow: variantShadowSchema.optional(),
|
|
8889
9064
|
border: buttonBorderSchema.optional(),
|
|
8890
|
-
hoverBackgroundToken:
|
|
9065
|
+
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
8891
9066
|
effects: variantEffectsSchema.optional(),
|
|
8892
9067
|
sizes: variantSizeOverridesSchema.optional(),
|
|
8893
9068
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
8894
9069
|
});
|
|
9070
|
+
/**
|
|
9071
|
+
* Temporary persisted-theme admission boundary for issue #1206.
|
|
9072
|
+
*
|
|
9073
|
+
* Production inventory on 2026-07-22 found 22 rows using the old independent
|
|
9074
|
+
* `textColorToken`/border colour shape. New source and all downstream code use
|
|
9075
|
+
* only the canonical relationship. Delete this preprocessor after the reviewed
|
|
9076
|
+
* production rewrite reports zero legacy rows.
|
|
9077
|
+
*/
|
|
9078
|
+
const buttonVariantSchema = z$1.preprocess(normalizeLegacyButtonVariantInput, canonicalButtonVariantSchema);
|
|
8895
9079
|
const buttonSystemSchema = z$1.object({
|
|
8896
9080
|
global: buttonGlobalSettingsSchema,
|
|
8897
9081
|
variants: z$1.array(buttonVariantSchema).min(1).max(6),
|
|
8898
9082
|
sizes: buttonSizesSchema.optional()
|
|
8899
9083
|
});
|
|
9084
|
+
function normalizeLegacyButtonVariantInput(input) {
|
|
9085
|
+
if (!isUnknownRecord(input)) return input;
|
|
9086
|
+
const background = input.background;
|
|
9087
|
+
if (!isUnknownRecord(background)) return input;
|
|
9088
|
+
if (!(background.type === "transparent" || Object.prototype.hasOwnProperty.call(input, "textColorToken") || isUnknownRecord(input.border) && Object.prototype.hasOwnProperty.call(input.border, "colorToken") || hasLegacyButtonEffects(input.effects) || hasLegacyAlphaToken(input, background))) return input;
|
|
9089
|
+
const { textColorToken, ...withoutLegacyText } = input;
|
|
9090
|
+
const normalizedBorder = isUnknownRecord(input.border) && typeof input.border.widthClass === "string" ? { widthClass: input.border.widthClass } : input.border;
|
|
9091
|
+
const normalizedAffordance = isUnknownRecord(input.affordance) && typeof input.affordance.iconId === "string" ? { iconId: input.affordance.iconId } : input.affordance;
|
|
9092
|
+
const normalizedEffects = normalizeLegacyButtonEffects(input.effects, background.type);
|
|
9093
|
+
const hoverBackgroundToken = stripLegacyTokenAlpha(input.hoverBackgroundToken);
|
|
9094
|
+
if (background.type === "transparent") return {
|
|
9095
|
+
...withoutLegacyText,
|
|
9096
|
+
background: {
|
|
9097
|
+
type: "surface",
|
|
9098
|
+
role: "link"
|
|
9099
|
+
},
|
|
9100
|
+
border: normalizedBorder,
|
|
9101
|
+
affordance: normalizedAffordance,
|
|
9102
|
+
effects: normalizedEffects,
|
|
9103
|
+
hoverBackgroundToken
|
|
9104
|
+
};
|
|
9105
|
+
if (background.type === "gradient") {
|
|
9106
|
+
const stops = Array.isArray(background.stops) ? background.stops.map(stripLegacyTokenAlpha) : background.stops;
|
|
9107
|
+
return {
|
|
9108
|
+
...withoutLegacyText,
|
|
9109
|
+
background: {
|
|
9110
|
+
...background,
|
|
9111
|
+
stops,
|
|
9112
|
+
foregroundToken: stripLegacyTokenAlpha(background.foregroundToken ?? textColorToken)
|
|
9113
|
+
},
|
|
9114
|
+
border: normalizedBorder,
|
|
9115
|
+
affordance: normalizedAffordance,
|
|
9116
|
+
effects: normalizedEffects,
|
|
9117
|
+
hoverBackgroundToken
|
|
9118
|
+
};
|
|
9119
|
+
}
|
|
9120
|
+
return {
|
|
9121
|
+
...withoutLegacyText,
|
|
9122
|
+
background: background.type === "solid" ? {
|
|
9123
|
+
...background,
|
|
9124
|
+
colorToken: stripLegacyTokenAlpha(background.colorToken)
|
|
9125
|
+
} : background,
|
|
9126
|
+
border: normalizedBorder,
|
|
9127
|
+
affordance: normalizedAffordance,
|
|
9128
|
+
effects: normalizedEffects,
|
|
9129
|
+
hoverBackgroundToken
|
|
9130
|
+
};
|
|
9131
|
+
}
|
|
9132
|
+
function normalizeLegacyButtonGlobalInput(input) {
|
|
9133
|
+
if (!isUnknownRecord(input)) return input;
|
|
9134
|
+
const hoverColorToken = stripLegacyTokenAlpha(input.hoverColorToken);
|
|
9135
|
+
return hoverColorToken === input.hoverColorToken ? input : {
|
|
9136
|
+
...input,
|
|
9137
|
+
hoverColorToken
|
|
9138
|
+
};
|
|
9139
|
+
}
|
|
9140
|
+
function hasLegacyAlphaToken(input, background) {
|
|
9141
|
+
const stops = isUnknownArray$2(background.stops) ? background.stops : [];
|
|
9142
|
+
return [
|
|
9143
|
+
input.hoverBackgroundToken,
|
|
9144
|
+
background.colorToken,
|
|
9145
|
+
background.foregroundToken,
|
|
9146
|
+
...stops
|
|
9147
|
+
].some((token) => stripLegacyTokenAlpha(token) !== token);
|
|
9148
|
+
}
|
|
9149
|
+
function stripLegacyTokenAlpha(value) {
|
|
9150
|
+
if (typeof value !== "string") return value;
|
|
9151
|
+
const slashIndex = value.indexOf("/");
|
|
9152
|
+
return slashIndex < 0 ? value : value.slice(0, slashIndex);
|
|
9153
|
+
}
|
|
9154
|
+
function hasLegacyButtonEffects(input) {
|
|
9155
|
+
if (!isUnknownRecord(input)) return false;
|
|
9156
|
+
return [
|
|
9157
|
+
"base",
|
|
9158
|
+
"hover",
|
|
9159
|
+
"active",
|
|
9160
|
+
"focus"
|
|
9161
|
+
].some((state) => {
|
|
9162
|
+
const effects = input[state];
|
|
9163
|
+
return Array.isArray(effects) && effects.some((effect) => {
|
|
9164
|
+
if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return true;
|
|
9165
|
+
const classification = classifyButtonEffectId(effect.effectId);
|
|
9166
|
+
if (classification !== "colour-transition" && classification !== "non-colour") return true;
|
|
9167
|
+
return effect.effectId === "background-on-hover" && isUnknownRecord(effect.options) && stripLegacyTokenAlpha(effect.options.colorToken) !== effect.options.colorToken;
|
|
9168
|
+
});
|
|
9169
|
+
});
|
|
9170
|
+
}
|
|
9171
|
+
function normalizeLegacyButtonEffects(input, backgroundType) {
|
|
9172
|
+
if (!isUnknownRecord(input)) return input;
|
|
9173
|
+
const normalized = {};
|
|
9174
|
+
for (const state of [
|
|
9175
|
+
"base",
|
|
9176
|
+
"hover",
|
|
9177
|
+
"active",
|
|
9178
|
+
"focus"
|
|
9179
|
+
]) {
|
|
9180
|
+
const effects = input[state];
|
|
9181
|
+
if (!Array.isArray(effects)) continue;
|
|
9182
|
+
const safeEffects = effects.flatMap((effect) => {
|
|
9183
|
+
if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return [];
|
|
9184
|
+
const classification = classifyButtonEffectId(effect.effectId);
|
|
9185
|
+
if (classification === "non-colour") return [effect];
|
|
9186
|
+
if (classification !== "colour-transition") return [];
|
|
9187
|
+
if (effect.effectId === "background-on-hover") {
|
|
9188
|
+
const options = isUnknownRecord(effect.options) ? effect.options : null;
|
|
9189
|
+
const colorToken = options === null ? null : parseOpaqueButtonColourToken(stripLegacyTokenAlpha(options.colorToken));
|
|
9190
|
+
return colorToken === null ? [] : [{
|
|
9191
|
+
...effect,
|
|
9192
|
+
options: {
|
|
9193
|
+
...options,
|
|
9194
|
+
colorToken
|
|
9195
|
+
}
|
|
9196
|
+
}];
|
|
9197
|
+
}
|
|
9198
|
+
if (backgroundType !== "solid") return [];
|
|
9199
|
+
const rawAmount = isUnknownRecord(effect.options) ? effect.options.amount : void 0;
|
|
9200
|
+
const amount = typeof rawAmount === "number" && rawAmount > 0 ? Math.max(100, Math.round(rawAmount / 100) * 100) : 100;
|
|
9201
|
+
return [{
|
|
9202
|
+
...effect,
|
|
9203
|
+
options: {
|
|
9204
|
+
...isUnknownRecord(effect.options) ? effect.options : {},
|
|
9205
|
+
amount
|
|
9206
|
+
}
|
|
9207
|
+
}];
|
|
9208
|
+
});
|
|
9209
|
+
if (safeEffects.length > 0) normalized[state] = safeEffects;
|
|
9210
|
+
}
|
|
9211
|
+
return Object.keys(normalized).length === 0 ? void 0 : normalized;
|
|
9212
|
+
}
|
|
9213
|
+
function isUnknownRecord(value) {
|
|
9214
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9215
|
+
}
|
|
9216
|
+
function isUnknownArray$2(value) {
|
|
9217
|
+
return Array.isArray(value);
|
|
9218
|
+
}
|
|
8900
9219
|
//#endregion
|
|
8901
9220
|
//#region ../theme-core/src/buttons/personalities/types.ts
|
|
8902
9221
|
function asButtonPersonalityId(value) {
|
|
@@ -8922,7 +9241,7 @@ function defineButtonPersonality(input) {
|
|
|
8922
9241
|
name: input.name,
|
|
8923
9242
|
description: input.description,
|
|
8924
9243
|
tags: input.tags,
|
|
8925
|
-
buttonSystem: input.buttonSystem
|
|
9244
|
+
buttonSystem: buttonSystemSchema.parse(input.buttonSystem)
|
|
8926
9245
|
};
|
|
8927
9246
|
}
|
|
8928
9247
|
//#endregion
|
|
@@ -8975,19 +9294,15 @@ const brushedWash = defineButtonPersonality({
|
|
|
8975
9294
|
background: {
|
|
8976
9295
|
type: "gradient",
|
|
8977
9296
|
stops: ["primary", "accent"],
|
|
8978
|
-
direction: "to-r"
|
|
9297
|
+
direction: "to-r",
|
|
9298
|
+
foregroundToken: "primaryForeground"
|
|
8979
9299
|
},
|
|
8980
|
-
textColorToken: "primaryForeground",
|
|
8981
9300
|
borderRadius: "rounded-lg",
|
|
8982
9301
|
shadow: {
|
|
8983
9302
|
elevation: "low",
|
|
8984
9303
|
softness: "soft",
|
|
8985
9304
|
position: "bottom"
|
|
8986
|
-
}
|
|
8987
|
-
effects: { hover: [{
|
|
8988
|
-
effectId: "opacity-reduce",
|
|
8989
|
-
options: { reduction: -15 }
|
|
8990
|
-
}] }
|
|
9305
|
+
}
|
|
8991
9306
|
},
|
|
8992
9307
|
{
|
|
8993
9308
|
id: "secondary",
|
|
@@ -8997,32 +9312,27 @@ const brushedWash = defineButtonPersonality({
|
|
|
8997
9312
|
background: {
|
|
8998
9313
|
type: "gradient",
|
|
8999
9314
|
stops: ["secondary", "accent"],
|
|
9000
|
-
direction: "to-br"
|
|
9315
|
+
direction: "to-br",
|
|
9316
|
+
foregroundToken: "primaryForeground"
|
|
9001
9317
|
},
|
|
9002
|
-
textColorToken: "primaryForeground",
|
|
9003
9318
|
borderRadius: "rounded-lg",
|
|
9004
9319
|
shadow: {
|
|
9005
9320
|
elevation: "low",
|
|
9006
9321
|
softness: "soft",
|
|
9007
9322
|
position: "bottom"
|
|
9008
|
-
}
|
|
9009
|
-
effects: { hover: [{
|
|
9010
|
-
effectId: "opacity-reduce",
|
|
9011
|
-
options: { reduction: -15 }
|
|
9012
|
-
}] }
|
|
9323
|
+
}
|
|
9013
9324
|
},
|
|
9014
9325
|
{
|
|
9015
9326
|
id: "outline",
|
|
9016
9327
|
name: "Outline",
|
|
9017
9328
|
enabled: true,
|
|
9018
9329
|
priority: 3,
|
|
9019
|
-
background: {
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
border: {
|
|
9023
|
-
widthClass: "border",
|
|
9024
|
-
colorToken: "primary"
|
|
9330
|
+
background: {
|
|
9331
|
+
type: "surface",
|
|
9332
|
+
role: "link"
|
|
9025
9333
|
},
|
|
9334
|
+
borderRadius: "rounded-lg",
|
|
9335
|
+
border: { widthClass: "border" },
|
|
9026
9336
|
effects: { hover: [{
|
|
9027
9337
|
effectId: "background-on-hover",
|
|
9028
9338
|
options: { colorToken: "surface" }
|
|
@@ -9033,8 +9343,10 @@ const brushedWash = defineButtonPersonality({
|
|
|
9033
9343
|
name: "Ghost",
|
|
9034
9344
|
enabled: true,
|
|
9035
9345
|
priority: 3,
|
|
9036
|
-
background: {
|
|
9037
|
-
|
|
9346
|
+
background: {
|
|
9347
|
+
type: "surface",
|
|
9348
|
+
role: "link"
|
|
9349
|
+
},
|
|
9038
9350
|
borderRadius: "rounded-lg",
|
|
9039
9351
|
effects: { hover: [{
|
|
9040
9352
|
effectId: "background-on-hover",
|
|
@@ -9080,7 +9392,6 @@ const confidentChip = defineButtonPersonality({
|
|
|
9080
9392
|
type: "solid",
|
|
9081
9393
|
colorToken: "primary"
|
|
9082
9394
|
},
|
|
9083
|
-
textColorToken: "primaryForeground",
|
|
9084
9395
|
borderRadius: "rounded-md",
|
|
9085
9396
|
shadow: {
|
|
9086
9397
|
elevation: "medium",
|
|
@@ -9090,7 +9401,7 @@ const confidentChip = defineButtonPersonality({
|
|
|
9090
9401
|
effects: {
|
|
9091
9402
|
hover: [{
|
|
9092
9403
|
effectId: "darken-background",
|
|
9093
|
-
options: { amount:
|
|
9404
|
+
options: { amount: 100 }
|
|
9094
9405
|
}],
|
|
9095
9406
|
active: [{
|
|
9096
9407
|
effectId: "scale-down",
|
|
@@ -9107,12 +9418,8 @@ const confidentChip = defineButtonPersonality({
|
|
|
9107
9418
|
type: "solid",
|
|
9108
9419
|
colorToken: "surface"
|
|
9109
9420
|
},
|
|
9110
|
-
textColorToken: "text",
|
|
9111
9421
|
borderRadius: "rounded-md",
|
|
9112
|
-
border: {
|
|
9113
|
-
widthClass: "border",
|
|
9114
|
-
colorToken: "border"
|
|
9115
|
-
},
|
|
9422
|
+
border: { widthClass: "border" },
|
|
9116
9423
|
effects: { hover: [{
|
|
9117
9424
|
effectId: "background-on-hover",
|
|
9118
9425
|
options: { colorToken: "background" }
|
|
@@ -9123,13 +9430,12 @@ const confidentChip = defineButtonPersonality({
|
|
|
9123
9430
|
name: "Outline",
|
|
9124
9431
|
enabled: true,
|
|
9125
9432
|
priority: 3,
|
|
9126
|
-
background: {
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
border: {
|
|
9130
|
-
widthClass: "border",
|
|
9131
|
-
colorToken: "primary"
|
|
9433
|
+
background: {
|
|
9434
|
+
type: "surface",
|
|
9435
|
+
role: "link"
|
|
9132
9436
|
},
|
|
9437
|
+
borderRadius: "rounded-md",
|
|
9438
|
+
border: { widthClass: "border" },
|
|
9133
9439
|
effects: { hover: [{
|
|
9134
9440
|
effectId: "background-on-hover",
|
|
9135
9441
|
options: { colorToken: "surface" }
|
|
@@ -9140,8 +9446,10 @@ const confidentChip = defineButtonPersonality({
|
|
|
9140
9446
|
name: "Ghost",
|
|
9141
9447
|
enabled: true,
|
|
9142
9448
|
priority: 3,
|
|
9143
|
-
background: {
|
|
9144
|
-
|
|
9449
|
+
background: {
|
|
9450
|
+
type: "surface",
|
|
9451
|
+
role: "link"
|
|
9452
|
+
},
|
|
9145
9453
|
borderRadius: "rounded-md",
|
|
9146
9454
|
effects: { hover: [{
|
|
9147
9455
|
effectId: "background-on-hover",
|
|
@@ -9204,7 +9512,6 @@ const earthPill = defineButtonPersonality({
|
|
|
9204
9512
|
type: "solid",
|
|
9205
9513
|
colorToken: "primary"
|
|
9206
9514
|
},
|
|
9207
|
-
textColorToken: "primaryForeground",
|
|
9208
9515
|
borderRadius: "rounded-full",
|
|
9209
9516
|
shadow: {
|
|
9210
9517
|
elevation: "low",
|
|
@@ -9230,13 +9537,12 @@ const earthPill = defineButtonPersonality({
|
|
|
9230
9537
|
name: "Secondary",
|
|
9231
9538
|
enabled: true,
|
|
9232
9539
|
priority: 2,
|
|
9233
|
-
background: {
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
border: {
|
|
9237
|
-
widthClass: "border",
|
|
9238
|
-
colorToken: "primary"
|
|
9540
|
+
background: {
|
|
9541
|
+
type: "surface",
|
|
9542
|
+
role: "link"
|
|
9239
9543
|
},
|
|
9544
|
+
borderRadius: "rounded-full",
|
|
9545
|
+
border: { widthClass: "border" },
|
|
9240
9546
|
effects: { hover: [{
|
|
9241
9547
|
effectId: "background-on-hover",
|
|
9242
9548
|
options: { colorToken: "muted" }
|
|
@@ -9247,13 +9553,12 @@ const earthPill = defineButtonPersonality({
|
|
|
9247
9553
|
name: "Outline",
|
|
9248
9554
|
enabled: true,
|
|
9249
9555
|
priority: 3,
|
|
9250
|
-
background: {
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
border: {
|
|
9254
|
-
widthClass: "border",
|
|
9255
|
-
colorToken: "border"
|
|
9556
|
+
background: {
|
|
9557
|
+
type: "surface",
|
|
9558
|
+
role: "link"
|
|
9256
9559
|
},
|
|
9560
|
+
borderRadius: "rounded-full",
|
|
9561
|
+
border: { widthClass: "border" },
|
|
9257
9562
|
effects: { hover: [{
|
|
9258
9563
|
effectId: "background-on-hover",
|
|
9259
9564
|
options: { colorToken: "surfaceAlt" }
|
|
@@ -9264,8 +9569,10 @@ const earthPill = defineButtonPersonality({
|
|
|
9264
9569
|
name: "Ghost",
|
|
9265
9570
|
enabled: true,
|
|
9266
9571
|
priority: 3,
|
|
9267
|
-
background: {
|
|
9268
|
-
|
|
9572
|
+
background: {
|
|
9573
|
+
type: "surface",
|
|
9574
|
+
role: "link"
|
|
9575
|
+
},
|
|
9269
9576
|
borderRadius: "rounded-full",
|
|
9270
9577
|
shadow: {
|
|
9271
9578
|
elevation: "none",
|
|
@@ -9286,11 +9593,7 @@ const earthPill = defineButtonPersonality({
|
|
|
9286
9593
|
padding: "0.625rem 0",
|
|
9287
9594
|
fontSize: "text-xl"
|
|
9288
9595
|
}
|
|
9289
|
-
}
|
|
9290
|
-
effects: { hover: [{
|
|
9291
|
-
effectId: "opacity-reduce",
|
|
9292
|
-
options: { reduction: 25 }
|
|
9293
|
-
}] }
|
|
9596
|
+
}
|
|
9294
9597
|
}
|
|
9295
9598
|
]
|
|
9296
9599
|
}
|
|
@@ -9326,8 +9629,10 @@ const editorialLink = defineButtonPersonality({
|
|
|
9326
9629
|
name: "Primary",
|
|
9327
9630
|
enabled: true,
|
|
9328
9631
|
priority: 1,
|
|
9329
|
-
background: {
|
|
9330
|
-
|
|
9632
|
+
background: {
|
|
9633
|
+
type: "surface",
|
|
9634
|
+
role: "link"
|
|
9635
|
+
},
|
|
9331
9636
|
borderRadius: "rounded-none",
|
|
9332
9637
|
sizes: {
|
|
9333
9638
|
sm: { padding: "0.25rem 0" },
|
|
@@ -9349,8 +9654,10 @@ const editorialLink = defineButtonPersonality({
|
|
|
9349
9654
|
name: "Secondary",
|
|
9350
9655
|
enabled: true,
|
|
9351
9656
|
priority: 2,
|
|
9352
|
-
background: {
|
|
9353
|
-
|
|
9657
|
+
background: {
|
|
9658
|
+
type: "surface",
|
|
9659
|
+
role: "link"
|
|
9660
|
+
},
|
|
9354
9661
|
borderRadius: "rounded-none",
|
|
9355
9662
|
sizes: {
|
|
9356
9663
|
sm: { padding: "0.25rem 0" },
|
|
@@ -9372,8 +9679,10 @@ const editorialLink = defineButtonPersonality({
|
|
|
9372
9679
|
name: "Outline",
|
|
9373
9680
|
enabled: true,
|
|
9374
9681
|
priority: 3,
|
|
9375
|
-
background: {
|
|
9376
|
-
|
|
9682
|
+
background: {
|
|
9683
|
+
type: "surface",
|
|
9684
|
+
role: "link"
|
|
9685
|
+
},
|
|
9377
9686
|
borderRadius: "rounded-none",
|
|
9378
9687
|
sizes: {
|
|
9379
9688
|
sm: { padding: "0.25rem 0" },
|
|
@@ -9395,19 +9704,17 @@ const editorialLink = defineButtonPersonality({
|
|
|
9395
9704
|
name: "Ghost",
|
|
9396
9705
|
enabled: true,
|
|
9397
9706
|
priority: 3,
|
|
9398
|
-
background: {
|
|
9399
|
-
|
|
9707
|
+
background: {
|
|
9708
|
+
type: "surface",
|
|
9709
|
+
role: "link"
|
|
9710
|
+
},
|
|
9400
9711
|
borderRadius: "rounded-none",
|
|
9401
9712
|
sizes: {
|
|
9402
9713
|
sm: { padding: "0.25rem 0" },
|
|
9403
9714
|
md: { padding: "0.5rem 0" },
|
|
9404
9715
|
lg: { padding: "0.625rem 0" },
|
|
9405
9716
|
xl: { padding: "0.75rem 0" }
|
|
9406
|
-
}
|
|
9407
|
-
effects: { hover: [{
|
|
9408
|
-
effectId: "opacity-reduce",
|
|
9409
|
-
options: { reduction: -20 }
|
|
9410
|
-
}] }
|
|
9717
|
+
}
|
|
9411
9718
|
}
|
|
9412
9719
|
]
|
|
9413
9720
|
}
|
|
@@ -9469,12 +9776,8 @@ const flatInk = defineButtonPersonality({
|
|
|
9469
9776
|
type: "solid",
|
|
9470
9777
|
colorToken: "primary"
|
|
9471
9778
|
},
|
|
9472
|
-
textColorToken: "primaryForeground",
|
|
9473
9779
|
borderRadius: "rounded-lg",
|
|
9474
|
-
affordance: {
|
|
9475
|
-
iconId: "ArrowRight",
|
|
9476
|
-
colorToken: "accent"
|
|
9477
|
-
},
|
|
9780
|
+
affordance: { iconId: "ArrowRight" },
|
|
9478
9781
|
effects: { hover: [{
|
|
9479
9782
|
effectId: "lift",
|
|
9480
9783
|
options: { translateY: "-2px" }
|
|
@@ -9488,13 +9791,12 @@ const flatInk = defineButtonPersonality({
|
|
|
9488
9791
|
name: "Secondary",
|
|
9489
9792
|
enabled: true,
|
|
9490
9793
|
priority: 2,
|
|
9491
|
-
background: {
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
border: {
|
|
9495
|
-
widthClass: "border",
|
|
9496
|
-
colorToken: "border"
|
|
9794
|
+
background: {
|
|
9795
|
+
type: "surface",
|
|
9796
|
+
role: "link"
|
|
9497
9797
|
},
|
|
9798
|
+
borderRadius: "rounded-lg",
|
|
9799
|
+
border: { widthClass: "border" },
|
|
9498
9800
|
effects: { hover: [{
|
|
9499
9801
|
effectId: "lift",
|
|
9500
9802
|
options: { translateY: "-2px" }
|
|
@@ -9512,12 +9814,8 @@ const flatInk = defineButtonPersonality({
|
|
|
9512
9814
|
type: "solid",
|
|
9513
9815
|
colorToken: "accent"
|
|
9514
9816
|
},
|
|
9515
|
-
textColorToken: "accentForeground",
|
|
9516
9817
|
borderRadius: "rounded-lg",
|
|
9517
|
-
affordance: {
|
|
9518
|
-
iconId: "ArrowRight",
|
|
9519
|
-
colorToken: "accentForeground"
|
|
9520
|
-
},
|
|
9818
|
+
affordance: { iconId: "ArrowRight" },
|
|
9521
9819
|
effects: { hover: [{
|
|
9522
9820
|
effectId: "lift",
|
|
9523
9821
|
options: { translateY: "-2px" }
|
|
@@ -9580,7 +9878,6 @@ const inkStamp = defineButtonPersonality({
|
|
|
9580
9878
|
type: "solid",
|
|
9581
9879
|
colorToken: "primary"
|
|
9582
9880
|
},
|
|
9583
|
-
textColorToken: "primaryForeground",
|
|
9584
9881
|
borderRadius: "rounded-md",
|
|
9585
9882
|
effects: {
|
|
9586
9883
|
hover: [{
|
|
@@ -9601,13 +9898,12 @@ const inkStamp = defineButtonPersonality({
|
|
|
9601
9898
|
name: "Secondary",
|
|
9602
9899
|
enabled: true,
|
|
9603
9900
|
priority: 2,
|
|
9604
|
-
background: {
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
border: {
|
|
9608
|
-
widthClass: "border-2",
|
|
9609
|
-
colorToken: "primary"
|
|
9901
|
+
background: {
|
|
9902
|
+
type: "surface",
|
|
9903
|
+
role: "link"
|
|
9610
9904
|
},
|
|
9905
|
+
borderRadius: "rounded-md",
|
|
9906
|
+
border: { widthClass: "border-2" },
|
|
9611
9907
|
effects: { hover: [{
|
|
9612
9908
|
effectId: "background-on-hover",
|
|
9613
9909
|
options: { colorToken: "surface" }
|
|
@@ -9618,13 +9914,12 @@ const inkStamp = defineButtonPersonality({
|
|
|
9618
9914
|
name: "Outline",
|
|
9619
9915
|
enabled: true,
|
|
9620
9916
|
priority: 3,
|
|
9621
|
-
background: {
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
border: {
|
|
9625
|
-
widthClass: "border-2",
|
|
9626
|
-
colorToken: "border"
|
|
9917
|
+
background: {
|
|
9918
|
+
type: "surface",
|
|
9919
|
+
role: "link"
|
|
9627
9920
|
},
|
|
9921
|
+
borderRadius: "rounded-md",
|
|
9922
|
+
border: { widthClass: "border-2" },
|
|
9628
9923
|
effects: { hover: [{
|
|
9629
9924
|
effectId: "background-on-hover",
|
|
9630
9925
|
options: { colorToken: "surface" }
|
|
@@ -9635,8 +9930,10 @@ const inkStamp = defineButtonPersonality({
|
|
|
9635
9930
|
name: "Ghost",
|
|
9636
9931
|
enabled: true,
|
|
9637
9932
|
priority: 3,
|
|
9638
|
-
background: {
|
|
9639
|
-
|
|
9933
|
+
background: {
|
|
9934
|
+
type: "surface",
|
|
9935
|
+
role: "link"
|
|
9936
|
+
},
|
|
9640
9937
|
borderRadius: "rounded-none",
|
|
9641
9938
|
sizes: {
|
|
9642
9939
|
sm: {
|
|
@@ -9729,7 +10026,6 @@ const joyStamp = defineButtonPersonality({
|
|
|
9729
10026
|
type: "solid",
|
|
9730
10027
|
colorToken: "primary"
|
|
9731
10028
|
},
|
|
9732
|
-
textColorToken: "primaryForeground",
|
|
9733
10029
|
borderRadius: "rounded-full",
|
|
9734
10030
|
shadow: {
|
|
9735
10031
|
elevation: "high",
|
|
@@ -9743,13 +10039,12 @@ const joyStamp = defineButtonPersonality({
|
|
|
9743
10039
|
name: "Secondary",
|
|
9744
10040
|
enabled: true,
|
|
9745
10041
|
priority: 2,
|
|
9746
|
-
background: {
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
border: {
|
|
9750
|
-
widthClass: "border-2",
|
|
9751
|
-
colorToken: "text"
|
|
10042
|
+
background: {
|
|
10043
|
+
type: "surface",
|
|
10044
|
+
role: "link"
|
|
9752
10045
|
},
|
|
10046
|
+
borderRadius: "rounded-full",
|
|
10047
|
+
border: { widthClass: "border-2" },
|
|
9753
10048
|
shadow: {
|
|
9754
10049
|
elevation: "high",
|
|
9755
10050
|
softness: "hard",
|
|
@@ -9814,12 +10109,8 @@ const ornateRitual = defineButtonPersonality({
|
|
|
9814
10109
|
type: "solid",
|
|
9815
10110
|
colorToken: "primary"
|
|
9816
10111
|
},
|
|
9817
|
-
textColorToken: "primaryForeground",
|
|
9818
10112
|
borderRadius: "rounded-md",
|
|
9819
|
-
border: {
|
|
9820
|
-
widthClass: "border",
|
|
9821
|
-
colorToken: "primary"
|
|
9822
|
-
},
|
|
10113
|
+
border: { widthClass: "border" },
|
|
9823
10114
|
effects: {
|
|
9824
10115
|
hover: [{
|
|
9825
10116
|
effectId: "background-on-hover",
|
|
@@ -9840,12 +10131,8 @@ const ornateRitual = defineButtonPersonality({
|
|
|
9840
10131
|
type: "solid",
|
|
9841
10132
|
colorToken: "secondary"
|
|
9842
10133
|
},
|
|
9843
|
-
textColorToken: "primaryForeground",
|
|
9844
10134
|
borderRadius: "rounded-md",
|
|
9845
|
-
border: {
|
|
9846
|
-
widthClass: "border",
|
|
9847
|
-
colorToken: "primary"
|
|
9848
|
-
},
|
|
10135
|
+
border: { widthClass: "border" },
|
|
9849
10136
|
effects: { hover: [{
|
|
9850
10137
|
effectId: "background-on-hover",
|
|
9851
10138
|
options: { colorToken: "surface" }
|
|
@@ -9856,13 +10143,12 @@ const ornateRitual = defineButtonPersonality({
|
|
|
9856
10143
|
name: "Outline",
|
|
9857
10144
|
enabled: true,
|
|
9858
10145
|
priority: 3,
|
|
9859
|
-
background: {
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
border: {
|
|
9863
|
-
widthClass: "border",
|
|
9864
|
-
colorToken: "primary"
|
|
10146
|
+
background: {
|
|
10147
|
+
type: "surface",
|
|
10148
|
+
role: "link"
|
|
9865
10149
|
},
|
|
10150
|
+
borderRadius: "rounded-md",
|
|
10151
|
+
border: { widthClass: "border" },
|
|
9866
10152
|
effects: { hover: [{
|
|
9867
10153
|
effectId: "background-on-hover",
|
|
9868
10154
|
options: { colorToken: "muted" }
|
|
@@ -9873,8 +10159,10 @@ const ornateRitual = defineButtonPersonality({
|
|
|
9873
10159
|
name: "Ghost",
|
|
9874
10160
|
enabled: true,
|
|
9875
10161
|
priority: 3,
|
|
9876
|
-
background: {
|
|
9877
|
-
|
|
10162
|
+
background: {
|
|
10163
|
+
type: "surface",
|
|
10164
|
+
role: "link"
|
|
10165
|
+
},
|
|
9878
10166
|
borderRadius: "rounded-none",
|
|
9879
10167
|
sizes: {
|
|
9880
10168
|
sm: {
|
|
@@ -9956,14 +10244,10 @@ const pebble = defineButtonPersonality({
|
|
|
9956
10244
|
type: "solid",
|
|
9957
10245
|
colorToken: "primary"
|
|
9958
10246
|
},
|
|
9959
|
-
textColorToken: "primaryForeground",
|
|
9960
10247
|
borderRadius: "rounded-full",
|
|
9961
10248
|
effects: { hover: [{
|
|
9962
|
-
effectId: "background
|
|
9963
|
-
options: {
|
|
9964
|
-
colorToken: "primary",
|
|
9965
|
-
opacity: 88
|
|
9966
|
-
}
|
|
10249
|
+
effectId: "darken-background",
|
|
10250
|
+
options: { amount: 100 }
|
|
9967
10251
|
}] }
|
|
9968
10252
|
},
|
|
9969
10253
|
{
|
|
@@ -9971,13 +10255,12 @@ const pebble = defineButtonPersonality({
|
|
|
9971
10255
|
name: "Secondary",
|
|
9972
10256
|
enabled: true,
|
|
9973
10257
|
priority: 2,
|
|
9974
|
-
background: {
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
border: {
|
|
9978
|
-
widthClass: "border-2",
|
|
9979
|
-
colorToken: "accent"
|
|
10258
|
+
background: {
|
|
10259
|
+
type: "surface",
|
|
10260
|
+
role: "link"
|
|
9980
10261
|
},
|
|
10262
|
+
borderRadius: "rounded-full",
|
|
10263
|
+
border: { widthClass: "border-2" },
|
|
9981
10264
|
effects: { hover: [{
|
|
9982
10265
|
effectId: "background-on-hover",
|
|
9983
10266
|
options: { colorToken: "accent" }
|
|
@@ -9988,13 +10271,12 @@ const pebble = defineButtonPersonality({
|
|
|
9988
10271
|
name: "Outline",
|
|
9989
10272
|
enabled: true,
|
|
9990
10273
|
priority: 3,
|
|
9991
|
-
background: {
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
border: {
|
|
9995
|
-
widthClass: "border",
|
|
9996
|
-
colorToken: "border"
|
|
10274
|
+
background: {
|
|
10275
|
+
type: "surface",
|
|
10276
|
+
role: "link"
|
|
9997
10277
|
},
|
|
10278
|
+
borderRadius: "rounded-full",
|
|
10279
|
+
border: { widthClass: "border" },
|
|
9998
10280
|
effects: { hover: [{
|
|
9999
10281
|
effectId: "background-on-hover",
|
|
10000
10282
|
options: { colorToken: "surface" }
|
|
@@ -10005,8 +10287,10 @@ const pebble = defineButtonPersonality({
|
|
|
10005
10287
|
name: "Ghost",
|
|
10006
10288
|
enabled: true,
|
|
10007
10289
|
priority: 3,
|
|
10008
|
-
background: {
|
|
10009
|
-
|
|
10290
|
+
background: {
|
|
10291
|
+
type: "surface",
|
|
10292
|
+
role: "link"
|
|
10293
|
+
},
|
|
10010
10294
|
borderRadius: "rounded-full",
|
|
10011
10295
|
sizes: {
|
|
10012
10296
|
sm: {
|
|
@@ -10022,11 +10306,7 @@ const pebble = defineButtonPersonality({
|
|
|
10022
10306
|
padding: "0.75rem 1.5rem",
|
|
10023
10307
|
fontSize: "text-xl"
|
|
10024
10308
|
}
|
|
10025
|
-
}
|
|
10026
|
-
effects: { hover: [{
|
|
10027
|
-
effectId: "opacity-reduce",
|
|
10028
|
-
options: { reduction: 30 }
|
|
10029
|
-
}] }
|
|
10309
|
+
}
|
|
10030
10310
|
}
|
|
10031
10311
|
]
|
|
10032
10312
|
}
|
|
@@ -10088,15 +10368,11 @@ const quietArrow = defineButtonPersonality({
|
|
|
10088
10368
|
type: "solid",
|
|
10089
10369
|
colorToken: "primary"
|
|
10090
10370
|
},
|
|
10091
|
-
textColorToken: "primaryForeground",
|
|
10092
10371
|
borderRadius: "rounded-xl",
|
|
10093
10372
|
affordance: { iconId: "ArrowRight" },
|
|
10094
10373
|
effects: { hover: [{
|
|
10095
|
-
effectId: "background
|
|
10096
|
-
options: {
|
|
10097
|
-
colorToken: "primary",
|
|
10098
|
-
opacity: 90
|
|
10099
|
-
}
|
|
10374
|
+
effectId: "darken-background",
|
|
10375
|
+
options: { amount: 100 }
|
|
10100
10376
|
}] }
|
|
10101
10377
|
},
|
|
10102
10378
|
{
|
|
@@ -10104,13 +10380,12 @@ const quietArrow = defineButtonPersonality({
|
|
|
10104
10380
|
name: "Secondary",
|
|
10105
10381
|
enabled: true,
|
|
10106
10382
|
priority: 2,
|
|
10107
|
-
background: {
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
border: {
|
|
10111
|
-
widthClass: "border",
|
|
10112
|
-
colorToken: "primary"
|
|
10383
|
+
background: {
|
|
10384
|
+
type: "surface",
|
|
10385
|
+
role: "link"
|
|
10113
10386
|
},
|
|
10387
|
+
borderRadius: "rounded-xl",
|
|
10388
|
+
border: { widthClass: "border" },
|
|
10114
10389
|
affordance: { iconId: "ArrowRight" },
|
|
10115
10390
|
effects: { hover: [{
|
|
10116
10391
|
effectId: "background-on-hover",
|
|
@@ -10122,21 +10397,22 @@ const quietArrow = defineButtonPersonality({
|
|
|
10122
10397
|
name: "Outline",
|
|
10123
10398
|
enabled: true,
|
|
10124
10399
|
priority: 3,
|
|
10125
|
-
background: {
|
|
10126
|
-
|
|
10400
|
+
background: {
|
|
10401
|
+
type: "surface",
|
|
10402
|
+
role: "link"
|
|
10403
|
+
},
|
|
10127
10404
|
borderRadius: "rounded-xl",
|
|
10128
|
-
border: {
|
|
10129
|
-
widthClass: "border",
|
|
10130
|
-
colorToken: "primary"
|
|
10131
|
-
}
|
|
10405
|
+
border: { widthClass: "border" }
|
|
10132
10406
|
},
|
|
10133
10407
|
{
|
|
10134
10408
|
id: "ghost",
|
|
10135
10409
|
name: "Ghost",
|
|
10136
10410
|
enabled: true,
|
|
10137
10411
|
priority: 3,
|
|
10138
|
-
background: {
|
|
10139
|
-
|
|
10412
|
+
background: {
|
|
10413
|
+
type: "surface",
|
|
10414
|
+
role: "link"
|
|
10415
|
+
},
|
|
10140
10416
|
borderRadius: "rounded-xl"
|
|
10141
10417
|
}
|
|
10142
10418
|
]
|
|
@@ -10200,7 +10476,6 @@ const showtimePill = defineButtonPersonality({
|
|
|
10200
10476
|
type: "solid",
|
|
10201
10477
|
colorToken: "primary"
|
|
10202
10478
|
},
|
|
10203
|
-
textColorToken: "background",
|
|
10204
10479
|
borderRadius: "rounded-full",
|
|
10205
10480
|
effects: { hover: [{ effectId: "pop" }] }
|
|
10206
10481
|
},
|
|
@@ -10209,13 +10484,12 @@ const showtimePill = defineButtonPersonality({
|
|
|
10209
10484
|
name: "Secondary",
|
|
10210
10485
|
enabled: true,
|
|
10211
10486
|
priority: 2,
|
|
10212
|
-
background: {
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
border: {
|
|
10216
|
-
widthClass: "border-2",
|
|
10217
|
-
colorToken: "primary"
|
|
10487
|
+
background: {
|
|
10488
|
+
type: "surface",
|
|
10489
|
+
role: "link"
|
|
10218
10490
|
},
|
|
10491
|
+
borderRadius: "rounded-full",
|
|
10492
|
+
border: { widthClass: "border-2" },
|
|
10219
10493
|
effects: { hover: [{ effectId: "pop" }] }
|
|
10220
10494
|
},
|
|
10221
10495
|
{
|
|
@@ -10227,7 +10501,6 @@ const showtimePill = defineButtonPersonality({
|
|
|
10227
10501
|
type: "solid",
|
|
10228
10502
|
colorToken: "secondary"
|
|
10229
10503
|
},
|
|
10230
|
-
textColorToken: "primary",
|
|
10231
10504
|
borderRadius: "rounded-full",
|
|
10232
10505
|
effects: { hover: [{ effectId: "pop" }] }
|
|
10233
10506
|
},
|
|
@@ -10240,12 +10513,8 @@ const showtimePill = defineButtonPersonality({
|
|
|
10240
10513
|
type: "solid",
|
|
10241
10514
|
colorToken: "background"
|
|
10242
10515
|
},
|
|
10243
|
-
textColorToken: "primary",
|
|
10244
10516
|
borderRadius: "rounded-full",
|
|
10245
|
-
border: {
|
|
10246
|
-
widthClass: "border-2",
|
|
10247
|
-
colorToken: "primary"
|
|
10248
|
-
},
|
|
10517
|
+
border: { widthClass: "border-2" },
|
|
10249
10518
|
effects: { hover: [{
|
|
10250
10519
|
effectId: "background-on-hover",
|
|
10251
10520
|
options: { colorToken: "surface" }
|
|
@@ -10256,13 +10525,12 @@ const showtimePill = defineButtonPersonality({
|
|
|
10256
10525
|
name: "Outline",
|
|
10257
10526
|
enabled: true,
|
|
10258
10527
|
priority: 3,
|
|
10259
|
-
background: {
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
border: {
|
|
10263
|
-
widthClass: "border-2",
|
|
10264
|
-
colorToken: "primary"
|
|
10528
|
+
background: {
|
|
10529
|
+
type: "surface",
|
|
10530
|
+
role: "link"
|
|
10265
10531
|
},
|
|
10532
|
+
borderRadius: "rounded-full",
|
|
10533
|
+
border: { widthClass: "border-2" },
|
|
10266
10534
|
effects: { hover: [{
|
|
10267
10535
|
effectId: "background-on-hover",
|
|
10268
10536
|
options: { colorToken: "background" }
|
|
@@ -10273,8 +10541,10 @@ const showtimePill = defineButtonPersonality({
|
|
|
10273
10541
|
name: "Ghost",
|
|
10274
10542
|
enabled: true,
|
|
10275
10543
|
priority: 3,
|
|
10276
|
-
background: {
|
|
10277
|
-
|
|
10544
|
+
background: {
|
|
10545
|
+
type: "surface",
|
|
10546
|
+
role: "link"
|
|
10547
|
+
},
|
|
10278
10548
|
borderRadius: "rounded-full",
|
|
10279
10549
|
effects: { hover: [{
|
|
10280
10550
|
effectId: "background-on-hover",
|
|
@@ -10320,7 +10590,6 @@ const softPill = defineButtonPersonality({
|
|
|
10320
10590
|
type: "solid",
|
|
10321
10591
|
colorToken: "primary"
|
|
10322
10592
|
},
|
|
10323
|
-
textColorToken: "primaryForeground",
|
|
10324
10593
|
borderRadius: "rounded-full",
|
|
10325
10594
|
shadow: {
|
|
10326
10595
|
elevation: "low",
|
|
@@ -10343,13 +10612,12 @@ const softPill = defineButtonPersonality({
|
|
|
10343
10612
|
name: "Secondary",
|
|
10344
10613
|
enabled: true,
|
|
10345
10614
|
priority: 2,
|
|
10346
|
-
background: {
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
border: {
|
|
10350
|
-
widthClass: "border-2",
|
|
10351
|
-
colorToken: "primary"
|
|
10615
|
+
background: {
|
|
10616
|
+
type: "surface",
|
|
10617
|
+
role: "link"
|
|
10352
10618
|
},
|
|
10619
|
+
borderRadius: "rounded-full",
|
|
10620
|
+
border: { widthClass: "border-2" },
|
|
10353
10621
|
effects: { hover: [{
|
|
10354
10622
|
effectId: "background-on-hover",
|
|
10355
10623
|
options: { colorToken: "surface" }
|
|
@@ -10360,13 +10628,12 @@ const softPill = defineButtonPersonality({
|
|
|
10360
10628
|
name: "Outline",
|
|
10361
10629
|
enabled: true,
|
|
10362
10630
|
priority: 3,
|
|
10363
|
-
background: {
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
border: {
|
|
10367
|
-
widthClass: "border",
|
|
10368
|
-
colorToken: "border"
|
|
10631
|
+
background: {
|
|
10632
|
+
type: "surface",
|
|
10633
|
+
role: "link"
|
|
10369
10634
|
},
|
|
10635
|
+
borderRadius: "rounded-full",
|
|
10636
|
+
border: { widthClass: "border" },
|
|
10370
10637
|
effects: { hover: [{
|
|
10371
10638
|
effectId: "background-on-hover",
|
|
10372
10639
|
options: { colorToken: "surface" }
|
|
@@ -10377,8 +10644,10 @@ const softPill = defineButtonPersonality({
|
|
|
10377
10644
|
name: "Ghost",
|
|
10378
10645
|
enabled: true,
|
|
10379
10646
|
priority: 3,
|
|
10380
|
-
background: {
|
|
10381
|
-
|
|
10647
|
+
background: {
|
|
10648
|
+
type: "surface",
|
|
10649
|
+
role: "link"
|
|
10650
|
+
},
|
|
10382
10651
|
borderRadius: "rounded-full",
|
|
10383
10652
|
effects: { hover: [{
|
|
10384
10653
|
effectId: "background-on-hover",
|
|
@@ -10397,9 +10666,8 @@ const solidSecondary = {
|
|
|
10397
10666
|
priority: 2,
|
|
10398
10667
|
background: {
|
|
10399
10668
|
type: "solid",
|
|
10400
|
-
colorToken: "secondary"
|
|
10669
|
+
colorToken: unsafeAsOpaqueButtonColourToken("secondary")
|
|
10401
10670
|
},
|
|
10402
|
-
textColorToken: "onSecondary",
|
|
10403
10671
|
borderRadius: "rounded-full",
|
|
10404
10672
|
shadow: {
|
|
10405
10673
|
elevation: "none",
|
|
@@ -10832,6 +11100,282 @@ const serifDisplayQuote = { style: "serif-display" };
|
|
|
10832
11100
|
/** Punchy quotation mark in the secondary accent colour. Bold / accent styles. */
|
|
10833
11101
|
const accentGlyphQuote = { style: "accent-glyph" };
|
|
10834
11102
|
//#endregion
|
|
11103
|
+
//#region ../theme-core/src/gradients/types.ts
|
|
11104
|
+
/**
|
|
11105
|
+
* Gradient configuration types and schemas
|
|
11106
|
+
*/
|
|
11107
|
+
/**
|
|
11108
|
+
* Gradient color stop
|
|
11109
|
+
*/
|
|
11110
|
+
const gradientStopSchema = z$1.object({
|
|
11111
|
+
color: themeColorTokenSchema,
|
|
11112
|
+
position: z$1.number().min(0).max(100)
|
|
11113
|
+
});
|
|
11114
|
+
/**
|
|
11115
|
+
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
11116
|
+
* so existing radial gradients are byte-identical.
|
|
11117
|
+
*
|
|
11118
|
+
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
11119
|
+
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
11120
|
+
*/
|
|
11121
|
+
const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
11122
|
+
/**
|
|
11123
|
+
* Gradient configuration.
|
|
11124
|
+
*
|
|
11125
|
+
* `type` is optional and defaults to `'linear'` so gradients persisted without a
|
|
11126
|
+
* type (or with an explicit `'linear'`) render exactly as before. `'radial'` and
|
|
11127
|
+
* `'conic'` are additive kinds:
|
|
11128
|
+
* - linear: `angle` (degrees)
|
|
11129
|
+
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
11130
|
+
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
11131
|
+
*/
|
|
11132
|
+
const gradientConfigSchema = z$1.object({
|
|
11133
|
+
type: z$1.enum([
|
|
11134
|
+
"linear",
|
|
11135
|
+
"radial",
|
|
11136
|
+
"conic"
|
|
11137
|
+
]).default("linear"),
|
|
11138
|
+
angle: z$1.number().min(0).max(360).optional(),
|
|
11139
|
+
shape: radialGradientShapeSchema.optional(),
|
|
11140
|
+
position: z$1.string().optional(),
|
|
11141
|
+
stops: z$1.array(gradientStopSchema).min(2)
|
|
11142
|
+
});
|
|
11143
|
+
/**
|
|
11144
|
+
* Curated library of gradient presets.
|
|
11145
|
+
* All gradients use theme color tokens, so they adapt to the site's palette.
|
|
11146
|
+
*/
|
|
11147
|
+
const GRADIENT_PRESETS = [
|
|
11148
|
+
{
|
|
11149
|
+
id: "primary-secondary",
|
|
11150
|
+
name: "Primary to Secondary",
|
|
11151
|
+
description: "Blend your primary and secondary brand colors",
|
|
11152
|
+
type: "linear",
|
|
11153
|
+
angle: 135,
|
|
11154
|
+
stops: [{
|
|
11155
|
+
color: "primary-500",
|
|
11156
|
+
position: 0
|
|
11157
|
+
}, {
|
|
11158
|
+
color: "secondary-500",
|
|
11159
|
+
position: 100
|
|
11160
|
+
}]
|
|
11161
|
+
},
|
|
11162
|
+
{
|
|
11163
|
+
id: "primary-accent",
|
|
11164
|
+
name: "Primary to Accent",
|
|
11165
|
+
description: "Energetic gradient from primary to accent",
|
|
11166
|
+
type: "linear",
|
|
11167
|
+
angle: 135,
|
|
11168
|
+
stops: [{
|
|
11169
|
+
color: "primary-500",
|
|
11170
|
+
position: 0
|
|
11171
|
+
}, {
|
|
11172
|
+
color: "accent-500",
|
|
11173
|
+
position: 100
|
|
11174
|
+
}]
|
|
11175
|
+
},
|
|
11176
|
+
{
|
|
11177
|
+
id: "secondary-accent",
|
|
11178
|
+
name: "Secondary to Accent",
|
|
11179
|
+
description: "Vibrant secondary to accent blend",
|
|
11180
|
+
type: "linear",
|
|
11181
|
+
angle: 135,
|
|
11182
|
+
stops: [{
|
|
11183
|
+
color: "secondary-500",
|
|
11184
|
+
position: 0
|
|
11185
|
+
}, {
|
|
11186
|
+
color: "accent-500",
|
|
11187
|
+
position: 100
|
|
11188
|
+
}]
|
|
11189
|
+
},
|
|
11190
|
+
{
|
|
11191
|
+
id: "primary-light-dark",
|
|
11192
|
+
name: "Primary Light to Dark",
|
|
11193
|
+
description: "Subtle primary color fade",
|
|
11194
|
+
type: "linear",
|
|
11195
|
+
angle: 180,
|
|
11196
|
+
stops: [{
|
|
11197
|
+
color: "primary-500",
|
|
11198
|
+
position: 0
|
|
11199
|
+
}, {
|
|
11200
|
+
color: "primary-900",
|
|
11201
|
+
position: 100
|
|
11202
|
+
}]
|
|
11203
|
+
},
|
|
11204
|
+
{
|
|
11205
|
+
id: "primary-dark-light",
|
|
11206
|
+
name: "Primary Dark to Light",
|
|
11207
|
+
description: "Reverse primary fade",
|
|
11208
|
+
type: "linear",
|
|
11209
|
+
angle: 180,
|
|
11210
|
+
stops: [{
|
|
11211
|
+
color: "primary-900",
|
|
11212
|
+
position: 0
|
|
11213
|
+
}, {
|
|
11214
|
+
color: "primary-50",
|
|
11215
|
+
position: 100
|
|
11216
|
+
}]
|
|
11217
|
+
},
|
|
11218
|
+
{
|
|
11219
|
+
id: "secondary-light-dark",
|
|
11220
|
+
name: "Secondary Light to Dark",
|
|
11221
|
+
description: "Subtle secondary color fade",
|
|
11222
|
+
type: "linear",
|
|
11223
|
+
angle: 180,
|
|
11224
|
+
stops: [{
|
|
11225
|
+
color: "secondary-500",
|
|
11226
|
+
position: 0
|
|
11227
|
+
}, {
|
|
11228
|
+
color: "secondary-900",
|
|
11229
|
+
position: 100
|
|
11230
|
+
}]
|
|
11231
|
+
},
|
|
11232
|
+
{
|
|
11233
|
+
id: "accent-light-dark",
|
|
11234
|
+
name: "Accent Light to Dark",
|
|
11235
|
+
description: "Accent color depth fade",
|
|
11236
|
+
type: "linear",
|
|
11237
|
+
angle: 180,
|
|
11238
|
+
stops: [{
|
|
11239
|
+
color: "accent-500",
|
|
11240
|
+
position: 0
|
|
11241
|
+
}, {
|
|
11242
|
+
color: "accent-900",
|
|
11243
|
+
position: 100
|
|
11244
|
+
}]
|
|
11245
|
+
},
|
|
11246
|
+
{
|
|
11247
|
+
id: "background-surface",
|
|
11248
|
+
name: "Background to Surface",
|
|
11249
|
+
description: "Subtle depth using base colors",
|
|
11250
|
+
type: "linear",
|
|
11251
|
+
angle: 180,
|
|
11252
|
+
stops: [{
|
|
11253
|
+
color: "background",
|
|
11254
|
+
position: 0
|
|
11255
|
+
}, {
|
|
11256
|
+
color: "surface",
|
|
11257
|
+
position: 100
|
|
11258
|
+
}]
|
|
11259
|
+
},
|
|
11260
|
+
{
|
|
11261
|
+
id: "neutral-fade",
|
|
11262
|
+
name: "Neutral Gradient",
|
|
11263
|
+
description: "Elegant neutral color fade",
|
|
11264
|
+
type: "linear",
|
|
11265
|
+
angle: 180,
|
|
11266
|
+
stops: [{
|
|
11267
|
+
color: "neutral-900",
|
|
11268
|
+
position: 0
|
|
11269
|
+
}, {
|
|
11270
|
+
color: "neutral-50",
|
|
11271
|
+
position: 100
|
|
11272
|
+
}]
|
|
11273
|
+
},
|
|
11274
|
+
{
|
|
11275
|
+
id: "primary-glow",
|
|
11276
|
+
name: "Primary glow",
|
|
11277
|
+
description: "A soft top-centred glow using your primary palette",
|
|
11278
|
+
type: "radial",
|
|
11279
|
+
shape: "ellipse",
|
|
11280
|
+
position: "top center",
|
|
11281
|
+
stops: [{
|
|
11282
|
+
color: "primary-900",
|
|
11283
|
+
position: 0
|
|
11284
|
+
}, {
|
|
11285
|
+
color: "primary-950",
|
|
11286
|
+
position: 100
|
|
11287
|
+
}],
|
|
11288
|
+
foreground: {
|
|
11289
|
+
textColor: "onPrimary900",
|
|
11290
|
+
headingColor: "onPrimary900",
|
|
11291
|
+
linkColor: "onPrimary900",
|
|
11292
|
+
supportingColor: "onPrimary900"
|
|
11293
|
+
}
|
|
11294
|
+
},
|
|
11295
|
+
{
|
|
11296
|
+
id: "accent-glow",
|
|
11297
|
+
name: "Accent glow",
|
|
11298
|
+
description: "A soft top-centred glow using your accent palette",
|
|
11299
|
+
type: "radial",
|
|
11300
|
+
shape: "ellipse",
|
|
11301
|
+
position: "top center",
|
|
11302
|
+
stops: [{
|
|
11303
|
+
color: "accent-900",
|
|
11304
|
+
position: 0
|
|
11305
|
+
}, {
|
|
11306
|
+
color: "accent-950",
|
|
11307
|
+
position: 100
|
|
11308
|
+
}],
|
|
11309
|
+
foreground: {
|
|
11310
|
+
textColor: "onAccent900",
|
|
11311
|
+
headingColor: "onAccent900",
|
|
11312
|
+
linkColor: "onAccent900",
|
|
11313
|
+
supportingColor: "onAccent900"
|
|
11314
|
+
}
|
|
11315
|
+
},
|
|
11316
|
+
{
|
|
11317
|
+
id: "primary-secondary-accent",
|
|
11318
|
+
name: "Brand Trio",
|
|
11319
|
+
description: "All three brand colors in harmony",
|
|
11320
|
+
type: "linear",
|
|
11321
|
+
angle: 135,
|
|
11322
|
+
stops: [
|
|
11323
|
+
{
|
|
11324
|
+
color: "primary-500",
|
|
11325
|
+
position: 0
|
|
11326
|
+
},
|
|
11327
|
+
{
|
|
11328
|
+
color: "secondary-500",
|
|
11329
|
+
position: 50
|
|
11330
|
+
},
|
|
11331
|
+
{
|
|
11332
|
+
color: "accent-500",
|
|
11333
|
+
position: 100
|
|
11334
|
+
}
|
|
11335
|
+
]
|
|
11336
|
+
}
|
|
11337
|
+
].map((preset) => ({
|
|
11338
|
+
...preset,
|
|
11339
|
+
id: preset.id,
|
|
11340
|
+
stops: preset.stops
|
|
11341
|
+
}));
|
|
11342
|
+
const GRADIENT_PRESET_IDS = GRADIENT_PRESETS.map((preset) => preset.id);
|
|
11343
|
+
const gradientPresetIdSet = new Set(GRADIENT_PRESET_IDS);
|
|
11344
|
+
const gradientPresetById = Object.fromEntries(GRADIENT_PRESETS.map((preset) => [preset.id, preset]));
|
|
11345
|
+
function parseGradientPresetId(value) {
|
|
11346
|
+
if (typeof value !== "string") return null;
|
|
11347
|
+
const normalized = value.trim();
|
|
11348
|
+
if (!gradientPresetIdSet.has(normalized)) return null;
|
|
11349
|
+
return normalized;
|
|
11350
|
+
}
|
|
11351
|
+
function getGradientPreset(id) {
|
|
11352
|
+
return gradientPresetById[id];
|
|
11353
|
+
}
|
|
11354
|
+
//#endregion
|
|
11355
|
+
//#region ../theme-core/src/gradients/utils.ts
|
|
11356
|
+
/**
|
|
11357
|
+
* Convert a GradientConfig to a CSS gradient string
|
|
11358
|
+
*
|
|
11359
|
+
* @param config - The gradient configuration using theme tokens
|
|
11360
|
+
* @param tokens - Map of theme color tokens to hex values
|
|
11361
|
+
* @returns CSS gradient string (e.g., "linear-gradient(180deg, #3b82f6 0%, #f59e0b 100%)")
|
|
11362
|
+
*/
|
|
11363
|
+
function gradientToCss(config, tokens) {
|
|
11364
|
+
const stops = config.stops.map((stop) => {
|
|
11365
|
+
return `${tokens[stop.color] ?? "#000000"} ${stop.position}%`;
|
|
11366
|
+
}).join(", ");
|
|
11367
|
+
const type = config.type ?? "linear";
|
|
11368
|
+
if (type === "radial") {
|
|
11369
|
+
const position = config.position ?? "center";
|
|
11370
|
+
return `radial-gradient(${config.shape ?? "circle"} at ${position}, ${stops})`;
|
|
11371
|
+
}
|
|
11372
|
+
if (type === "conic") {
|
|
11373
|
+
const position = config.position ?? "center";
|
|
11374
|
+
return `conic-gradient(from ${config.angle ?? 0}deg at ${position}, ${stops})`;
|
|
11375
|
+
}
|
|
11376
|
+
return `linear-gradient(${config.angle ?? 180}deg, ${stops})`;
|
|
11377
|
+
}
|
|
11378
|
+
//#endregion
|
|
10835
11379
|
//#region ../theme-core/src/site-styles/logoBranding.ts
|
|
10836
11380
|
const logoTextConfidenceValues = [
|
|
10837
11381
|
"low",
|
|
@@ -13153,14 +13697,12 @@ const backgroundOnHoverEffect = {
|
|
|
13153
13697
|
]
|
|
13154
13698
|
},
|
|
13155
13699
|
generateCSS: (ctx) => {
|
|
13156
|
-
const { themeId, variantId, options, tokens } = ctx;
|
|
13700
|
+
const { themeId, variantId, options, tokens, buttonConfig } = ctx;
|
|
13157
13701
|
const colorToken = options.colorToken || "neutral-800";
|
|
13158
|
-
const color = tokens.getColor(colorToken);
|
|
13159
|
-
const textColorToken = typeof options.textColorToken === "string" ? options.textColorToken : null;
|
|
13160
13702
|
return `
|
|
13161
13703
|
/* Add background on hover */
|
|
13162
13704
|
:where([data-theme-scope="${themeId}"]) .${variantId}:hover {
|
|
13163
|
-
background-color: ${
|
|
13705
|
+
background-color: ${tokens.getColor(colorToken)};${"textColorToken" in buttonConfig && typeof options.textColorToken === "string" ? `\n color: ${tokens.getColor(options.textColorToken)};` : ""}
|
|
13164
13706
|
}
|
|
13165
13707
|
`;
|
|
13166
13708
|
}
|
|
@@ -13184,10 +13726,10 @@ const backgroundOnHoverAlphaEffect = {
|
|
|
13184
13726
|
default: 50
|
|
13185
13727
|
},
|
|
13186
13728
|
generateCSS: (ctx) => {
|
|
13187
|
-
const { themeId, variantId, stateGroup, options
|
|
13729
|
+
const { themeId, variantId, stateGroup, options } = ctx;
|
|
13188
13730
|
const rawOpacity = options.opacity;
|
|
13189
13731
|
const clampedOpacity = Math.max(0, Math.min(100, typeof rawOpacity === "number" && !Number.isNaN(rawOpacity) ? rawOpacity : 50));
|
|
13190
|
-
const cssVar = `var(--tb-${options.colorToken ||
|
|
13732
|
+
const cssVar = `var(--tb-${options.colorToken || "neutral-800"})`;
|
|
13191
13733
|
return `
|
|
13192
13734
|
/* Add semi-transparent background (${stateGroup}) */
|
|
13193
13735
|
:where([data-theme-scope="${themeId}"]) .${variantId}${stateGroup === "base" ? "" : `:${stateGroup}`} {
|
|
@@ -13400,7 +13942,7 @@ const outerGlowEffect = {
|
|
|
13400
13942
|
const spread = options.spread || 10;
|
|
13401
13943
|
let glowColor;
|
|
13402
13944
|
if (options.glowColorToken && typeof options.glowColorToken === "string") glowColor = tokens.getColor(options.glowColorToken);
|
|
13403
|
-
else if (buttonConfig.border
|
|
13945
|
+
else if (buttonConfig.border) glowColor = "colorToken" in buttonConfig.border ? tokens.getColor(buttonConfig.border.colorToken) : "currentColor";
|
|
13404
13946
|
else if (buttonConfig.background.type === "solid") glowColor = tokens.getColor(buttonConfig.background.colorToken ?? "primary-400");
|
|
13405
13947
|
else glowColor = tokens.getColor("primary-400");
|
|
13406
13948
|
return `
|
|
@@ -13459,7 +14001,7 @@ const retro3DShadowEffect = {
|
|
|
13459
14001
|
/**
|
|
13460
14002
|
* Map Tailwind-style gradient direction tokens to CSS gradient directions
|
|
13461
14003
|
*/
|
|
13462
|
-
const GRADIENT_DIRECTION_MAP$
|
|
14004
|
+
const GRADIENT_DIRECTION_MAP$2 = {
|
|
13463
14005
|
"to-r": "to right",
|
|
13464
14006
|
"to-l": "to left",
|
|
13465
14007
|
"to-t": "to top",
|
|
@@ -14389,29 +14931,6 @@ function generateSingleEffectCSS(themeId, variantId, stateGroup, effectApp, elem
|
|
|
14389
14931
|
};
|
|
14390
14932
|
return effectPreset.generateCSS(ctx);
|
|
14391
14933
|
}
|
|
14392
|
-
/**
|
|
14393
|
-
* Get contrasting text color for a button background
|
|
14394
|
-
*
|
|
14395
|
-
* This function returns theme-aware text colors using the neutral scale,
|
|
14396
|
-
* which is guaranteed to exist in every theme and harmonizes with the design.
|
|
14397
|
-
*
|
|
14398
|
-
* Uses neutral-50 (lightest) for dark backgrounds and neutral-950 (darkest)
|
|
14399
|
-
* for light backgrounds. This ensures excellent contrast while respecting
|
|
14400
|
-
* the theme's neutral palette (warm/cool tinting).
|
|
14401
|
-
*
|
|
14402
|
-
* For solid backgrounds with primary/secondary/neutral colors:
|
|
14403
|
-
* - Dark backgrounds (shade >= 500): neutral-50 (very light)
|
|
14404
|
-
* - Light backgrounds (shade < 500): neutral-950 (very dark)
|
|
14405
|
-
*/
|
|
14406
|
-
function getContrastingTextColorToken(backgroundToken, theme) {
|
|
14407
|
-
const isLightTheme = theme.palette.meta.mode === "light";
|
|
14408
|
-
if (backgroundToken.startsWith("primary-") || backgroundToken.startsWith("secondary-")) return "neutral-50";
|
|
14409
|
-
if (backgroundToken.startsWith("neutral-")) {
|
|
14410
|
-
const match = backgroundToken.match(/neutral-(\d+)/);
|
|
14411
|
-
if (match?.[1]) return parseInt(match[1], 10) >= 500 ? "neutral-50" : "neutral-950";
|
|
14412
|
-
}
|
|
14413
|
-
return isLightTheme ? "neutral-50" : "neutral-950";
|
|
14414
|
-
}
|
|
14415
14934
|
//#endregion
|
|
14416
14935
|
//#region ../theme-core/src/buttons/generateDefaultButtonSystem.ts
|
|
14417
14936
|
/**
|
|
@@ -14469,13 +14988,8 @@ function generateDefaultButtonSystem(theme) {
|
|
|
14469
14988
|
priority: 1,
|
|
14470
14989
|
background: {
|
|
14471
14990
|
type: "solid",
|
|
14472
|
-
colorToken: "primary"
|
|
14473
|
-
}
|
|
14474
|
-
textColorToken: getContrastingTextColorToken("primary", theme),
|
|
14475
|
-
effects: { hover: [{
|
|
14476
|
-
effectId: "opacity-reduce",
|
|
14477
|
-
options: { reduction: 15 }
|
|
14478
|
-
}] }
|
|
14991
|
+
colorToken: unsafeAsOpaqueButtonColourToken("primary")
|
|
14992
|
+
}
|
|
14479
14993
|
},
|
|
14480
14994
|
{
|
|
14481
14995
|
id: "secondary",
|
|
@@ -14484,51 +14998,39 @@ function generateDefaultButtonSystem(theme) {
|
|
|
14484
14998
|
priority: 2,
|
|
14485
14999
|
background: {
|
|
14486
15000
|
type: "solid",
|
|
14487
|
-
colorToken: "neutral-700"
|
|
14488
|
-
}
|
|
14489
|
-
textColorToken: getContrastingTextColorToken("neutral-700", theme),
|
|
14490
|
-
effects: { hover: [{
|
|
14491
|
-
effectId: "opacity-reduce",
|
|
14492
|
-
options: { reduction: 15 }
|
|
14493
|
-
}] }
|
|
15001
|
+
colorToken: unsafeAsOpaqueButtonColourToken("neutral-700")
|
|
15002
|
+
}
|
|
14494
15003
|
},
|
|
14495
15004
|
{
|
|
14496
15005
|
id: "outline",
|
|
14497
15006
|
name: "Outline",
|
|
14498
15007
|
enabled: true,
|
|
14499
15008
|
priority: 3,
|
|
14500
|
-
background: {
|
|
14501
|
-
|
|
15009
|
+
background: {
|
|
15010
|
+
type: "surface",
|
|
15011
|
+
role: "link"
|
|
15012
|
+
},
|
|
14502
15013
|
shadow: {
|
|
14503
15014
|
elevation: "none",
|
|
14504
15015
|
softness: null,
|
|
14505
15016
|
position: "bottom"
|
|
14506
15017
|
},
|
|
14507
|
-
border: {
|
|
14508
|
-
colorToken: "primary",
|
|
14509
|
-
widthClass: borderWidthClass
|
|
14510
|
-
},
|
|
14511
|
-
effects: { hover: [{
|
|
14512
|
-
effectId: "opacity-reduce",
|
|
14513
|
-
options: { reduction: 15 }
|
|
14514
|
-
}] }
|
|
15018
|
+
border: { widthClass: borderWidthClass }
|
|
14515
15019
|
},
|
|
14516
15020
|
{
|
|
14517
15021
|
id: "ghost",
|
|
14518
15022
|
name: "Ghost",
|
|
14519
15023
|
enabled: true,
|
|
14520
15024
|
priority: 3,
|
|
14521
|
-
background: {
|
|
14522
|
-
|
|
15025
|
+
background: {
|
|
15026
|
+
type: "surface",
|
|
15027
|
+
role: "link"
|
|
15028
|
+
},
|
|
14523
15029
|
shadow: {
|
|
14524
15030
|
elevation: "none",
|
|
14525
15031
|
softness: null,
|
|
14526
15032
|
position: "bottom"
|
|
14527
|
-
}
|
|
14528
|
-
effects: { hover: [{
|
|
14529
|
-
effectId: "opacity-reduce",
|
|
14530
|
-
options: { reduction: 15 }
|
|
14531
|
-
}] }
|
|
15033
|
+
}
|
|
14532
15034
|
}
|
|
14533
15035
|
];
|
|
14534
15036
|
return {
|
|
@@ -14584,6 +15086,472 @@ function affordanceIconMaskUrl(iconId) {
|
|
|
14584
15086
|
return `data:image/svg+xml,${`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>${paths.map((d) => `<path d='${d}'/>`).join("")}</svg>`.replace(/"/g, "'").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ")}`;
|
|
14585
15087
|
}
|
|
14586
15088
|
//#endregion
|
|
15089
|
+
//#region ../theme-core/src/surfaces/foregroundRoles.ts
|
|
15090
|
+
const SURFACE_FOREGROUND_ROLES = [
|
|
15091
|
+
"text",
|
|
15092
|
+
"heading",
|
|
15093
|
+
"link",
|
|
15094
|
+
"supporting"
|
|
15095
|
+
];
|
|
15096
|
+
//#endregion
|
|
15097
|
+
//#region ../theme-core/src/surfaces/foregroundContract.ts
|
|
15098
|
+
const SURFACE_FOREGROUND_CSS_VARS = {
|
|
15099
|
+
text: "--rb-surface-text-color",
|
|
15100
|
+
heading: "--rb-surface-heading-color",
|
|
15101
|
+
link: "--rb-surface-link-color",
|
|
15102
|
+
supporting: "--rb-surface-supporting-color"
|
|
15103
|
+
};
|
|
15104
|
+
const DEFAULT_SURFACE_TEXT_COLOR = "rgb(var(--tb-text, 17 24 39))";
|
|
15105
|
+
const DEFAULT_ROLE_FALLBACKS = {
|
|
15106
|
+
text: DEFAULT_SURFACE_TEXT_COLOR,
|
|
15107
|
+
heading: DEFAULT_SURFACE_TEXT_COLOR,
|
|
15108
|
+
link: "rgb(var(--tb-primary, var(--tb-text, 17 24 39)))",
|
|
15109
|
+
supporting: "rgb(var(--tb-mutedText, 100 116 139))"
|
|
15110
|
+
};
|
|
15111
|
+
function requireSurfaceColorValue(role, value) {
|
|
15112
|
+
const normalized = value.trim();
|
|
15113
|
+
if (normalized.length === 0) throw new RangeError(`Surface foreground ${role} must be a non-empty CSS color.`);
|
|
15114
|
+
return normalized;
|
|
15115
|
+
}
|
|
15116
|
+
function completeSurfaceForegrounds(input) {
|
|
15117
|
+
const text = requireSurfaceColorValue("text", input.text);
|
|
15118
|
+
return {
|
|
15119
|
+
text,
|
|
15120
|
+
heading: input.heading === void 0 ? text : requireSurfaceColorValue("heading", input.heading),
|
|
15121
|
+
link: input.link === void 0 ? text : requireSurfaceColorValue("link", input.link),
|
|
15122
|
+
supporting: input.supporting === void 0 ? text : requireSurfaceColorValue("supporting", input.supporting)
|
|
15123
|
+
};
|
|
15124
|
+
}
|
|
15125
|
+
function surfaceForegroundValue(role, outsideProviderFallback = DEFAULT_ROLE_FALLBACKS[role]) {
|
|
15126
|
+
const roleVariable = SURFACE_FOREGROUND_CSS_VARS[role];
|
|
15127
|
+
const fallback = requireSurfaceColorValue("fallback", outsideProviderFallback);
|
|
15128
|
+
if (role === "text") return `var(${roleVariable}, ${fallback})`;
|
|
15129
|
+
return `var(${roleVariable}, var(${SURFACE_FOREGROUND_CSS_VARS.text}, ${fallback}))`;
|
|
15130
|
+
}
|
|
15131
|
+
function surfaceForegroundValueWithOpacity(role, opacityPercent) {
|
|
15132
|
+
if (!Number.isFinite(opacityPercent) || opacityPercent < 0 || opacityPercent > 100) throw new RangeError("Surface foreground opacity must be between 0 and 100.");
|
|
15133
|
+
return `color-mix(in srgb, ${surfaceForegroundValue(role)} ${opacityPercent}%, transparent)`;
|
|
15134
|
+
}
|
|
15135
|
+
function surfaceForegroundStyle(input) {
|
|
15136
|
+
const foregrounds = completeSurfaceForegrounds(input);
|
|
15137
|
+
return {
|
|
15138
|
+
color: foregrounds.text,
|
|
15139
|
+
[SURFACE_FOREGROUND_CSS_VARS.text]: foregrounds.text,
|
|
15140
|
+
[SURFACE_FOREGROUND_CSS_VARS.heading]: foregrounds.heading,
|
|
15141
|
+
[SURFACE_FOREGROUND_CSS_VARS.link]: foregrounds.link,
|
|
15142
|
+
[SURFACE_FOREGROUND_CSS_VARS.supporting]: foregrounds.supporting
|
|
15143
|
+
};
|
|
15144
|
+
}
|
|
15145
|
+
function surfaceForegroundDeclarations(input) {
|
|
15146
|
+
const foregrounds = completeSurfaceForegrounds(input);
|
|
15147
|
+
return [`color: ${foregrounds.text}`, ...SURFACE_FOREGROUND_ROLES.map((role) => `${SURFACE_FOREGROUND_CSS_VARS[role]}: ${foregrounds[role]}`)];
|
|
15148
|
+
}
|
|
15149
|
+
//#endregion
|
|
15150
|
+
//#region ../theme-core/src/buttons/resolveButtonColourStates.ts
|
|
15151
|
+
const BUTTON_VISUAL_STATES = [
|
|
15152
|
+
"base",
|
|
15153
|
+
"hover",
|
|
15154
|
+
"focus",
|
|
15155
|
+
"active",
|
|
15156
|
+
"disabled"
|
|
15157
|
+
];
|
|
15158
|
+
const BUTTON_CONTRAST_POLICY = {
|
|
15159
|
+
textMinimumRatio: 4.5,
|
|
15160
|
+
nonTextMinimumRatio: 3,
|
|
15161
|
+
gradientSamplesPerSegment: 20,
|
|
15162
|
+
alphaBackgrounds: "reject-without-known-surface",
|
|
15163
|
+
disabled: "retain-full-colour-contract"
|
|
15164
|
+
};
|
|
15165
|
+
function compileButtonColourStates(input) {
|
|
15166
|
+
const baseTransition = applyColourEffects({
|
|
15167
|
+
variantId: input.variant.id,
|
|
15168
|
+
state: "base",
|
|
15169
|
+
treatment: input.variant.background,
|
|
15170
|
+
effects: input.variant.effects?.base,
|
|
15171
|
+
palette: input.palette
|
|
15172
|
+
});
|
|
15173
|
+
if (!baseTransition.ok) return baseTransition;
|
|
15174
|
+
const stateTreatments = {
|
|
15175
|
+
base: baseTransition.treatment,
|
|
15176
|
+
hover: hoverTreatment(input.variant, input.global, baseTransition.treatment),
|
|
15177
|
+
focus: baseTransition.treatment,
|
|
15178
|
+
active: baseTransition.treatment,
|
|
15179
|
+
disabled: baseTransition.treatment
|
|
15180
|
+
};
|
|
15181
|
+
const nonColourEffects = { ...baseTransition.nonColourEffects.length > 0 ? { base: [...baseTransition.nonColourEffects] } : {} };
|
|
15182
|
+
for (const state of [
|
|
15183
|
+
"hover",
|
|
15184
|
+
"focus",
|
|
15185
|
+
"active"
|
|
15186
|
+
]) {
|
|
15187
|
+
const transition = applyColourEffects({
|
|
15188
|
+
variantId: input.variant.id,
|
|
15189
|
+
state,
|
|
15190
|
+
treatment: stateTreatments[state],
|
|
15191
|
+
effects: input.variant.effects?.[state],
|
|
15192
|
+
palette: input.palette
|
|
15193
|
+
});
|
|
15194
|
+
if (!transition.ok) return transition;
|
|
15195
|
+
stateTreatments[state] = transition.treatment;
|
|
15196
|
+
if (transition.nonColourEffects.length > 0) nonColourEffects[state] = [...transition.nonColourEffects];
|
|
15197
|
+
}
|
|
15198
|
+
const resolved = {};
|
|
15199
|
+
for (const state of BUTTON_VISUAL_STATES) {
|
|
15200
|
+
const result = resolveTreatment$1({
|
|
15201
|
+
variantId: input.variant.id,
|
|
15202
|
+
state,
|
|
15203
|
+
treatment: stateTreatments[state],
|
|
15204
|
+
palette: input.palette
|
|
15205
|
+
});
|
|
15206
|
+
if (!result.ok) return result;
|
|
15207
|
+
resolved[state] = result.colour;
|
|
15208
|
+
}
|
|
15209
|
+
return {
|
|
15210
|
+
ok: true,
|
|
15211
|
+
states: resolved,
|
|
15212
|
+
focusIndicator: resolveFocusIndicator(resolved.focus),
|
|
15213
|
+
nonColourEffects
|
|
15214
|
+
};
|
|
15215
|
+
}
|
|
15216
|
+
function formatButtonColourContractError(error) {
|
|
15217
|
+
switch (error.tag) {
|
|
15218
|
+
case "unknown_palette_token": return `Button "${error.variantId}" ${error.state} state uses unknown palette token "${error.token}".`;
|
|
15219
|
+
case "missing_on_colour": return `Button "${error.variantId}" ${error.state} state cannot derive ${error.foregroundToken} from ${error.backgroundToken}.`;
|
|
15220
|
+
case "insufficient_contrast": return `Button "${error.variantId}" ${error.state} state has ${error.ratio.toFixed(2)}:1 contrast (${error.requiredRatio}:1 required).`;
|
|
15221
|
+
case "unsupported_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" is not contrast-safe (${error.reason}).`;
|
|
15222
|
+
case "invalid_colour_effect_options": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" has an invalid ${error.option} option.`;
|
|
15223
|
+
case "inapplicable_colour_effect": return `Button "${error.variantId}" ${error.state} effect "${error.effectId}" cannot apply to a ${error.treatment} treatment.`;
|
|
15224
|
+
case "unknown_button_effect": return `Button "${error.variantId}" ${error.state} uses unknown effect "${error.effectId}".`;
|
|
15225
|
+
}
|
|
15226
|
+
}
|
|
15227
|
+
function hoverTreatment(variant, global, fallback) {
|
|
15228
|
+
const token = variant.hoverBackgroundToken ?? (global.hoverColor === "token" ? global.hoverColorToken : void 0);
|
|
15229
|
+
return token === void 0 ? fallback : {
|
|
15230
|
+
type: "solid",
|
|
15231
|
+
colorToken: token
|
|
15232
|
+
};
|
|
15233
|
+
}
|
|
15234
|
+
function applyColourEffects(input) {
|
|
15235
|
+
let treatment = input.treatment;
|
|
15236
|
+
const nonColourEffects = [];
|
|
15237
|
+
for (const effect of input.effects ?? []) {
|
|
15238
|
+
const policy = getButtonEffectPolicy(effect.effectId);
|
|
15239
|
+
if (policy === null) return unknownEffect(input, effect);
|
|
15240
|
+
switch (policy.classification) {
|
|
15241
|
+
case "non-colour":
|
|
15242
|
+
nonColourEffects.push(effect);
|
|
15243
|
+
break;
|
|
15244
|
+
case "unsupported-colour":
|
|
15245
|
+
case "unsupported-background-overlay":
|
|
15246
|
+
case "not-button": return unsupportedEffect(input, effect, policy.reason);
|
|
15247
|
+
case "colour-transition":
|
|
15248
|
+
if (policy.transition.kind === "adjust-shade") {
|
|
15249
|
+
if (treatment.type !== "solid") return inapplicableEffect(input, effect, treatment);
|
|
15250
|
+
const amount = readShadeAmount(effect);
|
|
15251
|
+
if (amount === null) return invalidEffectOption(input, effect, "amount");
|
|
15252
|
+
const signedAmount = policy.transition.direction === "darker" ? amount : -amount;
|
|
15253
|
+
treatment = {
|
|
15254
|
+
type: "solid",
|
|
15255
|
+
colorToken: adjustShade(treatment.colorToken, signedAmount, input.palette)
|
|
15256
|
+
};
|
|
15257
|
+
break;
|
|
15258
|
+
}
|
|
15259
|
+
if (policy.transition.kind === "replace-background") {
|
|
15260
|
+
const colorToken = readOpaqueToken(effect, "colorToken", "neutral-800");
|
|
15261
|
+
if (colorToken === null) return invalidEffectOption(input, effect, "colorToken");
|
|
15262
|
+
treatment = {
|
|
15263
|
+
type: "solid",
|
|
15264
|
+
colorToken
|
|
15265
|
+
};
|
|
15266
|
+
break;
|
|
15267
|
+
}
|
|
15268
|
+
return unknownEffect(input, effect);
|
|
15269
|
+
}
|
|
15270
|
+
}
|
|
15271
|
+
return {
|
|
15272
|
+
ok: true,
|
|
15273
|
+
treatment,
|
|
15274
|
+
nonColourEffects
|
|
15275
|
+
};
|
|
15276
|
+
}
|
|
15277
|
+
function resolveTreatment$1(input) {
|
|
15278
|
+
const treatment = input.treatment;
|
|
15279
|
+
switch (treatment.type) {
|
|
15280
|
+
case "surface": return {
|
|
15281
|
+
ok: true,
|
|
15282
|
+
colour: {
|
|
15283
|
+
kind: "surface",
|
|
15284
|
+
role: treatment.role,
|
|
15285
|
+
backgroundCss: "transparent",
|
|
15286
|
+
foregroundCss: surfaceForegroundValue(treatment.role)
|
|
15287
|
+
}
|
|
15288
|
+
};
|
|
15289
|
+
case "solid": return resolveSolid(input, treatment.colorToken);
|
|
15290
|
+
case "gradient": return resolveGradient$2(input, treatment);
|
|
15291
|
+
}
|
|
15292
|
+
}
|
|
15293
|
+
function resolveFocusIndicator(colour) {
|
|
15294
|
+
switch (colour.kind) {
|
|
15295
|
+
case "solid": return {
|
|
15296
|
+
kind: "two-tone",
|
|
15297
|
+
innerCss: colour.foregroundCss,
|
|
15298
|
+
outerCss: colour.backgroundCss,
|
|
15299
|
+
minimumPairContrast: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
15300
|
+
};
|
|
15301
|
+
case "gradient": return {
|
|
15302
|
+
kind: "two-tone",
|
|
15303
|
+
innerCss: colour.foregroundCss,
|
|
15304
|
+
outerCss: tokenCss(colour.backgroundTokens[0]),
|
|
15305
|
+
minimumPairContrast: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
15306
|
+
};
|
|
15307
|
+
case "surface": return {
|
|
15308
|
+
kind: "surface-role",
|
|
15309
|
+
colorCss: colour.foregroundCss,
|
|
15310
|
+
minimumSurfaceContrast: BUTTON_CONTRAST_POLICY.nonTextMinimumRatio
|
|
15311
|
+
};
|
|
15312
|
+
}
|
|
15313
|
+
}
|
|
15314
|
+
function resolveSolid(input, backgroundToken) {
|
|
15315
|
+
const backgroundHex = paletteHex(input, backgroundToken);
|
|
15316
|
+
if (!backgroundHex.ok) return backgroundHex;
|
|
15317
|
+
const foregroundToken = unsafeAsOpaqueButtonColourToken(onColorTokenName(backgroundToken));
|
|
15318
|
+
const foregroundHex = input.palette[foregroundToken];
|
|
15319
|
+
if (typeof foregroundHex !== "string") return {
|
|
15320
|
+
ok: false,
|
|
15321
|
+
error: {
|
|
15322
|
+
tag: "missing_on_colour",
|
|
15323
|
+
variantId: input.variantId,
|
|
15324
|
+
state: input.state,
|
|
15325
|
+
backgroundToken,
|
|
15326
|
+
foregroundToken
|
|
15327
|
+
}
|
|
15328
|
+
};
|
|
15329
|
+
const contrast = validateContrast({
|
|
15330
|
+
...input,
|
|
15331
|
+
background: backgroundToken,
|
|
15332
|
+
backgroundHex: backgroundHex.hex,
|
|
15333
|
+
foreground: foregroundToken,
|
|
15334
|
+
foregroundHex
|
|
15335
|
+
});
|
|
15336
|
+
if (!contrast.ok) return contrast;
|
|
15337
|
+
return {
|
|
15338
|
+
ok: true,
|
|
15339
|
+
colour: {
|
|
15340
|
+
kind: "solid",
|
|
15341
|
+
backgroundToken,
|
|
15342
|
+
foregroundToken,
|
|
15343
|
+
backgroundCss: tokenCss(backgroundToken),
|
|
15344
|
+
foregroundCss: tokenCss(foregroundToken)
|
|
15345
|
+
}
|
|
15346
|
+
};
|
|
15347
|
+
}
|
|
15348
|
+
function resolveGradient$2(input, treatment) {
|
|
15349
|
+
const foregroundHex = paletteHex(input, treatment.foregroundToken);
|
|
15350
|
+
if (!foregroundHex.ok) return foregroundHex;
|
|
15351
|
+
const stopHexes = [];
|
|
15352
|
+
for (const token of treatment.stops) {
|
|
15353
|
+
const stop = paletteHex(input, token);
|
|
15354
|
+
if (!stop.ok) return stop;
|
|
15355
|
+
stopHexes.push(stop.hex);
|
|
15356
|
+
}
|
|
15357
|
+
for (let segment = 0; segment < stopHexes.length - 1; segment += 1) {
|
|
15358
|
+
const start = stopHexes[segment];
|
|
15359
|
+
const end = stopHexes[segment + 1];
|
|
15360
|
+
const startToken = treatment.stops[segment];
|
|
15361
|
+
const endToken = treatment.stops[segment + 1];
|
|
15362
|
+
if (start === void 0 || end === void 0 || startToken === void 0 || endToken === void 0) continue;
|
|
15363
|
+
for (let sample = 0; sample <= BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment; sample += 1) {
|
|
15364
|
+
const position = sample / BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment;
|
|
15365
|
+
const sampleHex = interpolateHex(start, end, position);
|
|
15366
|
+
const contrast = validateContrast({
|
|
15367
|
+
...input,
|
|
15368
|
+
background: `${startToken}→${endToken}@${position.toFixed(2)}`,
|
|
15369
|
+
backgroundHex: sampleHex,
|
|
15370
|
+
foreground: treatment.foregroundToken,
|
|
15371
|
+
foregroundHex: foregroundHex.hex
|
|
15372
|
+
});
|
|
15373
|
+
if (!contrast.ok) return contrast;
|
|
15374
|
+
}
|
|
15375
|
+
}
|
|
15376
|
+
const direction = GRADIENT_DIRECTION_MAP$2[treatment.direction] ?? "to right";
|
|
15377
|
+
return {
|
|
15378
|
+
ok: true,
|
|
15379
|
+
colour: {
|
|
15380
|
+
kind: "gradient",
|
|
15381
|
+
backgroundTokens: treatment.stops,
|
|
15382
|
+
foregroundToken: treatment.foregroundToken,
|
|
15383
|
+
backgroundCss: `linear-gradient(${direction}, ${treatment.stops.map(tokenCss).join(", ")})`,
|
|
15384
|
+
foregroundCss: tokenCss(treatment.foregroundToken)
|
|
15385
|
+
}
|
|
15386
|
+
};
|
|
15387
|
+
}
|
|
15388
|
+
function paletteHex(input, token) {
|
|
15389
|
+
const hex = input.palette[token];
|
|
15390
|
+
return typeof hex === "string" ? {
|
|
15391
|
+
ok: true,
|
|
15392
|
+
hex
|
|
15393
|
+
} : {
|
|
15394
|
+
ok: false,
|
|
15395
|
+
error: {
|
|
15396
|
+
tag: "unknown_palette_token",
|
|
15397
|
+
variantId: input.variantId,
|
|
15398
|
+
state: input.state,
|
|
15399
|
+
token
|
|
15400
|
+
}
|
|
15401
|
+
};
|
|
15402
|
+
}
|
|
15403
|
+
function validateContrast(input) {
|
|
15404
|
+
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
15405
|
+
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
15406
|
+
ok: false,
|
|
15407
|
+
error: {
|
|
15408
|
+
tag: "insufficient_contrast",
|
|
15409
|
+
variantId: input.variantId,
|
|
15410
|
+
state: input.state,
|
|
15411
|
+
background: input.background,
|
|
15412
|
+
foreground: input.foreground,
|
|
15413
|
+
ratio,
|
|
15414
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
15415
|
+
}
|
|
15416
|
+
};
|
|
15417
|
+
}
|
|
15418
|
+
function tokenCss(token) {
|
|
15419
|
+
return `rgb(var(--tb-${token}))`;
|
|
15420
|
+
}
|
|
15421
|
+
function adjustShade(token, amount, palette) {
|
|
15422
|
+
const match = token.match(/^(.*)-(\d{2,3})$/);
|
|
15423
|
+
const base = match?.[1] ?? token;
|
|
15424
|
+
const currentShade = match?.[2] === void 0 ? 500 : Number(match[2]);
|
|
15425
|
+
const availableShades = [
|
|
15426
|
+
50,
|
|
15427
|
+
100,
|
|
15428
|
+
200,
|
|
15429
|
+
300,
|
|
15430
|
+
400,
|
|
15431
|
+
500,
|
|
15432
|
+
600,
|
|
15433
|
+
700,
|
|
15434
|
+
800,
|
|
15435
|
+
900,
|
|
15436
|
+
950
|
|
15437
|
+
].filter((shade) => typeof palette[`${base}-${shade}`] === "string");
|
|
15438
|
+
if (availableShades.length === 0) return token;
|
|
15439
|
+
const firstShade = availableShades[0];
|
|
15440
|
+
if (firstShade === void 0) return token;
|
|
15441
|
+
const exactIndex = availableShades.indexOf(currentShade);
|
|
15442
|
+
const startingIndex = exactIndex >= 0 ? exactIndex : availableShades.indexOf(availableShades.reduce((closestShade, shade) => Math.abs(shade - currentShade) < Math.abs(closestShade - currentShade) ? shade : closestShade, firstShade));
|
|
15443
|
+
const stepCount = Math.abs(amount) / 100;
|
|
15444
|
+
const direction = amount < 0 ? -1 : 1;
|
|
15445
|
+
const targetShade = availableShades[Math.max(0, Math.min(availableShades.length - 1, startingIndex + direction * stepCount))];
|
|
15446
|
+
return targetShade === void 0 ? token : unsafeAsOpaqueButtonColourToken(`${base}-${targetShade}`);
|
|
15447
|
+
}
|
|
15448
|
+
function readShadeAmount(effect) {
|
|
15449
|
+
const value = effect.options?.amount ?? 100;
|
|
15450
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value % 100 === 0 ? value : null;
|
|
15451
|
+
}
|
|
15452
|
+
function readOpaqueToken(effect, key, fallback) {
|
|
15453
|
+
return parseOpaqueButtonColourToken(effect.options?.[key] ?? fallback);
|
|
15454
|
+
}
|
|
15455
|
+
function unsupportedEffect(input, effect, reason) {
|
|
15456
|
+
return {
|
|
15457
|
+
ok: false,
|
|
15458
|
+
error: {
|
|
15459
|
+
tag: "unsupported_colour_effect",
|
|
15460
|
+
variantId: input.variantId,
|
|
15461
|
+
state: input.state,
|
|
15462
|
+
effectId: effect.effectId,
|
|
15463
|
+
reason
|
|
15464
|
+
}
|
|
15465
|
+
};
|
|
15466
|
+
}
|
|
15467
|
+
function invalidEffectOption(input, effect, option) {
|
|
15468
|
+
return {
|
|
15469
|
+
ok: false,
|
|
15470
|
+
error: {
|
|
15471
|
+
tag: "invalid_colour_effect_options",
|
|
15472
|
+
variantId: input.variantId,
|
|
15473
|
+
state: input.state,
|
|
15474
|
+
effectId: effect.effectId,
|
|
15475
|
+
option
|
|
15476
|
+
}
|
|
15477
|
+
};
|
|
15478
|
+
}
|
|
15479
|
+
function inapplicableEffect(input, effect, treatment) {
|
|
15480
|
+
return {
|
|
15481
|
+
ok: false,
|
|
15482
|
+
error: {
|
|
15483
|
+
tag: "inapplicable_colour_effect",
|
|
15484
|
+
variantId: input.variantId,
|
|
15485
|
+
state: input.state,
|
|
15486
|
+
effectId: effect.effectId,
|
|
15487
|
+
treatment: treatment.type
|
|
15488
|
+
}
|
|
15489
|
+
};
|
|
15490
|
+
}
|
|
15491
|
+
function unknownEffect(input, effect) {
|
|
15492
|
+
return {
|
|
15493
|
+
ok: false,
|
|
15494
|
+
error: {
|
|
15495
|
+
tag: "unknown_button_effect",
|
|
15496
|
+
variantId: input.variantId,
|
|
15497
|
+
state: input.state,
|
|
15498
|
+
effectId: effect.effectId
|
|
15499
|
+
}
|
|
15500
|
+
};
|
|
15501
|
+
}
|
|
15502
|
+
function interpolateHex(startHex, endHex, position) {
|
|
15503
|
+
const start = hexToRgb$1(startHex);
|
|
15504
|
+
const end = hexToRgb$1(endHex);
|
|
15505
|
+
const channel = (from, to) => Math.round(from + (to - from) * position).toString(16).padStart(2, "0");
|
|
15506
|
+
return `#${channel(start.r, end.r)}${channel(start.g, end.g)}${channel(start.b, end.b)}`;
|
|
15507
|
+
}
|
|
15508
|
+
//#endregion
|
|
15509
|
+
//#region ../theme-core/src/buttons/resolvedButtonCss.ts
|
|
15510
|
+
/**
|
|
15511
|
+
* Canonical colour declaration mapping shared by full themes and ThemeBridge.
|
|
15512
|
+
* Both background properties are always emitted so transitions cannot retain
|
|
15513
|
+
* a stale gradient or solid layer.
|
|
15514
|
+
*/
|
|
15515
|
+
function resolvedButtonColourDeclarations(colour) {
|
|
15516
|
+
switch (colour.kind) {
|
|
15517
|
+
case "solid": return [
|
|
15518
|
+
["background-color", colour.backgroundCss],
|
|
15519
|
+
["background-image", "none"],
|
|
15520
|
+
["color", colour.foregroundCss]
|
|
15521
|
+
];
|
|
15522
|
+
case "gradient": return [
|
|
15523
|
+
["background-color", "transparent"],
|
|
15524
|
+
["background-image", colour.backgroundCss],
|
|
15525
|
+
["color", colour.foregroundCss]
|
|
15526
|
+
];
|
|
15527
|
+
case "surface": return [
|
|
15528
|
+
["background-color", colour.backgroundCss],
|
|
15529
|
+
["background-image", "none"],
|
|
15530
|
+
["color", colour.foregroundCss]
|
|
15531
|
+
];
|
|
15532
|
+
}
|
|
15533
|
+
}
|
|
15534
|
+
function resolvedButtonFocusDeclarations(indicator) {
|
|
15535
|
+
return indicator.kind === "two-tone" ? [
|
|
15536
|
+
["outline", `2px solid ${indicator.innerCss}`],
|
|
15537
|
+
["outline-offset", "2px"],
|
|
15538
|
+
["box-shadow", `0 0 0 4px ${indicator.outerCss}`]
|
|
15539
|
+
] : [["outline", `3px solid ${indicator.colorCss}`], ["outline-offset", "3px"]];
|
|
15540
|
+
}
|
|
15541
|
+
/**
|
|
15542
|
+
* Disabled buttons retain their validated colour pair and add a non-layout
|
|
15543
|
+
* visual affordance. `currentColor` keeps the cue inside the same contrast
|
|
15544
|
+
* relationship, while retaining pointer events lets the not-allowed cursor
|
|
15545
|
+
* remain observable.
|
|
15546
|
+
*/
|
|
15547
|
+
const RESOLVED_BUTTON_DISABLED_DECLARATIONS = [
|
|
15548
|
+
["cursor", "not-allowed"],
|
|
15549
|
+
["transform", "none"],
|
|
15550
|
+
["box-shadow", "none"],
|
|
15551
|
+
["outline", "2px dashed currentColor"],
|
|
15552
|
+
["outline-offset", "-4px"]
|
|
15553
|
+
];
|
|
15554
|
+
//#endregion
|
|
14587
15555
|
//#region ../theme-core/src/buttons/generateButtonCss.ts
|
|
14588
15556
|
/**
|
|
14589
15557
|
* Class the `button` runtime node adds when it renders its own trailing icon,
|
|
@@ -14600,7 +15568,7 @@ const LETTER_SPACING_MAP = {
|
|
|
14600
15568
|
normal: "0",
|
|
14601
15569
|
loose: "0.05em"
|
|
14602
15570
|
};
|
|
14603
|
-
function rule(selector, declarations) {
|
|
15571
|
+
function rule$1(selector, declarations) {
|
|
14604
15572
|
return {
|
|
14605
15573
|
selectors: typeof selector === "string" ? [selector] : selector,
|
|
14606
15574
|
declarations
|
|
@@ -14650,6 +15618,7 @@ const STRUCTURAL_DECLARATIONS = [
|
|
|
14650
15618
|
function generateButtonCss(options) {
|
|
14651
15619
|
const { themeId, theme, buttonSystem: providedButtonSystem } = options;
|
|
14652
15620
|
const tokens = new TokenResolver(theme);
|
|
15621
|
+
const palette = expandPalette(theme.palette);
|
|
14653
15622
|
const buttonSystem = providedButtonSystem ?? generateDefaultButtonSystem(theme);
|
|
14654
15623
|
const themeSizes = {
|
|
14655
15624
|
...DEFAULT_BUTTON_SIZES,
|
|
@@ -14658,34 +15627,109 @@ function generateButtonCss(options) {
|
|
|
14658
15627
|
const enabledVariants = buttonSystem.variants.filter((v) => v.enabled);
|
|
14659
15628
|
const aliasSource = resolveAliasSource(enabledVariants);
|
|
14660
15629
|
const chunks = [];
|
|
14661
|
-
for (const variant of enabledVariants)
|
|
15630
|
+
for (const variant of enabledVariants) {
|
|
15631
|
+
const compiled = compileRuntimeVariant(variant, buttonSystem.global, palette);
|
|
15632
|
+
if (compiled.fallbackError) chunks.push({ raw: `/* ${formatButtonColourContractError(compiled.fallbackError)} Using contrast-safe surface fallback. */` });
|
|
15633
|
+
chunks.push(...variantChunks(compiled.variant, compiled.global, themeSizes, themeId, tokens, theme, compiled.colours, compiled.focusIndicator, compiled.nonColourEffects));
|
|
15634
|
+
}
|
|
14662
15635
|
if (aliasSource) {
|
|
14663
|
-
const
|
|
15636
|
+
const compiled = compileRuntimeVariant({
|
|
14664
15637
|
...aliasSource,
|
|
14665
15638
|
id: DEFAULT_VARIANT_ALIAS_ID,
|
|
14666
15639
|
name: "Default"
|
|
14667
|
-
};
|
|
14668
|
-
chunks.push(
|
|
15640
|
+
}, buttonSystem.global, palette);
|
|
15641
|
+
if (compiled.fallbackError) chunks.push({ raw: `/* ${formatButtonColourContractError(compiled.fallbackError)} Using contrast-safe surface fallback. */` });
|
|
15642
|
+
chunks.push(...variantChunks(compiled.variant, compiled.global, themeSizes, themeId, tokens, theme, compiled.colours, compiled.focusIndicator, compiled.nonColourEffects));
|
|
14669
15643
|
}
|
|
14670
15644
|
return chunks.map(renderChunk).join("\n\n");
|
|
14671
15645
|
}
|
|
15646
|
+
function compileRuntimeVariant(variant, global, palette) {
|
|
15647
|
+
const result = compileButtonColourStates({
|
|
15648
|
+
variant,
|
|
15649
|
+
global,
|
|
15650
|
+
palette
|
|
15651
|
+
});
|
|
15652
|
+
if (result.ok) return {
|
|
15653
|
+
variant,
|
|
15654
|
+
global,
|
|
15655
|
+
colours: result.states,
|
|
15656
|
+
focusIndicator: result.focusIndicator,
|
|
15657
|
+
nonColourEffects: result.nonColourEffects
|
|
15658
|
+
};
|
|
15659
|
+
const fallbackVariant = {
|
|
15660
|
+
...variant,
|
|
15661
|
+
background: {
|
|
15662
|
+
type: "surface",
|
|
15663
|
+
role: "link"
|
|
15664
|
+
},
|
|
15665
|
+
hoverBackgroundToken: void 0,
|
|
15666
|
+
effects: void 0
|
|
15667
|
+
};
|
|
15668
|
+
const fallbackGlobal = {
|
|
15669
|
+
...global,
|
|
15670
|
+
hoverColor: "none",
|
|
15671
|
+
hoverColorToken: void 0
|
|
15672
|
+
};
|
|
15673
|
+
const fallback = compileButtonColourStates({
|
|
15674
|
+
variant: fallbackVariant,
|
|
15675
|
+
global: fallbackGlobal,
|
|
15676
|
+
palette
|
|
15677
|
+
});
|
|
15678
|
+
if (!fallback.ok) {
|
|
15679
|
+
const colour = {
|
|
15680
|
+
kind: "surface",
|
|
15681
|
+
role: "link",
|
|
15682
|
+
backgroundCss: "transparent",
|
|
15683
|
+
foregroundCss: surfaceForegroundValue("link")
|
|
15684
|
+
};
|
|
15685
|
+
return {
|
|
15686
|
+
variant: fallbackVariant,
|
|
15687
|
+
global: fallbackGlobal,
|
|
15688
|
+
colours: {
|
|
15689
|
+
base: colour,
|
|
15690
|
+
hover: colour,
|
|
15691
|
+
focus: colour,
|
|
15692
|
+
active: colour,
|
|
15693
|
+
disabled: colour
|
|
15694
|
+
},
|
|
15695
|
+
focusIndicator: {
|
|
15696
|
+
kind: "surface-role",
|
|
15697
|
+
colorCss: colour.foregroundCss,
|
|
15698
|
+
minimumSurfaceContrast: BUTTON_CONTRAST_POLICY.nonTextMinimumRatio
|
|
15699
|
+
},
|
|
15700
|
+
nonColourEffects: {},
|
|
15701
|
+
fallbackError: result.error
|
|
15702
|
+
};
|
|
15703
|
+
}
|
|
15704
|
+
return {
|
|
15705
|
+
variant: fallbackVariant,
|
|
15706
|
+
global: fallbackGlobal,
|
|
15707
|
+
colours: fallback.states,
|
|
15708
|
+
focusIndicator: fallback.focusIndicator,
|
|
15709
|
+
nonColourEffects: fallback.nonColourEffects,
|
|
15710
|
+
fallbackError: result.error
|
|
15711
|
+
};
|
|
15712
|
+
}
|
|
14672
15713
|
/** Pick the highest-priority variant whose role we'll alias to `.default`. */
|
|
14673
15714
|
function resolveAliasSource(enabled) {
|
|
14674
15715
|
if (enabled.some((v) => v.id === DEFAULT_VARIANT_ALIAS_ID)) return null;
|
|
14675
15716
|
return enabled.slice().sort((a, b) => a.priority - b.priority)[0] ?? null;
|
|
14676
15717
|
}
|
|
14677
|
-
function variantChunks(variant, global, themeSizes, themeId, tokens, theme) {
|
|
15718
|
+
function variantChunks(variant, global, themeSizes, themeId, tokens, theme, colours, focusIndicator, nonColourEffects) {
|
|
14678
15719
|
const out = [];
|
|
14679
15720
|
const variantId = parseButtonVariantIdForCss(variant.id);
|
|
14680
15721
|
const selector = `:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}`;
|
|
14681
|
-
out.push(variantBaseRule(variant, selector, global, tokens, theme));
|
|
15722
|
+
out.push(variantBaseRule(variant, selector, global, tokens, theme, colours.base));
|
|
14682
15723
|
out.push({ raw: generateInteractiveChildInheritanceCSS(selector) });
|
|
14683
|
-
|
|
14684
|
-
|
|
14685
|
-
|
|
14686
|
-
|
|
15724
|
+
for (const state of [
|
|
15725
|
+
"hover",
|
|
15726
|
+
"focus",
|
|
15727
|
+
"active"
|
|
15728
|
+
]) if (!resolvedColoursEqual(colours.base, colours[state])) out.push(variantStateColourRule(variantId, themeId, state, colours[state]));
|
|
15729
|
+
const effects = variantEffectsCss(variant, nonColourEffects, themeId, tokens, theme);
|
|
14687
15730
|
if (effects) out.push({ raw: effects });
|
|
14688
|
-
|
|
15731
|
+
out.push(variantFocusVisibleRule(variantId, themeId, focusIndicator));
|
|
15732
|
+
const affordance = variantAffordanceRule(variant, selector);
|
|
14689
15733
|
if (affordance) out.push(affordance);
|
|
14690
15734
|
out.push(...variantDisabledRules(variantId, themeId));
|
|
14691
15735
|
out.push(...variantSizeRules(variant, variantId, themeSizes, themeId));
|
|
@@ -14700,21 +15744,20 @@ function variantChunks(variant, global, themeSizes, themeId, tokens, theme) {
|
|
|
14700
15744
|
* one (node overrides personality). Colour comes from the affordance token, or
|
|
14701
15745
|
* `currentColor` (the button text colour) when no token is given.
|
|
14702
15746
|
*/
|
|
14703
|
-
function variantAffordanceRule(variant, selector
|
|
15747
|
+
function variantAffordanceRule(variant, selector) {
|
|
14704
15748
|
const affordance = variant.affordance;
|
|
14705
15749
|
if (!affordance) return null;
|
|
14706
15750
|
const maskUrl = affordanceIconMaskUrl(affordance.iconId);
|
|
14707
15751
|
if (!maskUrl) return null;
|
|
14708
|
-
const color = affordance.colorToken ? variant.background.type === "transparent" ? surfaceLinkColor(tokens.getColor(affordance.colorToken)) : tokens.getColor(affordance.colorToken) : "currentColor";
|
|
14709
15752
|
const mask = `url("${maskUrl}") no-repeat center / contain`;
|
|
14710
|
-
return rule(`${selector}:not(.${AFFORDANCE_SUPPRESS_CLASS})::after`, [
|
|
15753
|
+
return rule$1(`${selector}:not(.${AFFORDANCE_SUPPRESS_CLASS})::after`, [
|
|
14711
15754
|
["content", "\"\""],
|
|
14712
15755
|
["display", "inline-block"],
|
|
14713
15756
|
["width", "1em"],
|
|
14714
15757
|
["height", "1em"],
|
|
14715
15758
|
["margin-inline-start", "0.5em"],
|
|
14716
15759
|
["flex", "0 0 auto"],
|
|
14717
|
-
["background-color",
|
|
15760
|
+
["background-color", "currentColor"],
|
|
14718
15761
|
["-webkit-mask", mask],
|
|
14719
15762
|
["mask", mask]
|
|
14720
15763
|
]);
|
|
@@ -14724,7 +15767,7 @@ function parseButtonVariantIdForCss(value) {
|
|
|
14724
15767
|
if (!variantId) throw new Error("Button variant id must be a non-empty string");
|
|
14725
15768
|
return variantId;
|
|
14726
15769
|
}
|
|
14727
|
-
function variantBaseRule(variant, selector, global, tokens, theme) {
|
|
15770
|
+
function variantBaseRule(variant, selector, global, tokens, theme, colour) {
|
|
14728
15771
|
const decls = [];
|
|
14729
15772
|
decls.push(["font-weight", String(global.fontWeight)]);
|
|
14730
15773
|
decls.push(["font-family", resolveFontFamily(global)]);
|
|
@@ -14736,20 +15779,12 @@ function variantBaseRule(variant, selector, global, tokens, theme) {
|
|
|
14736
15779
|
for (const decl of STRUCTURAL_DECLARATIONS) decls.push(decl);
|
|
14737
15780
|
decls.push(["border-radius", resolveBorderRadius(variant, global)]);
|
|
14738
15781
|
decls.push(["box-shadow", resolveBoxShadow(variant, global, theme, tokens)]);
|
|
14739
|
-
|
|
14740
|
-
else if (variant.background.type === "gradient") {
|
|
14741
|
-
const colors = variant.background.stops.map((stop) => tokens.getColor(stop)).join(", ");
|
|
14742
|
-
const direction = GRADIENT_DIRECTION_MAP$3[variant.background.direction] || "to right";
|
|
14743
|
-
decls.push(["background-image", `linear-gradient(${direction}, ${colors})`]);
|
|
14744
|
-
} else decls.push(["background-color", "transparent"]);
|
|
14745
|
-
const foregroundColor = variant.background.type === "transparent" ? surfaceLinkColor(tokens.getColor(variant.textColorToken)) : tokens.getColor(variant.textColorToken);
|
|
14746
|
-
decls.push(["color", foregroundColor]);
|
|
15782
|
+
decls.push(...resolvedButtonColourDeclarations(colour));
|
|
14747
15783
|
if (variant.border) {
|
|
14748
15784
|
const borderWidth = BORDER_WIDTH_MAP$4[variant.border.widthClass] || "1px";
|
|
14749
|
-
|
|
14750
|
-
decls.push(["border", `${borderWidth} solid ${borderColor}`]);
|
|
15785
|
+
decls.push(["border", `${borderWidth} solid currentColor`]);
|
|
14751
15786
|
}
|
|
14752
|
-
return rule(selector, decls);
|
|
15787
|
+
return rule$1(selector, decls);
|
|
14753
15788
|
}
|
|
14754
15789
|
/**
|
|
14755
15790
|
* Resolve a colour for a button that does not own its own background.
|
|
@@ -14758,30 +15793,22 @@ function variantBaseRule(variant, selector, global, tokens, theme) {
|
|
|
14758
15793
|
* token fallback keeps buttons usable in contexts that do not provide that
|
|
14759
15794
|
* contract (and preserves the existing theme behaviour there).
|
|
14760
15795
|
*/
|
|
14761
|
-
function
|
|
14762
|
-
return
|
|
14763
|
-
}
|
|
14764
|
-
function variantHoverBackgroundRule(variant, variantId, global, themeId, tokens) {
|
|
14765
|
-
let hoverToken = variant.hoverBackgroundToken;
|
|
14766
|
-
if (!hoverToken && global.hoverColor === "token" && global.hoverColorToken) hoverToken = global.hoverColorToken;
|
|
14767
|
-
if (!hoverToken) return null;
|
|
14768
|
-
return rule(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:hover`, [["background-color", tokens.getColor(hoverToken)]]);
|
|
15796
|
+
function variantStateColourRule(variantId, themeId, state, colour) {
|
|
15797
|
+
return rule$1(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:${state}`, resolvedButtonColourDeclarations(colour));
|
|
14769
15798
|
}
|
|
14770
|
-
function variantFocusVisibleRule(variantId, themeId) {
|
|
14771
|
-
return rule(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:focus-visible`,
|
|
15799
|
+
function variantFocusVisibleRule(variantId, themeId, focusIndicator) {
|
|
15800
|
+
return rule$1(`:where([data-theme-scope="${themeId}"]) ${themeButtonSelector(variantId)}:focus-visible`, resolvedButtonFocusDeclarations(focusIndicator));
|
|
14772
15801
|
}
|
|
14773
|
-
function variantEffectsCss(variant, themeId, tokens, theme) {
|
|
14774
|
-
if (!
|
|
15802
|
+
function variantEffectsCss(variant, effects, themeId, tokens, theme) {
|
|
15803
|
+
if (!effects) return "";
|
|
14775
15804
|
const elementConfig = {
|
|
14776
|
-
background: variant.background,
|
|
14777
|
-
textColorToken: variant.textColorToken,
|
|
14778
|
-
border: variant.border ? { colorToken: variant.border.colorToken } : void 0,
|
|
15805
|
+
background: variant.background.type === "surface" ? { type: "transparent" } : variant.background,
|
|
14779
15806
|
shadow: variant.shadow
|
|
14780
15807
|
};
|
|
14781
15808
|
return generateEffectsCSS({
|
|
14782
15809
|
themeId,
|
|
14783
15810
|
variantId: variant.id,
|
|
14784
|
-
effects
|
|
15811
|
+
effects,
|
|
14785
15812
|
elementConfig,
|
|
14786
15813
|
tokens,
|
|
14787
15814
|
theme
|
|
@@ -14796,18 +15823,15 @@ function variantDisabledRules(variantId, themeId) {
|
|
|
14796
15823
|
`${base}:focus`
|
|
14797
15824
|
];
|
|
14798
15825
|
const pseudoSelectors = [`${base}::before`, `${base}::after`];
|
|
14799
|
-
return [rule(disabledSelectors, [
|
|
14800
|
-
["opacity", "0.5"],
|
|
14801
|
-
["cursor", "not-allowed"],
|
|
14802
|
-
["pointer-events", "none"],
|
|
14803
|
-
["transform", "none"],
|
|
14804
|
-
["box-shadow", "none"]
|
|
14805
|
-
]), rule(pseudoSelectors, [
|
|
15826
|
+
return [rule$1(disabledSelectors, [...RESOLVED_BUTTON_DISABLED_DECLARATIONS]), rule$1(pseudoSelectors, [
|
|
14806
15827
|
["opacity", "0"],
|
|
14807
15828
|
["animation", "none"],
|
|
14808
15829
|
["pointer-events", "none"]
|
|
14809
15830
|
])];
|
|
14810
15831
|
}
|
|
15832
|
+
function resolvedColoursEqual(left, right) {
|
|
15833
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
15834
|
+
}
|
|
14811
15835
|
function variantSizeRules(variant, variantId, themeSizes, themeId) {
|
|
14812
15836
|
const borderWidth = variant.border ? BORDER_WIDTH_MAP$4[variant.border.widthClass] || "1px" : "0px";
|
|
14813
15837
|
const rules = [];
|
|
@@ -14817,7 +15841,7 @@ function variantSizeRules(variant, variantId, themeSizes, themeId) {
|
|
|
14817
15841
|
const decls = [];
|
|
14818
15842
|
for (const decl of paddingDeclarations(config.padding, borderWidth)) decls.push(decl);
|
|
14819
15843
|
if (config.fontSize) decls.push(["font-size", FONT_SIZE_MAP[config.fontSize] || "1rem"]);
|
|
14820
|
-
rules.push(rule(selector, decls));
|
|
15844
|
+
rules.push(rule$1(selector, decls));
|
|
14821
15845
|
}
|
|
14822
15846
|
return rules;
|
|
14823
15847
|
}
|
|
@@ -14875,6 +15899,27 @@ function resolveBoxShadow(variant, global, theme, tokens) {
|
|
|
14875
15899
|
const color = shadowConfig.colorToken ? tokens.getColor(shadowConfig.colorToken) : void 0;
|
|
14876
15900
|
return generateShadowValue$1(shadowConfig.elevation, shadowConfig.softness, shadowConfig.position ?? "bottom", color);
|
|
14877
15901
|
}
|
|
15902
|
+
buttonPersonalities.map((personality) => ({
|
|
15903
|
+
id: personality.id,
|
|
15904
|
+
name: personality.name,
|
|
15905
|
+
description: personality.description,
|
|
15906
|
+
category: presetCategory(personality),
|
|
15907
|
+
buttonSystem: personality.buttonSystem,
|
|
15908
|
+
compatibility: {
|
|
15909
|
+
...personality.tags.tone ? { tones: [personality.tags.tone] } : {},
|
|
15910
|
+
...personality.tags.energy ? { energies: [personality.tags.energy] } : {}
|
|
15911
|
+
}
|
|
15912
|
+
}));
|
|
15913
|
+
function presetCategory(personality) {
|
|
15914
|
+
switch (personality.tags.era) {
|
|
15915
|
+
case "retro": return "retro";
|
|
15916
|
+
case "editorial": return "minimal";
|
|
15917
|
+
case "organic": return "artistic";
|
|
15918
|
+
case "modern": return personality.tags.tone === "bold" ? "modern" : "technical";
|
|
15919
|
+
case "technical": return "technical";
|
|
15920
|
+
case void 0: return "modern";
|
|
15921
|
+
}
|
|
15922
|
+
}
|
|
14878
15923
|
//#endregion
|
|
14879
15924
|
//#region ../theme-core/src/cards/types.ts
|
|
14880
15925
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
@@ -15111,67 +16156,6 @@ function generateDefaultCardSystem(theme) {
|
|
|
15111
16156
|
return { variants: [defaultVariant, alternativeVariant] };
|
|
15112
16157
|
}
|
|
15113
16158
|
//#endregion
|
|
15114
|
-
//#region ../theme-core/src/surfaces/foregroundRoles.ts
|
|
15115
|
-
const SURFACE_FOREGROUND_ROLES = [
|
|
15116
|
-
"text",
|
|
15117
|
-
"heading",
|
|
15118
|
-
"link",
|
|
15119
|
-
"supporting"
|
|
15120
|
-
];
|
|
15121
|
-
//#endregion
|
|
15122
|
-
//#region ../theme-core/src/surfaces/foregroundContract.ts
|
|
15123
|
-
const SURFACE_FOREGROUND_CSS_VARS = {
|
|
15124
|
-
text: "--rb-surface-text-color",
|
|
15125
|
-
heading: "--rb-surface-heading-color",
|
|
15126
|
-
link: "--rb-surface-link-color",
|
|
15127
|
-
supporting: "--rb-surface-supporting-color"
|
|
15128
|
-
};
|
|
15129
|
-
const DEFAULT_SURFACE_TEXT_COLOR = "rgb(var(--tb-text, 17 24 39))";
|
|
15130
|
-
const DEFAULT_ROLE_FALLBACKS = {
|
|
15131
|
-
text: DEFAULT_SURFACE_TEXT_COLOR,
|
|
15132
|
-
heading: DEFAULT_SURFACE_TEXT_COLOR,
|
|
15133
|
-
link: "rgb(var(--tb-primary, var(--tb-text, 17 24 39)))",
|
|
15134
|
-
supporting: "rgb(var(--tb-mutedText, 100 116 139))"
|
|
15135
|
-
};
|
|
15136
|
-
function requireSurfaceColorValue(role, value) {
|
|
15137
|
-
const normalized = value.trim();
|
|
15138
|
-
if (normalized.length === 0) throw new RangeError(`Surface foreground ${role} must be a non-empty CSS color.`);
|
|
15139
|
-
return normalized;
|
|
15140
|
-
}
|
|
15141
|
-
function completeSurfaceForegrounds(input) {
|
|
15142
|
-
const text = requireSurfaceColorValue("text", input.text);
|
|
15143
|
-
return {
|
|
15144
|
-
text,
|
|
15145
|
-
heading: input.heading === void 0 ? text : requireSurfaceColorValue("heading", input.heading),
|
|
15146
|
-
link: input.link === void 0 ? text : requireSurfaceColorValue("link", input.link),
|
|
15147
|
-
supporting: input.supporting === void 0 ? text : requireSurfaceColorValue("supporting", input.supporting)
|
|
15148
|
-
};
|
|
15149
|
-
}
|
|
15150
|
-
function surfaceForegroundValue(role, outsideProviderFallback = DEFAULT_ROLE_FALLBACKS[role]) {
|
|
15151
|
-
const roleVariable = SURFACE_FOREGROUND_CSS_VARS[role];
|
|
15152
|
-
const fallback = requireSurfaceColorValue("fallback", outsideProviderFallback);
|
|
15153
|
-
if (role === "text") return `var(${roleVariable}, ${fallback})`;
|
|
15154
|
-
return `var(${roleVariable}, var(${SURFACE_FOREGROUND_CSS_VARS.text}, ${fallback}))`;
|
|
15155
|
-
}
|
|
15156
|
-
function surfaceForegroundValueWithOpacity(role, opacityPercent) {
|
|
15157
|
-
if (!Number.isFinite(opacityPercent) || opacityPercent < 0 || opacityPercent > 100) throw new RangeError("Surface foreground opacity must be between 0 and 100.");
|
|
15158
|
-
return `color-mix(in srgb, ${surfaceForegroundValue(role)} ${opacityPercent}%, transparent)`;
|
|
15159
|
-
}
|
|
15160
|
-
function surfaceForegroundStyle(input) {
|
|
15161
|
-
const foregrounds = completeSurfaceForegrounds(input);
|
|
15162
|
-
return {
|
|
15163
|
-
color: foregrounds.text,
|
|
15164
|
-
[SURFACE_FOREGROUND_CSS_VARS.text]: foregrounds.text,
|
|
15165
|
-
[SURFACE_FOREGROUND_CSS_VARS.heading]: foregrounds.heading,
|
|
15166
|
-
[SURFACE_FOREGROUND_CSS_VARS.link]: foregrounds.link,
|
|
15167
|
-
[SURFACE_FOREGROUND_CSS_VARS.supporting]: foregrounds.supporting
|
|
15168
|
-
};
|
|
15169
|
-
}
|
|
15170
|
-
function surfaceForegroundDeclarations(input) {
|
|
15171
|
-
const foregrounds = completeSurfaceForegrounds(input);
|
|
15172
|
-
return [`color: ${foregrounds.text}`, ...SURFACE_FOREGROUND_ROLES.map((role) => `${SURFACE_FOREGROUND_CSS_VARS[role]}: ${foregrounds[role]}`)];
|
|
15173
|
-
}
|
|
15174
|
-
//#endregion
|
|
15175
16159
|
//#region ../theme-core/src/cards/generateCardCss.ts
|
|
15176
16160
|
const PER_CORNER_RADIUS_MAP$1 = {
|
|
15177
16161
|
square: "0",
|
|
@@ -15608,47 +16592,6 @@ const FONT_WEIGHT_MAP = {
|
|
|
15608
16592
|
black: "800"
|
|
15609
16593
|
};
|
|
15610
16594
|
//#endregion
|
|
15611
|
-
//#region ../theme-core/src/gradients/types.ts
|
|
15612
|
-
/**
|
|
15613
|
-
* Gradient configuration types and schemas
|
|
15614
|
-
*/
|
|
15615
|
-
/**
|
|
15616
|
-
* Gradient color stop
|
|
15617
|
-
*/
|
|
15618
|
-
const gradientStopSchema = z$1.object({
|
|
15619
|
-
color: themeColorTokenSchema,
|
|
15620
|
-
position: z$1.number().min(0).max(100)
|
|
15621
|
-
});
|
|
15622
|
-
/**
|
|
15623
|
-
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
15624
|
-
* so existing radial gradients are byte-identical.
|
|
15625
|
-
*
|
|
15626
|
-
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
15627
|
-
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
15628
|
-
*/
|
|
15629
|
-
const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
15630
|
-
/**
|
|
15631
|
-
* Gradient configuration.
|
|
15632
|
-
*
|
|
15633
|
-
* `type` is optional and defaults to `'linear'` so gradients persisted without a
|
|
15634
|
-
* type (or with an explicit `'linear'`) render exactly as before. `'radial'` and
|
|
15635
|
-
* `'conic'` are additive kinds:
|
|
15636
|
-
* - linear: `angle` (degrees)
|
|
15637
|
-
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
15638
|
-
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
15639
|
-
*/
|
|
15640
|
-
const gradientConfigSchema = z$1.object({
|
|
15641
|
-
type: z$1.enum([
|
|
15642
|
-
"linear",
|
|
15643
|
-
"radial",
|
|
15644
|
-
"conic"
|
|
15645
|
-
]).default("linear"),
|
|
15646
|
-
angle: z$1.number().min(0).max(360).optional(),
|
|
15647
|
-
shape: radialGradientShapeSchema.optional(),
|
|
15648
|
-
position: z$1.string().optional(),
|
|
15649
|
-
stops: z$1.array(gradientStopSchema).min(2)
|
|
15650
|
-
});
|
|
15651
|
-
//#endregion
|
|
15652
16595
|
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
15653
16596
|
/**
|
|
15654
16597
|
* Shared Base Schemas for Interactive Elements
|
|
@@ -17399,6 +18342,21 @@ z$1.object({
|
|
|
17399
18342
|
blocks: z$1.array(blockDesignPlanSchema),
|
|
17400
18343
|
styleAuthorities: z$1.array(blockRuntimeStyleAuthoritySchema)
|
|
17401
18344
|
}).strict();
|
|
18345
|
+
//#endregion
|
|
18346
|
+
//#region ../theme-core/src/site-styles/runtimeCompiler.ts
|
|
18347
|
+
function defineSectionForegroundRuntimeTokens(input) {
|
|
18348
|
+
return {
|
|
18349
|
+
textColor: requireThemeColorToken(input.textColor),
|
|
18350
|
+
headingColor: requireThemeColorToken(input.headingColor),
|
|
18351
|
+
linkColor: requireThemeColorToken(input.linkColor),
|
|
18352
|
+
supportingColor: requireThemeColorToken(input.supportingColor)
|
|
18353
|
+
};
|
|
18354
|
+
}
|
|
18355
|
+
function requireThemeColorToken(value) {
|
|
18356
|
+
const token = parseThemeColorToken(value);
|
|
18357
|
+
if (!token) throw new Error(`Invalid section foreground Theme color token: ${String(value)}`);
|
|
18358
|
+
return token;
|
|
18359
|
+
}
|
|
17402
18360
|
function defineDesignRuntimeRules(rules) {
|
|
17403
18361
|
return rules;
|
|
17404
18362
|
}
|
|
@@ -17669,24 +18627,24 @@ const kirtanOrnateDesignRuntimeRules = defineDesignRuntimeRules({
|
|
|
17669
18627
|
type: "color",
|
|
17670
18628
|
color: "muted"
|
|
17671
18629
|
},
|
|
17672
|
-
foreground: {
|
|
18630
|
+
foreground: defineSectionForegroundRuntimeTokens({
|
|
17673
18631
|
textColor: "text",
|
|
17674
18632
|
headingColor: "primary",
|
|
17675
18633
|
linkColor: "primary",
|
|
17676
18634
|
supportingColor: "text"
|
|
17677
|
-
}
|
|
18635
|
+
})
|
|
17678
18636
|
},
|
|
17679
18637
|
"brand-depth-band": {
|
|
17680
18638
|
background: {
|
|
17681
18639
|
type: "color",
|
|
17682
18640
|
color: "primary-800"
|
|
17683
18641
|
},
|
|
17684
|
-
foreground: {
|
|
18642
|
+
foreground: defineSectionForegroundRuntimeTokens({
|
|
17685
18643
|
textColor: "text",
|
|
17686
18644
|
headingColor: "primary",
|
|
17687
18645
|
linkColor: "primary",
|
|
17688
18646
|
supportingColor: "text"
|
|
17689
|
-
}
|
|
18647
|
+
})
|
|
17690
18648
|
},
|
|
17691
18649
|
"hero-image": {
|
|
17692
18650
|
background: {
|
|
@@ -17694,12 +18652,32 @@ const kirtanOrnateDesignRuntimeRules = defineDesignRuntimeRules({
|
|
|
17694
18652
|
opacity: 1,
|
|
17695
18653
|
position: "center center"
|
|
17696
18654
|
},
|
|
17697
|
-
foreground: {
|
|
18655
|
+
foreground: defineSectionForegroundRuntimeTokens({
|
|
17698
18656
|
textColor: "text",
|
|
17699
18657
|
headingColor: "primary",
|
|
17700
18658
|
linkColor: "primary",
|
|
17701
18659
|
supportingColor: "text"
|
|
17702
|
-
}
|
|
18660
|
+
})
|
|
18661
|
+
}
|
|
18662
|
+
}
|
|
18663
|
+
});
|
|
18664
|
+
const primaryGlowGradientPresetId = parseGradientPresetId("primary-glow");
|
|
18665
|
+
if (!primaryGlowGradientPresetId) throw new Error("Expected primary-glow in the Theme Core gradient catalog");
|
|
18666
|
+
const fulcrumDesignRuntimeRules = defineDesignRuntimeRules({
|
|
18667
|
+
...defaultDesignRuntimeRules,
|
|
18668
|
+
sectionSurfaces: {
|
|
18669
|
+
...defaultDesignRuntimeRules.sectionSurfaces,
|
|
18670
|
+
"accent-band": {
|
|
18671
|
+
background: {
|
|
18672
|
+
type: "gradient",
|
|
18673
|
+
gradientPresetId: primaryGlowGradientPresetId
|
|
18674
|
+
},
|
|
18675
|
+
foreground: defineSectionForegroundRuntimeTokens({
|
|
18676
|
+
textColor: "primaryForeground",
|
|
18677
|
+
headingColor: "primaryForeground",
|
|
18678
|
+
linkColor: "primaryForeground",
|
|
18679
|
+
supportingColor: "primaryForeground"
|
|
18680
|
+
})
|
|
17703
18681
|
}
|
|
17704
18682
|
}
|
|
17705
18683
|
});
|
|
@@ -19087,6 +20065,8 @@ const curatedSiteStyles = [
|
|
|
19087
20065
|
},
|
|
19088
20066
|
compositionBudget: quietBudget,
|
|
19089
20067
|
typography: fulcrumTypography,
|
|
20068
|
+
designRuntimeRules: fulcrumDesignRuntimeRules,
|
|
20069
|
+
recommendedAppearancePresetIds: ["cta-accent-band"],
|
|
19090
20070
|
themeOverrides: {
|
|
19091
20071
|
shadow: { colorToken: "primary" },
|
|
19092
20072
|
accordions: {
|
|
@@ -22555,9 +23535,15 @@ function createButtonGroup(options = {}) {
|
|
|
22555
23535
|
//#endregion
|
|
22556
23536
|
//#region ../blocks/src/system/fields/ctas.ts
|
|
22557
23537
|
function createCtasRepeater(options = {}) {
|
|
22558
|
-
const { id = "ctas", label = "Calls to action", itemLabel = "CTA", minItems = 0, maxItems, button } = options;
|
|
23538
|
+
const { id = "ctas", label = "Calls to action", itemLabel = "CTA", minItems = 0, maxItems, button, defaultValue } = options;
|
|
23539
|
+
const fieldId = id;
|
|
23540
|
+
const buttonField = createButtonGroup({
|
|
23541
|
+
showGroupLabel: false,
|
|
23542
|
+
...button ?? {},
|
|
23543
|
+
flattenInRepeater: true
|
|
23544
|
+
});
|
|
22559
23545
|
return {
|
|
22560
|
-
id,
|
|
23546
|
+
id: fieldId,
|
|
22561
23547
|
type: "repeater",
|
|
22562
23548
|
label,
|
|
22563
23549
|
itemLabel,
|
|
@@ -22566,11 +23552,8 @@ function createCtasRepeater(options = {}) {
|
|
|
22566
23552
|
maxItems,
|
|
22567
23553
|
required: false,
|
|
22568
23554
|
allowConversion: true,
|
|
22569
|
-
|
|
22570
|
-
|
|
22571
|
-
...button ?? {},
|
|
22572
|
-
flattenInRepeater: true
|
|
22573
|
-
})] }
|
|
23555
|
+
...defaultValue !== void 0 ? { defaultValue: [...defaultValue] } : {},
|
|
23556
|
+
schema: { fields: [buttonField] }
|
|
22574
23557
|
};
|
|
22575
23558
|
}
|
|
22576
23559
|
//#endregion
|
|
@@ -22620,6 +23603,7 @@ const heroCtaRowFragment = defineFragment({
|
|
|
22620
23603
|
label: "Calls to action",
|
|
22621
23604
|
itemLabel: "CTA",
|
|
22622
23605
|
maxItems: 3,
|
|
23606
|
+
defaultValue: [],
|
|
22623
23607
|
button: {
|
|
22624
23608
|
variants: [
|
|
22625
23609
|
{
|
|
@@ -22687,7 +23671,7 @@ const ctaCopyFragment = defineFragment({
|
|
|
22687
23671
|
eyebrowPath: "content.eyebrow",
|
|
22688
23672
|
titlePath: "content.title",
|
|
22689
23673
|
className: "cta-heading"
|
|
22690
|
-
}), richText({ className: "cta-content rb-prose rb-mx-auto rb-max-w-none" }, when("content
|
|
23674
|
+
}), richText({ className: "cta-content rb-prose rb-mx-auto rb-max-w-none" }, when("content"), bind("content"))]
|
|
22691
23675
|
});
|
|
22692
23676
|
//#endregion
|
|
22693
23677
|
//#region ../blocks/src/system/fragments/library/testimonialsHeading.ts
|
|
@@ -24904,6 +25888,7 @@ function createBlockManifest(config) {
|
|
|
24904
25888
|
previewCustomize: config.previewCustomize,
|
|
24905
25889
|
category: config.category,
|
|
24906
25890
|
contentTypes: config.contentTypes ? [...config.contentTypes] : void 0,
|
|
25891
|
+
contentSource: config.contentSource,
|
|
24907
25892
|
tags: config.tags ? [...config.tags] : [],
|
|
24908
25893
|
icon: config.icon ?? "Box",
|
|
24909
25894
|
layout,
|
|
@@ -25049,6 +26034,7 @@ const heroBlockDefinition = { manifest: createBlockManifest({
|
|
|
25049
26034
|
title: "Hero",
|
|
25050
26035
|
titleSource: "headline",
|
|
25051
26036
|
category: "layout",
|
|
26037
|
+
contentSource: { kind: "inline" },
|
|
25052
26038
|
includeContainerStyles: true,
|
|
25053
26039
|
promotedFields: ["_sectionStyles.background.image"],
|
|
25054
26040
|
fragments: [
|
|
@@ -25322,6 +26308,7 @@ const introBlockDefinition = { manifest: createBlockManifest({
|
|
|
25322
26308
|
id: "block.intro",
|
|
25323
26309
|
title: "Intro",
|
|
25324
26310
|
category: "layout",
|
|
26311
|
+
contentSource: { kind: "inline" },
|
|
25325
26312
|
includeContainerStyles: true,
|
|
25326
26313
|
titleSource: "title",
|
|
25327
26314
|
previewCustomize: { quickFieldPriority: [
|
|
@@ -25507,6 +26494,7 @@ const bodyTextBlockDefinition = { manifest: createBlockManifest({
|
|
|
25507
26494
|
title: "Body Text",
|
|
25508
26495
|
titleSource: "heading",
|
|
25509
26496
|
category: "content",
|
|
26497
|
+
contentSource: { kind: "inline" },
|
|
25510
26498
|
fragments: [{
|
|
25511
26499
|
fragment: bodyCopyFragment,
|
|
25512
26500
|
fieldPriority: 0
|
|
@@ -25563,6 +26551,10 @@ const blogPostBlockDefinition = {
|
|
|
25563
26551
|
description: "Highlights a single blog post with title, image, and excerpt.",
|
|
25564
26552
|
category: "blog",
|
|
25565
26553
|
contentTypes: ["post"],
|
|
26554
|
+
contentSource: {
|
|
26555
|
+
kind: "entries",
|
|
26556
|
+
contentType: "post"
|
|
26557
|
+
},
|
|
25566
26558
|
tags: [
|
|
25567
26559
|
"blog",
|
|
25568
26560
|
"post",
|
|
@@ -25860,6 +26852,10 @@ const blogListingManifest = createBlockManifest({
|
|
|
25860
26852
|
],
|
|
25861
26853
|
description: "Display a collection of blog posts in grid or stack layout.",
|
|
25862
26854
|
contentTypes: ["post"],
|
|
26855
|
+
contentSource: {
|
|
26856
|
+
kind: "entries",
|
|
26857
|
+
contentType: "post"
|
|
26858
|
+
},
|
|
25863
26859
|
tags: [
|
|
25864
26860
|
"blog",
|
|
25865
26861
|
"posts",
|
|
@@ -25902,6 +26898,7 @@ const ctaFullBlockDefinition = { manifest: createBlockManifest({
|
|
|
25902
26898
|
id: "block.cta-full",
|
|
25903
26899
|
title: "Full-width CTA",
|
|
25904
26900
|
category: "marketing",
|
|
26901
|
+
contentSource: { kind: "inline" },
|
|
25905
26902
|
fragments: [{
|
|
25906
26903
|
fragment: ctaCopyFragment,
|
|
25907
26904
|
fieldPriority: 0
|
|
@@ -25935,6 +26932,7 @@ const singleButtonBlockDefinition = { manifest: createBlockManifest({
|
|
|
25935
26932
|
id: "block.single-button",
|
|
25936
26933
|
title: "Single Button",
|
|
25937
26934
|
category: "marketing",
|
|
26935
|
+
contentSource: { kind: "inline" },
|
|
25938
26936
|
fragments: [{
|
|
25939
26937
|
fragment: singleButtonFragment,
|
|
25940
26938
|
fieldPriority: 0
|
|
@@ -26217,6 +27215,7 @@ const formManifest = createBlockManifest({
|
|
|
26217
27215
|
paletteHidden: false
|
|
26218
27216
|
},
|
|
26219
27217
|
category: "interactive",
|
|
27218
|
+
contentSource: { kind: "inline" },
|
|
26220
27219
|
tags: [
|
|
26221
27220
|
"form",
|
|
26222
27221
|
"contact",
|
|
@@ -26279,6 +27278,7 @@ const contactNewsletterBlockDefinition = {
|
|
|
26279
27278
|
titleSource: "contactTitle",
|
|
26280
27279
|
description: "Two-column newsletter signup and contact form section.",
|
|
26281
27280
|
category: "interactive",
|
|
27281
|
+
contentSource: { kind: "inline" },
|
|
26282
27282
|
layout: contactNewsletterLayout,
|
|
26283
27283
|
defaultVariant: "default",
|
|
26284
27284
|
variants: { default: contactNewsletterLayout },
|
|
@@ -26482,6 +27482,7 @@ const faqBlockDefinition = { manifest: createBlockManifest({
|
|
|
26482
27482
|
title: "FAQ",
|
|
26483
27483
|
titleSource: "title",
|
|
26484
27484
|
category: "content",
|
|
27485
|
+
contentSource: { kind: "inline" },
|
|
26485
27486
|
includeContainerStyles: true,
|
|
26486
27487
|
fragments: [{
|
|
26487
27488
|
fragment: faqHeadingFragment,
|
|
@@ -26782,7 +27783,7 @@ const heroTitleLengthThresholds = {
|
|
|
26782
27783
|
maxWords: 11
|
|
26783
27784
|
}
|
|
26784
27785
|
};
|
|
26785
|
-
function isPlainObject$
|
|
27786
|
+
function isPlainObject$4(value) {
|
|
26786
27787
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
26787
27788
|
}
|
|
26788
27789
|
function readString$1(obj, key) {
|
|
@@ -26791,7 +27792,7 @@ function readString$1(obj, key) {
|
|
|
26791
27792
|
}
|
|
26792
27793
|
function resolveGeneratedHeroLayoutStyles(content) {
|
|
26793
27794
|
const raw = content._heroLayoutStyles;
|
|
26794
|
-
return isPlainObject$
|
|
27795
|
+
return isPlainObject$4(raw) ? raw : null;
|
|
26795
27796
|
}
|
|
26796
27797
|
function readHeroLayoutString(content, generatedKey, fallbackKey = generatedKey) {
|
|
26797
27798
|
const explicitValue = readString$1(content, fallbackKey);
|
|
@@ -26847,7 +27848,7 @@ const heroContentWrapperClassTransform = {
|
|
|
26847
27848
|
summary: "Resolve hero content wrapper className from alignment + max width controls",
|
|
26848
27849
|
schema: z$1.object({ base: z$1.string().optional() }),
|
|
26849
27850
|
run: (value, options, context) => {
|
|
26850
|
-
const content = isPlainObject$
|
|
27851
|
+
const content = isPlainObject$4(value) ? value : isPlainObject$4(context.data) ? context.data : {};
|
|
26851
27852
|
const alignment = resolveHeroContentAlignment(content);
|
|
26852
27853
|
const maxWidth = resolveHeroContentMaxWidth(content);
|
|
26853
27854
|
const typographyScale = resolveHeroTypographyScale(content);
|
|
@@ -26870,7 +27871,7 @@ const heroCtaJustifyTransform = {
|
|
|
26870
27871
|
kind: "string",
|
|
26871
27872
|
summary: "Map hero contentAlignment to CTA row justify value",
|
|
26872
27873
|
run: (value, _options, context) => {
|
|
26873
|
-
const alignment = resolveHeroContentAlignment(isPlainObject$
|
|
27874
|
+
const alignment = resolveHeroContentAlignment(isPlainObject$4(value) ? value : isPlainObject$4(context.data) ? context.data : {});
|
|
26874
27875
|
return alignment === "left" ? "start" : alignment === "right" ? "end" : "center";
|
|
26875
27876
|
}
|
|
26876
27877
|
};
|
|
@@ -26879,7 +27880,7 @@ const heroStackJustifyFromVerticalAlignmentTransform = {
|
|
|
26879
27880
|
kind: "string",
|
|
26880
27881
|
summary: "Map hero verticalAlignment to stack justify value",
|
|
26881
27882
|
run: (value, _options, context) => {
|
|
26882
|
-
const vertical = resolveHeroVerticalAlignment(isPlainObject$
|
|
27883
|
+
const vertical = resolveHeroVerticalAlignment(isPlainObject$4(value) ? value : isPlainObject$4(context.data) ? context.data : {});
|
|
26883
27884
|
return vertical === "top" ? "start" : vertical === "bottom" ? "end" : "center";
|
|
26884
27885
|
}
|
|
26885
27886
|
};
|
|
@@ -26889,7 +27890,7 @@ const heroGridClassFromVerticalAlignmentTransform = {
|
|
|
26889
27890
|
summary: "Append align-items class for hero split layouts based on verticalAlignment",
|
|
26890
27891
|
schema: z$1.object({ base: z$1.string() }),
|
|
26891
27892
|
run: (value, options, context) => {
|
|
26892
|
-
const vertical = resolveHeroVerticalAlignment(isPlainObject$
|
|
27893
|
+
const vertical = resolveHeroVerticalAlignment(isPlainObject$4(value) ? value : isPlainObject$4(context.data) ? context.data : {});
|
|
26893
27894
|
const itemsClass = vertical === "top" ? "rb-items-start" : vertical === "bottom" ? "rb-items-end" : "rb-items-center";
|
|
26894
27895
|
return joinClasses$3([options.base, itemsClass]);
|
|
26895
27896
|
}
|
|
@@ -28206,6 +29207,7 @@ const siteHeaderManifest = createBlockManifest({
|
|
|
28206
29207
|
id: "block.site-header",
|
|
28207
29208
|
title: "Site Header",
|
|
28208
29209
|
category: "layout",
|
|
29210
|
+
contentSource: { kind: "inline" },
|
|
28209
29211
|
additionalFields: [{
|
|
28210
29212
|
id: "mode",
|
|
28211
29213
|
type: "select",
|
|
@@ -28411,6 +29413,7 @@ const siteFooterManifest = createBlockManifest({
|
|
|
28411
29413
|
id: "block.site-footer",
|
|
28412
29414
|
title: "Site Footer",
|
|
28413
29415
|
category: "layout",
|
|
29416
|
+
contentSource: { kind: "inline" },
|
|
28414
29417
|
skipSectionStyles: true,
|
|
28415
29418
|
layout: section$1({
|
|
28416
29419
|
background: "background",
|
|
@@ -28561,6 +29564,7 @@ const testimonialsBlockDefinition = {
|
|
|
28561
29564
|
id: "block.testimonials",
|
|
28562
29565
|
title: "Testimonials",
|
|
28563
29566
|
category: "marketing",
|
|
29567
|
+
contentSource: { kind: "inline" },
|
|
28564
29568
|
includeContainerStyles: true,
|
|
28565
29569
|
previewCustomize: { quickFieldPriority: [
|
|
28566
29570
|
"avatarLayout",
|
|
@@ -28719,6 +29723,7 @@ const columnsBlockDefinition = { manifest: createBlockManifest({
|
|
|
28719
29723
|
id: "block.columns",
|
|
28720
29724
|
title: "Columns",
|
|
28721
29725
|
category: "layout",
|
|
29726
|
+
contentSource: { kind: "inline" },
|
|
28722
29727
|
additionalFields: [
|
|
28723
29728
|
parseFieldDefinition({
|
|
28724
29729
|
id: "equalHeight",
|
|
@@ -28952,6 +29957,7 @@ const collectionBlockDefinition = { manifest: createBlockManifest({
|
|
|
28952
29957
|
id: "block.collection",
|
|
28953
29958
|
title: "Collection",
|
|
28954
29959
|
category: "layout",
|
|
29960
|
+
contentSource: { kind: "inline" },
|
|
28955
29961
|
additionalFields: [
|
|
28956
29962
|
parseFieldDefinition({
|
|
28957
29963
|
id: "layout",
|
|
@@ -29239,6 +30245,7 @@ const featureCardsBlockDefinition = { manifest: createBlockManifest({
|
|
|
29239
30245
|
id: "block.feature-cards",
|
|
29240
30246
|
title: "Feature Cards",
|
|
29241
30247
|
category: "layout",
|
|
30248
|
+
contentSource: { kind: "inline" },
|
|
29242
30249
|
includeContainerStyles: true,
|
|
29243
30250
|
titleSource: "title",
|
|
29244
30251
|
additionalFields: [
|
|
@@ -29622,6 +30629,7 @@ const mediaTextBlockDefinition = { manifest: createBlockManifest({
|
|
|
29622
30629
|
id: "block.media-text",
|
|
29623
30630
|
title: "Media and Text",
|
|
29624
30631
|
category: "layout",
|
|
30632
|
+
contentSource: { kind: "inline" },
|
|
29625
30633
|
includeContainerStyles: true,
|
|
29626
30634
|
titleSource: "title",
|
|
29627
30635
|
previewCustomize: { quickFieldPriority: [
|
|
@@ -30022,6 +31030,7 @@ const appointmentBookingBlockDefinition = {
|
|
|
30022
31030
|
paletteHidden: false
|
|
30023
31031
|
},
|
|
30024
31032
|
category: "interactive",
|
|
31033
|
+
contentSource: { kind: "inline" },
|
|
30025
31034
|
tags: [
|
|
30026
31035
|
"booking",
|
|
30027
31036
|
"appointment",
|
|
@@ -30186,6 +31195,7 @@ const weeklySlotAvailabilityManifest = createBlockManifest({
|
|
|
30186
31195
|
paletteHidden: false
|
|
30187
31196
|
},
|
|
30188
31197
|
category: "interactive",
|
|
31198
|
+
contentSource: { kind: "inline" },
|
|
30189
31199
|
tags: [
|
|
30190
31200
|
"booking",
|
|
30191
31201
|
"appointment",
|
|
@@ -31881,6 +32891,7 @@ const eventRegistrationBlockDefinition = {
|
|
|
31881
32891
|
titleSource: "heading",
|
|
31882
32892
|
description: "Multi-step event registration form",
|
|
31883
32893
|
category: "interactive",
|
|
32894
|
+
contentSource: { kind: "inline" },
|
|
31884
32895
|
tags: [
|
|
31885
32896
|
"events",
|
|
31886
32897
|
"registration",
|
|
@@ -31987,15 +32998,9 @@ const eventRegistrationBlockDefinition = {
|
|
|
31987
32998
|
defaultValue: "Complete Registration",
|
|
31988
32999
|
maxLength: 40
|
|
31989
33000
|
},
|
|
31990
|
-
{
|
|
31991
|
-
id: "buttonVariant",
|
|
31992
|
-
type: "select",
|
|
31993
|
-
label: "Button style",
|
|
33001
|
+
createButtonVariantField({
|
|
31994
33002
|
description: "Choose a button style from your theme",
|
|
31995
|
-
|
|
31996
|
-
multiple: false,
|
|
31997
|
-
defaultValue: "primary",
|
|
31998
|
-
options: [
|
|
33003
|
+
variants: [
|
|
31999
33004
|
{
|
|
32000
33005
|
value: "primary",
|
|
32001
33006
|
label: "Primary"
|
|
@@ -32008,9 +33013,8 @@ const eventRegistrationBlockDefinition = {
|
|
|
32008
33013
|
value: "outline",
|
|
32009
33014
|
label: "Outline"
|
|
32010
33015
|
}
|
|
32011
|
-
]
|
|
32012
|
-
|
|
32013
|
-
}
|
|
33016
|
+
]
|
|
33017
|
+
})
|
|
32014
33018
|
],
|
|
32015
33019
|
layout: [styledSection({
|
|
32016
33020
|
baseClass: "",
|
|
@@ -32385,6 +33389,7 @@ const courseRegistrationBlockDefinition = {
|
|
|
32385
33389
|
titleSource: "heading",
|
|
32386
33390
|
description: "Enrollment form for multi-session courses",
|
|
32387
33391
|
category: "interactive",
|
|
33392
|
+
contentSource: { kind: "inline" },
|
|
32388
33393
|
tags: [
|
|
32389
33394
|
"courses",
|
|
32390
33395
|
"enrollment",
|
|
@@ -32498,15 +33503,9 @@ const courseRegistrationBlockDefinition = {
|
|
|
32498
33503
|
defaultValue: "Sign up",
|
|
32499
33504
|
maxLength: 40
|
|
32500
33505
|
},
|
|
32501
|
-
{
|
|
32502
|
-
id: "buttonVariant",
|
|
32503
|
-
type: "select",
|
|
32504
|
-
label: "Button style",
|
|
33506
|
+
createButtonVariantField({
|
|
32505
33507
|
description: "Choose a button style from your theme",
|
|
32506
|
-
|
|
32507
|
-
multiple: false,
|
|
32508
|
-
defaultValue: "primary",
|
|
32509
|
-
options: [
|
|
33508
|
+
variants: [
|
|
32510
33509
|
{
|
|
32511
33510
|
value: "primary",
|
|
32512
33511
|
label: "Primary"
|
|
@@ -32519,9 +33518,8 @@ const courseRegistrationBlockDefinition = {
|
|
|
32519
33518
|
value: "outline",
|
|
32520
33519
|
label: "Outline"
|
|
32521
33520
|
}
|
|
32522
|
-
]
|
|
32523
|
-
|
|
32524
|
-
}
|
|
33521
|
+
]
|
|
33522
|
+
})
|
|
32525
33523
|
],
|
|
32526
33524
|
layout: [styledSection({
|
|
32527
33525
|
baseClass: "",
|
|
@@ -32601,6 +33599,7 @@ const eventDetailsManifest = createBlockManifest({
|
|
|
32601
33599
|
titleSource: "heading",
|
|
32602
33600
|
description: "Date/time, venue, map, and other dates for an event",
|
|
32603
33601
|
category: "content",
|
|
33602
|
+
contentSource: { kind: "entries" },
|
|
32604
33603
|
tags: [
|
|
32605
33604
|
"events",
|
|
32606
33605
|
"venue",
|
|
@@ -32806,6 +33805,7 @@ const courseDetailsBlockDefinition = {
|
|
|
32806
33805
|
titleSource: "heading",
|
|
32807
33806
|
description: "Schedule, venue, price, and enrollment status for a course",
|
|
32808
33807
|
category: "content",
|
|
33808
|
+
contentSource: { kind: "entries" },
|
|
32809
33809
|
tags: [
|
|
32810
33810
|
"courses",
|
|
32811
33811
|
"schedule",
|
|
@@ -33097,6 +34097,7 @@ const eventSpotlightBlockDefinition = {
|
|
|
33097
34097
|
paletteHidden: false
|
|
33098
34098
|
},
|
|
33099
34099
|
category: "content",
|
|
34100
|
+
contentSource: { kind: "entries" },
|
|
33100
34101
|
tags: [
|
|
33101
34102
|
"events",
|
|
33102
34103
|
"featured",
|
|
@@ -35965,6 +36966,7 @@ const eventListingBlockDefinition = {
|
|
|
35965
36966
|
paletteHidden: true
|
|
35966
36967
|
},
|
|
35967
36968
|
category: "interactive",
|
|
36969
|
+
contentSource: { kind: "entries" },
|
|
35968
36970
|
tags: [
|
|
35969
36971
|
"events",
|
|
35970
36972
|
"listing",
|
|
@@ -37170,6 +38172,7 @@ const eventCalendarBlockDefinition = {
|
|
|
37170
38172
|
paletteHidden: false
|
|
37171
38173
|
},
|
|
37172
38174
|
category: "interactive",
|
|
38175
|
+
contentSource: { kind: "entries" },
|
|
37173
38176
|
tags: [
|
|
37174
38177
|
"events",
|
|
37175
38178
|
"calendar",
|
|
@@ -37567,6 +38570,7 @@ const recurringScheduleBlockDefinition = {
|
|
|
37567
38570
|
titleSource: "heading",
|
|
37568
38571
|
description: "A compact weekly schedule with one row per recurring series.",
|
|
37569
38572
|
category: "interactive",
|
|
38573
|
+
contentSource: { kind: "entries" },
|
|
37570
38574
|
icon: "CalendarDays",
|
|
37571
38575
|
tags: [
|
|
37572
38576
|
"schedule",
|
|
@@ -38197,7 +39201,10 @@ const offeringsPreviewFields = [
|
|
|
38197
39201
|
label: "Link"
|
|
38198
39202
|
}
|
|
38199
39203
|
],
|
|
38200
|
-
ui: {
|
|
39204
|
+
ui: {
|
|
39205
|
+
intent: "display",
|
|
39206
|
+
widget: "buttonVariant"
|
|
39207
|
+
}
|
|
38201
39208
|
},
|
|
38202
39209
|
{
|
|
38203
39210
|
id: "buttonText",
|
|
@@ -38250,6 +39257,7 @@ const offeringsPreviewManifest = createBlockManifest({
|
|
|
38250
39257
|
paletteHidden: false
|
|
38251
39258
|
},
|
|
38252
39259
|
category: "content",
|
|
39260
|
+
contentSource: { kind: "mixed" },
|
|
38253
39261
|
tags: [
|
|
38254
39262
|
"offerings",
|
|
38255
39263
|
"events",
|
|
@@ -38418,6 +39426,7 @@ const embedManifest = createBlockManifest({
|
|
|
38418
39426
|
id: "block.embed",
|
|
38419
39427
|
title: "Embed Content",
|
|
38420
39428
|
category: "content",
|
|
39429
|
+
contentSource: { kind: "entries" },
|
|
38421
39430
|
titleSource: "heading",
|
|
38422
39431
|
additionalFields: [
|
|
38423
39432
|
parseFieldDefinition({
|
|
@@ -38905,6 +39914,7 @@ const imageGalleryBlockDefinition = { manifest: createBlockManifest({
|
|
|
38905
39914
|
id: "block.image-gallery",
|
|
38906
39915
|
title: "Image Gallery",
|
|
38907
39916
|
category: "content",
|
|
39917
|
+
contentSource: { kind: "inline" },
|
|
38908
39918
|
previewCustomize: { quickFieldPriority: [
|
|
38909
39919
|
"aspectRatio",
|
|
38910
39920
|
"slidesToShow",
|
|
@@ -39557,6 +40567,7 @@ const videoGridBlockDefinition = { manifest: createBlockManifest({
|
|
|
39557
40567
|
id: "block.video-grid",
|
|
39558
40568
|
title: "Video Grid",
|
|
39559
40569
|
category: "media",
|
|
40570
|
+
contentSource: { kind: "inline" },
|
|
39560
40571
|
skipSectionStyles: true,
|
|
39561
40572
|
additionalFields: parseFieldDefinitions([
|
|
39562
40573
|
{
|
|
@@ -39727,6 +40738,7 @@ const audioPlayerBlockDefinition = { manifest: createBlockManifest({
|
|
|
39727
40738
|
title: "Audio Player",
|
|
39728
40739
|
titleSource: "title",
|
|
39729
40740
|
category: "media",
|
|
40741
|
+
contentSource: { kind: "inline" },
|
|
39730
40742
|
description: "Add a branded audio player for a single track.",
|
|
39731
40743
|
tags: [
|
|
39732
40744
|
"audio",
|
|
@@ -39838,6 +40850,7 @@ const fileDownloadBlockDefinition = { manifest: createBlockManifest({
|
|
|
39838
40850
|
title: "File Download",
|
|
39839
40851
|
titleSource: ["title", "file.filename"],
|
|
39840
40852
|
category: "media",
|
|
40853
|
+
contentSource: { kind: "inline" },
|
|
39841
40854
|
description: "Add a simple public download link for a document, ZIP, or audio file.",
|
|
39842
40855
|
tags: [
|
|
39843
40856
|
"file",
|
|
@@ -40857,6 +41870,7 @@ const shopBlockDefinition = {
|
|
|
40857
41870
|
paletteHidden: false
|
|
40858
41871
|
},
|
|
40859
41872
|
category: "interactive",
|
|
41873
|
+
contentSource: { kind: "entries" },
|
|
40860
41874
|
tags: [
|
|
40861
41875
|
"shop",
|
|
40862
41876
|
"passes",
|
|
@@ -41056,6 +42070,7 @@ const productListBlockDefinition = {
|
|
|
41056
42070
|
paletteHidden: false
|
|
41057
42071
|
},
|
|
41058
42072
|
category: "interactive",
|
|
42073
|
+
contentSource: { kind: "entries" },
|
|
41059
42074
|
tags: [
|
|
41060
42075
|
"shop",
|
|
41061
42076
|
"products",
|
|
@@ -41197,6 +42212,7 @@ const productDetailBlockDefinition = {
|
|
|
41197
42212
|
paletteHidden: false
|
|
41198
42213
|
},
|
|
41199
42214
|
category: "interactive",
|
|
42215
|
+
contentSource: { kind: "entries" },
|
|
41200
42216
|
tags: [
|
|
41201
42217
|
"shop",
|
|
41202
42218
|
"product",
|
|
@@ -41313,6 +42329,7 @@ const cartBlockDefinition = {
|
|
|
41313
42329
|
paletteHidden: false
|
|
41314
42330
|
},
|
|
41315
42331
|
category: "interactive",
|
|
42332
|
+
contentSource: { kind: "inline" },
|
|
41316
42333
|
tags: [
|
|
41317
42334
|
"shop",
|
|
41318
42335
|
"cart",
|
|
@@ -41395,6 +42412,7 @@ const checkoutBlockDefinition = {
|
|
|
41395
42412
|
paletteHidden: false
|
|
41396
42413
|
},
|
|
41397
42414
|
category: "interactive",
|
|
42415
|
+
contentSource: { kind: "inline" },
|
|
41398
42416
|
tags: [
|
|
41399
42417
|
"shop",
|
|
41400
42418
|
"checkout",
|
|
@@ -41609,6 +42627,7 @@ const giftingBlockDefinition = {
|
|
|
41609
42627
|
paletteHidden: false
|
|
41610
42628
|
},
|
|
41611
42629
|
category: "interactive",
|
|
42630
|
+
contentSource: { kind: "entries" },
|
|
41612
42631
|
tags: [
|
|
41613
42632
|
"gifting",
|
|
41614
42633
|
"gift cards",
|
|
@@ -41981,6 +43000,7 @@ const newsletterSignupBlockDefinition = {
|
|
|
41981
43000
|
titleSource: "title",
|
|
41982
43001
|
description: "Newsletter subscription form with configurable field presets.",
|
|
41983
43002
|
category: "interactive",
|
|
43003
|
+
contentSource: { kind: "inline" },
|
|
41984
43004
|
fragments: [{
|
|
41985
43005
|
fragment: newsletterCopyFragment,
|
|
41986
43006
|
fieldPriority: 0
|
|
@@ -42162,6 +43182,7 @@ const teamMembersBlockDefinition = {
|
|
|
42162
43182
|
id: "block.team-members",
|
|
42163
43183
|
title: "Team Members",
|
|
42164
43184
|
category: "content",
|
|
43185
|
+
contentSource: { kind: "mixed" },
|
|
42165
43186
|
titleSource: "heading",
|
|
42166
43187
|
additionalFields: [
|
|
42167
43188
|
parseFieldDefinition({
|
|
@@ -42602,6 +43623,7 @@ const locationMapBlockDefinition = {
|
|
|
42602
43623
|
titleSource: "heading",
|
|
42603
43624
|
description: "Show a business location with an interactive map and directions link.",
|
|
42604
43625
|
category: "content",
|
|
43626
|
+
contentSource: { kind: "inline" },
|
|
42605
43627
|
tags: [
|
|
42606
43628
|
"map",
|
|
42607
43629
|
"location",
|
|
@@ -43608,213 +44630,6 @@ function getBlockDefinition(name) {
|
|
|
43608
44630
|
return blockStore.get(name);
|
|
43609
44631
|
}
|
|
43610
44632
|
//#endregion
|
|
43611
|
-
//#region ../theme-core/src/gradients/presets.ts
|
|
43612
|
-
/**
|
|
43613
|
-
* Curated library of gradient presets
|
|
43614
|
-
* All gradients use theme color tokens, so they adapt to the site's palette
|
|
43615
|
-
*/
|
|
43616
|
-
const GRADIENT_PRESETS = [
|
|
43617
|
-
{
|
|
43618
|
-
id: "primary-secondary",
|
|
43619
|
-
name: "Primary to Secondary",
|
|
43620
|
-
description: "Blend your primary and secondary brand colors",
|
|
43621
|
-
type: "linear",
|
|
43622
|
-
angle: 135,
|
|
43623
|
-
stops: [{
|
|
43624
|
-
color: "primary-500",
|
|
43625
|
-
position: 0
|
|
43626
|
-
}, {
|
|
43627
|
-
color: "secondary-500",
|
|
43628
|
-
position: 100
|
|
43629
|
-
}]
|
|
43630
|
-
},
|
|
43631
|
-
{
|
|
43632
|
-
id: "primary-accent",
|
|
43633
|
-
name: "Primary to Accent",
|
|
43634
|
-
description: "Energetic gradient from primary to accent",
|
|
43635
|
-
type: "linear",
|
|
43636
|
-
angle: 135,
|
|
43637
|
-
stops: [{
|
|
43638
|
-
color: "primary-500",
|
|
43639
|
-
position: 0
|
|
43640
|
-
}, {
|
|
43641
|
-
color: "accent-500",
|
|
43642
|
-
position: 100
|
|
43643
|
-
}]
|
|
43644
|
-
},
|
|
43645
|
-
{
|
|
43646
|
-
id: "secondary-accent",
|
|
43647
|
-
name: "Secondary to Accent",
|
|
43648
|
-
description: "Vibrant secondary to accent blend",
|
|
43649
|
-
type: "linear",
|
|
43650
|
-
angle: 135,
|
|
43651
|
-
stops: [{
|
|
43652
|
-
color: "secondary-500",
|
|
43653
|
-
position: 0
|
|
43654
|
-
}, {
|
|
43655
|
-
color: "accent-500",
|
|
43656
|
-
position: 100
|
|
43657
|
-
}]
|
|
43658
|
-
},
|
|
43659
|
-
{
|
|
43660
|
-
id: "primary-light-dark",
|
|
43661
|
-
name: "Primary Light to Dark",
|
|
43662
|
-
description: "Subtle primary color fade",
|
|
43663
|
-
type: "linear",
|
|
43664
|
-
angle: 180,
|
|
43665
|
-
stops: [{
|
|
43666
|
-
color: "primary-500",
|
|
43667
|
-
position: 0
|
|
43668
|
-
}, {
|
|
43669
|
-
color: "primary-900",
|
|
43670
|
-
position: 100
|
|
43671
|
-
}]
|
|
43672
|
-
},
|
|
43673
|
-
{
|
|
43674
|
-
id: "primary-dark-light",
|
|
43675
|
-
name: "Primary Dark to Light",
|
|
43676
|
-
description: "Reverse primary fade",
|
|
43677
|
-
type: "linear",
|
|
43678
|
-
angle: 180,
|
|
43679
|
-
stops: [{
|
|
43680
|
-
color: "primary-900",
|
|
43681
|
-
position: 0
|
|
43682
|
-
}, {
|
|
43683
|
-
color: "primary-50",
|
|
43684
|
-
position: 100
|
|
43685
|
-
}]
|
|
43686
|
-
},
|
|
43687
|
-
{
|
|
43688
|
-
id: "secondary-light-dark",
|
|
43689
|
-
name: "Secondary Light to Dark",
|
|
43690
|
-
description: "Subtle secondary color fade",
|
|
43691
|
-
type: "linear",
|
|
43692
|
-
angle: 180,
|
|
43693
|
-
stops: [{
|
|
43694
|
-
color: "secondary-500",
|
|
43695
|
-
position: 0
|
|
43696
|
-
}, {
|
|
43697
|
-
color: "secondary-900",
|
|
43698
|
-
position: 100
|
|
43699
|
-
}]
|
|
43700
|
-
},
|
|
43701
|
-
{
|
|
43702
|
-
id: "accent-light-dark",
|
|
43703
|
-
name: "Accent Light to Dark",
|
|
43704
|
-
description: "Accent color depth fade",
|
|
43705
|
-
type: "linear",
|
|
43706
|
-
angle: 180,
|
|
43707
|
-
stops: [{
|
|
43708
|
-
color: "accent-500",
|
|
43709
|
-
position: 0
|
|
43710
|
-
}, {
|
|
43711
|
-
color: "accent-900",
|
|
43712
|
-
position: 100
|
|
43713
|
-
}]
|
|
43714
|
-
},
|
|
43715
|
-
{
|
|
43716
|
-
id: "background-surface",
|
|
43717
|
-
name: "Background to Surface",
|
|
43718
|
-
description: "Subtle depth using base colors",
|
|
43719
|
-
type: "linear",
|
|
43720
|
-
angle: 180,
|
|
43721
|
-
stops: [{
|
|
43722
|
-
color: "background",
|
|
43723
|
-
position: 0
|
|
43724
|
-
}, {
|
|
43725
|
-
color: "surface",
|
|
43726
|
-
position: 100
|
|
43727
|
-
}]
|
|
43728
|
-
},
|
|
43729
|
-
{
|
|
43730
|
-
id: "neutral-fade",
|
|
43731
|
-
name: "Neutral Gradient",
|
|
43732
|
-
description: "Elegant neutral color fade",
|
|
43733
|
-
type: "linear",
|
|
43734
|
-
angle: 180,
|
|
43735
|
-
stops: [{
|
|
43736
|
-
color: "neutral-900",
|
|
43737
|
-
position: 0
|
|
43738
|
-
}, {
|
|
43739
|
-
color: "neutral-50",
|
|
43740
|
-
position: 100
|
|
43741
|
-
}]
|
|
43742
|
-
},
|
|
43743
|
-
{
|
|
43744
|
-
id: "primary-radial",
|
|
43745
|
-
name: "Primary Spotlight",
|
|
43746
|
-
description: "Radial primary gradient from center",
|
|
43747
|
-
type: "radial",
|
|
43748
|
-
position: "center",
|
|
43749
|
-
stops: [{
|
|
43750
|
-
color: "primary-500",
|
|
43751
|
-
position: 0
|
|
43752
|
-
}, {
|
|
43753
|
-
color: "primary-900",
|
|
43754
|
-
position: 100
|
|
43755
|
-
}]
|
|
43756
|
-
},
|
|
43757
|
-
{
|
|
43758
|
-
id: "accent-radial",
|
|
43759
|
-
name: "Accent Spotlight",
|
|
43760
|
-
description: "Radial accent gradient from center",
|
|
43761
|
-
type: "radial",
|
|
43762
|
-
position: "center",
|
|
43763
|
-
stops: [{
|
|
43764
|
-
color: "accent-500",
|
|
43765
|
-
position: 0
|
|
43766
|
-
}, {
|
|
43767
|
-
color: "accent-900",
|
|
43768
|
-
position: 100
|
|
43769
|
-
}]
|
|
43770
|
-
},
|
|
43771
|
-
{
|
|
43772
|
-
id: "primary-secondary-accent",
|
|
43773
|
-
name: "Brand Trio",
|
|
43774
|
-
description: "All three brand colors in harmony",
|
|
43775
|
-
type: "linear",
|
|
43776
|
-
angle: 135,
|
|
43777
|
-
stops: [
|
|
43778
|
-
{
|
|
43779
|
-
color: "primary-500",
|
|
43780
|
-
position: 0
|
|
43781
|
-
},
|
|
43782
|
-
{
|
|
43783
|
-
color: "secondary-500",
|
|
43784
|
-
position: 50
|
|
43785
|
-
},
|
|
43786
|
-
{
|
|
43787
|
-
color: "accent-500",
|
|
43788
|
-
position: 100
|
|
43789
|
-
}
|
|
43790
|
-
]
|
|
43791
|
-
}
|
|
43792
|
-
];
|
|
43793
|
-
//#endregion
|
|
43794
|
-
//#region ../theme-core/src/gradients/utils.ts
|
|
43795
|
-
/**
|
|
43796
|
-
* Convert a GradientConfig to a CSS gradient string
|
|
43797
|
-
*
|
|
43798
|
-
* @param config - The gradient configuration using theme tokens
|
|
43799
|
-
* @param tokens - Map of theme color tokens to hex values
|
|
43800
|
-
* @returns CSS gradient string (e.g., "linear-gradient(180deg, #3b82f6 0%, #f59e0b 100%)")
|
|
43801
|
-
*/
|
|
43802
|
-
function gradientToCss(config, tokens) {
|
|
43803
|
-
const stops = config.stops.map((stop) => {
|
|
43804
|
-
return `${tokens[stop.color] ?? "#000000"} ${stop.position}%`;
|
|
43805
|
-
}).join(", ");
|
|
43806
|
-
const type = config.type ?? "linear";
|
|
43807
|
-
if (type === "radial") {
|
|
43808
|
-
const position = config.position ?? "center";
|
|
43809
|
-
return `radial-gradient(${config.shape ?? "circle"} at ${position}, ${stops})`;
|
|
43810
|
-
}
|
|
43811
|
-
if (type === "conic") {
|
|
43812
|
-
const position = config.position ?? "center";
|
|
43813
|
-
return `conic-gradient(from ${config.angle ?? 0}deg at ${position}, ${stops})`;
|
|
43814
|
-
}
|
|
43815
|
-
return `linear-gradient(${config.angle ?? 180}deg, ${stops})`;
|
|
43816
|
-
}
|
|
43817
|
-
//#endregion
|
|
43818
44633
|
//#region ../blocks/src/system/helpers/backgroundMedia.ts
|
|
43819
44634
|
function resolveBackgroundMedia(input) {
|
|
43820
44635
|
const parsedMedia = mediaSchema.safeParse(input.image);
|
|
@@ -43852,9 +44667,9 @@ function appendBackgroundMediaClasses(baseClassName, input) {
|
|
|
43852
44667
|
].filter(Boolean).join(" ");
|
|
43853
44668
|
}
|
|
43854
44669
|
function gradientPresetCss(value) {
|
|
43855
|
-
|
|
43856
|
-
|
|
43857
|
-
|
|
44670
|
+
const presetId = parseGradientPresetId(value);
|
|
44671
|
+
if (!presetId) return null;
|
|
44672
|
+
const preset = getGradientPreset(presetId);
|
|
43858
44673
|
return gradientToCss(preset, Object.fromEntries(preset.stops.map((stop) => [stop.color, `rgb(var(--tb-${stop.color}))`])));
|
|
43859
44674
|
}
|
|
43860
44675
|
const backgroundTransforms = [
|
|
@@ -52949,7 +53764,7 @@ function readFromSource$1(source, segments) {
|
|
|
52949
53764
|
/**
|
|
52950
53765
|
* Type guard for plain objects.
|
|
52951
53766
|
*/
|
|
52952
|
-
function isPlainObject$
|
|
53767
|
+
function isPlainObject$3(value) {
|
|
52953
53768
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
52954
53769
|
}
|
|
52955
53770
|
/**
|
|
@@ -52958,18 +53773,18 @@ function isPlainObject$2(value) {
|
|
|
52958
53773
|
function parseRouteEntry(routeId, value) {
|
|
52959
53774
|
if (typeof routeId !== "string" || routeId.length === 0) return null;
|
|
52960
53775
|
if (typeof value === "string") return [routeId, value];
|
|
52961
|
-
if (isPlainObject$
|
|
53776
|
+
if (isPlainObject$3(value)) return [routeId, value];
|
|
52962
53777
|
return null;
|
|
52963
53778
|
}
|
|
52964
53779
|
/**
|
|
52965
53780
|
* Extracts route map from $root.routes in the viewModel.
|
|
52966
53781
|
*/
|
|
52967
53782
|
function extractRouteMapFromViewModel(viewModel) {
|
|
52968
|
-
if (!isPlainObject$
|
|
53783
|
+
if (!isPlainObject$3(viewModel)) return void 0;
|
|
52969
53784
|
const root = viewModel.$root;
|
|
52970
|
-
if (!isPlainObject$
|
|
53785
|
+
if (!isPlainObject$3(root)) return void 0;
|
|
52971
53786
|
const routes = root.routes;
|
|
52972
|
-
if (!isPlainObject$
|
|
53787
|
+
if (!isPlainObject$3(routes)) return void 0;
|
|
52973
53788
|
const entries = Object.entries(routes).map(([routeId, value]) => parseRouteEntry(routeId, value)).filter((entry) => entry !== null);
|
|
52974
53789
|
if (entries.length === 0) return void 0;
|
|
52975
53790
|
return Object.fromEntries(entries);
|
|
@@ -52978,22 +53793,22 @@ function extractRouteMapFromViewModel(viewModel) {
|
|
|
52978
53793
|
* Extracts pagesByIdentifier from $root.pagesByIdentifier in the viewModel.
|
|
52979
53794
|
*/
|
|
52980
53795
|
function extractPagesByIdentifierFromViewModel(viewModel) {
|
|
52981
|
-
if (!isPlainObject$
|
|
53796
|
+
if (!isPlainObject$3(viewModel)) return void 0;
|
|
52982
53797
|
const root = viewModel.$root;
|
|
52983
|
-
if (!isPlainObject$
|
|
53798
|
+
if (!isPlainObject$3(root)) return void 0;
|
|
52984
53799
|
const pagesByIdentifier = root.pagesByIdentifier;
|
|
52985
|
-
if (!isPlainObject$
|
|
53800
|
+
if (!isPlainObject$3(pagesByIdentifier)) return void 0;
|
|
52986
53801
|
return pagesByIdentifier;
|
|
52987
53802
|
}
|
|
52988
53803
|
/**
|
|
52989
53804
|
* Extracts entriesByIdentifier from $root.entriesByIdentifier in the viewModel.
|
|
52990
53805
|
*/
|
|
52991
53806
|
function extractEntriesByIdentifierFromViewModel(viewModel) {
|
|
52992
|
-
if (!isPlainObject$
|
|
53807
|
+
if (!isPlainObject$3(viewModel)) return void 0;
|
|
52993
53808
|
const root = viewModel.$root;
|
|
52994
|
-
if (!isPlainObject$
|
|
53809
|
+
if (!isPlainObject$3(root)) return void 0;
|
|
52995
53810
|
const entriesByIdentifier = root.entriesByIdentifier;
|
|
52996
|
-
if (!isPlainObject$
|
|
53811
|
+
if (!isPlainObject$3(entriesByIdentifier)) return void 0;
|
|
52997
53812
|
return entriesByIdentifier;
|
|
52998
53813
|
}
|
|
52999
53814
|
/**
|
|
@@ -53015,7 +53830,7 @@ function applyTransformsAndFallback(value, binding, context) {
|
|
|
53015
53830
|
const routeMap = context.routes ?? extractRouteMapFromViewModel(context.viewModel);
|
|
53016
53831
|
const pagesByIdentifier = context.pagesByIdentifier ?? extractPagesByIdentifierFromViewModel(context.viewModel);
|
|
53017
53832
|
const entriesByIdentifier = context.entriesByIdentifier ?? extractEntriesByIdentifierFromViewModel(context.viewModel);
|
|
53018
|
-
const stage = (isPlainObject$
|
|
53833
|
+
const stage = (isPlainObject$3(context.viewModel.$root) ? context.viewModel.$root : null)?.previewStage === "preview" ? "preview" : "published";
|
|
53019
53834
|
const transformed = runTransforms(value, binding.transforms?.map((step) => ({
|
|
53020
53835
|
id: step.id,
|
|
53021
53836
|
options: step.options
|
|
@@ -53044,15 +53859,15 @@ function resolveTransformData(context, bindingPath) {
|
|
|
53044
53859
|
const [first] = splitPath$1(bindingPath);
|
|
53045
53860
|
if (typeof first === "string" && first !== "$root") {
|
|
53046
53861
|
const namedScope = context.scopes.find((entry) => entry.name === first);
|
|
53047
|
-
if (namedScope && isPlainObject$
|
|
53862
|
+
if (namedScope && isPlainObject$3(namedScope.value)) return namedScope.value;
|
|
53048
53863
|
}
|
|
53049
53864
|
for (let i = context.scopes.length - 1; i >= 0; i -= 1) {
|
|
53050
53865
|
const scope = context.scopes[i];
|
|
53051
|
-
if (scope && isPlainObject$
|
|
53866
|
+
if (scope && isPlainObject$3(scope.value)) return scope.value;
|
|
53052
53867
|
}
|
|
53053
53868
|
const content = context.viewModel.content;
|
|
53054
|
-
if (isPlainObject$
|
|
53055
|
-
if (isPlainObject$
|
|
53869
|
+
if (isPlainObject$3(content)) return content;
|
|
53870
|
+
if (isPlainObject$3(context.viewModel)) return context.viewModel;
|
|
53056
53871
|
}
|
|
53057
53872
|
function coerceBindingValue(value, binding) {
|
|
53058
53873
|
const mode = binding.coerce;
|
|
@@ -53114,7 +53929,7 @@ function isRichTextConditionValueEmpty(value) {
|
|
|
53114
53929
|
return richTextStructuralPresence(root).kind === "empty";
|
|
53115
53930
|
}
|
|
53116
53931
|
function isTipTapNode(value) {
|
|
53117
|
-
return isPlainObject$
|
|
53932
|
+
return isPlainObject$3(value) && typeof value.type === "string";
|
|
53118
53933
|
}
|
|
53119
53934
|
function richTextStructuralPresence(node) {
|
|
53120
53935
|
if (typeof node.text === "string" && node.text.trim().length > 0) return {
|
|
@@ -53143,7 +53958,7 @@ function richTextSelfPresence(node) {
|
|
|
53143
53958
|
}
|
|
53144
53959
|
}
|
|
53145
53960
|
function hasResolvableRichTextImageSource(node) {
|
|
53146
|
-
const attrs = isPlainObject$
|
|
53961
|
+
const attrs = isPlainObject$3(node.attrs) ? node.attrs : {};
|
|
53147
53962
|
return hasNonBlankStringAttr(attrs, "src") || hasNonBlankStringAttr(attrs, "identifier");
|
|
53148
53963
|
}
|
|
53149
53964
|
function hasNonBlankStringAttr(attrs, key) {
|
|
@@ -53335,7 +54150,7 @@ function getNestedBinding(bindings, path) {
|
|
|
53335
54150
|
const segments = path.split(".");
|
|
53336
54151
|
let current = bindings;
|
|
53337
54152
|
for (const segment of segments) {
|
|
53338
|
-
if (!isPlainObject$
|
|
54153
|
+
if (!isPlainObject$3(current)) return void 0;
|
|
53339
54154
|
current = current[segment];
|
|
53340
54155
|
}
|
|
53341
54156
|
return current;
|
|
@@ -53358,7 +54173,7 @@ function resolveBindingToEditorPath(fieldName, bindings, editableRouteMetadataFi
|
|
|
53358
54173
|
};
|
|
53359
54174
|
const binding = bindings[fieldName] ?? getNestedBinding(bindings, fieldName);
|
|
53360
54175
|
if (!binding) return null;
|
|
53361
|
-
if (isPlainObject$
|
|
54176
|
+
if (isPlainObject$3(binding) && "source" in binding) {
|
|
53362
54177
|
const source = binding.source;
|
|
53363
54178
|
if (source === "field" && "path" in binding) {
|
|
53364
54179
|
const path = binding.path;
|
|
@@ -53375,7 +54190,7 @@ function resolveBindingToEditorPath(fieldName, bindings, editableRouteMetadataFi
|
|
|
53375
54190
|
if (!Array.isArray(options)) return null;
|
|
53376
54191
|
for (const option of options) {
|
|
53377
54192
|
if (typeof option === "string") return `content.${option}`;
|
|
53378
|
-
if (isPlainObject$
|
|
54193
|
+
if (isPlainObject$3(option) && "source" in option) {
|
|
53379
54194
|
const optSource = option.source;
|
|
53380
54195
|
if (optSource === "field" && "path" in option) {
|
|
53381
54196
|
const path = option.path;
|
|
@@ -53427,7 +54242,7 @@ function derivePreviewTextEditableTarget(parsedBinding, context) {
|
|
|
53427
54242
|
};
|
|
53428
54243
|
}
|
|
53429
54244
|
const root = context.viewModel?.$root;
|
|
53430
|
-
if (isPlainObject$
|
|
54245
|
+
if (isPlainObject$3(root) && root.contentEntry != null && context.pathBase) return {
|
|
53431
54246
|
kind: "read-only",
|
|
53432
54247
|
reason: "entry-template-block-field"
|
|
53433
54248
|
};
|
|
@@ -53486,7 +54301,7 @@ function injectMediaSlotPath(props, node, parsedBinding, context) {
|
|
|
53486
54301
|
if (resolveBindingToEditorPath(fieldPath, context.blockBindings, context.editableRouteMetadataFieldIds)) return props;
|
|
53487
54302
|
}
|
|
53488
54303
|
const root = context.viewModel?.$root;
|
|
53489
|
-
if (isPlainObject$
|
|
54304
|
+
if (isPlainObject$3(root) && root.contentEntry != null && context.pathBase) return props;
|
|
53490
54305
|
return {
|
|
53491
54306
|
...props,
|
|
53492
54307
|
fieldPath
|
|
@@ -53633,7 +54448,7 @@ function getNodeProps(node) {
|
|
|
53633
54448
|
if (key.startsWith("$")) continue;
|
|
53634
54449
|
legacy[key] = value;
|
|
53635
54450
|
}
|
|
53636
|
-
const props = isPlainObject$
|
|
54451
|
+
const props = isPlainObject$3(node.props) ? node.props : {};
|
|
53637
54452
|
return {
|
|
53638
54453
|
...legacy,
|
|
53639
54454
|
...props
|
|
@@ -53745,7 +54560,7 @@ function generateHoverEffects(axes, _space) {
|
|
|
53745
54560
|
//#endregion
|
|
53746
54561
|
//#region ../theme-core/src/blockOverrides.ts
|
|
53747
54562
|
const BLOCK_PREFIX = "block.";
|
|
53748
|
-
function isPlainObject$
|
|
54563
|
+
function isPlainObject$2(value) {
|
|
53749
54564
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53750
54565
|
}
|
|
53751
54566
|
function isUnknownArray$1(value) {
|
|
@@ -53753,7 +54568,7 @@ function isUnknownArray$1(value) {
|
|
|
53753
54568
|
}
|
|
53754
54569
|
function cloneValue(value) {
|
|
53755
54570
|
if (isUnknownArray$1(value)) return value.map((item) => cloneValue(item));
|
|
53756
|
-
if (isPlainObject$
|
|
54571
|
+
if (isPlainObject$2(value)) {
|
|
53757
54572
|
const cloned = {};
|
|
53758
54573
|
for (const [key, child] of Object.entries(value)) cloned[key] = cloneValue(child);
|
|
53759
54574
|
return cloned;
|
|
@@ -53763,7 +54578,7 @@ function cloneValue(value) {
|
|
|
53763
54578
|
function mergeDeep(defaultValue, overrideValue) {
|
|
53764
54579
|
if (overrideValue === void 0) return cloneValue(defaultValue);
|
|
53765
54580
|
if (overrideValue === null) return null;
|
|
53766
|
-
if (isPlainObject$
|
|
54581
|
+
if (isPlainObject$2(defaultValue) && isPlainObject$2(overrideValue)) {
|
|
53767
54582
|
const merged = {};
|
|
53768
54583
|
const keys = /* @__PURE__ */ new Set([...Object.keys(defaultValue), ...Object.keys(overrideValue)]);
|
|
53769
54584
|
for (const key of keys) merged[key] = mergeDeep(defaultValue[key], overrideValue[key]);
|
|
@@ -53820,7 +54635,7 @@ function mergeContentWithBlockStyleOverrides(content, theme, blockKind) {
|
|
|
53820
54635
|
*/
|
|
53821
54636
|
function applyHeadingDecorationSignature(target, themeDecoration) {
|
|
53822
54637
|
const existing = target["_sectionStyles"];
|
|
53823
|
-
const existingObj = isPlainObject$
|
|
54638
|
+
const existingObj = isPlainObject$2(existing) ? existing : void 0;
|
|
53824
54639
|
const rawOverride = existingObj?.["headingDecorationOverride"];
|
|
53825
54640
|
const effective = resolveEffectiveHeadingDecoration(themeDecoration, rawOverride === "site-default" || rawOverride === "off" ? rawOverride : void 0);
|
|
53826
54641
|
if (effective.kind === "none") {
|
|
@@ -57386,6 +58201,8 @@ function buildThemeCssVars(theme) {
|
|
|
57386
58201
|
const inputRadius = mapInputRadius(inputSystem.base.corners, theme.corners);
|
|
57387
58202
|
return {
|
|
57388
58203
|
...generateCssVars(theme.palette),
|
|
58204
|
+
["--tb-secondaryForeground"]: "var(--tb-onSecondary)",
|
|
58205
|
+
["--tb-accentForeground"]: "var(--tb-onAccent)",
|
|
57389
58206
|
["--tb-scrim"]: "0 0 0",
|
|
57390
58207
|
["--tb-shadow"]: "0 0 0",
|
|
57391
58208
|
...generateShadowCssVars(theme),
|
|
@@ -66029,6 +66846,11 @@ const containerResponsiveThemeCss = `/*
|
|
|
66029
66846
|
flex-wrap: wrap;
|
|
66030
66847
|
}
|
|
66031
66848
|
|
|
66849
|
+
/* Text-style CTA actions belong to the section foreground contract. */
|
|
66850
|
+
:where(.theme-scope) [data-block="cta-full"] .cta-row .button-link {
|
|
66851
|
+
color: var(--rb-surface-link-color, var(--rb-surface-text-color, rgb(var(--tb-primary))));
|
|
66852
|
+
}
|
|
66853
|
+
|
|
66032
66854
|
/* =============================================================================
|
|
66033
66855
|
* Block: Body Text (content block, Phase 2)
|
|
66034
66856
|
*
|
|
@@ -72587,35 +73409,35 @@ z.object({
|
|
|
72587
73409
|
//#endregion
|
|
72588
73410
|
//#region ../blocks/src/system/runtime/bindings.ts
|
|
72589
73411
|
const shouldLogWarnings = isNonProductionEnv();
|
|
72590
|
-
function isPlainObject(value) {
|
|
73412
|
+
function isPlainObject$1(value) {
|
|
72591
73413
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72592
73414
|
}
|
|
72593
73415
|
function isRouteMapEntry(value) {
|
|
72594
73416
|
if (typeof value === "string") return true;
|
|
72595
|
-
return isPlainObject(value);
|
|
73417
|
+
return isPlainObject$1(value);
|
|
72596
73418
|
}
|
|
72597
73419
|
function isRouteMap(value) {
|
|
72598
|
-
if (!isPlainObject(value)) return false;
|
|
73420
|
+
if (!isPlainObject$1(value)) return false;
|
|
72599
73421
|
return Object.values(value).every(isRouteMapEntry);
|
|
72600
73422
|
}
|
|
72601
73423
|
function isPageIdentifierMap(value) {
|
|
72602
|
-
if (!isPlainObject(value)) return false;
|
|
73424
|
+
if (!isPlainObject$1(value)) return false;
|
|
72603
73425
|
return Object.values(value).every((v) => typeof v === "string");
|
|
72604
73426
|
}
|
|
72605
73427
|
function isEntryIdentifierMap(value) {
|
|
72606
|
-
if (!isPlainObject(value)) return false;
|
|
73428
|
+
if (!isPlainObject$1(value)) return false;
|
|
72607
73429
|
for (const v of Object.values(value)) {
|
|
72608
|
-
if (!isPlainObject(v)) return false;
|
|
73430
|
+
if (!isPlainObject$1(v)) return false;
|
|
72609
73431
|
if (!Object.values(v).every((inner) => typeof inner === "string")) return false;
|
|
72610
73432
|
}
|
|
72611
73433
|
return true;
|
|
72612
73434
|
}
|
|
72613
73435
|
function buildTransformContext(vm) {
|
|
72614
73436
|
const root = vm.$root;
|
|
72615
|
-
const stage = root && isPlainObject(root) && root.previewStage === "preview" ? "preview" : "published";
|
|
72616
|
-
const routes = root && isPlainObject(root) && isRouteMap(root.routes) ? root.routes : void 0;
|
|
72617
|
-
const pagesByIdentifier = root && isPlainObject(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
|
|
72618
|
-
const entriesByIdentifier = root && isPlainObject(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
|
|
73437
|
+
const stage = root && isPlainObject$1(root) && root.previewStage === "preview" ? "preview" : "published";
|
|
73438
|
+
const routes = root && isPlainObject$1(root) && isRouteMap(root.routes) ? root.routes : void 0;
|
|
73439
|
+
const pagesByIdentifier = root && isPlainObject$1(root) && isPageIdentifierMap(root.pagesByIdentifier) ? root.pagesByIdentifier : void 0;
|
|
73440
|
+
const entriesByIdentifier = root && isPlainObject$1(root) && isEntryIdentifierMap(root.entriesByIdentifier) ? root.entriesByIdentifier : void 0;
|
|
72619
73441
|
return {
|
|
72620
73442
|
theme: defaultThemeTokens,
|
|
72621
73443
|
stage,
|
|
@@ -73010,8 +73832,6 @@ function parseBackgroundColorToken(value) {
|
|
|
73010
73832
|
if (!token) return null;
|
|
73011
73833
|
return token ? token : null;
|
|
73012
73834
|
}
|
|
73013
|
-
const gradientPresetIds = GRADIENT_PRESETS.map((preset) => preset.id);
|
|
73014
|
-
new Set(gradientPresetIds);
|
|
73015
73835
|
function blockedDemoMutationPolicy(classification, publicMessage) {
|
|
73016
73836
|
if (publicMessage.trim() === "") throw new Error(`Demo mutation policy ${classification} requires publicMessage.`);
|
|
73017
73837
|
return {
|
|
@@ -73560,6 +74380,7 @@ const CANONICAL_REFUND_PLANNER_ERROR_CODES = [
|
|
|
73560
74380
|
"already_refunded",
|
|
73561
74381
|
"idempotency_amount_mismatch",
|
|
73562
74382
|
"idempotency_method_mismatch",
|
|
74383
|
+
"idempotency_receipt_mismatch",
|
|
73563
74384
|
"refund_in_progress"
|
|
73564
74385
|
],
|
|
73565
74386
|
"invalid_amount",
|
|
@@ -73572,7 +74393,12 @@ const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
|
|
|
73572
74393
|
"payment_intent_not_found",
|
|
73573
74394
|
"stripe_error",
|
|
73574
74395
|
"stale_pending_missing_context",
|
|
73575
|
-
"non_refundable_deposit_remaining"
|
|
74396
|
+
"non_refundable_deposit_remaining",
|
|
74397
|
+
"deposit_refund_override_required",
|
|
74398
|
+
"refund_revoke_requires_full_line_refund",
|
|
74399
|
+
"payment_receipt_not_found",
|
|
74400
|
+
"payment_receipt_not_refundable",
|
|
74401
|
+
"payment_receipt_attribution_required"
|
|
73576
74402
|
];
|
|
73577
74403
|
[...CANONICAL_REFUND_PLANNER_ERROR_CODES];
|
|
73578
74404
|
//#endregion
|
|
@@ -73585,7 +74411,10 @@ const STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
|
|
|
73585
74411
|
"missing_credit_customer",
|
|
73586
74412
|
"deposit_refund_override_required",
|
|
73587
74413
|
"refund_revoke_requires_full_line_refund",
|
|
73588
|
-
"unified_order_link_required"
|
|
74414
|
+
"unified_order_link_required",
|
|
74415
|
+
"payment_receipt_not_found",
|
|
74416
|
+
"payment_receipt_not_refundable",
|
|
74417
|
+
"payment_receipt_attribution_required"
|
|
73589
74418
|
];
|
|
73590
74419
|
const EVENT_ATTENDEE_REFUND_INVALID_CODES = ["manual_booking_not_refundable", ...STANDARD_LINE_ITEM_REFUND_INVALID_CODES];
|
|
73591
74420
|
[...CANONICAL_ADMIN_REFUND_FAILURE_CODES];
|
|
@@ -76369,6 +77198,225 @@ function isDisplayMediaKind(value) {
|
|
|
76369
77198
|
function isFileFieldKind(value) {
|
|
76370
77199
|
return FILE_FIELD_KINDS.includes(value);
|
|
76371
77200
|
}
|
|
77201
|
+
/** Matches the closed sentinel shape `"<REQUIRED: …>"`. */
|
|
77202
|
+
const SENTINEL_PATTERN = /^<REQUIRED:.*>$/;
|
|
77203
|
+
/**
|
|
77204
|
+
* True when a value is an unfilled placeholder sentinel. Shared by the emitter
|
|
77205
|
+
* (self-check) and the validator (rejection) so recognition can't drift.
|
|
77206
|
+
*/
|
|
77207
|
+
function isPlaceholderSentinel(value) {
|
|
77208
|
+
return typeof value === "string" && SENTINEL_PATTERN.test(value);
|
|
77209
|
+
}
|
|
77210
|
+
function effectiveReferenceKind(field) {
|
|
77211
|
+
const kind = field.referenceKind;
|
|
77212
|
+
const legacy = field.reference?.type;
|
|
77213
|
+
return kind ?? legacy;
|
|
77214
|
+
}
|
|
77215
|
+
function selectOptionValues$1(field) {
|
|
77216
|
+
const options = field.options;
|
|
77217
|
+
return options ? options.map((o) => o.value) : [];
|
|
77218
|
+
}
|
|
77219
|
+
/**
|
|
77220
|
+
* The placeholder sentinel for a leaf field. Container types (group/button/
|
|
77221
|
+
* repeater) do not have a leaf sentinel — they expand structurally — and calling
|
|
77222
|
+
* this for them returns a generic marker only for completeness.
|
|
77223
|
+
*/
|
|
77224
|
+
function buildSentinel(field) {
|
|
77225
|
+
switch (field.type) {
|
|
77226
|
+
case "text":
|
|
77227
|
+
case "textarea": return "<REQUIRED: text>";
|
|
77228
|
+
case "richText": return "<REQUIRED: rich-text>";
|
|
77229
|
+
case "number": return "<REQUIRED: number>";
|
|
77230
|
+
case "date": return "<REQUIRED: date (YYYY-MM-DD)>";
|
|
77231
|
+
case "datetime": return "<REQUIRED: datetime (ISO 8601)>";
|
|
77232
|
+
case "url": return "<REQUIRED: url>";
|
|
77233
|
+
case "link": return "<REQUIRED: link>";
|
|
77234
|
+
case "media": return "<REQUIRED: media-identifier>";
|
|
77235
|
+
case "file": return "<REQUIRED: file-identifier>";
|
|
77236
|
+
case "boolean": return "<REQUIRED: boolean>";
|
|
77237
|
+
case "select": {
|
|
77238
|
+
const values = selectOptionValues$1(field);
|
|
77239
|
+
return values.length > 0 ? `<REQUIRED: select (${values.join("|")})>` : "<REQUIRED: select>";
|
|
77240
|
+
}
|
|
77241
|
+
case "reference": {
|
|
77242
|
+
const kind = effectiveReferenceKind(field);
|
|
77243
|
+
return kind ? `<REQUIRED: reference-identifier (${kind})>` : "<REQUIRED: reference-identifier>";
|
|
77244
|
+
}
|
|
77245
|
+
case "group": return "<REQUIRED: group>";
|
|
77246
|
+
case "button": return "<REQUIRED: button>";
|
|
77247
|
+
case "repeater": return "<REQUIRED: repeater>";
|
|
77248
|
+
}
|
|
77249
|
+
}
|
|
77250
|
+
//#endregion
|
|
77251
|
+
//#region ../content-model/src/content-types/entryValidation.ts
|
|
77252
|
+
function subfieldsOf$1(field) {
|
|
77253
|
+
const direct = field.fields;
|
|
77254
|
+
if (direct && direct.length > 0) return direct;
|
|
77255
|
+
return field.schema?.fields ?? [];
|
|
77256
|
+
}
|
|
77257
|
+
function selectOptionValues(field) {
|
|
77258
|
+
const options = field.options;
|
|
77259
|
+
return options ? options.map((o) => o.value) : [];
|
|
77260
|
+
}
|
|
77261
|
+
function isPlainObject(value) {
|
|
77262
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
77263
|
+
}
|
|
77264
|
+
/** Field types whose value must be a string. */
|
|
77265
|
+
const STRING_TYPES = /* @__PURE__ */ new Set([
|
|
77266
|
+
"text",
|
|
77267
|
+
"textarea",
|
|
77268
|
+
"url",
|
|
77269
|
+
"link",
|
|
77270
|
+
"media",
|
|
77271
|
+
"file",
|
|
77272
|
+
"reference",
|
|
77273
|
+
"date",
|
|
77274
|
+
"datetime",
|
|
77275
|
+
"select"
|
|
77276
|
+
]);
|
|
77277
|
+
function checkLeafType(field, value, path, errors) {
|
|
77278
|
+
const push = (code, message) => {
|
|
77279
|
+
errors.push({
|
|
77280
|
+
path,
|
|
77281
|
+
fieldType: field.type,
|
|
77282
|
+
code,
|
|
77283
|
+
message
|
|
77284
|
+
});
|
|
77285
|
+
};
|
|
77286
|
+
if (field.type === "number") {
|
|
77287
|
+
if (typeof value !== "number" || Number.isNaN(value)) push("wrong_type", `"${path}" must be a number.`);
|
|
77288
|
+
return;
|
|
77289
|
+
}
|
|
77290
|
+
if (field.type === "boolean") {
|
|
77291
|
+
if (typeof value !== "boolean") push("wrong_type", `"${path}" must be a boolean.`);
|
|
77292
|
+
return;
|
|
77293
|
+
}
|
|
77294
|
+
if (field.type === "richText") {
|
|
77295
|
+
if (typeof value !== "string" && !isPlainObject(value)) push("wrong_type", `"${path}" must be rich-text (string or document object).`);
|
|
77296
|
+
return;
|
|
77297
|
+
}
|
|
77298
|
+
if (field.type === "select") {
|
|
77299
|
+
if (typeof value !== "string") {
|
|
77300
|
+
push("wrong_type", `"${path}" must be a string.`);
|
|
77301
|
+
return;
|
|
77302
|
+
}
|
|
77303
|
+
const options = selectOptionValues(field);
|
|
77304
|
+
if (options.length > 0 && !options.includes(value)) push("invalid_option", `"${path}" must be one of: ${options.join(", ")}.`);
|
|
77305
|
+
return;
|
|
77306
|
+
}
|
|
77307
|
+
if (STRING_TYPES.has(field.type)) {
|
|
77308
|
+
if (typeof value !== "string") push("wrong_type", `"${path}" must be a string.`);
|
|
77309
|
+
}
|
|
77310
|
+
}
|
|
77311
|
+
function validateField(field, value, path, errors) {
|
|
77312
|
+
if (value === void 0 || value === null || value === "") {
|
|
77313
|
+
if (field.required === true) errors.push({
|
|
77314
|
+
path,
|
|
77315
|
+
fieldType: field.type,
|
|
77316
|
+
code: "missing_required",
|
|
77317
|
+
message: `Required field "${path}" is missing.`
|
|
77318
|
+
});
|
|
77319
|
+
return;
|
|
77320
|
+
}
|
|
77321
|
+
if (isPlaceholderSentinel(value)) {
|
|
77322
|
+
errors.push({
|
|
77323
|
+
path,
|
|
77324
|
+
fieldType: field.type,
|
|
77325
|
+
code: "unfilled_placeholder",
|
|
77326
|
+
message: `"${path}" still contains an unfilled placeholder (${value}).`
|
|
77327
|
+
});
|
|
77328
|
+
return;
|
|
77329
|
+
}
|
|
77330
|
+
if (field.type === "group" || field.type === "button") {
|
|
77331
|
+
if (!isPlainObject(value)) {
|
|
77332
|
+
errors.push({
|
|
77333
|
+
path,
|
|
77334
|
+
fieldType: field.type,
|
|
77335
|
+
code: "wrong_type",
|
|
77336
|
+
message: `"${path}" must be an object.`
|
|
77337
|
+
});
|
|
77338
|
+
return;
|
|
77339
|
+
}
|
|
77340
|
+
validateFields(subfieldsOf$1(field), value, path, errors);
|
|
77341
|
+
return;
|
|
77342
|
+
}
|
|
77343
|
+
if (field.type === "repeater") {
|
|
77344
|
+
if (!Array.isArray(value)) {
|
|
77345
|
+
errors.push({
|
|
77346
|
+
path,
|
|
77347
|
+
fieldType: field.type,
|
|
77348
|
+
code: "wrong_type",
|
|
77349
|
+
message: `"${path}" must be an array.`
|
|
77350
|
+
});
|
|
77351
|
+
return;
|
|
77352
|
+
}
|
|
77353
|
+
const itemFields = subfieldsOf$1(field);
|
|
77354
|
+
value.forEach((item, index) => {
|
|
77355
|
+
const itemPath = `${path}[${index}]`;
|
|
77356
|
+
if (!isPlainObject(item)) {
|
|
77357
|
+
errors.push({
|
|
77358
|
+
path: itemPath,
|
|
77359
|
+
fieldType: "repeater",
|
|
77360
|
+
code: "wrong_type",
|
|
77361
|
+
message: `"${itemPath}" must be an object.`
|
|
77362
|
+
});
|
|
77363
|
+
return;
|
|
77364
|
+
}
|
|
77365
|
+
validateFields(itemFields, item, itemPath, errors);
|
|
77366
|
+
});
|
|
77367
|
+
return;
|
|
77368
|
+
}
|
|
77369
|
+
checkLeafType(field, value, path, errors);
|
|
77370
|
+
}
|
|
77371
|
+
function validateFields(fields, data, pathPrefix, errors) {
|
|
77372
|
+
for (const field of fields) {
|
|
77373
|
+
const path = pathPrefix ? `${pathPrefix}.${field.id}` : field.id;
|
|
77374
|
+
validateField(field, data[field.id], path, errors);
|
|
77375
|
+
}
|
|
77376
|
+
}
|
|
77377
|
+
//#endregion
|
|
77378
|
+
//#region ../content-model/src/content-types/scaffold.ts
|
|
77379
|
+
/** Nested subfields for group/repeater/button-style fields (both DSL shapes). */
|
|
77380
|
+
function subfieldsOf(field) {
|
|
77381
|
+
const direct = field.fields;
|
|
77382
|
+
if (direct && direct.length > 0) return direct;
|
|
77383
|
+
return field.schema?.fields ?? [];
|
|
77384
|
+
}
|
|
77385
|
+
const CONTAINER_TYPES = /* @__PURE__ */ new Set([
|
|
77386
|
+
"group",
|
|
77387
|
+
"button",
|
|
77388
|
+
"repeater"
|
|
77389
|
+
]);
|
|
77390
|
+
/**
|
|
77391
|
+
* Build the placeholder value for a required field. Group/button fields recurse
|
|
77392
|
+
* into their required subfields; repeaters emit a single seed item so agents see
|
|
77393
|
+
* the item shape.
|
|
77394
|
+
*/
|
|
77395
|
+
function buildFieldValue(field) {
|
|
77396
|
+
if (field.type === "repeater") return [buildObjectFromFields(subfieldsOf(field))];
|
|
77397
|
+
if (CONTAINER_TYPES.has(field.type)) {
|
|
77398
|
+
const subfields = subfieldsOf(field);
|
|
77399
|
+
if (subfields.length > 0) return buildObjectFromFields(subfields);
|
|
77400
|
+
if (field.type === "button") return {
|
|
77401
|
+
label: "<REQUIRED: text>",
|
|
77402
|
+
link: "<REQUIRED: link>"
|
|
77403
|
+
};
|
|
77404
|
+
return {};
|
|
77405
|
+
}
|
|
77406
|
+
return buildSentinel(field);
|
|
77407
|
+
}
|
|
77408
|
+
/**
|
|
77409
|
+
* Build a template object from a list of fields, stubbing required fields and
|
|
77410
|
+
* omitting optional ones.
|
|
77411
|
+
*/
|
|
77412
|
+
function buildObjectFromFields(fields) {
|
|
77413
|
+
const template = {};
|
|
77414
|
+
for (const field of fields) {
|
|
77415
|
+
if (field.required !== true) continue;
|
|
77416
|
+
template[field.id] = buildFieldValue(field);
|
|
77417
|
+
}
|
|
77418
|
+
return template;
|
|
77419
|
+
}
|
|
76372
77420
|
//#endregion
|
|
76373
77421
|
//#region ../content-model/src/content-types/builtins.ts
|
|
76374
77422
|
/**
|