Skip to content

Commit

Permalink
rollup config; typings
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeen committed Dec 8, 2024
1 parent 7700078 commit e4ac264
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Changelog

- `4.0.0-alpha` - Dec 1, 2024 - **In development**
- `4.0.0-alpha` - Dec 7, 2024 - **In development**
- Breaking changes:
- Minimum react version updated to 16.8.0 (hooks)
- `classes` prop has been renamed `className`
- `onBlur` callback is no longer passed the selected value, just the event
- `onBlur` callback is no longer passed the selected value as first argument, just the event
- `3.7.0` - Nov 21, 2024
- Upgrade country-region-data to 3.1.0.
- `3.6.1` - Aug 3, 2022
Expand Down
10 changes: 5 additions & 5 deletions packages/react-country-region-selector/config/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ const config: RollupOptions[] = [
external: ['react', 'react-dom', 'react/jsx-runtime'],
},

// {
// input: './src/types.d.ts',
// output: [{ file: 'dist/types.d.ts', format: 'es' }],
// plugins: [dts()],
// },
{
input: './src/index.ts',
output: [{ file: 'dist/types.d.ts', format: 'es' }],
plugins: [dts()],
},
];

export default config;
7 changes: 5 additions & 2 deletions packages/react-country-region-selector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
"@types/react-dom": "18.3.0"
},
"files": [
"dist",
"index.d.ts"
"dist/rcrs.es.js",
"dist/rcrs.es.js.map",
"dist/rcrs.js",
"dist/rcrs.js.map",
"dist/types.d.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CountryDropdown: FC<CountryDropdownProps> = ({
showDefaultOption = true,
defaultOptionLabel = 'Select Country',
priorityOptions = [],
onChange = (value: string, e: any) => null,
onChange = () => null,
onBlur = () => null,
labelType = 'full',
valueType = 'full',
Expand All @@ -24,7 +24,7 @@ export const CountryDropdown: FC<CountryDropdownProps> = ({
disabled = false,
customRender = defaultRender,
...arbitraryProps
}) => {
}): JSX.Element => {
const countries: RenderDataOption[] = useMemo(() => {
const countries = filterCountries(
CountryRegionData as unknown as CountryRegionDataMinified[],
Expand Down
2 changes: 1 addition & 1 deletion packages/react-country-region-selector/src/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const findDuplicates = (
.map(({ label }) => label);
};

export const defaultRender = (data: RenderData) => {
export const defaultRender = (data: RenderData): JSX.Element => {
const { options, ...rest } = data;
return (
<select {...rest}>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-country-region-selector/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface CountryDropdownProps extends NativeDropdownProps {
*
* Default value: undefined
*/
readonly onChange?: (value: string, event?: any) => null;
readonly onChange?: (value: string, event?: any) => void;

/**
* Callback that gets called when the user blurs off the country field.
Expand Down Expand Up @@ -155,7 +155,7 @@ export interface RegionDropdownProps extends NativeDropdownProps {
*
* Default value: undefined
*/
readonly onChange?: (value: string, event?: any) => null;
readonly onChange?: (value: string, event?: any) => void;

/**
* The ID of the generated select box. Not added by default.
Expand Down
11 changes: 0 additions & 11 deletions packages/react-country-region-selector/tsconfig-original.json

This file was deleted.

0 comments on commit e4ac264

Please sign in to comment.