@korioinc/next-core 1.0.1 → 1.0.3
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/dist/app-init.d.ts +41 -0
- package/dist/app-init.d.ts.map +1 -0
- package/dist/app-init.js +53 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/lingui-config.d.ts +23 -0
- package/dist/config/lingui-config.d.ts.map +1 -0
- package/dist/config/lingui-config.js +38 -0
- package/dist/i18n/init.d.ts +24 -0
- package/dist/i18n/init.d.ts.map +1 -0
- package/dist/i18n/init.js +24 -0
- package/dist/i18n/lingui-server.d.ts +32 -0
- package/dist/i18n/lingui-server.d.ts.map +1 -0
- package/dist/i18n/lingui-server.js +74 -0
- package/dist/styles/globals.css +369 -0
- package/dist/types/global.d.ts +3 -0
- package/dist/types/lingui-config.d.ts +5 -0
- package/package.json +4 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App initialization helper for Korio Next Core
|
|
3
|
+
* This file should be imported at the root of your Next.js application
|
|
4
|
+
*
|
|
5
|
+
* @example Create a file `app/init.ts`:
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import linguiConfig from '../lingui.config';
|
|
8
|
+
* import { createAppInitializer } from '@korioinc/next-core/app-init';
|
|
9
|
+
*
|
|
10
|
+
* export const initializeApp = createAppInitializer({
|
|
11
|
+
* linguiConfig,
|
|
12
|
+
* loadCatalog: async (locale) => {
|
|
13
|
+
* const { messages } = await import(`../lang/${locale}.po`);
|
|
14
|
+
* return { messages };
|
|
15
|
+
* },
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Then in your root layout or _app.tsx:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { initializeApp } from './init';
|
|
22
|
+
*
|
|
23
|
+
* // Call this before using any i18n features
|
|
24
|
+
* await initializeApp();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import type { LinguiConfig } from '@lingui/conf';
|
|
28
|
+
import { type LoadCatalogFunction } from './i18n/lingui-server';
|
|
29
|
+
export interface AppInitOptions {
|
|
30
|
+
linguiConfig: LinguiConfig;
|
|
31
|
+
loadCatalog: LoadCatalogFunction;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create an app initializer function
|
|
35
|
+
*/
|
|
36
|
+
export declare function createAppInitializer(options: AppInitOptions): () => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Direct initialization function
|
|
39
|
+
*/
|
|
40
|
+
export declare function initializeKorioApp(options: AppInitOptions): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=app-init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-init.d.ts","sourceRoot":"","sources":["../src/app-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAExF,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,mBAAmB,CAAC;CAClC;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,uBAU3D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,cAAc,iBAQ/D"}
|
package/dist/app-init.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App initialization helper for Korio Next Core
|
|
3
|
+
* This file should be imported at the root of your Next.js application
|
|
4
|
+
*
|
|
5
|
+
* @example Create a file `app/init.ts`:
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import linguiConfig from '../lingui.config';
|
|
8
|
+
* import { createAppInitializer } from '@korioinc/next-core/app-init';
|
|
9
|
+
*
|
|
10
|
+
* export const initializeApp = createAppInitializer({
|
|
11
|
+
* linguiConfig,
|
|
12
|
+
* loadCatalog: async (locale) => {
|
|
13
|
+
* const { messages } = await import(`../lang/${locale}.po`);
|
|
14
|
+
* return { messages };
|
|
15
|
+
* },
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Then in your root layout or _app.tsx:
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { initializeApp } from './init';
|
|
22
|
+
*
|
|
23
|
+
* // Call this before using any i18n features
|
|
24
|
+
* await initializeApp();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { initializeLinguiConfig } from './config/lingui-config';
|
|
28
|
+
import { initializeLinguiServer } from './i18n/lingui-server';
|
|
29
|
+
let initialized = false;
|
|
30
|
+
/**
|
|
31
|
+
* Create an app initializer function
|
|
32
|
+
*/
|
|
33
|
+
export function createAppInitializer(options) {
|
|
34
|
+
return async function initializeApp() {
|
|
35
|
+
if (initialized) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
initializeLinguiConfig(options.linguiConfig);
|
|
39
|
+
initializeLinguiServer(options.loadCatalog);
|
|
40
|
+
initialized = true;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Direct initialization function
|
|
45
|
+
*/
|
|
46
|
+
export async function initializeKorioApp(options) {
|
|
47
|
+
if (initialized) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
initializeLinguiConfig(options.linguiConfig);
|
|
51
|
+
initializeLinguiServer(options.loadCatalog);
|
|
52
|
+
initialized = true;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,eAAe,EACf,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LinguiConfig } from '@lingui/conf';
|
|
2
|
+
/**
|
|
3
|
+
* Initialize the lingui configuration with user's config
|
|
4
|
+
* This should be called once at the application startup
|
|
5
|
+
*/
|
|
6
|
+
export declare function initializeLinguiConfig(config: LinguiConfig): void;
|
|
7
|
+
/**
|
|
8
|
+
* Get the current lingui configuration
|
|
9
|
+
* Returns user's config if initialized, otherwise returns default config
|
|
10
|
+
*/
|
|
11
|
+
export declare function getLinguiConfig(): LinguiConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Get the locales from the configuration
|
|
14
|
+
*/
|
|
15
|
+
export declare function getLocalesFromConfig(): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Get the fallback locales from the configuration
|
|
18
|
+
*/
|
|
19
|
+
export declare function getFallbackLocalesFromConfig(): false | {
|
|
20
|
+
[locale: string]: string | string[];
|
|
21
|
+
default?: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
//# sourceMappingURL=lingui-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lingui-config.d.ts","sourceRoot":"","sources":["../../src/config/lingui-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAcjD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,QAE1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAG/C;AAED;;GAEG;AACH,wBAAgB,4BAA4B;;;cAG3C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Default configuration
|
|
2
|
+
const defaultLinguiConfig = {
|
|
3
|
+
locales: ['en', 'ko'],
|
|
4
|
+
sourceLocale: 'en',
|
|
5
|
+
fallbackLocales: {
|
|
6
|
+
default: 'en',
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
// This will be set by the initialization function
|
|
10
|
+
let userLinguiConfig = null;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the lingui configuration with user's config
|
|
13
|
+
* This should be called once at the application startup
|
|
14
|
+
*/
|
|
15
|
+
export function initializeLinguiConfig(config) {
|
|
16
|
+
userLinguiConfig = config;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the current lingui configuration
|
|
20
|
+
* Returns user's config if initialized, otherwise returns default config
|
|
21
|
+
*/
|
|
22
|
+
export function getLinguiConfig() {
|
|
23
|
+
return userLinguiConfig || defaultLinguiConfig;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the locales from the configuration
|
|
27
|
+
*/
|
|
28
|
+
export function getLocalesFromConfig() {
|
|
29
|
+
const config = getLinguiConfig();
|
|
30
|
+
return config.locales || ['en'];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the fallback locales from the configuration
|
|
34
|
+
*/
|
|
35
|
+
export function getFallbackLocalesFromConfig() {
|
|
36
|
+
const config = getLinguiConfig();
|
|
37
|
+
return config.fallbackLocales;
|
|
38
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LinguiConfig } from '@lingui/conf';
|
|
2
|
+
import { type LoadCatalogFunction } from './lingui-server';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize the Korio Next Core i18n system
|
|
5
|
+
* This should be called once at application startup
|
|
6
|
+
*
|
|
7
|
+
* @param config - Your Lingui configuration
|
|
8
|
+
* @param loadCatalog - Function to load message catalogs
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import linguiConfig from './lingui.config';
|
|
13
|
+
* import { initializeI18n } from '@korioinc/next-core/i18n/init';
|
|
14
|
+
*
|
|
15
|
+
* initializeI18n(linguiConfig, async (locale) => {
|
|
16
|
+
* const { messages } = await import(`./lang/${locale}.po`);
|
|
17
|
+
* return { messages };
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function initializeI18n(config: LinguiConfig, loadCatalog: LoadCatalogFunction): void;
|
|
22
|
+
export type { LoadCatalogFunction } from './lingui-server';
|
|
23
|
+
export type { LinguiConfig } from '@lingui/conf';
|
|
24
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/i18n/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,QAGpF;AAGD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { initializeLinguiConfig } from '../config/lingui-config';
|
|
2
|
+
import { initializeLinguiServer } from './lingui-server';
|
|
3
|
+
/**
|
|
4
|
+
* Initialize the Korio Next Core i18n system
|
|
5
|
+
* This should be called once at application startup
|
|
6
|
+
*
|
|
7
|
+
* @param config - Your Lingui configuration
|
|
8
|
+
* @param loadCatalog - Function to load message catalogs
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import linguiConfig from './lingui.config';
|
|
13
|
+
* import { initializeI18n } from '@korioinc/next-core/i18n/init';
|
|
14
|
+
*
|
|
15
|
+
* initializeI18n(linguiConfig, async (locale) => {
|
|
16
|
+
* const { messages } = await import(`./lang/${locale}.po`);
|
|
17
|
+
* return { messages };
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function initializeI18n(config, loadCatalog) {
|
|
22
|
+
initializeLinguiConfig(config);
|
|
23
|
+
initializeLinguiServer(loadCatalog);
|
|
24
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Messages } from '@lingui/core';
|
|
2
|
+
import { I18n } from '@lingui/core';
|
|
3
|
+
import 'server-only';
|
|
4
|
+
/**
|
|
5
|
+
* Load message catalog for a specific locale
|
|
6
|
+
* This function should be implemented by the consumer application
|
|
7
|
+
*/
|
|
8
|
+
export type LoadCatalogFunction = (locale: string) => Promise<{
|
|
9
|
+
messages: Messages;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize the lingui server with a catalog loader function
|
|
13
|
+
* This should be called once at application startup
|
|
14
|
+
*/
|
|
15
|
+
export declare function initializeLinguiServer(loadCatalog: LoadCatalogFunction): void;
|
|
16
|
+
/**
|
|
17
|
+
* Get all message catalogs
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAllMessages(): Promise<{
|
|
20
|
+
[key: string]: Messages;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Get all i18n instances
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAllI18nInstances(): Promise<{
|
|
26
|
+
[key: string]: I18n;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Get i18n instance for a specific locale
|
|
30
|
+
*/
|
|
31
|
+
export declare function getI18nInstance(locale: string): Promise<I18n>;
|
|
32
|
+
//# sourceMappingURL=lingui-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lingui-server.d.ts","sourceRoot":"","sources":["../../src/i18n/lingui-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAI/C,OAAO,aAAa,CAAC;AAMrB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAItF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,mBAAmB,QAKtE;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAC,CAyB3E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAmB5E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWnE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { setupI18n } from '@lingui/core';
|
|
2
|
+
import { getLocalesFromConfig } from '../config/lingui-config';
|
|
3
|
+
import 'server-only';
|
|
4
|
+
// Cache for loaded catalogs and i18n instances
|
|
5
|
+
let catalogsCache = null;
|
|
6
|
+
let i18nInstancesCache = null;
|
|
7
|
+
let loadCatalogFunction = null;
|
|
8
|
+
/**
|
|
9
|
+
* Initialize the lingui server with a catalog loader function
|
|
10
|
+
* This should be called once at application startup
|
|
11
|
+
*/
|
|
12
|
+
export function initializeLinguiServer(loadCatalog) {
|
|
13
|
+
loadCatalogFunction = loadCatalog;
|
|
14
|
+
// Reset caches when re-initializing
|
|
15
|
+
catalogsCache = null;
|
|
16
|
+
i18nInstancesCache = null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get all message catalogs
|
|
20
|
+
*/
|
|
21
|
+
export async function getAllMessages() {
|
|
22
|
+
if (catalogsCache) {
|
|
23
|
+
return catalogsCache;
|
|
24
|
+
}
|
|
25
|
+
if (!loadCatalogFunction) {
|
|
26
|
+
console.warn('Lingui server not initialized. Using empty catalogs.');
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
const locales = getLocalesFromConfig();
|
|
30
|
+
const catalogs = await Promise.all(locales.map(async (locale) => {
|
|
31
|
+
try {
|
|
32
|
+
const { messages } = await loadCatalogFunction(locale);
|
|
33
|
+
return { [locale]: messages };
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.warn(`Failed to load catalog for locale "${locale}":`, error);
|
|
37
|
+
return { [locale]: {} };
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
catalogsCache = catalogs.reduce((acc, catalog) => ({ ...acc, ...catalog }), {});
|
|
41
|
+
return catalogsCache;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get all i18n instances
|
|
45
|
+
*/
|
|
46
|
+
export async function getAllI18nInstances() {
|
|
47
|
+
if (i18nInstancesCache) {
|
|
48
|
+
return i18nInstancesCache;
|
|
49
|
+
}
|
|
50
|
+
const allMessages = await getAllMessages();
|
|
51
|
+
const locales = getLocalesFromConfig();
|
|
52
|
+
i18nInstancesCache = locales.reduce((acc, locale) => {
|
|
53
|
+
const messages = allMessages[locale] ?? {};
|
|
54
|
+
const i18n = setupI18n({
|
|
55
|
+
locale,
|
|
56
|
+
messages: { [locale]: messages },
|
|
57
|
+
});
|
|
58
|
+
return { ...acc, [locale]: i18n };
|
|
59
|
+
}, {});
|
|
60
|
+
return i18nInstancesCache;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get i18n instance for a specific locale
|
|
64
|
+
*/
|
|
65
|
+
export async function getI18nInstance(locale) {
|
|
66
|
+
const instances = await getAllI18nInstances();
|
|
67
|
+
if (!instances[locale]) {
|
|
68
|
+
console.warn(`No i18n instance found for locale "${locale}"`);
|
|
69
|
+
// Fallback to 'en' or first available locale
|
|
70
|
+
const fallbackLocale = instances['en'] ? 'en' : Object.keys(instances)[0];
|
|
71
|
+
return instances[fallbackLocale];
|
|
72
|
+
}
|
|
73
|
+
return instances[locale];
|
|
74
|
+
}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@import 'tw-animate-css';
|
|
3
|
+
|
|
4
|
+
/* Include all core package components and auth modules */
|
|
5
|
+
@source "../**/*.{ts,tsx,js,jsx}";
|
|
6
|
+
|
|
7
|
+
/************************************************************/
|
|
8
|
+
/* font */
|
|
9
|
+
@import 'pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css';
|
|
10
|
+
|
|
11
|
+
/* plugin */
|
|
12
|
+
@plugin '@tailwindcss/typography';
|
|
13
|
+
|
|
14
|
+
/* custom */
|
|
15
|
+
@theme {
|
|
16
|
+
--text-xxs: 0.65rem;
|
|
17
|
+
--text-xxs--line-height: 1.5;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/************************************************************/
|
|
21
|
+
/* shadcn-ui/globals.css (https://github.com/shadcn-ui/ui/blob/main/apps/v4/styles/globals.css) */
|
|
22
|
+
@custom-variant dark (&:is(.dark *));
|
|
23
|
+
|
|
24
|
+
@custom-variant fixed (&:is(.layout-fixed *));
|
|
25
|
+
|
|
26
|
+
@theme inline {
|
|
27
|
+
--breakpoint-3xl: 1600px;
|
|
28
|
+
--breakpoint-4xl: 2000px;
|
|
29
|
+
--font-sans: var(--font-sans);
|
|
30
|
+
--font-mono: var(--font-mono);
|
|
31
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
32
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
33
|
+
--radius-lg: var(--radius);
|
|
34
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
35
|
+
--color-background: var(--background);
|
|
36
|
+
--color-foreground: var(--foreground);
|
|
37
|
+
--color-card: var(--card);
|
|
38
|
+
--color-card-foreground: var(--card-foreground);
|
|
39
|
+
--color-popover: var(--popover);
|
|
40
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
41
|
+
--color-primary: var(--primary);
|
|
42
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
43
|
+
--color-secondary: var(--secondary);
|
|
44
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
45
|
+
--color-muted: var(--muted);
|
|
46
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
47
|
+
--color-accent: var(--accent);
|
|
48
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
49
|
+
--color-destructive: var(--destructive);
|
|
50
|
+
--color-border: var(--border);
|
|
51
|
+
--color-input: var(--input);
|
|
52
|
+
--color-ring: var(--ring);
|
|
53
|
+
--color-chart-1: var(--chart-1);
|
|
54
|
+
--color-chart-2: var(--chart-2);
|
|
55
|
+
--color-chart-3: var(--chart-3);
|
|
56
|
+
--color-chart-4: var(--chart-4);
|
|
57
|
+
--color-chart-5: var(--chart-5);
|
|
58
|
+
--color-sidebar: var(--sidebar);
|
|
59
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
60
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
61
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
62
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
63
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
64
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
65
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
66
|
+
--color-surface: var(--surface);
|
|
67
|
+
--color-surface-foreground: var(--surface-foreground);
|
|
68
|
+
--color-code: var(--code);
|
|
69
|
+
--color-code-foreground: var(--code-foreground);
|
|
70
|
+
--color-code-highlight: var(--code-highlight);
|
|
71
|
+
--color-code-number: var(--code-number);
|
|
72
|
+
--color-selection: var(--selection);
|
|
73
|
+
--color-selection-foreground: var(--selection-foreground);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:root {
|
|
77
|
+
--radius: 0.625rem;
|
|
78
|
+
--background: oklch(1 0 0);
|
|
79
|
+
--foreground: oklch(0.145 0 0);
|
|
80
|
+
--card: oklch(1 0 0);
|
|
81
|
+
--card-foreground: oklch(0.145 0 0);
|
|
82
|
+
--popover: oklch(1 0 0);
|
|
83
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
84
|
+
--primary: oklch(0.205 0 0);
|
|
85
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
86
|
+
--secondary: oklch(0.97 0 0);
|
|
87
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
88
|
+
--muted: oklch(0.97 0 0);
|
|
89
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
90
|
+
--accent: oklch(0.97 0 0);
|
|
91
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
92
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
93
|
+
--border: oklch(0.922 0 0);
|
|
94
|
+
--input: oklch(0.922 0 0);
|
|
95
|
+
--ring: oklch(0.708 0 0);
|
|
96
|
+
--chart-1: var(--color-blue-300);
|
|
97
|
+
--chart-2: var(--color-blue-500);
|
|
98
|
+
--chart-3: var(--color-blue-600);
|
|
99
|
+
--chart-4: var(--color-blue-700);
|
|
100
|
+
--chart-5: var(--color-blue-800);
|
|
101
|
+
--sidebar: oklch(0.985 0 0);
|
|
102
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
103
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
104
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
105
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
106
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
107
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
108
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
109
|
+
--surface: oklch(0.98 0 0);
|
|
110
|
+
--surface-foreground: var(--foreground);
|
|
111
|
+
--code: var(--surface);
|
|
112
|
+
--code-foreground: var(--surface-foreground);
|
|
113
|
+
--code-highlight: oklch(0.96 0 0);
|
|
114
|
+
--code-number: oklch(0.56 0 0);
|
|
115
|
+
--selection: oklch(0.145 0 0);
|
|
116
|
+
--selection-foreground: oklch(1 0 0);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.dark {
|
|
120
|
+
--background: oklch(0.145 0 0);
|
|
121
|
+
--foreground: oklch(0.985 0 0);
|
|
122
|
+
--card: oklch(0.205 0 0);
|
|
123
|
+
--card-foreground: oklch(0.985 0 0);
|
|
124
|
+
--popover: oklch(0.269 0 0);
|
|
125
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
126
|
+
--primary: oklch(0.922 0 0);
|
|
127
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
128
|
+
--secondary: oklch(0.269 0 0);
|
|
129
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
130
|
+
--muted: oklch(0.269 0 0);
|
|
131
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
132
|
+
--accent: oklch(0.371 0 0);
|
|
133
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
134
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
135
|
+
--border: oklch(1 0 0 / 10%);
|
|
136
|
+
--input: oklch(1 0 0 / 15%);
|
|
137
|
+
--ring: oklch(0.556 0 0);
|
|
138
|
+
--chart-1: var(--color-blue-300);
|
|
139
|
+
--chart-2: var(--color-blue-500);
|
|
140
|
+
--chart-3: var(--color-blue-600);
|
|
141
|
+
--chart-4: var(--color-blue-700);
|
|
142
|
+
--chart-5: var(--color-blue-800);
|
|
143
|
+
--sidebar: oklch(0.205 0 0);
|
|
144
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
145
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
146
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
147
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
148
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
149
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
150
|
+
--sidebar-ring: oklch(0.439 0 0);
|
|
151
|
+
--surface: oklch(0.2 0 0);
|
|
152
|
+
--surface-foreground: oklch(0.708 0 0);
|
|
153
|
+
--code: var(--surface);
|
|
154
|
+
--code-foreground: var(--surface-foreground);
|
|
155
|
+
--code-highlight: oklch(0.27 0 0);
|
|
156
|
+
--code-number: oklch(0.72 0 0);
|
|
157
|
+
--selection: oklch(0.922 0 0);
|
|
158
|
+
--selection-foreground: oklch(0.205 0 0);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@layer base {
|
|
162
|
+
* {
|
|
163
|
+
@apply border-border outline-ring/50;
|
|
164
|
+
}
|
|
165
|
+
::selection {
|
|
166
|
+
@apply bg-selection text-selection-foreground;
|
|
167
|
+
}
|
|
168
|
+
html {
|
|
169
|
+
@apply scroll-smooth;
|
|
170
|
+
}
|
|
171
|
+
body {
|
|
172
|
+
font-synthesis-weight: none;
|
|
173
|
+
text-rendering: optimizeLegibility;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@supports (font: -apple-system-body) and (-webkit-appearance: none) {
|
|
177
|
+
[data-wrapper] {
|
|
178
|
+
@apply min-[1800px]:border-t;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
a:active,
|
|
183
|
+
button:active {
|
|
184
|
+
@apply opacity-60 md:opacity-100;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@utility border-grid {
|
|
189
|
+
@apply border-border/50 dark:border-border;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@utility section-soft {
|
|
193
|
+
@apply from-background to-surface/40 dark:bg-background 3xl:fixed:bg-none bg-gradient-to-b;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@utility theme-container {
|
|
197
|
+
@apply font-sans;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@utility container-wrapper {
|
|
201
|
+
@apply 3xl:fixed:max-w-[calc(var(--breakpoint-2xl)+2rem)] mx-auto w-full px-2;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@utility container {
|
|
205
|
+
@apply 3xl:max-w-screen-2xl mx-auto max-w-[1400px] px-4 lg:px-8;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@utility no-scrollbar {
|
|
209
|
+
-ms-overflow-style: none;
|
|
210
|
+
scrollbar-width: none;
|
|
211
|
+
|
|
212
|
+
&::-webkit-scrollbar {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@utility border-ghost {
|
|
218
|
+
@apply after:border-border relative after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@utility step {
|
|
222
|
+
counter-increment: step;
|
|
223
|
+
@apply relative;
|
|
224
|
+
|
|
225
|
+
&:before {
|
|
226
|
+
@apply text-muted-foreground right-0 mr-2 hidden size-7 items-center justify-center rounded-full text-center -indent-px font-mono text-sm font-medium md:absolute;
|
|
227
|
+
content: counter(step);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@utility extend-touch-target {
|
|
232
|
+
@media (pointer: coarse) {
|
|
233
|
+
@apply relative touch-manipulation after:absolute after:-inset-2;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@layer components {
|
|
238
|
+
.steps {
|
|
239
|
+
&:first-child {
|
|
240
|
+
@apply !mt-0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&:first-child > h3:first-child {
|
|
244
|
+
@apply !mt-0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
> h3 {
|
|
248
|
+
@apply !mt-16;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
> h3 + p {
|
|
252
|
+
@apply !mt-2;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
[data-rehype-pretty-code-figure] {
|
|
257
|
+
background-color: var(--color-code);
|
|
258
|
+
color: var(--color-code-foreground);
|
|
259
|
+
border-radius: var(--radius-lg);
|
|
260
|
+
border-width: 0px;
|
|
261
|
+
border-color: var(--border);
|
|
262
|
+
margin-top: calc(var(--spacing) * 6);
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
font-size: var(--text-sm);
|
|
265
|
+
outline: none;
|
|
266
|
+
position: relative;
|
|
267
|
+
@apply -mx-1 md:-mx-1;
|
|
268
|
+
|
|
269
|
+
&:has([data-rehype-pretty-code-title]) [data-slot='copy-button'] {
|
|
270
|
+
top: calc(var(--spacing) * 1.5) !important;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
[data-rehype-pretty-code-title] {
|
|
275
|
+
border-bottom: color-mix(in oklab, var(--border) 30%, transparent);
|
|
276
|
+
border-bottom-width: 1px;
|
|
277
|
+
border-bottom-style: solid;
|
|
278
|
+
padding-block: calc(var(--spacing) * 2.5);
|
|
279
|
+
padding-inline: calc(var(--spacing) * 4);
|
|
280
|
+
font-size: var(--text-sm);
|
|
281
|
+
font-family: var(--font-mono);
|
|
282
|
+
color: var(--color-code-foreground);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
[data-line-numbers] {
|
|
286
|
+
display: grid;
|
|
287
|
+
min-width: 100%;
|
|
288
|
+
white-space: pre;
|
|
289
|
+
border: 0;
|
|
290
|
+
background: transparent;
|
|
291
|
+
padding: 0;
|
|
292
|
+
counter-reset: line;
|
|
293
|
+
box-decoration-break: clone;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
[data-line-numbers] [data-line]::before {
|
|
297
|
+
font-size: var(--text-sm);
|
|
298
|
+
counter-increment: line;
|
|
299
|
+
content: counter(line);
|
|
300
|
+
display: inline-block;
|
|
301
|
+
width: calc(var(--spacing) * 16);
|
|
302
|
+
padding-right: calc(var(--spacing) * 6);
|
|
303
|
+
text-align: right;
|
|
304
|
+
color: var(--color-code-number);
|
|
305
|
+
background-color: var(--color-code);
|
|
306
|
+
position: sticky;
|
|
307
|
+
left: 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
[data-line-numbers] [data-highlighted-line][data-line]::before {
|
|
311
|
+
background-color: var(--color-code-highlight);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
[data-line] {
|
|
315
|
+
padding-top: calc(var(--spacing) * 0.5);
|
|
316
|
+
padding-bottom: calc(var(--spacing) * 0.5);
|
|
317
|
+
min-height: calc(var(--spacing) * 1);
|
|
318
|
+
width: 100%;
|
|
319
|
+
display: inline-block;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
[data-line] span {
|
|
323
|
+
color: var(--shiki-light);
|
|
324
|
+
|
|
325
|
+
@variant dark {
|
|
326
|
+
color: var(--shiki-dark) !important;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
[data-highlighted-line],
|
|
331
|
+
[data-highlighted-chars] {
|
|
332
|
+
position: relative;
|
|
333
|
+
background-color: var(--color-code-highlight);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
[data-highlighted-line] {
|
|
337
|
+
&:after {
|
|
338
|
+
position: absolute;
|
|
339
|
+
top: 0;
|
|
340
|
+
left: 0;
|
|
341
|
+
width: 2px;
|
|
342
|
+
height: 100%;
|
|
343
|
+
content: '';
|
|
344
|
+
background-color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
[data-highlighted-chars] {
|
|
349
|
+
border-radius: var(--radius-sm);
|
|
350
|
+
padding-inline: 0.3rem;
|
|
351
|
+
padding-block: 0.1rem;
|
|
352
|
+
font-family: var(--font-mono);
|
|
353
|
+
font-size: 0.8rem;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/************************************************************/
|
|
358
|
+
/* floating-ui */
|
|
359
|
+
.panel {
|
|
360
|
+
display: none;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.arrow {
|
|
364
|
+
position: absolute;
|
|
365
|
+
background-color: inherit;
|
|
366
|
+
width: 8px;
|
|
367
|
+
height: 8px;
|
|
368
|
+
transform: rotate(45deg);
|
|
369
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@korioinc/next-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./ads": {
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"import": "./dist/components/index.js",
|
|
54
54
|
"default": "./dist/components/index.js"
|
|
55
55
|
},
|
|
56
|
-
"./styles/*": "./
|
|
56
|
+
"./styles/*": "./dist/styles/*",
|
|
57
|
+
"./types/*": "./dist/types/*"
|
|
57
58
|
},
|
|
58
59
|
"files": [
|
|
59
60
|
"dist",
|
|
@@ -87,7 +88,6 @@
|
|
|
87
88
|
"clsx": "^2.1.1",
|
|
88
89
|
"cookies-next": "^6.1.0",
|
|
89
90
|
"cosmiconfig": "^9.0.0",
|
|
90
|
-
"jiti": "^1.21.7",
|
|
91
91
|
"jose": "^6.1.0",
|
|
92
92
|
"localforage": "^1.10.0",
|
|
93
93
|
"negotiator": "^1.0.0",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"react-dom": ">=19"
|
|
118
118
|
},
|
|
119
119
|
"scripts": {
|
|
120
|
-
"build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
|
|
120
|
+
"build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json && cp -r src/styles dist/ && cp -r src/types dist/",
|
|
121
121
|
"dev": "tsc -p tsconfig.json -w & tsc-alias -p tsconfig.json -w",
|
|
122
122
|
"lint": "eslint . --max-warnings 0",
|
|
123
123
|
"generate:component": "turbo gen react-component"
|