Skip to content

Commit 654c0a5

Browse files
committed
feat: add afcl card component
1 parent 969787c commit 654c0a5

5 files changed

Lines changed: 47 additions & 5 deletions

File tree

adminforth/documentation/docs/tutorial/03-Customization/15-afcl.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,25 @@ const enable = ref(false)
436436
</div>
437437
</div>
438438

439+
## Card
440+
441+
<div class="split-screen">
442+
```ts
443+
import { Card } from '@/afcl'
444+
445+
...
446+
447+
<Card
448+
title="New Reality"
449+
description="Click this card to visit the new AdminForth reality where you can build your own back-office"
450+
>
451+
</Card>
452+
```
453+
454+
![AFCL Checkbox](Card.png)
455+
456+
457+
</div>
439458

440459
## Toggle
441460

15.2 KB
Loading

adminforth/modules/styles.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,12 @@ export const styles = () => ({
340340
lightToastCloseIconFocusRing: "#D1D5DB",
341341
lightToastText: "#6B7280",
342342

343+
lightCardBackground: "#FFFFFF",
344+
lightCardBackgroundHover: "#F3F4F6",
345+
lightCardBorder: "#E5E7EB",
346+
lightCardTitle: "#374151",
347+
lightCardDescription: "#6B7280",
343348

344-
345-
346-
347-
348349
// colors for dark theme
349350
darkHtml: "#111827",
350351

@@ -682,6 +683,11 @@ export const styles = () => ({
682683
darkToastCloseIconFocusRing: "#374151",
683684
darkToastText: "#9CA3AF",
684685

686+
darkCardBackground: "#1F2937", // card background
687+
darkCardBackgroundHover: "#374151", // card background hover
688+
darkCardBorder: "#4B5563", // card border
689+
darkCardTitle: "#FFFFFF", // card title
690+
darkCardDescription: "#9CA3AF", // card description
685691

686692
},
687693
boxShadow: {

adminforth/spa/src/afcl/Card.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<a href="#" class="block max-w-sm p-6 bg-lightCardBackground border border-lightCardBorder rounded-lg shadow-sm hover:bg-lightCardBackgroundHover dark:bg-darkCardBackground dark:border-darkCardBorder dark:hover:bg-darkCardBackgroundHover">
3+
4+
<h5 class="mb-2 text-2xl font-bold tracking-tight text-lightCardTitle dark:text-darkCardTitle">{{ props.title }}</h5>
5+
<p class="font-normal text-base text-lightCardDescription dark:text-darkCardDescription">{{ props.description }}</p>
6+
</a>
7+
</template>
8+
9+
10+
<script setup lang="ts">
11+
const props = defineProps<{
12+
title: string;
13+
description: string;
14+
}>();
15+
16+
</script>

adminforth/spa/src/afcl/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ export { default as JsonViewer } from './JsonViewer.vue';
2323
export { default as Toggle } from './Toggle.vue';
2424
export { default as DatePicker } from './DatePicker.vue';
2525
export { default as Textarea } from './Textarea.vue';
26-
export { default as ButtonGroup } from './ButtonGroup.vue';
26+
export { default as ButtonGroup } from './ButtonGroup.vue';
27+
export { default as Card } from './Card.vue';

0 commit comments

Comments
 (0)