independer-design-system 1.7.3 → 1.7.4

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.2.0"
6
6
  },
7
- "version": "1.7.3",
7
+ "version": "1.7.4",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -2,12 +2,12 @@
2
2
  <div
3
3
  v-if="show"
4
4
  class="notification flex gap-2 p-3 border rounded-lg"
5
- :class="classesBackground"
5
+ :class="colorClasses.background"
6
6
  >
7
7
  <Icon
8
8
  v-if="icon"
9
9
  :name="icon"
10
- :class="classesIcon"
10
+ :class="colorClasses.icon"
11
11
  />
12
12
 
13
13
  <div class="w-full">
@@ -17,7 +17,8 @@
17
17
  <Icon
18
18
  v-if="closeButton"
19
19
  name="eva:close-outline"
20
- class="text-grey-dark cursor-pointer"
20
+ class="cursor-pointer"
21
+ :class="colorClasses.close"
21
22
  @click.prevent="close"
22
23
  />
23
24
  </div>
@@ -34,19 +35,33 @@ const props = defineProps({
34
35
  }
35
36
  });
36
37
  const show = ref(true);
37
- const classesBackground = computed(() => {
38
- return {
39
- info: "bg-blue-light text-blue-darkest border-blue-400",
40
- warning: "bg-yellow-100 text-yellow-darkest border-yellow-400",
41
- error: "bg-red-100 text-red-darkest border-red-400"
42
- }[props.tone];
43
- });
44
- const classesIcon = computed(() => {
38
+ const colors = {
39
+ "brand-primary": "bg-brand-primary text-white border-transparent",
40
+ "brand-primary-subtle": "bg-brand-primary-subtlest text-brand-primary-strong border-brand-primary",
41
+ "spotlight-subtle": "bg-spotlight text-blue-800 border-border-spotlight",
42
+ "spotlight-strong": "bg-blue-700 text-white border-transparent",
43
+ "positive-subtle": "bg-green-100 text-green-800 border-green-600",
44
+ "positive-strong": "bg-green-700 text-white border-transparent",
45
+ "warning-subtle": "bg-warning text-orange-800 border-orange-400",
46
+ "warning-strong": "bg-orange-700 text-white border-transparent",
47
+ "negative-subtle": "bg-red-100 text-red-800 border-red-600",
48
+ "negative-strong": "bg-red-700 text-white border-transparent",
49
+ "neutral-subtle": "bg-neutral-subtlest text-text-default border-border-default-strong",
50
+ "neutral-strong": "bg-grey-700 text-white border-transparent"
51
+ };
52
+ const aliases = {
53
+ info: "spotlight-subtle",
54
+ warning: "warning-subtle",
55
+ error: "negative-subtle"
56
+ };
57
+ const colorClasses = computed(() => {
58
+ const tone = aliases[props.tone] ?? props.tone;
59
+ const strong = tone === "brand-primary" || tone?.endsWith("-strong");
45
60
  return {
46
- info: "text-blue-darkest",
47
- error: "text-red-darkest",
48
- warning: "text-yellow-darkest"
49
- }[props.tone];
61
+ background: colors[tone],
62
+ icon: tone === "brand-primary-subtle" ? "text-brand-primary" : "text-current",
63
+ close: strong ? "text-white" : "text-grey-700"
64
+ };
50
65
  });
51
66
  const close = () => {
52
67
  show.value = false;
@@ -54,5 +69,5 @@ const close = () => {
54
69
  </script>
55
70
 
56
71
  <style>
57
- @reference "../assets/style.css";.notification a{@apply font-semibold text-blue-darkest}
72
+ @reference "../assets/style.css";.notification a{@apply font-semibold text-current}
58
73
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "independer-design-system",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Vue 3 component library for the Independer Design System (DS2)",
5
5
  "repository": "arjanvanrees/independer-design-system",
6
6
  "license": "MIT",