@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
package/dist/server/theme.mjs
CHANGED
|
@@ -15,69 +15,11 @@ function brandNonEmptyString(value, label) {
|
|
|
15
15
|
return value;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// ../theme-core/src/
|
|
19
|
-
import { z } from "zod";
|
|
20
|
-
var STYLE_AXIS_VALUES = {
|
|
21
|
-
tone: ["minimal", "classic", "bold"],
|
|
22
|
-
energy: ["calm", "vibrant"],
|
|
23
|
-
motion: ["subtle", "standard", "expressive"],
|
|
24
|
-
era: ["editorial", "modern", "organic", "technical", "retro"]
|
|
25
|
-
};
|
|
26
|
-
var styleTagsSchema = z.object({
|
|
27
|
-
tone: z.enum(STYLE_AXIS_VALUES.tone).optional(),
|
|
28
|
-
energy: z.enum(STYLE_AXIS_VALUES.energy).optional(),
|
|
29
|
-
motion: z.enum(STYLE_AXIS_VALUES.motion).optional(),
|
|
30
|
-
era: z.enum(STYLE_AXIS_VALUES.era).optional()
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// ../theme-core/src/schema.ts
|
|
34
|
-
import { z as z14 } from "zod";
|
|
35
|
-
|
|
36
|
-
// ../theme-core/src/lib/media.ts
|
|
37
|
-
import z2 from "zod";
|
|
38
|
-
var hotspotSchema = z2.object({
|
|
39
|
-
x: z2.number().min(0).max(1),
|
|
40
|
-
y: z2.number().min(0).max(1),
|
|
41
|
-
radius: z2.number().optional()
|
|
42
|
-
});
|
|
43
|
-
var rotationSchema = z2.union([z2.literal(0), z2.literal(90), z2.literal(180), z2.literal(270)]);
|
|
44
|
-
var rectSchema = z2.tuple([z2.number(), z2.number(), z2.number(), z2.number()]);
|
|
45
|
-
var aspectCropSchema = z2.object({
|
|
46
|
-
aspect: z2.preprocess((value) => value == null ? void 0 : value, z2.string().optional()),
|
|
47
|
-
rect: z2.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
48
|
-
hotspot: z2.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
49
|
-
rotation: z2.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
50
|
-
});
|
|
51
|
-
var transformSchema = z2.object({
|
|
52
|
-
aspectCrops: z2.preprocess((value) => {
|
|
53
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
54
|
-
return void 0;
|
|
55
|
-
}
|
|
56
|
-
return value;
|
|
57
|
-
}, z2.record(z2.string(), aspectCropSchema.catch({}))).optional(),
|
|
58
|
-
rect: rectSchema.optional(),
|
|
59
|
-
hotspot: hotspotSchema.optional(),
|
|
60
|
-
rotation: rotationSchema.optional()
|
|
61
|
-
});
|
|
62
|
-
var mediaSchema = z2.object({
|
|
63
|
-
type: z2.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
|
|
64
|
-
purpose: z2.string().optional(),
|
|
65
|
-
placeholder: z2.boolean().default(true).optional(),
|
|
66
|
-
assetId: z2.string().optional(),
|
|
67
|
-
identifier: z2.string().optional(),
|
|
68
|
-
src: z2.string().optional(),
|
|
69
|
-
alt: z2.string().optional(),
|
|
70
|
-
filename: z2.string().optional(),
|
|
71
|
-
mimeType: z2.string().optional(),
|
|
72
|
-
width: z2.number().optional(),
|
|
73
|
-
height: z2.number().optional(),
|
|
74
|
-
storageBucket: z2.string().optional(),
|
|
75
|
-
storagePath: z2.string().optional(),
|
|
76
|
-
transform: transformSchema.optional()
|
|
77
|
-
});
|
|
18
|
+
// ../theme-core/src/buttons/personalities/types.ts
|
|
19
|
+
import { z as z3 } from "zod";
|
|
78
20
|
|
|
79
21
|
// ../theme-core/src/buttons/types.ts
|
|
80
|
-
import { z
|
|
22
|
+
import { z } from "zod";
|
|
81
23
|
var VARIANT_ROLES = [
|
|
82
24
|
"primary",
|
|
83
25
|
"secondary",
|
|
@@ -87,22 +29,22 @@ var VARIANT_ROLES = [
|
|
|
87
29
|
"tertiary",
|
|
88
30
|
"accent"
|
|
89
31
|
];
|
|
90
|
-
var cornerStyleSchema =
|
|
91
|
-
var shadowSizeSchema =
|
|
92
|
-
var textTransformSchema =
|
|
93
|
-
var fontWeightSchema =
|
|
94
|
-
var buttonTypographySchema =
|
|
95
|
-
var letterSpacingSchema =
|
|
96
|
-
var hoverTransformSchema =
|
|
97
|
-
var hoverColorSchema =
|
|
98
|
-
var buttonPaddingPresetSchema =
|
|
99
|
-
var gradientStyleSchema =
|
|
100
|
-
var gradientSharpnessSchema =
|
|
101
|
-
var prioritySchema =
|
|
102
|
-
var variantRoleSchema =
|
|
103
|
-
var buttonSizeNameSchema =
|
|
32
|
+
var cornerStyleSchema = z.enum(["square", "rounded", "pill"]);
|
|
33
|
+
var shadowSizeSchema = z.enum(["none", "low", "medium", "high"]);
|
|
34
|
+
var textTransformSchema = z.enum(["none", "uppercase", "lowercase", "capitalize"]);
|
|
35
|
+
var fontWeightSchema = z.union([z.literal(500), z.literal(600), z.literal(700)]);
|
|
36
|
+
var buttonTypographySchema = z.enum(["body", "heading"]);
|
|
37
|
+
var letterSpacingSchema = z.enum(["tight", "normal", "loose"]);
|
|
38
|
+
var hoverTransformSchema = z.enum(["none", "lift", "scale", "press"]);
|
|
39
|
+
var hoverColorSchema = z.enum(["none", "brighten", "darken", "saturate", "token"]);
|
|
40
|
+
var buttonPaddingPresetSchema = z.enum(["compact", "default", "spacious"]);
|
|
41
|
+
var gradientStyleSchema = z.enum(["linear", "radial", "conic"]);
|
|
42
|
+
var gradientSharpnessSchema = z.enum(["smooth", "medium", "hard"]);
|
|
43
|
+
var prioritySchema = z.union([z.literal(1), z.literal(2), z.literal(3)]);
|
|
44
|
+
var variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
45
|
+
var buttonSizeNameSchema = z.enum(["sm", "md", "lg", "xl"]);
|
|
104
46
|
var PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
105
|
-
var paddingShorthandSchema =
|
|
47
|
+
var paddingShorthandSchema = z.string().refine(
|
|
106
48
|
(value) => {
|
|
107
49
|
const parts = value.split(/\s+/).filter(Boolean);
|
|
108
50
|
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
@@ -111,11 +53,11 @@ var paddingShorthandSchema = z3.string().refine(
|
|
|
111
53
|
message: 'Padding must be two space-separated CSS length tokens (e.g. "0.5rem 1rem"). Use `0` for zero.'
|
|
112
54
|
}
|
|
113
55
|
);
|
|
114
|
-
var buttonSizeConfigSchema =
|
|
56
|
+
var buttonSizeConfigSchema = z.object({
|
|
115
57
|
padding: paddingShorthandSchema,
|
|
116
|
-
fontSize:
|
|
58
|
+
fontSize: z.string().optional()
|
|
117
59
|
});
|
|
118
|
-
var buttonSizesSchema =
|
|
60
|
+
var buttonSizesSchema = z.object({
|
|
119
61
|
sm: buttonSizeConfigSchema,
|
|
120
62
|
md: buttonSizeConfigSchema,
|
|
121
63
|
lg: buttonSizeConfigSchema,
|
|
@@ -126,9 +68,9 @@ var buttonSizesSchema = z3.object({
|
|
|
126
68
|
lg,
|
|
127
69
|
xl: xl ?? lg
|
|
128
70
|
}));
|
|
129
|
-
var buttonGlobalSettingsSchema =
|
|
71
|
+
var buttonGlobalSettingsSchema = z.object({
|
|
130
72
|
cornerStyle: cornerStyleSchema,
|
|
131
|
-
cornerRadius:
|
|
73
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
132
74
|
shadow: shadowSizeSchema,
|
|
133
75
|
textTransform: textTransformSchema,
|
|
134
76
|
fontWeight: fontWeightSchema,
|
|
@@ -138,107 +80,118 @@ var buttonGlobalSettingsSchema = z3.object({
|
|
|
138
80
|
* by the current generator and will be removed once the legacy
|
|
139
81
|
* `primitives/content/components/Button.tsx` slot exports are deleted.
|
|
140
82
|
*/
|
|
141
|
-
borderWidth:
|
|
83
|
+
borderWidth: z.union([z.literal(1), z.literal(2), z.literal(3)]),
|
|
142
84
|
// === Family-level typography ===
|
|
143
85
|
// Typography source (body or heading) — selects which theme typography pool to inherit
|
|
144
86
|
typography: buttonTypographySchema.optional(),
|
|
145
87
|
// Font size for all variants in the family (Tailwind token, e.g. "text-xs", "text-sm")
|
|
146
88
|
// Sized variants get this as default; fixed variants inherit unless they override.
|
|
147
89
|
// Size class CSS may still override at run time for sized variants.
|
|
148
|
-
fontSize:
|
|
90
|
+
fontSize: z.string().optional(),
|
|
149
91
|
// Letter spacing applied to all variants
|
|
150
92
|
letterSpacing: letterSpacingSchema.optional(),
|
|
151
93
|
// Italic style
|
|
152
|
-
italic:
|
|
94
|
+
italic: z.boolean().optional(),
|
|
153
95
|
// Padding preset (applies to sized variants without a sizes config)
|
|
154
96
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
155
97
|
hoverTransform: hoverTransformSchema,
|
|
156
98
|
hoverColor: hoverColorSchema,
|
|
157
99
|
// When hoverColor is 'token', this specifies which token to use
|
|
158
|
-
hoverColorToken:
|
|
100
|
+
hoverColorToken: z.string().optional(),
|
|
159
101
|
// Gradient settings (if any variant uses gradients)
|
|
160
102
|
gradientStyle: gradientStyleSchema.optional(),
|
|
161
|
-
gradientAngle:
|
|
103
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
162
104
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
163
105
|
});
|
|
164
|
-
var gradientDirectionSchema =
|
|
165
|
-
var buttonBackgroundSchema =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
type:
|
|
169
|
-
stops:
|
|
106
|
+
var gradientDirectionSchema = z.enum(["to-r", "to-l", "to-t", "to-b", "to-tr", "to-tl", "to-br", "to-bl"]);
|
|
107
|
+
var buttonBackgroundSchema = z.discriminatedUnion("type", [
|
|
108
|
+
z.object({ type: z.literal("solid"), colorToken: z.string() }),
|
|
109
|
+
z.object({
|
|
110
|
+
type: z.literal("gradient"),
|
|
111
|
+
stops: z.array(z.string()).min(2),
|
|
170
112
|
direction: gradientDirectionSchema
|
|
171
113
|
}),
|
|
172
|
-
|
|
114
|
+
z.object({ type: z.literal("transparent") })
|
|
173
115
|
]);
|
|
174
|
-
var effectApplicationSchema =
|
|
175
|
-
effectId:
|
|
176
|
-
options:
|
|
177
|
-
});
|
|
178
|
-
var buttonBorderSchema =
|
|
179
|
-
widthClass:
|
|
180
|
-
colorToken:
|
|
181
|
-
});
|
|
182
|
-
var variantShadowSchema =
|
|
183
|
-
elevation:
|
|
184
|
-
softness:
|
|
185
|
-
position:
|
|
186
|
-
});
|
|
187
|
-
var variantEffectsSchema =
|
|
188
|
-
base:
|
|
189
|
-
hover:
|
|
190
|
-
active:
|
|
191
|
-
focus:
|
|
192
|
-
});
|
|
193
|
-
var variantSizeOverridesSchema =
|
|
116
|
+
var effectApplicationSchema = z.object({
|
|
117
|
+
effectId: z.string(),
|
|
118
|
+
options: z.record(z.string(), z.any()).optional()
|
|
119
|
+
});
|
|
120
|
+
var buttonBorderSchema = z.object({
|
|
121
|
+
widthClass: z.string(),
|
|
122
|
+
colorToken: z.string()
|
|
123
|
+
});
|
|
124
|
+
var variantShadowSchema = z.object({
|
|
125
|
+
elevation: z.enum(["none", "low", "medium", "high"]),
|
|
126
|
+
softness: z.enum(["crisp", "soft", "hard"]).nullable(),
|
|
127
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom")
|
|
128
|
+
});
|
|
129
|
+
var variantEffectsSchema = z.object({
|
|
130
|
+
base: z.array(effectApplicationSchema).optional(),
|
|
131
|
+
hover: z.array(effectApplicationSchema).optional(),
|
|
132
|
+
active: z.array(effectApplicationSchema).optional(),
|
|
133
|
+
focus: z.array(effectApplicationSchema).optional()
|
|
134
|
+
});
|
|
135
|
+
var variantSizeOverridesSchema = z.object({
|
|
194
136
|
sm: buttonSizeConfigSchema.optional(),
|
|
195
137
|
md: buttonSizeConfigSchema.optional(),
|
|
196
138
|
lg: buttonSizeConfigSchema.optional(),
|
|
197
139
|
xl: buttonSizeConfigSchema.optional()
|
|
198
140
|
});
|
|
199
|
-
var buttonVariantSchema =
|
|
200
|
-
id:
|
|
201
|
-
name:
|
|
202
|
-
enabled:
|
|
141
|
+
var buttonVariantSchema = z.object({
|
|
142
|
+
id: z.string(),
|
|
143
|
+
name: z.string().min(1).max(20),
|
|
144
|
+
enabled: z.boolean(),
|
|
203
145
|
priority: prioritySchema,
|
|
204
146
|
// Base appearance (token-based)
|
|
205
147
|
background: buttonBackgroundSchema,
|
|
206
|
-
textColorToken:
|
|
148
|
+
textColorToken: z.string(),
|
|
207
149
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
208
|
-
borderRadius:
|
|
150
|
+
borderRadius: z.string().optional(),
|
|
209
151
|
// Optional shadow override (uses theme.shadow if not specified)
|
|
210
152
|
shadow: variantShadowSchema.optional(),
|
|
211
153
|
// Border (optional)
|
|
212
154
|
border: buttonBorderSchema.optional(),
|
|
213
155
|
// Hover background token (per-variant override, takes precedence over global hoverColorToken)
|
|
214
|
-
hoverBackgroundToken:
|
|
156
|
+
hoverBackgroundToken: z.string().optional(),
|
|
215
157
|
// Effect composition
|
|
216
158
|
effects: variantEffectsSchema.optional(),
|
|
217
159
|
// Per-variant size overrides — see VariantSizeOverrides
|
|
218
160
|
sizes: variantSizeOverridesSchema.optional()
|
|
219
161
|
});
|
|
220
|
-
var buttonSystemSchema =
|
|
162
|
+
var buttonSystemSchema = z.object({
|
|
221
163
|
global: buttonGlobalSettingsSchema,
|
|
222
|
-
variants:
|
|
164
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
223
165
|
sizes: buttonSizesSchema.optional()
|
|
224
166
|
});
|
|
225
167
|
|
|
226
|
-
// ../theme-core/src/
|
|
227
|
-
|
|
168
|
+
// ../theme-core/src/site-styles/styleTags.ts
|
|
169
|
+
import { z as z2 } from "zod";
|
|
170
|
+
var STYLE_AXIS_VALUES = {
|
|
171
|
+
tone: ["minimal", "classic", "bold"],
|
|
172
|
+
energy: ["calm", "vibrant"],
|
|
173
|
+
motion: ["subtle", "standard", "expressive"],
|
|
174
|
+
era: ["editorial", "modern", "organic", "technical", "retro"]
|
|
175
|
+
};
|
|
176
|
+
var styleTagsSchema = z2.object({
|
|
177
|
+
tone: z2.enum(STYLE_AXIS_VALUES.tone).optional(),
|
|
178
|
+
energy: z2.enum(STYLE_AXIS_VALUES.energy).optional(),
|
|
179
|
+
motion: z2.enum(STYLE_AXIS_VALUES.motion).optional(),
|
|
180
|
+
era: z2.enum(STYLE_AXIS_VALUES.era).optional()
|
|
181
|
+
});
|
|
228
182
|
|
|
229
183
|
// ../theme-core/src/buttons/personalities/types.ts
|
|
230
|
-
import { z as z4 } from "zod";
|
|
231
184
|
function asButtonPersonalityId(value) {
|
|
232
185
|
if (value.length === 0) {
|
|
233
186
|
throw new Error("ButtonPersonalityId must be a non-empty string");
|
|
234
187
|
}
|
|
235
188
|
return value;
|
|
236
189
|
}
|
|
237
|
-
var buttonPersonalityIdSchema =
|
|
238
|
-
var buttonPersonalitySchema =
|
|
190
|
+
var buttonPersonalityIdSchema = z3.string().min(1).transform((value) => asButtonPersonalityId(value));
|
|
191
|
+
var buttonPersonalitySchema = z3.object({
|
|
239
192
|
id: buttonPersonalityIdSchema,
|
|
240
|
-
name:
|
|
241
|
-
description:
|
|
193
|
+
name: z3.string().min(1),
|
|
194
|
+
description: z3.string().min(1),
|
|
242
195
|
tags: styleTagsSchema,
|
|
243
196
|
buttonSystem: buttonSystemSchema
|
|
244
197
|
});
|
|
@@ -776,6 +729,55 @@ var personalitiesById = new Map(
|
|
|
776
729
|
buttonPersonalities.map((p) => [p.id, p])
|
|
777
730
|
);
|
|
778
731
|
|
|
732
|
+
// ../theme-core/src/schema.ts
|
|
733
|
+
import { z as z14 } from "zod";
|
|
734
|
+
|
|
735
|
+
// ../theme-core/src/lib/media.ts
|
|
736
|
+
import z4 from "zod";
|
|
737
|
+
var hotspotSchema = z4.object({
|
|
738
|
+
x: z4.number().min(0).max(1),
|
|
739
|
+
y: z4.number().min(0).max(1),
|
|
740
|
+
radius: z4.number().optional()
|
|
741
|
+
});
|
|
742
|
+
var rotationSchema = z4.union([z4.literal(0), z4.literal(90), z4.literal(180), z4.literal(270)]);
|
|
743
|
+
var rectSchema = z4.tuple([z4.number(), z4.number(), z4.number(), z4.number()]);
|
|
744
|
+
var aspectCropSchema = z4.object({
|
|
745
|
+
aspect: z4.preprocess((value) => value == null ? void 0 : value, z4.string().optional()),
|
|
746
|
+
rect: z4.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
747
|
+
hotspot: z4.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
748
|
+
rotation: z4.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
749
|
+
});
|
|
750
|
+
var transformSchema = z4.object({
|
|
751
|
+
aspectCrops: z4.preprocess((value) => {
|
|
752
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
753
|
+
return void 0;
|
|
754
|
+
}
|
|
755
|
+
return value;
|
|
756
|
+
}, z4.record(z4.string(), aspectCropSchema.catch({}))).optional(),
|
|
757
|
+
rect: rectSchema.optional(),
|
|
758
|
+
hotspot: hotspotSchema.optional(),
|
|
759
|
+
rotation: rotationSchema.optional()
|
|
760
|
+
});
|
|
761
|
+
var mediaSchema = z4.object({
|
|
762
|
+
type: z4.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
|
|
763
|
+
purpose: z4.string().optional(),
|
|
764
|
+
placeholder: z4.boolean().default(true).optional(),
|
|
765
|
+
assetId: z4.string().optional(),
|
|
766
|
+
identifier: z4.string().optional(),
|
|
767
|
+
src: z4.string().optional(),
|
|
768
|
+
alt: z4.string().optional(),
|
|
769
|
+
filename: z4.string().optional(),
|
|
770
|
+
mimeType: z4.string().optional(),
|
|
771
|
+
width: z4.number().optional(),
|
|
772
|
+
height: z4.number().optional(),
|
|
773
|
+
storageBucket: z4.string().optional(),
|
|
774
|
+
storagePath: z4.string().optional(),
|
|
775
|
+
transform: transformSchema.optional()
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
// ../theme-core/src/buttons/generateButtonCss.ts
|
|
779
|
+
var BUTTON_SIZE_NAMES = buttonSizeNameSchema.options;
|
|
780
|
+
|
|
779
781
|
// ../theme-core/src/cards/types.ts
|
|
780
782
|
import { z as z5 } from "zod";
|
|
781
783
|
var cardSpacingSchema = z5.enum(["none", "compact", "cozy", "medium", "comfortable", "spacious"]);
|
package/package.json
CHANGED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Compatibility primitives for filtering button personalities and palette
|
|
4
|
-
* variants against a curated site style's acceptance region.
|
|
5
|
-
*
|
|
6
|
-
* Three axes (`tone`, `energy`, `motion`) reuse the values already declared on
|
|
7
|
-
* `theme.axes` so personality/palette tags can't drift from the rest of the
|
|
8
|
-
* design system. `era` is a fourth axis added here because the theme schema
|
|
9
|
-
* doesn't carry a "style language" / cultural-reference dimension.
|
|
10
|
-
*
|
|
11
|
-
* Pure functions; no ambient state. Used by:
|
|
12
|
-
* - `compileSiteThemeFromSelections` to filter / resolve incompatible IDs
|
|
13
|
-
* - The Style configurator UI to filter pickable options
|
|
14
|
-
*/
|
|
15
|
-
export declare const STYLE_AXIS_VALUES: {
|
|
16
|
-
readonly tone: readonly ["minimal", "classic", "bold"];
|
|
17
|
-
readonly energy: readonly ["calm", "vibrant"];
|
|
18
|
-
readonly motion: readonly ["subtle", "standard", "expressive"];
|
|
19
|
-
readonly era: readonly ["editorial", "modern", "organic", "technical", "retro"];
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Zod schema for `StyleTags`. Derived from `STYLE_AXIS_VALUES` so a single
|
|
23
|
-
* source of truth governs both the type-level vocabulary and the runtime
|
|
24
|
-
* validator used by `buttonPersonalitySchema` and `paletteVariantSchema`.
|
|
25
|
-
*/
|
|
26
|
-
export declare const styleTagsSchema: z.ZodObject<{
|
|
27
|
-
tone: z.ZodOptional<z.ZodEnum<{
|
|
28
|
-
classic: "classic";
|
|
29
|
-
bold: "bold";
|
|
30
|
-
minimal: "minimal";
|
|
31
|
-
}>>;
|
|
32
|
-
energy: z.ZodOptional<z.ZodEnum<{
|
|
33
|
-
calm: "calm";
|
|
34
|
-
vibrant: "vibrant";
|
|
35
|
-
}>>;
|
|
36
|
-
motion: z.ZodOptional<z.ZodEnum<{
|
|
37
|
-
standard: "standard";
|
|
38
|
-
subtle: "subtle";
|
|
39
|
-
expressive: "expressive";
|
|
40
|
-
}>>;
|
|
41
|
-
era: z.ZodOptional<z.ZodEnum<{
|
|
42
|
-
editorial: "editorial";
|
|
43
|
-
modern: "modern";
|
|
44
|
-
retro: "retro";
|
|
45
|
-
technical: "technical";
|
|
46
|
-
organic: "organic";
|
|
47
|
-
}>>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
export type StyleTone = (typeof STYLE_AXIS_VALUES.tone)[number];
|
|
50
|
-
export type StyleEnergy = (typeof STYLE_AXIS_VALUES.energy)[number];
|
|
51
|
-
export type StyleMotion = (typeof STYLE_AXIS_VALUES.motion)[number];
|
|
52
|
-
export type StyleEra = (typeof STYLE_AXIS_VALUES.era)[number];
|
|
53
|
-
export type StyleAxis = Readonly<{
|
|
54
|
-
tone: StyleTone;
|
|
55
|
-
energy: StyleEnergy;
|
|
56
|
-
motion: StyleMotion;
|
|
57
|
-
era: StyleEra;
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* A personality or palette's self-declared tags. All four axes are optional;
|
|
61
|
-
* an unset axis matches every region (no constraint).
|
|
62
|
-
*/
|
|
63
|
-
export type StyleTags = Readonly<Partial<StyleAxis>>;
|
|
64
|
-
/**
|
|
65
|
-
* A site style's acceptance region. Each axis declares the set of values that
|
|
66
|
-
* pair well with the site style. An unset axis accepts everything.
|
|
67
|
-
*/
|
|
68
|
-
export type AcceptanceRegion = Readonly<{
|
|
69
|
-
[K in keyof StyleAxis]?: ReadonlyArray<StyleAxis[K]>;
|
|
70
|
-
}>;
|
|
71
|
-
/**
|
|
72
|
-
* True if every tag the entry declares falls inside the corresponding
|
|
73
|
-
* axis-acceptance set in the region. Unset axes (on either side) are skipped.
|
|
74
|
-
*
|
|
75
|
-
* Example: an entry with `{ tone: 'bold', era: 'retro' }` is compatible with
|
|
76
|
-
* a region of `{ tone: ['bold'], energy: ['vibrant'] }` because the entry
|
|
77
|
-
* doesn't declare `energy`, and `tone: 'bold'` is in the region's set.
|
|
78
|
-
*/
|
|
79
|
-
export declare function isCompatible(tags: StyleTags, region: AcceptanceRegion): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Filter a library of tagged entries to those compatible with the region,
|
|
82
|
-
* preserving original order. Pure.
|
|
83
|
-
*/
|
|
84
|
-
export declare function compatibleEntries<T extends {
|
|
85
|
-
readonly tags: StyleTags;
|
|
86
|
-
}>(entries: readonly T[], region: AcceptanceRegion): readonly T[];
|
|
87
|
-
/**
|
|
88
|
-
* Deterministic auto-pick for the "user switched site style; their current
|
|
89
|
-
* personality/palette may be incompatible" flow.
|
|
90
|
-
*
|
|
91
|
-
* Algorithm:
|
|
92
|
-
* 1. Requested is null → fallback. No rejection.
|
|
93
|
-
* 2. Requested is compatible → keep. No rejection.
|
|
94
|
-
* 3. Requested is incompatible → fallback (which is the site style's default
|
|
95
|
-
* and is required to be compatible). Record rejection.
|
|
96
|
-
* 4. Requested ID not found in library → fallback. Record rejection.
|
|
97
|
-
*
|
|
98
|
-
* The site-style invariant "every site style has at least one compatible
|
|
99
|
-
* entry per library" is what makes the fallback always valid. Enforced by a
|
|
100
|
-
* lint-style test, not at runtime.
|
|
101
|
-
*/
|
|
102
|
-
export type ResolveCompatibleResult<TId extends string> = Readonly<{
|
|
103
|
-
resolved: TId;
|
|
104
|
-
rejected: TId | null;
|
|
105
|
-
}>;
|
|
106
|
-
export declare function resolveCompatible<TId extends string, T extends {
|
|
107
|
-
readonly id: TId;
|
|
108
|
-
readonly tags: StyleTags;
|
|
109
|
-
}>(requested: TId | null, region: AcceptanceRegion, library: readonly T[], fallback: TId): ResolveCompatibleResult<TId>;
|