@yahoo/uds-v5-wip 1.57.0 → 1.59.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/dist/config/dist/createConfig.d.ts +1 -22
- package/dist/config/dist/createConfig.js +2 -86
- package/dist/config/dist/preset-merge.js +0 -19
- package/dist/config/dist/serialize.js +0 -1
- package/dist/presets/dist/defaultPreset.js +1 -18
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -9
- package/dist/remotion/dist/components/image-slide.config.js +0 -43
- package/dist/remotion/dist/components/image-slide.d.ts +0 -20
- package/dist/remotion/dist/components/image-slide.js +0 -24
- package/dist/remotion/dist/components/index.js +0 -16
- package/dist/remotion/dist/components/lower-third.config.js +0 -54
- package/dist/remotion/dist/components/lower-third.d.ts +0 -21
- package/dist/remotion/dist/components/lower-third.js +0 -26
- package/dist/remotion/dist/components/quote-card.config.js +0 -85
- package/dist/remotion/dist/components/quote-card.d.ts +0 -21
- package/dist/remotion/dist/components/quote-card.js +0 -27
- package/dist/remotion/dist/components/split-screen.config.js +0 -90
- package/dist/remotion/dist/components/split-screen.d.ts +0 -25
- package/dist/remotion/dist/components/split-screen.js +0 -35
- package/dist/remotion/dist/components/stat-card.config.js +0 -55
- package/dist/remotion/dist/components/stat-card.d.ts +0 -19
- package/dist/remotion/dist/components/stat-card.js +0 -23
- package/dist/remotion/dist/components/text-overlay.config.js +0 -46
- package/dist/remotion/dist/components/text-overlay.d.ts +0 -17
- package/dist/remotion/dist/components/text-overlay.js +0 -16
- package/dist/remotion/dist/components/title-card.config.js +0 -56
- package/dist/remotion/dist/components/title-card.d.ts +0 -19
- package/dist/remotion/dist/components/title-card.js +0 -23
- package/dist/remotion/dist/components/typing-text.config.js +0 -57
- package/dist/remotion/dist/components/typing-text.d.ts +0 -21
- package/dist/remotion/dist/components/typing-text.js +0 -23
- package/dist/remotion/dist/index.d.ts +0 -8
- package/dist/remotion/dist/index.js +0 -8
- package/dist/remotion/dist/transitions/fade.js +0 -19
- package/dist/remotion/dist/transitions/index.js +0 -7
- package/dist/remotion/dist/transitions/slide-down.js +0 -21
- package/dist/remotion/dist/transitions/slide-left.js +0 -21
- package/dist/remotion/dist/transitions/slide-right.js +0 -21
- package/dist/remotion/dist/transitions/slide-up.js +0 -21
- package/dist/remotion/dist/transitions/wipe.js +0 -21
- package/dist/remotion/dist/transitions/zoom.js +0 -19
- package/dist/remotion.d.ts +0 -9
- package/dist/remotion.js +0 -10
|
@@ -3,7 +3,7 @@ import { BoundComponent } from "./defineComponent.js";
|
|
|
3
3
|
import { AnyStyleProp } from "./defineStyleProp.js";
|
|
4
4
|
import { TokenType, VarsConfig } from "./types.js";
|
|
5
5
|
import { ResolvedStyleProp } from "./resolveStyleProp.js";
|
|
6
|
-
import { BaseModifierProp, ComponentsConfig, CompositeStylesConfig, ConfigurableProp, ModifierProp, MotionPreset
|
|
6
|
+
import { BaseModifierProp, ComponentsConfig, CompositeStylesConfig, ConfigurableProp, ModifierProp, MotionPreset } from "@uds/types";
|
|
7
7
|
|
|
8
8
|
//#region ../config/dist/createConfig.d.ts
|
|
9
9
|
//#region src/createConfig.d.ts
|
|
@@ -216,7 +216,6 @@ interface UdsConfigData {
|
|
|
216
216
|
globalStyles: GlobalStylesDef;
|
|
217
217
|
preflight: boolean;
|
|
218
218
|
prefix: string;
|
|
219
|
-
remotion?: RemotionConfig;
|
|
220
219
|
buildOptions?: BuildOptions;
|
|
221
220
|
examples?: Record<string, ExampleDef>;
|
|
222
221
|
designPrinciples?: string[];
|
|
@@ -267,8 +266,6 @@ interface ComponentConfig<TComponents extends ComponentsConfig<string> = Compone
|
|
|
267
266
|
requiredTokens: string[];
|
|
268
267
|
components: TComponents;
|
|
269
268
|
motion?: TMotion;
|
|
270
|
-
/** Remotion metadata — carried through compose() automatically */
|
|
271
|
-
remotion?: RemotionConfig;
|
|
272
269
|
}
|
|
273
270
|
type SingleComponentDef<TMotionAlias extends string = string> = ComponentsConfig<TMotionAlias>[string];
|
|
274
271
|
type EmptyMotionPresetsDef = Record<never, never>;
|
|
@@ -279,12 +276,6 @@ type DefineComponentInput<TTokens, TMotion, TComponent extends SingleComponentDe
|
|
|
279
276
|
components: Record<string, any>;
|
|
280
277
|
}) => TComponent);
|
|
281
278
|
type DefineComponentMotionInput<TTokens, TMotion extends MotionPresetsDef = MotionPresetsDef> = TMotion | ((tokens: TTokens) => TMotion);
|
|
282
|
-
/** Input shape for defineRemotionComponent — component def or factory function */
|
|
283
|
-
type RemotionComponentInput<TTokens, TMotion> = RemotionComponentDef | ((ctx: {
|
|
284
|
-
tokens: TTokens;
|
|
285
|
-
motion: TMotion;
|
|
286
|
-
components: Record<string, any>;
|
|
287
|
-
}) => RemotionComponentDef);
|
|
288
279
|
/** Helper type: builder result includes both the UdsConfig interface and any extensions */
|
|
289
280
|
type ConfigResult<TModifier extends ModifierNameShape, TTokens, TMotion, TExt extends Record<string, any> = {}, TCompositeStyles = EmptyCompositeStyles, TModeModifiers extends ModifierNameShape = never, TVars extends VarsConfig = EmptyVars> = UdsConfig<TModifier, TTokens, TMotion, TExt, TCompositeStyles, TModeModifiers, TVars> & TExt;
|
|
290
281
|
interface UdsConfig<TModifier extends ModifierNameShape = ModifierProp, TTokens = EmptyTokens, TMotion = EmptyMotion, TExt extends Record<string, any> = {}, TCompositeStyles = EmptyCompositeStyles, TModeModifiers extends ModifierNameShape = never, TVars extends VarsConfig = EmptyVars> {
|
|
@@ -363,18 +354,6 @@ interface UdsConfig<TModifier extends ModifierNameShape = ModifierProp, TTokens
|
|
|
363
354
|
defineComponent<const TName extends string, const TComponent extends SingleComponentDef<MotionAliasValue<TMotion> | string>, const TPresetMotion extends MotionPresetsDef = EmptyMotionPresetsDef>(name: TName, component: DefineComponentInput<TTokens, TMotion, TComponent>, motion?: DefineComponentMotionInput<TTokens, TPresetMotion>): ComponentConfig<SingleComponentDefinitionRecord<TName, TComponent>, TPresetMotion>;
|
|
364
355
|
from(data: Partial<UdsConfigData>): ConfigResult<TModifier, TTokens, TMotion, TExt, TCompositeStyles, TModeModifiers, TVars>;
|
|
365
356
|
extend<const NewExt extends Record<string, any>>(ext: NewExt): ConfigResult<TModifier, TTokens, TMotion, TExt & NewExt, TCompositeStyles, TModeModifiers, TVars>;
|
|
366
|
-
defineRemotionComponents(params: RemotionConfig | ((ctx: {
|
|
367
|
-
tokens: TTokens;
|
|
368
|
-
motion: TMotion;
|
|
369
|
-
components: Record<string, any>;
|
|
370
|
-
}) => RemotionConfig)): ConfigResult<TModifier, TTokens, TMotion, TExt, TCompositeStyles, TModeModifiers, TVars>;
|
|
371
|
-
defineRemotionComponent<const TName extends string, const TComponent extends SingleComponentDef<MotionAliasValue<TMotion> | string>, const TPresetMotion extends MotionPresetsDef = EmptyMotionPresetsDef>(name: TName, def: RemotionComponentInput<TTokens, TMotion>, motion?: DefineComponentMotionInput<TTokens, TPresetMotion>): ComponentConfig<SingleComponentDefinitionRecord<TName, TComponent>, TPresetMotion>;
|
|
372
|
-
defineRemotionTransition(name: string, def: RemotionTransitionDef | ((ctx: {
|
|
373
|
-
tokens: TTokens;
|
|
374
|
-
}) => RemotionTransitionDef)): ComponentConfig;
|
|
375
|
-
defineRemotionTransitions(params: Record<string, RemotionTransitionDef> | ((ctx: {
|
|
376
|
-
tokens: TTokens;
|
|
377
|
-
}) => Record<string, RemotionTransitionDef>)): ConfigResult<TModifier, TTokens, TMotion, TExt, TCompositeStyles, TModeModifiers, TVars>;
|
|
378
357
|
defineVars<const TVarsNew extends VarsConfig<[TModeModifiers] extends [never] ? `_${string}` : TModeModifiers>>(vars: TVarsNew): ConfigResult<TModifier, MergeTokens<TTokens, VarsToTokens<TVars & TVarsNew>>, TMotion, TExt, TCompositeStyles, TModeModifiers, TVars & TVarsNew>;
|
|
379
358
|
}
|
|
380
359
|
type AnyUdsConfig = UdsConfig<ModifierNameShape, any, any, any, any, any, any>;
|
|
@@ -235,7 +235,6 @@ function resolveConfig(config) {
|
|
|
235
235
|
globalStyles: config.globalStyles ?? {},
|
|
236
236
|
preflight: config.preflight ?? true,
|
|
237
237
|
prefix: config.prefix ?? "uds",
|
|
238
|
-
remotion: config.remotion,
|
|
239
238
|
buildOptions: config.buildOptions,
|
|
240
239
|
examples: config.examples,
|
|
241
240
|
designPrinciples: config.designPrinciples,
|
|
@@ -264,22 +263,6 @@ function resolveConfig(config) {
|
|
|
264
263
|
}
|
|
265
264
|
return configData;
|
|
266
265
|
}
|
|
267
|
-
function mergeRemotionConfig(existing, incoming) {
|
|
268
|
-
return {
|
|
269
|
-
components: {
|
|
270
|
-
...existing?.components ?? {},
|
|
271
|
-
...incoming.components
|
|
272
|
-
},
|
|
273
|
-
transitions: {
|
|
274
|
-
...existing?.transitions ?? {},
|
|
275
|
-
...incoming.transitions ?? {}
|
|
276
|
-
},
|
|
277
|
-
effects: {
|
|
278
|
-
...existing?.effects ?? {},
|
|
279
|
-
...incoming.effects ?? {}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
266
|
function isComponentDefinition(input) {
|
|
284
267
|
return typeof input === "object" && input !== null && "requiredTokens" in input && "components" in input;
|
|
285
268
|
}
|
|
@@ -293,8 +276,7 @@ function resolvePresetData(input) {
|
|
|
293
276
|
components: input.components,
|
|
294
277
|
globalStyles: {},
|
|
295
278
|
preflight: true,
|
|
296
|
-
prefix: "uds"
|
|
297
|
-
remotion: input.remotion
|
|
279
|
+
prefix: "uds"
|
|
298
280
|
};
|
|
299
281
|
if ("defineVars" in input) return resolveConfig(input);
|
|
300
282
|
return {
|
|
@@ -307,7 +289,6 @@ function resolvePresetData(input) {
|
|
|
307
289
|
globalStyles: input.globalStyles ?? {},
|
|
308
290
|
preflight: input.preflight ?? true,
|
|
309
291
|
prefix: input.prefix ?? "uds",
|
|
310
|
-
remotion: input.remotion,
|
|
311
292
|
examples: input.examples,
|
|
312
293
|
designPrinciples: input.designPrinciples,
|
|
313
294
|
vars: input.vars,
|
|
@@ -590,70 +571,6 @@ function createConfigBuilder(data, extensions) {
|
|
|
590
571
|
...ext
|
|
591
572
|
});
|
|
592
573
|
},
|
|
593
|
-
defineRemotionComponents(params) {
|
|
594
|
-
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
595
|
-
const motionReference = buildMotionReference(data.motion);
|
|
596
|
-
const componentsAccessor = buildComponentsAccessor(data.components);
|
|
597
|
-
const remotionConfig = typeof params === "function" ? params({
|
|
598
|
-
tokens: tokenReference,
|
|
599
|
-
motion: motionReference,
|
|
600
|
-
components: componentsAccessor
|
|
601
|
-
}) : params;
|
|
602
|
-
for (const [name, def] of Object.entries(remotionConfig.components)) validateComponentVariants(resolveComponentMotionAliases({ [name]: def.config }, data.motion));
|
|
603
|
-
return next({ remotion: mergeRemotionConfig(data.remotion, remotionConfig) });
|
|
604
|
-
},
|
|
605
|
-
defineRemotionComponent(name, def, motion) {
|
|
606
|
-
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
607
|
-
const resolvedMotion = typeof motion === "function" ? motion(tokenReference) : motion;
|
|
608
|
-
const motionReference = buildMotionReference({
|
|
609
|
-
...data.motion,
|
|
610
|
-
...resolvedMotion ?? {}
|
|
611
|
-
});
|
|
612
|
-
const componentsAccessor = buildComponentsAccessor(data.components);
|
|
613
|
-
const resolved = typeof def === "function" ? def({
|
|
614
|
-
tokens: tokenReference,
|
|
615
|
-
motion: motionReference,
|
|
616
|
-
components: componentsAccessor
|
|
617
|
-
}) : def;
|
|
618
|
-
const resolvedComponents = resolveComponentMotionAliases({ [name]: resolved.config }, {
|
|
619
|
-
...data.motion,
|
|
620
|
-
...resolvedMotion ?? {}
|
|
621
|
-
});
|
|
622
|
-
validateComponentVariants(resolvedComponents);
|
|
623
|
-
return {
|
|
624
|
-
name,
|
|
625
|
-
requiredTokens: collectRequiredTokens(data, resolvedComponents, resolvedMotion),
|
|
626
|
-
components: {},
|
|
627
|
-
motion: resolvedMotion,
|
|
628
|
-
remotion: {
|
|
629
|
-
components: { [name]: resolved },
|
|
630
|
-
transitions: {},
|
|
631
|
-
effects: {}
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
|
-
},
|
|
635
|
-
defineRemotionTransition(name, def) {
|
|
636
|
-
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
637
|
-
const resolved = typeof def === "function" ? def({ tokens: tokenReference }) : def;
|
|
638
|
-
return {
|
|
639
|
-
name,
|
|
640
|
-
requiredTokens: [],
|
|
641
|
-
components: {},
|
|
642
|
-
remotion: {
|
|
643
|
-
components: {},
|
|
644
|
-
transitions: { [name]: resolved },
|
|
645
|
-
effects: {}
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
},
|
|
649
|
-
defineRemotionTransitions(params) {
|
|
650
|
-
const tokenReference = buildTokenReference(data.atomic, data.prefix);
|
|
651
|
-
const resolved = typeof params === "function" ? params({ tokens: tokenReference }) : params;
|
|
652
|
-
return next({ remotion: mergeRemotionConfig(data.remotion, {
|
|
653
|
-
components: {},
|
|
654
|
-
transitions: resolved
|
|
655
|
-
}) });
|
|
656
|
-
},
|
|
657
574
|
defineVars(vars) {
|
|
658
575
|
const merged = { ...data.vars };
|
|
659
576
|
for (const [namespace, group] of Object.entries(vars)) merged[namespace] = {
|
|
@@ -702,8 +619,7 @@ const uds = createConfigBuilder({
|
|
|
702
619
|
components: {},
|
|
703
620
|
globalStyles: {},
|
|
704
621
|
preflight: true,
|
|
705
|
-
prefix: "uds"
|
|
706
|
-
remotion: void 0
|
|
622
|
+
prefix: "uds"
|
|
707
623
|
});
|
|
708
624
|
//#endregion
|
|
709
625
|
export { buildCompositeStylesReference, buildTokenReference, convertModesInputToGroups, createConfigBuilder, darker, interpolate, lighter, rem, resolveConfig, uds };
|
|
@@ -123,24 +123,6 @@ function mergeRecordByKey(base, incoming, mode) {
|
|
|
123
123
|
...incoming
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function mergeRemotionConfig(base, incoming) {
|
|
127
|
-
if (!incoming) return base;
|
|
128
|
-
if (!base) return incoming;
|
|
129
|
-
return {
|
|
130
|
-
components: {
|
|
131
|
-
...base.components,
|
|
132
|
-
...incoming.components
|
|
133
|
-
},
|
|
134
|
-
transitions: {
|
|
135
|
-
...base.transitions ?? {},
|
|
136
|
-
...incoming.transitions ?? {}
|
|
137
|
-
},
|
|
138
|
-
effects: {
|
|
139
|
-
...base.effects ?? {},
|
|
140
|
-
...incoming.effects ?? {}
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
126
|
function applyPresetToData(base, preset, strategy) {
|
|
145
127
|
const s = {
|
|
146
128
|
...defaultComponentDefinitionMergeStrategy,
|
|
@@ -165,7 +147,6 @@ function applyPresetToData(base, preset, strategy) {
|
|
|
165
147
|
motion: mergeRecordByKey(base.motion, preset.motion, s.motion),
|
|
166
148
|
components: mergeRecordByKey(base.components, preset.components, s.components),
|
|
167
149
|
globalStyles: mergeRecordByKey(base.globalStyles, preset.globalStyles, s.globalStyles),
|
|
168
|
-
remotion: mergeRemotionConfig(base.remotion, preset.remotion),
|
|
169
150
|
examples: mergedExamples,
|
|
170
151
|
designPrinciples: mergedPrinciples,
|
|
171
152
|
vars: mergedVars,
|
|
@@ -42,25 +42,8 @@ import { tabsConfig } from "../../components/dist/tabs.config.js";
|
|
|
42
42
|
import { textareaConfig } from "../../components/dist/textarea.config.js";
|
|
43
43
|
import { toastConfig } from "../../components/dist/toast.config.js";
|
|
44
44
|
import { tooltipConfig } from "../../components/dist/tooltip.config.js";
|
|
45
|
-
import { imageSlideConfig } from "../../remotion/dist/components/image-slide.config.js";
|
|
46
|
-
import { lowerThirdConfig } from "../../remotion/dist/components/lower-third.config.js";
|
|
47
|
-
import { quoteCardConfig } from "../../remotion/dist/components/quote-card.config.js";
|
|
48
|
-
import { splitScreenConfig } from "../../remotion/dist/components/split-screen.config.js";
|
|
49
|
-
import { statCardConfig } from "../../remotion/dist/components/stat-card.config.js";
|
|
50
|
-
import { textOverlayConfig } from "../../remotion/dist/components/text-overlay.config.js";
|
|
51
|
-
import { titleCardConfig } from "../../remotion/dist/components/title-card.config.js";
|
|
52
|
-
import { typingTextConfig } from "../../remotion/dist/components/typing-text.config.js";
|
|
53
|
-
import "../../remotion/dist/components/index.js";
|
|
54
|
-
import { fadeTransitionConfig } from "../../remotion/dist/transitions/fade.js";
|
|
55
|
-
import { slideDownTransitionConfig } from "../../remotion/dist/transitions/slide-down.js";
|
|
56
|
-
import { slideLeftTransitionConfig } from "../../remotion/dist/transitions/slide-left.js";
|
|
57
|
-
import { slideRightTransitionConfig } from "../../remotion/dist/transitions/slide-right.js";
|
|
58
|
-
import { slideUpTransitionConfig } from "../../remotion/dist/transitions/slide-up.js";
|
|
59
|
-
import { wipeTransitionConfig } from "../../remotion/dist/transitions/wipe.js";
|
|
60
|
-
import { zoomTransitionConfig } from "../../remotion/dist/transitions/zoom.js";
|
|
61
|
-
import "../../remotion/dist/transitions/index.js";
|
|
62
45
|
//#region ../presets/dist/defaultPreset.js
|
|
63
|
-
const defaultPreset = defaultFoundationPreset.compose(anchorConfig).compose(buttonConfig).compose(selectConfig).compose(textConfig).compose(textareaConfig).compose(inputConfig).compose(accordionConfig).compose(alertConfig).compose(avatarConfig).compose(avatarGroupConfig).compose(badgeConfig).compose(cardConfig).compose(emptyStateConfig).compose(itemConfig).compose(modalConfig).compose(dropdownConfig).compose(navHeaderConfig).compose(progressConfig).compose(sheetConfig).compose(skeletonConfig).compose(switchConfig).compose(tabsConfig).compose(toastConfig).compose(tooltipConfig).compose(breadcrumbConfig).compose(sliderConfig).compose(spinnerConfig).compose(sidebarConfig).compose(collapsibleConfig).compose(controlColorConfig).compose(controlStepperConfig).compose(controlKnobConfig).compose(controlToggleConfig).compose(controlSliderConfig).compose(controlSelectConfig).compose(controlFolderConfig).compose(controlGroupConfig).compose(controlSpringConfig).compose(controlCurveConfig).compose(controlPanelConfig).compose(presetBarConfig).compose(commandConfig).compose(commandDialogConfig).compose(commandInputConfig).compose(commandListConfig).compose(commandEmptyConfig).compose(commandGroupConfig).compose(commandItemConfig).compose(commandShortcutConfig).compose(commandSeparatorConfig).
|
|
46
|
+
const defaultPreset = defaultFoundationPreset.compose(anchorConfig).compose(buttonConfig).compose(selectConfig).compose(textConfig).compose(textareaConfig).compose(inputConfig).compose(accordionConfig).compose(alertConfig).compose(avatarConfig).compose(avatarGroupConfig).compose(badgeConfig).compose(cardConfig).compose(emptyStateConfig).compose(itemConfig).compose(modalConfig).compose(dropdownConfig).compose(navHeaderConfig).compose(progressConfig).compose(sheetConfig).compose(skeletonConfig).compose(switchConfig).compose(tabsConfig).compose(toastConfig).compose(tooltipConfig).compose(breadcrumbConfig).compose(sliderConfig).compose(spinnerConfig).compose(sidebarConfig).compose(collapsibleConfig).compose(controlColorConfig).compose(controlStepperConfig).compose(controlKnobConfig).compose(controlToggleConfig).compose(controlSliderConfig).compose(controlSelectConfig).compose(controlFolderConfig).compose(controlGroupConfig).compose(controlSpringConfig).compose(controlCurveConfig).compose(controlPanelConfig).compose(presetBarConfig).compose(commandConfig).compose(commandDialogConfig).compose(commandInputConfig).compose(commandListConfig).compose(commandEmptyConfig).compose(commandGroupConfig).compose(commandItemConfig).compose(commandShortcutConfig).compose(commandSeparatorConfig).defineGlobalStyles((_tokens) => ({
|
|
64
47
|
"*": { scrollbarWidth: "none" },
|
|
65
48
|
"::-webkit-scrollbar": { display: "none" }
|
|
66
49
|
}));
|