From 67da0a72dbfc8224351a1577e47d46fe666e39ad Mon Sep 17 00:00:00 2001 From: Samuel Date: Wed, 11 Dec 2024 16:41:37 +0100 Subject: [PATCH] feat: typed database with kysely, updated config --- eslint.config.js | 120 ++--- package.json | 10 +- pnpm-lock.yaml | 528 ++++++++++++++++++++ src/App.module.css | 33 -- src/App.tsx | 4 + src/components/ui/badge.tsx | 44 ++ src/components/ui/button.tsx | 51 ++ src/components/ui/charts.tsx | 256 +++++----- src/components/ui/checkbox.tsx | 59 +++ src/components/ui/label.tsx | 19 + src/components/ui/table.tsx | 91 ++++ src/components/ui/text-field.tsx | 147 ++++++ src/db.ts | 156 +++--- src/index.css | 13 - src/index.tsx | 27 +- src/lib/database.ts | 53 -- src/lib/{sql-queries.ts => sql-queries.txt} | 0 src/lib/utils.ts | 6 +- src/pages/chat/index.tsx | 8 + src/pages/home.tsx | 21 +- src/pages/overview.tsx | 47 -- src/pages/overview/index.tsx | 49 ++ src/pages/overview/overview-table.tsx | 347 +++++++++++++ vite.config.ts | 1 - 24 files changed, 1656 insertions(+), 434 deletions(-) delete mode 100644 src/App.module.css create mode 100644 src/components/ui/badge.tsx create mode 100644 src/components/ui/button.tsx create mode 100644 src/components/ui/checkbox.tsx create mode 100644 src/components/ui/label.tsx create mode 100644 src/components/ui/table.tsx create mode 100644 src/components/ui/text-field.tsx delete mode 100644 src/index.css delete mode 100644 src/lib/database.ts rename src/lib/{sql-queries.ts => sql-queries.txt} (100%) create mode 100644 src/pages/chat/index.tsx delete mode 100644 src/pages/overview.tsx create mode 100644 src/pages/overview/index.tsx create mode 100644 src/pages/overview/overview-table.tsx diff --git a/eslint.config.js b/eslint.config.js index aa99347..69f5da6 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,65 +8,69 @@ import simpleImportSort from "eslint-plugin-simple-import-sort"; import solid from "eslint-plugin-solid/configs/typescript"; import tseslint from "typescript-eslint"; -export default tseslint.config([ - eslint.configs.recommended, - // tseslint.configs.recommendedTypeChecked, - // tseslint.configs.strictTypeChecked, - // tseslint.configs.stylisticTypeChecked, - eslintPluginPrettierRecommended, - eslintConfigPrettier, +export default tseslint.config( { - ...solid, - languageOptions: { - parser: tsparser, - // Specifies the ESLint parser - parserOptions: { - ecmaVersion: 2024, - // Allows for the parsing of modern ECMAScript features - sourceType: "module", - // Allows for the use of imports - ecmaFeatures: { - jsx: true, // Allows for the parsing of JSX + ignores: ["dist/**/*.ts", "dist/**", "**/*.mjs", "eslint.config.js", "**/*.js"], + }, + [ + eslint.configs.recommended, + tseslint.configs.strictTypeChecked, + tseslint.configs.stylisticTypeChecked, + eslintPluginPrettierRecommended, + eslintConfigPrettier, + { + ...solid, + languageOptions: { + parser: tsparser, + // Specifies the ESLint parser + parserOptions: { + ecmaVersion: 2024, + // Allows for the parsing of modern ECMAScript features + sourceType: "module", + // Allows for the use of imports + ecmaFeatures: { + jsx: true, // Allows for the parsing of JSX + }, + project: "./tsconfig.json", + projectService: true, + tsconfigRootDir: import.meta.dirname, }, - project: "./tsconfig.json", - projectService: true, - tsconfigRootDir: import.meta.dirname, + }, + + plugins: { + "simple-import-sort": simpleImportSort, + }, + rules: { + // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs + // e.g. "@typescript-eslint/explicit-function-return-type": "off", + "simple-import-sort/imports": [ + "error", + { + groups: [ + // solidjs + ["^solid-(js|start)", "^@solidjs/"], + ["^@?\\w"], + // components imports + ["^~/components/?"], + // other /src imports + ["^~/"], + // Parent imports. Put `..` last. + ["^\\.\\.(?!/?$)", "^\\.\\./?$"], + // Other relative imports. Put same-folder imports and `.` last. + ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"], + // types imports + ["^~/types$"], + // Side effect imports. + ["^\\u0000"], + // Style imports. + ["^.+\\.?(s?css)$"], + ], + }, + ], + "simple-import-sort/exports": "error", + // "@typescript-eslint/consistent-type-imports": "error", + // "@typescript-eslint/consistent-type-exports": "error", }, }, - - plugins: { - "simple-import-sort": simpleImportSort, - }, - rules: { - // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs - // e.g. "@typescript-eslint/explicit-function-return-type": "off", - "simple-import-sort/imports": [ - "error", - { - groups: [ - // solidjs - ["^solid-(js|start)", "^@solidjs/"], - ["^@?\\w"], - // components imports - ["^~/components/?"], - // other /src imports - ["^~/"], - // Parent imports. Put `..` last. - ["^\\.\\.(?!/?$)", "^\\.\\./?$"], - // Other relative imports. Put same-folder imports and `.` last. - ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"], - // types imports - ["^~/types$"], - // Side effect imports. - ["^\\u0000"], - // Style imports. - ["^.+\\.?(s?css)$"], - ], - }, - ], - "simple-import-sort/exports": "error", - // "@typescript-eslint/consistent-type-imports": "error", - // "@typescript-eslint/consistent-type-exports": "error", - }, - }, -]); + ], +); diff --git a/package.json b/package.json index 9155997..15065ad 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "dev": "vite", "build": "vite build", "serve": "vite preview", - "postinstall": "cp ./node_modules/sql.js/dist/sql-wasm.wasm ./src/assets/sql-wasm.wasm" + "postinstall": "cp ./node_modules/sql.js/dist/sql-wasm.wasm ./src/assets/sql-wasm.wasm", + "generate-db-types": "kysely-codegen --dialect=sqlite --url=./src/assets/database.sqlite" }, "license": "MIT", "devDependencies": { @@ -18,11 +19,13 @@ "@typescript-eslint/eslint-plugin": "^8.17.0", "@typescript-eslint/parser": "^8.17.0", "autoprefixer": "^10.4.20", + "better-sqlite3": "^11.7.0", "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-solid": "^0.14.4", + "kysely-codegen": "^0.17.0", "postcss": "^8.4.49", "prettier": "^3.4.2", "prettier-plugin-tailwindcss": "^0.6.9", @@ -37,9 +40,14 @@ "@kobalte/tailwindcss": "^0.9.0", "@solid-primitives/refs": "^1.0.8", "@solidjs/router": "^0.15.1", + "@tanstack/solid-table": "^8.20.5", "chart.js": "^4.4.7", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "date-fns": "^4.1.0", + "kysely": "^0.27.5", + "kysely-wasm": "^0.7.0", + "lucide-solid": "^0.468.0", "solid-js": "^1.9.3", "sql.js": "^1.12.0", "tailwind-merge": "^2.5.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08c45a5..402d0c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@solidjs/router': specifier: ^0.15.1 version: 0.15.1(solid-js@1.9.3) + '@tanstack/solid-table': + specifier: ^8.20.5 + version: 8.20.5(solid-js@1.9.3) chart.js: specifier: ^4.4.7 version: 4.4.7 @@ -29,6 +32,18 @@ importers: clsx: specifier: ^2.1.1 version: 2.1.1 + date-fns: + specifier: ^4.1.0 + version: 4.1.0 + kysely: + specifier: ^0.27.5 + version: 0.27.5 + kysely-wasm: + specifier: ^0.7.0 + version: 0.7.0(kysely@0.27.5) + lucide-solid: + specifier: ^0.468.0 + version: 0.468.0(solid-js@1.9.3) solid-js: specifier: ^1.9.3 version: 1.9.3 @@ -60,6 +75,9 @@ importers: autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.49) + better-sqlite3: + specifier: ^11.7.0 + version: 11.7.0 eslint: specifier: ^9.16.0 version: 9.16.0(jiti@1.21.6) @@ -75,6 +93,9 @@ importers: eslint-plugin-solid: specifier: ^0.14.4 version: 0.14.4(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2) + kysely-codegen: + specifier: ^0.17.0 + version: 0.17.0(better-sqlite3@11.7.0)(kysely@0.27.5) postcss: specifier: ^8.4.49 version: 8.4.49 @@ -623,6 +644,16 @@ packages: '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} + '@tanstack/solid-table@8.20.5': + resolution: {integrity: sha512-LsB/g/24CjBpccOcok+u+tfyqtU9SIQg5wf7ne54jRdEsy5YQnrpb5ATWZileHBduIG0p/1oE7UOA+DyjtnbDQ==} + engines: {node: '>=12'} + peerDependencies: + solid-js: '>=1.3' + + '@tanstack/table-core@8.20.5': + resolution: {integrity: sha512-P9dF7XbibHph2PFRz8gfBKEXEY/HJPOhym8CHmjF8y3q5mWpKx9xtZapXQUWCgkqvsK0R46Azuz+VaxD4Xl+Tg==} + engines: {node: '>=12'} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -733,6 +764,10 @@ packages: resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} + ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -774,10 +809,22 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + better-sqlite3@11.7.0: + resolution: {integrity: sha512-mXpa5jnIKKHeoGzBrUJrc65cXFKcILGZpU3FXR0pradUEm9MA7UZz02qfEejaMcm9iXrSOCenwwYMJ/tZ1y5Ig==} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + + bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -793,6 +840,9 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -804,6 +854,10 @@ packages: caniuse-lite@1.0.30001687: resolution: {integrity: sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==} + chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -816,6 +870,9 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} + chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} @@ -823,10 +880,16 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} + color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -852,6 +915,9 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + date-fns@4.1.0: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + debug@4.4.0: resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} engines: {node: '>=6.0'} @@ -861,15 +927,39 @@ packages: supports-color: optional: true + decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + detect-libc@2.0.3: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + diff@3.5.0: + resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} + engines: {node: '>=0.3.1'} + dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + dotenv-expand@11.0.7: + resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} + engines: {node: '>=12'} + + dotenv@16.4.7: + resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} + engines: {node: '>=12'} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -882,6 +972,9 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + end-of-stream@1.4.4: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -895,6 +988,10 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -972,6 +1069,10 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + expand-template@2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -995,6 +1096,9 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -1017,6 +1121,12 @@ packages: fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -1029,6 +1139,13 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + git-diff@2.0.6: + resolution: {integrity: sha512-/Iu4prUrydE3Pb3lCBMbcSNIf81tgGt0W1ZwknnyF62t3tHmtiJTRj0f+1ZIhp3+Rh0ktz1pJVoa7ZXUCskivA==} + engines: {node: '>= 4.8.0'} + + github-from-package@0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1041,6 +1158,10 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -1052,6 +1173,10 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1067,6 +1192,9 @@ packages: resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} engines: {node: '>=8'} + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -1079,9 +1207,23 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + inline-style-parser@0.2.4: resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} + interpret@1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -1159,6 +1301,49 @@ packages: known-css-properties@0.30.0: resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==} + kysely-codegen@0.17.0: + resolution: {integrity: sha512-C36g6epial8cIOSBEWGI9sRfkKSsEzTcivhjPivtYFQnhMdXnrVFaUe7UMZHeSdXaHiWDqDOkReJgWLD8nPKdg==} + hasBin: true + peerDependencies: + '@libsql/kysely-libsql': ^0.3.0 + '@tediousjs/connection-string': ^0.5.0 + better-sqlite3: '>=7.6.2' + kysely: ^0.27.0 + kysely-bun-sqlite: ^0.3.2 + kysely-bun-worker: ^0.5.3 + mysql2: ^2.3.3 || ^3.0.0 + pg: ^8.8.0 + tarn: ^3.0.0 + tedious: ^18.0.0 + peerDependenciesMeta: + '@libsql/kysely-libsql': + optional: true + '@tediousjs/connection-string': + optional: true + better-sqlite3: + optional: true + kysely-bun-sqlite: + optional: true + kysely-bun-worker: + optional: true + mysql2: + optional: true + pg: + optional: true + tarn: + optional: true + tedious: + optional: true + + kysely-wasm@0.7.0: + resolution: {integrity: sha512-SUzSCJdY4AioyivtcjJBXXnXE2Y3Tdsv96sJYfey6KlFPNVf7JrUl7SiI8gimZJqFLtdvmzjPJwevc5ReLSHjQ==} + peerDependencies: + kysely: '>=0.26' + + kysely@0.27.5: + resolution: {integrity: sha512-s7hZHcQeSNKpzCkHRm8yA+0JPLjncSWnjb+2TIElwS2JAqYr+Kv3Ess+9KFfJS0C1xcQ1i9NkNHpWwCYpHMWsA==} + engines: {node: '>=14.0.0'} + levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -1177,12 +1362,21 @@ packages: lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + loglevel@1.9.2: + resolution: {integrity: sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==} + engines: {node: '>= 0.6.0'} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + lucide-solid@0.468.0: + resolution: {integrity: sha512-saTgTS9QvkDdWMl2mHxxubz1A8+3hfbdKeZ2KbluONqBhxwncFDyYQCqfsYMzyrGn3JPRy8O6ha0N9qM0TsSSA==} + peerDependencies: + solid-js: ^1.4.7 + merge-anything@5.1.7: resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==} engines: {node: '>=12.13'} @@ -1195,6 +1389,10 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -1202,10 +1400,16 @@ packages: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1217,9 +1421,16 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + napi-build-utils@1.0.2: + resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + node-abi@3.71.0: + resolution: {integrity: sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==} + engines: {node: '>=10'} + node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} @@ -1239,6 +1450,9 @@ packages: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -1265,6 +1479,10 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -1291,6 +1509,10 @@ packages: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + postcss-import@15.1.0: resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} @@ -1332,6 +1554,11 @@ packages: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} + prebuild-install@7.1.2: + resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} + engines: {node: '>=10'} + hasBin: true + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1400,6 +1627,9 @@ packages: engines: {node: '>=14'} hasBin: true + pump@3.0.2: + resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -1407,13 +1637,25 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + rechoir@0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -1434,6 +1676,9 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -1461,10 +1706,25 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + shelljs.exec@1.1.8: + resolution: {integrity: sha512-vFILCw+lzUtiwBAHV8/Ex8JsFjelFMdhONIsgKNLgTzeRckp2AOYRQtHJE/9LhNvdMmE27AGtzWx0+DHpwIwSw==} + engines: {node: '>= 4.0.0'} + + shelljs@0.8.5: + resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} + engines: {node: '>=4'} + hasBin: true + signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + simple-get@4.0.1: + resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + solid-js@1.9.3: resolution: {integrity: sha512-5ba3taPoZGt9GY3YlsCB24kCg0Lv/rie/HTD4kG6h4daZZz7+yK02xn8Vx8dLYBc9i6Ps5JwAbEiqjmKaLB3Ag==} @@ -1498,6 +1758,9 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -1506,6 +1769,10 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -1518,6 +1785,10 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true + supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1543,6 +1814,13 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + tar-fs@2.1.1: + resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -1566,6 +1844,9 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -1678,6 +1959,9 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -2154,6 +2438,13 @@ snapshots: dependencies: tslib: 2.8.1 + '@tanstack/solid-table@8.20.5(solid-js@1.9.3)': + dependencies: + '@tanstack/table-core': 8.20.5 + solid-js: 1.9.3 + + '@tanstack/table-core@8.20.5': {} + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.26.3 @@ -2289,6 +2580,10 @@ snapshots: ansi-regex@6.1.0: {} + ansi-styles@3.2.1: + dependencies: + color-convert: 1.9.3 + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -2333,8 +2628,25 @@ snapshots: balanced-match@1.0.2: {} + base64-js@1.5.1: {} + + better-sqlite3@11.7.0: + dependencies: + bindings: 1.5.0 + prebuild-install: 7.1.2 + binary-extensions@2.3.0: {} + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + + bl@4.1.0: + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -2355,12 +2667,23 @@ snapshots: node-releases: 2.0.18 update-browserslist-db: 1.1.1(browserslist@4.24.2) + buffer@5.7.1: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + callsites@3.1.0: {} camelcase-css@2.0.1: {} caniuse-lite@1.0.30001687: {} + chalk@2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -2382,16 +2705,24 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chownr@1.1.4: {} + class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 clsx@2.1.1: {} + color-convert@1.9.3: + dependencies: + color-name: 1.1.3 + color-convert@2.0.1: dependencies: color-name: 1.1.4 + color-name@1.1.3: {} + color-name@1.1.4: {} commander@4.1.1: {} @@ -2410,16 +2741,34 @@ snapshots: csstype@3.1.3: {} + date-fns@4.1.0: {} + debug@4.4.0: dependencies: ms: 2.1.3 + decompress-response@6.0.0: + dependencies: + mimic-response: 3.1.0 + + deep-extend@0.6.0: {} + deep-is@0.1.4: {} + detect-libc@2.0.3: {} + didyoumean@1.2.2: {} + diff@3.5.0: {} + dlv@1.1.3: {} + dotenv-expand@11.0.7: + dependencies: + dotenv: 16.4.7 + + dotenv@16.4.7: {} + eastasianwidth@0.2.0: {} electron-to-chromium@1.5.71: {} @@ -2428,6 +2777,10 @@ snapshots: emoji-regex@9.2.2: {} + end-of-stream@1.4.4: + dependencies: + once: 1.4.0 + entities@4.5.0: {} esbuild@0.24.0: @@ -2459,6 +2812,8 @@ snapshots: escalade@3.2.0: {} + escape-string-regexp@1.0.5: {} + escape-string-regexp@4.0.0: {} eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.6)): @@ -2559,6 +2914,8 @@ snapshots: esutils@2.0.3: {} + expand-template@2.0.3: {} + fast-deep-equal@3.1.3: {} fast-diff@1.3.0: {} @@ -2583,6 +2940,8 @@ snapshots: dependencies: flat-cache: 4.0.1 + file-uri-to-path@1.0.0: {} + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -2606,6 +2965,10 @@ snapshots: fraction.js@4.3.7: {} + fs-constants@1.0.0: {} + + fs.realpath@1.0.0: {} + fsevents@2.3.3: optional: true @@ -2613,6 +2976,16 @@ snapshots: gensync@1.0.0-beta.2: {} + git-diff@2.0.6: + dependencies: + chalk: 2.4.2 + diff: 3.5.0 + loglevel: 1.9.2 + shelljs: 0.8.5 + shelljs.exec: 1.1.8 + + github-from-package@0.0.0: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -2630,12 +3003,23 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + globals@11.12.0: {} globals@14.0.0: {} graphemer@1.4.0: {} + has-flag@3.0.0: {} + has-flag@4.0.0: {} hasown@2.0.2: @@ -2646,6 +3030,8 @@ snapshots: html-tags@3.3.1: {} + ieee754@1.2.1: {} + ignore@5.3.2: {} import-fresh@3.3.0: @@ -2655,8 +3041,19 @@ snapshots: imurmurhash@0.1.4: {} + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + + ini@1.3.8: {} + inline-style-parser@0.2.4: {} + interpret@1.4.0: {} + is-binary-path@2.1.0: dependencies: binary-extensions: 2.3.0 @@ -2715,6 +3112,25 @@ snapshots: known-css-properties@0.30.0: {} + kysely-codegen@0.17.0(better-sqlite3@11.7.0)(kysely@0.27.5): + dependencies: + chalk: 4.1.2 + dotenv: 16.4.7 + dotenv-expand: 11.0.7 + git-diff: 2.0.6 + kysely: 0.27.5 + micromatch: 4.0.8 + minimist: 1.2.8 + pluralize: 8.0.0 + optionalDependencies: + better-sqlite3: 11.7.0 + + kysely-wasm@0.7.0(kysely@0.27.5): + dependencies: + kysely: 0.27.5 + + kysely@0.27.5: {} + levn@0.4.1: dependencies: prelude-ls: 1.2.1 @@ -2730,12 +3146,18 @@ snapshots: lodash.merge@4.6.2: {} + loglevel@1.9.2: {} + lru-cache@10.4.3: {} lru-cache@5.1.1: dependencies: yallist: 3.1.1 + lucide-solid@0.468.0(solid-js@1.9.3): + dependencies: + solid-js: 1.9.3 + merge-anything@5.1.7: dependencies: is-what: 4.1.16 @@ -2747,6 +3169,8 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 + mimic-response@3.1.0: {} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -2755,8 +3179,12 @@ snapshots: dependencies: brace-expansion: 2.0.1 + minimist@1.2.8: {} + minipass@7.1.2: {} + mkdirp-classic@0.5.3: {} + ms@2.1.3: {} mz@2.7.0: @@ -2767,8 +3195,14 @@ snapshots: nanoid@3.3.8: {} + napi-build-utils@1.0.2: {} + natural-compare@1.4.0: {} + node-abi@3.71.0: + dependencies: + semver: 7.6.3 + node-releases@2.0.18: {} normalize-path@3.0.0: {} @@ -2779,6 +3213,10 @@ snapshots: object-hash@3.0.0: {} + once@1.4.0: + dependencies: + wrappy: 1.0.2 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -2808,6 +3246,8 @@ snapshots: path-exists@4.0.0: {} + path-is-absolute@1.0.1: {} + path-key@3.1.1: {} path-parse@1.0.7: {} @@ -2825,6 +3265,8 @@ snapshots: pirates@4.0.6: {} + pluralize@8.0.0: {} + postcss-import@15.1.0(postcss@8.4.49): dependencies: postcss: 8.4.49 @@ -2862,6 +3304,21 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + prebuild-install@7.1.2: + dependencies: + detect-libc: 2.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 1.0.2 + node-abi: 3.71.0 + pump: 3.0.2 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.1 + tunnel-agent: 0.6.0 + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: @@ -2874,18 +3331,40 @@ snapshots: prettier@3.4.2: {} + pump@3.0.2: + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + punycode@2.3.1: {} queue-microtask@1.2.3: {} + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + read-cache@1.0.0: dependencies: pify: 2.3.0 + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + readdirp@3.6.0: dependencies: picomatch: 2.3.1 + rechoir@0.6.2: + dependencies: + resolve: 1.22.8 + resolve-from@4.0.0: {} resolve@1.22.8: @@ -2925,6 +3404,8 @@ snapshots: dependencies: queue-microtask: 1.2.3 + safe-buffer@5.2.1: {} + semver@6.3.1: {} semver@7.6.3: {} @@ -2941,8 +3422,24 @@ snapshots: shebang-regex@3.0.0: {} + shelljs.exec@1.1.8: {} + + shelljs@0.8.5: + dependencies: + glob: 7.2.3 + interpret: 1.4.0 + rechoir: 0.6.2 + signal-exit@4.1.0: {} + simple-concat@1.0.1: {} + + simple-get@4.0.1: + dependencies: + decompress-response: 6.0.0 + once: 1.4.0 + simple-concat: 1.0.1 + solid-js@1.9.3: dependencies: csstype: 3.1.3 @@ -2984,6 +3481,10 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -2992,6 +3493,8 @@ snapshots: dependencies: ansi-regex: 6.1.0 + strip-json-comments@2.0.1: {} + strip-json-comments@3.1.1: {} style-to-object@1.0.8: @@ -3008,6 +3511,10 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 + supports-color@5.5.0: + dependencies: + has-flag: 3.0.0 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -3052,6 +3559,21 @@ snapshots: transitivePeerDependencies: - ts-node + tar-fs@2.1.1: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.2 + tar-stream: 2.2.0 + + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + thenify-all@1.6.0: dependencies: thenify: 3.3.1 @@ -3072,6 +3594,10 @@ snapshots: tslib@2.8.1: {} + tunnel-agent@0.6.0: + dependencies: + safe-buffer: 5.2.1 + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 @@ -3151,6 +3677,8 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrappy@1.0.2: {} + yallist@3.1.1: {} yaml@2.6.1: {} diff --git a/src/App.module.css b/src/App.module.css deleted file mode 100644 index 48308b2..0000000 --- a/src/App.module.css +++ /dev/null @@ -1,33 +0,0 @@ -.App { - text-align: center; -} - -.logo { - animation: logo-spin infinite 20s linear; - height: 40vmin; - pointer-events: none; -} - -.header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.link { - color: #b318f0; -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.tsx b/src/App.tsx index 99c16d5..7f3f55e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,10 @@ import { type Component } from "solid-js"; import { Route } from "@solidjs/router"; + import { Home, Overview } from "./pages"; +import "./app.css"; + const App: Component = () => { return ( <> @@ -13,6 +16,7 @@ const App: Component = () => { path="/overview" component={Overview} /> + ); }; diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx new file mode 100644 index 0000000..0c39688 --- /dev/null +++ b/src/components/ui/badge.tsx @@ -0,0 +1,44 @@ +import type { Component, ComponentProps } from "solid-js"; +import { splitProps } from "solid-js"; + +import type { VariantProps } from "class-variance-authority"; +import { cva } from "class-variance-authority"; + +import { cn } from "~/lib/utils"; + +const badgeVariants = cva( + "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: "border-transparent bg-primary text-primary-foreground", + secondary: "border-transparent bg-secondary text-secondary-foreground", + outline: "text-foreground", + success: "border-success-foreground bg-success text-success-foreground", + warning: "border-warning-foreground bg-warning text-warning-foreground", + error: "border-error-foreground bg-error text-error-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); + +type BadgeProps = ComponentProps<"div"> & + VariantProps & { + round?: boolean; + }; + +const Badge: Component = (props) => { + const [local, others] = splitProps(props, ["class", "variant", "round"]); + return ( +
+ ); +}; + +export type { BadgeProps }; +export { Badge, badgeVariants }; diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx new file mode 100644 index 0000000..4f55a28 --- /dev/null +++ b/src/components/ui/button.tsx @@ -0,0 +1,51 @@ +import type { JSX, ValidComponent } from "solid-js"; +import { splitProps } from "solid-js"; + +import * as ButtonPrimitive from "@kobalte/core/button"; +import type { PolymorphicProps } from "@kobalte/core/polymorphic"; +import type { VariantProps } from "class-variance-authority"; +import { cva } from "class-variance-authority"; + +import { cn } from "~/lib/utils"; + +const buttonVariants = cva( + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", + { + variants: { + variant: { + default: "bg-primary text-primary-foreground hover:bg-primary/90", + destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: "border border-input hover:bg-accent hover:text-accent-foreground", + secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-10 px-4 py-2", + sm: "h-9 px-3 text-xs", + lg: "h-11 px-8", + icon: "size-10", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + }, +); + +type ButtonProps = ButtonPrimitive.ButtonRootProps & + VariantProps & { class?: string | undefined; children?: JSX.Element }; + +const Button = (props: PolymorphicProps>) => { + const [local, others] = splitProps(props as ButtonProps, ["variant", "size", "class"]); + return ( + + ); +}; + +export type { ButtonProps }; +export { Button, buttonVariants }; diff --git a/src/components/ui/charts.tsx b/src/components/ui/charts.tsx index 5abab3a..7557adf 100644 --- a/src/components/ui/charts.tsx +++ b/src/components/ui/charts.tsx @@ -1,19 +1,19 @@ -import type { Component } from "solid-js" -import { createEffect, createSignal, mergeProps, on, onCleanup, onMount } from "solid-js" -import { unwrap } from "solid-js/store" +import type { Component } from "solid-js"; +import { createEffect, createSignal, mergeProps, on, onCleanup, onMount } from "solid-js"; +import { unwrap } from "solid-js/store"; -import type { Ref } from "@solid-primitives/refs" -import { mergeRefs } from "@solid-primitives/refs" +import type { Ref } from "@solid-primitives/refs"; +import { mergeRefs } from "@solid-primitives/refs"; import type { ChartComponent, ChartData, ChartItem, ChartOptions, - Plugin as ChartPlugin, ChartType, ChartTypeRegistry, - TooltipModel -} from "chart.js" + Plugin as ChartPlugin, + TooltipModel, +} from "chart.js"; import { ArcElement, BarController, @@ -34,167 +34,166 @@ import { RadarController, RadialLinearScale, ScatterController, - Tooltip -} from "chart.js" + Tooltip, +} from "chart.js"; -type TypedChartProps = { - data: ChartData - options?: ChartOptions - plugins?: ChartPlugin[] - ref?: Ref - width?: number | undefined - height?: number | undefined +interface TypedChartProps { + data: ChartData; + options?: ChartOptions; + plugins?: ChartPlugin[]; + ref?: Ref; + width?: number | undefined; + height?: number | undefined; } type ChartProps = TypedChartProps & { - type: ChartType -} + type: ChartType; +}; -type ChartContext = { - chart: Chart - tooltip: TooltipModel +interface ChartContext { + chart: Chart; + tooltip: TooltipModel; } const BaseChart: Component = (rawProps) => { - const [canvasRef, setCanvasRef] = createSignal() - const [chart, setChart] = createSignal() + const [canvasRef, setCanvasRef] = createSignal(); + const [chart, setChart] = createSignal(); const props = mergeProps( { width: 512, height: 512, options: { responsive: true } as ChartOptions, - plugins: [] as ChartPlugin[] + plugins: [] as ChartPlugin[], }, - rawProps - ) + rawProps, + ); const init = () => { - const ctx = canvasRef()?.getContext("2d") as ChartItem - const config = unwrap(props) + const ctx = canvasRef()?.getContext("2d") as ChartItem; + const config = unwrap(props); const chart = new Chart(ctx, { type: config.type, data: config.data, options: config.options, - plugins: config.plugins - }) - setChart(chart) - } + plugins: config.plugins, + }); + setChart(chart); + }; - onMount(() => init()) + onMount(() => { + init(); + }); createEffect( on( () => props.data, () => { - chart()!.data = props.data - chart()!.update() + chart()!.data = props.data; + chart()!.update(); }, - { defer: true } - ) - ) + { defer: true }, + ), + ); createEffect( on( () => props.options, () => { - chart()!.options = props.options - chart()!.update() + chart()!.options = props.options; + chart()!.update(); }, - { defer: true } - ) - ) + { defer: true }, + ), + ); createEffect( on( [() => props.width, () => props.height], () => { - chart()!.resize(props.width, props.height) + chart()!.resize(props.width, props.height); }, - { defer: true } - ) - ) + { defer: true }, + ), + ); createEffect( on( () => props.type, () => { - const dimensions = [chart()!.width, chart()!.height] - chart()!.destroy() - init() - chart()!.resize(...dimensions) + const dimensions = [chart()!.width, chart()!.height]; + chart()!.destroy(); + init(); + chart()!.resize(...dimensions); }, - { defer: true } - ) - ) + { defer: true }, + ), + ); onCleanup(() => { - chart()?.destroy() - mergeRefs(props.ref, null) - }) + chart()?.destroy(); + mergeRefs(props.ref, null); + }); - Chart.register(Colors, Filler, Legend, Tooltip) + Chart.register(Colors, Filler, Legend, Tooltip); return ( setCanvasRef(el))} height={props.height} width={props.width} /> - ) -} + ); +}; function showTooltip(context: ChartContext) { - let el = document.getElementById("chartjs-tooltip") + let el = document.getElementById("chartjs-tooltip"); if (!el) { - el = document.createElement("div") - el.id = "chartjs-tooltip" - document.body.appendChild(el) + el = document.createElement("div"); + el.id = "chartjs-tooltip"; + document.body.appendChild(el); } - const model = context.tooltip + const model = context.tooltip; if (model.opacity === 0 || !model.body) { - el.style.opacity = "0" - return + el.style.opacity = "0"; + return; } el.className = `p-2 bg-card text-card-foreground rounded-lg border shadow-sm text-sm ${ model.yAlign ?? `no-transform` - }` + }`; - let content = "" + let content = ""; model.title.forEach((title) => { - content += `

${title}

` - }) + content += `

${title}

`; + }); - content += `
` - const body = model.body.flatMap((body) => body.lines) + content += `
`; + const body = model.body.flatMap((body) => body.lines); body.forEach((line, i) => { - const colors = model.labelColors[i] + const colors = model.labelColors[i]; content += `
${line} -
` - }) - content += `
` +
`; + }); + content += `
`; - el.innerHTML = content + el.innerHTML = content; - const pos = context.chart.canvas.getBoundingClientRect() - el.style.opacity = "1" - el.style.position = "absolute" - el.style.left = `${pos.left + window.scrollX + model.caretX}px` - el.style.top = `${pos.top + window.scrollY + model.caretY}px` - el.style.pointerEvents = "none" + const pos = context.chart.canvas.getBoundingClientRect(); + el.style.opacity = "1"; + el.style.position = "absolute"; + el.style.left = `${pos.left + window.scrollX + model.caretX}px`; + el.style.top = `${pos.top + window.scrollY + model.caretY}px`; + el.style.pointerEvents = "none"; } -function createTypedChart( - type: ChartType, - components: ChartComponent[] -): Component { - const chartsWithScales: ChartType[] = ["bar", "line", "scatter"] - const chartsWithLegends: ChartType[] = ["bar", "line"] +function createTypedChart(type: ChartType, components: ChartComponent[]): Component { + const chartsWithScales: ChartType[] = ["bar", "line", "scatter"]; + const chartsWithLegends: ChartType[] = ["bar", "line"]; const options: ChartOptions = { responsive: true, @@ -203,18 +202,18 @@ function createTypedChart( ? { x: { border: { display: false }, - grid: { display: false } + grid: { display: false }, }, y: { border: { dash: [3], dashOffset: 3, - display: false + display: false, }, grid: { - color: "hsla(240, 3.8%, 46.1%, 0.4)" - } - } + color: "hsla(240, 3.8%, 46.1%, 0.4)", + }, + }, } : {}, plugins: { @@ -227,66 +226,61 @@ function createTypedChart( boxWidth: 6, boxHeight: 6, color: "hsl(240, 3.8%, 46.1%)", - font: { size: 14 } - } + font: { size: 14 }, + }, } : { display: false }, tooltip: { enabled: false, - external: (context) => showTooltip(context) - } - } - } + external: (context) => { + showTooltip(context); + }, + }, + }, + }; - Chart.register(...components) - return (props) => + Chart.register(...components); + return (props) => ( + + ); } -const BarChart = /* #__PURE__ */ createTypedChart("bar", [ - BarController, - BarElement, - CategoryScale, - LinearScale -]) -const BubbleChart = /* #__PURE__ */ createTypedChart("bubble", [ - BubbleController, - PointElement, - LinearScale -]) -const DonutChart = /* #__PURE__ */ createTypedChart("doughnut", [DoughnutController, ArcElement]) +const BarChart = /* #__PURE__ */ createTypedChart("bar", [BarController, BarElement, CategoryScale, LinearScale]); +const BubbleChart = /* #__PURE__ */ createTypedChart("bubble", [BubbleController, PointElement, LinearScale]); +const DonutChart = /* #__PURE__ */ createTypedChart("doughnut", [DoughnutController, ArcElement]); const LineChart = /* #__PURE__ */ createTypedChart("line", [ LineController, LineElement, PointElement, CategoryScale, - LinearScale -]) -const PieChart = /* #__PURE__ */ createTypedChart("pie", [PieController, ArcElement]) + LinearScale, +]); +const PieChart = /* #__PURE__ */ createTypedChart("pie", [PieController, ArcElement]); const PolarAreaChart = /* #__PURE__ */ createTypedChart("polarArea", [ PolarAreaController, ArcElement, - RadialLinearScale -]) + RadialLinearScale, +]); const RadarChart = /* #__PURE__ */ createTypedChart("radar", [ RadarController, LineElement, PointElement, - RadialLinearScale -]) -const ScatterChart = /* #__PURE__ */ createTypedChart("scatter", [ - ScatterController, - PointElement, - LinearScale -]) + RadialLinearScale, +]); +const ScatterChart = /* #__PURE__ */ createTypedChart("scatter", [ScatterController, PointElement, LinearScale]); export { - BaseChart as Chart, BarChart, BubbleChart, + BaseChart as Chart, DonutChart, LineChart, PieChart, PolarAreaChart, RadarChart, - ScatterChart -} + ScatterChart, +}; diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx new file mode 100644 index 0000000..45e8b61 --- /dev/null +++ b/src/components/ui/checkbox.tsx @@ -0,0 +1,59 @@ +import type { ValidComponent } from "solid-js"; +import { Match, splitProps, Switch } from "solid-js"; + +import * as CheckboxPrimitive from "@kobalte/core/checkbox"; +import type { PolymorphicProps } from "@kobalte/core/polymorphic"; + +import { cn } from "~/lib/utils"; + +type CheckboxRootProps = CheckboxPrimitive.CheckboxRootProps & { + class?: string | undefined; +}; + +const Checkbox = (props: PolymorphicProps>) => { + const [local, others] = splitProps(props as CheckboxRootProps, ["class"]); + return ( + + + + + + + + + + + + + + + + + + + + ); +}; + +export { Checkbox }; diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx new file mode 100644 index 0000000..ec430f5 --- /dev/null +++ b/src/components/ui/label.tsx @@ -0,0 +1,19 @@ +import type { Component, ComponentProps } from "solid-js"; +import { splitProps } from "solid-js"; + +import { cn } from "~/lib/utils"; + +const Label: Component> = (props) => { + const [local, others] = splitProps(props, ["class"]); + return ( +