timvir 0.2.42 → 0.2.44
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/CHANGELOG.md +13 -0
- package/blocks/Arbitrary/index.js +9 -1
- package/blocks/Arbitrary/styles.css +59 -3
- package/blocks/Code/index.js +9 -1
- package/blocks/Code/styles.css +58 -0
- package/blocks/ColorBar/index.js +9 -1
- package/blocks/ColorBar/styles.css +54 -0
- package/blocks/ColorBook/index.js +8 -1
- package/blocks/ColorBook/styles.css +63 -5
- package/blocks/Cover/docs/index.mdx +0 -11
- package/blocks/Cover/index.js +13 -1
- package/blocks/Cover/styles.css +65 -1
- package/blocks/Exhibit/index.js +9 -1
- package/blocks/Exhibit/styles.css +63 -3
- package/blocks/Font/index.js +32 -4
- package/blocks/Font/styles.css +63 -3
- package/blocks/Grid/index.js +8 -1
- package/blocks/Grid/styles.css +59 -1
- package/blocks/Message/index.js +63 -5
- package/blocks/Message/styles.css +63 -3
- package/blocks/Swatch/index.js +9 -1
- package/blocks/Swatch/styles.css +63 -3
- package/blocks/Viewport/index.js +50 -8
- package/blocks/Viewport/styles.css +54 -0
- package/blocks/WebLink/index.js +9 -1
- package/blocks/WebLink/styles.css +59 -3
- package/blocks/styles.css +723 -25
- package/builtins/index.js +28 -4
- package/builtins/styles.css +58 -0
- package/core/index.js +56 -7
- package/icons/AlertCircle.d.ts +3 -0
- package/icons/ChevronLeft.d.ts +3 -0
- package/icons/ChevronRight.d.ts +3 -0
- package/icons/ChevronsRight.d.ts +3 -0
- package/icons/Code.d.ts +3 -0
- package/icons/Codepen.d.ts +3 -0
- package/icons/Info.d.ts +3 -0
- package/icons/Link.d.ts +3 -0
- package/icons/Menu.d.ts +3 -0
- package/icons/XOctagon.d.ts +3 -0
- package/icons/alert-circle.svg +1 -0
- package/icons/chevron-left.svg +1 -0
- package/icons/chevron-right.svg +1 -0
- package/icons/chevrons-right.svg +1 -0
- package/icons/code.svg +1 -0
- package/icons/codepen.svg +1 -0
- package/icons/index.d.ts +10 -0
- package/icons/info.svg +1 -0
- package/icons/link.svg +1 -0
- package/icons/menu.svg +1 -0
- package/icons/x-octagon.svg +1 -0
- package/package.json +1 -3
- package/styles.css +796 -40
package/blocks/Viewport/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useArticleComponents, useBlock
|
|
3
|
+
import { useArticleComponents, useBlock } from 'timvir/core';
|
|
4
4
|
import { useResizeObserverEntry, useResizeObserver } from 'timvir/hooks';
|
|
5
|
-
import { jsxs, Fragment
|
|
6
|
-
import * as Icons from 'react-feather';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
6
|
import { Code } from 'timvir/blocks';
|
|
8
7
|
|
|
9
8
|
function cx(...args) {
|
|
@@ -168,16 +167,45 @@ function props(...styles) {
|
|
|
168
167
|
return result;
|
|
169
168
|
}
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
const layoutStyles = {
|
|
171
|
+
block: {
|
|
172
|
+
kBCFzs: "timvir-s-htle6",
|
|
173
|
+
k7Eaqz: "timvir-s-euugli",
|
|
174
|
+
kogj98: "timvir-s-1t4wa6b",
|
|
175
|
+
$$css: true
|
|
176
|
+
},
|
|
177
|
+
fullWidth: {
|
|
178
|
+
kBCFzs: "timvir-s-1ywaqmw",
|
|
179
|
+
$$css: true
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const SvgCode = props => /*#__PURE__*/jsx("svg", {
|
|
184
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
185
|
+
width: 24,
|
|
186
|
+
height: 24,
|
|
187
|
+
fill: "none",
|
|
188
|
+
stroke: "currentColor",
|
|
189
|
+
strokeLinecap: "round",
|
|
190
|
+
strokeLinejoin: "round",
|
|
191
|
+
strokeWidth: 2,
|
|
192
|
+
viewBox: "0 0 24 24",
|
|
193
|
+
...props,
|
|
194
|
+
children: /*#__PURE__*/jsx("path", {
|
|
195
|
+
d: "m16 18 6-6-6-6M8 6l-6 6 6 6"
|
|
196
|
+
})
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
function Caption(props$1) {
|
|
172
200
|
const components = useArticleComponents();
|
|
173
201
|
const {
|
|
174
202
|
src,
|
|
175
203
|
code
|
|
176
|
-
} = props;
|
|
204
|
+
} = props$1;
|
|
177
205
|
const [codeRef, setCodeRef] = React.useState(null);
|
|
178
206
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
179
207
|
children: [/*#__PURE__*/jsxs("figcaption", {
|
|
180
|
-
|
|
208
|
+
...props(layoutStyles.block, styles$1.figcaption),
|
|
181
209
|
children: [/*#__PURE__*/jsxs("div", {
|
|
182
210
|
children: ["Source:", " ", /*#__PURE__*/jsx(components.a, {
|
|
183
211
|
href: src,
|
|
@@ -198,8 +226,9 @@ function Caption(props) {
|
|
|
198
226
|
}
|
|
199
227
|
}
|
|
200
228
|
},
|
|
201
|
-
children: /*#__PURE__*/jsx(
|
|
202
|
-
|
|
229
|
+
children: /*#__PURE__*/jsx(SvgCode, {
|
|
230
|
+
width: "1.6em",
|
|
231
|
+
height: "1.6em",
|
|
203
232
|
className: "timvir-s-1lliihq"
|
|
204
233
|
})
|
|
205
234
|
})]
|
|
@@ -217,6 +246,18 @@ function Caption(props) {
|
|
|
217
246
|
});
|
|
218
247
|
}
|
|
219
248
|
var Caption$1 = /*#__PURE__*/React.memo(Caption);
|
|
249
|
+
const styles$1 = {
|
|
250
|
+
figcaption: {
|
|
251
|
+
kGuDYH: "timvir-s-1dcheo9",
|
|
252
|
+
kLWn49: "timvir-s-jkpybl",
|
|
253
|
+
kMwMTN: "timvir-s-vgvpxu",
|
|
254
|
+
khDVqt: "timvir-s-uxw1ft",
|
|
255
|
+
k1xSpc: "timvir-s-78zum5",
|
|
256
|
+
kjj79g: "timvir-s-1qughib",
|
|
257
|
+
kGNEyG: "timvir-s-6s0dn4",
|
|
258
|
+
$$css: true
|
|
259
|
+
}
|
|
260
|
+
};
|
|
220
261
|
|
|
221
262
|
function Handle(props) {
|
|
222
263
|
const {
|
|
@@ -448,6 +489,7 @@ function Viewport(props$1, ref) {
|
|
|
448
489
|
code: code
|
|
449
490
|
}), /*#__PURE__*/jsx("div", {
|
|
450
491
|
style: {
|
|
492
|
+
gridColumn: "1 / -1",
|
|
451
493
|
height: (maxHeight ?? 0) - (height ?? 0),
|
|
452
494
|
transition: "height 0.16s"
|
|
453
495
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
@layer priority1;
|
|
2
2
|
|
|
3
3
|
@layer priority2 {
|
|
4
|
+
.timvir-s-1t4wa6b {
|
|
5
|
+
margin: 0 0 2rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
.timvir-s-14kudrl {
|
|
5
9
|
margin: 8px 0;
|
|
6
10
|
}
|
|
@@ -27,6 +31,18 @@
|
|
|
27
31
|
grid-column: 2 / span 1;
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
.timvir-s-htle6 {
|
|
35
|
+
grid-column: lc / rc;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.timvir-s-1ywaqmw {
|
|
39
|
+
grid-column: le / re;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.timvir-s-bldiei {
|
|
43
|
+
grid-column: lex / rex;
|
|
44
|
+
}
|
|
45
|
+
|
|
30
46
|
.timvir-s-diuk5s {
|
|
31
47
|
grid-row: 1 / span 3;
|
|
32
48
|
}
|
|
@@ -137,10 +153,18 @@
|
|
|
137
153
|
font-variant-numeric: tabular-nums;
|
|
138
154
|
}
|
|
139
155
|
|
|
156
|
+
.timvir-s-3xbxsf {
|
|
157
|
+
grid-auto-rows: min-content;
|
|
158
|
+
}
|
|
159
|
+
|
|
140
160
|
.timvir-s-jv0b96 {
|
|
141
161
|
grid-column-gap: 8px;
|
|
142
162
|
}
|
|
143
163
|
|
|
164
|
+
.timvir-s-12c0rpe {
|
|
165
|
+
grid-template-columns: [le] var(--timvir-page-margin) [lex lc] 1fr[rc rex] var(--timvir-page-margin) [re];
|
|
166
|
+
}
|
|
167
|
+
|
|
144
168
|
.timvir-s-7tmw4v {
|
|
145
169
|
grid-template-columns: 56px auto 56px;
|
|
146
170
|
}
|
|
@@ -200,6 +224,18 @@
|
|
|
200
224
|
.timvir-s-1kpm4h4:active {
|
|
201
225
|
box-shadow: 0 0 0 1px #10161a1a, 0 0 #10161a00, 0 1px 1px #10161a33;
|
|
202
226
|
}
|
|
227
|
+
|
|
228
|
+
@media (width >= 72rem) {
|
|
229
|
+
.timvir-s-1mxrek7.timvir-s-1mxrek7 {
|
|
230
|
+
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];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@media (width >= 48rem) {
|
|
235
|
+
.timvir-s-9q0i6z.timvir-s-9q0i6z {
|
|
236
|
+
grid-template-columns: [le] var(--timvir-page-margin) [lex] 1fr[lc] minmax(0, 48rem) [rc] 1fr[rex] var(--timvir-page-margin) [re];
|
|
237
|
+
}
|
|
238
|
+
}
|
|
203
239
|
}
|
|
204
240
|
|
|
205
241
|
@layer priority5 {
|
|
@@ -235,6 +271,10 @@
|
|
|
235
271
|
margin-top: 12px;
|
|
236
272
|
}
|
|
237
273
|
|
|
274
|
+
.timvir-s-euugli {
|
|
275
|
+
min-width: 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
238
278
|
.timvir-s-13vifvy {
|
|
239
279
|
top: 0;
|
|
240
280
|
}
|
|
@@ -261,3 +301,17 @@
|
|
|
261
301
|
background-position: 85vw 0;
|
|
262
302
|
}
|
|
263
303
|
}
|
|
304
|
+
|
|
305
|
+
.timvir-s-1f9b50e {
|
|
306
|
+
--timvir-margin: var(--timvir-page-margin);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.timvir-s-1hz7z82 {
|
|
310
|
+
--timvir-page-margin: 16px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@media (width >= 48rem) {
|
|
314
|
+
.timvir-s-1i3za4p.timvir-s-1i3za4p {
|
|
315
|
+
--timvir-page-margin: 24px;
|
|
316
|
+
}
|
|
317
|
+
}
|
package/blocks/WebLink/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useContext
|
|
3
|
+
import { useContext } from 'timvir/core';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
function cx(...args) {
|
|
@@ -165,6 +165,14 @@ function props(...styles) {
|
|
|
165
165
|
return result;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
const layoutStyles = {
|
|
169
|
+
block: {
|
|
170
|
+
kBCFzs: "timvir-s-htle6",
|
|
171
|
+
k7Eaqz: "timvir-s-euugli",
|
|
172
|
+
kogj98: "timvir-s-1t4wa6b",
|
|
173
|
+
$$css: true
|
|
174
|
+
}};
|
|
175
|
+
|
|
168
176
|
const Root = "a";
|
|
169
177
|
function WebLink(props$1, ref) {
|
|
170
178
|
const {
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
@layer priority1 {
|
|
2
|
+
.timvir-s-1f9b50e {
|
|
3
|
+
--timvir-margin: var(--timvir-page-margin);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.timvir-s-1hz7z82 {
|
|
7
|
+
--timvir-page-margin: 16px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (width >= 48rem) {
|
|
11
|
+
.timvir-s-1i3za4p.timvir-s-1i3za4p {
|
|
12
|
+
--timvir-page-margin: 24px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@layer priority2 {
|
|
18
|
+
.timvir-s-1t4wa6b {
|
|
19
|
+
margin: 0 0 2rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
2
22
|
.timvir-s-hkrif2 {
|
|
3
23
|
padding: 12px 14px 14px;
|
|
4
24
|
}
|
|
5
25
|
}
|
|
6
26
|
|
|
7
|
-
@layer
|
|
27
|
+
@layer priority3 {
|
|
8
28
|
.timvir-s-j7gikm {
|
|
9
29
|
border-color: var(--timvir-border-color);
|
|
10
30
|
}
|
|
@@ -33,6 +53,18 @@
|
|
|
33
53
|
flex: 4 180px;
|
|
34
54
|
}
|
|
35
55
|
|
|
56
|
+
.timvir-s-htle6 {
|
|
57
|
+
grid-column: lc / rc;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.timvir-s-1ywaqmw {
|
|
61
|
+
grid-column: le / re;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.timvir-s-bldiei {
|
|
65
|
+
grid-column: lex / rex;
|
|
66
|
+
}
|
|
67
|
+
|
|
36
68
|
.timvir-s-b3r6kr {
|
|
37
69
|
overflow: hidden;
|
|
38
70
|
}
|
|
@@ -50,7 +82,7 @@
|
|
|
50
82
|
}
|
|
51
83
|
}
|
|
52
84
|
|
|
53
|
-
@layer
|
|
85
|
+
@layer priority4 {
|
|
54
86
|
.timvir-s-1d0dlzq {
|
|
55
87
|
background-color: var(--timvir-secondary-background-color);
|
|
56
88
|
}
|
|
@@ -75,10 +107,22 @@
|
|
|
75
107
|
display: flex;
|
|
76
108
|
}
|
|
77
109
|
|
|
110
|
+
.timvir-s-rvj5dj {
|
|
111
|
+
display: grid;
|
|
112
|
+
}
|
|
113
|
+
|
|
78
114
|
.timvir-s-boafo0 {
|
|
79
115
|
font-size: .75rem;
|
|
80
116
|
}
|
|
81
117
|
|
|
118
|
+
.timvir-s-3xbxsf {
|
|
119
|
+
grid-auto-rows: min-content;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.timvir-s-12c0rpe {
|
|
123
|
+
grid-template-columns: [le] var(--timvir-page-margin) [lex lc] 1fr[rc rex] var(--timvir-page-margin) [re];
|
|
124
|
+
}
|
|
125
|
+
|
|
82
126
|
.timvir-s-1vbrtjm {
|
|
83
127
|
line-height: 1.1rem;
|
|
84
128
|
}
|
|
@@ -110,9 +154,21 @@
|
|
|
110
154
|
.timvir-s-1dc5b4e:hover, .timvir-s-1bx2y69:active {
|
|
111
155
|
background-color: var(--timvir-sidebar-highlight-color);
|
|
112
156
|
}
|
|
157
|
+
|
|
158
|
+
@media (width >= 72rem) {
|
|
159
|
+
.timvir-s-1mxrek7.timvir-s-1mxrek7 {
|
|
160
|
+
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];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@media (width >= 48rem) {
|
|
165
|
+
.timvir-s-9q0i6z.timvir-s-9q0i6z {
|
|
166
|
+
grid-template-columns: [le] var(--timvir-page-margin) [lex] 1fr[lc] minmax(0, 48rem) [rc] 1fr[rex] var(--timvir-page-margin) [re];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
113
169
|
}
|
|
114
170
|
|
|
115
|
-
@layer
|
|
171
|
+
@layer priority5 {
|
|
116
172
|
.timvir-s-5yr21d {
|
|
117
173
|
height: 100%;
|
|
118
174
|
}
|