@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,35 +1,27 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* SelectableCard — cartão CLICÁVEL genérico (tile de ação OU escolha).
|
|
6
|
-
*
|
|
7
|
-
* Resolve os "card-as-div" reimplementados como `<button className="rounded-xl border">`:
|
|
8
|
-
* tiles de ação (abrir modal, navegar), cards de escolha, pricing card (com ribbon).
|
|
9
|
-
* Renderiza `<button>` (ação) ou `<a>` (navegação) — semântica correta, foco acessível.
|
|
10
|
-
*
|
|
11
|
-
* Estado `selected` usa destaque NEUTRO (border-focus + surface-raised) — NÃO usa brand,
|
|
12
|
-
* então é seguro no admin (onde cor de marca é proibida) e na vitrine.
|
|
13
|
-
*
|
|
14
|
-
* indicator:
|
|
15
|
-
* 'radio' — bolinha de seleção (escolha exclusiva)
|
|
16
|
-
* 'check' — check quando selecionado (multi-seleção/confirmação)
|
|
17
|
-
* 'chevron' — seta de navegação (tile que leva a outra tela)
|
|
18
|
-
* 'none' — sem indicador (tile de ação puro)
|
|
19
|
-
*/
|
|
4
|
+
/** @deprecated Use ChoiceCardProps. */
|
|
20
5
|
interface SelectableCardProps {
|
|
21
6
|
selected?: boolean;
|
|
22
7
|
onClick?: () => void;
|
|
23
|
-
/**
|
|
8
|
+
/** Ignored: the card is a radio now, never a link. */
|
|
24
9
|
as?: 'button' | 'a';
|
|
10
|
+
/** Ignored: the card is a radio now, never a link. */
|
|
25
11
|
href?: string;
|
|
12
|
+
/** Ignored: the ChoiceCard row always shows its radio. */
|
|
26
13
|
indicator?: 'radio' | 'check' | 'chevron' | 'none';
|
|
27
|
-
/**
|
|
14
|
+
/** Ignored: the ChoiceCard has no ribbon. */
|
|
28
15
|
ribbon?: ReactNode;
|
|
29
16
|
disabled?: boolean;
|
|
30
17
|
className?: string;
|
|
31
18
|
children: ReactNode;
|
|
32
19
|
}
|
|
33
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use ChoiceCard (Figma [RDS] Content/ChoiceCard, layout="row"). A thin wrapper over it: `children`
|
|
22
|
+
* is the label, `onClick` is `onSelect`. It is a native radio now, not a button: `as`, `href`, `indicator` and
|
|
23
|
+
* `ribbon` are ignored, and a chosen card cannot be un-chosen by clicking it again.
|
|
24
|
+
*/
|
|
25
|
+
declare function SelectableCard({ selected, onClick, disabled, className, children }: SelectableCardProps): react.JSX.Element;
|
|
34
26
|
|
|
35
27
|
export { SelectableCard, type SelectableCardProps };
|
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-ORMEWXMH.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
function SelectableCard({
|
|
6
|
-
selected
|
|
7
|
-
onClick,
|
|
8
|
-
as = "button",
|
|
9
|
-
href,
|
|
10
|
-
indicator = "none",
|
|
11
|
-
ribbon,
|
|
12
|
-
disabled = false,
|
|
13
|
-
className = "",
|
|
14
|
-
children
|
|
15
|
-
}) {
|
|
16
|
-
const base = "relative w-full flex items-center gap-4 px-4 py-4 rounded-(--radius-card) border text-left transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus";
|
|
17
|
-
const state = selected ? "border-2 border-stroke-focus bg-surface-raised" : "border border-stroke-default bg-surface-default hover:border-stroke-strong";
|
|
18
|
-
const disabledCls = disabled ? "opacity-50 cursor-not-allowed pointer-events-none" : "cursor-pointer";
|
|
19
|
-
const cls = [base, state, disabledCls, className].filter(Boolean).join(" ");
|
|
20
|
-
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
-
ribbon && /* @__PURE__ */ jsx("span", { className: "absolute -top-3 left-1/2 -translate-x-1/2", children: ribbon }),
|
|
22
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children }),
|
|
23
|
-
indicator === "radio" && /* @__PURE__ */ jsx("span", { className: `shrink-0 size-4 rounded-full border-2 flex items-center justify-center ${selected ? "border-stroke-focus" : "border-stroke-strong"}`, children: selected && /* @__PURE__ */ jsx("span", { className: "size-2 rounded-full bg-stroke-focus" }) }),
|
|
24
|
-
indicator === "check" && selected && /* @__PURE__ */ jsx(Check, { className: "shrink-0 size-4 text-fg-primary", strokeWidth: 2.5 }),
|
|
25
|
-
indicator === "chevron" && /* @__PURE__ */ jsx(ChevronRight, { className: "shrink-0 size-4 text-fg-muted", strokeWidth: 2 })
|
|
26
|
-
] });
|
|
27
|
-
if (as === "a") {
|
|
28
|
-
return /* @__PURE__ */ jsx("a", { href, className: cls, "aria-disabled": disabled || void 0, "aria-current": selected || void 0, children: inner });
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ jsx("button", { type: "button", onClick, disabled, "aria-pressed": selected, className: cls, children: inner });
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { ChoiceCard } from "./choice-card.js";
|
|
5
|
+
function SelectableCard({ selected = false, onClick, disabled, className, children }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(ChoiceCard, { layout: "row", selected, onSelect: onClick, disabled, className, children });
|
|
31
7
|
}
|
|
32
8
|
export {
|
|
33
9
|
SelectableCard
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** horizontal between blocks; vertical between items on the same line. */
|
|
7
|
+
orientation?: SeparatorOrientation;
|
|
8
|
+
/**
|
|
9
|
+
* true (default): only visual, hidden from screen readers.
|
|
10
|
+
* false: it separates sections, announced as role="separator".
|
|
11
|
+
*/
|
|
12
|
+
decorative?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Separator — Figma [RDS] Content/Separator. A thin line between groups of content. Prefer
|
|
16
|
+
* space: use the line only when space alone is not enough. Styles: separator.css.
|
|
17
|
+
*/
|
|
18
|
+
declare function Separator({ orientation, decorative, className, ...rest }: SeparatorProps): react.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { Separator, type SeparatorOrientation, type SeparatorProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function Separator(_a) {
|
|
8
|
+
var _b = _a, { orientation = "horizontal", decorative = true, className } = _b, rest = __objRest(_b, ["orientation", "decorative", "className"]);
|
|
9
|
+
const semantics = decorative ? { role: "none", "aria-hidden": true } : { role: "separator", "aria-orientation": orientation === "vertical" ? "vertical" : void 0 };
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
__spreadProps(__spreadValues(__spreadValues({}, semantics), rest), {
|
|
13
|
+
className: ["rds-separator", `rds-separator--${orientation}`, className].filter(Boolean).join(" ")
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
Separator
|
|
19
|
+
};
|
|
@@ -2,32 +2,28 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* SettingRow —
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* aplicados pelo <SettingsList> que as agrupa — a row nunca desenha a própria borda.
|
|
5
|
+
* SettingRow — deprecated: a thin wrapper over the Item (Figma [RDS] Content/Item), kept because SettingsList is
|
|
6
|
+
* documented as its container and the products still compose it. New code uses Item (`title`, `description`,
|
|
7
|
+
* `media`, `action`).
|
|
9
8
|
*
|
|
10
|
-
* controlWidth
|
|
11
|
-
*
|
|
12
|
-
* 'fill' — input/select que ocupa uma coluna de largura previsível (até ~20rem).
|
|
13
|
-
* 'full' — controle LARGO (fileira de <ChoicePreviewCard>): largura total, sempre abaixo do label.
|
|
14
|
-
*
|
|
15
|
-
* a11y: passe `htmlFor` quando o controle for um input/toggle único — o label vira
|
|
16
|
-
* <label> associado (sem isso, leitores de tela não associam rótulo↔controle).
|
|
9
|
+
* label → title (a <label> when `htmlFor` is given), icon → media, control → action. controlWidth='full' puts the
|
|
10
|
+
* control under the row; 'fill' and `align` no longer change anything.
|
|
17
11
|
*/
|
|
18
12
|
interface SettingRowProps {
|
|
19
13
|
label: ReactNode;
|
|
20
14
|
description?: ReactNode;
|
|
21
|
-
/**
|
|
15
|
+
/** Optional icon before the label. */
|
|
22
16
|
icon?: ReactNode;
|
|
23
|
-
/** id
|
|
17
|
+
/** The control's id: the label becomes a <label for> so screen readers tie them together. */
|
|
24
18
|
htmlFor?: string;
|
|
19
|
+
/** Only 'full' still has an effect: the control goes under the row, across its width. */
|
|
25
20
|
controlWidth?: 'auto' | 'fill' | 'full';
|
|
26
|
-
/**
|
|
21
|
+
/** Kept for compatibility; it no longer changes anything. */
|
|
27
22
|
align?: 'center' | 'start';
|
|
28
23
|
control: ReactNode;
|
|
29
24
|
className?: string;
|
|
30
25
|
}
|
|
31
|
-
|
|
26
|
+
/** @deprecated Use Item. */
|
|
27
|
+
declare function SettingRow({ label, description, icon, htmlFor, controlWidth, control, className }: SettingRowProps): react.JSX.Element;
|
|
32
28
|
|
|
33
29
|
export { SettingRow, type SettingRowProps };
|
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
const cols = controlWidth === "full" ? "" : controlWidth === "fill" ? "sm:grid-cols-[minmax(0,1fr)_minmax(0,20rem)]" : "sm:grid-cols-[1fr_auto]";
|
|
14
|
-
const alignCls = align === "start" ? "sm:items-start" : "sm:items-center";
|
|
15
|
-
const LabelTag = htmlFor ? "label" : "div";
|
|
16
|
-
return /* @__PURE__ */ jsxs("div", { className: ["grid grid-cols-1 gap-x-6 gap-y-3 py-4", cols, alignCls, className].filter(Boolean).join(" "), children: [
|
|
17
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 min-w-0", children: [
|
|
18
|
-
icon && /* @__PURE__ */ jsx("div", { className: "shrink-0 text-fg-muted mt-0.5", children: icon }),
|
|
19
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
20
|
-
/* @__PURE__ */ jsx(LabelTag, { htmlFor, className: "block text-sm font-medium text-fg-primary", children: label }),
|
|
21
|
-
description && /* @__PURE__ */ jsx("div", { className: "text-sm text-fg-muted mt-0.5 leading-snug", children: description })
|
|
22
|
-
] })
|
|
23
|
-
] }),
|
|
24
|
-
/* @__PURE__ */ jsx("div", { className: controlWidth === "auto" ? "sm:justify-self-end" : "", children: control })
|
|
25
|
-
] });
|
|
3
|
+
import { Item } from "./item.js";
|
|
4
|
+
function SettingRow({ label, description, icon, htmlFor, controlWidth = "auto", control, className }) {
|
|
5
|
+
const title = htmlFor ? /* @__PURE__ */ jsx("label", { htmlFor, children: label }) : label;
|
|
6
|
+
if (controlWidth === "full") {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Item, { title, description, media: icon }),
|
|
9
|
+
/* @__PURE__ */ jsx("div", { children: control })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ jsx(Item, { title, description, media: icon, action: control, className });
|
|
26
13
|
}
|
|
27
14
|
export {
|
|
28
15
|
SettingRow
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* SettingsList — agrupa <SettingRow> num bloco com divisores entre elas. Substitui o
|
|
6
|
-
* boilerplate repetido `Card > CardBody noPadding > div.divide-y` espalhado pelas telas.
|
|
7
|
-
*
|
|
8
|
-
* O título do grupo é simples (sem número/eyebrow) — o padrão "Settings" não numera
|
|
9
|
-
* seções (são ajustes paralelos, não etapas). Divisor = `stroke-default` (visível, não o
|
|
10
|
-
* `stroke-subtle` quase invisível do Untitled UI) — acessibilidade > estética de Figma.
|
|
11
|
-
*/
|
|
12
4
|
interface SettingsListProps {
|
|
13
|
-
/**
|
|
5
|
+
/** The group's title (an h2). Leave it out when the group has no header. */
|
|
14
6
|
title?: string;
|
|
15
7
|
description?: string;
|
|
16
|
-
/**
|
|
8
|
+
/** One action on the right of the title (the PageHeader's actions). */
|
|
17
9
|
action?: ReactNode;
|
|
18
|
-
/**
|
|
10
|
+
/** A Card around the rows. Default true; false leaves the rows loose. */
|
|
19
11
|
framed?: boolean;
|
|
12
|
+
/** The rows: Items (or the deprecated SettingRows). */
|
|
20
13
|
children: ReactNode;
|
|
21
14
|
className?: string;
|
|
22
15
|
}
|
|
23
|
-
|
|
16
|
+
/**
|
|
17
|
+
* SettingsList — a composition of the PageHeader (h2), the Card and the Items (Figma [RDS] Content/Item): a group
|
|
18
|
+
* of settings, one per row, a line between rows. Settings are parallel, so the title has no number. Styles:
|
|
19
|
+
* settings-list.css.
|
|
20
|
+
*/
|
|
21
|
+
declare function SettingsList({ title, description, action, framed, children, className }: SettingsListProps): react.JSX.Element;
|
|
24
22
|
|
|
25
23
|
export { SettingsList, type SettingsListProps };
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
className = ""
|
|
11
|
-
}) {
|
|
12
|
-
const list = /* @__PURE__ */ jsx(
|
|
13
|
-
"div",
|
|
14
|
-
{
|
|
15
|
-
className: framed ? "rounded-(--radius-card) border border-stroke-default bg-surface-default px-4 [&>*]:border-t [&>*]:border-stroke-default [&>*:first-child]:border-t-0" : "[&>*]:border-t [&>*]:border-stroke-default [&>*:first-child]:border-t-0",
|
|
16
|
-
children
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
return /* @__PURE__ */ jsxs("section", { className: ["space-y-3", className].filter(Boolean).join(" "), children: [
|
|
20
|
-
title && /* @__PURE__ */ jsx(SectionHeader, { title, description, action }),
|
|
21
|
-
list
|
|
3
|
+
import { Card } from "./card.js";
|
|
4
|
+
import { PageHeader } from "./page-header.js";
|
|
5
|
+
function SettingsList({ title, description, action, framed = true, children, className }) {
|
|
6
|
+
const rows = /* @__PURE__ */ jsx("div", { className: "rds-settings-list__rows", children });
|
|
7
|
+
return /* @__PURE__ */ jsxs("section", { className: ["rds-settings-list", className].filter(Boolean).join(" "), children: [
|
|
8
|
+
title && /* @__PURE__ */ jsx(PageHeader, { titleAs: "h2", title, description, actions: action }),
|
|
9
|
+
framed ? /* @__PURE__ */ jsx(Card, { as: "div", className: "rds-settings-list__frame", children: rows }) : rows
|
|
22
10
|
] });
|
|
23
11
|
}
|
|
24
12
|
export {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as _radix_ui_react_dialog from '@radix-ui/react-dialog';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ModalProps } from './internal/modal.js';
|
|
4
|
+
|
|
5
|
+
type SheetSide = 'right' | 'left';
|
|
6
|
+
interface SheetProps extends ModalProps {
|
|
7
|
+
/** right for details and filters; left for navigation (Figma: `side`). */
|
|
8
|
+
side?: SheetSide;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Sheet — Figma [RDS] Overlays/Sheet. A panel that comes in from the side, over the screen (Radix Dialog):
|
|
12
|
+
* filters, an item's details, a long form. role="dialog", aria-modal, named by the title; the focus stays inside
|
|
13
|
+
* and goes back to what opened it. Escape, the × and a click on the veil close it, and the page behind doesn't
|
|
14
|
+
* scroll. In 1.x this was the Drawer: the Drawer is now the one that comes up from the bottom.
|
|
15
|
+
* Styles: internal/modal.css and sheet.css.
|
|
16
|
+
*/
|
|
17
|
+
declare function Sheet({ side, ...props }: SheetProps): react.JSX.Element;
|
|
18
|
+
/** Wraps an element inside the Sheet that closes it when pressed, with asChild. */
|
|
19
|
+
declare const SheetClose: react.ForwardRefExoticComponent<_radix_ui_react_dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
|
|
21
|
+
export { Sheet, SheetClose, type SheetProps, type SheetSide };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { ModalClose, ModalShell } from "./internal/modal.js";
|
|
8
|
+
function Sheet(_a) {
|
|
9
|
+
var _b = _a, { side = "right" } = _b, props = __objRest(_b, ["side"]);
|
|
10
|
+
return /* @__PURE__ */ jsx(ModalShell, __spreadValues({ prefix: "rds-sheet", modifiers: [`rds-sheet--${side}`] }, props));
|
|
11
|
+
}
|
|
12
|
+
const SheetClose = ModalClose;
|
|
13
|
+
export {
|
|
14
|
+
Sheet,
|
|
15
|
+
SheetClose
|
|
16
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, MouseEventHandler } from 'react';
|
|
3
|
+
|
|
4
|
+
type SidebarTone = 'light' | 'dark';
|
|
5
|
+
type SidebarHeader = 'mark' | 'logo';
|
|
6
|
+
interface SidebarProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
7
|
+
/**
|
|
8
|
+
* mark (default): the brand's square mark and the module's name. logo: the product's official logo, given in
|
|
9
|
+
* `logo`. The DS carries no client logo: both come in through slots.
|
|
10
|
+
*/
|
|
11
|
+
header?: SidebarHeader;
|
|
12
|
+
/** The product's logo, for header="logo" (Figma: `logo`). Give it its accessible name (an <img alt>, an svg title). */
|
|
13
|
+
logo?: ReactNode;
|
|
14
|
+
/** The brand mark, for header="mark". By default a brand Avatar with the module's first letter. */
|
|
15
|
+
mark?: ReactNode;
|
|
16
|
+
/** The module's name beside the mark (Figma: `module`). Collapsed, it stays for screen readers. */
|
|
17
|
+
module?: string;
|
|
18
|
+
/** Who is signed in, at the foot (Figma: `user`). Collapsed, it stays for screen readers. */
|
|
19
|
+
user?: ReactNode;
|
|
20
|
+
/** 64 wide with only the icons, for a tablet; each entry keeps its name and shows it in a Tooltip. */
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* light (default) or dark (colors/primary; the active entry stays the light pill). dark is deprecated in the
|
|
24
|
+
* Figma since 27/09/2026: for the brand colour, put the Sidebar in a brand-mode scope and keep light.
|
|
25
|
+
*/
|
|
26
|
+
tone?: SidebarTone;
|
|
27
|
+
/** The entries (Figma: the `items` slot): SidebarItem, SidebarSection, SidebarSeparator. */
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/** The foot, under the user: usually the "Sair" SidebarItem. */
|
|
30
|
+
footer?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Sidebar — Figma [RDS] Navigation/Sidebar. The product's main navigation, fixed on the left: a <nav> named
|
|
34
|
+
* "Navegação principal" (override with aria-label) with a list; the current entry has aria-current="page".
|
|
35
|
+
* Styles: sidebar.css.
|
|
36
|
+
*/
|
|
37
|
+
declare function Sidebar({ header, logo, mark, module, user, collapsed, tone, children, footer, className, ...rest }: SidebarProps): react.JSX.Element;
|
|
38
|
+
interface SidebarItemProps {
|
|
39
|
+
/**
|
|
40
|
+
* The entry's name (Figma: `label`). Collapsed, it stays as the accessible name and shows in a Tooltip. With
|
|
41
|
+
* `asChild`, a single link element (an `<a>`, a framework `Link`) whose text is the name.
|
|
42
|
+
*/
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
/** The icon (20). Decorative: the name says what the entry is. */
|
|
45
|
+
icon: ReactNode;
|
|
46
|
+
/** A link: where the entry leads. Without `href` nor `asChild`, the entry is a button (Sair). */
|
|
47
|
+
href?: string;
|
|
48
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
49
|
+
/** The current page (Figma: `state=active`): aria-current="page". Only one at a time. */
|
|
50
|
+
active?: boolean;
|
|
51
|
+
/** A number on the right, such as pending items (Figma: `showCount` + `count`). Hidden when collapsed. */
|
|
52
|
+
count?: number | string;
|
|
53
|
+
/** Render the single child element (a framework `Link`) as the entry, with the entry's classes and content. */
|
|
54
|
+
asChild?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** One entry (Figma: .sidebar/item): 44 tall, icon of 20. */
|
|
57
|
+
declare function SidebarItem({ children, icon, href, onClick, active, count, asChild }: SidebarItemProps): react.JSX.Element;
|
|
58
|
+
interface SidebarSectionProps {
|
|
59
|
+
/** The group's name ("Atendimento") (Figma: .sidebar/section `label`). */
|
|
60
|
+
label: string;
|
|
61
|
+
/** The group's SidebarItems. */
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
/** The pending items of the group, shown while it is closed (Figma: `showCount` + `count`). */
|
|
64
|
+
count?: number | string;
|
|
65
|
+
/** Open (controlled). */
|
|
66
|
+
open?: boolean;
|
|
67
|
+
/** Open at first (uncontrolled). Default true. */
|
|
68
|
+
defaultOpen?: boolean;
|
|
69
|
+
onOpenChange?: (open: boolean) => void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A group of entries under a label that opens and closes it (Figma: .sidebar/section): a button with
|
|
73
|
+
* aria-expanded. Collapsed, the label leaves the screen but still names the group, and its entries stay visible.
|
|
74
|
+
*/
|
|
75
|
+
declare function SidebarSection({ label, children, count, open: openProp, defaultOpen, onOpenChange }: SidebarSectionProps): react.JSX.Element;
|
|
76
|
+
/** The line between groups of entries. */
|
|
77
|
+
declare function SidebarSeparator(): react.JSX.Element;
|
|
78
|
+
|
|
79
|
+
export { Sidebar, type SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSection, type SidebarSectionProps, SidebarSeparator, type SidebarTone };
|
|
@@ -0,0 +1,111 @@
|
|
|
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 {
|
|
9
|
+
cloneElement,
|
|
10
|
+
createContext,
|
|
11
|
+
isValidElement,
|
|
12
|
+
useContext,
|
|
13
|
+
useId,
|
|
14
|
+
useState
|
|
15
|
+
} from "react";
|
|
16
|
+
import { Avatar } from "./avatar.js";
|
|
17
|
+
import { ChevronDownIcon } from "./internal/icons.js";
|
|
18
|
+
import { Separator } from "./separator.js";
|
|
19
|
+
import { Tooltip } from "./tooltip.js";
|
|
20
|
+
const SidebarContext = createContext({ collapsed: false });
|
|
21
|
+
function Sidebar(_a) {
|
|
22
|
+
var _b = _a, {
|
|
23
|
+
header = "mark",
|
|
24
|
+
logo,
|
|
25
|
+
mark,
|
|
26
|
+
module,
|
|
27
|
+
user,
|
|
28
|
+
collapsed = false,
|
|
29
|
+
tone = "light",
|
|
30
|
+
children,
|
|
31
|
+
footer,
|
|
32
|
+
className
|
|
33
|
+
} = _b, rest = __objRest(_b, [
|
|
34
|
+
"header",
|
|
35
|
+
"logo",
|
|
36
|
+
"mark",
|
|
37
|
+
"module",
|
|
38
|
+
"user",
|
|
39
|
+
"collapsed",
|
|
40
|
+
"tone",
|
|
41
|
+
"children",
|
|
42
|
+
"footer",
|
|
43
|
+
"className"
|
|
44
|
+
]);
|
|
45
|
+
const hideWhenCollapsed = (on) => collapsed ? "rds-visually-hidden" : on;
|
|
46
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: { collapsed }, children: /* @__PURE__ */ jsxs(
|
|
47
|
+
"nav",
|
|
48
|
+
__spreadProps(__spreadValues({
|
|
49
|
+
"aria-label": "Navega\xE7\xE3o principal"
|
|
50
|
+
}, rest), {
|
|
51
|
+
className: ["rds-sidebar", tone === "dark" && "rds-sidebar--dark", collapsed && "rds-sidebar--collapsed", className].filter(Boolean).join(" "),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "rds-sidebar__header", children: header === "logo" ? /* @__PURE__ */ jsx("span", { className: "rds-sidebar__logo", children: logo }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx("span", { className: "rds-sidebar__mark", "aria-hidden": "true", children: mark != null ? mark : /* @__PURE__ */ jsx(Avatar, { type: "brand", size: "sm", fallbackText: module == null ? void 0 : module.charAt(0).toUpperCase() }) }),
|
|
55
|
+
module && /* @__PURE__ */ jsx("span", { className: hideWhenCollapsed("rds-sidebar__module"), children: module })
|
|
56
|
+
] }) }),
|
|
57
|
+
/* @__PURE__ */ jsx("ul", { className: "rds-sidebar__items", children }),
|
|
58
|
+
(user || footer) && /* @__PURE__ */ jsxs("div", { className: "rds-sidebar__account", children: [
|
|
59
|
+
user && /* @__PURE__ */ jsx("p", { className: hideWhenCollapsed("rds-sidebar__user"), children: user }),
|
|
60
|
+
footer && /* @__PURE__ */ jsx("ul", { className: "rds-sidebar__items", children: footer })
|
|
61
|
+
] })
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
) });
|
|
65
|
+
}
|
|
66
|
+
function SidebarItem({ children, icon, href, onClick, active, count, asChild }) {
|
|
67
|
+
const { collapsed } = useContext(SidebarContext);
|
|
68
|
+
const link = asChild && isValidElement(children) ? children : null;
|
|
69
|
+
const label = link ? link.props.children : children;
|
|
70
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "rds-sidebar__icon", "aria-hidden": "true", children: icon }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { className: collapsed ? "rds-visually-hidden" : "rds-sidebar__label", children: label }),
|
|
73
|
+
count !== void 0 && !collapsed && /* @__PURE__ */ jsx("span", { className: "rds-sidebar__count", children: count })
|
|
74
|
+
] });
|
|
75
|
+
const common = { "aria-current": active ? "page" : void 0, onClick };
|
|
76
|
+
const entry = link ? cloneElement(link, __spreadProps(__spreadValues({}, common), {
|
|
77
|
+
className: ["rds-sidebar__item", link.props.className].filter(Boolean).join(" "),
|
|
78
|
+
children: content
|
|
79
|
+
})) : href ? /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({}, common), { className: "rds-sidebar__item", href, children: content })) : /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues({}, common), { type: "button", className: "rds-sidebar__item", children: content }));
|
|
80
|
+
return /* @__PURE__ */ jsx("li", { children: collapsed ? /* @__PURE__ */ jsx(Tooltip, { text: label, side: "right", children: entry }) : entry });
|
|
81
|
+
}
|
|
82
|
+
function SidebarSection({ label, children, count, open: openProp, defaultOpen = true, onOpenChange }) {
|
|
83
|
+
const { collapsed } = useContext(SidebarContext);
|
|
84
|
+
const [openState, setOpenState] = useState(defaultOpen);
|
|
85
|
+
const open = openProp != null ? openProp : openState;
|
|
86
|
+
const id = useId();
|
|
87
|
+
const toggle = () => {
|
|
88
|
+
setOpenState(!open);
|
|
89
|
+
onOpenChange == null ? void 0 : onOpenChange(!open);
|
|
90
|
+
};
|
|
91
|
+
if (collapsed) {
|
|
92
|
+
return /* @__PURE__ */ jsx("li", { className: "rds-sidebar__section", children: /* @__PURE__ */ jsx("ul", { className: "rds-sidebar__items", "aria-label": label, children }) });
|
|
93
|
+
}
|
|
94
|
+
return /* @__PURE__ */ jsxs("li", { className: "rds-sidebar__section", children: [
|
|
95
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: "rds-sidebar__section-toggle", "aria-expanded": open, "aria-controls": id, onClick: toggle, children: [
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "rds-sidebar__section-label", children: label }),
|
|
97
|
+
count !== void 0 && !open && /* @__PURE__ */ jsx("span", { className: "rds-sidebar__section-count", children: count }),
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: "rds-sidebar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsx("ul", { id, className: "rds-sidebar__items", hidden: !open, children })
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
function SidebarSeparator() {
|
|
104
|
+
return /* @__PURE__ */ jsx("li", { className: "rds-sidebar__separator", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Separator, {}) });
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
Sidebar,
|
|
108
|
+
SidebarItem,
|
|
109
|
+
SidebarSection,
|
|
110
|
+
SidebarSeparator
|
|
111
|
+
};
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, CSSProperties } from 'react';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly line: "h-3 w-full";
|
|
11
|
-
};
|
|
12
|
-
type SkeletonVariant = keyof typeof SKELETON_VARIANTS;
|
|
13
|
-
interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
-
variant?: SkeletonVariant;
|
|
15
|
-
/** Renderiza N skeletons stackados (útil pra simular lista). */
|
|
16
|
-
count?: number;
|
|
17
|
-
/** Gap entre skeletons quando count > 1. default = 'sm'. */
|
|
18
|
-
gap?: 'sm' | 'md' | 'lg';
|
|
19
|
-
/** Sem animação pulse (placeholder estático). */
|
|
20
|
-
noPulse?: boolean;
|
|
4
|
+
type SkeletonShape = 'line' | 'circle' | 'rect';
|
|
5
|
+
interface SkeletonProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6
|
+
/** line for text (16 tall), circle for an avatar (40), rect for an image or a card (120 tall). */
|
|
7
|
+
shape?: SkeletonShape;
|
|
8
|
+
/** The size of what is coming (a number is px). line and rect fill the width by default. */
|
|
9
|
+
width?: CSSProperties['width'];
|
|
10
|
+
height?: CSSProperties['height'];
|
|
21
11
|
}
|
|
22
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Skeleton — Figma [RDS] Content/Skeleton. The place of content while it loads. Always aria-hidden: put
|
|
14
|
+
* aria-busy="true" on the loading region and a "Carregando…" text only for screen readers. Styles: skeleton.css.
|
|
15
|
+
*/
|
|
16
|
+
declare function Skeleton({ shape, width, height, className, style, ...rest }: SkeletonProps): react.JSX.Element;
|
|
23
17
|
|
|
24
|
-
export { Skeleton, type SkeletonProps, type
|
|
18
|
+
export { Skeleton, type SkeletonProps, type SkeletonShape };
|
|
@@ -4,46 +4,17 @@ import {
|
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../chunk-ORMEWXMH.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
const SKELETON_VARIANTS = {
|
|
8
|
-
text: "h-4 w-full",
|
|
9
|
-
title: "h-6 w-3/5",
|
|
10
|
-
avatar: "size-10 rounded-full",
|
|
11
|
-
circle: "size-12 rounded-full",
|
|
12
|
-
button: "h-10 w-24 rounded-(--radius-card)",
|
|
13
|
-
card: "h-32 w-full rounded-(--radius-card)",
|
|
14
|
-
line: "h-3 w-full"
|
|
15
|
-
};
|
|
16
|
-
const GAP = { sm: "gap-2", md: "gap-3", lg: "gap-4" };
|
|
17
7
|
function Skeleton(_a) {
|
|
18
|
-
var _b = _a, {
|
|
19
|
-
|
|
20
|
-
count = 1,
|
|
21
|
-
gap = "sm",
|
|
22
|
-
noPulse = false,
|
|
23
|
-
className = ""
|
|
24
|
-
} = _b, props = __objRest(_b, [
|
|
25
|
-
"variant",
|
|
26
|
-
"count",
|
|
27
|
-
"gap",
|
|
28
|
-
"noPulse",
|
|
29
|
-
"className"
|
|
30
|
-
]);
|
|
31
|
-
const classes = [
|
|
32
|
-
noPulse ? "" : "animate-pulse",
|
|
33
|
-
"rounded bg-stroke-default/50",
|
|
34
|
-
SKELETON_VARIANTS[variant],
|
|
35
|
-
className
|
|
36
|
-
].filter(Boolean).join(" ");
|
|
37
|
-
if (count === 1) return /* @__PURE__ */ jsx("div", __spreadValues({ className: classes }, props));
|
|
38
|
-
return /* @__PURE__ */ jsx("div", { className: ["flex flex-col", GAP[gap]].join(" "), children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx(
|
|
8
|
+
var _b = _a, { shape = "line", width, height, className, style } = _b, rest = __objRest(_b, ["shape", "width", "height", "className", "style"]);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
39
10
|
"div",
|
|
40
11
|
__spreadProps(__spreadValues({
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}, rest), {
|
|
14
|
+
className: ["rds-skeleton", `rds-skeleton--${shape}`, className].filter(Boolean).join(" "),
|
|
15
|
+
style: __spreadValues({ width, height }, style)
|
|
16
|
+
})
|
|
17
|
+
);
|
|
47
18
|
}
|
|
48
19
|
export {
|
|
49
20
|
Skeleton
|