timvir 0.2.39 → 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 +20 -0
- package/blocks/Arbitrary/Arbitrary.d.ts +1 -1
- package/blocks/Arbitrary/index.js +193 -48
- 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 +205 -112
- package/blocks/Code/styles.css +100 -15
- package/blocks/ColorBar/docs/index.mdx +8 -2
- package/blocks/ColorBar/index.js +198 -47
- package/blocks/ColorBar/styles.css +103 -4
- package/blocks/ColorBook/docs/index.mdx +1 -1
- package/blocks/ColorBook/index.js +198 -39
- package/blocks/ColorBook/styles.css +166 -6
- package/blocks/Cover/index.js +165 -36
- package/blocks/Cover/styles.css +18 -0
- package/blocks/Exhibit/index.js +192 -41
- package/blocks/Exhibit/styles.css +66 -3
- package/blocks/Font/index.js +188 -58
- package/blocks/Font/styles.css +82 -8
- package/blocks/Grid/docs/index.mdx +4 -4
- package/blocks/Grid/index.js +176 -33
- package/blocks/Grid/styles.css +20 -1
- package/blocks/Icon/docs/index.mdx +13 -13
- package/blocks/Icon/index.js +25 -43
- package/blocks/Icon/styles.css +117 -5
- package/blocks/Message/docs/index.mdx +5 -8
- package/blocks/Message/index.js +233 -54
- package/blocks/Message/styles.css +94 -6
- package/blocks/Swatch/docs/index.mdx +16 -16
- package/blocks/Swatch/index.js +180 -35
- package/blocks/Swatch/styles.css +82 -4
- package/blocks/Viewport/index.js +198 -91
- package/blocks/Viewport/styles.css +259 -14
- package/blocks/WebLink/index.js +192 -48
- package/blocks/WebLink/styles.css +170 -8
- package/blocks/styles.css +1460 -97
- package/builtins/components.d.ts +2 -2
- package/builtins/index.d.ts +0 -1
- package/builtins/index.js +300 -243
- package/builtins/styles.css +265 -25
- package/context/index.d.ts +6 -1
- package/core/components/Commands/Commands.d.ts +5 -1
- package/core/components/NavigationFooter/NavigationFooter.d.ts +4 -2
- package/core/components/Page/Page.d.ts +12 -3
- package/core/components/Page/docs/index.mdx +44 -11
- package/core/index.d.ts +191 -2
- package/core/index.js +415 -256
- package/core/layout.d.ts +41 -0
- package/core/styles.css +857 -88
- package/global.css +79 -0
- package/internal/cx.d.ts +1 -0
- package/package.json +1 -2
- package/search/index.js +2 -223
- package/styles.css +2670 -235
- 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 -1
- 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 -1
- package/search/styles.css +0 -16
package/blocks/Swatch/index.js
CHANGED
|
@@ -1,43 +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
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
|
|
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
|
+
}
|
|
7
16
|
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
individualClassNames.forEach((className) => {
|
|
16
|
-
if (className.startsWith("atm_")) {
|
|
17
|
-
const [, keyHash] = className.split("_");
|
|
18
|
-
atomicClasses[keyHash] = className;
|
|
19
|
-
} else {
|
|
20
|
-
nonAtomicClasses.push(className);
|
|
21
|
-
}
|
|
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
|
|
22
24
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
};
|
|
28
147
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
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
|
+
}
|
|
34
167
|
|
|
35
|
-
/**
|
|
36
|
-
* The underlying DOM element which is rendered by this component.
|
|
37
|
-
*/
|
|
38
168
|
const Root = "div";
|
|
39
|
-
function Swatch(props, ref) {
|
|
40
|
-
const block = useBlock(props);
|
|
169
|
+
function Swatch(props$1, ref) {
|
|
170
|
+
const block = useBlock(props$1);
|
|
41
171
|
const {
|
|
42
172
|
value,
|
|
43
173
|
contrastValue,
|
|
@@ -46,20 +176,28 @@ function Swatch(props, ref) {
|
|
|
46
176
|
onClick,
|
|
47
177
|
onMouseLeave,
|
|
48
178
|
className,
|
|
179
|
+
style,
|
|
49
180
|
...rest
|
|
50
181
|
} = block.props;
|
|
51
182
|
const [label, setLabel] = React.useState(name);
|
|
52
183
|
React.useEffect(() => {
|
|
53
184
|
setLabel(name);
|
|
54
185
|
}, [name]);
|
|
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
|
+
};
|
|
55
190
|
return /*#__PURE__*/jsx(Root, {
|
|
56
191
|
role: "button",
|
|
57
192
|
ref: ref,
|
|
58
193
|
...rest,
|
|
194
|
+
...rootStyleProps,
|
|
195
|
+
className: cx(rootStyleProps.className, className),
|
|
59
196
|
style: {
|
|
197
|
+
...style,
|
|
198
|
+
...rootStyleProps.style,
|
|
60
199
|
height: ancestry ? 48 : 36
|
|
61
200
|
},
|
|
62
|
-
className: cx_default(className, "r19bcggb"),
|
|
63
201
|
onClick: ev => {
|
|
64
202
|
navigator.clipboard.writeText(value);
|
|
65
203
|
setLabel("Copied to clipboard");
|
|
@@ -70,25 +208,32 @@ function Swatch(props, ref) {
|
|
|
70
208
|
onMouseLeave?.(ev);
|
|
71
209
|
},
|
|
72
210
|
children: /*#__PURE__*/jsxs("div", {
|
|
73
|
-
|
|
211
|
+
...innerStyleProps,
|
|
74
212
|
style: {
|
|
213
|
+
...innerStyleProps.style,
|
|
75
214
|
background: value,
|
|
76
215
|
color: contrastValue
|
|
77
216
|
},
|
|
78
217
|
children: [/*#__PURE__*/jsxs("div", {
|
|
79
|
-
className: "
|
|
218
|
+
className: "timvir-s-78zum5 timvir-s-1qughib timvir-s-6s0dn4 timvir-s-o5v014",
|
|
80
219
|
children: [label && /*#__PURE__*/jsx("div", {
|
|
81
220
|
children: label
|
|
82
221
|
}), label === name && /*#__PURE__*/jsx("div", {
|
|
83
222
|
children: value
|
|
84
223
|
})]
|
|
85
224
|
}), ancestry && /*#__PURE__*/jsx("div", {
|
|
86
|
-
className: "
|
|
225
|
+
className: "timvir-s-1yrsyyn timvir-s-byyjgo timvir-s-sfzzmd timvir-s-o5v014",
|
|
87
226
|
children: ancestry
|
|
88
227
|
})]
|
|
89
228
|
})
|
|
90
229
|
});
|
|
91
230
|
}
|
|
92
231
|
var Swatch$1 = /*#__PURE__*/React.forwardRef(Swatch);
|
|
232
|
+
const styles = {
|
|
233
|
+
root: {
|
|
234
|
+
kVAEAm: "timvir-s-1n2onr6",
|
|
235
|
+
$$css: true
|
|
236
|
+
}
|
|
237
|
+
};
|
|
93
238
|
|
|
94
239
|
export { Swatch$1 as Swatch };
|
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
|
+
}
|