glacia-native 0.4.0 → 0.5.1

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.
Files changed (73) hide show
  1. package/lib/module/Bars.js +269 -0
  2. package/lib/module/Carousel.js +103 -0
  3. package/lib/module/Display.js +317 -0
  4. package/lib/module/Feedback.js +386 -0
  5. package/lib/module/Forms2.js +454 -0
  6. package/lib/module/Message.js +88 -0
  7. package/lib/module/Overlays.js +328 -0
  8. package/lib/module/Pickers.js +243 -0
  9. package/lib/module/SegmentedControl.js +5 -1
  10. package/lib/module/Slider.js +6 -1
  11. package/lib/module/Switch.js +4 -1
  12. package/lib/module/TabBar.js +5 -1
  13. package/lib/module/Text.js +37 -0
  14. package/lib/module/ai.js +8 -3
  15. package/lib/module/index.js +79 -1
  16. package/lib/module/internal/GlassContainer.js +54 -0
  17. package/lib/module/internal/GlassView.js +31 -7
  18. package/lib/module/internal/a11y.js +94 -0
  19. package/lib/module/internal/fallback.js +19 -8
  20. package/lib/module/internal/glass-routing.js +7 -0
  21. package/lib/module/internal/haptics.js +54 -0
  22. package/lib/module/internal/motion.js +10 -1
  23. package/lib/module/internal/primitives.js +73 -3
  24. package/lib/module/internal/tokens.js +101 -1
  25. package/lib/typescript/Bars.d.ts +188 -0
  26. package/lib/typescript/Carousel.d.ts +47 -0
  27. package/lib/typescript/Display.d.ts +178 -0
  28. package/lib/typescript/Feedback.d.ts +196 -0
  29. package/lib/typescript/Forms2.d.ts +209 -0
  30. package/lib/typescript/Glass.d.ts +1 -1
  31. package/lib/typescript/Message.d.ts +71 -0
  32. package/lib/typescript/Overlays.d.ts +146 -0
  33. package/lib/typescript/Pickers.d.ts +105 -0
  34. package/lib/typescript/SegmentedControl.d.ts +2 -0
  35. package/lib/typescript/Slider.d.ts +2 -0
  36. package/lib/typescript/Switch.d.ts +2 -0
  37. package/lib/typescript/TabBar.d.ts +2 -0
  38. package/lib/typescript/Text.d.ts +28 -0
  39. package/lib/typescript/index.d.ts +11 -1
  40. package/lib/typescript/internal/GlassContainer.d.ts +37 -0
  41. package/lib/typescript/internal/GlassView.d.ts +18 -1
  42. package/lib/typescript/internal/a11y.d.ts +19 -0
  43. package/lib/typescript/internal/fallback.d.ts +5 -0
  44. package/lib/typescript/internal/glass-routing.d.ts +10 -0
  45. package/lib/typescript/internal/haptics.d.ts +7 -0
  46. package/lib/typescript/internal/motion.d.ts +4 -0
  47. package/lib/typescript/internal/primitives.d.ts +21 -0
  48. package/lib/typescript/internal/tokens.d.ts +114 -0
  49. package/package.json +2 -2
  50. package/src/Bars.tsx +797 -0
  51. package/src/Carousel.tsx +233 -0
  52. package/src/Display.tsx +778 -0
  53. package/src/Feedback.tsx +969 -0
  54. package/src/Forms2.tsx +1014 -0
  55. package/src/Message.tsx +219 -0
  56. package/src/Overlays.tsx +685 -0
  57. package/src/Pickers.tsx +590 -0
  58. package/src/SegmentedControl.tsx +6 -0
  59. package/src/Slider.tsx +7 -0
  60. package/src/Switch.tsx +5 -0
  61. package/src/TabBar.tsx +6 -0
  62. package/src/Text.tsx +83 -0
  63. package/src/ai.tsx +9 -3
  64. package/src/index.ts +142 -1
  65. package/src/internal/GlassContainer.tsx +82 -0
  66. package/src/internal/GlassView.tsx +37 -7
  67. package/src/internal/a11y.ts +105 -0
  68. package/src/internal/fallback.tsx +19 -2
  69. package/src/internal/glass-routing.ts +17 -0
  70. package/src/internal/haptics.ts +59 -0
  71. package/src/internal/motion.ts +10 -1
  72. package/src/internal/primitives.ts +84 -3
  73. package/src/internal/tokens.ts +110 -0
@@ -0,0 +1,196 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ import { type Tone } from "./internal/tokens";
4
+ export interface ToastAction {
5
+ label: string;
6
+ onPress: () => void;
7
+ }
8
+ export interface ToastProps {
9
+ /** Controlled visibility. Omit it and the toast keeps its own state. */
10
+ visible?: boolean;
11
+ defaultVisible?: boolean;
12
+ onDismiss?: () => void;
13
+ message: string;
14
+ /** One optional action, e.g. Undo. */
15
+ action?: ToastAction;
16
+ /** A leading icon (an SVG node the caller supplies). */
17
+ icon?: ReactNode;
18
+ /**
19
+ * Milliseconds before it dismisses itself. 0 keeps it until dismissed.
20
+ * The timer is cleared on unmount as well as on dismiss.
21
+ */
22
+ duration?: number;
23
+ tone?: Tone | "neutral";
24
+ style?: StyleProp<ViewStyle>;
25
+ isDark?: boolean;
26
+ testID?: string;
27
+ }
28
+ /**
29
+ * A transient message on a glass pill.
30
+ *
31
+ * A toast is not a dialog: it never blocks the screen, so it renders in place
32
+ * and lets touches through to what is underneath. It dismisses itself after
33
+ * `duration` unless it is controlled or `duration` is 0.
34
+ */
35
+ export declare const Toast: import("react").ForwardRefExoticComponent<ToastProps & import("react").RefAttributes<any>>;
36
+ /** One message in a ToastViewport's queue. */
37
+ export interface ToastItem {
38
+ /** A stable identity. Required, because the queue reorders and dismisses. */
39
+ id: string;
40
+ message: string;
41
+ action?: ToastAction;
42
+ icon?: ReactNode;
43
+ tone?: Tone | "neutral";
44
+ /** Milliseconds before it dismisses itself. 0 keeps it until dismissed. */
45
+ duration?: number;
46
+ }
47
+ export interface ToastViewportProps {
48
+ /** The messages to show. The oldest are dropped when more than 3 arrive. */
49
+ toasts: ToastItem[];
50
+ /** Called when one leaves, by timer, by swipe or by its action. */
51
+ onDismiss: (id: string) => void;
52
+ /** How many are visible at once. Extras wait in order. Defaults to 3. */
53
+ max?: number;
54
+ /** Where the stack sits. */
55
+ position?: "top" | "bottom";
56
+ style?: StyleProp<ViewStyle>;
57
+ isDark?: boolean;
58
+ testID?: string;
59
+ }
60
+ /**
61
+ * A queue of toasts, stacked the way Sonner stacks them.
62
+ *
63
+ * Three at a time is the practical limit: beyond that the messages stop being
64
+ * read and start covering the screen. Extras wait in the order they arrived, so
65
+ * no message is lost and the newest is never hidden behind a backlog.
66
+ *
67
+ * Each toast is independently dismissible — its own timer, its own action, and
68
+ * a swipe up. Swiping one up removes only that one.
69
+ *
70
+ * The single `Toast` keeps working unchanged: this is the host for when an app
71
+ * has several messages at once, not a replacement. A caller that shows one
72
+ * message continues to use `Toast` directly.
73
+ */
74
+ export declare const ToastViewport: import("react").ForwardRefExoticComponent<ToastViewportProps & import("react").RefAttributes<any>>;
75
+ export interface BannerProps {
76
+ title?: string;
77
+ message: string;
78
+ tone?: Tone;
79
+ /** A leading icon node. */
80
+ icon?: ReactNode;
81
+ /** Shows a dismiss button when provided. */
82
+ onDismiss?: () => void;
83
+ /** A single inline action, e.g. Retry. */
84
+ action?: ToastAction;
85
+ style?: StyleProp<ViewStyle>;
86
+ isDark?: boolean;
87
+ testID?: string;
88
+ }
89
+ /**
90
+ * An inline alert.
91
+ *
92
+ * Unlike AlertDialog it is not modal and not an overlay: it sits in the layout
93
+ * and pushes the content below it down. The surface is glass with the tone's
94
+ * colour as its edge, so the tone reads at a glance without turning the whole
95
+ * panel into a solid block of colour.
96
+ */
97
+ export declare const Banner: import("react").ForwardRefExoticComponent<BannerProps & import("react").RefAttributes<any>>;
98
+ /** One action revealed by swiping a row. */
99
+ export interface ListSwipeAction {
100
+ label: string;
101
+ /** A leading node, typically an SVG icon the caller supplies. */
102
+ icon?: ReactNode;
103
+ /** The action's tint. Defaults to the theme's fill. */
104
+ color?: string;
105
+ onPress: () => void;
106
+ }
107
+ export interface ListItemProps {
108
+ /** An avatar, icon or other leading node. */
109
+ leading?: ReactNode;
110
+ /** The row's main text. */
111
+ title: string;
112
+ /** Secondary line under the title. */
113
+ description?: string;
114
+ /** A value text, a control, or any trailing node. */
115
+ trailing?: ReactNode;
116
+ /** Draws a chevron when the row is tappable and nothing else trails it. */
117
+ chevron?: boolean;
118
+ onPress?: () => void;
119
+ disabled?: boolean;
120
+ selected?: boolean;
121
+ /** Actions revealed by swiping right (towards the trailing edge). */
122
+ swipeActions?: ListSwipeAction[];
123
+ /** Actions revealed by swiping left. */
124
+ leadingSwipeActions?: ListSwipeAction[];
125
+ /** Width allotted to each revealed action button. */
126
+ swipeActionWidth?: number;
127
+ /** Turns the swipe gesture off, leaving the row's `onPress` only. */
128
+ swipeable?: boolean;
129
+ /** Opt out of the selection tick when a swipe opens. */
130
+ haptics?: boolean;
131
+ style?: StyleProp<ViewStyle>;
132
+ isDark?: boolean;
133
+ testID?: string;
134
+ }
135
+ /**
136
+ * One row of a List.
137
+ *
138
+ * The row is a Pressable when it has an `onPress`, and inert otherwise, which
139
+ * is what the platform expects: a row that does nothing should not announce
140
+ * itself as a button. The chevron is decoration and is hidden from screen
141
+ * readers, since the row's own role already says it is tappable.
142
+ */
143
+ export declare const ListItem: import("react").ForwardRefExoticComponent<ListItemProps & import("react").RefAttributes<any>>;
144
+ export interface ListProps {
145
+ children?: ReactNode;
146
+ /** Renders the rows on one glass panel with separators between them. */
147
+ inset?: boolean;
148
+ style?: StyleProp<ViewStyle>;
149
+ isDark?: boolean;
150
+ testID?: string;
151
+ }
152
+ /**
153
+ * A grouped list of rows — the backbone of settings and profile screens.
154
+ *
155
+ * With `inset`, the rows sit on one glass panel with hairline separators, which
156
+ * is the shape iOS settings screens use. The separators are drawn by the
157
+ * caller's ListItem spacing rather than by nesting glass inside glass.
158
+ */
159
+ export declare const List: import("react").ForwardRefExoticComponent<ListProps & import("react").RefAttributes<any>>;
160
+ /** A titled group of rows, e.g. "Account" above its settings. */
161
+ export interface ListSectionProps {
162
+ header?: string;
163
+ children?: ReactNode;
164
+ style?: StyleProp<ViewStyle>;
165
+ isDark?: boolean;
166
+ testID?: string;
167
+ }
168
+ export declare const ListSection: import("react").ForwardRefExoticComponent<ListSectionProps & import("react").RefAttributes<any>>;
169
+ export interface AccordionSection {
170
+ /** Stable identity for the section. */
171
+ value: string;
172
+ title: string;
173
+ /** Optional second line in the header. */
174
+ description?: string;
175
+ content: ReactNode;
176
+ }
177
+ export interface AccordionProps {
178
+ sections: AccordionSection[];
179
+ /** Allow several sections open at once. */
180
+ multiple?: boolean;
181
+ /** Controlled open sections. Omit for uncontrolled. */
182
+ openSections?: string[];
183
+ defaultOpenSections?: string[];
184
+ onOpenSectionsChange?: (open: string[]) => void;
185
+ style?: StyleProp<ViewStyle>;
186
+ isDark?: boolean;
187
+ testID?: string;
188
+ }
189
+ /**
190
+ * Expandable sections.
191
+ *
192
+ * The header is a Pressable reporting `expanded`; the panel is measured with
193
+ * the height the content reports and animated on the springs token, so the
194
+ * reveal is a real transition rather than an instant jump.
195
+ */
196
+ export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,209 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ export interface StepperProps {
4
+ /** Controlled value. Omit and the stepper keeps its own. */
5
+ value?: number;
6
+ defaultValue?: number;
7
+ onValueChange?: (value: number) => void;
8
+ min?: number;
9
+ max?: number;
10
+ step?: number;
11
+ disabled?: boolean;
12
+ /** Announced by screen readers, e.g. "Guests". */
13
+ accessibilityLabel: string;
14
+ /** Formats the middle readout; defaults to the plain number. */
15
+ formatValue?: (value: number) => string;
16
+ style?: StyleProp<ViewStyle>;
17
+ isDark?: boolean;
18
+ testID?: string;
19
+ }
20
+ /**
21
+ * Minus / value / plus.
22
+ *
23
+ * The same interaction contract Slider established: `adjustable` with
24
+ * increment and decrement accessibility actions, and clamping at min and max
25
+ * rather than wrapping or drifting past the range.
26
+ */
27
+ export declare const Stepper: import("react").ForwardRefExoticComponent<StepperProps & import("react").RefAttributes<any>>;
28
+ export interface ToggleProps {
29
+ /** Controlled pressed state. Omit and the toggle keeps its own. */
30
+ pressed?: boolean;
31
+ defaultPressed?: boolean;
32
+ onPressedChange?: (pressed: boolean) => void;
33
+ /** Equivalent to `pressed`, matching web's Toggle naming. */
34
+ selected?: boolean;
35
+ icon?: ReactNode;
36
+ children?: ReactNode;
37
+ variant?: "glass" | "ghost";
38
+ size?: "sm" | "md" | "lg";
39
+ disabled?: boolean;
40
+ /** Required when the toggle has no visible text. */
41
+ accessibilityLabel?: string;
42
+ style?: StyleProp<ViewStyle>;
43
+ isDark?: boolean;
44
+ testID?: string;
45
+ }
46
+ /**
47
+ * A button that stays pressed.
48
+ *
49
+ * Distinct from Switch: this is a button with an on-state (bold, favourite,
50
+ * pinned), not a setting. It reports `selected`, which is what web's Toggle
51
+ * announces.
52
+ */
53
+ export declare const Toggle: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<any>>;
54
+ export interface ToggleGroupItem {
55
+ value: string;
56
+ label: string;
57
+ icon?: ReactNode;
58
+ }
59
+ export interface ToggleGroupProps {
60
+ items: ToggleGroupItem[];
61
+ /** Allow several items on at once. */
62
+ multiple?: boolean;
63
+ /** Controlled selection. A string for single mode, an array for multiple. */
64
+ value?: string | string[];
65
+ defaultValue?: string | string[];
66
+ onValueChange?: (value: string | string[]) => void;
67
+ size?: "sm" | "md" | "lg";
68
+ disabled?: boolean;
69
+ accessibilityLabel?: string;
70
+ style?: StyleProp<ViewStyle>;
71
+ isDark?: boolean;
72
+ testID?: string;
73
+ }
74
+ /**
75
+ * A row of toggles acting as one choice.
76
+ *
77
+ * Built from the same pieces as SegmentedControl — one glass container, toggles
78
+ * inside it, `glassActive` marking the active ones — but each item carries the
79
+ * button styling of Toggle.
80
+ */
81
+ export declare const ToggleGroup: import("react").ForwardRefExoticComponent<ToggleGroupProps & import("react").RefAttributes<any>>;
82
+ export interface InputOTPProps {
83
+ /** Controlled code. Omit and the field keeps its own. */
84
+ value?: string;
85
+ defaultValue?: string;
86
+ onChange?: (value: string) => void;
87
+ /** Fires once the code reaches `length` characters. */
88
+ onComplete?: (value: string) => void;
89
+ /** How many digits. */
90
+ length?: number;
91
+ disabled?: boolean;
92
+ accessibilityLabel?: string;
93
+ style?: StyleProp<ViewStyle>;
94
+ isDark?: boolean;
95
+ testID?: string;
96
+ }
97
+ /**
98
+ * A verification-code row.
99
+ *
100
+ * One real text field drives the boxes. Keeping a single field — rather than N
101
+ * inputs — is what makes paste and autofill fill every box in one go, and it is
102
+ * what keeps the caret and keyboard behaviour sane across platforms.
103
+ */
104
+ export declare const InputOTP: import("react").ForwardRefExoticComponent<InputOTPProps & import("react").RefAttributes<any>>;
105
+ export interface ButtonGroupItem {
106
+ label: string;
107
+ onPress: () => void;
108
+ disabled?: boolean;
109
+ }
110
+ export interface ButtonGroupProps {
111
+ items: ButtonGroupItem[];
112
+ size?: "sm" | "md" | "lg";
113
+ /** `attached` shares edges; `segmented` leaves a gap between buttons. */
114
+ variant?: "attached" | "segmented";
115
+ /** A single handler instead of per-item `onPress`. */
116
+ onItemPress?: (item: ButtonGroupItem, index: number) => void;
117
+ accessibilityLabel?: string;
118
+ style?: StyleProp<ViewStyle>;
119
+ isDark?: boolean;
120
+ testID?: string;
121
+ }
122
+ /**
123
+ * A connected row of buttons.
124
+ *
125
+ * Stateless by design: it reports presses and holds no selection, which is what
126
+ * separates it from SegmentedControl (a stateful choice) and ToggleGroup.
127
+ */
128
+ export declare const ButtonGroup: import("react").ForwardRefExoticComponent<ButtonGroupProps & import("react").RefAttributes<any>>;
129
+ export interface ColorPickerProps {
130
+ /** A palette of hex colours the caller supplies. */
131
+ colors?: string[];
132
+ /** Controlled value. Omit and the picker keeps its own. */
133
+ value?: string;
134
+ defaultValue?: string;
135
+ onChange?: (color: string) => void;
136
+ /** The swatch size. */
137
+ size?: "sm" | "md" | "lg";
138
+ /** Rows in the palette grid. Defaults to a single row. */
139
+ columns?: number;
140
+ /** Whether a custom row (hue + picker) appears below the palette. */
141
+ allowCustom?: boolean;
142
+ disabled?: boolean;
143
+ /** The accessible name. */
144
+ accessibilityLabel?: string;
145
+ style?: StyleProp<ViewStyle>;
146
+ isDark?: boolean;
147
+ testID?: string;
148
+ }
149
+ /**
150
+ * A colour picker built from Glacia's own parts — no native widget.
151
+ *
152
+ * The palette is a grid of swatches from the caller's colours; the custom row
153
+ * is a hue track drawn as an SVG gradient (the resolver's shapes, so it works
154
+ * wherever the charts work) driven by the same Slider mechanics as the rest of
155
+ * the library: a drag along the track picks a hue, and a second track saturates
156
+ * it. The value is a hex string.
157
+ *
158
+ * The default palette is a small set of iOS-conventional colours, in case a
159
+ * caller wants a picker with no colour knowledge of its own.
160
+ */
161
+ export declare const DEFAULT_PALETTE: string[];
162
+ /** Parses a hex colour into its red, green and blue channels. */
163
+ export declare function hexToRgb(hex: string): {
164
+ r: number;
165
+ g: number;
166
+ b: number;
167
+ } | null;
168
+ /** Builds a hue gradient's colours, sweeping red → orange → … → red. */
169
+ export declare function hueGradientColors(): string[];
170
+ /** Converts an RGB triple to a hex string. */
171
+ export declare function rgbToHex(r: number, g: number, b: number): string;
172
+ export declare const ColorPicker: import("react").ForwardRefExoticComponent<ColorPickerProps & import("react").RefAttributes<any>>;
173
+ export interface ComboboxOption {
174
+ label: string;
175
+ value: string;
176
+ /** Extra text under the label, if any. */
177
+ description?: string;
178
+ }
179
+ export interface ComboboxProps {
180
+ /** The options the user can choose from. */
181
+ options: ComboboxOption[];
182
+ /** Controlled value. Omit and the combobox keeps its own. */
183
+ value?: string;
184
+ defaultValue?: string;
185
+ onChange?: (value: string) => void;
186
+ /** A description of the underlying field. */
187
+ label?: string;
188
+ placeholder?: string;
189
+ disabled?: boolean;
190
+ /** Called when the dropdown's empty result shows. */
191
+ onEmpty?: () => void;
192
+ style?: StyleProp<ViewStyle>;
193
+ isDark?: boolean;
194
+ testID?: string;
195
+ }
196
+ /**
197
+ * A type-to-search select.
198
+ *
199
+ * The Input patterns (real TextInput, themed placeholder, `value`/`defaultValue`)
200
+ * open a Menu-style glass dropdown whose list filters as the user types — every
201
+ * keystroke re-filters the options, so the visible set genuinely shrinks, never
202
+ * a list that stays put and pretends to search.
203
+ *
204
+ * The filter is a case-insensitive substring match on label and description. An
205
+ * empty result shows an explicit empty row, so the user sees a search that found
206
+ * nothing rather than a list that silently went blank. The dropdown stays open
207
+ * until an option is picked or the field loses focus.
208
+ */
209
+ export declare const Combobox: import("react").ForwardRefExoticComponent<ComboboxProps & import("react").RefAttributes<any>>;
@@ -11,4 +11,4 @@ export interface GlassProps extends NativeGlassProps {
11
11
  * iOS 26+, Glacia's translucent fallback of identical shape on older iOS and
12
12
  * Android. `testID` is passed to whichever surface renders.
13
13
  */
14
- export declare const Glass: import("react").ForwardRefExoticComponent<GlassProps & import("react").RefAttributes<any>>;
14
+ export declare const Glass: import("react").ForwardRefExoticComponent<Omit<GlassProps, "ref"> & import("react").RefAttributes<any>>;
@@ -0,0 +1,71 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ export interface MessageBubbleProps {
4
+ /** Whether the message is the device owner's (right, tinted) or not (left). */
5
+ outgoing?: boolean;
6
+ children?: ReactNode;
7
+ style?: StyleProp<ViewStyle>;
8
+ isDark?: boolean;
9
+ testID?: string;
10
+ }
11
+ /**
12
+ * One message's bubble.
13
+ *
14
+ * Both directions are flat tints, not glass: a chat transcript is a long
15
+ * scrolling list, and glass under every line would stack translucent surfaces
16
+ * over each other and over the conversation behind them. The glass in a chat
17
+ * belongs to the composer, which floats over the transcript — so
18
+ * `NativeAIInput` is glass and the bubbles are not.
19
+ *
20
+ * Incoming messages take the theme's wash; outgoing take `glassActive`, the
21
+ * same tint the library uses for any selected surface, so a transcript reads
22
+ * consistently with the rest of Glacia.
23
+ */
24
+ export declare const MessageBubble: import("react").ForwardRefExoticComponent<MessageBubbleProps & import("react").RefAttributes<any>>;
25
+ export interface MessageAttachmentProps {
26
+ /** The file's name, shown and used as the accessible label. */
27
+ name: string;
28
+ /** A human-readable size, e.g. "1.2 MB". */
29
+ size?: string;
30
+ /** A leading node, typically an SVG icon. */
31
+ icon?: ReactNode;
32
+ /** Makes the chip tappable, e.g. to open the file. */
33
+ onPress?: () => void;
34
+ disabled?: boolean;
35
+ style?: StyleProp<ViewStyle>;
36
+ isDark?: boolean;
37
+ testID?: string;
38
+ }
39
+ /**
40
+ * A file chip for a message.
41
+ *
42
+ * A flat, bordered chip rather than a glass one, for the same reason the
43
+ * bubbles are flat: it sits inside a bubble or beside one, and glass inside
44
+ * glass is never allowed. The size is a caller-formatted string — byte
45
+ * formatting belongs to the app's locale, not to a component library.
46
+ */
47
+ export declare const MessageAttachment: import("react").ForwardRefExoticComponent<MessageAttachmentProps & import("react").RefAttributes<any>>;
48
+ export interface MessageProps {
49
+ /** The sender's name, shown above the content. */
50
+ name?: string;
51
+ /** A time or timestamp, shown beside the name. */
52
+ time?: string;
53
+ /** Draws an Avatar showing `name`'s initials beside the content. */
54
+ avatar?: boolean;
55
+ /** The bubble direction. */
56
+ outgoing?: boolean;
57
+ /** The message's content: text, or a bubble, or a bubble with attachments. */
58
+ children?: ReactNode;
59
+ style?: StyleProp<ViewStyle>;
60
+ isDark?: boolean;
61
+ testID?: string;
62
+ }
63
+ /**
64
+ * A whole message: who sent it, when, and what they said.
65
+ *
66
+ * The row every chat screen builds by hand — an avatar, a name and time line,
67
+ * and the content under it. Grouping it means the alignment, spacing and
68
+ * accessibility grouping are decided once: the row is announced as a single
69
+ * message (name, time, content) rather than as three unrelated pieces of text.
70
+ */
71
+ export declare const Message: import("react").ForwardRefExoticComponent<MessageProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,146 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ /**
4
+ * Keeps a popover inside the window.
5
+ *
6
+ * Called with the trigger's measured frame and the popover's own size; returns
7
+ * the offsets that bring it back on screen. A menu near the bottom edge flips
8
+ * above its trigger rather than hanging off the display.
9
+ */
10
+ export declare function anchorPopover(trigger: {
11
+ x: number;
12
+ y: number;
13
+ width: number;
14
+ height: number;
15
+ }, popover: {
16
+ width: number;
17
+ height: number;
18
+ }, viewport: {
19
+ width: number;
20
+ height: number;
21
+ }, gap?: number): {
22
+ left: number;
23
+ top: number;
24
+ flipped: boolean;
25
+ };
26
+ export interface MenuItem {
27
+ label: string;
28
+ onPress: () => void;
29
+ icon?: ReactNode;
30
+ disabled?: boolean;
31
+ /** Renders in the destructive tone, for delete-and-similar. */
32
+ destructive?: boolean;
33
+ accessibilityLabel?: string;
34
+ }
35
+ export interface MenuProps {
36
+ /** The control that opens the menu. */
37
+ trigger: ReactNode;
38
+ items: MenuItem[];
39
+ /** Controlled open state. Omit and the menu keeps its own. */
40
+ open?: boolean;
41
+ onOpenChange?: (open: boolean) => void;
42
+ /** The menu's width. The list scrolls if the items exceed the screen. */
43
+ width?: number;
44
+ accessibilityLabel?: string;
45
+ style?: StyleProp<ViewStyle>;
46
+ isDark?: boolean;
47
+ testID?: string;
48
+ }
49
+ /**
50
+ * An anchored dropdown menu.
51
+ *
52
+ * A press outside or on an item closes it; Android's back button does too. The
53
+ * popover is a glass surface with `glassActive` rows, matching the way the
54
+ * library marks a tappable row rather than nesting another glass panel.
55
+ */
56
+ export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<any>>;
57
+ export interface SheetProps {
58
+ /** Controlled visibility. Omit and the sheet keeps its own. */
59
+ open?: boolean;
60
+ defaultOpen?: boolean;
61
+ onOpenChange?: (open: boolean) => void;
62
+ title?: string;
63
+ children?: ReactNode;
64
+ footer?: ReactNode;
65
+ /** Tapping the scrim dismisses. */
66
+ dismissOnBackdropPress?: boolean;
67
+ /** The drag handle at the top of the panel. */
68
+ showHandle?: boolean;
69
+ /**
70
+ * Resting heights the sheet can settle at, smallest first. A number is
71
+ * points; a fraction below 1 is a share of the window height. With one
72
+ * point the sheet opens there; with several it can be dragged between them.
73
+ * Omitted, the sheet uses its own natural height.
74
+ */
75
+ snapPoints?: number[];
76
+ /** Which snap point to open at. Defaults to the first. */
77
+ initialSnapIndex?: number;
78
+ /** Controlled snap point. Omit and the sheet tracks its own. */
79
+ snapIndex?: number;
80
+ onSnapIndexChange?: (index: number) => void;
81
+ /** Dragging below the lowest point dismisses instead of springing back. */
82
+ dismissOnSnapToBottom?: boolean;
83
+ /** Turns the drag gesture off, leaving press-and-back dismissal only. */
84
+ draggable?: boolean;
85
+ /** Opt out of the selection tick on snap changes. */
86
+ haptics?: boolean;
87
+ style?: StyleProp<ViewStyle>;
88
+ isDark?: boolean;
89
+ testID?: string;
90
+ }
91
+ /**
92
+ * A bottom sheet.
93
+ *
94
+ * The general-purpose container: it slides up on the springs token, dismisses
95
+ * on a scrim press and on Android back. ActionSheet remains the action-menu
96
+ * specialisation of this shape; Sheet is for arbitrary content — a form, a
97
+ * calendar, a detail panel.
98
+ */
99
+ /**
100
+ * Turns a snap point into a pixel height.
101
+ *
102
+ * A number under 1 is a fraction of the window; anything else is points. The
103
+ * result is clamped so a sheet can never be taller than the space it has.
104
+ */
105
+ export declare function resolveSnapPoint(point: number, windowHeight: number): number;
106
+ /**
107
+ * Picks the snap point nearest to where the user let go.
108
+ *
109
+ * `height` is how tall the sheet currently is. Ties go to the smaller sheet,
110
+ * so a small flick does not jump the panel to full height.
111
+ */
112
+ export declare function nearestSnapPoint(heights: number[], height: number): number;
113
+ export declare const Sheet: import("react").ForwardRefExoticComponent<SheetProps & import("react").RefAttributes<any>>;
114
+ export interface DrawerProps {
115
+ /** Controlled visibility. Omit and the drawer keeps its own. */
116
+ open?: boolean;
117
+ defaultOpen?: boolean;
118
+ onOpenChange?: (open: boolean) => void;
119
+ /** The edge the panel slides in from. */
120
+ side?: "left" | "right";
121
+ /** Panel width. */
122
+ width?: number;
123
+ children?: ReactNode;
124
+ /** Tapping the scrim dismisses. */
125
+ dismissOnBackdropPress?: boolean;
126
+ /** Turns the drag-to-close gesture off. */
127
+ draggable?: boolean;
128
+ /** Opt out of the selection tick when the drawer is thrown closed. */
129
+ haptics?: boolean;
130
+ style?: StyleProp<ViewStyle>;
131
+ isDark?: boolean;
132
+ testID?: string;
133
+ }
134
+ /**
135
+ * A side navigation drawer.
136
+ *
137
+ * The same overlay discipline as Sheet — scrim, spring slide, Android back —
138
+ * but anchored to a side edge, with a square panel that runs the full height.
139
+ * The caller supplies the content, typically a List.
140
+ *
141
+ * Dragging the panel towards its own edge follows the finger; releasing past
142
+ * the halfway point, or with enough outward velocity, closes it, and a drag
143
+ * that stays inside springs it back open. Reduce Motion is honoured: with it
144
+ * on, the drawer appears and disappears without sliding.
145
+ */
146
+ export declare const Drawer: import("react").ForwardRefExoticComponent<DrawerProps & import("react").RefAttributes<any>>;