@tscircuit/props 0.0.527 → 0.0.528

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.js CHANGED
@@ -16785,6 +16785,24 @@ expectTypesMatch(true);
16785
16785
  import { resistance } from "circuit-json";
16786
16786
  import { z as z48 } from "zod";
16787
16787
  var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
16788
+ var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
16789
+ "01005",
16790
+ "0201",
16791
+ "0402",
16792
+ "0504",
16793
+ "0603",
16794
+ "0805",
16795
+ "1206",
16796
+ "1210",
16797
+ "1812",
16798
+ "2010",
16799
+ "2512"
16800
+ ]);
16801
+ var mapResistorFootprint = (footprint) => {
16802
+ if (typeof footprint !== "string") return footprint;
16803
+ if (!resistorImperialFootprintNames.has(footprint)) return footprint;
16804
+ return `res${footprint}`;
16805
+ };
16788
16806
  var resistorProps = commonComponentProps.extend({
16789
16807
  resistance,
16790
16808
  tolerance: z48.union([z48.string(), z48.number()]).transform((val) => {
@@ -16805,7 +16823,10 @@ var resistorProps = commonComponentProps.extend({
16805
16823
  schOrientation: schematicOrientation.optional(),
16806
16824
  schSize: schematicSymbolSize.optional(),
16807
16825
  connections: createConnectionsProp(resistorPinLabels).optional()
16808
- });
16826
+ }).transform((props) => ({
16827
+ ...props,
16828
+ footprint: mapResistorFootprint(props.footprint)
16829
+ }));
16809
16830
  var resistorPins = lrPins;
16810
16831
  expectTypesMatch(true);
16811
16832