@fiscozen/card 1.0.1 → 1.0.2
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/CHANGELOG.md +18 -0
- package/dist/card.js +1106 -0
- package/dist/card.umd.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/src/FzCard.vue.d.ts +48 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/types.d.ts +119 -0
- package/dist/style.css +1 -0
- package/package.json +7 -7
- package/src/__tests__/FzCard.spec.ts +890 -0
- package/src/__tests__/__snapshots__/FzCard.spec.ts.snap +126 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vitest.config.ts +9 -1
- package/src/__test__/FzCard.test.ts +0 -576
- package/src/__test__/__snapshots__/FzCard.test.ts.snap +0 -19
|
@@ -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 k=((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 w(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 v={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=v.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=v.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(v.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=w(`(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";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";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(m=>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(k),{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]=m=>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]=m=>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]=m=>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"})});
|
package/dist/index.d.ts
ADDED
|
@@ -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,119 @@
|
|
|
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
|
+
*
|
|
67
|
+
* @deprecated 'aliceblue' is deprecated and will be removed in a future version. Use 'blue' instead.
|
|
68
|
+
*/
|
|
69
|
+
export type FzCardColor = "default" | "blue" | "orange" | "purple" | "grey" | "aliceblue";
|
|
70
|
+
/**
|
|
71
|
+
* Card environment context for buttons
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* Determines the visual style context for all buttons within the card
|
|
75
|
+
* - 'backoffice' for internal/admin interfaces
|
|
76
|
+
* - 'frontoffice' for public-facing interfaces
|
|
77
|
+
*/
|
|
78
|
+
export type FzCardEnvironment = "backoffice" | "frontoffice";
|
|
79
|
+
export interface FzCardEvents {
|
|
80
|
+
/**
|
|
81
|
+
* Event emitted when the primary action is clicked
|
|
82
|
+
* @type {() => void}
|
|
83
|
+
*/
|
|
84
|
+
(event: "fzprimary:click"): void;
|
|
85
|
+
/**
|
|
86
|
+
* Event emitted when the secondary action is clicked
|
|
87
|
+
* @type {() => void}
|
|
88
|
+
*/
|
|
89
|
+
(event: "fzsecondary:click"): void;
|
|
90
|
+
/**
|
|
91
|
+
* Event emitted when the tertiary action is clicked
|
|
92
|
+
* @type {() => void}
|
|
93
|
+
*/
|
|
94
|
+
(event: "fztertiary:click"): void;
|
|
95
|
+
/**
|
|
96
|
+
* Event emitted when the info icon is clicked
|
|
97
|
+
* @type {() => void}
|
|
98
|
+
*/
|
|
99
|
+
(event: "fzcard:click-info"): void;
|
|
100
|
+
}
|
|
101
|
+
export interface FzCardSlots {
|
|
102
|
+
/**
|
|
103
|
+
* Slot for the content of the card
|
|
104
|
+
*/
|
|
105
|
+
default(props: {}): any;
|
|
106
|
+
/**
|
|
107
|
+
* Slot for the header, it will be displayed on the left of the title
|
|
108
|
+
*/
|
|
109
|
+
header(props: {}): any;
|
|
110
|
+
/**
|
|
111
|
+
* Slot for the header content, it will be displayed below the title
|
|
112
|
+
*/
|
|
113
|
+
"header-content"(props: {}): any;
|
|
114
|
+
/**
|
|
115
|
+
* Slot for the footer of the card
|
|
116
|
+
*/
|
|
117
|
+
footer(props: {}): any;
|
|
118
|
+
}
|
|
119
|
+
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,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiscozen/card",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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/
|
|
12
|
-
"@fiscozen/
|
|
13
|
-
"@fiscozen/
|
|
14
|
-
"@fiscozen/
|
|
10
|
+
"@fiscozen/container": "0.4.1",
|
|
11
|
+
"@fiscozen/button": "1.0.1",
|
|
12
|
+
"@fiscozen/composables": "1.0.1",
|
|
13
|
+
"@fiscozen/icons": "0.1.36",
|
|
14
|
+
"@fiscozen/style": "0.2.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"tailwindcss": "^3.4.1",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"vite-plugin-dts": "^3.8.3",
|
|
34
34
|
"vitest": "^1.2.0",
|
|
35
35
|
"vue-tsc": "^1.8.25",
|
|
36
|
-
"@fiscozen/eslint-config": "^0.1.0",
|
|
37
36
|
"@fiscozen/tsconfig": "^0.1.0",
|
|
37
|
+
"@fiscozen/eslint-config": "^0.1.0",
|
|
38
38
|
"@fiscozen/prettier-config": "^0.1.0"
|
|
39
39
|
},
|
|
40
40
|
"license": "MIT",
|