@fiscozen/card 1.0.1 → 1.1.0

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.
@@ -0,0 +1 @@
1
+ (function(c,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):(c=typeof globalThis<"u"?globalThis:c||self,e(c.FzCard={},c.Vue,c.button))})(this,function(c,e,d){"use strict";const w=((o,l)=>{const a=o.__vccOpts||o;for(const[n,t]of l)a[n]=t;return a})(e.defineComponent({__name:"FzContainer",props:{main:{type:Boolean,default:!1},gap:{default:"base"},tag:{default:"div"},alignItems:{default:void 0},horizontal:{type:Boolean,default:!1},layout:{}},setup(o){const l=o,a=e.computed(()=>l.alignItems??(l.horizontal?"center":"stretch"));if(!l.horizontal&&"layout"in l){const t=l.layout;t&&t!=="default"&&console.error(`[FzContainer] The "layout" prop only works when horizontal is true. Current horizontal: ${l.horizontal}, layout: "${t}".`)}const n=e.computed(()=>{const t=l.main?"main-content":"section-content",p=[l.horizontal?"fz-container--horizontal":"fz-container--vertical",`gap-${t}-${l.gap}`,`align-items-${a.value}`];if(l.horizontal){const u=("layout"in l?l.layout:void 0)||"default";p.push(`layout-${u}`)}return p});return(t,r)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.tag),{class:e.normalizeClass(["fz-container",n.value])},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-8c40daeb"]]);new DOMRect(0,0,window.innerWidth,window.innerHeight);function k(o){const l=window.matchMedia(o),a=e.ref(l.matches);function n(t){a.value=t.matches}return e.onMounted(()=>{l.addEventListener("change",n)}),e.onUnmounted(()=>{l.removeEventListener("change",n)}),e.computed(()=>a.value)}const m={global:{blue:{50:{value:"#eff1ff",type:"color"},100:{value:"#dee2ff",type:"color"},200:{value:"#bdc5ff",type:"color"},300:{value:"#9ca8ff",type:"color"},400:{value:"#7b8bff",type:"color"},500:{value:"#5a6eff",type:"color"},600:{value:"#4858cc",type:"color"},700:{value:"#364299",type:"color"},800:{value:"#242c66",type:"color"},900:{value:"#1b214c",type:"color"}},purple:{50:{value:"#f8f4ff",type:"color"},100:{value:"#f0e9ff",type:"color"},200:{value:"#e1d3ff",type:"color"},300:{value:"#d2bdff",type:"color"},400:{value:"#c3a7ff",type:"color"},500:{value:"#b491ff",type:"color"},600:{value:"#9074cc",type:"color"},700:{value:"#6c5799",type:"color"},800:{value:"#483a66",type:"color"},900:{value:"#241d33",type:"color"}},orange:{50:{value:"#fff2ef",type:"color"},100:{value:"#ffe4de",type:"color"},200:{value:"#ffc9bd",type:"color"},300:{value:"#ffae9c",type:"color"},400:{value:"#ff937b",type:"color"},500:{value:"#ff785a",type:"color"},600:{value:"#cc6048",type:"color"},700:{value:"#994836",type:"color"},800:{value:"#663024",type:"color"},900:{value:"#331812",type:"color"}},pink:{50:{value:"#fff5f5",type:"color"},100:{value:"#ffe0e0",type:"color"},200:{value:"#ffcbcb",type:"color"},300:{value:"#ffc0c0",type:"color"},400:{value:"#ffabab",type:"color"},500:{value:"#ff9696",type:"color"},600:{value:"#cc7878",type:"color"},700:{value:"#995a5a",type:"color"},800:{value:"#663c3c",type:"color"},900:{value:"#331e1e",type:"color"}},yellow:{50:{value:"#fffbf4",type:"color"},100:{value:"#fff3de",type:"color"},200:{value:"#ffebc8",type:"color"},300:{value:"#ffe7bd",type:"color"},400:{value:"#ffdfa7",type:"color"},500:{value:"#ffd791",type:"color"},600:{value:"#ccac74",type:"color"},700:{value:"#998157",type:"color"},800:{value:"#806c49",type:"color"},900:{value:"#4c402b",type:"color"}},semantic:{error:{50:{value:"#fef3f3",type:"color"},100:{value:"#f8baba",type:"color"},200:{value:"#f04242",type:"color"},300:{value:"#aa2f2f",type:"color"}},warning:{50:{value:"#fff8f3",type:"color"},100:{value:"#ffdabd",type:"color"},200:{value:"#ffae4f",type:"color"},300:{value:"#b47b38",type:"color"}},success:{50:{value:"#f2f8f6",type:"color"},100:{value:"#b5d8ce",type:"color"},200:{value:"#0fa88c",type:"color"},300:{value:"#0b7763",type:"color"}},info:{50:{value:"#f3f7ff",type:"color"},100:{value:"#b4c8e1",type:"color"},200:{value:"#4e9fff",type:"color"},300:{value:"#3770b4",type:"color"}}},background:{"white-smoke":{value:"#f7f6f3",type:"color"},seashell:{value:"#f8ece7",type:"color"},"pale-purple":{value:"#f2e6ff",type:"color"},"alice-blue":{value:"#ecf2fc",type:"color"}},grey:{100:{value:"#e9edf0",type:"color"},200:{value:"#d1dde6",type:"color"},300:{value:"#9da9b2",type:"color"},400:{value:"#6e777e",type:"color"},500:{value:"#596167",type:"color"}},core:{white:{value:"#ffffff",type:"color"},black:{value:"#2c282f",type:"color"}},"font-sans":{"sharp-grotesk":{value:'"Sharp Grotesk", sans-serif',type:"fontFamilies"},inter:{value:'"Inter", sans-serif',type:"fontFamilies"}},font:{light:{value:"300",type:"fontWeights"},normal:{value:"400",type:"fontWeights"},medium:{value:"500",type:"fontWeights"}},spacing:{0:{value:"0px",type:"spacing"},1:{value:"1px",type:"spacing"},2:{value:"2px",type:"spacing"},4:{value:"4px",type:"spacing"},6:{value:"6px",type:"spacing"},8:{value:"8px",type:"spacing"},10:{value:"10px",type:"spacing"},12:{value:"12px",type:"spacing"},14:{value:"14px",type:"spacing"},16:{value:"16px",type:"spacing"},20:{value:"20px",type:"spacing"},24:{value:"24px",type:"spacing"},28:{value:"28px",type:"spacing"},32:{value:"32px",type:"spacing"},36:{value:"36px",type:"spacing"},40:{value:"40px",type:"spacing"},44:{value:"44px",type:"spacing"},48:{value:"48px",type:"spacing"},56:{value:"56px",type:"spacing"},64:{value:"64px",type:"spacing"},80:{value:"80px",type:"spacing"},96:{value:"96px",type:"spacing"},112:{value:"112px",type:"spacing"},128:{value:"128px",type:"spacing"},144:{value:"144px",type:"spacing"},160:{value:"160px",type:"spacing"},176:{value:"176px",type:"spacing"},192:{value:"192px",type:"spacing"},208:{value:"208px",type:"spacing"},224:{value:"224px",type:"spacing"},240:{value:"240px",type:"spacing"},256:{value:"256px",type:"spacing"},288:{value:"288px",type:"spacing"},320:{value:"320px",type:"spacing"},384:{value:"384px",type:"spacing"}},border:{0:{value:"0px",type:"borderWidth"},1:{value:"1px",type:"borderWidth"},2:{value:"2px",type:"borderWidth"},4:{value:"4px",type:"borderWidth"},8:{value:"8px",type:"borderWidth"}},rounded:{none:{value:"0px",type:"borderRadius"},sm:{value:"2px",type:"borderRadius"},base:{value:"4px",type:"borderRadius"},md:{value:"6px",type:"borderRadius"},lg:{value:"8px",type:"borderRadius"},xl:{value:"12px",type:"borderRadius"},"2xl":{value:"16px",type:"borderRadius"},"3xl":{value:"24px",type:"borderRadius"},full:{value:"9999px",type:"borderRadius"}},breakpoint:{xs:{value:"376px",type:"sizing"},sm:{value:"640px",type:"sizing"},md:{value:"768px",type:"sizing"},lg:{value:"1024px",type:"sizing"},xl:{value:"1280px",type:"sizing"},"2xl":{value:"1440px",type:"sizing"},"3xl":{value:"1536px",type:"sizing"}},shadow:{none:{value:{color:"#000000",type:"dropShadow",x:"0",y:"0",blur:"0",spread:"0"},type:"boxShadow"},sm:{value:{color:"#0000000d",type:"dropShadow",x:"0",y:"1",blur:"2",spread:"0"},type:"boxShadow"},base:{value:[{color:"#0000000f",type:"dropShadow",x:"0",y:"1",blur:"2",spread:"0"},{color:"#0000001a",type:"dropShadow",x:"0",y:"1",blur:"3",spread:"0"}],type:"boxShadow"},md:{value:[{color:"#0000000f",type:"dropShadow",x:"0",y:"2",blur:"4",spread:"-1"},{color:"#0000001a",type:"dropShadow",x:"0",y:"4",blur:"6",spread:"-1"}],type:"boxShadow"},lg:{value:[{color:"#0000000d",type:"dropShadow",x:"0",y:"4",blur:"6",spread:"-2"},{color:"#0000001a",type:"dropShadow",x:"0",y:"10",blur:"15",spread:"-3"}],type:"boxShadow"},xl:{value:[{color:"#0000000a",type:"dropShadow",x:"0",y:"10",blur:"10",spread:"-5"},{color:"#0000001a",type:"dropShadow",x:"0",y:"20",blur:"25",spread:"-5"}],type:"boxShadow"},"2xl":{value:{color:"#00000040",type:"dropShadow",x:"0",y:"25",blur:"50",spread:"-12"},type:"boxShadow"},inner:{value:{color:"#0000000f",type:"innerShadow",x:"0",y:"2",blur:"4",spread:"0"},type:"boxShadow"}},underline:{value:"underline",type:"textDecoration"},text:{xs:{value:"12px",type:"fontSizes"},sm:{value:"14px",type:"fontSizes"},base:{value:"16px",type:"fontSizes"},lg:{value:"18px",type:"fontSizes"},xl:{value:"20px",type:"fontSizes"},"2xl":{value:"24px",type:"fontSizes"},"3xl":{value:"30px",type:"fontSizes"},"4xl":{value:"36px",type:"fontSizes"},"5xl":{value:"48px",type:"fontSizes"},"6xl":{value:"60px",type:"fontSizes"},"7xl":{value:"72px",type:"fontSizes"},"8xl":{value:"96px",type:"fontSizes"},"9xl":{value:"128px",type:"fontSizes"}},leading:{xs:{value:"16px",type:"lineHeights"},sm:{value:"18px",type:"lineHeights"},base:{value:"20px",type:"lineHeights"},lg:{value:"24px",type:"lineHeights"},xl:{value:"28px",type:"lineHeights"},"2xl":{value:"32px",type:"lineHeights"},"3xl":{value:"36px",type:"lineHeights"},"4xl":{value:"40px",type:"lineHeights"},"5xl":{value:"48px",type:"lineHeights"},"6xl":{value:"60px",type:"lineHeights"},"7xl":{value:"72px",type:"lineHeights"},"8xl":{value:"96px",type:"lineHeights"},"9xl":{value:"128px",type:"lineHeights"}}}},C={safeColorNames:["blue","purple","orange","pink","yellow","grey","core"]},z={semanticColorNames:["error","warning","success","info"]},S=C.safeColorNames,B=z.semanticColorNames,s={};S.forEach(o=>{const l=m.global[o];l&&Object.keys(l).forEach(a=>{var t;const n=(t=l[a])==null?void 0:t.value;n&&(s[o]||(s[o]={}),s[o][a]=n)})});const x=m.global.semantic;x&&B.forEach(o=>{const l=x[o];l&&typeof l=="object"&&Object.keys(l).forEach(a=>{var t;const n=(t=l[a])==null?void 0:t.value;if(n){const r=`semantic-${o}`;s[r]||(s[r]={}),s[r][a]=n}})});const A=Object.entries(m.global.breakpoint).reduce((o,[l,a])=>(o[l]=a.value,o),{}),N=["title"],E={class:"flex flex-row gap-8 items-start"},$="border-1 border-solid rounded flex flex-col",F="border-solid pt-16 px-16 flex flex-row justify-between",V="border-solid pt-0 px-16 pb-16 flex gap-12 items-center",O=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(o,{expose:l,emit:a}){const n=k(`(max-width: ${A.sm})`),t=o,r=a,p=e.useSlots(),u=e.ref(t.defaultExpanded??!1);e.watch(()=>t.color==="aliceblue",y=>{y&&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 b=e.computed(()=>t.color==="aliceblue"?"blue":t.color),f=e.computed(()=>u.value||!t.collapsible),g=e.computed(()=>t.alwaysAlive||f.value),H=e.computed(()=>t.title||p.header||p["header-content"]),I=e.computed(()=>[t.collapsible?"cursor-pointer":""]),R=e.computed(()=>t.environment==="backoffice"?"py-2":"py-8"),j=e.computed(()=>{switch(b.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";case"yellow":return"bg-semantic-warning-50";case"red":return"bg-semantic-error-50";default:return"bg-core-white"}}),M=e.computed(()=>"text-core-black"),W=e.computed(()=>{switch(b.value){case"blue":return"border-background-alice-blue";case"orange":return"border-background-seashell";case"purple":return"border-background-pale-purple";case"grey":return"border-background-white-smoke";case"yellow":return"border-semantic-warning-50";case"red":return"border-semantic-error-50";default:return"border-grey-100"}}),D=e.computed(()=>t.primaryAction!==void 0||t.secondaryAction!==void 0||t.tertiaryAction!==void 0);function h(){t.collapsible&&(u.value=!u.value)}return e.onMounted(()=>{t.tertiaryAction&&!t.secondaryAction&&!t.primaryAction?console.warn("[Fiscozen Design System]: You should set primaryAction and secondaryAction if you want to set tertiaryAction"):t.secondaryAction&&!t.primaryAction&&console.warn("[Fiscozen Design System]: You should set primaryAction if you want to set secondaryAction")}),l({toggleOpen:h}),(y,i)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass([$,j.value,M.value,W.value,{"pb-16":!f.value}])},[H.value?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([I.value]),onClick:h},[e.createElementVNode("div",{class:e.normalizeClass(F)},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-row gap-12 items-start",R.value])},[o.title?(e.openBlock(),e.createElementBlock("h2",{key:0,class:"text-core-black font-medium text-xl m-0 p-0 break-words overflow-wrap-anywhere min-w-0 flex-shrink",title:o.title},e.toDisplayString(o.title),9,N)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")],2),e.createElementVNode("div",E,[o.hasInfoIcon?(e.openBlock(),e.createBlock(e.unref(d.FzIconButton),{key:0,iconName:"circle-question",variant:"invisible",environment:o.environment,onClick:i[0]||(i[0]=e.withModifiers(v=>r("fzcard:click-info"),["stop"]))},null,8,["environment"])):e.createCommentVNode("",!0),o.collapsible?(e.openBlock(),e.createBlock(e.unref(d.FzIconButton),{key:1,iconName:u.value?"chevron-up":"chevron-down",variant:"invisible",environment:o.environment},null,8,["iconName","environment"])):e.createCommentVNode("",!0)])]),e.renderSlot(y.$slots,"header-content")],2)):e.createCommentVNode("",!0),g.value?e.withDirectives((e.openBlock(),e.createElementBlock("article",{key:1,class:e.normalizeClass(["p-16",o.contentClass])},[e.renderSlot(y.$slots,"default")],2)),[[e.vShow,f.value]]):e.createCommentVNode("",!0),(p.footer||D.value)&&g.value?e.withDirectives((e.openBlock(),e.createElementBlock("footer",{key:2,class:e.normalizeClass([V,{"justify-end":!e.unref(n)}])},[e.renderSlot(y.$slots,"footer",{},()=>[e.createVNode(e.unref(w),{horizontal:"",gap:"sm",class:e.normalizeClass({"w-full":e.unref(n)})},{default:e.withCtx(()=>[o.tertiaryAction?(e.openBlock(),e.createBlock(e.unref(d.FzIconButton),{key:0,onClick:i[1]||(i[1]=v=>r("fztertiary:click")),iconName:o.tertiaryAction.icon,variant:"invisible",environment:o.environment,disabled:o.tertiaryAction.disabled},null,8,["iconName","environment","disabled"])):e.createCommentVNode("",!0),o.secondaryAction?(e.openBlock(),e.createBlock(e.unref(d.FzButton),{key:1,class:e.normalizeClass({"flex-grow":e.unref(n)}),onClick:i[2]||(i[2]=v=>r("fzsecondary:click")),label:o.secondaryAction.label,variant:"secondary",environment:o.environment,disabled:o.secondaryAction.disabled},null,8,["class","label","environment","disabled"])):e.createCommentVNode("",!0),o.primaryAction?(e.openBlock(),e.createBlock(e.unref(d.FzButton),{key:2,class:e.normalizeClass({"flex-grow":e.unref(n)}),onClick:i[3]||(i[3]=v=>r("fzprimary:click")),label:o.primaryAction.label,variant:"primary",environment:o.environment,disabled:o.primaryAction.disabled},null,8,["class","label","environment","disabled"])):e.createCommentVNode("",!0)]),_:1},8,["class"])])],2)),[[e.vShow,f.value]]):e.createCommentVNode("",!0)],2))}});c.FzCard=O,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1 @@
1
+ export * from './src/index'
@@ -0,0 +1,48 @@
1
+ import { FzCardProps, FzCardSlots } from './types';
2
+
3
+ declare function toggleOpen(): void;
4
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FzCardProps>, {
5
+ environment: string;
6
+ }>>, {
7
+ /**
8
+ * Method to toggle the card open/closed state
9
+ */
10
+ toggleOpen: typeof toggleOpen;
11
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ "fzprimary:click": () => void;
13
+ "fzsecondary:click": () => void;
14
+ "fztertiary:click": () => void;
15
+ "fzcard:click-info": () => void;
16
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FzCardProps>, {
17
+ environment: string;
18
+ }>>> & Readonly<{
19
+ "onFzprimary:click"?: (() => any) | undefined;
20
+ "onFzsecondary:click"?: (() => any) | undefined;
21
+ "onFztertiary:click"?: (() => any) | undefined;
22
+ "onFzcard:click-info"?: (() => any) | undefined;
23
+ }>, {
24
+ environment: import('./types').FzCardEnvironment;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, Readonly<FzCardSlots> & FzCardSlots>;
26
+ export default _default;
27
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
28
+ type __VLS_TypePropsToRuntimeProps<T> = {
29
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
30
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
31
+ } : {
32
+ type: import('vue').PropType<T[K]>;
33
+ required: true;
34
+ };
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
+ } & {};
44
+ type __VLS_WithTemplateSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,2 @@
1
+ export { default as FzCard } from './FzCard.vue';
2
+ export * from './types';
@@ -0,0 +1,121 @@
1
+ export type FzCardProps = {
2
+ /**
3
+ * The title of the card
4
+ */
5
+ title?: string;
6
+ /**
7
+ * The background color of the card
8
+ */
9
+ color?: FzCardColor;
10
+ /**
11
+ * The primary action button
12
+ */
13
+ primaryAction?: FzCardButton;
14
+ /**
15
+ * The secondary action button
16
+ */
17
+ secondaryAction?: FzCardButton;
18
+ /**
19
+ * The tertiary action button
20
+ */
21
+ tertiaryAction?: FzCardIconButton;
22
+ /**
23
+ * Custom css class to apply to the content
24
+ */
25
+ contentClass?: string;
26
+ /**
27
+ * Whether the card is collapsible
28
+ */
29
+ collapsible?: boolean;
30
+ /**
31
+ * Whether the card is expanded by default (only if collapsible)
32
+ */
33
+ defaultExpanded?: boolean;
34
+ /**
35
+ * Whether the card content is always alive (never destroyed) when collapsed
36
+ */
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;
48
+ };
49
+ type FzCardButton = {
50
+ label: string;
51
+ disabled?: boolean;
52
+ };
53
+ type FzCardIconButton = {
54
+ icon: string;
55
+ disabled?: boolean;
56
+ };
57
+ /**
58
+ * Card background color variants.
59
+ *
60
+ * @remarks
61
+ * - 'default' renders a white background
62
+ * - 'blue' renders an alice-blue background
63
+ * - 'orange' renders a seashell background
64
+ * - 'purple' renders a pale-purple background
65
+ * - 'grey' renders a white-smoke background
66
+ * - 'yellow' uses --semantic-warning-50 (warning tint)
67
+ * - 'red' uses --semantic-error-50 (error tint)
68
+ *
69
+ * @deprecated 'aliceblue' is deprecated and will be removed in a future version. Use 'blue' instead.
70
+ */
71
+ export type FzCardColor = "default" | "blue" | "orange" | "purple" | "grey" | "yellow" | "red" | "aliceblue";
72
+ /**
73
+ * Card environment context for buttons
74
+ *
75
+ * @remarks
76
+ * Determines the visual style context for all buttons within the card
77
+ * - 'backoffice' for internal/admin interfaces
78
+ * - 'frontoffice' for public-facing interfaces
79
+ */
80
+ export type FzCardEnvironment = "backoffice" | "frontoffice";
81
+ export interface FzCardEvents {
82
+ /**
83
+ * Event emitted when the primary action is clicked
84
+ * @type {() => void}
85
+ */
86
+ (event: "fzprimary:click"): void;
87
+ /**
88
+ * Event emitted when the secondary action is clicked
89
+ * @type {() => void}
90
+ */
91
+ (event: "fzsecondary:click"): void;
92
+ /**
93
+ * Event emitted when the tertiary action is clicked
94
+ * @type {() => void}
95
+ */
96
+ (event: "fztertiary:click"): void;
97
+ /**
98
+ * Event emitted when the info icon is clicked
99
+ * @type {() => void}
100
+ */
101
+ (event: "fzcard:click-info"): void;
102
+ }
103
+ export interface FzCardSlots {
104
+ /**
105
+ * Slot for the content of the card
106
+ */
107
+ default(props: {}): any;
108
+ /**
109
+ * Slot for the header, it will be displayed on the left of the title
110
+ */
111
+ header(props: {}): any;
112
+ /**
113
+ * Slot for the header content, it will be displayed below the title
114
+ */
115
+ "header-content"(props: {}): any;
116
+ /**
117
+ * Slot for the footer of the card
118
+ */
119
+ footer(props: {}): any;
120
+ }
121
+ export {};
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .fz-container[data-v-8c40daeb]{display:flex}.fz-container--vertical[data-v-8c40daeb]{flex-direction:column}.fz-container--horizontal[data-v-8c40daeb]{flex-direction:row;flex-wrap:nowrap}.fz-container.align-items-start[data-v-8c40daeb]{align-items:flex-start}.fz-container.align-items-center[data-v-8c40daeb]{align-items:center}.fz-container.align-items-end[data-v-8c40daeb]{align-items:flex-end}.fz-container.align-items-stretch[data-v-8c40daeb]{align-items:stretch}.fz-container.align-items-baseline[data-v-8c40daeb]{align-items:baseline}.fz-container--horizontal.layout-expand-first[data-v-8c40daeb]>*:first-child{flex-grow:1}.fz-container--horizontal.layout-expand-all[data-v-8c40daeb]>*{flex-grow:1}.fz-container--horizontal.layout-space-between[data-v-8c40daeb]{justify-content:space-between}.fz-container--horizontal.layout-expand-last[data-v-8c40daeb]>*:last-child{flex-grow:1}.fz-container--vertical.gap-main-content-sm[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--main-content-sm, 32px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-main-content-base[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--main-content-base, 48px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-main-content-lg[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--main-content-lg, 64px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-section-content-none[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--section-content-none, 0px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-section-content-xs[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--section-content-xs, 8px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-section-content-sm[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--section-content-sm, 16px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-section-content-base[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--section-content-base, 24px)) + var(--paragraph-gap, 8px))}.fz-container--vertical.gap-section-content-lg[data-v-8c40daeb]>p+p{margin-top:calc((0px - var(--section-content-lg, 32px)) + var(--paragraph-gap, 8px))}.fz-container--horizontal[data-v-8c40daeb]>p+p{margin-top:0}
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@fiscozen/card",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
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/button": "^1.0.1-next.1",
11
- "@fiscozen/style": "^0.1.8-next.0",
12
- "@fiscozen/icons": "^0.1.36",
13
- "@fiscozen/composables": "^1.0.0",
14
- "@fiscozen/container": "^0.3.1"
10
+ "@fiscozen/button": "1.0.2",
11
+ "@fiscozen/composables": "1.0.1",
12
+ "@fiscozen/container": "0.4.1",
13
+ "@fiscozen/style": "0.2.0"
15
14
  },
16
15
  "peerDependencies": {
17
16
  "tailwindcss": "^3.4.1",
18
- "vue": "^3.4.13"
17
+ "vue": "^3.4.13",
18
+ "@fiscozen/icons": "^0.1.37"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rushstack/eslint-patch": "^1.3.3",
package/src/FzCard.vue CHANGED
@@ -14,11 +14,11 @@
14
14
  * <FzCard title="Card Title" color="default">
15
15
  * <p>Card content goes here</p>
16
16
  * </FzCard>
17
- *
17
+ *
18
18
  * @example
19
- * <FzCard
20
- * title="Collapsible Card"
21
- * collapsible
19
+ * <FzCard
20
+ * title="Collapsible Card"
21
+ * collapsible
22
22
  * :primaryAction="{ label: 'Save' }"
23
23
  * >
24
24
  * <p>This card can be collapsed</p>
@@ -34,7 +34,7 @@ import { breakpoints } from "@fiscozen/style";
34
34
  const smOrSmaller = useMediaQuery(`(max-width: ${breakpoints.sm})`);
35
35
 
36
36
  const props = withDefaults(defineProps<FzCardProps>(), {
37
- environment: 'frontoffice'
37
+ environment: "frontoffice",
38
38
  });
39
39
  const emit = defineEmits<FzCardEvents>();
40
40
  const slots = defineSlots<FzCardSlots>();
@@ -42,7 +42,7 @@ const isOpen = ref(props.defaultExpanded ?? false);
42
42
 
43
43
  /**
44
44
  * Deprecation warning for 'aliceblue' color prop value.
45
- *
45
+ *
46
46
  * Watches for 'aliceblue' color usage and logs warning once on mount or when color changes.
47
47
  * Using watch with immediate:true ensures the warning only fires once per component instance.
48
48
  */
@@ -52,19 +52,19 @@ watch(
52
52
  if (isAliceblue) {
53
53
  console.warn(
54
54
  "[FzCard] The color prop value 'aliceblue' is deprecated and will be removed in a future version. " +
55
- "Please use 'blue' instead. The component will automatically map 'aliceblue' to 'blue' for now."
55
+ "Please use 'blue' instead. The component will automatically map 'aliceblue' to 'blue' for now.",
56
56
  );
57
57
  }
58
58
  },
59
- { immediate: true }
59
+ { immediate: true },
60
60
  );
61
61
 
62
62
  /**
63
63
  * Normalizes deprecated color values to their replacements.
64
- *
64
+ *
65
65
  * Maps deprecated colors to their replacements:
66
66
  * - 'aliceblue' → 'blue'
67
- *
67
+ *
68
68
  * This ensures backward compatibility while encouraging migration to new values.
69
69
  * Deprecation warnings are handled separately via watch hooks.
70
70
  */
@@ -72,12 +72,11 @@ const normalizedColor = computed(() => {
72
72
  if (props.color === "aliceblue") {
73
73
  return "blue";
74
74
  }
75
-
75
+
76
76
  return props.color;
77
77
  });
78
78
 
79
- const sectionStaticClass =
80
- "border-1 border-solid rounded flex flex-col";
79
+ const sectionStaticClass = "border-1 border-solid rounded flex flex-col";
81
80
  const headerStaticClass =
82
81
  "border-solid pt-16 px-16 flex flex-row justify-between";
83
82
  const footerStaticClass =
@@ -93,7 +92,7 @@ const headerContainerComputedClass = computed(() => [
93
92
  ]);
94
93
 
95
94
  const headerTitleClass = computed(() => {
96
- return props.environment === 'backoffice' ? 'py-2' : 'py-8';
95
+ return props.environment === "backoffice" ? "py-2" : "py-8";
97
96
  });
98
97
 
99
98
  const backgroundColor = computed(() => {
@@ -106,6 +105,10 @@ const backgroundColor = computed(() => {
106
105
  return "bg-background-pale-purple";
107
106
  case "grey":
108
107
  return "bg-background-white-smoke";
108
+ case "yellow":
109
+ return "bg-semantic-warning-50";
110
+ case "red":
111
+ return "bg-semantic-error-50";
109
112
  default:
110
113
  return "bg-core-white";
111
114
  }
@@ -128,6 +131,10 @@ const borderColor = computed(() => {
128
131
  return "border-background-pale-purple";
129
132
  case "grey":
130
133
  return "border-background-white-smoke";
134
+ case "yellow":
135
+ return "border-semantic-warning-50";
136
+ case "red":
137
+ return "border-semantic-error-50";
131
138
  default:
132
139
  return "border-grey-100";
133
140
  }
@@ -164,7 +171,15 @@ defineExpose({
164
171
  </script>
165
172
 
166
173
  <template>
167
- <section :class="[sectionStaticClass, backgroundColor, textColor, borderColor, {'pb-16': !showContent}]">
174
+ <section
175
+ :class="[
176
+ sectionStaticClass,
177
+ backgroundColor,
178
+ textColor,
179
+ borderColor,
180
+ { 'pb-16': !showContent },
181
+ ]"
182
+ >
168
183
  <header
169
184
  v-if="existHeader"
170
185
  :class="[headerContainerComputedClass]"
@@ -208,11 +223,11 @@ defineExpose({
208
223
  </article>
209
224
  <footer
210
225
  v-if="(slots.footer || atLeastOneButton) && isAlive"
211
- :class="[footerStaticClass, {'justify-end': !smOrSmaller}]"
226
+ :class="[footerStaticClass, { 'justify-end': !smOrSmaller }]"
212
227
  v-show="showContent"
213
228
  >
214
229
  <slot name="footer">
215
- <FzContainer horizontal gap="sm" :class="{'w-full': smOrSmaller}">
230
+ <FzContainer horizontal gap="sm" :class="{ 'w-full': smOrSmaller }">
216
231
  <FzIconButton
217
232
  v-if="tertiaryAction"
218
233
  @click="emit('fztertiary:click')"
@@ -223,7 +238,7 @@ defineExpose({
223
238
  />
224
239
  <FzButton
225
240
  v-if="secondaryAction"
226
- :class="{'flex-grow': smOrSmaller}"
241
+ :class="{ 'flex-grow': smOrSmaller }"
227
242
  @click="emit('fzsecondary:click')"
228
243
  :label="secondaryAction.label"
229
244
  variant="secondary"
@@ -232,7 +247,7 @@ defineExpose({
232
247
  />
233
248
  <FzButton
234
249
  v-if="primaryAction"
235
- :class="{'flex-grow': smOrSmaller}"
250
+ :class="{ 'flex-grow': smOrSmaller }"
236
251
  @click="emit('fzprimary:click')"
237
252
  :label="primaryAction.label"
238
253
  variant="primary"