Skip to content

Commit

Permalink
feat: stack docs
Browse files Browse the repository at this point in the history
  • Loading branch information
awesthouse committed May 10, 2024
1 parent af27b61 commit 4ad673b
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{
"name": "items",
"type": "CORE:BlueprintAttribute",
"description": "Pass list of viewConfigs",
"attributeType": "CORE:ViewConfig",
"dimensions": "*"
},
Expand Down Expand Up @@ -55,15 +56,15 @@
{
"name": "wrapItems",
"type": "CORE:BlueprintAttribute",
"description": "When using horizontal direction, make items wrap under eachother when width is getting too small to fit all items",
"description": "When using horizontal direction, make items wrap under each other when width is getting too small to fit all items",
"attributeType": "boolean",
"optional": true,
"default": false
},
{
"name": "classNames",
"type": "CORE:BlueprintAttribute",
"description": "Add tailwind classNames to wrapper",
"description": "Add classNames to wrapper",
"attributeType": "string",
"dimensions": "*",
"optional": true
Expand Down
28 changes: 28 additions & 0 deletions packages/dm-core-plugins/blueprints/stack/docs/Documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
`StackPlugin` allows you to stack views next to each other horizontally or vertically.

## Table of contents
- [Passing views](#passing-views)
- [Placement config](#placement-config)

### Passing views \{#passing-views}
Simply pass viewConfigs in the order you want to showcase to the `items` config field.

```json title="view-items.recipe.json"
items: [
{
"type": "CORE:ViewConfig",
"scope": "movies"
},
{
"type": "CORE:ViewConfig",
"scope": "shows"
},
{
"type": "CORE:ViewConfig",
"scope": "music",
}
]
```

### Placement config \{#placement-config}
In the plugins [config blueprint](./Blueprints.md) you can see all the ways you can place and space views.
71 changes: 71 additions & 0 deletions packages/dm-core-plugins/blueprints/stack/docs/Examples/Basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"title": "Basic Example",
"description": "Minimal example of how to pass views through stack component",
"note": "",
"showDemo": true,
"entityFilePrefix": "sections",
"blueprint": {
"name": "Section",
"type": "CORE:Blueprint",
"description": "",
"attributes": [
{
"name": "type",
"type": "dmss://system/SIMOS/BlueprintAttribute",
"attributeType": "string",
"optional": false
}
]
},
"entity": {
"type": "./Section",
"_id": "1179c897-df62-445f-87e4-f393b4253936"
},
"recipe": {
"name": "section",
"type": "CORE:UiRecipe",
"description": "stack recipe",
"plugin": "@development-framework/dm-core-plugins/stack",
"config": {
"type": "PLUGINS:dm-core-plugins/list/ListPluginConfig",
"items": [
{
"type": "CORE:InlineRecipeViewConfig",
"recipe": {
"name": "box",
"type": "CORE:UiRecipe",
"plugin": "custom-box-plugin",
"config": {
"type": "PLUGINS:custom-box-plugin-blueprint",
"content": "Item 1"
}
}
},
{
"type": "CORE:InlineRecipeViewConfig",
"recipe": {
"name": "box2",
"type": "CORE:UiRecipe",
"plugin": "custom-box-plugin",
"config": {
"type": "PLUGINS:custom-box-plugin-blueprint",
"content": "Item 2"
}
}
},
{
"type": "CORE:InlineRecipeViewConfig",
"recipe": {
"name": "box3",
"type": "CORE:UiRecipe",
"plugin": "custom-box-plugin",
"config": {
"type": "PLUGINS:custom-box-plugin-blueprint",
"content": "Item 3"
}
}
}
]
}
}
}

0 comments on commit 4ad673b

Please sign in to comment.