gemini-uis 0.1.0 → 0.1.2
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/index.d.ts +59 -0
- package/dist/index.js +73 -0
- package/dist/style.css +3 -0
- package/package.json +27 -17
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.github/workflows/deploy.yml +0 -59
- package/.husky/pre-commit +0 -12
- package/.storybook/index.css +0 -1
- package/.storybook/main.ts +0 -27
- package/.storybook/preview.ts +0 -22
- package/.storybook/vitest.setup.ts +0 -7
- package/eslint.config.js +0 -26
- package/index.html +0 -13
- package/src/icons/LoadingIcon.tsx +0 -34
- package/src/icons/index.ts +0 -2
- package/src/icons/types.ts +0 -6
- package/src/libs/Button/guide/Button.stories.tsx +0 -378
- package/src/libs/Button/guide/README.md +0 -144
- package/src/libs/Button/index.tsx +0 -69
- package/src/libs/Button/styles.ts +0 -71
- package/src/libs/Button/types.ts +0 -52
- package/src/libs/index.ts +0 -10
- package/src/libs/styles.css +0 -2
- package/src/utils/cn.ts +0 -8
- package/src/utils/index.ts +0 -1
- package/src/vite-env.d.ts +0 -7
- package/tsconfig.app.json +0 -34
- package/tsconfig.build.json +0 -20
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -103
- package/vitest.shims.d.ts +0 -1
- /package/{public → dist}/vite.svg +0 -0
package/src/libs/index.ts
DELETED
package/src/libs/styles.css
DELETED
package/src/utils/cn.ts
DELETED
package/src/utils/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as cn } from './cn'
|
package/src/vite-env.d.ts
DELETED
package/tsconfig.app.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"types": ["vite/client"],
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
|
|
11
|
-
/* Bundler mode */
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"moduleDetection": "force",
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
"jsx": "react-jsx",
|
|
18
|
-
|
|
19
|
-
/* Path Aliases */
|
|
20
|
-
"baseUrl": ".",
|
|
21
|
-
"paths": {
|
|
22
|
-
"@/*": ["./src/*"]
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
/* Linting */
|
|
26
|
-
"strict": true,
|
|
27
|
-
"noUnusedLocals": true,
|
|
28
|
-
"noUnusedParameters": true,
|
|
29
|
-
"erasableSyntaxOnly": true,
|
|
30
|
-
"noFallthroughCasesInSwitch": true,
|
|
31
|
-
"noUncheckedSideEffectImports": true
|
|
32
|
-
},
|
|
33
|
-
"include": ["src"]
|
|
34
|
-
}
|
package/tsconfig.build.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"jsx": "react-jsx",
|
|
7
|
-
"moduleResolution": "bundler",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"noEmit": false,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"emitDeclarationOnly": true,
|
|
13
|
-
"baseUrl": ".",
|
|
14
|
-
"paths": {
|
|
15
|
-
"@/*": ["./src/*"]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/libs", "src/utils", "src/icons"]
|
|
19
|
-
}
|
|
20
|
-
|
package/tsconfig.json
DELETED
package/tsconfig.node.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
-
"target": "ES2023",
|
|
5
|
-
"lib": ["ES2023"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
/* Linting */
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"erasableSyntaxOnly": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["vite.config.ts"]
|
|
26
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/// <reference types="vitest/config" />
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
3
|
-
import react from '@vitejs/plugin-react';
|
|
4
|
-
import dts from 'vite-plugin-dts';
|
|
5
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
6
|
-
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
|
-
|
|
10
|
-
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
11
|
-
import { playwright } from '@vitest/browser-playwright';
|
|
12
|
-
|
|
13
|
-
const dirname =
|
|
14
|
-
typeof __dirname !== 'undefined'
|
|
15
|
-
? __dirname
|
|
16
|
-
: path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
|
|
18
|
-
export default defineConfig(({ command }) => {
|
|
19
|
-
// 在构建时禁用 React Compiler,避免运行时注入 require 导致的 ES 模块兼容性问题
|
|
20
|
-
// React Compiler 应该在最终使用库的应用中运行
|
|
21
|
-
const enableReactCompiler = command !== 'build';
|
|
22
|
-
const isLibBuild = process.env.BUILD_LIB === 'true';
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
plugins: [
|
|
26
|
-
react({
|
|
27
|
-
babel: {
|
|
28
|
-
plugins: enableReactCompiler ? [['babel-plugin-react-compiler']] : [],
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
// ✅ 只在 dev / storybook 启用
|
|
33
|
-
!isLibBuild && tailwindcss(),
|
|
34
|
-
|
|
35
|
-
dts({
|
|
36
|
-
entryRoot: './src/libs',
|
|
37
|
-
tsconfigPath: './tsconfig.build.json',
|
|
38
|
-
insertTypesEntry: true,
|
|
39
|
-
rollupTypes: true,
|
|
40
|
-
exclude: ['**/*.css', '**/style-entry.ts', '**/*.stories.tsx', '**/*.test.ts', '**/*.test.tsx'],
|
|
41
|
-
}),
|
|
42
|
-
].filter(Boolean),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
resolve: {
|
|
46
|
-
alias: {
|
|
47
|
-
'@': path.resolve(dirname, './src'),
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
build: {
|
|
52
|
-
lib: {
|
|
53
|
-
entry: {
|
|
54
|
-
index: path.resolve(dirname, './src/libs/index.ts')
|
|
55
|
-
},
|
|
56
|
-
name: 'gemini-uis',
|
|
57
|
-
formats: ['es'],
|
|
58
|
-
fileName: () => 'index.js',
|
|
59
|
-
},
|
|
60
|
-
rollupOptions: {
|
|
61
|
-
external: [
|
|
62
|
-
'react',
|
|
63
|
-
'react-dom',
|
|
64
|
-
'react/jsx-runtime',
|
|
65
|
-
'react/jsx-dev-runtime',
|
|
66
|
-
],
|
|
67
|
-
output: {
|
|
68
|
-
assetFileNames: (assetInfo) => {
|
|
69
|
-
// 将所有 CSS 文件命名为 style.css
|
|
70
|
-
if (assetInfo.name && assetInfo.name.endsWith('.css')) {
|
|
71
|
-
return 'style.css';
|
|
72
|
-
}
|
|
73
|
-
return assetInfo.name || 'assets/[name]-[hash].[ext]';
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
cssCodeSplit: false,
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
test: {
|
|
81
|
-
projects: [
|
|
82
|
-
{
|
|
83
|
-
extends: true,
|
|
84
|
-
plugins: [
|
|
85
|
-
storybookTest({
|
|
86
|
-
configDir: path.join(dirname, '.storybook'),
|
|
87
|
-
}),
|
|
88
|
-
],
|
|
89
|
-
test: {
|
|
90
|
-
name: 'storybook',
|
|
91
|
-
browser: {
|
|
92
|
-
enabled: true,
|
|
93
|
-
headless: true,
|
|
94
|
-
provider: playwright({}),
|
|
95
|
-
instances: [{ browser: 'chromium' }],
|
|
96
|
-
},
|
|
97
|
-
setupFiles: ['.storybook/vitest.setup.ts'],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
});
|
package/vitest.shims.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@vitest/browser-playwright" />
|
|
File without changes
|