@tscircuit/props 0.0.276 → 0.0.278
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 +292 -285
- package/dist/index.d.ts +146 -2
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/lib/components/crystal.ts +7 -2
- package/lib/components/group.ts +11 -0
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
commonComponentProps,
|
|
5
5
|
lrPins,
|
|
6
6
|
} from "lib/common/layout"
|
|
7
|
+
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
8
|
+
import { createConnectionsProp } from "lib/common/connectionsProp"
|
|
7
9
|
import {
|
|
8
10
|
schematicOrientation,
|
|
9
11
|
type SchematicOrientation,
|
|
@@ -13,12 +15,16 @@ import { z } from "zod"
|
|
|
13
15
|
|
|
14
16
|
export type PinVariant = "two_pin" | "four_pin"
|
|
15
17
|
|
|
18
|
+
export const crystalPins = lrPins
|
|
19
|
+
export type CrystalPinLabels = (typeof crystalPins)[number]
|
|
20
|
+
|
|
16
21
|
export interface CrystalProps<PinLabel extends string = string>
|
|
17
22
|
extends CommonComponentProps<PinLabel> {
|
|
18
23
|
frequency: number | string
|
|
19
24
|
loadCapacitance: number | string
|
|
20
25
|
pinVariant?: PinVariant
|
|
21
26
|
schOrientation?: SchematicOrientation
|
|
27
|
+
connections?: Connections<CrystalPinLabels>
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
export const crystalProps = commonComponentProps.extend({
|
|
@@ -26,9 +32,8 @@ export const crystalProps = commonComponentProps.extend({
|
|
|
26
32
|
loadCapacitance: capacitance,
|
|
27
33
|
pinVariant: z.enum(["two_pin", "four_pin"]).optional(),
|
|
28
34
|
schOrientation: schematicOrientation.optional(),
|
|
35
|
+
connections: createConnectionsProp(crystalPins).optional(),
|
|
29
36
|
})
|
|
30
|
-
export const crystalPins = lrPins
|
|
31
|
-
export type CrystalPinLabels = (typeof crystalPins)[number]
|
|
32
37
|
|
|
33
38
|
type InferredCrystalProps = z.input<typeof crystalProps>
|
|
34
39
|
expectTypesMatch<CrystalProps, InferredCrystalProps>(true)
|
package/lib/components/group.ts
CHANGED
|
@@ -169,6 +169,12 @@ export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {
|
|
|
169
169
|
schPaddingTop?: Distance
|
|
170
170
|
schPaddingBottom?: Distance
|
|
171
171
|
|
|
172
|
+
pcbPadding?: Distance
|
|
173
|
+
pcbPaddingLeft?: Distance
|
|
174
|
+
pcbPaddingRight?: Distance
|
|
175
|
+
pcbPaddingTop?: Distance
|
|
176
|
+
pcbPaddingBottom?: Distance
|
|
177
|
+
|
|
172
178
|
/** @deprecated Use `pcbGrid` */
|
|
173
179
|
grid?: boolean
|
|
174
180
|
/** @deprecated Use `pcbFlex` */
|
|
@@ -371,6 +377,11 @@ export const baseGroupProps = commonLayoutProps.extend({
|
|
|
371
377
|
schPaddingRight: length.optional(),
|
|
372
378
|
schPaddingTop: length.optional(),
|
|
373
379
|
schPaddingBottom: length.optional(),
|
|
380
|
+
pcbPadding: length.optional(),
|
|
381
|
+
pcbPaddingLeft: length.optional(),
|
|
382
|
+
pcbPaddingRight: length.optional(),
|
|
383
|
+
pcbPaddingTop: length.optional(),
|
|
384
|
+
pcbPaddingBottom: length.optional(),
|
|
374
385
|
})
|
|
375
386
|
|
|
376
387
|
export const partsEngine = z.custom<PartsEngine>((v) => "findPart" in v)
|