@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,53 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
className: [
|
|
15
|
-
"grid grid-cols-2 gap-px overflow-hidden rounded-(--radius-card) border",
|
|
16
|
-
"sm:flex sm:gap-0 sm:overflow-x-auto sm:[scrollbar-width:none]",
|
|
17
|
-
"[background:var(--summary-bar-divider)] sm:[background:var(--summary-bar-bg)]",
|
|
18
|
-
"[border-color:var(--summary-bar-border)]",
|
|
19
|
-
className != null ? className : ""
|
|
20
|
-
].join(" ")
|
|
21
|
-
},
|
|
22
|
-
items.map((item, i) => {
|
|
23
|
-
var _a;
|
|
24
|
-
const spanFull = odd && i === items.length - 1;
|
|
25
|
-
return /* @__PURE__ */ React.createElement(
|
|
26
|
-
"div",
|
|
27
|
-
{
|
|
28
|
-
key: i,
|
|
29
|
-
className: [
|
|
30
|
-
"flex flex-1 flex-col gap-1.5 px-4 py-3 [background:var(--summary-bar-bg)]",
|
|
31
|
-
"min-w-0 sm:min-w-[7.5rem] sm:whitespace-nowrap",
|
|
32
|
-
spanFull ? "col-span-2 sm:col-span-1" : "",
|
|
33
|
-
i > 0 ? "sm:[border-left:1px_solid_var(--summary-bar-divider)]" : ""
|
|
34
|
-
].join(" ")
|
|
35
|
-
},
|
|
36
|
-
/* @__PURE__ */ React.createElement("span", { className: "text-[11px] font-medium uppercase tracking-wide [color:var(--summary-bar-label)]" }, item.label),
|
|
37
|
-
/* @__PURE__ */ React.createElement(
|
|
38
|
-
"span",
|
|
39
|
-
{
|
|
40
|
-
className: [
|
|
41
|
-
"flex items-center gap-1.5 text-heading-sm font-semibold leading-none tabular-nums",
|
|
42
|
-
TONE_CLASS[(_a = item.tone) != null ? _a : "default"]
|
|
43
|
-
].join(" ")
|
|
44
|
-
},
|
|
45
|
-
item.icon,
|
|
46
|
-
item.value
|
|
47
|
-
)
|
|
48
|
-
);
|
|
49
|
-
})
|
|
50
|
-
);
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Children } from "react";
|
|
9
|
+
import { Stat, StatFramedDefault } from "./stat.js";
|
|
10
|
+
function SummaryBar(_a) {
|
|
11
|
+
var _b = _a, { children, layout = "row", items, className } = _b, rest = __objRest(_b, ["children", "layout", "items", "className"]);
|
|
12
|
+
const cells = items ? items.map((item, i) => /* @__PURE__ */ jsx(Stat, { label: item.label, value: item.value, tone: item.tone }, i)) : Children.toArray(children);
|
|
13
|
+
return /* @__PURE__ */ jsx(StatFramedDefault.Provider, { value: false, children: /* @__PURE__ */ jsx("ul", __spreadProps(__spreadValues({}, rest), { className: ["rds-summary-bar", `rds-summary-bar--${layout}`, className].filter(Boolean).join(" "), children: cells.map((cell, i) => /* @__PURE__ */ jsx("li", { className: "rds-summary-bar__cell", children: cell }, i)) })) });
|
|
51
14
|
}
|
|
52
15
|
export {
|
|
53
16
|
SummaryBar
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface SwitchProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'children' | 'role' | 'size'> {
|
|
5
|
+
/** The setting it turns on (Figma: `showLabel` + `label`). It never changes with the state. Without it, pass aria-label. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** A line under the label (Figma: `showHint` + `hint`), tied by aria-describedby. */
|
|
8
|
+
hint?: ReactNode;
|
|
9
|
+
/** Called with the new state on every change (Figma: `checked`; `checked` + `onCheckedChange` to control it). */
|
|
10
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Switch — Figma [RDS] Forms/Switch. Turns on and off a setting that applies right away, with no save
|
|
14
|
+
* button (so no error and no required). Native <input type="checkbox" role="switch">: Space toggles it.
|
|
15
|
+
* Not the Toggle, which turns on a mode or a format. If the setting fails, turn it back and say so.
|
|
16
|
+
* Styles: switch.css and internal/choice.css.
|
|
17
|
+
*/
|
|
18
|
+
declare function Switch({ children, hint, disabled, id, className, style, onChange, onCheckedChange, ...input }: SwitchProps): react.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { Switch, type SwitchProps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { ChoiceRow } from "./internal/choice.js";
|
|
9
|
+
import { warnIfUnlabelled } from "./internal/field.js";
|
|
10
|
+
function Switch(_a) {
|
|
11
|
+
var _b = _a, { children, hint, disabled, id, className, style, onChange, onCheckedChange } = _b, input = __objRest(_b, ["children", "hint", "disabled", "id", "className", "style", "onChange", "onCheckedChange"]);
|
|
12
|
+
warnIfUnlabelled("Switch", children, input["aria-label"], input["aria-labelledby"]);
|
|
13
|
+
function change(event) {
|
|
14
|
+
onChange == null ? void 0 : onChange(event);
|
|
15
|
+
onCheckedChange == null ? void 0 : onCheckedChange(event.target.checked);
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
ChoiceRow,
|
|
19
|
+
{
|
|
20
|
+
kind: "rds-switch",
|
|
21
|
+
id,
|
|
22
|
+
label: children,
|
|
23
|
+
hint,
|
|
24
|
+
disabled,
|
|
25
|
+
className,
|
|
26
|
+
style,
|
|
27
|
+
control: ({ id: controlId, describedBy }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
"input",
|
|
30
|
+
__spreadProps(__spreadValues({}, input), {
|
|
31
|
+
id: controlId,
|
|
32
|
+
type: "checkbox",
|
|
33
|
+
role: "switch",
|
|
34
|
+
disabled,
|
|
35
|
+
"aria-describedby": [describedBy, input["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
36
|
+
onChange: change
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx("span", { className: "rds-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { className: "rds-switch__thumb" }) })
|
|
40
|
+
] })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
Switch
|
|
46
|
+
};
|
|
@@ -1,23 +1,62 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
3
|
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
type TableAlign = 'start' | 'end';
|
|
5
|
+
type TableSort = 'ascending' | 'descending' | 'none';
|
|
6
|
+
interface TableProps extends HTMLAttributes<HTMLTableElement> {
|
|
7
|
+
/** What the table shows. Required: it names the table (and its scroll area) for screen readers. */
|
|
8
|
+
caption: ReactNode;
|
|
9
|
+
/** Show the caption on screen. By default it is only for screen readers. */
|
|
10
|
+
showCaption?: boolean;
|
|
11
|
+
/** TableHeader and TableBody (Figma: the `rows` slot). */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** loading marks the table busy. Outside default, put a TableStatus in the body. */
|
|
14
|
+
status?: TableStatus;
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Table — Figma [RDS] Content/Table. Data to compare across rows: text on the left, numbers on the right. On a narrow
|
|
18
|
+
* screen it scrolls sideways inside its border (a focusable, named region). Styles: table.css.
|
|
19
|
+
*/
|
|
20
|
+
declare function Table({ caption, showCaption, status, className, children, ...rest }: TableProps): react.JSX.Element;
|
|
21
|
+
declare function TableHeader(props: HTMLAttributes<HTMLTableSectionElement>): react.JSX.Element;
|
|
22
|
+
declare function TableBody(props: HTMLAttributes<HTMLTableSectionElement>): react.JSX.Element;
|
|
23
|
+
declare function TableRow(props: HTMLAttributes<HTMLTableRowElement>): react.JSX.Element;
|
|
24
|
+
interface TableHeadProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
25
|
+
/** start for text columns, end for number columns. Same as the column's cells. */
|
|
26
|
+
align?: TableAlign;
|
|
27
|
+
/** A column that sorts: its current order. The header becomes a button, and aria-sort says the order. */
|
|
28
|
+
sort?: TableSort;
|
|
29
|
+
/** Called when the person asks to sort by this column. Required with `sort`. */
|
|
30
|
+
onSort?: () => void;
|
|
14
31
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
/** A column header (Figma: .table/cell type=header). */
|
|
33
|
+
declare function TableHead({ align, sort, onSort, className, children, ...rest }: TableHeadProps): react.JSX.Element;
|
|
34
|
+
interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
35
|
+
/** start for text, end for numbers (tabular figures). */
|
|
36
|
+
align?: TableAlign;
|
|
37
|
+
/** body for text; slot when the cell holds a component (Status, Badge, Avatar, Button): less padding. */
|
|
38
|
+
type?: 'body' | 'slot';
|
|
20
39
|
}
|
|
21
|
-
|
|
40
|
+
/** A body cell (Figma: .table/cell type=body or slot). */
|
|
41
|
+
declare function TableCell({ align, type, className, ...rest }: TableCellProps): react.JSX.Element;
|
|
42
|
+
interface TableStatusProps {
|
|
43
|
+
/** loading: 3 rows of Skeleton; empty, noResults and error: an Empty across the columns. */
|
|
44
|
+
status: Exclude<TableStatus, 'default'>;
|
|
45
|
+
/** How many columns the table has, so the state spans all of them. */
|
|
46
|
+
columns: number;
|
|
47
|
+
/** Which columns hold numbers (aligned to the end), for the loading rows. */
|
|
48
|
+
numericColumns?: number[];
|
|
49
|
+
/** The Empty's title, in the words of the screen ("Nenhum pedido ainda"). */
|
|
50
|
+
title?: ReactNode;
|
|
51
|
+
description?: ReactNode;
|
|
52
|
+
/** The Empty title's level, one below the page's last heading. */
|
|
53
|
+
titleAs?: 'h2' | 'h3' | 'h4';
|
|
54
|
+
/** The way out, an outline Button: create, clear the search, try again. */
|
|
55
|
+
action?: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
/** The data's life cycle (Figma: `status`). */
|
|
58
|
+
type TableStatus = 'default' | 'loading' | 'empty' | 'noResults' | 'error';
|
|
59
|
+
/** The table's body when there is no data to show yet: loading, empty, no results or error. Inside TableBody. */
|
|
60
|
+
declare function TableStatus({ status, columns, numericColumns, title, titleAs, description, action }: TableStatusProps): react.JSX.Element;
|
|
22
61
|
|
|
23
|
-
export { Table, TableBody, TableHead,
|
|
62
|
+
export { Table, type TableAlign, TableBody, TableCell, type TableCellProps, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableSort, TableStatus, type TableStatusProps };
|
package/dist/components/table.js
CHANGED
|
@@ -1,80 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
__objRest,
|
|
4
|
+
__spreadProps,
|
|
3
5
|
__spreadValues
|
|
4
6
|
} from "../chunk-ORMEWXMH.js";
|
|
5
|
-
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useId } from "react";
|
|
9
|
+
import { Empty } from "./empty.js";
|
|
10
|
+
import { Skeleton } from "./skeleton.js";
|
|
11
|
+
import { AlertIcon, ArrowDownIcon, ArrowUpDownIcon, ArrowUpIcon, SearchXIcon, TableIcon } from "./internal/icons.js";
|
|
6
12
|
function Table(_a) {
|
|
7
|
-
var _b = _a, {
|
|
8
|
-
|
|
13
|
+
var _b = _a, { caption, showCaption, status = "default", className, children } = _b, rest = __objRest(_b, ["caption", "showCaption", "status", "className", "children"]);
|
|
14
|
+
const captionId = useId();
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { className: ["rds-table", className].filter(Boolean).join(" "), role: "region", "aria-labelledby": captionId, tabIndex: 0, children: /* @__PURE__ */ jsxs("table", __spreadProps(__spreadValues({}, rest), { className: "rds-table__table", "aria-busy": status === "loading" || void 0, children: [
|
|
16
|
+
/* @__PURE__ */ jsx("caption", { id: captionId, className: showCaption ? "rds-table__caption" : "rds-visually-hidden", children: caption }),
|
|
17
|
+
children
|
|
18
|
+
] })) });
|
|
9
19
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
return /* @__PURE__ */ React.createElement("thead", __spreadValues({ className: className || void 0 }, props), children);
|
|
20
|
+
function TableHeader(props) {
|
|
21
|
+
return /* @__PURE__ */ jsx("thead", __spreadValues({}, props));
|
|
13
22
|
}
|
|
14
|
-
function TableBody(
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */ React.createElement("tbody", __spreadValues({ className: ["divide-y divide-stroke-default", className].join(" ") }, props), children);
|
|
23
|
+
function TableBody(props) {
|
|
24
|
+
return /* @__PURE__ */ jsx("tbody", __spreadValues({}, props));
|
|
17
25
|
}
|
|
18
|
-
function TableRow(
|
|
19
|
-
|
|
20
|
-
const base = header ? "border-b border-stroke-default" : [
|
|
21
|
-
!noHover && "hover:bg-surface-raised transition-colors",
|
|
22
|
-
onClick && "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-stroke-focus"
|
|
23
|
-
].filter(Boolean).join(" ");
|
|
24
|
-
const interactiveProps = !header && onClick ? {
|
|
25
|
-
role: "button",
|
|
26
|
-
tabIndex: 0,
|
|
27
|
-
onKeyDown: (e) => {
|
|
28
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
onClick(e);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
} : {};
|
|
34
|
-
return /* @__PURE__ */ React.createElement(
|
|
35
|
-
"tr",
|
|
36
|
-
__spreadValues(__spreadValues({
|
|
37
|
-
className: [base, className].filter(Boolean).join(" "),
|
|
38
|
-
onClick
|
|
39
|
-
}, interactiveProps), props),
|
|
40
|
-
children
|
|
41
|
-
);
|
|
26
|
+
function TableRow(props) {
|
|
27
|
+
return /* @__PURE__ */ jsx("tr", __spreadValues({}, props));
|
|
42
28
|
}
|
|
43
|
-
function
|
|
44
|
-
var
|
|
45
|
-
|
|
29
|
+
function TableHead(_c) {
|
|
30
|
+
var _d = _c, { align = "start", sort, onSort, className, children } = _d, rest = __objRest(_d, ["align", "sort", "onSort", "className", "children"]);
|
|
31
|
+
const SortIcon = sort === "ascending" ? ArrowUpIcon : sort === "descending" ? ArrowDownIcon : ArrowUpDownIcon;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
46
33
|
"th",
|
|
47
|
-
__spreadValues({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
34
|
+
__spreadProps(__spreadValues({
|
|
35
|
+
scope: "col",
|
|
36
|
+
"aria-sort": sort
|
|
37
|
+
}, rest), {
|
|
38
|
+
className: ["rds-table__head", `rds-table__cell--${align}`, className].filter(Boolean).join(" "),
|
|
39
|
+
children: sort ? /* @__PURE__ */ jsxs("button", { type: "button", className: "rds-table__sort", onClick: onSort, children: [
|
|
40
|
+
children,
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "rds-table__sort-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(SortIcon, {}) })
|
|
42
|
+
] }) : children
|
|
43
|
+
})
|
|
55
44
|
);
|
|
56
45
|
}
|
|
57
|
-
function
|
|
58
|
-
var
|
|
59
|
-
return /* @__PURE__ */
|
|
46
|
+
function TableCell(_e) {
|
|
47
|
+
var _f = _e, { align = "start", type = "body", className } = _f, rest = __objRest(_f, ["align", "type", "className"]);
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
60
49
|
"td",
|
|
61
|
-
__spreadValues({
|
|
62
|
-
className: [
|
|
63
|
-
|
|
64
|
-
ALIGN[align],
|
|
65
|
-
muted ? "text-fg-muted" : "text-fg-primary",
|
|
66
|
-
bold ? "font-medium" : "",
|
|
67
|
-
className
|
|
68
|
-
].filter(Boolean).join(" ")
|
|
69
|
-
}, props),
|
|
70
|
-
children
|
|
50
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
51
|
+
className: ["rds-table__cell", `rds-table__cell--${align}`, type === "slot" && "rds-table__cell--slot", className].filter(Boolean).join(" ")
|
|
52
|
+
})
|
|
71
53
|
);
|
|
72
54
|
}
|
|
55
|
+
const STATUS_COPY = {
|
|
56
|
+
empty: { icon: /* @__PURE__ */ jsx(TableIcon, {}), title: "Nada por aqui ainda", description: "Quando houver dados, eles aparecem nesta tabela." },
|
|
57
|
+
noResults: { icon: /* @__PURE__ */ jsx(SearchXIcon, {}), title: "Nada encontrado", description: "Tente outro termo ou limpe a busca." },
|
|
58
|
+
error: { icon: /* @__PURE__ */ jsx(AlertIcon, {}), title: "N\xE3o deu para carregar", description: "Verifique a conex\xE3o e tente de novo." }
|
|
59
|
+
};
|
|
60
|
+
function TableStatus({ status, columns, numericColumns = [], title, titleAs, description, action }) {
|
|
61
|
+
if (status === "loading") {
|
|
62
|
+
return /* @__PURE__ */ jsx(Fragment, { children: [0, 1, 2].map((row) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: columns }, (_, col) => /* @__PURE__ */ jsx(TableCell, { type: "slot", align: numericColumns.includes(col) ? "end" : "start", children: /* @__PURE__ */ jsx(Skeleton, { width: numericColumns.includes(col) ? 48 : "70%" }) }, col)) }, row)) });
|
|
63
|
+
}
|
|
64
|
+
const copy = STATUS_COPY[status];
|
|
65
|
+
return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { className: "rds-table__status", colSpan: columns, children: /* @__PURE__ */ jsx(
|
|
66
|
+
Empty,
|
|
67
|
+
{
|
|
68
|
+
icon: copy.icon,
|
|
69
|
+
tone: status === "error" ? "danger" : "neutral",
|
|
70
|
+
title: title != null ? title : copy.title,
|
|
71
|
+
titleAs,
|
|
72
|
+
description: description != null ? description : copy.description,
|
|
73
|
+
action,
|
|
74
|
+
role: status === "error" ? "alert" : void 0
|
|
75
|
+
}
|
|
76
|
+
) }) });
|
|
77
|
+
}
|
|
73
78
|
export {
|
|
74
79
|
Table,
|
|
75
80
|
TableBody,
|
|
81
|
+
TableCell,
|
|
76
82
|
TableHead,
|
|
83
|
+
TableHeader,
|
|
77
84
|
TableRow,
|
|
78
|
-
|
|
79
|
-
Th
|
|
85
|
+
TableStatus
|
|
80
86
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface TabsProps {
|
|
5
|
+
/** The TabsList and a TabsContent per tab. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** The open tab (controlled). With links (asChild), the value of the current route. */
|
|
8
|
+
value?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* automatic (default): the arrows open the tab they land on. manual: the arrows only move the focus, Enter or
|
|
13
|
+
* Space opens. Use manual when the tabs are links (asChild), so the arrows do not change the selection without
|
|
14
|
+
* navigating.
|
|
15
|
+
*/
|
|
16
|
+
activationMode?: 'automatic' | 'manual';
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Tabs — Figma [RDS] Navigation/Tabs. Views of the same place, one at a time (Radix Tabs): role="tablist",
|
|
21
|
+
* the arrows, Home and End move between tabs, aria-selected marks the open one. Styles: tabs.css.
|
|
22
|
+
*/
|
|
23
|
+
declare function Tabs({ className, activationMode, ...props }: TabsProps): react.JSX.Element;
|
|
24
|
+
interface TabsListProps {
|
|
25
|
+
/** What the tabs switch ("Pedidos"). The tablist's accessible name. */
|
|
26
|
+
'aria-label': string;
|
|
27
|
+
/** The TabsTriggers, in the order of use (Figma: the `tabs` slot). */
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/** A page action at the right end of the strip, outside the tablist: a small Button, a filter (Figma: `trailing`). */
|
|
30
|
+
trailing?: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/** The strip of tabs over the baseline (Figma: the `tabs` slot), with the `trailing` slot on the right. */
|
|
34
|
+
declare function TabsList({ children, trailing, className, ...rest }: TabsListProps): react.JSX.Element;
|
|
35
|
+
interface TabsTriggerProps {
|
|
36
|
+
value: string;
|
|
37
|
+
/**
|
|
38
|
+
* The tab's name (Figma: `label`). With `asChild`, a single link element (an `<a>`, a framework `Link`) whose
|
|
39
|
+
* text is the name: the tab is then that link.
|
|
40
|
+
*/
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
/** A count after the name, when the number helps choosing (Figma: `showCount` + `count`). */
|
|
43
|
+
count?: number | string;
|
|
44
|
+
/** The "em breve" tag: the view is not there yet (Figma: `showSoon`). Usually with `disabled`. */
|
|
45
|
+
soon?: boolean;
|
|
46
|
+
/** The status dot: there is something new in this view (Figma: `showDot`). */
|
|
47
|
+
dot?: boolean;
|
|
48
|
+
/** What the dot means, read by screen readers (the dot alone is only colour). */
|
|
49
|
+
dotLabel?: string;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Render the single child element (an `<a>`, a framework `Link`) as the tab instead of a `<button>`: the way
|
|
53
|
+
* to make tabs that navigate. Control `value` from the current route.
|
|
54
|
+
*/
|
|
55
|
+
asChild?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** One tab (Figma: .tabs/tab). Order inside: name, "em breve", dot, count. */
|
|
58
|
+
declare function TabsTrigger({ value, children, count, soon, dot, dotLabel, disabled, asChild }: TabsTriggerProps): react.JSX.Element;
|
|
59
|
+
interface TabsContentProps {
|
|
60
|
+
value: string;
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
/** The view of one tab: role="tabpanel", named by its tab. */
|
|
65
|
+
declare function TabsContent({ value, children, className }: TabsContentProps): react.JSX.Element;
|
|
66
|
+
|
|
67
|
+
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { cloneElement, isValidElement } from "react";
|
|
9
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
10
|
+
function Tabs(_a) {
|
|
11
|
+
var _b = _a, { className, activationMode = "automatic" } = _b, props = __objRest(_b, ["className", "activationMode"]);
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
TabsPrimitive.Root,
|
|
14
|
+
__spreadProps(__spreadValues({}, props), {
|
|
15
|
+
activationMode,
|
|
16
|
+
className: ["rds-tabs", className].filter(Boolean).join(" ")
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function TabsList(_c) {
|
|
21
|
+
var _d = _c, { children, trailing, className } = _d, rest = __objRest(_d, ["children", "trailing", "className"]);
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: ["rds-tabs__bar", className].filter(Boolean).join(" "), children: [
|
|
23
|
+
/* @__PURE__ */ jsx(TabsPrimitive.List, __spreadProps(__spreadValues({}, rest), { className: "rds-tabs__list", children })),
|
|
24
|
+
trailing && /* @__PURE__ */ jsx("div", { className: "rds-tabs__trailing", children: trailing })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function TabsTrigger({ value, children, count, soon, dot, dotLabel = "Tem novidade", disabled, asChild }) {
|
|
28
|
+
const extras = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
soon && /* @__PURE__ */ jsx("span", { className: "rds-tabs__soon", children: "em breve" }),
|
|
30
|
+
dot && /* @__PURE__ */ jsx("span", { className: "rds-tabs__dot", children: /* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: dotLabel }) }),
|
|
31
|
+
count !== void 0 && /* @__PURE__ */ jsx("span", { className: "rds-tabs__count", children: count })
|
|
32
|
+
] });
|
|
33
|
+
if (asChild && isValidElement(children)) {
|
|
34
|
+
const link = children;
|
|
35
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { value, disabled, asChild: true, children: cloneElement(link, {
|
|
36
|
+
className: ["rds-tabs__tab", link.props.className].filter(Boolean).join(" "),
|
|
37
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "rds-tabs__label", children: link.props.children }),
|
|
39
|
+
extras
|
|
40
|
+
] })
|
|
41
|
+
}) });
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ jsxs(TabsPrimitive.Trigger, { value, disabled, className: "rds-tabs__tab", children: [
|
|
44
|
+
/* @__PURE__ */ jsx("span", { className: "rds-tabs__label", children }),
|
|
45
|
+
extras
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
function TabsContent({ value, children, className }) {
|
|
49
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Content, { value, className: ["rds-tabs__panel", className].filter(Boolean).join(" "), children });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
Tabs,
|
|
53
|
+
TabsContent,
|
|
54
|
+
TabsList,
|
|
55
|
+
TabsTrigger
|
|
56
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface TestimonialProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
5
|
+
eyebrow?: ReactNode;
|
|
6
|
+
/** The block's title, an h2 that names the section. */
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** TestimonialItem cards (Figma: slot `items`): 3 per row, one column below 640 of container width. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Testimonial — Figma [RDS] Blocks/Testimonial. Testimonials of a public page: only real ones, with the consent of
|
|
14
|
+
* who said them. Adapts to the width of its container (Figma: `screen`). Styles: testimonial.css.
|
|
15
|
+
*/
|
|
16
|
+
declare function Testimonial({ eyebrow, title, description, children, className, ...rest }: TestimonialProps): react.JSX.Element;
|
|
17
|
+
interface TestimonialItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
18
|
+
/** The words of who said it (Figma: `quote`). */
|
|
19
|
+
quote: ReactNode;
|
|
20
|
+
/** Who said it (Figma: `name`). */
|
|
21
|
+
name: ReactNode;
|
|
22
|
+
/** Job title and company (Figma: `jobTitle`). */
|
|
23
|
+
jobTitle?: ReactNode;
|
|
24
|
+
/** An Avatar of the person (the Figma exposes it). */
|
|
25
|
+
avatar?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/** One testimonial card (Figma: .testimonial/item), a figure with the quote and its author. Only inside a Testimonial. */
|
|
28
|
+
declare function TestimonialItem({ quote, name, jobTitle, avatar, className, ...rest }: TestimonialItemProps): react.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Testimonial, TestimonialItem, type TestimonialItemProps, type TestimonialProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useId } from "react";
|
|
9
|
+
import { BlockHeading } from "./internal/block.js";
|
|
10
|
+
import { QuoteIcon } from "./internal/icons.js";
|
|
11
|
+
function Testimonial(_a) {
|
|
12
|
+
var _b = _a, { eyebrow, title, description, children, className } = _b, rest = __objRest(_b, ["eyebrow", "title", "description", "children", "className"]);
|
|
13
|
+
const titleId = useId();
|
|
14
|
+
return /* @__PURE__ */ jsx("section", __spreadProps(__spreadValues({ "aria-labelledby": titleId }, rest), { className: ["rds-block", "rds-testimonial", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("div", { className: "rds-block__inner", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(BlockHeading, { eyebrow, title, description, titleId }),
|
|
16
|
+
/* @__PURE__ */ jsx("ul", { className: "rds-testimonial__items", children })
|
|
17
|
+
] }) }));
|
|
18
|
+
}
|
|
19
|
+
function TestimonialItem(_c) {
|
|
20
|
+
var _d = _c, { quote, name, jobTitle, avatar, className } = _d, rest = __objRest(_d, ["quote", "name", "jobTitle", "avatar", "className"]);
|
|
21
|
+
return /* @__PURE__ */ jsx("li", __spreadProps(__spreadValues({}, rest), { className: ["rds-testimonial__item", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs("figure", { className: "rds-testimonial__figure", children: [
|
|
22
|
+
/* @__PURE__ */ jsx("span", { className: "rds-testimonial__mark", "aria-hidden": "true", children: /* @__PURE__ */ jsx(QuoteIcon, {}) }),
|
|
23
|
+
/* @__PURE__ */ jsx("blockquote", { className: "rds-testimonial__quote", children: quote }),
|
|
24
|
+
/* @__PURE__ */ jsxs("figcaption", { className: "rds-testimonial__author", children: [
|
|
25
|
+
avatar,
|
|
26
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-testimonial__byline", children: [
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "rds-testimonial__name", children: name }),
|
|
28
|
+
jobTitle && /* @__PURE__ */ jsx("span", { className: "rds-testimonial__role", children: jobTitle })
|
|
29
|
+
] })
|
|
30
|
+
] })
|
|
31
|
+
] }) }));
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
Testimonial,
|
|
35
|
+
TestimonialItem
|
|
36
|
+
};
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentPropsWithRef } from 'react';
|
|
3
|
+
import { FieldTextProps } from './internal/field.js';
|
|
3
4
|
|
|
4
|
-
interface TextareaProps extends
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
error?: string;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
optional?: boolean;
|
|
10
|
-
/** Auto-cresce conforme conteúdo (sem scroll bar interna). default = false. */
|
|
11
|
-
autoResize?: boolean;
|
|
12
|
-
/** Conta caracteres (mostra "X/Y" se maxLength definido). */
|
|
13
|
-
showCount?: boolean;
|
|
14
|
-
/** Min rows quando autoResize. default = 3. */
|
|
15
|
-
minRows?: number;
|
|
16
|
-
/** Max rows quando autoResize (cap pra evitar crescer infinito). default = 10. */
|
|
17
|
-
maxRows?: number;
|
|
5
|
+
interface TextareaProps extends FieldTextProps, Omit<ComponentPropsWithRef<'textarea'>, 'children'> {
|
|
6
|
+
/** Visible lines at first (3 to 5 fits most). Never under 2. The person can make it taller. */
|
|
7
|
+
rows?: number;
|
|
18
8
|
}
|
|
19
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Textarea — Figma [RDS] Forms/Textarea. A multi-line text field with its own label, hint and error; same
|
|
11
|
+
* model and spacing as the Input. The text is the native value (Figma: `content`). Styles: textarea.css
|
|
12
|
+
* and internal/field.css.
|
|
13
|
+
*/
|
|
14
|
+
declare function Textarea({ label, labelPosition, hint, error, errorMessage, required, id, disabled, rows, className, style, ...textarea }: TextareaProps): react.JSX.Element;
|
|
20
15
|
|
|
21
16
|
export { Textarea, type TextareaProps };
|