-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mapping): create mapping schema
- Loading branch information
Showing
11 changed files
with
8,102 additions
and
10,602 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,264 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$ref": "#/definitions/root", | ||
"title": "Eva Design System Configuration", | ||
"definitions": { | ||
"root": { | ||
"type": "object", | ||
"required": [ | ||
"version", | ||
"theme" | ||
], | ||
"properties": { | ||
"$schema": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"$ref": "#/definitions/version" | ||
}, | ||
"theme": { | ||
"$ref": "#/definitions/theme" | ||
} | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/control" | ||
} | ||
}, | ||
"version": { | ||
"type": "number" | ||
}, | ||
"theme": { | ||
"propertyNames": { | ||
"pattern": "[A-Z][a-zA-Z]*" | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/control" | ||
} | ||
}, | ||
"control": { | ||
"description": "UI Component", | ||
"type": "object", | ||
"required": [ | ||
"meta", | ||
"appearances" | ||
], | ||
"properties": { | ||
"meta": { | ||
"type": "object", | ||
"required": [ | ||
"scope", | ||
"parameters", | ||
"appearances", | ||
"variantGroups", | ||
"states" | ||
], | ||
"properties": { | ||
"scope": { | ||
"$ref": "#/definitions/scope" | ||
}, | ||
"parameters": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z]*" | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/parameterMeta" | ||
} | ||
}, | ||
"appearances": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z]*" | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/appearanceMeta" | ||
} | ||
}, | ||
"variantGroups": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z]*" | ||
}, | ||
"additionalProperties": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z0-9]*" | ||
}, | ||
"minProperties": 1, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/variantMeta" | ||
} | ||
} | ||
}, | ||
"states": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][.a-z]*" | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/stateMeta" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"appearances": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z]*" | ||
}, | ||
"minProperties": 1, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/appearance" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"appearanceMeta": { | ||
"required": [ | ||
"default" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"default": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"variantMeta": { | ||
"type": "object", | ||
"required": [ | ||
"default" | ||
], | ||
"properties": { | ||
"default": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"stateMeta": { | ||
"type": "object", | ||
"required": [ | ||
"default", | ||
"priority", | ||
"scope" | ||
], | ||
"properties": { | ||
"default": { | ||
"type": "boolean" | ||
}, | ||
"priority": { | ||
"type": "number", | ||
"minimum": 0 | ||
}, | ||
"scope": { | ||
"$ref": "#/definitions/scope" | ||
} | ||
} | ||
}, | ||
"parameterMeta": { | ||
"type": "object", | ||
"required": [ | ||
"type" | ||
], | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"number", | ||
"string" | ||
] | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"scope": { | ||
"description": "Platform where control is used. Also can be applied to particular state of control", | ||
"type": "string", | ||
"enum": [ | ||
"all", | ||
"mobile", | ||
"web" | ||
] | ||
}, | ||
"appearance": { | ||
"description": "Set of mappings that define at the high level view of related control: it's size, shape and main colors", | ||
"type": "object", | ||
"required": [ | ||
"mapping" | ||
], | ||
"properties": { | ||
"mapping": { | ||
"$ref": "#/definitions/mapping" | ||
}, | ||
"variantGroups": { | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z]*" | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/variant" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"variant": { | ||
"description": "Set of mapping that define control's appearance", | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z0-9]*" | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/mapping" | ||
} | ||
}, | ||
"mapping": { | ||
"description": "Set of parameters that define control's appearance", | ||
"type": "object", | ||
"propertyNames": { | ||
"pattern": "^[a-z][a-zA-Z]*" | ||
}, | ||
"patternProperties": { | ||
"[Ww]idth": { | ||
"type": "number" | ||
}, | ||
"[Hh]eight": { | ||
"type": "number" | ||
}, | ||
"[Cc]olor": { | ||
"type": "string" | ||
} | ||
}, | ||
"properties": { | ||
"state": { | ||
"$ref": "#/definitions/mapping", | ||
"propertyNames": { | ||
"pattern": "^[a-z][.a-z]*" | ||
}, | ||
"minProperties": 1 | ||
} | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/definitions/parameter" | ||
} | ||
}, | ||
"parameter": { | ||
"description": "Defines how the element or a component of the system will look like", | ||
"anyOf": [ | ||
{ | ||
"type": [ | ||
"number", | ||
"string" | ||
] | ||
}, | ||
{ | ||
"$ref": "#/definitions/mapping" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.