@ultraviolet/icons 2.12.9 → 2.12.10

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.
Files changed (2) hide show
  1. package/README.md +37 -2
  2. package/package.json +4 -3
package/README.md CHANGED
@@ -2,12 +2,47 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/%40ultraviolet%2Ficons.svg)](https://badge.fury.io/js/%40ultraviolet%2Ficons)
4
4
 
5
- Ultraviolet Icons is a set of SVG icons and components related to icons.
5
+ Ultraviolet Icons is a set of components based on SVG icons. It provides a set of icons that can be used in your projects.
6
6
 
7
7
  ## Installation
8
8
 
9
+ For icons to work you will need to install some extra dependencies, such as `@ultraviolet/themes` and `@emotion/react`.
10
+
9
11
  ```sh
10
- $ pnpm add @ultraviolet/icons
12
+ $ pnpm add @ultraviolet/icons @ultraviolet/themes @emotion/react
13
+ ```
14
+
15
+ You can then add `ThemeProvider` to your applications and use the provided theme from `@ultraviolet/themes` or use your own.
16
+
17
+ ```tsx
18
+ import { ThemeProvider } from '@emotion/react'
19
+ import { ProductIcon } from '@ultraviolet/icons'
20
+ import { consoleLightTheme } from '@ultraviolet/themes'
21
+
22
+ const App = () => (
23
+ <ThemeProvider theme={consoleLightTheme}>
24
+ <ProductIcon name="sdkGo" size="medium" variant="primary"/>
25
+ </ThemeProvider>
26
+ )
27
+ ```
28
+
29
+ > **Note**:
30
+ > To generate your own theme easily you can check the [theme generator](https://storybook.ultraviolet.scaleway.com/?path=/docs/tools-theme-generator--docs).
31
+
32
+ N.B. To allow typescript theme typings with `@emotion/styled` components,
33
+ you'll have to define the `@emotion/react` module `Theme` interface in your project.
34
+
35
+ Example, in a `emotion.d.ts` file:
36
+
37
+ ```ts
38
+ import '@emotion/react'
39
+ import type { consoleLightTheme } from '@ultraviolet/themes'
40
+
41
+ type UltravioletUITheme = typeof consoleLightTheme
42
+
43
+ declare module '@emotion/react' {
44
+ export interface Theme extends UltravioletUITheme {}
45
+ }
11
46
  ```
12
47
 
13
48
  ## Documentation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/icons",
3
- "version": "2.12.9",
3
+ "version": "2.12.10",
4
4
  "description": "Ultraviolet Icons",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -59,10 +59,11 @@
59
59
  "devDependencies": {
60
60
  "@babel/core": "7.24.5",
61
61
  "@types/react": "18.3.1",
62
- "@types/react-dom": "18.3.0"
62
+ "@types/react-dom": "18.3.0",
63
+ "@utils/test": "0.0.1"
63
64
  },
64
65
  "dependencies": {
65
- "@ultraviolet/themes": "1.10.2"
66
+ "@ultraviolet/themes": "1.11.0"
66
67
  },
67
68
  "scripts": {
68
69
  "prebuild": "shx rm -rf dist",