@abeedoo/radish-schemas 1.7.7

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.
@@ -0,0 +1,199 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://radish.dev/schemas/components.schema.json",
4
+ "title": "Radish Components Blueprint",
5
+ "description": "Schema for mapping named UI components to @radish/components primitives. Each component defines a base primitive, optional entity binding, field mappings, display modes, and actions.",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "components"
10
+ ],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "version": {
14
+ "type": "integer",
15
+ "minimum": 1,
16
+ "description": "Blueprint spec version"
17
+ },
18
+ "components": {
19
+ "type": "object",
20
+ "description": "Component definitions keyed by component name",
21
+ "minProperties": 1,
22
+ "patternProperties": {
23
+ "^[A-Z][A-Za-z0-9]*$": {
24
+ "$ref": "#/definitions/component"
25
+ }
26
+ },
27
+ "additionalProperties": false
28
+ }
29
+ },
30
+ "definitions": {
31
+ "component": {
32
+ "type": "object",
33
+ "required": [
34
+ "base"
35
+ ],
36
+ "additionalProperties": false,
37
+ "properties": {
38
+ "base": {
39
+ "type": "string",
40
+ "description": "The @radish/components primitive to compose",
41
+ "enum": [
42
+ "Button",
43
+ "Dropdown",
44
+ "Swap",
45
+ "ThemeController",
46
+ "AutoForm",
47
+ "ChatPanel",
48
+ "ConfirmDialog",
49
+ "DataTable",
50
+ "EmptyState",
51
+ "Icon",
52
+ "Modal",
53
+ "PageHeader",
54
+ "Tabs",
55
+ "Accordion",
56
+ "Avatar",
57
+ "Badge",
58
+ "Carousel",
59
+ "ChatBubble",
60
+ "CodeBlock",
61
+ "Collapse",
62
+ "Countdown",
63
+ "Kbd",
64
+ "List",
65
+ "Stat",
66
+ "StatGroup",
67
+ "Status",
68
+ "Table",
69
+ "Timeline",
70
+ "Calendar",
71
+ "Checkbox",
72
+ "DateRangeInput",
73
+ "DropZone",
74
+ "FileInput",
75
+ "FormField",
76
+ "Radio",
77
+ "Range",
78
+ "Rating",
79
+ "SearchInput",
80
+ "Select",
81
+ "TextInput",
82
+ "Textarea",
83
+ "Toggle",
84
+ "Alert",
85
+ "Loading",
86
+ "Progress",
87
+ "RadialProgress",
88
+ "Skeleton",
89
+ "Toast",
90
+ "Tooltip",
91
+ "Card",
92
+ "Divider",
93
+ "Drawer",
94
+ "Footer",
95
+ "Hero",
96
+ "Stack",
97
+ "Breadcrumbs",
98
+ "Dock",
99
+ "Link",
100
+ "Menu",
101
+ "Navbar",
102
+ "Pagination",
103
+ "Steps",
104
+ "ContentBlock"
105
+ ]
106
+ },
107
+ "entity": {
108
+ "type": "string",
109
+ "description": "Entity name from types blueprint to bind this component to (PascalCase)",
110
+ "pattern": "^[A-Z][A-Za-z0-9]*$"
111
+ },
112
+ "fields": {
113
+ "type": "object",
114
+ "description": "Map component slots (title, body, badge, subtitle, image, etc.) to entity field names",
115
+ "patternProperties": {
116
+ "^[a-zA-Z][a-zA-Z0-9]*$": {
117
+ "type": "string"
118
+ }
119
+ },
120
+ "additionalProperties": false
121
+ },
122
+ "columns": {
123
+ "type": "array",
124
+ "description": "Entity fields to display as columns in table/grid views",
125
+ "items": {
126
+ "type": "string"
127
+ }
128
+ },
129
+ "display": {
130
+ "type": "string",
131
+ "enum": [
132
+ "table",
133
+ "grid",
134
+ "preview"
135
+ ],
136
+ "description": "Display mode for list/data components"
137
+ },
138
+ "cardComponent": {
139
+ "type": "string",
140
+ "description": "Reference to another component definition to use as the card renderer in grid display",
141
+ "pattern": "^[A-Z][A-Za-z0-9]*$"
142
+ },
143
+ "props": {
144
+ "type": "object",
145
+ "description": "Static property values for non-entity components (e.g., hero title, button label)",
146
+ "additionalProperties": true
147
+ },
148
+ "actions": {
149
+ "type": "array",
150
+ "description": "Action buttons to render with the component",
151
+ "items": {
152
+ "$ref": "#/definitions/action"
153
+ }
154
+ },
155
+ "editable": {
156
+ "type": "boolean",
157
+ "description": "Whether this is a CMS-backed editable content block"
158
+ },
159
+ "defaultContent": {
160
+ "type": "string",
161
+ "description": "Default HTML content for editable content blocks"
162
+ }
163
+ }
164
+ },
165
+ "action": {
166
+ "type": "object",
167
+ "required": [
168
+ "label"
169
+ ],
170
+ "additionalProperties": false,
171
+ "properties": {
172
+ "label": {
173
+ "type": "string",
174
+ "description": "Button label text"
175
+ },
176
+ "href": {
177
+ "type": "string",
178
+ "description": "Link target. Supports interpolation with entity fields (e.g., /courses/{id})"
179
+ },
180
+ "variant": {
181
+ "type": "string",
182
+ "enum": [
183
+ "primary",
184
+ "secondary",
185
+ "accent",
186
+ "ghost",
187
+ "link",
188
+ "outline"
189
+ ],
190
+ "description": "Button style variant"
191
+ },
192
+ "icon": {
193
+ "type": "string",
194
+ "description": "Icon name to display on the button"
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
@@ -0,0 +1,49 @@
1
+ import { readFileSync } from 'fs';
2
+ import { fileURLToPath } from 'url';
3
+ import { dirname, join } from 'path';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+
8
+ export const typesSchema = JSON.parse(
9
+ readFileSync(join(__dirname, 'types.schema.json'), 'utf-8')
10
+ );
11
+
12
+ export const rolesSchema = JSON.parse(
13
+ readFileSync(join(__dirname, 'roles.schema.json'), 'utf-8')
14
+ );
15
+
16
+ export const appSchema = JSON.parse(
17
+ readFileSync(join(__dirname, 'app.schema.json'), 'utf-8')
18
+ );
19
+
20
+ export const uiSchema = JSON.parse(
21
+ readFileSync(join(__dirname, 'ui.schema.json'), 'utf-8')
22
+ );
23
+
24
+ export const componentsSchema = JSON.parse(
25
+ readFileSync(join(__dirname, 'components.schema.json'), 'utf-8')
26
+ );
27
+
28
+ export const themeSchema = JSON.parse(
29
+ readFileSync(join(__dirname, 'theme.schema.json'), 'utf-8')
30
+ );
31
+
32
+ export function getSchema(name) {
33
+ switch (name) {
34
+ case 'types':
35
+ return typesSchema;
36
+ case 'roles':
37
+ return rolesSchema;
38
+ case 'app':
39
+ return appSchema;
40
+ case 'ui':
41
+ return uiSchema;
42
+ case 'components':
43
+ return componentsSchema;
44
+ case 'theme':
45
+ return themeSchema;
46
+ default:
47
+ throw new Error(`Unknown schema: ${name}`);
48
+ }
49
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://radish.dev/schemas/roles.schema.json",
4
+ "title": "Radish Roles Blueprint",
5
+ "description": "Schema for defining roles and permissions in Radish CLI projects",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "roles"
10
+ ],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "version": {
14
+ "type": "integer",
15
+ "minimum": 1,
16
+ "description": "Schema version"
17
+ },
18
+ "roles": {
19
+ "type": "object",
20
+ "description": "Role definitions mapped by role key",
21
+ "minProperties": 1,
22
+ "patternProperties": {
23
+ "^[A-Z][A-Z0-9_]*$": {
24
+ "type": "object",
25
+ "description": "Role definition",
26
+ "required": [
27
+ "label",
28
+ "description",
29
+ "isSystem"
30
+ ],
31
+ "additionalProperties": false,
32
+ "properties": {
33
+ "label": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 100,
37
+ "description": "Human-readable role name"
38
+ },
39
+ "description": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 500,
43
+ "description": "Role description"
44
+ },
45
+ "isSystem": {
46
+ "type": "boolean",
47
+ "description": "Whether this is a system-managed role (permissions resolved in code)"
48
+ },
49
+ "permissions": {
50
+ "type": "array",
51
+ "description": "List of permission keys (ignored for system roles)",
52
+ "items": {
53
+ "type": "string",
54
+ "pattern": "^[a-z][a-zA-Z0-9-]*:[a-z*][a-zA-Z0-9:*-]*$",
55
+ "description": "Permission key in format 'entity:action' or 'entity:action:scope'"
56
+ },
57
+ "uniqueItems": true
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,196 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://radish.dev/schemas/theme.schema.json",
4
+ "title": "Radish Theme Blueprint",
5
+ "description": "Schema for defining DaisyUI v5 design tokens including colors, typography, border radius, and background definitions.",
6
+ "type": "object",
7
+ "required": [
8
+ "version",
9
+ "theme"
10
+ ],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "version": {
14
+ "type": "integer",
15
+ "minimum": 1,
16
+ "description": "Blueprint spec version"
17
+ },
18
+ "theme": {
19
+ "type": "object",
20
+ "description": "Theme definition with design tokens",
21
+ "required": [
22
+ "name",
23
+ "colorScheme",
24
+ "colors"
25
+ ],
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "name": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "pattern": "^[a-z][a-z0-9-]*$",
32
+ "description": "Theme identifier (lowercase, no spaces)"
33
+ },
34
+ "colorScheme": {
35
+ "type": "string",
36
+ "enum": [
37
+ "light",
38
+ "dark"
39
+ ],
40
+ "description": "Base color scheme"
41
+ },
42
+ "colors": {
43
+ "type": "object",
44
+ "description": "DaisyUI color tokens (hex values)",
45
+ "required": [
46
+ "primary",
47
+ "secondary",
48
+ "accent",
49
+ "neutral",
50
+ "base100",
51
+ "base200",
52
+ "base300",
53
+ "info",
54
+ "success",
55
+ "warning",
56
+ "error"
57
+ ],
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "primary": {
61
+ "type": "string",
62
+ "pattern": "^#[0-9a-fA-F]{6}$",
63
+ "description": "Primary brand color"
64
+ },
65
+ "secondary": {
66
+ "type": "string",
67
+ "pattern": "^#[0-9a-fA-F]{6}$",
68
+ "description": "Secondary color"
69
+ },
70
+ "accent": {
71
+ "type": "string",
72
+ "pattern": "^#[0-9a-fA-F]{6}$",
73
+ "description": "Accent color for contrast"
74
+ },
75
+ "neutral": {
76
+ "type": "string",
77
+ "pattern": "^#[0-9a-fA-F]{6}$",
78
+ "description": "Neutral color for text and borders"
79
+ },
80
+ "base100": {
81
+ "type": "string",
82
+ "pattern": "^#[0-9a-fA-F]{6}$",
83
+ "description": "Main background color"
84
+ },
85
+ "base200": {
86
+ "type": "string",
87
+ "pattern": "^#[0-9a-fA-F]{6}$",
88
+ "description": "Subtle background variation"
89
+ },
90
+ "base300": {
91
+ "type": "string",
92
+ "pattern": "^#[0-9a-fA-F]{6}$",
93
+ "description": "Strongest background variation"
94
+ },
95
+ "info": {
96
+ "type": "string",
97
+ "pattern": "^#[0-9a-fA-F]{6}$",
98
+ "description": "Info status color"
99
+ },
100
+ "success": {
101
+ "type": "string",
102
+ "pattern": "^#[0-9a-fA-F]{6}$",
103
+ "description": "Success status color"
104
+ },
105
+ "warning": {
106
+ "type": "string",
107
+ "pattern": "^#[0-9a-fA-F]{6}$",
108
+ "description": "Warning status color"
109
+ },
110
+ "error": {
111
+ "type": "string",
112
+ "pattern": "^#[0-9a-fA-F]{6}$",
113
+ "description": "Error status color"
114
+ }
115
+ }
116
+ },
117
+ "typography": {
118
+ "type": "object",
119
+ "description": "Font settings",
120
+ "additionalProperties": false,
121
+ "properties": {
122
+ "fontFamily": {
123
+ "type": "string",
124
+ "description": "Primary font family (e.g., 'Inter, sans-serif')"
125
+ },
126
+ "headingFont": {
127
+ "type": "string",
128
+ "description": "Heading font family (e.g., 'Poppins, sans-serif')"
129
+ }
130
+ }
131
+ },
132
+ "radius": {
133
+ "type": "object",
134
+ "description": "Border radius tokens (CSS rem values)",
135
+ "additionalProperties": false,
136
+ "properties": {
137
+ "box": {
138
+ "type": "string",
139
+ "description": "Border radius for cards and containers (e.g., '0.5rem')"
140
+ },
141
+ "button": {
142
+ "type": "string",
143
+ "description": "Border radius for buttons (e.g., '0.25rem')"
144
+ },
145
+ "badge": {
146
+ "type": "string",
147
+ "description": "Border radius for badges (e.g., '1rem')"
148
+ }
149
+ }
150
+ },
151
+ "backgrounds": {
152
+ "type": "object",
153
+ "description": "Named background definitions for page sections",
154
+ "patternProperties": {
155
+ "^[a-zA-Z][a-zA-Z0-9]*$": {
156
+ "$ref": "#/definitions/background"
157
+ }
158
+ },
159
+ "additionalProperties": false
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "definitions": {
165
+ "background": {
166
+ "type": "object",
167
+ "required": [
168
+ "type"
169
+ ],
170
+ "additionalProperties": false,
171
+ "properties": {
172
+ "type": {
173
+ "type": "string",
174
+ "enum": [
175
+ "solid",
176
+ "gradient",
177
+ "image"
178
+ ],
179
+ "description": "Background type"
180
+ },
181
+ "color": {
182
+ "type": "string",
183
+ "description": "Solid background color (hex or CSS value)"
184
+ },
185
+ "gradient": {
186
+ "type": "string",
187
+ "description": "CSS gradient value (e.g., 'linear-gradient(135deg, #334155, #4f46e5)')"
188
+ },
189
+ "url": {
190
+ "type": "string",
191
+ "description": "Background image URL"
192
+ }
193
+ }
194
+ }
195
+ }
196
+ }