From 22fd53d1f4ebf58e66db93fddef0fa9ce39df543 Mon Sep 17 00:00:00 2001 From: David Barry Date: Mon, 20 Nov 2023 13:16:05 +0000 Subject: [PATCH] JS Declaration File Fix (#768) * switch to index.ts so tsc can generate index.d.ts * typo * 5.6.2 * 5.6.3-0 * example of fixing the index.js generation issue * Convert index.js -> index.ts * 5.6.3-1 * snackbar context retrun typed correctly * uninstall unwanted dependencies * 5.6.3-2 * OS agnostic clean --------- Co-authored-by: Matthew Corner Co-authored-by: Manjesh M Pillai <56511816+m4manjesh@users.noreply.github.com> --- package-lock.json | 504 +++++++++++++++++- package.json | 5 +- src/Canvas/index.js | 1 - src/Canvas/{index.d.ts => index.ts} | 6 +- src/CanvasItem/CanvasItem.jsx | 113 ---- src/CanvasItem/index.d.ts | 37 -- src/CanvasItem/index.js | 1 - src/CanvasItem/index.ts | 126 +++++ src/Card/TableCard/index.js | 1 - src/Card/TableCard/{index.d.ts => index.ts} | 6 +- src/Card/index.d.ts | 1 - src/Checkbox/index.js | 1 - src/Checkbox/{index.d.ts => index.ts} | 6 +- src/Color/index.js | 1 - src/Color/{index.d.ts => index.ts} | 6 +- src/Copyright/index.d.ts | 5 - src/Copyright/index.js | 1 - src/Copyright/index.ts | 5 + src/DialogTitle/index.js | 1 - src/DialogTitle/{index.d.ts => index.ts} | 6 +- src/FeedbackForm/index.js | 1 - src/FeedbackForm/{index.d.ts => index.ts} | 6 +- src/Filter/CheckboxFilter/CheckboxFilter.jsx | 45 -- src/Filter/CheckboxFilter/index.js | 1 - .../CheckboxFilter/{index.d.ts => index.ts} | 6 +- src/Filter/FilterPopper/index.js | 1 - .../FilterPopper/{index.d.ts => index.ts} | 6 +- src/Filter/FilterStack/index.js | 1 - .../FilterStack/{index.d.ts => index.ts} | 6 +- src/Filter/LabelFilter/LabelFilter.jsx | 46 -- src/Filter/LabelFilter/index.js | 1 - .../LabelFilter/{index.d.ts => index.ts} | 5 +- src/Filter/RangeFilter/index.js | 1 - .../RangeFilter/{index.d.ts => index.ts} | 6 +- src/Filter/index.js | 5 - src/Filter/{index.d.ts => index.ts} | 0 src/FontPicker/index.js | 1 - src/FontPicker/{index.d.ts => index.ts} | 6 +- src/FontStyle/index.js | 1 - src/FontStyle/{index.d.ts => index.ts} | 6 +- .../DeleteLabelDialog/DeleteLabelDialog.jsx | 28 - src/LabelSelector/DeleteLabelDialog/index.js | 1 - .../{index.d.ts => index.ts} | 5 +- .../EditLabelDialog/EditLabelDialog.jsx | 78 --- src/LabelSelector/EditLabelDialog/index.d.ts | 16 - src/LabelSelector/EditLabelDialog/index.js | 1 - src/LabelSelector/EditLabelDialog/index.ts | 36 ++ src/Loading/index.d.ts | 7 - src/Loading/index.js | 1 - src/Loading/index.ts | 7 + src/LoginForm/index.js | 1 - src/LoginForm/{index.d.ts => index.ts} | 6 +- src/MultiColor/index.js | 1 - src/MultiColor/{index.d.ts => index.ts} | 6 +- src/MultiLabelPopover/index.js | 1 - .../{index.d.ts => index.ts} | 6 +- src/MultiText/index.js | 1 - src/MultiText/{index.d.ts => index.ts} | 6 +- src/NumberField/index.js | 1 - src/NumberField/{index.d.ts => index.ts} | 5 +- src/PasswordChangeDialog/index.js | 1 - .../{index.d.ts => index.ts} | 5 +- src/PasswordChangeForm/index.js | 1 - .../{index.d.ts => index.ts} | 6 +- src/PasswordResetForm/index.js | 1 - .../{index.d.ts => index.ts} | 6 +- src/RadioButtons/index.js | 1 - src/RadioButtons/{index.d.ts => index.ts} | 6 +- src/RegistrationForm/index.js | 1 - src/RegistrationForm/{index.d.ts => index.ts} | 6 +- src/Select/index.js | 1 - src/Select/{index.d.ts => index.ts} | 5 +- src/Slider/index.js | 1 - src/Slider/{index.d.ts => index.ts} | 6 +- src/SnackbarProvider/SnackbarContext.tsx | 14 +- src/SnackbarProvider/SnackbarProvider.tsx | 41 +- src/SvgIcons/VirtoBuild/index.js | 1 - .../VirtoBuild/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoData/index.js | 1 - .../VirtoData/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoFleet/index.js | 1 - .../VirtoFleet/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoID/index.js | 1 - src/SvgIcons/VirtoID/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoLogo/index.js | 1 - .../VirtoLogo/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoModel/index.js | 1 - .../VirtoModel/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoResult/index.d.ts | 7 - src/SvgIcons/VirtoResult/index.js | 1 - src/SvgIcons/VirtoResult/index.ts | 6 + src/SvgIcons/VirtoScene/index.js | 1 - .../VirtoScene/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoTest/index.js | 1 - .../VirtoTest/{index.d.ts => index.ts} | 5 +- src/SvgIcons/VirtoVehicle/index.d.ts | 7 - src/SvgIcons/VirtoVehicle/index.js | 1 - src/SvgIcons/VirtoVehicle/index.ts | 6 + src/SwitchField/index.js | 1 - src/SwitchField/{index.d.ts => index.ts} | 5 +- src/ToggleColorMode/index.js | 1 - src/ToggleColorMode/{index.d.ts => index.ts} | 6 +- src/ViewToggleButton/index.js | 1 - src/ViewToggleButton/{index.d.ts => index.ts} | 5 +- 104 files changed, 823 insertions(+), 572 deletions(-) delete mode 100644 src/Canvas/index.js rename src/Canvas/{index.d.ts => index.ts} (90%) delete mode 100644 src/CanvasItem/index.d.ts delete mode 100644 src/CanvasItem/index.js create mode 100644 src/CanvasItem/index.ts delete mode 100644 src/Card/TableCard/index.js rename src/Card/TableCard/{index.d.ts => index.ts} (60%) delete mode 100644 src/Card/index.d.ts delete mode 100644 src/Checkbox/index.js rename src/Checkbox/{index.d.ts => index.ts} (71%) delete mode 100644 src/Color/index.js rename src/Color/{index.d.ts => index.ts} (68%) delete mode 100644 src/Copyright/index.d.ts delete mode 100644 src/Copyright/index.js create mode 100644 src/Copyright/index.ts delete mode 100644 src/DialogTitle/index.js rename src/DialogTitle/{index.d.ts => index.ts} (57%) delete mode 100644 src/FeedbackForm/index.js rename src/FeedbackForm/{index.d.ts => index.ts} (70%) delete mode 100644 src/Filter/CheckboxFilter/index.js rename src/Filter/CheckboxFilter/{index.d.ts => index.ts} (66%) delete mode 100644 src/Filter/FilterPopper/index.js rename src/Filter/FilterPopper/{index.d.ts => index.ts} (50%) delete mode 100644 src/Filter/FilterStack/index.js rename src/Filter/FilterStack/{index.d.ts => index.ts} (59%) delete mode 100644 src/Filter/LabelFilter/index.js rename src/Filter/LabelFilter/{index.d.ts => index.ts} (71%) delete mode 100644 src/Filter/RangeFilter/index.js rename src/Filter/RangeFilter/{index.d.ts => index.ts} (62%) delete mode 100644 src/Filter/index.js rename src/Filter/{index.d.ts => index.ts} (100%) delete mode 100644 src/FontPicker/index.js rename src/FontPicker/{index.d.ts => index.ts} (76%) delete mode 100644 src/FontStyle/index.js rename src/FontStyle/{index.d.ts => index.ts} (72%) delete mode 100644 src/LabelSelector/DeleteLabelDialog/index.js rename src/LabelSelector/DeleteLabelDialog/{index.d.ts => index.ts} (68%) delete mode 100644 src/LabelSelector/EditLabelDialog/index.d.ts delete mode 100644 src/LabelSelector/EditLabelDialog/index.js create mode 100644 src/LabelSelector/EditLabelDialog/index.ts delete mode 100644 src/Loading/index.d.ts delete mode 100644 src/Loading/index.js create mode 100644 src/Loading/index.ts delete mode 100644 src/LoginForm/index.js rename src/LoginForm/{index.d.ts => index.ts} (64%) delete mode 100644 src/MultiColor/index.js rename src/MultiColor/{index.d.ts => index.ts} (59%) delete mode 100644 src/MultiLabelPopover/index.js rename src/MultiLabelPopover/{index.d.ts => index.ts} (50%) delete mode 100644 src/MultiText/index.js rename src/MultiText/{index.d.ts => index.ts} (60%) delete mode 100644 src/NumberField/index.js rename src/NumberField/{index.d.ts => index.ts} (84%) delete mode 100644 src/PasswordChangeDialog/index.js rename src/PasswordChangeDialog/{index.d.ts => index.ts} (76%) delete mode 100644 src/PasswordChangeForm/index.js rename src/PasswordChangeForm/{index.d.ts => index.ts} (62%) delete mode 100644 src/PasswordResetForm/index.js rename src/PasswordResetForm/{index.d.ts => index.ts} (58%) delete mode 100644 src/RadioButtons/index.js rename src/RadioButtons/{index.d.ts => index.ts} (77%) delete mode 100644 src/RegistrationForm/index.js rename src/RegistrationForm/{index.d.ts => index.ts} (72%) delete mode 100644 src/Select/index.js rename src/Select/{index.d.ts => index.ts} (83%) delete mode 100644 src/Slider/index.js rename src/Slider/{index.d.ts => index.ts} (87%) delete mode 100644 src/SvgIcons/VirtoBuild/index.js rename src/SvgIcons/VirtoBuild/{index.d.ts => index.ts} (50%) delete mode 100644 src/SvgIcons/VirtoData/index.js rename src/SvgIcons/VirtoData/{index.d.ts => index.ts} (51%) delete mode 100644 src/SvgIcons/VirtoFleet/index.js rename src/SvgIcons/VirtoFleet/{index.d.ts => index.ts} (50%) delete mode 100644 src/SvgIcons/VirtoID/index.js rename src/SvgIcons/VirtoID/{index.d.ts => index.ts} (52%) delete mode 100644 src/SvgIcons/VirtoLogo/index.js rename src/SvgIcons/VirtoLogo/{index.d.ts => index.ts} (51%) delete mode 100644 src/SvgIcons/VirtoModel/index.js rename src/SvgIcons/VirtoModel/{index.d.ts => index.ts} (50%) delete mode 100644 src/SvgIcons/VirtoResult/index.d.ts delete mode 100644 src/SvgIcons/VirtoResult/index.js create mode 100644 src/SvgIcons/VirtoResult/index.ts delete mode 100644 src/SvgIcons/VirtoScene/index.js rename src/SvgIcons/VirtoScene/{index.d.ts => index.ts} (50%) delete mode 100644 src/SvgIcons/VirtoTest/index.js rename src/SvgIcons/VirtoTest/{index.d.ts => index.ts} (51%) delete mode 100644 src/SvgIcons/VirtoVehicle/index.d.ts delete mode 100644 src/SvgIcons/VirtoVehicle/index.js create mode 100644 src/SvgIcons/VirtoVehicle/index.ts delete mode 100644 src/SwitchField/index.js rename src/SwitchField/{index.d.ts => index.ts} (73%) delete mode 100644 src/ToggleColorMode/index.js rename src/ToggleColorMode/{index.d.ts => index.ts} (50%) delete mode 100644 src/ViewToggleButton/index.js rename src/ViewToggleButton/{index.d.ts => index.ts} (66%) diff --git a/package-lock.json b/package-lock.json index 3829902d1..8b8a8682f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ipguk/react-ui", - "version": "5.6.1", + "version": "5.6.3-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ipguk/react-ui", - "version": "5.6.1", + "version": "5.6.3-2", "hasInstallScript": true, "license": "MIT", "devDependencies": { @@ -74,6 +74,7 @@ "react-dom": "^18.2.0", "react-hook-form": "^7.47.0", "react-text-mask": "^5.5.0", + "rimraf": "^5.0.5", "storybook": "^7.5.2", "storybook-dark-mode": "^3.0.1", "ts-jest": "^29.1.1", @@ -2688,6 +2689,54 @@ "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==", "dev": true }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/darwin-arm64": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", @@ -2704,6 +2753,278 @@ "node": ">=12" } }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "dev": true, @@ -15045,6 +15366,21 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/c8/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/c8/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -18171,6 +18507,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/del/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "dev": true, @@ -18996,6 +19347,22 @@ "esbuild": ">=0.12 <1" } }, + "node_modules/esbuild/node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/escalade": { "version": "3.1.1", "dev": true, @@ -20989,6 +21356,21 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/flatiron": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/flatiron/-/flatiron-0.4.3.tgz", @@ -35283,6 +35665,22 @@ "node": ">=10" } }, + "node_modules/react-scripts/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/react-scripts/node_modules/semver": { "version": "7.5.0", "dev": true, @@ -36236,14 +36634,92 @@ "peer": true }, "node_modules/rimraf": { - "version": "3.0.2", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", + "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", "dev": true, - "license": "ISC", "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/rimraf/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -40455,6 +40931,22 @@ "license": "MIT", "peer": true }, + "node_modules/webpack-dev-server/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/webpack-dev-server/node_modules/schema-utils": { "version": "4.0.1", "dev": true, diff --git a/package.json b/package.json index 18391fff4..201017e86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ipguk/react-ui", - "version": "5.6.1", + "version": "5.6.3-2", "description": "React UI component library for IPG web applications", "author": "IPG-Automotive-UK", "license": "MIT", @@ -11,7 +11,7 @@ }, "scripts": { "build": "npm run clean && tsc && npm run copy-files", - "clean": "rm -rf dist", + "clean": "rimraf dist", "copy-files": "copyfiles -e '**/*.test.**' -e '**/*.spec.**' -e '**/*.stories.**' -u 1 src/**/*.html src/**/*.css src/**/*.ts src/**/*.tsx dist/", "postinstall": "npx playwright install --with-deps", "prepublishOnly": "npm run build", @@ -93,6 +93,7 @@ "react-dom": "^18.2.0", "react-hook-form": "^7.47.0", "react-text-mask": "^5.5.0", + "rimraf": "^5.0.5", "storybook": "^7.5.2", "storybook-dark-mode": "^3.0.1", "ts-jest": "^29.1.1", diff --git a/src/Canvas/index.js b/src/Canvas/index.js deleted file mode 100644 index bba191881..000000000 --- a/src/Canvas/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Canvas"; diff --git a/src/Canvas/index.d.ts b/src/Canvas/index.ts similarity index 90% rename from src/Canvas/index.d.ts rename to src/Canvas/index.ts index 15526a7bd..59b8742c0 100644 --- a/src/Canvas/index.d.ts +++ b/src/Canvas/index.ts @@ -1,5 +1,7 @@ import { SxProps, Theme } from "@mui/material/styles"; +import Canvas from "./Canvas"; + export type CanvasProps = { backgroundColor?: string; backgroundImage?: string; @@ -31,6 +33,4 @@ export type CanvasProps = { width?: number; }; -declare const Canvas: React.FC; - -export default Canvas; +export default Canvas as React.FC; diff --git a/src/CanvasItem/CanvasItem.jsx b/src/CanvasItem/CanvasItem.jsx index 7211001ab..5a6e8e776 100644 --- a/src/CanvasItem/CanvasItem.jsx +++ b/src/CanvasItem/CanvasItem.jsx @@ -2,7 +2,6 @@ import * as React from "react"; import { centerToTL, degToRadian, getNewStyle, tLToCenter } from "./utils"; -import PropTypes from "prop-types"; import Rect from "./Rect"; /** @@ -145,115 +144,3 @@ export default function CanvasItem({ ); } - -CanvasItem.propTypes = { - /** - * Aspect ratio of the item. If set, the item will be resized to keep the aspect ratio when resizing. If not set, the item will be resized freely. - */ - aspectRatio: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]), - - /** - * The height of the item. - */ - height: PropTypes.number.isRequired, - - /** - * The left position of the item. - */ - left: PropTypes.number.isRequired, - - /** - * The minimum height of the item. - */ - minHeight: PropTypes.number, - /** - * The minimum width of the item. - */ - minWidth: PropTypes.number, - /** - * Callback function when the item is clicked. - * - * **Signature** - * - * ``` - * function(event: ReactMouseEvent) => void - * ``` - * event: The event source of the callback. - */ - onClick: PropTypes.func, - /** - * Callback function when the item is dragged. - * - * **Signature** - * - * ``` - * function(top: number, left: number) => void - * ``` - * - * top: The new top position of the item. - * - * left: The new left position of the item. - */ - onDrag: PropTypes.func, - /** - * Callback function when the item is resized. - * - * **Signature** - * ``` - * function({top: number, left: number, width: number, height: number, rotateAngle: number}, isShiftKey: boolean, type: string) => void - * ``` - * - * top: The new top position of the item. - * - * left: The new left position of the item. - * - * width: The new width of the item. - * - * height: The new height of the item. - * - * rotateAngle: The new rotate angle of the item. - * - * isShiftKey: Whether the shift key is pressed. - * - * type: The type of the resize handle. - */ - onResize: PropTypes.func, - /** - * Callback function when the item is rotated. - * - * **Signature** - * - * ``` - * function(rotateAngle: number) => void - * ``` - * - * rotateAngle: The new rotate angle of the item. - */ - onRotate: PropTypes.func, - /** - * The allowable resize directions of the item. Array of 'n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'. - */ - resizeDirection: PropTypes.arrayOf( - PropTypes.oneOf(["n", "ne", "e", "se", "s", "sw", "w", "nw"]) - ), - /** - * The rotation angle of the item. - */ - rotateAngle: PropTypes.number, - /** - * Defines whether the item is selected. When the item is selected, the resize and rotate handles will be shown. - */ - selected: PropTypes.bool, - /** - * The top position of the item. - */ - top: PropTypes.number.isRequired, - /** - * The width of the item. - */ - width: PropTypes.number.isRequired, - /** - * Z-index of the rectangle - */ - zIndex: PropTypes.number -}; diff --git a/src/CanvasItem/index.d.ts b/src/CanvasItem/index.d.ts deleted file mode 100644 index 156f5701d..000000000 --- a/src/CanvasItem/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -export type CanvasItemProps = { - aspectRatio?: number | boolean; - height: number; - left: number; - minHeight?: number; - minWidth?: number; - onClick?: (event: React.MouseEvent) => void; - onDrag?: (top: number, left: number) => void; - onResize?: ({ - top, - left, - width, - height, - rotateAngle, - isShiftKey, - type - }: { - top: number; - left: number; - width: number; - height: number; - rotateAngle: number; - isShiftKey: boolean; - type: string; - }) => void; - onRotate?: (rotateAngle: number) => void; - resizeDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw"[]; - rotateAngle?: number; - selected?: boolean; - top: number; - width: number; - zIndex?: number; -}; - -declare const CanvasItem: React.FC; - -export default CanvasItem; diff --git a/src/CanvasItem/index.js b/src/CanvasItem/index.js deleted file mode 100644 index 54f81ac09..000000000 --- a/src/CanvasItem/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./CanvasItem"; diff --git a/src/CanvasItem/index.ts b/src/CanvasItem/index.ts new file mode 100644 index 000000000..d658ed857 --- /dev/null +++ b/src/CanvasItem/index.ts @@ -0,0 +1,126 @@ +import CanvasItem from "./CanvasItem"; + +export type CanvasItemProps = { + /** + * Aspect ratio of the item. If set, the item will be resized to keep the aspect ratio when resizing. If not set, the item will be resized freely. + */ + aspectRatio?: number | boolean; + /** + * The height of the item. + */ + height: number; + /** + * The left position of the item. + */ + left: number; + /** + * The minimum height of the item. + */ + minHeight?: number; + /** + * The minimum width of the item. + */ + minWidth?: number; + /** + * Callback function when the item is clicked. + * + * **Signature** + * + * ``` + * function(event: ReactMouseEvent) => void + * ``` + * event: The event source of the callback. + */ + onClick?: (event: React.MouseEvent) => void; + /** + * Callback function when the item is dragged. + * + * **Signature** + * + * ``` + * function(top: number, left: number) => void + * ``` + * + * top: The new top position of the item. + * + * left: The new left position of the item. + */ + onDrag?: (top: number, left: number) => void; + /** + * Callback function when the item is resized. + * + * **Signature** + * ``` + * function({top: number, left: number, width: number, height: number, rotateAngle: number}, isShiftKey: boolean, type: string) => void + * ``` + * + * top: The new top position of the item. + * + * left: The new left position of the item. + * + * width: The new width of the item. + * + * height: The new height of the item. + * + * rotateAngle: The new rotate angle of the item. + * + * isShiftKey: Whether the shift key is pressed. + * + * type: The type of the resize handle. + */ + onResize?: ({ + top, + left, + width, + height, + rotateAngle, + isShiftKey, + type + }: { + top: number; + left: number; + width: number; + height: number; + rotateAngle: number; + isShiftKey: boolean; + type: string; + }) => void; + /** + * Callback function when the item is rotated. + * + * **Signature** + * + * ``` + * function(rotateAngle: number) => void + * ``` + * + * rotateAngle: The new rotate angle of the item. + */ + onRotate?: (rotateAngle: number) => void; + /** + * The allowable resize directions of the item. Array of 'n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'. + */ + resizeDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw"[]; + /** + * The rotation angle of the item. + */ + rotateAngle?: number; + /** + * Defines whether the item is selected. When the item is selected, the resize and rotate handles will be shown. + */ + selected?: boolean; + /** + * The top position of the item. + */ + top: number; + /** + * The width of the item. + */ + width: number; + /** + * Z-index of the rectangle + */ + zIndex?: number; +}; + +export default CanvasItem as React.FC; diff --git a/src/Card/TableCard/index.js b/src/Card/TableCard/index.js deleted file mode 100644 index da148f4a0..000000000 --- a/src/Card/TableCard/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./TableCard"; diff --git a/src/Card/TableCard/index.d.ts b/src/Card/TableCard/index.ts similarity index 60% rename from src/Card/TableCard/index.d.ts rename to src/Card/TableCard/index.ts index 6ac1d963e..c41919f0f 100644 --- a/src/Card/TableCard/index.d.ts +++ b/src/Card/TableCard/index.ts @@ -1,9 +1,9 @@ +import TableCard from "./TableCard"; + export type TableCardProps = { action?: React.ReactNode; tableContent?: [string, string | React.ReactNode][]; title?: string; }; -declare const TableCard: React.FC; - -export default TableCard; +export default TableCard as React.FC; diff --git a/src/Card/index.d.ts b/src/Card/index.d.ts deleted file mode 100644 index 72d0b1e17..000000000 --- a/src/Card/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as TableCard } from "./TableCard"; diff --git a/src/Checkbox/index.js b/src/Checkbox/index.js deleted file mode 100644 index a936c8527..000000000 --- a/src/Checkbox/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Checkbox"; diff --git a/src/Checkbox/index.d.ts b/src/Checkbox/index.ts similarity index 71% rename from src/Checkbox/index.d.ts rename to src/Checkbox/index.ts index e04bcaefa..aa405ed48 100644 --- a/src/Checkbox/index.d.ts +++ b/src/Checkbox/index.ts @@ -1,3 +1,5 @@ +import Checkbox from "./Checkbox"; + export type CheckboxProps = { checked?: boolean; disabled?: boolean; @@ -7,6 +9,4 @@ export type CheckboxProps = { style?: React.CSSProperties; }; -declare const Checkbox: React.FC; - -export default Checkbox; +export default Checkbox as React.FC; diff --git a/src/Color/index.js b/src/Color/index.js deleted file mode 100644 index 45bbeb2db..000000000 --- a/src/Color/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Color"; diff --git a/src/Color/index.d.ts b/src/Color/index.ts similarity index 68% rename from src/Color/index.d.ts rename to src/Color/index.ts index 1469571dd..65a336d46 100644 --- a/src/Color/index.d.ts +++ b/src/Color/index.ts @@ -1,3 +1,5 @@ +import Color from "./Color"; + export type ColorProps = { onChange?: (color: string) => void; showControls?: boolean; @@ -6,6 +8,4 @@ export type ColorProps = { value?: string; }; -declare const Color: React.FC; - -export default Color; +export default Color as React.FC; diff --git a/src/Copyright/index.d.ts b/src/Copyright/index.d.ts deleted file mode 100644 index 7bf9d615f..000000000 --- a/src/Copyright/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type CopyrightProps = {}; - -declare const Copyright: React.FC; - -export default Copyright; diff --git a/src/Copyright/index.js b/src/Copyright/index.js deleted file mode 100644 index 4a05b5580..000000000 --- a/src/Copyright/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Copyright"; diff --git a/src/Copyright/index.ts b/src/Copyright/index.ts new file mode 100644 index 000000000..2452ec49d --- /dev/null +++ b/src/Copyright/index.ts @@ -0,0 +1,5 @@ +import Copyright from "./Copyright"; + +export type CopyrightProps = {}; + +export default Copyright as React.FC; diff --git a/src/DialogTitle/index.js b/src/DialogTitle/index.js deleted file mode 100644 index efed9cd3b..000000000 --- a/src/DialogTitle/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./DialogTitle"; diff --git a/src/DialogTitle/index.d.ts b/src/DialogTitle/index.ts similarity index 57% rename from src/DialogTitle/index.d.ts rename to src/DialogTitle/index.ts index 06205d4ce..b96f16cb2 100644 --- a/src/DialogTitle/index.d.ts +++ b/src/DialogTitle/index.ts @@ -1,8 +1,8 @@ +import DialogTitle from "./DialogTitle"; + export type DialogTitleProps = { children?: React.ReactNode; onClose?: (event: React.KeyboardEvent) => void; }; -declare const DialogTitle: React.FC; - -export default DialogTitle; +export default DialogTitle as React.FC; diff --git a/src/FeedbackForm/index.js b/src/FeedbackForm/index.js deleted file mode 100644 index 6d85f5117..000000000 --- a/src/FeedbackForm/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./FeedbackForm"; diff --git a/src/FeedbackForm/index.d.ts b/src/FeedbackForm/index.ts similarity index 70% rename from src/FeedbackForm/index.d.ts rename to src/FeedbackForm/index.ts index cc83496e2..b5a0a7fc6 100644 --- a/src/FeedbackForm/index.d.ts +++ b/src/FeedbackForm/index.ts @@ -1,3 +1,5 @@ +import FeedbackForm from "./FeedbackForm"; + export type FeedbackFormProps = { dialogPosition?: "rightTop" | "bottomLeft" | "leftTop" | "leftBottom"; onSubmit?: (data: { @@ -9,6 +11,4 @@ export type FeedbackFormProps = { open?: boolean; }; -declare const FeedbackForm: React.FC; - -export default FeedbackForm; +export default FeedbackForm as React.FC; diff --git a/src/Filter/CheckboxFilter/CheckboxFilter.jsx b/src/Filter/CheckboxFilter/CheckboxFilter.jsx index 76b5d511c..35dd76b7a 100644 --- a/src/Filter/CheckboxFilter/CheckboxFilter.jsx +++ b/src/Filter/CheckboxFilter/CheckboxFilter.jsx @@ -11,7 +11,6 @@ import { import { CheckBox, CheckBoxOutlineBlank } from "@mui/icons-material"; import AlwaysOpenAutocomplete from "../AlwaysOpenAutocomplete"; -import PropTypes from "prop-types"; /** * A checkbox filter allows the user to select multiple options from a list. @@ -105,47 +104,3 @@ function Option(props, option, { selected }) { ); } - -// prop types -CheckboxFilter.propTypes = { - /** - * The label for the filter. - */ - label: PropTypes.string, - /** - * The number of selected tags to show - */ - limitTags: PropTypes.number, - /** - * Input name - */ - name: PropTypes.string, - /** - * Callback function to handle changes - * @param {Array} value - The new value - * @returns {void} - */ - onChange: PropTypes.func, - /** - * The options to select from - * @type {Array} - * @example - * ["Option 1", "Option 2"] - */ - options: PropTypes.arrayOf(PropTypes.string).isRequired, - /** - * The selected options - * @type {Array} - * @example - * ["Option 1"] - * @default [] - */ - value: PropTypes.arrayOf(PropTypes.string), - /** - * The variant of the filter - * @type {string} - * @default "popper" - * @enum {"popper", "always-open"} - */ - variant: PropTypes.oneOf(["popper", "always-open"]) -}; diff --git a/src/Filter/CheckboxFilter/index.js b/src/Filter/CheckboxFilter/index.js deleted file mode 100644 index 8001b5853..000000000 --- a/src/Filter/CheckboxFilter/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./CheckboxFilter"; diff --git a/src/Filter/CheckboxFilter/index.d.ts b/src/Filter/CheckboxFilter/index.ts similarity index 66% rename from src/Filter/CheckboxFilter/index.d.ts rename to src/Filter/CheckboxFilter/index.ts index dfd0053bb..9373e4811 100644 --- a/src/Filter/CheckboxFilter/index.d.ts +++ b/src/Filter/CheckboxFilter/index.ts @@ -1,3 +1,5 @@ +import CheckboxFilter from "./CheckboxFilter"; + export type CheckboxFilterProps = { label?: string; limitTags?: number; @@ -8,6 +10,4 @@ export type CheckboxFilterProps = { variant?: "popper" | "always-open"; }; -declare const CheckboxFilter: React.FC; - -export default CheckboxFilter; +export default CheckboxFilter as React.FC; diff --git a/src/Filter/FilterPopper/index.js b/src/Filter/FilterPopper/index.js deleted file mode 100644 index 03085a1ad..000000000 --- a/src/Filter/FilterPopper/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./FilterPopper"; diff --git a/src/Filter/FilterPopper/index.d.ts b/src/Filter/FilterPopper/index.ts similarity index 50% rename from src/Filter/FilterPopper/index.d.ts rename to src/Filter/FilterPopper/index.ts index eda7133f1..5c2f68434 100644 --- a/src/Filter/FilterPopper/index.d.ts +++ b/src/Filter/FilterPopper/index.ts @@ -1,9 +1,9 @@ +import FilterPopper from "./FilterPopper"; + export type FilterPopperProps = { children?: React.ReactNode; count?: number; label?: string; }; -declare const FilterPopper: React.FC; - -export default FilterPopper; +export default FilterPopper as React.FC; diff --git a/src/Filter/FilterStack/index.js b/src/Filter/FilterStack/index.js deleted file mode 100644 index ca221c753..000000000 --- a/src/Filter/FilterStack/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./FilterStack"; diff --git a/src/Filter/FilterStack/index.d.ts b/src/Filter/FilterStack/index.ts similarity index 59% rename from src/Filter/FilterStack/index.d.ts rename to src/Filter/FilterStack/index.ts index d661c4d85..18db9f25e 100644 --- a/src/Filter/FilterStack/index.d.ts +++ b/src/Filter/FilterStack/index.ts @@ -1,9 +1,9 @@ +import FilterStack from "./FilterStack"; + export type FilterStackProps = { children?: React.ReactNode; count?: number; onClear?: (event: React.MouseEvent) => void; }; -declare const FilterStack: React.FC; - -export default FilterStack; +export default FilterStack as React.FC; diff --git a/src/Filter/LabelFilter/LabelFilter.jsx b/src/Filter/LabelFilter/LabelFilter.jsx index 70981eaa5..717b0de43 100644 --- a/src/Filter/LabelFilter/LabelFilter.jsx +++ b/src/Filter/LabelFilter/LabelFilter.jsx @@ -11,7 +11,6 @@ import { import AlwaysOpenAutocomplete from "../AlwaysOpenAutocomplete"; import LabelChip from "../../LabelSelector/LabelChip/LabelChip"; -import PropTypes from "prop-types"; /** * A label filter allows the user to select multiple labels from a list. @@ -146,48 +145,3 @@ function Option(props, option, { selected }) { ); } - -// prop types -LabelFilter.propTypes = { - /** - * The label for the filter. - */ - label: PropTypes.string, - /** - * The name for the input. - */ - name: PropTypes.string, - /** - * Callback function to handle changes - * @param {Array} value - The new value - * @returns {void} - */ - onChange: PropTypes.func, - /** - * The options to select from - * @type {Array} - * @example - * [ - * { _id: 1, color: "#005FA8", description: "first label", name: "label 1" }, - * { _id: 2, color: "#005FA8", description: "second label", name: "label 2" } - * ] - */ - options: PropTypes.arrayOf(PropTypes.object).isRequired, - /** - * The selected value - * @type {Array} - * @example - * [ - * { _id: 1, color: "#005FA8", description: "first label", name: "label 1" }, - * ] - * @default [] - */ - value: PropTypes.arrayOf(PropTypes.object), - /** - * The variant of the filter - * @type {string} - * @default "popper" - * @enum {"popper", "always-open"} - */ - variant: PropTypes.oneOf(["popper", "always-open"]) -}; diff --git a/src/Filter/LabelFilter/index.js b/src/Filter/LabelFilter/index.js deleted file mode 100644 index 3fb05740b..000000000 --- a/src/Filter/LabelFilter/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./LabelFilter"; diff --git a/src/Filter/LabelFilter/index.d.ts b/src/Filter/LabelFilter/index.ts similarity index 71% rename from src/Filter/LabelFilter/index.d.ts rename to src/Filter/LabelFilter/index.ts index 2e9baf1d5..964236aef 100644 --- a/src/Filter/LabelFilter/index.d.ts +++ b/src/Filter/LabelFilter/index.ts @@ -1,4 +1,5 @@ import type { Label } from "../../LabelSelector/Label.types"; +import LabelFilter from "./LabelFilter"; export type LabelFilterProps = { label?: string; @@ -9,6 +10,4 @@ export type LabelFilterProps = { variant?: "popper" | "always-open"; }; -declare const LabelFilter: React.FC; - -export default LabelFilter; +export default LabelFilter as React.FC; diff --git a/src/Filter/RangeFilter/index.js b/src/Filter/RangeFilter/index.js deleted file mode 100644 index 9b96cb23f..000000000 --- a/src/Filter/RangeFilter/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./RangeFilter"; diff --git a/src/Filter/RangeFilter/index.d.ts b/src/Filter/RangeFilter/index.ts similarity index 62% rename from src/Filter/RangeFilter/index.d.ts rename to src/Filter/RangeFilter/index.ts index 2e465a79b..132d70afa 100644 --- a/src/Filter/RangeFilter/index.d.ts +++ b/src/Filter/RangeFilter/index.ts @@ -1,3 +1,5 @@ +import RangeFilter from "./RangeFilter"; + export type RangeFilterProps = { label?: string; max?: number; @@ -7,6 +9,4 @@ export type RangeFilterProps = { value?: number[]; }; -declare const RangeFilter: React.FC; - -export default RangeFilter; +export default RangeFilter as React.FC; diff --git a/src/Filter/index.js b/src/Filter/index.js deleted file mode 100644 index 7ba0ce6a8..000000000 --- a/src/Filter/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export { default as CheckboxFilter } from "./CheckboxFilter"; -export { default as LabelFilter } from "./LabelFilter"; -export { default as RangeFilter } from "./RangeFilter"; -export { default as FilterPopper } from "./FilterPopper"; -export { default as FilterStack } from "./FilterStack"; diff --git a/src/Filter/index.d.ts b/src/Filter/index.ts similarity index 100% rename from src/Filter/index.d.ts rename to src/Filter/index.ts diff --git a/src/FontPicker/index.js b/src/FontPicker/index.js deleted file mode 100644 index 5feadd07a..000000000 --- a/src/FontPicker/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./FontPicker"; diff --git a/src/FontPicker/index.d.ts b/src/FontPicker/index.ts similarity index 76% rename from src/FontPicker/index.d.ts rename to src/FontPicker/index.ts index aca8dc8c1..acadfb6a1 100644 --- a/src/FontPicker/index.d.ts +++ b/src/FontPicker/index.ts @@ -1,3 +1,5 @@ +import FontPicker from "./FontPicker"; + export type FontPickerProps = { disabled?: boolean; error?: boolean; @@ -10,6 +12,4 @@ export type FontPickerProps = { variant?: "standard" | "outlined" | "filled"; }; -declare const FontPicker: React.FC; - -export default FontPicker; +export default FontPicker as React.FC; diff --git a/src/FontStyle/index.js b/src/FontStyle/index.js deleted file mode 100644 index de27bb70d..000000000 --- a/src/FontStyle/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./FontStyle"; diff --git a/src/FontStyle/index.d.ts b/src/FontStyle/index.ts similarity index 72% rename from src/FontStyle/index.d.ts rename to src/FontStyle/index.ts index fe34087f4..3bdcf06bd 100644 --- a/src/FontStyle/index.d.ts +++ b/src/FontStyle/index.ts @@ -1,3 +1,5 @@ +import FontStyle from "./FontStyle"; + export type FontStyleProps = { disabled?: boolean; onChange?: (event: React.MouseEvent, value: string[]) => void; @@ -6,6 +8,4 @@ export type FontStyleProps = { value?: string[]; }; -declare const FontStyle: React.FC; - -export default FontStyle; +export default FontStyle as React.FC; diff --git a/src/LabelSelector/DeleteLabelDialog/DeleteLabelDialog.jsx b/src/LabelSelector/DeleteLabelDialog/DeleteLabelDialog.jsx index 6becfe96e..f7c3fda82 100644 --- a/src/LabelSelector/DeleteLabelDialog/DeleteLabelDialog.jsx +++ b/src/LabelSelector/DeleteLabelDialog/DeleteLabelDialog.jsx @@ -62,46 +62,18 @@ export default function DeleteLabelDialog({ DeleteLabelDialog.propTypes = { /** * If true, the component is shown. - * @default false - * @type {boolean} */ isOpen: PropTypes.bool, /** * The label to delete. - * @default { color: "#005FA8", description: "", _id: "", name: "" } - * @type {object} - * @property {string} color - The color of the label. - * @property {string} description - The description of the label. - * @property {string} _id - The id of the label. - * @property {string} name - The name of the label. - * */ label: PropTypes.object, /** * Callback fired when the component requests to be closed. - * - * **Signature:** - * ``` - * function(event: object, string: reason) => void - * ``` - * - * - `event`: The event source of the callback. - * - `reason`: Can be: `"escapeKeyDown"`, `"backdropClick"`. - * - * @type {function} */ onClose: PropTypes.func, /** * Callback fired when the delete button is clicked. - * - * **Signature:** - * ``` - * function(object: label) => void - * ``` - * - * - `label`: The label object to be deleted. - * - * @type {function} */ onDelete: PropTypes.func }; diff --git a/src/LabelSelector/DeleteLabelDialog/index.js b/src/LabelSelector/DeleteLabelDialog/index.js deleted file mode 100644 index bf8d10ad1..000000000 --- a/src/LabelSelector/DeleteLabelDialog/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./DeleteLabelDialog"; diff --git a/src/LabelSelector/DeleteLabelDialog/index.d.ts b/src/LabelSelector/DeleteLabelDialog/index.ts similarity index 68% rename from src/LabelSelector/DeleteLabelDialog/index.d.ts rename to src/LabelSelector/DeleteLabelDialog/index.ts index ad4e5d636..18c86ccd5 100644 --- a/src/LabelSelector/DeleteLabelDialog/index.d.ts +++ b/src/LabelSelector/DeleteLabelDialog/index.ts @@ -1,3 +1,4 @@ +import DeleteLabelDialog from "./DeleteLabelDialog"; import type { DialogProps } from "@mui/material/Dialog"; import type { Label } from "../Label.types"; @@ -8,6 +9,4 @@ export type DeleteLabelDialogProps = { onDelete?: (deletedLabel: Label) => void; }; -declare const DeleteLabelDialog: React.FC; - -export { DeleteLabelDialog }; +export default DeleteLabelDialog as React.FC; diff --git a/src/LabelSelector/EditLabelDialog/EditLabelDialog.jsx b/src/LabelSelector/EditLabelDialog/EditLabelDialog.jsx index e7fe90248..3bba04107 100644 --- a/src/LabelSelector/EditLabelDialog/EditLabelDialog.jsx +++ b/src/LabelSelector/EditLabelDialog/EditLabelDialog.jsx @@ -213,89 +213,11 @@ export default function EditLabelDialog({ // EditLabelDialog Proptypes EditLabelDialog.propTypes = { - /** - * If true, the component is shown. - * @default false - * @type {boolean} - */ isOpen: PropTypes.bool, - /** - * The label to be edited. - * @default { color: "#005FA8", description: "", _id: "", name: "" } - * @type {object} - * @property {string} color The color of the label. - * @property {string} description The description of the label. - * @property {string} _id The id of the label. - * @property {string} name The name of the label. - * - */ label: PropTypes.object, - /** - * The title of the dialog. - * @default "Edit Label" - * @type {string} - */ labelDialogTitle: PropTypes.string, - /** - * Callback fired when the component requests to be closed. - * - * **Signature:** - * ``` - * function(event: object, string: reason) => void - * ``` - * - * - `event`: The event source of the callback. - * - `reason`: Can be: `"escapeKeyDown"`, `"backdropClick"`. - * - * @type {function} - */ onClose: PropTypes.func, - /** - * Callback fired when a label is edited. - * - * **Signature** - * ``` - * function(label: object) => void - * ``` - * - * _label_: The label that is edited. - * @default () => {} - * @type {function} - */ onEdit: PropTypes.func, - /** - * Callback fired when a new label is added. - * - * **Signature** - * ``` - * function(label: object) => void - * ``` - * - * _label_: The label that is added. - * @default () => {} - * @type {function} - */ onNew: PropTypes.func, - /** - * The array of label objects that are options to render in the listbox. - * @default [] - * @type {array} - * - * @example - * [ - * { - * _id: "5f9f1b9b0b5b9c0b8c8b4567", - * name: "Label 1", - * description: "Description 1", - * color: "#ff0000" - * }, - * { - * _id: "5f9f1b9b0b5b9c0b8c8b4568", - * name: "Label 2", - * description: "Description 2", - * color: "#00ff00" - * } - * ] - */ options: PropTypes.array }; diff --git a/src/LabelSelector/EditLabelDialog/index.d.ts b/src/LabelSelector/EditLabelDialog/index.d.ts deleted file mode 100644 index 461249d15..000000000 --- a/src/LabelSelector/EditLabelDialog/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { DialogProps } from "@mui/material/Dialog"; -import type { Label } from "../Label.types"; - -export type EditLabelDialogProps = { - isOpen?: boolean; - label?: Label; - labelDialogTitle?: string; - onClose?: DialogProps["onClose"]; - onEdit?: (editedLabel: Label) => void; - onNew?: (newLabel: Label) => void; - options?: Label[]; -}; - -declare const EditLabelDialog: React.FC; - -export { EditLabelDialog }; diff --git a/src/LabelSelector/EditLabelDialog/index.js b/src/LabelSelector/EditLabelDialog/index.js deleted file mode 100644 index 6de7b4587..000000000 --- a/src/LabelSelector/EditLabelDialog/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./EditLabelDialog"; diff --git a/src/LabelSelector/EditLabelDialog/index.ts b/src/LabelSelector/EditLabelDialog/index.ts new file mode 100644 index 000000000..3adcd2674 --- /dev/null +++ b/src/LabelSelector/EditLabelDialog/index.ts @@ -0,0 +1,36 @@ +import type { DialogProps } from "@mui/material/Dialog"; +import EditLabelDialog from "./EditLabelDialog"; +import type { Label } from "../Label.types"; + +export type EditLabelDialogProps = { + /** + * If true, the component is shown. + */ + isOpen?: boolean; + /** + * The label to be edited. + */ + label?: Label; + /** + * The title of the dialog. + */ + labelDialogTitle?: string; + /** + * Callback fired when the component requests to be closed. + */ + onClose?: DialogProps["onClose"]; + /** + * Callback fired when a label is edited. + */ + onEdit?: (editedLabel: Label) => void; + /** + * Callback fired when a new label is added. + */ + onNew?: (newLabel: Label) => void; + /** + * The array of label objects that are options to render in the listbox. + */ + options?: Label[]; +}; + +export default EditLabelDialog as React.FC; diff --git a/src/Loading/index.d.ts b/src/Loading/index.d.ts deleted file mode 100644 index a04bf2c30..000000000 --- a/src/Loading/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type LoadingProps = { - label?: string; -}; - -declare const Loading: React.FC; - -export default Loading; diff --git a/src/Loading/index.js b/src/Loading/index.js deleted file mode 100644 index 61edb3814..000000000 --- a/src/Loading/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Loading"; diff --git a/src/Loading/index.ts b/src/Loading/index.ts new file mode 100644 index 000000000..faec74578 --- /dev/null +++ b/src/Loading/index.ts @@ -0,0 +1,7 @@ +import Loading from "./Loading"; + +export type LoadingProps = { + label?: string; +}; + +export default Loading as React.FC; diff --git a/src/LoginForm/index.js b/src/LoginForm/index.js deleted file mode 100644 index 8059f00fd..000000000 --- a/src/LoginForm/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./LoginForm"; diff --git a/src/LoginForm/index.d.ts b/src/LoginForm/index.ts similarity index 64% rename from src/LoginForm/index.d.ts rename to src/LoginForm/index.ts index e8d44f4b2..a63816c58 100644 --- a/src/LoginForm/index.d.ts +++ b/src/LoginForm/index.ts @@ -1,3 +1,5 @@ +import LoginForm from "./LoginForm"; + export type LoginFormProps = { loading?: boolean; onLogin?: ( @@ -6,6 +8,4 @@ export type LoginFormProps = { ) => void; }; -declare const LoginForm: React.FC; - -export default LoginForm; +export default LoginForm as React.FC; diff --git a/src/MultiColor/index.js b/src/MultiColor/index.js deleted file mode 100644 index 05d556d20..000000000 --- a/src/MultiColor/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./MultiColor"; diff --git a/src/MultiColor/index.d.ts b/src/MultiColor/index.ts similarity index 59% rename from src/MultiColor/index.d.ts rename to src/MultiColor/index.ts index 10b6e48c7..69e3d017e 100644 --- a/src/MultiColor/index.d.ts +++ b/src/MultiColor/index.ts @@ -1,3 +1,5 @@ +import MultiColor from "./MultiColor"; + type Row = { color: string; value: number; @@ -7,6 +9,4 @@ export type MultiColorProps = { rows?: Row[]; }; -declare const MultiColor: React.FC; - -export default MultiColor; +export default MultiColor as React.FC; diff --git a/src/MultiLabelPopover/index.js b/src/MultiLabelPopover/index.js deleted file mode 100644 index 5f3e443da..000000000 --- a/src/MultiLabelPopover/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./MultiLabelPopover"; diff --git a/src/MultiLabelPopover/index.d.ts b/src/MultiLabelPopover/index.ts similarity index 50% rename from src/MultiLabelPopover/index.d.ts rename to src/MultiLabelPopover/index.ts index 2c167c6f3..2373fc528 100644 --- a/src/MultiLabelPopover/index.d.ts +++ b/src/MultiLabelPopover/index.ts @@ -1,8 +1,8 @@ import type { Label } from "../LabelSelector/Label.types"; +import MultiLabelPopover from "./MultiLabelPopover"; + export type MultiLabelPopoverProps = { labels?: Label[]; }; -declare const MultiLabelPopover: React.FC; - -export default MultiLabelPopover; +export default MultiLabelPopover as React.FC; diff --git a/src/MultiText/index.js b/src/MultiText/index.js deleted file mode 100644 index fcdda622d..000000000 --- a/src/MultiText/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./MultiText"; diff --git a/src/MultiText/index.d.ts b/src/MultiText/index.ts similarity index 60% rename from src/MultiText/index.d.ts rename to src/MultiText/index.ts index 49d56710e..a97793fb0 100644 --- a/src/MultiText/index.d.ts +++ b/src/MultiText/index.ts @@ -1,3 +1,5 @@ +import MultiText from "./MultiText"; + type Row = { label: string; value: number; @@ -7,6 +9,4 @@ export type MultiTextProps = { rows?: Row[]; }; -declare const MultiText: React.FC; - -export default MultiText; +export default MultiText as React.FC; diff --git a/src/NumberField/index.js b/src/NumberField/index.js deleted file mode 100644 index c1d5bebd1..000000000 --- a/src/NumberField/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./NumberField"; diff --git a/src/NumberField/index.d.ts b/src/NumberField/index.ts similarity index 84% rename from src/NumberField/index.d.ts rename to src/NumberField/index.ts index f597c69b1..3a99479bb 100644 --- a/src/NumberField/index.d.ts +++ b/src/NumberField/index.ts @@ -1,3 +1,4 @@ +import NumberField from "./NumberField"; import type { TextFieldProps } from "@mui/material"; export type NumberFieldProps = { @@ -21,6 +22,4 @@ export type NumberFieldProps = { variant?: "standard" | "filled" | "outlined"; }; -declare const NumberField: React.FC; - -export default NumberField; +export default NumberField as React.FC; diff --git a/src/PasswordChangeDialog/index.js b/src/PasswordChangeDialog/index.js deleted file mode 100644 index 0900fdab1..000000000 --- a/src/PasswordChangeDialog/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./PasswordChangeDialog"; diff --git a/src/PasswordChangeDialog/index.d.ts b/src/PasswordChangeDialog/index.ts similarity index 76% rename from src/PasswordChangeDialog/index.d.ts rename to src/PasswordChangeDialog/index.ts index 90aba17a4..0526bafc1 100644 --- a/src/PasswordChangeDialog/index.d.ts +++ b/src/PasswordChangeDialog/index.ts @@ -1,4 +1,5 @@ import type { DialogProps } from "@mui/material"; +import PasswordChangeDialog from "./PasswordChangeDialog"; export type PasswordChangeDialogProps = { errorMessage?: string; @@ -16,6 +17,4 @@ export type PasswordChangeDialogProps = { successMessage?: string; }; -declare const PasswordChangeDialog: React.FC; - -export default PasswordChangeDialog; +export default PasswordChangeDialog as React.FC; diff --git a/src/PasswordChangeForm/index.js b/src/PasswordChangeForm/index.js deleted file mode 100644 index fb5c8aa95..000000000 --- a/src/PasswordChangeForm/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./PasswordChangeForm"; diff --git a/src/PasswordChangeForm/index.d.ts b/src/PasswordChangeForm/index.ts similarity index 62% rename from src/PasswordChangeForm/index.d.ts rename to src/PasswordChangeForm/index.ts index 48e6e16a2..916930e26 100644 --- a/src/PasswordChangeForm/index.d.ts +++ b/src/PasswordChangeForm/index.ts @@ -1,3 +1,5 @@ +import PasswordChangeForm from "./PasswordChangeForm"; + export type PasswordChangeFormProps = { loading?: boolean; onSubmit: ( @@ -9,6 +11,4 @@ export type PasswordChangeFormProps = { ) => void; }; -declare const PasswordChangeForm: React.FC; - -export default PasswordChangeForm; +export default PasswordChangeForm as React.FC; diff --git a/src/PasswordResetForm/index.js b/src/PasswordResetForm/index.js deleted file mode 100644 index 76cbea2e4..000000000 --- a/src/PasswordResetForm/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./PasswordResetForm"; diff --git a/src/PasswordResetForm/index.d.ts b/src/PasswordResetForm/index.ts similarity index 58% rename from src/PasswordResetForm/index.d.ts rename to src/PasswordResetForm/index.ts index e8b8c689d..4d9f78e76 100644 --- a/src/PasswordResetForm/index.d.ts +++ b/src/PasswordResetForm/index.ts @@ -1,3 +1,5 @@ +import PasswordResetForm from "./PasswordResetForm"; + export type PasswordResetFormProps = { loading?: boolean; onSubmit: ( @@ -8,6 +10,4 @@ export type PasswordResetFormProps = { ) => void; }; -declare const PasswordResetForm: React.FC; - -export default PasswordResetForm; +export default PasswordResetForm as React.FC; diff --git a/src/RadioButtons/index.js b/src/RadioButtons/index.js deleted file mode 100644 index 05f1a50c4..000000000 --- a/src/RadioButtons/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./RadioButtons"; diff --git a/src/RadioButtons/index.d.ts b/src/RadioButtons/index.ts similarity index 77% rename from src/RadioButtons/index.d.ts rename to src/RadioButtons/index.ts index 9b7e14b35..c7c3e4c74 100644 --- a/src/RadioButtons/index.d.ts +++ b/src/RadioButtons/index.ts @@ -1,5 +1,7 @@ import type { RadioGroupProps, SxProps, Theme } from "@mui/material"; +import RadioButtons from "./RadioButtons"; + export type RadioButtonsProps = { disabled?: boolean; labelPlacement?: "end" | "start" | "top" | "bottom"; @@ -12,6 +14,4 @@ export type RadioButtonsProps = { value?: string; }; -declare const RadioButtons: React.FC; - -export default RadioButtons; +export default RadioButtons as React.FC; diff --git a/src/RegistrationForm/index.js b/src/RegistrationForm/index.js deleted file mode 100644 index 473e9dbb2..000000000 --- a/src/RegistrationForm/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./RegistrationForm"; diff --git a/src/RegistrationForm/index.d.ts b/src/RegistrationForm/index.ts similarity index 72% rename from src/RegistrationForm/index.d.ts rename to src/RegistrationForm/index.ts index 99ef5eec9..3b825b975 100644 --- a/src/RegistrationForm/index.d.ts +++ b/src/RegistrationForm/index.ts @@ -1,3 +1,5 @@ +import RegistrationForm from "./RegistrationForm"; + export type RegistrationFormProps = { loading?: boolean; onRegister?: ( @@ -14,6 +16,4 @@ export type RegistrationFormProps = { teams: string[]; }; -declare const RegistrationForm: React.FC; - -export default RegistrationForm; +export default RegistrationForm as React.FC; diff --git a/src/Select/index.js b/src/Select/index.js deleted file mode 100644 index cd39325ed..000000000 --- a/src/Select/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Select"; diff --git a/src/Select/index.d.ts b/src/Select/index.ts similarity index 83% rename from src/Select/index.d.ts rename to src/Select/index.ts index c13a0145d..81e7ba3d8 100644 --- a/src/Select/index.d.ts +++ b/src/Select/index.ts @@ -1,3 +1,4 @@ +import Select from "./Select"; import type { TextFieldProps } from "../TextField"; export type SelectProps = { @@ -14,6 +15,4 @@ export type SelectProps = { variant?: "filled" | "outlined" | "standard"; }; -declare const Select: React.FC; - -export default Select; +export default Select as React.FC; diff --git a/src/Slider/index.js b/src/Slider/index.js deleted file mode 100644 index 8e1091006..000000000 --- a/src/Slider/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./Slider"; diff --git a/src/Slider/index.d.ts b/src/Slider/index.ts similarity index 87% rename from src/Slider/index.d.ts rename to src/Slider/index.ts index 7d0de24d4..661abdf2f 100644 --- a/src/Slider/index.d.ts +++ b/src/Slider/index.ts @@ -4,6 +4,8 @@ import type { Theme } from "@mui/material"; +import Slider from "./Slider"; + export type SliderProps = { color?: string; disabled?: boolean; @@ -24,6 +26,4 @@ export type SliderProps = { valueLabelDisplay?: "auto" | "off" | "on"; }; -declare const Slider: React.FC; - -export default Slider; +export default Slider as React.FC; diff --git a/src/SnackbarProvider/SnackbarContext.tsx b/src/SnackbarProvider/SnackbarContext.tsx index 18a3bede9..618cc4acc 100644 --- a/src/SnackbarProvider/SnackbarContext.tsx +++ b/src/SnackbarProvider/SnackbarContext.tsx @@ -1,6 +1,18 @@ import React from "react"; +import { SnackbarProps } from "../Snackbar/Snackbar.types"; + +export type SnackbarContextType = { + close: () => void; + show: ( + message: SnackbarProps["message"], + variant: SnackbarProps["variant"], + autoHideDuration?: SnackbarProps["autoHideDuration"], + actionText?: SnackbarProps["actionText"], + actionCallback?: SnackbarProps["actionCallback"] + ) => void; +}; /** * Context for snackbar */ -export default React.createContext({}); +export default React.createContext(null); diff --git a/src/SnackbarProvider/SnackbarProvider.tsx b/src/SnackbarProvider/SnackbarProvider.tsx index d270a36f0..76c3be20a 100644 --- a/src/SnackbarProvider/SnackbarProvider.tsx +++ b/src/SnackbarProvider/SnackbarProvider.tsx @@ -1,15 +1,24 @@ +import Snackbar, { SnackbarProps } from "../Snackbar"; +import SnackbarContext, { SnackbarContextType } from "./SnackbarContext"; + import React from "react"; -import Snackbar from "../Snackbar"; -import SnackbarContext from "./SnackbarContext"; -import { SnackbarProps } from "../Snackbar/Snackbar.types"; import { SnackbarProviderProps } from "./SnackbarProvider.types"; +type SnackbarStateType = { + message: SnackbarProps["message"]; + variant: SnackbarProps["variant"]; + autoHideDuration?: SnackbarProps["autoHideDuration"]; + actionText?: SnackbarProps["actionText"]; + actionCallback?: SnackbarProps["actionCallback"]; + open: boolean; +}; + /** * A helper component for adding a snackbar to an application. Injects a single snackbar component in your application, and exposes context down the React tree to control the snackbar via the useSnackbar hook. It should preferably be used at the root of your component tree. */ export default function SnackbarProvider({ children }: SnackbarProviderProps) { // snackbar state - const [snackbar, setSnackbar] = React.useState({ + const [snackbar, setSnackbar] = React.useState({ actionCallback: () => {}, actionText: "", message: "", @@ -18,19 +27,23 @@ export default function SnackbarProvider({ children }: SnackbarProviderProps) { }); // close snackbar - const close = React.useCallback( - () => setSnackbar(snackbar => ({ ...snackbar, open: false })), + const close = React.useCallback( + () => + setSnackbar(snackbar => ({ + ...snackbar, + open: false + })), [setSnackbar] ); // show snackbar - const show = React.useCallback( + const show = React.useCallback( ( - message: "", - variant: "info", - autoHideDuration: null, - actionText: "", - actionCallback: () => {} + message = "", + variant = "info", + autoHideDuration = null, + actionText = "", + actionCallback = () => {} ) => setSnackbar({ actionCallback, @@ -44,11 +57,11 @@ export default function SnackbarProvider({ children }: SnackbarProviderProps) { ); // memoise callbacks - const value = React.useMemo(() => ({ close, show }), [close, show]); + const contextValue = React.useMemo(() => ({ close, show }), [close, show]); // wrap snackbar component and children in provider return ( - + {children} diff --git a/src/SvgIcons/VirtoBuild/index.js b/src/SvgIcons/VirtoBuild/index.js deleted file mode 100644 index 1bffecfaf..000000000 --- a/src/SvgIcons/VirtoBuild/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoBuild"; diff --git a/src/SvgIcons/VirtoBuild/index.d.ts b/src/SvgIcons/VirtoBuild/index.ts similarity index 50% rename from src/SvgIcons/VirtoBuild/index.d.ts rename to src/SvgIcons/VirtoBuild/index.ts index f20bf5008..052acdf41 100644 --- a/src/SvgIcons/VirtoBuild/index.d.ts +++ b/src/SvgIcons/VirtoBuild/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoBuild from "./VirtoBuild"; export type VirtoBuildProps = SvgIconProps; -declare const VirtoBuild: React.FC; - -export default VirtoBuild; +export default VirtoBuild as React.FC; diff --git a/src/SvgIcons/VirtoData/index.js b/src/SvgIcons/VirtoData/index.js deleted file mode 100644 index 5ac4e26d0..000000000 --- a/src/SvgIcons/VirtoData/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoData"; diff --git a/src/SvgIcons/VirtoData/index.d.ts b/src/SvgIcons/VirtoData/index.ts similarity index 51% rename from src/SvgIcons/VirtoData/index.d.ts rename to src/SvgIcons/VirtoData/index.ts index 6bcd2d2f7..b5b338683 100644 --- a/src/SvgIcons/VirtoData/index.d.ts +++ b/src/SvgIcons/VirtoData/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoData from "./VirtoData"; export type VirtoDataProps = SvgIconProps; -declare const VirtoData: React.FC; - -export default VirtoData; +export default VirtoData as React.FC; diff --git a/src/SvgIcons/VirtoFleet/index.js b/src/SvgIcons/VirtoFleet/index.js deleted file mode 100644 index 763ec8703..000000000 --- a/src/SvgIcons/VirtoFleet/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoFleet"; diff --git a/src/SvgIcons/VirtoFleet/index.d.ts b/src/SvgIcons/VirtoFleet/index.ts similarity index 50% rename from src/SvgIcons/VirtoFleet/index.d.ts rename to src/SvgIcons/VirtoFleet/index.ts index 2b99bc366..064cff6c8 100644 --- a/src/SvgIcons/VirtoFleet/index.d.ts +++ b/src/SvgIcons/VirtoFleet/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoFleet from "./VirtoFleet"; export type VirtoFleetProps = SvgIconProps; -declare const VirtoFleet: React.FC; - -export default VirtoFleet; +export default VirtoFleet as React.FC; diff --git a/src/SvgIcons/VirtoID/index.js b/src/SvgIcons/VirtoID/index.js deleted file mode 100644 index 87b105459..000000000 --- a/src/SvgIcons/VirtoID/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoID"; diff --git a/src/SvgIcons/VirtoID/index.d.ts b/src/SvgIcons/VirtoID/index.ts similarity index 52% rename from src/SvgIcons/VirtoID/index.d.ts rename to src/SvgIcons/VirtoID/index.ts index 8e5453fde..556d9f312 100644 --- a/src/SvgIcons/VirtoID/index.d.ts +++ b/src/SvgIcons/VirtoID/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoID from "./VirtoID"; export type VirtoIDProps = SvgIconProps; -declare const VirtoID: React.FC; - -export default VirtoID; +export default VirtoID as React.FC; diff --git a/src/SvgIcons/VirtoLogo/index.js b/src/SvgIcons/VirtoLogo/index.js deleted file mode 100644 index 655239570..000000000 --- a/src/SvgIcons/VirtoLogo/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoLogo"; diff --git a/src/SvgIcons/VirtoLogo/index.d.ts b/src/SvgIcons/VirtoLogo/index.ts similarity index 51% rename from src/SvgIcons/VirtoLogo/index.d.ts rename to src/SvgIcons/VirtoLogo/index.ts index d9047a463..6cb7de1d3 100644 --- a/src/SvgIcons/VirtoLogo/index.d.ts +++ b/src/SvgIcons/VirtoLogo/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoLogo from "./VirtoLogo"; export type VirtoLogoProps = SvgIconProps; -declare const VirtoLogo: React.FC; - -export default VirtoLogo; +export default VirtoLogo as React.FC; diff --git a/src/SvgIcons/VirtoModel/index.js b/src/SvgIcons/VirtoModel/index.js deleted file mode 100644 index a93a503e5..000000000 --- a/src/SvgIcons/VirtoModel/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoModel"; diff --git a/src/SvgIcons/VirtoModel/index.d.ts b/src/SvgIcons/VirtoModel/index.ts similarity index 50% rename from src/SvgIcons/VirtoModel/index.d.ts rename to src/SvgIcons/VirtoModel/index.ts index 091211289..01797f2aa 100644 --- a/src/SvgIcons/VirtoModel/index.d.ts +++ b/src/SvgIcons/VirtoModel/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoModel from "./VirtoModel"; export type VirtoModelProps = SvgIconProps; -declare const VirtoModel: React.FC; - -export default VirtoModel; +export default VirtoModel as React.FC; diff --git a/src/SvgIcons/VirtoResult/index.d.ts b/src/SvgIcons/VirtoResult/index.d.ts deleted file mode 100644 index 3fd15c820..000000000 --- a/src/SvgIcons/VirtoResult/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SvgIconProps } from "../SvgIcons.types"; - -export type VirtoResultProps = SvgIconProps; - -declare const VirtoResult: React.FC; - -export default VirtoResult; diff --git a/src/SvgIcons/VirtoResult/index.js b/src/SvgIcons/VirtoResult/index.js deleted file mode 100644 index f9241c7a9..000000000 --- a/src/SvgIcons/VirtoResult/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoResult"; diff --git a/src/SvgIcons/VirtoResult/index.ts b/src/SvgIcons/VirtoResult/index.ts new file mode 100644 index 000000000..c1baf0b55 --- /dev/null +++ b/src/SvgIcons/VirtoResult/index.ts @@ -0,0 +1,6 @@ +import { SvgIconProps } from "../SvgIcons.types"; +import VirtoResult from "./VirtoResult"; + +export type VirtoResultProps = SvgIconProps; + +export default VirtoResult as React.FC; diff --git a/src/SvgIcons/VirtoScene/index.js b/src/SvgIcons/VirtoScene/index.js deleted file mode 100644 index a6e03b415..000000000 --- a/src/SvgIcons/VirtoScene/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoScene"; diff --git a/src/SvgIcons/VirtoScene/index.d.ts b/src/SvgIcons/VirtoScene/index.ts similarity index 50% rename from src/SvgIcons/VirtoScene/index.d.ts rename to src/SvgIcons/VirtoScene/index.ts index 02cd51c81..2edce484e 100644 --- a/src/SvgIcons/VirtoScene/index.d.ts +++ b/src/SvgIcons/VirtoScene/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoScene from "./VirtoScene"; export type VirtoSceneProps = SvgIconProps; -declare const VirtoScene: React.FC; - -export default VirtoScene; +export default VirtoScene as React.FC; diff --git a/src/SvgIcons/VirtoTest/index.js b/src/SvgIcons/VirtoTest/index.js deleted file mode 100644 index d483e879f..000000000 --- a/src/SvgIcons/VirtoTest/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoTest"; diff --git a/src/SvgIcons/VirtoTest/index.d.ts b/src/SvgIcons/VirtoTest/index.ts similarity index 51% rename from src/SvgIcons/VirtoTest/index.d.ts rename to src/SvgIcons/VirtoTest/index.ts index b4b837a10..46468e371 100644 --- a/src/SvgIcons/VirtoTest/index.d.ts +++ b/src/SvgIcons/VirtoTest/index.ts @@ -1,7 +1,6 @@ import { SvgIconProps } from "../SvgIcons.types"; +import VirtoTest from "./VirtoTest"; export type VirtoTestProps = SvgIconProps; -declare const VirtoTest: React.FC; - -export default VirtoTest; +export default VirtoTest as React.FC; diff --git a/src/SvgIcons/VirtoVehicle/index.d.ts b/src/SvgIcons/VirtoVehicle/index.d.ts deleted file mode 100644 index 4f071ff63..000000000 --- a/src/SvgIcons/VirtoVehicle/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SvgIconProps } from "../SvgIcons.types"; - -export type VirtoVehicleProps = SvgIconProps; - -declare const VirtoVehicle: React.FC; - -export default VirtoVehicle; diff --git a/src/SvgIcons/VirtoVehicle/index.js b/src/SvgIcons/VirtoVehicle/index.js deleted file mode 100644 index d56f93d86..000000000 --- a/src/SvgIcons/VirtoVehicle/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./VirtoVehicle"; diff --git a/src/SvgIcons/VirtoVehicle/index.ts b/src/SvgIcons/VirtoVehicle/index.ts new file mode 100644 index 000000000..89498fa50 --- /dev/null +++ b/src/SvgIcons/VirtoVehicle/index.ts @@ -0,0 +1,6 @@ +import { SvgIconProps } from "../SvgIcons.types"; +import VirtoVehicle from "./VirtoVehicle"; + +export type VirtoVehicleProps = SvgIconProps; + +export default VirtoVehicle as React.FC; diff --git a/src/SwitchField/index.js b/src/SwitchField/index.js deleted file mode 100644 index 3c872caa9..000000000 --- a/src/SwitchField/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./SwitchField"; diff --git a/src/SwitchField/index.d.ts b/src/SwitchField/index.ts similarity index 73% rename from src/SwitchField/index.d.ts rename to src/SwitchField/index.ts index 71656d0dc..bb29bb7d2 100644 --- a/src/SwitchField/index.d.ts +++ b/src/SwitchField/index.ts @@ -1,3 +1,4 @@ +import SwitchField from "./SwitchField"; import type { SwitchProps } from "@mui/material"; export type SwitchFieldProps = { @@ -10,6 +11,4 @@ export type SwitchFieldProps = { size?: "small" | "medium"; }; -declare const SwitchField: React.FC; - -export default SwitchField; +export default SwitchField as React.FC; diff --git a/src/ToggleColorMode/index.js b/src/ToggleColorMode/index.js deleted file mode 100644 index 39d8b1184..000000000 --- a/src/ToggleColorMode/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./ToggleColorMode"; diff --git a/src/ToggleColorMode/index.d.ts b/src/ToggleColorMode/index.ts similarity index 50% rename from src/ToggleColorMode/index.d.ts rename to src/ToggleColorMode/index.ts index 09da89da9..e29d8d184 100644 --- a/src/ToggleColorMode/index.d.ts +++ b/src/ToggleColorMode/index.ts @@ -1,8 +1,8 @@ +import ToggleColorMode from "./ToggleColorMode"; + export type ToggleColorModeProps = { mode?: "light" | "dark"; onChange: (mode: "light" | "dark") => void; }; -declare const ToggleColorMode: React.FC; - -export default ToggleColorMode; +export default ToggleColorMode as React.FC; diff --git a/src/ViewToggleButton/index.js b/src/ViewToggleButton/index.js deleted file mode 100644 index 0480492d1..000000000 --- a/src/ViewToggleButton/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./ViewToggleButton"; diff --git a/src/ViewToggleButton/index.d.ts b/src/ViewToggleButton/index.ts similarity index 66% rename from src/ViewToggleButton/index.d.ts rename to src/ViewToggleButton/index.ts index 77cea4e38..f913d3386 100644 --- a/src/ViewToggleButton/index.d.ts +++ b/src/ViewToggleButton/index.ts @@ -1,4 +1,5 @@ import type { ToggleButtonGroupProps } from "@mui/material"; +import ViewToggleButton from "./ViewToggleButton"; export type ViewToggleButtonProps = { disabled?: boolean; @@ -7,6 +8,4 @@ export type ViewToggleButtonProps = { value: "card" | "table"; }; -declare const ViewToggleButton: React.FC; - -export default ViewToggleButton; +export default ViewToggleButton as React.FC;