@salloomd/teeth-selector 0.0.1 → 0.0.3

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.
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import type { TeethPreviewProps } from "../lib/types";
3
+ declare const TeethPreview: React.ForwardRefExoticComponent<TeethPreviewProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { TeethPreview };
5
+ //# sourceMappingURL=teeth-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teeth-preview.d.ts","sourceRoot":"","sources":["../../src/components/teeth-preview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMtD,QAAA,MAAM,YAAY,yFAiHjB,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,63 @@
1
+ import * as React from "react";
2
+ import { type Tooth } from "../lib/teeth";
3
+ import type { TeethSelectorProps, TeethSelectorState } from "../lib/types";
4
+ type SelectionAction = {
5
+ type: "toggle-tooth";
6
+ toothId: number;
7
+ } | {
8
+ type: "toggle-bridge";
9
+ fromId: number;
10
+ toId: number;
11
+ } | {
12
+ type: "select-upper";
13
+ } | {
14
+ type: "select-lower";
15
+ } | {
16
+ type: "clear-all";
17
+ } | {
18
+ type: "select-range";
19
+ teethIds: number[];
20
+ } | {
21
+ type: "set";
22
+ state: TeethSelectorState;
23
+ };
24
+ interface TeethSelectorContextValue {
25
+ state: TeethSelectorState;
26
+ dispatch: React.Dispatch<SelectionAction>;
27
+ dragState: DragState;
28
+ setDragState: React.Dispatch<React.SetStateAction<DragState>>;
29
+ }
30
+ export declare function useTeethSelectorContext(): TeethSelectorContextValue;
31
+ interface DragState {
32
+ start: number | null;
33
+ current: number | null;
34
+ teethInRange: number[];
35
+ }
36
+ declare const TeethSelector: React.ForwardRefExoticComponent<TeethSelectorProps & React.RefAttributes<HTMLDivElement>>;
37
+ interface TeethChartProps {
38
+ width?: number;
39
+ height?: number;
40
+ className?: string;
41
+ renderTooth?: (props: {
42
+ tooth: Tooth;
43
+ isSelected: boolean;
44
+ isInDragRange: boolean;
45
+ }, defaultElement: React.JSX.Element) => React.ReactNode;
46
+ renderBridge?: (props: {
47
+ fromId: number;
48
+ toId: number;
49
+ exists: boolean;
50
+ position: {
51
+ x1: number;
52
+ y1: number;
53
+ x2: number;
54
+ y2: number;
55
+ midX: number;
56
+ midY: number;
57
+ };
58
+ }, defaultElement: React.JSX.Element) => React.ReactNode;
59
+ enableDragSelection?: boolean;
60
+ }
61
+ declare const TeethChart: React.ForwardRefExoticComponent<TeethChartProps & React.RefAttributes<SVGSVGElement>>;
62
+ export { TeethSelector, TeethChart };
63
+ //# sourceMappingURL=teeth-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teeth-selector.d.ts","sourceRoot":"","sources":["../../src/components/teeth-selector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAIL,KAAK,KAAK,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAM3E,KAAK,eAAe,GAChB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,K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,CAAC,OAAO,KAC9B,KAAK,CAAC,SAAS,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,QAAA,MAAM,UAAU,uFA4Mf,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { TeethSelector, TeethChart, useTeethSelectorContext, } from "./components/teeth-selector";
2
+ export { TeethPreview } from "./components/teeth-preview";
3
+ export { teethData, adjacentTeethPairs, getTeethInRange, parseTeethSelection, formatTeethSelection, sameSide, } from "./lib/teeth";
4
+ export type { Tooth } from "./lib/teeth";
5
+ export type { TeethSelectorProps, TeethSelectorState, TeethSelectorRenderProps, TeethChartProps, TeethPreviewProps, ToothRenderProps, BridgeRenderProps, } from "./lib/types";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,UAAU,EACV,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,GACT,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC"}