unicorn-design-system 1.0.0 → 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/index.d.mts +119 -0
- package/dist/index.d.ts +119 -15
- package/dist/index.js +370 -11
- package/dist/index.mjs +323 -0
- package/dist/styles.css +1 -0
- package/package.json +10 -5
- package/dist/components/Alert.d.ts +0 -10
- package/dist/components/Alert.js +0 -11
- package/dist/components/Badge.d.ts +0 -6
- package/dist/components/Badge.js +0 -17
- package/dist/components/Button.d.ts +0 -7
- package/dist/components/Button.js +0 -23
- package/dist/components/Card.d.ts +0 -7
- package/dist/components/Card.js +0 -22
- package/dist/components/Input.d.ts +0 -7
- package/dist/components/Input.js +0 -12
- package/dist/components/Modal.d.ts +0 -10
- package/dist/components/Modal.js +0 -7
- package/dist/tokens/src/tokens/colors.d.ts +0 -29
- package/dist/tokens/src/tokens/colors.js +0 -29
- package/dist/tokens/src/tokens/spacing.d.ts +0 -19
- package/dist/tokens/src/tokens/spacing.js +0 -19
- package/dist/tokens/src/tokens/typography.d.ts +0 -21
- package/dist/tokens/src/tokens/typography.js +0 -21
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
}
|
|
7
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
|
|
9
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
variant?: 'default' | 'elevated' | 'flat';
|
|
11
|
+
padding?: 'sm' | 'md' | 'lg';
|
|
12
|
+
}
|
|
13
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
16
|
+
variant?: 'primary' | 'success' | 'warning' | 'danger';
|
|
17
|
+
}
|
|
18
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
|
|
20
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
21
|
+
label?: string;
|
|
22
|
+
error?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
25
|
+
|
|
26
|
+
interface ModalProps {
|
|
27
|
+
isOpen: boolean;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
title?: string;
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
footer?: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
declare const Modal: React.FC<ModalProps>;
|
|
34
|
+
|
|
35
|
+
interface AlertProps {
|
|
36
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
37
|
+
title?: string;
|
|
38
|
+
message: string;
|
|
39
|
+
closable?: boolean;
|
|
40
|
+
onClose?: () => void;
|
|
41
|
+
action?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
declare const Alert: React.FC<AlertProps>;
|
|
44
|
+
|
|
45
|
+
declare const colors: {
|
|
46
|
+
primary: {
|
|
47
|
+
50: string;
|
|
48
|
+
100: string;
|
|
49
|
+
500: string;
|
|
50
|
+
600: string;
|
|
51
|
+
700: string;
|
|
52
|
+
};
|
|
53
|
+
success: {
|
|
54
|
+
500: string;
|
|
55
|
+
600: string;
|
|
56
|
+
700: string;
|
|
57
|
+
};
|
|
58
|
+
warning: {
|
|
59
|
+
500: string;
|
|
60
|
+
600: string;
|
|
61
|
+
700: string;
|
|
62
|
+
};
|
|
63
|
+
danger: {
|
|
64
|
+
500: string;
|
|
65
|
+
600: string;
|
|
66
|
+
700: string;
|
|
67
|
+
};
|
|
68
|
+
gray: {
|
|
69
|
+
50: string;
|
|
70
|
+
100: string;
|
|
71
|
+
200: string;
|
|
72
|
+
500: string;
|
|
73
|
+
900: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare const typography: {
|
|
78
|
+
fontFamily: {
|
|
79
|
+
primary: string;
|
|
80
|
+
mono: string;
|
|
81
|
+
};
|
|
82
|
+
fontSize: {
|
|
83
|
+
xs: string;
|
|
84
|
+
sm: string;
|
|
85
|
+
base: string;
|
|
86
|
+
lg: string;
|
|
87
|
+
xl: string;
|
|
88
|
+
'2xl': string;
|
|
89
|
+
'3xl': string;
|
|
90
|
+
};
|
|
91
|
+
fontWeight: {
|
|
92
|
+
regular: number;
|
|
93
|
+
medium: number;
|
|
94
|
+
semibold: number;
|
|
95
|
+
bold: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
declare const spacing: {
|
|
100
|
+
xs: string;
|
|
101
|
+
sm: string;
|
|
102
|
+
md: string;
|
|
103
|
+
lg: string;
|
|
104
|
+
xl: string;
|
|
105
|
+
'2xl': string;
|
|
106
|
+
};
|
|
107
|
+
declare const borderRadius: {
|
|
108
|
+
sm: string;
|
|
109
|
+
md: string;
|
|
110
|
+
lg: string;
|
|
111
|
+
xl: string;
|
|
112
|
+
};
|
|
113
|
+
declare const shadows: {
|
|
114
|
+
sm: string;
|
|
115
|
+
md: string;
|
|
116
|
+
lg: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { Alert, type AlertProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Input, type InputProps, Modal, type ModalProps, borderRadius, colors, shadows, spacing, typography };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
}
|
|
7
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
|
|
9
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
variant?: 'default' | 'elevated' | 'flat';
|
|
11
|
+
padding?: 'sm' | 'md' | 'lg';
|
|
12
|
+
}
|
|
13
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
16
|
+
variant?: 'primary' | 'success' | 'warning' | 'danger';
|
|
17
|
+
}
|
|
18
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
|
|
20
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
21
|
+
label?: string;
|
|
22
|
+
error?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
25
|
+
|
|
26
|
+
interface ModalProps {
|
|
27
|
+
isOpen: boolean;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
title?: string;
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
footer?: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
declare const Modal: React.FC<ModalProps>;
|
|
34
|
+
|
|
35
|
+
interface AlertProps {
|
|
36
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
37
|
+
title?: string;
|
|
38
|
+
message: string;
|
|
39
|
+
closable?: boolean;
|
|
40
|
+
onClose?: () => void;
|
|
41
|
+
action?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
declare const Alert: React.FC<AlertProps>;
|
|
44
|
+
|
|
45
|
+
declare const colors: {
|
|
46
|
+
primary: {
|
|
47
|
+
50: string;
|
|
48
|
+
100: string;
|
|
49
|
+
500: string;
|
|
50
|
+
600: string;
|
|
51
|
+
700: string;
|
|
52
|
+
};
|
|
53
|
+
success: {
|
|
54
|
+
500: string;
|
|
55
|
+
600: string;
|
|
56
|
+
700: string;
|
|
57
|
+
};
|
|
58
|
+
warning: {
|
|
59
|
+
500: string;
|
|
60
|
+
600: string;
|
|
61
|
+
700: string;
|
|
62
|
+
};
|
|
63
|
+
danger: {
|
|
64
|
+
500: string;
|
|
65
|
+
600: string;
|
|
66
|
+
700: string;
|
|
67
|
+
};
|
|
68
|
+
gray: {
|
|
69
|
+
50: string;
|
|
70
|
+
100: string;
|
|
71
|
+
200: string;
|
|
72
|
+
500: string;
|
|
73
|
+
900: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare const typography: {
|
|
78
|
+
fontFamily: {
|
|
79
|
+
primary: string;
|
|
80
|
+
mono: string;
|
|
81
|
+
};
|
|
82
|
+
fontSize: {
|
|
83
|
+
xs: string;
|
|
84
|
+
sm: string;
|
|
85
|
+
base: string;
|
|
86
|
+
lg: string;
|
|
87
|
+
xl: string;
|
|
88
|
+
'2xl': string;
|
|
89
|
+
'3xl': string;
|
|
90
|
+
};
|
|
91
|
+
fontWeight: {
|
|
92
|
+
regular: number;
|
|
93
|
+
medium: number;
|
|
94
|
+
semibold: number;
|
|
95
|
+
bold: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
declare const spacing: {
|
|
100
|
+
xs: string;
|
|
101
|
+
sm: string;
|
|
102
|
+
md: string;
|
|
103
|
+
lg: string;
|
|
104
|
+
xl: string;
|
|
105
|
+
'2xl': string;
|
|
106
|
+
};
|
|
107
|
+
declare const borderRadius: {
|
|
108
|
+
sm: string;
|
|
109
|
+
md: string;
|
|
110
|
+
lg: string;
|
|
111
|
+
xl: string;
|
|
112
|
+
};
|
|
113
|
+
declare const shadows: {
|
|
114
|
+
sm: string;
|
|
115
|
+
md: string;
|
|
116
|
+
lg: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { Alert, type AlertProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Input, type InputProps, Modal, type ModalProps, borderRadius, colors, shadows, spacing, typography };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,370 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
Alert: () => Alert,
|
|
34
|
+
Badge: () => Badge,
|
|
35
|
+
Button: () => Button,
|
|
36
|
+
Card: () => Card,
|
|
37
|
+
Input: () => Input,
|
|
38
|
+
Modal: () => Modal,
|
|
39
|
+
borderRadius: () => borderRadius,
|
|
40
|
+
colors: () => colors,
|
|
41
|
+
shadows: () => shadows,
|
|
42
|
+
spacing: () => spacing,
|
|
43
|
+
typography: () => typography
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(index_exports);
|
|
46
|
+
|
|
47
|
+
// src/components/Button.tsx
|
|
48
|
+
var import_react = __toESM(require("react"));
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
var Button = import_react.default.forwardRef(
|
|
51
|
+
({ variant = "primary", size = "md", className, children, ...props }, ref) => {
|
|
52
|
+
const variants = {
|
|
53
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700",
|
|
54
|
+
secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300",
|
|
55
|
+
success: "bg-emerald-600 text-white hover:bg-emerald-700",
|
|
56
|
+
danger: "bg-red-600 text-white hover:bg-red-700"
|
|
57
|
+
};
|
|
58
|
+
const sizes = {
|
|
59
|
+
sm: "px-3 py-1.5 text-sm",
|
|
60
|
+
md: "px-4 py-2 text-base",
|
|
61
|
+
lg: "px-6 py-3 text-lg"
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
className: `
|
|
68
|
+
rounded-lg font-semibold transition-colors
|
|
69
|
+
${variants[variant]}
|
|
70
|
+
${sizes[size]}
|
|
71
|
+
${className || ""}
|
|
72
|
+
`,
|
|
73
|
+
...props,
|
|
74
|
+
children
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
Button.displayName = "Button";
|
|
80
|
+
|
|
81
|
+
// src/components/Card.tsx
|
|
82
|
+
var import_react2 = __toESM(require("react"));
|
|
83
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
84
|
+
var Card = import_react2.default.forwardRef(
|
|
85
|
+
({ variant = "default", padding = "lg", className, children, ...props }, ref) => {
|
|
86
|
+
const variants = {
|
|
87
|
+
default: "bg-white border border-gray-200 shadow-sm",
|
|
88
|
+
elevated: "bg-white shadow-lg",
|
|
89
|
+
flat: "bg-gray-50 border border-gray-100"
|
|
90
|
+
};
|
|
91
|
+
const paddings = {
|
|
92
|
+
sm: "p-2",
|
|
93
|
+
md: "p-4",
|
|
94
|
+
lg: "p-6"
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
ref,
|
|
100
|
+
className: `
|
|
101
|
+
rounded-lg transition-all
|
|
102
|
+
${variants[variant]}
|
|
103
|
+
${paddings[padding]}
|
|
104
|
+
${className || ""}
|
|
105
|
+
`,
|
|
106
|
+
...props,
|
|
107
|
+
children
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
Card.displayName = "Card";
|
|
113
|
+
|
|
114
|
+
// src/components/Badge.tsx
|
|
115
|
+
var import_react3 = __toESM(require("react"));
|
|
116
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
117
|
+
var Badge = import_react3.default.forwardRef(
|
|
118
|
+
({ variant = "primary", className, children, ...props }, ref) => {
|
|
119
|
+
const variants = {
|
|
120
|
+
primary: "bg-blue-100 text-blue-800",
|
|
121
|
+
success: "bg-emerald-100 text-emerald-800",
|
|
122
|
+
warning: "bg-amber-100 text-amber-800",
|
|
123
|
+
danger: "bg-red-100 text-red-800"
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
className: `
|
|
130
|
+
inline-flex px-3 py-1.5 rounded-full text-sm font-semibold
|
|
131
|
+
${variants[variant]}
|
|
132
|
+
${className || ""}
|
|
133
|
+
`,
|
|
134
|
+
...props,
|
|
135
|
+
children
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
Badge.displayName = "Badge";
|
|
141
|
+
|
|
142
|
+
// src/components/Input.tsx
|
|
143
|
+
var import_react4 = __toESM(require("react"));
|
|
144
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
145
|
+
var Input = import_react4.default.forwardRef(
|
|
146
|
+
({ label, error, className, ...props }, ref) => {
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "w-full", children: [
|
|
148
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "block text-sm font-semibold mb-2", children: label }),
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
150
|
+
"input",
|
|
151
|
+
{
|
|
152
|
+
ref,
|
|
153
|
+
className: `
|
|
154
|
+
w-full px-4 py-2 border rounded-lg
|
|
155
|
+
focus:outline-none focus:ring-2 focus:ring-blue-500
|
|
156
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
157
|
+
${className || ""}
|
|
158
|
+
`,
|
|
159
|
+
...props
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm text-red-600 mt-1", children: error })
|
|
163
|
+
] });
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
Input.displayName = "Input";
|
|
167
|
+
|
|
168
|
+
// src/components/Modal.tsx
|
|
169
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
170
|
+
var Modal = ({
|
|
171
|
+
isOpen,
|
|
172
|
+
onClose,
|
|
173
|
+
title,
|
|
174
|
+
children,
|
|
175
|
+
footer
|
|
176
|
+
}) => {
|
|
177
|
+
if (!isOpen) return null;
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 z-40", onClick: onClose }),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "bg-white rounded-lg shadow-2xl max-w-md w-full mx-4", children: [
|
|
181
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "p-6 border-b border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { className: "text-xl font-bold", children: title }) }),
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "p-6", children }),
|
|
183
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "p-6 border-t border-gray-200 bg-gray-50", children: footer })
|
|
184
|
+
] }) })
|
|
185
|
+
] });
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/components/Alert.tsx
|
|
189
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
190
|
+
var Alert = ({
|
|
191
|
+
type = "info",
|
|
192
|
+
title,
|
|
193
|
+
message,
|
|
194
|
+
closable,
|
|
195
|
+
onClose,
|
|
196
|
+
action
|
|
197
|
+
}) => {
|
|
198
|
+
const typeStyles = {
|
|
199
|
+
info: {
|
|
200
|
+
container: "bg-primary-50 border-primary-100",
|
|
201
|
+
icon: "text-primary-600"
|
|
202
|
+
},
|
|
203
|
+
success: {
|
|
204
|
+
container: "bg-emerald-50 border-emerald-500",
|
|
205
|
+
icon: "text-emerald-600"
|
|
206
|
+
},
|
|
207
|
+
warning: {
|
|
208
|
+
container: "bg-amber-50 border-amber-500",
|
|
209
|
+
icon: "text-amber-600"
|
|
210
|
+
},
|
|
211
|
+
error: {
|
|
212
|
+
container: "bg-red-50 border-red-500",
|
|
213
|
+
icon: "text-red-600"
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const currentStyle = typeStyles[type];
|
|
217
|
+
if (type === "info") {
|
|
218
|
+
typeStyles.info.container = "bg-[#ECF4FF] border-[#D4E5FF]";
|
|
219
|
+
typeStyles.info.icon = "text-[#235ABD]";
|
|
220
|
+
}
|
|
221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
className: `flex w-full max-w-[480px] p-[12px] gap-3 rounded-[4px] border border-l-4 ${currentStyle.container} ${type === "info" ? "border-l-primary-100" : ""}`,
|
|
225
|
+
style: type === "info" ? {
|
|
226
|
+
border: "1px solid #D4E5FF",
|
|
227
|
+
// Explicitly matching the CSS provided for info
|
|
228
|
+
background: "#ECF4FF"
|
|
229
|
+
} : {},
|
|
230
|
+
children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "shrink-0 pt-0.5", children: [
|
|
232
|
+
type === "info" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
233
|
+
"svg",
|
|
234
|
+
{
|
|
235
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
236
|
+
viewBox: "0 0 24 24",
|
|
237
|
+
fill: "currentColor",
|
|
238
|
+
className: `w-5 h-5 ${currentStyle.icon}`,
|
|
239
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
240
|
+
"path",
|
|
241
|
+
{
|
|
242
|
+
fillRule: "evenodd",
|
|
243
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
244
|
+
clipRule: "evenodd"
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
type !== "info" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-xl", children: "\u2139\uFE0F" })
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-[10px] w-full", children: [
|
|
252
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex justify-between items-start gap-2", children: [
|
|
253
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "text-base font-bold text-gray-900 leading-tight", children: title }),
|
|
254
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
255
|
+
"button",
|
|
256
|
+
{
|
|
257
|
+
onClick: onClose,
|
|
258
|
+
className: "text-gray-400 hover:text-gray-600 transition-colors p-0.5 rounded focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
259
|
+
"aria-label": "Close alert",
|
|
260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
261
|
+
"svg",
|
|
262
|
+
{
|
|
263
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
264
|
+
viewBox: "0 0 20 20",
|
|
265
|
+
fill: "currentColor",
|
|
266
|
+
className: "w-5 h-5",
|
|
267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm text-gray-600 leading-normal", children: message }),
|
|
274
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: action })
|
|
275
|
+
] })
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// src/tokens/colors.ts
|
|
282
|
+
var colors = {
|
|
283
|
+
primary: {
|
|
284
|
+
50: "#ECF4FF",
|
|
285
|
+
100: "#D4E5FF",
|
|
286
|
+
500: "#2A6ECC",
|
|
287
|
+
600: "#235ABD",
|
|
288
|
+
700: "#1C45AE"
|
|
289
|
+
},
|
|
290
|
+
success: {
|
|
291
|
+
500: "#00995A",
|
|
292
|
+
600: "#007A4A",
|
|
293
|
+
700: "#005C3A"
|
|
294
|
+
},
|
|
295
|
+
warning: {
|
|
296
|
+
500: "#F9B02A",
|
|
297
|
+
600: "#E8A100",
|
|
298
|
+
700: "#D69200"
|
|
299
|
+
},
|
|
300
|
+
danger: {
|
|
301
|
+
500: "#FA5858",
|
|
302
|
+
600: "#E84545",
|
|
303
|
+
700: "#D63232"
|
|
304
|
+
},
|
|
305
|
+
gray: {
|
|
306
|
+
50: "#F9FAFB",
|
|
307
|
+
100: "#F3F4F6",
|
|
308
|
+
200: "#E5E7EB",
|
|
309
|
+
500: "#6B7280",
|
|
310
|
+
900: "#111827"
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/tokens/typography.ts
|
|
315
|
+
var typography = {
|
|
316
|
+
fontFamily: {
|
|
317
|
+
primary: "Poppins, -apple-system, BlinkMacSystemFont, sans-serif",
|
|
318
|
+
mono: '"Roboto Mono", monospace'
|
|
319
|
+
},
|
|
320
|
+
fontSize: {
|
|
321
|
+
xs: "10px",
|
|
322
|
+
sm: "12px",
|
|
323
|
+
base: "14px",
|
|
324
|
+
lg: "16px",
|
|
325
|
+
xl: "18px",
|
|
326
|
+
"2xl": "20px",
|
|
327
|
+
"3xl": "24px"
|
|
328
|
+
},
|
|
329
|
+
fontWeight: {
|
|
330
|
+
regular: 400,
|
|
331
|
+
medium: 500,
|
|
332
|
+
semibold: 600,
|
|
333
|
+
bold: 700
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// src/tokens/spacing.ts
|
|
338
|
+
var spacing = {
|
|
339
|
+
xs: "4px",
|
|
340
|
+
sm: "8px",
|
|
341
|
+
md: "12px",
|
|
342
|
+
lg: "16px",
|
|
343
|
+
xl: "24px",
|
|
344
|
+
"2xl": "32px"
|
|
345
|
+
};
|
|
346
|
+
var borderRadius = {
|
|
347
|
+
sm: "4px",
|
|
348
|
+
md: "6px",
|
|
349
|
+
lg: "8px",
|
|
350
|
+
xl: "12px"
|
|
351
|
+
};
|
|
352
|
+
var shadows = {
|
|
353
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
354
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
|
|
355
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1)"
|
|
356
|
+
};
|
|
357
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
358
|
+
0 && (module.exports = {
|
|
359
|
+
Alert,
|
|
360
|
+
Badge,
|
|
361
|
+
Button,
|
|
362
|
+
Card,
|
|
363
|
+
Input,
|
|
364
|
+
Modal,
|
|
365
|
+
borderRadius,
|
|
366
|
+
colors,
|
|
367
|
+
shadows,
|
|
368
|
+
spacing,
|
|
369
|
+
typography
|
|
370
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
// src/components/Button.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var Button = React.forwardRef(
|
|
5
|
+
({ variant = "primary", size = "md", className, children, ...props }, ref) => {
|
|
6
|
+
const variants = {
|
|
7
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700",
|
|
8
|
+
secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300",
|
|
9
|
+
success: "bg-emerald-600 text-white hover:bg-emerald-700",
|
|
10
|
+
danger: "bg-red-600 text-white hover:bg-red-700"
|
|
11
|
+
};
|
|
12
|
+
const sizes = {
|
|
13
|
+
sm: "px-3 py-1.5 text-sm",
|
|
14
|
+
md: "px-4 py-2 text-base",
|
|
15
|
+
lg: "px-6 py-3 text-lg"
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
ref,
|
|
21
|
+
className: `
|
|
22
|
+
rounded-lg font-semibold transition-colors
|
|
23
|
+
${variants[variant]}
|
|
24
|
+
${sizes[size]}
|
|
25
|
+
${className || ""}
|
|
26
|
+
`,
|
|
27
|
+
...props,
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
Button.displayName = "Button";
|
|
34
|
+
|
|
35
|
+
// src/components/Card.tsx
|
|
36
|
+
import React2 from "react";
|
|
37
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
38
|
+
var Card = React2.forwardRef(
|
|
39
|
+
({ variant = "default", padding = "lg", className, children, ...props }, ref) => {
|
|
40
|
+
const variants = {
|
|
41
|
+
default: "bg-white border border-gray-200 shadow-sm",
|
|
42
|
+
elevated: "bg-white shadow-lg",
|
|
43
|
+
flat: "bg-gray-50 border border-gray-100"
|
|
44
|
+
};
|
|
45
|
+
const paddings = {
|
|
46
|
+
sm: "p-2",
|
|
47
|
+
md: "p-4",
|
|
48
|
+
lg: "p-6"
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ jsx2(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: `
|
|
55
|
+
rounded-lg transition-all
|
|
56
|
+
${variants[variant]}
|
|
57
|
+
${paddings[padding]}
|
|
58
|
+
${className || ""}
|
|
59
|
+
`,
|
|
60
|
+
...props,
|
|
61
|
+
children
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
Card.displayName = "Card";
|
|
67
|
+
|
|
68
|
+
// src/components/Badge.tsx
|
|
69
|
+
import React3 from "react";
|
|
70
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
71
|
+
var Badge = React3.forwardRef(
|
|
72
|
+
({ variant = "primary", className, children, ...props }, ref) => {
|
|
73
|
+
const variants = {
|
|
74
|
+
primary: "bg-blue-100 text-blue-800",
|
|
75
|
+
success: "bg-emerald-100 text-emerald-800",
|
|
76
|
+
warning: "bg-amber-100 text-amber-800",
|
|
77
|
+
danger: "bg-red-100 text-red-800"
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ jsx3(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className: `
|
|
84
|
+
inline-flex px-3 py-1.5 rounded-full text-sm font-semibold
|
|
85
|
+
${variants[variant]}
|
|
86
|
+
${className || ""}
|
|
87
|
+
`,
|
|
88
|
+
...props,
|
|
89
|
+
children
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
Badge.displayName = "Badge";
|
|
95
|
+
|
|
96
|
+
// src/components/Input.tsx
|
|
97
|
+
import React4 from "react";
|
|
98
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
99
|
+
var Input = React4.forwardRef(
|
|
100
|
+
({ label, error, className, ...props }, ref) => {
|
|
101
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
102
|
+
label && /* @__PURE__ */ jsx4("label", { className: "block text-sm font-semibold mb-2", children: label }),
|
|
103
|
+
/* @__PURE__ */ jsx4(
|
|
104
|
+
"input",
|
|
105
|
+
{
|
|
106
|
+
ref,
|
|
107
|
+
className: `
|
|
108
|
+
w-full px-4 py-2 border rounded-lg
|
|
109
|
+
focus:outline-none focus:ring-2 focus:ring-blue-500
|
|
110
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
111
|
+
${className || ""}
|
|
112
|
+
`,
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
error && /* @__PURE__ */ jsx4("p", { className: "text-sm text-red-600 mt-1", children: error })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
Input.displayName = "Input";
|
|
121
|
+
|
|
122
|
+
// src/components/Modal.tsx
|
|
123
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
124
|
+
var Modal = ({
|
|
125
|
+
isOpen,
|
|
126
|
+
onClose,
|
|
127
|
+
title,
|
|
128
|
+
children,
|
|
129
|
+
footer
|
|
130
|
+
}) => {
|
|
131
|
+
if (!isOpen) return null;
|
|
132
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
133
|
+
/* @__PURE__ */ jsx5("div", { className: "fixed inset-0 bg-black bg-opacity-50 z-40", onClick: onClose }),
|
|
134
|
+
/* @__PURE__ */ jsx5("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: /* @__PURE__ */ jsxs2("div", { className: "bg-white rounded-lg shadow-2xl max-w-md w-full mx-4", children: [
|
|
135
|
+
title && /* @__PURE__ */ jsx5("div", { className: "p-6 border-b border-gray-200", children: /* @__PURE__ */ jsx5("h2", { className: "text-xl font-bold", children: title }) }),
|
|
136
|
+
/* @__PURE__ */ jsx5("div", { className: "p-6", children }),
|
|
137
|
+
footer && /* @__PURE__ */ jsx5("div", { className: "p-6 border-t border-gray-200 bg-gray-50", children: footer })
|
|
138
|
+
] }) })
|
|
139
|
+
] });
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// src/components/Alert.tsx
|
|
143
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
144
|
+
var Alert = ({
|
|
145
|
+
type = "info",
|
|
146
|
+
title,
|
|
147
|
+
message,
|
|
148
|
+
closable,
|
|
149
|
+
onClose,
|
|
150
|
+
action
|
|
151
|
+
}) => {
|
|
152
|
+
const typeStyles = {
|
|
153
|
+
info: {
|
|
154
|
+
container: "bg-primary-50 border-primary-100",
|
|
155
|
+
icon: "text-primary-600"
|
|
156
|
+
},
|
|
157
|
+
success: {
|
|
158
|
+
container: "bg-emerald-50 border-emerald-500",
|
|
159
|
+
icon: "text-emerald-600"
|
|
160
|
+
},
|
|
161
|
+
warning: {
|
|
162
|
+
container: "bg-amber-50 border-amber-500",
|
|
163
|
+
icon: "text-amber-600"
|
|
164
|
+
},
|
|
165
|
+
error: {
|
|
166
|
+
container: "bg-red-50 border-red-500",
|
|
167
|
+
icon: "text-red-600"
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const currentStyle = typeStyles[type];
|
|
171
|
+
if (type === "info") {
|
|
172
|
+
typeStyles.info.container = "bg-[#ECF4FF] border-[#D4E5FF]";
|
|
173
|
+
typeStyles.info.icon = "text-[#235ABD]";
|
|
174
|
+
}
|
|
175
|
+
return /* @__PURE__ */ jsxs3(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
className: `flex w-full max-w-[480px] p-[12px] gap-3 rounded-[4px] border border-l-4 ${currentStyle.container} ${type === "info" ? "border-l-primary-100" : ""}`,
|
|
179
|
+
style: type === "info" ? {
|
|
180
|
+
border: "1px solid #D4E5FF",
|
|
181
|
+
// Explicitly matching the CSS provided for info
|
|
182
|
+
background: "#ECF4FF"
|
|
183
|
+
} : {},
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ jsxs3("div", { className: "shrink-0 pt-0.5", children: [
|
|
186
|
+
type === "info" && /* @__PURE__ */ jsx6(
|
|
187
|
+
"svg",
|
|
188
|
+
{
|
|
189
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
190
|
+
viewBox: "0 0 24 24",
|
|
191
|
+
fill: "currentColor",
|
|
192
|
+
className: `w-5 h-5 ${currentStyle.icon}`,
|
|
193
|
+
children: /* @__PURE__ */ jsx6(
|
|
194
|
+
"path",
|
|
195
|
+
{
|
|
196
|
+
fillRule: "evenodd",
|
|
197
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
198
|
+
clipRule: "evenodd"
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
type !== "info" && /* @__PURE__ */ jsx6("span", { className: "text-xl", children: "\u2139\uFE0F" })
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-[10px] w-full", children: [
|
|
206
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-start gap-2", children: [
|
|
207
|
+
title && /* @__PURE__ */ jsx6("h3", { className: "text-base font-bold text-gray-900 leading-tight", children: title }),
|
|
208
|
+
closable && /* @__PURE__ */ jsx6(
|
|
209
|
+
"button",
|
|
210
|
+
{
|
|
211
|
+
onClick: onClose,
|
|
212
|
+
className: "text-gray-400 hover:text-gray-600 transition-colors p-0.5 rounded focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
213
|
+
"aria-label": "Close alert",
|
|
214
|
+
children: /* @__PURE__ */ jsx6(
|
|
215
|
+
"svg",
|
|
216
|
+
{
|
|
217
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
218
|
+
viewBox: "0 0 20 20",
|
|
219
|
+
fill: "currentColor",
|
|
220
|
+
className: "w-5 h-5",
|
|
221
|
+
children: /* @__PURE__ */ jsx6("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ jsx6("p", { className: "text-sm text-gray-600 leading-normal", children: message }),
|
|
228
|
+
action && /* @__PURE__ */ jsx6("div", { children: action })
|
|
229
|
+
] })
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// src/tokens/colors.ts
|
|
236
|
+
var colors = {
|
|
237
|
+
primary: {
|
|
238
|
+
50: "#ECF4FF",
|
|
239
|
+
100: "#D4E5FF",
|
|
240
|
+
500: "#2A6ECC",
|
|
241
|
+
600: "#235ABD",
|
|
242
|
+
700: "#1C45AE"
|
|
243
|
+
},
|
|
244
|
+
success: {
|
|
245
|
+
500: "#00995A",
|
|
246
|
+
600: "#007A4A",
|
|
247
|
+
700: "#005C3A"
|
|
248
|
+
},
|
|
249
|
+
warning: {
|
|
250
|
+
500: "#F9B02A",
|
|
251
|
+
600: "#E8A100",
|
|
252
|
+
700: "#D69200"
|
|
253
|
+
},
|
|
254
|
+
danger: {
|
|
255
|
+
500: "#FA5858",
|
|
256
|
+
600: "#E84545",
|
|
257
|
+
700: "#D63232"
|
|
258
|
+
},
|
|
259
|
+
gray: {
|
|
260
|
+
50: "#F9FAFB",
|
|
261
|
+
100: "#F3F4F6",
|
|
262
|
+
200: "#E5E7EB",
|
|
263
|
+
500: "#6B7280",
|
|
264
|
+
900: "#111827"
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// src/tokens/typography.ts
|
|
269
|
+
var typography = {
|
|
270
|
+
fontFamily: {
|
|
271
|
+
primary: "Poppins, -apple-system, BlinkMacSystemFont, sans-serif",
|
|
272
|
+
mono: '"Roboto Mono", monospace'
|
|
273
|
+
},
|
|
274
|
+
fontSize: {
|
|
275
|
+
xs: "10px",
|
|
276
|
+
sm: "12px",
|
|
277
|
+
base: "14px",
|
|
278
|
+
lg: "16px",
|
|
279
|
+
xl: "18px",
|
|
280
|
+
"2xl": "20px",
|
|
281
|
+
"3xl": "24px"
|
|
282
|
+
},
|
|
283
|
+
fontWeight: {
|
|
284
|
+
regular: 400,
|
|
285
|
+
medium: 500,
|
|
286
|
+
semibold: 600,
|
|
287
|
+
bold: 700
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// src/tokens/spacing.ts
|
|
292
|
+
var spacing = {
|
|
293
|
+
xs: "4px",
|
|
294
|
+
sm: "8px",
|
|
295
|
+
md: "12px",
|
|
296
|
+
lg: "16px",
|
|
297
|
+
xl: "24px",
|
|
298
|
+
"2xl": "32px"
|
|
299
|
+
};
|
|
300
|
+
var borderRadius = {
|
|
301
|
+
sm: "4px",
|
|
302
|
+
md: "6px",
|
|
303
|
+
lg: "8px",
|
|
304
|
+
xl: "12px"
|
|
305
|
+
};
|
|
306
|
+
var shadows = {
|
|
307
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
308
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
|
|
309
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1)"
|
|
310
|
+
};
|
|
311
|
+
export {
|
|
312
|
+
Alert,
|
|
313
|
+
Badge,
|
|
314
|
+
Button,
|
|
315
|
+
Card,
|
|
316
|
+
Input,
|
|
317
|
+
Modal,
|
|
318
|
+
borderRadius,
|
|
319
|
+
colors,
|
|
320
|
+
shadows,
|
|
321
|
+
spacing,
|
|
322
|
+
typography
|
|
323
|
+
};
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.fixed{position:fixed}.inset-0{inset:0}.z-40{z-index:40}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mb-2{margin-bottom:.5rem}.mt-1{margin-top:.25rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.h-5{height:1.25rem}.w-5{width:1.25rem}.w-full{width:100%}.max-w-\[480px\]{max-width:480px}.max-w-md{max-width:28rem}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-\[10px\]{gap:10px}.rounded{border-radius:.25rem}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-\[\#D4E5FF\]{--tw-border-opacity:1;border-color:rgb(212 229 255/var(--tw-border-opacity,1))}.border-amber-500{--tw-border-opacity:1;border-color:rgb(245 158 11/var(--tw-border-opacity,1))}.border-emerald-500{--tw-border-opacity:1;border-color:rgb(16 185 129/var(--tw-border-opacity,1))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-primary-100{--tw-border-opacity:1;border-color:rgb(212 229 255/var(--tw-border-opacity,1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.border-l-primary-100{--tw-border-opacity:1;border-left-color:rgb(212 229 255/var(--tw-border-opacity,1))}.bg-\[\#ECF4FF\]{--tw-bg-opacity:1;background-color:rgb(236 244 255/var(--tw-bg-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.bg-emerald-100{--tw-bg-opacity:1;background-color:rgb(209 250 229/var(--tw-bg-opacity,1))}.bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.bg-emerald-600{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity,1))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-primary-50{--tw-bg-opacity:1;background-color:rgb(236 244 255/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-opacity-50{--tw-bg-opacity:0.5}.p-0\.5{padding:.125rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[12px\]{padding:12px}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pt-0\.5{padding-top:.125rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.leading-normal{line-height:1.5}.leading-tight{line-height:1.25}.text-\[\#235ABD\]{--tw-text-opacity:1;color:rgb(35 90 189/var(--tw-text-opacity,1))}.text-amber-600{--tw-text-opacity:1;color:rgb(217 119 6/var(--tw-text-opacity,1))}.text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}.text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.text-emerald-600{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1))}.text-emerald-800{--tw-text-opacity:1;color:rgb(6 95 70/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-primary-600{--tw-text-opacity:1;color:rgb(35 90 189/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-2xl,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\:bg-emerald-700:hover{--tw-bg-opacity:1;background-color:rgb(4 120 87/var(--tw-bg-opacity,1))}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.focus\:ring-primary-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(42 110 204/var(--tw-ring-opacity,1))}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unicorn-design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "🦄 Beautiful React components and design tokens",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
12
|
"require": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"./styles": "./dist/styles.css"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"LICENSE"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"dev": "
|
|
22
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --clean && tailwindcss -i ./src/index.css -o ./dist/styles.css --minify",
|
|
23
|
+
"dev": "concurrently \"tsup src/index.ts --format cjs,esm --dts --watch\" \"tailwindcss -i ./src/index.css -o ./dist/styles.css --watch\""
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"react",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/react": "^18.2.0",
|
|
40
40
|
"@types/react-dom": "^18.2.0",
|
|
41
|
+
"autoprefixer": "^10.4.23",
|
|
42
|
+
"concurrently": "^9.2.1",
|
|
43
|
+
"postcss": "^8.5.6",
|
|
44
|
+
"tailwindcss": "^3.4.17",
|
|
45
|
+
"tsup": "^8.5.1",
|
|
41
46
|
"typescript": "^5.3.0"
|
|
42
47
|
}
|
|
43
48
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface AlertProps {
|
|
3
|
-
type?: 'info' | 'success' | 'warning' | 'error';
|
|
4
|
-
title?: string;
|
|
5
|
-
message: string;
|
|
6
|
-
closable?: boolean;
|
|
7
|
-
onClose?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const Alert: React.FC<AlertProps>;
|
|
10
|
-
export default Alert;
|
package/dist/components/Alert.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const Alert = ({ type = 'info', title, message, closable, onClose, }) => {
|
|
3
|
-
const types = {
|
|
4
|
-
info: 'bg-cyan-50 border-l-4 border-cyan-500 text-cyan-900',
|
|
5
|
-
success: 'bg-emerald-50 border-l-4 border-emerald-500 text-emerald-900',
|
|
6
|
-
warning: 'bg-amber-50 border-l-4 border-amber-500 text-amber-900',
|
|
7
|
-
error: 'bg-red-50 border-l-4 border-red-500 text-red-900',
|
|
8
|
-
};
|
|
9
|
-
return (_jsxs("div", { className: `p-4 rounded-lg ${types[type]}`, children: [title && _jsx("h3", { className: "font-semibold mb-1", children: title }), _jsx("p", { className: "text-sm", children: message }), closable && (_jsx("button", { onClick: onClose, className: "ml-auto text-sm font-semibold hover:opacity-70", children: "\u2715" }))] }));
|
|
10
|
-
};
|
|
11
|
-
export default Alert;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
-
variant?: 'primary' | 'success' | 'warning' | 'danger';
|
|
4
|
-
}
|
|
5
|
-
export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
-
export default Badge;
|
package/dist/components/Badge.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export const Badge = React.forwardRef(({ variant = 'primary', className, children, ...props }, ref) => {
|
|
4
|
-
const variants = {
|
|
5
|
-
primary: 'bg-blue-100 text-blue-800',
|
|
6
|
-
success: 'bg-emerald-100 text-emerald-800',
|
|
7
|
-
warning: 'bg-amber-100 text-amber-800',
|
|
8
|
-
danger: 'bg-red-100 text-red-800',
|
|
9
|
-
};
|
|
10
|
-
return (_jsx("span", { ref: ref, className: `
|
|
11
|
-
inline-flex px-3 py-1.5 rounded-full text-sm font-semibold
|
|
12
|
-
${variants[variant]}
|
|
13
|
-
${className || ''}
|
|
14
|
-
`, ...props, children: children }));
|
|
15
|
-
});
|
|
16
|
-
Badge.displayName = 'Badge';
|
|
17
|
-
export default Badge;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
variant?: 'primary' | 'secondary' | 'success' | 'danger';
|
|
4
|
-
size?: 'sm' | 'md' | 'lg';
|
|
5
|
-
}
|
|
6
|
-
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
export default Button;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export const Button = React.forwardRef(({ variant = 'primary', size = 'md', className, children, ...props }, ref) => {
|
|
4
|
-
const variants = {
|
|
5
|
-
primary: 'bg-blue-600 text-white hover:bg-blue-700',
|
|
6
|
-
secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300',
|
|
7
|
-
success: 'bg-emerald-600 text-white hover:bg-emerald-700',
|
|
8
|
-
danger: 'bg-red-600 text-white hover:bg-red-700',
|
|
9
|
-
};
|
|
10
|
-
const sizes = {
|
|
11
|
-
sm: 'px-3 py-1.5 text-sm',
|
|
12
|
-
md: 'px-4 py-2 text-base',
|
|
13
|
-
lg: 'px-6 py-3 text-lg',
|
|
14
|
-
};
|
|
15
|
-
return (_jsx("button", { ref: ref, className: `
|
|
16
|
-
rounded-lg font-semibold transition-colors
|
|
17
|
-
${variants[variant]}
|
|
18
|
-
${sizes[size]}
|
|
19
|
-
${className || ''}
|
|
20
|
-
`, ...props, children: children }));
|
|
21
|
-
});
|
|
22
|
-
Button.displayName = 'Button';
|
|
23
|
-
export default Button;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
variant?: 'default' | 'elevated' | 'flat';
|
|
4
|
-
padding?: 'sm' | 'md' | 'lg';
|
|
5
|
-
}
|
|
6
|
-
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export default Card;
|
package/dist/components/Card.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export const Card = React.forwardRef(({ variant = 'default', padding = 'lg', className, children, ...props }, ref) => {
|
|
4
|
-
const variants = {
|
|
5
|
-
default: 'bg-white border border-gray-200 shadow-sm',
|
|
6
|
-
elevated: 'bg-white shadow-lg',
|
|
7
|
-
flat: 'bg-gray-50 border border-gray-100',
|
|
8
|
-
};
|
|
9
|
-
const paddings = {
|
|
10
|
-
sm: 'p-2',
|
|
11
|
-
md: 'p-4',
|
|
12
|
-
lg: 'p-6',
|
|
13
|
-
};
|
|
14
|
-
return (_jsx("div", { ref: ref, className: `
|
|
15
|
-
rounded-lg transition-all
|
|
16
|
-
${variants[variant]}
|
|
17
|
-
${paddings[padding]}
|
|
18
|
-
${className || ''}
|
|
19
|
-
`, ...props, children: children }));
|
|
20
|
-
});
|
|
21
|
-
Card.displayName = 'Card';
|
|
22
|
-
export default Card;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
label?: string;
|
|
4
|
-
error?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
7
|
-
export default Input;
|
package/dist/components/Input.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export const Input = React.forwardRef(({ label, error, className, ...props }, ref) => {
|
|
4
|
-
return (_jsxs("div", { className: "w-full", children: [label && _jsx("label", { className: "block text-sm font-semibold mb-2", children: label }), _jsx("input", { ref: ref, className: `
|
|
5
|
-
w-full px-4 py-2 border rounded-lg
|
|
6
|
-
focus:outline-none focus:ring-2 focus:ring-blue-500
|
|
7
|
-
${error ? 'border-red-500' : 'border-gray-300'}
|
|
8
|
-
${className || ''}
|
|
9
|
-
`, ...props }), error && _jsx("p", { className: "text-sm text-red-600 mt-1", children: error })] }));
|
|
10
|
-
});
|
|
11
|
-
Input.displayName = 'Input';
|
|
12
|
-
export default Input;
|
package/dist/components/Modal.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
export const Modal = ({ isOpen, onClose, title, children, footer, }) => {
|
|
3
|
-
if (!isOpen)
|
|
4
|
-
return null;
|
|
5
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 z-40", onClick: onClose }), _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: _jsxs("div", { className: "bg-white rounded-lg shadow-2xl max-w-md w-full mx-4", children: [title && (_jsx("div", { className: "p-6 border-b border-gray-200", children: _jsx("h2", { className: "text-xl font-bold", children: title }) })), _jsx("div", { className: "p-6", children: children }), footer && _jsx("div", { className: "p-6 border-t border-gray-200 bg-gray-50", children: footer })] }) })] }));
|
|
6
|
-
};
|
|
7
|
-
export default Modal;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const colors: {
|
|
2
|
-
primary: {
|
|
3
|
-
500: string;
|
|
4
|
-
600: string;
|
|
5
|
-
700: string;
|
|
6
|
-
};
|
|
7
|
-
success: {
|
|
8
|
-
500: string;
|
|
9
|
-
600: string;
|
|
10
|
-
700: string;
|
|
11
|
-
};
|
|
12
|
-
warning: {
|
|
13
|
-
500: string;
|
|
14
|
-
600: string;
|
|
15
|
-
700: string;
|
|
16
|
-
};
|
|
17
|
-
danger: {
|
|
18
|
-
500: string;
|
|
19
|
-
600: string;
|
|
20
|
-
700: string;
|
|
21
|
-
};
|
|
22
|
-
gray: {
|
|
23
|
-
50: string;
|
|
24
|
-
100: string;
|
|
25
|
-
200: string;
|
|
26
|
-
500: string;
|
|
27
|
-
900: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const colors = {
|
|
2
|
-
primary: {
|
|
3
|
-
500: '#2A6ECC',
|
|
4
|
-
600: '#235ABD',
|
|
5
|
-
700: '#1C45AE',
|
|
6
|
-
},
|
|
7
|
-
success: {
|
|
8
|
-
500: '#00995A',
|
|
9
|
-
600: '#007A4A',
|
|
10
|
-
700: '#005C3A',
|
|
11
|
-
},
|
|
12
|
-
warning: {
|
|
13
|
-
500: '#F9B02A',
|
|
14
|
-
600: '#E8A100',
|
|
15
|
-
700: '#D69200',
|
|
16
|
-
},
|
|
17
|
-
danger: {
|
|
18
|
-
500: '#FA5858',
|
|
19
|
-
600: '#E84545',
|
|
20
|
-
700: '#D63232',
|
|
21
|
-
},
|
|
22
|
-
gray: {
|
|
23
|
-
50: '#F9FAFB',
|
|
24
|
-
100: '#F3F4F6',
|
|
25
|
-
200: '#E5E7EB',
|
|
26
|
-
500: '#6B7280',
|
|
27
|
-
900: '#111827',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const spacing: {
|
|
2
|
-
xs: string;
|
|
3
|
-
sm: string;
|
|
4
|
-
md: string;
|
|
5
|
-
lg: string;
|
|
6
|
-
xl: string;
|
|
7
|
-
'2xl': string;
|
|
8
|
-
};
|
|
9
|
-
export declare const borderRadius: {
|
|
10
|
-
sm: string;
|
|
11
|
-
md: string;
|
|
12
|
-
lg: string;
|
|
13
|
-
xl: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const shadows: {
|
|
16
|
-
sm: string;
|
|
17
|
-
md: string;
|
|
18
|
-
lg: string;
|
|
19
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const spacing = {
|
|
2
|
-
xs: '4px',
|
|
3
|
-
sm: '8px',
|
|
4
|
-
md: '12px',
|
|
5
|
-
lg: '16px',
|
|
6
|
-
xl: '24px',
|
|
7
|
-
'2xl': '32px',
|
|
8
|
-
};
|
|
9
|
-
export const borderRadius = {
|
|
10
|
-
sm: '4px',
|
|
11
|
-
md: '6px',
|
|
12
|
-
lg: '8px',
|
|
13
|
-
xl: '12px',
|
|
14
|
-
};
|
|
15
|
-
export const shadows = {
|
|
16
|
-
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
17
|
-
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
|
|
18
|
-
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
|
19
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const typography: {
|
|
2
|
-
fontFamily: {
|
|
3
|
-
primary: string;
|
|
4
|
-
mono: string;
|
|
5
|
-
};
|
|
6
|
-
fontSize: {
|
|
7
|
-
xs: string;
|
|
8
|
-
sm: string;
|
|
9
|
-
base: string;
|
|
10
|
-
lg: string;
|
|
11
|
-
xl: string;
|
|
12
|
-
'2xl': string;
|
|
13
|
-
'3xl': string;
|
|
14
|
-
};
|
|
15
|
-
fontWeight: {
|
|
16
|
-
regular: number;
|
|
17
|
-
medium: number;
|
|
18
|
-
semibold: number;
|
|
19
|
-
bold: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const typography = {
|
|
2
|
-
fontFamily: {
|
|
3
|
-
primary: 'Poppins, -apple-system, BlinkMacSystemFont, sans-serif',
|
|
4
|
-
mono: '"Roboto Mono", monospace',
|
|
5
|
-
},
|
|
6
|
-
fontSize: {
|
|
7
|
-
xs: '10px',
|
|
8
|
-
sm: '12px',
|
|
9
|
-
base: '14px',
|
|
10
|
-
lg: '16px',
|
|
11
|
-
xl: '18px',
|
|
12
|
-
'2xl': '20px',
|
|
13
|
-
'3xl': '24px',
|
|
14
|
-
},
|
|
15
|
-
fontWeight: {
|
|
16
|
-
regular: 400,
|
|
17
|
-
medium: 500,
|
|
18
|
-
semibold: 600,
|
|
19
|
-
bold: 700,
|
|
20
|
-
},
|
|
21
|
-
};
|