@innovui/react-native 0.0.0-stage → 0.1.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 +57 -2
- package/dist/components/_shared/anchored-overlay.js +74 -0
- package/dist/components/_shared/anchored-overlay.js.map +1 -0
- package/dist/components/_shared/backdrop.js +25 -0
- package/dist/components/_shared/backdrop.js.map +1 -0
- package/dist/components/_shared/overlay-anchor.js +31 -0
- package/dist/components/_shared/overlay-anchor.js.map +1 -0
- package/dist/components/_shared/overlay-state.js +31 -0
- package/dist/components/_shared/overlay-state.js.map +1 -0
- package/dist/components/_shared/status.d.ts +5 -0
- package/dist/components/_shared/status.js +98 -0
- package/dist/components/_shared/status.js.map +1 -0
- package/dist/components/_shared/use-token.js +15 -0
- package/dist/components/_shared/use-token.js.map +1 -0
- package/dist/components/accordion/accordion.d.ts +43 -0
- package/dist/components/accordion/accordion.js +90 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/alert/alert.d.ts +25 -0
- package/dist/components/alert/alert.js +61 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +17 -0
- package/dist/components/avatar/avatar.js +51 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/badge/badge.d.ts +16 -0
- package/dist/components/badge/badge.js +57 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/banner/banner.d.ts +23 -0
- package/dist/components/banner/banner.js +50 -0
- package/dist/components/banner/banner.js.map +1 -0
- package/dist/components/banner/index.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +22 -0
- package/dist/components/breadcrumb/breadcrumb.js +54 -0
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/button/button.d.ts +21 -0
- package/dist/components/button/button.js +89 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +17 -0
- package/dist/components/card/card.js +28 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox.d.ts +18 -0
- package/dist/components/checkbox/checkbox.js +64 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/combobox/combobox.d.ts +40 -0
- package/dist/components/combobox/combobox.js +101 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/container/container.d.ts +17 -0
- package/dist/components/container/container.js +42 -0
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/date-picker/calendar.d.ts +38 -0
- package/dist/components/date-picker/calendar.js +137 -0
- package/dist/components/date-picker/calendar.js.map +1 -0
- package/dist/components/date-picker/date-picker.d.ts +24 -0
- package/dist/components/date-picker/date-picker.js +52 -0
- package/dist/components/date-picker/date-picker.js.map +1 -0
- package/dist/components/date-picker/date-presets.d.ts +15 -0
- package/dist/components/date-picker/date-presets.js +52 -0
- package/dist/components/date-picker/date-presets.js.map +1 -0
- package/dist/components/date-picker/date-range-picker.d.ts +24 -0
- package/dist/components/date-picker/date-range-picker.js +78 -0
- package/dist/components/date-picker/date-range-picker.js.map +1 -0
- package/dist/components/date-picker/date-sheet.js +33 -0
- package/dist/components/date-picker/date-sheet.js.map +1 -0
- package/dist/components/date-picker/date-trigger.js +14 -0
- package/dist/components/date-picker/date-trigger.js.map +1 -0
- package/dist/components/date-picker/dates.d.ts +8 -0
- package/dist/components/date-picker/dates.js +40 -0
- package/dist/components/date-picker/dates.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +6 -0
- package/dist/components/divider/divider.d.ts +11 -0
- package/dist/components/divider/divider.js +16 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/drawer/drawer.d.ts +34 -0
- package/dist/components/drawer/drawer.js +144 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/field/field.d.ts +31 -0
- package/dist/components/field/field.js +52 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/grid/grid.d.ts +35 -0
- package/dist/components/grid/grid.js +64 -0
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/icon-button/icon-button.d.ts +23 -0
- package/dist/components/icon-button/icon-button.js +48 -0
- package/dist/components/icon-button/icon-button.js.map +1 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input.d.ts +22 -0
- package/dist/components/input/input.js +86 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/link.d.ts +13 -0
- package/dist/components/link/link.js +20 -0
- package/dist/components/link/link.js.map +1 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/list.d.ts +26 -0
- package/dist/components/list/list.js +45 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +47 -0
- package/dist/components/menu/menu.js +81 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/modal.d.ts +41 -0
- package/dist/components/modal/modal.js +92 -0
- package/dist/components/modal/modal.js.map +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination.d.ts +21 -0
- package/dist/components/pagination/pagination.js +99 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +29 -0
- package/dist/components/popover/popover.js +54 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio.d.ts +16 -0
- package/dist/components/radio/radio.js +37 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/segmented-control/index.d.ts +2 -0
- package/dist/components/segmented-control/segmented-control.d.ts +23 -0
- package/dist/components/segmented-control/segmented-control.js +53 -0
- package/dist/components/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/select/field-trigger.d.ts +6 -0
- package/dist/components/select/field-trigger.js +90 -0
- package/dist/components/select/field-trigger.js.map +1 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +35 -0
- package/dist/components/select/select.js +98 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/skeleton.d.ts +17 -0
- package/dist/components/skeleton/skeleton.js +53 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/slider.d.ts +26 -0
- package/dist/components/slider/slider.js +102 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/spinner.d.ts +13 -0
- package/dist/components/spinner/spinner.js +47 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/stack.d.ts +17 -0
- package/dist/components/stack/stack.js +60 -0
- package/dist/components/stack/stack.js.map +1 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/stepper.d.ts +20 -0
- package/dist/components/stepper/stepper.js +61 -0
- package/dist/components/stepper/stepper.js.map +1 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +15 -0
- package/dist/components/switch/switch.js +51 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/table.d.ts +42 -0
- package/dist/components/table/table.js +83 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.d.ts +35 -0
- package/dist/components/tabs/tabs.js +82 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/tag.d.ts +18 -0
- package/dist/components/tag/tag.js +37 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.ts +16 -0
- package/dist/components/textarea/textarea.js +46 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +41 -0
- package/dist/components/toast/toast.js +167 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.ts +28 -0
- package/dist/components/tooltip/tooltip.js +62 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/upload/index.d.ts +2 -0
- package/dist/components/upload/upload.d.ts +65 -0
- package/dist/components/upload/upload.js +130 -0
- package/dist/components/upload/upload.js.map +1 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +46 -0
- package/dist/tokens/generated.d.ts +371 -0
- package/dist/tokens/generated.js +373 -0
- package/dist/tokens/generated.js.map +1 -0
- package/dist/utils/cn.d.ts +6 -0
- package/dist/utils/cn.js +11 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +61 -3
- package/theme.css +191 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { CloseIcon, StatusIcon, statusBg, statusRole, statusText, statusTextToken } from "../_shared/status.js";
|
|
3
|
+
import { useToken } from "../_shared/use-token.js";
|
|
4
|
+
import { IconButton } from "../icon-button/icon-button.js";
|
|
5
|
+
import { Text, View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/alert/alert.tsx
|
|
8
|
+
const border = {
|
|
9
|
+
success: "border-status-success-border",
|
|
10
|
+
error: "border-status-error-border",
|
|
11
|
+
warning: "border-status-warning-border",
|
|
12
|
+
info: "border-status-info-border",
|
|
13
|
+
neutral: "border-status-neutral-border"
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Mensagem contextual em bloco, persistente. Para avisos temporários use Toast; para globais,
|
|
17
|
+
* Banner. `children` string vira `Text`; outros nós são renderizados como estão.
|
|
18
|
+
*/
|
|
19
|
+
function Alert({ className, status = "info", title, showIcon = true, action, onDismiss, dismissLabel = "Fechar", children, ...props }) {
|
|
20
|
+
const statusColor = useToken(statusTextToken[status]);
|
|
21
|
+
const closeColor = useToken("--color-button-ghost-text");
|
|
22
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
23
|
+
accessibilityRole: statusRole(status),
|
|
24
|
+
className: cn("flex-row items-start gap-3 rounded-md border-l-[3px] py-3 pr-3 pl-4", statusBg[status], border[status], className),
|
|
25
|
+
...props,
|
|
26
|
+
children: [
|
|
27
|
+
showIcon && /* @__PURE__ */ jsx(View, {
|
|
28
|
+
className: "shrink-0",
|
|
29
|
+
children: /* @__PURE__ */ jsx(StatusIcon, {
|
|
30
|
+
status,
|
|
31
|
+
color: statusColor
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsxs(View, {
|
|
35
|
+
className: "min-w-0 flex-1 items-start gap-1",
|
|
36
|
+
children: [
|
|
37
|
+
title ? /* @__PURE__ */ jsx(Text, {
|
|
38
|
+
className: cn("text-sm font-medium leading-5", statusText[status]),
|
|
39
|
+
children: title
|
|
40
|
+
}) : null,
|
|
41
|
+
typeof children === "string" ? /* @__PURE__ */ jsx(Text, {
|
|
42
|
+
className: "text-sm leading-5 text-text-primary",
|
|
43
|
+
children
|
|
44
|
+
}) : children,
|
|
45
|
+
action
|
|
46
|
+
]
|
|
47
|
+
}),
|
|
48
|
+
onDismiss && /* @__PURE__ */ jsx(IconButton, {
|
|
49
|
+
accessibilityLabel: dismissLabel,
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
size: "sm",
|
|
52
|
+
onPress: onDismiss,
|
|
53
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { color: closeColor })
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Alert };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport type { ReactNode } from 'react'\nimport { Text, View, type ViewProps } from 'react-native'\nimport { cn } from '../../utils/cn'\nimport {\n CloseIcon,\n type Status,\n StatusIcon,\n statusBg,\n statusRole,\n statusText,\n statusTextToken,\n} from '../_shared/status'\nimport { useToken } from '../_shared/use-token'\nimport { IconButton } from '../icon-button/icon-button'\n\nconst border: Record<Status, string> = {\n success: 'border-status-success-border',\n error: 'border-status-error-border',\n warning: 'border-status-warning-border',\n info: 'border-status-info-border',\n neutral: 'border-status-neutral-border',\n}\n\nexport type AlertProps = ViewProps & {\n className?: string\n status?: Status\n /** Resumo do alerta (opcional). */\n title?: string\n /** Mostra o ícone semântico do status. */\n showIcon?: boolean\n /** Ação contextual (ex.: um `<Button variant=\"ghost\">`). */\n action?: ReactNode\n /** Mostra o botão de fechar (×) e o chama ao tocar. */\n onDismiss?: () => void\n /** Nome acessível do botão de fechar. */\n dismissLabel?: string\n}\n\n/**\n * Mensagem contextual em bloco, persistente. Para avisos temporários use Toast; para globais,\n * Banner. `children` string vira `Text`; outros nós são renderizados como estão.\n */\nexport function Alert({\n className,\n status = 'info',\n title,\n showIcon = true,\n action,\n onDismiss,\n dismissLabel = 'Fechar',\n children,\n ...props\n}: AlertProps) {\n const statusColor = useToken(statusTextToken[status])\n const closeColor = useToken('--color-button-ghost-text')\n\n return (\n <View\n accessibilityRole={statusRole(status)}\n className={cn(\n 'flex-row items-start gap-3 rounded-md border-l-[3px] py-3 pr-3 pl-4',\n statusBg[status],\n border[status],\n className,\n )}\n {...props}\n >\n {showIcon && (\n <View className=\"shrink-0\">\n <StatusIcon status={status} color={statusColor} />\n </View>\n )}\n <View className=\"min-w-0 flex-1 items-start gap-1\">\n {title ? (\n <Text className={cn('text-sm font-medium leading-5', statusText[status])}>{title}</Text>\n ) : null}\n {typeof children === 'string' ? (\n <Text className=\"text-sm leading-5 text-text-primary\">{children}</Text>\n ) : (\n children\n )}\n {action}\n </View>\n {onDismiss && (\n <IconButton accessibilityLabel={dismissLabel} variant=\"ghost\" size=\"sm\" onPress={onDismiss}>\n <CloseIcon color={closeColor} />\n </IconButton>\n )}\n </View>\n )\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,SAAiC;CACrC,SAAS;CACT,OAAO;CACP,SAAS;CACT,MAAM;CACN,SAAS;AACX;;;;;AAqBA,SAAgB,MAAM,EACpB,WACA,SAAS,QACT,OACA,WAAW,MACX,QACA,WACA,eAAe,UACf,UACA,GAAG,SACU;CACb,MAAM,cAAc,SAAS,gBAAgB,OAAO;CACpD,MAAM,aAAa,SAAS,2BAA2B;CAEvD,OACE,qBAAC,MAAD;EACE,mBAAmB,WAAW,MAAM;EACpC,WAAW,GACT,uEACA,SAAS,SACT,OAAO,SACP,SACF;EACA,GAAI;EARN,UAAA;GAUG,YACC,oBAAC,MAAD;IAAM,WAAU;IACd,UAAA,oBAAC,YAAD;KAAoB;KAAQ,OAAO;IAAc,CAAA;GAC7C,CAAA;GAER,qBAAC,MAAD;IAAM,WAAU;IAAhB,UAAA;KACG,QACC,oBAAC,MAAD;MAAM,WAAW,GAAG,iCAAiC,WAAW,OAAO;MAAI,UAAA;KAAY,CAAA,IACrF;KACH,OAAO,aAAa,WACnB,oBAAC,MAAD;MAAM,WAAU;MAAuC;KAAe,CAAA,IAEtE;KAED;IACG;;GACL,aACC,oBAAC,YAAD;IAAY,oBAAoB;IAAc,SAAQ;IAAQ,MAAK;IAAK,SAAS;IAC/E,UAAA,oBAAC,WAAD,EAAW,OAAO,WAAa,CAAA;GACrB,CAAA;EAEV;;AAEV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ViewProps } from "react-native";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/avatar/avatar.d.ts
|
|
4
|
+
declare const avatarVariants: (props?: ({
|
|
5
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type AvatarProps = Omit<ViewProps, 'children'> & VariantProps<typeof avatarVariants> & {
|
|
8
|
+
className?: string;
|
|
9
|
+
/** URL da imagem. Se faltar ou falhar ao carregar, mostra as iniciais de `name`. */
|
|
10
|
+
src?: string;
|
|
11
|
+
/** Nome da pessoa ou entidade: vira as iniciais do fallback e o texto alternativo. */
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
/** Imagem circular de uma pessoa ou entidade, com iniciais como fallback. */
|
|
15
|
+
export declare function Avatar({ className, size, src, name, ...props }: AvatarProps): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Image, Text, View } from "react-native";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/components/avatar/avatar.tsx
|
|
7
|
+
const avatarVariants = cva("shrink-0 items-center justify-center overflow-hidden rounded-full bg-bg-tertiary", {
|
|
8
|
+
variants: { size: {
|
|
9
|
+
sm: "size-8",
|
|
10
|
+
md: "size-10",
|
|
11
|
+
lg: "size-14"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { size: "md" }
|
|
14
|
+
});
|
|
15
|
+
const initialsVariants = cva("font-medium text-text-secondary", {
|
|
16
|
+
variants: { size: {
|
|
17
|
+
sm: "text-xs",
|
|
18
|
+
md: "text-sm",
|
|
19
|
+
lg: "text-base"
|
|
20
|
+
} },
|
|
21
|
+
defaultVariants: { size: "md" }
|
|
22
|
+
});
|
|
23
|
+
function initials(name) {
|
|
24
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
25
|
+
return ((words[0]?.[0] ?? "") + (words.length > 1 ? words[words.length - 1]?.[0] ?? "" : "")).toUpperCase();
|
|
26
|
+
}
|
|
27
|
+
/** Imagem circular de uma pessoa ou entidade, com iniciais como fallback. */
|
|
28
|
+
function Avatar({ className, size, src, name, ...props }) {
|
|
29
|
+
const [failedSrc, setFailedSrc] = useState();
|
|
30
|
+
const showImage = src && failedSrc !== src;
|
|
31
|
+
return /* @__PURE__ */ jsx(View, {
|
|
32
|
+
accessible: true,
|
|
33
|
+
accessibilityRole: "image",
|
|
34
|
+
accessibilityLabel: name,
|
|
35
|
+
className: cn(avatarVariants({ size }), className),
|
|
36
|
+
...props,
|
|
37
|
+
children: showImage ? /* @__PURE__ */ jsx(Image, {
|
|
38
|
+
source: { uri: src },
|
|
39
|
+
onError: () => setFailedSrc(src),
|
|
40
|
+
resizeMode: "cover",
|
|
41
|
+
className: "size-full"
|
|
42
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
43
|
+
className: initialsVariants({ size }),
|
|
44
|
+
children: initials(name)
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Avatar };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","names":[],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { useState } from 'react'\nimport { Image, Text, View, type ViewProps } from 'react-native'\nimport { cn } from '../../utils/cn'\n\nconst avatarVariants = cva(\n 'shrink-0 items-center justify-center overflow-hidden rounded-full bg-bg-tertiary',\n {\n variants: {\n size: {\n sm: 'size-8',\n md: 'size-10',\n lg: 'size-14',\n },\n },\n defaultVariants: { size: 'md' },\n },\n)\n\nconst initialsVariants = cva('font-medium text-text-secondary', {\n variants: {\n size: { sm: 'text-xs', md: 'text-sm', lg: 'text-base' },\n },\n defaultVariants: { size: 'md' },\n})\n\nexport type AvatarProps = Omit<ViewProps, 'children'> &\n VariantProps<typeof avatarVariants> & {\n className?: string\n /** URL da imagem. Se faltar ou falhar ao carregar, mostra as iniciais de `name`. */\n src?: string\n /** Nome da pessoa ou entidade: vira as iniciais do fallback e o texto alternativo. */\n name: string\n }\n\nfunction initials(name: string) {\n const words = name.trim().split(/\\s+/).filter(Boolean)\n const first = words[0]?.[0] ?? ''\n const last = words.length > 1 ? (words[words.length - 1]?.[0] ?? '') : ''\n return (first + last).toUpperCase()\n}\n\n/** Imagem circular de uma pessoa ou entidade, com iniciais como fallback. */\nexport function Avatar({ className, size, src, name, ...props }: AvatarProps) {\n const [failedSrc, setFailedSrc] = useState<string>()\n const showImage = src && failedSrc !== src\n\n return (\n // accessible agrupa o conteúdo num único elemento \"img\" com o nome como rótulo\n <View\n accessible\n accessibilityRole=\"image\"\n accessibilityLabel={name}\n className={cn(avatarVariants({ size }), className)}\n {...props}\n >\n {showImage ? (\n <Image\n source={{ uri: src }}\n onError={() => setFailedSrc(src)}\n resizeMode=\"cover\"\n className=\"size-full\"\n />\n ) : (\n <Text className={initialsVariants({ size })}>{initials(name)}</Text>\n )}\n </View>\n )\n}\n"],"mappings":";;;;;;AAOA,MAAM,iBAAiB,IACrB,oFACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CACF;AAEA,MAAM,mBAAmB,IAAI,mCAAmC;CAC9D,UAAU,EACR,MAAM;EAAE,IAAI;EAAW,IAAI;EAAW,IAAI;CAAY,EACxD;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CAAC;AAWD,SAAS,SAAS,MAAc;CAC9B,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CAGrD,SAFc,MAAM,EAAE,GAAG,MAAM,OAClB,MAAM,SAAS,IAAK,MAAM,MAAM,SAAS,EAAE,GAAG,MAAM,KAAM,IAAA,CACjD,YAAY;AACpC;;AAGA,SAAgB,OAAO,EAAE,WAAW,MAAM,KAAK,MAAM,GAAG,SAAsB;CAC5E,MAAM,CAAC,WAAW,gBAAgB,SAAiB;CACnD,MAAM,YAAY,OAAO,cAAc;CAEvC,OAEE,oBAAC,MAAD;EACE,YAAA;EACA,mBAAkB;EAClB,oBAAoB;EACpB,WAAW,GAAG,eAAe,EAAE,KAAK,CAAC,GAAG,SAAS;EACjD,GAAI;EAEH,UAAA,YACC,oBAAC,OAAD;GACE,QAAQ,EAAE,KAAK,IAAI;GACnB,eAAe,aAAa,GAAG;GAC/B,YAAW;GACX,WAAU;EACX,CAAA,IAED,oBAAC,MAAD;GAAM,WAAW,iBAAiB,EAAE,KAAK,CAAC;GAAI,UAAA,SAAS,IAAI;EAAQ,CAAA;CAEjE,CAAA;AAEV"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ViewProps } from "react-native";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/badge/badge.d.ts
|
|
4
|
+
declare const badgeVariants: (props?: ({
|
|
5
|
+
status?: "error" | "info" | "neutral" | "pending" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type BadgeProps = Omit<ViewProps, 'children'> & VariantProps<typeof badgeVariants> & {
|
|
8
|
+
className?: string;
|
|
9
|
+
children: string;
|
|
10
|
+
/** Indicador circular antes do texto, na cor do status. */
|
|
11
|
+
dot?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** Indicador de status, não interativo. Para categorizar ou rotular conteúdo, use Tag. */
|
|
14
|
+
export declare function Badge({ className, status, dot, children, ...props }: BadgeProps): import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
//#region src/components/badge/badge.tsx
|
|
6
|
+
const badgeVariants = cva("flex-row items-center justify-center gap-1 self-start rounded-full px-2 py-0.5", {
|
|
7
|
+
variants: { status: {
|
|
8
|
+
success: "bg-status-success-bg",
|
|
9
|
+
error: "bg-status-error-bg",
|
|
10
|
+
warning: "bg-status-warning-bg",
|
|
11
|
+
info: "bg-status-info-bg",
|
|
12
|
+
neutral: "bg-status-neutral-bg",
|
|
13
|
+
pending: "bg-status-pending-bg"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { status: "neutral" }
|
|
16
|
+
});
|
|
17
|
+
const labelVariants = cva("text-xs font-medium leading-4", {
|
|
18
|
+
variants: { status: {
|
|
19
|
+
success: "text-status-success-text",
|
|
20
|
+
error: "text-status-error-text",
|
|
21
|
+
warning: "text-status-warning-text",
|
|
22
|
+
info: "text-status-info-text",
|
|
23
|
+
neutral: "text-status-neutral-text",
|
|
24
|
+
pending: "text-status-pending-text"
|
|
25
|
+
} },
|
|
26
|
+
defaultVariants: { status: "neutral" }
|
|
27
|
+
});
|
|
28
|
+
const dotVariants = cva("size-1.5 shrink-0 rounded-[3px]", {
|
|
29
|
+
variants: { status: {
|
|
30
|
+
success: "bg-status-success-text",
|
|
31
|
+
error: "bg-status-error-text",
|
|
32
|
+
warning: "bg-status-warning-text",
|
|
33
|
+
info: "bg-status-info-text",
|
|
34
|
+
neutral: "bg-status-neutral-text",
|
|
35
|
+
pending: "bg-status-pending-text"
|
|
36
|
+
} },
|
|
37
|
+
defaultVariants: { status: "neutral" }
|
|
38
|
+
});
|
|
39
|
+
/** Indicador de status, não interativo. Para categorizar ou rotular conteúdo, use Tag. */
|
|
40
|
+
function Badge({ className, status, dot = false, children, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
42
|
+
className: cn(badgeVariants({ status }), className),
|
|
43
|
+
...props,
|
|
44
|
+
children: [dot && /* @__PURE__ */ jsx(View, {
|
|
45
|
+
accessibilityElementsHidden: true,
|
|
46
|
+
importantForAccessibility: "no-hide-descendants",
|
|
47
|
+
className: dotVariants({ status })
|
|
48
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
49
|
+
className: labelVariants({ status }),
|
|
50
|
+
children
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Badge };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../../src/components/badge/badge.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Text, View, type ViewProps } from 'react-native'\nimport { cn } from '../../utils/cn'\n\nconst badgeVariants = cva(\n 'flex-row items-center justify-center gap-1 self-start rounded-full px-2 py-0.5',\n {\n variants: {\n status: {\n success: 'bg-status-success-bg',\n error: 'bg-status-error-bg',\n warning: 'bg-status-warning-bg',\n info: 'bg-status-info-bg',\n neutral: 'bg-status-neutral-bg',\n pending: 'bg-status-pending-bg',\n },\n },\n defaultVariants: { status: 'neutral' },\n },\n)\n\nconst labelVariants = cva('text-xs font-medium leading-4', {\n variants: {\n status: {\n success: 'text-status-success-text',\n error: 'text-status-error-text',\n warning: 'text-status-warning-text',\n info: 'text-status-info-text',\n neutral: 'text-status-neutral-text',\n pending: 'text-status-pending-text',\n },\n },\n defaultVariants: { status: 'neutral' },\n})\n\n// Sem `currentColor` no native: o ponto usa o token de texto do status.\nconst dotVariants = cva('size-1.5 shrink-0 rounded-[3px]', {\n variants: {\n status: {\n success: 'bg-status-success-text',\n error: 'bg-status-error-text',\n warning: 'bg-status-warning-text',\n info: 'bg-status-info-text',\n neutral: 'bg-status-neutral-text',\n pending: 'bg-status-pending-text',\n },\n },\n defaultVariants: { status: 'neutral' },\n})\n\nexport type BadgeProps = Omit<ViewProps, 'children'> &\n VariantProps<typeof badgeVariants> & {\n className?: string\n children: string\n /** Indicador circular antes do texto, na cor do status. */\n dot?: boolean\n }\n\n/** Indicador de status, não interativo. Para categorizar ou rotular conteúdo, use Tag. */\nexport function Badge({ className, status, dot = false, children, ...props }: BadgeProps) {\n return (\n <View className={cn(badgeVariants({ status }), className)} {...props}>\n {dot && (\n <View\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n className={dotVariants({ status })}\n />\n )}\n <Text className={labelVariants({ status })}>{children}</Text>\n </View>\n )\n}\n"],"mappings":";;;;;AAMA,MAAM,gBAAgB,IACpB,kFACA;CACE,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;EACP,SAAS;EACT,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EAAE,QAAQ,UAAU;AACvC,CACF;AAEA,MAAM,gBAAgB,IAAI,iCAAiC;CACzD,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;EACP,SAAS;EACT,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EAAE,QAAQ,UAAU;AACvC,CAAC;AAGD,MAAM,cAAc,IAAI,mCAAmC;CACzD,UAAU,EACR,QAAQ;EACN,SAAS;EACT,OAAO;EACP,SAAS;EACT,MAAM;EACN,SAAS;EACT,SAAS;CACX,EACF;CACA,iBAAiB,EAAE,QAAQ,UAAU;AACvC,CAAC;;AAWD,SAAgB,MAAM,EAAE,WAAW,QAAQ,MAAM,OAAO,UAAU,GAAG,SAAqB;CACxF,OACE,qBAAC,MAAD;EAAM,WAAW,GAAG,cAAc,EAAE,OAAO,CAAC,GAAG,SAAS;EAAG,GAAI;EAA/D,UAAA,CACG,OACC,oBAAC,MAAD;GACE,6BAAA;GACA,2BAA0B;GAC1B,WAAW,YAAY,EAAE,OAAO,CAAC;EAClC,CAAA,GAEH,oBAAC,MAAD;GAAM,WAAW,cAAc,EAAE,OAAO,CAAC;GAAI;EAAe,CAAA,CACxD;;AAEV"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Status } from "../_shared/status.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { ViewProps } from "react-native";
|
|
4
|
+
//#region src/components/banner/banner.d.ts
|
|
5
|
+
export type BannerProps = ViewProps & {
|
|
6
|
+
className?: string;
|
|
7
|
+
status?: Status;
|
|
8
|
+
/** Mostra o ícone semântico do status. */
|
|
9
|
+
showIcon?: boolean;
|
|
10
|
+
/** Ação ao lado da mensagem (ex.: um `<Button variant="ghost">`). */
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
/** Mostra o botão de fechar (×) e o chama ao tocar. */
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
/** Nome acessível do botão de fechar. */
|
|
15
|
+
dismissLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Mensagem persistente em largura total, no topo da interface (manutenção, anúncios).
|
|
19
|
+
* `children` string vira `Text`; outros nós são renderizados como estão.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Banner({ className, status, showIcon, action, onDismiss, dismissLabel, children, ...props }: BannerProps): import("react").JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { CloseIcon, StatusIcon, statusBg, statusRole, statusTextToken } from "../_shared/status.js";
|
|
3
|
+
import { useToken } from "../_shared/use-token.js";
|
|
4
|
+
import { IconButton } from "../icon-button/icon-button.js";
|
|
5
|
+
import { Text, View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/banner/banner.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Mensagem persistente em largura total, no topo da interface (manutenção, anúncios).
|
|
10
|
+
* `children` string vira `Text`; outros nós são renderizados como estão.
|
|
11
|
+
*/
|
|
12
|
+
function Banner({ className, status = "info", showIcon = true, action, onDismiss, dismissLabel = "Fechar", children, ...props }) {
|
|
13
|
+
const statusColor = useToken(statusTextToken[status]);
|
|
14
|
+
const closeColor = useToken("--color-button-ghost-text");
|
|
15
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
16
|
+
accessibilityRole: statusRole(status),
|
|
17
|
+
className: cn("w-full flex-row items-start gap-3 px-4 py-3", statusBg[status], className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [
|
|
20
|
+
showIcon && /* @__PURE__ */ jsx(View, {
|
|
21
|
+
className: "shrink-0",
|
|
22
|
+
children: /* @__PURE__ */ jsx(StatusIcon, {
|
|
23
|
+
status,
|
|
24
|
+
color: statusColor
|
|
25
|
+
})
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsxs(View, {
|
|
28
|
+
className: "min-w-0 flex-1 flex-row items-center gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ jsx(View, {
|
|
30
|
+
className: "min-w-0 flex-1",
|
|
31
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, {
|
|
32
|
+
className: "text-sm leading-5 text-text-primary",
|
|
33
|
+
children
|
|
34
|
+
}) : children
|
|
35
|
+
}), action]
|
|
36
|
+
}),
|
|
37
|
+
onDismiss && /* @__PURE__ */ jsx(IconButton, {
|
|
38
|
+
accessibilityLabel: dismissLabel,
|
|
39
|
+
variant: "ghost",
|
|
40
|
+
size: "sm",
|
|
41
|
+
onPress: onDismiss,
|
|
42
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { color: closeColor })
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Banner };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","names":[],"sources":["../../../src/components/banner/banner.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport type { ReactNode } from 'react'\nimport { Text, View, type ViewProps } from 'react-native'\nimport { cn } from '../../utils/cn'\nimport {\n CloseIcon,\n type Status,\n StatusIcon,\n statusBg,\n statusRole,\n statusTextToken,\n} from '../_shared/status'\nimport { useToken } from '../_shared/use-token'\nimport { IconButton } from '../icon-button/icon-button'\n\nexport type BannerProps = ViewProps & {\n className?: string\n status?: Status\n /** Mostra o ícone semântico do status. */\n showIcon?: boolean\n /** Ação ao lado da mensagem (ex.: um `<Button variant=\"ghost\">`). */\n action?: ReactNode\n /** Mostra o botão de fechar (×) e o chama ao tocar. */\n onDismiss?: () => void\n /** Nome acessível do botão de fechar. */\n dismissLabel?: string\n}\n\n/**\n * Mensagem persistente em largura total, no topo da interface (manutenção, anúncios).\n * `children` string vira `Text`; outros nós são renderizados como estão.\n */\nexport function Banner({\n className,\n status = 'info',\n showIcon = true,\n action,\n onDismiss,\n dismissLabel = 'Fechar',\n children,\n ...props\n}: BannerProps) {\n const statusColor = useToken(statusTextToken[status])\n const closeColor = useToken('--color-button-ghost-text')\n\n return (\n <View\n accessibilityRole={statusRole(status)}\n className={cn('w-full flex-row items-start gap-3 px-4 py-3', statusBg[status], className)}\n {...props}\n >\n {showIcon && (\n <View className=\"shrink-0\">\n <StatusIcon status={status} color={statusColor} />\n </View>\n )}\n <View className=\"min-w-0 flex-1 flex-row items-center gap-2\">\n <View className=\"min-w-0 flex-1\">\n {typeof children === 'string' ? (\n <Text className=\"text-sm leading-5 text-text-primary\">{children}</Text>\n ) : (\n children\n )}\n </View>\n {action}\n </View>\n {onDismiss && (\n <IconButton accessibilityLabel={dismissLabel} variant=\"ghost\" size=\"sm\" onPress={onDismiss}>\n <CloseIcon color={closeColor} />\n </IconButton>\n )}\n </View>\n )\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAgB,OAAO,EACrB,WACA,SAAS,QACT,WAAW,MACX,QACA,WACA,eAAe,UACf,UACA,GAAG,SACW;CACd,MAAM,cAAc,SAAS,gBAAgB,OAAO;CACpD,MAAM,aAAa,SAAS,2BAA2B;CAEvD,OACE,qBAAC,MAAD;EACE,mBAAmB,WAAW,MAAM;EACpC,WAAW,GAAG,+CAA+C,SAAS,SAAS,SAAS;EACxF,GAAI;EAHN,UAAA;GAKG,YACC,oBAAC,MAAD;IAAM,WAAU;IACd,UAAA,oBAAC,YAAD;KAAoB;KAAQ,OAAO;IAAc,CAAA;GAC7C,CAAA;GAER,qBAAC,MAAD;IAAM,WAAU;IAAhB,UAAA,CACE,oBAAC,MAAD;KAAM,WAAU;KACb,UAAA,OAAO,aAAa,WACnB,oBAAC,MAAD;MAAM,WAAU;MAAuC;KAAe,CAAA,IAEtE;IAEE,CAAA,GACL,MACG;;GACL,aACC,oBAAC,YAAD;IAAY,oBAAoB;IAAc,SAAQ;IAAQ,MAAK;IAAK,SAAS;IAC/E,UAAA,oBAAC,WAAD,EAAW,OAAO,WAAa,CAAA;GACrB,CAAA;EAEV;;AAEV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { PressableProps, ViewProps } from "react-native";
|
|
3
|
+
//#region src/components/breadcrumb/breadcrumb.d.ts
|
|
4
|
+
export type BreadcrumbProps = ViewProps & {
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/** Hierarquia de páginas (Início › Seção › Página). Para fluxos sequenciais, use Stepper. */
|
|
8
|
+
export declare function Breadcrumb({ className, children, accessibilityLabel, ...props }: BreadcrumbProps): import("react").JSX.Element;
|
|
9
|
+
export type BreadcrumbItemProps = Omit<PressableProps, 'children' | 'style'> & {
|
|
10
|
+
/** Estilo do item inteiro (link + separador). */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Marca a página atual: não é tocável e fica com estado `selected` (RN não tem aria-current). */
|
|
13
|
+
current?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Um item da trilha. O separador (›) aparece depois de todos, menos do último. No lugar de
|
|
18
|
+
* `href`/`asChild` do web, use `onPress` para navegar (ex.: `router.push`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function BreadcrumbItem({ className, current, children, accessibilityState, ...props }: BreadcrumbItemProps): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { ChevronRightIcon } from "../_shared/status.js";
|
|
3
|
+
import { useToken } from "../_shared/use-token.js";
|
|
4
|
+
import { Children, createContext, useContext } from "react";
|
|
5
|
+
import { Pressable, Text, View } from "react-native";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/breadcrumb/breadcrumb.tsx
|
|
8
|
+
const ItemContext = createContext({ isLast: false });
|
|
9
|
+
/** Hierarquia de páginas (Início › Seção › Página). Para fluxos sequenciais, use Stepper. */
|
|
10
|
+
function Breadcrumb({ className, children, accessibilityLabel = "Breadcrumb", ...props }) {
|
|
11
|
+
const items = Children.toArray(children);
|
|
12
|
+
return /* @__PURE__ */ jsx(View, {
|
|
13
|
+
accessibilityLabel,
|
|
14
|
+
className: cn("flex-row flex-wrap items-center gap-1", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: items.map((child, index) => /* @__PURE__ */ jsx(ItemContext.Provider, {
|
|
17
|
+
value: { isLast: index === items.length - 1 },
|
|
18
|
+
children: child
|
|
19
|
+
}, index))
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Um item da trilha. O separador (›) aparece depois de todos, menos do último. No lugar de
|
|
24
|
+
* `href`/`asChild` do web, use `onPress` para navegar (ex.: `router.push`).
|
|
25
|
+
*/
|
|
26
|
+
function BreadcrumbItem({ className, current = false, children, accessibilityState, ...props }) {
|
|
27
|
+
const { isLast } = useContext(ItemContext);
|
|
28
|
+
const separatorColor = useToken("--color-text-tertiary");
|
|
29
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
30
|
+
className: cn("flex-row items-center gap-2", className),
|
|
31
|
+
children: [current ? /* @__PURE__ */ jsx(View, {
|
|
32
|
+
accessible: true,
|
|
33
|
+
accessibilityRole: "text",
|
|
34
|
+
accessibilityState: { selected: true },
|
|
35
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, {
|
|
36
|
+
className: "text-sm font-medium text-text-primary",
|
|
37
|
+
children
|
|
38
|
+
}) : children
|
|
39
|
+
}) : /* @__PURE__ */ jsx(Pressable, {
|
|
40
|
+
accessibilityRole: "link",
|
|
41
|
+
accessibilityState,
|
|
42
|
+
hitSlop: 8,
|
|
43
|
+
...props,
|
|
44
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, {
|
|
45
|
+
className: "text-sm text-text-secondary",
|
|
46
|
+
children
|
|
47
|
+
}) : children
|
|
48
|
+
}), isLast ? null : /* @__PURE__ */ jsx(ChevronRightIcon, { color: separatorColor })]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Breadcrumb, BreadcrumbItem };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../../src/components/breadcrumb/breadcrumb.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport { Children, createContext, type ReactNode, useContext } from 'react'\nimport { Pressable, type PressableProps, Text, View, type ViewProps } from 'react-native'\nimport { cn } from '../../utils/cn'\nimport { ChevronRightIcon } from '../_shared/status'\nimport { useToken } from '../_shared/use-token'\n\nconst ItemContext = createContext({ isLast: false })\n\nexport type BreadcrumbProps = ViewProps & {\n className?: string\n}\n\n/** Hierarquia de páginas (Início › Seção › Página). Para fluxos sequenciais, use Stepper. */\nexport function Breadcrumb({\n className,\n children,\n accessibilityLabel = 'Breadcrumb',\n ...props\n}: BreadcrumbProps) {\n const items = Children.toArray(children)\n\n return (\n // RN não tem role \"navigation\": o nome acessível fica no accessibilityLabel.\n <View\n accessibilityLabel={accessibilityLabel}\n className={cn('flex-row flex-wrap items-center gap-1', className)}\n {...props}\n >\n {items.map((child, index) => (\n <ItemContext.Provider\n // biome-ignore lint/suspicious/noArrayIndexKey: a posição do item é a identidade dele\n key={index}\n value={{ isLast: index === items.length - 1 }}\n >\n {child}\n </ItemContext.Provider>\n ))}\n </View>\n )\n}\n\nexport type BreadcrumbItemProps = Omit<PressableProps, 'children' | 'style'> & {\n /** Estilo do item inteiro (link + separador). */\n className?: string\n /** Marca a página atual: não é tocável e fica com estado `selected` (RN não tem aria-current). */\n current?: boolean\n children?: ReactNode\n}\n\n/**\n * Um item da trilha. O separador (›) aparece depois de todos, menos do último. No lugar de\n * `href`/`asChild` do web, use `onPress` para navegar (ex.: `router.push`).\n */\nexport function BreadcrumbItem({\n className,\n current = false,\n children,\n accessibilityState,\n ...props\n}: BreadcrumbItemProps) {\n const { isLast } = useContext(ItemContext)\n const separatorColor = useToken('--color-text-tertiary')\n\n return (\n <View className={cn('flex-row items-center gap-2', className)}>\n {current ? (\n <View accessible accessibilityRole=\"text\" accessibilityState={{ selected: true }}>\n {typeof children === 'string' ? (\n <Text className=\"text-sm font-medium text-text-primary\">{children}</Text>\n ) : (\n children\n )}\n </View>\n ) : (\n <Pressable\n accessibilityRole=\"link\"\n accessibilityState={accessibilityState}\n hitSlop={8}\n {...props}\n >\n {typeof children === 'string' ? (\n <Text className=\"text-sm text-text-secondary\">{children}</Text>\n ) : (\n children\n )}\n </Pressable>\n )}\n {isLast ? null : <ChevronRightIcon color={separatorColor} />}\n </View>\n )\n}\n"],"mappings":";;;;;;;AAQA,MAAM,cAAc,cAAc,EAAE,QAAQ,MAAM,CAAC;;AAOnD,SAAgB,WAAW,EACzB,WACA,UACA,qBAAqB,cACrB,GAAG,SACe;CAClB,MAAM,QAAQ,SAAS,QAAQ,QAAQ;CAEvC,OAEE,oBAAC,MAAD;EACsB;EACpB,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;EAEH,UAAA,MAAM,KAAK,OAAO,UACjB,oBAAC,YAAY,UAAb;GAGE,OAAO,EAAE,QAAQ,UAAU,MAAM,SAAS,EAAE;GAE3C,UAAA;EACmB,GAJf,KAIe,CACvB;CACG,CAAA;AAEV;;;;;AAcA,SAAgB,eAAe,EAC7B,WACA,UAAU,OACV,UACA,oBACA,GAAG,SACmB;CACtB,MAAM,EAAE,WAAW,WAAW,WAAW;CACzC,MAAM,iBAAiB,SAAS,uBAAuB;CAEvD,OACE,qBAAC,MAAD;EAAM,WAAW,GAAG,+BAA+B,SAAS;EAA5D,UAAA,CACG,UACC,oBAAC,MAAD;GAAM,YAAA;GAAW,mBAAkB;GAAO,oBAAoB,EAAE,UAAU,KAAK;GAC5E,UAAA,OAAO,aAAa,WACnB,oBAAC,MAAD;IAAM,WAAU;IAAyC;GAAe,CAAA,IAExE;EAEE,CAAA,IAEN,oBAAC,WAAD;GACE,mBAAkB;GACE;GACpB,SAAS;GACT,GAAI;GAEH,UAAA,OAAO,aAAa,WACnB,oBAAC,MAAD;IAAM,WAAU;IAA+B;GAAe,CAAA,IAE9D;EAEO,CAAA,GAEZ,SAAS,OAAO,oBAAC,kBAAD,EAAkB,OAAO,eAAiB,CAAA,CACvD;;AAEV"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { PressableProps } from "react-native";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/button/button.d.ts
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "destructive" | "ghost" | "primary" | "secondary" | "tertiary" | null | undefined;
|
|
7
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export type ButtonProps = Omit<PressableProps, 'children' | 'style'> & VariantProps<typeof buttonVariants> & {
|
|
10
|
+
className?: string;
|
|
11
|
+
children: string;
|
|
12
|
+
/** Ícone antes do texto. Some junto ao label quando `loading` está ativo. */
|
|
13
|
+
leadingIcon?: ReactNode;
|
|
14
|
+
/** Ícone depois do texto. Some junto ao label quando `loading` está ativo. */
|
|
15
|
+
trailingIcon?: ReactNode;
|
|
16
|
+
/** Substitui os ícones por um spinner e desabilita o botão. */
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function Button({ className, variant, size, leadingIcon, trailingIcon, loading, disabled, children, accessibilityState, ...props }: ButtonProps): import("react").JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
3
|
+
import { Pressable, Text, View } from "react-native";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/components/button/button.tsx
|
|
7
|
+
const buttonVariants = cva("flex-row items-center justify-center rounded-full", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
primary: "bg-button-primary-bg active:bg-button-primary-bg-active disabled:bg-button-disabled-bg",
|
|
11
|
+
secondary: "bg-button-secondary-bg active:bg-button-secondary-bg-hover disabled:bg-button-disabled-bg",
|
|
12
|
+
tertiary: "border border-button-tertiary-border bg-transparent active:bg-bg-secondary",
|
|
13
|
+
ghost: "bg-transparent active:bg-button-secondary-bg-hover",
|
|
14
|
+
destructive: "bg-button-destructive-bg active:bg-button-destructive-bg-active disabled:bg-button-disabled-bg"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
lg: "h-14 gap-2 px-6",
|
|
18
|
+
md: "h-11 gap-2 px-6",
|
|
19
|
+
sm: "h-9 gap-1 px-4"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "primary",
|
|
24
|
+
size: "md"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const labelVariants = cva("font-semibold", {
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
primary: "text-button-primary-text",
|
|
31
|
+
secondary: "text-button-secondary-text",
|
|
32
|
+
tertiary: "text-button-tertiary-text",
|
|
33
|
+
ghost: "text-button-ghost-text",
|
|
34
|
+
destructive: "text-button-destructive-text"
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
lg: "text-base",
|
|
38
|
+
md: "text-sm",
|
|
39
|
+
sm: "text-sm"
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
true: "text-button-disabled-text",
|
|
43
|
+
false: ""
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
compoundVariants: [{
|
|
47
|
+
variant: "destructive",
|
|
48
|
+
disabled: true,
|
|
49
|
+
className: "text-button-disabled-text-destructive"
|
|
50
|
+
}],
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "primary",
|
|
53
|
+
size: "md",
|
|
54
|
+
disabled: false
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
function Button({ className, variant, size, leadingIcon, trailingIcon, loading = false, disabled, children, accessibilityState, ...props }) {
|
|
58
|
+
const isDisabled = Boolean(disabled || loading);
|
|
59
|
+
return /* @__PURE__ */ jsxs(Pressable, {
|
|
60
|
+
accessibilityRole: "button",
|
|
61
|
+
accessibilityState: {
|
|
62
|
+
...accessibilityState,
|
|
63
|
+
disabled: isDisabled,
|
|
64
|
+
busy: loading
|
|
65
|
+
},
|
|
66
|
+
disabled: isDisabled,
|
|
67
|
+
className: cn(buttonVariants({
|
|
68
|
+
variant,
|
|
69
|
+
size
|
|
70
|
+
}), className),
|
|
71
|
+
...props,
|
|
72
|
+
children: [
|
|
73
|
+
loading ? /* @__PURE__ */ jsx(Spinner, { size: size === "lg" ? "md" : "sm" }) : leadingIcon,
|
|
74
|
+
/* @__PURE__ */ jsx(Text, {
|
|
75
|
+
className: labelVariants({
|
|
76
|
+
variant,
|
|
77
|
+
size,
|
|
78
|
+
disabled: isDisabled
|
|
79
|
+
}),
|
|
80
|
+
children
|
|
81
|
+
}),
|
|
82
|
+
!loading && trailingIcon ? /* @__PURE__ */ jsx(View, { children: trailingIcon }) : null
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Button };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport type { ReactNode } from 'react'\nimport { Pressable, type PressableProps, Text, View } from 'react-native'\nimport { cn } from '../../utils/cn'\nimport { Spinner } from '../spinner/spinner'\n\nconst buttonVariants = cva('flex-row items-center justify-center rounded-full', {\n variants: {\n variant: {\n primary:\n 'bg-button-primary-bg active:bg-button-primary-bg-active disabled:bg-button-disabled-bg',\n secondary:\n 'bg-button-secondary-bg active:bg-button-secondary-bg-hover disabled:bg-button-disabled-bg',\n tertiary: 'border border-button-tertiary-border bg-transparent active:bg-bg-secondary',\n ghost: 'bg-transparent active:bg-button-secondary-bg-hover',\n destructive:\n 'bg-button-destructive-bg active:bg-button-destructive-bg-active disabled:bg-button-disabled-bg',\n },\n size: {\n lg: 'h-14 gap-2 px-6',\n md: 'h-11 gap-2 px-6',\n sm: 'h-9 gap-1 px-4',\n },\n },\n defaultVariants: { variant: 'primary', size: 'md' },\n})\n\nconst labelVariants = cva('font-semibold', {\n variants: {\n variant: {\n primary: 'text-button-primary-text',\n secondary: 'text-button-secondary-text',\n tertiary: 'text-button-tertiary-text',\n ghost: 'text-button-ghost-text',\n destructive: 'text-button-destructive-text',\n },\n size: { lg: 'text-base', md: 'text-sm', sm: 'text-sm' },\n disabled: {\n true: 'text-button-disabled-text',\n false: '',\n },\n },\n compoundVariants: [\n { variant: 'destructive', disabled: true, className: 'text-button-disabled-text-destructive' },\n ],\n defaultVariants: { variant: 'primary', size: 'md', disabled: false },\n})\n\nexport type ButtonProps = Omit<PressableProps, 'children' | 'style'> &\n VariantProps<typeof buttonVariants> & {\n className?: string\n children: string\n /** Ícone antes do texto. Some junto ao label quando `loading` está ativo. */\n leadingIcon?: ReactNode\n /** Ícone depois do texto. Some junto ao label quando `loading` está ativo. */\n trailingIcon?: ReactNode\n /** Substitui os ícones por um spinner e desabilita o botão. */\n loading?: boolean\n }\n\nexport function Button({\n className,\n variant,\n size,\n leadingIcon,\n trailingIcon,\n loading = false,\n disabled,\n children,\n accessibilityState,\n ...props\n}: ButtonProps) {\n const isDisabled = Boolean(disabled || loading)\n\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityState={{ ...accessibilityState, disabled: isDisabled, busy: loading }}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {loading ? <Spinner size={size === 'lg' ? 'md' : 'sm'} /> : leadingIcon}\n <Text className={labelVariants({ variant, size, disabled: isDisabled })}>{children}</Text>\n {!loading && trailingIcon ? <View>{trailingIcon}</View> : null}\n </Pressable>\n )\n}\n"],"mappings":";;;;;;AAQA,MAAM,iBAAiB,IAAI,qDAAqD;CAC9E,UAAU;EACR,SAAS;GACP,SACE;GACF,WACE;GACF,UAAU;GACV,OAAO;GACP,aACE;EACJ;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EAAE,SAAS;EAAW,MAAM;CAAK;AACpD,CAAC;AAED,MAAM,gBAAgB,IAAI,iBAAiB;CACzC,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,UAAU;GACV,OAAO;GACP,aAAa;EACf;EACA,MAAM;GAAE,IAAI;GAAa,IAAI;GAAW,IAAI;EAAU;EACtD,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,kBAAkB,CAChB;EAAE,SAAS;EAAe,UAAU;EAAM,WAAW;CAAwC,CAC/F;CACA,iBAAiB;EAAE,SAAS;EAAW,MAAM;EAAM,UAAU;CAAM;AACrE,CAAC;AAcD,SAAgB,OAAO,EACrB,WACA,SACA,MACA,aACA,cACA,UAAU,OACV,UACA,UACA,oBACA,GAAG,SACW;CACd,MAAM,aAAa,QAAQ,YAAY,OAAO;CAE9C,OACE,qBAAC,WAAD;EACE,mBAAkB;EAClB,oBAAoB;GAAE,GAAG;GAAoB,UAAU;GAAY,MAAM;EAAQ;EACjF,UAAU;EACV,WAAW,GAAG,eAAe;GAAE;GAAS;EAAK,CAAC,GAAG,SAAS;EAC1D,GAAI;EALN,UAAA;GAOG,UAAU,oBAAC,SAAD,EAAS,MAAM,SAAS,OAAO,OAAO,KAAO,CAAA,IAAI;GAC5D,oBAAC,MAAD;IAAM,WAAW,cAAc;KAAE;KAAS;KAAM,UAAU;IAAW,CAAC;IAAI;GAAe,CAAA;GACxF,CAAC,WAAW,eAAe,oBAAC,MAAD,EAAA,UAAO,aAAmB,CAAA,IAAI;EACjD;;AAEf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ViewProps } from "react-native";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/card/card.d.ts
|
|
4
|
+
declare const cardVariants: (props?: ({
|
|
5
|
+
padding?: "lg" | "md" | "none" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type CardProps = ViewProps & VariantProps<typeof cardVariants> & {
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Contêiner elevado (borda, raio e sombra) para agrupar conteúdo relacionado.
|
|
12
|
+
* Use `padding="none"` para mídia de ponta a ponta. No native, o texto não herda cor: use
|
|
13
|
+
* `text-text-primary` nos `Text` filhos.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Card({ className, padding, ...props }: CardProps): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
//#region src/components/card/card.tsx
|
|
6
|
+
const cardVariants = cva("rounded-md border border-border-default bg-surface-elevated shadow-md", {
|
|
7
|
+
variants: { padding: {
|
|
8
|
+
none: "",
|
|
9
|
+
md: "p-4",
|
|
10
|
+
lg: "p-6"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { padding: "md" }
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Contêiner elevado (borda, raio e sombra) para agrupar conteúdo relacionado.
|
|
16
|
+
* Use `padding="none"` para mídia de ponta a ponta. No native, o texto não herda cor: use
|
|
17
|
+
* `text-text-primary` nos `Text` filhos.
|
|
18
|
+
*/
|
|
19
|
+
function Card({ className, padding, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(View, {
|
|
21
|
+
className: cn(cardVariants({ padding }), className),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Card };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/card/card.tsx"],"sourcesContent":["/// <reference types=\"uniwind/types\" />\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { View, type ViewProps } from 'react-native'\nimport { cn } from '../../utils/cn'\n\nconst cardVariants = cva('rounded-md border border-border-default bg-surface-elevated shadow-md', {\n variants: {\n padding: { none: '', md: 'p-4', lg: 'p-6' },\n },\n defaultVariants: { padding: 'md' },\n})\n\nexport type CardProps = ViewProps & VariantProps<typeof cardVariants> & { className?: string }\n\n/**\n * Contêiner elevado (borda, raio e sombra) para agrupar conteúdo relacionado.\n * Use `padding=\"none\"` para mídia de ponta a ponta. No native, o texto não herda cor: use\n * `text-text-primary` nos `Text` filhos.\n */\nexport function Card({ className, padding, ...props }: CardProps) {\n return <View className={cn(cardVariants({ padding }), className)} {...props} />\n}\n"],"mappings":";;;;;AAMA,MAAM,eAAe,IAAI,yEAAyE;CAChG,UAAU,EACR,SAAS;EAAE,MAAM;EAAI,IAAI;EAAO,IAAI;CAAM,EAC5C;CACA,iBAAiB,EAAE,SAAS,KAAK;AACnC,CAAC;;;;;;AASD,SAAgB,KAAK,EAAE,WAAW,SAAS,GAAG,SAAoB;CAChE,OAAO,oBAAC,MAAD;EAAM,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { PressableProps } from "react-native";
|
|
3
|
+
//#region src/components/checkbox/checkbox.d.ts
|
|
4
|
+
export type CheckboxProps = Omit<PressableProps, 'children' | 'style' | 'onPress'> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
/** Controlado. Sem ele, o componente guarda o próprio estado (começa em `defaultChecked`). */
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
defaultChecked?: boolean;
|
|
10
|
+
/** Chamado com o novo valor a cada toque. */
|
|
11
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
12
|
+
/** Seleção parcial: aparece com o traço e é anunciada como "misto". */
|
|
13
|
+
indeterminate?: boolean;
|
|
14
|
+
error?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function Checkbox({ label, checked, defaultChecked, onCheckedChange, indeterminate, error, disabled, className, accessibilityState, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
//# sourceMappingURL=checkbox.d.ts.map
|