@rabelo-digital/ds-rd 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,684 @@
1
+ export { breakpoints, elevation, mediaQuery, motion, primitiveColors, radii, semanticColors, spacing, typography, zIndex } from './chunk-JPWULLEO.mjs';
2
+ import React, { useId, useState, createContext, useContext, useCallback } from 'react';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import * as RadixCheckbox from '@radix-ui/react-checkbox';
5
+ import * as RadixRadio from '@radix-ui/react-radio-group';
6
+ import * as RadixSelect from '@radix-ui/react-select';
7
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
8
+ import { FaTwitter, FaFacebookF, FaWhatsapp, FaYoutube, FaGithub, FaInstagram, FaLinkedinIn } from 'react-icons/fa';
9
+ import * as Dialog from '@radix-ui/react-dialog';
10
+ import * as RadixTabs from '@radix-ui/react-tabs';
11
+ import * as RadixAccordion from '@radix-ui/react-accordion';
12
+ import * as RadixToast from '@radix-ui/react-toast';
13
+
14
+ // src/components/atoms/Button/Button.module.css
15
+ var Button_default = {};
16
+ var Button = React.forwardRef(
17
+ ({
18
+ variant = "primary",
19
+ size = "md",
20
+ loading = false,
21
+ disabled,
22
+ className,
23
+ children,
24
+ onClick,
25
+ ...props
26
+ }, ref) => {
27
+ const isDisabled = disabled || loading;
28
+ return /* @__PURE__ */ jsxs(
29
+ "button",
30
+ {
31
+ ref,
32
+ className: [
33
+ Button_default.button,
34
+ Button_default[variant],
35
+ Button_default[size],
36
+ loading ? Button_default.loading : "",
37
+ className ?? ""
38
+ ].filter(Boolean).join(" "),
39
+ disabled: isDisabled,
40
+ "aria-disabled": isDisabled || void 0,
41
+ "aria-busy": loading || void 0,
42
+ onClick: isDisabled ? void 0 : onClick,
43
+ ...props,
44
+ children: [
45
+ /* @__PURE__ */ jsx("span", { className: loading ? Button_default.labelHidden : Button_default.label, children }),
46
+ loading && /* @__PURE__ */ jsx("span", { className: Button_default.spinner, "aria-hidden": "true" })
47
+ ]
48
+ }
49
+ );
50
+ }
51
+ );
52
+ Button.displayName = "Button";
53
+
54
+ // src/components/atoms/Input/Input.module.css
55
+ var Input_default = {};
56
+ var Input = React.forwardRef(
57
+ ({ label, error, helperText, size = "md", className, id, ...props }, ref) => {
58
+ const generatedId = useId();
59
+ const inputId = id ?? generatedId;
60
+ const errorId = `${inputId}-error`;
61
+ const helperId = `${inputId}-helper`;
62
+ return /* @__PURE__ */ jsxs("div", { className: Input_default.wrapper, children: [
63
+ label && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: Input_default.label, children: label }),
64
+ /* @__PURE__ */ jsx(
65
+ "input",
66
+ {
67
+ ref,
68
+ id: inputId,
69
+ className: [Input_default.input, Input_default[size], error ? Input_default.error : "", className ?? ""].filter(Boolean).join(" "),
70
+ "aria-invalid": !!error,
71
+ "aria-describedby": [error ? errorId : null, helperText ? helperId : null].filter(Boolean).join(" ") || void 0,
72
+ ...props
73
+ }
74
+ ),
75
+ error && /* @__PURE__ */ jsx("span", { id: errorId, className: Input_default.errorText, role: "alert", children: error }),
76
+ helperText && !error && /* @__PURE__ */ jsx("span", { id: helperId, className: Input_default.helperText, children: helperText })
77
+ ] });
78
+ }
79
+ );
80
+ Input.displayName = "Input";
81
+
82
+ // src/components/atoms/Textarea/Textarea.module.css
83
+ var Textarea_default = {};
84
+ var Textarea = React.forwardRef(
85
+ ({ label, error, helperText, showCount = false, maxLength, className, id, onChange, ...props }, ref) => {
86
+ const generatedId = useId();
87
+ const textareaId = id ?? generatedId;
88
+ const errorId = `${textareaId}-error`;
89
+ const helperId = `${textareaId}-helper`;
90
+ const [count, setCount] = useState(typeof props.value === "string" ? props.value.length : 0);
91
+ const handleChange = (e) => {
92
+ setCount(e.target.value.length);
93
+ onChange?.(e);
94
+ };
95
+ return /* @__PURE__ */ jsxs("div", { className: Textarea_default.wrapper, children: [
96
+ label && /* @__PURE__ */ jsx("label", { htmlFor: textareaId, className: Textarea_default.label, children: label }),
97
+ /* @__PURE__ */ jsx(
98
+ "textarea",
99
+ {
100
+ ref,
101
+ id: textareaId,
102
+ className: [Textarea_default.textarea, error ? Textarea_default.error : "", className ?? ""].filter(Boolean).join(" "),
103
+ maxLength,
104
+ onChange: handleChange,
105
+ "aria-invalid": !!error,
106
+ "aria-describedby": [error ? errorId : null, helperText ? helperId : null].filter(Boolean).join(" ") || void 0,
107
+ ...props
108
+ }
109
+ ),
110
+ /* @__PURE__ */ jsxs("div", { className: Textarea_default.footer, children: [
111
+ error && /* @__PURE__ */ jsx("span", { id: errorId, className: Textarea_default.errorText, role: "alert", children: error }),
112
+ helperText && !error && /* @__PURE__ */ jsx("span", { id: helperId, className: Textarea_default.helperText, children: helperText }),
113
+ showCount && maxLength && /* @__PURE__ */ jsxs("span", { className: Textarea_default.counter, "aria-live": "polite", children: [
114
+ count,
115
+ "/",
116
+ maxLength
117
+ ] })
118
+ ] })
119
+ ] });
120
+ }
121
+ );
122
+ Textarea.displayName = "Textarea";
123
+
124
+ // src/components/atoms/Badge/Badge.module.css
125
+ var Badge_default = {};
126
+ var Badge = ({
127
+ variant = "default",
128
+ size = "md",
129
+ children,
130
+ className
131
+ }) => /* @__PURE__ */ jsx(
132
+ "span",
133
+ {
134
+ className: [Badge_default.badge, Badge_default[variant], Badge_default[size], className ?? ""].filter(Boolean).join(" "),
135
+ children
136
+ }
137
+ );
138
+ Badge.displayName = "Badge";
139
+
140
+ // src/components/atoms/Avatar/Avatar.module.css
141
+ var Avatar_default = {};
142
+ function getInitials(name) {
143
+ return name.split(" ").map((part) => part[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
144
+ }
145
+ var Avatar = ({
146
+ src,
147
+ alt,
148
+ name,
149
+ size = "md",
150
+ shape = "circle",
151
+ className
152
+ }) => {
153
+ const [imgError, setImgError] = useState(false);
154
+ const initials = name ? getInitials(name) : null;
155
+ const showImage = src && !imgError;
156
+ const wrapperClass = [Avatar_default.avatar, Avatar_default[size], Avatar_default[shape], className ?? ""].filter(Boolean).join(" ");
157
+ if (showImage) {
158
+ return /* @__PURE__ */ jsx("span", { className: wrapperClass, children: /* @__PURE__ */ jsx(
159
+ "img",
160
+ {
161
+ src,
162
+ alt: alt ?? name ?? "",
163
+ className: Avatar_default.image,
164
+ onError: () => setImgError(true)
165
+ }
166
+ ) });
167
+ }
168
+ return /* @__PURE__ */ jsx("span", { className: wrapperClass, role: "img", "aria-label": alt ?? name ?? "Avatar", children: /* @__PURE__ */ jsx("span", { className: Avatar_default.initials, "aria-hidden": "true", children: initials ?? "?" }) });
169
+ };
170
+ Avatar.displayName = "Avatar";
171
+
172
+ // src/components/atoms/Checkbox/Checkbox.module.css
173
+ var Checkbox_default = {};
174
+ var Checkbox = ({
175
+ checked,
176
+ defaultChecked,
177
+ onCheckedChange,
178
+ disabled,
179
+ label,
180
+ id,
181
+ className
182
+ }) => {
183
+ const generatedId = useId();
184
+ const checkboxId = id ?? generatedId;
185
+ return /* @__PURE__ */ jsxs("div", { className: [Checkbox_default.wrapper, className ?? ""].filter(Boolean).join(" "), children: [
186
+ /* @__PURE__ */ jsx(
187
+ RadixCheckbox.Root,
188
+ {
189
+ id: checkboxId,
190
+ checked,
191
+ defaultChecked,
192
+ onCheckedChange,
193
+ disabled,
194
+ className: Checkbox_default.root,
195
+ children: /* @__PURE__ */ jsx(RadixCheckbox.Indicator, { className: Checkbox_default.indicator, children: checked === "indeterminate" ? /* @__PURE__ */ jsx("svg", { width: "10", height: "2", viewBox: "0 0 10 2", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx("rect", { width: "10", height: "2", rx: "1" }) }) : /* @__PURE__ */ jsx("svg", { width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
196
+ "path",
197
+ {
198
+ d: "M1 4l2.5 2.5L9 1",
199
+ stroke: "currentColor",
200
+ strokeWidth: "1.5",
201
+ strokeLinecap: "round",
202
+ strokeLinejoin: "round"
203
+ }
204
+ ) }) })
205
+ }
206
+ ),
207
+ label && /* @__PURE__ */ jsx("label", { htmlFor: checkboxId, className: Checkbox_default.label, children: label })
208
+ ] });
209
+ };
210
+ Checkbox.displayName = "Checkbox";
211
+
212
+ // src/components/atoms/Radio/Radio.module.css
213
+ var Radio_default = {};
214
+ var RadioGroup = ({
215
+ options,
216
+ value,
217
+ defaultValue,
218
+ onValueChange,
219
+ disabled,
220
+ name,
221
+ orientation = "vertical",
222
+ className
223
+ }) => {
224
+ const baseId = useId();
225
+ return /* @__PURE__ */ jsx(
226
+ RadixRadio.Root,
227
+ {
228
+ value,
229
+ defaultValue,
230
+ onValueChange,
231
+ disabled,
232
+ name,
233
+ orientation,
234
+ className: [Radio_default.group, Radio_default[orientation], className ?? ""].filter(Boolean).join(" "),
235
+ children: options.map((option) => {
236
+ const radioId = `${baseId}-${option.value}`;
237
+ return /* @__PURE__ */ jsxs("div", { className: Radio_default.item, children: [
238
+ /* @__PURE__ */ jsx(
239
+ RadixRadio.Item,
240
+ {
241
+ id: radioId,
242
+ value: option.value,
243
+ disabled: option.disabled ?? disabled,
244
+ className: Radio_default.radio,
245
+ children: /* @__PURE__ */ jsx(RadixRadio.Indicator, { className: Radio_default.indicator })
246
+ }
247
+ ),
248
+ /* @__PURE__ */ jsx("label", { htmlFor: radioId, className: Radio_default.label, children: option.label })
249
+ ] }, option.value);
250
+ })
251
+ }
252
+ );
253
+ };
254
+ RadioGroup.displayName = "RadioGroup";
255
+
256
+ // src/components/atoms/Select/Select.module.css
257
+ var Select_default = {};
258
+ var Select = ({
259
+ options,
260
+ value,
261
+ defaultValue,
262
+ onValueChange,
263
+ label,
264
+ placeholder = "Selecione...",
265
+ error,
266
+ helperText,
267
+ disabled,
268
+ size = "md",
269
+ id,
270
+ className
271
+ }) => {
272
+ const generatedId = useId();
273
+ const selectId = id ?? generatedId;
274
+ return /* @__PURE__ */ jsxs("div", { className: [Select_default.wrapper, className ?? ""].filter(Boolean).join(" "), children: [
275
+ label && /* @__PURE__ */ jsx("label", { id: `${selectId}-label`, className: Select_default.label, children: label }),
276
+ /* @__PURE__ */ jsxs(
277
+ RadixSelect.Root,
278
+ {
279
+ value,
280
+ defaultValue,
281
+ onValueChange,
282
+ disabled,
283
+ children: [
284
+ /* @__PURE__ */ jsxs(
285
+ RadixSelect.Trigger,
286
+ {
287
+ id: selectId,
288
+ "aria-labelledby": label ? `${selectId}-label` : void 0,
289
+ "aria-invalid": !!error,
290
+ className: [Select_default.trigger, Select_default[size], error ? Select_default.error : ""].filter(Boolean).join(" "),
291
+ children: [
292
+ /* @__PURE__ */ jsx(RadixSelect.Value, { placeholder }),
293
+ /* @__PURE__ */ jsx(RadixSelect.Icon, { className: Select_default.icon, children: /* @__PURE__ */ jsx("svg", { width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
294
+ "path",
295
+ {
296
+ d: "M1 1l5 5 5-5",
297
+ stroke: "currentColor",
298
+ strokeWidth: "1.5",
299
+ strokeLinecap: "round",
300
+ strokeLinejoin: "round"
301
+ }
302
+ ) }) })
303
+ ]
304
+ }
305
+ ),
306
+ /* @__PURE__ */ jsx(RadixSelect.Portal, { children: /* @__PURE__ */ jsx(RadixSelect.Content, { className: Select_default.content, position: "popper", sideOffset: 4, children: /* @__PURE__ */ jsx(RadixSelect.Viewport, { className: Select_default.viewport, children: options.map((option) => /* @__PURE__ */ jsxs(
307
+ RadixSelect.Item,
308
+ {
309
+ value: option.value,
310
+ disabled: option.disabled,
311
+ className: Select_default.item,
312
+ children: [
313
+ /* @__PURE__ */ jsx(RadixSelect.ItemText, { children: option.label }),
314
+ /* @__PURE__ */ jsx(RadixSelect.ItemIndicator, { className: Select_default.itemIndicator, children: /* @__PURE__ */ jsx("svg", { width: "12", height: "10", viewBox: "0 0 12 10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
315
+ "path",
316
+ {
317
+ d: "M1 5l3 3 7-7",
318
+ stroke: "currentColor",
319
+ strokeWidth: "1.5",
320
+ strokeLinecap: "round",
321
+ strokeLinejoin: "round"
322
+ }
323
+ ) }) })
324
+ ]
325
+ },
326
+ option.value
327
+ )) }) }) })
328
+ ]
329
+ }
330
+ ),
331
+ error && /* @__PURE__ */ jsx("span", { className: Select_default.errorText, role: "alert", children: error }),
332
+ helperText && !error && /* @__PURE__ */ jsx("span", { className: Select_default.helperText, children: helperText })
333
+ ] });
334
+ };
335
+ Select.displayName = "Select";
336
+
337
+ // src/components/atoms/Tooltip/Tooltip.module.css
338
+ var Tooltip_default = {};
339
+ var TooltipProvider = RadixTooltip.Provider;
340
+ var Tooltip = ({
341
+ content,
342
+ children,
343
+ side = "top",
344
+ delayDuration = 300
345
+ }) => /* @__PURE__ */ jsxs(RadixTooltip.Root, { delayDuration, children: [
346
+ /* @__PURE__ */ jsx(RadixTooltip.Trigger, { asChild: true, children }),
347
+ /* @__PURE__ */ jsx(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs(RadixTooltip.Content, { side, className: Tooltip_default.content, sideOffset: 6, children: [
348
+ content,
349
+ /* @__PURE__ */ jsx(RadixTooltip.Arrow, { className: Tooltip_default.arrow })
350
+ ] }) })
351
+ ] });
352
+ Tooltip.displayName = "Tooltip";
353
+
354
+ // src/components/atoms/SocialIcons/SocialIcons.module.css
355
+ var SocialIcons_default = {};
356
+ var ICON_MAP = {
357
+ linkedin: FaLinkedinIn,
358
+ instagram: FaInstagram,
359
+ github: FaGithub,
360
+ youtube: FaYoutube,
361
+ whatsapp: FaWhatsapp,
362
+ facebook: FaFacebookF,
363
+ twitter: FaTwitter
364
+ };
365
+ var DEFAULT_LABELS = {
366
+ linkedin: "Seguir no LinkedIn",
367
+ instagram: "Seguir no Instagram",
368
+ github: "Ver no GitHub",
369
+ youtube: "Assistir no YouTube",
370
+ whatsapp: "Conversar no WhatsApp",
371
+ facebook: "Seguir no Facebook",
372
+ twitter: "Seguir no Twitter"
373
+ };
374
+ var SocialIcons = ({ links, size = "md", className }) => /* @__PURE__ */ jsx("ul", { className: [SocialIcons_default.list, className ?? ""].filter(Boolean).join(" "), children: links.map(({ platform, url, label }) => {
375
+ const Icon2 = ICON_MAP[platform];
376
+ const ariaLabel = label ?? DEFAULT_LABELS[platform];
377
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
378
+ "a",
379
+ {
380
+ href: url,
381
+ target: "_blank",
382
+ rel: "noopener noreferrer",
383
+ "aria-label": ariaLabel,
384
+ className: [SocialIcons_default.link, SocialIcons_default[size]].join(" "),
385
+ children: /* @__PURE__ */ jsx(Icon2, { "aria-hidden": "true" })
386
+ }
387
+ ) }, platform);
388
+ }) });
389
+ SocialIcons.displayName = "SocialIcons";
390
+
391
+ // src/components/molecules/Card/Card.module.css
392
+ var Card_default = {};
393
+ var CardHeader = ({ children, className }) => /* @__PURE__ */ jsx("div", { className: [Card_default.header, className ?? ""].filter(Boolean).join(" "), children });
394
+ var CardBody = ({ children, className }) => /* @__PURE__ */ jsx("div", { className: [Card_default.body, className ?? ""].filter(Boolean).join(" "), children });
395
+ var CardFooter = ({ children, className }) => /* @__PURE__ */ jsx("div", { className: [Card_default.footer, className ?? ""].filter(Boolean).join(" "), children });
396
+ var Card = ({ elevation: elevation2 = "sm", radius = "lg", className, children }) => /* @__PURE__ */ jsx(
397
+ "div",
398
+ {
399
+ className: [Card_default.card, className ?? ""].filter(Boolean).join(" "),
400
+ style: {
401
+ boxShadow: `var(--ds-elevation-${elevation2})`,
402
+ borderRadius: `var(--ds-radius-${radius})`
403
+ },
404
+ children
405
+ }
406
+ );
407
+ Card.Header = CardHeader;
408
+ Card.Body = CardBody;
409
+ Card.Footer = CardFooter;
410
+ Card.displayName = "Card";
411
+
412
+ // src/components/molecules/Modal/Modal.module.css
413
+ var Modal_default = {};
414
+ var Modal = ({
415
+ open,
416
+ onOpenChange,
417
+ title,
418
+ description,
419
+ size = "md",
420
+ children,
421
+ trigger
422
+ }) => /* @__PURE__ */ jsxs(Dialog.Root, { open, onOpenChange, children: [
423
+ trigger && /* @__PURE__ */ jsx(Dialog.Trigger, { asChild: true, children: trigger }),
424
+ /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
425
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: Modal_default.overlay }),
426
+ /* @__PURE__ */ jsxs(
427
+ Dialog.Content,
428
+ {
429
+ className: [Modal_default.content, Modal_default[size]].join(" "),
430
+ "aria-describedby": description ? "modal-description" : void 0,
431
+ children: [
432
+ /* @__PURE__ */ jsxs("div", { className: Modal_default.header, children: [
433
+ title && /* @__PURE__ */ jsx(Dialog.Title, { className: Modal_default.title, children: title }),
434
+ /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: Modal_default.close, "aria-label": "Fechar", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
435
+ "path",
436
+ {
437
+ d: "M2 2l12 12M14 2L2 14",
438
+ stroke: "currentColor",
439
+ strokeWidth: "2",
440
+ strokeLinecap: "round"
441
+ }
442
+ ) }) }) })
443
+ ] }),
444
+ description && /* @__PURE__ */ jsx(Dialog.Description, { id: "modal-description", className: Modal_default.description, children: description }),
445
+ /* @__PURE__ */ jsx("div", { className: Modal_default.body, children })
446
+ ]
447
+ }
448
+ )
449
+ ] })
450
+ ] });
451
+ Modal.displayName = "Modal";
452
+
453
+ // src/components/molecules/Drawer/Drawer.module.css
454
+ var Drawer_default = {};
455
+ var Drawer = ({
456
+ open,
457
+ onOpenChange,
458
+ title,
459
+ side = "right",
460
+ children,
461
+ trigger
462
+ }) => /* @__PURE__ */ jsxs(Dialog.Root, { open, onOpenChange, children: [
463
+ trigger && /* @__PURE__ */ jsx(Dialog.Trigger, { asChild: true, children: trigger }),
464
+ /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
465
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: Drawer_default.overlay }),
466
+ /* @__PURE__ */ jsxs(Dialog.Content, { className: [Drawer_default.content, Drawer_default[side]].join(" "), children: [
467
+ /* @__PURE__ */ jsxs("div", { className: Drawer_default.header, children: [
468
+ title && /* @__PURE__ */ jsx(Dialog.Title, { className: Drawer_default.title, children: title }),
469
+ /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: Drawer_default.close, "aria-label": "Fechar", children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
470
+ "path",
471
+ {
472
+ d: "M2 2l12 12M14 2L2 14",
473
+ stroke: "currentColor",
474
+ strokeWidth: "2",
475
+ strokeLinecap: "round"
476
+ }
477
+ ) }) }) })
478
+ ] }),
479
+ /* @__PURE__ */ jsx("div", { className: Drawer_default.body, children })
480
+ ] })
481
+ ] })
482
+ ] });
483
+ Drawer.displayName = "Drawer";
484
+
485
+ // src/components/molecules/Tabs/Tabs.module.css
486
+ var Tabs_default = {};
487
+ var Tabs = ({
488
+ tabs,
489
+ defaultValue,
490
+ value,
491
+ onValueChange,
492
+ className
493
+ }) => /* @__PURE__ */ jsxs(
494
+ RadixTabs.Root,
495
+ {
496
+ defaultValue: defaultValue ?? tabs[0]?.value,
497
+ value,
498
+ onValueChange,
499
+ className: [Tabs_default.root, className ?? ""].filter(Boolean).join(" "),
500
+ children: [
501
+ /* @__PURE__ */ jsx(RadixTabs.List, { className: Tabs_default.list, "aria-label": "Tabs", children: tabs.map((tab) => /* @__PURE__ */ jsx(
502
+ RadixTabs.Trigger,
503
+ {
504
+ value: tab.value,
505
+ disabled: tab.disabled,
506
+ className: Tabs_default.trigger,
507
+ children: tab.label
508
+ },
509
+ tab.value
510
+ )) }),
511
+ tabs.map((tab) => /* @__PURE__ */ jsx(RadixTabs.Content, { value: tab.value, className: Tabs_default.content, children: tab.content }, tab.value))
512
+ ]
513
+ }
514
+ );
515
+ Tabs.displayName = "Tabs";
516
+
517
+ // src/components/molecules/Accordion/Accordion.module.css
518
+ var Accordion_default = {};
519
+ var Accordion = ({
520
+ items,
521
+ type = "single",
522
+ defaultValue,
523
+ value,
524
+ onValueChange,
525
+ collapsible = true,
526
+ className
527
+ }) => {
528
+ const rootClassName = [Accordion_default.root, className ?? ""].filter(Boolean).join(" ");
529
+ const content = items.map((item) => /* @__PURE__ */ jsxs(
530
+ RadixAccordion.Item,
531
+ {
532
+ value: item.value,
533
+ disabled: item.disabled,
534
+ className: Accordion_default.item,
535
+ children: [
536
+ /* @__PURE__ */ jsx(RadixAccordion.Header, { children: /* @__PURE__ */ jsxs(RadixAccordion.Trigger, { className: Accordion_default.trigger, children: [
537
+ item.trigger,
538
+ /* @__PURE__ */ jsx(
539
+ "svg",
540
+ {
541
+ className: Accordion_default.chevron,
542
+ width: "14",
543
+ height: "9",
544
+ viewBox: "0 0 14 9",
545
+ fill: "none",
546
+ "aria-hidden": "true",
547
+ children: /* @__PURE__ */ jsx(
548
+ "path",
549
+ {
550
+ d: "M1 1l6 6 6-6",
551
+ stroke: "currentColor",
552
+ strokeWidth: "1.5",
553
+ strokeLinecap: "round",
554
+ strokeLinejoin: "round"
555
+ }
556
+ )
557
+ }
558
+ )
559
+ ] }) }),
560
+ /* @__PURE__ */ jsx(RadixAccordion.Content, { className: Accordion_default.content, children: /* @__PURE__ */ jsx("div", { className: Accordion_default.contentInner, children: item.content }) })
561
+ ]
562
+ },
563
+ item.value
564
+ ));
565
+ if (type === "multiple") {
566
+ return /* @__PURE__ */ jsx(
567
+ RadixAccordion.Root,
568
+ {
569
+ type: "multiple",
570
+ className: rootClassName,
571
+ defaultValue,
572
+ value,
573
+ onValueChange,
574
+ children: content
575
+ }
576
+ );
577
+ }
578
+ return /* @__PURE__ */ jsx(
579
+ RadixAccordion.Root,
580
+ {
581
+ type: "single",
582
+ collapsible,
583
+ className: rootClassName,
584
+ defaultValue,
585
+ value,
586
+ onValueChange,
587
+ children: content
588
+ }
589
+ );
590
+ };
591
+ Accordion.displayName = "Accordion";
592
+
593
+ // src/components/molecules/Toast/Toast.module.css
594
+ var Toast_default = {};
595
+ var ToastContext = createContext(null);
596
+ var useToast = () => {
597
+ const ctx = useContext(ToastContext);
598
+ if (!ctx) throw new Error("useToast must be used within ToastProvider");
599
+ return ctx;
600
+ };
601
+ var ToastProvider = ({ children }) => {
602
+ const [toasts, setToasts] = useState([]);
603
+ const show = useCallback((message) => {
604
+ const id = Math.random().toString(36).slice(2);
605
+ setToasts((prev) => [...prev, { ...message, id }]);
606
+ }, []);
607
+ const dismiss = useCallback((id) => {
608
+ setToasts((prev) => prev.filter((t) => t.id !== id));
609
+ }, []);
610
+ return /* @__PURE__ */ jsx(ToastContext.Provider, { value: { show }, children: /* @__PURE__ */ jsxs(RadixToast.Provider, { swipeDirection: "right", children: [
611
+ children,
612
+ toasts.map((toast) => /* @__PURE__ */ jsx(
613
+ RadixToast.Root,
614
+ {
615
+ duration: toast.duration ?? 4e3,
616
+ className: [Toast_default.root, Toast_default[toast.variant ?? "default"]].join(" "),
617
+ onOpenChange: (open) => {
618
+ if (!open) dismiss(toast.id);
619
+ },
620
+ children: /* @__PURE__ */ jsxs("div", { className: Toast_default.content, children: [
621
+ /* @__PURE__ */ jsxs("div", { className: Toast_default.text, children: [
622
+ /* @__PURE__ */ jsx(RadixToast.Title, { className: Toast_default.title, children: toast.title }),
623
+ toast.description && /* @__PURE__ */ jsx(RadixToast.Description, { className: Toast_default.description, children: toast.description })
624
+ ] }),
625
+ /* @__PURE__ */ jsx(RadixToast.Close, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: Toast_default.close, "aria-label": "Fechar notifica\xE7\xE3o", children: /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
626
+ "path",
627
+ {
628
+ d: "M1 1l10 10M11 1L1 11",
629
+ stroke: "currentColor",
630
+ strokeWidth: "1.5",
631
+ strokeLinecap: "round"
632
+ }
633
+ ) }) }) })
634
+ ] })
635
+ },
636
+ toast.id
637
+ )),
638
+ /* @__PURE__ */ jsx(RadixToast.Viewport, { className: Toast_default.viewport, "aria-label": "Notifica\xE7\xF5es", role: "region" })
639
+ ] }) });
640
+ };
641
+
642
+ // src/components/molecules/Table/Table.module.css
643
+ var Table_default = {};
644
+ var TableHead = ({ className, children, ...props }) => /* @__PURE__ */ jsx("thead", { className: [Table_default.head, className ?? ""].filter(Boolean).join(" "), ...props, children });
645
+ var TableBody = ({ className, children, ...props }) => /* @__PURE__ */ jsx("tbody", { className: [Table_default.body, className ?? ""].filter(Boolean).join(" "), ...props, children });
646
+ var TableRow = ({ className, children, ...props }) => /* @__PURE__ */ jsx("tr", { className: [Table_default.row, className ?? ""].filter(Boolean).join(" "), ...props, children });
647
+ var TableCell = ({
648
+ as: Tag = "td",
649
+ scope,
650
+ className,
651
+ children,
652
+ ...props
653
+ }) => {
654
+ const cellClass = [Tag === "th" ? Table_default.th : Table_default.td, className ?? ""].filter(Boolean).join(" ");
655
+ return /* @__PURE__ */ jsx(
656
+ Tag,
657
+ {
658
+ className: cellClass,
659
+ scope,
660
+ ...props,
661
+ children
662
+ }
663
+ );
664
+ };
665
+ var Table = ({ caption, stickyHeader, className, children, ...props }) => /* @__PURE__ */ jsx("div", { className: Table_default.wrapper, children: /* @__PURE__ */ jsxs(
666
+ "table",
667
+ {
668
+ className: [Table_default.table, stickyHeader ? Table_default.stickyHeader : "", className ?? ""].filter(Boolean).join(" "),
669
+ ...props,
670
+ children: [
671
+ caption && /* @__PURE__ */ jsx("caption", { className: Table_default.caption, children: caption }),
672
+ children
673
+ ]
674
+ }
675
+ ) });
676
+ Table.Head = TableHead;
677
+ Table.Body = TableBody;
678
+ Table.Row = TableRow;
679
+ Table.Cell = TableCell;
680
+ Table.displayName = "Table";
681
+
682
+ export { Accordion, Avatar, Badge, Button, Card, Checkbox, Drawer, Input, Modal, RadioGroup, Select, SocialIcons, Table, Tabs, Textarea, ToastProvider, Tooltip, TooltipProvider, useToast };
683
+ //# sourceMappingURL=index.mjs.map
684
+ //# sourceMappingURL=index.mjs.map