@gv-tech/design-system 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"GettingStarted.d.ts","sourceRoot":"","sources":["../../src/pages/GettingStarted.tsx"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,4CA4FjC;AAED,wBAAgB,gBAAgB,4CA4K/B"}
1
+ {"version":3,"file":"GettingStarted.d.ts","sourceRoot":"","sources":["../../src/pages/GettingStarted.tsx"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,4CA4FjC;AAED,wBAAgB,gBAAgB,4CA2M/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeToggleDocs.d.ts","sourceRoot":"","sources":["../../../src/pages/components/ThemeToggleDocs.tsx"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,4CA+I9B"}
1
+ {"version":3,"file":"ThemeToggleDocs.d.ts","sourceRoot":"","sources":["../../../src/pages/components/ThemeToggleDocs.tsx"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,4CAkS9B"}
@@ -587,6 +587,20 @@
587
587
  ],
588
588
  "type": "registry:ui"
589
589
  },
590
+ {
591
+ "name": "theme-provider.test",
592
+ "files": [
593
+ "ui/theme-provider.test.tsx"
594
+ ],
595
+ "type": "registry:ui"
596
+ },
597
+ {
598
+ "name": "theme-provider",
599
+ "files": [
600
+ "ui/theme-provider.tsx"
601
+ ],
602
+ "type": "registry:ui"
603
+ },
590
604
  {
591
605
  "name": "theme-toggle.test",
592
606
  "files": [
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "theme-provider",
3
+ "type": "registry:ui",
4
+ "dependencies": [],
5
+ "registryDependencies": [],
6
+ "files": [
7
+ {
8
+ "path": "ui/theme-provider.tsx",
9
+ "content": "import type { ThemeProviderProps as NextThemesProviderProps } from 'next-themes';\nimport { ThemeProvider as NextThemesProvider } from 'next-themes';\n\nexport type ThemeProviderProps = NextThemesProviderProps;\n\nexport function ThemeProvider({ children, ...props }: ThemeProviderProps) {\n return (\n <NextThemesProvider attribute=\"class\" defaultTheme=\"system\" enableSystem {...props}>\n {children}\n </NextThemesProvider>\n );\n}\n",
10
+ "type": "registry:ui"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "theme-provider.test",
3
+ "type": "registry:ui",
4
+ "dependencies": [],
5
+ "registryDependencies": [],
6
+ "files": [
7
+ {
8
+ "path": "ui/theme-provider.test.tsx",
9
+ "content": "import { ThemeProvider } from '@/components/ui/theme-provider';\nimport { render, screen } from '@testing-library/react';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('ThemeProvider', () => {\n it('renders children correctly', () => {\n render(\n <ThemeProvider>\n <div data-testid=\"child\">Hello</div>\n </ThemeProvider>,\n );\n expect(screen.getByTestId('child')).toBeInTheDocument();\n expect(screen.getByTestId('child')).toHaveTextContent('Hello');\n });\n\n it('applies class attribute to html element by default', () => {\n render(\n <ThemeProvider>\n <div>Content</div>\n </ThemeProvider>,\n );\n // next-themes applies the attribute to the html element;\n // in jsdom the attribute should be set to 'class' by default\n const html = document.documentElement;\n // The attribute prop controls how the theme class is toggled.\n // We verify the provider renders without error, which confirms the defaults are valid.\n expect(html).toBeDefined();\n });\n\n it('allows overriding default props', () => {\n render(\n <ThemeProvider defaultTheme=\"dark\" enableSystem={false}>\n <div data-testid=\"child\">Dark Mode</div>\n </ThemeProvider>,\n );\n expect(screen.getByTestId('child')).toBeInTheDocument();\n });\n\n it('passes additional next-themes props through', () => {\n render(\n <ThemeProvider storageKey=\"my-app-theme\" themes={['light', 'dark', 'ocean']}>\n <div data-testid=\"child\">Custom themes</div>\n </ThemeProvider>,\n );\n expect(screen.getByTestId('child')).toBeInTheDocument();\n });\n});\n",
10
+ "type": "registry:ui"
11
+ }
12
+ ]
13
+ }