Skip to content

Commit

Permalink
Merge pull request #346 from csandman/exports-and-build
Browse files Browse the repository at this point in the history
Improve the `exports` and modify the tsup build config
  • Loading branch information
csandman authored Nov 1, 2024
2 parents 7f4b743 + 765b644 commit e8916bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 0 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export default defineConfig({
entry: ["src/index.ts"],
format: ["cjs", "esm"],
target: "es2019",
sourcemap: true,
dts: true,
minify: true,
treeshake: true,
});

0 comments on commit e8916bb

Please sign in to comment.