Skip to content

Commit bc24525

Browse files
fix: styling issues with wa tab components
1 parent b4eee3d commit bc24525

File tree

6 files changed

+62
-31
lines changed

6 files changed

+62
-31
lines changed

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tenants-react/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,21 @@
3232
},
3333
"devDependencies": {
3434
"@shared/eslint": "*",
35+
"@shared/js": "*",
36+
"@shared/react": "*",
3537
"@shared/tsconfig": "*",
3638
"@testing-library/jest-dom": "^6.1.0",
3739
"@types/react": "^17.0.20",
40+
"@vitejs/plugin-react": "^4.5.2",
3841
"jsdom": "^26.1.0",
3942
"prettier": "3.6.2",
4043
"pretty-quick": "^4.2.2",
44+
"rollup-plugin-peer-deps-external": "^2.2.4",
4145
"typescript": "^5.8.3",
42-
"vitest": "^1.3.1",
43-
"@shared/js": "*",
44-
"@shared/react": "*",
4546
"vite": "^6.3.5",
46-
"@vitejs/plugin-react": "^4.5.2",
47+
"vite-plugin-css-injected-by-js": "^3.5.2",
4748
"vite-plugin-dts": "^4.5.4",
48-
"rollup-plugin-peer-deps-external": "^2.2.4"
49+
"vitest": "^1.3.1"
4950
},
5051
"browser": {
5152
"fs": false
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from "react";
22

33
type TenantTabProps = {
4-
description: string;
5-
children: React.ReactNode;
6-
}
4+
description: string;
5+
children: React.ReactNode;
6+
};
77

88
export const TenantTab: React.FC<TenantTabProps> = ({ description, children }) => {
99
return (
1010
<div>
11-
<div>{description}</div>
12-
<div>{children}</div>
11+
<div>{description}</div>
12+
<div>{children}</div>
1313
</div>
1414
);
1515
};

packages/tenants-react/src/plugin.tsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
import { createPluginInitFunction } from "@shared/js";
22
import { buildContext, getQuerier } from "@shared/react";
3-
import { getTranslationFunction, SuperTokensPlugin, SuperTokensPublicConfig, SuperTokensPublicPlugin } from "supertokens-auth-react";
3+
import {
4+
getTranslationFunction,
5+
SuperTokensPlugin,
6+
SuperTokensPublicConfig,
7+
SuperTokensPublicPlugin,
8+
} from "supertokens-auth-react";
49
import { BooleanClaim } from "supertokens-auth-react/recipe/session";
510

611
import { getApi } from "./api";
712
import { API_PATH, PLUGIN_ID } from "./constants";
13+
import "./styles/global.css";
814
// import { InvitationAcceptWrapper } from "./invitation-accept-wrapper";
915
import { enableDebugLogs } from "./logger";
1016
import { TenantManagement } from "./pages/tenant-management/tenant-management";
1117
// import { SelectTenantPage } from "./select-tenant-page";
1218
import { defaultTranslationsTenants } from "./translations";
13-
import { SuperTokensPluginTenantsPluginConfig, SuperTokensPluginTenantsPluginNormalisedConfig, TranslationKeys } from "./types";
19+
import {
20+
SuperTokensPluginTenantsPluginConfig,
21+
SuperTokensPluginTenantsPluginNormalisedConfig,
22+
TranslationKeys,
23+
} from "./types";
1424

1525
const { usePluginContext, setContext } = buildContext<{
1626
plugins: SuperTokensPublicPlugin[];
@@ -137,14 +147,14 @@ export const init = createPluginInitFunction<
137147
return {
138148
status: "OK",
139149
routeHandlers: [
140-
{
141-
path: "/user/tenants/select",
142-
handler: () => SelectTenantPage.call(null),
143-
},
144-
{
145-
path: "/user/invite/accept",
146-
handler: () => InvitationAcceptWrapper.call(null),
147-
},
150+
// {
151+
// path: "/user/tenants/select",
152+
// handler: () => SelectTenantPage.call(null),
153+
// },
154+
// {
155+
// path: "/user/invite/accept",
156+
// handler: () => InvitationAcceptWrapper.call(null),
157+
// },
148158
],
149159
};
150160
},
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* Tab related styling */
2+
3+
.st-tab-group::part(base) {
4+
border: 1px solid #dddde3;
5+
border-radius: 12px;
6+
background-color: #f9f9f8;
7+
}

packages/tenants-react/vite.config.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
import { defineConfig } from 'vite';
2-
import react from '@vitejs/plugin-react';
3-
import dts from 'vite-plugin-dts';
4-
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
5-
import * as path from 'path';
6-
import packageJson from './package.json';
1+
import { defineConfig } from "vite";
2+
import react from "@vitejs/plugin-react";
3+
import dts from "vite-plugin-dts";
4+
import peerDepsExternal from "rollup-plugin-peer-deps-external";
5+
import * as path from "path";
6+
import packageJson from "./package.json";
7+
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
78

89
export default defineConfig(() => {
910
return {
1011
root: __dirname,
1112
plugins: [
1213
react(),
13-
dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.json') }),
14+
dts({ entryRoot: "src", tsconfigPath: path.join(__dirname, "tsconfig.json") }),
1415
peerDepsExternal(),
16+
cssInjectedByJsPlugin(),
1517
],
1618

1719
build: {
18-
outDir: 'dist',
20+
outDir: "dist",
1921
sourcemap: false,
2022
emptyOutDir: true,
2123
commonjsOptions: {
2224
transformMixedEsModules: true,
2325
},
2426
lib: {
2527
// Could also be a dictionary or array of multiple entry points.
26-
entry: 'src/index.ts',
27-
fileName: 'index',
28+
entry: "src/index.ts",
29+
fileName: "index",
2830
name: packageJson.name,
2931
// Change this to the formats you want to support.
3032
// Don't forget to update your package.json as well.
31-
formats: ['es' as const, 'cjs' as const],
33+
formats: ["es" as const, "cjs" as const],
3234
},
3335
rollupOptions: {
3436
cache: false,

0 commit comments

Comments
 (0)