Skip to content

Commit

Permalink
Introduce new widget EmptyStateBar
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Sep 13, 2023
1 parent 42ff531 commit 2cca68b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
11 changes: 11 additions & 0 deletions asset/css/empty-state.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.empty-state {
color: @empty-state-color;
}

.empty-state-bar {
padding: 1em;
text-align: center;

.rounded-corners();
background-color: @empty-state-bar-bg;
}
6 changes: 6 additions & 0 deletions asset/css/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
@schedule-element-fields-disabled-selected-bg: @base-gray-light;
@schedule-element-keyboard-note-bg: @base-gray-light;

@empty-state-color: @base-disabled;
@empty-state-bar-bg: @base-gray-lighter;

@empty-state-bg-in-lists: @base-gray-lighter;
@list-item-title-hover-color: @base-primary-color;
@list-item-separation-bg: @base-gray-light;
Expand Down Expand Up @@ -204,6 +207,9 @@
--schedule-element-fields-disabled-selected-bg: var(--base-gray-light);
--schedule-element-keyboard-note-bg: var(--base-gray-light);

--empty-state-color: var(--base-disabled);
--empty-state-bar-bg: var(--base-gray-lighter);

--empty-state-bg-in-lists: var(--base-gray-lighter);
--list-item-title-hover-color: var(--base-primary-color);
--list-item-separation-bg: var(--base-gray-light);
Expand Down
30 changes: 30 additions & 0 deletions src/Widget/EmptyStateBar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace ipl\Web\Widget;

use ipl\Html\BaseHtmlElement;

class EmptyStateBar extends BaseHtmlElement
{
/** @var mixed Content */
protected $content;

protected $tag = 'div';

protected $defaultAttributes = ['class' => ['empty-state', 'empty-state-bar']];

/**
* Create an empty list
*
* @param mixed $content
*/
public function __construct($content)
{
$this->content = $content;
}

protected function assemble(): void
{
$this->add($this->content);
}
}

0 comments on commit 2cca68b

Please sign in to comment.