@fringeworks/react-icon-material-symbols 0.0.0-stage → 0.1.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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/MaterialSymbolOutlined/MaterialSymbolOutlined.cjs +16 -0
  3. package/MaterialSymbolOutlined/MaterialSymbolOutlined.d.cts +13 -0
  4. package/MaterialSymbolOutlined/MaterialSymbolOutlined.d.mts +13 -0
  5. package/MaterialSymbolOutlined/MaterialSymbolOutlined.mjs +15 -0
  6. package/MaterialSymbolOutlined/index.cjs +5 -0
  7. package/MaterialSymbolOutlined/index.d.cts +2 -0
  8. package/MaterialSymbolOutlined/index.d.mts +2 -0
  9. package/MaterialSymbolOutlined/index.mjs +3 -0
  10. package/MaterialSymbolRounded/MaterialSymbolRounded.cjs +16 -0
  11. package/MaterialSymbolRounded/MaterialSymbolRounded.d.cts +13 -0
  12. package/MaterialSymbolRounded/MaterialSymbolRounded.d.mts +13 -0
  13. package/MaterialSymbolRounded/MaterialSymbolRounded.mjs +15 -0
  14. package/MaterialSymbolRounded/index.cjs +5 -0
  15. package/MaterialSymbolRounded/index.d.cts +2 -0
  16. package/MaterialSymbolRounded/index.d.mts +2 -0
  17. package/MaterialSymbolRounded/index.mjs +3 -0
  18. package/MaterialSymbolSharp/MaterialSymbolSharp.cjs +16 -0
  19. package/MaterialSymbolSharp/MaterialSymbolSharp.d.cts +13 -0
  20. package/MaterialSymbolSharp/MaterialSymbolSharp.d.mts +13 -0
  21. package/MaterialSymbolSharp/MaterialSymbolSharp.mjs +15 -0
  22. package/MaterialSymbolSharp/index.cjs +5 -0
  23. package/MaterialSymbolSharp/index.d.cts +2 -0
  24. package/MaterialSymbolSharp/index.d.mts +2 -0
  25. package/MaterialSymbolSharp/index.mjs +3 -0
  26. package/README.ja.md +282 -0
  27. package/README.md +281 -2
  28. package/_internal/_createMaterialSymbol.cjs +59 -0
  29. package/_internal/_createMaterialSymbol.d.cts +14 -0
  30. package/_internal/_createMaterialSymbol.d.mts +14 -0
  31. package/_internal/_createMaterialSymbol.mjs +58 -0
  32. package/_internal/_materialSymbolValue.cjs +1 -0
  33. package/_internal/_materialSymbolValue.d.cts +8 -0
  34. package/_internal/_materialSymbolValue.d.mts +8 -0
  35. package/_internal/_materialSymbolValue.mjs +1 -0
  36. package/_styles.scss.cjs +5 -0
  37. package/_styles.scss.d.cts +1 -0
  38. package/_styles.scss.d.mts +1 -0
  39. package/_styles.scss.mjs +6 -0
  40. package/constants.cjs +17 -0
  41. package/constants.d.cts +15 -0
  42. package/constants.d.mts +15 -0
  43. package/constants.mjs +16 -0
  44. package/font-outlined.css +1 -0
  45. package/font-rounded.css +1 -0
  46. package/font-sharp.css +1 -0
  47. package/index.cjs +13 -0
  48. package/index.d.cts +10 -0
  49. package/index.d.mts +10 -0
  50. package/index.mjs +9 -0
  51. package/package.json +78 -4
  52. package/styles.css +44 -0
  53. package/types.cjs +1 -0
  54. package/types.d.cts +53 -0
  55. package/types.d.mts +53 -0
  56. package/types.mjs +1 -0
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@fringeworks/react-icon-material-symbols",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "A library some will find handy, for using Material Symbols as typed React components with variable font axes.",
5
+ "keywords": [
6
+ "react",
7
+ "icon",
8
+ "material-symbols",
9
+ "icon-font"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/fringeworks-js/react-icon-material-symbols.git"
14
+ },
15
+ "license": "MIT",
16
+ "author": "Mitsuhiro Seino",
17
+ "sideEffects": [
18
+ "**/*.css"
19
+ ],
20
+ "type": "module",
21
+ "exports": {
22
+ ".": {
23
+ "import": {
24
+ "types": "./index.d.mts",
25
+ "default": "./index.mjs"
26
+ },
27
+ "require": {
28
+ "types": "./index.d.cts",
29
+ "default": "./index.cjs"
30
+ }
31
+ },
32
+ "./MaterialSymbolOutlined": {
33
+ "import": {
34
+ "types": "./MaterialSymbolOutlined/index.d.mts",
35
+ "default": "./MaterialSymbolOutlined/index.mjs"
36
+ },
37
+ "require": {
38
+ "types": "./MaterialSymbolOutlined/index.d.cts",
39
+ "default": "./MaterialSymbolOutlined/index.cjs"
40
+ }
41
+ },
42
+ "./MaterialSymbolRounded": {
43
+ "import": {
44
+ "types": "./MaterialSymbolRounded/index.d.mts",
45
+ "default": "./MaterialSymbolRounded/index.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./MaterialSymbolRounded/index.d.cts",
49
+ "default": "./MaterialSymbolRounded/index.cjs"
50
+ }
51
+ },
52
+ "./MaterialSymbolSharp": {
53
+ "import": {
54
+ "types": "./MaterialSymbolSharp/index.d.mts",
55
+ "default": "./MaterialSymbolSharp/index.mjs"
56
+ },
57
+ "require": {
58
+ "types": "./MaterialSymbolSharp/index.d.cts",
59
+ "default": "./MaterialSymbolSharp/index.cjs"
60
+ }
61
+ },
62
+ "./package.json": "./package.json",
63
+ "./styles.css": "./styles.css",
64
+ "./font-outlined.css": "./font-outlined.css",
65
+ "./font-rounded.css": "./font-rounded.css",
66
+ "./font-sharp.css": "./font-sharp.css"
67
+ },
68
+ "main": "./index.cjs",
69
+ "module": "./index.mjs",
70
+ "types": "./index.d.cts",
71
+ "dependencies": {
72
+ "@fringeworks/react-contract": "^0.2.2",
73
+ "@fringeworks/react-icon": "^0.1.0",
74
+ "@fringeworks/react-merge": "^0.9.2",
75
+ "material-symbols": "^0.49.0"
76
+ },
77
+ "peerDependencies": {
78
+ "react": "^18.0.0 || ^19.0.0"
79
+ }
80
+ }
package/styles.css ADDED
@@ -0,0 +1,44 @@
1
+ :where(.frg-icon) {
2
+ display: inline-block;
3
+ flex-shrink: 0;
4
+ box-sizing: content-box;
5
+ width: 1em;
6
+ height: 1em;
7
+ overflow: hidden;
8
+ vertical-align: -0.125em;
9
+ line-height: 1;
10
+ }
11
+
12
+ :where(.frg-fonticon) {
13
+ font-style: normal;
14
+ font-weight: normal;
15
+ letter-spacing: normal;
16
+ text-transform: none;
17
+ text-align: center;
18
+ white-space: nowrap;
19
+ word-wrap: normal;
20
+ direction: ltr;
21
+ font-feature-settings: "liga";
22
+ -webkit-font-smoothing: antialiased;
23
+ -moz-osx-font-smoothing: grayscale;
24
+ -webkit-user-select: none;
25
+ user-select: none;
26
+ }
27
+
28
+ :where(.frg-materialsymbol) {
29
+ font-weight: var(--frg-materialsymbol-fontWeight, 400);
30
+ font-variation-settings: "FILL" var(--frg-materialsymbol-filled, 0), "GRAD" var(--frg-materialsymbol-grade, 0);
31
+ }
32
+
33
+ :where(.frg-materialsymbol-opticalSize) {
34
+ font-variation-settings: "FILL" var(--frg-materialsymbol-filled, 0), "GRAD" var(--frg-materialsymbol-grade, 0), "opsz" var(--frg-materialsymbol-opticalSize, 24);
35
+ }
36
+
37
+ :where(.frg-materialsymbol:hover) {
38
+ font-weight: var(--frg-materialsymbol-fontWeight-hover, var(--frg-materialsymbol-fontWeight, 400));
39
+ font-variation-settings: "FILL" var(--frg-materialsymbol-filled-hover, var(--frg-materialsymbol-filled, 0)), "GRAD" var(--frg-materialsymbol-grade-hover, var(--frg-materialsymbol-grade, 0));
40
+ }
41
+
42
+ :where(.frg-materialsymbol-opticalSize:hover) {
43
+ font-variation-settings: "FILL" var(--frg-materialsymbol-filled-hover, var(--frg-materialsymbol-filled, 0)), "GRAD" var(--frg-materialsymbol-grade-hover, var(--frg-materialsymbol-grade, 0)), "opsz" var(--frg-materialsymbol-opticalSize, 24);
44
+ }
package/types.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
package/types.d.cts ADDED
@@ -0,0 +1,53 @@
1
+ import { MaterialSymbolValue } from "./_internal/_materialSymbolValue.cjs";
2
+ import { materialSymbolDesignDefinition } from "./constants.cjs";
3
+ import { Design, DesignDefinition, DesignPartDefinition, DesignPropertyValues, DesignState, DesignValue } from "@fringeworks/react-contract";
4
+ import { FontIconProps, FontIconWebFont, FontIconWebFont as FontIconWebFont$1 } from "@fringeworks/react-icon";
5
+ import { ReactElement } from "react";
6
+ /**
7
+ * Material Symbols の部品のデザインの値
8
+ */
9
+ export type MaterialSymbolDesign = Design<typeof materialSymbolDesignDefinition>;
10
+ /**
11
+ * Material Symbols の部品のプロパティ
12
+ *
13
+ * `value` でアイコンの名前を受け取る。そのほかの props は `<span>` に渡す。
14
+ */
15
+ export type MaterialSymbolProps = FontIconProps<MaterialSymbolValue> & {
16
+ /**
17
+ * 太さ(`wght` の軸。100〜700)。`font-weight` で描く
18
+ */
19
+ weight?: number;
20
+ /**
21
+ * 塗りつぶした形にする(`FILL` の軸)
22
+ * @default false
23
+ */
24
+ filled?: boolean;
25
+ /**
26
+ * グレード(`GRAD` の軸。-25〜200)。太さを変えずに線の濃さを変える
27
+ */
28
+ grade?: number;
29
+ /**
30
+ * 光学サイズ(`opsz` の軸。20〜48)。指定しなければ、ブラウザーが文字の大きさに合わせて決める
31
+ */
32
+ opticalSize?: number;
33
+ /**
34
+ * デザインの値(軸ごとに、`hover` の値も指定できる)。同じ軸のプロパティを指定した場合は、状態なしの値をプロパティで上書きする
35
+ */
36
+ design?: MaterialSymbolDesign;
37
+ };
38
+ /**
39
+ * Material Symbols の部品(`MaterialSymbolOutlined`・`MaterialSymbolRounded`・`MaterialSymbolSharp`)
40
+ */
41
+ export type MaterialSymbolComponent = {
42
+ (props: MaterialSymbolProps): ReactElement;
43
+ /**
44
+ * この部品のアイコンを描くのに要る Web フォント(react-defer-rendering の `useDeferUntilWebFontReady` に渡せる)
45
+ */
46
+ readonly webFonts: readonly FontIconWebFont$1[];
47
+ /**
48
+ * デザインの定義(react-contract の `withDesign` が読む)
49
+ */
50
+ readonly designDefinition: typeof materialSymbolDesignDefinition;
51
+ displayName?: string;
52
+ };
53
+ export type { DesignDefinition, DesignPartDefinition, DesignPropertyValues, DesignState, DesignValue, FontIconWebFont, MaterialSymbolValue };
package/types.d.mts ADDED
@@ -0,0 +1,53 @@
1
+ import { MaterialSymbolValue } from "./_internal/_materialSymbolValue.mjs";
2
+ import { materialSymbolDesignDefinition } from "./constants.mjs";
3
+ import { Design, DesignDefinition, DesignPartDefinition, DesignPropertyValues, DesignState, DesignValue } from "@fringeworks/react-contract";
4
+ import { FontIconProps, FontIconWebFont, FontIconWebFont as FontIconWebFont$1 } from "@fringeworks/react-icon";
5
+ import { ReactElement } from "react";
6
+ /**
7
+ * Material Symbols の部品のデザインの値
8
+ */
9
+ export type MaterialSymbolDesign = Design<typeof materialSymbolDesignDefinition>;
10
+ /**
11
+ * Material Symbols の部品のプロパティ
12
+ *
13
+ * `value` でアイコンの名前を受け取る。そのほかの props は `<span>` に渡す。
14
+ */
15
+ export type MaterialSymbolProps = FontIconProps<MaterialSymbolValue> & {
16
+ /**
17
+ * 太さ(`wght` の軸。100〜700)。`font-weight` で描く
18
+ */
19
+ weight?: number;
20
+ /**
21
+ * 塗りつぶした形にする(`FILL` の軸)
22
+ * @default false
23
+ */
24
+ filled?: boolean;
25
+ /**
26
+ * グレード(`GRAD` の軸。-25〜200)。太さを変えずに線の濃さを変える
27
+ */
28
+ grade?: number;
29
+ /**
30
+ * 光学サイズ(`opsz` の軸。20〜48)。指定しなければ、ブラウザーが文字の大きさに合わせて決める
31
+ */
32
+ opticalSize?: number;
33
+ /**
34
+ * デザインの値(軸ごとに、`hover` の値も指定できる)。同じ軸のプロパティを指定した場合は、状態なしの値をプロパティで上書きする
35
+ */
36
+ design?: MaterialSymbolDesign;
37
+ };
38
+ /**
39
+ * Material Symbols の部品(`MaterialSymbolOutlined`・`MaterialSymbolRounded`・`MaterialSymbolSharp`)
40
+ */
41
+ export type MaterialSymbolComponent = {
42
+ (props: MaterialSymbolProps): ReactElement;
43
+ /**
44
+ * この部品のアイコンを描くのに要る Web フォント(react-defer-rendering の `useDeferUntilWebFontReady` に渡せる)
45
+ */
46
+ readonly webFonts: readonly FontIconWebFont$1[];
47
+ /**
48
+ * デザインの定義(react-contract の `withDesign` が読む)
49
+ */
50
+ readonly designDefinition: typeof materialSymbolDesignDefinition;
51
+ displayName?: string;
52
+ };
53
+ export type { DesignDefinition, DesignPartDefinition, DesignPropertyValues, DesignState, DesignValue, FontIconWebFont, MaterialSymbolValue };
package/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };