@rojaostudio/ds 1.0.1 → 2.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -13
- package/dist/compat/generate.d.ts +0 -1
- package/dist/components/accordion.d.ts +30 -20
- package/dist/components/accordion.js +31 -87
- package/dist/components/action-bar.d.ts +24 -0
- package/dist/components/action-bar.js +55 -0
- package/dist/components/alert-dialog.d.ts +31 -0
- package/dist/components/alert-dialog.js +43 -0
- package/dist/components/alert.d.ts +31 -19
- package/dist/components/alert.js +74 -65
- package/dist/components/attachment.d.ts +37 -0
- package/dist/components/attachment.js +76 -0
- package/dist/components/avatar.d.ts +43 -36
- package/dist/components/avatar.js +59 -83
- package/dist/components/badge.d.ts +30 -41
- package/dist/components/badge.js +16 -106
- package/dist/components/banner.d.ts +27 -0
- package/dist/components/banner.js +66 -0
- package/dist/components/benefits.d.ts +30 -0
- package/dist/components/benefits.js +32 -0
- package/dist/components/breadcrumb.d.ts +25 -18
- package/dist/components/breadcrumb.js +40 -48
- package/dist/components/browser.d.ts +18 -0
- package/dist/components/browser.js +32 -0
- package/dist/components/bubble.d.ts +29 -0
- package/dist/components/bubble.js +33 -0
- package/dist/components/button-group.d.ts +19 -0
- package/dist/components/button-group.js +20 -0
- package/dist/components/button.d.ts +47 -20
- package/dist/components/button.js +51 -107
- package/dist/components/calendar.d.ts +29 -0
- package/dist/components/calendar.js +149 -0
- package/dist/components/card.d.ts +47 -19
- package/dist/components/card.js +38 -38
- package/dist/components/carousel.d.ts +28 -0
- package/dist/components/carousel.js +130 -0
- package/dist/components/chart.d.ts +49 -0
- package/dist/components/chart.js +258 -0
- package/dist/components/checkbox-group.d.ts +16 -0
- package/dist/components/checkbox-group.js +13 -0
- package/dist/components/checkbox.d.ts +25 -10
- package/dist/components/checkbox.js +86 -67
- package/dist/components/chip-input.d.ts +46 -20
- package/dist/components/chip-input.js +171 -158
- package/dist/components/chip.d.ts +28 -0
- package/dist/components/chip.js +73 -0
- package/dist/components/choice-card.d.ts +10 -13
- package/dist/components/choice-card.js +11 -56
- package/dist/components/choice-carousel.d.ts +9 -0
- package/dist/components/choice-carousel.js +67 -78
- package/dist/components/choice-preview-card.d.ts +10 -20
- package/dist/components/choice-preview-card.js +13 -30
- package/dist/components/color-input.d.ts +36 -11
- package/dist/components/color-input.js +139 -61
- package/dist/components/combobox.d.ts +60 -57
- package/dist/components/combobox.js +215 -196
- package/dist/components/command.d.ts +58 -0
- package/dist/components/command.js +177 -0
- package/dist/components/contact.d.ts +23 -0
- package/dist/components/contact.js +32 -0
- package/dist/components/context-menu.d.ts +34 -26
- package/dist/components/context-menu.js +43 -66
- package/dist/components/copy-field.d.ts +10 -5
- package/dist/components/copy-field.js +25 -27
- package/dist/components/currency-input.d.ts +25 -11
- package/dist/components/currency-input.js +39 -67
- package/dist/components/danger-zone.d.ts +10 -1
- package/dist/components/danger-zone.js +20 -14
- package/dist/components/data-table-header.d.ts +13 -2
- package/dist/components/data-table-header.js +143 -169
- package/dist/components/date-picker.d.ts +31 -32
- package/dist/components/date-picker.js +126 -242
- package/dist/components/delta.d.ts +26 -0
- package/dist/components/delta.js +24 -0
- package/dist/components/dialog.d.ts +21 -0
- package/dist/components/dialog.js +16 -0
- package/dist/components/drawer.d.ts +15 -23
- package/dist/components/drawer.js +56 -76
- package/dist/components/dropdown-menu.d.ts +63 -0
- package/dist/components/dropdown-menu.js +62 -0
- package/dist/components/dropzone.d.ts +10 -4
- package/dist/components/dropzone.js +30 -55
- package/dist/components/empty.d.ts +29 -0
- package/dist/components/empty.js +42 -0
- package/dist/components/fab.d.ts +29 -6
- package/dist/components/fab.js +51 -39
- package/dist/components/faq.d.ts +21 -0
- package/dist/components/faq.js +24 -0
- package/dist/components/file-input.d.ts +56 -0
- package/dist/components/file-input.js +244 -0
- package/dist/components/filter-chip.d.ts +34 -47
- package/dist/components/filter-chip.js +61 -57
- package/dist/components/floating-stepper.d.ts +7 -18
- package/dist/components/floating-stepper.js +17 -35
- package/dist/components/footer.d.ts +36 -0
- package/dist/components/footer.js +38 -0
- package/dist/components/form-actions.d.ts +28 -0
- package/dist/components/form-actions.js +24 -0
- package/dist/components/google-account-chooser.d.ts +25 -0
- package/dist/components/google-account-chooser.js +44 -0
- package/dist/components/google-button.d.ts +26 -0
- package/dist/components/google-button.js +38 -0
- package/dist/components/google-consent.d.ts +23 -0
- package/dist/components/google-consent.js +28 -0
- package/dist/components/google-sign-in.d.ts +26 -0
- package/dist/components/google-sign-in.js +36 -0
- package/dist/components/hover-card.d.ts +30 -0
- package/dist/components/hover-card.js +55 -0
- package/dist/components/icon-button.d.ts +41 -11
- package/dist/components/icon-button.js +47 -61
- package/dist/components/image-crop-modal.d.ts +3 -3
- package/dist/components/image-crop-modal.js +66 -52
- package/dist/components/image-upload.d.ts +21 -29
- package/dist/components/image-upload.js +59 -219
- package/dist/components/index.d.ts +105 -49
- package/dist/components/index.js +190 -68
- package/dist/components/input-otp.d.ts +35 -0
- package/dist/components/input-otp.js +119 -0
- package/dist/components/input.d.ts +23 -17
- package/dist/components/input.js +103 -108
- package/dist/components/insight-card.d.ts +25 -9
- package/dist/components/insight-card.js +45 -19
- package/dist/components/internal/announce.d.ts +3 -0
- package/dist/components/internal/announce.js +20 -0
- package/dist/components/internal/block.d.ts +15 -0
- package/dist/components/internal/block.js +14 -0
- package/dist/components/internal/button.d.ts +23 -0
- package/dist/components/internal/button.js +30 -0
- package/dist/components/internal/choice-card.d.ts +52 -0
- package/dist/components/internal/choice-card.js +117 -0
- package/dist/components/internal/choice.d.ts +25 -0
- package/dist/components/internal/choice.js +44 -0
- package/dist/components/internal/dates.d.ts +17 -0
- package/dist/components/internal/dates.js +59 -0
- package/dist/components/internal/field.d.ts +66 -0
- package/dist/components/internal/field.js +105 -0
- package/dist/components/internal/fieldset.d.ts +25 -0
- package/dist/components/internal/fieldset.js +56 -0
- package/dist/components/internal/focus-after.d.ts +3 -0
- package/dist/components/internal/focus-after.js +13 -0
- package/dist/components/internal/google.d.ts +47 -0
- package/dist/components/internal/google.js +73 -0
- package/dist/components/internal/icons.d.ts +108 -0
- package/dist/components/internal/icons.js +316 -0
- package/dist/components/internal/menu.d.ts +16 -0
- package/dist/components/internal/menu.js +14 -0
- package/dist/components/internal/modal.d.ts +50 -0
- package/dist/components/internal/modal.js +85 -0
- package/dist/components/internal/option-content.d.ts +10 -0
- package/dist/components/internal/option-content.js +13 -0
- package/dist/components/internal/radio-context.d.ts +16 -0
- package/dist/components/internal/radio-context.js +6 -0
- package/dist/components/internal/toggle.d.ts +7 -0
- package/dist/components/internal/toggle.js +13 -0
- package/dist/components/internal/use-listbox.d.ts +56 -0
- package/dist/components/internal/use-listbox.js +69 -0
- package/dist/components/internal/whatsapp.d.ts +8 -0
- package/dist/components/internal/whatsapp.js +12 -0
- package/dist/components/item.d.ts +32 -0
- package/dist/components/item.js +35 -0
- package/dist/components/kbd.d.ts +17 -0
- package/dist/components/kbd.js +18 -0
- package/dist/components/listbox.d.ts +34 -0
- package/dist/components/listbox.js +114 -0
- package/dist/components/marker.d.ts +24 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/media-tile.d.ts +17 -14
- package/dist/components/media-tile.js +19 -24
- package/dist/components/message-scroller.d.ts +20 -0
- package/dist/components/message-scroller.js +108 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +23 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +30 -0
- package/dist/components/newsletter.d.ts +27 -0
- package/dist/components/newsletter.js +75 -0
- package/dist/components/number-input.d.ts +60 -0
- package/dist/components/number-input.js +234 -0
- package/dist/components/option-tile.d.ts +20 -19
- package/dist/components/option-tile.js +52 -131
- package/dist/components/page-header.d.ts +31 -0
- package/dist/components/page-header.js +25 -0
- package/dist/components/page-shell.d.ts +11 -1
- package/dist/components/page-shell.js +8 -27
- package/dist/components/page-skeleton.d.ts +15 -21
- package/dist/components/page-skeleton.js +37 -4
- package/dist/components/pagination.d.ts +32 -22
- package/dist/components/pagination.js +83 -76
- package/dist/components/password-input.d.ts +26 -0
- package/dist/components/password-input.js +112 -0
- package/dist/components/phone-input.d.ts +12 -8
- package/dist/components/phone-input.js +77 -47
- package/dist/components/phone.d.ts +27 -0
- package/dist/components/phone.js +35 -0
- package/dist/components/popover.d.ts +25 -36
- package/dist/components/popover.js +32 -129
- package/dist/components/pricing-card.d.ts +9 -25
- package/dist/components/pricing-card.js +9 -25
- package/dist/components/pricing.d.ts +48 -0
- package/dist/components/pricing.js +64 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.js +57 -0
- package/dist/components/qr-display.d.ts +11 -6
- package/dist/components/qr-display.js +8 -19
- package/dist/components/questionnaire.d.ts +42 -0
- package/dist/components/questionnaire.js +107 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.js +40 -0
- package/dist/components/radio.d.ts +15 -29
- package/dist/components/radio.js +46 -87
- package/dist/components/row-actions.d.ts +5 -0
- package/dist/components/row-actions.js +57 -56
- package/dist/components/saving-bar-context.d.ts +0 -5
- package/dist/components/saving-bar-context.js +16 -34
- package/dist/components/saving-bar.d.ts +26 -11
- package/dist/components/saving-bar.js +53 -65
- package/dist/components/section-card.d.ts +18 -4
- package/dist/components/section-card.js +26 -39
- package/dist/components/section-header.d.ts +8 -12
- package/dist/components/section-header.js +7 -2
- package/dist/components/select.d.ts +44 -16
- package/dist/components/select.js +85 -135
- package/dist/components/selectable-card.d.ts +11 -19
- package/dist/components/selectable-card.js +4 -21
- package/dist/components/separator.d.ts +20 -0
- package/dist/components/separator.js +19 -0
- package/dist/components/setting-row.d.ts +11 -15
- package/dist/components/setting-row.js +11 -14
- package/dist/components/settings-list.d.ts +10 -12
- package/dist/components/settings-list.js +9 -17
- package/dist/components/sheet.d.ts +21 -0
- package/dist/components/sheet.js +16 -0
- package/dist/components/sidebar.d.ts +79 -0
- package/dist/components/sidebar.js +111 -0
- package/dist/components/skeleton.d.ts +14 -20
- package/dist/components/skeleton.js +8 -36
- package/dist/components/slider.d.ts +21 -23
- package/dist/components/slider.js +65 -56
- package/dist/components/sparkline.d.ts +19 -0
- package/dist/components/sparkline.js +32 -0
- package/dist/components/spinner.d.ts +16 -8
- package/dist/components/spinner.js +35 -32
- package/dist/components/star-rating.d.ts +22 -0
- package/dist/components/star-rating.js +25 -0
- package/dist/components/stat.d.ts +33 -0
- package/dist/components/stat.js +29 -0
- package/dist/components/status.d.ts +27 -0
- package/dist/components/status.js +34 -0
- package/dist/components/step-progress.d.ts +13 -6
- package/dist/components/step-progress.js +20 -17
- package/dist/components/summary-bar.d.ts +20 -20
- package/dist/components/summary-bar.js +13 -50
- package/dist/components/switch.d.ts +20 -0
- package/dist/components/switch.js +46 -0
- package/dist/components/table.d.ts +56 -17
- package/dist/components/table.js +65 -59
- package/dist/components/tabs.d.ts +67 -0
- package/dist/components/tabs.js +56 -0
- package/dist/components/testimonial.d.ts +30 -0
- package/dist/components/testimonial.js +36 -0
- package/dist/components/textarea.d.ts +11 -16
- package/dist/components/textarea.js +55 -75
- package/dist/components/tile.d.ts +24 -0
- package/dist/components/tile.js +21 -0
- package/dist/components/time-picker.d.ts +40 -25
- package/dist/components/time-picker.js +191 -189
- package/dist/components/toast.d.ts +63 -0
- package/dist/components/toast.js +132 -0
- package/dist/components/toggle-card-compact.d.ts +15 -5
- package/dist/components/toggle-card-compact.js +22 -81
- package/dist/components/toggle-card.d.ts +11 -2
- package/dist/components/toggle-card.js +9 -70
- package/dist/components/toggle-group.d.ts +21 -59
- package/dist/components/toggle-group.js +31 -74
- package/dist/components/toggle.d.ts +19 -9
- package/dist/components/toggle.js +20 -55
- package/dist/components/tooltip.d.ts +25 -12
- package/dist/components/tooltip.js +16 -84
- package/dist/components/top-navigation.d.ts +33 -0
- package/dist/components/top-navigation.js +85 -0
- package/dist/components/typing-indicator.d.ts +6 -0
- package/dist/components/typing-indicator.js +3 -21
- package/dist/components/whatsapp-chat.d.ts +28 -0
- package/dist/components/whatsapp-chat.js +95 -0
- package/dist/components/whatsapp-message.d.ts +22 -0
- package/dist/components/whatsapp-message.js +34 -0
- package/dist/components/whatsapp-notification.d.ts +27 -0
- package/dist/components/whatsapp-notification.js +73 -0
- package/dist/components/whatsapp-template.d.ts +42 -0
- package/dist/components/whatsapp-template.js +69 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/pix.d.ts +16 -0
- package/dist/icons/pix.js +29 -0
- package/dist/targets/native/components/accordion.js +31 -25
- package/dist/targets/native/components/alert.js +22 -16
- package/dist/targets/native/components/avatar.js +36 -29
- package/dist/targets/native/components/badge.js +4 -3
- package/dist/targets/native/components/button.js +11 -4
- package/dist/targets/native/components/card.js +2 -1
- package/dist/targets/native/components/checkbox.js +18 -15
- package/dist/targets/native/components/chips.js +19 -16
- package/dist/targets/native/components/choice-card.js +29 -23
- package/dist/targets/native/components/context-menu.js +13 -9
- package/dist/targets/native/components/currency-input.js +28 -25
- package/dist/targets/native/components/danger-zone.js +10 -4
- package/dist/targets/native/components/date-picker.js +86 -70
- package/dist/targets/native/components/divider.js +3 -2
- package/dist/targets/native/components/empty-state.js +6 -1
- package/dist/targets/native/components/fab.js +32 -26
- package/dist/targets/native/components/filter-chip.js +9 -8
- package/dist/targets/native/components/form-field.js +20 -10
- package/dist/targets/native/components/form-screen.js +50 -45
- package/dist/targets/native/components/google-icon.js +31 -25
- package/dist/targets/native/components/icon-button.js +6 -4
- package/dist/targets/native/components/icon.js +2 -1
- package/dist/targets/native/components/image-upload.js +59 -50
- package/dist/targets/native/components/index.d.ts +0 -2
- package/dist/targets/native/components/index.js +0 -4
- package/dist/targets/native/components/input.js +41 -34
- package/dist/targets/native/components/list-item.js +29 -23
- package/dist/targets/native/components/menu.js +12 -10
- package/dist/targets/native/components/modal.js +41 -32
- package/dist/targets/native/components/radio.js +19 -16
- package/dist/targets/native/components/search.js +41 -38
- package/dist/targets/native/components/select.js +71 -63
- package/dist/targets/native/components/sheet.js +36 -30
- package/dist/targets/native/components/skeleton.js +6 -5
- package/dist/targets/native/components/slider.js +51 -43
- package/dist/targets/native/components/spinner.js +2 -1
- package/dist/targets/native/components/stepper.js +14 -9
- package/dist/targets/native/components/switch.js +15 -14
- package/dist/targets/native/components/text.js +2 -1
- package/dist/targets/native/components/textarea.js +2 -1
- package/dist/targets/native/components/theme.js +2 -1
- package/dist/targets/native/components/toaster.js +24 -21
- package/dist/targets/native/index.d.ts +1 -1
- package/dist/targets/native/index.js +1 -3
- package/dist/targets/native/preset.cjs +0 -1
- package/dist/targets/native/theme.css +58 -60
- package/dist/targets/native/theme.d.ts +58 -60
- package/dist/targets/native/theme.js +58 -60
- package/package.json +35 -16
- package/styles/_primitives.generated.css +40 -0
- package/styles/base.css +15 -21
- package/styles/rds/components-styles.css +11365 -0
- package/styles/rds/components.css +993 -0
- package/styles/rds/foundation.css +74 -0
- package/styles/rds/theme.css +261 -0
- package/styles/rds.css +6 -0
- package/styles/themes/rojao.css +46 -53
- package/brand/rojao-black-on-white.png +0 -0
- package/brand/rojao-black.png +0 -0
- package/brand/rojao-white-on-black.png +0 -0
- package/brand/rojao-white.png +0 -0
- package/dist/components/blocker-card.d.ts +0 -42
- package/dist/components/blocker-card.js +0 -45
- package/dist/components/bottom-sheet.d.ts +0 -31
- package/dist/components/bottom-sheet.js +0 -120
- package/dist/components/chat-bubble.d.ts +0 -16
- package/dist/components/chat-bubble.js +0 -55
- package/dist/components/chips.d.ts +0 -22
- package/dist/components/chips.js +0 -94
- package/dist/components/copilot-hint.d.ts +0 -18
- package/dist/components/copilot-hint.js +0 -63
- package/dist/components/divider.d.ts +0 -20
- package/dist/components/divider.js +0 -47
- package/dist/components/empty-state.d.ts +0 -48
- package/dist/components/empty-state.js +0 -91
- package/dist/components/form-card-header.d.ts +0 -13
- package/dist/components/form-card-header.js +0 -8
- package/dist/components/label.d.ts +0 -16
- package/dist/components/label.js +0 -43
- package/dist/components/menu.d.ts +0 -50
- package/dist/components/menu.js +0 -80
- package/dist/components/modal.d.ts +0 -25
- package/dist/components/modal.js +0 -71
- package/dist/components/notice.d.ts +0 -50
- package/dist/components/notice.js +0 -103
- package/dist/components/page-tabs.d.ts +0 -35
- package/dist/components/page-tabs.js +0 -55
- package/dist/components/paywall-banner.d.ts +0 -37
- package/dist/components/paywall-banner.js +0 -42
- package/dist/components/paywall.d.ts +0 -44
- package/dist/components/paywall.js +0 -55
- package/dist/components/phone-frame.d.ts +0 -9
- package/dist/components/phone-frame.js +0 -18
- package/dist/components/pix-icon.d.ts +0 -8
- package/dist/components/pix-icon.js +0 -24
- package/dist/components/search.d.ts +0 -30
- package/dist/components/search.js +0 -81
- package/dist/components/themed.d.ts +0 -36
- package/dist/components/themed.js +0 -22
- package/dist/components/toaster.d.ts +0 -84
- package/dist/components/toaster.js +0 -284
- package/dist/components/use-dismiss.d.ts +0 -9
- package/dist/components/use-dismiss.js +0 -28
- package/dist/components/use-focus-trap.d.ts +0 -5
- package/dist/components/use-focus-trap.js +0 -54
- package/dist/targets/native/components/paywall-banner.d.ts +0 -11
- package/dist/targets/native/components/paywall-banner.js +0 -46
- package/dist/targets/native/components/paywall.d.ts +0 -18
- package/dist/targets/native/components/paywall.js +0 -61
|
@@ -1,79 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__objRest,
|
|
4
|
+
__spreadProps,
|
|
4
5
|
__spreadValues
|
|
5
6
|
} from "../chunk-ORMEWXMH.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useId, useState } from "react";
|
|
9
|
+
import { hasContent, warnIfUnlabelled } from "./internal/field.js";
|
|
10
|
+
function Slider(_a) {
|
|
10
11
|
var _b = _a, {
|
|
12
|
+
label,
|
|
13
|
+
showValue = true,
|
|
11
14
|
value,
|
|
12
|
-
|
|
15
|
+
defaultValue,
|
|
16
|
+
onValueChange,
|
|
13
17
|
min = 0,
|
|
14
18
|
max = 100,
|
|
15
|
-
step =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
showRange = false,
|
|
19
|
-
size = "md",
|
|
19
|
+
step = 5,
|
|
20
|
+
formatValue = String,
|
|
21
|
+
id,
|
|
20
22
|
disabled,
|
|
21
|
-
className
|
|
22
|
-
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
onChange
|
|
26
|
+
} = _b, input = __objRest(_b, [
|
|
27
|
+
"label",
|
|
28
|
+
"showValue",
|
|
23
29
|
"value",
|
|
24
|
-
"
|
|
30
|
+
"defaultValue",
|
|
31
|
+
"onValueChange",
|
|
25
32
|
"min",
|
|
26
33
|
"max",
|
|
27
34
|
"step",
|
|
28
|
-
"showValue",
|
|
29
35
|
"formatValue",
|
|
30
|
-
"
|
|
31
|
-
"size",
|
|
36
|
+
"id",
|
|
32
37
|
"disabled",
|
|
33
|
-
"className"
|
|
38
|
+
"className",
|
|
39
|
+
"style",
|
|
40
|
+
"onChange"
|
|
34
41
|
]);
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onChange: (e) => onChange(Number(e.target.value)),
|
|
50
|
-
className: [
|
|
51
|
-
"rojao-slider absolute inset-0 w-full bg-transparent appearance-none cursor-pointer",
|
|
52
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-stroke-focus focus-visible:ring-offset-2 focus-visible:rounded-full",
|
|
53
|
-
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
54
|
-
].join(" "),
|
|
55
|
-
style: {
|
|
56
|
-
["--rojao-slider-pct"]: `${pct}%`,
|
|
57
|
-
["--rojao-slider-track-h"]: `${TRACK_HEIGHT[size]}px`,
|
|
58
|
-
["--rojao-slider-thumb-size"]: `${THUMB_SIZE[size]}px`
|
|
59
|
-
}
|
|
60
|
-
}, rest)
|
|
61
|
-
), /* @__PURE__ */ React.createElement(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
"aria-hidden": true,
|
|
65
|
-
className: "absolute inset-x-0 rounded-full bg-stroke-default pointer-events-none",
|
|
66
|
-
style: { height: TRACK_HEIGHT[size] }
|
|
67
|
-
}
|
|
68
|
-
), /* @__PURE__ */ React.createElement(
|
|
42
|
+
warnIfUnlabelled("Slider", label, input["aria-label"], input["aria-labelledby"]);
|
|
43
|
+
const generated = useId();
|
|
44
|
+
const controlId = id != null ? id : generated;
|
|
45
|
+
const [own, setOwn] = useState(defaultValue != null ? defaultValue : min);
|
|
46
|
+
const current = value != null ? value : own;
|
|
47
|
+
const percent = (current - min) / (max - min || 1) * 100;
|
|
48
|
+
const labelled = hasContent(label);
|
|
49
|
+
function change(event) {
|
|
50
|
+
const next = Number(event.target.value);
|
|
51
|
+
setOwn(next);
|
|
52
|
+
onChange == null ? void 0 : onChange(event);
|
|
53
|
+
onValueChange == null ? void 0 : onValueChange(next);
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
69
56
|
"div",
|
|
70
57
|
{
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
role: disabled ? "group" : void 0,
|
|
59
|
+
"aria-disabled": disabled || void 0,
|
|
60
|
+
className: ["rds-slider", disabled && "rds-slider--disabled", className].filter(Boolean).join(" "),
|
|
61
|
+
style: __spreadProps(__spreadValues({}, style), { "--_percent": `${percent}%` }),
|
|
62
|
+
children: [
|
|
63
|
+
(labelled || showValue) && /* @__PURE__ */ jsxs("div", { className: "rds-slider__label-row", children: [
|
|
64
|
+
labelled && /* @__PURE__ */ jsx("label", { htmlFor: controlId, className: "rds-slider__label", children: label }),
|
|
65
|
+
showValue && /* @__PURE__ */ jsx("span", { className: "rds-slider__value", "aria-hidden": "true", children: formatValue(current) })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
"input",
|
|
69
|
+
__spreadProps(__spreadValues({}, input), {
|
|
70
|
+
id: controlId,
|
|
71
|
+
type: "range",
|
|
72
|
+
className: "rds-slider__input",
|
|
73
|
+
min,
|
|
74
|
+
max,
|
|
75
|
+
step,
|
|
76
|
+
disabled,
|
|
77
|
+
"aria-valuetext": formatValue(current),
|
|
78
|
+
value: current,
|
|
79
|
+
onChange: change
|
|
80
|
+
})
|
|
81
|
+
)
|
|
82
|
+
]
|
|
74
83
|
}
|
|
75
|
-
)
|
|
76
|
-
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
77
86
|
export {
|
|
78
87
|
Slider
|
|
79
88
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface SparklineProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
/** The series, oldest first. The dot marks the last value. */
|
|
6
|
+
data: number[];
|
|
7
|
+
/** The previous period, drawn dashed behind (Figma: `comparison=true`). Same length as `data` reads best. */
|
|
8
|
+
previous?: number[];
|
|
9
|
+
/** Height in px. The width follows the container. */
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Sparkline — Figma [RDS] Content/Sparkline. The shape of a series in the space of a line, no axes: the trend beside
|
|
14
|
+
* a number. Always aria-hidden: the trend goes into the number's text or a Delta ("subiu 24% na semana").
|
|
15
|
+
* Styles: sparkline.css.
|
|
16
|
+
*/
|
|
17
|
+
declare function Sparkline({ data, previous, height, className, style, ...rest }: SparklineProps): react.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { Sparkline, type SparklineProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function toPoints(values, min, max, length) {
|
|
8
|
+
const span = max - min || 1;
|
|
9
|
+
const step = length > 1 ? 100 / (length - 1) : 0;
|
|
10
|
+
return values.map((value, index) => ({ x: index * step, y: 100 - (value - min) / span * 100 }));
|
|
11
|
+
}
|
|
12
|
+
const path = (points) => points.map((p, i) => `${i ? "L" : "M"}${p.x.toFixed(2)} ${p.y.toFixed(2)}`).join(" ");
|
|
13
|
+
function Sparkline(_a) {
|
|
14
|
+
var _b = _a, { data, previous, height = 32, className, style } = _b, rest = __objRest(_b, ["data", "previous", "height", "className", "style"]);
|
|
15
|
+
var _a2;
|
|
16
|
+
const all = previous ? [...data, ...previous] : data;
|
|
17
|
+
const min = Math.min(...all);
|
|
18
|
+
const max = Math.max(...all);
|
|
19
|
+
const length = Math.max(data.length, (_a2 = previous == null ? void 0 : previous.length) != null ? _a2 : 0);
|
|
20
|
+
const current = toPoints(data, min, max, length);
|
|
21
|
+
const last = current[current.length - 1];
|
|
22
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ "aria-hidden": "true" }, rest), { className: ["rds-sparkline", className].filter(Boolean).join(" "), style: __spreadValues({ height }, style), children: /* @__PURE__ */ jsxs("div", { className: "rds-sparkline__area", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("svg", { className: "rds-sparkline__svg", viewBox: "0 0 100 100", preserveAspectRatio: "none", focusable: "false", children: [
|
|
24
|
+
previous && /* @__PURE__ */ jsx("path", { className: "rds-sparkline__previous", d: path(toPoints(previous, min, max, length)) }),
|
|
25
|
+
/* @__PURE__ */ jsx("path", { className: "rds-sparkline__line", d: path(current) })
|
|
26
|
+
] }),
|
|
27
|
+
last && /* @__PURE__ */ jsx("span", { className: "rds-sparkline__dot", style: { left: `${last.x}%`, top: `${last.y}%` } })
|
|
28
|
+
] }) }));
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
Sparkline
|
|
32
|
+
};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
2
3
|
|
|
3
|
-
type SpinnerSize = '
|
|
4
|
-
type
|
|
5
|
-
interface SpinnerProps {
|
|
4
|
+
type SpinnerSize = 'sm' | 'default' | 'lg';
|
|
5
|
+
type SpinnerTone = 'default' | 'inverse';
|
|
6
|
+
interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
7
|
+
/** sm 16 (inside a button or field), default 24 (next to text), lg 32 (alone in an empty area). */
|
|
6
8
|
size?: SpinnerSize;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
/** default on light surfaces; inverse on the dark brand band or a dark veil. */
|
|
10
|
+
tone?: SpinnerTone;
|
|
11
|
+
/** What is happening (Figma: `label`). Always the accessible name; shown next to the ring with `showLabel`. */
|
|
9
12
|
label?: string;
|
|
10
|
-
|
|
13
|
+
/** Show the label next to the ring (Figma: `showLabel`). */
|
|
14
|
+
showLabel?: boolean;
|
|
11
15
|
}
|
|
12
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Spinner — Figma [RDS] Indicators/Spinner. A wait without a known end (role="status"): a ring and a turning quarter
|
|
18
|
+
* arc. When the wait can be measured, use the Progress. Styles: spinner.css.
|
|
19
|
+
*/
|
|
20
|
+
declare function Spinner({ size, tone, label, showLabel, className, ...rest }: SpinnerProps): react.JSX.Element;
|
|
13
21
|
|
|
14
|
-
export { Spinner, type
|
|
22
|
+
export { Spinner, type SpinnerProps, type SpinnerSize, type SpinnerTone };
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
"
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Spinner(_a) {
|
|
8
|
+
var _b = _a, {
|
|
9
|
+
size = "default",
|
|
10
|
+
tone = "default",
|
|
11
|
+
label = "Carregando\u2026",
|
|
12
|
+
showLabel = false,
|
|
13
|
+
className
|
|
14
|
+
} = _b, rest = __objRest(_b, [
|
|
15
|
+
"size",
|
|
16
|
+
"tone",
|
|
17
|
+
"label",
|
|
18
|
+
"showLabel",
|
|
19
|
+
"className"
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"span",
|
|
23
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
24
|
+
role: "status",
|
|
25
|
+
"aria-label": showLabel ? void 0 : label,
|
|
26
|
+
className: ["rds-spinner", `rds-spinner--${size}`, `rds-spinner--${tone}`, className].filter(Boolean).join(" "),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("svg", { className: "rds-spinner__ring", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("circle", { className: "rds-spinner__track", cx: "12", cy: "12", r: "10.5", fill: "none", strokeWidth: "3" }),
|
|
30
|
+
/* @__PURE__ */ jsx("path", { className: "rds-spinner__indicator", d: "M12 1.5 A10.5 10.5 0 0 1 22.5 12", fill: "none", strokeWidth: "3", strokeLinecap: "round" })
|
|
31
|
+
] }),
|
|
32
|
+
showLabel && /* @__PURE__ */ jsx("span", { className: "rds-spinner__label", children: label })
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
);
|
|
33
36
|
}
|
|
34
37
|
export {
|
|
35
38
|
Spinner
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type StarRatingSize = 'sm' | 'default' | 'lg';
|
|
5
|
+
interface StarRatingProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
6
|
+
/** 0 to 5, rounded to the nearest half (Figma: `value`). */
|
|
7
|
+
value: number;
|
|
8
|
+
/** sm: 16 stars and 12 text; default: 20 and 14; lg: 24 and 14 (Figma: `size`). */
|
|
9
|
+
size?: StarRatingSize;
|
|
10
|
+
/**
|
|
11
|
+
* The written grade, such as the value and how many reviews (Figma: `showLabel` + `label`): "4,5 (128
|
|
12
|
+
* avaliações)". Show it: the yellow star alone has too little contrast to be the only cue.
|
|
13
|
+
*/
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* StarRating — Figma [RDS] Indicators/StarRating. The average rating in stars, read only: the stars are one image
|
|
18
|
+
* named "Nota 4,5 de 5". For the person to give a grade, it is another component. Styles: star-rating.css.
|
|
19
|
+
*/
|
|
20
|
+
declare function StarRating({ value, size, label, className, ...rest }: StarRatingProps): react.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { StarRating, type StarRatingProps, type StarRatingSize };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { StarFilledIcon, StarIcon } from "./internal/icons.js";
|
|
8
|
+
const format = (n) => n.toLocaleString("pt-BR", { maximumFractionDigits: 1 });
|
|
9
|
+
function StarRating(_a) {
|
|
10
|
+
var _b = _a, { value, size = "default", label, className } = _b, rest = __objRest(_b, ["value", "size", "label", "className"]);
|
|
11
|
+
const rounded = Math.round(Math.min(Math.max(value, 0), 5) * 2) / 2;
|
|
12
|
+
return /* @__PURE__ */ jsxs("span", __spreadProps(__spreadValues({}, rest), { className: ["rds-rating", `rds-rating--${size}`, className].filter(Boolean).join(" "), children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", { className: "rds-rating__stars", role: "img", "aria-label": `Nota ${format(rounded)} de 5`, children: [1, 2, 3, 4, 5].map((i) => {
|
|
14
|
+
const fill = rounded >= i ? "full" : rounded >= i - 0.5 ? "half" : "empty";
|
|
15
|
+
return /* @__PURE__ */ jsxs("span", { className: `rds-rating__star rds-rating__star--${fill}`, "aria-hidden": "true", children: [
|
|
16
|
+
fill !== "full" && /* @__PURE__ */ jsx("span", { className: "rds-rating__empty", children: /* @__PURE__ */ jsx(StarIcon, {}) }),
|
|
17
|
+
fill !== "empty" && /* @__PURE__ */ jsx("span", { className: "rds-rating__fill", children: /* @__PURE__ */ jsx(StarFilledIcon, {}) })
|
|
18
|
+
] }, i);
|
|
19
|
+
}) }),
|
|
20
|
+
label && /* @__PURE__ */ jsx("span", { className: "rds-rating__label", children: label })
|
|
21
|
+
] }));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
StarRating
|
|
25
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** What the number means: money in (positive), a loss or a lack (negative), a counter that asks for attention, zero. */
|
|
5
|
+
type StatTone = 'default' | 'positive' | 'negative' | 'warning' | 'muted';
|
|
6
|
+
interface StatProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
|
+
/** What is counted (Figma: `label`): "Pedidos no mês". */
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
/** The number, already formatted by the caller (Figma: `value`): "1.284", "R$ 48.320". */
|
|
10
|
+
value: ReactNode;
|
|
11
|
+
/** Paints the number (Figma: `tone`). */
|
|
12
|
+
tone?: StatTone;
|
|
13
|
+
/** A line under the number (Figma: `showCaption` + `caption`): "vs. 1.142 em agosto". */
|
|
14
|
+
caption?: ReactNode;
|
|
15
|
+
/** The change, a Delta beside the number (Figma: `showDelta` + the exposed Delta). */
|
|
16
|
+
delta?: ReactNode;
|
|
17
|
+
/** The trend, a Sparkline under the text (Figma: `showSparkline` + the exposed Sparkline). */
|
|
18
|
+
sparkline?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* On its own card surface with a border (Figma: `framed=true`, the default). Inside a SummaryBar it is false by
|
|
21
|
+
* default: the cell of the strip, no border.
|
|
22
|
+
*/
|
|
23
|
+
framed?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Set by the SummaryBar: a Stat inside it is a cell (framed=false) unless it says otherwise. */
|
|
26
|
+
declare const StatFramedDefault: react.Context<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* Stat — Figma [RDS] Content/Stat. A number that matters, with its label, the change (Delta) and, when it helps,
|
|
29
|
+
* the trend (Sparkline). Alone it is a card; in a SummaryBar it is a cell. Styles: stat.css.
|
|
30
|
+
*/
|
|
31
|
+
declare function Stat({ label, value, tone, caption, delta, sparkline, framed, className, ...rest }: StatProps): react.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { Stat, StatFramedDefault, type StatProps, type StatTone };
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { createContext, useContext } from "react";
|
|
9
|
+
const StatFramedDefault = createContext(true);
|
|
10
|
+
function Stat(_a) {
|
|
11
|
+
var _b = _a, { label, value, tone = "default", caption, delta, sparkline, framed, className } = _b, rest = __objRest(_b, ["label", "value", "tone", "caption", "delta", "sparkline", "framed", "className"]);
|
|
12
|
+
const framedDefault = useContext(StatFramedDefault);
|
|
13
|
+
const isFramed = framed != null ? framed : framedDefault;
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, rest), { className: ["rds-stat", `rds-stat--${tone}`, isFramed && "rds-stat--framed", className].filter(Boolean).join(" "), children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("div", { className: "rds-stat__pair", children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: "rds-stat__label", children: label }),
|
|
17
|
+
/* @__PURE__ */ jsxs("span", { className: "rds-stat__row", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("span", { className: "rds-stat__value", children: value }),
|
|
19
|
+
delta
|
|
20
|
+
] }),
|
|
21
|
+
caption && /* @__PURE__ */ jsx("span", { className: "rds-stat__caption", children: caption })
|
|
22
|
+
] }),
|
|
23
|
+
sparkline
|
|
24
|
+
] }));
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
Stat,
|
|
28
|
+
StatFramedDefault
|
|
29
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type StatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
5
|
+
/**
|
|
6
|
+
* Figma calls this property `style`: outline (white pill with a hairline, for coloured bands), soft (light plate
|
|
7
|
+
* with the tone's dark text, for dark backgrounds), fill (the tone's plate, for neutral backgrounds).
|
|
8
|
+
*/
|
|
9
|
+
type StatusVariant = 'outline' | 'soft' | 'fill';
|
|
10
|
+
type StatusSize = 'default' | 'sm';
|
|
11
|
+
interface StatusProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
12
|
+
/** The state, in one or two words (Figma: `label`). The text says the state; the dot only adds colour. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/** neutral (a record: draft, closed), info (in progress), success (done), warning (pending), danger (failed). */
|
|
15
|
+
tone?: StatusTone;
|
|
16
|
+
variant?: StatusVariant;
|
|
17
|
+
/** default 32 tall; sm 24 (dot 6), for narrow cards and table rows. */
|
|
18
|
+
size?: StatusSize;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Status — Figma [RDS] Indicators/Status. A state that changes over time ("Em análise", "Concluído"): a pill with a
|
|
22
|
+
* dot and the word. A fixed attribute is a Badge. When it changes without a reload, put aria-live="polite" on the
|
|
23
|
+
* surrounding region, not here. Styles: status.css.
|
|
24
|
+
*/
|
|
25
|
+
declare function Status({ tone, variant, size, children, className, ...rest }: StatusProps): react.JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { Status, type StatusProps, type StatusSize, type StatusTone, type StatusVariant };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Status(_a) {
|
|
8
|
+
var _b = _a, {
|
|
9
|
+
tone = "neutral",
|
|
10
|
+
variant = "outline",
|
|
11
|
+
size = "default",
|
|
12
|
+
children,
|
|
13
|
+
className
|
|
14
|
+
} = _b, rest = __objRest(_b, [
|
|
15
|
+
"tone",
|
|
16
|
+
"variant",
|
|
17
|
+
"size",
|
|
18
|
+
"children",
|
|
19
|
+
"className"
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"span",
|
|
23
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
24
|
+
className: ["rds-status", `rds-status--${tone}-${variant}`, `rds-status--${size}`, className].filter(Boolean).join(" "),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "rds-status__dot", "aria-hidden": "true" }),
|
|
27
|
+
children
|
|
28
|
+
]
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
Status
|
|
34
|
+
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
2
3
|
|
|
3
|
-
interface StepProgressProps {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
/**
|
|
4
|
+
interface StepProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
+
/** The step the person is on, from 1 (Figma: `step`, "2 of 4"). */
|
|
6
|
+
step: number;
|
|
7
|
+
/** How many steps the flow has (Figma: the "of 4"). */
|
|
7
8
|
total: number;
|
|
8
|
-
|
|
9
|
+
/** The bar's name for screen readers: what the flow is. */
|
|
10
|
+
'aria-label'?: string;
|
|
9
11
|
}
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* StepProgress — Figma [RDS] Indicators/StepProgress. The thin bar of a flow in steps (sign-up, onboarding): how much
|
|
14
|
+
* is done. It has no text; "Passo 2 de 4" goes outside, in the title. Read as a progressbar, "Passo 2 de 4".
|
|
15
|
+
* Named steps are the Stepper. Styles: step-progress.css.
|
|
16
|
+
*/
|
|
17
|
+
declare function StepProgress({ step, total, className, 'aria-label': ariaLabel, ...rest }: StepProgressProps): react.JSX.Element;
|
|
11
18
|
|
|
12
19
|
export { StepProgress, type StepProgressProps };
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../chunk-ORMEWXMH.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function StepProgress(_a) {
|
|
8
|
+
var _b = _a, { step, total, className, "aria-label": ariaLabel = "Progresso" } = _b, rest = __objRest(_b, ["step", "total", "className", "aria-label"]);
|
|
9
|
+
const safeTotal = Math.max(1, total);
|
|
10
|
+
const current = Math.min(Math.max(step, 0), safeTotal);
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
5
12
|
"div",
|
|
6
|
-
{
|
|
7
|
-
className: ["
|
|
13
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
14
|
+
className: ["rds-step-progress", className].filter(Boolean).join(" "),
|
|
8
15
|
role: "progressbar",
|
|
9
|
-
"aria-
|
|
10
|
-
"aria-
|
|
11
|
-
"aria-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"div",
|
|
15
|
-
|
|
16
|
-
className: "h-full rounded-full transition-all duration-300 ease-out [background:var(--brand-primary)]",
|
|
17
|
-
style: { width: `${pct}%` }
|
|
18
|
-
}
|
|
19
|
-
)
|
|
16
|
+
"aria-label": ariaLabel,
|
|
17
|
+
"aria-valuenow": current,
|
|
18
|
+
"aria-valuemin": 0,
|
|
19
|
+
"aria-valuemax": safeTotal,
|
|
20
|
+
"aria-valuetext": `Passo ${current} de ${safeTotal}`,
|
|
21
|
+
children: /* @__PURE__ */ jsx("div", { className: "rds-step-progress__fill", style: { width: `${current / safeTotal * 100}%` } })
|
|
22
|
+
})
|
|
20
23
|
);
|
|
21
24
|
}
|
|
22
25
|
export {
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { StatTone } from './stat.js';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
/** @deprecated Use StatTone. */
|
|
6
|
+
type SummaryBarTone = StatTone;
|
|
7
|
+
/** @deprecated Pass Stats as children. */
|
|
5
8
|
interface SummaryBarItem {
|
|
6
|
-
/** Short label, e.g. "Valor em estoque" */
|
|
7
9
|
label: string;
|
|
8
|
-
/** Pre-formatted value (currency, count, etc.) — formatting is the consumer's job */
|
|
9
10
|
value: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Optional leading icon shown before the value */
|
|
11
|
+
tone?: StatTone;
|
|
12
|
+
/** Ignored: the Stat has no icon in the Figma [RDS]. */
|
|
13
13
|
icon?: ReactNode;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/** row: the wide screen, the cells share the width (many scroll sideways). grid: the phone, two columns. */
|
|
16
|
+
type SummaryBarLayout = 'row' | 'grid';
|
|
17
|
+
interface SummaryBarProps extends Omit<HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
18
|
+
/** The Stats (Figma: slot `items`). Inside the bar a Stat is a cell (framed=false) by default. */
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/** Figma: `layout`. In grid, the last cell takes the whole line when the count is odd. */
|
|
21
|
+
layout?: SummaryBarLayout;
|
|
22
|
+
/** @deprecated Pass Stats as children. Kept so 1.x code compiles; the icon is dropped. */
|
|
23
|
+
items?: SummaryBarItem[];
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
21
|
-
* report
|
|
22
|
-
* flex com scroll horizontal se precisar. Contagem ímpar → último item ocupa a linha
|
|
23
|
-
* inteira no mobile (sem célula vazia). Valores são pré-formatados pelo consumidor.
|
|
24
|
-
*
|
|
25
|
-
* Truque do divisor: no mobile, o fundo do CONTAINER é a cor do divisor e o gap-px
|
|
26
|
-
* revela essa cor entre as células (cada célula tem o fundo normal) → linhas de grade
|
|
27
|
-
* limpas. No sm+, o fundo volta ao normal e os divisores são border-left por item.
|
|
26
|
+
* SummaryBar — Figma [RDS] Content/SummaryBar. The strip of aggregated numbers above a list (stock, finance,
|
|
27
|
+
* report): Stats 1px apart, the gap showing summary-bar/divider. A list: each Stat is an item. Styles: summary-bar.css.
|
|
28
28
|
*/
|
|
29
|
-
declare function SummaryBar({ items, className }: SummaryBarProps): react.JSX.Element;
|
|
29
|
+
declare function SummaryBar({ children, layout, items, className, ...rest }: SummaryBarProps): react.JSX.Element;
|
|
30
30
|
|
|
31
|
-
export { SummaryBar, type SummaryBarItem, type SummaryBarProps, type SummaryBarTone };
|
|
31
|
+
export { SummaryBar, type SummaryBarItem, type SummaryBarLayout, type SummaryBarProps, type SummaryBarTone };
|