@hanzogui/font-zen 8.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.
@@ -0,0 +1,86 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: true
22
+ }), mod);
23
+ var index_exports = {};
24
+ __export(index_exports, {
25
+ ZEN_MONO_FAMILY: () => ZEN_MONO_FAMILY,
26
+ ZEN_SANS_FAMILY: () => ZEN_SANS_FAMILY,
27
+ createZenMonoFont: () => createZenMonoFont,
28
+ createZenSansFont: () => createZenSansFont,
29
+ zenMono: () => zenMono,
30
+ zenMonoFamily: () => zenMonoFamily,
31
+ zenSans: () => zenSans,
32
+ zenSansFamily: () => zenSansFamily
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+ var import_core = require("@hanzogui/core");
36
+ const ZEN_SANS_FAMILY = "Zen";
37
+ const ZEN_MONO_FAMILY = "Zen Mono";
38
+ const zenSans = `"${ZEN_SANS_FAMILY}", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`;
39
+ const zenMono = `"${ZEN_MONO_FAMILY}", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`;
40
+ const zenSansFamily = import_core.isWeb ? zenSans : ZEN_SANS_FAMILY;
41
+ const zenMonoFamily = import_core.isWeb ? zenMono : ZEN_MONO_FAMILY;
42
+ const defaultSizes = {
43
+ 1: 11,
44
+ 2: 12,
45
+ 3: 13,
46
+ 4: 14,
47
+ true: 14,
48
+ 5: 16,
49
+ 6: 18,
50
+ 7: 20,
51
+ 8: 23,
52
+ 9: 30,
53
+ 10: 46,
54
+ 11: 55,
55
+ 12: 62,
56
+ 13: 72,
57
+ 14: 92,
58
+ 15: 114,
59
+ 16: 134
60
+ };
61
+ const createZenFont = (family, font, sizeLineHeight, sizeSize) => {
62
+ const size = Object.fromEntries(Object.entries({
63
+ ...defaultSizes,
64
+ ...font.size
65
+ }).map(([k, v]) => [k, sizeSize(+v)]));
66
+ return (0, import_core.createFont)({
67
+ family,
68
+ lineHeight: Object.fromEntries(Object.entries(size).map(([k, v]) => [k, sizeLineHeight((0, import_core.getVariableValue)(v))])),
69
+ weight: {
70
+ 4: "400"
71
+ },
72
+ letterSpacing: {
73
+ 4: 0
74
+ },
75
+ ...font,
76
+ size
77
+ });
78
+ };
79
+ const createZenSansFont = (font = {}, {
80
+ sizeLineHeight = size => Math.round(size * 1.5),
81
+ sizeSize = size => size * 1
82
+ } = {}) => createZenFont(zenSansFamily, font, sizeLineHeight, sizeSize);
83
+ const createZenMonoFont = (font = {}, {
84
+ sizeLineHeight = size => Math.round(size * 1.5),
85
+ sizeSize = size => size * 1
86
+ } = {}) => createZenFont(zenMonoFamily, font, sizeLineHeight, sizeSize);
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
+ value: true
24
+ }), mod);
25
+ var index_exports = {};
26
+ __export(index_exports, {
27
+ ZEN_MONO_FAMILY: () => ZEN_MONO_FAMILY,
28
+ ZEN_SANS_FAMILY: () => ZEN_SANS_FAMILY,
29
+ createZenMonoFont: () => createZenMonoFont,
30
+ createZenSansFont: () => createZenSansFont,
31
+ zenMono: () => zenMono,
32
+ zenMonoFamily: () => zenMonoFamily,
33
+ zenSans: () => zenSans,
34
+ zenSansFamily: () => zenSansFamily
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+ var import_core = require("@hanzogui/core");
38
+ var ZEN_SANS_FAMILY = "Zen";
39
+ var ZEN_MONO_FAMILY = "Zen Mono";
40
+ var zenSans = `"${ZEN_SANS_FAMILY}", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`;
41
+ var zenMono = `"${ZEN_MONO_FAMILY}", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`;
42
+ var zenSansFamily = import_core.isWeb ? zenSans : ZEN_SANS_FAMILY;
43
+ var zenMonoFamily = import_core.isWeb ? zenMono : ZEN_MONO_FAMILY;
44
+ var defaultSizes = {
45
+ 1: 11,
46
+ 2: 12,
47
+ 3: 13,
48
+ 4: 14,
49
+ true: 14,
50
+ 5: 16,
51
+ 6: 18,
52
+ 7: 20,
53
+ 8: 23,
54
+ 9: 30,
55
+ 10: 46,
56
+ 11: 55,
57
+ 12: 62,
58
+ 13: 72,
59
+ 14: 92,
60
+ 15: 114,
61
+ 16: 134
62
+ };
63
+ var createZenFont = function (family, font, sizeLineHeight, sizeSize) {
64
+ var size = Object.fromEntries(Object.entries({
65
+ ...defaultSizes,
66
+ ...font.size
67
+ }).map(function (param) {
68
+ var [k, v] = param;
69
+ return [k, sizeSize(+v)];
70
+ }));
71
+ return (0, import_core.createFont)({
72
+ family,
73
+ lineHeight: Object.fromEntries(Object.entries(size).map(function (param) {
74
+ var [k, v] = param;
75
+ return [k, sizeLineHeight((0, import_core.getVariableValue)(v))];
76
+ })),
77
+ weight: {
78
+ 4: "400"
79
+ },
80
+ letterSpacing: {
81
+ 4: 0
82
+ },
83
+ ...font,
84
+ size
85
+ });
86
+ };
87
+ var createZenSansFont = function () {
88
+ var font = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
89
+ {
90
+ sizeLineHeight = function (size) {
91
+ return Math.round(size * 1.5);
92
+ },
93
+ sizeSize = function (size) {
94
+ return size * 1;
95
+ }
96
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
97
+ return createZenFont(zenSansFamily, font, sizeLineHeight, sizeSize);
98
+ };
99
+ var createZenMonoFont = function () {
100
+ var font = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
101
+ {
102
+ sizeLineHeight = function (size) {
103
+ return Math.round(size * 1.5);
104
+ },
105
+ sizeSize = function (size) {
106
+ return size * 1;
107
+ }
108
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
109
+ return createZenFont(zenMonoFamily, font, sizeLineHeight, sizeSize);
110
+ };
111
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","ZEN_MONO_FAMILY","ZEN_SANS_FAMILY","createZenMonoFont","createZenSansFont","zenMono","zenMonoFamily","zenSans","zenSansFamily","module","exports","import_core","require","isWeb","defaultSizes","true","createZenFont","family","font","sizeLineHeight","sizeSize","size","Object","fromEntries","entries","map","param","k","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GAAOC,MAAQ,CAAAC,WAAK,CAAAD,MAAc,CAAAE,OAAQ;IAC5C,GAAAV,YAAA;IACA,GAAAI,IAAA,CAAAG;EAAkB,EAChB,CAAAI,GAAA,WAAAC,KAAA;IACA,KAAAC,CAAA,EAAAC,CAAA,IAAYF,KAAA;IAAO,OACjB,CACFC,CAAA,EACAP,QAAU,EAAAQ,CAAG,EACb;EAAsB,EACtB;EAAI,OACJ,IAAAjB,WAAA,CAAAkB,UAAA;IACDZ,MAAA;IACHa,UAAA,EAAAR,MAAA,CAAAC,WAAA,CAAAD,MAAA,CAAAE,OAAA,CAAAH,IAAA,EAAAI,GAAA,WAAAC,KAAA;MAOa,KAAAC,CAAA,EAAAC,CAAA,IAAAF,KAAA;MAGT,QACAC,CAAA,EACaR,cAEf,GAAc,EAAAR,WAAA,CAAAoB,gBAAqB,EAAAH,CAAA,GAKxB;IAGT;IACAI,MAAA;MACa","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ import { createFont, getVariableValue, isWeb } from "@hanzogui/core";
2
+ const ZEN_SANS_FAMILY = "Zen";
3
+ const ZEN_MONO_FAMILY = "Zen Mono";
4
+ const zenSans = `"${ZEN_SANS_FAMILY}", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`;
5
+ const zenMono = `"${ZEN_MONO_FAMILY}", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`;
6
+ const zenSansFamily = isWeb ? zenSans : ZEN_SANS_FAMILY;
7
+ const zenMonoFamily = isWeb ? zenMono : ZEN_MONO_FAMILY;
8
+ const defaultSizes = {
9
+ 1: 11,
10
+ 2: 12,
11
+ 3: 13,
12
+ 4: 14,
13
+ true: 14,
14
+ 5: 16,
15
+ 6: 18,
16
+ 7: 20,
17
+ 8: 23,
18
+ 9: 30,
19
+ 10: 46,
20
+ 11: 55,
21
+ 12: 62,
22
+ 13: 72,
23
+ 14: 92,
24
+ 15: 114,
25
+ 16: 134
26
+ };
27
+ const createZenFont = (family, font, sizeLineHeight, sizeSize) => {
28
+ const size = Object.fromEntries(Object.entries({
29
+ ...defaultSizes,
30
+ ...font.size
31
+ }).map(([k, v]) => [k, sizeSize(+v)]));
32
+ return createFont({
33
+ family,
34
+ lineHeight: Object.fromEntries(Object.entries(size).map(([k, v]) => [k, sizeLineHeight(getVariableValue(v))])),
35
+ weight: {
36
+ 4: "400"
37
+ },
38
+ letterSpacing: {
39
+ 4: 0
40
+ },
41
+ ...font,
42
+ size
43
+ });
44
+ };
45
+ const createZenSansFont = (font = {}, {
46
+ sizeLineHeight = size => Math.round(size * 1.5),
47
+ sizeSize = size => size * 1
48
+ } = {}) => createZenFont(zenSansFamily, font, sizeLineHeight, sizeSize);
49
+ const createZenMonoFont = (font = {}, {
50
+ sizeLineHeight = size => Math.round(size * 1.5),
51
+ sizeSize = size => size * 1
52
+ } = {}) => createZenFont(zenMonoFamily, font, sizeLineHeight, sizeSize);
53
+ export { ZEN_MONO_FAMILY, ZEN_SANS_FAMILY, createZenMonoFont, createZenSansFont, zenMono, zenMonoFamily, zenSans, zenSansFamily };
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFont","getVariableValue","isWeb","ZEN_SANS_FAMILY","ZEN_MONO_FAMILY","zenSans","zenMono","zenSansFamily","zenMonoFamily","defaultSizes","true","createZenFont","family","font","sizeLineHeight","sizeSize","size","Object","fromEntries","entries","map","k","v","lineHeight","weight","letterSpacing","createZenSansFont","Math","round","createZenMonoFont"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,UAAA,EAAYC,gBAAA,EAAkBC,KAAA,QAAa;AA8B7C,MAAMC,eAAA,GAA0B;AAChC,MAAMC,eAAA,GAA0B;AAShC,MAAMC,OAAA,GAAkB,IAAIF,eAAe;AAG3C,MAAMG,OAAA,GAAkB,IAAIF,eAAe;AAG3C,MAAMG,aAAA,GAAwBL,KAAA,GAAQG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AAA,CAAcJ,aAAA,EAAeM,IAAA,EAAMC,cAAA,EAAgBC,QAAQ;AAKtD,MAAMc,iBAAA,GAAoBA,CAC/BhB,IAAA,GAAmB,CAAC,GACpB;EACEC,cAAA,GAAkBE,IAAA,IAASW,IAAA,CAAKC,KAAA,CAAMZ,IAAA,GAAO,GAAG;EAChDD,QAAA,GAAYC,IAAA,IAASA,IAAA,GAAO;AAC9B,IAAc,CAAC,MAEfL,aAAA,CAAcH,aAAA,EAAeK,IAAA,EAAMC,cAAA,EAAgBC,QAAQ","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ import { createFont, getVariableValue, isWeb } from "@hanzogui/core";
2
+ const ZEN_SANS_FAMILY = "Zen";
3
+ const ZEN_MONO_FAMILY = "Zen Mono";
4
+ const zenSans = `"${ZEN_SANS_FAMILY}", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`;
5
+ const zenMono = `"${ZEN_MONO_FAMILY}", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`;
6
+ const zenSansFamily = isWeb ? zenSans : ZEN_SANS_FAMILY;
7
+ const zenMonoFamily = isWeb ? zenMono : ZEN_MONO_FAMILY;
8
+ const defaultSizes = {
9
+ 1: 11,
10
+ 2: 12,
11
+ 3: 13,
12
+ 4: 14,
13
+ true: 14,
14
+ 5: 16,
15
+ 6: 18,
16
+ 7: 20,
17
+ 8: 23,
18
+ 9: 30,
19
+ 10: 46,
20
+ 11: 55,
21
+ 12: 62,
22
+ 13: 72,
23
+ 14: 92,
24
+ 15: 114,
25
+ 16: 134
26
+ };
27
+ const createZenFont = (family, font, sizeLineHeight, sizeSize) => {
28
+ const size = Object.fromEntries(Object.entries({
29
+ ...defaultSizes,
30
+ ...font.size
31
+ }).map(([k, v]) => [k, sizeSize(+v)]));
32
+ return createFont({
33
+ family,
34
+ lineHeight: Object.fromEntries(Object.entries(size).map(([k, v]) => [k, sizeLineHeight(getVariableValue(v))])),
35
+ weight: {
36
+ 4: "400"
37
+ },
38
+ letterSpacing: {
39
+ 4: 0
40
+ },
41
+ ...font,
42
+ size
43
+ });
44
+ };
45
+ const createZenSansFont = (font = {}, {
46
+ sizeLineHeight = size => Math.round(size * 1.5),
47
+ sizeSize = size => size * 1
48
+ } = {}) => createZenFont(zenSansFamily, font, sizeLineHeight, sizeSize);
49
+ const createZenMonoFont = (font = {}, {
50
+ sizeLineHeight = size => Math.round(size * 1.5),
51
+ sizeSize = size => size * 1
52
+ } = {}) => createZenFont(zenMonoFamily, font, sizeLineHeight, sizeSize);
53
+ export { ZEN_MONO_FAMILY, ZEN_SANS_FAMILY, createZenMonoFont, createZenSansFont, zenMono, zenMonoFamily, zenSans, zenSansFamily };
54
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFont","getVariableValue","isWeb","ZEN_SANS_FAMILY","ZEN_MONO_FAMILY","zenSans","zenMono","zenSansFamily","zenMonoFamily","defaultSizes","true","createZenFont","family","font","sizeLineHeight","sizeSize","size","Object","fromEntries","entries","map","k","v","lineHeight","weight","letterSpacing","createZenSansFont","Math","round","createZenMonoFont"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,UAAA,EAAYC,gBAAA,EAAkBC,KAAA,QAAa;AA8B7C,MAAMC,eAAA,GAA0B;AAChC,MAAMC,eAAA,GAA0B;AAShC,MAAMC,OAAA,GAAkB,IAAIF,eAAe;AAG3C,MAAMG,OAAA,GAAkB,IAAIF,eAAe;AAG3C,MAAMG,aAAA,GAAwBL,KAAA,GAAQG,OAAA,GAAUF,eAAA;AAChD,MAAMK,aAAA,GAAwBN,KAAA,GAAQI,OAAA,GAAUF,eAAA;AAEvD,MAAMK,YAAA,GAAe;EACnB,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACHC,IAAA,EAAM;EACN,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,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A,IAASA,IAAA,GAAO;AAC9B,IAAc,CAAC,MAEfL,aAAA,CAAcH,aAAA,EAAeK,IAAA,EAAMC,cAAA,EAAgBC,QAAQ","ignoreList":[]}
@@ -0,0 +1,76 @@
1
+ import { createFont, getVariableValue, isWeb } from "@hanzogui/core";
2
+ var ZEN_SANS_FAMILY = "Zen";
3
+ var ZEN_MONO_FAMILY = "Zen Mono";
4
+ var zenSans = `"${ZEN_SANS_FAMILY}", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`;
5
+ var zenMono = `"${ZEN_MONO_FAMILY}", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace`;
6
+ var zenSansFamily = isWeb ? zenSans : ZEN_SANS_FAMILY;
7
+ var zenMonoFamily = isWeb ? zenMono : ZEN_MONO_FAMILY;
8
+ var defaultSizes = {
9
+ 1: 11,
10
+ 2: 12,
11
+ 3: 13,
12
+ 4: 14,
13
+ true: 14,
14
+ 5: 16,
15
+ 6: 18,
16
+ 7: 20,
17
+ 8: 23,
18
+ 9: 30,
19
+ 10: 46,
20
+ 11: 55,
21
+ 12: 62,
22
+ 13: 72,
23
+ 14: 92,
24
+ 15: 114,
25
+ 16: 134
26
+ };
27
+ var createZenFont = function (family, font, sizeLineHeight, sizeSize) {
28
+ var size = Object.fromEntries(Object.entries({
29
+ ...defaultSizes,
30
+ ...font.size
31
+ }).map(function (param) {
32
+ var [k, v] = param;
33
+ return [k, sizeSize(+v)];
34
+ }));
35
+ return createFont({
36
+ family,
37
+ lineHeight: Object.fromEntries(Object.entries(size).map(function (param) {
38
+ var [k, v] = param;
39
+ return [k, sizeLineHeight(getVariableValue(v))];
40
+ })),
41
+ weight: {
42
+ 4: "400"
43
+ },
44
+ letterSpacing: {
45
+ 4: 0
46
+ },
47
+ ...font,
48
+ size
49
+ });
50
+ };
51
+ var createZenSansFont = function () {
52
+ var font = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
53
+ {
54
+ sizeLineHeight = function (size) {
55
+ return Math.round(size * 1.5);
56
+ },
57
+ sizeSize = function (size) {
58
+ return size * 1;
59
+ }
60
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
61
+ return createZenFont(zenSansFamily, font, sizeLineHeight, sizeSize);
62
+ };
63
+ var createZenMonoFont = function () {
64
+ var font = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
65
+ {
66
+ sizeLineHeight = function (size) {
67
+ return Math.round(size * 1.5);
68
+ },
69
+ sizeSize = function (size) {
70
+ return size * 1;
71
+ }
72
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
73
+ return createZenFont(zenMonoFamily, font, sizeLineHeight, sizeSize);
74
+ };
75
+ export { ZEN_MONO_FAMILY, ZEN_SANS_FAMILY, createZenMonoFont, createZenSansFont, zenMono, zenMonoFamily, zenSans, zenSansFamily };
76
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFont","getVariableValue","isWeb","ZEN_SANS_FAMILY","ZEN_MONO_FAMILY","zenSans","zenMono","zenSansFamily","zenMonoFamily","defaultSizes","true","createZenFont","family","font","sizeLineHeight","sizeSize","size","Object","fromEntries","entries","map","param","k","v","lineHeight","weight"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,UAAA,EAAYC,gBAAA,EAAkBC,KAAA,QAAa;AA8B7C,IAAAC,eAAM,QAA0B;AAChC,IAAAC,eAAM,aAA0B;AAShC,IAAAC,OAAM,OAAkBF,eAAI,kHAAe;AAG3C,IAAAG,OAAM,OAAkBF,eAAI,2FAAe;AAG3C,IAAAG,aAAM,GAAAL,KAAwB,GAAAG,OAAQ,GAAAF,eAAU;AAChD,IAAAK,aAAM,GAAAN,KAAwB,GAAAI,OAAQ,GAAAF,eAAU;AAEvD,IAAAK,YAAM;EACJ,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACHC,IAAA,EAAM;EACN,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,GAAG;EACH,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;AACN;AAEA,IAAAC,aAAM,YAAAA,CACJC,MACA,EACAC,IAAA,EAAAC,cACA,EAAAC,QACG;EACH,IAAAC,IAAM,GAAAC,MAAO,CAAAC,WAAO,CAAAD,MAAA,CAAAE,OAAA;IAClB,GAAAV,YAAe;IACjB,GAAAI,IAAA,CAAAG;EACA,GAAAI,GAAA,CAAO,UAAAC,KAAW;IAChB,KAAAC,CAAA,EAAAC,CAAA,IAAAF,KAAA;IACA,QACEC,CAAA,EACFP,QAAA,EAAAQ,CAAA,EACA;EAAmB,EACnB;EAAsB,OAClBvB,UAAA;IACJY,MAAA;IACDY,UAAA,EAAAP,MAAA,CAAAC,WAAA,CAAAD,MAAA,CAAAE,OAAA,CAAAH,IAAA,EAAAI,GAAA,WAAAC,KAAA;MACH,KAAAC,CAAA,EAAAC,CAAA,IAAAF,KAAA;MAOa,QAGTC,CAAA,EACAR,cAAY,CAASb,gBAAO,CAAAsB,CAAA,GACf;IAOV,EAAM;IAGTE,MAAA;MACA;IACY,CAAC","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@hanzogui/font-zen",
3
+ "version": "8.1.1",
4
+ "files": [
5
+ "types",
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "sideEffects": false,
10
+ "main": "dist/cjs",
11
+ "module": "dist/esm",
12
+ "types": "./types/index.d.ts",
13
+ "exports": {
14
+ "./package.json": "./package.json",
15
+ ".": {
16
+ "types": "./types/index.d.ts",
17
+ "react-native": "./dist/esm/index.native.js",
18
+ "browser": "./dist/esm/index.mjs",
19
+ "module": "./dist/esm/index.mjs",
20
+ "import": "./dist/esm/index.mjs",
21
+ "require": "./dist/cjs/index.cjs",
22
+ "default": "./dist/esm/index.mjs"
23
+ }
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "scripts": {
29
+ "build": "hanzogui-build",
30
+ "watch": "hanzogui-build --watch",
31
+ "clean": "hanzogui-build clean",
32
+ "clean:build": "hanzogui-build clean:build",
33
+ "test": "vitest run"
34
+ },
35
+ "dependencies": {
36
+ "@hanzogui/core": "8.1.1"
37
+ },
38
+ "devDependencies": {
39
+ "@hanzogui/build": "8.1.1"
40
+ },
41
+ "skipPublishIfUnchanged": false
42
+ }
@@ -0,0 +1,69 @@
1
+ import type { FillInFont, GenericFont } from "@hanzogui/core";
2
+ export type { GenericFont, FillInFont } from "@hanzogui/core";
3
+ /**
4
+ * Zen is the Hanzo typeface: Zen for the UI, Zen Mono for anything monospaced.
5
+ * This module is the single place either one is named — the family stacks the
6
+ * tokens bind to, and the kit fonts built on them. An app that states a family
7
+ * of its own is a second source of truth and will drift from the rest of the
8
+ * fleet.
9
+ *
10
+ * THE BYTES COME FROM `@hanzo/font`, which ships the woff2 files and the
11
+ * @font-face that reaches them:
12
+ *
13
+ * import '@hanzo/font/css' // once, at the app's entry
14
+ *
15
+ * That package owns the faces; this one owns the names the kit binds. This
16
+ * module used to carry a second copy of the @font-face rules pointed at a
17
+ * versioned CDN path, so the family name and the file behind it were two
18
+ * decisions that could disagree — and for Zen they did: nothing is served under
19
+ * that path, so every rule it emitted would have 404'd.
20
+ */
21
+ /**
22
+ * The two family names, exactly as `@hanzo/font` registers them.
23
+ *
24
+ * Everything else here is derived from these, so a stack and a native face can
25
+ * never name the typeface differently. Spelling the name a second time anywhere
26
+ * is how a font silently stops resolving.
27
+ */
28
+ export declare const ZEN_SANS_FAMILY: string;
29
+ export declare const ZEN_MONO_FAMILY: string;
30
+ /**
31
+ * The UI face.
32
+ *
33
+ * Everything after Zen is a system face, and the list ends in `sans-serif`: a
34
+ * font that fails to load must never leave the browser on its default, which is
35
+ * a serif.
36
+ */
37
+ export declare const zenSans: string;
38
+ /** The monospace face, ending in `monospace` for the same reason. */
39
+ export declare const zenMono: string;
40
+ /** The family names as the platform resolves them: a stack on web, a registered face on native. */
41
+ export declare const zenSansFamily: string;
42
+ export declare const zenMonoFamily: string;
43
+ declare const defaultSizes: {
44
+ readonly 1: 11;
45
+ readonly 2: 12;
46
+ readonly 3: 13;
47
+ readonly 4: 14;
48
+ readonly true: 14;
49
+ readonly 5: 16;
50
+ readonly 6: 18;
51
+ readonly 7: 20;
52
+ readonly 8: 23;
53
+ readonly 9: 30;
54
+ readonly 10: 46;
55
+ readonly 11: 55;
56
+ readonly 12: 62;
57
+ readonly 13: 72;
58
+ readonly 14: 92;
59
+ readonly 15: 114;
60
+ readonly 16: 134;
61
+ };
62
+ type SizeOpts = {
63
+ sizeLineHeight?: (fontSize: number) => number;
64
+ sizeSize?: (size: number) => number;
65
+ };
66
+ export declare const createZenSansFont: <A extends GenericFont>(font?: Partial<A>, { sizeLineHeight, sizeSize }?: SizeOpts) => FillInFont<A, keyof typeof defaultSizes>;
67
+ export declare const createZenMonoFont: <A extends GenericFont>(font?: Partial<A>, { sizeLineHeight, sizeSize }?: SizeOpts) => FillInFont<A, keyof typeof defaultSizes>;
68
+
69
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,YAAY,mBAAmB;AAG7C,cAAc,aAAa,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;AA4B7C,OAAO,cAAM;AACb,OAAO,cAAM;;;;;;;;AASb,OAAO,cAAM;;AAGb,OAAO,cAAM;;AAGb,OAAO,cAAM;AACb,OAAO,cAAM;AAEb,cAAM;UACJ,GAAG;UACH,GAAG;UACH,GAAG;UACH,GAAG;UACH,MAAM;UACN,GAAG;UACH,GAAG;UACH,GAAG;UACH,GAAG;UACH,GAAG;UACH,IAAI;UACJ,IAAI;UACJ,IAAI;UACJ,IAAI;UACJ,IAAI;UACJ,IAAI;UACJ,IAAI;;KAwBD,WAAW;CACd,kBAAkB;CAClB,YAAY;;AAGd,OAAO,cAAM,oBAAqB,UAAU,aAC1C,OAAM,QAAQ,IACd,EACE,gBACA,aACC,aACF,WAAW,gBAAgB;AAM9B,OAAO,cAAM,oBAAqB,UAAU,aAC1C,OAAM,QAAQ,IACd,EACE,gBACA,aACC,aACF,WAAW,gBAAgB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/index.ts"
6
+ ],
7
+ "version": 3,
8
+ "sourcesContent": [
9
+ "import type { FillInFont, GenericFont } from '@hanzogui/core'\nimport { createFont, getVariableValue, isWeb } from '@hanzogui/core'\n\nexport type { GenericFont, FillInFont } from '@hanzogui/core'\n\n/**\n * Zen is the Hanzo typeface: Zen for the UI, Zen Mono for anything monospaced.\n * This module is the single place either one is named — the family stacks the\n * tokens bind to, and the kit fonts built on them. An app that states a family\n * of its own is a second source of truth and will drift from the rest of the\n * fleet.\n *\n * THE BYTES COME FROM `@hanzo/font`, which ships the woff2 files and the\n * @font-face that reaches them:\n *\n * import '@hanzo/font/css' // once, at the app's entry\n *\n * That package owns the faces; this one owns the names the kit binds. This\n * module used to carry a second copy of the @font-face rules pointed at a\n * versioned CDN path, so the family name and the file behind it were two\n * decisions that could disagree — and for Zen they did: nothing is served under\n * that path, so every rule it emitted would have 404'd.\n */\n\n/**\n * The two family names, exactly as `@hanzo/font` registers them.\n *\n * Everything else here is derived from these, so a stack and a native face can\n * never name the typeface differently. Spelling the name a second time anywhere\n * is how a font silently stops resolving.\n */\nexport const ZEN_SANS_FAMILY: string = 'Zen'\nexport const ZEN_MONO_FAMILY: string = 'Zen Mono'\n\n/**\n * The UI face.\n *\n * Everything after Zen is a system face, and the list ends in `sans-serif`: a\n * font that fails to load must never leave the browser on its default, which is\n * a serif.\n */\nexport const zenSans: string = `\"${ZEN_SANS_FAMILY}\", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif`\n\n/** The monospace face, ending in `monospace` for the same reason. */\nexport const zenMono: string = `\"${ZEN_MONO_FAMILY}\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace`\n\n/** The family names as the platform resolves them: a stack on web, a registered face on native. */\nexport const zenSansFamily: string = isWeb ? zenSans : ZEN_SANS_FAMILY\nexport const zenMonoFamily: string = isWeb ? zenMono : ZEN_MONO_FAMILY\n\nconst defaultSizes = {\n 1: 11,\n 2: 12,\n 3: 13,\n 4: 14,\n true: 14,\n 5: 16,\n 6: 18,\n 7: 20,\n 8: 23,\n 9: 30,\n 10: 46,\n 11: 55,\n 12: 62,\n 13: 72,\n 14: 92,\n 15: 114,\n 16: 134,\n} as const\n\nconst createZenFont = (\n family: string,\n font: Partial<GenericFont>,\n sizeLineHeight: (fontSize: number) => number,\n sizeSize: (size: number) => number\n) => {\n const size = Object.fromEntries(\n Object.entries({ ...defaultSizes, ...font.size }).map(([k, v]) => [k, sizeSize(+v)])\n )\n return createFont({\n family,\n lineHeight: Object.fromEntries(\n Object.entries(size).map(([k, v]) => [k, sizeLineHeight(getVariableValue(v))])\n ),\n weight: { 4: '400' },\n letterSpacing: { 4: 0 },\n ...(font as any),\n size,\n })\n}\n\ntype SizeOpts = {\n sizeLineHeight?: (fontSize: number) => number\n sizeSize?: (size: number) => number\n}\n\nexport const createZenSansFont = <A extends GenericFont>(\n font: Partial<A> = {},\n {\n sizeLineHeight = (size) => Math.round(size * 1.5),\n sizeSize = (size) => size * 1,\n }: SizeOpts = {}\n): FillInFont<A, keyof typeof defaultSizes> =>\n createZenFont(zenSansFamily, font, sizeLineHeight, sizeSize) as FillInFont<\n A,\n keyof typeof defaultSizes\n >\n\nexport const createZenMonoFont = <A extends GenericFont>(\n font: Partial<A> = {},\n {\n sizeLineHeight = (size) => Math.round(size * 1.5),\n sizeSize = (size) => size * 1,\n }: SizeOpts = {}\n): FillInFont<A, keyof typeof defaultSizes> =>\n createZenFont(zenMonoFamily, font, sizeLineHeight, sizeSize) as FillInFont<\n A,\n keyof typeof defaultSizes\n >\n"
10
+ ]
11
+ }