@rojaostudio/ds 1.0.2 → 2.0.0-next.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/README.md +75 -13
- package/dist/compat/generate.d.ts +0 -1
- package/dist/components/accordion.d.ts +30 -20
- package/dist/components/accordion.js +31 -93
- package/dist/components/action-bar.d.ts +24 -0
- package/dist/components/action-bar.js +55 -0
- package/dist/components/alert-dialog.d.ts +31 -0
- package/dist/components/alert-dialog.js +43 -0
- package/dist/components/alert.d.ts +31 -19
- package/dist/components/alert.js +67 -65
- package/dist/components/attachment.d.ts +37 -0
- package/dist/components/attachment.js +76 -0
- package/dist/components/avatar.d.ts +43 -36
- package/dist/components/avatar.js +59 -90
- package/dist/components/badge.d.ts +30 -41
- package/dist/components/badge.js +13 -110
- package/dist/components/banner.d.ts +27 -0
- package/dist/components/banner.js +66 -0
- package/dist/components/benefits.d.ts +30 -0
- package/dist/components/benefits.js +32 -0
- package/dist/components/breadcrumb.d.ts +25 -18
- package/dist/components/breadcrumb.js +38 -56
- package/dist/components/browser.d.ts +18 -0
- package/dist/components/browser.js +32 -0
- package/dist/components/bubble.d.ts +29 -0
- package/dist/components/bubble.js +33 -0
- package/dist/components/button-group.d.ts +19 -0
- package/dist/components/button-group.js +20 -0
- package/dist/components/button.d.ts +47 -20
- package/dist/components/button.js +45 -108
- package/dist/components/calendar.d.ts +29 -0
- package/dist/components/calendar.js +149 -0
- package/dist/components/card.d.ts +47 -19
- package/dist/components/card.js +31 -46
- package/dist/components/carousel.d.ts +28 -0
- package/dist/components/carousel.js +130 -0
- package/dist/components/chart.d.ts +49 -0
- package/dist/components/chart.js +258 -0
- package/dist/components/checkbox-group.d.ts +16 -0
- package/dist/components/checkbox-group.js +13 -0
- package/dist/components/checkbox.d.ts +25 -10
- package/dist/components/checkbox.js +87 -81
- package/dist/components/chip-input.d.ts +46 -20
- package/dist/components/chip-input.js +172 -176
- package/dist/components/chip.d.ts +28 -0
- package/dist/components/chip.js +73 -0
- package/dist/components/choice-card.d.ts +10 -13
- package/dist/components/choice-card.js +11 -62
- package/dist/components/choice-carousel.d.ts +9 -0
- package/dist/components/choice-carousel.js +28 -44
- package/dist/components/choice-preview-card.d.ts +10 -20
- package/dist/components/choice-preview-card.js +12 -40
- package/dist/components/color-input.d.ts +36 -11
- package/dist/components/color-input.js +131 -59
- package/dist/components/combobox.d.ts +60 -57
- package/dist/components/combobox.js +210 -213
- package/dist/components/command.d.ts +58 -0
- package/dist/components/command.js +177 -0
- package/dist/components/contact.d.ts +23 -0
- package/dist/components/contact.js +32 -0
- package/dist/components/context-menu.d.ts +34 -26
- package/dist/components/context-menu.js +41 -68
- package/dist/components/copy-field.d.ts +10 -5
- package/dist/components/copy-field.js +24 -29
- package/dist/components/currency-input.d.ts +25 -11
- package/dist/components/currency-input.js +29 -65
- package/dist/components/danger-zone.d.ts +10 -1
- package/dist/components/danger-zone.js +14 -18
- package/dist/components/data-table-header.d.ts +13 -2
- package/dist/components/data-table-header.js +114 -190
- package/dist/components/date-picker.d.ts +31 -32
- package/dist/components/date-picker.js +119 -254
- package/dist/components/delta.d.ts +26 -0
- package/dist/components/delta.js +24 -0
- package/dist/components/dialog.d.ts +21 -0
- package/dist/components/dialog.js +16 -0
- package/dist/components/drawer.d.ts +15 -23
- package/dist/components/drawer.js +57 -89
- package/dist/components/dropdown-menu.d.ts +63 -0
- package/dist/components/dropdown-menu.js +62 -0
- package/dist/components/dropzone.d.ts +10 -4
- package/dist/components/dropzone.js +30 -58
- package/dist/components/empty.d.ts +29 -0
- package/dist/components/empty.js +42 -0
- package/dist/components/fab.d.ts +29 -6
- package/dist/components/fab.js +51 -51
- package/dist/components/faq.d.ts +21 -0
- package/dist/components/faq.js +24 -0
- package/dist/components/file-input.d.ts +56 -0
- package/dist/components/file-input.js +244 -0
- package/dist/components/filter-chip.d.ts +34 -47
- package/dist/components/filter-chip.js +61 -61
- package/dist/components/floating-stepper.d.ts +7 -18
- package/dist/components/floating-stepper.js +27 -55
- package/dist/components/footer.d.ts +36 -0
- package/dist/components/footer.js +38 -0
- package/dist/components/form-actions.d.ts +28 -0
- package/dist/components/form-actions.js +24 -0
- package/dist/components/google-account-chooser.d.ts +25 -0
- package/dist/components/google-account-chooser.js +44 -0
- package/dist/components/google-button.d.ts +26 -0
- package/dist/components/google-button.js +38 -0
- package/dist/components/google-consent.d.ts +23 -0
- package/dist/components/google-consent.js +28 -0
- package/dist/components/google-sign-in.d.ts +26 -0
- package/dist/components/google-sign-in.js +36 -0
- package/dist/components/hover-card.d.ts +30 -0
- package/dist/components/hover-card.js +55 -0
- package/dist/components/icon-button.d.ts +41 -11
- package/dist/components/icon-button.js +44 -64
- package/dist/components/image-crop-modal.d.ts +3 -3
- package/dist/components/image-crop-modal.js +32 -39
- package/dist/components/image-upload.d.ts +21 -29
- package/dist/components/image-upload.js +55 -259
- package/dist/components/index.d.ts +105 -49
- package/dist/components/index.js +190 -68
- package/dist/components/input-otp.d.ts +35 -0
- package/dist/components/input-otp.js +119 -0
- package/dist/components/input.d.ts +23 -17
- package/dist/components/input.js +104 -137
- package/dist/components/insight-card.d.ts +25 -9
- package/dist/components/insight-card.js +42 -27
- package/dist/components/internal/announce.d.ts +3 -0
- package/dist/components/internal/announce.js +20 -0
- package/dist/components/internal/block.d.ts +15 -0
- package/dist/components/internal/block.js +14 -0
- package/dist/components/internal/button.d.ts +23 -0
- package/dist/components/internal/button.js +30 -0
- package/dist/components/internal/choice-card.d.ts +52 -0
- package/dist/components/internal/choice-card.js +117 -0
- package/dist/components/internal/choice.d.ts +25 -0
- package/dist/components/internal/choice.js +44 -0
- package/dist/components/internal/dates.d.ts +17 -0
- package/dist/components/internal/dates.js +59 -0
- package/dist/components/internal/field.d.ts +66 -0
- package/dist/components/internal/field.js +105 -0
- package/dist/components/internal/fieldset.d.ts +25 -0
- package/dist/components/internal/fieldset.js +56 -0
- package/dist/components/internal/focus-after.d.ts +3 -0
- package/dist/components/internal/focus-after.js +13 -0
- package/dist/components/internal/google.d.ts +47 -0
- package/dist/components/internal/google.js +73 -0
- package/dist/components/internal/icons.d.ts +108 -0
- package/dist/components/internal/icons.js +316 -0
- package/dist/components/internal/menu.d.ts +16 -0
- package/dist/components/internal/menu.js +14 -0
- package/dist/components/internal/modal.d.ts +50 -0
- package/dist/components/internal/modal.js +85 -0
- package/dist/components/internal/option-content.d.ts +10 -0
- package/dist/components/internal/option-content.js +13 -0
- package/dist/components/internal/radio-context.d.ts +16 -0
- package/dist/components/internal/radio-context.js +6 -0
- package/dist/components/internal/toggle.d.ts +7 -0
- package/dist/components/internal/toggle.js +13 -0
- package/dist/components/internal/use-listbox.d.ts +56 -0
- package/dist/components/internal/use-listbox.js +69 -0
- package/dist/components/internal/whatsapp.d.ts +8 -0
- package/dist/components/internal/whatsapp.js +12 -0
- package/dist/components/item.d.ts +32 -0
- package/dist/components/item.js +35 -0
- package/dist/components/kbd.d.ts +17 -0
- package/dist/components/kbd.js +18 -0
- package/dist/components/listbox.d.ts +34 -0
- package/dist/components/listbox.js +114 -0
- package/dist/components/marker.d.ts +24 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/media-tile.d.ts +17 -14
- package/dist/components/media-tile.js +19 -27
- package/dist/components/message-scroller.d.ts +20 -0
- package/dist/components/message-scroller.js +108 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +23 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +30 -0
- package/dist/components/newsletter.d.ts +27 -0
- package/dist/components/newsletter.js +75 -0
- package/dist/components/number-input.d.ts +60 -0
- package/dist/components/number-input.js +234 -0
- package/dist/components/option-tile.d.ts +20 -19
- package/dist/components/option-tile.js +52 -137
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.js +25 -0
- package/dist/components/page-shell.d.ts +11 -1
- package/dist/components/page-shell.js +8 -34
- package/dist/components/page-skeleton.d.ts +15 -21
- package/dist/components/page-skeleton.js +28 -25
- package/dist/components/pagination.d.ts +32 -22
- package/dist/components/pagination.js +78 -76
- package/dist/components/password-input.d.ts +26 -0
- package/dist/components/password-input.js +112 -0
- package/dist/components/phone-input.d.ts +12 -8
- package/dist/components/phone-input.js +75 -64
- package/dist/components/phone.d.ts +27 -0
- package/dist/components/phone.js +35 -0
- package/dist/components/popover.d.ts +25 -36
- package/dist/components/popover.js +30 -131
- package/dist/components/pricing-card.d.ts +9 -25
- package/dist/components/pricing-card.js +9 -40
- package/dist/components/pricing.d.ts +48 -0
- package/dist/components/pricing.js +64 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.js +57 -0
- package/dist/components/qr-display.d.ts +11 -6
- package/dist/components/qr-display.js +6 -22
- package/dist/components/questionnaire.d.ts +42 -0
- package/dist/components/questionnaire.js +107 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.js +40 -0
- package/dist/components/radio.d.ts +15 -29
- package/dist/components/radio.js +45 -103
- package/dist/components/row-actions.d.ts +5 -0
- package/dist/components/row-actions.js +27 -34
- package/dist/components/saving-bar-context.d.ts +0 -5
- package/dist/components/saving-bar-context.js +16 -40
- package/dist/components/saving-bar.d.ts +26 -11
- package/dist/components/saving-bar.js +50 -65
- package/dist/components/section-card.d.ts +18 -4
- package/dist/components/section-card.js +29 -50
- package/dist/components/section-header.d.ts +8 -12
- package/dist/components/section-header.js +5 -10
- package/dist/components/select.d.ts +44 -16
- package/dist/components/select.js +83 -154
- package/dist/components/selectable-card.d.ts +11 -19
- package/dist/components/selectable-card.js +4 -28
- package/dist/components/separator.d.ts +20 -0
- package/dist/components/separator.js +19 -0
- package/dist/components/setting-row.d.ts +11 -15
- package/dist/components/setting-row.js +10 -23
- package/dist/components/settings-list.d.ts +10 -12
- package/dist/components/settings-list.js +7 -19
- package/dist/components/sheet.d.ts +21 -0
- package/dist/components/sheet.js +16 -0
- package/dist/components/sidebar.d.ts +79 -0
- package/dist/components/sidebar.js +111 -0
- package/dist/components/skeleton.d.ts +14 -20
- package/dist/components/skeleton.js +8 -37
- package/dist/components/slider.d.ts +21 -23
- package/dist/components/slider.js +59 -64
- package/dist/components/sparkline.d.ts +19 -0
- package/dist/components/sparkline.js +32 -0
- package/dist/components/spinner.d.ts +16 -8
- package/dist/components/spinner.js +34 -37
- package/dist/components/star-rating.d.ts +22 -0
- package/dist/components/star-rating.js +25 -0
- package/dist/components/stat.d.ts +33 -0
- package/dist/components/stat.js +29 -0
- package/dist/components/status.d.ts +27 -0
- package/dist/components/status.js +34 -0
- package/dist/components/step-progress.d.ts +13 -6
- package/dist/components/step-progress.js +18 -16
- package/dist/components/summary-bar.d.ts +20 -20
- package/dist/components/summary-bar.js +13 -55
- package/dist/components/switch.d.ts +20 -0
- package/dist/components/switch.js +46 -0
- package/dist/components/table.d.ts +56 -17
- package/dist/components/table.js +59 -58
- package/dist/components/tabs.d.ts +67 -0
- package/dist/components/tabs.js +56 -0
- package/dist/components/testimonial.d.ts +30 -0
- package/dist/components/testimonial.js +36 -0
- package/dist/components/textarea.d.ts +11 -16
- package/dist/components/textarea.js +55 -91
- package/dist/components/tile.d.ts +24 -0
- package/dist/components/tile.js +21 -0
- package/dist/components/time-picker.d.ts +40 -25
- package/dist/components/time-picker.js +185 -203
- package/dist/components/toast.d.ts +63 -0
- package/dist/components/toast.js +132 -0
- package/dist/components/toggle-card-compact.d.ts +15 -5
- package/dist/components/toggle-card-compact.js +19 -86
- package/dist/components/toggle-card.d.ts +11 -2
- package/dist/components/toggle-card.js +8 -77
- package/dist/components/toggle-group.d.ts +21 -59
- package/dist/components/toggle-group.js +31 -80
- package/dist/components/toggle.d.ts +19 -9
- package/dist/components/toggle.js +16 -61
- package/dist/components/tooltip.d.ts +25 -12
- package/dist/components/tooltip.js +15 -88
- package/dist/components/top-navigation.d.ts +33 -0
- package/dist/components/top-navigation.js +85 -0
- package/dist/components/typing-indicator.d.ts +6 -0
- package/dist/components/typing-indicator.js +3 -24
- package/dist/components/whatsapp-chat.d.ts +28 -0
- package/dist/components/whatsapp-chat.js +95 -0
- package/dist/components/whatsapp-message.d.ts +22 -0
- package/dist/components/whatsapp-message.js +34 -0
- package/dist/components/whatsapp-notification.d.ts +27 -0
- package/dist/components/whatsapp-notification.js +73 -0
- package/dist/components/whatsapp-template.d.ts +42 -0
- package/dist/components/whatsapp-template.js +69 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/pix.d.ts +16 -0
- package/dist/targets/native/components/index.d.ts +0 -2
- package/dist/targets/native/components/index.js +0 -4
- package/dist/targets/native/preset.cjs +0 -1
- package/dist/targets/native/theme.css +58 -60
- package/dist/targets/native/theme.d.ts +58 -60
- package/dist/targets/native/theme.js +58 -60
- package/package.json +34 -12
- package/styles/_primitives.generated.css +40 -0
- package/styles/base.css +12 -18
- package/styles/rds/components-styles.css +11365 -0
- package/styles/rds/components.css +993 -0
- package/styles/rds/foundation.css +74 -0
- package/styles/rds/theme.css +261 -0
- package/styles/rds.css +6 -0
- package/styles/themes/rojao.css +46 -53
- package/dist/components/blocker-card.d.ts +0 -42
- package/dist/components/blocker-card.js +0 -54
- package/dist/components/bottom-sheet.d.ts +0 -31
- package/dist/components/bottom-sheet.js +0 -127
- package/dist/components/chat-bubble.d.ts +0 -16
- package/dist/components/chat-bubble.js +0 -56
- package/dist/components/chips.d.ts +0 -22
- package/dist/components/chips.js +0 -101
- package/dist/components/copilot-hint.d.ts +0 -18
- package/dist/components/copilot-hint.js +0 -72
- package/dist/components/divider.d.ts +0 -20
- package/dist/components/divider.js +0 -50
- package/dist/components/empty-state.d.ts +0 -48
- package/dist/components/empty-state.js +0 -94
- package/dist/components/form-card-header.d.ts +0 -13
- package/dist/components/form-card-header.js +0 -16
- package/dist/components/label.d.ts +0 -16
- package/dist/components/label.js +0 -48
- package/dist/components/menu.d.ts +0 -50
- package/dist/components/menu.js +0 -83
- package/dist/components/modal.d.ts +0 -25
- package/dist/components/modal.js +0 -86
- package/dist/components/notice.d.ts +0 -50
- package/dist/components/notice.js +0 -121
- package/dist/components/page-tabs.d.ts +0 -35
- package/dist/components/page-tabs.js +0 -68
- package/dist/components/paywall-banner.d.ts +0 -37
- package/dist/components/paywall-banner.js +0 -58
- package/dist/components/paywall.d.ts +0 -44
- package/dist/components/paywall.js +0 -65
- package/dist/components/phone-frame.d.ts +0 -9
- package/dist/components/phone-frame.js +0 -19
- package/dist/components/pix-icon.d.ts +0 -8
- package/dist/components/search.d.ts +0 -30
- package/dist/components/search.js +0 -86
- package/dist/components/themed.d.ts +0 -36
- package/dist/components/themed.js +0 -23
- package/dist/components/toaster.d.ts +0 -84
- package/dist/components/toaster.js +0 -290
- package/dist/components/use-dismiss.d.ts +0 -9
- package/dist/components/use-dismiss.js +0 -28
- package/dist/components/use-focus-trap.d.ts +0 -5
- package/dist/components/use-focus-trap.js +0 -54
- package/dist/targets/native/components/paywall-banner.d.ts +0 -11
- package/dist/targets/native/components/paywall-banner.js +0 -55
- package/dist/targets/native/components/paywall.d.ts +0 -18
- package/dist/targets/native/components/paywall.js +0 -71
- /package/dist/{components/pix-icon.js → icons/pix.js} +0 -0
package/dist/components/badge.js
CHANGED
|
@@ -3,119 +3,22 @@ import {
|
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../chunk-ORMEWXMH.js";
|
|
6
|
-
import { jsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
danger: "bg-danger-soft text-danger-text border border-danger-border",
|
|
14
|
-
info: "bg-info-soft text-info-text border border-info-border",
|
|
15
|
-
neutral: "bg-neutral-soft text-neutral-text border border-neutral-border"
|
|
16
|
-
};
|
|
17
|
-
const STATUS_VARIANTS = {
|
|
18
|
-
active: { dot: "bg-success", text: "text-success-text" },
|
|
19
|
-
inactive: { dot: "bg-state-disabled-text", text: "text-state-disabled-text" },
|
|
20
|
-
pending: { dot: "bg-warning", text: "text-warning-text" },
|
|
21
|
-
error: { dot: "bg-danger", text: "text-danger-text" }
|
|
22
|
-
};
|
|
23
|
-
const BASE = "inline-flex items-center rounded-(--radius-badge) font-medium transition-colors";
|
|
24
|
-
const SIZE_CLASS = {
|
|
25
|
-
sm: "text-[10px]",
|
|
26
|
-
md: "text-caption"
|
|
27
|
-
};
|
|
28
|
-
const DOT_BG = {
|
|
29
|
-
brand: "bg-brand-primary",
|
|
30
|
-
success: "bg-success",
|
|
31
|
-
warning: "bg-warning",
|
|
32
|
-
danger: "bg-danger",
|
|
33
|
-
info: "bg-info",
|
|
34
|
-
neutral: "bg-neutral"
|
|
35
|
-
};
|
|
36
|
-
const Badge = forwardRef(function Badge2(_a, ref) {
|
|
37
|
-
var _b = _a, {
|
|
38
|
-
variant = "default",
|
|
39
|
-
size = "md",
|
|
40
|
-
count,
|
|
41
|
-
max = 99,
|
|
42
|
-
dotColor = "brand",
|
|
43
|
-
className = "",
|
|
44
|
-
children
|
|
45
|
-
} = _b, props = __objRest(_b, [
|
|
46
|
-
"variant",
|
|
47
|
-
"size",
|
|
48
|
-
"count",
|
|
49
|
-
"max",
|
|
50
|
-
"dotColor",
|
|
51
|
-
"className",
|
|
52
|
-
"children"
|
|
53
|
-
]);
|
|
54
|
-
if (variant === "dot") {
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
-
"span",
|
|
57
|
-
__spreadValues({
|
|
58
|
-
ref,
|
|
59
|
-
role: "status",
|
|
60
|
-
className: [
|
|
61
|
-
"inline-block rounded-full",
|
|
62
|
-
size === "sm" ? "size-2" : "size-2.5",
|
|
63
|
-
DOT_BG[dotColor],
|
|
64
|
-
className
|
|
65
|
-
].join(" ")
|
|
66
|
-
}, props)
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
if (variant === "count") {
|
|
70
|
-
const display = count !== void 0 ? count > max ? `${max}+` : String(count) : children;
|
|
71
|
-
if (count !== void 0 && count <= 0) return null;
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
-
"span",
|
|
74
|
-
__spreadProps(__spreadValues({
|
|
75
|
-
ref,
|
|
76
|
-
className: [
|
|
77
|
-
BASE,
|
|
78
|
-
SIZE_CLASS[size],
|
|
79
|
-
size === "sm" ? "min-w-[16px] h-4 px-1" : "min-w-[20px] h-5 px-1.5",
|
|
80
|
-
"bg-brand-primary text-brand-on-primary justify-center tabular-nums",
|
|
81
|
-
className
|
|
82
|
-
].join(" ")
|
|
83
|
-
}, props), {
|
|
84
|
-
children: display
|
|
85
|
-
})
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
if (variant in STATUS_VARIANTS) {
|
|
89
|
-
const { dot, text } = STATUS_VARIANTS[variant];
|
|
90
|
-
return /* @__PURE__ */ jsxs(
|
|
91
|
-
"span",
|
|
92
|
-
__spreadProps(__spreadValues({
|
|
93
|
-
ref,
|
|
94
|
-
className: [BASE, SIZE_CLASS[size], "gap-1.5", text, className].join(" ")
|
|
95
|
-
}, props), {
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ jsx("span", { className: ["shrink-0 size-1.5 rounded-full", dot].join(" "), "aria-hidden": "true" }),
|
|
98
|
-
children
|
|
99
|
-
]
|
|
100
|
-
})
|
|
101
|
-
);
|
|
102
|
-
}
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function formatBadgeValue(value) {
|
|
8
|
+
return value > 99 ? "99+" : String(value);
|
|
9
|
+
}
|
|
10
|
+
function Badge(_a) {
|
|
11
|
+
var _b = _a, { tone = "neutral", variant = "fill", value, children, className } = _b, rest = __objRest(_b, ["tone", "variant", "value", "children", "className"]);
|
|
12
|
+
const isNumber = value !== void 0;
|
|
103
13
|
return /* @__PURE__ */ jsx(
|
|
104
14
|
"span",
|
|
105
|
-
__spreadProps(__spreadValues({
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
BASE,
|
|
109
|
-
SIZE_CLASS[size],
|
|
110
|
-
size === "sm" ? "px-1.5 py-px" : "px-2 py-0.5",
|
|
111
|
-
LABEL_VARIANTS[variant],
|
|
112
|
-
className
|
|
113
|
-
].join(" ")
|
|
114
|
-
}, props), {
|
|
115
|
-
children
|
|
15
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
16
|
+
className: ["rds-badge", `rds-badge--${tone}-${variant}`, isNumber && "rds-badge--number", className].filter(Boolean).join(" "),
|
|
17
|
+
children: isNumber ? formatBadgeValue(value) : children
|
|
116
18
|
})
|
|
117
19
|
);
|
|
118
|
-
}
|
|
20
|
+
}
|
|
119
21
|
export {
|
|
120
|
-
Badge
|
|
22
|
+
Badge,
|
|
23
|
+
formatBadgeValue
|
|
121
24
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface BannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Decorative (Figma: `showIcon` + `icon`). By default a megaphone; `null` hides it. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** The highlight before the message, such as "Novidade:" (Figma: `highlight`). */
|
|
8
|
+
highlight?: ReactNode;
|
|
9
|
+
/** The message, one short line (Figma: `message`). */
|
|
10
|
+
message: ReactNode;
|
|
11
|
+
/** An action ghost Button, or a link through Button asChild (Figma: `showAction`). */
|
|
12
|
+
action?: ReactNode;
|
|
13
|
+
/** Shows the × (Figma: `showClose`). The Banner hides itself, calls this, and the focus moves on. */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/** The ×'s accessible name. */
|
|
16
|
+
closeLabel?: string;
|
|
17
|
+
/** Names the strip for screen readers (a region landmark). */
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Banner — Figma [RDS] Blocks/Banner. The notice strip on top of the site: a short piece of news. An error or a
|
|
22
|
+
* status is the Alert. Below 640 of container width the text and the action stack (Figma: screen=mobile).
|
|
23
|
+
* Styles: banner.css.
|
|
24
|
+
*/
|
|
25
|
+
declare function Banner({ icon, highlight, message, action, onClose, closeLabel, label, className, ...rest }: BannerProps): react.JSX.Element | null;
|
|
26
|
+
|
|
27
|
+
export { Banner, type BannerProps };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useRef, useState } from "react";
|
|
9
|
+
import { IconButton } from "./icon-button.js";
|
|
10
|
+
import { Tooltip } from "./tooltip.js";
|
|
11
|
+
import { focusAfter } from "./internal/focus-after.js";
|
|
12
|
+
import { CloseIcon, MegaphoneIcon } from "./internal/icons.js";
|
|
13
|
+
function Banner(_a) {
|
|
14
|
+
var _b = _a, {
|
|
15
|
+
icon = /* @__PURE__ */ jsx(MegaphoneIcon, {}),
|
|
16
|
+
highlight,
|
|
17
|
+
message,
|
|
18
|
+
action,
|
|
19
|
+
onClose,
|
|
20
|
+
closeLabel = "Fechar aviso",
|
|
21
|
+
label = "Aviso",
|
|
22
|
+
className
|
|
23
|
+
} = _b, rest = __objRest(_b, [
|
|
24
|
+
"icon",
|
|
25
|
+
"highlight",
|
|
26
|
+
"message",
|
|
27
|
+
"action",
|
|
28
|
+
"onClose",
|
|
29
|
+
"closeLabel",
|
|
30
|
+
"label",
|
|
31
|
+
"className"
|
|
32
|
+
]);
|
|
33
|
+
const [open, setOpen] = useState(true);
|
|
34
|
+
const ref = useRef(null);
|
|
35
|
+
if (!open) return null;
|
|
36
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ ref, role: "region", "aria-label": label }, rest), { className: ["rds-banner", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("div", { className: "rds-banner__inner", children: [
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-banner__content", children: [
|
|
38
|
+
icon && /* @__PURE__ */ jsx("span", { className: "rds-banner__icon", "aria-hidden": "true", children: icon }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-banner__body", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("p", { className: "rds-banner__text", children: [
|
|
41
|
+
highlight && /* @__PURE__ */ jsx("strong", { className: "rds-banner__highlight", children: highlight }),
|
|
42
|
+
highlight && " ",
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "rds-banner__message", children: message })
|
|
44
|
+
] }),
|
|
45
|
+
action && /* @__PURE__ */ jsx("div", { className: "rds-banner__action", children: action })
|
|
46
|
+
] })
|
|
47
|
+
] }),
|
|
48
|
+
onClose && /* @__PURE__ */ jsx(Tooltip, { text: closeLabel, children: /* @__PURE__ */ jsx(
|
|
49
|
+
IconButton,
|
|
50
|
+
{
|
|
51
|
+
icon: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
52
|
+
label: closeLabel,
|
|
53
|
+
tone: "neutral",
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
onClick: () => {
|
|
56
|
+
focusAfter(ref.current);
|
|
57
|
+
setOpen(false);
|
|
58
|
+
onClose();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
) })
|
|
62
|
+
] }) }));
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
Banner
|
|
66
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface BenefitsProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
5
|
+
/** A short label above the title (Figma: `eyebrow`). */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
/** The block's title, an h2 that names the section (Figma: `title`). */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** 3 to 6 BenefitsItem (Figma: slot `items`): 3 per row, one column below 640 of container width. */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Benefits — Figma [RDS] Blocks/Benefits. The benefits of a public page: label, title, a sentence and a grid of
|
|
15
|
+
* reasons to use the product. Adapts to the width of its container (Figma: `screen`). Styles: benefits.css.
|
|
16
|
+
*/
|
|
17
|
+
declare function Benefits({ eyebrow, title, description, children, className, ...rest }: BenefitsProps): react.JSX.Element;
|
|
18
|
+
interface BenefitsItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'title'> {
|
|
19
|
+
/** Decorative, in the 40 plate (Figma: `icon`). */
|
|
20
|
+
icon: ReactNode;
|
|
21
|
+
/** An h3 (Figma: `title`). */
|
|
22
|
+
title: ReactNode;
|
|
23
|
+
description: ReactNode;
|
|
24
|
+
/** An action ghost Button, a link through asChild (Figma: `showLink`). */
|
|
25
|
+
link?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/** One card of the Benefits (Figma: .benefits/item). Only inside a Benefits. */
|
|
28
|
+
declare function BenefitsItem({ icon, title, description, link, className, ...rest }: BenefitsItemProps): react.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Benefits, BenefitsItem, type BenefitsItemProps, type BenefitsProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useId } from "react";
|
|
9
|
+
import { BlockHeading } from "./internal/block.js";
|
|
10
|
+
function Benefits(_a) {
|
|
11
|
+
var _b = _a, { eyebrow, title, description, children, className } = _b, rest = __objRest(_b, ["eyebrow", "title", "description", "children", "className"]);
|
|
12
|
+
const titleId = useId();
|
|
13
|
+
return /* @__PURE__ */ jsx("section", __spreadProps(__spreadValues({ "aria-labelledby": titleId }, rest), { className: ["rds-block", "rds-benefits", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("div", { className: "rds-block__inner", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(BlockHeading, { eyebrow, title, description, titleId }),
|
|
15
|
+
/* @__PURE__ */ jsx("ul", { className: "rds-benefits__items", children })
|
|
16
|
+
] }) }));
|
|
17
|
+
}
|
|
18
|
+
function BenefitsItem(_c) {
|
|
19
|
+
var _d = _c, { icon, title, description, link, className } = _d, rest = __objRest(_d, ["icon", "title", "description", "link", "className"]);
|
|
20
|
+
return /* @__PURE__ */ jsxs("li", __spreadProps(__spreadValues({}, rest), { className: ["rds-benefits__item", className].filter(Boolean).join(" "), children: [
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "rds-benefits__icon", "aria-hidden": "true", children: icon }),
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-benefits__text", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("h3", { className: "rds-benefits__item-title", children: title }),
|
|
24
|
+
/* @__PURE__ */ jsx("p", { className: "rds-benefits__item-description", children: description })
|
|
25
|
+
] }),
|
|
26
|
+
link && /* @__PURE__ */ jsx("div", { className: "rds-benefits__link", children: link })
|
|
27
|
+
] }));
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
Benefits,
|
|
31
|
+
BenefitsItem
|
|
32
|
+
};
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { HTMLAttributes, ComponentType, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface BreadcrumbItem {
|
|
5
5
|
label: string;
|
|
6
|
+
/** Where the step leads. The last step is the current page and never gets a link. */
|
|
6
7
|
href?: string;
|
|
7
|
-
/** Ícone leading opcional (ex: Home no primeiro item). */
|
|
8
|
-
icon?: ReactNode;
|
|
9
8
|
}
|
|
10
|
-
|
|
9
|
+
type BreadcrumbTone = 'default' | 'inverse';
|
|
10
|
+
type BreadcrumbLinkComponent = ComponentType<{
|
|
11
|
+
href: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
interface BreadcrumbProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
16
|
+
/** The path, from the most general to the current page, the last one (Figma: the `items` slot). */
|
|
11
17
|
items: BreadcrumbItem[];
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* default on a light surface; inverse over colors/primary. Deprecated in the Figma since 27/09/2026: for the brand
|
|
20
|
+
* colour, put the Breadcrumb in a brand-mode scope and keep the default tone.
|
|
21
|
+
*/
|
|
22
|
+
tone?: BreadcrumbTone;
|
|
23
|
+
/** More steps than this: the middle ones hide behind "…", a button that shows the whole path. */
|
|
15
24
|
maxItems?: number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
linkAs?: React.ComponentType<{
|
|
19
|
-
href: string;
|
|
20
|
-
className?: string;
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}>;
|
|
25
|
+
/** The link element (default `<a>`). Pass a framework Link (Next's `Link`) to navigate on the client. */
|
|
26
|
+
linkAs?: BreadcrumbLinkComponent;
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Breadcrumb — Figma [RDS] Navigation/Breadcrumb. The path to the current page: a <nav aria-label="Caminho"> with an
|
|
30
|
+
* <ol>; the current step has aria-current="page" and no link; the arrows are hidden from screen readers.
|
|
31
|
+
* Styles: breadcrumb.css.
|
|
32
|
+
*/
|
|
33
|
+
declare function Breadcrumb({ items, tone, maxItems, linkAs: Link, className, ...rest }: BreadcrumbProps): react.JSX.Element;
|
|
27
34
|
|
|
28
|
-
export { Breadcrumb, type BreadcrumbItem, type BreadcrumbProps,
|
|
35
|
+
export { Breadcrumb, type BreadcrumbItem, type BreadcrumbLinkComponent, type BreadcrumbProps, type BreadcrumbTone };
|
|
@@ -1,62 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
2
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
|
|
8
|
+
import { useRef, useState } from "react";
|
|
9
|
+
import { ChevronRightIcon } from "./internal/icons.js";
|
|
10
|
+
function Anchor({ href, className, children }) {
|
|
5
11
|
return /* @__PURE__ */ jsx("a", { href, className, children });
|
|
6
12
|
}
|
|
7
|
-
function Breadcrumb({
|
|
8
|
-
items,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
] });
|
|
36
|
-
return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-1.5", children: [
|
|
37
|
-
item.href && !isLast ? /* @__PURE__ */ jsx(
|
|
38
|
-
LinkAs,
|
|
39
|
-
{
|
|
40
|
-
href: item.href,
|
|
41
|
-
className: "text-fg-muted hover:text-fg-primary transition-colors",
|
|
42
|
-
children: labelEl
|
|
43
|
-
}
|
|
44
|
-
) : /* @__PURE__ */ jsx(
|
|
45
|
-
"span",
|
|
46
|
-
{
|
|
47
|
-
className: isLast ? "text-fg-primary font-medium" : "text-fg-muted",
|
|
48
|
-
"aria-current": isLast ? "page" : void 0,
|
|
49
|
-
children: labelEl
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
!isLast && sep
|
|
53
|
-
] }, idx);
|
|
54
|
-
}) }) });
|
|
55
|
-
}
|
|
56
|
-
function homeItem(href = "/") {
|
|
57
|
-
return { label: "In\xEDcio", href, icon: /* @__PURE__ */ jsx(Home, { size: 14 }) };
|
|
13
|
+
function Breadcrumb(_a) {
|
|
14
|
+
var _b = _a, { items, tone = "default", maxItems = 4, linkAs: Link = Anchor, className } = _b, rest = __objRest(_b, ["items", "tone", "maxItems", "linkAs", "className"]);
|
|
15
|
+
const [expanded, setExpanded] = useState(false);
|
|
16
|
+
const list = useRef(null);
|
|
17
|
+
const collapse = !expanded && items.length > maxItems;
|
|
18
|
+
const shown = collapse ? [items[0], "ellipsis", ...items.slice(-2)] : items;
|
|
19
|
+
const expand = () => {
|
|
20
|
+
setExpanded(true);
|
|
21
|
+
requestAnimationFrame(() => {
|
|
22
|
+
var _a2, _b2, _c;
|
|
23
|
+
return (_c = (_b2 = (_a2 = list.current) == null ? void 0 : _a2.children[1]) == null ? void 0 : _b2.querySelector("a")) == null ? void 0 : _c.focus();
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"nav",
|
|
28
|
+
__spreadProps(__spreadValues({
|
|
29
|
+
"aria-label": "Caminho"
|
|
30
|
+
}, rest), {
|
|
31
|
+
className: ["rds-breadcrumb", tone === "inverse" && "rds-breadcrumb--inverse", className].filter(Boolean).join(" "),
|
|
32
|
+
children: /* @__PURE__ */ jsx("ol", { ref: list, className: "rds-breadcrumb__list", children: shown.map((step, index) => {
|
|
33
|
+
const last = index === shown.length - 1;
|
|
34
|
+
return /* @__PURE__ */ jsxs("li", { className: "rds-breadcrumb__item", children: [
|
|
35
|
+
step === "ellipsis" ? /* @__PURE__ */ jsx("button", { type: "button", className: "rds-breadcrumb__link", "aria-label": "Mostrar o caminho completo", onClick: expand, children: "\u2026" }) : last ? /* @__PURE__ */ jsx("span", { className: "rds-breadcrumb__link rds-breadcrumb__link--current", "aria-current": "page", children: step.label }) : step.href ? /* @__PURE__ */ jsx(Link, { href: step.href, className: "rds-breadcrumb__link", children: step.label }) : /* @__PURE__ */ jsx("span", { className: "rds-breadcrumb__link", children: step.label }),
|
|
36
|
+
!last && /* @__PURE__ */ jsx("span", { className: "rds-breadcrumb__separator", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) })
|
|
37
|
+
] }, step === "ellipsis" ? "ellipsis" : `${index}-${step.label}`);
|
|
38
|
+
}) })
|
|
39
|
+
})
|
|
40
|
+
);
|
|
58
41
|
}
|
|
59
42
|
export {
|
|
60
|
-
Breadcrumb
|
|
61
|
-
homeItem
|
|
43
|
+
Breadcrumb
|
|
62
44
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface BrowserProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** The page (Figma: slot `screen`): the useful area, 1278 × 746 at full size. It scrolls when taller. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** The address in the bar (Figma: `url`). */
|
|
8
|
+
url?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Browser — Figma [RDS] External/Browser. A MOCKUP for flows, specs and showrooms: a desktop browser window,
|
|
12
|
+
* minimal in the Safari way (the window buttons, back and forward, the address in the centre). Up to 1280 wide; it
|
|
13
|
+
* narrows with its container and keeps the page's proportion. The toolbar is decorative; the page is live.
|
|
14
|
+
* Styles: browser.css.
|
|
15
|
+
*/
|
|
16
|
+
declare function Browser({ children, url, className, ...rest }: BrowserProps): react.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Browser, type BrowserProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { LockIcon } from "./internal/icons.js";
|
|
8
|
+
function Browser(_a) {
|
|
9
|
+
var _b = _a, { children, url = "rojao.studio", className } = _b, rest = __objRest(_b, ["children", "url", "className"]);
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-browser", className].filter(Boolean).join(" "), children: [
|
|
11
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-browser__toolbar", "aria-hidden": "true", children: [
|
|
12
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-browser__controls", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
14
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
15
|
+
/* @__PURE__ */ jsx("span", {})
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-browser__navigation", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("span", { children: "\u2039" }),
|
|
19
|
+
/* @__PURE__ */ jsx("span", { children: "\u203A" })
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "rds-browser__center", children: /* @__PURE__ */ jsxs("span", { className: "rds-browser__address", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(LockIcon, {}),
|
|
23
|
+
/* @__PURE__ */ jsx("span", { children: url })
|
|
24
|
+
] }) }),
|
|
25
|
+
/* @__PURE__ */ jsx("span", { className: "rds-browser__actions", children: "+" })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "rds-browser__screen", children })
|
|
28
|
+
] }));
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
Browser
|
|
32
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type BubbleVariant = 'fill' | 'muted' | 'tinted' | 'outline' | 'ghost' | 'error' | 'typing';
|
|
5
|
+
type BubbleAlign = 'start' | 'end';
|
|
6
|
+
interface BubbleProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* The surface (Figma: `style`). fill: the person writing, in the brand colour. muted or tinted: the one answering.
|
|
9
|
+
* outline: on a coloured background. ghost: a long answer from the assistant, no box. error: it was not sent.
|
|
10
|
+
* typing: the three dots of the one answering while they write; no text, no reactions.
|
|
11
|
+
*/
|
|
12
|
+
variant?: BubbleVariant;
|
|
13
|
+
/** start: the one answering, the small corner bottom left; end: the person writing, bottom right. */
|
|
14
|
+
align?: BubbleAlign;
|
|
15
|
+
/**
|
|
16
|
+
* The message (Figma: `text`). Line breaks are kept. In `typing` it is what a screen reader hears instead of the
|
|
17
|
+
* dots, "digitando…" by default ("Ana está digitando…").
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/** How many reacted (Figma: `showReactions` + `reactions`). The pill goes under the text; 0 hides it. */
|
|
21
|
+
reactions?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Bubble — Figma [RDS] Chat/Bubble. The surface of a message: it grows up to 480 and wraps. Inside a Message,
|
|
25
|
+
* which adds the avatar, the name and the actions. Styles: bubble.css.
|
|
26
|
+
*/
|
|
27
|
+
declare function Bubble({ variant, align, children, reactions, className, ...rest }: BubbleProps): react.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { Bubble, type BubbleAlign, type BubbleProps, type BubbleVariant };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ThumbsUpIcon } from "./internal/icons.js";
|
|
8
|
+
function Bubble(_a) {
|
|
9
|
+
var _b = _a, { variant = "muted", align = "start", children, reactions, className } = _b, rest = __objRest(_b, ["variant", "align", "children", "reactions", "className"]);
|
|
10
|
+
if (variant === "typing") {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ role: "status" }, rest), { className: ["rds-bubble", "rds-bubble--typing", `rds-bubble--${align}`, className].filter(Boolean).join(" "), children: [
|
|
12
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-bubble__dots", "aria-hidden": "true", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
14
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
15
|
+
/* @__PURE__ */ jsx("span", {})
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: children != null ? children : "digitando\u2026" })
|
|
18
|
+
] }));
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-bubble", `rds-bubble--${variant}`, `rds-bubble--${align}`, className].filter(Boolean).join(" "), children: [
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: "rds-bubble__text", children }),
|
|
22
|
+
reactions !== void 0 && reactions > 0 && /* @__PURE__ */ jsx("div", { className: "rds-bubble__reactions-row", children: /* @__PURE__ */ jsxs("span", { className: "rds-bubble__reactions", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-bubble__reactions-count", "aria-hidden": "true", children: [
|
|
24
|
+
/* @__PURE__ */ jsx(ThumbsUpIcon, {}),
|
|
25
|
+
reactions
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: reactions === 1 ? "1 rea\xE7\xE3o" : `${reactions} rea\xE7\xF5es` })
|
|
28
|
+
] }) })
|
|
29
|
+
] }));
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
Bubble
|
|
33
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** The sibling actions (Figma: slot `buttons`): Buttons of the same tone and variant, up to 4. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** In a row or stacked (Figma: `orientation`). */
|
|
9
|
+
orientation?: ButtonGroupOrientation;
|
|
10
|
+
/** Required: what the actions act on ("Rascunho"). The group is announced with this name. */
|
|
11
|
+
'aria-label': string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ButtonGroup — Figma [RDS] Actions/ButtonGroup. Buttons joined in one piece: inner corners square,
|
|
15
|
+
* borders overlapping by 1px. Each Button stays in the tab order. Styles: button-group.css.
|
|
16
|
+
*/
|
|
17
|
+
declare function ButtonGroup({ orientation, className, children, ...rest }: ButtonGroupProps): react.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function ButtonGroup(_a) {
|
|
8
|
+
var _b = _a, { orientation = "horizontal", className, children } = _b, rest = __objRest(_b, ["orientation", "className", "children"]);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"div",
|
|
11
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
12
|
+
role: "group",
|
|
13
|
+
className: ["rds-button-group", `rds-button-group--${orientation}`, className].filter(Boolean).join(" "),
|
|
14
|
+
children
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
ButtonGroup
|
|
20
|
+
};
|