glacia-native 0.3.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/lib/module/Bars.js +176 -0
  2. package/lib/module/Button.js +15 -2
  3. package/lib/module/Card.js +29 -14
  4. package/lib/module/Carousel.js +103 -0
  5. package/lib/module/Dialog.js +43 -32
  6. package/lib/module/Display.js +240 -0
  7. package/lib/module/Feedback.js +172 -0
  8. package/lib/module/Form.js +51 -12
  9. package/lib/module/Forms2.js +227 -0
  10. package/lib/module/Glass.js +11 -2
  11. package/lib/module/Input.js +19 -7
  12. package/lib/module/Overlays.js +166 -0
  13. package/lib/module/Pickers.js +243 -0
  14. package/lib/module/SegmentedControl.js +65 -21
  15. package/lib/module/Slider.js +121 -25
  16. package/lib/module/Switch.js +33 -15
  17. package/lib/module/TabBar.js +63 -25
  18. package/lib/module/Table.js +24 -6
  19. package/lib/module/Tabs.js +55 -33
  20. package/lib/module/Text.js +37 -0
  21. package/lib/module/ai.js +49 -20
  22. package/lib/module/charts/BarChart.js +4 -2
  23. package/lib/module/charts/FunnelChart.js +4 -2
  24. package/lib/module/charts/HeatmapChart.js +4 -2
  25. package/lib/module/charts/LineChart.js +4 -2
  26. package/lib/module/charts/PlotChart.js +11 -3
  27. package/lib/module/charts/RadarChart.js +4 -2
  28. package/lib/module/charts/RingChart.js +4 -2
  29. package/lib/module/charts/ScatterChart.js +20 -3
  30. package/lib/module/charts/WaterfallChart.js +12 -3
  31. package/lib/module/charts/advanced.js +12 -6
  32. package/lib/module/charts/extra.js +6 -3
  33. package/lib/module/index.js +58 -1
  34. package/lib/module/internal/GlassView.js +31 -17
  35. package/lib/module/internal/fallback.js +14 -3
  36. package/lib/module/internal/glass-routing.js +56 -0
  37. package/lib/module/internal/motion.js +55 -0
  38. package/lib/module/internal/primitives.js +413 -0
  39. package/lib/module/internal/tokens.js +55 -1
  40. package/lib/typescript/Bars.d.ts +121 -0
  41. package/lib/typescript/Button.d.ts +11 -1
  42. package/lib/typescript/Card.d.ts +20 -8
  43. package/lib/typescript/Carousel.d.ts +47 -0
  44. package/lib/typescript/Dialog.d.ts +19 -6
  45. package/lib/typescript/Display.d.ts +119 -0
  46. package/lib/typescript/Feedback.d.ts +138 -0
  47. package/lib/typescript/Form.d.ts +27 -11
  48. package/lib/typescript/Forms2.d.ts +128 -0
  49. package/lib/typescript/Glass.d.ts +10 -1
  50. package/lib/typescript/Input.d.ts +11 -1
  51. package/lib/typescript/Overlays.d.ts +105 -0
  52. package/lib/typescript/Pickers.d.ts +105 -0
  53. package/lib/typescript/SegmentedControl.d.ts +11 -1
  54. package/lib/typescript/Slider.d.ts +13 -1
  55. package/lib/typescript/Switch.d.ts +12 -1
  56. package/lib/typescript/TabBar.d.ts +13 -1
  57. package/lib/typescript/Table.d.ts +14 -5
  58. package/lib/typescript/Tabs.d.ts +8 -5
  59. package/lib/typescript/Text.d.ts +28 -0
  60. package/lib/typescript/ai.d.ts +12 -9
  61. package/lib/typescript/charts/BarChart.d.ts +1 -1
  62. package/lib/typescript/charts/FunnelChart.d.ts +1 -1
  63. package/lib/typescript/charts/HeatmapChart.d.ts +1 -1
  64. package/lib/typescript/charts/LineChart.d.ts +1 -1
  65. package/lib/typescript/charts/PlotChart.d.ts +1 -1
  66. package/lib/typescript/charts/RadarChart.d.ts +1 -1
  67. package/lib/typescript/charts/RingChart.d.ts +1 -1
  68. package/lib/typescript/charts/ScatterChart.d.ts +1 -1
  69. package/lib/typescript/charts/WaterfallChart.d.ts +1 -1
  70. package/lib/typescript/charts/advanced.d.ts +5 -5
  71. package/lib/typescript/charts/extra.d.ts +2 -2
  72. package/lib/typescript/index.d.ts +9 -1
  73. package/lib/typescript/internal/GlassView.d.ts +21 -4
  74. package/lib/typescript/internal/fallback.d.ts +10 -1
  75. package/lib/typescript/internal/glass-routing.d.ts +30 -0
  76. package/lib/typescript/internal/motion.d.ts +19 -0
  77. package/lib/typescript/internal/primitives.d.ts +41 -0
  78. package/lib/typescript/internal/tokens.d.ts +61 -0
  79. package/package.json +2 -2
  80. package/src/Bars.tsx +570 -0
  81. package/src/Button.tsx +47 -22
  82. package/src/Card.tsx +52 -31
  83. package/src/Carousel.tsx +233 -0
  84. package/src/Dialog.tsx +99 -64
  85. package/src/Display.tsx +550 -0
  86. package/src/Feedback.tsx +579 -0
  87. package/src/Form.tsx +90 -25
  88. package/src/Forms2.tsx +608 -0
  89. package/src/Glass.tsx +24 -1
  90. package/src/Input.tsx +33 -12
  91. package/src/Overlays.tsx +474 -0
  92. package/src/Pickers.tsx +590 -0
  93. package/src/SegmentedControl.tsx +104 -32
  94. package/src/Slider.tsx +151 -47
  95. package/src/Switch.tsx +56 -32
  96. package/src/TabBar.tsx +100 -30
  97. package/src/Table.tsx +38 -14
  98. package/src/Tabs.tsx +85 -32
  99. package/src/Text.tsx +83 -0
  100. package/src/ai.tsx +77 -31
  101. package/src/charts/BarChart.tsx +4 -2
  102. package/src/charts/FunnelChart.tsx +4 -2
  103. package/src/charts/HeatmapChart.tsx +4 -2
  104. package/src/charts/LineChart.tsx +4 -2
  105. package/src/charts/PlotChart.tsx +23 -3
  106. package/src/charts/RadarChart.tsx +4 -2
  107. package/src/charts/RingChart.tsx +4 -2
  108. package/src/charts/ScatterChart.tsx +24 -3
  109. package/src/charts/WaterfallChart.tsx +21 -3
  110. package/src/charts/advanced.tsx +12 -6
  111. package/src/charts/extra.tsx +6 -3
  112. package/src/index.ts +101 -1
  113. package/src/internal/GlassView.tsx +51 -19
  114. package/src/internal/fallback.tsx +23 -8
  115. package/src/internal/glass-routing.ts +68 -0
  116. package/src/internal/motion.ts +60 -0
  117. package/src/internal/primitives.ts +482 -0
  118. package/src/internal/tokens.ts +62 -0
  119. package/lib/module/charts/primitives.js +0 -212
  120. package/lib/typescript/charts/primitives.d.ts +0 -23
  121. package/src/charts/primitives.ts +0 -262
@@ -1,31 +1,43 @@
1
1
  import { type ReactNode } from "react";
2
+ import type { StyleProp, TextStyle, ViewStyle } from "react-native";
2
3
  export interface CardProps {
3
4
  effect?: "clear" | "regular" | "none";
4
- style?: any;
5
+ style?: StyleProp<ViewStyle>;
5
6
  children?: ReactNode;
6
7
  isDark?: boolean;
8
+ /** Passed through to the card's glass so it is testable. */
9
+ testID?: string;
7
10
  }
11
+ /**
12
+ * A content panel on Glacia's glass: Apple's material on iOS 26+, Glacia's
13
+ * tint elsewhere. The padding, radius and stacking are ours on every platform.
14
+ */
8
15
  export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<any>>;
16
+ /** The block holding a card's title and description. */
9
17
  export declare function CardHeader({ style, children, ...props }: {
10
- style?: any;
18
+ style?: StyleProp<ViewStyle>;
11
19
  children?: ReactNode;
12
20
  }): import("react").JSX.Element;
13
- export declare function CardTitle({ style, children, isDark, ...props }: {
14
- style?: any;
21
+ /** A card's heading, announced as a heading by screen readers. */
22
+ export declare function CardTitle({ style, children, isDark: isDarkProp, ...props }: {
23
+ style?: StyleProp<TextStyle>;
15
24
  children?: ReactNode;
16
25
  isDark?: boolean;
17
26
  }): import("react").JSX.Element;
18
- export declare function CardDescription({ style, children, isDark, ...props }: {
19
- style?: any;
27
+ /** Supporting text under a card's title. */
28
+ export declare function CardDescription({ style, children, isDark: isDarkProp, ...props }: {
29
+ style?: StyleProp<TextStyle>;
20
30
  children?: ReactNode;
21
31
  isDark?: boolean;
22
32
  }): import("react").JSX.Element;
33
+ /** The card's body. */
23
34
  export declare function CardContent({ style, children, ...props }: {
24
- style?: any;
35
+ style?: StyleProp<ViewStyle>;
25
36
  children?: ReactNode;
26
37
  }): import("react").JSX.Element;
27
38
  export declare const CardBody: typeof CardContent;
39
+ /** The card's action row. */
28
40
  export declare function CardFooter({ style, children, ...props }: {
29
- style?: any;
41
+ style?: StyleProp<ViewStyle>;
30
42
  children?: ReactNode;
31
43
  }): import("react").JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ export interface CarouselProps {
4
+ /** One node per page. */
5
+ slides: ReactNode[];
6
+ /** Controlled page. Omit and the carousel tracks itself. */
7
+ index?: number;
8
+ defaultIndex?: number;
9
+ /** Fires when a swipe settles on a new page. */
10
+ onIndexChange?: (index: number) => void;
11
+ /** Gap between pages, so neighbours peek at the edges. */
12
+ gap?: number;
13
+ style?: StyleProp<ViewStyle>;
14
+ isDark?: boolean;
15
+ testID?: string;
16
+ }
17
+ /**
18
+ * A horizontally paging swiper.
19
+ *
20
+ * It rides the resolver's ScrollView with `pagingEnabled`, so the paging feel is
21
+ * the platform's own and the pages are plain content the caller supplies. The
22
+ * active page is derived from the scroll offset, which is also what reports
23
+ * `onIndexChange`.
24
+ */
25
+ export declare const Carousel: import("react").ForwardRefExoticComponent<CarouselProps & import("react").RefAttributes<any>>;
26
+ export interface PageControlProps {
27
+ count: number;
28
+ /** Controlled active page. Omit and the control keeps its own. */
29
+ activeIndex?: number;
30
+ defaultActiveIndex?: number;
31
+ /** Called when a dot is tapped. */
32
+ onChange?: (index: number) => void;
33
+ /** Tint the active dot; defaults to the theme accent. */
34
+ tint?: string;
35
+ /** Hide the dots when there is only one page. */
36
+ hidesForSinglePage?: boolean;
37
+ style?: StyleProp<ViewStyle>;
38
+ isDark?: boolean;
39
+ testID?: string;
40
+ }
41
+ /**
42
+ * The page dots.
43
+ *
44
+ * The active dot elongates and the others stay narrow, which is how iOS reads
45
+ * "you are here". The width change runs on the springs token through Animated.
46
+ */
47
+ export declare const PageControl: import("react").ForwardRefExoticComponent<PageControlProps & import("react").RefAttributes<any>>;
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
2
3
  export interface DialogProps {
3
- /** Controlled visibility. Omit to use `trigger` and uncontrolled state. */
4
+ /** Controlled visibility. Omit it and the dialog keeps its own state. */
4
5
  open?: boolean;
5
6
  onOpenChange?: (open: boolean) => void;
6
7
  title?: string;
@@ -10,17 +11,25 @@ export interface DialogProps {
10
11
  /** Tapping the backdrop dismisses. Off for destructive confirmations. */
11
12
  dismissOnBackdropPress?: boolean;
12
13
  isDark?: boolean;
13
- style?: any;
14
+ style?: StyleProp<ViewStyle>;
15
+ /** Passed through to the dialog panel so it is testable. */
16
+ testID?: string;
14
17
  }
15
18
  /**
16
- * A centred modal surface above a dimmed backdrop.
19
+ * A centred modal panel above a dimmed backdrop.
20
+ *
21
+ * The panel is a glass surface, so it is Apple's real Liquid Glass on iOS 26+
22
+ * and Glacia's translucent tint elsewhere; the text sits on it with the
23
+ * theme's foreground colour, so contrast holds either way.
17
24
  *
18
25
  * React Native has no built-in focus trap, so this component covers what the
19
26
  * platform can actually do: `Modal` blocks touches behind it, Android's back
20
27
  * button routes to `onOpenChange(false)`, and the heading is marked as such so
21
28
  * screen readers announce the dialog as it appears.
29
+ *
30
+ * To open a dialog from a button, use `DialogTrigger`.
22
31
  */
23
- export declare function Dialog({ open: controlledOpen, onOpenChange, title, description, children, footer, dismissOnBackdropPress, isDark, style, }: DialogProps): import("react").JSX.Element;
32
+ export declare function Dialog({ open: controlledOpen, onOpenChange, title, description, children, footer, dismissOnBackdropPress, isDark: isDarkProp, style, testID, }: DialogProps): import("react").JSX.Element;
24
33
  /** Opens the dialog without the caller tracking state. */
25
34
  export declare function DialogTrigger({ label, children, ...dialogProps }: Omit<DialogProps, "open" | "onOpenChange"> & {
26
35
  label: string;
@@ -38,6 +47,8 @@ export interface AlertDialogProps {
38
47
  onConfirm?: () => void;
39
48
  onCancel?: () => void;
40
49
  isDark?: boolean;
50
+ /** Passed through to the dialog panel so it is testable. */
51
+ testID?: string;
41
52
  }
42
53
  /**
43
54
  * A dialog that asks for confirmation.
@@ -46,7 +57,7 @@ export interface AlertDialogProps {
46
57
  * should require a real answer, so the only ways out are the two buttons or the
47
58
  * Android back button, which counts as cancel.
48
59
  */
49
- export declare function AlertDialog({ open: controlledOpen, onOpenChange, title, description, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, isDark, }: AlertDialogProps): import("react").JSX.Element;
60
+ export declare function AlertDialog({ open: controlledOpen, onOpenChange, title, description, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, isDark: isDarkProp, testID, }: AlertDialogProps): import("react").JSX.Element;
50
61
  export interface ActionSheetOption {
51
62
  label: string;
52
63
  /** Tints the row destructive, for delete actions. */
@@ -61,6 +72,8 @@ export interface ActionSheetProps {
61
72
  options: ActionSheetOption[];
62
73
  cancelLabel?: string;
63
74
  isDark?: boolean;
75
+ /** Passed through to the sheet so it is testable. */
76
+ testID?: string;
64
77
  }
65
78
  /**
66
79
  * A list of choices attached to the bottom of the screen.
@@ -68,4 +81,4 @@ export interface ActionSheetProps {
68
81
  * Anchored to the bottom because that is where a thumb reaches, and it keeps a
69
82
  * separate Cancel row so a mis-tap is always reversible.
70
83
  */
71
- export declare function ActionSheet({ open: controlledOpen, onOpenChange, title, message, options, cancelLabel, isDark, }: ActionSheetProps): import("react").JSX.Element;
84
+ export declare function ActionSheet({ open: controlledOpen, onOpenChange, title, message, options, cancelLabel, isDark: isDarkProp, testID, }: ActionSheetProps): import("react").JSX.Element;
@@ -0,0 +1,119 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ export type AvatarSize = "sm" | "md" | "lg";
4
+ export interface AvatarProps {
5
+ /** Image to show. When absent, or when it fails to load, initials render. */
6
+ source?: {
7
+ uri: string;
8
+ } | number;
9
+ /** The person's name: initials are derived from it when no image loads. */
10
+ name?: string;
11
+ size?: AvatarSize;
12
+ /** Draws a status dot in the corner. */
13
+ status?: "online" | "offline" | "busy";
14
+ style?: StyleProp<ViewStyle>;
15
+ isDark?: boolean;
16
+ testID?: string;
17
+ }
18
+ /** First letters of the first and last word, as an avatar fallback. */
19
+ export declare function initialsOf(name: string): string;
20
+ /**
21
+ * A person or entity: their picture, or their initials when there is none.
22
+ *
23
+ * The frame is Glacia's glass so it belongs to the same family as the rest of
24
+ * the library; the initials sit on it in the theme's foreground colour.
25
+ */
26
+ export declare const Avatar: import("react").ForwardRefExoticComponent<AvatarProps & import("react").RefAttributes<any>>;
27
+ export interface BadgeProps {
28
+ /** The count or short label. Omit to render a plain dot. */
29
+ children?: ReactNode;
30
+ /** Draws the badge in the destructive tone (unread, errors). */
31
+ tone?: "fill" | "destructive" | "success" | "muted";
32
+ /** The element to overlay. Supplying it puts the badge in the corner. */
33
+ overlay?: ReactNode;
34
+ style?: StyleProp<ViewStyle>;
35
+ isDark?: boolean;
36
+ testID?: string;
37
+ }
38
+ /**
39
+ * A small count or dot.
40
+ *
41
+ * Deliberately not glass: a badge is a micro-element, and a translucent 16pt
42
+ * chip loses its contrast against whatever it sits on. It uses the solid theme
43
+ * tint instead, which is what makes it legible in both themes.
44
+ */
45
+ export declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<any>>;
46
+ export interface SeparatorProps {
47
+ orientation?: "horizontal" | "vertical";
48
+ /** Inset from the leading edge, matching a list row's leading accessory. */
49
+ inset?: number;
50
+ style?: StyleProp<ViewStyle>;
51
+ isDark?: boolean;
52
+ testID?: string;
53
+ }
54
+ /**
55
+ * A hairline divider in the theme's separator colour.
56
+ *
57
+ * A plain View rather than a Glass: a 1pt rule is not a surface, and glass on
58
+ * a line has nothing to refract.
59
+ */
60
+ export declare const Separator: import("react").ForwardRefExoticComponent<SeparatorProps & import("react").RefAttributes<any>>;
61
+ export interface SkeletonProps {
62
+ /** Rectangles for cards and rows, circles for avatars, lines for a run of text. */
63
+ shape?: "rect" | "circle" | "line";
64
+ width?: number | string;
65
+ height?: number;
66
+ style?: StyleProp<ViewStyle>;
67
+ isDark?: boolean;
68
+ testID?: string;
69
+ }
70
+ /**
71
+ * A loading placeholder.
72
+ *
73
+ * The pulse is opacity only and slow, on the gentle spring, so it reads as
74
+ * "loading" without motion that could bother someone sensitive to movement.
75
+ * Nothing about it is essential to understanding the screen, so it is hidden
76
+ * from screen readers rather than announced.
77
+ */
78
+ export declare const Skeleton: import("react").ForwardRefExoticComponent<SkeletonProps & import("react").RefAttributes<any>>;
79
+ export type SpinnerSize = "sm" | "md" | "lg";
80
+ export interface SpinnerProps {
81
+ size?: SpinnerSize;
82
+ /** Spinner colour; defaults to the theme's muted foreground. */
83
+ tint?: string;
84
+ /** Announced to screen readers, since a spinner alone has no text. */
85
+ accessibilityLabel?: string;
86
+ style?: StyleProp<ViewStyle>;
87
+ isDark?: boolean;
88
+ testID?: string;
89
+ }
90
+ /**
91
+ * A loading spinner, drawn by Glacia.
92
+ *
93
+ * An SVG arc that rotates on the gentle spring through Animated — not the
94
+ * platform's ActivityIndicator, so it looks the same on every platform and
95
+ * wears the theme's colour instead of inheriting the system tint.
96
+ */
97
+ export declare const Spinner: import("react").ForwardRefExoticComponent<SpinnerProps & import("react").RefAttributes<any>>;
98
+ export type ProgressVariant = "bar" | "ring";
99
+ export interface ProgressProps {
100
+ /** 0–100. Values outside the range are clamped rather than drawn wrong. */
101
+ value: number;
102
+ variant?: ProgressVariant;
103
+ /** Overrides the fill colour; defaults to the theme accent. */
104
+ tint?: string;
105
+ /** Announced by screen readers, e.g. "Uploading photo". */
106
+ accessibilityLabel?: string;
107
+ style?: StyleProp<ViewStyle>;
108
+ isDark?: boolean;
109
+ testID?: string;
110
+ }
111
+ /**
112
+ * Progress, linear or circular.
113
+ *
114
+ * The track is a glass surface, so it refracts what it sits on exactly like the
115
+ * rest of the library; the fill is the theme accent. Both forms report
116
+ * `progressbar` with a value, which is the contract NativeTask relies on
117
+ * internally — this component generalises it.
118
+ */
119
+ export declare const Progress: import("react").ForwardRefExoticComponent<ProgressProps & import("react").RefAttributes<any>>;
@@ -0,0 +1,138 @@
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
+ export interface BannerProps {
37
+ title?: string;
38
+ message: string;
39
+ tone?: Tone;
40
+ /** A leading icon node. */
41
+ icon?: ReactNode;
42
+ /** Shows a dismiss button when provided. */
43
+ onDismiss?: () => void;
44
+ /** A single inline action, e.g. Retry. */
45
+ action?: ToastAction;
46
+ style?: StyleProp<ViewStyle>;
47
+ isDark?: boolean;
48
+ testID?: string;
49
+ }
50
+ /**
51
+ * An inline alert.
52
+ *
53
+ * Unlike AlertDialog it is not modal and not an overlay: it sits in the layout
54
+ * and pushes the content below it down. The surface is glass with the tone's
55
+ * colour as its edge, so the tone reads at a glance without turning the whole
56
+ * panel into a solid block of colour.
57
+ */
58
+ export declare const Banner: import("react").ForwardRefExoticComponent<BannerProps & import("react").RefAttributes<any>>;
59
+ export interface ListItemProps {
60
+ /** An avatar, icon or other leading node. */
61
+ leading?: ReactNode;
62
+ /** The row's main text. */
63
+ title: string;
64
+ /** Secondary line under the title. */
65
+ description?: string;
66
+ /** A value text, a control, or any trailing node. */
67
+ trailing?: ReactNode;
68
+ /** Draws a chevron when the row is tappable and nothing else trails it. */
69
+ chevron?: boolean;
70
+ onPress?: () => void;
71
+ disabled?: boolean;
72
+ selected?: boolean;
73
+ style?: StyleProp<ViewStyle>;
74
+ isDark?: boolean;
75
+ testID?: string;
76
+ }
77
+ /**
78
+ * One row of a List.
79
+ *
80
+ * The row is a Pressable when it has an `onPress`, and inert otherwise, which
81
+ * is what the platform expects: a row that does nothing should not announce
82
+ * itself as a button. The chevron is decoration and is hidden from screen
83
+ * readers, since the row's own role already says it is tappable.
84
+ */
85
+ export declare const ListItem: import("react").ForwardRefExoticComponent<ListItemProps & import("react").RefAttributes<any>>;
86
+ export interface ListProps {
87
+ children?: ReactNode;
88
+ /** Renders the rows on one glass panel with separators between them. */
89
+ inset?: boolean;
90
+ style?: StyleProp<ViewStyle>;
91
+ isDark?: boolean;
92
+ testID?: string;
93
+ }
94
+ /**
95
+ * A grouped list of rows — the backbone of settings and profile screens.
96
+ *
97
+ * With `inset`, the rows sit on one glass panel with hairline separators, which
98
+ * is the shape iOS settings screens use. The separators are drawn by the
99
+ * caller's ListItem spacing rather than by nesting glass inside glass.
100
+ */
101
+ export declare const List: import("react").ForwardRefExoticComponent<ListProps & import("react").RefAttributes<any>>;
102
+ /** A titled group of rows, e.g. "Account" above its settings. */
103
+ export interface ListSectionProps {
104
+ header?: string;
105
+ children?: ReactNode;
106
+ style?: StyleProp<ViewStyle>;
107
+ isDark?: boolean;
108
+ testID?: string;
109
+ }
110
+ export declare const ListSection: import("react").ForwardRefExoticComponent<ListSectionProps & import("react").RefAttributes<any>>;
111
+ export interface AccordionSection {
112
+ /** Stable identity for the section. */
113
+ value: string;
114
+ title: string;
115
+ /** Optional second line in the header. */
116
+ description?: string;
117
+ content: ReactNode;
118
+ }
119
+ export interface AccordionProps {
120
+ sections: AccordionSection[];
121
+ /** Allow several sections open at once. */
122
+ multiple?: boolean;
123
+ /** Controlled open sections. Omit for uncontrolled. */
124
+ openSections?: string[];
125
+ defaultOpenSections?: string[];
126
+ onOpenSectionsChange?: (open: string[]) => void;
127
+ style?: StyleProp<ViewStyle>;
128
+ isDark?: boolean;
129
+ testID?: string;
130
+ }
131
+ /**
132
+ * Expandable sections.
133
+ *
134
+ * The header is a Pressable reporting `expanded`; the panel is measured with
135
+ * the height the content reports and animated on the springs token, so the
136
+ * reveal is a real transition rather than an instant jump.
137
+ */
138
+ export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<any>>;
@@ -1,13 +1,17 @@
1
1
  import { type ReactNode } from "react";
2
+ import type { StyleProp, TextStyle, ViewStyle } from "react-native";
2
3
  export interface LabelProps {
3
4
  children?: ReactNode;
4
5
  /** Marks the field required with a visible asterisk. */
5
6
  required?: boolean;
6
7
  disabled?: boolean;
7
- /** Ties the label to the control for screen readers. */
8
- htmlFor?: string;
8
+ /**
9
+ * The id of the control this label describes. Same meaning and prop name as
10
+ * React Native's `nativeID`.
11
+ */
12
+ nativeID?: string;
9
13
  isDark?: boolean;
10
- style?: any;
14
+ style?: StyleProp<TextStyle>;
11
15
  }
12
16
  /** The text above a control. */
13
17
  export declare const Label: import("react").ForwardRefExoticComponent<LabelProps & import("react").RefAttributes<any>>;
@@ -21,25 +25,29 @@ export interface FieldProps {
21
25
  disabled?: boolean;
22
26
  isDark?: boolean;
23
27
  children?: ReactNode;
24
- style?: any;
28
+ style?: StyleProp<ViewStyle>;
25
29
  }
26
30
  /**
27
31
  * Label, control and message stacked in the order assistive tech announces
28
32
  * them, so a caller never has to place these three by hand.
29
33
  */
30
- export declare function Field({ label, description, error, required, disabled, isDark, children, style, }: FieldProps): import("react").JSX.Element;
34
+ export declare function Field({ label, description, error, required, disabled, isDark: isDarkProp, children, style, }: FieldProps): import("react").JSX.Element;
31
35
  export interface CheckboxProps {
32
36
  checked?: boolean;
37
+ /** Starting state for uncontrolled use. */
38
+ defaultChecked?: boolean;
33
39
  onCheckedChange?: (checked: boolean) => void;
34
40
  label?: string;
35
41
  description?: string;
36
42
  indeterminate?: boolean;
37
43
  disabled?: boolean;
38
44
  isDark?: boolean;
39
- style?: any;
45
+ style?: StyleProp<ViewStyle>;
46
+ /** Passed through to the pressable row so it is testable. */
47
+ testID?: string;
40
48
  }
41
49
  /** A tick box for a single boolean, with an optional label and description. */
42
- export declare function Checkbox({ checked, onCheckedChange, label, description, indeterminate, disabled, isDark, style, }: CheckboxProps): import("react").JSX.Element;
50
+ export declare function Checkbox({ checked: checkedProp, defaultChecked, onCheckedChange, label, description, indeterminate, disabled, isDark: isDarkProp, style, testID, }: CheckboxProps): import("react").JSX.Element;
43
51
  export interface RadioOption {
44
52
  value: string;
45
53
  label: string;
@@ -48,28 +56,36 @@ export interface RadioOption {
48
56
  }
49
57
  export interface RadioGroupProps {
50
58
  value?: string;
59
+ /** Starting selection for uncontrolled use. */
60
+ defaultValue?: string;
51
61
  onValueChange?: (value: string) => void;
52
62
  options: RadioOption[];
53
63
  /** Lay the options out in a row instead of a column. */
54
64
  horizontal?: boolean;
55
65
  disabled?: boolean;
56
66
  isDark?: boolean;
57
- style?: any;
67
+ style?: StyleProp<ViewStyle>;
68
+ /** Passed through to the group so it is testable. */
69
+ testID?: string;
58
70
  }
59
71
  /** One choice from a small, always-visible set. */
60
- export declare function RadioGroup({ value, onValueChange, options, horizontal, disabled, isDark, style, }: RadioGroupProps): import("react").JSX.Element;
72
+ export declare function RadioGroup({ value: valueProp, defaultValue, onValueChange, options, horizontal, disabled, isDark: isDarkProp, style, testID, }: RadioGroupProps): import("react").JSX.Element;
61
73
  export interface SelectOption {
62
74
  value: string;
63
75
  label: string;
64
76
  }
65
77
  export interface SelectProps {
66
78
  value?: string;
79
+ /** Starting selection for uncontrolled use. */
80
+ defaultValue?: string;
67
81
  onValueChange?: (value: string) => void;
68
82
  options: SelectOption[];
69
83
  placeholder?: string;
70
84
  disabled?: boolean;
71
85
  isDark?: boolean;
72
- style?: any;
86
+ style?: StyleProp<ViewStyle>;
87
+ /** Passed through to the trigger so it is testable. */
88
+ testID?: string;
73
89
  }
74
90
  /**
75
91
  * A dropdown of mutually exclusive options.
@@ -78,4 +94,4 @@ export interface SelectProps {
78
94
  * list opens inline: predictable across platforms and reachable without a
79
95
  * modal. A long list scrolls naturally with the page.
80
96
  */
81
- export declare function Select({ value, onValueChange, options, placeholder, disabled, isDark, style, }: SelectProps): import("react").JSX.Element;
97
+ export declare function Select({ value: valueProp, defaultValue, onValueChange, options, placeholder, disabled, isDark: isDarkProp, style, testID, }: SelectProps): import("react").JSX.Element;
@@ -0,0 +1,128 @@
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>>;
@@ -1,5 +1,14 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
1
2
  import { type NativeGlassProps } from "./internal/GlassView";
2
3
  export interface GlassProps extends NativeGlassProps {
3
4
  testID?: string;
5
+ style?: StyleProp<ViewStyle>;
4
6
  }
5
- export declare const Glass: import("react").ForwardRefExoticComponent<GlassProps & import("react").RefAttributes<any>>;
7
+ /**
8
+ * A glass surface.
9
+ *
10
+ * Routes through the package's single switch: Apple's real `UIGlassEffect` on
11
+ * iOS 26+, Glacia's translucent fallback of identical shape on older iOS and
12
+ * Android. `testID` is passed to whichever surface renders.
13
+ */
14
+ export declare const Glass: import("react").ForwardRefExoticComponent<Omit<GlassProps, "ref"> & import("react").RefAttributes<any>>;