Skip to content

Commit 0849d53

Browse files
author
yaroslav8765
committed
feat: add primary color support to the Checkbox.vue
1 parent 00093c9 commit 0849d53

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

adminforth/spa/src/afcl/Checkbox.vue

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
<template>
2-
<div class="afcl-checkbox flex items-center h-5" :class="{'opacity-50' : props.disabled}">
3-
<input :id="id"
4-
ref="rememberInput"
5-
type="checkbox"
6-
:checked="props.modelValue"
7-
:disabled="props.disabled"
8-
@change="$emit('update:modelValue', $event.target.checked)"
9-
class="w-4 h-4 border border-gray-300 rounded bg-gray-50 focus:ring-3 focus:ring-lightPrimary cursor-pointer
10-
focus:ring-opacity-50 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 checked:bg-lightPrimary checked:dark:bg-darkPrimary" />
2+
<div class="afcl-checkbox flex items-center relative h-5" :class="{'opacity-50' : props.disabled}">
3+
<div class="flex items-center justify-center">
4+
<input :id="id"
5+
ref="rememberInput"
6+
type="checkbox"
7+
:checked="props.modelValue"
8+
:disabled="props.disabled"
9+
@change="$emit('update:modelValue', $event.target.checked)"
10+
class="peer appearance-none min-w-4 min-h-4 bg-lightCheckboxBgUnchecked border border-lightCheckboxBorderColor rounded-sm checked:bg-lightCheckboxBgChecked
11+
focus:ring-lightFocusRing dark:focus:ring-darkFocusRing dark:focus:ring-darkFocusRing
12+
focus:ring-2 dark:bg-darkCheckboxBgUnchecked dark:border-darkCheckboxBorderColor dark:checked:bg-darkCheckboxBgChecked cursor-pointer"
13+
>
14+
<div class="pointer-events-none absolute text-lightCheckboxIconColor dark:text-darkCheckboxIconColor leading-none peer-checked:block hidden">
15+
<IconCheckOutline width="18" height="18" />
16+
</div>
17+
</div>
18+
<label :for="id" class="ms-2 text-sm font-medium text-lightTextLabel dark:text-darkTextLabel">
19+
<slot></slot>
20+
</label>
21+
1122
</div>
12-
<label :for="id" class="ms-2 text-sm font-medium text-gray-900 dark:text-gray-300">
13-
<slot></slot>
14-
</label>
1523
</template>
1624

1725
<script setup lang="ts">
18-
26+
import { IconCheckOutline } from '@iconify-prerendered/vue-flowbite';
1927
const props = defineProps({
2028
modelValue: Boolean,
2129
disabled: Boolean,

0 commit comments

Comments
 (0)