@riverbankcms/sdk 0.107.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 (256) hide show
  1. package/README.md +21 -1
  2. package/dist/{PreviewEditorSidebar-DpAbAl08.mjs → PreviewEditorSidebar-DWqwfy3_.mjs} +48 -28
  3. package/dist/{PreviewEditorUI-O7cn6Xxv.mjs → PreviewEditorUI-B7OL4sfR.mjs} +10 -9
  4. package/dist/{PreviewQueryProvider-D0tnKl0t.mjs → PreviewQueryProvider-D0y2l8JN.mjs} +1 -1
  5. package/dist/{SdkPreviewModeRuntime-CVB7urtl.mjs → SdkPreviewModeRuntime-D8Gt9Gbe.mjs} +633 -220
  6. package/dist/{SiteChromeCustomizeContext-C_sizso-.mjs → SiteChromeCustomizeContext-DUpalEdL.mjs} +5764 -1556
  7. package/dist/_dts/ai/src/contracts/proposals.d.ts +15383 -11388
  8. package/dist/_dts/api/src/blocks.d.ts +41 -7
  9. package/dist/_dts/api/src/bookingAdjustments.d.ts +5 -0
  10. package/dist/_dts/api/src/bookingOperations.d.ts +4 -0
  11. package/dist/_dts/api/src/bookingRecords.d.ts +177 -127
  12. package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
  13. package/dist/_dts/api/src/cache-tags.d.ts +3 -0
  14. package/dist/_dts/api/src/common/envelope.d.ts +7 -0
  15. package/dist/_dts/api/src/contentRuntime.d.ts +19 -1
  16. package/dist/_dts/api/src/courses.d.ts +1 -0
  17. package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +5 -5
  18. package/dist/_dts/api/src/endpoints.d.ts +134 -0
  19. package/dist/_dts/api/src/footer-settings.d.ts +1 -0
  20. package/dist/_dts/api/src/footerSettings.d.ts +8 -0
  21. package/dist/_dts/api/src/index.d.ts +7 -4
  22. package/dist/_dts/api/src/navigation/contracts.d.ts +3 -3
  23. package/dist/_dts/api/src/participantMessaging.d.ts +18 -12
  24. package/dist/_dts/api/src/previewContentContract.d.ts +4 -0
  25. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +1 -0
  26. package/dist/_dts/api/src/sdkContracts.d.ts +309 -1
  27. package/dist/_dts/api/src/siteBanner.d.ts +2 -2
  28. package/dist/_dts/api/src/siteInfrastructure.d.ts +13 -0
  29. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +144 -60
  30. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +35 -1
  31. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +74 -28
  32. package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientField.d.ts +9 -0
  33. package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientWidget.d.ts +3 -4
  34. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -4
  35. package/dist/_dts/blocks/src/index.d.ts +1 -1
  36. package/dist/_dts/blocks/src/primitives/layout/Section.d.ts +0 -1
  37. package/dist/_dts/blocks/src/rendering/server.d.ts +1 -0
  38. package/dist/_dts/blocks/src/system/blocks/audio-player.d.ts +3 -0
  39. package/dist/_dts/blocks/src/system/blocks/body-text.d.ts +3 -0
  40. package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +3 -0
  41. package/dist/_dts/blocks/src/system/blocks/course-registration.d.ts +1 -22
  42. package/dist/_dts/blocks/src/system/blocks/cta-full.d.ts +3 -0
  43. package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -22
  44. package/dist/_dts/blocks/src/system/blocks/file-download.d.ts +3 -0
  45. package/dist/_dts/blocks/src/system/blocks/form.d.ts +3 -0
  46. package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +3 -0
  47. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +3 -0
  48. package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +3 -0
  49. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +50 -0
  50. package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +9 -48
  51. package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +3 -0
  52. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +3 -0
  53. package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +3 -0
  54. package/dist/_dts/blocks/src/system/blocks/video-grid.d.ts +3 -0
  55. package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
  56. package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +16 -6
  57. package/dist/_dts/blocks/src/system/defineBlock.d.ts +9 -1
  58. package/dist/_dts/blocks/src/system/fields/ctas.d.ts +8 -0
  59. package/dist/_dts/blocks/src/system/icons/registry.d.ts +2 -1
  60. package/dist/_dts/blocks/src/system/icons/social.d.ts +5 -0
  61. package/dist/_dts/blocks/src/system/icons/svg.d.ts +1 -0
  62. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +33 -2
  63. package/dist/_dts/blocks/src/system/node/fragments/backgroundLayer.d.ts +13 -0
  64. package/dist/_dts/blocks/src/system/node/fragments/footerNav.d.ts +2 -0
  65. package/dist/_dts/blocks/src/system/node/fragments/styledContainer.d.ts +4 -4
  66. package/dist/_dts/blocks/src/system/node/fragments/styledSection.d.ts +3 -12
  67. package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
  68. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
  69. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +3 -3
  70. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +2 -2
  71. package/dist/_dts/blocks/src/system/types/link.d.ts +3 -3
  72. package/dist/_dts/content-editor/src/FooterComposerPanel.d.ts +14 -0
  73. package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +27 -8
  74. package/dist/_dts/content-editor/src/footerComposer.d.ts +56 -0
  75. package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +1 -1
  76. package/dist/_dts/content-editor/src/hooks/useEntryMutations.d.ts +5 -5
  77. package/dist/_dts/content-editor/src/index.d.ts +2 -0
  78. package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +3 -1
  79. package/dist/_dts/content-editor/src/services/contentEntryServices.d.ts +20 -36
  80. package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +5 -1
  81. package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +11 -0
  82. package/dist/_dts/content-model/src/content-types/entryValidation.d.ts +31 -0
  83. package/dist/_dts/content-model/src/content-types/scaffold.d.ts +58 -0
  84. package/dist/_dts/content-model/src/content-types/schema.d.ts +1 -1
  85. package/dist/_dts/content-model/src/content-types/sentinels.d.ts +36 -0
  86. package/dist/_dts/content-model/src/definitions/shared.d.ts +3 -0
  87. package/dist/_dts/content-model/src/index.d.ts +3 -0
  88. package/dist/_dts/core/src/booking-date-time.d.ts +8 -0
  89. package/dist/_dts/core/src/branded.d.ts +3 -0
  90. package/dist/_dts/core/src/editor-state.d.ts +4 -0
  91. package/dist/_dts/core/src/footer-composition.d.ts +143 -0
  92. package/dist/_dts/core/src/index.d.ts +2 -0
  93. package/dist/_dts/core/src/public-profile.d.ts +73 -0
  94. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +221 -205
  95. package/dist/_dts/db/src/schemas/forms.d.ts +10 -10
  96. package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +5 -0
  97. package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +1 -0
  98. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockCreation.d.ts +2 -1
  99. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +2 -1
  100. package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockReorder.d.ts +2 -1
  101. package/dist/_dts/editor-blocks/src/block-editor/owner.d.ts +10 -0
  102. package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +1 -0
  103. package/dist/_dts/media-core/src/fileMimeDetection.d.ts +16 -0
  104. package/dist/_dts/media-core/src/fileStorage.d.ts +8 -0
  105. package/dist/_dts/media-core/src/storagePathDomain.d.ts +2 -0
  106. package/dist/_dts/media-core/src/uploadVerificationContract.d.ts +3 -0
  107. package/dist/_dts/path-utils/src/index.d.ts +5 -0
  108. package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +2 -0
  109. package/dist/_dts/preview-next/src/client/preview/PreviewChromeLayer.d.ts +5 -0
  110. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
  111. package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +1 -0
  112. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
  113. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
  114. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
  115. package/dist/_dts/preview-next/src/client/preview/previewErrorMessages.d.ts +4 -0
  116. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -1
  117. package/dist/_dts/sdk/src/cli/commands/audit.d.ts +1 -1
  118. package/dist/_dts/sdk/src/cli/commands/compare.d.ts +1 -1
  119. package/dist/_dts/sdk/src/cli/commands/deploy.d.ts +1 -1
  120. package/dist/_dts/sdk/src/cli/commands/drafts.d.ts +18 -0
  121. package/dist/_dts/sdk/src/cli/commands/entry.d.ts +15 -0
  122. package/dist/_dts/sdk/src/cli/commands/init-docs.d.ts +2 -2
  123. package/dist/_dts/sdk/src/cli/commands/publish-all.d.ts +1 -1
  124. package/dist/_dts/sdk/src/cli/commands/pull.d.ts +1 -0
  125. package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +1 -1
  126. package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +3 -0
  127. package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +12 -1
  128. package/dist/_dts/sdk/src/cli/commands/setup.d.ts +1 -0
  129. package/dist/_dts/sdk/src/cli/commands/verify.d.ts +1 -0
  130. package/dist/_dts/sdk/src/cli/content/reader.d.ts +1 -0
  131. package/dist/_dts/sdk/src/cli/helpers.d.ts +22 -1
  132. package/dist/_dts/sdk/src/cli/index.d.ts +4 -0
  133. package/dist/_dts/sdk/src/cli/output.d.ts +88 -0
  134. package/dist/_dts/sdk/src/cli/program.d.ts +29 -0
  135. package/dist/_dts/sdk/src/cli/push-config.d.ts +1 -1
  136. package/dist/_dts/sdk/src/client/management/blocks.d.ts +14 -1
  137. package/dist/_dts/sdk/src/client/management/catalog.d.ts +10 -0
  138. package/dist/_dts/sdk/src/client/management/http.d.ts +7 -1
  139. package/dist/_dts/sdk/src/client/management/index.d.ts +2 -1
  140. package/dist/_dts/sdk/src/client/management/types.d.ts +58 -20
  141. package/dist/_dts/sdk/src/config/content-types.d.ts +2 -0
  142. package/dist/_dts/sdk/src/config/content-validation.d.ts +4 -0
  143. package/dist/_dts/sdk/src/date-time/index.d.ts +68 -0
  144. package/dist/_dts/sdk/src/navigation/index.d.ts +2 -0
  145. package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -2
  146. package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +2 -1
  147. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +1 -1
  148. package/dist/_dts/sdk/src/version.d.ts +1 -1
  149. package/dist/_dts/site-commands/src/commands.d.ts +900 -827
  150. package/dist/_dts/theme-core/src/accordions/types.d.ts +2 -2
  151. package/dist/_dts/theme-core/src/buttons/core.d.ts +15 -46
  152. package/dist/_dts/theme-core/src/buttons/effectClassification.d.ts +147 -0
  153. package/dist/_dts/theme-core/src/buttons/effects/types.d.ts +2 -3
  154. package/dist/_dts/theme-core/src/buttons/generateDefaultButtonSystem.d.ts +1 -1
  155. package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
  156. package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +11 -0
  157. package/dist/_dts/theme-core/src/buttons/personalities/two-tone-pill.d.ts +17 -0
  158. package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +45 -33
  159. package/dist/_dts/theme-core/src/buttons/presets.d.ts +4 -25
  160. package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +100 -0
  161. package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +16 -0
  162. package/dist/_dts/theme-core/src/buttons/types.d.ts +104 -86
  163. package/dist/_dts/theme-core/src/cards/types.d.ts +16 -16
  164. package/dist/_dts/theme-core/src/footer/mode.d.ts +15 -0
  165. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  166. package/dist/_dts/theme-core/src/gradients/presets.d.ts +200 -8
  167. package/dist/_dts/theme-core/src/gradients/utils.d.ts +6 -2
  168. package/dist/_dts/theme-core/src/interactive/baseSchema.d.ts +1 -1
  169. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +117 -150
  170. package/dist/_dts/theme-core/src/mock-themes/modern-minimal.d.ts +1 -1
  171. package/dist/_dts/theme-core/src/navigation/types.d.ts +3 -3
  172. package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -2
  173. package/dist/_dts/theme-core/src/palette/curated/types.d.ts +5 -8
  174. package/dist/_dts/theme-core/src/palette/index.d.ts +0 -1
  175. package/dist/_dts/theme-core/src/schema.d.ts +1264 -138
  176. package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
  177. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +10 -10
  178. package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +12 -1
  179. package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +3 -2
  180. package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +13 -6
  181. package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +29 -8
  182. package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +15 -0
  183. package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +2 -2
  184. package/dist/cli/index.mjs +68552 -66955
  185. package/dist/cli/init-docs/content/cli-reference.md +50 -7
  186. package/dist/cli/init-docs/content/content-management.md +7 -4
  187. package/dist/cli/init-docs/content/workflow-publish.md +5 -1
  188. package/dist/client/{DiscountCodeDisclosure-BwGkvmVH.mjs → DiscountCodeDisclosure-DU1ygxU2.mjs} +1 -1
  189. package/dist/client/{EventCombined.client-JnWE6Hzc.mjs → EventCombined.client-DB5zagCo.mjs} +3 -3
  190. package/dist/client/{EventListing.client-DQewc_kg.mjs → EventListing.client-CTX9JHBL.mjs} +2 -2
  191. package/dist/client/{LeafletStaticMap-DPAU3SFt.mjs → LeafletStaticMap-BYImhgiB.mjs} +1 -1
  192. package/dist/client/{MagicLinkForm-D4kpWCbW.mjs → MagicLinkForm-CRkw_M3l.mjs} +2 -2
  193. package/dist/client/{StepIndicator-CBlkb4rA.mjs → StepIndicator-BnmVBJJh.mjs} +2 -2
  194. package/dist/client/{accordion-DAIBVpTS.mjs → accordion-CeGreumd.mjs} +1 -1
  195. package/dist/client/{bookingForm-DZ-4l5_1.mjs → bookingForm-CSzFNrpN.mjs} +6 -6
  196. package/dist/client/bookings.mjs +637 -328
  197. package/dist/client/{buttons-DJgynGHQ.mjs → buttons-DoFV7KDL.mjs} +618 -306
  198. package/dist/client/{carousel-D-SLfX8r.mjs → carousel-B2jDtogf.mjs} +1 -1
  199. package/dist/client/{cart-CEgbgJhX.mjs → cart-D-jZ-vaY.mjs} +3 -3
  200. package/dist/client/{checkout-CXWrCRAA.mjs → checkout-Dza-LA7N.mjs} +3 -3
  201. package/dist/client/client.mjs +2497 -1216
  202. package/dist/client/{colorStyles-jZS6KfkP.mjs → colorStyles-CrgzoXsm.mjs} +1 -30
  203. package/dist/client/{courseRegistration-DVmLrRVz.mjs → courseRegistration-TYkNychb.mjs} +7 -7
  204. package/dist/client/{eventCalendar-DCuyPY_c.mjs → eventCalendar-BI_90SsT.mjs} +5 -5
  205. package/dist/client/{eventCombined-kP2CA2D4.mjs → eventCombined-mNrpryE9.mjs} +2 -2
  206. package/dist/client/{eventDetails-DU0LeF5e.mjs → eventDetails-D4GVlCIY.mjs} +3 -3
  207. package/dist/client/{eventListing-CcHF87BI.mjs → eventListing-YhKN018y.mjs} +2 -2
  208. package/dist/client/{eventRegistration-DJnR0yFH.mjs → eventRegistration-CdHGtilr.mjs} +7 -7
  209. package/dist/client/foregroundContract-xICPq59x.mjs +31 -0
  210. package/dist/client/{form-CH1lCusH.mjs → form-AcAL45rA.mjs} +2 -2
  211. package/dist/client/{headerSection-CBPFZoku.mjs → headerSection-uEC52ueD.mjs} +3 -3
  212. package/dist/client/hooks.mjs +1249 -841
  213. package/dist/client/{locationMap-Cx1hBg5n.mjs → locationMap-_wJDSUYe.mjs} +3 -3
  214. package/dist/client/{media-DHtSxS5V.mjs → media-BK0O3b-U.mjs} +3 -2
  215. package/dist/client/{newsletterForm-1ZL_ti9u.mjs → newsletterForm-DrArsb2B.mjs} +2 -2
  216. package/dist/client/{pricing-BIbzmV0G.mjs → pricing-BSYVghwo.mjs} +1 -1
  217. package/dist/client/{productDetail-BTh5gHBV.mjs → productDetail-Dyk90sMs.mjs} +3 -3
  218. package/dist/client/{productList-Cc7OMrqN.mjs → productList-BCKThwAI.mjs} +3 -3
  219. package/dist/client/{propsDecoder-oR-M-ISN.mjs → propsDecoder-CkXxkdSR.mjs} +96 -33
  220. package/dist/client/rendering/client.mjs +1278 -523
  221. package/dist/client/rendering/islands.mjs +19 -19
  222. package/dist/client/rendering.mjs +2308 -1028
  223. package/dist/client/{shop-CQ_YbCnn.mjs → shop-DeltVH10.mjs} +6 -6
  224. package/dist/client/{shop-commerce-BM-AoD3M.mjs → shop-commerce-BD9Jsm2Z.mjs} +6 -6
  225. package/dist/client/{shop-commerce-store-DFMQhU5p.mjs → shop-commerce-store-CmXD6FDS.mjs} +1 -1
  226. package/dist/client/{shopShared-D0SKO2Cu.mjs → shopShared-B8v-lH_F.mjs} +2 -2
  227. package/dist/client/{useDiscountCodeUi-CrG4_ARt.mjs → useDiscountCodeUi-DbWJN8ld.mjs} +1 -1
  228. package/dist/client/{useEventFilters-CxK8Fekl.mjs → useEventFilters-EJIMUnqT.mjs} +46 -69
  229. package/dist/client/{usePolling-jcVryNgZ.mjs → usePolling-Cmh14fc7.mjs} +2 -2
  230. package/dist/preview-next/before-render.mjs +213 -0
  231. package/dist/preview-next/client/runtime.mjs +4 -4
  232. package/dist/preview-next/middleware.mjs +213 -0
  233. package/dist/{previewAuthStore-BPcJPzdz.mjs → previewAuthStore-CTO7CRPk.mjs} +213 -0
  234. package/dist/{sdk-runtime-C39Rsk-x.mjs → sdk-runtime-Dou0GAav.mjs} +2 -2
  235. package/dist/{separator-BoMSQnsP.mjs → separator-CI5wZNXT.mjs} +1 -1
  236. package/dist/server/components.mjs +2370 -1132
  237. package/dist/server/config-validation.mjs +1256 -842
  238. package/dist/server/config.mjs +1256 -843
  239. package/dist/server/data.mjs +1249 -841
  240. package/dist/server/date-time.mjs +386 -0
  241. package/dist/server/index.mjs +214 -1
  242. package/dist/server/navigation.mjs +9 -3
  243. package/dist/server/next.mjs +3421 -1949
  244. package/dist/server/page-converter.mjs +1236 -659
  245. package/dist/server/prebuild.mjs +1 -1
  246. package/dist/server/rendering/server.mjs +2074 -1060
  247. package/dist/server/rendering.mjs +2370 -1132
  248. package/dist/server/routing.mjs +1543 -1062
  249. package/dist/server/server.mjs +1464 -843
  250. package/dist/server/theme-bridge.mjs +1581 -474
  251. package/dist/server/theme.mjs +614 -305
  252. package/dist/styles/index.css +12 -1
  253. package/package.json +7 -1
  254. package/dist/_dts/theme-core/src/buttons/presets/types.d.ts +0 -88
  255. package/dist/_dts/theme-core/src/buttons/utils/contrast.d.ts +0 -38
  256. package/dist/_dts/theme-core/src/palette/themePaletteCompatibility.d.ts +0 -57
@@ -87,8 +87,8 @@ export declare const accordionSystemSchema: z.ZodObject<{
87
87
  semibold: "semibold";
88
88
  }>>;
89
89
  fontFamily: z.ZodOptional<z.ZodEnum<{
90
- body: "body";
91
90
  heading: "heading";
91
+ body: "body";
92
92
  }>>;
93
93
  fontScale: z.ZodOptional<z.ZodEnum<{
94
94
  body: "body";
@@ -116,8 +116,8 @@ export declare const accordionSystemSchema: z.ZodObject<{
116
116
  accent: z.ZodOptional<z.ZodObject<{
117
117
  edge: z.ZodEnum<{
118
118
  left: "left";
119
- top: "top";
120
119
  bottom: "bottom";
120
+ top: "top";
121
121
  }>;
122
122
  colorToken: z.ZodString;
123
123
  thickness: z.ZodEnum<{
@@ -1,54 +1,23 @@
1
1
  /**
2
- * Core Button CSS Generator
2
+ * Small button emitter used by the SDK bridge.
3
3
  *
4
- * Pure functions for generating button CSS without requiring the full Theme type.
5
- * Used by both the full CMS theme system and the SDK theme bridge.
4
+ * The bridge deliberately has a smaller structural contract than a full CMS
5
+ * theme, but colour relationships still compile through the canonical button
6
+ * colour-state resolver.
6
7
  */
7
- export type ButtonBackgroundType = 'solid' | 'transparent' | 'gradient';
8
+ import type { ExpandedPalette } from '../palette/expandPalette';
9
+ import { type ButtonColourTreatment } from './types';
8
10
  export interface ButtonVariantCore {
9
- /** Unique variant identifier (e.g., 'primary', 'secondary') */
10
- id: string;
11
- /** Background style */
12
- background: ButtonBackgroundType;
13
- /** Background color token for solid backgrounds (e.g., 'primary') */
14
- backgroundToken?: string;
15
- /** Gradient stops for gradient backgrounds */
16
- gradientStops?: string[];
17
- /** Gradient direction for gradient backgrounds */
18
- gradientDirection?: 'to-r' | 'to-l' | 'to-t' | 'to-b' | 'to-tr' | 'to-tl' | 'to-br' | 'to-bl';
19
- /** Text color token */
20
- textToken: string;
21
- /** Border color token (for outline style) */
22
- borderToken?: string;
23
- /** Border width */
24
- borderWidth?: 'none' | 'thin' | 'medium' | 'thick';
11
+ readonly id: string;
12
+ readonly treatment: ButtonColourTreatment;
13
+ readonly borderWidth?: 'none' | 'thin' | 'medium' | 'thick';
25
14
  }
26
15
  export interface ButtonCoreSettings {
27
- /** Corner radius style */
28
- corners: 'square' | 'soft' | 'rounded' | 'pill';
29
- /** Shadow intensity */
30
- shadow: 'none' | 'low' | 'medium' | 'high';
31
- /** Default border width for variants with borders */
32
- borderWidth: 'none' | 'thin' | 'medium' | 'thick';
33
- /** Font weight */
34
- fontWeight?: number;
35
- /** Text transform */
36
- textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
16
+ readonly corners: 'square' | 'soft' | 'rounded' | 'pill';
17
+ readonly shadow: 'none' | 'low' | 'medium' | 'high';
18
+ readonly borderWidth: 'none' | 'thin' | 'medium' | 'thick';
19
+ readonly fontWeight?: number;
20
+ readonly textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';
37
21
  }
38
- /**
39
- * Generate button CSS from core variant definitions.
40
- *
41
- * This is a pure function with no dependencies on Theme type.
42
- * It generates CSS that uses rgb(var(--tb-{token})) for colors.
43
- *
44
- * @param scopeId - Theme scope ID for selector (e.g., 'sdk' -> [data-theme-scope="sdk"])
45
- * @param variants - Button variant definitions
46
- * @param settings - Global button settings
47
- * @returns CSS string
48
- */
49
- export declare function generateButtonCoreCss(scopeId: string, variants: ButtonVariantCore[], settings: ButtonCoreSettings): string;
50
- /**
51
- * Get default button variants for SDK usage.
52
- * These create primary, secondary, outline, and ghost buttons.
53
- */
22
+ export declare function generateButtonCoreCss(scopeId: string, variants: readonly ButtonVariantCore[], settings: ButtonCoreSettings, palette: ExpandedPalette): string;
54
23
  export declare function getDefaultButtonVariants(): ButtonVariantCore[];
@@ -0,0 +1,147 @@
1
+ export type ButtonUnsupportedEffectReason = 'alpha_requires_surface' | 'changes_foreground' | 'changes_border' | 'changes_element_opacity' | 'unresolved_background_overlay' | 'not_button_effect';
2
+ export type ButtonEffectPolicy = Readonly<{
3
+ classification: 'colour-transition';
4
+ transition: Readonly<{
5
+ kind: 'adjust-shade';
6
+ direction: 'darker' | 'lighter';
7
+ }> | Readonly<{
8
+ kind: 'replace-background';
9
+ }>;
10
+ }> | Readonly<{
11
+ classification: 'non-colour';
12
+ }> | Readonly<{
13
+ classification: 'unsupported-colour' | 'unsupported-background-overlay' | 'not-button';
14
+ reason: ButtonUnsupportedEffectReason;
15
+ }>;
16
+ export type ButtonEffectClassification = ButtonEffectPolicy['classification'] | 'unknown';
17
+ /**
18
+ * Exhaustive live policy for every registered effect id.
19
+ *
20
+ * The resolver consumes the transition payload directly, so adding an effect
21
+ * cannot update classification without also defining its runtime behavior.
22
+ */
23
+ export declare const BUTTON_EFFECT_POLICIES: {
24
+ readonly 'darken-background': {
25
+ readonly classification: "colour-transition";
26
+ readonly transition: {
27
+ readonly kind: "adjust-shade";
28
+ readonly direction: "darker";
29
+ };
30
+ };
31
+ readonly 'lighten-background': {
32
+ readonly classification: "colour-transition";
33
+ readonly transition: {
34
+ readonly kind: "adjust-shade";
35
+ readonly direction: "lighter";
36
+ };
37
+ };
38
+ readonly 'background-on-hover': {
39
+ readonly classification: "colour-transition";
40
+ readonly transition: {
41
+ readonly kind: "replace-background";
42
+ };
43
+ };
44
+ readonly 'background-on-hover-alpha': {
45
+ readonly classification: "unsupported-colour";
46
+ readonly reason: "alpha_requires_surface";
47
+ };
48
+ readonly 'fade-background': {
49
+ readonly classification: "unsupported-colour";
50
+ readonly reason: "changes_element_opacity";
51
+ };
52
+ readonly 'opacity-reduce': {
53
+ readonly classification: "unsupported-colour";
54
+ readonly reason: "changes_element_opacity";
55
+ };
56
+ readonly 'gradient-text': {
57
+ readonly classification: "unsupported-colour";
58
+ readonly reason: "changes_foreground";
59
+ };
60
+ readonly 'text-color-change': {
61
+ readonly classification: "unsupported-colour";
62
+ readonly reason: "changes_foreground";
63
+ };
64
+ readonly 'border-color-change': {
65
+ readonly classification: "unsupported-colour";
66
+ readonly reason: "changes_border";
67
+ };
68
+ readonly 'aurora-glow': {
69
+ readonly classification: "unsupported-background-overlay";
70
+ readonly reason: "unresolved_background_overlay";
71
+ };
72
+ readonly 'cosmic-stardust': {
73
+ readonly classification: "unsupported-background-overlay";
74
+ readonly reason: "unresolved_background_overlay";
75
+ };
76
+ readonly 'gradient-border-fill': {
77
+ readonly classification: "unsupported-background-overlay";
78
+ readonly reason: "unresolved_background_overlay";
79
+ };
80
+ readonly 'animated-gradient-border-fill': {
81
+ readonly classification: "unsupported-background-overlay";
82
+ readonly reason: "unresolved_background_overlay";
83
+ };
84
+ readonly 'nav-underline': {
85
+ readonly classification: "not-button";
86
+ readonly reason: "not_button_effect";
87
+ };
88
+ readonly 'nav-frosted-base': {
89
+ readonly classification: "not-button";
90
+ readonly reason: "not_button_effect";
91
+ };
92
+ readonly 'nav-frosted-hover': {
93
+ readonly classification: "not-button";
94
+ readonly reason: "not_button_effect";
95
+ };
96
+ readonly 'nav-frosted-active': {
97
+ readonly classification: "not-button";
98
+ readonly reason: "not_button_effect";
99
+ };
100
+ readonly 'animated-gradient': {
101
+ readonly classification: "non-colour";
102
+ };
103
+ readonly 'border-glow': {
104
+ readonly classification: "non-colour";
105
+ };
106
+ readonly 'drop-shadow': {
107
+ readonly classification: "non-colour";
108
+ };
109
+ readonly 'inner-shadow': {
110
+ readonly classification: "non-colour";
111
+ };
112
+ readonly 'neumorphic-shadow': {
113
+ readonly classification: "non-colour";
114
+ };
115
+ readonly 'outer-glow': {
116
+ readonly classification: "non-colour";
117
+ };
118
+ readonly 'retro-3d-shadow': {
119
+ readonly classification: "non-colour";
120
+ };
121
+ readonly 'scale-up': {
122
+ readonly classification: "non-colour";
123
+ };
124
+ readonly 'scale-down': {
125
+ readonly classification: "non-colour";
126
+ };
127
+ readonly lift: {
128
+ readonly classification: "non-colour";
129
+ };
130
+ readonly 'press-down': {
131
+ readonly classification: "non-colour";
132
+ };
133
+ readonly pop: {
134
+ readonly classification: "non-colour";
135
+ };
136
+ readonly 'border-bottom-grow': {
137
+ readonly classification: "non-colour";
138
+ };
139
+ readonly 'sketchy-border': {
140
+ readonly classification: "non-colour";
141
+ };
142
+ readonly 'pulse-animation': {
143
+ readonly classification: "non-colour";
144
+ };
145
+ };
146
+ export declare function getButtonEffectPolicy(effectId: string): ButtonEffectPolicy | null;
147
+ export declare function classifyButtonEffectId(effectId: string): ButtonEffectClassification;
@@ -1,5 +1,4 @@
1
1
  import type { TokenResolver } from '../../tokens/resolver';
2
- import type { ButtonPreset } from '../presets/types';
3
2
  import type { ButtonVariant } from '../types';
4
3
  import type { Theme } from '../../schema';
5
4
  import type { InteractiveElementConfig } from '../../interactive/types';
@@ -39,7 +38,7 @@ export interface EffectContext {
39
38
  /** User-provided customization options */
40
39
  options: Record<string, unknown>;
41
40
  /** Element configuration (access to background, colors, etc.) */
42
- buttonConfig: ButtonVariant | ButtonPreset | InteractiveElementConfig;
41
+ buttonConfig: ButtonVariant | InteractiveElementConfig;
43
42
  /** Token resolver for converting tokens to CSS vars */
44
43
  tokens: TokenResolver;
45
44
  /** Theme configuration (for accessing theme-level settings like shadows) */
@@ -127,7 +126,7 @@ export interface EffectPreset {
127
126
  * @param buttonConfig - Button configuration (ButtonVariant or ButtonPreset)
128
127
  * @returns True if effect can be applied to this button
129
128
  */
130
- isApplicable?: (buttonConfig: ButtonVariant | ButtonPreset) => boolean;
129
+ isApplicable?: (buttonConfig: ButtonVariant | InteractiveElementConfig) => boolean;
131
130
  }
132
131
  /**
133
132
  * Reference to an effect preset with customization options
@@ -1,5 +1,5 @@
1
1
  import type { Theme } from '../schema';
2
- import type { ButtonSystem } from './types';
2
+ import { type ButtonSystem } from './types';
3
3
  /**
4
4
  * Generate default button system from theme settings.
5
5
  *
@@ -6,6 +6,7 @@
6
6
  export * from './types';
7
7
  export * from './classNames';
8
8
  export * from './generateButtonCss';
9
+ export * from './resolveButtonColourStates';
9
10
  export * from './affordanceIcons';
10
11
  export * from './generateDefaultButtonSystem';
11
12
  export * from './constants';
@@ -20,6 +20,17 @@ export declare const buttonPersonalities: readonly [Readonly<{
20
20
  era: import("../../../../blocks/src/index").StyleEra;
21
21
  }>>>;
22
22
  buttonSystem: import("../../../../blocks/src/index").ButtonSystem;
23
+ }>, Readonly<{
24
+ id: ButtonPersonalityId<"two-tone-pill">;
25
+ name: string;
26
+ description: string;
27
+ tags: Readonly<Partial<Readonly<{
28
+ tone: import("../../../../blocks/src/index").StyleTone;
29
+ energy: import("../../../../blocks/src/index").StyleEnergy;
30
+ motion: import("../../../../blocks/src/index").StyleMotion;
31
+ era: import("../../../../blocks/src/index").StyleEra;
32
+ }>>>;
33
+ buttonSystem: import("../../../../blocks/src/index").ButtonSystem;
23
34
  }>, Readonly<{
24
35
  id: ButtonPersonalityId<"earth-pill">;
25
36
  name: string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Two-tone Pill keeps Soft Pill's shape, spacing, typography, and motion while
3
+ * giving secondary actions their own solid palette role. The derived
4
+ * `onSecondary` token keeps the label legible as the site's palette changes.
5
+ */
6
+ export declare const twoTonePill: Readonly<{
7
+ id: import("./types").ButtonPersonalityId<"two-tone-pill">;
8
+ name: string;
9
+ description: string;
10
+ tags: Readonly<Partial<Readonly<{
11
+ tone: import("../../../../blocks/src/index").StyleTone;
12
+ energy: import("../../../../blocks/src/index").StyleEnergy;
13
+ motion: import("../../../../blocks/src/index").StyleMotion;
14
+ era: import("../../../../blocks/src/index").StyleEra;
15
+ }>>>;
16
+ buttonSystem: import("../../../../blocks/src/index").ButtonSystem;
17
+ }>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { type ButtonSystem } from '../types';
2
+ import { type ButtonColourTreatment, type ButtonGlobalSettings, type ButtonSystem, type ButtonVariant } from '../types';
3
3
  import { type StyleTags } from '../../site-styles/styleTags';
4
4
  /**
5
5
  * Branded ID for a button personality entry in the curated library.
@@ -46,13 +46,13 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
46
46
  era: z.ZodOptional<z.ZodEnum<{
47
47
  editorial: "editorial";
48
48
  modern: "modern";
49
- retro: "retro";
50
- technical: "technical";
51
49
  organic: "organic";
50
+ technical: "technical";
51
+ retro: "retro";
52
52
  }>>;
53
53
  }, z.core.$strip>;
54
54
  buttonSystem: z.ZodObject<{
55
- global: z.ZodObject<{
55
+ global: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
56
56
  cornerStyle: z.ZodEnum<{
57
57
  square: "square";
58
58
  rounded: "rounded";
@@ -74,8 +74,8 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
74
74
  fontWeight: z.ZodUnion<readonly [z.ZodLiteral<500>, z.ZodLiteral<600>, z.ZodLiteral<700>]>;
75
75
  borderWidth: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
76
76
  typography: z.ZodOptional<z.ZodEnum<{
77
- body: "body";
78
77
  heading: "heading";
78
+ body: "body";
79
79
  }>>;
80
80
  fontSize: z.ZodOptional<z.ZodString>;
81
81
  letterSpacing: z.ZodOptional<z.ZodEnum<{
@@ -102,7 +102,7 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
102
102
  darken: "darken";
103
103
  saturate: "saturate";
104
104
  }>;
105
- hoverColorToken: z.ZodOptional<z.ZodString>;
105
+ hoverColorToken: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("..").OpaqueButtonColourToken, string>>>;
106
106
  gradientStyle: z.ZodOptional<z.ZodEnum<{
107
107
  linear: "linear";
108
108
  radial: "radial";
@@ -114,18 +114,18 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
114
114
  hard: "hard";
115
115
  smooth: "smooth";
116
116
  }>>;
117
- }, z.core.$strip>;
118
- variants: z.ZodArray<z.ZodObject<{
117
+ }, z.core.$strip>>;
118
+ variants: z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
119
119
  id: z.ZodString;
120
120
  name: z.ZodString;
121
121
  enabled: z.ZodBoolean;
122
122
  priority: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
123
123
  background: z.ZodDiscriminatedUnion<[z.ZodObject<{
124
124
  type: z.ZodLiteral<"solid">;
125
- colorToken: z.ZodString;
125
+ colorToken: z.ZodPipe<z.ZodString, z.ZodTransform<import("..").OpaqueButtonColourToken, string>>;
126
126
  }, z.core.$strip>, z.ZodObject<{
127
127
  type: z.ZodLiteral<"gradient">;
128
- stops: z.ZodArray<z.ZodString>;
128
+ stops: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("..").OpaqueButtonColourToken, string>>>, z.ZodTransform<[import("..").OpaqueButtonColourToken, import("..").OpaqueButtonColourToken, ...import("..").OpaqueButtonColourToken[]], import("..").OpaqueButtonColourToken[]>>;
129
129
  direction: z.ZodEnum<{
130
130
  "to-r": "to-r";
131
131
  "to-l": "to-l";
@@ -136,10 +136,11 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
136
136
  "to-br": "to-br";
137
137
  "to-bl": "to-bl";
138
138
  }>;
139
+ foregroundToken: z.ZodPipe<z.ZodString, z.ZodTransform<import("..").OpaqueButtonColourToken, string>>;
139
140
  }, z.core.$strip>, z.ZodObject<{
140
- type: z.ZodLiteral<"transparent">;
141
+ type: z.ZodLiteral<"surface">;
142
+ role: z.ZodLiteral<"link">;
141
143
  }, z.core.$strip>], "type">;
142
- textColorToken: z.ZodString;
143
144
  borderRadius: z.ZodOptional<z.ZodString>;
144
145
  shadow: z.ZodOptional<z.ZodObject<{
145
146
  elevation: z.ZodEnum<{
@@ -161,26 +162,13 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
161
162
  }, z.core.$strip>>;
162
163
  border: z.ZodOptional<z.ZodObject<{
163
164
  widthClass: z.ZodString;
164
- colorToken: z.ZodString;
165
165
  }, z.core.$strip>>;
166
- hoverBackgroundToken: z.ZodOptional<z.ZodString>;
166
+ hoverBackgroundToken: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("..").OpaqueButtonColourToken, string>>>;
167
167
  effects: z.ZodOptional<z.ZodObject<{
168
- base: z.ZodOptional<z.ZodArray<z.ZodObject<{
169
- effectId: z.ZodString;
170
- options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
171
- }, z.core.$strip>>>;
172
- hover: z.ZodOptional<z.ZodArray<z.ZodObject<{
173
- effectId: z.ZodString;
174
- options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
175
- }, z.core.$strip>>>;
176
- active: z.ZodOptional<z.ZodArray<z.ZodObject<{
177
- effectId: z.ZodString;
178
- options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
179
- }, z.core.$strip>>>;
180
- focus: z.ZodOptional<z.ZodArray<z.ZodObject<{
181
- effectId: z.ZodString;
182
- options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
183
- }, z.core.$strip>>>;
168
+ base: z.ZodOptional<z.ZodArray<z.ZodType<import("../../../../blocks/src/index").EffectApplication, unknown, z.core.$ZodTypeInternals<import("../../../../blocks/src/index").EffectApplication, unknown>>>>;
169
+ hover: z.ZodOptional<z.ZodArray<z.ZodType<import("../../../../blocks/src/index").EffectApplication, unknown, z.core.$ZodTypeInternals<import("../../../../blocks/src/index").EffectApplication, unknown>>>>;
170
+ active: z.ZodOptional<z.ZodArray<z.ZodType<import("../../../../blocks/src/index").EffectApplication, unknown, z.core.$ZodTypeInternals<import("../../../../blocks/src/index").EffectApplication, unknown>>>>;
171
+ focus: z.ZodOptional<z.ZodArray<z.ZodType<import("../../../../blocks/src/index").EffectApplication, unknown, z.core.$ZodTypeInternals<import("../../../../blocks/src/index").EffectApplication, unknown>>>>;
184
172
  }, z.core.$strip>>;
185
173
  sizes: z.ZodOptional<z.ZodObject<{
186
174
  sm: z.ZodOptional<z.ZodObject<{
@@ -202,9 +190,8 @@ export declare const buttonPersonalitySchema: z.ZodObject<{
202
190
  }, z.core.$strip>>;
203
191
  affordance: z.ZodOptional<z.ZodObject<{
204
192
  iconId: z.ZodString;
205
- colorToken: z.ZodOptional<z.ZodString>;
206
193
  }, z.core.$strip>>;
207
- }, z.core.$strip>>;
194
+ }, z.core.$strip>>>;
208
195
  sizes: z.ZodOptional<z.ZodPipe<z.ZodObject<{
209
196
  sm: z.ZodObject<{
210
197
  padding: z.ZodString;
@@ -269,5 +256,30 @@ export declare function defineButtonPersonality<const TId extends string>(input:
269
256
  name: string;
270
257
  description: string;
271
258
  tags: StyleTags;
272
- buttonSystem: ButtonSystem;
259
+ buttonSystem: ButtonSystemAuthoringInput;
273
260
  }): ButtonPersonality<ButtonPersonalityId<TId>>;
261
+ type ButtonColourTreatmentAuthoringInput = Readonly<{
262
+ type: 'solid';
263
+ colorToken: string;
264
+ }> | Readonly<{
265
+ type: 'gradient';
266
+ stops: readonly [string, string, ...string[]];
267
+ direction: Extract<ButtonColourTreatment, {
268
+ type: 'gradient';
269
+ }>['direction'];
270
+ foregroundToken: string;
271
+ }> | Extract<ButtonColourTreatment, {
272
+ type: 'surface';
273
+ }>;
274
+ type ButtonVariantAuthoringInput = Omit<ButtonVariant, 'background' | 'hoverBackgroundToken'> & Readonly<{
275
+ background: ButtonColourTreatmentAuthoringInput;
276
+ hoverBackgroundToken?: string;
277
+ }>;
278
+ type ButtonGlobalSettingsAuthoringInput = Omit<ButtonGlobalSettings, 'hoverColorToken'> & Readonly<{
279
+ hoverColorToken?: string;
280
+ }>;
281
+ type ButtonSystemAuthoringInput = Omit<ButtonSystem, 'global' | 'variants'> & Readonly<{
282
+ global: ButtonGlobalSettingsAuthoringInput;
283
+ variants: readonly ButtonVariantAuthoringInput[];
284
+ }>;
285
+ export {};
@@ -1,43 +1,22 @@
1
1
  import type { ButtonSystem } from './types';
2
- /**
3
- * Button Preset
4
- *
5
- * A preset is a complete ButtonSystem configuration (global settings + variants)
6
- * that users can select to quickly style their site's buttons.
7
- */
8
2
  export interface ButtonPreset {
9
3
  id: string;
10
4
  name: string;
11
5
  description: string;
12
6
  category: 'modern' | 'retro' | 'minimal' | 'artistic' | 'technical';
13
7
  buttonSystem: ButtonSystem;
14
- /**
15
- * Theme compatibility metadata
16
- *
17
- * Defines which theme characteristics work well with this preset.
18
- * Used for intelligent filtering to show only contextually appropriate presets.
19
- */
20
8
  compatibility?: {
21
- /** Which palette modes work well (undefined = works with both) */
22
9
  modes?: ('light' | 'dark')[];
23
- /** Which tone axes match (undefined = works with all) */
24
10
  tones?: ('minimal' | 'classic' | 'bold')[];
25
- /** Which energy levels match (undefined = works with all) */
26
11
  energies?: ('calm' | 'vibrant')[];
27
12
  };
28
13
  }
29
14
  /**
30
- * Button Presets Library
31
- *
32
- * Curated collection of button system configurations extracted from
33
- * button experiments and design explorations.
15
+ * The dashboard gallery and generated site styles now share the same curated
16
+ * button definitions. The former experiment-era preset catalogue duplicated
17
+ * colour choices and effect emitters, so it could drift outside the canonical
18
+ * colour contract.
34
19
  */
35
20
  export declare const buttonPresets: ButtonPreset[];
36
- /**
37
- * Get preset by ID
38
- */
39
21
  export declare function getPresetById(id: string): ButtonPreset | undefined;
40
- /**
41
- * Get presets by category
42
- */
43
22
  export declare function getPresetsByCategory(category: ButtonPreset['category']): ButtonPreset[];
@@ -0,0 +1,100 @@
1
+ import type { ExpandedPalette } from '../palette/expandPalette';
2
+ import type { ButtonColourTreatment, ButtonGlobalSettings, ButtonVariant, OpaqueButtonColourToken, VariantEffects } from './types';
3
+ import { type ButtonUnsupportedEffectReason } from './effectClassification';
4
+ export { classifyButtonEffectId, type ButtonEffectClassification, } from './effectClassification';
5
+ export declare const BUTTON_VISUAL_STATES: readonly ["base", "hover", "focus", "active", "disabled"];
6
+ export type ButtonVisualState = (typeof BUTTON_VISUAL_STATES)[number];
7
+ export declare const BUTTON_CONTRAST_POLICY: {
8
+ readonly textMinimumRatio: 4.5;
9
+ readonly nonTextMinimumRatio: 3;
10
+ readonly gradientSamplesPerSegment: 20;
11
+ readonly alphaBackgrounds: "reject-without-known-surface";
12
+ readonly disabled: "retain-full-colour-contract";
13
+ };
14
+ export type ButtonColourContractError = Readonly<{
15
+ tag: 'unknown_palette_token';
16
+ variantId: string;
17
+ state: ButtonVisualState;
18
+ token: OpaqueButtonColourToken;
19
+ }> | Readonly<{
20
+ tag: 'missing_on_colour';
21
+ variantId: string;
22
+ state: ButtonVisualState;
23
+ backgroundToken: OpaqueButtonColourToken;
24
+ foregroundToken: OpaqueButtonColourToken;
25
+ }> | Readonly<{
26
+ tag: 'insufficient_contrast';
27
+ variantId: string;
28
+ state: ButtonVisualState;
29
+ background: string;
30
+ foreground: string;
31
+ ratio: number;
32
+ requiredRatio: number;
33
+ }> | Readonly<{
34
+ tag: 'unsupported_colour_effect';
35
+ variantId: string;
36
+ state: ButtonVisualState;
37
+ effectId: string;
38
+ reason: ButtonUnsupportedEffectReason;
39
+ }> | Readonly<{
40
+ tag: 'invalid_colour_effect_options';
41
+ variantId: string;
42
+ state: ButtonVisualState;
43
+ effectId: string;
44
+ option: string;
45
+ }> | Readonly<{
46
+ tag: 'inapplicable_colour_effect';
47
+ variantId: string;
48
+ state: ButtonVisualState;
49
+ effectId: string;
50
+ treatment: ButtonColourTreatment['type'];
51
+ }> | Readonly<{
52
+ tag: 'unknown_button_effect';
53
+ variantId: string;
54
+ state: ButtonVisualState;
55
+ effectId: string;
56
+ }>;
57
+ export type ResolvedButtonColour = Readonly<{
58
+ kind: 'solid';
59
+ backgroundToken: OpaqueButtonColourToken;
60
+ foregroundToken: OpaqueButtonColourToken;
61
+ backgroundCss: string;
62
+ foregroundCss: string;
63
+ }> | Readonly<{
64
+ kind: 'gradient';
65
+ backgroundTokens: readonly [OpaqueButtonColourToken, OpaqueButtonColourToken, ...OpaqueButtonColourToken[]];
66
+ foregroundToken: OpaqueButtonColourToken;
67
+ backgroundCss: string;
68
+ foregroundCss: string;
69
+ }> | Readonly<{
70
+ kind: 'surface';
71
+ role: 'link';
72
+ backgroundCss: 'transparent';
73
+ foregroundCss: string;
74
+ }>;
75
+ export type ResolvedButtonColourStates = Readonly<Record<ButtonVisualState, ResolvedButtonColour>>;
76
+ export type ResolvedButtonFocusIndicator = Readonly<{
77
+ kind: 'two-tone';
78
+ innerCss: string;
79
+ outerCss: string;
80
+ minimumPairContrast: number;
81
+ }> | Readonly<{
82
+ kind: 'surface-role';
83
+ colorCss: string;
84
+ minimumSurfaceContrast: number;
85
+ }>;
86
+ export type ButtonColourContractResult = Readonly<{
87
+ ok: true;
88
+ states: ResolvedButtonColourStates;
89
+ focusIndicator: ResolvedButtonFocusIndicator;
90
+ nonColourEffects: VariantEffects;
91
+ }> | Readonly<{
92
+ ok: false;
93
+ error: ButtonColourContractError;
94
+ }>;
95
+ export declare function compileButtonColourStates(input: Readonly<{
96
+ variant: ButtonVariant;
97
+ global: ButtonGlobalSettings;
98
+ palette: ExpandedPalette;
99
+ }>): ButtonColourContractResult;
100
+ export declare function formatButtonColourContractError(error: ButtonColourContractError): string;
@@ -0,0 +1,16 @@
1
+ import type { ResolvedButtonColour, ResolvedButtonFocusIndicator } from './resolveButtonColourStates';
2
+ export type ButtonCssDeclaration = readonly [property: string, value: string];
3
+ /**
4
+ * Canonical colour declaration mapping shared by full themes and ThemeBridge.
5
+ * Both background properties are always emitted so transitions cannot retain
6
+ * a stale gradient or solid layer.
7
+ */
8
+ export declare function resolvedButtonColourDeclarations(colour: ResolvedButtonColour): readonly ButtonCssDeclaration[];
9
+ export declare function resolvedButtonFocusDeclarations(indicator: ResolvedButtonFocusIndicator): readonly ButtonCssDeclaration[];
10
+ /**
11
+ * Disabled buttons retain their validated colour pair and add a non-layout
12
+ * visual affordance. `currentColor` keeps the cue inside the same contrast
13
+ * relationship, while retaining pointer events lets the not-allowed cursor
14
+ * remain observable.
15
+ */
16
+ export declare const RESOLVED_BUTTON_DISABLED_DECLARATIONS: readonly ButtonCssDeclaration[];