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.
Files changed (113) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/blocks/Arbitrary/Arbitrary.d.ts +1 -1
  3. package/blocks/Arbitrary/index.js +232 -78
  4. package/blocks/Arbitrary/samples/basic.d.ts +1 -1
  5. package/blocks/Arbitrary/styles.css +166 -6
  6. package/blocks/Code/Code.d.ts +0 -6
  7. package/blocks/Code/docs/index.mdx +0 -11
  8. package/blocks/Code/index.js +213 -112
  9. package/blocks/Code/samples/basic.d.ts +1 -1
  10. package/blocks/Code/samples/toggle.d.ts +1 -2
  11. package/blocks/Code/styles.css +100 -15
  12. package/blocks/ColorBar/docs/index.mdx +8 -2
  13. package/blocks/ColorBar/index.js +223 -68
  14. package/blocks/ColorBar/samples/basic.d.ts +1 -2
  15. package/blocks/ColorBar/styles.css +103 -4
  16. package/blocks/ColorBook/docs/index.mdx +1 -1
  17. package/blocks/ColorBook/index.js +222 -60
  18. package/blocks/ColorBook/samples/basic.d.ts +1 -2
  19. package/blocks/ColorBook/styles.css +166 -6
  20. package/blocks/Cover/index.js +177 -48
  21. package/blocks/Cover/samples/basic.d.ts +1 -2
  22. package/blocks/Cover/styles.css +18 -0
  23. package/blocks/Exhibit/index.js +205 -50
  24. package/blocks/Exhibit/samples/basic.d.ts +1 -2
  25. package/blocks/Exhibit/samples/bleed.d.ts +1 -1
  26. package/blocks/Exhibit/samples/usage.d.ts +1 -2
  27. package/blocks/Exhibit/styles.css +66 -3
  28. package/blocks/Font/index.js +239 -98
  29. package/blocks/Font/samples/basic.d.ts +1 -1
  30. package/blocks/Font/samples/timvir/body1.d.ts +1 -1
  31. package/blocks/Font/samples/timvir/caption.d.ts +1 -1
  32. package/blocks/Font/samples/timvir/h1.d.ts +1 -1
  33. package/blocks/Font/samples/timvir/h2.d.ts +1 -1
  34. package/blocks/Font/samples/timvir/h3.d.ts +1 -1
  35. package/blocks/Font/samples/timvir/h4.d.ts +1 -1
  36. package/blocks/Font/styles.css +82 -8
  37. package/blocks/Grid/docs/index.mdx +4 -4
  38. package/blocks/Grid/index.js +181 -36
  39. package/blocks/Grid/samples/basic.d.ts +1 -2
  40. package/blocks/Grid/styles.css +20 -1
  41. package/blocks/Icon/docs/index.mdx +13 -13
  42. package/blocks/Icon/index.js +93 -100
  43. package/blocks/Icon/internal/Canvas.d.ts +1 -1
  44. package/blocks/Icon/samples/basic.d.ts +1 -2
  45. package/blocks/Icon/styles.css +117 -5
  46. package/blocks/Icon/types.d.ts +3 -2
  47. package/blocks/Message/docs/index.mdx +5 -8
  48. package/blocks/Message/index.js +238 -55
  49. package/blocks/Message/samples/basic.d.ts +1 -1
  50. package/blocks/Message/styles.css +94 -6
  51. package/blocks/Swatch/docs/index.mdx +16 -16
  52. package/blocks/Swatch/index.js +199 -45
  53. package/blocks/Swatch/samples/basic.d.ts +1 -2
  54. package/blocks/Swatch/styles.css +82 -4
  55. package/blocks/Viewport/index.js +360 -237
  56. package/blocks/Viewport/internal/Caption.d.ts +1 -1
  57. package/blocks/Viewport/internal/Handle.d.ts +1 -1
  58. package/blocks/Viewport/internal/Ruler.d.ts +1 -2
  59. package/blocks/Viewport/samples/basic.d.ts +1 -2
  60. package/blocks/Viewport/styles.css +259 -14
  61. package/blocks/WebLink/index.js +217 -62
  62. package/blocks/WebLink/samples/basic.d.ts +1 -1
  63. package/blocks/WebLink/styles.css +170 -8
  64. package/blocks/styles.css +1460 -97
  65. package/builtins/components.d.ts +2 -2
  66. package/builtins/index.js +306 -239
  67. package/builtins/styles.css +267 -14
  68. package/context/index.d.ts +6 -1
  69. package/core/components/Commands/Commands.d.ts +2 -0
  70. package/core/components/Commands/internal/Action.d.ts +1 -1
  71. package/core/components/Commands/internal/Dialog.d.ts +1 -2
  72. package/core/components/Commands/internal/index.d.ts +0 -1
  73. package/core/components/Footer/samples/basic.d.ts +1 -1
  74. package/core/components/NavigationFooter/NavigationFooter.d.ts +4 -2
  75. package/core/components/NavigationFooter/samples/basic.d.ts +1 -1
  76. package/core/components/Page/Page.d.ts +12 -3
  77. package/core/components/Page/docs/index.mdx +44 -11
  78. package/core/components/Page/internal/Section.d.ts +1 -2
  79. package/core/components/Page/internal/Sidebar.d.ts +1 -1
  80. package/core/components/Page/internal/SidebarItem.d.ts +1 -2
  81. package/core/components/Page/internal/index.d.ts +0 -1
  82. package/core/components/Page/samples/basic.d.ts +1 -2
  83. package/core/components/Page/samples/layout.d.ts +1 -2
  84. package/core/index.d.ts +191 -2
  85. package/core/index.js +674 -449
  86. package/core/layout.d.ts +40 -0
  87. package/core/styles.css +857 -88
  88. package/core/theme/detector.js +1 -1
  89. package/global.css +79 -0
  90. package/internal/cx.d.ts +1 -0
  91. package/knip.config.d.ts +5 -0
  92. package/package.json +1 -2
  93. package/search/Search/samples/basic.d.ts +1 -2
  94. package/search/index.js +2 -208
  95. package/styles.css +2670 -222
  96. package/blocks/Code/theme.d.ts +0 -2
  97. package/bus/styles.css +0 -1
  98. package/context/styles.css +0 -1
  99. package/core/theme/index.d.ts +0 -1
  100. package/hooks/styles.css +0 -1
  101. package/search/Search/internal/Dialog.d.ts +0 -20
  102. package/search/Search/internal/index.d.ts +0 -1
  103. package/search/SearchBoxInput/SearchBoxInput.d.ts +0 -11
  104. package/search/SearchBoxInput/docs/api.mdx +0 -76
  105. package/search/SearchBoxInput/docs/index.mdx +0 -6
  106. package/search/SearchBoxInput/index.d.ts +0 -1
  107. package/search/SearchBoxInput/samples/basic.d.ts +0 -2
  108. package/search/SearchBoxListItem/SearchBoxListItem.d.ts +0 -13
  109. package/search/SearchBoxListItem/docs/api.mdx +0 -76
  110. package/search/SearchBoxListItem/docs/index.mdx +0 -30
  111. package/search/SearchBoxListItem/index.d.ts +0 -1
  112. package/search/SearchBoxListItem/samples/basic.d.ts +0 -2
  113. package/search/styles.css +0 -16
@@ -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
- // 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
+ }
6
16
 
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
- }
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
- const result = [];
24
- for (const keyHash in atomicClasses) {
25
- if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
26
- 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
+ };
27
147
  }
28
- }
29
- result.push(...nonAtomicClasses);
30
- return result.join(" ");
31
- };
32
- 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
+ }
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
- return /*#__PURE__*/React.createElement(Root, {
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
- }, /*#__PURE__*/React.createElement("div", {
72
- className: "dhgsgky",
73
- style: {
74
- background: value,
75
- color: contrastValue
76
- }
77
- }, /*#__PURE__*/React.createElement("div", {
78
- className: "dobecwk"
79
- }, label && /*#__PURE__*/React.createElement("div", null, label), label === name && /*#__PURE__*/React.createElement("div", null, value)), ancestry && /*#__PURE__*/React.createElement("div", {
80
- className: "dho7t08"
81
- }, ancestry)));
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
- import * as React from "react";
2
- export default function Sample(): React.JSX.Element;
1
+ export default function Sample(): import("react/jsx-runtime").JSX.Element;
@@ -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
+ }