@riverbankcms/sdk 0.60.3 → 0.60.7
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/dist/_dts/api/src/appointmentSetup.d.ts +2 -2
- package/dist/_dts/api/src/bookingConfig.d.ts +6 -0
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +45 -3
- package/dist/_dts/api/src/bookingOperations.d.ts +40 -3
- package/dist/_dts/api/src/bookingVerticals.d.ts +1 -0
- package/dist/_dts/api/src/courses.d.ts +1 -5
- package/dist/_dts/api/src/endpoints.d.ts +80 -1
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/navigation/contracts.d.ts +9 -9
- package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +15 -1
- package/dist/_dts/api/src/resources.d.ts +1 -1
- package/dist/_dts/api/src/siteBanner.d.ts +8 -8
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -39
- package/dist/_dts/api/src/siteOnboarding.d.ts +1 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +2 -0
- package/dist/_dts/api/src/teamMembers.d.ts +27 -0
- package/dist/_dts/blocks/src/system/blocks/courses/shared/schemas.d.ts +35 -29
- package/dist/_dts/blocks/src/system/blocks/courses/shared/types.d.ts +1 -5
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +40 -34
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -5
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/products/shared.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +9 -9
- package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +24 -0
- package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +18 -8
- package/dist/_dts/blocks/src/system/constants/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/utils.d.ts +1 -1
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +201 -201
- package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -2
- package/dist/_dts/blocks/src/system/node/fragments/ctaButton.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/schema.d.ts +5 -5
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/shared/themedButtonClass.d.ts +11 -0
- package/dist/_dts/blocks/src/system/transforms/registry/ui.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +3 -3
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +10 -2
- package/dist/_dts/content-model/src/content-types/schema.d.ts +8 -8
- package/dist/_dts/content-model/src/metadataConfig.d.ts +1 -0
- package/dist/_dts/core/src/branded.d.ts +2 -0
- package/dist/_dts/core/src/participants.d.ts +32 -1
- package/dist/_dts/core/src/rectification.d.ts +79 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +130 -14
- package/dist/_dts/db/src/schemas/forms.d.ts +61 -61
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +17 -15
- package/dist/_dts/sdk/src/client/types.d.ts +10 -2
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +40 -37
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +17 -8
- package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +19 -19
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +87 -69
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -5
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/accordions/types.d.ts +11 -11
- package/dist/_dts/theme-core/src/buttons/personalities/brushed-wash.d.ts +7 -2
- package/dist/_dts/theme-core/src/buttons/personalities/confident-chip.d.ts +7 -2
- package/dist/_dts/theme-core/src/buttons/personalities/editorial-link.d.ts +7 -2
- package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +86 -5
- package/dist/_dts/theme-core/src/buttons/personalities/ink-stamp.d.ts +7 -2
- package/dist/_dts/theme-core/src/buttons/personalities/pebble.d.ts +7 -2
- package/dist/_dts/theme-core/src/buttons/personalities/soft-pill.d.ts +7 -2
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +20 -20
- package/dist/_dts/theme-core/src/buttons/types.d.ts +27 -27
- package/dist/_dts/theme-core/src/cards/types.d.ts +17 -17
- package/dist/_dts/theme-core/src/inputs/types.d.ts +14 -14
- package/dist/_dts/theme-core/src/interactive/baseSchema.d.ts +2 -2
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +438 -438
- package/dist/_dts/theme-core/src/navigation/types.d.ts +16 -16
- package/dist/_dts/theme-core/src/palette/variants/brand-led.d.ts +33 -9
- package/dist/_dts/theme-core/src/palette/variants/high-contrast.d.ts +33 -9
- package/dist/_dts/theme-core/src/palette/variants/index.d.ts +200 -4
- package/dist/_dts/theme-core/src/palette/variants/soft-natural.d.ts +33 -9
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +25 -25
- package/dist/_dts/theme-core/src/palette/variants/warm-neutral.d.ts +33 -9
- package/dist/_dts/theme-core/src/schema.d.ts +662 -662
- package/dist/_dts/theme-core/src/shared/componentStyles.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/curatedChoices.d.ts +27 -0
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +48 -194
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +15 -15
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +7 -7
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +2 -1
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +12 -14
- package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +46 -0
- package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +5 -5
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/button-group.d.ts +1 -1
- package/dist/_dts/ui/src/button.d.ts +2 -2
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/_dts/ui/src/card.d.ts +1 -1
- package/dist/_dts/ui/src/palette/ColorChooserDialog.d.ts +47 -0
- package/dist/_dts/ui/src/palette/ColorSlotButton.d.ts +15 -0
- package/dist/_dts/ui/src/palette/ColorSwatchButton.d.ts +15 -0
- package/dist/_dts/ui/src/palette/PaletteTokenEditor.d.ts +50 -0
- package/dist/_dts/ui/src/palette/hex.d.ts +23 -0
- package/dist/_dts/ui/src/palette/index.d.ts +14 -0
- package/dist/_dts/ui/src/surface.d.ts +2 -2
- package/dist/_dts/ui/src/toggle.d.ts +4 -4
- package/dist/cli/index.mjs +1535 -1183
- package/dist/client/client.mjs +3944 -3454
- package/dist/client/hooks.mjs +2053 -1743
- package/dist/client/rendering/client.mjs +311 -167
- package/dist/client/rendering/islands.mjs +159 -73
- package/dist/client/rendering.mjs +1918 -1447
- package/dist/preview-next/before-render.mjs +147 -1
- package/dist/preview-next/client/runtime.mjs +2828 -2174
- package/dist/preview-next/middleware.mjs +147 -1
- package/dist/server/components.mjs +4311 -3928
- package/dist/server/config-validation.mjs +2201 -1906
- package/dist/server/config.mjs +2201 -1906
- package/dist/server/data.mjs +2053 -1743
- package/dist/server/index.mjs +171 -4
- package/dist/server/next.mjs +3442 -3024
- package/dist/server/page-converter.mjs +2109 -1962
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4021 -3622
- package/dist/server/rendering.mjs +4021 -3622
- package/dist/server/routing.mjs +2377 -2058
- package/dist/server/server.mjs +2244 -1915
- package/dist/server/theme-bridge.mjs +130 -126
- package/dist/server/theme.mjs +131 -129
- package/package.json +1 -1
- package/dist/_dts/theme-core/src/site-styles/compatibility.d.ts +0 -109
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Descriptive style-axis metadata for button personalities and palette
|
|
4
|
+
* variants. Site Style picker shape is curated explicitly; these tags remain
|
|
5
|
+
* for catalog audit, docs, and future discovery tooling.
|
|
6
|
+
*/
|
|
7
|
+
export declare const STYLE_AXIS_VALUES: {
|
|
8
|
+
readonly tone: readonly ["minimal", "classic", "bold"];
|
|
9
|
+
readonly energy: readonly ["calm", "vibrant"];
|
|
10
|
+
readonly motion: readonly ["subtle", "standard", "expressive"];
|
|
11
|
+
readonly era: readonly ["editorial", "modern", "organic", "technical", "retro"];
|
|
12
|
+
};
|
|
13
|
+
export declare const styleTagsSchema: z.ZodObject<{
|
|
14
|
+
tone: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
bold: "bold";
|
|
16
|
+
minimal: "minimal";
|
|
17
|
+
classic: "classic";
|
|
18
|
+
}>>;
|
|
19
|
+
energy: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
calm: "calm";
|
|
21
|
+
vibrant: "vibrant";
|
|
22
|
+
}>>;
|
|
23
|
+
motion: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
standard: "standard";
|
|
25
|
+
subtle: "subtle";
|
|
26
|
+
expressive: "expressive";
|
|
27
|
+
}>>;
|
|
28
|
+
era: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
editorial: "editorial";
|
|
30
|
+
modern: "modern";
|
|
31
|
+
retro: "retro";
|
|
32
|
+
technical: "technical";
|
|
33
|
+
organic: "organic";
|
|
34
|
+
}>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type StyleTone = (typeof STYLE_AXIS_VALUES.tone)[number];
|
|
37
|
+
export type StyleEnergy = (typeof STYLE_AXIS_VALUES.energy)[number];
|
|
38
|
+
export type StyleMotion = (typeof STYLE_AXIS_VALUES.motion)[number];
|
|
39
|
+
export type StyleEra = (typeof STYLE_AXIS_VALUES.era)[number];
|
|
40
|
+
export type StyleAxis = Readonly<{
|
|
41
|
+
tone: StyleTone;
|
|
42
|
+
energy: StyleEnergy;
|
|
43
|
+
motion: StyleMotion;
|
|
44
|
+
era: StyleEra;
|
|
45
|
+
}>;
|
|
46
|
+
export type StyleTags = Readonly<Partial<StyleAxis>>;
|
|
@@ -18,14 +18,14 @@ export declare const themeTokenRecipesSchema: z.ZodObject<{
|
|
|
18
18
|
}>;
|
|
19
19
|
contrast: z.ZodEnum<{
|
|
20
20
|
standard: "standard";
|
|
21
|
-
strong: "strong";
|
|
22
21
|
maximum: "maximum";
|
|
22
|
+
strong: "strong";
|
|
23
23
|
}>;
|
|
24
24
|
radius: z.ZodEnum<{
|
|
25
|
-
|
|
25
|
+
soft: "soft";
|
|
26
26
|
square: "square";
|
|
27
|
+
rounded: "rounded";
|
|
27
28
|
pill: "pill";
|
|
28
|
-
soft: "soft";
|
|
29
29
|
}>;
|
|
30
30
|
shadow: z.ZodEnum<{
|
|
31
31
|
none: "none";
|
|
@@ -39,9 +39,9 @@ export declare const themeTokenRecipesSchema: z.ZodObject<{
|
|
|
39
39
|
"friendly-sans": "friendly-sans";
|
|
40
40
|
}>;
|
|
41
41
|
spacing: z.ZodEnum<{
|
|
42
|
-
compact: "compact";
|
|
43
|
-
regular: "regular";
|
|
44
42
|
airy: "airy";
|
|
43
|
+
regular: "regular";
|
|
44
|
+
compact: "compact";
|
|
45
45
|
}>;
|
|
46
46
|
motion: z.ZodEnum<{
|
|
47
47
|
none: "none";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "success" | "
|
|
4
|
+
variant?: "success" | "default" | "warning" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { Separator } from './separator';
|
|
4
4
|
declare const buttonGroupVariants: (props?: ({
|
|
5
|
-
orientation?: "
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<'div'> & {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "
|
|
5
|
-
size?: "default" | "
|
|
4
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | "onDark" | "onDarkOutline" | "heroGlass" | null | undefined;
|
|
5
|
+
size?: "default" | "lg" | "sm" | "icon" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const calloutVariants: (props?: ({
|
|
4
|
-
tone?: "success" | "default" | "warning" | "
|
|
4
|
+
tone?: "success" | "default" | "warning" | "danger" | "info" | null | undefined;
|
|
5
5
|
layout?: "inline" | "banner" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type CalloutProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof calloutVariants> & {
|
|
@@ -4,7 +4,7 @@ import { surfaceVariants } from './surface';
|
|
|
4
4
|
export type CardVariant = VariantProps<typeof surfaceVariants>['variant'];
|
|
5
5
|
export type CardRadius = VariantProps<typeof surfaceVariants>['radius'];
|
|
6
6
|
declare const cardLayoutVariants: (props?: ({
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "default" | "none" | "compact" | "responsive" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export type CardSize = VariantProps<typeof cardLayoutVariants>['size'];
|
|
10
10
|
export type CardProps = React.ComponentProps<'div'> & {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional pre-set swatch passed to the chooser. Macadamia onboarding feeds
|
|
3
|
+
* logo-extracted colours here; the LiveThemeEditor and Style configurator
|
|
4
|
+
* pass an empty array (or omit the prop) so the dialog just exposes the
|
|
5
|
+
* freeform colour picker.
|
|
6
|
+
*/
|
|
7
|
+
export type ColorChooserSwatch = Readonly<{
|
|
8
|
+
hex: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type ColorChooserDialogProps = Readonly<{
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
14
|
+
/** Current persisted value for the slot being edited. */
|
|
15
|
+
currentValue: string | null;
|
|
16
|
+
/** Suggested-swatch grid. Empty/omitted => freeform picker only. */
|
|
17
|
+
swatches?: ReadonlyArray<ColorChooserSwatch>;
|
|
18
|
+
/**
|
|
19
|
+
* Swatches in `swatches` that should render as visibly disabled
|
|
20
|
+
* (typically: already used elsewhere in the palette). Selecting one of
|
|
21
|
+
* these is still possible if it matches `currentValue`.
|
|
22
|
+
*/
|
|
23
|
+
disabledHexes?: ReadonlyArray<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Fallback hex used when neither `currentValue` nor `swatches[0]` resolve
|
|
26
|
+
* to a usable colour. Defaults to `#000000`; pass the brand colour if you
|
|
27
|
+
* want the dialog to open on it.
|
|
28
|
+
*/
|
|
29
|
+
defaultValue?: string;
|
|
30
|
+
/** Localised dialog title. */
|
|
31
|
+
title?: string;
|
|
32
|
+
/** Localised body description. Falls back to a swatches-aware default. */
|
|
33
|
+
description?: string;
|
|
34
|
+
/** Confirm button label. Defaults to "Use this colour". */
|
|
35
|
+
confirmLabel?: string;
|
|
36
|
+
/** Optional remove handler. When provided, a "Remove colour" button appears. */
|
|
37
|
+
onRemove?: () => void;
|
|
38
|
+
/** Remove button label. Defaults to "Remove colour". */
|
|
39
|
+
removeLabel?: string;
|
|
40
|
+
onChoose: (value: string) => void;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Shared colour-chooser dialog. Combines an optional logo-derived swatch
|
|
44
|
+
* grid with a freeform `ColorPicker` + hex display. Consolidates the
|
|
45
|
+
* implementations that previously lived inline in Macadamia onboarding.
|
|
46
|
+
*/
|
|
47
|
+
export declare function ColorChooserDialog({ open, onOpenChange, currentValue, swatches, disabledHexes, defaultValue, title, description, confirmLabel, onRemove, removeLabel, onChoose, }: ColorChooserDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot affordance for "this row holds a colour, click to choose". Renders as
|
|
3
|
+
* an empty dashed-border tile when `value` is null, or as a filled swatch
|
|
4
|
+
* with the hex displayed when a value is set. Used in the Macadamia
|
|
5
|
+
* onboarding's primary/secondary colour rows and the Style configurator's
|
|
6
|
+
* advanced palette panel.
|
|
7
|
+
*/
|
|
8
|
+
export type ColorSlotButtonProps = Readonly<{
|
|
9
|
+
value: string | null;
|
|
10
|
+
emptyLabel: string;
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function ColorSlotButton({ value, emptyLabel, ariaLabel, onClick, className }: ColorSlotButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact swatch + label tile. Used in the colour-chooser dialog's
|
|
3
|
+
* "from your logo" grid and anywhere a palette-aware single-colour row is
|
|
4
|
+
* needed (Macadamia onboarding's brand colour rows, the Style configurator
|
|
5
|
+
* advanced palette panel).
|
|
6
|
+
*/
|
|
7
|
+
export type ColorSwatchButtonProps = Readonly<{
|
|
8
|
+
hex: string;
|
|
9
|
+
label: string;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function ColorSwatchButton({ hex, label, selected, onClick, disabled, className }: ColorSwatchButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One palette role slot. `name` is intentionally a free string here so the
|
|
3
|
+
* component can be reused for theme palettes that predate the closed
|
|
4
|
+
* `PaletteTokenName` union; callers pass the role-label mapping via `roles`.
|
|
5
|
+
*/
|
|
6
|
+
export type PaletteToken = Readonly<{
|
|
7
|
+
name: string;
|
|
8
|
+
hex: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type PaletteRole = Readonly<{
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const DEFAULT_BRAND_ROLES: ReadonlyArray<PaletteRole>;
|
|
15
|
+
export declare const DEFAULT_FEEDBACK_ROLES: ReadonlyArray<PaletteRole>;
|
|
16
|
+
export declare const DEFAULT_SURFACE_ROLES: ReadonlyArray<PaletteRole>;
|
|
17
|
+
export type PaletteTokenEditorProps = Readonly<{
|
|
18
|
+
/**
|
|
19
|
+
* Current palette colours. Only entries whose `name` matches one of the
|
|
20
|
+
* configured role keys are surfaced; extra entries pass through untouched.
|
|
21
|
+
*/
|
|
22
|
+
palette: ReadonlyArray<PaletteToken>;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the user edits a role's hex via the picker or the input
|
|
25
|
+
* field. The editor filters implausible strings and forwards a canonical
|
|
26
|
+
* lowercase `#RRGGBB` value via `normalizeHex`; the handler can merge
|
|
27
|
+
* the value into its store without further normalisation.
|
|
28
|
+
*/
|
|
29
|
+
onChange: (role: string, hex: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Optional invalid-palette banner — shown when the consumer wants to
|
|
32
|
+
* surface schema errors (e.g. from a Zod parse failure) without coupling
|
|
33
|
+
* the editor to a validation context.
|
|
34
|
+
*/
|
|
35
|
+
hasInvalidValues?: boolean;
|
|
36
|
+
/** Override the default role groupings (e.g. to add `primaryForeground`). */
|
|
37
|
+
brandRoles?: ReadonlyArray<PaletteRole>;
|
|
38
|
+
feedbackRoles?: ReadonlyArray<PaletteRole>;
|
|
39
|
+
surfaceRoles?: ReadonlyArray<PaletteRole>;
|
|
40
|
+
showContrastChecks?: boolean;
|
|
41
|
+
className?: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Shared palette role grid + contrast checker. Self-contained: no theme-
|
|
45
|
+
* editor / validation context dependencies. Used by:
|
|
46
|
+
* - Macadamia onboarding (advanced colour panel, planned)
|
|
47
|
+
* - LiveThemeEditor's palette tab (via a thin context wrapper)
|
|
48
|
+
* - Style configurator's brand-colours row
|
|
49
|
+
*/
|
|
50
|
+
export declare function PaletteTokenEditor({ palette, onChange, hasInvalidValues, brandRoles, feedbackRoles, surfaceRoles, showContrastChecks, className, }: PaletteTokenEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hex colour helpers shared by every palette-editing surface (Macadamia
|
|
3
|
+
* onboarding swatches, the LiveThemeEditor, the Style configurator advanced
|
|
4
|
+
* row). Consolidates three prior duplicates: `normalizeColorPickerValue` in
|
|
5
|
+
* Macadamia, `normalizeHex` + `contrastRatio` in `theme-editor/utils.ts`, and
|
|
6
|
+
* the inline regex in `updateColorRole`.
|
|
7
|
+
*
|
|
8
|
+
* Pure functions; no DOM, no React.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Coerces user input into a canonical lowercase `#RRGGBB` form. Accepts
|
|
12
|
+
* 3-digit shorthand, case-insensitive 6-digit hex, and the same forms with or
|
|
13
|
+
* without a leading `#`; returns `fallback` for any other shape (empty
|
|
14
|
+
* string, garbage, characters outside `[0-9a-f]`, wrong length, etc.). Pass
|
|
15
|
+
* a `fallback` to make the fallback explicit at the call site — defaulting
|
|
16
|
+
* to `'#000000'` keeps the legacy `theme-editor/utils.ts` semantics.
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeHex(input: string | null | undefined, fallback?: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* WCAG relative luminance + contrast ratio. Rounded to 2 decimal places so
|
|
21
|
+
* the result is stable for UI display.
|
|
22
|
+
*/
|
|
23
|
+
export declare function contrastRatio(hexA: string, hexB: string): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @riverbankcms/ui/palette — shared palette-editing primitives.
|
|
3
|
+
*
|
|
4
|
+
* Consolidates three palette-editing surfaces that had drifted in the
|
|
5
|
+
* dashboard: Macadamia onboarding's colour chooser, the LiveThemeEditor's
|
|
6
|
+
* palette tab, and the Style configurator's brand-colours panel. Each
|
|
7
|
+
* component is self-contained (no context coupling) and built on
|
|
8
|
+
* Riverbank UI primitives so it works in any client tree.
|
|
9
|
+
*/
|
|
10
|
+
export { ColorSwatchButton, type ColorSwatchButtonProps } from './ColorSwatchButton';
|
|
11
|
+
export { ColorSlotButton, type ColorSlotButtonProps } from './ColorSlotButton';
|
|
12
|
+
export { ColorChooserDialog, type ColorChooserDialogProps, type ColorChooserSwatch, } from './ColorChooserDialog';
|
|
13
|
+
export { PaletteTokenEditor, type PaletteTokenEditorProps, type PaletteToken, type PaletteRole, DEFAULT_BRAND_ROLES, DEFAULT_FEEDBACK_ROLES, DEFAULT_SURFACE_ROLES, } from './PaletteTokenEditor';
|
|
14
|
+
export { contrastRatio, normalizeHex } from './hex';
|
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
export declare const surfaceVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "background" | null | undefined;
|
|
5
|
-
radius?: "none" | "
|
|
6
|
-
padding?: "none" | "
|
|
5
|
+
radius?: "none" | "md" | "lg" | "xl" | "sm" | "flushMobile" | null | undefined;
|
|
6
|
+
padding?: "none" | "md" | "lg" | "sm" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export type SurfaceProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof surfaceVariants>;
|
|
9
9
|
export declare function Surface({ className, variant, radius, padding, ...props }: SurfaceProps): React.ReactElement;
|
|
@@ -2,11 +2,11 @@ import * as React from "react";
|
|
|
2
2
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
|
4
4
|
declare const toggleVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
6
|
-
size?: "default" | "
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
-
variant?: "
|
|
10
|
-
size?: "default" | "
|
|
9
|
+
variant?: "default" | "outline" | null | undefined;
|
|
10
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
export { Toggle, toggleVariants };
|