Skip to content

Commit 262baf9

Browse files
authored
chore: onboard @carbon/icons-motion to IBM Telemetry 🚀 (#274)
* chore: add ibm telemetry * docs: fix invalid react example
1 parent 81a0660 commit 262baf9

File tree

5 files changed

+779
-66
lines changed

5 files changed

+779
-66
lines changed

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ build
99
dist
1010
.rpt2_cache
1111

12+
# ide
13+
.vscode
14+
1215
# misc
1316
.DS_Store
1417
.env

‎README.md

+38-26
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# Carbon Icon Animations
22

33
This is a package of animated icons which mirrors the icons in [Carbon Design System](https://carbondesignsystem.com/guidelines/icons/library/) icons.
4-
It enables developers to import an animated icon directly from this library, in place of importing the existing static icon from the Carbon Design System library. The animated icons are implemented as React components. Since they do not make use of Carbon's icon components directly, they are not tied to a specific version of Carbon, and can be used in any React project.
4+
It enables developers to import an animated icon directly from this library, in place of importing the existing static icon from the Carbon Design System library. The animated icons are implemented as React components. Since they do not make use of Carbon's icon components directly, they are not tied to a specific version of Carbon, and can be used in any React project.
55

66
Check out what the animations look like in this [example app](https://carbon-design-system.github.io/icons-motion/).
77

88
We will be adding onto this library one category at a time - the current release includes the **Navigation** icons and **Operations** icons. The **Formatting** icons are currently in progress, and toggle icons are being worked on as well.
9-
If you want to request an icon/category to be animated, please open an issue using the **New icon animation** template. Working together with the Carbon team, we will prioritize the categories that will be most frequently used.
9+
If you want to request an icon/category to be animated, please open an issue using the **New icon animation** template. Working together with the Carbon team, we will prioritize the categories that will be most frequently used.
1010

1111
We will do our very best to keep these icons in sync with the Carbon icons but if there is a change to the Carbon icon, it may not yet be reflected in our library- if you encounter this, please open a **Update icon animation** issue to alert us.
1212
<br />
1313

1414
## Using the icons
1515

1616
### Installation
17-
To use the icons in your project, first install the package:
17+
18+
To use the icons in your project, first install the package:
1819

1920
```bash
2021
npm install @carbon/icons-motion
@@ -25,34 +26,31 @@ npm install @carbon/icons-motion
2526
Example:
2627
How to import and use the icon component and CSS file from the package.
2728

28-
This example shows how to import one specific icon `HomeMotion` and use it a component in an app.
29-
29+
This example shows how to import one specific icon `HomeMotion` and use it a component in an app.
3030

3131
App.js
32+
3233
```jsx
3334
import { HomeMotion } from '@carbon/icons-motion'
3435
import '@carbon/icons-motion/dist/index.css'
3536

36-
const myComponent = () => {
37-
<HomeMotion
38-
isAnimating={false}
39-
size={32}
40-
/>
41-
}
37+
const myComponent = () => <HomeMotion isAnimating={false} size={32} />
4238
```
4339

4440
The component takes two props:
41+
4542
- `isAnimating` is a boolean; to trigger the animation, change this prop to `true`
46-
- `size` is an integer which will set the width and height of the icon in px
43+
- `size` is an integer which will set the width and height of the icon in px
4744

48-
**Important** Your app will need to update the `isAnimating` prop to `true` in order to make the icon animate. You can decide when/how this prop change should be triggered, depending on your specific use case.
45+
**Important** Your app will need to update the `isAnimating` prop to `true` in order to make the icon animate. You can decide when/how this prop change should be triggered, depending on your specific use case.
4946

5047
Example:
5148
Here's how to make an icon animate on mouseEnter of the `div` with the className of `icon-tile`, similar to the examples shown in the demo app at `./example/src/components/NavigationSection folder`.
5249

5350
Note in this example, all icons are imported as `*` so to use the specific icon, use `<icons.IconName>`
5451

5552
App.js
53+
5654
```jsx
5755
import React, { useState } from 'react'
5856
import * as icons from '@carbon/icons-motion'
@@ -62,49 +60,63 @@ const [homeAnimating, setHomeAnimating] = useState(false)
6260

6361
function App() {
6462
return (
65-
<div className="App">
63+
<div className='App'>
6664
<div
6765
className='icon-tile'
6866
onMouseEnter={() => setHomeAnimating(true)}
6967
onMouseLeave={() => setHomeAnimating(false)}
7068
>
7169
<h3>Home</h3>
72-
<icons.HomeMotion
73-
isAnimating={homeAnimating}
74-
size={32} />
75-
</div>
76-
</div>)
77-
}
78-
79-
export default App;
70+
<icons.HomeMotion isAnimating={homeAnimating} size={32} />
71+
</div>
72+
</div>
73+
)
74+
}
75+
76+
export default App
8077
```
8178

8279
Additional examples coming soon!
8380

8481
<br />
8582

8683
## Contributing
87-
We welcome everyone who would like to contribute! Check out our [Contribution guidelines](https://github.com/carbon-design-system/icons-motion/blob/main/.github/CONTRIBUTING.md) to get started, and don't hesitate to reach out if you have any questions!
84+
85+
We welcome everyone who would like to contribute! Check out our [Contribution guidelines](https://github.com/carbon-design-system/icons-motion/blob/main/.github/CONTRIBUTING.md) to get started, and don't hesitate to reach out if you have any questions!
8886

8987
[All Contributors](https://github.com/all-contributors/all-contributors) table coming soon!
9088

9189
## Feedback
92-
This library is in constant evolution, and we welcome any feedback to help it improve!
90+
91+
This library is in constant evolution, and we welcome any feedback to help it improve!
9392

9493
We'd especially love feedback in the following areas:
94+
9595
- New icons needed - propose additional icons you would like to see animated
9696
- Animation feedback - too fast/slow/bouncy/whatever; conformance to existing animation guidelines
9797
- Package feedback - improvements to code quality, efficiency, dependencies etc related to the actual package icon components
98-
- Example app feedback - ideas on how to make the included demo app super engaging
98+
- Example app feedback - ideas on how to make the included demo app super engaging
9999
- Documentation feedback - Is the ReadMe clear? Did you have the information you needed to successfully edit/create icons, or use icons in your project?
100-
- Implementation feedback - Did the icons work for your use case? Did you need different props?
100+
- Implementation feedback - Did the icons work for your use case? Did you need different props?
101101

102102
<br />
103103

104104
## Contributors
105+
105106
This effort is lead by the Animated Icon Workgroup members: @kristastarr, @johnbister, @Motion-Mike, @silvio-hajdin
106107

107108
<br />
108109

110+
## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry
111+
112+
This package uses IBM Telemetry to collect metrics data. By installing this package as a dependency
113+
you are agreeing to telemetry collection. To opt out, see
114+
[Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
115+
For more information on the data being collected, please see the
116+
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).
117+
118+
<br />
119+
109120
## License
121+
110122
Licensed under the [Apache 2.0 License](https://github.com/carbon-design-system/carbon-motion/blob/main/LICENSE).

0 commit comments

Comments
 (0)