cari-ui-kit 0.1.21 → 0.1.22

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.
@@ -1,7 +1,8 @@
1
1
  import { ElementType } from 'react';
2
2
  import { COLORS } from '../../foundation/colors';
3
3
  import { SIZES } from '../../foundation/sizes';
4
- export interface IButtonProps {
4
+ import { IPolymorphicProps } from '../../types/polymorphic';
5
+ export interface IButtonOwnProps {
5
6
  className?: string;
6
7
  label?: string;
7
8
  prefix?: React.ReactNode;
@@ -17,7 +18,6 @@ export interface IButtonProps {
17
18
  isCircle?: boolean;
18
19
  isHiddenLabel?: boolean;
19
20
  type?: 'button' | 'submit' | 'reset';
20
- as?: ElementType;
21
- [key: string]: unknown;
22
21
  }
23
- export declare const Button: (props: IButtonProps) => import("react/jsx-runtime").JSX.Element;
22
+ export type IButtonProps<C extends ElementType = 'button'> = IPolymorphicProps<C, IButtonOwnProps>;
23
+ export declare const Button: <C extends ElementType = "button">(props: IButtonProps<C>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
1
  export { Button } from './Button';
2
+ export type { IButtonProps, IButtonOwnProps } from './Button';
@@ -0,0 +1,4 @@
1
+ import { ComponentPropsWithoutRef, ElementType } from 'react';
2
+ export type IPolymorphicProps<C extends ElementType, OwnProps = object> = OwnProps & {
3
+ as?: C;
4
+ } & Omit<ComponentPropsWithoutRef<C>, keyof OwnProps | 'as'>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cari-ui-kit",
3
3
  "private": false,
4
- "version": "0.1.21",
4
+ "version": "0.1.22",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",