Skip to content

Commit

Permalink
feat: StyledContainer implementation (#32)
Browse files Browse the repository at this point in the history
* feat: StyledContainer implementation
  • Loading branch information
jonas-martinez authored Sep 28, 2021
1 parent 2bae77d commit 9febcf0
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 0 deletions.
32 changes: 32 additions & 0 deletions api/components/styledContainer.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "styledContainer.schema.json",
"title": "StyledContainer",
"description": "Element of type StyledContainer",
"type": "component",
"properties": {
"type": {
"description": "The identifier of the component",
"enum": [
"styledContainer"
]
},
"child": {
"type": "component"
},
"border": {
"$ref": "defs/border.schema.json"
},
"borderRadius": {
"$ref": "defs/borderRadius.schema.json"
},
"boxShadow": {
"$ref": "defs/boxShadow.schema.json"
}
},
"required": [
"type",
"child"
],
"additionalProperties": false
}
22 changes: 22 additions & 0 deletions api/defs/border.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "border.schema.json",
"title": "Border",
"description": "Element of type Border",
"type": "object",
"properties": {
"top": {
"$ref": "defs/borderSide.schema.json"
},
"left": {
"$ref": "defs/borderSide.schema.json"
},
"bottom": {
"$ref": "defs/borderSide.schema.json"
},
"right": {
"$ref": "defs/borderSide.schema.json"
}
},
"additionalProperties": false
}
37 changes: 37 additions & 0 deletions api/defs/borderRadius.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "borderRadius.schema.json",
"title": "BorderRadius",
"description": "Element of type BorderRadius",
"type": "object",
"properties": {
"topLeft": {
"$ref": "#/definitions/radiusType"
},
"topRight": {
"$ref": "#/definitions/radiusType"
},
"bottomLeft": {
"$ref": "#/definitions/radiusType"
},
"bottomRight": {
"$ref": "#/definitions/radiusType"
}
},
"additionalProperties": false,
"definitions": {
"radiusType": {
"type": "object",
"properties": {
"x": {
"type": "number",
"default": 0
},
"y": {
"type": "number",
"default": 0
}
}
}
}
}
20 changes: 20 additions & 0 deletions api/defs/borderSide.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "borderSide.schema.json",
"title": "BorderSide",
"description": "Element of type BorderSide",
"type": "object",
"properties": {
"width": {
"description": "The width of the Border",
"type": "number",
"default": 1.0
},
"color": {
"description": "The color of the Border",
"type": "string",
"default": "#000000"
}
},
"additionalProperties": false
}
28 changes: 28 additions & 0 deletions api/defs/boxShadow.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "boxShadow.schema.json",
"title": "BoxShadow",
"description": "Element of type BoxShadow",
"type": "object",
"properties": {
"color": {
"description": "The color of the Shadow",
"type": "string",
"default": "#000000"
},
"blurRadius": {
"description": "The blur radius",
"type": "number",
"default": 0
},
"spreadRadius": {
"description": "The spread radius",
"type": "number",
"default": 0
},
"offset": {
"$ref": "defs/offset.schema.json"
}
},
"additionalProperties": false
}
20 changes: 20 additions & 0 deletions api/defs/offset.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "offset.schema.json",
"title": "Offset",
"description": "Element of type Offset",
"type": "object",
"properties": {
"dx": {
"description": "The Offset along the x axis",
"type": "number",
"default": 0
},
"dy": {
"description": "The Offset along the y axis",
"type": "number",
"default": 0
}
},
"additionalProperties": false
}

0 comments on commit 9febcf0

Please sign in to comment.