@marktiderman/genesis-ui-native 2.4.1 → 2.6.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 +30 -0
- package/dist/{chunk-BPD5DCFP.js → chunk-3S5XVER4.js} +271 -6
- package/dist/chunk-3S5XVER4.js.map +1 -0
- package/dist/chunk-56QLEHHV.js +1231 -0
- package/dist/chunk-56QLEHHV.js.map +1 -0
- package/dist/chunk-6JBNSW4D.js +479 -0
- package/dist/chunk-6JBNSW4D.js.map +1 -0
- package/dist/{chunk-RARJGZA3.js → chunk-KZEIF4YI.js} +7 -741
- package/dist/chunk-KZEIF4YI.js.map +1 -0
- package/dist/{chunk-6TLBCRS6.js → chunk-VMSIKSU2.js} +13 -477
- package/dist/chunk-VMSIKSU2.js.map +1 -0
- package/dist/components/index.d.ts +29 -3
- package/dist/components/index.js +3 -4
- package/dist/data/index.d.ts +382 -4
- package/dist/data/index.js +1067 -19
- package/dist/data/index.js.map +1 -1
- package/dist/inbox-page-DZUR-PJ1.d.ts +199 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +5 -5
- package/dist/layouts/index.d.ts +4 -186
- package/dist/layouts/index.js +3 -3
- package/package.json +2 -2
- package/src/components/__tests__/loading-state.test.tsx +41 -0
- package/src/components/image.tsx +5 -0
- package/src/components/index.ts +3 -0
- package/src/components/loading-state.tsx +92 -0
- package/src/data/NativeDetailPanel.tsx +8 -1
- package/src/data/index.ts +1 -0
- package/src/data/resource-view/NativeResourceFormSheet.tsx +305 -0
- package/src/data/resource-view/NativeResourceView.tsx +528 -0
- package/src/data/resource-view/__tests__/native-resource-view.test.tsx +870 -0
- package/src/data/resource-view/display.tsx +256 -0
- package/src/data/resource-view/index.ts +50 -0
- package/src/data/resource-view/mapping.ts +326 -0
- package/src/data/resource-view/messages.ts +121 -0
- package/src/data/resource-view/use-native-resource-view.ts +307 -0
- package/src/layouts/__tests__/inbox-page.test.tsx +2 -1
- package/src/layouts/__tests__/screen-container.test.tsx +27 -0
- package/src/layouts/inbox-page.tsx +4 -7
- package/src/layouts/screen-container.tsx +18 -1
- package/dist/chunk-6TLBCRS6.js.map +0 -1
- package/dist/chunk-BPD5DCFP.js.map +0 -1
- package/dist/chunk-EFXCJ5AN.js +0 -234
- package/dist/chunk-EFXCJ5AN.js.map +0 -1
- package/dist/chunk-FIITITXO.js +0 -492
- package/dist/chunk-FIITITXO.js.map +0 -1
- package/dist/chunk-RARJGZA3.js.map +0 -1
package/dist/chunk-EFXCJ5AN.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-OHZD7KRO.js';
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
|
-
import { Text, Pressable, ActivityIndicator, View, TextInput } from 'react-native';
|
|
4
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
import { createContext, useContext, useMemo, createElement } from 'react';
|
|
6
|
-
import { nativeColors } from '@marktiderman/genesis-design-system/tokens/native';
|
|
7
|
-
|
|
8
|
-
var textVariants = cva("text-foreground", {
|
|
9
|
-
variants: {
|
|
10
|
-
preset: {
|
|
11
|
-
h1: "text-3xl font-bold leading-9",
|
|
12
|
-
h2: "text-2xl font-bold leading-8",
|
|
13
|
-
h3: "text-xl font-semibold leading-7",
|
|
14
|
-
h4: "text-lg font-semibold leading-7",
|
|
15
|
-
body: "text-base font-normal leading-6",
|
|
16
|
-
"body-sm": "text-sm font-normal leading-5",
|
|
17
|
-
caption: "text-xs font-normal leading-4",
|
|
18
|
-
label: "text-sm font-medium leading-5"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
defaultVariants: {
|
|
22
|
-
preset: "body"
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
function NativeText({
|
|
26
|
-
className,
|
|
27
|
-
preset,
|
|
28
|
-
children,
|
|
29
|
-
...props
|
|
30
|
-
}) {
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
-
Text,
|
|
33
|
-
{
|
|
34
|
-
className: cn(textVariants({ preset }), className),
|
|
35
|
-
...props,
|
|
36
|
-
children
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
var buttonVariants = cva(
|
|
41
|
-
"flex-row items-center justify-center rounded-md",
|
|
42
|
-
{
|
|
43
|
-
variants: {
|
|
44
|
-
variant: {
|
|
45
|
-
default: "bg-primary",
|
|
46
|
-
secondary: "bg-secondary",
|
|
47
|
-
outline: "border border-input bg-transparent",
|
|
48
|
-
ghost: "bg-transparent",
|
|
49
|
-
destructive: "bg-destructive"
|
|
50
|
-
},
|
|
51
|
-
size: {
|
|
52
|
-
sm: "h-9 px-3 gap-1.5",
|
|
53
|
-
md: "h-10 px-4 gap-2",
|
|
54
|
-
lg: "h-11 px-8 gap-2"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
defaultVariants: {
|
|
58
|
-
variant: "default",
|
|
59
|
-
size: "md"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
var buttonTextVariants = cva("font-medium text-center", {
|
|
64
|
-
variants: {
|
|
65
|
-
variant: {
|
|
66
|
-
default: "text-primary-foreground",
|
|
67
|
-
secondary: "text-secondary-foreground",
|
|
68
|
-
outline: "text-foreground",
|
|
69
|
-
ghost: "text-foreground",
|
|
70
|
-
destructive: "text-destructive-foreground"
|
|
71
|
-
},
|
|
72
|
-
size: {
|
|
73
|
-
sm: "text-sm",
|
|
74
|
-
md: "text-sm",
|
|
75
|
-
lg: "text-base"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
variant: "default",
|
|
80
|
-
size: "md"
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
function NativeButton({
|
|
84
|
-
className,
|
|
85
|
-
textClassName,
|
|
86
|
-
variant,
|
|
87
|
-
size,
|
|
88
|
-
children,
|
|
89
|
-
onPress,
|
|
90
|
-
disabled,
|
|
91
|
-
loading,
|
|
92
|
-
...props
|
|
93
|
-
}) {
|
|
94
|
-
const isDisabled = disabled || loading;
|
|
95
|
-
return /* @__PURE__ */ jsxs(
|
|
96
|
-
Pressable,
|
|
97
|
-
{
|
|
98
|
-
className: cn(
|
|
99
|
-
buttonVariants({ variant, size }),
|
|
100
|
-
isDisabled && "opacity-50",
|
|
101
|
-
className
|
|
102
|
-
),
|
|
103
|
-
onPress,
|
|
104
|
-
disabled: isDisabled,
|
|
105
|
-
accessibilityRole: "button",
|
|
106
|
-
accessibilityState: { disabled: isDisabled, busy: loading },
|
|
107
|
-
...props,
|
|
108
|
-
children: [
|
|
109
|
-
loading ? /* @__PURE__ */ jsx(
|
|
110
|
-
ActivityIndicator,
|
|
111
|
-
{
|
|
112
|
-
size: "small",
|
|
113
|
-
color: variant === "outline" || variant === "ghost" ? void 0 : "white"
|
|
114
|
-
}
|
|
115
|
-
) : null,
|
|
116
|
-
typeof children === "string" ? /* @__PURE__ */ jsx(
|
|
117
|
-
Text,
|
|
118
|
-
{
|
|
119
|
-
className: cn(
|
|
120
|
-
buttonTextVariants({ variant, size }),
|
|
121
|
-
textClassName
|
|
122
|
-
),
|
|
123
|
-
children
|
|
124
|
-
}
|
|
125
|
-
) : children
|
|
126
|
-
]
|
|
127
|
-
}
|
|
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
|
-
}
|
|
202
|
-
function NativeInput({
|
|
203
|
-
className,
|
|
204
|
-
inputClassName,
|
|
205
|
-
label,
|
|
206
|
-
error,
|
|
207
|
-
editable = true,
|
|
208
|
-
placeholderTextColor,
|
|
209
|
-
...props
|
|
210
|
-
}) {
|
|
211
|
-
return /* @__PURE__ */ jsxs(View, { className: cn("gap-1.5", className), children: [
|
|
212
|
-
label ? /* @__PURE__ */ jsx(Text, { className: "text-sm font-medium text-foreground", children: label }) : null,
|
|
213
|
-
/* @__PURE__ */ jsx(
|
|
214
|
-
TextInput,
|
|
215
|
-
{
|
|
216
|
-
className: cn(
|
|
217
|
-
"h-10 rounded-md border border-input bg-background px-3 text-base text-foreground",
|
|
218
|
-
!editable && "opacity-50",
|
|
219
|
-
error && "border-destructive",
|
|
220
|
-
inputClassName
|
|
221
|
-
),
|
|
222
|
-
editable,
|
|
223
|
-
placeholderTextColor: placeholderTextColor ?? nativeColors.neutral[400],
|
|
224
|
-
accessibilityLabel: label,
|
|
225
|
-
...props
|
|
226
|
-
}
|
|
227
|
-
),
|
|
228
|
-
error ? /* @__PURE__ */ jsx(Text, { className: "text-sm text-destructive", children: error }) : null
|
|
229
|
-
] });
|
|
230
|
-
}
|
|
231
|
-
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;AA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,IAAA;AAAA,MACC,WAAW,EAAA,CAAG,iBAAA,CAAkB,EAAE,OAAA,EAAS,GAAG,aAAa,CAAA;AAAA,MAE1D;AAAA;AAAA,MAGH,QAAA,EAEJ,CAAA;AAEJ;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"]}
|