timvir 0.2.20 → 0.2.22
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/blocks/Arbitrary/index.js +2 -9
- package/blocks/Code/index.js +3 -3
- package/blocks/Exhibit/index.js +3 -3
- package/blocks/Font/docs/index.mdx +20 -15
- package/blocks/Font/index.js +11 -9
- package/blocks/Font/samples/timvir/body1.d.ts +5 -0
- package/blocks/Font/samples/timvir/caption.d.ts +5 -0
- package/blocks/Font/samples/timvir/h1.d.ts +5 -0
- package/blocks/Font/samples/timvir/h2.d.ts +5 -0
- package/blocks/Font/samples/timvir/h3.d.ts +5 -0
- package/blocks/Font/samples/timvir/h4.d.ts +5 -0
- package/blocks/Font/styles.css +7 -8
- package/blocks/Icon/types.d.ts +0 -1
- package/blocks/Viewport/index.js +1 -1
- package/blocks/styles.css +7 -8
- package/core/styles.css +1 -1
- package/package.json +1 -1
- package/styles.css +8 -9
- package/blocks/Font/samples/system.d.ts +0 -2
|
@@ -128,7 +128,7 @@ function Arbitrary(props, ref) {
|
|
|
128
128
|
value: value
|
|
129
129
|
}, /*#__PURE__*/React.createElement(Root, {
|
|
130
130
|
ref: ref,
|
|
131
|
-
className: cx_default(classes.root, className),
|
|
131
|
+
className: cx_default("timvir-b-Arbitrary", classes.root, className),
|
|
132
132
|
...rest
|
|
133
133
|
}, /*#__PURE__*/React.createElement("div", {
|
|
134
134
|
className: classes.controls
|
|
@@ -137,7 +137,7 @@ function Arbitrary(props, ref) {
|
|
|
137
137
|
}, /*#__PURE__*/React.createElement("span", {
|
|
138
138
|
className: classes.startAdornment
|
|
139
139
|
}, "Seed:"), /*#__PURE__*/React.createElement("input", {
|
|
140
|
-
className: classes.input,
|
|
140
|
+
className: cx_default("timvir-b-Arbitrary-seed", classes.input),
|
|
141
141
|
placeholder: "Seed",
|
|
142
142
|
value: encode(new TextEncoder().encode(`${value.seed}`)),
|
|
143
143
|
readOnly: true,
|
|
@@ -158,13 +158,6 @@ function Arbitrary(props, ref) {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
}, "Refresh")), /*#__PURE__*/React.createElement(Exhibit, {
|
|
161
|
-
bleed: 0,
|
|
162
|
-
BackdropProps: {
|
|
163
|
-
style: {
|
|
164
|
-
borderRadius: 2,
|
|
165
|
-
border: "1px solid var(--timvir-border-color)"
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
161
|
...ExhibitProps
|
|
169
162
|
}, children)));
|
|
170
163
|
}
|
package/blocks/Code/index.js
CHANGED
|
@@ -95,10 +95,10 @@ function Code(props, ref) {
|
|
|
95
95
|
}, [mutate, children, language]);
|
|
96
96
|
return /*#__PURE__*/React.createElement(Root, {
|
|
97
97
|
ref: ref,
|
|
98
|
-
className: cx_default(classes.root, fullWidth && Page.fullWidth),
|
|
98
|
+
className: cx_default("timvir-b-Code", classes.root, fullWidth && Page.fullWidth),
|
|
99
99
|
...rest
|
|
100
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: cx_default(className, theme, classes.code, fullWidth && classes.fullWidth)
|
|
101
|
+
className: cx_default("timvir-b-Code-container", className, theme, classes.code, fullWidth && classes.fullWidth)
|
|
102
102
|
}, /*#__PURE__*/React.createElement("div", {
|
|
103
103
|
className: "d1513p2s",
|
|
104
104
|
onMouseEnter: () => {
|
|
@@ -137,7 +137,7 @@ function Code(props, ref) {
|
|
|
137
137
|
__html: state.html
|
|
138
138
|
}
|
|
139
139
|
}))), caption && /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
className: classes.caption
|
|
140
|
+
className: cx_default("timvir-b-Code-caption", classes.caption)
|
|
141
141
|
}, caption));
|
|
142
142
|
}
|
|
143
143
|
var Code$1 = /*#__PURE__*/React.forwardRef(Code);
|
package/blocks/Exhibit/index.js
CHANGED
|
@@ -53,21 +53,21 @@ function Exhibit(props, ref) {
|
|
|
53
53
|
} = block.props;
|
|
54
54
|
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(components.h3, null, title), /*#__PURE__*/React.createElement(Root, {
|
|
55
55
|
ref: ref,
|
|
56
|
-
className: cx_default(className, classes.root),
|
|
56
|
+
className: cx_default("timvir-b-Exhibit", className, classes.root),
|
|
57
57
|
style: {
|
|
58
58
|
...style,
|
|
59
59
|
[cssVariables.bleed]: typeof bleed === "number" ? `${bleed}px` : undefined
|
|
60
60
|
},
|
|
61
61
|
...rest
|
|
62
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: classes.container,
|
|
63
|
+
className: cx_default("timvir-b-Exhibit-container", classes.container),
|
|
64
64
|
...BackdropProps,
|
|
65
65
|
style: {
|
|
66
66
|
border: bleed === 0 ? "none" : `1px solid var(${cssVariables.borderColor})`,
|
|
67
67
|
...BackdropProps?.style
|
|
68
68
|
}
|
|
69
69
|
}, children), caption && /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: classes.caption
|
|
70
|
+
className: cx_default("timvir-b-Exhibit-caption", classes.caption)
|
|
71
71
|
}, caption)));
|
|
72
72
|
}
|
|
73
73
|
var Exhibit$1 = /*#__PURE__*/React.forwardRef(Exhibit);
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Code } from "../../Code";
|
|
3
|
-
import { Viewport } from "../../Viewport";
|
|
1
|
+
import { Exhibit } from "../../Exhibit";
|
|
4
2
|
|
|
5
3
|
# Font
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
The Font block displays a sample text in a given font, and provides basic information about the font metrics.
|
|
6
|
+
The metrics show the actual, computed font size and line height values from the DOM.
|
|
7
|
+
They are updated in real time to support fonts that make use of dynamic CSS units (such as `vw`).
|
|
8
|
+
To provide context (such as where this font is used, or instructions for developers how to apply the font style), use the info option.
|
|
8
9
|
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
</
|
|
10
|
+
<Exhibit caption="A Font block inside an Exhibit. You would not usually use it like that but here we do to better illustrate what it contains.">
|
|
11
|
+
<Sample variant="basic" />
|
|
12
|
+
</Exhibit>
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
Originally called Neuste schmale fette Zeitungs-Grotesk, the design was listed in this catalogue as Enge fette Grotesque. It was a straight-sided sans serif with rounded terminals, and it bears no relation to any styles of Akzidenz-Grotesk. The remaining three sans serif designs in that undated, post-sale catalogue were Schmale magere Grotesque, Breite Grotesque, and Breite fette Grotesque.
|
|
15
|
-
</Font>
|
|
14
|
+
## Timvir Font System
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
The samples below illustrate the font system used by Timvir itself.
|
|
17
|
+
Note that the Timvir font system is currently (for most parts) not responsive.
|
|
18
|
+
The font sizes remain the same across all viewport sizes.
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
In Timvir itself, ont sizes are always specified in rem, line height in unitless values.
|
|
21
|
+
This ensures the font size scales when the user has set a non-standard font size in their browser (currently Chrome and Firefox offer such option, Safari does not).
|
|
22
22
|
|
|
23
|
-
<
|
|
23
|
+
<Sample variant="timvir/h1" />
|
|
24
|
+
<Sample variant="timvir/h2" />
|
|
25
|
+
<Sample variant="timvir/h3" />
|
|
26
|
+
<Sample variant="timvir/h4" />
|
|
27
|
+
<Sample variant="timvir/body1" />
|
|
28
|
+
<Sample variant="timvir/caption" />
|
package/blocks/Font/index.js
CHANGED
|
@@ -59,7 +59,9 @@ function Font(props, ref) {
|
|
|
59
59
|
const computedStyle = window.getComputedStyle(contentRef);
|
|
60
60
|
const intervalId = setInterval(() => {
|
|
61
61
|
if (fontSizeRef) {
|
|
62
|
-
const
|
|
62
|
+
const fontSize = parseInt(computedStyle.fontSize, 10);
|
|
63
|
+
const lineHeight = parseInt(computedStyle.lineHeight, 10);
|
|
64
|
+
const innerText = `${name} – ${Math.round(fontSize)}px / ${Math.round(lineHeight / fontSize * 1000) / 1000}`;
|
|
63
65
|
if (fontSizeRef.innerText !== innerText) {
|
|
64
66
|
fontSizeRef.innerText = innerText;
|
|
65
67
|
}
|
|
@@ -72,16 +74,16 @@ function Font(props, ref) {
|
|
|
72
74
|
}, [name, contentRef]);
|
|
73
75
|
return /*#__PURE__*/React.createElement(Root, {
|
|
74
76
|
ref: ref,
|
|
75
|
-
className: cx_default(className
|
|
77
|
+
className: cx_default(className),
|
|
76
78
|
...rest
|
|
77
79
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
80
|
className: classes.meta
|
|
79
81
|
}, /*#__PURE__*/React.createElement(components.h3, {
|
|
80
|
-
className: "
|
|
82
|
+
className: "fc7ivp5"
|
|
81
83
|
}, /*#__PURE__*/React.createElement("span", {
|
|
82
84
|
ref: setFontSizeRef
|
|
83
85
|
}, name)), info && /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: "
|
|
86
|
+
className: "de58upx",
|
|
85
87
|
onClick: () => {
|
|
86
88
|
if (infoRef && contentRef) {
|
|
87
89
|
// const contentParent = contentRef.parentElement;
|
|
@@ -104,18 +106,18 @@ function Font(props, ref) {
|
|
|
104
106
|
}, /*#__PURE__*/React.createElement(Icons.Info, {
|
|
105
107
|
size: "1.1em"
|
|
106
108
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
className: "
|
|
109
|
+
className: "d10949ho"
|
|
108
110
|
}, info && /*#__PURE__*/React.createElement("div", {
|
|
109
|
-
className: "
|
|
111
|
+
className: "d1o2du3z",
|
|
110
112
|
style: {
|
|
111
113
|
height: 0,
|
|
112
114
|
opacity: 0
|
|
113
115
|
}
|
|
114
116
|
}, /*#__PURE__*/React.createElement("div", {
|
|
115
117
|
ref: setInfoRef,
|
|
116
|
-
className: "
|
|
118
|
+
className: "d1o9zhgl"
|
|
117
119
|
}, info)), /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: "
|
|
120
|
+
className: "ddlplux",
|
|
119
121
|
style: {
|
|
120
122
|
height: "auto",
|
|
121
123
|
opacity: 1
|
|
@@ -124,7 +126,7 @@ function Font(props, ref) {
|
|
|
124
126
|
ref: setContentRef,
|
|
125
127
|
contentEditable: true,
|
|
126
128
|
spellCheck: "false",
|
|
127
|
-
className: cx_default(font.className, "
|
|
129
|
+
className: cx_default(font.className, "dw285p4"),
|
|
128
130
|
style: font.style
|
|
129
131
|
}, children || "The quick brown fox jumps over the lazy dog"))));
|
|
130
132
|
}
|
package/blocks/Font/styles.css
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
.mby32tn{display:flex;align-items:baseline;font-size:0.9rem;font-weight:bold;transition:all 0.2s;}
|
|
2
|
-
.
|
|
3
|
-
.
|
|
4
|
-
.d10949ho{
|
|
5
|
-
.d1o2du3z{
|
|
6
|
-
.d1o9zhgl{
|
|
7
|
-
.ddlplux{
|
|
8
|
-
.dw285p4{
|
|
9
|
-
.dx3nfmc{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
|
|
2
|
+
.fc7ivp5{margin:0 auto 0 0;}
|
|
3
|
+
.de58upx{cursor:pointer;}.de58upx:hover{color:var(--c-p-4);opacity:1;}.de58upx > svg{position:relative;top:2px;}
|
|
4
|
+
.d10949ho{display:flex;flex-direction:column;}
|
|
5
|
+
.d1o2du3z{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
|
|
6
|
+
.d1o9zhgl{padding:0 0 16px;}
|
|
7
|
+
.ddlplux{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
|
|
8
|
+
.dw285p4{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
|
|
10
9
|
|
package/blocks/Icon/types.d.ts
CHANGED
package/blocks/Viewport/index.js
CHANGED
|
@@ -249,7 +249,7 @@ function Viewport(props, ref) {
|
|
|
249
249
|
}), /*#__PURE__*/React.createElement(Root, {
|
|
250
250
|
ref: ref,
|
|
251
251
|
...rest,
|
|
252
|
-
className: cx_default(className, fullWidth, "r1ouu0bc")
|
|
252
|
+
className: cx_default("timvir-b-Viewport", className, fullWidth, "r1ouu0bc")
|
|
253
253
|
}, /*#__PURE__*/React.createElement("div", {
|
|
254
254
|
ref: svgRef,
|
|
255
255
|
className: "d1uj09ka"
|
package/blocks/styles.css
CHANGED
|
@@ -40,14 +40,13 @@
|
|
|
40
40
|
.cf43jjx{font-size:0.8125rem;line-height:1.1875;color:var(--timvir-secondary-text-color);margin-top:0.3em;}
|
|
41
41
|
|
|
42
42
|
.mby32tn{display:flex;align-items:baseline;font-size:0.9rem;font-weight:bold;transition:all 0.2s;}
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.d10949ho{
|
|
46
|
-
.d1o2du3z{
|
|
47
|
-
.d1o9zhgl{
|
|
48
|
-
.ddlplux{
|
|
49
|
-
.dw285p4{
|
|
50
|
-
.dx3nfmc{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
|
|
43
|
+
.fc7ivp5{margin:0 auto 0 0;}
|
|
44
|
+
.de58upx{cursor:pointer;}.de58upx:hover{color:var(--c-p-4);opacity:1;}.de58upx > svg{position:relative;top:2px;}
|
|
45
|
+
.d10949ho{display:flex;flex-direction:column;}
|
|
46
|
+
.d1o2du3z{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
|
|
47
|
+
.d1o9zhgl{padding:0 0 16px;}
|
|
48
|
+
.ddlplux{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
|
|
49
|
+
.dw285p4{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
|
|
51
50
|
|
|
52
51
|
.r1c1ozpm{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--timvir-page-margin,24px);--timvir-margin:calc(var(--timvir-page-margin,24px) * 0.5);}
|
|
53
52
|
|
package/core/styles.css
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
.rymvrdu{padding:50px 0 80px;display:grid;grid-auto-rows:min-content;grid-template-columns:[le] var(--timvir-page-margin) [lex lc] 1fr [rc rex] var(--timvir-page-margin) [re];}@media (min-width:48rem){.rymvrdu{grid-template-columns: [le] var(--timvir-page-margin) [lex] 1fr [lc] minmax(0,48rem) [rc] 1fr [rex] var(--timvir-page-margin) [re];}}@media (min-width:72rem){.rymvrdu{grid-template-columns: [le] 1fr var(--timvir-page-margin) [lex] minmax(0,12rem) [lc] 48rem [rc] minmax(0,12rem) [rex] var( --timvir-page-margin ) 1fr [re];}}.rymvrdu > *{grid-column:lc / rc;}
|
|
32
32
|
|
|
33
33
|
.a12hs2f7{color:inherit;text-decoration:none;}.a12hs2f7:hover svg{opacity:1;transform:none;visibility:visible;--visibility-delay:0s;}
|
|
34
|
-
.c31avqb{margin-left:6px;color:var(--timvir-secondary-text-color);height:0.9rem;width:0.9rem;vertical-align:middle;transition:opacity 0.2s,transform 0.2s,visibility 0s var(--visibility-delay,0.2s);opacity:0;visibility:hidden;transform:translateX(-50%);}
|
|
34
|
+
.c31avqb{display:inline-block;margin-left:6px;color:var(--timvir-secondary-text-color);height:0.9rem;width:0.9rem;vertical-align:middle;transition:opacity 0.2s,transform 0.2s,visibility 0s var(--visibility-delay,0.2s);opacity:0;visibility:hidden;transform:translateX(-50%);}
|
|
35
35
|
.h6ceq1b{margin-top:3rem;margin-bottom:1rem;font-size:2rem;line-height:1.125;font-weight:590;text-indent:-0.05em;}
|
|
36
36
|
.hj6166y{position:relative;margin:2.5rem 0 1rem;font-size:1.5rem;line-height:1.1666;font-weight:590;}
|
|
37
37
|
.h1f8mqks{position:relative;margin:1rem 0 1rem;font-size:1.0625rem;line-height:1.4705882353;font-weight:590;}
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -40,14 +40,13 @@
|
|
|
40
40
|
.cf43jjx{font-size:0.8125rem;line-height:1.1875;color:var(--timvir-secondary-text-color);margin-top:0.3em;}
|
|
41
41
|
|
|
42
42
|
.mby32tn{display:flex;align-items:baseline;font-size:0.9rem;font-weight:bold;transition:all 0.2s;}
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.d10949ho{
|
|
46
|
-
.d1o2du3z{
|
|
47
|
-
.d1o9zhgl{
|
|
48
|
-
.ddlplux{
|
|
49
|
-
.dw285p4{
|
|
50
|
-
.dx3nfmc{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
|
|
43
|
+
.fc7ivp5{margin:0 auto 0 0;}
|
|
44
|
+
.de58upx{cursor:pointer;}.de58upx:hover{color:var(--c-p-4);opacity:1;}.de58upx > svg{position:relative;top:2px;}
|
|
45
|
+
.d10949ho{display:flex;flex-direction:column;}
|
|
46
|
+
.d1o2du3z{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
|
|
47
|
+
.d1o9zhgl{padding:0 0 16px;}
|
|
48
|
+
.ddlplux{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
|
|
49
|
+
.dw285p4{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
|
|
51
50
|
|
|
52
51
|
.r1c1ozpm{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--timvir-page-margin,24px);--timvir-margin:calc(var(--timvir-page-margin,24px) * 0.5);}
|
|
53
52
|
|
|
@@ -132,7 +131,7 @@
|
|
|
132
131
|
.rymvrdu{padding:50px 0 80px;display:grid;grid-auto-rows:min-content;grid-template-columns:[le] var(--timvir-page-margin) [lex lc] 1fr [rc rex] var(--timvir-page-margin) [re];}@media (min-width:48rem){.rymvrdu{grid-template-columns: [le] var(--timvir-page-margin) [lex] 1fr [lc] minmax(0,48rem) [rc] 1fr [rex] var(--timvir-page-margin) [re];}}@media (min-width:72rem){.rymvrdu{grid-template-columns: [le] 1fr var(--timvir-page-margin) [lex] minmax(0,12rem) [lc] 48rem [rc] minmax(0,12rem) [rex] var( --timvir-page-margin ) 1fr [re];}}.rymvrdu > *{grid-column:lc / rc;}
|
|
133
132
|
|
|
134
133
|
.a12hs2f7{color:inherit;text-decoration:none;}.a12hs2f7:hover svg{opacity:1;transform:none;visibility:visible;--visibility-delay:0s;}
|
|
135
|
-
.c31avqb{margin-left:6px;color:var(--timvir-secondary-text-color);height:0.9rem;width:0.9rem;vertical-align:middle;transition:opacity 0.2s,transform 0.2s,visibility 0s var(--visibility-delay,0.2s);opacity:0;visibility:hidden;transform:translateX(-50%);}
|
|
134
|
+
.c31avqb{display:inline-block;margin-left:6px;color:var(--timvir-secondary-text-color);height:0.9rem;width:0.9rem;vertical-align:middle;transition:opacity 0.2s,transform 0.2s,visibility 0s var(--visibility-delay,0.2s);opacity:0;visibility:hidden;transform:translateX(-50%);}
|
|
136
135
|
.h6ceq1b{margin-top:3rem;margin-bottom:1rem;font-size:2rem;line-height:1.125;font-weight:590;text-indent:-0.05em;}
|
|
137
136
|
.hj6166y{position:relative;margin:2.5rem 0 1rem;font-size:1.5rem;line-height:1.1666;font-weight:590;}
|
|
138
137
|
.h1f8mqks{position:relative;margin:1rem 0 1rem;font-size:1.0625rem;line-height:1.4705882353;font-weight:590;}
|