@tscircuit/props 0.0.577 → 0.0.579

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.
@@ -13,23 +13,15 @@ export interface NetLabelProps {
13
13
  anchorSide?: "left" | "top" | "right" | "bottom"
14
14
  }
15
15
 
16
- export const netLabelProps = z
17
- .object({
18
- net: z.string().optional(),
19
- connection: z.string().optional(),
20
- connectsTo: z.string().or(z.array(z.string())).optional(),
21
- schX: distance.optional(),
22
- schY: distance.optional(),
23
- schRotation: rotation.optional(),
24
- anchorSide: z.enum(["left", "top", "right", "bottom"]).optional(),
25
- })
26
- .refine(
27
- (props) => props.net === undefined || props.connection === undefined,
28
- {
29
- message: "net and connection cannot be provided together",
30
- path: ["connection"],
31
- },
32
- )
16
+ export const netLabelProps = z.object({
17
+ net: z.string().optional(),
18
+ connection: z.string().optional(),
19
+ connectsTo: z.string().or(z.array(z.string())).optional(),
20
+ schX: distance.optional(),
21
+ schY: distance.optional(),
22
+ schRotation: rotation.optional(),
23
+ anchorSide: z.enum(["left", "top", "right", "bottom"]).optional(),
24
+ })
33
25
 
34
26
  type InferredNetLabelProps = z.input<typeof netLabelProps>
35
27
  expectTypesMatch<NetLabelProps, InferredNetLabelProps>(true)
@@ -0,0 +1,24 @@
1
+ import { type Distance, distance } from "lib/common/distance"
2
+ import { expectTypesMatch } from "lib/typecheck"
3
+ import { z } from "zod"
4
+
5
+ export interface EnclosureFdmBoxProps {
6
+ /** The name or selector of the board enclosed by this box. */
7
+ boardRef: string
8
+ width?: Distance
9
+ height?: Distance
10
+ depth?: Distance
11
+ wallThickness?: Distance
12
+ }
13
+
14
+ export const enclosureFdmBoxProps = z.object({
15
+ boardRef: z.string().min(1),
16
+ width: distance.optional(),
17
+ height: distance.optional(),
18
+ depth: distance.optional(),
19
+ wallThickness: distance.default("2mm"),
20
+ })
21
+
22
+ export type EnclosureFdmBoxPropsInput = z.input<typeof enclosureFdmBoxProps>
23
+
24
+ expectTypesMatch<EnclosureFdmBoxProps, EnclosureFdmBoxPropsInput>(true)
@@ -0,0 +1 @@
1
+ export * from "./box"
@@ -0,0 +1,9 @@
1
+ import { enclosureFdmBoxProps } from "./fdm/box"
2
+
3
+ export * from "./fdm"
4
+
5
+ export const enclosureProps = {
6
+ fdm: {
7
+ Box: enclosureFdmBoxProps,
8
+ },
9
+ } as const
package/lib/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./common/direction"
2
+ export * from "./enclosure"
2
3
  export * from "./common/portHints"
3
4
  export * from "./common/layout"
4
5
  export * from "./common/pinAttributeMap"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.577",
3
+ "version": "0.0.579",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",