@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.
Files changed (189) hide show
  1. package/README.md +21 -1
  2. package/dist/{PreviewEditorSidebar-BBT-kZAM.mjs → PreviewEditorSidebar-DWqwfy3_.mjs} +7 -22
  3. package/dist/{PreviewEditorUI-D69xNKT2.mjs → PreviewEditorUI-B7OL4sfR.mjs} +3 -3
  4. package/dist/{PreviewQueryProvider-RRu7wyQ5.mjs → PreviewQueryProvider-D0y2l8JN.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-CuDjXH6o.mjs → SdkPreviewModeRuntime-D8Gt9Gbe.mjs} +212 -153
  6. package/dist/{SiteChromeCustomizeContext-BQUY2dEk.mjs → SiteChromeCustomizeContext-DUpalEdL.mjs} +1919 -1032
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +11244 -10741
  8. package/dist/_dts/api/src/bookingAdjustments.d.ts +5 -0
  9. package/dist/_dts/api/src/bookingOperations.d.ts +4 -0
  10. package/dist/_dts/api/src/bookingRecords.d.ts +2 -17
  11. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
  12. package/dist/_dts/api/src/common/envelope.d.ts +7 -0
  13. package/dist/_dts/api/src/courses.d.ts +1 -0
  14. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +5 -5
  15. package/dist/_dts/api/src/endpoints.d.ts +35 -0
  16. package/dist/_dts/api/src/index.d.ts +2 -2
  17. package/dist/_dts/api/src/participantMessaging.d.ts +18 -12
  18. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +1 -0
  19. package/dist/_dts/api/src/sdkContracts.d.ts +247 -1
  20. package/dist/_dts/api/src/siteInfrastructure.d.ts +13 -0
  21. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +1 -5
  22. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +29 -1
  23. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +33 -27
  24. package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientField.d.ts +9 -0
  25. package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientWidget.d.ts +3 -4
  26. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -4
  27. package/dist/_dts/blocks/src/index.d.ts +1 -1
  28. package/dist/_dts/blocks/src/system/blocks/audio-player.d.ts +3 -0
  29. package/dist/_dts/blocks/src/system/blocks/body-text.d.ts +3 -0
  30. package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +3 -0
  31. package/dist/_dts/blocks/src/system/blocks/course-registration.d.ts +1 -22
  32. package/dist/_dts/blocks/src/system/blocks/cta-full.d.ts +3 -0
  33. package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -22
  34. package/dist/_dts/blocks/src/system/blocks/file-download.d.ts +3 -0
  35. package/dist/_dts/blocks/src/system/blocks/form.d.ts +3 -0
  36. package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +3 -0
  37. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +3 -0
  38. package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +3 -0
  39. package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +3 -0
  40. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +3 -0
  41. package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +3 -0
  42. package/dist/_dts/blocks/src/system/blocks/video-grid.d.ts +3 -0
  43. package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
  44. package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +16 -6
  45. package/dist/_dts/blocks/src/system/defineBlock.d.ts +9 -1
  46. package/dist/_dts/blocks/src/system/fields/ctas.d.ts +8 -0
  47. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +31 -0
  48. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
  49. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +3 -3
  50. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +1 -1
  51. package/dist/_dts/content-model/src/content-types/entryValidation.d.ts +31 -0
  52. package/dist/_dts/content-model/src/content-types/scaffold.d.ts +58 -0
  53. package/dist/_dts/content-model/src/content-types/sentinels.d.ts +36 -0
  54. package/dist/_dts/content-model/src/index.d.ts +3 -0
  55. package/dist/_dts/core/src/booking-date-time.d.ts +8 -0
  56. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +3071 -3157
  57. package/dist/_dts/media-core/src/fileMimeDetection.d.ts +16 -0
  58. package/dist/_dts/media-core/src/fileStorage.d.ts +8 -0
  59. package/dist/_dts/media-core/src/storagePathDomain.d.ts +2 -0
  60. package/dist/_dts/media-core/src/uploadVerificationContract.d.ts +3 -0
  61. package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +2 -0
  62. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
  63. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -1
  64. package/dist/_dts/sdk/src/cli/commands/audit.d.ts +1 -1
  65. package/dist/_dts/sdk/src/cli/commands/compare.d.ts +1 -1
  66. package/dist/_dts/sdk/src/cli/commands/deploy.d.ts +1 -1
  67. package/dist/_dts/sdk/src/cli/commands/drafts.d.ts +18 -0
  68. package/dist/_dts/sdk/src/cli/commands/entry.d.ts +15 -0
  69. package/dist/_dts/sdk/src/cli/commands/init-docs.d.ts +2 -2
  70. package/dist/_dts/sdk/src/cli/commands/publish-all.d.ts +1 -1
  71. package/dist/_dts/sdk/src/cli/commands/pull.d.ts +1 -0
  72. package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +1 -1
  73. package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +3 -0
  74. package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +12 -1
  75. package/dist/_dts/sdk/src/cli/commands/setup.d.ts +1 -0
  76. package/dist/_dts/sdk/src/cli/commands/verify.d.ts +1 -0
  77. package/dist/_dts/sdk/src/cli/helpers.d.ts +22 -1
  78. package/dist/_dts/sdk/src/cli/index.d.ts +4 -0
  79. package/dist/_dts/sdk/src/cli/output.d.ts +88 -0
  80. package/dist/_dts/sdk/src/cli/program.d.ts +29 -0
  81. package/dist/_dts/sdk/src/cli/push-config.d.ts +1 -1
  82. package/dist/_dts/sdk/src/client/management/catalog.d.ts +10 -0
  83. package/dist/_dts/sdk/src/client/management/http.d.ts +7 -1
  84. package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
  85. package/dist/_dts/sdk/src/client/management/types.d.ts +43 -19
  86. package/dist/_dts/sdk/src/date-time/index.d.ts +68 -0
  87. package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -0
  88. package/dist/_dts/sdk/src/version.d.ts +1 -1
  89. package/dist/_dts/site-commands/src/commands.d.ts +893 -823
  90. package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
  91. package/dist/_dts/theme-core/src/buttons/core.d.ts +15 -46
  92. package/dist/_dts/theme-core/src/buttons/effectClassification.d.ts +147 -0
  93. package/dist/_dts/theme-core/src/buttons/effects/types.d.ts +2 -3
  94. package/dist/_dts/theme-core/src/buttons/generateDefaultButtonSystem.d.ts +1 -1
  95. package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
  96. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +44 -32
  97. package/dist/_dts/theme-core/src/buttons/presets.d.ts +4 -25
  98. package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +100 -0
  99. package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +16 -0
  100. package/dist/_dts/theme-core/src/buttons/types.d.ts +101 -83
  101. package/dist/_dts/theme-core/src/cards/types.d.ts +16 -16
  102. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  103. package/dist/_dts/theme-core/src/gradients/presets.d.ts +200 -8
  104. package/dist/_dts/theme-core/src/gradients/utils.d.ts +6 -2
  105. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +87 -126
  106. package/dist/_dts/theme-core/src/mock-themes/modern-minimal.d.ts +1 -1
  107. package/dist/_dts/theme-core/src/navigation/types.d.ts +2 -2
  108. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -2
  109. package/dist/_dts/theme-core/src/palette/curated/types.d.ts +5 -8
  110. package/dist/_dts/theme-core/src/palette/index.d.ts +0 -1
  111. package/dist/_dts/theme-core/src/schema.d.ts +112 -138
  112. package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
  113. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +10 -10
  114. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +3 -2
  115. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +13 -6
  116. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +29 -8
  117. package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +2 -2
  118. package/dist/cli/index.mjs +67956 -66745
  119. package/dist/cli/init-docs/content/cli-reference.md +50 -7
  120. package/dist/cli/init-docs/content/content-management.md +7 -4
  121. package/dist/cli/init-docs/content/workflow-publish.md +5 -1
  122. package/dist/client/{DiscountCodeDisclosure-D6TOf6Hi.mjs → DiscountCodeDisclosure-DU1ygxU2.mjs} +1 -1
  123. package/dist/client/{EventCombined.client-Dao3zxRk.mjs → EventCombined.client-DB5zagCo.mjs} +3 -3
  124. package/dist/client/{EventListing.client-B2NNt4y1.mjs → EventListing.client-CTX9JHBL.mjs} +2 -2
  125. package/dist/client/{LeafletStaticMap-BhwFo16w.mjs → LeafletStaticMap-BYImhgiB.mjs} +1 -1
  126. package/dist/client/{MagicLinkForm-BWnB7cMR.mjs → MagicLinkForm-CRkw_M3l.mjs} +2 -2
  127. package/dist/client/{StepIndicator-TzRiQ0BY.mjs → StepIndicator-BnmVBJJh.mjs} +2 -2
  128. package/dist/client/{accordion-BPy-AJ4_.mjs → accordion-CeGreumd.mjs} +1 -1
  129. package/dist/client/{bookingForm-BL4PGZds.mjs → bookingForm-CSzFNrpN.mjs} +6 -6
  130. package/dist/client/bookings.mjs +512 -252
  131. package/dist/client/{buttons-EBjyslaX.mjs → buttons-DoFV7KDL.mjs} +493 -230
  132. package/dist/client/{carousel-C2b7Cn9-.mjs → carousel-B2jDtogf.mjs} +1 -1
  133. package/dist/client/{cart-BQcbXIVD.mjs → cart-D-jZ-vaY.mjs} +3 -3
  134. package/dist/client/{checkout-DEmpGRJu.mjs → checkout-Dza-LA7N.mjs} +3 -3
  135. package/dist/client/client.mjs +1673 -785
  136. package/dist/client/{colorStyles-jZS6KfkP.mjs → colorStyles-CrgzoXsm.mjs} +1 -30
  137. package/dist/client/{courseRegistration-BqRZPmsq.mjs → courseRegistration-TYkNychb.mjs} +7 -7
  138. package/dist/client/{eventCalendar-B8N_tSl5.mjs → eventCalendar-BI_90SsT.mjs} +5 -5
  139. package/dist/client/{eventCombined-Gjn6gtq7.mjs → eventCombined-mNrpryE9.mjs} +2 -2
  140. package/dist/client/{eventDetails-M-VCxA-r.mjs → eventDetails-D4GVlCIY.mjs} +3 -3
  141. package/dist/client/{eventListing-DR19hqYi.mjs → eventListing-YhKN018y.mjs} +2 -2
  142. package/dist/client/{eventRegistration-BR02a0k3.mjs → eventRegistration-CdHGtilr.mjs} +7 -7
  143. package/dist/client/foregroundContract-xICPq59x.mjs +31 -0
  144. package/dist/client/{form-LY2xIbwg.mjs → form-AcAL45rA.mjs} +2 -2
  145. package/dist/client/{headerSection-CYwwXJfh.mjs → headerSection-uEC52ueD.mjs} +3 -3
  146. package/dist/client/hooks.mjs +890 -497
  147. package/dist/client/{locationMap-DWnBXrFq.mjs → locationMap-_wJDSUYe.mjs} +3 -3
  148. package/dist/client/{media-DHtSxS5V.mjs → media-BK0O3b-U.mjs} +3 -2
  149. package/dist/client/{newsletterForm-D9s-fQ2P.mjs → newsletterForm-DrArsb2B.mjs} +2 -2
  150. package/dist/client/{pricing-DDq80oYc.mjs → pricing-BSYVghwo.mjs} +1 -1
  151. package/dist/client/{productDetail-B0SbWd45.mjs → productDetail-Dyk90sMs.mjs} +3 -3
  152. package/dist/client/{productList-PwYlZn0y.mjs → productList-BCKThwAI.mjs} +3 -3
  153. package/dist/client/{propsDecoder-BRWBiH7i.mjs → propsDecoder-CkXxkdSR.mjs} +63 -24
  154. package/dist/client/rendering/client.mjs +1034 -486
  155. package/dist/client/rendering/islands.mjs +19 -19
  156. package/dist/client/rendering.mjs +1832 -760
  157. package/dist/client/{shop-CMwZPYME.mjs → shop-DeltVH10.mjs} +6 -6
  158. package/dist/client/{shop-commerce-BuxsFate.mjs → shop-commerce-BD9Jsm2Z.mjs} +6 -6
  159. package/dist/client/{shop-commerce-store-boYlEJ91.mjs → shop-commerce-store-CmXD6FDS.mjs} +1 -1
  160. package/dist/client/{shopShared-D2naaOes.mjs → shopShared-B8v-lH_F.mjs} +2 -2
  161. package/dist/client/{useDiscountCodeUi-D9RHpVoj.mjs → useDiscountCodeUi-DbWJN8ld.mjs} +1 -1
  162. package/dist/client/{useEventFilters-igGiK1re.mjs → useEventFilters-EJIMUnqT.mjs} +46 -69
  163. package/dist/client/{usePolling-CI7MbsFB.mjs → usePolling-Cmh14fc7.mjs} +2 -2
  164. package/dist/preview-next/before-render.mjs +35 -0
  165. package/dist/preview-next/client/runtime.mjs +4 -4
  166. package/dist/preview-next/middleware.mjs +35 -0
  167. package/dist/{previewAuthStore-a_cBD28m.mjs → previewAuthStore-CTO7CRPk.mjs} +35 -0
  168. package/dist/{sdk-runtime-MBzD-GmP.mjs → sdk-runtime-Dou0GAav.mjs} +2 -2
  169. package/dist/{separator-5ahRBC85.mjs → separator-CI5wZNXT.mjs} +1 -1
  170. package/dist/server/components.mjs +1832 -784
  171. package/dist/server/config-validation.mjs +890 -497
  172. package/dist/server/config.mjs +890 -497
  173. package/dist/server/data.mjs +890 -497
  174. package/dist/server/date-time.mjs +386 -0
  175. package/dist/server/index.mjs +36 -1
  176. package/dist/server/next.mjs +1868 -785
  177. package/dist/server/page-converter.mjs +849 -285
  178. package/dist/server/prebuild.mjs +1 -1
  179. package/dist/server/rendering/server.mjs +1553 -718
  180. package/dist/server/rendering.mjs +1832 -784
  181. package/dist/server/routing.mjs +933 -522
  182. package/dist/server/server.mjs +929 -501
  183. package/dist/server/theme-bridge.mjs +1408 -392
  184. package/dist/server/theme.mjs +471 -228
  185. package/dist/styles/index.css +5 -0
  186. package/package.json +7 -1
  187. package/dist/_dts/theme-core/src/buttons/presets/types.d.ts +0 -88
  188. package/dist/_dts/theme-core/src/buttons/utils/contrast.d.ts +0 -38
  189. package/dist/_dts/theme-core/src/palette/themePaletteCompatibility.d.ts +0 -57
@@ -3961,19 +3961,29 @@ function assertNever$1(value) {
3961
3961
  const DEFAULT_LOCALE = "en-US";
3962
3962
  const FALLBACK_TIMEZONE = "UTC";
3963
3963
  const LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
3964
+ const DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
3965
+ const dateTimeFormatterCache = /* @__PURE__ */ new Map();
3966
+ const timeZoneValidityCache = /* @__PURE__ */ new Map();
3964
3967
  function isValidTimeZone(timeZone) {
3968
+ const cached = timeZoneValidityCache.get(timeZone);
3969
+ if (cached !== void 0) return cached;
3970
+ let isValid;
3965
3971
  try {
3966
3972
  new Intl.DateTimeFormat(DEFAULT_LOCALE, { timeZone }).format(/* @__PURE__ */ new Date());
3967
- return true;
3973
+ isValid = true;
3968
3974
  } catch {
3969
- return false;
3975
+ isValid = false;
3970
3976
  }
3977
+ if (timeZoneValidityCache.size >= DATE_TIME_FORMATTER_CACHE_LIMIT) timeZoneValidityCache.clear();
3978
+ timeZoneValidityCache.set(timeZone, isValid);
3979
+ return isValid;
3971
3980
  }
3972
3981
  function getSafeTimeZone(timeZone) {
3973
3982
  const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
3974
3983
  return normalized.length > 0 && isValidTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
3975
3984
  }
3976
3985
  function parseStrictBookingTimeZone(timeZone) {
3986
+ if (typeof timeZone !== "string") return null;
3977
3987
  const normalized = timeZone.trim();
3978
3988
  if (normalized.length === 0 || !isValidTimeZone(normalized)) return null;
3979
3989
  return normalized;
@@ -3986,10 +3996,19 @@ function formatParseError(error) {
3986
3996
  }
3987
3997
  }
3988
3998
  function formatToPartsLookup(date, locale, timeZone, format) {
3989
- return new Map(new Intl.DateTimeFormat(locale, {
3999
+ return new Map(getCachedDateTimeFormatter(locale, timeZone, format).formatToParts(date).map((part) => [part.type, part.value]));
4000
+ }
4001
+ function getCachedDateTimeFormatter(locale, timeZone, format) {
4002
+ const key = `${locale}\u0000${timeZone}\u0000${JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)))}`;
4003
+ const cached = dateTimeFormatterCache.get(key);
4004
+ if (cached !== void 0) return cached;
4005
+ const formatter = new Intl.DateTimeFormat(locale, {
3990
4006
  ...format,
3991
4007
  timeZone
3992
- }).formatToParts(date).map((part) => [part.type, part.value]));
4008
+ });
4009
+ if (dateTimeFormatterCache.size >= DATE_TIME_FORMATTER_CACHE_LIMIT) dateTimeFormatterCache.clear();
4010
+ dateTimeFormatterCache.set(key, formatter);
4011
+ return formatter;
3993
4012
  }
3994
4013
  function getZonedDateTimeParts(date, timeZone) {
3995
4014
  const parts = formatToPartsLookup(date, "en-GB", timeZone, {
@@ -4042,23 +4061,9 @@ function toUtcIsoDateTimeString(value) {
4042
4061
  return parsed.value;
4043
4062
  }
4044
4063
  function parseScheduledBookingDateTime(input) {
4064
+ let startsAt;
4045
4065
  try {
4046
- const startsAt = toUtcIsoDateTimeString(input.startsAt);
4047
- const timeZone = parseStrictBookingTimeZone(input.timeZone);
4048
- if (timeZone === null) return {
4049
- ok: false,
4050
- field: "timeZone",
4051
- reason: "invalid_time_zone",
4052
- value: input.timeZone
4053
- };
4054
- return {
4055
- ok: true,
4056
- value: {
4057
- startsAt,
4058
- timeZone,
4059
- locale: input.locale
4060
- }
4061
- };
4066
+ startsAt = toUtcIsoDateTimeString(input.startsAt);
4062
4067
  } catch {
4063
4068
  return {
4064
4069
  ok: false,
@@ -4067,6 +4072,21 @@ function parseScheduledBookingDateTime(input) {
4067
4072
  value: input.startsAt
4068
4073
  };
4069
4074
  }
4075
+ const timeZone = parseStrictBookingTimeZone(input.timeZone);
4076
+ if (timeZone === null) return {
4077
+ ok: false,
4078
+ field: "timeZone",
4079
+ reason: "invalid_time_zone",
4080
+ value: typeof input.timeZone === "string" ? input.timeZone : ""
4081
+ };
4082
+ return {
4083
+ ok: true,
4084
+ value: {
4085
+ startsAt,
4086
+ timeZone,
4087
+ locale: input.locale
4088
+ }
4089
+ };
4070
4090
  }
4071
4091
  function toScheduledBookingDateTime(input) {
4072
4092
  const result = parseScheduledBookingDateTime(input);
@@ -4076,10 +4096,7 @@ function toScheduledBookingDateTime(input) {
4076
4096
  function formatBookingInstant(isoString, options) {
4077
4097
  const date = new Date(isoString);
4078
4098
  if (Number.isNaN(date.getTime())) return isoString;
4079
- return new Intl.DateTimeFormat(options.locale ?? DEFAULT_LOCALE, {
4080
- ...options.format,
4081
- timeZone: getSafeTimeZone(options.timeZone)
4082
- }).format(date);
4099
+ return getCachedDateTimeFormatter(options.locale ?? DEFAULT_LOCALE, getSafeTimeZone(options.timeZone), options.format).format(date);
4083
4100
  }
4084
4101
  function getBookingLocalDateKey(input) {
4085
4102
  return formatDateKey(getLocalScheduleDate(new Date(input.startsAt), input.timeZone));
@@ -7288,6 +7305,111 @@ function useAppointmentCheckoutVerificationWithDeps(config, deps) {
7288
7305
  };
7289
7306
  }
7290
7307
  //#endregion
7308
+ //#region ../theme-core/src/buttons/effectClassification.ts
7309
+ /**
7310
+ * Exhaustive live policy for every registered effect id.
7311
+ *
7312
+ * The resolver consumes the transition payload directly, so adding an effect
7313
+ * cannot update classification without also defining its runtime behavior.
7314
+ */
7315
+ const BUTTON_EFFECT_POLICIES = {
7316
+ "darken-background": {
7317
+ classification: "colour-transition",
7318
+ transition: {
7319
+ kind: "adjust-shade",
7320
+ direction: "darker"
7321
+ }
7322
+ },
7323
+ "lighten-background": {
7324
+ classification: "colour-transition",
7325
+ transition: {
7326
+ kind: "adjust-shade",
7327
+ direction: "lighter"
7328
+ }
7329
+ },
7330
+ "background-on-hover": {
7331
+ classification: "colour-transition",
7332
+ transition: { kind: "replace-background" }
7333
+ },
7334
+ "background-on-hover-alpha": {
7335
+ classification: "unsupported-colour",
7336
+ reason: "alpha_requires_surface"
7337
+ },
7338
+ "fade-background": {
7339
+ classification: "unsupported-colour",
7340
+ reason: "changes_element_opacity"
7341
+ },
7342
+ "opacity-reduce": {
7343
+ classification: "unsupported-colour",
7344
+ reason: "changes_element_opacity"
7345
+ },
7346
+ "gradient-text": {
7347
+ classification: "unsupported-colour",
7348
+ reason: "changes_foreground"
7349
+ },
7350
+ "text-color-change": {
7351
+ classification: "unsupported-colour",
7352
+ reason: "changes_foreground"
7353
+ },
7354
+ "border-color-change": {
7355
+ classification: "unsupported-colour",
7356
+ reason: "changes_border"
7357
+ },
7358
+ "aurora-glow": {
7359
+ classification: "unsupported-background-overlay",
7360
+ reason: "unresolved_background_overlay"
7361
+ },
7362
+ "cosmic-stardust": {
7363
+ classification: "unsupported-background-overlay",
7364
+ reason: "unresolved_background_overlay"
7365
+ },
7366
+ "gradient-border-fill": {
7367
+ classification: "unsupported-background-overlay",
7368
+ reason: "unresolved_background_overlay"
7369
+ },
7370
+ "animated-gradient-border-fill": {
7371
+ classification: "unsupported-background-overlay",
7372
+ reason: "unresolved_background_overlay"
7373
+ },
7374
+ "nav-underline": {
7375
+ classification: "not-button",
7376
+ reason: "not_button_effect"
7377
+ },
7378
+ "nav-frosted-base": {
7379
+ classification: "not-button",
7380
+ reason: "not_button_effect"
7381
+ },
7382
+ "nav-frosted-hover": {
7383
+ classification: "not-button",
7384
+ reason: "not_button_effect"
7385
+ },
7386
+ "nav-frosted-active": {
7387
+ classification: "not-button",
7388
+ reason: "not_button_effect"
7389
+ },
7390
+ "animated-gradient": { classification: "non-colour" },
7391
+ "border-glow": { classification: "non-colour" },
7392
+ "drop-shadow": { classification: "non-colour" },
7393
+ "inner-shadow": { classification: "non-colour" },
7394
+ "neumorphic-shadow": { classification: "non-colour" },
7395
+ "outer-glow": { classification: "non-colour" },
7396
+ "retro-3d-shadow": { classification: "non-colour" },
7397
+ "scale-up": { classification: "non-colour" },
7398
+ "scale-down": { classification: "non-colour" },
7399
+ lift: { classification: "non-colour" },
7400
+ "press-down": { classification: "non-colour" },
7401
+ pop: { classification: "non-colour" },
7402
+ "border-bottom-grow": { classification: "non-colour" },
7403
+ "sketchy-border": { classification: "non-colour" },
7404
+ "pulse-animation": { classification: "non-colour" }
7405
+ };
7406
+ function getButtonEffectPolicy(effectId) {
7407
+ return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
7408
+ }
7409
+ function classifyButtonEffectId(effectId) {
7410
+ return getButtonEffectPolicy(effectId)?.classification ?? "unknown";
7411
+ }
7412
+ //#endregion
7291
7413
  //#region ../theme-core/src/tokens/colorTokenParts.ts
7292
7414
  function parseOpacityPercent(source) {
7293
7415
  const trimmed = source.trim();
@@ -7419,6 +7541,10 @@ function isThemeColorToken(value) {
7419
7541
  const parts = parseColorTokenParts(value);
7420
7542
  return parts.kind === "token" && isThemeColorTokenBase(parts.token);
7421
7543
  }
7544
+ function parseThemeColorToken(value) {
7545
+ if (!isThemeColorToken(value)) return null;
7546
+ return value.trim();
7547
+ }
7422
7548
  const themeColorTokenSchema = z$1.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
7423
7549
  //#endregion
7424
7550
  //#region ../theme-core/src/buttons/types.ts
@@ -7437,6 +7563,20 @@ const VARIANT_ROLES = [
7437
7563
  "tertiary",
7438
7564
  "accent"
7439
7565
  ];
7566
+ function parseOpaqueButtonColourToken(value) {
7567
+ const token = parseThemeColorToken(value);
7568
+ if (token === null) return null;
7569
+ const parts = parseColorTokenParts(token);
7570
+ return parts.kind === "token" && parts.opacityPercent === null ? token : null;
7571
+ }
7572
+ function unsafeAsOpaqueButtonColourToken(value) {
7573
+ return value;
7574
+ }
7575
+ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
7576
+ const token = parseOpaqueButtonColourToken(value);
7577
+ if (token === null) throw new Error("Invariant: opaque button token passed its schema");
7578
+ return token;
7579
+ });
7440
7580
  const cornerStyleSchema = z$1.enum([
7441
7581
  "square",
7442
7582
  "rounded",
@@ -7538,7 +7678,7 @@ const buttonSizesSchema = z$1.object({
7538
7678
  lg,
7539
7679
  xl: xl ?? lg
7540
7680
  }));
7541
- const buttonGlobalSettingsSchema = z$1.object({
7681
+ const canonicalButtonGlobalSettingsSchema = z$1.object({
7542
7682
  cornerStyle: cornerStyleSchema,
7543
7683
  cornerRadius: z$1.number().min(0).max(24).optional(),
7544
7684
  /**
@@ -7569,11 +7709,12 @@ const buttonGlobalSettingsSchema = z$1.object({
7569
7709
  paddingPreset: buttonPaddingPresetSchema.optional(),
7570
7710
  hoverTransform: hoverTransformSchema,
7571
7711
  hoverColor: hoverColorSchema,
7572
- hoverColorToken: themeColorTokenSchema.optional(),
7712
+ hoverColorToken: opaqueButtonColourTokenSchema.optional(),
7573
7713
  gradientStyle: gradientStyleSchema.optional(),
7574
7714
  gradientAngle: z$1.number().min(0).max(360).optional(),
7575
7715
  gradientSharpness: gradientSharpnessSchema.optional()
7576
7716
  });
7717
+ const buttonGlobalSettingsSchema = z$1.preprocess(normalizeLegacyButtonGlobalInput, canonicalButtonGlobalSettingsSchema);
7577
7718
  const gradientDirectionSchema = z$1.enum([
7578
7719
  "to-r",
7579
7720
  "to-l",
@@ -7587,27 +7728,33 @@ const gradientDirectionSchema = z$1.enum([
7587
7728
  const buttonBackgroundSchema = z$1.discriminatedUnion("type", [
7588
7729
  z$1.object({
7589
7730
  type: z$1.literal("solid"),
7590
- colorToken: themeColorTokenSchema
7731
+ colorToken: opaqueButtonColourTokenSchema
7591
7732
  }),
7592
7733
  z$1.object({
7593
7734
  type: z$1.literal("gradient"),
7594
- stops: z$1.array(themeColorTokenSchema).min(2),
7595
- direction: gradientDirectionSchema
7735
+ stops: z$1.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
7736
+ const [first, second, ...rest] = stops;
7737
+ if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
7738
+ return [
7739
+ first,
7740
+ second,
7741
+ ...rest
7742
+ ];
7743
+ }),
7744
+ direction: gradientDirectionSchema,
7745
+ foregroundToken: opaqueButtonColourTokenSchema
7596
7746
  }),
7597
- z$1.object({ type: z$1.literal("transparent") })
7747
+ z$1.object({
7748
+ type: z$1.literal("surface"),
7749
+ role: z$1.literal("link")
7750
+ })
7598
7751
  ]);
7599
7752
  const effectApplicationSchema = z$1.object({
7600
7753
  effectId: z$1.string(),
7601
- options: z$1.record(z$1.string(), z$1.any()).optional()
7602
- });
7603
- const buttonBorderSchema = z$1.object({
7604
- widthClass: z$1.string(),
7605
- colorToken: themeColorTokenSchema
7606
- });
7607
- const buttonVariantAffordanceSchema = z$1.object({
7608
- iconId: z$1.string().min(1),
7609
- colorToken: themeColorTokenSchema.optional()
7754
+ options: z$1.record(z$1.string(), z$1.json()).optional()
7610
7755
  });
7756
+ const buttonBorderSchema = z$1.object({ widthClass: z$1.string() });
7757
+ const buttonVariantAffordanceSchema = z$1.object({ iconId: z$1.string().min(1) });
7611
7758
  const variantShadowSchema = z$1.object({
7612
7759
  elevation: z$1.enum([
7613
7760
  "none",
@@ -7648,27 +7795,170 @@ const variantSizeOverridesSchema = z$1.object({
7648
7795
  * default (e.g. link-style variants declaring zero horizontal padding at
7649
7796
  * every size).
7650
7797
  */
7651
- const buttonVariantSchema = z$1.object({
7798
+ const canonicalButtonVariantSchema = z$1.object({
7652
7799
  id: z$1.string(),
7653
7800
  name: z$1.string().min(1).max(20),
7654
7801
  enabled: z$1.boolean(),
7655
7802
  priority: prioritySchema,
7656
7803
  background: buttonBackgroundSchema,
7657
- textColorToken: themeColorTokenSchema,
7658
7804
  /** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
7659
7805
  borderRadius: z$1.string().optional(),
7660
7806
  shadow: variantShadowSchema.optional(),
7661
7807
  border: buttonBorderSchema.optional(),
7662
- hoverBackgroundToken: z$1.string().optional(),
7808
+ hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
7663
7809
  effects: variantEffectsSchema.optional(),
7664
7810
  sizes: variantSizeOverridesSchema.optional(),
7665
7811
  affordance: buttonVariantAffordanceSchema.optional()
7666
7812
  });
7813
+ /**
7814
+ * Temporary persisted-theme admission boundary for issue #1206.
7815
+ *
7816
+ * Production inventory on 2026-07-22 found 22 rows using the old independent
7817
+ * `textColorToken`/border colour shape. New source and all downstream code use
7818
+ * only the canonical relationship. Delete this preprocessor after the reviewed
7819
+ * production rewrite reports zero legacy rows.
7820
+ */
7821
+ const buttonVariantSchema = z$1.preprocess(normalizeLegacyButtonVariantInput, canonicalButtonVariantSchema);
7667
7822
  const buttonSystemSchema = z$1.object({
7668
7823
  global: buttonGlobalSettingsSchema,
7669
7824
  variants: z$1.array(buttonVariantSchema).min(1).max(6),
7670
7825
  sizes: buttonSizesSchema.optional()
7671
7826
  });
7827
+ function normalizeLegacyButtonVariantInput(input) {
7828
+ if (!isUnknownRecord(input)) return input;
7829
+ const background = input.background;
7830
+ if (!isUnknownRecord(background)) return input;
7831
+ 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;
7832
+ const { textColorToken, ...withoutLegacyText } = input;
7833
+ const normalizedBorder = isUnknownRecord(input.border) && typeof input.border.widthClass === "string" ? { widthClass: input.border.widthClass } : input.border;
7834
+ const normalizedAffordance = isUnknownRecord(input.affordance) && typeof input.affordance.iconId === "string" ? { iconId: input.affordance.iconId } : input.affordance;
7835
+ const normalizedEffects = normalizeLegacyButtonEffects(input.effects, background.type);
7836
+ const hoverBackgroundToken = stripLegacyTokenAlpha(input.hoverBackgroundToken);
7837
+ if (background.type === "transparent") return {
7838
+ ...withoutLegacyText,
7839
+ background: {
7840
+ type: "surface",
7841
+ role: "link"
7842
+ },
7843
+ border: normalizedBorder,
7844
+ affordance: normalizedAffordance,
7845
+ effects: normalizedEffects,
7846
+ hoverBackgroundToken
7847
+ };
7848
+ if (background.type === "gradient") {
7849
+ const stops = Array.isArray(background.stops) ? background.stops.map(stripLegacyTokenAlpha) : background.stops;
7850
+ return {
7851
+ ...withoutLegacyText,
7852
+ background: {
7853
+ ...background,
7854
+ stops,
7855
+ foregroundToken: stripLegacyTokenAlpha(background.foregroundToken ?? textColorToken)
7856
+ },
7857
+ border: normalizedBorder,
7858
+ affordance: normalizedAffordance,
7859
+ effects: normalizedEffects,
7860
+ hoverBackgroundToken
7861
+ };
7862
+ }
7863
+ return {
7864
+ ...withoutLegacyText,
7865
+ background: background.type === "solid" ? {
7866
+ ...background,
7867
+ colorToken: stripLegacyTokenAlpha(background.colorToken)
7868
+ } : background,
7869
+ border: normalizedBorder,
7870
+ affordance: normalizedAffordance,
7871
+ effects: normalizedEffects,
7872
+ hoverBackgroundToken
7873
+ };
7874
+ }
7875
+ function normalizeLegacyButtonGlobalInput(input) {
7876
+ if (!isUnknownRecord(input)) return input;
7877
+ const hoverColorToken = stripLegacyTokenAlpha(input.hoverColorToken);
7878
+ return hoverColorToken === input.hoverColorToken ? input : {
7879
+ ...input,
7880
+ hoverColorToken
7881
+ };
7882
+ }
7883
+ function hasLegacyAlphaToken(input, background) {
7884
+ const stops = isUnknownArray(background.stops) ? background.stops : [];
7885
+ return [
7886
+ input.hoverBackgroundToken,
7887
+ background.colorToken,
7888
+ background.foregroundToken,
7889
+ ...stops
7890
+ ].some((token) => stripLegacyTokenAlpha(token) !== token);
7891
+ }
7892
+ function stripLegacyTokenAlpha(value) {
7893
+ if (typeof value !== "string") return value;
7894
+ const slashIndex = value.indexOf("/");
7895
+ return slashIndex < 0 ? value : value.slice(0, slashIndex);
7896
+ }
7897
+ function hasLegacyButtonEffects(input) {
7898
+ if (!isUnknownRecord(input)) return false;
7899
+ return [
7900
+ "base",
7901
+ "hover",
7902
+ "active",
7903
+ "focus"
7904
+ ].some((state) => {
7905
+ const effects = input[state];
7906
+ return Array.isArray(effects) && effects.some((effect) => {
7907
+ if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return true;
7908
+ const classification = classifyButtonEffectId(effect.effectId);
7909
+ if (classification !== "colour-transition" && classification !== "non-colour") return true;
7910
+ return effect.effectId === "background-on-hover" && isUnknownRecord(effect.options) && stripLegacyTokenAlpha(effect.options.colorToken) !== effect.options.colorToken;
7911
+ });
7912
+ });
7913
+ }
7914
+ function normalizeLegacyButtonEffects(input, backgroundType) {
7915
+ if (!isUnknownRecord(input)) return input;
7916
+ const normalized = {};
7917
+ for (const state of [
7918
+ "base",
7919
+ "hover",
7920
+ "active",
7921
+ "focus"
7922
+ ]) {
7923
+ const effects = input[state];
7924
+ if (!Array.isArray(effects)) continue;
7925
+ const safeEffects = effects.flatMap((effect) => {
7926
+ if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return [];
7927
+ const classification = classifyButtonEffectId(effect.effectId);
7928
+ if (classification === "non-colour") return [effect];
7929
+ if (classification !== "colour-transition") return [];
7930
+ if (effect.effectId === "background-on-hover") {
7931
+ const options = isUnknownRecord(effect.options) ? effect.options : null;
7932
+ const colorToken = options === null ? null : parseOpaqueButtonColourToken(stripLegacyTokenAlpha(options.colorToken));
7933
+ return colorToken === null ? [] : [{
7934
+ ...effect,
7935
+ options: {
7936
+ ...options,
7937
+ colorToken
7938
+ }
7939
+ }];
7940
+ }
7941
+ if (backgroundType !== "solid") return [];
7942
+ const rawAmount = isUnknownRecord(effect.options) ? effect.options.amount : void 0;
7943
+ const amount = typeof rawAmount === "number" && rawAmount > 0 ? Math.max(100, Math.round(rawAmount / 100) * 100) : 100;
7944
+ return [{
7945
+ ...effect,
7946
+ options: {
7947
+ ...isUnknownRecord(effect.options) ? effect.options : {},
7948
+ amount
7949
+ }
7950
+ }];
7951
+ });
7952
+ if (safeEffects.length > 0) normalized[state] = safeEffects;
7953
+ }
7954
+ return Object.keys(normalized).length === 0 ? void 0 : normalized;
7955
+ }
7956
+ function isUnknownRecord(value) {
7957
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7958
+ }
7959
+ function isUnknownArray(value) {
7960
+ return Array.isArray(value);
7961
+ }
7672
7962
  //#endregion
7673
7963
  //#region ../theme-core/src/buttons/classNames.ts
7674
7964
  function themeButtonVariantClassNames(variant) {
@@ -7744,7 +8034,7 @@ function defineButtonPersonality(input) {
7744
8034
  name: input.name,
7745
8035
  description: input.description,
7746
8036
  tags: input.tags,
7747
- buttonSystem: input.buttonSystem
8037
+ buttonSystem: buttonSystemSchema.parse(input.buttonSystem)
7748
8038
  };
7749
8039
  }
7750
8040
  //#endregion
@@ -7797,19 +8087,15 @@ const brushedWash = defineButtonPersonality({
7797
8087
  background: {
7798
8088
  type: "gradient",
7799
8089
  stops: ["primary", "accent"],
7800
- direction: "to-r"
8090
+ direction: "to-r",
8091
+ foregroundToken: "primaryForeground"
7801
8092
  },
7802
- textColorToken: "primaryForeground",
7803
8093
  borderRadius: "rounded-lg",
7804
8094
  shadow: {
7805
8095
  elevation: "low",
7806
8096
  softness: "soft",
7807
8097
  position: "bottom"
7808
- },
7809
- effects: { hover: [{
7810
- effectId: "opacity-reduce",
7811
- options: { reduction: -15 }
7812
- }] }
8098
+ }
7813
8099
  },
7814
8100
  {
7815
8101
  id: "secondary",
@@ -7819,32 +8105,27 @@ const brushedWash = defineButtonPersonality({
7819
8105
  background: {
7820
8106
  type: "gradient",
7821
8107
  stops: ["secondary", "accent"],
7822
- direction: "to-br"
8108
+ direction: "to-br",
8109
+ foregroundToken: "primaryForeground"
7823
8110
  },
7824
- textColorToken: "primaryForeground",
7825
8111
  borderRadius: "rounded-lg",
7826
8112
  shadow: {
7827
8113
  elevation: "low",
7828
8114
  softness: "soft",
7829
8115
  position: "bottom"
7830
- },
7831
- effects: { hover: [{
7832
- effectId: "opacity-reduce",
7833
- options: { reduction: -15 }
7834
- }] }
8116
+ }
7835
8117
  },
7836
8118
  {
7837
8119
  id: "outline",
7838
8120
  name: "Outline",
7839
8121
  enabled: true,
7840
8122
  priority: 3,
7841
- background: { type: "transparent" },
7842
- textColorToken: "primary",
7843
- borderRadius: "rounded-lg",
7844
- border: {
7845
- widthClass: "border",
7846
- colorToken: "primary"
8123
+ background: {
8124
+ type: "surface",
8125
+ role: "link"
7847
8126
  },
8127
+ borderRadius: "rounded-lg",
8128
+ border: { widthClass: "border" },
7848
8129
  effects: { hover: [{
7849
8130
  effectId: "background-on-hover",
7850
8131
  options: { colorToken: "surface" }
@@ -7855,8 +8136,10 @@ const brushedWash = defineButtonPersonality({
7855
8136
  name: "Ghost",
7856
8137
  enabled: true,
7857
8138
  priority: 3,
7858
- background: { type: "transparent" },
7859
- textColorToken: "text",
8139
+ background: {
8140
+ type: "surface",
8141
+ role: "link"
8142
+ },
7860
8143
  borderRadius: "rounded-lg",
7861
8144
  effects: { hover: [{
7862
8145
  effectId: "background-on-hover",
@@ -7902,7 +8185,6 @@ const confidentChip = defineButtonPersonality({
7902
8185
  type: "solid",
7903
8186
  colorToken: "primary"
7904
8187
  },
7905
- textColorToken: "primaryForeground",
7906
8188
  borderRadius: "rounded-md",
7907
8189
  shadow: {
7908
8190
  elevation: "medium",
@@ -7912,7 +8194,7 @@ const confidentChip = defineButtonPersonality({
7912
8194
  effects: {
7913
8195
  hover: [{
7914
8196
  effectId: "darken-background",
7915
- options: { amount: 60 }
8197
+ options: { amount: 100 }
7916
8198
  }],
7917
8199
  active: [{
7918
8200
  effectId: "scale-down",
@@ -7929,12 +8211,8 @@ const confidentChip = defineButtonPersonality({
7929
8211
  type: "solid",
7930
8212
  colorToken: "surface"
7931
8213
  },
7932
- textColorToken: "text",
7933
8214
  borderRadius: "rounded-md",
7934
- border: {
7935
- widthClass: "border",
7936
- colorToken: "border"
7937
- },
8215
+ border: { widthClass: "border" },
7938
8216
  effects: { hover: [{
7939
8217
  effectId: "background-on-hover",
7940
8218
  options: { colorToken: "background" }
@@ -7945,13 +8223,12 @@ const confidentChip = defineButtonPersonality({
7945
8223
  name: "Outline",
7946
8224
  enabled: true,
7947
8225
  priority: 3,
7948
- background: { type: "transparent" },
7949
- textColorToken: "primary",
7950
- borderRadius: "rounded-md",
7951
- border: {
7952
- widthClass: "border",
7953
- colorToken: "primary"
8226
+ background: {
8227
+ type: "surface",
8228
+ role: "link"
7954
8229
  },
8230
+ borderRadius: "rounded-md",
8231
+ border: { widthClass: "border" },
7955
8232
  effects: { hover: [{
7956
8233
  effectId: "background-on-hover",
7957
8234
  options: { colorToken: "surface" }
@@ -7962,8 +8239,10 @@ const confidentChip = defineButtonPersonality({
7962
8239
  name: "Ghost",
7963
8240
  enabled: true,
7964
8241
  priority: 3,
7965
- background: { type: "transparent" },
7966
- textColorToken: "primary",
8242
+ background: {
8243
+ type: "surface",
8244
+ role: "link"
8245
+ },
7967
8246
  borderRadius: "rounded-md",
7968
8247
  effects: { hover: [{
7969
8248
  effectId: "background-on-hover",
@@ -8026,7 +8305,6 @@ const earthPill = defineButtonPersonality({
8026
8305
  type: "solid",
8027
8306
  colorToken: "primary"
8028
8307
  },
8029
- textColorToken: "primaryForeground",
8030
8308
  borderRadius: "rounded-full",
8031
8309
  shadow: {
8032
8310
  elevation: "low",
@@ -8052,13 +8330,12 @@ const earthPill = defineButtonPersonality({
8052
8330
  name: "Secondary",
8053
8331
  enabled: true,
8054
8332
  priority: 2,
8055
- background: { type: "transparent" },
8056
- textColorToken: "primary",
8057
- borderRadius: "rounded-full",
8058
- border: {
8059
- widthClass: "border",
8060
- colorToken: "primary"
8333
+ background: {
8334
+ type: "surface",
8335
+ role: "link"
8061
8336
  },
8337
+ borderRadius: "rounded-full",
8338
+ border: { widthClass: "border" },
8062
8339
  effects: { hover: [{
8063
8340
  effectId: "background-on-hover",
8064
8341
  options: { colorToken: "muted" }
@@ -8069,13 +8346,12 @@ const earthPill = defineButtonPersonality({
8069
8346
  name: "Outline",
8070
8347
  enabled: true,
8071
8348
  priority: 3,
8072
- background: { type: "transparent" },
8073
- textColorToken: "text",
8074
- borderRadius: "rounded-full",
8075
- border: {
8076
- widthClass: "border",
8077
- colorToken: "border"
8349
+ background: {
8350
+ type: "surface",
8351
+ role: "link"
8078
8352
  },
8353
+ borderRadius: "rounded-full",
8354
+ border: { widthClass: "border" },
8079
8355
  effects: { hover: [{
8080
8356
  effectId: "background-on-hover",
8081
8357
  options: { colorToken: "surfaceAlt" }
@@ -8086,8 +8362,10 @@ const earthPill = defineButtonPersonality({
8086
8362
  name: "Ghost",
8087
8363
  enabled: true,
8088
8364
  priority: 3,
8089
- background: { type: "transparent" },
8090
- textColorToken: "primary",
8365
+ background: {
8366
+ type: "surface",
8367
+ role: "link"
8368
+ },
8091
8369
  borderRadius: "rounded-full",
8092
8370
  shadow: {
8093
8371
  elevation: "none",
@@ -8108,11 +8386,7 @@ const earthPill = defineButtonPersonality({
8108
8386
  padding: "0.625rem 0",
8109
8387
  fontSize: "text-xl"
8110
8388
  }
8111
- },
8112
- effects: { hover: [{
8113
- effectId: "opacity-reduce",
8114
- options: { reduction: 25 }
8115
- }] }
8389
+ }
8116
8390
  }
8117
8391
  ]
8118
8392
  }
@@ -8148,8 +8422,10 @@ const editorialLink = defineButtonPersonality({
8148
8422
  name: "Primary",
8149
8423
  enabled: true,
8150
8424
  priority: 1,
8151
- background: { type: "transparent" },
8152
- textColorToken: "text",
8425
+ background: {
8426
+ type: "surface",
8427
+ role: "link"
8428
+ },
8153
8429
  borderRadius: "rounded-none",
8154
8430
  sizes: {
8155
8431
  sm: { padding: "0.25rem 0" },
@@ -8171,8 +8447,10 @@ const editorialLink = defineButtonPersonality({
8171
8447
  name: "Secondary",
8172
8448
  enabled: true,
8173
8449
  priority: 2,
8174
- background: { type: "transparent" },
8175
- textColorToken: "mutedText",
8450
+ background: {
8451
+ type: "surface",
8452
+ role: "link"
8453
+ },
8176
8454
  borderRadius: "rounded-none",
8177
8455
  sizes: {
8178
8456
  sm: { padding: "0.25rem 0" },
@@ -8194,8 +8472,10 @@ const editorialLink = defineButtonPersonality({
8194
8472
  name: "Outline",
8195
8473
  enabled: true,
8196
8474
  priority: 3,
8197
- background: { type: "transparent" },
8198
- textColorToken: "accent",
8475
+ background: {
8476
+ type: "surface",
8477
+ role: "link"
8478
+ },
8199
8479
  borderRadius: "rounded-none",
8200
8480
  sizes: {
8201
8481
  sm: { padding: "0.25rem 0" },
@@ -8217,19 +8497,17 @@ const editorialLink = defineButtonPersonality({
8217
8497
  name: "Ghost",
8218
8498
  enabled: true,
8219
8499
  priority: 3,
8220
- background: { type: "transparent" },
8221
- textColorToken: "mutedText",
8500
+ background: {
8501
+ type: "surface",
8502
+ role: "link"
8503
+ },
8222
8504
  borderRadius: "rounded-none",
8223
8505
  sizes: {
8224
8506
  sm: { padding: "0.25rem 0" },
8225
8507
  md: { padding: "0.5rem 0" },
8226
8508
  lg: { padding: "0.625rem 0" },
8227
8509
  xl: { padding: "0.75rem 0" }
8228
- },
8229
- effects: { hover: [{
8230
- effectId: "opacity-reduce",
8231
- options: { reduction: -20 }
8232
- }] }
8510
+ }
8233
8511
  }
8234
8512
  ]
8235
8513
  }
@@ -8291,12 +8569,8 @@ const flatInk = defineButtonPersonality({
8291
8569
  type: "solid",
8292
8570
  colorToken: "primary"
8293
8571
  },
8294
- textColorToken: "primaryForeground",
8295
8572
  borderRadius: "rounded-lg",
8296
- affordance: {
8297
- iconId: "ArrowRight",
8298
- colorToken: "accent"
8299
- },
8573
+ affordance: { iconId: "ArrowRight" },
8300
8574
  effects: { hover: [{
8301
8575
  effectId: "lift",
8302
8576
  options: { translateY: "-2px" }
@@ -8310,13 +8584,12 @@ const flatInk = defineButtonPersonality({
8310
8584
  name: "Secondary",
8311
8585
  enabled: true,
8312
8586
  priority: 2,
8313
- background: { type: "transparent" },
8314
- textColorToken: "primary",
8315
- borderRadius: "rounded-lg",
8316
- border: {
8317
- widthClass: "border",
8318
- colorToken: "border"
8587
+ background: {
8588
+ type: "surface",
8589
+ role: "link"
8319
8590
  },
8591
+ borderRadius: "rounded-lg",
8592
+ border: { widthClass: "border" },
8320
8593
  effects: { hover: [{
8321
8594
  effectId: "lift",
8322
8595
  options: { translateY: "-2px" }
@@ -8334,12 +8607,8 @@ const flatInk = defineButtonPersonality({
8334
8607
  type: "solid",
8335
8608
  colorToken: "accent"
8336
8609
  },
8337
- textColorToken: "accentForeground",
8338
8610
  borderRadius: "rounded-lg",
8339
- affordance: {
8340
- iconId: "ArrowRight",
8341
- colorToken: "accentForeground"
8342
- },
8611
+ affordance: { iconId: "ArrowRight" },
8343
8612
  effects: { hover: [{
8344
8613
  effectId: "lift",
8345
8614
  options: { translateY: "-2px" }
@@ -8402,7 +8671,6 @@ const inkStamp = defineButtonPersonality({
8402
8671
  type: "solid",
8403
8672
  colorToken: "primary"
8404
8673
  },
8405
- textColorToken: "primaryForeground",
8406
8674
  borderRadius: "rounded-md",
8407
8675
  effects: {
8408
8676
  hover: [{
@@ -8423,13 +8691,12 @@ const inkStamp = defineButtonPersonality({
8423
8691
  name: "Secondary",
8424
8692
  enabled: true,
8425
8693
  priority: 2,
8426
- background: { type: "transparent" },
8427
- textColorToken: "primary",
8428
- borderRadius: "rounded-md",
8429
- border: {
8430
- widthClass: "border-2",
8431
- colorToken: "primary"
8694
+ background: {
8695
+ type: "surface",
8696
+ role: "link"
8432
8697
  },
8698
+ borderRadius: "rounded-md",
8699
+ border: { widthClass: "border-2" },
8433
8700
  effects: { hover: [{
8434
8701
  effectId: "background-on-hover",
8435
8702
  options: { colorToken: "surface" }
@@ -8440,13 +8707,12 @@ const inkStamp = defineButtonPersonality({
8440
8707
  name: "Outline",
8441
8708
  enabled: true,
8442
8709
  priority: 3,
8443
- background: { type: "transparent" },
8444
- textColorToken: "text",
8445
- borderRadius: "rounded-md",
8446
- border: {
8447
- widthClass: "border-2",
8448
- colorToken: "border"
8710
+ background: {
8711
+ type: "surface",
8712
+ role: "link"
8449
8713
  },
8714
+ borderRadius: "rounded-md",
8715
+ border: { widthClass: "border-2" },
8450
8716
  effects: { hover: [{
8451
8717
  effectId: "background-on-hover",
8452
8718
  options: { colorToken: "surface" }
@@ -8457,8 +8723,10 @@ const inkStamp = defineButtonPersonality({
8457
8723
  name: "Ghost",
8458
8724
  enabled: true,
8459
8725
  priority: 3,
8460
- background: { type: "transparent" },
8461
- textColorToken: "accent",
8726
+ background: {
8727
+ type: "surface",
8728
+ role: "link"
8729
+ },
8462
8730
  borderRadius: "rounded-none",
8463
8731
  sizes: {
8464
8732
  sm: {
@@ -8551,7 +8819,6 @@ const joyStamp = defineButtonPersonality({
8551
8819
  type: "solid",
8552
8820
  colorToken: "primary"
8553
8821
  },
8554
- textColorToken: "primaryForeground",
8555
8822
  borderRadius: "rounded-full",
8556
8823
  shadow: {
8557
8824
  elevation: "high",
@@ -8565,13 +8832,12 @@ const joyStamp = defineButtonPersonality({
8565
8832
  name: "Secondary",
8566
8833
  enabled: true,
8567
8834
  priority: 2,
8568
- background: { type: "transparent" },
8569
- textColorToken: "text",
8570
- borderRadius: "rounded-full",
8571
- border: {
8572
- widthClass: "border-2",
8573
- colorToken: "text"
8835
+ background: {
8836
+ type: "surface",
8837
+ role: "link"
8574
8838
  },
8839
+ borderRadius: "rounded-full",
8840
+ border: { widthClass: "border-2" },
8575
8841
  shadow: {
8576
8842
  elevation: "high",
8577
8843
  softness: "hard",
@@ -8636,12 +8902,8 @@ const ornateRitual = defineButtonPersonality({
8636
8902
  type: "solid",
8637
8903
  colorToken: "primary"
8638
8904
  },
8639
- textColorToken: "primaryForeground",
8640
8905
  borderRadius: "rounded-md",
8641
- border: {
8642
- widthClass: "border",
8643
- colorToken: "primary"
8644
- },
8906
+ border: { widthClass: "border" },
8645
8907
  effects: {
8646
8908
  hover: [{
8647
8909
  effectId: "background-on-hover",
@@ -8662,12 +8924,8 @@ const ornateRitual = defineButtonPersonality({
8662
8924
  type: "solid",
8663
8925
  colorToken: "secondary"
8664
8926
  },
8665
- textColorToken: "primaryForeground",
8666
8927
  borderRadius: "rounded-md",
8667
- border: {
8668
- widthClass: "border",
8669
- colorToken: "primary"
8670
- },
8928
+ border: { widthClass: "border" },
8671
8929
  effects: { hover: [{
8672
8930
  effectId: "background-on-hover",
8673
8931
  options: { colorToken: "surface" }
@@ -8678,13 +8936,12 @@ const ornateRitual = defineButtonPersonality({
8678
8936
  name: "Outline",
8679
8937
  enabled: true,
8680
8938
  priority: 3,
8681
- background: { type: "transparent" },
8682
- textColorToken: "primary",
8683
- borderRadius: "rounded-md",
8684
- border: {
8685
- widthClass: "border",
8686
- colorToken: "primary"
8939
+ background: {
8940
+ type: "surface",
8941
+ role: "link"
8687
8942
  },
8943
+ borderRadius: "rounded-md",
8944
+ border: { widthClass: "border" },
8688
8945
  effects: { hover: [{
8689
8946
  effectId: "background-on-hover",
8690
8947
  options: { colorToken: "muted" }
@@ -8695,8 +8952,10 @@ const ornateRitual = defineButtonPersonality({
8695
8952
  name: "Ghost",
8696
8953
  enabled: true,
8697
8954
  priority: 3,
8698
- background: { type: "transparent" },
8699
- textColorToken: "accent",
8955
+ background: {
8956
+ type: "surface",
8957
+ role: "link"
8958
+ },
8700
8959
  borderRadius: "rounded-none",
8701
8960
  sizes: {
8702
8961
  sm: {
@@ -8778,14 +9037,10 @@ const pebble = defineButtonPersonality({
8778
9037
  type: "solid",
8779
9038
  colorToken: "primary"
8780
9039
  },
8781
- textColorToken: "primaryForeground",
8782
9040
  borderRadius: "rounded-full",
8783
9041
  effects: { hover: [{
8784
- effectId: "background-on-hover-alpha",
8785
- options: {
8786
- colorToken: "primary",
8787
- opacity: 88
8788
- }
9042
+ effectId: "darken-background",
9043
+ options: { amount: 100 }
8789
9044
  }] }
8790
9045
  },
8791
9046
  {
@@ -8793,13 +9048,12 @@ const pebble = defineButtonPersonality({
8793
9048
  name: "Secondary",
8794
9049
  enabled: true,
8795
9050
  priority: 2,
8796
- background: { type: "transparent" },
8797
- textColorToken: "primary",
8798
- borderRadius: "rounded-full",
8799
- border: {
8800
- widthClass: "border-2",
8801
- colorToken: "accent"
9051
+ background: {
9052
+ type: "surface",
9053
+ role: "link"
8802
9054
  },
9055
+ borderRadius: "rounded-full",
9056
+ border: { widthClass: "border-2" },
8803
9057
  effects: { hover: [{
8804
9058
  effectId: "background-on-hover",
8805
9059
  options: { colorToken: "accent" }
@@ -8810,13 +9064,12 @@ const pebble = defineButtonPersonality({
8810
9064
  name: "Outline",
8811
9065
  enabled: true,
8812
9066
  priority: 3,
8813
- background: { type: "transparent" },
8814
- textColorToken: "text",
8815
- borderRadius: "rounded-full",
8816
- border: {
8817
- widthClass: "border",
8818
- colorToken: "border"
9067
+ background: {
9068
+ type: "surface",
9069
+ role: "link"
8819
9070
  },
9071
+ borderRadius: "rounded-full",
9072
+ border: { widthClass: "border" },
8820
9073
  effects: { hover: [{
8821
9074
  effectId: "background-on-hover",
8822
9075
  options: { colorToken: "surface" }
@@ -8827,8 +9080,10 @@ const pebble = defineButtonPersonality({
8827
9080
  name: "Ghost",
8828
9081
  enabled: true,
8829
9082
  priority: 3,
8830
- background: { type: "transparent" },
8831
- textColorToken: "primary",
9083
+ background: {
9084
+ type: "surface",
9085
+ role: "link"
9086
+ },
8832
9087
  borderRadius: "rounded-full",
8833
9088
  sizes: {
8834
9089
  sm: {
@@ -8844,11 +9099,7 @@ const pebble = defineButtonPersonality({
8844
9099
  padding: "0.75rem 1.5rem",
8845
9100
  fontSize: "text-xl"
8846
9101
  }
8847
- },
8848
- effects: { hover: [{
8849
- effectId: "opacity-reduce",
8850
- options: { reduction: 30 }
8851
- }] }
9102
+ }
8852
9103
  }
8853
9104
  ]
8854
9105
  }
@@ -8910,15 +9161,11 @@ const quietArrow = defineButtonPersonality({
8910
9161
  type: "solid",
8911
9162
  colorToken: "primary"
8912
9163
  },
8913
- textColorToken: "primaryForeground",
8914
9164
  borderRadius: "rounded-xl",
8915
9165
  affordance: { iconId: "ArrowRight" },
8916
9166
  effects: { hover: [{
8917
- effectId: "background-on-hover-alpha",
8918
- options: {
8919
- colorToken: "primary",
8920
- opacity: 90
8921
- }
9167
+ effectId: "darken-background",
9168
+ options: { amount: 100 }
8922
9169
  }] }
8923
9170
  },
8924
9171
  {
@@ -8926,13 +9173,12 @@ const quietArrow = defineButtonPersonality({
8926
9173
  name: "Secondary",
8927
9174
  enabled: true,
8928
9175
  priority: 2,
8929
- background: { type: "transparent" },
8930
- textColorToken: "primary",
8931
- borderRadius: "rounded-xl",
8932
- border: {
8933
- widthClass: "border",
8934
- colorToken: "primary"
9176
+ background: {
9177
+ type: "surface",
9178
+ role: "link"
8935
9179
  },
9180
+ borderRadius: "rounded-xl",
9181
+ border: { widthClass: "border" },
8936
9182
  affordance: { iconId: "ArrowRight" },
8937
9183
  effects: { hover: [{
8938
9184
  effectId: "background-on-hover",
@@ -8944,21 +9190,22 @@ const quietArrow = defineButtonPersonality({
8944
9190
  name: "Outline",
8945
9191
  enabled: true,
8946
9192
  priority: 3,
8947
- background: { type: "transparent" },
8948
- textColorToken: "primary",
9193
+ background: {
9194
+ type: "surface",
9195
+ role: "link"
9196
+ },
8949
9197
  borderRadius: "rounded-xl",
8950
- border: {
8951
- widthClass: "border",
8952
- colorToken: "primary"
8953
- }
9198
+ border: { widthClass: "border" }
8954
9199
  },
8955
9200
  {
8956
9201
  id: "ghost",
8957
9202
  name: "Ghost",
8958
9203
  enabled: true,
8959
9204
  priority: 3,
8960
- background: { type: "transparent" },
8961
- textColorToken: "primary",
9205
+ background: {
9206
+ type: "surface",
9207
+ role: "link"
9208
+ },
8962
9209
  borderRadius: "rounded-xl"
8963
9210
  }
8964
9211
  ]
@@ -9022,7 +9269,6 @@ const showtimePill = defineButtonPersonality({
9022
9269
  type: "solid",
9023
9270
  colorToken: "primary"
9024
9271
  },
9025
- textColorToken: "background",
9026
9272
  borderRadius: "rounded-full",
9027
9273
  effects: { hover: [{ effectId: "pop" }] }
9028
9274
  },
@@ -9031,13 +9277,12 @@ const showtimePill = defineButtonPersonality({
9031
9277
  name: "Secondary",
9032
9278
  enabled: true,
9033
9279
  priority: 2,
9034
- background: { type: "transparent" },
9035
- textColorToken: "primary",
9036
- borderRadius: "rounded-full",
9037
- border: {
9038
- widthClass: "border-2",
9039
- colorToken: "primary"
9280
+ background: {
9281
+ type: "surface",
9282
+ role: "link"
9040
9283
  },
9284
+ borderRadius: "rounded-full",
9285
+ border: { widthClass: "border-2" },
9041
9286
  effects: { hover: [{ effectId: "pop" }] }
9042
9287
  },
9043
9288
  {
@@ -9049,7 +9294,6 @@ const showtimePill = defineButtonPersonality({
9049
9294
  type: "solid",
9050
9295
  colorToken: "secondary"
9051
9296
  },
9052
- textColorToken: "primary",
9053
9297
  borderRadius: "rounded-full",
9054
9298
  effects: { hover: [{ effectId: "pop" }] }
9055
9299
  },
@@ -9062,12 +9306,8 @@ const showtimePill = defineButtonPersonality({
9062
9306
  type: "solid",
9063
9307
  colorToken: "background"
9064
9308
  },
9065
- textColorToken: "primary",
9066
9309
  borderRadius: "rounded-full",
9067
- border: {
9068
- widthClass: "border-2",
9069
- colorToken: "primary"
9070
- },
9310
+ border: { widthClass: "border-2" },
9071
9311
  effects: { hover: [{
9072
9312
  effectId: "background-on-hover",
9073
9313
  options: { colorToken: "surface" }
@@ -9078,13 +9318,12 @@ const showtimePill = defineButtonPersonality({
9078
9318
  name: "Outline",
9079
9319
  enabled: true,
9080
9320
  priority: 3,
9081
- background: { type: "transparent" },
9082
- textColorToken: "primary",
9083
- borderRadius: "rounded-full",
9084
- border: {
9085
- widthClass: "border-2",
9086
- colorToken: "primary"
9321
+ background: {
9322
+ type: "surface",
9323
+ role: "link"
9087
9324
  },
9325
+ borderRadius: "rounded-full",
9326
+ border: { widthClass: "border-2" },
9088
9327
  effects: { hover: [{
9089
9328
  effectId: "background-on-hover",
9090
9329
  options: { colorToken: "background" }
@@ -9095,8 +9334,10 @@ const showtimePill = defineButtonPersonality({
9095
9334
  name: "Ghost",
9096
9335
  enabled: true,
9097
9336
  priority: 3,
9098
- background: { type: "transparent" },
9099
- textColorToken: "primary",
9337
+ background: {
9338
+ type: "surface",
9339
+ role: "link"
9340
+ },
9100
9341
  borderRadius: "rounded-full",
9101
9342
  effects: { hover: [{
9102
9343
  effectId: "background-on-hover",
@@ -9142,7 +9383,6 @@ const softPill = defineButtonPersonality({
9142
9383
  type: "solid",
9143
9384
  colorToken: "primary"
9144
9385
  },
9145
- textColorToken: "primaryForeground",
9146
9386
  borderRadius: "rounded-full",
9147
9387
  shadow: {
9148
9388
  elevation: "low",
@@ -9165,13 +9405,12 @@ const softPill = defineButtonPersonality({
9165
9405
  name: "Secondary",
9166
9406
  enabled: true,
9167
9407
  priority: 2,
9168
- background: { type: "transparent" },
9169
- textColorToken: "primary",
9170
- borderRadius: "rounded-full",
9171
- border: {
9172
- widthClass: "border-2",
9173
- colorToken: "primary"
9408
+ background: {
9409
+ type: "surface",
9410
+ role: "link"
9174
9411
  },
9412
+ borderRadius: "rounded-full",
9413
+ border: { widthClass: "border-2" },
9175
9414
  effects: { hover: [{
9176
9415
  effectId: "background-on-hover",
9177
9416
  options: { colorToken: "surface" }
@@ -9182,13 +9421,12 @@ const softPill = defineButtonPersonality({
9182
9421
  name: "Outline",
9183
9422
  enabled: true,
9184
9423
  priority: 3,
9185
- background: { type: "transparent" },
9186
- textColorToken: "text",
9187
- borderRadius: "rounded-full",
9188
- border: {
9189
- widthClass: "border",
9190
- colorToken: "border"
9424
+ background: {
9425
+ type: "surface",
9426
+ role: "link"
9191
9427
  },
9428
+ borderRadius: "rounded-full",
9429
+ border: { widthClass: "border" },
9192
9430
  effects: { hover: [{
9193
9431
  effectId: "background-on-hover",
9194
9432
  options: { colorToken: "surface" }
@@ -9199,8 +9437,10 @@ const softPill = defineButtonPersonality({
9199
9437
  name: "Ghost",
9200
9438
  enabled: true,
9201
9439
  priority: 3,
9202
- background: { type: "transparent" },
9203
- textColorToken: "text",
9440
+ background: {
9441
+ type: "surface",
9442
+ role: "link"
9443
+ },
9204
9444
  borderRadius: "rounded-full",
9205
9445
  effects: { hover: [{
9206
9446
  effectId: "background-on-hover",
@@ -9219,9 +9459,8 @@ const solidSecondary = {
9219
9459
  priority: 2,
9220
9460
  background: {
9221
9461
  type: "solid",
9222
- colorToken: "secondary"
9462
+ colorToken: unsafeAsOpaqueButtonColourToken("secondary")
9223
9463
  },
9224
- textColorToken: "onSecondary",
9225
9464
  borderRadius: "rounded-full",
9226
9465
  shadow: {
9227
9466
  elevation: "none",
@@ -9269,6 +9508,27 @@ const buttonPersonalities = [
9269
9508
  quietArrow
9270
9509
  ];
9271
9510
  new Map(buttonPersonalities.map((p) => [p.id, p]));
9511
+ buttonPersonalities.map((personality) => ({
9512
+ id: personality.id,
9513
+ name: personality.name,
9514
+ description: personality.description,
9515
+ category: presetCategory(personality),
9516
+ buttonSystem: personality.buttonSystem,
9517
+ compatibility: {
9518
+ ...personality.tags.tone ? { tones: [personality.tags.tone] } : {},
9519
+ ...personality.tags.energy ? { energies: [personality.tags.energy] } : {}
9520
+ }
9521
+ }));
9522
+ function presetCategory(personality) {
9523
+ switch (personality.tags.era) {
9524
+ case "retro": return "retro";
9525
+ case "editorial": return "minimal";
9526
+ case "organic": return "artistic";
9527
+ case "modern": return personality.tags.tone === "bold" ? "modern" : "technical";
9528
+ case "technical": return "technical";
9529
+ case void 0: return "modern";
9530
+ }
9531
+ }
9272
9532
  //#endregion
9273
9533
  //#region ../blocks/src/system/runtime/shared/components/FeedbackMessage.tsx
9274
9534
  function joinClasses(...parts) {