2026-03-13 23:56:34 +00:00
|
|
|
import { defineRegistry } from "@json-render/react-native"
|
|
|
|
|
import { View } from "react-native"
|
|
|
|
|
import tw from "twrnc"
|
|
|
|
|
|
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
|
|
|
import { FeedCard } from "@/components/ui/feed-card"
|
|
|
|
|
import { MonospaceText } from "@/components/ui/monospace-text"
|
|
|
|
|
import { SansSerifText } from "@/components/ui/sans-serif-text"
|
|
|
|
|
import { SerifText } from "@/components/ui/serif-text"
|
|
|
|
|
|
|
|
|
|
import { catalog } from "./catalog"
|
|
|
|
|
|
2026-03-14 00:39:59 +00:00
|
|
|
type ButtonIconName = React.ComponentProps<typeof Button.Icon>["name"]
|
2026-03-13 23:56:34 +00:00
|
|
|
|
|
|
|
|
export const { registry } = defineRegistry(catalog, {
|
|
|
|
|
components: {
|
|
|
|
|
View: ({ props, children }) => <View style={props.style ? tw`${props.style}` : undefined}>{children}</View>,
|
|
|
|
|
Button: ({ props, emit }) => (
|
|
|
|
|
<Button
|
|
|
|
|
label={props.label}
|
2026-03-14 00:39:59 +00:00
|
|
|
leadingIcon={props.leadingIcon ? <Button.Icon name={props.leadingIcon as ButtonIconName} /> : undefined}
|
|
|
|
|
trailingIcon={props.trailingIcon ? <Button.Icon name={props.trailingIcon as ButtonIconName} /> : undefined}
|
2026-03-13 23:56:34 +00:00
|
|
|
onPress={() => emit("press")}
|
|
|
|
|
/>
|
|
|
|
|
),
|
|
|
|
|
FeedCard: ({ props, children }) => (
|
|
|
|
|
<FeedCard style={props.style ? tw`${props.style}` : undefined}>{children}</FeedCard>
|
|
|
|
|
),
|
|
|
|
|
SansSerifText: ({ props }) => (
|
|
|
|
|
<SansSerifText style={props.style ? tw`${props.style}` : undefined}>{props.text}</SansSerifText>
|
|
|
|
|
),
|
|
|
|
|
SerifText: ({ props }) => (
|
|
|
|
|
<SerifText style={props.style ? tw`${props.style}` : undefined}>{props.text}</SerifText>
|
|
|
|
|
),
|
|
|
|
|
MonospaceText: ({ props }) => (
|
|
|
|
|
<MonospaceText style={props.style ? tw`${props.style}` : undefined}>{props.text}</MonospaceText>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
})
|