Skip to content

Commit

Permalink
Fix: Typings and changed react component to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
saschb2b committed Aug 22, 2024
1 parent e6f26c4 commit c0a98f9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions lib/components/CurrencyTextField/CurrencyTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ interface CurrencyTextFieldProps
* This component provides a text field for currency input, supporting custom formatting options.
* It handles value formatting using the NumericFormat component from react-number-format.
*/
const CurrencyTextField: React.FC<CurrencyTextFieldProps> = ({
export const CurrencyTextField: React.FC<CurrencyTextFieldProps> = ({
decimalCharacter = ',',
digitGroupSeparator = '.',
currency = 'USD',
Expand Down Expand Up @@ -198,5 +198,3 @@ const CurrencyTextField: React.FC<CurrencyTextFieldProps> = ({
/>
);
};

export default CurrencyTextField;
2 changes: 1 addition & 1 deletion lib/components/CurrencyTextField/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './CurrencyTextField';
export * from './CurrencyTextField';
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "module",
"main": "dist/material-ui-currency-textfield.umd.js",
"module": "dist/material-ui-currency-textfield.js",
"types": "dist/index.d.ts",
"types": "dist/material-ui-currency-textfield.d.ts",
"files": [
"dist"
],
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Dinero from 'dinero.js';
import CurrencyTextField from '../lib/components/CurrencyTextField';
import { CurrencyTextField } from '../dist/material-ui-currency-textfield';
import { Typography } from '@mui/material';

export const App: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
build: {
copyPublicDir: false,
lib: {
entry: resolve(__dirname, 'lib/index.ts'),
entry: resolve(__dirname, 'lib/material-ui-currency-textfield.ts'),
name: 'material-ui-currency-textfield',
},
rollupOptions: {
Expand Down

0 comments on commit c0a98f9

Please sign in to comment.