Commit awal: prototipe UI SIAKAD Untan
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
{{-- Peringatan satu blok: ikon + teks (bukan warna saja). Slot = isi. Tutup hanya bila JS aktif. --}}
|
||||
@props(['tone' => 'info', 'title' => null, 'dismissible' => false])
|
||||
|
||||
@php
|
||||
$tone = in_array($tone, ['info', 'success', 'warning', 'danger'], true) ? $tone : 'info';
|
||||
$icon = ['info' => 'information-circle', 'success' => 'check-circle', 'warning' => 'exclamation-triangle', 'danger' => 'exclamation-circle'][$tone];
|
||||
$name = ['info' => 'Informasi', 'success' => 'Berhasil', 'warning' => 'Peringatan', 'danger' => 'Galat'][$tone];
|
||||
$role = in_array($tone, ['warning', 'danger'], true) ? 'alert' : 'status';
|
||||
@endphp
|
||||
|
||||
<div
|
||||
{{ $attributes->class(['alert', "alert--{$tone}"]) }}
|
||||
role="{{ $role }}"
|
||||
@if ($dismissible) x-data="{ open: true }" x-show="open" x-transition.opacity @endif
|
||||
>
|
||||
<x-dynamic-component :component="'heroicon-m-'.$icon" class="alert__icon" aria-hidden="true" />
|
||||
|
||||
<div class="alert__body">
|
||||
<span class="visually-hidden">{{ $name }}:</span>
|
||||
@if ($title) <p class="alert__title">{{ $title }}</p> @endif
|
||||
<div class="alert__text">{{ $slot }}</div>
|
||||
</div>
|
||||
|
||||
@if ($dismissible)
|
||||
<x-ui.button
|
||||
variant="ghost"
|
||||
icon="x-mark"
|
||||
:icon-only="true"
|
||||
class="alert__close"
|
||||
aria-label="Tutup peringatan"
|
||||
x-on:click="open = false"
|
||||
/>
|
||||
@endif
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
{{-- Inisial dari nama; gelar di depan (Dr., Ir., Prof.) dan di belakang koma dilewati. --}}
|
||||
@props(['name', 'size' => 'md', 'labelled' => false])
|
||||
|
||||
@php
|
||||
$words = preg_split('/\s+/u', trim(\Illuminate\Support\Str::before((string) $name, ',')), -1, PREG_SPLIT_NO_EMPTY) ?: [];
|
||||
$plain = array_values(array_filter($words, fn (string $w) => ! str_ends_with($w, '.')));
|
||||
$words = $plain ?: $words;
|
||||
$initials = mb_strtoupper(
|
||||
mb_substr($words[0] ?? '?', 0, 1).(count($words) > 1 ? mb_substr(end($words), 0, 1) : '')
|
||||
);
|
||||
$sizeClass = in_array($size, ['sm', 'lg', 'xl'], true) ? "avatar--{$size}" : null;
|
||||
@endphp
|
||||
|
||||
<span {{ $attributes->class(array_filter(['avatar', $sizeClass])) }} @if ($labelled) role="img" aria-label="{{ $name }}" @else aria-hidden="true" @endif>{{ $initials }}</span>
|
||||
@@ -0,0 +1,10 @@
|
||||
@props(['tone' => 'neutral', 'icon' => null])
|
||||
|
||||
@php
|
||||
$tone = in_array($tone, ['neutral', 'accent', 'gold', 'success', 'danger'], true) ? $tone : 'neutral';
|
||||
@endphp
|
||||
|
||||
<span {{ $attributes->class(['badge', "badge--{$tone}" => $tone !== 'neutral']) }}>
|
||||
@if ($icon) <x-dynamic-component :component="'heroicon-m-'.$icon" /> @endif
|
||||
{{ $slot }}
|
||||
</span>
|
||||
@@ -0,0 +1,38 @@
|
||||
@props([
|
||||
'variant' => 'primary',
|
||||
'type' => 'button',
|
||||
'href' => null,
|
||||
'size' => 'md',
|
||||
'block' => false,
|
||||
'icon' => null,
|
||||
'iconOnly' => false,
|
||||
'loading' => false,
|
||||
])
|
||||
|
||||
@php
|
||||
$variant = in_array($variant, ['primary', 'secondary', 'ghost', 'danger'], true) ? $variant : 'primary';
|
||||
$classes = array_filter([
|
||||
'btn',
|
||||
"btn--{$variant}",
|
||||
$size === 'sm' ? 'btn--sm' : null,
|
||||
$block ? 'btn--block' : null,
|
||||
$iconOnly ? 'btn--icon' : null,
|
||||
]);
|
||||
@endphp
|
||||
|
||||
@if ($href)
|
||||
<a href="{{ $href }}" {{ $attributes->class($classes) }}>
|
||||
@if ($icon) <x-dynamic-component :component="'heroicon-o-'.$icon" /> @endif
|
||||
@unless ($iconOnly) <span>{{ $slot }}</span> @endunless
|
||||
</a>
|
||||
@else
|
||||
<button
|
||||
type="{{ $type }}"
|
||||
@if ($loading) data-busy="true" aria-busy="true" @endif
|
||||
{{ $attributes->class($classes) }}
|
||||
>
|
||||
<span class="btn__spinner" aria-hidden="true"></span>
|
||||
@if ($icon) <x-dynamic-component :component="'heroicon-o-'.$icon" /> @endif
|
||||
@unless ($iconOnly) <span>{{ $slot }}</span> @endunless
|
||||
</button>
|
||||
@endif
|
||||
@@ -0,0 +1,36 @@
|
||||
{{--
|
||||
Grafik Chart.js dengan data nyata. type: bar | line | doughnut. datasets: [['label' => ..., 'data' => [...]]].
|
||||
Tabel tersembunyi menyediakan data yang sama bagi pembaca layar.
|
||||
--}}
|
||||
@props(['title', 'type' => 'bar', 'labels' => [], 'datasets' => [], 'description' => null, 'height' => '16rem'])
|
||||
|
||||
@php
|
||||
$type = in_array($type, ['bar', 'line', 'doughnut'], true) ? $type : 'bar';
|
||||
$id = 'chart-'.\Illuminate\Support\Str::random(6);
|
||||
@endphp
|
||||
|
||||
<x-glass.panel as="figure" {{ $attributes->class('chart') }}>
|
||||
<figcaption class="panel-title">
|
||||
<h2>{{ $title }}</h2>
|
||||
</figcaption>
|
||||
@if ($description) <p class="stat__hint">{{ $description }}</p> @endif
|
||||
|
||||
@if (count($labels) === 0)
|
||||
<x-ui.empty icon="chart-bar" title="Belum ada data" description="Grafik tampil setelah data tersedia." />
|
||||
@else
|
||||
<div class="chart__canvas" style="height: {{ $height }}" x-data="chartCanvas(@js(['type' => $type, 'labels' => $labels, 'datasets' => $datasets]))">
|
||||
<canvas x-ref="canvas" id="{{ $id }}" role="img" aria-label="{{ $title }}"></canvas>
|
||||
</div>
|
||||
<table class="visually-hidden">
|
||||
<caption>{{ $title }}</caption>
|
||||
<thead>
|
||||
<tr><th scope="col">Kategori</th>@foreach ($datasets as $ds)<th scope="col">{{ $ds['label'] ?? 'Nilai' }}</th>@endforeach</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($labels as $i => $label)
|
||||
<tr><th scope="row">{{ $label }}</th>@foreach ($datasets as $ds)<td>{{ $ds['data'][$i] ?? 0 }}</td>@endforeach</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
</x-glass.panel>
|
||||
@@ -0,0 +1,71 @@
|
||||
{{--
|
||||
Tombol pemicu + dialog konfirmasi. Dirender sebagai <form> (atribut tambahan ke form).
|
||||
Tanpa JS pemicu adalah tombol kirim biasa: formulir langsung terkirim (progressive enhancement).
|
||||
Jangan taruh di dalam <form> lain.
|
||||
--}}
|
||||
@props([
|
||||
'action',
|
||||
'method' => 'POST',
|
||||
'title',
|
||||
'message' => null,
|
||||
'confirmLabel' => 'Ya, lanjutkan',
|
||||
'cancelLabel' => 'Batal',
|
||||
'tone' => 'primary',
|
||||
'icon' => null,
|
||||
'iconOnly' => false,
|
||||
'triggerLabel' => null,
|
||||
'label' => null,
|
||||
'variant' => 'ghost',
|
||||
])
|
||||
|
||||
@php
|
||||
$method = strtoupper($method);
|
||||
$method = in_array($method, ['POST', 'PUT', 'PATCH', 'DELETE'], true) ? $method : 'POST';
|
||||
$tone = $tone === 'danger' ? 'danger' : 'primary';
|
||||
$variant = $variant === 'secondary' ? 'secondary' : 'ghost';
|
||||
$uid = 'confirm-'.\Illuminate\Support\Str::random(8);
|
||||
@endphp
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ $action }}"
|
||||
x-data="confirmDialog"
|
||||
{{ $attributes->class('confirm') }}
|
||||
>
|
||||
@csrf
|
||||
@if ($method !== 'POST') @method($method) @endif
|
||||
|
||||
<x-ui.button
|
||||
type="submit"
|
||||
:variant="$variant"
|
||||
:icon="$icon"
|
||||
:icon-only="$iconOnly"
|
||||
:class="$tone === 'danger' ? 'confirm__trigger--danger' : ''"
|
||||
:aria-label="$iconOnly ? ($label ?? $title) : null"
|
||||
x-ref="trigger"
|
||||
x-on:click.prevent="show()"
|
||||
>{{ $triggerLabel ?? $title }}</x-ui.button>
|
||||
|
||||
<dialog
|
||||
x-ref="dialog"
|
||||
@class(['dialog', 'dialog--danger' => $tone === 'danger'])
|
||||
aria-labelledby="{{ $uid }}-title"
|
||||
@if ($message) aria-describedby="{{ $uid }}-message" @endif
|
||||
x-on:click="backdrop($event)"
|
||||
x-on:close="restore()"
|
||||
>
|
||||
<div class="dialog__body">
|
||||
<div class="dialog__head">
|
||||
<span class="dialog__icon" aria-hidden="true">
|
||||
@if ($tone === 'danger') <x-heroicon-o-exclamation-triangle /> @else <x-heroicon-o-question-mark-circle /> @endif
|
||||
</span>
|
||||
<p id="{{ $uid }}-title" class="dialog__title">{{ $title }}</p>
|
||||
</div>
|
||||
@if ($message) <p id="{{ $uid }}-message" class="dialog__message">{{ $message }}</p> @endif
|
||||
<div class="dialog__actions">
|
||||
<x-ui.button type="submit" :variant="$tone === 'danger' ? 'danger' : 'primary'">{{ $confirmLabel }}</x-ui.button>
|
||||
<x-ui.button variant="secondary" x-ref="cancel" x-on:click="close()">{{ $cancelLabel }}</x-ui.button>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
</form>
|
||||
@@ -0,0 +1,9 @@
|
||||
{{-- Keadaan kosong standar: ikon, judul, penjelasan, dan aksi (slot). --}}
|
||||
@props(['icon' => 'inbox', 'title', 'description' => null])
|
||||
|
||||
<div {{ $attributes->class('empty') }}>
|
||||
<span class="empty__icon" aria-hidden="true"><x-dynamic-component :component="'heroicon-o-'.$icon" /></span>
|
||||
<p class="empty__title">{{ $title }}</p>
|
||||
@if ($description) <p class="empty__text">{{ $description }}</p> @endif
|
||||
@if (trim((string) $slot) !== '') <div class="empty__actions">{{ $slot }}</div> @endif
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
{{-- Satu angka: label, nilai, petunjuk, dan tautan opsional (seluruh sel menjadi tautan). --}}
|
||||
@props(['label', 'value', 'href' => null, 'hint' => null])
|
||||
|
||||
@php
|
||||
$shown = is_int($value) ? number_format($value, 0, ',', '.') : $value;
|
||||
@endphp
|
||||
|
||||
<div {{ $attributes->class('figure') }}>
|
||||
<dt class="figure__label">
|
||||
@if ($href) <a href="{{ $href }}" class="figure__link">{{ $label }}</a> @else {{ $label }} @endif
|
||||
</dt>
|
||||
<dd class="figure__value num">{{ $shown }}</dd>
|
||||
@if ($hint) <dd class="figure__hint">{{ $hint }}</dd> @endif
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
{{-- Deret angka ringkas: satu panel kaca berisi <dl> dengan pemisah hairline. Isi: <x-ui.figure> (angka nyata dari DB). --}}
|
||||
@props(['label'])
|
||||
|
||||
<x-glass.panel as="section" padding="none" :aria-label="$label" {{ $attributes }}>
|
||||
<dl class="figures">
|
||||
{{ $slot }}
|
||||
</dl>
|
||||
</x-glass.panel>
|
||||
@@ -0,0 +1,33 @@
|
||||
{{-- Formulir GET untuk pencarian (q) dan filter di atas tabel. Slot = filter tambahan (form.select). Terkirim otomatis saat pilihan berubah (Enter/keluar kolom untuk pencarian). --}}
|
||||
@props(['action' => null, 'search' => true, 'placeholder' => 'Cari', 'label' => 'Cari', 'id' => 'filter-q'])
|
||||
|
||||
@php
|
||||
$target = $action ?? url()->current();
|
||||
$query = request()->query('q');
|
||||
$query = is_string($query) ? $query : '';
|
||||
@endphp
|
||||
|
||||
<form method="GET" action="{{ $target }}" role="search" aria-label="Pencarian dan filter" x-data x-on:change="$el.requestSubmit()" {{ $attributes->class('filter-bar') }}>
|
||||
@if ($search)
|
||||
<div class="field filter-bar__search">
|
||||
<label class="visually-hidden" for="{{ $id }}">{{ $label }}</label>
|
||||
<div class="field__control">
|
||||
<span class="field__icon" aria-hidden="true"><x-heroicon-o-magnifying-glass /></span>
|
||||
<input
|
||||
type="search"
|
||||
id="{{ $id }}"
|
||||
name="q"
|
||||
value="{{ $query }}"
|
||||
placeholder="{{ $placeholder }}"
|
||||
autocomplete="off"
|
||||
enterkeyhint="search"
|
||||
class="field__input"
|
||||
style="--pad-start: 2.5rem"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,51 @@
|
||||
{{--
|
||||
Pesan dari sesi (status, error, warning, info, toast) + tempat toast klien.
|
||||
Pasang satu kali per layout, tepat setelah tautan lewati (bukan di dalam <main>: toast memakai position fixed).
|
||||
Tanpa JS pesan tampil sebagai daftar peringatan di atas cangkang; setelah Alpine siap, daftar itu disembunyikan dan toast mengambil alih.
|
||||
Dari klien: window.toast('success', 'Tersimpan') atau $dispatch('toast', { tone: 'danger', message: '...' }).
|
||||
--}}
|
||||
@php
|
||||
$tones = ['info', 'success', 'warning', 'danger'];
|
||||
$messages = [];
|
||||
|
||||
if (request()->hasSession()) {
|
||||
foreach (['status' => 'success', 'error' => 'danger', 'warning' => 'warning', 'info' => 'info'] as $key => $tone) {
|
||||
$text = session($key);
|
||||
if (is_string($text) && $text !== '') {
|
||||
$messages[] = ['tone' => $tone, 'message' => $text];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ((array) session('toast', []) as $item) {
|
||||
if (is_array($item) && is_string($item['message'] ?? null) && $item['message'] !== '') {
|
||||
$messages[] = [
|
||||
'tone' => in_array($item['tone'] ?? 'info', $tones, true) ? $item['tone'] : 'info',
|
||||
'message' => $item['message'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if ($messages)
|
||||
<div class="flash-static" data-flash-static>
|
||||
@foreach ($messages as $item)
|
||||
<x-ui.alert :tone="$item['tone']">{{ $item['message'] }}</x-ui.alert>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="toasts" x-data x-init="$store.toasts.seed(@js($messages))">
|
||||
<div class="toasts__stack" role="region" aria-label="Notifikasi">
|
||||
<div aria-live="polite" aria-atomic="false">
|
||||
<template x-for="item in $store.toasts.items.filter((i) => !i.assertive)" :key="item.id">
|
||||
@include('ui.toast')
|
||||
</template>
|
||||
</div>
|
||||
<div aria-live="assertive" aria-atomic="false">
|
||||
<template x-for="item in $store.toasts.items.filter((i) => i.assertive)" :key="item.id">
|
||||
@include('ui.toast')
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
{{-- Batang kemajuan bernilai nyata (role="meter"). Isi memakai skala, bukan lebar. --}}
|
||||
@props(['value', 'max' => 100, 'label', 'valueText' => null, 'tone' => 'neutral', 'id' => null])
|
||||
|
||||
@php
|
||||
$id ??= 'meter-'.\Illuminate\Support\Str::random(6);
|
||||
$tone = in_array($tone, ['neutral', 'success', 'danger', 'accent'], true) ? $tone : 'neutral';
|
||||
$max = (float) $max > 0 ? (float) $max : 100.0;
|
||||
$now = max(0.0, min((float) $value, $max));
|
||||
$ratio = round($now / $max, 4);
|
||||
$fmt = fn (float $n): string => rtrim(rtrim(number_format($n, 2, ',', '.'), '0'), ',');
|
||||
$valueText ??= $fmt($now).' dari '.$fmt($max);
|
||||
@endphp
|
||||
|
||||
<div {{ $attributes->class(['meter', "meter--{$tone}" => $tone !== 'neutral']) }}>
|
||||
<div class="meter__head">
|
||||
<span class="meter__label" id="{{ $id }}-label">{{ $label }}</span>
|
||||
<span class="meter__text">{{ $valueText }}</span>
|
||||
</div>
|
||||
<div
|
||||
class="meter__track"
|
||||
role="meter"
|
||||
aria-labelledby="{{ $id }}-label"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{ $max }}"
|
||||
aria-valuenow="{{ $now }}"
|
||||
aria-valuetext="{{ $valueText }}"
|
||||
>
|
||||
<div class="meter__fill" style="--meter-ratio: {{ $ratio }}"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{-- Kepala halaman: satu-satunya <h1>, kalimat pengantar, jejak halaman, dan slot aksi (<x-slot:actions>). Blok polos, bukan kaca. --}}
|
||||
@props(['title', 'description' => null, 'breadcrumbs' => []])
|
||||
|
||||
<header {{ $attributes->class('page-header') }}>
|
||||
@if ($breadcrumbs)
|
||||
<nav aria-label="Breadcrumb">
|
||||
<div class="crumbs" x-data="nameMarquee">
|
||||
<ol class="crumbs__list" x-ref="inner">
|
||||
@foreach ($breadcrumbs as $text => $url)
|
||||
<li class="crumbs__item">
|
||||
@if ($loop->last || blank($url))
|
||||
<span class="crumbs__text" @if ($loop->last) aria-current="page" @endif>{{ $text }}</span>
|
||||
@else
|
||||
<a class="crumbs__link" href="{{ $url }}">
|
||||
@if ($loop->first) <x-heroicon-o-home class="crumbs__home" aria-hidden="true" /> @endif
|
||||
{{ $text }}
|
||||
</a>
|
||||
@endif
|
||||
@unless ($loop->last)
|
||||
<x-heroicon-m-chevron-right class="crumbs__sep" aria-hidden="true" />
|
||||
@endunless
|
||||
</li>
|
||||
@endforeach
|
||||
</ol>
|
||||
</div>
|
||||
</nav>
|
||||
@endif
|
||||
|
||||
<div class="page-header__row">
|
||||
<div class="page-header__text">
|
||||
<h1>{{ $title }}</h1>
|
||||
@if ($description) <p class="lede">{{ $description }}</p> @endif
|
||||
</div>
|
||||
|
||||
@isset($actions)
|
||||
@if (trim((string) $actions) !== '')
|
||||
<div class="page-header__actions">{{ $actions }}</div>
|
||||
@endif
|
||||
@endisset
|
||||
</div>
|
||||
</header>
|
||||
@@ -0,0 +1,50 @@
|
||||
{{-- Pemilih peran di bilah atas: menampilkan peran aktif; menu hanya berisi daftar peran milik akun (prototipe: peralihan belum aktif). --}}
|
||||
@props(['user'])
|
||||
|
||||
@php
|
||||
$roles = \App\Support\Prototype\RoleAccess::for($user);
|
||||
$current = $user->role;
|
||||
@endphp
|
||||
|
||||
<div class="role-switch" x-data="{ open: false }" x-on:keydown.escape="open = false" x-on:click.outside="open = false">
|
||||
<button
|
||||
type="button"
|
||||
class="role-switch__trigger"
|
||||
aria-haspopup="true" aria-label="Peran aktif: {{ $current->label() }}. Lihat daftar peran"
|
||||
aria-controls="role-switch-menu"
|
||||
x-bind:aria-expanded="open"
|
||||
aria-expanded="false"
|
||||
data-no-busy
|
||||
x-on:click="open = !open"
|
||||
>
|
||||
<x-dynamic-component :component="'heroicon-o-'.$current->roleIcon()" class="role-switch__icon" />
|
||||
<span class="role-switch__role">{{ $current->label() }}</span>
|
||||
</button>
|
||||
|
||||
<div id="role-switch-menu" class="role-switch__menu" x-bind:class="{ 'is-open': open }" x-bind:inert="!open" inert>
|
||||
<ul class="role-switch__list" role="list" aria-label="Peran yang dimiliki">
|
||||
@foreach ($roles as $role)
|
||||
<li>
|
||||
@if ($role === $current)
|
||||
<span class="role-switch__item is-current" aria-current="true">
|
||||
<x-dynamic-component :component="'heroicon-o-'.$role->roleIcon()" class="role-switch__icon" />
|
||||
<span class="role-switch__item-text">{{ $role->label() }}</span>
|
||||
<x-heroicon-s-check class="role-switch__check" />
|
||||
</span>
|
||||
@else
|
||||
<button
|
||||
type="button"
|
||||
class="role-switch__item"
|
||||
data-no-busy
|
||||
x-on:click="open = false; toast('info', 'Peralihan ke peran {{ $role->label() }} belum aktif pada tampilan prototipe.')"
|
||||
>
|
||||
<x-dynamic-component :component="'heroicon-o-'.$role->roleIcon()" class="role-switch__icon" />
|
||||
<span class="role-switch__item-text">{{ $role->label() }}</span>
|
||||
</button>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
{{-- Hiasan latar: garis awan bergerak (tema terang) dan bintang berkedip (tema gelap). Murni dekoratif, hanya opacity/transform. --}}
|
||||
@props(['defs' => false])
|
||||
|
||||
<div class="sky" aria-hidden="true">
|
||||
@if ($defs)
|
||||
<svg class="sky__defs" width="0" height="0" focusable="false">
|
||||
<symbol id="sky-cloud" viewBox="0 0 200 92">
|
||||
<path d="M40 70 H150 C175 70 190 56 190 42 C190 28 176 18 160 20 C156 8 142 0 126 0 C108 0 94 10 90 24 C86 22 82 22 78 22 C62 22 50 33 50 46 C34 46 22 56 22 64 C22 68 28 70 40 70 Z M12 82 H74 M92 82 H168 M30 90 H120" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />
|
||||
</symbol>
|
||||
</svg>
|
||||
@endif
|
||||
<div class="sky__clouds">
|
||||
<svg class="sky__cloud" viewBox="0 0 200 92" style="--y: 9vh; --w: 15rem; --d: 170s; --t: -20s; --o: 1"><use href="#sky-cloud" /></svg>
|
||||
<svg class="sky__cloud" viewBox="0 0 200 92" style="--y: 24vh; --w: 10rem; --d: 210s; --t: -130s; --o: 0.8"><use href="#sky-cloud" /></svg>
|
||||
<svg class="sky__cloud" viewBox="0 0 200 92" style="--y: 46vh; --w: 18rem; --d: 240s; --t: -60s; --o: 0.9"><use href="#sky-cloud" /></svg>
|
||||
<svg class="sky__cloud" viewBox="0 0 200 92" style="--y: 68vh; --w: 12rem; --d: 190s; --t: -170s; --o: 0.75"><use href="#sky-cloud" /></svg>
|
||||
<svg class="sky__cloud" viewBox="0 0 200 92" style="--y: 86vh; --w: 16rem; --d: 260s; --t: -100s; --o: 0.85"><use href="#sky-cloud" /></svg>
|
||||
</div>
|
||||
<div class="sky__stars">
|
||||
<i class="sky__star-layer sky__star-layer--1"></i>
|
||||
<i class="sky__star-layer sky__star-layer--2"></i>
|
||||
<i class="sky__star-layer sky__star-layer--3"></i>
|
||||
<i class="sky__star-layer sky__star-layer--4"></i>
|
||||
<i class="sky__star-layer sky__star-layer--5"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
{{-- Kartu angka tunggal dengan ikon. Nilai harus nyata dari DB. Dengan href, seluruh kartu menjadi tautan. --}}
|
||||
@props(['label', 'value', 'icon' => 'chart-bar', 'hint' => null, 'href' => null])
|
||||
|
||||
@php
|
||||
$shown = is_int($value) ? number_format($value, 0, ',', '.') : $value;
|
||||
$tag = $href ? 'a' : 'div';
|
||||
@endphp
|
||||
|
||||
<x-glass.panel :as="$tag" :href="$href" {{ $attributes->class('stat') }}>
|
||||
<span class="stat__icon" aria-hidden="true"><x-dynamic-component :component="'heroicon-o-'.$icon" /></span>
|
||||
<span class="stat__label">{{ $label }}</span>
|
||||
<span class="stat__value">{{ $shown }}</span>
|
||||
@if ($hint) <span class="stat__hint">{{ $hint }}</span> @endif
|
||||
</x-glass.panel>
|
||||
@@ -0,0 +1,4 @@
|
||||
{{-- Deret kartu angka (ui.stat). --}}
|
||||
<div {{ $attributes->class('stats') }}>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
@props(['href', 'active' => false])
|
||||
|
||||
<a href="{{ $href }}" @if ($active) aria-current="page" @endif {{ $attributes->class('tab') }}>{{ $slot }}</a>
|
||||
@@ -0,0 +1,6 @@
|
||||
{{-- Pembungkus tabel yang bisa digulir dan dapat difokus. Isi: <table class="table"> (atau table table--compact). Taruh di dalam glass.panel padding="none". --}}
|
||||
@props(['label'])
|
||||
|
||||
<div {{ $attributes->class('table-wrap') }} role="region" tabindex="0" aria-label="{{ $label }}">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
{{-- Navigasi tab berbasis tautan (server). Isi: <x-ui.tab :href :active>. Menggulir ke samping di layar sempit. --}}
|
||||
@props(['label'])
|
||||
|
||||
<nav {{ $attributes->class('tabs') }} aria-label="{{ $label }}">
|
||||
<div class="tabs__list">{{ $slot }}</div>
|
||||
</nav>
|
||||
@@ -0,0 +1,13 @@
|
||||
{{-- Tombol ganti tema terang/gelap. Pilihan disimpan di peramban; tanpa JS tombol disembunyikan. --}}
|
||||
<button
|
||||
type="button"
|
||||
{{ $attributes->class('theme-toggle js-only') }}
|
||||
x-data="themeToggle"
|
||||
x-on:click="toggle($event)"
|
||||
x-bind:aria-label="dark ? 'Ganti ke tema terang' : 'Ganti ke tema gelap'"
|
||||
x-bind:title="dark ? 'Tema terang' : 'Tema gelap'"
|
||||
aria-label="Ganti tema"
|
||||
>
|
||||
<span class="theme-toggle__moon" aria-hidden="true"><x-heroicon-o-moon /></span>
|
||||
<span class="theme-toggle__sun" aria-hidden="true"><x-heroicon-o-sun /></span>
|
||||
</button>
|
||||
Reference in New Issue
Block a user