Card-DYSPsF5s.mjs
6.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import { useSlots, computed, unref, mergeProps, withCtx, openBlock, createBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderClass, ssrRenderSlot, ssrInterpolate } from 'vue/server-renderer';
import { k as useAppConfig, l as useComponentUI, t as tv, P as Primitive } from './server.mjs';
const theme = {
"slots": {
"root": "rounded-lg overflow-hidden",
"header": "p-4 sm:px-6",
"title": "text-highlighted font-semibold",
"description": "mt-1 text-muted text-sm",
"body": "p-4 sm:p-6",
"footer": "p-4 sm:px-6"
},
"variants": {
"variant": {
"solid": {
"root": "bg-inverted text-inverted",
"title": "text-inverted",
"description": "text-dimmed"
},
"outline": {
"root": "bg-default ring ring-default divide-y divide-default"
},
"soft": {
"root": "bg-elevated/50 divide-y divide-default"
},
"subtle": {
"root": "bg-elevated/50 ring ring-default divide-y divide-default"
}
}
},
"defaultVariants": {
"variant": "outline"
}
};
const _sfc_main = {
__name: "UCard",
__ssrInlineRender: true,
props: {
as: { type: null, required: false },
title: { type: String, required: false },
description: { type: String, required: false },
variant: { type: null, required: false },
class: { type: null, required: false },
ui: { type: Object, required: false }
},
setup(__props) {
const props = __props;
const slots = useSlots();
const appConfig = useAppConfig();
const uiProp = useComponentUI("card", props);
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.card || {} })({
variant: props.variant
}));
return (_ctx, _push, _parent, _attrs) => {
_push(ssrRenderComponent(unref(Primitive), mergeProps({
as: __props.as,
"data-slot": "root",
class: ui.value.root({ class: [unref(uiProp)?.root, props.class] })
}, _attrs), {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
if (!!slots.header || (__props.title || !!slots.title) || (__props.description || !!slots.description)) {
_push2(`<div data-slot="header" class="${ssrRenderClass(ui.value.header({ class: unref(uiProp)?.header }))}"${_scopeId}>`);
ssrRenderSlot(_ctx.$slots, "header", {}, () => {
if (__props.title || !!slots.title) {
_push2(`<div data-slot="title" class="${ssrRenderClass(ui.value.title({ class: unref(uiProp)?.title }))}"${_scopeId}>`);
ssrRenderSlot(_ctx.$slots, "title", {}, () => {
_push2(`${ssrInterpolate(__props.title)}`);
}, _push2, _parent2, _scopeId);
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
if (__props.description || !!slots.description) {
_push2(`<div data-slot="description" class="${ssrRenderClass(ui.value.description({ class: unref(uiProp)?.description }))}"${_scopeId}>`);
ssrRenderSlot(_ctx.$slots, "description", {}, () => {
_push2(`${ssrInterpolate(__props.description)}`);
}, _push2, _parent2, _scopeId);
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
}, _push2, _parent2, _scopeId);
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
if (!!slots.default) {
_push2(`<div data-slot="body" class="${ssrRenderClass(ui.value.body({ class: unref(uiProp)?.body }))}"${_scopeId}>`);
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
if (!!slots.footer) {
_push2(`<div data-slot="footer" class="${ssrRenderClass(ui.value.footer({ class: unref(uiProp)?.footer }))}"${_scopeId}>`);
ssrRenderSlot(_ctx.$slots, "footer", {}, null, _push2, _parent2, _scopeId);
_push2(`</div>`);
} else {
_push2(`<!---->`);
}
} else {
return [
!!slots.header || (__props.title || !!slots.title) || (__props.description || !!slots.description) ? (openBlock(), createBlock("div", {
key: 0,
"data-slot": "header",
class: ui.value.header({ class: unref(uiProp)?.header })
}, [
renderSlot(_ctx.$slots, "header", {}, () => [
__props.title || !!slots.title ? (openBlock(), createBlock("div", {
key: 0,
"data-slot": "title",
class: ui.value.title({ class: unref(uiProp)?.title })
}, [
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString(__props.title), 1)
])
], 2)) : createCommentVNode("", true),
__props.description || !!slots.description ? (openBlock(), createBlock("div", {
key: 1,
"data-slot": "description",
class: ui.value.description({ class: unref(uiProp)?.description })
}, [
renderSlot(_ctx.$slots, "description", {}, () => [
createTextVNode(toDisplayString(__props.description), 1)
])
], 2)) : createCommentVNode("", true)
])
], 2)) : createCommentVNode("", true),
!!slots.default ? (openBlock(), createBlock("div", {
key: 1,
"data-slot": "body",
class: ui.value.body({ class: unref(uiProp)?.body })
}, [
renderSlot(_ctx.$slots, "default")
], 2)) : createCommentVNode("", true),
!!slots.footer ? (openBlock(), createBlock("div", {
key: 2,
"data-slot": "footer",
class: ui.value.footer({ class: unref(uiProp)?.footer })
}, [
renderSlot(_ctx.$slots, "footer")
], 2)) : createCommentVNode("", true)
];
}
}),
_: 3
}, _parent));
};
}
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/.pnpm/@nuxt+ui@4.7.1_@internationalized+date@3.12.1_@internationalized+number@3.6.6_@tiptap+e_90a56fc914ccb75fcd2d7dd88cfc0d9f/node_modules/@nuxt/ui/dist/runtime/components/Card.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as _ };
//# sourceMappingURL=Card-DYSPsF5s.mjs.map