timvir 0.2.50 → 0.2.52
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 +12 -0
- package/LICENSE +21 -0
- package/blocks/Arbitrary/Arbitrary.d.ts +2 -2
- package/blocks/Arbitrary/docs/index.mdx +57 -10
- package/blocks/Arbitrary/index.d.ts +1 -1
- package/blocks/Arbitrary/index.js +16 -71
- package/blocks/Arbitrary/styles.css +11 -7
- package/blocks/Code/Code.d.ts +3 -3
- package/blocks/Code/docs/index.mdx +1 -1
- package/blocks/Code/index.d.ts +1 -1
- package/blocks/Code/index.js +2 -4
- package/blocks/Code/styles.css +8 -8
- package/blocks/ColorBar/ColorBar.d.ts +3 -3
- package/blocks/ColorBar/docs/index.mdx +1 -1
- package/blocks/ColorBar/index.d.ts +1 -1
- package/blocks/ColorBar/index.js +2 -4
- package/blocks/ColorBar/styles.css +6 -6
- package/blocks/ColorBook/ColorBook.d.ts +4 -4
- package/blocks/ColorBook/index.d.ts +1 -1
- package/blocks/ColorBook/index.js +3 -5
- package/blocks/ColorBook/styles.css +18 -18
- package/blocks/Cover/Cover.d.ts +4 -4
- package/blocks/Cover/index.d.ts +1 -1
- package/blocks/Cover/index.js +2 -5
- package/blocks/Cover/styles.css +6 -6
- package/blocks/Exhibit/Exhibit.d.ts +4 -4
- package/blocks/Exhibit/docs/index.mdx +11 -8
- package/blocks/Exhibit/index.d.ts +1 -1
- package/blocks/Exhibit/index.js +2 -5
- package/blocks/Exhibit/styles.css +7 -7
- package/blocks/Font/Font.d.ts +3 -3
- package/blocks/Font/index.d.ts +1 -1
- package/blocks/Font/index.js +2 -4
- package/blocks/Font/styles.css +7 -6
- package/blocks/Grid/Grid.d.ts +2 -2
- package/blocks/Grid/docs/index.mdx +1 -1
- package/blocks/Grid/index.d.ts +1 -1
- package/blocks/Grid/index.js +2 -4
- package/blocks/Grid/styles.css +6 -6
- package/blocks/Icon/Icon.d.ts +3 -3
- package/blocks/Icon/index.d.ts +1 -1
- package/blocks/Icon/index.js +2 -5
- package/blocks/Icon/internal/Canvas.d.ts +2 -2
- package/blocks/Icon/internal/index.d.ts +1 -1
- package/blocks/Icon/styles.css +1 -0
- package/blocks/Message/Message.d.ts +3 -3
- package/blocks/Message/docs/index.mdx +1 -1
- package/blocks/Message/index.d.ts +1 -1
- package/blocks/Message/index.js +2 -4
- package/blocks/Message/styles.css +6 -6
- package/blocks/Swatch/Swatch.d.ts +3 -3
- package/blocks/Swatch/docs/index.mdx +1 -2
- package/blocks/Swatch/index.d.ts +1 -1
- package/blocks/Swatch/index.js +2 -4
- package/blocks/Swatch/styles.css +6 -6
- package/blocks/Viewport/Viewport.d.ts +3 -3
- package/blocks/Viewport/docs/index.mdx +5 -8
- package/blocks/Viewport/index.d.ts +1 -1
- package/blocks/Viewport/index.js +6 -10
- package/blocks/Viewport/internal/Caption.d.ts +2 -4
- package/blocks/Viewport/internal/Handle.d.ts +3 -4
- package/blocks/Viewport/internal/Ruler.d.ts +2 -2
- package/blocks/Viewport/internal/index.d.ts +3 -3
- package/blocks/Viewport/styles.css +7 -7
- package/blocks/WebLink/WebLink.d.ts +3 -3
- package/blocks/WebLink/docs/index.mdx +3 -1
- package/blocks/WebLink/index.d.ts +1 -1
- package/blocks/WebLink/index.js +2 -4
- package/blocks/WebLink/styles.css +6 -6
- package/blocks/styles.css +95 -89
- package/builtins/index.js +1 -1
- package/builtins/styles.css +11 -11
- package/context/index.d.ts +1 -1
- package/context/index.js +1 -1
- package/core/components/Footer/Footer.d.ts +4 -4
- package/core/components/Page/Page.d.ts +2 -2
- package/core/index.js +13 -17
- package/core/styles.css +13 -14
- package/package.json +5 -5
- package/search/Search/Search.d.ts +4 -4
- package/search/index.js +2 -5
- package/styles.css +119 -114
package/blocks/Swatch/styles.css
CHANGED
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
grid-auto-rows: min-content;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
.timvir-s-
|
|
79
|
-
grid-template-columns: [le]
|
|
78
|
+
.timvir-s-1u7e2r6 {
|
|
79
|
+
grid-template-columns: [le]var(--timvir-page-margin)[lex lc]1fr[rc rex]var(--timvir-page-margin)[re];
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.timvir-s-l56j7k {
|
|
@@ -104,14 +104,14 @@
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
@media (width >= 72rem) {
|
|
107
|
-
.timvir-s-
|
|
108
|
-
grid-template-columns: [le]
|
|
107
|
+
.timvir-s-5diife.timvir-s-5diife {
|
|
108
|
+
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];
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
@media (width >= 48rem) {
|
|
113
|
-
.timvir-s-
|
|
114
|
-
grid-template-columns: [le]
|
|
113
|
+
.timvir-s-1s3i72i.timvir-s-1s3i72i {
|
|
114
|
+
grid-template-columns: [le]var(--timvir-page-margin)[lex]1fr[lc]minmax(0,48rem)[rc]1fr[rex]var(--timvir-page-margin)[re];
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
* The underlying DOM element which is rendered by this component.
|
|
4
4
|
*/
|
|
5
5
|
declare const Root = "div";
|
|
6
|
-
interface Props extends React.
|
|
6
|
+
interface Props extends React.ComponentPropsWithRef<typeof Root> {
|
|
7
7
|
/**
|
|
8
8
|
* URL that should be loaded in the viewport. Can be absolute or relative.
|
|
9
9
|
*/
|
|
@@ -13,5 +13,5 @@ interface Props extends React.ComponentPropsWithoutRef<typeof Root> {
|
|
|
13
13
|
*/
|
|
14
14
|
code?: string;
|
|
15
15
|
}
|
|
16
|
-
declare
|
|
17
|
-
export
|
|
16
|
+
export declare function Viewport(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -2,13 +2,12 @@ import { Viewport } from "..";
|
|
|
2
2
|
|
|
3
3
|
# Viewport
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
The viewport can be resized to simulate different device widths. The height of the iframe will automatically adjust
|
|
7
|
-
to the iframe content.
|
|
5
|
+
> A resizable iframe wrapper for previewing content at different device widths.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
<Viewport src="/docs/components/Grid/samples/basic" />
|
|
8
|
+
|
|
9
|
+
The height of the iframe automatically adjusts to fit the content.
|
|
10
|
+
Note that it does not replicate the browser's full responsive device mode: network and CPU throttling, as well as user agent changes, are not supported.
|
|
12
11
|
|
|
13
12
|
Since `<Viewport>` uses an `<iframe>`, you must provide a page which can be loaded into it. If you used the timvir
|
|
14
13
|
cli to scaffold your component, you already have one such sample (in `src/components/…/samples/basic.tsx`). Make that
|
|
@@ -16,8 +15,6 @@ sample available via a Next.js page and load it into the `<Viewport>`.
|
|
|
16
15
|
|
|
17
16
|
See also [Concepts: Component Sample](/concepts/component-sample).
|
|
18
17
|
|
|
19
|
-
<Viewport src="/docs/components/Grid/samples/basic" />
|
|
20
|
-
|
|
21
18
|
## Loading Behaviour
|
|
22
19
|
|
|
23
20
|
The `<Viewport>` displays a gray, animated background while the iframe is loading.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Viewport } from "./Viewport";
|
package/blocks/Viewport/index.js
CHANGED
|
@@ -248,7 +248,6 @@ function Caption(props$1) {
|
|
|
248
248
|
})]
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
-
var Caption$1 = /*#__PURE__*/React.memo(Caption);
|
|
252
251
|
const styles$1 = {
|
|
253
252
|
figcaption: {
|
|
254
253
|
kGuDYH: "timvir-s-1dcheo9",
|
|
@@ -292,7 +291,6 @@ function Handle(props) {
|
|
|
292
291
|
})
|
|
293
292
|
});
|
|
294
293
|
}
|
|
295
|
-
var Handle$1 = /*#__PURE__*/React.memo(Handle);
|
|
296
294
|
|
|
297
295
|
const height = 16;
|
|
298
296
|
function Ruler(props) {
|
|
@@ -328,7 +326,7 @@ function Ruler(props) {
|
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
const Root = "div";
|
|
331
|
-
function Viewport(props$1
|
|
329
|
+
function Viewport(props$1) {
|
|
332
330
|
const block = useBlock(props$1);
|
|
333
331
|
const {
|
|
334
332
|
src,
|
|
@@ -393,7 +391,6 @@ function Viewport(props$1, ref) {
|
|
|
393
391
|
const rootStyleProps = props(layoutStyles.block, layoutStyles.fullWidth, styles.root);
|
|
394
392
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
395
393
|
children: [/*#__PURE__*/jsxs(Root, {
|
|
396
|
-
ref: ref,
|
|
397
394
|
"data-timvir-b-viewport": true,
|
|
398
395
|
...rest,
|
|
399
396
|
className: cx(!state.settled && "timvir-unsettled", className, rootStyleProps.className),
|
|
@@ -422,7 +419,7 @@ function Viewport(props$1, ref) {
|
|
|
422
419
|
className: "timvir-s-wonfvy timvir-s-w75i6v timvir-s-1n2onr6 timvir-s-98rzlu timvir-s-pyat2d timvir-s-1h3vnj2 timvir-s-10r4kp7 timvir-s-b3r6kr"
|
|
423
420
|
},
|
|
424
421
|
1: {
|
|
425
|
-
className: "timvir-s-wonfvy timvir-s-w75i6v timvir-s-1n2onr6 timvir-s-98rzlu timvir-s-pyat2d timvir-s-10r4kp7 timvir-s-b3r6kr timvir-s-1c74tu6 timvir-s-10e4vud timvir-s-a4qsjk timvir-s-1bx2yh timvir-s-1esw782 timvir-s-dftl3q timvir-s-
|
|
422
|
+
className: "timvir-s-wonfvy timvir-s-w75i6v timvir-s-1n2onr6 timvir-s-98rzlu timvir-s-pyat2d timvir-s-10r4kp7 timvir-s-b3r6kr timvir-s-1c74tu6 timvir-s-10e4vud timvir-s-a4qsjk timvir-s-1bx2yh timvir-s-1esw782 timvir-s-dftl3q timvir-s-9emw9s timvir-s-1w911z timvir-s-1nj7uno"
|
|
426
423
|
}
|
|
427
424
|
}[!!(height === undefined) << 0],
|
|
428
425
|
style: {
|
|
@@ -474,12 +471,12 @@ function Viewport(props$1, ref) {
|
|
|
474
471
|
pointerEvents: height === undefined ? "none" : undefined
|
|
475
472
|
}
|
|
476
473
|
})
|
|
477
|
-
}), /*#__PURE__*/jsx(Handle
|
|
474
|
+
}), /*#__PURE__*/jsx(Handle, {
|
|
478
475
|
gridColumn: "1",
|
|
479
476
|
lock: lock,
|
|
480
477
|
edge: "left",
|
|
481
478
|
iframeRef: iframeRef
|
|
482
|
-
}), /*#__PURE__*/jsx(Handle
|
|
479
|
+
}), /*#__PURE__*/jsx(Handle, {
|
|
483
480
|
gridColumn: "3",
|
|
484
481
|
lock: lock,
|
|
485
482
|
edge: "right",
|
|
@@ -491,7 +488,7 @@ function Viewport(props$1, ref) {
|
|
|
491
488
|
containerWidth: svgROE?.contentRect.width,
|
|
492
489
|
viewportWidth: width
|
|
493
490
|
})]
|
|
494
|
-
}), /*#__PURE__*/jsx(Caption
|
|
491
|
+
}), /*#__PURE__*/jsx(Caption, {
|
|
495
492
|
src: src,
|
|
496
493
|
code: code
|
|
497
494
|
}), /*#__PURE__*/jsx("div", {
|
|
@@ -503,7 +500,6 @@ function Viewport(props$1, ref) {
|
|
|
503
500
|
})]
|
|
504
501
|
});
|
|
505
502
|
}
|
|
506
|
-
var Viewport_default = /*#__PURE__*/React.forwardRef(Viewport);
|
|
507
503
|
const styles = {
|
|
508
504
|
root: {
|
|
509
505
|
ktR8K2: "timvir-s-1vjgj0v",
|
|
@@ -512,4 +508,4 @@ const styles = {
|
|
|
512
508
|
}
|
|
513
509
|
};
|
|
514
510
|
|
|
515
|
-
export {
|
|
511
|
+
export { Viewport };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
interface Props {
|
|
3
2
|
src: string;
|
|
4
3
|
code?: string;
|
|
5
4
|
}
|
|
6
|
-
declare function Caption(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
5
|
+
export declare function Caption(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import type * as React from "react";
|
|
2
2
|
interface Props {
|
|
3
3
|
gridColumn: string;
|
|
4
4
|
lock: React.MutableRefObject<string>;
|
|
5
5
|
edge: "left" | "right";
|
|
6
6
|
iframeRef: React.RefObject<null | HTMLIFrameElement>;
|
|
7
7
|
}
|
|
8
|
-
declare function Handle(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
|
|
10
|
-
export default _default;
|
|
8
|
+
export declare function Handle(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -2,5 +2,5 @@ interface Props {
|
|
|
2
2
|
containerWidth?: number;
|
|
3
3
|
viewportWidth?: number;
|
|
4
4
|
}
|
|
5
|
-
declare function Ruler(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export
|
|
5
|
+
export declare function Ruler(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { Caption } from "./Caption";
|
|
2
|
+
export { Handle } from "./Handle";
|
|
3
|
+
export { Ruler } from "./Ruler";
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
animation-timing-function: linear;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.timvir-s-
|
|
104
|
+
.timvir-s-9emw9s {
|
|
105
105
|
background-image: linear-gradient(to right, #fafafa 0%, #f4f4f4 25%, #fafafa 40%);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -161,8 +161,8 @@
|
|
|
161
161
|
grid-column-gap: 8px;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
.timvir-s-
|
|
165
|
-
grid-template-columns: [le]
|
|
164
|
+
.timvir-s-1u7e2r6 {
|
|
165
|
+
grid-template-columns: [le]var(--timvir-page-margin)[lex lc]1fr[rc rex]var(--timvir-page-margin)[re];
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
.timvir-s-7tmw4v {
|
|
@@ -226,14 +226,14 @@
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
@media (width >= 72rem) {
|
|
229
|
-
.timvir-s-
|
|
230
|
-
grid-template-columns: [le]
|
|
229
|
+
.timvir-s-5diife.timvir-s-5diife {
|
|
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
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
@media (width >= 48rem) {
|
|
235
|
-
.timvir-s-
|
|
236
|
-
grid-template-columns: [le]
|
|
235
|
+
.timvir-s-1s3i72i.timvir-s-1s3i72i {
|
|
236
|
+
grid-template-columns: [le]var(--timvir-page-margin)[lex]1fr[lc]minmax(0,48rem)[rc]1fr[rex]var(--timvir-page-margin)[re];
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -3,8 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
* The underlying DOM element which is rendered by this component.
|
|
4
4
|
*/
|
|
5
5
|
declare const Root = "a";
|
|
6
|
-
interface Props extends React.
|
|
6
|
+
interface Props extends React.ComponentPropsWithRef<typeof Root> {
|
|
7
7
|
url: string;
|
|
8
8
|
}
|
|
9
|
-
declare
|
|
10
|
-
export
|
|
9
|
+
export declare function WebLink(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -2,7 +2,9 @@ import { WebLink } from "..";
|
|
|
2
2
|
|
|
3
3
|
# WebLink
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> A link to a website displayed as rich media with title, description, and image.
|
|
6
|
+
|
|
7
|
+
<WebLink url="https://tangled.sh" />
|
|
6
8
|
|
|
7
9
|
## Examples
|
|
8
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { WebLink } from "./WebLink";
|
package/blocks/WebLink/index.js
CHANGED
|
@@ -174,7 +174,7 @@ const layoutStyles = {
|
|
|
174
174
|
}};
|
|
175
175
|
|
|
176
176
|
const Root = "a";
|
|
177
|
-
function WebLink(props$1
|
|
177
|
+
function WebLink(props$1) {
|
|
178
178
|
const {
|
|
179
179
|
url,
|
|
180
180
|
className,
|
|
@@ -199,7 +199,6 @@ function WebLink(props$1, ref) {
|
|
|
199
199
|
const image = metadata?.open_graph?.images?.[0]?.url;
|
|
200
200
|
const rootStyleProps = props(layoutStyles.block, styles.root);
|
|
201
201
|
return /*#__PURE__*/jsxs(Root, {
|
|
202
|
-
ref: ref,
|
|
203
202
|
"data-timvir-b-weblink": true,
|
|
204
203
|
href: url,
|
|
205
204
|
target: "_blank",
|
|
@@ -242,7 +241,6 @@ function WebLink(props$1, ref) {
|
|
|
242
241
|
})]
|
|
243
242
|
});
|
|
244
243
|
}
|
|
245
|
-
var WebLink_default = /*#__PURE__*/React.forwardRef(WebLink);
|
|
246
244
|
const styles = {
|
|
247
245
|
root: {
|
|
248
246
|
kmkexE: "timvir-s-zhuw26",
|
|
@@ -265,4 +263,4 @@ async function defaultUnfurl(url) {
|
|
|
265
263
|
return fetch(`https://timvir.dev/api/unfurl?url=${encodeURIComponent(url)}`).then(res => res.json());
|
|
266
264
|
}
|
|
267
265
|
|
|
268
|
-
export {
|
|
266
|
+
export { WebLink };
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
grid-auto-rows: min-content;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
.timvir-s-
|
|
123
|
-
grid-template-columns: [le]
|
|
122
|
+
.timvir-s-1u7e2r6 {
|
|
123
|
+
grid-template-columns: [le]var(--timvir-page-margin)[lex lc]1fr[rc rex]var(--timvir-page-margin)[re];
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.timvir-s-1vbrtjm {
|
|
@@ -156,14 +156,14 @@
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
@media (width >= 72rem) {
|
|
159
|
-
.timvir-s-
|
|
160
|
-
grid-template-columns: [le]
|
|
159
|
+
.timvir-s-5diife.timvir-s-5diife {
|
|
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
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
@media (width >= 48rem) {
|
|
165
|
-
.timvir-s-
|
|
166
|
-
grid-template-columns: [le]
|
|
165
|
+
.timvir-s-1s3i72i.timvir-s-1s3i72i {
|
|
166
|
+
grid-template-columns: [le]var(--timvir-page-margin)[lex]1fr[lc]minmax(0,48rem)[rc]1fr[rex]var(--timvir-page-margin)[re];
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|