timvir 0.2.1 → 0.2.3

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 (41) hide show
  1. package/blocks/Arbitrary/index.js +20 -29
  2. package/blocks/Arbitrary/styles.css +1 -0
  3. package/blocks/Code/index.js +23 -19
  4. package/blocks/Code/styles.css +3 -1
  5. package/blocks/ColorBar/index.js +18 -14
  6. package/blocks/ColorBar/styles.css +1 -0
  7. package/blocks/ColorBook/index.js +18 -14
  8. package/blocks/ColorBook/styles.css +1 -0
  9. package/blocks/Cover/index.js +18 -13
  10. package/blocks/Cover/styles.css +1 -0
  11. package/blocks/Exhibit/index.js +18 -13
  12. package/blocks/Exhibit/styles.css +1 -0
  13. package/blocks/Font/index.js +23 -17
  14. package/blocks/Font/styles.css +1 -0
  15. package/blocks/Grid/index.js +16 -12
  16. package/blocks/Grid/styles.css +1 -0
  17. package/blocks/Icon/index.js +17 -20
  18. package/blocks/Icon/styles.css +4 -2
  19. package/blocks/Message/index.js +16 -12
  20. package/blocks/Message/styles.css +1 -0
  21. package/blocks/Swatch/index.js +16 -12
  22. package/blocks/Swatch/styles.css +1 -0
  23. package/blocks/Viewport/index.js +22 -30
  24. package/blocks/Viewport/styles.css +10 -6
  25. package/blocks/WebLink/index.js +16 -14
  26. package/blocks/WebLink/styles.css +1 -0
  27. package/blocks/styles.css +27 -9
  28. package/bus/index.js +1 -1
  29. package/bus/styles.css +1 -0
  30. package/context/index.js +0 -2
  31. package/context/styles.css +1 -0
  32. package/core/components/Page/components.d.ts +14 -14
  33. package/core/index.js +105 -734
  34. package/core/layout.d.ts +2 -2
  35. package/core/styles.css +32 -21
  36. package/hooks/index.js +3 -10
  37. package/hooks/styles.css +1 -0
  38. package/package.json +3 -3
  39. package/search/index.js +30 -37
  40. package/search/styles.css +9 -6
  41. package/styles.css +71 -36
@@ -18,26 +18,33 @@ import { useImmer } from 'use-immer';
18
18
  * @returns the combined, space separated class names that can be applied directly to the class attribute
19
19
  */
20
20
  const cx = function cx() {
21
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
21
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
22
+ .call(arguments).filter(Boolean);
22
23
  const atomicClasses = {};
23
24
  const nonAtomicClasses = [];
24
-
25
- for (const className of presentClassNames) {
25
+ presentClassNames.forEach(arg => {
26
26
  // className could be the output of a previous cx call, so split by ' ' first
27
- const individualClassNames = className.split(' ');
28
-
29
- for (const className of individualClassNames) {
27
+ const individualClassNames = arg ? arg.split(' ') : [];
28
+ individualClassNames.forEach(className => {
30
29
  if (className.startsWith('atm_')) {
31
30
  const [, keyHash] = className.split('_');
32
31
  atomicClasses[keyHash] = className;
33
32
  } else {
34
33
  nonAtomicClasses.push(className);
35
34
  }
35
+ });
36
+ });
37
+ const result = []; // eslint-disable-next-line no-restricted-syntax
38
+
39
+ for (const keyHash in atomicClasses) {
40
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
41
+ result.push(atomicClasses[keyHash]);
36
42
  }
37
43
  }
38
-
39
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
44
+ result.push(...nonAtomicClasses);
45
+ return result.join(' ');
40
46
  };
47
+ var cx$1 = cx;
41
48
 
42
49
  const bytesToHex = (() => {
43
50
  const s = Array.from({
@@ -45,67 +52,53 @@ const bytesToHex = (() => {
45
52
  }).map((_, i) => i.toString(16).padStart(2, "0"));
46
53
  return uint8a => [...uint8a].map(o => s[o]).join("");
47
54
  })();
48
-
49
55
  const alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
50
56
  function encode(input) {
51
57
  if (input.length === 0) {
52
58
  return "";
53
- } // Uint8Array -> BigInt (Big Endian)
54
-
55
-
59
+ }
60
+ // Uint8Array -> BigInt (Big Endian)
56
61
  let x = BigInt("0x" + bytesToHex(input));
57
62
  const output = [];
58
-
59
63
  while (x > 0n) {
60
64
  const mod = x % 58n;
61
65
  x = x / 58n;
62
66
  output.push(alphabet[Number(mod)]);
63
67
  }
64
-
65
68
  for (let i = 0; input[i] === 0; i++) {
66
69
  output.push(alphabet[0]);
67
70
  }
68
-
69
71
  return output.reverse().join("");
70
72
  }
71
73
  function decode(output) {
72
74
  if (output.length === 0) {
73
75
  return new Uint8Array();
74
76
  }
75
-
76
77
  const bytes = [0];
77
78
  const letters = alphabet;
78
-
79
79
  for (const char of output) {
80
80
  const value = letters.indexOf(char);
81
-
82
81
  if (value === undefined) {
83
82
  throw new Error(`base58.decode received invalid input. Character '${char}' is not in the base58 alphabet.`);
84
83
  }
85
-
86
84
  for (let j = 0; j < bytes.length; j++) {
87
85
  bytes[j] *= 58;
88
86
  }
89
-
90
87
  bytes[0] += value;
91
88
  let carry = 0;
92
-
93
89
  for (let j = 0; j < bytes.length; j++) {
94
90
  bytes[j] += carry;
95
91
  carry = bytes[j] >> 8;
96
92
  bytes[j] &= 0xff;
97
93
  }
98
-
99
94
  while (carry > 0) {
100
95
  bytes.push(carry & 0xff);
101
96
  carry >>= 8;
102
97
  }
103
98
  }
104
-
105
99
  for (let i = 0; i < output.length && output[i] === "1"; i++) {
106
100
  bytes.push(0);
107
101
  }
108
-
109
102
  return new Uint8Array(bytes.reverse());
110
103
  }
111
104
 
@@ -117,9 +110,7 @@ const useContext = () => React.useContext(Context);
117
110
  /**
118
111
  * The underlying DOM element which is rendered by this component.
119
112
  */
120
-
121
113
  const Root = "div";
122
-
123
114
  function Arbitrary(props, ref) {
124
115
  const block = useBlock(props);
125
116
  const {
@@ -151,7 +142,7 @@ function Arbitrary(props, ref) {
151
142
  value: value
152
143
  }, /*#__PURE__*/React.createElement(Root, {
153
144
  ref: ref,
154
- className: cx(classes.root, className),
145
+ className: cx$1(classes.root, className),
155
146
  ...rest
156
147
  }, /*#__PURE__*/React.createElement("div", {
157
148
  className: classes.controls
@@ -179,10 +170,10 @@ function Arbitrary(props, ref) {
179
170
  draft.seed = crypto.getRandomValues(new Uint32Array(1))[0];
180
171
  });
181
172
  }
182
- }, "Refresh")), /*#__PURE__*/React.createElement(Exhibit, { ...ExhibitProps
173
+ }, "Refresh")), /*#__PURE__*/React.createElement(Exhibit, {
174
+ ...ExhibitProps
183
175
  }, children)));
184
176
  }
185
-
186
177
  var Arbitrary$1 = /*#__PURE__*/React.forwardRef(Arbitrary);
187
178
  const classes = {
188
179
  root: "r1ev38xg",
@@ -4,3 +4,4 @@
4
4
  .s1k50njo{display:inline-block;color:var(--timvir-secondary-text-color);margin-right:6px;}
5
5
  .i1dajnne{border:none;outline:none;font:inherit;background:transparent;align-self:stretch;padding:0;height:34px;width:100%;color:inherit;}
6
6
  .b128wsn{border:none;outline:none;height:36px;background:var(--timvir-accent-color);font:inherit;border-radius:2px;cursor:pointer;transition:background 0.2s;}.b128wsn:hover{background:var(--c-p-3);}.b128wsn:active{background:var(--c-p-4);}
7
+
@@ -20,42 +20,48 @@ import { useImmer } from 'use-immer';
20
20
  * @returns the combined, space separated class names that can be applied directly to the class attribute
21
21
  */
22
22
  const cx = function cx() {
23
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
23
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
24
+ .call(arguments).filter(Boolean);
24
25
  const atomicClasses = {};
25
26
  const nonAtomicClasses = [];
26
-
27
- for (const className of presentClassNames) {
27
+ presentClassNames.forEach(arg => {
28
28
  // className could be the output of a previous cx call, so split by ' ' first
29
- const individualClassNames = className.split(' ');
30
-
31
- for (const className of individualClassNames) {
29
+ const individualClassNames = arg ? arg.split(' ') : [];
30
+ individualClassNames.forEach(className => {
32
31
  if (className.startsWith('atm_')) {
33
32
  const [, keyHash] = className.split('_');
34
33
  atomicClasses[keyHash] = className;
35
34
  } else {
36
35
  nonAtomicClasses.push(className);
37
36
  }
37
+ });
38
+ });
39
+ const result = []; // eslint-disable-next-line no-restricted-syntax
40
+
41
+ for (const keyHash in atomicClasses) {
42
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
43
+ result.push(atomicClasses[keyHash]);
38
44
  }
39
45
  }
40
-
41
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
46
+ result.push(...nonAtomicClasses);
47
+ return result.join(' ');
42
48
  };
49
+ var cx$1 = cx;
43
50
 
44
51
  var theme = "tac6gx6";
45
52
 
46
53
  /**
47
54
  * This is documentation for the Code component.
48
55
  */
56
+
49
57
  /**
50
58
  * The underlying DOM element which is rendered by this component.
51
59
  */
52
-
53
60
  const Root = "div";
54
61
  const nullTheme = {
55
62
  plain: {},
56
63
  styles: []
57
64
  };
58
-
59
65
  function Code(props, ref) {
60
66
  const block = useBlock(props);
61
67
  const {
@@ -66,20 +72,19 @@ function Code(props, ref) {
66
72
  caption,
67
73
  ...rest
68
74
  } = block.props;
69
-
70
75
  const isHighlightedLine = (() => {
71
76
  return line => highlightedLines === null || highlightedLines === void 0 ? void 0 : highlightedLines.includes(line);
72
77
  })();
73
-
74
78
  const [state, mutate] = useImmer({
75
79
  mouseOver: false,
76
80
  copiedToClipboard: false
77
81
  });
78
82
  return /*#__PURE__*/React.createElement(Root, {
79
83
  ref: ref,
80
- className: cx(classes.root, fullWidth && Page.fullWidth),
84
+ className: cx$1(classes.root, fullWidth && Page.fullWidth),
81
85
  ...rest
82
- }, /*#__PURE__*/React.createElement(Highlight, { ...defaultProps,
86
+ }, /*#__PURE__*/React.createElement(Highlight, {
87
+ ...defaultProps,
83
88
  code: children.trim(),
84
89
  language: language !== null && language !== void 0 ? language : "markup",
85
90
  theme: nullTheme
@@ -90,7 +95,7 @@ function Code(props, ref) {
90
95
  getLineProps,
91
96
  getTokenProps
92
97
  }) => /*#__PURE__*/React.createElement("pre", {
93
- className: cx(className, theme, classes.code, fullWidth && classes.fullWidth),
98
+ className: cx$1(className, theme, classes.code, fullWidth && classes.fullWidth),
94
99
  style: style
95
100
  }, /*#__PURE__*/React.createElement("div", {
96
101
  className: "d1513p2s",
@@ -112,7 +117,7 @@ function Code(props, ref) {
112
117
  draft.copiedToClipboard = true;
113
118
  });
114
119
  },
115
- className: cx("b157mkz", state.mouseOver && "b10oxtfo")
120
+ className: cx$1("b157mkz", state.mouseOver && "b10oxtfo")
116
121
  }, /*#__PURE__*/React.createElement("svg", {
117
122
  width: 48,
118
123
  height: 48,
@@ -125,7 +130,7 @@ function Code(props, ref) {
125
130
  }) : /*#__PURE__*/React.createElement(Icons.Copy, {
126
131
  size: "16px"
127
132
  })), /*#__PURE__*/React.createElement("div", {
128
- className: cx(fullWidth ? "d17pltln" : "d793q8f")
133
+ className: cx$1(fullWidth ? "d17pltln" : "d793q8f")
129
134
  }, tokens.map((line, i) => {
130
135
  const {
131
136
  className,
@@ -137,7 +142,7 @@ function Code(props, ref) {
137
142
  return /*#__PURE__*/React.createElement("div", {
138
143
  key: i,
139
144
  ...lineProps,
140
- className: cx(className, classes.line, isHighlightedLine(i + 1) && classes.highlightedLine)
145
+ className: cx$1(className, classes.line, isHighlightedLine(i + 1) && classes.highlightedLine)
141
146
  }, line.map((token, key) => /*#__PURE__*/React.createElement("span", {
142
147
  key: key,
143
148
  ...getTokenProps({
@@ -149,7 +154,6 @@ function Code(props, ref) {
149
154
  className: classes.caption
150
155
  }, caption));
151
156
  }
152
-
153
157
  var Code$1 = /*#__PURE__*/React.forwardRef(Code);
154
158
  const classes = {
155
159
  root: "r9v2r0l",
@@ -1,3 +1,5 @@
1
+ .tac6gx6{color:#393a34;background-color:#f6f8fa;}.tac6gx6 :is(.comment,.prolog,.doctype,.cdata){color:#999988;font-style:italic;}.tac6gx6 :is(.namespace){opacity:0.7;}.tac6gx6 :is(.string,.attr-value){color:#e3116c;}.tac6gx6 :is(.punctuation,.operator){color:#6cb6ff;}.tac6gx6 :is(.function,.delete,.tag){color:#d73a49;}.tac6gx6 :is(.tag,.selector,.keyword){color:#00009f;}.tac6gx6 :is(.function-variable){color:#6f42c1;}.tac6gx6 :is(.atrule,.keyword,.attr-name,.selector){color:#00a4db;}.tac6gx6 :is(.entity,.url,.symbol,.number,.boolean,.variable,.constant,.property,.regex,.inserted){color:#36acaa;}:root[data-timvir-theme="dark"] .tac6gx6{color:#adbac7;background-color:#2d333b;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.comment,.prolog,.doctype,.cdata){color:#999988;font-style:italic;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.namespace){opacity:0.7;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.string,.attr-value){color:#96d0ff;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.punctuation,.operator){color:#6cb6ff;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.function,.delete,.tag){color:#d73a49;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.tag,.selector,.keyword){color:#8ddb8c;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.function-variable){color:#6f42c1;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.atrule,.keyword,.attr-name,.selector){color:#f47067;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.entity,.url,.symbol,.number,.boolean,.variable,.constant,.property,.regex,.inserted){color:#dcbdfb;}
2
+
1
3
  .d1513p2s{display:grid;grid-template-columns:1fr;padding-block:16px;}
2
4
  .b157mkz{--size:48px;z-index:1;position:absolute;top:0;right:0;overflow:hidden;width:var(--size);height:var(--size);display:flex;align-items:flex-start;justify-content:flex-end;outline:none;border:none;padding:6px;background:transparent;transition:all 0.2s;cursor:pointer;pointer-events:none;opacity:0;}.b157mkz:hover{color:white;}.b157mkz:hover svg:first-child{transform:translate(0,0);}.b157mkz:active svg:first-child{transform:translate(2px,-2px);}
3
5
  .b10oxtfo{pointer-events:all;opacity:1;}
@@ -11,4 +13,4 @@
11
13
  .h1xcko1i{background-color:#ffe10044;}:root[data-timvir-theme="dark"] .h1xcko1i{background-color:rgba(174,124,20,0.15);}
12
14
  .ll2b9hx{display:inline-block;width:var(--timvir-b-Code-bleed);color:var(--timvir-secondary-text-color);text-align:right;padding-inline:4px;}
13
15
  .c5vr6r2{font-size:0.75rem;color:var(--timvir-secondary-text-color);margin-top:2px;}
14
- .tac6gx6{color:#393a34;background-color:#f6f8fa;}.tac6gx6 :is(.comment,.prolog,.doctype,.cdata){color:#999988;font-style:italic;}.tac6gx6 :is(.namespace){opacity:0.7;}.tac6gx6 :is(.string,.attr-value){color:#e3116c;}.tac6gx6 :is(.punctuation,.operator){color:#6cb6ff;}.tac6gx6 :is(.function,.delete,.tag){color:#d73a49;}.tac6gx6 :is(.tag,.selector,.keyword){color:#00009f;}.tac6gx6 :is(.function-variable){color:#6f42c1;}.tac6gx6 :is(.atrule,.keyword,.attr-name,.selector){color:#00a4db;}.tac6gx6 :is(.entity,.url,.symbol,.number,.boolean,.variable,.constant,.property,.regex,.inserted){color:#36acaa;}:root[data-timvir-theme="dark"] .tac6gx6{color:#adbac7;background-color:#2d333b;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.comment,.prolog,.doctype,.cdata){color:#999988;font-style:italic;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.namespace){opacity:0.7;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.string,.attr-value){color:#96d0ff;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.punctuation,.operator){color:#6cb6ff;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.function,.delete,.tag){color:#d73a49;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.tag,.selector,.keyword){color:#8ddb8c;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.function-variable){color:#6f42c1;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.atrule,.keyword,.attr-name,.selector){color:#f47067;}:root[data-timvir-theme="dark"] .tac6gx6 :is(.entity,.url,.symbol,.number,.boolean,.variable,.constant,.property,.regex,.inserted){color:#dcbdfb;}
16
+
@@ -17,36 +17,40 @@ import * as React from 'react';
17
17
  * @returns the combined, space separated class names that can be applied directly to the class attribute
18
18
  */
19
19
  const cx = function cx() {
20
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
20
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
21
+ .call(arguments).filter(Boolean);
21
22
  const atomicClasses = {};
22
23
  const nonAtomicClasses = [];
23
-
24
- for (const className of presentClassNames) {
24
+ presentClassNames.forEach(arg => {
25
25
  // className could be the output of a previous cx call, so split by ' ' first
26
- const individualClassNames = className.split(' ');
27
-
28
- for (const className of individualClassNames) {
26
+ const individualClassNames = arg ? arg.split(' ') : [];
27
+ individualClassNames.forEach(className => {
29
28
  if (className.startsWith('atm_')) {
30
29
  const [, keyHash] = className.split('_');
31
30
  atomicClasses[keyHash] = className;
32
31
  } else {
33
32
  nonAtomicClasses.push(className);
34
33
  }
34
+ });
35
+ });
36
+ const result = []; // eslint-disable-next-line no-restricted-syntax
37
+
38
+ for (const keyHash in atomicClasses) {
39
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
40
+ result.push(atomicClasses[keyHash]);
35
41
  }
36
42
  }
37
-
38
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
43
+ result.push(...nonAtomicClasses);
44
+ return result.join(' ');
39
45
  };
46
+ var cx$1 = cx;
40
47
 
41
48
  /**
42
49
  * The underlying DOM element which is rendered by this component.
43
50
  */
44
-
45
51
  const Root = "div";
46
-
47
52
  function ColorBar(props, ref) {
48
53
  var _selected$value;
49
-
50
54
  const block = useBlock(props);
51
55
  const {
52
56
  values,
@@ -56,7 +60,7 @@ function ColorBar(props, ref) {
56
60
  const [selected, setSelected] = React.useState(undefined);
57
61
  return /*#__PURE__*/React.createElement(Root, {
58
62
  ref: ref,
59
- className: cx(className, classes.root, selected && tweaks.selected),
63
+ className: cx$1(className, classes.root, selected && tweaks.selected),
60
64
  ...rest
61
65
  }, /*#__PURE__*/React.createElement("div", {
62
66
  className: classes.bar,
@@ -75,7 +79,8 @@ function ColorBar(props, ref) {
75
79
  }
76
80
  })))), /*#__PURE__*/React.createElement("div", {
77
81
  className: classes.overlay
78
- }, /*#__PURE__*/React.createElement(Swatch, { ...(typeof selected === "string" ? {
82
+ }, /*#__PURE__*/React.createElement(Swatch, {
83
+ ...(typeof selected === "string" ? {
79
84
  value: selected
80
85
  } : {
81
86
  value: (_selected$value = selected === null || selected === void 0 ? void 0 : selected.value) !== null && _selected$value !== void 0 ? _selected$value : ""
@@ -85,7 +90,6 @@ function ColorBar(props, ref) {
85
90
  }
86
91
  })));
87
92
  }
88
-
89
93
  var ColorBar$1 = /*#__PURE__*/React.forwardRef(ColorBar);
90
94
  const tweaks = {
91
95
  selected: "s4sqb81"
@@ -3,3 +3,4 @@
3
3
  .b15hqsfj{display:grid;grid-auto-flow:row;grid-template-columns:repeat(auto-fit,minmax(0,1fr));transition:all 0.16s;}.b15hqsfj::before{position:absolute;top:0;right:0;bottom:0;left:0;display:block;z-index:2;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(16,22,26,0.15);content:"";pointer-events:none;user-select:none;transition:all 0.16s;}.b15hqsfj:hover::before{opacity:0;}
4
4
  .v1uw85xw{height:40px;flex-grow:1;display:grid;place-items:stretch;}.v1uw85xw > div{transition:all 0.16s;cursor:pointer;}.v1uw85xw:first-child > div{border-radius:2px 0 0 2px;}.v1uw85xw:last-child > div{border-radius:0 2px 2px 0;}.v1uw85xw:hover{z-index:3;}.v1uw85xw:hover > div{border-radius:2px;margin:-3px 1px;box-shadow:inset 0 0 0 1px rgba(16,22,26,0.2),0 2px 4px rgba(16,22,26,0.1), 0 8px 24px rgba(16,22,26,0.2);}
5
5
  .o1823law{position:absolute;top:50%;right:0px;left:0px;transform:translateY(-50%);pointer-events:none;opacity:0;z-index:4;transition:opacity 0.16s;}.s4sqb81 .o1823law{pointer-events:all;opacity:1;}
6
+
@@ -15,33 +15,38 @@ import * as React from 'react';
15
15
  * @returns the combined, space separated class names that can be applied directly to the class attribute
16
16
  */
17
17
  const cx = function cx() {
18
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
18
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
19
+ .call(arguments).filter(Boolean);
19
20
  const atomicClasses = {};
20
21
  const nonAtomicClasses = [];
21
-
22
- for (const className of presentClassNames) {
22
+ presentClassNames.forEach(arg => {
23
23
  // className could be the output of a previous cx call, so split by ' ' first
24
- const individualClassNames = className.split(' ');
25
-
26
- for (const className of individualClassNames) {
24
+ const individualClassNames = arg ? arg.split(' ') : [];
25
+ individualClassNames.forEach(className => {
27
26
  if (className.startsWith('atm_')) {
28
27
  const [, keyHash] = className.split('_');
29
28
  atomicClasses[keyHash] = className;
30
29
  } else {
31
30
  nonAtomicClasses.push(className);
32
31
  }
32
+ });
33
+ });
34
+ const result = []; // eslint-disable-next-line no-restricted-syntax
35
+
36
+ for (const keyHash in atomicClasses) {
37
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
38
+ result.push(atomicClasses[keyHash]);
33
39
  }
34
40
  }
35
-
36
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
41
+ result.push(...nonAtomicClasses);
42
+ return result.join(' ');
37
43
  };
44
+ var cx$1 = cx;
38
45
 
39
46
  /**
40
47
  * The underlying DOM element which is rendered by this component.
41
48
  */
42
-
43
49
  const Root = "div";
44
-
45
50
  function ColorBook(props, ref) {
46
51
  const {
47
52
  chapters,
@@ -53,7 +58,7 @@ function ColorBook(props, ref) {
53
58
  return /*#__PURE__*/React.createElement(Root, {
54
59
  ref: ref,
55
60
  ...rest,
56
- className: cx(className, "rmv2wrl")
61
+ className: cx$1(className, "rmv2wrl")
57
62
  }, chapters.map(({
58
63
  name,
59
64
  values
@@ -63,7 +68,7 @@ function ColorBook(props, ref) {
63
68
  gridColumn: i + 1
64
69
  }
65
70
  }, /*#__PURE__*/React.createElement("div", {
66
- className: cx(chapter, i === selectedChapter && activeChapter),
71
+ className: cx$1(chapter, i === selectedChapter && activeChapter),
67
72
  onClick: () => {
68
73
  if (onSelectChapter) {
69
74
  onSelectChapter(i);
@@ -76,10 +81,9 @@ function ColorBook(props, ref) {
76
81
  },
77
82
  className: "d1l94wnr"
78
83
  }))), name && /*#__PURE__*/React.createElement("div", {
79
- className: cx("d1uopbb", i === selectedChapter && "d1vwzhoa")
84
+ className: cx$1("d1uopbb", i === selectedChapter && "d1vwzhoa")
80
85
  }, name))));
81
86
  }
82
-
83
87
  var ColorBook$1 = /*#__PURE__*/React.forwardRef(ColorBook);
84
88
  const chapter = "c1xqhu04";
85
89
  const activeChapter = "a1y0tcvx";
@@ -4,3 +4,4 @@
4
4
  .d1vwzhoa{color:var(--timvir-text-color);}
5
5
  .c1xqhu04{position:relative;cursor:pointer;display:flex;flex-direction:column;height:200px;}.c1xqhu04::before{position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;border-radius:4px;box-shadow:0 0 0 0 rgba(19,124,189,0);content:"";transition:all 0.16s cubic-bezier(0.4,1,0.75,0.9);}.c1xqhu04:hover::before{box-shadow:0 0 0 2px #00000040;opacity:1;}
6
6
  .a1y0tcvx:hover::before,.a1y0tcvx::before{box-shadow:0 0 0 2px var(--c-p-5);opacity:1;}
7
+
@@ -16,33 +16,38 @@ import { fullWidth } from 'timvir/core';
16
16
  * @returns the combined, space separated class names that can be applied directly to the class attribute
17
17
  */
18
18
  const cx = function cx() {
19
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
19
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
20
+ .call(arguments).filter(Boolean);
20
21
  const atomicClasses = {};
21
22
  const nonAtomicClasses = [];
22
-
23
- for (const className of presentClassNames) {
23
+ presentClassNames.forEach(arg => {
24
24
  // className could be the output of a previous cx call, so split by ' ' first
25
- const individualClassNames = className.split(' ');
26
-
27
- for (const className of individualClassNames) {
25
+ const individualClassNames = arg ? arg.split(' ') : [];
26
+ individualClassNames.forEach(className => {
28
27
  if (className.startsWith('atm_')) {
29
28
  const [, keyHash] = className.split('_');
30
29
  atomicClasses[keyHash] = className;
31
30
  } else {
32
31
  nonAtomicClasses.push(className);
33
32
  }
33
+ });
34
+ });
35
+ const result = []; // eslint-disable-next-line no-restricted-syntax
36
+
37
+ for (const keyHash in atomicClasses) {
38
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
39
+ result.push(atomicClasses[keyHash]);
34
40
  }
35
41
  }
36
-
37
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
42
+ result.push(...nonAtomicClasses);
43
+ return result.join(' ');
38
44
  };
45
+ var cx$1 = cx;
39
46
 
40
47
  /**
41
48
  * The underlying DOM element which is rendered by this component.
42
49
  */
43
-
44
50
  const Root = "div";
45
-
46
51
  function Cover(props, ref) {
47
52
  const {
48
53
  metadata,
@@ -53,12 +58,13 @@ function Cover(props, ref) {
53
58
  } = props;
54
59
  return /*#__PURE__*/React.createElement(Root, {
55
60
  ref: ref,
56
- className: cx(className, fullWidth),
61
+ className: cx$1(className, fullWidth),
57
62
  ...rest
58
63
  }, /*#__PURE__*/React.createElement("picture", null, sources.map((p, i) => /*#__PURE__*/React.createElement("source", {
59
64
  key: i,
60
65
  ...p
61
- })), /*#__PURE__*/React.createElement("img", { ...metadata,
66
+ })), /*#__PURE__*/React.createElement("img", {
67
+ ...metadata,
62
68
  ...img,
63
69
  style: {
64
70
  display: "block",
@@ -68,7 +74,6 @@ function Cover(props, ref) {
68
74
  }
69
75
  })));
70
76
  }
71
-
72
77
  var Cover$1 = /*#__PURE__*/React.forwardRef(Cover);
73
78
 
74
79
  export { Cover$1 as Cover };
@@ -0,0 +1 @@
1
+
@@ -17,33 +17,38 @@ import * as React from 'react';
17
17
  * @returns the combined, space separated class names that can be applied directly to the class attribute
18
18
  */
19
19
  const cx = function cx() {
20
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
20
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
21
+ .call(arguments).filter(Boolean);
21
22
  const atomicClasses = {};
22
23
  const nonAtomicClasses = [];
23
-
24
- for (const className of presentClassNames) {
24
+ presentClassNames.forEach(arg => {
25
25
  // className could be the output of a previous cx call, so split by ' ' first
26
- const individualClassNames = className.split(' ');
27
-
28
- for (const className of individualClassNames) {
26
+ const individualClassNames = arg ? arg.split(' ') : [];
27
+ individualClassNames.forEach(className => {
29
28
  if (className.startsWith('atm_')) {
30
29
  const [, keyHash] = className.split('_');
31
30
  atomicClasses[keyHash] = className;
32
31
  } else {
33
32
  nonAtomicClasses.push(className);
34
33
  }
34
+ });
35
+ });
36
+ const result = []; // eslint-disable-next-line no-restricted-syntax
37
+
38
+ for (const keyHash in atomicClasses) {
39
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
40
+ result.push(atomicClasses[keyHash]);
35
41
  }
36
42
  }
37
-
38
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
43
+ result.push(...nonAtomicClasses);
44
+ return result.join(' ');
39
45
  };
46
+ var cx$1 = cx;
40
47
 
41
48
  /**
42
49
  * The underlying DOM element which is rendered by this component.
43
50
  */
44
-
45
51
  const Root = "figure";
46
-
47
52
  function Exhibit(props, ref) {
48
53
  const block = useBlock(props);
49
54
  const components = {
@@ -62,8 +67,9 @@ function Exhibit(props, ref) {
62
67
  } = block.props;
63
68
  return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(components.h3, null, title), /*#__PURE__*/React.createElement(Root, {
64
69
  ref: ref,
65
- className: cx(className, classes.root),
66
- style: { ...style,
70
+ className: cx$1(className, classes.root),
71
+ style: {
72
+ ...style,
67
73
  [cssVariables.bleed]: typeof bleed === "number" ? `${bleed}px` : bleed
68
74
  },
69
75
  ...rest
@@ -77,7 +83,6 @@ function Exhibit(props, ref) {
77
83
  className: classes.caption
78
84
  }, caption)));
79
85
  }
80
-
81
86
  var Exhibit$1 = /*#__PURE__*/React.forwardRef(Exhibit);
82
87
  const cssVariables = {
83
88
  bleed: "--timvir-b-Exhibit-bleed",
@@ -1,3 +1,4 @@
1
1
  .r1nql2f9{margin:0 0 1.5rem;--timvir-b-Exhibit-bleed:0px;--timvir-b-Exhibit-borderColor:#EFEFEF;--timvir-b-Exhibit-background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAF0lEQVQI12P4BAI/QICBFCaYBPNJYQIAkUZftTbC4sIAAAAASUVORK5CYII=);}:root[data-timvir-theme="dark"] .r1nql2f9{--timvir-b-Exhibit-borderColor:#101010;--timvir-b-Exhibit-background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAFklEQVQI12NQBQF2EGAghQkmwXxSmADZJQiZ2ZZ46gAAAABJRU5ErkJggg==);}
2
2
  .c4ji594{display:flow-root;background:var(--timvir-b-Exhibit-background);margin:0 calc(-1 * var(--timvir-b-Exhibit-bleed));padding:var(--timvir-b-Exhibit-bleed);}
3
3
  .cf43jjx{font-size:0.75rem;color:var(--timvir-secondary-text-color);margin-top:2px;}
4
+