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.
- package/lib/module/Bars.js +269 -0
- package/lib/module/Carousel.js +103 -0
- package/lib/module/Display.js +317 -0
- package/lib/module/Feedback.js +386 -0
- package/lib/module/Forms2.js +454 -0
- package/lib/module/Message.js +88 -0
- package/lib/module/Overlays.js +328 -0
- package/lib/module/Pickers.js +243 -0
- 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/Text.js +37 -0
- package/lib/module/ai.js +8 -3
- package/lib/module/index.js +79 -1
- package/lib/module/internal/GlassContainer.js +54 -0
- package/lib/module/internal/GlassView.js +31 -7
- 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 +73 -3
- package/lib/module/internal/tokens.js +101 -1
- package/lib/typescript/Bars.d.ts +188 -0
- package/lib/typescript/Carousel.d.ts +47 -0
- package/lib/typescript/Display.d.ts +178 -0
- package/lib/typescript/Feedback.d.ts +196 -0
- package/lib/typescript/Forms2.d.ts +209 -0
- package/lib/typescript/Glass.d.ts +1 -1
- package/lib/typescript/Message.d.ts +71 -0
- package/lib/typescript/Overlays.d.ts +146 -0
- package/lib/typescript/Pickers.d.ts +105 -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/Text.d.ts +28 -0
- package/lib/typescript/index.d.ts +11 -1
- package/lib/typescript/internal/GlassContainer.d.ts +37 -0
- package/lib/typescript/internal/GlassView.d.ts +18 -1
- 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 +114 -0
- package/package.json +2 -2
- package/src/Bars.tsx +797 -0
- package/src/Carousel.tsx +233 -0
- package/src/Display.tsx +778 -0
- package/src/Feedback.tsx +969 -0
- package/src/Forms2.tsx +1014 -0
- package/src/Message.tsx +219 -0
- package/src/Overlays.tsx +685 -0
- package/src/Pickers.tsx +590 -0
- 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/Text.tsx +83 -0
- package/src/ai.tsx +9 -3
- package/src/index.ts +142 -1
- package/src/internal/GlassContainer.tsx +82 -0
- package/src/internal/GlassView.tsx +37 -7
- 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 +84 -3
- package/src/internal/tokens.ts +110 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
/** Midnight on the same calendar day, so two picks compare equal. */
|
|
3
|
+
export declare function startOfDay(date: Date): Date;
|
|
4
|
+
export declare function sameDay(a: Date | undefined, b: Date | undefined): boolean;
|
|
5
|
+
export interface CalendarCell {
|
|
6
|
+
date: Date;
|
|
7
|
+
/** True for days outside the displayed month, shown to fill the grid. */
|
|
8
|
+
outside: boolean;
|
|
9
|
+
key: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The six-row month grid.
|
|
13
|
+
*
|
|
14
|
+
* Always six rows so the calendar does not change height as months change,
|
|
15
|
+
* which would make the surrounding layout jump between February and March.
|
|
16
|
+
*/
|
|
17
|
+
export declare function monthGrid(year: number, month: number, weekStartsOn?: 0 | 1): CalendarCell[];
|
|
18
|
+
export declare const WEEKDAYS: string[];
|
|
19
|
+
export declare const MONTHS: string[];
|
|
20
|
+
export interface CalendarProps {
|
|
21
|
+
/** Controlled selection. */
|
|
22
|
+
value?: Date;
|
|
23
|
+
/** Fires when a day is tapped. */
|
|
24
|
+
onChange?: (date: Date) => void;
|
|
25
|
+
/** Days before this are dimmed and cannot be picked. */
|
|
26
|
+
minDate?: Date;
|
|
27
|
+
/** Days after this are dimmed and cannot be picked. */
|
|
28
|
+
maxDate?: Date;
|
|
29
|
+
/** Which month to open on when there is no value. */
|
|
30
|
+
initialMonth?: Date;
|
|
31
|
+
/** 0 starts the week on Sunday, 1 on Monday. */
|
|
32
|
+
weekStartsOn?: 0 | 1;
|
|
33
|
+
style?: StyleProp<ViewStyle>;
|
|
34
|
+
isDark?: boolean;
|
|
35
|
+
testID?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A month calendar, built from Glacia's own views.
|
|
39
|
+
*
|
|
40
|
+
* No native date picker anywhere: the grid, the weekday header and the month
|
|
41
|
+
* navigation are ours, so the calendar looks the same on iOS and Android and
|
|
42
|
+
* wears the library's tokens. The selected day is a `glassActive` fill, today
|
|
43
|
+
* carries a ring, and disabled days are dimmed.
|
|
44
|
+
*/
|
|
45
|
+
export declare const Calendar: import("react").ForwardRefExoticComponent<CalendarProps & import("react").RefAttributes<any>>;
|
|
46
|
+
export interface DatePickerProps {
|
|
47
|
+
/** Controlled visibility. Omit and the picker keeps its own. */
|
|
48
|
+
open?: boolean;
|
|
49
|
+
defaultOpen?: boolean;
|
|
50
|
+
onOpenChange?: (open: boolean) => void;
|
|
51
|
+
/** The committed date. */
|
|
52
|
+
value?: Date;
|
|
53
|
+
/** Fires only when the user confirms, never on a mere browse. */
|
|
54
|
+
onConfirm?: (date: Date) => void;
|
|
55
|
+
onCancel?: () => void;
|
|
56
|
+
title?: string;
|
|
57
|
+
confirmLabel?: string;
|
|
58
|
+
cancelLabel?: string;
|
|
59
|
+
minDate?: Date;
|
|
60
|
+
maxDate?: Date;
|
|
61
|
+
style?: StyleProp<ViewStyle>;
|
|
62
|
+
isDark?: boolean;
|
|
63
|
+
testID?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A date picker: the Calendar presented in a Sheet.
|
|
67
|
+
*
|
|
68
|
+
* Browsing months does not commit anything — the pending date is local until
|
|
69
|
+
* the user confirms, so an accidental swipe of the calendar cannot change a
|
|
70
|
+
* saved value.
|
|
71
|
+
*/
|
|
72
|
+
export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps & import("react").RefAttributes<any>>;
|
|
73
|
+
export interface TimePickerProps {
|
|
74
|
+
open?: boolean;
|
|
75
|
+
defaultOpen?: boolean;
|
|
76
|
+
onOpenChange?: (open: boolean) => void;
|
|
77
|
+
/** The committed time, as "HH:MM" (24-hour). */
|
|
78
|
+
value?: string;
|
|
79
|
+
/** Fires only on confirm. */
|
|
80
|
+
onConfirm?: (time: string) => void;
|
|
81
|
+
onCancel?: () => void;
|
|
82
|
+
/** Show an AM/PM column and present times in 12-hour form. */
|
|
83
|
+
use12Hour?: boolean;
|
|
84
|
+
title?: string;
|
|
85
|
+
confirmLabel?: string;
|
|
86
|
+
cancelLabel?: string;
|
|
87
|
+
minuteStep?: number;
|
|
88
|
+
style?: StyleProp<ViewStyle>;
|
|
89
|
+
isDark?: boolean;
|
|
90
|
+
testID?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Splits "HH:MM" into parts, falling back to a sane default. */
|
|
93
|
+
export declare function parseTime(value: string | undefined): {
|
|
94
|
+
hour: number;
|
|
95
|
+
minute: number;
|
|
96
|
+
};
|
|
97
|
+
/** Formats parts back to zero-padded "HH:MM". */
|
|
98
|
+
export declare function formatTime(hour: number, minute: number): string;
|
|
99
|
+
/**
|
|
100
|
+
* A time picker: tappable hour/minute drums inside a Sheet.
|
|
101
|
+
*
|
|
102
|
+
* The drums are ordinary Pressables drawn by Glacia — not a native picker
|
|
103
|
+
* widget. Tapping a value selects it; the whole column scrolls in the Sheet.
|
|
104
|
+
*/
|
|
105
|
+
export declare const TimePicker: import("react").ForwardRefExoticComponent<TimePickerProps & 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. */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { StyleProp, TextStyle } from "react-native";
|
|
3
|
+
export type TextVariant = "title" | "heading" | "body" | "caption" | "label";
|
|
4
|
+
export interface TextProps {
|
|
5
|
+
/**
|
|
6
|
+
* The type step. The names come from the package's type scale, so a title in
|
|
7
|
+
* one app reads the same as a title in another.
|
|
8
|
+
*/
|
|
9
|
+
variant?: TextVariant;
|
|
10
|
+
/** Secondary text: descriptions, hints, timestamps. */
|
|
11
|
+
muted?: boolean;
|
|
12
|
+
/** Renders the text in the destructive tone (errors, danger). */
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
/** Number of lines before truncating. */
|
|
15
|
+
numberOfLines?: number;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
style?: StyleProp<TextStyle>;
|
|
18
|
+
isDark?: boolean;
|
|
19
|
+
testID?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Themed text.
|
|
23
|
+
*
|
|
24
|
+
* Every Glacia component that renders words uses this, so type, colour and
|
|
25
|
+
* contrast come from one place. It wraps the resolver's `Text`, which is React
|
|
26
|
+
* Native's own on a device.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<any>>;
|
|
@@ -12,5 +12,15 @@ export { Dialog, DialogTrigger, AlertDialog, ActionSheet, type DialogProps, type
|
|
|
12
12
|
export { NativePlan, NativeSources, NativeResponse, NativeTask, NativeSoundwave, NativeThinkingOrb, NativePanelside, NativeAIInput, NativeImageGeneration, type NativePlanProps, type NativePlanStep, type NativeSourcesProps, type NativeSource, type NativeResponseProps, type NativeTaskProps, type NativeSoundwaveProps, type NativeThinkingOrbProps, type NativePanelsideProps, type NativePanelNavItem, type NativeAIInputProps, type NativeImageGenerationProps, type NativeGeneratedImage, } from "./ai";
|
|
13
13
|
export { NativeTable, NativeScrollArea, type NativeTableProps, type NativeTableColumn, type NativeTableRow, type NativeScrollAreaProps, } from "./Table";
|
|
14
14
|
export * from "./charts";
|
|
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, 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
|
+
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, ColorPicker, DEFAULT_PALETTE, hexToRgb, rgbToHex, hueGradientColors, type ColorPickerProps, Combobox, type ComboboxProps, type ComboboxOption, } from "./Forms2";
|
|
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";
|
|
15
24
|
export { isGlassSupported } from "./internal/GlassView";
|
|
16
|
-
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>>;
|
|
@@ -13,11 +13,28 @@ export interface NativeGlassProps {
|
|
|
13
13
|
* colour scheme decides, so developers never thread this prop themselves.
|
|
14
14
|
*/
|
|
15
15
|
isDark?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Any further React Native view prop (accessibility, onLayout, pointer
|
|
18
|
+
* events, …) is passed straight through to whichever surface renders, so a
|
|
19
|
+
* component can put its own accessibility contract on the glass itself.
|
|
20
|
+
*/
|
|
21
|
+
[prop: string]: any;
|
|
16
22
|
}
|
|
23
|
+
/** Clears the memoised decision. Only tests call this, to drive both branches. */
|
|
24
|
+
export declare function resetGlassRouter(): void;
|
|
25
|
+
/** Whether this build renders Apple's glass. */
|
|
17
26
|
export declare const isGlassSupported: boolean;
|
|
18
27
|
/**
|
|
19
28
|
* Platform Glass View — the single place a glass surface is chosen:
|
|
20
29
|
* - iOS 26+: Real UIGlassEffect via @callstack/liquid-glass
|
|
21
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.
|
|
22
39
|
*/
|
|
23
|
-
export declare const GlassView: import("react").ForwardRefExoticComponent<NativeGlassProps & import("react").RefAttributes<any>>;
|
|
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;
|
|
@@ -7,6 +7,11 @@ export interface FallbackGlassProps {
|
|
|
7
7
|
style?: StyleProp<ViewStyle>;
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
isDark?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Force the solid treatment. Normally read from the system's Reduce
|
|
12
|
+
* Transparency preference; this exists so a test can pin it.
|
|
13
|
+
*/
|
|
14
|
+
reducedTransparency?: boolean;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* Glacia's own glass surface for every platform where Apple's material is not
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export interface LiquidGlassModule {
|
|
2
2
|
LiquidGlassView?: any;
|
|
3
|
+
/**
|
|
4
|
+
* The container that merges nearby glass elements into one connected
|
|
5
|
+
* surface. Exported by `@callstack/liquid-glass` alongside the view.
|
|
6
|
+
*/
|
|
7
|
+
LiquidGlassContainerView?: any;
|
|
3
8
|
isLiquidGlassSupported?: boolean;
|
|
4
9
|
}
|
|
5
10
|
/** The routing decision for one glass surface. */
|
|
@@ -8,6 +13,11 @@ export interface GlassRouter {
|
|
|
8
13
|
supported: boolean;
|
|
9
14
|
/** Apple's `LiquidGlassView`, or null when the fallback renders instead. */
|
|
10
15
|
LiquidGlassView: any;
|
|
16
|
+
/**
|
|
17
|
+
* Apple's `LiquidGlassContainerView` — the surface that merges neighbouring
|
|
18
|
+
* glass — or null when the fallback wrapper renders instead.
|
|
19
|
+
*/
|
|
20
|
+
LiquidGlassContainerView: any;
|
|
11
21
|
}
|
|
12
22
|
/**
|
|
13
23
|
* Reads a liquid-glass module and decides which branch renders.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One selection tick, for a control whose value just changed by one step.
|
|
3
|
+
*
|
|
4
|
+
* Silent where no haptics API is available (the DOM preview, a test run, a
|
|
5
|
+
* device without a vibration motor). Never throws.
|
|
6
|
+
*/
|
|
7
|
+
export declare function hapticSelection(): void;
|
|
@@ -12,6 +12,10 @@ export type SpringName = keyof typeof springs;
|
|
|
12
12
|
* on this platform. A caller that gets `animated === false` renders the target
|
|
13
13
|
* directly, so the DOM preview and tests show the settled state rather than an
|
|
14
14
|
* animation the environment cannot advance.
|
|
15
|
+
*
|
|
16
|
+
* Reduce Motion turns this into the same case: `animated` is false and the
|
|
17
|
+
* value is already at its target, so the component jumps to its end state
|
|
18
|
+
* rather than playing a transition the user asked not to see.
|
|
15
19
|
*/
|
|
16
20
|
export declare function useSpring(target: number, spring?: SpringName): {
|
|
17
21
|
value: any;
|
|
@@ -10,6 +10,11 @@ export interface RNPrimitives {
|
|
|
10
10
|
Circle: any;
|
|
11
11
|
Rect: any;
|
|
12
12
|
Polygon: any;
|
|
13
|
+
/** Gradient and clipping nodes, for the colour picker's hue track. */
|
|
14
|
+
Defs: any;
|
|
15
|
+
LinearGradient: any;
|
|
16
|
+
Stop: any;
|
|
17
|
+
ClipPath: any;
|
|
13
18
|
SvgText: any;
|
|
14
19
|
TextInput: any;
|
|
15
20
|
Modal: any;
|
|
@@ -28,6 +33,22 @@ export interface RNPrimitives {
|
|
|
28
33
|
PanResponder: any;
|
|
29
34
|
/** React Native's useColorScheme, or null outside a native runtime. */
|
|
30
35
|
useColorScheme: (() => "light" | "dark" | null | undefined) | null;
|
|
36
|
+
/**
|
|
37
|
+
* React Native's AccessibilityInfo, or null outside a native runtime. Read
|
|
38
|
+
* for the Reduce Transparency and Reduce Motion preferences.
|
|
39
|
+
*/
|
|
40
|
+
AccessibilityInfo: any;
|
|
41
|
+
/** React Native's Vibration, or null outside a native runtime. */
|
|
42
|
+
Vibration: any;
|
|
43
|
+
/**
|
|
44
|
+
* React Native's useWindowDimensions, or a fixed reader off-device. Snap
|
|
45
|
+
* points are fractions of the window, so the sheet needs the height before
|
|
46
|
+
* it can resolve them.
|
|
47
|
+
*/
|
|
48
|
+
useWindowDimensions: () => {
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
31
52
|
}
|
|
32
53
|
/**
|
|
33
54
|
* Records an element's width for gesture maths when the environment has no
|
|
@@ -22,6 +22,81 @@ export declare const springs: {
|
|
|
22
22
|
readonly mass: 1;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* The package's type scale, in React Native points.
|
|
27
|
+
*
|
|
28
|
+
* Text maps its variants onto these names so every component in the library —
|
|
29
|
+
* and every app built on it — sizes type the same way.
|
|
30
|
+
*/
|
|
31
|
+
export declare const typeScale: {
|
|
32
|
+
title: {
|
|
33
|
+
fontSize: number;
|
|
34
|
+
lineHeight: number;
|
|
35
|
+
fontWeight: "700";
|
|
36
|
+
};
|
|
37
|
+
heading: {
|
|
38
|
+
fontSize: number;
|
|
39
|
+
lineHeight: number;
|
|
40
|
+
fontWeight: "600";
|
|
41
|
+
};
|
|
42
|
+
body: {
|
|
43
|
+
fontSize: number;
|
|
44
|
+
lineHeight: number;
|
|
45
|
+
fontWeight: "400";
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
fontSize: number;
|
|
49
|
+
lineHeight: number;
|
|
50
|
+
fontWeight: "600";
|
|
51
|
+
};
|
|
52
|
+
caption: {
|
|
53
|
+
fontSize: number;
|
|
54
|
+
lineHeight: number;
|
|
55
|
+
fontWeight: "400";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The default colour palette for ColorPicker.
|
|
60
|
+
*
|
|
61
|
+
* A palette is data, not a theme colour — it is the same twelve hues in light
|
|
62
|
+
* and dark — so it lives here rather than in either theme. Keeping it in the
|
|
63
|
+
* token module is also what lets the conformance guard require that component
|
|
64
|
+
* code contains no colour literal at all.
|
|
65
|
+
*/
|
|
66
|
+
export declare const palette: {
|
|
67
|
+
default: string[];
|
|
68
|
+
/** The colour a picker starts on when the caller gives none. */
|
|
69
|
+
fallback: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Control sizes in points, for components whose dimension is not a radius.
|
|
73
|
+
*
|
|
74
|
+
* Rating's stars are the reason this exists: a star has a size and the size
|
|
75
|
+
* must come from the scale rather than from a literal in the component.
|
|
76
|
+
*/
|
|
77
|
+
export declare const controlSizes: {
|
|
78
|
+
star: {
|
|
79
|
+
sm: number;
|
|
80
|
+
md: number;
|
|
81
|
+
lg: number;
|
|
82
|
+
};
|
|
83
|
+
swatch: {
|
|
84
|
+
sm: number;
|
|
85
|
+
md: number;
|
|
86
|
+
lg: number;
|
|
87
|
+
};
|
|
88
|
+
picker: {
|
|
89
|
+
track: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Theme colours in the form React Native accepts.
|
|
94
|
+
*
|
|
95
|
+
* The shared tokens express colours as CSS colour strings (`rgb(r g b / a)`),
|
|
96
|
+
* which is right for the web package and rejected by React Native. The values
|
|
97
|
+
* below are the same colours written as `rgba(...)`/hex, sourced from the same
|
|
98
|
+
* token file, so the two platforms stay in step.
|
|
99
|
+
*/
|
|
25
100
|
export declare const colors: {
|
|
26
101
|
light: {
|
|
27
102
|
foreground: string;
|
|
@@ -29,8 +104,29 @@ export declare const colors: {
|
|
|
29
104
|
glass: string;
|
|
30
105
|
glassActive: string;
|
|
31
106
|
edge: string;
|
|
107
|
+
separator: string;
|
|
32
108
|
fill: string;
|
|
33
109
|
destructive: string;
|
|
110
|
+
on: string;
|
|
111
|
+
warning: string;
|
|
112
|
+
info: string;
|
|
113
|
+
scrim: string;
|
|
114
|
+
onTint: string;
|
|
115
|
+
skeleton: string;
|
|
116
|
+
/**
|
|
117
|
+
* The solid colour glass becomes when the user has asked the system to
|
|
118
|
+
* reduce transparency. Apple's rule is that a translucent surface is
|
|
119
|
+
* replaced by an opaque one, not merely tinted differently.
|
|
120
|
+
*/
|
|
121
|
+
glassSolid: string;
|
|
122
|
+
/**
|
|
123
|
+
* Neutral colours used by pickers and fields: the field's own wash, and
|
|
124
|
+
* the far end of a saturation gradient (the point of no saturation).
|
|
125
|
+
*/
|
|
126
|
+
fieldWash: string;
|
|
127
|
+
/** A flat neutral surface: incoming message bubbles, file chips. */
|
|
128
|
+
wash: string;
|
|
129
|
+
neutralTop: string;
|
|
34
130
|
axis: string;
|
|
35
131
|
};
|
|
36
132
|
dark: {
|
|
@@ -39,8 +135,26 @@ export declare const colors: {
|
|
|
39
135
|
glass: string;
|
|
40
136
|
glassActive: string;
|
|
41
137
|
edge: string;
|
|
138
|
+
separator: string;
|
|
42
139
|
fill: string;
|
|
43
140
|
destructive: string;
|
|
141
|
+
on: string;
|
|
142
|
+
warning: string;
|
|
143
|
+
info: string;
|
|
144
|
+
scrim: string;
|
|
145
|
+
onTint: string;
|
|
146
|
+
skeleton: string;
|
|
147
|
+
glassSolid: string;
|
|
148
|
+
fieldWash: string;
|
|
149
|
+
/** A flat neutral surface: incoming message bubbles, file chips. */
|
|
150
|
+
wash: string;
|
|
151
|
+
neutralTop: string;
|
|
44
152
|
axis: string;
|
|
45
153
|
};
|
|
46
154
|
};
|
|
155
|
+
/** Keeps the shared token file honest if a colour is added there first. */
|
|
156
|
+
export type ThemeColors = typeof colors.light;
|
|
157
|
+
/** The semantic tone of a feedback component (Banner, Toast). */
|
|
158
|
+
export type Tone = "info" | "success" | "warning" | "error";
|
|
159
|
+
/** Resolves a tone to its theme colour. */
|
|
160
|
+
export declare function toneColor(theme: ThemeColors, tone: Tone): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glacia-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Liquid Glass UI components for React Native — real iOS 26 glass, with a clean fallback on Android and older iOS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-native-svg": ">=13"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"glacia-tokens": "0.
|
|
30
|
+
"glacia-tokens": "0.5.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@testing-library/react": "^16.3.3",
|