{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "design-system-provider",
  "title": "Design System Provider",
  "description": "Design System Provider from the Get IT Done design system.",
  "dependencies": [],
  "registryDependencies": [
    "https://zero-design.itdone.de/r/labels.json",
    "https://zero-design.itdone.de/r/labels-context.json",
    "https://zero-design.itdone.de/r/labels-de.json",
    "https://zero-design.itdone.de/r/labels-en.json",
    "https://zero-design.itdone.de/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ui/design-system-provider.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\n\nimport { DesignSystemContext, type DesignSystemContextValue, type DesignSystemPreset, intlLocaleOf, useLabels, useLocale, usePreset } from '@/components/ui/labels-context';\nimport { type DesignSystemLocale, type Labels } from '@/components/ui/labels';\nimport { labelsDe } from '@/components/ui/labels-de';\nimport { labelsEn } from '@/components/ui/labels-en';\n\nexport type { DesignSystemLocale } from '@/components/ui/labels';\nexport type { DesignSystemPreset } from '@/components/ui/labels-context';\n\nconst labelsByLocale: Record<DesignSystemLocale, Labels> = { en: labelsEn, de: labelsDe };\n\nexport interface DesignSystemProviderProps {\n  // Language of the built-in texts and the date and number formats. Defaults to `en`.\n  locale?: DesignSystemLocale;\n  // Overrides single built-in texts for every component below the provider.\n  labels?: Partial<Labels>;\n  // Product look for the component defaults below the provider. `zero` is the workload.zero look. Inherits from the parent provider and defaults to `zero` in this package (the theme it ships is the zero theme). Pass `preset=\"default\"` for the former look of the components.\n  preset?: DesignSystemPreset;\n  children?: React.ReactNode;\n}\n\n// Nested providers inherit from the closest parent, so a subtree can switch only the locale or one label.\nconst DesignSystemProvider = ({ locale, labels, preset, children }: DesignSystemProviderProps) => {\n  const parent = React.useContext(DesignSystemContext);\n  const resolvedLocale = locale ?? parent.locale;\n  const resolvedPreset = preset ?? parent.preset;\n  const value = React.useMemo<DesignSystemContextValue>(\n    () => ({\n      locale: resolvedLocale,\n      preset: resolvedPreset,\n      labels: { ...(locale ? labelsByLocale[locale] : parent.labels), ...labels },\n    }),\n    [locale, resolvedLocale, resolvedPreset, labels, parent.labels],\n  );\n  return <DesignSystemContext.Provider value={value}>{children}</DesignSystemContext.Provider>;\n};\nDesignSystemProvider.displayName = 'DesignSystemProvider';\n\nexport { DesignSystemProvider, intlLocaleOf, useLabels, useLocale, usePreset };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}