@tscircuit/core 0.0.662 → 0.0.664

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
@@ -7570,6 +7570,7 @@ interface VoltageSourceProps extends CommonComponentProps {
7570
7570
  peakToPeakVoltage?: number | string;
7571
7571
  waveShape?: WaveShape;
7572
7572
  phase?: number | string;
7573
+ dutyCycle?: number;
7573
7574
  }
7574
7575
  declare const voltageSourceProps: z.ZodObject<{
7575
7576
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -7859,6 +7860,7 @@ declare const voltageSourceProps: z.ZodObject<{
7859
7860
  peakToPeakVoltage: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
7860
7861
  waveShape: z.ZodOptional<z.ZodEnum<["sinewave", "square", "triangle", "sawtooth"]>>;
7861
7862
  phase: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
7863
+ dutyCycle: z.ZodOptional<z.ZodNumber>;
7862
7864
  }, "strip", z.ZodTypeAny, {
7863
7865
  name: string;
7864
7866
  children?: any;
@@ -7887,6 +7889,7 @@ declare const voltageSourceProps: z.ZodObject<{
7887
7889
  }> | undefined;
7888
7890
  peakToPeakVoltage?: number | undefined;
7889
7891
  waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
7892
+ dutyCycle?: number | undefined;
7890
7893
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
7891
7894
  cadModel?: string | {
7892
7895
  stlUrl: string;
@@ -7973,6 +7976,7 @@ declare const voltageSourceProps: z.ZodObject<{
7973
7976
  }> | undefined;
7974
7977
  peakToPeakVoltage?: string | number | undefined;
7975
7978
  waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
7979
+ dutyCycle?: number | undefined;
7976
7980
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
7977
7981
  cadModel?: string | {
7978
7982
  stlUrl: string;
@@ -8322,6 +8326,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
8322
8326
  peakToPeakVoltage: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
8323
8327
  waveShape: z.ZodOptional<z.ZodEnum<["sinewave", "square", "triangle", "sawtooth"]>>;
8324
8328
  phase: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
8329
+ dutyCycle: z.ZodOptional<z.ZodNumber>;
8325
8330
  }, "strip", z.ZodTypeAny, {
8326
8331
  name: string;
8327
8332
  children?: any;
@@ -8350,6 +8355,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
8350
8355
  }> | undefined;
8351
8356
  peakToPeakVoltage?: number | undefined;
8352
8357
  waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
8358
+ dutyCycle?: number | undefined;
8353
8359
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
8354
8360
  cadModel?: string | {
8355
8361
  stlUrl: string;
@@ -8436,6 +8442,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
8436
8442
  }> | undefined;
8437
8443
  peakToPeakVoltage?: string | number | undefined;
8438
8444
  waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
8445
+ dutyCycle?: number | undefined;
8439
8446
  supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
8440
8447
  cadModel?: string | {
8441
8448
  stlUrl: string;
@@ -12020,7 +12027,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
12020
12027
  rightAngle: zod.ZodOptional<zod.ZodBoolean>;
12021
12028
  holeDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12022
12029
  platedDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12023
- pinLabels: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
12030
+ pinLabels: zod.ZodOptional<zod.ZodUnion<[zod.ZodRecord<zod.ZodString, zod.ZodString>, zod.ZodArray<zod.ZodString, "many">]>>;
12024
12031
  connections: zod.ZodOptional<zod.ZodPipeline<zod.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, zod.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
12025
12032
  facingDirection: zod.ZodOptional<zod.ZodEnum<["left", "right"]>>;
12026
12033
  schPinArrangement: zod.ZodOptional<zod.ZodObject<{
@@ -12237,7 +12244,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
12237
12244
  doNotPlace?: boolean | undefined;
12238
12245
  schWidth?: number | undefined;
12239
12246
  schHeight?: number | undefined;
12240
- pinLabels?: string[] | undefined;
12247
+ pinLabels?: string[] | Record<string, string> | undefined;
12241
12248
  pcbPinLabels?: Record<string, string> | undefined;
12242
12249
  schPinArrangement?: {
12243
12250
  leftSize?: number | undefined;
@@ -12370,7 +12377,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
12370
12377
  schWidth?: string | number | undefined;
12371
12378
  schHeight?: string | number | undefined;
12372
12379
  gender?: "male" | "female" | "unpopulated" | undefined;
12373
- pinLabels?: string[] | undefined;
12380
+ pinLabels?: string[] | Record<string, string> | undefined;
12374
12381
  pcbPinLabels?: Record<string, string> | undefined;
12375
12382
  schPinArrangement?: {
12376
12383
  leftSize?: number | undefined;
package/dist/index.js CHANGED
@@ -12059,13 +12059,15 @@ var voltageSourceProps = commonComponentProps.extend({
12059
12059
  frequency: frequency.optional(),
12060
12060
  peakToPeakVoltage: voltage.optional(),
12061
12061
  waveShape: z12.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
12062
- phase: rotation2.optional()
12062
+ phase: rotation2.optional(),
12063
+ dutyCycle: z12.number().optional()
12063
12064
  });
12064
12065
  var VoltageSource = class extends NormalComponent {
12065
12066
  get config() {
12067
+ const isSquare = this.props.waveShape === "square";
12066
12068
  return {
12067
12069
  componentName: "VoltageSource",
12068
- schematicSymbolName: "ac_voltmeter",
12070
+ schematicSymbolName: isSquare ? "square_wave" : "ac_voltmeter",
12069
12071
  zodProps: voltageSourceProps,
12070
12072
  sourceFtype: "simple_voltage_source"
12071
12073
  };
@@ -12100,6 +12102,7 @@ var VoltageSource = class extends NormalComponent {
12100
12102
  peak_to_peak_voltage: props.peakToPeakVoltage,
12101
12103
  wave_shape: props.waveShape,
12102
12104
  phase: props.phase,
12105
+ duty_cycle: props.dutyCycle,
12103
12106
  supplier_part_numbers: props.supplierPartNumbers,
12104
12107
  are_pins_interchangeable: true
12105
12108
  });
@@ -12119,7 +12122,8 @@ var VoltageSource = class extends NormalComponent {
12119
12122
  frequency: props.frequency,
12120
12123
  peak_to_peak_voltage: props.peakToPeakVoltage,
12121
12124
  wave_shape: props.waveShape,
12122
- phase: props.phase
12125
+ phase: props.phase,
12126
+ duty_cycle: props.dutyCycle
12123
12127
  });
12124
12128
  }
12125
12129
  terminal1 = this.portMap.terminal1;
@@ -12908,7 +12912,7 @@ var PinHeader = class extends NormalComponent {
12908
12912
  };
12909
12913
  }
12910
12914
  _getImpliedFootprintString() {
12911
- const pinCount = this._parsedProps.pinCount ?? this._parsedProps.pinLabels?.length ?? 0;
12915
+ const pinCount = this._parsedProps.pinCount ?? (Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels.length : this._parsedProps.pinLabels ? Object.keys(this._parsedProps.pinLabels).length : 0);
12912
12916
  const holeDiameter = this._parsedProps.holeDiameter;
12913
12917
  const platedDiameter = this._parsedProps.platedDiameter;
12914
12918
  const pitch = this._parsedProps.pitch;
@@ -12936,15 +12940,14 @@ var PinHeader = class extends NormalComponent {
12936
12940
  return null;
12937
12941
  }
12938
12942
  initPorts() {
12939
- const pinCount = this._parsedProps.pinCount ?? this._parsedProps.pinLabels?.length ?? 1;
12943
+ const pinCount = this._parsedProps.pinCount ?? (Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels.length : this._parsedProps.pinLabels ? Object.keys(this._parsedProps.pinLabels).length : 1);
12940
12944
  for (let i = 1; i <= pinCount; i++) {
12945
+ const label = Array.isArray(this._parsedProps.pinLabels) ? this._parsedProps.pinLabels[i - 1] : this._parsedProps.pinLabels?.[i];
12941
12946
  this.add(
12942
12947
  new Port({
12943
12948
  name: `pin${i}`,
12944
12949
  pinNumber: i,
12945
- aliases: [this._parsedProps.pinLabels?.[i - 1]].filter(
12946
- Boolean
12947
- )
12950
+ aliases: [label].filter(Boolean)
12948
12951
  })
12949
12952
  );
12950
12953
  }
@@ -13827,7 +13830,7 @@ import { identity as identity5 } from "transformation-matrix";
13827
13830
  var package_default = {
13828
13831
  name: "@tscircuit/core",
13829
13832
  type: "module",
13830
- version: "0.0.661",
13833
+ version: "0.0.663",
13831
13834
  types: "dist/index.d.ts",
13832
13835
  main: "dist/index.js",
13833
13836
  module: "dist/index.js",
@@ -13866,7 +13869,7 @@ var package_default = {
13866
13869
  "@tscircuit/matchpack": "^0.0.9",
13867
13870
  "@tscircuit/math-utils": "^0.0.18",
13868
13871
  "@tscircuit/miniflex": "^0.0.4",
13869
- "@tscircuit/props": "0.0.288",
13872
+ "@tscircuit/props": "0.0.289",
13870
13873
  "@tscircuit/schematic-autolayout": "^0.0.6",
13871
13874
  "@tscircuit/schematic-match-adapt": "^0.0.16",
13872
13875
  "@tscircuit/schematic-trace-solver": "^0.0.23",
@@ -13896,7 +13899,7 @@ var package_default = {
13896
13899
  "pkg-pr-new": "^0.0.37",
13897
13900
  react: "^19.1.0",
13898
13901
  "react-dom": "^19.1.0",
13899
- "schematic-symbols": "^0.0.180",
13902
+ "schematic-symbols": "^0.0.195",
13900
13903
  "ts-expect": "^1.3.0",
13901
13904
  tsup: "^8.2.4"
13902
13905
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.662",
4
+ "version": "0.0.664",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "@tscircuit/matchpack": "^0.0.9",
41
41
  "@tscircuit/math-utils": "^0.0.18",
42
42
  "@tscircuit/miniflex": "^0.0.4",
43
- "@tscircuit/props": "0.0.288",
43
+ "@tscircuit/props": "0.0.289",
44
44
  "@tscircuit/schematic-autolayout": "^0.0.6",
45
45
  "@tscircuit/schematic-match-adapt": "^0.0.16",
46
46
  "@tscircuit/schematic-trace-solver": "^0.0.23",
@@ -70,7 +70,7 @@
70
70
  "pkg-pr-new": "^0.0.37",
71
71
  "react": "^19.1.0",
72
72
  "react-dom": "^19.1.0",
73
- "schematic-symbols": "^0.0.180",
73
+ "schematic-symbols": "^0.0.195",
74
74
  "ts-expect": "^1.3.0",
75
75
  "tsup": "^8.2.4"
76
76
  },