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,4 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
2
3
  export interface InputProps {
3
4
  value?: string;
4
5
  onChangeText?: (text: string) => void;
@@ -17,10 +18,14 @@ export interface InputProps {
17
18
  accessibilityLabel?: string;
18
19
  returnKeyType?: "done" | "next" | "go" | "search" | "send";
19
20
  onSubmitEditing?: () => void;
21
+ /** Starting text for uncontrolled use, like React Native's `defaultValue`. */
22
+ defaultValue?: string;
20
23
  prefix?: ReactNode;
21
24
  suffix?: ReactNode;
22
25
  isDark?: boolean;
23
- style?: any;
26
+ style?: StyleProp<ViewStyle>;
27
+ /** Passed through to the text field so it is testable. */
28
+ testID?: string;
24
29
  maxLength?: number;
25
30
  editable?: boolean;
26
31
  onFocus?: () => void;
@@ -32,6 +37,11 @@ export interface InputProps {
32
37
  * The native TextInput has no placeholder styling prop, so the placeholder is
33
38
  * drawn as a sibling Text: that keeps its colour tied to the theme instead of
34
39
  * the OS default, which changes between iOS versions.
40
+ *
41
+ * The field works controlled (`value` + `onChangeText`) or uncontrolled (no
42
+ * `value` prop). In uncontrolled use it tracks its own text so the themed
43
+ * placeholder disappears as soon as the user types; without that state the
44
+ * overlay would sit on top of the typed text until the parent re-rendered.
35
45
  */
36
46
  export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<any>>;
37
47
  export interface TextareaProps extends Omit<InputProps, "size" | "multiline" | "minLines"> {
@@ -0,0 +1,105 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ /**
4
+ * Keeps a popover inside the window.
5
+ *
6
+ * Called with the trigger's measured frame and the popover's own size; returns
7
+ * the offsets that bring it back on screen. A menu near the bottom edge flips
8
+ * above its trigger rather than hanging off the display.
9
+ */
10
+ export declare function anchorPopover(trigger: {
11
+ x: number;
12
+ y: number;
13
+ width: number;
14
+ height: number;
15
+ }, popover: {
16
+ width: number;
17
+ height: number;
18
+ }, viewport: {
19
+ width: number;
20
+ height: number;
21
+ }, gap?: number): {
22
+ left: number;
23
+ top: number;
24
+ flipped: boolean;
25
+ };
26
+ export interface MenuItem {
27
+ label: string;
28
+ onPress: () => void;
29
+ icon?: ReactNode;
30
+ disabled?: boolean;
31
+ /** Renders in the destructive tone, for delete-and-similar. */
32
+ destructive?: boolean;
33
+ accessibilityLabel?: string;
34
+ }
35
+ export interface MenuProps {
36
+ /** The control that opens the menu. */
37
+ trigger: ReactNode;
38
+ items: MenuItem[];
39
+ /** Controlled open state. Omit and the menu keeps its own. */
40
+ open?: boolean;
41
+ onOpenChange?: (open: boolean) => void;
42
+ /** The menu's width. The list scrolls if the items exceed the screen. */
43
+ width?: number;
44
+ accessibilityLabel?: string;
45
+ style?: StyleProp<ViewStyle>;
46
+ isDark?: boolean;
47
+ testID?: string;
48
+ }
49
+ /**
50
+ * An anchored dropdown menu.
51
+ *
52
+ * A press outside or on an item closes it; Android's back button does too. The
53
+ * popover is a glass surface with `glassActive` rows, matching the way the
54
+ * library marks a tappable row rather than nesting another glass panel.
55
+ */
56
+ export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<any>>;
57
+ export interface SheetProps {
58
+ /** Controlled visibility. Omit and the sheet keeps its own. */
59
+ open?: boolean;
60
+ defaultOpen?: boolean;
61
+ onOpenChange?: (open: boolean) => void;
62
+ title?: string;
63
+ children?: ReactNode;
64
+ footer?: ReactNode;
65
+ /** Tapping the scrim dismisses. */
66
+ dismissOnBackdropPress?: boolean;
67
+ /** The drag handle at the top of the panel. */
68
+ showHandle?: boolean;
69
+ style?: StyleProp<ViewStyle>;
70
+ isDark?: boolean;
71
+ testID?: string;
72
+ }
73
+ /**
74
+ * A bottom sheet.
75
+ *
76
+ * The general-purpose container: it slides up on the springs token, dismisses
77
+ * on a scrim press and on Android back. ActionSheet remains the action-menu
78
+ * specialisation of this shape; Sheet is for arbitrary content — a form, a
79
+ * calendar, a detail panel.
80
+ */
81
+ export declare const Sheet: import("react").ForwardRefExoticComponent<SheetProps & import("react").RefAttributes<any>>;
82
+ export interface DrawerProps {
83
+ /** Controlled visibility. Omit and the drawer keeps its own. */
84
+ open?: boolean;
85
+ defaultOpen?: boolean;
86
+ onOpenChange?: (open: boolean) => void;
87
+ /** The edge the panel slides in from. */
88
+ side?: "left" | "right";
89
+ /** Panel width. */
90
+ width?: number;
91
+ children?: ReactNode;
92
+ /** Tapping the scrim dismisses. */
93
+ dismissOnBackdropPress?: boolean;
94
+ style?: StyleProp<ViewStyle>;
95
+ isDark?: boolean;
96
+ testID?: string;
97
+ }
98
+ /**
99
+ * A side navigation drawer.
100
+ *
101
+ * The same overlay discipline as Sheet — scrim, spring slide, Android back —
102
+ * but anchored to a side edge, with a square panel that runs the full height.
103
+ * The caller supplies the content, typically a List.
104
+ */
105
+ export declare const Drawer: import("react").ForwardRefExoticComponent<DrawerProps & import("react").RefAttributes<any>>;
@@ -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>>;
@@ -1,9 +1,19 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
1
2
  export interface SegmentedControlProps {
2
3
  values: string[];
3
4
  selectedIndex?: number;
4
5
  defaultIndex?: number;
5
6
  onValueChange?: (value: string, index: number) => void;
6
- style?: any;
7
+ style?: StyleProp<ViewStyle>;
7
8
  isDark?: boolean;
9
+ /** Passed through to the control so it is testable. */
10
+ testID?: string;
8
11
  }
12
+ /**
13
+ * A row of mutually exclusive segments on one glass container.
14
+ *
15
+ * The selected segment is marked by a pill that slides on the springs token.
16
+ * The pill's colours come from the theme tokens, so it reads correctly in both
17
+ * light and dark instead of assuming a white-on-light palette.
18
+ */
9
19
  export declare const SegmentedControl: import("react").ForwardRefExoticComponent<SegmentedControlProps & import("react").RefAttributes<any>>;
@@ -1,3 +1,4 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
1
2
  export interface SliderProps {
2
3
  value?: number;
3
4
  defaultValue?: number;
@@ -7,7 +8,18 @@ export interface SliderProps {
7
8
  onValueChange?: (value: number) => void;
8
9
  disabled?: boolean;
9
10
  accessibilityLabel: string;
10
- style?: any;
11
+ style?: StyleProp<ViewStyle>;
11
12
  isDark?: boolean;
13
+ /** Passed through to the draggable track so it is testable. */
14
+ testID?: string;
12
15
  }
16
+ /**
17
+ * A continuous value chosen by dragging.
18
+ *
19
+ * The interaction is Glacia's own: the track and thumb are Views and dragging
20
+ * is a PanResponder reading the touch position against the track's measured
21
+ * width. React Native has no DOM `<input type="range">` and the platform
22
+ * sliders are not used, so the control looks and behaves the same on every
23
+ * platform; only the glass material changes.
24
+ */
13
25
  export declare const Slider: import("react").ForwardRefExoticComponent<SliderProps & import("react").RefAttributes<any>>;
@@ -1,10 +1,21 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
1
2
  export interface SwitchProps {
2
3
  checked?: boolean;
3
4
  defaultChecked?: boolean;
4
5
  onCheckedChange?: (checked: boolean) => void;
5
6
  disabled?: boolean;
6
7
  accessibilityLabel: string;
7
- style?: any;
8
+ style?: StyleProp<ViewStyle>;
8
9
  isDark?: boolean;
10
+ /** Passed through to the switch track so it is testable. */
11
+ testID?: string;
9
12
  }
13
+ /**
14
+ * An on/off switch.
15
+ *
16
+ * The track is Glacia's glass; the thumb is one of our own Views, animated on
17
+ * the springs token. The material changes by platform (Apple's glass on
18
+ * iOS 26+, Glacia's tint elsewhere) but the control is always ours — React
19
+ * Native's built-in Switch is never used.
20
+ */
10
21
  export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<any>>;
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
2
3
  export interface TabBarItem {
3
4
  id: string;
4
5
  label: string;
@@ -9,7 +10,18 @@ export interface TabBarProps {
9
10
  activeId?: string;
10
11
  defaultActiveId?: string;
11
12
  onTabChange?: (id: string) => void;
12
- style?: any;
13
+ style?: StyleProp<ViewStyle>;
13
14
  isDark?: boolean;
15
+ /** Passed through to the bar so it is testable. */
16
+ testID?: string;
14
17
  }
18
+ /**
19
+ * The bottom bar of an app: a row of tabs on one glass surface.
20
+ *
21
+ * The platform rule is the point of this component. On iOS 26+ the surface is
22
+ * Apple's real Liquid Glass (`UIGlassEffect` via `@callstack/liquid-glass`)
23
+ * with Glacia's own items inside it; on older iOS and on Android it is
24
+ * Glacia's bar. The items are always our Pressables and Texts — no native tab
25
+ * bar is used on any platform.
26
+ */
15
27
  export declare const TabBar: import("react").ForwardRefExoticComponent<TabBarProps & import("react").RefAttributes<any>>;
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
2
3
  export interface NativeTableColumn {
3
4
  key: string;
4
5
  header: string;
@@ -12,17 +13,25 @@ export interface NativeTableColumn {
12
13
  export interface NativeTableRow {
13
14
  id: string;
14
15
  cells: Record<string, ReactNode>;
16
+ /**
17
+ * What screen readers announce when the row is pressable. Use it when the
18
+ * cells hold elements rather than text; without it the primary cell is used
19
+ * only if it is a string or number.
20
+ */
21
+ accessibilityLabel?: string;
15
22
  }
16
23
  export interface NativeTableProps {
17
24
  columns: NativeTableColumn[];
18
25
  rows: NativeTableRow[];
19
26
  /** Tap handler for a whole row. */
20
27
  onRowPress?: (row: NativeTableRow) => void;
21
- /** Text direction for right-aligned columns; defaults to left. */
28
+ /** A caption describing the table's contents, shown above it. */
22
29
  caption?: string;
23
30
  isDark?: boolean;
24
- style?: any;
31
+ style?: StyleProp<ViewStyle>;
25
32
  emptyMessage?: string;
33
+ /** Passed through to the table root so it is testable. */
34
+ testID?: string;
26
35
  }
27
36
  /**
28
37
  * Tabular data laid out for a phone.
@@ -32,7 +41,7 @@ export interface NativeTableProps {
32
41
  * are laid out as labelled pairs beneath it, which keeps every value readable
33
42
  * without horizontal scrolling.
34
43
  */
35
- export declare function NativeTable({ columns, rows, onRowPress, caption, isDark, style, emptyMessage, }: NativeTableProps): import("react").JSX.Element;
44
+ export declare function NativeTable({ columns, rows, onRowPress, caption, isDark: isDarkProp, style, emptyMessage, testID, }: NativeTableProps): import("react").JSX.Element;
36
45
  export interface NativeScrollAreaProps {
37
46
  children?: ReactNode;
38
47
  /** Fixed height. Without one the area grows with its content. */
@@ -41,7 +50,7 @@ export interface NativeScrollAreaProps {
41
50
  bordered?: boolean;
42
51
  horizontal?: boolean;
43
52
  isDark?: boolean;
44
- style?: any;
53
+ style?: StyleProp<ViewStyle>;
45
54
  /** Announced to screen readers. */
46
55
  accessibilityLabel?: string;
47
56
  }
@@ -52,4 +61,4 @@ export interface NativeScrollAreaProps {
52
61
  * scroll indicator is the one users already recognise, and it stays correct
53
62
  * under momentum, bouncing and accessibility settings.
54
63
  */
55
- export declare function NativeScrollArea({ children, maxHeight, bordered, horizontal, isDark, style, accessibilityLabel, }: NativeScrollAreaProps): import("react").JSX.Element;
64
+ export declare function NativeScrollArea({ children, maxHeight, bordered, horizontal, isDark: isDarkProp, style, accessibilityLabel, }: NativeScrollAreaProps): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
2
3
  export interface TabItem {
3
4
  /** Stable identifier for the tab. */
4
5
  id: string;
@@ -13,16 +14,18 @@ export interface TabsProps {
13
14
  activeId?: string;
14
15
  defaultActiveId?: string;
15
16
  onTabChange?: (id: string) => void;
16
- style?: any;
17
+ style?: StyleProp<ViewStyle>;
17
18
  isDark?: boolean;
19
+ /** Passed through to the rail so it is testable. */
20
+ testID?: string;
18
21
  }
19
22
  /**
20
23
  * A row of tabs on a glass rail, in the reference implementation's style: the
21
24
  * selected tab is a lifted inner pane rather than a flat highlight.
22
25
  *
23
- * Follows the same conventions as the other native components — no browser
24
- * APIs and no CSS — so it renders on iOS and Android. On iOS 26 the rail is
25
- * real glass through `@callstack/liquid-glass`; elsewhere it is a translucent
26
- * tint of the same shape with no layout shift.
26
+ * Same conventions as every other component here — React Native primitives
27
+ * only, no browser APIs. The rail is Apple's real glass on iOS 26+ and
28
+ * Glacia's translucent fallback of the same shape on older iOS and Android, so
29
+ * the layout never shifts between platforms.
27
30
  */
28
31
  export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<any>>;
@@ -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>>;
@@ -17,7 +17,7 @@ export interface NativePlanProps {
17
17
  * Each step carries its own status, so a half-finished plan is legible instead
18
18
  * of appearing blank until the whole thing completes.
19
19
  */
20
- export declare function NativePlan({ title, steps, isDark, style }: NativePlanProps): import("react").JSX.Element;
20
+ export declare function NativePlan({ title, steps, isDark: isDarkProp, style }: NativePlanProps): import("react").JSX.Element;
21
21
  export interface NativeSource {
22
22
  id: string;
23
23
  title: string;
@@ -38,7 +38,7 @@ export interface NativeSourcesProps {
38
38
  * Native has no anchor element, so a row hands the source to the caller's
39
39
  * `onSourcePress` instead of opening a browser the component cannot control.
40
40
  */
41
- export declare function NativeSources({ sources, title, isDark, style, onSourcePress, }: NativeSourcesProps): import("react").JSX.Element | null;
41
+ export declare function NativeSources({ sources, title, isDark: isDarkProp, style, onSourcePress, }: NativeSourcesProps): import("react").JSX.Element | null;
42
42
  export interface NativeResponseProps {
43
43
  text: string;
44
44
  /** Characters to reveal. Omit to show the whole string. */
@@ -53,7 +53,7 @@ export interface NativeResponseProps {
53
53
  * The caller owns the streaming clock (usually a network stream); this only
54
54
  * renders the first `revealed` characters and shows a caret while incomplete.
55
55
  */
56
- export declare function NativeResponse({ text, revealed, streaming, isDark, style, }: NativeResponseProps): import("react").JSX.Element;
56
+ export declare function NativeResponse({ text, revealed, streaming, isDark: isDarkProp, style, }: NativeResponseProps): import("react").JSX.Element;
57
57
  export interface NativeTaskProps {
58
58
  task: {
59
59
  /** 0–1, or omit for an indeterminate task. */
@@ -66,7 +66,7 @@ export interface NativeTaskProps {
66
66
  style?: any;
67
67
  }
68
68
  /** Progress of a long-running background task. */
69
- export declare function NativeTask({ task, isDark, style }: NativeTaskProps): import("react").JSX.Element;
69
+ export declare function NativeTask({ task, isDark: isDarkProp, style }: NativeTaskProps): import("react").JSX.Element;
70
70
  export interface NativeSoundwaveProps {
71
71
  levels?: number[];
72
72
  bars?: number;
@@ -84,7 +84,7 @@ export interface NativeSoundwaveProps {
84
84
  * Without levels it rests at a low, static profile instead of animating:
85
85
  * continuous motion with no audio behind it would be decorative noise.
86
86
  */
87
- export declare function NativeSoundwave({ levels, bars, active, height, color, isDark, style, label, }: NativeSoundwaveProps): import("react").JSX.Element;
87
+ export declare function NativeSoundwave({ levels, bars, active, height, color, isDark: isDarkProp, style, label, }: NativeSoundwaveProps): import("react").JSX.Element;
88
88
  export interface NativeThinkingOrbProps {
89
89
  label?: string;
90
90
  size?: number;
@@ -98,7 +98,7 @@ export interface NativeThinkingOrbProps {
98
98
  * Purely decorative, so it is hidden from screen readers and the label is
99
99
  * exposed as text instead of relying on the motion being perceived.
100
100
  */
101
- export declare function NativeThinkingOrb({ label, size, paused, isDark, style, }: NativeThinkingOrbProps): import("react").JSX.Element;
101
+ export declare function NativeThinkingOrb({ label, size, paused, isDark: isDarkProp, style, }: NativeThinkingOrbProps): import("react").JSX.Element;
102
102
  export interface NativePanelNavItem {
103
103
  id: string;
104
104
  label: string;
@@ -118,9 +118,12 @@ export interface NativePanelsideProps {
118
118
  * Selection is a press rather than navigation because the panel's content is
119
119
  * client state; the caller decides what a selection means.
120
120
  */
121
- export declare function NativePanelside({ items, value, onValueChange, isDark, style, title, }: NativePanelsideProps): import("react").JSX.Element;
121
+ export declare function NativePanelside({ items, value, onValueChange, isDark: isDarkProp, style, title, }: NativePanelsideProps): import("react").JSX.Element;
122
122
  export interface NativeAIInputProps {
123
+ /** Controlled text. Omit it and the composer keeps its own. */
123
124
  value?: string;
125
+ /** Starting text for uncontrolled use. */
126
+ defaultValue?: string;
124
127
  onChangeText?: (text: string) => void;
125
128
  onSubmit?: () => void;
126
129
  placeholder?: string;
@@ -138,7 +141,7 @@ export interface NativeAIInputProps {
138
141
  * Send stays disabled until there is non-whitespace to send, which is the rule
139
142
  * that prevents empty submissions rather than a validation message afterwards.
140
143
  */
141
- export declare function NativeAIInput({ value, onChangeText, onSubmit, placeholder, disabled, busy, sendLabel, isDark, style, footer, }: NativeAIInputProps): import("react").JSX.Element;
144
+ export declare function NativeAIInput({ value: valueProp, defaultValue, onChangeText, onSubmit, placeholder, disabled, busy, sendLabel, isDark: isDarkProp, style, footer, }: NativeAIInputProps): import("react").JSX.Element;
142
145
  export interface NativeGeneratedImage {
143
146
  url: string;
144
147
  alt: string;
@@ -160,4 +163,4 @@ export interface NativeImageGenerationProps {
160
163
  * While generating, a placeholder with the same aspect ratio holds the space so
161
164
  * the layout does not jump when the image arrives.
162
165
  */
163
- export declare function NativeImageGeneration({ image, prompt, status, isDark, style, }: NativeImageGenerationProps): import("react").JSX.Element;
166
+ export declare function NativeImageGeneration({ image, prompt, status, isDark: isDarkProp, style, }: NativeImageGenerationProps): import("react").JSX.Element;
@@ -16,4 +16,4 @@ export interface NativeBarChartProps {
16
16
  onBarPress?: (index: number) => void;
17
17
  }
18
18
  /** Grouped or stacked bars, drawn with react-native-svg. */
19
- export declare function NativeBarChart({ labels, series, width, height, stacked, radius, isDark, palette, style, onBarPress, }: NativeBarChartProps): import("react").JSX.Element;
19
+ export declare function NativeBarChart({ labels, series, width, height, stacked, radius, isDark: isDarkProp, palette, style, onBarPress, }: NativeBarChartProps): import("react").JSX.Element;
@@ -22,4 +22,4 @@ export interface NativeFunnelChartProps {
22
22
  * shows its own value, its share of entry, and the step conversion — the three
23
23
  * numbers a funnel is actually read for.
24
24
  */
25
- export declare function NativeFunnelChart({ stages, width, stageHeight, baseline, isDark, palette, style, onStagePress, }: NativeFunnelChartProps): import("react").JSX.Element;
25
+ export declare function NativeFunnelChart({ stages, width, stageHeight, baseline, isDark: isDarkProp, palette, style, onStagePress, }: NativeFunnelChartProps): import("react").JSX.Element;
@@ -20,4 +20,4 @@ export interface NativeHeatmapChartProps {
20
20
  * Cells are Views rather than SVG rects: the grid is uniform, so native layout
21
21
  * positions it exactly and text stays crisp without vector text.
22
22
  */
23
- export declare function NativeHeatmapChart({ rows, columns, cellSize, cellGap, isDark, minColor, maxColor, style, onCellPress, }: NativeHeatmapChartProps): import("react").JSX.Element;
23
+ export declare function NativeHeatmapChart({ rows, columns, cellSize, cellGap, isDark: isDarkProp, minColor, maxColor, style, onCellPress, }: NativeHeatmapChartProps): import("react").JSX.Element;
@@ -26,5 +26,5 @@ type StyleProps = any;
26
26
  * the same axis values on both platforms. Touching a column selects that
27
27
  * point, which is the touch equivalent of hovering on the web.
28
28
  */
29
- export declare function NativeLineChart({ labels, series, width, height, area, smooth, showDots, isDark, palette, style, onPointPress, }: NativeLineChartProps): import("react").JSX.Element;
29
+ export declare function NativeLineChart({ labels, series, width, height, area, smooth, showDots, isDark: isDarkProp, palette, style, onPointPress, }: NativeLineChartProps): import("react").JSX.Element;
30
30
  export {};
@@ -28,4 +28,4 @@ export interface NativePlotChartProps {
28
28
  * pixel scales. That keeps stroke widths and text sizes honest regardless of
29
29
  * the chart's width, instead of a scaled viewBox that would distort them.
30
30
  */
31
- export declare function NativePlotChart({ points, renderMark, width, height, xLabel, yLabel, isDark, style, }: NativePlotChartProps): import("react").JSX.Element;
31
+ export declare function NativePlotChart({ points, renderMark, width, height, xLabel, yLabel, isDark: isDarkProp, style, }: NativePlotChartProps): import("react").JSX.Element;
@@ -24,4 +24,4 @@ export interface NativeRadarChartProps {
24
24
  * touch target: tapping one lists that axis's values for all series instead of
25
25
  * relying on a hover tooltip.
26
26
  */
27
- export declare function NativeRadarChart({ axes, series, size, rings, max, isDark, palette, style, onAxisPress, }: NativeRadarChartProps): import("react").JSX.Element;
27
+ export declare function NativeRadarChart({ axes, series, size, rings, max, isDark: isDarkProp, palette, style, onAxisPress, }: NativeRadarChartProps): import("react").JSX.Element;
@@ -25,4 +25,4 @@ export interface NativeRingChartProps {
25
25
  * places on both platforms. A legend is on by default: on a phone there is no
26
26
  * hover, so colour alone cannot identify a slice.
27
27
  */
28
- export declare function NativeRingChart({ data, size, thickness, isDark, palette, showLegend, style, onSlicePress, }: NativeRingChartProps): import("react").JSX.Element;
28
+ export declare function NativeRingChart({ data, size, thickness, isDark: isDarkProp, palette, showLegend, style, onSlicePress, }: NativeRingChartProps): import("react").JSX.Element;
@@ -29,6 +29,6 @@ export interface NativeScatterChartProps {
29
29
  * BubbleChart is this component with `bubble` set, so the two share their
30
30
  * axes, padding and touch behaviour instead of drifting apart.
31
31
  */
32
- export declare function NativeScatterChart({ series, width, height, radius, bubble, isDark, palette, style, onPointPress, }: NativeScatterChartProps): import("react").JSX.Element;
32
+ export declare function NativeScatterChart({ series, width, height, radius, bubble, isDark: isDarkProp, palette, style, onPointPress, }: NativeScatterChartProps): import("react").JSX.Element;
33
33
  /** Scatter marks sized by a third value. */
34
34
  export declare function NativeBubbleChart(props: Omit<NativeScatterChartProps, "bubble" | "radius">): import("react").JSX.Element;
@@ -19,4 +19,4 @@ export interface NativeWaterfallChartProps {
19
19
  * from opening to closing balance rather than a set of unrelated changes.
20
20
  * Increases and decreases are coloured differently, and totals span the axis.
21
21
  */
22
- export declare function NativeWaterfallChart({ steps, width, height, isDark, style, onStepPress, }: NativeWaterfallChartProps): import("react").JSX.Element;
22
+ export declare function NativeWaterfallChart({ steps, width, height, isDark: isDarkProp, style, onStepPress, }: NativeWaterfallChartProps): import("react").JSX.Element;
@@ -20,7 +20,7 @@ export interface NativeCandlestickChartProps {
20
20
  * down, which is the convention traders read without a legend. Each candle is
21
21
  * tappable to reveal the four prices, replacing the web hover tooltip.
22
22
  */
23
- export declare function NativeCandlestickChart({ candles, width, height, isDark, style, onCandlePress, }: NativeCandlestickChartProps): import("react").JSX.Element;
23
+ export declare function NativeCandlestickChart({ candles, width, height, isDark: isDarkProp, style, onCandlePress, }: NativeCandlestickChartProps): import("react").JSX.Element;
24
24
  export interface NativeTreemapItem {
25
25
  label: string;
26
26
  value: number;
@@ -36,7 +36,7 @@ export interface NativeTreemapChartProps {
36
36
  onItemPress?: (index: number) => void;
37
37
  }
38
38
  /** Proportional rectangles for part-to-whole comparison. */
39
- export declare function NativeTreemapChart({ items, width, height, isDark, palette, style, onItemPress, }: NativeTreemapChartProps): import("react").JSX.Element;
39
+ export declare function NativeTreemapChart({ items, width, height, isDark: isDarkProp, palette, style, onItemPress, }: NativeTreemapChartProps): import("react").JSX.Element;
40
40
  export interface NativeSankeyNode {
41
41
  id: string;
42
42
  label: string;
@@ -62,7 +62,7 @@ export interface NativeSankeyChartProps {
62
62
  * after everything feeding it. Rendering uses Views rather than SVG because the
63
63
  * bands are axis-aligned rectangles.
64
64
  */
65
- export declare function NativeSankeyChart({ nodes, links, width, height, isDark, palette, style, }: NativeSankeyChartProps): import("react").JSX.Element;
65
+ export declare function NativeSankeyChart({ nodes, links, width, height, isDark: isDarkProp, palette, style, }: NativeSankeyChartProps): import("react").JSX.Element;
66
66
  export interface NativeBumpSeries {
67
67
  name: string;
68
68
  /** Rank per period; 1 is best. */
@@ -80,7 +80,7 @@ export interface NativeBumpChartProps {
80
80
  onPointPress?: (seriesIndex: number, periodIndex: number) => void;
81
81
  }
82
82
  /** Rank changes over time, where the vertical position is the rank itself. */
83
- export declare function NativeBumpChart({ labels, series, width, height, isDark, palette, style, onPointPress, }: NativeBumpChartProps): import("react").JSX.Element;
83
+ export declare function NativeBumpChart({ labels, series, width, height, isDark: isDarkProp, palette, style, onPointPress, }: NativeBumpChartProps): import("react").JSX.Element;
84
84
  export interface NativeHexPoint {
85
85
  x: number;
86
86
  y: number;
@@ -104,4 +104,4 @@ export interface NativeHexChartProps {
104
104
  * Binning keeps thousands of points legible: reading one mark's exact position
105
105
  * matters less than seeing where density is concentrated.
106
106
  */
107
- export declare function NativeHexChart({ points, radius, width, height, isDark, style, onBinPress, }: NativeHexChartProps): import("react").JSX.Element;
107
+ export declare function NativeHexChart({ points, radius, width, height, isDark: isDarkProp, style, onBinPress, }: NativeHexChartProps): import("react").JSX.Element;