@octane-xplat/ui 0.2.1 → 0.4.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 (126) hide show
  1. package/README.md +46 -0
  2. package/dist/native/octane-client-build.json +1 -1
  3. package/dist/native/ui.js +52 -19
  4. package/dist/native/ui10.js +25 -45
  5. package/dist/native/ui11.js +52 -57
  6. package/dist/native/ui12.js +47 -16
  7. package/dist/native/ui13.js +24 -18
  8. package/dist/native/ui14.js +117 -12
  9. package/dist/native/ui15.js +78 -17
  10. package/dist/native/ui16.js +88 -115
  11. package/dist/native/ui17.js +29 -19
  12. package/dist/native/ui18.js +34 -12
  13. package/dist/native/ui19.js +244 -8
  14. package/dist/native/ui2.js +10 -48
  15. package/dist/native/ui20.js +28 -0
  16. package/dist/native/ui21.js +383 -0
  17. package/dist/native/ui22.js +36 -0
  18. package/dist/native/ui23.js +55 -0
  19. package/dist/native/ui24.js +83 -0
  20. package/dist/native/ui25.js +141 -0
  21. package/dist/native/ui26.js +12 -0
  22. package/dist/native/ui27.js +61 -0
  23. package/dist/native/ui28.js +40 -0
  24. package/dist/native/ui29.js +108 -0
  25. package/dist/native/ui3.js +17 -20
  26. package/dist/native/ui30.js +18 -0
  27. package/dist/native/ui31.js +58 -0
  28. package/dist/native/ui32.js +58 -0
  29. package/dist/native/ui33.js +38 -0
  30. package/dist/native/ui34.js +53 -0
  31. package/dist/native/ui35.js +105 -0
  32. package/dist/native/ui36.js +10 -0
  33. package/dist/native/ui37.js +44 -0
  34. package/dist/native/ui38.js +197 -0
  35. package/dist/native/ui39.js +105 -0
  36. package/dist/native/ui4.js +23 -48
  37. package/dist/native/ui40.js +58 -0
  38. package/dist/native/ui41.js +19 -0
  39. package/dist/native/ui42.js +8 -0
  40. package/dist/native/ui43.js +38 -0
  41. package/dist/native/ui44.js +267 -0
  42. package/dist/native/ui45.js +28 -0
  43. package/dist/native/ui46.js +35 -0
  44. package/dist/native/ui47.js +41 -0
  45. package/dist/native/ui48.js +72 -0
  46. package/dist/native/ui49.js +66 -0
  47. package/dist/native/ui5.js +37 -34
  48. package/dist/native/ui50.js +27 -0
  49. package/dist/native/ui51.js +13 -0
  50. package/dist/native/ui52.js +92 -0
  51. package/dist/native/ui53.js +34 -0
  52. package/dist/native/ui54.js +17 -0
  53. package/dist/native/ui55.js +156 -0
  54. package/dist/native/ui56.js +33 -0
  55. package/dist/native/ui57.js +14 -0
  56. package/dist/native/ui58.js +22 -0
  57. package/dist/native/ui59.js +8 -0
  58. package/dist/native/ui6.js +79 -20
  59. package/dist/native/ui60.js +108 -0
  60. package/dist/native/ui61.js +76 -0
  61. package/dist/native/ui7.js +44 -65
  62. package/dist/native/ui8.js +25 -17
  63. package/dist/native/ui9.js +24 -12
  64. package/dist/web/octane-client-build.json +1 -1
  65. package/dist/web/ui.js +51 -19
  66. package/dist/web/ui10.js +33 -30
  67. package/dist/web/ui11.js +40 -55
  68. package/dist/web/ui12.js +36 -15
  69. package/dist/web/ui13.js +212 -20
  70. package/dist/web/ui14.js +84 -14
  71. package/dist/web/ui15.js +425 -46
  72. package/dist/web/ui16.js +12 -93
  73. package/dist/web/ui17.js +246 -28
  74. package/dist/web/ui18.js +238 -15
  75. package/dist/web/ui19.js +36 -8
  76. package/dist/web/ui2.js +15 -103
  77. package/dist/web/ui20.js +85 -0
  78. package/dist/web/ui21.js +111 -0
  79. package/dist/web/ui22.js +108 -0
  80. package/dist/web/ui23.js +96 -0
  81. package/dist/web/ui24.js +32 -0
  82. package/dist/web/ui25.js +108 -0
  83. package/dist/web/ui26.js +45 -0
  84. package/dist/web/ui27.js +16 -0
  85. package/dist/web/ui28.js +11 -0
  86. package/dist/web/ui29.js +58 -0
  87. package/dist/web/ui3.js +30 -27
  88. package/dist/web/ui30.js +34 -0
  89. package/dist/web/ui31.js +123 -0
  90. package/dist/web/ui32.js +44 -0
  91. package/dist/web/ui33.js +159 -0
  92. package/dist/web/ui34.js +70 -0
  93. package/dist/web/ui35.js +57 -0
  94. package/dist/web/ui36.js +22 -0
  95. package/dist/web/ui37.js +7 -0
  96. package/dist/web/ui38.js +38 -0
  97. package/dist/web/ui39.js +154 -0
  98. package/dist/web/ui4.js +46 -24
  99. package/dist/web/ui40.js +43 -0
  100. package/dist/web/ui41.js +42 -0
  101. package/dist/web/ui42.js +76 -0
  102. package/dist/web/ui43.js +42 -0
  103. package/dist/web/ui44.js +62 -0
  104. package/dist/web/ui45.js +9 -0
  105. package/dist/web/ui46.js +45 -0
  106. package/dist/web/ui47.js +13 -0
  107. package/dist/web/ui48.js +63 -0
  108. package/dist/web/ui49.js +47 -0
  109. package/dist/web/ui5.js +158 -52
  110. package/dist/web/ui50.js +17 -0
  111. package/dist/web/ui51.js +149 -0
  112. package/dist/web/ui52.js +42 -0
  113. package/dist/web/ui53.js +17 -0
  114. package/dist/web/ui54.js +9 -0
  115. package/dist/web/ui55.js +22 -0
  116. package/dist/web/ui56.js +8 -0
  117. package/dist/web/ui57.js +44 -0
  118. package/dist/web/ui58.js +46 -0
  119. package/dist/web/ui6.js +85 -22
  120. package/dist/web/ui7.js +46 -41
  121. package/dist/web/ui8.js +28 -11
  122. package/dist/web/ui9.js +32 -13
  123. package/package.json +18 -6
  124. package/src/theme/tokens.css +444 -47
  125. package/types/index.d.ts +180 -29
  126. package/types/props.d.ts +553 -8
package/types/index.d.ts CHANGED
@@ -6,92 +6,243 @@
6
6
  // emit declarations for .tsrx (upstream: tsrx-org/tsrx#136); this file is
7
7
  // what `tsc --emitDeclarationOnly` on pure .ts buys us.
8
8
 
9
- import type { UniversalComponent } from 'octane/universal';
9
+ import type { UniversalComponent } from 'octane/universal'
10
10
  import type {
11
11
  AnimatedValue,
12
+ AbsoluteProps,
13
+ ActivityIndicatorProps,
14
+ BeforeLoad,
15
+ BeforeLoadArgs,
12
16
  ColorScheme,
17
+ DrawerProps,
18
+ GridProps,
19
+ HeadingProps,
20
+ IconGlyph,
21
+ IconProps,
13
22
  ImageProps,
23
+ KeyboardAvoidingProps,
24
+ LayoutChildProps,
25
+ LinkProps,
14
26
  ListProps,
27
+ MeterProps,
15
28
  ModalProps,
29
+ ModalOpenOptions,
30
+ ModalOpenResult,
31
+ NavLinkProps,
32
+ OpenModal,
33
+ OpenWindowOptions,
34
+ OverlayProps,
35
+ PopoverAnchorRef,
36
+ PopoverPlacement,
37
+ PopoverProps,
16
38
  PlatformBadgeProps,
17
39
  PressableProps,
40
+ ReadableStore,
18
41
  Route,
42
+ RouteContext,
43
+ RouteHead,
44
+ RouteHeadExport,
45
+ RouteManifest,
46
+ RouteMeta,
47
+ RichTextProps,
48
+ RichTextSpanProps,
19
49
  RowProps,
20
50
  ScreenProps,
51
+ SafeAreaProps,
52
+ ScreenTable,
21
53
  ScrollViewProps,
54
+ SliderProps,
55
+ Store,
56
+ SpacerProps,
57
+ StackProps,
22
58
  SwitchProps,
23
59
  TabSpec,
24
60
  TabsProps,
61
+ TextAreaProps,
25
62
  TextInputProps,
26
63
  TextProps,
64
+ ToastContent,
65
+ ToastOptions,
66
+ ToastPosition,
27
67
  ViewProps,
28
- } from './props';
68
+ } from './props'
29
69
 
30
70
  export type {
71
+ AbsoluteProps,
31
72
  AnimatedValue,
73
+ ActivityIndicatorProps,
74
+ BeforeLoad,
75
+ BeforeLoadArgs,
32
76
  ColorScheme,
77
+ DrawerProps,
78
+ GridProps,
79
+ HeadingProps,
80
+ IconGlyph,
81
+ IconProps,
33
82
  ImageProps,
83
+ KeyboardAvoidingProps,
84
+ LayoutChildProps,
85
+ LinkProps,
34
86
  ListProps,
35
87
  ModalProps,
88
+ ModalOpenOptions,
89
+ ModalOpenResult,
90
+ NavLinkProps,
91
+ OpenModal,
92
+ OpenWindowOptions,
93
+ OverlayProps,
94
+ PopoverAnchorRef,
95
+ PopoverPlacement,
96
+ PopoverProps,
36
97
  PanEvent,
37
98
  PlatformBadgeProps,
38
99
  PressableProps,
100
+ ReadableStore,
39
101
  Route,
102
+ RouteContext,
103
+ RouteHead,
104
+ RouteHeadExport,
105
+ RouteManifest,
106
+ RouteMeta,
107
+ RichTextProps,
108
+ RichTextSpanProps,
40
109
  RowProps,
41
110
  ScreenProps,
111
+ SafeAreaProps,
112
+ ScreenTable,
42
113
  ScrollViewProps,
114
+ SliderProps,
115
+ Store,
116
+ SpacerProps,
117
+ StackProps,
43
118
  SwipeEvent,
44
119
  SwitchProps,
45
120
  TabSpec,
46
121
  TabsProps,
122
+ TextAreaProps,
47
123
  TextInputProps,
48
124
  TextProps,
125
+ ToastContent,
126
+ ToastOptions,
127
+ ToastPosition,
49
128
  ViewProps,
50
- } from './props';
129
+ } from './props'
130
+
131
+ /** ScrollBox shares ScrollView's public shell props; native renders it inline. */
132
+ export type ScrollBoxProps = ScrollViewProps
51
133
 
52
134
  // ---------- primitives ----------
53
135
 
54
- export declare const View: UniversalComponent<ViewProps>;
136
+ export declare const View: UniversalComponent<ViewProps>
55
137
  /** Column-direction alias of View. */
56
- export declare const Column: UniversalComponent<ViewProps>;
57
- export declare const Row: UniversalComponent<RowProps>;
58
- export declare const Text: UniversalComponent<TextProps>;
59
- export declare const Pressable: UniversalComponent<PressableProps>;
60
- export declare const TextInput: UniversalComponent<TextInputProps>;
61
- export declare const List: UniversalComponent<ListProps>;
62
- export declare const ScrollView: UniversalComponent<ScrollViewProps>;
63
- export declare const Image: UniversalComponent<ImageProps>;
64
- export declare const Screen: UniversalComponent<ScreenProps>;
65
- export declare const Switch: UniversalComponent<SwitchProps>;
66
- export declare const PlatformBadge: UniversalComponent<PlatformBadgeProps>;
138
+ export declare const Column: UniversalComponent<ViewProps>
139
+ export declare const Row: UniversalComponent<RowProps>
140
+ export declare const Grid: UniversalComponent<GridProps>
141
+ export declare const Stack: UniversalComponent<StackProps>
142
+ export declare const Absolute: UniversalComponent<AbsoluteProps>
143
+ export declare const Spacer: UniversalComponent<SpacerProps>
144
+ export declare const Text: UniversalComponent<TextProps>
145
+ export declare const RichText: UniversalComponent<RichTextProps>
146
+ export declare const RichTextSpan: UniversalComponent<RichTextSpanProps>
147
+ export declare const Pressable: UniversalComponent<PressableProps>
148
+ export declare const Link: UniversalComponent<LinkProps>
149
+ export declare const NavLink: UniversalComponent<NavLinkProps>
150
+ export declare const TextInput: UniversalComponent<TextInputProps>
151
+ export declare const TextArea: UniversalComponent<TextAreaProps>
152
+ export declare const List: UniversalComponent<ListProps>
153
+ export declare const ScrollBox: UniversalComponent<ScrollBoxProps>
154
+ export declare const ScrollView: UniversalComponent<ScrollViewProps>
155
+ export declare const Image: UniversalComponent<ImageProps>
156
+ export declare const Screen: UniversalComponent<ScreenProps>
157
+ export declare const SafeArea: UniversalComponent<SafeAreaProps>
158
+ export declare const KeyboardAvoiding: UniversalComponent<KeyboardAvoidingProps>
159
+ export declare const Drawer: UniversalComponent<DrawerProps>
160
+ export declare const Switch: UniversalComponent<SwitchProps>
161
+ export declare const ActivityIndicator: UniversalComponent<ActivityIndicatorProps>
162
+ export declare const Meter: UniversalComponent<MeterProps>
163
+ export declare const Slider: UniversalComponent<SliderProps>
164
+ export declare const Icon: UniversalComponent<IconProps>
165
+ export declare const Heading: UniversalComponent<HeadingProps>
166
+ export declare const PlatformBadge: UniversalComponent<PlatformBadgeProps>
167
+
168
+ export declare function registerIcon(name: string, glyph: IconGlyph): void
169
+ export declare function registerIcons(record: Record<string, IconGlyph>): void
67
170
 
68
171
  // ---------- overlays / shells ----------
69
172
 
70
- export declare const Modal: UniversalComponent<ModalProps>;
71
- export declare const Tabs: UniversalComponent<TabsProps>;
173
+ export declare const Modal: UniversalComponent<ModalProps>
174
+ export declare const openModal: OpenModal
175
+ export declare function openWindow(options?: OpenWindowOptions): any
176
+ export declare const Overlay: UniversalComponent<OverlayProps>
177
+ export declare const Popover: UniversalComponent<PopoverProps>
178
+ export declare function showToast(content: ToastContent, options?: ToastOptions): void
179
+ export declare const Tabs: UniversalComponent<TabsProps>
72
180
 
73
181
  // ---------- stacks (native registry; no-op on web) ----------
74
182
 
75
- export declare function registerStack(name: string, frame: any): void;
76
- export declare function getStack(name: string): any;
77
- export declare function stackEntries(): IterableIterator<[string, any]>;
183
+ export declare function registerStack(name: string, frame: any): void
184
+ export declare function getStack(name: string): any
185
+ export declare function stackEntries(): IterableIterator<[string, any]>
186
+
187
+ // ---------- routes (real on both: URL store on web, Frame stacks on native) ----------
188
+
189
+ export declare function pushRoute(r: Route): void
190
+ export declare function popRoute(stack?: string): void
191
+ export declare function routeStacks(): string[]
192
+ export declare function layoutsForRoute(name: string): any[]
193
+ export declare function routeFor(stack: string): Route | null
194
+ export declare function currentRoute(): Route | null
195
+ export declare function canGoBack(stack?: string): boolean
196
+ export declare function useCanGoBack(stack?: string): boolean
197
+ export declare function redirect(route: Route): never
198
+ export declare function useRoute(stack: string): Route | null
199
+ /** name → screen table; native pushRoute resolves `route.name` through
200
+ * it, web outlets fall back to it via `screenFor`. `manifest` (from
201
+ * deriveRouteManifest) enables path-param URL matching on web. Call
202
+ * once at boot. */
203
+ export declare function registerScreens(table: ScreenTable, manifest?: RouteMeta[]): void
204
+ /** One-call registration for route-dir apps — screens + URL patterns +
205
+ * layouts all come from deriveRouteManifest. */
206
+ export declare function registerRoutes(manifest: RouteManifest): void
207
+ export declare function screenFor(name: string): any
208
+ /** Canonical /<stack>/<path> for a Route — Link's href on web. */
209
+ export declare function hrefFor(r: Route): string
78
210
 
79
- // ---------- routes (web store; no-op on native) ----------
211
+ // ---------- route dir (file → route manifest; docs/navigation-notes.md) ----------
80
212
 
81
- export declare function pushRoute(r: Route): void;
82
- export declare function routeFor(stack: string): Route | null;
83
- export declare function currentRoute(): Route | null;
84
- export declare function useRoute(stack: string): Route | null;
213
+ /** Turn an `import.meta.glob` module map of the route dir into
214
+ * {screens, routes, layouts}: `demo/[id].tsrx` → 'demo/:id',
215
+ * `_layout.tsrx` → layouts[''], platform suffixes deduped by `prefer`
216
+ * rank (web: ['web']; native: ['ios'|'android','native']). */
217
+ export declare function deriveRouteManifest(
218
+ files: Record<string, any>,
219
+ prefer: readonly string[],
220
+ dir?: string,
221
+ ): RouteManifest
85
222
 
86
223
  // ---------- animation / theme ----------
87
224
 
88
- export declare function useAnimation(initial?: number, prop?: string): AnimatedValue;
89
- export declare function getColorScheme(): ColorScheme;
90
- export declare function useColorScheme(): ColorScheme;
225
+ export declare function useAnimation(initial?: number, prop?: string): AnimatedValue
226
+ export declare function getColorScheme(): ColorScheme
227
+ export declare function useColorScheme(): ColorScheme
228
+ export interface SafeAreaInsets {
229
+ top: number
230
+ right: number
231
+ bottom: number
232
+ left: number
233
+ }
234
+
235
+ export declare function useSafeAreaInsets(): SafeAreaInsets
91
236
 
92
237
  // ---------- styled ----------
93
238
 
94
239
  export declare function styled<P extends { className?: any }, V extends Record<string, any>>(
95
240
  Base: (props: P) => any,
96
241
  def: { base?: any; variants?: V },
97
- ): UniversalComponent<P & { [K in keyof V]?: boolean }>;
242
+ ): UniversalComponent<P & { [K in keyof V]?: boolean }>
243
+
244
+ // ---------- stores ----------
245
+
246
+ export declare function createStore<T>(initial: T): Store<T>
247
+ export declare function useStore<T>(store: ReadableStore<T>): T
248
+ export declare function useStore<T, S>(store: ReadableStore<T>, select: (state: T) => S): S