@tscircuit/props 0.0.529 → 0.0.530
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 +1 -5717
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/lib/components/resistor.ts +4 -6
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
commonComponentProps,
|
|
6
6
|
lrPins,
|
|
7
7
|
} from "lib/common/layout"
|
|
8
|
+
import { footprintProp } from "lib/common/footprintProp"
|
|
8
9
|
import {
|
|
9
10
|
schematicSymbolSize,
|
|
10
11
|
type SchematicSymbolSize,
|
|
@@ -56,8 +57,9 @@ const mapResistorFootprint = (
|
|
|
56
57
|
if (!resistorImperialFootprintNames.has(footprint)) return footprint
|
|
57
58
|
return `res${footprint}`
|
|
58
59
|
}
|
|
59
|
-
export const resistorProps =
|
|
60
|
-
.extend({
|
|
60
|
+
export const resistorProps: z.ZodType<ResistorProps> =
|
|
61
|
+
commonComponentProps.extend({
|
|
62
|
+
footprint: footprintProp.optional().transform(mapResistorFootprint),
|
|
61
63
|
resistance,
|
|
62
64
|
tolerance: z
|
|
63
65
|
.union([z.string(), z.number()])
|
|
@@ -89,10 +91,6 @@ export const resistorProps = commonComponentProps
|
|
|
89
91
|
|
|
90
92
|
connections: createConnectionsProp(resistorPinLabels).optional(),
|
|
91
93
|
})
|
|
92
|
-
.transform((props) => ({
|
|
93
|
-
...props,
|
|
94
|
-
footprint: mapResistorFootprint(props.footprint),
|
|
95
|
-
}))
|
|
96
94
|
export const resistorPins = lrPins
|
|
97
95
|
|
|
98
96
|
type InferredResistorProps = z.input<typeof resistorProps>
|