@fiscozen/card 1.0.0-beta.2 → 1.0.0-beta.3
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/package.json +8 -5
- package/src/FzCard.vue +36 -39
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiscozen/card",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
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/container": "^0.3.1",
|
|
11
|
+
"@fiscozen/button": "^1.0.1-next.0",
|
|
12
|
+
"@fiscozen/composables": "^0.1.37",
|
|
13
|
+
"@fiscozen/icons": "^0.1.35",
|
|
14
|
+
"@fiscozen/style": "^0.1.7"
|
|
12
15
|
},
|
|
13
16
|
"peerDependencies": {
|
|
14
17
|
"tailwindcss": "^3.4.1",
|
|
@@ -34,8 +37,8 @@
|
|
|
34
37
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
35
38
|
"@fortawesome/vue-fontawesome": "^3.0.6",
|
|
36
39
|
"@fiscozen/prettier-config": "^0.1.0",
|
|
37
|
-
"@fiscozen/
|
|
38
|
-
"@fiscozen/
|
|
40
|
+
"@fiscozen/tsconfig": "^0.1.0",
|
|
41
|
+
"@fiscozen/eslint-config": "^0.1.0"
|
|
39
42
|
},
|
|
40
43
|
"license": "MIT",
|
|
41
44
|
"scripts": {
|
package/src/FzCard.vue
CHANGED
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
import { computed, onMounted, ref, watch } from "vue";
|
|
28
28
|
import { FzCardEvents, FzCardProps, FzCardSlots } from "./types";
|
|
29
29
|
import { FzButton, FzIconButton } from "@fiscozen/button";
|
|
30
|
+
import { FzContainer } from "@fiscozen/container";
|
|
31
|
+
import { useMediaQuery } from "@fiscozen/composables";
|
|
32
|
+
import { breakpoints } from "@fiscozen/style";
|
|
33
|
+
|
|
34
|
+
const smOrSmaller = useMediaQuery(`(max-width: ${breakpoints.sm})`);
|
|
30
35
|
|
|
31
36
|
const props = withDefaults(defineProps<FzCardProps>(), {
|
|
32
37
|
environment: 'frontoffice'
|
|
@@ -72,11 +77,11 @@ const normalizedColor = computed(() => {
|
|
|
72
77
|
});
|
|
73
78
|
|
|
74
79
|
const sectionStaticClass =
|
|
75
|
-
"border-1 border-solid
|
|
80
|
+
"border-1 border-solid rounded flex flex-col";
|
|
76
81
|
const headerStaticClass =
|
|
77
82
|
"border-solid pt-16 px-16 flex flex-row justify-between";
|
|
78
83
|
const footerStaticClass =
|
|
79
|
-
"border-solid pt-0 px-16 pb-16 flex
|
|
84
|
+
"border-solid pt-0 px-16 pb-16 flex gap-12 items-center";
|
|
80
85
|
|
|
81
86
|
const showContent = computed(() => isOpen.value || !props.collapsible);
|
|
82
87
|
const isAlive = computed(() => props.alwaysAlive || showContent.value);
|
|
@@ -118,28 +123,16 @@ const borderColor = computed(() => {
|
|
|
118
123
|
case "blue":
|
|
119
124
|
return "border-background-alice-blue";
|
|
120
125
|
case "orange":
|
|
121
|
-
return "border-
|
|
126
|
+
return "border-background-seashell";
|
|
122
127
|
case "purple":
|
|
123
|
-
return "border-purple
|
|
128
|
+
return "border-background-pale-purple";
|
|
124
129
|
case "grey":
|
|
125
|
-
return "border-
|
|
130
|
+
return "border-background-white-smoke";
|
|
126
131
|
default:
|
|
127
132
|
return "border-grey-100";
|
|
128
133
|
}
|
|
129
134
|
});
|
|
130
135
|
|
|
131
|
-
const borderWidth = computed(() => {
|
|
132
|
-
switch (normalizedColor.value) {
|
|
133
|
-
case "blue":
|
|
134
|
-
case "orange":
|
|
135
|
-
case "purple":
|
|
136
|
-
case "grey":
|
|
137
|
-
return "border-0";
|
|
138
|
-
default:
|
|
139
|
-
return "border-1";
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
136
|
const atLeastOneButton = computed(
|
|
144
137
|
() =>
|
|
145
138
|
props.primaryAction !== undefined ||
|
|
@@ -215,31 +208,35 @@ defineExpose({
|
|
|
215
208
|
</article>
|
|
216
209
|
<footer
|
|
217
210
|
v-if="(slots.footer || atLeastOneButton) && isAlive"
|
|
218
|
-
:class="[footerStaticClass]"
|
|
211
|
+
:class="[footerStaticClass, {'justify-end': !smOrSmaller}]"
|
|
219
212
|
v-show="showContent"
|
|
220
213
|
>
|
|
221
214
|
<slot name="footer">
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
215
|
+
<FzContainer horizontal gap="sm" :class="{'w-full': smOrSmaller}">
|
|
216
|
+
<FzIconButton
|
|
217
|
+
v-if="tertiaryAction"
|
|
218
|
+
@click="emit('fztertiary:click')"
|
|
219
|
+
:iconName="tertiaryAction.icon"
|
|
220
|
+
variant="invisible"
|
|
221
|
+
:environment="environment"
|
|
222
|
+
/>
|
|
223
|
+
<FzButton
|
|
224
|
+
v-if="secondaryAction"
|
|
225
|
+
:class="{'flex-grow': smOrSmaller}"
|
|
226
|
+
@click="emit('fzsecondary:click')"
|
|
227
|
+
:label="secondaryAction.label"
|
|
228
|
+
variant="secondary"
|
|
229
|
+
:environment="environment"
|
|
230
|
+
/>
|
|
231
|
+
<FzButton
|
|
232
|
+
v-if="primaryAction"
|
|
233
|
+
:class="{'flex-grow': smOrSmaller}"
|
|
234
|
+
@click="emit('fzprimary:click')"
|
|
235
|
+
:label="primaryAction.label"
|
|
236
|
+
variant="primary"
|
|
237
|
+
:environment="environment"
|
|
238
|
+
/>
|
|
239
|
+
</FzContainer>
|
|
243
240
|
</slot>
|
|
244
241
|
</footer>
|
|
245
242
|
</section>
|