diff --git a/cloud/infrastructure/package.json b/cloud/infrastructure/package.json index e0894eda7c..65476688c2 100644 --- a/cloud/infrastructure/package.json +++ b/cloud/infrastructure/package.json @@ -8,24 +8,24 @@ "restart-functions": "node tools/restart-functions.js" }, "devDependencies": { - "@types/node": "18.18.9", - "@typescript-eslint/eslint-plugin": "6.11.0", - "@typescript-eslint/parser": "6.11.0", + "@types/node": "18.18.11", + "@typescript-eslint/eslint-plugin": "6.12.0", + "@typescript-eslint/parser": "6.12.0", "eslint": "8.54.0", "eslint-config-standard": "17.1.0", "eslint-plugin-import": "2.29.0", "eslint-plugin-n": "16.3.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "6.1.1", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "dependencies": { "@checkly/pulumi": "1.1.4", - "@pulumi/aws": "6.9.0", - "@pulumi/azure-native": "2.18.0", + "@pulumi/aws": "6.10.0", + "@pulumi/azure-native": "2.19.0", "@pulumi/cloudflare": "5.15.0", "@pulumi/command": "0.9.2", - "@pulumi/docker": "4.4.5", + "@pulumi/docker": "4.5.0", "@pulumi/pulumi": "3.94.2" } } diff --git a/cloud/infrastructure/pnpm-lock.yaml b/cloud/infrastructure/pnpm-lock.yaml index bbf1b3b780..32a9993589 100644 --- a/cloud/infrastructure/pnpm-lock.yaml +++ b/cloud/infrastructure/pnpm-lock.yaml @@ -9,11 +9,11 @@ dependencies: specifier: 1.1.4 version: 1.1.4 '@pulumi/aws': - specifier: 6.9.0 - version: 6.9.0 + specifier: 6.10.0 + version: 6.10.0 '@pulumi/azure-native': - specifier: 2.18.0 - version: 2.18.0 + specifier: 2.19.0 + version: 2.19.0 '@pulumi/cloudflare': specifier: 5.15.0 version: 5.15.0 @@ -21,22 +21,22 @@ dependencies: specifier: 0.9.2 version: 0.9.2 '@pulumi/docker': - specifier: 4.4.5 - version: 4.4.5 + specifier: 4.5.0 + version: 4.5.0 '@pulumi/pulumi': specifier: 3.94.2 version: 3.94.2 devDependencies: '@types/node': - specifier: 18.18.9 - version: 18.18.9 + specifier: 18.18.11 + version: 18.18.11 '@typescript-eslint/eslint-plugin': - specifier: 6.11.0 - version: 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) + specifier: 6.12.0 + version: 6.12.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0)(typescript@5.3.2) '@typescript-eslint/parser': - specifier: 6.11.0 - version: 6.11.0(eslint@8.54.0)(typescript@5.2.2) + specifier: 6.12.0 + version: 6.12.0(eslint@8.54.0)(typescript@5.3.2) eslint: specifier: 8.54.0 version: 8.54.0 @@ -45,7 +45,7 @@ devDependencies: version: 17.1.0(eslint-plugin-import@2.29.0)(eslint-plugin-n@16.3.1)(eslint-plugin-promise@6.1.1)(eslint@8.54.0) eslint-plugin-import: specifier: 2.29.0 - version: 2.29.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0) + version: 2.29.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0) eslint-plugin-n: specifier: 16.3.1 version: 16.3.1(eslint@8.54.0) @@ -56,8 +56,8 @@ devDependencies: specifier: 6.1.1 version: 6.1.1(eslint@8.54.0) typescript: - specifier: 5.2.2 - version: 5.2.2 + specifier: 5.3.2 + version: 5.3.2 packages: @@ -117,7 +117,7 @@ packages: engines: {node: ^8.13.0 || >=10.10.0} dependencies: '@grpc/proto-loader': 0.7.10 - '@types/node': 18.18.9 + '@types/node': 18.18.11 dev: false /@grpc/proto-loader@0.7.10: @@ -362,8 +362,8 @@ packages: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: false - /@pulumi/aws@6.9.0: - resolution: {integrity: sha512-c0ivz01YEuZesfroFSQJdjXivyltdvXBW8hcOhGCwAycjmHpDnXI0HSXk9aIkwxVrUBAW0MQYEa+QRHb5W2V1Q==} + /@pulumi/aws@6.10.0: + resolution: {integrity: sha512-dUgI1yIx32COdX7Ql/J07DGrkah+LPt3dwnCRl+45jf4jpcXz1d+5ccmO/zEwgoZP/fAgWW7zzZ9R+8JN+mtfw==} dependencies: '@pulumi/pulumi': 3.94.2 builtin-modules: 3.0.0 @@ -374,8 +374,8 @@ packages: - supports-color dev: false - /@pulumi/azure-native@2.18.0: - resolution: {integrity: sha512-mp6MlTmM1GRj1EXLk5cfwGTZtmAFFjb1taAjs53xHl7YLnW+wLd/Ff0Su+uvloLGUgV2JJIOjdaegQqcR1Aj+w==} + /@pulumi/azure-native@2.19.0: + resolution: {integrity: sha512-WWl9ua2Bmexk3h8Gdv0MOtHdXREbdv+2K4mvG0t1+yfRsB0CviJekE1g+wFs+elmzYEqdKfMg6fQcIS3qp5o1Q==} dependencies: '@pulumi/pulumi': 3.94.2 transitivePeerDependencies: @@ -399,8 +399,8 @@ packages: - supports-color dev: false - /@pulumi/docker@4.4.5: - resolution: {integrity: sha512-Y3q/aI9HQEN3FwgGbTTURFaD+vQLlG5CXiHD4lnlbqt4USU9BhMeYpT6BbwHktFxnNil/8FYr2mX7X4MetQidg==} + /@pulumi/docker@4.5.0: + resolution: {integrity: sha512-DOiczZK1cF4NGlEWzacPLjGcoPKXHXISoqq4KqCO97YW28rZSu6LOdveQ8tLaUHGeyWQ+CS3PT45caSxHAbzbw==} dependencies: '@pulumi/pulumi': 3.94.2 semver: 5.7.2 @@ -453,8 +453,8 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true - /@types/node@18.18.9: - resolution: {integrity: sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==} + /@types/node@18.18.11: + resolution: {integrity: sha512-c1vku6qnTeujJneYH94/4aq73XrVcsJe35UPyAsSok1ijiKrkRzK+AxQPSpNMUnC03roWBBwJx/9I8V7lQoxmA==} dependencies: undici-types: 5.26.5 @@ -462,8 +462,8 @@ packages: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true - /@typescript-eslint/eslint-plugin@6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2): - resolution: {integrity: sha512-uXnpZDc4VRjY4iuypDBKzW1rz9T5YBBK0snMn8MaTSNd2kMlj50LnLBABELjJiOL5YHk7ZD8hbSpI9ubzqYI0w==} + /@typescript-eslint/eslint-plugin@6.12.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-XOpZ3IyJUIV1b15M7HVOpgQxPPF7lGXgsfcEIu3yDxFPaf/xZKt7s9QO/pbk7vpWQyVulpJbu4E5LwpZiQo4kA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -474,25 +474,25 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 6.11.0 - '@typescript-eslint/type-utils': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.11.0 + '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/scope-manager': 6.12.0 + '@typescript-eslint/type-utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/visitor-keys': 6.12.0 debug: 4.3.4 eslint: 8.54.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.2.2) - typescript: 5.2.2 + ts-api-utils: 1.0.1(typescript@5.3.2) + typescript: 5.3.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.11.0(eslint@8.54.0)(typescript@5.2.2): - resolution: {integrity: sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==} + /@typescript-eslint/parser@6.12.0(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -501,27 +501,27 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.11.0 - '@typescript-eslint/types': 6.11.0 - '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.11.0 + '@typescript-eslint/scope-manager': 6.12.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) + '@typescript-eslint/visitor-keys': 6.12.0 debug: 4.3.4 eslint: 8.54.0 - typescript: 5.2.2 + typescript: 5.3.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@6.11.0: - resolution: {integrity: sha512-0A8KoVvIURG4uhxAdjSaxy8RdRE//HztaZdG8KiHLP8WOXSk0vlF7Pvogv+vlJA5Rnjj/wDcFENvDaHb+gKd1A==} + /@typescript-eslint/scope-manager@6.12.0: + resolution: {integrity: sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.11.0 - '@typescript-eslint/visitor-keys': 6.11.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/visitor-keys': 6.12.0 dev: true - /@typescript-eslint/type-utils@6.11.0(eslint@8.54.0)(typescript@5.2.2): - resolution: {integrity: sha512-nA4IOXwZtqBjIoYrJcYxLRO+F9ri+leVGoJcMW1uqr4r1Hq7vW5cyWrA43lFbpRvQ9XgNrnfLpIkO3i1emDBIA==} + /@typescript-eslint/type-utils@6.12.0(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-WWmRXxhm1X8Wlquj+MhsAG4dU/Blvf1xDgGaYCzfvStP2NwPQh6KBvCDbiOEvaE0filhranjIlK/2fSTVwtBng==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -530,23 +530,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.11.0(eslint@8.54.0)(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) + '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.3.2) debug: 4.3.4 eslint: 8.54.0 - ts-api-utils: 1.0.1(typescript@5.2.2) - typescript: 5.2.2 + ts-api-utils: 1.0.1(typescript@5.3.2) + typescript: 5.3.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@6.11.0: - resolution: {integrity: sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==} + /@typescript-eslint/types@6.12.0: + resolution: {integrity: sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.11.0(typescript@5.2.2): - resolution: {integrity: sha512-Aezzv1o2tWJwvZhedzvD5Yv7+Lpu1by/U1LZ5gLc4tCx8jUmuSCMioPFRjliN/6SJIvY6HpTtJIWubKuYYYesQ==} + /@typescript-eslint/typescript-estree@6.12.0(typescript@5.3.2): + resolution: {integrity: sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -554,20 +554,20 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.11.0 - '@typescript-eslint/visitor-keys': 6.11.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/visitor-keys': 6.12.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.2.2) - typescript: 5.2.2 + ts-api-utils: 1.0.1(typescript@5.3.2) + typescript: 5.3.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@6.11.0(eslint@8.54.0)(typescript@5.2.2): - resolution: {integrity: sha512-p23ibf68fxoZy605dc0dQAEoUsoiNoP3MD9WQGiHLDuTSOuqoTsa4oAy+h3KDkTcxbbfOtUjb9h3Ta0gT4ug2g==} + /@typescript-eslint/utils@6.12.0(eslint@8.54.0)(typescript@5.3.2): + resolution: {integrity: sha512-LywPm8h3tGEbgfyjYnu3dauZ0U7R60m+miXgKcZS8c7QALO9uWJdvNoP+duKTk2XMWc7/Q3d/QiCuLN9X6SWyQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -575,9 +575,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.54.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 6.11.0 - '@typescript-eslint/types': 6.11.0 - '@typescript-eslint/typescript-estree': 6.11.0(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.12.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.3.2) eslint: 8.54.0 semver: 7.5.4 transitivePeerDependencies: @@ -585,11 +585,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.11.0: - resolution: {integrity: sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==} + /@typescript-eslint/visitor-keys@6.12.0: + resolution: {integrity: sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.11.0 + '@typescript-eslint/types': 6.12.0 eslint-visitor-keys: 3.4.3 dev: true @@ -994,7 +994,7 @@ packages: eslint-plugin-promise: ^6.0.0 dependencies: eslint: 8.54.0 - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0) eslint-plugin-n: 16.3.1(eslint@8.54.0) eslint-plugin-promise: 6.1.1(eslint@8.54.0) dev: true @@ -1009,7 +1009,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.11.0)(eslint-import-resolver-node@0.3.9)(eslint@8.54.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-node@0.3.9)(eslint@8.54.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -1030,7 +1030,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) debug: 3.2.7 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 @@ -1060,7 +1060,7 @@ packages: regexpp: 3.2.0 dev: true - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0): + /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -1070,7 +1070,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -1079,7 +1079,7 @@ packages: doctrine: 2.1.0 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.11.0)(eslint-import-resolver-node@0.3.9)(eslint@8.54.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.12.0)(eslint-import-resolver-node@0.3.9)(eslint@8.54.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2020,7 +2020,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 18.18.9 + '@types/node': 18.18.11 long: 5.2.3 dev: false @@ -2331,13 +2331,13 @@ packages: is-number: 7.0.0 dev: true - /ts-api-utils@1.0.1(typescript@5.2.2): + /ts-api-utils@1.0.1(typescript@5.3.2): resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.2.2 + typescript: 5.3.2 dev: true /ts-node@7.0.1: @@ -2416,8 +2416,8 @@ packages: hasBin: true dev: false - /typescript@5.2.2: - resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + /typescript@5.3.2: + resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==} engines: {node: '>=14.17'} hasBin: true dev: true diff --git a/cloud/src/Signalco.Api.RemoteBrowser/Signalco.Api.RemoteBrowser.csproj b/cloud/src/Signalco.Api.RemoteBrowser/Signalco.Api.RemoteBrowser.csproj index 0f6003de7c..1a6270fa07 100644 --- a/cloud/src/Signalco.Api.RemoteBrowser/Signalco.Api.RemoteBrowser.csproj +++ b/cloud/src/Signalco.Api.RemoteBrowser/Signalco.Api.RemoteBrowser.csproj @@ -13,7 +13,7 @@ - + diff --git a/cloud/src/Signalco.Infrastructure.Processor.Tests/Signalco.Infrastructure.Processor.Tests.csproj b/cloud/src/Signalco.Infrastructure.Processor.Tests/Signalco.Infrastructure.Processor.Tests.csproj index 08759eb177..92b85f12dc 100644 --- a/cloud/src/Signalco.Infrastructure.Processor.Tests/Signalco.Infrastructure.Processor.Tests.csproj +++ b/cloud/src/Signalco.Infrastructure.Processor.Tests/Signalco.Infrastructure.Processor.Tests.csproj @@ -10,8 +10,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/station/Signal.Beacon.Core.Tests/Signal.Beacon.Core.Tests.csproj b/station/Signal.Beacon.Core.Tests/Signal.Beacon.Core.Tests.csproj index 2cbee23f21..836a897d6b 100644 --- a/station/Signal.Beacon.Core.Tests/Signal.Beacon.Core.Tests.csproj +++ b/station/Signal.Beacon.Core.Tests/Signal.Beacon.Core.Tests.csproj @@ -9,8 +9,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/station/Signal.Beacon.Voice.Tests/Signal.Beacon.Voice.Tests.csproj b/station/Signal.Beacon.Voice.Tests/Signal.Beacon.Voice.Tests.csproj index a3756dca2f..af5449554f 100644 --- a/station/Signal.Beacon.Voice.Tests/Signal.Beacon.Voice.Tests.csproj +++ b/station/Signal.Beacon.Voice.Tests/Signal.Beacon.Voice.Tests.csproj @@ -10,8 +10,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/web/apps/app/.eslintrc.js b/web/apps/app/.eslintrc.cjs similarity index 100% rename from web/apps/app/.eslintrc.js rename to web/apps/app/.eslintrc.cjs diff --git a/web/apps/app/app/LayoutClientWrapper.tsx b/web/apps/app/app/LayoutClientWrapper.tsx index c5087f3451..1340c2ea2a 100644 --- a/web/apps/app/app/LayoutClientWrapper.tsx +++ b/web/apps/app/app/LayoutClientWrapper.tsx @@ -1,20 +1,25 @@ 'use client'; -import { ToastContainer } from 'react-toastify'; import { PropsWithChildren } from 'react'; -import { ThemeProvider } from 'next-themes' +import { ThemeProvider, useTheme } from 'next-themes' +import { NotificationsContainer } from '@signalco/ui-notifications'; import useAppTheme from '../src/hooks/useAppTheme'; function ThemeChangerWrapper({ children }: PropsWithChildren) { + const { resolvedTheme } = useTheme(); useAppTheme(); - return <>{children}; + return ( + <> + + {children} + + ); } export function LayoutClientWrapper({ children }: PropsWithChildren) { return ( - {children} diff --git a/web/apps/app/app/channels/[channelName]/page.tsx b/web/apps/app/app/channels/[channelName]/page.tsx index c3888e538c..cf80080f69 100644 --- a/web/apps/app/app/channels/[channelName]/page.tsx +++ b/web/apps/app/app/channels/[channelName]/page.tsx @@ -2,16 +2,16 @@ import { useMemo } from 'react'; import { Bug, Link as LinkIcon } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { NoDataPlaceholder } from '@signalco/ui/dist/NoDataPlaceholder'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ListItem } from '@signalco/ui/dist/ListItem'; -import { List } from '@signalco/ui/dist/List'; -import { Link } from '@signalco/ui/dist/Link'; -import { Container } from '@signalco/ui/dist/Container'; -import { channelsData } from '@signalco/data'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { NoDataPlaceholder } from '@signalco/ui/NoDataPlaceholder'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List } from '@signalco/ui/List'; +import { Link } from '@signalco/ui/Link'; +import { Container } from '@signalco/ui/Container'; +import { channelsData } from '@signalco/data/data'; import { KnownPages } from '../../../src/knownPages'; import useAllEntities from '../../../src/hooks/signalco/entity/useAllEntities'; import ChannelPartialSlack from '../../../components/channels/partials/ChannelPartialSlack'; diff --git a/web/apps/app/app/entities/[id]/layout.tsx b/web/apps/app/app/entities/[id]/layout.tsx index 543cf83f15..d95c080315 100644 --- a/web/apps/app/app/entities/[id]/layout.tsx +++ b/web/apps/app/app/entities/[id]/layout.tsx @@ -2,13 +2,13 @@ import { type PropsWithChildren } from 'react'; import { ExternalLink } from '@signalco/ui-icons'; -import { Timeago } from '@signalco/ui/dist/Timeago'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { DisableButton } from '@signalco/ui/dist/DisableButton'; -import { Chip } from '@signalco/ui/dist/Chip'; +import { Timeago } from '@signalco/ui/Timeago'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { DisableButton } from '@signalco/ui/DisableButton'; +import { Chip } from '@signalco/ui/Chip'; import { camelToSentenceCase } from '@signalco/js'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import useContact from '../../../src/hooks/signalco/useContact'; import useEntity from '../../../src/hooks/signalco/entity/useEntity'; import { entityLastActivity } from '../../../src/entity/EntityHelper'; diff --git a/web/apps/app/app/entities/page.tsx b/web/apps/app/app/entities/page.tsx index d68243bcba..a0ba9e75c4 100644 --- a/web/apps/app/app/entities/page.tsx +++ b/web/apps/app/app/entities/page.tsx @@ -2,14 +2,14 @@ import React, { useCallback, useMemo, useState } from 'react'; import { useRouter } from 'next/navigation'; -import { cx } from 'classix'; import { Add, Check, LayoutGrid, LayoutList } from '@signalco/ui-icons'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { KnownPages } from '../../src/knownPages'; import useUserSetting from '../../src/hooks/useUserSetting'; import useLocale from '../../src/hooks/useLocale'; diff --git a/web/apps/app/app/global.css b/web/apps/app/app/global.css index e46cf7a22f..3bbba127d2 100644 --- a/web/apps/app/app/global.css +++ b/web/apps/app/app/global.css @@ -1,8 +1,4 @@ -@import '@signalco/ui/dist/index.css'; -@import 'react-toastify/dist/ReactToastify.css'; - -@tailwind components; -@tailwind utilities; +@import '@signalco/ui/index.css'; @font-face { font-family: 'Material Icons'; @@ -39,29 +35,6 @@ } :root { - --toastify-font-family: var(--font-sans); - --toastify-color-dark: #fff; - --toastify-color-progress-dark: #000; - --toastify-text-color-dark: #333; - --graph-stroke: #999; - - --bg-selection: #000; - --text-selection: #fff; -} - -.dark { - --toastify-color-progress-dark: #fff; - --bg-selection: #fff; - --text-selection: #000; } -::selection { background: var(--bg-selection); color: var(--text-selection); } - -.image--light { - display: var(--light-display); -} - -.image--dark { - display: var(--dark-display); -} diff --git a/web/apps/app/app/login-return/page.tsx b/web/apps/app/app/login-return/page.tsx index b0775eb5c6..2575762318 100644 --- a/web/apps/app/app/login-return/page.tsx +++ b/web/apps/app/app/login-return/page.tsx @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { useRouter } from 'next/navigation'; -import { useIsServer } from '@signalco/hooks/dist/useIsServer'; +import { useIsServer } from '@signalco/hooks/useIsServer'; import { useAuth0 } from '@auth0/auth0-react'; import Login from '../../components/Login'; diff --git a/web/apps/app/app/logout/page.tsx b/web/apps/app/app/logout/page.tsx index 34659f8bcb..4a7c635d54 100644 --- a/web/apps/app/app/logout/page.tsx +++ b/web/apps/app/app/logout/page.tsx @@ -1,8 +1,8 @@ 'use client'; import { useEffect } from 'react'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Loadable } from '@signalco/ui/dist/Loadable'; +import { Stack } from '@signalco/ui/Stack'; +import { Loadable } from '@signalco/ui/Loadable'; import { useAuth0 } from '@auth0/auth0-react'; export default function AppLogoutPage() { diff --git a/web/apps/app/app/settings/page.tsx b/web/apps/app/app/settings/page.tsx index bc7393bd86..38e6970457 100644 --- a/web/apps/app/app/settings/page.tsx +++ b/web/apps/app/app/settings/page.tsx @@ -4,14 +4,14 @@ import { ResponsiveContainer } from 'recharts'; import React, { ComponentProps, ReactNode, useEffect, useState } from 'react'; import dynamic from 'next/dynamic'; import { getTimeZones } from '@vvo/tzdb'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { FilterList } from '@signalco/ui/dist/FilterList'; -import { Divider } from '@signalco/ui/dist/Divider'; -import { Container } from '@signalco/ui/dist/Container'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { FilterList } from '@signalco/ui/FilterList'; +import { Divider } from '@signalco/ui/Divider'; +import { Container } from '@signalco/ui/Container'; import { arraySum, humanizeNumber, objectWithKey } from '@signalco/js'; import { isNonEmptyString, isNotNull, noError } from '@enterwell/react-form-validation'; import { FormBuilderComponent, FormBuilderComponents } from '@enterwell/react-form-builder/lib/FormBuilderProvider/FormBuilderProvider.types'; @@ -133,7 +133,7 @@ function LabeledValue({ value, unit, label }: { value: string | number, unit?: s ) } -function sumUsage(u: Partial) { +function sumUsage(u: Partial | undefined) { return u ? (u.other ?? 0) + (u.contactSet ?? 0) + (u.conduct ?? 0) + (u.process ?? 0) : 0; } @@ -189,7 +189,7 @@ function UsageCurrent() { return ( - + @@ -263,22 +263,22 @@ function SettingsPane() { { id: 'developer', label: 'Developer', form: developerForm }, ]; - const [selectedCategoryId, setSelectedCategoryId] = useState(categories[0].id); + const [selectedCategoryId, setSelectedCategoryId] = useState(categories[0]?.id); const selectedCategory = categories.find(c => c.id === selectedCategoryId) ?? categories[0]; return (
- + - {selectedCategory.label} + {selectedCategory?.label}
- {selectedCategory.form && ( + {selectedCategory?.form && ( )} - {selectedCategory.component && } + {selectedCategory?.component && }
diff --git a/web/apps/app/components/Login.tsx b/web/apps/app/components/Login.tsx index c4968c6542..fdde858094 100644 --- a/web/apps/app/components/Login.tsx +++ b/web/apps/app/components/Login.tsx @@ -1,11 +1,11 @@ 'use client'; import React, { useState } from 'react'; -import { cx } from 'classix'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Button } from '@signalco/ui/dist/Button'; -import { useTimeout } from '@signalco/hooks/dist/useTimeout'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { cx } from '@signalco/ui/cx'; +import { Button } from '@signalco/ui/Button'; +import { useTimeout } from '@signalco/hooks/useTimeout'; export default function Login() { const [isLong, setIsLong] = useState(false); diff --git a/web/apps/app/components/channels/ChannelGalleryItem.tsx b/web/apps/app/components/channels/ChannelGalleryItem.tsx index 7f1607c1db..43dafe4552 100644 --- a/web/apps/app/components/channels/ChannelGalleryItem.tsx +++ b/web/apps/app/components/channels/ChannelGalleryItem.tsx @@ -1,8 +1,8 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import type { ColorPaletteProp } from '@signalco/ui/dist/theme'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Chip } from '@signalco/ui/dist/Chip'; -import { Card } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import type { ColorPaletteProp } from '@signalco/ui/theme'; +import { Stack } from '@signalco/ui/Stack'; +import { Chip } from '@signalco/ui/Chip'; +import { Card } from '@signalco/ui/Card'; import ChannelLogo from './ChannelLogo'; type ChannelGalleryItemProps = { diff --git a/web/apps/app/components/channels/ChannelLogo.tsx b/web/apps/app/components/channels/ChannelLogo.tsx index 7f2a50193c..2f6355e7fe 100644 --- a/web/apps/app/components/channels/ChannelLogo.tsx +++ b/web/apps/app/components/channels/ChannelLogo.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import Image from 'next/image'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; +import { Tooltip } from '@signalco/ui/Tooltip'; export type ChannelLogoProps = { channelName: string; diff --git a/web/apps/app/components/channels/ChannelsGallery.tsx b/web/apps/app/components/channels/ChannelsGallery.tsx index 0e723013fa..51094f9a49 100644 --- a/web/apps/app/components/channels/ChannelsGallery.tsx +++ b/web/apps/app/components/channels/ChannelsGallery.tsx @@ -1,10 +1,10 @@ 'use client'; -import {Gallery} from '@signalco/ui/dist/Gallery'; -import { FilterList } from '@signalco/ui/dist/FilterList'; +import {Gallery} from '@signalco/ui/Gallery'; +import { FilterList } from '@signalco/ui/FilterList'; import { orderBy } from '@signalco/js'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; -import { channelsData, channelCategories } from '@signalco/data'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; +import { channelsData, channelCategories } from '@signalco/data/data'; import ChannelGalleryItem from './ChannelGalleryItem'; export default function ChannelsGallery(props: { channelHrefFunc: (id: string) => string }) { diff --git a/web/apps/app/components/channels/partials/ChannelPartialSlack.tsx b/web/apps/app/components/channels/partials/ChannelPartialSlack.tsx index 67ee40e3bb..845b180138 100644 --- a/web/apps/app/components/channels/partials/ChannelPartialSlack.tsx +++ b/web/apps/app/components/channels/partials/ChannelPartialSlack.tsx @@ -1,6 +1,6 @@ import { useRouter } from 'next/navigation'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; import { objectWithKey } from '@signalco/js'; import OAuthRedirectConnectButton from '../../oauth/OAuthRedirectConnectButton'; import { requestAsync } from '../../../src/services/HttpService'; diff --git a/web/apps/app/components/dashboards/DashboardSelector.tsx b/web/apps/app/components/dashboards/DashboardSelector.tsx index 208bb8dde0..5949cfa7fd 100644 --- a/web/apps/app/components/dashboards/DashboardSelector.tsx +++ b/web/apps/app/components/dashboards/DashboardSelector.tsx @@ -1,12 +1,12 @@ 'use client'; import { useEffect, useState } from 'react'; -import { Row } from '@signalco/ui/dist/Row'; -import { Popper } from '@signalco/ui/dist/Popper'; -import { ButtonDropdown } from '@signalco/ui/dist/ButtonDropdown'; -import { Button } from '@signalco/ui/dist/Button'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; -import { showNotification } from '../../src/notifications/PageNotificationService'; +import { showNotification } from '@signalco/ui-notifications'; +import { Row } from '@signalco/ui/Row'; +import { Popper } from '@signalco/ui/Popper'; +import { ButtonDropdown } from '@signalco/ui/ButtonDropdown'; +import { Button } from '@signalco/ui/Button'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import useDashboards from '../../src/hooks/dashboards/useDashboards'; import DashboardSelectorMenu from './DashboardSelectorMenu'; @@ -34,8 +34,8 @@ function DashboardSelector({ onEditWidgets, onSettings }: DashboardSelectorProps // Set initial selection on component and dashboards load useEffect(() => { if (!selectedId && dashboards?.length && !isLoading) { - console.debug('Selecting first available dashboard', dashboards[0].id); - setSelectedId(dashboards[0].id); + console.debug('Selecting first available dashboard', dashboards[0]?.id); + setSelectedId(dashboards[0]?.id); } }, [selectedId, dashboards, setSelectedId, isLoading]); diff --git a/web/apps/app/components/dashboards/DashboardSelectorMenu.tsx b/web/apps/app/components/dashboards/DashboardSelectorMenu.tsx index ede3effd7e..6dcfacbcdb 100644 --- a/web/apps/app/components/dashboards/DashboardSelectorMenu.tsx +++ b/web/apps/app/components/dashboards/DashboardSelectorMenu.tsx @@ -1,15 +1,15 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */ import React from 'react'; -import { cx } from 'classix'; import { Add, Pin, PinOff } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Divider } from '@signalco/ui/dist/Divider'; -import { Button } from '@signalco/ui/dist/Button'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Divider } from '@signalco/ui/Divider'; +import { cx } from '@signalco/ui/cx'; +import { Button } from '@signalco/ui/Button'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { CSS } from '@dnd-kit/utilities'; import { SortableContext, arrayMove, sortableKeyboardCoordinates, useSortable } from '@dnd-kit/sortable'; import { DndContext, DragEndEvent, KeyboardSensor, MouseSensor, TouchSensor, useSensor, useSensors } from '@dnd-kit/core'; @@ -108,7 +108,10 @@ function DashboardSelectorMenu(props: IDashboardSelectorMenuProps) { const newIndex = orderedDashboardIds.indexOf(over.id.toString()); const newOrderedDashboards = arrayMove(orderedDashboards, oldIndex, newIndex); for (let i = 0; i < newOrderedDashboards.length; i++) { - newOrderedDashboards[i].order = i; + const item = newOrderedDashboards[i]; + if (item) { + item.order = i; + } } await DashboardsRepository.dashboardsOrderSetAsync(newOrderedDashboards.map(d => d.id)); diff --git a/web/apps/app/components/dashboards/DashboardSettings.tsx b/web/apps/app/components/dashboards/DashboardSettings.tsx index e5e5c09a84..1e407dd505 100644 --- a/web/apps/app/components/dashboards/DashboardSettings.tsx +++ b/web/apps/app/components/dashboards/DashboardSettings.tsx @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Input } from '@signalco/ui/dist/Input'; -import { Button } from '@signalco/ui/dist/Button'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Input } from '@signalco/ui/Input'; +import { Button } from '@signalco/ui/Button'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import ConfirmDeleteButton from '../shared/dialog/ConfirmDeleteButton'; import ConfigurationDialog from '../shared/dialog/ConfigurationDialog'; import useLocale from '../../src/hooks/useLocale'; diff --git a/web/apps/app/components/dashboards/DashboardView.tsx b/web/apps/app/components/dashboards/DashboardView.tsx index 4c6ed84e34..3dadca1069 100644 --- a/web/apps/app/components/dashboards/DashboardView.tsx +++ b/web/apps/app/components/dashboards/DashboardView.tsx @@ -2,10 +2,10 @@ import { useState, useMemo, CSSProperties } from 'react'; import Image from 'next/image'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Button } from '@signalco/ui/Button'; import { useResizeObserver } from '@enterwell/react-hooks'; import useLocale from '../../src/hooks/useLocale'; import { IDashboardModel } from '../../src/dashboards/DashboardsRepository'; diff --git a/web/apps/app/components/dashboards/Dashboards.tsx b/web/apps/app/components/dashboards/Dashboards.tsx index b8a3a35ce8..ee57f9d979 100644 --- a/web/apps/app/components/dashboards/Dashboards.tsx +++ b/web/apps/app/components/dashboards/Dashboards.tsx @@ -3,15 +3,15 @@ import React, { useCallback, useEffect, useState } from 'react'; import Image from 'next/image'; import dynamic from 'next/dynamic'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { Button } from '@signalco/ui/dist/Button'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { showNotification } from '@signalco/ui-notifications'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { Button } from '@signalco/ui/Button'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { widgetType } from '../widgets/Widget'; import ConfigurationDialog from '../shared/dialog/ConfigurationDialog'; -import { showNotification } from '../../src/notifications/PageNotificationService'; import useLocale from '../../src/hooks/useLocale'; import useSaveDashboard from '../../src/hooks/dashboards/useSaveDashboard'; import useDashboard from '../../src/hooks/dashboards/useDashboard'; diff --git a/web/apps/app/components/development/ApiBadge.tsx b/web/apps/app/components/development/ApiBadge.tsx index 1f45fbdb64..add3eaa92a 100644 --- a/web/apps/app/components/development/ApiBadge.tsx +++ b/web/apps/app/components/development/ApiBadge.tsx @@ -1,5 +1,5 @@ -import { Chip } from '@signalco/ui/dist/Chip'; -import { useIsServer } from '@signalco/hooks/dist/useIsServer'; +import { Chip } from '@signalco/ui/Chip'; +import { useIsServer } from '@signalco/hooks/useIsServer'; import { isDeveloper } from '../../src/services/EnvProvider'; import { signalcoApiEndpointIsProduction } from '../../src/services/AppSettingsProvider'; diff --git a/web/apps/app/components/entity/EntityCard.tsx b/web/apps/app/components/entity/EntityCard.tsx index c8c9d706a7..9c2ebf6e5b 100644 --- a/web/apps/app/components/entity/EntityCard.tsx +++ b/web/apps/app/components/entity/EntityCard.tsx @@ -1,13 +1,13 @@ import { type FormEvent } from 'react'; import Link from 'next/link'; -import { cx } from 'classix'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Timeago } from '@signalco/ui/dist/Timeago'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Checkbox } from '@signalco/ui/dist/Checkbox'; -import { Card } from '@signalco/ui/dist/Card'; -import { Avatar } from '@signalco/ui/dist/Avatar'; +import { Typography } from '@signalco/ui/Typography'; +import { Timeago } from '@signalco/ui/Timeago'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { cx } from '@signalco/ui/cx'; +import { Checkbox } from '@signalco/ui/Checkbox'; +import { Card } from '@signalco/ui/Card'; +import { Avatar } from '@signalco/ui/Avatar'; import EntityIcon from '../shared/entity/EntityIcon'; import BatteryIndicator from '../indicators/BatteryIndicator'; import { KnownPages } from '../../src/knownPages'; @@ -28,7 +28,6 @@ export interface EntityCardProps { export default function EntityCard({ entity, spread, selectable, selected, onSelection }: EntityCardProps) { const { hasStatus, isOffline, isStale } = useEntityStatus(entity); const { hasBattery, level } = useEntityBattery(entity); - const Icon = EntityIcon(entity); const Container = spread ? Row : Stack; @@ -43,7 +42,7 @@ export default function EntityCard({ entity, spread, selectable, selected, onSel className="h-full"> - + {entity.alias} diff --git a/web/apps/app/components/entity/EntityStatus.tsx b/web/apps/app/components/entity/EntityStatus.tsx index 9b05be18d8..d8598af730 100644 --- a/web/apps/app/components/entity/EntityStatus.tsx +++ b/web/apps/app/components/entity/EntityStatus.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react'; import { Lightning } from '@signalco/ui-icons'; -import { DotIndicator } from '@signalco/ui/dist/DotIndicator'; +import { DotIndicator } from '@signalco/ui/DotIndicator'; import { now } from '../../src/services/DateTimeProvider'; import IEntityDetails from '../../src/entity/IEntityDetails'; import { entityInError, entityHasOffline, entityLastActivity } from '../../src/entity/EntityHelper'; diff --git a/web/apps/app/components/entity/ShareEntityChip.tsx b/web/apps/app/components/entity/ShareEntityChip.tsx index c4760cc00c..ddb7ebc9f5 100644 --- a/web/apps/app/components/entity/ShareEntityChip.tsx +++ b/web/apps/app/components/entity/ShareEntityChip.tsx @@ -1,14 +1,14 @@ import { useState } from 'react'; import { Clear, People, Send, Share } from '@signalco/ui-icons'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { ListItem } from '@signalco/ui/dist/ListItem'; -import { List } from '@signalco/ui/dist/List'; -import { Input } from '@signalco/ui/dist/Input'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { GentleSlide } from '@signalco/ui/dist/GentleSlide'; -import { Chip } from '@signalco/ui/dist/Chip'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List } from '@signalco/ui/List'; +import { Input } from '@signalco/ui/Input'; +import { IconButton } from '@signalco/ui/IconButton'; +import { GentleSlide } from '@signalco/ui/GentleSlide'; +import { Chip } from '@signalco/ui/Chip'; import ConfigurationDialog from '../shared/dialog/ConfigurationDialog'; import IUser from '../../src/users/IUser'; import { requestAsync } from '../../src/services/HttpService'; diff --git a/web/apps/app/components/forms/LocationMapPicker/LocationMapPicker.tsx b/web/apps/app/components/forms/LocationMapPicker/LocationMapPicker.tsx index 8ea7004d20..d437132756 100644 --- a/web/apps/app/components/forms/LocationMapPicker/LocationMapPicker.tsx +++ b/web/apps/app/components/forms/LocationMapPicker/LocationMapPicker.tsx @@ -1,17 +1,17 @@ import React, { useCallback, useState } from 'react'; import { Draggable, Map, Marker } from 'pigeon-maps'; +import { showNotification } from '@signalco/ui-notifications'; import { MyLocation } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { Input } from '@signalco/ui/dist/Input'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Accordion } from '@signalco/ui/dist/Accordion'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { Input } from '@signalco/ui/Input'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Accordion } from '@signalco/ui/Accordion'; import { asArray, objectWithKey } from '@signalco/js'; import { usePromise } from '@enterwell/react-hooks'; import { FieldConfig } from '@enterwell/react-form-builder/lib/index.types'; -import { showNotification } from '../../../src/notifications/PageNotificationService'; import useUserTheme from '../../../src/hooks/useUserTheme'; const mapBoxAccessToken = process.env.NEXT_PUBLIC_MAPBOX_TOKEN; diff --git a/web/apps/app/components/forms/generalFormComponents.tsx b/web/apps/app/components/forms/generalFormComponents.tsx index cf76cef5ab..937b88eaa1 100644 --- a/web/apps/app/components/forms/generalFormComponents.tsx +++ b/web/apps/app/components/forms/generalFormComponents.tsx @@ -1,5 +1,5 @@ -import { Input } from '@signalco/ui/dist/Input'; -import { Checkbox } from '@signalco/ui/dist/Checkbox'; +import { Input } from '@signalco/ui/Input'; +import { Checkbox } from '@signalco/ui/Checkbox'; import { FormBuilderComponents } from '@enterwell/react-form-builder/lib/FormBuilderProvider/FormBuilderProvider.types'; const components: FormBuilderComponents = { diff --git a/web/apps/app/components/graphs/Graph.tsx b/web/apps/app/components/graphs/Graph.tsx index 45246ec9db..d6873fb89f 100644 --- a/web/apps/app/components/graphs/Graph.tsx +++ b/web/apps/app/components/graphs/Graph.tsx @@ -2,13 +2,13 @@ import { TooltipProps } from 'recharts/types/component/Tooltip'; import { Area, Bar, BarChart, CartesianGrid, ComposedChart, LabelList, LabelProps, Legend, Line, ReferenceLine, Tooltip, XAxis, YAxis } from 'recharts'; import { type SVGProps } from 'react'; import { ScaleTime, scaleTime, timeHour } from 'd3'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Timeago } from '@signalco/ui/dist/Timeago'; -import { Row } from '@signalco/ui/dist/Row'; -import { NoDataPlaceholder } from '@signalco/ui/dist/NoDataPlaceholder'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { lightBlue, deepOrange, green, amber, zinc } from '@signalco/ui/dist/colors'; -import { Card } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import { Timeago } from '@signalco/ui/Timeago'; +import { Row } from '@signalco/ui/Row'; +import { NoDataPlaceholder } from '@signalco/ui/NoDataPlaceholder'; +import { Loadable } from '@signalco/ui/Loadable'; +import { lightBlue, deepOrange, green, amber, zinc } from '@signalco/ui/colors'; +import { Card } from '@signalco/ui/Card'; import { camelToSentenceCase, ObjectDictAny } from '@signalco/js'; import { now } from '../../src/services/DateTimeProvider'; import { useLocalePlaceholders } from '../../src/hooks/useLocale'; @@ -83,15 +83,15 @@ function GraphTimeLine({ data, durationMs, width, startDateTime, hideLegend }: I const transformedDataItem: ObjectDictAny = {}; // From start of graph to first entry - transformedDataItem['t0'] = domainGraph(new Date(firstEntry.id).getTime()) - domainGraph(past.getTime()); - transformedDataItem['v0'] = firstEntry.value === 'true' ? 'false' : 'true'; + transformedDataItem['t0'] = domainGraph(new Date(firstEntry?.id ?? 0).getTime()) - domainGraph(past.getTime()); + transformedDataItem['v0'] = firstEntry?.value === 'true' ? 'false' : 'true'; // From first entry to last entry for (let i = 1; i < reversedData.length; i++) { const currentElement = reversedData[i]; const previousElement = reversedData[i - 1]; - transformedDataItem[`t${i}`] = domainGraph(new Date(currentElement.id).getTime()) - domainGraph(new Date(previousElement.id).getTime()); - transformedDataItem[`v${i}`] = previousElement.value; + transformedDataItem[`t${i}`] = domainGraph(new Date(currentElement?.id ?? 0).getTime()) - domainGraph(new Date(previousElement?.id ?? 0).getTime()); + transformedDataItem[`v${i}`] = previousElement?.value; } // Period from last state change until present @@ -149,10 +149,10 @@ function ChartGenericTooltip({ }: TooltipProps & { domain: ScaleTime, units?: string }) { if (active && payload && payload.length) { - const dateTime = domain.invert(payload[0].payload.key) as Date; + const dateTime = domain.invert(payload[0]?.payload.key) as Date; return ( - {`${payload[0].value}${units || ''}`} + {`${payload[0]?.value}${units || ''}`} {`${dateTime.getFullYear()}-${dateTime.getMonth().toString().padStart(2, '0')}-${dateTime.getDate().toString().padStart(2, '0')} ${dateTime.getHours().toString().padStart(2, '0')}:${dateTime.getMinutes().toString().padStart(2, '0')}`} @@ -256,7 +256,7 @@ const graphColorWheel = [ function GraphBar({ data, limits, aggregate, width, height }: InnerGraphProps) { const barKeys = (data?.length ?? 0) > 0 - ? (typeof data[0].value === 'object' ? Object.keys(data[0].value) : ['value']) + ? (typeof data[0]?.value === 'object' ? Object.keys(data[0].value) : ['value']) : []; const graphData = data.map(d => typeof d.value === 'object' ? ({ id: d.id, ...d.value }) : d); @@ -264,10 +264,19 @@ function GraphBar({ data, limits, aggregate, width, height }: InnerGraphProps) { const usagesAggregated = []; if (aggregate) { for (let usageIndex = 0; usageIndex < graphData.length; usageIndex++) { - const currentPoint: ObjectDictAny = graphData[usageIndex]; + const curr = graphData[usageIndex]; + if (!curr) { + continue; + } + const currentPoint: ObjectDictAny = curr; + const previousPoint = usageIndex > 0 ? usagesAggregated[usageIndex - 1] : {}; + if (!previousPoint) { + continue; + } + const aggregatedPoint: ObjectDictAny = { id: currentPoint.id }; diff --git a/web/apps/app/components/icons/FanVisual.tsx b/web/apps/app/components/icons/FanVisual.tsx index 465f8029d8..730425087b 100644 --- a/web/apps/app/components/icons/FanVisual.tsx +++ b/web/apps/app/components/icons/FanVisual.tsx @@ -1,4 +1,4 @@ -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; export default function FanVisual(props: { state: boolean, size: number }) { const isActive = props.state; diff --git a/web/apps/app/components/icons/SignalcoLogotype.tsx b/web/apps/app/components/icons/SignalcoLogotype.tsx index 5f09314cdc..08bf689125 100644 --- a/web/apps/app/components/icons/SignalcoLogotype.tsx +++ b/web/apps/app/components/icons/SignalcoLogotype.tsx @@ -1,6 +1,6 @@ import React, { CSSProperties, forwardRef } from 'react'; -import { cx } from 'classix'; -import type { SupportedColorScheme } from '@signalco/ui/dist/theme'; +import type { SupportedColorScheme } from '@signalco/ui/theme'; +import { cx } from '@signalco/ui/cx'; import ApiBadge from '../development/ApiBadge'; import { isDeveloper } from '../../src/services/EnvProvider'; diff --git a/web/apps/app/components/icons/WindowVisual.tsx b/web/apps/app/components/icons/WindowVisual.tsx index 103ce5bb01..76117e62b6 100644 --- a/web/apps/app/components/icons/WindowVisual.tsx +++ b/web/apps/app/components/icons/WindowVisual.tsx @@ -1,6 +1,6 @@ /* eslint-disable tailwindcss/no-custom-classname */ import { useState } from 'react'; -import { useInterval } from '@signalco/hooks/dist/useInterval'; +import { useInterval } from '@signalco/hooks/useInterval'; import { now } from '../../src/services/DateTimeProvider'; import { colorToRgb } from '../../src/helpers/StringHelpers'; import styles from './WindowVisual.module.scss'; @@ -41,8 +41,9 @@ function WindowVisual(props: { shadePerc: number, size: number, dateAndTime?: Da const perc = Math.max(0, Math.min(props.shadePerc || 0, 1)); const gradData = skySunnyGrads[hours]; - const cssSkyGradStops = gradData.map((stop, index) => ) - const castColor = colorToRgb(gradData[gradData.length - 1].color); + const cssSkyGradStops = gradData?.map((stop, index) => ) + const grdientLastColor = gradData?.at(-1)?.color; + const castColor = grdientLastColor ? colorToRgb(grdientLastColor) : undefined; const castR = (castColor?.r || 0) / 255; const castG = (castColor?.g || 0) / 255; const castB = (castColor?.b || 0) / 255; diff --git a/web/apps/app/components/indicators/BatteryIndicator.tsx b/web/apps/app/components/indicators/BatteryIndicator.tsx index 2737d5e236..60ed5471bb 100644 --- a/web/apps/app/components/indicators/BatteryIndicator.tsx +++ b/web/apps/app/components/indicators/BatteryIndicator.tsx @@ -1,6 +1,6 @@ -import { cx } from 'classix'; import { BatteryEmpty, BatteryLow, BatteryMedium, BatteryFull } from '@signalco/ui-icons'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { cx } from '@signalco/ui/cx'; type BatteryIndicatorProps = { level: number | undefined; diff --git a/web/apps/app/components/layouts/AppLayout.tsx b/web/apps/app/components/layouts/AppLayout.tsx index 75ef4fbc69..9eefcaffab 100644 --- a/web/apps/app/components/layouts/AppLayout.tsx +++ b/web/apps/app/components/layouts/AppLayout.tsx @@ -1,12 +1,12 @@ 'use client'; import React from 'react'; -import { cx } from 'classix'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { Minimize } from '@signalco/ui-icons'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Stack } from '@signalco/ui/Stack'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { PageTitle } from '../navigation/PageTitle'; import NavProfile from '../navigation/NavProfile'; import { AuthWrapper } from './AuthWrapper'; diff --git a/web/apps/app/components/logging/LogViewer.tsx b/web/apps/app/components/logging/LogViewer.tsx index f5313595df..63edaaf9ab 100644 --- a/web/apps/app/components/logging/LogViewer.tsx +++ b/web/apps/app/components/logging/LogViewer.tsx @@ -28,12 +28,12 @@ const logLineRegex = new RegExp(/\[(.*)\]\s\((\w+)\)\s(.*)/); export function LogViewerLine(props: ILogViewerLineProps) { const { number, data, lineHeight } = props; const matches = logLineRegex.exec(data); - const timeStamp = matches ? new Date(matches[1]) : new Date(0); + const timeStamp = matches ? new Date(matches[1] ?? 0) : new Date(0); return (
{number} {matches && {timeStamp.getUTCHours().toString().padStart(2, '0')}:{timeStamp.getUTCMinutes().toString().padStart(2, '0')}:{timeStamp.getUTCSeconds().toString().padStart(2, '0')}.{timeStamp.getMilliseconds().toString().padEnd(3, '0')}} - {matches && } + {matches && }
{matches ? matches[3] : data}
) diff --git a/web/apps/app/components/navigation/EntitiesTitle.tsx b/web/apps/app/components/navigation/EntitiesTitle.tsx index 9e995d7286..7498e1c47d 100644 --- a/web/apps/app/components/navigation/EntitiesTitle.tsx +++ b/web/apps/app/components/navigation/EntitiesTitle.tsx @@ -1,5 +1,5 @@ -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { EntityIconByType } from '../shared/entity/EntityIcon'; const entityTypes = [ @@ -22,7 +22,7 @@ export function EntitiesTitle() { items={entityTypes.map(t => { const Icon = EntityIconByType(parseInt(t.value)); return ({ - value: t.value, label: t.label, icon: + value: t.value, label: t.label, icon: typeof Icon === 'function' ? : Icon }); })} /> ); diff --git a/web/apps/app/components/navigation/FloatingNavContainer.tsx b/web/apps/app/components/navigation/FloatingNavContainer.tsx index f468564e0d..0b3ad1b6cc 100644 --- a/web/apps/app/components/navigation/FloatingNavContainer.tsx +++ b/web/apps/app/components/navigation/FloatingNavContainer.tsx @@ -1,5 +1,5 @@ import { PropsWithChildren } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; export function FloatingNavContainer({ children }: PropsWithChildren) { return ( diff --git a/web/apps/app/components/navigation/MobileMenu.tsx b/web/apps/app/components/navigation/MobileMenu.tsx index 1bbdf0d4c6..3c12b25489 100644 --- a/web/apps/app/components/navigation/MobileMenu.tsx +++ b/web/apps/app/components/navigation/MobileMenu.tsx @@ -1,10 +1,10 @@ 'use client'; import Link from 'next/link'; -import { cx } from 'classix'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Button } from '@signalco/ui/dist/Button'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { cx } from '@signalco/ui/cx'; +import { Button } from '@signalco/ui/Button'; import useLocale from '../../src/hooks/useLocale'; import { NavItem } from './NavProfile'; diff --git a/web/apps/app/components/navigation/NavLink.tsx b/web/apps/app/components/navigation/NavLink.tsx index 2d6dcc1ce8..61a87be948 100644 --- a/web/apps/app/components/navigation/NavLink.tsx +++ b/web/apps/app/components/navigation/NavLink.tsx @@ -1,9 +1,9 @@ 'use client'; import Link from 'next/link'; -import { cx } from 'classix'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { IconButton } from '@signalco/ui/dist/IconButton'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; import styles from './NavLink.module.scss'; export type NavLinkProps = { diff --git a/web/apps/app/components/navigation/NavProfile.tsx b/web/apps/app/components/navigation/NavProfile.tsx index dd4f2b8309..3e05c44d5a 100644 --- a/web/apps/app/components/navigation/NavProfile.tsx +++ b/web/apps/app/components/navigation/NavProfile.tsx @@ -2,8 +2,8 @@ import React, { Suspense, useState } from 'react'; import { Channel, Close, Dashboard, Device, Menu as MenuIcon, Settings } from '@signalco/ui-icons'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { IconButton } from '@signalco/ui/dist/IconButton'; +import { Stack } from '@signalco/ui/Stack'; +import { IconButton } from '@signalco/ui/IconButton'; import { UserProfileAvatar } from '../users/UserProfileAvatar'; import { KnownPages } from '../../src/knownPages'; import useLocale from '../../src/hooks/useLocale'; diff --git a/web/apps/app/components/navigation/PageTitle.tsx b/web/apps/app/components/navigation/PageTitle.tsx index ac2fbe1b9d..498fac5f6f 100644 --- a/web/apps/app/components/navigation/PageTitle.tsx +++ b/web/apps/app/components/navigation/PageTitle.tsx @@ -2,9 +2,9 @@ import React, { Suspense } from 'react'; import { usePathname } from 'next/navigation'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Row } from '@signalco/ui/dist/Row'; -import { Avatar } from '@signalco/ui/dist/Avatar'; +import { Typography } from '@signalco/ui/Typography'; +import { Row } from '@signalco/ui/Row'; +import { Avatar } from '@signalco/ui/Avatar'; import { KnownPages } from '../../src/knownPages'; import { useActiveNavItem } from './useActiveNavItem'; import { SpaceTitle } from './SpaceTitle'; diff --git a/web/apps/app/components/navigation/SpaceTitle.tsx b/web/apps/app/components/navigation/SpaceTitle.tsx index 3f43387dcb..5b253da9d9 100644 --- a/web/apps/app/components/navigation/SpaceTitle.tsx +++ b/web/apps/app/components/navigation/SpaceTitle.tsx @@ -1,8 +1,8 @@ 'use client'; import React from 'react'; -import { Row } from '@signalco/ui/dist/Row'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Row } from '@signalco/ui/Row'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import DashboardSelector from '../dashboards/DashboardSelector'; export function SpaceTitle() { diff --git a/web/apps/app/components/oauth/OAuthRedirectConnectButton.tsx b/web/apps/app/components/oauth/OAuthRedirectConnectButton.tsx index a5b2a724e7..2e46612711 100644 --- a/web/apps/app/components/oauth/OAuthRedirectConnectButton.tsx +++ b/web/apps/app/components/oauth/OAuthRedirectConnectButton.tsx @@ -1,6 +1,6 @@ import { Suspense, useEffect, useState } from 'react'; -import { Button } from '@signalco/ui/dist/Button'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Button } from '@signalco/ui/Button'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; type OAuthRedirectConnectButtonProps = { label: string; diff --git a/web/apps/app/components/settings/AppThemePicker.tsx b/web/apps/app/components/settings/AppThemePicker.tsx index 3ed311d3e1..6e2d7762d7 100644 --- a/web/apps/app/components/settings/AppThemePicker.tsx +++ b/web/apps/app/components/settings/AppThemePicker.tsx @@ -1,12 +1,12 @@ import { Suspense, useState } from 'react'; -import { cx } from 'classix'; import { Custom, Laptop, SunMoon, Timer } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import type { AppThemeMode, DefaultColorScheme, SupportedColorScheme } from '@signalco/ui/dist/theme'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { Input } from '@signalco/ui/dist/Input'; +import { Typography } from '@signalco/ui/Typography'; +import type { AppThemeMode, DefaultColorScheme, SupportedColorScheme } from '@signalco/ui/theme'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { Input } from '@signalco/ui/Input'; +import { cx } from '@signalco/ui/cx'; import { fromDuration, now, todayAt, toDuration } from '../../src/services/DateTimeProvider'; import useUserSetting from '../../src/hooks/useUserSetting'; import useLocale from '../../src/hooks/useLocale'; diff --git a/web/apps/app/components/shared/dialog/ConfigurationDialog.tsx b/web/apps/app/components/shared/dialog/ConfigurationDialog.tsx index cd5e82f75a..3f680cb824 100644 --- a/web/apps/app/components/shared/dialog/ConfigurationDialog.tsx +++ b/web/apps/app/components/shared/dialog/ConfigurationDialog.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Modal } from '@signalco/ui/dist/Modal'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Modal } from '@signalco/ui/Modal'; export interface IConfigurationDialogProps { open?: boolean; diff --git a/web/apps/app/components/shared/dialog/ConfirmDeleteButton.tsx b/web/apps/app/components/shared/dialog/ConfirmDeleteButton.tsx index ae61ac6adf..c6f4e0fd7c 100644 --- a/web/apps/app/components/shared/dialog/ConfirmDeleteButton.tsx +++ b/web/apps/app/components/shared/dialog/ConfirmDeleteButton.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Button } from '@signalco/ui/dist/Button'; +import { Button } from '@signalco/ui/Button'; import ConfirmDeleteDialog from './ConfirmDeleteDialog'; export interface ConfirmDeleteButtonDialogProps { diff --git a/web/apps/app/components/shared/dialog/ConfirmDeleteDialog.tsx b/web/apps/app/components/shared/dialog/ConfirmDeleteDialog.tsx index cff647a089..088df79c6e 100644 --- a/web/apps/app/components/shared/dialog/ConfirmDeleteDialog.tsx +++ b/web/apps/app/components/shared/dialog/ConfirmDeleteDialog.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Input } from '@signalco/ui/dist/Input'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Input } from '@signalco/ui/Input'; +import { Button } from '@signalco/ui/Button'; import useLocale from '../../../src/hooks/useLocale'; import ConfigurationDialog from './ConfigurationDialog'; diff --git a/web/apps/app/components/shared/entity/DisplayEntityTarget.tsx b/web/apps/app/components/shared/entity/DisplayEntityTarget.tsx index f4193f99b0..ae20ace406 100644 --- a/web/apps/app/components/shared/entity/DisplayEntityTarget.tsx +++ b/web/apps/app/components/shared/entity/DisplayEntityTarget.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Row } from '@signalco/ui/dist/Row'; -import { Popper } from '@signalco/ui/dist/Popper'; -import { Card } from '@signalco/ui/dist/Card'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Row } from '@signalco/ui/Row'; +import { Popper } from '@signalco/ui/Popper'; +import { Card } from '@signalco/ui/Card'; +import { Button } from '@signalco/ui/Button'; import { camelToSentenceCase } from '@signalco/js'; import IContactPointer from '../../../src/contacts/IContactPointer'; import EntitySelectionMenu from './EntitySelectionMenu'; diff --git a/web/apps/app/components/shared/entity/EntityContactSelection.tsx b/web/apps/app/components/shared/entity/EntityContactSelection.tsx index 25af4140e2..4c68b45376 100644 --- a/web/apps/app/components/shared/entity/EntityContactSelection.tsx +++ b/web/apps/app/components/shared/entity/EntityContactSelection.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { NoDataPlaceholder } from '@signalco/ui/dist/NoDataPlaceholder'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ListItem } from '@signalco/ui/dist/ListItem'; -import { List } from '@signalco/ui/dist/List'; +import { NoDataPlaceholder } from '@signalco/ui/NoDataPlaceholder'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List } from '@signalco/ui/List'; import useEntity from '../../../src/hooks/signalco/entity/useEntity'; import { ContactPointerRequiredEntity } from './DisplayEntityTarget'; diff --git a/web/apps/app/components/shared/entity/EntityContactValueSelection.tsx b/web/apps/app/components/shared/entity/EntityContactValueSelection.tsx index ecd7b001ba..e3ab520c44 100644 --- a/web/apps/app/components/shared/entity/EntityContactValueSelection.tsx +++ b/web/apps/app/components/shared/entity/EntityContactValueSelection.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Loadable } from '@signalco/ui/dist/Loadable'; +import { Loadable } from '@signalco/ui/Loadable'; import useContact from '../../../src/hooks/signalco/useContact'; import useEntity from '../../../src/hooks/signalco/entity/useEntity'; import IContactPointer from '../../../src/contacts/IContactPointer'; diff --git a/web/apps/app/components/shared/entity/EntityIcon.tsx b/web/apps/app/components/shared/entity/EntityIcon.tsx index 4403fde5e5..4e4eb8bf2d 100644 --- a/web/apps/app/components/shared/entity/EntityIcon.tsx +++ b/web/apps/app/components/shared/entity/EntityIcon.tsx @@ -7,62 +7,37 @@ export function EntityIconByType(entityOrType: IEntityDetails | number) { const type = typeof entityOrType === 'number' ? entityOrType : entityOrType.type; switch (type) { case 2: - return Dashboard; + return ; case 3: - return Play; + return ; case 4: - return Station; + return ; case 5: if (typeof entityOrType === 'number') - return Channel; + return ; const entityChannels = distinctBy(entityOrType.contacts.map(c => c.channelName), c => c); - if (entityChannels.length === 1) + const onlyChannel = entityChannels[0]; + if (entityChannels.length === 1 && onlyChannel) { return function ChannelIcon() { - return + return }; - return Channel; + } + return ; default: - return Device; + return ; } } -export default function EntityIcon(entity: IEntityDetails | null | undefined) { +export default function EntityIcon({ entity }: { entity: IEntityDetails | null | undefined }) { const Icon = null; - if (entity) { - if (entity.alias.toLowerCase().indexOf('light') >= 0 || - entity.alias.toLowerCase().indexOf('lamp') >= 0 || - entity.alias.toLowerCase().indexOf('svijetlo') >= 0) { - // Icon = LightbulbIcon; - } else if (entity.alias.toLowerCase().indexOf('temp') >= 0) { - // Icon = ThermostatIcon; - } else if (entity.alias.toLowerCase().indexOf('motion') >= 0) { - // Icon = DirectionsRunIcon; - } else if (entity.alias.toLowerCase().indexOf('tv') >= 0) { - // Icon = TvIcon; - } else if (entity.alias.toLowerCase().indexOf('door') >= 0 || - entity.alias.toLowerCase().indexOf('vrata') >= 0) { - // Icon = MeetingRoomIcon; - } else if (entity.alias.toLowerCase().indexOf('window') >= 0 || - entity.alias.toLowerCase().indexOf('prozor') >= 0) { - // Icon = SensorWindowIcon; - } else if (entity.alias.toLowerCase().indexOf('socket') >= 0) { - // Icon = PowerIcon; - } else if (entity.alias.toLowerCase().indexOf('flower') >= 0) { - // Icon = LocalFloristIcon; - } else if (entity.alias.toLowerCase().indexOf('button') >= 0) { - // Icon = RadioButtonCheckedIcon; - } else if (entity.alias.toLowerCase().indexOf('heat') >= 0) { - // Icon = WhatshotIcon; - } else if (entity.alias.toLowerCase().indexOf('switch') >= 0) { - // Icon = PowerSettingsNewIcon; - } - - if (!Icon) { - return EntityIconByType(entity); - } + if (entity && !Icon) { + const EntityTypeIconOrFunc = EntityIconByType(entity); + if (typeof EntityTypeIconOrFunc === 'function') + return ; + return EntityTypeIconOrFunc; } - return Icon ?? Device; + return Icon ?? ; } diff --git a/web/apps/app/components/shared/entity/EntityIconLabel.tsx b/web/apps/app/components/shared/entity/EntityIconLabel.tsx index f72a887d87..0f77b9ec78 100644 --- a/web/apps/app/components/shared/entity/EntityIconLabel.tsx +++ b/web/apps/app/components/shared/entity/EntityIconLabel.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { Avatar } from '@signalco/ui/dist/Avatar'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { Avatar } from '@signalco/ui/Avatar'; import useEntity from '../../../src/hooks/signalco/entity/useEntity'; import EntityIcon from './EntityIcon'; @@ -18,15 +18,14 @@ export default function EntityIconLabel({ entityId, description, header }: Entit const isLoading = !!entityId && loadingEntity; const entityName = entity?.alias ?? (entity?.id); - const Icon = EntityIcon(entity); return ( {entity && header ? ( - + - ) : entity && ()} + ) : entity && ()}
diff --git a/web/apps/app/components/shared/entity/EntitySelection.tsx b/web/apps/app/components/shared/entity/EntitySelection.tsx index d982375aa0..0ad2bd8fcc 100644 --- a/web/apps/app/components/shared/entity/EntitySelection.tsx +++ b/web/apps/app/components/shared/entity/EntitySelection.tsx @@ -1,9 +1,9 @@ import React, { useMemo, useState } from 'react'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ListItem } from '@signalco/ui/dist/ListItem'; -import { List } from '@signalco/ui/dist/List'; -import { Input } from '@signalco/ui/dist/Input'; +import { Stack } from '@signalco/ui/Stack'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List } from '@signalco/ui/List'; +import { Input } from '@signalco/ui/Input'; import useAllEntities from '../../../src/hooks/signalco/entity/useAllEntities'; import IEntityDetails from '../../../src/entity/IEntityDetails'; import IContactPointer from '../../../src/contacts/IContactPointer'; diff --git a/web/apps/app/components/shared/entity/EntitySelectionMenu.tsx b/web/apps/app/components/shared/entity/EntitySelectionMenu.tsx index 4137d84d3c..4513916aaa 100644 --- a/web/apps/app/components/shared/entity/EntitySelectionMenu.tsx +++ b/web/apps/app/components/shared/entity/EntitySelectionMenu.tsx @@ -1,8 +1,8 @@ import React, { useEffect, useState } from 'react'; -import { cx } from 'classix'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Row } from '@signalco/ui/dist/Row'; -import { Accordion } from '@signalco/ui/dist/Accordion'; +import { Typography } from '@signalco/ui/Typography'; +import { Row } from '@signalco/ui/Row'; +import { cx } from '@signalco/ui/cx'; +import { Accordion } from '@signalco/ui/Accordion'; import IContactPointer from '../../../src/contacts/IContactPointer'; import EntitySelection from './EntitySelection'; import EntityIconLabel from './EntityIconLabel'; diff --git a/web/apps/app/components/shared/entity/InputContactValue.tsx b/web/apps/app/components/shared/entity/InputContactValue.tsx index 3f2ffe2b81..abbd4a91c9 100644 --- a/web/apps/app/components/shared/entity/InputContactValue.tsx +++ b/web/apps/app/components/shared/entity/InputContactValue.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Row } from '@signalco/ui/dist/Row'; -import { Checkbox } from '@signalco/ui/dist/Checkbox'; +import { Typography } from '@signalco/ui/Typography'; +import { Row } from '@signalco/ui/Row'; +import { Checkbox } from '@signalco/ui/Checkbox'; import blendColors from '../../../src/helpers/BlendColors'; import IContact from '../../../src/contacts/IContact'; diff --git a/web/apps/app/components/shared/inputs/SearchInput.tsx b/web/apps/app/components/shared/inputs/SearchInput.tsx index 7f65e02db3..d99f722c35 100644 --- a/web/apps/app/components/shared/inputs/SearchInput.tsx +++ b/web/apps/app/components/shared/inputs/SearchInput.tsx @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { Input } from '@signalco/ui/dist/Input'; +import { Input } from '@signalco/ui/Input'; import useSearch, { filterFuncObjectStringProps } from '../../../src/hooks/useSearch'; import useLocale from '../../../src/hooks/useLocale'; diff --git a/web/apps/app/components/station/StationCheckUpdate.tsx b/web/apps/app/components/station/StationCheckUpdate.tsx index 3f90664a25..3c2b513cc9 100644 --- a/web/apps/app/components/station/StationCheckUpdate.tsx +++ b/web/apps/app/components/station/StationCheckUpdate.tsx @@ -1,10 +1,10 @@ import { compareVersions } from 'compare-versions'; +import { showNotification } from '@signalco/ui-notifications'; import { Check, Upload } from '@signalco/ui-icons'; -import { Button } from '@signalco/ui/dist/Button'; +import { Button } from '@signalco/ui/Button'; import { objectWithKey } from '@signalco/js'; import { usePromise } from '@enterwell/react-hooks'; import StationsRepository from '../../src/stations/StationsRepository'; -import { showNotification } from '../../src/notifications/PageNotificationService'; import useLocale, { localizer, useLocalePlaceholders } from '../../src/hooks/useLocale'; async function loadLatestAvailableVersion() { diff --git a/web/apps/app/components/users/UserAvatar.tsx b/web/apps/app/components/users/UserAvatar.tsx index 273e708f44..d53ead0dc3 100644 --- a/web/apps/app/components/users/UserAvatar.tsx +++ b/web/apps/app/components/users/UserAvatar.tsx @@ -1,4 +1,4 @@ -import { Avatar } from '@signalco/ui/dist/Avatar'; +import { Avatar } from '@signalco/ui/Avatar'; import { User } from '@auth0/auth0-spa-js'; export default function UserAvatar({ user }: { user: User | undefined }) { @@ -6,8 +6,10 @@ export default function UserAvatar({ user }: { user: User | undefined }) { if (user?.given_name && user?.family_name) { userNameInitials = `${user.given_name[0]}${user.family_name[0]}`; } - if (userNameInitials === '' && user?.email) { - userNameInitials = user.email[0]; + + const userEmail = user?.email; + if (userNameInitials === '' && userEmail) { + userNameInitials = userEmail[0] ? userEmail[0] : 'S'; } return ( diff --git a/web/apps/app/components/users/UserProfileAvatar.tsx b/web/apps/app/components/users/UserProfileAvatar.tsx index 2a51f1ddab..5751a23596 100644 --- a/web/apps/app/components/users/UserProfileAvatar.tsx +++ b/web/apps/app/components/users/UserProfileAvatar.tsx @@ -1,5 +1,5 @@ import { LogOut, Settings } from '@signalco/ui-icons'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/Menu'; import { KnownPages } from '../../src/knownPages'; import useLocale from '../../src/hooks/useLocale'; import UserProfileAvatarButton from './UserProfileAvatarButton'; diff --git a/web/apps/app/components/users/UserProfileAvatarButton.tsx b/web/apps/app/components/users/UserProfileAvatarButton.tsx index 660beeb79e..61a59a2ff5 100644 --- a/web/apps/app/components/users/UserProfileAvatarButton.tsx +++ b/web/apps/app/components/users/UserProfileAvatarButton.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { forwardRef } from 'react'; -import { Button } from '@signalco/ui/dist/Button'; +import { Button } from '@signalco/ui/Button'; import ApiBadge from '../development/ApiBadge'; import useCurrentUser from '../../src/hooks/useCurrentUser'; import UserAvatar from './UserAvatar'; diff --git a/web/apps/app/components/views/Entity/ContactsTable.tsx b/web/apps/app/components/views/Entity/ContactsTable.tsx index 04257a6669..bda46c15b1 100644 --- a/web/apps/app/components/views/Entity/ContactsTable.tsx +++ b/web/apps/app/components/views/Entity/ContactsTable.tsx @@ -1,20 +1,20 @@ import React, { useMemo, useState } from 'react'; -import { cx } from 'classix'; import { Add, Code, Delete, Edit, MoreVertical, UI, History, CircleEqual } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Timeago } from '@signalco/ui/dist/Timeago'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ListItem } from '@signalco/ui/dist/ListItem'; -import { List } from '@signalco/ui/dist/List'; -import { Input } from '@signalco/ui/dist/Input'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Chip } from '@signalco/ui/dist/Chip'; -import { Card } from '@signalco/ui/dist/Card'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Timeago } from '@signalco/ui/Timeago'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/Menu'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List } from '@signalco/ui/List'; +import { Input } from '@signalco/ui/Input'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; +import { Chip } from '@signalco/ui/Chip'; +import { Card } from '@signalco/ui/Card'; +import { Button } from '@signalco/ui/Button'; import { camelToSentenceCase, isJson, ParsedJson } from '@signalco/js'; import { ObjectVisualizer } from '../../visualizers/ObjectVisualizer'; import ConfirmDeleteDialog from '../../shared/dialog/ConfirmDeleteDialog'; diff --git a/web/apps/app/components/views/Entity/EntityDetailsView.tsx b/web/apps/app/components/views/Entity/EntityDetailsView.tsx index 65d64576ee..32b6071eff 100644 --- a/web/apps/app/components/views/Entity/EntityDetailsView.tsx +++ b/web/apps/app/components/views/Entity/EntityDetailsView.tsx @@ -2,9 +2,9 @@ import { useMemo } from 'react'; import dynamic from 'next/dynamic'; -import { NoDataPlaceholder } from '@signalco/ui/dist/NoDataPlaceholder'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { NoDataPlaceholder } from '@signalco/ui/NoDataPlaceholder'; +import { Loadable } from '@signalco/ui/Loadable'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import useEntity from '../../../src/hooks/signalco/entity/useEntity'; import ContactsTable from './ContactsTable'; diff --git a/web/apps/app/components/views/Entity/EntityOptions.tsx b/web/apps/app/components/views/Entity/EntityOptions.tsx index c06ca82de1..569f601939 100644 --- a/web/apps/app/components/views/Entity/EntityOptions.tsx +++ b/web/apps/app/components/views/Entity/EntityOptions.tsx @@ -1,10 +1,10 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; +import { showNotification } from '@signalco/ui-notifications'; import { MoreHorizontal } from '@signalco/ui-icons'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; -import { Button } from '@signalco/ui/dist/Button'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/Menu'; +import { Button } from '@signalco/ui/Button'; import ConfirmDeleteDialog from '../../shared/dialog/ConfirmDeleteDialog'; -import { showNotification } from '../../../src/notifications/PageNotificationService'; import { KnownPages } from '../../../src/knownPages'; import useLocale from '../../../src/hooks/useLocale'; import useEntity from '../../../src/hooks/signalco/entity/useEntity'; diff --git a/web/apps/app/components/views/Entity/EntityProcessDetails.tsx b/web/apps/app/components/views/Entity/EntityProcessDetails.tsx index ae61294d84..2aa62f0537 100644 --- a/web/apps/app/components/views/Entity/EntityProcessDetails.tsx +++ b/web/apps/app/components/views/Entity/EntityProcessDetails.tsx @@ -1,14 +1,14 @@ import { useMemo } from 'react'; import { Close, Equal, EqualNot, Play, Warning, Timer, Pause, Left, Right } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Timeago } from '@signalco/ui/dist/Timeago'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Container } from '@signalco/ui/dist/Container'; -import { Chip } from '@signalco/ui/dist/Chip'; -import { Card } from '@signalco/ui/dist/Card'; -import { Alert } from '@signalco/ui/dist/Alert'; +import { Typography } from '@signalco/ui/Typography'; +import { Timeago } from '@signalco/ui/Timeago'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Container } from '@signalco/ui/Container'; +import { Chip } from '@signalco/ui/Chip'; +import { Card } from '@signalco/ui/Card'; +import { Alert } from '@signalco/ui/Alert'; import { objectWithKey } from '@signalco/js'; import DisplayEntityTarget from '../../shared/entity/DisplayEntityTarget'; import useContact from '../../../src/hooks/signalco/useContact'; diff --git a/web/apps/app/components/views/Entity/EntityStationDetails.tsx b/web/apps/app/components/views/Entity/EntityStationDetails.tsx index 4a49555fab..888345116b 100644 --- a/web/apps/app/components/views/Entity/EntityStationDetails.tsx +++ b/web/apps/app/components/views/Entity/EntityStationDetails.tsx @@ -1,10 +1,10 @@ import { useState, Fragment } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Card, CardContent, CardTitle } from '@signalco/ui/dist/Card'; -import { Button } from '@signalco/ui/dist/Button'; +import { showNotification } from '@signalco/ui-notifications'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Card, CardContent, CardTitle } from '@signalco/ui/Card'; +import { Button } from '@signalco/ui/Button'; import EntityStatus from '../../entity/EntityStatus'; -import { showNotification } from '../../../src/notifications/PageNotificationService'; import useContact from '../../../src/hooks/signalco/useContact'; import type IEntityDetails from '../../../src/entity/IEntityDetails'; import IContactPointer from '../../../src/contacts/IContactPointer'; diff --git a/web/apps/app/components/visualizers/ObjectVisualizer.tsx b/web/apps/app/components/visualizers/ObjectVisualizer.tsx index 28dbebdbdb..14ae2d9aa5 100644 --- a/web/apps/app/components/visualizers/ObjectVisualizer.tsx +++ b/web/apps/app/components/visualizers/ObjectVisualizer.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Row } from '@signalco/ui/dist/Row'; -import { ListTreeItem } from '@signalco/ui/dist/ListTreeItem'; -import { CopyToClipboardInput } from '@signalco/ui/dist/CopyToClipboardInput'; +import { Typography } from '@signalco/ui/Typography'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Row } from '@signalco/ui/Row'; +import { ListTreeItem } from '@signalco/ui/ListTreeItem'; +import { CopyToClipboardInput } from '@signalco/ui/CopyToClipboardInput'; import { ParsedJson } from '@signalco/js'; import { JsonNonArrayVisualizer } from './JsonNonArrayVisualizer'; import { JsonArrayVisualizer } from './JsonArrayVisualizer'; diff --git a/web/apps/app/components/widget-store/WidgetStore.tsx b/web/apps/app/components/widget-store/WidgetStore.tsx index 79b4d31a53..486968abed 100644 --- a/web/apps/app/components/widget-store/WidgetStore.tsx +++ b/web/apps/app/components/widget-store/WidgetStore.tsx @@ -1,11 +1,12 @@ import React from 'react'; import { Add } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Input } from '@signalco/ui/dist/Input'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Card } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Input } from '@signalco/ui/Input'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Card } from '@signalco/ui/Card'; +import { asArray } from '@signalco/js'; import { widgetType } from '../widgets/Widget'; import useSearch, { filterFuncObjectStringProps } from '../../src/hooks/useSearch'; @@ -102,7 +103,7 @@ function WidgetStore(props: { onAddWidget?: (widgetType: widgetType) => void }) variant="plain" disabled={props.onAddWidget == null} aria-label="Add to dashboard" - onClick={() => props.onAddWidget && props.onAddWidget(Array.isArray(availableWidget.type) ? availableWidget.type[0] : availableWidget.type)}> + onClick={() => props.onAddWidget && props.onAddWidget(asArray(availableWidget.type)[0] ?? 'unknown')}> diff --git a/web/apps/app/components/widgets/Widget.tsx b/web/apps/app/components/widgets/Widget.tsx index 93a889170b..93e03bfdbb 100644 --- a/web/apps/app/components/widgets/Widget.tsx +++ b/web/apps/app/components/widgets/Widget.tsx @@ -16,7 +16,7 @@ const WidgetFinanceStock = dynamic(() => import('./parts/WidgetFinanceStock')); const WidgetGraph = dynamic(() => import('./parts/WidgetGraph')); const WidgetEnergy = dynamic(() => import('./parts/WidgetEnergy')); -export type widgetType = 'button' | 'state' | 'vacuum' | 'shades' | 'indicator' | 'airconditioning' | 'termostat' | 'time' | 'checklist' | 'finance-stock' | 'graph' | 'energy'; +export type widgetType = 'unknown' | 'button' | 'state' | 'vacuum' | 'shades' | 'indicator' | 'airconditioning' | 'termostat' | 'time' | 'checklist' | 'finance-stock' | 'graph' | 'energy'; export interface WidgetProps extends WidgetSpecifigProps { type: widgetType, diff --git a/web/apps/app/components/widgets/parts/Wave.tsx b/web/apps/app/components/widgets/parts/Wave.tsx index 43696c4d65..bf327b441c 100644 --- a/web/apps/app/components/widgets/parts/Wave.tsx +++ b/web/apps/app/components/widgets/parts/Wave.tsx @@ -1,5 +1,5 @@ import { CSSProperties } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import styles from './Wave.module.css'; function SingleWave() { @@ -10,7 +10,7 @@ function SingleWave() { ) } -export function Wave({ value, breakpoints }: { value: number, breakpoints: number[] }) { +export function Wave({ value, breakpoints }: { value: number, breakpoints: readonly [number, number, number] }) { return (
[] = [ ]; function UsageIndicatorCircle({ value, percentageValue, unit, largeValue }: { value: number, percentageValue: number, unit: string, largeValue?: boolean }) { - const breakpoints = [10, 30, 60]; + const breakpoints = [10, 30, 60] as const; return (
Unknown widget diff --git a/web/apps/app/components/widgets/parts/WidgetVacuum.tsx b/web/apps/app/components/widgets/parts/WidgetVacuum.tsx index f2cef01009..cdd74fb1db 100644 --- a/web/apps/app/components/widgets/parts/WidgetVacuum.tsx +++ b/web/apps/app/components/widgets/parts/WidgetVacuum.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; import { WidgetSharedProps } from '../Widget'; import { DefaultRows, DefaultLabel, DefaultColumns } from '../../../src/widgets/WidgetConfigurationOptions'; import IWidgetConfigurationOption from '../../../src/widgets/IWidgetConfigurationOption'; diff --git a/web/apps/app/components/widgets/parts/piece/PrimaryValueLabel.tsx b/web/apps/app/components/widgets/parts/piece/PrimaryValueLabel.tsx index 597a8c90de..46b61e0b6a 100644 --- a/web/apps/app/components/widgets/parts/piece/PrimaryValueLabel.tsx +++ b/web/apps/app/components/widgets/parts/piece/PrimaryValueLabel.tsx @@ -1,6 +1,6 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; export function numberWholeAndDecimal(data: number | string | undefined): [undefined, undefined] | [number, number] { if (typeof data === 'undefined') diff --git a/web/apps/app/components/widgets/parts/piece/SmallIndicator.tsx b/web/apps/app/components/widgets/parts/piece/SmallIndicator.tsx index c53ff39f14..e3f0f4d0cd 100644 --- a/web/apps/app/components/widgets/parts/piece/SmallIndicator.tsx +++ b/web/apps/app/components/widgets/parts/piece/SmallIndicator.tsx @@ -1,6 +1,6 @@ -import { cx } from 'classix'; -import { Icon } from '@signalco/ui/dist/Icon'; -import { Button } from '@signalco/ui/dist/Button'; +import { Icon } from '@signalco/ui/Icon'; +import { cx } from '@signalco/ui/cx'; +import { Button } from '@signalco/ui/Button'; export interface SmallIndicatorProps { isActive: boolean; diff --git a/web/apps/app/next.config.mjs b/web/apps/app/next.config.mjs index 62e63f4b21..f8c9da0ab5 100644 --- a/web/apps/app/next.config.mjs +++ b/web/apps/app/next.config.mjs @@ -3,7 +3,7 @@ import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD, } from 'next/constants.js'; -import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data'; +import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data/node'; import nextBundleAnalyzer from '@next/bundle-analyzer'; const isDevelopment = process.env.NODE_ENV === 'development'; diff --git a/web/apps/app/package.json b/web/apps/app/package.json index 55a6579ced..d5f42bcd8b 100644 --- a/web/apps/app/package.json +++ b/web/apps/app/package.json @@ -4,6 +4,7 @@ "homepage": "https://www.signalco.io/", "version": "1.0.0", "private": true, + "type": "module", "engines": { "node": "18.x" }, @@ -36,6 +37,7 @@ "@signalco/js": "workspace:*", "@signalco/tailwindcss-config-signalco": "workspace:*", "@signalco/ui": "workspace:*", + "@signalco/ui-notifications": "workspace:*", "@signalco/ui-icons": "workspace:*", "@tanstack/query-sync-storage-persister": "5.8.3", "@tanstack/react-query": "5.8.4", @@ -59,9 +61,8 @@ "react-cool-inview": "3.0.1", "react-dom": "18.2.0", "react-grid-layout": "1.4.3", - "react-toastify": "9.1.3", "react-transition-group": "4.4.5", - "recharts": "2.9.3", + "recharts": "2.10.1", "sharp": "0.32.6", "suncalc": "1.9.0", "tailwindcss": "3.3.5", @@ -79,11 +80,11 @@ "@types/color": "3.0.6", "@types/d3": "7.4.3", "@types/next-pwa": "5.6.9", - "@types/node": "18.18.9", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/node": "18.18.11", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "@types/react-grid-layout": "1.3.5", - "@types/recharts": "1.8.27", + "@types/recharts": "1.8.28", "@types/suncalc": "1.9.2", "@types/uuid": "9.0.7", "colorette": "2.0.20", @@ -97,7 +98,7 @@ "rimraf": "5.0.5", "sass": "1.69.5", "sass-loader": "13.3.2", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "nextBundleAnalysis": { "budget": 358400, diff --git a/web/apps/app/playwright.config.ts b/web/apps/app/playwright.config.ts index 9e503cd9e2..fd10b4318b 100644 --- a/web/apps/app/playwright.config.ts +++ b/web/apps/app/playwright.config.ts @@ -1,6 +1,8 @@ import path from 'path' import type { PlaywrightTestConfig } from '@playwright/test'; import { devices } from '@playwright/test'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; const PORT = process.env.PORT || 3001 const baseURL = `http://127.0.0.1:${PORT}` @@ -8,7 +10,7 @@ const baseURL = `http://127.0.0.1:${PORT}` const config: PlaywrightTestConfig = { retries: 2, timeout: 30 * 1000, - testDir: path.join(__dirname, 'e2e'), + testDir: path.join(dirname(fileURLToPath(import.meta.url)), 'e2e'), outputDir: 'test-results/', webServer: { command: 'pnpm start', diff --git a/web/apps/app/postcss.config.js b/web/apps/app/postcss.config.cjs similarity index 100% rename from web/apps/app/postcss.config.js rename to web/apps/app/postcss.config.cjs diff --git a/web/apps/app/src/conducts/ConductsService.ts b/web/apps/app/src/conducts/ConductsService.ts index ce3fd1c236..dda190f96a 100644 --- a/web/apps/app/src/conducts/ConductsService.ts +++ b/web/apps/app/src/conducts/ConductsService.ts @@ -47,7 +47,10 @@ export default class ConductsService { // Set local value state for (let index = 0; index < conducts.length; index++) { - ConductsService._updateLocalStateAsync(conducts[index]); + const conduct = conducts[index]; + if (conduct) { + ConductsService._updateLocalStateAsync(conduct); + } } } } diff --git a/web/apps/app/src/dashboards/DashboardsRepository.ts b/web/apps/app/src/dashboards/DashboardsRepository.ts index 7889ecc057..bd7c086166 100644 --- a/web/apps/app/src/dashboards/DashboardsRepository.ts +++ b/web/apps/app/src/dashboards/DashboardsRepository.ts @@ -77,7 +77,7 @@ class DashboardModel implements IDashboardModel { } } -export function dashboardModelFromEntity(entity: IEntityDetails, order: number, favorites: string[]): DashboardModel { +export function dashboardModelFromEntity(entity: IEntityDetails, order: number, favorites: string[]): IDashboardModel { const dashboard = new DashboardModel( entity.id, entity.alias, diff --git a/web/apps/app/src/helpers/BlendColors.ts b/web/apps/app/src/helpers/BlendColors.ts index eb62fe1712..23abf621b1 100644 --- a/web/apps/app/src/helpers/BlendColors.ts +++ b/web/apps/app/src/helpers/BlendColors.ts @@ -5,9 +5,8 @@ @param: num => the number to conver to hex @returns: string => the hex representation of the provided number */ -function int_to_hex(num: number) -{ - let hex = Math.round(num).toString(16); +function int_to_hex(num: number | undefined) { + let hex = Math.round(num ?? 0).toString(16); if (hex.length == 1) hex = '0' + hex; return hex; @@ -26,8 +25,7 @@ function int_to_hex(num: number) @param: percentage => the distance from the first color, as a decimal between 0 and 1 (ie: 0.5) @returns: string => the third color, hex, represenatation of the blend between color1 and color2 at the given percentage */ -export default function blendColors(color1: string, color2: string, percentage: number) -{ +export default function blendColors(color1: string, color2: string, percentage: number) { // check input color1 = color1 || '#000000'; color2 = color2 || '#ffffff'; @@ -47,17 +45,17 @@ export default function blendColors(color1: string, color2: string, percentage: // the three character hex is just a representation of the 6 hex where each character is repeated // ie: #060 => #006600 (green) if (color1.length == 4) - color1 = color1[1] + color1[1] + color1[2] + color1[2] + color1[3] + color1[3]; + color1 = '' + color1[1] + color1[1] + color1[2] + color1[2] + color1[3] + color1[3]; else color1 = color1.substring(1); if (color2.length == 4) - color2 = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3]; + color2 = '' + color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3]; else color2 = color2.substring(1); // 3: we have valid input, convert colors to rgb - const color1Channels = [parseInt(color1[0] + color1[1], 16), parseInt(color1[2] + color1[3], 16), parseInt(color1[4] + color1[5], 16)]; - const color2Channels = [parseInt(color2[0] + color2[1], 16), parseInt(color2[2] + color2[3], 16), parseInt(color2[4] + color2[5], 16)]; + const color1Channels: readonly [number, number, number] = [parseInt('' + color1[0] + color1[1], 16) ?? 0, parseInt('' + color1[2] + color1[3], 16) ?? 0, parseInt('' + color1[4] + color1[5], 16) ?? 0]; + const color2Channels: readonly [number, number, number] = [parseInt('' + color2[0] + color2[1], 16) ?? 0, parseInt('' + color2[2] + color2[3], 16) ?? 0, parseInt('' + color2[4] + color2[5], 16) ?? 0]; // 4: blend const color3 = [ diff --git a/web/apps/app/src/hooks/dashboards/useDashboard.ts b/web/apps/app/src/hooks/dashboards/useDashboard.ts index bcb105d3b1..60be9ccf4b 100644 --- a/web/apps/app/src/hooks/dashboards/useDashboard.ts +++ b/web/apps/app/src/hooks/dashboards/useDashboard.ts @@ -1,9 +1,11 @@ +import { useMemo } from 'react'; +import { IDashboardModel } from '../../dashboards/DashboardsRepository'; import useDashboards from './useDashboards'; -export default function useDashboard(id?: string) { +export default function useDashboard(id?: string): Omit, 'data'> & { data: IDashboardModel | undefined } { const dashboards = useDashboards(); - return { + return useMemo(() => ({ ...dashboards, data: dashboards.data?.find(d => d.id === id) - }; + }), [dashboards]); } diff --git a/web/apps/app/src/hooks/dashboards/useDashboards.ts b/web/apps/app/src/hooks/dashboards/useDashboards.ts index c09bcd4284..3a31dad9a6 100644 --- a/web/apps/app/src/hooks/dashboards/useDashboards.ts +++ b/web/apps/app/src/hooks/dashboards/useDashboards.ts @@ -1,12 +1,13 @@ +import { useMemo } from 'react'; import { useUserSettingAsync } from '../useUserSetting'; import useAllEntities from '../signalco/entity/useAllEntities'; -import { DashboardsFavoritesLocalStorageKey, dashboardModelFromEntity } from '../../dashboards/DashboardsRepository'; +import { DashboardsFavoritesLocalStorageKey, IDashboardModel, dashboardModelFromEntity } from '../../dashboards/DashboardsRepository'; -export default function useDashboards() { +export default function useDashboards(): Omit, 'data'> & { data: IDashboardModel[] | undefined } { const dashboardEntities = useAllEntities(2); const [currentFavorites] = useUserSettingAsync(DashboardsFavoritesLocalStorageKey, []); - return { + return useMemo(() => ({ ...dashboardEntities, data: dashboardEntities.data?.map((entity, i) => dashboardModelFromEntity(entity, i, currentFavorites ?? [])) - } + }), [dashboardEntities, currentFavorites]); } diff --git a/web/apps/app/src/hooks/dashboards/useDeleteDashboard.ts b/web/apps/app/src/hooks/dashboards/useDeleteDashboard.ts index 21ca3c2ab4..9d8e7b4435 100644 --- a/web/apps/app/src/hooks/dashboards/useDeleteDashboard.ts +++ b/web/apps/app/src/hooks/dashboards/useDeleteDashboard.ts @@ -1,9 +1,9 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { entityKey } from '../signalco/entity/useEntity'; import { allEntitiesKey } from '../signalco/entity/useAllEntities'; import { deleteDashboardAsync } from '../../dashboards/DashboardsRepository'; -export default function useDeleteDashboard() { +export default function useDeleteDashboard(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: (id: string) => { diff --git a/web/apps/app/src/hooks/dashboards/useSaveDashboard.ts b/web/apps/app/src/hooks/dashboards/useSaveDashboard.ts index becd176e31..383940abb6 100644 --- a/web/apps/app/src/hooks/dashboards/useSaveDashboard.ts +++ b/web/apps/app/src/hooks/dashboards/useSaveDashboard.ts @@ -1,9 +1,9 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { entityKey } from '../signalco/entity/useEntity'; import { allEntitiesKey } from '../signalco/entity/useAllEntities'; import { IDashboardSetModel, saveDashboardAsync } from '../../dashboards/DashboardsRepository'; -export default function useSaveDashboard() { +export default function useSaveDashboard(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: (dashboard: IDashboardSetModel) => { diff --git a/web/apps/app/src/hooks/signalco/entity/useAllEntities.ts b/web/apps/app/src/hooks/signalco/entity/useAllEntities.ts index 59f5c8d020..fc54851c05 100644 --- a/web/apps/app/src/hooks/signalco/entity/useAllEntities.ts +++ b/web/apps/app/src/hooks/signalco/entity/useAllEntities.ts @@ -1,4 +1,5 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; +import IEntityDetails from '../../../entity/IEntityDetails'; import { entitiesAsync } from '../../../entity/EntityRepository'; export function allEntitiesKey(type?: number | undefined) { @@ -7,10 +8,12 @@ export function allEntitiesKey(type?: number | undefined) { return ['entities', type]; } -const useAllEntities = (type?: number | undefined) => useQuery({ - queryKey: allEntitiesKey(type), - queryFn: async () => await entitiesAsync(type) ?? undefined, - staleTime: 60 * 1000 // 1min -}); +function useAllEntities(type?: number | undefined): UseQueryResult { + return useQuery({ + queryKey: allEntitiesKey(type), + queryFn: async () => await entitiesAsync(type) ?? undefined, + staleTime: 60 * 1000 + }); +} export default useAllEntities; diff --git a/web/apps/app/src/hooks/signalco/entity/useDeleteEntity.ts b/web/apps/app/src/hooks/signalco/entity/useDeleteEntity.ts index e70a794184..a37f747997 100644 --- a/web/apps/app/src/hooks/signalco/entity/useDeleteEntity.ts +++ b/web/apps/app/src/hooks/signalco/entity/useDeleteEntity.ts @@ -1,9 +1,9 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { entityDeleteAsync } from '../../../entity/EntityRepository'; import { entityKey } from './useEntity'; import { allEntitiesKey } from './useAllEntities'; -export default function useDeleteEntity() { +export default function useDeleteEntity(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: entityDeleteAsync, diff --git a/web/apps/app/src/hooks/signalco/entity/useEntity.ts b/web/apps/app/src/hooks/signalco/entity/useEntity.ts index 7e9cc0aa77..ecc6c14ca1 100644 --- a/web/apps/app/src/hooks/signalco/entity/useEntity.ts +++ b/web/apps/app/src/hooks/signalco/entity/useEntity.ts @@ -1,4 +1,4 @@ -import { QueryClient, useQuery, useQueryClient } from '@tanstack/react-query'; +import { QueryClient, UseQueryResult, useQuery, useQueryClient } from '@tanstack/react-query'; import IEntityDetails from '../../../entity/IEntityDetails'; import { entityAsync } from '../../../entity/EntityRepository'; import { entityTypes } from '../../../entity/EntityHelper'; @@ -17,7 +17,7 @@ function findEntity(client: QueryClient, id: string | undefined) { .at(0); } -export default function useEntity(id: string | undefined) { +export default function useEntity(id: string | undefined): UseQueryResult { const client = useQueryClient(); return useQuery({ queryKey: entityKey(id), diff --git a/web/apps/app/src/hooks/signalco/entity/useUpsertEntity.ts b/web/apps/app/src/hooks/signalco/entity/useUpsertEntity.ts index 848ef35169..de85f91dac 100644 --- a/web/apps/app/src/hooks/signalco/entity/useUpsertEntity.ts +++ b/web/apps/app/src/hooks/signalco/entity/useUpsertEntity.ts @@ -1,11 +1,11 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { entityUpsertAsync } from '../../../entity/EntityRepository'; import { entityKey } from './useEntity'; import { allEntitiesKey } from './useAllEntities'; type EntityUpsertArgs = { id: string | undefined, type: number, alias: string }; -export default function useUpsertEntity() { +export default function useUpsertEntity(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ id, type, alias }: EntityUpsertArgs) => entityUpsertAsync(id, type, alias), diff --git a/web/apps/app/src/hooks/signalco/useContact.ts b/web/apps/app/src/hooks/signalco/useContact.ts index 816314d39e..0ac1ae9b43 100644 --- a/web/apps/app/src/hooks/signalco/useContact.ts +++ b/web/apps/app/src/hooks/signalco/useContact.ts @@ -1,5 +1,6 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import type IContactPointer from '../../contacts/IContactPointer'; +import IContact from '../../contacts/IContact'; import useEntity from './entity/useEntity'; export function contactKey(pointer: Partial | null | undefined) { @@ -8,7 +9,7 @@ export function contactKey(pointer: Partial | null | undefined) return ['contact', pointer.entityId, pointer.channelName, pointer.contactName]; } -export default function useContact(pointer: Partial | null | undefined) { +export default function useContact(pointer: Partial | null | undefined): UseQueryResult { const entity = useEntity(pointer?.entityId); return useQuery({ diff --git a/web/apps/app/src/hooks/signalco/useContacts.ts b/web/apps/app/src/hooks/signalco/useContacts.ts index 54a9ca4ca9..9baa5f5fd2 100644 --- a/web/apps/app/src/hooks/signalco/useContacts.ts +++ b/web/apps/app/src/hooks/signalco/useContacts.ts @@ -1,9 +1,10 @@ -import { useQueries, useQueryClient } from '@tanstack/react-query'; +import { UseQueryResult, useQueries, useQueryClient } from '@tanstack/react-query'; import IEntityDetails from '../../entity/IEntityDetails'; import { entityAsync } from '../../entity/EntityRepository'; import IContactPointer from '../../contacts/IContactPointer'; +import IContact from '../../contacts/IContact'; -export default function useContacts(pointers: IContactPointer[] | undefined) { +export default function useContacts(pointers: IContactPointer[] | undefined): UseQueryResult[] { const client = useQueryClient(); return useQueries({ queries: (pointers ?? []).filter(Boolean).map(pointer => { diff --git a/web/apps/app/src/hooks/signalco/useDeleteContact.ts b/web/apps/app/src/hooks/signalco/useDeleteContact.ts index 456d8266d2..6c70ef7867 100644 --- a/web/apps/app/src/hooks/signalco/useDeleteContact.ts +++ b/web/apps/app/src/hooks/signalco/useDeleteContact.ts @@ -1,10 +1,11 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; +import IContactPointer from '../../contacts/IContactPointer'; import { deleteContactAsync } from '../../../src/contacts/ContactRepository'; import { contactKey } from './useContact'; import { entityKey } from './entity/useEntity'; import { allEntitiesKey } from './entity/useAllEntities'; -export default function useDeleteContact() { +export default function useDeleteContact(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: deleteContactAsync, diff --git a/web/apps/app/src/hooks/signalco/useSetContact.ts b/web/apps/app/src/hooks/signalco/useSetContact.ts index 0f1d51ddb3..29357f1008 100644 --- a/web/apps/app/src/hooks/signalco/useSetContact.ts +++ b/web/apps/app/src/hooks/signalco/useSetContact.ts @@ -1,11 +1,14 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import type IContactPointer from '../../contacts/IContactPointer'; import { setAsync } from '../../../src/contacts/ContactRepository'; import { contactKey } from './useContact'; import { entityKey } from './entity/useEntity'; import { allEntitiesKey } from './entity/useAllEntities'; -export default function useSetContact() { +export default function useSetContact(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ pointer, valueSerialized }: { pointer: IContactPointer, valueSerialized: string | undefined }) => diff --git a/web/apps/app/src/hooks/signalco/useSetMetadataContact.ts b/web/apps/app/src/hooks/signalco/useSetMetadataContact.ts index de7f403720..5b8e1aded1 100644 --- a/web/apps/app/src/hooks/signalco/useSetMetadataContact.ts +++ b/web/apps/app/src/hooks/signalco/useSetMetadataContact.ts @@ -1,11 +1,14 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import type IContactPointer from '../../contacts/IContactPointer'; import { setMetadataAsync } from '../../contacts/ContactRepository'; import { contactKey } from './useContact'; import { entityKey } from './entity/useEntity'; import { allEntitiesKey } from './entity/useAllEntities'; -export default function useSetMetadataContact() { +export default function useSetMetadataContact(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ pointer, metadataSerialized }: { pointer: IContactPointer, metadataSerialized: string | undefined }) => diff --git a/web/apps/app/src/hooks/sounds/useAudioOff.ts b/web/apps/app/src/hooks/sounds/useAudioOff.ts index 61db901f67..da639be278 100644 --- a/web/apps/app/src/hooks/sounds/useAudioOff.ts +++ b/web/apps/app/src/hooks/sounds/useAudioOff.ts @@ -1,4 +1,4 @@ -import { useAudio } from '@signalco/hooks/dist/useAudio'; +import { useAudio } from '@signalco/hooks/useAudio'; export default function useAudioOff() { return useAudio('/sounds/switch-off.mp3', { volume: 0.8 }); diff --git a/web/apps/app/src/hooks/sounds/useAudioOn.ts b/web/apps/app/src/hooks/sounds/useAudioOn.ts index d0a1fc9ce5..8a864f172b 100644 --- a/web/apps/app/src/hooks/sounds/useAudioOn.ts +++ b/web/apps/app/src/hooks/sounds/useAudioOn.ts @@ -1,4 +1,4 @@ -import { useAudio } from '@signalco/hooks/dist/useAudio'; +import { useAudio } from '@signalco/hooks/useAudio'; export default function useAudioOn() { return useAudio('/sounds/switch-on.mp3', { volume: 0.8 }); diff --git a/web/apps/app/src/hooks/useAppTheme.tsx b/web/apps/app/src/hooks/useAppTheme.tsx index bd3aaeb6ce..e33251f1f3 100644 --- a/web/apps/app/src/hooks/useAppTheme.tsx +++ b/web/apps/app/src/hooks/useAppTheme.tsx @@ -1,9 +1,9 @@ import { useCallback } from 'react'; -import type { AppThemeMode, DefaultColorScheme } from '@signalco/ui/dist/theme'; -import { useIsomorphicLayoutEffect } from '@signalco/hooks/dist/useIsomorphicLayoutEffect'; -import { useInterval } from '@signalco/hooks/dist/useInterval'; +import { showNotification } from '@signalco/ui-notifications'; +import type { AppThemeMode, DefaultColorScheme } from '@signalco/ui/theme'; +import { useIsomorphicLayoutEffect } from '@signalco/hooks/useIsomorphicLayoutEffect'; +import { useInterval } from '@signalco/hooks/useInterval'; import { fromDuration, now } from '../services/DateTimeProvider'; -import { showNotification } from '../notifications/PageNotificationService'; import SunHelper from '../helpers/SunHelper'; import useUserSetting from './useUserSetting'; import { localizer } from './useLocale'; diff --git a/web/apps/app/src/hooks/useLocale.ts b/web/apps/app/src/hooks/useLocale.ts index 7d0fe2c921..7cba142872 100644 --- a/web/apps/app/src/hooks/useLocale.ts +++ b/web/apps/app/src/hooks/useLocale.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react'; import { ObjectDictAny } from '@signalco/js'; -import { useIsServer } from '@signalco/hooks/dist/useIsServer'; +import { useIsServer } from '@signalco/hooks/useIsServer'; import UserSettingsProvider from '../services/UserSettingsProvider'; import hr from '../../locales/hr.json'; import en from '../../locales/en.json'; @@ -15,8 +15,7 @@ function resolvePathSplit(data: ObjectDictAny, pathParts: string[]) { let namespaceKeys = data; for (let i = 0; i < pathParts.length; i++) { const nextNamespaceKey = pathParts[i]; - - if (!namespaceKeys) { + if (!nextNamespaceKey) { break; } namespaceKeys = namespaceKeys[nextNamespaceKey] as ObjectDictAny; diff --git a/web/apps/app/src/realtime/realtimeService.ts b/web/apps/app/src/realtime/realtimeService.ts index 9a936c8897..59c1cd4b9b 100644 --- a/web/apps/app/src/realtime/realtimeService.ts +++ b/web/apps/app/src/realtime/realtimeService.ts @@ -1,7 +1,7 @@ import { QueryClient } from '@tanstack/react-query'; +import { showNotification } from '@signalco/ui-notifications'; import { HubConnection, HubConnectionBuilder, LogLevel } from '@microsoft/signalr'; import { getApiUrl, getTokenFactory } from '../services/HttpService'; -import { showNotification } from '../notifications/PageNotificationService'; import { contactKey } from '../hooks/signalco/useContact'; import { entityKey } from '../hooks/signalco/entity/useEntity'; diff --git a/web/apps/app/src/services/DateTimeProvider.ts b/web/apps/app/src/services/DateTimeProvider.ts index b3f5993287..229e300db9 100644 --- a/web/apps/app/src/services/DateTimeProvider.ts +++ b/web/apps/app/src/services/DateTimeProvider.ts @@ -46,13 +46,13 @@ export function fromDuration(date: Date, duration: string) { const matches = duration.match(durationRegex); if (!matches) return undefined; - const years= parseFloat(matches[3]); - const months= parseFloat(matches[5]); - const weeks= parseFloat(matches[7]); - const days= parseFloat(matches[9]); - const hours= parseFloat(matches[12]); - const minutes= parseFloat(matches[14]); - const seconds= parseFloat(matches[16]); + const years= parseFloat(matches[3] ?? '0'); + const months= parseFloat(matches[5] ?? '0'); + const weeks= parseFloat(matches[7] ?? '0'); + const days= parseFloat(matches[9] ?? '0'); + const hours= parseFloat(matches[12] ?? '0'); + const minutes= parseFloat(matches[14] ?? '0'); + const seconds= parseFloat(matches[16] ?? '0'); const dateTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0,0,0,0); diff --git a/web/apps/app/src/widgets/ConfigurationValidator.ts b/web/apps/app/src/widgets/ConfigurationValidator.ts index 31191b72ce..1a16483edb 100644 --- a/web/apps/app/src/widgets/ConfigurationValidator.ts +++ b/web/apps/app/src/widgets/ConfigurationValidator.ts @@ -12,7 +12,7 @@ export function IsConfigurationValid( if (!config) return false; for (let i = 0; i < options.length; i++) { const opt = options[i]; - if (opt.optional) continue; + if (!opt || opt.optional) continue; const value = config[opt.name]; if (typeof value === 'undefined' || value == null) { diff --git a/web/apps/app/tailwind.config.cjs b/web/apps/app/tailwind.config.cjs index 0d40ba909e..84b3ba102d 100644 --- a/web/apps/app/tailwind.config.cjs +++ b/web/apps/app/tailwind.config.cjs @@ -6,6 +6,7 @@ export default { presets: [baseConfig], content: [ './app/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}' + './components/**/*.{ts,tsx}', + "../../packages/ui/src/**/*.{ts,tsx}" ] } diff --git a/web/apps/app/tsconfig.json b/web/apps/app/tsconfig.json index 85d808dccd..5bb23aa5fc 100644 --- a/web/apps/app/tsconfig.json +++ b/web/apps/app/tsconfig.json @@ -2,19 +2,21 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "@signalco/tsconfig/web.json", "compilerOptions": { - "outDir": "dist", "plugins": [ { "name": "next" } ] }, + "exclude": [ + "node_modules", + "worker" + ], "include": [ - "src", - "app", - "components", "next-env.d.ts", - "@types", + "next.config.js", + "**/*.ts", + "**/*.tsx", ".next/types/**/*.ts" -, "../../packages/hooks/src/useInterval.ts" ] + ] } diff --git a/web/apps/blog/.eslintrc.js b/web/apps/blog/.eslintrc.cjs similarity index 100% rename from web/apps/blog/.eslintrc.js rename to web/apps/blog/.eslintrc.cjs diff --git a/web/apps/blog/app/(posts)/hello-world/page.tsx b/web/apps/blog/app/(posts)/hello-world/page.tsx index d9078d650a..4c342f93a0 100644 --- a/web/apps/blog/app/(posts)/hello-world/page.tsx +++ b/web/apps/blog/app/(posts)/hello-world/page.tsx @@ -1,8 +1,8 @@ -import {Typography} from '@signalco/ui/dist/Typography'; -import {Stack} from '@signalco/ui/dist/Stack'; -import {Row} from '@signalco/ui/dist/Row'; -import {Container} from '@signalco/ui/dist/Container'; -import {Chip} from '@signalco/ui/dist/Chip'; +import {Typography} from '@signalco/ui/Typography'; +import {Stack} from '@signalco/ui/Stack'; +import {Row} from '@signalco/ui/Row'; +import {Container} from '@signalco/ui/Container'; +import {Chip} from '@signalco/ui/Chip'; import HelloWorld, { meta } from './hello-world.mdx'; export default function Page() { diff --git a/web/apps/blog/app/(posts)/layout.tsx b/web/apps/blog/app/(posts)/layout.tsx index bf6c3ab6da..44d2992197 100644 --- a/web/apps/blog/app/(posts)/layout.tsx +++ b/web/apps/blog/app/(posts)/layout.tsx @@ -1,7 +1,7 @@ import { PropsWithChildren } from 'react'; -import {Typography} from '@signalco/ui/dist/Typography'; -import {Stack} from '@signalco/ui/dist/Stack'; -import {Link} from '@signalco/ui/dist/Link'; +import {Typography} from '@signalco/ui/Typography'; +import {Stack} from '@signalco/ui/Stack'; +import {Link} from '@signalco/ui/Link'; import { KnownPages } from '../../src/knownPages'; export default function PostLayout({ children }: PropsWithChildren) { diff --git a/web/apps/blog/app/error.tsx b/web/apps/blog/app/error.tsx index cb25ec73a7..2d5a49266e 100644 --- a/web/apps/blog/app/error.tsx +++ b/web/apps/blog/app/error.tsx @@ -1,11 +1,11 @@ 'use client'; import { useEffect } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Button } from '@signalco/ui/Button'; type RootErrorProps = { error: Error; diff --git a/web/apps/blog/app/global.css b/web/apps/blog/app/global.css index abb6713fc9..619dc6faab 100644 --- a/web/apps/blog/app/global.css +++ b/web/apps/blog/app/global.css @@ -1,8 +1,4 @@ -@import '@signalco/ui/dist/index.css'; - -@tailwind base; -@tailwind components; -@tailwind utilities; +@import '@signalco/ui/index.css'; @font-face { font-family: 'Material Icons'; @@ -43,10 +39,3 @@ html, body, #__next { font-feature-settings: 'liga'; } -.image--light { - display: var(--light-display); -} - -.image--dark { - display: var(--dark-display); -} diff --git a/web/apps/blog/components/PageNav.tsx b/web/apps/blog/components/PageNav.tsx index c89cb9b914..d69d646fee 100644 --- a/web/apps/blog/components/PageNav.tsx +++ b/web/apps/blog/components/PageNav.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { cx } from 'classix'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; -import { Container } from '@signalco/ui/dist/Container'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; import SignalcoLogotype from './icons/SignalcoLogotype'; export const HeaderHeight = 80; diff --git a/web/apps/blog/components/icons/SignalcoLogotype.tsx b/web/apps/blog/components/icons/SignalcoLogotype.tsx index f5571bffe2..a1e900992f 100644 --- a/web/apps/blog/components/icons/SignalcoLogotype.tsx +++ b/web/apps/blog/components/icons/SignalcoLogotype.tsx @@ -1,6 +1,6 @@ import React, { forwardRef } from 'react'; -import { cx } from 'classix'; -import type { SupportedColorScheme } from '@signalco/ui/dist/theme'; +import type { SupportedColorScheme } from '@signalco/ui/theme'; +import { cx } from '@signalco/ui/cx'; import styles from './SignalcoLogotype.module.scss'; interface SignalcoLogotypeProps { diff --git a/web/apps/blog/components/layouts/PageLayout.tsx b/web/apps/blog/components/layouts/PageLayout.tsx index 66ae9b4d85..be3b145653 100644 --- a/web/apps/blog/components/layouts/PageLayout.tsx +++ b/web/apps/blog/components/layouts/PageLayout.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren } from 'react'; -import {Stack} from '@signalco/ui/dist/Stack'; -import {Container} from '@signalco/ui/dist/Container'; +import {Stack} from '@signalco/ui/Stack'; +import {Container} from '@signalco/ui/Container'; import Footer from '../pages/Footer'; import PageNav, { HeaderHeight } from '../PageNav'; diff --git a/web/apps/blog/components/pages/Footer.tsx b/web/apps/blog/components/pages/Footer.tsx index e0af9e73f2..be3e00bc0c 100644 --- a/web/apps/blog/components/pages/Footer.tsx +++ b/web/apps/blog/components/pages/Footer.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Container } from '@signalco/ui/dist/Container'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Container } from '@signalco/ui/Container'; import SignalcoLogotype from '../icons/SignalcoLogotype'; import { isDeveloper } from '../../src/services/EnvProvider'; import { now } from '../../src/services/DateTimeProvider'; diff --git a/web/apps/blog/components/pages/PageCenterHeader.tsx b/web/apps/blog/components/pages/PageCenterHeader.tsx index 9389517f06..d79c90b8ab 100644 --- a/web/apps/blog/components/pages/PageCenterHeader.tsx +++ b/web/apps/blog/components/pages/PageCenterHeader.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {Typography} from '@signalco/ui/dist/Typography'; -import {Stack} from '@signalco/ui/dist/Stack'; +import {Typography} from '@signalco/ui/Typography'; +import {Stack} from '@signalco/ui/Stack'; import style from './PageCenterHeader.module.scss'; export default function PageCenterHeader(props: { header: string; subHeader?: string; secondary?: boolean }) { diff --git a/web/apps/blog/components/views/LandingView.tsx b/web/apps/blog/components/views/LandingView.tsx index ffab6425af..addc9a185f 100644 --- a/web/apps/blog/components/views/LandingView.tsx +++ b/web/apps/blog/components/views/LandingView.tsx @@ -1,10 +1,10 @@ import fs from 'fs'; import React from 'react'; import klaw from 'klaw'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Card, CardContent, CardTitle } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Card, CardContent, CardTitle } from '@signalco/ui/Card'; import PageCenterHeader from '../pages/PageCenterHeader'; export default async function LandingPageView() { diff --git a/web/apps/blog/mdx-components.tsx b/web/apps/blog/mdx-components.tsx index e450c4331d..e9d9a09272 100644 --- a/web/apps/blog/mdx-components.tsx +++ b/web/apps/blog/mdx-components.tsx @@ -1,35 +1,36 @@ -import {Typography} from '@signalco/ui/dist/Typography'; -import {Row} from '@signalco/ui/dist/Row'; +import { PropsWithChildren, JSX } from 'react'; +import {Typography} from '@signalco/ui/Typography'; +import {Row} from '@signalco/ui/Row'; -function H1({ children }) { +function H1({ children }: PropsWithChildren) { return {children}; } -function H2({ children }) { +function H2({ children }: PropsWithChildren) { return {children}; } -function H3({ children }) { +function H3({ children }: PropsWithChildren) { return {children}; } -function H4({ children }) { +function H4({ children }: PropsWithChildren) { return {children}; } -function H5({ children }) { +function H5({ children }: PropsWithChildren) { return {children}; } -function H6({ children }) { +function H6({ children }: PropsWithChildren) { return {children}; } -function P({ children }) { +function P({ children }: PropsWithChildren) { return {children}; } -function Li({ children }) { +function Li({ children }: PropsWithChildren) { return ( @@ -38,10 +39,10 @@ function Li({ children }) { ); } -function Ul({ children }) { +function Ul({ children }: PropsWithChildren) { return
    {children}
; } -export function useMDXComponents(components) { +export function useMDXComponents(components: JSX.Element) { return { h1: H1, h2: H2, h3: H3, h4: H4, h5: H5, h6: H6, p: P, li: Li, ul: Ul, ...components }; } diff --git a/web/apps/blog/next.config.mjs b/web/apps/blog/next.config.mjs index f0076ed541..aa93510e4c 100644 --- a/web/apps/blog/next.config.mjs +++ b/web/apps/blog/next.config.mjs @@ -1,5 +1,5 @@ import { createSecureHeaders } from 'next-secure-headers'; -import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data'; +import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data/node'; import mdx from '@next/mdx'; const isDevelopment = process.env.NODE_ENV === 'development'; diff --git a/web/apps/blog/package.json b/web/apps/blog/package.json index 193a0793cb..f105b95726 100644 --- a/web/apps/blog/package.json +++ b/web/apps/blog/package.json @@ -4,6 +4,7 @@ "homepage": "https://blog.signalco.io/", "version": "1.0.0", "private": true, + "type": "module", "engines": { "node": "18.x" }, @@ -54,9 +55,9 @@ "@types/color": "3.0.6", "@types/fs-extra": "11.0.4", "@types/klaw": "3.0.6", - "@types/node": "18.18.9", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/node": "18.18.11", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "colorette": "2.0.20", "cross-env": "7.0.3", "eslint": "8.54.0", @@ -64,7 +65,7 @@ "postcss": "8.4.31", "rimraf": "5.0.5", "sass": "1.69.5", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "nextBundleAnalysis": { "budget": 358400, diff --git a/web/apps/blog/playwright.config.ts b/web/apps/blog/playwright.config.ts index cc69fc8031..546db67a87 100644 --- a/web/apps/blog/playwright.config.ts +++ b/web/apps/blog/playwright.config.ts @@ -1,6 +1,8 @@ import path from 'path' import type { PlaywrightTestConfig } from '@playwright/test'; import { devices } from '@playwright/test'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; const PORT = process.env.PORT || 3002 const baseURL = `http://127.0.0.1:${PORT}` @@ -8,7 +10,7 @@ const baseURL = `http://127.0.0.1:${PORT}` const config: PlaywrightTestConfig = { retries: 2, timeout: 30 * 1000, - testDir: path.join(__dirname, 'e2e'), + testDir: path.join(dirname(fileURLToPath(import.meta.url)), 'e2e'), outputDir: 'test-results/', webServer: { command: 'pnpm start', diff --git a/web/apps/blog/postcss.config.js b/web/apps/blog/postcss.config.cjs similarity index 100% rename from web/apps/blog/postcss.config.js rename to web/apps/blog/postcss.config.cjs diff --git a/web/apps/blog/tailwind.config.cjs b/web/apps/blog/tailwind.config.cjs index 0d40ba909e..84b3ba102d 100644 --- a/web/apps/blog/tailwind.config.cjs +++ b/web/apps/blog/tailwind.config.cjs @@ -6,6 +6,7 @@ export default { presets: [baseConfig], content: [ './app/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}' + './components/**/*.{ts,tsx}', + "../../packages/ui/src/**/*.{ts,tsx}" ] } diff --git a/web/apps/blog/tsconfig.json b/web/apps/blog/tsconfig.json index ad7aaf8e24..5bb23aa5fc 100644 --- a/web/apps/blog/tsconfig.json +++ b/web/apps/blog/tsconfig.json @@ -2,19 +2,21 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "@signalco/tsconfig/web.json", "compilerOptions": { - "outDir": "dist", "plugins": [ { "name": "next" } ] }, + "exclude": [ + "node_modules", + "worker" + ], "include": [ - "src", - "app", - "components", "next-env.d.ts", - "@types", + "next.config.js", + "**/*.ts", + "**/*.tsx", ".next/types/**/*.ts" ] } diff --git a/web/apps/brandgrab/.eslintrc.js b/web/apps/brandgrab/.eslintrc.cjs similarity index 100% rename from web/apps/brandgrab/.eslintrc.js rename to web/apps/brandgrab/.eslintrc.cjs diff --git a/web/apps/brandgrab/app/api/screenshot/route.ts b/web/apps/brandgrab/app/api/screenshot/route.ts index a3057d712f..dc43a92426 100644 --- a/web/apps/brandgrab/app/api/screenshot/route.ts +++ b/web/apps/brandgrab/app/api/screenshot/route.ts @@ -17,8 +17,8 @@ function extractColor(data: Buffer, channels: number) { const green = data[i + 1]; const blue = data[i + 2]; const alpha = data[i + 3]; - if (alpha > 0) { - colors.push(`#${red.toString(16).padStart(2, '0')}${green.toString(16).padStart(2, '0')}${blue.toString(16).padStart(2, '0')}`); + if ((alpha ?? 0) > 0) { + colors.push(`#${red?.toString(16).padStart(2, '0')}${green?.toString(16).padStart(2, '0')}${blue?.toString(16).padStart(2, '0')}`); } } return colors; diff --git a/web/apps/brandgrab/app/error.tsx b/web/apps/brandgrab/app/error.tsx index 6b28c9f27d..afef740021 100644 --- a/web/apps/brandgrab/app/error.tsx +++ b/web/apps/brandgrab/app/error.tsx @@ -1,7 +1,7 @@ 'use client'; -import {Stack} from '@signalco/ui/dist/Stack'; -import {Row} from '@signalco/ui/dist/Row'; +import {Stack} from '@signalco/ui/Stack'; +import {Row} from '@signalco/ui/Row'; type RootErrorProps = { error: Error; diff --git a/web/apps/slco/app/global.scss b/web/apps/brandgrab/app/global.css similarity index 68% rename from web/apps/slco/app/global.scss rename to web/apps/brandgrab/app/global.css index c5e5150225..dc369d9e3f 100644 --- a/web/apps/slco/app/global.scss +++ b/web/apps/brandgrab/app/global.css @@ -1,7 +1,4 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - +@import "@signalco/ui/index.css"; @font-face { font-family: 'Material Icons'; @@ -41,26 +38,3 @@ html, body, #__next { /* Support for IE. */ font-feature-settings: 'liga'; } - - -@layer base { - :root { - --bg-selection: #000; - --text-selection: #fff; - } - - .dark { - --bg-selection: #fff; - --text-selection: #000; - } - - ::selection { background: var(--bg-selection); color: var(--text-selection); } -} - -.image--light { - display: var(--light-display); -} - -.image--dark { - display: var(--dark-display); -} diff --git a/web/apps/brandgrab/app/layout.tsx b/web/apps/brandgrab/app/layout.tsx index 4e923b40c0..f420ed39ed 100644 --- a/web/apps/brandgrab/app/layout.tsx +++ b/web/apps/brandgrab/app/layout.tsx @@ -1,6 +1,5 @@ -import '@signalco/ui/dist/index.css'; import { Inter } from 'next/font/google'; -import './global.scss'; +import './global.css'; import { Metadata, Viewport } from 'next'; const inter = Inter({ diff --git a/web/apps/brandgrab/components/InputGrabDomain.tsx b/web/apps/brandgrab/components/InputGrabDomain.tsx index a624dd6221..1b653ddc7e 100644 --- a/web/apps/brandgrab/components/InputGrabDomain.tsx +++ b/web/apps/brandgrab/components/InputGrabDomain.tsx @@ -1,7 +1,7 @@ 'use client'; import { useState } from 'react'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import InputSubmit from './form/InputSubmit'; function stripDomain(domain: string) { diff --git a/web/apps/brandgrab/components/PageNav.tsx b/web/apps/brandgrab/components/PageNav.tsx index 81da4a9714..84f75f79df 100644 --- a/web/apps/brandgrab/components/PageNav.tsx +++ b/web/apps/brandgrab/components/PageNav.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { cx } from 'classix'; -import { Link } from '@signalco/ui/dist/Link'; -import { Container } from '@signalco/ui/dist/Container'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; import InputGrabDomain from './InputGrabDomain'; export function PageNav({ fullWidth }: { fullWidth?: boolean | undefined; }) { diff --git a/web/apps/brandgrab/components/form/InputSubmit.tsx b/web/apps/brandgrab/components/form/InputSubmit.tsx index 40caf47573..c499835ad2 100644 --- a/web/apps/brandgrab/components/form/InputSubmit.tsx +++ b/web/apps/brandgrab/components/form/InputSubmit.tsx @@ -1,5 +1,5 @@ -import { Input } from '@signalco/ui/dist/Input'; -import { Button } from '@signalco/ui/dist/Button'; +import { Input } from '@signalco/ui/Input'; +import { Button } from '@signalco/ui/Button'; type InputSubmitProps = { value: string; diff --git a/web/apps/brandgrab/components/pages/Footer.tsx b/web/apps/brandgrab/components/pages/Footer.tsx index 59e25de066..722b48368a 100644 --- a/web/apps/brandgrab/components/pages/Footer.tsx +++ b/web/apps/brandgrab/components/pages/Footer.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {Stack} from '@signalco/ui/dist/Stack'; -import {Container} from '@signalco/ui/dist/Container'; +import {Stack} from '@signalco/ui/Stack'; +import {Container} from '@signalco/ui/Container'; import FooterLinks, { type FooterSectionType } from './FooterLinks'; import { FooterInfo } from './FooterInfo'; diff --git a/web/apps/brandgrab/components/pages/FooterInfo.tsx b/web/apps/brandgrab/components/pages/FooterInfo.tsx index af6bf7536d..8597aa28a6 100644 --- a/web/apps/brandgrab/components/pages/FooterInfo.tsx +++ b/web/apps/brandgrab/components/pages/FooterInfo.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {Row} from '@signalco/ui/dist/Row'; -import {Link} from '@signalco/ui/dist/Link'; +import {Row} from '@signalco/ui/Row'; +import {Link} from '@signalco/ui/Link'; import { now } from '../../src/services/DateTimeProvider'; import styles from './FooterInfo.module.scss'; diff --git a/web/apps/brandgrab/components/pages/FooterLinks.tsx b/web/apps/brandgrab/components/pages/FooterLinks.tsx index 5df20b9f1d..a17690702e 100644 --- a/web/apps/brandgrab/components/pages/FooterLinks.tsx +++ b/web/apps/brandgrab/components/pages/FooterLinks.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {Typography} from '@signalco/ui/dist/Typography'; -import {Stack} from '@signalco/ui/dist/Stack'; -import {Row} from '@signalco/ui/dist/Row'; -import {Link} from '@signalco/ui/dist/Link'; +import {Typography} from '@signalco/ui/Typography'; +import {Stack} from '@signalco/ui/Stack'; +import {Row} from '@signalco/ui/Row'; +import {Link} from '@signalco/ui/Link'; import { isDeveloper } from '../../src/services/EnvProvider'; export type FooterSectionType = { diff --git a/web/apps/brandgrab/components/pages/PageCenterHeader.tsx b/web/apps/brandgrab/components/pages/PageCenterHeader.tsx index 2ca67d40d7..c2ec2f76c7 100644 --- a/web/apps/brandgrab/components/pages/PageCenterHeader.tsx +++ b/web/apps/brandgrab/components/pages/PageCenterHeader.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; import style from './PageCenterHeader.module.scss'; export default function PageCenterHeader(props: { header: string; subHeader?: string; secondary?: boolean }) { diff --git a/web/apps/brandgrab/components/pages/SectionCenter.tsx b/web/apps/brandgrab/components/pages/SectionCenter.tsx index eacfe20a29..2b602c46f1 100644 --- a/web/apps/brandgrab/components/pages/SectionCenter.tsx +++ b/web/apps/brandgrab/components/pages/SectionCenter.tsx @@ -1,5 +1,5 @@ import React, { type CSSProperties } from 'react'; -import {Container} from '@signalco/ui/dist/Container'; +import {Container} from '@signalco/ui/Container'; export function SectionCenter(props: { children?: React.ReactNode | undefined; style?: CSSProperties | undefined; narrow?: boolean; }) { return ( diff --git a/web/apps/brandgrab/components/views/LandingView.tsx b/web/apps/brandgrab/components/views/LandingView.tsx index f7e7de6648..d718854df9 100644 --- a/web/apps/brandgrab/components/views/LandingView.tsx +++ b/web/apps/brandgrab/components/views/LandingView.tsx @@ -2,16 +2,16 @@ import React, { PropsWithChildren, useCallback } from 'react'; import NextImage from 'next/image'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { Link } from '@signalco/ui/dist/Link'; -import { Divider } from '@signalco/ui/dist/Divider'; -import { Container } from '@signalco/ui/dist/Container'; -import { Card, CardContent, CardCover, CardOverflow } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { Loadable } from '@signalco/ui/Loadable'; +import { Link } from '@signalco/ui/Link'; +import { Divider } from '@signalco/ui/Divider'; +import { Container } from '@signalco/ui/Container'; +import { Card, CardContent, CardCover, CardOverflow } from '@signalco/ui/Card'; import { orderBy, isImageDataUrl } from '@signalco/js'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { usePromise } from '@enterwell/react-hooks'; import { ScreenshotResponse } from '../../app/api/screenshot/route'; import { BrandResources } from '../../app/api/quick/route'; diff --git a/web/apps/brandgrab/next.config.mjs b/web/apps/brandgrab/next.config.mjs index 70cfb55ceb..d0fc6ed953 100644 --- a/web/apps/brandgrab/next.config.mjs +++ b/web/apps/brandgrab/next.config.mjs @@ -1,5 +1,5 @@ import { createSecureHeaders } from 'next-secure-headers'; -import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data'; +import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data/node'; import nextBundleAnalyzer from '@next/bundle-analyzer'; const isDevelopment = process.env.NODE_ENV === 'development'; diff --git a/web/apps/brandgrab/package.json b/web/apps/brandgrab/package.json index af4c970184..8f3f23c387 100644 --- a/web/apps/brandgrab/package.json +++ b/web/apps/brandgrab/package.json @@ -4,6 +4,7 @@ "homepage": "https://www.brandgrab.io/", "version": "1.0.0", "private": true, + "type": "module", "engines": { "node": "18.x" }, @@ -41,9 +42,9 @@ "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", "@types/color": "3.0.6", - "@types/node": "18.18.9", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/node": "18.18.11", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "@types/sharp": "0.31.1", "cross-env": "7.0.3", "eslint": "8.54.0", @@ -51,7 +52,7 @@ "postcss": "8.4.31", "rimraf": "5.0.5", "sass": "1.69.5", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "nextBundleAnalysis": { "budget": 358400, diff --git a/web/apps/brandgrab/playwright.config.ts b/web/apps/brandgrab/playwright.config.ts index b78590422e..e49b3bf4fc 100644 --- a/web/apps/brandgrab/playwright.config.ts +++ b/web/apps/brandgrab/playwright.config.ts @@ -1,6 +1,8 @@ import path from 'path' import type { PlaywrightTestConfig } from '@playwright/test'; import { devices } from '@playwright/test'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; const PORT = process.env.PORT || 4001 const baseURL = `http://127.0.0.1:${PORT}` @@ -8,7 +10,7 @@ const baseURL = `http://127.0.0.1:${PORT}` const config: PlaywrightTestConfig = { retries: 2, timeout: 30 * 1000, - testDir: path.join(__dirname, 'e2e'), + testDir: path.join(dirname(fileURLToPath(import.meta.url)), 'e2e'), outputDir: 'test-results/', webServer: { command: 'pnpm start', diff --git a/web/apps/brandgrab/tsconfig.json b/web/apps/brandgrab/tsconfig.json index e0904158d5..8d1c3a5638 100644 --- a/web/apps/brandgrab/tsconfig.json +++ b/web/apps/brandgrab/tsconfig.json @@ -2,21 +2,21 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "@signalco/tsconfig/web.json", "compilerOptions": { - "outDir": "dist", "plugins": [ { "name": "next" } ] }, - "include": [ - "src", - "app", - "components", - "pages", + "exclude": [ + "node_modules", + "worker" +], +"include": [ "next-env.d.ts", - "@types", - ".next/types/**/*.ts", - "C:\\Users\\aleks\\Documents\\GitHub\\signalco\\web\\apps\\brandgrab\\.next/types/**/*.ts" - ] + "next.config.js", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" +] } diff --git a/web/apps/development/package.json b/web/apps/development/package.json index dc13ca8aeb..1f0bdac02d 100644 --- a/web/apps/development/package.json +++ b/web/apps/development/package.json @@ -9,14 +9,17 @@ }, "dependencies": { "@signalco/ui": "workspace:*", + "@signalco/tailwindcss-config-signalco": "workspace:*", "react": "18.2.0", - "react-dom": "18.2.0" + "react-dom": "18.2.0", + "tailwindcss": "3.3.5", + "tailwindcss-animate": "1.0.7" }, "devDependencies": { - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "@vitejs/plugin-react-swc": "3.5.0", - "typescript": "5.2.2", - "vite": "5.0.0" + "typescript": "5.3.2", + "vite": "5.0.2" } } \ No newline at end of file diff --git a/web/apps/doprocess.app/postcss.config.js b/web/apps/development/postcss.config.cjs similarity index 100% rename from web/apps/doprocess.app/postcss.config.js rename to web/apps/development/postcss.config.cjs diff --git a/web/apps/development/src/App.tsx b/web/apps/development/src/App.tsx index 850681ab88..a9a0a08106 100644 --- a/web/apps/development/src/App.tsx +++ b/web/apps/development/src/App.tsx @@ -1,7 +1,7 @@ import './App.css' import { AppItemSection } from './AppItemSection'; import { AppItemType } from './AppItemType'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; const tools: AppItemType[] = [ { label: 'UI Docs', href: 'http://localhost:6007' }, diff --git a/web/apps/development/src/AppItemSection.tsx b/web/apps/development/src/AppItemSection.tsx index ea655e052a..a859c768eb 100644 --- a/web/apps/development/src/AppItemSection.tsx +++ b/web/apps/development/src/AppItemSection.tsx @@ -1,7 +1,7 @@ import { AppItem } from './AppItem'; import { AppItemType } from './AppItemType'; -import { Row } from '@signalco/ui/dist/Row'; -import { Typography } from '@signalco/ui/dist/Typography'; +import { Row } from '@signalco/ui/Row'; +import { Typography } from '@signalco/ui/Typography'; export function AppItemSection({ items, title }: { items: AppItemType[]; title: string; }) { return ( diff --git a/web/apps/development/src/index.css b/web/apps/development/src/index.css index 30b6db6067..4f9f8df026 100644 --- a/web/apps/development/src/index.css +++ b/web/apps/development/src/index.css @@ -1,4 +1,4 @@ -@import '@signalco/ui/dist/index.css'; +@import '@signalco/ui/index.css'; :root { font-family: Inter, Avenir, Helvetica, Arial, sans-serif; diff --git a/web/apps/development/tailwind.config.cjs b/web/apps/development/tailwind.config.cjs new file mode 100644 index 0000000000..978a9650a1 --- /dev/null +++ b/web/apps/development/tailwind.config.cjs @@ -0,0 +1,11 @@ +import { baseConfig } from '@signalco/tailwindcss-config-signalco'; + +/** @type {import('tailwindcss').Config} */ +// eslint-disable-next-line import/no-anonymous-default-export +export default { + presets: [baseConfig], + content: [ + './src/**/*.{ts,tsx}', + "../../packages/ui/src/**/*.{ts,tsx}" + ] +} diff --git a/web/apps/doprocess.app/.eslintrc.js b/web/apps/doprocess.app/.eslintrc.cjs similarity index 100% rename from web/apps/doprocess.app/.eslintrc.js rename to web/apps/doprocess.app/.eslintrc.cjs diff --git a/web/apps/doprocess.app/app/(embedded)/documents/[id]/embedded/page.tsx b/web/apps/doprocess.app/app/(embedded)/documents/[id]/embedded/page.tsx index 62b0f30669..e3dff255ab 100644 --- a/web/apps/doprocess.app/app/(embedded)/documents/[id]/embedded/page.tsx +++ b/web/apps/doprocess.app/app/(embedded)/documents/[id]/embedded/page.tsx @@ -1,4 +1,4 @@ -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import { TypographyDocumentName } from '../../../../../components/processes/documents/TypographyDocumentName'; import { DocumentEditor } from '../../../../../components/processes/documents/DocumentEditor'; diff --git a/web/apps/doprocess.app/app/(rest)/(app)/documents/[id]/page.tsx b/web/apps/doprocess.app/app/(rest)/(app)/documents/[id]/page.tsx index 70b652248a..c713131fba 100644 --- a/web/apps/doprocess.app/app/(rest)/(app)/documents/[id]/page.tsx +++ b/web/apps/doprocess.app/app/(rest)/(app)/documents/[id]/page.tsx @@ -1,8 +1,8 @@ 'use client'; import { useState } from 'react'; -import { cx } from 'classix'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; +import { cx } from '@signalco/ui/cx'; import { useDocument } from '../../../../../src/hooks/useDocument'; import { TypographyDocumentName } from '../../../../../components/processes/documents/TypographyDocumentName'; import { DocumentEditor } from '../../../../../components/processes/documents/DocumentEditor'; diff --git a/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/layout.tsx b/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/layout.tsx index c68502fb2f..baa0ee1087 100644 --- a/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/layout.tsx +++ b/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/layout.tsx @@ -2,8 +2,8 @@ import { PropsWithChildren, useMemo } from 'react'; import { usePathname } from 'next/navigation'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Breadcrumbs } from '@signalco/ui/dist/Breadcrumbs'; +import { Stack } from '@signalco/ui/Stack'; +import { Breadcrumbs } from '@signalco/ui/Breadcrumbs'; import { KnownPages } from '../../../../../src/knownPages'; import { TypographyProcessName } from '../../../../../components/processes/processes/TypographyProcessName'; import { ProcessDetails } from '../../../../../components/processes/processes/ProcessDetails'; diff --git a/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/page.tsx b/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/page.tsx index 9feb0e8741..0a033d0e4b 100644 --- a/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/page.tsx +++ b/web/apps/doprocess.app/app/(rest)/(app)/processes/[id]/page.tsx @@ -1,4 +1,4 @@ -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { TaskDetails } from '../../../../../components/processes/tasks/TaskDetails'; export default function ProcessPage({ params }: { params: { id: string } }) { diff --git a/web/apps/doprocess.app/app/(rest)/(marketing)/page.tsx b/web/apps/doprocess.app/app/(rest)/(marketing)/page.tsx index 6528915b57..31bbcb33ef 100644 --- a/web/apps/doprocess.app/app/(rest)/(marketing)/page.tsx +++ b/web/apps/doprocess.app/app/(rest)/(marketing)/page.tsx @@ -1,5 +1,5 @@ import { ListChecks, Play, Share } from '@signalco/ui-icons'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; import { KnownPages } from '../../../src/knownPages'; import { ImagePlaceholder } from '../../../components/images/ImagePlaceholder'; diff --git a/web/apps/doprocess.app/app/(rest)/error.tsx b/web/apps/doprocess.app/app/(rest)/error.tsx index db5e24cd4e..2a2ada3cc7 100644 --- a/web/apps/doprocess.app/app/(rest)/error.tsx +++ b/web/apps/doprocess.app/app/(rest)/error.tsx @@ -1,11 +1,11 @@ 'use client'; import { useEffect } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Button } from '@signalco/ui/Button'; type RootErrorProps = { error: Error; diff --git a/web/apps/doprocess.app/app/global.css b/web/apps/doprocess.app/app/global.css index ac0f313360..3fb2bb7d8f 100644 --- a/web/apps/doprocess.app/app/global.css +++ b/web/apps/doprocess.app/app/global.css @@ -1,29 +1,6 @@ -@import '@signalco/ui/dist/index.css'; - -@tailwind components; -@tailwind utilities; +@import '@signalco/ui/index.css'; html, body, #__next { height: 100%; width: 100%; } - -:root { - --bg-selection: #000; - --text-selection: #fff; -} - -.dark { - --bg-selection: #fff; - --text-selection: #000; -} - -::selection { background: var(--bg-selection); color: var(--text-selection); } - -.image--light { - display: var(--light-display); -} - -.image--dark { - display: var(--dark-display); -} diff --git a/web/apps/doprocess.app/components/PageNav.tsx b/web/apps/doprocess.app/components/PageNav.tsx index 6c8f137066..a29c5b5eb7 100644 --- a/web/apps/doprocess.app/components/PageNav.tsx +++ b/web/apps/doprocess.app/components/PageNav.tsx @@ -1,9 +1,9 @@ -import { cx } from 'classix'; import { Navigate } from '@signalco/ui-icons'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; -import { Container } from '@signalco/ui/dist/Container'; -import { Button } from '@signalco/ui/dist/Button'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; +import { Button } from '@signalco/ui/Button'; import { SignInButton, SignUpButton, SignedIn, SignedOut } from '@clerk/nextjs'; import { KnownPages } from '../src/knownPages'; import { UserButton } from './UserButton'; diff --git a/web/apps/doprocess.app/components/brand/DoProcessLogo.tsx b/web/apps/doprocess.app/components/brand/DoProcessLogo.tsx index 710014869f..c6ed8bf36f 100644 --- a/web/apps/doprocess.app/components/brand/DoProcessLogo.tsx +++ b/web/apps/doprocess.app/components/brand/DoProcessLogo.tsx @@ -1,5 +1,5 @@ import React, { forwardRef } from 'react'; -import type { SupportedColorScheme } from '@signalco/ui/dist/theme'; +import type { SupportedColorScheme } from '@signalco/ui/theme'; interface DoProcessLogoProps { width?: number; diff --git a/web/apps/doprocess.app/components/layouts/ResizeHandle.tsx b/web/apps/doprocess.app/components/layouts/ResizeHandle.tsx index 1783b2225b..dbfe1ff2c9 100644 --- a/web/apps/doprocess.app/components/layouts/ResizeHandle.tsx +++ b/web/apps/doprocess.app/components/layouts/ResizeHandle.tsx @@ -1,8 +1,8 @@ 'use client'; import { ComponentProps, HTMLAttributes, MouseEventHandler, TouchEventHandler, forwardRef } from 'react'; -import { cx } from 'classix'; -import { Divider } from '@signalco/ui/dist/Divider'; +import { Divider } from '@signalco/ui/Divider'; +import { cx } from '@signalco/ui/cx'; export type ResizeHandleProps = HTMLAttributes & { onMouseDown: MouseEventHandler; diff --git a/web/apps/doprocess.app/components/layouts/Sidebar.tsx b/web/apps/doprocess.app/components/layouts/Sidebar.tsx index 9b9ef43adb..a8626a5443 100644 --- a/web/apps/doprocess.app/components/layouts/Sidebar.tsx +++ b/web/apps/doprocess.app/components/layouts/Sidebar.tsx @@ -2,11 +2,11 @@ import { useEffect, useMemo } from 'react'; import { usePathname } from 'next/navigation'; -import {cx} from 'classix'; import { FileText, ListChecks, Play, Right } from '@signalco/ui-icons'; -import { List } from '@signalco/ui/dist/List'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { ListItem } from '../shared/ListItem'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List } from '@signalco/ui/List'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; import { KnownPages } from '../../src/knownPages'; export function Sidebar({ open, onOpenChange }: { open: boolean, onOpenChange?: (open: boolean) => void }) { @@ -25,25 +25,28 @@ export function Sidebar({ open, onOpenChange }: { open: boolean, onOpenChange?: }, [links, onOpenChange, pathname]); return ( -
+
onOpenChange?.(!open)}> - + - + {links.map(({ href, label, Icon }) => ( } selected={pathname.startsWith(href)} /> diff --git a/web/apps/doprocess.app/components/layouts/SplitView.tsx b/web/apps/doprocess.app/components/layouts/SplitView.tsx index 4ddcd3627f..2c59903453 100644 --- a/web/apps/doprocess.app/components/layouts/SplitView.tsx +++ b/web/apps/doprocess.app/components/layouts/SplitView.tsx @@ -1,7 +1,7 @@ 'use client'; import { ReactNode } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { useResizeable } from '../../src/hooks/useResizeable'; import { ResizeHandle } from './ResizeHandle'; diff --git a/web/apps/doprocess.app/components/pages/Footer.tsx b/web/apps/doprocess.app/components/pages/Footer.tsx index 6998d9b459..2845ec4c5c 100644 --- a/web/apps/doprocess.app/components/pages/Footer.tsx +++ b/web/apps/doprocess.app/components/pages/Footer.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Container } from '@signalco/ui/dist/Container'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Container } from '@signalco/ui/Container'; import { isDeveloper } from '../../src/services/EnvProvider'; import { now } from '../../src/services/DateTimeProvider'; diff --git a/web/apps/doprocess.app/components/processes/documents/DocumentCreateForm.tsx b/web/apps/doprocess.app/components/processes/documents/DocumentCreateForm.tsx index 0923653a63..fce5aaf3c7 100644 --- a/web/apps/doprocess.app/components/processes/documents/DocumentCreateForm.tsx +++ b/web/apps/doprocess.app/components/processes/documents/DocumentCreateForm.tsx @@ -2,10 +2,10 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { Add } from '@signalco/ui-icons'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Input } from '@signalco/ui/dist/Input'; -import { Button } from '@signalco/ui/dist/Button'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { Input } from '@signalco/ui/Input'; +import { Button } from '@signalco/ui/Button'; import { KnownPages } from '../../../src/knownPages'; import { useDocumentCreate } from '../../../src/hooks/useDocumentCreate'; diff --git a/web/apps/doprocess.app/components/processes/documents/DocumentDeleteModal.tsx b/web/apps/doprocess.app/components/processes/documents/DocumentDeleteModal.tsx index df3879fd68..0306757235 100644 --- a/web/apps/doprocess.app/components/processes/documents/DocumentDeleteModal.tsx +++ b/web/apps/doprocess.app/components/processes/documents/DocumentDeleteModal.tsx @@ -1,7 +1,7 @@ 'use client'; import { useRouter } from 'next/navigation'; -import { ModalConfirm, ModalConfirmProps } from '@signalco/ui/dist/ModalConfirm'; +import { ModalConfirm, ModalConfirmProps } from '@signalco/ui/ModalConfirm'; import { useDocumentDelete } from '../../../src/hooks/useDocumentDelete'; import { DocumentDto } from '../../../app/api/dtos/dtos'; diff --git a/web/apps/doprocess.app/components/processes/documents/DocumentDetailsToolbar.tsx b/web/apps/doprocess.app/components/processes/documents/DocumentDetailsToolbar.tsx index 6ceb9994f3..1ebaf00f9c 100644 --- a/web/apps/doprocess.app/components/processes/documents/DocumentDetailsToolbar.tsx +++ b/web/apps/doprocess.app/components/processes/documents/DocumentDetailsToolbar.tsx @@ -1,12 +1,13 @@ 'use client'; import { useState } from 'react'; -import { cx } from 'classix'; -import { Delete, MoreHorizontal } from '@signalco/ui-icons'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; -import { IconButton } from '@signalco/ui/dist/IconButton'; +import { Delete, Embed, MoreHorizontal } from '@signalco/ui-icons'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/Menu'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; import { Toolbar } from '../../shared/Toolbar'; import { SavingIndicator } from '../../shared/SavingIndicator'; +import { EmbedModal } from '../../shared/EmbedModal'; import { KnownPages } from '../../../src/knownPages'; import { useDocument } from '../../../src/hooks/useDocument'; import { DocumentDeleteModal } from './DocumentDeleteModal'; @@ -19,6 +20,7 @@ type DocumentDetailsToolbarProps = { export function DocumentDetailsToolbar({ id, saving }: DocumentDetailsToolbarProps) { const { data: document } = useDocument(id); const [deleteModalOpen, setDeleteModalOpen] = useState(false); + const [embedOpen, setEmbedOpen] = useState(false); return ( <> @@ -35,6 +37,10 @@ export function DocumentDetailsToolbar({ id, saving }: DocumentDetailsToolbarPro + } onClick={() => setEmbedOpen(true)}> + Embed... + + } onClick={() => setDeleteModalOpen(true)}> Delete... @@ -48,6 +54,12 @@ export function DocumentDetailsToolbar({ id, saving }: DocumentDetailsToolbarPro onOpenChange={setDeleteModalOpen} redirect={KnownPages.Documents} /> )} + ); } diff --git a/web/apps/doprocess.app/components/processes/documents/DocumentEditor.tsx b/web/apps/doprocess.app/components/processes/documents/DocumentEditor.tsx index 64d5244877..edee24c167 100644 --- a/web/apps/doprocess.app/components/processes/documents/DocumentEditor.tsx +++ b/web/apps/doprocess.app/components/processes/documents/DocumentEditor.tsx @@ -1,7 +1,8 @@ 'use client'; import { useEffect, useRef, useState } from 'react'; -import { Loadable } from '@signalco/ui/dist/Loadable'; +import { showNotification } from '@signalco/ui-notifications'; +import { Loadable } from '@signalco/ui/Loadable'; import { useDebouncedEffect } from '@enterwell/react-hooks'; import { useDocumentUpdate } from '../../../src/hooks/useDocumentUpdate'; import { useDocument } from '../../../src/hooks/useDocument'; @@ -41,7 +42,7 @@ export function DocumentEditor({ id, editable, onSavingChange }: DocumentEditorP data: content }); } catch(err) { - // TODO: Show error notification + showNotification('Failed to save document', 'error'); } finally{ onSavingChange?.(false); } diff --git a/web/apps/doprocess.app/components/processes/documents/DocumentsListView.tsx b/web/apps/doprocess.app/components/processes/documents/DocumentsListView.tsx index 9782cce630..c0162b59bd 100644 --- a/web/apps/doprocess.app/components/processes/documents/DocumentsListView.tsx +++ b/web/apps/doprocess.app/components/processes/documents/DocumentsListView.tsx @@ -1,4 +1,4 @@ -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import { ListHeader } from '../../shared/ListHeader'; import { DocumentsList } from './DocumentsList'; diff --git a/web/apps/doprocess.app/components/processes/documents/TypographyDocumentName.tsx b/web/apps/doprocess.app/components/processes/documents/TypographyDocumentName.tsx index 73c36e6e80..c791c827c6 100644 --- a/web/apps/doprocess.app/components/processes/documents/TypographyDocumentName.tsx +++ b/web/apps/doprocess.app/components/processes/documents/TypographyDocumentName.tsx @@ -1,8 +1,8 @@ 'use client'; -import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/dist/TypographyEditable'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Loadable } from '@signalco/ui/dist/Loadable'; +import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/TypographyEditable'; +import { Typography } from '@signalco/ui/Typography'; +import { Loadable } from '@signalco/ui/Loadable'; import { useDocumentUpdate } from '../../../src/hooks/useDocumentUpdate'; import { useDocument } from '../../../src/hooks/useDocument'; diff --git a/web/apps/doprocess.app/components/processes/documents/editor/EditorSkeleton.tsx b/web/apps/doprocess.app/components/processes/documents/editor/EditorSkeleton.tsx index 6a9f549583..da750be21c 100644 --- a/web/apps/doprocess.app/components/processes/documents/editor/EditorSkeleton.tsx +++ b/web/apps/doprocess.app/components/processes/documents/editor/EditorSkeleton.tsx @@ -1,5 +1,5 @@ -import { Stack } from '@signalco/ui/dist/Stack'; -import { Skeleton } from '@signalco/ui/dist/Skeleton'; +import { Stack } from '@signalco/ui/Stack'; +import { Skeleton } from '@signalco/ui/Skeleton'; export function EditorSkeleton() { return ( diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx index dc7d063012..988acae11b 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessCreateForm.tsx @@ -3,10 +3,10 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { Add } from '@signalco/ui-icons'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Input } from '@signalco/ui/dist/Input'; -import { Button } from '@signalco/ui/dist/Button'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { Input } from '@signalco/ui/Input'; +import { Button } from '@signalco/ui/Button'; import { KnownPages } from '../../../src/knownPages'; import { useProcessCreate } from '../../../src/hooks/useProcessCreate'; diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx index 18697f08c9..a0c6763f53 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessDetails.tsx @@ -1,4 +1,4 @@ -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import { TaskList } from '../tasks/TaskList'; import { ProcessDetailsHeader } from './ProcessDetailsHeader'; diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx index f03de3a7e1..9d318fc9d6 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessDetailsHeader.tsx @@ -1,13 +1,15 @@ 'use client'; import { useState } from 'react'; -import { cx } from 'classix'; -import { Delete, ListChecks, MoreHorizontal, Play } from '@signalco/ui-icons'; -import { Skeleton } from '@signalco/ui/dist/Skeleton'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { IconButton } from '@signalco/ui/dist/IconButton'; +import { Delete, Embed, ListChecks, MoreHorizontal, Play } from '@signalco/ui-icons'; +import { Stack } from '@signalco/ui/Stack'; +import { Skeleton } from '@signalco/ui/Skeleton'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@signalco/ui/Menu'; +import { Loadable } from '@signalco/ui/Loadable'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; import { ListHeader } from '../../shared/ListHeader'; +import { EmbedModal } from '../../shared/EmbedModal'; import { KnownPages } from '../../../src/knownPages'; import { useProcess } from '../../../src/hooks/useProcess'; import { TypographyProcessRunName } from './TypographyProcessRunName'; @@ -24,6 +26,7 @@ export function ProcessDetailsHeader({ }) { const { data: process, isLoading: isLoadingProcess, error: errorProcess } = useProcess(processId); const [deleteOpen, setDeleteOpen] = useState(false); + const [embedOpen, setEmbedOpen] = useState(false); const isRun = Boolean(runId); @@ -33,6 +36,9 @@ export function ProcessDetailsHeader({ loadingLabel="Loading process details..." placeholder={} error={errorProcess}> + + Stack + : } header={isRun @@ -52,14 +58,15 @@ export function ProcessDetailsHeader({ + } onClick={() => setEmbedOpen(true)}> + Embed... + {!isRun && ( - <> - } href={KnownPages.ProcessRuns(processId)}> - View process runs - - - + } href={KnownPages.ProcessRuns(processId)}> + View process runs + )} + } onClick={() => setDeleteOpen(true)}> Delete... @@ -73,6 +80,14 @@ export function ProcessDetailsHeader({ open={deleteOpen} onOpenChange={setDeleteOpen} redirect={runId ? KnownPages.ProcessRuns(processId) : KnownPages.Processes} /> + ); } diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessOrRunDeleteModal.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessOrRunDeleteModal.tsx index a1ad7ecb84..aa488af160 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessOrRunDeleteModal.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessOrRunDeleteModal.tsx @@ -1,7 +1,7 @@ 'use client'; import { useRouter } from 'next/navigation'; -import { ModalConfirm, ModalConfirmProps } from '@signalco/ui/dist/ModalConfirm'; +import { ModalConfirm, ModalConfirmProps } from '@signalco/ui/ModalConfirm'; import { useProcessRunDelete } from '../../../src/hooks/useProcessRunDelete'; import { useProcessDelete } from '../../../src/hooks/useProcessDelete'; diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx index 5e09b252bc..68bafcf4cb 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateForm.tsx @@ -3,10 +3,10 @@ import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { Play } from '@signalco/ui-icons'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Input } from '@signalco/ui/dist/Input'; -import { Button } from '@signalco/ui/dist/Button'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Input } from '@signalco/ui/Input'; +import { Button } from '@signalco/ui/Button'; import { KnownPages } from '../../../src/knownPages'; import { useProcessRunCreate } from '../../../src/hooks/useProcessRunCreate'; import { useProcess } from '../../../src/hooks/useProcess'; diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx index f09ccf1b2c..34e28d394c 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessRunCreateModal.tsx @@ -1,12 +1,12 @@ 'use client'; import { Play } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Modal } from '@signalco/ui/dist/Modal'; -import { IconButton } from '@signalco/ui/dist/IconButton'; +import { Typography } from '@signalco/ui/Typography'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Modal } from '@signalco/ui/Modal'; +import { IconButton } from '@signalco/ui/IconButton'; import { ProcessRunCreateForm } from './ProcessRunCreateForm'; type ProcessRunCreateModalProps = { diff --git a/web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx b/web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx index afd96be588..fb1e86c78f 100644 --- a/web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx +++ b/web/apps/doprocess.app/components/processes/processes/ProcessesListView.tsx @@ -1,4 +1,4 @@ -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import { ListHeader } from '../../shared/ListHeader'; import { ProcessesList } from './ProcessesList'; diff --git a/web/apps/doprocess.app/components/processes/processes/RunsList.tsx b/web/apps/doprocess.app/components/processes/processes/RunsList.tsx index 4b361988b5..cebb87e7cb 100644 --- a/web/apps/doprocess.app/components/processes/processes/RunsList.tsx +++ b/web/apps/doprocess.app/components/processes/processes/RunsList.tsx @@ -1,9 +1,9 @@ 'use client'; import { Play } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; import { List } from '../../shared/List'; import { KnownPages } from '../../../src/knownPages'; import { useProcessRuns } from '../../../src/hooks/useProcessRuns'; diff --git a/web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx b/web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx index 3d3d609048..632cd60790 100644 --- a/web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx +++ b/web/apps/doprocess.app/components/processes/processes/RunsListItem.tsx @@ -1,5 +1,7 @@ import { ListChecks, Navigate, Play } from '@signalco/ui-icons'; -import { Row } from '@signalco/ui/dist/Row'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; import { ListItem } from '../../shared/ListItem'; import { KnownPages } from '../../../src/knownPages'; import { ProcessRunDto } from '../../../app/api/dtos/dtos'; @@ -12,16 +14,18 @@ export type RunsListItemProps = { export function RunsListItem({ run }: RunsListItemProps) { return ( } - endDecorator={( - + label={( + + {run.name} - - + + - - + + )} + startDecorator={} + endDecorator={( + )} className="group w-full" href={KnownPages.ProcessRun(run.processId, run.id)} /> diff --git a/web/apps/doprocess.app/components/processes/processes/RunsListView.tsx b/web/apps/doprocess.app/components/processes/processes/RunsListView.tsx index c31114d255..7c3d9d2293 100644 --- a/web/apps/doprocess.app/components/processes/processes/RunsListView.tsx +++ b/web/apps/doprocess.app/components/processes/processes/RunsListView.tsx @@ -1,8 +1,8 @@ 'use client'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { ListHeader } from '../../shared/ListHeader'; import { TypographyProcessName } from './TypographyProcessName'; import { RunsList } from './RunsList'; diff --git a/web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx b/web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx index f77f909f79..fb25756fb9 100644 --- a/web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx +++ b/web/apps/doprocess.app/components/processes/processes/TypographyProcessName.tsx @@ -1,8 +1,8 @@ 'use client'; -import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/dist/TypographyEditable'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Loadable } from '@signalco/ui/dist/Loadable'; +import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/TypographyEditable'; +import { Typography } from '@signalco/ui/Typography'; +import { Loadable } from '@signalco/ui/Loadable'; import { useProcessUpdate } from '../../../src/hooks/useProcessUpdate'; import { useProcess } from '../../../src/hooks/useProcess'; diff --git a/web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx b/web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx index 2ff69f8a0b..4cb618e023 100644 --- a/web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx +++ b/web/apps/doprocess.app/components/processes/processes/TypographyProcessRunName.tsx @@ -1,8 +1,8 @@ 'use client'; -import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/dist/TypographyEditable'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Loadable } from '@signalco/ui/dist/Loadable'; +import { TypographyEditable, TypographyEditableProps } from '@signalco/ui/TypographyEditable'; +import { Typography } from '@signalco/ui/Typography'; +import { Loadable } from '@signalco/ui/Loadable'; import { useProcessRunUpdate } from '../../../src/hooks/useProcessRunUpdate'; import { useProcessRun } from '../../../src/hooks/useProcessRun'; diff --git a/web/apps/doprocess.app/components/processes/tasks/TaskDeleteModal.tsx b/web/apps/doprocess.app/components/processes/tasks/TaskDeleteModal.tsx index 2a1a8f2826..b8a61e920f 100644 --- a/web/apps/doprocess.app/components/processes/tasks/TaskDeleteModal.tsx +++ b/web/apps/doprocess.app/components/processes/tasks/TaskDeleteModal.tsx @@ -1,7 +1,7 @@ 'use client'; -import { ModalConfirm, ModalConfirmProps } from '@signalco/ui/dist/ModalConfirm'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { ModalConfirm, ModalConfirmProps } from '@signalco/ui/ModalConfirm'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { useProcessTaskDefinitionDelete } from '../../../src/hooks/useProcessTaskDefinitionDelete'; import { ProcessTaskDefinitionDto } from '../../../app/api/dtos/dtos'; diff --git a/web/apps/doprocess.app/components/processes/tasks/TaskDetails.tsx b/web/apps/doprocess.app/components/processes/tasks/TaskDetails.tsx index ca90af0389..e4b14e8d95 100644 --- a/web/apps/doprocess.app/components/processes/tasks/TaskDetails.tsx +++ b/web/apps/doprocess.app/components/processes/tasks/TaskDetails.tsx @@ -2,16 +2,16 @@ import { useState } from 'react'; import dynamic from 'next/dynamic'; -import { cx } from 'classix'; import { Empty, FileText } from '@signalco/ui-icons'; -import { TypographyEditable } from '@signalco/ui/dist/TypographyEditable'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Skeleton } from '@signalco/ui/dist/Skeleton'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { Link } from '@signalco/ui/dist/Link'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { TypographyEditable } from '@signalco/ui/TypographyEditable'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Skeleton } from '@signalco/ui/Skeleton'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { TypographyDocumentName } from '../documents/TypographyDocumentName'; import { EditorSkeleton } from '../documents/editor/EditorSkeleton'; import { KnownPages } from '../../../src/knownPages'; diff --git a/web/apps/doprocess.app/components/processes/tasks/TaskDetailsToolbar.tsx b/web/apps/doprocess.app/components/processes/tasks/TaskDetailsToolbar.tsx index 6884c7ccc1..fc8ab5ba19 100644 --- a/web/apps/doprocess.app/components/processes/tasks/TaskDetailsToolbar.tsx +++ b/web/apps/doprocess.app/components/processes/tasks/TaskDetailsToolbar.tsx @@ -1,10 +1,10 @@ 'use client'; import { useState } from 'react'; -import { cx } from 'classix'; import { Delete, MoreHorizontal } from '@signalco/ui-icons'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@signalco/ui/dist/Menu'; -import { IconButton } from '@signalco/ui/dist/IconButton'; +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@signalco/ui/Menu'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; import { Toolbar } from '../../shared/Toolbar'; import { SavingIndicator } from '../../shared/SavingIndicator'; import { useProcessTaskDefinition } from '../../../src/hooks/useProcessTaskDefinition'; diff --git a/web/apps/doprocess.app/components/processes/tasks/TaskDetailsTypePicker.tsx b/web/apps/doprocess.app/components/processes/tasks/TaskDetailsTypePicker.tsx index 8b8be0f393..a99fbe1d7c 100644 --- a/web/apps/doprocess.app/components/processes/tasks/TaskDetailsTypePicker.tsx +++ b/web/apps/doprocess.app/components/processes/tasks/TaskDetailsTypePicker.tsx @@ -1,8 +1,8 @@ 'use client'; import { Empty, FileInput, FileText } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Card, CardContent } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import { Card, CardContent } from '@signalco/ui/Card'; import { useProcessTaskDefinitionUpdate } from '../../../src/hooks/useProcessTaskDefinitionUpdate'; export default function TaskDetailsTypePicker({ processId, taskDefinitionId }: { processId: string, taskDefinitionId: string }) { diff --git a/web/apps/doprocess.app/components/processes/tasks/TaskList.tsx b/web/apps/doprocess.app/components/processes/tasks/TaskList.tsx index a36341daf2..d022cfbb7e 100644 --- a/web/apps/doprocess.app/components/processes/tasks/TaskList.tsx +++ b/web/apps/doprocess.app/components/processes/tasks/TaskList.tsx @@ -1,12 +1,12 @@ 'use client'; import { useMemo } from 'react'; -import { NoDataPlaceholder } from '@signalco/ui/dist/NoDataPlaceholder'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { List } from '@signalco/ui/dist/List'; +import { NoDataPlaceholder } from '@signalco/ui/NoDataPlaceholder'; +import { Loadable } from '@signalco/ui/Loadable'; +import { List } from '@signalco/ui/List'; import { lexinsert } from '@signalco/lexorder'; import { orderBy } from '@signalco/js'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { SortableContext, arrayMove, verticalListSortingStrategy } from '@dnd-kit/sortable'; import { DndContext, DragEndEvent } from '@dnd-kit/core'; import { ListSkeleton } from '../../shared/ListSkeleton'; diff --git a/web/apps/doprocess.app/components/processes/tasks/TaskListItem.tsx b/web/apps/doprocess.app/components/processes/tasks/TaskListItem.tsx index a9ea6e7e1c..0c06607f01 100644 --- a/web/apps/doprocess.app/components/processes/tasks/TaskListItem.tsx +++ b/web/apps/doprocess.app/components/processes/tasks/TaskListItem.tsx @@ -1,13 +1,13 @@ 'use client'; -import { cx } from 'classix'; import { Delete, Drag } from '@signalco/ui-icons'; -import { TypographyEditable } from '@signalco/ui/dist/TypographyEditable'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Row } from '@signalco/ui/dist/Row'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Checkbox } from '@signalco/ui/dist/Checkbox'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { TypographyEditable } from '@signalco/ui/TypographyEditable'; +import { Typography } from '@signalco/ui/Typography'; +import { Row } from '@signalco/ui/Row'; +import { IconButton } from '@signalco/ui/IconButton'; +import { cx } from '@signalco/ui/cx'; +import { Checkbox } from '@signalco/ui/Checkbox'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { CSS } from '@dnd-kit/utilities'; import { useSortable } from '@dnd-kit/sortable'; import { ListItem } from '../../shared/ListItem'; diff --git a/web/apps/doprocess.app/components/providers/ClientProvider.tsx b/web/apps/doprocess.app/components/providers/ClientProvider.tsx index b77d40946d..3a4f2f4e17 100644 --- a/web/apps/doprocess.app/components/providers/ClientProvider.tsx +++ b/web/apps/doprocess.app/components/providers/ClientProvider.tsx @@ -1,15 +1,22 @@ 'use client'; import { PropsWithChildren } from 'react'; -import { ThemeProvider } from 'next-themes'; +import { ThemeProvider, useTheme } from 'next-themes'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { NotificationsContainer } from '@signalco/ui-notifications'; const queryClient = new QueryClient(); +function ThemedNotificationsContainer() { + const { resolvedTheme } = useTheme(); + return ; +} + export function ClientProvider({children}: PropsWithChildren) { return ( + {children} diff --git a/web/apps/doprocess.app/components/shared/EmbedModal.tsx b/web/apps/doprocess.app/components/shared/EmbedModal.tsx new file mode 100644 index 0000000000..edf36f3809 --- /dev/null +++ b/web/apps/doprocess.app/components/shared/EmbedModal.tsx @@ -0,0 +1,38 @@ +'use client'; +import { showNotification } from '@signalco/ui-notifications'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Modal } from '@signalco/ui/Modal'; +import { Button } from '@signalco/ui/Button'; + +export function EmbedModal({ + header, subHeader, src, open, onOpenChange +}: { + header: React.ReactNode; + subHeader: React.ReactNode; + src: string; + open: boolean; + onOpenChange: (open: boolean) => void; +}) { + const code = ``; + + const handleCopy = () => { + navigator.clipboard.writeText(code); + showNotification('Code copied to clipboard', 'info'); + }; + + return ( + + + {header} + {subHeader} +
+ + {code} + +
+ +
+
+ ); +} diff --git a/web/apps/doprocess.app/components/shared/List.tsx b/web/apps/doprocess.app/components/shared/List.tsx index bdae1a5a4b..ee3b467006 100644 --- a/web/apps/doprocess.app/components/shared/List.tsx +++ b/web/apps/doprocess.app/components/shared/List.tsx @@ -3,13 +3,13 @@ import { Fragment, ReactElement, ReactNode, useState } from 'react'; import { type UseQueryResult } from '@tanstack/react-query'; import { Add } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Modal } from '@signalco/ui/dist/Modal'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ListItem } from '@signalco/ui/dist/ListItem'; -import { List as UIList } from '@signalco/ui/dist/List'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Modal } from '@signalco/ui/Modal'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ListItem } from '@signalco/ui/ListItem'; +import { List as UIList } from '@signalco/ui/List'; import { ListSkeleton } from './ListSkeleton'; import { ListItemCreate } from './ListItemCreate'; diff --git a/web/apps/doprocess.app/components/shared/ListHeader.tsx b/web/apps/doprocess.app/components/shared/ListHeader.tsx index d096b42f49..f3ed38e51e 100644 --- a/web/apps/doprocess.app/components/shared/ListHeader.tsx +++ b/web/apps/doprocess.app/components/shared/ListHeader.tsx @@ -1,7 +1,7 @@ import { Fragment, type ReactNode } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; type ListHeaderProps = { header: ReactNode | string | undefined; diff --git a/web/apps/doprocess.app/components/shared/ListItem.tsx b/web/apps/doprocess.app/components/shared/ListItem.tsx index 21e2b5248e..32f2e7b4e7 100644 --- a/web/apps/doprocess.app/components/shared/ListItem.tsx +++ b/web/apps/doprocess.app/components/shared/ListItem.tsx @@ -1,5 +1,5 @@ -import { cx } from 'classix'; -import { ListItem as UiListItem, type ListItemProps } from '@signalco/ui/dist/ListItem'; +import { ListItem as UiListItem, type ListItemProps } from '@signalco/ui/ListItem'; +import { cx } from '@signalco/ui/cx'; export function ListItem({ className, ...rest }: ListItemProps) { return ( diff --git a/web/apps/doprocess.app/components/shared/ListItemCreate.tsx b/web/apps/doprocess.app/components/shared/ListItemCreate.tsx index ac21701642..f9382158f3 100644 --- a/web/apps/doprocess.app/components/shared/ListItemCreate.tsx +++ b/web/apps/doprocess.app/components/shared/ListItemCreate.tsx @@ -1,6 +1,6 @@ import { Add } from '@signalco/ui-icons'; -import { Spinner } from '@signalco/ui/dist/Spinner'; -import { type ListItemProps } from '@signalco/ui/dist/ListItem'; +import { Spinner } from '@signalco/ui/Spinner'; +import { type ListItemProps } from '@signalco/ui/ListItem'; import { ListItem } from './ListItem'; export function ListItemCreate({ loading, label, onSelected }: Required> & { loading?: boolean }) { diff --git a/web/apps/doprocess.app/components/shared/ListSkeleton.tsx b/web/apps/doprocess.app/components/shared/ListSkeleton.tsx index aac4fafe91..3bba77b39d 100644 --- a/web/apps/doprocess.app/components/shared/ListSkeleton.tsx +++ b/web/apps/doprocess.app/components/shared/ListSkeleton.tsx @@ -1,5 +1,5 @@ -import { Stack } from '@signalco/ui/dist/Stack'; -import { Skeleton } from '@signalco/ui/dist/Skeleton'; +import { Stack } from '@signalco/ui/Stack'; +import { Skeleton } from '@signalco/ui/Skeleton'; export function ListSkeleton({ itemsCount = 5, itemClassName = 'h-5 w-full', spacing = 1 }: { itemsCount?: number; itemClassName?: string; spacing?: number; }) { return ( diff --git a/web/apps/doprocess.app/components/shared/SavingIndicator.tsx b/web/apps/doprocess.app/components/shared/SavingIndicator.tsx index c780b5c231..3a6215f302 100644 --- a/web/apps/doprocess.app/components/shared/SavingIndicator.tsx +++ b/web/apps/doprocess.app/components/shared/SavingIndicator.tsx @@ -1,7 +1,7 @@ 'use client'; import { useEffect, useState } from 'react'; -import { cx } from 'classix'; import { Check } from '@signalco/ui-icons'; +import { cx } from '@signalco/ui/cx'; type SavingIndicatorProps = { saving?: boolean; diff --git a/web/apps/doprocess.app/components/shared/Toolbar.tsx b/web/apps/doprocess.app/components/shared/Toolbar.tsx index 1f720f63ed..41a467d983 100644 --- a/web/apps/doprocess.app/components/shared/Toolbar.tsx +++ b/web/apps/doprocess.app/components/shared/Toolbar.tsx @@ -1,6 +1,6 @@ import { type HTMLAttributes } from 'react'; -import { cx } from 'classix'; -import { Row } from '@signalco/ui/dist/Row'; +import { Row } from '@signalco/ui/Row'; +import { cx } from '@signalco/ui/cx'; export type ToolbarProps = HTMLAttributes; diff --git a/web/apps/doprocess.app/next.config.mjs b/web/apps/doprocess.app/next.config.js similarity index 96% rename from web/apps/doprocess.app/next.config.mjs rename to web/apps/doprocess.app/next.config.js index 616345e8b0..f643c5b176 100644 --- a/web/apps/doprocess.app/next.config.mjs +++ b/web/apps/doprocess.app/next.config.js @@ -3,7 +3,7 @@ import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD, } from 'next/constants.js'; -import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data'; +import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data/node'; import nextBundleAnalyzer from '@next/bundle-analyzer'; const isDevelopment = process.env.NODE_ENV === 'development'; @@ -53,7 +53,7 @@ const nextConfigFunction = async (phase) => { dest: 'public', buildExcludes: [/middleware-manifest.json$/, /chunks\/images\/.*$/], dynamicStartUrl: false, - disable: isDevelopment + disable: isDevelopment, }); return withPWA(componsedNextConfig); } diff --git a/web/apps/doprocess.app/package.json b/web/apps/doprocess.app/package.json index 3c5d047099..38c8670b0d 100644 --- a/web/apps/doprocess.app/package.json +++ b/web/apps/doprocess.app/package.json @@ -4,6 +4,7 @@ "homepage": "https://doprocess.app/", "version": "1.0.0", "private": true, + "type": "module", "engines": { "node": "18.x" }, @@ -36,6 +37,7 @@ "@signalco/lexorder": "workspace:*", "@signalco/tailwindcss-config-signalco": "workspace:*", "@signalco/ui": "workspace:*", + "@signalco/ui-notifications": "workspace:*", "@signalco/ui-icons": "workspace:*", "@tanstack/react-query": "5.8.4", "@vercel/analytics": "1.1.1", @@ -63,9 +65,9 @@ "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", "@types/color": "3.0.6", - "@types/node": "18.18.9", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/node": "18.18.11", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "cross-env": "7.0.3", "dotenv": "16.3.1", "drizzle-kit": "0.20.4", @@ -74,7 +76,7 @@ "postcss": "8.4.31", "rimraf": "5.0.5", "sass": "1.69.5", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "nextBundleAnalysis": { "budget": 358400, diff --git a/web/apps/doprocess.app/playwright.config.ts b/web/apps/doprocess.app/playwright.config.ts index 7f8d8e8cc0..da4743fd83 100644 --- a/web/apps/doprocess.app/playwright.config.ts +++ b/web/apps/doprocess.app/playwright.config.ts @@ -1,6 +1,8 @@ import path from 'path' import type { PlaywrightTestConfig } from '@playwright/test'; import { devices } from '@playwright/test'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; const PORT = process.env.PORT || 4003 const baseURL = `http://127.0.0.1:${PORT}` @@ -8,7 +10,7 @@ const baseURL = `http://127.0.0.1:${PORT}` const config: PlaywrightTestConfig = { retries: 2, timeout: 30 * 1000, - testDir: path.join(__dirname, 'e2e'), + testDir: path.join(dirname(fileURLToPath(import.meta.url)), 'e2e'), outputDir: 'test-results/', webServer: { command: 'pnpm start', diff --git a/web/apps/slco/postcss.config.js b/web/apps/doprocess.app/postcss.config.cjs similarity index 100% rename from web/apps/slco/postcss.config.js rename to web/apps/doprocess.app/postcss.config.cjs diff --git a/web/apps/doprocess.app/src/hooks/useDocument.ts b/web/apps/doprocess.app/src/hooks/useDocument.ts index 9dd190b717..725e641c36 100644 --- a/web/apps/doprocess.app/src/hooks/useDocument.ts +++ b/web/apps/doprocess.app/src/hooks/useDocument.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { type UseQueryResult, useQuery } from '@tanstack/react-query'; import { DocumentDto } from '../../app/api/dtos/dtos'; import { documentsKey } from './useDocuments'; @@ -13,7 +13,7 @@ async function fetchGetDocument(id: string) { return await response.json() as DocumentDto | undefined; } -export function useDocument(id?: string) { +export function useDocument(id?: string): UseQueryResult { return useQuery({ queryKey: documentKey(id), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useDocumentCreate.ts b/web/apps/doprocess.app/src/hooks/useDocumentCreate.ts index 357f03613e..c06c742e1d 100644 --- a/web/apps/doprocess.app/src/hooks/useDocumentCreate.ts +++ b/web/apps/doprocess.app/src/hooks/useDocumentCreate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { documentsKey } from './useDocuments'; type DocumentCreateArgs = { @@ -13,7 +13,9 @@ async function fetchPostDocument(data: object) { return await response.json() as { id: string } | undefined; } -export function useDocumentCreate() { +export function useDocumentCreate(): UseMutationResult<{ + id: string; +} | undefined, Error, DocumentCreateArgs, unknown> { const client = useQueryClient(); return useMutation({ mutationFn: ({ name }: DocumentCreateArgs) => fetchPostDocument(({ name })), diff --git a/web/apps/doprocess.app/src/hooks/useDocumentDelete.ts b/web/apps/doprocess.app/src/hooks/useDocumentDelete.ts index 5e0ddacddc..ac0d2604af 100644 --- a/web/apps/doprocess.app/src/hooks/useDocumentDelete.ts +++ b/web/apps/doprocess.app/src/hooks/useDocumentDelete.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { documentsKey } from './useDocuments'; type DocumentDeleteArgs = { @@ -11,7 +11,7 @@ async function fetchDeleteDocumentAsync(id: string) { }); } -export function useDocumentDelete() { +export function useDocumentDelete(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ id }: DocumentDeleteArgs) => fetchDeleteDocumentAsync(id), diff --git a/web/apps/doprocess.app/src/hooks/useDocumentUpdate.ts b/web/apps/doprocess.app/src/hooks/useDocumentUpdate.ts index 76b873be62..3cc4abc288 100644 --- a/web/apps/doprocess.app/src/hooks/useDocumentUpdate.ts +++ b/web/apps/doprocess.app/src/hooks/useDocumentUpdate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { documentsKey } from './useDocuments'; import { documentKey } from './useDocument'; @@ -15,7 +15,7 @@ async function fetchPutDocument(id: string, data: object) { }); } -export function useDocumentUpdate() { +export function useDocumentUpdate(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ id, ...rest }: DocumentUpdateArgs) => fetchPutDocument(id, ({ id, ...rest })), diff --git a/web/apps/doprocess.app/src/hooks/useDocuments.ts b/web/apps/doprocess.app/src/hooks/useDocuments.ts index be3e521523..2861e150aa 100644 --- a/web/apps/doprocess.app/src/hooks/useDocuments.ts +++ b/web/apps/doprocess.app/src/hooks/useDocuments.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { DocumentDto } from '../../app/api/dtos/dtos'; export function documentsKey() { @@ -10,7 +10,7 @@ async function fetchGetDocuments() { return await response.json() as DocumentDto[] | undefined; } -export function useDocuments() { +export function useDocuments(): UseQueryResult { return useQuery({ queryKey: documentsKey(), queryFn: fetchGetDocuments, diff --git a/web/apps/doprocess.app/src/hooks/useProcess.ts b/web/apps/doprocess.app/src/hooks/useProcess.ts index 47e8ec4fdd..8f71e96152 100644 --- a/web/apps/doprocess.app/src/hooks/useProcess.ts +++ b/web/apps/doprocess.app/src/hooks/useProcess.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessDto } from '../../app/api/dtos/dtos'; import { processesKey } from './useProcesses'; @@ -15,7 +15,7 @@ async function fetchGetProcess(id: string) { return await response.json() as ProcessDto | undefined; } -export function useProcess(id?: string) { +export function useProcess(id?: string): UseQueryResult { return useQuery({ queryKey: processKey(id), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useProcessCreate.ts b/web/apps/doprocess.app/src/hooks/useProcessCreate.ts index 19c8a7c4f8..3321c9ac60 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessCreate.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessCreate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processesKey } from './useProcesses'; type ProcessCreateArgs = { @@ -13,7 +13,9 @@ async function fetchPostProcess(data: object) { return await response.json() as { id: string } | undefined; } -export function useProcessCreate() { +export function useProcessCreate(): UseMutationResult<{ + id: string; +} | undefined, Error, ProcessCreateArgs, unknown> { const client = useQueryClient(); return useMutation({ mutationFn: ({ name }: ProcessCreateArgs) => fetchPostProcess(({ name })), diff --git a/web/apps/doprocess.app/src/hooks/useProcessDelete.ts b/web/apps/doprocess.app/src/hooks/useProcessDelete.ts index 6c8fe71c73..f86234421c 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessDelete.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessDelete.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processesKey } from './useProcesses'; type ProcessDeleteArgs = { @@ -11,7 +11,7 @@ async function fetchDeleteProcessAsync(id: string) { }); } -export function useProcessDelete() { +export function useProcessDelete(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId: id }: ProcessDeleteArgs) => fetchDeleteProcessAsync(id), diff --git a/web/apps/doprocess.app/src/hooks/useProcessRun.ts b/web/apps/doprocess.app/src/hooks/useProcessRun.ts index 34e0093555..8412aa7de0 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRun.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRun.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessRunDto } from '../../app/api/dtos/dtos'; import { processRunsKey } from './useProcessRuns'; @@ -15,7 +15,7 @@ async function fetchGetProcessRun(processId: string, runId: string) { return await response.json() as ProcessRunDto | undefined; } -export function useProcessRun(processId?: string, runId?: string) { +export function useProcessRun(processId?: string, runId?: string): UseQueryResult { return useQuery({ queryKey: processRunKey(processId, runId), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useProcessRunCreate.ts b/web/apps/doprocess.app/src/hooks/useProcessRunCreate.ts index bd03adb75d..76b84d86c7 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRunCreate.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRunCreate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processKey } from './useProcess'; type ProcessRunCreateArgs = { @@ -14,7 +14,9 @@ async function fetchPostProcessRun(processId: string, data: object) { return await response.json() as { id: string } | undefined; } -export function useProcessRunCreate() { +export function useProcessRunCreate(): UseMutationResult<{ + id: string; +} | undefined, Error, ProcessRunCreateArgs, unknown> { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, ...rest }: ProcessRunCreateArgs) => fetchPostProcessRun(processId, rest), diff --git a/web/apps/doprocess.app/src/hooks/useProcessRunDelete.ts b/web/apps/doprocess.app/src/hooks/useProcessRunDelete.ts index cfaf75d24a..1f3a8b8449 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRunDelete.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRunDelete.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processRunsKey } from './useProcessRuns'; type ProcessRunDeleteArgs = { @@ -12,7 +12,7 @@ async function fetchDeleteProcessAsync(processId: string, runId: string) { }); } -export function useProcessRunDelete() { +export function useProcessRunDelete(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, runId }: ProcessRunDeleteArgs) => fetchDeleteProcessAsync(processId, runId), diff --git a/web/apps/doprocess.app/src/hooks/useProcessRunTaskUpsert.ts b/web/apps/doprocess.app/src/hooks/useProcessRunTaskUpsert.ts index 5e55916ca3..3ff0c2b082 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRunTaskUpsert.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRunTaskUpsert.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { handleArrayOptimisticUpdate } from '../helpers/queryHelpers'; import { tasksKey } from './useProcessRunTasks'; @@ -16,7 +16,9 @@ async function fetchPostProcessRunTask(processId: string, runId: string, data: o }); } -export function useProcessRunTaskUpsert() { +export function useProcessRunTaskUpsert(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, runId, ...rest }: TaskCreateArgs) => fetchPostProcessRunTask(processId, runId, { processId, runId, ...rest }), diff --git a/web/apps/doprocess.app/src/hooks/useProcessRunTasks.ts b/web/apps/doprocess.app/src/hooks/useProcessRunTasks.ts index 81fada1e2a..362b99b218 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRunTasks.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRunTasks.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessRunTaskDto } from '../../app/api/dtos/dtos'; import { processRunKey } from './useProcessRun'; @@ -19,7 +19,7 @@ async function fetchGetProcessRunTasks(processId: string, runId: string) { return await response.json() as ProcessRunTaskDto[] | undefined; } -export function useProcessRunTasks(processId?: string, runId?: string) { +export function useProcessRunTasks(processId?: string, runId?: string): UseQueryResult { return useQuery({ queryKey: tasksKey(processId, runId), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useProcessRunUpdate.ts b/web/apps/doprocess.app/src/hooks/useProcessRunUpdate.ts index b6857e47cd..4009f56029 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRunUpdate.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRunUpdate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processRunsKey } from './useProcessRuns'; import { processRunKey } from './useProcessRun'; @@ -15,7 +15,7 @@ async function fetchPutProcessRun(processId: string, runId: string, data: object }); } -export function useProcessRunUpdate() { +export function useProcessRunUpdate(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, runId, name }: ProcessRunUpdateArgs) => fetchPutProcessRun(processId, runId, ({ processId, runId, name })), diff --git a/web/apps/doprocess.app/src/hooks/useProcessRuns.ts b/web/apps/doprocess.app/src/hooks/useProcessRuns.ts index 25943022b8..84b5edfefa 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessRuns.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessRuns.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessRunDto } from '../../app/api/dtos/dtos'; import { processKey } from './useProcess'; @@ -13,7 +13,7 @@ async function fetchGetProcessRuns(processId: string) { return await response.json() as ProcessRunDto[] | undefined; } -export function useProcessRuns(processId?: string) { +export function useProcessRuns(processId?: string): UseQueryResult { return useQuery({ queryKey: processRunsKey(processId), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinition.ts b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinition.ts index 08dcbd5d4a..920b2a5981 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinition.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinition.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessTaskDefinitionDto } from '../../app/api/dtos/dtos'; import { processTaskDefinitionsKey } from './useProcessTaskDefinitions'; @@ -13,7 +13,8 @@ async function fetchGetProcessTaskDefinition(processId: string, taskDefinitionId return await response.json() as ProcessTaskDefinitionDto | undefined; } -export function useProcessTaskDefinition(processId?: string, taskDefinitionId?: string) { +export function useProcessTaskDefinition(processId?: string, taskDefinitionId?: string): + UseQueryResult { return useQuery({ queryKey: processTaskDefinitionKey(processId, taskDefinitionId), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionCreate.ts b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionCreate.ts index e08bc2b90c..eec99f87d9 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionCreate.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionCreate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processTaskDefinitionsKey } from './useProcessTaskDefinitions'; type TaskDefinitionCreateArgs = { @@ -14,7 +14,9 @@ async function fetchPostProcessTaskDefinition(processId: string, data: object) { return await response.json() as { id: string } | undefined; } -export function useProcessTaskDefinitionCreate() { +export function useProcessTaskDefinitionCreate(): UseMutationResult<{ + id: string; +} | undefined, Error, TaskDefinitionCreateArgs, unknown> { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, ...rest }: TaskDefinitionCreateArgs) => fetchPostProcessTaskDefinition(processId, rest), diff --git a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionDelete.ts b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionDelete.ts index 5cf350faed..51d9490083 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionDelete.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionDelete.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processTaskDefinitionsKey } from './useProcessTaskDefinitions'; type ProcessTaskDefinitionDeleteArgs = { @@ -12,7 +12,7 @@ async function fetchDeleteProcessTaskDefinitionAsync(processId: string, taskDefi }); } -export function useProcessTaskDefinitionDelete() { +export function useProcessTaskDefinitionDelete(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, taskDefinitionId }: ProcessTaskDefinitionDeleteArgs) => fetchDeleteProcessTaskDefinitionAsync(processId, taskDefinitionId), diff --git a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionUpdate.ts b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionUpdate.ts index 278fba011c..f274091049 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionUpdate.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitionUpdate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { handleArrayOptimisticUpdate, handleOptimisticUpdate } from '../helpers/queryHelpers'; import { ProcessTaskDefinitionDto } from '../../app/api/dtos/dtos'; import { processTaskDefinitionsKey } from './useProcessTaskDefinitions'; @@ -20,7 +20,11 @@ async function fetchPutProcessTaskDefinition(processId: string, taskDefinitionId }); } -export function useProcessTaskDefinitionUpdate() { +export function useProcessTaskDefinitionUpdate(): UseMutationResult +{ const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, taskDefinitionId, ...rest }: TaskDefinitionUpdateArgs) => fetchPutProcessTaskDefinition(processId, taskDefinitionId, { diff --git a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitions.ts b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitions.ts index 447bbc207f..6bd195dfad 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitions.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessTaskDefinitions.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessTaskDefinitionDto } from '../../app/api/dtos/dtos'; import { processKey } from './useProcess'; @@ -13,7 +13,7 @@ async function fetchGetProcess(processId: string) { return await response.json() as ProcessTaskDefinitionDto[] | undefined; } -export function useProcessTaskDefinitions(processId?: string) { +export function useProcessTaskDefinitions(processId?: string): UseQueryResult { return useQuery({ queryKey: processTaskDefinitionsKey(processId), queryFn: async () => { diff --git a/web/apps/doprocess.app/src/hooks/useProcessUpdate.ts b/web/apps/doprocess.app/src/hooks/useProcessUpdate.ts index 02eb4aaf5d..0209422181 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessUpdate.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessUpdate.ts @@ -1,4 +1,4 @@ -import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { UseMutationResult, useMutation, useQueryClient } from '@tanstack/react-query'; import { processesKey } from './useProcesses'; import { processKey } from './useProcess'; @@ -14,7 +14,7 @@ async function fetchPutProcess(processId: string, data: object) { }); } -export function useProcessUpdate() { +export function useProcessUpdate(): UseMutationResult { const client = useQueryClient(); return useMutation({ mutationFn: ({ processId, name }: ProcessUpdateArgs) => fetchPutProcess(processId, ({ processId, name })), diff --git a/web/apps/doprocess.app/src/hooks/useProcesses.ts b/web/apps/doprocess.app/src/hooks/useProcesses.ts index 078bf123ec..a4487aa88f 100644 --- a/web/apps/doprocess.app/src/hooks/useProcesses.ts +++ b/web/apps/doprocess.app/src/hooks/useProcesses.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessDto } from '../../app/api/dtos/dtos'; export function processesKey() { @@ -10,7 +10,7 @@ async function fetchGetProcesses() { return await response.json() as ProcessDto[] | undefined; } -export function useProcesses() { +export function useProcesses(): UseQueryResult { return useQuery({ queryKey: processesKey(), queryFn: fetchGetProcesses, diff --git a/web/apps/doprocess.app/src/hooks/useProcessesRuns.ts b/web/apps/doprocess.app/src/hooks/useProcessesRuns.ts index 89cc63ced1..706f621dda 100644 --- a/web/apps/doprocess.app/src/hooks/useProcessesRuns.ts +++ b/web/apps/doprocess.app/src/hooks/useProcessesRuns.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { UseQueryResult, useQuery } from '@tanstack/react-query'; import { ProcessRunDto } from '../../app/api/dtos/dtos'; export function processesRunsKey() { @@ -10,7 +10,7 @@ async function fetchGetProcessesRuns() { return await response.json() as ProcessRunDto[] | undefined; } -export function useProcessesRuns(enabled?: boolean) { +export function useProcessesRuns(enabled?: boolean): UseQueryResult { return useQuery({ queryKey: processesRunsKey(), queryFn: fetchGetProcessesRuns, diff --git a/web/apps/doprocess.app/src/hooks/useResizeable.tsx b/web/apps/doprocess.app/src/hooks/useResizeable.tsx index b604292d10..db567a93c1 100644 --- a/web/apps/doprocess.app/src/hooks/useResizeable.tsx +++ b/web/apps/doprocess.app/src/hooks/useResizeable.tsx @@ -43,9 +43,11 @@ export function useResizeable({ }; const handleTouchMove = (event: TouchEvent) => { - handleMove(direction === 'vertical' - ? event.touches[0].clientX - : event.touches[0].clientY); + if (event.touches[0]) { + handleMove(direction === 'vertical' + ? event.touches[0].clientX + : event.touches[0].clientY); + } }; const handleMouseMove = (event: MouseEvent) => { diff --git a/web/apps/doprocess.app/tailwind.config.cjs b/web/apps/doprocess.app/tailwind.config.cjs index 0d40ba909e..84b3ba102d 100644 --- a/web/apps/doprocess.app/tailwind.config.cjs +++ b/web/apps/doprocess.app/tailwind.config.cjs @@ -6,6 +6,7 @@ export default { presets: [baseConfig], content: [ './app/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}' + './components/**/*.{ts,tsx}', + "../../packages/ui/src/**/*.{ts,tsx}" ] } diff --git a/web/apps/doprocess.app/tsconfig.json b/web/apps/doprocess.app/tsconfig.json index 7e651d41e4..6f1b11c13b 100644 --- a/web/apps/doprocess.app/tsconfig.json +++ b/web/apps/doprocess.app/tsconfig.json @@ -1,22 +1,22 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@signalco/tsconfig/web.json", - "compilerOptions": { - "outDir": "dist", - "plugins": [ - { - "name": "next" - } + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@signalco/tsconfig/web.json", + "compilerOptions": { + "plugins": [ + { + "name": "next" + } + ] + }, + "exclude": [ + "node_modules", + "worker" + ], + "include": [ + "next-env.d.ts", + "next.config.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" ] - }, - "include": [ - "src", - "app", - "components", - "pages", - "next-env.d.ts", - "@types", - ".next/types/**/*.ts", - "C:\\Users\\aleks\\Documents\\GitHub\\signalco\\web\\apps\\doprocess.app\\.next/types/**/*.ts" - ] } diff --git a/web/apps/slco/.eslintrc.js b/web/apps/slco/.eslintrc.cjs similarity index 100% rename from web/apps/slco/.eslintrc.js rename to web/apps/slco/.eslintrc.cjs diff --git a/web/apps/slco/app/error.tsx b/web/apps/slco/app/error.tsx index a36a28d72f..0f75557390 100644 --- a/web/apps/slco/app/error.tsx +++ b/web/apps/slco/app/error.tsx @@ -1,11 +1,11 @@ 'use client'; import { useEffect } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Button } from '@signalco/ui/Button'; type RootErrorProps = { error: Error; diff --git a/web/apps/brandgrab/app/global.scss b/web/apps/slco/app/global.css similarity index 61% rename from web/apps/brandgrab/app/global.scss rename to web/apps/slco/app/global.css index a3789cceab..dc369d9e3f 100644 --- a/web/apps/brandgrab/app/global.scss +++ b/web/apps/slco/app/global.css @@ -1,7 +1,4 @@ -* { box-sizing: border-box; } - -// Custom normalize -h6 { margin: 0 }; +@import "@signalco/ui/index.css"; @font-face { font-family: 'Material Icons'; @@ -41,37 +38,3 @@ html, body, #__next { /* Support for IE. */ font-feature-settings: 'liga'; } - -@layer base { - :root { - --bg-selection: #000; - --text-selection: #fff; - } - - .dark { - --bg-selection: #fff; - --text-selection: #000; - } - - ::selection { background: var(--bg-selection); color: var(--text-selection); } -} - -.image--light { - display: var(--light-display); -} - -.image--dark { - display: var(--dark-display); -} - -h6 { - font-size: 1.2em; - font-weight: 500; - opacity: .8; -} - -xs:textAlign-center { - @media (max-width: 600px) { - text-align: center; - } -} diff --git a/web/apps/slco/app/layout.tsx b/web/apps/slco/app/layout.tsx index 015d89ef2e..be4c6910db 100644 --- a/web/apps/slco/app/layout.tsx +++ b/web/apps/slco/app/layout.tsx @@ -1,7 +1,6 @@ import { Inter } from 'next/font/google'; import { Metadata, Viewport } from 'next'; -import '@signalco/ui/dist/index.css'; -import './global.scss'; +import './global.css'; const inter = Inter({ subsets: ['latin'], diff --git a/web/apps/slco/components/PageNav.tsx b/web/apps/slco/components/PageNav.tsx index 18ee9b60d7..3019ac1cea 100644 --- a/web/apps/slco/components/PageNav.tsx +++ b/web/apps/slco/components/PageNav.tsx @@ -1,9 +1,9 @@ import React, { Suspense } from 'react'; -import { cx } from 'classix'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; -import { Container } from '@signalco/ui/dist/Container'; -import { Button } from '@signalco/ui/dist/Button'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; +import { Button } from '@signalco/ui/Button'; type NavLinkItem = { href: string, diff --git a/web/apps/slco/components/pages/Footer.tsx b/web/apps/slco/components/pages/Footer.tsx index 6998d9b459..2845ec4c5c 100644 --- a/web/apps/slco/components/pages/Footer.tsx +++ b/web/apps/slco/components/pages/Footer.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { Container } from '@signalco/ui/dist/Container'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { IconButton } from '@signalco/ui/IconButton'; +import { Container } from '@signalco/ui/Container'; import { isDeveloper } from '../../src/services/EnvProvider'; import { now } from '../../src/services/DateTimeProvider'; diff --git a/web/apps/slco/components/views/LandingView.tsx b/web/apps/slco/components/views/LandingView.tsx index 53163dbe2a..ede56e21d6 100644 --- a/web/apps/slco/components/views/LandingView.tsx +++ b/web/apps/slco/components/views/LandingView.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; export default function LandingPageView() { return ( diff --git a/web/apps/slco/next.config.mjs b/web/apps/slco/next.config.mjs index ec17ea45d4..d02bca5def 100644 --- a/web/apps/slco/next.config.mjs +++ b/web/apps/slco/next.config.mjs @@ -1,5 +1,5 @@ import { createSecureHeaders } from 'next-secure-headers'; -import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data'; +import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data/node'; import nextBundleAnalyzer from '@next/bundle-analyzer'; const isDevelopment = process.env.NODE_ENV === 'development'; diff --git a/web/apps/slco/package.json b/web/apps/slco/package.json index 2464b6b821..bb742f1597 100644 --- a/web/apps/slco/package.json +++ b/web/apps/slco/package.json @@ -4,6 +4,7 @@ "homepage": "https://slco.io/", "version": "1.0.0", "private": true, + "type": "module", "engines": { "node": "18.x" }, @@ -43,16 +44,16 @@ "@signalco/tsconfig": "workspace:*", "@total-typescript/ts-reset": "0.5.1", "@types/color": "3.0.6", - "@types/node": "18.18.9", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/node": "18.18.11", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "cross-env": "7.0.3", "eslint": "8.54.0", "next-sitemap": "4.2.3", "postcss": "8.4.31", "rimraf": "5.0.5", "sass": "1.69.5", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "nextBundleAnalysis": { "budget": 358400, diff --git a/web/apps/slco/playwright.config.ts b/web/apps/slco/playwright.config.ts index 3265243ca0..1b6b2edd28 100644 --- a/web/apps/slco/playwright.config.ts +++ b/web/apps/slco/playwright.config.ts @@ -1,6 +1,8 @@ import path from 'path' import type { PlaywrightTestConfig } from '@playwright/test'; import { devices } from '@playwright/test'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; const PORT = process.env.PORT || 4002 const baseURL = `http://127.0.0.1:${PORT}` @@ -8,7 +10,7 @@ const baseURL = `http://127.0.0.1:${PORT}` const config: PlaywrightTestConfig = { retries: 2, timeout: 30 * 1000, - testDir: path.join(__dirname, 'e2e'), + testDir: path.join(dirname(fileURLToPath(import.meta.url)), 'e2e'), outputDir: 'test-results/', webServer: { command: 'pnpm start', diff --git a/web/apps/web/postcss.config.js b/web/apps/slco/postcss.config.cjs similarity index 100% rename from web/apps/web/postcss.config.js rename to web/apps/slco/postcss.config.cjs diff --git a/web/apps/slco/tailwind.config.cjs b/web/apps/slco/tailwind.config.cjs index 0d40ba909e..84b3ba102d 100644 --- a/web/apps/slco/tailwind.config.cjs +++ b/web/apps/slco/tailwind.config.cjs @@ -6,6 +6,7 @@ export default { presets: [baseConfig], content: [ './app/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}' + './components/**/*.{ts,tsx}', + "../../packages/ui/src/**/*.{ts,tsx}" ] } diff --git a/web/apps/slco/tsconfig.json b/web/apps/slco/tsconfig.json index bc6645e24b..5bb23aa5fc 100644 --- a/web/apps/slco/tsconfig.json +++ b/web/apps/slco/tsconfig.json @@ -1,22 +1,22 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@signalco/tsconfig/web.json", - "compilerOptions": { - "outDir": "dist", - "plugins": [ - { - "name": "next" - } + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@signalco/tsconfig/web.json", + "compilerOptions": { + "plugins": [ + { + "name": "next" + } + ] + }, + "exclude": [ + "node_modules", + "worker" + ], + "include": [ + "next-env.d.ts", + "next.config.js", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" ] - }, - "include": [ - "src", - "app", - "components", - "pages", - "next-env.d.ts", - "@types", - ".next/types/**/*.ts", - "C:\\Users\\aleks\\Documents\\GitHub\\signalco\\web\\apps\\slco\\.next/types/**/*.ts" - ] } diff --git a/web/apps/ui-docs/package.json b/web/apps/ui-docs/package.json index b875bdab1f..947bea340a 100644 --- a/web/apps/ui-docs/package.json +++ b/web/apps/ui-docs/package.json @@ -24,8 +24,8 @@ "@storybook/nextjs": "7.5.3", "@storybook/react": "7.5.3", "@storybook/theming": "7.5.3", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "autoprefixer": "10.4.16", "css-loader": "6.8.1", "postcss": "8.4.31", @@ -38,7 +38,7 @@ "style-loader": "3.3.3", "styled-jsx": "5.1.2", "tailwindcss": "3.3.5", - "typescript": "5.2.2", + "typescript": "5.3.2", "webpack": "5.89.0" }, "dependencies": { diff --git a/web/apps/ui-docs/postcss.config.cjs b/web/apps/ui-docs/postcss.config.cjs index 03c4051591..fef1b2256d 100644 --- a/web/apps/ui-docs/postcss.config.cjs +++ b/web/apps/ui-docs/postcss.config.cjs @@ -1 +1,6 @@ -module.exports = require('@signalco/ui/postcss.config.cjs'); \ No newline at end of file +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/web/apps/ui-docs/stories/Components/Accordion.stories.tsx b/web/apps/ui-docs/stories/Components/Accordion.stories.tsx index e88fd305b8..b331f05e93 100644 --- a/web/apps/ui-docs/stories/Components/Accordion.stories.tsx +++ b/web/apps/ui-docs/stories/Components/Accordion.stories.tsx @@ -1,4 +1,4 @@ -import { Accordion } from "@signalco/ui/dist/Accordion"; +import { Accordion } from "@signalco/ui/Accordion"; import { Meta, StoryObj } from "@storybook/react"; export default { component: Accordion, tags: ['autodocs'] } satisfies Meta; diff --git a/web/apps/ui-docs/stories/Components/Animations/Collapse.stories.tsx b/web/apps/ui-docs/stories/Components/Animations/Collapse.stories.tsx index d8797fbc07..a3eae2efbd 100644 --- a/web/apps/ui-docs/stories/Components/Animations/Collapse.stories.tsx +++ b/web/apps/ui-docs/stories/Components/Animations/Collapse.stories.tsx @@ -1,6 +1,6 @@ -import { Card } from "@signalco/ui/dist/Card"; -import { Collapse } from "@signalco/ui/dist/Collapse"; -import { Stack } from "@signalco/ui/dist/Stack"; +import { Card } from "@signalco/ui/Card"; +import { Collapse } from "@signalco/ui/Collapse"; +import { Stack } from "@signalco/ui/Stack"; import { StoryObj } from "@storybook/react"; export default { component: Collapse, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Animations/Fade.stories.tsx b/web/apps/ui-docs/stories/Components/Animations/Fade.stories.tsx index 7f8e03e7eb..2330142cd6 100644 --- a/web/apps/ui-docs/stories/Components/Animations/Fade.stories.tsx +++ b/web/apps/ui-docs/stories/Components/Animations/Fade.stories.tsx @@ -1,6 +1,6 @@ -import { Card } from "@signalco/ui/dist/Card"; -import { Fade } from "@signalco/ui/dist/Fade"; -import { Stack } from "@signalco/ui/dist/Stack"; +import { Card } from "@signalco/ui/Card"; +import { Fade } from "@signalco/ui/Fade"; +import { Stack } from "@signalco/ui/Stack"; import { StoryObj } from "@storybook/react"; export default { component: Fade, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Animations/GentleSlide.stories.tsx b/web/apps/ui-docs/stories/Components/Animations/GentleSlide.stories.tsx index ee4d5e2f59..b0d0d8f37a 100644 --- a/web/apps/ui-docs/stories/Components/Animations/GentleSlide.stories.tsx +++ b/web/apps/ui-docs/stories/Components/Animations/GentleSlide.stories.tsx @@ -1,7 +1,7 @@ -import { Card } from "@signalco/ui/dist/Card"; -import { GentleSlide } from "@signalco/ui/dist/GentleSlide"; -import { Stack } from "@signalco/ui/dist/Stack"; -import { Row } from "@signalco/ui/dist/Row"; +import { Card } from "@signalco/ui/Card"; +import { GentleSlide } from "@signalco/ui/GentleSlide"; +import { Stack } from "@signalco/ui/Stack"; +import { Row } from "@signalco/ui/Row"; import { StoryObj } from "@storybook/react"; export default { component: GentleSlide, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Animations/Grow.stories.tsx b/web/apps/ui-docs/stories/Components/Animations/Grow.stories.tsx index 2a4b619a7b..394d64f85f 100644 --- a/web/apps/ui-docs/stories/Components/Animations/Grow.stories.tsx +++ b/web/apps/ui-docs/stories/Components/Animations/Grow.stories.tsx @@ -1,6 +1,6 @@ -import { Card } from "@signalco/ui/dist/Card"; -import { Grow } from "@signalco/ui/dist/Grow"; -import { Stack } from "@signalco/ui/dist/Stack"; +import { Card } from "@signalco/ui/Card"; +import { Grow } from "@signalco/ui/Grow"; +import { Stack } from "@signalco/ui/Stack"; import { StoryObj } from "@storybook/react"; export default { component: Grow, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Breadcrumbs.stories.ts b/web/apps/ui-docs/stories/Components/Breadcrumbs.stories.ts index dcd6e6d4cf..985f81e7a2 100644 --- a/web/apps/ui-docs/stories/Components/Breadcrumbs.stories.ts +++ b/web/apps/ui-docs/stories/Components/Breadcrumbs.stories.ts @@ -1,4 +1,4 @@ -import { Breadcrumbs } from "@signalco/ui/dist/Breadcrumbs"; +import { Breadcrumbs } from "@signalco/ui/Breadcrumbs"; import { StoryObj } from "@storybook/react"; export default { component: Breadcrumbs, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Button.stories.ts b/web/apps/ui-docs/stories/Components/Button.stories.ts index 2adc5a99e4..d69285e721 100644 --- a/web/apps/ui-docs/stories/Components/Button.stories.ts +++ b/web/apps/ui-docs/stories/Components/Button.stories.ts @@ -1,4 +1,4 @@ -import { Button } from "@signalco/ui/dist/Button"; +import { Button } from "@signalco/ui/Button"; import { Meta, StoryObj } from "@storybook/react"; export default { component: Button, tags: ['autodocs'] } satisfies Meta; diff --git a/web/apps/ui-docs/stories/Components/DisableButton.stories.ts b/web/apps/ui-docs/stories/Components/DisableButton.stories.ts index 8a2bc8c84f..db36edbc48 100644 --- a/web/apps/ui-docs/stories/Components/DisableButton.stories.ts +++ b/web/apps/ui-docs/stories/Components/DisableButton.stories.ts @@ -1,4 +1,4 @@ -import { DisableButton } from "@signalco/ui/dist/DisableButton"; +import { DisableButton } from "@signalco/ui/DisableButton"; import { StoryObj } from "@storybook/react"; export default { component: DisableButton, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/DropdownMenu.stories.ts b/web/apps/ui-docs/stories/Components/DropdownMenu.stories.ts index def4804a7f..1bf1e97db5 100644 --- a/web/apps/ui-docs/stories/Components/DropdownMenu.stories.ts +++ b/web/apps/ui-docs/stories/Components/DropdownMenu.stories.ts @@ -1,4 +1,4 @@ -import { DropdownMenu } from "@signalco/ui/dist/Menu"; +import { DropdownMenu } from "@signalco/ui/Menu"; import { StoryObj } from "@storybook/react"; export default { component: DropdownMenu, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/EditableInput.stories.ts b/web/apps/ui-docs/stories/Components/EditableInput.stories.ts index ee7592bd6e..0262ccac37 100644 --- a/web/apps/ui-docs/stories/Components/EditableInput.stories.ts +++ b/web/apps/ui-docs/stories/Components/EditableInput.stories.ts @@ -1,4 +1,4 @@ -import { EditableInput } from "@signalco/ui/dist/EditableInput"; +import { EditableInput } from "@signalco/ui/EditableInput"; import { StoryObj } from "@storybook/react"; export default { component: EditableInput, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/ErrorBoundary.stories.ts b/web/apps/ui-docs/stories/Components/ErrorBoundary.stories.ts index f2197c47f8..051c6cb656 100644 --- a/web/apps/ui-docs/stories/Components/ErrorBoundary.stories.ts +++ b/web/apps/ui-docs/stories/Components/ErrorBoundary.stories.ts @@ -1,4 +1,4 @@ -import { ErrorBoundary } from "@signalco/ui/dist/ErrorBoundary"; +import { ErrorBoundary } from "@signalco/ui/ErrorBoundary"; import { StoryObj } from "@storybook/react"; export default { component: ErrorBoundary, tags: ['docsPage'] }; diff --git a/web/apps/ui-docs/stories/Components/Icon.stories.ts b/web/apps/ui-docs/stories/Components/Icon.stories.ts index d65fb8c752..cf23cefb59 100644 --- a/web/apps/ui-docs/stories/Components/Icon.stories.ts +++ b/web/apps/ui-docs/stories/Components/Icon.stories.ts @@ -1,4 +1,4 @@ -import { Icon } from "@signalco/ui/dist/Icon"; +import { Icon } from "@signalco/ui/Icon"; import { StoryObj } from "@storybook/react"; export default { component: Icon, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/IconButtonCopyToClipboard.stories.ts b/web/apps/ui-docs/stories/Components/IconButtonCopyToClipboard.stories.ts index 62de1a0f2f..cf504a720d 100644 --- a/web/apps/ui-docs/stories/Components/IconButtonCopyToClipboard.stories.ts +++ b/web/apps/ui-docs/stories/Components/IconButtonCopyToClipboard.stories.ts @@ -1,4 +1,4 @@ -import { IconButtonCopyToClipboard } from "@signalco/ui/dist/IconButtonCopyToClipboard"; +import { IconButtonCopyToClipboard } from "@signalco/ui/IconButtonCopyToClipboard"; import { StoryObj } from "@storybook/react"; export default { component: IconButtonCopyToClipboard, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Indicators/Alert.stories.ts b/web/apps/ui-docs/stories/Components/Indicators/Alert.stories.ts index 20e802ad81..58494f25e6 100644 --- a/web/apps/ui-docs/stories/Components/Indicators/Alert.stories.ts +++ b/web/apps/ui-docs/stories/Components/Indicators/Alert.stories.ts @@ -1,5 +1,5 @@ import type { StoryObj } from '@storybook/react'; -import { Alert } from '@signalco/ui/dist/Alert'; +import { Alert } from '@signalco/ui/Alert'; export default { component: Alert, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Indicators/Chip.stories.ts b/web/apps/ui-docs/stories/Components/Indicators/Chip.stories.ts index 871df1b555..5a63874b81 100644 --- a/web/apps/ui-docs/stories/Components/Indicators/Chip.stories.ts +++ b/web/apps/ui-docs/stories/Components/Indicators/Chip.stories.ts @@ -1,4 +1,4 @@ -import { Chip } from "@signalco/ui/dist/Chip"; +import { Chip } from "@signalco/ui/Chip"; import { Meta, StoryObj } from "@storybook/react"; export default { diff --git a/web/apps/ui-docs/stories/Components/Indicators/DotIndicator.stories.ts b/web/apps/ui-docs/stories/Components/Indicators/DotIndicator.stories.ts index f6c9922208..4a96485d4c 100644 --- a/web/apps/ui-docs/stories/Components/Indicators/DotIndicator.stories.ts +++ b/web/apps/ui-docs/stories/Components/Indicators/DotIndicator.stories.ts @@ -1,4 +1,4 @@ -import { DotIndicator } from "@signalco/ui/dist/DotIndicator"; +import { DotIndicator } from "@signalco/ui/DotIndicator"; import { StoryObj } from "@storybook/react"; export default { component: DotIndicator, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Indicators/Skeleton.stories.ts b/web/apps/ui-docs/stories/Components/Indicators/Skeleton.stories.ts index b9b1eabf92..83506b224c 100644 --- a/web/apps/ui-docs/stories/Components/Indicators/Skeleton.stories.ts +++ b/web/apps/ui-docs/stories/Components/Indicators/Skeleton.stories.ts @@ -1,4 +1,4 @@ -import { Skeleton } from "@signalco/ui/dist/Skeleton"; +import { Skeleton } from "@signalco/ui/Skeleton"; import { Meta, StoryObj } from "@storybook/react"; export default { diff --git a/web/apps/ui-docs/stories/Components/Input.stories.ts b/web/apps/ui-docs/stories/Components/Input.stories.ts index 4cd8bcb8e3..2270f7c2ad 100644 --- a/web/apps/ui-docs/stories/Components/Input.stories.ts +++ b/web/apps/ui-docs/stories/Components/Input.stories.ts @@ -1,4 +1,4 @@ -import { Input } from "@signalco/ui/dist/Input"; +import { Input } from "@signalco/ui/Input"; import { StoryObj } from "@storybook/react"; export default { component: Input, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Layouts/Container.stories.ts b/web/apps/ui-docs/stories/Components/Layouts/Container.stories.ts index 88790e24fc..16c556142a 100644 --- a/web/apps/ui-docs/stories/Components/Layouts/Container.stories.ts +++ b/web/apps/ui-docs/stories/Components/Layouts/Container.stories.ts @@ -1,4 +1,4 @@ -import { Container } from "@signalco/ui/dist/Container"; +import { Container } from "@signalco/ui/Container"; import { StoryObj } from "@storybook/react"; export default { component: Container, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Layouts/Row.stories.ts b/web/apps/ui-docs/stories/Components/Layouts/Row.stories.ts index 0c2bd198d6..4ab4a75933 100644 --- a/web/apps/ui-docs/stories/Components/Layouts/Row.stories.ts +++ b/web/apps/ui-docs/stories/Components/Layouts/Row.stories.ts @@ -1,4 +1,4 @@ -import { Row } from "@signalco/ui/dist/Row"; +import { Row } from "@signalco/ui/Row"; import { StoryObj } from "@storybook/react"; export default { component: Row, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Layouts/Stack.stories.ts b/web/apps/ui-docs/stories/Components/Layouts/Stack.stories.ts index de2d46e2f3..16b21db22b 100644 --- a/web/apps/ui-docs/stories/Components/Layouts/Stack.stories.ts +++ b/web/apps/ui-docs/stories/Components/Layouts/Stack.stories.ts @@ -1,4 +1,4 @@ -import { Stack } from "@signalco/ui/dist/Stack"; +import { Stack } from "@signalco/ui/Stack"; import { StoryObj } from "@storybook/react"; export default { component: Stack, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Link.stories.ts b/web/apps/ui-docs/stories/Components/Link.stories.ts index ef3dac48c2..2e9841666e 100644 --- a/web/apps/ui-docs/stories/Components/Link.stories.ts +++ b/web/apps/ui-docs/stories/Components/Link.stories.ts @@ -1,4 +1,4 @@ -import { Link } from "@signalco/ui/dist/Link"; +import { Link } from "@signalco/ui/Link"; import { StoryObj } from "@storybook/react"; export default { component: Link, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Loadable.stories.ts b/web/apps/ui-docs/stories/Components/Loadable.stories.ts index 04941589e2..14012f40dd 100644 --- a/web/apps/ui-docs/stories/Components/Loadable.stories.ts +++ b/web/apps/ui-docs/stories/Components/Loadable.stories.ts @@ -1,4 +1,4 @@ -import { Loadable } from "@signalco/ui/dist/Loadable"; +import { Loadable } from "@signalco/ui/Loadable"; import { StoryObj } from "@storybook/react"; export default { component: Loadable, tags: ['autodocs'], args: { isLoading: true, loadingLabel: 'Loading...' } }; diff --git a/web/apps/ui-docs/stories/Components/ModalConfirm.stories.tsx b/web/apps/ui-docs/stories/Components/ModalConfirm.stories.tsx index 0a52c5c448..dd32ab6c50 100644 --- a/web/apps/ui-docs/stories/Components/ModalConfirm.stories.tsx +++ b/web/apps/ui-docs/stories/Components/ModalConfirm.stories.tsx @@ -1,5 +1,5 @@ -import { Button } from "@signalco/ui/dist/Button"; -import { ModalConfirm } from "@signalco/ui/dist/ModalConfirm"; +import { Button } from "@signalco/ui/Button"; +import { ModalConfirm } from "@signalco/ui/ModalConfirm"; import { Meta, StoryObj } from "@storybook/react"; export default { diff --git a/web/apps/ui-docs/stories/Components/NavigatingButton.stories.ts b/web/apps/ui-docs/stories/Components/NavigatingButton.stories.ts index 44602ef661..1d4a780e54 100644 --- a/web/apps/ui-docs/stories/Components/NavigatingButton.stories.ts +++ b/web/apps/ui-docs/stories/Components/NavigatingButton.stories.ts @@ -1,4 +1,4 @@ -import { NavigatingButton } from "@signalco/ui/dist/NavigatingButton"; +import { NavigatingButton } from "@signalco/ui/NavigatingButton"; import { Meta, StoryObj } from "@storybook/react"; const Component = NavigatingButton; diff --git a/web/apps/ui-docs/stories/Components/NoDataPlaceholder.stories.ts b/web/apps/ui-docs/stories/Components/NoDataPlaceholder.stories.ts index 81c2464241..9b5876cc16 100644 --- a/web/apps/ui-docs/stories/Components/NoDataPlaceholder.stories.ts +++ b/web/apps/ui-docs/stories/Components/NoDataPlaceholder.stories.ts @@ -1,4 +1,4 @@ -import { NoDataPlaceholder } from "@signalco/ui/dist/NoDataPlaceholder"; +import { NoDataPlaceholder } from "@signalco/ui/NoDataPlaceholder"; import { Meta, StoryObj } from "@storybook/react"; const Component = NoDataPlaceholder; diff --git a/web/apps/ui-docs/stories/Components/Popper.stories.ts b/web/apps/ui-docs/stories/Components/Popper.stories.ts index d8a0d09084..c87e939e92 100644 --- a/web/apps/ui-docs/stories/Components/Popper.stories.ts +++ b/web/apps/ui-docs/stories/Components/Popper.stories.ts @@ -1,4 +1,4 @@ -import { Popper } from "@signalco/ui/dist/Popper"; +import { Popper } from "@signalco/ui/Popper"; import { StoryObj } from "@storybook/react"; export default { component: Popper, tags: ['autodocs'] }; diff --git a/web/apps/ui-docs/stories/Components/Typography.stories.tsx b/web/apps/ui-docs/stories/Components/Typography.stories.tsx index 22d1bf206a..c9be8a1888 100644 --- a/web/apps/ui-docs/stories/Components/Typography.stories.tsx +++ b/web/apps/ui-docs/stories/Components/Typography.stories.tsx @@ -1,4 +1,4 @@ -import { Typography } from "@signalco/ui/dist/Typography"; +import { Typography } from "@signalco/ui/Typography"; import { Meta, StoryObj } from "@storybook/react"; export default { component: Typography, tags: ['autodocs'] } satisfies Meta; diff --git a/web/apps/ui-docs/stories/styles.css b/web/apps/ui-docs/stories/styles.css index 252fa105cd..b8c694a7f4 100644 --- a/web/apps/ui-docs/stories/styles.css +++ b/web/apps/ui-docs/stories/styles.css @@ -1,4 +1,4 @@ -@import '@signalco/ui/dist/index.css'; +@import '@signalco/ui/index.css'; @tailwind components; @tailwind utilities; diff --git a/web/apps/ui-docs/tailwind.config.cjs b/web/apps/ui-docs/tailwind.config.cjs index 0890267ae9..38a53d5051 100644 --- a/web/apps/ui-docs/tailwind.config.cjs +++ b/web/apps/ui-docs/tailwind.config.cjs @@ -4,6 +4,7 @@ const { baseConfig } = require('@signalco/tailwindcss-config-signalco'); export default { presets: [baseConfig], content: [ - 'stories/**/*.stories.{tsx,ts}' + 'stories/**/*.stories.{tsx,ts}', + "../../packages/ui/src/**/*.{ts,tsx}" ] } diff --git a/web/apps/ui-docs/tsconfig.json b/web/apps/ui-docs/tsconfig.json index 8209d87e6c..a230e2a45b 100644 --- a/web/apps/ui-docs/tsconfig.json +++ b/web/apps/ui-docs/tsconfig.json @@ -1,9 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig", "extends": "@signalco/tsconfig/react-library.json", - "compilerOptions": { - "noEmit": true - }, "include": [ "stories/**/*.ts", "stories/**/*.tsx" diff --git a/web/apps/web/.eslintrc.js b/web/apps/web/.eslintrc.cjs similarity index 100% rename from web/apps/web/.eslintrc.js rename to web/apps/web/.eslintrc.cjs diff --git a/web/apps/web/app/(rest)/channels/[channelName]/page.tsx b/web/apps/web/app/(rest)/channels/[channelName]/page.tsx index 04f3ca653a..aaeeeee224 100644 --- a/web/apps/web/app/(rest)/channels/[channelName]/page.tsx +++ b/web/apps/web/app/(rest)/channels/[channelName]/page.tsx @@ -1,12 +1,12 @@ import { Bug, Link as LinkIcon } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Link } from '@signalco/ui/dist/Link'; -import { Card } from '@signalco/ui/dist/Card'; -import { Breadcrumbs } from '@signalco/ui/dist/Breadcrumbs'; -import { channelCategories as channelCategoriesData, channelsData } from '@signalco/data'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Link } from '@signalco/ui/Link'; +import { Card } from '@signalco/ui/Card'; +import { Breadcrumbs } from '@signalco/ui/Breadcrumbs'; +import { channelCategories as channelCategoriesData, channelsData } from '@signalco/data/data'; import { KnownPages } from '../../../../src/knownPages'; import ShareSocial from '../../../../components/pages/ShareSocial'; import FaqSection from '../../../../components/pages/FaqSection'; diff --git a/web/apps/web/app/(rest)/channels/page.tsx b/web/apps/web/app/(rest)/channels/page.tsx index 008f0fb752..dd9843653b 100644 --- a/web/apps/web/app/(rest)/channels/page.tsx +++ b/web/apps/web/app/(rest)/channels/page.tsx @@ -1,4 +1,4 @@ -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import PageCenterHeader from '../../../components/pages/PageCenterHeader'; import FaqSection from '../../../components/pages/FaqSection'; import CtaSection from '../../../components/pages/CtaSection'; diff --git a/web/apps/web/app/(rest)/contact/page.tsx b/web/apps/web/app/(rest)/contact/page.tsx index c596f1ba1a..548ad3eec0 100644 --- a/web/apps/web/app/(rest)/contact/page.tsx +++ b/web/apps/web/app/(rest)/contact/page.tsx @@ -1,5 +1,5 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; export default function ContactPage() { return ( diff --git a/web/apps/web/app/(rest)/docs/api/page.tsx b/web/apps/web/app/(rest)/docs/api/page.tsx index 404943631c..d3ce971f25 100644 --- a/web/apps/web/app/(rest)/docs/api/page.tsx +++ b/web/apps/web/app/(rest)/docs/api/page.tsx @@ -4,25 +4,25 @@ import React, { useCallback, useState, useContext, createContext } from 'react'; import { OpenAPIV3 } from 'openapi-types'; import { useRouter, useSearchParams } from 'next/navigation'; import { Security, Send } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import type { ColorPaletteProp } from '@signalco/ui/dist/theme'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ListTreeItem } from '@signalco/ui/dist/ListTreeItem'; -import { List } from '@signalco/ui/dist/List'; -import { Input } from '@signalco/ui/dist/Input'; -import { Divider } from '@signalco/ui/dist/Divider'; -import { CopyToClipboardInput } from '@signalco/ui/dist/CopyToClipboardInput'; -import { Chip } from '@signalco/ui/dist/Chip'; -import { Card, CardOverflow } from '@signalco/ui/dist/Card'; -import { Button } from '@signalco/ui/dist/Button'; -import { Alert } from '@signalco/ui/dist/Alert'; +import { Typography } from '@signalco/ui/Typography'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import type { ColorPaletteProp } from '@signalco/ui/theme'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ListTreeItem } from '@signalco/ui/ListTreeItem'; +import { List } from '@signalco/ui/List'; +import { Input } from '@signalco/ui/Input'; +import { Divider } from '@signalco/ui/Divider'; +import { CopyToClipboardInput } from '@signalco/ui/CopyToClipboardInput'; +import { Chip } from '@signalco/ui/Chip'; +import { Card, CardOverflow } from '@signalco/ui/Card'; +import { Button } from '@signalco/ui/Button'; +import { Alert } from '@signalco/ui/Alert'; import { camelToSentenceCase, HttpOperation, ObjectDictAny, objectWithKey } from '@signalco/js'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; import { usePromise } from '@enterwell/react-hooks'; import { isDeveloper } from '../../../../src/services/EnvProvider'; @@ -174,8 +174,8 @@ function ApiOperation(props: ApiOperationProps) { {Object.keys(requestBodyResolved.content).map(contentType => ( - {requestBodyResolved.content[contentType].schema && - } + {requestBodyResolved.content[contentType]?.schema && + } ))} @@ -298,6 +298,9 @@ function resolveRef(api: OpenAPIV3.Document, obj: T | OpenAPIV3.ReferenceObje let curr: unknown = api; for (let i = 1; i < refSplit.length && typeof curr !== 'undefined'; i++) { const nextKey = refSplit[i]; + if (!nextKey) { + break; + } const next = objectWithKey(curr, nextKey)?.nextKey; if (next == null) { break; @@ -429,11 +432,11 @@ function Actions(props: ActionsProps) { if (!api) throw 'API undefined'; const { servers } = api; - const selectedServerUrl = selectedServer ?? (servers && servers.length > 0 ? servers[0].url : 'https://example.com'); + const selectedServerUrl = selectedServer ?? (servers && servers.length > 0 ? servers[0]?.url : 'https://example.com'); const { requestBody, security } = info; const requestBodyResolved = requestBody && resolveRef(api, requestBody); - const [requestBodyValue, setRequestBodyValue] = useState(requestBodyResolved ? JSON.stringify(schemaToJson(api, requestBodyResolved.content['application/json'].schema), undefined, 2) : ''); + const [requestBodyValue, setRequestBodyValue] = useState(requestBodyResolved ? JSON.stringify(schemaToJson(api, requestBodyResolved.content['application/json']?.schema), undefined, 2) : ''); const [response, setResponse] = useState(''); const [responseStatusCode, setResponseStatusCode] = useState(undefined); diff --git a/web/apps/web/app/(rest)/docs/entity/page.tsx b/web/apps/web/app/(rest)/docs/entity/page.tsx index 1456e9797f..a83eeba316 100644 --- a/web/apps/web/app/(rest)/docs/entity/page.tsx +++ b/web/apps/web/app/(rest)/docs/entity/page.tsx @@ -1,4 +1,4 @@ -import {Stack} from '@signalco/ui/dist/Stack'; +import {Stack} from '@signalco/ui/Stack'; export default function EntityDocsPage() { return ( diff --git a/web/apps/web/app/(rest)/docs/infrastructure/LayoutResourceGraph.tsx b/web/apps/web/app/(rest)/docs/infrastructure/LayoutResourceGraph.tsx index b7eeb31ef9..e99d5bf562 100644 --- a/web/apps/web/app/(rest)/docs/infrastructure/LayoutResourceGraph.tsx +++ b/web/apps/web/app/(rest)/docs/infrastructure/LayoutResourceGraph.tsx @@ -1,14 +1,14 @@ 'use client'; import { useCallback, useEffect, useMemo, useState } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Tooltip } from '@signalco/ui/dist/Tooltip'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { Card, CardOverflow } from '@signalco/ui/dist/Card'; -import { Avatar } from '@signalco/ui/dist/Avatar'; +import { Typography } from '@signalco/ui/Typography'; +import { Tooltip } from '@signalco/ui/Tooltip'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { Loadable } from '@signalco/ui/Loadable'; +import { Card, CardOverflow } from '@signalco/ui/Card'; +import { Avatar } from '@signalco/ui/Avatar'; import '@reactflow/core/dist/base.css'; import { ReactFlowProvider, @@ -91,9 +91,18 @@ function ResourceGraph() { const matchLabel = line.match(/Resource([0-9]*) \[label="(.*)"\];/); if (matchLabel) { const [, id, urn] = matchLabel; - const urnMatch = urn.match(/urn:([\w-]*):([\w-]*)::([\w-]*)::([\w-]*):(.*)::([\w-]*)/); + if (!id || !urn) { + console.warn('Invalid resource', line); + return; + } + + const urnMatch = urn?.match(/urn:([\w-]*):([\w-]*)::([\w-]*)::([\w-]*):(.*)::([\w-]*)/); if (urnMatch) { const [, source, stack, project, packageName, resourceType, name] = urnMatch; + if (!source || !stack || !project || !packageName || !resourceType || !name) { + console.warn('Invalid urn', urn); + return; + } resourceItems.push({ id, urn, valid: true, source, name, stack, project, package: packageName, resourceType, depth: 0, totalChildren: 0 @@ -187,7 +196,7 @@ function ResourceGraph() { const nodes: Node[] = []; for (let i = 0; i < expandedResources.length; i++) { const resource = expandedResources[i]; - if (!resource.valid) { + if (!resource?.valid) { continue; } diff --git a/web/apps/web/app/(rest)/docs/infrastructure/page.tsx b/web/apps/web/app/(rest)/docs/infrastructure/page.tsx index 149c2feabb..be3fec5ae7 100644 --- a/web/apps/web/app/(rest)/docs/infrastructure/page.tsx +++ b/web/apps/web/app/(rest)/docs/infrastructure/page.tsx @@ -1,5 +1,5 @@ import dynamic from 'next/dynamic'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import PageCenterHeader from '../../../../components/pages/PageCenterHeader'; const LayoutResourceGraph = dynamic(() => import('./LayoutResourceGraph'), { ssr: false, loading: () =>
Loading...
}); diff --git a/web/apps/web/app/(rest)/features/page.tsx b/web/apps/web/app/(rest)/features/page.tsx index 51ec6735dd..f35cd358e8 100644 --- a/web/apps/web/app/(rest)/features/page.tsx +++ b/web/apps/web/app/(rest)/features/page.tsx @@ -1,5 +1,5 @@ -import { Stack } from '@signalco/ui/dist/Stack'; -import { Link } from '@signalco/ui/dist/Link'; +import { Stack } from '@signalco/ui/Stack'; +import { Link } from '@signalco/ui/Link'; export default function FeaturesPage() { return ( diff --git a/web/apps/web/app/(rest)/features/processes/page.tsx b/web/apps/web/app/(rest)/features/processes/page.tsx index 981aa274bc..8f5673a07e 100644 --- a/web/apps/web/app/(rest)/features/processes/page.tsx +++ b/web/apps/web/app/(rest)/features/processes/page.tsx @@ -1,5 +1,5 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; export default function FeatureProcessesPage() { return ( diff --git a/web/apps/web/app/(rest)/features/spaces/page.tsx b/web/apps/web/app/(rest)/features/spaces/page.tsx index 7c09c2f1e3..4f3823744d 100644 --- a/web/apps/web/app/(rest)/features/spaces/page.tsx +++ b/web/apps/web/app/(rest)/features/spaces/page.tsx @@ -1,5 +1,5 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; import PageCenterHeader from '../../../../components/pages/PageCenterHeader'; export default function FeatureSpacesPage() { diff --git a/web/apps/web/app/(rest)/learn/page.tsx b/web/apps/web/app/(rest)/learn/page.tsx index 73b89c44d7..7d76a6ce89 100644 --- a/web/apps/web/app/(rest)/learn/page.tsx +++ b/web/apps/web/app/(rest)/learn/page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; +import { Typography } from '@signalco/ui/Typography'; export default function Learn() { return Learn diff --git a/web/apps/web/app/(rest)/oss/page.tsx b/web/apps/web/app/(rest)/oss/page.tsx index b67445dfa7..4a7fa1fadd 100644 --- a/web/apps/web/app/(rest)/oss/page.tsx +++ b/web/apps/web/app/(rest)/oss/page.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; +import { Typography } from '@signalco/ui/Typography'; export default function OpenSourceSoftware() { return Open Source Software diff --git a/web/apps/web/app/(rest)/pricing/page.tsx b/web/apps/web/app/(rest)/pricing/page.tsx index ee3d58ebbb..8b7d736610 100644 --- a/web/apps/web/app/(rest)/pricing/page.tsx +++ b/web/apps/web/app/(rest)/pricing/page.tsx @@ -1,5 +1,5 @@ -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; import { KnownPages } from '../../../src/knownPages'; import PricingCard, { PricingOption } from '../../../components/pages/pricing/PricingCard'; import PageCenterHeader from '../../../components/pages/PageCenterHeader'; @@ -54,7 +54,7 @@ export default function PricingPage() { - {pricingOptions.map((po, i) => )} + {pricingOptions.map((po, i) => )} diff --git a/web/apps/web/app/(rest)/roadmap/roadmap.tsx b/web/apps/web/app/(rest)/roadmap/roadmap.tsx index 7f66c8b386..7370e0704e 100644 --- a/web/apps/web/app/(rest)/roadmap/roadmap.tsx +++ b/web/apps/web/app/(rest)/roadmap/roadmap.tsx @@ -1,14 +1,14 @@ import { PropsWithChildren } from 'react'; -import { cx } from 'classix'; import { Up } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Loadable } from '@signalco/ui/dist/Loadable'; -import { ItemsShowMore } from '@signalco/ui/dist/FilterList'; -import { Container } from '@signalco/ui/dist/Container'; -import { Card } from '@signalco/ui/dist/Card'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Loadable } from '@signalco/ui/Loadable'; +import { ItemsShowMore } from '@signalco/ui/FilterList'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; +import { Card } from '@signalco/ui/Card'; +import { Button } from '@signalco/ui/Button'; import { camelToSentenceCase, orderBy } from '@signalco/js'; import { RoadmapItem, RoadmapItemStatus } from '../../api/github/[owner]/[repo]/issues/route'; import PageCenterHeader from '../../../components/pages/PageCenterHeader'; diff --git a/web/apps/web/app/(rest)/security/page.tsx b/web/apps/web/app/(rest)/security/page.tsx index 9e92e75226..f00a6bc956 100644 --- a/web/apps/web/app/(rest)/security/page.tsx +++ b/web/apps/web/app/(rest)/security/page.tsx @@ -1,8 +1,8 @@ import { Shield, Lock, Euro } from '@signalco/ui-icons'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Container } from '@signalco/ui/dist/Container'; -import { Card, CardContent } from '@signalco/ui/dist/Card'; -import { Avatar } from '@signalco/ui/dist/Avatar'; +import { Stack } from '@signalco/ui/Stack'; +import { Container } from '@signalco/ui/Container'; +import { Card, CardContent } from '@signalco/ui/Card'; +import { Avatar } from '@signalco/ui/Avatar'; import PageCenterHeader from '../../../components/pages/PageCenterHeader'; import FaqSection from '../../../components/pages/FaqSection'; import CtaSection from '../../../components/pages/CtaSection'; diff --git a/web/apps/web/app/(rest)/store/page.tsx b/web/apps/web/app/(rest)/store/page.tsx index 0c952c5e5f..5094fa1927 100644 --- a/web/apps/web/app/(rest)/store/page.tsx +++ b/web/apps/web/app/(rest)/store/page.tsx @@ -3,15 +3,15 @@ import React, { useState } from 'react'; import Image from 'next/image'; import { Check, Close, ExternalLink, Hourglass } from '@signalco/ui-icons'; -import { Typography } from '@signalco/ui/dist/Typography'; -import type { ColorVariants } from '@signalco/ui/dist/theme'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { SelectItems } from '@signalco/ui/dist/SelectItems'; -import { Row } from '@signalco/ui/dist/Row'; -import { Gallery } from '@signalco/ui/dist/Gallery'; -import { FilterList } from '@signalco/ui/dist/FilterList'; -import { Chip } from '@signalco/ui/dist/Chip'; -import { Card } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import type { ColorVariants } from '@signalco/ui/theme'; +import { Stack } from '@signalco/ui/Stack'; +import { SelectItems } from '@signalco/ui/SelectItems'; +import { Row } from '@signalco/ui/Row'; +import { Gallery } from '@signalco/ui/Gallery'; +import { FilterList } from '@signalco/ui/FilterList'; +import { Chip } from '@signalco/ui/Chip'; +import { Card } from '@signalco/ui/Card'; import { objectWithKey } from '@signalco/js'; import PageCenterHeader from '../../../components/pages/PageCenterHeader'; import SignalcoLogo from '../../../components/icons/SignalcoLogo'; diff --git a/web/apps/web/app/error.tsx b/web/apps/web/app/error.tsx index cb25ec73a7..2d5a49266e 100644 --- a/web/apps/web/app/error.tsx +++ b/web/apps/web/app/error.tsx @@ -1,11 +1,11 @@ 'use client'; import { useEffect } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Button } from '@signalco/ui/Button'; type RootErrorProps = { error: Error; diff --git a/web/apps/web/app/global.css b/web/apps/web/app/global.css index 64bb44e500..db4cccc9b1 100644 --- a/web/apps/web/app/global.css +++ b/web/apps/web/app/global.css @@ -1,7 +1,4 @@ -@import '@signalco/ui/dist/index.css'; - -@tailwind components; -@tailwind utilities; +@import '@signalco/ui/index.css'; @font-face { font-family: 'Material Icons'; @@ -33,11 +30,3 @@ /* Support for Firefox. */ -moz-osx-font-smoothing: grayscale; } - -.image--light { - display: var(--light-display); -} - -.image--dark { - display: var(--dark-display); -} diff --git a/web/apps/web/components/PageNav.tsx b/web/apps/web/components/PageNav.tsx index da9ce4275d..32239f1d27 100644 --- a/web/apps/web/components/PageNav.tsx +++ b/web/apps/web/components/PageNav.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import { cx } from 'classix'; -import { Row } from '@signalco/ui/dist/Row'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Link } from '@signalco/ui/dist/Link'; -import { Container } from '@signalco/ui/dist/Container'; -import { Button } from '@signalco/ui/dist/Button'; +import { Row } from '@signalco/ui/Row'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; +import { Button } from '@signalco/ui/Button'; import { KnownPages } from '../src/knownPages'; import SignalcoLogotype from './icons/SignalcoLogotype'; diff --git a/web/apps/web/components/channels/ChannelGalleryItem.tsx b/web/apps/web/components/channels/ChannelGalleryItem.tsx index 3afe3a5aaa..f3168d7c23 100644 --- a/web/apps/web/components/channels/ChannelGalleryItem.tsx +++ b/web/apps/web/components/channels/ChannelGalleryItem.tsx @@ -1,8 +1,8 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import type { ColorPaletteProp } from '@signalco/ui/dist/theme'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Chip } from '@signalco/ui/dist/Chip'; -import { Card } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import type { ColorPaletteProp } from '@signalco/ui/theme'; +import { Stack } from '@signalco/ui/Stack'; +import { Chip } from '@signalco/ui/Chip'; +import { Card } from '@signalco/ui/Card'; import ChannelLogo from './ChannelLogo'; type ChannelGalleryItemProps = { diff --git a/web/apps/web/components/channels/ChannelsGallery.tsx b/web/apps/web/components/channels/ChannelsGallery.tsx index 014b0fc618..02ba138d2c 100644 --- a/web/apps/web/components/channels/ChannelsGallery.tsx +++ b/web/apps/web/components/channels/ChannelsGallery.tsx @@ -1,10 +1,10 @@ 'use client'; -import { Gallery } from '@signalco/ui/dist/Gallery'; -import { FilterList } from '@signalco/ui/dist/FilterList'; +import { Gallery } from '@signalco/ui/Gallery'; +import { FilterList } from '@signalco/ui/FilterList'; import { orderBy } from '@signalco/js'; -import { useSearchParam } from '@signalco/hooks/dist/useSearchParam'; -import { channelsData, channelCategories } from '@signalco/data'; +import { useSearchParam } from '@signalco/hooks/useSearchParam'; +import { channelsData, channelCategories } from '@signalco/data/data'; import ChannelGalleryItem from './ChannelGalleryItem'; function channelHrefFunc(id: string) { diff --git a/web/apps/web/components/icons/SignalcoLogo.tsx b/web/apps/web/components/icons/SignalcoLogo.tsx index da49900928..089f280b26 100644 --- a/web/apps/web/components/icons/SignalcoLogo.tsx +++ b/web/apps/web/components/icons/SignalcoLogo.tsx @@ -1,5 +1,5 @@ import Image, { ImageProps } from 'next/image'; -import { SupportedColorScheme } from '@signalco/ui/dist/theme'; +import { SupportedColorScheme } from '@signalco/ui/theme'; export type SignalcoLogoProps = Omit & { width?: number; diff --git a/web/apps/web/components/icons/SignalcoLogotype.tsx b/web/apps/web/components/icons/SignalcoLogotype.tsx index 3f25d72952..85ac4f1931 100644 --- a/web/apps/web/components/icons/SignalcoLogotype.tsx +++ b/web/apps/web/components/icons/SignalcoLogotype.tsx @@ -1,6 +1,6 @@ import { Ref, forwardRef } from 'react'; import Image, { ImageProps } from 'next/image'; -import type { SupportedColorScheme } from '@signalco/ui/dist/theme'; +import type { SupportedColorScheme } from '@signalco/ui/theme'; export type SignalcoLogotypeProps = Omit & { width?: number; diff --git a/web/apps/web/components/layouts/PageFullLayout.tsx b/web/apps/web/components/layouts/PageFullLayout.tsx index 329ef664fe..7ca473cc34 100644 --- a/web/apps/web/components/layouts/PageFullLayout.tsx +++ b/web/apps/web/components/layouts/PageFullLayout.tsx @@ -1,5 +1,5 @@ import { PropsWithChildren } from 'react'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Stack } from '@signalco/ui/Stack'; import Footer from '../pages/Footer'; import { PageNav } from '../PageNav'; diff --git a/web/apps/web/components/layouts/PageLayout.tsx b/web/apps/web/components/layouts/PageLayout.tsx index efce498014..7fb3732476 100644 --- a/web/apps/web/components/layouts/PageLayout.tsx +++ b/web/apps/web/components/layouts/PageLayout.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren } from 'react'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Container } from '@signalco/ui/dist/Container'; +import { Stack } from '@signalco/ui/Stack'; +import { Container } from '@signalco/ui/Container'; import Footer from '../pages/Footer'; import { PageNav } from '../PageNav'; diff --git a/web/apps/web/components/pages/CtaSection.tsx b/web/apps/web/components/pages/CtaSection.tsx index e7ac2c857d..07351682b6 100644 --- a/web/apps/web/components/pages/CtaSection.tsx +++ b/web/apps/web/components/pages/CtaSection.tsx @@ -1,7 +1,7 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { NavigatingButton } from '@signalco/ui/dist/NavigatingButton'; -import { Card } from '@signalco/ui/dist/Card'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { NavigatingButton } from '@signalco/ui/NavigatingButton'; +import { Card } from '@signalco/ui/Card'; import { KnownPages } from '../../src/knownPages'; export default function CtaSection() { diff --git a/web/apps/web/components/pages/FaqSection.tsx b/web/apps/web/components/pages/FaqSection.tsx index 89bf8e7368..2c5aab5adc 100644 --- a/web/apps/web/components/pages/FaqSection.tsx +++ b/web/apps/web/components/pages/FaqSection.tsx @@ -1,7 +1,7 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Container } from '@signalco/ui/dist/Container'; -import { Accordion } from '@signalco/ui/dist/Accordion'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Container } from '@signalco/ui/Container'; +import { Accordion } from '@signalco/ui/Accordion'; import PageCenterHeader from './PageCenterHeader'; export interface FaqItem { diff --git a/web/apps/web/components/pages/Footer/Footer.tsx b/web/apps/web/components/pages/Footer/Footer.tsx index 9205358539..a33942c87f 100644 --- a/web/apps/web/components/pages/Footer/Footer.tsx +++ b/web/apps/web/components/pages/Footer/Footer.tsx @@ -1,7 +1,7 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Link } from '@signalco/ui/dist/Link'; -import { Divider } from '@signalco/ui/dist/Divider'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Link } from '@signalco/ui/Link'; +import { Divider } from '@signalco/ui/Divider'; import { SystemStatusLabel } from '../SystemStatusLabel'; import SignalcoLogotype from '../../icons/SignalcoLogotype'; import { isDeveloper } from '../../../src/services/EnvProvider'; diff --git a/web/apps/web/components/pages/Footer/FooterContainer.tsx b/web/apps/web/components/pages/Footer/FooterContainer.tsx index abe91d511b..1966c49ccd 100644 --- a/web/apps/web/components/pages/Footer/FooterContainer.tsx +++ b/web/apps/web/components/pages/Footer/FooterContainer.tsx @@ -1,5 +1,5 @@ import { type PropsWithChildren } from 'react'; -import { Container } from '@signalco/ui/dist/Container'; +import { Container } from '@signalco/ui/Container'; export function FooterContainer({ children }: PropsWithChildren) { return ( diff --git a/web/apps/web/components/pages/Footer/SignalcoSocialIcons.tsx b/web/apps/web/components/pages/Footer/SignalcoSocialIcons.tsx index 5c78e544e3..78614880d7 100644 --- a/web/apps/web/components/pages/Footer/SignalcoSocialIcons.tsx +++ b/web/apps/web/components/pages/Footer/SignalcoSocialIcons.tsx @@ -1,8 +1,8 @@ -import { Row } from '@signalco/ui/dist/Row'; -import { IconButton } from '@signalco/ui/dist/IconButton'; -import { GitHubIcon } from './GitHubIcon'; -import { RedditIcon } from './RedditIcon'; +import { Row } from '@signalco/ui/Row'; +import { IconButton } from '@signalco/ui/IconButton'; import { XIconSvg } from './XIconSvg'; +import { RedditIcon } from './RedditIcon'; +import { GitHubIcon } from './GitHubIcon'; export function SignalcoSocialIcons() { return ( diff --git a/web/apps/web/components/pages/PageCenterHeader.tsx b/web/apps/web/components/pages/PageCenterHeader.tsx index a38772484e..5a38c90058 100644 --- a/web/apps/web/components/pages/PageCenterHeader.tsx +++ b/web/apps/web/components/pages/PageCenterHeader.tsx @@ -1,6 +1,6 @@ import React, { ComponentProps } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; type PageCenterHeaderProps = { level?: ComponentProps['level']; diff --git a/web/apps/web/components/pages/ShareSocial.tsx b/web/apps/web/components/pages/ShareSocial.tsx index 928434fbae..da9dd9e711 100644 --- a/web/apps/web/components/pages/ShareSocial.tsx +++ b/web/apps/web/components/pages/ShareSocial.tsx @@ -1,6 +1,6 @@ import { Share } from '@signalco/ui-icons'; -import { IconButtonCopyToClipboard } from '@signalco/ui/dist/IconButtonCopyToClipboard'; -import { useIsServer } from '@signalco/hooks/dist/useIsServer'; +import { IconButtonCopyToClipboard } from '@signalco/ui/IconButtonCopyToClipboard'; +import { useIsServer } from '@signalco/hooks/useIsServer'; export default function ShareSocial() { const isServer = useIsServer(); diff --git a/web/apps/web/components/pages/SystemStatusLabel.tsx b/web/apps/web/components/pages/SystemStatusLabel.tsx index 79f457e3d5..28ebb99112 100644 --- a/web/apps/web/components/pages/SystemStatusLabel.tsx +++ b/web/apps/web/components/pages/SystemStatusLabel.tsx @@ -1,10 +1,10 @@ 'use client'; import React from 'react'; -import { cx } from 'classix'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Row } from '@signalco/ui/dist/Row'; -import { Link } from '@signalco/ui/dist/Link'; +import { Typography } from '@signalco/ui/Typography'; +import { Row } from '@signalco/ui/Row'; +import { Link } from '@signalco/ui/Link'; +import { cx } from '@signalco/ui/cx'; import { JsonResponse } from '@signalco/js'; import { usePromise } from '@enterwell/react-hooks'; diff --git a/web/apps/web/components/pages/landing/CounterIndicator.tsx b/web/apps/web/components/pages/landing/CounterIndicator.tsx index 152905d309..97b2698131 100644 --- a/web/apps/web/components/pages/landing/CounterIndicator.tsx +++ b/web/apps/web/components/pages/landing/CounterIndicator.tsx @@ -1,5 +1,5 @@ -import { cx } from 'classix'; -import { Typography } from '@signalco/ui/dist/Typography'; +import { Typography } from '@signalco/ui/Typography'; +import { cx } from '@signalco/ui/cx'; function CounterIndicator(props: { count: number, hideAfter?: boolean }) { return ( diff --git a/web/apps/web/components/pages/landing/Cover.tsx b/web/apps/web/components/pages/landing/Cover.tsx index 01dced6ce7..9ac53d20cb 100644 --- a/web/apps/web/components/pages/landing/Cover.tsx +++ b/web/apps/web/components/pages/landing/Cover.tsx @@ -1,5 +1,5 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; import SignalcoLogotype from '../../icons/SignalcoLogotype'; export default function Cover() { diff --git a/web/apps/web/components/pages/landing/Globe.tsx b/web/apps/web/components/pages/landing/Globe.tsx index d4b4478b23..a489e57916 100644 --- a/web/apps/web/components/pages/landing/Globe.tsx +++ b/web/apps/web/components/pages/landing/Globe.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useMemo, useRef } from 'react'; import createGlobe from 'cobe'; -import { useWindowWidth } from '@signalco/hooks/dist/useWindowWidth'; +import { useWindowWidth } from '@signalco/hooks/useWindowWidth'; function Globe() { const canvasRef = useRef(null); diff --git a/web/apps/web/components/pages/landing/GlobeSection.tsx b/web/apps/web/components/pages/landing/GlobeSection.tsx index de2578ef1e..6890e0b2ea 100644 --- a/web/apps/web/components/pages/landing/GlobeSection.tsx +++ b/web/apps/web/components/pages/landing/GlobeSection.tsx @@ -2,10 +2,10 @@ import { useState } from 'react'; import dynamic from 'next/dynamic'; -import { Fade } from '@signalco/ui/dist/Fade'; -import { Container } from '@signalco/ui/dist/Container'; -import { useTimeout } from '@signalco/hooks/dist/useTimeout'; -import { useIsServer } from '@signalco/hooks/dist/useIsServer'; +import { Fade } from '@signalco/ui/Fade'; +import { Container } from '@signalco/ui/Container'; +import { useTimeout } from '@signalco/hooks/useTimeout'; +import { useIsServer } from '@signalco/hooks/useIsServer'; const Globe = dynamic(() => import('./Globe')); function GlobeSection() { diff --git a/web/apps/web/components/pages/landing/Newsletter.tsx b/web/apps/web/components/pages/landing/Newsletter.tsx index bca606b24f..ee59b0243d 100644 --- a/web/apps/web/components/pages/landing/Newsletter.tsx +++ b/web/apps/web/components/pages/landing/Newsletter.tsx @@ -1,14 +1,14 @@ 'use client'; import { ChangeEvent, SyntheticEvent, createRef, useState } from 'react'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Input } from '@signalco/ui/dist/Input'; -import { GentleSlide} from '@signalco/ui/dist/GentleSlide'; -import { Fade } from '@signalco/ui/dist/Fade'; -import { Button } from '@signalco/ui/dist/Button'; -import { Alert } from '@signalco/ui/dist/Alert'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Input } from '@signalco/ui/Input'; +import { GentleSlide} from '@signalco/ui/GentleSlide'; +import { Fade } from '@signalco/ui/Fade'; +import { Button } from '@signalco/ui/Button'; +import { Alert } from '@signalco/ui/Alert'; import HCaptcha from '@hcaptcha/react-hcaptcha'; function Newsletter() { diff --git a/web/apps/web/components/pages/pricing/PricingCard.tsx b/web/apps/web/components/pages/pricing/PricingCard.tsx index acaddc9c84..068232e6e3 100644 --- a/web/apps/web/components/pages/pricing/PricingCard.tsx +++ b/web/apps/web/components/pages/pricing/PricingCard.tsx @@ -1,9 +1,9 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Row } from '@signalco/ui/dist/Row'; -import { Checkbox } from '@signalco/ui/dist/Checkbox'; -import { Card } from '@signalco/ui/dist/Card'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Row } from '@signalco/ui/Row'; +import { Checkbox } from '@signalco/ui/Checkbox'; +import { Card } from '@signalco/ui/Card'; +import { Button } from '@signalco/ui/Button'; import SignalcoLogotype from '../../icons/SignalcoLogotype'; export interface PricingOption { diff --git a/web/apps/web/components/views/DataPart.tsx b/web/apps/web/components/views/DataPart.tsx index 59d7a3f757..4a44c8f1c1 100644 --- a/web/apps/web/components/views/DataPart.tsx +++ b/web/apps/web/components/views/DataPart.tsx @@ -1,5 +1,5 @@ -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; export function DataPart(props: { value: string; subtitle: string; }) { return ( diff --git a/web/apps/web/components/views/FeatureDescription.tsx b/web/apps/web/components/views/FeatureDescription.tsx index 58aa6730d7..15d6687b6d 100644 --- a/web/apps/web/components/views/FeatureDescription.tsx +++ b/web/apps/web/components/views/FeatureDescription.tsx @@ -1,8 +1,8 @@ import React from 'react'; import Link from 'next/link'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Button } from '@signalco/ui/dist/Button'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { Button } from '@signalco/ui/Button'; export function FeatureDescription(props: { header: string; content: string | React.ReactElement; link?: string; linkText?: string; }) { return ( diff --git a/web/apps/web/components/views/FeaturedIntegrationsSection.tsx b/web/apps/web/components/views/FeaturedIntegrationsSection.tsx index 2f4ddf1051..8b8d44bfca 100644 --- a/web/apps/web/components/views/FeaturedIntegrationsSection.tsx +++ b/web/apps/web/components/views/FeaturedIntegrationsSection.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Link from 'next/link'; import Image from 'next/image'; -import { Typography } from '@signalco/ui/dist/Typography'; +import { Typography } from '@signalco/ui/Typography'; import { SectionCenter } from './SectionCenter'; const integrationsList = [ diff --git a/web/apps/web/components/views/LandingView.tsx b/web/apps/web/components/views/LandingView.tsx index 29351540f5..bef3592edf 100644 --- a/web/apps/web/components/views/LandingView.tsx +++ b/web/apps/web/components/views/LandingView.tsx @@ -1,10 +1,10 @@ import React from 'react'; import dynamic from 'next/dynamic'; import { Navigate } from '@signalco/ui-icons'; -import { Stack } from '@signalco/ui/dist/Stack'; -import { Divider } from '@signalco/ui/dist/Divider'; -import { Container } from '@signalco/ui/dist/Container'; -import {Button} from '@signalco/ui/dist/Button'; +import { Stack } from '@signalco/ui/Stack'; +import { Divider } from '@signalco/ui/Divider'; +import { Container } from '@signalco/ui/Container'; +import {Button} from '@signalco/ui/Button'; import DeveloperOnly from '../shared/DeveloperOnly'; import DiscoverVisual from '../pages/landing/visuals/DiscoverVisual'; import Cover from '../pages/landing/Cover'; diff --git a/web/apps/web/components/views/SectionCenter.tsx b/web/apps/web/components/views/SectionCenter.tsx index 2c507a4682..04c696763f 100644 --- a/web/apps/web/components/views/SectionCenter.tsx +++ b/web/apps/web/components/views/SectionCenter.tsx @@ -1,6 +1,6 @@ import React, { type CSSProperties } from 'react'; -import { cx } from 'classix'; -import { Container } from '@signalco/ui/dist/Container'; +import { cx } from '@signalco/ui/cx'; +import { Container } from '@signalco/ui/Container'; export function SectionCenter(props: { children?: React.ReactNode | undefined; style?: CSSProperties | undefined; narrow?: boolean; className?: string; }) { return ( diff --git a/web/apps/web/components/views/StepContent.tsx b/web/apps/web/components/views/StepContent.tsx index c38b5a193d..f5e17ee60c 100644 --- a/web/apps/web/components/views/StepContent.tsx +++ b/web/apps/web/components/views/StepContent.tsx @@ -1,7 +1,7 @@ import React, { type CSSProperties } from 'react'; -import { cx } from 'classix'; -import { Typography } from '@signalco/ui/dist/Typography'; -import { Stack } from '@signalco/ui/dist/Stack'; +import { Typography } from '@signalco/ui/Typography'; +import { Stack } from '@signalco/ui/Stack'; +import { cx } from '@signalco/ui/cx'; import { SectionCenter } from './SectionCenter'; export function StepContent(props: { diff --git a/web/apps/web/next.config.mjs b/web/apps/web/next.config.mjs index a1c3a24217..1c57b12909 100644 --- a/web/apps/web/next.config.mjs +++ b/web/apps/web/next.config.mjs @@ -3,7 +3,7 @@ import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD, } from 'next/constants.js'; -import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data'; +import { combineSecureHeaders, knownSecureHeadersExternalUrls } from '@signalco/data/node'; import nextBundleAnalyzer from '@next/bundle-analyzer'; const isDevelopment = process.env.NODE_ENV === 'development'; diff --git a/web/apps/web/package.json b/web/apps/web/package.json index ec1b24d421..0a8117ee05 100644 --- a/web/apps/web/package.json +++ b/web/apps/web/package.json @@ -4,6 +4,7 @@ "homepage": "https://www.signalco.io/", "version": "1.0.0", "private": true, + "type": "module", "engines": { "node": "18.x" }, @@ -57,9 +58,9 @@ "@types/cobe": "0.4.3", "@types/color": "3.0.6", "@types/next-pwa": "5.6.9", - "@types/node": "18.18.9", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/node": "18.18.11", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "babel-loader": "9.1.3", "colorette": "2.0.20", "cross-env": "7.0.3", @@ -69,7 +70,7 @@ "postcss": "8.4.31", "rimraf": "5.0.5", "sass": "1.69.5", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "nextBundleAnalysis": { "budget": 358400, diff --git a/web/apps/web/playwright.config.ts b/web/apps/web/playwright.config.ts index d1ee374cfd..f141ba67a1 100644 --- a/web/apps/web/playwright.config.ts +++ b/web/apps/web/playwright.config.ts @@ -1,6 +1,8 @@ import path from 'path' import type { PlaywrightTestConfig } from '@playwright/test'; import { devices } from '@playwright/test'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; const PORT = process.env.PORT || 3000 const baseURL = `http://127.0.0.1:${PORT}` @@ -8,7 +10,7 @@ const baseURL = `http://127.0.0.1:${PORT}` const config: PlaywrightTestConfig = { retries: 2, timeout: 30 * 1000, - testDir: path.join(__dirname, 'e2e'), + testDir: path.join(dirname(fileURLToPath(import.meta.url)), 'e2e'), outputDir: 'test-results/', fullyParallel: true, webServer: { diff --git a/web/packages/ui/postcss.config.cjs b/web/apps/web/postcss.config.cjs similarity index 92% rename from web/packages/ui/postcss.config.cjs rename to web/apps/web/postcss.config.cjs index b28b7e10d8..fef1b2256d 100644 --- a/web/packages/ui/postcss.config.cjs +++ b/web/apps/web/postcss.config.cjs @@ -2,5 +2,5 @@ module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, - } + }, } diff --git a/web/apps/web/tailwind.config.cjs b/web/apps/web/tailwind.config.cjs index 0d40ba909e..84b3ba102d 100644 --- a/web/apps/web/tailwind.config.cjs +++ b/web/apps/web/tailwind.config.cjs @@ -6,6 +6,7 @@ export default { presets: [baseConfig], content: [ './app/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}' + './components/**/*.{ts,tsx}', + "../../packages/ui/src/**/*.{ts,tsx}" ] } diff --git a/web/apps/web/tsconfig.json b/web/apps/web/tsconfig.json index 27cbc8a149..f145244ae4 100644 --- a/web/apps/web/tsconfig.json +++ b/web/apps/web/tsconfig.json @@ -1,20 +1,22 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@signalco/tsconfig/web.json", - "compilerOptions": { - "outDir": "dist", - "plugins": [ - { - "name": "next" - } - ] - }, - "include": [ - "src", - "app", - "components", - "@types", - "next-env.d.ts", - ".next/types/**/*.ts" + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@signalco/tsconfig/web.json", + "compilerOptions": { + "plugins": [ + { + "name": "next" + } ] + }, + "include": [ + "src", + "app", + "components", + "@types", + "next-env.d.ts", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] } diff --git a/web/package.json b/web/package.json index e233766ab5..1a67d0b078 100644 --- a/web/package.json +++ b/web/package.json @@ -10,7 +10,7 @@ "scripts": { "build": "turbo run build", "clean": "turbo run clean", - "dev": "turbo run dev --no-cache --continue --concurrency 20", + "dev": "turbo run dev", "lint": "turbo run lint", "test": "turbo run test" }, diff --git a/web/packages/data/package.json b/web/packages/data/package.json index fbd5e6f3c3..e5b9218c29 100644 --- a/web/packages/data/package.json +++ b/web/packages/data/package.json @@ -3,26 +3,15 @@ "version": "0.0.0", "private": true, "sideEffects": false, - "module": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { - ".": { - "import": "./dist/index.js" - } + "./data": "./src/data/index.ts", + "./node": "./src/node/index.js" }, "type": "module", - "files": [ - "dist" - ], "scripts": { - "build": "tsup src/index.ts --dts --format esm --clean", - "dev": "tsup src/index.ts --dts --format esm --clean --watch", - "clean": "rimraf dist" }, "devDependencies": { "@signalco/tsconfig": "workspace:*", - "rimraf": "5.0.5", - "tsup": "7.3.0", - "typescript": "5.2.2" + "typescript": "5.3.2" } } diff --git a/web/packages/data/src/ExternalUrls.ts b/web/packages/data/src/ExternalUrls.ts deleted file mode 100644 index 3af341c83d..0000000000 --- a/web/packages/data/src/ExternalUrls.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type ExternalUrls = { - scriptSrc?: string[]; - styleSrc?: string[]; - imgSrc?: string[]; - frameSrc?: string[]; - connectSrc?: string[]; - frameAncestors?: string[]; -}; diff --git a/web/packages/data/src/channelCategoriesData.json b/web/packages/data/src/data/channelCategoriesData.json similarity index 100% rename from web/packages/data/src/channelCategoriesData.json rename to web/packages/data/src/data/channelCategoriesData.json diff --git a/web/packages/data/src/channelsData.json b/web/packages/data/src/data/channelsData.json similarity index 100% rename from web/packages/data/src/channelsData.json rename to web/packages/data/src/data/channelsData.json diff --git a/web/packages/data/src/index.ts b/web/packages/data/src/data/index.ts similarity index 80% rename from web/packages/data/src/index.ts rename to web/packages/data/src/data/index.ts index 59afced158..2fe79aeaf8 100644 --- a/web/packages/data/src/index.ts +++ b/web/packages/data/src/data/index.ts @@ -1,10 +1,6 @@ import ChannelsData from './channelsData.json'; import ChannelCategories from './channelCategoriesData.json'; -export * from './ExternalUrls'; -export * from './KnownSecureHeadersExternalUrls'; -export * from './combineSecureHeaders'; - export type ChannelDataItem = { channelName: string, label: string, diff --git a/web/packages/data/src/combineSecureHeaders.ts b/web/packages/data/src/node/combineSecureHeaders.js similarity index 90% rename from web/packages/data/src/combineSecureHeaders.ts rename to web/packages/data/src/node/combineSecureHeaders.js index 368cd216cf..8b87704613 100644 --- a/web/packages/data/src/combineSecureHeaders.ts +++ b/web/packages/data/src/node/combineSecureHeaders.js @@ -1,10 +1,8 @@ -import { ExternalUrls } from "./ExternalUrls"; - export function combineSecureHeaders( - baseDomains: string[], - allowSubdomains: boolean, - isDevelopment: boolean, - externalUrls: ExternalUrls[] + baseDomains, + allowSubdomains, + isDevelopment, + externalUrls, ) { const baseSubdomains = allowSubdomains ? (baseDomains.map(bd => `*.${bd.split('.').slice(-2).join('.')}`)) : []; return { diff --git a/web/packages/data/src/node/index.js b/web/packages/data/src/node/index.js new file mode 100644 index 0000000000..99d96d85f9 --- /dev/null +++ b/web/packages/data/src/node/index.js @@ -0,0 +1,2 @@ +export * from './combineSecureHeaders.js'; +export * from './knownSecureHeadersExternalUrls.js'; diff --git a/web/packages/data/src/KnownSecureHeadersExternalUrls.ts b/web/packages/data/src/node/knownSecureHeadersExternalUrls.js similarity index 87% rename from web/packages/data/src/KnownSecureHeadersExternalUrls.ts rename to web/packages/data/src/node/knownSecureHeadersExternalUrls.js index 30cf8e988c..f266d21939 100644 --- a/web/packages/data/src/KnownSecureHeadersExternalUrls.ts +++ b/web/packages/data/src/node/knownSecureHeadersExternalUrls.js @@ -1,10 +1,4 @@ -import { ExternalUrls } from "./ExternalUrls"; - -export type KnownSecureHeadersExternalUrlsObject = { - [key: string]: ExternalUrls | ((param: string) => ExternalUrls); -}; - -export const knownSecureHeadersExternalUrls: KnownSecureHeadersExternalUrlsObject = { +export const knownSecureHeadersExternalUrls = { signalco: { connectSrc: ['https://*.signalco.io'], imgSrc: ['https://*.signalco.io'] @@ -18,7 +12,7 @@ export const knownSecureHeadersExternalUrls: KnownSecureHeadersExternalUrlsObjec github: { connectSrc: ['https://api.github.com'] }, - auth0: (tenant: string) => { + auth0: (tenant) => { return { frameSrc: [`https://${tenant}.auth0.com`], imgSrc: [`https://${tenant}.auth0.com`], diff --git a/web/packages/data/tsconfig.json b/web/packages/data/tsconfig.json index 6cf2315613..9682bc7060 100644 --- a/web/packages/data/tsconfig.json +++ b/web/packages/data/tsconfig.json @@ -1,10 +1,13 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@signalco/tsconfig/react-library.json", + "extends": "@signalco/tsconfig/js-library.json", + "compilerOptions": { + "resolveJsonModule": true + }, "include": [ "./src/**/*.ts*" ], - "compilerOptions": { - "resolveJsonModule": true - } + "exclude": [ + "node_modules" + ] } diff --git a/web/packages/eslint-config-signalco/index.js b/web/packages/eslint-config-signalco/index.cjs similarity index 87% rename from web/packages/eslint-config-signalco/index.js rename to web/packages/eslint-config-signalco/index.cjs index fc5f7e858a..860a236fc6 100644 --- a/web/packages/eslint-config-signalco/index.js +++ b/web/packages/eslint-config-signalco/index.cjs @@ -1,3 +1,7 @@ +const { resolve } = require("node:path"); + +const project = resolve(process.cwd(), "tsconfig.json"); + module.exports = { extends: [ "next", @@ -8,21 +12,22 @@ module.exports = { 'plugin:@typescript-eslint/recommended', "plugin:tailwindcss/recommended" ], + plugins: ["only-warn"], + globals: { + React: true, + JSX: true, + }, overrides: [ { - files: ['*.ts', '*.tsx', '*.js'], - parser: '@typescript-eslint/parser', + files: ['*.ts', '*.tsx', '*.js'] }, ], settings: { "import/resolver": { typescript: { - project: "./tsconfig.json" + project } - }, - react: { - version: "detect" - }, + } }, rules: { "@next/next/no-html-link-for-pages": "off", diff --git a/web/packages/eslint-config-signalco/package.json b/web/packages/eslint-config-signalco/package.json index 1eca7a3559..cfe188fd9f 100644 --- a/web/packages/eslint-config-signalco/package.json +++ b/web/packages/eslint-config-signalco/package.json @@ -2,21 +2,18 @@ "name": "@signalco/eslint-config-signalco", "version": "0.0.0", "private": true, - "main": "index.js", + "main": "index.cjs", + "type": "module", "sideEffects": false, "dependencies": { - "@typescript-eslint/eslint-plugin": "6.11.0", - "@typescript-eslint/parser": "6.11.0", - "eslint": "8.54.0", + "@typescript-eslint/eslint-plugin": "6.12.0", + "@typescript-eslint/parser": "6.12.0", "eslint-config-next": "14.0.3", "eslint-config-turbo": "1.10.16", - "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "2.29.0", + "eslint-plugin-only-warn": "1.1.0", "eslint-plugin-react": "7.33.2", "eslint-plugin-tailwindcss": "3.13.0", - "typescript": "5.2.2" - }, - "publishConfig": { - "access": "public" + "typescript": "5.3.2" } } \ No newline at end of file diff --git a/web/packages/hooks/.eslintrc.cjs b/web/packages/hooks/.eslintrc.cjs new file mode 100644 index 0000000000..b10b311de1 --- /dev/null +++ b/web/packages/hooks/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['@signalco/eslint-config-signalco'], +}; diff --git a/web/packages/hooks/package.json b/web/packages/hooks/package.json index a2f79d8a31..edfedefd8e 100644 --- a/web/packages/hooks/package.json +++ b/web/packages/hooks/package.json @@ -3,32 +3,32 @@ "version": "0.0.0", "private": true, "sideEffects": false, - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "type": "module", "exports": { - "./dist/": { - "import": "./dist/" - } + "./useWindowWidth": "./src/useWindowWidth.ts", + "./useWindowRect": "./src/useWindowRect.ts", + "./useWindowEvent": "./src/useWindowEvent.ts", + "./useTimeout": "./src/useTimeout.ts", + "./useSearchParam": "./src/useSearchParam.ts", + "./useIsServer": "./src/useIsServer.ts", + "./useIsomorphicLayoutEffect": "./src/useIsomorphicLayoutEffect.ts", + "./useInterval": "./src/useInterval.ts", + "./useControllableState": "./src/useControllableState.ts", + "./useCallbackRef": "./src/useCallbackRef.ts", + "./useAudio": "./src/useAudio.ts" }, - "type": "module", - "files": [ - "dist" - ], "scripts": { - "build": "tsup src/*.ts --dts --format esm --clean", - "dev": "tsup src/*.ts --dts --format esm --watch", - "clean": "rimraf dist" + "lint": "eslint ." }, "devDependencies": { "@signalco/js": "workspace:*", "@signalco/tsconfig": "workspace:*", - "@types/react": "18.2.37", + "@signalco/eslint-config-signalco": "workspace:*", + "@types/react": "18.2.38", "next": "14.0.3", "react": "18.2.0", "react-dom": "18.2.0", - "rimraf": "5.0.5", - "tsup": "7.3.0", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "peerDependencies": { "next": "14.0.3", diff --git a/web/packages/hooks/tsconfig.json b/web/packages/hooks/tsconfig.json index 59a3be20ac..66c2e02513 100644 --- a/web/packages/hooks/tsconfig.json +++ b/web/packages/hooks/tsconfig.json @@ -4,5 +4,8 @@ "include": [ "./src/**/*.ts*", "next-env.d.ts" + ], + "exclude": [ + "node_modules" ] } diff --git a/web/packages/js/.eslintrc.cjs b/web/packages/js/.eslintrc.cjs new file mode 100644 index 0000000000..b10b311de1 --- /dev/null +++ b/web/packages/js/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['@signalco/eslint-config-signalco'], +}; diff --git a/web/packages/js/package.json b/web/packages/js/package.json index 850a578124..2e331dacd2 100644 --- a/web/packages/js/package.json +++ b/web/packages/js/package.json @@ -3,29 +3,19 @@ "version": "0.0.0", "private": true, "sideEffects": false, - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "type": "module", "exports": { - ".": { - "import": "./dist/index.js" - } + ".": "./src/index.ts" }, - "type": "module", - "files": [ - "dist" - ], "scripts": { - "build": "tsup src/index.ts --dts --format esm --clean", - "dev": "tsup src/index.ts --dts --format esm --watch", - "clean": "rimraf dist" + "lint": "eslint ." }, "devDependencies": { "@signalco/tsconfig": "workspace:*", + "@signalco/eslint-config-signalco": "workspace:*", "react": "18.2.0", "react-dom": "18.2.0", - "rimraf": "5.0.5", - "tsup": "7.3.0", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "peerDependencies": { "react": "18.2.0", diff --git a/web/packages/js/src/ArrayHelpers.ts b/web/packages/js/src/ArrayHelpers.ts index c221a1043f..5e94dd5388 100644 --- a/web/packages/js/src/ArrayHelpers.ts +++ b/web/packages/js/src/ArrayHelpers.ts @@ -25,7 +25,7 @@ export const orderBy = (array: T[], compareFn?: (a: T, b: T) => number) => { return copy; } -export const arraySum = (array: T[], selectorFunc: (i: T, index: number) => number) => { +export const arraySum = (array: T[], selectorFunc: (i: T | undefined, index: number) => number) => { if (!Array.isArray(array)) throw new Error('Not an array: ' + typeof array); @@ -37,7 +37,7 @@ export const arraySum = (array: T[], selectorFunc: (i: T, index: number) => n return sum; } -const arrayPick = (array: T[], compareFn: (i: T, index: number) => number | undefined, pickFn: (a: number | undefined, b: number | undefined) => boolean) => { +const arrayPick = (array: T[], compareFn: (i: T | undefined, index: number) => number | undefined, pickFn: (a: number | undefined, b: number | undefined) => boolean) => { if (!Array.isArray(array)) throw new Error('Not an array: ' + typeof array); @@ -55,12 +55,12 @@ const arrayPick = (array: T[], compareFn: (i: T, index: number) => number | u return currentMin; } -export const arrayMin = (array: T[], compareFn: (i: T, index: number) => number | undefined) => +export const arrayMin = (array: T[], compareFn: (i: T | undefined, index: number) => number | undefined) => arrayPick(array, compareFn, (a, b) => typeof a === 'undefined' ? true : (typeof b === 'undefined' ? false : a < b)) -export const arrayMax = (array: T[], compareFn: (i: T, index: number) => number | undefined) => +export const arrayMax = (array: T[], compareFn: (i: T | undefined, index: number) => number | undefined) => arrayPick(array, compareFn, (a, b) => typeof a === 'undefined' ? false : (typeof b === 'undefined' ? true : a > b)) -export function sequenceEqual(arrayA: TA[], arrayB: TB[], compareFn?: (a: TA, b: TB) => boolean) { +export function sequenceEqual(arrayA: TA[], arrayB: TB[], compareFn?: (a: TA | undefined, b: TB | undefined) => boolean) { if (!arrayA || !arrayB) return false; if (arrayA.length !== arrayB.length) diff --git a/web/packages/js/tsconfig.json b/web/packages/js/tsconfig.json index b6c5a0b61f..986a57b8c6 100644 --- a/web/packages/js/tsconfig.json +++ b/web/packages/js/tsconfig.json @@ -1,7 +1,10 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@signalco/tsconfig/react-library.json", + "extends": "@signalco/tsconfig/js-library.json", "include": [ "./src/**/*.ts*" + ], + "exclude": [ + "node_modules" ] } diff --git a/web/packages/lexorder/.eslintrc.cjs b/web/packages/lexorder/.eslintrc.cjs new file mode 100644 index 0000000000..b10b311de1 --- /dev/null +++ b/web/packages/lexorder/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['@signalco/eslint-config-signalco'], +}; diff --git a/web/packages/lexorder/package.json b/web/packages/lexorder/package.json index 31cf3c05a3..1c09931acb 100644 --- a/web/packages/lexorder/package.json +++ b/web/packages/lexorder/package.json @@ -2,26 +2,19 @@ "name": "@signalco/lexorder", "version": "0.1.0", "sideEffects": false, - "module": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { - ".": { - "import": "./dist/index.js" - } + ".": "./src/index.ts" }, "type": "module", "files": [ "dist" ], "scripts": { - "build": "tsup src/index.ts --dts --format esm --clean", - "dev": "tsup src/index.ts --dts --format esm --watch", - "clean": "rimraf dist" + "lint": "eslint ." }, "devDependencies": { "@signalco/tsconfig": "workspace:*", - "rimraf": "5.0.5", - "tsup": "7.3.0", - "typescript": "5.2.2" + "@signalco/eslint-config-signalco": "workspace:*", + "typescript": "5.3.2" } -} \ No newline at end of file +} diff --git a/web/packages/lexorder/tsconfig.json b/web/packages/lexorder/tsconfig.json index b6c5a0b61f..986a57b8c6 100644 --- a/web/packages/lexorder/tsconfig.json +++ b/web/packages/lexorder/tsconfig.json @@ -1,7 +1,10 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@signalco/tsconfig/react-library.json", + "extends": "@signalco/tsconfig/js-library.json", "include": [ "./src/**/*.ts*" + ], + "exclude": [ + "node_modules" ] } diff --git a/web/packages/tsconfig/base.json b/web/packages/tsconfig/base.json index ee5cc4f2c0..8a596dd7d1 100644 --- a/web/packages/tsconfig/base.json +++ b/web/packages/tsconfig/base.json @@ -2,21 +2,20 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "Default", "compilerOptions": { - "composite": false, "declaration": true, "declarationMap": true, "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "inlineSources": false, + "incremental": false, "isolatedModules": true, - "moduleResolution": "node", - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, + "lib": ["es2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "moduleDetection": "force", + "moduleResolution": "Bundler", + "noUncheckedIndexedAccess": true, + "resolveJsonModule": true, "skipLibCheck": true, - "strict": true - }, - "exclude": [ - "node_modules" - ] + "strict": true, + "target": "ES2022", + "noEmit": true + } } diff --git a/web/packages/tsconfig/js-library.json b/web/packages/tsconfig/js-library.json new file mode 100644 index 0000000000..7d28cc5335 --- /dev/null +++ b/web/packages/tsconfig/js-library.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "React Library", + "extends": "./base.json", + "compilerOptions": { + "noEmit": true + } +} diff --git a/web/packages/tsconfig/react-library.json b/web/packages/tsconfig/react-library.json index 4569acff62..2515de86f7 100644 --- a/web/packages/tsconfig/react-library.json +++ b/web/packages/tsconfig/react-library.json @@ -3,24 +3,10 @@ "display": "React Library", "extends": "./base.json", "compilerOptions": { - "jsx": "react-jsx", - "lib": [ - "ESNext", - "DOM", - "DOM.Iterable" + "jsx": "preserve", + "typeRoots": [ + "../node_modules/@types", + "../@types" ], - "allowSyntheticDefaultImports": true, - "module": "ESNext", - "target": "ESNext", - "useDefineForClassFields": true, - "resolveJsonModule": true - }, - "include": [ - "./src/**/*.ts*" - ], - "exclude": [ - "dist", - "node_modules", - ".turbo" - ] + } } diff --git a/web/packages/tsconfig/web.json b/web/packages/tsconfig/web.json index ded9928c3f..ed9c9ab243 100644 --- a/web/packages/tsconfig/web.json +++ b/web/packages/tsconfig/web.json @@ -3,39 +3,15 @@ "display": "Web", "extends": "./base.json", "compilerOptions": { + "plugins": [{ "name": "next" }], + "module": "ESNext", + "moduleResolution": "Bundler", "allowJs": true, - "declaration": false, - "declarationMap": false, - "incremental": true, - "noEmit": true, "jsx": "preserve", - "resolveJsonModule": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "noEmit": true, "typeRoots": [ "../node_modules/@types", "../@types" ], - "module": "esnext", - "target": "es6", - "plugins": [ - { - "name": "next" - } - ] - }, - "exclude": [ - "node_modules", - "public", - "worker" - ], - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts" - ] + } } diff --git a/web/packages/ui-icons/.eslintrc.cjs b/web/packages/ui-icons/.eslintrc.cjs new file mode 100644 index 0000000000..b10b311de1 --- /dev/null +++ b/web/packages/ui-icons/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['@signalco/eslint-config-signalco'], +}; diff --git a/web/packages/ui-icons/package.json b/web/packages/ui-icons/package.json index b2b62a5a65..9a488570a4 100644 --- a/web/packages/ui-icons/package.json +++ b/web/packages/ui-icons/package.json @@ -3,30 +3,20 @@ "version": "0.0.0", "private": true, "sideEffects": false, - "module": "./dist/index.js", - "types": "./dist/index.d.ts", + "type": "module", "exports": { - ".": { - "import": "./dist/index.js" - } + ".": "./src/index.ts" }, - "type": "module", - "files": [ - "dist" - ], "scripts": { - "build": "tsup src/index.ts --dts --format esm --clean", - "dev": "tsup src/index.ts --dts --format esm --watch", - "clean": "rimraf dist" + "lint": "eslint ." }, "devDependencies": { "@signalco/tsconfig": "workspace:*", + "@signalco/eslint-config-signalco": "workspace:*", "lucide-react": "0.292.0", "react": "18.2.0", "react-dom": "18.2.0", - "rimraf": "5.0.5", - "tsup": "7.3.0", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "peerDependencies": { "react": "18.2.0", diff --git a/web/packages/ui-icons/src/lucide/index.ts b/web/packages/ui-icons/src/lucide/index.ts index 043d49a459..ab9d91474b 100644 --- a/web/packages/ui-icons/src/lucide/index.ts +++ b/web/packages/ui-icons/src/lucide/index.ts @@ -5,6 +5,7 @@ export { BatteryCharging, Battery as BatteryEmpty, Cloud, + Code2Icon as Embed, Settings, Menu, GitCommit as Channel, diff --git a/web/packages/ui-icons/tsconfig.json b/web/packages/ui-icons/tsconfig.json index b6c5a0b61f..ce5d7cadcf 100644 --- a/web/packages/ui-icons/tsconfig.json +++ b/web/packages/ui-icons/tsconfig.json @@ -3,5 +3,8 @@ "extends": "@signalco/tsconfig/react-library.json", "include": [ "./src/**/*.ts*" + ], + "exclude": [ + "node_modules" ] } diff --git a/web/packages/ui-notifications/.editorconfig b/web/packages/ui-notifications/.editorconfig new file mode 100644 index 0000000000..6aa8a118d3 --- /dev/null +++ b/web/packages/ui-notifications/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[*.{js,ts,json,yml}] +charset = utf-8 +indent_style = space +indent_size = 4 diff --git a/web/packages/ui-notifications/.eslintrc.cjs b/web/packages/ui-notifications/.eslintrc.cjs new file mode 100644 index 0000000000..b10b311de1 --- /dev/null +++ b/web/packages/ui-notifications/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['@signalco/eslint-config-signalco'], +}; diff --git a/web/packages/ui-notifications/README.md b/web/packages/ui-notifications/README.md new file mode 100644 index 0000000000..0a17bbf978 --- /dev/null +++ b/web/packages/ui-notifications/README.md @@ -0,0 +1,3 @@ +# signalco UI + +Some components are based on https://ui.shadcn.com/ diff --git a/web/packages/ui-notifications/package.json b/web/packages/ui-notifications/package.json new file mode 100644 index 0000000000..1454cf7272 --- /dev/null +++ b/web/packages/ui-notifications/package.json @@ -0,0 +1,34 @@ +{ + "name": "@signalco/ui-notifications", + "version": "0.0.0", + "private": true, + "license": "MIT", + "type": "module", + "exports": { + ".": "./src/index.ts" + }, + "scripts": { + "lint": "eslint ." + }, + "devDependencies": { + "@signalco/eslint-config-signalco": "workspace:*", + "@signalco/tailwindcss-config-signalco": "workspace:*", + "@signalco/tsconfig": "workspace:*", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", + "typescript": "5.3.2" + }, + "dependencies": { + "@signalco/ui": "workspace:*", + "next": "14.0.3", + "react": "18.2.0", + "react-dom": "18.2.0", + "sonner": "1.2.2" + }, + "peerDependencies": { + "@signalco/ui": "workspace:*", + "next": "14.0.3", + "react": "18.2.0", + "react-dom": "18.2.0" + } +} diff --git a/web/packages/ui-notifications/src/NotificationsContainer.tsx b/web/packages/ui-notifications/src/NotificationsContainer.tsx new file mode 100644 index 0000000000..4ebb900a15 --- /dev/null +++ b/web/packages/ui-notifications/src/NotificationsContainer.tsx @@ -0,0 +1,5 @@ +import { Toaster } from 'sonner'; + +export function NotificationsContainer({ theme }: { theme?: 'light' | 'dark' }) { + return +} diff --git a/web/apps/app/src/notifications/PageNotificationService.tsx b/web/packages/ui-notifications/src/NotificationsService.tsx similarity index 70% rename from web/apps/app/src/notifications/PageNotificationService.tsx rename to web/packages/ui-notifications/src/NotificationsService.tsx index d633dc9f40..7f1f07f01c 100644 --- a/web/apps/app/src/notifications/PageNotificationService.tsx +++ b/web/packages/ui-notifications/src/NotificationsService.tsx @@ -1,15 +1,16 @@ -import { toast } from 'react-toastify'; +// import { toast } from 'react-toastify'; +import { toast } from 'sonner'; import { ReactNode } from 'react'; -import { Row } from '@signalco/ui/dist/Row'; -import { Button } from '@signalco/ui/dist/Button'; +import { Row } from '@signalco/ui/Row'; +import { Button } from '@signalco/ui/Button'; export type PageNotificationVariant = 'default' | 'info' | 'success' | 'warning' | 'error'; -export interface PageNotificationOptions { +export type PageNotificationOptions = { variant?: PageNotificationVariant; autoHideDuration?: number; persist?: boolean; - action?: ReactNode + action?: ReactNode; } function _enqueue(message: string | ReactNode, options?: PageNotificationOptions): string | number { @@ -21,11 +22,17 @@ function _enqueue(message: string | ReactNode, options?: PageNotificationOptions ) : message; - return toast(content, { - autoClose: options?.persist ? false : options?.autoHideDuration, - type: options?.variant, - position: 'bottom-right', - theme: 'dark' + let func = toast.info; + if (options?.variant === 'success') { + func = toast.success; + } else if (options?.variant === 'warning') { + func = toast.warning; + } else if (options?.variant === 'error') { + func = toast.error; + } + + return func(content, { + duration: options?.autoHideDuration, }); } diff --git a/web/packages/ui-notifications/src/index.ts b/web/packages/ui-notifications/src/index.ts new file mode 100644 index 0000000000..f6c4df00ec --- /dev/null +++ b/web/packages/ui-notifications/src/index.ts @@ -0,0 +1,2 @@ +export * from './NotificationsService'; +export * from './NotificationsContainer'; diff --git a/web/packages/ui-notifications/tailwind.config.cjs b/web/packages/ui-notifications/tailwind.config.cjs new file mode 100644 index 0000000000..cd1ba5f106 --- /dev/null +++ b/web/packages/ui-notifications/tailwind.config.cjs @@ -0,0 +1,12 @@ +// NOTE: Not actualy used, but here to enable tailwindcss IDE support + +import { baseConfig } from '@signalco/tailwindcss-config-signalco'; + +/** @type {import('tailwindcss').Config} */ +// eslint-disable-next-line import/no-anonymous-default-export +export default { + presets: [baseConfig], + content: [ + './src/**/*.{ts,tsx}' + ] +} diff --git a/web/packages/ui/tsconfig.build.json b/web/packages/ui-notifications/tsconfig.json similarity index 65% rename from web/packages/ui/tsconfig.build.json rename to web/packages/ui-notifications/tsconfig.json index 949426aeb0..ce5d7cadcf 100644 --- a/web/packages/ui/tsconfig.build.json +++ b/web/packages/ui-notifications/tsconfig.json @@ -2,11 +2,9 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "@signalco/tsconfig/react-library.json", "include": [ - "./src/**/index.ts" + "./src/**/*.ts*" ], "exclude": [ - "dist", - "node_modules", - ".turbo" + "node_modules" ] } diff --git a/web/packages/ui/package.json b/web/packages/ui/package.json index c22c5e502f..cd4b58ea1a 100644 --- a/web/packages/ui/package.json +++ b/web/packages/ui/package.json @@ -4,39 +4,82 @@ "private": true, "license": "MIT", "type": "module", + "sideEffects": false, "files": [ - "/dist" + "package.json", + "README.md", + "dist" ], + "exports": { + "./index.css": "./src/index.css", + "./cx": "./src/cx/index.ts", + "./TypographyEditable": "./src/TypographyEditable/index.ts", + "./Typography": "./src/Typography/index.ts", + "./Tooltip": "./src/Tooltip/index.ts", + "./Timeago": "./src/Timeago/index.ts", + "./theme": "./src/theme/index.ts", + "./Stack": "./src/Stack/index.ts", + "./Spinner": "./src/Spinner/index.ts", + "./Skeleton": "./src/Skeleton/index.ts", + "./SelectItems": "./src/SelectItems/index.ts", + "./Row": "./src/Row/index.ts", + "./Popper": "./src/Popper/index.ts", + "./NoDataPlaceholder": "./src/NoDataPlaceholder/index.ts", + "./NavigatingButton": "./src/NavigatingButton/index.ts", + "./ModalConfirm": "./src/ModalConfirm/index.ts", + "./Modal": "./src/Modal/index.ts", + "./Menu": "./src/Menu/index.ts", + "./Loadable": "./src/Loadable/index.ts", + "./ListTreeItem": "./src/ListTreeItem/index.ts", + "./ListItem": "./src/ListItem/index.ts", + "./List": "./src/List/index.ts", + "./Link": "./src/Link/index.ts", + "./Input": "./src/Input/index.ts", + "./IconButtonCopyToClipboard": "./src/IconButtonCopyToClipboard/index.ts", + "./IconButton": "./src/IconButton/index.ts", + "./Icon": "./src/Icon/index.ts", + "./Grow": "./src/Grow/index.ts", + "./GentleSlide": "./src/GentleSlide/index.ts", + "./Gallery": "./src/Gallery/index.ts", + "./FilterList": "./src/FilterList/index.ts", + "./Fade": "./src/Fade/index.ts", + "./ErrorBoundary": "./src/ErrorBoundary/index.ts", + "./EditableInput": "./src/EditableInput/index.ts", + "./DotIndicator": "./src/DotIndicator/index.ts", + "./Divider": "./src/Divider/index.ts", + "./DisableButton": "./src/DisableButton/index.ts", + "./CopyToClipboardInput": "./src/CopyToClipboardInput/index.ts", + "./Container": "./src/Container/index.ts", + "./colors": "./src/colors/index.ts", + "./Collapse": "./src/Collapse/index.ts", + "./Chip": "./src/Chip/index.ts", + "./Checkbox": "./src/Checkbox/index.ts", + "./Card": "./src/Card/index.ts", + "./ButtonDropdown": "./src/ButtonDropdown/index.ts", + "./Button": "./src/Button/index.ts", + "./Breadcrumbs": "./src/Breadcrumbs/index.ts", + "./Avatar": "./src/Avatar/index.ts", + "./Alert": "./src/Alert/index.ts", + "./Accordion": "./src/Accordion/index.ts" + }, "scripts": { - "build": "npm run clean && pnpm run \"/^build:.*/\"", - "build:tsup": "tsup", - "build:declaration": "tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist", - "dev": "pnpm run \"/^dev:.*/\"", - "dev:tsup": "tsup --watch", - "dev:declaration": "tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --watch --outDir dist", - "clean": "rimraf dist", - "lint": "eslint --ext .ts,.tsx . --fix" + "lint": "eslint ." }, "devDependencies": { "@signalco/eslint-config-signalco": "workspace:*", "@signalco/tailwindcss-config-signalco": "workspace:*", "@signalco/tsconfig": "workspace:*", - "@types/react": "18.2.37", - "@types/react-dom": "18.2.15", + "@types/react": "18.2.38", + "@types/react-dom": "18.2.16", "@types/react-timeago": "4.1.6", "autoprefixer": "10.4.16", "classix": "2.1.35", - "concurrently": "8.2.2", - "glob": "10.3.10", "postcss": "8.4.31", "postcss-preset-env": "9.3.0", - "rimraf": "5.0.5", "sass": "1.69.5", - "tsup": "7.3.0", - "typescript": "5.2.2" + "typescript": "5.3.2" }, "dependencies": { - "@babel/core": "7.23.3", "@radix-ui/react-checkbox": "1.0.4", "@radix-ui/react-dialog": "1.0.5", "@radix-ui/react-dropdown-menu": "2.0.6", @@ -51,14 +94,13 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-timeago": "7.2.0", - "tailwindcss": "3.3.5", - "tailwindcss-animate": "1.0.7" + "tailwind-merge": "2.0.0" }, "peerDependencies": { - "@babel/core": "7.23.3", - "@signalco/ui-icons": "workspace:*", "next": "14.0.3", "react": "18.2.0", - "react-dom": "18.2.0" + "react-dom": "18.2.0", + "tailwindcss": "3.3.5", + "tailwindcss-animate": "1.0.7" } } diff --git a/web/packages/ui/src/Accordion/Accordion.tsx b/web/packages/ui/src/Accordion/Accordion.tsx index 62c1caff55..66bab6a359 100644 --- a/web/packages/ui/src/Accordion/Accordion.tsx +++ b/web/packages/ui/src/Accordion/Accordion.tsx @@ -1,6 +1,6 @@ -import { useState } from 'react'; +import { isValidElement, useState } from 'react'; import type { ComponentProps, MouseEvent } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { ExpandDown } from '@signalco/ui-icons'; import { Row } from '../Row'; import { Collapse } from '../Collapse'; @@ -26,23 +26,25 @@ export function Accordion({ children, open, disabled, onOpenChanged, unmountOnEx const actualOpen = open ?? isOpen; - const multipleChildren = !!children && Array.isArray(children); + const firstChild = Array.isArray(children) ? children[0] : children; + const otherChildren = Array.isArray(children) ? children.filter((_: unknown, i: number) => i !== 0 && isValidElement) : []; + const multipleChildren = otherChildren.length > 0; return ( - + - {multipleChildren ? children[0] : children} + {multipleChildren && isValidElement(firstChild) ? firstChild : children} {!disabled && ( - + )} {(!unmountOnExit || actualOpen) && ( - {multipleChildren && ( - - {children.filter((_, i) => i !== 0)} + {multipleChildren && isValidElement(otherChildren) && ( + + {otherChildren} )} diff --git a/web/packages/ui/src/Alert/Alert.tsx b/web/packages/ui/src/Alert/Alert.tsx index f384c7e58a..65db480d48 100644 --- a/web/packages/ui/src/Alert/Alert.tsx +++ b/web/packages/ui/src/Alert/Alert.tsx @@ -1,5 +1,5 @@ import { type HTMLAttributes, type ReactNode } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { Row } from '../Row'; export type AlertProps = HTMLAttributes & { @@ -14,17 +14,18 @@ export function Alert({ className, color, startDecorator, endDecorator, children role="alert" spacing={1} className={cx( - 'uitw-relative uitw-w-full uitw-rounded-lg uitw-border p-4 [&>svg~*]:uitw-pl-7 [&>svg+div]:uitw-translate-y-[-3px] [&>svg]:uitw-absolute [&>svg]:uitw-left-4 [&>svg]:uitw-top-4 [&>svg]:uitw-text-foreground', - color === 'primary' && 'uitw-bg-primary-100 uitw-border-primary-300', - color === 'neutral' && 'uitw-bg-neutral-100 uitw-border-neutral-300', - color === 'danger' && 'uitw-bg-red-100 uitw-border-red-300 dark:uitw-bg-red-900 dark:uitw-border-red-700', - color === 'info' && 'uitw-bg-blue-100 uitw-border-blue-300', - color === 'success' && 'uitw-bg-green-100 uitw-border-green-300', - color === 'warning' && 'uitw-bg-yellow-100 uitw-border-yellow-300', + 'relative w-full rounded-lg border p-4', + '[&>svg~*]:pl-8 [&>svg]:absolute [&>svg]:top-3.5 [&>svg]:left-4', + color === 'primary' && 'bg-primary-100 border-primary-300', + color === 'neutral' && 'bg-neutral-100 border-neutral-300', + color === 'danger' && 'bg-red-100 border-red-300 dark:bg-red-900 dark:border-red-700', + color === 'info' && 'bg-blue-100 border-blue-300', + color === 'success' && 'bg-green-100 border-green-300', + color === 'warning' && 'bg-yellow-100 border-yellow-300', className)} {...props}> {startDecorator} -
+
{children}
{endDecorator} diff --git a/web/packages/ui/src/Avatar/Avatar.tsx b/web/packages/ui/src/Avatar/Avatar.tsx index 8aaa18ea4d..1bfe7bdf7f 100644 --- a/web/packages/ui/src/Avatar/Avatar.tsx +++ b/web/packages/ui/src/Avatar/Avatar.tsx @@ -1,5 +1,5 @@ import { PropsWithChildren } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; export type AvatarProps = PropsWithChildren<{ size?: 'sm' | 'md' | 'lg'; // TODO: Implement @@ -10,7 +10,7 @@ export type AvatarProps = PropsWithChildren<{ export function Avatar({ children, className }: AvatarProps) { return (
{children}
); } diff --git a/web/packages/ui/src/Breadcrumbs/Breadcrumbs.tsx b/web/packages/ui/src/Breadcrumbs/Breadcrumbs.tsx index 352557e5b8..81431edf6b 100644 --- a/web/packages/ui/src/Breadcrumbs/Breadcrumbs.tsx +++ b/web/packages/ui/src/Breadcrumbs/Breadcrumbs.tsx @@ -17,7 +17,7 @@ export function Breadcrumbs({ items, endSeparator }: BreadcrumbsProps) { return null; return ( -
diff --git a/web/packages/ui/src/Breadcrumbs/BreadcrumbsSeparator.tsx b/web/packages/ui/src/Breadcrumbs/BreadcrumbsSeparator.tsx index 732c14a79e..9fbf33ee9b 100644 --- a/web/packages/ui/src/Breadcrumbs/BreadcrumbsSeparator.tsx +++ b/web/packages/ui/src/Breadcrumbs/BreadcrumbsSeparator.tsx @@ -2,6 +2,6 @@ import { Typography } from '../Typography'; export function BreadcrumbsSeparator() { return ( - {'/'} + {'/'} ); } diff --git a/web/packages/ui/src/Button/Button.tsx b/web/packages/ui/src/Button/Button.tsx index 22b88997eb..bab94c6a2b 100644 --- a/web/packages/ui/src/Button/Button.tsx +++ b/web/packages/ui/src/Button/Button.tsx @@ -31,7 +31,7 @@ const Button = forwardRef(({ ...otherProps }, ref) => { const Comp = useMemo(() => href && !disabled - ? ({ children }: PropsWithChildren) => {children} + ? ({ children }: PropsWithChildren) => {children} : ({ children }: PropsWithChildren) => <>{children}, [href, disabled]); const ButtonComp = useMemo(() => asChild ? Slot : 'button', [asChild]); @@ -40,23 +40,23 @@ const Button = forwardRef(({ {!loading && (typeof startDecorator === 'string' ? {startDecorator} : startDecorator)} - {loading && } + {loading && } {children} {typeof endDecorator === 'string' ? {endDecorator} : endDecorator} diff --git a/web/packages/ui/src/ButtonDropdown/ButtonDropdown.tsx b/web/packages/ui/src/ButtonDropdown/ButtonDropdown.tsx index e1c8e50d4c..5e502347f9 100644 --- a/web/packages/ui/src/ButtonDropdown/ButtonDropdown.tsx +++ b/web/packages/ui/src/ButtonDropdown/ButtonDropdown.tsx @@ -26,17 +26,17 @@ const ButtonDropdown = forwardRef(({ {!loading && startDecorator} - {loading && } + {loading && } {children} - ) }); diff --git a/web/packages/ui/src/Card/Card.tsx b/web/packages/ui/src/Card/Card.tsx index 4ecd8607c9..d88ae92004 100644 --- a/web/packages/ui/src/Card/Card.tsx +++ b/web/packages/ui/src/Card/Card.tsx @@ -1,5 +1,5 @@ import { type HTMLAttributes, type PropsWithChildren, type MouseEventHandler, forwardRef } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { Link } from '../Link'; export type CardProps = Omit, 'onClick'> & { @@ -15,7 +15,7 @@ function LinkCard({ href, children }: PropsWithChildren & Required>) { return ( - + ); } @@ -37,8 +37,8 @@ const CardForwarded = forwardRef(({ href, onClick, cl
@@ -49,19 +49,19 @@ CardForwarded.displayName = 'Card'; export const Card = CardForwarded; export function CardHeader({ className, ...props }: HTMLAttributes) { - return
; + return
; } export function CardTitle({ className, ...props }: HTMLAttributes) { - return
; + return
; } export function CardOverflow({ className, ...props }: HTMLAttributes) { - return
{props.children}
; + return
{props.children}
; } export function CardContent({ className, ...props }: HTMLAttributes) { - return
{props.children}
; + return
{props.children}
; } export function CardCover({ className, ...props }: HTMLAttributes) { diff --git a/web/packages/ui/src/Checkbox/Checkbox.tsx b/web/packages/ui/src/Checkbox/Checkbox.tsx index c203e7a2ea..af9643b72f 100644 --- a/web/packages/ui/src/Checkbox/Checkbox.tsx +++ b/web/packages/ui/src/Checkbox/Checkbox.tsx @@ -1,5 +1,5 @@ import { type ReactNode, useId, ComponentPropsWithoutRef } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { Check } from '@signalco/ui-icons'; import * as CheckboxPrimitive from '@radix-ui/react-checkbox' @@ -22,12 +22,12 @@ export function Checkbox({ const id = useId(); const readonlyChecked = defaultChecked; return ( -
+
- + {label && ( diff --git a/web/packages/ui/src/Chip/Chip.tsx b/web/packages/ui/src/Chip/Chip.tsx index f0a414b6f0..766d8c823b 100644 --- a/web/packages/ui/src/Chip/Chip.tsx +++ b/web/packages/ui/src/Chip/Chip.tsx @@ -1,5 +1,5 @@ import type { PropsWithChildren, MouseEventHandler, ReactNode } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import type { ColorPaletteProp } from '../theme'; import {Row} from '../Row'; import {Link} from '../Link'; @@ -18,19 +18,19 @@ export function Chip({ size, color, startDecorator, onClick, children, href, cla const actionable = typeof onClick !== 'undefined' || typeof href !== 'undefined'; const chipClassName = cx( - 'uitw-m-0 uitw-border', - size === 'sm' && 'uitw-rounded-xl uitw-py-0.5 uitw-px-1.5 uitw-text-xs', - (!size || size === 'md') && 'uitw-text-sm uitw-py-1 uitw-rounded-2xl uitw-px-3 uitw-px-2', - size === 'lg' && 'uitw-rounded-3xl uitw-px-3 uitw-text-base uitw-py-1', - (!color || color === 'neutral') && 'uitw-bg-card uitw-border-foreground/60 uitw-text-foreground/70', - (!color || color === 'neutral') && actionable && 'hover:uitw-bg-card-foreground/20', - color === 'info' && 'uitw-bg-sky-300 uitw-text-sky-800 uitw-border-sky-400', - color === 'warning' && 'uitw-bg-amber-300 uitw-text-amber-800 uitw-border-amber-300 uitw-border-amber-400', - color === 'success' && 'uitw-bg-lime-300 uitw-text-lime-800 uitw-border-lime-400', - color === 'error' && 'uitw-bg-red-300 uitw-text-red-800 uitw-border-red-400', - color === 'primary' && 'uitw-bg-neutral-950 uitw-text-white uitw-border-neutral-950', - color === 'secondary' && 'uitw-bg-neutral-500 uitw-text-white uitw-border-neutral-600', - actionable && 'hover:uitw-bg-opacity-90', + 'm-0 border', + size === 'sm' && 'rounded-xl py-0.5 px-1.5 text-xs', + (!size || size === 'md') && 'text-sm py-1 rounded-2xl px-3 px-2', + size === 'lg' && 'rounded-3xl px-3 text-base py-1', + (!color || color === 'neutral') && 'bg-card border-foreground/60 text-foreground/70', + (!color || color === 'neutral') && actionable && 'hover:bg-card-foreground/20', + color === 'info' && 'bg-sky-300 text-sky-800 border-sky-400', + color === 'warning' && 'bg-amber-300 text-amber-800 border-amber-300 border-amber-400', + color === 'success' && 'bg-lime-300 text-lime-800 border-lime-400', + color === 'error' && 'bg-red-300 text-red-800 border-red-400', + color === 'primary' && 'bg-neutral-950 text-white border-neutral-950', + color === 'secondary' && 'bg-neutral-500 text-white border-neutral-600', + actionable && 'hover:bg-opacity-90', ); const Wrapper = onClick ? (props: PropsWithChildren) => diff --git a/web/packages/ui/src/Container/Container.tsx b/web/packages/ui/src/Container/Container.tsx index 3d9d994d58..fe55f75547 100644 --- a/web/packages/ui/src/Container/Container.tsx +++ b/web/packages/ui/src/Container/Container.tsx @@ -1,5 +1,5 @@ import type { CSSProperties, PropsWithChildren } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; export type ContainerProps = PropsWithChildren<{ maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false, @@ -31,9 +31,9 @@ export function Container({ maxWidth, centered = true, padded = true, children } return (
diff --git a/web/packages/ui/src/Divider/Divider.tsx b/web/packages/ui/src/Divider/Divider.tsx index d9ec2802e6..aa4c04c42b 100644 --- a/web/packages/ui/src/Divider/Divider.tsx +++ b/web/packages/ui/src/Divider/Divider.tsx @@ -3,7 +3,7 @@ import { cx } from 'classix' export function Divider({orientation = 'horizontal'} : {orientation?: 'horizontal' | 'vertical'}) { return (
+ 'shrink-0 bg-border', + orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]')} /> ); } diff --git a/web/packages/ui/src/DotIndicator/DotIndicator.tsx b/web/packages/ui/src/DotIndicator/DotIndicator.tsx index 29f58beae6..6f7295b672 100644 --- a/web/packages/ui/src/DotIndicator/DotIndicator.tsx +++ b/web/packages/ui/src/DotIndicator/DotIndicator.tsx @@ -1,4 +1,4 @@ -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import type { ColorVariants } from '../theme'; export type DotIndicatorProps = { @@ -13,12 +13,12 @@ export function DotIndicator(props: DotIndicatorProps) { return (
setIsEditing(true)} > {value} - + ) } diff --git a/web/packages/ui/src/ErrorBoundary/ErrorBoundary.tsx b/web/packages/ui/src/ErrorBoundary/ErrorBoundary.tsx index 68659400f6..a17e429d77 100644 --- a/web/packages/ui/src/ErrorBoundary/ErrorBoundary.tsx +++ b/web/packages/ui/src/ErrorBoundary/ErrorBoundary.tsx @@ -19,7 +19,7 @@ export class ErrorBoundary extends Component}> + }> Something went wrong. ); diff --git a/web/packages/ui/src/FilterList/FilterList.tsx b/web/packages/ui/src/FilterList/FilterList.tsx index c3b7f47eda..a8310d9b02 100644 --- a/web/packages/ui/src/FilterList/FilterList.tsx +++ b/web/packages/ui/src/FilterList/FilterList.tsx @@ -1,6 +1,6 @@ import { Children, type PropsWithChildren } from 'react'; import { useEffect, useState } from 'react'; -import cx from 'classix'; +import { cx } from '@signalco/ui/cx'; import { Check, Close, ExpandDown } from '@signalco/ui-icons'; import { Typography } from '../Typography'; import { Stack } from '../Stack'; @@ -145,18 +145,18 @@ export function FilterList({ return ( -
+
({ value: i.id, label: i.label }))} value={checked?.at(0)} label={header} placeholder={placeholder ?? header ? `Select ${placeholder ?? header}` : undefined} - className="uitw-w-full" + className="w-full" onValueChange={(value) => { handleToggle(value); }} />
-
+
{header && {header}} (props: GalleryProps) { const { items, itemComponent, filters, gridHeader, gridFilters } = props; return ( -
+
{filters && } - + diff --git a/web/packages/ui/src/Gallery/GalleryFilters.tsx b/web/packages/ui/src/Gallery/GalleryFilters.tsx index 95c2352f0b..6a2d581015 100644 --- a/web/packages/ui/src/Gallery/GalleryFilters.tsx +++ b/web/packages/ui/src/Gallery/GalleryFilters.tsx @@ -8,7 +8,7 @@ export type GalleryFiltersProps = { export function GalleryFilters(props: GalleryFiltersProps) { const { filters } = props; return ( - + {filters} ); diff --git a/web/packages/ui/src/Gallery/GalleryGrid.tsx b/web/packages/ui/src/Gallery/GalleryGrid.tsx index e1c867ed0c..d6de636e27 100644 --- a/web/packages/ui/src/Gallery/GalleryGrid.tsx +++ b/web/packages/ui/src/Gallery/GalleryGrid.tsx @@ -15,7 +15,7 @@ export function GalleryGrid(props: GalleryGridProps +
{items.map(item => ( ))} diff --git a/web/packages/ui/src/Icon/Icon.tsx b/web/packages/ui/src/Icon/Icon.tsx index f09fd1dd7e..5a67e885c0 100644 --- a/web/packages/ui/src/Icon/Icon.tsx +++ b/web/packages/ui/src/Icon/Icon.tsx @@ -1,5 +1,5 @@ import type { HTMLAttributes } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; export type IconProps = HTMLAttributes; diff --git a/web/packages/ui/src/IconButton/IconButton.tsx b/web/packages/ui/src/IconButton/IconButton.tsx index d23f08121b..5ea4de75fc 100644 --- a/web/packages/ui/src/IconButton/IconButton.tsx +++ b/web/packages/ui/src/IconButton/IconButton.tsx @@ -1,5 +1,5 @@ import { forwardRef, type ComponentProps, PropsWithChildren, useMemo } from 'react'; -import {cx} from 'classix'; +import {cx} from '@signalco/ui/cx'; import { Link , LoaderSpinner } from '@signalco/ui-icons'; import { Slot } from '@radix-ui/react-slot'; import { Button } from '../Button'; @@ -19,19 +19,19 @@ const IconButton = forwardRef(({ - {loading && } + {loading && } {loading ? null : children} diff --git a/web/packages/ui/src/Input/Input.tsx b/web/packages/ui/src/Input/Input.tsx index f71c6ee2c3..6eb9edf271 100644 --- a/web/packages/ui/src/Input/Input.tsx +++ b/web/packages/ui/src/Input/Input.tsx @@ -1,5 +1,5 @@ import { InputHTMLAttributes, PropsWithChildren, useMemo } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { Stack } from '../Stack'; import { Row } from '../Row'; @@ -29,19 +29,19 @@ export function Input({ return ( - {label && } + {label && } {startDecorator ?? null} {endDecorator ?? null} - {helperText &&

{helperText}

} + {helperText &&

{helperText}

}
); } diff --git a/web/packages/ui/src/Link/Link.tsx b/web/packages/ui/src/Link/Link.tsx index c5a1a14468..aad7d691e0 100644 --- a/web/packages/ui/src/Link/Link.tsx +++ b/web/packages/ui/src/Link/Link.tsx @@ -1,26 +1,28 @@ import type { AnchorHTMLAttributes } from 'react'; import NextLink from 'next/link'; import type { Url } from 'next/dist/shared/lib/router/router'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { isAbsoluteUrl } from '@signalco/js'; export type LinkProps = AnchorHTMLAttributes & { href: string | Url; className?: string | undefined; 'aria-label'?: string | undefined; + legacy?: boolean; }; -export function Link({ className, href, children, ...rest }: LinkProps) { +export function Link({ className, href, children, legacy, ...rest }: LinkProps) { return ( {children} diff --git a/web/packages/ui/src/ListItem/ListItem.tsx b/web/packages/ui/src/ListItem/ListItem.tsx index b4a5942462..27dbaf9da8 100644 --- a/web/packages/ui/src/ListItem/ListItem.tsx +++ b/web/packages/ui/src/ListItem/ListItem.tsx @@ -1,5 +1,5 @@ import { Ref, type ReactElement } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { Row } from '../Row'; import { Button } from '../Button'; @@ -64,11 +64,11 @@ export function ListItem({ {typeof startDecorator === 'string' ? {startDecorator} : startDecorator ?? null} -
{label}
+
{label}
<> {typeof endDecorator === 'string' ? {endDecorator} : endDecorator ?? null} @@ -85,9 +85,9 @@ export function ListItem({ disabled={disabled} title={title} style={style} - className={cx('uitw-text-start uitw-h-auto', className)}> + className={cx('text-start h-auto', className)}> {typeof startDecorator === 'string' ? {startDecorator} : startDecorator ?? null} - {Boolean(label) &&
{label}
} + {Boolean(label) &&
{label}
} {Boolean(endDecorator) && ( <> {typeof endDecorator === 'string' ? {endDecorator} : endDecorator ?? null} diff --git a/web/packages/ui/src/ListTreeItem/ListTreeItem.tsx b/web/packages/ui/src/ListTreeItem/ListTreeItem.tsx index 4dde0d0eb2..d7cf66a30b 100644 --- a/web/packages/ui/src/ListTreeItem/ListTreeItem.tsx +++ b/web/packages/ui/src/ListTreeItem/ListTreeItem.tsx @@ -1,5 +1,5 @@ import { PropsWithChildren, ReactElement, useState } from 'react'; -import { cx } from 'classix'; +import { cx } from '@signalco/ui/cx'; import { ExpandDown } from '@signalco/ui-icons'; import { Tooltip } from '../Tooltip'; import { Stack } from '../Stack'; @@ -36,9 +36,9 @@ export function ListTreeItem({ return ( - + - + { if (placeholder == null || placeholder === 'circular') { return ( -
+
); @@ -45,7 +45,7 @@ export function Loadable({ if (placeholder === 'skeletonText') { return ( ); @@ -53,7 +53,7 @@ export function Loadable({ if (placeholder === 'skeletonRect') { return ( ); @@ -75,7 +75,7 @@ export function Loadable({ } } return ( - }> + }> {errorDisplay} ); @@ -89,7 +89,7 @@ export function Loadable({ )} {contentVisible && ( -
+
{indicator}
)} diff --git a/web/packages/ui/src/Menu/DropdownMenu.tsx b/web/packages/ui/src/Menu/DropdownMenu.tsx index ed147bab63..83435cf56d 100644 --- a/web/packages/ui/src/Menu/DropdownMenu.tsx +++ b/web/packages/ui/src/Menu/DropdownMenu.tsx @@ -31,14 +31,14 @@ const DropdownMenuSubTrigger = forwardRef< {children} - + )) DropdownMenuSubTrigger.displayName = SubTrigger.displayName; @@ -50,7 +50,7 @@ const DropdownMenuSubContent = forwardRef< - + {startDecorator} {children} {endDecorator} @@ -121,8 +121,8 @@ const DropdownMenuLabel = forwardRef<