11<script lang="ts">
22import { defineComponent , PropType , Component } from ' vue'
33
4+ type ClassValue = string | string [] | Record <string , boolean >
5+
46export default defineComponent ({
57 name: ' APanel' ,
68 props: {
@@ -15,13 +17,27 @@ export default defineComponent({
1517 as: {
1618 type: [Object , String ] as PropType <Component | keyof HTMLElementTagNameMap >,
1719 default: ' div'
20+ },
21+ /**
22+ * Custom classes for internal containers. Merged with default classes.
23+ * - `title`: merged with (min-h-10 px-6 pt-2 heading-sm)
24+ * - `body`: merged with (overflow-auto px-6 py-4 body-md)
25+ * - `actions`: merged with (mt-auto flex h-16 items-center gap-2 rounded-b border-t border-gray bg-athens px-6 py-3)
26+ */
27+ classes: {
28+ type: Object as PropType <{
29+ title? : ClassValue
30+ body? : ClassValue
31+ actions? : ClassValue
32+ }>,
33+ default : () => ({})
1834 }
1935 }
2036})
2137 </script >
2238<template >
2339 <div class =" a-panel-lg flex flex-col whitespace-pre-line rounded bg-white" >
24- <div v-if =" $slots.title || title" class =" min-h-10 px-6 pt-2 heading-sm" >
40+ <div v-if =" $slots.title || title" class =" min-h-10 px-6 pt-2 heading-sm" :class = " classes.title " >
2541 <!--
2642 @slot #title
2743 For simple strings, use the `title` prop.
@@ -31,7 +47,7 @@ export default defineComponent({
3147 {{ title }}
3248 </slot >
3349 </div >
34- <div class =" overflow-auto px-6 py-4 body-md" >
50+ <div class =" overflow-auto px-6 py-4 body-md" :class = " classes.body " >
3551 <!--
3652 @slot #body
3753 This is a padded container with typography styles
@@ -40,7 +56,8 @@ export default defineComponent({
4056 </div >
4157 <div
4258 v-if =" $slots.actions"
43- class =" mt-auto flex h-16 items-center gap-2 rounded-b border-t border-gray bg-athens px-6 py-3" >
59+ class =" mt-auto flex h-16 items-center gap-2 rounded-b border-t border-gray bg-athens px-6 py-3"
60+ :class =" classes.actions" >
4461 <!--
4562 @slot #actions
4663 Use the slot to provide buttons for user actions.
0 commit comments