@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.js
CHANGED
|
@@ -20,20 +20,30 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// index.web.ts
|
|
21
21
|
var index_web_exports = {};
|
|
22
22
|
__export(index_web_exports, {
|
|
23
|
-
ActionItem: () => ActionItem,
|
|
24
23
|
Alert: () => Alert,
|
|
25
24
|
Button: () => Button,
|
|
25
|
+
ButtonIcon: () => ButtonIcon,
|
|
26
26
|
Checkbox: () => Checkbox,
|
|
27
27
|
Chip: () => Chip,
|
|
28
|
+
ChoiceCard: () => ChoiceCard,
|
|
29
|
+
DismissButton: () => DismissButton,
|
|
28
30
|
Input: () => Input,
|
|
31
|
+
InputField: () => InputField,
|
|
32
|
+
ListItem: () => ListItem,
|
|
29
33
|
ProgressBar: () => ProgressBar,
|
|
30
34
|
RadioGroup: () => RadioGroup,
|
|
31
|
-
RadioItem: () => RadioItem,
|
|
32
35
|
RatingScale: () => RatingScale,
|
|
33
36
|
Stepper: () => Stepper,
|
|
37
|
+
ToggleSwitch: () => ToggleSwitch,
|
|
38
|
+
borderWidth: () => borderWidth,
|
|
34
39
|
colors: () => colors,
|
|
35
40
|
darkTheme: () => darkTheme,
|
|
41
|
+
grid: () => grid,
|
|
36
42
|
lightTheme: () => lightTheme,
|
|
43
|
+
opacity: () => opacity,
|
|
44
|
+
radius: () => radius,
|
|
45
|
+
shadow: () => shadow,
|
|
46
|
+
spacing: () => spacing,
|
|
37
47
|
typography: () => typography
|
|
38
48
|
});
|
|
39
49
|
module.exports = __toCommonJS(index_web_exports);
|
|
@@ -42,12 +52,12 @@ module.exports = __toCommonJS(index_web_exports);
|
|
|
42
52
|
var colors = {
|
|
43
53
|
marianBlue: {
|
|
44
54
|
50: "#FAFBFF",
|
|
45
|
-
100: "#
|
|
55
|
+
100: "#F6F8FF",
|
|
46
56
|
200: "#E1E7FF",
|
|
47
57
|
300: "#C3CCF7",
|
|
48
58
|
400: "#94A5F2",
|
|
49
59
|
500: "#697DD6",
|
|
50
|
-
600: "#
|
|
60
|
+
600: "#4357AD",
|
|
51
61
|
700: "#31428B",
|
|
52
62
|
800: "#25326A",
|
|
53
63
|
900: "#131937"
|
|
@@ -59,12 +69,15 @@ var colors = {
|
|
|
59
69
|
300: "#474747",
|
|
60
70
|
400: "#3D3D3D",
|
|
61
71
|
500: "#333333",
|
|
62
|
-
600: "#
|
|
72
|
+
600: "#292929",
|
|
63
73
|
700: "#161616",
|
|
64
74
|
800: "#141414",
|
|
65
75
|
900: "#0A0A0A"
|
|
66
76
|
},
|
|
67
77
|
gray: {
|
|
78
|
+
15: "#F4F5F8",
|
|
79
|
+
25: "#EDEEF1",
|
|
80
|
+
35: "#DDE0E6",
|
|
68
81
|
50: "#B1B5BE",
|
|
69
82
|
100: "#A6ABB5",
|
|
70
83
|
200: "#9BA0AB",
|
|
@@ -76,7 +89,20 @@ var colors = {
|
|
|
76
89
|
800: "#5D636F",
|
|
77
90
|
900: "#545964"
|
|
78
91
|
},
|
|
79
|
-
|
|
92
|
+
amber: {
|
|
93
|
+
50: "#FFFBEB",
|
|
94
|
+
100: "#FEF3C7",
|
|
95
|
+
200: "#FDE68A",
|
|
96
|
+
300: "#FCD34D",
|
|
97
|
+
400: "#FBBF24",
|
|
98
|
+
500: "#F59E0B",
|
|
99
|
+
600: "#D97706",
|
|
100
|
+
700: "#B45309",
|
|
101
|
+
800: "#92400E",
|
|
102
|
+
900: "#78350F",
|
|
103
|
+
text: "#BA5C0A"
|
|
104
|
+
},
|
|
105
|
+
yellow: {
|
|
80
106
|
50: "#FFF2D6",
|
|
81
107
|
100: "#FFECC2",
|
|
82
108
|
200: "#FFE5AD",
|
|
@@ -89,97 +115,337 @@ var colors = {
|
|
|
89
115
|
900: "#FFB81F"
|
|
90
116
|
},
|
|
91
117
|
ketchup: {
|
|
92
|
-
50: "#
|
|
93
|
-
100: "#
|
|
94
|
-
200: "#
|
|
95
|
-
300: "#
|
|
96
|
-
400: "#
|
|
97
|
-
500: "#
|
|
98
|
-
600: "#
|
|
99
|
-
700: "#
|
|
100
|
-
800: "#
|
|
101
|
-
900: "#
|
|
118
|
+
50: "#FEF2F2",
|
|
119
|
+
100: "#FEE2E2",
|
|
120
|
+
200: "#FECACA",
|
|
121
|
+
300: "#FCA5A5",
|
|
122
|
+
400: "#F87171",
|
|
123
|
+
500: "#EF4444",
|
|
124
|
+
600: "#DC2626",
|
|
125
|
+
700: "#B91C1C",
|
|
126
|
+
800: "#991B1B",
|
|
127
|
+
900: "#7F1D1D",
|
|
128
|
+
text: "#D91F3C"
|
|
129
|
+
},
|
|
130
|
+
green: {
|
|
131
|
+
50: "#F2FDF4",
|
|
132
|
+
100: "#E5FBE9",
|
|
133
|
+
200: "#C7F4D0",
|
|
134
|
+
300: "#99E5AC",
|
|
135
|
+
400: "#5FCD80",
|
|
136
|
+
500: "#36B260",
|
|
137
|
+
600: "#258F4B",
|
|
138
|
+
700: "#1B6F3B",
|
|
139
|
+
800: "#145430",
|
|
140
|
+
900: "#0E3622",
|
|
141
|
+
text: "#0E8745"
|
|
142
|
+
},
|
|
143
|
+
blue: {
|
|
144
|
+
50: "#EFF6FF",
|
|
145
|
+
100: "#DBEAFE",
|
|
146
|
+
200: "#BFDBFE",
|
|
147
|
+
300: "#93C5FD",
|
|
148
|
+
400: "#60A5FA",
|
|
149
|
+
500: "#3B82F6",
|
|
150
|
+
600: "#2563EB",
|
|
151
|
+
700: "#1D4ED8",
|
|
152
|
+
800: "#1E40AF",
|
|
153
|
+
900: "#1E3A8A",
|
|
154
|
+
text: "#1E40AF"
|
|
102
155
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
156
|
+
// Single brand accent green — the vibrant tone that was previously green/300
|
|
157
|
+
// before the green scale was retuned to muted values in the Figma v2 palette.
|
|
158
|
+
brandGreen: "#6DFFB4",
|
|
159
|
+
overlayBlack: {
|
|
160
|
+
5: "#0000000D",
|
|
161
|
+
8: "#00000014",
|
|
162
|
+
12: "#0000001F",
|
|
163
|
+
16: "#00000029"
|
|
164
|
+
},
|
|
165
|
+
overlayWhite: {
|
|
166
|
+
5: "#FFFFFF0D",
|
|
167
|
+
8: "#FFFFFF14",
|
|
168
|
+
12: "#FFFFFF1F",
|
|
169
|
+
16: "#FFFFFF29"
|
|
114
170
|
},
|
|
115
171
|
white: "#FFFFFF",
|
|
116
|
-
|
|
172
|
+
black: "#000000"
|
|
117
173
|
};
|
|
118
174
|
|
|
119
175
|
// src/tokens/typography.ts
|
|
120
176
|
var typography = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
177
|
+
display1: { fontFamily: "Poppins", fontSize: 32, fontWeight: "700", lineHeight: 40, letterSpacing: -1, textTransform: "none" },
|
|
178
|
+
display2: { fontFamily: "Poppins", fontSize: 32, fontWeight: "700", lineHeight: 40, letterSpacing: -1, textTransform: "none" },
|
|
179
|
+
h1: { fontFamily: "Poppins", fontSize: 24, fontWeight: "700", lineHeight: 32, letterSpacing: -1, textTransform: "none" },
|
|
180
|
+
h2: { fontFamily: "Poppins", fontSize: 20, fontWeight: "700", lineHeight: 28, letterSpacing: 0, textTransform: "none" },
|
|
181
|
+
h3: { fontFamily: "Poppins", fontSize: 16, fontWeight: "600", lineHeight: 24, letterSpacing: 0, textTransform: "none" },
|
|
182
|
+
bodyLarge: { fontFamily: "Inter", fontSize: 16, fontWeight: "500", lineHeight: 24, letterSpacing: 0, textTransform: "none" },
|
|
183
|
+
bodyDefault: { fontFamily: "Inter", fontSize: 14, fontWeight: "500", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
184
|
+
bodySmall: { fontFamily: "Inter", fontSize: 12, fontWeight: "400", lineHeight: 16, letterSpacing: 0.2, textTransform: "none" },
|
|
185
|
+
labelLarge: { fontFamily: "Inter", fontSize: 16, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
186
|
+
labelDefault: { fontFamily: "Inter", fontSize: 14, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
187
|
+
labelSmall: { fontFamily: "Inter", fontSize: 12, fontWeight: "600", lineHeight: 16, letterSpacing: 0.2, textTransform: "none" },
|
|
188
|
+
labelTiny: { fontFamily: "Inter", fontSize: 10, fontWeight: "600", lineHeight: 14, letterSpacing: 0, textTransform: "none" },
|
|
189
|
+
caption: { fontFamily: "Inter", fontSize: 12, fontWeight: "500", lineHeight: 16, letterSpacing: 0.5, textTransform: "none" },
|
|
190
|
+
captionUppercase: { fontFamily: "Inter", fontSize: 12, fontWeight: "500", lineHeight: 16, letterSpacing: 0.5, textTransform: "uppercase" },
|
|
191
|
+
overline: { fontFamily: "Inter", fontSize: 10, fontWeight: "600", lineHeight: 16, letterSpacing: 8, textTransform: "uppercase" },
|
|
192
|
+
buttonLarge: { fontFamily: "Inter", fontSize: 16, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
193
|
+
buttonDefault: { fontFamily: "Inter", fontSize: 14, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
194
|
+
buttonSmall: { fontFamily: "Inter", fontSize: 12, fontWeight: "600", lineHeight: 16, letterSpacing: 0, textTransform: "none" }
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/tokens/spacing.ts
|
|
198
|
+
var spacing = {
|
|
199
|
+
unit: 4,
|
|
200
|
+
gap: {
|
|
201
|
+
"0.5": 2,
|
|
202
|
+
"1": 4,
|
|
203
|
+
"2": 8,
|
|
204
|
+
"3": 12,
|
|
205
|
+
"4": 16,
|
|
206
|
+
"5": 20,
|
|
207
|
+
"6": 24,
|
|
208
|
+
"8": 32,
|
|
209
|
+
"10": 40,
|
|
210
|
+
"12": 48,
|
|
211
|
+
"14": 56,
|
|
212
|
+
"16": 64,
|
|
213
|
+
"18": 72,
|
|
214
|
+
"20": 80,
|
|
215
|
+
"22": 88,
|
|
216
|
+
"24": 96
|
|
217
|
+
},
|
|
218
|
+
screen: {
|
|
219
|
+
x: 16,
|
|
220
|
+
y: 24
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// src/tokens/grid.ts
|
|
225
|
+
var grid = {
|
|
226
|
+
// 8px square baseline — line-height/* steps 16/24/32/40 snap; 20 and 28 land on a half-cell
|
|
227
|
+
baseline: 8,
|
|
228
|
+
breakpoints: {
|
|
229
|
+
mobile: 0,
|
|
230
|
+
tablet: 768,
|
|
231
|
+
desktop: 1024
|
|
232
|
+
},
|
|
233
|
+
columns: {
|
|
234
|
+
mobile: 4,
|
|
235
|
+
tablet: 8,
|
|
236
|
+
desktop: 12
|
|
237
|
+
},
|
|
238
|
+
gutter: {
|
|
239
|
+
mobile: 8,
|
|
240
|
+
tablet: 16,
|
|
241
|
+
desktop: 24
|
|
242
|
+
},
|
|
243
|
+
margin: {
|
|
244
|
+
mobile: 20,
|
|
245
|
+
tablet: 24,
|
|
246
|
+
desktop: 32
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// src/tokens/radius.ts
|
|
251
|
+
var radius = {
|
|
252
|
+
none: 0,
|
|
253
|
+
sm: 8,
|
|
254
|
+
md: 12,
|
|
255
|
+
lg: 16,
|
|
256
|
+
xl: 20,
|
|
257
|
+
"2xl": 24,
|
|
258
|
+
full: 9999,
|
|
259
|
+
button: 16,
|
|
260
|
+
card: 20,
|
|
261
|
+
input: 12,
|
|
262
|
+
chip: 9999,
|
|
263
|
+
badge: 8
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// src/tokens/borderWidth.ts
|
|
267
|
+
var borderWidth = {
|
|
268
|
+
default: 1,
|
|
269
|
+
strong: 1.5,
|
|
270
|
+
heavy: 2
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// src/tokens/shadow.ts
|
|
274
|
+
var shadow = {
|
|
275
|
+
sm: { offsetX: 0, offsetY: 1, blur: 3, spread: 0, color: "#000000", opacity: { light: 0.08, dark: 0.4 } },
|
|
276
|
+
md: { offsetX: 0, offsetY: 4, blur: 12, spread: 0, color: "#000000", opacity: { light: 0.1, dark: 0.5 } },
|
|
277
|
+
lg: { offsetX: 0, offsetY: 8, blur: 24, spread: -4, color: "#000000", opacity: { light: 0.12, dark: 0.6 } }
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// src/tokens/opacity.ts
|
|
281
|
+
var opacity = {
|
|
282
|
+
disabled: 0.4,
|
|
283
|
+
hover: 0.08,
|
|
284
|
+
pressed: 0.12
|
|
135
285
|
};
|
|
136
286
|
|
|
137
287
|
// src/themes/lightTheme.ts
|
|
138
288
|
var lightTheme = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
289
|
+
bg: {
|
|
290
|
+
primary: colors.marianBlue[600],
|
|
291
|
+
primaryHover: colors.marianBlue[700],
|
|
292
|
+
primaryPressed: colors.marianBlue[800],
|
|
293
|
+
primarySubtle: colors.marianBlue[200],
|
|
294
|
+
primarySubtleHover: colors.marianBlue[300],
|
|
295
|
+
primarySubtlePressed: colors.marianBlue[400],
|
|
296
|
+
surface: colors.white,
|
|
297
|
+
surfaceRaised: colors.marianBlue[50],
|
|
298
|
+
surfaceHover: colors.gray[15],
|
|
299
|
+
surfacePressed: colors.gray[35],
|
|
300
|
+
overlay: colors.marianBlue[900],
|
|
301
|
+
overlaySubtle: colors.overlayBlack[8],
|
|
302
|
+
overlaySubtleHover: colors.overlayBlack[12],
|
|
303
|
+
overlaySubtlePressed: colors.overlayBlack[16],
|
|
304
|
+
success: colors.green[600],
|
|
305
|
+
successSubtle: colors.green[100],
|
|
306
|
+
error: colors.ketchup[600],
|
|
307
|
+
errorSubtle: colors.ketchup[100],
|
|
308
|
+
warning: colors.amber[500],
|
|
309
|
+
warningSubtle: colors.amber[100],
|
|
310
|
+
info: colors.blue[500],
|
|
311
|
+
infoSubtle: colors.blue[100],
|
|
312
|
+
highlight: colors.brandGreen,
|
|
313
|
+
accent: colors.amber[500],
|
|
314
|
+
accentSubtle: colors.amber[100],
|
|
315
|
+
disabled: colors.gray[25]
|
|
316
|
+
},
|
|
317
|
+
text: {
|
|
318
|
+
primary: colors.marianBlue[900],
|
|
319
|
+
secondary: colors.gray[700],
|
|
320
|
+
inverse: colors.white,
|
|
321
|
+
brand: colors.marianBlue[600],
|
|
322
|
+
link: colors.marianBlue[600],
|
|
323
|
+
placeholder: colors.gray[400],
|
|
324
|
+
success: colors.green.text,
|
|
325
|
+
error: colors.ketchup.text,
|
|
326
|
+
warning: colors.amber.text,
|
|
327
|
+
info: colors.blue.text,
|
|
328
|
+
highlight: colors.marianBlue[900],
|
|
329
|
+
accent: colors.amber.text,
|
|
330
|
+
disabled: colors.gray[400],
|
|
331
|
+
onSuccess: colors.white,
|
|
332
|
+
onError: colors.white,
|
|
333
|
+
onWarning: colors.midnight[900],
|
|
334
|
+
onHighlight: colors.midnight[900]
|
|
335
|
+
},
|
|
336
|
+
border: {
|
|
337
|
+
default: colors.marianBlue[200],
|
|
338
|
+
strong: colors.marianBlue[600],
|
|
339
|
+
subtle: colors.overlayBlack[5],
|
|
340
|
+
focus: colors.black,
|
|
341
|
+
accent: colors.amber[700],
|
|
342
|
+
success: colors.green.text,
|
|
343
|
+
error: colors.ketchup[600],
|
|
344
|
+
warning: colors.amber[700],
|
|
345
|
+
info: colors.blue[600],
|
|
346
|
+
disabled: colors.gray[50]
|
|
347
|
+
},
|
|
348
|
+
icon: {
|
|
349
|
+
primary: colors.marianBlue[900],
|
|
350
|
+
secondary: colors.gray[600],
|
|
351
|
+
inverse: colors.white,
|
|
352
|
+
brand: colors.marianBlue[600],
|
|
353
|
+
accent: colors.amber[700],
|
|
354
|
+
success: colors.green.text,
|
|
355
|
+
error: colors.ketchup[600],
|
|
356
|
+
warning: colors.amber[600],
|
|
357
|
+
info: colors.blue[600],
|
|
358
|
+
highlight: colors.marianBlue[900],
|
|
359
|
+
disabled: colors.gray[400]
|
|
360
|
+
},
|
|
361
|
+
interactive: {
|
|
362
|
+
hover: colors.overlayBlack[8],
|
|
363
|
+
pressed: colors.overlayBlack[12],
|
|
364
|
+
selected: colors.marianBlue[700],
|
|
365
|
+
selectedSubtle: colors.marianBlue[200]
|
|
366
|
+
}
|
|
159
367
|
};
|
|
160
368
|
|
|
161
369
|
// src/themes/darkTheme.ts
|
|
162
370
|
var darkTheme = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
371
|
+
bg: {
|
|
372
|
+
primary: colors.marianBlue[600],
|
|
373
|
+
primaryHover: colors.marianBlue[500],
|
|
374
|
+
primaryPressed: colors.marianBlue[600],
|
|
375
|
+
primarySubtle: colors.marianBlue[900],
|
|
376
|
+
primarySubtleHover: colors.marianBlue[800],
|
|
377
|
+
primarySubtlePressed: colors.marianBlue[700],
|
|
378
|
+
surface: colors.midnight[900],
|
|
379
|
+
surfaceRaised: colors.midnight[800],
|
|
380
|
+
surfaceHover: colors.midnight[800],
|
|
381
|
+
surfacePressed: colors.midnight[600],
|
|
382
|
+
overlay: colors.black,
|
|
383
|
+
overlaySubtle: colors.overlayWhite[8],
|
|
384
|
+
overlaySubtleHover: colors.overlayWhite[12],
|
|
385
|
+
overlaySubtlePressed: colors.overlayWhite[16],
|
|
386
|
+
success: colors.green[300],
|
|
387
|
+
successSubtle: colors.green[800],
|
|
388
|
+
error: colors.ketchup[900],
|
|
389
|
+
errorSubtle: colors.ketchup[800],
|
|
390
|
+
warning: colors.amber[900],
|
|
391
|
+
warningSubtle: colors.amber[800],
|
|
392
|
+
info: colors.blue[600],
|
|
393
|
+
infoSubtle: colors.blue[700],
|
|
394
|
+
highlight: colors.brandGreen,
|
|
395
|
+
accent: colors.amber[900],
|
|
396
|
+
accentSubtle: colors.amber[900],
|
|
397
|
+
disabled: colors.midnight[700]
|
|
398
|
+
},
|
|
399
|
+
text: {
|
|
400
|
+
primary: colors.white,
|
|
401
|
+
secondary: colors.gray[300],
|
|
402
|
+
inverse: colors.midnight[900],
|
|
403
|
+
brand: colors.marianBlue[300],
|
|
404
|
+
link: colors.marianBlue[300],
|
|
405
|
+
placeholder: colors.gray[400],
|
|
406
|
+
success: colors.green[500],
|
|
407
|
+
error: colors.ketchup[600],
|
|
408
|
+
warning: colors.amber[500],
|
|
409
|
+
info: colors.blue[100],
|
|
410
|
+
highlight: colors.marianBlue[900],
|
|
411
|
+
accent: colors.amber.text,
|
|
412
|
+
disabled: colors.gray[600],
|
|
413
|
+
onSuccess: colors.white,
|
|
414
|
+
onError: colors.white,
|
|
415
|
+
onWarning: colors.midnight[900],
|
|
416
|
+
onHighlight: colors.midnight[900]
|
|
417
|
+
},
|
|
418
|
+
border: {
|
|
419
|
+
default: colors.midnight[50],
|
|
420
|
+
strong: colors.marianBlue[300],
|
|
421
|
+
subtle: colors.overlayWhite[5],
|
|
422
|
+
focus: colors.white,
|
|
423
|
+
accent: colors.amber.text,
|
|
424
|
+
success: colors.green.text,
|
|
425
|
+
error: colors.ketchup[500],
|
|
426
|
+
warning: colors.amber[600],
|
|
427
|
+
info: colors.blue[500],
|
|
428
|
+
disabled: colors.midnight[700]
|
|
429
|
+
},
|
|
430
|
+
icon: {
|
|
431
|
+
primary: colors.white,
|
|
432
|
+
secondary: colors.gray[400],
|
|
433
|
+
inverse: colors.midnight[900],
|
|
434
|
+
brand: colors.marianBlue[300],
|
|
435
|
+
accent: colors.amber[700],
|
|
436
|
+
success: colors.green.text,
|
|
437
|
+
error: colors.ketchup.text,
|
|
438
|
+
warning: colors.amber[100],
|
|
439
|
+
info: colors.blue[100],
|
|
440
|
+
highlight: colors.marianBlue[900],
|
|
441
|
+
disabled: colors.gray[600]
|
|
442
|
+
},
|
|
443
|
+
interactive: {
|
|
444
|
+
hover: colors.overlayWhite[8],
|
|
445
|
+
pressed: colors.overlayWhite[12],
|
|
446
|
+
selected: colors.marianBlue[800],
|
|
447
|
+
selectedSubtle: colors.marianBlue[900]
|
|
448
|
+
}
|
|
183
449
|
};
|
|
184
450
|
|
|
185
451
|
// src/components/Button/Button.web.tsx
|
|
@@ -195,23 +461,23 @@ function cn(...inputs) {
|
|
|
195
461
|
// src/components/Button/Button.web.tsx
|
|
196
462
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
197
463
|
var button = (0, import_class_variance_authority.cva)(
|
|
198
|
-
"inline-flex items-center justify-center
|
|
464
|
+
"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",
|
|
199
465
|
{
|
|
200
466
|
variants: {
|
|
201
467
|
variant: {
|
|
202
|
-
primary: "bg-marian-blue-
|
|
203
|
-
secondary: "bg-marian-blue-200 text-marian-blue-900 disabled:
|
|
204
|
-
ghost: "bg-transparent text-marian-blue-
|
|
468
|
+
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",
|
|
469
|
+
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",
|
|
470
|
+
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"
|
|
205
471
|
},
|
|
206
472
|
size: {
|
|
207
|
-
sm: "h-
|
|
208
|
-
md: "h-
|
|
209
|
-
lg: "h-
|
|
473
|
+
sm: "h-8 px-3 text-button-small",
|
|
474
|
+
md: "h-10 px-4 text-button-default",
|
|
475
|
+
lg: "h-12 px-6 text-button-large"
|
|
210
476
|
}
|
|
211
477
|
},
|
|
212
478
|
defaultVariants: {
|
|
213
479
|
variant: "primary",
|
|
214
|
-
size: "
|
|
480
|
+
size: "lg"
|
|
215
481
|
}
|
|
216
482
|
}
|
|
217
483
|
);
|
|
@@ -228,54 +494,192 @@ function Button({ variant, size, disabled, children, onClick, type = "button", c
|
|
|
228
494
|
);
|
|
229
495
|
}
|
|
230
496
|
|
|
231
|
-
// src/components/
|
|
497
|
+
// src/components/ButtonIcon/ButtonIcon.web.tsx
|
|
498
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
232
499
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
233
|
-
|
|
500
|
+
var buttonIcon = (0, import_class_variance_authority2.cva)(
|
|
501
|
+
"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",
|
|
502
|
+
{
|
|
503
|
+
variants: {
|
|
504
|
+
variant: {
|
|
505
|
+
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",
|
|
506
|
+
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",
|
|
507
|
+
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",
|
|
508
|
+
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"
|
|
509
|
+
},
|
|
510
|
+
size: {
|
|
511
|
+
sm: "size-10",
|
|
512
|
+
md: "size-12",
|
|
513
|
+
lg: "size-16"
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
defaultVariants: {
|
|
517
|
+
variant: "primary",
|
|
518
|
+
size: "md"
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
function ButtonIcon({ variant, size, icon, label, disabled, onClick, type = "button", className }) {
|
|
234
523
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
524
|
+
"button",
|
|
525
|
+
{
|
|
526
|
+
type,
|
|
527
|
+
disabled,
|
|
528
|
+
onClick,
|
|
529
|
+
"aria-label": label,
|
|
530
|
+
className: cn(buttonIcon({ variant, size }), className),
|
|
531
|
+
children: icon
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// src/components/DismissButton/DismissButton.web.tsx
|
|
537
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
538
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
539
|
+
var dismissButton = (0, import_class_variance_authority3.cva)(
|
|
540
|
+
"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",
|
|
541
|
+
{
|
|
542
|
+
variants: {
|
|
543
|
+
variant: {
|
|
544
|
+
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",
|
|
545
|
+
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"
|
|
546
|
+
},
|
|
547
|
+
size: {
|
|
548
|
+
xs: "size-5",
|
|
549
|
+
sm: "size-8",
|
|
550
|
+
md: "size-10"
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
defaultVariants: {
|
|
554
|
+
variant: "subtle",
|
|
555
|
+
size: "sm"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
var glyphSize = {
|
|
560
|
+
xs: 12,
|
|
561
|
+
sm: 16,
|
|
562
|
+
md: 20
|
|
563
|
+
};
|
|
564
|
+
function DismissButton({ variant, size = "sm", label = "Fechar", disabled, onClick, className }) {
|
|
565
|
+
const s = glyphSize[size ?? "sm"];
|
|
566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
235
567
|
"button",
|
|
236
568
|
{
|
|
237
569
|
type: "button",
|
|
570
|
+
disabled,
|
|
571
|
+
onClick,
|
|
572
|
+
"aria-label": label,
|
|
573
|
+
className: cn(dismissButton({ variant, size }), className),
|
|
574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M18 6 6 18M6 6l12 12" }) })
|
|
575
|
+
}
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// src/components/Chip/Chip.web.tsx
|
|
580
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
581
|
+
var sizeCls = {
|
|
582
|
+
sm: "h-8 px-3 text-xs leading-4 tracking-[0.5px]",
|
|
583
|
+
md: "h-11 px-4 text-sm leading-5"
|
|
584
|
+
};
|
|
585
|
+
function Chip({ children, checked = false, disabled = false, size = "md", leading, trailing, onClick, className }) {
|
|
586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
587
|
+
"button",
|
|
588
|
+
{
|
|
589
|
+
type: "button",
|
|
590
|
+
role: "button",
|
|
591
|
+
"aria-pressed": checked,
|
|
592
|
+
disabled,
|
|
238
593
|
onClick,
|
|
239
594
|
className: cn(
|
|
240
|
-
"inline-flex items-center justify-center
|
|
241
|
-
|
|
595
|
+
"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",
|
|
596
|
+
sizeCls[size],
|
|
597
|
+
checked ? "font-semibold" : "font-medium",
|
|
598
|
+
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]",
|
|
242
599
|
className
|
|
243
600
|
),
|
|
244
|
-
children
|
|
601
|
+
children: [
|
|
602
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "shrink-0", children: leading }),
|
|
603
|
+
children,
|
|
604
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "shrink-0", children: trailing })
|
|
605
|
+
]
|
|
245
606
|
}
|
|
246
607
|
);
|
|
247
608
|
}
|
|
248
609
|
|
|
249
610
|
// src/components/Alert/Alert.web.tsx
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
|
|
611
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
612
|
+
var variantStyles = {
|
|
613
|
+
success: { bg: "bg-green-100 dark:bg-green-800", icon: "text-green-text" },
|
|
614
|
+
info: { bg: "bg-blue-100 dark:bg-blue-700", icon: "text-blue-600 dark:text-blue-100" },
|
|
615
|
+
warning: { bg: "bg-amber-100 dark:bg-amber-800", icon: "text-amber-600 dark:text-amber-100" },
|
|
616
|
+
error: { bg: "bg-ketchup-100 dark:bg-ketchup-800", icon: "text-ketchup-600 dark:text-ketchup-text" }
|
|
617
|
+
};
|
|
618
|
+
function AlertIcon({ variant }) {
|
|
619
|
+
const common = { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true };
|
|
620
|
+
switch (variant) {
|
|
621
|
+
case "success":
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...common, children: [
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
624
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M8.5 12.5 11 15l4.5-5" })
|
|
625
|
+
] });
|
|
626
|
+
case "error":
|
|
627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...common, children: [
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M15 9l-6 6M9 9l6 6" })
|
|
630
|
+
] });
|
|
631
|
+
case "warning":
|
|
632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...common, children: [
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 7.5v5M12 16h.01" })
|
|
635
|
+
] });
|
|
636
|
+
case "info":
|
|
637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...common, children: [
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 11v5M12 8h.01" })
|
|
640
|
+
] });
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function Alert({ variant = "info", size = "default", layout = "stacked", title, description, onDismiss, className }) {
|
|
644
|
+
const styles = variantStyles[variant];
|
|
645
|
+
const pad = size === "compact" ? "p-3" : "p-5";
|
|
646
|
+
const gap = size === "compact" ? "gap-2" : "gap-3";
|
|
647
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("shrink-0", styles.icon), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AlertIcon, { variant }) });
|
|
648
|
+
const body = description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-body-default text-gray-700 dark:text-gray-300 w-full", children: description });
|
|
649
|
+
const close = onDismiss && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: onDismiss, "aria-label": "Fechar", className: "shrink-0 text-marian-blue-900 dark:text-white", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M18 6 6 18M6 6l12 12" }) }) });
|
|
650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
253
651
|
"div",
|
|
254
652
|
{
|
|
653
|
+
role: variant === "error" ? "alert" : "status",
|
|
255
654
|
className: cn(
|
|
256
|
-
"w-full
|
|
257
|
-
|
|
655
|
+
"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",
|
|
656
|
+
pad,
|
|
657
|
+
gap,
|
|
658
|
+
styles.bg,
|
|
258
659
|
className
|
|
259
660
|
),
|
|
260
661
|
children: [
|
|
261
|
-
/* @__PURE__ */ (0,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
662
|
+
layout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
663
|
+
icon,
|
|
664
|
+
body
|
|
665
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
666
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
667
|
+
icon,
|
|
668
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "flex-1 text-h3 text-marian-blue-900 dark:text-white", children: title })
|
|
669
|
+
] }),
|
|
670
|
+
body
|
|
671
|
+
] }),
|
|
672
|
+
close
|
|
269
673
|
]
|
|
270
674
|
}
|
|
271
675
|
);
|
|
272
676
|
}
|
|
273
677
|
|
|
274
678
|
// src/components/ProgressBar/ProgressBar.web.tsx
|
|
275
|
-
var
|
|
679
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
276
680
|
function ProgressBar({ value, className }) {
|
|
277
681
|
const pct = Math.min(100, Math.max(0, value));
|
|
278
|
-
return /* @__PURE__ */ (0,
|
|
682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
279
683
|
"div",
|
|
280
684
|
{
|
|
281
685
|
role: "progressbar",
|
|
@@ -283,13 +687,13 @@ function ProgressBar({ value, className }) {
|
|
|
283
687
|
"aria-valuemin": 0,
|
|
284
688
|
"aria-valuemax": 100,
|
|
285
689
|
className: cn(
|
|
286
|
-
"relative h-2 w-full rounded-full bg-
|
|
690
|
+
"relative h-2 w-full rounded-full bg-gray-15 overflow-hidden dark:bg-midnight-800",
|
|
287
691
|
className
|
|
288
692
|
),
|
|
289
|
-
children: /* @__PURE__ */ (0,
|
|
693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
290
694
|
"div",
|
|
291
695
|
{
|
|
292
|
-
className: "absolute inset-y-0 left-0 bg-marian-blue-
|
|
696
|
+
className: "absolute inset-y-0 left-0 bg-marian-blue-600 rounded-full transition-[width]",
|
|
293
697
|
style: { width: `${pct}%` }
|
|
294
698
|
}
|
|
295
699
|
)
|
|
@@ -298,22 +702,22 @@ function ProgressBar({ value, className }) {
|
|
|
298
702
|
}
|
|
299
703
|
|
|
300
704
|
// src/components/Input/Input.web.tsx
|
|
301
|
-
var
|
|
302
|
-
function Input({ value, placeholder = "exemplo@email.com", state = "default", leadingIcon, onChange, className }) {
|
|
705
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
706
|
+
function Input({ value, placeholder = "exemplo@email.com", state = "default", leadingIcon, trailingIcon, onChange, className }) {
|
|
303
707
|
const isDisabled = state === "disabled";
|
|
304
708
|
const isError = state === "error";
|
|
305
|
-
return /* @__PURE__ */ (0,
|
|
709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
306
710
|
"div",
|
|
307
711
|
{
|
|
308
712
|
className: cn(
|
|
309
|
-
"flex items-center gap-2 h-12 px-3 rounded-
|
|
310
|
-
"focus-within:
|
|
311
|
-
isDisabled ? "bg-
|
|
713
|
+
"flex items-center gap-2 h-12 px-3 rounded-input border border-solid text-body-default transition-colors",
|
|
714
|
+
"focus-within:ring-2 focus-within:ring-black dark:focus-within:ring-white",
|
|
715
|
+
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",
|
|
312
716
|
className
|
|
313
717
|
),
|
|
314
718
|
children: [
|
|
315
|
-
leadingIcon && /* @__PURE__ */ (0,
|
|
316
|
-
/* @__PURE__ */ (0,
|
|
719
|
+
leadingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "shrink-0 text-current", children: leadingIcon }),
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
317
721
|
"input",
|
|
318
722
|
{
|
|
319
723
|
type: "text",
|
|
@@ -321,109 +725,152 @@ function Input({ value, placeholder = "exemplo@email.com", state = "default", le
|
|
|
321
725
|
placeholder,
|
|
322
726
|
disabled: isDisabled,
|
|
323
727
|
onChange,
|
|
324
|
-
className: "flex-1 bg-transparent outline-none
|
|
728
|
+
className: "flex-1 bg-transparent outline-none text-current placeholder:text-gray-500 min-w-0"
|
|
325
729
|
}
|
|
326
|
-
)
|
|
730
|
+
),
|
|
731
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "shrink-0 text-current", children: trailingIcon })
|
|
327
732
|
]
|
|
328
733
|
}
|
|
329
734
|
);
|
|
330
735
|
}
|
|
331
736
|
|
|
737
|
+
// src/components/InputField/InputField.web.tsx
|
|
738
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
739
|
+
function InputField({
|
|
740
|
+
label,
|
|
741
|
+
required,
|
|
742
|
+
helperText,
|
|
743
|
+
error,
|
|
744
|
+
value,
|
|
745
|
+
placeholder,
|
|
746
|
+
disabled,
|
|
747
|
+
leadingIcon,
|
|
748
|
+
trailingIcon,
|
|
749
|
+
onChange,
|
|
750
|
+
className
|
|
751
|
+
}) {
|
|
752
|
+
const state = disabled ? "disabled" : error ? "error" : "default";
|
|
753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("flex flex-col gap-2 w-full", className), children: [
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "flex flex-col gap-2", children: [
|
|
755
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "inline-flex items-center gap-0.5 text-label-default text-marian-blue-900 dark:text-white", children: [
|
|
756
|
+
label,
|
|
757
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": "true", className: "text-ketchup-text dark:text-ketchup-600", children: "*" })
|
|
758
|
+
] }),
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
760
|
+
Input,
|
|
761
|
+
{
|
|
762
|
+
state,
|
|
763
|
+
value,
|
|
764
|
+
placeholder,
|
|
765
|
+
leadingIcon,
|
|
766
|
+
trailingIcon,
|
|
767
|
+
onChange
|
|
768
|
+
}
|
|
769
|
+
)
|
|
770
|
+
] }),
|
|
771
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: cn("text-caption", error ? "text-ketchup-text dark:text-ketchup-600" : "text-gray-700 dark:text-gray-300"), children: helperText })
|
|
772
|
+
] });
|
|
773
|
+
}
|
|
774
|
+
|
|
332
775
|
// src/components/Checkbox/Checkbox.web.tsx
|
|
333
|
-
var
|
|
776
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
777
|
+
var boxSize = {
|
|
778
|
+
xs: "size-4",
|
|
779
|
+
sm: "size-5",
|
|
780
|
+
md: "size-6"
|
|
781
|
+
};
|
|
334
782
|
function CheckIcon() {
|
|
335
|
-
return /* @__PURE__ */ (0,
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", className: "w-3/4 h-3/4", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M5 12.5 10 17.5 19 7", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
336
784
|
}
|
|
337
|
-
function Checkbox({ checked = false, onChange, disabled = false, className }) {
|
|
338
|
-
return /* @__PURE__ */ (0,
|
|
785
|
+
function Checkbox({ checked = false, onChange, disabled = false, size = "sm", className }) {
|
|
786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
339
787
|
"label",
|
|
340
788
|
{
|
|
341
789
|
className: cn(
|
|
342
|
-
"
|
|
343
|
-
disabled ? "cursor-not-allowed
|
|
344
|
-
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",
|
|
790
|
+
"inline-flex items-center justify-center rounded-full p-1 transition-colors",
|
|
791
|
+
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]",
|
|
345
792
|
className
|
|
346
793
|
),
|
|
347
794
|
children: [
|
|
348
|
-
/* @__PURE__ */ (0,
|
|
795
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
349
796
|
"input",
|
|
350
797
|
{
|
|
351
798
|
type: "checkbox",
|
|
352
799
|
checked,
|
|
353
800
|
disabled,
|
|
354
801
|
onChange: () => onChange?.(!checked),
|
|
355
|
-
className: "sr-only"
|
|
802
|
+
className: "peer sr-only"
|
|
356
803
|
}
|
|
357
804
|
),
|
|
358
|
-
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
806
|
+
"span",
|
|
807
|
+
{
|
|
808
|
+
className: cn(
|
|
809
|
+
"flex items-center justify-center rounded-[6px] border-2 transition-colors",
|
|
810
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-marian-blue-900 dark:peer-focus-visible:ring-white",
|
|
811
|
+
boxSize[size],
|
|
812
|
+
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"
|
|
813
|
+
),
|
|
814
|
+
children: checked && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckIcon, {})
|
|
815
|
+
}
|
|
816
|
+
)
|
|
359
817
|
]
|
|
360
818
|
}
|
|
361
819
|
);
|
|
362
820
|
}
|
|
363
821
|
|
|
364
|
-
// src/components/
|
|
365
|
-
var
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
822
|
+
// src/components/ToggleSwitch/ToggleSwitch.web.tsx
|
|
823
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
824
|
+
var trackSize = {
|
|
825
|
+
xs: "w-8 h-5",
|
|
826
|
+
sm: "w-10 h-6",
|
|
827
|
+
md: "w-[52px] h-8"
|
|
828
|
+
};
|
|
829
|
+
var knobSize = {
|
|
830
|
+
xs: "size-4",
|
|
831
|
+
sm: "size-5",
|
|
832
|
+
md: "size-7"
|
|
833
|
+
};
|
|
834
|
+
var knobOn = {
|
|
835
|
+
xs: "translate-x-3",
|
|
836
|
+
sm: "translate-x-4",
|
|
837
|
+
md: "translate-x-5"
|
|
838
|
+
};
|
|
839
|
+
function ToggleSwitch({ value = false, onChange, disabled = false, size = "sm", label, className }) {
|
|
840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
380
841
|
"button",
|
|
381
842
|
{
|
|
382
843
|
type: "button",
|
|
383
|
-
role: "
|
|
384
|
-
"aria-checked":
|
|
385
|
-
|
|
844
|
+
role: "switch",
|
|
845
|
+
"aria-checked": value,
|
|
846
|
+
"aria-label": label,
|
|
847
|
+
disabled,
|
|
848
|
+
onClick: () => onChange?.(!value),
|
|
386
849
|
className: cn(
|
|
387
|
-
"flex items-center
|
|
388
|
-
|
|
850
|
+
"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",
|
|
851
|
+
trackSize[size],
|
|
852
|
+
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",
|
|
389
853
|
className
|
|
390
854
|
),
|
|
391
|
-
children:
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
children: label
|
|
403
|
-
}
|
|
404
|
-
),
|
|
405
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
406
|
-
"span",
|
|
407
|
-
{
|
|
408
|
-
className: cn(
|
|
409
|
-
"text-xs leading-normal tracking-[0.024px]",
|
|
410
|
-
selected ? "text-current opacity-80" : "text-gray-700 dark:text-gray-500"
|
|
411
|
-
),
|
|
412
|
-
children: description
|
|
413
|
-
}
|
|
414
|
-
)
|
|
415
|
-
] })
|
|
416
|
-
] }),
|
|
417
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadioIndicator, { selected })
|
|
418
|
-
]
|
|
855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
856
|
+
"span",
|
|
857
|
+
{
|
|
858
|
+
className: cn(
|
|
859
|
+
"rounded-full transition-transform",
|
|
860
|
+
knobSize[size],
|
|
861
|
+
disabled ? "bg-gray-400 dark:bg-gray-600" : "bg-white dark:bg-midnight-900",
|
|
862
|
+
value ? knobOn[size] : "translate-x-0"
|
|
863
|
+
)
|
|
864
|
+
}
|
|
865
|
+
)
|
|
419
866
|
}
|
|
420
867
|
);
|
|
421
868
|
}
|
|
422
869
|
|
|
423
870
|
// src/components/RadioGroup/RadioGroup.web.tsx
|
|
424
|
-
var
|
|
871
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
425
872
|
function RadioGroup({ children, label, className }) {
|
|
426
|
-
return /* @__PURE__ */ (0,
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
427
874
|
"div",
|
|
428
875
|
{
|
|
429
876
|
role: "radiogroup",
|
|
@@ -434,138 +881,217 @@ function RadioGroup({ children, label, className }) {
|
|
|
434
881
|
);
|
|
435
882
|
}
|
|
436
883
|
|
|
437
|
-
// src/components/
|
|
438
|
-
var
|
|
439
|
-
function
|
|
440
|
-
|
|
884
|
+
// src/components/ChoiceCard/ChoiceCard.web.tsx
|
|
885
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
886
|
+
function containerClass(selected, disabled) {
|
|
887
|
+
if (disabled) {
|
|
888
|
+
return "cursor-not-allowed border border-gray-50 bg-white dark:border-midnight-700 dark:bg-midnight-900";
|
|
889
|
+
}
|
|
890
|
+
if (selected) {
|
|
891
|
+
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";
|
|
892
|
+
}
|
|
893
|
+
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";
|
|
441
894
|
}
|
|
442
|
-
function
|
|
443
|
-
return /* @__PURE__ */ (0,
|
|
895
|
+
function CheckGlyph() {
|
|
896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", className: "w-3/4 h-3/4", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M5 12.5 10 17.5 19 7", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
897
|
+
}
|
|
898
|
+
function Trailing({ type, selected, disabled }) {
|
|
899
|
+
const off = disabled ? "border-gray-400 dark:border-gray-600" : "border-gray-600 dark:border-gray-400";
|
|
900
|
+
const on = "border-marian-blue-700 dark:border-marian-blue-800";
|
|
901
|
+
if (type === "action") {
|
|
902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("shrink-0", disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-600 dark:text-gray-400"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M9 6l6 6-6 6" }) }) });
|
|
903
|
+
}
|
|
904
|
+
if (type === "checkbox") {
|
|
905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsx)(CheckGlyph, {}) });
|
|
906
|
+
}
|
|
907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("flex size-6 shrink-0 items-center justify-center rounded-full border-2", selected ? on : off), children: selected && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "size-3 rounded-full bg-marian-blue-700 dark:bg-marian-blue-800" }) });
|
|
908
|
+
}
|
|
909
|
+
function ChoiceCard({ type = "radio", label, description, selected = false, disabled = false, leading, showTrailing = true, onClick, className }) {
|
|
910
|
+
const isSelected = type === "action" ? false : selected;
|
|
911
|
+
const textColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-marian-blue-900 dark:text-white";
|
|
912
|
+
const descColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-700 dark:text-gray-300";
|
|
913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
444
914
|
"button",
|
|
445
915
|
{
|
|
446
916
|
type: "button",
|
|
917
|
+
role: type === "radio" ? "radio" : type === "checkbox" ? "checkbox" : "button",
|
|
918
|
+
"aria-checked": type === "action" ? void 0 : isSelected,
|
|
919
|
+
disabled,
|
|
447
920
|
onClick,
|
|
448
921
|
className: cn(
|
|
449
|
-
"flex items-center gap-
|
|
450
|
-
|
|
922
|
+
"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",
|
|
923
|
+
containerClass(isSelected, disabled),
|
|
451
924
|
className
|
|
452
925
|
),
|
|
453
926
|
children: [
|
|
454
|
-
/* @__PURE__ */ (0,
|
|
455
|
-
|
|
456
|
-
/* @__PURE__ */ (0,
|
|
457
|
-
|
|
458
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs font-normal text-gray-700 dark:text-gray-400 leading-normal tracking-[0.024px]", children: description })
|
|
459
|
-
] })
|
|
927
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex size-6 shrink-0 items-center justify-center", children: leading }),
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex flex-1 flex-col gap-1 min-w-0", children: [
|
|
929
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("text-sm leading-5", description ? "font-semibold" : "font-medium", textColor), children: label }),
|
|
930
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("text-sm font-medium leading-5", descColor), children: description })
|
|
460
931
|
] }),
|
|
461
|
-
/* @__PURE__ */ (0,
|
|
932
|
+
showTrailing && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Trailing, { type, selected: isSelected, disabled })
|
|
462
933
|
]
|
|
463
934
|
}
|
|
464
935
|
);
|
|
465
936
|
}
|
|
466
937
|
|
|
467
|
-
// src/components/
|
|
468
|
-
var
|
|
469
|
-
function
|
|
470
|
-
return /* @__PURE__ */ (0,
|
|
471
|
-
|
|
938
|
+
// src/components/ListItem/ListItem.web.tsx
|
|
939
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
940
|
+
function CheckGlyph2() {
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", className: "w-3/4 h-3/4", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M5 12.5 10 17.5 19 7", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
942
|
+
}
|
|
943
|
+
function TrailingVisual({ trailing, selected, disabled }) {
|
|
944
|
+
const off = disabled ? "border-gray-400 dark:border-gray-600" : "border-gray-600 dark:border-gray-400";
|
|
945
|
+
const on = "border-marian-blue-700 dark:border-marian-blue-800";
|
|
946
|
+
if (trailing === "action") {
|
|
947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("shrink-0", disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-600 dark:text-gray-400"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M9 6l6 6-6 6" }) }) });
|
|
948
|
+
}
|
|
949
|
+
if (trailing === "checkbox") {
|
|
950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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__ */ (0, import_jsx_runtime13.jsx)(CheckGlyph2, {}) });
|
|
951
|
+
}
|
|
952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("flex size-6 shrink-0 items-center justify-center rounded-full border-2", selected ? on : off), children: selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "size-3 rounded-full bg-marian-blue-700 dark:bg-marian-blue-800" }) });
|
|
953
|
+
}
|
|
954
|
+
function ListItem({ trailing = "none", label, description, selected = false, disabled = false, leading, switchValue = false, onSwitchChange, onClick, className }) {
|
|
955
|
+
const isSelected = trailing === "radio" || trailing === "checkbox" ? selected : false;
|
|
956
|
+
const pad = description ? "p-4" : "p-2.5";
|
|
957
|
+
const textColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-marian-blue-900 dark:text-white";
|
|
958
|
+
const descColor = disabled ? "text-gray-400 dark:text-gray-600" : "text-gray-700 dark:text-gray-300";
|
|
959
|
+
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";
|
|
960
|
+
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);
|
|
961
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
962
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex size-6 shrink-0 items-center justify-center", children: leading }),
|
|
963
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex flex-1 flex-col gap-1 min-w-0", children: [
|
|
964
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("text-sm leading-5", description ? "font-semibold" : "font-medium", textColor), children: label }),
|
|
965
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("text-sm font-medium leading-5", descColor), children: description })
|
|
966
|
+
] }),
|
|
967
|
+
trailing === "switch" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToggleSwitch, { size: "sm", value: switchValue, onChange: onSwitchChange, disabled, label }) : trailing !== "none" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TrailingVisual, { trailing, selected: isSelected, disabled }) : null
|
|
968
|
+
] });
|
|
969
|
+
if (trailing === "switch" || trailing === "none") {
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: base, children: content });
|
|
971
|
+
}
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
973
|
+
"button",
|
|
472
974
|
{
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
975
|
+
type: "button",
|
|
976
|
+
role: trailing === "radio" ? "radio" : trailing === "checkbox" ? "checkbox" : "button",
|
|
977
|
+
"aria-checked": trailing === "radio" || trailing === "checkbox" ? isSelected : void 0,
|
|
978
|
+
disabled,
|
|
979
|
+
onClick,
|
|
980
|
+
className: cn(base, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marian-blue-900 dark:focus-visible:ring-white"),
|
|
981
|
+
children: content
|
|
477
982
|
}
|
|
478
983
|
);
|
|
479
984
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
985
|
+
|
|
986
|
+
// src/components/Stepper/Stepper.web.tsx
|
|
987
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
988
|
+
function segmentClass(index, currentStep) {
|
|
989
|
+
if (index < currentStep - 1) return "bg-marian-blue-600";
|
|
990
|
+
if (index === currentStep - 1) return "bg-marian-blue-200 dark:bg-marian-blue-900";
|
|
991
|
+
return "bg-gray-25 dark:bg-midnight-700";
|
|
485
992
|
}
|
|
486
|
-
function Stepper({
|
|
487
|
-
return /* @__PURE__ */ (0,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
993
|
+
function Stepper({ totalSteps, currentStep, className }) {
|
|
994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
995
|
+
"div",
|
|
996
|
+
{
|
|
997
|
+
role: "progressbar",
|
|
998
|
+
"aria-valuenow": currentStep,
|
|
999
|
+
"aria-valuemin": 1,
|
|
1000
|
+
"aria-valuemax": totalSteps,
|
|
1001
|
+
"aria-label": `Etapa ${currentStep} de ${totalSteps}`,
|
|
1002
|
+
className: cn("flex w-full items-start gap-1", className),
|
|
1003
|
+
children: Array.from({ length: totalSteps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { "aria-hidden": "true", className: cn("h-1 flex-1 rounded-full", segmentClass(i, currentStep)) }, i))
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
499
1006
|
}
|
|
500
1007
|
|
|
501
1008
|
// src/components/RatingScale/RatingScale.styles.ts
|
|
502
1009
|
var DEFAULT_OPTIONS = [
|
|
503
|
-
{ emoji: "\u{
|
|
504
|
-
{ emoji: "\u{
|
|
505
|
-
{ emoji: "\u{1F610}", label: "
|
|
506
|
-
{ emoji: "\u{
|
|
507
|
-
{ emoji: "\u{
|
|
1010
|
+
{ emoji: "\u{1F621}", label: "P\xE9ssimo" },
|
|
1011
|
+
{ emoji: "\u{1F615}", label: "Ruim" },
|
|
1012
|
+
{ emoji: "\u{1F610}", label: "Neutro" },
|
|
1013
|
+
{ emoji: "\u{1F60A}", label: "Bom" },
|
|
1014
|
+
{ emoji: "\u{1F60D}", label: "\xD3timo" }
|
|
508
1015
|
];
|
|
509
1016
|
|
|
510
1017
|
// src/components/RatingScale/RatingScale.web.tsx
|
|
511
|
-
var
|
|
512
|
-
function RatingScale({ value = null, onChange, options = DEFAULT_OPTIONS, className }) {
|
|
513
|
-
return /* @__PURE__ */ (0,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
"
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
"
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
1018
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1019
|
+
function RatingScale({ value = null, onChange, options = DEFAULT_OPTIONS, disabled = false, className }) {
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1021
|
+
"div",
|
|
1022
|
+
{
|
|
1023
|
+
role: "radiogroup",
|
|
1024
|
+
"aria-label": "Avalia\xE7\xE3o de 1 a 5",
|
|
1025
|
+
className: cn("flex items-center justify-center gap-2 p-4", className),
|
|
1026
|
+
children: options.map((option, index) => {
|
|
1027
|
+
const itemValue = index + 1;
|
|
1028
|
+
const selected = value === itemValue;
|
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1030
|
+
"button",
|
|
1031
|
+
{
|
|
1032
|
+
type: "button",
|
|
1033
|
+
role: "radio",
|
|
1034
|
+
"aria-checked": selected,
|
|
1035
|
+
"aria-label": option.label.replace("\n", " "),
|
|
1036
|
+
disabled,
|
|
1037
|
+
onClick: () => onChange?.(itemValue),
|
|
1038
|
+
className: "flex flex-1 flex-col items-center justify-center gap-1.5 py-1 disabled:cursor-not-allowed",
|
|
1039
|
+
children: [
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1041
|
+
"div",
|
|
1042
|
+
{
|
|
1043
|
+
className: cn(
|
|
1044
|
+
"flex size-[60px] items-center justify-center overflow-hidden rounded-full transition-colors",
|
|
1045
|
+
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"
|
|
1046
|
+
),
|
|
1047
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("select-none text-[28px] leading-none", disabled && "opacity-40"), children: option.emoji })
|
|
1048
|
+
}
|
|
530
1049
|
),
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
itemValue
|
|
550
|
-
);
|
|
551
|
-
}) });
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1051
|
+
"span",
|
|
1052
|
+
{
|
|
1053
|
+
className: cn(
|
|
1054
|
+
"w-full whitespace-pre-line text-center text-caption",
|
|
1055
|
+
disabled ? "text-gray-400 dark:text-gray-600" : "text-marian-blue-900 dark:text-white"
|
|
1056
|
+
),
|
|
1057
|
+
children: option.label
|
|
1058
|
+
}
|
|
1059
|
+
),
|
|
1060
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-[10px] font-semibold leading-none tracking-[0.8px] text-gray-400 dark:text-gray-600", children: itemValue })
|
|
1061
|
+
]
|
|
1062
|
+
},
|
|
1063
|
+
itemValue
|
|
1064
|
+
);
|
|
1065
|
+
})
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
552
1068
|
}
|
|
553
1069
|
// Annotate the CommonJS export names for ESM import in node:
|
|
554
1070
|
0 && (module.exports = {
|
|
555
|
-
ActionItem,
|
|
556
1071
|
Alert,
|
|
557
1072
|
Button,
|
|
1073
|
+
ButtonIcon,
|
|
558
1074
|
Checkbox,
|
|
559
1075
|
Chip,
|
|
1076
|
+
ChoiceCard,
|
|
1077
|
+
DismissButton,
|
|
560
1078
|
Input,
|
|
1079
|
+
InputField,
|
|
1080
|
+
ListItem,
|
|
561
1081
|
ProgressBar,
|
|
562
1082
|
RadioGroup,
|
|
563
|
-
RadioItem,
|
|
564
1083
|
RatingScale,
|
|
565
1084
|
Stepper,
|
|
1085
|
+
ToggleSwitch,
|
|
1086
|
+
borderWidth,
|
|
566
1087
|
colors,
|
|
567
1088
|
darkTheme,
|
|
1089
|
+
grid,
|
|
568
1090
|
lightTheme,
|
|
1091
|
+
opacity,
|
|
1092
|
+
radius,
|
|
1093
|
+
shadow,
|
|
1094
|
+
spacing,
|
|
569
1095
|
typography
|
|
570
1096
|
});
|
|
571
1097
|
//# sourceMappingURL=index.web.js.map
|