diff --git a/resources/css/app.css b/resources/css/app.css index 76807c0..9e73e90 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -174,6 +174,119 @@ html.qr-mobile-page body { pointer-events: none; } + .btn-warning { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + border-radius: 9999px; + border: 1px solid rgb(252 211 77); + background-color: #fff; + padding: 0.5rem 1rem; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 600; + color: rgb(180 83 9); + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + transition: background-color 0.15s ease, border-color 0.15s ease; + } + + .btn-warning:hover { + background-color: rgb(255 251 235); + border-color: rgb(245 158 11); + } + + .btn-warning:disabled { + opacity: 0.6; + pointer-events: none; + } + + .btn-danger { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + border-radius: 9999px; + border: 1px solid rgb(254 202 202); + background-color: #fff; + padding: 0.5rem 1rem; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 600; + color: rgb(185 28 28); + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + transition: background-color 0.15s ease, border-color 0.15s ease; + } + + .btn-danger:hover { + background-color: rgb(254 242 242); + border-color: rgb(252 165 165); + } + + .btn-danger:disabled { + opacity: 0.6; + pointer-events: none; + } + + .btn-danger-plain { + padding: 0; + border: none; + background: transparent; + border-radius: 0; + box-shadow: none; + font-weight: 500; + } + + .btn-danger-plain:hover { + background: transparent; + text-decoration: underline; + } + + .btn-link { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.375rem; + border-radius: 9999px; + border: 1px solid transparent; + background-color: transparent; + padding: 0.5rem 0.75rem; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 600; + color: rgb(67 56 202); + transition: background-color 0.15s ease, color 0.15s ease; + } + + .btn-link:hover { + background-color: rgb(238 242 255); + color: rgb(55 48 163); + } + + .btn-link:disabled { + opacity: 0.6; + pointer-events: none; + } + + .btn-link-plain { + padding: 0; + border: none; + background: transparent; + border-radius: 0; + font-weight: 500; + } + + .btn-link-plain:hover { + background: transparent; + text-decoration: underline; + } + + .btn-sm { + padding: 0.25rem 0.625rem; + font-size: 0.75rem; + line-height: 1rem; + } + .btn-group { display: flex; flex-wrap: wrap; diff --git a/resources/views/components/btn.blade.php b/resources/views/components/btn.blade.php new file mode 100644 index 0000000..ca40175 --- /dev/null +++ b/resources/views/components/btn.blade.php @@ -0,0 +1,34 @@ +@props([ + 'variant' => 'primary', + 'href' => null, + 'type' => 'button', + 'size' => null, + 'plain' => false, +]) + +@php + $tag = $href ? 'a' : 'button'; + + $variantClass = match ($variant) { + 'secondary' => 'btn-secondary', + 'warning' => 'btn-warning', + 'danger' => 'btn-danger', + 'link' => 'btn-link', + default => 'btn-primary', + }; + + $classes = collect([ + $variantClass, + $size === 'sm' ? 'btn-sm' : null, + ($plain && $variant === 'link') ? 'btn-link-plain' : null, + ($plain && $variant === 'danger') ? 'btn-danger-plain' : null, + ])->filter()->implode(' '); +@endphp + +<{{ $tag }} + @if ($href) href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + {{ $attributes->class([$classes]) }} +> + {{ $slot }} +{{ $tag }}> diff --git a/resources/views/components/danger-zone.blade.php b/resources/views/components/danger-zone.blade.php new file mode 100644 index 0000000..c24603b --- /dev/null +++ b/resources/views/components/danger-zone.blade.php @@ -0,0 +1,12 @@ +@props([ + 'title' => null, +]) + +
{{ $title }}
+ @endif +