@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,18 +1,22 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
import { Pressable } from "react-native";
|
|
4
5
|
import { Menu } from "./menu.js";
|
|
5
6
|
function ContextMenu({ items, children }) {
|
|
6
7
|
const [visible, setVisible] = useState(false);
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ jsx(
|
|
10
|
+
Pressable,
|
|
11
|
+
{
|
|
12
|
+
onLongPress: () => setVisible(true),
|
|
13
|
+
accessibilityHint: "Mantenha pressionado para abrir as a\xE7\xF5es",
|
|
14
|
+
delayLongPress: 350,
|
|
15
|
+
children
|
|
16
|
+
}
|
|
17
|
+
),
|
|
18
|
+
/* @__PURE__ */ jsx(Menu, { visible, onClose: () => setVisible(false), items })
|
|
19
|
+
] });
|
|
16
20
|
}
|
|
17
21
|
export {
|
|
18
22
|
ContextMenu
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { useState } from "react";
|
|
6
7
|
import { StyleSheet, TextInput, View } from "react-native";
|
|
7
8
|
import { Text } from "./text.js";
|
|
@@ -51,7 +52,7 @@ function CurrencyInput(_a) {
|
|
|
51
52
|
const digits = text.replace(/\D/g, "").slice(0, 12);
|
|
52
53
|
onChangeValueCents(digits ? parseInt(digits, 10) : 0);
|
|
53
54
|
}
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
55
56
|
View,
|
|
56
57
|
{
|
|
57
58
|
style: [
|
|
@@ -62,31 +63,33 @@ function CurrencyInput(_a) {
|
|
|
62
63
|
opacity: disabled ? 0.5 : 1
|
|
63
64
|
},
|
|
64
65
|
style
|
|
66
|
+
],
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Text, { variant: "body", color: "muted", style: { marginRight: 6 }, children: currency }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
TextInput,
|
|
71
|
+
__spreadValues({
|
|
72
|
+
value: display,
|
|
73
|
+
onChangeText: handle,
|
|
74
|
+
keyboardType: "number-pad",
|
|
75
|
+
editable: !disabled,
|
|
76
|
+
accessibilityLabel: accessibilityLabel != null ? accessibilityLabel : label,
|
|
77
|
+
accessibilityState: { disabled: !!disabled },
|
|
78
|
+
selectTextOnFocus: true,
|
|
79
|
+
placeholderTextColor: t["--text-placeholder"],
|
|
80
|
+
onFocus: (e) => {
|
|
81
|
+
setFocused(true);
|
|
82
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
83
|
+
},
|
|
84
|
+
onBlur: (e) => {
|
|
85
|
+
setFocused(false);
|
|
86
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
87
|
+
},
|
|
88
|
+
style: [styles.input, { color: disabled ? t["--text-disabled"] : t["--text-primary"] }]
|
|
89
|
+
}, rest)
|
|
90
|
+
)
|
|
65
91
|
]
|
|
66
|
-
}
|
|
67
|
-
/* @__PURE__ */ React.createElement(Text, { variant: "body", color: "muted", style: { marginRight: 6 } }, currency),
|
|
68
|
-
/* @__PURE__ */ React.createElement(
|
|
69
|
-
TextInput,
|
|
70
|
-
__spreadValues({
|
|
71
|
-
value: display,
|
|
72
|
-
onChangeText: handle,
|
|
73
|
-
keyboardType: "number-pad",
|
|
74
|
-
editable: !disabled,
|
|
75
|
-
accessibilityLabel: accessibilityLabel != null ? accessibilityLabel : label,
|
|
76
|
-
accessibilityState: { disabled: !!disabled },
|
|
77
|
-
selectTextOnFocus: true,
|
|
78
|
-
placeholderTextColor: t["--text-placeholder"],
|
|
79
|
-
onFocus: (e) => {
|
|
80
|
-
setFocused(true);
|
|
81
|
-
onFocus == null ? void 0 : onFocus(e);
|
|
82
|
-
},
|
|
83
|
-
onBlur: (e) => {
|
|
84
|
-
setFocused(false);
|
|
85
|
-
onBlur == null ? void 0 : onBlur(e);
|
|
86
|
-
},
|
|
87
|
-
style: [styles.input, { color: disabled ? t["--text-disabled"] : t["--text-primary"] }]
|
|
88
|
-
}, rest)
|
|
89
|
-
)
|
|
92
|
+
}
|
|
90
93
|
);
|
|
91
94
|
}
|
|
92
95
|
const styles = StyleSheet.create({
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { StyleSheet, View } from "react-native";
|
|
3
4
|
import { Text } from "./text.js";
|
|
4
5
|
import { useTheme } from "./theme.js";
|
|
5
6
|
function DangerZone({ title, description, children, style }) {
|
|
6
7
|
const t = useTheme();
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
8
9
|
View,
|
|
9
10
|
{
|
|
10
11
|
style: [
|
|
11
12
|
styles.box,
|
|
12
13
|
{ backgroundColor: t["--danger-soft"], borderColor: t["--danger-border"] },
|
|
13
14
|
style
|
|
15
|
+
],
|
|
16
|
+
children: [
|
|
17
|
+
(title || description) && /* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
18
|
+
title ? /* @__PURE__ */ jsx(Text, { variant: "label", color: "danger", children: title }) : null,
|
|
19
|
+
description ? /* @__PURE__ */ jsx(Text, { variant: "caption", color: "danger", style: styles.description, children: description }) : null
|
|
20
|
+
] }),
|
|
21
|
+
children
|
|
14
22
|
]
|
|
15
|
-
}
|
|
16
|
-
(title || description) && /* @__PURE__ */ React.createElement(View, { style: styles.header }, title ? /* @__PURE__ */ React.createElement(Text, { variant: "label", color: "danger" }, title) : null, description ? /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "danger", style: styles.description }, description) : null),
|
|
17
|
-
children
|
|
23
|
+
}
|
|
18
24
|
);
|
|
19
25
|
}
|
|
20
26
|
const styles = StyleSheet.create({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Calendar, ChevronLeft, ChevronRight } from "lucide-react-native";
|
|
3
4
|
import { useState } from "react";
|
|
4
5
|
import { Modal, Pressable, StyleSheet, View } from "react-native";
|
|
@@ -76,79 +77,94 @@ function DatePicker({ value, onChange, min, max, placeholder, disabled }) {
|
|
|
76
77
|
setOpen(false);
|
|
77
78
|
}
|
|
78
79
|
const cells = monthGrid(viewYear, viewMonth);
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
onPress: openPicker,
|
|
83
|
-
disabled,
|
|
84
|
-
accessibilityRole: "button",
|
|
85
|
-
accessibilityLabel: value ? `Data: ${formatLong(value)}` : placeholder != null ? placeholder : "Selecione uma data",
|
|
86
|
-
accessibilityState: { disabled: !!disabled },
|
|
87
|
-
style: [
|
|
88
|
-
styles.field,
|
|
89
|
-
{
|
|
90
|
-
borderColor: t["--border-default"],
|
|
91
|
-
backgroundColor: t["--surface-default"],
|
|
92
|
-
opacity: disabled ? 0.5 : 1
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
/* @__PURE__ */ React.createElement(Text, { variant: "body", color: value ? "primary" : "muted", style: { flex: 1 } }, value ? formatDate(value) : placeholder != null ? placeholder : "Selecione uma data"),
|
|
97
|
-
/* @__PURE__ */ React.createElement(Calendar, { size: 20, color: t["--text-muted"] })
|
|
98
|
-
), /* @__PURE__ */ React.createElement(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: () => setOpen(false) }, /* @__PURE__ */ React.createElement(Pressable, { style: styles.backdrop, onPress: () => setOpen(false) }, /* @__PURE__ */ React.createElement(
|
|
99
|
-
Pressable,
|
|
100
|
-
{
|
|
101
|
-
style: [styles.card, { backgroundColor: t["--surface-default"] }],
|
|
102
|
-
onPress: (e) => e.stopPropagation(),
|
|
103
|
-
accessibilityViewIsModal: true
|
|
104
|
-
},
|
|
105
|
-
/* @__PURE__ */ React.createElement(View, { style: styles.header }, /* @__PURE__ */ React.createElement(Pressable, { onPress: () => shiftMonth(-1), hitSlop: 8, accessibilityRole: "button", accessibilityLabel: "M\xEAs anterior", style: styles.navBtn }, /* @__PURE__ */ React.createElement(ChevronLeft, { size: 22, color: t["--text-primary"] })), /* @__PURE__ */ React.createElement(Text, { variant: "label" }, MONTHS[viewMonth], " ", viewYear), /* @__PURE__ */ React.createElement(Pressable, { onPress: () => shiftMonth(1), hitSlop: 8, accessibilityRole: "button", accessibilityLabel: "Pr\xF3ximo m\xEAs", style: styles.navBtn }, /* @__PURE__ */ React.createElement(ChevronRight, { size: 22, color: t["--text-primary"] }))),
|
|
106
|
-
/* @__PURE__ */ React.createElement(View, { style: styles.week }, WEEKDAYS.map((w, i) => /* @__PURE__ */ React.createElement(View, { key: i, style: styles.cell }, /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "muted" }, w)))),
|
|
107
|
-
/* @__PURE__ */ React.createElement(View, { style: styles.grid }, cells.map((d, i) => {
|
|
108
|
-
if (!d) return /* @__PURE__ */ React.createElement(View, { key: i, style: styles.cell });
|
|
109
|
-
const selected = value ? sameDay(d, value) : false;
|
|
110
|
-
const off = isDisabled(d);
|
|
111
|
-
return /* @__PURE__ */ React.createElement(
|
|
112
|
-
Pressable,
|
|
113
|
-
{
|
|
114
|
-
key: i,
|
|
115
|
-
onPress: () => pick(d),
|
|
116
|
-
disabled: off,
|
|
117
|
-
accessibilityRole: "button",
|
|
118
|
-
accessibilityLabel: formatLong(d),
|
|
119
|
-
accessibilityState: { selected, disabled: off },
|
|
120
|
-
style: [
|
|
121
|
-
styles.cell,
|
|
122
|
-
styles.day,
|
|
123
|
-
selected ? { backgroundColor: t["--brand-primary"] } : null
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
|
-
/* @__PURE__ */ React.createElement(
|
|
127
|
-
Text,
|
|
128
|
-
{
|
|
129
|
-
variant: "body-sm",
|
|
130
|
-
style: {
|
|
131
|
-
color: selected ? t["--brand-on-primary"] : off ? t["--text-placeholder"] : t["--text-primary"]
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
d.getDate()
|
|
135
|
-
)
|
|
136
|
-
);
|
|
137
|
-
})),
|
|
138
|
-
value && /* @__PURE__ */ React.createElement(
|
|
80
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
81
|
+
/* @__PURE__ */ jsxs(
|
|
139
82
|
Pressable,
|
|
140
83
|
{
|
|
141
|
-
onPress:
|
|
142
|
-
|
|
143
|
-
setOpen(false);
|
|
144
|
-
},
|
|
84
|
+
onPress: openPicker,
|
|
85
|
+
disabled,
|
|
145
86
|
accessibilityRole: "button",
|
|
146
|
-
accessibilityLabel: "
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
87
|
+
accessibilityLabel: value ? `Data: ${formatLong(value)}` : placeholder != null ? placeholder : "Selecione uma data",
|
|
88
|
+
accessibilityState: { disabled: !!disabled },
|
|
89
|
+
style: [
|
|
90
|
+
styles.field,
|
|
91
|
+
{
|
|
92
|
+
borderColor: t["--border-default"],
|
|
93
|
+
backgroundColor: t["--surface-default"],
|
|
94
|
+
opacity: disabled ? 0.5 : 1
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx(Text, { variant: "body", color: value ? "primary" : "muted", style: { flex: 1 }, children: value ? formatDate(value) : placeholder != null ? placeholder : "Selecione uma data" }),
|
|
99
|
+
/* @__PURE__ */ jsx(Calendar, { size: 20, color: t["--text-muted"] })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: () => setOpen(false), children: /* @__PURE__ */ jsx(Pressable, { style: styles.backdrop, onPress: () => setOpen(false), children: /* @__PURE__ */ jsxs(
|
|
104
|
+
Pressable,
|
|
105
|
+
{
|
|
106
|
+
style: [styles.card, { backgroundColor: t["--surface-default"] }],
|
|
107
|
+
onPress: (e) => e.stopPropagation(),
|
|
108
|
+
accessibilityViewIsModal: true,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => shiftMonth(-1), hitSlop: 8, accessibilityRole: "button", accessibilityLabel: "M\xEAs anterior", style: styles.navBtn, children: /* @__PURE__ */ jsx(ChevronLeft, { size: 22, color: t["--text-primary"] }) }),
|
|
112
|
+
/* @__PURE__ */ jsxs(Text, { variant: "label", children: [
|
|
113
|
+
MONTHS[viewMonth],
|
|
114
|
+
" ",
|
|
115
|
+
viewYear
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => shiftMonth(1), hitSlop: 8, accessibilityRole: "button", accessibilityLabel: "Pr\xF3ximo m\xEAs", style: styles.navBtn, children: /* @__PURE__ */ jsx(ChevronRight, { size: 22, color: t["--text-primary"] }) })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsx(View, { style: styles.week, children: WEEKDAYS.map((w, i) => /* @__PURE__ */ jsx(View, { style: styles.cell, children: /* @__PURE__ */ jsx(Text, { variant: "caption", color: "muted", children: w }) }, i)) }),
|
|
120
|
+
/* @__PURE__ */ jsx(View, { style: styles.grid, children: cells.map((d, i) => {
|
|
121
|
+
if (!d) return /* @__PURE__ */ jsx(View, { style: styles.cell }, i);
|
|
122
|
+
const selected = value ? sameDay(d, value) : false;
|
|
123
|
+
const off = isDisabled(d);
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
Pressable,
|
|
126
|
+
{
|
|
127
|
+
onPress: () => pick(d),
|
|
128
|
+
disabled: off,
|
|
129
|
+
accessibilityRole: "button",
|
|
130
|
+
accessibilityLabel: formatLong(d),
|
|
131
|
+
accessibilityState: { selected, disabled: off },
|
|
132
|
+
style: [
|
|
133
|
+
styles.cell,
|
|
134
|
+
styles.day,
|
|
135
|
+
selected ? { backgroundColor: t["--brand-primary"] } : null
|
|
136
|
+
],
|
|
137
|
+
children: /* @__PURE__ */ jsx(
|
|
138
|
+
Text,
|
|
139
|
+
{
|
|
140
|
+
variant: "body-sm",
|
|
141
|
+
style: {
|
|
142
|
+
color: selected ? t["--brand-on-primary"] : off ? t["--text-placeholder"] : t["--text-primary"]
|
|
143
|
+
},
|
|
144
|
+
children: d.getDate()
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
},
|
|
148
|
+
i
|
|
149
|
+
);
|
|
150
|
+
}) }),
|
|
151
|
+
value && /* @__PURE__ */ jsx(
|
|
152
|
+
Pressable,
|
|
153
|
+
{
|
|
154
|
+
onPress: () => {
|
|
155
|
+
onChange(null);
|
|
156
|
+
setOpen(false);
|
|
157
|
+
},
|
|
158
|
+
accessibilityRole: "button",
|
|
159
|
+
accessibilityLabel: "Limpar data",
|
|
160
|
+
style: styles.clear,
|
|
161
|
+
children: /* @__PURE__ */ jsx(Text, { variant: "body-sm", color: "muted", children: "Limpar" })
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
) }) })
|
|
167
|
+
] });
|
|
152
168
|
}
|
|
153
169
|
const styles = StyleSheet.create({
|
|
154
170
|
field: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { StyleSheet, View } from "react-native";
|
|
3
4
|
import { useTheme } from "./theme.js";
|
|
4
5
|
function Divider({ vertical, spacing }) {
|
|
5
6
|
const t = useTheme();
|
|
6
7
|
const hairline = StyleSheet.hairlineWidth;
|
|
7
8
|
if (vertical) {
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
9
10
|
View,
|
|
10
11
|
{
|
|
11
12
|
accessibilityRole: "none",
|
|
@@ -18,7 +19,7 @@ function Divider({ vertical, spacing }) {
|
|
|
18
19
|
}
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
22
23
|
View,
|
|
23
24
|
{
|
|
24
25
|
accessibilityRole: "none",
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { Button } from "./button.js";
|
|
4
5
|
import { Text } from "./text.js";
|
|
5
6
|
function EmptyState({ title, description, cta }) {
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsxs(View, { style: { flex: 1, alignItems: "center", justifyContent: "center", gap: 12, paddingHorizontal: 32 }, children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Text, { variant: "title", style: { textAlign: "center" }, children: title }),
|
|
9
|
+
description ? /* @__PURE__ */ jsx(Text, { variant: "body-sm", color: "muted", style: { textAlign: "center" }, children: description }) : null,
|
|
10
|
+
cta ? /* @__PURE__ */ jsx(Button, { label: cta.label, onPress: cta.onPress, fullWidth: true }) : null
|
|
11
|
+
] });
|
|
7
12
|
}
|
|
8
13
|
export {
|
|
9
14
|
EmptyState
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../../chunk-ORMEWXMH.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { Plus } from "lucide-react-native";
|
|
5
6
|
import {
|
|
6
7
|
cloneElement,
|
|
@@ -30,37 +31,39 @@ function FAB({
|
|
|
30
31
|
const t = useTheme();
|
|
31
32
|
const insets = useSafeAreaInsets();
|
|
32
33
|
const fg = t["--brand-on-primary"];
|
|
33
|
-
const glyph = tintIcon(icon != null ? icon : /* @__PURE__ */
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
const glyph = tintIcon(icon != null ? icon : /* @__PURE__ */ jsx(Plus, {}), fg, 24);
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
35
36
|
View,
|
|
36
37
|
{
|
|
37
38
|
pointerEvents: "box-none",
|
|
38
39
|
style: [
|
|
39
40
|
styles.anchor,
|
|
40
41
|
{ right: 16, bottom: (insets.bottom > 0 ? insets.bottom : 16) + 16 }
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
],
|
|
43
|
+
children: /* @__PURE__ */ jsxs(
|
|
44
|
+
Pressable,
|
|
45
|
+
{
|
|
46
|
+
accessibilityRole: "button",
|
|
47
|
+
accessibilityLabel,
|
|
48
|
+
accessibilityState: { disabled },
|
|
49
|
+
disabled,
|
|
50
|
+
hitSlop: 8,
|
|
51
|
+
onPress,
|
|
52
|
+
style: ({ pressed }) => [
|
|
53
|
+
styles.base,
|
|
54
|
+
extended ? styles.extended : styles.circle,
|
|
55
|
+
{
|
|
56
|
+
backgroundColor: t["--brand-primary"],
|
|
57
|
+
opacity: disabled ? 0.5 : pressed ? 0.85 : 1
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
children: [
|
|
61
|
+
glyph,
|
|
62
|
+
extended && label ? /* @__PURE__ */ jsx(Text, { style: [styles.label, { color: fg }], numberOfLines: 1, children: label }) : null
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
64
67
|
);
|
|
65
68
|
}
|
|
66
69
|
const FABContext = createContext({
|
|
@@ -71,7 +74,10 @@ const FABContext = createContext({
|
|
|
71
74
|
function FABProvider({ children }) {
|
|
72
75
|
const [config, setConfig] = useState(null);
|
|
73
76
|
const setFAB = useCallback((next) => setConfig(next), []);
|
|
74
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ jsxs(FABContext.Provider, { value: { config, setFAB }, children: [
|
|
78
|
+
children,
|
|
79
|
+
config ? /* @__PURE__ */ jsx(FAB, __spreadValues({}, config)) : null
|
|
80
|
+
] });
|
|
75
81
|
}
|
|
76
82
|
function useFAB() {
|
|
77
83
|
return useContext(FABContext);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
3
4
|
import { Text } from "./text.js";
|
|
4
5
|
import { useTheme } from "./theme.js";
|
|
@@ -7,7 +8,7 @@ function FilterChip({ label, active, onPress, disabled = false }) {
|
|
|
7
8
|
const bg = active ? t["--brand-primary"] : t["--surface-default"];
|
|
8
9
|
const fg = active ? t["--brand-on-primary"] : t["--text-primary"];
|
|
9
10
|
const border = active ? t["--brand-primary"] : t["--border-default"];
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
11
12
|
Pressable,
|
|
12
13
|
{
|
|
13
14
|
onPress: disabled ? void 0 : onPress,
|
|
@@ -23,9 +24,9 @@ function FilterChip({ label, active, onPress, disabled = false }) {
|
|
|
23
24
|
borderColor: border,
|
|
24
25
|
opacity: disabled ? 0.5 : pressed ? 0.85 : 1
|
|
25
26
|
}
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
],
|
|
28
|
+
children: /* @__PURE__ */ jsx(Text, { variant: "caption", style: [styles.label, { color: fg }], children: label })
|
|
29
|
+
}
|
|
29
30
|
);
|
|
30
31
|
}
|
|
31
32
|
function FilterChipGroup({
|
|
@@ -34,16 +35,16 @@ function FilterChipGroup({
|
|
|
34
35
|
onChange,
|
|
35
36
|
disabled = false
|
|
36
37
|
}) {
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ jsx(View, { style: styles.group, children: items.map((item) => /* @__PURE__ */ jsx(
|
|
38
39
|
FilterChip,
|
|
39
40
|
{
|
|
40
|
-
key: item.value,
|
|
41
41
|
label: item.label,
|
|
42
42
|
active: item.value === value,
|
|
43
43
|
onPress: () => onChange(item.value),
|
|
44
44
|
disabled
|
|
45
|
-
}
|
|
46
|
-
|
|
45
|
+
},
|
|
46
|
+
item.value
|
|
47
|
+
)) });
|
|
47
48
|
}
|
|
48
49
|
const styles = StyleSheet.create({
|
|
49
50
|
chip: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { AlertCircle } from "lucide-react-native";
|
|
3
4
|
import { cloneElement, isValidElement } from "react";
|
|
4
5
|
import { View } from "react-native";
|
|
@@ -13,16 +14,25 @@ function FormField({ label, hint, error, required, children }) {
|
|
|
13
14
|
error: (_a = children.props.error) != null ? _a : error ? true : void 0,
|
|
14
15
|
accessibilityLabel: (_b = children.props.accessibilityLabel) != null ? _b : a11yLabel
|
|
15
16
|
}) : children;
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
View,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
return /* @__PURE__ */ jsxs(View, { style: { gap: 6 }, children: [
|
|
18
|
+
label ? /* @__PURE__ */ jsxs(View, { style: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Text, { variant: "label", style: { flexShrink: 1 }, children: label }),
|
|
20
|
+
required ? /* @__PURE__ */ jsx(Text, { variant: "label", color: "danger", accessibilityElementsHidden: true, importantForAccessibility: "no", children: "*" }) : null
|
|
21
|
+
] }) : null,
|
|
22
|
+
field,
|
|
23
|
+
error ? /* @__PURE__ */ jsxs(
|
|
24
|
+
View,
|
|
25
|
+
{
|
|
26
|
+
style: { flexDirection: "row", alignItems: "flex-start", gap: 4 },
|
|
27
|
+
accessibilityLiveRegion: "polite",
|
|
28
|
+
accessibilityRole: "alert",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(AlertCircle, { size: 14, color: t["--danger-text"], style: { marginTop: 2 } }),
|
|
31
|
+
/* @__PURE__ */ jsx(Text, { variant: "caption", color: "danger", style: { flex: 1 }, children: error })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
) : hint ? /* @__PURE__ */ jsx(Text, { variant: "caption", color: "muted", children: hint }) : null
|
|
35
|
+
] });
|
|
26
36
|
}
|
|
27
37
|
export {
|
|
28
38
|
FormField
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { KeyboardAvoidingView, Platform, ScrollView, Text, View } from "react-native";
|
|
3
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
5
|
import { Button } from "./button.js";
|
|
@@ -16,7 +17,7 @@ function SavingBar({
|
|
|
16
17
|
const t = useTheme();
|
|
17
18
|
const insets = useSafeAreaInsets();
|
|
18
19
|
if (!visible) return null;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
20
21
|
View,
|
|
21
22
|
{
|
|
22
23
|
style: {
|
|
@@ -28,58 +29,62 @@ function SavingBar({
|
|
|
28
29
|
// Respeita o home indicator do iPhone; soma 16 de respiro quando não há inset.
|
|
29
30
|
paddingBottom: insets.bottom > 0 ? insets.bottom : 16,
|
|
30
31
|
gap: 8
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
message ? /* @__PURE__ */ React.createElement(
|
|
34
|
-
Text,
|
|
35
|
-
{
|
|
36
|
-
style: {
|
|
37
|
-
color: t["--text-muted"],
|
|
38
|
-
fontSize: 13
|
|
39
|
-
}
|
|
40
32
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
children: [
|
|
34
|
+
message ? /* @__PURE__ */ jsx(
|
|
35
|
+
Text,
|
|
36
|
+
{
|
|
37
|
+
style: {
|
|
38
|
+
color: t["--text-muted"],
|
|
39
|
+
fontSize: 13
|
|
40
|
+
},
|
|
41
|
+
children: message
|
|
42
|
+
}
|
|
43
|
+
) : null,
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Button,
|
|
46
|
+
{
|
|
47
|
+
label,
|
|
48
|
+
variant: "primary",
|
|
49
|
+
fullWidth: true,
|
|
50
|
+
onPress: onSave,
|
|
51
|
+
loading,
|
|
52
|
+
disabled
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
onDiscard ? /* @__PURE__ */ jsx(
|
|
56
|
+
Button,
|
|
57
|
+
{
|
|
58
|
+
label: discardLabel,
|
|
59
|
+
variant: "secondary",
|
|
60
|
+
fullWidth: true,
|
|
61
|
+
onPress: onDiscard,
|
|
62
|
+
disabled: loading
|
|
63
|
+
}
|
|
64
|
+
) : null
|
|
65
|
+
]
|
|
66
|
+
}
|
|
64
67
|
);
|
|
65
68
|
}
|
|
66
69
|
function FormScreen({ children, saveBar }) {
|
|
67
70
|
const t = useTheme();
|
|
68
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
69
72
|
KeyboardAvoidingView,
|
|
70
73
|
{
|
|
71
74
|
style: { flex: 1, backgroundColor: t["--surface-page"] },
|
|
72
|
-
behavior: Platform.OS === "ios" ? "padding" : void 0
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
behavior: Platform.OS === "ios" ? "padding" : void 0,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
ScrollView,
|
|
79
|
+
{
|
|
80
|
+
contentContainerStyle: { padding: 16, gap: 16 },
|
|
81
|
+
keyboardShouldPersistTaps: "handled",
|
|
82
|
+
children
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
saveBar
|
|
86
|
+
]
|
|
87
|
+
}
|
|
83
88
|
);
|
|
84
89
|
}
|
|
85
90
|
export {
|