Skip to content

Commit

Permalink
Merge pull request #470 from helsingborg-stad/feat/element-component
Browse files Browse the repository at this point in the history
feat: new element component
  • Loading branch information
NiclasNorin authored Oct 24, 2024
2 parents e4d1b51 + ca4d9c2 commit 14d09ec
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/php/Component/Element/Element.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace ComponentLibrary\Component\Element;

/**
* Class Element
* @package ComponentLibrary\Component\Element
*/
class Element extends \ComponentLibrary\Component\BaseController
{
public function init()
{
}
}
5 changes: 5 additions & 0 deletions source/php/Component/Element/element.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@if ($slotHasData || !$hideIfNoContent)
<{{ $componentElement }} class="{{ $class }}" {!! $attribute !!}>
{{ $slot }}
</{{ $componentElement }}>
@endif
23 changes: 23 additions & 0 deletions source/php/Component/Element/element.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"slug": "element",
"default": {
"componentElement": "div",
"hideIfNoContent": true
},
"description": {
"componentElement": "The tag to use for this component.",
"hideIfNoContent": "If true, the component will not be rendered if there is no content."
},
"types":{
"componentElement": "string",
"hideIfNoContent": "boolean"
},
"view": "element.blade.php",
"dependency": {
"sass": {
"components": [
"element"
]
}
}
}

0 comments on commit 14d09ec

Please sign in to comment.