Skip to content

Commit 46e87c4

Browse files
committed
chore(docs): format registry items
1 parent 46f6721 commit 46e87c4

32 files changed

+119
-61
lines changed

apps/docs/public/r/new-york/accordion.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"title": "Accordion",
66
"author": "@mrzachnugent",
77
"description": "A vertically stacked set of interactive headings that each reveal a section of content.",
8-
"dependencies": ["@rn-primitives/accordion"],
8+
"dependencies": [
9+
"@rn-primitives/accordion"
10+
],
911
"registryDependencies": [
1012
"https://reactnativereusables.com/r/new-york/text.json",
1113
"https://reactnativereusables.com/r/new-york/icon.json"
@@ -17,4 +19,4 @@
1719
"type": "registry:ui"
1820
}
1921
]
20-
}
22+
}

apps/docs/public/r/new-york/alert-dialog.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"title": "Alert Dialog",
66
"author": "@mrzachnugent",
77
"description": "A modal dialog that interrupts the user with important content and expects a response.",
8-
"dependencies": ["@rn-primitives/alert-dialog"],
8+
"dependencies": [
9+
"@rn-primitives/alert-dialog"
10+
],
911
"registryDependencies": [
1012
"https://reactnativereusables.com/r/new-york/button.json",
1113
"https://reactnativereusables.com/r/new-york/native-only-animated-view.json",
@@ -18,4 +20,4 @@
1820
"type": "registry:ui"
1921
}
2022
]
21-
}
23+
}

apps/docs/public/r/new-york/alert.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"type": "registry:ui"
1717
}
1818
]
19-
}
19+
}

apps/docs/public/r/new-york/aspect-ratio.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"title": "Aspect Ratio",
66
"author": "@mrzachnugent",
77
"description": "Displays content within a desired ratio.",
8-
"dependencies": ["@rn-primitives/aspect-ratio"],
8+
"dependencies": [
9+
"@rn-primitives/aspect-ratio"
10+
],
911
"files": [
1012
{
1113
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/aspect-ratio.tsx",
1214
"content": "import * as AspectRatioPrimitive from '@rn-primitives/aspect-ratio';\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n",
1315
"type": "registry:ui"
1416
}
1517
]
16-
}
18+
}

apps/docs/public/r/new-york/avatar.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"title": "Avatar",
66
"author": "@mrzachnugent",
77
"description": "An image element with a fallback for representing the user.",
8-
"dependencies": ["@rn-primitives/avatar"],
8+
"dependencies": [
9+
"@rn-primitives/avatar"
10+
],
911
"files": [
1012
{
1113
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/avatar.tsx",
1214
"content": "import { cn } from '@/registry/new-york/lib/utils';\nimport * as AvatarPrimitive from '@rn-primitives/avatar';\n\nfunction Avatar({\n className,\n ...props\n}: AvatarPrimitive.RootProps & React.RefAttributes<AvatarPrimitive.RootRef>) {\n return (\n <AvatarPrimitive.Root\n className={cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: AvatarPrimitive.ImageProps & React.RefAttributes<AvatarPrimitive.ImageRef>) {\n return <AvatarPrimitive.Image className={cn('aspect-square size-full', className)} {...props} />;\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: AvatarPrimitive.FallbackProps & React.RefAttributes<AvatarPrimitive.FallbackRef>) {\n return (\n <AvatarPrimitive.Fallback\n className={cn(\n 'bg-muted flex size-full flex-row items-center justify-center rounded-full',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarFallback, AvatarImage };\n",
1315
"type": "registry:ui"
1416
}
1517
]
16-
}
18+
}

apps/docs/public/r/new-york/badge.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
"title": "Badge",
66
"author": "@mrzachnugent",
77
"description": "Displays a badge or a component that looks like a badge.",
8-
"dependencies": ["@rn-primitives/slot"],
9-
"registryDependencies": ["https://reactnativereusables.com/r/new-york/text.json"],
8+
"dependencies": [
9+
"@rn-primitives/slot"
10+
],
11+
"registryDependencies": [
12+
"https://reactnativereusables.com/r/new-york/text.json"
13+
],
1014
"files": [
1115
{
1216
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/badge.tsx",
1317
"content": "import { TextClassContext } from '@/registry/new-york/components/ui/text';\nimport { cn } from '@/registry/new-york/lib/utils';\nimport * as Slot from '@rn-primitives/slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Platform, View, ViewProps } from 'react-native';\n\nconst badgeVariants = cva(\n cn(\n 'border-border group shrink-0 flex-row items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5',\n Platform.select({\n web: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive w-fit whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3',\n })\n ),\n {\n variants: {\n variant: {\n default: cn(\n 'bg-primary border-transparent',\n Platform.select({ web: '[a&]:hover:bg-primary/90' })\n ),\n secondary: cn(\n 'bg-secondary border-transparent',\n Platform.select({ web: '[a&]:hover:bg-secondary/90' })\n ),\n destructive: cn(\n 'bg-destructive border-transparent',\n Platform.select({ web: '[a&]:hover:bg-destructive/90' })\n ),\n outline: Platform.select({ web: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground' }),\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-white',\n outline: 'text-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\ntype BadgeProps = ViewProps &\n React.RefAttributes<View> & {\n asChild?: boolean;\n } & VariantProps<typeof badgeVariants>;\n\nfunction Badge({ className, variant, asChild, ...props }: BadgeProps) {\n const Component = asChild ? Slot.View : View;\n return (\n <TextClassContext.Provider value={badgeTextVariants({ variant })}>\n <Component className={cn(badgeVariants({ variant }), className)} {...props} />\n </TextClassContext.Provider>\n );\n}\n\nexport { Badge, badgeTextVariants, badgeVariants };\nexport type { BadgeProps };\n",
1418
"type": "registry:ui"
1519
}
1620
]
17-
}
21+
}

apps/docs/public/r/new-york/button.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"title": "Button",
66
"author": "@mrzachnugent",
77
"description": "Displays a button or a component that looks like a button.",
8-
"registryDependencies": ["https://reactnativereusables.com/r/new-york/text.json"],
8+
"registryDependencies": [
9+
"https://reactnativereusables.com/r/new-york/text.json"
10+
],
911
"files": [
1012
{
1113
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/button.tsx",
1214
"content": "import { TextClassContext } from '@/registry/new-york/components/ui/text';\nimport { cn } from '@/registry/new-york/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Platform, Pressable } from 'react-native';\n\nconst buttonVariants = cva(\n cn(\n 'group shrink-0 flex-row items-center justify-center gap-2 rounded-md shadow-none',\n Platform.select({\n web: \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n })\n ),\n {\n variants: {\n variant: {\n default: cn(\n 'bg-primary active:bg-primary/90 shadow-sm shadow-black/5',\n Platform.select({ web: 'hover:bg-primary/90' })\n ),\n destructive: cn(\n 'bg-destructive active:bg-destructive/90 dark:bg-destructive/60 shadow-sm shadow-black/5',\n Platform.select({\n web: 'hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n })\n ),\n outline: cn(\n 'border-border bg-background active:bg-accent dark:bg-input/30 dark:border-input dark:active:bg-input/50 border shadow-sm shadow-black/5',\n Platform.select({\n web: 'hover:bg-accent dark:hover:bg-input/50',\n })\n ),\n secondary: cn(\n 'bg-secondary active:bg-secondary/80 shadow-sm shadow-black/5',\n Platform.select({ web: 'hover:bg-secondary/80' })\n ),\n ghost: cn(\n 'active:bg-accent dark:active:bg-accent/50',\n Platform.select({ web: 'hover:bg-accent dark:hover:bg-accent/50' })\n ),\n link: '',\n },\n size: {\n default: cn('h-10 px-4 py-2 sm:h-9', Platform.select({ web: 'has-[>svg]:px-3' })),\n sm: cn('h-9 gap-1.5 rounded-md px-3 sm:h-8', Platform.select({ web: 'has-[>svg]:px-2.5' })),\n lg: cn('h-11 rounded-md px-6 sm:h-10', Platform.select({ web: 'has-[>svg]:px-4' })),\n icon: 'h-10 w-10 sm:h-9 sm:w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nconst buttonTextVariants = cva(\n cn(\n 'text-foreground text-sm font-medium',\n Platform.select({ web: 'pointer-events-none transition-colors' })\n ),\n {\n variants: {\n variant: {\n default: 'text-primary-foreground',\n destructive: 'text-white',\n outline: cn(\n 'group-active:text-accent-foreground',\n Platform.select({ web: 'group-hover:text-accent-foreground' })\n ),\n secondary: 'text-secondary-foreground',\n ghost: 'group-active:text-accent-foreground',\n link: cn(\n 'text-primary group-active:underline',\n Platform.select({ web: 'underline-offset-4 hover:underline group-hover:underline' })\n ),\n },\n size: {\n default: '',\n sm: '',\n lg: '',\n icon: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\ntype ButtonProps = React.ComponentProps<typeof Pressable> &\n React.RefAttributes<typeof Pressable> &\n VariantProps<typeof buttonVariants>;\n\nfunction Button({ className, variant, size, ...props }: ButtonProps) {\n return (\n <TextClassContext.Provider value={buttonTextVariants({ variant, size })}>\n <Pressable\n className={cn(props.disabled && 'opacity-50', buttonVariants({ variant, size }), className)}\n role=\"button\"\n {...props}\n />\n </TextClassContext.Provider>\n );\n}\n\nexport { Button, buttonTextVariants, buttonVariants };\nexport type { ButtonProps };\n",
1315
"type": "registry:ui"
1416
}
1517
]
16-
}
18+
}

apps/docs/public/r/new-york/card.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"title": "Card",
66
"author": "@mrzachnugent",
77
"description": "Displays a card with header, content, and footer.",
8-
"registryDependencies": ["https://reactnativereusables.com/r/new-york/text.json"],
8+
"registryDependencies": [
9+
"https://reactnativereusables.com/r/new-york/text.json"
10+
],
911
"files": [
1012
{
1113
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/card.tsx",
1214
"content": "import { Text, TextClassContext } from '@/registry/new-york/components/ui/text';\nimport { cn } from '@/registry/new-york/lib/utils';\nimport { View, type ViewProps } from 'react-native';\n\nfunction Card({ className, ...props }: ViewProps & React.RefAttributes<View>) {\n return (\n <TextClassContext.Provider value=\"text-card-foreground\">\n <View\n className={cn(\n 'bg-card border-border flex flex-col gap-6 rounded-xl border py-6 shadow-sm shadow-black/5',\n className\n )}\n {...props}\n />\n </TextClassContext.Provider>\n );\n}\n\nfunction CardHeader({ className, ...props }: ViewProps & React.RefAttributes<View>) {\n return <View className={cn('flex flex-col gap-1.5 px-6', className)} {...props} />;\n}\n\nfunction CardTitle({\n className,\n ...props\n}: React.ComponentProps<typeof Text> & React.RefAttributes<Text>) {\n return (\n <Text\n role=\"heading\"\n aria-level={3}\n className={cn('font-semibold leading-none', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({\n className,\n ...props\n}: React.ComponentProps<typeof Text> & React.RefAttributes<Text>) {\n return <Text className={cn('text-muted-foreground text-sm', className)} {...props} />;\n}\n\nfunction CardContent({ className, ...props }: ViewProps & React.RefAttributes<View>) {\n return <View className={cn('px-6', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: ViewProps & React.RefAttributes<View>) {\n return <View className={cn('flex flex-row items-center px-6', className)} {...props} />;\n}\n\nexport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };\n",
1315
"type": "registry:ui"
1416
}
1517
]
16-
}
18+
}

apps/docs/public/r/new-york/checkbox.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
"title": "Checkbox",
66
"author": "@mrzachnugent",
77
"description": "A control that allows the user to toggle between checked and not checked.",
8-
"dependencies": ["@rn-primitives/checkbox"],
9-
"registryDependencies": ["https://reactnativereusables.com/r/new-york/icon.json"],
8+
"dependencies": [
9+
"@rn-primitives/checkbox"
10+
],
11+
"registryDependencies": [
12+
"https://reactnativereusables.com/r/new-york/icon.json"
13+
],
1014
"files": [
1115
{
1216
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/checkbox.tsx",
1317
"content": "import { Icon } from '@/registry/new-york/components/ui/icon';\nimport { cn } from '@/registry/new-york/lib/utils';\nimport * as CheckboxPrimitive from '@rn-primitives/checkbox';\nimport { Check } from 'lucide-react-native';\nimport { Platform } from 'react-native';\n\nconst DEFAULT_HIT_SLOP = 24;\n\nfunction Checkbox({\n className,\n checkedClassName,\n indicatorClassName,\n iconClassName,\n ...props\n}: CheckboxPrimitive.RootProps &\n React.RefAttributes<CheckboxPrimitive.RootRef> & {\n checkedClassName?: string;\n indicatorClassName?: string;\n iconClassName?: string;\n }) {\n return (\n <CheckboxPrimitive.Root\n className={cn(\n 'border-input dark:bg-input/30 size-4 shrink-0 rounded-[4px] border shadow-sm shadow-black/5',\n Platform.select({\n web: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer cursor-default outline-none transition-shadow focus-visible:ring-[3px] disabled:cursor-not-allowed',\n native: 'overflow-hidden',\n }),\n props.checked && cn('border-primary', checkedClassName),\n props.disabled && 'opacity-50',\n className\n )}\n hitSlop={DEFAULT_HIT_SLOP}\n {...props}>\n <CheckboxPrimitive.Indicator\n className={cn('bg-primary h-full w-full items-center justify-center', indicatorClassName)}>\n <Icon\n as={Check}\n size={12}\n strokeWidth={Platform.OS === 'web' ? 2.5 : 3.5}\n className={cn('text-primary-foreground', iconClassName)}\n />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n",
1418
"type": "registry:ui"
1519
}
1620
]
17-
}
21+
}

apps/docs/public/r/new-york/collapsible.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
"title": "Collapsible",
66
"author": "@mrzachnugent",
77
"description": "A control that allows the user to toggle between checked and not checked.",
8-
"dependencies": ["@rn-primitives/collapsible"],
8+
"dependencies": [
9+
"@rn-primitives/collapsible"
10+
],
911
"files": [
1012
{
1113
"path": "./node_modules/@rnr/registry/src/new-york/components/ui/collapsible.tsx",
1214
"content": "import * as CollapsiblePrimitive from '@rn-primitives/collapsible';\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.Trigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.Content;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n",
1315
"type": "registry:ui"
1416
}
1517
]
16-
}
18+
}

0 commit comments

Comments
 (0)