{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tag",
  "type": "registry:ui",
  "title": "Tag",
  "description": "Tag is a compact label used to categorize, classify, or annotate content with color-coded visual styles.",
  "dependencies": [
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/tag/Tag.context.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tag/Tag.context.tsx",
      "content": "'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { TagContextValue } from './Tag.types';\n\nexport const TagContext = createContext<TagContextValue | undefined>(undefined);\n\nexport const useTagContext = () => {\n  const context = useContext(TagContext);\n\n  if (context === undefined) {\n    throw new Error('useTagContext must be used within a Tag');\n  }\n\n  return context;\n};\n"
    },
    {
      "path": "src/components/tag/Tag.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tag/Tag.tsx",
      "content": "'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { TagContext } from './Tag.context';\nimport type { TagProps, TagWithSubComponents } from './Tag.types';\nimport { tagVariants } from './Tag.variants';\nimport { TagIcon } from './TagIcon';\n\nconst Tag = forwardRef<HTMLDivElement, TagProps>(\n  (\n    {\n      className,\n      size = 'md',\n      color = 'brand',\n      preset = 'filled',\n      shape = 'square',\n      children,\n      truncate,\n      iconOnly = false,\n      ...props\n    },\n    ref,\n  ) => {\n    return (\n      <TagContext.Provider value={{ size, color }}>\n        <div\n          className={cn(\n            tagVariants({\n              size,\n              color,\n              preset,\n              shape,\n              truncate,\n              iconOnly,\n            }),\n            className,\n          )}\n          ref={ref}\n          data-slot=\"tag\"\n          {...props}\n        >\n          {truncate ? <span className=\"min-w-0 flex-1 truncate\">{children}</span> : children}\n        </div>\n      </TagContext.Provider>\n    );\n  },\n) as TagWithSubComponents;\n\nTag.displayName = 'Tag';\nTag.Icon = TagIcon;\n\nexport { Tag };\n"
    },
    {
      "path": "src/components/tag/Tag.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/tag/Tag.types.ts",
      "content": "import type { RemixiconComponentType } from '@remixicon/react';\nimport type { VariantProps } from 'class-variance-authority';\nimport type {\n  ForwardRefExoticComponent,\n  HTMLAttributes,\n  PropsWithoutRef,\n  RefAttributes,\n} from 'react';\n\nimport type { tagVariants } from './Tag.variants';\nimport type { TagIcon } from './TagIcon';\n\nexport type TagContextValue = {\n  size: VariantProps<typeof tagVariants>['size'];\n  color: VariantProps<typeof tagVariants>['color'];\n};\n\n/** A compact descriptive label with optional icon. */\nexport type TagProps = {\n  /** When true, truncates overflowing text with an ellipsis. */\n  truncate?: boolean;\n  /** When true, renders the tag as an icon-only variant with equal padding on all sides. */\n  iconOnly?: boolean;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'color'> &\n  VariantProps<typeof tagVariants>;\n\nexport type TagWithSubComponents = ForwardRefExoticComponent<\n  PropsWithoutRef<TagProps> & RefAttributes<HTMLDivElement>\n> & {\n  Icon: typeof TagIcon;\n};\n\n/** An icon rendered within `Tag`. */\nexport type TagIconProps = HTMLAttributes<HTMLDivElement> & {\n  /** Icon component from `@remixicon/react`. */\n  icon: RemixiconComponentType;\n};\n"
    },
    {
      "path": "src/components/tag/Tag.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/tag/Tag.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\n\nexport const tagVariants = cva('inline-flex w-fit items-center', {\n  variants: {\n    size: {\n      sm: 'typography-caption-strong-md h-ws-11 gap-ws-2',\n      md: 'typography-label-strong-sm h-ws-12 gap-ws-3',\n      lg: 'typography-label-strong-sm h-ws-13 gap-ws-3',\n    },\n    color: {\n      brand: 'text-ws-non-semantic-brand-on-subtle',\n      red: 'text-ws-non-semantic-red-on-subtle',\n      pink: 'text-ws-non-semantic-pink-on-subtle',\n      violet: 'text-ws-non-semantic-violet-on-subtle',\n      purple: 'text-ws-non-semantic-purple-on-subtle',\n      indigo: 'text-ws-non-semantic-indigo-on-subtle',\n      blue: 'text-ws-non-semantic-blue-on-subtle',\n      cyan: 'text-ws-non-semantic-cyan-on-subtle',\n      teal: 'text-ws-non-semantic-teal-on-subtle',\n      green: 'text-ws-non-semantic-green-on-subtle',\n      lime: 'text-ws-non-semantic-lime-on-subtle',\n      yellow: 'text-ws-non-semantic-yellow-on-subtle',\n      orange: 'text-ws-non-semantic-orange-on-subtle',\n      secondary: 'text-ws-dynamic-secondary-default',\n    },\n    // Figma's Filled variant carries no stroke at all (strokes: []), so the\n    // border belongs to the Border preset rather than the base.\n    preset: {\n      filled: '',\n      border: 'bg-ws-static-highlight-subtle border',\n    },\n    shape: {\n      square: '',\n      rounded: 'rounded-ws-control-full',\n    },\n    truncate: {\n      true: 'max-w-full min-w-0',\n      false: 'whitespace-nowrap',\n    },\n    iconOnly: {\n      true: 'justify-center',\n      false: '',\n    },\n  },\n  compoundVariants: [\n    {\n      iconOnly: false,\n      size: 'sm',\n      className: 'px-ws-4',\n    },\n    // At md and lg Figma insets the icon side by one step (paddingLeft Gap/4 vs\n    // Gap/5 at md, Gap/5 vs Gap/6 at lg) when an icon leads. Small is symmetric.\n    // The second selector covers truncate={true}, where Tag wraps all children\n    // — the icon included — in a single span, so the icon is no longer a direct\n    // child of the root.\n    {\n      iconOnly: false,\n      size: 'md',\n      className:\n        'px-ws-5 [&>[data-slot=tag-icon]:first-child]:-ml-ws-2 [&>span>[data-slot=tag-icon]:first-child]:-ml-ws-2',\n    },\n    {\n      iconOnly: false,\n      size: 'lg',\n      className:\n        'px-ws-6 [&>[data-slot=tag-icon]:first-child]:-ml-ws-2 [&>span>[data-slot=tag-icon]:first-child]:-ml-ws-2',\n    },\n    {\n      iconOnly: true,\n      size: 'sm',\n      className: 'w-ws-11 px-0',\n    },\n    {\n      iconOnly: true,\n      size: 'md',\n      className: 'w-ws-12 px-0',\n    },\n    {\n      iconOnly: true,\n      size: 'lg',\n      className: 'w-ws-13 px-0',\n    },\n    {\n      size: ['lg', 'md'],\n      shape: 'square',\n      className: 'rounded-ws-control-md',\n    },\n    {\n      size: 'sm',\n      shape: 'square',\n      className: 'rounded-ws-control-sm',\n    },\n    {\n      color: 'brand',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-brand-subtle',\n    },\n    {\n      color: 'red',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-red-subtle',\n    },\n    {\n      color: 'pink',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-pink-subtle',\n    },\n    {\n      color: 'violet',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-violet-subtle',\n    },\n    {\n      color: 'purple',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-purple-subtle',\n    },\n    {\n      color: 'indigo',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-indigo-subtle',\n    },\n    {\n      color: 'blue',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-blue-subtle',\n    },\n    {\n      color: 'cyan',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-cyan-subtle',\n    },\n    {\n      color: 'teal',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-teal-subtle',\n    },\n    {\n      color: 'green',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-green-subtle',\n    },\n    {\n      color: 'lime',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-lime-subtle',\n    },\n    {\n      color: 'yellow',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-yellow-subtle',\n    },\n    {\n      color: 'orange',\n      preset: 'filled',\n      className: 'bg-ws-non-semantic-orange-subtle',\n    },\n    {\n      color: 'secondary',\n      preset: 'filled',\n      className: 'bg-ws-dynamic-secondary-alpha-strong-default',\n    },\n    {\n      color: 'brand',\n      preset: 'border',\n      className: 'border-ws-non-semantic-brand-default',\n    },\n    {\n      color: 'red',\n      preset: 'border',\n      className: 'border-ws-non-semantic-red-default',\n    },\n    {\n      color: 'pink',\n      preset: 'border',\n      className: 'border-ws-non-semantic-pink-default',\n    },\n    {\n      color: 'violet',\n      preset: 'border',\n      className: 'border-ws-non-semantic-violet-default',\n    },\n    {\n      color: 'purple',\n      preset: 'border',\n      className: 'border-ws-non-semantic-purple-default',\n    },\n    {\n      color: 'indigo',\n      preset: 'border',\n      className: 'border-ws-non-semantic-indigo-default',\n    },\n    {\n      color: 'blue',\n      preset: 'border',\n      className: 'border-ws-non-semantic-blue-default',\n    },\n    {\n      color: 'cyan',\n      preset: 'border',\n      className: 'border-ws-non-semantic-cyan-default',\n    },\n    {\n      color: 'teal',\n      preset: 'border',\n      className: 'border-ws-non-semantic-teal-default',\n    },\n    {\n      color: 'green',\n      preset: 'border',\n      className: 'border-ws-non-semantic-green-default',\n    },\n    {\n      color: 'lime',\n      preset: 'border',\n      className: 'border-ws-non-semantic-lime-default',\n    },\n    {\n      color: 'yellow',\n      preset: 'border',\n      className: 'border-ws-non-semantic-yellow-default',\n    },\n    {\n      color: 'orange',\n      preset: 'border',\n      className: 'border-ws-non-semantic-orange-default',\n    },\n  ],\n  defaultVariants: {\n    size: 'md',\n    color: 'brand',\n    preset: 'filled',\n    shape: 'square',\n    truncate: false,\n    iconOnly: false,\n  },\n});\n\nexport const iconVariants = cva('', {\n  variants: {\n    size: {\n      sm: 'h-ws-7 w-ws-7',\n      md: 'h-ws-8 w-ws-8',\n      lg: 'h-ws-9 w-ws-9',\n    },\n    color: {\n      brand: 'text-ws-non-semantic-brand-on-subtle',\n      red: 'text-ws-non-semantic-red-on-subtle',\n      pink: 'text-ws-non-semantic-pink-on-subtle',\n      violet: 'text-ws-non-semantic-violet-on-subtle',\n      purple: 'text-ws-non-semantic-purple-on-subtle',\n      indigo: 'text-ws-non-semantic-indigo-on-subtle',\n      blue: 'text-ws-non-semantic-blue-on-subtle',\n      cyan: 'text-ws-non-semantic-cyan-on-subtle',\n      teal: 'text-ws-non-semantic-teal-on-subtle',\n      green: 'text-ws-non-semantic-green-on-subtle',\n      lime: 'text-ws-non-semantic-lime-on-subtle',\n      yellow: 'text-ws-non-semantic-yellow-on-subtle',\n      orange: 'text-ws-non-semantic-orange-on-subtle',\n      secondary: 'text-ws-dynamic-secondary-default',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    color: 'brand',\n  },\n});\n\nexport const iconButtonVariants = cva('rounded-full p-0', {\n  variants: {\n    size: {\n      sm: 'size-ws-9',\n      md: 'size-ws-10',\n      lg: 'size-ws-12',\n    },\n  },\n});\n\nexport const iconButtonIconVariants = cva('w-auto p-0', {\n  variants: {\n    size: {\n      sm: 'size-ws-6',\n      md: 'size-ws-7',\n      lg: 'size-ws-9',\n    },\n    color: {\n      brand: 'text-ws-non-semantic-brand-on-subtle',\n      red: 'text-ws-non-semantic-red-on-subtle',\n      pink: 'text-ws-non-semantic-pink-on-subtle',\n      violet: 'text-ws-non-semantic-violet-on-subtle',\n      purple: 'text-ws-non-semantic-purple-on-subtle',\n      indigo: 'text-ws-non-semantic-indigo-on-subtle',\n      blue: 'text-ws-non-semantic-blue-on-subtle',\n      cyan: 'text-ws-non-semantic-cyan-on-subtle',\n      teal: 'text-ws-non-semantic-teal-on-subtle',\n      green: 'text-ws-non-semantic-green-on-subtle',\n      lime: 'text-ws-non-semantic-lime-on-subtle',\n      yellow: 'text-ws-non-semantic-yellow-on-subtle',\n      orange: 'text-ws-non-semantic-orange-on-subtle',\n      secondary: 'text-ws-dynamic-secondary-default',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    color: 'brand',\n  },\n});\n"
    },
    {
      "path": "src/components/tag/TagIcon.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/tag/TagIcon.tsx",
      "content": "'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useTagContext } from './Tag.context';\nimport type { TagIconProps } from './Tag.types';\nimport { iconVariants } from './Tag.variants';\n\nconst TagIcon = forwardRef<HTMLDivElement, TagIconProps>(\n  ({ className, icon: Icon, ...props }, ref) => {\n    const { size, color } = useTagContext();\n\n    return (\n      // Tag's leading-icon inset selector keys off `tag-icon`; a caller can still\n      // override it, like every other part marker.\n      <div ref={ref} data-slot=\"tag-icon\" {...props}>\n        <Icon\n          aria-hidden=\"true\"\n          focusable=\"false\"\n          className={cn(iconVariants({ size, color }), className)}\n        />\n      </div>\n    );\n  },\n);\n\nTagIcon.displayName = 'Tag.Icon';\n\nexport { TagIcon };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
