Skip to content

Commit

Permalink
Add Grouping directory. (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 20, 2024
1 parent bc32c25 commit 8202982
Show file tree
Hide file tree
Showing 26 changed files with 83 additions and 73 deletions.
17 changes: 11 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ The following tags are currently supported:
- [a](/docs/tag/A.md)
- [button](/docs/tag/Button.md)
- [button toggle](/docs/tag/ButtonToggle.md)
- [div](/docs/tag/Div.md)
- [h](/docs/tag/H.md)
- [i](/docs/tag/I.md)
- [img](/docs/tag/Img.md)
- [li](/docs/tag/Li.md)
- [ol](/docs/tag/Ol.md)
- [p](/docs/tag/P.md)
- [span](/docs/tag/Span.md)
- [svg](/docs/tag/Svg.md)
- [ul](/docs/tag/Ul.md)

## Grouping

The repository provides a set of classes for creating groups of elements, including:

- [div](/docs/grouping/Div.md)
- [li](/docs/grouping/Li.md)
- [ol](/docs/grouping/Ol.md)
- [p](/docs/grouping/P.md)
- [ul](/docs/grouping/Ul.md)

## Metadata

Expand All @@ -48,7 +53,7 @@ The repository provides a set of classes for creating layouts, including:
- [head](/docs/layout/Head.md)
- [header](/docs/layout/Header.md)
- [html](/docs/layout/Html.md)
- [main](/docs/layout/Main.md)
- [main](/docs/grouping/Main.md)
- [nav](/docs/layout/Nav.md)
- [section](/docs/layout/Section.md)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 15 additions & 13 deletions src/Base/AbstractLi.php → src/Grouping/Base/AbstractLi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@

declare(strict_types=1);

namespace PHPForge\Html\Base;
namespace PHPForge\Html\Grouping\Base;

use PHPForge\Html\Attribute;
use PHPForge\Html\Attribute\{Custom\HasAttributes, Input\HasName, Input\HasValue};
use PHPForge\Html\Attribute\{HasClass, HasId, HasLang, HasStyle, HasTabindex, HasTitle};
use PHPForge\Html\Tag;
use PHPForge\Widget\Element;
use PHPForge\Widget\ElementInterface;
use PHPForge\Widget\{Element, ElementInterface};

use function trim;

/**
* Provides a foundation for creating HTML `<li>` elements with various attributes and content.
*/
abstract class AbstractLi extends Element
{
use Attribute\Custom\HasAttributes;
use Attribute\HasClass;
use Attribute\HasId;
use Attribute\HasLang;
use Attribute\HasStyle;
use Attribute\HasTabindex;
use Attribute\HasTitle;
use Attribute\Input\HasName;
use Attribute\Input\HasValue;
use HasAttributes;
use HasClass;
use HasId;
use HasLang;
use HasName;
use HasStyle;
use HasTabindex;
use HasTitle;
use HasValue;

protected array $attributes = [];
protected string $content = '';
Expand Down
27 changes: 13 additions & 14 deletions src/Base/AbstractList.php → src/Grouping/Base/AbstractList.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace PHPForge\Html\Base;
namespace PHPForge\Html\Grouping\Base;

use PHPForge\Html\Attribute;
use PHPForge\Html\Attribute\{Custom\HasAttributes, Custom\HasTagName, Input\HasName};
use PHPForge\Html\Attribute\{HasClass, HasId, HasLang, HasStyle, HasTabindex, HasTitle};
use PHPForge\Html\Tag;
use PHPForge\Widget\Element;
use PHPForge\Widget\ElementInterface;
use PHPForge\Widget\{Element, ElementInterface};

use function trim;

Expand All @@ -16,19 +16,18 @@
*/
abstract class AbstractList extends Element
{
use Attribute\Custom\HasAttributes;
use Attribute\Custom\HasTagName;
use Attribute\HasClass;
use Attribute\HasId;
use Attribute\HasLang;
use Attribute\HasStyle;
use Attribute\HasTabindex;
use Attribute\HasTitle;
use Attribute\Input\HasName;
use HasAttributes;
use HasClass;
use HasId;
use HasLang;
use HasName;
use HasStyle;
use HasTabindex;
use HasTagName;
use HasTitle;

protected array $attributes = [];
protected string $content = '';
protected string $tagName = '';

/**
* Set the `HTML` content value.
Expand Down
6 changes: 4 additions & 2 deletions src/Div.php → src/Grouping/Div.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html;
namespace PHPForge\Html\Grouping;

use PHPForge\Html\Base\AbstractBlockElement;

/**
* The `<div>` `HTML` element is the generic container for flow content.
Expand All @@ -12,7 +14,7 @@
*
* @link https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element
*/
final class Div extends Base\AbstractBlockElement
final class Div extends AbstractBlockElement
{
protected string $tagName = 'div';
}
6 changes: 4 additions & 2 deletions src/Li.php → src/Grouping/Li.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html;
namespace PHPForge\Html\Grouping;

use PHPForge\Html\Attribute\Input\HasType;

/**
* The `<li>` HTML element is used to represent an item in a list.
Expand All @@ -14,5 +16,5 @@
*/
final class Li extends Base\AbstractLi
{
use Attribute\Input\HasType;
use HasType;
}
10 changes: 6 additions & 4 deletions src/Ol.php → src/Grouping/Ol.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html;
namespace PHPForge\Html\Grouping;

use PHPForge\Html\Attribute\{Input\HasType, Tag\HasReversed, Tag\HasStart};

/**
* The `<ol> HTML element represents an ordered list of items, typically rendered as a numbered list.
Expand All @@ -11,9 +13,9 @@
*/
final class Ol extends Base\AbstractList
{
use Attribute\Input\HasType;
use Attribute\Tag\HasReversed;
use Attribute\Tag\HasStart;
use HasReversed;
use HasStart;
use HasType;

protected string $tagName = 'ol';
}
6 changes: 4 additions & 2 deletions src/P.php → src/Grouping/P.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html;
namespace PHPForge\Html\Grouping;

use PHPForge\Html\Base\AbstractBlockElement;

/**
* The `<p>` HTML element represents a paragraph. Paragraphs are usually represented in visual media as blocks of text
Expand All @@ -11,7 +13,7 @@
*
* @link https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element
*/
final class P extends Base\AbstractBlockElement
final class P extends AbstractBlockElement
{
protected string $tagName = 'p';
}
2 changes: 1 addition & 1 deletion src/Ul.php → src/Grouping/Ul.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PHPForge\Html;
namespace PHPForge\Html\Grouping;

/**
* The `<ul>` HTML element represents an unordered list of items, typically rendered as a bulleted list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Div;
namespace PHPForge\Html\Tests\Grouping\Div;

use PHPForge\Html\Div;
use PHPForge\Html\Grouping\Div;
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Div;
namespace PHPForge\Html\Tests\Grouping\Div;

use PHPForge\Html\Div;
use PHPForge\Html\Grouping\Div;
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Li;
namespace PHPForge\Html\Tests\Grouping\Li;

use PHPForge\Html\Li;
use PHPForge\Html\Grouping\Li;
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Li;
namespace PHPForge\Html\Tests\Grouping\Li;

use PHPForge\Html\Li;
use PHPForge\Html\Ul;
use PHPForge\Html\Grouping\{Li, Ul};
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace PHPForge\Html\Tests\Li;

use PHPForge\Html\Li;
use PHPForge\Html\Grouping\Li;
use PHPUnit\Framework\TestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Ol;
namespace PHPForge\Html\Tests\Grouping\Ol;

use PHPForge\Html\Li;
use PHPForge\Html\Ol;
use PHPForge\Html\Grouping\{Li, Ol};
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Ol;
namespace PHPForge\Html\Tests\Grouping\Ol;

use PHPForge\Html\Li;
use PHPForge\Html\Ol;
use PHPForge\Html\Grouping\{Li, Ol};
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Ol;
namespace PHPForge\Html\Tests\Grouping\Ol;

use PHPForge\Html\Ol;
use PHPForge\Html\Grouping\Ol;
use PHPUnit\Framework\TestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\P;
namespace PHPForge\Html\Tests\Grouping\P;

use PHPForge\Html\P;
use PHPForge\Html\Grouping\P;
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\P;
namespace PHPForge\Html\Tests\Grouping\P;

use PHPForge\Html\P;
use PHPForge\Html\Grouping\P;
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Ul;
namespace PHPForge\Html\Tests\Grouping\Ul;

use PHPForge\Html\Ul;
use PHPForge\Html\Grouping\Ul;
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Ul;
namespace PHPForge\Html\Tests\Grouping\Ul;

use PHPForge\Html\Li;
use PHPForge\Html\Ul;
use PHPForge\Html\Grouping\{Li, Ul};
use PHPForge\Support\Assert;
use PHPUnit\Framework\TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace PHPForge\Html\Tests\Ul;
namespace PHPForge\Html\Tests\Grouping\Ul;

use PHPForge\Html\Ul;
use PHPForge\Html\Grouping\Ul;
use PHPUnit\Framework\TestCase;

/**
Expand Down

0 comments on commit 8202982

Please sign in to comment.