Skip to content

Commit 9e319e5

Browse files
authored
Merge pull request #17 from biomathcode/feature-branch
2 parents 679ada1 + 5002975 commit 9e319e5

19 files changed

Lines changed: 888 additions & 3646 deletions

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ yarn add react-odontogram
4949

5050
```tsx
5151
import { Odontogram } from "react-odontogram";
52+
import "react-odontogram/style.css";
5253

5354
export default function App() {
5455
const handleChange = (selectedTeeth) => {
@@ -129,12 +130,19 @@ Example JSON output:
129130

130131
## ⚙️ Props
131132

132-
| Prop | Type | Default | Description |
133-
| ----------------- | ------------------------------------------- | ------- | ------------------------------------------------------- |
134-
| `onChange` | `(selectedTeeth: ToothSelection[]) => void` || Triggered whenever the user selects or deselects teeth. |
135-
| `initialSelected` | `string[]` | `[]` | Array of tooth IDs to preselect. |
136-
| `readOnly` | `boolean` | `false` | Makes the odontogram non-interactive (view-only). |
137-
| `className` | `string` || Optional class for custom styling. |
133+
| Prop | Type | Default | Description |
134+
| --- | --- | --- | --- |
135+
| `defaultSelected` | `string[]` | `[]` | Tooth IDs selected on first render. |
136+
| `onChange` | `(selectedTeeth: ToothSelection[]) => void` || Called whenever selection changes. |
137+
| `name` | `string` | `"teeth"` | Name used for hidden form input. |
138+
| `className` | `string` | `""` | Additional class for wrapper customization. |
139+
| `theme` | `"light" \| "dark"` | `"light"` | Applies built-in light/dark palette. |
140+
| `colors` | `{ darkBlue?: string; baseBlue?: string; lightBlue?: string }` | `{}` | Override palette colors. |
141+
| `notation` | `"FDI" \| "Universal" \| "Palmer"` | `"FDI"` | Display notation in native tooth titles/tooltips. |
142+
| `tooltip` | `{ placement?: Placement; margin?: number; content?: ReactNode \| ((payload?: ToothSelection) => ReactNode) }` | `{ placement: "top", margin: 10 }` | Tooltip behavior and custom content renderer. |
143+
| `showTooltip` | `boolean` | `true` | Enables/disables tooltip rendering. |
144+
| `showHalf` | `"full" \| "upper" \| "lower"` | `"full"` | Render full chart or only upper/lower arches. |
145+
| `maxTeeth` | `number` | `8` | Number of teeth per quadrant (for baby/mixed dentition views). |
138146

139147
---
140148

@@ -144,14 +152,8 @@ Each tooth is internally defined in a structured format:
144152

145153
```ts
146154
{
147-
id: "teeth-21",
148-
name: "21",
155+
name: "1",
149156
type: "Central Incisor",
150-
notations: {
151-
fdi: "21",
152-
universal: "9",
153-
palmer: "1UL"
154-
},
155157
outlinePath: "...",
156158
shadowPath: "...",
157159
lineHighlightPath: "..."
@@ -190,5 +192,3 @@ MIT © [biomathcode](https://github.com/biomathcode)
190192
## 💬 Feedback
191193

192194
If this library helps your dental project, please ⭐ the repo or open issues/PRs for enhancements!
193-
194-

lefthook.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ pre-commit:
44
lint:
55
run: git add -u
66
typecheck:
7-
run: pnpm tsc
7+
run: npx pnpm tsc
88
build:
9-
run: pnpm build
9+
run: npx pnpm build
1010
test:
11-
run: pnpm test:ci
11+
run: npx pnpm test:ci

package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,17 @@
3535
"types": "./dist/index.d.ts",
3636
"exports": {
3737
".": {
38+
"types": "./dist/index.d.ts",
3839
"require": "./dist/index.js",
39-
"import": "./dist/index.mjs"
40-
}
40+
"import": "./dist/index.mjs",
41+
"default": "./dist/index.mjs"
42+
},
43+
"./style.css": "./dist/index.css"
4144
},
45+
"sideEffects": [
46+
"*.css",
47+
"**/*.css"
48+
],
4249
"files": [
4350
"dist"
4451
],
@@ -65,11 +72,11 @@
6572
"@biomejs/biome": "1.9.4",
6673
"@ryansonshine/commitizen": "4.2.8",
6774
"@ryansonshine/cz-conventional-changelog": "3.3.4",
68-
"@storybook/addon-a11y": "^10.0.8",
69-
"@storybook/addon-links": "10.0.8",
70-
"@storybook/addon-themes": "^10.0.8",
75+
"@storybook/addon-a11y": "^10.2.10",
76+
"@storybook/addon-links": "10.2.10",
77+
"@storybook/addon-themes": "^10.2.10",
7178
"@storybook/addon-webpack5-compiler-swc": "4.0.2",
72-
"@storybook/react-webpack5": "10.0.8",
79+
"@storybook/react-webpack5": "10.2.10",
7380
"@testing-library/jest-dom": "6.6.3",
7481
"@testing-library/react": "16.2.0",
7582
"@types/node": "22.13.11",
@@ -87,14 +94,14 @@
8794
"react-dom": "18.3.1",
8895
"react-test-renderer": "18.3.1",
8996
"release-it": "18.1.2",
90-
"storybook": "10.0.8",
97+
"storybook": "10.2.10",
9198
"ts-node": "10.9.2",
9299
"tsconfig-paths": "4.2.0",
93100
"tsup": "8.4.0",
94101
"tsx": "4.19.3",
95102
"typescript": "5.8.2",
96103
"vitest": "3.0.9",
97-
"@storybook/addon-docs": "10.0.8"
104+
"@storybook/addon-docs": "10.2.10"
98105
},
99106
"peerDependencies": {
100107
"react": ">=17",

0 commit comments

Comments
 (0)