@mxenabled/mx-icons 0.4.1 → 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 CHANGED
@@ -1,50 +1,77 @@
1
- # React + TypeScript + Vite
1
+ # MX Icon Component Library (based on material symbols)
2
+ #### @mxenabled/mx-icons
2
3
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+ ### Description
4
5
 
5
- Currently, two official plugins are available:
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
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
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
- ## Expanding the ESLint configuration
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
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
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
- - Configure the top-level `parserOptions` property like this:
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
- ```js
17
- export default tseslint.config({
18
- languageOptions: {
19
- // other options...
20
- parserOptions: {
21
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
22
- tsconfigRootDir: import.meta.dirname,
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
- - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29
- - Optionally add `...tseslint.configs.stylisticTypeChecked`
30
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31
-
32
- ```js
33
- // eslint.config.js
34
- import react from 'eslint-plugin-react'
35
-
36
- export default tseslint.config({
37
- // Set the react version
38
- settings: { react: { version: '18.3' } },
39
- plugins: {
40
- // Add the react plugin
41
- react,
42
- },
43
- rules: {
44
- // other rules...
45
- // Enable its recommended rules
46
- ...react.configs.recommended.rules,
47
- ...react.configs['jsx-runtime'].rules,
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;