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
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker — an inline note in a conversation.
|
|
3
|
+
*
|
|
4
|
+
* Transcripts are not only messages. Between the turns sit things the
|
|
5
|
+
* conversation did rather than said: a tool that ran, a file that was read, a
|
|
6
|
+
* model that changed, the point where yesterday ended. Those are not messages
|
|
7
|
+
* and should not look like one — a bubble implies a speaker, and none of these
|
|
8
|
+
* have one. A marker is the quieter row that carries them: small, muted, and
|
|
9
|
+
* aligned to the transcript rather than to a side of it.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Marker>
|
|
13
|
+
* <Marker.Icon><CheckIcon /></Marker.Icon>
|
|
14
|
+
* <Marker.Content>Explored 4 files</Marker.Content>
|
|
15
|
+
* </Marker>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* `shimmer` on the content is for the row that is still happening — the sweep
|
|
19
|
+
* runs through the glyphs while a step is in flight, and is dropped the moment
|
|
20
|
+
* it finishes.
|
|
21
|
+
*/
|
|
22
|
+
import { type ReactNode } from 'react';
|
|
23
|
+
import { View, type Text as RNText, type ViewProps } from 'react-native';
|
|
24
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
25
|
+
import { type AnimatedPressableProps } from '../../primitives/animated-pressable.js';
|
|
26
|
+
import { type TextProps } from '../../primitives/text.js';
|
|
27
|
+
type MarkerVariant = 'default' | 'border' | 'separator';
|
|
28
|
+
declare const markerVariants: import("tailwind-variants").TVReturnType<{
|
|
29
|
+
variant: {
|
|
30
|
+
/** The plain row: an icon and a line of muted text. */
|
|
31
|
+
default: {};
|
|
32
|
+
/** Same row, closed by a hairline — for a step that ends a section. */
|
|
33
|
+
border: {
|
|
34
|
+
root: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A centred label with a rule running out to each edge. The rules are
|
|
38
|
+
* `Separator`s rather than borders so they follow the same token and
|
|
39
|
+
* thickness as every other rule in the app.
|
|
40
|
+
*/
|
|
41
|
+
separator: {
|
|
42
|
+
root: string;
|
|
43
|
+
content: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
disabled: {
|
|
47
|
+
true: {
|
|
48
|
+
root: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
root: string;
|
|
53
|
+
content: string;
|
|
54
|
+
}, undefined, {
|
|
55
|
+
variant: {
|
|
56
|
+
/** The plain row: an icon and a line of muted text. */
|
|
57
|
+
default: {};
|
|
58
|
+
/** Same row, closed by a hairline — for a step that ends a section. */
|
|
59
|
+
border: {
|
|
60
|
+
root: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* A centred label with a rule running out to each edge. The rules are
|
|
64
|
+
* `Separator`s rather than borders so they follow the same token and
|
|
65
|
+
* thickness as every other rule in the app.
|
|
66
|
+
*/
|
|
67
|
+
separator: {
|
|
68
|
+
root: string;
|
|
69
|
+
content: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
disabled: {
|
|
73
|
+
true: {
|
|
74
|
+
root: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
78
|
+
root: string;
|
|
79
|
+
content: string;
|
|
80
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
81
|
+
variant: {
|
|
82
|
+
/** The plain row: an icon and a line of muted text. */
|
|
83
|
+
default: {};
|
|
84
|
+
/** Same row, closed by a hairline — for a step that ends a section. */
|
|
85
|
+
border: {
|
|
86
|
+
root: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* A centred label with a rule running out to each edge. The rules are
|
|
90
|
+
* `Separator`s rather than borders so they follow the same token and
|
|
91
|
+
* thickness as every other rule in the app.
|
|
92
|
+
*/
|
|
93
|
+
separator: {
|
|
94
|
+
root: string;
|
|
95
|
+
content: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
disabled: {
|
|
99
|
+
true: {
|
|
100
|
+
root: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}, {
|
|
104
|
+
root: string;
|
|
105
|
+
content: string;
|
|
106
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
107
|
+
export interface MarkerProps extends Omit<AnimatedPressableProps, 'children' | 'disabled'>, Omit<VariantProps<typeof markerVariants>, 'disabled'> {
|
|
108
|
+
className?: string;
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* `default` is the inline status row. `border` closes it with a hairline.
|
|
112
|
+
* `separator` centres the content between two rules — the "Yesterday"
|
|
113
|
+
* divider shape.
|
|
114
|
+
*/
|
|
115
|
+
variant?: MarkerVariant;
|
|
116
|
+
children?: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
export interface MarkerIconProps extends ViewProps {
|
|
119
|
+
className?: string;
|
|
120
|
+
children?: ReactNode;
|
|
121
|
+
}
|
|
122
|
+
export interface MarkerContentProps extends TextProps {
|
|
123
|
+
className?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Sweep a highlight through the text, for a step that is still running.
|
|
126
|
+
* Drop it when the step finishes — a marker that shimmers forever reads as
|
|
127
|
+
* a stuck one.
|
|
128
|
+
*/
|
|
129
|
+
shimmer?: boolean;
|
|
130
|
+
children?: ReactNode;
|
|
131
|
+
}
|
|
132
|
+
export declare const Marker: import("react").ForwardRefExoticComponent<MarkerProps & import("react").RefAttributes<View>> & {
|
|
133
|
+
Icon: import("react").ForwardRefExoticComponent<MarkerIconProps & import("react").RefAttributes<View>>;
|
|
134
|
+
Content: import("react").ForwardRefExoticComponent<MarkerContentProps & import("react").RefAttributes<RNText>>;
|
|
135
|
+
};
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/marker/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;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CACtB;AAsBD,eAAO,MAAM,MAAM;;;CAGjB,CAAC"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
import { type ReactNode } from 'react';
|
|
24
|
-
import { View, type ViewProps } from 'react-native';
|
|
24
|
+
import { View, type GestureResponderEvent, type ViewProps } from 'react-native';
|
|
25
25
|
import { type VariantProps } from 'tailwind-variants';
|
|
26
26
|
import { type TextProps } from '../../primitives/text.js';
|
|
27
27
|
declare const messageVariants: import("tailwind-variants").TVReturnType<{
|
|
@@ -123,6 +123,13 @@ export interface MessageProps extends ViewProps, VariantProps<typeof messageVari
|
|
|
123
123
|
* this for you.
|
|
124
124
|
*/
|
|
125
125
|
stacked?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Fires on a long press anywhere on the turn — the gesture a chat uses to
|
|
128
|
+
* surface per-message actions (copy, reply, react). Open a menu from it; the
|
|
129
|
+
* component only exposes the press. When set, the whole row gains press
|
|
130
|
+
* feedback. A plain tap should still do nothing, so there is no `onPress`.
|
|
131
|
+
*/
|
|
132
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
126
133
|
children?: ReactNode;
|
|
127
134
|
}
|
|
128
135
|
export interface MessageGroupProps extends ViewProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/message/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/message/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,I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Q,SAAS;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAiBD,MAAM,WAAW,yBAA0B,SAAQ,SAAS;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAwBD,eAAO,MAAM,OAAO;;;;;;;;;CASlB,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MessageScroller — the scroll behaviour a chat transcript needs.
|
|
3
|
+
*
|
|
4
|
+
* A transcript is the one list where the interesting end is the bottom, the
|
|
5
|
+
* content grows while you are reading it, and history is added to the top. A
|
|
6
|
+
* plain scroll view gets all three wrong: it opens at the top, it stays put
|
|
7
|
+
* while a reply streams in below the fold, and it jumps a screen when older
|
|
8
|
+
* messages load. This owns those three behaviours so a screen does not have to
|
|
9
|
+
* rebuild them.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <MessageScroller autoScroll className="flex-1">
|
|
13
|
+
* <MessageScroller.Viewport>
|
|
14
|
+
* <MessageScroller.Content>
|
|
15
|
+
* {messages.map((m) => (
|
|
16
|
+
* <MessageScroller.Item key={m.id} messageId={m.id} scrollAnchor={m.role === 'user'}>
|
|
17
|
+
* <Message>…</Message>
|
|
18
|
+
* </MessageScroller.Item>
|
|
19
|
+
* ))}
|
|
20
|
+
* </MessageScroller.Content>
|
|
21
|
+
* </MessageScroller.Viewport>
|
|
22
|
+
* <MessageScroller.Button />
|
|
23
|
+
* </MessageScroller>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* The rule behind every part of it: **the reader's position is theirs**. New
|
|
27
|
+
* content follows the bottom only while they are already at the bottom, and
|
|
28
|
+
* scrolling away hands control back to them until they ask for it again.
|
|
29
|
+
* Content added above them never moves what they are looking at.
|
|
30
|
+
*
|
|
31
|
+
* Needs a bounded height — from `flex-1` in a column, or an explicit one.
|
|
32
|
+
* Given an unbounded parent it grows to fit its content and never scrolls.
|
|
33
|
+
*/
|
|
34
|
+
import { type ReactNode } from 'react';
|
|
35
|
+
import { type ViewProps } from 'react-native';
|
|
36
|
+
import { type AnimatedScrollViewProps } from 'react-native-reanimated';
|
|
37
|
+
export type MessageScrollerPosition = 'start' | 'end' | 'last-anchor';
|
|
38
|
+
/** Scroll commands, for a control that lives outside the viewport. */
|
|
39
|
+
export declare function useMessageScroller(): {
|
|
40
|
+
scrollToEnd: (animated?: boolean) => void;
|
|
41
|
+
scrollToStart: (animated?: boolean) => void;
|
|
42
|
+
scrollToMessage: (id: string, animated?: boolean) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Where the reader is: the turn they are inside, and whether they are at the
|
|
46
|
+
* live edge. Both settle after a scroll rather than updating per frame — this
|
|
47
|
+
* is for a header that names the current turn, not for anything animated.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useMessageScrollerVisibility(): {
|
|
50
|
+
currentAnchorId: string | null;
|
|
51
|
+
atEnd: boolean;
|
|
52
|
+
};
|
|
53
|
+
export interface MessageScrollerProps extends ViewProps {
|
|
54
|
+
className?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Follow new content down as it arrives — but only while the reader is
|
|
57
|
+
* already at the bottom. Scrolling up disengages it until they come back or
|
|
58
|
+
* press the button.
|
|
59
|
+
*/
|
|
60
|
+
autoScroll?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Keep the reader on the same message when older ones are added above. Without
|
|
63
|
+
* it, loading history throws them a screen backwards.
|
|
64
|
+
*/
|
|
65
|
+
preserveScrollOnPrepend?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Where a freshly mounted transcript opens. `last-anchor` is the one to want
|
|
68
|
+
* for a saved thread: it lands on the last turn that started something,
|
|
69
|
+
* rather than at the very bottom of whatever the reply happened to be.
|
|
70
|
+
*/
|
|
71
|
+
defaultScrollPosition?: MessageScrollerPosition;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
declare function MessageScrollerRoot({ className, autoScroll, preserveScrollOnPrepend, defaultScrollPosition, children, ...props }: MessageScrollerProps): import("react").JSX.Element;
|
|
75
|
+
declare namespace MessageScrollerRoot {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The four scroll events are owned by the component and taken off the props
|
|
80
|
+
* type rather than merged with a consumer's. They are not decoration on top of
|
|
81
|
+
* a scroll view — they *are* the behaviour, and a call site that quietly
|
|
82
|
+
* replaced one would look like a bug in the scrolling.
|
|
83
|
+
*/
|
|
84
|
+
export interface MessageScrollerViewportProps extends Omit<AnimatedScrollViewProps, 'onScroll' | 'onScrollEndDrag' | 'onMomentumScrollEnd' | 'onContentSizeChange'> {
|
|
85
|
+
className?: string;
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The scrollable itself. Owns the three behaviours, because all three are
|
|
90
|
+
* reactions to scroll and content-size events and this is where they arrive.
|
|
91
|
+
*/
|
|
92
|
+
declare function MessageScrollerViewport({ className, children, ...props }: MessageScrollerViewportProps): import("react").JSX.Element;
|
|
93
|
+
declare namespace MessageScrollerViewport {
|
|
94
|
+
var displayName: string;
|
|
95
|
+
}
|
|
96
|
+
export interface MessageScrollerContentProps extends ViewProps {
|
|
97
|
+
className?: string;
|
|
98
|
+
children?: ReactNode;
|
|
99
|
+
}
|
|
100
|
+
/** The transcript column. Announces additions rather than the whole list. */
|
|
101
|
+
declare function MessageScrollerContent({ className, children, ...props }: MessageScrollerContentProps): import("react").JSX.Element;
|
|
102
|
+
declare namespace MessageScrollerContent {
|
|
103
|
+
var displayName: string;
|
|
104
|
+
}
|
|
105
|
+
export interface MessageScrollerItemProps extends ViewProps {
|
|
106
|
+
className?: string;
|
|
107
|
+
/** Stable id for this turn. `scrollToMessage` takes the same value. */
|
|
108
|
+
messageId: string;
|
|
109
|
+
/**
|
|
110
|
+
* Marks this row as the start of a turn. `defaultScrollPosition="last-anchor"`
|
|
111
|
+
* opens on the last one, and it is what a saved thread should land on — the
|
|
112
|
+
* question, not the tail of the answer to it.
|
|
113
|
+
*/
|
|
114
|
+
scrollAnchor?: boolean;
|
|
115
|
+
children?: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* One row of the transcript. It exists to be measured: without a boundary per
|
|
119
|
+
* turn there is nothing to scroll *to*, and nothing to measure the prepend
|
|
120
|
+
* shift against.
|
|
121
|
+
*/
|
|
122
|
+
declare function MessageScrollerItem({ className, messageId, scrollAnchor, children, ...props }: MessageScrollerItemProps): import("react").JSX.Element;
|
|
123
|
+
declare namespace MessageScrollerItem {
|
|
124
|
+
var displayName: string;
|
|
125
|
+
}
|
|
126
|
+
export interface MessageScrollerButtonProps extends ViewProps {
|
|
127
|
+
className?: string;
|
|
128
|
+
/** `end` jumps to the newest message, `start` to the beginning of the thread. */
|
|
129
|
+
target?: 'start' | 'end';
|
|
130
|
+
accessibilityLabel?: string;
|
|
131
|
+
children?: ReactNode;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The way back to the live edge, shown only when there is one to go back to.
|
|
135
|
+
*
|
|
136
|
+
* Its visibility is driven from the same shared value the scroll handler
|
|
137
|
+
* writes, so it fades on the UI thread while the transcript is still moving.
|
|
138
|
+
*/
|
|
139
|
+
declare function MessageScrollerButton({ className, target, accessibilityLabel, children, ...props }: MessageScrollerButtonProps): import("react").JSX.Element;
|
|
140
|
+
declare namespace MessageScrollerButton {
|
|
141
|
+
var displayName: string;
|
|
142
|
+
}
|
|
143
|
+
export declare const MessageScroller: typeof MessageScrollerRoot & {
|
|
144
|
+
Viewport: typeof MessageScrollerViewport;
|
|
145
|
+
Content: typeof MessageScrollerContent;
|
|
146
|
+
Item: typeof MessageScrollerItem;
|
|
147
|
+
Button: typeof MessageScrollerButton;
|
|
148
|
+
};
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/message-scroller/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAiB,EAQf,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAejC,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,KAAK,GAAG,aAAa,CAAC;AAmCtE,sEAAsE;AACtE,wBAAgB,kBAAkB;6BAlBP,OAAO,KAAK,IAAI;+BACd,OAAO,KAAK,IAAI;0BACrB,MAAM,aAAa,OAAO,KAAK,IAAI;EAmB1D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B;;;EAG3C;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,uBAAuB,CAAC;IAChD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,UAAkB,EAClB,uBAA8B,EAC9B,qBAA6B,EAC7B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BA2FtB;kBAlGQ,mBAAmB;;;AAqG5B;;;;;GAKG;AACH,MAAM,WAAW,4BACf,SAAQ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AQ,EACR,GAAG,KAAK,EACT,EAAE,0BAA0B,+BAkD5B;kBAxDQ,qBAAqB;;;AA2D9B,eAAO,MAAM,eAAe;;;;;CAK1B,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover — a panel anchored to the thing that opened it.
|
|
3
|
+
*
|
|
4
|
+
* A dialog takes the screen and asks to be dealt with; a popover stays next to
|
|
5
|
+
* its trigger and keeps the context around it visible. That difference is the
|
|
6
|
+
* whole reason both exist, and it is why this one is positioned rather than
|
|
7
|
+
* centred.
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Popover>
|
|
11
|
+
* <Popover.Trigger>
|
|
12
|
+
* <Button variant="outline">Options</Button>
|
|
13
|
+
* </Popover.Trigger>
|
|
14
|
+
* <Popover.Content placement="bottom" align="end">
|
|
15
|
+
* <Popover.Title>Export</Popover.Title>
|
|
16
|
+
* <Popover.Description>Choose a format.</Popover.Description>
|
|
17
|
+
* </Popover.Content>
|
|
18
|
+
* </Popover>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Placement is a preference, not a promise. The trigger is measured in window
|
|
22
|
+
* coordinates when it is pressed, the panel measures itself on its first
|
|
23
|
+
* layout, and the two are reconciled against the safe area: a panel that would
|
|
24
|
+
* run off the bottom flips above the trigger, and one that would run off the
|
|
25
|
+
* side slides back inside. So `placement="bottom"` means *below, if below
|
|
26
|
+
* fits* — which is the only behaviour that survives a trigger near an edge.
|
|
27
|
+
*
|
|
28
|
+
* The first frame is rendered transparent, because the panel's own size is not
|
|
29
|
+
* known until it has laid out once. Without that it would appear at the origin
|
|
30
|
+
* and jump into place.
|
|
31
|
+
*/
|
|
32
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
33
|
+
import { type ViewProps } from 'react-native';
|
|
34
|
+
import { type TextProps } from '../../primitives/text.js';
|
|
35
|
+
export type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
36
|
+
export type PopoverAlign = 'start' | 'center' | 'end';
|
|
37
|
+
export type PopoverPresentation = 'popover' | 'bottom-sheet';
|
|
38
|
+
export interface PopoverProps {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/** Controlled open state. */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
onOpenChange?: (open: boolean) => void;
|
|
43
|
+
/** Initial state when uncontrolled. */
|
|
44
|
+
defaultOpen?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* `popover` is the anchored panel. `bottom-sheet` presents the content in a
|
|
47
|
+
* draggable sheet instead — better on a small screen, or when the content is
|
|
48
|
+
* a form rather than a menu. Placement, align and the arrow do not apply to a
|
|
49
|
+
* sheet.
|
|
50
|
+
*/
|
|
51
|
+
presentation?: PopoverPresentation;
|
|
52
|
+
}
|
|
53
|
+
declare function PopoverRoot({ children, open, onOpenChange, defaultOpen, presentation, }: PopoverProps): import("react").JSX.Element;
|
|
54
|
+
export interface PopoverTriggerProps {
|
|
55
|
+
children: ReactElement<{
|
|
56
|
+
onPress?: (...args: unknown[]) => void;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Wraps its child and toggles the popover on press.
|
|
61
|
+
*
|
|
62
|
+
* The child is wrapped in a view rather than given a ref directly: the ref has
|
|
63
|
+
* to survive whatever the child is — a Button, a plain Pressable, an icon —
|
|
64
|
+
* and only a wrapper we own is guaranteed to be measurable.
|
|
65
|
+
*/
|
|
66
|
+
declare function PopoverTrigger({ children }: PopoverTriggerProps): import("react").JSX.Element;
|
|
67
|
+
export interface PopoverContentProps extends ViewProps {
|
|
68
|
+
className?: string;
|
|
69
|
+
/** Preferred side of the trigger. Flipped when that side does not fit. */
|
|
70
|
+
placement?: PopoverPlacement;
|
|
71
|
+
/** Where the panel sits along the trigger's other axis. */
|
|
72
|
+
align?: PopoverAlign;
|
|
73
|
+
/** Gap between the trigger and the panel, in pixels. */
|
|
74
|
+
offset?: number;
|
|
75
|
+
/** Nudge along the alignment axis, in pixels. */
|
|
76
|
+
alignOffset?: number;
|
|
77
|
+
/**
|
|
78
|
+
* `content-fit` sizes to the content, `trigger` matches the trigger's width,
|
|
79
|
+
* `full` spans the safe area, and a number is that many pixels.
|
|
80
|
+
*/
|
|
81
|
+
width?: number | 'trigger' | 'full' | 'content-fit';
|
|
82
|
+
/** Tap outside the panel closes it. Default true. */
|
|
83
|
+
dismissible?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Frost the background behind the panel instead of dimming it. Uses
|
|
86
|
+
* `expo-blur` when installed and falls back to the dimmed scrim when it is
|
|
87
|
+
* not, so it is safe to pass either way.
|
|
88
|
+
*/
|
|
89
|
+
blur?: boolean;
|
|
90
|
+
children?: ReactNode;
|
|
91
|
+
}
|
|
92
|
+
declare function PopoverContent({ className, placement, align, offset, alignOffset, width, dismissible, blur, children, ...props }: PopoverContentProps): import("react").JSX.Element | null;
|
|
93
|
+
export interface PopoverArrowProps extends ViewProps {
|
|
94
|
+
className?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A small square rotated into a diamond, half-buried under the panel so only
|
|
98
|
+
* the point shows. It needs the panel to have a border for its own two visible
|
|
99
|
+
* edges to line up with — without one it reads as a floating lozenge.
|
|
100
|
+
*
|
|
101
|
+
* It points at the trigger's centre, which the panel resolves and publishes:
|
|
102
|
+
* when `align` shifts the panel off-centre, or a clamp slides it back on
|
|
103
|
+
* screen, the arrow stays over the trigger rather than over the panel's middle.
|
|
104
|
+
*/
|
|
105
|
+
declare function PopoverArrow({ className, style, ...props }: PopoverArrowProps): import("react").JSX.Element | null;
|
|
106
|
+
export interface PopoverCloseProps {
|
|
107
|
+
children: ReactElement<{
|
|
108
|
+
onPress?: (...args: unknown[]) => void;
|
|
109
|
+
}>;
|
|
110
|
+
}
|
|
111
|
+
/** Wraps its child and closes the popover on press. */
|
|
112
|
+
declare function PopoverClose({ children }: PopoverCloseProps): ReactElement<{
|
|
113
|
+
onPress?: (...args: unknown[]) => void;
|
|
114
|
+
}, string | import("react").JSXElementConstructor<any>>;
|
|
115
|
+
export declare const Popover: typeof PopoverRoot & {
|
|
116
|
+
Trigger: typeof PopoverTrigger;
|
|
117
|
+
Content: typeof PopoverContent;
|
|
118
|
+
Arrow: typeof PopoverArrow;
|
|
119
|
+
Title: {
|
|
120
|
+
({ className, ...props }: TextProps): import("react").JSX.Element;
|
|
121
|
+
displayName: string;
|
|
122
|
+
};
|
|
123
|
+
Description: {
|
|
124
|
+
({ className, ...props }: TextProps): import("react").JSX.Element;
|
|
125
|
+
displayName: string;
|
|
126
|
+
};
|
|
127
|
+
Close: typeof PopoverClose;
|
|
128
|
+
};
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAUL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAatB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,0BAAuB,CAAC;AAU7D,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAwBtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,cAAc,CAAC;AAY7D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;I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,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,sCA2CtE;AAiBD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,uDAAuD;AACvD,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB;cAJhB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI;wDAchE;AA2GD,eAAO,MAAM,OAAO;;;;;kCAzI2B,SAAS;;;;kCAUH,SAAS;;;;CAsI5D,CAAC"}
|
|
@@ -1,20 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RadioGroup — one choice from a set.
|
|
3
|
+
*
|
|
4
|
+
* The group owns the value and hands each item its selected state through
|
|
5
|
+
* context, so an item is a thin pressable that reports its own value up and
|
|
6
|
+
* reads selection back down.
|
|
7
|
+
*
|
|
8
|
+
* Two shapes, chosen on the group and inherited by every item: `dot` is the
|
|
9
|
+
* classic label-beside-a-disc row; `card` turns the whole surface into the
|
|
10
|
+
* target — for pickable options where the disc is a confirmation rather than
|
|
11
|
+
* the thing you aim at. The card is the same treatment `Checkbox` offers, so a
|
|
12
|
+
* form mixing single- and multi-select choices reads as one family.
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <RadioGroup value={plan} onValueChange={setPlan} variant="card">
|
|
16
|
+
* <RadioGroup.Item value="pro" label="Pro" description="For growing teams" />
|
|
17
|
+
* <RadioGroup.Item value="max" label="Max" description="Everything, uncapped" />
|
|
18
|
+
* </RadioGroup>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
1
21
|
import { type ReactNode } from 'react';
|
|
2
22
|
import { View, type ViewProps } from 'react-native';
|
|
23
|
+
type RadioVariant = 'dot' | 'card';
|
|
3
24
|
export interface RadioGroupProps extends ViewProps {
|
|
4
25
|
className?: string;
|
|
5
26
|
value?: string;
|
|
6
27
|
onValueChange: (value: string) => void;
|
|
7
28
|
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* `dot` is the label-beside-a-disc row. `card` makes the whole surface the
|
|
31
|
+
* target and highlights the selected option — for a plan picker or a
|
|
32
|
+
* settings choice where each option carries a description.
|
|
33
|
+
*/
|
|
34
|
+
variant?: RadioVariant;
|
|
8
35
|
children: ReactNode;
|
|
9
36
|
}
|
|
10
37
|
export interface RadioGroupItemProps {
|
|
11
38
|
className?: string;
|
|
12
39
|
value: string;
|
|
13
40
|
label?: string;
|
|
41
|
+
/** Secondary line under the label. Most at home in the `card` variant. */
|
|
42
|
+
description?: string;
|
|
14
43
|
disabled?: boolean;
|
|
44
|
+
/** Hide the disc entirely — for a card whose selected fill is enough. */
|
|
45
|
+
hideIndicator?: boolean;
|
|
15
46
|
children?: ReactNode;
|
|
16
47
|
}
|
|
17
48
|
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<View>> & {
|
|
18
49
|
Item: import("react").ForwardRefExoticComponent<RadioGroupItemProps & import("react").RefAttributes<View>>;
|
|
19
50
|
};
|
|
51
|
+
export type { RadioVariant };
|
|
20
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/radio-group/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/radio-group/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAa,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAW/D,KAAK,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;AA4CnC,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAyBD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA0ED,eAAO,MAAM,UAAU;;CAErB,CAAC;AAEH,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
3
|
+
declare const separatorVariants: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
orientation: {
|
|
5
|
+
horizontal: string;
|
|
6
|
+
vertical: string;
|
|
7
|
+
};
|
|
8
|
+
variant: {
|
|
9
|
+
thin: string;
|
|
10
|
+
thick: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, "bg-border", {
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: string;
|
|
15
|
+
vertical: string;
|
|
16
|
+
};
|
|
17
|
+
variant: {
|
|
18
|
+
thin: string;
|
|
19
|
+
thick: string;
|
|
20
|
+
};
|
|
21
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
22
|
+
orientation: {
|
|
23
|
+
horizontal: string;
|
|
24
|
+
vertical: string;
|
|
25
|
+
};
|
|
26
|
+
variant: {
|
|
27
|
+
thin: string;
|
|
28
|
+
thick: string;
|
|
29
|
+
};
|
|
30
|
+
}, undefined, "bg-border", unknown, unknown, undefined>>;
|
|
31
|
+
export interface SeparatorProps extends ViewProps, VariantProps<typeof separatorVariants> {
|
|
32
|
+
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Thickness in pixels, overriding the variant. Sets the height of a
|
|
35
|
+
* horizontal separator and the width of a vertical one.
|
|
36
|
+
*/
|
|
37
|
+
thickness?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the separator is only visual. A decorative separator is skipped by
|
|
40
|
+
* screen readers; set false when the split itself carries meaning — between
|
|
41
|
+
* two groups of menu items, say — and it is announced instead.
|
|
42
|
+
*/
|
|
43
|
+
decorative?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare const Separator: import("react").ForwardRefExoticComponent<SeparatorProps & import("react").RefAttributes<View>>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAwBrB,CAAC;AAEH,MAAM,WAAW,cACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,iBAAiB,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,SAAS,iGA6BrB,CAAC"}
|
|
@@ -7,13 +7,37 @@ declare const surfaceVariants: import("tailwind-variants").TVReturnType<{
|
|
|
7
7
|
tertiary: string;
|
|
8
8
|
transparent: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
padding: {
|
|
11
|
+
none: string;
|
|
12
|
+
sm: string;
|
|
13
|
+
default: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
};
|
|
16
|
+
bordered: {
|
|
17
|
+
true: string;
|
|
18
|
+
};
|
|
19
|
+
elevated: {
|
|
20
|
+
true: string;
|
|
21
|
+
};
|
|
22
|
+
}, undefined, "overflow-hidden rounded-3xl", {
|
|
11
23
|
variant: {
|
|
12
24
|
default: string;
|
|
13
25
|
secondary: string;
|
|
14
26
|
tertiary: string;
|
|
15
27
|
transparent: string;
|
|
16
28
|
};
|
|
29
|
+
padding: {
|
|
30
|
+
none: string;
|
|
31
|
+
sm: string;
|
|
32
|
+
default: string;
|
|
33
|
+
lg: string;
|
|
34
|
+
};
|
|
35
|
+
bordered: {
|
|
36
|
+
true: string;
|
|
37
|
+
};
|
|
38
|
+
elevated: {
|
|
39
|
+
true: string;
|
|
40
|
+
};
|
|
17
41
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
18
42
|
variant: {
|
|
19
43
|
default: string;
|
|
@@ -21,9 +45,34 @@ declare const surfaceVariants: import("tailwind-variants").TVReturnType<{
|
|
|
21
45
|
tertiary: string;
|
|
22
46
|
transparent: string;
|
|
23
47
|
};
|
|
24
|
-
|
|
48
|
+
padding: {
|
|
49
|
+
none: string;
|
|
50
|
+
sm: string;
|
|
51
|
+
default: string;
|
|
52
|
+
lg: string;
|
|
53
|
+
};
|
|
54
|
+
bordered: {
|
|
55
|
+
true: string;
|
|
56
|
+
};
|
|
57
|
+
elevated: {
|
|
58
|
+
true: string;
|
|
59
|
+
};
|
|
60
|
+
}, undefined, "overflow-hidden rounded-3xl", unknown, unknown, undefined>>;
|
|
25
61
|
export interface SurfaceProps extends ViewProps, VariantProps<typeof surfaceVariants> {
|
|
26
62
|
className?: string;
|
|
63
|
+
/**
|
|
64
|
+
* A hairline border. A surface the same colour as what it sits on needs one
|
|
65
|
+
* to read as a distinct plane rather than dissolving into the background.
|
|
66
|
+
*/
|
|
67
|
+
bordered?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* A soft shadow lifting the surface off the page. Off by default because a
|
|
70
|
+
* nested surface reads its depth from its fill, not from a shadow it would
|
|
71
|
+
* only cast onto its parent.
|
|
72
|
+
*/
|
|
73
|
+
elevated?: boolean;
|
|
74
|
+
/** Inner spacing. `none` is for a surface wrapping a bled image or a chart. */
|
|
75
|
+
padding?: 'none' | 'sm' | 'default' | 'lg';
|
|
27
76
|
}
|
|
28
77
|
export declare const Surface: import("react").ForwardRefExoticComponent<SurfaceProps & import("react").RefAttributes<View>>;
|
|
29
78
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/surface/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAc,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/surface/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAc,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EA0BnB,CAAC;AAEH,MAAM,WAAW,YACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,OAAO,+FAYnB,CAAC"}
|