panelui-native 0.7.0 → 0.9.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/lib/module/components/attachment/index.js +219 -0
- package/lib/module/components/attachment/index.js.map +1 -0
- package/lib/module/components/bottom-sheet/index.js +15 -1
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/dialog/index.js +6 -2
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +94 -17
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +1024 -0
- package/lib/module/components/line-chart/index.js.map +1 -0
- package/lib/module/components/marker/index.js +190 -0
- package/lib/module/components/marker/index.js.map +1 -0
- package/lib/module/components/message/index.js +24 -8
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +451 -0
- package/lib/module/components/message-scroller/index.js.map +1 -0
- package/lib/module/components/popover/index.js +500 -0
- package/lib/module/components/popover/index.js.map +1 -0
- package/lib/module/components/radio-group/index.js +104 -16
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/separator/index.js +91 -0
- package/lib/module/components/separator/index.js.map +1 -0
- package/lib/module/components/surface/index.js +21 -2
- package/lib/module/components/surface/index.js.map +1 -1
- package/lib/module/icons/index.js +69 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +7 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/scrim.js +72 -0
- package/lib/module/primitives/scrim.js.map +1 -0
- package/lib/typescript/src/components/attachment/index.d.ts +93 -0
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +6 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/dialog/index.d.ts +7 -1
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts +152 -2
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +247 -0
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/marker/index.d.ts +137 -0
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/message/index.d.ts +8 -1
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts +150 -0
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +130 -0
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -0
- package/lib/typescript/src/components/radio-group/index.d.ts +32 -0
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/separator/index.d.ts +47 -0
- package/lib/typescript/src/components/separator/index.d.ts.map +1 -0
- package/lib/typescript/src/components/surface/index.d.ts +51 -2
- package/lib/typescript/src/components/surface/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts +6 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/scrim.d.ts +21 -0
- package/lib/typescript/src/primitives/scrim.d.ts.map +1 -0
- package/package.json +5 -1
- package/src/components/attachment/index.tsx +279 -0
- package/src/components/bottom-sheet/index.tsx +20 -0
- package/src/components/dialog/index.tsx +10 -1
- package/src/components/empty-state/index.tsx +60 -14
- package/src/components/line-chart/index.tsx +1224 -0
- package/src/components/marker/index.tsx +194 -0
- package/src/components/message/index.tsx +29 -5
- package/src/components/message-scroller/index.tsx +574 -0
- package/src/components/popover/index.tsx +599 -0
- package/src/components/radio-group/index.tsx +108 -17
- package/src/components/separator/index.tsx +97 -0
- package/src/components/surface/index.tsx +29 -3
- package/src/icons/index.tsx +48 -0
- package/src/index.ts +60 -0
- package/src/primitives/scrim.tsx +95 -0
- package/theme.css +58 -0
|
@@ -66,4 +66,10 @@ export declare function CardIcon({ size, color, ...props }: IconProps): import("
|
|
|
66
66
|
export declare function ReceiptIcon({ size, color, ...props }: IconProps): import("react").JSX.Element;
|
|
67
67
|
/** Paper plane — sent, submitted, approved-and-forwarded. */
|
|
68
68
|
export declare function SendIcon({ size, color, ...props }: IconProps): import("react").JSX.Element;
|
|
69
|
+
/** Document with a folded corner — a file attachment. */
|
|
70
|
+
export declare function FileIcon({ size, color, ...props }: IconProps): import("react").JSX.Element;
|
|
71
|
+
/** Framed picture with a sun and a corner peak — an image attachment. */
|
|
72
|
+
export declare function ImageIcon({ size, color, ...props }: IconProps): import("react").JSX.Element;
|
|
73
|
+
/** A paperclip — attaching a file to a composer. */
|
|
74
|
+
export declare function PaperclipIcon({ size, color, ...props }: IconProps): import("react").JSX.Element;
|
|
69
75
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/icons/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAY,EAAmB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvE,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAEA;AAED,gEAAgE;AAChE,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAEjD;AAkBD,wBAAgB,SAAS,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,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,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAajE;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAapE;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAajE;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAapE;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAYjE;AAED,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAajE;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAalE;AAED,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAatE"}
|
|
@@ -8,6 +8,7 @@ export { hasNativeUI } from './native/index.js';
|
|
|
8
8
|
export { Accordion, type AccordionProps, type AccordionItemProps, type AccordionTriggerProps, type AccordionIndicatorProps, type AccordionContentProps, type AccordionVariant, type AccordionSelectionMode, } from './components/accordion/index.js';
|
|
9
9
|
export { Alert, type AlertProps, type AlertIndicatorProps, } from './components/alert/index.js';
|
|
10
10
|
export { Avatar, type AvatarProps, type AvatarBadgeProps, } from './components/avatar/index.js';
|
|
11
|
+
export { Attachment, type AttachmentProps, type AttachmentGroupProps, type AttachmentMediaProps, type AttachmentContentProps, type AttachmentTitleProps, type AttachmentDescriptionProps, type AttachmentActionsProps, type AttachmentActionProps, type AttachmentState, } from './components/attachment/index.js';
|
|
11
12
|
export { Badge, type BadgeProps } from './components/badge/index.js';
|
|
12
13
|
export { BottomSheet, type BottomSheetProps, type BottomSheetContentProps, } from './components/bottom-sheet/index.js';
|
|
13
14
|
export { Button, type ButtonProps } from './components/button/index.js';
|
|
@@ -23,10 +24,15 @@ export { Input, type InputProps } from './components/input/index.js';
|
|
|
23
24
|
export { InputGroup, type InputGroupProps, type InputGroupInputProps, type InputGroupDecoratorProps, } from './components/input-group/index.js';
|
|
24
25
|
export { Item, type ItemProps, type ItemGroupProps, type ItemSeparatorProps, type ItemMediaProps, type ItemContentProps, type ItemTitleProps, type ItemDescriptionProps, type ItemActionsProps, type ItemHeaderProps, type ItemFooterProps, } from './components/item/index.js';
|
|
25
26
|
export { Label, type LabelProps, type LabelTextProps } from './components/label/index.js';
|
|
27
|
+
export { LineChart, useLineChart, type LineChartProps, type LineChartHandle, type LineChartGridProps, type LineChartLineProps, type LineChartAreaProps, type LineChartSkeletonProps, type LineChartXAxisProps, type LineChartTooltipProps, type LineChartLegendProps, type LineChartDatum, type LineChartStatus, type LineChartCurve, } from './components/line-chart/index.js';
|
|
28
|
+
export { Marker, type MarkerProps, type MarkerIconProps, type MarkerContentProps, } from './components/marker/index.js';
|
|
29
|
+
export { MessageScroller, useMessageScroller, useMessageScrollerVisibility, type MessageScrollerProps, type MessageScrollerViewportProps, type MessageScrollerContentProps, type MessageScrollerItemProps, type MessageScrollerButtonProps, type MessageScrollerPosition, } from './components/message-scroller/index.js';
|
|
26
30
|
export { Message, type MessageProps, type MessageGroupProps, type MessageAvatarProps, type MessageContentProps, type MessageHeaderProps, type MessageBubbleProps, type MessageBubbleContentProps, type MessageFooterProps, type MessageActionsProps, } from './components/message/index.js';
|
|
31
|
+
export { Popover, type PopoverProps, type PopoverTriggerProps, type PopoverContentProps, type PopoverArrowProps, type PopoverCloseProps, type PopoverPlacement, type PopoverAlign, type PopoverPresentation, } from './components/popover/index.js';
|
|
27
32
|
export { Progress, type ProgressProps } from './components/progress/index.js';
|
|
28
33
|
export { RadioGroup, type RadioGroupProps, type RadioGroupItemProps, } from './components/radio-group/index.js';
|
|
29
34
|
export { ScrollFade, type ScrollFadeProps, } from './components/scroll-fade/index.js';
|
|
35
|
+
export { Separator, type SeparatorProps } from './components/separator/index.js';
|
|
30
36
|
export { Shimmer, type ShimmerProps } from './components/shimmer/index.js';
|
|
31
37
|
export { Skeleton, type SkeletonProps } from './components/skeleton/index.js';
|
|
32
38
|
export { Spinner, type SpinnerProps } from './components/spinner/index.js';
|
|
@@ -36,7 +42,7 @@ export { Switch, type SwitchProps } from './components/switch/index.js';
|
|
|
36
42
|
export { Timeline, type TimelineProps, type TimelineItemProps, type TimelineIndicatorProps, type TimelineStatProps, type TimelineVariant, type TimelineTone, } from './components/timeline/index.js';
|
|
37
43
|
export { Toast, ToastViewport, toast, useToast, type ToastProps, type ToastOptions, type ToastItem, type ToastVariant, type ToastPlacement, type ToastHandle, type ToastIndicatorProps, type ToastCloseProps, } from './components/toast/index.js';
|
|
38
44
|
export { Typography, type TypographyProps, type TypographyType, type TypographyHeadingProps, type TypographyParagraphProps, type TypographyCodeProps, } from './components/typography/index.js';
|
|
39
|
-
export { AlertTriangleIcon, AppleIcon, ArrowUpRightIcon, BellIcon, CardIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, FacebookIcon, GoogleIcon, IconColorProvider, InfoIcon, MoonIcon, PackageIcon, PlusSquareIcon, ReceiptIcon, SearchIcon, SendIcon, ShareNodesIcon, ShieldAlertIcon, ShieldCheckIcon, SunIcon, XIcon, useIconColor, type IconProps, } from './icons/index.js';
|
|
45
|
+
export { AlertTriangleIcon, AppleIcon, ArrowUpRightIcon, BellIcon, CardIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, FacebookIcon, FileIcon, GoogleIcon, IconColorProvider, InfoIcon, ImageIcon, MoonIcon, PackageIcon, PaperclipIcon, PlusSquareIcon, ReceiptIcon, SearchIcon, SendIcon, ShareNodesIcon, ShieldAlertIcon, ShieldCheckIcon, SunIcon, XIcon, useIconColor, type IconProps, } from './icons/index.js';
|
|
40
46
|
export * from './hooks/index.js';
|
|
41
47
|
export { cn } from './utils/cn.js';
|
|
42
48
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,kCAA+B,CAAC;AAG3F,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,sBAAmB,CAAC;AAG3B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAqB,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAmB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,kCAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,oCAAiC,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAU,CAAC;AAGvC,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,iCAAwB,CAAC;AAChC,OAAO,EACL,KAAK,EACL,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,6BAAoB,CAAC;AAC5B,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,8BAAqB,CAAC;AAC7B,OAAO,EA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sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY,GAClB,MAAM,gCAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,6BAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,GACzB,MAAM,kCAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,SAAS,EACT,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,cAAc,EACd,eAAe,EACf,eAAe,EACf,OAAO,EACP,KAAK,EACL,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,kBAAS,CAAC;AAGjB,cAAc,kBAAS,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,eAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,kCAA+B,CAAC;AAG3F,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,sBAAmB,CAAC;AAG3B,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AAU,EACV,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,cAAc,EACd,eAAe,EACf,eAAe,EACf,OAAO,EACP,KAAK,EACL,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,kBAAS,CAAC;AAGjB,cAAc,kBAAS,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,eAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ViewProps } from 'react-native';
|
|
2
|
+
/** True when a real blur can be drawn — for a caller that wants to know. */
|
|
3
|
+
export declare const hasBlur: boolean;
|
|
4
|
+
export interface ScrimProps extends Omit<ViewProps, 'children'> {
|
|
5
|
+
/** Frost the backdrop instead of dimming it. Falls back to a dim if it can't. */
|
|
6
|
+
blur?: boolean;
|
|
7
|
+
/** Blur strength, 0–100. */
|
|
8
|
+
intensity?: number;
|
|
9
|
+
/** Which way the blur tints. */
|
|
10
|
+
tint?: 'light' | 'dark' | 'default' | 'systemMaterial';
|
|
11
|
+
/**
|
|
12
|
+
* The dim used when not blurring — and when blurring is asked for but
|
|
13
|
+
* unavailable. A popover passes a lighter one than a dialog.
|
|
14
|
+
*/
|
|
15
|
+
dimClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Scrim({ blur, intensity, tint, dimClassName, style, ...props }: ScrimProps): import("react").JSX.Element;
|
|
18
|
+
export declare namespace Scrim {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=scrim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrim.d.ts","sourceRoot":"","sources":["../../../../src/primitives/scrim.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAyBhE,4EAA4E;AAC5E,eAAO,MAAM,OAAO,SAAoB,CAAC;AAEzC,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7D,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAAC;IACvD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAY,EACZ,SAAc,EACd,IAAgB,EAChB,YAA4B,EAC5B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,+BA0BZ;yBAjCe,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "panelui-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "High-performance React Native UI components for Expo. Semantic design tokens, powered by Uniwind (Tailwind v4) and Reanimated.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@expo/ui": "*",
|
|
67
67
|
"@react-native-masked-view/masked-view": ">=0.3.0",
|
|
68
|
+
"expo-blur": ">=13.0.0",
|
|
68
69
|
"expo-clipboard": ">=7.0.0",
|
|
69
70
|
"expo-linear-gradient": ">=13.0.0",
|
|
70
71
|
"react": "*",
|
|
@@ -102,6 +103,9 @@
|
|
|
102
103
|
"@expo/ui": {
|
|
103
104
|
"optional": true
|
|
104
105
|
},
|
|
106
|
+
"expo-blur": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
105
109
|
"expo-clipboard": {
|
|
106
110
|
"optional": true
|
|
107
111
|
},
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment — a file, with its upload life.
|
|
3
|
+
*
|
|
4
|
+
* A file in a chat composer or an upload list is the same row shape `Item`
|
|
5
|
+
* already draws — media, a name, a size, a remove button — so this is that row,
|
|
6
|
+
* not a second one. What it adds is the part `Item` has no opinion on: the
|
|
7
|
+
* file's *state*. A file is picked, then uploading, then processing, then done
|
|
8
|
+
* (or failed), and each of those has to look different or the user cannot tell
|
|
9
|
+
* a stuck upload from a finished one.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Attachment state="uploading">
|
|
13
|
+
* <Attachment.Media><FileIcon /></Attachment.Media>
|
|
14
|
+
* <Attachment.Content>
|
|
15
|
+
* <Attachment.Title>report.pdf</Attachment.Title>
|
|
16
|
+
* <Attachment.Description>PDF · 2.4 MB</Attachment.Description>
|
|
17
|
+
* </Attachment.Content>
|
|
18
|
+
* <Attachment.Actions>
|
|
19
|
+
* <Attachment.Action aria-label="Cancel"><XIcon size={14} /></Attachment.Action>
|
|
20
|
+
* </Attachment.Actions>
|
|
21
|
+
* </Attachment>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* While uploading or processing the title shimmers — the same sweep the rest of
|
|
25
|
+
* the library uses for "in progress" — and an optional bar tracks `progress`.
|
|
26
|
+
* A failed file tints its name and description in the destructive colour, which
|
|
27
|
+
* carries the state without relying on an icon nobody reads.
|
|
28
|
+
*/
|
|
29
|
+
import { createContext, forwardRef, useContext, type ReactNode } from 'react';
|
|
30
|
+
import { View, type ViewProps } from 'react-native';
|
|
31
|
+
import { tv } from 'tailwind-variants';
|
|
32
|
+
import { useCSSVariable } from 'uniwind';
|
|
33
|
+
import { AnimatedPressable, type AnimatedPressableProps } from '../../primitives/animated-pressable';
|
|
34
|
+
import { Text, type TextProps } from '../../primitives/text';
|
|
35
|
+
import { cn } from '../../utils/cn';
|
|
36
|
+
import { Item } from '../item';
|
|
37
|
+
import { Shimmer } from '../shimmer';
|
|
38
|
+
|
|
39
|
+
export type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
|
|
40
|
+
type AttachmentSize = 'default' | 'sm' | 'xs';
|
|
41
|
+
|
|
42
|
+
interface AttachmentContextValue {
|
|
43
|
+
state: AttachmentState;
|
|
44
|
+
size: AttachmentSize;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const AttachmentContext = createContext<AttachmentContextValue>({
|
|
48
|
+
state: 'done',
|
|
49
|
+
size: 'default',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/** True while the file is still moving — the two states that shimmer. */
|
|
53
|
+
function isBusy(state: AttachmentState): boolean {
|
|
54
|
+
return state === 'uploading' || state === 'processing';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const rootVariants = tv({
|
|
58
|
+
base: '',
|
|
59
|
+
variants: {
|
|
60
|
+
state: {
|
|
61
|
+
idle: '',
|
|
62
|
+
uploading: '',
|
|
63
|
+
processing: '',
|
|
64
|
+
// The border carries the failure, so it reads at a glance in a list.
|
|
65
|
+
error: 'border border-destructive',
|
|
66
|
+
done: '',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export interface AttachmentProps
|
|
72
|
+
extends Omit<AnimatedPressableProps, 'children' | 'disabled'> {
|
|
73
|
+
className?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Where the file is in its life. `uploading`/`processing` shimmer the name;
|
|
76
|
+
* `error` tints the row destructive. Default `done`.
|
|
77
|
+
*/
|
|
78
|
+
state?: AttachmentState;
|
|
79
|
+
/** Row density, passed through to the underlying Item. */
|
|
80
|
+
size?: AttachmentSize;
|
|
81
|
+
/** Stack the row into a card — for a horizontal group of thumbnails. */
|
|
82
|
+
orientation?: 'horizontal' | 'vertical';
|
|
83
|
+
/** Upload progress 0–1. Draws a thin bar along the bottom while busy. */
|
|
84
|
+
progress?: number;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const AttachmentRoot = forwardRef<View, AttachmentProps>(
|
|
90
|
+
(
|
|
91
|
+
{ className, state = 'done', size = 'default', orientation, progress, children, ...props },
|
|
92
|
+
ref
|
|
93
|
+
) => {
|
|
94
|
+
const track = useCSSVariable('--color-primary');
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<AttachmentContext.Provider value={{ state, size }}>
|
|
98
|
+
<Item
|
|
99
|
+
ref={ref}
|
|
100
|
+
size={size}
|
|
101
|
+
orientation={orientation}
|
|
102
|
+
variant="outline"
|
|
103
|
+
className={cn('overflow-hidden', rootVariants({ state }), className)}
|
|
104
|
+
{...props}
|
|
105
|
+
>
|
|
106
|
+
{children}
|
|
107
|
+
|
|
108
|
+
{/* A determinate bar while busy, if progress is known. Absolute so it
|
|
109
|
+
rides the row's bottom edge without shifting the layout. */}
|
|
110
|
+
{isBusy(state) && progress !== undefined ? (
|
|
111
|
+
<View className="absolute bottom-0 left-0 right-0 h-0.5 bg-muted">
|
|
112
|
+
<View
|
|
113
|
+
style={{
|
|
114
|
+
width: `${Math.min(100, Math.max(0, progress * 100))}%`,
|
|
115
|
+
backgroundColor: typeof track === 'string' ? track : undefined,
|
|
116
|
+
}}
|
|
117
|
+
className="h-full"
|
|
118
|
+
/>
|
|
119
|
+
</View>
|
|
120
|
+
) : null}
|
|
121
|
+
</Item>
|
|
122
|
+
</AttachmentContext.Provider>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
AttachmentRoot.displayName = 'Attachment';
|
|
127
|
+
|
|
128
|
+
export interface AttachmentGroupProps extends ViewProps {
|
|
129
|
+
className?: string;
|
|
130
|
+
orientation?: 'horizontal' | 'vertical';
|
|
131
|
+
children?: ReactNode;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** A row (or column) of attachments — the same stack `Item.Group` provides. */
|
|
135
|
+
const AttachmentGroup = forwardRef<View, AttachmentGroupProps>(
|
|
136
|
+
({ className, orientation = 'vertical', children, ...props }, ref) => (
|
|
137
|
+
<Item.Group ref={ref} orientation={orientation} className={className} {...props}>
|
|
138
|
+
{children}
|
|
139
|
+
</Item.Group>
|
|
140
|
+
)
|
|
141
|
+
);
|
|
142
|
+
AttachmentGroup.displayName = 'Attachment.Group';
|
|
143
|
+
|
|
144
|
+
export interface AttachmentMediaProps extends ViewProps {
|
|
145
|
+
className?: string;
|
|
146
|
+
/** `icon` frames it in a tile; `image` clips it for a thumbnail. */
|
|
147
|
+
variant?: 'default' | 'icon' | 'image';
|
|
148
|
+
children?: ReactNode;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Leading slot — a file-type icon tile, or an image thumbnail. */
|
|
152
|
+
const AttachmentMedia = forwardRef<View, AttachmentMediaProps>(
|
|
153
|
+
({ className, variant = 'icon', children, ...props }, ref) => (
|
|
154
|
+
<Item.Media ref={ref} variant={variant} className={className} {...props}>
|
|
155
|
+
{children}
|
|
156
|
+
</Item.Media>
|
|
157
|
+
)
|
|
158
|
+
);
|
|
159
|
+
AttachmentMedia.displayName = 'Attachment.Media';
|
|
160
|
+
|
|
161
|
+
export interface AttachmentContentProps extends ViewProps {
|
|
162
|
+
className?: string;
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const AttachmentContent = forwardRef<View, AttachmentContentProps>(
|
|
167
|
+
({ className, children, ...props }, ref) => (
|
|
168
|
+
<Item.Content ref={ref} className={className} {...props}>
|
|
169
|
+
{children}
|
|
170
|
+
</Item.Content>
|
|
171
|
+
)
|
|
172
|
+
);
|
|
173
|
+
AttachmentContent.displayName = 'Attachment.Content';
|
|
174
|
+
|
|
175
|
+
export interface AttachmentTitleProps extends TextProps {
|
|
176
|
+
className?: string;
|
|
177
|
+
children?: ReactNode;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** The file name. Shimmers while the file is uploading or processing. */
|
|
181
|
+
const AttachmentTitle = forwardRef<React.ElementRef<typeof Text>, AttachmentTitleProps>(
|
|
182
|
+
({ className, children, ...props }, ref) => {
|
|
183
|
+
const { state } = useContext(AttachmentContext);
|
|
184
|
+
|
|
185
|
+
if (isBusy(state)) {
|
|
186
|
+
// Shimmer owns the text so it can mask the sweep to the glyphs.
|
|
187
|
+
return <Shimmer textClassName={cn('text-base font-medium', className)}>{children}</Shimmer>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<Item.Title
|
|
192
|
+
ref={ref}
|
|
193
|
+
className={cn(state === 'error' && 'text-destructive', className)}
|
|
194
|
+
{...props}
|
|
195
|
+
>
|
|
196
|
+
{children}
|
|
197
|
+
</Item.Title>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
AttachmentTitle.displayName = 'Attachment.Title';
|
|
202
|
+
|
|
203
|
+
export interface AttachmentDescriptionProps extends TextProps {
|
|
204
|
+
className?: string;
|
|
205
|
+
children?: ReactNode;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** File type, size or status. Tints destructive on `error`. */
|
|
209
|
+
const AttachmentDescription = forwardRef<
|
|
210
|
+
React.ElementRef<typeof Text>,
|
|
211
|
+
AttachmentDescriptionProps
|
|
212
|
+
>(({ className, children, ...props }, ref) => {
|
|
213
|
+
const { state } = useContext(AttachmentContext);
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<Item.Description
|
|
217
|
+
ref={ref}
|
|
218
|
+
className={cn(state === 'error' && 'text-destructive', className)}
|
|
219
|
+
{...props}
|
|
220
|
+
>
|
|
221
|
+
{children}
|
|
222
|
+
</Item.Description>
|
|
223
|
+
);
|
|
224
|
+
});
|
|
225
|
+
AttachmentDescription.displayName = 'Attachment.Description';
|
|
226
|
+
|
|
227
|
+
export interface AttachmentActionsProps extends ViewProps {
|
|
228
|
+
className?: string;
|
|
229
|
+
children?: ReactNode;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const AttachmentActions = forwardRef<View, AttachmentActionsProps>(
|
|
233
|
+
({ className, children, ...props }, ref) => (
|
|
234
|
+
<Item.Actions ref={ref} className={className} {...props}>
|
|
235
|
+
{children}
|
|
236
|
+
</Item.Actions>
|
|
237
|
+
)
|
|
238
|
+
);
|
|
239
|
+
AttachmentActions.displayName = 'Attachment.Actions';
|
|
240
|
+
|
|
241
|
+
export interface AttachmentActionProps
|
|
242
|
+
extends Omit<AnimatedPressableProps, 'children'> {
|
|
243
|
+
className?: string;
|
|
244
|
+
accessibilityLabel: string;
|
|
245
|
+
children?: ReactNode;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* A single icon button in the actions slot — remove, retry, download. An icon
|
|
250
|
+
* on its own says nothing to a screen reader, so the label is required.
|
|
251
|
+
*/
|
|
252
|
+
const AttachmentAction = forwardRef<View, AttachmentActionProps>(
|
|
253
|
+
({ className, accessibilityLabel, children, ...props }, ref) => (
|
|
254
|
+
<AnimatedPressable
|
|
255
|
+
ref={ref}
|
|
256
|
+
accessibilityRole="button"
|
|
257
|
+
accessibilityLabel={accessibilityLabel}
|
|
258
|
+
hitSlop={8}
|
|
259
|
+
className={cn(
|
|
260
|
+
'h-8 w-8 items-center justify-center rounded-full active:bg-muted',
|
|
261
|
+
className
|
|
262
|
+
)}
|
|
263
|
+
{...props}
|
|
264
|
+
>
|
|
265
|
+
{children}
|
|
266
|
+
</AnimatedPressable>
|
|
267
|
+
)
|
|
268
|
+
);
|
|
269
|
+
AttachmentAction.displayName = 'Attachment.Action';
|
|
270
|
+
|
|
271
|
+
export const Attachment = Object.assign(AttachmentRoot, {
|
|
272
|
+
Group: AttachmentGroup,
|
|
273
|
+
Media: AttachmentMedia,
|
|
274
|
+
Content: AttachmentContent,
|
|
275
|
+
Title: AttachmentTitle,
|
|
276
|
+
Description: AttachmentDescription,
|
|
277
|
+
Actions: AttachmentActions,
|
|
278
|
+
Action: AttachmentAction,
|
|
279
|
+
});
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ReactNode,
|
|
11
11
|
} from 'react';
|
|
12
12
|
import { Pressable, useWindowDimensions, View, type ViewProps } from 'react-native';
|
|
13
|
+
import { useCSSVariable } from 'uniwind';
|
|
13
14
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
14
15
|
import Animated, {
|
|
15
16
|
FadeIn,
|
|
@@ -24,6 +25,7 @@ import Animated, {
|
|
|
24
25
|
} from 'react-native-reanimated';
|
|
25
26
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
26
27
|
import { getNativeUI } from '../../native';
|
|
28
|
+
import { XIcon } from '../../icons';
|
|
27
29
|
import { Portal } from '../../primitives/portal';
|
|
28
30
|
import { cn } from '../../utils/cn';
|
|
29
31
|
|
|
@@ -138,12 +140,18 @@ export interface BottomSheetContentProps extends ViewProps {
|
|
|
138
140
|
className?: string;
|
|
139
141
|
/** Tap on the backdrop closes the sheet. Default true. */
|
|
140
142
|
dismissible?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Show a close button in the top-right corner. On by default for the styled
|
|
145
|
+
* sheet; ignored by the native sheet, which has its own dismiss affordances.
|
|
146
|
+
*/
|
|
147
|
+
showClose?: boolean;
|
|
141
148
|
children?: ReactNode;
|
|
142
149
|
}
|
|
143
150
|
|
|
144
151
|
function BottomSheetContent({
|
|
145
152
|
className,
|
|
146
153
|
dismissible = true,
|
|
154
|
+
showClose = true,
|
|
147
155
|
children,
|
|
148
156
|
...props
|
|
149
157
|
}: BottomSheetContentProps) {
|
|
@@ -153,6 +161,7 @@ function BottomSheetContent({
|
|
|
153
161
|
const { height: screenHeight, width: screenWidth } = useWindowDimensions();
|
|
154
162
|
const insets = useSafeAreaInsets();
|
|
155
163
|
const translateY = useSharedValue(0);
|
|
164
|
+
const closeTint = useCSSVariable('--color-muted-foreground');
|
|
156
165
|
|
|
157
166
|
const close = useCallback(() => setOpen(false), [setOpen]);
|
|
158
167
|
|
|
@@ -256,6 +265,17 @@ function BottomSheetContent({
|
|
|
256
265
|
<View className="mb-3 self-center">
|
|
257
266
|
<View className="h-1 w-10 rounded-full bg-muted-foreground/30" />
|
|
258
267
|
</View>
|
|
268
|
+
{showClose ? (
|
|
269
|
+
<Pressable
|
|
270
|
+
accessibilityRole="button"
|
|
271
|
+
accessibilityLabel="Close"
|
|
272
|
+
onPress={close}
|
|
273
|
+
hitSlop={8}
|
|
274
|
+
className="absolute right-4 top-3 h-8 w-8 items-center justify-center rounded-full bg-muted active:opacity-70"
|
|
275
|
+
>
|
|
276
|
+
<XIcon size={16} color={typeof closeTint === 'string' ? closeTint : undefined} />
|
|
277
|
+
</Pressable>
|
|
278
|
+
) : null}
|
|
259
279
|
{children}
|
|
260
280
|
</Animated.View>
|
|
261
281
|
</GestureDetector>
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import { Pressable, View, type ViewProps } from 'react-native';
|
|
14
14
|
import Animated, { FadeIn, FadeOut, ZoomIn } from 'react-native-reanimated';
|
|
15
15
|
import { Portal } from '../../primitives/portal';
|
|
16
|
+
import { Scrim } from '../../primitives/scrim';
|
|
16
17
|
import { Text, type TextProps } from '../../primitives/text';
|
|
17
18
|
import { cn } from '../../utils/cn';
|
|
18
19
|
|
|
@@ -82,12 +83,19 @@ export interface DialogContentProps extends ViewProps {
|
|
|
82
83
|
className?: string;
|
|
83
84
|
/** Tap on the backdrop closes the dialog. Default true. */
|
|
84
85
|
dismissible?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Frost the screen behind the dialog instead of dimming it. Uses `expo-blur`
|
|
88
|
+
* when installed and falls back to the dim when it is not, so it is safe to
|
|
89
|
+
* pass either way.
|
|
90
|
+
*/
|
|
91
|
+
blur?: boolean;
|
|
85
92
|
children?: ReactNode;
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
function DialogContent({
|
|
89
96
|
className,
|
|
90
97
|
dismissible = true,
|
|
98
|
+
blur = false,
|
|
91
99
|
children,
|
|
92
100
|
...props
|
|
93
101
|
}: DialogContentProps) {
|
|
@@ -106,9 +114,10 @@ function DialogContent({
|
|
|
106
114
|
exiting={FadeOut.duration(150)}
|
|
107
115
|
className="absolute inset-0 items-center justify-center p-6"
|
|
108
116
|
>
|
|
117
|
+
<Scrim blur={blur} />
|
|
109
118
|
<Pressable
|
|
110
119
|
accessibilityLabel="Close dialog"
|
|
111
|
-
className="absolute inset-0
|
|
120
|
+
className="absolute inset-0"
|
|
112
121
|
onPress={dismissible ? () => setOpen(false) : undefined}
|
|
113
122
|
/>
|
|
114
123
|
<Animated.View
|
|
@@ -6,26 +6,49 @@
|
|
|
6
6
|
* is a pair of CSS pseudo-elements; React Native has none, so it is two
|
|
7
7
|
* absolutely positioned siblings with static rotate transforms.
|
|
8
8
|
*/
|
|
9
|
-
import { forwardRef, type ReactNode } from 'react';
|
|
9
|
+
import { createContext, forwardRef, useContext, type ReactNode } from 'react';
|
|
10
10
|
import { View, type Text as RNText, type ViewProps } from 'react-native';
|
|
11
11
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
12
12
|
import { Text, type TextProps } from '../../primitives/text';
|
|
13
13
|
|
|
14
|
+
type EmptyStateSize = 'sm' | 'default' | 'lg';
|
|
15
|
+
|
|
16
|
+
/** Sub-components read the size so the title, description and media scale with the root. */
|
|
17
|
+
const EmptyStateContext = createContext<{ size: EmptyStateSize }>({ size: 'default' });
|
|
18
|
+
|
|
14
19
|
const emptyStateVariants = tv({
|
|
15
20
|
slots: {
|
|
16
|
-
root: 'w-full
|
|
21
|
+
root: 'w-full items-center justify-center',
|
|
17
22
|
header: 'w-full max-w-sm items-center gap-1',
|
|
18
|
-
title: 'text-center
|
|
19
|
-
description: 'text-center text-
|
|
23
|
+
title: 'text-center font-semibold text-foreground',
|
|
24
|
+
description: 'text-center text-muted-foreground',
|
|
20
25
|
content: 'w-full max-w-sm items-center gap-3',
|
|
21
26
|
},
|
|
27
|
+
variants: {
|
|
28
|
+
variant: {
|
|
29
|
+
// Fills whatever space it is given — a whole screen, or a flex parent.
|
|
30
|
+
default: { root: 'flex-1' },
|
|
31
|
+
// A self-contained block that sits inside content rather than filling a
|
|
32
|
+
// screen: bordered, on the card fill, sized to its contents.
|
|
33
|
+
card: { root: 'rounded-2xl border border-border bg-card' },
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
sm: { root: 'gap-4 px-4 py-8', title: 'text-base', description: 'text-sm' },
|
|
37
|
+
default: { root: 'gap-6 px-6 py-12', title: 'text-xl', description: 'text-sm' },
|
|
38
|
+
lg: { root: 'gap-6 px-6 py-16', title: 'text-2xl', description: 'text-base' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: 'default',
|
|
43
|
+
size: 'default',
|
|
44
|
+
},
|
|
22
45
|
});
|
|
23
46
|
|
|
24
47
|
const mediaVariants = tv({
|
|
25
48
|
slots: {
|
|
26
49
|
wrapper: 'items-center justify-center',
|
|
27
|
-
card: '
|
|
28
|
-
ghost: 'absolute
|
|
50
|
+
card: 'shrink-0 items-center justify-center',
|
|
51
|
+
ghost: 'absolute rounded-md border border-border bg-card',
|
|
29
52
|
},
|
|
30
53
|
variants: {
|
|
31
54
|
variant: {
|
|
@@ -37,21 +60,41 @@ const mediaVariants = tv({
|
|
|
37
60
|
card: 'rounded-md border border-border bg-card',
|
|
38
61
|
},
|
|
39
62
|
},
|
|
63
|
+
size: {
|
|
64
|
+
sm: { card: 'h-8 w-8', ghost: 'h-8 w-8' },
|
|
65
|
+
default: { card: 'h-9 w-9', ghost: 'h-9 w-9' },
|
|
66
|
+
lg: { card: 'h-11 w-11', ghost: 'h-11 w-11' },
|
|
67
|
+
},
|
|
40
68
|
},
|
|
41
69
|
defaultVariants: {
|
|
42
70
|
variant: 'default',
|
|
71
|
+
size: 'default',
|
|
43
72
|
},
|
|
44
73
|
});
|
|
45
74
|
|
|
46
|
-
export interface EmptyStateProps
|
|
75
|
+
export interface EmptyStateProps
|
|
76
|
+
extends ViewProps,
|
|
77
|
+
VariantProps<typeof emptyStateVariants> {
|
|
47
78
|
className?: string;
|
|
79
|
+
/**
|
|
80
|
+
* `default` fills its parent — a whole screen, or a flex slot. `card` is a
|
|
81
|
+
* self-contained bordered block for an empty state that sits inside content
|
|
82
|
+
* rather than owning the screen.
|
|
83
|
+
*/
|
|
84
|
+
variant?: 'default' | 'card';
|
|
85
|
+
/** Scales the padding, media, title and description together. */
|
|
86
|
+
size?: EmptyStateSize;
|
|
48
87
|
children?: ReactNode;
|
|
49
88
|
}
|
|
50
89
|
|
|
51
90
|
const EmptyStateRoot = forwardRef<View, EmptyStateProps>(
|
|
52
|
-
({ className, ...props }, ref) => {
|
|
53
|
-
const { root } = emptyStateVariants();
|
|
54
|
-
return
|
|
91
|
+
({ className, variant, size = 'default', ...props }, ref) => {
|
|
92
|
+
const { root } = emptyStateVariants({ variant, size });
|
|
93
|
+
return (
|
|
94
|
+
<EmptyStateContext.Provider value={{ size }}>
|
|
95
|
+
<View ref={ref} className={root({ className })} {...props} />
|
|
96
|
+
</EmptyStateContext.Provider>
|
|
97
|
+
);
|
|
55
98
|
}
|
|
56
99
|
);
|
|
57
100
|
EmptyStateRoot.displayName = 'EmptyState';
|
|
@@ -78,7 +121,8 @@ export interface EmptyStateMediaProps
|
|
|
78
121
|
*/
|
|
79
122
|
const EmptyStateMedia = forwardRef<View, EmptyStateMediaProps>(
|
|
80
123
|
({ className, variant = 'default', children, ...props }, ref) => {
|
|
81
|
-
const {
|
|
124
|
+
const { size } = useContext(EmptyStateContext);
|
|
125
|
+
const { wrapper, card, ghost } = mediaVariants({ variant, size });
|
|
82
126
|
|
|
83
127
|
return (
|
|
84
128
|
<View ref={ref} className={wrapper({ className: `mb-4 ${className ?? ''}` })} {...props}>
|
|
@@ -104,21 +148,23 @@ const EmptyStateMedia = forwardRef<View, EmptyStateMediaProps>(
|
|
|
104
148
|
EmptyStateMedia.displayName = 'EmptyState.Media';
|
|
105
149
|
|
|
106
150
|
const EmptyStateTitle = forwardRef<RNText, TextProps>(({ className, ...props }, ref) => {
|
|
107
|
-
const {
|
|
151
|
+
const { size } = useContext(EmptyStateContext);
|
|
152
|
+
const { title } = emptyStateVariants({ size });
|
|
108
153
|
return <Text ref={ref} className={title({ className })} {...props} />;
|
|
109
154
|
});
|
|
110
155
|
EmptyStateTitle.displayName = 'EmptyState.Title';
|
|
111
156
|
|
|
112
157
|
const EmptyStateDescription = forwardRef<RNText, TextProps>(
|
|
113
158
|
({ className, ...props }, ref) => {
|
|
114
|
-
const {
|
|
159
|
+
const { size } = useContext(EmptyStateContext);
|
|
160
|
+
const { description } = emptyStateVariants({ size });
|
|
115
161
|
return <Text ref={ref} className={description({ className })} {...props} />;
|
|
116
162
|
}
|
|
117
163
|
);
|
|
118
164
|
EmptyStateDescription.displayName = 'EmptyState.Description';
|
|
119
165
|
|
|
120
166
|
/** Slot below the header, for actions such as a primary button. */
|
|
121
|
-
const EmptyStateContent = forwardRef<View,
|
|
167
|
+
const EmptyStateContent = forwardRef<View, ViewProps & { className?: string }>(
|
|
122
168
|
({ className, ...props }, ref) => {
|
|
123
169
|
const { content } = emptyStateVariants();
|
|
124
170
|
return <View ref={ref} className={content({ className })} {...props} />;
|