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.
Files changed (82) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/blocks/Arbitrary/Arbitrary.d.ts +2 -2
  4. package/blocks/Arbitrary/docs/index.mdx +57 -10
  5. package/blocks/Arbitrary/index.d.ts +1 -1
  6. package/blocks/Arbitrary/index.js +16 -71
  7. package/blocks/Arbitrary/styles.css +11 -7
  8. package/blocks/Code/Code.d.ts +3 -3
  9. package/blocks/Code/docs/index.mdx +1 -1
  10. package/blocks/Code/index.d.ts +1 -1
  11. package/blocks/Code/index.js +2 -4
  12. package/blocks/Code/styles.css +8 -8
  13. package/blocks/ColorBar/ColorBar.d.ts +3 -3
  14. package/blocks/ColorBar/docs/index.mdx +1 -1
  15. package/blocks/ColorBar/index.d.ts +1 -1
  16. package/blocks/ColorBar/index.js +2 -4
  17. package/blocks/ColorBar/styles.css +6 -6
  18. package/blocks/ColorBook/ColorBook.d.ts +4 -4
  19. package/blocks/ColorBook/index.d.ts +1 -1
  20. package/blocks/ColorBook/index.js +3 -5
  21. package/blocks/ColorBook/styles.css +18 -18
  22. package/blocks/Cover/Cover.d.ts +4 -4
  23. package/blocks/Cover/index.d.ts +1 -1
  24. package/blocks/Cover/index.js +2 -5
  25. package/blocks/Cover/styles.css +6 -6
  26. package/blocks/Exhibit/Exhibit.d.ts +4 -4
  27. package/blocks/Exhibit/docs/index.mdx +11 -8
  28. package/blocks/Exhibit/index.d.ts +1 -1
  29. package/blocks/Exhibit/index.js +2 -5
  30. package/blocks/Exhibit/styles.css +7 -7
  31. package/blocks/Font/Font.d.ts +3 -3
  32. package/blocks/Font/index.d.ts +1 -1
  33. package/blocks/Font/index.js +2 -4
  34. package/blocks/Font/styles.css +7 -6
  35. package/blocks/Grid/Grid.d.ts +2 -2
  36. package/blocks/Grid/docs/index.mdx +1 -1
  37. package/blocks/Grid/index.d.ts +1 -1
  38. package/blocks/Grid/index.js +2 -4
  39. package/blocks/Grid/styles.css +6 -6
  40. package/blocks/Icon/Icon.d.ts +3 -3
  41. package/blocks/Icon/index.d.ts +1 -1
  42. package/blocks/Icon/index.js +2 -5
  43. package/blocks/Icon/internal/Canvas.d.ts +2 -2
  44. package/blocks/Icon/internal/index.d.ts +1 -1
  45. package/blocks/Icon/styles.css +1 -0
  46. package/blocks/Message/Message.d.ts +3 -3
  47. package/blocks/Message/docs/index.mdx +1 -1
  48. package/blocks/Message/index.d.ts +1 -1
  49. package/blocks/Message/index.js +2 -4
  50. package/blocks/Message/styles.css +6 -6
  51. package/blocks/Swatch/Swatch.d.ts +3 -3
  52. package/blocks/Swatch/docs/index.mdx +1 -2
  53. package/blocks/Swatch/index.d.ts +1 -1
  54. package/blocks/Swatch/index.js +2 -4
  55. package/blocks/Swatch/styles.css +6 -6
  56. package/blocks/Viewport/Viewport.d.ts +3 -3
  57. package/blocks/Viewport/docs/index.mdx +5 -8
  58. package/blocks/Viewport/index.d.ts +1 -1
  59. package/blocks/Viewport/index.js +6 -10
  60. package/blocks/Viewport/internal/Caption.d.ts +2 -4
  61. package/blocks/Viewport/internal/Handle.d.ts +3 -4
  62. package/blocks/Viewport/internal/Ruler.d.ts +2 -2
  63. package/blocks/Viewport/internal/index.d.ts +3 -3
  64. package/blocks/Viewport/styles.css +7 -7
  65. package/blocks/WebLink/WebLink.d.ts +3 -3
  66. package/blocks/WebLink/docs/index.mdx +3 -1
  67. package/blocks/WebLink/index.d.ts +1 -1
  68. package/blocks/WebLink/index.js +2 -4
  69. package/blocks/WebLink/styles.css +6 -6
  70. package/blocks/styles.css +95 -89
  71. package/builtins/index.js +1 -1
  72. package/builtins/styles.css +11 -11
  73. package/context/index.d.ts +1 -1
  74. package/context/index.js +1 -1
  75. package/core/components/Footer/Footer.d.ts +4 -4
  76. package/core/components/Page/Page.d.ts +2 -2
  77. package/core/index.js +13 -17
  78. package/core/styles.css +13 -14
  79. package/package.json +5 -5
  80. package/search/Search/Search.d.ts +4 -4
  81. package/search/index.js +2 -5
  82. package/styles.css +119 -114
@@ -75,8 +75,8 @@
75
75
  grid-auto-rows: min-content;
76
76
  }
77
77
 
78
- .timvir-s-12c0rpe {
79
- grid-template-columns: [le] var(--timvir-page-margin) [lex lc] 1fr[rc rex] var(--timvir-page-margin) [re];
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-1mxrek7.timvir-s-1mxrek7 {
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];
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-9q0i6z.timvir-s-9q0i6z {
114
- grid-template-columns: [le] var(--timvir-page-margin) [lex] 1fr[lc] minmax(0, 48rem) [rc] 1fr[rex] var(--timvir-page-margin) [re];
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.ComponentPropsWithoutRef<typeof Root> {
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 const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
17
- export default _default;
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
- The `<Viewport>` component is a full-width component which is a lightly interactive wrapper around an `<iframe>`.
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
- The component does not provide the full functionality of the browsers responsive device mode simulation. In particular,
10
- it can't simulate network / CPU throttling, nor can it change the user agent. It's purpose is to provide a simple
11
- interface to test your components at different viewport widths.
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 { default as Viewport } from "./Viewport";
1
+ export { Viewport } from "./Viewport";
@@ -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, ref) {
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-9ncquh timvir-s-1w911z timvir-s-1nj7uno"
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$1, {
474
+ }), /*#__PURE__*/jsx(Handle, {
478
475
  gridColumn: "1",
479
476
  lock: lock,
480
477
  edge: "left",
481
478
  iframeRef: iframeRef
482
- }), /*#__PURE__*/jsx(Handle$1, {
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$1, {
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 { Viewport_default as Viewport };
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
- declare const _default: React.MemoExoticComponent<typeof Caption>;
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
- declare const _default: React.MemoExoticComponent<typeof Handle>;
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 default Ruler;
5
+ export declare function Ruler(props: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,3 +1,3 @@
1
- export { default as Caption } from "./Caption";
2
- export { default as Handle } from "./Handle";
3
- export { default as Ruler } from "./Ruler";
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-9ncquh {
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-12c0rpe {
165
- grid-template-columns: [le] var(--timvir-page-margin) [lex lc] 1fr[rc rex] var(--timvir-page-margin) [re];
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-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];
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-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];
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.ComponentPropsWithoutRef<typeof Root> {
6
+ interface Props extends React.ComponentPropsWithRef<typeof Root> {
7
7
  url: string;
8
8
  }
9
- declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLAnchorElement>>;
10
- export default _default;
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
- `<WebLink>` is a link to an website, displayed as rich media (title, description, and opengraph image).
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 { default as WebLink } from "./WebLink";
1
+ export { WebLink } from "./WebLink";
@@ -174,7 +174,7 @@ const layoutStyles = {
174
174
  }};
175
175
 
176
176
  const Root = "a";
177
- function WebLink(props$1, ref) {
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 { WebLink_default as WebLink };
266
+ export { WebLink };
@@ -119,8 +119,8 @@
119
119
  grid-auto-rows: min-content;
120
120
  }
121
121
 
122
- .timvir-s-12c0rpe {
123
- grid-template-columns: [le] var(--timvir-page-margin) [lex lc] 1fr[rc rex] var(--timvir-page-margin) [re];
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-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];
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-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];
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
  }