@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
@@ -132,6 +132,10 @@ function isThemeColorToken(value) {
132
132
  const parts = parseColorTokenParts(value);
133
133
  return parts.kind === "token" && isThemeColorTokenBase(parts.token);
134
134
  }
135
+ function parseThemeColorToken(value) {
136
+ if (!isThemeColorToken(value)) return null;
137
+ return value.trim();
138
+ }
135
139
  const themeColorTokenSchema = z$1.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
136
140
  //#endregion
137
141
  //#region ../theme-core/src/site-styles/styleTags.ts
@@ -224,6 +228,111 @@ const mediaSchema = z.object({
224
228
  transform: transformSchema.optional()
225
229
  });
226
230
  //#endregion
231
+ //#region ../theme-core/src/buttons/effectClassification.ts
232
+ /**
233
+ * Exhaustive live policy for every registered effect id.
234
+ *
235
+ * The resolver consumes the transition payload directly, so adding an effect
236
+ * cannot update classification without also defining its runtime behavior.
237
+ */
238
+ const BUTTON_EFFECT_POLICIES = {
239
+ "darken-background": {
240
+ classification: "colour-transition",
241
+ transition: {
242
+ kind: "adjust-shade",
243
+ direction: "darker"
244
+ }
245
+ },
246
+ "lighten-background": {
247
+ classification: "colour-transition",
248
+ transition: {
249
+ kind: "adjust-shade",
250
+ direction: "lighter"
251
+ }
252
+ },
253
+ "background-on-hover": {
254
+ classification: "colour-transition",
255
+ transition: { kind: "replace-background" }
256
+ },
257
+ "background-on-hover-alpha": {
258
+ classification: "unsupported-colour",
259
+ reason: "alpha_requires_surface"
260
+ },
261
+ "fade-background": {
262
+ classification: "unsupported-colour",
263
+ reason: "changes_element_opacity"
264
+ },
265
+ "opacity-reduce": {
266
+ classification: "unsupported-colour",
267
+ reason: "changes_element_opacity"
268
+ },
269
+ "gradient-text": {
270
+ classification: "unsupported-colour",
271
+ reason: "changes_foreground"
272
+ },
273
+ "text-color-change": {
274
+ classification: "unsupported-colour",
275
+ reason: "changes_foreground"
276
+ },
277
+ "border-color-change": {
278
+ classification: "unsupported-colour",
279
+ reason: "changes_border"
280
+ },
281
+ "aurora-glow": {
282
+ classification: "unsupported-background-overlay",
283
+ reason: "unresolved_background_overlay"
284
+ },
285
+ "cosmic-stardust": {
286
+ classification: "unsupported-background-overlay",
287
+ reason: "unresolved_background_overlay"
288
+ },
289
+ "gradient-border-fill": {
290
+ classification: "unsupported-background-overlay",
291
+ reason: "unresolved_background_overlay"
292
+ },
293
+ "animated-gradient-border-fill": {
294
+ classification: "unsupported-background-overlay",
295
+ reason: "unresolved_background_overlay"
296
+ },
297
+ "nav-underline": {
298
+ classification: "not-button",
299
+ reason: "not_button_effect"
300
+ },
301
+ "nav-frosted-base": {
302
+ classification: "not-button",
303
+ reason: "not_button_effect"
304
+ },
305
+ "nav-frosted-hover": {
306
+ classification: "not-button",
307
+ reason: "not_button_effect"
308
+ },
309
+ "nav-frosted-active": {
310
+ classification: "not-button",
311
+ reason: "not_button_effect"
312
+ },
313
+ "animated-gradient": { classification: "non-colour" },
314
+ "border-glow": { classification: "non-colour" },
315
+ "drop-shadow": { classification: "non-colour" },
316
+ "inner-shadow": { classification: "non-colour" },
317
+ "neumorphic-shadow": { classification: "non-colour" },
318
+ "outer-glow": { classification: "non-colour" },
319
+ "retro-3d-shadow": { classification: "non-colour" },
320
+ "scale-up": { classification: "non-colour" },
321
+ "scale-down": { classification: "non-colour" },
322
+ lift: { classification: "non-colour" },
323
+ "press-down": { classification: "non-colour" },
324
+ pop: { classification: "non-colour" },
325
+ "border-bottom-grow": { classification: "non-colour" },
326
+ "sketchy-border": { classification: "non-colour" },
327
+ "pulse-animation": { classification: "non-colour" }
328
+ };
329
+ function getButtonEffectPolicy(effectId) {
330
+ return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
331
+ }
332
+ function classifyButtonEffectId(effectId) {
333
+ return getButtonEffectPolicy(effectId)?.classification ?? "unknown";
334
+ }
335
+ //#endregion
227
336
  //#region ../theme-core/src/buttons/types.ts
228
337
  /**
229
338
  * Standard semantic variant roles a theme exposes.
@@ -240,6 +349,20 @@ const VARIANT_ROLES = [
240
349
  "tertiary",
241
350
  "accent"
242
351
  ];
352
+ function parseOpaqueButtonColourToken(value) {
353
+ const token = parseThemeColorToken(value);
354
+ if (token === null) return null;
355
+ const parts = parseColorTokenParts(token);
356
+ return parts.kind === "token" && parts.opacityPercent === null ? token : null;
357
+ }
358
+ function unsafeAsOpaqueButtonColourToken(value) {
359
+ return value;
360
+ }
361
+ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
362
+ const token = parseOpaqueButtonColourToken(value);
363
+ if (token === null) throw new Error("Invariant: opaque button token passed its schema");
364
+ return token;
365
+ });
243
366
  const cornerStyleSchema = z$1.enum([
244
367
  "square",
245
368
  "rounded",
@@ -341,7 +464,7 @@ const buttonSizesSchema = z$1.object({
341
464
  lg,
342
465
  xl: xl ?? lg
343
466
  }));
344
- const buttonGlobalSettingsSchema = z$1.object({
467
+ const canonicalButtonGlobalSettingsSchema = z$1.object({
345
468
  cornerStyle: cornerStyleSchema,
346
469
  cornerRadius: z$1.number().min(0).max(24).optional(),
347
470
  /**
@@ -372,11 +495,12 @@ const buttonGlobalSettingsSchema = z$1.object({
372
495
  paddingPreset: buttonPaddingPresetSchema.optional(),
373
496
  hoverTransform: hoverTransformSchema,
374
497
  hoverColor: hoverColorSchema,
375
- hoverColorToken: themeColorTokenSchema.optional(),
498
+ hoverColorToken: opaqueButtonColourTokenSchema.optional(),
376
499
  gradientStyle: gradientStyleSchema.optional(),
377
500
  gradientAngle: z$1.number().min(0).max(360).optional(),
378
501
  gradientSharpness: gradientSharpnessSchema.optional()
379
502
  });
503
+ const buttonGlobalSettingsSchema = z$1.preprocess(normalizeLegacyButtonGlobalInput, canonicalButtonGlobalSettingsSchema);
380
504
  const gradientDirectionSchema$1 = z$1.enum([
381
505
  "to-r",
382
506
  "to-l",
@@ -390,27 +514,33 @@ const gradientDirectionSchema$1 = z$1.enum([
390
514
  const buttonBackgroundSchema = z$1.discriminatedUnion("type", [
391
515
  z$1.object({
392
516
  type: z$1.literal("solid"),
393
- colorToken: themeColorTokenSchema
517
+ colorToken: opaqueButtonColourTokenSchema
394
518
  }),
395
519
  z$1.object({
396
520
  type: z$1.literal("gradient"),
397
- stops: z$1.array(themeColorTokenSchema).min(2),
398
- direction: gradientDirectionSchema$1
521
+ stops: z$1.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
522
+ const [first, second, ...rest] = stops;
523
+ if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
524
+ return [
525
+ first,
526
+ second,
527
+ ...rest
528
+ ];
529
+ }),
530
+ direction: gradientDirectionSchema$1,
531
+ foregroundToken: opaqueButtonColourTokenSchema
399
532
  }),
400
- z$1.object({ type: z$1.literal("transparent") })
533
+ z$1.object({
534
+ type: z$1.literal("surface"),
535
+ role: z$1.literal("link")
536
+ })
401
537
  ]);
402
538
  const effectApplicationSchema$1 = z$1.object({
403
539
  effectId: z$1.string(),
404
- options: z$1.record(z$1.string(), z$1.any()).optional()
405
- });
406
- const buttonBorderSchema = z$1.object({
407
- widthClass: z$1.string(),
408
- colorToken: themeColorTokenSchema
409
- });
410
- const buttonVariantAffordanceSchema = z$1.object({
411
- iconId: z$1.string().min(1),
412
- colorToken: themeColorTokenSchema.optional()
540
+ options: z$1.record(z$1.string(), z$1.json()).optional()
413
541
  });
542
+ const buttonBorderSchema = z$1.object({ widthClass: z$1.string() });
543
+ const buttonVariantAffordanceSchema = z$1.object({ iconId: z$1.string().min(1) });
414
544
  const variantShadowSchema = z$1.object({
415
545
  elevation: z$1.enum([
416
546
  "none",
@@ -451,27 +581,170 @@ const variantSizeOverridesSchema = z$1.object({
451
581
  * default (e.g. link-style variants declaring zero horizontal padding at
452
582
  * every size).
453
583
  */
454
- const buttonVariantSchema = z$1.object({
584
+ const canonicalButtonVariantSchema = z$1.object({
455
585
  id: z$1.string(),
456
586
  name: z$1.string().min(1).max(20),
457
587
  enabled: z$1.boolean(),
458
588
  priority: prioritySchema,
459
589
  background: buttonBackgroundSchema,
460
- textColorToken: themeColorTokenSchema,
461
590
  /** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
462
591
  borderRadius: z$1.string().optional(),
463
592
  shadow: variantShadowSchema.optional(),
464
593
  border: buttonBorderSchema.optional(),
465
- hoverBackgroundToken: z$1.string().optional(),
594
+ hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
466
595
  effects: variantEffectsSchema.optional(),
467
596
  sizes: variantSizeOverridesSchema.optional(),
468
597
  affordance: buttonVariantAffordanceSchema.optional()
469
598
  });
599
+ /**
600
+ * Temporary persisted-theme admission boundary for issue #1206.
601
+ *
602
+ * Production inventory on 2026-07-22 found 22 rows using the old independent
603
+ * `textColorToken`/border colour shape. New source and all downstream code use
604
+ * only the canonical relationship. Delete this preprocessor after the reviewed
605
+ * production rewrite reports zero legacy rows.
606
+ */
607
+ const buttonVariantSchema = z$1.preprocess(normalizeLegacyButtonVariantInput, canonicalButtonVariantSchema);
470
608
  const buttonSystemSchema = z$1.object({
471
609
  global: buttonGlobalSettingsSchema,
472
610
  variants: z$1.array(buttonVariantSchema).min(1).max(6),
473
611
  sizes: buttonSizesSchema.optional()
474
612
  });
613
+ function normalizeLegacyButtonVariantInput(input) {
614
+ if (!isUnknownRecord(input)) return input;
615
+ const background = input.background;
616
+ if (!isUnknownRecord(background)) return input;
617
+ 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;
618
+ const { textColorToken, ...withoutLegacyText } = input;
619
+ const normalizedBorder = isUnknownRecord(input.border) && typeof input.border.widthClass === "string" ? { widthClass: input.border.widthClass } : input.border;
620
+ const normalizedAffordance = isUnknownRecord(input.affordance) && typeof input.affordance.iconId === "string" ? { iconId: input.affordance.iconId } : input.affordance;
621
+ const normalizedEffects = normalizeLegacyButtonEffects(input.effects, background.type);
622
+ const hoverBackgroundToken = stripLegacyTokenAlpha(input.hoverBackgroundToken);
623
+ if (background.type === "transparent") return {
624
+ ...withoutLegacyText,
625
+ background: {
626
+ type: "surface",
627
+ role: "link"
628
+ },
629
+ border: normalizedBorder,
630
+ affordance: normalizedAffordance,
631
+ effects: normalizedEffects,
632
+ hoverBackgroundToken
633
+ };
634
+ if (background.type === "gradient") {
635
+ const stops = Array.isArray(background.stops) ? background.stops.map(stripLegacyTokenAlpha) : background.stops;
636
+ return {
637
+ ...withoutLegacyText,
638
+ background: {
639
+ ...background,
640
+ stops,
641
+ foregroundToken: stripLegacyTokenAlpha(background.foregroundToken ?? textColorToken)
642
+ },
643
+ border: normalizedBorder,
644
+ affordance: normalizedAffordance,
645
+ effects: normalizedEffects,
646
+ hoverBackgroundToken
647
+ };
648
+ }
649
+ return {
650
+ ...withoutLegacyText,
651
+ background: background.type === "solid" ? {
652
+ ...background,
653
+ colorToken: stripLegacyTokenAlpha(background.colorToken)
654
+ } : background,
655
+ border: normalizedBorder,
656
+ affordance: normalizedAffordance,
657
+ effects: normalizedEffects,
658
+ hoverBackgroundToken
659
+ };
660
+ }
661
+ function normalizeLegacyButtonGlobalInput(input) {
662
+ if (!isUnknownRecord(input)) return input;
663
+ const hoverColorToken = stripLegacyTokenAlpha(input.hoverColorToken);
664
+ return hoverColorToken === input.hoverColorToken ? input : {
665
+ ...input,
666
+ hoverColorToken
667
+ };
668
+ }
669
+ function hasLegacyAlphaToken(input, background) {
670
+ const stops = isUnknownArray(background.stops) ? background.stops : [];
671
+ return [
672
+ input.hoverBackgroundToken,
673
+ background.colorToken,
674
+ background.foregroundToken,
675
+ ...stops
676
+ ].some((token) => stripLegacyTokenAlpha(token) !== token);
677
+ }
678
+ function stripLegacyTokenAlpha(value) {
679
+ if (typeof value !== "string") return value;
680
+ const slashIndex = value.indexOf("/");
681
+ return slashIndex < 0 ? value : value.slice(0, slashIndex);
682
+ }
683
+ function hasLegacyButtonEffects(input) {
684
+ if (!isUnknownRecord(input)) return false;
685
+ return [
686
+ "base",
687
+ "hover",
688
+ "active",
689
+ "focus"
690
+ ].some((state) => {
691
+ const effects = input[state];
692
+ return Array.isArray(effects) && effects.some((effect) => {
693
+ if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return true;
694
+ const classification = classifyButtonEffectId(effect.effectId);
695
+ if (classification !== "colour-transition" && classification !== "non-colour") return true;
696
+ return effect.effectId === "background-on-hover" && isUnknownRecord(effect.options) && stripLegacyTokenAlpha(effect.options.colorToken) !== effect.options.colorToken;
697
+ });
698
+ });
699
+ }
700
+ function normalizeLegacyButtonEffects(input, backgroundType) {
701
+ if (!isUnknownRecord(input)) return input;
702
+ const normalized = {};
703
+ for (const state of [
704
+ "base",
705
+ "hover",
706
+ "active",
707
+ "focus"
708
+ ]) {
709
+ const effects = input[state];
710
+ if (!Array.isArray(effects)) continue;
711
+ const safeEffects = effects.flatMap((effect) => {
712
+ if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return [];
713
+ const classification = classifyButtonEffectId(effect.effectId);
714
+ if (classification === "non-colour") return [effect];
715
+ if (classification !== "colour-transition") return [];
716
+ if (effect.effectId === "background-on-hover") {
717
+ const options = isUnknownRecord(effect.options) ? effect.options : null;
718
+ const colorToken = options === null ? null : parseOpaqueButtonColourToken(stripLegacyTokenAlpha(options.colorToken));
719
+ return colorToken === null ? [] : [{
720
+ ...effect,
721
+ options: {
722
+ ...options,
723
+ colorToken
724
+ }
725
+ }];
726
+ }
727
+ if (backgroundType !== "solid") return [];
728
+ const rawAmount = isUnknownRecord(effect.options) ? effect.options.amount : void 0;
729
+ const amount = typeof rawAmount === "number" && rawAmount > 0 ? Math.max(100, Math.round(rawAmount / 100) * 100) : 100;
730
+ return [{
731
+ ...effect,
732
+ options: {
733
+ ...isUnknownRecord(effect.options) ? effect.options : {},
734
+ amount
735
+ }
736
+ }];
737
+ });
738
+ if (safeEffects.length > 0) normalized[state] = safeEffects;
739
+ }
740
+ return Object.keys(normalized).length === 0 ? void 0 : normalized;
741
+ }
742
+ function isUnknownRecord(value) {
743
+ return typeof value === "object" && value !== null && !Array.isArray(value);
744
+ }
745
+ function isUnknownArray(value) {
746
+ return Array.isArray(value);
747
+ }
475
748
  buttonSizeNameSchema.options;
476
749
  //#endregion
477
750
  //#region ../theme-core/src/buttons/personalities/types.ts
@@ -498,7 +771,7 @@ function defineButtonPersonality(input) {
498
771
  name: input.name,
499
772
  description: input.description,
500
773
  tags: input.tags,
501
- buttonSystem: input.buttonSystem
774
+ buttonSystem: buttonSystemSchema.parse(input.buttonSystem)
502
775
  };
503
776
  }
504
777
  //#endregion
@@ -551,19 +824,15 @@ const brushedWash = defineButtonPersonality({
551
824
  background: {
552
825
  type: "gradient",
553
826
  stops: ["primary", "accent"],
554
- direction: "to-r"
827
+ direction: "to-r",
828
+ foregroundToken: "primaryForeground"
555
829
  },
556
- textColorToken: "primaryForeground",
557
830
  borderRadius: "rounded-lg",
558
831
  shadow: {
559
832
  elevation: "low",
560
833
  softness: "soft",
561
834
  position: "bottom"
562
- },
563
- effects: { hover: [{
564
- effectId: "opacity-reduce",
565
- options: { reduction: -15 }
566
- }] }
835
+ }
567
836
  },
568
837
  {
569
838
  id: "secondary",
@@ -573,32 +842,27 @@ const brushedWash = defineButtonPersonality({
573
842
  background: {
574
843
  type: "gradient",
575
844
  stops: ["secondary", "accent"],
576
- direction: "to-br"
845
+ direction: "to-br",
846
+ foregroundToken: "primaryForeground"
577
847
  },
578
- textColorToken: "primaryForeground",
579
848
  borderRadius: "rounded-lg",
580
849
  shadow: {
581
850
  elevation: "low",
582
851
  softness: "soft",
583
852
  position: "bottom"
584
- },
585
- effects: { hover: [{
586
- effectId: "opacity-reduce",
587
- options: { reduction: -15 }
588
- }] }
853
+ }
589
854
  },
590
855
  {
591
856
  id: "outline",
592
857
  name: "Outline",
593
858
  enabled: true,
594
859
  priority: 3,
595
- background: { type: "transparent" },
596
- textColorToken: "primary",
597
- borderRadius: "rounded-lg",
598
- border: {
599
- widthClass: "border",
600
- colorToken: "primary"
860
+ background: {
861
+ type: "surface",
862
+ role: "link"
601
863
  },
864
+ borderRadius: "rounded-lg",
865
+ border: { widthClass: "border" },
602
866
  effects: { hover: [{
603
867
  effectId: "background-on-hover",
604
868
  options: { colorToken: "surface" }
@@ -609,8 +873,10 @@ const brushedWash = defineButtonPersonality({
609
873
  name: "Ghost",
610
874
  enabled: true,
611
875
  priority: 3,
612
- background: { type: "transparent" },
613
- textColorToken: "text",
876
+ background: {
877
+ type: "surface",
878
+ role: "link"
879
+ },
614
880
  borderRadius: "rounded-lg",
615
881
  effects: { hover: [{
616
882
  effectId: "background-on-hover",
@@ -656,7 +922,6 @@ const confidentChip = defineButtonPersonality({
656
922
  type: "solid",
657
923
  colorToken: "primary"
658
924
  },
659
- textColorToken: "primaryForeground",
660
925
  borderRadius: "rounded-md",
661
926
  shadow: {
662
927
  elevation: "medium",
@@ -666,7 +931,7 @@ const confidentChip = defineButtonPersonality({
666
931
  effects: {
667
932
  hover: [{
668
933
  effectId: "darken-background",
669
- options: { amount: 60 }
934
+ options: { amount: 100 }
670
935
  }],
671
936
  active: [{
672
937
  effectId: "scale-down",
@@ -683,12 +948,8 @@ const confidentChip = defineButtonPersonality({
683
948
  type: "solid",
684
949
  colorToken: "surface"
685
950
  },
686
- textColorToken: "text",
687
951
  borderRadius: "rounded-md",
688
- border: {
689
- widthClass: "border",
690
- colorToken: "border"
691
- },
952
+ border: { widthClass: "border" },
692
953
  effects: { hover: [{
693
954
  effectId: "background-on-hover",
694
955
  options: { colorToken: "background" }
@@ -699,13 +960,12 @@ const confidentChip = defineButtonPersonality({
699
960
  name: "Outline",
700
961
  enabled: true,
701
962
  priority: 3,
702
- background: { type: "transparent" },
703
- textColorToken: "primary",
704
- borderRadius: "rounded-md",
705
- border: {
706
- widthClass: "border",
707
- colorToken: "primary"
963
+ background: {
964
+ type: "surface",
965
+ role: "link"
708
966
  },
967
+ borderRadius: "rounded-md",
968
+ border: { widthClass: "border" },
709
969
  effects: { hover: [{
710
970
  effectId: "background-on-hover",
711
971
  options: { colorToken: "surface" }
@@ -716,8 +976,10 @@ const confidentChip = defineButtonPersonality({
716
976
  name: "Ghost",
717
977
  enabled: true,
718
978
  priority: 3,
719
- background: { type: "transparent" },
720
- textColorToken: "primary",
979
+ background: {
980
+ type: "surface",
981
+ role: "link"
982
+ },
721
983
  borderRadius: "rounded-md",
722
984
  effects: { hover: [{
723
985
  effectId: "background-on-hover",
@@ -780,7 +1042,6 @@ const earthPill = defineButtonPersonality({
780
1042
  type: "solid",
781
1043
  colorToken: "primary"
782
1044
  },
783
- textColorToken: "primaryForeground",
784
1045
  borderRadius: "rounded-full",
785
1046
  shadow: {
786
1047
  elevation: "low",
@@ -806,13 +1067,12 @@ const earthPill = defineButtonPersonality({
806
1067
  name: "Secondary",
807
1068
  enabled: true,
808
1069
  priority: 2,
809
- background: { type: "transparent" },
810
- textColorToken: "primary",
811
- borderRadius: "rounded-full",
812
- border: {
813
- widthClass: "border",
814
- colorToken: "primary"
1070
+ background: {
1071
+ type: "surface",
1072
+ role: "link"
815
1073
  },
1074
+ borderRadius: "rounded-full",
1075
+ border: { widthClass: "border" },
816
1076
  effects: { hover: [{
817
1077
  effectId: "background-on-hover",
818
1078
  options: { colorToken: "muted" }
@@ -823,13 +1083,12 @@ const earthPill = defineButtonPersonality({
823
1083
  name: "Outline",
824
1084
  enabled: true,
825
1085
  priority: 3,
826
- background: { type: "transparent" },
827
- textColorToken: "text",
828
- borderRadius: "rounded-full",
829
- border: {
830
- widthClass: "border",
831
- colorToken: "border"
1086
+ background: {
1087
+ type: "surface",
1088
+ role: "link"
832
1089
  },
1090
+ borderRadius: "rounded-full",
1091
+ border: { widthClass: "border" },
833
1092
  effects: { hover: [{
834
1093
  effectId: "background-on-hover",
835
1094
  options: { colorToken: "surfaceAlt" }
@@ -840,8 +1099,10 @@ const earthPill = defineButtonPersonality({
840
1099
  name: "Ghost",
841
1100
  enabled: true,
842
1101
  priority: 3,
843
- background: { type: "transparent" },
844
- textColorToken: "primary",
1102
+ background: {
1103
+ type: "surface",
1104
+ role: "link"
1105
+ },
845
1106
  borderRadius: "rounded-full",
846
1107
  shadow: {
847
1108
  elevation: "none",
@@ -862,11 +1123,7 @@ const earthPill = defineButtonPersonality({
862
1123
  padding: "0.625rem 0",
863
1124
  fontSize: "text-xl"
864
1125
  }
865
- },
866
- effects: { hover: [{
867
- effectId: "opacity-reduce",
868
- options: { reduction: 25 }
869
- }] }
1126
+ }
870
1127
  }
871
1128
  ]
872
1129
  }
@@ -902,8 +1159,10 @@ const editorialLink = defineButtonPersonality({
902
1159
  name: "Primary",
903
1160
  enabled: true,
904
1161
  priority: 1,
905
- background: { type: "transparent" },
906
- textColorToken: "text",
1162
+ background: {
1163
+ type: "surface",
1164
+ role: "link"
1165
+ },
907
1166
  borderRadius: "rounded-none",
908
1167
  sizes: {
909
1168
  sm: { padding: "0.25rem 0" },
@@ -925,8 +1184,10 @@ const editorialLink = defineButtonPersonality({
925
1184
  name: "Secondary",
926
1185
  enabled: true,
927
1186
  priority: 2,
928
- background: { type: "transparent" },
929
- textColorToken: "mutedText",
1187
+ background: {
1188
+ type: "surface",
1189
+ role: "link"
1190
+ },
930
1191
  borderRadius: "rounded-none",
931
1192
  sizes: {
932
1193
  sm: { padding: "0.25rem 0" },
@@ -948,8 +1209,10 @@ const editorialLink = defineButtonPersonality({
948
1209
  name: "Outline",
949
1210
  enabled: true,
950
1211
  priority: 3,
951
- background: { type: "transparent" },
952
- textColorToken: "accent",
1212
+ background: {
1213
+ type: "surface",
1214
+ role: "link"
1215
+ },
953
1216
  borderRadius: "rounded-none",
954
1217
  sizes: {
955
1218
  sm: { padding: "0.25rem 0" },
@@ -971,19 +1234,17 @@ const editorialLink = defineButtonPersonality({
971
1234
  name: "Ghost",
972
1235
  enabled: true,
973
1236
  priority: 3,
974
- background: { type: "transparent" },
975
- textColorToken: "mutedText",
1237
+ background: {
1238
+ type: "surface",
1239
+ role: "link"
1240
+ },
976
1241
  borderRadius: "rounded-none",
977
1242
  sizes: {
978
1243
  sm: { padding: "0.25rem 0" },
979
1244
  md: { padding: "0.5rem 0" },
980
1245
  lg: { padding: "0.625rem 0" },
981
1246
  xl: { padding: "0.75rem 0" }
982
- },
983
- effects: { hover: [{
984
- effectId: "opacity-reduce",
985
- options: { reduction: -20 }
986
- }] }
1247
+ }
987
1248
  }
988
1249
  ]
989
1250
  }
@@ -1045,12 +1306,8 @@ const flatInk = defineButtonPersonality({
1045
1306
  type: "solid",
1046
1307
  colorToken: "primary"
1047
1308
  },
1048
- textColorToken: "primaryForeground",
1049
1309
  borderRadius: "rounded-lg",
1050
- affordance: {
1051
- iconId: "ArrowRight",
1052
- colorToken: "accent"
1053
- },
1310
+ affordance: { iconId: "ArrowRight" },
1054
1311
  effects: { hover: [{
1055
1312
  effectId: "lift",
1056
1313
  options: { translateY: "-2px" }
@@ -1064,13 +1321,12 @@ const flatInk = defineButtonPersonality({
1064
1321
  name: "Secondary",
1065
1322
  enabled: true,
1066
1323
  priority: 2,
1067
- background: { type: "transparent" },
1068
- textColorToken: "primary",
1069
- borderRadius: "rounded-lg",
1070
- border: {
1071
- widthClass: "border",
1072
- colorToken: "border"
1324
+ background: {
1325
+ type: "surface",
1326
+ role: "link"
1073
1327
  },
1328
+ borderRadius: "rounded-lg",
1329
+ border: { widthClass: "border" },
1074
1330
  effects: { hover: [{
1075
1331
  effectId: "lift",
1076
1332
  options: { translateY: "-2px" }
@@ -1088,12 +1344,8 @@ const flatInk = defineButtonPersonality({
1088
1344
  type: "solid",
1089
1345
  colorToken: "accent"
1090
1346
  },
1091
- textColorToken: "accentForeground",
1092
1347
  borderRadius: "rounded-lg",
1093
- affordance: {
1094
- iconId: "ArrowRight",
1095
- colorToken: "accentForeground"
1096
- },
1348
+ affordance: { iconId: "ArrowRight" },
1097
1349
  effects: { hover: [{
1098
1350
  effectId: "lift",
1099
1351
  options: { translateY: "-2px" }
@@ -1156,7 +1408,6 @@ const inkStamp = defineButtonPersonality({
1156
1408
  type: "solid",
1157
1409
  colorToken: "primary"
1158
1410
  },
1159
- textColorToken: "primaryForeground",
1160
1411
  borderRadius: "rounded-md",
1161
1412
  effects: {
1162
1413
  hover: [{
@@ -1177,13 +1428,12 @@ const inkStamp = defineButtonPersonality({
1177
1428
  name: "Secondary",
1178
1429
  enabled: true,
1179
1430
  priority: 2,
1180
- background: { type: "transparent" },
1181
- textColorToken: "primary",
1182
- borderRadius: "rounded-md",
1183
- border: {
1184
- widthClass: "border-2",
1185
- colorToken: "primary"
1431
+ background: {
1432
+ type: "surface",
1433
+ role: "link"
1186
1434
  },
1435
+ borderRadius: "rounded-md",
1436
+ border: { widthClass: "border-2" },
1187
1437
  effects: { hover: [{
1188
1438
  effectId: "background-on-hover",
1189
1439
  options: { colorToken: "surface" }
@@ -1194,13 +1444,12 @@ const inkStamp = defineButtonPersonality({
1194
1444
  name: "Outline",
1195
1445
  enabled: true,
1196
1446
  priority: 3,
1197
- background: { type: "transparent" },
1198
- textColorToken: "text",
1199
- borderRadius: "rounded-md",
1200
- border: {
1201
- widthClass: "border-2",
1202
- colorToken: "border"
1447
+ background: {
1448
+ type: "surface",
1449
+ role: "link"
1203
1450
  },
1451
+ borderRadius: "rounded-md",
1452
+ border: { widthClass: "border-2" },
1204
1453
  effects: { hover: [{
1205
1454
  effectId: "background-on-hover",
1206
1455
  options: { colorToken: "surface" }
@@ -1211,8 +1460,10 @@ const inkStamp = defineButtonPersonality({
1211
1460
  name: "Ghost",
1212
1461
  enabled: true,
1213
1462
  priority: 3,
1214
- background: { type: "transparent" },
1215
- textColorToken: "accent",
1463
+ background: {
1464
+ type: "surface",
1465
+ role: "link"
1466
+ },
1216
1467
  borderRadius: "rounded-none",
1217
1468
  sizes: {
1218
1469
  sm: {
@@ -1305,7 +1556,6 @@ const joyStamp = defineButtonPersonality({
1305
1556
  type: "solid",
1306
1557
  colorToken: "primary"
1307
1558
  },
1308
- textColorToken: "primaryForeground",
1309
1559
  borderRadius: "rounded-full",
1310
1560
  shadow: {
1311
1561
  elevation: "high",
@@ -1319,13 +1569,12 @@ const joyStamp = defineButtonPersonality({
1319
1569
  name: "Secondary",
1320
1570
  enabled: true,
1321
1571
  priority: 2,
1322
- background: { type: "transparent" },
1323
- textColorToken: "text",
1324
- borderRadius: "rounded-full",
1325
- border: {
1326
- widthClass: "border-2",
1327
- colorToken: "text"
1572
+ background: {
1573
+ type: "surface",
1574
+ role: "link"
1328
1575
  },
1576
+ borderRadius: "rounded-full",
1577
+ border: { widthClass: "border-2" },
1329
1578
  shadow: {
1330
1579
  elevation: "high",
1331
1580
  softness: "hard",
@@ -1390,12 +1639,8 @@ const ornateRitual = defineButtonPersonality({
1390
1639
  type: "solid",
1391
1640
  colorToken: "primary"
1392
1641
  },
1393
- textColorToken: "primaryForeground",
1394
1642
  borderRadius: "rounded-md",
1395
- border: {
1396
- widthClass: "border",
1397
- colorToken: "primary"
1398
- },
1643
+ border: { widthClass: "border" },
1399
1644
  effects: {
1400
1645
  hover: [{
1401
1646
  effectId: "background-on-hover",
@@ -1416,12 +1661,8 @@ const ornateRitual = defineButtonPersonality({
1416
1661
  type: "solid",
1417
1662
  colorToken: "secondary"
1418
1663
  },
1419
- textColorToken: "primaryForeground",
1420
1664
  borderRadius: "rounded-md",
1421
- border: {
1422
- widthClass: "border",
1423
- colorToken: "primary"
1424
- },
1665
+ border: { widthClass: "border" },
1425
1666
  effects: { hover: [{
1426
1667
  effectId: "background-on-hover",
1427
1668
  options: { colorToken: "surface" }
@@ -1432,13 +1673,12 @@ const ornateRitual = defineButtonPersonality({
1432
1673
  name: "Outline",
1433
1674
  enabled: true,
1434
1675
  priority: 3,
1435
- background: { type: "transparent" },
1436
- textColorToken: "primary",
1437
- borderRadius: "rounded-md",
1438
- border: {
1439
- widthClass: "border",
1440
- colorToken: "primary"
1676
+ background: {
1677
+ type: "surface",
1678
+ role: "link"
1441
1679
  },
1680
+ borderRadius: "rounded-md",
1681
+ border: { widthClass: "border" },
1442
1682
  effects: { hover: [{
1443
1683
  effectId: "background-on-hover",
1444
1684
  options: { colorToken: "muted" }
@@ -1449,8 +1689,10 @@ const ornateRitual = defineButtonPersonality({
1449
1689
  name: "Ghost",
1450
1690
  enabled: true,
1451
1691
  priority: 3,
1452
- background: { type: "transparent" },
1453
- textColorToken: "accent",
1692
+ background: {
1693
+ type: "surface",
1694
+ role: "link"
1695
+ },
1454
1696
  borderRadius: "rounded-none",
1455
1697
  sizes: {
1456
1698
  sm: {
@@ -1532,14 +1774,10 @@ const pebble = defineButtonPersonality({
1532
1774
  type: "solid",
1533
1775
  colorToken: "primary"
1534
1776
  },
1535
- textColorToken: "primaryForeground",
1536
1777
  borderRadius: "rounded-full",
1537
1778
  effects: { hover: [{
1538
- effectId: "background-on-hover-alpha",
1539
- options: {
1540
- colorToken: "primary",
1541
- opacity: 88
1542
- }
1779
+ effectId: "darken-background",
1780
+ options: { amount: 100 }
1543
1781
  }] }
1544
1782
  },
1545
1783
  {
@@ -1547,13 +1785,12 @@ const pebble = defineButtonPersonality({
1547
1785
  name: "Secondary",
1548
1786
  enabled: true,
1549
1787
  priority: 2,
1550
- background: { type: "transparent" },
1551
- textColorToken: "primary",
1552
- borderRadius: "rounded-full",
1553
- border: {
1554
- widthClass: "border-2",
1555
- colorToken: "accent"
1788
+ background: {
1789
+ type: "surface",
1790
+ role: "link"
1556
1791
  },
1792
+ borderRadius: "rounded-full",
1793
+ border: { widthClass: "border-2" },
1557
1794
  effects: { hover: [{
1558
1795
  effectId: "background-on-hover",
1559
1796
  options: { colorToken: "accent" }
@@ -1564,13 +1801,12 @@ const pebble = defineButtonPersonality({
1564
1801
  name: "Outline",
1565
1802
  enabled: true,
1566
1803
  priority: 3,
1567
- background: { type: "transparent" },
1568
- textColorToken: "text",
1569
- borderRadius: "rounded-full",
1570
- border: {
1571
- widthClass: "border",
1572
- colorToken: "border"
1804
+ background: {
1805
+ type: "surface",
1806
+ role: "link"
1573
1807
  },
1808
+ borderRadius: "rounded-full",
1809
+ border: { widthClass: "border" },
1574
1810
  effects: { hover: [{
1575
1811
  effectId: "background-on-hover",
1576
1812
  options: { colorToken: "surface" }
@@ -1581,8 +1817,10 @@ const pebble = defineButtonPersonality({
1581
1817
  name: "Ghost",
1582
1818
  enabled: true,
1583
1819
  priority: 3,
1584
- background: { type: "transparent" },
1585
- textColorToken: "primary",
1820
+ background: {
1821
+ type: "surface",
1822
+ role: "link"
1823
+ },
1586
1824
  borderRadius: "rounded-full",
1587
1825
  sizes: {
1588
1826
  sm: {
@@ -1598,11 +1836,7 @@ const pebble = defineButtonPersonality({
1598
1836
  padding: "0.75rem 1.5rem",
1599
1837
  fontSize: "text-xl"
1600
1838
  }
1601
- },
1602
- effects: { hover: [{
1603
- effectId: "opacity-reduce",
1604
- options: { reduction: 30 }
1605
- }] }
1839
+ }
1606
1840
  }
1607
1841
  ]
1608
1842
  }
@@ -1664,15 +1898,11 @@ const quietArrow = defineButtonPersonality({
1664
1898
  type: "solid",
1665
1899
  colorToken: "primary"
1666
1900
  },
1667
- textColorToken: "primaryForeground",
1668
1901
  borderRadius: "rounded-xl",
1669
1902
  affordance: { iconId: "ArrowRight" },
1670
1903
  effects: { hover: [{
1671
- effectId: "background-on-hover-alpha",
1672
- options: {
1673
- colorToken: "primary",
1674
- opacity: 90
1675
- }
1904
+ effectId: "darken-background",
1905
+ options: { amount: 100 }
1676
1906
  }] }
1677
1907
  },
1678
1908
  {
@@ -1680,13 +1910,12 @@ const quietArrow = defineButtonPersonality({
1680
1910
  name: "Secondary",
1681
1911
  enabled: true,
1682
1912
  priority: 2,
1683
- background: { type: "transparent" },
1684
- textColorToken: "primary",
1685
- borderRadius: "rounded-xl",
1686
- border: {
1687
- widthClass: "border",
1688
- colorToken: "primary"
1913
+ background: {
1914
+ type: "surface",
1915
+ role: "link"
1689
1916
  },
1917
+ borderRadius: "rounded-xl",
1918
+ border: { widthClass: "border" },
1690
1919
  affordance: { iconId: "ArrowRight" },
1691
1920
  effects: { hover: [{
1692
1921
  effectId: "background-on-hover",
@@ -1698,21 +1927,22 @@ const quietArrow = defineButtonPersonality({
1698
1927
  name: "Outline",
1699
1928
  enabled: true,
1700
1929
  priority: 3,
1701
- background: { type: "transparent" },
1702
- textColorToken: "primary",
1930
+ background: {
1931
+ type: "surface",
1932
+ role: "link"
1933
+ },
1703
1934
  borderRadius: "rounded-xl",
1704
- border: {
1705
- widthClass: "border",
1706
- colorToken: "primary"
1707
- }
1935
+ border: { widthClass: "border" }
1708
1936
  },
1709
1937
  {
1710
1938
  id: "ghost",
1711
1939
  name: "Ghost",
1712
1940
  enabled: true,
1713
1941
  priority: 3,
1714
- background: { type: "transparent" },
1715
- textColorToken: "primary",
1942
+ background: {
1943
+ type: "surface",
1944
+ role: "link"
1945
+ },
1716
1946
  borderRadius: "rounded-xl"
1717
1947
  }
1718
1948
  ]
@@ -1776,7 +2006,6 @@ const showtimePill = defineButtonPersonality({
1776
2006
  type: "solid",
1777
2007
  colorToken: "primary"
1778
2008
  },
1779
- textColorToken: "background",
1780
2009
  borderRadius: "rounded-full",
1781
2010
  effects: { hover: [{ effectId: "pop" }] }
1782
2011
  },
@@ -1785,13 +2014,12 @@ const showtimePill = defineButtonPersonality({
1785
2014
  name: "Secondary",
1786
2015
  enabled: true,
1787
2016
  priority: 2,
1788
- background: { type: "transparent" },
1789
- textColorToken: "primary",
1790
- borderRadius: "rounded-full",
1791
- border: {
1792
- widthClass: "border-2",
1793
- colorToken: "primary"
2017
+ background: {
2018
+ type: "surface",
2019
+ role: "link"
1794
2020
  },
2021
+ borderRadius: "rounded-full",
2022
+ border: { widthClass: "border-2" },
1795
2023
  effects: { hover: [{ effectId: "pop" }] }
1796
2024
  },
1797
2025
  {
@@ -1803,7 +2031,6 @@ const showtimePill = defineButtonPersonality({
1803
2031
  type: "solid",
1804
2032
  colorToken: "secondary"
1805
2033
  },
1806
- textColorToken: "primary",
1807
2034
  borderRadius: "rounded-full",
1808
2035
  effects: { hover: [{ effectId: "pop" }] }
1809
2036
  },
@@ -1816,12 +2043,8 @@ const showtimePill = defineButtonPersonality({
1816
2043
  type: "solid",
1817
2044
  colorToken: "background"
1818
2045
  },
1819
- textColorToken: "primary",
1820
2046
  borderRadius: "rounded-full",
1821
- border: {
1822
- widthClass: "border-2",
1823
- colorToken: "primary"
1824
- },
2047
+ border: { widthClass: "border-2" },
1825
2048
  effects: { hover: [{
1826
2049
  effectId: "background-on-hover",
1827
2050
  options: { colorToken: "surface" }
@@ -1832,13 +2055,12 @@ const showtimePill = defineButtonPersonality({
1832
2055
  name: "Outline",
1833
2056
  enabled: true,
1834
2057
  priority: 3,
1835
- background: { type: "transparent" },
1836
- textColorToken: "primary",
1837
- borderRadius: "rounded-full",
1838
- border: {
1839
- widthClass: "border-2",
1840
- colorToken: "primary"
2058
+ background: {
2059
+ type: "surface",
2060
+ role: "link"
1841
2061
  },
2062
+ borderRadius: "rounded-full",
2063
+ border: { widthClass: "border-2" },
1842
2064
  effects: { hover: [{
1843
2065
  effectId: "background-on-hover",
1844
2066
  options: { colorToken: "background" }
@@ -1849,8 +2071,10 @@ const showtimePill = defineButtonPersonality({
1849
2071
  name: "Ghost",
1850
2072
  enabled: true,
1851
2073
  priority: 3,
1852
- background: { type: "transparent" },
1853
- textColorToken: "primary",
2074
+ background: {
2075
+ type: "surface",
2076
+ role: "link"
2077
+ },
1854
2078
  borderRadius: "rounded-full",
1855
2079
  effects: { hover: [{
1856
2080
  effectId: "background-on-hover",
@@ -1896,7 +2120,6 @@ const softPill = defineButtonPersonality({
1896
2120
  type: "solid",
1897
2121
  colorToken: "primary"
1898
2122
  },
1899
- textColorToken: "primaryForeground",
1900
2123
  borderRadius: "rounded-full",
1901
2124
  shadow: {
1902
2125
  elevation: "low",
@@ -1919,13 +2142,12 @@ const softPill = defineButtonPersonality({
1919
2142
  name: "Secondary",
1920
2143
  enabled: true,
1921
2144
  priority: 2,
1922
- background: { type: "transparent" },
1923
- textColorToken: "primary",
1924
- borderRadius: "rounded-full",
1925
- border: {
1926
- widthClass: "border-2",
1927
- colorToken: "primary"
2145
+ background: {
2146
+ type: "surface",
2147
+ role: "link"
1928
2148
  },
2149
+ borderRadius: "rounded-full",
2150
+ border: { widthClass: "border-2" },
1929
2151
  effects: { hover: [{
1930
2152
  effectId: "background-on-hover",
1931
2153
  options: { colorToken: "surface" }
@@ -1936,13 +2158,12 @@ const softPill = defineButtonPersonality({
1936
2158
  name: "Outline",
1937
2159
  enabled: true,
1938
2160
  priority: 3,
1939
- background: { type: "transparent" },
1940
- textColorToken: "text",
1941
- borderRadius: "rounded-full",
1942
- border: {
1943
- widthClass: "border",
1944
- colorToken: "border"
2161
+ background: {
2162
+ type: "surface",
2163
+ role: "link"
1945
2164
  },
2165
+ borderRadius: "rounded-full",
2166
+ border: { widthClass: "border" },
1946
2167
  effects: { hover: [{
1947
2168
  effectId: "background-on-hover",
1948
2169
  options: { colorToken: "surface" }
@@ -1953,8 +2174,10 @@ const softPill = defineButtonPersonality({
1953
2174
  name: "Ghost",
1954
2175
  enabled: true,
1955
2176
  priority: 3,
1956
- background: { type: "transparent" },
1957
- textColorToken: "text",
2177
+ background: {
2178
+ type: "surface",
2179
+ role: "link"
2180
+ },
1958
2181
  borderRadius: "rounded-full",
1959
2182
  effects: { hover: [{
1960
2183
  effectId: "background-on-hover",
@@ -1973,9 +2196,8 @@ const solidSecondary = {
1973
2196
  priority: 2,
1974
2197
  background: {
1975
2198
  type: "solid",
1976
- colorToken: "secondary"
2199
+ colorToken: unsafeAsOpaqueButtonColourToken("secondary")
1977
2200
  },
1978
- textColorToken: "onSecondary",
1979
2201
  borderRadius: "rounded-full",
1980
2202
  shadow: {
1981
2203
  elevation: "none",
@@ -2023,6 +2245,27 @@ const buttonPersonalities = [
2023
2245
  quietArrow
2024
2246
  ];
2025
2247
  new Map(buttonPersonalities.map((p) => [p.id, p]));
2248
+ buttonPersonalities.map((personality) => ({
2249
+ id: personality.id,
2250
+ name: personality.name,
2251
+ description: personality.description,
2252
+ category: presetCategory(personality),
2253
+ buttonSystem: personality.buttonSystem,
2254
+ compatibility: {
2255
+ ...personality.tags.tone ? { tones: [personality.tags.tone] } : {},
2256
+ ...personality.tags.energy ? { energies: [personality.tags.energy] } : {}
2257
+ }
2258
+ }));
2259
+ function presetCategory(personality) {
2260
+ switch (personality.tags.era) {
2261
+ case "retro": return "retro";
2262
+ case "editorial": return "minimal";
2263
+ case "organic": return "artistic";
2264
+ case "modern": return personality.tags.tone === "bold" ? "modern" : "technical";
2265
+ case "technical": return "technical";
2266
+ case void 0: return "modern";
2267
+ }
2268
+ }
2026
2269
  //#endregion
2027
2270
  //#region ../theme-core/src/cards/types.ts
2028
2271
  const cardVariantRoleValues = ["default", "alternative"];