@mxenabled/mx-icons 0.4.3 → 1.0.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/README.md +69 -42
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +67 -63
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,50 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MX Icon Component Library (based on material symbols)
|
|
2
|
+
#### @mxenabled/mx-icons
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
### Description
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
This library provides React components for a subset of material symbol icons. That subset of icons is defined in the
|
|
7
|
+
`config.json` configuration file. Additional icons can be added by appended to the `material_icons` list and then
|
|
8
|
+
running a script that will build new React components for the added icons.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
10
|
+
### Config file
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"weight": 300,
|
|
15
|
+
"size": 48,
|
|
16
|
+
"material_icon_type": "materialsymbolsrounded",
|
|
17
|
+
"material_icons": [
|
|
18
|
+
"account_balance",
|
|
19
|
+
"add",
|
|
20
|
+
"add_box",
|
|
21
|
+
"wall_art",
|
|
22
|
+
"wallet"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
- `weight` - The line thickness to use for the material symbols `[100-700]`
|
|
27
|
+
- `size` - The SVG size `[20, 24, 40, 48]`
|
|
28
|
+
- `material_icon_type` - The type of icons `[materialsymbolsoutlined, materialsymbolsrounded, materialsymbolssharp]`
|
|
29
|
+
- `material_icons` - A list of material icon names to include in the library
|
|
11
30
|
|
|
12
|
-
|
|
31
|
+
### Adding Icons
|
|
32
|
+
- Edit `config.json` file and add new material symbol icon name in pascal_case (keep list in alphabetical order)
|
|
33
|
+
- See https://fonts.google.com/icons?icon.style=Rounded for full list of material symbol icons
|
|
34
|
+
- Run `buildIcons.py` to generate new components and add them to the `IconList`
|
|
35
|
+
- Install requests python package: ```pip3 install requests```
|
|
36
|
+
- Run script: ```./buildIcons.py```
|
|
37
|
+
- Create MR
|
|
38
|
+
- Publish package after MR has been merged (will be automated in the future)
|
|
13
39
|
|
|
14
|
-
|
|
40
|
+
### Using Icons
|
|
41
|
+
There are 2 ways to utilize the icons from this library. There is a backwards compatible `<Icon />` component or
|
|
42
|
+
directly using the named icon component `<AccountBalance />`
|
|
15
43
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
```
|
|
44
|
+
- Dependencies
|
|
45
|
+
- React 19
|
|
46
|
+
- MUI 6
|
|
47
|
+
- Installing MX Icon library
|
|
48
|
+
- npm `npm install @mxenabled/mx-icons`
|
|
49
|
+
- yarn `yarn add @mxenabled/mx-icons`
|
|
50
|
+
#### Usage
|
|
27
51
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
##### Icon component
|
|
53
|
+
```tsx
|
|
54
|
+
import { Icon } from "@mxenabled/mx-icons";
|
|
55
|
+
|
|
56
|
+
<Icon name="account_balance" />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
###### Props
|
|
60
|
+
- color (optional) - MUI Theme color (primary, secondary, success, error, etc)
|
|
61
|
+
- fill (optional) - `True` or `False` (Defaults to `False`)
|
|
62
|
+
- name (required) - material symbol name in pascal_case
|
|
63
|
+
- size (optional) - The font size of the icon (Defaults to `20`)
|
|
64
|
+
- sx (optional) - MUI SX Prop
|
|
65
|
+
- weight (optional) - DEPRECATED - Weight is hardcoded in config (Defaults to `300`)
|
|
66
|
+
|
|
67
|
+
##### Named icon component
|
|
68
|
+
```tsx
|
|
69
|
+
import { AccountBalance } from "@mxenabled/mx-icons";
|
|
70
|
+
|
|
71
|
+
<AccountBalance />
|
|
72
|
+
```
|
|
73
|
+
###### Props
|
|
74
|
+
- color - MUI Theme color (primary, secondary, success, error, etc)
|
|
75
|
+
- filled (optional) - `True` or `False` (Defaults to `False`)
|
|
76
|
+
- size (optional) - The font size of the icon (Defaults to `20`)
|
|
77
|
+
- sx (optional) - MUI SX Prop
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export declare const ExpandLess: ({ color, filled, size, sx }: MxIconProps) => J
|
|
|
63
63
|
|
|
64
64
|
export declare const ExpandMore: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
65
65
|
|
|
66
|
+
export declare const Favorite: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
67
|
+
|
|
66
68
|
export declare const FilterAlt: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
67
69
|
|
|
68
70
|
export declare const Flag: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
@@ -71,6 +73,8 @@ export declare const Flare: ({ color, filled, size, sx }: MxIconProps) => JSX.El
|
|
|
71
73
|
|
|
72
74
|
export declare const FormatListBulleted: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
73
75
|
|
|
76
|
+
export declare const Home: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
77
|
+
|
|
74
78
|
export declare const HomeWork: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
75
79
|
|
|
76
80
|
export declare const House: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
@@ -108,10 +112,12 @@ export declare const IconList: {
|
|
|
108
112
|
error: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
109
113
|
expand_less: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
110
114
|
expand_more: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
115
|
+
favorite: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
111
116
|
filter_alt: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
112
117
|
flag: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
113
118
|
flare: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
114
119
|
format_list_bulleted: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
120
|
+
home: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
115
121
|
home_work: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
116
122
|
house: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|
|
117
123
|
ios_share: ({ color, filled, size, sx }: MxIconProps) => JSX.Element;
|