@12min/ds 1.0.0 → 3.0.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/Checkbox.styles-DPyXzxFJ.d.mts +90 -0
- package/dist/Checkbox.styles-DPyXzxFJ.d.ts +90 -0
- package/dist/chunk-ZK7NW4WW.mjs +247 -0
- package/dist/chunk-ZK7NW4WW.mjs.map +1 -0
- package/dist/chunk-ZKPOS2PD.mjs +192 -0
- package/dist/chunk-ZKPOS2PD.mjs.map +1 -0
- package/dist/index.native.d.mts +92 -26
- package/dist/index.native.d.ts +92 -26
- package/dist/index.native.js +856 -386
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +509 -295
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +93 -22
- package/dist/index.web.d.ts +93 -22
- package/dist/index.web.js +799 -273
- package/dist/index.web.js.map +1 -1
- package/dist/index.web.mjs +454 -188
- package/dist/index.web.mjs.map +1 -1
- package/dist/tailwind/theme.css +206 -66
- package/dist/tokens/index.d.mts +283 -60
- package/dist/tokens/index.d.ts +283 -60
- package/dist/tokens/index.js +192 -40
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +13 -1
- package/package.json +2 -1
- package/dist/chunk-CC3QVZS2.mjs +0 -80
- package/dist/chunk-CC3QVZS2.mjs.map +0 -1
- package/dist/chunk-NK4IHR7O.mjs +0 -101
- package/dist/chunk-NK4IHR7O.mjs.map +0 -1
- package/dist/darkTheme-gaad4-zD.d.mts +0 -28
- package/dist/darkTheme-gaad4-zD.d.ts +0 -28
package/dist/index.web.mjs
CHANGED
|
@@ -2,11 +2,17 @@ import {
|
|
|
2
2
|
DEFAULT_OPTIONS,
|
|
3
3
|
darkTheme,
|
|
4
4
|
lightTheme
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZKPOS2PD.mjs";
|
|
6
6
|
import {
|
|
7
|
+
borderWidth,
|
|
7
8
|
colors,
|
|
9
|
+
grid,
|
|
10
|
+
opacity,
|
|
11
|
+
radius,
|
|
12
|
+
shadow,
|
|
13
|
+
spacing,
|
|
8
14
|
typography
|
|
9
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZK7NW4WW.mjs";
|
|
10
16
|
|
|
11
17
|
// src/components/Button/Button.web.tsx
|
|
12
18
|
import { cva } from "class-variance-authority";
|
|
@@ -21,23 +27,23 @@ function cn(...inputs) {
|
|
|
21
27
|
// src/components/Button/Button.web.tsx
|
|
22
28
|
import { jsx } from "react/jsx-runtime";
|
|
23
29
|
var button = cva(
|
|
24
|
-
"inline-flex items-center justify-center
|
|
30
|
+
"inline-flex items-center justify-center gap-2 rounded-full transition-colors disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:focus-visible:ring-white",
|
|
25
31
|
{
|
|
26
32
|
variants: {
|
|
27
33
|
variant: {
|
|
28
|
-
primary: "bg-marian-blue-
|
|
29
|
-
secondary: "bg-marian-blue-200 text-marian-blue-900 disabled:
|
|
30
|
-
ghost: "bg-transparent text-marian-blue-
|
|
34
|
+
primary: "bg-marian-blue-600 text-white dark:text-midnight-900 enabled:hover:bg-marian-blue-700 dark:enabled:hover:bg-marian-blue-500 enabled:active:bg-marian-blue-800 dark:enabled:active:bg-marian-blue-600 disabled:bg-gray-25 disabled:text-gray-400 dark:disabled:bg-midnight-700 dark:disabled:text-gray-600",
|
|
35
|
+
secondary: "bg-marian-blue-200 text-marian-blue-900 dark:bg-marian-blue-900 dark:text-white enabled:hover:bg-marian-blue-300 dark:enabled:hover:bg-marian-blue-800 enabled:active:bg-marian-blue-400 dark:enabled:active:bg-marian-blue-700 disabled:bg-gray-25 disabled:text-gray-400 dark:disabled:bg-midnight-700 dark:disabled:text-gray-600",
|
|
36
|
+
ghost: "bg-transparent text-marian-blue-600 dark:text-marian-blue-300 enabled:hover:bg-marian-blue-200 dark:enabled:hover:bg-marian-blue-900 enabled:active:bg-marian-blue-300 dark:enabled:active:bg-marian-blue-800 disabled:text-gray-400 dark:disabled:text-gray-600"
|
|
31
37
|
},
|
|
32
38
|
size: {
|
|
33
|
-
sm: "h-
|
|
34
|
-
md: "h-
|
|
35
|
-
lg: "h-
|
|
39
|
+
sm: "h-8 px-3 text-button-small",
|
|
40
|
+
md: "h-10 px-4 text-button-default",
|
|
41
|
+
lg: "h-12 px-6 text-button-large"
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
44
|
defaultVariants: {
|
|
39
45
|
variant: "primary",
|
|
40
|
-
size: "
|
|
46
|
+
size: "lg"
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
);
|
|
@@ -54,54 +60,192 @@ function Button({ variant, size, disabled, children, onClick, type = "button", c
|
|
|
54
60
|
);
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
// src/components/
|
|
63
|
+
// src/components/ButtonIcon/ButtonIcon.web.tsx
|
|
64
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
58
65
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
59
|
-
|
|
66
|
+
var buttonIcon = cva2(
|
|
67
|
+
"inline-flex items-center justify-center shrink-0 rounded-full transition-colors disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:focus-visible:ring-white",
|
|
68
|
+
{
|
|
69
|
+
variants: {
|
|
70
|
+
variant: {
|
|
71
|
+
primary: "bg-marian-blue-600 text-white dark:text-midnight-900 enabled:hover:bg-marian-blue-700 dark:enabled:hover:bg-marian-blue-500 enabled:active:bg-marian-blue-800 dark:enabled:active:bg-marian-blue-600 disabled:bg-gray-25 disabled:text-gray-400 dark:disabled:bg-midnight-700 dark:disabled:text-gray-600",
|
|
72
|
+
secondary: "bg-marian-blue-200 text-marian-blue-900 dark:bg-marian-blue-900 dark:text-white enabled:hover:bg-marian-blue-300 dark:enabled:hover:bg-marian-blue-800 enabled:active:bg-marian-blue-400 dark:enabled:active:bg-marian-blue-700 disabled:bg-gray-25 disabled:text-gray-400 dark:disabled:bg-midnight-700 dark:disabled:text-gray-600",
|
|
73
|
+
ghost: "bg-transparent text-marian-blue-600 dark:text-marian-blue-300 enabled:hover:bg-marian-blue-200 dark:enabled:hover:bg-marian-blue-900 enabled:active:bg-marian-blue-300 dark:enabled:active:bg-marian-blue-800 disabled:text-gray-400 dark:disabled:text-gray-600",
|
|
74
|
+
overlay: "bg-overlay-black-8 text-marian-blue-900 dark:bg-overlay-white-8 dark:text-white enabled:hover:bg-overlay-black-12 dark:enabled:hover:bg-overlay-white-12 enabled:active:bg-overlay-black-16 dark:enabled:active:bg-overlay-white-16 disabled:bg-gray-25 disabled:text-gray-400 dark:disabled:bg-midnight-700 dark:disabled:text-gray-600"
|
|
75
|
+
},
|
|
76
|
+
size: {
|
|
77
|
+
sm: "size-10",
|
|
78
|
+
md: "size-12",
|
|
79
|
+
lg: "size-16"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
defaultVariants: {
|
|
83
|
+
variant: "primary",
|
|
84
|
+
size: "md"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
function ButtonIcon({ variant, size, icon, label, disabled, onClick, type = "button", className }) {
|
|
60
89
|
return /* @__PURE__ */ jsx2(
|
|
90
|
+
"button",
|
|
91
|
+
{
|
|
92
|
+
type,
|
|
93
|
+
disabled,
|
|
94
|
+
onClick,
|
|
95
|
+
"aria-label": label,
|
|
96
|
+
className: cn(buttonIcon({ variant, size }), className),
|
|
97
|
+
children: icon
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/components/DismissButton/DismissButton.web.tsx
|
|
103
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
104
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
105
|
+
var dismissButton = cva3(
|
|
106
|
+
"inline-flex items-center justify-center shrink-0 rounded-full transition-colors disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:focus-visible:ring-white",
|
|
107
|
+
{
|
|
108
|
+
variants: {
|
|
109
|
+
variant: {
|
|
110
|
+
subtle: "bg-overlay-black-8 text-marian-blue-900 dark:bg-overlay-white-8 dark:text-white enabled:hover:bg-overlay-black-12 dark:enabled:hover:bg-overlay-white-12 enabled:active:bg-overlay-black-16 dark:enabled:active:bg-overlay-white-16 disabled:bg-gray-25 disabled:text-gray-400 dark:disabled:bg-midnight-700 dark:disabled:text-gray-600",
|
|
111
|
+
ghost: "bg-transparent text-marian-blue-900 dark:text-white enabled:hover:bg-marian-blue-200 dark:enabled:hover:bg-marian-blue-900 enabled:active:bg-marian-blue-300 dark:enabled:active:bg-marian-blue-800 disabled:text-gray-400 dark:disabled:text-gray-600"
|
|
112
|
+
},
|
|
113
|
+
size: {
|
|
114
|
+
xs: "size-5",
|
|
115
|
+
sm: "size-8",
|
|
116
|
+
md: "size-10"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
defaultVariants: {
|
|
120
|
+
variant: "subtle",
|
|
121
|
+
size: "sm"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
var glyphSize = {
|
|
126
|
+
xs: 12,
|
|
127
|
+
sm: 16,
|
|
128
|
+
md: 20
|
|
129
|
+
};
|
|
130
|
+
function DismissButton({ variant, size = "sm", label = "Fechar", disabled, onClick, className }) {
|
|
131
|
+
const s = glyphSize[size ?? "sm"];
|
|
132
|
+
return /* @__PURE__ */ jsx3(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
type: "button",
|
|
136
|
+
disabled,
|
|
137
|
+
onClick,
|
|
138
|
+
"aria-label": label,
|
|
139
|
+
className: cn(dismissButton({ variant, size }), className),
|
|
140
|
+
children: /* @__PURE__ */ jsx3("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx3("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// src/components/Chip/Chip.web.tsx
|
|
146
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
147
|
+
var sizeCls = {
|
|
148
|
+
sm: "h-8 px-3 text-xs leading-4 tracking-[0.5px]",
|
|
149
|
+
md: "h-11 px-4 text-sm leading-5"
|
|
150
|
+
};
|
|
151
|
+
function Chip({ children, checked = false, disabled = false, size = "md", leading, trailing, onClick, className }) {
|
|
152
|
+
return /* @__PURE__ */ jsxs(
|
|
61
153
|
"button",
|
|
62
154
|
{
|
|
63
155
|
type: "button",
|
|
156
|
+
role: "button",
|
|
157
|
+
"aria-pressed": checked,
|
|
158
|
+
disabled,
|
|
64
159
|
onClick,
|
|
65
160
|
className: cn(
|
|
66
|
-
"inline-flex items-center justify-center
|
|
67
|
-
|
|
161
|
+
"inline-flex items-center justify-center gap-2 rounded-full border border-solid transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marian-blue-900 dark:focus-visible:ring-white",
|
|
162
|
+
sizeCls[size],
|
|
163
|
+
checked ? "font-semibold" : "font-medium",
|
|
164
|
+
disabled ? "cursor-not-allowed border-gray-50 bg-gray-25 text-gray-400 dark:border-midnight-700 dark:bg-midnight-700 dark:text-gray-600" : checked ? "cursor-pointer border-marian-blue-700 bg-marian-blue-700 text-white enabled:hover:bg-marian-blue-800 enabled:active:bg-marian-blue-900 dark:border-marian-blue-800 dark:bg-marian-blue-800 dark:enabled:hover:bg-marian-blue-900" : "cursor-pointer border-marian-blue-200 bg-transparent text-marian-blue-900 enabled:hover:bg-marian-blue-700/[0.08] enabled:active:bg-marian-blue-700/[0.12] dark:border-midnight-50 dark:text-white dark:enabled:hover:bg-marian-blue-800/[0.08] dark:enabled:active:bg-marian-blue-800/[0.12]",
|
|
68
165
|
className
|
|
69
166
|
),
|
|
70
|
-
children
|
|
167
|
+
children: [
|
|
168
|
+
leading && /* @__PURE__ */ jsx4("span", { className: "shrink-0", children: leading }),
|
|
169
|
+
children,
|
|
170
|
+
trailing && /* @__PURE__ */ jsx4("span", { className: "shrink-0", children: trailing })
|
|
171
|
+
]
|
|
71
172
|
}
|
|
72
173
|
);
|
|
73
174
|
}
|
|
74
175
|
|
|
75
176
|
// src/components/Alert/Alert.web.tsx
|
|
76
|
-
import { jsx as
|
|
77
|
-
|
|
78
|
-
|
|
177
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
178
|
+
var variantStyles = {
|
|
179
|
+
success: { bg: "bg-green-100 dark:bg-green-800", icon: "text-green-text" },
|
|
180
|
+
info: { bg: "bg-blue-100 dark:bg-blue-700", icon: "text-blue-600 dark:text-blue-100" },
|
|
181
|
+
warning: { bg: "bg-amber-100 dark:bg-amber-800", icon: "text-amber-600 dark:text-amber-100" },
|
|
182
|
+
error: { bg: "bg-ketchup-100 dark:bg-ketchup-800", icon: "text-ketchup-600 dark:text-ketchup-text" }
|
|
183
|
+
};
|
|
184
|
+
function AlertIcon({ variant }) {
|
|
185
|
+
const common = { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true };
|
|
186
|
+
switch (variant) {
|
|
187
|
+
case "success":
|
|
188
|
+
return /* @__PURE__ */ jsxs2("svg", { ...common, children: [
|
|
189
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "9" }),
|
|
190
|
+
/* @__PURE__ */ jsx5("path", { d: "M8.5 12.5 11 15l4.5-5" })
|
|
191
|
+
] });
|
|
192
|
+
case "error":
|
|
193
|
+
return /* @__PURE__ */ jsxs2("svg", { ...common, children: [
|
|
194
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "9" }),
|
|
195
|
+
/* @__PURE__ */ jsx5("path", { d: "M15 9l-6 6M9 9l6 6" })
|
|
196
|
+
] });
|
|
197
|
+
case "warning":
|
|
198
|
+
return /* @__PURE__ */ jsxs2("svg", { ...common, children: [
|
|
199
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "9" }),
|
|
200
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 7.5v5M12 16h.01" })
|
|
201
|
+
] });
|
|
202
|
+
case "info":
|
|
203
|
+
return /* @__PURE__ */ jsxs2("svg", { ...common, children: [
|
|
204
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "9" }),
|
|
205
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 11v5M12 8h.01" })
|
|
206
|
+
] });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function Alert({ variant = "info", size = "default", layout = "stacked", title, description, onDismiss, className }) {
|
|
210
|
+
const styles = variantStyles[variant];
|
|
211
|
+
const pad = size === "compact" ? "p-3" : "p-5";
|
|
212
|
+
const gap = size === "compact" ? "gap-2" : "gap-3";
|
|
213
|
+
const icon = /* @__PURE__ */ jsx5("span", { className: cn("shrink-0", styles.icon), children: /* @__PURE__ */ jsx5(AlertIcon, { variant }) });
|
|
214
|
+
const body = description && /* @__PURE__ */ jsx5("p", { className: "text-body-default text-gray-700 dark:text-gray-300 w-full", children: description });
|
|
215
|
+
const close = onDismiss && /* @__PURE__ */ jsx5("button", { type: "button", onClick: onDismiss, "aria-label": "Fechar", className: "shrink-0 text-marian-blue-900 dark:text-white", children: /* @__PURE__ */ jsx5("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M18 6 6 18M6 6l12 12" }) }) });
|
|
216
|
+
return /* @__PURE__ */ jsxs2(
|
|
79
217
|
"div",
|
|
80
218
|
{
|
|
219
|
+
role: variant === "error" ? "alert" : "status",
|
|
81
220
|
className: cn(
|
|
82
|
-
"w-full
|
|
83
|
-
|
|
221
|
+
"flex w-full items-start rounded-tl-2xl rounded-tr-2xl rounded-br-2xl border border-solid border-overlay-black-5 dark:border-overlay-white-5",
|
|
222
|
+
pad,
|
|
223
|
+
gap,
|
|
224
|
+
styles.bg,
|
|
84
225
|
className
|
|
85
226
|
),
|
|
86
227
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
228
|
+
layout === "inline" ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
229
|
+
icon,
|
|
230
|
+
body
|
|
231
|
+
] }) : /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
232
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
|
|
233
|
+
icon,
|
|
234
|
+
title && /* @__PURE__ */ jsx5("p", { className: "flex-1 text-h3 text-marian-blue-900 dark:text-white", children: title })
|
|
235
|
+
] }),
|
|
236
|
+
body
|
|
237
|
+
] }),
|
|
238
|
+
close
|
|
95
239
|
]
|
|
96
240
|
}
|
|
97
241
|
);
|
|
98
242
|
}
|
|
99
243
|
|
|
100
244
|
// src/components/ProgressBar/ProgressBar.web.tsx
|
|
101
|
-
import { jsx as
|
|
245
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
102
246
|
function ProgressBar({ value, className }) {
|
|
103
247
|
const pct = Math.min(100, Math.max(0, value));
|
|
104
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ jsx6(
|
|
105
249
|
"div",
|
|
106
250
|
{
|
|
107
251
|
role: "progressbar",
|
|
@@ -109,13 +253,13 @@ function ProgressBar({ value, className }) {
|
|
|
109
253
|
"aria-valuemin": 0,
|
|
110
254
|
"aria-valuemax": 100,
|
|
111
255
|
className: cn(
|
|
112
|
-
"relative h-2 w-full rounded-full bg-
|
|
256
|
+
"relative h-2 w-full rounded-full bg-gray-15 overflow-hidden dark:bg-midnight-800",
|
|
113
257
|
className
|
|
114
258
|
),
|
|
115
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ jsx6(
|
|
116
260
|
"div",
|
|
117
261
|
{
|
|
118
|
-
className: "absolute inset-y-0 left-0 bg-marian-blue-
|
|
262
|
+
className: "absolute inset-y-0 left-0 bg-marian-blue-600 rounded-full transition-[width]",
|
|
119
263
|
style: { width: `${pct}%` }
|
|
120
264
|
}
|
|
121
265
|
)
|
|
@@ -124,22 +268,22 @@ function ProgressBar({ value, className }) {
|
|
|
124
268
|
}
|
|
125
269
|
|
|
126
270
|
// src/components/Input/Input.web.tsx
|
|
127
|
-
import { jsx as
|
|
128
|
-
function Input({ value, placeholder = "exemplo@email.com", state = "default", leadingIcon, onChange, className }) {
|
|
271
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
272
|
+
function Input({ value, placeholder = "exemplo@email.com", state = "default", leadingIcon, trailingIcon, onChange, className }) {
|
|
129
273
|
const isDisabled = state === "disabled";
|
|
130
274
|
const isError = state === "error";
|
|
131
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ jsxs3(
|
|
132
276
|
"div",
|
|
133
277
|
{
|
|
134
278
|
className: cn(
|
|
135
|
-
"flex items-center gap-2 h-12 px-3 rounded-
|
|
136
|
-
"focus-within:
|
|
137
|
-
isDisabled ? "bg-
|
|
279
|
+
"flex items-center gap-2 h-12 px-3 rounded-input border border-solid text-body-default transition-colors",
|
|
280
|
+
"focus-within:ring-2 focus-within:ring-black dark:focus-within:ring-white",
|
|
281
|
+
isDisabled ? "bg-gray-25 border-gray-50 text-gray-400 cursor-not-allowed dark:bg-midnight-700 dark:border-midnight-700 dark:text-gray-600" : isError ? "bg-white border-ketchup-600 text-ketchup-text dark:bg-midnight-900 dark:border-ketchup-500 dark:text-ketchup-600" : "bg-white border-marian-blue-200 text-marian-blue-900 dark:bg-midnight-900 dark:border-midnight-50 dark:text-white",
|
|
138
282
|
className
|
|
139
283
|
),
|
|
140
284
|
children: [
|
|
141
|
-
leadingIcon && /* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
285
|
+
leadingIcon && /* @__PURE__ */ jsx7("span", { className: "shrink-0 text-current", children: leadingIcon }),
|
|
286
|
+
/* @__PURE__ */ jsx7(
|
|
143
287
|
"input",
|
|
144
288
|
{
|
|
145
289
|
type: "text",
|
|
@@ -147,109 +291,152 @@ function Input({ value, placeholder = "exemplo@email.com", state = "default", le
|
|
|
147
291
|
placeholder,
|
|
148
292
|
disabled: isDisabled,
|
|
149
293
|
onChange,
|
|
150
|
-
className: "flex-1 bg-transparent outline-none
|
|
294
|
+
className: "flex-1 bg-transparent outline-none text-current placeholder:text-gray-500 min-w-0"
|
|
151
295
|
}
|
|
152
|
-
)
|
|
296
|
+
),
|
|
297
|
+
trailingIcon && /* @__PURE__ */ jsx7("span", { className: "shrink-0 text-current", children: trailingIcon })
|
|
153
298
|
]
|
|
154
299
|
}
|
|
155
300
|
);
|
|
156
301
|
}
|
|
157
302
|
|
|
303
|
+
// src/components/InputField/InputField.web.tsx
|
|
304
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
305
|
+
function InputField({
|
|
306
|
+
label,
|
|
307
|
+
required,
|
|
308
|
+
helperText,
|
|
309
|
+
error,
|
|
310
|
+
value,
|
|
311
|
+
placeholder,
|
|
312
|
+
disabled,
|
|
313
|
+
leadingIcon,
|
|
314
|
+
trailingIcon,
|
|
315
|
+
onChange,
|
|
316
|
+
className
|
|
317
|
+
}) {
|
|
318
|
+
const state = disabled ? "disabled" : error ? "error" : "default";
|
|
319
|
+
return /* @__PURE__ */ jsxs4("div", { className: cn("flex flex-col gap-2 w-full", className), children: [
|
|
320
|
+
/* @__PURE__ */ jsxs4("label", { className: "flex flex-col gap-2", children: [
|
|
321
|
+
label && /* @__PURE__ */ jsxs4("span", { className: "inline-flex items-center gap-0.5 text-label-default text-marian-blue-900 dark:text-white", children: [
|
|
322
|
+
label,
|
|
323
|
+
required && /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "text-ketchup-text dark:text-ketchup-600", children: "*" })
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ jsx8(
|
|
326
|
+
Input,
|
|
327
|
+
{
|
|
328
|
+
state,
|
|
329
|
+
value,
|
|
330
|
+
placeholder,
|
|
331
|
+
leadingIcon,
|
|
332
|
+
trailingIcon,
|
|
333
|
+
onChange
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] }),
|
|
337
|
+
helperText && /* @__PURE__ */ jsx8("span", { className: cn("text-caption", error ? "text-ketchup-text dark:text-ketchup-600" : "text-gray-700 dark:text-gray-300"), children: helperText })
|
|
338
|
+
] });
|
|
339
|
+
}
|
|
340
|
+
|
|
158
341
|
// src/components/Checkbox/Checkbox.web.tsx
|
|
159
|
-
import { jsx as
|
|
342
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
343
|
+
var boxSize = {
|
|
344
|
+
xs: "size-4",
|
|
345
|
+
sm: "size-5",
|
|
346
|
+
md: "size-6"
|
|
347
|
+
};
|
|
160
348
|
function CheckIcon() {
|
|
161
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ jsx9("svg", { viewBox: "0 0 24 24", fill: "none", className: "w-3/4 h-3/4", "aria-hidden": "true", children: /* @__PURE__ */ jsx9("path", { d: "M5 12.5 10 17.5 19 7", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
162
350
|
}
|
|
163
|
-
function Checkbox({ checked = false, onChange, disabled = false, className }) {
|
|
164
|
-
return /* @__PURE__ */
|
|
351
|
+
function Checkbox({ checked = false, onChange, disabled = false, size = "sm", className }) {
|
|
352
|
+
return /* @__PURE__ */ jsxs5(
|
|
165
353
|
"label",
|
|
166
354
|
{
|
|
167
355
|
className: cn(
|
|
168
|
-
"
|
|
169
|
-
disabled ? "cursor-not-allowed
|
|
170
|
-
checked ? "bg-marian-blue-800 text-white dark:bg-marian-blue-400 dark:text-midnight-900" : "border border-marian-blue-600 bg-transparent dark:border-marian-blue-400",
|
|
356
|
+
"inline-flex items-center justify-center rounded-full p-1 transition-colors",
|
|
357
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer hover:bg-marian-blue-700/[0.08] active:bg-marian-blue-700/[0.12] dark:hover:bg-marian-blue-800/[0.08] dark:active:bg-marian-blue-800/[0.12]",
|
|
171
358
|
className
|
|
172
359
|
),
|
|
173
360
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ jsx9(
|
|
175
362
|
"input",
|
|
176
363
|
{
|
|
177
364
|
type: "checkbox",
|
|
178
365
|
checked,
|
|
179
366
|
disabled,
|
|
180
367
|
onChange: () => onChange?.(!checked),
|
|
181
|
-
className: "sr-only"
|
|
368
|
+
className: "peer sr-only"
|
|
182
369
|
}
|
|
183
370
|
),
|
|
184
|
-
|
|
371
|
+
/* @__PURE__ */ jsx9(
|
|
372
|
+
"span",
|
|
373
|
+
{
|
|
374
|
+
className: cn(
|
|
375
|
+
"flex items-center justify-center rounded-[6px] border-2 transition-colors",
|
|
376
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-marian-blue-900 dark:peer-focus-visible:ring-white",
|
|
377
|
+
boxSize[size],
|
|
378
|
+
checked ? disabled ? "bg-gray-25 border-gray-25 text-gray-400 dark:bg-midnight-700 dark:border-midnight-700 dark:text-gray-600" : "bg-marian-blue-700 border-marian-blue-700 text-white dark:bg-marian-blue-800 dark:border-marian-blue-800" : disabled ? "border-gray-400 dark:border-gray-600" : "border-gray-600 dark:border-gray-400"
|
|
379
|
+
),
|
|
380
|
+
children: checked && /* @__PURE__ */ jsx9(CheckIcon, {})
|
|
381
|
+
}
|
|
382
|
+
)
|
|
185
383
|
]
|
|
186
384
|
}
|
|
187
385
|
);
|
|
188
386
|
}
|
|
189
387
|
|
|
190
|
-
// src/components/
|
|
191
|
-
import { jsx as
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
388
|
+
// src/components/ToggleSwitch/ToggleSwitch.web.tsx
|
|
389
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
390
|
+
var trackSize = {
|
|
391
|
+
xs: "w-8 h-5",
|
|
392
|
+
sm: "w-10 h-6",
|
|
393
|
+
md: "w-[52px] h-8"
|
|
394
|
+
};
|
|
395
|
+
var knobSize = {
|
|
396
|
+
xs: "size-4",
|
|
397
|
+
sm: "size-5",
|
|
398
|
+
md: "size-7"
|
|
399
|
+
};
|
|
400
|
+
var knobOn = {
|
|
401
|
+
xs: "translate-x-3",
|
|
402
|
+
sm: "translate-x-4",
|
|
403
|
+
md: "translate-x-5"
|
|
404
|
+
};
|
|
405
|
+
function ToggleSwitch({ value = false, onChange, disabled = false, size = "sm", label, className }) {
|
|
406
|
+
return /* @__PURE__ */ jsx10(
|
|
206
407
|
"button",
|
|
207
408
|
{
|
|
208
409
|
type: "button",
|
|
209
|
-
role: "
|
|
210
|
-
"aria-checked":
|
|
211
|
-
|
|
410
|
+
role: "switch",
|
|
411
|
+
"aria-checked": value,
|
|
412
|
+
"aria-label": label,
|
|
413
|
+
disabled,
|
|
414
|
+
onClick: () => onChange?.(!value),
|
|
212
415
|
className: cn(
|
|
213
|
-
"flex items-center
|
|
214
|
-
|
|
416
|
+
"inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marian-blue-900 dark:focus-visible:ring-white",
|
|
417
|
+
trackSize[size],
|
|
418
|
+
disabled ? "cursor-not-allowed bg-gray-25 dark:bg-midnight-700" : value ? "cursor-pointer bg-marian-blue-700 dark:bg-marian-blue-800" : "cursor-pointer bg-gray-25 dark:bg-midnight-700",
|
|
215
419
|
className
|
|
216
420
|
),
|
|
217
|
-
children:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
children: label
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
description && /* @__PURE__ */ jsx7(
|
|
232
|
-
"span",
|
|
233
|
-
{
|
|
234
|
-
className: cn(
|
|
235
|
-
"text-xs leading-normal tracking-[0.024px]",
|
|
236
|
-
selected ? "text-current opacity-80" : "text-gray-700 dark:text-gray-500"
|
|
237
|
-
),
|
|
238
|
-
children: description
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
] })
|
|
242
|
-
] }),
|
|
243
|
-
/* @__PURE__ */ jsx7(RadioIndicator, { selected })
|
|
244
|
-
]
|
|
421
|
+
children: /* @__PURE__ */ jsx10(
|
|
422
|
+
"span",
|
|
423
|
+
{
|
|
424
|
+
className: cn(
|
|
425
|
+
"rounded-full transition-transform",
|
|
426
|
+
knobSize[size],
|
|
427
|
+
disabled ? "bg-gray-400 dark:bg-gray-600" : "bg-white dark:bg-midnight-900",
|
|
428
|
+
value ? knobOn[size] : "translate-x-0"
|
|
429
|
+
)
|
|
430
|
+
}
|
|
431
|
+
)
|
|
245
432
|
}
|
|
246
433
|
);
|
|
247
434
|
}
|
|
248
435
|
|
|
249
436
|
// src/components/RadioGroup/RadioGroup.web.tsx
|
|
250
|
-
import { jsx as
|
|
437
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
251
438
|
function RadioGroup({ children, label, className }) {
|
|
252
|
-
return /* @__PURE__ */
|
|
439
|
+
return /* @__PURE__ */ jsx11(
|
|
253
440
|
"div",
|
|
254
441
|
{
|
|
255
442
|
role: "radiogroup",
|
|
@@ -260,128 +447,207 @@ function RadioGroup({ children, label, className }) {
|
|
|
260
447
|
);
|
|
261
448
|
}
|
|
262
449
|
|
|
263
|
-
// src/components/
|
|
264
|
-
import { jsx as
|
|
265
|
-
function
|
|
266
|
-
|
|
450
|
+
// src/components/ChoiceCard/ChoiceCard.web.tsx
|
|
451
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
452
|
+
function containerClass(selected, disabled) {
|
|
453
|
+
if (disabled) {
|
|
454
|
+
return "cursor-not-allowed border border-gray-50 bg-white dark:border-midnight-700 dark:bg-midnight-900";
|
|
455
|
+
}
|
|
456
|
+
if (selected) {
|
|
457
|
+
return "cursor-pointer border-2 border-marian-blue-600 bg-marian-blue-200 enabled:hover:bg-marian-blue-300 enabled:active:bg-marian-blue-400 dark:border-marian-blue-300 dark:bg-marian-blue-900 dark:enabled:hover:bg-marian-blue-800 dark:enabled:active:bg-marian-blue-700";
|
|
458
|
+
}
|
|
459
|
+
return "cursor-pointer border border-marian-blue-200 bg-white enabled:hover:bg-gray-15 enabled:active:bg-gray-35 dark:border-midnight-50 dark:bg-midnight-900 dark:enabled:hover:bg-midnight-800 dark:enabled:active:bg-midnight-600";
|
|
267
460
|
}
|
|
268
|
-
function
|
|
269
|
-
return /* @__PURE__ */
|
|
461
|
+
function CheckGlyph() {
|
|
462
|
+
return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 24 24", fill: "none", className: "w-3/4 h-3/4", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("path", { d: "M5 12.5 10 17.5 19 7", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
463
|
+
}
|
|
464
|
+
function Trailing({ type, selected, disabled }) {
|
|
465
|
+
const off = disabled ? "border-gray-400 dark:border-gray-600" : "border-gray-600 dark:border-gray-400";
|
|
466
|
+
const on = "border-marian-blue-700 dark:border-marian-blue-800";
|
|
467
|
+
if (type === "action") {
|
|
468
|
+
return /* @__PURE__ */ jsx12("span", { className: cn("shrink-0", disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-600 dark:text-gray-400"), children: /* @__PURE__ */ jsx12("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("path", { d: "M9 6l6 6-6 6" }) }) });
|
|
469
|
+
}
|
|
470
|
+
if (type === "checkbox") {
|
|
471
|
+
return /* @__PURE__ */ jsx12("span", { className: cn("flex size-6 shrink-0 items-center justify-center rounded-[6px] border-2", selected ? cn(on, "bg-marian-blue-700 text-white dark:bg-marian-blue-800") : off), children: selected && /* @__PURE__ */ jsx12(CheckGlyph, {}) });
|
|
472
|
+
}
|
|
473
|
+
return /* @__PURE__ */ jsx12("span", { className: cn("flex size-6 shrink-0 items-center justify-center rounded-full border-2", selected ? on : off), children: selected && /* @__PURE__ */ jsx12("span", { className: "size-3 rounded-full bg-marian-blue-700 dark:bg-marian-blue-800" }) });
|
|
474
|
+
}
|
|
475
|
+
function ChoiceCard({ type = "radio", label, description, selected = false, disabled = false, leading, showTrailing = true, onClick, className }) {
|
|
476
|
+
const isSelected = type === "action" ? false : selected;
|
|
477
|
+
const textColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-marian-blue-900 dark:text-white";
|
|
478
|
+
const descColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-700 dark:text-gray-300";
|
|
479
|
+
return /* @__PURE__ */ jsxs6(
|
|
270
480
|
"button",
|
|
271
481
|
{
|
|
272
482
|
type: "button",
|
|
483
|
+
role: type === "radio" ? "radio" : type === "checkbox" ? "checkbox" : "button",
|
|
484
|
+
"aria-checked": type === "action" ? void 0 : isSelected,
|
|
485
|
+
disabled,
|
|
273
486
|
onClick,
|
|
274
487
|
className: cn(
|
|
275
|
-
"flex items-center gap-
|
|
276
|
-
|
|
488
|
+
"flex w-full items-center gap-3 rounded-[20px] p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marian-blue-900 dark:focus-visible:ring-white",
|
|
489
|
+
containerClass(isSelected, disabled),
|
|
277
490
|
className
|
|
278
491
|
),
|
|
279
492
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
284
|
-
description && /* @__PURE__ */ jsx9("span", { className: "text-xs font-normal text-gray-700 dark:text-gray-400 leading-normal tracking-[0.024px]", children: description })
|
|
285
|
-
] })
|
|
493
|
+
leading && /* @__PURE__ */ jsx12("span", { className: "flex size-6 shrink-0 items-center justify-center", children: leading }),
|
|
494
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex flex-1 flex-col gap-1 min-w-0", children: [
|
|
495
|
+
/* @__PURE__ */ jsx12("span", { className: cn("text-sm leading-5", description ? "font-semibold" : "font-medium", textColor), children: label }),
|
|
496
|
+
description && /* @__PURE__ */ jsx12("span", { className: cn("text-sm font-medium leading-5", descColor), children: description })
|
|
286
497
|
] }),
|
|
287
|
-
/* @__PURE__ */
|
|
498
|
+
showTrailing && /* @__PURE__ */ jsx12(Trailing, { type, selected: isSelected, disabled })
|
|
288
499
|
]
|
|
289
500
|
}
|
|
290
501
|
);
|
|
291
502
|
}
|
|
292
503
|
|
|
293
|
-
// src/components/
|
|
294
|
-
import { jsx as
|
|
295
|
-
function
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
|
|
504
|
+
// src/components/ListItem/ListItem.web.tsx
|
|
505
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
506
|
+
function CheckGlyph2() {
|
|
507
|
+
return /* @__PURE__ */ jsx13("svg", { viewBox: "0 0 24 24", fill: "none", className: "w-3/4 h-3/4", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M5 12.5 10 17.5 19 7", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
508
|
+
}
|
|
509
|
+
function TrailingVisual({ trailing, selected, disabled }) {
|
|
510
|
+
const off = disabled ? "border-gray-400 dark:border-gray-600" : "border-gray-600 dark:border-gray-400";
|
|
511
|
+
const on = "border-marian-blue-700 dark:border-marian-blue-800";
|
|
512
|
+
if (trailing === "action") {
|
|
513
|
+
return /* @__PURE__ */ jsx13("span", { className: cn("shrink-0", disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-600 dark:text-gray-400"), children: /* @__PURE__ */ jsx13("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M9 6l6 6-6 6" }) }) });
|
|
514
|
+
}
|
|
515
|
+
if (trailing === "checkbox") {
|
|
516
|
+
return /* @__PURE__ */ jsx13("span", { className: cn("flex size-6 shrink-0 items-center justify-center rounded-[6px] border-2", selected ? cn(on, "bg-marian-blue-700 text-white dark:bg-marian-blue-800") : off), children: selected && /* @__PURE__ */ jsx13(CheckGlyph2, {}) });
|
|
517
|
+
}
|
|
518
|
+
return /* @__PURE__ */ jsx13("span", { className: cn("flex size-6 shrink-0 items-center justify-center rounded-full border-2", selected ? on : off), children: selected && /* @__PURE__ */ jsx13("span", { className: "size-3 rounded-full bg-marian-blue-700 dark:bg-marian-blue-800" }) });
|
|
519
|
+
}
|
|
520
|
+
function ListItem({ trailing = "none", label, description, selected = false, disabled = false, leading, switchValue = false, onSwitchChange, onClick, className }) {
|
|
521
|
+
const isSelected = trailing === "radio" || trailing === "checkbox" ? selected : false;
|
|
522
|
+
const pad = description ? "p-4" : "p-2.5";
|
|
523
|
+
const textColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-marian-blue-900 dark:text-white";
|
|
524
|
+
const descColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-700 dark:text-gray-300";
|
|
525
|
+
const hover = disabled ? "" : isSelected ? "hover:bg-marian-blue-300 active:bg-marian-blue-400 dark:hover:bg-marian-blue-800 dark:active:bg-marian-blue-700" : "hover:bg-gray-15 active:bg-gray-35 dark:hover:bg-midnight-800 dark:active:bg-midnight-600";
|
|
526
|
+
const base = cn("flex w-full items-center gap-3 text-left transition-colors", pad, isSelected && "bg-marian-blue-200 dark:bg-marian-blue-900", hover, className);
|
|
527
|
+
const content = /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
528
|
+
leading && /* @__PURE__ */ jsx13("span", { className: "flex size-6 shrink-0 items-center justify-center", children: leading }),
|
|
529
|
+
/* @__PURE__ */ jsxs7("span", { className: "flex flex-1 flex-col gap-1 min-w-0", children: [
|
|
530
|
+
/* @__PURE__ */ jsx13("span", { className: cn("text-sm leading-5", description ? "font-semibold" : "font-medium", textColor), children: label }),
|
|
531
|
+
description && /* @__PURE__ */ jsx13("span", { className: cn("text-sm font-medium leading-5", descColor), children: description })
|
|
532
|
+
] }),
|
|
533
|
+
trailing === "switch" ? /* @__PURE__ */ jsx13(ToggleSwitch, { size: "sm", value: switchValue, onChange: onSwitchChange, disabled, label }) : trailing !== "none" ? /* @__PURE__ */ jsx13(TrailingVisual, { trailing, selected: isSelected, disabled }) : null
|
|
534
|
+
] });
|
|
535
|
+
if (trailing === "switch" || trailing === "none") {
|
|
536
|
+
return /* @__PURE__ */ jsx13("div", { className: base, children: content });
|
|
537
|
+
}
|
|
538
|
+
return /* @__PURE__ */ jsx13(
|
|
539
|
+
"button",
|
|
298
540
|
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
541
|
+
type: "button",
|
|
542
|
+
role: trailing === "radio" ? "radio" : trailing === "checkbox" ? "checkbox" : "button",
|
|
543
|
+
"aria-checked": trailing === "radio" || trailing === "checkbox" ? isSelected : void 0,
|
|
544
|
+
disabled,
|
|
545
|
+
onClick,
|
|
546
|
+
className: cn(base, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marian-blue-900 dark:focus-visible:ring-white"),
|
|
547
|
+
children: content
|
|
303
548
|
}
|
|
304
549
|
);
|
|
305
550
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
551
|
+
|
|
552
|
+
// src/components/Stepper/Stepper.web.tsx
|
|
553
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
554
|
+
function segmentClass(index, currentStep) {
|
|
555
|
+
if (index < currentStep - 1) return "bg-marian-blue-600";
|
|
556
|
+
if (index === currentStep - 1) return "bg-marian-blue-200 dark:bg-marian-blue-900";
|
|
557
|
+
return "bg-gray-25 dark:bg-midnight-700";
|
|
311
558
|
}
|
|
312
|
-
function Stepper({
|
|
313
|
-
return /* @__PURE__ */
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
559
|
+
function Stepper({ totalSteps, currentStep, className }) {
|
|
560
|
+
return /* @__PURE__ */ jsx14(
|
|
561
|
+
"div",
|
|
562
|
+
{
|
|
563
|
+
role: "progressbar",
|
|
564
|
+
"aria-valuenow": currentStep,
|
|
565
|
+
"aria-valuemin": 1,
|
|
566
|
+
"aria-valuemax": totalSteps,
|
|
567
|
+
"aria-label": `Etapa ${currentStep} de ${totalSteps}`,
|
|
568
|
+
className: cn("flex w-full items-start gap-1", className),
|
|
569
|
+
children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ jsx14("div", { "aria-hidden": "true", className: cn("h-1 flex-1 rounded-full", segmentClass(i, currentStep)) }, i))
|
|
570
|
+
}
|
|
571
|
+
);
|
|
325
572
|
}
|
|
326
573
|
|
|
327
574
|
// src/components/RatingScale/RatingScale.web.tsx
|
|
328
|
-
import { jsx as
|
|
329
|
-
function RatingScale({ value = null, onChange, options = DEFAULT_OPTIONS, className }) {
|
|
330
|
-
return /* @__PURE__ */
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
"
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
"
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
575
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
576
|
+
function RatingScale({ value = null, onChange, options = DEFAULT_OPTIONS, disabled = false, className }) {
|
|
577
|
+
return /* @__PURE__ */ jsx15(
|
|
578
|
+
"div",
|
|
579
|
+
{
|
|
580
|
+
role: "radiogroup",
|
|
581
|
+
"aria-label": "Avalia\xE7\xE3o de 1 a 5",
|
|
582
|
+
className: cn("flex items-center justify-center gap-2 p-4", className),
|
|
583
|
+
children: options.map((option, index) => {
|
|
584
|
+
const itemValue = index + 1;
|
|
585
|
+
const selected = value === itemValue;
|
|
586
|
+
return /* @__PURE__ */ jsxs8(
|
|
587
|
+
"button",
|
|
588
|
+
{
|
|
589
|
+
type: "button",
|
|
590
|
+
role: "radio",
|
|
591
|
+
"aria-checked": selected,
|
|
592
|
+
"aria-label": option.label.replace("\n", " "),
|
|
593
|
+
disabled,
|
|
594
|
+
onClick: () => onChange?.(itemValue),
|
|
595
|
+
className: "flex flex-1 flex-col items-center justify-center gap-1.5 py-1 disabled:cursor-not-allowed",
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ jsx15(
|
|
598
|
+
"div",
|
|
599
|
+
{
|
|
600
|
+
className: cn(
|
|
601
|
+
"flex size-[60px] items-center justify-center overflow-hidden rounded-full transition-colors",
|
|
602
|
+
disabled ? "border border-gray-50 bg-gray-25 dark:border-midnight-700 dark:bg-midnight-700" : selected ? "border-2 border-marian-blue-600 bg-marian-blue-200 dark:border-marian-blue-300 dark:bg-marian-blue-900" : "border border-marian-blue-200 bg-white dark:border-midnight-50 dark:bg-midnight-900"
|
|
603
|
+
),
|
|
604
|
+
children: /* @__PURE__ */ jsx15("span", { className: cn("select-none text-[28px] leading-none", disabled && "opacity-40"), children: option.emoji })
|
|
605
|
+
}
|
|
347
606
|
),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
itemValue
|
|
367
|
-
);
|
|
368
|
-
}) });
|
|
607
|
+
/* @__PURE__ */ jsx15(
|
|
608
|
+
"span",
|
|
609
|
+
{
|
|
610
|
+
className: cn(
|
|
611
|
+
"w-full whitespace-pre-line text-center text-caption",
|
|
612
|
+
disabled ? "text-gray-400 dark:text-gray-600" : "text-marian-blue-900 dark:text-white"
|
|
613
|
+
),
|
|
614
|
+
children: option.label
|
|
615
|
+
}
|
|
616
|
+
),
|
|
617
|
+
/* @__PURE__ */ jsx15("span", { className: "text-[10px] font-semibold leading-none tracking-[0.8px] text-gray-400 dark:text-gray-600", children: itemValue })
|
|
618
|
+
]
|
|
619
|
+
},
|
|
620
|
+
itemValue
|
|
621
|
+
);
|
|
622
|
+
})
|
|
623
|
+
}
|
|
624
|
+
);
|
|
369
625
|
}
|
|
370
626
|
export {
|
|
371
|
-
ActionItem,
|
|
372
627
|
Alert,
|
|
373
628
|
Button,
|
|
629
|
+
ButtonIcon,
|
|
374
630
|
Checkbox,
|
|
375
631
|
Chip,
|
|
632
|
+
ChoiceCard,
|
|
633
|
+
DismissButton,
|
|
376
634
|
Input,
|
|
635
|
+
InputField,
|
|
636
|
+
ListItem,
|
|
377
637
|
ProgressBar,
|
|
378
638
|
RadioGroup,
|
|
379
|
-
RadioItem,
|
|
380
639
|
RatingScale,
|
|
381
640
|
Stepper,
|
|
641
|
+
ToggleSwitch,
|
|
642
|
+
borderWidth,
|
|
382
643
|
colors,
|
|
383
644
|
darkTheme,
|
|
645
|
+
grid,
|
|
384
646
|
lightTheme,
|
|
647
|
+
opacity,
|
|
648
|
+
radius,
|
|
649
|
+
shadow,
|
|
650
|
+
spacing,
|
|
385
651
|
typography
|
|
386
652
|
};
|
|
387
653
|
//# sourceMappingURL=index.web.mjs.map
|