{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "context-icon", "title": "Context Icon", "description": "Octilinear tile identifying an organization, a stack, or an app. Ships the SVG art alongside the component.", "dependencies": [ "class-variance-authority" ], "files": [ { "path": "registry/default/ui/context-icon.tsx", "content": "import { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst CONTEXT_TYPES = {\n ORGANIZATION: 'ORGANIZATION',\n STACK: 'STACK',\n APP: 'APP',\n} as const;\n\ntype TContextType = (typeof CONTEXT_TYPES)[keyof typeof CONTEXT_TYPES];\n\n// The tiles are art, not glyphs: each one is a full-colour octilinear pattern on\n// its own background, so it is served as a file rather than inlined as\n// `currentColor` paths. `xs` is the size that fits a line of text — a menu row,\n// a table cell; the larger steps are for cards and headers.\n// `md+` and `lg+` are half-steps inside the ramp rather than extensions of it.\n// The named sizes are already published, so shifting `lg` or `xl` to make room\n// would silently resize every existing caller — a new name is the only additive\n// way to reach 28px and 40px.\nconst contextIconVariants = cva('shrink-0 object-contain', {\n variants: {\n size: {\n xs: 'size-4',\n sm: 'size-5',\n md: 'size-6',\n 'md+': 'size-7',\n lg: 'size-8',\n 'lg+': 'size-10',\n xl: 'size-12',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype TContextIconProps = Omit, 'src'> &\n VariantProps & {\n type: TContextType;\n };\n\n// `alt` defaults to empty because the tile almost always sits beside the name it\n// stands for, and announcing it twice is noise. It stays overridable for the\n// cases where the tile is the only thing identifying the row.\nfunction ContextIcon({\n type,\n size,\n className,\n alt = '',\n ...props\n}: TContextIconProps) {\n const slug = type.toLowerCase();\n\n return (\n \n );\n}\n\nexport {\n ContextIcon,\n contextIconVariants,\n CONTEXT_TYPES,\n type TContextType,\n type TContextIconProps,\n};\n", "type": "registry:ui" }, { "path": "public/icons/app.svg", "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "type": "registry:file", "target": "public/icons/app.svg" }, { "path": "public/icons/organization.svg", "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "type": "registry:file", "target": "public/icons/organization.svg" }, { "path": "public/icons/stack.svg", "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "type": "registry:file", "target": "public/icons/stack.svg" } ], "type": "registry:ui" }