timvir 0.2.38 → 0.2.39
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 +9 -0
- package/blocks/Arbitrary/index.js +46 -37
- package/blocks/Arbitrary/samples/basic.d.ts +1 -1
- package/blocks/Code/index.js +56 -48
- package/blocks/Code/samples/basic.d.ts +1 -1
- package/blocks/Code/samples/toggle.d.ts +1 -2
- package/blocks/Code/styles.css +3 -3
- package/blocks/ColorBar/index.js +33 -29
- package/blocks/ColorBar/samples/basic.d.ts +1 -2
- package/blocks/ColorBook/index.js +29 -26
- package/blocks/ColorBook/samples/basic.d.ts +1 -2
- package/blocks/Cover/index.js +18 -18
- package/blocks/Cover/samples/basic.d.ts +1 -2
- package/blocks/Exhibit/index.js +16 -12
- 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 +1 -1
- package/blocks/Font/index.js +67 -56
- 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/Grid/index.js +5 -3
- package/blocks/Grid/samples/basic.d.ts +1 -2
- package/blocks/Icon/index.js +72 -61
- package/blocks/Icon/internal/Canvas.d.ts +1 -1
- package/blocks/Icon/samples/basic.d.ts +1 -2
- package/blocks/Icon/types.d.ts +3 -2
- package/blocks/Message/index.js +21 -17
- package/blocks/Message/samples/basic.d.ts +1 -1
- package/blocks/Swatch/index.js +22 -13
- package/blocks/Swatch/samples/basic.d.ts +1 -2
- package/blocks/Viewport/index.js +206 -190
- 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/WebLink/index.js +34 -23
- package/blocks/WebLink/samples/basic.d.ts +1 -1
- package/blocks/WebLink/styles.css +1 -1
- package/blocks/styles.css +5 -5
- package/builtins/index.d.ts +1 -0
- package/builtins/index.js +37 -27
- package/builtins/styles.css +13 -0
- package/core/components/Commands/Commands.d.ts +1 -3
- 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/samples/basic.d.ts +1 -1
- 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.js +363 -297
- package/core/layout.d.ts +0 -1
- package/core/theme/detector.js +1 -1
- package/knip.config.d.ts +5 -0
- package/package.json +1 -1
- package/search/Search/samples/basic.d.ts +1 -2
- package/search/SearchBoxInput/samples/basic.d.ts +1 -2
- package/search/SearchBoxListItem/samples/basic.d.ts +1 -2
- package/search/index.js +96 -81
- package/search/styles.css +3 -3
- package/styles.css +21 -8
package/blocks/Font/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { useMDXComponents } from '@mdx-js/react';
|
|
|
2
2
|
import * as builtins from 'timvir/builtins';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as Icons from 'react-feather';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
7
|
// src/css.ts
|
|
7
8
|
|
|
@@ -60,8 +61,8 @@ function Font(props, ref) {
|
|
|
60
61
|
const computedStyle = window.getComputedStyle(contentRef);
|
|
61
62
|
const intervalId = setInterval(() => {
|
|
62
63
|
if (fontSizeRef) {
|
|
63
|
-
const fontSize = parseInt(computedStyle.fontSize, 10);
|
|
64
|
-
const lineHeight = parseInt(computedStyle.lineHeight, 10);
|
|
64
|
+
const fontSize = Number.parseInt(computedStyle.fontSize, 10);
|
|
65
|
+
const lineHeight = Number.parseInt(computedStyle.lineHeight, 10);
|
|
65
66
|
const innerText = `${name} – ${Math.round(fontSize)}px / ${Math.round(lineHeight / fontSize * 1000) / 1000}`;
|
|
66
67
|
if (fontSizeRef.innerText !== innerText) {
|
|
67
68
|
fontSizeRef.innerText = innerText;
|
|
@@ -72,64 +73,74 @@ function Font(props, ref) {
|
|
|
72
73
|
clearInterval(intervalId);
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
|
-
}, [name, contentRef]);
|
|
76
|
-
return /*#__PURE__*/
|
|
76
|
+
}, [name, contentRef, fontSizeRef]);
|
|
77
|
+
return /*#__PURE__*/jsxs(Root, {
|
|
77
78
|
ref: ref,
|
|
78
79
|
className: cx_default(className),
|
|
79
|
-
...rest
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
...rest,
|
|
81
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
82
|
+
className: classes.meta,
|
|
83
|
+
children: [/*#__PURE__*/jsx(components.h3, {
|
|
84
|
+
className: "fc7ivp5",
|
|
85
|
+
children: /*#__PURE__*/jsx("span", {
|
|
86
|
+
ref: setFontSizeRef,
|
|
87
|
+
children: name
|
|
88
|
+
})
|
|
89
|
+
}), info && /*#__PURE__*/jsx("div", {
|
|
90
|
+
className: "de58upx",
|
|
91
|
+
onClick: () => {
|
|
92
|
+
if (infoRef && contentRef) {
|
|
93
|
+
// const contentParent = contentRef.parentElement;
|
|
94
|
+
const infoParent = infoRef.parentElement;
|
|
95
|
+
if (infoParent.style.height === "0px") {
|
|
96
|
+
infoParent.style.height = `${infoRef.getBoundingClientRect().height}px`;
|
|
97
|
+
infoParent.style.opacity = "1";
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
// contentParent.style.height = "0px";
|
|
100
|
+
// contentParent.style.opacity = "0";
|
|
101
|
+
} else {
|
|
102
|
+
infoParent.style.height = "0px";
|
|
103
|
+
infoParent.style.opacity = "0";
|
|
101
104
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
105
|
+
// contentParent.style.height = window.getComputedStyle(contentRef).height;
|
|
106
|
+
// contentParent.style.opacity = "1";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
children: /*#__PURE__*/jsx(Icons.Info, {
|
|
111
|
+
size: "1.1em"
|
|
112
|
+
})
|
|
113
|
+
})]
|
|
114
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
115
|
+
className: "d10949ho",
|
|
116
|
+
children: [info && /*#__PURE__*/jsx("div", {
|
|
117
|
+
className: "d1o2du3z",
|
|
118
|
+
style: {
|
|
119
|
+
height: 0,
|
|
120
|
+
opacity: 0
|
|
121
|
+
},
|
|
122
|
+
children: /*#__PURE__*/jsx("div", {
|
|
123
|
+
ref: setInfoRef,
|
|
124
|
+
className: "d1o9zhgl",
|
|
125
|
+
children: info
|
|
126
|
+
})
|
|
127
|
+
}), /*#__PURE__*/jsx("div", {
|
|
128
|
+
className: "ddlplux",
|
|
129
|
+
style: {
|
|
130
|
+
height: "auto",
|
|
131
|
+
opacity: 1
|
|
132
|
+
},
|
|
133
|
+
children: /*#__PURE__*/jsx("div", {
|
|
134
|
+
ref: setContentRef,
|
|
135
|
+
contentEditable: true,
|
|
136
|
+
spellCheck: "false",
|
|
137
|
+
className: cx_default(font.className, "dw285p4"),
|
|
138
|
+
style: font.style,
|
|
139
|
+
children: children || "The quick brown fox jumps over the lazy dog"
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
133
144
|
}
|
|
134
145
|
var Font$1 = /*#__PURE__*/React.forwardRef(Font);
|
|
135
146
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "../..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "../..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "../..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "../..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "../..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Font } from "../..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Font>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
package/blocks/Grid/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
// src/css.ts
|
|
4
5
|
|
|
@@ -39,11 +40,12 @@ function Grid(props, ref) {
|
|
|
39
40
|
className,
|
|
40
41
|
...rest
|
|
41
42
|
} = props;
|
|
42
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/jsx(Root, {
|
|
43
44
|
ref: ref,
|
|
44
45
|
className: cx_default(className, classes.root),
|
|
45
|
-
...rest
|
|
46
|
-
|
|
46
|
+
...rest,
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
47
49
|
}
|
|
48
50
|
var Grid$1 = /*#__PURE__*/React.forwardRef(Grid);
|
|
49
51
|
const classes = {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
package/blocks/Icon/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useResizeObserverEntry } from 'timvir/hooks';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
4
|
|
|
4
5
|
// src/css.ts
|
|
5
6
|
|
|
@@ -42,23 +43,25 @@ function Canvas(props) {
|
|
|
42
43
|
size,
|
|
43
44
|
Component
|
|
44
45
|
} = props;
|
|
45
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/jsxs(Root$1, {
|
|
46
47
|
className: "r1bcczis",
|
|
47
48
|
style: {
|
|
48
49
|
width,
|
|
49
50
|
height
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
},
|
|
52
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
53
|
+
className: classes$1.backdrop
|
|
54
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
55
|
+
className: classes$1.grid,
|
|
56
|
+
size: size
|
|
57
|
+
}), /*#__PURE__*/jsx("div", {
|
|
58
|
+
style: {
|
|
59
|
+
fontSize: `${size}px`,
|
|
60
|
+
zIndex: 1
|
|
61
|
+
},
|
|
62
|
+
children: /*#__PURE__*/jsx(Component, {})
|
|
63
|
+
})]
|
|
64
|
+
});
|
|
62
65
|
}
|
|
63
66
|
function Grid({
|
|
64
67
|
size,
|
|
@@ -70,47 +73,50 @@ function Grid({
|
|
|
70
73
|
const Corner = ({
|
|
71
74
|
dx,
|
|
72
75
|
dy
|
|
73
|
-
}) => /*#__PURE__*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
}) => /*#__PURE__*/jsxs("g", {
|
|
77
|
+
children: [/*#__PURE__*/jsx("line", {
|
|
78
|
+
x1: dx(center, halfSize),
|
|
79
|
+
x2: dx(center, halfSize + whiskerLength),
|
|
80
|
+
y1: dy(center, halfSize),
|
|
81
|
+
y2: dy(center, halfSize),
|
|
82
|
+
strokeWidth: 1,
|
|
83
|
+
stroke: "#EEEEEE"
|
|
84
|
+
}), /*#__PURE__*/jsx("line", {
|
|
85
|
+
x1: dx(center, halfSize),
|
|
86
|
+
x2: dx(center, halfSize),
|
|
87
|
+
y1: dy(center, halfSize),
|
|
88
|
+
y2: dy(center, halfSize + whiskerLength),
|
|
89
|
+
strokeWidth: 1,
|
|
90
|
+
stroke: "#EEEEEE"
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
88
93
|
const add = (a, b) => a + b;
|
|
89
94
|
const sub = (a, b) => a - b;
|
|
90
|
-
return /*#__PURE__*/
|
|
95
|
+
return /*#__PURE__*/jsxs("svg", {
|
|
91
96
|
width: "120",
|
|
92
97
|
height: "120",
|
|
93
98
|
viewBox: "0 0 120 120",
|
|
94
|
-
...rest
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
99
|
+
...rest,
|
|
100
|
+
children: [/*#__PURE__*/jsx("rect", {
|
|
101
|
+
x: center - halfSize,
|
|
102
|
+
y: center - halfSize,
|
|
103
|
+
width: size,
|
|
104
|
+
height: size,
|
|
105
|
+
fill: "#FFBBFF88"
|
|
106
|
+
}), /*#__PURE__*/jsx(Corner, {
|
|
107
|
+
dx: sub,
|
|
108
|
+
dy: sub
|
|
109
|
+
}), /*#__PURE__*/jsx(Corner, {
|
|
110
|
+
dx: add,
|
|
111
|
+
dy: sub
|
|
112
|
+
}), /*#__PURE__*/jsx(Corner, {
|
|
113
|
+
dx: add,
|
|
114
|
+
dy: add
|
|
115
|
+
}), /*#__PURE__*/jsx(Corner, {
|
|
116
|
+
dx: sub,
|
|
117
|
+
dy: add
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
/**
|
|
@@ -128,20 +134,25 @@ function Icon(props, ref) {
|
|
|
128
134
|
} = props;
|
|
129
135
|
const [roRef, roe] = useResizeObserverEntry();
|
|
130
136
|
const width = roe?.contentRect.width;
|
|
131
|
-
return /*#__PURE__*/
|
|
137
|
+
return /*#__PURE__*/jsx(Root, {
|
|
132
138
|
ref: ref,
|
|
133
139
|
className: cx_default(className, "r1k0w618"),
|
|
134
|
-
...rest
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
...rest,
|
|
141
|
+
children: /*#__PURE__*/jsx("div", {
|
|
142
|
+
ref: roRef,
|
|
143
|
+
children: width !== undefined && /*#__PURE__*/jsxs(Fragment, {
|
|
144
|
+
children: [/*#__PURE__*/jsx(Canvas, {
|
|
145
|
+
width: width,
|
|
146
|
+
height: width,
|
|
147
|
+
size: 32 /*descriptor.instances[0].size as number */,
|
|
148
|
+
Component: descriptor.instances[0].Component
|
|
149
|
+
}), /*#__PURE__*/jsx("div", {
|
|
150
|
+
className: classes.name,
|
|
151
|
+
children: descriptor.name
|
|
152
|
+
})]
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
});
|
|
145
156
|
}
|
|
146
157
|
var Icon$1 = /*#__PURE__*/React.forwardRef(Icon);
|
|
147
158
|
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|
package/blocks/Icon/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type Size = "responsive" | number;
|
|
2
|
+
interface Instance {
|
|
3
3
|
size: Size;
|
|
4
4
|
Component: React.ElementType;
|
|
5
5
|
}
|
|
@@ -7,3 +7,4 @@ export interface Descriptor {
|
|
|
7
7
|
name: string;
|
|
8
8
|
instances: Instance[];
|
|
9
9
|
}
|
|
10
|
+
export {};
|
package/blocks/Message/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as Icons from 'react-feather';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
4
|
|
|
4
5
|
// src/css.ts
|
|
5
6
|
|
|
@@ -41,25 +42,28 @@ function Message(props, ref) {
|
|
|
41
42
|
children,
|
|
42
43
|
...rest
|
|
43
44
|
} = props;
|
|
44
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/jsxs(Root, {
|
|
45
46
|
ref: ref,
|
|
46
47
|
className: cx_default(className, "r1ssql2z", variant !== undefined && variantStyles[variant]),
|
|
47
|
-
...rest
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
...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
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
63
67
|
}
|
|
64
68
|
var Message$1 = /*#__PURE__*/React.forwardRef(Message);
|
|
65
69
|
const icon = "i1dz18jz";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Message } from "..";
|
|
3
3
|
type Props = Partial<React.ComponentPropsWithoutRef<typeof Message>>;
|
|
4
|
-
export default function Sample(props: Props):
|
|
4
|
+
export default function Sample(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
package/blocks/Swatch/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useBlock } from 'timvir/core';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
// src/css.ts
|
|
6
7
|
|
|
@@ -51,7 +52,7 @@ function Swatch(props, ref) {
|
|
|
51
52
|
React.useEffect(() => {
|
|
52
53
|
setLabel(name);
|
|
53
54
|
}, [name]);
|
|
54
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/jsx(Root, {
|
|
55
56
|
role: "button",
|
|
56
57
|
ref: ref,
|
|
57
58
|
...rest,
|
|
@@ -67,18 +68,26 @@ function Swatch(props, ref) {
|
|
|
67
68
|
onMouseLeave: ev => {
|
|
68
69
|
setLabel(name);
|
|
69
70
|
onMouseLeave?.(ev);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
},
|
|
72
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
73
|
+
className: "dhgsgky",
|
|
74
|
+
style: {
|
|
75
|
+
background: value,
|
|
76
|
+
color: contrastValue
|
|
77
|
+
},
|
|
78
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
79
|
+
className: "dobecwk",
|
|
80
|
+
children: [label && /*#__PURE__*/jsx("div", {
|
|
81
|
+
children: label
|
|
82
|
+
}), label === name && /*#__PURE__*/jsx("div", {
|
|
83
|
+
children: value
|
|
84
|
+
})]
|
|
85
|
+
}), ancestry && /*#__PURE__*/jsx("div", {
|
|
86
|
+
className: "dho7t08",
|
|
87
|
+
children: ancestry
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
82
91
|
}
|
|
83
92
|
var Swatch$1 = /*#__PURE__*/React.forwardRef(Swatch);
|
|
84
93
|
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function Sample(): React.JSX.Element;
|
|
1
|
+
export default function Sample(): import("react/jsx-runtime").JSX.Element;
|