@tscircuit/props 0.0.476 → 0.0.478

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.
@@ -23,7 +23,7 @@ export interface CadModelBase {
23
23
  size?: { x: number | string; y: number | string; z: number | string }
24
24
  modelUnitToMmScale?: Distance
25
25
  zOffsetFromSurface?: Distance
26
- showAsTranslucent?: boolean
26
+ showAsTranslucentModel?: boolean
27
27
  }
28
28
 
29
29
  export const cadModelBase = z.object({
@@ -32,7 +32,7 @@ export const cadModelBase = z.object({
32
32
  size: point3.optional(),
33
33
  modelUnitToMmScale: distance.optional(),
34
34
  zOffsetFromSurface: distance.optional(),
35
- showAsTranslucent: z.boolean().optional(),
35
+ showAsTranslucentModel: z.boolean().optional(),
36
36
  })
37
37
 
38
38
  expectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)
@@ -1,22 +1,28 @@
1
1
  import { resistance } from "circuit-json"
2
+ import { createConnectionsProp } from "lib/common/connectionsProp"
2
3
  import {
3
4
  type CommonComponentProps,
4
5
  commonComponentProps,
5
- lrPins,
6
6
  } from "lib/common/layout"
7
7
  import { expectTypesMatch } from "lib/typecheck"
8
+ import type { Connections } from "lib/utility-types/connections-and-selectors"
8
9
  import { z } from "zod"
9
10
 
10
11
  export type PotentiometerPinVariant = "two_pin" | "three_pin"
12
+ export const potentiometerPinLabels = ["pin1", "pin2", "pin3"] as const
13
+ export type PotentiometerPinLabels = (typeof potentiometerPinLabels)[number]
11
14
 
12
- export interface PotentiometerProps extends CommonComponentProps {
15
+ export interface PotentiometerProps<PinLabel extends string = string>
16
+ extends CommonComponentProps<PinLabel> {
13
17
  maxResistance: number | string
14
18
  pinVariant?: PotentiometerPinVariant
19
+ connections?: Connections<PotentiometerPinLabels>
15
20
  }
16
21
 
17
22
  export const potentiometerProps = commonComponentProps.extend({
18
23
  maxResistance: resistance,
19
24
  pinVariant: z.enum(["two_pin", "three_pin"]).optional(),
25
+ connections: createConnectionsProp(potentiometerPinLabels).optional(),
20
26
  })
21
27
 
22
28
  type InferredPotentiometerProps = z.input<typeof potentiometerProps>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.476",
3
+ "version": "0.0.478",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",