Skip to content

Commit

Permalink
fix for missing properties (#16)
Browse files Browse the repository at this point in the history
* fix for missing properties when no conditions are specified

* add changeset
  • Loading branch information
nsaunders authored May 18, 2024
1 parent e005503 commit 26def23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-lies-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@embellish/react": patch
---

fix for missing properties when no conditions are specified
11 changes: 6 additions & 5 deletions packages/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ export type BoxComponent<ConditionName, Properties> = <
JSX.LibraryManagedAttributes<Is, ComponentPropsWithRef<Is>>,
"style"
> &
StyleProps<
"initial" | Exclude<ConditionName | LocalConditionName, unknown>,
Properties
>
StyleProps<"initial" | ConditionName | LocalConditionName, Properties>
) => JSX.Element;

export type GetProperties<ConfigProperties> = Partial<{
Expand Down Expand Up @@ -105,7 +102,11 @@ export type EmbellishResult<ConditionName, Properties> = {
Box: BoxComponent<ConditionName, Properties>;
};

export type EmbellishFn = <ConditionName, ConfigProperties>(
export type EmbellishFn = <
Conditions,
ConfigProperties,
ConditionName = Conditions extends Record<infer C, unknown> ? C : never
>(
config: Config<ConditionName, ConfigProperties>
) => EmbellishResult<ConditionName, GetProperties<ConfigProperties>>;

Expand Down

0 comments on commit 26def23

Please sign in to comment.