@logto/core-kit 1.1.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/models/tenant.d.ts +7 -0
- package/lib/models/tenant.js +9 -0
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/package.json +16 -12
- package/scss/_console-themes.scss +24 -8
- package/scss/_fonts.scss +4 -0
- package/lib/utils/id.d.ts +0 -2
- package/lib/utils/id.js +0 -4
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tenant.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tenant.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { generateStandardId, buildIdGenerator } from '@logto/shared/universal';
|
|
2
|
+
// Use lowercase letters for tenant IDs to improve compatibility
|
|
3
|
+
const generateTenantId = buildIdGenerator(6, false);
|
|
4
|
+
export const createTenantMetadata = (databaseName, tenantId = generateTenantId(6)) => {
|
|
5
|
+
const parentRole = `logto_tenant_${databaseName}`;
|
|
6
|
+
const role = `logto_tenant_${databaseName}_${tenantId}`;
|
|
7
|
+
const password = generateStandardId(32);
|
|
8
|
+
return { id: tenantId, parentRole, role, password };
|
|
9
|
+
};
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/core-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
5
5
|
"homepage": "https://github.com/logto-io/toolkit#readme",
|
|
6
6
|
"repository": {
|
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "./lib/index.js",
|
|
13
13
|
"exports": {
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
".": {
|
|
15
|
+
"default": "./lib/index.js",
|
|
16
|
+
"types": "./lib/index.d.ts",
|
|
17
|
+
"import": "./lib/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./declaration": "./declaration/index.ts",
|
|
20
|
+
"./scss/*": "./scss/*.scss"
|
|
17
21
|
},
|
|
18
22
|
"types": "./lib/index.d.ts",
|
|
19
23
|
"files": [
|
|
@@ -25,23 +29,23 @@
|
|
|
25
29
|
"node": "^18.12.0"
|
|
26
30
|
},
|
|
27
31
|
"dependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
32
|
+
"@logto/language-kit": "^1.0.0",
|
|
33
|
+
"@logto/shared": "^2.0.0",
|
|
34
|
+
"color": "^4.2.3"
|
|
31
35
|
},
|
|
32
36
|
"optionalDependencies": {
|
|
33
37
|
"zod": "^3.20.2"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
40
|
"@jest/types": "^29.0.3",
|
|
37
|
-
"@silverhand/eslint-config": "
|
|
38
|
-
"@silverhand/eslint-config-react": "2.0.1",
|
|
41
|
+
"@silverhand/eslint-config": "3.0.1",
|
|
39
42
|
"@silverhand/essentials": "^2.5.0",
|
|
40
|
-
"@silverhand/ts-config": "
|
|
43
|
+
"@silverhand/ts-config": "3.0.0",
|
|
44
|
+
"@silverhand/ts-config-react": "3.0.0",
|
|
41
45
|
"@types/color": "^3.0.3",
|
|
42
46
|
"@types/jest": "^29.4.0",
|
|
43
47
|
"@types/node": "^18.11.18",
|
|
44
|
-
"@types/react": "^18.0.
|
|
48
|
+
"@types/react": "^18.0.31",
|
|
45
49
|
"eslint": "^8.34.0",
|
|
46
50
|
"jest": "^29.5.0",
|
|
47
51
|
"lint-staged": "^13.0.0",
|
|
@@ -49,7 +53,7 @@
|
|
|
49
53
|
"prettier": "^2.8.2",
|
|
50
54
|
"stylelint": "^15.0.0",
|
|
51
55
|
"tslib": "^2.4.1",
|
|
52
|
-
"typescript": "^
|
|
56
|
+
"typescript": "^5.0.0"
|
|
53
57
|
},
|
|
54
58
|
"eslintConfig": {
|
|
55
59
|
"extends": "@silverhand"
|
|
@@ -105,10 +105,15 @@
|
|
|
105
105
|
--color-tertiary-container: var(--color-tertiary-90);
|
|
106
106
|
--color-on-tertiary-container: var(--color-tertiary-10);
|
|
107
107
|
--color-error: var(--color-error-40);
|
|
108
|
-
--color-
|
|
109
|
-
--color-error-container: var(--color-error-
|
|
110
|
-
--color-on-error-container: var(--color-error-
|
|
111
|
-
--color-alert-container: var(--color-alert-
|
|
108
|
+
--color-error-hover: var(--color-error-50);
|
|
109
|
+
--color-error-container: var(--color-error-95);
|
|
110
|
+
--color-on-error-container: var(--color-error-50);
|
|
111
|
+
--color-alert-container: var(--color-alert-95);
|
|
112
|
+
--color-on-alert-container: var(--color-alert-70);
|
|
113
|
+
--color-success-container: var(--color-success-99);
|
|
114
|
+
--color-on-success-container: var(--color-success-70);
|
|
115
|
+
--color-info-container: var(--color-neutral-variant-90);
|
|
116
|
+
--color-on-info-container: var(--color-neutral-variant-60);
|
|
112
117
|
--color-background: var(--color-neutral-99);
|
|
113
118
|
--color-on-background: var(--color-neutral-10);
|
|
114
119
|
--color-surface: var(--color-neutral-99);
|
|
@@ -150,6 +155,9 @@
|
|
|
150
155
|
--color-hover-variant: rgba(93, 52, 242, 8%); // 8% Primary-40
|
|
151
156
|
--color-pressed-variant: rgba(93, 52, 242, 12%); // 12% Primary-40
|
|
152
157
|
--color-focused-variant: rgba(93, 52, 242, 16%); // 16% Primary-40
|
|
158
|
+
--color-env-tag-development: rgba(93, 52, 242, 15%);
|
|
159
|
+
--color-env-tag-staging: rgba(255, 185, 90, 35%);
|
|
160
|
+
--color-env-tag-production: rgba(131, 218, 133, 35%);
|
|
153
161
|
|
|
154
162
|
// Shadows
|
|
155
163
|
--shadow-1: 0 4px 8px rgba(0, 0, 0, 8%);
|
|
@@ -278,10 +286,15 @@
|
|
|
278
286
|
--color-tertiary-container: var(--color-tertiary-90);
|
|
279
287
|
--color-on-tertiary-container: var(--color-tertiary-30);
|
|
280
288
|
--color-error: var(--color-error-70);
|
|
281
|
-
--color-
|
|
282
|
-
--color-error-container: var(--color-error-
|
|
283
|
-
--color-on-error-container: var(--color-error-
|
|
289
|
+
--color-error-hover: var(--color-error-60);
|
|
290
|
+
--color-error-container: var(--color-error-95);
|
|
291
|
+
--color-on-error-container: var(--color-error-70);
|
|
284
292
|
--color-alert-container: var(--color-alert-90);
|
|
293
|
+
--color-on-alert-container: var(--color-alert-60);
|
|
294
|
+
--color-success-container: var(--color-success-90);
|
|
295
|
+
--color-on-success-container: var(--color-success-60);
|
|
296
|
+
--color-info-container: var(--color-neutral-variant-90);
|
|
297
|
+
--color-on-info-container: var(--color-neutral-variant-70);
|
|
285
298
|
--color-background: var(--color-neutral-99);
|
|
286
299
|
--color-on-background: var(--color-neutral-10);
|
|
287
300
|
--color-surface: var(--color-neutral-99);
|
|
@@ -323,6 +336,9 @@
|
|
|
323
336
|
--color-hover-variant: rgba(202, 190, 255, 8%); // 8% Primary-40
|
|
324
337
|
--color-pressed-variant: rgba(202, 190, 255, 12%); // 12% Primary-40
|
|
325
338
|
--color-focused-variant: rgba(202, 190, 255, 16%); // 16% Primary-40
|
|
339
|
+
--color-env-tag-development: rgba(202, 190, 255, 32%);
|
|
340
|
+
--color-env-tag-staging: rgba(235, 153, 24, 36%);
|
|
341
|
+
--color-env-tag-production: rgba(104, 190, 108, 36%);
|
|
326
342
|
|
|
327
343
|
// Shadows
|
|
328
344
|
--shadow-1: 0 4px 8px rgba(0, 0, 0, 8%);
|
|
@@ -337,7 +353,7 @@
|
|
|
337
353
|
--color-danger-focused: rgba(255, 180, 169, 16%); // 16% Error-40
|
|
338
354
|
--color-tooltip-background: var(--color-surface-4);
|
|
339
355
|
--color-tooltip-text: var(--color-neutral-10);
|
|
340
|
-
--color-overlay: rgba(0, 0, 0,
|
|
356
|
+
--color-overlay: rgba(0, 0, 0, 70%); // 70% Neutral-100
|
|
341
357
|
--color-drawer-overlay: rgba(0, 0, 0, 60%);
|
|
342
358
|
--color-guide-dropdown-background: var(--color-neutral-variant-80);
|
|
343
359
|
--color-guide-dropdown-border: var(--color-neutral-variant-70);
|
package/scss/_fonts.scss
CHANGED
|
@@ -12,6 +12,9 @@ $font-family:
|
|
|
12
12
|
|
|
13
13
|
:root {
|
|
14
14
|
--font-family: #{$font-family};
|
|
15
|
+
--font-display-1: 700 48/56px #{$font-family};
|
|
16
|
+
--font-display-2: 700 40px/48px #{$font-family};
|
|
17
|
+
--font-display-3: 700 32px/40px #{$font-family};
|
|
15
18
|
--font-headline-1: 600 32px/40px #{$font-family};
|
|
16
19
|
--font-headline-2: 600 28px/36px #{$font-family};
|
|
17
20
|
--font-headline-3: 600 24px/32px #{$font-family};
|
|
@@ -21,6 +24,7 @@ $font-family:
|
|
|
21
24
|
--font-label-1: 500 16px/24px #{$font-family};
|
|
22
25
|
--font-label-2: 500 14px/20px #{$font-family};
|
|
23
26
|
--font-label-3: 500 12px/16px #{$font-family};
|
|
27
|
+
--font-body-0: 400 18px/26px #{$font-family};
|
|
24
28
|
--font-body-1: 400 16px/24px #{$font-family};
|
|
25
29
|
--font-body-2: 400 14px/20px #{$font-family};
|
|
26
30
|
--font-body-3: 400 12px/16px #{$font-family};
|
package/lib/utils/id.d.ts
DELETED
package/lib/utils/id.js
DELETED