@riverbankcms/sdk 0.108.0 → 0.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -1
- package/dist/{PreviewEditorSidebar-BBT-kZAM.mjs → PreviewEditorSidebar-DWqwfy3_.mjs} +7 -22
- package/dist/{PreviewEditorUI-D69xNKT2.mjs → PreviewEditorUI-B7OL4sfR.mjs} +3 -3
- package/dist/{PreviewQueryProvider-RRu7wyQ5.mjs → PreviewQueryProvider-D0y2l8JN.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-CuDjXH6o.mjs → SdkPreviewModeRuntime-D8Gt9Gbe.mjs} +212 -153
- package/dist/{SiteChromeCustomizeContext-BQUY2dEk.mjs → SiteChromeCustomizeContext-DUpalEdL.mjs} +1919 -1032
- package/dist/_dts/ai/src/contracts/proposals.d.ts +11244 -10741
- package/dist/_dts/api/src/bookingAdjustments.d.ts +5 -0
- package/dist/_dts/api/src/bookingOperations.d.ts +4 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +2 -17
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +6 -6
- package/dist/_dts/api/src/common/envelope.d.ts +7 -0
- package/dist/_dts/api/src/courses.d.ts +1 -0
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/endpoints.d.ts +35 -0
- package/dist/_dts/api/src/index.d.ts +2 -2
- package/dist/_dts/api/src/participantMessaging.d.ts +18 -12
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +1 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +247 -1
- package/dist/_dts/api/src/siteInfrastructure.d.ts +13 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +1 -5
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +29 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +33 -27
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientField.d.ts +9 -0
- package/dist/_dts/block-form/src/widgets/BackgroundGradientWidget/BackgroundGradientWidget.d.ts +3 -4
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -4
- package/dist/_dts/blocks/src/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/audio-player.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/body-text.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/course-registration.d.ts +1 -22
- package/dist/_dts/blocks/src/system/blocks/cta-full.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +1 -22
- package/dist/_dts/blocks/src/system/blocks/file-download.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/form.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/site-header.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/testimonials.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/video-grid.d.ts +3 -0
- package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +16 -6
- package/dist/_dts/blocks/src/system/defineBlock.d.ts +9 -1
- package/dist/_dts/blocks/src/system/fields/ctas.d.ts +8 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +31 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +1 -1
- package/dist/_dts/content-model/src/content-types/entryValidation.d.ts +31 -0
- package/dist/_dts/content-model/src/content-types/scaffold.d.ts +58 -0
- package/dist/_dts/content-model/src/content-types/sentinels.d.ts +36 -0
- package/dist/_dts/content-model/src/index.d.ts +3 -0
- package/dist/_dts/core/src/booking-date-time.d.ts +8 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +3071 -3157
- package/dist/_dts/media-core/src/fileMimeDetection.d.ts +16 -0
- package/dist/_dts/media-core/src/fileStorage.d.ts +8 -0
- package/dist/_dts/media-core/src/storagePathDomain.d.ts +2 -0
- package/dist/_dts/media-core/src/uploadVerificationContract.d.ts +3 -0
- package/dist/_dts/preview-next/src/client/blocks/BlockToolbar.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/audit.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/compare.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/deploy.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/drafts.d.ts +18 -0
- package/dist/_dts/sdk/src/cli/commands/entry.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/commands/init-docs.d.ts +2 -2
- package/dist/_dts/sdk/src/cli/commands/publish-all.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/pull.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/push/execute/diff.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/commands/push/options.d.ts +3 -0
- package/dist/_dts/sdk/src/cli/commands/push-execute.d.ts +12 -1
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/commands/verify.d.ts +1 -0
- package/dist/_dts/sdk/src/cli/helpers.d.ts +22 -1
- package/dist/_dts/sdk/src/cli/index.d.ts +4 -0
- package/dist/_dts/sdk/src/cli/output.d.ts +88 -0
- package/dist/_dts/sdk/src/cli/program.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/push-config.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/catalog.d.ts +10 -0
- package/dist/_dts/sdk/src/client/management/http.d.ts +7 -1
- package/dist/_dts/sdk/src/client/management/index.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +43 -19
- package/dist/_dts/sdk/src/date-time/index.d.ts +68 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +893 -823
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/core.d.ts +15 -46
- package/dist/_dts/theme-core/src/buttons/effectClassification.d.ts +147 -0
- package/dist/_dts/theme-core/src/buttons/effects/types.d.ts +2 -3
- package/dist/_dts/theme-core/src/buttons/generateDefaultButtonSystem.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +44 -32
- package/dist/_dts/theme-core/src/buttons/presets.d.ts +4 -25
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +100 -0
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +16 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +101 -83
- package/dist/_dts/theme-core/src/cards/types.d.ts +16 -16
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/gradients/presets.d.ts +200 -8
- package/dist/_dts/theme-core/src/gradients/utils.d.ts +6 -2
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +87 -126
- package/dist/_dts/theme-core/src/mock-themes/modern-minimal.d.ts +1 -1
- package/dist/_dts/theme-core/src/navigation/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -2
- package/dist/_dts/theme-core/src/palette/curated/types.d.ts +5 -8
- package/dist/_dts/theme-core/src/palette/index.d.ts +0 -1
- package/dist/_dts/theme-core/src/schema.d.ts +112 -138
- package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +10 -10
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +3 -2
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +13 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +29 -8
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +2 -2
- package/dist/cli/index.mjs +67956 -66745
- package/dist/cli/init-docs/content/cli-reference.md +50 -7
- package/dist/cli/init-docs/content/content-management.md +7 -4
- package/dist/cli/init-docs/content/workflow-publish.md +5 -1
- package/dist/client/{DiscountCodeDisclosure-D6TOf6Hi.mjs → DiscountCodeDisclosure-DU1ygxU2.mjs} +1 -1
- package/dist/client/{EventCombined.client-Dao3zxRk.mjs → EventCombined.client-DB5zagCo.mjs} +3 -3
- package/dist/client/{EventListing.client-B2NNt4y1.mjs → EventListing.client-CTX9JHBL.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-BhwFo16w.mjs → LeafletStaticMap-BYImhgiB.mjs} +1 -1
- package/dist/client/{MagicLinkForm-BWnB7cMR.mjs → MagicLinkForm-CRkw_M3l.mjs} +2 -2
- package/dist/client/{StepIndicator-TzRiQ0BY.mjs → StepIndicator-BnmVBJJh.mjs} +2 -2
- package/dist/client/{accordion-BPy-AJ4_.mjs → accordion-CeGreumd.mjs} +1 -1
- package/dist/client/{bookingForm-BL4PGZds.mjs → bookingForm-CSzFNrpN.mjs} +6 -6
- package/dist/client/bookings.mjs +512 -252
- package/dist/client/{buttons-EBjyslaX.mjs → buttons-DoFV7KDL.mjs} +493 -230
- package/dist/client/{carousel-C2b7Cn9-.mjs → carousel-B2jDtogf.mjs} +1 -1
- package/dist/client/{cart-BQcbXIVD.mjs → cart-D-jZ-vaY.mjs} +3 -3
- package/dist/client/{checkout-DEmpGRJu.mjs → checkout-Dza-LA7N.mjs} +3 -3
- package/dist/client/client.mjs +1673 -785
- package/dist/client/{colorStyles-jZS6KfkP.mjs → colorStyles-CrgzoXsm.mjs} +1 -30
- package/dist/client/{courseRegistration-BqRZPmsq.mjs → courseRegistration-TYkNychb.mjs} +7 -7
- package/dist/client/{eventCalendar-B8N_tSl5.mjs → eventCalendar-BI_90SsT.mjs} +5 -5
- package/dist/client/{eventCombined-Gjn6gtq7.mjs → eventCombined-mNrpryE9.mjs} +2 -2
- package/dist/client/{eventDetails-M-VCxA-r.mjs → eventDetails-D4GVlCIY.mjs} +3 -3
- package/dist/client/{eventListing-DR19hqYi.mjs → eventListing-YhKN018y.mjs} +2 -2
- package/dist/client/{eventRegistration-BR02a0k3.mjs → eventRegistration-CdHGtilr.mjs} +7 -7
- package/dist/client/foregroundContract-xICPq59x.mjs +31 -0
- package/dist/client/{form-LY2xIbwg.mjs → form-AcAL45rA.mjs} +2 -2
- package/dist/client/{headerSection-CYwwXJfh.mjs → headerSection-uEC52ueD.mjs} +3 -3
- package/dist/client/hooks.mjs +890 -497
- package/dist/client/{locationMap-DWnBXrFq.mjs → locationMap-_wJDSUYe.mjs} +3 -3
- package/dist/client/{media-DHtSxS5V.mjs → media-BK0O3b-U.mjs} +3 -2
- package/dist/client/{newsletterForm-D9s-fQ2P.mjs → newsletterForm-DrArsb2B.mjs} +2 -2
- package/dist/client/{pricing-DDq80oYc.mjs → pricing-BSYVghwo.mjs} +1 -1
- package/dist/client/{productDetail-B0SbWd45.mjs → productDetail-Dyk90sMs.mjs} +3 -3
- package/dist/client/{productList-PwYlZn0y.mjs → productList-BCKThwAI.mjs} +3 -3
- package/dist/client/{propsDecoder-BRWBiH7i.mjs → propsDecoder-CkXxkdSR.mjs} +63 -24
- package/dist/client/rendering/client.mjs +1034 -486
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +1832 -760
- package/dist/client/{shop-CMwZPYME.mjs → shop-DeltVH10.mjs} +6 -6
- package/dist/client/{shop-commerce-BuxsFate.mjs → shop-commerce-BD9Jsm2Z.mjs} +6 -6
- package/dist/client/{shop-commerce-store-boYlEJ91.mjs → shop-commerce-store-CmXD6FDS.mjs} +1 -1
- package/dist/client/{shopShared-D2naaOes.mjs → shopShared-B8v-lH_F.mjs} +2 -2
- package/dist/client/{useDiscountCodeUi-D9RHpVoj.mjs → useDiscountCodeUi-DbWJN8ld.mjs} +1 -1
- package/dist/client/{useEventFilters-igGiK1re.mjs → useEventFilters-EJIMUnqT.mjs} +46 -69
- package/dist/client/{usePolling-CI7MbsFB.mjs → usePolling-Cmh14fc7.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +35 -0
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +35 -0
- package/dist/{previewAuthStore-a_cBD28m.mjs → previewAuthStore-CTO7CRPk.mjs} +35 -0
- package/dist/{sdk-runtime-MBzD-GmP.mjs → sdk-runtime-Dou0GAav.mjs} +2 -2
- package/dist/{separator-5ahRBC85.mjs → separator-CI5wZNXT.mjs} +1 -1
- package/dist/server/components.mjs +1832 -784
- package/dist/server/config-validation.mjs +890 -497
- package/dist/server/config.mjs +890 -497
- package/dist/server/data.mjs +890 -497
- package/dist/server/date-time.mjs +386 -0
- package/dist/server/index.mjs +36 -1
- package/dist/server/next.mjs +1868 -785
- package/dist/server/page-converter.mjs +849 -285
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1553 -718
- package/dist/server/rendering.mjs +1832 -784
- package/dist/server/routing.mjs +933 -522
- package/dist/server/server.mjs +929 -501
- package/dist/server/theme-bridge.mjs +1408 -392
- package/dist/server/theme.mjs +471 -228
- package/dist/styles/index.css +5 -0
- package/package.json +7 -1
- package/dist/_dts/theme-core/src/buttons/presets/types.d.ts +0 -88
- package/dist/_dts/theme-core/src/buttons/utils/contrast.d.ts +0 -38
- package/dist/_dts/theme-core/src/palette/themePaletteCompatibility.d.ts +0 -57
|
@@ -115,8 +115,8 @@ export declare const accordionSystemSchema: z.ZodObject<{
|
|
|
115
115
|
triggerColorToken: z.ZodOptional<z.ZodString>;
|
|
116
116
|
accent: z.ZodOptional<z.ZodObject<{
|
|
117
117
|
edge: z.ZodEnum<{
|
|
118
|
-
bottom: "bottom";
|
|
119
118
|
left: "left";
|
|
119
|
+
bottom: "bottom";
|
|
120
120
|
top: "top";
|
|
121
121
|
}>;
|
|
122
122
|
colorToken: z.ZodString;
|
|
@@ -1,54 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Small button emitter used by the SDK bridge.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
-
|
|
8
|
+
import type { ExpandedPalette } from '../palette/expandPalette';
|
|
9
|
+
import { type ButtonColourTreatment } from './types';
|
|
8
10
|
export interface ButtonVariantCore {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 |
|
|
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 |
|
|
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 { 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";
|
|
@@ -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<"
|
|
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.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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:
|
|
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
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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[];
|