@dative-gpi/foundation-shared-components 1.0.151 → 1.0.153

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.
@@ -6,32 +6,47 @@
6
6
  :disabled="false"
7
7
  :elevation="0"
8
8
  :style="style"
9
+ :hideActions="$props.actionPosition === 'start'"
9
10
  v-bind="$attrs"
10
11
  >
11
- <template
12
- #title
13
- >
14
- <slot
15
- name="title"
12
+ <v-expansion-panel-title>
13
+ <template
14
+ v-slot:default="{ expanded, collapseIcon, expandIcon }"
16
15
  >
17
- <FSRow>
18
- <FSIcon
19
- v-if="$props.prependIcon"
16
+ <FSRow
17
+ gap="4px"
18
+ >
19
+ <FSCol
20
+ v-if="$props.actionPosition === 'start'"
21
+ width="hug"
22
+ align="center-center"
20
23
  >
21
- {{ $props.prependIcon }}
22
- </FSIcon>
23
- <FSSpan
24
- class="fs-accordion-panel-title"
25
- :lineClamp="$props.lineClampTitle"
24
+ <FSIcon
25
+ size="22.5px"
26
+ :icon="expanded ? collapseIcon : expandIcon"
27
+ />
28
+ </FSCol>
29
+ <slot
30
+ name="title"
26
31
  >
27
- {{ $props.title }}
28
- </FSSpan>
32
+ <FSRow>
33
+ <FSIcon
34
+ v-if="$props.prependIcon"
35
+ >
36
+ {{ $props.prependIcon }}
37
+ </FSIcon>
38
+ <FSSpan
39
+ class="fs-accordion-panel-title"
40
+ :lineClamp="$props.lineClampTitle"
41
+ >
42
+ {{ $props.title }}
43
+ </FSSpan>
44
+ </FSRow>
45
+ </slot>
29
46
  </FSRow>
30
- </slot>
31
- </template>
32
- <template
33
- #text
34
- >
47
+ </template>
48
+ </v-expansion-panel-title>
49
+ <v-expansion-panel-text>
35
50
  <slot
36
51
  name="content"
37
52
  >
@@ -47,7 +62,7 @@
47
62
  :modelValue="$props.content"
48
63
  />
49
64
  </slot>
50
- </template>
65
+ </v-expansion-panel-text>
51
66
  </v-expansion-panel>
52
67
  </template>
53
68
 
@@ -128,6 +143,10 @@ export default defineComponent({
128
143
  type: String as PropType<"standard" | "rich-text">,
129
144
  required: false,
130
145
  default: "standard"
146
+ },
147
+ actionPosition: {
148
+ type: String as () => "start" | "end",
149
+ default: "end"
131
150
  }
132
151
  },
133
152
  setup(props) {
@@ -68,6 +68,11 @@ export default defineComponent({
68
68
  required: false,
69
69
  default: null
70
70
  },
71
+ maxWidth: {
72
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
73
+ required: false,
74
+ default: null
75
+ },
71
76
  padding: {
72
77
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
73
78
  required: false,
@@ -103,6 +108,11 @@ export default defineComponent({
103
108
  required: false,
104
109
  default: "solid"
105
110
  },
111
+ borderColor: {
112
+ type: [Array, String] as PropType<ColorBase | null | string>,
113
+ required: false,
114
+ default: null
115
+ },
106
116
  elevation: {
107
117
  type: Boolean,
108
118
  required: false,
@@ -129,6 +139,10 @@ export default defineComponent({
129
139
  const darks = getColors(ColorEnum.Dark);
130
140
 
131
141
  const borderColor = computed((): ColorBase => {
142
+ if (props.borderColor) {
143
+ return getColors(props.borderColor).base;
144
+ }
145
+
132
146
  switch (props.variant) {
133
147
  case "background":
134
148
  return lights.dark;
@@ -154,6 +168,7 @@ export default defineComponent({
154
168
  "--fs-card-padding" : sizeToVar(props.padding),
155
169
  "--fs-card-height" : sizeToVar(props.height),
156
170
  "--fs-card-width" : sizeToVar(props.width),
171
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
157
172
  "--fs-card-background-color": backgrounds.base,
158
173
  "--fs-card-border-color" : borderColor.value,
159
174
  "--fs-card-color" : darks.base,
@@ -166,6 +181,7 @@ export default defineComponent({
166
181
  "--fs-card-padding" : sizeToVar(props.padding),
167
182
  "--fs-card-height" : sizeToVar(props.height),
168
183
  "--fs-card-width" : sizeToVar(props.width),
184
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
169
185
  "--fs-card-background-color": colors.value.light,
170
186
  "--fs-card-border-color" : borderColor.value,
171
187
  "--fs-card-color" : colors.value.lightContrast!,
@@ -178,6 +194,7 @@ export default defineComponent({
178
194
  "--fs-card-padding" : sizeToVar(props.padding),
179
195
  "--fs-card-height" : sizeToVar(props.height),
180
196
  "--fs-card-width" : sizeToVar(props.width),
197
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
181
198
  "--fs-card-background-color": colors.value.base,
182
199
  "--fs-card-border-color" : borderColor.value,
183
200
  "--fs-card-color" : colors.value.baseContrast!,
@@ -190,6 +207,7 @@ export default defineComponent({
190
207
  "--fs-card-padding" : sizeToVar(props.padding),
191
208
  "--fs-card-height" : sizeToVar(props.height),
192
209
  "--fs-card-width" : sizeToVar(props.width),
210
+ "--fs-card-max-width" : sizeToVar(props.maxWidth, "unset"),
193
211
  "--fs-card-background-color": gradients.value.base,
194
212
  "--fs-card-border-color" : borderColor.value,
195
213
  "--fs-card-color" : colors.value.lightContrast!,
@@ -13,7 +13,7 @@
13
13
  import { computed, defineComponent, type PropType, type StyleValue } from "vue";
14
14
 
15
15
  import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
16
- import { type ColorBase } from "@dative-gpi/foundation-shared-components/models";
16
+ import { type ColorBase, type ColorBaseVariations } from "@dative-gpi/foundation-shared-components/models";
17
17
 
18
18
  import { sizeToVar } from "../utils";
19
19
 
@@ -31,7 +31,7 @@ export default defineComponent({
31
31
  default: null
32
32
  },
33
33
  variant: {
34
- type: String as PropType<"base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
34
+ type: String as PropType<ColorBaseVariations>,
35
35
  required: false,
36
36
  default: "base"
37
37
  }
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <FSCard
3
3
  :variant="$props.backgroundVariant"
4
+ :borderColor="$props.backgroundVariant === 'background' ? ColorEnum.Light : null"
4
5
  :color="$props.backgroundColor"
5
6
  :border="$props.border"
6
7
  :height="$props.size"
@@ -10,8 +11,8 @@
10
11
  align="center-center"
11
12
  >
12
13
  <FSIcon
13
- :variant="$props.iconVariant"
14
- :color="contrastedIconColor"
14
+ :variant="iconVariant"
15
+ :color="iconColor"
15
16
  :size="actualIconSize"
16
17
  >
17
18
  {{ $props.icon }}
@@ -23,10 +24,9 @@
23
24
  <script lang="ts">
24
25
  import { defineComponent, type PropType, computed } from "vue";
25
26
 
26
- import { ColorEnum, type ColorBase } from "@dative-gpi/foundation-shared-components/models";
27
+ import { ColorEnum, type ColorBase, type ColorBaseVariations } from "@dative-gpi/foundation-shared-components/models";
27
28
 
28
29
  import { sizeToVar } from "../utils";
29
- import { useColors } from "../composables";
30
30
 
31
31
  import FSCard from "./FSCard.vue";
32
32
  import FSIcon from "./FSIcon.vue";
@@ -46,7 +46,7 @@ export default defineComponent({
46
46
  backgroundColor: {
47
47
  type: [Array, String] as PropType<ColorBase | ColorBase[]>,
48
48
  required: false,
49
- default: null
49
+ default: ColorEnum.Background
50
50
  },
51
51
  backgroundVariant: {
52
52
  type: String as PropType<"background" | "standard" | "full" | "gradient">,
@@ -60,13 +60,12 @@ export default defineComponent({
60
60
  },
61
61
  iconColor: {
62
62
  type: String as PropType<ColorBase>,
63
- required: false,
64
- default: ColorEnum.Light
63
+ required: false
65
64
  },
66
65
  iconVariant: {
67
- type: String as PropType<"base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
66
+ type: String as PropType<ColorBaseVariations | null>,
68
67
  required: false,
69
- default: "base"
68
+ default: null
70
69
  },
71
70
  iconSize: {
72
71
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
@@ -80,14 +79,6 @@ export default defineComponent({
80
79
  }
81
80
  },
82
81
  setup(props){
83
- const { getColors } = useColors();
84
-
85
- const colors = computed(() => {
86
- return Array.isArray(props.backgroundColor)
87
- ? getColors(props.backgroundColor[Math.floor(props.backgroundColor.length/2)])
88
- : getColors(props.backgroundColor)
89
- });
90
-
91
82
  const actualIconSize = computed(() => {
92
83
  if (props.iconSize){
93
84
  return props.iconSize;
@@ -98,22 +89,47 @@ export default defineComponent({
98
89
  return "42px";
99
90
  });
100
91
 
101
- const contrastedIconColor = computed(() => {
92
+ const iconVariant = computed((): ColorBaseVariations | undefined => {
93
+ if (props.iconVariant) {
94
+ return props.iconVariant;
95
+ }
96
+ if (props.iconColor) {
97
+ return "base";
98
+ }
99
+
102
100
  switch (props.backgroundVariant) {
101
+ case "background":
102
+ return "lightContrast";
103
103
  case "standard":
104
- switch (props.iconColor) {
105
- case ColorEnum.Dark :
106
- case ColorEnum.Light:
107
- default: return colors.value.lightContrast!
108
- };
109
- case "background": return colors.value.base
110
- default: return colors.value.baseContrast!
104
+ return "lightContrast";
105
+ case "full":
106
+ return "baseContrast";
107
+ case "gradient":
108
+ return "baseContrast";
109
+ default:
110
+ return "base";
111
+ }
112
+ });
113
+
114
+ const iconColor = computed((): ColorBase | undefined => {
115
+ if (props.iconColor) {
116
+ return props.iconColor;
117
+ }
118
+
119
+ if(Array.isArray(props.backgroundColor)) {
120
+ return props.backgroundColor[Math.floor(props.backgroundColor.length/2)];
121
+ }
122
+ if(props.backgroundVariant === "background") {
123
+ return ColorEnum.Light;
111
124
  }
125
+ return props.backgroundColor;
112
126
  });
113
127
 
114
128
  return {
115
- contrastedIconColor,
116
- actualIconSize
129
+ actualIconSize,
130
+ iconVariant,
131
+ ColorEnum,
132
+ iconColor,
117
133
  };
118
134
  }
119
135
  });
@@ -15,7 +15,7 @@
15
15
  >
16
16
  <FSButton
17
17
  v-bind="props"
18
- :color="lightColors.dark"
18
+ :color="$props.iconColor"
19
19
  :iconSize="$props.iconSize"
20
20
  variant="icon"
21
21
  icon="mdi-information-outline"
@@ -26,6 +26,7 @@
26
26
  name="menuContent"
27
27
  >
28
28
  <FSCard
29
+ :maxWidth="$props.maxWidth"
29
30
  :width="$props.width"
30
31
  :padding="$props.padding"
31
32
  :elevation="true"
@@ -38,14 +39,15 @@
38
39
  align="center-center"
39
40
  >
40
41
  <FSText
41
- font="text-overline"
42
- :lineClamp="4"
42
+ font="text-body"
43
+ :lineClamp="$props.lineClamp"
43
44
  >
44
45
  {{ $props.content }}
45
46
  </FSText>
46
47
  </FSRow>
47
48
  </slot>
48
49
  <template
50
+ v-if="$props.showCloseButton"
49
51
  #top-right
50
52
  >
51
53
  <FSButton
@@ -95,7 +97,11 @@ export default defineComponent({
95
97
  },
96
98
  width: {
97
99
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
98
- default: 182
100
+ default: null
101
+ },
102
+ maxWidth: {
103
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
104
+ default: null
99
105
  },
100
106
  padding: {
101
107
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
@@ -104,6 +110,18 @@ export default defineComponent({
104
110
  iconSize: {
105
111
  type: String,
106
112
  default: "18px"
113
+ },
114
+ iconColor: {
115
+ type: String as PropType<ColorBase>,
116
+ default: ColorEnum.Primary
117
+ },
118
+ showCloseButton: {
119
+ type: Boolean,
120
+ default: true
121
+ },
122
+ lineClamp: {
123
+ type: Number,
124
+ default: 4
107
125
  }
108
126
  },
109
127
  emits: ["update:modelValue"],
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FSTile
3
- :width="['324px','272px']"
3
+ :width="['296px','336px']"
4
4
  :height="['132px', '116px']"
5
5
  :padding="['16px', '12px']"
6
6
  borderRadius="8px"
@@ -107,13 +107,11 @@ export default defineComponent({
107
107
  },
108
108
  iconBackgroundVariant: {
109
109
  type: String as PropType<"background" | "standard" | "full" | "gradient">,
110
- required: false,
111
- default: "standard"
110
+ required: false
112
111
  },
113
112
  iconBackgroundColor: {
114
113
  type: [Array, String] as PropType<ColorBase | ColorBase[]>,
115
- required: false,
116
- default: ColorEnum.Background
114
+ required: false
117
115
  },
118
116
  iconBorder: {
119
117
  type: Boolean as PropType<boolean>,
@@ -122,8 +120,7 @@ export default defineComponent({
122
120
  },
123
121
  iconColor: {
124
122
  type: String as PropType<ColorBase>,
125
- required: false,
126
- default: ColorEnum.Light
123
+ required: false
127
124
  },
128
125
  activeColor: {
129
126
  type: String as PropType<ColorBase>,
package/models/colors.ts CHANGED
@@ -19,4 +19,5 @@ export interface ColorVariations {
19
19
  darkContrast?: string | null;
20
20
  }
21
21
 
22
- export type ColorBase = (string | ColorEnum);
22
+ export type ColorBase = (string | ColorEnum);
23
+ export type ColorBaseVariations = "base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.151",
4
+ "version": "1.0.153",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "1.0.151",
14
- "@dative-gpi/foundation-shared-services": "1.0.151"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.153",
14
+ "@dative-gpi/foundation-shared-services": "1.0.153"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "009160ea61bb43f150c0c34cbc09a08804df46b7"
38
+ "gitHead": "91509afb15dcc9a8baf13c9594c2b5d1da394f7f"
39
39
  }
@@ -4,6 +4,7 @@
4
4
  padding: var(--fs-card-padding);
5
5
  height: var(--fs-card-height);
6
6
  width: var(--fs-card-width);
7
+ max-width: var(--fs-card-max-width);
7
8
  position: relative;
8
9
  display: flex;
9
10