From c4ff9d1cab67ae2e4865d99f6beb97dab126d7a3 Mon Sep 17 00:00:00 2001 From: csandman Date: Fri, 25 Oct 2024 14:01:13 -0400 Subject: [PATCH 1/3] Update package.json exports field to properly export types for each build type --- package.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4e521aa..38fbd57 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,14 @@ }, "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } }, "./package.json": "./package.json" }, From a703fe38ac9f67bca17571f91de1359409f20a78 Mon Sep 17 00:00:00 2001 From: csandman Date: Fri, 25 Oct 2024 14:01:27 -0400 Subject: [PATCH 2/3] Stop minifying build --- tsup.config.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tsup.config.ts b/tsup.config.ts index b812dd5..9fe919f 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -5,8 +5,6 @@ export default defineConfig({ entry: ["src/index.ts"], format: ["cjs", "esm"], target: "es2019", - sourcemap: true, dts: true, - minify: true, treeshake: true, }); From 765b6442fc86651af4b99299d1679462b5a07125 Mon Sep 17 00:00:00 2001 From: csandman Date: Thu, 31 Oct 2024 19:28:24 -0400 Subject: [PATCH 3/3] Update deprecated docs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ce1bf4b..6e8624b 100644 --- a/README.md +++ b/README.md @@ -526,9 +526,9 @@ The API for an individual style function looks like this: ```js /** - * @param {CSSObject} provided -- The component's default Chakra styles + * @param {SystemStyleObject} provided -- The component's default Chakra styles * @param {Object} state -- The component's current state e.g. `isFocused` (this gives all of the same props that are passed into the component) - * @returns {CSSObject} An output style object which is forwarded to the component's `sx` prop + * @returns {SystemStyleObject} An output style object which is forwarded to the component's `sx` prop */ function option(provided, state) { return { @@ -807,7 +807,7 @@ offered by this package: `chakraStyles` that can be passed to customize the component styles. This is almost identical to the built-in `StylesConfig` type, however, it uses Chakra's - [`CSSObject`](https://github.com/chakra-ui/chakra-ui/blob/790d2417a3f5d59e2d69229a027af671c2dc0cbc/packages/styled-system/src/system.types.ts#L81) + [`SystemStyleObject`](https://github.com/chakra-ui/chakra-ui/blob/v2/packages/styled-system/src/system.types.ts#L80) type instead of react-select's emotion styles. It also has the same three generics as your `Select` component which would be required if you define your styles separately from your component. @@ -1042,7 +1042,7 @@ const App = () => ( components={asyncComponents} loadOptions={(inputValue, callback) => { setTimeout(() => { - const values = colourOptions.filter((i) => + const values = colorOptions.filter((i) => i.label.toLowerCase().includes(inputValue.toLowerCase()) ); callback(values);