tsquare 0.4.1 → 0.4.2
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
CHANGED
package/dist/catalog.d.ts
CHANGED
|
@@ -613,7 +613,11 @@ export declare const componentDefinitions: {
|
|
|
613
613
|
icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
614
614
|
position: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
615
615
|
bottom: "bottom";
|
|
616
|
+
bottomLeft: "bottomLeft";
|
|
617
|
+
bottomRight: "bottomRight";
|
|
616
618
|
top: "top";
|
|
619
|
+
topLeft: "topLeft";
|
|
620
|
+
topRight: "topRight";
|
|
617
621
|
}>>>;
|
|
618
622
|
}, z.core.$strip>;
|
|
619
623
|
slots: never[];
|
|
@@ -1266,7 +1270,11 @@ export declare const catalog: import("@json-render/core").Catalog<{
|
|
|
1266
1270
|
icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1267
1271
|
position: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1268
1272
|
bottom: "bottom";
|
|
1273
|
+
bottomLeft: "bottomLeft";
|
|
1274
|
+
bottomRight: "bottomRight";
|
|
1269
1275
|
top: "top";
|
|
1276
|
+
topLeft: "topLeft";
|
|
1277
|
+
topRight: "topRight";
|
|
1270
1278
|
}>>>;
|
|
1271
1279
|
}, z.core.$strip>;
|
|
1272
1280
|
slots: never[];
|
|
@@ -609,7 +609,7 @@ var componentDefinitions = {
|
|
|
609
609
|
text: o(z.string()),
|
|
610
610
|
action: o(z.string()).describe('A text button, e.g. "Undo"'),
|
|
611
611
|
icon: o(iconName),
|
|
612
|
-
position: o(z.enum(["bottom", "top"])).describe("Default bottom, above a TabBar")
|
|
612
|
+
position: o(z.enum(["bottom", "top", "topLeft", "topRight", "bottomLeft", "bottomRight"])).describe("Default bottom (centered), above a TabBar")
|
|
613
613
|
}),
|
|
614
614
|
slots: [],
|
|
615
615
|
description: "Short message over the screen, e.g. after saving. Must be a direct child of a Screen, listed last.",
|
|
@@ -1692,8 +1692,10 @@ function Drawer({ element, children }) {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
function Toast({ element, aboveTabBar }) {
|
|
1694
1694
|
const p = element.props;
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1695
|
+
const position = p.position ?? "bottom";
|
|
1696
|
+
const top = position.startsWith("top");
|
|
1697
|
+
const side = position.endsWith("Left") ? "flex-start" : position.endsWith("Right") ? "flex-end" : "center";
|
|
1698
|
+
return /* @__PURE__ */ jsx(Box, { style: { position: "absolute", left: 16, right: 16, justifyContent: side, ...top ? { top: 16 } : { bottom: aboveTabBar ? 92 : 24 } }, children: /* @__PURE__ */ jsxs(Box, { style: { alignItems: "center", gap: 12, padding: "12px 16px", borderRadius: 12, backgroundColor: theme.ink, color: theme.onPrimary, fontSize: 14, boxShadow: "0 6px 20px rgba(0,0,0,0.22)", maxWidth: 420 }, children: [
|
|
1697
1699
|
p.icon ? /* @__PURE__ */ jsx(IconGlyph, { name: p.icon, size: 18, color: theme.onPrimary }) : null,
|
|
1698
1700
|
/* @__PURE__ */ jsx(Box, { style: { flexShrink: 1 }, children: p.text ?? "" }),
|
|
1699
1701
|
p.action ? /* @__PURE__ */ jsx(Box, { style: { fontWeight: 700, marginLeft: 8, flexShrink: 0 }, children: p.action }) : null
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/dist/playground/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
renderWireframePng,
|
|
12
12
|
renderWireframeSvg,
|
|
13
13
|
wireframePrompt
|
|
14
|
-
} from "../chunks/chunk-
|
|
14
|
+
} from "../chunks/chunk-NREXWHAE.js";
|
|
15
15
|
|
|
16
16
|
// src/playground/index.ts
|
|
17
17
|
import { createServer } from "node:http";
|
|
@@ -394,7 +394,12 @@ var EXAMPLES = {
|
|
|
394
394
|
screen phone "Top"
|
|
395
395
|
heading "Profile" level=2
|
|
396
396
|
image height=160
|
|
397
|
-
toast "Changes saved" position=top
|
|
397
|
+
toast "Changes saved" position=top
|
|
398
|
+
screen desktop "Corners: topLeft, topRight, bottomLeft, bottomRight" width=900 height=420
|
|
399
|
+
heading "Dashboard" level=2
|
|
400
|
+
image height=220
|
|
401
|
+
toast "topRight" position=topRight
|
|
402
|
+
toast "bottomLeft" action="Undo" position=bottomLeft`
|
|
398
403
|
};
|
|
399
404
|
|
|
400
405
|
// src/playground/index.ts
|
package/package.json
CHANGED
|
@@ -248,4 +248,4 @@ Short message over the screen, e.g. after saving. Must be a direct child of a Sc
|
|
|
248
248
|
- text: string (main text)
|
|
249
249
|
- action: string — A text button, e.g. "Undo"
|
|
250
250
|
- icon: string — Lucide icon name in kebab-case, e.g. menu, search, arrow-left, settings, bell, user
|
|
251
|
-
- position: "bottom" | "top" — Default bottom, above a TabBar
|
|
251
|
+
- position: "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" — Default bottom (centered), above a TabBar
|