@tscircuit/props 0.0.20 → 0.0.22

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,7 +1,7 @@
1
- import { z } from 'zod';
1
+ import { LayoutBuilder } from '@tscircuit/layout';
2
2
  import { AnySoupElementInput } from '@tscircuit/soup';
3
3
  import { ReactElement } from 'react';
4
- import { LayoutBuilder } from '@tscircuit/layout';
4
+ import { z } from 'zod';
5
5
 
6
6
  declare const portHints: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">;
7
7
  declare const direction: z.ZodEnum<["up", "down", "left", "right"]>;
@@ -3118,8 +3118,8 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
3118
3118
  }>]>>;
3119
3119
  children: z.ZodOptional<z.ZodAny>;
3120
3120
  }>, {
3121
- pinLabels: z.ZodRecord<z.ZodNumber, z.ZodString>;
3122
- schPortArrangement: z.ZodUnion<[z.ZodObject<{
3121
+ pinLabels: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodString>>;
3122
+ schPortArrangement: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
3123
3123
  leftSize: z.ZodOptional<z.ZodNumber>;
3124
3124
  topSize: z.ZodOptional<z.ZodNumber>;
3125
3125
  rightSize: z.ZodOptional<z.ZodNumber>;
@@ -3209,35 +3209,11 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
3209
3209
  pins: number[];
3210
3210
  direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3211
3211
  } | undefined;
3212
- }>]>;
3212
+ }>]>>;
3213
3213
  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">]>>>;
3214
3214
  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">]>>>;
3215
3215
  }>, "strip", z.ZodTypeAny, {
3216
3216
  name: string;
3217
- pinLabels: Record<number, string>;
3218
- schPortArrangement: {
3219
- leftSize?: number | undefined;
3220
- topSize?: number | undefined;
3221
- rightSize?: number | undefined;
3222
- bottomSize?: number | undefined;
3223
- } | {
3224
- leftSide?: {
3225
- pins: number[];
3226
- direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3227
- } | undefined;
3228
- rightSide?: {
3229
- pins: number[];
3230
- direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3231
- } | undefined;
3232
- topSide?: {
3233
- pins: number[];
3234
- direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3235
- } | undefined;
3236
- bottomSide?: {
3237
- pins: number[];
3238
- direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3239
- } | undefined;
3240
- };
3241
3217
  schPinSpacing: number | "2x" | "3x" | "4x" | "auto";
3242
3218
  schWidth: number | "2x" | "3x" | "4x" | "auto";
3243
3219
  pcbX?: number | undefined;
@@ -3303,10 +3279,8 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
3303
3279
  jscad?: any;
3304
3280
  } | undefined;
3305
3281
  children?: any;
3306
- }, {
3307
- name: string;
3308
- pinLabels: Record<number, string>;
3309
- schPortArrangement: {
3282
+ pinLabels?: Record<number, string> | undefined;
3283
+ schPortArrangement?: {
3310
3284
  leftSize?: number | undefined;
3311
3285
  topSize?: number | undefined;
3312
3286
  rightSize?: number | undefined;
@@ -3328,7 +3302,9 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
3328
3302
  pins: number[];
3329
3303
  direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3330
3304
  } | undefined;
3331
- };
3305
+ } | undefined;
3306
+ }, {
3307
+ name: string;
3332
3308
  pcbX?: string | number | undefined;
3333
3309
  pcbY?: string | number | undefined;
3334
3310
  pcbRotation?: string | number | undefined;
@@ -3394,6 +3370,30 @@ declare const bugProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extend
3394
3370
  jscad?: any;
3395
3371
  } | undefined;
3396
3372
  children?: any;
3373
+ pinLabels?: Record<number, string> | undefined;
3374
+ schPortArrangement?: {
3375
+ leftSize?: number | undefined;
3376
+ topSize?: number | undefined;
3377
+ rightSize?: number | undefined;
3378
+ bottomSize?: number | undefined;
3379
+ } | {
3380
+ leftSide?: {
3381
+ pins: number[];
3382
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3383
+ } | undefined;
3384
+ rightSide?: {
3385
+ pins: number[];
3386
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3387
+ } | undefined;
3388
+ topSide?: {
3389
+ pins: number[];
3390
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3391
+ } | undefined;
3392
+ bottomSide?: {
3393
+ pins: number[];
3394
+ direction: "top-to-bottom" | "left-to-right" | "bottom-to-top" | "right-to-left";
3395
+ } | undefined;
3396
+ } | undefined;
3397
3397
  schPinSpacing?: string | number | undefined;
3398
3398
  schWidth?: string | number | undefined;
3399
3399
  }>;
package/dist/index.js CHANGED
@@ -76,8 +76,8 @@ __export(lib_exports, {
76
76
  viaProps: () => viaProps
77
77
  });
78
78
  module.exports = __toCommonJS(lib_exports);
79
- var import_zod = require("zod");
80
79
  var import_soup = require("@tscircuit/soup");
80
+ var import_zod = require("zod");
81
81
  var portHints = import_zod.z.array(import_zod.z.string().or(import_zod.z.number()));
82
82
  var direction = import_zod.z.enum(["up", "down", "left", "right"]);
83
83
  var relativeDirection = import_zod.z.enum([
@@ -193,8 +193,8 @@ var schematicPortArrangement = import_zod.z.object({
193
193
  })
194
194
  );
195
195
  var bugProps = commonComponentProps.extend({
196
- pinLabels: import_zod.z.record(import_zod.z.number(), import_zod.z.string()),
197
- schPortArrangement: schematicPortArrangement,
196
+ pinLabels: import_zod.z.record(import_zod.z.number(), import_zod.z.string()).optional(),
197
+ schPortArrangement: schematicPortArrangement.optional(),
198
198
  schPinSpacing: distanceOrMultiplier.or(import_zod.z.literal("auto")).optional().default("auto"),
199
199
  schWidth: distanceOrMultiplier.or(import_zod.z.literal("auto")).optional().default("auto")
200
200
  });
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 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\nconst point3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(point3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.any(),\n})\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n cadModel: z.union([cadModelStl, cadModelObj, cadModelJscad]).optional(),\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 pcbX: distance.optional().default(0),\n pcbY: 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 = z.union([\n pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n innerWidth: distance,\n innerHeight: distance,\n portHints: portHints.optional(),\n })\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,kBAaO;AAIA,IAAM,YAAY,aAAE,MAAM,aAAE,OAAO,EAAE,GAAG,aAAE,O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outBuilder } from \"@tscircuit/layout\"\nimport {\n type AnySoupElementInput,\n capacitance,\n distance,\n inductance,\n layer_ref,\n length,\n point,\n resistance,\n rotation,\n route_hint_point,\n supplier_name,\n voltage,\n} from \"@tscircuit/soup\"\nimport type { ReactElement, ReactNode } from \"react\"\nimport { z } from \"zod\"\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\nconst point3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(point3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.any(),\n})\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n name: z.string(),\n cadModel: z.union([cadModelStl, cadModelObj, cadModelJscad]).optional(),\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 pcbX: distance.optional().default(0),\n pcbY: 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()).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\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 = z.union([\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n innerWidth: distance,\n innerHeight: distance,\n portHints: portHints.optional(),\n }),\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAaO;AAEP,iBAAkB;AAEX,IAAM,YAAY,aAAE,MAAM,aAAE,OAAO,EAAE,GAAG,aAAE,OAAO,CAAC,CAAC;AAEnD,IAAM,YAAY,aAAE,KAAK,CAAC,MAAM,QAAQ,QAAQ,OAAO,CAAC;AAExD,IAAM,oBAAoB,aAAE,KAAK;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,4BAA4B,aAAE,OAAO;AAAA,EAChD,MAAM,aAAE,MAAM,aAAE,OAAO,CAAC;AAAA,EACxB,WAAW,aAAE,MAAM;AAAA,IACjB,aAAE,QAAQ,eAAe;AAAA,IACzB,aAAE,QAAQ,eAAe;AAAA,IACzB,aAAE,QAAQ,eAAe;AAAA,IACzB,aAAE,QAAQ,eAAe;AAAA,EAC3B,CAAC;AAC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aAAE,OAAO;AAAA,EACrC,KAAK,aAAE,OAAO;AAAA,EACd,OAAO,aAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,QAAQ,6BAAiB,SAAS;AAAA,EAClC,SAAS,aAAE,MAAM,4BAAgB,EAAE,SAAS;AAC9C,CAAC;AAIM,IAAM,gBAAgB,aAAE,OAAO;AAAA,EACpC,OAAO,aAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,WAAW,qBAAS,SAAS;AAAA,EAC7B,OAAO,aAAE,MAAM,4BAAgB;AACjC,CAAC;AAGM,IAAM,2BAA2B,eAAe,OAAO;AAAA,EAC5D,MAAM,aAAE,OAAO;AAAA,EACf,iBAAiB,aACd,KAAK,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.20",
3
+ "version": "0.0.22",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {