@marktiderman/genesis-ui-native 2.2.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 +82 -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-2WCXMJL6.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 +142 -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 +320 -4
- 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/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__/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/auth-screen.tsx +6 -3
- package/src/layouts/google-sign-in.tsx +42 -0
- package/src/layouts/inbox-page.tsx +408 -0
- package/src/layouts/index.ts +37 -2
- package/src/layouts/keyboard.tsx +61 -9
- package/src/layouts/notifications-page.tsx +133 -16
- 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-2WCXMJL6.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-FZTUSM56.js +0 -935
- package/dist/chunk-FZTUSM56.js.map +0 -1
- package/dist/chunk-TXJT55JC.js.map +0 -1
- package/dist/chunk-ULS7I6ZS.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,6 +3,62 @@
|
|
|
3
3
|
Genesis React Native components and screen layouts for Expo apps (NativeWind). Every component
|
|
4
4
|
is listed in the [component reference](https://github.com/marktiderman/genesis/blob/main/docs/component-reference.md).
|
|
5
5
|
|
|
6
|
+
## Optional native modules
|
|
7
|
+
|
|
8
|
+
Some components draw better with a native module your app may or may not have. This package never
|
|
9
|
+
`require()`s one itself: you import what you installed and pass it once, near the root, and every
|
|
10
|
+
component falls back to plain React Native for whatever you leave out. (`GenesisNativeApp` from
|
|
11
|
+
`@marktiderman/genesis-native` takes the same object as its `modules` prop.)
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import DateTimePicker from "@expo/ui/community/datetime-picker";
|
|
15
|
+
import { FlashList } from "@shopify/flash-list";
|
|
16
|
+
import * as GlassEffect from "expo-glass-effect";
|
|
17
|
+
import { Image } from "expo-image";
|
|
18
|
+
import { SymbolView } from "expo-symbols";
|
|
19
|
+
import * as Reanimated from "react-native-reanimated";
|
|
20
|
+
import { GenesisModulesProvider } from "@marktiderman/genesis-ui-native";
|
|
21
|
+
import { lucideIcons } from "@marktiderman/genesis-ui-native/icons/lucide";
|
|
22
|
+
|
|
23
|
+
<GenesisModulesProvider
|
|
24
|
+
modules={{ list: FlashList, image: Image, reanimated: Reanimated, glass: GlassEffect,
|
|
25
|
+
symbol: SymbolView, icons: lucideIcons, datePicker: DateTimePicker }}
|
|
26
|
+
>
|
|
27
|
+
{app}
|
|
28
|
+
</GenesisModulesProvider>;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| `modules.` | Package (`npx expo install …`) | Used by | Without it |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| `list` | `@shopify/flash-list` v2 (New Architecture only) | `NativeResourcePage`, `NotificationsPage` (sections become one list with sticky headers) | `FlatList` / `SectionList` |
|
|
34
|
+
| `image` | `expo-image` | `NativeAvatar`, `NativeImage`: memory and disk cache, `placeholder` (blurhash / thumbhash), `recyclingKey` (the URL by default) so recycled rows never flash the last picture, no cross-fade under Reduce Motion | React Native `Image` |
|
|
35
|
+
| `reanimated` | `react-native-reanimated` 4 (`import * as`) | `NativeToastProvider`, `NativeDrawer`, `NativeSkeleton`; all of them stay still under Reduce Motion | React Native `Animated` |
|
|
36
|
+
| `glass` | `expo-glass-effect` (`import * as`) | `NativeGlassSurface`: default toasts, the update banner, popovers and dropdown menus, as iOS 26 Liquid Glass | the solid surface |
|
|
37
|
+
| `symbol` | `expo-symbols` | `NativeIcon` on iOS (SF Symbols), and the drill-in chevron of `NativeListItem` | `icons` |
|
|
38
|
+
| `icons` | `lucide-react-native` 0.475+, through `lucideIcons` from `/icons/lucide` | `NativeIcon` on Android and web, and as the SF Symbol's fallback | an empty space of the icon's size, and a development warning |
|
|
39
|
+
| `datePicker` | `@expo/ui` (`@expo/ui/community/datetime-picker`) | `NativeDatePicker`, `NativeTimePicker`: SwiftUI on iOS, a Jetpack Compose dialog on Android | `@react-native-community/datetimepicker`, else a read-only label |
|
|
40
|
+
|
|
41
|
+
Glass is drawn only on iOS when both `isLiquidGlassAvailable()` (built with the iOS 26 SDK, running
|
|
42
|
+
iOS 26) and `isGlassEffectAPIAvailable()` (the API exists at run time) are true, and Reduce
|
|
43
|
+
Transparency is off. Success and destructive toasts keep their solid color, which carries their
|
|
44
|
+
meaning.
|
|
45
|
+
|
|
46
|
+
`NativeIcon` takes a semantic name (`"settings"`, `"bell"`, `"trash"`: `NATIVE_ICON_NAMES`), never a
|
|
47
|
+
library's own. It is decorative (hidden from screen readers) unless you give it a `label`.
|
|
48
|
+
|
|
49
|
+
**Gesture handler.** No component here needs `react-native-gesture-handler` except `NativeSheet`
|
|
50
|
+
when it draws with `@gorhom/bottom-sheet`. If you use that, install `react-native-gesture-handler`
|
|
51
|
+
as a direct dependency of your app (`npx expo install react-native-gesture-handler`) and wrap the
|
|
52
|
+
root in its `GestureHandlerRootView`; don't rely on another package bringing it in. The drawer's
|
|
53
|
+
swipe uses React Native's `PanResponder`.
|
|
54
|
+
|
|
55
|
+
## Keyboard toolbar
|
|
56
|
+
|
|
57
|
+
`KeyboardScrollProvider` (from `/layouts`) takes an optional `toolbar`: react-native-keyboard-controller's
|
|
58
|
+
`KeyboardToolbar`. With it, `AuthScreen` and `SettingsSubPage` show the previous / next / done bar
|
|
59
|
+
above the keyboard and keep the focused field clear of it. It needs the scroll view (`component`)
|
|
60
|
+
and the library's `KeyboardProvider`; `GenesisNativeApp` takes it as `keyboardToolbar`.
|
|
61
|
+
|
|
6
62
|
## Sign-in: `AuthScreen` and Sign in with Apple
|
|
7
63
|
|
|
8
64
|
`AuthScreen` (from `@marktiderman/genesis-ui-native/layouts`) is a whole sign-in screen: branding,
|
|
@@ -38,6 +94,10 @@ import { AuthScreen, appleProvider } from "@marktiderman/genesis-ui-native/layou
|
|
|
38
94
|
- **`AppleSignInButton`**: the same button on its own, for a screen you compose yourself. While an
|
|
39
95
|
`onPress` promise is pending it ignores further taps (so a double tap can't open a second sheet)
|
|
40
96
|
and reports itself busy and disabled to accessibility; `disabled` does the same and dims it.
|
|
97
|
+
- **`googleProvider({ onPress, label?, icon?, disabled?, enabled? })`**: a provider with id
|
|
98
|
+
`"google"` ("Continue with Google"), drawn as the row's outline button, or `null` when `enabled`
|
|
99
|
+
is false. Pass Google's "G" mark as `icon` (Genesis ships no Google artwork). `onPress` is
|
|
100
|
+
usually `signInWithGoogle` from `@marktiderman/genesis-supabase/native`.
|
|
41
101
|
- **`SocialAuthProvider.render`**: any provider can draw its own button this way.
|
|
42
102
|
- `onPress` is usually `signInWithApple` from `@marktiderman/genesis-supabase/native`, which
|
|
43
103
|
returns the full name Apple shares on the first sign-in only; save it with
|
|
@@ -49,4 +109,26 @@ import { AuthScreen, appleProvider } from "@marktiderman/genesis-ui-native/layou
|
|
|
49
109
|
asks with `Alert.alert` (a destructive button) and then calls `deleteMyAccount(supabase)` from
|
|
50
110
|
`@marktiderman/genesis-supabase`. The example and the SQL it needs are in that package's README.
|
|
51
111
|
|
|
112
|
+
## Inbox and thread: `InboxPage` and `ThreadPage`
|
|
113
|
+
|
|
114
|
+
Two generic layouts for conversations (support tickets, direct messages, comment threads), in
|
|
115
|
+
`SettingsPage`'s iOS inset grouped style.
|
|
116
|
+
|
|
117
|
+
- **`InboxPage`**: rows with an unread dot or count, a short time (`9:41`, `Yesterday`, a
|
|
118
|
+
weekday, a date), a two-line preview and a status line; pull to refresh, `onEndReached` paging
|
|
119
|
+
and an empty state with an optional action. Each row's `swipeActions` are always reachable as
|
|
120
|
+
VoiceOver / TalkBack custom actions and on long press (a menu); for the swipe gesture itself,
|
|
121
|
+
fill the `swipeable` slot with react-native-gesture-handler's `ReanimatedSwipeable`. Slots:
|
|
122
|
+
`row`, `swipeable`, `header`, `footer`, `empty`.
|
|
123
|
+
- **`ThreadPage`**: messages oldest first (mine trailing in the tint, theirs leading on
|
|
124
|
+
`surface`), attachments, a read receipt under my newest message the other side has read
|
|
125
|
+
(`readAt`), "load earlier", optimistic `sending` and `failed` messages with retry, and a
|
|
126
|
+
composer. With `KeyboardScrollProvider` (the native shell's `keyboardScroll`) the messages and
|
|
127
|
+
the composer scroll together above the keyboard; without it a `KeyboardAvoidingView` does.
|
|
128
|
+
`composer={null}` makes it read-only with a `closedNotice`. Slots: `message`, `attachment`,
|
|
129
|
+
`readReceipt`, `composer`, `composerAccessory`, `header`, `earlier`, `empty`.
|
|
130
|
+
|
|
131
|
+
`getInboxPageStackOptions()` and `getThreadPageStackOptions()` compose the header.
|
|
132
|
+
`@marktiderman/genesis-support/native` feeds both for a person's support reports.
|
|
133
|
+
|
|
52
134
|
Part of the [Genesis framework](https://github.com/marktiderman/genesis).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { AccessibilityInfo } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// src/hooks/use-reduced-motion.ts
|
|
5
|
+
var lastKnown = false;
|
|
6
|
+
function useReducedMotion() {
|
|
7
|
+
const [reduced, setReduced] = useState(lastKnown);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
let mounted = true;
|
|
10
|
+
const set = (v) => {
|
|
11
|
+
lastKnown = v;
|
|
12
|
+
if (mounted) setReduced(v);
|
|
13
|
+
};
|
|
14
|
+
AccessibilityInfo.isReduceMotionEnabled().then(set).catch(() => {
|
|
15
|
+
});
|
|
16
|
+
const sub = AccessibilityInfo.addEventListener("reduceMotionChanged", set);
|
|
17
|
+
return () => {
|
|
18
|
+
mounted = false;
|
|
19
|
+
sub?.remove?.();
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
return reduced;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { useReducedMotion };
|
|
26
|
+
//# sourceMappingURL=chunk-7PCWEY6R.js.map
|
|
27
|
+
//# sourceMappingURL=chunk-7PCWEY6R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-reduced-motion.ts"],"names":[],"mappings":";;;;AAgBA,IAAI,SAAA,GAAY,KAAA;AAOT,SAAS,gBAAA,GAA4B;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,SAAS,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAA,GAAU,IAAA;AACd,IAAA,MAAM,GAAA,GAAM,CAAC,CAAA,KAAe;AAC1B,MAAA,SAAA,GAAY,CAAA;AACZ,MAAA,IAAI,OAAA,aAAoB,CAAC,CAAA;AAAA,IAC3B,CAAA;AACA,IAAA,iBAAA,CAAkB,uBAAsB,CACrC,IAAA,CAAK,GAAG,CAAA,CAGR,MAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AACjB,IAAA,MAAM,GAAA,GAAM,iBAAA,CAAkB,gBAAA,CAAiB,qBAAA,EAAuB,GAAG,CAAA;AACzE,IAAA,OAAO,MAAM;AACX,MAAA,OAAA,GAAU,KAAA;AACV,MAAA,GAAA,EAAK,MAAA,IAAS;AAAA,IAChB,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,OAAA;AACT","file":"chunk-7PCWEY6R.js","sourcesContent":["/**\n * useReducedMotion — subscribe to the OS reduce-motion preference.\n *\n * Returns `true` when the user has enabled reduce-motion at the OS level,\n * and follows the setting while the app runs (Reanimated's own hook reads it\n * once at launch). Components that animate (Sheet, Drawer, Toast, Skeleton)\n * honor it by skipping non-essential transitions and snapping into the\n * final state.\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\n\n// The last answer anyone got: a component mounting later (a toast, an open\n// drawer) starts from it instead of animating for a frame before it hears.\nlet lastKnown = false;\n\n/** Tests only: forget the last answer. Not exported from the package. */\nexport function __resetReducedMotion() {\n lastKnown = false;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(lastKnown);\n\n useEffect(() => {\n let mounted = true;\n const set = (v: boolean) => {\n lastKnown = v;\n if (mounted) setReduced(v);\n };\n AccessibilityInfo.isReduceMotionEnabled()\n .then(set)\n // Some runtimes (web, older Android) reject when the accessibility\n // manager isn't wired up: treat that as \"no preference\".\n .catch(() => {});\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", set);\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n\n return reduced;\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createContext, createElement, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-genesis-extension.ts
|
|
4
|
+
var BrandExtensionsContext = createContext(
|
|
5
|
+
void 0
|
|
6
|
+
);
|
|
7
|
+
function BrandExtensionsProvider({
|
|
8
|
+
value,
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
11
|
+
return createElement(
|
|
12
|
+
BrandExtensionsContext.Provider,
|
|
13
|
+
{ value },
|
|
14
|
+
children
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function useGenesisExtension(key) {
|
|
18
|
+
const ctx = useContext(BrandExtensionsContext);
|
|
19
|
+
return ctx?.[key];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { BrandExtensionsProvider, useGenesisExtension };
|
|
23
|
+
//# sourceMappingURL=chunk-D5RKSPMH.js.map
|
|
24
|
+
//# sourceMappingURL=chunk-D5RKSPMH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-genesis-extension.ts"],"names":[],"mappings":";;;AAkDA,IAAM,sBAAA,GAAyB,aAAA;AAAA,EAC7B;AACF,CAAA;AAOO,SAAS,uBAAA,CAAwB;AAAA,EACtC,KAAA;AAAA,EACA;AACF,CAAA,EAAiC;AAC/B,EAAA,OAAO,aAAA;AAAA,IACL,sBAAA,CAAuB,QAAA;AAAA,IACvB,EAAE,KAAA,EAAM;AAAA,IACR;AAAA,GACF;AACF;AAOO,SAAS,oBACd,GAAA,EACgC;AAChC,EAAA,MAAM,GAAA,GAAM,WAAW,sBAAsB,CAAA;AAC7C,EAAA,OAAO,MAAM,GAAG,CAAA;AAClB","file":"chunk-D5RKSPMH.js","sourcesContent":["/**\n * useGenesisExtension — read a brand-package `extensions[<key>]` token scale.\n *\n * Brand packages declare domain-specific token categories under the\n * `extensions` slot of the canonical schema (PRD-07 D8 design decision).\n * Genesis primitives don't read these — only consumer composites do — so\n * this hook is the canonical accessor.\n *\n * Resolution order:\n * 1. `BrandExtensionsContext` value (set via <BrandExtensionsProvider>)\n * 2. `undefined` — the extension key isn't declared\n *\n * Consumers wire the provider once at app root; calls anywhere downstream\n * read by key.\n *\n * <BrandExtensionsProvider value={brand.extensions}>\n * <App />\n * </BrandExtensionsProvider>\n *\n * const moodTokens = useGenesisExtension(\"mood\");\n * // moodTokens?.[500] etc. — shape is consumer-defined\n *\n * Type contract: the canonical `BrandExtensions` interface lives in\n * `@marktiderman/genesis-design-system` (declaration-merging surface). At\n * runtime, consumers may pass a partially-populated object whose keys\n * match their own augmented `BrandExtensions`. We intentionally accept\n * `Partial<BrandExtensions>` here so the provider works with brand\n * packages that haven't declared extensions yet (a common case in newly\n * scaffolded apps).\n *\n * @stability Beta\n */\nimport {\n createContext,\n createElement,\n useContext,\n type ReactNode,\n} from \"react\";\nimport type { BrandExtensions } from \"@marktiderman/genesis-design-system\";\n\n/**\n * Runtime shape passed to `<BrandExtensionsProvider>`. Consumers augment\n * the canonical `BrandExtensions` interface (in design-system) via TS\n * declaration merging; the provider accepts the resulting record.\n *\n * `Partial<>` so brand packages that have no extensions can still wrap\n * their app in the provider without TS errors.\n */\nexport type BrandExtensionsValue = Partial<BrandExtensions>;\n\nconst BrandExtensionsContext = createContext<BrandExtensionsValue | undefined>(\n undefined,\n);\n\nexport interface BrandExtensionsProviderProps {\n value?: BrandExtensionsValue;\n children: ReactNode;\n}\n\nexport function BrandExtensionsProvider({\n value,\n children,\n}: BrandExtensionsProviderProps) {\n return createElement(\n BrandExtensionsContext.Provider,\n { value },\n children,\n );\n}\n\n/**\n * Read an extension scale by key. Returns `undefined` when the provider\n * isn't mounted OR when the key isn't declared on the brand. The return\n * type follows the consumer's augmented `BrandExtensions[K]`.\n */\nexport function useGenesisExtension<K extends keyof BrandExtensions>(\n key: K,\n): BrandExtensions[K] | undefined {\n const ctx = useContext(BrandExtensionsContext);\n return ctx?.[key];\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import { cn } from './chunk-OHZD7KRO.js';
|
|
|
2
2
|
import { cva } from 'class-variance-authority';
|
|
3
3
|
import { Text, Pressable, ActivityIndicator, View, TextInput } from 'react-native';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import { createContext, useContext, useMemo, createElement } from 'react';
|
|
5
6
|
import { nativeColors } from '@marktiderman/genesis-design-system/tokens/native';
|
|
6
7
|
|
|
7
8
|
var textVariants = cva("text-foreground", {
|
|
@@ -126,6 +127,78 @@ function NativeButton({
|
|
|
126
127
|
}
|
|
127
128
|
);
|
|
128
129
|
}
|
|
130
|
+
var EMPTY = Object.freeze({});
|
|
131
|
+
var GenesisModulesContext = createContext(EMPTY);
|
|
132
|
+
function GenesisModulesProvider({ modules, children }) {
|
|
133
|
+
const outer = useContext(GenesisModulesContext);
|
|
134
|
+
const value = useMemo(() => outer === EMPTY ? modules : { ...outer, ...modules }, [outer, modules]);
|
|
135
|
+
return createElement(GenesisModulesContext.Provider, { value }, children);
|
|
136
|
+
}
|
|
137
|
+
function useGenesisModules() {
|
|
138
|
+
return useContext(GenesisModulesContext);
|
|
139
|
+
}
|
|
140
|
+
var badgeVariants = cva(
|
|
141
|
+
"flex-row items-center self-start rounded-full border px-2.5 py-0.5",
|
|
142
|
+
{
|
|
143
|
+
variants: {
|
|
144
|
+
variant: {
|
|
145
|
+
default: "border-transparent bg-primary",
|
|
146
|
+
secondary: "border-transparent bg-secondary",
|
|
147
|
+
destructive: "border-transparent bg-destructive",
|
|
148
|
+
outline: "border-border bg-transparent",
|
|
149
|
+
success: "border-transparent bg-success/15",
|
|
150
|
+
warning: "border-transparent bg-warning/15",
|
|
151
|
+
info: "border-transparent bg-info/15",
|
|
152
|
+
muted: "border-transparent bg-muted"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
defaultVariants: {
|
|
156
|
+
variant: "default"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
var badgeTextVariants = cva("text-xs font-medium", {
|
|
161
|
+
variants: {
|
|
162
|
+
variant: {
|
|
163
|
+
default: "text-primary-foreground",
|
|
164
|
+
secondary: "text-secondary-foreground",
|
|
165
|
+
destructive: "text-destructive-foreground",
|
|
166
|
+
outline: "text-foreground",
|
|
167
|
+
// AA-safe status text on the /15 tint. The bare status token
|
|
168
|
+
// (text-success ~2.2:1) fails WCAG AA. The `-dark` stop is optional in
|
|
169
|
+
// the brand schema (only `status.*.DEFAULT` is required) AND regresses
|
|
170
|
+
// dark mode — a dark shade on the dark-surface tint drops to ~1.7–2.6:1.
|
|
171
|
+
// Instead use the semantic Tailwind ramp (always present, brand-
|
|
172
|
+
// independent, same hues as the Genesis status tokens) with a `dark:`
|
|
173
|
+
// stop. Measured: light /15 tint emerald-700 4.76 / amber-800 6.32 /
|
|
174
|
+
// blue-700 5.64; dark-surface tint emerald-300 ≥8.2 / amber-200 ≥10.8 /
|
|
175
|
+
// blue-300 ≥8.2 — AA in both modes across the static preset and the
|
|
176
|
+
// themeFromBrand() runtime dark map.
|
|
177
|
+
success: "text-emerald-700 dark:text-emerald-300",
|
|
178
|
+
warning: "text-amber-800 dark:text-amber-200",
|
|
179
|
+
info: "text-blue-700 dark:text-blue-300",
|
|
180
|
+
muted: "text-muted-foreground"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
defaultVariants: {
|
|
184
|
+
variant: "default"
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
function NativeBadge({
|
|
188
|
+
className,
|
|
189
|
+
textClassName,
|
|
190
|
+
variant,
|
|
191
|
+
children,
|
|
192
|
+
...props
|
|
193
|
+
}) {
|
|
194
|
+
return /* @__PURE__ */ jsx(View, { className: cn(badgeVariants({ variant }), className), accessibilityRole: "text", ...props, children: typeof children === "string" ? /* @__PURE__ */ jsx(
|
|
195
|
+
Text,
|
|
196
|
+
{
|
|
197
|
+
className: cn(badgeTextVariants({ variant }), textClassName),
|
|
198
|
+
children
|
|
199
|
+
}
|
|
200
|
+
) : children });
|
|
201
|
+
}
|
|
129
202
|
function NativeInput({
|
|
130
203
|
className,
|
|
131
204
|
inputClassName,
|
|
@@ -156,6 +229,6 @@ function NativeInput({
|
|
|
156
229
|
] });
|
|
157
230
|
}
|
|
158
231
|
|
|
159
|
-
export { NativeButton, NativeInput, NativeText, buttonTextVariants, buttonVariants, textVariants };
|
|
160
|
-
//# sourceMappingURL=chunk-
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
232
|
+
export { GenesisModulesProvider, NativeBadge, NativeButton, NativeInput, NativeText, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, textVariants, useGenesisModules };
|
|
233
|
+
//# sourceMappingURL=chunk-EFXCJ5AN.js.map
|
|
234
|
+
//# sourceMappingURL=chunk-EFXCJ5AN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/text.tsx","../src/components/button.tsx","../src/native-modules.tsx","../src/components/badge.tsx","../src/components/input.tsx"],"names":["RNText","cva","jsx","Text","jsxs","View"],"mappings":";;;;;;;AASA,IAAM,YAAA,GAAe,IAAI,iBAAA,EAAmB;AAAA,EAC1C,QAAA,EAAU;AAAA,IACR,MAAA,EAAQ;AAAA,MACN,EAAA,EAAI,8BAAA;AAAA,MACJ,EAAA,EAAI,8BAAA;AAAA,MACJ,EAAA,EAAI,iCAAA;AAAA,MACJ,EAAA,EAAI,iCAAA;AAAA,MACJ,IAAA,EAAM,iCAAA;AAAA,MACN,SAAA,EAAW,+BAAA;AAAA,MACX,OAAA,EAAS,+BAAA;AAAA,MACT,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,MAAA,EAAQ;AAAA;AAEZ,CAAC;AA2BD,SAAS,UAAA,CAAW;AAAA,EAClB,SAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoB;AAClB,EAAA,uBACE,GAAA;AAAA,IAACA,IAAA;AAAA,IAAA;AAAA,MACC,WAAW,EAAA,CAAG,YAAA,CAAa,EAAE,MAAA,EAAQ,GAAG,SAAS,CAAA;AAAA,MAChD,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ;ACzDA,IAAM,cAAA,GAAiBC,GAAAA;AAAA,EACrB,iDAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,YAAA;AAAA,QACT,SAAA,EAAW,cAAA;AAAA,QACX,OAAA,EAAS,oCAAA;AAAA,QACT,KAAA,EAAO,gBAAA;AAAA,QACP,WAAA,EAAa;AAAA,OACf;AAAA,MACA,IAAA,EA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EJ;ACvEA,SAAS,WAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,cAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA,GAAW,IAAA;AAAA,EACX,oBAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAqB;AACnB,EAAA,uBACEC,KAACC,IAAAA,EAAA,EAAK,WAAW,EAAA,CAAG,SAAA,EAAW,SAAS,CAAA,EACrC,QAAA,EAAA;AAAA,IAAA,KAAA,mBACCH,GAAAA,CAACC,IAAAA,EAAA,EAAK,SAAA,EAAU,qCAAA,EACb,iBACH,CAAA,GACE,IAAA;AAAA,oBACJD,GAAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,EAAA;AAAA,UACT,kFAAA;AAAA,UACA,CAAC,QAAA,IAAY,YAAA;AAAA,UACb,KAAA,IAAS,oBAAA;AAAA,UACT;AAAA,SACF;AAAA,QACA,QAAA;AAAA,QACA,oBAAA,EAAsB,oBAAA,IAAwB,YAAA,CAAa,OAAA,CAAQ,GAAG,CAAA;AAAA,QACtE,kBAAA,EAAoB,KAAA;AAAA,QACnB,GAAG;AAAA;AAAA,KACN;AAAA,IACC,KAAA,mBACCA,GAAAA,CAACC,IAAAA,EAAA,EAAK,SAAA,EAAU,0BAAA,EAA4B,iBAAM,CAAA,GAChD;AAAA,GAAA,EACN,CAAA;AAEJ","file":"chunk-EFXCJ5AN.js","sourcesContent":["/**\n * Text — typography primitive with semantic presets (h1, h2, body, caption, etc.).\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { Text as RNText, type TextProps } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst textVariants = cva(\"text-foreground\", {\n variants: {\n preset: {\n h1: \"text-3xl font-bold leading-9\",\n h2: \"text-2xl font-bold leading-8\",\n h3: \"text-xl font-semibold leading-7\",\n h4: \"text-lg font-semibold leading-7\",\n body: \"text-base font-normal leading-6\",\n \"body-sm\": \"text-sm font-normal leading-5\",\n caption: \"text-xs font-normal leading-4\",\n label: \"text-sm font-medium leading-5\",\n },\n },\n defaultVariants: {\n preset: \"body\",\n },\n});\n\n// `className` is declared explicitly here — not inherited from react-native's\n// `TextProps` via NativeWind's global augmentation, which does not resolve across\n// the RN / nativewind / react-native-css-interop version matrix. Mirrors every\n// other ui-native primitive (Button, Tooltip, ChipGroup, …); the implementation\n// already consumes `className` below.\nexport interface NativeTextProps\n extends TextProps,\n VariantProps<typeof textVariants> {\n /** NativeWind utility class string applied to the underlying Text. */\n className?: string;\n}\n\n/**\n * Allowed `preset` values on {@link NativeText}. Re-exported as a named type\n * so consumer brand packages can build preset-driven typography APIs without\n * having to reach into `NativeTextProps['preset']` themselves.\n *\n * Example (consumer):\n * ```ts\n * import type { TextPreset } from \"@marktiderman/genesis-ui-native\";\n * function Heading({ as }: { as: TextPreset }) { ... }\n * ```\n */\nexport type TextPreset = NonNullable<NativeTextProps[\"preset\"]>;\n\nfunction NativeText({\n className,\n preset,\n children,\n ...props\n}: NativeTextProps) {\n return (\n <RNText\n className={cn(textVariants({ preset }), className)}\n {...props}\n >\n {children}\n </RNText>\n );\n}\n\nexport { NativeText, textVariants };\n","/**\n * Button — primary touch target. Variants: default, secondary, outline, ghost, destructive.\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { ActivityIndicator, Pressable, Text } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst buttonVariants = cva(\n \"flex-row items-center justify-center rounded-md\",\n {\n variants: {\n variant: {\n default: \"bg-primary\",\n secondary: \"bg-secondary\",\n outline: \"border border-input bg-transparent\",\n ghost: \"bg-transparent\",\n destructive: \"bg-destructive\",\n },\n size: {\n sm: \"h-9 px-3 gap-1.5\",\n md: \"h-10 px-4 gap-2\",\n lg: \"h-11 px-8 gap-2\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n }\n);\n\nconst buttonTextVariants = cva(\"font-medium text-center\", {\n variants: {\n variant: {\n default: \"text-primary-foreground\",\n secondary: \"text-secondary-foreground\",\n outline: \"text-foreground\",\n ghost: \"text-foreground\",\n destructive: \"text-destructive-foreground\",\n },\n size: {\n sm: \"text-sm\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\nexport interface NativeButtonProps\n extends VariantProps<typeof buttonVariants> {\n className?: string;\n textClassName?: string;\n children: React.ReactNode;\n onPress?: () => void;\n disabled?: boolean;\n loading?: boolean;\n testID?: string;\n}\n\nfunction NativeButton({\n className,\n textClassName,\n variant,\n size,\n children,\n onPress,\n disabled,\n loading,\n ...props\n}: NativeButtonProps) {\n const isDisabled = disabled || loading;\n\n return (\n <Pressable\n className={cn(\n buttonVariants({ variant, size }),\n isDisabled && \"opacity-50\",\n className\n )}\n onPress={onPress}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isDisabled, busy: loading }}\n {...props}\n >\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={\n variant === \"outline\" || variant === \"ghost\"\n ? undefined\n : \"white\"\n }\n />\n ) : null}\n {typeof children === \"string\" ? (\n <Text\n className={cn(\n buttonTextVariants({ variant, size }),\n textClassName\n )}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </Pressable>\n );\n}\n\nexport { NativeButton, buttonVariants, buttonTextVariants };\n","/**\n * GenesisModulesProvider — the native modules an app opts in to, passed in\n * once near the root. Genesis never `require()`s these itself: an app that\n * has a module installed imports it and hands it over, and every component\n * that could use it falls back to plain React Native when it isn't here.\n *\n * import { FlashList } from \"@shopify/flash-list\";\n * import { Image } from \"expo-image\";\n * import * as Reanimated from \"react-native-reanimated\";\n * import * as GlassEffect from \"expo-glass-effect\";\n * import { SymbolView } from \"expo-symbols\";\n * import DateTimePicker from \"@expo/ui/community/datetime-picker\";\n * import { lucideIcons } from \"@marktiderman/genesis-ui-native/icons/lucide\";\n *\n * // At module scope, not inline:\n * const modules = { list: FlashList, image: Image, reanimated: Reanimated, glass: GlassEffect,\n * symbol: SymbolView, icons: lucideIcons, datePicker: DateTimePicker };\n * <GenesisModulesProvider modules={modules}>…</GenesisModulesProvider>\n *\n * (`GenesisNativeApp` from `@marktiderman/genesis-native` takes the same\n * object as its `modules` prop and mounts this for you.)\n *\n * | Module | Used by | Without it |\n * | ------------------------------ | ---------------------------------------- | ----------------------------- |\n * | `list` (FlashList v2) | NativeResourcePage, NotificationsPage | FlatList / SectionList |\n * | `image` (expo-image) | NativeAvatar, NativeImage | React Native `Image` |\n * | `reanimated` (Reanimated 4) | Toast, Drawer, Skeleton | React Native `Animated` |\n * | `glass` (expo-glass-effect) | Toast, NativeGlassSurface, update banner | the solid surface |\n * | `symbol` (expo-symbols) | NativeIcon on iOS | `icons` (lucide) |\n * | `icons` (a lucide icon set) | NativeIcon on Android, web, and as the SF Symbol fallback | a blank space of the icon's size |\n * | `datePicker` (@expo/ui) | NativeDatePicker, NativeTimePicker | @react-native-community/datetimepicker |\n *\n * The props below are written structurally (no import of the optional\n * packages), so this package builds and type-checks without any of them.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { ColorValue } from \"react-native\";\nimport type { NativeIconName } from \"./icon-names\";\n\n/** The FlatList props Genesis lists pass; FlashList v2 takes the same ones. */\nexport interface GenesisListProps<T> {\n data: readonly T[];\n renderItem: (info: { item: T; index: number }) => ReactNode;\n keyExtractor?: (item: T, index: number) => string;\n getItemType?: (item: T, index: number) => string | number | undefined;\n stickyHeaderIndices?: number[];\n /** FlashList v2's: `offset` moves sticky headers down from the list's top (under a native header). */\n stickyHeaderConfig?: { offset?: number };\n ListHeaderComponent?: ReactNode | ComponentType<unknown> | null;\n ListEmptyComponent?: ReactNode | ComponentType<unknown> | null;\n contentContainerStyle?: Record<string, unknown>;\n refreshing?: boolean;\n onRefresh?: () => void;\n refreshControl?: ReactNode;\n testID?: string;\n}\n\n/** `FlashList` from `@shopify/flash-list` v2 (New Architecture only; no `estimatedItemSize`). */\nexport type GenesisListComponent = ComponentType<GenesisListProps<any>>;\n\n/** The expo-image `Image` props Genesis passes. */\nexport interface GenesisImageProps {\n source: { uri: string } | number | null;\n style?: unknown;\n contentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n cachePolicy?: \"none\" | \"disk\" | \"memory\" | \"memory-disk\";\n placeholder?: unknown;\n placeholderContentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n transition?: number | null;\n recyclingKey?: string | null;\n priority?: \"low\" | \"normal\" | \"high\" | null;\n onError?: (event: unknown) => void;\n onLoad?: (event: unknown) => void;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `Image` from `expo-image`. */\nexport type GenesisImageComponent = ComponentType<GenesisImageProps>;\n\n/** `import * as Reanimated from \"react-native-reanimated\"` (v4). Only what Genesis calls is listed. */\nexport interface GenesisReanimatedModule {\n default: { View: ComponentType<any> };\n useSharedValue: <V>(initial: V) => { value: V };\n useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;\n withTiming: (toValue: number, config?: { duration?: number; easing?: unknown; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;\n cancelAnimation: (value: { value: unknown }) => void;\n Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown };\n ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };\n}\n\n/** `import * as GlassEffect from \"expo-glass-effect\"`. */\nexport interface GenesisGlassModule {\n GlassView: ComponentType<{\n style?: unknown;\n glassEffectStyle?: \"regular\" | \"clear\" | \"none\";\n tintColor?: string;\n isInteractive?: boolean;\n colorScheme?: \"auto\" | \"light\" | \"dark\";\n children?: ReactNode;\n testID?: string;\n pointerEvents?: \"box-none\" | \"none\" | \"box-only\" | \"auto\";\n }>;\n isLiquidGlassAvailable: () => boolean;\n isGlassEffectAPIAvailable: () => boolean;\n}\n\n/** The expo-symbols `SymbolView` props Genesis passes. */\nexport interface GenesisSymbolProps {\n name: string;\n size?: number;\n tintColor?: ColorValue;\n type?: \"monochrome\" | \"hierarchical\" | \"palette\" | \"multicolor\";\n weight?: string;\n fallback?: ReactNode;\n style?: unknown;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `SymbolView` from `expo-symbols`. */\nexport type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;\n\n/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */\nexport type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; strokeWidth?: number; testID?: string }>;\n\n/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */\nexport type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;\n\n/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */\nexport interface GenesisDatePickerProps {\n value: Date;\n mode: \"date\" | \"time\";\n display?: \"default\" | \"compact\" | \"spinner\" | \"inline\";\n presentation?: \"inline\" | \"dialog\";\n disabled?: boolean;\n onValueChange?: (event: unknown, date: Date) => void;\n onDismiss?: () => void;\n style?: unknown;\n testID?: string;\n}\n\n/** The default export of `@expo/ui/community/datetime-picker`. */\nexport type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;\n\n/** Every optional native module Genesis components can use. Each is optional on its own. */\nexport interface GenesisModules {\n list?: GenesisListComponent;\n image?: GenesisImageComponent;\n reanimated?: GenesisReanimatedModule;\n glass?: GenesisGlassModule;\n symbol?: GenesisSymbolComponent;\n icons?: GenesisIconSet;\n datePicker?: GenesisDatePickerComponent;\n}\n\nconst EMPTY: GenesisModules = Object.freeze({});\nconst GenesisModulesContext = createContext<GenesisModules>(EMPTY);\n\nexport interface GenesisModulesProviderProps {\n modules: GenesisModules;\n children: ReactNode;\n}\n\n/**\n * Pass the optional native modules the app has installed. Nested providers\n * merge: an inner one adds to or replaces what an outer one gave. Define the\n * `modules` object once at module scope (as the starter's\n * `src/lib/native-modules.ts` does): a new inline object on every render\n * re-renders every component that reads it.\n */\nexport function GenesisModulesProvider({ modules, children }: GenesisModulesProviderProps) {\n const outer = useContext(GenesisModulesContext);\n const value = useMemo(() => (outer === EMPTY ? modules : { ...outer, ...modules }), [outer, modules]);\n return createElement(GenesisModulesContext.Provider, { value }, children);\n}\n\n/** The modules given to the nearest `GenesisModulesProvider`; `{}` without one. */\nexport function useGenesisModules(): GenesisModules {\n return useContext(GenesisModulesContext);\n}\n","/**\n * Badge — compact status / count / category tag.\n *\n * @stability Stable\n */\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nconst badgeVariants = cva(\n \"flex-row items-center self-start rounded-full border px-2.5 py-0.5\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary\",\n secondary: \"border-transparent bg-secondary\",\n destructive: \"border-transparent bg-destructive\",\n outline: \"border-border bg-transparent\",\n success: \"border-transparent bg-success/15\",\n warning: \"border-transparent bg-warning/15\",\n info: \"border-transparent bg-info/15\",\n muted: \"border-transparent bg-muted\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst badgeTextVariants = cva(\"text-xs font-medium\", {\n variants: {\n variant: {\n default: \"text-primary-foreground\",\n secondary: \"text-secondary-foreground\",\n destructive: \"text-destructive-foreground\",\n outline: \"text-foreground\",\n // AA-safe status text on the /15 tint. The bare status token\n // (text-success ~2.2:1) fails WCAG AA. The `-dark` stop is optional in\n // the brand schema (only `status.*.DEFAULT` is required) AND regresses\n // dark mode — a dark shade on the dark-surface tint drops to ~1.7–2.6:1.\n // Instead use the semantic Tailwind ramp (always present, brand-\n // independent, same hues as the Genesis status tokens) with a `dark:`\n // stop. Measured: light /15 tint emerald-700 4.76 / amber-800 6.32 /\n // blue-700 5.64; dark-surface tint emerald-300 ≥8.2 / amber-200 ≥10.8 /\n // blue-300 ≥8.2 — AA in both modes across the static preset and the\n // themeFromBrand() runtime dark map.\n success: \"text-emerald-700 dark:text-emerald-300\",\n warning: \"text-amber-800 dark:text-amber-200\",\n info: \"text-blue-700 dark:text-blue-300\",\n muted: \"text-muted-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n});\n\nexport interface NativeBadgeProps\n extends VariantProps<typeof badgeVariants> {\n className?: string;\n textClassName?: string;\n children: React.ReactNode;\n accessibilityLabel?: string;\n testID?: string;\n}\n\nfunction NativeBadge({\n className,\n textClassName,\n variant,\n children,\n ...props\n}: NativeBadgeProps) {\n return (\n <View className={cn(badgeVariants({ variant }), className)} accessibilityRole=\"text\" {...props}>\n {typeof children === \"string\" ? (\n <Text\n className={cn(badgeTextVariants({ variant }), textClassName)}\n >\n {children}\n </Text>\n ) : (\n children\n )}\n </View>\n );\n}\n\nexport { NativeBadge, badgeVariants, badgeTextVariants };\n","/**\n * Input — single-line text field.\n *\n * @stability Stable\n */\nimport { Text, TextInput, type TextInputProps, View } from \"react-native\";\nimport { nativeColors } from \"@marktiderman/genesis-design-system/tokens/native\";\nimport { cn } from \"../utils\";\n\nexport interface NativeInputProps extends TextInputProps {\n className?: string;\n inputClassName?: string;\n label?: string;\n error?: string;\n}\n\nfunction NativeInput({\n className,\n inputClassName,\n label,\n error,\n editable = true,\n placeholderTextColor,\n ...props\n}: NativeInputProps) {\n return (\n <View className={cn(\"gap-1.5\", className)}>\n {label ? (\n <Text className=\"text-sm font-medium text-foreground\">\n {label}\n </Text>\n ) : null}\n <TextInput\n className={cn(\n \"h-10 rounded-md border border-input bg-background px-3 text-base text-foreground\",\n !editable && \"opacity-50\",\n error && \"border-destructive\",\n inputClassName\n )}\n editable={editable}\n placeholderTextColor={placeholderTextColor ?? nativeColors.neutral[400]}\n accessibilityLabel={label}\n {...props}\n />\n {error ? (\n <Text className=\"text-sm text-destructive\">{error}</Text>\n ) : null}\n </View>\n );\n}\n\nexport { NativeInput };\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useGenesisModules } from './chunk-EFXCJ5AN.js';
|
|
2
|
+
import { useThemeRoles } from './chunk-Z3AQYVUA.js';
|
|
1
3
|
import { cn } from './chunk-OHZD7KRO.js';
|
|
2
|
-
import { View, Text, Pressable } from 'react-native';
|
|
4
|
+
import { View, Text, Platform, Pressable } from 'react-native';
|
|
3
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
6
|
|
|
5
7
|
var defaults = {
|
|
@@ -86,6 +88,65 @@ function NativeEmptyState({
|
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
90
|
}
|
|
91
|
+
|
|
92
|
+
// src/icon-names.ts
|
|
93
|
+
var SF_SYMBOLS = {
|
|
94
|
+
"arrow-left": "arrow.left",
|
|
95
|
+
bell: "bell",
|
|
96
|
+
calendar: "calendar",
|
|
97
|
+
check: "checkmark",
|
|
98
|
+
"chevron-down": "chevron.down",
|
|
99
|
+
"chevron-left": "chevron.left",
|
|
100
|
+
"chevron-right": "chevron.right",
|
|
101
|
+
"chevron-up": "chevron.up",
|
|
102
|
+
clock: "clock",
|
|
103
|
+
close: "xmark",
|
|
104
|
+
edit: "pencil",
|
|
105
|
+
error: "xmark.circle",
|
|
106
|
+
"external-link": "arrow.up.right.square",
|
|
107
|
+
filter: "line.3.horizontal.decrease",
|
|
108
|
+
heart: "heart",
|
|
109
|
+
home: "house",
|
|
110
|
+
info: "info.circle",
|
|
111
|
+
lock: "lock",
|
|
112
|
+
"log-out": "rectangle.portrait.and.arrow.right",
|
|
113
|
+
mail: "envelope",
|
|
114
|
+
menu: "line.3.horizontal",
|
|
115
|
+
minus: "minus",
|
|
116
|
+
more: "ellipsis",
|
|
117
|
+
plus: "plus",
|
|
118
|
+
refresh: "arrow.clockwise",
|
|
119
|
+
search: "magnifyingglass",
|
|
120
|
+
settings: "gearshape",
|
|
121
|
+
share: "square.and.arrow.up",
|
|
122
|
+
star: "star",
|
|
123
|
+
success: "checkmark.circle",
|
|
124
|
+
trash: "trash",
|
|
125
|
+
user: "person",
|
|
126
|
+
warning: "exclamationmark.triangle"
|
|
127
|
+
};
|
|
128
|
+
var NATIVE_ICON_NAMES = Object.keys(SF_SYMBOLS);
|
|
129
|
+
var warned = /* @__PURE__ */ new Set();
|
|
130
|
+
function warnOnce(name) {
|
|
131
|
+
if (typeof __DEV__ === "undefined" || !__DEV__ || warned.has(name)) return;
|
|
132
|
+
warned.add(name);
|
|
133
|
+
console.warn(
|
|
134
|
+
`[genesis] NativeIcon "${name}" has nothing to draw with: pass modules.icons (lucideIcons from "@marktiderman/genesis-ui-native/icons/lucide") and, for SF Symbols on iOS, modules.symbol (SymbolView from "expo-symbols") to GenesisModulesProvider.`
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function NativeIcon({ name, size = 20, color, weight, label, testID }) {
|
|
138
|
+
const { symbol: SymbolView, icons } = useGenesisModules();
|
|
139
|
+
const roles = useThemeRoles();
|
|
140
|
+
const tint = color ?? roles.label;
|
|
141
|
+
const a11y = label ? { accessible: true, accessibilityRole: "image", accessibilityLabel: label } : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
142
|
+
const Fallback = icons?.[name];
|
|
143
|
+
const fallback = Fallback ? /* @__PURE__ */ jsx(Fallback, { size, color: tint, testID: testID ? `${testID}-fallback` : void 0 }) : null;
|
|
144
|
+
if (Platform.OS === "ios" && SymbolView) {
|
|
145
|
+
return /* @__PURE__ */ jsx(View, { ...a11y, testID, style: { width: size, height: size }, children: /* @__PURE__ */ jsx(SymbolView, { name: SF_SYMBOLS[name], size, tintColor: tint, weight, fallback, style: { width: size, height: size } }) });
|
|
146
|
+
}
|
|
147
|
+
if (!fallback) warnOnce(name);
|
|
148
|
+
return /* @__PURE__ */ jsx(View, { ...a11y, testID, style: { width: size, height: size, alignItems: "center", justifyContent: "center" }, children: fallback });
|
|
149
|
+
}
|
|
89
150
|
function NativeListItem({
|
|
90
151
|
title,
|
|
91
152
|
subtitle,
|
|
@@ -111,14 +172,7 @@ function NativeListItem({
|
|
|
111
172
|
) : null
|
|
112
173
|
] }),
|
|
113
174
|
trailing ? /* @__PURE__ */ jsx(View, { className: "ml-3", children: trailing }) : null,
|
|
114
|
-
showChevron ? /* @__PURE__ */ jsx(
|
|
115
|
-
Text,
|
|
116
|
-
{
|
|
117
|
-
accessibilityElementsHidden: true,
|
|
118
|
-
className: "ml-2 text-base text-muted-foreground",
|
|
119
|
-
children: "\u203A"
|
|
120
|
-
}
|
|
121
|
-
) : null
|
|
175
|
+
showChevron ? /* @__PURE__ */ jsx(Chevron, {}) : null
|
|
122
176
|
] });
|
|
123
177
|
if (onPress) {
|
|
124
178
|
return /* @__PURE__ */ jsx(
|
|
@@ -152,6 +206,21 @@ function NativeListItem({
|
|
|
152
206
|
}
|
|
153
207
|
);
|
|
154
208
|
}
|
|
209
|
+
function Chevron() {
|
|
210
|
+
const { symbol, icons } = useGenesisModules();
|
|
211
|
+
const roles = useThemeRoles();
|
|
212
|
+
if (Platform.OS === "ios" && symbol || icons?.["chevron-right"]) {
|
|
213
|
+
return /* @__PURE__ */ jsx(View, { className: "ml-2", children: /* @__PURE__ */ jsx(NativeIcon, { name: "chevron-right", size: 14, weight: "semibold", color: roles.tertiaryLabel, testID: "native-list-item-chevron" }) });
|
|
214
|
+
}
|
|
215
|
+
return /* @__PURE__ */ jsx(
|
|
216
|
+
Text,
|
|
217
|
+
{
|
|
218
|
+
accessibilityElementsHidden: true,
|
|
219
|
+
className: "ml-2 text-base text-muted-foreground",
|
|
220
|
+
children: "\u203A"
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
155
224
|
function NativeListItemDivider({ className }) {
|
|
156
225
|
return /* @__PURE__ */ jsx(View, { className: cn("h-px bg-border", className) });
|
|
157
226
|
}
|
|
@@ -178,6 +247,6 @@ function NativeSectionListHeader({
|
|
|
178
247
|
);
|
|
179
248
|
}
|
|
180
249
|
|
|
181
|
-
export { NativeEmptyState, NativeListItem, NativeListItemDivider, NativeSectionListHeader };
|
|
182
|
-
//# sourceMappingURL=chunk-
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
250
|
+
export { NATIVE_ICON_NAMES, NativeEmptyState, NativeIcon, NativeListItem, NativeListItemDivider, NativeSectionListHeader, SF_SYMBOLS };
|
|
251
|
+
//# sourceMappingURL=chunk-ERHGCWTY.js.map
|
|
252
|
+
//# sourceMappingURL=chunk-ERHGCWTY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/empty-state.tsx","../src/icon-names.ts","../src/components/icon.tsx","../src/components/list-item.tsx","../src/components/section-list.tsx"],"names":["jsx","View","jsxs","Text","Platform"],"mappings":";;;;;;AAwEA,IAAM,QAAA,GAA6E;AAAA,EACjF,WAAA,EAAa,EAAE,KAAA,EAAO,kBAAA,EAAoB,MAAM,uBAAA,EAAwB;AAAA,EACxE,YAAA,EAAc,EAAE,KAAA,EAAO,YAAA,EAAc,MAAM,uBAAA,EAAwB;AAAA,EACnE,KAAA,EAAO,EAAE,KAAA,EAAO,sBAAA,EAAwB,MAAM,kBAAA;AAChD,CAAA;AAEO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,OAAA,GAAU,WAAA;AAAA,EACV,KAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,IAAA,GAAO,SAAS,OAAO,CAAA;AAC7B,EAAA,MAAM,eAAe,IAAA,IAAQ,WAAA;AAC7B,EAAA,MAAM,kBAAkB,aAAA,IAAiB,MAAA;AAKzC,EAAA,MAAM,OAAQ,UAAA,CACX,OAAA;AACH,EAAA,MAAM,OAAA,GAA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ACC,QAAQ,MAAA,IAAU,uBAAA;AAAA,MAClB,iBAAA,EAAkB,QAAA;AAAA,MAClB,SAAA,EAAW,EAAA;AAAA,QACT,iFAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAAD,GAAAA,CAACG,IAAAA,EAAA,EAAK,SAAA,EAAU,wEACb,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,QACC;AAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-ERHGCWTY.js","sourcesContent":["/**\n * EmptyState — what to show when a list / screen has no data.\n *\n * Three semantic variants drive default messaging:\n * - \"first-run\": user has never had data here. Optimistic.\n * - \"no-results\": user filtered/searched and got nothing. Suggest reset.\n * - \"error\": fetching failed. Suggest retry.\n *\n * The variant only sets sensible defaults for `title` and tone — pass\n * your own `title`, `body`, `primaryAction`, `secondaryAction`, etc. to\n * override. Mirrors the @marktiderman/genesis-ui web `<EmptyState>` API where\n * possible (illustration vs icon slot, primary/secondary actions).\n *\n * @stability Beta\n */\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nexport type NativeEmptyStateVariant = \"first-run\" | \"no-results\" | \"error\";\n\n/**\n * Action descriptor for primary/secondary CTAs. Either pass a structured\n * object (renders a Pressable button via the consumer's button slot) or\n * pass an arbitrary node via `action` for maximum flexibility.\n */\nexport interface NativeEmptyStateAction {\n label: string;\n onPress: () => void;\n testID?: string;\n}\n\nexport interface NativeEmptyStateProps {\n /** Variant drives default tone + default title. Default \"first-run\". */\n variant?: NativeEmptyStateVariant;\n /** Headline. Falls back to a variant-specific default. */\n title?: string;\n /** Body copy shown below the title. (Alias: `description`.) */\n body?: string;\n /**\n * @deprecated Prefer `body`. `description` remains for back-compat with\n * the original C3 API; both are accepted but `body` wins if both passed.\n */\n description?: string;\n /** Optional illustration (artwork node) above the title. */\n illustration?: React.ReactNode;\n /** Optional icon node above the title (use either icon or illustration). */\n icon?: React.ReactNode;\n /**\n * Primary CTA. When provided, the consumer is responsible for rendering\n * the button itself (we accept a node, not a label) so brand + token\n * styling is honored. The web API takes a `{label, onPress}` descriptor;\n * on native, prefer to pass a `<NativeButton>` directly to avoid\n * cross-package coupling.\n */\n primaryAction?: React.ReactNode;\n /** Secondary CTA, rendered below the primary. */\n secondaryAction?: React.ReactNode;\n /**\n * Free-form action slot. Equivalent to `primaryAction`; accepted for\n * back-compat with the C3 API. If both `action` and `primaryAction` are\n * passed, `primaryAction` wins.\n */\n action?: React.ReactNode;\n /**\n * Developer-facing error details. Only rendered when __DEV__ is true at\n * runtime (we infer by reading `process.env.NODE_ENV !== \"production\"`).\n */\n details?: string;\n className?: string;\n testID?: string;\n}\n\nconst defaults: Record<NativeEmptyStateVariant, { title: string; tone: string }> = {\n \"first-run\": { title: \"Nothing here yet\", tone: \"text-muted-foreground\" },\n \"no-results\": { title: \"No results\", tone: \"text-muted-foreground\" },\n error: { title: \"Something went wrong\", tone: \"text-destructive\" },\n};\n\nexport function NativeEmptyState({\n variant = \"first-run\",\n title,\n body,\n description,\n illustration,\n icon,\n primaryAction,\n secondaryAction,\n action,\n details,\n className,\n testID,\n}: NativeEmptyStateProps) {\n const meta = defaults[variant];\n const resolvedBody = body ?? description;\n const resolvedPrimary = primaryAction ?? action;\n // Read NODE_ENV defensively — some bundlers don't define `process` at\n // runtime (e.g., RN classic), so we guard via globalThis. The `details`\n // slot is dev-only; we explicitly enumerate non-production values so an\n // undefined NODE_ENV doesn't accidentally leak diagnostic strings.\n const proc = (globalThis as { process?: { env?: { NODE_ENV?: string } } })\n .process;\n const nodeEnv = proc?.env?.NODE_ENV;\n const isDev = nodeEnv === \"development\" || nodeEnv === \"test\";\n\n return (\n <View\n testID={testID ?? `empty-state-${variant}`}\n accessibilityRole=\"summary\"\n className={cn(\n \"items-center justify-center gap-3 px-8 py-12\",\n className\n )}\n >\n {illustration ? <View accessibilityElementsHidden>{illustration}</View> : null}\n {icon && !illustration ? (\n <View accessibilityElementsHidden>{icon}</View>\n ) : null}\n <Text\n testID={testID ? `${testID}-title` : undefined}\n className={cn(\n \"text-center text-lg font-semibold\",\n variant === \"error\" ? \"text-destructive\" : \"text-foreground\"\n )}\n >\n {title ?? meta.title}\n </Text>\n {resolvedBody ? (\n <Text\n testID={testID ? `${testID}-body` : undefined}\n className={cn(\"max-w-sm text-center text-sm\", meta.tone)}\n >\n {resolvedBody}\n </Text>\n ) : null}\n {resolvedPrimary ? (\n <View\n testID={testID ? `${testID}-primary-action` : undefined}\n className=\"mt-2\"\n >\n {resolvedPrimary}\n </View>\n ) : null}\n {secondaryAction ? (\n <View\n testID={testID ? `${testID}-secondary-action` : undefined}\n className=\"mt-1\"\n >\n {secondaryAction}\n </View>\n ) : null}\n {details && isDev ? (\n <Text\n testID={testID ? `${testID}-details` : undefined}\n className=\"mt-2 max-w-sm text-center text-xs text-muted-foreground\"\n >\n {details}\n </Text>\n ) : null}\n </View>\n );\n}\n","/**\n * The semantic icon names Genesis components ask for, and the SF Symbol each\n * one draws on iOS. Components say \"settings\" or \"bell\", never a library's\n * own name; `lucideIcons` (`/icons/lucide`) maps the same names for Android,\n * web and the SF Symbol fallback.\n *\n * @stability Beta\n */\nexport const SF_SYMBOLS = {\n \"arrow-left\": \"arrow.left\",\n bell: \"bell\",\n calendar: \"calendar\",\n check: \"checkmark\",\n \"chevron-down\": \"chevron.down\",\n \"chevron-left\": \"chevron.left\",\n \"chevron-right\": \"chevron.right\",\n \"chevron-up\": \"chevron.up\",\n clock: \"clock\",\n close: \"xmark\",\n edit: \"pencil\",\n error: \"xmark.circle\",\n \"external-link\": \"arrow.up.right.square\",\n filter: \"line.3.horizontal.decrease\",\n heart: \"heart\",\n home: \"house\",\n info: \"info.circle\",\n lock: \"lock\",\n \"log-out\": \"rectangle.portrait.and.arrow.right\",\n mail: \"envelope\",\n menu: \"line.3.horizontal\",\n minus: \"minus\",\n more: \"ellipsis\",\n plus: \"plus\",\n refresh: \"arrow.clockwise\",\n search: \"magnifyingglass\",\n settings: \"gearshape\",\n share: \"square.and.arrow.up\",\n star: \"star\",\n success: \"checkmark.circle\",\n trash: \"trash\",\n user: \"person\",\n warning: \"exclamationmark.triangle\",\n} as const;\n\n/** A semantic icon name: what the icon is for. */\nexport type NativeIconName = keyof typeof SF_SYMBOLS;\n\n/** Every semantic icon name. */\nexport const NATIVE_ICON_NAMES = Object.keys(SF_SYMBOLS) as NativeIconName[];\n","/**\n * NativeIcon — an icon by what it is for (\"settings\", \"bell\"), not by a\n * library's name. On iOS it draws the SF Symbol (expo-symbols' `SymbolView`,\n * passed as `modules.symbol`); on Android and web, and as the SF Symbol's\n * fallback, it draws the icon set given as `modules.icons` (`lucideIcons`\n * from `@marktiderman/genesis-ui-native/icons/lucide`). With neither, it\n * keeps the icon's space empty and warns once in development.\n *\n * Decorative by default (hidden from screen readers). Give `label` when the\n * icon carries meaning on its own, such as an icon-only button's content.\n *\n * @stability Beta\n */\nimport { Platform, View, type ColorValue } from \"react-native\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { SF_SYMBOLS, type NativeIconName } from \"../icon-names\";\nimport { useGenesisModules } from \"../native-modules\";\n\nexport interface NativeIconProps {\n name: NativeIconName;\n /** Points. Default 20. */\n size?: number;\n /** Default the theme's label color. */\n color?: ColorValue;\n /** iOS SF Symbol weight. */\n weight?: \"ultraLight\" | \"thin\" | \"light\" | \"regular\" | \"medium\" | \"semibold\" | \"bold\" | \"heavy\" | \"black\";\n /** Read by screen readers. Without it the icon is decorative and hidden from them. */\n label?: string;\n testID?: string;\n}\n\ndeclare const __DEV__: boolean | undefined;\nconst warned = new Set<string>();\n\nfunction warnOnce(name: string) {\n if (typeof __DEV__ === \"undefined\" || !__DEV__ || warned.has(name)) return;\n warned.add(name);\n console.warn(\n `[genesis] NativeIcon \"${name}\" has nothing to draw with: pass modules.icons (lucideIcons from \"@marktiderman/genesis-ui-native/icons/lucide\") and, for SF Symbols on iOS, modules.symbol (SymbolView from \"expo-symbols\") to GenesisModulesProvider.`,\n );\n}\n\nexport function NativeIcon({ name, size = 20, color, weight, label, testID }: NativeIconProps) {\n const { symbol: SymbolView, icons } = useGenesisModules();\n const roles = useThemeRoles();\n const tint = color ?? roles.label;\n const a11y = label\n ? { accessible: true, accessibilityRole: \"image\" as const, accessibilityLabel: label }\n : { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: \"no-hide-descendants\" as const };\n const Fallback = icons?.[name];\n const fallback = Fallback ? <Fallback size={size} color={tint} testID={testID ? `${testID}-fallback` : undefined} /> : null;\n\n if (Platform.OS === \"ios\" && SymbolView) {\n return (\n <View {...a11y} testID={testID} style={{ width: size, height: size }}>\n <SymbolView name={SF_SYMBOLS[name]} size={size} tintColor={tint} weight={weight} fallback={fallback} style={{ width: size, height: size }} />\n </View>\n );\n }\n if (!fallback) warnOnce(name);\n return (\n <View {...a11y} testID={testID} style={{ width: size, height: size, alignItems: \"center\", justifyContent: \"center\" }}>\n {fallback}\n </View>\n );\n}\n","/**\n * ListItem — recurring row in a list (settings, contacts, results).\n *\n * Slots: leading (avatar / icon), title, subtitle, trailing\n * (chevron / accessory / action). Supports pressable variants with\n * automatic divider rendering between adjacent items via a wrapper\n * pattern (see <NativeListItemDivider>).\n *\n * For platform-default chevrons, pass `showChevron`; the chevron uses\n * the muted-foreground token.\n *\n * @stability Beta\n */\nimport { Platform, Pressable, Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { NativeIcon } from \"./icon\";\n\nexport interface NativeListItemProps {\n title: string;\n subtitle?: string;\n /** Slot rendered to the left of the title (avatar / icon). */\n leading?: React.ReactNode;\n /** Slot rendered to the right of the title (badge / accessory). */\n trailing?: React.ReactNode;\n /** When true, renders a chevron-right at the end. */\n showChevron?: boolean;\n /** When provided, the row becomes pressable. */\n onPress?: () => void;\n disabled?: boolean;\n className?: string;\n testID?: string;\n}\n\nexport function NativeListItem({\n title,\n subtitle,\n leading,\n trailing,\n showChevron,\n onPress,\n disabled,\n className,\n testID,\n}: NativeListItemProps) {\n const inner = (\n <>\n {leading ? <View className=\"mr-3\">{leading}</View> : null}\n <View className=\"flex-1\">\n <Text className=\"text-base text-foreground\" numberOfLines={1}>\n {title}\n </Text>\n {subtitle ? (\n <Text\n className=\"mt-0.5 text-xs text-muted-foreground\"\n numberOfLines={2}\n >\n {subtitle}\n </Text>\n ) : null}\n </View>\n {trailing ? <View className=\"ml-3\">{trailing}</View> : null}\n {showChevron ? <Chevron /> : null}\n </>\n );\n\n if (onPress) {\n return (\n <Pressable\n testID={testID ?? \"native-list-item\"}\n accessibilityRole=\"button\"\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n className={cn(\n \"min-h-[44px] flex-row items-center bg-background px-4 py-3\",\n disabled && \"opacity-50\",\n className\n )}\n >\n {inner}\n </Pressable>\n );\n }\n\n return (\n <View\n testID={testID ?? \"native-list-item\"}\n accessibilityLabel={subtitle ? `${title}, ${subtitle}` : title}\n className={cn(\n \"min-h-[44px] flex-row items-center bg-background px-4 py-3\",\n className\n )}\n >\n {inner}\n </View>\n );\n}\n\n/**\n * The drill-in chevron: an SF Symbol on iOS or the app's icon set\n * (`modules.symbol` / `modules.icons`) when given, else a text \"›\".\n */\nfunction Chevron() {\n const { symbol, icons } = useGenesisModules();\n const roles = useThemeRoles();\n if ((Platform.OS === \"ios\" && symbol) || icons?.[\"chevron-right\"]) {\n return (\n <View className=\"ml-2\">\n <NativeIcon name=\"chevron-right\" size={14} weight=\"semibold\" color={roles.tertiaryLabel} testID=\"native-list-item-chevron\" />\n </View>\n );\n }\n return (\n <Text\n accessibilityElementsHidden\n className=\"ml-2 text-base text-muted-foreground\"\n >\n ›\n </Text>\n );\n}\n\nexport function NativeListItemDivider({ className }: { className?: string }) {\n return <View className={cn(\"h-px bg-border\", className)} />;\n}\n","/**\n * SectionList header pattern — opinionated header style for\n * react-native SectionList rows.\n *\n * The full SectionList API stays with React Native; Genesis ships the\n * header component so consumers can pass it as `renderSectionHeader`\n * and get a consistent visual: muted background, uppercase tracking,\n * sticky-friendly padding.\n *\n * Pattern:\n *\n * <SectionList\n * sections={...}\n * renderItem={({ item }) => <NativeListItem title={item.label} />}\n * renderSectionHeader={({ section }) => (\n * <NativeSectionListHeader title={section.title} />\n * )}\n * />\n *\n * @stability Beta\n */\nimport { Text, View } from \"react-native\";\nimport { cn } from \"../utils\";\n\nexport interface NativeSectionListHeaderProps {\n title: string;\n /** Optional trailing content (e.g., a count badge). */\n trailing?: React.ReactNode;\n className?: string;\n testID?: string;\n}\n\nexport function NativeSectionListHeader({\n title,\n trailing,\n className,\n testID,\n}: NativeSectionListHeaderProps) {\n return (\n <View\n testID={testID ?? \"native-section-header\"}\n accessibilityRole=\"header\"\n className={cn(\n \"flex-row items-center justify-between border-b border-border bg-muted px-4 py-2\",\n className\n )}\n >\n <Text className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {title}\n </Text>\n {trailing}\n </View>\n );\n}\n"]}
|