@cypress-design/vue-icon 0.24.2 → 0.24.3

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/generate-icons.js CHANGED
@@ -27,25 +27,28 @@ const iconsComponents = Object.keys(iconsMetadata).map((name) => {
27
27
  }, {})
28
28
 
29
29
  return dedent`
30
- export const Icon${pascalCaseName} = defineComponent((props: Omit<iconsRegistry.Icon${pascalCaseName}Props, 'name'> & {
30
+ export const Icon${pascalCaseName} = defineComponent({
31
+ ...__iconComponentOpts__,
32
+ setup(props: Omit<iconsRegistry.Icon${pascalCaseName}Props, 'name'> & {
31
33
  class?: any
32
- }, { attrs }: { attrs: Omit<SVGAttributes, 'name' | 'class'> }) => {
33
- const iconPropsStep = useIconProps(props, ${JSON.stringify(
34
- iconBodies,
35
- null,
36
- 2,
37
- )}, ${JSON.stringify(iconMetadata.availableSizes)}, ${JSON.stringify(name)})
34
+ }, { attrs }: { attrs: Omit<SVGAttributes, 'name' | 'class'> }) {
35
+ const iconPropsStep = useIconProps(props, ${JSON.stringify(
36
+ iconBodies,
37
+ null,
38
+ 2,
39
+ )}, ${JSON.stringify(iconMetadata.availableSizes)}, ${JSON.stringify(
40
+ name,
41
+ )})
38
42
 
39
- const { componentProps, defs } = compileVueIconProperties(iconPropsStep)
43
+ const { componentProps, defs } = compileVueIconProperties(iconPropsStep)
40
44
 
41
- const { shouldRenderDefs } = useShouldRenderDefs(
42
- ${JSON.stringify(name)},
43
- defs)
45
+ const { shouldRenderDefs } = useShouldRenderDefs(
46
+ ${JSON.stringify(name)},
47
+ defs)
44
48
 
45
- return () => hyperSVG(componentProps, defs, shouldRenderDefs, attrs, props.class)
46
- },
47
- // @ts-expect-error - vue types need an update
48
- __iconComponentOpts__)
49
+ return () => hyperSVG(componentProps, defs, shouldRenderDefs, attrs, props.class)
50
+ },
51
+ })
49
52
  `
50
53
  })
51
54
 
@@ -56,7 +59,7 @@ import * as iconsRegistry from '@cypress-design/icon-registry'
56
59
  import { compileVueIconProperties, useShouldRenderDefs } from './compileProperties'
57
60
 
58
61
  const __iconComponentOpts__ = {
59
- props: [...iconsRegistry.ICON_COLOR_PROP_NAMES, 'interactiveColorsOnGroup', 'size', 'class'],
62
+ props: [...iconsRegistry.ICON_COLOR_PROP_NAMES, 'interactiveColorsOnGroup', 'size', 'class'] as string[],
60
63
  } as const
61
64
 
62
65
  function useIconProps(props: SVGAttributes & Omit<iconsRegistry.IconProps, 'name'>, iconBodiesAndDefs: Record<string, {body: string, defs?: string}>, availableSizes: string[], name: string) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress-design/vue-icon",
3
- "version": "0.24.2",
3
+ "version": "0.24.3",
4
4
  "files": [
5
5
  "*"
6
6
  ],