villela-ui 0.1.0
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.css +596 -0
- package/dist/index.d.mts +249 -0
- package/dist/index.d.ts +249 -0
- package/dist/index.js +409 -0
- package/dist/index.mjs +377 -0
- package/package.json +44 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
// src/tokens/colors/colors.css.ts
|
|
2
|
+
var colors = { palette: { primary: "var(--palette-primary__e8shvx0)", secundary: "var(--palette-secundary__e8shvx1)", tertiary: "var(--palette-tertiary__e8shvx2)", quaternary: "var(--palette-quaternary__e8shvx3)", quinary: "var(--palette-quinary__e8shvx4)" }, toning: { primary: { t30: "var(--toning-primary-t30__e8shvx5)", t50: "var(--toning-primary-t50__e8shvx6)", t60: "var(--toning-primary-t60__e8shvx7)", t70: "var(--toning-primary-t70__e8shvx8)", t80: "var(--toning-primary-t80__e8shvx9)", t90: "var(--toning-primary-t90__e8shvxa)" }, error: { t30: "var(--toning-error-t30__e8shvxb)", t50: "var(--toning-error-t50__e8shvxc)", t60: "var(--toning-error-t60__e8shvxd)", t70: "var(--toning-error-t70__e8shvxe)", t80: "var(--toning-error-t80__e8shvxf)", t90: "var(--toning-error-t90__e8shvxg)" }, success: { t30: "var(--toning-success-t30__e8shvxh)", t50: "var(--toning-success-t50__e8shvxi)", t60: "var(--toning-success-t60__e8shvxj)", t70: "var(--toning-success-t70__e8shvxk)", t80: "var(--toning-success-t80__e8shvxl)", t90: "var(--toning-success-t90__e8shvxm)" }, warning: { t30: "var(--toning-warning-t30__e8shvxn)", t50: "var(--toning-warning-t50__e8shvxo)", t60: "var(--toning-warning-t60__e8shvxp)", t70: "var(--toning-warning-t70__e8shvxq)", t80: "var(--toning-warning-t80__e8shvxr)", t90: "var(--toning-warning-t90__e8shvxs)" }, base: { t30: "var(--toning-base-t30__e8shvxt)", t50: "var(--toning-base-t50__e8shvxu)", t60: "var(--toning-base-t60__e8shvxv)", t70: "var(--toning-base-t70__e8shvxw)", t80: "var(--toning-base-t80__e8shvxx)", t90: "var(--toning-base-t90__e8shvxy)" } }, text: { primary: { T60: "var(--text-primary-T60__e8shvxz)", T30: "var(--text-primary-T30__e8shvx10)", T10: "var(--text-primary-T10__e8shvx11)", T05: "var(--text-primary-T05__e8shvx12)", TO1: "var(--text-primary-TO1__e8shvx13)" }, secundary: { T60: "var(--text-secundary-T60__e8shvx14)", T30: "var(--text-secundary-T30__e8shvx15)", T10: "var(--text-secundary-T10__e8shvx16)", T05: "var(--text-secundary-T05__e8shvx17)", TO1: "var(--text-secundary-TO1__e8shvx18)" }, error: { T60L: "var(--text-error-T60L__e8shvx19)", T30: "var(--text-error-T30__e8shvx1a)", T10: "var(--text-error-T10__e8shvx1b)", T05: "var(--text-error-T05__e8shvx1c)", TO1: "var(--text-error-TO1__e8shvx1d)" }, success: { T60: "var(--text-success-T60__e8shvx1e)", T30: "var(--text-success-T30__e8shvx1f)", T10: "var(--text-success-T10__e8shvx1g)", T05: "var(--text-success-T05__e8shvx1h)", T01: "var(--text-success-T01__e8shvx1i)" }, warning: { T60: "var(--text-warning-T60__e8shvx1j)", T30: "var(--text-warning-T30__e8shvx1k)", T10: "var(--text-warning-T10__e8shvx1l)", TO5: "var(--text-warning-TO5__e8shvx1m)", T01: "var(--text-warning-T01__e8shvx1n)" } } };
|
|
3
|
+
|
|
4
|
+
// src/tokens/spacing/spacing.css.ts
|
|
5
|
+
var spacing = { space: { "0": "var(--space-0__17tztz60)", "1": "var(--space-1__17tztz61)", "2": "var(--space-2__17tztz62)", "3": "var(--space-3__17tztz63)", "4": "var(--space-4__17tztz64)", "5": "var(--space-5__17tztz65)", "6": "var(--space-6__17tztz66)", "7": "var(--space-7__17tztz67)", "8": "var(--space-8__17tztz68)", "9": "var(--space-9__17tztz69)", "10": "var(--space-10__17tztz6a)", "12": "var(--space-12__17tztz6b)", "14": "var(--space-14__17tztz6c)", "16": "var(--space-16__17tztz6d)", "20": "var(--space-20__17tztz6e)", "24": "var(--space-24__17tztz6f)", "28": "var(--space-28__17tztz6g)", "32": "var(--space-32__17tztz6h)", "36": "var(--space-36__17tztz6i)", "40": "var(--space-40__17tztz6j)", "48": "var(--space-48__17tztz6k)", "56": "var(--space-56__17tztz6l)", "64": "var(--space-64__17tztz6m)" } };
|
|
6
|
+
|
|
7
|
+
// src/tokens/typograpgy/typography.css.ts
|
|
8
|
+
var typography = { fontFamily: "var(--fontFamily__6elmlr0)" };
|
|
9
|
+
|
|
10
|
+
// src/tokens/radius/radii.css.ts
|
|
11
|
+
var radii = { width: { small: "var(--width-small__xtrgmf0)", medium: "var(--width-medium__xtrgmf1)", large: "var(--width-large__xtrgmf2)" }, radius: { small: "var(--radius-small__xtrgmf3)", medium: "var(--radius-medium__xtrgmf4)", large: "var(--radius-large__xtrgmf5)", rounded: "var(--radius-rounded__xtrgmf6)" } };
|
|
12
|
+
|
|
13
|
+
// src/tokens/shadows/shadows.css.ts
|
|
14
|
+
var shadows = { shadow: { none: "var(--shadow-none__3ldqw10)", xs: "var(--shadow-xs__3ldqw11)", sm: "var(--shadow-sm__3ldqw12)", md: "var(--shadow-md__3ldqw13)", lg: "var(--shadow-lg__3ldqw14)", xl: "var(--shadow-xl__3ldqw15)" } };
|
|
15
|
+
|
|
16
|
+
// src/components/button/button.component.tsx
|
|
17
|
+
import {
|
|
18
|
+
useEffect,
|
|
19
|
+
useState
|
|
20
|
+
} from "react";
|
|
21
|
+
|
|
22
|
+
// src/components/button/button.css.ts
|
|
23
|
+
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
24
|
+
var button = _7a468({ defaultClassName: "button_button__rnxq7e0", variantClassNames: { variant: { primary: "button_button_variant_primary__rnxq7e1", secondary: "button_button_variant_secondary__rnxq7e2", tertiary: "button_button_variant_tertiary__rnxq7e3" }, color: { brand: "button_button_color_brand__rnxq7e4", error: "button_button_color_error__rnxq7e5", warning: "button_button_color_warning__rnxq7e6", success: "button_button_color_success__rnxq7e7" }, size: { xl: "button_button_size_xl__rnxq7e8", lg: "button_button_size_lg__rnxq7e9", md: "button_button_size_md__rnxq7ea", sm: "button_button_size_sm__rnxq7eb", icon: "button_button_size_icon__rnxq7ec" }, pill: { true: "button_button_pill_true__rnxq7ed", false: "button_button_pill_false__rnxq7ee" }, disabled: { true: "button_button_disabled_true__rnxq7ef", false: "button_button_disabled_false__rnxq7eg" } }, defaultVariants: { variant: "primary", color: "brand", size: "md", pill: false, disabled: false }, compoundVariants: [[{ variant: "primary", color: "brand" }, "button_button_compound_0__rnxq7eh"], [{ variant: "secondary", color: "brand" }, "button_button_compound_1__rnxq7ei"], [{ variant: "tertiary", color: "brand" }, "button_button_compound_2__rnxq7ej"], [{ variant: "primary", color: "error" }, "button_button_compound_3__rnxq7ek"], [{ variant: "secondary", color: "error" }, "button_button_compound_4__rnxq7el"], [{ variant: "tertiary", color: "error" }, "button_button_compound_5__rnxq7em"], [{ variant: "primary", color: "warning" }, "button_button_compound_6__rnxq7en"], [{ variant: "secondary", color: "warning" }, "button_button_compound_7__rnxq7eo"], [{ variant: "tertiary", color: "warning" }, "button_button_compound_8__rnxq7ep"], [{ variant: "primary", color: "success" }, "button_button_compound_9__rnxq7eq"], [{ variant: "secondary", color: "success" }, "button_button_compound_10__rnxq7er"], [{ variant: "tertiary", color: "success" }, "button_button_compound_11__rnxq7es"]] });
|
|
25
|
+
var iconWrapper = { withText: "button_iconWrapper_withText__rnxq7et", noText: "button_iconWrapper_noText__rnxq7eu" };
|
|
26
|
+
var loaderWrapper = { withText: "button_loaderWrapper_withText__rnxq7ev", noText: "button_loaderWrapper_noText__rnxq7ew" };
|
|
27
|
+
var text = "button_text__rnxq7ex";
|
|
28
|
+
|
|
29
|
+
// src/components/button/button.component.tsx
|
|
30
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var Button = ({
|
|
32
|
+
text: text2,
|
|
33
|
+
variant = "primary",
|
|
34
|
+
color = "brand",
|
|
35
|
+
size = "md",
|
|
36
|
+
pill = false,
|
|
37
|
+
iconBefore,
|
|
38
|
+
iconAfter,
|
|
39
|
+
isLoading = false,
|
|
40
|
+
disabled = false,
|
|
41
|
+
onClick,
|
|
42
|
+
htmlType,
|
|
43
|
+
style,
|
|
44
|
+
className
|
|
45
|
+
}) => {
|
|
46
|
+
const [preventDoubleClick, setPreventDoubleClick] = useState(false);
|
|
47
|
+
const isDisabled = disabled || isLoading || preventDoubleClick;
|
|
48
|
+
const handleClick = (event) => {
|
|
49
|
+
if (isDisabled) return;
|
|
50
|
+
setPreventDoubleClick(true);
|
|
51
|
+
onClick?.(event);
|
|
52
|
+
};
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (preventDoubleClick) {
|
|
55
|
+
const timer = setTimeout(() => setPreventDoubleClick(false), 400);
|
|
56
|
+
return () => clearTimeout(timer);
|
|
57
|
+
}
|
|
58
|
+
}, [preventDoubleClick]);
|
|
59
|
+
const classNames = [
|
|
60
|
+
button({ variant, color, size, pill, disabled: isDisabled }),
|
|
61
|
+
className
|
|
62
|
+
].filter(Boolean).join(" ");
|
|
63
|
+
const textExists = Boolean(text2);
|
|
64
|
+
return /* @__PURE__ */ jsxs(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
type: htmlType,
|
|
68
|
+
className: classNames,
|
|
69
|
+
onClick: handleClick,
|
|
70
|
+
disabled: isDisabled,
|
|
71
|
+
"aria-busy": isLoading,
|
|
72
|
+
style,
|
|
73
|
+
children: [
|
|
74
|
+
iconBefore && !isLoading && /* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
className: textExists ? iconWrapper.withText : iconWrapper.noText,
|
|
78
|
+
children: iconBefore
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
text2 && /* @__PURE__ */ jsx("span", { className: text, children: text2 }),
|
|
82
|
+
isLoading && /* @__PURE__ */ jsx(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
className: textExists ? loaderWrapper.withText : loaderWrapper.noText,
|
|
86
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
iconAfter && !isLoading && /* @__PURE__ */ jsx(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: textExists ? loaderWrapper.withText : loaderWrapper.noText,
|
|
93
|
+
children: iconAfter
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
function Spinner() {
|
|
101
|
+
return /* @__PURE__ */ jsxs(
|
|
102
|
+
"svg",
|
|
103
|
+
{
|
|
104
|
+
width: "16",
|
|
105
|
+
height: "16",
|
|
106
|
+
viewBox: "0 0 16 16",
|
|
107
|
+
fill: "none",
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
style: { animation: "spin 0.65s linear infinite" },
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` }),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"circle",
|
|
114
|
+
{
|
|
115
|
+
cx: "8",
|
|
116
|
+
cy: "8",
|
|
117
|
+
r: "6",
|
|
118
|
+
stroke: "currentColor",
|
|
119
|
+
strokeWidth: "2",
|
|
120
|
+
strokeOpacity: "0.25"
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsx(
|
|
124
|
+
"path",
|
|
125
|
+
{
|
|
126
|
+
d: "M14 8a6 6 0 0 0-6-6",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
strokeWidth: "2",
|
|
129
|
+
strokeLinecap: "round"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// src/components/input/input.component.tsx
|
|
138
|
+
import { useState as useState2, useId } from "react";
|
|
139
|
+
|
|
140
|
+
// src/components/input/input.css.ts
|
|
141
|
+
import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
142
|
+
var container = _7a4682({ defaultClassName: "input_container__9wx5ob4", variantClassNames: { state: { "default": "input_container_state_default__9wx5ob5", error: "input_container_state_error__9wx5ob6" }, multiline: { true: "input_container_multiline_true__9wx5ob7", false: "input_container_multiline_false__9wx5ob8" } }, defaultVariants: { state: "default", multiline: false }, compoundVariants: [] });
|
|
143
|
+
var counter = "input_counter__9wx5obf";
|
|
144
|
+
var eyeButton = "input_eyeButton__9wx5obh";
|
|
145
|
+
var footer = "input_footer__9wx5obc";
|
|
146
|
+
var forgotLink = "input_forgotLink__9wx5obg";
|
|
147
|
+
var helperText = { "default": "input_helperText_default__9wx5obd", error: "input_helperText_error__9wx5obe" };
|
|
148
|
+
var iconWrapper2 = "input_iconWrapper__9wx5obb";
|
|
149
|
+
var input = "input_input__9wx5ob9";
|
|
150
|
+
var label = { "default": "input_label_default__9wx5ob1", active: "input_label_active__9wx5ob2", error: "input_label_error__9wx5ob3" };
|
|
151
|
+
var textarea = "input_textarea__9wx5oba";
|
|
152
|
+
var wrapper = "input_wrapper__9wx5ob0";
|
|
153
|
+
|
|
154
|
+
// src/components/input/input.component.tsx
|
|
155
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
156
|
+
function EyeIcon({ open }) {
|
|
157
|
+
return open ? /* @__PURE__ */ jsxs2("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
158
|
+
/* @__PURE__ */ jsx2("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
159
|
+
/* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "3" })
|
|
160
|
+
] }) : /* @__PURE__ */ jsxs2("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
161
|
+
/* @__PURE__ */ jsx2("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
162
|
+
/* @__PURE__ */ jsx2("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
163
|
+
] });
|
|
164
|
+
}
|
|
165
|
+
var Input = ({
|
|
166
|
+
label: label3,
|
|
167
|
+
placeholder = "Texto",
|
|
168
|
+
icon,
|
|
169
|
+
type = "text",
|
|
170
|
+
error,
|
|
171
|
+
helperText: helperText2,
|
|
172
|
+
maxLength,
|
|
173
|
+
multiline = false,
|
|
174
|
+
rows = 4,
|
|
175
|
+
forgotPasswordLabel,
|
|
176
|
+
onForgotPassword,
|
|
177
|
+
value,
|
|
178
|
+
onChange,
|
|
179
|
+
disabled = false,
|
|
180
|
+
id: externalId,
|
|
181
|
+
className
|
|
182
|
+
}) => {
|
|
183
|
+
const [showPassword, setShowPassword] = useState2(false);
|
|
184
|
+
const [focused, setFocused] = useState2(false);
|
|
185
|
+
const [internalValue, setInternalValue] = useState2("");
|
|
186
|
+
const generatedId = useId();
|
|
187
|
+
const id = externalId ?? generatedId;
|
|
188
|
+
const isControlled = value !== void 0;
|
|
189
|
+
const currentValue = isControlled ? value : internalValue;
|
|
190
|
+
const hasError = Boolean(error);
|
|
191
|
+
const state = hasError ? "error" : "default";
|
|
192
|
+
const labelState = hasError ? "error" : focused ? "active" : "default";
|
|
193
|
+
const handleChange = (e) => {
|
|
194
|
+
const val = e.target.value;
|
|
195
|
+
if (!isControlled) setInternalValue(val);
|
|
196
|
+
onChange?.(val);
|
|
197
|
+
};
|
|
198
|
+
const containerClass = [
|
|
199
|
+
container({ state, multiline }),
|
|
200
|
+
className
|
|
201
|
+
].filter(Boolean).join(" ");
|
|
202
|
+
const showFooter = forgotPasswordLabel || maxLength !== void 0 || helperText2 || error;
|
|
203
|
+
const resolvedType = type === "password" ? showPassword ? "text" : "password" : type;
|
|
204
|
+
return /* @__PURE__ */ jsxs2("div", { className: wrapper, children: [
|
|
205
|
+
label3 && /* @__PURE__ */ jsx2("label", { htmlFor: id, className: label[labelState], children: label3 }),
|
|
206
|
+
/* @__PURE__ */ jsxs2("div", { className: containerClass, children: [
|
|
207
|
+
multiline ? /* @__PURE__ */ jsx2(
|
|
208
|
+
"textarea",
|
|
209
|
+
{
|
|
210
|
+
id,
|
|
211
|
+
className: textarea,
|
|
212
|
+
placeholder,
|
|
213
|
+
rows,
|
|
214
|
+
maxLength,
|
|
215
|
+
value: currentValue,
|
|
216
|
+
onChange: handleChange,
|
|
217
|
+
onFocus: () => setFocused(true),
|
|
218
|
+
onBlur: () => setFocused(false),
|
|
219
|
+
disabled,
|
|
220
|
+
"aria-invalid": hasError,
|
|
221
|
+
"aria-describedby": hasError ? `${id}-error` : void 0
|
|
222
|
+
}
|
|
223
|
+
) : /* @__PURE__ */ jsx2(
|
|
224
|
+
"input",
|
|
225
|
+
{
|
|
226
|
+
id,
|
|
227
|
+
className: input,
|
|
228
|
+
type: resolvedType,
|
|
229
|
+
placeholder,
|
|
230
|
+
maxLength,
|
|
231
|
+
value: currentValue,
|
|
232
|
+
onChange: handleChange,
|
|
233
|
+
onFocus: () => setFocused(true),
|
|
234
|
+
onBlur: () => setFocused(false),
|
|
235
|
+
disabled,
|
|
236
|
+
"aria-invalid": hasError,
|
|
237
|
+
"aria-describedby": hasError ? `${id}-error` : void 0
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
icon && !multiline && type !== "password" && /* @__PURE__ */ jsx2("span", { className: iconWrapper2, "aria-hidden": "true", children: icon }),
|
|
241
|
+
type === "password" && /* @__PURE__ */ jsx2(
|
|
242
|
+
"button",
|
|
243
|
+
{
|
|
244
|
+
type: "button",
|
|
245
|
+
className: eyeButton,
|
|
246
|
+
onClick: () => setShowPassword((v) => !v),
|
|
247
|
+
"aria-label": showPassword ? "Ocultar senha" : "Mostrar senha",
|
|
248
|
+
children: /* @__PURE__ */ jsx2(EyeIcon, { open: showPassword })
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
] }),
|
|
252
|
+
showFooter && /* @__PURE__ */ jsxs2("div", { className: footer, children: [
|
|
253
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
254
|
+
error && /* @__PURE__ */ jsx2("span", { id: `${id}-error`, className: helperText.error, children: error }),
|
|
255
|
+
!error && helperText2 && /* @__PURE__ */ jsx2("span", { className: helperText.default, children: helperText2 }),
|
|
256
|
+
!error && !helperText2 && forgotPasswordLabel && /* @__PURE__ */ jsx2(
|
|
257
|
+
"button",
|
|
258
|
+
{
|
|
259
|
+
type: "button",
|
|
260
|
+
className: forgotLink,
|
|
261
|
+
onClick: onForgotPassword,
|
|
262
|
+
children: forgotPasswordLabel
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
] }),
|
|
266
|
+
maxLength !== void 0 && /* @__PURE__ */ jsxs2("span", { className: counter, children: [
|
|
267
|
+
currentValue.length,
|
|
268
|
+
"/",
|
|
269
|
+
maxLength
|
|
270
|
+
] })
|
|
271
|
+
] }),
|
|
272
|
+
error && forgotPasswordLabel && /* @__PURE__ */ jsx2(
|
|
273
|
+
"button",
|
|
274
|
+
{
|
|
275
|
+
type: "button",
|
|
276
|
+
className: forgotLink,
|
|
277
|
+
onClick: onForgotPassword,
|
|
278
|
+
children: forgotPasswordLabel
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
] });
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// src/components/card/card.css.ts
|
|
285
|
+
var body = "card_body__odd29h1";
|
|
286
|
+
var card = "card_card__odd29h0";
|
|
287
|
+
var cardInline = "card_cardInline__odd29hc";
|
|
288
|
+
var description = "card_description__odd29hb";
|
|
289
|
+
var iconWrapper3 = { plain: "card_iconWrapper_plain__odd29h2", background: "card_iconWrapper_background__odd29h3" };
|
|
290
|
+
var inlineLabelGroup = "card_inlineLabelGroup__odd29he";
|
|
291
|
+
var inlineLeft = "card_inlineLeft__odd29hd";
|
|
292
|
+
var label2 = "card_label__odd29h4";
|
|
293
|
+
var sublabel = "card_sublabel__odd29hf";
|
|
294
|
+
var valueColor = { "default": "card_valueColor_default__odd29h6", brand: "card_valueColor_brand__odd29h7", success: "card_valueColor_success__odd29h8", error: "card_valueColor_error__odd29h9", warning: "card_valueColor_warning__odd29ha" };
|
|
295
|
+
var valueInline = "card_valueInline__odd29hg";
|
|
296
|
+
var valueStacked = "card_valueStacked__odd29h5";
|
|
297
|
+
|
|
298
|
+
// src/components/card/card.component.tsx
|
|
299
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
300
|
+
var Card = ({
|
|
301
|
+
label: label3,
|
|
302
|
+
value,
|
|
303
|
+
icon,
|
|
304
|
+
iconBackground = false,
|
|
305
|
+
sublabel: sublabel2,
|
|
306
|
+
description: description2,
|
|
307
|
+
valueColor: valueColor2 = "default",
|
|
308
|
+
className
|
|
309
|
+
}) => {
|
|
310
|
+
if (sublabel2) {
|
|
311
|
+
return /* @__PURE__ */ jsxs3("div", { className: [cardInline, className].filter(Boolean).join(" "), children: [
|
|
312
|
+
/* @__PURE__ */ jsxs3("div", { className: inlineLeft, children: [
|
|
313
|
+
icon && /* @__PURE__ */ jsx3("span", { className: iconWrapper3[iconBackground ? "background" : "plain"], children: icon }),
|
|
314
|
+
/* @__PURE__ */ jsxs3("div", { className: inlineLabelGroup, children: [
|
|
315
|
+
/* @__PURE__ */ jsx3("span", { className: label2, children: label3 }),
|
|
316
|
+
/* @__PURE__ */ jsx3("span", { className: sublabel, children: sublabel2 })
|
|
317
|
+
] })
|
|
318
|
+
] }),
|
|
319
|
+
/* @__PURE__ */ jsx3("span", { className: `${valueInline} ${valueColor[valueColor2]}`, children: value })
|
|
320
|
+
] });
|
|
321
|
+
}
|
|
322
|
+
return /* @__PURE__ */ jsxs3("div", { className: [card, className].filter(Boolean).join(" "), children: [
|
|
323
|
+
icon && /* @__PURE__ */ jsx3("span", { className: iconWrapper3[iconBackground ? "background" : "plain"], children: icon }),
|
|
324
|
+
/* @__PURE__ */ jsxs3("div", { className: body, children: [
|
|
325
|
+
/* @__PURE__ */ jsx3("span", { className: label2, children: label3 }),
|
|
326
|
+
/* @__PURE__ */ jsx3("span", { className: `${valueStacked} ${valueColor[valueColor2]}`, children: value }),
|
|
327
|
+
description2 && /* @__PURE__ */ jsx3("span", { className: description, children: description2 })
|
|
328
|
+
] })
|
|
329
|
+
] });
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// src/components/tag/tag.css.ts
|
|
333
|
+
import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
334
|
+
var removeButton = "tag_removeButton__ffqj0pl";
|
|
335
|
+
var tag = _7a4683({ defaultClassName: "tag_tag__ffqj0p0", variantClassNames: { size: { lg: "tag_tag_size_lg__ffqj0p1", md: "tag_tag_size_md__ffqj0p2", sm: "tag_tag_size_sm__ffqj0p3" }, variant: { filled: "tag_tag_variant_filled__ffqj0p4", outlined: "tag_tag_variant_outlined__ffqj0p5" }, color: { brand: "tag_tag_color_brand__ffqj0p6", warning: "tag_tag_color_warning__ffqj0p7", error: "tag_tag_color_error__ffqj0p8", success: "tag_tag_color_success__ffqj0p9", neutral: "tag_tag_color_neutral__ffqj0pa" } }, defaultVariants: { variant: "filled", color: "brand", size: "md" }, compoundVariants: [[{ variant: "filled", color: "brand" }, "tag_tag_compound_0__ffqj0pb"], [{ variant: "outlined", color: "brand" }, "tag_tag_compound_1__ffqj0pc"], [{ variant: "filled", color: "warning" }, "tag_tag_compound_2__ffqj0pd"], [{ variant: "outlined", color: "warning" }, "tag_tag_compound_3__ffqj0pe"], [{ variant: "filled", color: "error" }, "tag_tag_compound_4__ffqj0pf"], [{ variant: "outlined", color: "error" }, "tag_tag_compound_5__ffqj0pg"], [{ variant: "filled", color: "success" }, "tag_tag_compound_6__ffqj0ph"], [{ variant: "outlined", color: "success" }, "tag_tag_compound_7__ffqj0pi"], [{ variant: "filled", color: "neutral" }, "tag_tag_compound_8__ffqj0pj"], [{ variant: "outlined", color: "neutral" }, "tag_tag_compound_9__ffqj0pk"]] });
|
|
336
|
+
|
|
337
|
+
// src/components/tag/tag.component.tsx
|
|
338
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
339
|
+
var XIcon = ({ size }) => {
|
|
340
|
+
const px = size === "lg" ? 14 : size === "md" ? 12 : 10;
|
|
341
|
+
return /* @__PURE__ */ jsxs4("svg", { width: px, height: px, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
342
|
+
/* @__PURE__ */ jsx4("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
343
|
+
/* @__PURE__ */ jsx4("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
344
|
+
] });
|
|
345
|
+
};
|
|
346
|
+
var Tag = ({
|
|
347
|
+
label: label3,
|
|
348
|
+
color = "brand",
|
|
349
|
+
variant = "filled",
|
|
350
|
+
size = "md",
|
|
351
|
+
onRemove
|
|
352
|
+
}) => {
|
|
353
|
+
return /* @__PURE__ */ jsxs4("span", { className: tag({ color, variant, size }), children: [
|
|
354
|
+
label3,
|
|
355
|
+
onRemove && /* @__PURE__ */ jsx4(
|
|
356
|
+
"button",
|
|
357
|
+
{
|
|
358
|
+
type: "button",
|
|
359
|
+
className: removeButton,
|
|
360
|
+
onClick: onRemove,
|
|
361
|
+
"aria-label": `Remover ${label3}`,
|
|
362
|
+
children: /* @__PURE__ */ jsx4(XIcon, { size })
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
] });
|
|
366
|
+
};
|
|
367
|
+
export {
|
|
368
|
+
Button,
|
|
369
|
+
Card,
|
|
370
|
+
Input,
|
|
371
|
+
Tag,
|
|
372
|
+
colors,
|
|
373
|
+
radii,
|
|
374
|
+
shadows,
|
|
375
|
+
spacing,
|
|
376
|
+
typography
|
|
377
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "villela-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Design system e biblioteca de componentes Villela",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./dist/index.css": "./dist/index.css"
|
|
15
|
+
},
|
|
16
|
+
"files": ["dist"],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"dev": "storybook dev -p 6006",
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"build:storybook": "storybook build",
|
|
21
|
+
"typecheck": "tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "^18.0.0",
|
|
25
|
+
"react-dom": "^18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@storybook/addon-essentials": "^8.0.0",
|
|
29
|
+
"@storybook/react": "^8.0.0",
|
|
30
|
+
"@storybook/react-vite": "^8.0.0",
|
|
31
|
+
"@types/react": "^18.0.0",
|
|
32
|
+
"@types/react-dom": "^18.0.0",
|
|
33
|
+
"@vanilla-extract/esbuild-plugin": "^2.3.22",
|
|
34
|
+
"@vanilla-extract/vite-plugin": "^4.0.0",
|
|
35
|
+
"storybook": "^8.0.0",
|
|
36
|
+
"tsup": "^8.5.1",
|
|
37
|
+
"typescript": "^5.0.0",
|
|
38
|
+
"vite": "^5.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@vanilla-extract/css": "^1.15.0",
|
|
42
|
+
"@vanilla-extract/recipes": "^0.5.0"
|
|
43
|
+
}
|
|
44
|
+
}
|