@tscircuit/props 0.0.249 → 0.0.251
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/README.md +326 -313
- package/dist/index.d.ts +76 -3
- package/dist/index.js +95 -58
- package/dist/index.js.map +1 -1
- package/lib/components/schematic-cell.ts +19 -0
- package/lib/components/schematic-row.ts +15 -0
- package/lib/components/schematic-table.ts +26 -0
- package/lib/index.ts +3 -0
- package/package.json +2 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { distance } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
4
|
+
|
|
5
|
+
export const schematicCellProps = z.object({
|
|
6
|
+
children: z.string(),
|
|
7
|
+
horizontalAlign: z.enum(["left", "center", "right"]).optional(),
|
|
8
|
+
verticalAlign: z.enum(["top", "middle", "bottom"]).optional(),
|
|
9
|
+
fontSize: distance.optional(),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export interface SchematicCellProps {
|
|
13
|
+
children: string
|
|
14
|
+
horizontalAlign?: "left" | "center" | "right"
|
|
15
|
+
verticalAlign?: "top" | "middle" | "bottom"
|
|
16
|
+
fontSize?: number | string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
expectTypesMatch<SchematicCellProps, z.input<typeof schematicCellProps>>(true)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { distance } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
4
|
+
|
|
5
|
+
export const schematicRowProps = z.object({
|
|
6
|
+
children: z.any().optional(),
|
|
7
|
+
height: distance.optional(),
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export interface SchematicRowProps {
|
|
11
|
+
children?: any
|
|
12
|
+
height?: number | string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
expectTypesMatch<SchematicRowProps, z.input<typeof schematicRowProps>>(true)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { distance } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
import { ninePointAnchor } from "lib/common/ninePointAnchor"
|
|
4
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
5
|
+
|
|
6
|
+
export const schematicTableProps = z.object({
|
|
7
|
+
schX: distance.optional(),
|
|
8
|
+
schY: distance.optional(),
|
|
9
|
+
children: z.any().optional(),
|
|
10
|
+
cellPadding: distance.optional(),
|
|
11
|
+
borderWidth: distance.optional(),
|
|
12
|
+
anchor: ninePointAnchor.optional(),
|
|
13
|
+
fontSize: distance.optional(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export interface SchematicTableProps {
|
|
17
|
+
schX?: number | string
|
|
18
|
+
schY?: number | string
|
|
19
|
+
children?: any
|
|
20
|
+
cellPadding?: number | string
|
|
21
|
+
borderWidth?: number | string
|
|
22
|
+
anchor?: z.infer<typeof ninePointAnchor>
|
|
23
|
+
fontSize?: number | string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
expectTypesMatch<SchematicTableProps, z.input<typeof schematicTableProps>>(true)
|
package/lib/index.ts
CHANGED
|
@@ -59,6 +59,9 @@ export * from "./components/schematic-box"
|
|
|
59
59
|
export * from "./components/schematic-line"
|
|
60
60
|
export * from "./components/schematic-text"
|
|
61
61
|
export * from "./components/schematic-path"
|
|
62
|
+
export * from "./components/schematic-table"
|
|
63
|
+
export * from "./components/schematic-row"
|
|
64
|
+
export * from "./components/schematic-cell"
|
|
62
65
|
export * from "./components/silkscreen-text"
|
|
63
66
|
export * from "./components/silkscreen-path"
|
|
64
67
|
export * from "./components/silkscreen-line"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/props",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.251",
|
|
4
4
|
"description": "Props for tscircuit builtin component types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"expect-type": "^0.20.0",
|
|
36
36
|
"glob": "^11.0.0",
|
|
37
37
|
"madge": "^8.0.0",
|
|
38
|
+
"prettier": "^3.3.3",
|
|
38
39
|
"react": "^18.3.1",
|
|
39
40
|
"ts-expect": "^1.3.0",
|
|
40
41
|
"tsup": "^8.0.2",
|