{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "snippet",
  "title": "snippet",
  "description": "snippet",
  "dependencies": [
    "react-aria-components"
  ],
  "registryDependencies": [
    "https://intentui.com/r/button",
    "https://intentui.com/r/tabs",
    "https://intentui.com/r/use-clipboard",
    "https://intentui.com/r/primitive"
  ],
  "files": [
    {
      "path": "src/components/ui/snippet.tsx",
      "content": "'use client'\n\nimport { useSlottedContext } from 'react-aria-components/slots'\nimport { type TabPanelProps, TabsContext, type TabsProps } from 'react-aria-components/Tabs'\nimport { Button } from '@/components/ui/button'\nimport { Tab, TabList, type TabListProps, TabPanel, TabPanels, Tabs } from '@/components/ui/tabs'\nimport { useClipboard } from '@/hooks/use-clipboard'\nimport { cx } from '@/lib/primitive'\n\nexport const Snippet = ({ className, ...props }: TabsProps) => (\n  <Tabs\n    className={cx(\n      'not-typeset group w-full gap-0 overflow-hidden rounded-md border bg-bg',\n      className\n    )}\n    {...props}\n  />\n)\n\nexport function SnippetTabsList<T extends object>({ className, ...props }: TabListProps<T>) {\n  const { orientation } = useSlottedContext(TabsContext)!\n  return (\n    <TabList\n      className={cx(\n        'bg-muted',\n        orientation === 'horizontal' &&\n          'flex-row gap-x-(--tab-list-gutter) rounded-(--tab-list-rounded) border-b px-4 py-(--tab-list-gutter)',\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport const SnippetTab = ({ className, ...props }: React.ComponentProps<typeof Tab>) => (\n  <Tab className={cx('gap-1.5', className)} {...props} />\n)\n\nexport const SnippetTabPanels = TabPanels\n\nexport function SnippetTabPanel({ className, children, ...props }: TabPanelProps) {\n  const { copy, copied } = useClipboard()\n  return (\n    <TabPanel className={cx('mt-0 px-4 py-2 text-sm dark:bg-secondary/70', className)} {...props}>\n      {(values) => (\n        <>\n          {typeof children === 'function' ? (\n            <pre className=\"truncate\">{children(values)}</pre>\n          ) : (\n            <div className=\"flex items-center justify-between\">\n              <pre className=\"truncate\">{children}</pre>\n              <Button\n                className=\"-me-2\"\n                size=\"sq-sm\"\n                intent=\"plain\"\n                onPress={() => {\n                  copy(children as string)\n                }}\n              >\n                {copied ? (\n                  <>\n                    <svg\n                      data-slot=\"icon\"\n                      xmlns=\"http://www.w3.org/2000/svg\"\n                      fill=\"none\"\n                      viewBox=\"0 0 24 24\"\n                      strokeWidth={1.5}\n                      stroke=\"currentColor\"\n                    >\n                      <path\n                        strokeLinecap=\"round\"\n                        strokeLinejoin=\"round\"\n                        d=\"m4.5 12.75 6 6 9-13.5\"\n                      />\n                    </svg>\n                    <span className=\"sr-only\">Copied</span>\n                  </>\n                ) : (\n                  <>\n                    <svg\n                      data-slot=\"icon\"\n                      viewBox=\"0 0 18 18\"\n                      fill=\"none\"\n                      xmlns=\"http://www.w3.org/2000/svg\"\n                    >\n                      <path\n                        d=\"M14.25 5.25H7.25C6.14543 5.25 5.25 6.14543 5.25 7.25V14.25C5.25 15.3546 6.14543 16.25 7.25 16.25H14.25C15.3546 16.25 16.25 15.3546 16.25 14.25V7.25C16.25 6.14543 15.3546 5.25 14.25 5.25Z\"\n                        stroke=\"currentColor\"\n                        strokeWidth=\"1.5\"\n                        strokeLinecap=\"round\"\n                        strokeLinejoin=\"round\"\n                      />\n                      <path\n                        d=\"M2.80103 11.998L1.77203 5.07397C1.61003 3.98097 2.36403 2.96397 3.45603 2.80197L10.38 1.77297C11.313 1.63397 12.19 2.16297 12.528 3.00097\"\n                        stroke=\"currentColor\"\n                        strokeWidth=\"1.5\"\n                        strokeLinecap=\"round\"\n                        strokeLinejoin=\"round\"\n                      />\n                    </svg>\n                    <span className=\"sr-only\">Copy to clipboard</span>\n                  </>\n                )}\n              </Button>\n            </div>\n          )}\n        </>\n      )}\n    </TabPanel>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}