@petrarca/sonnet-core
v0.4.2
Published
Shared utilities, schema tools, and hooks for the Petrarca Sonnet component library
Readme
@petrarca/sonnet-core
Foundation utilities for the Petrarca Sonnet component library. Leaf package — all other Sonnet packages depend on it.
Entry points
| Import | What |
|---|---|
| @petrarca/sonnet-core | cn, isEqual, formatDateTime, normalizeError, logging |
| @petrarca/sonnet-core/schema | JSON Schema types, resolution, validation, diffing |
| @petrarca/sonnet-core/search | Filter expression types (FilterExpr, buildListParams) |
| @petrarca/sonnet-core/hooks | React hooks (see below) |
| @petrarca/sonnet-core/entityOptions | Entity option fetcher context for async select/autocomplete |
Hooks
| Hook | Purpose |
|---|---|
| useClipboard | Copy text to clipboard with copied-state timeout |
| useDisclosure | Boolean open/close/toggle state |
| useFormState | Generic form state with dirty tracking |
| useEntityOptions | Async entity fetching for select/autocomplete components |
| useResizablePanel | Drag-to-resize panel width |
| useTreeExpansion | Expand/collapse state for TreeView components |
Install
pnpm add @petrarca/sonnet-coreLicense
See LICENSE.md.
