timvir 0.2.38 → 0.2.42

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 (113) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/blocks/Arbitrary/Arbitrary.d.ts +1 -1
  3. package/blocks/Arbitrary/index.js +232 -78
  4. package/blocks/Arbitrary/samples/basic.d.ts +1 -1
  5. package/blocks/Arbitrary/styles.css +166 -6
  6. package/blocks/Code/Code.d.ts +0 -6
  7. package/blocks/Code/docs/index.mdx +0 -11
  8. package/blocks/Code/index.js +213 -112
  9. package/blocks/Code/samples/basic.d.ts +1 -1
  10. package/blocks/Code/samples/toggle.d.ts +1 -2
  11. package/blocks/Code/styles.css +100 -15
  12. package/blocks/ColorBar/docs/index.mdx +8 -2
  13. package/blocks/ColorBar/index.js +223 -68
  14. package/blocks/ColorBar/samples/basic.d.ts +1 -2
  15. package/blocks/ColorBar/styles.css +103 -4
  16. package/blocks/ColorBook/docs/index.mdx +1 -1
  17. package/blocks/ColorBook/index.js +222 -60
  18. package/blocks/ColorBook/samples/basic.d.ts +1 -2
  19. package/blocks/ColorBook/styles.css +166 -6
  20. package/blocks/Cover/index.js +177 -48
  21. package/blocks/Cover/samples/basic.d.ts +1 -2
  22. package/blocks/Cover/styles.css +18 -0
  23. package/blocks/Exhibit/index.js +205 -50
  24. package/blocks/Exhibit/samples/basic.d.ts +1 -2
  25. package/blocks/Exhibit/samples/bleed.d.ts +1 -1
  26. package/blocks/Exhibit/samples/usage.d.ts +1 -2
  27. package/blocks/Exhibit/styles.css +66 -3
  28. package/blocks/Font/index.js +239 -98
  29. package/blocks/Font/samples/basic.d.ts +1 -1
  30. package/blocks/Font/samples/timvir/body1.d.ts +1 -1
  31. package/blocks/Font/samples/timvir/caption.d.ts +1 -1
  32. package/blocks/Font/samples/timvir/h1.d.ts +1 -1
  33. package/blocks/Font/samples/timvir/h2.d.ts +1 -1
  34. package/blocks/Font/samples/timvir/h3.d.ts +1 -1
  35. package/blocks/Font/samples/timvir/h4.d.ts +1 -1
  36. package/blocks/Font/styles.css +82 -8
  37. package/blocks/Grid/docs/index.mdx +4 -4
  38. package/blocks/Grid/index.js +181 -36
  39. package/blocks/Grid/samples/basic.d.ts +1 -2
  40. package/blocks/Grid/styles.css +20 -1
  41. package/blocks/Icon/docs/index.mdx +13 -13
  42. package/blocks/Icon/index.js +93 -100
  43. package/blocks/Icon/internal/Canvas.d.ts +1 -1
  44. package/blocks/Icon/samples/basic.d.ts +1 -2
  45. package/blocks/Icon/styles.css +117 -5
  46. package/blocks/Icon/types.d.ts +3 -2
  47. package/blocks/Message/docs/index.mdx +5 -8
  48. package/blocks/Message/index.js +238 -55
  49. package/blocks/Message/samples/basic.d.ts +1 -1
  50. package/blocks/Message/styles.css +94 -6
  51. package/blocks/Swatch/docs/index.mdx +16 -16
  52. package/blocks/Swatch/index.js +199 -45
  53. package/blocks/Swatch/samples/basic.d.ts +1 -2
  54. package/blocks/Swatch/styles.css +82 -4
  55. package/blocks/Viewport/index.js +360 -237
  56. package/blocks/Viewport/internal/Caption.d.ts +1 -1
  57. package/blocks/Viewport/internal/Handle.d.ts +1 -1
  58. package/blocks/Viewport/internal/Ruler.d.ts +1 -2
  59. package/blocks/Viewport/samples/basic.d.ts +1 -2
  60. package/blocks/Viewport/styles.css +259 -14
  61. package/blocks/WebLink/index.js +217 -62
  62. package/blocks/WebLink/samples/basic.d.ts +1 -1
  63. package/blocks/WebLink/styles.css +170 -8
  64. package/blocks/styles.css +1460 -97
  65. package/builtins/components.d.ts +2 -2
  66. package/builtins/index.js +306 -239
  67. package/builtins/styles.css +267 -14
  68. package/context/index.d.ts +6 -1
  69. package/core/components/Commands/Commands.d.ts +2 -0
  70. package/core/components/Commands/internal/Action.d.ts +1 -1
  71. package/core/components/Commands/internal/Dialog.d.ts +1 -2
  72. package/core/components/Commands/internal/index.d.ts +0 -1
  73. package/core/components/Footer/samples/basic.d.ts +1 -1
  74. package/core/components/NavigationFooter/NavigationFooter.d.ts +4 -2
  75. package/core/components/NavigationFooter/samples/basic.d.ts +1 -1
  76. package/core/components/Page/Page.d.ts +12 -3
  77. package/core/components/Page/docs/index.mdx +44 -11
  78. package/core/components/Page/internal/Section.d.ts +1 -2
  79. package/core/components/Page/internal/Sidebar.d.ts +1 -1
  80. package/core/components/Page/internal/SidebarItem.d.ts +1 -2
  81. package/core/components/Page/internal/index.d.ts +0 -1
  82. package/core/components/Page/samples/basic.d.ts +1 -2
  83. package/core/components/Page/samples/layout.d.ts +1 -2
  84. package/core/index.d.ts +191 -2
  85. package/core/index.js +674 -449
  86. package/core/layout.d.ts +40 -0
  87. package/core/styles.css +857 -88
  88. package/core/theme/detector.js +1 -1
  89. package/global.css +79 -0
  90. package/internal/cx.d.ts +1 -0
  91. package/knip.config.d.ts +5 -0
  92. package/package.json +1 -2
  93. package/search/Search/samples/basic.d.ts +1 -2
  94. package/search/index.js +2 -208
  95. package/styles.css +2670 -222
  96. package/blocks/Code/theme.d.ts +0 -2
  97. package/bus/styles.css +0 -1
  98. package/context/styles.css +0 -1
  99. package/core/theme/index.d.ts +0 -1
  100. package/hooks/styles.css +0 -1
  101. package/search/Search/internal/Dialog.d.ts +0 -20
  102. package/search/Search/internal/index.d.ts +0 -1
  103. package/search/SearchBoxInput/SearchBoxInput.d.ts +0 -11
  104. package/search/SearchBoxInput/docs/api.mdx +0 -76
  105. package/search/SearchBoxInput/docs/index.mdx +0 -6
  106. package/search/SearchBoxInput/index.d.ts +0 -1
  107. package/search/SearchBoxInput/samples/basic.d.ts +0 -2
  108. package/search/SearchBoxListItem/SearchBoxListItem.d.ts +0 -13
  109. package/search/SearchBoxListItem/docs/api.mdx +0 -76
  110. package/search/SearchBoxListItem/docs/index.mdx +0 -30
  111. package/search/SearchBoxListItem/index.d.ts +0 -1
  112. package/search/SearchBoxListItem/samples/basic.d.ts +0 -2
  113. package/search/styles.css +0 -16
@@ -5,6 +5,6 @@ interface Props {
5
5
  edge: "left" | "right";
6
6
  iframeRef: React.RefObject<null | HTMLIFrameElement>;
7
7
  }
8
- declare function Handle(props: Props): React.JSX.Element;
8
+ declare function Handle(props: Props): import("react/jsx-runtime").JSX.Element;
9
9
  declare const _default: React.MemoExoticComponent<typeof Handle>;
10
10
  export default _default;
@@ -1,7 +1,6 @@
1
- import * as React from "react";
2
1
  interface Props {
3
2
  containerWidth?: number;
4
3
  viewportWidth?: number;
5
4
  }
6
- declare function Ruler(props: Props): React.JSX.Element;
5
+ declare function Ruler(props: Props): import("react/jsx-runtime").JSX.Element;
7
6
  export default Ruler;
@@ -1,2 +1 @@
1
- import * as React from "react";
2
- export default function Sample(): React.JSX.Element;
1
+ export default function Sample(): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,263 @@
1
- .fgdj0yb{font-size:0.8125rem;line-height:1.1875;color:var(--timvir-secondary-text-color);white-space:nowrap;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:space-between;-webkit-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
2
- .d1rc4zjh{cursor:pointer;}.d1rc4zjh:hover{color:var(--c-p-4);opacity:1;}.d1rc4zjh>svg{display:block;}
3
- .d1enfo6{overflow:hidden;-webkit-transition:height 0.2s,opacity 0.2s 0.1s;transition:height 0.2s,opacity 0.2s 0.1s;}
4
- .d1watfn6{margin-top:12px;}
1
+ @layer priority1;
5
2
 
6
- .d1mmz2b6{-ms-grid-row:1;-ms-grid-row-span:3;grid-row:1/span 3;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;opacity:0.5;color:var(--timvir-text-color);border-radius:2px;-webkit-transition:all 0.2s cubic-bezier(0.4, 1, 0.75, 0.9);transition:all 0.2s cubic-bezier(0.4, 1, 0.75, 0.9);}.d1mmz2b6:hover{opacity:1;box-shadow:0 0 0 1px rgba(16, 22, 26, 0.1),0 2px 4px rgba(16, 22, 26, 0.2),0 8px 24px rgba(16, 22, 26, 0.2);}.d1mmz2b6:active{box-shadow:0 0 0 1px rgba(16, 22, 26, 0.1),0 0 0 rgba(16, 22, 26, 0),0 1px 1px rgba(16, 22, 26, 0.2);}
3
+ @layer priority2 {
4
+ .timvir-s-14kudrl {
5
+ margin: 8px 0;
6
+ }
7
+ }
7
8
 
8
- .ssl4j8q{width:100%;display:block;height:16px;margin:8px 0;}
9
+ @layer priority3 {
10
+ .timvir-s-1nj7uno {
11
+ border-radius: 1px;
12
+ }
9
13
 
10
- .r1ouu0bc{contain:layout;margin-bottom:0;}
11
- .d1uj09ka{position:relative;}
12
- .d2uawyc{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);font-variant-numeric:tabular-nums;}
13
- .d8ms9m9{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}
14
- .d17q9rbm{border-radius:3px;display:-ms-grid;display:grid;-ms-grid-columns:56px auto 56px;grid-template-columns:56px auto 56px;-ms-grid-rows:0 auto 0;grid-template-rows:0 auto 0;-ms-grid-column-gap:8px;grid-column-gap:8px;}
15
- .daubpa6{-ms-grid-column:2;-ms-grid-column-span:1;grid-column:2/span 1;-ms-grid-row:2;-ms-grid-row-span:1;grid-row:2/span 1;position:relative;-webkit-flex:1;-ms-flex:1;flex:1;height:100px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAF0lEQVQI12P4BAI/QICBFCaYBPNJYQIAkUZftTbC4sIAAAAASUVORK5CYII=);-webkit-transition:height 0.16s;transition:height 0.16s;overflow:hidden;}
16
- .d1d22s19{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:shimmer-d1d22s19;animation-name:shimmer-d1d22s19;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-background-size:150vw 100px;background-size:150vw 100px;background-image:linear-gradient(to right, #fafafa 0%, #f4f4f4 25%, #fafafa 40%);box-shadow:inset 0 0 0 1px rgba(16, 22, 26, 0.2);border-radius:1px;}@-webkit-keyframes shimmer-d1d22s19{0%{-webkit-background-position:-60vw 0;background-position:-60vw 0;}40%{-webkit-background-position:85vw 0;background-position:85vw 0;}100%{-webkit-background-position:85vw 0;background-position:85vw 0;}}@keyframes shimmer-d1d22s19{0%{-webkit-background-position:-60vw 0;background-position:-60vw 0;}40%{-webkit-background-position:85vw 0;background-position:85vw 0;}100%{-webkit-background-position:85vw 0;background-position:85vw 0;}}
17
- .i11uos8q{display:block;position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transition:opacity 0.2s;transition:opacity 0.2s;}
14
+ .timvir-s-1cum3z5 {
15
+ border-radius: 2px;
16
+ }
18
17
 
18
+ .timvir-s-18zih8k {
19
+ border-radius: 3px;
20
+ }
21
+
22
+ .timvir-s-98rzlu {
23
+ flex: 1;
24
+ }
25
+
26
+ .timvir-s-wonfvy {
27
+ grid-column: 2 / span 1;
28
+ }
29
+
30
+ .timvir-s-diuk5s {
31
+ grid-row: 1 / span 3;
32
+ }
33
+
34
+ .timvir-s-w75i6v {
35
+ grid-row: 2 / span 1;
36
+ }
37
+
38
+ .timvir-s-b3r6kr {
39
+ overflow: hidden;
40
+ }
41
+
42
+ .timvir-s-blhjk6 {
43
+ transition: all .2s cubic-bezier(.4, 1, .75, .9);
44
+ }
45
+
46
+ .timvir-s-10r4kp7 {
47
+ transition: height .16s;
48
+ }
49
+
50
+ .timvir-s-104cjix {
51
+ transition: height .2s, opacity .2s .1s;
52
+ }
53
+
54
+ .timvir-s-1pl5831 {
55
+ transition: opacity .2s;
56
+ }
57
+ }
58
+
59
+ @layer priority4 {
60
+ .timvir-s-6s0dn4 {
61
+ align-items: center;
62
+ }
63
+
64
+ .timvir-s-1qjc9v5 {
65
+ align-items: stretch;
66
+ }
67
+
68
+ .timvir-s-1c74tu6 {
69
+ animation-duration: 2s;
70
+ }
71
+
72
+ .timvir-s-10e4vud {
73
+ animation-fill-mode: forwards;
74
+ }
75
+
76
+ .timvir-s-a4qsjk {
77
+ animation-iteration-count: infinite;
78
+ }
79
+
80
+ .timvir-s-1bx2yh {
81
+ animation-name: timvir-s-iar28k-B;
82
+ }
83
+
84
+ .timvir-s-1esw782 {
85
+ animation-timing-function: linear;
86
+ }
87
+
88
+ .timvir-s-9ncquh {
89
+ background-image: linear-gradient(to right, #fafafa 0%, #f4f4f4 25%, #fafafa 40%);
90
+ }
91
+
92
+ .timvir-s-1h3vnj2 {
93
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAF0lEQVQI12P4BAI/QICBFCaYBPNJYQIAkUZftTbC4sIAAAAASUVORK5CYII=");
94
+ }
95
+
96
+ .timvir-s-dftl3q {
97
+ background-size: 150vw 100px;
98
+ }
99
+
100
+ .timvir-s-1w911z {
101
+ box-shadow: inset 0 0 0 1px #10161a33;
102
+ }
103
+
104
+ .timvir-s-vgvpxu {
105
+ color: var(--timvir-secondary-text-color);
106
+ }
107
+
108
+ .timvir-s-1cdhzux {
109
+ color: var(--timvir-text-color);
110
+ }
111
+
112
+ .timvir-s-1vjgj0v {
113
+ contain: layout;
114
+ }
115
+
116
+ .timvir-s-1ypdohk {
117
+ cursor: pointer;
118
+ }
119
+
120
+ .timvir-s-1lliihq {
121
+ display: block;
122
+ }
123
+
124
+ .timvir-s-78zum5 {
125
+ display: flex;
126
+ }
127
+
128
+ .timvir-s-rvj5dj {
129
+ display: grid;
130
+ }
131
+
132
+ .timvir-s-1dcheo9 {
133
+ font-size: .8125rem;
134
+ }
135
+
136
+ .timvir-s-ss6m8b {
137
+ font-variant-numeric: tabular-nums;
138
+ }
139
+
140
+ .timvir-s-jv0b96 {
141
+ grid-column-gap: 8px;
142
+ }
143
+
144
+ .timvir-s-7tmw4v {
145
+ grid-template-columns: 56px auto 56px;
146
+ }
147
+
148
+ .timvir-s-yy29n5 {
149
+ grid-template-rows: 0 auto 0;
150
+ }
151
+
152
+ .timvir-s-l56j7k {
153
+ justify-content: center;
154
+ }
155
+
156
+ .timvir-s-1qughib {
157
+ justify-content: space-between;
158
+ }
159
+
160
+ .timvir-s-jkpybl {
161
+ line-height: 1.1875;
162
+ }
163
+
164
+ .timvir-s-byyjgo {
165
+ opacity: .5;
166
+ }
167
+
168
+ .timvir-s-g01cxk {
169
+ opacity: 0;
170
+ }
171
+
172
+ .timvir-s-10l6tqk {
173
+ position: absolute;
174
+ }
175
+
176
+ .timvir-s-1n2onr6 {
177
+ position: relative;
178
+ }
179
+
180
+ .timvir-s-11lhmoz {
181
+ transform: translate(-50%, -50%);
182
+ }
183
+
184
+ .timvir-s-uxw1ft {
185
+ white-space: nowrap;
186
+ }
187
+
188
+ .timvir-s-10xrfx7:hover {
189
+ box-shadow: 0 0 0 1px #10161a1a, 0 2px 4px #10161a33, 0 8px 24px #10161a33;
190
+ }
191
+
192
+ .timvir-s-gmrl4:hover {
193
+ color: var(--c-p-4);
194
+ }
195
+
196
+ .timvir-s-1o7uuvo:hover {
197
+ opacity: 1;
198
+ }
199
+
200
+ .timvir-s-1kpm4h4:active {
201
+ box-shadow: 0 0 0 1px #10161a1a, 0 0 #10161a00, 0 1px 1px #10161a33;
202
+ }
203
+ }
204
+
205
+ @layer priority5 {
206
+ .timvir-s-qtp20y {
207
+ height: 0;
208
+ }
209
+
210
+ .timvir-s-5yr21d {
211
+ height: 100%;
212
+ }
213
+
214
+ .timvir-s-pyat2d {
215
+ height: 100px;
216
+ }
217
+
218
+ .timvir-s-lup9mm {
219
+ height: 16px;
220
+ }
221
+
222
+ .timvir-s-u96u03 {
223
+ left: 0;
224
+ }
225
+
226
+ .timvir-s-1nrll8i {
227
+ left: 50%;
228
+ }
229
+
230
+ .timvir-s-at24cr {
231
+ margin-bottom: 0;
232
+ }
233
+
234
+ .timvir-s-14vqqas {
235
+ margin-top: 12px;
236
+ }
237
+
238
+ .timvir-s-13vifvy {
239
+ top: 0;
240
+ }
241
+
242
+ .timvir-s-wa60dl {
243
+ top: 50%;
244
+ }
245
+
246
+ .timvir-s-h8yej3 {
247
+ width: 100%;
248
+ }
249
+ }
250
+
251
+ @keyframes timvir-s-iar28k-B {
252
+ 0% {
253
+ background-position: -60vw 0;
254
+ }
255
+
256
+ 40% {
257
+ background-position: 85vw 0;
258
+ }
259
+
260
+ 100% {
261
+ background-position: 85vw 0;
262
+ }
263
+ }
@@ -1,46 +1,177 @@
1
1
  'use client';
2
2
  import * as React from 'react';
3
- import { useContext } from 'timvir/core';
3
+ import { useContext, layoutStyles } from 'timvir/core';
4
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
5
 
5
- // src/css.ts
6
+ function cx(...args) {
7
+ let str = "";
8
+ for (let i = 0; i < args.length; i++) {
9
+ const arg = args[i];
10
+ if (typeof arg === "string") {
11
+ str += (str && " ") + arg;
12
+ }
13
+ }
14
+ return str;
15
+ }
6
16
 
7
- // src/cx.ts
8
- var cx = function cx2() {
9
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
10
- const atomicClasses = {};
11
- const nonAtomicClasses = [];
12
- presentClassNames.forEach((arg) => {
13
- const individualClassNames = arg ? arg.split(" ") : [];
14
- individualClassNames.forEach((className) => {
15
- if (className.startsWith("atm_")) {
16
- const [, keyHash] = className.split("_");
17
- atomicClasses[keyHash] = className;
18
- } else {
19
- nonAtomicClasses.push(className);
20
- }
17
+ var styleq = {};
18
+ var hasRequiredStyleq;
19
+ function requireStyleq() {
20
+ if (hasRequiredStyleq) return styleq;
21
+ hasRequiredStyleq = 1;
22
+ Object.defineProperty(styleq, "__esModule", {
23
+ value: true
21
24
  });
22
- });
23
- const result = [];
24
- for (const keyHash in atomicClasses) {
25
- if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
26
- result.push(atomicClasses[keyHash]);
25
+ styleq.styleq = void 0;
26
+ var cache = new WeakMap();
27
+ var compiledKey = '$$css';
28
+ function createStyleq(options) {
29
+ var disableCache;
30
+ var disableMix;
31
+ var transform;
32
+ if (options != null) {
33
+ disableCache = options.disableCache === true;
34
+ disableMix = options.disableMix === true;
35
+ transform = options.transform;
36
+ }
37
+ return function styleq() {
38
+ var definedProperties = [];
39
+ var className = '';
40
+ var inlineStyle = null;
41
+ var debugString = '';
42
+ var nextCache = disableCache ? null : cache;
43
+ var styles = new Array(arguments.length);
44
+ for(var i = 0; i < arguments.length; i++){
45
+ styles[i] = arguments[i];
46
+ }
47
+ while(styles.length > 0){
48
+ var possibleStyle = styles.pop();
49
+ if (possibleStyle == null || possibleStyle === false) {
50
+ continue;
51
+ }
52
+ if (Array.isArray(possibleStyle)) {
53
+ for(var _i = 0; _i < possibleStyle.length; _i++){
54
+ styles.push(possibleStyle[_i]);
55
+ }
56
+ continue;
57
+ }
58
+ var style = transform != null ? transform(possibleStyle) : possibleStyle;
59
+ if (style.$$css != null) {
60
+ var classNameChunk = '';
61
+ if (nextCache != null && nextCache.has(style)) {
62
+ var cacheEntry = nextCache.get(style);
63
+ if (cacheEntry != null) {
64
+ classNameChunk = cacheEntry[0];
65
+ debugString = cacheEntry[2];
66
+ definedProperties.push.apply(definedProperties, cacheEntry[1]);
67
+ nextCache = cacheEntry[3];
68
+ }
69
+ } else {
70
+ var definedPropertiesChunk = [];
71
+ for(var prop in style){
72
+ var value = style[prop];
73
+ if (prop === compiledKey) {
74
+ var compiledKeyValue = style[prop];
75
+ if (compiledKeyValue !== true) {
76
+ debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;
77
+ }
78
+ continue;
79
+ }
80
+ if (typeof value === 'string' || value === null) {
81
+ if (!definedProperties.includes(prop)) {
82
+ definedProperties.push(prop);
83
+ if (nextCache != null) {
84
+ definedPropertiesChunk.push(prop);
85
+ }
86
+ if (typeof value === 'string') {
87
+ classNameChunk += classNameChunk ? ' ' + value : value;
88
+ }
89
+ }
90
+ } else {
91
+ console.error("styleq: ".concat(prop, " typeof ").concat(String(value), " is not \"string\" or \"null\"."));
92
+ }
93
+ }
94
+ if (nextCache != null) {
95
+ var weakMap = new WeakMap();
96
+ nextCache.set(style, [
97
+ classNameChunk,
98
+ definedPropertiesChunk,
99
+ debugString,
100
+ weakMap
101
+ ]);
102
+ nextCache = weakMap;
103
+ }
104
+ }
105
+ if (classNameChunk) {
106
+ className = className ? classNameChunk + ' ' + className : classNameChunk;
107
+ }
108
+ } else {
109
+ if (disableMix) {
110
+ if (inlineStyle == null) {
111
+ inlineStyle = {};
112
+ }
113
+ inlineStyle = Object.assign({}, style, inlineStyle);
114
+ } else {
115
+ var subStyle = null;
116
+ for(var _prop in style){
117
+ var _value = style[_prop];
118
+ if (_value !== undefined) {
119
+ if (!definedProperties.includes(_prop)) {
120
+ if (_value != null) {
121
+ if (inlineStyle == null) {
122
+ inlineStyle = {};
123
+ }
124
+ if (subStyle == null) {
125
+ subStyle = {};
126
+ }
127
+ subStyle[_prop] = _value;
128
+ }
129
+ definedProperties.push(_prop);
130
+ nextCache = null;
131
+ }
132
+ }
133
+ }
134
+ if (subStyle != null) {
135
+ inlineStyle = Object.assign(subStyle, inlineStyle);
136
+ }
137
+ }
138
+ }
139
+ }
140
+ var styleProps = [
141
+ className,
142
+ inlineStyle,
143
+ debugString
144
+ ];
145
+ return styleProps;
146
+ };
27
147
  }
28
- }
29
- result.push(...nonAtomicClasses);
30
- return result.join(" ");
31
- };
32
- var cx_default = cx;
148
+ var styleq$1 = styleq.styleq = createStyleq();
149
+ styleq$1.factory = createStyleq;
150
+ return styleq;
151
+ }
152
+ var styleqExports = requireStyleq();
153
+ function props(...styles) {
154
+ const [className, style, dataStyleSrc] = styleqExports.styleq(styles);
155
+ const result = {};
156
+ if (className != null && className !== '') {
157
+ result.className = className;
158
+ }
159
+ if (style != null && Object.keys(style).length > 0) {
160
+ result.style = style;
161
+ }
162
+ if (dataStyleSrc != null && dataStyleSrc !== '') {
163
+ result['data-style-src'] = dataStyleSrc;
164
+ }
165
+ return result;
166
+ }
33
167
 
34
- /**
35
- * The underlying DOM element which is rendered by this component.
36
- */
37
168
  const Root = "a";
38
- function WebLink(props, ref) {
169
+ function WebLink(props$1, ref) {
39
170
  const {
40
171
  url,
41
172
  className,
42
173
  ...rest
43
- } = props;
174
+ } = props$1;
44
175
  const [state, setState] = React.useState({
45
176
  settled: false,
46
177
  metadata: undefined
@@ -55,47 +186,71 @@ function WebLink(props, ref) {
55
186
  metadata: metadata
56
187
  });
57
188
  });
58
- }, [url]);
189
+ }, [unfurl, url]);
59
190
  const metadata = state.metadata;
60
191
  const image = metadata?.open_graph?.images?.[0]?.url;
61
- return /*#__PURE__*/React.createElement(Root, {
192
+ const rootStyleProps = props(layoutStyles.block, styles.root);
193
+ return /*#__PURE__*/jsxs(Root, {
62
194
  ref: ref,
63
195
  href: url,
64
196
  target: "_blank",
65
197
  rel: "noopener noreferrer",
66
- className: cx_default("timvir-b-WebLink", !state.settled && "timvir-unsettled", className, classes.root),
67
- ...rest
68
- }, /*#__PURE__*/React.createElement("div", {
69
- className: classes.text
70
- }, /*#__PURE__*/React.createElement("div", {
71
- className: classes.title
72
- }, metadata?.open_graph?.title ?? metadata?.title ?? /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0")), /*#__PURE__*/React.createElement("div", {
73
- className: classes.description
74
- }, metadata?.open_graph?.description ?? metadata?.description), /*#__PURE__*/React.createElement("div", {
75
- className: classes.url
76
- }, /*#__PURE__*/React.createElement("img", {
198
+ ...rest,
199
+ ...rootStyleProps,
200
+ className: cx("timvir-b-WebLink", !state.settled && "timvir-unsettled", className, rootStyleProps.className),
77
201
  style: {
78
- opacity: metadata?.favicon ? 1 : 0
202
+ ...rootStyleProps.style,
203
+ ...rest.style
79
204
  },
80
- className: classes.favicon,
81
- src: metadata?.favicon
82
- }), /*#__PURE__*/React.createElement("div", null, metadata ? url : null))), image && /*#__PURE__*/React.createElement("div", {
83
- className: classes.imageContainer
84
- }, /*#__PURE__*/React.createElement("img", {
85
- className: classes.image,
86
- src: image
87
- })));
205
+ children: [/*#__PURE__*/jsxs("div", {
206
+ className: "timvir-s-1fvrxw4 timvir-s-hkrif2 timvir-s-euugli",
207
+ children: [/*#__PURE__*/jsx("div", {
208
+ className: "timvir-s-1cdhzux timvir-s-uxw1ft timvir-s-b3r6kr timvir-s-lyipyv timvir-s-jwf9q1 timvir-s-zueoph",
209
+ children: metadata?.open_graph?.title ?? metadata?.title ?? /*#__PURE__*/jsx(Fragment, {
210
+ children: "\xA0"
211
+ })
212
+ }), /*#__PURE__*/jsx("div", {
213
+ className: "timvir-s-boafo0 timvir-s-1vbrtjm timvir-s-vgvpxu timvir-s-1ehw58o timvir-s-b3r6kr",
214
+ children: metadata?.open_graph?.description ?? metadata?.description
215
+ }), /*#__PURE__*/jsxs("div", {
216
+ className: "timvir-s-14vqqas timvir-s-78zum5 timvir-s-boafo0 timvir-s-l2ypbo timvir-s-1cdhzux timvir-s-uxw1ft timvir-s-b3r6kr timvir-s-lyipyv",
217
+ children: [/*#__PURE__*/jsx("img", {
218
+ className: "timvir-s-cdlrvm timvir-s-1l36t39 timvir-s-gomdpo timvir-s-15ku74s",
219
+ style: {
220
+ opacity: metadata?.favicon ? 1 : 0
221
+ },
222
+ src: metadata?.favicon
223
+ }), /*#__PURE__*/jsx("div", {
224
+ children: metadata ? url : null
225
+ })]
226
+ })]
227
+ }), image && /*#__PURE__*/jsx("div", {
228
+ className: "timvir-s-15lv9n0 timvir-s-1n2onr6 timvir-s-fb3i0g",
229
+ children: /*#__PURE__*/jsx("img", {
230
+ className: "timvir-s-1lliihq timvir-s-l1xv1r timvir-s-1p4ba9y timvir-s-h8yej3 timvir-s-5yr21d timvir-s-10l6tqk timvir-s-13vifvy timvir-s-u96u03",
231
+ src: image
232
+ })
233
+ })]
234
+ });
88
235
  }
89
236
  var WebLink$1 = /*#__PURE__*/React.forwardRef(WebLink);
90
- const classes = {
91
- root: "r1szx90n",
92
- text: "tywhumj",
93
- title: "t1sni99u",
94
- description: "d7eo497",
95
- url: "u1rlrpoc",
96
- favicon: "f1cqi3na",
97
- imageContainer: "igksd61",
98
- image: "i1gibb8w"
237
+ const styles = {
238
+ root: {
239
+ kmkexE: "timvir-s-zhuw26",
240
+ kMzoRj: "timvir-s-mkeg23",
241
+ ksu8eU: "timvir-s-1y0btm7",
242
+ kVAM5u: "timvir-s-j7gikm",
243
+ kWkggS: "timvir-s-1d0dlzq",
244
+ kaIpWk: "timvir-s-18zih8k",
245
+ k1xSpc: "timvir-s-78zum5",
246
+ kkrTdU: "timvir-s-1ypdohk",
247
+ kybGjl: "timvir-s-1hl2dhg",
248
+ kaVNsj: "timvir-s-49kzi4",
249
+ kGzVvX: "timvir-s-1dc5b4e",
250
+ kSVDLA: "timvir-s-13m658e",
251
+ kSReZ0: "timvir-s-1bx2y69",
252
+ $$css: true
253
+ }
99
254
  };
100
255
  async function defaultUnfurl(url) {
101
256
  return fetch(`https://timvir.vercel.app/api/unfurl?url=${encodeURIComponent(url)}`).then(res => res.json());
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { WebLink } from "..";
3
3
  type Props = Partial<React.ComponentPropsWithoutRef<typeof WebLink>>;
4
- export default function Sample(props: Props): React.JSX.Element;
4
+ export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
5
5
  export {};