@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
@@ -1,5 +1,111 @@
1
- import { $ as themeColorTokenSchema } from "./propsDecoder-BRWBiH7i.mjs";
1
+ import { t as parseColorTokenParts } from "./colorTokenParts-CMugwvX_.mjs";
2
+ import { $ as themeColorTokenSchema, Q as parseThemeColorToken } from "./propsDecoder-CkXxkdSR.mjs";
2
3
  import { z as z$1 } from "zod";
4
+ //#region ../theme-core/src/buttons/effectClassification.ts
5
+ /**
6
+ * Exhaustive live policy for every registered effect id.
7
+ *
8
+ * The resolver consumes the transition payload directly, so adding an effect
9
+ * cannot update classification without also defining its runtime behavior.
10
+ */
11
+ const BUTTON_EFFECT_POLICIES = {
12
+ "darken-background": {
13
+ classification: "colour-transition",
14
+ transition: {
15
+ kind: "adjust-shade",
16
+ direction: "darker"
17
+ }
18
+ },
19
+ "lighten-background": {
20
+ classification: "colour-transition",
21
+ transition: {
22
+ kind: "adjust-shade",
23
+ direction: "lighter"
24
+ }
25
+ },
26
+ "background-on-hover": {
27
+ classification: "colour-transition",
28
+ transition: { kind: "replace-background" }
29
+ },
30
+ "background-on-hover-alpha": {
31
+ classification: "unsupported-colour",
32
+ reason: "alpha_requires_surface"
33
+ },
34
+ "fade-background": {
35
+ classification: "unsupported-colour",
36
+ reason: "changes_element_opacity"
37
+ },
38
+ "opacity-reduce": {
39
+ classification: "unsupported-colour",
40
+ reason: "changes_element_opacity"
41
+ },
42
+ "gradient-text": {
43
+ classification: "unsupported-colour",
44
+ reason: "changes_foreground"
45
+ },
46
+ "text-color-change": {
47
+ classification: "unsupported-colour",
48
+ reason: "changes_foreground"
49
+ },
50
+ "border-color-change": {
51
+ classification: "unsupported-colour",
52
+ reason: "changes_border"
53
+ },
54
+ "aurora-glow": {
55
+ classification: "unsupported-background-overlay",
56
+ reason: "unresolved_background_overlay"
57
+ },
58
+ "cosmic-stardust": {
59
+ classification: "unsupported-background-overlay",
60
+ reason: "unresolved_background_overlay"
61
+ },
62
+ "gradient-border-fill": {
63
+ classification: "unsupported-background-overlay",
64
+ reason: "unresolved_background_overlay"
65
+ },
66
+ "animated-gradient-border-fill": {
67
+ classification: "unsupported-background-overlay",
68
+ reason: "unresolved_background_overlay"
69
+ },
70
+ "nav-underline": {
71
+ classification: "not-button",
72
+ reason: "not_button_effect"
73
+ },
74
+ "nav-frosted-base": {
75
+ classification: "not-button",
76
+ reason: "not_button_effect"
77
+ },
78
+ "nav-frosted-hover": {
79
+ classification: "not-button",
80
+ reason: "not_button_effect"
81
+ },
82
+ "nav-frosted-active": {
83
+ classification: "not-button",
84
+ reason: "not_button_effect"
85
+ },
86
+ "animated-gradient": { classification: "non-colour" },
87
+ "border-glow": { classification: "non-colour" },
88
+ "drop-shadow": { classification: "non-colour" },
89
+ "inner-shadow": { classification: "non-colour" },
90
+ "neumorphic-shadow": { classification: "non-colour" },
91
+ "outer-glow": { classification: "non-colour" },
92
+ "retro-3d-shadow": { classification: "non-colour" },
93
+ "scale-up": { classification: "non-colour" },
94
+ "scale-down": { classification: "non-colour" },
95
+ lift: { classification: "non-colour" },
96
+ "press-down": { classification: "non-colour" },
97
+ pop: { classification: "non-colour" },
98
+ "border-bottom-grow": { classification: "non-colour" },
99
+ "sketchy-border": { classification: "non-colour" },
100
+ "pulse-animation": { classification: "non-colour" }
101
+ };
102
+ function getButtonEffectPolicy(effectId) {
103
+ return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
104
+ }
105
+ function classifyButtonEffectId(effectId) {
106
+ return getButtonEffectPolicy(effectId)?.classification ?? "unknown";
107
+ }
108
+ //#endregion
3
109
  //#region ../theme-core/src/buttons/types.ts
4
110
  /**
5
111
  * Standard semantic variant roles a theme exposes.
@@ -16,6 +122,20 @@ const VARIANT_ROLES = [
16
122
  "tertiary",
17
123
  "accent"
18
124
  ];
125
+ function parseOpaqueButtonColourToken(value) {
126
+ const token = parseThemeColorToken(value);
127
+ if (token === null) return null;
128
+ const parts = parseColorTokenParts(token);
129
+ return parts.kind === "token" && parts.opacityPercent === null ? token : null;
130
+ }
131
+ function unsafeAsOpaqueButtonColourToken(value) {
132
+ return value;
133
+ }
134
+ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => parseOpaqueButtonColourToken(value) !== null, "Button colour tokens must be opaque").transform((value) => {
135
+ const token = parseOpaqueButtonColourToken(value);
136
+ if (token === null) throw new Error("Invariant: opaque button token passed its schema");
137
+ return token;
138
+ });
19
139
  const cornerStyleSchema = z$1.enum([
20
140
  "square",
21
141
  "rounded",
@@ -117,7 +237,7 @@ const buttonSizesSchema = z$1.object({
117
237
  lg,
118
238
  xl: xl ?? lg
119
239
  }));
120
- const buttonGlobalSettingsSchema = z$1.object({
240
+ const canonicalButtonGlobalSettingsSchema = z$1.object({
121
241
  cornerStyle: cornerStyleSchema,
122
242
  cornerRadius: z$1.number().min(0).max(24).optional(),
123
243
  /**
@@ -148,11 +268,12 @@ const buttonGlobalSettingsSchema = z$1.object({
148
268
  paddingPreset: buttonPaddingPresetSchema.optional(),
149
269
  hoverTransform: hoverTransformSchema,
150
270
  hoverColor: hoverColorSchema,
151
- hoverColorToken: themeColorTokenSchema.optional(),
271
+ hoverColorToken: opaqueButtonColourTokenSchema.optional(),
152
272
  gradientStyle: gradientStyleSchema.optional(),
153
273
  gradientAngle: z$1.number().min(0).max(360).optional(),
154
274
  gradientSharpness: gradientSharpnessSchema.optional()
155
275
  });
276
+ const buttonGlobalSettingsSchema = z$1.preprocess(normalizeLegacyButtonGlobalInput, canonicalButtonGlobalSettingsSchema);
156
277
  const gradientDirectionSchema = z$1.enum([
157
278
  "to-r",
158
279
  "to-l",
@@ -166,27 +287,33 @@ const gradientDirectionSchema = z$1.enum([
166
287
  const buttonBackgroundSchema = z$1.discriminatedUnion("type", [
167
288
  z$1.object({
168
289
  type: z$1.literal("solid"),
169
- colorToken: themeColorTokenSchema
290
+ colorToken: opaqueButtonColourTokenSchema
170
291
  }),
171
292
  z$1.object({
172
293
  type: z$1.literal("gradient"),
173
- stops: z$1.array(themeColorTokenSchema).min(2),
174
- direction: gradientDirectionSchema
294
+ stops: z$1.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
295
+ const [first, second, ...rest] = stops;
296
+ if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
297
+ return [
298
+ first,
299
+ second,
300
+ ...rest
301
+ ];
302
+ }),
303
+ direction: gradientDirectionSchema,
304
+ foregroundToken: opaqueButtonColourTokenSchema
175
305
  }),
176
- z$1.object({ type: z$1.literal("transparent") })
306
+ z$1.object({
307
+ type: z$1.literal("surface"),
308
+ role: z$1.literal("link")
309
+ })
177
310
  ]);
178
311
  const effectApplicationSchema = z$1.object({
179
312
  effectId: z$1.string(),
180
- options: z$1.record(z$1.string(), z$1.any()).optional()
181
- });
182
- const buttonBorderSchema = z$1.object({
183
- widthClass: z$1.string(),
184
- colorToken: themeColorTokenSchema
185
- });
186
- const buttonVariantAffordanceSchema = z$1.object({
187
- iconId: z$1.string().min(1),
188
- colorToken: themeColorTokenSchema.optional()
313
+ options: z$1.record(z$1.string(), z$1.json()).optional()
189
314
  });
315
+ const buttonBorderSchema = z$1.object({ widthClass: z$1.string() });
316
+ const buttonVariantAffordanceSchema = z$1.object({ iconId: z$1.string().min(1) });
190
317
  const variantShadowSchema = z$1.object({
191
318
  elevation: z$1.enum([
192
319
  "none",
@@ -227,27 +354,170 @@ const variantSizeOverridesSchema = z$1.object({
227
354
  * default (e.g. link-style variants declaring zero horizontal padding at
228
355
  * every size).
229
356
  */
230
- const buttonVariantSchema = z$1.object({
357
+ const canonicalButtonVariantSchema = z$1.object({
231
358
  id: z$1.string(),
232
359
  name: z$1.string().min(1).max(20),
233
360
  enabled: z$1.boolean(),
234
361
  priority: prioritySchema,
235
362
  background: buttonBackgroundSchema,
236
- textColorToken: themeColorTokenSchema,
237
363
  /** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
238
364
  borderRadius: z$1.string().optional(),
239
365
  shadow: variantShadowSchema.optional(),
240
366
  border: buttonBorderSchema.optional(),
241
- hoverBackgroundToken: z$1.string().optional(),
367
+ hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
242
368
  effects: variantEffectsSchema.optional(),
243
369
  sizes: variantSizeOverridesSchema.optional(),
244
370
  affordance: buttonVariantAffordanceSchema.optional()
245
371
  });
372
+ /**
373
+ * Temporary persisted-theme admission boundary for issue #1206.
374
+ *
375
+ * Production inventory on 2026-07-22 found 22 rows using the old independent
376
+ * `textColorToken`/border colour shape. New source and all downstream code use
377
+ * only the canonical relationship. Delete this preprocessor after the reviewed
378
+ * production rewrite reports zero legacy rows.
379
+ */
380
+ const buttonVariantSchema = z$1.preprocess(normalizeLegacyButtonVariantInput, canonicalButtonVariantSchema);
246
381
  const buttonSystemSchema = z$1.object({
247
382
  global: buttonGlobalSettingsSchema,
248
383
  variants: z$1.array(buttonVariantSchema).min(1).max(6),
249
384
  sizes: buttonSizesSchema.optional()
250
385
  });
386
+ function normalizeLegacyButtonVariantInput(input) {
387
+ if (!isUnknownRecord(input)) return input;
388
+ const background = input.background;
389
+ if (!isUnknownRecord(background)) return input;
390
+ 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;
391
+ const { textColorToken, ...withoutLegacyText } = input;
392
+ const normalizedBorder = isUnknownRecord(input.border) && typeof input.border.widthClass === "string" ? { widthClass: input.border.widthClass } : input.border;
393
+ const normalizedAffordance = isUnknownRecord(input.affordance) && typeof input.affordance.iconId === "string" ? { iconId: input.affordance.iconId } : input.affordance;
394
+ const normalizedEffects = normalizeLegacyButtonEffects(input.effects, background.type);
395
+ const hoverBackgroundToken = stripLegacyTokenAlpha(input.hoverBackgroundToken);
396
+ if (background.type === "transparent") return {
397
+ ...withoutLegacyText,
398
+ background: {
399
+ type: "surface",
400
+ role: "link"
401
+ },
402
+ border: normalizedBorder,
403
+ affordance: normalizedAffordance,
404
+ effects: normalizedEffects,
405
+ hoverBackgroundToken
406
+ };
407
+ if (background.type === "gradient") {
408
+ const stops = Array.isArray(background.stops) ? background.stops.map(stripLegacyTokenAlpha) : background.stops;
409
+ return {
410
+ ...withoutLegacyText,
411
+ background: {
412
+ ...background,
413
+ stops,
414
+ foregroundToken: stripLegacyTokenAlpha(background.foregroundToken ?? textColorToken)
415
+ },
416
+ border: normalizedBorder,
417
+ affordance: normalizedAffordance,
418
+ effects: normalizedEffects,
419
+ hoverBackgroundToken
420
+ };
421
+ }
422
+ return {
423
+ ...withoutLegacyText,
424
+ background: background.type === "solid" ? {
425
+ ...background,
426
+ colorToken: stripLegacyTokenAlpha(background.colorToken)
427
+ } : background,
428
+ border: normalizedBorder,
429
+ affordance: normalizedAffordance,
430
+ effects: normalizedEffects,
431
+ hoverBackgroundToken
432
+ };
433
+ }
434
+ function normalizeLegacyButtonGlobalInput(input) {
435
+ if (!isUnknownRecord(input)) return input;
436
+ const hoverColorToken = stripLegacyTokenAlpha(input.hoverColorToken);
437
+ return hoverColorToken === input.hoverColorToken ? input : {
438
+ ...input,
439
+ hoverColorToken
440
+ };
441
+ }
442
+ function hasLegacyAlphaToken(input, background) {
443
+ const stops = isUnknownArray(background.stops) ? background.stops : [];
444
+ return [
445
+ input.hoverBackgroundToken,
446
+ background.colorToken,
447
+ background.foregroundToken,
448
+ ...stops
449
+ ].some((token) => stripLegacyTokenAlpha(token) !== token);
450
+ }
451
+ function stripLegacyTokenAlpha(value) {
452
+ if (typeof value !== "string") return value;
453
+ const slashIndex = value.indexOf("/");
454
+ return slashIndex < 0 ? value : value.slice(0, slashIndex);
455
+ }
456
+ function hasLegacyButtonEffects(input) {
457
+ if (!isUnknownRecord(input)) return false;
458
+ return [
459
+ "base",
460
+ "hover",
461
+ "active",
462
+ "focus"
463
+ ].some((state) => {
464
+ const effects = input[state];
465
+ return Array.isArray(effects) && effects.some((effect) => {
466
+ if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return true;
467
+ const classification = classifyButtonEffectId(effect.effectId);
468
+ if (classification !== "colour-transition" && classification !== "non-colour") return true;
469
+ return effect.effectId === "background-on-hover" && isUnknownRecord(effect.options) && stripLegacyTokenAlpha(effect.options.colorToken) !== effect.options.colorToken;
470
+ });
471
+ });
472
+ }
473
+ function normalizeLegacyButtonEffects(input, backgroundType) {
474
+ if (!isUnknownRecord(input)) return input;
475
+ const normalized = {};
476
+ for (const state of [
477
+ "base",
478
+ "hover",
479
+ "active",
480
+ "focus"
481
+ ]) {
482
+ const effects = input[state];
483
+ if (!Array.isArray(effects)) continue;
484
+ const safeEffects = effects.flatMap((effect) => {
485
+ if (!isUnknownRecord(effect) || typeof effect.effectId !== "string") return [];
486
+ const classification = classifyButtonEffectId(effect.effectId);
487
+ if (classification === "non-colour") return [effect];
488
+ if (classification !== "colour-transition") return [];
489
+ if (effect.effectId === "background-on-hover") {
490
+ const options = isUnknownRecord(effect.options) ? effect.options : null;
491
+ const colorToken = options === null ? null : parseOpaqueButtonColourToken(stripLegacyTokenAlpha(options.colorToken));
492
+ return colorToken === null ? [] : [{
493
+ ...effect,
494
+ options: {
495
+ ...options,
496
+ colorToken
497
+ }
498
+ }];
499
+ }
500
+ if (backgroundType !== "solid") return [];
501
+ const rawAmount = isUnknownRecord(effect.options) ? effect.options.amount : void 0;
502
+ const amount = typeof rawAmount === "number" && rawAmount > 0 ? Math.max(100, Math.round(rawAmount / 100) * 100) : 100;
503
+ return [{
504
+ ...effect,
505
+ options: {
506
+ ...isUnknownRecord(effect.options) ? effect.options : {},
507
+ amount
508
+ }
509
+ }];
510
+ });
511
+ if (safeEffects.length > 0) normalized[state] = safeEffects;
512
+ }
513
+ return Object.keys(normalized).length === 0 ? void 0 : normalized;
514
+ }
515
+ function isUnknownRecord(value) {
516
+ return typeof value === "object" && value !== null && !Array.isArray(value);
517
+ }
518
+ function isUnknownArray(value) {
519
+ return Array.isArray(value);
520
+ }
251
521
  //#endregion
252
522
  //#region ../theme-core/src/buttons/classNames.ts
253
523
  function themeButtonVariantClassNames(variant) {
@@ -264,6 +534,29 @@ function themeButtonClassName(spec) {
264
534
  spec.extraClassName
265
535
  ].filter(Boolean).join(" ");
266
536
  }
537
+ //#endregion
538
+ //#region ../theme-core/src/palette/utils/colorConversion.ts
539
+ function hexToRgb(hex) {
540
+ const h = hex.replace(/^#/, "");
541
+ const m = h.length === 3 ? h.split("").map((c) => c + c).join("") : h;
542
+ if (m.length !== 6) throw new Error("Bad hex");
543
+ const int = parseInt(m, 16);
544
+ return {
545
+ r: int >> 16 & 255,
546
+ g: int >> 8 & 255,
547
+ b: int & 255
548
+ };
549
+ }
550
+ function srgbToLinear(u) {
551
+ const x = u / 255;
552
+ return x <= .04045 ? x / 12.92 : Math.pow((x + .055) / 1.055, 2.4);
553
+ }
554
+ //#endregion
555
+ //#region ../theme-core/src/palette/utils/contrast.ts
556
+ function relativeLuminance(r, g, b) {
557
+ const R = srgbToLinear(r), G = srgbToLinear(g), B = srgbToLinear(b);
558
+ return .2126 * R + .7152 * G + .0722 * B;
559
+ }
267
560
  buttonSizeNameSchema.options;
268
561
  //#endregion
269
562
  //#region ../theme-core/src/site-styles/styleTags.ts
@@ -323,7 +616,7 @@ function defineButtonPersonality(input) {
323
616
  name: input.name,
324
617
  description: input.description,
325
618
  tags: input.tags,
326
- buttonSystem: input.buttonSystem
619
+ buttonSystem: buttonSystemSchema.parse(input.buttonSystem)
327
620
  };
328
621
  }
329
622
  //#endregion
@@ -376,19 +669,15 @@ const brushedWash = defineButtonPersonality({
376
669
  background: {
377
670
  type: "gradient",
378
671
  stops: ["primary", "accent"],
379
- direction: "to-r"
672
+ direction: "to-r",
673
+ foregroundToken: "primaryForeground"
380
674
  },
381
- textColorToken: "primaryForeground",
382
675
  borderRadius: "rounded-lg",
383
676
  shadow: {
384
677
  elevation: "low",
385
678
  softness: "soft",
386
679
  position: "bottom"
387
- },
388
- effects: { hover: [{
389
- effectId: "opacity-reduce",
390
- options: { reduction: -15 }
391
- }] }
680
+ }
392
681
  },
393
682
  {
394
683
  id: "secondary",
@@ -398,32 +687,27 @@ const brushedWash = defineButtonPersonality({
398
687
  background: {
399
688
  type: "gradient",
400
689
  stops: ["secondary", "accent"],
401
- direction: "to-br"
690
+ direction: "to-br",
691
+ foregroundToken: "primaryForeground"
402
692
  },
403
- textColorToken: "primaryForeground",
404
693
  borderRadius: "rounded-lg",
405
694
  shadow: {
406
695
  elevation: "low",
407
696
  softness: "soft",
408
697
  position: "bottom"
409
- },
410
- effects: { hover: [{
411
- effectId: "opacity-reduce",
412
- options: { reduction: -15 }
413
- }] }
698
+ }
414
699
  },
415
700
  {
416
701
  id: "outline",
417
702
  name: "Outline",
418
703
  enabled: true,
419
704
  priority: 3,
420
- background: { type: "transparent" },
421
- textColorToken: "primary",
422
- borderRadius: "rounded-lg",
423
- border: {
424
- widthClass: "border",
425
- colorToken: "primary"
705
+ background: {
706
+ type: "surface",
707
+ role: "link"
426
708
  },
709
+ borderRadius: "rounded-lg",
710
+ border: { widthClass: "border" },
427
711
  effects: { hover: [{
428
712
  effectId: "background-on-hover",
429
713
  options: { colorToken: "surface" }
@@ -434,8 +718,10 @@ const brushedWash = defineButtonPersonality({
434
718
  name: "Ghost",
435
719
  enabled: true,
436
720
  priority: 3,
437
- background: { type: "transparent" },
438
- textColorToken: "text",
721
+ background: {
722
+ type: "surface",
723
+ role: "link"
724
+ },
439
725
  borderRadius: "rounded-lg",
440
726
  effects: { hover: [{
441
727
  effectId: "background-on-hover",
@@ -481,7 +767,6 @@ const confidentChip = defineButtonPersonality({
481
767
  type: "solid",
482
768
  colorToken: "primary"
483
769
  },
484
- textColorToken: "primaryForeground",
485
770
  borderRadius: "rounded-md",
486
771
  shadow: {
487
772
  elevation: "medium",
@@ -491,7 +776,7 @@ const confidentChip = defineButtonPersonality({
491
776
  effects: {
492
777
  hover: [{
493
778
  effectId: "darken-background",
494
- options: { amount: 60 }
779
+ options: { amount: 100 }
495
780
  }],
496
781
  active: [{
497
782
  effectId: "scale-down",
@@ -508,12 +793,8 @@ const confidentChip = defineButtonPersonality({
508
793
  type: "solid",
509
794
  colorToken: "surface"
510
795
  },
511
- textColorToken: "text",
512
796
  borderRadius: "rounded-md",
513
- border: {
514
- widthClass: "border",
515
- colorToken: "border"
516
- },
797
+ border: { widthClass: "border" },
517
798
  effects: { hover: [{
518
799
  effectId: "background-on-hover",
519
800
  options: { colorToken: "background" }
@@ -524,13 +805,12 @@ const confidentChip = defineButtonPersonality({
524
805
  name: "Outline",
525
806
  enabled: true,
526
807
  priority: 3,
527
- background: { type: "transparent" },
528
- textColorToken: "primary",
529
- borderRadius: "rounded-md",
530
- border: {
531
- widthClass: "border",
532
- colorToken: "primary"
808
+ background: {
809
+ type: "surface",
810
+ role: "link"
533
811
  },
812
+ borderRadius: "rounded-md",
813
+ border: { widthClass: "border" },
534
814
  effects: { hover: [{
535
815
  effectId: "background-on-hover",
536
816
  options: { colorToken: "surface" }
@@ -541,8 +821,10 @@ const confidentChip = defineButtonPersonality({
541
821
  name: "Ghost",
542
822
  enabled: true,
543
823
  priority: 3,
544
- background: { type: "transparent" },
545
- textColorToken: "primary",
824
+ background: {
825
+ type: "surface",
826
+ role: "link"
827
+ },
546
828
  borderRadius: "rounded-md",
547
829
  effects: { hover: [{
548
830
  effectId: "background-on-hover",
@@ -605,7 +887,6 @@ const earthPill = defineButtonPersonality({
605
887
  type: "solid",
606
888
  colorToken: "primary"
607
889
  },
608
- textColorToken: "primaryForeground",
609
890
  borderRadius: "rounded-full",
610
891
  shadow: {
611
892
  elevation: "low",
@@ -631,13 +912,12 @@ const earthPill = defineButtonPersonality({
631
912
  name: "Secondary",
632
913
  enabled: true,
633
914
  priority: 2,
634
- background: { type: "transparent" },
635
- textColorToken: "primary",
636
- borderRadius: "rounded-full",
637
- border: {
638
- widthClass: "border",
639
- colorToken: "primary"
915
+ background: {
916
+ type: "surface",
917
+ role: "link"
640
918
  },
919
+ borderRadius: "rounded-full",
920
+ border: { widthClass: "border" },
641
921
  effects: { hover: [{
642
922
  effectId: "background-on-hover",
643
923
  options: { colorToken: "muted" }
@@ -648,13 +928,12 @@ const earthPill = defineButtonPersonality({
648
928
  name: "Outline",
649
929
  enabled: true,
650
930
  priority: 3,
651
- background: { type: "transparent" },
652
- textColorToken: "text",
653
- borderRadius: "rounded-full",
654
- border: {
655
- widthClass: "border",
656
- colorToken: "border"
931
+ background: {
932
+ type: "surface",
933
+ role: "link"
657
934
  },
935
+ borderRadius: "rounded-full",
936
+ border: { widthClass: "border" },
658
937
  effects: { hover: [{
659
938
  effectId: "background-on-hover",
660
939
  options: { colorToken: "surfaceAlt" }
@@ -665,8 +944,10 @@ const earthPill = defineButtonPersonality({
665
944
  name: "Ghost",
666
945
  enabled: true,
667
946
  priority: 3,
668
- background: { type: "transparent" },
669
- textColorToken: "primary",
947
+ background: {
948
+ type: "surface",
949
+ role: "link"
950
+ },
670
951
  borderRadius: "rounded-full",
671
952
  shadow: {
672
953
  elevation: "none",
@@ -687,11 +968,7 @@ const earthPill = defineButtonPersonality({
687
968
  padding: "0.625rem 0",
688
969
  fontSize: "text-xl"
689
970
  }
690
- },
691
- effects: { hover: [{
692
- effectId: "opacity-reduce",
693
- options: { reduction: 25 }
694
- }] }
971
+ }
695
972
  }
696
973
  ]
697
974
  }
@@ -727,8 +1004,10 @@ const editorialLink = defineButtonPersonality({
727
1004
  name: "Primary",
728
1005
  enabled: true,
729
1006
  priority: 1,
730
- background: { type: "transparent" },
731
- textColorToken: "text",
1007
+ background: {
1008
+ type: "surface",
1009
+ role: "link"
1010
+ },
732
1011
  borderRadius: "rounded-none",
733
1012
  sizes: {
734
1013
  sm: { padding: "0.25rem 0" },
@@ -750,8 +1029,10 @@ const editorialLink = defineButtonPersonality({
750
1029
  name: "Secondary",
751
1030
  enabled: true,
752
1031
  priority: 2,
753
- background: { type: "transparent" },
754
- textColorToken: "mutedText",
1032
+ background: {
1033
+ type: "surface",
1034
+ role: "link"
1035
+ },
755
1036
  borderRadius: "rounded-none",
756
1037
  sizes: {
757
1038
  sm: { padding: "0.25rem 0" },
@@ -773,8 +1054,10 @@ const editorialLink = defineButtonPersonality({
773
1054
  name: "Outline",
774
1055
  enabled: true,
775
1056
  priority: 3,
776
- background: { type: "transparent" },
777
- textColorToken: "accent",
1057
+ background: {
1058
+ type: "surface",
1059
+ role: "link"
1060
+ },
778
1061
  borderRadius: "rounded-none",
779
1062
  sizes: {
780
1063
  sm: { padding: "0.25rem 0" },
@@ -796,19 +1079,17 @@ const editorialLink = defineButtonPersonality({
796
1079
  name: "Ghost",
797
1080
  enabled: true,
798
1081
  priority: 3,
799
- background: { type: "transparent" },
800
- textColorToken: "mutedText",
1082
+ background: {
1083
+ type: "surface",
1084
+ role: "link"
1085
+ },
801
1086
  borderRadius: "rounded-none",
802
1087
  sizes: {
803
1088
  sm: { padding: "0.25rem 0" },
804
1089
  md: { padding: "0.5rem 0" },
805
1090
  lg: { padding: "0.625rem 0" },
806
1091
  xl: { padding: "0.75rem 0" }
807
- },
808
- effects: { hover: [{
809
- effectId: "opacity-reduce",
810
- options: { reduction: -20 }
811
- }] }
1092
+ }
812
1093
  }
813
1094
  ]
814
1095
  }
@@ -870,12 +1151,8 @@ const flatInk = defineButtonPersonality({
870
1151
  type: "solid",
871
1152
  colorToken: "primary"
872
1153
  },
873
- textColorToken: "primaryForeground",
874
1154
  borderRadius: "rounded-lg",
875
- affordance: {
876
- iconId: "ArrowRight",
877
- colorToken: "accent"
878
- },
1155
+ affordance: { iconId: "ArrowRight" },
879
1156
  effects: { hover: [{
880
1157
  effectId: "lift",
881
1158
  options: { translateY: "-2px" }
@@ -889,13 +1166,12 @@ const flatInk = defineButtonPersonality({
889
1166
  name: "Secondary",
890
1167
  enabled: true,
891
1168
  priority: 2,
892
- background: { type: "transparent" },
893
- textColorToken: "primary",
894
- borderRadius: "rounded-lg",
895
- border: {
896
- widthClass: "border",
897
- colorToken: "border"
1169
+ background: {
1170
+ type: "surface",
1171
+ role: "link"
898
1172
  },
1173
+ borderRadius: "rounded-lg",
1174
+ border: { widthClass: "border" },
899
1175
  effects: { hover: [{
900
1176
  effectId: "lift",
901
1177
  options: { translateY: "-2px" }
@@ -913,12 +1189,8 @@ const flatInk = defineButtonPersonality({
913
1189
  type: "solid",
914
1190
  colorToken: "accent"
915
1191
  },
916
- textColorToken: "accentForeground",
917
1192
  borderRadius: "rounded-lg",
918
- affordance: {
919
- iconId: "ArrowRight",
920
- colorToken: "accentForeground"
921
- },
1193
+ affordance: { iconId: "ArrowRight" },
922
1194
  effects: { hover: [{
923
1195
  effectId: "lift",
924
1196
  options: { translateY: "-2px" }
@@ -981,7 +1253,6 @@ const inkStamp = defineButtonPersonality({
981
1253
  type: "solid",
982
1254
  colorToken: "primary"
983
1255
  },
984
- textColorToken: "primaryForeground",
985
1256
  borderRadius: "rounded-md",
986
1257
  effects: {
987
1258
  hover: [{
@@ -1002,13 +1273,12 @@ const inkStamp = defineButtonPersonality({
1002
1273
  name: "Secondary",
1003
1274
  enabled: true,
1004
1275
  priority: 2,
1005
- background: { type: "transparent" },
1006
- textColorToken: "primary",
1007
- borderRadius: "rounded-md",
1008
- border: {
1009
- widthClass: "border-2",
1010
- colorToken: "primary"
1276
+ background: {
1277
+ type: "surface",
1278
+ role: "link"
1011
1279
  },
1280
+ borderRadius: "rounded-md",
1281
+ border: { widthClass: "border-2" },
1012
1282
  effects: { hover: [{
1013
1283
  effectId: "background-on-hover",
1014
1284
  options: { colorToken: "surface" }
@@ -1019,13 +1289,12 @@ const inkStamp = defineButtonPersonality({
1019
1289
  name: "Outline",
1020
1290
  enabled: true,
1021
1291
  priority: 3,
1022
- background: { type: "transparent" },
1023
- textColorToken: "text",
1024
- borderRadius: "rounded-md",
1025
- border: {
1026
- widthClass: "border-2",
1027
- colorToken: "border"
1292
+ background: {
1293
+ type: "surface",
1294
+ role: "link"
1028
1295
  },
1296
+ borderRadius: "rounded-md",
1297
+ border: { widthClass: "border-2" },
1029
1298
  effects: { hover: [{
1030
1299
  effectId: "background-on-hover",
1031
1300
  options: { colorToken: "surface" }
@@ -1036,8 +1305,10 @@ const inkStamp = defineButtonPersonality({
1036
1305
  name: "Ghost",
1037
1306
  enabled: true,
1038
1307
  priority: 3,
1039
- background: { type: "transparent" },
1040
- textColorToken: "accent",
1308
+ background: {
1309
+ type: "surface",
1310
+ role: "link"
1311
+ },
1041
1312
  borderRadius: "rounded-none",
1042
1313
  sizes: {
1043
1314
  sm: {
@@ -1130,7 +1401,6 @@ const joyStamp = defineButtonPersonality({
1130
1401
  type: "solid",
1131
1402
  colorToken: "primary"
1132
1403
  },
1133
- textColorToken: "primaryForeground",
1134
1404
  borderRadius: "rounded-full",
1135
1405
  shadow: {
1136
1406
  elevation: "high",
@@ -1144,13 +1414,12 @@ const joyStamp = defineButtonPersonality({
1144
1414
  name: "Secondary",
1145
1415
  enabled: true,
1146
1416
  priority: 2,
1147
- background: { type: "transparent" },
1148
- textColorToken: "text",
1149
- borderRadius: "rounded-full",
1150
- border: {
1151
- widthClass: "border-2",
1152
- colorToken: "text"
1417
+ background: {
1418
+ type: "surface",
1419
+ role: "link"
1153
1420
  },
1421
+ borderRadius: "rounded-full",
1422
+ border: { widthClass: "border-2" },
1154
1423
  shadow: {
1155
1424
  elevation: "high",
1156
1425
  softness: "hard",
@@ -1215,12 +1484,8 @@ const ornateRitual = defineButtonPersonality({
1215
1484
  type: "solid",
1216
1485
  colorToken: "primary"
1217
1486
  },
1218
- textColorToken: "primaryForeground",
1219
1487
  borderRadius: "rounded-md",
1220
- border: {
1221
- widthClass: "border",
1222
- colorToken: "primary"
1223
- },
1488
+ border: { widthClass: "border" },
1224
1489
  effects: {
1225
1490
  hover: [{
1226
1491
  effectId: "background-on-hover",
@@ -1241,12 +1506,8 @@ const ornateRitual = defineButtonPersonality({
1241
1506
  type: "solid",
1242
1507
  colorToken: "secondary"
1243
1508
  },
1244
- textColorToken: "primaryForeground",
1245
1509
  borderRadius: "rounded-md",
1246
- border: {
1247
- widthClass: "border",
1248
- colorToken: "primary"
1249
- },
1510
+ border: { widthClass: "border" },
1250
1511
  effects: { hover: [{
1251
1512
  effectId: "background-on-hover",
1252
1513
  options: { colorToken: "surface" }
@@ -1257,13 +1518,12 @@ const ornateRitual = defineButtonPersonality({
1257
1518
  name: "Outline",
1258
1519
  enabled: true,
1259
1520
  priority: 3,
1260
- background: { type: "transparent" },
1261
- textColorToken: "primary",
1262
- borderRadius: "rounded-md",
1263
- border: {
1264
- widthClass: "border",
1265
- colorToken: "primary"
1521
+ background: {
1522
+ type: "surface",
1523
+ role: "link"
1266
1524
  },
1525
+ borderRadius: "rounded-md",
1526
+ border: { widthClass: "border" },
1267
1527
  effects: { hover: [{
1268
1528
  effectId: "background-on-hover",
1269
1529
  options: { colorToken: "muted" }
@@ -1274,8 +1534,10 @@ const ornateRitual = defineButtonPersonality({
1274
1534
  name: "Ghost",
1275
1535
  enabled: true,
1276
1536
  priority: 3,
1277
- background: { type: "transparent" },
1278
- textColorToken: "accent",
1537
+ background: {
1538
+ type: "surface",
1539
+ role: "link"
1540
+ },
1279
1541
  borderRadius: "rounded-none",
1280
1542
  sizes: {
1281
1543
  sm: {
@@ -1357,14 +1619,10 @@ const pebble = defineButtonPersonality({
1357
1619
  type: "solid",
1358
1620
  colorToken: "primary"
1359
1621
  },
1360
- textColorToken: "primaryForeground",
1361
1622
  borderRadius: "rounded-full",
1362
1623
  effects: { hover: [{
1363
- effectId: "background-on-hover-alpha",
1364
- options: {
1365
- colorToken: "primary",
1366
- opacity: 88
1367
- }
1624
+ effectId: "darken-background",
1625
+ options: { amount: 100 }
1368
1626
  }] }
1369
1627
  },
1370
1628
  {
@@ -1372,13 +1630,12 @@ const pebble = defineButtonPersonality({
1372
1630
  name: "Secondary",
1373
1631
  enabled: true,
1374
1632
  priority: 2,
1375
- background: { type: "transparent" },
1376
- textColorToken: "primary",
1377
- borderRadius: "rounded-full",
1378
- border: {
1379
- widthClass: "border-2",
1380
- colorToken: "accent"
1633
+ background: {
1634
+ type: "surface",
1635
+ role: "link"
1381
1636
  },
1637
+ borderRadius: "rounded-full",
1638
+ border: { widthClass: "border-2" },
1382
1639
  effects: { hover: [{
1383
1640
  effectId: "background-on-hover",
1384
1641
  options: { colorToken: "accent" }
@@ -1389,13 +1646,12 @@ const pebble = defineButtonPersonality({
1389
1646
  name: "Outline",
1390
1647
  enabled: true,
1391
1648
  priority: 3,
1392
- background: { type: "transparent" },
1393
- textColorToken: "text",
1394
- borderRadius: "rounded-full",
1395
- border: {
1396
- widthClass: "border",
1397
- colorToken: "border"
1649
+ background: {
1650
+ type: "surface",
1651
+ role: "link"
1398
1652
  },
1653
+ borderRadius: "rounded-full",
1654
+ border: { widthClass: "border" },
1399
1655
  effects: { hover: [{
1400
1656
  effectId: "background-on-hover",
1401
1657
  options: { colorToken: "surface" }
@@ -1406,8 +1662,10 @@ const pebble = defineButtonPersonality({
1406
1662
  name: "Ghost",
1407
1663
  enabled: true,
1408
1664
  priority: 3,
1409
- background: { type: "transparent" },
1410
- textColorToken: "primary",
1665
+ background: {
1666
+ type: "surface",
1667
+ role: "link"
1668
+ },
1411
1669
  borderRadius: "rounded-full",
1412
1670
  sizes: {
1413
1671
  sm: {
@@ -1423,11 +1681,7 @@ const pebble = defineButtonPersonality({
1423
1681
  padding: "0.75rem 1.5rem",
1424
1682
  fontSize: "text-xl"
1425
1683
  }
1426
- },
1427
- effects: { hover: [{
1428
- effectId: "opacity-reduce",
1429
- options: { reduction: 30 }
1430
- }] }
1684
+ }
1431
1685
  }
1432
1686
  ]
1433
1687
  }
@@ -1489,15 +1743,11 @@ const quietArrow = defineButtonPersonality({
1489
1743
  type: "solid",
1490
1744
  colorToken: "primary"
1491
1745
  },
1492
- textColorToken: "primaryForeground",
1493
1746
  borderRadius: "rounded-xl",
1494
1747
  affordance: { iconId: "ArrowRight" },
1495
1748
  effects: { hover: [{
1496
- effectId: "background-on-hover-alpha",
1497
- options: {
1498
- colorToken: "primary",
1499
- opacity: 90
1500
- }
1749
+ effectId: "darken-background",
1750
+ options: { amount: 100 }
1501
1751
  }] }
1502
1752
  },
1503
1753
  {
@@ -1505,13 +1755,12 @@ const quietArrow = defineButtonPersonality({
1505
1755
  name: "Secondary",
1506
1756
  enabled: true,
1507
1757
  priority: 2,
1508
- background: { type: "transparent" },
1509
- textColorToken: "primary",
1510
- borderRadius: "rounded-xl",
1511
- border: {
1512
- widthClass: "border",
1513
- colorToken: "primary"
1758
+ background: {
1759
+ type: "surface",
1760
+ role: "link"
1514
1761
  },
1762
+ borderRadius: "rounded-xl",
1763
+ border: { widthClass: "border" },
1515
1764
  affordance: { iconId: "ArrowRight" },
1516
1765
  effects: { hover: [{
1517
1766
  effectId: "background-on-hover",
@@ -1523,21 +1772,22 @@ const quietArrow = defineButtonPersonality({
1523
1772
  name: "Outline",
1524
1773
  enabled: true,
1525
1774
  priority: 3,
1526
- background: { type: "transparent" },
1527
- textColorToken: "primary",
1775
+ background: {
1776
+ type: "surface",
1777
+ role: "link"
1778
+ },
1528
1779
  borderRadius: "rounded-xl",
1529
- border: {
1530
- widthClass: "border",
1531
- colorToken: "primary"
1532
- }
1780
+ border: { widthClass: "border" }
1533
1781
  },
1534
1782
  {
1535
1783
  id: "ghost",
1536
1784
  name: "Ghost",
1537
1785
  enabled: true,
1538
1786
  priority: 3,
1539
- background: { type: "transparent" },
1540
- textColorToken: "primary",
1787
+ background: {
1788
+ type: "surface",
1789
+ role: "link"
1790
+ },
1541
1791
  borderRadius: "rounded-xl"
1542
1792
  }
1543
1793
  ]
@@ -1601,7 +1851,6 @@ const showtimePill = defineButtonPersonality({
1601
1851
  type: "solid",
1602
1852
  colorToken: "primary"
1603
1853
  },
1604
- textColorToken: "background",
1605
1854
  borderRadius: "rounded-full",
1606
1855
  effects: { hover: [{ effectId: "pop" }] }
1607
1856
  },
@@ -1610,13 +1859,12 @@ const showtimePill = defineButtonPersonality({
1610
1859
  name: "Secondary",
1611
1860
  enabled: true,
1612
1861
  priority: 2,
1613
- background: { type: "transparent" },
1614
- textColorToken: "primary",
1615
- borderRadius: "rounded-full",
1616
- border: {
1617
- widthClass: "border-2",
1618
- colorToken: "primary"
1862
+ background: {
1863
+ type: "surface",
1864
+ role: "link"
1619
1865
  },
1866
+ borderRadius: "rounded-full",
1867
+ border: { widthClass: "border-2" },
1620
1868
  effects: { hover: [{ effectId: "pop" }] }
1621
1869
  },
1622
1870
  {
@@ -1628,7 +1876,6 @@ const showtimePill = defineButtonPersonality({
1628
1876
  type: "solid",
1629
1877
  colorToken: "secondary"
1630
1878
  },
1631
- textColorToken: "primary",
1632
1879
  borderRadius: "rounded-full",
1633
1880
  effects: { hover: [{ effectId: "pop" }] }
1634
1881
  },
@@ -1641,12 +1888,8 @@ const showtimePill = defineButtonPersonality({
1641
1888
  type: "solid",
1642
1889
  colorToken: "background"
1643
1890
  },
1644
- textColorToken: "primary",
1645
1891
  borderRadius: "rounded-full",
1646
- border: {
1647
- widthClass: "border-2",
1648
- colorToken: "primary"
1649
- },
1892
+ border: { widthClass: "border-2" },
1650
1893
  effects: { hover: [{
1651
1894
  effectId: "background-on-hover",
1652
1895
  options: { colorToken: "surface" }
@@ -1657,13 +1900,12 @@ const showtimePill = defineButtonPersonality({
1657
1900
  name: "Outline",
1658
1901
  enabled: true,
1659
1902
  priority: 3,
1660
- background: { type: "transparent" },
1661
- textColorToken: "primary",
1662
- borderRadius: "rounded-full",
1663
- border: {
1664
- widthClass: "border-2",
1665
- colorToken: "primary"
1903
+ background: {
1904
+ type: "surface",
1905
+ role: "link"
1666
1906
  },
1907
+ borderRadius: "rounded-full",
1908
+ border: { widthClass: "border-2" },
1667
1909
  effects: { hover: [{
1668
1910
  effectId: "background-on-hover",
1669
1911
  options: { colorToken: "background" }
@@ -1674,8 +1916,10 @@ const showtimePill = defineButtonPersonality({
1674
1916
  name: "Ghost",
1675
1917
  enabled: true,
1676
1918
  priority: 3,
1677
- background: { type: "transparent" },
1678
- textColorToken: "primary",
1919
+ background: {
1920
+ type: "surface",
1921
+ role: "link"
1922
+ },
1679
1923
  borderRadius: "rounded-full",
1680
1924
  effects: { hover: [{
1681
1925
  effectId: "background-on-hover",
@@ -1721,7 +1965,6 @@ const softPill = defineButtonPersonality({
1721
1965
  type: "solid",
1722
1966
  colorToken: "primary"
1723
1967
  },
1724
- textColorToken: "primaryForeground",
1725
1968
  borderRadius: "rounded-full",
1726
1969
  shadow: {
1727
1970
  elevation: "low",
@@ -1744,13 +1987,12 @@ const softPill = defineButtonPersonality({
1744
1987
  name: "Secondary",
1745
1988
  enabled: true,
1746
1989
  priority: 2,
1747
- background: { type: "transparent" },
1748
- textColorToken: "primary",
1749
- borderRadius: "rounded-full",
1750
- border: {
1751
- widthClass: "border-2",
1752
- colorToken: "primary"
1990
+ background: {
1991
+ type: "surface",
1992
+ role: "link"
1753
1993
  },
1994
+ borderRadius: "rounded-full",
1995
+ border: { widthClass: "border-2" },
1754
1996
  effects: { hover: [{
1755
1997
  effectId: "background-on-hover",
1756
1998
  options: { colorToken: "surface" }
@@ -1761,13 +2003,12 @@ const softPill = defineButtonPersonality({
1761
2003
  name: "Outline",
1762
2004
  enabled: true,
1763
2005
  priority: 3,
1764
- background: { type: "transparent" },
1765
- textColorToken: "text",
1766
- borderRadius: "rounded-full",
1767
- border: {
1768
- widthClass: "border",
1769
- colorToken: "border"
2006
+ background: {
2007
+ type: "surface",
2008
+ role: "link"
1770
2009
  },
2010
+ borderRadius: "rounded-full",
2011
+ border: { widthClass: "border" },
1771
2012
  effects: { hover: [{
1772
2013
  effectId: "background-on-hover",
1773
2014
  options: { colorToken: "surface" }
@@ -1778,8 +2019,10 @@ const softPill = defineButtonPersonality({
1778
2019
  name: "Ghost",
1779
2020
  enabled: true,
1780
2021
  priority: 3,
1781
- background: { type: "transparent" },
1782
- textColorToken: "text",
2022
+ background: {
2023
+ type: "surface",
2024
+ role: "link"
2025
+ },
1783
2026
  borderRadius: "rounded-full",
1784
2027
  effects: { hover: [{
1785
2028
  effectId: "background-on-hover",
@@ -1798,9 +2041,8 @@ const solidSecondary = {
1798
2041
  priority: 2,
1799
2042
  background: {
1800
2043
  type: "solid",
1801
- colorToken: "secondary"
2044
+ colorToken: unsafeAsOpaqueButtonColourToken("secondary")
1802
2045
  },
1803
- textColorToken: "onSecondary",
1804
2046
  borderRadius: "rounded-full",
1805
2047
  shadow: {
1806
2048
  elevation: "none",
@@ -1848,5 +2090,26 @@ const buttonPersonalities = [
1848
2090
  quietArrow
1849
2091
  ];
1850
2092
  new Map(buttonPersonalities.map((p) => [p.id, p]));
2093
+ buttonPersonalities.map((personality) => ({
2094
+ id: personality.id,
2095
+ name: personality.name,
2096
+ description: personality.description,
2097
+ category: presetCategory(personality),
2098
+ buttonSystem: personality.buttonSystem,
2099
+ compatibility: {
2100
+ ...personality.tags.tone ? { tones: [personality.tags.tone] } : {},
2101
+ ...personality.tags.energy ? { energies: [personality.tags.energy] } : {}
2102
+ }
2103
+ }));
2104
+ function presetCategory(personality) {
2105
+ switch (personality.tags.era) {
2106
+ case "retro": return "retro";
2107
+ case "editorial": return "minimal";
2108
+ case "organic": return "artistic";
2109
+ case "modern": return personality.tags.tone === "bold" ? "modern" : "technical";
2110
+ case "technical": return "technical";
2111
+ case void 0: return "modern";
2112
+ }
2113
+ }
1851
2114
  //#endregion
1852
- export { themeButtonClassName as t };
2115
+ export { hexToRgb as n, themeButtonClassName as r, relativeLuminance as t };