@cypress-design/vue-icon 3.3.1 → 3.4.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/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +16 -0
- package/Icon.ts +7 -4
- package/IconVue.cy.tsx +17 -17
- package/ReadMe.md +1 -1
- package/_TreeShakableIcons.ts +689 -685
- package/animated/_testUtils.tsx +8 -8
- package/compileProperties.ts +0 -5
- package/dist/Icon.d.ts.map +1 -1
- package/dist/_TreeShakableIcons.d.ts +1705 -1023
- package/dist/_TreeShakableIcons.d.ts.map +1 -1
- package/dist/compileProperties.d.ts +0 -1
- package/dist/compileProperties.d.ts.map +1 -1
- package/dist/index.es.mjs +1855 -1856
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/generate-icons.js +12 -5
- package/package.json +3 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -4,7 +4,7 @@ transforming...
|
|
|
4
4
|
[32m✓[39m 17 modules transformed.
|
|
5
5
|
rendering chunks...
|
|
6
6
|
computing gzip size...
|
|
7
|
-
[2mdist/[22m[36mindex.es.mjs [39m[1m[
|
|
7
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m478.80 kB[22m[1m[22m[2m │ gzip: 95.07 kB[22m[2m │ map: 803.38 kB[22m
|
|
8
8
|
Entry module "index.ts" is using named and default exports together. Consumers of your bundle will have to use `Icon.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
9
|
-
[2mdist/[22m[36mindex.umd.js [39m[1m[
|
|
10
|
-
[32m✓ built in
|
|
9
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m434.59 kB[22m[1m[22m[2m │ gzip: 93.68 kB[22m[2m │ map: 783.93 kB[22m
|
|
10
|
+
[32m✓ built in 11.61s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @cypress-design/vue-icon
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @cypress-design/icon-registry@3.4.0
|
|
9
|
+
|
|
10
|
+
## 3.3.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#731](https://github.com/cypress-io/cypress-design/pull/731) [`677c0c0`](https://github.com/cypress-io/cypress-design/commit/677c0c00f3ea3e37e89b38710b919bc03cabec0c) Thanks [@jennifer-shehane](https://github.com/jennifer-shehane)! - Fix tree shaking in `@cypress-design/vue-icon`: importing a single named icon (for example `IconActionPlaySmall`) now bundles about 13 KB instead of every icon plus the full icon registry (about 960 KB). Both icon packages are now marked `"sideEffects": false`. The default `Icon` component still includes every icon because it looks icons up by name at runtime, so prefer named imports.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies []:
|
|
17
|
+
- @cypress-design/icon-registry@3.3.2
|
|
18
|
+
|
|
3
19
|
## 3.3.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/Icon.ts
CHANGED
|
@@ -15,19 +15,22 @@ interface Props extends Pick<IconProps, 'name'>, Omit<OpenIconProps, 'name'> {
|
|
|
15
15
|
class?: any
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// PURE so bundlers can drop this component (and the full icon set that
|
|
19
|
+
// compileIcon pulls in) when only the named per-icon components are used
|
|
20
|
+
export default /* @__PURE__ */ defineComponent<Props>({
|
|
19
21
|
// the props here need to exist because of runtime treatment
|
|
20
22
|
// if we don't have them explicit, vuejs will think it's attributes
|
|
21
23
|
// and not pass it down as props to the components
|
|
22
24
|
// but for typescript to pick up the correct prop types, we need to cast it to unknown
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
// concat() instead of an array spread: esbuild treats a spread as a possible
|
|
26
|
+
// side effect and would keep this component even when it is never imported
|
|
27
|
+
props: /* @__PURE__ */ (ICON_COLOR_PROP_NAMES as readonly string[]).concat([
|
|
25
28
|
'interactiveColorsOnGroup',
|
|
26
29
|
'size',
|
|
27
30
|
'name',
|
|
28
31
|
'alt',
|
|
29
32
|
'class',
|
|
30
|
-
] as unknown as undefined,
|
|
33
|
+
]) as unknown as undefined,
|
|
31
34
|
setup(
|
|
32
35
|
// the OpenIconProps helps volar extract the documentation from the props
|
|
33
36
|
// since the IconProps are more restrictive, it will not change the use behavior
|
package/IconVue.cy.tsx
CHANGED
|
@@ -49,17 +49,17 @@ describe('Icon', { viewportWidth: 80, viewportHeight: 80 }, () => {
|
|
|
49
49
|
it('renders multiple times an icon with defs with the generic Icon component', () => {
|
|
50
50
|
mount(() => (
|
|
51
51
|
<div class="p-2">
|
|
52
|
-
<Icon name="browser-webkit" class="
|
|
53
|
-
<Icon name="browser-webkit" class="
|
|
52
|
+
<Icon name="browser-webkit" class="hidden h-16 w-16" />
|
|
53
|
+
<Icon name="browser-webkit" class="h-16 w-16" />
|
|
54
54
|
</div>
|
|
55
55
|
))
|
|
56
56
|
})
|
|
57
57
|
|
|
58
58
|
it('renders multiple times an icon with defs', () => {
|
|
59
59
|
mount(() => (
|
|
60
|
-
<div class="p-2
|
|
61
|
-
<IconBrowserWebkit class="
|
|
62
|
-
<IconBrowserWebkit class="
|
|
60
|
+
<div class="flex p-2">
|
|
61
|
+
<IconBrowserWebkit class="hidden h-16 w-16" />
|
|
62
|
+
<IconBrowserWebkit class="h-16 w-16" />
|
|
63
63
|
</div>
|
|
64
64
|
))
|
|
65
65
|
})
|
|
@@ -68,9 +68,9 @@ describe('Icon', { viewportWidth: 80, viewportHeight: 80 }, () => {
|
|
|
68
68
|
cy.viewport(200, 100)
|
|
69
69
|
const iconVisible = ref(true)
|
|
70
70
|
mount(() => (
|
|
71
|
-
<div class="p-2
|
|
72
|
-
{iconVisible.value ? <IconBrowserWebkit class="
|
|
73
|
-
<IconBrowserWebkit class="
|
|
71
|
+
<div class="flex p-2">
|
|
72
|
+
{iconVisible.value ? <IconBrowserWebkit class="h-16 w-16" /> : null}
|
|
73
|
+
<IconBrowserWebkit class="h-16 w-16" />
|
|
74
74
|
<button onClick={() => (iconVisible.value = !iconVisible.value)}>
|
|
75
75
|
toggle
|
|
76
76
|
</button>
|
|
@@ -86,11 +86,11 @@ describe('Icon', { viewportWidth: 80, viewportHeight: 80 }, () => {
|
|
|
86
86
|
cy.viewport(200, 100)
|
|
87
87
|
const iconVisible = ref(true)
|
|
88
88
|
mount(() => (
|
|
89
|
-
<div class="p-2
|
|
89
|
+
<div class="flex p-2">
|
|
90
90
|
<IconBrowserWebkit
|
|
91
|
-
class={`
|
|
91
|
+
class={`h-16 w-16 ${iconVisible.value ? '' : 'hidden'}`}
|
|
92
92
|
/>
|
|
93
|
-
<IconBrowserWebkit class="
|
|
93
|
+
<IconBrowserWebkit class="h-16 w-16" />
|
|
94
94
|
<button onClick={() => (iconVisible.value = !iconVisible.value)}>
|
|
95
95
|
toggle
|
|
96
96
|
</button>
|
|
@@ -104,9 +104,9 @@ describe('Icon', { viewportWidth: 80, viewportHeight: 80 }, () => {
|
|
|
104
104
|
cy.viewport(200, 200)
|
|
105
105
|
const iconName = ref<'browser-edge' | 'browser-safari'>('browser-safari')
|
|
106
106
|
mount(() => (
|
|
107
|
-
<div class="
|
|
108
|
-
<Icon name={iconName.value} class="
|
|
109
|
-
<Icon name={iconName.value} class="
|
|
107
|
+
<div class="flex h-screen flex-col items-center justify-center p-2">
|
|
108
|
+
<Icon name={iconName.value} class="hidden h-16 w-16" />
|
|
109
|
+
<Icon name={iconName.value} class="h-16 w-16" />
|
|
110
110
|
<button
|
|
111
111
|
onClick={() =>
|
|
112
112
|
(iconName.value =
|
|
@@ -124,14 +124,14 @@ describe('Icon', { viewportWidth: 80, viewportHeight: 80 }, () => {
|
|
|
124
124
|
})
|
|
125
125
|
|
|
126
126
|
it('renders a title element when passed an alt prop', () => {
|
|
127
|
-
mount(() => <IconBrowserWebkit class="
|
|
127
|
+
mount(() => <IconBrowserWebkit class="h-16 w-16" alt="This is a title" />)
|
|
128
128
|
|
|
129
129
|
cy.get('svg title').should('have.text', 'This is a title')
|
|
130
130
|
})
|
|
131
131
|
|
|
132
132
|
it('renders class passed only once', () => {
|
|
133
|
-
mount(() => <IconBrowserWebkit class="
|
|
133
|
+
mount(() => <IconBrowserWebkit class="h-16 w-16" />)
|
|
134
134
|
|
|
135
|
-
cy.get('svg[width="16"]').should('have.attr', 'class', '
|
|
135
|
+
cy.get('svg[width="16"]').should('have.attr', 'class', 'h-16 w-16')
|
|
136
136
|
})
|
|
137
137
|
})
|
package/ReadMe.md
CHANGED
|
@@ -94,7 +94,7 @@ import { IconObjectBook } from '@cypress-design/vue-icon'
|
|
|
94
94
|
</script>
|
|
95
95
|
|
|
96
96
|
<template>
|
|
97
|
-
<button class="group
|
|
97
|
+
<button class="group flex items-center gap-[8px] hover:text-jade-800">
|
|
98
98
|
<IconObjectBook
|
|
99
99
|
size="16"
|
|
100
100
|
strokeColor="blue-600"
|