diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index f0dc5312..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -open_collective: yiisoft -github: [yiisoft] diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index b748c2da..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### What steps will reproduce the problem? - -### What is the expected result? - -### What do you get instead? - - -### Additional info - -| Q | A -| ---------------- | --- -| Version | 1.0.? -| PHP version | -| Operating system | diff --git a/src/Accordion.php b/src/Accordion.php index f870104e..c1cb1f75 100644 --- a/src/Accordion.php +++ b/src/Accordion.php @@ -34,22 +34,39 @@ final class Accordion extends Widget { private const CLASS_BODY = 'accordion-body'; + private const CLASS_COLLAPSE = 'accordion-collapse collapse'; + private const CLASS_HEADER = 'accordion-header'; + private const CLASS_ITEM = 'accordion-item'; + private const CLASS_TOGGLE = 'accordion-button'; + private const CLASS_TOGGLE_ACTIVE = 'collapsed'; + private const NAME = 'accordion'; + private bool $alwaysOpen = false; + private array $attributes = []; + private array $bodyAttributes = []; + private array $collapseAttributes = []; + private array $cssClasses = []; + private array $headerAttributes = []; + private string $headerTag = 'h2'; + private bool|string $id = true; + private array $items = []; + private array $togglerAttributes = []; + private string|null $togglerTag = null; /** diff --git a/src/Alert.php b/src/Alert.php index c66c154f..eba89c8c 100644 --- a/src/Alert.php +++ b/src/Alert.php @@ -30,20 +30,35 @@ final class Alert extends Widget { private const CLASS_CLOSE_BUTTON = 'btn-close'; + private const NAME = 'alert'; + private array $attributes = []; + private AlertVariant $alertType = AlertVariant::SECONDARY; + private string|Stringable $body = ''; + private array $cssClasses = []; + private array $closeButtonAttributes = []; + private string|null $closeButtonTag = null; + private string $closeButtonLabel = ''; + private bool $dismissable = false; + private bool $fade = false; + private string|null $header = null; + private array $headerAttributes = []; + private string $headerTag = 'h4'; + private bool|string $id = true; + private string $templateContent = "\n{header}\n{body}\n{toggler}\n"; /** diff --git a/src/Breadcrumbs.php b/src/Breadcrumbs.php index 63fdb4c1..8813f48f 100644 --- a/src/Breadcrumbs.php +++ b/src/Breadcrumbs.php @@ -37,15 +37,25 @@ final class Breadcrumbs extends Widget { private const LIST_NAME = 'breadcrumb'; + private const ITEM_NAME = 'breadcrumb-item'; + private array $attributes = []; + private array $cssClasses = []; + private string $itemActiveClass = 'active'; + private array $itemAttributes = []; + private array $linkAttributes = []; + private array $links = []; + private array $listAttributes = []; + private bool|string $listId = true; + private string $listTagName = 'ol'; /** diff --git a/src/Button.php b/src/Button.php index c2abdb67..cac8ddf2 100644 --- a/src/Button.php +++ b/src/Button.php @@ -35,12 +35,19 @@ final class Button extends Widget { private const NAME = 'btn'; + private array $attributes = []; + private ButtonVariant|null $buttonVariant = ButtonVariant::SECONDARY; + private array $cssClasses = []; + private bool $disabled = false; + private bool|string $id = true; + private string|Stringable $label = ''; + private A|ButtonTag|Input|null $tag = null; /** diff --git a/src/ButtonGroup.php b/src/ButtonGroup.php index c2444e23..91762b8f 100644 --- a/src/ButtonGroup.php +++ b/src/ButtonGroup.php @@ -37,10 +37,14 @@ final class ButtonGroup extends Widget { private const NAME = 'btn-group'; + private array $attributes = []; + /** psalm-var Button[]|Checkbox[]|Radio[] $buttons */ private array $buttons = []; + private array $cssClasses = []; + private bool|string $id = true; /** diff --git a/src/ButtonToolbar.php b/src/ButtonToolbar.php index add75ff5..ed2db4de 100644 --- a/src/ButtonToolbar.php +++ b/src/ButtonToolbar.php @@ -53,10 +53,14 @@ final class ButtonToolbar extends Widget { private const NAME = 'btn-toolbar'; + private array $attributes = []; + /** @psalm-var ButtonGroup[]|Tag[] $buttonGroups */ private array $buttonGroups = []; + private array $cssClasses = []; + private bool|string $id = true; /** diff --git a/src/Carousel.php b/src/Carousel.php index e31394f7..ed131bfb 100644 --- a/src/Carousel.php +++ b/src/Carousel.php @@ -38,26 +38,46 @@ final class Carousel extends Widget { private const CLASS_CAROUSEL_CAPTION = 'carousel-caption d-none d-md-block'; + private const CLASS_CAROUSEL_CONTROL_NEXT = 'carousel-control-next'; + private const CLASS_CAROUSEL_CONTROL_NEXT_ICON = 'carousel-control-next-icon'; + private const CLASS_CAROUSEL_CONTROL_PREV = 'carousel-control-prev'; + private const CLASS_CAROUSEL_CONTROL_PREV_ICON = 'carousel-control-prev-icon'; + private const CLASS_CAROUSEL_INDICATORS = 'carousel-indicators'; + private const CLASS_CAROUSEL_INNER = 'carousel-inner'; + private const CLASS_CAROUSEL_ITEM = 'carousel-item'; + private const CLASS_IMAGE = 'd-block w-100'; + private const CLASS_SLIDE = 'slide'; + private const NAME = 'carousel'; + private array $attributes = []; + private array $cssClasses = []; + private bool $controls = true; + private string $captionTagName = 'h5'; + private string $captionPlaceholderTagName = 'p'; + private string $controlNextLabel = 'Next'; + private string $controlPreviousLabel = 'Previous'; + private bool|string $id = true; + /** @psalm-var CarouselItem[] */ private array $items = []; + private bool $showIndicators = false; /** diff --git a/src/Collapse.php b/src/Collapse.php index 11addb83..164975a9 100644 --- a/src/Collapse.php +++ b/src/Collapse.php @@ -49,17 +49,28 @@ final class Collapse extends Widget { private const NAME = 'collapse'; + private const CARD = 'card'; + private const CARD_BODY = 'card-body'; + private const COLLAPSE_MULTIPLE = 'multi-collapse'; + private array $attributes = []; + private array $cardBodyAttributes = []; + private bool $container = true; + private array $containerAttributes = []; + private array $cssClasses = []; + /** @var Toggler[] */ private array $items = []; + private string $togglerContainerTag = 'p'; + private array $togglerContainerAttributes = []; /** diff --git a/src/Dropdown.php b/src/Dropdown.php index a0b7a924..7a6403df 100644 --- a/src/Dropdown.php +++ b/src/Dropdown.php @@ -41,36 +41,66 @@ final class Dropdown extends Widget { private const DROPDOWN_CLASS = 'dropdown'; + private const DROPDOWN_ITEM_ACTIVE_CLASS = 'active'; + private const DROPDOWN_ITEM_CLASS = 'dropdown-item'; + private const DROPDOWN_ITEM_DISABLED_CLASS = 'disabled'; + private const DROPDOWN_ITEM_DIVIDER_CLASS = 'dropdown-divider'; + private const DROPDOWN_ITEM_HEADER_CLASS = 'dropdown-header'; + private const DROPDOWN_ITEM_TEXT_CLASS = 'dropdown-item-text'; + private const DROPDOWN_LIST_CLASS = 'dropdown-menu'; + private const DROPDOWN_TOGGLER_BUTTON_CLASS = 'btn'; + private const DROPDOWN_TOGGLER_CLASS = 'dropdown-toggle'; + private const DROPDOWN_TOGGLER_CONTAINER_CLASS = 'btn-group'; + private const DROPDOWN_TOGGLER_SPAN_CLASS = 'visually-hidden'; + private const DROPDOWN_TOGGLER_SPLIT_CLASS = 'dropdown-toggle-split'; + private const NAME = 'dropdown'; + private array $alignmentClasses = []; + private array $attributes = []; + private array $cssClasses = []; + private bool $container = true; + private array $containerClasses = [self::DROPDOWN_CLASS]; + /** @psalm-var DropdownItem[] */ private array $items = []; + private string|Stringable $toggler = ''; + private array $togglerAttributes = []; + private array $togglerClasses = []; + private string $togglerContent = 'Dropdown button'; + private bool|string $togglerId = false; + private bool $togglerLink = false; + private string $togglerUrl = '#'; + private string|null $togglerSize = null; + private bool $togglerSplit = false; + private string $togglerSplitContent = 'Action'; + private ButtonVariant|null $togglerVariant = ButtonVariant::SECONDARY; /** diff --git a/src/Modal.php b/src/Modal.php index 6c7f8f2e..28681dce 100644 --- a/src/Modal.php +++ b/src/Modal.php @@ -44,28 +44,51 @@ final class Modal extends Widget { private const CLASS_CLOSE_BUTTON = 'btn-close'; + private const NAME = 'modal'; + private const MODAL_BODY = 'modal-body'; + private const MODAL_CONTENT = 'modal-content'; + private const MODAL_DIALOG = 'modal-dialog'; + private const MODAL_FOOTER = 'modal-footer'; + private const MODAL_HEADER = 'modal-header'; + private const MODAL_TITLE = 'modal-title'; + private array $attributes = []; + private string $body = ''; + private array $bodyAttributes = []; + private array $closeButtonAttributes = []; + private string $closeButtonLabel = ''; + private array $contentAttributes = []; + private array $cssClasses = []; + private array $dialogAttributes = []; + private array $dialogClasses = []; + private string $footer = ''; + private array $footerAttributes = []; + private array $headerAttributes = []; + private bool|string $id = true; + private string $responsive = ''; + private string|Stringable $title = ''; + private string|Stringable $triggerButton = ''; /** diff --git a/src/Nav.php b/src/Nav.php index fe143c40..50c6a014 100644 --- a/src/Nav.php +++ b/src/Nav.php @@ -49,22 +49,38 @@ final class Nav extends Widget { private const NAME = 'nav'; + private const NAV_ITEM_CLASS = 'nav-item'; + private const NAV_ITEM_DROPDOWN_CLASS = 'nav-item dropdown'; + private const NAV_LINK_ACTIVE_CLASS = 'active'; + private const NAV_LINK_CLASS = 'nav-link'; + private const NAV_LINK_DISABLED_CLASS = 'disabled'; + private bool $activateItems = true; + private array $attributes = []; + private array $cssClasses = []; + private string $currentPath = ''; + private array $dropdownCssClasses = [self::NAV_ITEM_DROPDOWN_CLASS]; + private bool $fade = true; + private bool|string $id = false; + /** @var array */ private array $items = []; + private array $paneAttributes = []; + private array $styleClasses = []; + private string $tag = ''; /** diff --git a/src/NavBar.php b/src/NavBar.php index c2d6aef9..0598ff65 100644 --- a/src/NavBar.php +++ b/src/NavBar.php @@ -48,30 +48,55 @@ final class NavBar extends Widget { private const NAME = 'navbar'; + private const NAVBAR_BRAND = 'navbar-brand mb-0 h1'; + private const NAVBAR_BRAND_LINK = 'navbar-brand'; + private const NAV_CONTAINER = 'collapse navbar-collapse'; + private const NAV_INNER_CONTAINER = 'container-fluid'; + private const NAV_TOGGLE = 'navbar-toggler'; + private const NAV_TOGGLE_ICON = 'navbar-toggler-icon'; + private array $attributes = []; + private string|Stringable $brand = ''; + private array $brandAttributes = []; + private string|Stringable $brandText = ''; + private string|Stringable $brandImage = ''; + private array $brandImageAttributes = []; + private string $brandUrl = ''; + private array $cssClass = []; + private bool $container = false; + private array $containerAttributes = []; + private NavBarExpand $expand = NavBarExpand::LG; + private bool $innerContainer = true; + private array $innerContainerAttributes = []; + private string $innerContainerTag = 'div'; + private bool|string $id = true; + private bool|string $navId = false; + private string $tag = 'nav'; + private string|Stringable $toggler = ''; + private array $togglerAttributes = []; /** diff --git a/src/Offcanvas.php b/src/Offcanvas.php index 08ba7e62..0797ce6a 100644 --- a/src/Offcanvas.php +++ b/src/Offcanvas.php @@ -38,28 +38,49 @@ final class Offcanvas extends Widget { private const NAME = 'offcanvas'; + private const BODY_CLASS = 'offcanvas-body'; + private const CLOSE_CLASS = 'btn-close'; + private const HEADER_CLASS = 'offcanvas-header'; + private const SHOW_CLASS = 'show'; + private const TITLE_CLASS = 'offcanvas-title'; + private const TOGGLER_CLASS = 'btn btn-primary'; private array $attributes = []; + private bool $backdrop = false; + private bool $backdropStatic = false; + private array $bodyAttributes = []; + private array $cssClasses = []; + private array $headerAttributes = []; + private bool|string $id = true; + private OffcanvasPlacement|string $placement = OffcanvasPlacement::START; + private string $responsive = ''; + private bool $scrollable = false; + private bool $show = false; + private string|Stringable $title = ''; + private array $titleAttributes = []; + private string|Stringable $toggler = ''; + private array $togglerAttributes = []; + private string|Stringable $togglerContent = ''; /** diff --git a/src/Progress.php b/src/Progress.php index 44ecbf29..dcc1d9ce 100644 --- a/src/Progress.php +++ b/src/Progress.php @@ -36,17 +36,29 @@ final class Progress extends Widget { private const NAME = 'progress'; + private const PROGRESS_BAR = 'progress-bar'; + private array $attributes = []; + private array $barAttributes = []; + private array $barClasses = []; + private array $cssClasses = []; + private string $content = ''; + private bool|string $id = true; + private int|float $max = 100; + private int|float $min = 0; + private int|float $percent = 0; + private bool $sizing = false; + private bool $stacked = false; /** diff --git a/src/ProgressStack.php b/src/ProgressStack.php index 3235a06f..b91ae229 100644 --- a/src/ProgressStack.php +++ b/src/ProgressStack.php @@ -39,10 +39,15 @@ final class ProgressStack extends Widget { private const NAME = 'progress-stack'; + private const PROGRESS_STACKED = 'progress-stacked'; + private array $attributes = []; + private array $cssClasses = []; + private array $bars = []; + private bool|string $id = true; /** diff --git a/src/Toast.php b/src/Toast.php index 40602ac0..04b90421 100644 --- a/src/Toast.php +++ b/src/Toast.php @@ -38,23 +38,41 @@ final class Toast extends Widget { private const CLASS_CLOSE_BUTTON = 'btn-close'; + private const NAME = 'toast'; + private const TOAST_BODY = 'toast-body'; + private const TOAST_CONTAINER = 'toast-container position-fixed bottom-0 end-0 p-3'; + private const TOAST_HEADER = 'toast-header'; + private const TOAST_TITLE_HEADER = 'me-auto'; + private array $attributes = []; + private string $body = ''; + private string|Stringable $closeButton = ''; + private array $closeButtonAttributes = []; + private string|Stringable $content = ''; + private array $cssClasses = []; + private bool $container = false; + private array $headerAttributes = []; + private bool|string $id = true; + private string|Stringable $image = ''; + private string $time = ''; + private string|Stringable $title = ''; + private string|Stringable $triggerButton = ''; /**