Skip to content
Open
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f5d622e
fix(extendVariants): return component type error
IsDyh01 Oct 10, 2025
3858ffd
fix(CompoundVariants): correct type inference for extended/compound v…
ITBoomBKStudio Oct 24, 2025
84aaa3e
test: cover compound/extend inference; enforce CP required props
ITBoomBKStudio Oct 24, 2025
5ab2c68
fix(types): correct CompoundVariants class value inference
ITBoomBKStudio Oct 24, 2025
2dfa44c
fix(system-rsc): correct slot detection in getSlots()
ITBoomBKStudio Oct 24, 2025
6336fa8
fix(types): make ExtendVariants props optional and guard V[key] with …
ITBoomBKStudio Oct 25, 2025
b770b54
test(extendVariants): add compoundVariants integration test
ITBoomBKStudio Oct 25, 2025
0293552
fix(system-rsc): getSlots() brief JSDoc comment added
ITBoomBKStudio Oct 25, 2025
0021c8f
test(extendVariants): new styles - extended & fixed styles - origina…
ITBoomBKStudio Oct 25, 2025
73032ce
test(extendVariants): fixed slot component variant styles extended test
ITBoomBKStudio Oct 25, 2025
8baeab2
fix(types): avoid leaking React internals by removing PropsWithoutRef
ITBoomBKStudio Oct 26, 2025
4e64ece
chore(changeset): add patch for extendVariants and CompoundVariants t…
ITBoomBKStudio Oct 26, 2025
c878267
chore(system-rsc): add changeset for getSlots() slot detection fix
ITBoomBKStudio Oct 26, 2025
d18110f
refactor(types): unify slot value inference via GetSuggestedValues<S>…
ITBoomBKStudio Oct 26, 2025
5bbef15
Merge pull request #1 from ITBoomBKStudio/fix/getslots-logic
ITBoomBKStudio Nov 26, 2025
9f38de7
fix(extendVariants): improved as-prop handling and exclude classNames…
ITBoomBKStudio Nov 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions packages/core/system-rsc/src/extend-variants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ type VariantValue<V, SV> = {

type DefaultVariants<V, SV> = VariantValue<V, SV>;

type CompoundVariants<V, SV> = Array<VariantValue<V, SV> & ClassProp<ClassValue>>;
type CompoundVariants<V, SV, S> = Array<
VariantValue<V, SV> &
ClassProp<S extends undefined ? ClassValue : ClassValue | SlotsClassValue<S>>
>;

type Options = {
/**
Expand Down Expand Up @@ -92,7 +95,7 @@ export type ExtendVariants = {
V extends ComposeVariants<CP, S>,
SV extends SuggestedVariants<CP, S>,
DV extends DefaultVariants<V, SV>,
CV extends CompoundVariants<V, SV>,
CV extends CompoundVariants<V, SV, ComponentSlots<CP>>,
>(
BaseComponent: C,
styles: {
Expand All @@ -103,11 +106,11 @@ export type ExtendVariants = {
},
opts?: Options,
): ForwardRefExoticComponent<
PropsWithoutRef<
CP & {
[key in keyof V]?: StringToBoolean<keyof V[key]>;
}
> &
PropsWithoutRef<{
[key in keyof CP | keyof V]?:
| (key extends keyof CP ? CP[key] : never)
| (key extends keyof V ? StringToBoolean<keyof V[key]> : never);
}> &
RefAttributes<InferRef<C>>
>;
};
Expand Down