@transparentcage/ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +146 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +203 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
Button: () => Button,
|
|
25
|
+
Card: () => Card,
|
|
26
|
+
Input: () => Input,
|
|
27
|
+
Stack: () => Stack,
|
|
28
|
+
Text: () => Text
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(index_exports);
|
|
31
|
+
|
|
32
|
+
// src/components/Button/Button.tsx
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
function Button({
|
|
35
|
+
variant = "primary",
|
|
36
|
+
size = "md",
|
|
37
|
+
className = "",
|
|
38
|
+
disabled,
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
type: "button",
|
|
46
|
+
className: `acme-btn acme-btn--${variant} acme-btn--${size} ${className}`.trim(),
|
|
47
|
+
disabled,
|
|
48
|
+
"data-variant": variant,
|
|
49
|
+
"data-size": size,
|
|
50
|
+
...props,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/components/Text/Text.tsx
|
|
57
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
58
|
+
function Text({
|
|
59
|
+
as: Component = "span",
|
|
60
|
+
size = "md",
|
|
61
|
+
weight = "normal",
|
|
62
|
+
tone = "primary",
|
|
63
|
+
className = "",
|
|
64
|
+
style,
|
|
65
|
+
children
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
68
|
+
Component,
|
|
69
|
+
{
|
|
70
|
+
className: `acme-text acme-text--${size} acme-text--${weight} acme-text--${tone} ${className}`.trim(),
|
|
71
|
+
"data-size": size,
|
|
72
|
+
"data-weight": weight,
|
|
73
|
+
"data-tone": tone,
|
|
74
|
+
style,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/components/Stack/Stack.tsx
|
|
81
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
82
|
+
function Stack({
|
|
83
|
+
as: Component = "div",
|
|
84
|
+
direction = "column",
|
|
85
|
+
gap = "4",
|
|
86
|
+
className = "",
|
|
87
|
+
children
|
|
88
|
+
}) {
|
|
89
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
90
|
+
Component,
|
|
91
|
+
{
|
|
92
|
+
className: `acme-stack acme-stack--${direction} acme-stack--gap-${gap} ${className}`.trim(),
|
|
93
|
+
"data-direction": direction,
|
|
94
|
+
"data-gap": gap,
|
|
95
|
+
children
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// src/components/Card/Card.tsx
|
|
101
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
102
|
+
function Card({
|
|
103
|
+
as: Component = "div",
|
|
104
|
+
elevation = "md",
|
|
105
|
+
className = "",
|
|
106
|
+
children
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
109
|
+
Component,
|
|
110
|
+
{
|
|
111
|
+
className: `acme-card acme-card--${elevation} ${className}`.trim(),
|
|
112
|
+
"data-elevation": elevation,
|
|
113
|
+
children
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/components/Input/Input.tsx
|
|
119
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
120
|
+
function Input({
|
|
121
|
+
error = false,
|
|
122
|
+
size = "md",
|
|
123
|
+
disabled,
|
|
124
|
+
className = "",
|
|
125
|
+
...props
|
|
126
|
+
}) {
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
128
|
+
"input",
|
|
129
|
+
{
|
|
130
|
+
className: `acme-input acme-input--${size} ${error ? "acme-input--error" : ""} ${disabled ? "acme-input--disabled" : ""} ${className}`.trim(),
|
|
131
|
+
disabled,
|
|
132
|
+
"data-error": error,
|
|
133
|
+
"data-size": size,
|
|
134
|
+
...props
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
139
|
+
0 && (module.exports = {
|
|
140
|
+
Button,
|
|
141
|
+
Card,
|
|
142
|
+
Input,
|
|
143
|
+
Stack,
|
|
144
|
+
Text
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/Button/Button.tsx","../src/components/Text/Text.tsx","../src/components/Stack/Stack.tsx","../src/components/Card/Card.tsx","../src/components/Input/Input.tsx"],"sourcesContent":["import \"./components/Button/Button.css\";\nimport \"./components/Text/Text.css\";\nimport \"./components/Stack/Stack.css\";\nimport \"./components/Card/Card.css\";\nimport \"./components/Input/Input.css\";\n\nexport { Button } from \"./components/Button/Button\";\nexport type { ButtonProps, ButtonVariant, ButtonSize } from \"./components/Button/Button\";\n\nexport { Text } from \"./components/Text/Text\";\nexport type { TextProps, TextSize, TextWeight, TextTone } from \"./components/Text/Text\";\n\nexport { Stack } from \"./components/Stack/Stack\";\nexport type { StackProps, StackDirection, StackGap } from \"./components/Stack/Stack\";\n\nexport { Card } from \"./components/Card/Card\";\nexport type { CardProps, CardElevation } from \"./components/Card/Card\";\n\nexport { Input } from \"./components/Input/Input\";\nexport type { InputProps } from \"./components/Input/Input\";\n","import type { ButtonHTMLAttributes } from \"react\";\nimport \"./Button.css\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n children: React.ReactNode;\n}\n\nexport function Button({\n variant = \"primary\",\n size = \"md\",\n className = \"\",\n disabled,\n children,\n ...props\n}: ButtonProps) {\n return (\n <button\n type=\"button\"\n className={`acme-btn acme-btn--${variant} acme-btn--${size} ${className}`.trim()}\n disabled={disabled}\n data-variant={variant}\n data-size={size}\n {...props}\n >\n {children}\n </button>\n );\n}\n","import \"./Text.css\";\n\nexport type TextSize =\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"2xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextTone = \"primary\" | \"secondary\" | \"muted\";\n\nexport interface TextProps {\n as?: \"span\" | \"p\" | \"div\";\n size?: TextSize;\n weight?: TextWeight;\n tone?: TextTone;\n className?: string;\n style?: React.CSSProperties;\n children: React.ReactNode;\n}\n\nexport function Text({\n as: Component = \"span\",\n size = \"md\",\n weight = \"normal\",\n tone = \"primary\",\n className = \"\",\n style,\n children,\n}: TextProps) {\n return (\n <Component\n className={`acme-text acme-text--${size} acme-text--${weight} acme-text--${tone} ${className}`.trim()}\n data-size={size}\n data-weight={weight}\n data-tone={tone}\n style={style}\n >\n {children}\n </Component>\n );\n}\n","import \"./Stack.css\";\n\nexport type StackDirection = \"row\" | \"column\";\nexport type StackGap = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"8\" | \"10\" | \"12\";\n\nexport interface StackProps {\n as?: \"div\" | \"section\" | \"article\";\n direction?: StackDirection;\n gap?: StackGap;\n className?: string;\n children: React.ReactNode;\n}\n\nexport function Stack({\n as: Component = \"div\",\n direction = \"column\",\n gap = \"4\",\n className = \"\",\n children,\n}: StackProps) {\n return (\n <Component\n className={`acme-stack acme-stack--${direction} acme-stack--gap-${gap} ${className}`.trim()}\n data-direction={direction}\n data-gap={gap}\n >\n {children}\n </Component>\n );\n}\n","import \"./Card.css\";\n\nexport type CardElevation = \"none\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface CardProps {\n as?: \"div\" | \"article\" | \"section\";\n elevation?: CardElevation;\n className?: string;\n children: React.ReactNode;\n}\n\nexport function Card({\n as: Component = \"div\",\n elevation = \"md\",\n className = \"\",\n children,\n}: CardProps) {\n return (\n <Component\n className={`acme-card acme-card--${elevation} ${className}`.trim()}\n data-elevation={elevation}\n >\n {children}\n </Component>\n );\n}\n","import type { InputHTMLAttributes } from \"react\";\nimport \"./Input.css\";\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n error?: boolean;\n /** @deprecated Use className for sizing; kept for API compatibility */\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function Input({\n error = false,\n size = \"md\",\n disabled,\n className = \"\",\n ...props\n}: InputProps) {\n return (\n <input\n className={`acme-input acme-input--${size} ${error ? \"acme-input--error\" : \"\"} ${disabled ? \"acme-input--disabled\" : \"\"} ${className}`.trim()}\n disabled={disabled}\n data-error={error}\n data-size={size}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqBI;AATG,SAAS,OAAO;AAAA,EACrB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAgB;AACd,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,sBAAsB,OAAO,cAAc,IAAI,IAAI,SAAS,GAAG,KAAK;AAAA,MAC/E;AAAA,MACA,gBAAc;AAAA,MACd,aAAW;AAAA,MACV,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;;;ACAI,IAAAA,sBAAA;AAVG,SAAS,KAAK;AAAA,EACnB,IAAI,YAAY;AAAA,EAChB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA;AACF,GAAc;AACZ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,wBAAwB,IAAI,eAAe,MAAM,eAAe,IAAI,IAAI,SAAS,GAAG,KAAK;AAAA,MACpG,aAAW;AAAA,MACX,eAAa;AAAA,MACb,aAAW;AAAA,MACX;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;ACrBI,IAAAC,sBAAA;AARG,SAAS,MAAM;AAAA,EACpB,IAAI,YAAY;AAAA,EAChB,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,YAAY;AAAA,EACZ;AACF,GAAe;AACb,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,0BAA0B,SAAS,oBAAoB,GAAG,IAAI,SAAS,GAAG,KAAK;AAAA,MAC1F,kBAAgB;AAAA,MAChB,YAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;;;ACXI,IAAAC,sBAAA;AAPG,SAAS,KAAK;AAAA,EACnB,IAAI,YAAY;AAAA,EAChB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AACF,GAAc;AACZ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,wBAAwB,SAAS,IAAI,SAAS,GAAG,KAAK;AAAA,MACjE,kBAAgB;AAAA,MAEf;AAAA;AAAA,EACH;AAEJ;;;ACRI,IAAAC,sBAAA;AARG,SAAS,MAAM;AAAA,EACpB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,GAAe;AACb,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,0BAA0B,IAAI,IAAI,QAAQ,sBAAsB,EAAE,IAAI,WAAW,yBAAyB,EAAE,IAAI,SAAS,GAAG,KAAK;AAAA,MAC5I;AAAA,MACA,cAAY;AAAA,MACZ,aAAW;AAAA,MACV,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/* src/components/Button/Button.css */
|
|
2
|
+
.acme-btn {
|
|
3
|
+
font-family: var(--typography-font-family-sans);
|
|
4
|
+
font-weight: var(--typography-font-weight-medium);
|
|
5
|
+
border: var(--border-width-1) solid transparent;
|
|
6
|
+
border-radius: var(--radius-md);
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
transition:
|
|
9
|
+
background-color var(--motion-duration-fast) var(--motion-easing-default),
|
|
10
|
+
color var(--motion-duration-fast) var(--motion-easing-default),
|
|
11
|
+
border-color var(--motion-duration-fast) var(--motion-easing-default);
|
|
12
|
+
}
|
|
13
|
+
.acme-btn:disabled {
|
|
14
|
+
opacity: 0.6;
|
|
15
|
+
cursor: not-allowed;
|
|
16
|
+
}
|
|
17
|
+
.acme-btn--sm {
|
|
18
|
+
padding: var(--space-1) var(--space-3);
|
|
19
|
+
font-size: var(--typography-font-size-sm);
|
|
20
|
+
}
|
|
21
|
+
.acme-btn--md {
|
|
22
|
+
padding: var(--space-2) var(--space-4);
|
|
23
|
+
font-size: var(--typography-font-size-md);
|
|
24
|
+
}
|
|
25
|
+
.acme-btn--lg {
|
|
26
|
+
padding: var(--space-3) var(--space-5);
|
|
27
|
+
font-size: var(--typography-font-size-lg);
|
|
28
|
+
}
|
|
29
|
+
.acme-btn--primary {
|
|
30
|
+
background-color: var(--color-brand-primary);
|
|
31
|
+
color: var(--color-text-inverse);
|
|
32
|
+
}
|
|
33
|
+
.acme-btn--primary:hover:not(:disabled) {
|
|
34
|
+
background-color: var(--color-brand-primary-hover);
|
|
35
|
+
}
|
|
36
|
+
.acme-btn--secondary {
|
|
37
|
+
background-color: var(--color-bg-surface-alt);
|
|
38
|
+
color: var(--color-text-primary);
|
|
39
|
+
border-color: var(--color-border-default);
|
|
40
|
+
}
|
|
41
|
+
.acme-btn--secondary:hover:not(:disabled) {
|
|
42
|
+
background-color: var(--color-border-muted);
|
|
43
|
+
border-color: var(--color-border-strong);
|
|
44
|
+
}
|
|
45
|
+
.acme-btn--ghost {
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
color: var(--color-text-primary);
|
|
48
|
+
}
|
|
49
|
+
.acme-btn--ghost:hover:not(:disabled) {
|
|
50
|
+
background-color: var(--color-bg-surface-alt);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* src/components/Text/Text.css */
|
|
54
|
+
.acme-text {
|
|
55
|
+
font-family: var(--typography-font-family-sans);
|
|
56
|
+
line-height: var(--typography-line-height-normal);
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
.acme-text--xs {
|
|
60
|
+
font-size: var(--typography-font-size-xs);
|
|
61
|
+
}
|
|
62
|
+
.acme-text--sm {
|
|
63
|
+
font-size: var(--typography-font-size-sm);
|
|
64
|
+
}
|
|
65
|
+
.acme-text--md {
|
|
66
|
+
font-size: var(--typography-font-size-md);
|
|
67
|
+
}
|
|
68
|
+
.acme-text--lg {
|
|
69
|
+
font-size: var(--typography-font-size-lg);
|
|
70
|
+
}
|
|
71
|
+
.acme-text--xl {
|
|
72
|
+
font-size: var(--typography-font-size-xl);
|
|
73
|
+
}
|
|
74
|
+
.acme-text--2xl {
|
|
75
|
+
font-size: var(--typography-font-size-2xl);
|
|
76
|
+
}
|
|
77
|
+
.acme-text--normal {
|
|
78
|
+
font-weight: var(--typography-font-weight-normal);
|
|
79
|
+
}
|
|
80
|
+
.acme-text--medium {
|
|
81
|
+
font-weight: var(--typography-font-weight-medium);
|
|
82
|
+
}
|
|
83
|
+
.acme-text--semibold {
|
|
84
|
+
font-weight: var(--typography-font-weight-semibold);
|
|
85
|
+
}
|
|
86
|
+
.acme-text--bold {
|
|
87
|
+
font-weight: var(--typography-font-weight-bold);
|
|
88
|
+
}
|
|
89
|
+
.acme-text--primary {
|
|
90
|
+
color: var(--color-text-primary);
|
|
91
|
+
}
|
|
92
|
+
.acme-text--secondary {
|
|
93
|
+
color: var(--color-text-secondary);
|
|
94
|
+
}
|
|
95
|
+
.acme-text--muted {
|
|
96
|
+
color: var(--color-text-muted);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* src/components/Stack/Stack.css */
|
|
100
|
+
.acme-stack {
|
|
101
|
+
display: flex;
|
|
102
|
+
}
|
|
103
|
+
.acme-stack--row {
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
}
|
|
106
|
+
.acme-stack--column {
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
}
|
|
109
|
+
.acme-stack--gap-0 {
|
|
110
|
+
gap: var(--space-0);
|
|
111
|
+
}
|
|
112
|
+
.acme-stack--gap-1 {
|
|
113
|
+
gap: var(--space-1);
|
|
114
|
+
}
|
|
115
|
+
.acme-stack--gap-2 {
|
|
116
|
+
gap: var(--space-2);
|
|
117
|
+
}
|
|
118
|
+
.acme-stack--gap-3 {
|
|
119
|
+
gap: var(--space-3);
|
|
120
|
+
}
|
|
121
|
+
.acme-stack--gap-4 {
|
|
122
|
+
gap: var(--space-4);
|
|
123
|
+
}
|
|
124
|
+
.acme-stack--gap-5 {
|
|
125
|
+
gap: var(--space-5);
|
|
126
|
+
}
|
|
127
|
+
.acme-stack--gap-6 {
|
|
128
|
+
gap: var(--space-6);
|
|
129
|
+
}
|
|
130
|
+
.acme-stack--gap-8 {
|
|
131
|
+
gap: var(--space-8);
|
|
132
|
+
}
|
|
133
|
+
.acme-stack--gap-10 {
|
|
134
|
+
gap: var(--space-10);
|
|
135
|
+
}
|
|
136
|
+
.acme-stack--gap-12 {
|
|
137
|
+
gap: var(--space-12);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* src/components/Card/Card.css */
|
|
141
|
+
.acme-card {
|
|
142
|
+
background-color: var(--color-bg-surface);
|
|
143
|
+
border: var(--border-width-1) solid var(--color-border-default);
|
|
144
|
+
border-radius: var(--radius-lg);
|
|
145
|
+
padding: var(--space-4);
|
|
146
|
+
}
|
|
147
|
+
.acme-card--none {
|
|
148
|
+
box-shadow: var(--shadow-none);
|
|
149
|
+
}
|
|
150
|
+
.acme-card--sm {
|
|
151
|
+
box-shadow: var(--shadow-sm);
|
|
152
|
+
}
|
|
153
|
+
.acme-card--md {
|
|
154
|
+
box-shadow: var(--shadow-md);
|
|
155
|
+
}
|
|
156
|
+
.acme-card--lg {
|
|
157
|
+
box-shadow: var(--shadow-lg);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* src/components/Input/Input.css */
|
|
161
|
+
.acme-input {
|
|
162
|
+
font-family: var(--typography-font-family-sans);
|
|
163
|
+
color: var(--color-text-primary);
|
|
164
|
+
background-color: var(--color-bg-surface);
|
|
165
|
+
border: var(--border-width-1) solid var(--color-border-default);
|
|
166
|
+
border-radius: var(--radius-md);
|
|
167
|
+
padding: var(--space-2) var(--space-3);
|
|
168
|
+
transition: border-color var(--motion-duration-fast) var(--motion-easing-default), box-shadow var(--motion-duration-fast) var(--motion-easing-default);
|
|
169
|
+
}
|
|
170
|
+
.acme-input::placeholder {
|
|
171
|
+
color: var(--color-text-muted);
|
|
172
|
+
}
|
|
173
|
+
.acme-input:hover:not(:disabled):not(.acme-input--error) {
|
|
174
|
+
border-color: var(--color-border-strong);
|
|
175
|
+
}
|
|
176
|
+
.acme-input:focus {
|
|
177
|
+
outline: none;
|
|
178
|
+
border-color: var(--color-brand-primary);
|
|
179
|
+
box-shadow: 0 0 0 2px var(--color-brand-primary-muted);
|
|
180
|
+
}
|
|
181
|
+
.acme-input--error {
|
|
182
|
+
border-color: var(--color-status-error);
|
|
183
|
+
}
|
|
184
|
+
.acme-input--error:focus {
|
|
185
|
+
box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
|
|
186
|
+
}
|
|
187
|
+
.acme-input--disabled {
|
|
188
|
+
opacity: 0.6;
|
|
189
|
+
cursor: not-allowed;
|
|
190
|
+
background-color: var(--color-bg-surface-alt);
|
|
191
|
+
}
|
|
192
|
+
.acme-input--sm {
|
|
193
|
+
font-size: var(--typography-font-size-sm);
|
|
194
|
+
padding: var(--space-1) var(--space-2);
|
|
195
|
+
}
|
|
196
|
+
.acme-input--md {
|
|
197
|
+
font-size: var(--typography-font-size-md);
|
|
198
|
+
}
|
|
199
|
+
.acme-input--lg {
|
|
200
|
+
font-size: var(--typography-font-size-lg);
|
|
201
|
+
padding: var(--space-3) var(--space-4);
|
|
202
|
+
}
|
|
203
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button/Button.css","../src/components/Text/Text.css","../src/components/Stack/Stack.css","../src/components/Card/Card.css","../src/components/Input/Input.css"],"sourcesContent":[".acme-btn {\n font-family: var(--typography-font-family-sans);\n font-weight: var(--typography-font-weight-medium);\n border: var(--border-width-1) solid transparent;\n border-radius: var(--radius-md);\n cursor: pointer;\n transition:\n background-color var(--motion-duration-fast) var(--motion-easing-default),\n color var(--motion-duration-fast) var(--motion-easing-default),\n border-color var(--motion-duration-fast) var(--motion-easing-default);\n}\n\n.acme-btn:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n/* Sizes */\n.acme-btn--sm {\n padding: var(--space-1) var(--space-3);\n font-size: var(--typography-font-size-sm);\n}\n\n.acme-btn--md {\n padding: var(--space-2) var(--space-4);\n font-size: var(--typography-font-size-md);\n}\n\n.acme-btn--lg {\n padding: var(--space-3) var(--space-5);\n font-size: var(--typography-font-size-lg);\n}\n\n/* Variants */\n.acme-btn--primary {\n background-color: var(--color-brand-primary);\n color: var(--color-text-inverse);\n}\n\n.acme-btn--primary:hover:not(:disabled) {\n background-color: var(--color-brand-primary-hover);\n}\n\n.acme-btn--secondary {\n background-color: var(--color-bg-surface-alt);\n color: var(--color-text-primary);\n border-color: var(--color-border-default);\n}\n\n.acme-btn--secondary:hover:not(:disabled) {\n background-color: var(--color-border-muted);\n border-color: var(--color-border-strong);\n}\n\n.acme-btn--ghost {\n background-color: transparent;\n color: var(--color-text-primary);\n}\n\n.acme-btn--ghost:hover:not(:disabled) {\n background-color: var(--color-bg-surface-alt);\n}\n",".acme-text {\n font-family: var(--typography-font-family-sans);\n line-height: var(--typography-line-height-normal);\n margin: 0;\n}\n\n.acme-text--xs {\n font-size: var(--typography-font-size-xs);\n}\n.acme-text--sm {\n font-size: var(--typography-font-size-sm);\n}\n.acme-text--md {\n font-size: var(--typography-font-size-md);\n}\n.acme-text--lg {\n font-size: var(--typography-font-size-lg);\n}\n.acme-text--xl {\n font-size: var(--typography-font-size-xl);\n}\n.acme-text--2xl {\n font-size: var(--typography-font-size-2xl);\n}\n\n.acme-text--normal {\n font-weight: var(--typography-font-weight-normal);\n}\n.acme-text--medium {\n font-weight: var(--typography-font-weight-medium);\n}\n.acme-text--semibold {\n font-weight: var(--typography-font-weight-semibold);\n}\n.acme-text--bold {\n font-weight: var(--typography-font-weight-bold);\n}\n\n.acme-text--primary {\n color: var(--color-text-primary);\n}\n.acme-text--secondary {\n color: var(--color-text-secondary);\n}\n.acme-text--muted {\n color: var(--color-text-muted);\n}\n",".acme-stack {\n display: flex;\n}\n\n.acme-stack--row {\n flex-direction: row;\n}\n\n.acme-stack--column {\n flex-direction: column;\n}\n\n.acme-stack--gap-0 {\n gap: var(--space-0);\n}\n.acme-stack--gap-1 {\n gap: var(--space-1);\n}\n.acme-stack--gap-2 {\n gap: var(--space-2);\n}\n.acme-stack--gap-3 {\n gap: var(--space-3);\n}\n.acme-stack--gap-4 {\n gap: var(--space-4);\n}\n.acme-stack--gap-5 {\n gap: var(--space-5);\n}\n.acme-stack--gap-6 {\n gap: var(--space-6);\n}\n.acme-stack--gap-8 {\n gap: var(--space-8);\n}\n.acme-stack--gap-10 {\n gap: var(--space-10);\n}\n.acme-stack--gap-12 {\n gap: var(--space-12);\n}\n",".acme-card {\n background-color: var(--color-bg-surface);\n border: var(--border-width-1) solid var(--color-border-default);\n border-radius: var(--radius-lg);\n padding: var(--space-4);\n}\n\n.acme-card--none {\n box-shadow: var(--shadow-none);\n}\n\n.acme-card--sm {\n box-shadow: var(--shadow-sm);\n}\n\n.acme-card--md {\n box-shadow: var(--shadow-md);\n}\n\n.acme-card--lg {\n box-shadow: var(--shadow-lg);\n}\n",".acme-input {\n font-family: var(--typography-font-family-sans);\n color: var(--color-text-primary);\n background-color: var(--color-bg-surface);\n border: var(--border-width-1) solid var(--color-border-default);\n border-radius: var(--radius-md);\n padding: var(--space-2) var(--space-3);\n transition:\n border-color var(--motion-duration-fast) var(--motion-easing-default),\n box-shadow var(--motion-duration-fast) var(--motion-easing-default);\n}\n\n.acme-input::placeholder {\n color: var(--color-text-muted);\n}\n\n.acme-input:hover:not(:disabled):not(.acme-input--error) {\n border-color: var(--color-border-strong);\n}\n\n.acme-input:focus {\n outline: none;\n border-color: var(--color-brand-primary);\n box-shadow: 0 0 0 2px var(--color-brand-primary-muted);\n}\n\n.acme-input--error {\n border-color: var(--color-status-error);\n}\n\n.acme-input--error:focus {\n box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);\n}\n\n.acme-input--disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background-color: var(--color-bg-surface-alt);\n}\n\n.acme-input--sm {\n font-size: var(--typography-font-size-sm);\n padding: var(--space-1) var(--space-2);\n}\n\n.acme-input--md {\n font-size: var(--typography-font-size-md);\n}\n\n.acme-input--lg {\n font-size: var(--typography-font-size-lg);\n padding: var(--space-3) var(--space-4);\n}\n"],"mappings":"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","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = "primary" | "secondary" | "ghost";
|
|
5
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
6
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Button({ variant, size, className, disabled, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
type TextSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
14
|
+
type TextWeight = "normal" | "medium" | "semibold" | "bold";
|
|
15
|
+
type TextTone = "primary" | "secondary" | "muted";
|
|
16
|
+
interface TextProps {
|
|
17
|
+
as?: "span" | "p" | "div";
|
|
18
|
+
size?: TextSize;
|
|
19
|
+
weight?: TextWeight;
|
|
20
|
+
tone?: TextTone;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare function Text({ as: Component, size, weight, tone, className, style, children, }: TextProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
type StackDirection = "row" | "column";
|
|
28
|
+
type StackGap = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "8" | "10" | "12";
|
|
29
|
+
interface StackProps {
|
|
30
|
+
as?: "div" | "section" | "article";
|
|
31
|
+
direction?: StackDirection;
|
|
32
|
+
gap?: StackGap;
|
|
33
|
+
className?: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare function Stack({ as: Component, direction, gap, className, children, }: StackProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
type CardElevation = "none" | "sm" | "md" | "lg";
|
|
39
|
+
interface CardProps {
|
|
40
|
+
as?: "div" | "article" | "section";
|
|
41
|
+
elevation?: CardElevation;
|
|
42
|
+
className?: string;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
declare function Card({ as: Component, elevation, className, children, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
48
|
+
error?: boolean;
|
|
49
|
+
/** @deprecated Use className for sizing; kept for API compatibility */
|
|
50
|
+
size?: "sm" | "md" | "lg";
|
|
51
|
+
}
|
|
52
|
+
declare function Input({ error, size, disabled, className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardElevation, type CardProps, Input, type InputProps, Stack, type StackDirection, type StackGap, type StackProps, Text, type TextProps, type TextSize, type TextTone, type TextWeight };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = "primary" | "secondary" | "ghost";
|
|
5
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
6
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Button({ variant, size, className, disabled, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
type TextSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
14
|
+
type TextWeight = "normal" | "medium" | "semibold" | "bold";
|
|
15
|
+
type TextTone = "primary" | "secondary" | "muted";
|
|
16
|
+
interface TextProps {
|
|
17
|
+
as?: "span" | "p" | "div";
|
|
18
|
+
size?: TextSize;
|
|
19
|
+
weight?: TextWeight;
|
|
20
|
+
tone?: TextTone;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare function Text({ as: Component, size, weight, tone, className, style, children, }: TextProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
|
|
27
|
+
type StackDirection = "row" | "column";
|
|
28
|
+
type StackGap = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "8" | "10" | "12";
|
|
29
|
+
interface StackProps {
|
|
30
|
+
as?: "div" | "section" | "article";
|
|
31
|
+
direction?: StackDirection;
|
|
32
|
+
gap?: StackGap;
|
|
33
|
+
className?: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare function Stack({ as: Component, direction, gap, className, children, }: StackProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
type CardElevation = "none" | "sm" | "md" | "lg";
|
|
39
|
+
interface CardProps {
|
|
40
|
+
as?: "div" | "article" | "section";
|
|
41
|
+
elevation?: CardElevation;
|
|
42
|
+
className?: string;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
declare function Card({ as: Component, elevation, className, children, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
48
|
+
error?: boolean;
|
|
49
|
+
/** @deprecated Use className for sizing; kept for API compatibility */
|
|
50
|
+
size?: "sm" | "md" | "lg";
|
|
51
|
+
}
|
|
52
|
+
declare function Input({ error, size, disabled, className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardElevation, type CardProps, Input, type InputProps, Stack, type StackDirection, type StackGap, type StackProps, Text, type TextProps, type TextSize, type TextTone, type TextWeight };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/Button/Button.tsx
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function Button({
|
|
6
|
+
variant = "primary",
|
|
7
|
+
size = "md",
|
|
8
|
+
className = "",
|
|
9
|
+
disabled,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"button",
|
|
15
|
+
{
|
|
16
|
+
type: "button",
|
|
17
|
+
className: `acme-btn acme-btn--${variant} acme-btn--${size} ${className}`.trim(),
|
|
18
|
+
disabled,
|
|
19
|
+
"data-variant": variant,
|
|
20
|
+
"data-size": size,
|
|
21
|
+
...props,
|
|
22
|
+
children
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/components/Text/Text.tsx
|
|
28
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
29
|
+
function Text({
|
|
30
|
+
as: Component = "span",
|
|
31
|
+
size = "md",
|
|
32
|
+
weight = "normal",
|
|
33
|
+
tone = "primary",
|
|
34
|
+
className = "",
|
|
35
|
+
style,
|
|
36
|
+
children
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ jsx2(
|
|
39
|
+
Component,
|
|
40
|
+
{
|
|
41
|
+
className: `acme-text acme-text--${size} acme-text--${weight} acme-text--${tone} ${className}`.trim(),
|
|
42
|
+
"data-size": size,
|
|
43
|
+
"data-weight": weight,
|
|
44
|
+
"data-tone": tone,
|
|
45
|
+
style,
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/components/Stack/Stack.tsx
|
|
52
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
53
|
+
function Stack({
|
|
54
|
+
as: Component = "div",
|
|
55
|
+
direction = "column",
|
|
56
|
+
gap = "4",
|
|
57
|
+
className = "",
|
|
58
|
+
children
|
|
59
|
+
}) {
|
|
60
|
+
return /* @__PURE__ */ jsx3(
|
|
61
|
+
Component,
|
|
62
|
+
{
|
|
63
|
+
className: `acme-stack acme-stack--${direction} acme-stack--gap-${gap} ${className}`.trim(),
|
|
64
|
+
"data-direction": direction,
|
|
65
|
+
"data-gap": gap,
|
|
66
|
+
children
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/components/Card/Card.tsx
|
|
72
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
73
|
+
function Card({
|
|
74
|
+
as: Component = "div",
|
|
75
|
+
elevation = "md",
|
|
76
|
+
className = "",
|
|
77
|
+
children
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsx4(
|
|
80
|
+
Component,
|
|
81
|
+
{
|
|
82
|
+
className: `acme-card acme-card--${elevation} ${className}`.trim(),
|
|
83
|
+
"data-elevation": elevation,
|
|
84
|
+
children
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// src/components/Input/Input.tsx
|
|
90
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
91
|
+
function Input({
|
|
92
|
+
error = false,
|
|
93
|
+
size = "md",
|
|
94
|
+
disabled,
|
|
95
|
+
className = "",
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsx5(
|
|
99
|
+
"input",
|
|
100
|
+
{
|
|
101
|
+
className: `acme-input acme-input--${size} ${error ? "acme-input--error" : ""} ${disabled ? "acme-input--disabled" : ""} ${className}`.trim(),
|
|
102
|
+
disabled,
|
|
103
|
+
"data-error": error,
|
|
104
|
+
"data-size": size,
|
|
105
|
+
...props
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
Button,
|
|
111
|
+
Card,
|
|
112
|
+
Input,
|
|
113
|
+
Stack,
|
|
114
|
+
Text
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button/Button.tsx","../src/components/Text/Text.tsx","../src/components/Stack/Stack.tsx","../src/components/Card/Card.tsx","../src/components/Input/Input.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\nimport \"./Button.css\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n children: React.ReactNode;\n}\n\nexport function Button({\n variant = \"primary\",\n size = \"md\",\n className = \"\",\n disabled,\n children,\n ...props\n}: ButtonProps) {\n return (\n <button\n type=\"button\"\n className={`acme-btn acme-btn--${variant} acme-btn--${size} ${className}`.trim()}\n disabled={disabled}\n data-variant={variant}\n data-size={size}\n {...props}\n >\n {children}\n </button>\n );\n}\n","import \"./Text.css\";\n\nexport type TextSize =\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"2xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextTone = \"primary\" | \"secondary\" | \"muted\";\n\nexport interface TextProps {\n as?: \"span\" | \"p\" | \"div\";\n size?: TextSize;\n weight?: TextWeight;\n tone?: TextTone;\n className?: string;\n style?: React.CSSProperties;\n children: React.ReactNode;\n}\n\nexport function Text({\n as: Component = \"span\",\n size = \"md\",\n weight = \"normal\",\n tone = \"primary\",\n className = \"\",\n style,\n children,\n}: TextProps) {\n return (\n <Component\n className={`acme-text acme-text--${size} acme-text--${weight} acme-text--${tone} ${className}`.trim()}\n data-size={size}\n data-weight={weight}\n data-tone={tone}\n style={style}\n >\n {children}\n </Component>\n );\n}\n","import \"./Stack.css\";\n\nexport type StackDirection = \"row\" | \"column\";\nexport type StackGap = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"8\" | \"10\" | \"12\";\n\nexport interface StackProps {\n as?: \"div\" | \"section\" | \"article\";\n direction?: StackDirection;\n gap?: StackGap;\n className?: string;\n children: React.ReactNode;\n}\n\nexport function Stack({\n as: Component = \"div\",\n direction = \"column\",\n gap = \"4\",\n className = \"\",\n children,\n}: StackProps) {\n return (\n <Component\n className={`acme-stack acme-stack--${direction} acme-stack--gap-${gap} ${className}`.trim()}\n data-direction={direction}\n data-gap={gap}\n >\n {children}\n </Component>\n );\n}\n","import \"./Card.css\";\n\nexport type CardElevation = \"none\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface CardProps {\n as?: \"div\" | \"article\" | \"section\";\n elevation?: CardElevation;\n className?: string;\n children: React.ReactNode;\n}\n\nexport function Card({\n as: Component = \"div\",\n elevation = \"md\",\n className = \"\",\n children,\n}: CardProps) {\n return (\n <Component\n className={`acme-card acme-card--${elevation} ${className}`.trim()}\n data-elevation={elevation}\n >\n {children}\n </Component>\n );\n}\n","import type { InputHTMLAttributes } from \"react\";\nimport \"./Input.css\";\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n error?: boolean;\n /** @deprecated Use className for sizing; kept for API compatibility */\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function Input({\n error = false,\n size = \"md\",\n disabled,\n className = \"\",\n ...props\n}: InputProps) {\n return (\n <input\n className={`acme-input acme-input--${size} ${error ? \"acme-input--error\" : \"\"} ${disabled ? \"acme-input--disabled\" : \"\"} ${className}`.trim()}\n disabled={disabled}\n data-error={error}\n data-size={size}\n {...props}\n />\n );\n}\n"],"mappings":";;;AAqBI;AATG,SAAS,OAAO;AAAA,EACrB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAgB;AACd,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,sBAAsB,OAAO,cAAc,IAAI,IAAI,SAAS,GAAG,KAAK;AAAA,MAC/E;AAAA,MACA,gBAAc;AAAA,MACd,aAAW;AAAA,MACV,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;;;ACAI,gBAAAA,YAAA;AAVG,SAAS,KAAK;AAAA,EACnB,IAAI,YAAY;AAAA,EAChB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA;AACF,GAAc;AACZ,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,wBAAwB,IAAI,eAAe,MAAM,eAAe,IAAI,IAAI,SAAS,GAAG,KAAK;AAAA,MACpG,aAAW;AAAA,MACX,eAAa;AAAA,MACb,aAAW;AAAA,MACX;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;ACrBI,gBAAAC,YAAA;AARG,SAAS,MAAM;AAAA,EACpB,IAAI,YAAY;AAAA,EAChB,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,YAAY;AAAA,EACZ;AACF,GAAe;AACb,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,0BAA0B,SAAS,oBAAoB,GAAG,IAAI,SAAS,GAAG,KAAK;AAAA,MAC1F,kBAAgB;AAAA,MAChB,YAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;;;ACXI,gBAAAC,YAAA;AAPG,SAAS,KAAK;AAAA,EACnB,IAAI,YAAY;AAAA,EAChB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AACF,GAAc;AACZ,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,wBAAwB,SAAS,IAAI,SAAS,GAAG,KAAK;AAAA,MACjE,kBAAgB;AAAA,MAEf;AAAA;AAAA,EACH;AAEJ;;;ACRI,gBAAAC,YAAA;AARG,SAAS,MAAM;AAAA,EACpB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,GAAe;AACb,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,0BAA0B,IAAI,IAAI,QAAQ,sBAAsB,EAAE,IAAI,WAAW,yBAAyB,EAAE,IAAI,SAAS,GAAG,KAAK;AAAA,MAC5I;AAAA,MACA,cAAY;AAAA,MACZ,aAAW;AAAA,MACV,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["jsx","jsx","jsx","jsx"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@transparentcage/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": ">=18.0.0",
|
|
25
|
+
"react-dom": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/react": "^18.2.0",
|
|
29
|
+
"@types/react-dom": "^18.2.0",
|
|
30
|
+
"react": "^18.2.0",
|
|
31
|
+
"react-dom": "^18.2.0",
|
|
32
|
+
"tsup": "^8.0.0",
|
|
33
|
+
"typescript": "^5.3.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup",
|
|
37
|
+
"dev": "tsup --watch",
|
|
38
|
+
"lint": "eslint .",
|
|
39
|
+
"typecheck": "tsc --noEmit"
|
|
40
|
+
}
|
|
41
|
+
}
|