@charcoal-ui/foundation 5.0.0-beta.1 → 5.0.0-beta.3

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/dist/index.cjs ADDED
@@ -0,0 +1,95 @@
1
+
2
+ //#region src/typography.ts
3
+ const TYPOGRAPHY_SIZE = {
4
+ 12: {
5
+ fontSize: 12,
6
+ lineHeight: 20
7
+ },
8
+ 14: {
9
+ fontSize: 14,
10
+ lineHeight: 22
11
+ },
12
+ 16: {
13
+ fontSize: 16,
14
+ lineHeight: 24
15
+ },
16
+ 20: {
17
+ fontSize: 20,
18
+ lineHeight: 28
19
+ },
20
+ 32: {
21
+ fontSize: 32,
22
+ lineHeight: 40
23
+ }
24
+ };
25
+ const TYPOGRAPHY_WEIGHT = ["regular", "bold"];
26
+ const TYPOGRAPHY_VARIANT = ["proportional", "monospace"];
27
+
28
+ //#endregion
29
+ //#region src/spacing.ts
30
+ const SPACING = {
31
+ 0: 0,
32
+ 4: 4,
33
+ 8: 8,
34
+ 16: 16,
35
+ 24: 24,
36
+ 40: 40,
37
+ 64: 64,
38
+ 104: 104,
39
+ 168: 168,
40
+ 272: 272,
41
+ 440: 440
42
+ };
43
+
44
+ //#endregion
45
+ //#region src/grid.ts
46
+ /**
47
+ * Unit for grid column (px)
48
+ */
49
+ const COLUMN_UNIT = 80;
50
+ /**
51
+ * Unit for grid gutter width (px)
52
+ */
53
+ const GUTTER_UNIT = 24;
54
+ /**
55
+ * Calculate px occupied by the span of the columns with gutter gap
56
+ *
57
+ * @param span column span count
58
+ */
59
+ function columnSystem(span, column, gutter) {
60
+ return span * column + (span - 1) * gutter;
61
+ }
62
+
63
+ //#endregion
64
+ //#region src/border-radius.ts
65
+ const BORDER_RADIUS = {
66
+ none: 0,
67
+ 4: 4,
68
+ 8: 8,
69
+ 16: 16,
70
+ 24: 24,
71
+ oval: 999999
72
+ };
73
+
74
+ //#endregion
75
+ //#region src/breakpoint.ts
76
+ const HORIZONTAL_MIN_MARGIN = 72;
77
+ const BREAKPOINT = {
78
+ [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
79
+ [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
80
+ [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
81
+ [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2
82
+ };
83
+
84
+ //#endregion
85
+ exports.BORDER_RADIUS = BORDER_RADIUS;
86
+ exports.BREAKPOINT = BREAKPOINT;
87
+ exports.COLUMN_UNIT = COLUMN_UNIT;
88
+ exports.GUTTER_UNIT = GUTTER_UNIT;
89
+ exports.HORIZONTAL_MIN_MARGIN = HORIZONTAL_MIN_MARGIN;
90
+ exports.SPACING = SPACING;
91
+ exports.TYPOGRAPHY_SIZE = TYPOGRAPHY_SIZE;
92
+ exports.TYPOGRAPHY_VARIANT = TYPOGRAPHY_VARIANT;
93
+ exports.TYPOGRAPHY_WEIGHT = TYPOGRAPHY_WEIGHT;
94
+ exports.columnSystem = columnSystem;
95
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/typography.ts","../src/spacing.ts","../src/grid.ts","../src/border-radius.ts","../src/breakpoint.ts"],"sourcesContent":["export interface TypographyDescriptor {\n readonly lineHeight: number\n readonly fontSize: number\n}\n\nexport const TYPOGRAPHY_SIZE = {\n 12: {\n fontSize: 12,\n lineHeight: 20,\n },\n 14: {\n fontSize: 14,\n lineHeight: 22,\n },\n 16: {\n fontSize: 16,\n lineHeight: 24,\n },\n 20: {\n fontSize: 20,\n lineHeight: 28,\n },\n 32: {\n fontSize: 32,\n lineHeight: 40,\n },\n} as const\n\nexport const TYPOGRAPHY_WEIGHT = [\n /**\n * Regular font weight\n *\n * <font-weight-absolute> ~ 400\n *\n * It should be the **DEFAULT** weight\n */\n 'regular',\n /**\n * Bolder than `regular` weight\n *\n * <font-weight-absolute> ~ 700\n */\n 'bold',\n] as const\n\nexport const TYPOGRAPHY_VARIANT = [\n /**\n * Proportional font (which has the variable amount of horizontal space)\n *\n * It should be the **DEFAULT** variant\n */\n 'proportional',\n /**\n * Monospaced font (which has the same amount of horizontal space)\n */\n 'monospace',\n] as const\n","export const SPACING = {\n 0: 0,\n 4: 4,\n 8: 8,\n 16: 16,\n 24: 24,\n 40: 40,\n 64: 64,\n 104: 104,\n 168: 168,\n 272: 272,\n 440: 440,\n} as const\n","/**\n * Unit for grid column (px)\n */\nexport const COLUMN_UNIT = 80\n\n/**\n * Unit for grid gutter width (px)\n */\nexport const GUTTER_UNIT = 24\n\n// TODO: Grid definition with breakpoint\n\n/**\n * Calculate px occupied by the span of the columns with gutter gap\n *\n * @param span column span count\n */\nexport function columnSystem(\n span: number,\n column: number,\n gutter: number\n): number {\n return span * column + (span - 1) * gutter\n}\n","export const BORDER_RADIUS = {\n /**\n * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)\n */\n none: 0,\n /**\n * 用途: バッジ, 高さ40px以下の要素\n */\n 4: 4,\n /**\n * 用途: サムネイル\n */\n 8: 8,\n /**\n * 用途: チュートリアルツールチップ\n */\n 16: 16,\n /**\n * 用途: モーダル\n */\n 24: 24,\n /**\n * 真円 or 左右が丸まっている矩形 を作る時に用いる\n *\n * 用途: ボタン\n */\n oval: 999999,\n} as const\n","import { COLUMN_UNIT, GUTTER_UNIT, columnSystem } from './grid'\n\nexport const HORIZONTAL_MIN_MARGIN = 72\n\nexport const BREAKPOINT = {\n [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n} as { 10: 1160; 12: 1368; 6: 744; 8: 952 }\n"],"mappings":";;AAKA,MAAa,kBAAkB;CAC7B,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACF;AAED,MAAa,oBAAoB,CAQ/B,WAMA,OACD;AAED,MAAa,qBAAqB,CAMhC,gBAIA,YACD;;;;ACxDD,MAAa,UAAU;CACrB,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACN;;;;;;;ACTD,MAAa,cAAc;;;;AAK3B,MAAa,cAAc;;;;;;AAS3B,SAAgB,aACd,MACA,QACA,QACQ;AACR,QAAO,OAAO,UAAU,OAAO,KAAK;;;;;ACtBtC,MAAa,gBAAgB;CAI3B,MAAM;CAIN,GAAG;CAIH,GAAG;CAIH,IAAI;CAIJ,IAAI;CAMJ,MAAM;CACP;;;;ACzBD,MAAa,wBAAwB;AAErC,MAAa,aAAa;EACvB,IAAI,aAAa,GAAG,aAAa,YAAY,GAAG,wBAAwB;EACxE,IAAI,aAAa,GAAG,aAAa,YAAY,GAAG,wBAAwB;EACxE,KAAK,aAAa,IAAI,aAAa,YAAY,GAAG,wBAAwB;EAC1E,KAAK,aAAa,IAAI,aAAa,YAAY,GAAG,wBAAwB;CAC5E"}
@@ -0,0 +1,147 @@
1
+ //#region src/typography.d.ts
2
+ interface TypographyDescriptor {
3
+ readonly lineHeight: number;
4
+ readonly fontSize: number;
5
+ }
6
+ declare const TYPOGRAPHY_SIZE: {
7
+ readonly 12: {
8
+ readonly fontSize: 12;
9
+ readonly lineHeight: 20;
10
+ };
11
+ readonly 14: {
12
+ readonly fontSize: 14;
13
+ readonly lineHeight: 22;
14
+ };
15
+ readonly 16: {
16
+ readonly fontSize: 16;
17
+ readonly lineHeight: 24;
18
+ };
19
+ readonly 20: {
20
+ readonly fontSize: 20;
21
+ readonly lineHeight: 28;
22
+ };
23
+ readonly 32: {
24
+ readonly fontSize: 32;
25
+ readonly lineHeight: 40;
26
+ };
27
+ };
28
+ declare const TYPOGRAPHY_WEIGHT: readonly ["regular", "bold"];
29
+ declare const TYPOGRAPHY_VARIANT: readonly ["proportional", "monospace"];
30
+ //#endregion
31
+ //#region src/spacing.d.ts
32
+ declare const SPACING: {
33
+ readonly 0: 0;
34
+ readonly 4: 4;
35
+ readonly 8: 8;
36
+ readonly 16: 16;
37
+ readonly 24: 24;
38
+ readonly 40: 40;
39
+ readonly 64: 64;
40
+ readonly 104: 104;
41
+ readonly 168: 168;
42
+ readonly 272: 272;
43
+ readonly 440: 440;
44
+ };
45
+ //#endregion
46
+ //#region src/grid.d.ts
47
+ /**
48
+ * Unit for grid column (px)
49
+ */
50
+ declare const COLUMN_UNIT = 80;
51
+ /**
52
+ * Unit for grid gutter width (px)
53
+ */
54
+ declare const GUTTER_UNIT = 24;
55
+ /**
56
+ * Calculate px occupied by the span of the columns with gutter gap
57
+ *
58
+ * @param span column span count
59
+ */
60
+ declare function columnSystem(span: number, column: number, gutter: number): number;
61
+ //#endregion
62
+ //#region src/border-radius.d.ts
63
+ declare const BORDER_RADIUS: {
64
+ /**
65
+ * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)
66
+ */
67
+ readonly none: 0;
68
+ /**
69
+ * 用途: バッジ, 高さ40px以下の要素
70
+ */
71
+ readonly 4: 4;
72
+ /**
73
+ * 用途: サムネイル
74
+ */
75
+ readonly 8: 8;
76
+ /**
77
+ * 用途: チュートリアルツールチップ
78
+ */
79
+ readonly 16: 16;
80
+ /**
81
+ * 用途: モーダル
82
+ */
83
+ readonly 24: 24;
84
+ /**
85
+ * 真円 or 左右が丸まっている矩形 を作る時に用いる
86
+ *
87
+ * 用途: ボタン
88
+ */
89
+ readonly oval: 999999;
90
+ };
91
+ //#endregion
92
+ //#region src/breakpoint.d.ts
93
+ declare const HORIZONTAL_MIN_MARGIN = 72;
94
+ declare const BREAKPOINT: {
95
+ 10: 1160;
96
+ 12: 1368;
97
+ 6: 744;
98
+ 8: 952;
99
+ };
100
+ //#endregion
101
+ //#region src/color.d.ts
102
+ type Material = string;
103
+ type GradientMaterial = readonly {
104
+ readonly color: Material;
105
+ readonly ratio: number;
106
+ }[];
107
+ //#endregion
108
+ //#region src/effect.d.ts
109
+ type Effects = Readonly<Effect> | readonly Readonly<Effect>[];
110
+ type Effect = AlphaEffect | OpacityEffect | ReplaceEffect;
111
+ interface BaseEffect {}
112
+ interface AlphaEffect extends BaseEffect {
113
+ readonly type: "alpha";
114
+ /**
115
+ * Color to blend with the base color using alpha blending.
116
+ */
117
+ readonly color: string;
118
+ /**
119
+ * Multiplied with the alpha value of the effect's `color` before blending.
120
+ *
121
+ * `1` by default.
122
+ */
123
+ readonly opacity?: number;
124
+ }
125
+ interface OpacityEffect extends BaseEffect {
126
+ readonly type: "opacity";
127
+ /**
128
+ * Value to multiply with the current color's alpha value.
129
+ */
130
+ readonly opacity: number;
131
+ }
132
+ interface ReplaceEffect extends BaseEffect {
133
+ readonly type: "replace";
134
+ /**
135
+ * Replaces any given color with this color
136
+ */
137
+ readonly color?: string;
138
+ /**
139
+ * Replaces the alpha value with this opacity.
140
+ *
141
+ * Overrides the `color`'s opacity as well.
142
+ */
143
+ readonly opacity?: number;
144
+ }
145
+ //#endregion
146
+ export { AlphaEffect, BORDER_RADIUS, BREAKPOINT, COLUMN_UNIT, Effect, Effects, GUTTER_UNIT, GradientMaterial, HORIZONTAL_MIN_MARGIN, Material, OpacityEffect, ReplaceEffect, SPACING, TYPOGRAPHY_SIZE, TYPOGRAPHY_VARIANT, TYPOGRAPHY_WEIGHT, TypographyDescriptor, columnSystem };
147
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/typography.ts","../src/spacing.ts","../src/grid.ts","../src/border-radius.ts","../src/breakpoint.ts","../src/color.ts","../src/effect.ts"],"sourcesContent":[],"mappings":";UAAiB,oBAAA;EAAjB,SAAiB,UAAA,EAAA,MAAA;EAKjB,SAAa,QAAA,EAAA,MAAA;AAuBb;AAiBa,cAxCA,eAkDX,EAAA;;;;ECvDF,CAAA;;;;ECGA,CAAA;EAKA,SAAa,EAAA,EAAA;IASb,SAAgB,QAAA,EAAA,EAAA;;;;ICjBhB,SAAa,QAAA,EAAA,EAAA;;;;ICEb,SAAa,QAAA,EAAA,EAAA;IAEb,SAAa,UAAA,EAAA,EAAA;;;cJwBA;AK5BD,cL6CC,kBK7CD,EAAA,SAAA,CAAA,cAAA,EAAA,WAAA,CAAA;;;cJAC;EDAb,SAAiB,CAAA,EAAA,CAAA;EAKjB,SAAa,CAAA,EAAA,CAAA;EAuBb,SAAa,CAAA,EAAA,CAAA;EAiBb,SAAa,EAAA,EAAA,EAAA;;;;EC7Cb,SAAa,GAAA,EAAA,GAAA;;;;ACGb,CAAA;;;;AFHA;AAKA;AAuBa,cEzBA,WAAA,GFuCX,EAAA;AAGF;;;cErCa,WAAA;ADRb;;;;ACGA;AAKa,iBASG,YAAA,CATH,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;cCRA;EHAb;AAKA;AAuBA;EAiBA,SAAa,IAAA,EAAA,CAAA;;;;EC7Cb,SAAa,CAAA,EAAA,CAAA;;;;ECGb,SAAa,CAAA,EAAA,CAAA;EAKb;AASA;;;;ACjBA;;;;ACEA;AAEA;;;;ACJA,CAAA;;;cDEa,qBAAA;AJFI,cIIJ,UJJI,EAAA;EAKjB,EAAA,EAAa,IAAA;EAuBb,EAAA,EAAa,IAAA;EAiBb,CAAA,EAAa,GAAA;;;;;KK7CD,QAAA;ALAK,KKEL,gBAAA,GLFK,SAAA;EAKjB,SAAa,KAAA,EKFK,QLEL;EAuBb,SAAa,KAAA,EAAA,MAAA;AAiBb,CAAA,EAAA;;;KM7CY,OAAA,GAAU,SAAS,mBAAmB,SAAS;ANA1C,KMEL,MAAA,GAAS,WNFJ,GMEkB,aNFlB,GMEkC,aNFlC;AAKjB,UMDU,UAAA,CNCG,CAAA;AAuBA,UMtBI,WAAA,SAAoB,UNoCnC,CAAA;EAGF,SAAa,IAAA,EAAA,OAAA;;;;EC7Cb,SAAa,KAAA,EAAA,MAAA;;;;ACGb;AAKA;EASA,SAAgB,OAAA,CAAA,EAAA,MAAA;;UIGC,aAAA,SAAsB;;EHpBvC;;;;ACEA;AAEa,UEwBI,aAAA,SAAsB,UFxB1B,CAAA;;;;ACJb;EAEA,SAAY,KAAA,CAAA,EAAA,MAAA;;;;ACFZ;;WAA+B,OAAA,CAAA,EAAA,MAAA"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,147 @@
1
- export * from './typography';
2
- export * from './spacing';
3
- export * from './grid';
4
- export * from './border-radius';
5
- export * from './breakpoint';
6
- export * from './color';
7
- export * from './effect';
1
+ //#region src/typography.d.ts
2
+ interface TypographyDescriptor {
3
+ readonly lineHeight: number;
4
+ readonly fontSize: number;
5
+ }
6
+ declare const TYPOGRAPHY_SIZE: {
7
+ readonly 12: {
8
+ readonly fontSize: 12;
9
+ readonly lineHeight: 20;
10
+ };
11
+ readonly 14: {
12
+ readonly fontSize: 14;
13
+ readonly lineHeight: 22;
14
+ };
15
+ readonly 16: {
16
+ readonly fontSize: 16;
17
+ readonly lineHeight: 24;
18
+ };
19
+ readonly 20: {
20
+ readonly fontSize: 20;
21
+ readonly lineHeight: 28;
22
+ };
23
+ readonly 32: {
24
+ readonly fontSize: 32;
25
+ readonly lineHeight: 40;
26
+ };
27
+ };
28
+ declare const TYPOGRAPHY_WEIGHT: readonly ["regular", "bold"];
29
+ declare const TYPOGRAPHY_VARIANT: readonly ["proportional", "monospace"];
30
+ //#endregion
31
+ //#region src/spacing.d.ts
32
+ declare const SPACING: {
33
+ readonly 0: 0;
34
+ readonly 4: 4;
35
+ readonly 8: 8;
36
+ readonly 16: 16;
37
+ readonly 24: 24;
38
+ readonly 40: 40;
39
+ readonly 64: 64;
40
+ readonly 104: 104;
41
+ readonly 168: 168;
42
+ readonly 272: 272;
43
+ readonly 440: 440;
44
+ };
45
+ //#endregion
46
+ //#region src/grid.d.ts
47
+ /**
48
+ * Unit for grid column (px)
49
+ */
50
+ declare const COLUMN_UNIT = 80;
51
+ /**
52
+ * Unit for grid gutter width (px)
53
+ */
54
+ declare const GUTTER_UNIT = 24;
55
+ /**
56
+ * Calculate px occupied by the span of the columns with gutter gap
57
+ *
58
+ * @param span column span count
59
+ */
60
+ declare function columnSystem(span: number, column: number, gutter: number): number;
61
+ //#endregion
62
+ //#region src/border-radius.d.ts
63
+ declare const BORDER_RADIUS: {
64
+ /**
65
+ * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)
66
+ */
67
+ readonly none: 0;
68
+ /**
69
+ * 用途: バッジ, 高さ40px以下の要素
70
+ */
71
+ readonly 4: 4;
72
+ /**
73
+ * 用途: サムネイル
74
+ */
75
+ readonly 8: 8;
76
+ /**
77
+ * 用途: チュートリアルツールチップ
78
+ */
79
+ readonly 16: 16;
80
+ /**
81
+ * 用途: モーダル
82
+ */
83
+ readonly 24: 24;
84
+ /**
85
+ * 真円 or 左右が丸まっている矩形 を作る時に用いる
86
+ *
87
+ * 用途: ボタン
88
+ */
89
+ readonly oval: 999999;
90
+ };
91
+ //#endregion
92
+ //#region src/breakpoint.d.ts
93
+ declare const HORIZONTAL_MIN_MARGIN = 72;
94
+ declare const BREAKPOINT: {
95
+ 10: 1160;
96
+ 12: 1368;
97
+ 6: 744;
98
+ 8: 952;
99
+ };
100
+ //#endregion
101
+ //#region src/color.d.ts
102
+ type Material = string;
103
+ type GradientMaterial = readonly {
104
+ readonly color: Material;
105
+ readonly ratio: number;
106
+ }[];
107
+ //#endregion
108
+ //#region src/effect.d.ts
109
+ type Effects = Readonly<Effect> | readonly Readonly<Effect>[];
110
+ type Effect = AlphaEffect | OpacityEffect | ReplaceEffect;
111
+ interface BaseEffect {}
112
+ interface AlphaEffect extends BaseEffect {
113
+ readonly type: "alpha";
114
+ /**
115
+ * Color to blend with the base color using alpha blending.
116
+ */
117
+ readonly color: string;
118
+ /**
119
+ * Multiplied with the alpha value of the effect's `color` before blending.
120
+ *
121
+ * `1` by default.
122
+ */
123
+ readonly opacity?: number;
124
+ }
125
+ interface OpacityEffect extends BaseEffect {
126
+ readonly type: "opacity";
127
+ /**
128
+ * Value to multiply with the current color's alpha value.
129
+ */
130
+ readonly opacity: number;
131
+ }
132
+ interface ReplaceEffect extends BaseEffect {
133
+ readonly type: "replace";
134
+ /**
135
+ * Replaces any given color with this color
136
+ */
137
+ readonly color?: string;
138
+ /**
139
+ * Replaces the alpha value with this opacity.
140
+ *
141
+ * Overrides the `color`'s opacity as well.
142
+ */
143
+ readonly opacity?: number;
144
+ }
145
+ //#endregion
146
+ export { AlphaEffect, BORDER_RADIUS, BREAKPOINT, COLUMN_UNIT, Effect, Effects, GUTTER_UNIT, GradientMaterial, HORIZONTAL_MIN_MARGIN, Material, OpacityEffect, ReplaceEffect, SPACING, TYPOGRAPHY_SIZE, TYPOGRAPHY_VARIANT, TYPOGRAPHY_WEIGHT, TypographyDescriptor, columnSystem };
8
147
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/typography.ts","../src/spacing.ts","../src/grid.ts","../src/border-radius.ts","../src/breakpoint.ts","../src/color.ts","../src/effect.ts"],"sourcesContent":[],"mappings":";UAAiB,oBAAA;EAAjB,SAAiB,UAAA,EAAA,MAAA;EAKjB,SAAa,QAAA,EAAA,MAAA;AAuBb;AAiBa,cAxCA,eAkDX,EAAA;;;;ECvDF,CAAA;;;;ECGA,CAAA;EAKA,SAAa,EAAA,EAAA;IASb,SAAgB,QAAA,EAAA,EAAA;;;;ICjBhB,SAAa,QAAA,EAAA,EAAA;;;;ICEb,SAAa,QAAA,EAAA,EAAA;IAEb,SAAa,UAAA,EAAA,EAAA;;;cJwBA;AK5BD,cL6CC,kBK7CD,EAAA,SAAA,CAAA,cAAA,EAAA,WAAA,CAAA;;;cJAC;EDAb,SAAiB,CAAA,EAAA,CAAA;EAKjB,SAAa,CAAA,EAAA,CAAA;EAuBb,SAAa,CAAA,EAAA,CAAA;EAiBb,SAAa,EAAA,EAAA,EAAA;;;;EC7Cb,SAAa,GAAA,EAAA,GAAA;;;;ACGb,CAAA;;;;AFHA;AAKA;AAuBa,cEzBA,WAAA,GFuCX,EAAA;AAGF;;;cErCa,WAAA;ADRb;;;;ACGA;AAKa,iBASG,YAAA,CATH,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;cCRA;EHAb;AAKA;AAuBA;EAiBA,SAAa,IAAA,EAAA,CAAA;;;;EC7Cb,SAAa,CAAA,EAAA,CAAA;;;;ECGb,SAAa,CAAA,EAAA,CAAA;EAKb;AASA;;;;ACjBA;;;;ACEA;AAEA;;;;ACJA,CAAA;;;cDEa,qBAAA;AJFI,cIIJ,UJJI,EAAA;EAKjB,EAAA,EAAa,IAAA;EAuBb,EAAA,EAAa,IAAA;EAiBb,CAAA,EAAa,GAAA;;;;;KK7CD,QAAA;ALAK,KKEL,gBAAA,GLFK,SAAA;EAKjB,SAAa,KAAA,EKFK,QLEL;EAuBb,SAAa,KAAA,EAAA,MAAA;AAiBb,CAAA,EAAA;;;KM7CY,OAAA,GAAU,SAAS,mBAAmB,SAAS;ANA1C,KMEL,MAAA,GAAS,WNFJ,GMEkB,aNFlB,GMEkC,aNFlC;AAKjB,UMDU,UAAA,CNCG,CAAA;AAuBA,UMtBI,WAAA,SAAoB,UNoCnC,CAAA;EAGF,SAAa,IAAA,EAAA,OAAA;;;;EC7Cb,SAAa,KAAA,EAAA,MAAA;;;;ACGb;AAKA;EASA,SAAgB,OAAA,CAAA,EAAA,MAAA;;UIGC,aAAA,SAAsB;;EHpBvC;;;;ACEA;AAEa,UEwBI,aAAA,SAAsB,UFxB1B,CAAA;;;;ACJb;EAEA,SAAY,KAAA,CAAA,EAAA,MAAA;;;;ACFZ;;WAA+B,OAAA,CAAA,EAAA,MAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,85 @@
1
+ //#region src/typography.ts
2
+ const TYPOGRAPHY_SIZE = {
3
+ 12: {
4
+ fontSize: 12,
5
+ lineHeight: 20
6
+ },
7
+ 14: {
8
+ fontSize: 14,
9
+ lineHeight: 22
10
+ },
11
+ 16: {
12
+ fontSize: 16,
13
+ lineHeight: 24
14
+ },
15
+ 20: {
16
+ fontSize: 20,
17
+ lineHeight: 28
18
+ },
19
+ 32: {
20
+ fontSize: 32,
21
+ lineHeight: 40
22
+ }
23
+ };
24
+ const TYPOGRAPHY_WEIGHT = ["regular", "bold"];
25
+ const TYPOGRAPHY_VARIANT = ["proportional", "monospace"];
26
+
27
+ //#endregion
28
+ //#region src/spacing.ts
29
+ const SPACING = {
30
+ 0: 0,
31
+ 4: 4,
32
+ 8: 8,
33
+ 16: 16,
34
+ 24: 24,
35
+ 40: 40,
36
+ 64: 64,
37
+ 104: 104,
38
+ 168: 168,
39
+ 272: 272,
40
+ 440: 440
41
+ };
42
+
43
+ //#endregion
44
+ //#region src/grid.ts
45
+ /**
46
+ * Unit for grid column (px)
47
+ */
48
+ const COLUMN_UNIT = 80;
49
+ /**
50
+ * Unit for grid gutter width (px)
51
+ */
52
+ const GUTTER_UNIT = 24;
53
+ /**
54
+ * Calculate px occupied by the span of the columns with gutter gap
55
+ *
56
+ * @param span column span count
57
+ */
58
+ function columnSystem(span, column, gutter) {
59
+ return span * column + (span - 1) * gutter;
60
+ }
61
+
62
+ //#endregion
63
+ //#region src/border-radius.ts
64
+ const BORDER_RADIUS = {
65
+ none: 0,
66
+ 4: 4,
67
+ 8: 8,
68
+ 16: 16,
69
+ 24: 24,
70
+ oval: 999999
71
+ };
72
+
73
+ //#endregion
74
+ //#region src/breakpoint.ts
75
+ const HORIZONTAL_MIN_MARGIN = 72;
76
+ const BREAKPOINT = {
77
+ [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
78
+ [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
79
+ [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
80
+ [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2
81
+ };
82
+
83
+ //#endregion
84
+ export { BORDER_RADIUS, BREAKPOINT, COLUMN_UNIT, GUTTER_UNIT, HORIZONTAL_MIN_MARGIN, SPACING, TYPOGRAPHY_SIZE, TYPOGRAPHY_VARIANT, TYPOGRAPHY_WEIGHT, columnSystem };
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/typography.ts","../src/spacing.ts","../src/grid.ts","../src/border-radius.ts","../src/breakpoint.ts"],"sourcesContent":["export interface TypographyDescriptor {\n readonly lineHeight: number\n readonly fontSize: number\n}\n\nexport const TYPOGRAPHY_SIZE = {\n 12: {\n fontSize: 12,\n lineHeight: 20,\n },\n 14: {\n fontSize: 14,\n lineHeight: 22,\n },\n 16: {\n fontSize: 16,\n lineHeight: 24,\n },\n 20: {\n fontSize: 20,\n lineHeight: 28,\n },\n 32: {\n fontSize: 32,\n lineHeight: 40,\n },\n} as const\n\nexport const TYPOGRAPHY_WEIGHT = [\n /**\n * Regular font weight\n *\n * <font-weight-absolute> ~ 400\n *\n * It should be the **DEFAULT** weight\n */\n 'regular',\n /**\n * Bolder than `regular` weight\n *\n * <font-weight-absolute> ~ 700\n */\n 'bold',\n] as const\n\nexport const TYPOGRAPHY_VARIANT = [\n /**\n * Proportional font (which has the variable amount of horizontal space)\n *\n * It should be the **DEFAULT** variant\n */\n 'proportional',\n /**\n * Monospaced font (which has the same amount of horizontal space)\n */\n 'monospace',\n] as const\n","export const SPACING = {\n 0: 0,\n 4: 4,\n 8: 8,\n 16: 16,\n 24: 24,\n 40: 40,\n 64: 64,\n 104: 104,\n 168: 168,\n 272: 272,\n 440: 440,\n} as const\n","/**\n * Unit for grid column (px)\n */\nexport const COLUMN_UNIT = 80\n\n/**\n * Unit for grid gutter width (px)\n */\nexport const GUTTER_UNIT = 24\n\n// TODO: Grid definition with breakpoint\n\n/**\n * Calculate px occupied by the span of the columns with gutter gap\n *\n * @param span column span count\n */\nexport function columnSystem(\n span: number,\n column: number,\n gutter: number\n): number {\n return span * column + (span - 1) * gutter\n}\n","export const BORDER_RADIUS = {\n /**\n * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)\n */\n none: 0,\n /**\n * 用途: バッジ, 高さ40px以下の要素\n */\n 4: 4,\n /**\n * 用途: サムネイル\n */\n 8: 8,\n /**\n * 用途: チュートリアルツールチップ\n */\n 16: 16,\n /**\n * 用途: モーダル\n */\n 24: 24,\n /**\n * 真円 or 左右が丸まっている矩形 を作る時に用いる\n *\n * 用途: ボタン\n */\n oval: 999999,\n} as const\n","import { COLUMN_UNIT, GUTTER_UNIT, columnSystem } from './grid'\n\nexport const HORIZONTAL_MIN_MARGIN = 72\n\nexport const BREAKPOINT = {\n [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n} as { 10: 1160; 12: 1368; 6: 744; 8: 952 }\n"],"mappings":";AAKA,MAAa,kBAAkB;CAC7B,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACD,IAAI;EACF,UAAU;EACV,YAAY;EACb;CACF;AAED,MAAa,oBAAoB,CAQ/B,WAMA,OACD;AAED,MAAa,qBAAqB,CAMhC,gBAIA,YACD;;;;ACxDD,MAAa,UAAU;CACrB,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACN;;;;;;;ACTD,MAAa,cAAc;;;;AAK3B,MAAa,cAAc;;;;;;AAS3B,SAAgB,aACd,MACA,QACA,QACQ;AACR,QAAO,OAAO,UAAU,OAAO,KAAK;;;;;ACtBtC,MAAa,gBAAgB;CAI3B,MAAM;CAIN,GAAG;CAIH,GAAG;CAIH,IAAI;CAIJ,IAAI;CAMJ,MAAM;CACP;;;;ACzBD,MAAa,wBAAwB;AAErC,MAAa,aAAa;EACvB,IAAI,aAAa,GAAG,aAAa,YAAY,GAAG,wBAAwB;EACxE,IAAI,aAAa,GAAG,aAAa,YAAY,GAAG,wBAAwB;EACxE,KAAK,aAAa,IAAI,aAAa,YAAY,GAAG,wBAAwB;EAC1E,KAAK,aAAa,IAAI,aAAa,YAAY,GAAG,wBAAwB;CAC5E"}
package/package.json CHANGED
@@ -1,24 +1,22 @@
1
1
  {
2
2
  "name": "@charcoal-ui/foundation",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.3",
4
4
  "license": "Apache-2.0",
5
- "main": "./dist/index.cjs.js",
6
- "module": "./dist/index.esm.js",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
7
8
  "exports": {
8
- "types": "./dist/index.d.ts",
9
- "require": "./dist/index.cjs.js",
10
- "import": "./dist/index.esm.js",
11
- "default": "./dist/index.esm.js"
9
+ "types": {
10
+ "import": "./dist/index.d.ts",
11
+ "require": "./dist/index.d.cts",
12
+ "default": "./dist/index.d.ts"
13
+ },
14
+ "require": "./dist/index.cjs",
15
+ "import": "./dist/index.js",
16
+ "default": "./dist/index.js"
12
17
  },
13
18
  "types": "./dist/index.d.ts",
14
19
  "sideEffects": false,
15
- "devDependencies": {
16
- "npm-run-all": "^4.1.5",
17
- "rimraf": "^3.0.2",
18
- "tsup": "^6.5.0",
19
- "typescript": "^4.9.5",
20
- "vitest": "^2.0.1"
21
- },
22
20
  "files": [
23
21
  "src",
24
22
  "dist"
@@ -33,10 +31,8 @@
33
31
  },
34
32
  "gitHead": "e1ece2e43901ae667afdd5c178040607d939dcd5",
35
33
  "scripts": {
36
- "build": "run-p --print-label 'build:*'",
37
- "build:bundle": "FORCE_COLOR=1 tsup",
38
- "build:dts": "tsc --project tsconfig.build.json --pretty --emitDeclarationOnly",
39
- "typecheck": "tsc --project tsconfig.build.json --pretty --noEmit",
34
+ "build": "tsdown",
35
+ "typecheck": "tsc --pretty --noEmit",
40
36
  "clean": "rimraf dist .tsbuildinfo",
41
37
  "test": "vitest run --passWithNoTests"
42
38
  }
@@ -0,0 +1,12 @@
1
+ import { BREAKPOINT } from './breakpoint'
2
+
3
+ it('checks BREAKPOINT', () => {
4
+ expect(BREAKPOINT).toMatchInlineSnapshot(`
5
+ {
6
+ "10": 1160,
7
+ "12": 1368,
8
+ "6": 744,
9
+ "8": 952,
10
+ }
11
+ `)
12
+ })
package/src/breakpoint.ts CHANGED
@@ -7,4 +7,4 @@ export const BREAKPOINT = {
7
7
  [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
8
8
  [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
9
9
  [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
10
- } as const
10
+ } as { 10: 1160; 12: 1368; 6: 744; 8: 952 }
package/src/grid.ts CHANGED
@@ -15,6 +15,10 @@ export const GUTTER_UNIT = 24
15
15
  *
16
16
  * @param span column span count
17
17
  */
18
- export function columnSystem(span: number, column: number, gutter: number) {
18
+ export function columnSystem(
19
+ span: number,
20
+ column: number,
21
+ gutter: number
22
+ ): number {
19
23
  return span * column + (span - 1) * gutter
20
24
  }
@@ -1,29 +0,0 @@
1
- export declare const BORDER_RADIUS: {
2
- /**
3
- * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)
4
- */
5
- readonly none: 0;
6
- /**
7
- * 用途: バッジ, 高さ40px以下の要素
8
- */
9
- readonly 4: 4;
10
- /**
11
- * 用途: サムネイル
12
- */
13
- readonly 8: 8;
14
- /**
15
- * 用途: チュートリアルツールチップ
16
- */
17
- readonly 16: 16;
18
- /**
19
- * 用途: モーダル
20
- */
21
- readonly 24: 24;
22
- /**
23
- * 真円 or 左右が丸まっている矩形 を作る時に用いる
24
- *
25
- * 用途: ボタン
26
- */
27
- readonly oval: 999999;
28
- };
29
- //# sourceMappingURL=border-radius.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"border-radius.d.ts","sourceRoot":"","sources":["../src/border-radius.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;CAEK,CAAA"}
@@ -1,8 +0,0 @@
1
- export declare const HORIZONTAL_MIN_MARGIN = 72;
2
- export declare const BREAKPOINT: {
3
- readonly 6: number;
4
- readonly 8: number;
5
- readonly 10: number;
6
- readonly 12: number;
7
- };
8
- //# sourceMappingURL=breakpoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoint.d.ts","sourceRoot":"","sources":["../src/breakpoint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,KAAK,CAAA;AAEvC,eAAO,MAAM,UAAU;;;;;CAKb,CAAA"}
package/dist/color.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export type Material = string;
2
- export type GradientMaterial = readonly {
3
- readonly color: Material;
4
- readonly ratio: number;
5
- }[];
6
- //# sourceMappingURL=color.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../src/color.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;AAE7B,MAAM,MAAM,gBAAgB,GAAG,SAAS;IACtC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,EAAE,CAAA"}
package/dist/effect.d.ts DELETED
@@ -1,39 +0,0 @@
1
- export type Effects = Readonly<Effect> | readonly Readonly<Effect>[];
2
- export type Effect = AlphaEffect | OpacityEffect | ReplaceEffect;
3
- interface BaseEffect {
4
- }
5
- export interface AlphaEffect extends BaseEffect {
6
- readonly type: 'alpha';
7
- /**
8
- * Color to blend with the base color using alpha blending.
9
- */
10
- readonly color: string;
11
- /**
12
- * Multiplied with the alpha value of the effect's `color` before blending.
13
- *
14
- * `1` by default.
15
- */
16
- readonly opacity?: number;
17
- }
18
- export interface OpacityEffect extends BaseEffect {
19
- readonly type: 'opacity';
20
- /**
21
- * Value to multiply with the current color's alpha value.
22
- */
23
- readonly opacity: number;
24
- }
25
- export interface ReplaceEffect extends BaseEffect {
26
- readonly type: 'replace';
27
- /**
28
- * Replaces any given color with this color
29
- */
30
- readonly color?: string;
31
- /**
32
- * Replaces the alpha value with this opacity.
33
- *
34
- * Overrides the `color`'s opacity as well.
35
- */
36
- readonly opacity?: number;
37
- }
38
- export {};
39
- //# sourceMappingURL=effect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../src/effect.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAA;AAEpE,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,aAAa,CAAA;AAEhE,UAAU,UAAU;CAAG;AAEvB,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B"}
package/dist/grid.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Unit for grid column (px)
3
- */
4
- export declare const COLUMN_UNIT = 80;
5
- /**
6
- * Unit for grid gutter width (px)
7
- */
8
- export declare const GUTTER_UNIT = 24;
9
- /**
10
- * Calculate px occupied by the span of the columns with gutter gap
11
- *
12
- * @param span column span count
13
- */
14
- export declare function columnSystem(span: number, column: number, gutter: number): number;
15
- //# sourceMappingURL=grid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../src/grid.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW,KAAK,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,WAAW,KAAK,CAAA;AAI7B;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAExE"}
package/dist/index.cjs.js DELETED
@@ -1,161 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- BORDER_RADIUS: () => BORDER_RADIUS,
24
- BREAKPOINT: () => BREAKPOINT,
25
- COLUMN_UNIT: () => COLUMN_UNIT,
26
- GUTTER_UNIT: () => GUTTER_UNIT,
27
- HORIZONTAL_MIN_MARGIN: () => HORIZONTAL_MIN_MARGIN,
28
- SPACING: () => SPACING,
29
- TYPOGRAPHY_SIZE: () => TYPOGRAPHY_SIZE,
30
- TYPOGRAPHY_VARIANT: () => TYPOGRAPHY_VARIANT,
31
- TYPOGRAPHY_WEIGHT: () => TYPOGRAPHY_WEIGHT,
32
- columnSystem: () => columnSystem
33
- });
34
- module.exports = __toCommonJS(src_exports);
35
-
36
- // src/typography.ts
37
- var TYPOGRAPHY_SIZE = {
38
- 12: {
39
- fontSize: 12,
40
- lineHeight: 20
41
- },
42
- 14: {
43
- fontSize: 14,
44
- lineHeight: 22
45
- },
46
- 16: {
47
- fontSize: 16,
48
- lineHeight: 24
49
- },
50
- 20: {
51
- fontSize: 20,
52
- lineHeight: 28
53
- },
54
- 32: {
55
- fontSize: 32,
56
- lineHeight: 40
57
- }
58
- };
59
- var TYPOGRAPHY_WEIGHT = [
60
- /**
61
- * Regular font weight
62
- *
63
- * <font-weight-absolute> ~ 400
64
- *
65
- * It should be the **DEFAULT** weight
66
- */
67
- "regular",
68
- /**
69
- * Bolder than `regular` weight
70
- *
71
- * <font-weight-absolute> ~ 700
72
- */
73
- "bold"
74
- ];
75
- var TYPOGRAPHY_VARIANT = [
76
- /**
77
- * Proportional font (which has the variable amount of horizontal space)
78
- *
79
- * It should be the **DEFAULT** variant
80
- */
81
- "proportional",
82
- /**
83
- * Monospaced font (which has the same amount of horizontal space)
84
- */
85
- "monospace"
86
- ];
87
-
88
- // src/spacing.ts
89
- var SPACING = {
90
- 0: 0,
91
- 4: 4,
92
- 8: 8,
93
- 16: 16,
94
- 24: 24,
95
- 40: 40,
96
- 64: 64,
97
- 104: 104,
98
- 168: 168,
99
- 272: 272,
100
- 440: 440
101
- };
102
-
103
- // src/grid.ts
104
- var COLUMN_UNIT = 80;
105
- var GUTTER_UNIT = 24;
106
- function columnSystem(span, column, gutter) {
107
- return span * column + (span - 1) * gutter;
108
- }
109
-
110
- // src/border-radius.ts
111
- var BORDER_RADIUS = {
112
- /**
113
- * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)
114
- */
115
- none: 0,
116
- /**
117
- * 用途: バッジ, 高さ40px以下の要素
118
- */
119
- 4: 4,
120
- /**
121
- * 用途: サムネイル
122
- */
123
- 8: 8,
124
- /**
125
- * 用途: チュートリアルツールチップ
126
- */
127
- 16: 16,
128
- /**
129
- * 用途: モーダル
130
- */
131
- 24: 24,
132
- /**
133
- * 真円 or 左右が丸まっている矩形 を作る時に用いる
134
- *
135
- * 用途: ボタン
136
- */
137
- oval: 999999
138
- };
139
-
140
- // src/breakpoint.ts
141
- var HORIZONTAL_MIN_MARGIN = 72;
142
- var BREAKPOINT = {
143
- [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
144
- [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
145
- [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
146
- [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2
147
- };
148
- // Annotate the CommonJS export names for ESM import in node:
149
- 0 && (module.exports = {
150
- BORDER_RADIUS,
151
- BREAKPOINT,
152
- COLUMN_UNIT,
153
- GUTTER_UNIT,
154
- HORIZONTAL_MIN_MARGIN,
155
- SPACING,
156
- TYPOGRAPHY_SIZE,
157
- TYPOGRAPHY_VARIANT,
158
- TYPOGRAPHY_WEIGHT,
159
- columnSystem
160
- });
161
- //# sourceMappingURL=index.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/typography.ts","../src/spacing.ts","../src/grid.ts","../src/border-radius.ts","../src/breakpoint.ts"],"sourcesContent":["export * from './typography'\nexport * from './spacing'\nexport * from './grid'\nexport * from './border-radius'\nexport * from './breakpoint'\nexport * from './color'\nexport * from './effect'\n","export interface TypographyDescriptor {\n readonly lineHeight: number\n readonly fontSize: number\n}\n\nexport const TYPOGRAPHY_SIZE = {\n 12: {\n fontSize: 12,\n lineHeight: 20,\n },\n 14: {\n fontSize: 14,\n lineHeight: 22,\n },\n 16: {\n fontSize: 16,\n lineHeight: 24,\n },\n 20: {\n fontSize: 20,\n lineHeight: 28,\n },\n 32: {\n fontSize: 32,\n lineHeight: 40,\n },\n} as const\n\nexport const TYPOGRAPHY_WEIGHT = [\n /**\n * Regular font weight\n *\n * <font-weight-absolute> ~ 400\n *\n * It should be the **DEFAULT** weight\n */\n 'regular',\n /**\n * Bolder than `regular` weight\n *\n * <font-weight-absolute> ~ 700\n */\n 'bold',\n] as const\n\nexport const TYPOGRAPHY_VARIANT = [\n /**\n * Proportional font (which has the variable amount of horizontal space)\n *\n * It should be the **DEFAULT** variant\n */\n 'proportional',\n /**\n * Monospaced font (which has the same amount of horizontal space)\n */\n 'monospace',\n] as const\n","export const SPACING = {\n 0: 0,\n 4: 4,\n 8: 8,\n 16: 16,\n 24: 24,\n 40: 40,\n 64: 64,\n 104: 104,\n 168: 168,\n 272: 272,\n 440: 440,\n} as const\n","/**\n * Unit for grid column (px)\n */\nexport const COLUMN_UNIT = 80\n\n/**\n * Unit for grid gutter width (px)\n */\nexport const GUTTER_UNIT = 24\n\n// TODO: Grid definition with breakpoint\n\n/**\n * Calculate px occupied by the span of the columns with gutter gap\n *\n * @param span column span count\n */\nexport function columnSystem(span: number, column: number, gutter: number) {\n return span * column + (span - 1) * gutter\n}\n","export const BORDER_RADIUS = {\n /**\n * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)\n */\n none: 0,\n /**\n * 用途: バッジ, 高さ40px以下の要素\n */\n 4: 4,\n /**\n * 用途: サムネイル\n */\n 8: 8,\n /**\n * 用途: チュートリアルツールチップ\n */\n 16: 16,\n /**\n * 用途: モーダル\n */\n 24: 24,\n /**\n * 真円 or 左右が丸まっている矩形 を作る時に用いる\n *\n * 用途: ボタン\n */\n oval: 999999,\n} as const\n","import { COLUMN_UNIT, GUTTER_UNIT, columnSystem } from './grid'\n\nexport const HORIZONTAL_MIN_MARGIN = 72\n\nexport const BREAKPOINT = {\n [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,kBAAkB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AACF;AAEO,IAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AACF;AAEO,IAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhC;AAAA;AAAA;AAAA;AAAA,EAIA;AACF;;;ACxDO,IAAM,UAAU;AAAA,EACrB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;;;ACTO,IAAM,cAAc;AAKpB,IAAM,cAAc;AASpB,SAAS,aAAa,MAAc,QAAgB,QAAgB;AACzE,SAAO,OAAO,UAAU,OAAO,KAAK;AACtC;;;ACnBO,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAI3B,MAAM;AAAA;AAAA;AAAA;AAAA,EAIN,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,MAAM;AACR;;;ACzBO,IAAM,wBAAwB;AAE9B,IAAM,aAAa;AAAA,EACxB,CAAC,CAAC,GAAG,aAAa,GAAG,aAAa,WAAW,IAAI,wBAAwB;AAAA,EACzE,CAAC,CAAC,GAAG,aAAa,GAAG,aAAa,WAAW,IAAI,wBAAwB;AAAA,EACzE,CAAC,EAAE,GAAG,aAAa,IAAI,aAAa,WAAW,IAAI,wBAAwB;AAAA,EAC3E,CAAC,EAAE,GAAG,aAAa,IAAI,aAAa,WAAW,IAAI,wBAAwB;AAC7E;","names":[]}
package/dist/index.esm.js DELETED
@@ -1,125 +0,0 @@
1
- // src/typography.ts
2
- var TYPOGRAPHY_SIZE = {
3
- 12: {
4
- fontSize: 12,
5
- lineHeight: 20
6
- },
7
- 14: {
8
- fontSize: 14,
9
- lineHeight: 22
10
- },
11
- 16: {
12
- fontSize: 16,
13
- lineHeight: 24
14
- },
15
- 20: {
16
- fontSize: 20,
17
- lineHeight: 28
18
- },
19
- 32: {
20
- fontSize: 32,
21
- lineHeight: 40
22
- }
23
- };
24
- var TYPOGRAPHY_WEIGHT = [
25
- /**
26
- * Regular font weight
27
- *
28
- * <font-weight-absolute> ~ 400
29
- *
30
- * It should be the **DEFAULT** weight
31
- */
32
- "regular",
33
- /**
34
- * Bolder than `regular` weight
35
- *
36
- * <font-weight-absolute> ~ 700
37
- */
38
- "bold"
39
- ];
40
- var TYPOGRAPHY_VARIANT = [
41
- /**
42
- * Proportional font (which has the variable amount of horizontal space)
43
- *
44
- * It should be the **DEFAULT** variant
45
- */
46
- "proportional",
47
- /**
48
- * Monospaced font (which has the same amount of horizontal space)
49
- */
50
- "monospace"
51
- ];
52
-
53
- // src/spacing.ts
54
- var SPACING = {
55
- 0: 0,
56
- 4: 4,
57
- 8: 8,
58
- 16: 16,
59
- 24: 24,
60
- 40: 40,
61
- 64: 64,
62
- 104: 104,
63
- 168: 168,
64
- 272: 272,
65
- 440: 440
66
- };
67
-
68
- // src/grid.ts
69
- var COLUMN_UNIT = 80;
70
- var GUTTER_UNIT = 24;
71
- function columnSystem(span, column, gutter) {
72
- return span * column + (span - 1) * gutter;
73
- }
74
-
75
- // src/border-radius.ts
76
- var BORDER_RADIUS = {
77
- /**
78
- * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)
79
- */
80
- none: 0,
81
- /**
82
- * 用途: バッジ, 高さ40px以下の要素
83
- */
84
- 4: 4,
85
- /**
86
- * 用途: サムネイル
87
- */
88
- 8: 8,
89
- /**
90
- * 用途: チュートリアルツールチップ
91
- */
92
- 16: 16,
93
- /**
94
- * 用途: モーダル
95
- */
96
- 24: 24,
97
- /**
98
- * 真円 or 左右が丸まっている矩形 を作る時に用いる
99
- *
100
- * 用途: ボタン
101
- */
102
- oval: 999999
103
- };
104
-
105
- // src/breakpoint.ts
106
- var HORIZONTAL_MIN_MARGIN = 72;
107
- var BREAKPOINT = {
108
- [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
109
- [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
110
- [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,
111
- [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2
112
- };
113
- export {
114
- BORDER_RADIUS,
115
- BREAKPOINT,
116
- COLUMN_UNIT,
117
- GUTTER_UNIT,
118
- HORIZONTAL_MIN_MARGIN,
119
- SPACING,
120
- TYPOGRAPHY_SIZE,
121
- TYPOGRAPHY_VARIANT,
122
- TYPOGRAPHY_WEIGHT,
123
- columnSystem
124
- };
125
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/typography.ts","../src/spacing.ts","../src/grid.ts","../src/border-radius.ts","../src/breakpoint.ts"],"sourcesContent":["export interface TypographyDescriptor {\n readonly lineHeight: number\n readonly fontSize: number\n}\n\nexport const TYPOGRAPHY_SIZE = {\n 12: {\n fontSize: 12,\n lineHeight: 20,\n },\n 14: {\n fontSize: 14,\n lineHeight: 22,\n },\n 16: {\n fontSize: 16,\n lineHeight: 24,\n },\n 20: {\n fontSize: 20,\n lineHeight: 28,\n },\n 32: {\n fontSize: 32,\n lineHeight: 40,\n },\n} as const\n\nexport const TYPOGRAPHY_WEIGHT = [\n /**\n * Regular font weight\n *\n * <font-weight-absolute> ~ 400\n *\n * It should be the **DEFAULT** weight\n */\n 'regular',\n /**\n * Bolder than `regular` weight\n *\n * <font-weight-absolute> ~ 700\n */\n 'bold',\n] as const\n\nexport const TYPOGRAPHY_VARIANT = [\n /**\n * Proportional font (which has the variable amount of horizontal space)\n *\n * It should be the **DEFAULT** variant\n */\n 'proportional',\n /**\n * Monospaced font (which has the same amount of horizontal space)\n */\n 'monospace',\n] as const\n","export const SPACING = {\n 0: 0,\n 4: 4,\n 8: 8,\n 16: 16,\n 24: 24,\n 40: 40,\n 64: 64,\n 104: 104,\n 168: 168,\n 272: 272,\n 440: 440,\n} as const\n","/**\n * Unit for grid column (px)\n */\nexport const COLUMN_UNIT = 80\n\n/**\n * Unit for grid gutter width (px)\n */\nexport const GUTTER_UNIT = 24\n\n// TODO: Grid definition with breakpoint\n\n/**\n * Calculate px occupied by the span of the columns with gutter gap\n *\n * @param span column span count\n */\nexport function columnSystem(span: number, column: number, gutter: number) {\n return span * column + (span - 1) * gutter\n}\n","export const BORDER_RADIUS = {\n /**\n * 用途: 打ち消し用(モバイルのときに角丸じゃなくなる、などを表現する)\n */\n none: 0,\n /**\n * 用途: バッジ, 高さ40px以下の要素\n */\n 4: 4,\n /**\n * 用途: サムネイル\n */\n 8: 8,\n /**\n * 用途: チュートリアルツールチップ\n */\n 16: 16,\n /**\n * 用途: モーダル\n */\n 24: 24,\n /**\n * 真円 or 左右が丸まっている矩形 を作る時に用いる\n *\n * 用途: ボタン\n */\n oval: 999999,\n} as const\n","import { COLUMN_UNIT, GUTTER_UNIT, columnSystem } from './grid'\n\nexport const HORIZONTAL_MIN_MARGIN = 72\n\nexport const BREAKPOINT = {\n [6]: columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [8]: columnSystem(8, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [10]: columnSystem(10, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n [12]: columnSystem(12, COLUMN_UNIT, GUTTER_UNIT) + HORIZONTAL_MIN_MARGIN * 2,\n} as const\n"],"mappings":";AAKO,IAAM,kBAAkB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AACF;AAEO,IAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AACF;AAEO,IAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhC;AAAA;AAAA;AAAA;AAAA,EAIA;AACF;;;ACxDO,IAAM,UAAU;AAAA,EACrB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;;;ACTO,IAAM,cAAc;AAKpB,IAAM,cAAc;AASpB,SAAS,aAAa,MAAc,QAAgB,QAAgB;AACzE,SAAO,OAAO,UAAU,OAAO,KAAK;AACtC;;;ACnBO,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAI3B,MAAM;AAAA;AAAA;AAAA;AAAA,EAIN,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,MAAM;AACR;;;ACzBO,IAAM,wBAAwB;AAE9B,IAAM,aAAa;AAAA,EACxB,CAAC,CAAC,GAAG,aAAa,GAAG,aAAa,WAAW,IAAI,wBAAwB;AAAA,EACzE,CAAC,CAAC,GAAG,aAAa,GAAG,aAAa,WAAW,IAAI,wBAAwB;AAAA,EACzE,CAAC,EAAE,GAAG,aAAa,IAAI,aAAa,WAAW,IAAI,wBAAwB;AAAA,EAC3E,CAAC,EAAE,GAAG,aAAa,IAAI,aAAa,WAAW,IAAI,wBAAwB;AAC7E;","names":[]}
package/dist/spacing.d.ts DELETED
@@ -1,14 +0,0 @@
1
- export declare const SPACING: {
2
- readonly 0: 0;
3
- readonly 4: 4;
4
- readonly 8: 8;
5
- readonly 16: 16;
6
- readonly 24: 24;
7
- readonly 40: 40;
8
- readonly 64: 64;
9
- readonly 104: 104;
10
- readonly 168: 168;
11
- readonly 272: 272;
12
- readonly 440: 440;
13
- };
14
- //# sourceMappingURL=spacing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../src/spacing.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYV,CAAA"}
@@ -1,29 +0,0 @@
1
- export interface TypographyDescriptor {
2
- readonly lineHeight: number;
3
- readonly fontSize: number;
4
- }
5
- export declare const TYPOGRAPHY_SIZE: {
6
- readonly 12: {
7
- readonly fontSize: 12;
8
- readonly lineHeight: 20;
9
- };
10
- readonly 14: {
11
- readonly fontSize: 14;
12
- readonly lineHeight: 22;
13
- };
14
- readonly 16: {
15
- readonly fontSize: 16;
16
- readonly lineHeight: 24;
17
- };
18
- readonly 20: {
19
- readonly fontSize: 20;
20
- readonly lineHeight: 28;
21
- };
22
- readonly 32: {
23
- readonly fontSize: 32;
24
- readonly lineHeight: 40;
25
- };
26
- };
27
- export declare const TYPOGRAPHY_WEIGHT: readonly ["regular", "bold"];
28
- export declare const TYPOGRAPHY_VARIANT: readonly ["proportional", "monospace"];
29
- //# sourceMappingURL=typography.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../src/typography.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;CAqBlB,CAAA;AAEV,eAAO,MAAM,iBAAiB,8BAepB,CAAA;AAEV,eAAO,MAAM,kBAAkB,wCAWrB,CAAA"}