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,76 +1,255 @@
1
1
  import * as React from 'react';
2
2
  import * as Icons from 'react-feather';
3
+ import { layoutStyles } from 'timvir/core';
3
4
  import { jsxs, jsx } from 'react/jsx-runtime';
4
5
 
5
- // src/css.ts
6
-
7
- // src/cx.ts
8
- var cx = function cx2() {
9
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
10
- const atomicClasses = {};
11
- const nonAtomicClasses = [];
12
- presentClassNames.forEach((arg) => {
13
- const individualClassNames = arg ? arg.split(" ") : [];
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
- }
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
21
13
  });
22
- });
23
- const result = [];
24
- for (const keyHash in atomicClasses) {
25
- if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
26
- result.push(atomicClasses[keyHash]);
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
+ };
27
136
  }
28
- }
29
- result.push(...nonAtomicClasses);
30
- return result.join(" ");
31
- };
32
- var cx_default = cx;
137
+ var styleq$1 = styleq.styleq = createStyleq();
138
+ styleq$1.factory = createStyleq;
139
+ return styleq;
140
+ }
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;
147
+ }
148
+ if (style != null && Object.keys(style).length > 0) {
149
+ result.style = style;
150
+ }
151
+ if (dataStyleSrc != null && dataStyleSrc !== '') {
152
+ result['data-style-src'] = dataStyleSrc;
153
+ }
154
+ return result;
155
+ }
33
156
 
34
- /**
35
- * The underlying DOM element which is rendered by this component.
36
- */
37
157
  const Root = "div";
38
- function Message(props, ref) {
158
+ function Message(props$1, ref) {
39
159
  const {
40
160
  variant,
41
- className,
42
161
  children,
43
162
  ...rest
44
- } = props;
163
+ } = props$1;
45
164
  return /*#__PURE__*/jsxs(Root, {
46
165
  ref: ref,
47
- className: cx_default(className, "r1ssql2z", variant !== undefined && variantStyles[variant]),
166
+ ...props(layoutStyles.block, styles.root, variant && styles[variant]),
48
167
  ...rest,
49
- children: [variant && /*#__PURE__*/jsx("div", {
50
- className: icon,
51
- children: {
52
- info: /*#__PURE__*/jsx(Icons.ChevronsRight, {
53
- size: "1.5em"
54
- }),
55
- warning: /*#__PURE__*/jsx(Icons.AlertCircle, {
56
- size: "1.5em"
57
- }),
58
- alert: /*#__PURE__*/jsx(Icons.XOctagon, {
59
- size: "1.5em"
60
- })
61
- }[variant]
62
- }), /*#__PURE__*/jsx("div", {
63
- className: "dhvu07f",
64
- children: children
168
+ children: [variant && {
169
+ info: /*#__PURE__*/jsx(Icons.ChevronsRight, {
170
+ className: "timvir-s-3psx0u timvir-s-1lliihq timvir-s-1n2onr6 timvir-s-xk6nc9 timvir-s-jvto2c timvir-s-dpf0h8 timvir-s-ozkzq6 timvir-s-1h1xus1"
171
+ }),
172
+ warning: /*#__PURE__*/jsx(Icons.AlertCircle, {
173
+ className: "timvir-s-3psx0u timvir-s-1lliihq timvir-s-1n2onr6 timvir-s-xk6nc9 timvir-s-jvto2c timvir-s-dpf0h8 timvir-s-ozkzq6 timvir-s-4u77bm"
174
+ }),
175
+ alert: /*#__PURE__*/jsx(Icons.XOctagon, {
176
+ className: "timvir-s-3psx0u timvir-s-1lliihq timvir-s-1n2onr6 timvir-s-xk6nc9 timvir-s-jvto2c timvir-s-dpf0h8 timvir-s-ozkzq6 timvir-s-1mz1spe"
177
+ })
178
+ }[variant], /*#__PURE__*/jsx("div", {
179
+ children: React.Children.toArray(children).map((child, index, array) => {
180
+ if (/*#__PURE__*/React.isValidElement(child)) {
181
+ const style = {
182
+ marginTop: index === 0 ? "0" : undefined,
183
+ marginBottom: index === array.length - 1 ? "0" : undefined
184
+ };
185
+ if (Object.keys(style).length > 0) {
186
+ const props = child.props;
187
+ return /*#__PURE__*/React.cloneElement(child, {
188
+ style: {
189
+ ...props?.style,
190
+ ...style
191
+ }
192
+ });
193
+ }
194
+ return child;
195
+ }
196
+ return child;
197
+ })
65
198
  })]
66
199
  });
67
200
  }
68
201
  var Message$1 = /*#__PURE__*/React.forwardRef(Message);
69
- const icon = "i1dz18jz";
70
- const variantStyles = {
71
- info: "i41wipx",
72
- warning: "wi7iy6",
73
- alert: "a1d5oxsn"
202
+ const styles = {
203
+ root: {
204
+ kVAEAm: "timvir-s-1n2onr6",
205
+ kWkggS: "timvir-s-m75j3u",
206
+ kMwMTN: "timvir-s-1mqxbix",
207
+ kaIpWk: "timvir-s-18zih8k",
208
+ kmVPX3: "timvir-s-qb5aye",
209
+ kGVxlE: "timvir-s-1w911z",
210
+ k1xSpc: "timvir-s-78zum5",
211
+ kGNEyG: "timvir-s-1cy8zhl",
212
+ kGuDYH: "timvir-s-kpwil5",
213
+ kLWn49: "timvir-s-1evy7pa",
214
+ $$css: true
215
+ },
216
+ icon: {
217
+ kUk6DE: "timvir-s-3psx0u",
218
+ k1xSpc: "timvir-s-1lliihq",
219
+ kVAEAm: "timvir-s-1n2onr6",
220
+ k87sOh: "timvir-s-xk6nc9",
221
+ kogj98: "timvir-s-jvto2c",
222
+ kzqmXN: "timvir-s-dpf0h8",
223
+ kZKoxP: "timvir-s-ozkzq6",
224
+ $$css: true
225
+ },
226
+ info: {
227
+ kWkggS: "timvir-s-1a1mm2c",
228
+ kMwMTN: "timvir-s-1mqxbix",
229
+ $$css: true
230
+ },
231
+ warning: {
232
+ kWkggS: "timvir-s-1nd4xj2",
233
+ kMwMTN: "timvir-s-1mqxbix",
234
+ $$css: true
235
+ },
236
+ alert: {
237
+ kWkggS: "timvir-s-18vcsbs",
238
+ kMwMTN: "timvir-s-1mqxbix",
239
+ $$css: true
240
+ },
241
+ iconInfo: {
242
+ kMwMTN: "timvir-s-1h1xus1",
243
+ $$css: true
244
+ },
245
+ iconWarning: {
246
+ kMwMTN: "timvir-s-4u77bm",
247
+ $$css: true
248
+ },
249
+ iconAlert: {
250
+ kMwMTN: "timvir-s-1mz1spe",
251
+ $$css: true
252
+ }
74
253
  };
75
254
 
76
255
  export { Message$1 as Message };
@@ -1,7 +1,95 @@
1
- .r1ssql2z{position:relative;background:var(--c-p-0);color:black;border-radius:3px;padding:16px 24px 16px 24px;box-shadow:inset 0 0 0 1px rgba(16, 22, 26, 0.2);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;font-size:0.875rem;line-height:1.5;}
2
- .dhvu07f>*:first-child{margin-top:0;}.dhvu07f>*:last-child{margin-bottom:0;}.dhvu07f>h3:before{display:none;}
3
- .i1dz18jz{position:relative;top:3px;margin:-2px 12px 0 -4px;}.i1dz18jz>svg{display:block;}
4
- .i41wipx{background:#f0f2fc;color:black;}.i41wipx .i1dz18jz{color:#2a47d5;}
5
- .wi7iy6{background:#fcf9f0;color:black;}.wi7iy6 .i1dz18jz{color:#a68521;}
6
- .a1d5oxsn{background:#fcf0f0;color:black;}.a1d5oxsn .i1dz18jz{color:#da4444;}
1
+ @layer priority1 {
2
+ .timvir-s-jvto2c {
3
+ margin: -2px 12px 0 -4px;
4
+ }
7
5
 
6
+ .timvir-s-qb5aye {
7
+ padding: 16px 24px;
8
+ }
9
+ }
10
+
11
+ @layer priority2 {
12
+ .timvir-s-18zih8k {
13
+ border-radius: 3px;
14
+ }
15
+
16
+ .timvir-s-3psx0u {
17
+ flex: none;
18
+ }
19
+ }
20
+
21
+ @layer priority3 {
22
+ .timvir-s-1cy8zhl {
23
+ align-items: flex-start;
24
+ }
25
+
26
+ .timvir-s-1a1mm2c {
27
+ background-color: #f0f2fc;
28
+ }
29
+
30
+ .timvir-s-18vcsbs {
31
+ background-color: #fcf0f0;
32
+ }
33
+
34
+ .timvir-s-1nd4xj2 {
35
+ background-color: #fcf9f0;
36
+ }
37
+
38
+ .timvir-s-m75j3u {
39
+ background-color: var(--c-p-0);
40
+ }
41
+
42
+ .timvir-s-1w911z {
43
+ box-shadow: inset 0 0 0 1px #10161a33;
44
+ }
45
+
46
+ .timvir-s-1h1xus1 {
47
+ color: #2a47d5;
48
+ }
49
+
50
+ .timvir-s-4u77bm {
51
+ color: #a68521;
52
+ }
53
+
54
+ .timvir-s-1mz1spe {
55
+ color: #da4444;
56
+ }
57
+
58
+ .timvir-s-1mqxbix {
59
+ color: #000;
60
+ }
61
+
62
+ .timvir-s-1lliihq {
63
+ display: block;
64
+ }
65
+
66
+ .timvir-s-78zum5 {
67
+ display: flex;
68
+ }
69
+
70
+ .timvir-s-kpwil5 {
71
+ font-size: .875rem;
72
+ }
73
+
74
+ .timvir-s-1evy7pa {
75
+ line-height: 1.5;
76
+ }
77
+
78
+ .timvir-s-1n2onr6 {
79
+ position: relative;
80
+ }
81
+ }
82
+
83
+ @layer priority4 {
84
+ .timvir-s-ozkzq6 {
85
+ height: 1.5em;
86
+ }
87
+
88
+ .timvir-s-xk6nc9 {
89
+ top: 3px;
90
+ }
91
+
92
+ .timvir-s-dpf0h8 {
93
+ width: 1.5em;
94
+ }
95
+ }
@@ -5,35 +5,35 @@ import { Grid } from "../../Grid";
5
5
  # Swatch
6
6
 
7
7
  <Exhibit caption="Plain color" style={{ marginBottom: 24 }}>
8
- <Swatch value="#FF00FF" />
8
+ <Swatch value="#FF00FF" style={{ margin: 0 }} />
9
9
  </Exhibit>
10
10
 
11
11
  <Exhibit caption="Give the color a meaningful name" style={{ marginBottom: 24 }}>
12
- <Swatch value="#FF00FF" name="Primary" />
12
+ <Swatch value="#FF00FF" name="Primary" style={{ margin: 0 }} />
13
13
  </Exhibit>
14
14
 
15
15
  <Exhibit caption="Add a note about its ancenstry (how or where from it was derived)" style={{ marginBottom: 24 }}>
16
- <Swatch value="#FF00FF" name="Primary" ancestry="Red 700" />
16
+ <Swatch value="#FF00FF" name="Primary" ancestry="Red 700" style={{ margin: 0 }} />
17
17
  </Exhibit>
18
18
 
19
19
  ## In a Grid
20
20
 
21
21
  <Grid style={{ gridGap: 6 }}>
22
- <Swatch value="#0E5A8A" contrastValue="#FFFFFF" name="@blue1" />
23
- <Swatch value="#106BA3" contrastValue="#FFFFFF" name="@blue2" />
24
- <Swatch value="#137CBD" contrastValue="#FFFFFF" name="@blue3" />
25
- <Swatch value="#2B95D6" contrastValue="#000000" name="@blue4" />
26
- <Swatch value="#48AFF0" contrastValue="#000000" name="@blue5" />
22
+ <Swatch value="#0E5A8A" contrastValue="#FFFFFF" name="@blue1" style={{ margin: 0, gridColumn: "initial" }} />
23
+ <Swatch value="#106BA3" contrastValue="#FFFFFF" name="@blue2" style={{ margin: 0, gridColumn: "initial" }} />
24
+ <Swatch value="#137CBD" contrastValue="#FFFFFF" name="@blue3" style={{ margin: 0, gridColumn: "initial" }} />
25
+ <Swatch value="#2B95D6" contrastValue="#000000" name="@blue4" style={{ margin: 0, gridColumn: "initial" }} />
26
+ <Swatch value="#48AFF0" contrastValue="#000000" name="@blue5" style={{ margin: 0, gridColumn: "initial" }} />
27
27
  </Grid>
28
28
 
29
29
  ## Another example
30
30
 
31
- <div style={{display: "grid", gridGap: 6 }}>
32
- <Swatch value="#F58221" name="Access" ancestry="Orange 300" />
33
- <Swatch value="#D9418D" name="Use" ancestry="Red 500" />
34
- <Swatch value="#B87AF2" name="Innovation" ancestry="Violett 500" />
35
- <Swatch value="#4188D9" name="Jobs" ancestry="Blue 500" />
36
- <Swatch value="#4AE6CC" name="Society" ancestry="…" />
37
- <Swatch value="#1FD35B" name="Trust" ancestry="Green 400" />
38
- <Swatch value="#C4D534" name="Market Openness" ancestry="…" />
31
+ <div style={{ gridColumn: "lc / rc", display: "grid", gridGap: 6 }}>
32
+ <Swatch value="#F58221" name="Access" ancestry="Orange 300" style={{ margin: 0, gridColumn: "initial" }} />
33
+ <Swatch value="#D9418D" name="Use" ancestry="Red 500" style={{ margin: 0, gridColumn: "initial" }} />
34
+ <Swatch value="#B87AF2" name="Innovation" ancestry="Violett 500" style={{ margin: 0, gridColumn: "initial" }} />
35
+ <Swatch value="#4188D9" name="Jobs" ancestry="Blue 500" style={{ margin: 0, gridColumn: "initial" }} />
36
+ <Swatch value="#4AE6CC" name="Society" ancestry="…" style={{ margin: 0, gridColumn: "initial" }} />
37
+ <Swatch value="#1FD35B" name="Trust" ancestry="Green 400" style={{ margin: 0, gridColumn: "initial" }} />
38
+ <Swatch value="#C4D534" name="Market Openness" ancestry="…" style={{ margin: 0, gridColumn: "initial" }} />
39
39
  </div>