@fiscozen/card 1.0.0-beta.2 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +8 -5
  2. 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.2",
3
+ "version": "1.0.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.0",
11
- "@fiscozen/icons": "^0.1.35"
10
+ "@fiscozen/icons": "^0.1.35",
11
+ "@fiscozen/button": "^1.0.1-next.0",
12
+ "@fiscozen/container": "^0.3.1",
13
+ "@fiscozen/style": "^0.1.7",
14
+ "@fiscozen/composables": "^0.1.37"
12
15
  },
13
16
  "peerDependencies": {
14
17
  "tailwindcss": "^3.4.1",
@@ -33,9 +36,9 @@
33
36
  "@awesome.me/kit-8137893ad3": "^1.0.65",
34
37
  "@fortawesome/fontawesome-svg-core": "^6.5.1",
35
38
  "@fortawesome/vue-fontawesome": "^3.0.6",
39
+ "@fiscozen/tsconfig": "^0.1.0",
36
40
  "@fiscozen/prettier-config": "^0.1.0",
37
- "@fiscozen/eslint-config": "^0.1.0",
38
- "@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 border-grey-100 rounded flex flex-col";
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 justify-end gap-12 items-center";
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-orange-200";
126
+ return "border-background-seashell";
122
127
  case "purple":
123
- return "border-purple-200";
128
+ return "border-background-pale-purple";
124
129
  case "grey":
125
- return "border-grey-200";
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
- <FzIconButton
223
- v-if="tertiaryAction"
224
- @click="emit('fztertiary:click')"
225
- :iconName="tertiaryAction.icon"
226
- variant="invisible"
227
- :environment="environment"
228
- />
229
- <FzButton
230
- v-if="secondaryAction"
231
- @click="emit('fzsecondary:click')"
232
- :label="secondaryAction.label"
233
- variant="secondary"
234
- :environment="environment"
235
- />
236
- <FzButton
237
- v-if="primaryAction"
238
- @click="emit('fzprimary:click')"
239
- :label="primaryAction.label"
240
- variant="primary"
241
- :environment="environment"
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>