@tscircuit/props 0.0.610 → 0.0.611

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
@@ -152463,7 +152463,10 @@ declare const ledProps: z.ZodObject<{
152463
152463
  wavelength: z.ZodOptional<z.ZodString>;
152464
152464
  schDisplayValue: z.ZodOptional<z.ZodString>;
152465
152465
  schOrientation: z.ZodOptional<z.ZodEnum<["vertical", "horizontal", "pos_top", "pos_bottom", "pos_left", "pos_right", "neg_top", "neg_bottom", "neg_left", "neg_right"]>>;
152466
- pinLabels: z.ZodOptional<z.ZodRecord<z.ZodEnum<["pin1", "left", "anode", "pos", "pin2", "right", "cathode", "neg"]>, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>;
152466
+ pinLabels: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodEnum<["pin1", "left", "anode", "pos", "pin2", "right", "cathode", "neg"]>, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>, z.ZodEffects<z.ZodRecord<z.ZodEnum<["1", "2"]>, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>, {
152467
+ pin2?: string | readonly string[] | string[] | undefined;
152468
+ pin1?: string | readonly string[] | string[] | undefined;
152469
+ }, Partial<Record<"1" | "2", string | readonly string[] | string[]>>>]>>;
152467
152470
  connections: z.ZodOptional<z.ZodRecord<z.ZodEnum<["pin1", "left", "anode", "pos", "pin2", "right", "cathode", "neg"]>, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>;
152468
152471
  laser: z.ZodOptional<z.ZodBoolean>;
152469
152472
  }, "strip", z.ZodTypeAny, {
@@ -153045,7 +153048,10 @@ declare const ledProps: z.ZodObject<{
153045
153048
  schSectionName?: string | undefined;
153046
153049
  schSheetName?: string | undefined;
153047
153050
  connections?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
153048
- pinLabels?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
153051
+ pinLabels?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | {
153052
+ pin2?: string | readonly string[] | string[] | undefined;
153053
+ pin1?: string | readonly string[] | string[] | undefined;
153054
+ } | undefined;
153049
153055
  schOrientation?: "vertical" | "horizontal" | "pos_top" | "pos_bottom" | "pos_left" | "pos_right" | "neg_top" | "neg_bottom" | "neg_left" | "neg_right" | undefined;
153050
153056
  color?: string | undefined;
153051
153057
  wavelength?: string | undefined;
@@ -153632,7 +153638,7 @@ declare const ledProps: z.ZodObject<{
153632
153638
  schSectionName?: string | undefined;
153633
153639
  schSheetName?: string | undefined;
153634
153640
  connections?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
153635
- pinLabels?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
153641
+ pinLabels?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | Partial<Record<"1" | "2", string | readonly string[] | string[]>> | undefined;
153636
153642
  schOrientation?: "vertical" | "horizontal" | "pos_top" | "pos_bottom" | "pos_left" | "pos_right" | "neg_top" | "neg_bottom" | "neg_left" | "neg_right" | undefined;
153637
153643
  color?: string | undefined;
153638
153644
  wavelength?: string | undefined;
package/dist/index.js CHANGED
@@ -18036,12 +18036,21 @@ expectTypesMatch(true);
18036
18036
 
18037
18037
  // lib/components/led.ts
18038
18038
  import { z as z96 } from "zod";
18039
+ var legacyNumericLedPinLabelsProp = z96.record(
18040
+ z96.enum(["1", "2"]),
18041
+ schematicPinLabel.or(z96.array(schematicPinLabel).readonly()).or(z96.array(schematicPinLabel))
18042
+ ).transform((pinLabels) => ({
18043
+ ...pinLabels["1"] === void 0 ? {} : { pin1: pinLabels["1"] },
18044
+ ...pinLabels["2"] === void 0 ? {} : { pin2: pinLabels["2"] }
18045
+ }));
18039
18046
  var ledProps = commonComponentProps.extend({
18040
18047
  color: z96.string().optional(),
18041
18048
  wavelength: z96.string().optional(),
18042
18049
  schDisplayValue: z96.string().optional(),
18043
18050
  schOrientation: schematicOrientation.optional(),
18044
- pinLabels: diodePinLabelsProp.optional(),
18051
+ // Numeric keys are accepted for compatibility with legacy generated LED
18052
+ // wrappers, then normalized to the canonical pin1/pin2 representation.
18053
+ pinLabels: diodePinLabelsProp.or(legacyNumericLedPinLabelsProp).optional(),
18045
18054
  connections: createConnectionsProp(lrPolarPins).optional(),
18046
18055
  laser: z96.boolean().optional()
18047
18056
  });