@rojaostudio/ds 1.0.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/LICENSE +21 -0
- package/README.md +89 -0
- 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/chunk-ORMEWXMH.js +37 -0
- package/dist/compat/generate.d.ts +6 -0
- package/dist/compat/generate.js +1 -0
- package/dist/compat/recipes.d.ts +1 -0
- package/dist/compat/recipes.js +1 -0
- package/dist/compat/themes.d.ts +1 -0
- package/dist/compat/themes.js +1 -0
- package/dist/compat/tokens.d.ts +1 -0
- package/dist/compat/tokens.js +1 -0
- package/dist/components/accordion.d.ts +35 -0
- package/dist/components/accordion.js +95 -0
- package/dist/components/alert.d.ts +24 -0
- package/dist/components/alert.js +72 -0
- package/dist/components/avatar.d.ts +45 -0
- package/dist/components/avatar.js +97 -0
- package/dist/components/badge.d.ts +45 -0
- package/dist/components/badge.js +114 -0
- package/dist/components/blocker-card.d.ts +42 -0
- package/dist/components/blocker-card.js +45 -0
- package/dist/components/bottom-sheet.d.ts +31 -0
- package/dist/components/bottom-sheet.js +120 -0
- package/dist/components/breadcrumb.d.ts +28 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/button.d.ts +27 -0
- package/dist/components/button.js +124 -0
- package/dist/components/card.d.ts +27 -0
- package/dist/components/card.js +52 -0
- package/dist/components/chat-bubble.d.ts +16 -0
- package/dist/components/chat-bubble.js +55 -0
- package/dist/components/checkbox.d.ts +14 -0
- package/dist/components/checkbox.js +78 -0
- package/dist/components/chip-input.d.ts +26 -0
- package/dist/components/chip-input.js +182 -0
- package/dist/components/chips.d.ts +22 -0
- package/dist/components/chips.js +94 -0
- package/dist/components/choice-card.d.ts +16 -0
- package/dist/components/choice-card.js +60 -0
- package/dist/components/choice-carousel.d.ts +16 -0
- package/dist/components/choice-carousel.js +154 -0
- package/dist/components/choice-preview-card.d.ts +37 -0
- package/dist/components/choice-preview-card.js +39 -0
- package/dist/components/color-input.d.ts +20 -0
- package/dist/components/color-input.js +79 -0
- package/dist/components/combobox.d.ts +70 -0
- package/dist/components/combobox.js +213 -0
- package/dist/components/context-menu.d.ts +33 -0
- package/dist/components/context-menu.js +70 -0
- package/dist/components/copilot-hint.d.ts +18 -0
- package/dist/components/copilot-hint.js +63 -0
- package/dist/components/copy-field.d.ts +16 -0
- package/dist/components/copy-field.js +41 -0
- package/dist/components/currency-input.d.ts +32 -0
- package/dist/components/currency-input.js +138 -0
- package/dist/components/danger-zone.d.ts +20 -0
- package/dist/components/danger-zone.js +21 -0
- package/dist/components/data-table-header.d.ts +43 -0
- package/dist/components/data-table-header.js +205 -0
- package/dist/components/date-picker.d.ts +40 -0
- package/dist/components/date-picker.js +252 -0
- package/dist/components/divider.d.ts +20 -0
- package/dist/components/divider.js +47 -0
- package/dist/components/drawer.d.ts +26 -0
- package/dist/components/drawer.js +82 -0
- package/dist/components/dropzone.d.ts +19 -0
- package/dist/components/dropzone.js +65 -0
- package/dist/components/empty-state.d.ts +48 -0
- package/dist/components/empty-state.js +91 -0
- package/dist/components/fab.d.ts +38 -0
- package/dist/components/fab.js +100 -0
- package/dist/components/filter-chip.d.ts +54 -0
- package/dist/components/filter-chip.js +66 -0
- package/dist/components/floating-stepper.d.ts +44 -0
- package/dist/components/floating-stepper.js +53 -0
- package/dist/components/form-card-header.d.ts +13 -0
- package/dist/components/form-card-header.js +8 -0
- package/dist/components/icon-button.d.ts +17 -0
- package/dist/components/icon-button.js +80 -0
- package/dist/components/image-crop-modal.d.ts +59 -0
- package/dist/components/image-crop-modal.js +240 -0
- package/dist/components/image-upload.d.ts +72 -0
- package/dist/components/image-upload.js +271 -0
- package/dist/components/index.d.ts +85 -0
- package/dist/components/index.js +200 -0
- package/dist/components/input.d.ts +25 -0
- package/dist/components/input.js +136 -0
- package/dist/components/insight-card.d.ts +19 -0
- package/dist/components/insight-card.js +27 -0
- package/dist/components/label.d.ts +16 -0
- package/dist/components/label.js +43 -0
- package/dist/components/media-tile.d.ts +24 -0
- package/dist/components/media-tile.js +28 -0
- package/dist/components/menu.d.ts +50 -0
- package/dist/components/menu.js +80 -0
- package/dist/components/modal.d.ts +25 -0
- package/dist/components/modal.js +71 -0
- package/dist/components/notice.d.ts +50 -0
- package/dist/components/notice.js +103 -0
- package/dist/components/option-tile.d.ts +60 -0
- package/dist/components/option-tile.js +144 -0
- package/dist/components/page-shell.d.ts +29 -0
- package/dist/components/page-shell.js +36 -0
- package/dist/components/page-skeleton.d.ts +35 -0
- package/dist/components/page-skeleton.js +12 -0
- package/dist/components/page-tabs.d.ts +35 -0
- package/dist/components/page-tabs.js +55 -0
- package/dist/components/pagination.d.ts +31 -0
- package/dist/components/pagination.js +80 -0
- package/dist/components/paywall-banner.d.ts +37 -0
- package/dist/components/paywall-banner.js +42 -0
- package/dist/components/paywall.d.ts +44 -0
- package/dist/components/paywall.js +55 -0
- package/dist/components/phone-frame.d.ts +9 -0
- package/dist/components/phone-frame.js +18 -0
- package/dist/components/phone-input.d.ts +24 -0
- package/dist/components/phone-input.js +92 -0
- package/dist/components/pix-icon.d.ts +8 -0
- package/dist/components/pix-icon.js +24 -0
- package/dist/components/popover.d.ts +44 -0
- package/dist/components/popover.js +140 -0
- package/dist/components/pricing-card.d.ts +42 -0
- package/dist/components/pricing-card.js +29 -0
- package/dist/components/qr-display.d.ts +19 -0
- package/dist/components/qr-display.js +24 -0
- package/dist/components/radio.d.ts +33 -0
- package/dist/components/radio.js +97 -0
- package/dist/components/row-actions.d.ts +24 -0
- package/dist/components/row-actions.js +76 -0
- package/dist/components/saving-bar-context.d.ts +40 -0
- package/dist/components/saving-bar-context.js +125 -0
- package/dist/components/saving-bar.d.ts +18 -0
- package/dist/components/saving-bar.js +72 -0
- package/dist/components/search.d.ts +30 -0
- package/dist/components/search.js +81 -0
- package/dist/components/section-card.d.ts +14 -0
- package/dist/components/section-card.js +49 -0
- package/dist/components/section-header.d.ts +29 -0
- package/dist/components/section-header.js +7 -0
- package/dist/components/select.d.ts +21 -0
- package/dist/components/select.js +140 -0
- package/dist/components/selectable-card.d.ts +35 -0
- package/dist/components/selectable-card.js +27 -0
- package/dist/components/setting-row.d.ts +33 -0
- package/dist/components/setting-row.js +19 -0
- package/dist/components/settings-list.d.ts +25 -0
- package/dist/components/settings-list.js +22 -0
- package/dist/components/skeleton.d.ts +24 -0
- package/dist/components/skeleton.js +49 -0
- package/dist/components/slider.d.ts +32 -0
- package/dist/components/slider.js +79 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +36 -0
- package/dist/components/step-progress.d.ts +12 -0
- package/dist/components/step-progress.js +24 -0
- package/dist/components/summary-bar.d.ts +31 -0
- package/dist/components/summary-bar.js +54 -0
- package/dist/components/table.d.ts +23 -0
- package/dist/components/table.js +80 -0
- package/dist/components/textarea.d.ts +21 -0
- package/dist/components/textarea.js +95 -0
- package/dist/components/themed.d.ts +36 -0
- package/dist/components/themed.js +22 -0
- package/dist/components/time-picker.d.ts +34 -0
- package/dist/components/time-picker.js +213 -0
- package/dist/components/toaster.d.ts +84 -0
- package/dist/components/toaster.js +284 -0
- package/dist/components/toggle-card-compact.d.ts +21 -0
- package/dist/components/toggle-card-compact.js +99 -0
- package/dist/components/toggle-card.d.ts +15 -0
- package/dist/components/toggle-card.js +76 -0
- package/dist/components/toggle-group.d.ts +67 -0
- package/dist/components/toggle-group.js +80 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +64 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +89 -0
- package/dist/components/typing-indicator.d.ts +8 -0
- package/dist/components/typing-indicator.js +27 -0
- package/dist/components/use-dismiss.d.ts +9 -0
- package/dist/components/use-dismiss.js +28 -0
- package/dist/components/use-focus-trap.d.ts +5 -0
- package/dist/components/use-focus-trap.js +54 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +89 -0
- package/dist/targets/native/components/accordion.d.ts +18 -0
- package/dist/targets/native/components/accordion.js +122 -0
- package/dist/targets/native/components/alert.d.ts +16 -0
- package/dist/targets/native/components/alert.js +58 -0
- package/dist/targets/native/components/avatar.d.ts +25 -0
- package/dist/targets/native/components/avatar.js +88 -0
- package/dist/targets/native/components/badge.d.ts +27 -0
- package/dist/targets/native/components/badge.js +59 -0
- package/dist/targets/native/components/button.d.ts +18 -0
- package/dist/targets/native/components/button.js +84 -0
- package/dist/targets/native/components/card.d.ts +6 -0
- package/dist/targets/native/components/card.js +36 -0
- package/dist/targets/native/components/checkbox.d.ts +12 -0
- package/dist/targets/native/components/checkbox.js +59 -0
- package/dist/targets/native/components/chips.d.ts +17 -0
- package/dist/targets/native/components/chips.js +77 -0
- package/dist/targets/native/components/choice-card.d.ts +11 -0
- package/dist/targets/native/components/choice-card.js +52 -0
- package/dist/targets/native/components/context-menu.d.ts +11 -0
- package/dist/targets/native/components/context-menu.js +19 -0
- package/dist/targets/native/components/currency-input.d.ts +22 -0
- package/dist/targets/native/components/currency-input.js +105 -0
- package/dist/targets/native/components/danger-zone.d.ts +13 -0
- package/dist/targets/native/components/danger-zone.js +27 -0
- package/dist/targets/native/components/date-picker.d.ts +13 -0
- package/dist/targets/native/components/date-picker.js +185 -0
- package/dist/targets/native/components/divider.d.ts +9 -0
- package/dist/targets/native/components/divider.js +36 -0
- package/dist/targets/native/components/empty-state.d.ts +13 -0
- package/dist/targets/native/components/empty-state.js +10 -0
- package/dist/targets/native/components/fab.d.ts +25 -0
- package/dist/targets/native/components/fab.js +112 -0
- package/dist/targets/native/components/filter-chip.d.ts +22 -0
- package/dist/targets/native/components/filter-chip.js +70 -0
- package/dist/targets/native/components/form-field.d.ts +13 -0
- package/dist/targets/native/components/form-field.js +29 -0
- package/dist/targets/native/components/form-screen.d.ts +19 -0
- package/dist/targets/native/components/form-screen.js +88 -0
- package/dist/targets/native/components/google-icon.d.ts +8 -0
- package/dist/targets/native/components/google-icon.js +32 -0
- package/dist/targets/native/components/icon-button.d.ts +18 -0
- package/dist/targets/native/components/icon-button.js +80 -0
- package/dist/targets/native/components/icon.d.ts +11 -0
- package/dist/targets/native/components/icon.js +9 -0
- package/dist/targets/native/components/image-upload.d.ts +12 -0
- package/dist/targets/native/components/image-upload.js +95 -0
- package/dist/targets/native/components/index.d.ts +45 -0
- package/dist/targets/native/components/index.js +100 -0
- package/dist/targets/native/components/input.d.ts +17 -0
- package/dist/targets/native/components/input.js +103 -0
- package/dist/targets/native/components/list-item.d.ts +20 -0
- package/dist/targets/native/components/list-item.js +71 -0
- package/dist/targets/native/components/menu.d.ts +24 -0
- package/dist/targets/native/components/menu.js +71 -0
- package/dist/targets/native/components/modal.d.ts +15 -0
- package/dist/targets/native/components/modal.js +110 -0
- package/dist/targets/native/components/paywall-banner.d.ts +11 -0
- package/dist/targets/native/components/paywall-banner.js +46 -0
- package/dist/targets/native/components/paywall.d.ts +18 -0
- package/dist/targets/native/components/paywall.js +61 -0
- package/dist/targets/native/components/radio.d.ts +20 -0
- package/dist/targets/native/components/radio.js +71 -0
- package/dist/targets/native/components/search.d.ts +22 -0
- package/dist/targets/native/components/search.js +92 -0
- package/dist/targets/native/components/select.d.ts +17 -0
- package/dist/targets/native/components/select.js +86 -0
- package/dist/targets/native/components/sheet.d.ts +11 -0
- package/dist/targets/native/components/sheet.js +51 -0
- package/dist/targets/native/components/skeleton.d.ts +18 -0
- package/dist/targets/native/components/skeleton.js +52 -0
- package/dist/targets/native/components/slider.d.ts +18 -0
- package/dist/targets/native/components/slider.js +153 -0
- package/dist/targets/native/components/spinner.d.ts +7 -0
- package/dist/targets/native/components/spinner.js +10 -0
- package/dist/targets/native/components/stepper.d.ts +10 -0
- package/dist/targets/native/components/stepper.js +33 -0
- package/dist/targets/native/components/switch.d.ts +20 -0
- package/dist/targets/native/components/switch.js +68 -0
- package/dist/targets/native/components/text.d.ts +12 -0
- package/dist/targets/native/components/text.js +31 -0
- package/dist/targets/native/components/textarea.d.ts +13 -0
- package/dist/targets/native/components/textarea.js +92 -0
- package/dist/targets/native/components/theme.d.ts +18 -0
- package/dist/targets/native/components/theme.js +20 -0
- package/dist/targets/native/components/toaster.d.ts +35 -0
- package/dist/targets/native/components/toaster.js +159 -0
- package/dist/targets/native/fonts.d.ts +9 -0
- package/dist/targets/native/fonts.js +10 -0
- package/dist/targets/native/icons.d.ts +1 -0
- package/dist/targets/native/icons.js +1 -0
- package/dist/targets/native/index.d.ts +3 -0
- package/dist/targets/native/index.js +11 -0
- package/dist/targets/native/preset.cjs +69 -0
- package/dist/targets/native/resolve.d.ts +22 -0
- package/dist/targets/native/resolve.js +85 -0
- package/dist/targets/native/theme.css +118 -0
- package/dist/targets/native/theme.d.ts +117 -0
- package/dist/targets/native/theme.js +118 -0
- package/package.json +194 -0
- package/styles/_primitives.generated.css +284 -0
- package/styles/base.css +950 -0
- package/styles/themes/rojao.css +107 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { CheckCircle, AlertCircle, AlertTriangle, Info, X } from "lucide-react-native";
|
|
3
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Text } from "./text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
const VARIANTS = {
|
|
7
|
+
success: { soft: "--success-soft", border: "--success-border", text: "--success-text", icon: CheckCircle },
|
|
8
|
+
danger: { soft: "--danger-soft", border: "--danger-border", text: "--danger-text", icon: AlertCircle },
|
|
9
|
+
warning: { soft: "--warning-soft", border: "--warning-border", text: "--warning-text", icon: AlertTriangle },
|
|
10
|
+
info: { soft: "--info-soft", border: "--info-border", text: "--info-text", icon: Info }
|
|
11
|
+
};
|
|
12
|
+
function Alert({ variant = "info", title, children, onClose, hideIcon = false }) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const t = useTheme();
|
|
15
|
+
const spec = VARIANTS[variant];
|
|
16
|
+
const bg = (_a = t[spec.soft]) != null ? _a : t["--surface-raised"];
|
|
17
|
+
const border = (_b = t[spec.border]) != null ? _b : t["--border-default"];
|
|
18
|
+
const fg = (_c = t[spec.text]) != null ? _c : t["--text-primary"];
|
|
19
|
+
const Icon = spec.icon;
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
|
+
View,
|
|
22
|
+
{
|
|
23
|
+
accessibilityRole: variant === "danger" ? "alert" : "summary",
|
|
24
|
+
style: [styles.container, { backgroundColor: bg, borderColor: border }]
|
|
25
|
+
},
|
|
26
|
+
!hideIcon && /* @__PURE__ */ React.createElement(Icon, { size: 18, color: fg, style: styles.icon }),
|
|
27
|
+
/* @__PURE__ */ React.createElement(View, { style: styles.body }, title != null && /* @__PURE__ */ React.createElement(Text, { variant: "label", style: { color: fg } }, title), children != null && (typeof children === "string" ? /* @__PURE__ */ React.createElement(Text, { variant: "body-sm", style: [{ color: fg }, title != null && styles.childrenSpacing] }, children) : /* @__PURE__ */ React.createElement(View, { style: title != null ? styles.childrenSpacing : void 0 }, children))),
|
|
28
|
+
onClose != null && /* @__PURE__ */ React.createElement(
|
|
29
|
+
Pressable,
|
|
30
|
+
{
|
|
31
|
+
accessibilityRole: "button",
|
|
32
|
+
accessibilityLabel: "Fechar",
|
|
33
|
+
hitSlop: 12,
|
|
34
|
+
onPress: onClose,
|
|
35
|
+
style: ({ pressed }) => [styles.close, { opacity: pressed ? 0.6 : 1 }]
|
|
36
|
+
},
|
|
37
|
+
/* @__PURE__ */ React.createElement(X, { size: 16, color: fg })
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
alignItems: "flex-start",
|
|
45
|
+
gap: 12,
|
|
46
|
+
paddingHorizontal: 16,
|
|
47
|
+
paddingVertical: 12,
|
|
48
|
+
borderRadius: 12,
|
|
49
|
+
borderWidth: 1
|
|
50
|
+
},
|
|
51
|
+
icon: { marginTop: 1 },
|
|
52
|
+
body: { flex: 1, minWidth: 0 },
|
|
53
|
+
childrenSpacing: { marginTop: 2 },
|
|
54
|
+
close: { padding: 2 }
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
Alert
|
|
58
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
type AvatarStatus = 'active' | 'inactive' | 'pending' | 'error';
|
|
6
|
+
interface AvatarProps {
|
|
7
|
+
/** Nome completo — gera iniciais (até 2 letras) quando não há `src`. */
|
|
8
|
+
name?: string;
|
|
9
|
+
src?: string;
|
|
10
|
+
size?: AvatarSize;
|
|
11
|
+
status?: AvatarStatus;
|
|
12
|
+
/** Cor de fundo. default = brand. */
|
|
13
|
+
variant?: 'brand' | 'neutral';
|
|
14
|
+
}
|
|
15
|
+
declare function initials(name: string): string;
|
|
16
|
+
declare function Avatar({ name, src, size, status, variant }: AvatarProps): react.JSX.Element;
|
|
17
|
+
interface AvatarGroupProps {
|
|
18
|
+
/** Máximo de avatares visíveis; o resto vira `+N`. default = 3. */
|
|
19
|
+
max?: number;
|
|
20
|
+
size?: AvatarSize;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare function AvatarGroup({ max, size, children }: AvatarGroupProps): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, initials };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { Children, isValidElement } from "react";
|
|
6
|
+
import { Image, StyleSheet, Text, View } from "react-native";
|
|
7
|
+
import { useTheme } from "./theme.js";
|
|
8
|
+
const DIMENSION = {
|
|
9
|
+
xs: { box: 24, font: 10 },
|
|
10
|
+
sm: { box: 32, font: 12 },
|
|
11
|
+
md: { box: 40, font: 14 },
|
|
12
|
+
lg: { box: 48, font: 16 },
|
|
13
|
+
xl: { box: 64, font: 20 }
|
|
14
|
+
};
|
|
15
|
+
const DOT_SIZE = {
|
|
16
|
+
xs: 6,
|
|
17
|
+
sm: 8,
|
|
18
|
+
md: 10,
|
|
19
|
+
lg: 12,
|
|
20
|
+
xl: 14
|
|
21
|
+
};
|
|
22
|
+
const STATUS_TOKEN = {
|
|
23
|
+
active: "--success",
|
|
24
|
+
inactive: "--text-muted",
|
|
25
|
+
pending: "--warning",
|
|
26
|
+
error: "--danger"
|
|
27
|
+
};
|
|
28
|
+
function initials(name) {
|
|
29
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
30
|
+
if (parts.length === 0) return "?";
|
|
31
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
32
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
33
|
+
}
|
|
34
|
+
function Avatar({ name, src, size = "md", status, variant = "brand" }) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const t = useTheme();
|
|
37
|
+
const { box, font } = DIMENSION[size];
|
|
38
|
+
const label = name != null ? name : "Avatar";
|
|
39
|
+
const showImage = !!src;
|
|
40
|
+
const bg = variant === "brand" ? t["--brand-primary"] : t["--surface-raised"];
|
|
41
|
+
const fg = variant === "brand" ? t["--brand-on-primary"] : t["--text-muted"];
|
|
42
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.wrap, accessibilityRole: "image", accessibilityLabel: label }, /* @__PURE__ */ React.createElement(
|
|
43
|
+
View,
|
|
44
|
+
{
|
|
45
|
+
style: [
|
|
46
|
+
styles.circle,
|
|
47
|
+
{ width: box, height: box, borderRadius: box / 2, backgroundColor: showImage ? void 0 : bg }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
showImage ? /* @__PURE__ */ React.createElement(Image, { source: { uri: src }, style: { width: box, height: box }, resizeMode: "cover" }) : /* @__PURE__ */ React.createElement(Text, { style: { color: fg, fontSize: font, fontWeight: "600" }, numberOfLines: 1 }, initials(name != null ? name : "?"))
|
|
51
|
+
), status ? /* @__PURE__ */ React.createElement(
|
|
52
|
+
View,
|
|
53
|
+
{
|
|
54
|
+
accessibilityLabel: `status: ${status}`,
|
|
55
|
+
style: [
|
|
56
|
+
styles.dot,
|
|
57
|
+
{
|
|
58
|
+
width: DOT_SIZE[size],
|
|
59
|
+
height: DOT_SIZE[size],
|
|
60
|
+
borderRadius: DOT_SIZE[size] / 2,
|
|
61
|
+
backgroundColor: (_b = (_a = t[STATUS_TOKEN[status]]) != null ? _a : t["--brand-accent"]) != null ? _b : t["--icon-default"],
|
|
62
|
+
borderColor: t["--surface-default"]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
) : null);
|
|
67
|
+
}
|
|
68
|
+
function AvatarGroup({ max = 3, size = "md", children }) {
|
|
69
|
+
const items = Children.toArray(children).filter(isValidElement);
|
|
70
|
+
const visible = items.slice(0, max);
|
|
71
|
+
const overflow = items.length - visible.length;
|
|
72
|
+
const overlap = -Math.round(DIMENSION[size].box * 0.3);
|
|
73
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.group, accessibilityRole: "none" }, visible.map((child, idx) => {
|
|
74
|
+
var _a;
|
|
75
|
+
return /* @__PURE__ */ React.createElement(View, { key: idx, style: idx === 0 ? void 0 : { marginLeft: overlap } }, /* @__PURE__ */ React.createElement(Avatar, __spreadProps(__spreadValues({}, child.props), { size: (_a = child.props.size) != null ? _a : size })));
|
|
76
|
+
}), overflow > 0 ? /* @__PURE__ */ React.createElement(View, { style: { marginLeft: overlap } }, /* @__PURE__ */ React.createElement(Avatar, { name: `+${overflow}`, variant: "neutral", size })) : null);
|
|
77
|
+
}
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
wrap: { position: "relative", alignSelf: "flex-start" },
|
|
80
|
+
circle: { alignItems: "center", justifyContent: "center", overflow: "hidden" },
|
|
81
|
+
dot: { position: "absolute", bottom: 0, right: 0, borderWidth: 2 },
|
|
82
|
+
group: { flexDirection: "row", alignItems: "center", alignSelf: "flex-start" }
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
Avatar,
|
|
86
|
+
AvatarGroup,
|
|
87
|
+
initials
|
|
88
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type BadgeTone = 'neutral' | 'brand' | 'danger' | 'success' | 'warning' | 'info';
|
|
4
|
+
type CommonProps = {
|
|
5
|
+
tone?: BadgeTone;
|
|
6
|
+
};
|
|
7
|
+
type LabelProps = CommonProps & {
|
|
8
|
+
dot?: false;
|
|
9
|
+
count?: undefined;
|
|
10
|
+
children: string;
|
|
11
|
+
};
|
|
12
|
+
type DotProps = CommonProps & {
|
|
13
|
+
dot: true;
|
|
14
|
+
count?: undefined;
|
|
15
|
+
children?: undefined;
|
|
16
|
+
};
|
|
17
|
+
type CountProps = CommonProps & {
|
|
18
|
+
dot?: false;
|
|
19
|
+
count: number;
|
|
20
|
+
/** Limite pra count overflow. default = 99. */
|
|
21
|
+
max?: number;
|
|
22
|
+
children?: undefined;
|
|
23
|
+
};
|
|
24
|
+
type BadgeProps = LabelProps | DotProps | CountProps;
|
|
25
|
+
declare function Badge(props: BadgeProps): react.JSX.Element | null;
|
|
26
|
+
|
|
27
|
+
export { Badge, type BadgeProps, type BadgeTone };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { Text } from "./text.js";
|
|
4
|
+
import { useTheme } from "./theme.js";
|
|
5
|
+
const BG = {
|
|
6
|
+
neutral: "--neutral-soft",
|
|
7
|
+
brand: "--brand-secondary",
|
|
8
|
+
danger: "--danger-soft",
|
|
9
|
+
success: "--success-soft",
|
|
10
|
+
warning: "--warning-soft",
|
|
11
|
+
info: "--info-soft"
|
|
12
|
+
};
|
|
13
|
+
const FG = {
|
|
14
|
+
neutral: "--neutral-text",
|
|
15
|
+
brand: "--brand-on-secondary",
|
|
16
|
+
danger: "--danger-text",
|
|
17
|
+
success: "--success-text",
|
|
18
|
+
warning: "--warning-text",
|
|
19
|
+
info: "--info-text"
|
|
20
|
+
};
|
|
21
|
+
const DOT_BG = {
|
|
22
|
+
neutral: "--neutral",
|
|
23
|
+
brand: "--brand-primary",
|
|
24
|
+
danger: "--danger",
|
|
25
|
+
success: "--success",
|
|
26
|
+
warning: "--warning",
|
|
27
|
+
info: "--info"
|
|
28
|
+
};
|
|
29
|
+
function Badge(props) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const t = useTheme();
|
|
32
|
+
const tone = (_a = props.tone) != null ? _a : "neutral";
|
|
33
|
+
if (props.dot) {
|
|
34
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.dot, { backgroundColor: t[DOT_BG[tone]] }], accessibilityRole: "image" });
|
|
35
|
+
}
|
|
36
|
+
if (props.count !== void 0) {
|
|
37
|
+
if (props.count <= 0) return null;
|
|
38
|
+
const max = (_b = props.max) != null ? _b : 99;
|
|
39
|
+
const display = props.count > max ? `${max}+` : String(props.count);
|
|
40
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.count, { backgroundColor: t["--brand-primary"] }] }, /* @__PURE__ */ React.createElement(Text, { variant: "caption", style: { color: t["--brand-on-primary"], fontWeight: "500" } }, display));
|
|
41
|
+
}
|
|
42
|
+
return /* @__PURE__ */ React.createElement(View, { style: [styles.badge, { backgroundColor: t[BG[tone]] }] }, /* @__PURE__ */ React.createElement(Text, { variant: "caption", style: { color: t[FG[tone]], fontWeight: "500" } }, props.children));
|
|
43
|
+
}
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
badge: { alignSelf: "flex-start", borderRadius: 999, paddingHorizontal: 10, paddingVertical: 4 },
|
|
46
|
+
dot: { alignSelf: "flex-start", width: 10, height: 10, borderRadius: 999 },
|
|
47
|
+
count: {
|
|
48
|
+
alignSelf: "flex-start",
|
|
49
|
+
minWidth: 20,
|
|
50
|
+
height: 20,
|
|
51
|
+
borderRadius: 999,
|
|
52
|
+
paddingHorizontal: 6,
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
justifyContent: "center"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
Badge
|
|
59
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { PressableProps } from 'react-native';
|
|
4
|
+
|
|
5
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
|
6
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
type Props = Omit<PressableProps, 'children' | 'style'> & {
|
|
8
|
+
label: string;
|
|
9
|
+
variant?: ButtonVariant;
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
leftIcon?: ReactNode;
|
|
14
|
+
rightIcon?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
declare function Button({ label, variant, size, loading, disabled, fullWidth, leftIcon, rightIcon, ...rest }: Props): react.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { Button, type ButtonSize, type ButtonVariant };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { cloneElement, isValidElement } from "react";
|
|
6
|
+
import {
|
|
7
|
+
ActivityIndicator,
|
|
8
|
+
Pressable,
|
|
9
|
+
StyleSheet,
|
|
10
|
+
Text
|
|
11
|
+
} from "react-native";
|
|
12
|
+
import { useTheme } from "./theme.js";
|
|
13
|
+
function tintIcon(icon, color) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
if (!isValidElement(icon)) return icon != null ? icon : null;
|
|
16
|
+
const el = icon;
|
|
17
|
+
return cloneElement(el, { color: (_a = el.props.color) != null ? _a : color, size: (_b = el.props.size) != null ? _b : 18 });
|
|
18
|
+
}
|
|
19
|
+
const HEIGHT = { sm: 40, md: 48, lg: 56 };
|
|
20
|
+
function Button(_a) {
|
|
21
|
+
var _b = _a, {
|
|
22
|
+
label,
|
|
23
|
+
variant = "primary",
|
|
24
|
+
size = "md",
|
|
25
|
+
loading = false,
|
|
26
|
+
disabled,
|
|
27
|
+
fullWidth,
|
|
28
|
+
leftIcon,
|
|
29
|
+
rightIcon
|
|
30
|
+
} = _b, rest = __objRest(_b, [
|
|
31
|
+
"label",
|
|
32
|
+
"variant",
|
|
33
|
+
"size",
|
|
34
|
+
"loading",
|
|
35
|
+
"disabled",
|
|
36
|
+
"fullWidth",
|
|
37
|
+
"leftIcon",
|
|
38
|
+
"rightIcon"
|
|
39
|
+
]);
|
|
40
|
+
const t = useTheme();
|
|
41
|
+
const isDisabled = disabled || loading;
|
|
42
|
+
const skin = {
|
|
43
|
+
primary: { bg: t["--brand-primary"], fg: t["--brand-on-primary"], border: void 0 },
|
|
44
|
+
secondary: { bg: t["--brand-secondary"], fg: t["--brand-on-secondary"], border: void 0 },
|
|
45
|
+
outline: { bg: t["--surface-default"], fg: t["--text-primary"], border: t["--border-default"] },
|
|
46
|
+
ghost: { bg: "transparent", fg: t["--text-primary"], border: void 0 },
|
|
47
|
+
danger: { bg: t["--danger"], fg: "#ffffff", border: void 0 }
|
|
48
|
+
}[variant];
|
|
49
|
+
return /* @__PURE__ */ React.createElement(
|
|
50
|
+
Pressable,
|
|
51
|
+
__spreadValues({
|
|
52
|
+
accessibilityRole: "button",
|
|
53
|
+
accessibilityState: { disabled: !!isDisabled, busy: loading },
|
|
54
|
+
disabled: isDisabled,
|
|
55
|
+
hitSlop: 8,
|
|
56
|
+
style: ({ pressed }) => [
|
|
57
|
+
styles.base,
|
|
58
|
+
{
|
|
59
|
+
height: HEIGHT[size],
|
|
60
|
+
backgroundColor: skin.bg,
|
|
61
|
+
borderColor: skin.border,
|
|
62
|
+
borderWidth: skin.border ? 1 : 0,
|
|
63
|
+
opacity: isDisabled ? 0.5 : pressed ? 0.8 : 1,
|
|
64
|
+
alignSelf: fullWidth ? "stretch" : "flex-start"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}, rest),
|
|
68
|
+
loading ? /* @__PURE__ */ React.createElement(ActivityIndicator, { color: skin.fg }) : /* @__PURE__ */ React.createElement(React.Fragment, null, tintIcon(leftIcon, skin.fg), /* @__PURE__ */ React.createElement(Text, { style: [styles.label, { color: skin.fg }] }, label), tintIcon(rightIcon, skin.fg))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
base: {
|
|
73
|
+
flexDirection: "row",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
justifyContent: "center",
|
|
76
|
+
gap: 8,
|
|
77
|
+
borderRadius: 12,
|
|
78
|
+
paddingHorizontal: 20
|
|
79
|
+
},
|
|
80
|
+
label: { fontSize: 16, fontWeight: "600" }
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
Button
|
|
84
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { StyleSheet, View } from "react-native";
|
|
6
|
+
import { useTheme } from "./theme.js";
|
|
7
|
+
function Card(_a) {
|
|
8
|
+
var _b = _a, { style } = _b, rest = __objRest(_b, ["style"]);
|
|
9
|
+
const t = useTheme();
|
|
10
|
+
return /* @__PURE__ */ React.createElement(
|
|
11
|
+
View,
|
|
12
|
+
__spreadValues({
|
|
13
|
+
style: [
|
|
14
|
+
styles.card,
|
|
15
|
+
{ backgroundColor: t["--surface-default"], borderColor: t["--border-subtle"] },
|
|
16
|
+
style
|
|
17
|
+
]
|
|
18
|
+
}, rest)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
const styles = StyleSheet.create({
|
|
22
|
+
card: {
|
|
23
|
+
borderRadius: 12,
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
padding: 16,
|
|
26
|
+
// elevação sutil (iOS shadow* + Android elevation)
|
|
27
|
+
shadowColor: "#000000",
|
|
28
|
+
shadowOpacity: 0.05,
|
|
29
|
+
shadowRadius: 8,
|
|
30
|
+
shadowOffset: { width: 0, height: 2 },
|
|
31
|
+
elevation: 1
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
Card
|
|
36
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
label?: string;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
onChange: (next: boolean) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare function Checkbox({ label, checked, onChange, disabled, indeterminate }: Props): react.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { Checkbox };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Check } from "lucide-react-native";
|
|
3
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Text } from "./text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
function Checkbox({ label, checked, onChange, disabled, indeterminate }) {
|
|
7
|
+
const t = useTheme();
|
|
8
|
+
const active = checked || indeterminate;
|
|
9
|
+
return /* @__PURE__ */ React.createElement(
|
|
10
|
+
Pressable,
|
|
11
|
+
{
|
|
12
|
+
accessibilityRole: "checkbox",
|
|
13
|
+
accessibilityState: { checked: indeterminate ? "mixed" : checked, disabled: !!disabled },
|
|
14
|
+
accessibilityLabel: label,
|
|
15
|
+
disabled,
|
|
16
|
+
hitSlop: 8,
|
|
17
|
+
onPress: () => onChange(!checked),
|
|
18
|
+
style: [styles.row, { opacity: disabled ? 0.5 : 1 }]
|
|
19
|
+
},
|
|
20
|
+
/* @__PURE__ */ React.createElement(
|
|
21
|
+
View,
|
|
22
|
+
{
|
|
23
|
+
style: [
|
|
24
|
+
styles.box,
|
|
25
|
+
{
|
|
26
|
+
borderColor: active ? t["--brand-primary"] : t["--border-strong"],
|
|
27
|
+
backgroundColor: active ? t["--brand-primary"] : "transparent"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
indeterminate ? /* @__PURE__ */ React.createElement(View, { style: [styles.dash, { backgroundColor: t["--brand-on-primary"] }] }) : checked ? /* @__PURE__ */ React.createElement(Check, { size: 14, color: t["--brand-on-primary"], strokeWidth: 3 }) : null
|
|
32
|
+
),
|
|
33
|
+
label ? /* @__PURE__ */ React.createElement(Text, { variant: "body", style: { color: t["--text-primary"] } }, label) : null
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
row: {
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: 10,
|
|
41
|
+
minHeight: 44
|
|
42
|
+
},
|
|
43
|
+
box: {
|
|
44
|
+
width: 20,
|
|
45
|
+
height: 20,
|
|
46
|
+
borderRadius: 6,
|
|
47
|
+
borderWidth: 2,
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
justifyContent: "center"
|
|
50
|
+
},
|
|
51
|
+
dash: {
|
|
52
|
+
width: 10,
|
|
53
|
+
height: 2,
|
|
54
|
+
borderRadius: 1
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
Checkbox
|
|
59
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
label: string;
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
onRemove?: () => void;
|
|
9
|
+
/** Leading slot — ícone (lucide-react-native) ou qualquer nó. */
|
|
10
|
+
leadingIcon?: ReactNode;
|
|
11
|
+
/** Sem borda, fundo discreto (surface-raised). */
|
|
12
|
+
subtle?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare function Chip({ label, onPress, selected, onRemove, leadingIcon, subtle, disabled, }: Props): react.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Chip };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
3
|
+
import { X } from "lucide-react-native";
|
|
4
|
+
import { Text } from "./text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
function Chip({
|
|
7
|
+
label,
|
|
8
|
+
onPress,
|
|
9
|
+
selected = false,
|
|
10
|
+
onRemove,
|
|
11
|
+
leadingIcon,
|
|
12
|
+
subtle = false,
|
|
13
|
+
disabled = false
|
|
14
|
+
}) {
|
|
15
|
+
const t = useTheme();
|
|
16
|
+
const bg = selected ? t["--brand-primary"] : subtle ? t["--surface-raised"] : t["--surface-default"];
|
|
17
|
+
const fg = selected ? t["--brand-on-primary"] : t["--text-primary"];
|
|
18
|
+
const border = selected ? t["--brand-primary"] : subtle ? "transparent" : t["--border-default"];
|
|
19
|
+
return /* @__PURE__ */ React.createElement(
|
|
20
|
+
Pressable,
|
|
21
|
+
{
|
|
22
|
+
onPress: disabled ? void 0 : onPress,
|
|
23
|
+
disabled: disabled || !onPress,
|
|
24
|
+
hitSlop: 8,
|
|
25
|
+
accessibilityRole: "button",
|
|
26
|
+
accessibilityLabel: label,
|
|
27
|
+
accessibilityState: { selected, disabled: !!disabled },
|
|
28
|
+
style: ({ pressed }) => [
|
|
29
|
+
styles.chip,
|
|
30
|
+
{
|
|
31
|
+
backgroundColor: bg,
|
|
32
|
+
borderColor: border,
|
|
33
|
+
opacity: disabled ? 0.5 : pressed && onPress ? 0.85 : 1
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
leadingIcon != null && /* @__PURE__ */ React.createElement(View, { style: styles.leading }, leadingIcon),
|
|
38
|
+
/* @__PURE__ */ React.createElement(Text, { variant: "caption", style: [styles.label, { color: fg }] }, label),
|
|
39
|
+
onRemove && /* @__PURE__ */ React.createElement(
|
|
40
|
+
Pressable,
|
|
41
|
+
{
|
|
42
|
+
onPress: disabled ? void 0 : onRemove,
|
|
43
|
+
disabled,
|
|
44
|
+
hitSlop: 8,
|
|
45
|
+
accessibilityRole: "button",
|
|
46
|
+
accessibilityLabel: "Remove",
|
|
47
|
+
style: styles.remove
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ React.createElement(X, { size: 14, color: fg })
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
chip: {
|
|
55
|
+
flexDirection: "row",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
gap: 6,
|
|
58
|
+
minHeight: 32,
|
|
59
|
+
paddingHorizontal: 12,
|
|
60
|
+
borderRadius: 999,
|
|
61
|
+
borderWidth: 1,
|
|
62
|
+
alignSelf: "flex-start"
|
|
63
|
+
},
|
|
64
|
+
leading: {
|
|
65
|
+
marginLeft: -2
|
|
66
|
+
},
|
|
67
|
+
label: {
|
|
68
|
+
fontWeight: "500"
|
|
69
|
+
},
|
|
70
|
+
remove: {
|
|
71
|
+
marginRight: -4,
|
|
72
|
+
marginLeft: 2
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
Chip
|
|
77
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
onSelect: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare function ChoiceCard({ label, description, selected, onSelect }: Props): react.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { ChoiceCard };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Pressable, View } from "react-native";
|
|
3
|
+
import { Text } from "./text.js";
|
|
4
|
+
import { useTheme } from "./theme.js";
|
|
5
|
+
function ChoiceCard({ label, description, selected, onSelect }) {
|
|
6
|
+
const t = useTheme();
|
|
7
|
+
return /* @__PURE__ */ React.createElement(
|
|
8
|
+
Pressable,
|
|
9
|
+
{
|
|
10
|
+
onPress: onSelect,
|
|
11
|
+
accessibilityRole: "radio",
|
|
12
|
+
accessibilityState: { selected },
|
|
13
|
+
style: {
|
|
14
|
+
minHeight: 56,
|
|
15
|
+
borderRadius: 12,
|
|
16
|
+
borderWidth: 1.5,
|
|
17
|
+
paddingHorizontal: 16,
|
|
18
|
+
paddingVertical: 12,
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "space-between",
|
|
22
|
+
gap: 12,
|
|
23
|
+
borderColor: selected ? t["--brand-primary"] : t["--border-default"],
|
|
24
|
+
backgroundColor: selected ? t["--surface-raised"] : t["--surface-default"]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
/* @__PURE__ */ React.createElement(View, { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { variant: "label" }, label), description ? /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "muted" }, description) : null),
|
|
28
|
+
/* @__PURE__ */ React.createElement(
|
|
29
|
+
View,
|
|
30
|
+
{
|
|
31
|
+
style: {
|
|
32
|
+
width: 20,
|
|
33
|
+
height: 20,
|
|
34
|
+
borderRadius: 10,
|
|
35
|
+
borderWidth: 2,
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
borderColor: selected ? t["--brand-primary"] : t["--border-strong"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
selected ? /* @__PURE__ */ React.createElement(
|
|
42
|
+
View,
|
|
43
|
+
{
|
|
44
|
+
style: { width: 10, height: 10, borderRadius: 5, backgroundColor: t["--brand-primary"] }
|
|
45
|
+
}
|
|
46
|
+
) : null
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
ChoiceCard
|
|
52
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { MenuItem } from './menu.js';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
items: MenuItem[];
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
};
|
|
9
|
+
declare function ContextMenu({ items, children }: Props): react.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { ContextMenu };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Pressable } from "react-native";
|
|
4
|
+
import { Menu } from "./menu.js";
|
|
5
|
+
function ContextMenu({ items, children }) {
|
|
6
|
+
const [visible, setVisible] = useState(false);
|
|
7
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
8
|
+
Pressable,
|
|
9
|
+
{
|
|
10
|
+
onLongPress: () => setVisible(true),
|
|
11
|
+
accessibilityHint: "Mantenha pressionado para abrir as a\xE7\xF5es",
|
|
12
|
+
delayLongPress: 350
|
|
13
|
+
},
|
|
14
|
+
children
|
|
15
|
+
), /* @__PURE__ */ React.createElement(Menu, { visible, onClose: () => setVisible(false), items }));
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
ContextMenu
|
|
19
|
+
};
|