glacia-native 0.5.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.
- package/lib/module/Bars.js +95 -2
- package/lib/module/Display.js +78 -1
- package/lib/module/Feedback.js +221 -7
- package/lib/module/Forms2.js +228 -1
- package/lib/module/Message.js +88 -0
- package/lib/module/Overlays.js +173 -11
- package/lib/module/SegmentedControl.js +5 -1
- package/lib/module/Slider.js +6 -1
- package/lib/module/Switch.js +4 -1
- package/lib/module/TabBar.js +5 -1
- package/lib/module/ai.js +8 -3
- package/lib/module/index.js +23 -2
- package/lib/module/internal/GlassContainer.js +54 -0
- package/lib/module/internal/GlassView.js +8 -0
- package/lib/module/internal/a11y.js +94 -0
- package/lib/module/internal/fallback.js +19 -8
- package/lib/module/internal/glass-routing.js +7 -0
- package/lib/module/internal/haptics.js +54 -0
- package/lib/module/internal/motion.js +10 -1
- package/lib/module/internal/primitives.js +69 -4
- package/lib/module/internal/tokens.js +47 -1
- package/lib/typescript/Bars.d.ts +67 -0
- package/lib/typescript/Display.d.ts +59 -0
- package/lib/typescript/Feedback.d.ts +58 -0
- package/lib/typescript/Forms2.d.ts +81 -0
- package/lib/typescript/Message.d.ts +71 -0
- package/lib/typescript/Overlays.d.ts +41 -0
- package/lib/typescript/SegmentedControl.d.ts +2 -0
- package/lib/typescript/Slider.d.ts +2 -0
- package/lib/typescript/Switch.d.ts +2 -0
- package/lib/typescript/TabBar.d.ts +2 -0
- package/lib/typescript/index.d.ts +8 -6
- package/lib/typescript/internal/GlassContainer.d.ts +37 -0
- package/lib/typescript/internal/GlassView.d.ts +8 -0
- package/lib/typescript/internal/a11y.d.ts +19 -0
- package/lib/typescript/internal/fallback.d.ts +5 -0
- package/lib/typescript/internal/glass-routing.d.ts +10 -0
- package/lib/typescript/internal/haptics.d.ts +7 -0
- package/lib/typescript/internal/motion.d.ts +4 -0
- package/lib/typescript/internal/primitives.d.ts +21 -0
- package/lib/typescript/internal/tokens.d.ts +53 -0
- package/package.json +2 -2
- package/src/Bars.tsx +227 -0
- package/src/Display.tsx +229 -1
- package/src/Feedback.tsx +412 -22
- package/src/Forms2.tsx +407 -1
- package/src/Message.tsx +219 -0
- package/src/Overlays.tsx +244 -33
- package/src/SegmentedControl.tsx +6 -0
- package/src/Slider.tsx +7 -0
- package/src/Switch.tsx +5 -0
- package/src/TabBar.tsx +6 -0
- package/src/ai.tsx +9 -3
- package/src/index.ts +42 -1
- package/src/internal/GlassContainer.tsx +82 -0
- package/src/internal/GlassView.tsx +8 -0
- package/src/internal/a11y.ts +105 -0
- package/src/internal/fallback.tsx +19 -2
- package/src/internal/glass-routing.ts +17 -0
- package/src/internal/haptics.ts +59 -0
- package/src/internal/motion.ts +10 -1
- package/src/internal/primitives.ts +80 -4
- package/src/internal/tokens.ts +48 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colors = exports.typeScale = exports.springs = exports.radii = void 0;
|
|
3
|
+
exports.colors = exports.controlSizes = exports.palette = exports.typeScale = exports.springs = exports.radii = void 0;
|
|
4
4
|
exports.toneColor = toneColor;
|
|
5
5
|
const glacia_tokens_1 = require("glacia-tokens");
|
|
6
6
|
exports.radii = {
|
|
@@ -28,6 +28,33 @@ exports.typeScale = {
|
|
|
28
28
|
label: { fontSize: 13, lineHeight: 18, fontWeight: "600" },
|
|
29
29
|
caption: { fontSize: 12, lineHeight: 16, fontWeight: "400" },
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The default colour palette for ColorPicker.
|
|
33
|
+
*
|
|
34
|
+
* A palette is data, not a theme colour — it is the same twelve hues in light
|
|
35
|
+
* and dark — so it lives here rather than in either theme. Keeping it in the
|
|
36
|
+
* token module is also what lets the conformance guard require that component
|
|
37
|
+
* code contains no colour literal at all.
|
|
38
|
+
*/
|
|
39
|
+
exports.palette = {
|
|
40
|
+
default: [
|
|
41
|
+
"#FF3B30", "#FF9500", "#FFCC00", "#34C759", "#32ADE6", "#007AFF",
|
|
42
|
+
"#5856D6", "#AF52DE", "#FF2D55", "#A2845E", "#8E8E93", "#1C1C1E",
|
|
43
|
+
],
|
|
44
|
+
/** The colour a picker starts on when the caller gives none. */
|
|
45
|
+
fallback: "#007AFF",
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Control sizes in points, for components whose dimension is not a radius.
|
|
49
|
+
*
|
|
50
|
+
* Rating's stars are the reason this exists: a star has a size and the size
|
|
51
|
+
* must come from the scale rather than from a literal in the component.
|
|
52
|
+
*/
|
|
53
|
+
exports.controlSizes = {
|
|
54
|
+
star: { sm: 14, md: 20, lg: 28 },
|
|
55
|
+
swatch: { sm: 28, md: 36, lg: 44 },
|
|
56
|
+
picker: { track: 28 },
|
|
57
|
+
};
|
|
31
58
|
/**
|
|
32
59
|
* Theme colours in the form React Native accepts.
|
|
33
60
|
*
|
|
@@ -54,6 +81,20 @@ exports.colors = {
|
|
|
54
81
|
// Text and icons drawn on top of a filled (tinted) surface.
|
|
55
82
|
onTint: "#FFFFFF",
|
|
56
83
|
skeleton: "rgba(60, 60, 67, 0.12)",
|
|
84
|
+
/**
|
|
85
|
+
* The solid colour glass becomes when the user has asked the system to
|
|
86
|
+
* reduce transparency. Apple's rule is that a translucent surface is
|
|
87
|
+
* replaced by an opaque one, not merely tinted differently.
|
|
88
|
+
*/
|
|
89
|
+
glassSolid: "#F2F2F7",
|
|
90
|
+
/**
|
|
91
|
+
* Neutral colours used by pickers and fields: the field's own wash, and
|
|
92
|
+
* the far end of a saturation gradient (the point of no saturation).
|
|
93
|
+
*/
|
|
94
|
+
fieldWash: "rgba(120, 120, 128, 0.12)",
|
|
95
|
+
/** A flat neutral surface: incoming message bubbles, file chips. */
|
|
96
|
+
wash: "rgba(120, 120, 128, 0.12)",
|
|
97
|
+
neutralTop: "#FFFFFF",
|
|
57
98
|
// Chart axis and grid lines: low-contrast, so they never compete with data.
|
|
58
99
|
axis: "#3C3C43",
|
|
59
100
|
},
|
|
@@ -72,6 +113,11 @@ exports.colors = {
|
|
|
72
113
|
scrim: "rgba(0, 0, 0, 0.6)",
|
|
73
114
|
onTint: "#FFFFFF",
|
|
74
115
|
skeleton: "rgba(235, 235, 245, 0.14)",
|
|
116
|
+
glassSolid: "#1C1C1E",
|
|
117
|
+
fieldWash: "rgba(120, 120, 128, 0.12)",
|
|
118
|
+
/** A flat neutral surface: incoming message bubbles, file chips. */
|
|
119
|
+
wash: "rgba(120, 120, 128, 0.12)",
|
|
120
|
+
neutralTop: "#FFFFFF",
|
|
75
121
|
axis: "#EBEBF5",
|
|
76
122
|
},
|
|
77
123
|
};
|
package/lib/typescript/Bars.d.ts
CHANGED
|
@@ -108,6 +108,15 @@ export interface AppBarProps {
|
|
|
108
108
|
* knows its insets, and passing a number keeps this component dependency-free.
|
|
109
109
|
*/
|
|
110
110
|
topInset?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Whether content has scrolled under the bar.
|
|
113
|
+
*
|
|
114
|
+
* iOS bars sit quiet at the top of a screen and gain a defined edge once
|
|
115
|
+
* content passes beneath them, so the bar reads as a layer over the content
|
|
116
|
+
* rather than as part of it. Wire this to a ScrollView's scroll offset — see
|
|
117
|
+
* the component's documentation for the two-line version.
|
|
118
|
+
*/
|
|
119
|
+
scrolled?: boolean;
|
|
111
120
|
style?: StyleProp<ViewStyle>;
|
|
112
121
|
isDark?: boolean;
|
|
113
122
|
testID?: string;
|
|
@@ -117,5 +126,63 @@ export interface AppBarProps {
|
|
|
117
126
|
*
|
|
118
127
|
* A glass bar across the top of the screen with a leading action, a title and
|
|
119
128
|
* trailing actions — the counterpart to the existing bottom TabBar.
|
|
129
|
+
*
|
|
130
|
+
* `scrolled` mirrors iOS 26's scroll-edge effect. At the top of the screen the
|
|
131
|
+
* bar is quiet: its bottom edge is invisible and the glass blends into the
|
|
132
|
+
* content above it. Once content has scrolled under it, the edge token becomes
|
|
133
|
+
* visible and the surface reads as a distinct layer — the change iOS makes when
|
|
134
|
+
* a navigation bar starts floating over scrolled content.
|
|
135
|
+
*
|
|
136
|
+
* ```
|
|
137
|
+
* const [scrolled, setScrolled] = useState(false);
|
|
138
|
+
* <ScrollView onScroll={(e) => setScrolled(e.nativeEvent.contentOffset.y > 8)}
|
|
139
|
+
* scrollEventThrottle={16}>{...}</ScrollView>
|
|
140
|
+
* <AppBar title="Inbox" scrolled={scrolled} />
|
|
141
|
+
* ```
|
|
120
142
|
*/
|
|
121
143
|
export declare const AppBar: import("react").ForwardRefExoticComponent<AppBarProps & import("react").RefAttributes<any>>;
|
|
144
|
+
export interface FABGroupAction {
|
|
145
|
+
/** A leading node, typically an SVG icon the caller supplies. */
|
|
146
|
+
icon: ReactNode;
|
|
147
|
+
/** The action's name, shown on its mini button. */
|
|
148
|
+
label: string;
|
|
149
|
+
onPress: () => void;
|
|
150
|
+
}
|
|
151
|
+
export interface FABGroupProps {
|
|
152
|
+
/** The actions, listed top to bottom as they appear when expanded. */
|
|
153
|
+
actions: FABGroupAction[];
|
|
154
|
+
/** The icon on the main button. Rotates 45° while open. */
|
|
155
|
+
icon: ReactNode;
|
|
156
|
+
/** The icon on the main button while open. Defaults to the closed one. */
|
|
157
|
+
closeIcon?: ReactNode;
|
|
158
|
+
/** Controlled open state. Omit and the group keeps its own. */
|
|
159
|
+
open?: boolean;
|
|
160
|
+
defaultOpen?: boolean;
|
|
161
|
+
onOpenChange?: (open: boolean) => void;
|
|
162
|
+
/** The main button's accessible name. */
|
|
163
|
+
accessibilityLabel?: string;
|
|
164
|
+
size?: "md" | "lg";
|
|
165
|
+
style?: StyleProp<ViewStyle>;
|
|
166
|
+
isDark?: boolean;
|
|
167
|
+
testID?: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* A main button that expands into a stack of labelled mini buttons.
|
|
171
|
+
*
|
|
172
|
+
* The pattern Paper calls `FAB.Group`: one floating button stands in for a set
|
|
173
|
+
* of actions until it is opened, then the actions appear above it, each on its
|
|
174
|
+
* own glass pill with a label. A scrim behind them takes the next press and
|
|
175
|
+
* closes the group, which is how a floating action set gets out of the way
|
|
176
|
+
* without a dismissal button.
|
|
177
|
+
*
|
|
178
|
+
* The mini buttons rise on the bouncy spring with a small stagger, and the main
|
|
179
|
+
* button's icon rotates 45° — both settle instantly under Reduce Motion.
|
|
180
|
+
*
|
|
181
|
+
* **Merging is an iOS 26+ visual effect.** This component is one glass surface
|
|
182
|
+
* plus one per action; to have them blend into a single connected surface, put
|
|
183
|
+
* the group inside a `GlassContainer` on iOS 26. It works standalone — nothing
|
|
184
|
+
* depends on the container — and that composition is left to the caller rather
|
|
185
|
+
* than forced, because a group outside a container is the correct rendering on
|
|
186
|
+
* every other platform anyway.
|
|
187
|
+
*/
|
|
188
|
+
export declare const FABGroup: import("react").ForwardRefExoticComponent<FABGroupProps & import("react").RefAttributes<any>>;
|
|
@@ -117,3 +117,62 @@ export interface ProgressProps {
|
|
|
117
117
|
* internally — this component generalises it.
|
|
118
118
|
*/
|
|
119
119
|
export declare const Progress: import("react").ForwardRefExoticComponent<ProgressProps & import("react").RefAttributes<any>>;
|
|
120
|
+
export interface RatingProps {
|
|
121
|
+
/** How many stars are filled. Fractions render a partially filled star. */
|
|
122
|
+
value: number;
|
|
123
|
+
/** The number of stars. Defaults to five. */
|
|
124
|
+
max?: number;
|
|
125
|
+
size?: "sm" | "md" | "lg";
|
|
126
|
+
/** Makes the stars tappable. Omit for a read-only rating. */
|
|
127
|
+
onChange?: (value: number) => void;
|
|
128
|
+
disabled?: boolean;
|
|
129
|
+
/** The accessible name, e.g. "Rating". */
|
|
130
|
+
accessibilityLabel?: string;
|
|
131
|
+
style?: StyleProp<ViewStyle>;
|
|
132
|
+
isDark?: boolean;
|
|
133
|
+
testID?: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A star rating.
|
|
137
|
+
*
|
|
138
|
+
* The stars are drawn as SVG paths from the resolver, so nothing is a
|
|
139
|
+
* platform control. A fractional value fills part of a star: 3.5 draws three
|
|
140
|
+
* full stars and one half, the half produced by clipping the filled star at the
|
|
141
|
+
* fraction's width rather than by rounding — a 4.5-star average must look like
|
|
142
|
+
* a 4.5-star average.
|
|
143
|
+
*
|
|
144
|
+
* Read-only unless `onChange` is given. With it, each star is tappable, the
|
|
145
|
+
* value is exposed as an adjustable control (increment/decrement through
|
|
146
|
+
* accessibility actions), and each star has its own label so a screen reader
|
|
147
|
+
* can name the exact rating it sets.
|
|
148
|
+
*/
|
|
149
|
+
export declare const Rating: import("react").ForwardRefExoticComponent<RatingProps & import("react").RefAttributes<any>>;
|
|
150
|
+
export interface NativeImageProps {
|
|
151
|
+
/** The image to show. */
|
|
152
|
+
source: {
|
|
153
|
+
uri: string;
|
|
154
|
+
} | number;
|
|
155
|
+
/** A description for screen readers. Required: an image with no name is a hole. */
|
|
156
|
+
accessibilityLabel: string;
|
|
157
|
+
/** Shown behind the image while it loads; a Skeleton when omitted. */
|
|
158
|
+
placeholder?: ReactNode;
|
|
159
|
+
/** Shown when the image fails to load. */
|
|
160
|
+
fallback?: ReactNode;
|
|
161
|
+
/** Fades the image in when it loads. Honours Reduce Motion. */
|
|
162
|
+
fadeIn?: boolean;
|
|
163
|
+
style?: StyleProp<ViewStyle>;
|
|
164
|
+
isDark?: boolean;
|
|
165
|
+
testID?: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* A plain image, with the loading and error states every app ends up writing.
|
|
169
|
+
*
|
|
170
|
+
* Three states, because an image on a phone is three states: loading (a
|
|
171
|
+
* Skeleton behind it), loaded (a fade in), and failed (the caller's fallback).
|
|
172
|
+
* Aspect ratio comes from `style`, so a caller sets `aspectRatio` and the height
|
|
173
|
+
* follows.
|
|
174
|
+
*
|
|
175
|
+
* This is the plain one; `NativeImageGeneration` is the AI-specific cousin and
|
|
176
|
+
* keeps its own state machine.
|
|
177
|
+
*/
|
|
178
|
+
export declare const NativeImage: import("react").ForwardRefExoticComponent<NativeImageProps & import("react").RefAttributes<any>>;
|
|
@@ -33,6 +33,45 @@ export interface ToastProps {
|
|
|
33
33
|
* `duration` unless it is controlled or `duration` is 0.
|
|
34
34
|
*/
|
|
35
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>>;
|
|
36
75
|
export interface BannerProps {
|
|
37
76
|
title?: string;
|
|
38
77
|
message: string;
|
|
@@ -56,6 +95,15 @@ export interface BannerProps {
|
|
|
56
95
|
* panel into a solid block of colour.
|
|
57
96
|
*/
|
|
58
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
|
+
}
|
|
59
107
|
export interface ListItemProps {
|
|
60
108
|
/** An avatar, icon or other leading node. */
|
|
61
109
|
leading?: ReactNode;
|
|
@@ -70,6 +118,16 @@ export interface ListItemProps {
|
|
|
70
118
|
onPress?: () => void;
|
|
71
119
|
disabled?: boolean;
|
|
72
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;
|
|
73
131
|
style?: StyleProp<ViewStyle>;
|
|
74
132
|
isDark?: boolean;
|
|
75
133
|
testID?: string;
|
|
@@ -126,3 +126,84 @@ export interface ButtonGroupProps {
|
|
|
126
126
|
* separates it from SegmentedControl (a stateful choice) and ToggleGroup.
|
|
127
127
|
*/
|
|
128
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>>;
|
|
@@ -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>>;
|
|
@@ -66,6 +66,24 @@ export interface SheetProps {
|
|
|
66
66
|
dismissOnBackdropPress?: boolean;
|
|
67
67
|
/** The drag handle at the top of the panel. */
|
|
68
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;
|
|
69
87
|
style?: StyleProp<ViewStyle>;
|
|
70
88
|
isDark?: boolean;
|
|
71
89
|
testID?: string;
|
|
@@ -78,6 +96,20 @@ export interface SheetProps {
|
|
|
78
96
|
* specialisation of this shape; Sheet is for arbitrary content — a form, a
|
|
79
97
|
* calendar, a detail panel.
|
|
80
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;
|
|
81
113
|
export declare const Sheet: import("react").ForwardRefExoticComponent<SheetProps & import("react").RefAttributes<any>>;
|
|
82
114
|
export interface DrawerProps {
|
|
83
115
|
/** Controlled visibility. Omit and the drawer keeps its own. */
|
|
@@ -91,6 +123,10 @@ export interface DrawerProps {
|
|
|
91
123
|
children?: ReactNode;
|
|
92
124
|
/** Tapping the scrim dismisses. */
|
|
93
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;
|
|
94
130
|
style?: StyleProp<ViewStyle>;
|
|
95
131
|
isDark?: boolean;
|
|
96
132
|
testID?: string;
|
|
@@ -101,5 +137,10 @@ export interface DrawerProps {
|
|
|
101
137
|
* The same overlay discipline as Sheet — scrim, spring slide, Android back —
|
|
102
138
|
* but anchored to a side edge, with a square panel that runs the full height.
|
|
103
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.
|
|
104
145
|
*/
|
|
105
146
|
export declare const Drawer: import("react").ForwardRefExoticComponent<DrawerProps & import("react").RefAttributes<any>>;
|
|
@@ -4,6 +4,8 @@ export interface SegmentedControlProps {
|
|
|
4
4
|
selectedIndex?: number;
|
|
5
5
|
defaultIndex?: number;
|
|
6
6
|
onValueChange?: (value: string, index: number) => void;
|
|
7
|
+
/** One selection tick when the segment changes. `false` opts out. */
|
|
8
|
+
haptics?: boolean;
|
|
7
9
|
style?: StyleProp<ViewStyle>;
|
|
8
10
|
isDark?: boolean;
|
|
9
11
|
/** Passed through to the control so it is testable. */
|
|
@@ -7,6 +7,8 @@ export interface SliderProps {
|
|
|
7
7
|
step?: number;
|
|
8
8
|
onValueChange?: (value: number) => void;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
/** One selection tick each time the stepped value changes while dragging. */
|
|
11
|
+
haptics?: boolean;
|
|
10
12
|
accessibilityLabel: string;
|
|
11
13
|
style?: StyleProp<ViewStyle>;
|
|
12
14
|
isDark?: boolean;
|
|
@@ -3,6 +3,8 @@ export interface SwitchProps {
|
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
defaultChecked?: boolean;
|
|
5
5
|
onCheckedChange?: (checked: boolean) => void;
|
|
6
|
+
/** One selection tick when it toggles. `false` opts out. */
|
|
7
|
+
haptics?: boolean;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
accessibilityLabel: string;
|
|
8
10
|
style?: StyleProp<ViewStyle>;
|
|
@@ -10,6 +10,8 @@ export interface TabBarProps {
|
|
|
10
10
|
activeId?: string;
|
|
11
11
|
defaultActiveId?: string;
|
|
12
12
|
onTabChange?: (id: string) => void;
|
|
13
|
+
/** One selection tick when the tab changes. `false` opts out. */
|
|
14
|
+
haptics?: boolean;
|
|
13
15
|
style?: StyleProp<ViewStyle>;
|
|
14
16
|
isDark?: boolean;
|
|
15
17
|
/** Passed through to the bar so it is testable. */
|
|
@@ -13,12 +13,14 @@ export { NativePlan, NativeSources, NativeResponse, NativeTask, NativeSoundwave,
|
|
|
13
13
|
export { NativeTable, NativeScrollArea, type NativeTableProps, type NativeTableColumn, type NativeTableRow, type NativeScrollAreaProps, } from "./Table";
|
|
14
14
|
export * from "./charts";
|
|
15
15
|
export { Text, type TextProps, type TextVariant } from "./Text";
|
|
16
|
-
export { Avatar, Badge, Separator, Skeleton, Spinner, Progress, initialsOf, type AvatarProps, type AvatarSize, type BadgeProps, type SeparatorProps, type SkeletonProps, type SpinnerProps, type SpinnerSize, type ProgressProps, type ProgressVariant, } from "./Display";
|
|
17
|
-
export { Toast, Banner, List, ListItem, ListSection, Accordion, type ToastProps, type ToastAction, type BannerProps, type ListProps, type ListItemProps, type ListSectionProps, type AccordionProps, type AccordionSection, } from "./Feedback";
|
|
18
|
-
export { SearchBar, Chip, FAB, IconButton, AppBar, type SearchBarProps, type ChipProps, type FABProps, type IconButtonProps, type AppBarProps, type AppBarAction, } from "./Bars";
|
|
19
|
-
export { Menu, Sheet, Drawer, anchorPopover, type MenuProps, type MenuItem, type SheetProps, type DrawerProps, } from "./Overlays";
|
|
16
|
+
export { Avatar, Badge, Separator, Skeleton, Spinner, Progress, initialsOf, type AvatarProps, type AvatarSize, type BadgeProps, type SeparatorProps, type SkeletonProps, type SpinnerProps, type SpinnerSize, type ProgressProps, type ProgressVariant, Rating, type RatingProps, NativeImage, type NativeImageProps, } from "./Display";
|
|
17
|
+
export { Toast, Banner, List, ListItem, ListSection, Accordion, ToastViewport, type ToastProps, type ToastAction, type ToastItem, type ToastViewportProps, type BannerProps, type ListProps, type ListItemProps, type ListSwipeAction, type ListSectionProps, type AccordionProps, type AccordionSection, } from "./Feedback";
|
|
18
|
+
export { SearchBar, Chip, FAB, IconButton, AppBar, type SearchBarProps, type ChipProps, type FABProps, type IconButtonProps, type AppBarProps, type AppBarAction, FABGroup, type FABGroupProps, type FABGroupAction, } from "./Bars";
|
|
19
|
+
export { Menu, Sheet, Drawer, anchorPopover, resolveSnapPoint, nearestSnapPoint, type MenuProps, type MenuItem, type SheetProps, type DrawerProps, } from "./Overlays";
|
|
20
20
|
export { Carousel, PageControl, type CarouselProps, type PageControlProps, } from "./Carousel";
|
|
21
|
-
export { Stepper, Toggle, ToggleGroup, InputOTP, ButtonGroup, type StepperProps, type ToggleProps, type ToggleGroupProps, type ToggleGroupItem, type InputOTPProps, type ButtonGroupProps, type ButtonGroupItem, } from "./Forms2";
|
|
21
|
+
export { Stepper, Toggle, ToggleGroup, InputOTP, ButtonGroup, type StepperProps, type ToggleProps, type ToggleGroupProps, type ToggleGroupItem, type InputOTPProps, type ButtonGroupProps, type ButtonGroupItem, ColorPicker, DEFAULT_PALETTE, hexToRgb, rgbToHex, hueGradientColors, type ColorPickerProps, Combobox, type ComboboxProps, type ComboboxOption, } from "./Forms2";
|
|
22
22
|
export { Calendar, DatePicker, TimePicker, monthGrid, startOfDay, sameDay, parseTime, formatTime, WEEKDAYS, MONTHS, type CalendarProps, type CalendarCell, type DatePickerProps, type TimePickerProps, } from "./Pickers";
|
|
23
|
+
export { Message, MessageBubble, MessageAttachment, type MessageProps, type MessageBubbleProps, type MessageAttachmentProps, } from "./Message";
|
|
23
24
|
export { isGlassSupported } from "./internal/GlassView";
|
|
24
|
-
export {
|
|
25
|
+
export { GlassContainer, type NativeGlassContainerProps } from "./internal/GlassContainer";
|
|
26
|
+
export { colors, controlSizes, palette, radii, springs, typeScale, toneColor, type Tone, } from "./internal/tokens";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
export interface NativeGlassContainerProps {
|
|
4
|
+
/**
|
|
5
|
+
* How close two glass surfaces must be before iOS 26 blends them into one
|
|
6
|
+
* connected liquid surface, in points. 0 merges only what touches.
|
|
7
|
+
*/
|
|
8
|
+
spacing?: number;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
isDark?: boolean;
|
|
12
|
+
testID?: string;
|
|
13
|
+
[prop: string]: any;
|
|
14
|
+
}
|
|
15
|
+
/** Clears the memoised decision. Only tests call this, to drive both branches. */
|
|
16
|
+
export declare function resetGlassContainerRouter(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Groups glass surfaces so iOS 26 can merge them into one surface.
|
|
19
|
+
*
|
|
20
|
+
* On iOS 26, Apple's Liquid Glass is a connected material: two glass elements
|
|
21
|
+
* placed close enough run together into a single shape with one shared edge,
|
|
22
|
+
* rather than reading as two separate panes. `GlassContainer` is the component
|
|
23
|
+
* that opts into that — a bar and the floating button above it, or a pair of
|
|
24
|
+
* adjacent buttons, become one piece of glass.
|
|
25
|
+
*
|
|
26
|
+
* **Merging is an iOS 26+ visual effect and a no-op everywhere else.** On
|
|
27
|
+
* older iOS, Android, Expo Go and the web preview this renders a plain wrapper
|
|
28
|
+
* with identical layout: the children are the same components, drawn at the
|
|
29
|
+
* same positions, they simply keep their own separate edges. Nothing changes
|
|
30
|
+
* shape or shifts, so a container costs nothing on the platforms that cannot
|
|
31
|
+
* blend.
|
|
32
|
+
*
|
|
33
|
+
* Use it only around surfaces that should read as one; glass inside glass is
|
|
34
|
+
* still forbidden, so a container's children are `Glass` surfaces placed side
|
|
35
|
+
* by side, not a panel wrapping another panel.
|
|
36
|
+
*/
|
|
37
|
+
export declare const GlassContainer: import("react").ForwardRefExoticComponent<Omit<NativeGlassContainerProps, "ref"> & import("react").RefAttributes<any>>;
|
|
@@ -28,5 +28,13 @@ export declare const isGlassSupported: boolean;
|
|
|
28
28
|
* Platform Glass View — the single place a glass surface is chosen:
|
|
29
29
|
* - iOS 26+: Real UIGlassEffect via @callstack/liquid-glass
|
|
30
30
|
* - iOS < 26 / Android / Expo Go: translucent tint View with identical layout
|
|
31
|
+
*
|
|
32
|
+
* Reduce Transparency is honoured on the fallback branch only: there the
|
|
33
|
+
* translucent tint is replaced by the theme's solid glass colour, with the same
|
|
34
|
+
* radius and the same hairline border, because a translucent surface is what
|
|
35
|
+
* the user asked the system to remove. On iOS 26 the system applies its own
|
|
36
|
+
* treatment to `UIGlassEffect` and this component does not second-guess it —
|
|
37
|
+
* overriding Apple's accessibility treatment would be worse than deferring to
|
|
38
|
+
* it, so the real glass is left exactly as the system renders it.
|
|
31
39
|
*/
|
|
32
40
|
export declare const GlassView: import("react").ForwardRefExoticComponent<Omit<NativeGlassProps, "ref"> & import("react").RefAttributes<any>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the user has asked the system to reduce transparency.
|
|
3
|
+
*
|
|
4
|
+
* When true, a glass surface must render a solid colour rather than a
|
|
5
|
+
* translucent one. `GlassView` honours this on the fallback branch; on iOS 26
|
|
6
|
+
* the system applies its own treatment to `UIGlassEffect` and is not
|
|
7
|
+
* second-guessed here.
|
|
8
|
+
*
|
|
9
|
+
* The change event is iOS-only in React Native, so on Android the initial
|
|
10
|
+
* read is the answer.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useReducedTransparency(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the user has asked the system to reduce motion.
|
|
15
|
+
*
|
|
16
|
+
* Glacia's own animations settle at their end state instead of playing when
|
|
17
|
+
* this is true.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useReducedMotion(): boolean;
|