@marktiderman/genesis-ui-native 2.1.0 → 2.3.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.
- package/README.md +134 -0
- package/dist/chunk-7PCWEY6R.js +27 -0
- package/dist/chunk-7PCWEY6R.js.map +1 -0
- package/dist/chunk-D5RKSPMH.js +24 -0
- package/dist/chunk-D5RKSPMH.js.map +1 -0
- package/dist/{chunk-5HRGIA6F.js → chunk-EFXCJ5AN.js} +76 -3
- package/dist/chunk-EFXCJ5AN.js.map +1 -0
- package/dist/{chunk-ULS7I6ZS.js → chunk-ERHGCWTY.js} +81 -12
- package/dist/chunk-ERHGCWTY.js.map +1 -0
- package/dist/{chunk-3LK5ZJ4M.js → chunk-FIITITXO.js} +67 -108
- package/dist/chunk-FIITITXO.js.map +1 -0
- package/dist/chunk-FZY2IXOX.js +1559 -0
- package/dist/chunk-FZY2IXOX.js.map +1 -0
- package/dist/{chunk-TXJT55JC.js → chunk-W7BK3ARU.js} +715 -293
- package/dist/chunk-W7BK3ARU.js.map +1 -0
- package/dist/components/index.d.ts +143 -17
- package/dist/components/index.js +6 -4
- package/dist/data/index.d.ts +7 -1
- package/dist/data/index.js +31 -6
- package/dist/data/index.js.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/icons/lucide.d.ts +7 -0
- package/dist/icons/lucide.js +47 -0
- package/dist/icons/lucide.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +7 -6
- package/dist/layouts/index.d.ts +399 -7
- package/dist/layouts/index.js +3 -3
- package/dist/native-modules-BSVaEb3D.d.ts +206 -0
- package/package.json +34 -5
- package/src/__tests__/fake-modules.tsx +134 -0
- package/src/__tests__/native-modules-lists.test.tsx +70 -0
- package/src/__tests__/native-modules.test.tsx +631 -0
- package/src/components/__tests__/sheet.test.tsx +193 -0
- package/src/components/__tests__/toast.test.tsx +15 -0
- package/src/components/avatar.tsx +69 -16
- package/src/components/date-time-picker.tsx +128 -10
- package/src/components/drawer.tsx +158 -68
- package/src/components/dropdown-menu.tsx +7 -6
- package/src/components/glass-surface.tsx +150 -0
- package/src/components/icon.tsx +66 -0
- package/src/components/image.tsx +89 -0
- package/src/components/index.ts +33 -2
- package/src/components/list-item.tsx +29 -9
- package/src/components/popover.tsx +12 -9
- package/src/components/segmented-control.tsx +7 -1
- package/src/components/sheet.tsx +276 -133
- package/src/components/skeleton.tsx +75 -53
- package/src/components/textarea.tsx +1 -0
- package/src/components/toast.tsx +185 -87
- package/src/data/NativeResourcePage.tsx +48 -3
- package/src/data/__tests__/resource-page-offline.test.tsx +47 -0
- package/src/hooks/use-reduced-motion.ts +24 -10
- package/src/icon-names.ts +49 -0
- package/src/icons/lucide.ts +88 -0
- package/src/layouts/__tests__/apple-sign-in.test.tsx +97 -0
- package/src/layouts/__tests__/google-sign-in.test.tsx +26 -0
- package/src/layouts/__tests__/inbox-page.test.tsx +155 -0
- package/src/layouts/__tests__/keyboard-scroll.test.tsx +42 -1
- package/src/layouts/__tests__/settings-page-native-look.test.tsx +142 -0
- package/src/layouts/__tests__/thread-page.test.tsx +128 -0
- package/src/layouts/apple-sign-in.tsx +136 -0
- package/src/layouts/auth-screen.tsx +17 -8
- package/src/layouts/auth.tsx +29 -19
- package/src/layouts/google-sign-in.tsx +42 -0
- package/src/layouts/inbox-page.tsx +408 -0
- package/src/layouts/index.ts +45 -2
- package/src/layouts/keyboard.tsx +61 -9
- package/src/layouts/notifications-page.tsx +133 -16
- package/src/layouts/screen-container.tsx +6 -2
- package/src/layouts/settings-page.tsx +117 -14
- package/src/layouts/settings-sub-page.tsx +9 -3
- package/src/layouts/thread-page.tsx +444 -0
- package/src/native-modules.tsx +186 -0
- package/dist/chunk-3LK5ZJ4M.js.map +0 -1
- package/dist/chunk-5HRGIA6F.js.map +0 -1
- package/dist/chunk-F2TGDKOO.js +0 -43
- package/dist/chunk-F2TGDKOO.js.map +0 -1
- package/dist/chunk-TXJT55JC.js.map +0 -1
- package/dist/chunk-U2SPACTV.js +0 -876
- package/dist/chunk-U2SPACTV.js.map +0 -1
- package/dist/chunk-ULS7I6ZS.js.map +0 -1
package/dist/layouts/index.d.ts
CHANGED
|
@@ -146,6 +146,12 @@ interface SettingsPageSection {
|
|
|
146
146
|
footnote?: string;
|
|
147
147
|
/** Rows in render order. */
|
|
148
148
|
rows: SettingsPageRow[];
|
|
149
|
+
/**
|
|
150
|
+
* Content rendered inside the section's group, after the rows: a part that
|
|
151
|
+
* a pattern built on SettingsPage lets you replace (a block's slot), kept
|
|
152
|
+
* under the same header, in the same group and above the same footnote.
|
|
153
|
+
*/
|
|
154
|
+
children?: ReactNode;
|
|
149
155
|
}
|
|
150
156
|
/** A destructive-tone action in the footer, e.g. "Sign out". */
|
|
151
157
|
interface SettingsPageDangerousAction {
|
|
@@ -307,6 +313,16 @@ interface NotificationsPageProps extends ScreenHeaderProps {
|
|
|
307
313
|
emptyTitle?: string;
|
|
308
314
|
/** Optional override of the empty-state body copy. */
|
|
309
315
|
emptyBody?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Where a section header sticks, in points from the top of the list. Under a large-title header
|
|
318
|
+
* (`getNotificationsPageStackOptions`' default) the list runs under the native header (iOS
|
|
319
|
+
* insets its rows, and the title collapses as it scrolls), so a header stuck at 0 would sit
|
|
320
|
+
* under the status bar. Default on iOS: under the collapsed navigation bar of an iPhone in
|
|
321
|
+
* portrait (`defaultStickyHeaderOffset`); elsewhere 0. Pass 0 when the list starts below an
|
|
322
|
+
* opaque header (a standard one before iOS 26), the safe area's top with no header, and your own
|
|
323
|
+
* value on iPad (a 50 pt bar) or in landscape (32 pt).
|
|
324
|
+
*/
|
|
325
|
+
stickyHeaderOffset?: number;
|
|
310
326
|
/** Override root container styling. */
|
|
311
327
|
className?: string;
|
|
312
328
|
/** testID on the root container. Default `"notifications-page"`. */
|
|
@@ -326,7 +342,239 @@ declare function getNotificationsPageStackOptions(props: {
|
|
|
326
342
|
headerRight?: ScreenHeaderProps["headerRight"];
|
|
327
343
|
headerOptions?: ScreenHeaderProps["headerOptions"];
|
|
328
344
|
}): Record<string, unknown>;
|
|
329
|
-
|
|
345
|
+
/**
|
|
346
|
+
* The height of iOS's compact navigation bar, below the status bar: 44 pt up to iOS 18, 54 pt
|
|
347
|
+
* from iOS 26 (measured on an iOS 26 simulator, the collapsed large-title bar of a native stack).
|
|
348
|
+
*/
|
|
349
|
+
declare function iosCompactNavigationBarHeight(version: number | string): number;
|
|
350
|
+
/**
|
|
351
|
+
* Where a list's section headers stick by default: on iOS, the bottom of the collapsed
|
|
352
|
+
* navigation bar (the safe area's top plus the compact bar), since the list runs under the
|
|
353
|
+
* header; elsewhere 0 (the header sits above the list).
|
|
354
|
+
*/
|
|
355
|
+
declare function defaultStickyHeaderOffset(os: string, version: number | string, safeAreaTop: number): number;
|
|
356
|
+
declare function NotificationsPage({ items, refreshing, onRefresh, emptyState, emptyTitle, emptyBody, className, testID, slots, slotProps, stickyHeaderOffset, }: NotificationsPageProps): react.JSX.Element;
|
|
357
|
+
|
|
358
|
+
/** An action on a row: swipe, long press, or an accessibility action. */
|
|
359
|
+
interface InboxSwipeAction {
|
|
360
|
+
id: string;
|
|
361
|
+
label: string;
|
|
362
|
+
onPress: () => void;
|
|
363
|
+
/** Destructive tone (delete, leave). */
|
|
364
|
+
destructive?: boolean;
|
|
365
|
+
}
|
|
366
|
+
interface InboxItem {
|
|
367
|
+
/** Stable id for keying. */
|
|
368
|
+
id: string;
|
|
369
|
+
title: string;
|
|
370
|
+
/** The latest message or a summary, at most two lines. */
|
|
371
|
+
preview?: string;
|
|
372
|
+
/** When it last changed. Shown as a short time or date. */
|
|
373
|
+
timestamp?: string | Date;
|
|
374
|
+
/** Something new the person hasn't read: a dot, and the title in bold. */
|
|
375
|
+
unread?: boolean;
|
|
376
|
+
/** How many unread messages; shown as a count instead of the dot when above 0. */
|
|
377
|
+
unreadCount?: number;
|
|
378
|
+
/** A short status shown under the preview ("In progress", "12 votes"). */
|
|
379
|
+
meta?: string;
|
|
380
|
+
/** Replaces the unread dot (an avatar, an icon). */
|
|
381
|
+
leading?: ReactNode;
|
|
382
|
+
/** Shown at the end of the row (a vote button, a badge). Replaces the chevron. */
|
|
383
|
+
trailing?: ReactNode;
|
|
384
|
+
/** Opens the conversation. Rows with `onPress` show a chevron unless `trailing` is set. */
|
|
385
|
+
onPress?: () => void;
|
|
386
|
+
swipeActions?: InboxSwipeAction[];
|
|
387
|
+
/** testID override. Default `<page testID>-row-<id>`. */
|
|
388
|
+
testID?: string;
|
|
389
|
+
}
|
|
390
|
+
/** The parts `slots` and `slotProps` reach, with the props each receives. */
|
|
391
|
+
type InboxPageSlotMap = {
|
|
392
|
+
row: InboxItem & {
|
|
393
|
+
testID: string;
|
|
394
|
+
isFirst: boolean;
|
|
395
|
+
isLast: boolean;
|
|
396
|
+
timeLabel: string | null;
|
|
397
|
+
};
|
|
398
|
+
swipeable: {
|
|
399
|
+
actions: InboxSwipeAction[];
|
|
400
|
+
testID: string;
|
|
401
|
+
children?: ReactNode;
|
|
402
|
+
};
|
|
403
|
+
header: {
|
|
404
|
+
testID: string;
|
|
405
|
+
};
|
|
406
|
+
footer: {
|
|
407
|
+
loadingMore: boolean;
|
|
408
|
+
testID: string;
|
|
409
|
+
};
|
|
410
|
+
empty: {
|
|
411
|
+
title: string;
|
|
412
|
+
body: string;
|
|
413
|
+
actionLabel?: string;
|
|
414
|
+
onAction?: () => void;
|
|
415
|
+
testID: string;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
interface InboxPageProps extends ScreenHeaderProps {
|
|
419
|
+
/** Newest first, as they should show. Empty → the empty state. */
|
|
420
|
+
items: InboxItem[];
|
|
421
|
+
refreshing?: boolean;
|
|
422
|
+
onRefresh?: () => void | Promise<void>;
|
|
423
|
+
/** Called near the end of the list, to load the next page. */
|
|
424
|
+
onEndReached?: () => void;
|
|
425
|
+
/** A next page is loading: the default footer shows a spinner. */
|
|
426
|
+
loadingMore?: boolean;
|
|
427
|
+
/** Above the group (a filter, a call to action). Prefer `slots.header` for a component. */
|
|
428
|
+
header?: ReactNode;
|
|
429
|
+
/** An optional title over the group, in the Settings header style. */
|
|
430
|
+
sectionTitle?: string;
|
|
431
|
+
emptyTitle?: string;
|
|
432
|
+
emptyBody?: string;
|
|
433
|
+
/** The first page is loading: a spinner instead of the empty state. */
|
|
434
|
+
loading?: boolean;
|
|
435
|
+
/** The read failed: the empty slot shows `errorTitle` / `errorBody` instead (and pull to refresh retries). */
|
|
436
|
+
error?: boolean;
|
|
437
|
+
errorTitle?: string;
|
|
438
|
+
errorBody?: string;
|
|
439
|
+
/** A button in the empty state ("Send feedback"). */
|
|
440
|
+
emptyActionLabel?: string;
|
|
441
|
+
onEmptyAction?: () => void;
|
|
442
|
+
/** How a row's time reads. Default: the time today, "Yesterday", the weekday this week, else the date. */
|
|
443
|
+
formatTime?: (date: Date, now: Date) => string;
|
|
444
|
+
/** The clock, for tests. */
|
|
445
|
+
now?: () => Date;
|
|
446
|
+
slots?: Slots<InboxPageSlotMap>;
|
|
447
|
+
slotProps?: SlotPropsFor<InboxPageSlotMap>;
|
|
448
|
+
/** testID on the root. Default `"inbox-page"`. */
|
|
449
|
+
testID?: string;
|
|
450
|
+
}
|
|
451
|
+
/** `<Stack.Screen options>` for an InboxPage: a large title that collapses on scroll. */
|
|
452
|
+
declare function getInboxPageStackOptions(props: ScreenHeaderProps & {
|
|
453
|
+
headerTitle?: string;
|
|
454
|
+
}): Record<string, unknown>;
|
|
455
|
+
/** The default row time: `9:41`, `Yesterday`, `Monday`, then a short date. */
|
|
456
|
+
declare function formatInboxTime(date: Date, now: Date): string;
|
|
457
|
+
declare function InboxPage({ items, refreshing, onRefresh, onEndReached, loadingMore, header, sectionTitle, emptyTitle, emptyBody, emptyActionLabel, onEmptyAction, loading, error, errorTitle, errorBody, formatTime, now, slots, slotProps, testID, }: InboxPageProps): react.JSX.Element;
|
|
458
|
+
/** Opens a row's actions as a menu (long press). */
|
|
459
|
+
declare function showInboxActions(title: string, actions: InboxSwipeAction[], cancelLabel?: string): void;
|
|
460
|
+
|
|
461
|
+
interface ThreadAttachment {
|
|
462
|
+
id: string;
|
|
463
|
+
/** An image URI (a signed URL, a file:// path). */
|
|
464
|
+
uri: string;
|
|
465
|
+
width?: number;
|
|
466
|
+
height?: number;
|
|
467
|
+
accessibilityLabel?: string;
|
|
468
|
+
onPress?: () => void;
|
|
469
|
+
}
|
|
470
|
+
interface ThreadMessage {
|
|
471
|
+
id: string;
|
|
472
|
+
body: string;
|
|
473
|
+
/** Sent by the person using the app: trailing side, tint. */
|
|
474
|
+
mine: boolean;
|
|
475
|
+
/** Shown over theirs ("Support"); never over mine. */
|
|
476
|
+
authorName?: string;
|
|
477
|
+
timestamp: string | Date;
|
|
478
|
+
/** An optimistic message: `sending`, then `sent`, or `failed` with `onRetry`. */
|
|
479
|
+
status?: "sending" | "sent" | "failed";
|
|
480
|
+
onRetry?: () => void;
|
|
481
|
+
attachments?: ThreadAttachment[];
|
|
482
|
+
}
|
|
483
|
+
interface ThreadComposer {
|
|
484
|
+
value: string;
|
|
485
|
+
onChangeText: (text: string) => void;
|
|
486
|
+
onSend: () => void;
|
|
487
|
+
/** A send is in flight: the button spins and won't send twice. */
|
|
488
|
+
sending?: boolean;
|
|
489
|
+
placeholder?: string;
|
|
490
|
+
sendLabel?: string;
|
|
491
|
+
/** Turns the send button off (besides an empty or blank value). */
|
|
492
|
+
disabled?: boolean;
|
|
493
|
+
maxLength?: number;
|
|
494
|
+
}
|
|
495
|
+
/** What the default parts say. */
|
|
496
|
+
interface ThreadLabels {
|
|
497
|
+
/** Who "mine" is, to VoiceOver. */
|
|
498
|
+
you: string;
|
|
499
|
+
sending: string;
|
|
500
|
+
notSent: string;
|
|
501
|
+
retryHint: string;
|
|
502
|
+
}
|
|
503
|
+
type ThreadPageSlotMap = {
|
|
504
|
+
message: ThreadMessage & {
|
|
505
|
+
testID: string;
|
|
506
|
+
timeLabel: string;
|
|
507
|
+
showReadReceipt: boolean;
|
|
508
|
+
labels: ThreadLabels;
|
|
509
|
+
};
|
|
510
|
+
attachment: ThreadAttachment & {
|
|
511
|
+
testID: string;
|
|
512
|
+
mine: boolean;
|
|
513
|
+
};
|
|
514
|
+
readReceipt: {
|
|
515
|
+
label: string;
|
|
516
|
+
testID: string;
|
|
517
|
+
};
|
|
518
|
+
/** `accessory` is the `composerAccessory` slot, already rendered. */
|
|
519
|
+
composer: ThreadComposer & {
|
|
520
|
+
testID: string;
|
|
521
|
+
accessory?: ReactNode;
|
|
522
|
+
};
|
|
523
|
+
composerAccessory: {
|
|
524
|
+
testID: string;
|
|
525
|
+
};
|
|
526
|
+
header: {
|
|
527
|
+
testID: string;
|
|
528
|
+
};
|
|
529
|
+
earlier: {
|
|
530
|
+
loading: boolean;
|
|
531
|
+
onPress: () => void;
|
|
532
|
+
label: string;
|
|
533
|
+
testID: string;
|
|
534
|
+
};
|
|
535
|
+
empty: {
|
|
536
|
+
title: string;
|
|
537
|
+
body: string;
|
|
538
|
+
testID: string;
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
interface ThreadPageProps extends ScreenHeaderProps {
|
|
542
|
+
/** Oldest first. */
|
|
543
|
+
messages: ThreadMessage[];
|
|
544
|
+
/** `null`: read-only, no composer. */
|
|
545
|
+
composer: ThreadComposer | null;
|
|
546
|
+
/** Shown instead of the composer when it is `null` ("This conversation is closed"). */
|
|
547
|
+
closedNotice?: string;
|
|
548
|
+
/** Above the messages (what the thread is about). Prefer `slots.header` for a component. */
|
|
549
|
+
header?: ReactNode;
|
|
550
|
+
/**
|
|
551
|
+
* When the other side last read the thread. My newest message sent before
|
|
552
|
+
* it shows the read receipt.
|
|
553
|
+
*/
|
|
554
|
+
readAt?: string | Date | null;
|
|
555
|
+
readLabel?: string;
|
|
556
|
+
/** There are older messages: shows a "load earlier" button at the top. */
|
|
557
|
+
hasEarlier?: boolean;
|
|
558
|
+
onLoadEarlier?: () => void;
|
|
559
|
+
loadingEarlier?: boolean;
|
|
560
|
+
earlierLabel?: string;
|
|
561
|
+
emptyTitle?: string;
|
|
562
|
+
emptyBody?: string;
|
|
563
|
+
formatTime?: (date: Date) => string;
|
|
564
|
+
/** The words the defaults say, for translating. */
|
|
565
|
+
labels?: Partial<ThreadLabels>;
|
|
566
|
+
slots?: Slots<ThreadPageSlotMap>;
|
|
567
|
+
slotProps?: SlotPropsFor<ThreadPageSlotMap>;
|
|
568
|
+
/** testID on the root. Default `"thread-page"`. */
|
|
569
|
+
testID?: string;
|
|
570
|
+
}
|
|
571
|
+
/** `<Stack.Screen options>` for a ThreadPage: a standard (not large) title, like Messages. */
|
|
572
|
+
declare function getThreadPageStackOptions(props: ScreenHeaderProps & {
|
|
573
|
+
headerTitle?: string;
|
|
574
|
+
}): Record<string, unknown>;
|
|
575
|
+
/** The newest of my messages the other side has read, or null. */
|
|
576
|
+
declare function readReceiptFor(messages: readonly ThreadMessage[], readAt: string | Date | null | undefined): string | null;
|
|
577
|
+
declare function ThreadPage({ messages, composer, closedNotice, header, readAt, readLabel, hasEarlier, onLoadEarlier, loadingEarlier, earlierLabel, emptyTitle, emptyBody, formatTime, labels: labelOverrides, slots, slotProps, testID, }: ThreadPageProps): react.JSX.Element;
|
|
330
578
|
|
|
331
579
|
interface AuthBrandingProps {
|
|
332
580
|
/** Brand mark (logo node). */
|
|
@@ -351,6 +599,15 @@ type SocialAuthProvider = {
|
|
|
351
599
|
onPress: () => void | Promise<void>;
|
|
352
600
|
/** When true, the button is disabled (e.g., loading). */
|
|
353
601
|
disabled?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Draw the provider's own button instead of the default outline button,
|
|
604
|
+
* for a provider whose brand rules require theirs (Apple: see
|
|
605
|
+
* `appleProvider`). Receives the testID the default would use.
|
|
606
|
+
*/
|
|
607
|
+
render?: (props: {
|
|
608
|
+
testID: string;
|
|
609
|
+
disabled?: boolean;
|
|
610
|
+
}) => ReactNode;
|
|
354
611
|
};
|
|
355
612
|
interface SocialAuthRowProps {
|
|
356
613
|
providers: SocialAuthProvider[];
|
|
@@ -423,8 +680,12 @@ type AuthScreenSlotMap = {
|
|
|
423
680
|
interface AuthScreenProps {
|
|
424
681
|
/** Logo, headline and subhead above everything else. */
|
|
425
682
|
branding?: AuthBrandingProps;
|
|
426
|
-
/**
|
|
427
|
-
|
|
683
|
+
/**
|
|
684
|
+
* Sign-in providers (Apple, Google…). None: no social row. A `null` or
|
|
685
|
+
* `false` entry is skipped, so a platform-only provider such as
|
|
686
|
+
* `appleProvider(...)` (null off iOS) goes in the list as is.
|
|
687
|
+
*/
|
|
688
|
+
providers?: Array<SocialAuthProvider | null | false | undefined>;
|
|
428
689
|
/** The email form. */
|
|
429
690
|
form: AuthFormProps;
|
|
430
691
|
/** Adds a "Forgot password?" link below the fields (password mode only). */
|
|
@@ -438,7 +699,7 @@ interface AuthScreenProps {
|
|
|
438
699
|
/** testID on the root container. Default `"auth-screen"`. */
|
|
439
700
|
testID?: string;
|
|
440
701
|
}
|
|
441
|
-
declare function AuthScreen({ branding, providers, form, onForgotPassword, footer, slots, slotProps, testID, }: AuthScreenProps): react.JSX.Element;
|
|
702
|
+
declare function AuthScreen({ branding, providers: givenProviders, form, onForgotPassword, footer, slots, slotProps, testID, }: AuthScreenProps): react.JSX.Element;
|
|
442
703
|
|
|
443
704
|
/** The props Genesis passes to a keyboard-aware scroll view. */
|
|
444
705
|
interface KeyboardScrollProps {
|
|
@@ -451,11 +712,142 @@ interface KeyboardScrollProps {
|
|
|
451
712
|
/** Extra space between the focused input and the keyboard. */
|
|
452
713
|
bottomOffset?: number;
|
|
453
714
|
}
|
|
454
|
-
|
|
715
|
+
/**
|
|
716
|
+
* The props Genesis may pass to a keyboard toolbar, all optional and all
|
|
717
|
+
* `KeyboardToolbar`'s own: a settings form passes none (previous / next /
|
|
718
|
+
* done), a one-question form (forms-native's `FormFocus`) hides the arrows
|
|
719
|
+
* and makes Done its Next or Send. To theme it, pass a wrapper defined at
|
|
720
|
+
* module scope that renders it with your props and forwards these.
|
|
721
|
+
*/
|
|
722
|
+
interface KeyboardToolbarProps {
|
|
723
|
+
/** Show the previous / next arrows. `KeyboardToolbar`'s default is true. */
|
|
724
|
+
showArrows?: boolean;
|
|
725
|
+
/** The done button's label. */
|
|
726
|
+
doneText?: ReactNode;
|
|
727
|
+
/** Called when done is pressed. The keyboard closes too, unless the callback calls `event.preventDefault()`. */
|
|
728
|
+
onDoneCallback?: (event: {
|
|
729
|
+
preventDefault(): void;
|
|
730
|
+
}) => void;
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Height of react-native-keyboard-controller's `KeyboardToolbar`, kept clear
|
|
734
|
+
* above the focused input. Mirrors `KEYBOARD_TOOLBAR_HEIGHT` in the library's
|
|
735
|
+
* `src/components/KeyboardToolbar/constants.ts` (1.22): move them together.
|
|
736
|
+
*/
|
|
737
|
+
declare const KEYBOARD_TOOLBAR_HEIGHT = 42;
|
|
738
|
+
interface KeyboardScrollValue {
|
|
455
739
|
component: ComponentType<KeyboardScrollProps>;
|
|
740
|
+
toolbar: ComponentType<KeyboardToolbarProps> | null;
|
|
741
|
+
}
|
|
742
|
+
declare function KeyboardScrollProvider({ component, toolbar, children, }: {
|
|
743
|
+
component: ComponentType<KeyboardScrollProps>;
|
|
744
|
+
/** `KeyboardToolbar` from react-native-keyboard-controller: previous / next / done above the keyboard. */
|
|
745
|
+
toolbar?: ComponentType<KeyboardToolbarProps>;
|
|
456
746
|
children: ReactNode;
|
|
457
|
-
}): react.FunctionComponentElement<react.ProviderProps<
|
|
747
|
+
}): react.FunctionComponentElement<react.ProviderProps<KeyboardScrollValue | null>>;
|
|
458
748
|
/** The app's keyboard-aware scroll view, or null when none was provided. */
|
|
459
749
|
declare function useKeyboardScroll(): ComponentType<KeyboardScrollProps> | null;
|
|
750
|
+
/** The app's keyboard toolbar, or null when none was provided (or no scroll view to go with it). */
|
|
751
|
+
declare function useKeyboardToolbar(): ComponentType<KeyboardToolbarProps> | null;
|
|
752
|
+
|
|
753
|
+
/** The parts of `expo-apple-authentication` the button uses. Pass the module itself. */
|
|
754
|
+
interface AppleButtonModuleLike {
|
|
755
|
+
AppleAuthenticationButton: ComponentType<{
|
|
756
|
+
buttonType: number;
|
|
757
|
+
buttonStyle: number;
|
|
758
|
+
cornerRadius?: number;
|
|
759
|
+
onPress: () => void;
|
|
760
|
+
style?: ViewStyle;
|
|
761
|
+
testID?: string;
|
|
762
|
+
accessibilityState?: {
|
|
763
|
+
disabled?: boolean;
|
|
764
|
+
busy?: boolean;
|
|
765
|
+
};
|
|
766
|
+
}>;
|
|
767
|
+
AppleAuthenticationButtonType: {
|
|
768
|
+
SIGN_IN: number;
|
|
769
|
+
CONTINUE: number;
|
|
770
|
+
SIGN_UP: number;
|
|
771
|
+
};
|
|
772
|
+
AppleAuthenticationButtonStyle: {
|
|
773
|
+
BLACK: number;
|
|
774
|
+
WHITE: number;
|
|
775
|
+
WHITE_OUTLINE: number;
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
interface AppleSignInButtonProps {
|
|
779
|
+
/** `expo-apple-authentication`. */
|
|
780
|
+
apple: AppleButtonModuleLike;
|
|
781
|
+
/** Usually `() => signInWithApple(supabase, AppleAuthentication, { digest })` from `@marktiderman/genesis-supabase/native`. */
|
|
782
|
+
onPress: () => void | Promise<void>;
|
|
783
|
+
/** Apple's wording: "Sign in with Apple", "Continue with Apple" (default) or "Sign up with Apple". */
|
|
784
|
+
type?: "sign-in" | "continue" | "sign-up";
|
|
785
|
+
/** `"auto"` (default): black in light mode, white in dark, as Apple recommends. */
|
|
786
|
+
appearance?: "auto" | "black" | "white" | "white-outline";
|
|
787
|
+
/** Default 10, to sit with Genesis buttons. */
|
|
788
|
+
cornerRadius?: number;
|
|
789
|
+
/** Default 44, the recommended touch target (Apple's HIG minimum for this button is 30pt). */
|
|
790
|
+
height?: number;
|
|
791
|
+
/** Dims the button and ignores presses. It is also ignored on its own while an `onPress` promise is pending, so a second tap can't open a second sheet. */
|
|
792
|
+
disabled?: boolean;
|
|
793
|
+
testID?: string;
|
|
794
|
+
}
|
|
795
|
+
/** Apple's branded button, full width. Renders nothing off iOS. */
|
|
796
|
+
declare function AppleSignInButton({ apple, onPress, type, appearance, cornerRadius, height, disabled, testID, }: AppleSignInButtonProps): react.JSX.Element | null;
|
|
797
|
+
interface AppleProviderOptions extends Omit<AppleSignInButtonProps, "apple" | "testID"> {
|
|
798
|
+
/** `expo-apple-authentication`, or `undefined` where it isn't installed. */
|
|
799
|
+
apple: AppleButtonModuleLike | null | undefined;
|
|
800
|
+
/**
|
|
801
|
+
* The provider's `label`, used only by `AuthScreen`'s dev warning and a
|
|
802
|
+
* custom `social` slot. Apple's button draws and announces its own localized
|
|
803
|
+
* text. Default follows `type`: "Continue with Apple", "Sign in with Apple"
|
|
804
|
+
* or "Sign up with Apple".
|
|
805
|
+
*/
|
|
806
|
+
label?: string;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* A `SocialAuthProvider` (id `"apple"`) that draws Apple's button, for
|
|
810
|
+
* `AuthScreen`'s `providers`. `null` off iOS or without the module.
|
|
811
|
+
*
|
|
812
|
+
* @stability Beta
|
|
813
|
+
*/
|
|
814
|
+
declare function appleProvider({ apple, label, ...button }: AppleProviderOptions): SocialAuthProvider | null;
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Google sign-in for `AuthScreen` / `SocialAuthRow`: the provider entry,
|
|
818
|
+
* drawn as the row's outline button. Nothing here imports
|
|
819
|
+
* `@react-native-google-signin/google-signin`; sign in with
|
|
820
|
+
* `signInWithGoogle` from `@marktiderman/genesis-supabase/native`.
|
|
821
|
+
*
|
|
822
|
+
* ```tsx
|
|
823
|
+
* <AuthScreen providers={[appleProvider({ apple, onPress: onApple }), googleProvider({ onPress: onGoogle })]} … />
|
|
824
|
+
* ```
|
|
825
|
+
*
|
|
826
|
+
* Google's branding guidelines want its "G" mark on the button: pass it as
|
|
827
|
+
* `icon` (Genesis ships no Google artwork). On iOS, offer Sign in with Apple
|
|
828
|
+
* too (App Store Review Guideline 4.8); `AuthScreen` warns in development
|
|
829
|
+
* when it's missing.
|
|
830
|
+
*
|
|
831
|
+
* @stability Beta
|
|
832
|
+
*/
|
|
833
|
+
|
|
834
|
+
interface GoogleProviderOptions {
|
|
835
|
+
/** Usually `() => signInWithGoogle(supabase, GoogleOneTapSignIn, { digest })`. */
|
|
836
|
+
onPress: () => void | Promise<void>;
|
|
837
|
+
/** Default "Continue with Google", Google's own wording. */
|
|
838
|
+
label?: string;
|
|
839
|
+
/** Google's "G" mark, as the app draws it. */
|
|
840
|
+
icon?: ReactNode;
|
|
841
|
+
disabled?: boolean;
|
|
842
|
+
/** `false` (or `null`) gives `null`, so a switched-off provider goes in the list as is. Default true. */
|
|
843
|
+
enabled?: boolean | null;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* A `SocialAuthProvider` (id `"google"`) for `AuthScreen`'s `providers`, or
|
|
847
|
+
* `null` when `enabled` is false.
|
|
848
|
+
*
|
|
849
|
+
* @stability Beta
|
|
850
|
+
*/
|
|
851
|
+
declare function googleProvider({ onPress, label, icon, disabled, enabled }: GoogleProviderOptions): SocialAuthProvider | null;
|
|
460
852
|
|
|
461
|
-
export { AuthBranding, type AuthBrandingProps, AuthForm, type AuthFormProps, type AuthFormValues, AuthScreen, type AuthScreenProps, type AuthScreenSlotMap, ForgotPasswordLink, type KeyboardScrollProps, KeyboardScrollProvider, NavBarSaveButton, type NavBarSaveButtonProps, NavBarSearchBar, type NavBarSearchBarProps, NavBarTitle, type NavBarTitleProps, type NotificationItem, NotificationsPage, type NotificationsPageProps, type NotificationsPageSlotMap, type SafeAreaEdge, ScreenContainer, type ScreenContainerProps, type ScreenHeaderProps, type ScrollEdgeBehavior, SettingsPage, type SettingsPageDangerousAction, type SettingsPageProps, type SettingsPageRow, type SettingsPageSection, type SettingsPageSlotMap, SettingsSubPage, type SettingsSubPageProps, type SocialAuthProvider, SocialAuthRow, type SocialAuthRowProps, composeHeaderOptions, confirmDiscardChanges, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, useKeyboardScroll };
|
|
853
|
+
export { type AppleButtonModuleLike, type AppleProviderOptions, AppleSignInButton, type AppleSignInButtonProps, AuthBranding, type AuthBrandingProps, AuthForm, type AuthFormProps, type AuthFormValues, AuthScreen, type AuthScreenProps, type AuthScreenSlotMap, ForgotPasswordLink, type GoogleProviderOptions, type InboxItem, InboxPage, type InboxPageProps, type InboxPageSlotMap, type InboxSwipeAction, KEYBOARD_TOOLBAR_HEIGHT, type KeyboardScrollProps, KeyboardScrollProvider, type KeyboardToolbarProps, NavBarSaveButton, type NavBarSaveButtonProps, NavBarSearchBar, type NavBarSearchBarProps, NavBarTitle, type NavBarTitleProps, type NotificationItem, NotificationsPage, type NotificationsPageProps, type NotificationsPageSlotMap, type SafeAreaEdge, ScreenContainer, type ScreenContainerProps, type ScreenHeaderProps, type ScrollEdgeBehavior, SettingsPage, type SettingsPageDangerousAction, type SettingsPageProps, type SettingsPageRow, type SettingsPageSection, type SettingsPageSlotMap, SettingsSubPage, type SettingsSubPageProps, type SocialAuthProvider, SocialAuthRow, type SocialAuthRowProps, type ThreadAttachment, type ThreadComposer, type ThreadLabels, type ThreadMessage, ThreadPage, type ThreadPageProps, type ThreadPageSlotMap, appleProvider, composeHeaderOptions, confirmDiscardChanges, defaultStickyHeaderOffset, formatInboxTime, getInboxPageStackOptions, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, showInboxActions, useKeyboardScroll, useKeyboardToolbar };
|
package/dist/layouts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, KeyboardScrollProvider, NavBarSaveButton, NavBarSearchBar, NavBarTitle, NotificationsPage, ScreenContainer, SettingsPage, SettingsSubPage, SocialAuthRow, composeHeaderOptions, confirmDiscardChanges, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, useKeyboardScroll } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, InboxPage, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProvider, NavBarSaveButton, NavBarSearchBar, NavBarTitle, NotificationsPage, ScreenContainer, SettingsPage, SettingsSubPage, SocialAuthRow, ThreadPage, appleProvider, composeHeaderOptions, confirmDiscardChanges, defaultStickyHeaderOffset, formatInboxTime, getInboxPageStackOptions, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, showInboxActions, useKeyboardScroll, useKeyboardToolbar } from '../chunk-FZY2IXOX.js';
|
|
2
|
+
import '../chunk-ERHGCWTY.js';
|
|
3
|
+
import '../chunk-EFXCJ5AN.js';
|
|
4
4
|
import '../chunk-Z3AQYVUA.js';
|
|
5
5
|
import '../chunk-OHZD7KRO.js';
|
|
6
6
|
import '../chunk-DGUM43GV.js';
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import { ColorValue } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The semantic icon names Genesis components ask for, and the SF Symbol each
|
|
7
|
+
* one draws on iOS. Components say "settings" or "bell", never a library's
|
|
8
|
+
* own name; `lucideIcons` (`/icons/lucide`) maps the same names for Android,
|
|
9
|
+
* web and the SF Symbol fallback.
|
|
10
|
+
*
|
|
11
|
+
* @stability Beta
|
|
12
|
+
*/
|
|
13
|
+
declare const SF_SYMBOLS: {
|
|
14
|
+
readonly "arrow-left": "arrow.left";
|
|
15
|
+
readonly bell: "bell";
|
|
16
|
+
readonly calendar: "calendar";
|
|
17
|
+
readonly check: "checkmark";
|
|
18
|
+
readonly "chevron-down": "chevron.down";
|
|
19
|
+
readonly "chevron-left": "chevron.left";
|
|
20
|
+
readonly "chevron-right": "chevron.right";
|
|
21
|
+
readonly "chevron-up": "chevron.up";
|
|
22
|
+
readonly clock: "clock";
|
|
23
|
+
readonly close: "xmark";
|
|
24
|
+
readonly edit: "pencil";
|
|
25
|
+
readonly error: "xmark.circle";
|
|
26
|
+
readonly "external-link": "arrow.up.right.square";
|
|
27
|
+
readonly filter: "line.3.horizontal.decrease";
|
|
28
|
+
readonly heart: "heart";
|
|
29
|
+
readonly home: "house";
|
|
30
|
+
readonly info: "info.circle";
|
|
31
|
+
readonly lock: "lock";
|
|
32
|
+
readonly "log-out": "rectangle.portrait.and.arrow.right";
|
|
33
|
+
readonly mail: "envelope";
|
|
34
|
+
readonly menu: "line.3.horizontal";
|
|
35
|
+
readonly minus: "minus";
|
|
36
|
+
readonly more: "ellipsis";
|
|
37
|
+
readonly plus: "plus";
|
|
38
|
+
readonly refresh: "arrow.clockwise";
|
|
39
|
+
readonly search: "magnifyingglass";
|
|
40
|
+
readonly settings: "gearshape";
|
|
41
|
+
readonly share: "square.and.arrow.up";
|
|
42
|
+
readonly star: "star";
|
|
43
|
+
readonly success: "checkmark.circle";
|
|
44
|
+
readonly trash: "trash";
|
|
45
|
+
readonly user: "person";
|
|
46
|
+
readonly warning: "exclamationmark.triangle";
|
|
47
|
+
};
|
|
48
|
+
/** A semantic icon name: what the icon is for. */
|
|
49
|
+
type NativeIconName = keyof typeof SF_SYMBOLS;
|
|
50
|
+
/** Every semantic icon name. */
|
|
51
|
+
declare const NATIVE_ICON_NAMES: NativeIconName[];
|
|
52
|
+
|
|
53
|
+
/** The FlatList props Genesis lists pass; FlashList v2 takes the same ones. */
|
|
54
|
+
interface GenesisListProps<T> {
|
|
55
|
+
data: readonly T[];
|
|
56
|
+
renderItem: (info: {
|
|
57
|
+
item: T;
|
|
58
|
+
index: number;
|
|
59
|
+
}) => ReactNode;
|
|
60
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
61
|
+
getItemType?: (item: T, index: number) => string | number | undefined;
|
|
62
|
+
stickyHeaderIndices?: number[];
|
|
63
|
+
/** FlashList v2's: `offset` moves sticky headers down from the list's top (under a native header). */
|
|
64
|
+
stickyHeaderConfig?: {
|
|
65
|
+
offset?: number;
|
|
66
|
+
};
|
|
67
|
+
ListHeaderComponent?: ReactNode | ComponentType<unknown> | null;
|
|
68
|
+
ListEmptyComponent?: ReactNode | ComponentType<unknown> | null;
|
|
69
|
+
contentContainerStyle?: Record<string, unknown>;
|
|
70
|
+
refreshing?: boolean;
|
|
71
|
+
onRefresh?: () => void;
|
|
72
|
+
refreshControl?: ReactNode;
|
|
73
|
+
testID?: string;
|
|
74
|
+
}
|
|
75
|
+
/** `FlashList` from `@shopify/flash-list` v2 (New Architecture only; no `estimatedItemSize`). */
|
|
76
|
+
type GenesisListComponent = ComponentType<GenesisListProps<any>>;
|
|
77
|
+
/** The expo-image `Image` props Genesis passes. */
|
|
78
|
+
interface GenesisImageProps {
|
|
79
|
+
source: {
|
|
80
|
+
uri: string;
|
|
81
|
+
} | number | null;
|
|
82
|
+
style?: unknown;
|
|
83
|
+
contentFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
84
|
+
cachePolicy?: "none" | "disk" | "memory" | "memory-disk";
|
|
85
|
+
placeholder?: unknown;
|
|
86
|
+
placeholderContentFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
87
|
+
transition?: number | null;
|
|
88
|
+
recyclingKey?: string | null;
|
|
89
|
+
priority?: "low" | "normal" | "high" | null;
|
|
90
|
+
onError?: (event: unknown) => void;
|
|
91
|
+
onLoad?: (event: unknown) => void;
|
|
92
|
+
accessible?: boolean;
|
|
93
|
+
accessibilityLabel?: string;
|
|
94
|
+
testID?: string;
|
|
95
|
+
}
|
|
96
|
+
/** `Image` from `expo-image`. */
|
|
97
|
+
type GenesisImageComponent = ComponentType<GenesisImageProps>;
|
|
98
|
+
/** `import * as Reanimated from "react-native-reanimated"` (v4). Only what Genesis calls is listed. */
|
|
99
|
+
interface GenesisReanimatedModule {
|
|
100
|
+
default: {
|
|
101
|
+
View: ComponentType<any>;
|
|
102
|
+
};
|
|
103
|
+
useSharedValue: <V>(initial: V) => {
|
|
104
|
+
value: V;
|
|
105
|
+
};
|
|
106
|
+
useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;
|
|
107
|
+
withTiming: (toValue: number, config?: {
|
|
108
|
+
duration?: number;
|
|
109
|
+
easing?: unknown;
|
|
110
|
+
reduceMotion?: unknown;
|
|
111
|
+
}, callback?: (finished?: boolean) => void) => number;
|
|
112
|
+
withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;
|
|
113
|
+
cancelAnimation: (value: {
|
|
114
|
+
value: unknown;
|
|
115
|
+
}) => void;
|
|
116
|
+
Easing: {
|
|
117
|
+
inOut: (easing: unknown) => unknown;
|
|
118
|
+
ease: unknown;
|
|
119
|
+
out: (easing: unknown) => unknown;
|
|
120
|
+
cubic: unknown;
|
|
121
|
+
};
|
|
122
|
+
ReduceMotion?: {
|
|
123
|
+
System: unknown;
|
|
124
|
+
Always: unknown;
|
|
125
|
+
Never: unknown;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** `import * as GlassEffect from "expo-glass-effect"`. */
|
|
129
|
+
interface GenesisGlassModule {
|
|
130
|
+
GlassView: ComponentType<{
|
|
131
|
+
style?: unknown;
|
|
132
|
+
glassEffectStyle?: "regular" | "clear" | "none";
|
|
133
|
+
tintColor?: string;
|
|
134
|
+
isInteractive?: boolean;
|
|
135
|
+
colorScheme?: "auto" | "light" | "dark";
|
|
136
|
+
children?: ReactNode;
|
|
137
|
+
testID?: string;
|
|
138
|
+
pointerEvents?: "box-none" | "none" | "box-only" | "auto";
|
|
139
|
+
}>;
|
|
140
|
+
isLiquidGlassAvailable: () => boolean;
|
|
141
|
+
isGlassEffectAPIAvailable: () => boolean;
|
|
142
|
+
}
|
|
143
|
+
/** The expo-symbols `SymbolView` props Genesis passes. */
|
|
144
|
+
interface GenesisSymbolProps {
|
|
145
|
+
name: string;
|
|
146
|
+
size?: number;
|
|
147
|
+
tintColor?: ColorValue;
|
|
148
|
+
type?: "monochrome" | "hierarchical" | "palette" | "multicolor";
|
|
149
|
+
weight?: string;
|
|
150
|
+
fallback?: ReactNode;
|
|
151
|
+
style?: unknown;
|
|
152
|
+
accessible?: boolean;
|
|
153
|
+
accessibilityLabel?: string;
|
|
154
|
+
testID?: string;
|
|
155
|
+
}
|
|
156
|
+
/** `SymbolView` from `expo-symbols`. */
|
|
157
|
+
type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;
|
|
158
|
+
/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */
|
|
159
|
+
type GenesisIconComponent = ComponentType<{
|
|
160
|
+
size?: number;
|
|
161
|
+
color?: ColorValue;
|
|
162
|
+
strokeWidth?: number;
|
|
163
|
+
testID?: string;
|
|
164
|
+
}>;
|
|
165
|
+
/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */
|
|
166
|
+
type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;
|
|
167
|
+
/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */
|
|
168
|
+
interface GenesisDatePickerProps {
|
|
169
|
+
value: Date;
|
|
170
|
+
mode: "date" | "time";
|
|
171
|
+
display?: "default" | "compact" | "spinner" | "inline";
|
|
172
|
+
presentation?: "inline" | "dialog";
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
onValueChange?: (event: unknown, date: Date) => void;
|
|
175
|
+
onDismiss?: () => void;
|
|
176
|
+
style?: unknown;
|
|
177
|
+
testID?: string;
|
|
178
|
+
}
|
|
179
|
+
/** The default export of `@expo/ui/community/datetime-picker`. */
|
|
180
|
+
type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;
|
|
181
|
+
/** Every optional native module Genesis components can use. Each is optional on its own. */
|
|
182
|
+
interface GenesisModules {
|
|
183
|
+
list?: GenesisListComponent;
|
|
184
|
+
image?: GenesisImageComponent;
|
|
185
|
+
reanimated?: GenesisReanimatedModule;
|
|
186
|
+
glass?: GenesisGlassModule;
|
|
187
|
+
symbol?: GenesisSymbolComponent;
|
|
188
|
+
icons?: GenesisIconSet;
|
|
189
|
+
datePicker?: GenesisDatePickerComponent;
|
|
190
|
+
}
|
|
191
|
+
interface GenesisModulesProviderProps {
|
|
192
|
+
modules: GenesisModules;
|
|
193
|
+
children: ReactNode;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Pass the optional native modules the app has installed. Nested providers
|
|
197
|
+
* merge: an inner one adds to or replaces what an outer one gave. Define the
|
|
198
|
+
* `modules` object once at module scope (as the starter's
|
|
199
|
+
* `src/lib/native-modules.ts` does): a new inline object on every render
|
|
200
|
+
* re-renders every component that reads it.
|
|
201
|
+
*/
|
|
202
|
+
declare function GenesisModulesProvider({ modules, children }: GenesisModulesProviderProps): react.FunctionComponentElement<react.ProviderProps<GenesisModules>>;
|
|
203
|
+
/** The modules given to the nearest `GenesisModulesProvider`; `{}` without one. */
|
|
204
|
+
declare function useGenesisModules(): GenesisModules;
|
|
205
|
+
|
|
206
|
+
export { type GenesisDatePickerComponent as G, NATIVE_ICON_NAMES as N, SF_SYMBOLS as S, type GenesisDatePickerProps as a, type GenesisGlassModule as b, type GenesisIconComponent as c, type GenesisIconSet as d, type GenesisImageComponent as e, type GenesisImageProps as f, type GenesisListComponent as g, type GenesisListProps as h, type GenesisModules as i, GenesisModulesProvider as j, type GenesisModulesProviderProps as k, type GenesisReanimatedModule as l, type GenesisSymbolComponent as m, type GenesisSymbolProps as n, type NativeIconName as o, useGenesisModules as u };
|