mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-16 01:21:49 +02:00
🎨 Update UI package (#1070)
Add new components and update various existing ones.
This commit is contained in:
parent
a4ffbee081
commit
e6792a4283
33 changed files with 386 additions and 56 deletions
22
packages/ui/src/helpers/component-props.ts
Normal file
22
packages/ui/src/helpers/component-props.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import type React from "react";
|
||||
|
||||
type ComponentPropsAs<
|
||||
C extends React.ElementType<any>,
|
||||
T extends React.ComponentPropsWithoutRef<C>["as"],
|
||||
> = Omit<
|
||||
Extract<React.ComponentPropsWithoutRef<C>, { as: T }>,
|
||||
"as" | "asChild"
|
||||
>;
|
||||
|
||||
// Omits the specified props from the component props. Autocomplete will suggest props
|
||||
// of the component, but won't restrict the omittable props to those that actually exist.
|
||||
type ComponentPropsWithout<
|
||||
T extends React.ElementType,
|
||||
O extends
|
||||
| Omit<string, keyof React.ComponentPropsWithoutRef<T>>
|
||||
| keyof React.ComponentPropsWithoutRef<T>,
|
||||
> = Omit<React.ComponentPropsWithoutRef<T>, O & string>;
|
||||
|
||||
type RemovedProps = "asChild" | "defaultChecked" | "defaultValue" | "color";
|
||||
|
||||
export type { ComponentPropsAs, ComponentPropsWithout, RemovedProps };
|
Loading…
Add table
Add a link
Reference in a new issue