timvir 0.2.38 → 0.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/blocks/Arbitrary/index.js +46 -37
- package/blocks/Arbitrary/samples/basic.d.ts +1 -1
- package/blocks/Code/index.js +56 -48
- package/blocks/Code/samples/basic.d.ts +1 -1
- package/blocks/Code/samples/toggle.d.ts +1 -2
- package/blocks/Code/styles.css +3 -3
- package/blocks/ColorBar/index.js +33 -29
- package/blocks/ColorBar/samples/basic.d.ts +1 -2
- package/blocks/ColorBook/index.js +29 -26
- package/blocks/ColorBook/samples/basic.d.ts +1 -2
- package/blocks/Cover/index.js +18 -18
- package/blocks/Cover/samples/basic.d.ts +1 -2
- package/blocks/Exhibit/index.js +16 -12
- package/blocks/Exhibit/samples/basic.d.ts +1 -2
- package/blocks/Exhibit/samples/bleed.d.ts +1 -1
- package/blocks/Exhibit/samples/usage.d.ts +1 -2
- package/blocks/Exhibit/styles.css +1 -1
- package/blocks/Font/index.js +67 -56
- package/blocks/Font/samples/basic.d.ts +1 -1
- package/blocks/Font/samples/timvir/body1.d.ts +1 -1
- package/blocks/Font/samples/timvir/caption.d.ts +1 -1
- package/blocks/Font/samples/timvir/h1.d.ts +1 -1
- package/blocks/Font/samples/timvir/h2.d.ts +1 -1
- package/blocks/Font/samples/timvir/h3.d.ts +1 -1
- package/blocks/Font/samples/timvir/h4.d.ts +1 -1
- package/blocks/Grid/index.js +5 -3
- package/blocks/Grid/samples/basic.d.ts +1 -2
- package/blocks/Icon/index.js +72 -61
- package/blocks/Icon/internal/Canvas.d.ts +1 -1
- package/blocks/Icon/samples/basic.d.ts +1 -2
- package/blocks/Icon/types.d.ts +3 -2
- package/blocks/Message/index.js +21 -17
- package/blocks/Message/samples/basic.d.ts +1 -1
- package/blocks/Swatch/index.js +22 -13
- package/blocks/Swatch/samples/basic.d.ts +1 -2
- package/blocks/Viewport/index.js +206 -190
- package/blocks/Viewport/internal/Caption.d.ts +1 -1
- package/blocks/Viewport/internal/Handle.d.ts +1 -1
- package/blocks/Viewport/internal/Ruler.d.ts +1 -2
- package/blocks/Viewport/samples/basic.d.ts +1 -2
- package/blocks/WebLink/index.js +34 -23
- package/blocks/WebLink/samples/basic.d.ts +1 -1
- package/blocks/WebLink/styles.css +1 -1
- package/blocks/styles.css +5 -5
- package/builtins/index.d.ts +1 -0
- package/builtins/index.js +37 -27
- package/builtins/styles.css +13 -0
- package/core/components/Commands/Commands.d.ts +1 -3
- package/core/components/Commands/internal/Action.d.ts +1 -1
- package/core/components/Commands/internal/Dialog.d.ts +1 -2
- package/core/components/Commands/internal/index.d.ts +0 -1
- package/core/components/Footer/samples/basic.d.ts +1 -1
- package/core/components/NavigationFooter/samples/basic.d.ts +1 -1
- package/core/components/Page/internal/Section.d.ts +1 -2
- package/core/components/Page/internal/Sidebar.d.ts +1 -1
- package/core/components/Page/internal/SidebarItem.d.ts +1 -2
- package/core/components/Page/internal/index.d.ts +0 -1
- package/core/components/Page/samples/basic.d.ts +1 -2
- package/core/components/Page/samples/layout.d.ts +1 -2
- package/core/index.js +363 -297
- package/core/layout.d.ts +0 -1
- package/core/theme/detector.js +1 -1
- package/knip.config.d.ts +5 -0
- package/package.json +1 -1
- package/search/Search/samples/basic.d.ts +1 -2
- package/search/SearchBoxInput/samples/basic.d.ts +1 -2
- package/search/SearchBoxListItem/samples/basic.d.ts +1 -2
- package/search/index.js +96 -81
- package/search/styles.css +3 -3
- package/styles.css +21 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# timvir
|
|
2
2
|
|
|
3
|
+
## 0.2.39
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **Use the New JSX Transform** ([#3323](https://github.com/timvir/timvir/pull/3323)) - The New JSX Transform was released as part of React 17. This transform reduces bundle sizes and improves performance. For more details, see the announcement on the React blog: [Introducing the New JSX Transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html). As Timvir already requires React 17 or later, this should not have any impact to users.
|
|
8
|
+
- **Fix dark mode styles** ([#3197](https://github.com/timvir/timvir/pull/3197)) - During the recent Linaria v5 -> v6 (and corresponding stylis v3 -> v4) upgrade, the dark mode styles were slightly broken. This patch restores the dark mode styles.
|
|
9
|
+
|
|
10
|
+
## 0.2.38
|
|
11
|
+
|
|
3
12
|
## 0.2.37
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Exhibit } from 'timvir/blocks';
|
|
3
3
|
import { useBlock } from 'timvir/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
7
|
// src/css.ts
|
|
7
8
|
|
|
@@ -123,43 +124,51 @@ function Arbitrary(props, ref) {
|
|
|
123
124
|
body: value.seed
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
|
-
}, [block.bus, value.seed]);
|
|
127
|
-
return /*#__PURE__*/
|
|
128
|
-
value: value
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
127
|
+
}, [props.id, block.bus, value.seed]);
|
|
128
|
+
return /*#__PURE__*/jsx(Context.Provider, {
|
|
129
|
+
value: value,
|
|
130
|
+
children: /*#__PURE__*/jsxs(Root, {
|
|
131
|
+
ref: ref,
|
|
132
|
+
className: cx_default("timvir-b-Arbitrary", classes.root, className),
|
|
133
|
+
...rest,
|
|
134
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
135
|
+
className: classes.controls,
|
|
136
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
137
|
+
className: classes.textField,
|
|
138
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
139
|
+
className: classes.startAdornment,
|
|
140
|
+
children: "Seed:"
|
|
141
|
+
}), /*#__PURE__*/jsx("input", {
|
|
142
|
+
className: cx_default("timvir-b-Arbitrary-seed", classes.input),
|
|
143
|
+
placeholder: "Seed",
|
|
144
|
+
value: encode(new TextEncoder().encode(`${value.seed}`)),
|
|
145
|
+
readOnly: true,
|
|
146
|
+
onPaste: ev => {
|
|
147
|
+
const v = ev.clipboardData.getData("text/plain");
|
|
148
|
+
setValue({
|
|
149
|
+
seed: +new TextDecoder().decode(decode(v))
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
onFocus: ev => {
|
|
153
|
+
ev.currentTarget.select();
|
|
154
|
+
}
|
|
155
|
+
})]
|
|
156
|
+
}), /*#__PURE__*/jsx("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
className: classes.button,
|
|
159
|
+
onClick: () => {
|
|
160
|
+
setValue({
|
|
161
|
+
seed: crypto.getRandomValues(new Uint32Array(1))[0]
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
children: "Refresh"
|
|
165
|
+
})]
|
|
166
|
+
}), /*#__PURE__*/jsx(Exhibit, {
|
|
167
|
+
...ExhibitProps,
|
|
168
|
+
children: children
|
|
169
|
+
})]
|
|
170
|
+
})
|
|
171
|
+
});
|
|
163
172
|
}
|
|
164
173
|
var Arbitrary$1 = /*#__PURE__*/React.forwardRef(Arbitrary);
|
|
165
174
|
const classes = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Arbitrary } from "..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Arbitrary>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
package/blocks/Code/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { useBlock } from 'timvir/core';
|
|
|
4
4
|
import { codeToHtml } from 'shiki';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import * as Icons from 'react-feather';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
9
|
// src/css.ts
|
|
9
10
|
|
|
@@ -90,56 +91,63 @@ function Code(props, ref) {
|
|
|
90
91
|
html
|
|
91
92
|
}));
|
|
92
93
|
})();
|
|
93
|
-
}, [children, language]);
|
|
94
|
-
return /*#__PURE__*/
|
|
94
|
+
}, [children, language, highlightedLines]);
|
|
95
|
+
return /*#__PURE__*/jsxs(Root, {
|
|
95
96
|
ref: ref,
|
|
96
97
|
className: cx_default("timvir-b-Code", !state.settled && "timvir-unsettled", classes.root, fullWidth && Page.fullWidth),
|
|
97
|
-
...rest
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
98
|
+
...rest,
|
|
99
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
100
|
+
className: cx_default("timvir-b-Code-container", className, theme, classes.code, fullWidth && classes.fullWidth),
|
|
101
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
102
|
+
className: "d1513p2s",
|
|
103
|
+
onMouseEnter: () => {
|
|
104
|
+
setState(state => ({
|
|
105
|
+
...state,
|
|
106
|
+
mouseOver: true
|
|
107
|
+
}));
|
|
108
|
+
},
|
|
109
|
+
onMouseLeave: () => {
|
|
110
|
+
setState(state => ({
|
|
111
|
+
...state,
|
|
112
|
+
mouseOver: false,
|
|
113
|
+
copiedToClipboard: false
|
|
114
|
+
}));
|
|
115
|
+
},
|
|
116
|
+
children: [/*#__PURE__*/jsxs("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: () => {
|
|
119
|
+
navigator.clipboard.writeText(children);
|
|
120
|
+
setState(state => ({
|
|
121
|
+
...state,
|
|
122
|
+
copiedToClipboard: true
|
|
123
|
+
}));
|
|
124
|
+
},
|
|
125
|
+
className: cx_default("b157mkz", state.mouseOver && "b10oxtfo"),
|
|
126
|
+
children: [/*#__PURE__*/jsx("svg", {
|
|
127
|
+
width: 48,
|
|
128
|
+
height: 48,
|
|
129
|
+
viewBox: "0 0 48 48",
|
|
130
|
+
className: "s1hdfi6o",
|
|
131
|
+
children: /*#__PURE__*/jsx("path", {
|
|
132
|
+
d: "M0 0 H48 V48 Z"
|
|
133
|
+
})
|
|
134
|
+
}), state.copiedToClipboard ? /*#__PURE__*/jsx(Icons.Clipboard, {
|
|
135
|
+
size: "16px"
|
|
136
|
+
}) : /*#__PURE__*/jsx(Icons.Copy, {
|
|
137
|
+
size: "16px"
|
|
138
|
+
})]
|
|
139
|
+
}), /*#__PURE__*/jsx("div", {
|
|
140
|
+
className: cx_default(fullWidth ? "d17pltln" : "d793q8f"),
|
|
141
|
+
dangerouslySetInnerHTML: {
|
|
142
|
+
__html: state.html
|
|
143
|
+
}
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
146
|
+
}), caption && /*#__PURE__*/jsx("div", {
|
|
147
|
+
className: cx_default("timvir-b-Code-caption", classes.caption),
|
|
148
|
+
children: caption
|
|
149
|
+
})]
|
|
150
|
+
});
|
|
143
151
|
}
|
|
144
152
|
var Code$1 = /*#__PURE__*/React.forwardRef(Code);
|
|
145
153
|
const classes = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Code } from "..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Code>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample({ language, children }: any): React.JSX.Element;
|
|
1
|
+
export default function Sample({ language, children }: any): import("react/jsx-runtime").JSX.Element;
|
package/blocks/Code/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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"] {color:#adbac7;background-color
|
|
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:var(--timvir-secondary-background-color);}: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
2
|
|
|
3
3
|
.d1513p2s{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;}
|
|
4
4
|
.b157mkz{--size:48px;z-index:1;position:absolute;top:0;right:0;overflow:hidden;width:var(--size);height:var(--size);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;outline:none;border:none;padding:6px;background:transparent;-webkit-transition:all 0.2s;transition:all 0.2s;cursor:pointer;pointer-events:none;opacity:0;}.b157mkz:hover{color:white;}.b157mkz:hover svg:first-child{-webkit-transform:translate(0, 0);-moz-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0);}.b157mkz:active svg:first-child{-webkit-transform:translate(2px, -2px);-moz-transform:translate(2px, -2px);-ms-transform:translate(2px, -2px);transform:translate(2px, -2px);}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
.s1hdfi6o{position:absolute;z-index:-1;top:0;right:0;-webkit-transition:all 0.2s;transition:all 0.2s;-webkit-transform:translate(48px, -48px);-moz-transform:translate(48px, -48px);-ms-transform:translate(48px, -48px);transform:translate(48px, -48px);}.s1hdfi6o path{fill:var(--c-p-4);}
|
|
7
7
|
.d17pltln{padding:16px 24px 16px 0;}
|
|
8
8
|
|
|
9
|
-
:root[data-timvir-theme="dark"] ,:root[data-timvir-theme="dark"] {color:var(--shiki-dark)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;text-decoration:var(--shiki-dark-text-decoration)!important;}
|
|
9
|
+
:root[data-timvir-theme="dark"] .r9v2r0l .shiki,:root[data-timvir-theme="dark"] .r9v2r0l .shiki span{color:var(--shiki-dark)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;text-decoration:var(--shiki-dark-text-decoration)!important;}
|
|
10
10
|
.cs7tint{overflow-x:auto;contain:content;font-size:0.8em;border-radius:5px;--timvir-b-Code-bleed:calc(var(--timvir-margin, 0px) * 0.6666);--timvir-b-Code-inlinePadding:max(var(--timvir-b-Code-bleed), 8px);padding:0;margin:0 calc(-1 * var(--timvir-b-Code-bleed));border:1px solid var(--timvir-border-color);}.cs7tint pre{margin:0;padding:16px 0;background-color:var(--timvir-secondary-background-color)!important;}.cs7tint pre code{display:block;}.cs7tint pre code .line{display:inline-block;position:relative;width:100%;}.cs7tint pre .line{padding-inline:var(--timvir-b-Code-inlinePadding);}
|
|
11
11
|
.fjvaz2s{display:-ms-grid;display:grid;border-radius:0;box-shadow:none;margin-inline:0;-ms-grid-auto-rows:min-content;grid-auto-rows:min-content;-ms-grid-columns:[le] 0 [lc] 1fr [rc] 0 [re];grid-template-columns:[le] 0 [lc] 1fr [rc] 0 [re];-ms-grid-column-gap:16px;grid-column-gap:16px;}.fjvaz2s:hover{box-shadow:none;}@media (min-width: 60rem){.fjvaz2s{-ms-grid-columns:[le] 1fr [lc] minmax(0, 48rem) [rc] 1fr [re];grid-template-columns:[le] 1fr [lc] minmax(0, 48rem) [rc] 1fr [re];-ms-grid-column-gap:24px;grid-column-gap:24px;}}.fjvaz2s>*{grid-column:lc/re;}
|
|
12
12
|
.lchll0h{padding-inline:var(--timvir-b-Code-inlinePadding);}
|
|
13
|
-
.h1xcko1i{background-color:#ffe10044;}:root[data-timvir-theme="dark"] {background-color:rgba(174, 124, 20, 0.15);}
|
|
13
|
+
.h1xcko1i{background-color:#ffe10044;}:root[data-timvir-theme="dark"] .h1xcko1i{background-color:rgba(174, 124, 20, 0.15);}
|
|
14
14
|
.ll2b9hx{display:inline-block;width:var(--timvir-b-Code-bleed);color:var(--timvir-secondary-text-color);text-align:right;padding-inline:4px;}
|
|
15
15
|
.c5vr6r2{font-size:0.8125rem;line-height:1.1875;color:var(--timvir-secondary-text-color);margin-top:0.3em;}
|
|
16
16
|
|
package/blocks/ColorBar/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Swatch } from 'timvir/blocks';
|
|
3
3
|
import { useBlock } from 'timvir/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
7
|
// src/css.ts
|
|
7
8
|
|
|
@@ -44,37 +45,40 @@ function ColorBar(props, ref) {
|
|
|
44
45
|
...rest
|
|
45
46
|
} = block.props;
|
|
46
47
|
const [selected, setSelected] = React.useState(undefined);
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/jsxs(Root, {
|
|
48
49
|
ref: ref,
|
|
49
50
|
className: cx_default(className, classes.root, selected && tweaks.selected),
|
|
50
|
-
...rest
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
51
|
+
...rest,
|
|
52
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
53
|
+
className: classes.bar,
|
|
54
|
+
style: {
|
|
55
|
+
opacity: selected ? 0 : 1
|
|
56
|
+
},
|
|
57
|
+
children: values.map((value, i) => /*#__PURE__*/jsx("div", {
|
|
58
|
+
className: classes.value,
|
|
59
|
+
children: /*#__PURE__*/jsx("div", {
|
|
60
|
+
style: {
|
|
61
|
+
background: typeof value === "string" ? value : value.value
|
|
62
|
+
},
|
|
63
|
+
onClick: () => {
|
|
64
|
+
setSelected(value);
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}, i))
|
|
68
|
+
}), /*#__PURE__*/jsx("div", {
|
|
69
|
+
className: classes.overlay,
|
|
70
|
+
children: /*#__PURE__*/jsx(Swatch, {
|
|
71
|
+
...(typeof selected === "string" ? {
|
|
72
|
+
value: selected
|
|
73
|
+
} : {
|
|
74
|
+
value: selected?.value ?? ""
|
|
75
|
+
}),
|
|
76
|
+
onMouseLeave: () => {
|
|
77
|
+
setSelected(undefined);
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
78
82
|
}
|
|
79
83
|
var ColorBar$1 = /*#__PURE__*/React.forwardRef(ColorBar);
|
|
80
84
|
const tweaks = {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
// src/css.ts
|
|
4
5
|
|
|
@@ -41,34 +42,36 @@ function ColorBook(props, ref) {
|
|
|
41
42
|
className,
|
|
42
43
|
...rest
|
|
43
44
|
} = props;
|
|
44
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/jsx(Root, {
|
|
45
46
|
ref: ref,
|
|
46
47
|
...rest,
|
|
47
|
-
className: cx_default(className, "rmv2wrl")
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
48
|
+
className: cx_default(className, "rmv2wrl"),
|
|
49
|
+
children: chapters.map(({
|
|
50
|
+
name,
|
|
51
|
+
values
|
|
52
|
+
}, i) => /*#__PURE__*/jsxs("div", {
|
|
53
|
+
style: {
|
|
54
|
+
gridColumn: i + 1
|
|
55
|
+
},
|
|
56
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
57
|
+
className: cx_default(chapter, i === selectedChapter && activeChapter),
|
|
58
|
+
onClick: () => {
|
|
59
|
+
if (onSelectChapter) {
|
|
60
|
+
onSelectChapter(i);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
children: values.map(value => /*#__PURE__*/jsx("div", {
|
|
64
|
+
style: {
|
|
65
|
+
background: value
|
|
66
|
+
},
|
|
67
|
+
className: "d1l94wnr"
|
|
68
|
+
}, value))
|
|
69
|
+
}), name && /*#__PURE__*/jsx("div", {
|
|
70
|
+
className: cx_default("d1uopbb", i === selectedChapter && "d1vwzhoa"),
|
|
71
|
+
children: name
|
|
72
|
+
})]
|
|
73
|
+
}, i))
|
|
74
|
+
});
|
|
72
75
|
}
|
|
73
76
|
var ColorBook$1 = /*#__PURE__*/React.forwardRef(ColorBook);
|
|
74
77
|
const chapter = "c1xqhu04";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
package/blocks/Cover/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { fullWidth } from 'timvir/core';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
4
|
|
|
4
5
|
// src/css.ts
|
|
5
6
|
|
|
@@ -30,9 +31,6 @@ var cx = function cx2() {
|
|
|
30
31
|
};
|
|
31
32
|
var cx_default = cx;
|
|
32
33
|
|
|
33
|
-
/**
|
|
34
|
-
* The underlying DOM element which is rendered by this component.
|
|
35
|
-
*/
|
|
36
34
|
const Root = "div";
|
|
37
35
|
function Cover(props, ref) {
|
|
38
36
|
const {
|
|
@@ -42,23 +40,25 @@ function Cover(props, ref) {
|
|
|
42
40
|
className,
|
|
43
41
|
...rest
|
|
44
42
|
} = props;
|
|
45
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/jsx(Root, {
|
|
46
44
|
ref: ref,
|
|
47
45
|
className: cx_default(className, fullWidth),
|
|
48
|
-
...rest
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
...rest,
|
|
47
|
+
children: /*#__PURE__*/jsxs("picture", {
|
|
48
|
+
children: [sources.map((p, i) => /*#__PURE__*/jsx("source", {
|
|
49
|
+
...p
|
|
50
|
+
}, i)), /*#__PURE__*/jsx("img", {
|
|
51
|
+
...metadata,
|
|
52
|
+
...img,
|
|
53
|
+
style: {
|
|
54
|
+
display: "block",
|
|
55
|
+
maxWidth: "100%",
|
|
56
|
+
height: "35vh",
|
|
57
|
+
objectFit: "cover"
|
|
58
|
+
}
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
62
|
}
|
|
63
63
|
var Cover$1 = /*#__PURE__*/React.forwardRef(Cover);
|
|
64
64
|
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
package/blocks/Exhibit/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useBlock } from 'timvir/core';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
// src/css.ts
|
|
6
7
|
|
|
@@ -46,24 +47,27 @@ function Exhibit(props, ref) {
|
|
|
46
47
|
style,
|
|
47
48
|
...rest
|
|
48
49
|
} = block.props;
|
|
49
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/jsxs(Root, {
|
|
50
51
|
ref: ref,
|
|
51
52
|
className: cx_default("timvir-b-Exhibit", className, classes.root),
|
|
52
53
|
style: {
|
|
53
54
|
...style,
|
|
54
55
|
[cssVariables.bleed]: typeof bleed === "number" ? `${bleed}px` : undefined
|
|
55
56
|
},
|
|
56
|
-
...rest
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
...rest,
|
|
58
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
59
|
+
className: cx_default("timvir-b-Exhibit-container", classes.container),
|
|
60
|
+
...BackdropProps,
|
|
61
|
+
style: {
|
|
62
|
+
border: bleed === 0 ? "none" : `1px solid var(${cssVariables.borderColor})`,
|
|
63
|
+
...BackdropProps?.style
|
|
64
|
+
},
|
|
65
|
+
children: children
|
|
66
|
+
}), caption && /*#__PURE__*/jsx("div", {
|
|
67
|
+
className: cx_default("timvir-b-Exhibit-caption", classes.caption),
|
|
68
|
+
children: caption
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
67
71
|
}
|
|
68
72
|
var Exhibit$1 = /*#__PURE__*/React.forwardRef(Exhibit);
|
|
69
73
|
const cssVariables = {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Exhibit } from "..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Exhibit>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.r1nql2f9{--timvir-b-Exhibit-bleed:calc(var(--timvir-margin, 0px) * 0.6666);--timvir-b-Exhibit-borderColor:var(--timvir-border-color);--timvir-b-Exhibit-background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAHElEQVR4AWP4/u07Mvr75y8yGlBpND6a6oGUBgAxMSSkDKa/pQAAAABJRU5ErkJggg==);}:root[data-timvir-theme="dark"] {--timvir-b-Exhibit-background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAFklEQVQI12NQBQF2EGAghQkmwXxSmADZJQiZ2ZZ46gAAAABJRU5ErkJggg==);}
|
|
1
|
+
.r1nql2f9{--timvir-b-Exhibit-bleed:calc(var(--timvir-margin, 0px) * 0.6666);--timvir-b-Exhibit-borderColor:var(--timvir-border-color);--timvir-b-Exhibit-background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAHElEQVR4AWP4/u07Mvr75y8yGlBpND6a6oGUBgAxMSSkDKa/pQAAAABJRU5ErkJggg==);}:root[data-timvir-theme="dark"] .r1nql2f9{--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);border-radius:5px;}
|
|
3
3
|
.cf43jjx{font-size:0.8125rem;line-height:1.1875;color:var(--timvir-secondary-text-color);margin-top:0.3em;}
|
|
4
4
|
|