@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ChoiceRowProps {
|
|
5
|
+
/** The component class: rds-checkbox, rds-radio, rds-switch. */
|
|
6
|
+
kind: string;
|
|
7
|
+
/** Renders the native input with the id and the description it must carry. */
|
|
8
|
+
control: (ids: {
|
|
9
|
+
id: string;
|
|
10
|
+
describedBy: string | undefined;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
/** The visible label (Figma: `showLabel` + `label`). Without it the input needs aria-label. */
|
|
13
|
+
label?: ReactNode;
|
|
14
|
+
hint?: ReactNode;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
errorMessage?: ReactNode;
|
|
19
|
+
id?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
declare function ChoiceRow({ kind, control, label, hint, required, disabled, invalid, errorMessage, id, className, style, }: ChoiceRowProps): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { ChoiceRow, type ChoiceRowProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { hasContent } from "./field.js";
|
|
5
|
+
function ChoiceRow({
|
|
6
|
+
kind,
|
|
7
|
+
control,
|
|
8
|
+
label,
|
|
9
|
+
hint,
|
|
10
|
+
required,
|
|
11
|
+
disabled,
|
|
12
|
+
invalid,
|
|
13
|
+
errorMessage,
|
|
14
|
+
id,
|
|
15
|
+
className,
|
|
16
|
+
style
|
|
17
|
+
}) {
|
|
18
|
+
const generated = useId();
|
|
19
|
+
const controlId = id != null ? id : generated;
|
|
20
|
+
const hintId = hasContent(hint) ? `${controlId}-hint` : void 0;
|
|
21
|
+
const errorId = invalid && hasContent(errorMessage) ? `${controlId}-error` : void 0;
|
|
22
|
+
const describedBy = [hintId, errorId].filter(Boolean).join(" ") || void 0;
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: ["rds-choice", kind, invalid && `${kind}--error`, disabled && `${kind}--disabled`, className].filter(Boolean).join(" "),
|
|
27
|
+
style,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("label", { className: "rds-choice__row", htmlFor: controlId, children: [
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: `rds-choice__control ${kind}__control`, children: control({ id: controlId, describedBy }) }),
|
|
31
|
+
hasContent(label) && /* @__PURE__ */ jsxs("span", { className: `rds-choice__label ${kind}__label`, children: [
|
|
32
|
+
label,
|
|
33
|
+
required && /* @__PURE__ */ jsx("span", { className: `${kind}__required`, "aria-hidden": "true", children: " *" })
|
|
34
|
+
] })
|
|
35
|
+
] }),
|
|
36
|
+
hintId && /* @__PURE__ */ jsx("span", { id: hintId, className: `rds-choice__support ${kind}__support ${kind}__hint`, children: hint }),
|
|
37
|
+
errorId && /* @__PURE__ */ jsx("span", { id: errorId, className: `rds-choice__support ${kind}__support ${kind}__error-message`, children: errorMessage })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
ChoiceRow
|
|
44
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type IsoDate = string;
|
|
2
|
+
declare function toIso(date: Date): IsoDate;
|
|
3
|
+
declare function fromIso(iso: IsoDate | undefined | null): Date | null;
|
|
4
|
+
declare function addDays(date: Date, days: number): Date;
|
|
5
|
+
/** Same day of the month in another month, clamped to its last day (31/01 + 1 month = 28 or 29/02). */
|
|
6
|
+
declare function addMonths(date: Date, months: number): Date;
|
|
7
|
+
/** dd/mm/aaaa → ISO, or null when the date does not exist (31/02). */
|
|
8
|
+
declare function parseBr(text: string): IsoDate | null;
|
|
9
|
+
declare function formatBr(iso: IsoDate | undefined | null): string;
|
|
10
|
+
/** Keeps only digits and puts the slashes as the person types: 3009 → 30/09. */
|
|
11
|
+
declare function maskBr(text: string): string;
|
|
12
|
+
/** The full date in pt-BR words ("30 de setembro de 2026"): the name a screen reader hears for a day. */
|
|
13
|
+
declare const dayName: (date: Date) => string;
|
|
14
|
+
/** "Setembro de 2026". */
|
|
15
|
+
declare function monthName(date: Date): string;
|
|
16
|
+
|
|
17
|
+
export { type IsoDate, addDays, addMonths, dayName, formatBr, fromIso, maskBr, monthName, parseBr, toIso };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "../../chunk-ORMEWXMH.js";
|
|
2
|
+
function toIso(date) {
|
|
3
|
+
const y = date.getFullYear();
|
|
4
|
+
const m = String(date.getMonth() + 1).padStart(2, "0");
|
|
5
|
+
const d = String(date.getDate()).padStart(2, "0");
|
|
6
|
+
return `${y}-${m}-${d}`;
|
|
7
|
+
}
|
|
8
|
+
function fromIso(iso) {
|
|
9
|
+
if (!iso || !/^\d{4}-\d{2}-\d{2}$/.test(iso)) return null;
|
|
10
|
+
const [y, m, d] = iso.split("-").map(Number);
|
|
11
|
+
const date = new Date(y, m - 1, d);
|
|
12
|
+
return date.getMonth() === m - 1 && date.getDate() === d ? date : null;
|
|
13
|
+
}
|
|
14
|
+
function addDays(date, days) {
|
|
15
|
+
const next = new Date(date);
|
|
16
|
+
next.setDate(next.getDate() + days);
|
|
17
|
+
return next;
|
|
18
|
+
}
|
|
19
|
+
function addMonths(date, months) {
|
|
20
|
+
const target = new Date(date.getFullYear(), date.getMonth() + months, 1);
|
|
21
|
+
const last = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();
|
|
22
|
+
target.setDate(Math.min(date.getDate(), last));
|
|
23
|
+
return target;
|
|
24
|
+
}
|
|
25
|
+
function parseBr(text) {
|
|
26
|
+
const match = /^(\d{2})\/(\d{2})\/(\d{4})$/.exec(text.trim());
|
|
27
|
+
if (!match) return null;
|
|
28
|
+
const iso = `${match[3]}-${match[2]}-${match[1]}`;
|
|
29
|
+
return fromIso(iso) ? iso : null;
|
|
30
|
+
}
|
|
31
|
+
function formatBr(iso) {
|
|
32
|
+
const date = fromIso(iso);
|
|
33
|
+
if (!date) return "";
|
|
34
|
+
return `${String(date.getDate()).padStart(2, "0")}/${String(date.getMonth() + 1).padStart(2, "0")}/${date.getFullYear()}`;
|
|
35
|
+
}
|
|
36
|
+
function maskBr(text) {
|
|
37
|
+
const d = text.replace(/\D/g, "").slice(0, 8);
|
|
38
|
+
if (d.length > 4) return `${d.slice(0, 2)}/${d.slice(2, 4)}/${d.slice(4)}`;
|
|
39
|
+
if (d.length > 2) return `${d.slice(0, 2)}/${d.slice(2)}`;
|
|
40
|
+
return d;
|
|
41
|
+
}
|
|
42
|
+
const longDate = new Intl.DateTimeFormat("pt-BR", { day: "numeric", month: "long", year: "numeric" });
|
|
43
|
+
const monthTitle = new Intl.DateTimeFormat("pt-BR", { month: "long", year: "numeric" });
|
|
44
|
+
const dayName = (date) => longDate.format(date);
|
|
45
|
+
function monthName(date) {
|
|
46
|
+
const text = monthTitle.format(date);
|
|
47
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
addDays,
|
|
51
|
+
addMonths,
|
|
52
|
+
dayName,
|
|
53
|
+
formatBr,
|
|
54
|
+
fromIso,
|
|
55
|
+
maskBr,
|
|
56
|
+
monthName,
|
|
57
|
+
parseBr,
|
|
58
|
+
toIso
|
|
59
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes, HTMLAttributes, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
type FieldLabelPosition = 'top' | 'floating';
|
|
5
|
+
interface FieldTextProps {
|
|
6
|
+
/**
|
|
7
|
+
* The label (Figma: `showLabel` + `label`), always tied to the control. Without it the field has no
|
|
8
|
+
* visible name: pass aria-label (a search in a header).
|
|
9
|
+
*/
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
/** top (default): the label above the box. floating: inside the box, shrinking on focus or with a value. */
|
|
12
|
+
labelPosition?: FieldLabelPosition;
|
|
13
|
+
/** A line under the box (Figma: `showHint` + `hint`), tied by aria-describedby. Gives way to the error message. */
|
|
14
|
+
hint?: ReactNode;
|
|
15
|
+
/** The error state (Figma: `error`): red border and aria-invalid. Passing `errorMessage` turns it on too. */
|
|
16
|
+
error?: boolean;
|
|
17
|
+
/** What went wrong and how to fix it, never just "campo inválido". Turns the error state on. */
|
|
18
|
+
errorMessage?: ReactNode;
|
|
19
|
+
/** Shows the asterisk and sets the native required (read as "obrigatório"). */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** The ids a field's control points to, and whether it is in error. */
|
|
23
|
+
declare function useFieldIds(id: string | undefined, hint: ReactNode, error: boolean | undefined, errorMessage: ReactNode): {
|
|
24
|
+
controlId: string;
|
|
25
|
+
hintId: string | undefined;
|
|
26
|
+
errorId: string | undefined;
|
|
27
|
+
invalid: boolean;
|
|
28
|
+
describedBy: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
declare const hasContent: (node: ReactNode) => boolean;
|
|
31
|
+
/** A field without a visible label needs a name, or a screen reader only says "edit text". */
|
|
32
|
+
declare function warnIfUnlabelled(component: string, label: ReactNode, ariaLabel: unknown, ariaLabelledBy: unknown): void;
|
|
33
|
+
interface FieldShellProps {
|
|
34
|
+
/** The component class (rds-input, rds-textarea, rds-select). */
|
|
35
|
+
kind: string;
|
|
36
|
+
controlId: string;
|
|
37
|
+
hintId?: string;
|
|
38
|
+
errorId?: string;
|
|
39
|
+
label?: ReactNode;
|
|
40
|
+
labelPosition?: FieldLabelPosition;
|
|
41
|
+
hint?: ReactNode;
|
|
42
|
+
errorMessage?: ReactNode;
|
|
43
|
+
invalid: boolean;
|
|
44
|
+
required?: boolean;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** The box contents, in order: leading parts, the control, trailing parts. */
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
/** Extra class on the box (for example when it ends on an action). */
|
|
49
|
+
boxClassName?: string;
|
|
50
|
+
/** What goes between the box and the hint or error (the NumberInput's named steps). */
|
|
51
|
+
afterBox?: ReactNode;
|
|
52
|
+
/** Event handlers on the box (the FileInput's drag and drop). */
|
|
53
|
+
boxProps?: Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'role' | 'children'>;
|
|
54
|
+
className?: string;
|
|
55
|
+
style?: CSSProperties;
|
|
56
|
+
}
|
|
57
|
+
declare function FieldShell({ kind, controlId, hintId, errorId, label, labelPosition, hint, errorMessage, invalid, required, disabled, children, boxClassName, afterBox, boxProps, className, style, }: FieldShellProps): react.JSX.Element;
|
|
58
|
+
/** The 32 × 32 button inside a field (Figma: .action): clear, show password. Always named. */
|
|
59
|
+
declare function FieldAction({ label, icon, ...rest }: {
|
|
60
|
+
label: string;
|
|
61
|
+
icon: ReactNode;
|
|
62
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>): react.JSX.Element;
|
|
63
|
+
/** Clears a field the way typing would: React's onChange fires, controlled or not. */
|
|
64
|
+
declare function clearNativeValue(element: HTMLInputElement | HTMLTextAreaElement | null): void;
|
|
65
|
+
|
|
66
|
+
export { FieldAction, type FieldLabelPosition, FieldShell, type FieldShellProps, type FieldTextProps, clearNativeValue, hasContent, useFieldIds, warnIfUnlabelled };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-ORMEWXMH.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useId } from "react";
|
|
8
|
+
function useFieldIds(id, hint, error, errorMessage) {
|
|
9
|
+
const generated = useId();
|
|
10
|
+
const controlId = id != null ? id : generated;
|
|
11
|
+
const invalid = Boolean(error || hasContent(errorMessage));
|
|
12
|
+
const errorId = invalid && hasContent(errorMessage) ? `${controlId}-error` : void 0;
|
|
13
|
+
const hintId = hasContent(hint) && !errorId ? `${controlId}-hint` : void 0;
|
|
14
|
+
return { controlId, hintId, errorId, invalid, describedBy: [hintId, errorId].filter(Boolean).join(" ") || void 0 };
|
|
15
|
+
}
|
|
16
|
+
const hasContent = (node) => node !== void 0 && node !== null && node !== false && node !== "";
|
|
17
|
+
function warnIfUnlabelled(component, label, ariaLabel, ariaLabelledBy) {
|
|
18
|
+
if (!hasContent(label) && !ariaLabel && !ariaLabelledBy) {
|
|
19
|
+
console.warn(`[@rojaostudio/ds] ${component} without label needs aria-label.`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function LabelText({ label, required }) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
label,
|
|
25
|
+
required && /* @__PURE__ */ jsx("span", { className: "rds-field__required", "aria-hidden": "true", children: " *" })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
function FieldShell({
|
|
29
|
+
kind,
|
|
30
|
+
controlId,
|
|
31
|
+
hintId,
|
|
32
|
+
errorId,
|
|
33
|
+
label,
|
|
34
|
+
labelPosition = "top",
|
|
35
|
+
hint,
|
|
36
|
+
errorMessage,
|
|
37
|
+
invalid,
|
|
38
|
+
required,
|
|
39
|
+
disabled,
|
|
40
|
+
children,
|
|
41
|
+
boxClassName,
|
|
42
|
+
afterBox,
|
|
43
|
+
boxProps,
|
|
44
|
+
className,
|
|
45
|
+
style
|
|
46
|
+
}) {
|
|
47
|
+
const labelled = hasContent(label);
|
|
48
|
+
const floating = labelPosition === "floating" && labelled;
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: [
|
|
53
|
+
"rds-field",
|
|
54
|
+
kind,
|
|
55
|
+
floating && "rds-field--floating",
|
|
56
|
+
invalid && "rds-field--error",
|
|
57
|
+
disabled && "rds-field--disabled",
|
|
58
|
+
className
|
|
59
|
+
].filter(Boolean).join(" "),
|
|
60
|
+
style,
|
|
61
|
+
children: [
|
|
62
|
+
labelled && !floating && /* @__PURE__ */ jsx("label", { htmlFor: controlId, className: "rds-field__label", children: /* @__PURE__ */ jsx(LabelText, { label, required }) }),
|
|
63
|
+
/* @__PURE__ */ jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
__spreadProps(__spreadValues({}, boxProps), {
|
|
66
|
+
className: ["rds-field__box", boxClassName].filter(Boolean).join(" "),
|
|
67
|
+
role: disabled ? "group" : void 0,
|
|
68
|
+
"aria-disabled": disabled || void 0,
|
|
69
|
+
children: [
|
|
70
|
+
floating && /* @__PURE__ */ jsx("label", { htmlFor: controlId, className: "rds-field__float-label", children: /* @__PURE__ */ jsx(LabelText, { label, required }) }),
|
|
71
|
+
children
|
|
72
|
+
]
|
|
73
|
+
})
|
|
74
|
+
),
|
|
75
|
+
afterBox,
|
|
76
|
+
errorId ? /* @__PURE__ */ jsx("span", { id: errorId, className: "rds-field__support rds-field__error-message", children: errorMessage }) : hintId && /* @__PURE__ */ jsx("span", { id: hintId, className: "rds-field__support rds-field__hint", children: hint })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function FieldAction(_a) {
|
|
82
|
+
var _b = _a, {
|
|
83
|
+
label,
|
|
84
|
+
icon
|
|
85
|
+
} = _b, rest = __objRest(_b, [
|
|
86
|
+
"label",
|
|
87
|
+
"icon"
|
|
88
|
+
]);
|
|
89
|
+
return /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues({ type: "button", "aria-label": label }, rest), { className: "rds-field__action", children: /* @__PURE__ */ jsx("span", { className: "rds-field__action-icon", "aria-hidden": "true", children: icon }) }));
|
|
90
|
+
}
|
|
91
|
+
function clearNativeValue(element) {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
if (!element) return;
|
|
94
|
+
const prototype = element instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype;
|
|
95
|
+
(_b = (_a = Object.getOwnPropertyDescriptor(prototype, "value")) == null ? void 0 : _a.set) == null ? void 0 : _b.call(element, "");
|
|
96
|
+
element.dispatchEvent(new Event("input", { bubbles: true }));
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
FieldAction,
|
|
100
|
+
FieldShell,
|
|
101
|
+
clearNativeValue,
|
|
102
|
+
hasContent,
|
|
103
|
+
useFieldIds,
|
|
104
|
+
warnIfUnlabelled
|
|
105
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { FieldsetHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ChoiceFieldsetProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'children'> {
|
|
5
|
+
/** The question (Figma: `legend`). It names the group: without it, a screen reader hears only the option. */
|
|
6
|
+
legend: ReactNode;
|
|
7
|
+
/** Shows the asterisk. */
|
|
8
|
+
required?: boolean;
|
|
9
|
+
/** A line under the question (Figma: `showHint` + `hint`), tied by aria-describedby. */
|
|
10
|
+
hint?: ReactNode;
|
|
11
|
+
/** The group is in error (Figma: `error`). Passing `errorMessage` turns it on too. */
|
|
12
|
+
error?: boolean;
|
|
13
|
+
/** What is missing and how to fix it: one message for the whole group. Turns the error state on. */
|
|
14
|
+
errorMessage?: ReactNode;
|
|
15
|
+
/** The options (Figma: slot `options`). */
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare function ChoiceFieldset({ kind, legend, required, hint, error, errorMessage, requiredText, className, children, ...rest }: ChoiceFieldsetProps & {
|
|
19
|
+
/** The component class (rds-checkbox-group, rds-radio-group). */
|
|
20
|
+
kind: string;
|
|
21
|
+
/** Said after the legend when the group cannot carry aria-required (a plain group). */
|
|
22
|
+
requiredText?: string;
|
|
23
|
+
}): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { ChoiceFieldset, type ChoiceFieldsetProps };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useId } from "react";
|
|
8
|
+
import { hasContent } from "./field.js";
|
|
9
|
+
function ChoiceFieldset(_a) {
|
|
10
|
+
var _b = _a, {
|
|
11
|
+
kind,
|
|
12
|
+
legend,
|
|
13
|
+
required,
|
|
14
|
+
hint,
|
|
15
|
+
error,
|
|
16
|
+
errorMessage,
|
|
17
|
+
requiredText,
|
|
18
|
+
className,
|
|
19
|
+
children
|
|
20
|
+
} = _b, rest = __objRest(_b, [
|
|
21
|
+
"kind",
|
|
22
|
+
"legend",
|
|
23
|
+
"required",
|
|
24
|
+
"hint",
|
|
25
|
+
"error",
|
|
26
|
+
"errorMessage",
|
|
27
|
+
"requiredText",
|
|
28
|
+
"className",
|
|
29
|
+
"children"
|
|
30
|
+
]);
|
|
31
|
+
const id = useId();
|
|
32
|
+
const invalid = Boolean(error || hasContent(errorMessage));
|
|
33
|
+
const hintId = hasContent(hint) ? `${id}-hint` : void 0;
|
|
34
|
+
const errorId = invalid && hasContent(errorMessage) ? `${id}-error` : void 0;
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
"fieldset",
|
|
37
|
+
__spreadProps(__spreadValues({
|
|
38
|
+
"aria-describedby": [hintId, errorId].filter(Boolean).join(" ") || void 0
|
|
39
|
+
}, rest), {
|
|
40
|
+
className: ["rds-fieldset", kind, invalid && `${kind}--error`, className].filter(Boolean).join(" "),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("legend", { className: `rds-fieldset__legend ${kind}__legend`, children: [
|
|
43
|
+
legend,
|
|
44
|
+
required && /* @__PURE__ */ jsx("span", { className: `${kind}__required`, "aria-hidden": "true", children: " *" }),
|
|
45
|
+
required && requiredText && /* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: ` (${requiredText})` })
|
|
46
|
+
] }),
|
|
47
|
+
hintId && /* @__PURE__ */ jsx("span", { id: hintId, className: `rds-fieldset__support ${kind}__support ${kind}__hint`, children: hint }),
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: "rds-fieldset__options", children }),
|
|
49
|
+
errorId && /* @__PURE__ */ jsx("span", { id: errorId, className: `rds-fieldset__support ${kind}__support ${kind}__error-message`, children: errorMessage })
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
ChoiceFieldset
|
|
56
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../../chunk-ORMEWXMH.js";
|
|
2
|
+
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
3
|
+
function focusAfter(element) {
|
|
4
|
+
if (!element || typeof document === "undefined") return;
|
|
5
|
+
const all = Array.from(document.querySelectorAll(FOCUSABLE)).filter((el) => !element.contains(el));
|
|
6
|
+
const next = all.find((el) => element.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
7
|
+
const previous = [...all].reverse().find((el) => element.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING);
|
|
8
|
+
const target = next != null ? next : previous;
|
|
9
|
+
requestAnimationFrame(() => target == null ? void 0 : target.focus());
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
focusAfter
|
|
13
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type GoogleLayout = 'm3' | 'oauth';
|
|
5
|
+
/**
|
|
6
|
+
* The G of Google, in its four colours (Figma: .google/g). The brand's own mark, drawn only where the Figma draws
|
|
7
|
+
* it (the sign-in button and the Google screens); never recoloured. The fills are the mark's, not the theme's.
|
|
8
|
+
*/
|
|
9
|
+
declare function GoogleG(): react.JSX.Element;
|
|
10
|
+
/** The outlined field with the floating label (Figma: .google/field). focus: label on top, 2px primary border. */
|
|
11
|
+
declare function GoogleField({ label, value, state }: {
|
|
12
|
+
label: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
state?: 'default' | 'focus' | 'filled';
|
|
15
|
+
}): react.JSX.Element;
|
|
16
|
+
/** The account the screen is about: initial, e-mail and the chevron to switch (Figma: .google/account-chip). */
|
|
17
|
+
declare function GoogleAccountChip({ email }: {
|
|
18
|
+
email: string;
|
|
19
|
+
}): react.JSX.Element;
|
|
20
|
+
/** The primary button and the text action on its left (Figma: actions). */
|
|
21
|
+
declare function GoogleActions({ secondary, primary }: {
|
|
22
|
+
secondary: string;
|
|
23
|
+
primary: string;
|
|
24
|
+
}): react.JSX.Element;
|
|
25
|
+
interface GoogleScreenProps {
|
|
26
|
+
layout: GoogleLayout;
|
|
27
|
+
/** What the mockup shows, for screen readers. */
|
|
28
|
+
label: string;
|
|
29
|
+
title: ReactNode;
|
|
30
|
+
/** Under the title: the "Prosseguir para <app>" line or the account chip. */
|
|
31
|
+
intro?: ReactNode;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The Google screen: the page, the card and the footer. m3: a card in two panels (the G, the title and the intro on
|
|
37
|
+
* the left; the form on the right), stacked below 640 of container width. oauth: the narrow card with the "Fazer
|
|
38
|
+
* Login com o Google" header and everything centred, edge to edge below 640.
|
|
39
|
+
*/
|
|
40
|
+
declare function GoogleScreen({ layout, label, title, intro, children, className }: GoogleScreenProps): react.JSX.Element;
|
|
41
|
+
/** "Prosseguir para <app>" (or another lead) with the app's name in the primary colour. */
|
|
42
|
+
declare function GoogleAppLine({ lead, appName }: {
|
|
43
|
+
lead: string;
|
|
44
|
+
appName: string;
|
|
45
|
+
}): react.JSX.Element;
|
|
46
|
+
|
|
47
|
+
export { GoogleAccountChip, GoogleActions, GoogleAppLine, GoogleField, GoogleG, type GoogleLayout, GoogleScreen, type GoogleScreenProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import "../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function GoogleG() {
|
|
4
|
+
return /* @__PURE__ */ jsxs("svg", { className: "rds-google-g", viewBox: "0 0 48 48", "aria-hidden": "true", focusable: "false", children: [
|
|
5
|
+
/* @__PURE__ */ jsx("path", { fill: "#EA4335", d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" }),
|
|
6
|
+
/* @__PURE__ */ jsx("path", { fill: "#4285F4", d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" }),
|
|
7
|
+
/* @__PURE__ */ jsx("path", { fill: "#FBBC05", d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" }),
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "#34A853", d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" })
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
function GoogleField({ label, value, state = "default" }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { className: `rds-google__field rds-google__field--${state}`, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__field-label", children: label }),
|
|
14
|
+
state === "filled" && value && /* @__PURE__ */ jsx("span", { className: "rds-google__field-value", children: value })
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
function GoogleAccountChip({ email }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs("span", { className: "rds-google__chip", children: [
|
|
19
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__avatar rds-google__avatar--sm", "aria-hidden": "true", children: email.charAt(0).toUpperCase() }),
|
|
20
|
+
/* @__PURE__ */ jsx("span", { children: email }),
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__caret", "aria-hidden": "true" })
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
function GoogleActions({ secondary, primary }) {
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { className: "rds-google__actions", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__link", children: secondary }),
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__primary", children: primary })
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
function GoogleScreen({ layout, label, title, intro, children, className }) {
|
|
31
|
+
return /* @__PURE__ */ jsx("div", { role: "group", "aria-label": label, className: ["rds-google", `rds-google--${layout}`, className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("div", { className: "rds-google__page", children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-google__card", children: [
|
|
33
|
+
layout === "oauth" && /* @__PURE__ */ jsxs("div", { className: "rds-google__header", children: [
|
|
34
|
+
/* @__PURE__ */ jsx(GoogleG, {}),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { children: "Fazer Login com o Google" })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-google__body", children: [
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-google__intro", children: [
|
|
39
|
+
layout === "m3" && /* @__PURE__ */ jsx(GoogleG, {}),
|
|
40
|
+
/* @__PURE__ */ jsx("p", { className: "rds-google__title", children: title }),
|
|
41
|
+
intro
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "rds-google__form", children })
|
|
44
|
+
] })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-google__footer", children: [
|
|
47
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-google__language", children: [
|
|
48
|
+
"Portugu\xEAs (Brasil)",
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__caret", "aria-hidden": "true" })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-google__footer-links", children: [
|
|
52
|
+
/* @__PURE__ */ jsx("span", { children: "Ajuda" }),
|
|
53
|
+
/* @__PURE__ */ jsx("span", { children: "Privacidade" }),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { children: "Termos" })
|
|
55
|
+
] })
|
|
56
|
+
] })
|
|
57
|
+
] }) });
|
|
58
|
+
}
|
|
59
|
+
function GoogleAppLine({ lead, appName }) {
|
|
60
|
+
return /* @__PURE__ */ jsxs("p", { className: "rds-google__subtitle", children: [
|
|
61
|
+
lead,
|
|
62
|
+
" ",
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__app", children: appName })
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
GoogleAccountChip,
|
|
68
|
+
GoogleActions,
|
|
69
|
+
GoogleAppLine,
|
|
70
|
+
GoogleField,
|
|
71
|
+
GoogleG,
|
|
72
|
+
GoogleScreen
|
|
73
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/** An X: closes, clears or removes. */
|
|
4
|
+
declare function CloseIcon(): react.JSX.Element;
|
|
5
|
+
/** A plus: creates something new. */
|
|
6
|
+
declare function PlusIcon(): react.JSX.Element;
|
|
7
|
+
/** A circle with an exclamation mark: something went wrong. */
|
|
8
|
+
declare function AlertIcon(): react.JSX.Element;
|
|
9
|
+
/** A check mark: chosen, done. */
|
|
10
|
+
declare function CheckIcon(): react.JSX.Element;
|
|
11
|
+
/** A dash: partly checked (the "select all" of a list with some options checked). */
|
|
12
|
+
declare function MinusIcon(): react.JSX.Element;
|
|
13
|
+
/** A chevron pointing down: opens a list. */
|
|
14
|
+
declare function ChevronDownIcon(): react.JSX.Element;
|
|
15
|
+
/** An open eye: shows what is hidden (a password). */
|
|
16
|
+
declare function EyeIcon(): react.JSX.Element;
|
|
17
|
+
/** A crossed eye: hides again what was shown. */
|
|
18
|
+
declare function EyeOffIcon(): react.JSX.Element;
|
|
19
|
+
/** A chevron pointing left: the previous month or page. */
|
|
20
|
+
declare function ChevronLeftIcon(): react.JSX.Element;
|
|
21
|
+
/** A chevron pointing right: the next month or page. */
|
|
22
|
+
declare function ChevronRightIcon(): react.JSX.Element;
|
|
23
|
+
/** A calendar page: opens a date picker. */
|
|
24
|
+
declare function CalendarIcon(): react.JSX.Element;
|
|
25
|
+
/** A paperclip: a file field. */
|
|
26
|
+
declare function PaperclipIcon(): react.JSX.Element;
|
|
27
|
+
/** A circle with an i: information. */
|
|
28
|
+
declare function InfoIcon(): react.JSX.Element;
|
|
29
|
+
/** A circle with a check: it went right. */
|
|
30
|
+
declare function CircleCheckIcon(): react.JSX.Element;
|
|
31
|
+
/** A triangle with an exclamation mark: it can still be avoided. */
|
|
32
|
+
declare function TriangleAlertIcon(): react.JSX.Element;
|
|
33
|
+
/** A map pin: a place. */
|
|
34
|
+
declare function MapPinIcon(): react.JSX.Element;
|
|
35
|
+
/** An arrow pointing up: went up. */
|
|
36
|
+
declare function ArrowUpIcon(): react.JSX.Element;
|
|
37
|
+
/** An arrow pointing down: went down. */
|
|
38
|
+
declare function ArrowDownIcon(): react.JSX.Element;
|
|
39
|
+
/** An empty star: a point not reached. */
|
|
40
|
+
declare function StarIcon(): react.JSX.Element;
|
|
41
|
+
/** A full star: a point reached. */
|
|
42
|
+
declare function StarFilledIcon(): react.JSX.Element;
|
|
43
|
+
/** A magnifying glass: searches. */
|
|
44
|
+
declare function SearchIcon(): react.JSX.Element;
|
|
45
|
+
/** Three dots in a column: more actions. */
|
|
46
|
+
declare function MoreVerticalIcon(): react.JSX.Element;
|
|
47
|
+
/** A person's head and shoulders: someone without a name or a photo. */
|
|
48
|
+
declare function UserIcon(): react.JSX.Element;
|
|
49
|
+
/** A building: a company or a brand without a logo. */
|
|
50
|
+
declare function BuildingIcon(): react.JSX.Element;
|
|
51
|
+
/** A table grid: a table with no data yet. */
|
|
52
|
+
declare function TableIcon(): react.JSX.Element;
|
|
53
|
+
/** A magnifying glass with an x: a search that found nothing. */
|
|
54
|
+
declare function SearchXIcon(): react.JSX.Element;
|
|
55
|
+
/** Two arrows, up and down: a column that can be sorted. */
|
|
56
|
+
declare function ArrowUpDownIcon(): react.JSX.Element;
|
|
57
|
+
/** A page with lines: a document. */
|
|
58
|
+
declare function FileTextIcon(): react.JSX.Element;
|
|
59
|
+
/** A framed landscape: an image. */
|
|
60
|
+
declare function ImageIcon(): react.JSX.Element;
|
|
61
|
+
/** A struck-out landscape: the image that is missing. */
|
|
62
|
+
declare function ImageOffIcon(): react.JSX.Element;
|
|
63
|
+
/** A circular arrow: try again. */
|
|
64
|
+
declare function RotateCcwIcon(): react.JSX.Element;
|
|
65
|
+
/** Sparkles: the assistant. */
|
|
66
|
+
declare function SparklesIcon(): react.JSX.Element;
|
|
67
|
+
/** A thumb up: a reaction. */
|
|
68
|
+
declare function ThumbsUpIcon(): react.JSX.Element;
|
|
69
|
+
/** Quotation marks: someone else's words. */
|
|
70
|
+
declare function QuoteIcon(): react.JSX.Element;
|
|
71
|
+
/** A megaphone: news. */
|
|
72
|
+
declare function MegaphoneIcon(): react.JSX.Element;
|
|
73
|
+
/** Three lines: opens the menu. */
|
|
74
|
+
declare function MenuIcon(): react.JSX.Element;
|
|
75
|
+
/** An arrow pointing left: back. */
|
|
76
|
+
declare function ArrowLeftIcon(): react.JSX.Element;
|
|
77
|
+
/** A handset: a call. */
|
|
78
|
+
declare function PhoneIcon(): react.JSX.Element;
|
|
79
|
+
/** An arrow back: a reply. */
|
|
80
|
+
declare function ReplyIcon(): react.JSX.Element;
|
|
81
|
+
/** A box with an arrow out: a link. */
|
|
82
|
+
declare function ExternalLinkIcon(): react.JSX.Element;
|
|
83
|
+
/** A smiling face: emoji. */
|
|
84
|
+
declare function SmileIcon(): react.JSX.Element;
|
|
85
|
+
/** A camera: a photo. */
|
|
86
|
+
declare function CameraIcon(): react.JSX.Element;
|
|
87
|
+
/** A microphone: a voice message. */
|
|
88
|
+
declare function MicIcon(): react.JSX.Element;
|
|
89
|
+
/** A badge with a check: verified. */
|
|
90
|
+
declare function BadgeCheckIcon(): react.JSX.Element;
|
|
91
|
+
/** Two checks: delivered or read. */
|
|
92
|
+
declare function CheckCheckIcon(): react.JSX.Element;
|
|
93
|
+
/** A padlock: a secure connection. */
|
|
94
|
+
declare function LockIcon(): react.JSX.Element;
|
|
95
|
+
/** An arrow out of a tray: send a file. */
|
|
96
|
+
declare function UploadIcon(): react.JSX.Element;
|
|
97
|
+
/** A picture with a plus: add an image. */
|
|
98
|
+
declare function ImagePlusIcon(): react.JSX.Element;
|
|
99
|
+
/** A clock: a time of day. */
|
|
100
|
+
declare function ClockIcon(): react.JSX.Element;
|
|
101
|
+
/** Two overlapping sheets: copies to the clipboard. */
|
|
102
|
+
declare function CopyIcon(): react.JSX.Element;
|
|
103
|
+
/** A pencil: edits. */
|
|
104
|
+
declare function PencilIcon(): react.JSX.Element;
|
|
105
|
+
/** Three sliders: the filters of a list. */
|
|
106
|
+
declare function SlidersIcon(): react.JSX.Element;
|
|
107
|
+
|
|
108
|
+
export { AlertIcon, ArrowDownIcon, ArrowLeftIcon, ArrowUpDownIcon, ArrowUpIcon, BadgeCheckIcon, BuildingIcon, CalendarIcon, CameraIcon, CheckCheckIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CircleCheckIcon, ClockIcon, CloseIcon, CopyIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, ImageIcon, ImageOffIcon, ImagePlusIcon, InfoIcon, LockIcon, MapPinIcon, MegaphoneIcon, MenuIcon, MicIcon, MinusIcon, MoreVerticalIcon, PaperclipIcon, PencilIcon, PhoneIcon, PlusIcon, QuoteIcon, ReplyIcon, RotateCcwIcon, SearchIcon, SearchXIcon, SlidersIcon, SmileIcon, SparklesIcon, StarFilledIcon, StarIcon, TableIcon, ThumbsUpIcon, TriangleAlertIcon, UploadIcon, UserIcon };
|