Files
saasshop/resources/views/admin/components/mini_bar_row.blade.php

47 lines
1.2 KiB
PHP

@php
/**
* Admin UI Component: Mini Bar Row (link)
*
* Required:
* - $href
* - $label
* - $pct
* - $value
*
* Optional:
* - $rowRole
* - $barRole
* - $title
* - $ariaLabel
* - $class
*/
$href = (string) ($href ?? '#');
$label = (string) ($label ?? '');
$pct = (float) ($pct ?? 0);
$value = (string) ($value ?? '');
$rowRole = (string) ($rowRole ?? '');
$barRole = (string) ($barRole ?? '');
$title = (string) ($title ?? '');
$ariaLabel = (string) ($ariaLabel ?? '');
$class = (string) ($class ?? '');
$pct = max(0, min(100, $pct));
@endphp
<a class="adm-mini-bar-row adm-mini-bar-row-link {{ $class }}"
@if($rowRole !== '') data-role="{{ $rowRole }}" @endif
href="{!! $href !!}"
@if($ariaLabel !== '') aria-label="{{ $ariaLabel }}" @endif
>
<div class="adm-mini-bar-label">{{ $label }}</div>
<div class="adm-mini-bar"
@if($barRole !== '') data-role="{{ $barRole }}" @endif
@if($title !== '') title="{{ $title }}" @endif
>
<span class="adm-mini-bar-fill" style="width: {{ $pct }}%"></span>
</div>
<div class="adm-mini-bar-value">{{ $value }}</div>
</a>