diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb1ea0..d65786b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.1.3](https://github.com/cinnyapp/folds/compare/v1.1.2...v1.1.3) (2023-05-13) + +### Bug Fixes + +- as types ([#19](https://github.com/cinnyapp/folds/issues/19)) ([0fc2b04](https://github.com/cinnyapp/folds/commit/0fc2b04fa77bae4e1dc0e61a01b0a331416c80a6)) + ## [1.1.2](https://github.com/cinnyapp/folds/compare/v1.1.1...v1.1.2) (2023-05-11) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index 8f066db..196f546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "folds", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "folds", - "version": "1.1.2", + "version": "1.1.3", "license": "Apache-2.0", "dependencies": { "@fontsource/inter": "^4.5.12", diff --git a/package.json b/package.json index 608dd17..405d633 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "folds", - "version": "1.1.2", + "version": "1.1.3", "author": "Ajay Bura (ajbura)", "license": "Apache-2.0", "main": "dist/index.js", diff --git a/src/components/as.tsx b/src/components/as.tsx index ec2c083..5c3c6f4 100644 --- a/src/components/as.tsx +++ b/src/components/as.tsx @@ -1,12 +1,12 @@ import { ElementType, forwardRef, ReactElement } from "react"; -import { AsComponentProps, RefOfType } from "./types"; +import { ComponentProps, AsProp, RefOfType } from "./types"; export const as = ( fc: ( - props: Omit, keyof ExtraProps> & ExtraProps, + props: Omit, keyof ExtraProps | keyof AsProp> & AsProp & ExtraProps, ref: RefOfType ) => ReactElement ) => - forwardRef(fc) as unknown as ( - props: Omit, keyof ExtraProps> & ExtraProps + forwardRef(fc) as unknown as ( + props: Omit, keyof ExtraProps | keyof AsProp> & AsProp & ExtraProps ) => ReactElement; diff --git a/src/components/icon/Icons.tsx b/src/components/icon/Icons.tsx index dbe58b7..f7b7823 100644 --- a/src/components/icon/Icons.tsx +++ b/src/components/icon/Icons.tsx @@ -12,6 +12,7 @@ export type IconName = | "Explore" | "Smile" | "SmilePlus" + | "Leaf" | "Sticker" | "Delete" | "Phone" @@ -51,6 +52,7 @@ export type IconName = | "Eye" | "EyeBlind" | "Warning" + | "Funnel" | "Hash" | "HashLock" | "HashGlobe" @@ -330,7 +332,22 @@ export const Icons: Record = { ), - + Leaf: (filled) => + filled ? ( + + ) : ( + + ), Sticker: (filled) => filled ? ( <> @@ -1188,19 +1205,19 @@ export const Icons: Record = { filled ? ( <> @@ -1208,7 +1225,7 @@ export const Icons: Record = { ), @@ -1279,6 +1296,17 @@ export const Icons: Record = { ), + Funnel: (filled) => + filled ? ( + + ) : ( + + ), Hash: () => ( = ComponentPropsWithRef["ref"]; -type AsProp = { +export type AsProp = { as?: E; }; -export type AsComponentProps = PropsWithChildren< - ComponentPropsWithRef & AsProp ->; +export type ComponentProps = PropsWithChildren>;