@rojaostudio/ds 1.0.2 → 2.0.0-next.1
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 -52
- package/dist/components/index.js +190 -74
- 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
package/dist/components/index.js
CHANGED
|
@@ -1,34 +1,59 @@
|
|
|
1
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
2
|
import { Alert } from "./alert.js";
|
|
3
|
+
import { AlertDialog } from "./alert-dialog.js";
|
|
4
|
+
import { HoverCard } from "./hover-card.js";
|
|
5
|
+
import { Dialog, DialogClose } from "./dialog.js";
|
|
6
|
+
import { Sheet, SheetClose } from "./sheet.js";
|
|
7
|
+
import { Drawer, DrawerClose } from "./drawer.js";
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenu,
|
|
10
|
+
DropdownMenuItem,
|
|
11
|
+
DropdownMenuRadioGroup,
|
|
12
|
+
DropdownMenuRadioItem,
|
|
13
|
+
DropdownMenuSeparator
|
|
14
|
+
} from "./dropdown-menu.js";
|
|
15
|
+
import { ContextMenu, ContextMenuItem, ContextMenuSeparator } from "./context-menu.js";
|
|
16
|
+
import { Command, CommandGroup, CommandItem } from "./command.js";
|
|
3
17
|
import { FilterChip, FilterChipGroup } from "./filter-chip.js";
|
|
4
18
|
import { DataTableHeader, FilterDropdown } from "./data-table-header.js";
|
|
5
|
-
import { Button
|
|
6
|
-
import { Badge } from "./badge.js";
|
|
7
|
-
import {
|
|
19
|
+
import { Button } from "./button.js";
|
|
20
|
+
import { Badge, formatBadgeValue } from "./badge.js";
|
|
21
|
+
import { Status } from "./status.js";
|
|
22
|
+
import { Delta } from "./delta.js";
|
|
23
|
+
import { Progress } from "./progress.js";
|
|
24
|
+
import { StarRating } from "./star-rating.js";
|
|
25
|
+
import { Card, CardHeader, CardContent, CardFooter } from "./card.js";
|
|
26
|
+
import { Tile } from "./tile.js";
|
|
27
|
+
import { Kbd, KbdGroup } from "./kbd.js";
|
|
28
|
+
import { Sparkline } from "./sparkline.js";
|
|
29
|
+
import { Chart } from "./chart.js";
|
|
30
|
+
import { Carousel, CarouselPlaceholder } from "./carousel.js";
|
|
31
|
+
import { Item, ItemGroup } from "./item.js";
|
|
32
|
+
import { Pricing, PricingPlan } from "./pricing.js";
|
|
8
33
|
import { PricingCard } from "./pricing-card.js";
|
|
9
34
|
import { Checkbox } from "./checkbox.js";
|
|
10
|
-
import {
|
|
35
|
+
import { CheckboxGroup } from "./checkbox-group.js";
|
|
11
36
|
import { Input } from "./input.js";
|
|
12
|
-
import {
|
|
37
|
+
import { PasswordInput } from "./password-input.js";
|
|
13
38
|
import { Radio } from "./radio.js";
|
|
14
|
-
import {
|
|
39
|
+
import { RadioGroup } from "./radio-group.js";
|
|
40
|
+
import { Select, SelectItem } from "./select.js";
|
|
15
41
|
import { Spinner } from "./spinner.js";
|
|
16
42
|
import { Skeleton } from "./skeleton.js";
|
|
17
43
|
import { StepProgress } from "./step-progress.js";
|
|
18
|
-
import {
|
|
44
|
+
import { Empty } from "./empty.js";
|
|
19
45
|
import { InsightCard } from "./insight-card.js";
|
|
20
46
|
import { SectionCard } from "./section-card.js";
|
|
21
47
|
import { SectionHeader } from "./section-header.js";
|
|
22
48
|
import { FloatingStepper } from "./floating-stepper.js";
|
|
49
|
+
import { Stat } from "./stat.js";
|
|
23
50
|
import { SummaryBar } from "./summary-bar.js";
|
|
24
51
|
import { ToggleCard } from "./toggle-card.js";
|
|
25
|
-
import { PixIcon } from "./pix-icon.js";
|
|
26
52
|
import { ToggleCardCompact } from "./toggle-card-compact.js";
|
|
27
53
|
import { ChipInput } from "./chip-input.js";
|
|
28
|
-
import { FormCardHeader } from "./form-card-header.js";
|
|
29
54
|
import { CopyField } from "./copy-field.js";
|
|
30
55
|
import { QRDisplay } from "./qr-display.js";
|
|
31
|
-
import { ChoiceCard } from "./choice-card.js";
|
|
56
|
+
import { ChoiceCard, ChoiceCardGroup } from "./choice-card.js";
|
|
32
57
|
import { OptionTile, OptionTileGrid } from "./option-tile.js";
|
|
33
58
|
import { SelectableCard } from "./selectable-card.js";
|
|
34
59
|
import { ChoicePreviewCard } from "./choice-preview-card.js";
|
|
@@ -36,165 +61,256 @@ import { SettingRow } from "./setting-row.js";
|
|
|
36
61
|
import { SettingsList } from "./settings-list.js";
|
|
37
62
|
import { Dropzone } from "./dropzone.js";
|
|
38
63
|
import { MediaTile } from "./media-tile.js";
|
|
39
|
-
import {
|
|
64
|
+
import { Attachment } from "./attachment.js";
|
|
65
|
+
import { Bubble } from "./bubble.js";
|
|
66
|
+
import { Marker } from "./marker.js";
|
|
67
|
+
import { Message } from "./message.js";
|
|
68
|
+
import { MessageScroller } from "./message-scroller.js";
|
|
69
|
+
import { Questionnaire } from "./questionnaire.js";
|
|
40
70
|
import { TypingIndicator } from "./typing-indicator.js";
|
|
41
71
|
import { ChoiceCarousel } from "./choice-carousel.js";
|
|
42
|
-
import {
|
|
72
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from "./tabs.js";
|
|
73
|
+
import { PageHeader } from "./page-header.js";
|
|
74
|
+
import { Sidebar, SidebarItem, SidebarSection, SidebarSeparator } from "./sidebar.js";
|
|
75
|
+
import { NavigationMenu } from "./navigation-menu.js";
|
|
43
76
|
import { SavingBar } from "./saving-bar.js";
|
|
44
77
|
import { SavingBarProvider, SavingBarRoot, usePageSavingBar } from "./saving-bar-context.js";
|
|
45
|
-
import { FABProvider, FABRoot, useFAB, usePageFAB } from "./fab.js";
|
|
46
|
-
import { Table,
|
|
78
|
+
import { FAB, FABProvider, FABRoot, useFAB, usePageFAB } from "./fab.js";
|
|
79
|
+
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableStatus } from "./table.js";
|
|
47
80
|
import { Textarea } from "./textarea.js";
|
|
48
81
|
import { Toggle } from "./toggle.js";
|
|
82
|
+
import { Switch } from "./switch.js";
|
|
49
83
|
import { Tooltip } from "./tooltip.js";
|
|
50
|
-
import { Toaster,
|
|
51
|
-
import {
|
|
52
|
-
import { Avatar, AvatarGroup } from "./avatar.js";
|
|
84
|
+
import { Toaster, ToastView, toast, useToast, toastClassName } from "./toast.js";
|
|
85
|
+
import { Separator } from "./separator.js";
|
|
86
|
+
import { Avatar, AvatarGroup, initials } from "./avatar.js";
|
|
53
87
|
import { IconButton } from "./icon-button.js";
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import { ToggleGroup } from "./toggle-group.js";
|
|
88
|
+
import { ButtonGroup } from "./button-group.js";
|
|
89
|
+
import { ActionBar } from "./action-bar.js";
|
|
90
|
+
import { FormActions } from "./form-actions.js";
|
|
91
|
+
import { Breadcrumb } from "./breadcrumb.js";
|
|
92
|
+
import { Pagination, pageItems } from "./pagination.js";
|
|
93
|
+
import { Popover, PopoverClose } from "./popover.js";
|
|
94
|
+
import { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
|
|
61
95
|
import { Accordion, AccordionItem } from "./accordion.js";
|
|
62
96
|
import { Slider } from "./slider.js";
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
97
|
+
import { Listbox, ListboxOption } from "./listbox.js";
|
|
98
|
+
import { Calendar } from "./calendar.js";
|
|
99
|
+
import { FileInput, formatFileSize } from "./file-input.js";
|
|
100
|
+
import { NumberInput } from "./number-input.js";
|
|
101
|
+
import { InputOTP } from "./input-otp.js";
|
|
65
102
|
import { Combobox } from "./combobox.js";
|
|
66
103
|
import { DatePicker } from "./date-picker.js";
|
|
67
|
-
import { TimePicker } from "./time-picker.js";
|
|
68
|
-
import { Chip } from "./
|
|
69
|
-
import { BlockerCard } from "./blocker-card.js";
|
|
70
|
-
import { PaywallBanner } from "./paywall-banner.js";
|
|
71
|
-
import { PaywallContent, PaywallState, PaywallModal } from "./paywall.js";
|
|
104
|
+
import { TimePicker, parseTime, formatTime } from "./time-picker.js";
|
|
105
|
+
import { Chip } from "./chip.js";
|
|
72
106
|
import { PageSkeleton, CardsSkeleton } from "./page-skeleton.js";
|
|
73
107
|
import { CurrencyInput } from "./currency-input.js";
|
|
74
|
-
import { ColorInput } from "./color-input.js";
|
|
75
|
-
import { ImageUpload } from "./image-upload.js";
|
|
76
|
-
import { ImageCropModal } from "./image-crop-modal.js";
|
|
77
|
-
import { PhoneInput } from "./phone-input.js";
|
|
108
|
+
import { ColorInput, normalizeHex } from "./color-input.js";
|
|
78
109
|
import { RowActions } from "./row-actions.js";
|
|
79
110
|
import { PageShell } from "./page-shell.js";
|
|
80
111
|
import { DangerZone, DangerZoneItem } from "./danger-zone.js";
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
112
|
+
import { Banner } from "./banner.js";
|
|
113
|
+
import { Benefits, BenefitsItem } from "./benefits.js";
|
|
114
|
+
import { Contact } from "./contact.js";
|
|
115
|
+
import { FAQ } from "./faq.js";
|
|
116
|
+
import { Footer, FooterColumn } from "./footer.js";
|
|
117
|
+
import { Newsletter } from "./newsletter.js";
|
|
118
|
+
import { Testimonial, TestimonialItem } from "./testimonial.js";
|
|
119
|
+
import { TopNavigation } from "./top-navigation.js";
|
|
120
|
+
import { Phone } from "./phone.js";
|
|
121
|
+
import { Browser } from "./browser.js";
|
|
122
|
+
import { GoogleButton } from "./google-button.js";
|
|
123
|
+
import { GoogleSignIn } from "./google-sign-in.js";
|
|
124
|
+
import { GoogleConsent } from "./google-consent.js";
|
|
125
|
+
import { GoogleAccountChooser } from "./google-account-chooser.js";
|
|
126
|
+
import { WhatsAppChat } from "./whatsapp-chat.js";
|
|
127
|
+
import { WhatsAppMessage } from "./whatsapp-message.js";
|
|
128
|
+
import { WhatsAppNotification } from "./whatsapp-notification.js";
|
|
129
|
+
import { WhatsAppTemplate, WhatsAppTemplateButton } from "./whatsapp-template.js";
|
|
85
130
|
export {
|
|
86
131
|
Accordion,
|
|
87
132
|
AccordionItem,
|
|
133
|
+
ActionBar,
|
|
88
134
|
Alert,
|
|
135
|
+
AlertDialog,
|
|
136
|
+
Attachment,
|
|
89
137
|
Avatar,
|
|
90
138
|
AvatarGroup,
|
|
91
139
|
Badge,
|
|
92
|
-
|
|
93
|
-
|
|
140
|
+
Banner,
|
|
141
|
+
Benefits,
|
|
142
|
+
BenefitsItem,
|
|
94
143
|
Breadcrumb,
|
|
144
|
+
Browser,
|
|
145
|
+
Bubble,
|
|
95
146
|
Button,
|
|
147
|
+
ButtonGroup,
|
|
148
|
+
Calendar,
|
|
96
149
|
Card,
|
|
97
|
-
|
|
150
|
+
CardContent,
|
|
98
151
|
CardFooter,
|
|
99
152
|
CardHeader,
|
|
100
|
-
CardTitle,
|
|
101
153
|
CardsSkeleton,
|
|
102
|
-
|
|
154
|
+
Carousel,
|
|
155
|
+
CarouselPlaceholder,
|
|
156
|
+
Chart,
|
|
103
157
|
Checkbox,
|
|
158
|
+
CheckboxGroup,
|
|
104
159
|
Chip,
|
|
105
160
|
ChipInput,
|
|
106
161
|
ChoiceCard,
|
|
162
|
+
ChoiceCardGroup,
|
|
107
163
|
ChoiceCarousel,
|
|
108
164
|
ChoicePreviewCard,
|
|
109
165
|
ColorInput,
|
|
110
166
|
Combobox,
|
|
167
|
+
Command,
|
|
168
|
+
CommandGroup,
|
|
169
|
+
CommandItem,
|
|
170
|
+
Contact,
|
|
111
171
|
ContextMenu,
|
|
112
|
-
|
|
172
|
+
ContextMenuItem,
|
|
173
|
+
ContextMenuSeparator,
|
|
113
174
|
CopyField,
|
|
114
175
|
CurrencyInput,
|
|
115
176
|
DangerZone,
|
|
116
177
|
DangerZoneItem,
|
|
117
178
|
DataTableHeader,
|
|
118
179
|
DatePicker,
|
|
119
|
-
|
|
180
|
+
Delta,
|
|
181
|
+
Dialog,
|
|
182
|
+
DialogClose,
|
|
120
183
|
Drawer,
|
|
184
|
+
DrawerClose,
|
|
185
|
+
DropdownMenu,
|
|
186
|
+
DropdownMenuItem,
|
|
187
|
+
DropdownMenuRadioGroup,
|
|
188
|
+
DropdownMenuRadioItem,
|
|
189
|
+
DropdownMenuSeparator,
|
|
121
190
|
Dropzone,
|
|
122
|
-
|
|
191
|
+
Empty,
|
|
192
|
+
FAB,
|
|
123
193
|
FABProvider,
|
|
124
194
|
FABRoot,
|
|
195
|
+
FAQ,
|
|
196
|
+
FileInput,
|
|
125
197
|
FilterChip,
|
|
126
198
|
FilterChipGroup,
|
|
127
199
|
FilterDropdown,
|
|
128
200
|
FloatingStepper,
|
|
129
|
-
|
|
201
|
+
Footer,
|
|
202
|
+
FooterColumn,
|
|
203
|
+
FormActions,
|
|
204
|
+
GoogleAccountChooser,
|
|
205
|
+
GoogleButton,
|
|
206
|
+
GoogleConsent,
|
|
207
|
+
GoogleSignIn,
|
|
208
|
+
HoverCard,
|
|
130
209
|
IconButton,
|
|
131
|
-
ImageCropModal,
|
|
132
|
-
ImageUpload,
|
|
133
210
|
Input,
|
|
211
|
+
InputOTP,
|
|
134
212
|
InsightCard,
|
|
135
|
-
|
|
213
|
+
Item,
|
|
214
|
+
ItemGroup,
|
|
215
|
+
Kbd,
|
|
216
|
+
KbdGroup,
|
|
217
|
+
Listbox,
|
|
218
|
+
ListboxOption,
|
|
219
|
+
Marker,
|
|
136
220
|
MediaTile,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Notice,
|
|
221
|
+
Message,
|
|
222
|
+
MessageScroller,
|
|
223
|
+
NavigationMenu,
|
|
224
|
+
Newsletter,
|
|
225
|
+
NumberInput,
|
|
143
226
|
OptionTile,
|
|
144
227
|
OptionTileGrid,
|
|
228
|
+
PageHeader,
|
|
145
229
|
PageShell,
|
|
146
230
|
PageSkeleton,
|
|
147
|
-
PageTabs,
|
|
148
231
|
Pagination,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
PaywallModal,
|
|
152
|
-
PaywallState,
|
|
153
|
-
PhoneFrame,
|
|
154
|
-
PhoneInput,
|
|
155
|
-
PixIcon,
|
|
232
|
+
PasswordInput,
|
|
233
|
+
Phone,
|
|
156
234
|
Popover,
|
|
235
|
+
PopoverClose,
|
|
236
|
+
Pricing,
|
|
157
237
|
PricingCard,
|
|
238
|
+
PricingPlan,
|
|
239
|
+
Progress,
|
|
158
240
|
QRDisplay,
|
|
241
|
+
Questionnaire,
|
|
159
242
|
Radio,
|
|
243
|
+
RadioGroup,
|
|
160
244
|
RowActions,
|
|
161
245
|
SavingBar,
|
|
162
246
|
SavingBarProvider,
|
|
163
247
|
SavingBarRoot,
|
|
164
|
-
Search,
|
|
165
248
|
SectionCard,
|
|
166
249
|
SectionHeader,
|
|
167
250
|
Select,
|
|
251
|
+
SelectItem,
|
|
168
252
|
SelectableCard,
|
|
253
|
+
Separator,
|
|
169
254
|
SettingRow,
|
|
170
255
|
SettingsList,
|
|
256
|
+
Sheet,
|
|
257
|
+
SheetClose,
|
|
258
|
+
Sidebar,
|
|
259
|
+
SidebarItem,
|
|
260
|
+
SidebarSection,
|
|
261
|
+
SidebarSeparator,
|
|
171
262
|
Skeleton,
|
|
172
263
|
Slider,
|
|
264
|
+
Sparkline,
|
|
173
265
|
Spinner,
|
|
266
|
+
StarRating,
|
|
267
|
+
Stat,
|
|
268
|
+
Status,
|
|
174
269
|
StepProgress,
|
|
175
270
|
SummaryBar,
|
|
271
|
+
Switch,
|
|
176
272
|
Table,
|
|
177
273
|
TableBody,
|
|
274
|
+
TableCell,
|
|
178
275
|
TableHead,
|
|
276
|
+
TableHeader,
|
|
179
277
|
TableRow,
|
|
180
|
-
|
|
278
|
+
TableStatus,
|
|
279
|
+
Tabs,
|
|
280
|
+
TabsContent,
|
|
281
|
+
TabsList,
|
|
282
|
+
TabsTrigger,
|
|
283
|
+
Testimonial,
|
|
284
|
+
TestimonialItem,
|
|
181
285
|
Textarea,
|
|
182
|
-
|
|
183
|
-
Themed,
|
|
286
|
+
Tile,
|
|
184
287
|
TimePicker,
|
|
185
|
-
|
|
288
|
+
ToastView,
|
|
186
289
|
Toaster,
|
|
187
290
|
Toggle,
|
|
188
291
|
ToggleCard,
|
|
189
292
|
ToggleCardCompact,
|
|
190
293
|
ToggleGroup,
|
|
294
|
+
ToggleGroupItem,
|
|
191
295
|
Tooltip,
|
|
296
|
+
TopNavigation,
|
|
192
297
|
TypingIndicator,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
298
|
+
WhatsAppChat,
|
|
299
|
+
WhatsAppMessage,
|
|
300
|
+
WhatsAppNotification,
|
|
301
|
+
WhatsAppTemplate,
|
|
302
|
+
WhatsAppTemplateButton,
|
|
303
|
+
formatBadgeValue,
|
|
304
|
+
formatFileSize,
|
|
305
|
+
formatTime,
|
|
306
|
+
initials,
|
|
307
|
+
normalizeHex,
|
|
308
|
+
pageItems,
|
|
309
|
+
parseTime,
|
|
196
310
|
toast,
|
|
311
|
+
toastClassName,
|
|
197
312
|
useFAB,
|
|
198
313
|
usePageFAB,
|
|
199
|
-
usePageSavingBar
|
|
314
|
+
usePageSavingBar,
|
|
315
|
+
useToast
|
|
200
316
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type InputOTPLength = 4 | 6;
|
|
5
|
+
interface InputOTPProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'maxLength' | 'pattern' | 'value' | 'defaultValue' | 'children' | 'size'> {
|
|
6
|
+
/** The field's name, such as "Código de verificação" (Figma: `showLabel` + `label`). Without it, pass aria-label. */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** 4 or 6 digits (Figma: `length`). */
|
|
9
|
+
length?: InputOTPLength;
|
|
10
|
+
/** A dash in the middle of the 6-digit code (Figma: `showSeparator`). On by default; a 4-digit code has none. */
|
|
11
|
+
showSeparator?: boolean;
|
|
12
|
+
/** Where the code went, without the full address: a masked e-mail or phone (Figma: `showHint` + `hint`). */
|
|
13
|
+
hint?: ReactNode;
|
|
14
|
+
/** The code was refused (Figma: `error`): the boxes turn red. The digits stay, so the person can fix one. */
|
|
15
|
+
error?: boolean;
|
|
16
|
+
/** What went wrong and what to do. Replaces the hint and turns the error state on. */
|
|
17
|
+
errorMessage?: ReactNode;
|
|
18
|
+
/** Controlled: the digits typed so far. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Uncontrolled: the digits at first. */
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
/** Called with the digits on every change (letters are dropped). */
|
|
23
|
+
onValueChange?: (value: string) => void;
|
|
24
|
+
/** Called once all the digits are in. */
|
|
25
|
+
onComplete?: (value: string) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* InputOTP — Figma [RDS] Forms/InputOTP. The verification code: one box per digit. One real
|
|
29
|
+
* <input autocomplete="one-time-code" inputmode="numeric"> lies over the boxes, so pasting the whole code and the
|
|
30
|
+
* SMS autofill just work, each digit moves on by itself, and Backspace takes the last one back. Disabled is the
|
|
31
|
+
* native one. Styles: input-otp.css.
|
|
32
|
+
*/
|
|
33
|
+
declare function InputOTP({ label, length, showSeparator, hint, error, errorMessage, value, defaultValue, onValueChange, onComplete, id, disabled, className, style, onChange, onFocus, onBlur, onSelect, ...input }: InputOTPProps): react.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { InputOTP, type InputOTPLength, type InputOTPProps };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { hasContent, useFieldIds, warnIfUnlabelled } from "./internal/field.js";
|
|
10
|
+
function InputOTP(_a) {
|
|
11
|
+
var _b = _a, {
|
|
12
|
+
label,
|
|
13
|
+
length = 6,
|
|
14
|
+
showSeparator = true,
|
|
15
|
+
hint,
|
|
16
|
+
error,
|
|
17
|
+
errorMessage,
|
|
18
|
+
value,
|
|
19
|
+
defaultValue = "",
|
|
20
|
+
onValueChange,
|
|
21
|
+
onComplete,
|
|
22
|
+
id,
|
|
23
|
+
disabled,
|
|
24
|
+
className,
|
|
25
|
+
style,
|
|
26
|
+
onChange,
|
|
27
|
+
onFocus,
|
|
28
|
+
onBlur,
|
|
29
|
+
onSelect
|
|
30
|
+
} = _b, input = __objRest(_b, [
|
|
31
|
+
"label",
|
|
32
|
+
"length",
|
|
33
|
+
"showSeparator",
|
|
34
|
+
"hint",
|
|
35
|
+
"error",
|
|
36
|
+
"errorMessage",
|
|
37
|
+
"value",
|
|
38
|
+
"defaultValue",
|
|
39
|
+
"onValueChange",
|
|
40
|
+
"onComplete",
|
|
41
|
+
"id",
|
|
42
|
+
"disabled",
|
|
43
|
+
"className",
|
|
44
|
+
"style",
|
|
45
|
+
"onChange",
|
|
46
|
+
"onFocus",
|
|
47
|
+
"onBlur",
|
|
48
|
+
"onSelect"
|
|
49
|
+
]);
|
|
50
|
+
warnIfUnlabelled("InputOTP", label, input["aria-label"], input["aria-labelledby"]);
|
|
51
|
+
const { controlId, hintId, errorId, invalid, describedBy } = useFieldIds(id, hint, error, errorMessage);
|
|
52
|
+
const [own, setOwn] = useState(defaultValue.replace(/\D/g, ""));
|
|
53
|
+
const [focused, setFocused] = useState(false);
|
|
54
|
+
const code = (value != null ? value : own).slice(0, length);
|
|
55
|
+
const split = showSeparator && length === 6 ? 3 : -1;
|
|
56
|
+
const active = focused ? Math.min(code.length, length - 1) : -1;
|
|
57
|
+
function change(event) {
|
|
58
|
+
const digits = event.target.value.replace(/\D/g, "").slice(0, length);
|
|
59
|
+
setOwn(digits);
|
|
60
|
+
onChange == null ? void 0 : onChange(event);
|
|
61
|
+
onValueChange == null ? void 0 : onValueChange(digits);
|
|
62
|
+
if (digits.length === length && digits !== code) onComplete == null ? void 0 : onComplete(digits);
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsxs(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: ["rds-otp", invalid && "rds-otp--error", disabled && "rds-otp--disabled", className].filter(Boolean).join(" "),
|
|
68
|
+
style,
|
|
69
|
+
children: [
|
|
70
|
+
hasContent(label) && /* @__PURE__ */ jsx("label", { htmlFor: controlId, className: "rds-otp__label", children: label }),
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-otp__slots", children: [
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
"input",
|
|
74
|
+
__spreadProps(__spreadValues({}, input), {
|
|
75
|
+
id: controlId,
|
|
76
|
+
className: "rds-otp__input",
|
|
77
|
+
type: "text",
|
|
78
|
+
inputMode: "numeric",
|
|
79
|
+
autoComplete: "one-time-code",
|
|
80
|
+
pattern: `\\d{${length}}`,
|
|
81
|
+
disabled,
|
|
82
|
+
"aria-invalid": invalid || void 0,
|
|
83
|
+
"aria-describedby": [describedBy, input["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
84
|
+
value: code,
|
|
85
|
+
onChange: change,
|
|
86
|
+
onFocus: (event) => {
|
|
87
|
+
setFocused(true);
|
|
88
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
89
|
+
},
|
|
90
|
+
onBlur: (event) => {
|
|
91
|
+
setFocused(false);
|
|
92
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
93
|
+
},
|
|
94
|
+
onSelect: (event) => {
|
|
95
|
+
const target = event.currentTarget;
|
|
96
|
+
if (target.selectionStart !== target.value.length) target.setSelectionRange(target.value.length, target.value.length);
|
|
97
|
+
onSelect == null ? void 0 : onSelect(event);
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
),
|
|
101
|
+
Array.from({ length }, (_, i) => {
|
|
102
|
+
var _a2;
|
|
103
|
+
return /* @__PURE__ */ jsxs("span", { className: "rds-otp__group", "aria-hidden": "true", children: [
|
|
104
|
+
i === split && /* @__PURE__ */ jsx("span", { className: "rds-otp__separator", children: "\u2013" }),
|
|
105
|
+
/* @__PURE__ */ jsxs("span", { className: ["rds-otp__slot", i === active && "rds-otp__slot--active"].filter(Boolean).join(" "), children: [
|
|
106
|
+
(_a2 = code[i]) != null ? _a2 : "",
|
|
107
|
+
i === active && !code[i] && /* @__PURE__ */ jsx("span", { className: "rds-otp__caret" })
|
|
108
|
+
] })
|
|
109
|
+
] }, i);
|
|
110
|
+
})
|
|
111
|
+
] }),
|
|
112
|
+
errorId ? /* @__PURE__ */ jsx("span", { id: errorId, className: "rds-otp__support rds-otp__error-message", children: errorMessage }) : hintId && /* @__PURE__ */ jsx("span", { id: hintId, className: "rds-otp__support rds-otp__hint", children: hint })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
InputOTP
|
|
119
|
+
};
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
+
import { FieldTextProps } from './internal/field.js';
|
|
4
|
+
export { FieldLabelPosition } from './internal/field.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
error?: string;
|
|
9
|
-
size?: InputSize;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
optional?: boolean;
|
|
12
|
-
iconLeft?: ReactNode;
|
|
13
|
-
iconRight?: ReactNode;
|
|
6
|
+
interface InputProps extends FieldTextProps, Omit<ComponentPropsWithRef<'input'>, 'prefix' | 'children' | 'size'> {
|
|
7
|
+
/** An icon on the left, such as a magnifier on a search (Figma: `showLeadingIcon` + `leadingIcon`). Decorative. */
|
|
8
|
+
leadingIcon?: ReactNode;
|
|
9
|
+
/** Text before the value, such as R$ (Figma: `showPrefix` + `prefix`). Not read with the value: if it matters, say it in the label. */
|
|
14
10
|
prefix?: ReactNode;
|
|
11
|
+
/** Text after the value, such as kg (Figma: `showSuffix` + `suffix`). */
|
|
15
12
|
suffix?: ReactNode;
|
|
13
|
+
/** A decorative icon on the right (Figma: `showTrailingIcon` + `trailingIcon`). Hidden while the clear button shows. */
|
|
14
|
+
trailingIcon?: ReactNode;
|
|
15
|
+
/** A clear button on the right while there is a value (Figma: `showClear`). Focus goes back to the field. */
|
|
16
16
|
clearable?: boolean;
|
|
17
|
+
/** Called after the clear button empties the field (onChange fires too, with an empty value). */
|
|
17
18
|
onClear?: () => void;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/** Conta caracteres (mostra "X/Y" se maxLength definido). */
|
|
21
|
-
showCount?: boolean;
|
|
19
|
+
/** The clear button's accessible name. */
|
|
20
|
+
clearLabel?: string;
|
|
22
21
|
}
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Input — Figma [RDS] Forms/Input. A one-line text field with its own label, hint and error.
|
|
24
|
+
* email, tel, url, number and search are this Input with the right `type` and `autoComplete`; a search
|
|
25
|
+
* is a leading magnifier plus `clearable`, a currency a `prefix`. The value is the native one
|
|
26
|
+
* (Figma: `text`): `value` + `onChange`, or `defaultValue`. Disabled is the native one. Styles: input.css
|
|
27
|
+
* and internal/field.css.
|
|
28
|
+
*/
|
|
29
|
+
declare function Input({ label, labelPosition, hint, error, errorMessage, required, leadingIcon, prefix, suffix, trailingIcon, clearable, onClear, clearLabel, id, disabled, className, style, onChange, ref, ...input }: InputProps): react.JSX.Element;
|
|
24
30
|
|
|
25
|
-
export { Input, type InputProps
|
|
31
|
+
export { Input, type InputProps };
|