@rojaostudio/ds 1.0.1 → 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 -87
- 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 +74 -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 -83
- package/dist/components/badge.d.ts +30 -41
- package/dist/components/badge.js +16 -106
- 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 +40 -48
- 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 +51 -107
- 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 +38 -38
- 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 +86 -67
- package/dist/components/chip-input.d.ts +46 -20
- package/dist/components/chip-input.js +171 -158
- 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 -56
- package/dist/components/choice-carousel.d.ts +9 -0
- package/dist/components/choice-carousel.js +67 -78
- package/dist/components/choice-preview-card.d.ts +10 -20
- package/dist/components/choice-preview-card.js +13 -30
- package/dist/components/color-input.d.ts +36 -11
- package/dist/components/color-input.js +139 -61
- package/dist/components/combobox.d.ts +60 -57
- package/dist/components/combobox.js +215 -196
- 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 +43 -66
- package/dist/components/copy-field.d.ts +10 -5
- package/dist/components/copy-field.js +25 -27
- package/dist/components/currency-input.d.ts +25 -11
- package/dist/components/currency-input.js +39 -67
- package/dist/components/danger-zone.d.ts +10 -1
- package/dist/components/danger-zone.js +20 -14
- package/dist/components/data-table-header.d.ts +13 -2
- package/dist/components/data-table-header.js +143 -169
- package/dist/components/date-picker.d.ts +31 -32
- package/dist/components/date-picker.js +126 -242
- 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 +56 -76
- 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 -55
- 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 -39
- 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 -57
- package/dist/components/floating-stepper.d.ts +7 -18
- package/dist/components/floating-stepper.js +17 -35
- 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 +47 -61
- package/dist/components/image-crop-modal.d.ts +3 -3
- package/dist/components/image-crop-modal.js +66 -52
- package/dist/components/image-upload.d.ts +21 -29
- package/dist/components/image-upload.js +59 -219
- 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 +103 -108
- package/dist/components/insight-card.d.ts +25 -9
- package/dist/components/insight-card.js +45 -19
- 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 -24
- 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 -131
- 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 -27
- package/dist/components/page-skeleton.d.ts +15 -21
- package/dist/components/page-skeleton.js +37 -4
- package/dist/components/pagination.d.ts +32 -22
- package/dist/components/pagination.js +83 -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 +77 -47
- 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 +32 -129
- package/dist/components/pricing-card.d.ts +9 -25
- package/dist/components/pricing-card.js +9 -25
- 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 +8 -19
- 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 +46 -87
- package/dist/components/row-actions.d.ts +5 -0
- package/dist/components/row-actions.js +57 -56
- package/dist/components/saving-bar-context.d.ts +0 -5
- package/dist/components/saving-bar-context.js +16 -34
- package/dist/components/saving-bar.d.ts +26 -11
- package/dist/components/saving-bar.js +53 -65
- package/dist/components/section-card.d.ts +18 -4
- package/dist/components/section-card.js +26 -39
- package/dist/components/section-header.d.ts +8 -12
- package/dist/components/section-header.js +7 -2
- package/dist/components/select.d.ts +44 -16
- package/dist/components/select.js +85 -135
- package/dist/components/selectable-card.d.ts +11 -19
- package/dist/components/selectable-card.js +4 -21
- 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 +11 -14
- package/dist/components/settings-list.d.ts +10 -12
- package/dist/components/settings-list.js +9 -17
- 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 -36
- package/dist/components/slider.d.ts +21 -23
- package/dist/components/slider.js +65 -56
- 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 +35 -32
- 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 +20 -17
- package/dist/components/summary-bar.d.ts +20 -20
- package/dist/components/summary-bar.js +13 -50
- 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 +65 -59
- 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 -75
- 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 +191 -189
- 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 +22 -81
- package/dist/components/toggle-card.d.ts +11 -2
- package/dist/components/toggle-card.js +9 -70
- package/dist/components/toggle-group.d.ts +21 -59
- package/dist/components/toggle-group.js +31 -74
- package/dist/components/toggle.d.ts +19 -9
- package/dist/components/toggle.js +20 -55
- package/dist/components/tooltip.d.ts +25 -12
- package/dist/components/tooltip.js +16 -84
- 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 -21
- 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/icons/pix.js +29 -0
- package/dist/targets/native/components/accordion.js +31 -25
- package/dist/targets/native/components/alert.js +22 -16
- package/dist/targets/native/components/avatar.js +36 -29
- package/dist/targets/native/components/badge.js +4 -3
- package/dist/targets/native/components/button.js +11 -4
- package/dist/targets/native/components/card.js +2 -1
- package/dist/targets/native/components/checkbox.js +18 -15
- package/dist/targets/native/components/chips.js +19 -16
- package/dist/targets/native/components/choice-card.js +29 -23
- package/dist/targets/native/components/context-menu.js +13 -9
- package/dist/targets/native/components/currency-input.js +28 -25
- package/dist/targets/native/components/danger-zone.js +10 -4
- package/dist/targets/native/components/date-picker.js +86 -70
- package/dist/targets/native/components/divider.js +3 -2
- package/dist/targets/native/components/empty-state.js +6 -1
- package/dist/targets/native/components/fab.js +32 -26
- package/dist/targets/native/components/filter-chip.js +9 -8
- package/dist/targets/native/components/form-field.js +20 -10
- package/dist/targets/native/components/form-screen.js +50 -45
- package/dist/targets/native/components/google-icon.js +31 -25
- package/dist/targets/native/components/icon-button.js +6 -4
- package/dist/targets/native/components/icon.js +2 -1
- package/dist/targets/native/components/image-upload.js +59 -50
- package/dist/targets/native/components/index.d.ts +0 -2
- package/dist/targets/native/components/index.js +0 -4
- package/dist/targets/native/components/input.js +41 -34
- package/dist/targets/native/components/list-item.js +29 -23
- package/dist/targets/native/components/menu.js +12 -10
- package/dist/targets/native/components/modal.js +41 -32
- package/dist/targets/native/components/radio.js +19 -16
- package/dist/targets/native/components/search.js +41 -38
- package/dist/targets/native/components/select.js +71 -63
- package/dist/targets/native/components/sheet.js +36 -30
- package/dist/targets/native/components/skeleton.js +6 -5
- package/dist/targets/native/components/slider.js +51 -43
- package/dist/targets/native/components/spinner.js +2 -1
- package/dist/targets/native/components/stepper.js +14 -9
- package/dist/targets/native/components/switch.js +15 -14
- package/dist/targets/native/components/text.js +2 -1
- package/dist/targets/native/components/textarea.js +2 -1
- package/dist/targets/native/components/theme.js +2 -1
- package/dist/targets/native/components/toaster.js +24 -21
- package/dist/targets/native/index.d.ts +1 -1
- package/dist/targets/native/index.js +1 -3
- 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 +35 -16
- package/styles/_primitives.generated.css +40 -0
- package/styles/base.css +15 -21
- 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/brand/rojao-black-on-white.png +0 -0
- package/brand/rojao-black.png +0 -0
- package/brand/rojao-white-on-black.png +0 -0
- package/brand/rojao-white.png +0 -0
- package/dist/components/blocker-card.d.ts +0 -42
- package/dist/components/blocker-card.js +0 -45
- package/dist/components/bottom-sheet.d.ts +0 -31
- package/dist/components/bottom-sheet.js +0 -120
- package/dist/components/chat-bubble.d.ts +0 -16
- package/dist/components/chat-bubble.js +0 -55
- package/dist/components/chips.d.ts +0 -22
- package/dist/components/chips.js +0 -94
- package/dist/components/copilot-hint.d.ts +0 -18
- package/dist/components/copilot-hint.js +0 -63
- package/dist/components/divider.d.ts +0 -20
- package/dist/components/divider.js +0 -47
- package/dist/components/empty-state.d.ts +0 -48
- package/dist/components/empty-state.js +0 -91
- package/dist/components/form-card-header.d.ts +0 -13
- package/dist/components/form-card-header.js +0 -8
- package/dist/components/label.d.ts +0 -16
- package/dist/components/label.js +0 -43
- package/dist/components/menu.d.ts +0 -50
- package/dist/components/menu.js +0 -80
- package/dist/components/modal.d.ts +0 -25
- package/dist/components/modal.js +0 -71
- package/dist/components/notice.d.ts +0 -50
- package/dist/components/notice.js +0 -103
- package/dist/components/page-tabs.d.ts +0 -35
- package/dist/components/page-tabs.js +0 -55
- package/dist/components/paywall-banner.d.ts +0 -37
- package/dist/components/paywall-banner.js +0 -42
- package/dist/components/paywall.d.ts +0 -44
- package/dist/components/paywall.js +0 -55
- package/dist/components/phone-frame.d.ts +0 -9
- package/dist/components/phone-frame.js +0 -18
- package/dist/components/pix-icon.d.ts +0 -8
- package/dist/components/pix-icon.js +0 -24
- package/dist/components/search.d.ts +0 -30
- package/dist/components/search.js +0 -81
- package/dist/components/themed.d.ts +0 -36
- package/dist/components/themed.js +0 -22
- package/dist/components/toaster.d.ts +0 -84
- package/dist/components/toaster.js +0 -284
- 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 -46
- package/dist/targets/native/components/paywall.d.ts +0 -18
- package/dist/targets/native/components/paywall.js +0 -61
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 { ChevronLeftIcon, ChevronRightIcon } from "./internal/icons.js";
|
|
9
|
+
const range = (start, end) => Array.from({ length: Math.max(0, end - start + 1) }, (_, i) => start + i);
|
|
10
|
+
function pageItems(page, totalPages, siblings = 1, boundaries = 1) {
|
|
11
|
+
const wanted = new Set(
|
|
12
|
+
[...range(1, boundaries), ...range(page - siblings, page + siblings), ...range(totalPages - boundaries + 1, totalPages)].filter(
|
|
13
|
+
(p) => p >= 1 && p <= totalPages
|
|
14
|
+
)
|
|
15
|
+
);
|
|
16
|
+
const sorted = [...wanted].sort((a, b) => a - b);
|
|
17
|
+
const out = [];
|
|
18
|
+
sorted.forEach((p, i) => {
|
|
19
|
+
const previous = sorted[i - 1];
|
|
20
|
+
if (previous !== void 0 && p - previous > 1) {
|
|
21
|
+
out.push(p - previous === 2 ? p - 1 : p < page ? "ellipsis-start" : "ellipsis-end");
|
|
22
|
+
}
|
|
23
|
+
out.push(p);
|
|
24
|
+
});
|
|
25
|
+
return out;
|
|
6
26
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
function Anchor(_a) {
|
|
28
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
29
|
+
return /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({}, props), { children }));
|
|
30
|
+
}
|
|
31
|
+
function Pagination(_c) {
|
|
32
|
+
var _d = _c, {
|
|
33
|
+
page,
|
|
34
|
+
totalPages,
|
|
35
|
+
onChange,
|
|
36
|
+
href,
|
|
37
|
+
linkAs: Link = Anchor,
|
|
38
|
+
summary,
|
|
39
|
+
siblings = 1,
|
|
40
|
+
boundaries = 1,
|
|
41
|
+
hideOnSinglePage = true,
|
|
42
|
+
className
|
|
43
|
+
} = _d, rest = __objRest(_d, [
|
|
44
|
+
"page",
|
|
45
|
+
"totalPages",
|
|
46
|
+
"onChange",
|
|
47
|
+
"href",
|
|
48
|
+
"linkAs",
|
|
49
|
+
"summary",
|
|
50
|
+
"siblings",
|
|
51
|
+
"boundaries",
|
|
52
|
+
"hideOnSinglePage",
|
|
53
|
+
"className"
|
|
54
|
+
]);
|
|
55
|
+
if (hideOnSinglePage && totalPages <= 1 && !summary) return null;
|
|
56
|
+
const control = (target, label, content, current = false) => {
|
|
57
|
+
const off = target < 1 || target > totalPages;
|
|
58
|
+
if (href && !off) {
|
|
59
|
+
return /* @__PURE__ */ jsx(Link, { href: href(target), className: "rds-pagination__item", "aria-label": label, "aria-current": current ? "page" : void 0, children: content });
|
|
60
|
+
}
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
"button",
|
|
63
|
+
{
|
|
64
|
+
type: "button",
|
|
65
|
+
className: "rds-pagination__item",
|
|
66
|
+
"aria-label": label,
|
|
67
|
+
"aria-current": current ? "page" : void 0,
|
|
68
|
+
disabled: off,
|
|
69
|
+
onClick: off ? void 0 : () => onChange == null ? void 0 : onChange(target),
|
|
70
|
+
children: content
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
const arrow = (icon) => /* @__PURE__ */ jsx("span", { className: "rds-pagination__icon", "aria-hidden": "true", children: icon });
|
|
75
|
+
return /* @__PURE__ */ jsxs("nav", __spreadProps(__spreadValues({ "aria-label": "Pagina\xE7\xE3o" }, rest), { className: ["rds-pagination", className].filter(Boolean).join(" "), children: [
|
|
76
|
+
summary && /* @__PURE__ */ jsx("p", { className: "rds-pagination__summary", "aria-live": "polite", children: summary }),
|
|
77
|
+
!(hideOnSinglePage && totalPages <= 1) && /* @__PURE__ */ jsxs("ul", { className: "rds-pagination__pages", children: [
|
|
78
|
+
/* @__PURE__ */ jsx("li", { children: control(page - 1, "P\xE1gina anterior", arrow(/* @__PURE__ */ jsx(ChevronLeftIcon, {}))) }),
|
|
79
|
+
pageItems(page, totalPages, siblings, boundaries).map((entry) => /* @__PURE__ */ jsx("li", { children: typeof entry === "string" ? /* @__PURE__ */ jsx("span", { className: "rds-pagination__item rds-pagination__item--ellipsis", "aria-hidden": "true", children: "\u2026" }) : control(entry, `P\xE1gina ${entry}`, entry, entry === page) }, entry)),
|
|
80
|
+
/* @__PURE__ */ jsx("li", { children: control(page + 1, "Pr\xF3xima p\xE1gina", arrow(/* @__PURE__ */ jsx(ChevronRightIcon, {}))) })
|
|
81
|
+
] })
|
|
82
|
+
] }));
|
|
29
83
|
}
|
|
30
|
-
const baseBtn = "inline-flex items-center justify-center min-w-9 h-9 px-2 rounded-(--radius-control) text-label transition-colors disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus";
|
|
31
|
-
const Pagination = forwardRef(function Pagination2({
|
|
32
|
-
page,
|
|
33
|
-
totalPages,
|
|
34
|
-
onChange,
|
|
35
|
-
siblings = 1,
|
|
36
|
-
boundaries = 1,
|
|
37
|
-
className = "",
|
|
38
|
-
hideOnSinglePage = true
|
|
39
|
-
}, ref) {
|
|
40
|
-
if (hideOnSinglePage && totalPages <= 1) return null;
|
|
41
|
-
const items = getRange(page, totalPages, siblings, boundaries);
|
|
42
|
-
const canPrev = page > 1;
|
|
43
|
-
const canNext = page < totalPages;
|
|
44
|
-
return /* @__PURE__ */ React.createElement("nav", { ref, role: "navigation", "aria-label": "Pagina\xE7\xE3o", className }, /* @__PURE__ */ React.createElement("ul", { className: "flex items-center gap-1" }, /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement(
|
|
45
|
-
"button",
|
|
46
|
-
{
|
|
47
|
-
type: "button",
|
|
48
|
-
disabled: !canPrev,
|
|
49
|
-
onClick: () => canPrev && onChange(page - 1),
|
|
50
|
-
"aria-label": "P\xE1gina anterior",
|
|
51
|
-
className: [baseBtn, "text-fg-secondary hover:bg-surface-raised"].join(" ")
|
|
52
|
-
},
|
|
53
|
-
/* @__PURE__ */ React.createElement(ChevronLeft, { size: 16 })
|
|
54
|
-
)), items.map((it, idx) => /* @__PURE__ */ React.createElement("li", { key: `${it}-${idx}` }, typeof it === "string" ? /* @__PURE__ */ React.createElement("span", { className: "inline-flex items-center justify-center min-w-9 h-9 text-fg-muted text-label" }, "\u2026") : /* @__PURE__ */ React.createElement(
|
|
55
|
-
"button",
|
|
56
|
-
{
|
|
57
|
-
type: "button",
|
|
58
|
-
onClick: () => onChange(it),
|
|
59
|
-
"aria-current": it === page ? "page" : void 0,
|
|
60
|
-
className: [
|
|
61
|
-
baseBtn,
|
|
62
|
-
it === page ? "bg-brand-primary text-brand-on-primary" : "text-fg-secondary hover:bg-surface-raised"
|
|
63
|
-
].join(" ")
|
|
64
|
-
},
|
|
65
|
-
it
|
|
66
|
-
))), /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement(
|
|
67
|
-
"button",
|
|
68
|
-
{
|
|
69
|
-
type: "button",
|
|
70
|
-
disabled: !canNext,
|
|
71
|
-
onClick: () => canNext && onChange(page + 1),
|
|
72
|
-
"aria-label": "Pr\xF3xima p\xE1gina",
|
|
73
|
-
className: [baseBtn, "text-fg-secondary hover:bg-surface-raised"].join(" ")
|
|
74
|
-
},
|
|
75
|
-
/* @__PURE__ */ React.createElement(ChevronRight, { size: 16 })
|
|
76
|
-
))));
|
|
77
|
-
});
|
|
78
84
|
export {
|
|
79
|
-
Pagination
|
|
85
|
+
Pagination,
|
|
86
|
+
pageItems
|
|
80
87
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithRef } from 'react';
|
|
3
|
+
import { FieldTextProps } from './internal/field.js';
|
|
4
|
+
|
|
5
|
+
interface PasswordInputProps extends FieldTextProps, Omit<ComponentPropsWithRef<'input'>, 'type' | 'children' | 'prefix' | 'size'> {
|
|
6
|
+
/** current-password to sign in, new-password to create one: the password manager fills or suggests. */
|
|
7
|
+
autoComplete?: 'current-password' | 'new-password';
|
|
8
|
+
/** Controlled (Figma: `revealed`): the password shows as text. */
|
|
9
|
+
revealed?: boolean;
|
|
10
|
+
/** Uncontrolled: starts shown. */
|
|
11
|
+
defaultRevealed?: boolean;
|
|
12
|
+
onRevealedChange?: (revealed: boolean) => void;
|
|
13
|
+
/** The eye button's accessible name. It stays the same; aria-pressed says whether it is on. */
|
|
14
|
+
revealLabel?: string;
|
|
15
|
+
/** Said to screen readers when the password shows and when it hides again. */
|
|
16
|
+
revealedMessage?: string;
|
|
17
|
+
hiddenMessage?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* PasswordInput — Figma [RDS] Forms/PasswordInput. A password field with the eye built in, so the person
|
|
21
|
+
* can check what they typed. The eye is a toggle button (aria-pressed) and the change is announced.
|
|
22
|
+
* Same field as the Input (styles: internal/field.css).
|
|
23
|
+
*/
|
|
24
|
+
declare function PasswordInput({ label, labelPosition, hint, error, errorMessage, required, id, disabled, className, style, autoComplete, revealed: revealedProp, defaultRevealed, onRevealedChange, revealLabel, revealedMessage, hiddenMessage, ...input }: PasswordInputProps): react.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { PasswordInput, type PasswordInputProps };
|
|
@@ -0,0 +1,112 @@
|
|
|
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 { useState } from "react";
|
|
9
|
+
import { announce } from "./internal/announce.js";
|
|
10
|
+
import { FieldAction, FieldShell, hasContent, useFieldIds, warnIfUnlabelled } from "./internal/field.js";
|
|
11
|
+
import { EyeIcon, EyeOffIcon } from "./internal/icons.js";
|
|
12
|
+
function PasswordInput(_a) {
|
|
13
|
+
var _b = _a, {
|
|
14
|
+
label,
|
|
15
|
+
labelPosition,
|
|
16
|
+
hint,
|
|
17
|
+
error,
|
|
18
|
+
errorMessage,
|
|
19
|
+
required,
|
|
20
|
+
id,
|
|
21
|
+
disabled,
|
|
22
|
+
className,
|
|
23
|
+
style,
|
|
24
|
+
autoComplete = "current-password",
|
|
25
|
+
revealed: revealedProp,
|
|
26
|
+
defaultRevealed = false,
|
|
27
|
+
onRevealedChange,
|
|
28
|
+
revealLabel = "Mostrar senha",
|
|
29
|
+
revealedMessage = "Senha vis\xEDvel",
|
|
30
|
+
hiddenMessage = "Senha oculta"
|
|
31
|
+
} = _b, input = __objRest(_b, [
|
|
32
|
+
"label",
|
|
33
|
+
"labelPosition",
|
|
34
|
+
"hint",
|
|
35
|
+
"error",
|
|
36
|
+
"errorMessage",
|
|
37
|
+
"required",
|
|
38
|
+
"id",
|
|
39
|
+
"disabled",
|
|
40
|
+
"className",
|
|
41
|
+
"style",
|
|
42
|
+
"autoComplete",
|
|
43
|
+
"revealed",
|
|
44
|
+
"defaultRevealed",
|
|
45
|
+
"onRevealedChange",
|
|
46
|
+
"revealLabel",
|
|
47
|
+
"revealedMessage",
|
|
48
|
+
"hiddenMessage"
|
|
49
|
+
]);
|
|
50
|
+
warnIfUnlabelled("PasswordInput", label, input["aria-label"], input["aria-labelledby"]);
|
|
51
|
+
const { controlId, hintId, errorId, invalid, describedBy } = useFieldIds(id, hint, error, errorMessage);
|
|
52
|
+
const [ownRevealed, setOwnRevealed] = useState(defaultRevealed);
|
|
53
|
+
const revealed = revealedProp != null ? revealedProp : ownRevealed;
|
|
54
|
+
const floating = labelPosition === "floating" && hasContent(label);
|
|
55
|
+
function toggle() {
|
|
56
|
+
const next = !revealed;
|
|
57
|
+
setOwnRevealed(next);
|
|
58
|
+
onRevealedChange == null ? void 0 : onRevealedChange(next);
|
|
59
|
+
announce(next ? revealedMessage : hiddenMessage);
|
|
60
|
+
}
|
|
61
|
+
return /* @__PURE__ */ jsxs(
|
|
62
|
+
FieldShell,
|
|
63
|
+
{
|
|
64
|
+
kind: "rds-password-input",
|
|
65
|
+
controlId,
|
|
66
|
+
hintId,
|
|
67
|
+
errorId,
|
|
68
|
+
label,
|
|
69
|
+
labelPosition,
|
|
70
|
+
hint,
|
|
71
|
+
errorMessage,
|
|
72
|
+
invalid,
|
|
73
|
+
required,
|
|
74
|
+
disabled,
|
|
75
|
+
boxClassName: "rds-field__box--action",
|
|
76
|
+
className,
|
|
77
|
+
style,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
"input",
|
|
81
|
+
__spreadProps(__spreadValues({}, input), {
|
|
82
|
+
id: controlId,
|
|
83
|
+
className: "rds-field__control",
|
|
84
|
+
type: revealed ? "text" : "password",
|
|
85
|
+
autoComplete,
|
|
86
|
+
spellCheck: false,
|
|
87
|
+
autoCapitalize: "none",
|
|
88
|
+
required,
|
|
89
|
+
disabled,
|
|
90
|
+
"aria-invalid": invalid || void 0,
|
|
91
|
+
"aria-describedby": [describedBy, input["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
92
|
+
placeholder: floating ? " " : input.placeholder
|
|
93
|
+
})
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
FieldAction,
|
|
97
|
+
{
|
|
98
|
+
label: revealLabel,
|
|
99
|
+
"aria-pressed": revealed,
|
|
100
|
+
"aria-controls": controlId,
|
|
101
|
+
disabled,
|
|
102
|
+
icon: revealed ? /* @__PURE__ */ jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {}),
|
|
103
|
+
onClick: toggle
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
PasswordInput
|
|
112
|
+
};
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { InputHTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
interface PhoneInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'defaultValue' | 'size'> {
|
|
4
|
+
interface PhoneInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'defaultValue' | 'size' | 'prefix' | 'type'> {
|
|
5
|
+
/** The number's label (the Input's). Without it, pass aria-label. */
|
|
5
6
|
label?: string;
|
|
7
|
+
/** A line under the field (the Input's hint). */
|
|
6
8
|
helper?: string;
|
|
9
|
+
/** What is wrong with the number (the Input's error message). */
|
|
7
10
|
error?: string;
|
|
8
11
|
required?: boolean;
|
|
12
|
+
/** Says "(opcional)" after the label. */
|
|
9
13
|
optional?: boolean;
|
|
14
|
+
/** The number in E.164 (+5511987654321). */
|
|
10
15
|
value?: string;
|
|
11
16
|
defaultValue?: string;
|
|
17
|
+
/** Called with the number in E.164; empty when only the dial code is left. */
|
|
12
18
|
onChange?: (value: string) => void;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
|
-
* PhoneInput —
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* A mecânica de máscara/parse/E.164 vem do hook `usePhoneInput` da lib.
|
|
20
|
-
* Submete E.164 via input hidden (prop `name`); onChange entrega E.164.
|
|
21
|
+
* PhoneInput — a composition of the Combobox (the country, searchable by name or code) and the Input (Figma [RDS]
|
|
22
|
+
* Forms/Input, the number, with the dial code as its prefix). The mask, the parsing and E.164 come from
|
|
23
|
+
* `react-international-phone` (an optional peer, needed only here). Submits E.164 through a hidden input named
|
|
24
|
+
* `name`; onChange gets E.164 too. Styles: phone-input.css.
|
|
21
25
|
*/
|
|
22
|
-
declare function PhoneInput({ label, helper, error, required, optional, value, defaultValue, placeholder, name, onChange, id, }: PhoneInputProps): react.JSX.Element;
|
|
26
|
+
declare function PhoneInput({ label, helper, error, required, optional, value, defaultValue, placeholder, name, onChange, id, disabled, className, ...rest }: PhoneInputProps): react.JSX.Element;
|
|
23
27
|
|
|
24
28
|
export { PhoneInput, type PhoneInputProps };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
8
|
import { useId, useMemo, useState } from "react";
|
|
4
9
|
import { usePhoneInput, defaultCountries, parseCountry, FlagImage } from "react-international-phone";
|
|
5
10
|
import { Combobox } from "./combobox.js";
|
|
11
|
+
import { Input } from "./input.js";
|
|
6
12
|
function normalizeToE164(raw) {
|
|
7
13
|
if (!raw) return "";
|
|
8
14
|
const digits = raw.replace(/\D/g, "");
|
|
@@ -10,19 +16,36 @@ function normalizeToE164(raw) {
|
|
|
10
16
|
if (digits.length >= 12) return `+${digits}`;
|
|
11
17
|
return `+55${digits}`;
|
|
12
18
|
}
|
|
13
|
-
function PhoneInput({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
function PhoneInput(_a) {
|
|
20
|
+
var _b = _a, {
|
|
21
|
+
label,
|
|
22
|
+
helper,
|
|
23
|
+
error,
|
|
24
|
+
required,
|
|
25
|
+
optional,
|
|
26
|
+
value,
|
|
27
|
+
defaultValue = "",
|
|
28
|
+
placeholder,
|
|
29
|
+
name,
|
|
30
|
+
onChange,
|
|
31
|
+
id,
|
|
32
|
+
disabled,
|
|
33
|
+
className
|
|
34
|
+
} = _b, rest = __objRest(_b, [
|
|
35
|
+
"label",
|
|
36
|
+
"helper",
|
|
37
|
+
"error",
|
|
38
|
+
"required",
|
|
39
|
+
"optional",
|
|
40
|
+
"value",
|
|
41
|
+
"defaultValue",
|
|
42
|
+
"placeholder",
|
|
43
|
+
"name",
|
|
44
|
+
"onChange",
|
|
45
|
+
"id",
|
|
46
|
+
"disabled",
|
|
47
|
+
"className"
|
|
48
|
+
]);
|
|
26
49
|
const generatedId = useId();
|
|
27
50
|
const inputId = id != null ? id : generatedId;
|
|
28
51
|
const controlled = value !== void 0;
|
|
@@ -48,44 +71,51 @@ function PhoneInput({
|
|
|
48
71
|
const p = parseCountry(c);
|
|
49
72
|
return {
|
|
50
73
|
value: p.iso2,
|
|
51
|
-
label: p.name
|
|
52
|
-
|
|
53
|
-
icon: /* @__PURE__ */ React.createElement(FlagImage, { iso2: p.iso2, size: "18px" })
|
|
74
|
+
label: `${p.name} +${p.dialCode}`,
|
|
75
|
+
icon: /* @__PURE__ */ jsx(FlagImage, { iso2: p.iso2, size: "18px" })
|
|
54
76
|
};
|
|
55
77
|
}),
|
|
56
78
|
[]
|
|
57
79
|
);
|
|
58
|
-
const
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
const labelText = label && optional && !required ? `${label} (opcional)` : label;
|
|
81
|
+
return /* @__PURE__ */ jsxs("div", { className: ["rds-phone-input", labelText && "rds-phone-input--labelled", className].filter(Boolean).join(" "), children: [
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
Combobox,
|
|
84
|
+
{
|
|
85
|
+
className: "rds-phone-input__country",
|
|
86
|
+
"aria-label": "Pa\xEDs",
|
|
87
|
+
options: countryOptions,
|
|
88
|
+
value: country.iso2,
|
|
89
|
+
onValueChange: (iso2) => {
|
|
90
|
+
if (iso2) setCountry(iso2);
|
|
91
|
+
},
|
|
92
|
+
leadingIcon: /* @__PURE__ */ jsx(FlagImage, { iso2: country.iso2, size: "18px" }),
|
|
93
|
+
placeholder: "Pa\xEDs",
|
|
94
|
+
emptyMessage: "Nenhum pa\xEDs com esse nome.",
|
|
95
|
+
disabled
|
|
74
96
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
Input,
|
|
100
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
101
|
+
className: "rds-phone-input__number",
|
|
102
|
+
id: inputId,
|
|
103
|
+
ref: inputRef,
|
|
104
|
+
label: labelText,
|
|
105
|
+
prefix: `+${country.dialCode}`,
|
|
106
|
+
type: "tel",
|
|
107
|
+
autoComplete: "tel-national",
|
|
108
|
+
value: inputValue,
|
|
109
|
+
onChange: handlePhoneValueChange,
|
|
110
|
+
placeholder,
|
|
111
|
+
required,
|
|
112
|
+
disabled,
|
|
113
|
+
hint: helper,
|
|
114
|
+
errorMessage: error
|
|
115
|
+
})
|
|
116
|
+
),
|
|
117
|
+
name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: displayValue })
|
|
118
|
+
] });
|
|
89
119
|
}
|
|
90
120
|
export {
|
|
91
121
|
PhoneInput
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type PhonePlatform = 'ios' | 'android';
|
|
5
|
+
interface PhoneProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* The screen (Figma: slot `screen`): the browser's useful area, 390 × 700 on ios and 412 × 795 on android (taller
|
|
8
|
+
* without the browser). It scrolls when the content is taller.
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** The browser's bars (Figma: `browser`). Off, it is a native app: only the status bar and the system bar. */
|
|
12
|
+
browser?: boolean;
|
|
13
|
+
/** The address in the browser bar (Figma: `url`). */
|
|
14
|
+
url?: string;
|
|
15
|
+
/** ios: an iPhone (390 × 844) with Safari, the address at the bottom; android: 412 × 915 with Chrome, at the top. */
|
|
16
|
+
platform?: PhonePlatform;
|
|
17
|
+
/** The time in the status bar. */
|
|
18
|
+
time?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Phone — Figma [RDS] External/Phone. A MOCKUP for flows, specs and showrooms: the phone with the browser, to show a
|
|
22
|
+
* screen the way it looks on the device. The bars are decorative (hidden from screen readers); the screen is live.
|
|
23
|
+
* Styles: phone.css.
|
|
24
|
+
*/
|
|
25
|
+
declare function Phone({ children, browser, url, platform, time, className, ...rest }: PhoneProps): react.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { Phone, type PhonePlatform, type PhoneProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
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 Phone(_a) {
|
|
9
|
+
var _b = _a, { children, browser = true, url = "rojao.studio", platform = "ios", time = "9:41", className } = _b, rest = __objRest(_b, ["children", "browser", "url", "platform", "time", "className"]);
|
|
10
|
+
const address = /* @__PURE__ */ jsxs("div", { className: "rds-phone__address", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(LockIcon, {}),
|
|
12
|
+
/* @__PURE__ */ jsx("span", { children: url })
|
|
13
|
+
] });
|
|
14
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-phone", `rds-phone--${platform}`, className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("div", { className: "rds-phone__device", children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-phone__status", "aria-hidden": "true", children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: "rds-phone__time", children: time }),
|
|
17
|
+
platform === "ios" ? /* @__PURE__ */ jsx("span", { className: "rds-phone__island" }) : /* @__PURE__ */ jsx("span", { className: "rds-phone__camera" }),
|
|
18
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-phone__indicators", children: [
|
|
19
|
+
/* @__PURE__ */ jsx("span", { className: "rds-phone__signal" }),
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "rds-phone__battery" })
|
|
21
|
+
] })
|
|
22
|
+
] }),
|
|
23
|
+
browser && platform === "android" && /* @__PURE__ */ jsxs("div", { className: "rds-phone__browser rds-phone__browser--top", "aria-hidden": "true", children: [
|
|
24
|
+
address,
|
|
25
|
+
/* @__PURE__ */ jsx("span", { className: "rds-phone__tabs", children: "1" }),
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "rds-phone__menu" })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: "rds-phone__screen", children }),
|
|
29
|
+
browser && platform === "ios" && /* @__PURE__ */ jsx("div", { className: "rds-phone__browser rds-phone__browser--bottom", "aria-hidden": "true", children: address }),
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: "rds-phone__system", "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { className: "rds-phone__home" }) })
|
|
31
|
+
] }) }));
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
Phone
|
|
35
|
+
};
|
|
@@ -1,44 +1,33 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactElement, ReactNode } from 'react';
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* HoverCard, custom dropdowns. Não tem opinião sobre conteúdo.
|
|
7
|
-
*
|
|
8
|
-
* Uso:
|
|
9
|
-
* <Popover
|
|
10
|
-
* trigger={<Button>Abrir</Button>}
|
|
11
|
-
* placement="bottom-start"
|
|
12
|
-
* >
|
|
13
|
-
* <div className="p-3 bg-surface-default rounded-md shadow-lg">
|
|
14
|
-
* Conteúdo aqui
|
|
15
|
-
* </div>
|
|
16
|
-
* </Popover>
|
|
17
|
-
*
|
|
18
|
-
* Recursos: clique fora fecha, ESC fecha, focus trap opcional, posicionamento
|
|
19
|
-
* com flip automático quando não cabe (top → bottom, etc).
|
|
20
|
-
*/
|
|
21
|
-
type PopoverPlacement = 'top-start' | 'top' | 'top-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'right-start' | 'right' | 'right-end';
|
|
5
|
+
type PopoverSide = 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
type PopoverAlign = 'start' | 'center' | 'end';
|
|
22
7
|
interface PopoverProps {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
/** The button that opens it (a Button or IconButton). It gets aria-expanded and aria-controls. */
|
|
9
|
+
trigger: ReactElement;
|
|
10
|
+
/** A short title. It also names the box for screen readers. */
|
|
11
|
+
title?: ReactNode;
|
|
12
|
+
/** Without a title, the box's name for screen readers. */
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
/** The content (Figma: the `content` slot): text, a short list, a small form, a Button. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
side?: PopoverSide;
|
|
17
|
+
align?: PopoverAlign;
|
|
32
18
|
open?: boolean;
|
|
19
|
+
defaultOpen?: boolean;
|
|
33
20
|
onOpenChange?: (open: boolean) => void;
|
|
34
|
-
/** Fecha ao clicar fora. default = true. */
|
|
35
|
-
closeOnOutsideClick?: boolean;
|
|
36
|
-
/** Fecha ao apertar ESC. default = true. */
|
|
37
|
-
closeOnEsc?: boolean;
|
|
38
21
|
className?: string;
|
|
39
|
-
/** Classe CSS do wrapper do trigger. default = "inline-block". */
|
|
40
|
-
triggerClassName?: string;
|
|
41
22
|
}
|
|
42
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Popover — Figma [RDS] Feedback/Popover. A box that opens next to a button, on click or tap (Radix Popover): more
|
|
25
|
+
* about an item without leaving the screen. Escape and a click outside close it, and the focus goes back to the
|
|
26
|
+
* button. A short name for an icon is the Tooltip; something that demands a decision is a Dialog.
|
|
27
|
+
* Styles: popover.css.
|
|
28
|
+
*/
|
|
29
|
+
declare function Popover({ trigger, title, children, side, align, open, defaultOpen, onOpenChange, className, 'aria-label': ariaLabel, }: PopoverProps): react.JSX.Element;
|
|
30
|
+
/** Wraps an element inside the Popover that closes it when pressed (a "Pronto" Button), with asChild. */
|
|
31
|
+
declare const PopoverClose: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
43
32
|
|
|
44
|
-
export { Popover, type
|
|
33
|
+
export { Popover, type PopoverAlign, PopoverClose, type PopoverProps, type PopoverSide };
|