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.
Files changed (73) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/blocks/Arbitrary/Arbitrary.d.ts +1 -1
  3. package/blocks/Arbitrary/index.js +193 -48
  4. package/blocks/Arbitrary/styles.css +166 -6
  5. package/blocks/Code/Code.d.ts +0 -6
  6. package/blocks/Code/docs/index.mdx +0 -11
  7. package/blocks/Code/index.js +205 -112
  8. package/blocks/Code/styles.css +100 -15
  9. package/blocks/ColorBar/docs/index.mdx +8 -2
  10. package/blocks/ColorBar/index.js +198 -47
  11. package/blocks/ColorBar/styles.css +103 -4
  12. package/blocks/ColorBook/docs/index.mdx +1 -1
  13. package/blocks/ColorBook/index.js +198 -39
  14. package/blocks/ColorBook/styles.css +166 -6
  15. package/blocks/Cover/index.js +165 -36
  16. package/blocks/Cover/styles.css +18 -0
  17. package/blocks/Exhibit/index.js +192 -41
  18. package/blocks/Exhibit/styles.css +66 -3
  19. package/blocks/Font/index.js +188 -58
  20. package/blocks/Font/styles.css +82 -8
  21. package/blocks/Grid/docs/index.mdx +4 -4
  22. package/blocks/Grid/index.js +176 -33
  23. package/blocks/Grid/styles.css +20 -1
  24. package/blocks/Icon/docs/index.mdx +13 -13
  25. package/blocks/Icon/index.js +25 -43
  26. package/blocks/Icon/styles.css +117 -5
  27. package/blocks/Message/docs/index.mdx +5 -8
  28. package/blocks/Message/index.js +233 -54
  29. package/blocks/Message/styles.css +94 -6
  30. package/blocks/Swatch/docs/index.mdx +16 -16
  31. package/blocks/Swatch/index.js +180 -35
  32. package/blocks/Swatch/styles.css +82 -4
  33. package/blocks/Viewport/index.js +198 -91
  34. package/blocks/Viewport/styles.css +259 -14
  35. package/blocks/WebLink/index.js +192 -48
  36. package/blocks/WebLink/styles.css +170 -8
  37. package/blocks/styles.css +1460 -97
  38. package/builtins/components.d.ts +2 -2
  39. package/builtins/index.d.ts +0 -1
  40. package/builtins/index.js +300 -243
  41. package/builtins/styles.css +265 -25
  42. package/context/index.d.ts +6 -1
  43. package/core/components/Commands/Commands.d.ts +5 -1
  44. package/core/components/NavigationFooter/NavigationFooter.d.ts +4 -2
  45. package/core/components/Page/Page.d.ts +12 -3
  46. package/core/components/Page/docs/index.mdx +44 -11
  47. package/core/index.d.ts +191 -2
  48. package/core/index.js +415 -256
  49. package/core/layout.d.ts +41 -0
  50. package/core/styles.css +857 -88
  51. package/global.css +79 -0
  52. package/internal/cx.d.ts +1 -0
  53. package/package.json +1 -2
  54. package/search/index.js +2 -223
  55. package/styles.css +2670 -235
  56. package/blocks/Code/theme.d.ts +0 -2
  57. package/bus/styles.css +0 -1
  58. package/context/styles.css +0 -1
  59. package/core/theme/index.d.ts +0 -1
  60. package/hooks/styles.css +0 -1
  61. package/search/Search/internal/Dialog.d.ts +0 -20
  62. package/search/Search/internal/index.d.ts +0 -1
  63. package/search/SearchBoxInput/SearchBoxInput.d.ts +0 -11
  64. package/search/SearchBoxInput/docs/api.mdx +0 -76
  65. package/search/SearchBoxInput/docs/index.mdx +0 -6
  66. package/search/SearchBoxInput/index.d.ts +0 -1
  67. package/search/SearchBoxInput/samples/basic.d.ts +0 -1
  68. package/search/SearchBoxListItem/SearchBoxListItem.d.ts +0 -13
  69. package/search/SearchBoxListItem/docs/api.mdx +0 -76
  70. package/search/SearchBoxListItem/docs/index.mdx +0 -30
  71. package/search/SearchBoxListItem/index.d.ts +0 -1
  72. package/search/SearchBoxListItem/samples/basic.d.ts +0 -1
  73. package/search/styles.css +0 -16
@@ -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
- // 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
+ }
7
16
 
8
- // src/cx.ts
9
- var cx = function cx2() {
10
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
11
- const atomicClasses = {};
12
- const nonAtomicClasses = [];
13
- presentClassNames.forEach((arg) => {
14
- const individualClassNames = arg ? arg.split(" ") : [];
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
- const result = [];
25
- for (const keyHash in atomicClasses) {
26
- if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
27
- 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
+ };
28
147
  }
29
- }
30
- result.push(...nonAtomicClasses);
31
- return result.join(" ");
32
- };
33
- 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
+ }
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
- className: "dhgsgky",
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: "dobecwk",
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: "dho7t08",
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 };
@@ -1,5 +1,83 @@
1
- .r19bcggb{position:relative;}.r19bcggb>div{border-radius:2px;}.r19bcggb:hover>div{top:-4px;right:-4px;bottom:-4px;left:-4px;box-shadow:inset 0 0 0 1px rgba(16, 22, 26, 0.2),0 2px 4px rgba(16, 22, 26, 0.1),0 8px 24px rgba(16, 22, 26, 0.2);padding:0px 16px;z-index:2;}.r19bcggb:active>div{top:-2px;right:-2px;bottom:-2px;left:-2px;box-shadow:inset 0 0 0 1px rgba(16, 22, 26, 0.2),0 1px 1px rgba(16, 22, 26, 0.2);padding:0px 14px;z-index:2;}
2
- .dhgsgky{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-transition:all 0.16s;transition:all 0.16s;padding:0px 12px;cursor:pointer;}
3
- .dobecwk{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;line-height:1;}
4
- .dho7t08{padding-top:6px;opacity:0.5;font-size:0.8em;line-height:1;}
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
+ }