@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
|
@@ -1,93 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
3
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
case "bottom": {
|
|
15
|
-
const cx = rect.left + rect.width / 2;
|
|
16
|
-
if (cx > vpW - EDGE) return { top: rect.bottom + GAP, left: rect.right, transform: "translateX(-100%)" };
|
|
17
|
-
if (cx < EDGE) return { top: rect.bottom + GAP, left: rect.left, transform: "" };
|
|
18
|
-
return { top: rect.bottom + GAP, left: cx, transform: "translateX(-50%)" };
|
|
19
|
-
}
|
|
20
|
-
case "top":
|
|
21
|
-
default: {
|
|
22
|
-
const cx = rect.left + rect.width / 2;
|
|
23
|
-
if (cx > vpW - EDGE) return { top: rect.top - GAP, left: rect.right, transform: "translate(-100%, -100%)" };
|
|
24
|
-
if (cx < EDGE) return { top: rect.top - GAP, left: rect.left, transform: "translateY(-100%)" };
|
|
25
|
-
return { top: rect.top - GAP, left: cx, transform: "translate(-50%, -100%)" };
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const ARROW_CLASSES = {
|
|
30
|
-
top: `bottom-0 left-1/2 -translate-x-1/2 translate-y-full border-t-[var(--tooltip-bg)] border-x-transparent border-b-transparent`,
|
|
31
|
-
bottom: `top-0 left-1/2 -translate-x-1/2 -translate-y-full border-b-[var(--tooltip-bg)] border-x-transparent border-t-transparent`,
|
|
32
|
-
left: `right-0 top-1/2 -translate-y-1/2 translate-x-full border-l-[var(--tooltip-bg)] border-y-transparent border-r-transparent`,
|
|
33
|
-
right: `left-0 top-1/2 -translate-y-1/2 -translate-x-full border-r-[var(--tooltip-bg)] border-y-transparent border-l-transparent`
|
|
34
|
-
};
|
|
35
|
-
function Tooltip({ content, children, side = "top", delay = 300, className, wrapperClassName }) {
|
|
36
|
-
const id = useId();
|
|
37
|
-
const ref = useRef(null);
|
|
38
|
-
const timer = useRef(null);
|
|
39
|
-
const [pos, setPos] = useState(null);
|
|
40
|
-
function show() {
|
|
41
|
-
timer.current = setTimeout(() => {
|
|
42
|
-
if (!ref.current) return;
|
|
43
|
-
setPos(getFixedPos(ref.current.getBoundingClientRect(), side));
|
|
44
|
-
}, delay);
|
|
45
|
-
}
|
|
46
|
-
function hide() {
|
|
47
|
-
if (timer.current) clearTimeout(timer.current);
|
|
48
|
-
setPos(null);
|
|
49
|
-
}
|
|
50
|
-
useEffect(() => () => {
|
|
51
|
-
if (timer.current) clearTimeout(timer.current);
|
|
52
|
-
}, []);
|
|
53
|
-
return /* @__PURE__ */ jsxs(
|
|
54
|
-
"span",
|
|
55
|
-
{
|
|
56
|
-
ref,
|
|
57
|
-
className: wrapperClassName != null ? wrapperClassName : "inline-flex items-center",
|
|
58
|
-
onMouseEnter: show,
|
|
59
|
-
onMouseLeave: hide,
|
|
60
|
-
onFocus: show,
|
|
61
|
-
onBlur: hide,
|
|
62
|
-
"aria-describedby": pos ? id : void 0,
|
|
63
|
-
children: [
|
|
64
|
-
children,
|
|
65
|
-
pos && /* @__PURE__ */ jsxs(
|
|
66
|
-
"span",
|
|
67
|
-
{
|
|
68
|
-
id,
|
|
69
|
-
role: "tooltip",
|
|
70
|
-
style: { position: "fixed", top: pos.top, left: pos.left, transform: pos.transform },
|
|
71
|
-
className: `z-[9999] px-2.5 py-1.5 bg-[var(--tooltip-bg)] text-[var(--tooltip-text)] text-caption font-medium rounded-(--radius-tooltip) whitespace-nowrap pointer-events-none shadow-md${className ? ` ${className}` : ""}`,
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
"span",
|
|
75
|
-
{
|
|
76
|
-
"aria-hidden": "true",
|
|
77
|
-
className: [
|
|
78
|
-
"absolute border-[5px]",
|
|
79
|
-
ARROW_CLASSES[side]
|
|
80
|
-
].join(" "),
|
|
81
|
-
style: { width: 0, height: 0 }
|
|
82
|
-
}
|
|
83
|
-
),
|
|
84
|
-
content
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
);
|
|
8
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
9
|
+
function Tooltip(_a) {
|
|
10
|
+
var _b = _a, { children, text, side = "top", delay = 300 } = _b, trigger = __objRest(_b, ["children", "text", "side", "delay"]);
|
|
11
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, __spreadProps(__spreadValues({}, trigger), { asChild: true, children })),
|
|
13
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Content, { side, sideOffset: 4, collisionPadding: 8, className: "rds-tooltip", children: [
|
|
14
|
+
text,
|
|
15
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "rds-tooltip__arrow", width: 16, height: 8 })
|
|
16
|
+
] }) })
|
|
17
|
+
] }) });
|
|
91
18
|
}
|
|
92
19
|
export {
|
|
93
20
|
Tooltip
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface TopNavigationProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The brand (Figma: `logo`), always by slot: the design system carries no client logo. Usually a link to the home
|
|
7
|
+
* page named after the brand, around the logotype.
|
|
8
|
+
*/
|
|
9
|
+
logo: ReactNode;
|
|
10
|
+
/** The main sections: neutral ghost Buttons as links, through asChild (Figma: slot `links`). */
|
|
11
|
+
links?: ReactNode;
|
|
12
|
+
/** Sign in and the main action: a neutral outline and an action fill Button (Figma: slot `actions`). */
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/** Names the links' navigation. */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** The menu panel open, below 768 of container width (Figma: `open`). Controlled; pair with `onOpenChange`. */
|
|
17
|
+
open?: boolean;
|
|
18
|
+
/** Uncontrolled: the panel open at first. */
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
/** The menu button's accessible name, closed and open. */
|
|
22
|
+
openLabel?: string;
|
|
23
|
+
closeLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* TopNavigation — Figma [RDS] Blocks/TopNavigation. The top bar of the public pages (<header>, the banner landmark
|
|
27
|
+
* at the top level): logo, links and actions. Below 768 of container width the links and the actions go into the
|
|
28
|
+
* panel the menu button opens (Figma: `screen=mobile`, `open`); Escape closes it and returns the focus to the
|
|
29
|
+
* button. Styles: top-navigation.css.
|
|
30
|
+
*/
|
|
31
|
+
declare function TopNavigation({ logo, links, actions, label, open: openProp, defaultOpen, onOpenChange, openLabel, closeLabel, className, onKeyDown, ...rest }: TopNavigationProps): react.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { TopNavigation, type TopNavigationProps };
|
|
@@ -0,0 +1,85 @@
|
|
|
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, useRef, useState } from "react";
|
|
9
|
+
import { IconButton } from "./icon-button.js";
|
|
10
|
+
import { Tooltip } from "./tooltip.js";
|
|
11
|
+
import { CloseIcon, MenuIcon } from "./internal/icons.js";
|
|
12
|
+
function TopNavigation(_a) {
|
|
13
|
+
var _b = _a, {
|
|
14
|
+
logo,
|
|
15
|
+
links,
|
|
16
|
+
actions,
|
|
17
|
+
label = "Principal",
|
|
18
|
+
open: openProp,
|
|
19
|
+
defaultOpen = false,
|
|
20
|
+
onOpenChange,
|
|
21
|
+
openLabel = "Abrir menu",
|
|
22
|
+
closeLabel = "Fechar menu",
|
|
23
|
+
className,
|
|
24
|
+
onKeyDown
|
|
25
|
+
} = _b, rest = __objRest(_b, [
|
|
26
|
+
"logo",
|
|
27
|
+
"links",
|
|
28
|
+
"actions",
|
|
29
|
+
"label",
|
|
30
|
+
"open",
|
|
31
|
+
"defaultOpen",
|
|
32
|
+
"onOpenChange",
|
|
33
|
+
"openLabel",
|
|
34
|
+
"closeLabel",
|
|
35
|
+
"className",
|
|
36
|
+
"onKeyDown"
|
|
37
|
+
]);
|
|
38
|
+
const [own, setOwn] = useState(defaultOpen);
|
|
39
|
+
const open = openProp != null ? openProp : own;
|
|
40
|
+
const panelId = useId();
|
|
41
|
+
const toggle = useRef(null);
|
|
42
|
+
const setOpen = (next) => {
|
|
43
|
+
setOwn(next);
|
|
44
|
+
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
"header",
|
|
48
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
49
|
+
className: ["rds-topnav", className].filter(Boolean).join(" "),
|
|
50
|
+
"data-open": open ? "" : void 0,
|
|
51
|
+
onKeyDown: (event) => {
|
|
52
|
+
var _a2;
|
|
53
|
+
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
54
|
+
if (event.key === "Escape" && open) {
|
|
55
|
+
setOpen(false);
|
|
56
|
+
(_a2 = toggle.current) == null ? void 0 : _a2.focus();
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ jsxs("div", { className: "rds-topnav__bar", children: [
|
|
60
|
+
/* @__PURE__ */ jsx("div", { className: "rds-topnav__brand", children: logo }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { id: panelId, className: "rds-topnav__panel", children: [
|
|
62
|
+
links && /* @__PURE__ */ jsx("nav", { className: "rds-topnav__links", "aria-label": label, children: links }),
|
|
63
|
+
actions && /* @__PURE__ */ jsx("div", { className: "rds-topnav__actions", children: actions })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx(Tooltip, { text: open ? closeLabel : openLabel, children: /* @__PURE__ */ jsx(
|
|
66
|
+
IconButton,
|
|
67
|
+
{
|
|
68
|
+
ref: toggle,
|
|
69
|
+
className: "rds-topnav__toggle",
|
|
70
|
+
icon: open ? /* @__PURE__ */ jsx(CloseIcon, {}) : /* @__PURE__ */ jsx(MenuIcon, {}),
|
|
71
|
+
label: open ? closeLabel : openLabel,
|
|
72
|
+
tone: "neutral",
|
|
73
|
+
variant: "ghost",
|
|
74
|
+
"aria-expanded": open,
|
|
75
|
+
"aria-controls": panelId,
|
|
76
|
+
onClick: () => setOpen(!open)
|
|
77
|
+
}
|
|
78
|
+
) })
|
|
79
|
+
] })
|
|
80
|
+
})
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
TopNavigation
|
|
85
|
+
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
|
+
/** @deprecated Use Bubble with variant="typing". */
|
|
3
4
|
interface TypingIndicatorProps {
|
|
5
|
+
/** What a screen reader hears. Default "Digitando". */
|
|
4
6
|
ariaLabel?: string;
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `<Bubble variant="typing" />` (Figma [RDS] Chat/Bubble, style=typing). A thin wrapper over it: the
|
|
10
|
+
* label becomes the bubble's announcement.
|
|
11
|
+
*/
|
|
6
12
|
declare function TypingIndicator({ ariaLabel }: TypingIndicatorProps): react.JSX.Element;
|
|
7
13
|
|
|
8
14
|
export { TypingIndicator, type TypingIndicatorProps };
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import "../chunk-ORMEWXMH.js";
|
|
3
|
-
import { jsx
|
|
4
|
-
import {
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Bubble } from "./bubble.js";
|
|
5
4
|
function TypingIndicator({ ariaLabel = "Digitando" }) {
|
|
6
|
-
|
|
7
|
-
width: "var(--typing-dot-size)",
|
|
8
|
-
height: "var(--typing-dot-size)",
|
|
9
|
-
background: "var(--typing-dot-color)",
|
|
10
|
-
borderRadius: "9999px",
|
|
11
|
-
animation: "rojao-typing-pulse 1400ms infinite",
|
|
12
|
-
animationDelay: delay
|
|
13
|
-
});
|
|
14
|
-
return /* @__PURE__ */ jsx(ChatBubble, { variant: "bot", ariaLabel, children: /* @__PURE__ */ jsxs(
|
|
15
|
-
"span",
|
|
16
|
-
{
|
|
17
|
-
className: "inline-flex items-center",
|
|
18
|
-
style: { gap: "var(--typing-dot-gap)" },
|
|
19
|
-
"aria-live": "polite",
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ jsx("span", { style: dotStyle("0ms") }),
|
|
22
|
-
/* @__PURE__ */ jsx("span", { style: dotStyle("200ms") }),
|
|
23
|
-
/* @__PURE__ */ jsx("span", { style: dotStyle("400ms") })
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
) });
|
|
5
|
+
return /* @__PURE__ */ jsx(Bubble, { variant: "typing", align: "start", children: ariaLabel });
|
|
27
6
|
}
|
|
28
7
|
export {
|
|
29
8
|
TypingIndicator
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { WhatsAppPlatform } from './internal/whatsapp.js';
|
|
4
|
+
|
|
5
|
+
interface WhatsAppChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** WhatsAppTemplate and WhatsAppMessage, from the oldest to the newest (Figma: slot `messages`). */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** The business's name in the header (Figma: `name`). */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** The line under the name (Figma: `subtitle`). */
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** The verified badge next to the name (Figma: `showVerified`). */
|
|
13
|
+
showVerified?: boolean;
|
|
14
|
+
/** The business's picture: its logo, always by slot (the design system carries no client logo). */
|
|
15
|
+
avatar?: ReactNode;
|
|
16
|
+
/** android (Roboto) or ios. The messages inside follow it. */
|
|
17
|
+
platform?: WhatsAppPlatform;
|
|
18
|
+
/** The time in the status bar. */
|
|
19
|
+
time?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* WhatsAppChat — Figma [RDS] External/WhatsAppChat. A MOCKUP of a WhatsApp Business conversation, 360 × 780, for
|
|
23
|
+
* flows: the status bar, the header, the day, Meta's notice, the messages and the composer. Nothing in it works;
|
|
24
|
+
* the bars are decorative and the messages are read. Styles: whatsapp-chat.css and internal/whatsapp.css.
|
|
25
|
+
*/
|
|
26
|
+
declare function WhatsAppChat({ children, name, subtitle, showVerified, avatar, platform, time, className, ...rest }: WhatsAppChatProps): react.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { WhatsAppChat, type WhatsAppChatProps };
|
|
@@ -0,0 +1,95 @@
|
|
|
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 {
|
|
9
|
+
ArrowLeftIcon,
|
|
10
|
+
BadgeCheckIcon,
|
|
11
|
+
CameraIcon,
|
|
12
|
+
ChevronLeftIcon,
|
|
13
|
+
MicIcon,
|
|
14
|
+
MoreVerticalIcon,
|
|
15
|
+
PaperclipIcon,
|
|
16
|
+
PhoneIcon,
|
|
17
|
+
SmileIcon
|
|
18
|
+
} from "./internal/icons.js";
|
|
19
|
+
import { WhatsAppPlatformContext } from "./internal/whatsapp.js";
|
|
20
|
+
function WhatsAppChat(_a) {
|
|
21
|
+
var _b = _a, {
|
|
22
|
+
children,
|
|
23
|
+
name = "Roj\xE3o",
|
|
24
|
+
subtitle = "Conta comercial",
|
|
25
|
+
showVerified,
|
|
26
|
+
avatar,
|
|
27
|
+
platform = "android",
|
|
28
|
+
time,
|
|
29
|
+
className
|
|
30
|
+
} = _b, rest = __objRest(_b, [
|
|
31
|
+
"children",
|
|
32
|
+
"name",
|
|
33
|
+
"subtitle",
|
|
34
|
+
"showVerified",
|
|
35
|
+
"avatar",
|
|
36
|
+
"platform",
|
|
37
|
+
"time",
|
|
38
|
+
"className"
|
|
39
|
+
]);
|
|
40
|
+
const ios = platform === "ios";
|
|
41
|
+
return /* @__PURE__ */ jsx(WhatsAppPlatformContext.Provider, { value: platform, children: /* @__PURE__ */ jsxs(
|
|
42
|
+
"div",
|
|
43
|
+
__spreadProps(__spreadValues({
|
|
44
|
+
role: "group",
|
|
45
|
+
"aria-label": `Mockup: conversa do WhatsApp com ${name}`
|
|
46
|
+
}, rest), {
|
|
47
|
+
className: ["rds-whatsapp-chat", `rds-whatsapp--${platform}`, className].filter(Boolean).join(" "),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-chat__status", "aria-hidden": "true", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("span", { children: time != null ? time : ios ? "9:41" : "12:30" }),
|
|
51
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-chat__indicators", children: [
|
|
52
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
53
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
54
|
+
/* @__PURE__ */ jsx("span", {})
|
|
55
|
+
] })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-chat__header", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-chat__icon", "aria-hidden": "true", children: ios ? /* @__PURE__ */ jsx(ChevronLeftIcon, {}) : /* @__PURE__ */ jsx(ArrowLeftIcon, {}) }),
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-chat__avatar", children: avatar }),
|
|
60
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-chat__contact", children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-chat__name", children: [
|
|
62
|
+
name,
|
|
63
|
+
showVerified && /* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-chat__verified", children: [
|
|
64
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(BadgeCheckIcon, {}) }),
|
|
65
|
+
/* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: "(verificada)" })
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-chat__subtitle", children: subtitle })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-chat__actions", "aria-hidden": "true", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(PhoneIcon, {}),
|
|
72
|
+
!ios && /* @__PURE__ */ jsx(MoreVerticalIcon, {})
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-chat__conversation", children: [
|
|
76
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-chat__date", children: "Hoje" }),
|
|
77
|
+
/* @__PURE__ */ jsx("p", { className: "rds-whatsapp-chat__notice", children: "Esta empresa usa um servi\xE7o seguro da Meta para gerenciar esta conversa. Saiba mais" }),
|
|
78
|
+
/* @__PURE__ */ jsx("div", { className: "rds-whatsapp-chat__messages", children })
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-chat__composer", "aria-hidden": "true", children: [
|
|
81
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-chat__field", children: [
|
|
82
|
+
!ios && /* @__PURE__ */ jsx(SmileIcon, {}),
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-chat__placeholder", children: "Mensagem" }),
|
|
84
|
+
/* @__PURE__ */ jsx(PaperclipIcon, {}),
|
|
85
|
+
/* @__PURE__ */ jsx(CameraIcon, {})
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-chat__mic", children: /* @__PURE__ */ jsx(MicIcon, {}) })
|
|
88
|
+
] })
|
|
89
|
+
]
|
|
90
|
+
})
|
|
91
|
+
) });
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
WhatsAppChat
|
|
95
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { WhatsAppPlatform } from './internal/whatsapp.js';
|
|
4
|
+
|
|
5
|
+
type WhatsAppMessageType = 'received' | 'sent' | 'delivered' | 'read';
|
|
6
|
+
interface WhatsAppMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/** The message (Figma: `text`). Line breaks are kept. */
|
|
8
|
+
text: ReactNode;
|
|
9
|
+
/** The time under it, such as "11:59" (Figma: `time`). */
|
|
10
|
+
time?: string;
|
|
11
|
+
/** android (Roboto) or ios. Inside a WhatsAppChat, the chat's by default. */
|
|
12
|
+
platform?: WhatsAppPlatform;
|
|
13
|
+
/** received: white, on the left; sent, delivered or read: green, on the right, with one tick, two grey or two blue. */
|
|
14
|
+
type?: WhatsAppMessageType;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* WhatsAppMessage — Figma [RDS] External/WhatsAppMessage. A MOCKUP of a WhatsApp message bubble (2024 look), for
|
|
18
|
+
* flows. The ticks are said in words to screen readers. Styles: whatsapp-message.css and internal/whatsapp.css.
|
|
19
|
+
*/
|
|
20
|
+
declare function WhatsAppMessage({ text, time, platform, type, className, ...rest }: WhatsAppMessageProps): react.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { WhatsAppMessage, type WhatsAppMessageProps, type WhatsAppMessageType, WhatsAppPlatform };
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { CheckCheckIcon, CheckIcon } from "./internal/icons.js";
|
|
9
|
+
import { useWhatsAppPlatform } from "./internal/whatsapp.js";
|
|
10
|
+
const TICKS = { sent: "Enviada", delivered: "Entregue", read: "Lida" };
|
|
11
|
+
function WhatsAppMessage(_a) {
|
|
12
|
+
var _b = _a, { text, time = "11:59", platform, type = "received", className } = _b, rest = __objRest(_b, ["text", "time", "platform", "type", "className"]);
|
|
13
|
+
const finalPlatform = useWhatsAppPlatform(platform);
|
|
14
|
+
const out = type !== "received";
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
"div",
|
|
17
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
18
|
+
className: ["rds-whatsapp-message", `rds-whatsapp--${finalPlatform}`, out ? "rds-whatsapp-message--out" : "rds-whatsapp-message--in", className].filter(Boolean).join(" "),
|
|
19
|
+
children: /* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-message__bubble", children: [
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "rds-whatsapp-message__text", children: text }),
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-message__meta", children: [
|
|
22
|
+
/* @__PURE__ */ jsx("span", { children: time }),
|
|
23
|
+
out && /* @__PURE__ */ jsxs("span", { className: `rds-whatsapp-message__ticks rds-whatsapp-message__ticks--${type}`, children: [
|
|
24
|
+
type === "sent" ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CheckCheckIcon, {}),
|
|
25
|
+
/* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: TICKS[type] })
|
|
26
|
+
] })
|
|
27
|
+
] })
|
|
28
|
+
] })
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
WhatsAppMessage
|
|
34
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { WhatsAppPlatform } from './internal/whatsapp.js';
|
|
4
|
+
|
|
5
|
+
interface WhatsAppNotificationProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Who sent it: the business's name (Figma: `title`). */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** The message, cut at three lines (Figma: `message`). */
|
|
9
|
+
message: ReactNode;
|
|
10
|
+
/** When, such as "agora" (Figma: `when`). */
|
|
11
|
+
when?: string;
|
|
12
|
+
/** android: the Android notification anatomy; ios: Apple's, the picture with the app icon over it. */
|
|
13
|
+
platform?: WhatsAppPlatform;
|
|
14
|
+
/** The sender's picture: its logo, always by slot (the design system carries no client logo). */
|
|
15
|
+
avatar?: ReactNode;
|
|
16
|
+
/** The lock screen's clock and date. */
|
|
17
|
+
time?: string;
|
|
18
|
+
date?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* WhatsAppNotification — Figma [RDS] External/WhatsAppNotification. A MOCKUP of a WhatsApp notification on the
|
|
22
|
+
* lock screen, for flows. The wallpaper is a neutral gradient, no real picture. Nothing in it works; the clock is
|
|
23
|
+
* decorative and the notification is read. Styles: whatsapp-notification.css.
|
|
24
|
+
*/
|
|
25
|
+
declare function WhatsAppNotification({ title, message, when, platform, avatar, time, date, className, ...rest }: WhatsAppNotificationProps): react.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { WhatsAppNotification, type WhatsAppNotificationProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { PhoneIcon } from "./internal/icons.js";
|
|
8
|
+
function WhatsAppNotification(_a) {
|
|
9
|
+
var _b = _a, {
|
|
10
|
+
title = "Roj\xE3o",
|
|
11
|
+
message,
|
|
12
|
+
when = "agora",
|
|
13
|
+
platform = "android",
|
|
14
|
+
avatar,
|
|
15
|
+
time,
|
|
16
|
+
date,
|
|
17
|
+
className
|
|
18
|
+
} = _b, rest = __objRest(_b, [
|
|
19
|
+
"title",
|
|
20
|
+
"message",
|
|
21
|
+
"when",
|
|
22
|
+
"platform",
|
|
23
|
+
"avatar",
|
|
24
|
+
"time",
|
|
25
|
+
"date",
|
|
26
|
+
"className"
|
|
27
|
+
]);
|
|
28
|
+
const ios = platform === "ios";
|
|
29
|
+
const appIcon = /* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__app", "aria-hidden": "true", children: /* @__PURE__ */ jsx(PhoneIcon, {}) });
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
__spreadProps(__spreadValues({
|
|
33
|
+
role: "group",
|
|
34
|
+
"aria-label": "Mockup: notifica\xE7\xE3o do WhatsApp"
|
|
35
|
+
}, rest), {
|
|
36
|
+
className: ["rds-whatsapp-notification", `rds-whatsapp--${platform}`, className].filter(Boolean).join(" "),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-whatsapp-notification__clock", "aria-hidden": "true", children: [
|
|
39
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__date", children: date != null ? date : ios ? "S\xE1b. 26 de set." : "s\xE1b., 26 de set." }),
|
|
40
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__time", children: time != null ? time : ios ? "09:41" : "12:30" })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsx("div", { className: "rds-whatsapp-notification__card", children: ios ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-notification__picture", children: [
|
|
44
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__avatar", children: avatar }),
|
|
45
|
+
appIcon
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-notification__text", children: [
|
|
48
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-notification__title-row", children: [
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__title", children: title }),
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__when", children: when })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__message", children: message })
|
|
53
|
+
] })
|
|
54
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-notification__text", children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-whatsapp-notification__app-row", children: [
|
|
57
|
+
appIcon,
|
|
58
|
+
/* @__PURE__ */ jsx("span", { children: "WhatsApp" }),
|
|
59
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2022" }),
|
|
60
|
+
/* @__PURE__ */ jsx("span", { children: when })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__title", children: title }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__message", children: message })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx("span", { className: "rds-whatsapp-notification__avatar", children: avatar })
|
|
66
|
+
] }) })
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
WhatsAppNotification
|
|
73
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { WhatsAppPlatform } from './internal/whatsapp.js';
|
|
4
|
+
|
|
5
|
+
type WhatsAppTemplateHeader = 'none' | 'text' | 'image';
|
|
6
|
+
interface WhatsAppTemplateProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/** WhatsAppTemplateButton, up to 10 (Figma: slot `buttons`); with more than 3, WhatsApp shows 2 and "all-options". */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** The header kind (Figma: `header`): none, a bold line (up to 60 characters) or an image. */
|
|
10
|
+
header?: WhatsAppTemplateHeader;
|
|
11
|
+
/** The header line, with `header="text"` (Figma: `headerText`). */
|
|
12
|
+
headerText?: ReactNode;
|
|
13
|
+
/** The header image, with `header="image"`: an `<img>` with its alt. Without it, a grey placeholder. */
|
|
14
|
+
image?: ReactNode;
|
|
15
|
+
/** The message, up to 1024 characters (Figma: `body`). */
|
|
16
|
+
body: ReactNode;
|
|
17
|
+
/** The grey line under the body, up to 60 characters (Figma: `showFooter` + `footer`). */
|
|
18
|
+
footer?: ReactNode;
|
|
19
|
+
time?: string;
|
|
20
|
+
/** android or ios. Inside a WhatsAppChat, the chat's by default. */
|
|
21
|
+
platform?: WhatsAppPlatform;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* WhatsAppTemplate — Figma [RDS] External/WhatsAppTemplate. A MOCKUP of a WhatsApp Business template message, for
|
|
25
|
+
* flows: the header, the body, the footer, the time and the buttons under the bubble. Limits from Meta's
|
|
26
|
+
* documentation. Styles: whatsapp-template.css and internal/whatsapp.css.
|
|
27
|
+
*/
|
|
28
|
+
declare function WhatsAppTemplate({ children, header, headerText, image, body, footer, time, platform, className, ...rest }: WhatsAppTemplateProps): react.JSX.Element;
|
|
29
|
+
type WhatsAppTemplateButtonType = 'quick-reply' | 'url' | 'phone' | 'all-options';
|
|
30
|
+
type WhatsAppTemplateButtonStatus = 'default' | 'used';
|
|
31
|
+
interface WhatsAppTemplateButtonProps extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
/** The label, up to 25 characters (Figma: `label`). With all-options, "Ver todas as opções" by default. */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
/** quick-reply (a reply), url (a link), phone (a call) or all-options (more than 3 buttons). */
|
|
35
|
+
type?: WhatsAppTemplateButtonType;
|
|
36
|
+
/** used: a quick reply already tapped, in grey. */
|
|
37
|
+
status?: WhatsAppTemplateButtonStatus;
|
|
38
|
+
}
|
|
39
|
+
/** One button under a WhatsAppTemplate (Figma: .whatsapp/template-button). A mockup: it does nothing. */
|
|
40
|
+
declare function WhatsAppTemplateButton({ children, type, status, className, ...rest }: WhatsAppTemplateButtonProps): react.JSX.Element;
|
|
41
|
+
|
|
42
|
+
export { WhatsAppTemplate, WhatsAppTemplateButton, type WhatsAppTemplateButtonProps, type WhatsAppTemplateButtonStatus, type WhatsAppTemplateButtonType, type WhatsAppTemplateHeader, type WhatsAppTemplateProps };
|