@gentleduck/registers 0.1.1
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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/index.ts +16 -0
- package/package.json +35 -0
- package/registry-blocks/index.ts +3 -0
- package/registry-blocks/registry-auth.ts +55 -0
- package/registry-blocks/registry-charts.ts +577 -0
- package/registry-blocks/registry-dashboards.ts +13 -0
- package/registry-colors/index.ts +3 -0
- package/registry-colors/registry-base-colors.ts +1721 -0
- package/registry-colors/registry-colors.dto.ts +68 -0
- package/registry-colors/registry-colors.ts +1810 -0
- package/registry-colors/registry-themes.ts +1086 -0
- package/registry-examples/index.ts +1 -0
- package/registry-examples/registry-examples.ts +398 -0
- package/registry-schema/index.ts +1 -0
- package/registry-schema/registry-schema.ts +93 -0
- package/registry-ui/index.ts +1 -0
- package/registry-ui/registry-ui.ts +385 -0
- package/styles.ts +8 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
// HSL color schema
|
|
4
|
+
export const hsl_schema = z.string()
|
|
5
|
+
export const radiusSchema = z.string()
|
|
6
|
+
|
|
7
|
+
// CSS variables schema
|
|
8
|
+
export const css_vars_schema = z
|
|
9
|
+
.object({
|
|
10
|
+
accent: hsl_schema,
|
|
11
|
+
'accent-foreground': hsl_schema,
|
|
12
|
+
background: hsl_schema,
|
|
13
|
+
border: hsl_schema,
|
|
14
|
+
card: hsl_schema,
|
|
15
|
+
'card-foreground': hsl_schema,
|
|
16
|
+
'chart-1': hsl_schema,
|
|
17
|
+
'chart-2': hsl_schema,
|
|
18
|
+
'chart-3': hsl_schema,
|
|
19
|
+
'chart-4': hsl_schema,
|
|
20
|
+
'chart-5': hsl_schema,
|
|
21
|
+
destructive: hsl_schema,
|
|
22
|
+
'destructive-foreground': hsl_schema,
|
|
23
|
+
foreground: hsl_schema,
|
|
24
|
+
input: hsl_schema,
|
|
25
|
+
muted: hsl_schema,
|
|
26
|
+
'muted-foreground': hsl_schema,
|
|
27
|
+
popover: hsl_schema,
|
|
28
|
+
'popover-foreground': hsl_schema,
|
|
29
|
+
primary: hsl_schema,
|
|
30
|
+
'primary-foreground': hsl_schema,
|
|
31
|
+
radius: radiusSchema,
|
|
32
|
+
ring: hsl_schema,
|
|
33
|
+
secondary: hsl_schema,
|
|
34
|
+
'secondary-foreground': hsl_schema,
|
|
35
|
+
warning: hsl_schema,
|
|
36
|
+
'warning-foreground': hsl_schema,
|
|
37
|
+
})
|
|
38
|
+
.catchall(z.string())
|
|
39
|
+
export type CSSVars = z.infer<typeof css_vars_schema>
|
|
40
|
+
|
|
41
|
+
export const color_scheme = z.object({
|
|
42
|
+
activeColor: z
|
|
43
|
+
.object({
|
|
44
|
+
dark: hsl_schema,
|
|
45
|
+
light: hsl_schema,
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
48
|
+
// This will be used for themes not base_colors
|
|
49
|
+
css: z
|
|
50
|
+
.object({
|
|
51
|
+
'@layer base': z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
cssVars: z.object({
|
|
55
|
+
dark: css_vars_schema.omit({ radius: true }),
|
|
56
|
+
light: css_vars_schema,
|
|
57
|
+
// This will be used for themes not base_colors
|
|
58
|
+
theme: z.record(z.string(), z.string()).optional(),
|
|
59
|
+
}),
|
|
60
|
+
label: z.string().optional(),
|
|
61
|
+
name: z.string(),
|
|
62
|
+
})
|
|
63
|
+
export type ColorScheme = z.infer<typeof color_scheme>
|
|
64
|
+
|
|
65
|
+
export const color_base_schema = z.array(color_scheme).min(1, {
|
|
66
|
+
message: 'At least one color scheme is required',
|
|
67
|
+
})
|
|
68
|
+
export type ColorBase = z.infer<typeof color_base_schema>
|