@tallyui/primitives 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/dist/index.d.ts +1370 -0
- package/dist/index.js +3954 -0
- package/package.json +47 -0
- package/src/__tests__/accordion.test.tsx +370 -0
- package/src/__tests__/alert-dialog.test.tsx +127 -0
- package/src/__tests__/animated.test.tsx +184 -0
- package/src/__tests__/checkbox.test.tsx +90 -0
- package/src/__tests__/collapsible.test.tsx +149 -0
- package/src/__tests__/combobox.test.tsx +292 -0
- package/src/__tests__/context-menu.test.tsx +226 -0
- package/src/__tests__/dialog.test.tsx +81 -0
- package/src/__tests__/dropdown-menu.test.tsx +119 -0
- package/src/__tests__/hooks.test.tsx +46 -0
- package/src/__tests__/hover-card.test.tsx +77 -0
- package/src/__tests__/image.test.tsx +53 -0
- package/src/__tests__/label.test.tsx +50 -0
- package/src/__tests__/list.test.tsx +63 -0
- package/src/__tests__/popover.test.tsx +63 -0
- package/src/__tests__/portal.test.tsx +66 -0
- package/src/__tests__/progress.test.tsx +70 -0
- package/src/__tests__/radio-group.test.tsx +164 -0
- package/src/__tests__/select.test.tsx +76 -0
- package/src/__tests__/separator.test.tsx +37 -0
- package/src/__tests__/slider.test.tsx +124 -0
- package/src/__tests__/slot.test.tsx +56 -0
- package/src/__tests__/switch.test.tsx +70 -0
- package/src/__tests__/table.test.tsx +172 -0
- package/src/__tests__/tabs.test.tsx +67 -0
- package/src/__tests__/text.test.tsx +59 -0
- package/src/__tests__/toast.test.tsx +137 -0
- package/src/__tests__/toggle-group.test.tsx +167 -0
- package/src/__tests__/toggle.test.tsx +60 -0
- package/src/__tests__/tooltip.test.tsx +77 -0
- package/src/__tests__/types.test-d.ts +106 -0
- package/src/__tests__/utils.test.ts +47 -0
- package/src/accordion/accordion.tsx +232 -0
- package/src/accordion/index.ts +12 -0
- package/src/accordion/types.ts +56 -0
- package/src/alert-dialog/alert-dialog.tsx +296 -0
- package/src/alert-dialog/index.ts +25 -0
- package/src/alert-dialog/types.ts +50 -0
- package/src/animated/index.ts +3 -0
- package/src/animated/presence.tsx +27 -0
- package/src/animated/types.ts +36 -0
- package/src/animated/use-presence.ts +44 -0
- package/src/checkbox/checkbox.tsx +106 -0
- package/src/checkbox/index.ts +2 -0
- package/src/checkbox/types.ts +19 -0
- package/src/collapsible/collapsible.tsx +135 -0
- package/src/collapsible/index.ts +2 -0
- package/src/collapsible/types.ts +25 -0
- package/src/combobox/combobox.tsx +325 -0
- package/src/combobox/index.ts +24 -0
- package/src/combobox/types.ts +84 -0
- package/src/context-menu/context-menu.tsx +654 -0
- package/src/context-menu/index.ts +40 -0
- package/src/context-menu/types.ts +117 -0
- package/src/dialog/dialog.tsx +260 -0
- package/src/dialog/index.ts +23 -0
- package/src/dialog/types.ts +47 -0
- package/src/dropdown-menu/dropdown-menu.tsx +654 -0
- package/src/dropdown-menu/index.ts +40 -0
- package/src/dropdown-menu/types.ts +117 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/use-augmented-ref.ts +32 -0
- package/src/hooks/use-controllable-state.ts +87 -0
- package/src/hooks/use-relative-position.ts +253 -0
- package/src/hooks/use-relative-position.web.ts +9 -0
- package/src/hover-card/hover-card.tsx +271 -0
- package/src/hover-card/index.ts +17 -0
- package/src/hover-card/types.ts +50 -0
- package/src/image/image.tsx +29 -0
- package/src/image/index.ts +2 -0
- package/src/image/types.ts +10 -0
- package/src/index.ts +38 -0
- package/src/label/index.ts +2 -0
- package/src/label/label.tsx +45 -0
- package/src/label/types.ts +11 -0
- package/src/list/index.ts +2 -0
- package/src/list/list.tsx +54 -0
- package/src/list/types.ts +14 -0
- package/src/popover/index.ts +19 -0
- package/src/popover/popover.tsx +314 -0
- package/src/popover/types.ts +51 -0
- package/src/portal.tsx +60 -0
- package/src/progress/index.ts +2 -0
- package/src/progress/progress.tsx +92 -0
- package/src/progress/types.ts +16 -0
- package/src/radio-group/index.ts +2 -0
- package/src/radio-group/radio-group.tsx +160 -0
- package/src/radio-group/types.ts +31 -0
- package/src/select/index.ts +34 -0
- package/src/select/select.tsx +465 -0
- package/src/select/types.ts +112 -0
- package/src/separator/index.ts +2 -0
- package/src/separator/separator.tsx +32 -0
- package/src/separator/types.ts +8 -0
- package/src/slider/index.ts +2 -0
- package/src/slider/slider.tsx +139 -0
- package/src/slider/types.ts +35 -0
- package/src/slot.tsx +160 -0
- package/src/switch/index.ts +2 -0
- package/src/switch/switch.tsx +92 -0
- package/src/switch/types.ts +18 -0
- package/src/table/index.ts +12 -0
- package/src/table/table.tsx +160 -0
- package/src/table/types.ts +30 -0
- package/src/tabs/index.ts +15 -0
- package/src/tabs/tabs.tsx +140 -0
- package/src/tabs/types.ts +36 -0
- package/src/text/index.ts +2 -0
- package/src/text/text.tsx +40 -0
- package/src/text/types.ts +5 -0
- package/src/toast/index.ts +2 -0
- package/src/toast/toast.tsx +189 -0
- package/src/toast/types.ts +35 -0
- package/src/toggle/index.ts +2 -0
- package/src/toggle/toggle.tsx +59 -0
- package/src/toggle/types.ts +11 -0
- package/src/toggle-group/index.ts +2 -0
- package/src/toggle-group/toggle-group.tsx +123 -0
- package/src/toggle-group/types.ts +36 -0
- package/src/tooltip/index.ts +17 -0
- package/src/tooltip/tooltip.tsx +272 -0
- package/src/tooltip/types.ts +49 -0
- package/src/types.ts +129 -0
- package/src/uniwind-env.d.ts +31 -0
- package/src/utils.ts +67 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { LayoutRectangle } from 'react-native';
|
|
2
|
+
import type { LayoutPosition } from '../hooks';
|
|
3
|
+
import type {
|
|
4
|
+
ForceMountable,
|
|
5
|
+
PositionedContentProps,
|
|
6
|
+
SlottablePressableProps,
|
|
7
|
+
SlottableTextProps,
|
|
8
|
+
SlottableViewProps,
|
|
9
|
+
} from '../types';
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Context types
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
interface RootContext {
|
|
16
|
+
open: boolean;
|
|
17
|
+
onOpenChange: (open: boolean) => void;
|
|
18
|
+
triggerPosition: LayoutPosition | null;
|
|
19
|
+
setTriggerPosition: (pos: LayoutPosition | null) => void;
|
|
20
|
+
contentLayout: LayoutRectangle | null;
|
|
21
|
+
setContentLayout: (layout: LayoutRectangle | null) => void;
|
|
22
|
+
nativeID: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Component props
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
interface RootProps {
|
|
30
|
+
open?: boolean;
|
|
31
|
+
defaultOpen?: boolean;
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface TriggerProps extends SlottablePressableProps {}
|
|
37
|
+
|
|
38
|
+
interface PortalProps extends ForceMountable {
|
|
39
|
+
hostName?: string;
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface OverlayProps extends SlottablePressableProps, ForceMountable {
|
|
44
|
+
closeOnPress?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface ContentProps extends SlottableViewProps, PositionedContentProps {}
|
|
48
|
+
|
|
49
|
+
interface ItemProps extends SlottablePressableProps {
|
|
50
|
+
textValue?: string;
|
|
51
|
+
closeOnPress?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface GroupProps extends SlottableViewProps {}
|
|
55
|
+
|
|
56
|
+
interface LabelProps extends SlottableTextProps {}
|
|
57
|
+
|
|
58
|
+
interface CheckboxItemProps extends SlottablePressableProps {
|
|
59
|
+
checked: boolean;
|
|
60
|
+
onCheckedChange: (checked: boolean) => void;
|
|
61
|
+
textValue?: string;
|
|
62
|
+
closeOnPress?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface RadioGroupProps extends SlottableViewProps {
|
|
66
|
+
value: string | undefined;
|
|
67
|
+
onValueChange: (value: string) => void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface RadioItemProps extends SlottablePressableProps {
|
|
71
|
+
value: string;
|
|
72
|
+
textValue?: string;
|
|
73
|
+
closeOnPress?: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface ItemIndicatorProps extends SlottableViewProps, ForceMountable {}
|
|
77
|
+
|
|
78
|
+
interface SeparatorProps extends SlottableViewProps {
|
|
79
|
+
decorative?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface SubProps {
|
|
83
|
+
open?: boolean;
|
|
84
|
+
defaultOpen?: boolean;
|
|
85
|
+
onOpenChange?: (open: boolean) => void;
|
|
86
|
+
children?: React.ReactNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface SubTriggerProps extends SlottablePressableProps {
|
|
90
|
+
textValue?: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface SubContentProps extends SlottableViewProps, ForceMountable {}
|
|
94
|
+
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Exports
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
export type {
|
|
100
|
+
CheckboxItemProps,
|
|
101
|
+
ContentProps,
|
|
102
|
+
GroupProps,
|
|
103
|
+
ItemIndicatorProps,
|
|
104
|
+
ItemProps,
|
|
105
|
+
LabelProps,
|
|
106
|
+
OverlayProps,
|
|
107
|
+
PortalProps,
|
|
108
|
+
RadioGroupProps,
|
|
109
|
+
RadioItemProps,
|
|
110
|
+
RootContext,
|
|
111
|
+
RootProps,
|
|
112
|
+
SeparatorProps,
|
|
113
|
+
SubContentProps,
|
|
114
|
+
SubProps,
|
|
115
|
+
SubTriggerProps,
|
|
116
|
+
TriggerProps,
|
|
117
|
+
};
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Pressable, Text, View, type GestureResponderEvent } from 'react-native';
|
|
3
|
+
import { useControllableState } from '../hooks';
|
|
4
|
+
import { Portal as RNPortal } from '../portal';
|
|
5
|
+
import { Slot } from '../slot';
|
|
6
|
+
import type {
|
|
7
|
+
CloseProps,
|
|
8
|
+
ContentProps,
|
|
9
|
+
DescriptionProps,
|
|
10
|
+
OverlayProps,
|
|
11
|
+
PortalProps,
|
|
12
|
+
RootContext as RootContextType,
|
|
13
|
+
RootProps,
|
|
14
|
+
TitleProps,
|
|
15
|
+
TriggerProps,
|
|
16
|
+
} from './types';
|
|
17
|
+
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Contexts
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
const RootContext = React.createContext<RootContextType | null>(null);
|
|
23
|
+
|
|
24
|
+
function useRootContext(): RootContextType {
|
|
25
|
+
const context = React.useContext(RootContext);
|
|
26
|
+
if (!context) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'Dialog compound components cannot be rendered outside the Dialog.Root component'
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return context;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const InternalContext = React.createContext<{ nativeID: string } | null>(null);
|
|
35
|
+
|
|
36
|
+
function useInternalContext() {
|
|
37
|
+
const context = React.useContext(InternalContext);
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
'Dialog compound components cannot be rendered outside the Dialog.Root component'
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return context;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Root
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
function Root({ open: openProp, defaultOpen, onOpenChange: onOpenChangeProp, children }: RootProps) {
|
|
51
|
+
const nativeID = React.useId();
|
|
52
|
+
const [open = false, onOpenChange] = useControllableState({
|
|
53
|
+
prop: openProp,
|
|
54
|
+
defaultProp: defaultOpen,
|
|
55
|
+
onChange: onOpenChangeProp,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<InternalContext.Provider value={{ nativeID }}>
|
|
60
|
+
<RootContext.Provider value={{ open, onOpenChange }}>
|
|
61
|
+
{children}
|
|
62
|
+
</RootContext.Provider>
|
|
63
|
+
</InternalContext.Provider>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
Root.displayName = 'DialogRoot';
|
|
68
|
+
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Trigger
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
|
|
73
|
+
const Trigger = React.forwardRef<View, TriggerProps>(function Trigger(
|
|
74
|
+
{ asChild, onPress: onPressProp, disabled, ...props },
|
|
75
|
+
ref
|
|
76
|
+
) {
|
|
77
|
+
const { open, onOpenChange } = useRootContext();
|
|
78
|
+
|
|
79
|
+
const onPress = React.useCallback(
|
|
80
|
+
(ev: GestureResponderEvent) => {
|
|
81
|
+
onOpenChange(!open);
|
|
82
|
+
onPressProp?.(ev);
|
|
83
|
+
},
|
|
84
|
+
[onOpenChange, onPressProp, open]
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const Component = asChild ? Slot : Pressable;
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Component
|
|
91
|
+
ref={ref}
|
|
92
|
+
role="button"
|
|
93
|
+
aria-disabled={disabled || undefined}
|
|
94
|
+
onPress={onPress}
|
|
95
|
+
disabled={disabled || undefined}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
Trigger.displayName = 'DialogTrigger';
|
|
102
|
+
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Portal
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
|
|
107
|
+
function Portal({ forceMount, hostName, children }: PortalProps) {
|
|
108
|
+
const internalValue = useInternalContext();
|
|
109
|
+
const rootValue = useRootContext();
|
|
110
|
+
|
|
111
|
+
if (!forceMount && !rootValue.open) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<RNPortal hostName={hostName} name={`${internalValue.nativeID}_portal`}>
|
|
117
|
+
<InternalContext.Provider value={internalValue}>
|
|
118
|
+
<RootContext.Provider value={rootValue}>{children}</RootContext.Provider>
|
|
119
|
+
</InternalContext.Provider>
|
|
120
|
+
</RNPortal>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Portal.displayName = 'DialogPortal';
|
|
125
|
+
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Overlay
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
const Overlay = React.forwardRef<View, OverlayProps>(function Overlay(
|
|
131
|
+
{ asChild, forceMount, ...props },
|
|
132
|
+
ref
|
|
133
|
+
) {
|
|
134
|
+
const { open } = useRootContext();
|
|
135
|
+
|
|
136
|
+
if (!forceMount && !open) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const Component = asChild ? Slot : View;
|
|
141
|
+
|
|
142
|
+
return <Component ref={ref} aria-modal={true} {...props} />;
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
Overlay.displayName = 'DialogOverlay';
|
|
146
|
+
|
|
147
|
+
// ---------------------------------------------------------------------------
|
|
148
|
+
// Content
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
|
|
151
|
+
const Content = React.forwardRef<View, ContentProps>(function Content(
|
|
152
|
+
{ asChild, forceMount, ...props },
|
|
153
|
+
ref
|
|
154
|
+
) {
|
|
155
|
+
const { open } = useRootContext();
|
|
156
|
+
const { nativeID } = useInternalContext();
|
|
157
|
+
|
|
158
|
+
if (!forceMount && !open) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const Component = asChild ? Slot : View;
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<Component
|
|
166
|
+
ref={ref}
|
|
167
|
+
role="dialog"
|
|
168
|
+
nativeID={nativeID}
|
|
169
|
+
aria-labelledby={`${nativeID}_title`}
|
|
170
|
+
aria-describedby={`${nativeID}_description`}
|
|
171
|
+
{...props}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
Content.displayName = 'DialogContent';
|
|
177
|
+
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
// Title
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
|
|
182
|
+
const Title = React.forwardRef<Text, TitleProps>(function Title(
|
|
183
|
+
{ asChild, ...props },
|
|
184
|
+
ref
|
|
185
|
+
) {
|
|
186
|
+
const { nativeID } = useInternalContext();
|
|
187
|
+
|
|
188
|
+
const Component = asChild ? Slot : Text;
|
|
189
|
+
|
|
190
|
+
return <Component ref={ref} role="heading" nativeID={`${nativeID}_title`} {...props} />;
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
Title.displayName = 'DialogTitle';
|
|
194
|
+
|
|
195
|
+
// ---------------------------------------------------------------------------
|
|
196
|
+
// Description
|
|
197
|
+
// ---------------------------------------------------------------------------
|
|
198
|
+
|
|
199
|
+
const Description = React.forwardRef<Text, DescriptionProps>(function Description(
|
|
200
|
+
{ asChild, ...props },
|
|
201
|
+
ref
|
|
202
|
+
) {
|
|
203
|
+
const { nativeID } = useInternalContext();
|
|
204
|
+
|
|
205
|
+
const Component = asChild ? Slot : Text;
|
|
206
|
+
|
|
207
|
+
return <Component ref={ref} nativeID={`${nativeID}_description`} {...props} />;
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
Description.displayName = 'DialogDescription';
|
|
211
|
+
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
// Close
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
|
|
216
|
+
const Close = React.forwardRef<View, CloseProps>(function Close(
|
|
217
|
+
{ asChild, onPress: onPressProp, disabled, ...props },
|
|
218
|
+
ref
|
|
219
|
+
) {
|
|
220
|
+
const { onOpenChange } = useRootContext();
|
|
221
|
+
|
|
222
|
+
const onPress = React.useCallback(
|
|
223
|
+
(ev: GestureResponderEvent) => {
|
|
224
|
+
onOpenChange(false);
|
|
225
|
+
onPressProp?.(ev);
|
|
226
|
+
},
|
|
227
|
+
[onOpenChange, onPressProp]
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const Component = asChild ? Slot : Pressable;
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
<Component
|
|
234
|
+
ref={ref}
|
|
235
|
+
role="button"
|
|
236
|
+
aria-disabled={disabled || undefined}
|
|
237
|
+
onPress={onPress}
|
|
238
|
+
disabled={disabled || undefined}
|
|
239
|
+
{...props}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
Close.displayName = 'DialogClose';
|
|
245
|
+
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// Exports
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
|
|
250
|
+
export {
|
|
251
|
+
Close,
|
|
252
|
+
Content,
|
|
253
|
+
Description,
|
|
254
|
+
Overlay,
|
|
255
|
+
Portal,
|
|
256
|
+
Root,
|
|
257
|
+
Title,
|
|
258
|
+
Trigger,
|
|
259
|
+
useRootContext,
|
|
260
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Root,
|
|
3
|
+
Trigger,
|
|
4
|
+
Portal,
|
|
5
|
+
Overlay,
|
|
6
|
+
Content,
|
|
7
|
+
Title,
|
|
8
|
+
Description,
|
|
9
|
+
Close,
|
|
10
|
+
useRootContext,
|
|
11
|
+
} from './dialog';
|
|
12
|
+
|
|
13
|
+
export type {
|
|
14
|
+
RootProps,
|
|
15
|
+
TriggerProps,
|
|
16
|
+
PortalProps,
|
|
17
|
+
OverlayProps,
|
|
18
|
+
ContentProps,
|
|
19
|
+
TitleProps,
|
|
20
|
+
DescriptionProps,
|
|
21
|
+
CloseProps,
|
|
22
|
+
RootContext,
|
|
23
|
+
} from './types';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ForceMountable,
|
|
3
|
+
SlottablePressableProps,
|
|
4
|
+
SlottableTextProps,
|
|
5
|
+
SlottableViewProps,
|
|
6
|
+
} from '../types';
|
|
7
|
+
|
|
8
|
+
interface RootProps {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface TriggerProps extends SlottablePressableProps {}
|
|
16
|
+
|
|
17
|
+
interface PortalProps extends ForceMountable {
|
|
18
|
+
hostName?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface OverlayProps extends SlottableViewProps, ForceMountable {}
|
|
23
|
+
|
|
24
|
+
interface ContentProps extends SlottableViewProps, ForceMountable {}
|
|
25
|
+
|
|
26
|
+
interface TitleProps extends SlottableTextProps {}
|
|
27
|
+
|
|
28
|
+
interface DescriptionProps extends SlottableTextProps {}
|
|
29
|
+
|
|
30
|
+
interface CloseProps extends SlottablePressableProps {}
|
|
31
|
+
|
|
32
|
+
interface RootContext {
|
|
33
|
+
open: boolean;
|
|
34
|
+
onOpenChange: (open: boolean) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type {
|
|
38
|
+
CloseProps,
|
|
39
|
+
ContentProps,
|
|
40
|
+
DescriptionProps,
|
|
41
|
+
OverlayProps,
|
|
42
|
+
PortalProps,
|
|
43
|
+
RootContext,
|
|
44
|
+
RootProps,
|
|
45
|
+
TitleProps,
|
|
46
|
+
TriggerProps,
|
|
47
|
+
};
|