@fiscozen/card 0.1.6 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/card.js +116 -71
- package/dist/card.umd.cjs +1 -1
- package/dist/src/FzCard.vue.d.ts +20 -4
- package/dist/src/types.d.ts +46 -6
- package/package.json +5 -5
- package/src/FzCard.vue +164 -79
- package/src/__test__/FzCard.test.ts +518 -135
- package/src/__test__/__snapshots__/FzCard.test.ts.snap +9 -6
- package/src/types.ts +38 -1
- package/tsconfig.tsbuildinfo +1 -1
package/dist/card.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { FzIconButton as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as O, useSlots as j, ref as M, watch as T, computed as n, onMounted as V, createElementBlock as i, openBlock as r, normalizeClass as a, createCommentVNode as t, withDirectives as A, createElementVNode as f, renderSlot as m, toDisplayString as Y, createBlock as s, unref as c, withModifiers as q, vShow as C } from "vue";
|
|
2
|
+
import { FzIconButton as k, FzButton as h } from "@fiscozen/button";
|
|
3
|
+
const x = { class: "flex flex-row gap-12 items-center" }, H = ["title"], L = { class: "flex flex-row gap-8 items-center" }, P = "border-1 border-solid border-grey-100 rounded flex flex-col", G = "border-solid pt-16 px-16 flex flex-row justify-between", J = "border-solid pt-0 px-16 pb-16 flex justify-end gap-12 items-center", R = /* @__PURE__ */ O({
|
|
4
4
|
__name: "FzCard",
|
|
5
5
|
props: {
|
|
6
6
|
title: {},
|
|
@@ -11,114 +11,159 @@ const j = { class: "flex flex-row gap-12 items-center" }, V = ["title"], Y = "bo
|
|
|
11
11
|
contentClass: {},
|
|
12
12
|
collapsible: { type: Boolean },
|
|
13
13
|
defaultExpanded: { type: Boolean },
|
|
14
|
-
alwaysAlive: { type: Boolean }
|
|
14
|
+
alwaysAlive: { type: Boolean },
|
|
15
|
+
hasInfoIcon: { type: Boolean },
|
|
16
|
+
environment: { default: "frontoffice" }
|
|
15
17
|
},
|
|
16
|
-
emits: ["fzprimary:click", "fzsecondary:click", "fztertiary:click"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
emits: ["fzprimary:click", "fzsecondary:click", "fztertiary:click", "fzcard:click-info"],
|
|
19
|
+
setup(z, { expose: B, emit: S }) {
|
|
20
|
+
const o = z, u = S, v = j(), d = M(o.defaultExpanded ?? !1);
|
|
21
|
+
T(
|
|
22
|
+
() => o.color === "aliceblue",
|
|
23
|
+
(e) => {
|
|
24
|
+
e && console.warn(
|
|
25
|
+
"[FzCard] The color prop value 'aliceblue' is deprecated and will be removed in a future version. Please use 'blue' instead. The component will automatically map 'aliceblue' to 'blue' for now."
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
{ immediate: !0 }
|
|
29
|
+
);
|
|
30
|
+
const y = n(() => o.color === "aliceblue" ? "blue" : o.color), p = n(() => d.value || !o.collapsible), g = n(() => o.alwaysAlive || p.value), $ = n(
|
|
31
|
+
() => o.title || v.header || v["header-content"]
|
|
32
|
+
), F = n(() => [
|
|
33
|
+
o.collapsible ? "cursor-pointer" : ""
|
|
34
|
+
]), N = n(() => {
|
|
35
|
+
switch (y.value) {
|
|
23
36
|
case "blue":
|
|
24
37
|
return "bg-background-alice-blue";
|
|
25
38
|
case "orange":
|
|
26
39
|
return "bg-background-seashell";
|
|
27
40
|
case "purple":
|
|
28
41
|
return "bg-background-pale-purple";
|
|
42
|
+
case "grey":
|
|
43
|
+
return "bg-background-white-smoke";
|
|
29
44
|
default:
|
|
30
45
|
return "bg-core-white";
|
|
31
46
|
}
|
|
32
|
-
}),
|
|
33
|
-
switch (
|
|
47
|
+
}), I = n(() => "text-core-black"), D = n(() => {
|
|
48
|
+
switch (y.value) {
|
|
34
49
|
case "blue":
|
|
35
|
-
return "border-blue
|
|
50
|
+
return "border-background-alice-blue";
|
|
36
51
|
case "orange":
|
|
37
52
|
return "border-orange-200";
|
|
38
53
|
case "purple":
|
|
39
54
|
return "border-purple-200";
|
|
55
|
+
case "grey":
|
|
56
|
+
return "border-grey-200";
|
|
40
57
|
default:
|
|
41
58
|
return "border-grey-100";
|
|
42
59
|
}
|
|
43
|
-
})
|
|
44
|
-
|
|
60
|
+
});
|
|
61
|
+
n(() => {
|
|
62
|
+
switch (y.value) {
|
|
63
|
+
case "blue":
|
|
64
|
+
case "orange":
|
|
65
|
+
case "purple":
|
|
66
|
+
case "grey":
|
|
67
|
+
return "border-0";
|
|
68
|
+
default:
|
|
69
|
+
return "border-1";
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const E = n(
|
|
73
|
+
() => o.primaryAction !== void 0 || o.secondaryAction !== void 0 || o.tertiaryAction !== void 0
|
|
45
74
|
);
|
|
46
|
-
function
|
|
47
|
-
|
|
75
|
+
function w() {
|
|
76
|
+
o.collapsible && (d.value = !d.value);
|
|
48
77
|
}
|
|
49
|
-
return
|
|
50
|
-
|
|
78
|
+
return V(() => {
|
|
79
|
+
o.tertiaryAction && !o.secondaryAction && !o.primaryAction ? console.warn(
|
|
51
80
|
"[Fiscozen Design System]: You should set primaryAction and secondaryAction if you want to set tertiaryAction"
|
|
52
|
-
) :
|
|
81
|
+
) : o.secondaryAction && !o.primaryAction && console.warn(
|
|
53
82
|
"[Fiscozen Design System]: You should set primaryAction if you want to set secondaryAction"
|
|
54
83
|
);
|
|
55
|
-
}),
|
|
84
|
+
}), B({
|
|
56
85
|
/**
|
|
57
86
|
* Method to toggle the card open/closed state
|
|
58
87
|
*/
|
|
59
|
-
toggleOpen:
|
|
60
|
-
}), (
|
|
61
|
-
class: a([
|
|
88
|
+
toggleOpen: w
|
|
89
|
+
}), (e, l) => (r(), i("section", {
|
|
90
|
+
class: a([P, N.value, I.value, D.value, { "pb-16": !p.value }])
|
|
62
91
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
$.value ? (r(), i("header", {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: a([F.value]),
|
|
95
|
+
onClick: w
|
|
66
96
|
}, [
|
|
67
|
-
|
|
68
|
-
class: a(
|
|
97
|
+
f("div", {
|
|
98
|
+
class: a(G)
|
|
69
99
|
}, [
|
|
70
|
-
|
|
71
|
-
|
|
100
|
+
f("div", x, [
|
|
101
|
+
e.title ? (r(), i("h2", {
|
|
72
102
|
key: 0,
|
|
73
|
-
class: "text-core-black font-medium text-
|
|
74
|
-
title:
|
|
75
|
-
},
|
|
76
|
-
|
|
103
|
+
class: "text-core-black font-medium text-xl m-0 p-0 break-words",
|
|
104
|
+
title: e.title
|
|
105
|
+
}, Y(e.title), 9, H)) : t("", !0),
|
|
106
|
+
m(e.$slots, "header")
|
|
77
107
|
]),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
108
|
+
f("div", L, [
|
|
109
|
+
e.hasInfoIcon ? (r(), s(c(k), {
|
|
110
|
+
key: 0,
|
|
111
|
+
iconName: "circle-question",
|
|
112
|
+
variant: "invisible",
|
|
113
|
+
environment: e.environment,
|
|
114
|
+
onClick: l[0] || (l[0] = q((b) => u("fzcard:click-info"), ["stop"]))
|
|
115
|
+
}, null, 8, ["environment"])) : t("", !0),
|
|
116
|
+
e.collapsible ? (r(), s(c(k), {
|
|
117
|
+
key: 1,
|
|
118
|
+
iconName: d.value ? "chevron-up" : "chevron-down",
|
|
119
|
+
variant: "invisible",
|
|
120
|
+
environment: e.environment
|
|
121
|
+
}, null, 8, ["iconName", "environment"])) : t("", !0)
|
|
122
|
+
])
|
|
83
123
|
]),
|
|
84
|
-
|
|
85
|
-
], 2),
|
|
86
|
-
|
|
87
|
-
key:
|
|
88
|
-
class: a(["p-20",
|
|
124
|
+
m(e.$slots, "header-content")
|
|
125
|
+
], 2)) : t("", !0),
|
|
126
|
+
g.value ? A((r(), i("article", {
|
|
127
|
+
key: 1,
|
|
128
|
+
class: a(["p-20", e.contentClass])
|
|
89
129
|
}, [
|
|
90
|
-
|
|
130
|
+
m(e.$slots, "default")
|
|
91
131
|
], 2)), [
|
|
92
|
-
[
|
|
132
|
+
[C, p.value]
|
|
93
133
|
]) : t("", !0),
|
|
94
|
-
|
|
95
|
-
key:
|
|
96
|
-
class: a([
|
|
134
|
+
(v.footer || E.value) && g.value ? A((r(), i("footer", {
|
|
135
|
+
key: 2,
|
|
136
|
+
class: a([J])
|
|
97
137
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
m(e.$slots, "footer", {}, () => [
|
|
139
|
+
e.tertiaryAction ? (r(), s(c(k), {
|
|
140
|
+
key: 0,
|
|
141
|
+
onClick: l[1] || (l[1] = (b) => u("fztertiary:click")),
|
|
142
|
+
iconName: e.tertiaryAction.icon,
|
|
143
|
+
variant: "invisible",
|
|
144
|
+
environment: e.environment
|
|
145
|
+
}, null, 8, ["iconName", "environment"])) : t("", !0),
|
|
146
|
+
e.secondaryAction ? (r(), s(c(h), {
|
|
147
|
+
key: 1,
|
|
148
|
+
onClick: l[2] || (l[2] = (b) => u("fzsecondary:click")),
|
|
149
|
+
label: e.secondaryAction.label,
|
|
150
|
+
variant: "secondary",
|
|
151
|
+
environment: e.environment
|
|
152
|
+
}, null, 8, ["label", "environment"])) : t("", !0),
|
|
153
|
+
e.primaryAction ? (r(), s(c(h), {
|
|
154
|
+
key: 2,
|
|
155
|
+
onClick: l[3] || (l[3] = (b) => u("fzprimary:click")),
|
|
156
|
+
label: e.primaryAction.label,
|
|
157
|
+
variant: "primary",
|
|
158
|
+
environment: e.environment
|
|
159
|
+
}, null, 8, ["label", "environment"])) : t("", !0)
|
|
160
|
+
])
|
|
116
161
|
], 2)), [
|
|
117
|
-
[
|
|
162
|
+
[C, p.value]
|
|
118
163
|
]) : t("", !0)
|
|
119
164
|
], 2));
|
|
120
165
|
}
|
|
121
166
|
});
|
|
122
167
|
export {
|
|
123
|
-
|
|
168
|
+
R as FzCard
|
|
124
169
|
};
|
package/dist/card.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@fiscozen/button")):typeof define=="function"&&define.amd?define(["exports","vue","@fiscozen/button"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.FzCard={},t.Vue,t.button))})(this,function(t,e,l){"use strict";const u={class:"flex flex-row gap-12 items-center"},y=["title"],b={class:"flex flex-row gap-8 items-center"},k="border-1 border-solid border-grey-100 rounded flex flex-col",C="border-solid pt-16 px-16 flex flex-row justify-between",B="border-solid pt-0 px-16 pb-16 flex justify-end gap-12 items-center",g=e.defineComponent({__name:"FzCard",props:{title:{},color:{},primaryAction:{},secondaryAction:{},tertiaryAction:{},contentClass:{},collapsible:{type:Boolean},defaultExpanded:{type:Boolean},alwaysAlive:{type:Boolean},hasInfoIcon:{type:Boolean},environment:{default:"frontoffice"}},emits:["fzprimary:click","fzsecondary:click","fztertiary:click","fzcard:click-info"],setup(h,{expose:w,emit:z}){const n=h,a=z,s=e.useSlots(),i=e.ref(n.defaultExpanded??!1);e.watch(()=>n.color==="aliceblue",o=>{o&&console.warn("[FzCard] The color prop value 'aliceblue' is deprecated and will be removed in a future version. Please use 'blue' instead. The component will automatically map 'aliceblue' to 'blue' for now.")},{immediate:!0});const d=e.computed(()=>n.color==="aliceblue"?"blue":n.color),c=e.computed(()=>i.value||!n.collapsible),p=e.computed(()=>n.alwaysAlive||c.value),A=e.computed(()=>n.title||s.header||s["header-content"]),N=e.computed(()=>[n.collapsible?"cursor-pointer":""]),S=e.computed(()=>{switch(d.value){case"blue":return"bg-background-alice-blue";case"orange":return"bg-background-seashell";case"purple":return"bg-background-pale-purple";case"grey":return"bg-background-white-smoke";default:return"bg-core-white"}}),V=e.computed(()=>"text-core-black"),F=e.computed(()=>{switch(d.value){case"blue":return"border-background-alice-blue";case"orange":return"border-orange-200";case"purple":return"border-purple-200";case"grey":return"border-grey-200";default:return"border-grey-100"}});e.computed(()=>{switch(d.value){case"blue":case"orange":case"purple":case"grey":return"border-0";default:return"border-1"}});const E=e.computed(()=>n.primaryAction!==void 0||n.secondaryAction!==void 0||n.tertiaryAction!==void 0);function f(){n.collapsible&&(i.value=!i.value)}return e.onMounted(()=>{n.tertiaryAction&&!n.secondaryAction&&!n.primaryAction?console.warn("[Fiscozen Design System]: You should set primaryAction and secondaryAction if you want to set tertiaryAction"):n.secondaryAction&&!n.primaryAction&&console.warn("[Fiscozen Design System]: You should set primaryAction if you want to set secondaryAction")}),w({toggleOpen:f}),(o,r)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass([k,S.value,V.value,F.value,{"pb-16":!c.value}])},[A.value?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([N.value]),onClick:f},[e.createElementVNode("div",{class:e.normalizeClass(C)},[e.createElementVNode("div",u,[o.title?(e.openBlock(),e.createElementBlock("h2",{key:0,class:"text-core-black font-medium text-xl m-0 p-0 break-words",title:o.title},e.toDisplayString(o.title),9,y)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"header")]),e.createElementVNode("div",b,[o.hasInfoIcon?(e.openBlock(),e.createBlock(e.unref(l.FzIconButton),{key:0,iconName:"circle-question",variant:"invisible",environment:o.environment,onClick:r[0]||(r[0]=e.withModifiers(m=>a("fzcard:click-info"),["stop"]))},null,8,["environment"])):e.createCommentVNode("",!0),o.collapsible?(e.openBlock(),e.createBlock(e.unref(l.FzIconButton),{key:1,iconName:i.value?"chevron-up":"chevron-down",variant:"invisible",environment:o.environment},null,8,["iconName","environment"])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"header-content")],2)):e.createCommentVNode("",!0),p.value?e.withDirectives((e.openBlock(),e.createElementBlock("article",{key:1,class:e.normalizeClass(["p-20",o.contentClass])},[e.renderSlot(o.$slots,"default")],2)),[[e.vShow,c.value]]):e.createCommentVNode("",!0),(s.footer||E.value)&&p.value?e.withDirectives((e.openBlock(),e.createElementBlock("footer",{key:2,class:e.normalizeClass([B])},[e.renderSlot(o.$slots,"footer",{},()=>[o.tertiaryAction?(e.openBlock(),e.createBlock(e.unref(l.FzIconButton),{key:0,onClick:r[1]||(r[1]=m=>a("fztertiary:click")),iconName:o.tertiaryAction.icon,variant:"invisible",environment:o.environment},null,8,["iconName","environment"])):e.createCommentVNode("",!0),o.secondaryAction?(e.openBlock(),e.createBlock(e.unref(l.FzButton),{key:1,onClick:r[2]||(r[2]=m=>a("fzsecondary:click")),label:o.secondaryAction.label,variant:"secondary",environment:o.environment},null,8,["label","environment"])):e.createCommentVNode("",!0),o.primaryAction?(e.openBlock(),e.createBlock(e.unref(l.FzButton),{key:2,onClick:r[3]||(r[3]=m=>a("fzprimary:click")),label:o.primaryAction.label,variant:"primary",environment:o.environment},null,8,["label","environment"])):e.createCommentVNode("",!0)])],2)),[[e.vShow,c.value]]):e.createCommentVNode("",!0)],2))}});t.FzCard=g,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
package/dist/src/FzCard.vue.d.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { FzCardProps, FzCardSlots } from './types';
|
|
2
2
|
|
|
3
3
|
declare function toggleOpen(): void;
|
|
4
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<FzCardProps>, {
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FzCardProps>, {
|
|
5
|
+
environment: string;
|
|
6
|
+
}>>, {
|
|
5
7
|
/**
|
|
6
8
|
* Method to toggle the card open/closed state
|
|
7
9
|
*/
|
|
8
10
|
toggleOpen: typeof toggleOpen;
|
|
9
|
-
},
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
12
|
"fzprimary:click": () => void;
|
|
11
13
|
"fzsecondary:click": () => void;
|
|
12
14
|
"fztertiary:click": () => void;
|
|
13
|
-
|
|
15
|
+
"fzcard:click-info": () => void;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FzCardProps>, {
|
|
17
|
+
environment: string;
|
|
18
|
+
}>>> & Readonly<{
|
|
14
19
|
"onFzprimary:click"?: (() => any) | undefined;
|
|
15
20
|
"onFzsecondary:click"?: (() => any) | undefined;
|
|
16
21
|
"onFztertiary:click"?: (() => any) | undefined;
|
|
17
|
-
|
|
22
|
+
"onFzcard:click-info"?: (() => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
environment: import('./types').FzCardEnvironment;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, Readonly<FzCardSlots> & FzCardSlots>;
|
|
18
26
|
export default _default;
|
|
19
27
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
20
28
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -25,6 +33,14 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
25
33
|
required: true;
|
|
26
34
|
};
|
|
27
35
|
};
|
|
36
|
+
type __VLS_WithDefaults<P, D> = {
|
|
37
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
38
|
+
default: D[K];
|
|
39
|
+
}> : P[K];
|
|
40
|
+
};
|
|
41
|
+
type __VLS_Prettify<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
|
28
44
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
29
45
|
new (): {
|
|
30
46
|
$slots: S;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type FzCardProps = {
|
|
|
2
2
|
/**
|
|
3
3
|
* The title of the card
|
|
4
4
|
*/
|
|
5
|
-
title
|
|
5
|
+
title?: string;
|
|
6
6
|
/**
|
|
7
7
|
* The background color of the card
|
|
8
8
|
*/
|
|
@@ -35,6 +35,16 @@ export type FzCardProps = {
|
|
|
35
35
|
* Whether the card content is always alive (never destroyed) when collapsed
|
|
36
36
|
*/
|
|
37
37
|
alwaysAlive?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to show an info icon in the header
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
hasInfoIcon?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The environment context for the card buttons
|
|
45
|
+
* @default 'frontoffice'
|
|
46
|
+
*/
|
|
47
|
+
environment?: FzCardEnvironment;
|
|
38
48
|
};
|
|
39
49
|
type FzCardButton = {
|
|
40
50
|
label: string;
|
|
@@ -42,23 +52,49 @@ type FzCardButton = {
|
|
|
42
52
|
type FzCardIconButton = {
|
|
43
53
|
icon: string;
|
|
44
54
|
};
|
|
45
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Card background color variants.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* - 'default' renders a white background
|
|
60
|
+
* - 'blue' renders an alice-blue background
|
|
61
|
+
* - 'orange' renders a seashell background
|
|
62
|
+
* - 'purple' renders a pale-purple background
|
|
63
|
+
* - 'grey' renders a white-smoke background
|
|
64
|
+
*
|
|
65
|
+
* @deprecated 'aliceblue' is deprecated and will be removed in a future version. Use 'blue' instead.
|
|
66
|
+
*/
|
|
67
|
+
export type FzCardColor = "default" | "blue" | "orange" | "purple" | "grey" | "aliceblue";
|
|
68
|
+
/**
|
|
69
|
+
* Card environment context for buttons
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* Determines the visual style context for all buttons within the card
|
|
73
|
+
* - 'backoffice' for internal/admin interfaces
|
|
74
|
+
* - 'frontoffice' for public-facing interfaces
|
|
75
|
+
*/
|
|
76
|
+
export type FzCardEnvironment = "backoffice" | "frontoffice";
|
|
46
77
|
export interface FzCardEvents {
|
|
47
78
|
/**
|
|
48
79
|
* Event emitted when the primary action is clicked
|
|
49
80
|
* @type {() => void}
|
|
50
81
|
*/
|
|
51
|
-
(event:
|
|
82
|
+
(event: "fzprimary:click"): void;
|
|
52
83
|
/**
|
|
53
84
|
* Event emitted when the secondary action is clicked
|
|
54
85
|
* @type {() => void}
|
|
55
86
|
*/
|
|
56
|
-
(event:
|
|
87
|
+
(event: "fzsecondary:click"): void;
|
|
57
88
|
/**
|
|
58
89
|
* Event emitted when the tertiary action is clicked
|
|
59
90
|
* @type {() => void}
|
|
60
91
|
*/
|
|
61
|
-
(event:
|
|
92
|
+
(event: "fztertiary:click"): void;
|
|
93
|
+
/**
|
|
94
|
+
* Event emitted when the info icon is clicked
|
|
95
|
+
* @type {() => void}
|
|
96
|
+
*/
|
|
97
|
+
(event: "fzcard:click-info"): void;
|
|
62
98
|
}
|
|
63
99
|
export interface FzCardSlots {
|
|
64
100
|
/**
|
|
@@ -72,6 +108,10 @@ export interface FzCardSlots {
|
|
|
72
108
|
/**
|
|
73
109
|
* Slot for the header content, it will be displayed below the title
|
|
74
110
|
*/
|
|
75
|
-
|
|
111
|
+
"header-content"(props: {}): any;
|
|
112
|
+
/**
|
|
113
|
+
* Slot for the footer of the card
|
|
114
|
+
*/
|
|
115
|
+
footer(props: {}): any;
|
|
76
116
|
}
|
|
77
117
|
export {};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiscozen/card",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "Design System Card component",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [],
|
|
8
8
|
"author": "Cristian Barraco",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@fiscozen/
|
|
11
|
-
"@fiscozen/
|
|
10
|
+
"@fiscozen/button": "^1.0.0",
|
|
11
|
+
"@fiscozen/icons": "^0.1.35"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"tailwindcss": "^3.4.1",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@awesome.me/kit-8137893ad3": "^1.0.65",
|
|
34
34
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
35
35
|
"@fortawesome/vue-fontawesome": "^3.0.6",
|
|
36
|
+
"@fiscozen/tsconfig": "^0.1.0",
|
|
36
37
|
"@fiscozen/prettier-config": "^0.1.0",
|
|
37
|
-
"@fiscozen/eslint-config": "^0.1.0"
|
|
38
|
-
"@fiscozen/tsconfig": "^0.1.0"
|
|
38
|
+
"@fiscozen/eslint-config": "^0.1.0"
|
|
39
39
|
},
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"scripts": {
|