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.
- package/CHANGELOG.md +29 -0
- package/blocks/Arbitrary/Arbitrary.d.ts +1 -1
- package/blocks/Arbitrary/index.js +232 -78
- package/blocks/Arbitrary/samples/basic.d.ts +1 -1
- package/blocks/Arbitrary/styles.css +166 -6
- package/blocks/Code/Code.d.ts +0 -6
- package/blocks/Code/docs/index.mdx +0 -11
- package/blocks/Code/index.js +213 -112
- package/blocks/Code/samples/basic.d.ts +1 -1
- package/blocks/Code/samples/toggle.d.ts +1 -2
- package/blocks/Code/styles.css +100 -15
- package/blocks/ColorBar/docs/index.mdx +8 -2
- package/blocks/ColorBar/index.js +223 -68
- package/blocks/ColorBar/samples/basic.d.ts +1 -2
- package/blocks/ColorBar/styles.css +103 -4
- package/blocks/ColorBook/docs/index.mdx +1 -1
- package/blocks/ColorBook/index.js +222 -60
- package/blocks/ColorBook/samples/basic.d.ts +1 -2
- package/blocks/ColorBook/styles.css +166 -6
- package/blocks/Cover/index.js +177 -48
- package/blocks/Cover/samples/basic.d.ts +1 -2
- package/blocks/Cover/styles.css +18 -0
- package/blocks/Exhibit/index.js +205 -50
- 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 +66 -3
- package/blocks/Font/index.js +239 -98
- 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/Font/styles.css +82 -8
- package/blocks/Grid/docs/index.mdx +4 -4
- package/blocks/Grid/index.js +181 -36
- package/blocks/Grid/samples/basic.d.ts +1 -2
- package/blocks/Grid/styles.css +20 -1
- package/blocks/Icon/docs/index.mdx +13 -13
- package/blocks/Icon/index.js +93 -100
- package/blocks/Icon/internal/Canvas.d.ts +1 -1
- package/blocks/Icon/samples/basic.d.ts +1 -2
- package/blocks/Icon/styles.css +117 -5
- package/blocks/Icon/types.d.ts +3 -2
- package/blocks/Message/docs/index.mdx +5 -8
- package/blocks/Message/index.js +238 -55
- package/blocks/Message/samples/basic.d.ts +1 -1
- package/blocks/Message/styles.css +94 -6
- package/blocks/Swatch/docs/index.mdx +16 -16
- package/blocks/Swatch/index.js +199 -45
- package/blocks/Swatch/samples/basic.d.ts +1 -2
- package/blocks/Swatch/styles.css +82 -4
- package/blocks/Viewport/index.js +360 -237
- 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/Viewport/styles.css +259 -14
- package/blocks/WebLink/index.js +217 -62
- package/blocks/WebLink/samples/basic.d.ts +1 -1
- package/blocks/WebLink/styles.css +170 -8
- package/blocks/styles.css +1460 -97
- package/builtins/components.d.ts +2 -2
- package/builtins/index.js +306 -239
- package/builtins/styles.css +267 -14
- package/context/index.d.ts +6 -1
- package/core/components/Commands/Commands.d.ts +2 -0
- 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/NavigationFooter.d.ts +4 -2
- package/core/components/NavigationFooter/samples/basic.d.ts +1 -1
- package/core/components/Page/Page.d.ts +12 -3
- package/core/components/Page/docs/index.mdx +44 -11
- 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.d.ts +191 -2
- package/core/index.js +674 -449
- package/core/layout.d.ts +40 -0
- package/core/styles.css +857 -88
- package/core/theme/detector.js +1 -1
- package/global.css +79 -0
- package/internal/cx.d.ts +1 -0
- package/knip.config.d.ts +5 -0
- package/package.json +1 -2
- package/search/Search/samples/basic.d.ts +1 -2
- package/search/index.js +2 -208
- package/styles.css +2670 -222
- package/blocks/Code/theme.d.ts +0 -2
- package/bus/styles.css +0 -1
- package/context/styles.css +0 -1
- package/core/theme/index.d.ts +0 -1
- package/hooks/styles.css +0 -1
- package/search/Search/internal/Dialog.d.ts +0 -20
- package/search/Search/internal/index.d.ts +0 -1
- package/search/SearchBoxInput/SearchBoxInput.d.ts +0 -11
- package/search/SearchBoxInput/docs/api.mdx +0 -76
- package/search/SearchBoxInput/docs/index.mdx +0 -6
- package/search/SearchBoxInput/index.d.ts +0 -1
- package/search/SearchBoxInput/samples/basic.d.ts +0 -2
- package/search/SearchBoxListItem/SearchBoxListItem.d.ts +0 -13
- package/search/SearchBoxListItem/docs/api.mdx +0 -76
- package/search/SearchBoxListItem/docs/index.mdx +0 -30
- package/search/SearchBoxListItem/index.d.ts +0 -1
- package/search/SearchBoxListItem/samples/basic.d.ts +0 -2
- package/search/styles.css +0 -16
package/blocks/Swatch/index.js
CHANGED
|
@@ -1,42 +1,173 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useBlock } from 'timvir/core';
|
|
2
|
+
import { useBlock, layoutStyles } from 'timvir/core';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
var
|
|
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 = "div";
|
|
38
|
-
function Swatch(props, ref) {
|
|
39
|
-
const block = useBlock(props);
|
|
169
|
+
function Swatch(props$1, ref) {
|
|
170
|
+
const block = useBlock(props$1);
|
|
40
171
|
const {
|
|
41
172
|
value,
|
|
42
173
|
contrastValue,
|
|
@@ -45,20 +176,28 @@ function Swatch(props, ref) {
|
|
|
45
176
|
onClick,
|
|
46
177
|
onMouseLeave,
|
|
47
178
|
className,
|
|
179
|
+
style,
|
|
48
180
|
...rest
|
|
49
181
|
} = block.props;
|
|
50
182
|
const [label, setLabel] = React.useState(name);
|
|
51
183
|
React.useEffect(() => {
|
|
52
184
|
setLabel(name);
|
|
53
185
|
}, [name]);
|
|
54
|
-
|
|
186
|
+
const rootStyleProps = props(layoutStyles.block, styles.root);
|
|
187
|
+
const innerStyleProps = {
|
|
188
|
+
className: "timvir-s-78zum5 timvir-s-dt5ytf timvir-s-l56j7k timvir-s-10l6tqk timvir-s-13vifvy timvir-s-3m8u43 timvir-s-1ey2m1c timvir-s-u96u03 timvir-s-zhuw26 timvir-s-84vhe8 timvir-s-1ypdohk timvir-s-1cum3z5"
|
|
189
|
+
};
|
|
190
|
+
return /*#__PURE__*/jsx(Root, {
|
|
55
191
|
role: "button",
|
|
56
192
|
ref: ref,
|
|
57
193
|
...rest,
|
|
194
|
+
...rootStyleProps,
|
|
195
|
+
className: cx(rootStyleProps.className, className),
|
|
58
196
|
style: {
|
|
197
|
+
...style,
|
|
198
|
+
...rootStyleProps.style,
|
|
59
199
|
height: ancestry ? 48 : 36
|
|
60
200
|
},
|
|
61
|
-
className: cx_default(className, "r19bcggb"),
|
|
62
201
|
onClick: ev => {
|
|
63
202
|
navigator.clipboard.writeText(value);
|
|
64
203
|
setLabel("Copied to clipboard");
|
|
@@ -67,19 +206,34 @@ function Swatch(props, ref) {
|
|
|
67
206
|
onMouseLeave: ev => {
|
|
68
207
|
setLabel(name);
|
|
69
208
|
onMouseLeave?.(ev);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
209
|
+
},
|
|
210
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
211
|
+
...innerStyleProps,
|
|
212
|
+
style: {
|
|
213
|
+
...innerStyleProps.style,
|
|
214
|
+
background: value,
|
|
215
|
+
color: contrastValue
|
|
216
|
+
},
|
|
217
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
218
|
+
className: "timvir-s-78zum5 timvir-s-1qughib timvir-s-6s0dn4 timvir-s-o5v014",
|
|
219
|
+
children: [label && /*#__PURE__*/jsx("div", {
|
|
220
|
+
children: label
|
|
221
|
+
}), label === name && /*#__PURE__*/jsx("div", {
|
|
222
|
+
children: value
|
|
223
|
+
})]
|
|
224
|
+
}), ancestry && /*#__PURE__*/jsx("div", {
|
|
225
|
+
className: "timvir-s-1yrsyyn timvir-s-byyjgo timvir-s-sfzzmd timvir-s-o5v014",
|
|
226
|
+
children: ancestry
|
|
227
|
+
})]
|
|
228
|
+
})
|
|
229
|
+
});
|
|
82
230
|
}
|
|
83
231
|
var Swatch$1 = /*#__PURE__*/React.forwardRef(Swatch);
|
|
232
|
+
const styles = {
|
|
233
|
+
root: {
|
|
234
|
+
kVAEAm: "timvir-s-1n2onr6",
|
|
235
|
+
$$css: true
|
|
236
|
+
}
|
|
237
|
+
};
|
|
84
238
|
|
|
85
239
|
export { Swatch$1 as Swatch };
|
|
@@ -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/Swatch/styles.css
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
@layer priority1 {
|
|
2
|
+
.timvir-s-84vhe8 {
|
|
3
|
+
padding: 0 12px;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
5
6
|
|
|
7
|
+
@layer priority2 {
|
|
8
|
+
.timvir-s-1cum3z5 {
|
|
9
|
+
border-radius: 2px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.timvir-s-zhuw26 {
|
|
13
|
+
transition: all .16s;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@layer priority3 {
|
|
18
|
+
.timvir-s-6s0dn4 {
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.timvir-s-1ypdohk {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.timvir-s-78zum5 {
|
|
27
|
+
display: flex;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.timvir-s-dt5ytf {
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.timvir-s-sfzzmd {
|
|
35
|
+
font-size: .8em;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.timvir-s-l56j7k {
|
|
39
|
+
justify-content: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.timvir-s-1qughib {
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.timvir-s-o5v014 {
|
|
47
|
+
line-height: 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.timvir-s-byyjgo {
|
|
51
|
+
opacity: .5;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.timvir-s-10l6tqk {
|
|
55
|
+
position: absolute;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.timvir-s-1n2onr6 {
|
|
59
|
+
position: relative;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@layer priority4 {
|
|
64
|
+
.timvir-s-1ey2m1c {
|
|
65
|
+
bottom: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.timvir-s-u96u03 {
|
|
69
|
+
left: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.timvir-s-1yrsyyn {
|
|
73
|
+
padding-top: 6px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.timvir-s-3m8u43 {
|
|
77
|
+
right: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.timvir-s-13vifvy {
|
|
81
|
+
top: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|