@fringeworks/react-icon-material-symbols 0.3.0 → 0.3.1
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.ja.md +21 -0
- package/README.md +21 -0
- package/_styles.scss.cjs +4 -4
- package/package.json +42 -2
- package/with-css/MaterialSymbolOutlined/index.cjs +8 -0
- package/with-css/MaterialSymbolOutlined/index.d.cts +3 -0
- package/with-css/MaterialSymbolOutlined/index.d.mts +3 -0
- package/with-css/MaterialSymbolOutlined/index.mjs +6 -0
- package/with-css/MaterialSymbolRounded/index.cjs +8 -0
- package/with-css/MaterialSymbolRounded/index.d.cts +3 -0
- package/with-css/MaterialSymbolRounded/index.d.mts +3 -0
- package/with-css/MaterialSymbolRounded/index.mjs +6 -0
- package/with-css/MaterialSymbolSharp/index.cjs +8 -0
- package/with-css/MaterialSymbolSharp/index.d.cts +3 -0
- package/with-css/MaterialSymbolSharp/index.d.mts +3 -0
- package/with-css/MaterialSymbolSharp/index.mjs +6 -0
- package/with-css/index.cjs +15 -0
- package/with-css/index.d.cts +8 -0
- package/with-css/index.d.mts +8 -0
- package/with-css/index.mjs +11 -0
package/README.ja.md
CHANGED
|
@@ -30,6 +30,26 @@ import '@fringeworks/react-icon-material-symbols/font-outlined.css';
|
|
|
30
30
|
|
|
31
31
|
`value` の型は Material Symbols のアイコンの名前(`MaterialSymbolValue`)なので、補完が効き、書き間違いは型エラーになります。
|
|
32
32
|
|
|
33
|
+
### CSS とフォントを自動で読み込む(with-css)
|
|
34
|
+
|
|
35
|
+
`with-css` の入口から部品を import すると、見た目の CSS とフォントの読み込みも一緒に読み込まれます。CSS やフォントを別に読み込まずに、部品を import するだけで使えます。CSS の import を扱えるバンドラー(Vite・webpack・Next.js など)が要ります。
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { MaterialSymbolOutlined } from '@fringeworks/react-icon-material-symbols/with-css/MaterialSymbolOutlined';
|
|
39
|
+
|
|
40
|
+
<MaterialSymbolOutlined value="home" />;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| 入口 | 読み込むもの |
|
|
44
|
+
| --------------------------------- | ------------------------------------------------------------- |
|
|
45
|
+
| `with-css` | 3つの部品。`styles.css` と3つの種類のフォント |
|
|
46
|
+
| `with-css/MaterialSymbolOutlined` | `MaterialSymbolOutlined`。`styles.css` と Outlined のフォント |
|
|
47
|
+
| `with-css/MaterialSymbolRounded` | `MaterialSymbolRounded`。`styles.css` と Rounded のフォント |
|
|
48
|
+
| `with-css/MaterialSymbolSharp` | `MaterialSymbolSharp`。`styles.css` と Sharp のフォント |
|
|
49
|
+
|
|
50
|
+
- フォントは、下の「フォントの読み込み」の、このパッケージの入口(`font-<種類>.css`)と同じものです。`with-css` は3つの種類のフォントを読み込みますが、ブラウザーは描いた種類のフォントだけをダウンロードします(ビルドの出力には、3つの種類のフォントのファイルが置かれます)
|
|
51
|
+
- Google Fonts や自分で配るフォントを使うときは、`with-css` でない入口から import します
|
|
52
|
+
|
|
33
53
|
### 3つの種類
|
|
34
54
|
|
|
35
55
|
Material Symbols の種類ごとに部品が分かれています。アプリでは種類を1つにそろえることが多いので、短い名前は import の別名で付けてください。
|
|
@@ -259,6 +279,7 @@ MaterialSymbolSharp(props: MaterialSymbolProps): ReactElement
|
|
|
259
279
|
|
|
260
280
|
| 入口 | 説明 |
|
|
261
281
|
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
282
|
+
| `with-css`・`with-css/<部品>` | 部品を export し、`styles.css` とフォントの読み込みも読み込む JS の入口(上の「CSS とフォントを自動で読み込む」) |
|
|
262
283
|
| `styles.css` | アイコンの見た目(react-icon の箱の CSS を含む)。フォントは含まない |
|
|
263
284
|
| `font-outlined.css`・`font-rounded.css`・`font-sharp.css` | 種類ごとのフォントの読み込み(npm の `material-symbols` の `@font-face`)。Google Fonts や自分で配るフォントを使うときは読み込まない |
|
|
264
285
|
|
package/README.md
CHANGED
|
@@ -30,6 +30,26 @@ import '@fringeworks/react-icon-material-symbols/font-outlined.css';
|
|
|
30
30
|
|
|
31
31
|
The type of `value` is the Material Symbols icon names (`MaterialSymbolValue`), so you get completion, and typos are type errors.
|
|
32
32
|
|
|
33
|
+
### Loading the CSS and font automatically (with-css)
|
|
34
|
+
|
|
35
|
+
When you import a component from the `with-css` entry points, the styles and the font loading are loaded too. You can use the component just by importing it, without loading the CSS or the font separately. You need a bundler that handles CSS imports (Vite, webpack, Next.js, and so on).
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { MaterialSymbolOutlined } from '@fringeworks/react-icon-material-symbols/with-css/MaterialSymbolOutlined';
|
|
39
|
+
|
|
40
|
+
<MaterialSymbolOutlined value="home" />;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Entry point | What it loads |
|
|
44
|
+
| --------------------------------- | -------------------------------------------------------------------- |
|
|
45
|
+
| `with-css` | The three components. `styles.css` and the fonts of all three styles |
|
|
46
|
+
| `with-css/MaterialSymbolOutlined` | `MaterialSymbolOutlined`. `styles.css` and the Outlined font |
|
|
47
|
+
| `with-css/MaterialSymbolRounded` | `MaterialSymbolRounded`. `styles.css` and the Rounded font |
|
|
48
|
+
| `with-css/MaterialSymbolSharp` | `MaterialSymbolSharp`. `styles.css` and the Sharp font |
|
|
49
|
+
|
|
50
|
+
- The fonts are the same as this package's entry points (`font-<style>.css`) in "Loading the font" below. `with-css` loads the fonts of all three styles, but the browser downloads only the fonts of the styles you draw (the build output contains the font files of all three styles).
|
|
51
|
+
- When you use Google Fonts or fonts you serve yourself, import from the entry points without `with-css`.
|
|
52
|
+
|
|
33
53
|
### Three styles
|
|
34
54
|
|
|
35
55
|
There is one component per Material Symbols style. Apps usually stick to one style, so give it a short name with an import alias.
|
|
@@ -259,6 +279,7 @@ When you set `opticalSize` with a CSS variable, also add the `frg-materialsymbol
|
|
|
259
279
|
|
|
260
280
|
| Entry point | Description |
|
|
261
281
|
| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| `with-css`, `with-css/<component>` | JS entry points that export the components and also load `styles.css` and the font loading (see "Loading the CSS and font automatically" above) |
|
|
262
283
|
| `styles.css` | The icon styles (including react-icon's box CSS). Does not include the fonts |
|
|
263
284
|
| `font-outlined.css`, `font-rounded.css`, `font-sharp.css` | Loads the font for each style (the `@font-face` from the npm `material-symbols` package). Do not load them when you use Google Fonts or serve the font yourself |
|
|
264
285
|
|
package/_styles.scss.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
require("./font-outlined.css");
|
|
3
|
+
require("./font-rounded.css");
|
|
4
|
+
require("./font-sharp.css");
|
|
5
|
+
require("./styles.css");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fringeworks/react-icon-material-symbols",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A library some will find handy, for using Material Symbols as typed React components with variable font axes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -59,6 +59,46 @@
|
|
|
59
59
|
"default": "./MaterialSymbolSharp/index.cjs"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
"./with-css": {
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./with-css/index.d.mts",
|
|
65
|
+
"default": "./with-css/index.mjs"
|
|
66
|
+
},
|
|
67
|
+
"require": {
|
|
68
|
+
"types": "./with-css/index.d.cts",
|
|
69
|
+
"default": "./with-css/index.cjs"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./with-css/MaterialSymbolOutlined": {
|
|
73
|
+
"import": {
|
|
74
|
+
"types": "./with-css/MaterialSymbolOutlined/index.d.mts",
|
|
75
|
+
"default": "./with-css/MaterialSymbolOutlined/index.mjs"
|
|
76
|
+
},
|
|
77
|
+
"require": {
|
|
78
|
+
"types": "./with-css/MaterialSymbolOutlined/index.d.cts",
|
|
79
|
+
"default": "./with-css/MaterialSymbolOutlined/index.cjs"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"./with-css/MaterialSymbolRounded": {
|
|
83
|
+
"import": {
|
|
84
|
+
"types": "./with-css/MaterialSymbolRounded/index.d.mts",
|
|
85
|
+
"default": "./with-css/MaterialSymbolRounded/index.mjs"
|
|
86
|
+
},
|
|
87
|
+
"require": {
|
|
88
|
+
"types": "./with-css/MaterialSymbolRounded/index.d.cts",
|
|
89
|
+
"default": "./with-css/MaterialSymbolRounded/index.cjs"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"./with-css/MaterialSymbolSharp": {
|
|
93
|
+
"import": {
|
|
94
|
+
"types": "./with-css/MaterialSymbolSharp/index.d.mts",
|
|
95
|
+
"default": "./with-css/MaterialSymbolSharp/index.mjs"
|
|
96
|
+
},
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./with-css/MaterialSymbolSharp/index.d.cts",
|
|
99
|
+
"default": "./with-css/MaterialSymbolSharp/index.cjs"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
62
102
|
"./package.json": "./package.json",
|
|
63
103
|
"./styles.css": "./styles.css",
|
|
64
104
|
"./font-outlined.css": "./font-outlined.css",
|
|
@@ -69,7 +109,7 @@
|
|
|
69
109
|
"module": "./index.mjs",
|
|
70
110
|
"types": "./index.d.cts",
|
|
71
111
|
"dependencies": {
|
|
72
|
-
"@fringeworks/react-contract": "^0.3.
|
|
112
|
+
"@fringeworks/react-contract": "^0.3.3",
|
|
73
113
|
"@fringeworks/react-icon": "^0.2.0",
|
|
74
114
|
"@fringeworks/react-merge": "^0.9.2",
|
|
75
115
|
"material-symbols": "^0.49.0"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_MaterialSymbolOutlined_MaterialSymbolOutlined = require("../../MaterialSymbolOutlined/MaterialSymbolOutlined.cjs");
|
|
3
|
+
require("../../font-outlined.css");
|
|
4
|
+
require("../../styles.css");
|
|
5
|
+
require("../../MaterialSymbolOutlined/index.cjs");
|
|
6
|
+
|
|
7
|
+
exports.MaterialSymbolOutlined = require_MaterialSymbolOutlined_MaterialSymbolOutlined.default;
|
|
8
|
+
exports.default = require_MaterialSymbolOutlined_MaterialSymbolOutlined.default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import MaterialSymbolOutlined from "../../MaterialSymbolOutlined/MaterialSymbolOutlined.mjs";
|
|
2
|
+
import "../../font-outlined.css";
|
|
3
|
+
import "../../styles.css";
|
|
4
|
+
import "../../MaterialSymbolOutlined/index.mjs";
|
|
5
|
+
|
|
6
|
+
export { MaterialSymbolOutlined, MaterialSymbolOutlined as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_MaterialSymbolRounded_MaterialSymbolRounded = require("../../MaterialSymbolRounded/MaterialSymbolRounded.cjs");
|
|
3
|
+
require("../../font-rounded.css");
|
|
4
|
+
require("../../styles.css");
|
|
5
|
+
require("../../MaterialSymbolRounded/index.cjs");
|
|
6
|
+
|
|
7
|
+
exports.MaterialSymbolRounded = require_MaterialSymbolRounded_MaterialSymbolRounded.default;
|
|
8
|
+
exports.default = require_MaterialSymbolRounded_MaterialSymbolRounded.default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import MaterialSymbolRounded from "../../MaterialSymbolRounded/MaterialSymbolRounded.mjs";
|
|
2
|
+
import "../../font-rounded.css";
|
|
3
|
+
import "../../styles.css";
|
|
4
|
+
import "../../MaterialSymbolRounded/index.mjs";
|
|
5
|
+
|
|
6
|
+
export { MaterialSymbolRounded, MaterialSymbolRounded as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_MaterialSymbolSharp_MaterialSymbolSharp = require("../../MaterialSymbolSharp/MaterialSymbolSharp.cjs");
|
|
3
|
+
require("../../font-sharp.css");
|
|
4
|
+
require("../../styles.css");
|
|
5
|
+
require("../../MaterialSymbolSharp/index.cjs");
|
|
6
|
+
|
|
7
|
+
exports.MaterialSymbolSharp = require_MaterialSymbolSharp_MaterialSymbolSharp.default;
|
|
8
|
+
exports.default = require_MaterialSymbolSharp_MaterialSymbolSharp.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_constants = require("../constants.cjs");
|
|
3
|
+
const require_MaterialSymbolOutlined_MaterialSymbolOutlined = require("../MaterialSymbolOutlined/MaterialSymbolOutlined.cjs");
|
|
4
|
+
const require_MaterialSymbolRounded_MaterialSymbolRounded = require("../MaterialSymbolRounded/MaterialSymbolRounded.cjs");
|
|
5
|
+
const require_MaterialSymbolSharp_MaterialSymbolSharp = require("../MaterialSymbolSharp/MaterialSymbolSharp.cjs");
|
|
6
|
+
require("../font-outlined.css");
|
|
7
|
+
require("../font-rounded.css");
|
|
8
|
+
require("../font-sharp.css");
|
|
9
|
+
require("../styles.css");
|
|
10
|
+
require("../index.cjs");
|
|
11
|
+
|
|
12
|
+
exports.MaterialSymbolOutlined = require_MaterialSymbolOutlined_MaterialSymbolOutlined.default;
|
|
13
|
+
exports.MaterialSymbolRounded = require_MaterialSymbolRounded_MaterialSymbolRounded.default;
|
|
14
|
+
exports.MaterialSymbolSharp = require_MaterialSymbolSharp_MaterialSymbolSharp.default;
|
|
15
|
+
exports.materialSymbolDesignDefinition = require_constants.materialSymbolDesignDefinition;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { materialSymbolDesignDefinition } from "../constants.cjs";
|
|
2
|
+
import MaterialSymbolOutlined from "../MaterialSymbolOutlined/MaterialSymbolOutlined.cjs";
|
|
3
|
+
import MaterialSymbolRounded from "../MaterialSymbolRounded/MaterialSymbolRounded.cjs";
|
|
4
|
+
import MaterialSymbolSharp from "../MaterialSymbolSharp/MaterialSymbolSharp.cjs";
|
|
5
|
+
import { MaterialSymbolValue } from "../_internal/_materialSymbolValue.cjs";
|
|
6
|
+
import { DesignDefinition, DesignPartDefinition, DesignPropertyValues, DesignState, DesignValue, FontIconWebFont, MaterialSymbolComponent, MaterialSymbolDesign, MaterialSymbolProps } from "../types.cjs";
|
|
7
|
+
import "../index.cjs";
|
|
8
|
+
export { type DesignDefinition, type DesignPartDefinition, type DesignPropertyValues, type DesignState, type DesignValue, type FontIconWebFont, type MaterialSymbolComponent, type MaterialSymbolDesign, MaterialSymbolOutlined, type MaterialSymbolProps, MaterialSymbolRounded, MaterialSymbolSharp, type MaterialSymbolValue, materialSymbolDesignDefinition };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { materialSymbolDesignDefinition } from "../constants.mjs";
|
|
2
|
+
import MaterialSymbolRounded from "../MaterialSymbolRounded/MaterialSymbolRounded.mjs";
|
|
3
|
+
import MaterialSymbolSharp from "../MaterialSymbolSharp/MaterialSymbolSharp.mjs";
|
|
4
|
+
import { MaterialSymbolValue } from "../_internal/_materialSymbolValue.mjs";
|
|
5
|
+
import { DesignDefinition, DesignPartDefinition, DesignPropertyValues, DesignState, DesignValue, FontIconWebFont, MaterialSymbolComponent, MaterialSymbolDesign, MaterialSymbolProps } from "../types.mjs";
|
|
6
|
+
import "../index.mjs";
|
|
7
|
+
import MaterialSymbolOutlined from "../MaterialSymbolOutlined/MaterialSymbolOutlined.mjs";
|
|
8
|
+
export { type DesignDefinition, type DesignPartDefinition, type DesignPropertyValues, type DesignState, type DesignValue, type FontIconWebFont, type MaterialSymbolComponent, type MaterialSymbolDesign, MaterialSymbolOutlined, type MaterialSymbolProps, MaterialSymbolRounded, MaterialSymbolSharp, type MaterialSymbolValue, materialSymbolDesignDefinition };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { materialSymbolDesignDefinition } from "../constants.mjs";
|
|
2
|
+
import MaterialSymbolOutlined from "../MaterialSymbolOutlined/MaterialSymbolOutlined.mjs";
|
|
3
|
+
import MaterialSymbolRounded from "../MaterialSymbolRounded/MaterialSymbolRounded.mjs";
|
|
4
|
+
import MaterialSymbolSharp from "../MaterialSymbolSharp/MaterialSymbolSharp.mjs";
|
|
5
|
+
import "../font-outlined.css";
|
|
6
|
+
import "../font-rounded.css";
|
|
7
|
+
import "../font-sharp.css";
|
|
8
|
+
import "../styles.css";
|
|
9
|
+
import "../index.mjs";
|
|
10
|
+
|
|
11
|
+
export { MaterialSymbolOutlined, MaterialSymbolRounded, MaterialSymbolSharp, materialSymbolDesignDefinition };
|