timvir 0.2.43 → 0.2.45

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 (52) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/blocks/Arbitrary/index.js +6 -11
  3. package/blocks/Code/index.js +8 -13
  4. package/blocks/Code/styles.css +2 -2
  5. package/blocks/ColorBar/docs/index.mdx +37 -122
  6. package/blocks/ColorBar/index.js +2 -2
  7. package/blocks/ColorBook/index.js +2 -2
  8. package/blocks/Cover/docs/index.mdx +0 -11
  9. package/blocks/Cover/index.js +2 -2
  10. package/blocks/Exhibit/index.js +8 -9
  11. package/blocks/Font/index.js +25 -5
  12. package/blocks/Grid/index.js +19 -3
  13. package/blocks/Icon/index.js +2 -2
  14. package/blocks/Message/docs/index.mdx +39 -33
  15. package/blocks/Message/index.js +63 -6
  16. package/blocks/Message/styles.css +4 -0
  17. package/blocks/Swatch/docs/index.mdx +25 -23
  18. package/blocks/Swatch/index.js +2 -2
  19. package/blocks/Viewport/index.js +40 -10
  20. package/blocks/WebLink/index.js +4 -3
  21. package/blocks/styles.css +6 -2
  22. package/builtins/index.js +20 -3
  23. package/core/components/Commands/internal/Action.d.ts +1 -1
  24. package/core/components/Page/Page.d.ts +1 -1
  25. package/core/components/Page/internal/Sidebar.d.ts +3 -1
  26. package/core/index.js +87 -47
  27. package/global.css +2 -2
  28. package/hooks/useResizeObserver/index.d.ts +0 -21
  29. package/icons/AlertCircle.d.ts +3 -0
  30. package/icons/ChevronLeft.d.ts +3 -0
  31. package/icons/ChevronRight.d.ts +3 -0
  32. package/icons/ChevronsRight.d.ts +3 -0
  33. package/icons/Code.d.ts +3 -0
  34. package/icons/Codepen.d.ts +3 -0
  35. package/icons/Info.d.ts +3 -0
  36. package/icons/Link.d.ts +3 -0
  37. package/icons/Menu.d.ts +3 -0
  38. package/icons/XOctagon.d.ts +3 -0
  39. package/icons/alert-circle.svg +1 -0
  40. package/icons/chevron-left.svg +1 -0
  41. package/icons/chevron-right.svg +1 -0
  42. package/icons/chevrons-right.svg +1 -0
  43. package/icons/code.svg +1 -0
  44. package/icons/codepen.svg +1 -0
  45. package/icons/index.d.ts +10 -0
  46. package/icons/info.svg +1 -0
  47. package/icons/link.svg +1 -0
  48. package/icons/menu.svg +1 -0
  49. package/icons/x-octagon.svg +1 -0
  50. package/package.json +1 -3
  51. package/search/index.js +2 -2
  52. package/styles.css +8 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # timvir
2
2
 
3
+ ## 0.2.45
4
+
5
+ ### Patch Changes
6
+
7
+ - **Use data attributes instead of CSS classes to identify block elements** ([#3511](https://github.com/timvir/timvir/pull/3511)) - Previously we've added well-known class names to certain blocks. This was used to allow external tools to more easily identify blocks on a rendered page. The custom CSS classes have been replaced by data attributes. If you used class selectors to identify blocks, you'll need to replace them with data attribute selectors. For example, instead of `.timvir-b-Exhibit` use `[data-timvir-b-exhibit]`. Note: data attributes are lowercase.
8
+
9
+ ## 0.2.44
10
+
11
+ ### Patch Changes
12
+
13
+ - **Fix Viewport caption placement** ([#3484](https://github.com/timvir/timvir/pull/3484)) - During the migration to StyleX the layout of the Viewport caption got broken. Now the caption is once again in its correct place.
14
+ - **Trim dependencies** ([#3497](https://github.com/timvir/timvir/pull/3497)) - Removed `downshift` (because unused) and vendored the few icons from `react-feathers`. These dependencies are either unmaintained, contain legacy code, or make Timvir depend on such through their transitive dependencies. These changes improve the security posture of the Timvir package.
15
+
3
16
  ## 0.2.43
4
17
 
5
18
  ### Patch Changes
@@ -264,16 +264,14 @@ function Arbitrary(props$1, ref) {
264
264
  }
265
265
  }, [props$1.id, block.bus, value.seed]);
266
266
  const rootStyleProps = props(layoutStyles.block, styles.root);
267
- const inputStyleProps = {
268
- className: "timvir-s-c342km timvir-s-1a2a7pz timvir-s-ln7xf2 timvir-s-jbqb8w timvir-s-kh2ocl timvir-s-1717udv timvir-s-h8yej3 timvir-s-1heor9g"
269
- };
270
267
  return /*#__PURE__*/jsx(Context.Provider, {
271
268
  value: value,
272
269
  children: /*#__PURE__*/jsxs(Root, {
273
270
  ref: ref,
271
+ "data-timvir-b-arbitrary": true,
274
272
  ...rest,
275
273
  ...rootStyleProps,
276
- className: cx("timvir-b-Arbitrary", rootStyleProps.className, className),
274
+ className: cx(rootStyleProps.className, className),
277
275
  style: {
278
276
  margin: "1em 0",
279
277
  ...rootStyleProps.style,
@@ -287,11 +285,8 @@ function Arbitrary(props$1, ref) {
287
285
  className: "timvir-s-1rg5ohu timvir-s-vgvpxu timvir-s-15ku74s",
288
286
  children: "Seed:"
289
287
  }), /*#__PURE__*/jsx("input", {
290
- ...inputStyleProps,
291
- className: cx("timvir-b-Arbitrary-seed", inputStyleProps.className),
292
- style: {
293
- ...inputStyleProps.style
294
- },
288
+ "data-timvir-b-arbitrary-seed": true,
289
+ className: "timvir-s-c342km timvir-s-1a2a7pz timvir-s-ln7xf2 timvir-s-jbqb8w timvir-s-kh2ocl timvir-s-1717udv timvir-s-h8yej3 timvir-s-1heor9g",
295
290
  placeholder: "Seed",
296
291
  value: encode(new TextEncoder().encode(`${value.seed}`)),
297
292
  readOnly: true,
@@ -325,7 +320,7 @@ function Arbitrary(props$1, ref) {
325
320
  })
326
321
  });
327
322
  }
328
- var Arbitrary$1 = /*#__PURE__*/React.forwardRef(Arbitrary);
323
+ var Arbitrary_default = /*#__PURE__*/React.forwardRef(Arbitrary);
329
324
  const styles = {
330
325
  root: {
331
326
  kogj98: "timvir-s-9t3ola",
@@ -333,4 +328,4 @@ const styles = {
333
328
  }
334
329
  };
335
330
 
336
- export { Arbitrary$1 as Arbitrary, useContext };
331
+ export { Arbitrary_default as Arbitrary, useContext };
@@ -229,34 +229,29 @@ function Code(props$1, ref) {
229
229
  })();
230
230
  }, [children, language, highlightedLines]);
231
231
  const rootStyleProps = props(layoutStyles.block);
232
- const codeStyleProps = {
233
- className: "timvir-s-w2csxc timvir-s-6wvzqs timvir-s-sfzzmd timvir-s-1sxf85j timvir-s-15o1dgp timvir-s-idmeni timvir-s-1717udv timvir-s-1etwjqo timvir-s-mkeg23 timvir-s-1y0btm7 timvir-s-j7gikm timvir-s-1d0dlzq"
234
- };
235
- const captionStyleProps = {
236
- className: "timvir-s-1dcheo9 timvir-s-jkpybl timvir-s-vgvpxu timvir-s-lwy1ot"
237
- };
238
232
  return /*#__PURE__*/jsxs(Root, {
239
233
  ref: ref,
234
+ "data-timvir-b-code": true,
240
235
  ...rest,
241
236
  ...rootStyleProps,
242
- className: cx("timvir-b-Code", !state.settled && "timvir-unsettled", className, rootStyleProps.className),
237
+ className: cx(!state.settled && "timvir-unsettled", className, rootStyleProps.className),
243
238
  style: {
244
239
  ...rootStyleProps.style,
245
240
  ...rest.style
246
241
  },
247
242
  children: [/*#__PURE__*/jsx("div", {
248
- ...codeStyleProps,
249
- className: cx("timvir-b-Code-container", codeStyleProps.className),
243
+ "data-timvir-b-code-container": true,
244
+ className: "timvir-s-w2csxc timvir-s-6wvzqs timvir-s-sfzzmd timvir-s-1sxf85j timvir-s-i27niw timvir-s-idmeni timvir-s-1717udv timvir-s-1etwjqo timvir-s-mkeg23 timvir-s-1y0btm7 timvir-s-j7gikm timvir-s-1d0dlzq",
250
245
  dangerouslySetInnerHTML: {
251
246
  __html: state.html
252
247
  }
253
248
  }), caption && /*#__PURE__*/jsx("div", {
254
- ...captionStyleProps,
255
- className: cx("timvir-b-Code-caption", captionStyleProps.className),
249
+ "data-timvir-b-code-caption": true,
250
+ className: "timvir-s-1dcheo9 timvir-s-jkpybl timvir-s-vgvpxu timvir-s-lwy1ot",
256
251
  children: caption
257
252
  })]
258
253
  });
259
254
  }
260
- var Code$1 = /*#__PURE__*/React.forwardRef(Code);
255
+ var Code_default = /*#__PURE__*/React.forwardRef(Code);
261
256
 
262
- export { Code$1 as Code };
257
+ export { Code_default as Code };
@@ -1,6 +1,6 @@
1
1
  @layer priority1 {
2
- .timvir-s-15o1dgp {
3
- --timvir-b-Code-bleed: calc(var(--timvir-margin, 0) * .6666);
2
+ .timvir-s-i27niw {
3
+ --timvir-b-Code-bleed: calc(var(--timvir-margin, 0px) * .6666);
4
4
  }
5
5
 
6
6
  .timvir-s-idmeni {
@@ -5,130 +5,45 @@ import { Code, Exhibit } from "timvir/blocks";
5
5
 
6
6
  A `ColorBar` is a horizontal arrangement of swatches.
7
7
 
8
- <Exhibit>
9
- <ColorBar
10
- values={[
11
- "#D6CCFF",
12
- "#C8BCF5",
13
- "#BAACEB",
14
- "#AC9CE1",
15
- "#9E8CD7",
16
- "#907DCD",
17
- "#826EC3",
18
- "#745FBA",
19
- "#6550B0",
20
- "#5642A6",
21
- ]}
22
- style={{ margin: 0 }}
23
- />
24
- </Exhibit>
8
+ <Sample variant="basic" />
25
9
 
26
- <Exhibit>
27
- <ColorBar values={["#a0dbc2", "#60c19f", "#1a896b", "#0e6d54"]} style={{ margin: 0 }} />
28
- </Exhibit>
10
+ Pass the colors as an array of CSS color values.
29
11
 
30
- <Code language="jsx" caption="Pass an array of color values to the component." highlightedLines={[4]}>
12
+ <Code language="jsx" highlightedLines={[4]}>
31
13
  <Sample variant="basic" as="source" />
32
14
  </Code>
33
15
 
34
- The ColorBar works comfortably with as few as two colors and as many as 20
35
-
36
- <Exhibit caption="Two colors in a ColorBar">
37
- <ColorBar
38
- values={[
39
- { value: "#FFE4A0", name: "Yellow Submarine", ancestry: "Yellow 001" },
40
- { value: "#A67908", name: "Yellow Spaceship", ancestry: "Yellow 999", contrastValue: "white" },
41
- ]}
42
- style={{ margin: 0 }}
43
- />
44
- </Exhibit>
45
-
46
- <Exhibit caption="20 colors in a ColorBar">
47
- <ColorBar
48
- values={[
49
- "#FFE4A0",
50
- "#FBDE98",
51
- "#F6D891",
52
- "#F2D28A",
53
- "#EDCC82",
54
- "#E8C77B",
55
- "#E4C173",
56
- "#DFBB6C",
57
- "#DBB565",
58
- "#D6B05D",
59
- "#D1AA56",
60
- "#CDA54F",
61
- "#C89F47",
62
- "#C39940",
63
- "#BE9438",
64
- "#BA8E30",
65
- "#B58928",
66
- "#B0841F",
67
- "#AB7E15",
68
- "#A67908",
69
- ]}
70
- style={{ margin: 0 }}
71
- />
72
- </Exhibit>
73
-
74
- ## Text Colors
75
-
76
- These are the main text colors that are used in our website. We have a **textPrimary** color for
77
- headings and body text, **textSecondary** for captions and meta lines, and a third (yet unamed)
78
- text color for card descriptions.
79
-
80
- All text colors are taken from the **Gray** palette.
81
-
82
- <Exhibit caption="Text Colors" style={{ margin: "10px 0 20px 0" }}>
83
- <ColorBar
84
- values={[
85
- { value: "rgba(0, 0, 13, 0.89)", name: "textPrimary", ancestry: "Gray 01", contrastValue: "white" },
86
- { value: "rgba(0, 0, 13, 0.69)", name: "???? (unnamed)", ancestry: "Gray 03", contrastValue: "white" },
87
- { value: "rgba(0, 0, 13, 0.49)", name: "textSecondary", ancestry: "Gray 05" },
88
- ]}
89
- style={{ margin: 0 }}
90
- />
91
- </Exhibit>
92
- <Exhibit caption="Gray Color Palette (00 – 09)" style={{ margin: "-12px 0 20px 0" }}>
93
- <ColorBar
94
- values={[
95
- { value: "rgba(0, 0, 13, 0.99)", name: "Gray 00", contrastValue: "white" },
96
- { value: "rgba(0, 0, 13, 0.89)", name: "Gray 01", contrastValue: "white" },
97
- { value: "rgba(0, 0, 13, 0.79)", name: "Gray 02", contrastValue: "white" },
98
- { value: "rgba(0, 0, 13, 0.69)", name: "Gray 03", contrastValue: "white" },
99
- { value: "rgba(0, 0, 13, 0.59)", name: "Gray 04", contrastValue: "white" },
100
- { value: "rgba(0, 0, 13, 0.49)", name: "Gray 05", contrastValue: "black" },
101
- { value: "rgba(0, 0, 13, 0.39)", name: "Gray 06", contrastValue: "black" },
102
- { value: "rgba(0, 0, 13, 0.29)", name: "Gray 07", contrastValue: "black" },
103
- { value: "rgba(0, 0, 13, 0.19)", name: "Gray 08", contrastValue: "black" },
104
- { value: "rgba(0, 0, 13, 0.09)", name: "Gray 09", contrastValue: "black" },
105
- ]}
106
- style={{ margin: 0 }}
107
- />
108
- </Exhibit>
109
-
110
- Wrap a `<ColorBar>` in a `<Exhibit>` to add a caption to it. The caption can even include links!
111
-
112
- <Exhibit
113
- caption={
114
- <>
115
- Source: <a href="https://hihayk.github.io/scale/#2/7/50/90/0/0/0/-0/1190D7/17/144/215">hihayk.github.io/scale</a>
116
- </>
117
- }
118
- >
119
- <ColorBar
120
- values={[
121
- "#E7F4FB",
122
- "#C9E6F6",
123
- "#AAD7F1",
124
- "#8BC9EC",
125
- "#6DBBE6",
126
- "#4EADE1",
127
- "#309EDC",
128
- "#1190D7",
129
- "#0D6CA1",
130
- "#09486C",
131
- ]}
132
- style={{ margin: 0 }}
133
- />
134
- </Exhibit>
16
+ The ColorBar works comfortably with as few as two colors and as many as 20.
17
+ If you specify more colors than that, each individual swatch becomes tiny, especially on smaller viewports.
18
+
19
+ <ColorBar
20
+ values={[
21
+ { value: "#FFE4A0", name: "Yellow Submarine", ancestry: "Yellow 001" },
22
+ { value: "#A67908", name: "Yellow Spaceship", ancestry: "Yellow 999", contrastValue: "white" },
23
+ ]}
24
+ />
25
+
26
+ <ColorBar
27
+ values={[
28
+ "#FFE4A0",
29
+ "#FBDE98",
30
+ "#F6D891",
31
+ "#F2D28A",
32
+ "#EDCC82",
33
+ "#E8C77B",
34
+ "#E4C173",
35
+ "#DFBB6C",
36
+ "#DBB565",
37
+ "#D6B05D",
38
+ "#D1AA56",
39
+ "#CDA54F",
40
+ "#C89F47",
41
+ "#C39940",
42
+ "#BE9438",
43
+ "#BA8E30",
44
+ "#B58928",
45
+ "#B0841F",
46
+ "#AB7E15",
47
+ "#A67908",
48
+ ]}
49
+ />
@@ -227,7 +227,7 @@ function ColorBar(props$1, ref) {
227
227
  })]
228
228
  });
229
229
  }
230
- var ColorBar$1 = /*#__PURE__*/React.forwardRef(ColorBar);
230
+ var ColorBar_default = /*#__PURE__*/React.forwardRef(ColorBar);
231
231
  const styles = {
232
232
  root: {
233
233
  kVAEAm: "timvir-s-1n2onr6",
@@ -250,4 +250,4 @@ const styles = {
250
250
  }
251
251
  };
252
252
 
253
- export { ColorBar$1 as ColorBar };
253
+ export { ColorBar_default as ColorBar };
@@ -213,7 +213,7 @@ function ColorBook(props$1, ref) {
213
213
  }, i))
214
214
  });
215
215
  }
216
- var ColorBook$1 = /*#__PURE__*/React.forwardRef(ColorBook);
216
+ var ColorBook_default = /*#__PURE__*/React.forwardRef(ColorBook);
217
217
  const styles = {
218
218
  root: {
219
219
  k1xSpc: "timvir-s-rvj5dj",
@@ -243,4 +243,4 @@ const styles = {
243
243
  }
244
244
  };
245
245
 
246
- export { ColorBook$1 as ColorBook };
246
+ export { ColorBook_default as ColorBook };
@@ -7,14 +7,3 @@ import image from "../../../../../assets/daniel-leone-v7daTKlZzaw-unsplash.jpg";
7
7
  # Cover
8
8
 
9
9
  The Cover component is an image that is displayed full-width. Use it above the first h1 heading on the page.
10
-
11
- ## Usage
12
-
13
- Use the `importImage()` macro from the `"@zhif/macro"` package to load the image.
14
-
15
- ```jsx
16
- import { Cover } from "timvir/blocks";
17
- import { importImage } from "@zhif/macro";
18
-
19
- <Cover {...importImage("path/to/image.jpg")} />;
20
- ```
@@ -201,6 +201,6 @@ function Cover(props$1, ref) {
201
201
  })
202
202
  });
203
203
  }
204
- var Cover$1 = /*#__PURE__*/React.forwardRef(Cover);
204
+ var Cover_default = /*#__PURE__*/React.forwardRef(Cover);
205
205
 
206
- export { Cover$1 as Cover };
206
+ export { Cover_default as Cover };
@@ -194,14 +194,12 @@ function Exhibit(props$1, ref) {
194
194
  className: "timvir-s-ufnvkl timvir-s-7zdco timvir-s-1sxf85j timvir-s-mkeg23 timvir-s-1tffoc1 timvir-s-ng3xce timvir-s-rxpjvj timvir-s-1717udv"
195
195
  }
196
196
  }[!!(bleed === 0) << 0];
197
- const captionStyleProps = {
198
- className: "timvir-s-1dcheo9 timvir-s-jkpybl timvir-s-vgvpxu timvir-s-lwy1ot"
199
- };
200
197
  return /*#__PURE__*/jsxs(Root, {
201
198
  ref: ref,
199
+ "data-timvir-b-exhibit": true,
202
200
  ...rest,
203
201
  ...rootStyleProps,
204
- className: cx("timvir-b-Exhibit", className, rootStyleProps.className),
202
+ className: cx(className, rootStyleProps.className),
205
203
  style: {
206
204
  ...rootStyleProps.style,
207
205
  ...style,
@@ -210,9 +208,10 @@ function Exhibit(props$1, ref) {
210
208
  [cssVariables.background]: "var(--timvir-background-pattern)"
211
209
  },
212
210
  children: [/*#__PURE__*/jsx("div", {
211
+ "data-timvir-b-exhibit-container": true,
213
212
  ...BackdropProps,
214
213
  ...containerStyleProps,
215
- className: cx("timvir-b-Exhibit-container", containerStyleProps.className, BackdropProps?.className),
214
+ className: cx(containerStyleProps.className, BackdropProps?.className),
216
215
  style: {
217
216
  ...containerStyleProps.style,
218
217
  border: bleed === 0 ? "none" : `1px solid var(${cssVariables.borderColor})`,
@@ -220,13 +219,13 @@ function Exhibit(props$1, ref) {
220
219
  },
221
220
  children: children
222
221
  }), caption && /*#__PURE__*/jsx("div", {
223
- ...captionStyleProps,
224
- className: cx("timvir-b-Exhibit-caption", captionStyleProps.className),
222
+ "data-timvir-b-exhibit-caption": true,
223
+ className: "timvir-s-1dcheo9 timvir-s-jkpybl timvir-s-vgvpxu timvir-s-lwy1ot",
225
224
  children: caption
226
225
  })]
227
226
  });
228
227
  }
229
- var Exhibit$1 = /*#__PURE__*/React.forwardRef(Exhibit);
228
+ var Exhibit_default = /*#__PURE__*/React.forwardRef(Exhibit);
230
229
  const cssVariables = {
231
230
  bleed: "--timvir-b-Exhibit-bleed",
232
231
  borderColor: "--timvir-b-Exhibit-borderColor",
@@ -238,4 +237,4 @@ const styles = {
238
237
  }
239
238
  };
240
239
 
241
- export { Exhibit$1 as Exhibit };
240
+ export { Exhibit_default as Exhibit };
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
  import { useArticleComponents } from 'timvir/core';
3
3
  import * as React from 'react';
4
- import * as Icons from 'react-feather';
5
4
  import { jsxs, jsx } from 'react/jsx-runtime';
6
5
 
7
6
  function cx(...args) {
@@ -174,6 +173,26 @@ function props(...styles) {
174
173
  return result;
175
174
  }
176
175
 
176
+ const SvgInfo = props => /*#__PURE__*/jsxs("svg", {
177
+ xmlns: "http://www.w3.org/2000/svg",
178
+ width: 24,
179
+ height: 24,
180
+ fill: "none",
181
+ stroke: "currentColor",
182
+ strokeLinecap: "round",
183
+ strokeLinejoin: "round",
184
+ strokeWidth: 2,
185
+ viewBox: "0 0 24 24",
186
+ ...props,
187
+ children: [/*#__PURE__*/jsx("circle", {
188
+ cx: 12,
189
+ cy: 12,
190
+ r: 10
191
+ }), /*#__PURE__*/jsx("path", {
192
+ d: "M12 16v-4M12 8h.01"
193
+ })]
194
+ });
195
+
177
196
  const Root = "div";
178
197
  function Font(props$1, ref) {
179
198
  const components = useArticleComponents();
@@ -240,8 +259,9 @@ function Font(props$1, ref) {
240
259
  }
241
260
  }
242
261
  },
243
- children: /*#__PURE__*/jsx(Icons.Info, {
244
- size: "1.1em",
262
+ children: /*#__PURE__*/jsx(SvgInfo, {
263
+ width: "1.1em",
264
+ height: "1.1em",
245
265
  className: "timvir-s-1n2onr6 timvir-s-s7f9wi"
246
266
  })
247
267
  })]
@@ -280,6 +300,6 @@ function Font(props$1, ref) {
280
300
  })]
281
301
  });
282
302
  }
283
- var Font$1 = /*#__PURE__*/React.forwardRef(Font);
303
+ var Font_default = /*#__PURE__*/React.forwardRef(Font);
284
304
 
285
- export { Font$1 as Font };
305
+ export { Font_default as Font };
@@ -188,10 +188,26 @@ function Grid(props$1, ref) {
188
188
  ...rest.style
189
189
  },
190
190
  className: cx(className, rootStyleProps.className),
191
- children: children
191
+ children: React.Children.map(children, child => {
192
+ if (! /*#__PURE__*/React.isValidElement(child)) {
193
+ return child;
194
+ }
195
+ const {
196
+ style,
197
+ ...props
198
+ } = child.props;
199
+ return /*#__PURE__*/React.createElement(child.type, {
200
+ ...props,
201
+ style: {
202
+ margin: 0,
203
+ gridColumn: "initial",
204
+ ...style
205
+ }
206
+ });
207
+ })
192
208
  });
193
209
  }
194
- var Grid$1 = /*#__PURE__*/React.forwardRef(Grid);
210
+ var Grid_default = /*#__PURE__*/React.forwardRef(Grid);
195
211
  const styles = {
196
212
  root: {
197
213
  k1xSpc: "timvir-s-rvj5dj",
@@ -202,4 +218,4 @@ const styles = {
202
218
  }
203
219
  };
204
220
 
205
- export { Grid$1 as Grid };
221
+ export { Grid_default as Grid };
@@ -136,6 +136,6 @@ function Icon(props, ref) {
136
136
  })
137
137
  });
138
138
  }
139
- var Icon$1 = /*#__PURE__*/React.forwardRef(Icon);
139
+ var Icon_default = /*#__PURE__*/React.forwardRef(Icon);
140
140
 
141
- export { Icon$1 as Icon };
141
+ export { Icon_default as Icon };
@@ -1,48 +1,57 @@
1
- import { Exhibit } from "../../Exhibit";
2
- import { Grid } from "../../Grid";
3
1
  import { Swatch } from "../../Swatch";
4
2
  import { Code } from "../../Code";
5
3
 
6
4
  # Message
7
5
 
8
- <Exhibit>
9
- <Sample variant="basic" />
10
- </Exhibit>
6
+ The `<Message>` component is a simple container for messages.
11
7
 
12
- <Code language="jsx">
13
- <Sample variant="basic" as="source" />
14
- </Code>
8
+ <Sample variant="basic" />
15
9
 
16
10
  ## Variants
17
11
 
18
- <Grid>
19
- <Exhibit caption="info" style={{ margin: 0, gridColumn: "initial" }}>
20
- <Sample variant="basic" props={{ variant: "info" }} />
21
- </Exhibit>
22
- <Exhibit caption="warning" style={{ margin: 0, gridColumn: "initial" }}>
23
- <Sample variant="basic" props={{ variant: "warning" }} />
24
- </Exhibit>
25
- <Exhibit caption="alert" style={{ margin: 0, gridColumn: "initial" }}>
26
- <Sample variant="basic" props={{ variant: "alert" }} />
27
- </Exhibit>
28
- </Grid>
12
+ The Message block comes in four variants: **plain**, **info**, **warning**, and **alert**.
13
+ Each variant uses a different color and icon.
14
+ Below are examples in which situations to use the variants.
29
15
 
30
- ## Content
16
+ <Sample variant="basic">
17
+ This is the **plain** variant. Use it for simple notes, neutral remarks, or secondary information that doesn’t require emphasis.
18
+
19
+ _Example:_ This component is defined in src/components/Message.tsx.
20
+
21
+ </Sample>
22
+
23
+ <Sample variant="basic" props={{ variant: "info" }}>
24
+ This is the **info** variant. Use it to share helpful or contextual information about the code or component.
25
+
26
+ _Example:_ This hook is useful for managing form state.
27
+
28
+ </Sample>
31
29
 
32
- Make the title bold and place it before the message, or use a level 3 heading. You can use arbitrary markdown inside the message.
30
+ <Sample variant="basic" props={{ variant: "warning" }}>
31
+ This is the **warning** variant. Use it to call attention to potential pitfalls, limitations, or special cases to consider when using the code.
33
32
 
34
- <Grid>
35
- <Exhibit caption="Inline title" style={{ margin: 0, gridColumn: "initial" }}>
36
- <Sample variant="basic">
33
+ _Example:_ This component has not been tested with server-side rendering.
37
34
 
38
- **Short Messages** should place the title in front of the message and make it stand out.
35
+ </Sample>
39
36
 
40
- </Sample>
41
- </Exhibit>
37
+ <Sample variant="basic" props={{ variant: "alert" }}>
38
+ This is the **alert** variant. Use it for strict requirements, do-nots, or critical caveats that must be followed when using the code.
42
39
 
43
- <Exhibit caption="Title as a separate block elment" style={{ margin: 0, gridColumn: "initial" }}>
44
- <Sample variant="basic">
40
+ _Example:_ You must not use this component inside a React Suspense boundary.
45
41
 
42
+ </Sample>
43
+
44
+ ## Content
45
+
46
+ You can use arbitrary markdown inside the message, or even blocks.
47
+ Note that not all combinations have been exhaustively tested.
48
+ If you come across markup that doesn't render well, please raise an issue in the Timvir project.
49
+
50
+ <Sample variant="basic">
51
+ **Short Messages** should place the title in front of the message and make it stand out.
52
+ </Sample>
53
+
54
+ <Sample variant="basic">
46
55
  ### Longer Messages
47
56
 
48
57
  Longer messages should make the title a separate block element. This body uses [links](#) and _italic_ text.
@@ -50,10 +59,7 @@ Longer messages should make the title a separate block element. This body uses [
50
59
  And multiple paragraphs. And even a component:
51
60
 
52
61
  <Swatch value="#FF00FF" />
53
-
54
- </Sample>
55
- </Exhibit>
56
- </Grid>
62
+ </Sample>
57
63
 
58
64
  ## References
59
65