gemini-uis 0.1.0 → 0.1.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/dist/index.d.ts +45 -0
- package/dist/index.js +73 -0
- package/dist/style.css +3 -0
- package/package.json +10 -2
- 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/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { RefAttributes } from 'react';
|
|
5
|
+
|
|
6
|
+
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Button组件的基础属性接口 - 简化版
|
|
10
|
+
*/
|
|
11
|
+
export declare interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'size' | 'children' | 'type'> {
|
|
12
|
+
/** 按钮变体 */
|
|
13
|
+
type?: ButtonType;
|
|
14
|
+
/** 按钮尺寸 */
|
|
15
|
+
size?: ButtonSize;
|
|
16
|
+
/** 是否圆角 */
|
|
17
|
+
rounded?: boolean;
|
|
18
|
+
/** 是否禁用 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 是否显示加载状态 */
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** 自定义类名 */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** 子元素 */
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
/** 按钮类型 */
|
|
27
|
+
htmlType?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Button组件的ref类型
|
|
32
|
+
*/
|
|
33
|
+
export declare type ButtonRef = HTMLButtonElement;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Button组件的尺寸类型 - 简化版
|
|
37
|
+
*/
|
|
38
|
+
export declare type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Button组件的变体类型 - 简化版
|
|
42
|
+
*/
|
|
43
|
+
export declare type ButtonType = 'primary' | 'default' | 'secondary' | 'outline' | 'ghost' | 'text' | 'danger';
|
|
44
|
+
|
|
45
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
const getVariantStyles = (e) => {
|
|
4
|
+
let n = {
|
|
5
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",
|
|
6
|
+
default: "bg-white text-gray-700 hover:bg-gray-50 focus:ring-gray-500 border border-gray-300",
|
|
7
|
+
secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500 border border-gray-300",
|
|
8
|
+
outline: "bg-transparent text-blue-600 hover:bg-blue-50 focus:ring-blue-500 border border-blue-600",
|
|
9
|
+
ghost: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500",
|
|
10
|
+
text: "bg-transparent text-gray-700 focus:ring-gray-500",
|
|
11
|
+
danger: "bg-red-600 text-white hover:bg-red-700 focus:ring-red-500"
|
|
12
|
+
};
|
|
13
|
+
return n[e] || n.primary;
|
|
14
|
+
}, getSizeStyles = (e) => {
|
|
15
|
+
let n = {
|
|
16
|
+
xs: "px-2 py-1 text-xs min-h-[1.5rem]",
|
|
17
|
+
sm: "px-3 py-1.5 text-sm min-h-[2rem]",
|
|
18
|
+
md: "px-4 py-2 text-sm min-h-[2.5rem]",
|
|
19
|
+
lg: "px-6 py-3 text-base min-h-[3rem]",
|
|
20
|
+
xl: "px-8 py-4 text-lg min-h-[3.5rem]"
|
|
21
|
+
};
|
|
22
|
+
return n[e] || n.md;
|
|
23
|
+
}, getRoundedStyles = (e) => e ? "rounded-lg" : "rounded-none", getButtonStyles = (e = "primary", n = "md", r = !1, s = !1, c = !1, l) => [
|
|
24
|
+
"inline-flex items-center justify-center font-medium text-center transition-all duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
25
|
+
getVariantStyles(e),
|
|
26
|
+
getSizeStyles(n),
|
|
27
|
+
getRoundedStyles(r),
|
|
28
|
+
s ? "opacity-50 cursor-not-allowed" : "",
|
|
29
|
+
c ? "cursor-wait" : "",
|
|
30
|
+
l
|
|
31
|
+
].filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
32
|
+
function cn(...e) {
|
|
33
|
+
return e.filter(Boolean).join(" ");
|
|
34
|
+
}
|
|
35
|
+
var cn_default = cn, LoadingIcon_default = ({ size: e = 16, className: i = "animate-spin", ...a }) => /* @__PURE__ */ jsxs("svg", {
|
|
36
|
+
width: e,
|
|
37
|
+
height: e,
|
|
38
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
39
|
+
fill: "none",
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
className: i,
|
|
42
|
+
...a,
|
|
43
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
44
|
+
className: "opacity-25",
|
|
45
|
+
cx: "12",
|
|
46
|
+
cy: "12",
|
|
47
|
+
r: "10",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeWidth: "4"
|
|
50
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
51
|
+
className: "opacity-75",
|
|
52
|
+
fill: "currentColor",
|
|
53
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
54
|
+
})]
|
|
55
|
+
}), Button_default = forwardRef(({ type: e = "primary", size: i = "md", rounded: a = !1, disabled: o = !1, loading: c = !1, className: u, children: d, htmlType: f = "button", onClick: p, ...m }, h) => {
|
|
56
|
+
let g = o || c;
|
|
57
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
58
|
+
ref: h,
|
|
59
|
+
type: f,
|
|
60
|
+
disabled: g,
|
|
61
|
+
onClick: (e) => {
|
|
62
|
+
if (g) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
p?.(e);
|
|
67
|
+
},
|
|
68
|
+
className: cn_default(getButtonStyles(e, i, a, g, c, u)),
|
|
69
|
+
...m,
|
|
70
|
+
children: [c && /* @__PURE__ */ jsx(LoadingIcon_default, { className: "animate-spin w-4 h-4 mr-2" }), d]
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
export { Button_default as Button };
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:#fb2c36;--color-red-600:#e40014;--color-red-700:#bf000f;--color-blue-50:#eff6ff;--color-blue-500:#3080ff;--color-blue-600:#155dfc;--color-blue-700:#1447e6;--color-gray-50:#f9fafb;--color-gray-100:#f3f4f6;--color-gray-200:#e5e7eb;--color-gray-300:#d1d5dc;--color-gray-500:#6a7282;--color-gray-700:#364153;--color-gray-900:#101828;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--radius-lg:.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--color-red-500:lab(55.4814% 75.0732 48.8528);--color-red-600:lab(48.4493% 77.4328 61.5452);--color-red-700:lab(40.4273% 67.2623 53.7441);--color-blue-50:lab(96.492% -1.14644 -5.11479);--color-blue-500:lab(54.1736% 13.3369 -74.6839);--color-blue-600:lab(44.0605% 29.0279 -86.0352);--color-blue-700:lab(36.9089% 35.0961 -85.6872);--color-gray-50:lab(98.2596% -.247031 -.706708);--color-gray-100:lab(96.1596% -.0823438 -1.13575);--color-gray-200:lab(91.6229% -.159115 -2.26791);--color-gray-300:lab(85.1236% -.612259 -3.7138);--color-gray-500:lab(47.7841% -.393182 -10.0268);--color-gray-700:lab(27.1134% -.956401 -12.3224);--color-gray-900:lab(8.11897% .811279 -12.254)}}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.fixed{position:fixed}.mr-2{margin-right:calc(var(--spacing)*2)}.contents{display:contents}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.h-4{height:calc(var(--spacing)*4)}.min-h-\[1\.5rem\]{min-height:1.5rem}.min-h-\[2\.5rem\]{min-height:2.5rem}.min-h-\[2rem\]{min-height:2rem}.min-h-\[3\.5rem\]{min-height:3.5rem}.min-h-\[3rem\]{min-height:3rem}.w-4{width:calc(var(--spacing)*4)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-none{border-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-300{border-color:var(--color-gray-300)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.text-center{text-align:center}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-blue-600{color:var(--color-blue-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}@media (hover:hover){.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-gray-500:focus{--tw-ring-color:var(--color-gray-500)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(360deg)}}
|
|
3
|
+
/*$vite$:1*/
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gemini-uis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"*.css"
|
|
10
|
+
],
|
|
6
11
|
"scripts": {
|
|
7
12
|
"dev": "storybook dev -p 6006",
|
|
8
13
|
"build": "tsc -b && vite build",
|
|
@@ -11,6 +16,9 @@
|
|
|
11
16
|
"build-storybook": "storybook build -o storybook-static",
|
|
12
17
|
"prepare": "husky install"
|
|
13
18
|
},
|
|
19
|
+
"np": {
|
|
20
|
+
"publishBranch": "production"
|
|
21
|
+
},
|
|
14
22
|
"dependencies": {
|
|
15
23
|
"react": "^19.2.0",
|
|
16
24
|
"react-dom": "^19.2.0"
|
package/.changeset/README.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Changesets
|
|
2
|
-
|
|
3
|
-
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
-
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
-
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
-
|
|
7
|
-
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
-
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
package/.changeset/config.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
|
|
3
|
-
"changelog": "@changesets/cli/changelog",
|
|
4
|
-
"commit": false,
|
|
5
|
-
"fixed": [],
|
|
6
|
-
"linked": [],
|
|
7
|
-
"access": "restricted",
|
|
8
|
-
"baseBranch": "main",
|
|
9
|
-
"updateInternalDependencies": "patch",
|
|
10
|
-
"ignore": []
|
|
11
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: Deploy Storybook to GitHub Pages
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- production
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
contents: read
|
|
10
|
-
pages: write
|
|
11
|
-
id-token: write
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
build:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- name: Setup Node.js
|
|
22
|
-
uses: actions/setup-node@v4
|
|
23
|
-
with:
|
|
24
|
-
node-version: '22'
|
|
25
|
-
|
|
26
|
-
- name: Setup pnpm
|
|
27
|
-
uses: pnpm/action-setup@v4
|
|
28
|
-
with:
|
|
29
|
-
version: 10
|
|
30
|
-
|
|
31
|
-
- name: Setup pnpm cache
|
|
32
|
-
uses: actions/cache@v4
|
|
33
|
-
with:
|
|
34
|
-
path: ~/.pnpm-store
|
|
35
|
-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
36
|
-
restore-keys: |
|
|
37
|
-
${{ runner.os }}-pnpm-store-
|
|
38
|
-
|
|
39
|
-
- name: Install dependencies
|
|
40
|
-
run: pnpm install --frozen-lockfile
|
|
41
|
-
|
|
42
|
-
- name: Build Storybook
|
|
43
|
-
run: pnpm build-storybook
|
|
44
|
-
|
|
45
|
-
- name: Create .nojekyll file
|
|
46
|
-
run: touch storybook-static/.nojekyll
|
|
47
|
-
|
|
48
|
-
- name: Upload artifact for GitHub Pages
|
|
49
|
-
uses: actions/upload-pages-artifact@v3
|
|
50
|
-
with:
|
|
51
|
-
path: storybook-static
|
|
52
|
-
|
|
53
|
-
deploy:
|
|
54
|
-
needs: build
|
|
55
|
-
runs-on: ubuntu-latest
|
|
56
|
-
|
|
57
|
-
steps:
|
|
58
|
-
- name: Deploy to GitHub Pages
|
|
59
|
-
uses: actions/deploy-pages@v4
|
package/.husky/pre-commit
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# 运行 lint-staged 检查
|
|
2
|
-
echo "Running code quality checks..."
|
|
3
|
-
npx lint-staged
|
|
4
|
-
|
|
5
|
-
# 如果检查失败,阻止提交
|
|
6
|
-
if [ $? -ne 0 ]; then
|
|
7
|
-
echo "Code quality checks failed. Please fix the errors before committing."
|
|
8
|
-
echo "Run 'pnpm run lint' to see detailed error messages."
|
|
9
|
-
exit 1
|
|
10
|
-
fi
|
|
11
|
-
|
|
12
|
-
echo "Code quality checks passed. Proceeding with commit."
|
package/.storybook/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
package/.storybook/main.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from '@storybook/react-vite';
|
|
2
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
3
|
-
// import tailwindcss from '@tailwindcss/vite';
|
|
4
|
-
|
|
5
|
-
const config: StorybookConfig = {
|
|
6
|
-
stories: [
|
|
7
|
-
"../src/**/*.mdx",
|
|
8
|
-
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
|
|
9
|
-
],
|
|
10
|
-
addons: [
|
|
11
|
-
"@chromatic-com/storybook",
|
|
12
|
-
"@storybook/addon-vitest",
|
|
13
|
-
"@storybook/addon-a11y",
|
|
14
|
-
"@storybook/addon-docs",
|
|
15
|
-
"@storybook/addon-onboarding"
|
|
16
|
-
],
|
|
17
|
-
framework: "@storybook/react-vite",
|
|
18
|
-
async viteFinal(config) {
|
|
19
|
-
config.plugins = config.plugins || [];
|
|
20
|
-
config.plugins.push(tsconfigPaths());
|
|
21
|
-
// config.plugins.push(tailwindcss());
|
|
22
|
-
config.base = '/UIs/';
|
|
23
|
-
return config;
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default config;
|
package/.storybook/preview.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Preview } from '@storybook/react-vite'
|
|
2
|
-
import './index.css'
|
|
3
|
-
|
|
4
|
-
const preview: Preview = {
|
|
5
|
-
parameters: {
|
|
6
|
-
controls: {
|
|
7
|
-
matchers: {
|
|
8
|
-
color: /(background|color)$/i,
|
|
9
|
-
date: /Date$/i,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
a11y: {
|
|
14
|
-
// 'todo' - show a11y violations in the test UI only
|
|
15
|
-
// 'error' - fail CI on a11y violations
|
|
16
|
-
// 'off' - skip a11y checks entirely
|
|
17
|
-
test: 'todo'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default preview;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
|
|
2
|
-
import { setProjectAnnotations } from '@storybook/react-vite';
|
|
3
|
-
import * as projectAnnotations from './preview';
|
|
4
|
-
|
|
5
|
-
// This is an important step to apply the right configuration when testing your stories.
|
|
6
|
-
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
|
|
7
|
-
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
|
package/eslint.config.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
|
|
2
|
-
import storybook from "eslint-plugin-storybook";
|
|
3
|
-
|
|
4
|
-
import js from '@eslint/js'
|
|
5
|
-
import globals from 'globals'
|
|
6
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
7
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
8
|
-
import tseslint from 'typescript-eslint'
|
|
9
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
10
|
-
|
|
11
|
-
export default defineConfig([
|
|
12
|
-
globalIgnores(['dist']),
|
|
13
|
-
{
|
|
14
|
-
files: ['**/*.{ts,tsx}'],
|
|
15
|
-
extends: [
|
|
16
|
-
js.configs.recommended,
|
|
17
|
-
tseslint.configs.recommended,
|
|
18
|
-
reactHooks.configs.flat.recommended,
|
|
19
|
-
reactRefresh.configs.vite,
|
|
20
|
-
],
|
|
21
|
-
languageOptions: {
|
|
22
|
-
ecmaVersion: 2020,
|
|
23
|
-
globals: globals.browser,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
])
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>gemini-uis</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { IconProps } from './types';
|
|
3
|
-
|
|
4
|
-
export const LoadingIcon: FC<IconProps> = ({
|
|
5
|
-
size = 16,
|
|
6
|
-
className = 'animate-spin',
|
|
7
|
-
...props
|
|
8
|
-
}) => (
|
|
9
|
-
<svg
|
|
10
|
-
width={size}
|
|
11
|
-
height={size}
|
|
12
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
-
fill="none"
|
|
14
|
-
viewBox="0 0 24 24"
|
|
15
|
-
className={className}
|
|
16
|
-
{...props}
|
|
17
|
-
>
|
|
18
|
-
<circle
|
|
19
|
-
className="opacity-25"
|
|
20
|
-
cx="12"
|
|
21
|
-
cy="12"
|
|
22
|
-
r="10"
|
|
23
|
-
stroke="currentColor"
|
|
24
|
-
strokeWidth="4"
|
|
25
|
-
/>
|
|
26
|
-
<path
|
|
27
|
-
className="opacity-75"
|
|
28
|
-
fill="currentColor"
|
|
29
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
30
|
-
/>
|
|
31
|
-
</svg>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
export default LoadingIcon;
|
package/src/icons/index.ts
DELETED