@cypress-design/react-icon 0.18.2 → 0.20.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/.gitignore +1 -1
- package/.turbo/turbo-build.log +13 -0
- package/CHANGELOG.md +19 -0
- package/IconReact.cy.tsx +1 -1
- package/ReadMe.md +30 -30
- package/_TreeShakableIcons.ts +4363 -0
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/{TreeShakableIcons.d.ts → _TreeShakableIcons.d.ts} +3 -1
- package/dist/_TreeShakableIcons.d.ts.map +1 -0
- package/dist/compileProperties.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.mjs +518 -496
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +524 -501
- package/dist/index.umd.js.map +1 -1
- package/generate-icons.js +1 -1
- package/index.ts +1 -1
- package/package.json +31 -29
- package/tsconfig.build.json +1 -0
- package/tsconfig.json +3 -0
- package/Icon.stories.mdx +0 -113
- package/TreeShakableIcons.ts +0 -4323
- package/dist/TreeShakableIcons.d.ts.map +0 -1
package/.gitignore
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
_TreeShakableIcons.ts
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
$ yarn build:codegen && yarn build:module && yarn build:types
|
|
2
|
+
$ node ./generate-icons.js
|
|
3
|
+
$ rollup -c ./rollup.config.mjs
|
|
4
|
+
[36m
|
|
5
|
+
[1m./index.ts[22m → [1m./dist/index.umd.js, ./dist/index.es.mjs[22m...[39m
|
|
6
|
+
[1m[33m(!) Mixing named and default exports[39m[22m
|
|
7
|
+
[90mhttps://rollupjs.org/configuration-options/#output-exports[39m
|
|
8
|
+
[1mThe following entry modules are using named and default exports together:[22m
|
|
9
|
+
index.ts
|
|
10
|
+
|
|
11
|
+
Consumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
12
|
+
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [1m13.9s[22m[39m
|
|
13
|
+
$ tsc --project ./tsconfig.build.json
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @cypress-design/react-icon
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#196](https://github.com/cypress-io/cypress-design/pull/196) [`fc6d9e4`](https://github.com/cypress-io/cypress-design/commit/fc6d9e4fedcc01fa8e01b868b0fa66d8895c37d0) Thanks [@elevatebart](https://github.com/elevatebart)! - refactor: avoid constants relative imports
|
|
8
|
+
|
|
9
|
+
## 0.19.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#167](https://github.com/cypress-io/cypress-design/pull/167) [`18399c7`](https://github.com/cypress-io/cypress-design/commit/18399c72a52288c67af0935384430d4e4cd24251) Thanks [@elevatebart](https://github.com/elevatebart)! - add icons shape pieces of heaven (sun & moon)
|
|
14
|
+
|
|
15
|
+
- [#178](https://github.com/cypress-io/cypress-design/pull/178) [`d0de778`](https://github.com/cypress-io/cypress-design/commit/d0de77843adb87d8f4804219c6dca8f45b15c650) Thanks [@elevatebart](https://github.com/elevatebart)! - deliver new docs and improved components
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`18399c7`](https://github.com/cypress-io/cypress-design/commit/18399c72a52288c67af0935384430d4e4cd24251), [`d0de778`](https://github.com/cypress-io/cypress-design/commit/d0de77843adb87d8f4804219c6dca8f45b15c650)]:
|
|
20
|
+
- @cypress-design/icon-registry@0.21.0
|
|
21
|
+
|
|
3
22
|
## 0.18.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/IconReact.cy.tsx
CHANGED
package/ReadMe.md
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
# Icon
|
|
2
2
|
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @cypress-design/react-icon
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
or with yarn
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @cypress-design/react-icon
|
|
13
|
+
```
|
|
14
|
+
|
|
3
15
|
## Usage
|
|
4
16
|
|
|
5
17
|
The simple way using the Icon component
|
|
6
18
|
|
|
7
|
-
```tsx
|
|
8
|
-
import
|
|
19
|
+
```tsx live
|
|
20
|
+
import Icon from '@cypress-design/react-icon'
|
|
9
21
|
|
|
10
22
|
export const MyButtonWithIcon = () => {
|
|
11
23
|
return (
|
|
12
|
-
<button>
|
|
24
|
+
<button className="flex items-center gap-[8px] p-[8px] border-1 border-red-500">
|
|
13
25
|
<Icon
|
|
14
|
-
name="book"
|
|
26
|
+
name="object-book"
|
|
15
27
|
size="16"
|
|
16
28
|
strokeColor="blue-600"
|
|
17
29
|
fillColor="red-200"
|
|
@@ -23,16 +35,16 @@ export const MyButtonWithIcon = () => {
|
|
|
23
35
|
}
|
|
24
36
|
```
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
We can also import each icon components separately. When we use named imports, the results becomes tree-shakable (more optimized).
|
|
39
|
+
This means that the final bundle will not contain any of the unused icons code.
|
|
40
|
+
Only imported icons will end up in your app or website js.
|
|
27
41
|
|
|
28
|
-
```tsx
|
|
29
|
-
import {
|
|
42
|
+
```tsx live
|
|
43
|
+
import { IconObjectBook } from '@cypress-design/react-icon'
|
|
30
44
|
|
|
31
45
|
export const MyButtonWithIcon = () => {
|
|
32
46
|
return (
|
|
33
|
-
<
|
|
34
|
-
<IconBook size="16" strokeColor="indigo-600" fillColor="red-200" />
|
|
35
|
-
</button>
|
|
47
|
+
<IconObjectBook size="16" strokeColor="indigo-600" fillColor="red-200" />
|
|
36
48
|
)
|
|
37
49
|
}
|
|
38
50
|
```
|
|
@@ -41,13 +53,13 @@ Should you need to change the color of the icon on `hover` or `focus` prefix the
|
|
|
41
53
|
|
|
42
54
|
Here, the `strokeColor` will change on hover from indigo to jade
|
|
43
55
|
|
|
44
|
-
```tsx
|
|
45
|
-
import {
|
|
56
|
+
```tsx live
|
|
57
|
+
import { IconObjectBook } from '@cypress-design/react-icon'
|
|
46
58
|
|
|
47
59
|
export const MyButtonWithIcon = () => {
|
|
48
60
|
return (
|
|
49
61
|
<button>
|
|
50
|
-
<
|
|
62
|
+
<IconObjectBook
|
|
51
63
|
size="16"
|
|
52
64
|
strokeColor="indigo-600"
|
|
53
65
|
hoverStrokeColor="jade-600"
|
|
@@ -62,14 +74,14 @@ This prop will change all the pseudo prefixes to be group focused instead of tri
|
|
|
62
74
|
|
|
63
75
|
To achieve the same goal, in WindiCSS, we would use `group-hover:` instead of `hover:`.
|
|
64
76
|
|
|
65
|
-
```tsx
|
|
66
|
-
import {
|
|
77
|
+
```tsx live
|
|
78
|
+
import { IconObjectBook } from '@cypress-design/react-icon'
|
|
67
79
|
|
|
68
80
|
export const MyButtonWithIcon = () => {
|
|
69
81
|
return (
|
|
70
|
-
<button className="group hover:text-jade-800">
|
|
71
|
-
<
|
|
72
|
-
size="
|
|
82
|
+
<button className="flex items-center gap-[8px] group hover:text-jade-800">
|
|
83
|
+
<IconObjectBook
|
|
84
|
+
size="48"
|
|
73
85
|
strokeColor="indigo-600"
|
|
74
86
|
hoverStrokeColor="jade-600"
|
|
75
87
|
interactiveColorsOnGroup
|
|
@@ -79,15 +91,3 @@ export const MyButtonWithIcon = () => {
|
|
|
79
91
|
)
|
|
80
92
|
}
|
|
81
93
|
```
|
|
82
|
-
|
|
83
|
-
## install
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
npm install @cypress-design/react-icon
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
or with yarn
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
yarn add @cypress-design/react-icon
|
|
93
|
-
```
|