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/builtins/components.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export declare const table: React.FunctionComponent<React.TableHTMLAttributes<HT
|
|
|
9
9
|
export declare const thead: React.FunctionComponent<React.HTMLAttributes<HTMLTableSectionElement>>;
|
|
10
10
|
export declare const tbody: React.FunctionComponent<React.HTMLAttributes<HTMLTableSectionElement>>;
|
|
11
11
|
export declare const tr: React.FunctionComponent<React.HTMLAttributes<HTMLTableRowElement>>;
|
|
12
|
-
export declare const th: React.FunctionComponent<React.ThHTMLAttributes<
|
|
13
|
-
export declare const td: React.FunctionComponent<React.TdHTMLAttributes<
|
|
12
|
+
export declare const th: React.FunctionComponent<React.ThHTMLAttributes<HTMLTableCellElement>>;
|
|
13
|
+
export declare const td: React.FunctionComponent<React.TdHTMLAttributes<HTMLTableCellElement>>;
|
|
14
14
|
export declare const code: React.FunctionComponent<React.HTMLAttributes<HTMLElement>>;
|
|
15
15
|
export declare const a: React.FunctionComponent<React.AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
16
16
|
export declare const p: React.FunctionComponent<React.HTMLAttributes<HTMLParagraphElement>>;
|
package/builtins/index.js
CHANGED
|
@@ -1,160 +1,158 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { forwardRef, createElement } from 'react';
|
|
3
2
|
import * as Icons from 'react-feather';
|
|
3
|
+
import { layoutStyles } from 'timvir/core';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
14
|
-
|
|
15
|
-
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
|
16
|
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
17
|
-
/* o */ && prop.charCodeAt(1) === 110
|
|
18
|
-
/* n */ && prop.charCodeAt(2) < 91;
|
|
19
|
-
}
|
|
20
|
-
/* Z+1 */);
|
|
21
|
-
|
|
22
|
-
// src/css.ts
|
|
23
|
-
|
|
24
|
-
// src/cx.ts
|
|
25
|
-
var cx = function cx2() {
|
|
26
|
-
const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
|
|
27
|
-
const atomicClasses = {};
|
|
28
|
-
const nonAtomicClasses = [];
|
|
29
|
-
presentClassNames.forEach((arg) => {
|
|
30
|
-
const individualClassNames = arg ? arg.split(" ") : [];
|
|
31
|
-
individualClassNames.forEach((className) => {
|
|
32
|
-
if (className.startsWith("atm_")) {
|
|
33
|
-
const [, keyHash] = className.split("_");
|
|
34
|
-
atomicClasses[keyHash] = className;
|
|
35
|
-
} else {
|
|
36
|
-
nonAtomicClasses.push(className);
|
|
37
|
-
}
|
|
6
|
+
var styleq = {};
|
|
7
|
+
var hasRequiredStyleq;
|
|
8
|
+
function requireStyleq() {
|
|
9
|
+
if (hasRequiredStyleq) return styleq;
|
|
10
|
+
hasRequiredStyleq = 1;
|
|
11
|
+
Object.defineProperty(styleq, "__esModule", {
|
|
12
|
+
value: true
|
|
38
13
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
14
|
+
styleq.styleq = void 0;
|
|
15
|
+
var cache = new WeakMap();
|
|
16
|
+
var compiledKey = '$$css';
|
|
17
|
+
function createStyleq(options) {
|
|
18
|
+
var disableCache;
|
|
19
|
+
var disableMix;
|
|
20
|
+
var transform;
|
|
21
|
+
if (options != null) {
|
|
22
|
+
disableCache = options.disableCache === true;
|
|
23
|
+
disableMix = options.disableMix === true;
|
|
24
|
+
transform = options.transform;
|
|
25
|
+
}
|
|
26
|
+
return function styleq() {
|
|
27
|
+
var definedProperties = [];
|
|
28
|
+
var className = '';
|
|
29
|
+
var inlineStyle = null;
|
|
30
|
+
var debugString = '';
|
|
31
|
+
var nextCache = disableCache ? null : cache;
|
|
32
|
+
var styles = new Array(arguments.length);
|
|
33
|
+
for(var i = 0; i < arguments.length; i++){
|
|
34
|
+
styles[i] = arguments[i];
|
|
35
|
+
}
|
|
36
|
+
while(styles.length > 0){
|
|
37
|
+
var possibleStyle = styles.pop();
|
|
38
|
+
if (possibleStyle == null || possibleStyle === false) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(possibleStyle)) {
|
|
42
|
+
for(var _i = 0; _i < possibleStyle.length; _i++){
|
|
43
|
+
styles.push(possibleStyle[_i]);
|
|
44
|
+
}
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
var style = transform != null ? transform(possibleStyle) : possibleStyle;
|
|
48
|
+
if (style.$$css != null) {
|
|
49
|
+
var classNameChunk = '';
|
|
50
|
+
if (nextCache != null && nextCache.has(style)) {
|
|
51
|
+
var cacheEntry = nextCache.get(style);
|
|
52
|
+
if (cacheEntry != null) {
|
|
53
|
+
classNameChunk = cacheEntry[0];
|
|
54
|
+
debugString = cacheEntry[2];
|
|
55
|
+
definedProperties.push.apply(definedProperties, cacheEntry[1]);
|
|
56
|
+
nextCache = cacheEntry[3];
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
var definedPropertiesChunk = [];
|
|
60
|
+
for(var prop in style){
|
|
61
|
+
var value = style[prop];
|
|
62
|
+
if (prop === compiledKey) {
|
|
63
|
+
var compiledKeyValue = style[prop];
|
|
64
|
+
if (compiledKeyValue !== true) {
|
|
65
|
+
debugString = debugString ? compiledKeyValue + '; ' + debugString : compiledKeyValue;
|
|
66
|
+
}
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (typeof value === 'string' || value === null) {
|
|
70
|
+
if (!definedProperties.includes(prop)) {
|
|
71
|
+
definedProperties.push(prop);
|
|
72
|
+
if (nextCache != null) {
|
|
73
|
+
definedPropertiesChunk.push(prop);
|
|
74
|
+
}
|
|
75
|
+
if (typeof value === 'string') {
|
|
76
|
+
classNameChunk += classNameChunk ? ' ' + value : value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
console.error("styleq: ".concat(prop, " typeof ").concat(String(value), " is not \"string\" or \"null\"."));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (nextCache != null) {
|
|
84
|
+
var weakMap = new WeakMap();
|
|
85
|
+
nextCache.set(style, [
|
|
86
|
+
classNameChunk,
|
|
87
|
+
definedPropertiesChunk,
|
|
88
|
+
debugString,
|
|
89
|
+
weakMap
|
|
90
|
+
]);
|
|
91
|
+
nextCache = weakMap;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (classNameChunk) {
|
|
95
|
+
className = className ? classNameChunk + ' ' + className : classNameChunk;
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
if (disableMix) {
|
|
99
|
+
if (inlineStyle == null) {
|
|
100
|
+
inlineStyle = {};
|
|
101
|
+
}
|
|
102
|
+
inlineStyle = Object.assign({}, style, inlineStyle);
|
|
103
|
+
} else {
|
|
104
|
+
var subStyle = null;
|
|
105
|
+
for(var _prop in style){
|
|
106
|
+
var _value = style[_prop];
|
|
107
|
+
if (_value !== undefined) {
|
|
108
|
+
if (!definedProperties.includes(_prop)) {
|
|
109
|
+
if (_value != null) {
|
|
110
|
+
if (inlineStyle == null) {
|
|
111
|
+
inlineStyle = {};
|
|
112
|
+
}
|
|
113
|
+
if (subStyle == null) {
|
|
114
|
+
subStyle = {};
|
|
115
|
+
}
|
|
116
|
+
subStyle[_prop] = _value;
|
|
117
|
+
}
|
|
118
|
+
definedProperties.push(_prop);
|
|
119
|
+
nextCache = null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (subStyle != null) {
|
|
124
|
+
inlineStyle = Object.assign(subStyle, inlineStyle);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var styleProps = [
|
|
130
|
+
className,
|
|
131
|
+
inlineStyle,
|
|
132
|
+
debugString
|
|
133
|
+
];
|
|
134
|
+
return styleProps;
|
|
135
|
+
};
|
|
44
136
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
var cx_default = cx;
|
|
50
|
-
|
|
51
|
-
// src/styled.ts
|
|
52
|
-
var isCapital = (ch) => ch.toUpperCase() === ch;
|
|
53
|
-
var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
|
|
54
|
-
var omit = (obj, keys) => {
|
|
55
|
-
const res = {};
|
|
56
|
-
Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
|
|
57
|
-
res[key] = obj[key];
|
|
58
|
-
});
|
|
59
|
-
return res;
|
|
60
|
-
};
|
|
61
|
-
function filterProps(asIs, props, omitKeys) {
|
|
62
|
-
const filteredProps = omit(props, omitKeys);
|
|
63
|
-
if (!asIs) {
|
|
64
|
-
const interopValidAttr = typeof isPropValid === "function" ? { default: isPropValid } : isPropValid;
|
|
65
|
-
Object.keys(filteredProps).forEach((key) => {
|
|
66
|
-
if (!interopValidAttr.default(key)) {
|
|
67
|
-
delete filteredProps[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
return filteredProps;
|
|
137
|
+
var styleq$1 = styleq.styleq = createStyleq();
|
|
138
|
+
styleq$1.factory = createStyleq;
|
|
139
|
+
return styleq;
|
|
72
140
|
}
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
141
|
+
var styleqExports = requireStyleq();
|
|
142
|
+
function props(...styles) {
|
|
143
|
+
const [className, style, dataStyleSrc] = styleqExports.styleq(styles);
|
|
144
|
+
const result = {};
|
|
145
|
+
if (className != null && className !== '') {
|
|
146
|
+
result.className = className;
|
|
78
147
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`An interpolation evaluated to '${stringified}' in the component '${componentName}', which is probably a mistake. You should explicitly cast or transform the value to a string.`
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
var idx = 0;
|
|
86
|
-
function styled(tag) {
|
|
87
|
-
let mockedClass = "";
|
|
88
|
-
if (process.env.NODE_ENV === "test") {
|
|
89
|
-
mockedClass += `mocked-styled-${idx++}`;
|
|
90
|
-
if (tag && tag.__wyw_meta && tag.__wyw_meta.className) {
|
|
91
|
-
mockedClass += ` ${tag.__wyw_meta.className}`;
|
|
148
|
+
if (style != null && Object.keys(style).length > 0) {
|
|
149
|
+
result.style = style;
|
|
92
150
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test") {
|
|
96
|
-
if (Array.isArray(options)) {
|
|
97
|
-
throw new Error(
|
|
98
|
-
'Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup'
|
|
99
|
-
);
|
|
100
|
-
}
|
|
151
|
+
if (dataStyleSrc != null && dataStyleSrc !== '') {
|
|
152
|
+
result['data-style-src'] = dataStyleSrc;
|
|
101
153
|
}
|
|
102
|
-
|
|
103
|
-
const { as: component = tag, class: className = mockedClass } = props;
|
|
104
|
-
const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
|
|
105
|
-
const filteredProps = filterProps(shouldKeepProps, props, [
|
|
106
|
-
"as",
|
|
107
|
-
"class"
|
|
108
|
-
]);
|
|
109
|
-
filteredProps.ref = ref;
|
|
110
|
-
filteredProps.className = options.atomic ? cx_default(options.class, filteredProps.className || className) : cx_default(filteredProps.className || className, options.class);
|
|
111
|
-
const { vars } = options;
|
|
112
|
-
if (vars) {
|
|
113
|
-
const style = {};
|
|
114
|
-
for (const name in vars) {
|
|
115
|
-
const variable = vars[name];
|
|
116
|
-
const result = variable[0];
|
|
117
|
-
const unit = variable[1] || "";
|
|
118
|
-
const value = typeof result === "function" ? result(props) : result;
|
|
119
|
-
warnIfInvalid(value, options.name);
|
|
120
|
-
style[`--${name}`] = `${value}${unit}`;
|
|
121
|
-
}
|
|
122
|
-
const ownStyle = filteredProps.style || {};
|
|
123
|
-
const keys = Object.keys(ownStyle);
|
|
124
|
-
if (keys.length > 0) {
|
|
125
|
-
keys.forEach((key) => {
|
|
126
|
-
style[key] = ownStyle[key];
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
filteredProps.style = style;
|
|
130
|
-
}
|
|
131
|
-
if (tag.__wyw_meta && tag !== component) {
|
|
132
|
-
filteredProps.as = component;
|
|
133
|
-
return createElement(tag, filteredProps);
|
|
134
|
-
}
|
|
135
|
-
return createElement(component, filteredProps);
|
|
136
|
-
};
|
|
137
|
-
const Result = forwardRef ? forwardRef(render) : (
|
|
138
|
-
// React.forwardRef won't available on older React versions and in Preact
|
|
139
|
-
// Fallback to a innerRef prop in that case
|
|
140
|
-
(props) => {
|
|
141
|
-
const rest = omit(props, ["innerRef"]);
|
|
142
|
-
return render(rest, props.innerRef);
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
Result.displayName = options.name;
|
|
146
|
-
Result.__wyw_meta = {
|
|
147
|
-
className: options.class || mockedClass,
|
|
148
|
-
extends: tag
|
|
149
|
-
};
|
|
150
|
-
return Result;
|
|
151
|
-
};
|
|
154
|
+
return result;
|
|
152
155
|
}
|
|
153
|
-
var styled_default = process.env.NODE_ENV !== "production" ? new Proxy(styled, {
|
|
154
|
-
get(o, prop) {
|
|
155
|
-
return o(prop);
|
|
156
|
-
}
|
|
157
|
-
}) : styled;
|
|
158
156
|
|
|
159
157
|
const anchorize = children => {
|
|
160
158
|
if (typeof children === "string") {
|
|
@@ -165,114 +163,183 @@ const anchorize = children => {
|
|
|
165
163
|
};
|
|
166
164
|
function Heading(Component) {
|
|
167
165
|
return function Heading(props) {
|
|
168
|
-
const
|
|
169
|
-
|
|
166
|
+
const {
|
|
167
|
+
children,
|
|
168
|
+
...rest
|
|
169
|
+
} = props;
|
|
170
|
+
const id = anchorize(children);
|
|
171
|
+
return /*#__PURE__*/jsx(Component, {
|
|
172
|
+
...rest,
|
|
170
173
|
id: id,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
children: /*#__PURE__*/jsxs("a", {
|
|
175
|
+
className: "timvir-s-1heor9g timvir-s-1hl2dhg timvir-s-bok0fy timvir-s-158d8ml timvir-s-1rb6emv timvir-s-1xi2g7t",
|
|
176
|
+
href: id && `#${id}`,
|
|
177
|
+
children: [children, /*#__PURE__*/jsx(Icons.Link, {
|
|
178
|
+
className: "timvir-s-1rg5ohu timvir-s-16vho4v timvir-s-vgvpxu timvir-s-1pazyae timvir-s-1y6pbyt timvir-s-xymvpz timvir-s-2r93rw timvir-s-1i3gk9 timvir-s-o5ics5 timvir-s-6ah1hw"
|
|
179
|
+
})]
|
|
180
|
+
})
|
|
181
|
+
});
|
|
178
182
|
};
|
|
179
183
|
}
|
|
180
|
-
const h1 = /*#__PURE__*/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
propsAsIs: false
|
|
184
|
+
const h1 = props$1 => /*#__PURE__*/jsx("h1", {
|
|
185
|
+
...props(layoutStyles.block, styles.h1),
|
|
186
|
+
...props$1
|
|
184
187
|
});
|
|
185
|
-
const h2 = Heading(/*#__PURE__*/
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
propsAsIs: false
|
|
188
|
+
const h2 = Heading(props$1 => /*#__PURE__*/jsx("h2", {
|
|
189
|
+
...props(layoutStyles.block, styles.h2),
|
|
190
|
+
...props$1
|
|
189
191
|
}));
|
|
190
|
-
const h3 = Heading(/*#__PURE__*/
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
propsAsIs: false
|
|
192
|
+
const h3 = Heading(props$1 => /*#__PURE__*/jsx("h3", {
|
|
193
|
+
...props(layoutStyles.block, styles.h3),
|
|
194
|
+
...props$1
|
|
194
195
|
}));
|
|
195
|
-
const h4 = Heading(/*#__PURE__*/
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
propsAsIs: false
|
|
196
|
+
const h4 = Heading(props$1 => /*#__PURE__*/jsx("h4", {
|
|
197
|
+
...props(layoutStyles.block, styles.h4),
|
|
198
|
+
...props$1
|
|
199
199
|
}));
|
|
200
|
-
const blockquote =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
200
|
+
const blockquote = props$1 => {
|
|
201
|
+
const {
|
|
202
|
+
children,
|
|
203
|
+
...rest
|
|
204
|
+
} = props$1;
|
|
205
|
+
return /*#__PURE__*/jsx("blockquote", {
|
|
206
|
+
...rest,
|
|
207
|
+
...props(layoutStyles.block, styles.blockquote),
|
|
208
|
+
children: React.Children.toArray(children).filter(x => x !== "\n").map((child, index, self) => {
|
|
209
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
210
|
+
return child;
|
|
211
|
+
}
|
|
212
|
+
const style = {
|
|
213
|
+
marginTop: index === 0 ? "0" : undefined,
|
|
214
|
+
marginBottom: index === self.length - 1 ? "0" : undefined
|
|
215
|
+
};
|
|
216
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
217
|
+
style
|
|
218
|
+
});
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
const hr = props$1 => /*#__PURE__*/jsx("hr", {
|
|
223
|
+
...props(layoutStyles.block, styles.hr),
|
|
224
|
+
...props$1
|
|
214
225
|
});
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
propsAsIs: false
|
|
226
|
+
const table = props$1 => /*#__PURE__*/jsx("table", {
|
|
227
|
+
...props(layoutStyles.block, styles.table),
|
|
228
|
+
...props$1
|
|
219
229
|
});
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
class: "t80peu3",
|
|
223
|
-
propsAsIs: false
|
|
230
|
+
const thead = props => /*#__PURE__*/jsx("thead", {
|
|
231
|
+
...props
|
|
224
232
|
});
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
class: "t1ichb2u",
|
|
228
|
-
propsAsIs: false
|
|
233
|
+
const tbody = props => /*#__PURE__*/jsx("tbody", {
|
|
234
|
+
...props
|
|
229
235
|
});
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
class: "tynrygb",
|
|
234
|
-
propsAsIs: false,
|
|
235
|
-
vars: {
|
|
236
|
-
"tynrygb-0": [_exp()]
|
|
237
|
-
}
|
|
236
|
+
const tr = props => /*#__PURE__*/jsx("tr", {
|
|
237
|
+
className: "timvir-s-83z2og timvir-s-178xt8z timvir-s-13fuv20 timvir-s-1r4gg6b timvir-s-7kswos",
|
|
238
|
+
...props
|
|
238
239
|
});
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
"
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
240
|
+
const th = props => {
|
|
241
|
+
const {
|
|
242
|
+
align,
|
|
243
|
+
...rest
|
|
244
|
+
} = props;
|
|
245
|
+
const style = {
|
|
246
|
+
textAlign: align || "center"
|
|
247
|
+
};
|
|
248
|
+
return /*#__PURE__*/jsx("th", {
|
|
249
|
+
className: "timvir-s-12ek6fo timvir-s-mkeg23 timvir-s-1y0btm7 timvir-s-1kgrkcs",
|
|
250
|
+
style: style,
|
|
251
|
+
...rest
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
const td = props => {
|
|
255
|
+
const {
|
|
256
|
+
align,
|
|
257
|
+
...rest
|
|
258
|
+
} = props;
|
|
259
|
+
const style = {
|
|
260
|
+
textAlign: align || "left"
|
|
261
|
+
};
|
|
262
|
+
return /*#__PURE__*/jsx("td", {
|
|
263
|
+
className: "timvir-s-12ek6fo timvir-s-mkeg23 timvir-s-1y0btm7 timvir-s-1kgrkcs",
|
|
264
|
+
style: style,
|
|
265
|
+
...rest
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
const code = props => /*#__PURE__*/jsx("code", {
|
|
269
|
+
className: "timvir-s-1sxf85j timvir-s-1jnxms5 timvir-s-sfzzmd timvir-s-bspb1j timvir-s-mkeg23 timvir-s-1y0btm7 timvir-s-j7gikm timvir-s-1vhptj2",
|
|
270
|
+
...props
|
|
252
271
|
});
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
class: "az92cdb",
|
|
257
|
-
propsAsIs: false,
|
|
258
|
-
vars: {
|
|
259
|
-
"az92cdb-0": [_exp4()]
|
|
260
|
-
}
|
|
272
|
+
const a = props => /*#__PURE__*/jsx("a", {
|
|
273
|
+
className: "timvir-s-15rks2t timvir-s-1hl2dhg timvir-s-1dlxito timvir-s-1j43nte timvir-s-odwsf6 timvir-s-1w3jsh0 timvir-s-g7t5vw timvir-s-1v02d47 timvir-s-ene6ev timvir-s-15m0p1m timvir-s-1bezv82",
|
|
274
|
+
...props
|
|
261
275
|
});
|
|
262
|
-
const p = /*#__PURE__*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
propsAsIs: false
|
|
276
|
+
const p = props$1 => /*#__PURE__*/jsx("p", {
|
|
277
|
+
...props(layoutStyles.block),
|
|
278
|
+
...props$1
|
|
266
279
|
});
|
|
267
|
-
const ul = /*#__PURE__*/
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
propsAsIs: false
|
|
280
|
+
const ul = props$1 => /*#__PURE__*/jsx("ul", {
|
|
281
|
+
...props(layoutStyles.block),
|
|
282
|
+
...props$1
|
|
271
283
|
});
|
|
272
|
-
const ol = /*#__PURE__*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
propsAsIs: false
|
|
284
|
+
const ol = props$1 => /*#__PURE__*/jsx("ol", {
|
|
285
|
+
...props(layoutStyles.block),
|
|
286
|
+
...props$1
|
|
276
287
|
});
|
|
288
|
+
const styles = {
|
|
289
|
+
h1: {
|
|
290
|
+
keoZOQ: "timvir-s-1hpjnmm",
|
|
291
|
+
k1K539: "timvir-s-yi6m4r",
|
|
292
|
+
kGuDYH: "timvir-s-579bpy",
|
|
293
|
+
kLWn49: "timvir-s-2sqz4w",
|
|
294
|
+
k63SB2: "timvir-s-kjxd12",
|
|
295
|
+
kTHuQy: "timvir-s-zqbfd8",
|
|
296
|
+
$$css: true
|
|
297
|
+
},
|
|
298
|
+
h2: {
|
|
299
|
+
kVAEAm: "timvir-s-1n2onr6",
|
|
300
|
+
kogj98: "timvir-s-gv6dkq",
|
|
301
|
+
kGuDYH: "timvir-s-ngnso2",
|
|
302
|
+
kLWn49: "timvir-s-1gst2wd",
|
|
303
|
+
k63SB2: "timvir-s-kjxd12",
|
|
304
|
+
$$css: true
|
|
305
|
+
},
|
|
306
|
+
h3: {
|
|
307
|
+
kVAEAm: "timvir-s-1n2onr6",
|
|
308
|
+
kogj98: "timvir-s-2ijy0e",
|
|
309
|
+
kGuDYH: "timvir-s-1lkfr7t",
|
|
310
|
+
kLWn49: "timvir-s-1c40qdn",
|
|
311
|
+
k63SB2: "timvir-s-kjxd12",
|
|
312
|
+
$$css: true
|
|
313
|
+
},
|
|
314
|
+
h4: {
|
|
315
|
+
kVAEAm: "timvir-s-1n2onr6",
|
|
316
|
+
kogj98: "timvir-s-2ijy0e",
|
|
317
|
+
kGuDYH: "timvir-s-6u19be",
|
|
318
|
+
kLWn49: "timvir-s-1k2ygyi",
|
|
319
|
+
k63SB2: "timvir-s-kjxd12",
|
|
320
|
+
$$css: true
|
|
321
|
+
},
|
|
322
|
+
hr: {
|
|
323
|
+
k1xSpc: "timvir-s-1lliihq",
|
|
324
|
+
ksu8eU: "timvir-s-ng3xce",
|
|
325
|
+
kZKoxP: "timvir-s-jm9jq1",
|
|
326
|
+
kzqmXN: "timvir-s-h8yej3",
|
|
327
|
+
kWkggS: "timvir-s-twfq29",
|
|
328
|
+
kSiTet: "timvir-s-vpkmg4",
|
|
329
|
+
$$css: true
|
|
330
|
+
},
|
|
331
|
+
table: {
|
|
332
|
+
kheTzg: "timvir-s-1gukg7c",
|
|
333
|
+
kLvRdT: "timvir-s-1mwwwfo",
|
|
334
|
+
kzqmXN: "timvir-s-h8yej3",
|
|
335
|
+
kVQacm: "timvir-s-ysyzu8",
|
|
336
|
+
$$css: true
|
|
337
|
+
},
|
|
338
|
+
blockquote: {
|
|
339
|
+
koQZXg: "timvir-s-j3b58b",
|
|
340
|
+
kGuDYH: "timvir-s-1hptrd9",
|
|
341
|
+
$$css: true
|
|
342
|
+
}
|
|
343
|
+
};
|
|
277
344
|
|
|
278
345
|
export { a, blockquote, code, h1, h2, h3, h4, hr, ol, p, table, tbody, td, th, thead, tr, ul };
|