@weni/unnnic-system 3.6.0 → 3.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -38,7 +38,7 @@
38
38
  "test": "vitest",
39
39
  "test:ui": "vitest --ui",
40
40
  "coverage": "vitest --coverage",
41
- "style-dictionary:generate": "style-dictionary build --config styleDictionary.config.js"
41
+ "style-dictionary:generate": "style-dictionary build --config styleDictionary.config.mjs"
42
42
  },
43
43
  "publishConfig": {
44
44
  "registry": "https://registry.npmjs.org/"
@@ -51,6 +51,7 @@
51
51
  "vue": "^3.4.8"
52
52
  },
53
53
  "dependencies": {
54
+ "@iconify/vue": "^5.0.0",
54
55
  "@vueuse/components": "^10.4.1",
55
56
  "emoji-mart-vue-fast": "^15.0.5",
56
57
  "lodash": "^4.17.21",
@@ -1,7 +1,24 @@
1
1
  <template>
2
+ <Icon
3
+ v-if="isIconify"
4
+ :icon="props.icon as string"
5
+ :class="[
6
+ 'unnnic-icon',
7
+ `unnnic-icon-scheme--${scheme}`,
8
+ `unnnic-icon-size--${size}`,
9
+ {
10
+ 'unnnic--clickable': clickable,
11
+ },
12
+ ]"
13
+ data-testid="iconify-icon"
14
+ @click="onClick"
15
+ @mousedown="(event) => $emit('mousedown', event)"
16
+ @mouseup="(event) => $emit('mouseup', event)"
17
+ />
18
+
2
19
  <component
3
20
  :is="customSvgIcon"
4
- v-if="customSvgIcon"
21
+ v-else-if="customSvgIcon"
5
22
  :class="[
6
23
  'unnnic-icon',
7
24
  `unnnic-icon--size-svg-${size}`,
@@ -40,6 +57,7 @@
40
57
 
41
58
  <script setup lang="ts">
42
59
  import { computed } from 'vue';
60
+ import { Icon } from '@iconify/vue';
43
61
 
44
62
  import icons from '../utils/icons';
45
63
  import OldIconsMap from './Icon/OldIconsMap.json';
@@ -67,6 +85,10 @@ const emit = defineEmits<{
67
85
  mouseup: [event: Event];
68
86
  }>();
69
87
 
88
+ const isIconify = computed(
89
+ () => (props.icon as string)?.includes(':') ?? false,
90
+ );
91
+
70
92
  const customSvgIcon = computed(() => icons[props.icon as string] ?? null);
71
93
 
72
94
  const materialSymbolsName = computed(
@@ -1,6 +1,15 @@
1
1
  import UnnnicIcon from '../components/Icon.vue';
2
2
 
3
- const iconsOptions = ['add'];
3
+ const iconsOptions = [
4
+ 'add',
5
+ 'add-1',
6
+ 'warning',
7
+ 'bi:stars',
8
+ 'indicator',
9
+ 'fitness-biceps-1',
10
+ 'close-1',
11
+ 'check-2',
12
+ ];
4
13
 
5
14
  const schemes = [
6
15
  'background-solo',
@@ -93,27 +102,27 @@ const schemes = [
93
102
  ];
94
103
 
95
104
  export default {
96
- title: 'example/Icon',
105
+ title: 'Misc/Icon',
97
106
  component: UnnnicIcon,
98
107
  argTypes: {
99
- scheme: { control: { type: 'select', options: schemes } },
108
+ scheme: { control: { type: 'select' }, options: schemes },
100
109
  size: {
101
110
  control: {
102
111
  type: 'select',
103
- options: [
104
- 'nano',
105
- 'xs',
106
- 'sm',
107
- 'md',
108
- 'lg',
109
- 'avatar-lg',
110
- 'avatar-md',
111
- 'avatar-sm',
112
- 'avatar-xs',
113
- 'avatar-nano',
114
- ],
115
112
  },
113
+ options: [
114
+ 'xs',
115
+ 'sm',
116
+ 'md',
117
+ 'lg',
118
+ 'avatar-lg',
119
+ 'avatar-md',
120
+ 'avatar-sm',
121
+ 'avatar-xs',
122
+ 'avatar-nano',
123
+ ],
116
124
  },
125
+ icon: { control: { type: 'select' }, options: iconsOptions },
117
126
  },
118
127
  };
119
128