@dative-gpi/foundation-shared-components 0.0.5 → 0.0.7

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 (46) hide show
  1. package/components/FSBreadcrumbs.vue +16 -14
  2. package/components/FSButton.vue +171 -115
  3. package/components/FSCheckbox.vue +21 -10
  4. package/components/FSCol.vue +17 -17
  5. package/components/FSColor.vue +80 -0
  6. package/components/FSFadeOut.vue +4 -4
  7. package/components/FSIcon.vue +5 -3
  8. package/components/FSNumberField.vue +1 -1
  9. package/components/FSPasswordField.vue +20 -9
  10. package/components/FSRadio.vue +20 -10
  11. package/components/FSRadioGroup.vue +5 -7
  12. package/components/FSRow.vue +17 -17
  13. package/components/FSSearchField.vue +122 -0
  14. package/components/FSSlideGroup.vue +16 -12
  15. package/components/FSSpan.vue +27 -2
  16. package/components/FSSwitch.vue +25 -12
  17. package/components/FSTab.vue +9 -2
  18. package/components/FSTabs.vue +18 -10
  19. package/components/FSTag.vue +31 -17
  20. package/components/FSTagField.vue +152 -0
  21. package/components/FSTagGroup.vue +60 -0
  22. package/components/FSText.vue +78 -0
  23. package/components/FSTextField.vue +74 -18
  24. package/components/FSWrapGroup.vue +15 -12
  25. package/composables/useColors.ts +31 -21
  26. package/{defaults → models}/FSButtons.ts +24 -6
  27. package/models/FSTags.ts +8 -0
  28. package/models/FSTextFields.ts +17 -0
  29. package/package.json +5 -4
  30. package/styles/components/fs_breadcrumbs.scss +10 -5
  31. package/styles/components/fs_button.scss +21 -20
  32. package/styles/components/fs_checkbox.scss +3 -4
  33. package/styles/components/fs_color.scss +5 -0
  34. package/styles/components/fs_password_field.scss +6 -1
  35. package/styles/components/fs_radio.scss +3 -4
  36. package/styles/components/fs_span.scss +7 -2
  37. package/styles/components/fs_switch.scss +4 -4
  38. package/styles/components/fs_tabs.scss +8 -8
  39. package/styles/components/fs_tag.scss +8 -8
  40. package/styles/components/fs_tag_field.scss +10 -0
  41. package/styles/components/fs_text.scss +5 -0
  42. package/styles/components/fs_text_field.scss +25 -14
  43. package/styles/components/index.scss +3 -0
  44. package/styles/globals/overrides.scss +13 -4
  45. package/styles/globals/text_fonts.scss +4 -0
  46. package/themes/default.ts +6 -6
@@ -10,7 +10,7 @@
10
10
  @update:value="(value) => $emit('update:value', value)"
11
11
  v-bind="$attrs"
12
12
  >
13
- <template #append>
13
+ <template #append-inner>
14
14
  <FSIcon
15
15
  class="fs-password-field-icon"
16
16
  size="m"
@@ -79,18 +79,29 @@ export default defineComponent({
79
79
 
80
80
  const stars = ref(true);
81
81
 
82
- const type = computed(() => stars.value ? "password" : "text");
82
+ const lights = useColors().getColors(ColorBase.Light);
83
+ const darks = useColors().getColors(ColorBase.Dark);
83
84
 
84
- const icon = computed(() => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
85
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
86
+ if (!editable.value) {
87
+ return {
88
+ "--fs-password-field-cursor" : "default",
89
+ "--fs-password-field-base-text": lights.dark,
90
+ "--fs-password-field-dark-text": lights.dark
91
+ };
92
+ }
93
+ return {
94
+ "--fs-password-field-cursor" : "pointer",
95
+ "--fs-password-field-base-text": darks.base,
96
+ "--fs-password-field-dark-text": darks.dark
97
+ };
98
+ });
85
99
 
86
- const dark = useColors().getVariants(ColorBase.Dark);
100
+ const type = computed((): string => stars.value ? "password" : "text");
87
101
 
88
- const style = computed(() => ({
89
- "--fs-password-field-cursor" : editable.value ? "pointer" : "default",
90
- "--fs-password-field-base-text": editable.value ? dark.base : dark.light
91
- }));
102
+ const icon = computed((): string => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
92
103
 
93
- const onToggle = () => {
104
+ const onToggle = (): void => {
94
105
  if (!editable.value) {
95
106
  return;
96
107
  }
@@ -88,21 +88,31 @@ export default defineComponent({
88
88
  setup(props, { emit }) {
89
89
  const { value, selected, color, editable } = toRefs(props);
90
90
 
91
- const colors = useColors().getVariants(color.value);
92
- const dark = useColors().getVariants(ColorBase.Dark);
91
+ const colors = useColors().getColors(color.value);
93
92
 
94
- const style = computed(() => ({
95
- "--fs-radio-cursor": (editable.value && !selected.value) ? "pointer" : "default",
96
- "--fs-radio-base-color": editable.value ? selected.value ? colors.base : dark.base : dark.light,
97
- "--fs-radio-base-text" : editable.value ? dark.base : dark.light
93
+ const lights = useColors().getColors(ColorBase.Light);
94
+ const darks = useColors().getColors(ColorBase.Dark);
98
95
 
99
- }));
96
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
97
+ if (!editable.value) {
98
+ return {
99
+ "--fs-radio-cursor": "default",
100
+ "--fs-radio-radio-color": lights.dark,
101
+ "--fs-radio-color": lights.dark
102
+ };
103
+ }
104
+ return {
105
+ "--fs-radio-cursor": selected.value ? "default" : "pointer",
106
+ "--fs-radio-radio-color": selected.value ? colors.base : darks.base,
107
+ "--fs-radio-color" : darks.base
108
+ };
109
+ });
100
110
 
101
- const icon = computed(() => selected.value ? "mdi-radiobox-marked" : "mdi-radiobox-blank");
111
+ const icon = computed((): string => selected.value ? "mdi-radiobox-marked" : "mdi-radiobox-blank");
102
112
 
103
- const font = computed(() => selected.value ? "text-button" : "text-body");
113
+ const font = computed((): string => selected.value ? "text-button" : "text-body");
104
114
 
105
- const onToggle = () => {
115
+ const onToggle = (): void => {
106
116
  if (!editable.value) {
107
117
  return;
108
118
  }
@@ -7,8 +7,8 @@
7
7
  :description="item.description"
8
8
  :value="item.value"
9
9
  :selected="isSelected(item.value)"
10
- :color="color"
11
- :editable="editable"
10
+ :color="$props.color"
11
+ :editable="$props.editable"
12
12
  @update:value="onToggle"
13
13
  />
14
14
  </FSCol>
@@ -52,21 +52,19 @@ export default defineComponent({
52
52
  },
53
53
  emits: ["update:value"],
54
54
  setup(props, { emit }) {
55
- const { value, color, editable } = toRefs(props);
55
+ const { value } = toRefs(props);
56
56
 
57
- const isSelected = (item: String | Boolean | Number) => {
57
+ const isSelected = (item: String | Boolean | Number): boolean => {
58
58
  return item == value.value;
59
59
  };
60
60
 
61
- const onToggle = (item: String | Boolean | Number) => {
61
+ const onToggle = (item: String | Boolean | Number): void => {
62
62
  if (item != value.value) {
63
63
  emit("update:value", item);
64
64
  }
65
65
  };
66
66
 
67
67
  return {
68
- color,
69
- editable,
70
68
  isSelected,
71
69
  onToggle
72
70
  };
@@ -50,57 +50,57 @@ export default defineComponent({
50
50
  "--fs-row-height": height.value
51
51
  }));
52
52
 
53
- const classes = computed((): string => {
54
- let classes = "fs-row";
53
+ const classes = computed((): string[] => {
54
+ const classes = ["fs-row"];
55
55
  switch (width.value) {
56
56
  case "hug":
57
- classes += " fs-row-width-hug";
57
+ classes.push("fs-row-width-hug");
58
58
  break;
59
59
  case "fill":
60
- classes += " fs-row-width-fill";
60
+ classes.push("fs-row-width-fill");
61
61
  break;
62
62
  default:
63
- classes += " fs-row-width-fixed";
63
+ classes.push("fs-row-width-fixed");
64
64
  break;
65
65
  }
66
66
  switch (height.value) {
67
67
  case "hug":
68
- classes += " fs-row-height-hug";
68
+ classes.push("fs-row-height-hug");
69
69
  break;
70
70
  case "fill":
71
- classes += " fs-row-height-fill";
71
+ classes.push("fs-row-height-fill");
72
72
  break;
73
73
  default:
74
- classes += " fs-row-height-fixed";
74
+ classes.push("fs-row-height-fixed");
75
75
  break;
76
76
  }
77
77
  switch (align.value) {
78
78
  case "top-left":
79
- classes += " fs-row-top-left";
79
+ classes.push("fs-row-top-left");
80
80
  break;
81
81
  case "top-center":
82
- classes += " fs-row-top-center";
82
+ classes.push("fs-row-top-center");
83
83
  break;
84
84
  case "top-right":
85
- classes += " fs-row-top-right";
85
+ classes.push("fs-row-top-right");
86
86
  break;
87
87
  case "center-left":
88
- classes += " fs-row-center-left";
88
+ classes.push("fs-row-center-left");
89
89
  break;
90
90
  case "center-center":
91
- classes += " fs-row-center-center";
91
+ classes.push("fs-row-center-center");
92
92
  break;
93
93
  case "center-right":
94
- classes += " fs-row-center-right";
94
+ classes.push("fs-row-center-right");
95
95
  break;
96
96
  case "bottom-left":
97
- classes += " fs-row-bottom-left";
97
+ classes.push("fs-row-bottom-left");
98
98
  break;
99
99
  case "bottom-center":
100
- classes += " fs-row-bottom-center";
100
+ classes.push("fs-row-bottom-center");
101
101
  break;
102
102
  case "bottom-right":
103
- classes += " fs-row-bottom-right";
103
+ classes.push("fs-row-bottom-right");
104
104
  break;
105
105
  }
106
106
  return classes;
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <FSTextField
3
+ :label="$props.label"
4
+ :description="$props.description"
5
+ :type="type"
6
+ :color="$props.color"
7
+ :required="$props.required"
8
+ :editable="$props.editable"
9
+ :value="innerValue"
10
+ @update:value="(value) => innerValue = value"
11
+ v-bind="$attrs"
12
+ >
13
+ <template #append>
14
+ <FSButton
15
+ :prependIcon="$props.buttonPrependIcon"
16
+ :label="$props.buttonLabel"
17
+ :appendIcon="$props.buttonAppendIcon"
18
+ :variant="$props.buttonVariant"
19
+ :color="$props.buttonColor"
20
+ :editable="$props.editable"
21
+ @click="onUpdate"
22
+ />
23
+ </template>
24
+ <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
25
+ <slot :name="name" v-bind="slotData" />
26
+ </template>
27
+ </FSTextField>
28
+ </template>
29
+
30
+ <script lang="ts">
31
+ import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
32
+
33
+ import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
34
+
35
+ import FSTextField from "./FSTextField.vue";
36
+ import FSButton from "./FSButton.vue";
37
+ import FSIcon from "./FSIcon.vue";
38
+
39
+ export default defineComponent({
40
+ name: "FSSearchField",
41
+ components: {
42
+ FSTextField,
43
+ FSButton,
44
+ FSIcon
45
+ },
46
+ props: {
47
+ label: {
48
+ type: String,
49
+ required: false,
50
+ default: null
51
+ },
52
+ description: {
53
+ type: String,
54
+ required: false,
55
+ default: null
56
+ },
57
+ buttonPrependIcon: {
58
+ type: String,
59
+ required: false,
60
+ default: "mdi-magnify"
61
+ },
62
+ buttonLabel: {
63
+ type: String,
64
+ required: false,
65
+ default: null
66
+ },
67
+ buttonAppendIcon: {
68
+ type: String,
69
+ required: false,
70
+ default: null
71
+ },
72
+ buttonVariant: {
73
+ type: String as PropType<"standard" | "full" | "icon">,
74
+ required: false,
75
+ default: "standard"
76
+ },
77
+ value: {
78
+ type: String,
79
+ required: false,
80
+ default: null
81
+ },
82
+ color: {
83
+ type: String as PropType<ColorBase>,
84
+ required: false,
85
+ default: ColorBase.Dark
86
+ },
87
+ buttonColor: {
88
+ type: String as PropType<ColorBase>,
89
+ required: false,
90
+ default: ColorBase.Primary
91
+ },
92
+ required: {
93
+ type: Boolean,
94
+ required: false,
95
+ default: false
96
+ },
97
+ editable: {
98
+ type: Boolean,
99
+ required: false,
100
+ default: true
101
+ }
102
+ },
103
+ emits: ["update:value"],
104
+ setup(props, { emit }) {
105
+ const { editable } = toRefs(props);
106
+
107
+ const innerValue: Ref<String> = ref(props.value);
108
+
109
+ const onUpdate = (): void => {
110
+ if (!editable.value) {
111
+ return;
112
+ }
113
+ emit("update:value", innerValue.value);
114
+ };
115
+
116
+ return {
117
+ innerValue,
118
+ onUpdate
119
+ };
120
+ }
121
+ });
122
+ </script>
@@ -7,14 +7,14 @@
7
7
  >
8
8
  <FSRow>
9
9
  <v-slide-group-item v-for="(component, index) in $slots.default()" :key="index">
10
- <component :is="component" v-bind="{ color }" />
10
+ <component :is="component" v-bind="{ color, colors, style }" />
11
11
  </v-slide-group-item>
12
12
  </FSRow>
13
13
  </v-slide-group>
14
14
  </template>
15
15
 
16
16
  <script lang="ts">
17
- import { defineComponent, PropType, toRefs } from "vue";
17
+ import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
18
18
 
19
19
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
20
20
  import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
@@ -36,20 +36,24 @@ export default defineComponent({
36
36
  setup(props) {
37
37
  const { color } = toRefs(props);
38
38
 
39
- const colors = useColors().getVariants(color.value);
40
- const dark = useColors().getVariants(ColorBase.Dark);
39
+ const textColors = useColors().getContrasts(color.value);
40
+ const colors = useColors().getColors(color.value);
41
41
 
42
- const style = {
43
- "--fs-group-light-color" : colors.light,
44
- "--fs-group-base-color" : colors.base,
45
- "--fs-group-dark-color" : colors.dark,
46
- "--fs-group-light-text" : dark.base,
47
- "--fs-group-base-text" : dark.base,
48
- "--fs-group-dark-text" : dark.dark
49
- };
42
+ const darks = useColors().getColors(ColorBase.Dark);
43
+
44
+ const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
45
+ "--fs-group-color": darks.base,
46
+ "--fs-group-hover-background-color": colors.light,
47
+ "--fs-group-hover-color": darks.dark,
48
+ "--fs-group-disabled-color": darks.light,
49
+ "--fs-group-light": colors.light,
50
+ "--fs-group-base": colors.base,
51
+ "--fs-group-dark": colors.dark
52
+ });
50
53
 
51
54
  return {
52
55
  color,
56
+ colors,
53
57
  style
54
58
  };
55
59
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <span
3
- :class="'fs-span ' + $props.font"
3
+ :class="classes"
4
4
  v-bind="$attrs"
5
5
  >
6
6
  <slot />
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script lang="ts">
11
- import { defineComponent, PropType } from "vue";
11
+ import { computed, defineComponent, PropType, toRefs, useSlots } from "vue";
12
12
 
13
13
  export default defineComponent({
14
14
  name: "FSSpan",
@@ -17,7 +17,32 @@ export default defineComponent({
17
17
  type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
18
18
  required: false,
19
19
  default: "text-body"
20
+ },
21
+ ellipsis: {
22
+ type: Boolean,
23
+ required: false,
24
+ default: true
20
25
  }
26
+ },
27
+ setup(props) {
28
+ const { font } = toRefs(props);
29
+
30
+ const slots = useSlots();
31
+
32
+ const classes = computed((): string[] => {
33
+ const classes = ["fs-span", font.value];
34
+ if (props.ellipsis) {
35
+ classes.push("fs-span-ellipsis");
36
+ }
37
+ if (!slots.default) {
38
+ classes.push("fs-span-pre-wrap");
39
+ }
40
+ return classes;
41
+ });
42
+
43
+ return {
44
+ classes
45
+ };
21
46
  }
22
47
  });
23
48
  </script>
@@ -84,21 +84,34 @@ export default defineComponent({
84
84
  setup(props, { emit }) {
85
85
  const { value, color, editable } = toRefs(props);
86
86
 
87
- const background = useColors().getBackground();
88
- const colors = useColors().getVariants(color.value);
89
- const dark = useColors().getVariants(ColorBase.Dark);
87
+ const colors = useColors().getColors(color.value);
90
88
 
91
- const style = computed(() => ({
92
- "--fs-switch-cursor" : editable.value ? "pointer" : "default",
93
- "--fs-switch-translate-x" : value.value ? "8px" : "-8px",
94
- "--fs-switch-base-color" : value.value ? colors.base : editable.value ? dark.base : dark.light,
95
- "--fs-switch-base-text" : editable.value ? dark.base : dark.light,
96
- "--fs-switch-base-background": background.base
97
- }));
89
+ const backgrounds = useColors().getColors(ColorBase.Background);
90
+ const lights = useColors().getColors(ColorBase.Light);
91
+ const darks = useColors().getColors(ColorBase.Dark);
98
92
 
99
- const font = computed(() => value.value ? "text-button" : "text-body");
93
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
94
+ if (!editable.value) {
95
+ return {
96
+ "--fs-switch-translate-x": value.value ? "8px" : "-8px",
97
+ "--fs-switch-cursor": "default",
98
+ "--fs-switch-track-color": lights.dark,
99
+ "--fs-switch-thumb-color": backgrounds.base,
100
+ "--fs-switch-color": lights.dark
101
+ };
102
+ }
103
+ return {
104
+ "--fs-switch-translate-x": value.value ? "8px" : "-8px",
105
+ "--fs-switch-cursor": "pointer",
106
+ "--fs-switch-track-color": value.value ? colors.base : darks.base,
107
+ "--fs-switch-thumb-color": backgrounds.base,
108
+ "--fs-switch-color": darks.base
109
+ };
110
+ });
111
+
112
+ const font = computed((): string => value.value ? "text-button" : "text-body");
100
113
 
101
- const onToggle = () => {
114
+ const onToggle = (): void => {
102
115
  if (!editable.value) {
103
116
  return;
104
117
  }
@@ -16,7 +16,7 @@
16
16
  {{ $props.label }}
17
17
  </FSSpan>
18
18
  </slot>
19
- <v-spacer />
19
+ <v-spacer v-if="$props.tag" />
20
20
  <slot name="tag">
21
21
  <FSSpan v-if="$props.tag" class="fs-tab-tag">
22
22
  {{ $props.tag }}
@@ -33,7 +33,9 @@
33
33
  </template>
34
34
 
35
35
  <script lang="ts">
36
- import { defineComponent } from "vue";
36
+ import { defineComponent, PropType } from "vue";
37
+
38
+ import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
37
39
 
38
40
  import FSSpan from "./FSSpan.vue";
39
41
  import FSIcon from "./FSIcon.vue";
@@ -66,6 +68,11 @@ export default defineComponent({
66
68
  type: String,
67
69
  required: false,
68
70
  default: null
71
+ },
72
+ color: {
73
+ type: String as PropType<ColorBase>,
74
+ required: false,
75
+ default: ColorBase.Dark
69
76
  }
70
77
  }
71
78
  });
@@ -11,13 +11,13 @@
11
11
  v-bind="$attrs"
12
12
  >
13
13
  <template v-for="(component, index) in $slots.default()" :key="index">
14
- <component :is="component" />
14
+ <component :is="component" v-bind="{ color, colors, style }" />
15
15
  </template>
16
16
  </v-tabs>
17
17
  </template>
18
18
 
19
19
  <script lang="ts">
20
- import { defineComponent, PropType, toRefs } from "vue";
20
+ import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
21
21
 
22
22
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
23
23
  import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
@@ -40,18 +40,26 @@ export default defineComponent({
40
40
  setup(props, { emit }) {
41
41
  const { tab, color } = toRefs(props);
42
42
 
43
- const colors = useColors().getVariants(color.value);
44
- const dark = useColors().getVariants(ColorBase.Dark);
43
+ const textColors = useColors().getContrasts(color.value);
44
+ const colors = useColors().getColors(color.value);
45
45
 
46
- const style = {
47
- "--fs-group-light-color" : colors.light,
48
- "--fs-group-base-color" : colors.base,
49
- "--fs-group-light-text" : dark.base,
50
- "--fs-group-dark-text" : dark.dark
51
- };
46
+ const darks = useColors().getColors(ColorBase.Dark);
47
+
48
+ const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
49
+ "--fs-group-color": darks.base,
50
+ "--fs-group-hover-background-color": colors.light,
51
+ "--fs-group-hover-color": darks.dark,
52
+ "--fs-group-disabled-color": darks.light,
53
+ "--fs-group-light": colors.light,
54
+ "--fs-group-base": colors.base,
55
+ "--fs-group-dark": colors.dark,
56
+ "--fs-tab-tag-background-color": colors.base,
57
+ "--fs-tab-tag-color": textColors.light
58
+ });
52
59
 
53
60
  return {
54
61
  tab,
62
+ color,
55
63
  colors,
56
64
  style,
57
65
  emit
@@ -6,14 +6,14 @@
6
6
  :style="style"
7
7
  v-bind="$attrs"
8
8
  >
9
- <slot name="default">
9
+ <slot name="default" v-bind="{ color, colors }">
10
10
  <FSSpan class="fs-tag-label">
11
11
  {{ $props.label }}
12
12
  </FSSpan>
13
13
  </slot>
14
- <slot name="button">
14
+ <slot name="button" v-bind="{ color, colors }">
15
15
  <v-btn
16
- v-if="editable"
16
+ v-if="$props.editable"
17
17
  class="fs-tag-button"
18
18
  :ripple="false"
19
19
  @click="$emit('remove')"
@@ -48,10 +48,10 @@ export default defineComponent({
48
48
  type: String,
49
49
  required: true
50
50
  },
51
- full: {
52
- type: Boolean,
51
+ variant: {
52
+ type: String as PropType<"standard" | "full">,
53
53
  required: false,
54
- default: true
54
+ default: "full"
55
55
  },
56
56
  color: {
57
57
  type: String as PropType<ColorBase>,
@@ -66,21 +66,35 @@ export default defineComponent({
66
66
  },
67
67
  emits: ["remove"],
68
68
  setup(props) {
69
- const { full, color, editable } = toRefs(props);
69
+ const { variant, color } = toRefs(props);
70
70
 
71
- const colors = useColors().getVariants(color.value);
71
+ const textColors = useColors().getContrasts(color.value);
72
+ const colors = useColors().getColors(color.value);
72
73
 
73
- const style = computed(() => ({
74
- "--fs-tag-light-color": full.value ? colors.base : colors.light,
75
- "--fs-tag-base-color" : colors.base,
76
- "--fs-tag-dark-color" : colors.dark,
77
- "--fs-tag-light-text" : full.value ? colors.light : colors.base,
78
- "--fs-tag-base-text" : colors.light,
79
- "--fs-tag-dark-text" : colors.light
80
- }));
74
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
75
+ switch (variant.value) {
76
+ case "standard": return {
77
+ "--fs-tag-background-color": colors.light,
78
+ "--fs-tag-color": textColors.base,
79
+ "--fs-tag-hover-background-color": colors.base,
80
+ "--fs-tag-hover-color": textColors.light,
81
+ "--fs-tag-active-background-color": colors.dark,
82
+ "--fs-tag-active-color": textColors.light
83
+ };
84
+ case "full": return {
85
+ "--fs-tag-background-color": colors.base,
86
+ "--fs-tag-color": textColors.light,
87
+ "--fs-tag-hover-background-color": colors.base,
88
+ "--fs-tag-hover-color": textColors.light,
89
+ "--fs-tag-active-background-color": colors.dark,
90
+ "--fs-tag-active-color": textColors.light
91
+ };
92
+ }
93
+ });
81
94
 
82
95
  return {
83
- editable,
96
+ colors,
97
+ color,
84
98
  style
85
99
  };
86
100
  }