@tscircuit/props 0.0.662 → 0.0.664

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.
@@ -0,0 +1,9 @@
1
+ import { assemblySubassemblyProps } from "./subassembly"
2
+
3
+ /** Exact alias of assembly.subassembly; parsed props are identical. */
4
+ export const assemblyCadAssemblyProps = assemblySubassemblyProps
5
+
6
+ export type {
7
+ AssemblySubassemblyProps as AssemblyCadAssemblyProps,
8
+ AssemblySubassemblyPropsInput as AssemblyCadAssemblyPropsInput,
9
+ } from "./subassembly"
@@ -1,10 +1,16 @@
1
+ import { assemblyCadAssemblyProps } from "./cadassembly"
1
2
  import { assemblyDeviceProps } from "./device"
2
3
  import { assemblyScreenProps } from "./screen"
4
+ import { assemblySubassemblyProps } from "./subassembly"
3
5
 
4
6
  export * from "./device"
5
7
  export * from "./screen"
8
+ export * from "./subassembly"
9
+ export * from "./cadassembly"
6
10
 
7
11
  export const assemblyProps = {
8
12
  device: assemblyDeviceProps,
9
13
  screen: assemblyScreenProps,
14
+ subassembly: assemblySubassemblyProps,
15
+ cadassembly: assemblyCadAssemblyProps,
10
16
  } as const
@@ -0,0 +1,30 @@
1
+ import { type CadModelProp, cadModelProp } from "lib/common/cadModel"
2
+ import { expectTypesMatch } from "lib/typecheck"
3
+ import type { ReactNode } from "react"
4
+ import { z } from "zod"
5
+
6
+ export interface AssemblySubassemblyProps {
7
+ /** Stable identity used by selectors from other assembly elements. */
8
+ name: string
9
+ /** Human-facing alternate to the stable name. */
10
+ displayName?: string
11
+ /** Optional CAD geometry using the existing component cadModel formats. */
12
+ cadModel?: CadModelProp
13
+ /** Nested assembly elements or CAD geometry; preserved without parsing. */
14
+ children?: ReactNode
15
+ }
16
+
17
+ export const assemblySubassemblyProps = z.object({
18
+ name: z.string().refine((value) => value.trim().length > 0, {
19
+ message: "name cannot be empty",
20
+ }),
21
+ displayName: z.string().optional(),
22
+ cadModel: cadModelProp.optional(),
23
+ children: z.custom<ReactNode>().optional(),
24
+ })
25
+
26
+ export type AssemblySubassemblyPropsInput = z.input<
27
+ typeof assemblySubassemblyProps
28
+ >
29
+
30
+ expectTypesMatch<AssemblySubassemblyProps, AssemblySubassemblyPropsInput>(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.662",
3
+ "version": "0.0.664",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",