From f7e5191d3d1412fd21ce76be0af69ba9950a8680 Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 06:34:22 +0530 Subject: [PATCH 01/30] chore: add packages --- package.json | 6 ++ pnpm-lock.yaml | 168 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) diff --git a/package.json b/package.json index 4a952280a..66aea1073 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "@simplewebauthn/types": "^10.0.0", "@tailwindcss/typography": "^0.5.12", "@types/cookie": "^0.6.0", + "@types/fs-extra": "^11.0.4", "@types/inquirer": "^9.0.7", "@types/lodash-es": "^4.17.12", "@types/node": "^20.12.12", @@ -138,12 +139,17 @@ "@types/ua-parser-js": "^0.7.39", "autoprefixer": "^10.4.19", "colors": "^1.4.0", + "execa": "^9.3.0", + "fast-glob": "^3.3.2", + "fs-extra": "^11.2.0", "husky": "^9.1.3", "inquirer": "^9.2.22", "knip": "^5.17.2", "lint-staged": "^15.2.2", + "node-html-parser": "^6.1.13", "postcss": "^8.4.40", "prisma": "^5.13.0", + "remixicon": "^4.3.0", "tailwindcss": "^3.4.3", "tsx": "^4.7.0", "typescript": "^5.4.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6e578d3b..f39f96c0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -300,6 +300,9 @@ importers: '@types/cookie': specifier: ^0.6.0 version: 0.6.0 + '@types/fs-extra': + specifier: ^11.0.4 + version: 11.0.4 '@types/inquirer': specifier: ^9.0.7 version: 9.0.7 @@ -327,6 +330,15 @@ importers: colors: specifier: ^1.4.0 version: 1.4.0 + execa: + specifier: ^9.3.0 + version: 9.3.0 + fast-glob: + specifier: ^3.3.2 + version: 3.3.2 + fs-extra: + specifier: ^11.2.0 + version: 11.2.0 husky: specifier: ^9.1.3 version: 9.1.4 @@ -339,12 +351,18 @@ importers: lint-staged: specifier: ^15.2.2 version: 15.2.2 + node-html-parser: + specifier: ^6.1.13 + version: 6.1.13 postcss: specifier: ^8.4.40 version: 8.4.40 prisma: specifier: ^5.13.0 version: 5.14.0 + remixicon: + specifier: ^4.3.0 + version: 4.3.0 tailwindcss: specifier: ^3.4.3 version: 3.4.3 @@ -3112,6 +3130,9 @@ packages: resolution: {integrity: sha512-OccT/4vWnz3MFoPRIRlFDFWFBca3GCxXQ9LjFaOTzb47W9Fb8l4mwsonZ/h8pCYNq0tZqaRul6G5J8AFzAgKrg==} engines: {node: '>=18'} + '@sec-ant/readable-stream@0.4.1': + resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + '@selderee/plugin-htmlparser2@0.11.0': resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} @@ -3254,6 +3275,10 @@ packages: '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sindresorhus/merge-streams@4.0.0': + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + engines: {node: '>=18'} + '@sindresorhus/slugify@2.2.1': resolution: {integrity: sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==} engines: {node: '>=12'} @@ -3911,6 +3936,9 @@ packages: '@types/extend@3.0.4': resolution: {integrity: sha512-ArMouDUTJEz1SQRpFsT2rIw7DeqICFv5aaVzLSIYMYQSLcwcGOfT3VyglQs/p7K3F7fT4zxr0NWxYZIdifD6dA==} + '@types/fs-extra@11.0.4': + resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} + '@types/har-format@1.2.15': resolution: {integrity: sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==} @@ -3929,6 +3957,9 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/jsonfile@6.1.4': + resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} + '@types/lodash-es@4.17.12': resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} @@ -4571,6 +4602,9 @@ packages: bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + bowser@2.11.0: resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} @@ -4873,6 +4907,13 @@ packages: crypto-js@4.2.0: resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} + css-select@5.1.0: + resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + + css-what@6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} @@ -5247,6 +5288,10 @@ packages: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} + execa@9.3.0: + resolution: {integrity: sha512-l6JFbqnHEadBoVAVpN5dl2yCyfX28WoBAGaoQcNmLLSedOxTxcn2Qa83s8I/PA5i56vWru2OHOtrwF7Om2vqlg==} + engines: {node: ^18.19.0 || >=20.5.0} + extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -5291,6 +5336,10 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + figures@6.1.0: + resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} + engines: {node: '>=18'} + file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -5375,6 +5424,10 @@ packages: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} engines: {node: '>=14.14'} + fs-extra@11.2.0: + resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} + engines: {node: '>=14.14'} + fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} @@ -5429,6 +5482,10 @@ packages: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} + get-stream@9.0.1: + resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} + engines: {node: '>=18'} + get-tsconfig@4.7.5: resolution: {integrity: sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==} @@ -5609,6 +5666,10 @@ packages: hastscript@8.0.0: resolution: {integrity: sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==} + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + help-me@5.0.0: resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==} @@ -5672,6 +5733,10 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} + human-signals@7.0.0: + resolution: {integrity: sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==} + engines: {node: '>=18.18.0'} + husky@9.1.4: resolution: {integrity: sha512-bho94YyReb4JV7LYWRWxZ/xr6TtOTt8cMfmQ39MQYJ7f/YE268s3GdghGwi+y4zAeqewE5zYLvuhV0M0ijsDEA==} engines: {node: '>=18'} @@ -5836,6 +5901,10 @@ packages: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-stream@4.0.1: + resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} + engines: {node: '>=18'} + is-typed-array@1.1.13: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} engines: {node: '>= 0.4'} @@ -5844,6 +5913,10 @@ packages: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} + is-unicode-supported@2.0.0: + resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} + engines: {node: '>=18'} + is-url@1.2.4: resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} @@ -6591,6 +6664,9 @@ packages: encoding: optional: true + node-html-parser@6.1.13: + resolution: {integrity: sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==} + node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -6630,6 +6706,9 @@ packages: nprogress@0.2.0: resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} + nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + oauth@0.9.15: resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} @@ -7385,6 +7464,9 @@ packages: remark-stringify@11.0.0: resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + remixicon@4.3.0: + resolution: {integrity: sha512-jRYQ37dTFSkJtvcxwTUAkIiXkYRvA9EDvVuXPNrmt2xf/VS//CRgFtsX2TAFBoQOhh9SDh7l6La4Xu12snEyxg==} + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -7677,6 +7759,10 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} + strip-final-newline@4.0.0: + resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} + engines: {node: '>=18'} + strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -8401,6 +8487,10 @@ packages: resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} + yoctocolors@2.1.1: + resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==} + engines: {node: '>=18'} + yoga-layout@2.0.1: resolution: {integrity: sha512-tT/oChyDXelLo2A+UVnlW9GU7CsvFMaEnd9kVFsaiCQonFAXd3xrHhkLYu+suwwosrAEQ746xBU+HvYtm1Zs2Q==} @@ -12090,6 +12180,8 @@ snapshots: - '@vue/composition-api' - typescript + '@sec-ant/readable-stream@0.4.1': {} + '@selderee/plugin-htmlparser2@0.11.0': dependencies: domhandler: 5.0.3 @@ -12319,6 +12411,8 @@ snapshots: '@sinclair/typebox@0.27.8': {} + '@sindresorhus/merge-streams@4.0.0': {} + '@sindresorhus/slugify@2.2.1': dependencies: '@sindresorhus/transliterate': 1.6.0 @@ -13131,6 +13225,11 @@ snapshots: '@types/extend@3.0.4': {} + '@types/fs-extra@11.0.4': + dependencies: + '@types/jsonfile': 6.1.4 + '@types/node': 20.12.12 + '@types/har-format@1.2.15': {} '@types/hast@2.3.10': @@ -13150,6 +13249,10 @@ snapshots: '@types/json-schema@7.0.15': {} + '@types/jsonfile@6.1.4': + dependencies: + '@types/node': 20.12.12 + '@types/lodash-es@4.17.12': dependencies: '@types/lodash': 4.17.4 @@ -14134,6 +14237,8 @@ snapshots: inherits: 2.0.4 readable-stream: 3.6.2 + boolbase@1.0.0: {} + bowser@2.11.0: {} brace-expansion@1.1.11: @@ -14450,6 +14555,16 @@ snapshots: crypto-js@4.2.0: {} + css-select@5.1.0: + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 5.0.3 + domutils: 3.1.0 + nth-check: 2.1.1 + + css-what@6.1.0: {} + css.escape@1.5.1: {} cssesc@3.0.0: {} @@ -14883,6 +14998,21 @@ snapshots: signal-exit: 4.1.0 strip-final-newline: 3.0.0 + execa@9.3.0: + dependencies: + '@sindresorhus/merge-streams': 4.0.0 + cross-spawn: 7.0.3 + figures: 6.1.0 + get-stream: 9.0.1 + human-signals: 7.0.0 + is-plain-obj: 4.1.0 + is-stream: 4.0.1 + npm-run-path: 5.3.0 + pretty-ms: 9.0.0 + signal-exit: 4.1.0 + strip-final-newline: 4.0.0 + yoctocolors: 2.1.1 + extend@3.0.2: {} external-editor@3.1.0: @@ -14923,6 +15053,10 @@ snapshots: dependencies: reusify: 1.0.4 + figures@6.1.0: + dependencies: + is-unicode-supported: 2.0.0 + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -15014,6 +15148,12 @@ snapshots: jsonfile: 6.1.0 universalify: 2.0.1 + fs-extra@11.2.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + fs-minipass@2.1.0: dependencies: minipass: 3.3.6 @@ -15063,6 +15203,11 @@ snapshots: get-stream@8.0.1: {} + get-stream@9.0.1: + dependencies: + '@sec-ant/readable-stream': 0.4.1 + is-stream: 4.0.1 + get-tsconfig@4.7.5: dependencies: resolve-pkg-maps: 1.0.0 @@ -15391,6 +15536,8 @@ snapshots: property-information: 6.5.0 space-separated-tokens: 2.0.2 + he@1.2.0: {} + help-me@5.0.0: {} highlight.js@11.9.0: {} @@ -15453,6 +15600,8 @@ snapshots: human-signals@5.0.0: {} + human-signals@7.0.0: {} + husky@9.1.4: {} hyphen@1.10.4: {} @@ -15595,12 +15744,16 @@ snapshots: is-stream@3.0.0: {} + is-stream@4.0.1: {} + is-typed-array@1.1.13: dependencies: which-typed-array: 1.1.15 is-unicode-supported@0.1.0: {} + is-unicode-supported@2.0.0: {} + is-url@1.2.4: {} is-what@4.1.16: {} @@ -16683,6 +16836,11 @@ snapshots: dependencies: whatwg-url: 5.0.0 + node-html-parser@6.1.13: + dependencies: + css-select: 5.1.0 + he: 1.2.0 + node-releases@2.0.14: {} nodemailer@6.9.14: {} @@ -16718,6 +16876,10 @@ snapshots: nprogress@0.2.0: {} + nth-check@2.1.1: + dependencies: + boolbase: 1.0.0 + oauth@0.9.15: {} object-assign@4.1.1: {} @@ -17714,6 +17876,8 @@ snapshots: mdast-util-to-markdown: 2.1.0 unified: 11.0.4 + remixicon@4.3.0: {} + require-directory@2.1.1: {} require-from-string@2.0.2: {} @@ -18062,6 +18226,8 @@ snapshots: strip-final-newline@3.0.0: {} + strip-final-newline@4.0.0: {} + strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -18860,6 +19026,8 @@ snapshots: yocto-queue@1.1.1: {} + yoctocolors@2.1.1: {} + yoga-layout@2.0.1: {} zhead@2.2.4: {} From 947f70e6ce18c385121657913003aa17db30372b Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 06:47:38 +0530 Subject: [PATCH 02/30] feat: add script --- scripts/build-icons.ts | 146 ++++++++++++++++++++++++++++ scripts/generate-icons.ts | 35 +++++++ src/components/ui/icon/icon-list.ts | 1 + 3 files changed, 182 insertions(+) create mode 100644 scripts/build-icons.ts create mode 100644 scripts/generate-icons.ts create mode 100644 src/components/ui/icon/icon-list.ts diff --git a/scripts/build-icons.ts b/scripts/build-icons.ts new file mode 100644 index 000000000..d713b30fc --- /dev/null +++ b/scripts/build-icons.ts @@ -0,0 +1,146 @@ +import * as path from "node:path"; +// this script is based on https://github.com/epicweb-dev/epic-stack/blob/main/other/build-icons.ts +// +import { $ } from "execa"; +import glob from "fast-glob"; +import fsExtra from "fs-extra"; +import { parse } from "node-html-parser"; + +import { copyIcons, removeTempDir } from "./generate-icons"; + +const cwd = process.cwd(); +const inputDir = path.join(cwd, "temp-svg-icons"); +const inputDirRelative = path.relative(cwd, inputDir); +const outputDir = path.join(cwd, "src", "components", "ui", "icon"); + +const shouldVerboseLog = process.argv.includes("--log=verbose"); +const logVerbose = shouldVerboseLog ? console.log : () => {}; + +async function generateIconFiles() { + const files = glob + .sync("**/*.svg", { + cwd: inputDir, + }) + .sort((a, b) => a.localeCompare(b)); + + await fsExtra.ensureDir(outputDir); + + const spriteFilepath = path.join(outputDir, "sprite.svg"); + const typeOutputFilepath = path.join(outputDir, "icon-names.ts"); + const currentSprite = await fsExtra + .readFile(spriteFilepath, "utf8") + .catch(() => ""); + const currentTypes = await fsExtra + .readFile(typeOutputFilepath, "utf8") + .catch(() => ""); + + const iconNames = files.map((file) => iconName(file)); + + const spriteUpToDate = iconNames.every((name) => + currentSprite.includes(`id=${name}`), + ); + const typesUpToDate = iconNames.every((name) => + currentTypes.includes(`"${name}"`), + ); + + if (spriteUpToDate && typesUpToDate) { + logVerbose("Icons are up to date"); + return; + } + + logVerbose(`Generating sprite for ${inputDirRelative}`); + + const spriteChanged = await generateSvgSprite({ + files, + inputDir, + outputPath: spriteFilepath, + }); + + for (const file of files) { + logVerbose("✅", file); + } + logVerbose(`Saved to ${path.relative(cwd, spriteFilepath)}`); + + const stringifiedIconNames = iconNames.map((name) => JSON.stringify(name)); + + const typeOutputContent = `// This file is generated by yarn run build:icons + +export type IconName = +\t| ${stringifiedIconNames.join("\n\t| ")}; +`; + const typesChanged = await writeIfChanged( + typeOutputFilepath, + typeOutputContent, + ); + + logVerbose(`Manifest saved to ${path.relative(cwd, typeOutputFilepath)}`); + + if (spriteChanged || typesChanged) { + console.log(`Generated ${files.length} icons`); + } +} + +function iconName(file: string) { + return file.replace(/\.svg$/, ""); +} + +/** + * Creates a single SVG file that contains all the icons + */ +async function generateSvgSprite({ + files, + inputDir, + outputPath, +}: { + files: string[]; + inputDir: string; + outputPath: string; +}) { + // Each SVG becomes a symbol and we wrap them all in a single SVG + const symbols = await Promise.all( + files.map(async (file) => { + const input = await fsExtra.readFile(path.join(inputDir, file), "utf8"); + const root = parse(input); + + const svg = root.querySelector("svg"); + if (!svg) throw new Error("No SVG element found"); + + svg.tagName = "symbol"; + svg.setAttribute("id", iconName(file)); + svg.removeAttribute("xmlns"); + svg.removeAttribute("xmlns:xlink"); + svg.removeAttribute("version"); + svg.removeAttribute("width"); + svg.removeAttribute("height"); + + return svg.toString().trim(); + }), + ); + + const output = [ + ``, + "", + ``, + "", // for semantics: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs + ...symbols, + "", + "", + "", // trailing newline + ].join("\n"); + + return writeIfChanged(outputPath, output); +} + +async function writeIfChanged(filepath: string, newContent: string) { + const currentContent = await fsExtra + .readFile(filepath, "utf8") + .catch(() => ""); + if (currentContent === newContent) return false; + await fsExtra.writeFile(filepath, newContent, "utf8"); + await $`biome check --apply --no-errors-on-unmatched ${filepath}`; + return true; +} + +copyIcons(); +await generateIconFiles(); +await removeTempDir(); diff --git a/scripts/generate-icons.ts b/scripts/generate-icons.ts new file mode 100644 index 000000000..789d6c0f1 --- /dev/null +++ b/scripts/generate-icons.ts @@ -0,0 +1,35 @@ +import path from "node:path"; +import { iconList } from "@/components/ui/icon/icon-list"; +import glob from "fast-glob"; +import fs from "fs-extra"; + +const cwd = process.cwd(); +const inputDir = path.join(cwd, "node_modules", "remixicon", "icons"); +const tempDir = path.join(cwd, "temp-svg-icons"); + +export function copyIcons() { + fs.ensureDirSync(tempDir); + + const svgIcons = glob.sync("**/*.svg", { + cwd: inputDir, + }); + + for (const icon of svgIcons) { + const iconName = path.basename(icon); + + if (iconList.has(iconName.replace(".svg", ""))) { + const destinationFile = path.join(tempDir, iconName); + const file = path.join(inputDir, icon); + try { + fs.copyFileSync(file, destinationFile); + console.log(`Copied icon: ${iconName}`); + } catch (err) { + console.error(`Error copying file: ${iconName}`, err); + } + } + } +} + +export const removeTempDir = async () => { + await fs.remove(tempDir); +}; diff --git a/src/components/ui/icon/icon-list.ts b/src/components/ui/icon/icon-list.ts new file mode 100644 index 000000000..9386502ef --- /dev/null +++ b/src/components/ui/icon/icon-list.ts @@ -0,0 +1 @@ +export const iconList = new Set(["add-circle-line"]); From 570e9ca6b9960a61774533e2330766d3ad890dad Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 07:14:02 +0530 Subject: [PATCH 03/30] feat: add sprite and icons --- src/components/ui/icon/icon-list.ts | 100 +++++++++++++++++++++++++- src/components/ui/icon/icon-names.ts | 100 ++++++++++++++++++++++++++ src/components/ui/icon/sprite.svg | 103 +++++++++++++++++++++++++++ 3 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 src/components/ui/icon/icon-names.ts create mode 100644 src/components/ui/icon/sprite.svg diff --git a/src/components/ui/icon/icon-list.ts b/src/components/ui/icon/icon-list.ts index 9386502ef..11aa7f9ab 100644 --- a/src/components/ui/icon/icon-list.ts +++ b/src/components/ui/icon/icon-list.ts @@ -1 +1,99 @@ -export const iconList = new Set(["add-circle-line"]); +export const iconList = new Set([ + "account-circle-fill", + "account-circle-line", + "add-circle-line", + "add-fill", + "add-line", + "arrow-down-s-line", + "arrow-left-line", + "arrow-left-s-line", + "arrow-right-line", + "arrow-right-s-line", + "arrow-up-s-line", + "bank-card-fill", + "bank-card-line", + "bank-fill", + "bank-line", + "building-fill", + "building-line", + "calendar-2-line", + "check-fill", + "check-line", + "checkbox-circle-fill", + "checkbox-circle-line", + "circle-line", + "close-circle-line", + "close-line", + "cross-line", + "delete-bin-2-line", + "delete-bin-line", + "door-lock-fill", + "door-lock-line", + "equalizer-2-fill", + "equalizer-2-line", + "expand-up-down-line", + "eye-line", + "eye-off-line", + "file-cloud-fill", + "file-download-line", + "file-excel-fill", + "file-image-fill", + "file-music-fill", + "file-pdf-2-fill", + "file-ppt-fill", + "file-text-fill", + "file-text-line", + "file-unknow-fill", + "file-video-fill", + "file-word-fill", + "folder-3-fill", + "folder-5-fill", + "folder-5-line", + "folder-chart-2-fill", + "folder-chart-2-line", + "folder-chart-fill", + "folder-chart-line", + "folder-check-fill", + "google-fill", + "group-2-fill", + "group-2-line", + "home-2-fill", + "home-2-line", + "information-line", + "link", + "list-check-3", + "list-indefinite", + "loader-5-fill", + "lock-2-fill", + "lock-2-line", + "mail-check-line", + "mail-close-line", + "mail-line", + "mail-send-fill", + "mail-send-line", + "menu-line", + "money-dollar-circle-fill", + "money-dollar-circle-line", + "more-2-fill", + "notification-fill", + "notification-line", + "pie-chart-2-fill", + "pie-chart-2-line", + "pie-chart-fill", + "pie-chart-line", + "safe-2-fill", + "safe-fill", + "safe-line", + "search-line", + "share-line", + "shield-user-fill", + "shield-user-line", + "sketching", + "sparkling-fill", + "terminal-box-fill", + "terminal-box-line", + "text", + "upload-cloud-2-fill", + "upload-cloud-line", + "upload-line", +]); diff --git a/src/components/ui/icon/icon-names.ts b/src/components/ui/icon/icon-names.ts new file mode 100644 index 000000000..7dbd835a4 --- /dev/null +++ b/src/components/ui/icon/icon-names.ts @@ -0,0 +1,100 @@ +// This file is generated by yarn run build:icons + +export type IconName = + | "account-circle-fill" + | "account-circle-line" + | "add-circle-line" + | "add-fill" + | "add-line" + | "arrow-down-s-line" + | "arrow-left-line" + | "arrow-left-s-line" + | "arrow-right-line" + | "arrow-right-s-line" + | "arrow-up-s-line" + | "bank-card-fill" + | "bank-card-line" + | "bank-fill" + | "bank-line" + | "building-fill" + | "building-line" + | "calendar-2-line" + | "check-fill" + | "check-line" + | "checkbox-circle-fill" + | "checkbox-circle-line" + | "circle-line" + | "close-circle-line" + | "close-line" + | "cross-line" + | "delete-bin-2-line" + | "delete-bin-line" + | "door-lock-fill" + | "door-lock-line" + | "equalizer-2-fill" + | "equalizer-2-line" + | "expand-up-down-line" + | "eye-line" + | "eye-off-line" + | "file-cloud-fill" + | "file-download-line" + | "file-excel-fill" + | "file-image-fill" + | "file-music-fill" + | "file-pdf-2-fill" + | "file-ppt-fill" + | "file-text-fill" + | "file-text-line" + | "file-unknow-fill" + | "file-video-fill" + | "file-word-fill" + | "folder-3-fill" + | "folder-5-fill" + | "folder-5-line" + | "folder-chart-2-fill" + | "folder-chart-2-line" + | "folder-chart-fill" + | "folder-chart-line" + | "folder-check-fill" + | "google-fill" + | "group-2-fill" + | "group-2-line" + | "home-2-fill" + | "home-2-line" + | "information-line" + | "link" + | "list-check-3" + | "list-indefinite" + | "loader-5-fill" + | "lock-2-fill" + | "lock-2-line" + | "mail-check-line" + | "mail-close-line" + | "mail-line" + | "mail-send-fill" + | "mail-send-line" + | "menu-line" + | "money-dollar-circle-fill" + | "money-dollar-circle-line" + | "more-2-fill" + | "notification-fill" + | "notification-line" + | "pie-chart-2-fill" + | "pie-chart-2-line" + | "pie-chart-fill" + | "pie-chart-line" + | "safe-2-fill" + | "safe-fill" + | "safe-line" + | "search-line" + | "share-line" + | "shield-user-fill" + | "shield-user-line" + | "sketching" + | "sparkling-fill" + | "terminal-box-fill" + | "terminal-box-line" + | "text" + | "upload-cloud-2-fill" + | "upload-cloud-line" + | "upload-line"; diff --git a/src/components/ui/icon/sprite.svg b/src/components/ui/icon/sprite.svg new file mode 100644 index 000000000..5b7d3b501 --- /dev/null +++ b/src/components/ui/icon/sprite.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From dfc18872b238c20d620adad16f6c6e1245d54cbe Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 07:18:10 +0530 Subject: [PATCH 04/30] feat: add icon component --- src/components/ui/icon/index.tsx | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/components/ui/icon/index.tsx diff --git a/src/components/ui/icon/index.tsx b/src/components/ui/icon/index.tsx new file mode 100644 index 000000000..f459f1138 --- /dev/null +++ b/src/components/ui/icon/index.tsx @@ -0,0 +1,79 @@ +import type { SVGProps } from "react"; +import type { IconName } from "./icon-names"; + +import { cn } from "@/lib/utils"; +import href from "./sprite.svg"; + +export type { IconName }; + +const sizeClassName = { + font: "w-[1em] h-[1em]", + xs: "w-3 h-3", + sm: "w-4 h-4", + md: "w-5 h-5", + lg: "w-6 h-6", + xl: "w-7 h-7", +} as const; + +type Size = keyof typeof sizeClassName; + +const childrenSizeClassName = { + font: "gap-1.5", + xs: "gap-1.5", + sm: "gap-1.5", + md: "gap-2", + lg: "gap-2", + xl: "gap-3", +} satisfies Record; + +/** + * Renders an SVG icon. The icon defaults to the size of the font. To make it + * align vertically with neighboring text, you can pass the text as a child of + * the icon and it will be automatically aligned. + * Alternatively, if you're not ok with the icon being to the left of the text, + * you need to wrap the icon and text in a common parent and set the parent to + * display "flex" (or "inline-flex") with "items-center" and a reasonable gap. + * + * Pass `title` prop to the `Icon` component to get `` element rendered + * in the SVG container, providing this way for accessibility. + */ +export function Icon({ + name, + size = "font", + className, + title, + children, + ...props +}: SVGProps<SVGSVGElement> & { + name: IconName; + size?: Size; + title?: string; +}) { + if (children) { + return ( + <span + className={`inline-flex items-center ${childrenSizeClassName[size]}`} + > + <Icon + name={name} + size={size} + className={className} + title={title} + {...props} + /> + {children} + </span> + ); + } + return ( + // biome-ignore lint/a11y/noSvgWithoutTitle: <explanation> + <svg + {...props} + className={cn(sizeClassName[size], "inline self-center", className)} + aria-hidden + > + {title ? <title>{title} : null} + + + ); +} From 232533d6213e7e38d6a71b008761483f372c359d Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 07:39:24 +0530 Subject: [PATCH 05/30] feat: add replace script --- replace.ts | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 replace.ts diff --git a/replace.ts b/replace.ts new file mode 100644 index 000000000..dd76982e3 --- /dev/null +++ b/replace.ts @@ -0,0 +1,72 @@ +import * as fs from "node:fs"; +import * as path from "node:path"; + +function toKebabCase(input: string): string { + // Remove the leading "Ri" if it exists + const trimmedInput = input.startsWith("Ri") ? input.slice(2) : input; + + return trimmedInput + .replace(/([a-z])([A-Z])/g, "$1-$2") // Insert hyphen between lowercase and uppercase letters + .replace(/([A-Z])([A-Z][a-z])/g, "$1-$2") // Handle consecutive uppercase letters + .replace(/([a-zA-Z])(\d)/g, "$1-$2") // Insert hyphen between letters and numbers + .replace(/(\d)([A-Z])/g, "$1-$2") // Insert hyphen between numbers and letters + .toLowerCase(); // Convert the whole string to lowercase +} + +function replaceImports(directory: string): void { + const files = getAllFiles(directory); + + // biome-ignore lint/complexity/noForEach: + files.forEach((file) => { + if (file.endsWith(".tsx")) { + let content = fs.readFileSync(file, "utf8"); + + // Check if the Icon import already exists + const iconImportExists = + /import\s+{\s*Icon\s*}\s+from\s+["']@\/components\/ui\/icon["']/.test( + content, + ); + + // Add Icon import if it doesn't exist + if (!iconImportExists) { + content = content.replace( + /(import\s+(\{[\s\S]*?\})\s+from\s+["']@remixicon\/react["'])/, + '$1\nimport { Icon } from "@/components/ui/icon"', + ); + } + + // Replace component usage + content = content.replace( + /<(Ri[A-Z][a-zA-Z]+)(\s+[^>]*)?>/g, + (match, componentName, props) => { + const iconName = toKebabCase(componentName); + return ``; + }, + ); + + fs.writeFileSync(file, content, "utf8"); + console.log(`Processed: ${file}`); + } + }); +} + +function getAllFiles(dir: string): string[] { + const files: string[] = []; + + // biome-ignore lint/complexity/noForEach: + fs.readdirSync(dir).forEach((file) => { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + + if (stat.isDirectory()) { + files.push(...getAllFiles(filePath)); + } else { + files.push(filePath); + } + }); + + return files; +} + +// Replace 'your_project_directory' with the actual path to your project +replaceImports("./src"); From f244026f7efe2f40739a69dbafe83c42a6ac78b8 Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 07:46:09 +0530 Subject: [PATCH 06/30] feat: add icons --- .../(authenticated)/(dashboard)/[publicId]/captable/page.tsx | 4 ++-- .../(dashboard)/[publicId]/documents/[bucketId]/page.tsx | 3 ++- .../[publicId]/documents/document-upload-button.tsx | 4 ++-- .../(authenticated)/(dashboard)/[publicId]/documents/page.tsx | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/(authenticated)/(dashboard)/[publicId]/captable/page.tsx b/src/app/(authenticated)/(dashboard)/[publicId]/captable/page.tsx index 249dae9bc..c6f1daea4 100644 --- a/src/app/(authenticated)/(dashboard)/[publicId]/captable/page.tsx +++ b/src/app/(authenticated)/(dashboard)/[publicId]/captable/page.tsx @@ -1,6 +1,6 @@ import EmptyState from "@/components/common/empty-state"; import { Button } from "@/components/ui/button"; -import { RiPieChartFill } from "@remixicon/react"; +import { Icon } from "@/components/ui/icon"; import type { Metadata } from "next"; export const metadata: Metadata = { @@ -10,7 +10,7 @@ export const metadata: Metadata = { const CaptablePage = () => { return ( } + icon={} title="Work in progress." subtitle="This page is not yet available." > diff --git a/src/app/(authenticated)/(dashboard)/[publicId]/documents/[bucketId]/page.tsx b/src/app/(authenticated)/(dashboard)/[publicId]/documents/[bucketId]/page.tsx index 31feddcfe..0037a3a46 100644 --- a/src/app/(authenticated)/(dashboard)/[publicId]/documents/[bucketId]/page.tsx +++ b/src/app/(authenticated)/(dashboard)/[publicId]/documents/[bucketId]/page.tsx @@ -2,6 +2,7 @@ import FileIcon from "@/components/common/file-icon"; import FilePreview from "@/components/file/preview"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; +import { Icon } from "@/components/ui/icon"; import { withServerComponentSession } from "@/server/auth"; import { db } from "@/server/db"; import { getPresignedGetUrl } from "@/server/file-uploads"; @@ -42,7 +43,7 @@ const DocumentPreview = async ({ size="icon" className="-mt-1 mr-3 flex items-center rounded-full" > - + diff --git a/src/app/(authenticated)/(dashboard)/[publicId]/documents/document-upload-button.tsx b/src/app/(authenticated)/(dashboard)/[publicId]/documents/document-upload-button.tsx index fdea11ae4..550b419d2 100644 --- a/src/app/(authenticated)/(dashboard)/[publicId]/documents/document-upload-button.tsx +++ b/src/app/(authenticated)/(dashboard)/[publicId]/documents/document-upload-button.tsx @@ -2,7 +2,7 @@ import { pushModal } from "@/components/modals"; import { Button } from "@/components/ui/button"; -import { RiAddFill } from "@remixicon/react"; +import { Icon } from "@/components/ui/icon"; import React from "react"; type DocumentUploadButtonProps = { @@ -22,7 +22,7 @@ export const DocumentUploadButton = ({ }); }} > - + {buttonDisplayName} ); diff --git a/src/app/(authenticated)/(dashboard)/[publicId]/documents/page.tsx b/src/app/(authenticated)/(dashboard)/[publicId]/documents/page.tsx index 1306b2bcc..f55e2e75b 100644 --- a/src/app/(authenticated)/(dashboard)/[publicId]/documents/page.tsx +++ b/src/app/(authenticated)/(dashboard)/[publicId]/documents/page.tsx @@ -1,11 +1,11 @@ import EmptyState from "@/components/common/empty-state"; import { PageLayout } from "@/components/dashboard/page-layout"; import { Card } from "@/components/ui/card"; +import { Icon } from "@/components/ui/icon"; import { UnAuthorizedState } from "@/components/ui/un-authorized-state"; import { serverAccessControl } from "@/lib/rbac/access-control"; import { withServerComponentSession } from "@/server/auth"; import { api } from "@/trpc/server"; -import { RiUploadCloudLine } from "@remixicon/react"; import type { Metadata } from "next"; import DocumentsTable from "./components/table"; import { DocumentUploadButton } from "./document-upload-button"; @@ -32,7 +32,7 @@ const DocumentsPage = async () => { if (documents.length === 0) { return ( } + icon={} title="You do not have any documents!" subtitle="Please click the button below to upload a new document." > From f3440b225bdbe92159b00a4728806431cdc838ab Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 07:47:55 +0530 Subject: [PATCH 07/30] feat: add icons --- src/components/ui/data-table/data-table-buttons.tsx | 5 +++-- .../ui/data-table/data-table-faceted-filter.tsx | 9 +++++---- src/components/ui/data-table/data-table-view-options.tsx | 3 ++- src/components/ui/un-authorized-state.tsx | 3 ++- src/components/update/update-table.tsx | 3 ++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/ui/data-table/data-table-buttons.tsx b/src/components/ui/data-table/data-table-buttons.tsx index e3123a8f3..0a4dcded9 100644 --- a/src/components/ui/data-table/data-table-buttons.tsx +++ b/src/components/ui/data-table/data-table-buttons.tsx @@ -1,3 +1,4 @@ +import { Icon } from "@/components/ui/icon"; import { cn } from "@/lib/utils"; import { RiCloseLine, RiExpandUpDownLine } from "@remixicon/react"; import { Button, type ButtonProps } from "../button"; @@ -11,7 +12,7 @@ export function SortButton({ label, className, ...rest }: SortButtonProps) { return ( ); } @@ -26,7 +27,7 @@ export function ResetButton({ className, ...rest }: ResetButtonProps) { className={cn("h-8 px-2 lg:px-3", className)} > Reset - + ); } diff --git a/src/components/ui/data-table/data-table-faceted-filter.tsx b/src/components/ui/data-table/data-table-faceted-filter.tsx index 2d098eed5..8b5f382f2 100644 --- a/src/components/ui/data-table/data-table-faceted-filter.tsx +++ b/src/components/ui/data-table/data-table-faceted-filter.tsx @@ -1,7 +1,8 @@ +import { Icon } from "@/components/ui/icon"; import { cn } from "@/lib/utils"; import { RiAddCircleLine, RiCheckLine } from "@remixicon/react"; -import { type Column } from "@tanstack/react-table"; -import * as React from "react"; +import type { Column } from "@tanstack/react-table"; +import type * as React from "react"; import { Badge } from "../badge"; import { Button } from "../button"; import { @@ -38,7 +39,7 @@ export function DataTableFacetedFilter({ diff --git a/src/components/ui/un-authorized-state.tsx b/src/components/ui/un-authorized-state.tsx index 413025f8a..1fc5ef835 100644 --- a/src/components/ui/un-authorized-state.tsx +++ b/src/components/ui/un-authorized-state.tsx @@ -1,3 +1,4 @@ +import { Icon } from "@/components/ui/icon"; import { RiDoorLockFill } from "@remixicon/react"; import EmptyState, { type EmptyStateProps } from "../common/empty-state"; @@ -6,7 +7,7 @@ export function UnAuthorizedState(props: Partial) { } + icon={} title="Unauthorized" subtitle="You are not authorized to access this content" {...props} diff --git a/src/components/update/update-table.tsx b/src/components/update/update-table.tsx index 15f28b4a9..e7fa972a1 100644 --- a/src/components/update/update-table.tsx +++ b/src/components/update/update-table.tsx @@ -15,6 +15,7 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { Icon } from "@/components/ui/icon"; import type { RouterOutputs } from "@/trpc/shared"; import { RiAddCircleLine } from "@remixicon/react"; import { @@ -70,7 +71,7 @@ const UpdateActions = (row: { original: Update[number] }) => { From 7405b67c528a0fcfce1775cd2715856daecdc57b Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Fri, 9 Aug 2024 07:48:12 +0530 Subject: [PATCH 08/30] feat: add icons --- src/components/ui/password-input.tsx | 13 +++++++++++-- src/components/ui/radio-group.tsx | 3 ++- src/components/ui/select.tsx | 9 +++++---- src/components/ui/sheet.tsx | 3 ++- src/components/ui/simple-multi-select.tsx | 8 ++++++-- src/components/ui/stepper.tsx | 7 ++++++- src/components/update/editor.tsx | 3 ++- 7 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/components/ui/password-input.tsx b/src/components/ui/password-input.tsx index 14956ebde..479a91fd5 100644 --- a/src/components/ui/password-input.tsx +++ b/src/components/ui/password-input.tsx @@ -1,5 +1,6 @@ import * as React from "react"; +import { Icon } from "@/components/ui/icon"; import { RiEyeLine, RiEyeOffLine } from "@remixicon/react"; import { cn } from "@/lib/utils"; @@ -29,9 +30,17 @@ const PasswordInput = React.forwardRef< onClick={() => setShowPassword((show) => !show)} > {showPassword ? ( - + ) : ( - + )} diff --git a/src/components/ui/radio-group.tsx b/src/components/ui/radio-group.tsx index 9e929e43e..2187dd53f 100644 --- a/src/components/ui/radio-group.tsx +++ b/src/components/ui/radio-group.tsx @@ -1,5 +1,6 @@ "use client"; +import { Icon } from "@/components/ui/icon"; import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; import { RiCheckFill } from "@remixicon/react"; import * as React from "react"; @@ -34,7 +35,7 @@ const RadioGroupItem = React.forwardRef< {...props} > - + ); diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx index df1afa3dd..d13a7dacc 100644 --- a/src/components/ui/select.tsx +++ b/src/components/ui/select.tsx @@ -1,5 +1,6 @@ "use client"; +import { Icon } from "@/components/ui/icon"; import { cn } from "@/lib/utils"; import * as SelectPrimitive from "@radix-ui/react-select"; import { @@ -27,7 +28,7 @@ const SelectTrigger = React.forwardRef< > {children} - + )); @@ -46,7 +47,7 @@ const SelectScrollUpButton = React.forwardRef< )} {...props} > - + )); @@ -64,7 +65,7 @@ const SelectScrollDownButton = React.forwardRef< )} {...props} > - + )); @@ -131,7 +132,7 @@ const SelectItem = React.forwardRef< > - + diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx index a9a9461cb..2bfb1a35f 100644 --- a/src/components/ui/sheet.tsx +++ b/src/components/ui/sheet.tsx @@ -4,6 +4,7 @@ import * as SheetPrimitive from "@radix-ui/react-dialog"; import { type VariantProps, cva } from "class-variance-authority"; import * as React from "react"; +import { Icon } from "@/components/ui/icon"; import { cn } from "@/lib/utils"; import { RiCloseLine } from "@remixicon/react"; @@ -66,7 +67,7 @@ const SheetContent = React.forwardRef< > {children} - diff --git a/src/components/ui/simple-multi-select.tsx b/src/components/ui/simple-multi-select.tsx index 4af827845..d5fd1cc24 100644 --- a/src/components/ui/simple-multi-select.tsx +++ b/src/components/ui/simple-multi-select.tsx @@ -9,6 +9,7 @@ import { } from "@/components/ui/command"; import { cn } from "@/lib/utils"; import { RiCheckLine, RiCloseLine } from "@remixicon/react"; +import { Icon } from "@/components/ui/icon"; import { Command as CommandPrimitive } from "cmdk"; // import { X as RemoveIcon, Ri } from "lucide-react"; import React, { @@ -194,7 +195,10 @@ const MultiSelectorTrigger = forwardRef< onClick={() => onValueChange(item)} > Remove {item} option - + ))} @@ -298,7 +302,7 @@ const MultiSelectorItem = forwardRef< onMouseDown={mousePreventDefault} > {children} - {isIncluded && } + {isIncluded && } ); }); diff --git a/src/components/ui/stepper.tsx b/src/components/ui/stepper.tsx index d57c510b5..c5895c04d 100644 --- a/src/components/ui/stepper.tsx +++ b/src/components/ui/stepper.tsx @@ -1,5 +1,6 @@ "use client"; +import { Icon } from "@/components/ui/icon"; import { cn } from "@/lib/utils"; import { DescendantProvider, @@ -155,7 +156,11 @@ function StepList() { )} > {stepId < currentStep ? ( -