@tscircuit/props 0.0.12 → 0.0.14

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AnySoupElement } from '@tscircuit/soup';
2
+ import { AnySoupElementInput } from '@tscircuit/soup';
3
3
  import { ReactElement } from 'react';
4
4
  import { LayoutBuilder } from '@tscircuit/layout';
5
5
 
@@ -16,7 +16,7 @@ declare const explicitPinSideDefinition: z.ZodObject<{
16
16
  pins: number[];
17
17
  direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
18
18
  }>;
19
- type Footprint = string | ReactElement | AnySoupElement[];
19
+ type Footprint = string | ReactElement | AnySoupElementInput[];
20
20
  declare const pcbLayoutProps: z.ZodObject<{
21
21
  pcbX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
22
22
  pcbY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
@@ -436,6 +436,98 @@ declare const boardProps: z.ZodObject<{
436
436
  layout?: any;
437
437
  }>;
438
438
  type BoardProps = z.input<typeof boardProps>;
439
+ declare const distanceOrMultiplier: z.ZodUnion<[z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodEnum<["2x", "3x", "4x"]>]>;
440
+ declare const schematicPortArrangement: z.ZodUnion<[z.ZodObject<{
441
+ leftSize: z.ZodOptional<z.ZodNumber>;
442
+ topSize: z.ZodOptional<z.ZodNumber>;
443
+ rightSize: z.ZodOptional<z.ZodNumber>;
444
+ bottomSize: z.ZodOptional<z.ZodNumber>;
445
+ }, "strip", z.ZodTypeAny, {
446
+ leftSize?: number | undefined;
447
+ topSize?: number | undefined;
448
+ rightSize?: number | undefined;
449
+ bottomSize?: number | undefined;
450
+ }, {
451
+ leftSize?: number | undefined;
452
+ topSize?: number | undefined;
453
+ rightSize?: number | undefined;
454
+ bottomSize?: number | undefined;
455
+ }>, z.ZodObject<{
456
+ leftSide: z.ZodOptional<z.ZodObject<{
457
+ pins: z.ZodArray<z.ZodNumber, "many">;
458
+ direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
459
+ }, "strip", z.ZodTypeAny, {
460
+ pins: number[];
461
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
462
+ }, {
463
+ pins: number[];
464
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
465
+ }>>;
466
+ rightSide: z.ZodOptional<z.ZodObject<{
467
+ pins: z.ZodArray<z.ZodNumber, "many">;
468
+ direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
469
+ }, "strip", z.ZodTypeAny, {
470
+ pins: number[];
471
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
472
+ }, {
473
+ pins: number[];
474
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
475
+ }>>;
476
+ topSide: z.ZodOptional<z.ZodObject<{
477
+ pins: z.ZodArray<z.ZodNumber, "many">;
478
+ direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
479
+ }, "strip", z.ZodTypeAny, {
480
+ pins: number[];
481
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
482
+ }, {
483
+ pins: number[];
484
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
485
+ }>>;
486
+ bottomSide: z.ZodOptional<z.ZodObject<{
487
+ pins: z.ZodArray<z.ZodNumber, "many">;
488
+ direction: z.ZodUnion<[z.ZodLiteral<"top-to-bottom">, z.ZodLiteral<"left-to-right">, z.ZodLiteral<"bottom-to-top">, z.ZodLiteral<"right-to-left">]>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ pins: number[];
491
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
492
+ }, {
493
+ pins: number[];
494
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
495
+ }>>;
496
+ }, "strip", z.ZodTypeAny, {
497
+ leftSide?: {
498
+ pins: number[];
499
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
500
+ } | undefined;
501
+ rightSide?: {
502
+ pins: number[];
503
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
504
+ } | undefined;
505
+ topSide?: {
506
+ pins: number[];
507
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
508
+ } | undefined;
509
+ bottomSide?: {
510
+ pins: number[];
511
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
512
+ } | undefined;
513
+ }, {
514
+ leftSide?: {
515
+ pins: number[];
516
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
517
+ } | undefined;
518
+ rightSide?: {
519
+ pins: number[];
520
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
521
+ } | undefined;
522
+ topSide?: {
523
+ pins: number[];
524
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
525
+ } | undefined;
526
+ bottomSide?: {
527
+ pins: number[];
528
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
529
+ } | undefined;
530
+ }>]>;
439
531
  declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
440
532
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
441
533
  pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -551,6 +643,8 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
551
643
  direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
552
644
  } | undefined;
553
645
  }>]>;
646
+ schPinSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodEnum<["2x", "3x", "4x"]>]>, z.ZodLiteral<"auto">]>>>;
647
+ schWidth: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodEnum<["2x", "3x", "4x"]>]>, z.ZodLiteral<"auto">]>>>;
554
648
  }>, "strip", z.ZodTypeAny, {
555
649
  name: string;
556
650
  pinLabels: Record<number, string>;
@@ -577,6 +671,8 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
577
671
  direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
578
672
  } | undefined;
579
673
  };
674
+ schPinSpacing: number | "2x" | "3x" | "4x" | "auto";
675
+ schWidth: number | "2x" | "3x" | "4x" | "auto";
580
676
  pcbX?: number | undefined;
581
677
  pcbY?: number | undefined;
582
678
  pcbRotation?: number | undefined;
@@ -625,6 +721,8 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
625
721
  footprint?: Footprint | undefined;
626
722
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
627
723
  children?: any;
724
+ schPinSpacing?: string | number | undefined;
725
+ schWidth?: string | number | undefined;
628
726
  }>;
629
727
  type BugProps = z.input<typeof bugProps>;
630
728
  declare const viaProps: z.ZodObject<z.objectUtil.extendShape<{
@@ -1799,4 +1897,4 @@ declare const fabricationNotePathProps: z.ZodObject<z.objectUtil.extendShape<Omi
1799
1897
  }>;
1800
1898
  type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>;
1801
1899
 
1802
- export { type BoardProps, type BugProps, type CapacitorProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type GroupProps, type HoleProps, type InductorProps, type LedProps, type NetAliasProps, type PcbTraceProps, type PlatedHoleProps, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SupplierProps, type TraceHintProps, type TraceProps, type ViaProps, boardProps, bugProps, capacitorPins, capacitorProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, groupProps, holeProps, inductorPins, inductorProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, portHints, portProps, powerSourceProps, relativeDirection, resistorPins, resistorProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, supplierProps, traceHintProps, traceProps, viaProps };
1900
+ export { type BoardProps, type BugProps, type CapacitorProps, type CommonComponentProps, type CommonLayoutProps, type ComponentProps, type ConstrainedLayoutProps, type ConstraintProps, type DiodeProps, type FabricationNotePathProps, type FabricationNoteTextProps, type Footprint, type FootprintProps, type GroupProps, type HoleProps, type InductorProps, type LedProps, type NetAliasProps, type PcbTraceProps, type PlatedHoleProps, type PortProps, type PowerSourceProps, type ResistorProps, type SchematicBoxProps, type SchematicLineProps, type SchematicPathProps, type SchematicTextProps, type SilkscreenCircleProps, type SilkscreenLineProps, type SilkscreenPathProps, type SilkscreenRectProps, type SilkscreenTextProps, type SmtPadProps, type SupplierProps, type TraceHintProps, type TraceProps, type ViaProps, boardProps, bugProps, capacitorPins, capacitorProps, commonComponentProps, commonLayoutProps, componentProps, constrainedLayoutProps, constraintProps, diodePins, diodeProps, direction, distanceOrMultiplier, explicitPinSideDefinition, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, groupProps, holeProps, inductorPins, inductorProps, ledPins, ledProps, lrPins, lrPolarPins, netAliasProps, pcbLayoutProps, pcbTraceProps, platedHoleProps, portHints, portProps, powerSourceProps, relativeDirection, resistorPins, resistorProps, schematicBoxProps, schematicLineProps, schematicPathProps, schematicPortArrangement, schematicTextProps, silkscreenCircleProps, silkscreenLineProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, smtPadProps, supplierProps, traceHintProps, traceProps, viaProps };
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ __export(lib_exports, {
32
32
  diodePins: () => diodePins,
33
33
  diodeProps: () => diodeProps,
34
34
  direction: () => direction,
35
+ distanceOrMultiplier: () => distanceOrMultiplier,
35
36
  explicitPinSideDefinition: () => explicitPinSideDefinition,
36
37
  fabricationNotePathProps: () => fabricationNotePathProps,
37
38
  fabricationNoteTextProps: () => fabricationNoteTextProps,
@@ -57,6 +58,7 @@ __export(lib_exports, {
57
58
  schematicBoxProps: () => schematicBoxProps,
58
59
  schematicLineProps: () => schematicLineProps,
59
60
  schematicPathProps: () => schematicPathProps,
61
+ schematicPortArrangement: () => schematicPortArrangement,
60
62
  schematicTextProps: () => schematicTextProps,
61
63
  silkscreenCircleProps: () => silkscreenCircleProps,
62
64
  silkscreenLineProps: () => silkscreenLineProps,
@@ -151,21 +153,25 @@ var boardProps = import_zod.z.object({
151
153
  layout: import_zod.z.any().optional(),
152
154
  children: import_zod.z.any()
153
155
  });
156
+ var distanceOrMultiplier = import_soup.distance.or(import_zod.z.enum(["2x", "3x", "4x"]));
157
+ var schematicPortArrangement = import_zod.z.object({
158
+ leftSize: import_zod.z.number().optional(),
159
+ topSize: import_zod.z.number().optional(),
160
+ rightSize: import_zod.z.number().optional(),
161
+ bottomSize: import_zod.z.number().optional()
162
+ }).or(
163
+ import_zod.z.object({
164
+ leftSide: explicitPinSideDefinition.optional(),
165
+ rightSide: explicitPinSideDefinition.optional(),
166
+ topSide: explicitPinSideDefinition.optional(),
167
+ bottomSide: explicitPinSideDefinition.optional()
168
+ })
169
+ );
154
170
  var bugProps = commonComponentProps.extend({
155
171
  pinLabels: import_zod.z.record(import_zod.z.number(), import_zod.z.string()),
156
- schPortArrangement: import_zod.z.object({
157
- leftSize: import_zod.z.number().optional(),
158
- topSize: import_zod.z.number().optional(),
159
- rightSize: import_zod.z.number().optional(),
160
- bottomSize: import_zod.z.number().optional()
161
- }).or(
162
- import_zod.z.object({
163
- leftSide: explicitPinSideDefinition.optional(),
164
- rightSide: explicitPinSideDefinition.optional(),
165
- topSide: explicitPinSideDefinition.optional(),
166
- bottomSide: explicitPinSideDefinition.optional()
167
- })
168
- )
172
+ schPortArrangement: schematicPortArrangement,
173
+ schPinSpacing: distanceOrMultiplier.or(import_zod.z.literal("auto")).optional().default("auto"),
174
+ schWidth: distanceOrMultiplier.or(import_zod.z.literal("auto")).optional().default("auto")
169
175
  });
170
176
  var viaProps = commonLayoutProps.extend({
171
177
  fromLayer: import_soup.layer_ref,
@@ -329,6 +335,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
329
335
  diodePins,
330
336
  diodeProps,
331
337
  direction,
338
+ distanceOrMultiplier,
332
339
  explicitPinSideDefinition,
333
340
  fabricationNotePathProps,
334
341
  fabricationNoteTextProps,
@@ -354,6 +361,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcb
354
361
  schematicBoxProps,
355
362
  schematicLineProps,
356
363
  schematicPathProps,
364
+ schematicPortArrangement,
357
365
  schematicTextProps,
358
366
  silkscreenCircleProps,
359
367
  silkscreenLineProps,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/index.ts"],"sourcesContent":["import { z } from \"zod\"\nimport {\n distance,\n rotation,\n layer_ref,\n supplier_name,\n resistance,\n capacitance,\n inductance,\n point,\n voltage,\n route_hint_point,\n length,\n type AnySoupElement,\n} from \"@tscircuit/soup\"\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\n\nexport const portHints = z.array(z.string().or(z.number()))\n\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\n\nexport const relativeDirection = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.number()),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\nexport type Footprint = string | ReactElement | AnySoupElement[]\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n\n // TODO pull in literals from @tscircuit/footprint\n // TODO footprint can be a string or react child\n footprint: z.custom<Footprint>((v) => true).optional(),\n})\nexport type CommonLayoutProps = z.input<typeof commonLayoutProps>\n\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\nexport type SupplierProps = z.input<typeof supplierProps>\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n children: z.any().optional(),\n })\nexport type CommonComponentProps = z.input<typeof commonComponentProps>\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n})\nexport const resistorPins = lrPins\nexport type ResistorProps = z.input<typeof resistorProps>\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n})\nexport const capacitorPins = lrPolarPins\nexport type CapacitorProps = z.input<typeof capacitorProps>\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n})\nexport const inductorPins = lrPins\nexport type InductorProps = z.input<typeof inductorProps>\n\nexport const diodeProps = commonComponentProps.extend({})\nexport const diodePins = lrPolarPins\nexport type DiodeProps = z.input<typeof diodeProps>\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n\nexport const boardProps = z.object({\n width: distance,\n height: distance,\n pcbCenterX: distance.optional().default(0),\n pcbCenterY: distance.optional().default(0),\n layout: z.any().optional(),\n children: z.any(),\n})\nexport type BoardProps = z.input<typeof boardProps>\n\nexport const bugProps = commonComponentProps.extend({\n pinLabels: z.record(z.number(), z.string()),\n schPortArrangement: z\n .object({\n leftSize: z.number().optional(),\n topSize: z.number().optional(),\n rightSize: z.number().optional(),\n bottomSize: z.number().optional(),\n })\n .or(\n z.object({\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n })\n ),\n})\nexport type BugProps = z.input<typeof bugProps>\n\nexport const viaProps = commonLayoutProps.extend({\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n})\nexport type ViaProps = z.input<typeof viaProps>\n\nexport const netAliasProps = commonLayoutProps.extend({\n net: z.string().optional(),\n})\nexport type NetAliasProps = z.input<typeof netAliasProps>\n\nexport const traceProps = z\n .object({\n path: z.array(z.string()),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n .or(\n z.object({\n from: z.string(),\n to: z.string(),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n )\nexport type TraceProps = z.input<typeof traceProps>\n\nexport const smtPadProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance.optional(),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"rect\"),\n width: distance.optional(),\n height: distance.optional(),\n portHints: portHints.optional(),\n }),\n])\nexport type SmtPadProps = z.input<typeof smtPadProps>\n\nexport const platedHoleProps = pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n })\nexport type PlatedHoleProps = z.input<typeof platedHoleProps>\n\nexport const holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({\n holeDiameter: distance,\n})\nexport type HoleProps = z.input<typeof holeProps>\n\nexport const schematicBoxProps = z.object({\n schX: distance,\n schY: distance,\n width: distance,\n height: distance,\n})\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n\nexport const schematicTextProps = z.object({\n schX: distance,\n schY: distance,\n text: z.string(),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n\nexport const constraintProps = z.union([\n z.object({\n type: z.literal(\"xdist\"),\n dist: distance,\n left: z.string(),\n right: z.string(),\n }),\n z.object({\n type: z.literal(\"ydist\"),\n dist: distance,\n top: z.string(),\n bottom: z.string(),\n }),\n])\nexport type ConstraintProps = z.input<typeof constraintProps>\n\nexport const constrainedLayoutProps = z.object({})\nexport type ConstrainedLayoutProps = z.input<typeof constrainedLayoutProps>\n\nexport const footprintProps = z.object({})\nexport type FootprintProps = z.input<typeof footprintProps>\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const groupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n layout: z.custom<LayoutBuilder>((v) => true).optional(),\n children: z.any().optional(),\n})\nexport type GroupProps = z.input<typeof groupProps>\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n\nexport const silkscreenRectProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n })\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n\nexport const silkscreenCircleProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n })\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n\nexport const traceHintProps = z.object({\n for: z.string(),\n order: z.number().optional(),\n offset: route_hint_point.optional(),\n offsets: z.array(route_hint_point).optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n\nexport const fabricationNoteTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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lib/index.ts"],"sourcesContent":["import { z } from \"zod\"\nimport {\n distance,\n rotation,\n layer_ref,\n supplier_name,\n resistance,\n capacitance,\n inductance,\n point,\n voltage,\n route_hint_point,\n length,\n type AnySoupElementInput,\n} from \"@tscircuit/soup\"\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { LayoutBuilder } from \"@tscircuit/layout\"\n\nexport const portHints = z.array(z.string().or(z.number()))\n\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\n\nexport const relativeDirection = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.number()),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\nexport type Footprint = string | ReactElement | AnySoupElementInput[]\nexport const pcbLayoutProps = z.object({\n pcbX: distance,\n pcbY: distance,\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n\n // TODO pull in literals from @tscircuit/footprint\n // TODO footprint can be a string or react child\n footprint: z.custom<Footprint>((v) => true).optional(),\n})\nexport type CommonLayoutProps = z.input<typeof commonLayoutProps>\n\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\nexport type SupplierProps = z.input<typeof supplierProps>\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n children: z.any().optional(),\n })\nexport type CommonComponentProps = z.input<typeof commonComponentProps>\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n})\nexport const resistorPins = lrPins\nexport type ResistorProps = z.input<typeof resistorProps>\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n})\nexport const capacitorPins = lrPolarPins\nexport type CapacitorProps = z.input<typeof capacitorProps>\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n})\nexport const inductorPins = lrPins\nexport type InductorProps = z.input<typeof inductorProps>\n\nexport const diodeProps = commonComponentProps.extend({})\nexport const diodePins = lrPolarPins\nexport type DiodeProps = z.input<typeof diodeProps>\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n\nexport const boardProps = z.object({\n width: distance,\n height: distance,\n pcbCenterX: distance.optional().default(0),\n pcbCenterY: distance.optional().default(0),\n layout: z.any().optional(),\n children: z.any(),\n})\nexport type BoardProps = z.input<typeof boardProps>\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n\nexport const schematicPortArrangement = z\n .object({\n leftSize: z.number().optional(),\n topSize: z.number().optional(),\n rightSize: z.number().optional(),\n bottomSize: z.number().optional(),\n })\n .or(\n z.object({\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n })\n )\n\nexport const bugProps = commonComponentProps.extend({\n pinLabels: z.record(z.number(), z.string()),\n schPortArrangement: schematicPortArrangement,\n schPinSpacing: distanceOrMultiplier\n .or(z.literal(\"auto\"))\n .optional()\n .default(\"auto\"),\n schWidth: distanceOrMultiplier\n .or(z.literal(\"auto\"))\n .optional()\n .default(\"auto\"),\n})\nexport type BugProps = z.input<typeof bugProps>\n\nexport const viaProps = commonLayoutProps.extend({\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n})\nexport type ViaProps = z.input<typeof viaProps>\n\nexport const netAliasProps = commonLayoutProps.extend({\n net: z.string().optional(),\n})\nexport type NetAliasProps = z.input<typeof netAliasProps>\n\nexport const traceProps = z\n .object({\n path: z.array(z.string()),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n .or(\n z.object({\n from: z.string(),\n to: z.string(),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n })\n )\nexport type TraceProps = z.input<typeof traceProps>\n\nexport const smtPadProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance.optional(),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"rect\"),\n width: distance.optional(),\n height: distance.optional(),\n portHints: portHints.optional(),\n }),\n])\nexport type SmtPadProps = z.input<typeof smtPadProps>\n\nexport const platedHoleProps = pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n })\nexport type PlatedHoleProps = z.input<typeof platedHoleProps>\n\nexport const holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({\n holeDiameter: distance,\n})\nexport type HoleProps = z.input<typeof holeProps>\n\nexport const schematicBoxProps = z.object({\n schX: distance,\n schY: distance,\n width: distance,\n height: distance,\n})\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n\nexport const schematicTextProps = z.object({\n schX: distance,\n schY: distance,\n text: z.string(),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n\nexport const constraintProps = z.union([\n z.object({\n type: z.literal(\"xdist\"),\n dist: distance,\n left: z.string(),\n right: z.string(),\n }),\n z.object({\n type: z.literal(\"ydist\"),\n dist: distance,\n top: z.string(),\n bottom: z.string(),\n }),\n])\nexport type ConstraintProps = z.input<typeof constraintProps>\n\nexport const constrainedLayoutProps = z.object({})\nexport type ConstrainedLayoutProps = z.input<typeof constrainedLayoutProps>\n\nexport const footprintProps = z.object({})\nexport type FootprintProps = z.input<typeof footprintProps>\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const groupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n layout: z.custom<LayoutBuilder>((v) => true).optional(),\n children: z.any().optional(),\n})\nexport type GroupProps = z.input<typeof groupProps>\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n\nexport const silkscreenRectProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n })\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n\nexport const silkscreenCircleProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n })\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n\nexport const traceHintProps = z.object({\n for: z.string(),\n order: z.number().optional(),\n offset: route_hint_point.optional(),\n offsets: z.array(route_hint_point).optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n\nexport const fabricationNoteTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AK,CAAC,UAAU,YAAY,aAAa,eAAe,cAAc,CAAC,EACvE,QAAQ,QAAQ;AAAA,EACnB,MAAM,aAAE,KAAK,CAAC,eAAe,CAAC,EAAE,SAAS;AAAA,EACzC,UAAU,mBAAO,SAAS;AAC5B,CAAC;AAGM,IAAM,2BAA2B,eACrC,KAAK,EAAE,MAAM,MAAM,MAAM,MAAM,aAAa,KAAK,CAAC,EAClD,OAAO;AAAA,EACN,OAAO,aAAE,MAAM,4BAAgB;AAAA,EAC/B,aAAa,mBAAO,SAAS;AAC/B,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {