@rojaostudio/ds 1.0.2 → 2.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -13
- package/dist/compat/generate.d.ts +0 -1
- package/dist/components/accordion.d.ts +30 -20
- package/dist/components/accordion.js +31 -93
- package/dist/components/action-bar.d.ts +24 -0
- package/dist/components/action-bar.js +55 -0
- package/dist/components/alert-dialog.d.ts +31 -0
- package/dist/components/alert-dialog.js +43 -0
- package/dist/components/alert.d.ts +31 -19
- package/dist/components/alert.js +67 -65
- package/dist/components/attachment.d.ts +37 -0
- package/dist/components/attachment.js +76 -0
- package/dist/components/avatar.d.ts +43 -36
- package/dist/components/avatar.js +59 -90
- package/dist/components/badge.d.ts +30 -41
- package/dist/components/badge.js +13 -110
- package/dist/components/banner.d.ts +27 -0
- package/dist/components/banner.js +66 -0
- package/dist/components/benefits.d.ts +30 -0
- package/dist/components/benefits.js +32 -0
- package/dist/components/breadcrumb.d.ts +25 -18
- package/dist/components/breadcrumb.js +38 -56
- package/dist/components/browser.d.ts +18 -0
- package/dist/components/browser.js +32 -0
- package/dist/components/bubble.d.ts +29 -0
- package/dist/components/bubble.js +33 -0
- package/dist/components/button-group.d.ts +19 -0
- package/dist/components/button-group.js +20 -0
- package/dist/components/button.d.ts +47 -20
- package/dist/components/button.js +45 -108
- package/dist/components/calendar.d.ts +29 -0
- package/dist/components/calendar.js +149 -0
- package/dist/components/card.d.ts +47 -19
- package/dist/components/card.js +31 -46
- package/dist/components/carousel.d.ts +28 -0
- package/dist/components/carousel.js +130 -0
- package/dist/components/chart.d.ts +49 -0
- package/dist/components/chart.js +258 -0
- package/dist/components/checkbox-group.d.ts +16 -0
- package/dist/components/checkbox-group.js +13 -0
- package/dist/components/checkbox.d.ts +25 -10
- package/dist/components/checkbox.js +87 -81
- package/dist/components/chip-input.d.ts +46 -20
- package/dist/components/chip-input.js +172 -176
- package/dist/components/chip.d.ts +28 -0
- package/dist/components/chip.js +73 -0
- package/dist/components/choice-card.d.ts +10 -13
- package/dist/components/choice-card.js +11 -62
- package/dist/components/choice-carousel.d.ts +9 -0
- package/dist/components/choice-carousel.js +28 -44
- package/dist/components/choice-preview-card.d.ts +10 -20
- package/dist/components/choice-preview-card.js +12 -40
- package/dist/components/color-input.d.ts +36 -11
- package/dist/components/color-input.js +131 -59
- package/dist/components/combobox.d.ts +60 -57
- package/dist/components/combobox.js +210 -213
- package/dist/components/command.d.ts +58 -0
- package/dist/components/command.js +177 -0
- package/dist/components/contact.d.ts +23 -0
- package/dist/components/contact.js +32 -0
- package/dist/components/context-menu.d.ts +34 -26
- package/dist/components/context-menu.js +41 -68
- package/dist/components/copy-field.d.ts +10 -5
- package/dist/components/copy-field.js +24 -29
- package/dist/components/currency-input.d.ts +25 -11
- package/dist/components/currency-input.js +29 -65
- package/dist/components/danger-zone.d.ts +10 -1
- package/dist/components/danger-zone.js +14 -18
- package/dist/components/data-table-header.d.ts +13 -2
- package/dist/components/data-table-header.js +114 -190
- package/dist/components/date-picker.d.ts +31 -32
- package/dist/components/date-picker.js +119 -254
- package/dist/components/delta.d.ts +26 -0
- package/dist/components/delta.js +24 -0
- package/dist/components/dialog.d.ts +21 -0
- package/dist/components/dialog.js +16 -0
- package/dist/components/drawer.d.ts +15 -23
- package/dist/components/drawer.js +57 -89
- package/dist/components/dropdown-menu.d.ts +63 -0
- package/dist/components/dropdown-menu.js +62 -0
- package/dist/components/dropzone.d.ts +10 -4
- package/dist/components/dropzone.js +30 -58
- package/dist/components/empty.d.ts +29 -0
- package/dist/components/empty.js +42 -0
- package/dist/components/fab.d.ts +29 -6
- package/dist/components/fab.js +51 -51
- package/dist/components/faq.d.ts +21 -0
- package/dist/components/faq.js +24 -0
- package/dist/components/file-input.d.ts +56 -0
- package/dist/components/file-input.js +244 -0
- package/dist/components/filter-chip.d.ts +34 -47
- package/dist/components/filter-chip.js +61 -61
- package/dist/components/floating-stepper.d.ts +7 -18
- package/dist/components/floating-stepper.js +27 -55
- package/dist/components/footer.d.ts +36 -0
- package/dist/components/footer.js +38 -0
- package/dist/components/form-actions.d.ts +28 -0
- package/dist/components/form-actions.js +24 -0
- package/dist/components/google-account-chooser.d.ts +25 -0
- package/dist/components/google-account-chooser.js +44 -0
- package/dist/components/google-button.d.ts +26 -0
- package/dist/components/google-button.js +38 -0
- package/dist/components/google-consent.d.ts +23 -0
- package/dist/components/google-consent.js +28 -0
- package/dist/components/google-sign-in.d.ts +26 -0
- package/dist/components/google-sign-in.js +36 -0
- package/dist/components/hover-card.d.ts +30 -0
- package/dist/components/hover-card.js +55 -0
- package/dist/components/icon-button.d.ts +41 -11
- package/dist/components/icon-button.js +44 -64
- package/dist/components/image-crop-modal.d.ts +3 -3
- package/dist/components/image-crop-modal.js +32 -39
- package/dist/components/image-upload.d.ts +21 -29
- package/dist/components/image-upload.js +55 -259
- package/dist/components/index.d.ts +105 -49
- package/dist/components/index.js +190 -68
- package/dist/components/input-otp.d.ts +35 -0
- package/dist/components/input-otp.js +119 -0
- package/dist/components/input.d.ts +23 -17
- package/dist/components/input.js +104 -137
- package/dist/components/insight-card.d.ts +25 -9
- package/dist/components/insight-card.js +42 -27
- package/dist/components/internal/announce.d.ts +3 -0
- package/dist/components/internal/announce.js +20 -0
- package/dist/components/internal/block.d.ts +15 -0
- package/dist/components/internal/block.js +14 -0
- package/dist/components/internal/button.d.ts +23 -0
- package/dist/components/internal/button.js +30 -0
- package/dist/components/internal/choice-card.d.ts +52 -0
- package/dist/components/internal/choice-card.js +117 -0
- package/dist/components/internal/choice.d.ts +25 -0
- package/dist/components/internal/choice.js +44 -0
- package/dist/components/internal/dates.d.ts +17 -0
- package/dist/components/internal/dates.js +59 -0
- package/dist/components/internal/field.d.ts +66 -0
- package/dist/components/internal/field.js +105 -0
- package/dist/components/internal/fieldset.d.ts +25 -0
- package/dist/components/internal/fieldset.js +56 -0
- package/dist/components/internal/focus-after.d.ts +3 -0
- package/dist/components/internal/focus-after.js +13 -0
- package/dist/components/internal/google.d.ts +47 -0
- package/dist/components/internal/google.js +73 -0
- package/dist/components/internal/icons.d.ts +108 -0
- package/dist/components/internal/icons.js +316 -0
- package/dist/components/internal/menu.d.ts +16 -0
- package/dist/components/internal/menu.js +14 -0
- package/dist/components/internal/modal.d.ts +50 -0
- package/dist/components/internal/modal.js +85 -0
- package/dist/components/internal/option-content.d.ts +10 -0
- package/dist/components/internal/option-content.js +13 -0
- package/dist/components/internal/radio-context.d.ts +16 -0
- package/dist/components/internal/radio-context.js +6 -0
- package/dist/components/internal/toggle.d.ts +7 -0
- package/dist/components/internal/toggle.js +13 -0
- package/dist/components/internal/use-listbox.d.ts +56 -0
- package/dist/components/internal/use-listbox.js +69 -0
- package/dist/components/internal/whatsapp.d.ts +8 -0
- package/dist/components/internal/whatsapp.js +12 -0
- package/dist/components/item.d.ts +32 -0
- package/dist/components/item.js +35 -0
- package/dist/components/kbd.d.ts +17 -0
- package/dist/components/kbd.js +18 -0
- package/dist/components/listbox.d.ts +34 -0
- package/dist/components/listbox.js +114 -0
- package/dist/components/marker.d.ts +24 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/media-tile.d.ts +17 -14
- package/dist/components/media-tile.js +19 -27
- package/dist/components/message-scroller.d.ts +20 -0
- package/dist/components/message-scroller.js +108 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +23 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +30 -0
- package/dist/components/newsletter.d.ts +27 -0
- package/dist/components/newsletter.js +75 -0
- package/dist/components/number-input.d.ts +60 -0
- package/dist/components/number-input.js +234 -0
- package/dist/components/option-tile.d.ts +20 -19
- package/dist/components/option-tile.js +52 -137
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.js +25 -0
- package/dist/components/page-shell.d.ts +11 -1
- package/dist/components/page-shell.js +8 -34
- package/dist/components/page-skeleton.d.ts +15 -21
- package/dist/components/page-skeleton.js +28 -25
- package/dist/components/pagination.d.ts +32 -22
- package/dist/components/pagination.js +78 -76
- package/dist/components/password-input.d.ts +26 -0
- package/dist/components/password-input.js +112 -0
- package/dist/components/phone-input.d.ts +12 -8
- package/dist/components/phone-input.js +75 -64
- package/dist/components/phone.d.ts +27 -0
- package/dist/components/phone.js +35 -0
- package/dist/components/popover.d.ts +25 -36
- package/dist/components/popover.js +30 -131
- package/dist/components/pricing-card.d.ts +9 -25
- package/dist/components/pricing-card.js +9 -40
- package/dist/components/pricing.d.ts +48 -0
- package/dist/components/pricing.js +64 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.js +57 -0
- package/dist/components/qr-display.d.ts +11 -6
- package/dist/components/qr-display.js +6 -22
- package/dist/components/questionnaire.d.ts +42 -0
- package/dist/components/questionnaire.js +107 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.js +40 -0
- package/dist/components/radio.d.ts +15 -29
- package/dist/components/radio.js +45 -103
- package/dist/components/row-actions.d.ts +5 -0
- package/dist/components/row-actions.js +27 -34
- package/dist/components/saving-bar-context.d.ts +0 -5
- package/dist/components/saving-bar-context.js +16 -40
- package/dist/components/saving-bar.d.ts +26 -11
- package/dist/components/saving-bar.js +50 -65
- package/dist/components/section-card.d.ts +18 -4
- package/dist/components/section-card.js +29 -50
- package/dist/components/section-header.d.ts +8 -12
- package/dist/components/section-header.js +5 -10
- package/dist/components/select.d.ts +44 -16
- package/dist/components/select.js +83 -154
- package/dist/components/selectable-card.d.ts +11 -19
- package/dist/components/selectable-card.js +4 -28
- package/dist/components/separator.d.ts +20 -0
- package/dist/components/separator.js +19 -0
- package/dist/components/setting-row.d.ts +11 -15
- package/dist/components/setting-row.js +10 -23
- package/dist/components/settings-list.d.ts +10 -12
- package/dist/components/settings-list.js +7 -19
- package/dist/components/sheet.d.ts +21 -0
- package/dist/components/sheet.js +16 -0
- package/dist/components/sidebar.d.ts +79 -0
- package/dist/components/sidebar.js +111 -0
- package/dist/components/skeleton.d.ts +14 -20
- package/dist/components/skeleton.js +8 -37
- package/dist/components/slider.d.ts +21 -23
- package/dist/components/slider.js +59 -64
- package/dist/components/sparkline.d.ts +19 -0
- package/dist/components/sparkline.js +32 -0
- package/dist/components/spinner.d.ts +16 -8
- package/dist/components/spinner.js +34 -37
- package/dist/components/star-rating.d.ts +22 -0
- package/dist/components/star-rating.js +25 -0
- package/dist/components/stat.d.ts +33 -0
- package/dist/components/stat.js +29 -0
- package/dist/components/status.d.ts +27 -0
- package/dist/components/status.js +34 -0
- package/dist/components/step-progress.d.ts +13 -6
- package/dist/components/step-progress.js +18 -16
- package/dist/components/summary-bar.d.ts +20 -20
- package/dist/components/summary-bar.js +13 -55
- package/dist/components/switch.d.ts +20 -0
- package/dist/components/switch.js +46 -0
- package/dist/components/table.d.ts +56 -17
- package/dist/components/table.js +59 -58
- package/dist/components/tabs.d.ts +67 -0
- package/dist/components/tabs.js +56 -0
- package/dist/components/testimonial.d.ts +30 -0
- package/dist/components/testimonial.js +36 -0
- package/dist/components/textarea.d.ts +11 -16
- package/dist/components/textarea.js +55 -91
- package/dist/components/tile.d.ts +24 -0
- package/dist/components/tile.js +21 -0
- package/dist/components/time-picker.d.ts +40 -25
- package/dist/components/time-picker.js +185 -203
- package/dist/components/toast.d.ts +63 -0
- package/dist/components/toast.js +132 -0
- package/dist/components/toggle-card-compact.d.ts +15 -5
- package/dist/components/toggle-card-compact.js +19 -86
- package/dist/components/toggle-card.d.ts +11 -2
- package/dist/components/toggle-card.js +8 -77
- package/dist/components/toggle-group.d.ts +21 -59
- package/dist/components/toggle-group.js +31 -80
- package/dist/components/toggle.d.ts +19 -9
- package/dist/components/toggle.js +16 -61
- package/dist/components/tooltip.d.ts +25 -12
- package/dist/components/tooltip.js +15 -88
- package/dist/components/top-navigation.d.ts +33 -0
- package/dist/components/top-navigation.js +85 -0
- package/dist/components/typing-indicator.d.ts +6 -0
- package/dist/components/typing-indicator.js +3 -24
- package/dist/components/whatsapp-chat.d.ts +28 -0
- package/dist/components/whatsapp-chat.js +95 -0
- package/dist/components/whatsapp-message.d.ts +22 -0
- package/dist/components/whatsapp-message.js +34 -0
- package/dist/components/whatsapp-notification.d.ts +27 -0
- package/dist/components/whatsapp-notification.js +73 -0
- package/dist/components/whatsapp-template.d.ts +42 -0
- package/dist/components/whatsapp-template.js +69 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/pix.d.ts +16 -0
- package/dist/targets/native/components/index.d.ts +0 -2
- package/dist/targets/native/components/index.js +0 -4
- package/dist/targets/native/preset.cjs +0 -1
- package/dist/targets/native/theme.css +58 -60
- package/dist/targets/native/theme.d.ts +58 -60
- package/dist/targets/native/theme.js +58 -60
- package/package.json +34 -12
- package/styles/_primitives.generated.css +40 -0
- package/styles/base.css +12 -18
- package/styles/rds/components-styles.css +11365 -0
- package/styles/rds/components.css +993 -0
- package/styles/rds/foundation.css +74 -0
- package/styles/rds/theme.css +261 -0
- package/styles/rds.css +6 -0
- package/styles/themes/rojao.css +46 -53
- package/dist/components/blocker-card.d.ts +0 -42
- package/dist/components/blocker-card.js +0 -54
- package/dist/components/bottom-sheet.d.ts +0 -31
- package/dist/components/bottom-sheet.js +0 -127
- package/dist/components/chat-bubble.d.ts +0 -16
- package/dist/components/chat-bubble.js +0 -56
- package/dist/components/chips.d.ts +0 -22
- package/dist/components/chips.js +0 -101
- package/dist/components/copilot-hint.d.ts +0 -18
- package/dist/components/copilot-hint.js +0 -72
- package/dist/components/divider.d.ts +0 -20
- package/dist/components/divider.js +0 -50
- package/dist/components/empty-state.d.ts +0 -48
- package/dist/components/empty-state.js +0 -94
- package/dist/components/form-card-header.d.ts +0 -13
- package/dist/components/form-card-header.js +0 -16
- package/dist/components/label.d.ts +0 -16
- package/dist/components/label.js +0 -48
- package/dist/components/menu.d.ts +0 -50
- package/dist/components/menu.js +0 -83
- package/dist/components/modal.d.ts +0 -25
- package/dist/components/modal.js +0 -86
- package/dist/components/notice.d.ts +0 -50
- package/dist/components/notice.js +0 -121
- package/dist/components/page-tabs.d.ts +0 -35
- package/dist/components/page-tabs.js +0 -68
- package/dist/components/paywall-banner.d.ts +0 -37
- package/dist/components/paywall-banner.js +0 -58
- package/dist/components/paywall.d.ts +0 -44
- package/dist/components/paywall.js +0 -65
- package/dist/components/phone-frame.d.ts +0 -9
- package/dist/components/phone-frame.js +0 -19
- package/dist/components/pix-icon.d.ts +0 -8
- package/dist/components/search.d.ts +0 -30
- package/dist/components/search.js +0 -86
- package/dist/components/themed.d.ts +0 -36
- package/dist/components/themed.js +0 -23
- package/dist/components/toaster.d.ts +0 -84
- package/dist/components/toaster.js +0 -290
- package/dist/components/use-dismiss.d.ts +0 -9
- package/dist/components/use-dismiss.js +0 -28
- package/dist/components/use-focus-trap.d.ts +0 -5
- package/dist/components/use-focus-trap.js +0 -54
- package/dist/targets/native/components/paywall-banner.d.ts +0 -11
- package/dist/targets/native/components/paywall-banner.js +0 -55
- package/dist/targets/native/components/paywall.d.ts +0 -18
- package/dist/targets/native/components/paywall.js +0 -71
- /package/dist/{components/pix-icon.js → icons/pix.js} +0 -0
|
@@ -1,45 +1,41 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, KeyboardEvent } from 'react';
|
|
3
|
-
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { ReactNode, KeyboardEvent, ComponentType } from 'react';
|
|
4
3
|
|
|
5
|
-
/**
|
|
6
|
-
* OptionTile / OptionTileGrid — grade de escolha única (onboarding #449).
|
|
7
|
-
*
|
|
8
|
-
* MESMA FAMÍLIA visual do ChoiceCard (os dois single-choice): casca idle suave
|
|
9
|
-
* (borda 1px border-default, hover border-strong) e selecionado = fill SÓLIDO
|
|
10
|
-
* derivado da camada semântica de seleção (--selection-fill-active). Baixa visão:
|
|
11
|
-
* a seleção é distinguível por mais que cor — fill de alto contraste + check
|
|
12
|
-
* redundante (badge on-fill, glifo fill), nunca só um realce sutil. Todo conteúdo
|
|
13
|
-
* sobre o fill ativo usa tokens de contraste próprios (*-active → on-fill), nunca
|
|
14
|
-
* os tokens de superfície clara.
|
|
15
|
-
*
|
|
16
|
-
* Acessibilidade: OptionTileGrid é um radiogroup com roving tabindex — só um tile é
|
|
17
|
-
* tabbable; setas movem foco E seleção (padrão ARIA), Home/End vão às pontas.
|
|
18
|
-
*/
|
|
4
|
+
/** @deprecated Use ChoiceCardProps. */
|
|
19
5
|
interface OptionTileProps {
|
|
20
6
|
selected: boolean;
|
|
21
7
|
label: string;
|
|
22
8
|
onClick: () => void;
|
|
23
9
|
icon?: ReactNode;
|
|
24
10
|
disabled?: boolean;
|
|
11
|
+
/** true: a checkbox (several chosen); false: a radio (one at a time). */
|
|
25
12
|
multiple?: boolean;
|
|
26
13
|
tabIndex?: number;
|
|
14
|
+
/** Ignored: the native radio handles the keyboard. */
|
|
27
15
|
onKeyDown?: (e: KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
|
+
/** Ignored: the control is an <input>, not a <button>. */
|
|
28
17
|
buttonRef?: (el: HTMLButtonElement | null) => void;
|
|
18
|
+
/** Takes the whole line of the grid. */
|
|
29
19
|
fullSpan?: boolean;
|
|
30
20
|
className?: string;
|
|
31
21
|
}
|
|
32
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use ChoiceCard with layout="tile" (Figma [RDS] Content/ChoiceCard). A thin wrapper over it: `label` is
|
|
24
|
+
* the children, `onClick` is `onSelect`. A native radio (a checkbox with `multiple`), no longer a button.
|
|
25
|
+
*/
|
|
26
|
+
declare function OptionTile({ selected, label, onClick, icon, disabled, multiple, tabIndex, fullSpan, className }: OptionTileProps): react.JSX.Element;
|
|
27
|
+
/** @deprecated Use ChoiceCardGroup's items. */
|
|
33
28
|
interface OptionTileItem<T extends string = string> {
|
|
34
29
|
value: T;
|
|
35
30
|
label: string;
|
|
36
|
-
icon
|
|
31
|
+
/** An icon component (lucide or your own); absent, the tile is text only. */
|
|
32
|
+
icon?: ComponentType;
|
|
37
33
|
fullSpan?: boolean;
|
|
38
34
|
}
|
|
39
35
|
interface OptionTileGridBase<T extends string = string> {
|
|
40
36
|
label?: ReactNode;
|
|
41
37
|
options: OptionTileItem<T>[];
|
|
42
|
-
/**
|
|
38
|
+
/** Ignored: the grid fits as many 160 cells as the width allows. */
|
|
43
39
|
columns?: 2 | 3;
|
|
44
40
|
className?: string;
|
|
45
41
|
'aria-label'?: string;
|
|
@@ -54,7 +50,12 @@ type OptionTileGridMulti<T extends string = string> = OptionTileGridBase<T> & {
|
|
|
54
50
|
value: T[];
|
|
55
51
|
onChange: (value: T[]) => void;
|
|
56
52
|
};
|
|
53
|
+
/** @deprecated Use ChoiceCardGroupProps. */
|
|
57
54
|
type OptionTileGridProps<T extends string = string> = OptionTileGridSingle<T> | OptionTileGridMulti<T>;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated Use ChoiceCardGroup with layout="tile". A thin wrapper over it: `label` (or `aria-label`) is the legend.
|
|
57
|
+
* With `multiple` the tiles are checkboxes, each toggling its value in the list.
|
|
58
|
+
*/
|
|
58
59
|
declare function OptionTileGrid<T extends string = string>(props: OptionTileGridProps<T>): react.JSX.Element;
|
|
59
60
|
|
|
60
61
|
export { OptionTile, OptionTileGrid, type OptionTileGridProps, type OptionTileItem, type OptionTileProps };
|
|
@@ -1,148 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
multiple = false,
|
|
13
|
-
tabIndex,
|
|
14
|
-
onKeyDown,
|
|
15
|
-
buttonRef,
|
|
16
|
-
fullSpan = false,
|
|
17
|
-
className = ""
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ jsxs(
|
|
20
|
-
"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,
|
|
21
12
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
control: multiple ? "checkbox" : "radio",
|
|
14
|
+
layout: "tile",
|
|
15
|
+
selected,
|
|
16
|
+
onSelect: onClick,
|
|
17
|
+
icon,
|
|
26
18
|
disabled,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"relative flex w-full flex-col items-center justify-center gap-2 rounded-(--radius-card) border text-center transition-all",
|
|
32
|
-
icon ? "min-h-[88px] px-3 py-4" : "min-h-[52px] px-3 py-3",
|
|
33
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:ring-offset-2",
|
|
34
|
-
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)]",
|
|
35
|
-
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
36
|
-
fullSpan ? "col-span-full" : "",
|
|
37
|
-
className
|
|
38
|
-
].filter(Boolean).join(" "),
|
|
39
|
-
children: [
|
|
40
|
-
selected && /* @__PURE__ */ jsx("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)]", children: /* @__PURE__ */ jsx(Check, { size: 11, strokeWidth: 3 }) }),
|
|
41
|
-
icon && /* @__PURE__ */ jsx(
|
|
42
|
-
"span",
|
|
43
|
-
{
|
|
44
|
-
className: [
|
|
45
|
-
"flex size-10 items-center justify-center rounded-(--radius-card) transition-colors [&_svg]:size-5",
|
|
46
|
-
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)]"
|
|
47
|
-
].join(" "),
|
|
48
|
-
children: icon
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
/* @__PURE__ */ jsx(
|
|
52
|
-
"span",
|
|
53
|
-
{
|
|
54
|
-
className: [
|
|
55
|
-
icon ? "text-caption" : "text-label",
|
|
56
|
-
"font-semibold leading-tight",
|
|
57
|
-
selected ? "[color:var(--option-tile-label-active)]" : "[color:var(--option-tile-label)]"
|
|
58
|
-
].join(" "),
|
|
59
|
-
children: label
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
]
|
|
19
|
+
tabIndex,
|
|
20
|
+
className,
|
|
21
|
+
style: fullSpan ? { gridColumn: "1 / -1" } : void 0,
|
|
22
|
+
children: label
|
|
63
23
|
}
|
|
64
24
|
);
|
|
65
25
|
}
|
|
66
26
|
function OptionTileGrid(props) {
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
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
|
+
};
|
|
80
39
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
case "Home":
|
|
103
|
-
e.preventDefault();
|
|
104
|
-
move(0);
|
|
105
|
-
break;
|
|
106
|
-
case "End":
|
|
107
|
-
e.preventDefault();
|
|
108
|
-
move(options.length - 1);
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const grid = /* @__PURE__ */ jsx(
|
|
113
|
-
"div",
|
|
114
|
-
{
|
|
115
|
-
id: groupId,
|
|
116
|
-
role: multiple ? "group" : "radiogroup",
|
|
117
|
-
"aria-label": ariaLabel,
|
|
118
|
-
className: ["grid gap-2", columns === 2 ? "grid-cols-2" : "grid-cols-2 sm:grid-cols-3", label ? "" : className].join(" "),
|
|
119
|
-
children: options.map((opt, i) => {
|
|
120
|
-
const Icon = opt.icon;
|
|
121
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
-
OptionTile,
|
|
123
|
-
{
|
|
124
|
-
multiple,
|
|
125
|
-
selected: isSel(opt.value),
|
|
126
|
-
label: opt.label,
|
|
127
|
-
icon: Icon ? /* @__PURE__ */ jsx(Icon, {}) : void 0,
|
|
128
|
-
fullSpan: opt.fullSpan,
|
|
129
|
-
onClick: () => activate(opt.value),
|
|
130
|
-
tabIndex: multiple ? 0 : i === activeIdx ? 0 : -1,
|
|
131
|
-
onKeyDown: (e) => onKeyDown(e, i),
|
|
132
|
-
buttonRef: (el) => {
|
|
133
|
-
btns.current[i] = el;
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
opt.value
|
|
137
|
-
);
|
|
138
|
-
})
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
if (!label) return grid;
|
|
142
|
-
return /* @__PURE__ */ jsxs("div", { className: ["flex flex-col gap-2", className].join(" "), children: [
|
|
143
|
-
/* @__PURE__ */ jsx("span", { className: "text-label font-medium text-fg-primary", children: label }),
|
|
144
|
-
grid
|
|
145
|
-
] });
|
|
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
|
|
53
|
+
);
|
|
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
|
+
}) });
|
|
146
61
|
}
|
|
147
62
|
export {
|
|
148
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,40 +1,14 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
-
import { jsx
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
wide: "max-w-screen-2xl"
|
|
7
|
-
};
|
|
8
|
-
function PageShell({
|
|
9
|
-
maxWidth = "default",
|
|
10
|
-
padded = true,
|
|
11
|
-
children,
|
|
12
|
-
className = ""
|
|
13
|
-
}) {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
"div",
|
|
16
|
-
{
|
|
17
|
-
className: [
|
|
18
|
-
"mx-auto w-full",
|
|
19
|
-
WIDTH_CLS[maxWidth],
|
|
20
|
-
padded ? "px-4 sm:px-6 lg:px-8 py-6" : "",
|
|
21
|
-
className
|
|
22
|
-
].filter(Boolean).join(" "),
|
|
23
|
-
children
|
|
24
|
-
}
|
|
25
|
-
);
|
|
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 });
|
|
26
6
|
}
|
|
27
|
-
function PageShellHeader({ title, eyebrow, actions, className
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
30
|
-
eyebrow && /* @__PURE__ */ jsx("p", { className: "text-caption font-medium text-fg-muted mb-1", children: eyebrow }),
|
|
31
|
-
/* @__PURE__ */ jsx("h1", { className: "text-heading-md font-semibold text-fg-primary truncate", children: title })
|
|
32
|
-
] }),
|
|
33
|
-
actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: actions })
|
|
34
|
-
] });
|
|
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(" ") });
|
|
35
9
|
}
|
|
36
|
-
function PageShellBody({ children, className
|
|
37
|
-
return /* @__PURE__ */ jsx("div", { className: ["
|
|
10
|
+
function PageShellBody({ children, className }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: ["rds-page-shell__body", className].filter(Boolean).join(" "), children });
|
|
38
12
|
}
|
|
39
13
|
PageShell.Header = PageShellHeader;
|
|
40
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,38 +1,41 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Card } from "./card.js";
|
|
3
4
|
import { Skeleton } from "./skeleton.js";
|
|
4
|
-
function PageSkeleton({ rows = 5, padded = true }) {
|
|
5
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
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 })
|
|
9
11
|
] }),
|
|
10
|
-
/* @__PURE__ */ jsxs("div",
|
|
11
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
12
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
13
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
14
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
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 })
|
|
15
17
|
] }),
|
|
16
|
-
Array.from({ length: rows }
|
|
17
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
18
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
19
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
20
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "
|
|
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" })
|
|
21
23
|
] }, i))
|
|
22
24
|
] })
|
|
23
25
|
] });
|
|
24
26
|
}
|
|
25
|
-
function CardsSkeleton({ count = 4, padded = true }) {
|
|
26
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
31
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
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 })
|
|
32
35
|
] }, i)) }),
|
|
33
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
34
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
35
|
-
/* @__PURE__ */ jsx(Skeleton, {
|
|
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 })
|
|
36
39
|
] }, i)) })
|
|
37
40
|
] });
|
|
38
41
|
}
|
|
@@ -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 };
|