@tscircuit/props 0.0.526 → 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/README.md +106 -127
- package/dist/index.d.ts +1181 -7
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +4 -0
- package/lib/components/resistor.ts +55 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16289,6 +16289,7 @@ var autorouterConfig = z36.object({
|
|
|
16289
16289
|
"auto_cloud",
|
|
16290
16290
|
"auto_jumper",
|
|
16291
16291
|
"tscircuit_beta",
|
|
16292
|
+
"krt",
|
|
16292
16293
|
"freerouting",
|
|
16293
16294
|
"laser_prefab",
|
|
16294
16295
|
"auto-jumper",
|
|
@@ -16306,6 +16307,7 @@ var autorouterPreset = z36.union([
|
|
|
16306
16307
|
z36.literal("auto_cloud"),
|
|
16307
16308
|
z36.literal("auto_jumper"),
|
|
16308
16309
|
z36.literal("tscircuit_beta"),
|
|
16310
|
+
z36.literal("krt"),
|
|
16309
16311
|
z36.literal("freerouting"),
|
|
16310
16312
|
z36.literal("laser_prefab"),
|
|
16311
16313
|
// Prefabricated PCB with laser copper ablation
|
|
@@ -16783,6 +16785,24 @@ expectTypesMatch(true);
|
|
|
16783
16785
|
import { resistance } from "circuit-json";
|
|
16784
16786
|
import { z as z48 } from "zod";
|
|
16785
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
|
+
};
|
|
16786
16806
|
var resistorProps = commonComponentProps.extend({
|
|
16787
16807
|
resistance,
|
|
16788
16808
|
tolerance: z48.union([z48.string(), z48.number()]).transform((val) => {
|
|
@@ -16803,7 +16823,10 @@ var resistorProps = commonComponentProps.extend({
|
|
|
16803
16823
|
schOrientation: schematicOrientation.optional(),
|
|
16804
16824
|
schSize: schematicSymbolSize.optional(),
|
|
16805
16825
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
16806
|
-
})
|
|
16826
|
+
}).transform((props) => ({
|
|
16827
|
+
...props,
|
|
16828
|
+
footprint: mapResistorFootprint(props.footprint)
|
|
16829
|
+
}));
|
|
16807
16830
|
var resistorPins = lrPins;
|
|
16808
16831
|
expectTypesMatch(true);
|
|
16809
16832
|
|