1{{--
2 Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
3 See the LICENCE file in the repository root for full licence text.
4--}}
5@php
6 $additionalClass = $locals['additionalClass'] ?? '';
7 $attributes = $locals['attributes'] ?? [];
8 $checked = $locals['checked'] ?? false;
9 $defaultValue = $locals['defaultValue'] ?? null;
10 $modifiers = $locals['modifiers'] ?? null;
11 $name = $locals['name'] ?? null;
12 $type = $locals['type'] ?? 'checkbox';
13 $value = $locals['value'] ?? null;
14@endphp
15<label class="{{ class_with_modifiers('osu-switch-v2', $modifiers) }}">
16 @if ($defaultValue !== null)
17 <input
18 type="hidden"
19 @if (isset($name))
20 name="{{ $name }}"
21 @endif
22 value="{{ $defaultValue }}"
23 />
24 @endif
25 <input
26 class="osu-switch-v2__input {{ $additionalClass }}"
27 type="{{ $type }}"
28 @if ($name !== null)
29 name="{{ $name }}"
30 @endif
31 @if ($value !== null)
32 value="{{ $value }}"
33 @endif
34 @if ($checked)
35 checked
36 @endif
37 @foreach ($attributes as $k => $v)
38 {!! $k !!}="{{ $v }}"
39 @endforeach
40 />
41 <span class="osu-switch-v2__content"></span>
42</label>