@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,142 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tabIndex,
|
|
13
|
-
onKeyDown,
|
|
14
|
-
buttonRef,
|
|
15
|
-
fullSpan = false,
|
|
16
|
-
className = ""
|
|
17
|
-
}) {
|
|
18
|
-
return /* @__PURE__ */ React.createElement(
|
|
19
|
-
"button",
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { ChoiceCardControl, ChoiceCardGroup } from "./internal/choice-card.js";
|
|
9
|
+
function OptionTile({ selected, label, onClick, icon, disabled, multiple = false, tabIndex, fullSpan, className }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
ChoiceCardControl,
|
|
20
12
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
control: multiple ? "checkbox" : "radio",
|
|
14
|
+
layout: "tile",
|
|
15
|
+
selected,
|
|
16
|
+
onSelect: onClick,
|
|
17
|
+
icon,
|
|
25
18
|
disabled,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
icon ? "min-h-[88px] px-3 py-4" : "min-h-[52px] px-3 py-3",
|
|
32
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:ring-offset-2",
|
|
33
|
-
selected ? "[border-color:var(--option-tile-border-active)] [background:var(--option-tile-bg-active)]" : "[border-color:var(--option-tile-border)] [background:var(--option-tile-bg)] hover:[border-color:var(--option-tile-border-hover)]",
|
|
34
|
-
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
35
|
-
fullSpan ? "col-span-full" : "",
|
|
36
|
-
className
|
|
37
|
-
].filter(Boolean).join(" ")
|
|
38
|
-
},
|
|
39
|
-
selected && /* @__PURE__ */ React.createElement("span", { className: "absolute right-2 top-2 flex size-4 items-center justify-center rounded-full [background:var(--option-tile-check)] [color:var(--option-tile-check-icon)]" }, /* @__PURE__ */ React.createElement(Check, { size: 11, strokeWidth: 3 })),
|
|
40
|
-
icon && /* @__PURE__ */ React.createElement(
|
|
41
|
-
"span",
|
|
42
|
-
{
|
|
43
|
-
className: [
|
|
44
|
-
"flex size-10 items-center justify-center rounded-(--radius-card) transition-colors [&_svg]:size-5",
|
|
45
|
-
selected ? "[background:var(--option-tile-icon-bg-active)] [color:var(--option-tile-icon-active)]" : "[background:var(--option-tile-icon-bg)] [color:var(--option-tile-icon)]"
|
|
46
|
-
].join(" ")
|
|
47
|
-
},
|
|
48
|
-
icon
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ React.createElement(
|
|
51
|
-
"span",
|
|
52
|
-
{
|
|
53
|
-
className: [
|
|
54
|
-
icon ? "text-caption" : "text-label",
|
|
55
|
-
"font-semibold leading-tight",
|
|
56
|
-
selected ? "[color:var(--option-tile-label-active)]" : "[color:var(--option-tile-label)]"
|
|
57
|
-
].join(" ")
|
|
58
|
-
},
|
|
59
|
-
label
|
|
60
|
-
)
|
|
19
|
+
tabIndex,
|
|
20
|
+
className,
|
|
21
|
+
style: fullSpan ? { gridColumn: "1 / -1" } : void 0,
|
|
22
|
+
children: label
|
|
23
|
+
}
|
|
61
24
|
);
|
|
62
25
|
}
|
|
63
26
|
function OptionTileGrid(props) {
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const activeIdx = multiple ? -1 : Math.max(0, options.findIndex((o) => isSel(o.value)));
|
|
79
|
-
const move = (i) => {
|
|
80
|
-
var _a;
|
|
81
|
-
const n = options.length;
|
|
82
|
-
const idx = (i % n + n) % n;
|
|
83
|
-
(_a = btns.current[idx]) == null ? void 0 : _a.focus();
|
|
84
|
-
if (!multiple) activate(options[idx].value);
|
|
27
|
+
var _a;
|
|
28
|
+
const { label, options, className } = props;
|
|
29
|
+
const legend = (_a = label != null ? label : props["aria-label"]) != null ? _a : "";
|
|
30
|
+
const tile = (opt) => {
|
|
31
|
+
const Icon = opt.icon;
|
|
32
|
+
return {
|
|
33
|
+
key: opt.value,
|
|
34
|
+
value: opt.value,
|
|
35
|
+
icon: Icon ? /* @__PURE__ */ jsx(Icon, {}) : void 0,
|
|
36
|
+
style: opt.fullSpan ? { gridColumn: "1 / -1" } : void 0,
|
|
37
|
+
children: opt.label
|
|
38
|
+
};
|
|
85
39
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
case "Home":
|
|
100
|
-
e.preventDefault();
|
|
101
|
-
move(0);
|
|
102
|
-
break;
|
|
103
|
-
case "End":
|
|
104
|
-
e.preventDefault();
|
|
105
|
-
move(options.length - 1);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
const grid = /* @__PURE__ */ React.createElement(
|
|
110
|
-
"div",
|
|
111
|
-
{
|
|
112
|
-
id: groupId,
|
|
113
|
-
role: multiple ? "group" : "radiogroup",
|
|
114
|
-
"aria-label": ariaLabel,
|
|
115
|
-
className: ["grid gap-2", columns === 2 ? "grid-cols-2" : "grid-cols-2 sm:grid-cols-3", label ? "" : className].join(" ")
|
|
116
|
-
},
|
|
117
|
-
options.map((opt, i) => {
|
|
118
|
-
const Icon = opt.icon;
|
|
119
|
-
return /* @__PURE__ */ React.createElement(
|
|
120
|
-
OptionTile,
|
|
121
|
-
{
|
|
122
|
-
key: opt.value,
|
|
123
|
-
multiple,
|
|
124
|
-
selected: isSel(opt.value),
|
|
125
|
-
label: opt.label,
|
|
126
|
-
icon: Icon ? /* @__PURE__ */ React.createElement(Icon, null) : void 0,
|
|
127
|
-
fullSpan: opt.fullSpan,
|
|
128
|
-
onClick: () => activate(opt.value),
|
|
129
|
-
tabIndex: multiple ? 0 : i === activeIdx ? 0 : -1,
|
|
130
|
-
onKeyDown: (e) => onKeyDown(e, i),
|
|
131
|
-
buttonRef: (el) => {
|
|
132
|
-
btns.current[i] = el;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
40
|
+
if (props.multiple) {
|
|
41
|
+
const { value: value2, onChange: onChange2 } = props;
|
|
42
|
+
return /* @__PURE__ */ jsx(ChoiceCardGroup, { legend, layout: "tile", className, children: options.map((opt) => {
|
|
43
|
+
const _a2 = tile(opt), { key } = _a2, rest = __objRest(_a2, ["key"]);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
ChoiceCardControl,
|
|
46
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
47
|
+
value: void 0,
|
|
48
|
+
control: "checkbox",
|
|
49
|
+
selected: value2.includes(opt.value),
|
|
50
|
+
onSelect: () => onChange2(value2.includes(opt.value) ? value2.filter((v) => v !== opt.value) : [...value2, opt.value])
|
|
51
|
+
}),
|
|
52
|
+
key
|
|
135
53
|
);
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return /* @__PURE__ */
|
|
54
|
+
}) });
|
|
55
|
+
}
|
|
56
|
+
const { value, onChange } = props;
|
|
57
|
+
return /* @__PURE__ */ jsx(ChoiceCardGroup, { legend, layout: "tile", value: value != null ? value : "", onValueChange: (next) => onChange(next), className, children: options.map((opt) => {
|
|
58
|
+
const _a2 = tile(opt), { key } = _a2, rest = __objRest(_a2, ["key"]);
|
|
59
|
+
return /* @__PURE__ */ jsx(ChoiceCardControl, __spreadProps(__spreadValues({}, rest), { control: "radio" }), key);
|
|
60
|
+
}) });
|
|
140
61
|
}
|
|
141
62
|
export {
|
|
142
63
|
OptionTile,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type PageHeaderHeading = 'h1' | 'h2' | 'h3';
|
|
5
|
+
interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
6
|
+
/** The screen's name (Figma: `title`). It does not repeat the path. */
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** What the screen does, in one sentence (Figma: `showDescription` + `description`). */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** Where the person is: a Breadcrumb (Figma: `showBreadcrumb`). */
|
|
11
|
+
breadcrumb?: ReactNode;
|
|
12
|
+
/** Up to two actions on the right, the main one a Button action fill (Figma: the `actions` slot). */
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* A TabsList, when the screen splits into views (Figma: `showTabs`). The Tabs root wraps the PageHeader and the
|
|
16
|
+
* TabsContent panels under it.
|
|
17
|
+
*/
|
|
18
|
+
tabs?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* The title's heading level. h1 (default) for the top of a screen, inside a <header>; h2 or h3 for a section
|
|
21
|
+
* inside the page, following its outline (then a <div>). Not in the Figma: it only changes the semantics.
|
|
22
|
+
*/
|
|
23
|
+
titleAs?: PageHeaderHeading;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* PageHeader — Figma [RDS] Navigation/PageHeader. The top of a screen: path, title, what it does, the main actions
|
|
27
|
+
* and, when the screen splits, the tabs. On a phone the actions go under the title. Styles: page-header.css.
|
|
28
|
+
*/
|
|
29
|
+
declare function PageHeader({ title, description, breadcrumb, actions, tabs, titleAs, className, ...rest }: PageHeaderProps): react.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { PageHeader, type PageHeaderHeading, type PageHeaderProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function PageHeader(_a) {
|
|
8
|
+
var _b = _a, { title, description, breadcrumb, actions, tabs, titleAs = "h1", className } = _b, rest = __objRest(_b, ["title", "description", "breadcrumb", "actions", "tabs", "titleAs", "className"]);
|
|
9
|
+
const Root = titleAs === "h1" ? "header" : "div";
|
|
10
|
+
const Title = titleAs;
|
|
11
|
+
return /* @__PURE__ */ jsxs(Root, __spreadProps(__spreadValues({}, rest), { className: ["rds-page-header", className].filter(Boolean).join(" "), children: [
|
|
12
|
+
breadcrumb,
|
|
13
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-page-header__row", children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-page-header__heading", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Title, { className: "rds-page-header__title", children: title }),
|
|
16
|
+
description && /* @__PURE__ */ jsx("p", { className: "rds-page-header__description", children: description })
|
|
17
|
+
] }),
|
|
18
|
+
actions && /* @__PURE__ */ jsx("div", { className: "rds-page-header__actions", children: actions })
|
|
19
|
+
] }),
|
|
20
|
+
tabs
|
|
21
|
+
] }));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
PageHeader
|
|
25
|
+
};
|
|
@@ -3,12 +3,18 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
|
|
4
4
|
type PageShellWidth = 'narrow' | 'default' | 'wide';
|
|
5
5
|
interface PageShellProps {
|
|
6
|
+
/** narrow 768, default 1280, wide 1536. */
|
|
6
7
|
maxWidth?: PageShellWidth;
|
|
8
|
+
/** The page's gutters: 24 on top and bottom, 16 on the sides (24 from 640, 32 from 1024). Default true. */
|
|
7
9
|
padded?: boolean;
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
className?: string;
|
|
10
12
|
}
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* PageShell — the page container: centred, at most `maxWidth` wide, with the page's gutters. PageShell.Header is
|
|
15
|
+
* the PageHeader (deprecated wrapper) and PageShell.Body stacks the sections 24 apart. Styles: page-shell.css.
|
|
16
|
+
*/
|
|
17
|
+
declare function PageShell({ maxWidth, padded, children, className }: PageShellProps): react.JSX.Element;
|
|
12
18
|
declare namespace PageShell {
|
|
13
19
|
var Header: typeof PageShellHeader;
|
|
14
20
|
var Body: typeof PageShellBody;
|
|
@@ -19,6 +25,10 @@ interface PageShellHeaderProps {
|
|
|
19
25
|
actions?: ReactNode;
|
|
20
26
|
className?: string;
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use PageHeader (Figma [RDS] Navigation/PageHeader). A thin wrapper over it: title and actions pass
|
|
30
|
+
* through; eyebrow (not in the Figma) becomes the description line.
|
|
31
|
+
*/
|
|
22
32
|
declare function PageShellHeader({ title, eyebrow, actions, className }: PageShellHeaderProps): react.JSX.Element;
|
|
23
33
|
interface PageShellBodyProps {
|
|
24
34
|
children: ReactNode;
|
|
@@ -1,33 +1,14 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
function PageShell({
|
|
8
|
-
maxWidth = "default",
|
|
9
|
-
padded = true,
|
|
10
|
-
children,
|
|
11
|
-
className = ""
|
|
12
|
-
}) {
|
|
13
|
-
return /* @__PURE__ */ React.createElement(
|
|
14
|
-
"div",
|
|
15
|
-
{
|
|
16
|
-
className: [
|
|
17
|
-
"mx-auto w-full",
|
|
18
|
-
WIDTH_CLS[maxWidth],
|
|
19
|
-
padded ? "px-4 sm:px-6 lg:px-8 py-6" : "",
|
|
20
|
-
className
|
|
21
|
-
].filter(Boolean).join(" ")
|
|
22
|
-
},
|
|
23
|
-
children
|
|
24
|
-
);
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PageHeader } from "./page-header.js";
|
|
4
|
+
function PageShell({ maxWidth = "default", padded = true, children, className }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: ["rds-page-shell", `rds-page-shell--${maxWidth}`, padded && "rds-page-shell--padded", className].filter(Boolean).join(" "), children });
|
|
25
6
|
}
|
|
26
|
-
function PageShellHeader({ title, eyebrow, actions, className
|
|
27
|
-
return /* @__PURE__ */
|
|
7
|
+
function PageShellHeader({ title, eyebrow, actions, className }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(PageHeader, { title, description: eyebrow, actions, className: ["rds-page-shell__header", className].filter(Boolean).join(" ") });
|
|
28
9
|
}
|
|
29
|
-
function PageShellBody({ children, className
|
|
30
|
-
return /* @__PURE__ */
|
|
10
|
+
function PageShellBody({ children, className }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: ["rds-page-shell__body", className].filter(Boolean).join(" "), children });
|
|
31
12
|
}
|
|
32
13
|
PageShell.Header = PageShellHeader;
|
|
33
14
|
PageShell.Body = PageShellBody;
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* PageSkeleton —
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `padded` (default true) controla o padding interno. Use `padded={false}`
|
|
8
|
-
* quando o skeleton já vive dentro de um container que aplica padding
|
|
9
|
-
* (ex.: PageRoot/PageLayout), evitando padding duplicado.
|
|
10
|
-
*
|
|
11
|
-
* Uso:
|
|
12
|
-
* <PageSkeleton rows={8} />
|
|
13
|
-
* <PageSkeleton rows={8} padded={false} /> // dentro de um container
|
|
4
|
+
* PageSkeleton and CardsSkeleton — compositions of the Skeleton (Figma [RDS] Content/Skeleton) inside Cards: the
|
|
5
|
+
* loading state of a page, in the shape of what is coming. The region is aria-busy and says "Carregando…" to
|
|
6
|
+
* screen readers only; the shapes are hidden from them. Styles: page-skeleton.css.
|
|
14
7
|
*/
|
|
15
8
|
interface PageSkeletonProps {
|
|
9
|
+
/** How many table rows. Default 5. */
|
|
16
10
|
rows?: number;
|
|
11
|
+
/** The page's padding (24). Turn it off inside a container that already pads. Default true. */
|
|
17
12
|
padded?: boolean;
|
|
13
|
+
/** What screen readers hear. */
|
|
14
|
+
label?: string;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* CardsSkeleton — loading state pra páginas com KPIs (4 cards no topo + 2 charts).
|
|
22
|
-
*
|
|
23
|
-
* `padded` (default true) — ver PageSkeleton.
|
|
24
|
-
*
|
|
25
|
-
* Uso:
|
|
26
|
-
* <CardsSkeleton count={4} />
|
|
27
|
-
* <CardsSkeleton count={4} padded={false} /> // dentro de um container
|
|
28
|
-
*/
|
|
16
|
+
/** A page with a table: the title and a button, then the table's header and `rows` rows. */
|
|
17
|
+
declare function PageSkeleton({ rows, padded, label }: PageSkeletonProps): react.JSX.Element;
|
|
29
18
|
interface CardsSkeletonProps {
|
|
19
|
+
/** How many indicator cards. Default 4. */
|
|
30
20
|
count?: number;
|
|
21
|
+
/** The page's padding (24). Turn it off inside a container that already pads. Default true. */
|
|
31
22
|
padded?: boolean;
|
|
23
|
+
/** What screen readers hear. */
|
|
24
|
+
label?: string;
|
|
32
25
|
}
|
|
33
|
-
|
|
26
|
+
/** A page of indicators: the title, `count` cards (2 per row, 4 from 1024) and two charts. */
|
|
27
|
+
declare function CardsSkeleton({ count, padded, label }: CardsSkeletonProps): react.JSX.Element;
|
|
34
28
|
|
|
35
29
|
export { CardsSkeleton, type CardsSkeletonProps, PageSkeleton, type PageSkeletonProps };
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Card } from "./card.js";
|
|
2
4
|
import { Skeleton } from "./skeleton.js";
|
|
3
|
-
function PageSkeleton({ rows = 5, padded = true }) {
|
|
4
|
-
return /* @__PURE__ */
|
|
5
|
+
function PageSkeleton({ rows = 5, padded = true, label = "Carregando\u2026" }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: ["rds-page-skeleton", padded && "rds-page-skeleton--padded"].filter(Boolean).join(" "), role: "status", "aria-busy": "true", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: label }),
|
|
8
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-page-skeleton__heading", children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 192, height: 28 }),
|
|
10
|
+
/* @__PURE__ */ jsx(Skeleton, { shape: "rect", width: 112, height: 36 })
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", className: "rds-page-skeleton__table", children: [
|
|
13
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-page-skeleton__row rds-page-skeleton__row--head", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 128 }),
|
|
15
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 96 }),
|
|
16
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 80 })
|
|
17
|
+
] }),
|
|
18
|
+
Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxs("div", { className: "rds-page-skeleton__row", children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 160 }),
|
|
20
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 112 }),
|
|
21
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 64 }),
|
|
22
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 80, className: "rds-page-skeleton__end" })
|
|
23
|
+
] }, i))
|
|
24
|
+
] })
|
|
25
|
+
] });
|
|
5
26
|
}
|
|
6
|
-
function CardsSkeleton({ count = 4, padded = true }) {
|
|
7
|
-
return /* @__PURE__ */
|
|
27
|
+
function CardsSkeleton({ count = 4, padded = true, label = "Carregando\u2026" }) {
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: ["rds-page-skeleton", padded && "rds-page-skeleton--padded"].filter(Boolean).join(" "), role: "status", "aria-busy": "true", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "rds-visually-hidden", children: label }),
|
|
30
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 192, height: 28 }),
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "rds-page-skeleton__grid rds-page-skeleton__grid--stats", children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", className: "rds-page-skeleton__card", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 96 }),
|
|
33
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 128, height: 32 }),
|
|
34
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 80, height: 12 })
|
|
35
|
+
] }, i)) }),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: "rds-page-skeleton__grid rds-page-skeleton__grid--charts", children: [0, 1].map((i) => /* @__PURE__ */ jsxs(Card, { as: "div", size: "sm", className: "rds-page-skeleton__card", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 128, height: 20 }),
|
|
38
|
+
/* @__PURE__ */ jsx(Skeleton, { shape: "rect", height: 128 })
|
|
39
|
+
] }, i)) })
|
|
40
|
+
] });
|
|
8
41
|
}
|
|
9
42
|
export {
|
|
10
43
|
CardsSkeleton,
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ComponentType, ReactNode } from 'react';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* <Pagination page={1} totalPages={20} onChange={...} siblings={2} />
|
|
14
|
-
*
|
|
15
|
-
* Renderiza: Prev | 1 ... 4 5 [6] 7 8 ... 20 | Next
|
|
16
|
-
*/
|
|
17
|
-
interface PaginationProps {
|
|
4
|
+
type PaginationLinkComponent = ComponentType<{
|
|
5
|
+
href: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
'aria-current'?: 'page';
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
12
|
+
/** The open page, from 1. */
|
|
18
13
|
page: number;
|
|
14
|
+
/** How many pages there are. */
|
|
19
15
|
totalPages: number;
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
/** Buttons: called with the page to open. Leave it out and pass `href` for links. */
|
|
17
|
+
onChange?: (page: number) => void;
|
|
18
|
+
/** Links: the address of each page. */
|
|
19
|
+
href?: (page: number) => string;
|
|
20
|
+
/** The link element when `href` is given (default `<a>`). Pass a framework Link to navigate on the client. */
|
|
21
|
+
linkAs?: PaginationLinkComponent;
|
|
22
|
+
/** The range and the total, on the left ("21–40 de 340"); never hide the total (Figma: `showSummary` + `summary`). */
|
|
23
|
+
summary?: ReactNode;
|
|
24
|
+
/** Pages shown on each side of the open one. Default 1. */
|
|
22
25
|
siblings?: number;
|
|
23
|
-
/**
|
|
26
|
+
/** Pages always shown at the start and at the end. Default 1. */
|
|
24
27
|
boundaries?: number;
|
|
25
|
-
|
|
26
|
-
/** Esconde quando totalPages <= 1. default = true. */
|
|
28
|
+
/** Render nothing when there is a single page. Default true. */
|
|
27
29
|
hideOnSinglePage?: boolean;
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
type Entry = number | 'ellipsis-start' | 'ellipsis-end';
|
|
32
|
+
/** First and last (`boundaries`), the open page and `siblings` on each side; a gap of one page shows the page, a longer one "…". */
|
|
33
|
+
declare function pageItems(page: number, totalPages: number, siblings?: number, boundaries?: number): Entry[];
|
|
34
|
+
/**
|
|
35
|
+
* Pagination — Figma [RDS] Navigation/Pagination. To walk a long list one page at a time: a <nav aria-label="Paginação">;
|
|
36
|
+
* the open page has aria-current="page", every number is named "Página N", previous and next are named and turn
|
|
37
|
+
* disabled at the ends. Buttons with `onChange`, links with `href`. Styles: pagination.css.
|
|
38
|
+
*/
|
|
39
|
+
declare function Pagination({ page, totalPages, onChange, href, linkAs: Link, summary, siblings, boundaries, hideOnSinglePage, className, ...rest }: PaginationProps): react.JSX.Element | null;
|
|
30
40
|
|
|
31
|
-
export { Pagination, type PaginationProps };
|
|
41
|
+
export { Pagination, type PaginationLinkComponent, type PaginationProps, pageItems };
|