@cypress-design/vue-icon 0.23.2 → 0.24.1
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +17 -0
- package/Icon.ts +8 -4
- package/IconVue.cy.tsx +25 -5
- package/_TreeShakableIcons.ts +242 -221
- package/compileProperties.ts +10 -5
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/_TreeShakableIcons.d.ts +223 -220
- package/dist/_TreeShakableIcons.d.ts.map +1 -1
- package/dist/compileProperties.d.ts +1 -0
- package/dist/compileProperties.d.ts.map +1 -1
- package/dist/index.es.mjs +407 -392
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/generate-icons.js +5 -5
- package/package.json +3 -3
package/compileProperties.ts
CHANGED
|
@@ -10,6 +10,11 @@ import {
|
|
|
10
10
|
} from 'vue'
|
|
11
11
|
import type { SVGAttributes } from 'vue'
|
|
12
12
|
|
|
13
|
+
export type VueComponentClassObject =
|
|
14
|
+
| Record<string, boolean>
|
|
15
|
+
| string
|
|
16
|
+
| Array<Record<string, boolean> | string>
|
|
17
|
+
|
|
13
18
|
/**
|
|
14
19
|
* Icon names of the SVGs whose defs already appear in the DOM
|
|
15
20
|
*/
|
|
@@ -27,7 +32,7 @@ const defsAlreadyLoaded = new Set<string>()
|
|
|
27
32
|
*/
|
|
28
33
|
export const useShouldRenderDefs = (
|
|
29
34
|
iconName: string,
|
|
30
|
-
defs: ComputedRef<string | undefined
|
|
35
|
+
defs: ComputedRef<string | undefined>,
|
|
31
36
|
) => {
|
|
32
37
|
const shouldRenderDefs = ref(false)
|
|
33
38
|
|
|
@@ -50,7 +55,7 @@ export const useShouldRenderDefs = (
|
|
|
50
55
|
// add the defs inside an extra SVG and append it to the end of the body only when unmounting
|
|
51
56
|
const newDefs = document.createElementNS(
|
|
52
57
|
'http://www.w3.org/2000/svg',
|
|
53
|
-
'svg'
|
|
58
|
+
'svg',
|
|
54
59
|
)
|
|
55
60
|
newDefs.setAttribute('width', '0')
|
|
56
61
|
newDefs.setAttribute('height', '0')
|
|
@@ -73,7 +78,7 @@ export const compileVueIconProperties = (
|
|
|
73
78
|
size: string
|
|
74
79
|
interactiveColorsOnGroup?: boolean
|
|
75
80
|
}
|
|
76
|
-
|
|
81
|
+
>,
|
|
77
82
|
) => {
|
|
78
83
|
const ret = computed(() => {
|
|
79
84
|
const {
|
|
@@ -88,7 +93,7 @@ export const compileVueIconProperties = (
|
|
|
88
93
|
(newAttributes, attrName) => {
|
|
89
94
|
if (
|
|
90
95
|
!ICON_COLOR_PROP_NAMES.includes(
|
|
91
|
-
attrName as (typeof ICON_COLOR_PROP_NAMES)[number]
|
|
96
|
+
attrName as (typeof ICON_COLOR_PROP_NAMES)[number],
|
|
92
97
|
) &&
|
|
93
98
|
attrName !== 'name'
|
|
94
99
|
) {
|
|
@@ -98,7 +103,7 @@ export const compileVueIconProperties = (
|
|
|
98
103
|
}
|
|
99
104
|
return newAttributes
|
|
100
105
|
},
|
|
101
|
-
{} as Omit<SVGAttributes, 'name'
|
|
106
|
+
{} as Omit<SVGAttributes, 'name'>,
|
|
102
107
|
)
|
|
103
108
|
|
|
104
109
|
const iconFileId = `${iconName}_${size}`
|
package/dist/Icon.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OpenIconProps, IconProps } from '@cypress-design/icon-registry';
|
|
2
2
|
declare const _default: (props: OpenIconProps & Pick<IconProps, "name"> & {
|
|
3
|
-
class?:
|
|
3
|
+
class?: any;
|
|
4
4
|
} & {}) => any;
|
|
5
5
|
export default _default;
|
|
6
6
|
//# sourceMappingURL=Icon.d.ts.map
|
package/dist/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../Icon.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../Icon.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;;YAe7D,GAAG;;AAPnB,wBA4DC"}
|