@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { GoogleAccountChip, GoogleActions, GoogleAppLine, GoogleField, GoogleScreen } from "./internal/google.js";
|
|
4
|
+
function GoogleSignIn({
|
|
5
|
+
title,
|
|
6
|
+
appName = "Roj\xE3o",
|
|
7
|
+
layout = "m3",
|
|
8
|
+
step = "email",
|
|
9
|
+
email = "ana@exemplo.com",
|
|
10
|
+
className
|
|
11
|
+
}) {
|
|
12
|
+
const password = step === "password";
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
GoogleScreen,
|
|
15
|
+
{
|
|
16
|
+
layout,
|
|
17
|
+
label: "Mockup: login com o Google",
|
|
18
|
+
title: title != null ? title : password ? "Boas-vindas" : "Fa\xE7a login",
|
|
19
|
+
intro: password ? /* @__PURE__ */ jsx(GoogleAccountChip, { email }) : /* @__PURE__ */ jsx(GoogleAppLine, { lead: "Prosseguir para", appName }),
|
|
20
|
+
className: ["rds-google-sign-in", className].filter(Boolean).join(" "),
|
|
21
|
+
children: password ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(GoogleField, { label: "Digite sua senha" }),
|
|
23
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__checkbox rds-google-sign-in__show", children: "Mostrar senha" }),
|
|
24
|
+
/* @__PURE__ */ jsx(GoogleActions, { secondary: "Esqueceu a senha?", primary: "Avan\xE7ar" })
|
|
25
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
+
/* @__PURE__ */ jsx(GoogleField, { label: "E-mail ou telefone", state: layout === "oauth" ? "focus" : "default" }),
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "rds-google__link rds-google-sign-in__forgot", children: "Esqueceu o e-mail?" }),
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "rds-google__text rds-google-sign-in__notice", children: layout === "m3" ? "N\xE3o est\xE1 no seu computador? Use uma janela de navega\xE7\xE3o privada para fazer login." : `Consulte a Pol\xEDtica de Privacidade e os Termos de Servi\xE7o do app ${appName} antes de us\xE1-lo.` }),
|
|
29
|
+
/* @__PURE__ */ jsx(GoogleActions, { secondary: "Criar conta", primary: "Avan\xE7ar" })
|
|
30
|
+
] })
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
GoogleSignIn
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactElement, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface HoverCardProps {
|
|
5
|
+
/** The link it opens from: an <a href> to the full page. The card only repeats what is there. */
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
/** Who or what it is (Figma: `title`). */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** What it does (Figma: `description`). */
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** An Avatar (Figma: `showAvatar` + the avatar). */
|
|
12
|
+
avatar?: ReactNode;
|
|
13
|
+
/** One short fact, such as the city, after a pin (Figma: `showMeta` + `meta`). */
|
|
14
|
+
meta?: ReactNode;
|
|
15
|
+
/** ms still before opening, so it does not flash while the mouse crosses the screen. */
|
|
16
|
+
openDelay?: number;
|
|
17
|
+
/** ms after the mouse leaves; it stays open while the mouse is over it. */
|
|
18
|
+
closeDelay?: number;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* HoverCard — Figma [RDS] Feedback/HoverCard. A preview on hovering or focusing a link: who it is, before clicking
|
|
25
|
+
* (Radix HoverCard). Never the only way to the information: on touch it does not open. No buttons inside: that is
|
|
26
|
+
* the Popover. Styles: hover-card.css.
|
|
27
|
+
*/
|
|
28
|
+
declare function HoverCard({ children, title, description, avatar, meta, openDelay, closeDelay, open, defaultOpen, onOpenChange, }: HoverCardProps): react.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { HoverCard, type HoverCardProps };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-ORMEWXMH.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
5
|
+
import { MapPinIcon } from "./internal/icons.js";
|
|
6
|
+
function HoverCard({
|
|
7
|
+
children,
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
avatar,
|
|
11
|
+
meta,
|
|
12
|
+
openDelay = 500,
|
|
13
|
+
closeDelay = 300,
|
|
14
|
+
open,
|
|
15
|
+
defaultOpen,
|
|
16
|
+
onOpenChange
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
HoverCardPrimitive.Root,
|
|
20
|
+
{
|
|
21
|
+
openDelay,
|
|
22
|
+
closeDelay,
|
|
23
|
+
open,
|
|
24
|
+
defaultOpen,
|
|
25
|
+
onOpenChange,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { asChild: true, children }),
|
|
28
|
+
/* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
29
|
+
HoverCardPrimitive.Content,
|
|
30
|
+
{
|
|
31
|
+
side: "bottom",
|
|
32
|
+
align: "start",
|
|
33
|
+
sideOffset: 8,
|
|
34
|
+
collisionPadding: 16,
|
|
35
|
+
className: "rds-hover-card",
|
|
36
|
+
children: [
|
|
37
|
+
avatar && /* @__PURE__ */ jsx("span", { className: "rds-hover-card__avatar", children: avatar }),
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-hover-card__content", children: [
|
|
39
|
+
/* @__PURE__ */ jsx("p", { className: "rds-hover-card__title", children: title }),
|
|
40
|
+
description && /* @__PURE__ */ jsx("p", { className: "rds-hover-card__description", children: description }),
|
|
41
|
+
meta && /* @__PURE__ */ jsxs("p", { className: "rds-hover-card__meta", children: [
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "rds-hover-card__meta-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(MapPinIcon, {}) }),
|
|
43
|
+
meta
|
|
44
|
+
] })
|
|
45
|
+
] })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
) })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
HoverCard
|
|
55
|
+
};
|
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
+
import { ButtonTone, ButtonVariant, ButtonSize } from './internal/button.js';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type IconButtonSize = 'sm' | 'md' | 'lg';
|
|
7
|
-
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
5
|
+
interface IconButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'children'> {
|
|
6
|
+
/** The only content of the button (Figma: `iconName`). */
|
|
8
7
|
icon: ReactNode;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
/** Required: the name a screen reader announces ("Fechar", "Mostrar senha"). Rendered as aria-label. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Same tones as the Button. */
|
|
11
|
+
tone?: ButtonTone;
|
|
12
|
+
/** Figma calls this property `style`. */
|
|
13
|
+
variant?: ButtonVariant;
|
|
14
|
+
/**
|
|
15
|
+
* The size of the square (Figma: `size`): sm 36 with a 16 icon, md 44 with a 20 icon (default), lg 52 with a 24
|
|
16
|
+
* icon. The touch target is 44 × 44 in every size: on sm, an invisible layer extends it under a coarse pointer.
|
|
17
|
+
*/
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
/** Rendered as aria-disabled="true", as in the Button. */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Render the single child element (an empty `<a>`, a framework `Link`) with the button's classes. */
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
/** Waiting for what the click started (Figma: `loading`): the icon gives way to a turning loader. */
|
|
13
24
|
loading?: boolean;
|
|
25
|
+
/** What is being waited for, announced while loading. */
|
|
26
|
+
loadingLabel?: string;
|
|
27
|
+
/** Only with `asChild`: the link element; the icon is placed inside it. */
|
|
28
|
+
children?: ReactNode;
|
|
14
29
|
}
|
|
15
|
-
|
|
30
|
+
/**
|
|
31
|
+
* IconButton — Figma [RDS] Actions/IconButton. A square of 36, 44 (default) or 52, same tones, sizes and tokens as
|
|
32
|
+
* the Button.
|
|
33
|
+
*
|
|
34
|
+
* The icon alone does not say what the button does: always pair it with a Tooltip carrying the same text as `label`,
|
|
35
|
+
* shown on hover and on keyboard focus. They are two components (no tooltip inside this one), always together:
|
|
36
|
+
*
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Tooltip text="Novo cliente">
|
|
39
|
+
* <IconButton icon={<PlusIcon />} label="Novo cliente" />
|
|
40
|
+
* </Tooltip>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Every IconButton the design system renders itself (closes, arrows, "Mais ações") already comes with its Tooltip.
|
|
44
|
+
*/
|
|
45
|
+
declare function IconButton({ icon, label, tone, variant, size, disabled, loading, loadingLabel, asChild, type, className, onClick, children, ...rest }: IconButtonProps): react.JSX.Element;
|
|
16
46
|
|
|
17
|
-
export { IconButton, type
|
|
47
|
+
export { IconButton, type IconButtonProps };
|
|
@@ -1,85 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
__objRest,
|
|
3
4
|
__spreadProps,
|
|
4
5
|
__spreadValues
|
|
5
6
|
} from "../chunk-ORMEWXMH.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
primary: "bg-brand-primary text-brand-on-primary hover:bg-brand-hover",
|
|
16
|
-
secondary: "bg-surface-raised text-fg-primary hover:opacity-90",
|
|
17
|
-
danger: "bg-danger text-fg-inverse hover:bg-danger-text",
|
|
18
|
-
neutral: "bg-surface-raised text-fg-primary hover:bg-stroke-default"
|
|
19
|
-
},
|
|
20
|
-
outline: {
|
|
21
|
-
primary: "border border-brand-primary text-brand-primary hover:bg-surface-raised",
|
|
22
|
-
secondary: "border border-stroke-default text-fg-secondary hover:bg-surface-raised",
|
|
23
|
-
danger: "border border-danger text-danger-text hover:bg-danger-soft",
|
|
24
|
-
neutral: "border border-stroke-default text-fg-secondary hover:bg-surface-raised"
|
|
25
|
-
},
|
|
26
|
-
ghost: {
|
|
27
|
-
primary: "text-brand-primary hover:bg-surface-raised",
|
|
28
|
-
secondary: "text-fg-secondary hover:bg-surface-raised",
|
|
29
|
-
danger: "text-danger-text hover:bg-danger-soft",
|
|
30
|
-
neutral: "text-fg-muted hover:bg-surface-raised hover:text-fg-primary"
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const IconButton = forwardRef(function IconButton2(_a, ref) {
|
|
8
|
+
import { Slot, Slottable } from "@radix-ui/react-slot";
|
|
9
|
+
import {
|
|
10
|
+
blockWhenDisabled,
|
|
11
|
+
buttonClassName,
|
|
12
|
+
Loader,
|
|
13
|
+
useLoadingAnnouncement
|
|
14
|
+
} from "./internal/button.js";
|
|
15
|
+
function IconButton(_a) {
|
|
34
16
|
var _b = _a, {
|
|
35
17
|
icon,
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
label,
|
|
19
|
+
tone = "action",
|
|
20
|
+
variant = "fill",
|
|
38
21
|
size = "md",
|
|
39
|
-
loading = false,
|
|
40
22
|
disabled,
|
|
41
|
-
|
|
23
|
+
loading,
|
|
24
|
+
loadingLabel = "Carregando\u2026",
|
|
25
|
+
asChild,
|
|
26
|
+
type = "button",
|
|
27
|
+
className,
|
|
28
|
+
onClick,
|
|
29
|
+
children
|
|
42
30
|
} = _b, rest = __objRest(_b, [
|
|
43
31
|
"icon",
|
|
32
|
+
"label",
|
|
33
|
+
"tone",
|
|
44
34
|
"variant",
|
|
45
|
-
"color",
|
|
46
35
|
"size",
|
|
47
|
-
"loading",
|
|
48
36
|
"disabled",
|
|
49
|
-
"
|
|
37
|
+
"loading",
|
|
38
|
+
"loadingLabel",
|
|
39
|
+
"asChild",
|
|
40
|
+
"type",
|
|
41
|
+
"className",
|
|
42
|
+
"onClick",
|
|
43
|
+
"children"
|
|
50
44
|
]);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
const Root = asChild ? Slot : "button";
|
|
46
|
+
const iconNode = /* @__PURE__ */ jsx("span", { className: loading ? "rds-button__icon rds-button__loader" : "rds-button__icon", "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsx(Loader, {}) : icon });
|
|
47
|
+
useLoadingAnnouncement(loading, loadingLabel);
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
Root,
|
|
50
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
51
|
+
type: asChild ? void 0 : type,
|
|
52
|
+
"aria-label": label,
|
|
53
|
+
className: buttonClassName(tone, variant, size, ["rds-button--icon-only", className].filter(Boolean).join(" ")),
|
|
54
|
+
"aria-disabled": disabled || void 0,
|
|
55
|
+
"aria-busy": loading || void 0,
|
|
56
|
+
onClick: blockWhenDisabled(disabled || loading, onClick),
|
|
57
|
+
children: [
|
|
58
|
+
asChild ? /* @__PURE__ */ jsx(Slottable, { children }) : iconNode,
|
|
59
|
+
asChild && iconNode
|
|
60
|
+
]
|
|
67
61
|
})
|
|
68
62
|
);
|
|
69
|
-
});
|
|
70
|
-
function Spinner() {
|
|
71
|
-
return /* @__PURE__ */ jsxs("svg", { className: "animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
|
|
72
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2.5", opacity: "0.25" }),
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
"path",
|
|
75
|
-
{
|
|
76
|
-
d: "M22 12a10 10 0 0 1-10 10",
|
|
77
|
-
stroke: "currentColor",
|
|
78
|
-
strokeWidth: "2.5",
|
|
79
|
-
strokeLinecap: "round"
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
] });
|
|
83
63
|
}
|
|
84
64
|
export {
|
|
85
65
|
IconButton
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* ImageCropModal —
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* ImageCropModal — a composition of the Dialog, a ToggleGroup (the aspect presets), the Alert (an aspect out of
|
|
5
|
+
* bounds) and the Spinner: crops an image before upload. Needs `react-image-crop` (an optional peer, needed only
|
|
6
|
+
* here). Styles: image-crop-modal.css.
|
|
7
7
|
*
|
|
8
8
|
* Uso:
|
|
9
9
|
* <ImageCropModal
|
|
@@ -4,17 +4,19 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import ReactCrop, { centerCrop } from "react-image-crop";
|
|
6
6
|
import "react-image-crop/dist/ReactCrop.css";
|
|
7
|
-
import {
|
|
8
|
-
import { Spinner } from "./spinner.js";
|
|
7
|
+
import { Alert } from "./alert.js";
|
|
9
8
|
import { Button } from "./button.js";
|
|
9
|
+
import { Dialog } from "./dialog.js";
|
|
10
|
+
import { Spinner } from "./spinner.js";
|
|
11
|
+
import { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
|
|
10
12
|
function RatioIcon({ w, h }) {
|
|
11
13
|
const box = 16;
|
|
12
14
|
const rw = w >= h ? box : w / h * box;
|
|
13
15
|
const rh = h >= w ? box : h / w * box;
|
|
14
|
-
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true,
|
|
16
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("rect", { x: (18 - rw) / 2, y: (18 - rh) / 2, width: rw, height: rh, rx: "1.5", stroke: "currentColor", strokeWidth: "1.6" }) });
|
|
15
17
|
}
|
|
16
18
|
function FreeIcon() {
|
|
17
|
-
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true,
|
|
19
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 18 18", fill: "none", "aria-hidden": true, children: /* @__PURE__ */ jsx("rect", { x: "2.5", y: "2.5", width: "13", height: "13", rx: "1.5", stroke: "currentColor", strokeWidth: "1.6", strokeDasharray: "2.5 2.2" }) });
|
|
18
20
|
}
|
|
19
21
|
const DEFAULT_PRESETS = [
|
|
20
22
|
{ id: "square", label: "1:1", aspect: 1, icon: /* @__PURE__ */ jsx(RatioIcon, { w: 1, h: 1 }) },
|
|
@@ -187,34 +189,34 @@ function ImageCropModal({
|
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
return /* @__PURE__ */ jsx(
|
|
190
|
-
|
|
192
|
+
Dialog,
|
|
191
193
|
{
|
|
192
194
|
open,
|
|
193
|
-
|
|
195
|
+
onOpenChange: (next) => {
|
|
196
|
+
if (!next) onCancel();
|
|
197
|
+
},
|
|
194
198
|
size: "lg",
|
|
195
199
|
title: position ? `${title} \xB7 ${position}` : title,
|
|
196
200
|
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onCancel, children: "Cancelar" }),
|
|
201
|
+
/* @__PURE__ */ jsx(Button, { tone: "neutral", variant: "ghost", onClick: onCancel, children: "Cancelar" }),
|
|
198
202
|
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, disabled: busy || !completedCrop || !!aspectError, loading: busy, children: busy ? "Aplicando\u2026" : confirmLabel })
|
|
199
203
|
] }),
|
|
200
|
-
children: /* @__PURE__ */ jsxs("div", { className: "
|
|
201
|
-
presets.length > 1 && /* @__PURE__ */ jsx(
|
|
202
|
-
|
|
204
|
+
children: /* @__PURE__ */ jsxs("div", { className: "rds-image-crop", children: [
|
|
205
|
+
presets.length > 1 && /* @__PURE__ */ jsx(
|
|
206
|
+
ToggleGroup,
|
|
203
207
|
{
|
|
204
|
-
type: "
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)) }),
|
|
217
|
-
/* @__PURE__ */ jsxs("div", { className: "relative rounded-(--radius-control) bg-surface-overlay overflow-hidden flex items-center justify-center min-h-[300px] max-h-[60vh] p-4", children: [
|
|
208
|
+
type: "single",
|
|
209
|
+
"aria-label": "Propor\xE7\xE3o",
|
|
210
|
+
value: preset.id,
|
|
211
|
+
onValueChange: (id) => {
|
|
212
|
+
const next = presets.find((p) => p.id === id);
|
|
213
|
+
if (next) applyPreset(next);
|
|
214
|
+
},
|
|
215
|
+
className: "rds-image-crop__presets",
|
|
216
|
+
children: presets.map((p) => /* @__PURE__ */ jsx(ToggleGroupItem, { value: p.id, icon: p.icon, children: p.label }, p.id))
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-image-crop__stage", children: [
|
|
218
220
|
src && /* @__PURE__ */ jsx(
|
|
219
221
|
ReactCrop,
|
|
220
222
|
{
|
|
@@ -228,24 +230,15 @@ function ImageCropModal({
|
|
|
228
230
|
keepSelection: true,
|
|
229
231
|
minWidth: 50,
|
|
230
232
|
minHeight: 50,
|
|
231
|
-
className: "
|
|
232
|
-
children: /* @__PURE__ */ jsx(
|
|
233
|
-
"img",
|
|
234
|
-
{
|
|
235
|
-
ref: imgRef,
|
|
236
|
-
src,
|
|
237
|
-
alt: "",
|
|
238
|
-
onLoad: handleImageLoad,
|
|
239
|
-
className: "max-h-full max-w-full"
|
|
240
|
-
}
|
|
241
|
-
)
|
|
233
|
+
className: "rds-image-crop__crop",
|
|
234
|
+
children: /* @__PURE__ */ jsx("img", { ref: imgRef, src, alt: "", onLoad: handleImageLoad, className: "rds-image-crop__image" })
|
|
242
235
|
}
|
|
243
236
|
),
|
|
244
|
-
!imgLoaded && /* @__PURE__ */ jsx("div", { className: "
|
|
245
|
-
busy && /* @__PURE__ */ jsx("div", { className: "
|
|
237
|
+
!imgLoaded && /* @__PURE__ */ jsx("div", { className: "rds-image-crop__layer", children: /* @__PURE__ */ jsx(Spinner, { size: "lg", label: "Carregando imagem\u2026" }) }),
|
|
238
|
+
busy && /* @__PURE__ */ jsx("div", { className: "rds-image-crop__layer rds-image-crop__layer--busy", children: /* @__PURE__ */ jsx(Spinner, { size: "lg", tone: "inverse", label: "Enviando\u2026" }) })
|
|
246
239
|
] }),
|
|
247
|
-
aspectError && /* @__PURE__ */ jsx(
|
|
248
|
-
!aspectError && preset.id === "free" && /* @__PURE__ */ jsxs("p", { className: "
|
|
240
|
+
aspectError && /* @__PURE__ */ jsx(Alert, { tone: "danger", title: aspectError, announce: "alert" }),
|
|
241
|
+
!aspectError && preset.id === "free" && /* @__PURE__ */ jsxs("p", { className: "rds-image-crop__hint", children: [
|
|
249
242
|
"Livre: propor\xE7\xE3o entre ",
|
|
250
243
|
minAspect.toFixed(1),
|
|
251
244
|
" (vertical) e ",
|
|
@@ -2,44 +2,32 @@ import * as react from 'react';
|
|
|
2
2
|
import { CropPreset } from './image-crop-modal.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* variant="dropzone" → zona de drop grande com drag & drop (upload é o herói: banner, galeria)
|
|
9
|
-
* variant="tile" → tile COMPACTO auto-contido (ativo único e pequeno: logo, avatar). O
|
|
10
|
-
* próprio tile é o alvo de clique/drop; quando preenchido, vira o preview
|
|
11
|
-
* com botões-ícone de trocar/remover no canto (sem fileira de controles
|
|
12
|
-
* separada, sem largura full). Todos os estados no mesmo footprint.
|
|
13
|
-
*
|
|
14
|
-
* Textos são i18n-áveis via `labels` (defaults pt-BR preservam o comportamento atual).
|
|
15
|
-
*
|
|
16
|
-
* Uso:
|
|
17
|
-
* <ImageUpload name="logo" value={url} onChange={setUrl}
|
|
18
|
-
* onUpload={async (file) => { ... return url; }} variant="tile" aspect="logo" />
|
|
5
|
+
* @deprecated Use `<FileInput variant="tile">` (Figma [RDS] Forms/FileInput): the image's square with the preview
|
|
6
|
+
* and the swap and remove buttons. ImageUpload is now a thin wrapper over it that keeps the 1.x API compiling and
|
|
7
|
+
* keeps the upload (`onUpload`) and the crop (`crop`). Every variant renders the tile: an image asks for a preview.
|
|
19
8
|
*/
|
|
20
9
|
type ImageUploadAspect = 'logo' | 'banner' | 'square';
|
|
21
10
|
type ImageUploadVariant = 'button' | 'dropzone' | 'tile';
|
|
22
11
|
interface ImageUploadLabels {
|
|
23
|
-
/**
|
|
12
|
+
/** The empty tile's text (FileInput's `tileText`). */
|
|
24
13
|
select: string;
|
|
25
|
-
/**
|
|
14
|
+
/** The swap button's name. */
|
|
26
15
|
change: string;
|
|
27
|
-
/**
|
|
16
|
+
/** The remove button's name. */
|
|
28
17
|
remove: string;
|
|
29
|
-
/**
|
|
18
|
+
/** The tile's text while uploading. */
|
|
30
19
|
uploading: string;
|
|
31
|
-
/**
|
|
20
|
+
/** @deprecated Not shown: the tile has no title. */
|
|
32
21
|
dropTitle: string;
|
|
33
|
-
/**
|
|
22
|
+
/** @deprecated Not shown: say the formats in `hint`. */
|
|
34
23
|
dropHint: string;
|
|
35
|
-
/**
|
|
24
|
+
/** The field's name when there is no `label`. */
|
|
36
25
|
aria: string;
|
|
37
|
-
/**
|
|
26
|
+
/** The error message when the upload fails without one. */
|
|
38
27
|
error: string;
|
|
39
28
|
}
|
|
40
|
-
/**
|
|
29
|
+
/** When given, the chosen image goes through the ImageCropModal before the upload. */
|
|
41
30
|
interface ImageUploadCrop {
|
|
42
|
-
/** Presets de proporção. 1 só preset (ex.: 'free') = recorte livre, sem barra de presets. */
|
|
43
31
|
presets?: CropPreset[];
|
|
44
32
|
minAspect?: number;
|
|
45
33
|
maxAspect?: number;
|
|
@@ -48,25 +36,29 @@ interface ImageUploadCrop {
|
|
|
48
36
|
confirmLabel?: string;
|
|
49
37
|
}
|
|
50
38
|
interface ImageUploadProps {
|
|
51
|
-
/**
|
|
39
|
+
/** @deprecated Ignored: the tile's preview fills the square. */
|
|
52
40
|
previewClassName?: string;
|
|
53
|
-
/**
|
|
41
|
+
/** @deprecated Ignored. */
|
|
54
42
|
previewWrapperClassName?: string;
|
|
43
|
+
/** The form field name: a hidden input carries the image's URL. */
|
|
55
44
|
name: string;
|
|
45
|
+
/** The image's URL, '' for none. */
|
|
56
46
|
value: string;
|
|
57
47
|
onChange: (url: string) => void;
|
|
48
|
+
/** Sends the file and resolves to its URL. A rejection shows its message as the error. */
|
|
58
49
|
onUpload: (file: File) => Promise<string>;
|
|
59
50
|
label?: string;
|
|
60
51
|
hint?: string;
|
|
52
|
+
/** @deprecated Ignored: the tile is a 112 square. */
|
|
61
53
|
aspect?: ImageUploadAspect;
|
|
62
54
|
accept?: string;
|
|
63
55
|
className?: string;
|
|
56
|
+
/** @deprecated Ignored: every variant is the tile. */
|
|
64
57
|
variant?: ImageUploadVariant;
|
|
65
|
-
/** Quando definido, abre o crop (ImageCropModal) entre selecionar o arquivo e subir. */
|
|
66
58
|
crop?: ImageUploadCrop;
|
|
67
|
-
/** Textos exibidos — mescla com os defaults pt-BR (passe só o que quiser sobrescrever). */
|
|
68
59
|
labels?: Partial<ImageUploadLabels>;
|
|
69
60
|
}
|
|
70
|
-
|
|
61
|
+
/** @deprecated Use `<FileInput variant="tile">`, with the upload in its `onFiles` and the URL in `preview`. */
|
|
62
|
+
declare function ImageUpload({ name, value, onChange, onUpload, label, hint, accept, className, crop, labels, }: ImageUploadProps): react.JSX.Element;
|
|
71
63
|
|
|
72
64
|
export { ImageUpload, type ImageUploadAspect, type ImageUploadCrop, type ImageUploadLabels, type ImageUploadProps, type ImageUploadVariant };
|