82 Commits

Author SHA1 Message Date
Mats Bosson
92435b2667 Wizard component
17 tests passing. Implements WizardRoot, WizardStep, WizardStepList, WizardStepTrigger, WizardStepContent, WizardPrev, WizardNext with createControllableSignal step state, completedSteps Set, registerStep/unregisterStep registration, linear guard on triggers, onComplete callback, and Object.assign compound export.
2026-03-29 21:15:55 +07:00
Mats Bosson
f270ef64af VirtualList component 2026-03-29 21:15:40 +07:00
Mats Bosson
896819526e Form component with Zod validation
Compound Form component (Root, Field, Label, Control, Description,
ErrorMessage, Submit) with reactive error store, aria linking, and
render-prop FormControl. 10 tests across rendering and validation suites.
2026-03-29 21:15:23 +07:00
Mats Bosson
8a248958f5 Calendar component
Compound component with Root, Header, Heading, Nav, PrevButton, NextButton, Grid, GridHead, GridBody, and Cell parts. Uses Intl.DateTimeFormat for locale-aware month/year heading and weekday names, min/max date constraints, and Enter/Space keyboard selection. 16 tests passing.
2026-03-29 21:15:19 +07:00
Mats Bosson
1106c2d020 CommandPalette component 2026-03-29 21:13:39 +07:00
Mats Bosson
de1c9a1cb8 Virtual scrolling primitive 2026-03-29 21:06:06 +07:00
Mats Bosson
ff6f1bb81f Plan for advanced components
7 components: Form, Calendar, DatePicker, CommandPalette, DataTable,
VirtualList, Wizard + createVirtualizer primitive.
2026-03-29 21:03:59 +07:00
Mats Bosson
5f425f445e Wire up Card, Avatar, NavigationMenu
Phase 1 complete — 32 component exports + 6 utility exports, 353 tests
passing, build clean.
2026-03-29 20:55:25 +07:00
Mats Bosson
b4ec99fe4a Registry package scaffold
Adds the shadcn-style copy-paste layer as a new monorepo package. Includes
theme token CSS custom properties (light/dark), a cn() class-merging utility
with tests, and a reference Dialog styled component wrapping the headless
pettyui/dialog primitive with Tailwind classes.
2026-03-29 20:53:40 +07:00
Mats Bosson
56f06c961d NavigationMenu component
Horizontal nav with dropdown submenus, hover-intent delay, keyboard-accessible
trigger/content parts, and full Zod v4 schema + ComponentMeta.
2026-03-29 20:53:17 +07:00
Mats Bosson
80f7af401a Avatar component
Image + fallback pattern with idle/loading/loaded/error status tracking via context. 4 tests passing.
2026-03-29 20:52:04 +07:00
Mats Bosson
5c503ee9ef Card component
Compound API (Root/Header/Content/Footer/Title/Description) with data-scope/data-part attributes, CardPropsSchema, and CardMeta. 4 tests passing.
2026-03-29 20:51:36 +07:00
Mats Bosson
01286d8b07 Trim unused exports
Fix systemic index.ts re-export bugs (accordion, alert-dialog, breadcrumbs, tabs)
where types were claimed from wrong source files, causing DTS build failures.
2026-03-29 20:49:28 +07:00
Mats Bosson
2e3d034a12 Migrate form components to Zod props 2026-03-29 20:41:18 +07:00
Mats Bosson
c0019d57e7 Migrate navigation components to Zod props 2026-03-29 20:41:10 +07:00
Mats Bosson
fdd12f95c6 Migrate selection components to Zod props 2026-03-29 20:39:35 +07:00
Mats Bosson
6dd06986cc Migrate overlay components to Zod props 2026-03-29 20:39:28 +07:00
Mats Bosson
c4547473a4 Migrate basic components to Zod props 2026-03-29 20:38:44 +07:00
Mats Bosson
38ef3b0934 Migrate Dialog to Zod props
Centralises all Dialog prop interfaces and schemas in dialog.props.ts.
Adds DialogRootPropsSchema, DialogContentPropsSchema, and DialogMeta for
AI/MCP discovery. Sub-components now import types from the shared file.
2026-03-29 20:36:18 +07:00
Mats Bosson
f197c58296 Add Zod v4 and ComponentMeta type 2026-03-29 20:32:18 +07:00
Mats Bosson
8dc5ab32ce AI-first architecture spec
New spec supersedes all prior design docs. Phase 1 covers Zod-first
props migration for 31 components, Meta objects, Card/Avatar/NavigationMenu,
cut ContextMenu/Image/Meter, and registry scaffolding.
2026-03-29 20:28:59 +07:00
Mats Bosson
8f075f1792 feat: add 12 components — Tooltip, Popover, HoverCard, Alert, Badge,
Skeleton, Breadcrumbs, Link, Button, Image, Meter, NumberField
Floating components: Tooltip (hover/focus), Popover (click, with focus
trap and dismiss), HoverCard (hover with safe area).
Simple components: Alert (role=alert), Badge (role=status), Skeleton
(loading placeholder with data attributes).
Navigation: Breadcrumbs (nav>ol>li with separators), Link (accessible
anchor with disabled), Button (with disabled click suppression).
Data/Form: Image (Img+Fallback with loading status), Meter (like
Progress for known ranges), NumberField (spinbutton with inc/dec).
302 tests across 46 files, typecheck clean, build produces 176 files.
2026-03-29 19:34:13 +07:00
Mats Bosson
2a07d9ceaa Wire up Wave 2 exports
Adds listbox, select, combobox, dropdown-menu, context-menu, and toast
to package.json exports and tsdown build config.
2026-03-29 19:24:43 +07:00
Mats Bosson
6382a59eaf Combobox, DropdownMenu, ContextMenu, Toast
Combobox: text input + floating listbox with consumer-driven filtering,
  allowCustomValue, and aria-autocomplete support.
DropdownMenu: activation-mode menu with menuitem, menuitemcheckbox,
  menuitemradio roles, keyboard navigation, and typeahead.
ContextMenu: right-click triggered menu with virtual anchor positioning
  at pointer coordinates.
Toast: imperative API (toast(), toast.success/error/dismiss/clear) with
  reactive signal-based store and Toast.Region declarative renderer.
2026-03-29 19:23:33 +07:00
Mats Bosson
5bc9ac7b61 Listbox, Select, and list navigation
createListNavigation is the core primitive for all collection components
(Listbox, Select, Combobox, Menu). It provides value-based keyboard
navigation, selection/activation modes, typeahead, and aria-activedescendant
virtual focus.
Listbox: standalone selectable list with single/multiple selection.
Select: floating dropdown with trigger, keyboard navigation, form integration.
Also fixes exactOptionalPropertyTypes compatibility in createDisclosureState
and createListNavigation interfaces.
2026-03-29 19:12:05 +07:00
Mats Bosson
b249509cd7 Update build config
Replaces static entry map with programmatic generation from component
and utility arrays. Removes stale src/index.ts entry, adds all 16
components and 6 utilities.
2026-03-29 13:34:57 +07:00
Mats Bosson
c78a8832d9 Floating positioning primitive
Reactive wrapper around @floating-ui/dom that auto-updates floating
element position relative to an anchor. Exports createFloating,
CreateFloatingOptions, and FloatingState from primitives index.
2026-03-29 10:25:38 +07:00
Mats Bosson
06eba6d551 Plan for floating components 2026-03-29 10:21:30 +07:00
Mats Bosson
292db3a422 Architecture spec 2026-03-29 10:06:48 +07:00
Mats Bosson
d9285cc524 Suppress progressbar lint false positive 2026-03-29 09:17:14 +07:00
Mats Bosson
295dd1388c Switch to sub-path exports
Consumers use sub-path imports (e.g. "pettyui/slider") for tree-shaking.
Adds Drawer component + 15 sub-path entries to package.json exports.
2026-03-29 09:15:53 +07:00
Mats Bosson
824d12ba9a Fix Pagination disabled guards 2026-03-29 08:53:07 +07:00
Mats Bosson
a9a9506f98 Pagination component
Headless Pagination with Root, Previous, Next, Items (render-prop), and Ellipsis parts. Context-driven, fully accessible with aria attributes, 6 tests passing.
2026-03-29 08:50:50 +07:00
Mats Bosson
789f4e0328 Fix Slider NaN edge case 2026-03-29 08:35:52 +07:00
Mats Bosson
796ccab838 Slider component
Implements headless Slider with Root, Track, Range, and Thumb parts. Supports controlled/uncontrolled value, keyboard navigation (Arrow, Page, Home, End), clamping, step, orientation, and disabled state. 10 tests added, all 152 suite tests pass.
2026-03-29 08:30:31 +07:00
Mats Bosson
ddc5aa3d7f Tabs component
Implements accessible Tabs with List, Tab, Panel parts. Supports controlled/uncontrolled value, keyboard navigation (ArrowRight/Left/Home/End), automatic/manual activation mode, and full WAI-ARIA compliance (role=tablist/tab/tabpanel, aria-selected strings, aria-controls/labelledby wiring).
2026-03-29 08:26:03 +07:00
Mats Bosson
576001f89f Fix AlertDialog ARIA 2026-03-29 08:22:31 +07:00
Mats Bosson
3388dbd371 AlertDialog component
Implements AlertDialog with compound component pattern (Root, Content, Title, Description, Trigger, Cancel, Action, Portal, Overlay). Content uses role=alertdialog, aria-modal, aria-labelledby/describedby, focus trap, and scroll lock. Does not dismiss on Escape key. 8 tests passing.
2026-03-29 08:19:02 +07:00
Mats Bosson
30ee5c877e Fix Accordion per-item disabled
- Add disabled accessor to AccordionItemContextValue and itemCtx so per-item disabled prop disables the trigger button
- Use getter for itemCtx.value to stay reactive with the local proxy
- Guard onClick toggle against itemCtx.disabled() in addition to rootCtx.disabled()
- Add one-liner JSDoc to all six exported accordion interfaces
2026-03-29 08:13:45 +07:00
Mats Bosson
94822186c2 Accordion component
Headless accordion with single/multiple modes, collapsible support, keyboard navigation (ArrowDown/ArrowUp/Home/End), and full ARIA semantics.
2026-03-29 08:06:47 +07:00
Mats Bosson
4c3005aa74 Fix Collapsible controlled mode 2026-03-29 08:03:31 +07:00
Mats Bosson
7359cd8d8f Collapsible component
Implements headless Collapsible with Root, Trigger, and Content parts.
Supports controlled/uncontrolled open state, disabled state, and full
ARIA attributes (aria-expanded, aria-controls, hidden).
2026-03-29 08:00:12 +07:00
Mats Bosson
315f5e4ae2 Fix ToggleGroup disabled handling 2026-03-29 07:57:25 +07:00
Mats Bosson
40e57715f9 ToggleGroup component
Implements headless ToggleGroup with single/multiple selection modes, context-based item coordination, aria-pressed, and data-state attributes.
2026-03-29 07:55:44 +07:00
Mats Bosson
b1f0cd2e9d Fix RadioGroup aria-checked 2026-03-29 07:52:49 +07:00
Mats Bosson
c2422d2da0 RadioGroup component
Implements headless RadioGroup with root + item sub-components, keyboard navigation (ArrowDown/Up/Left/Right), controlled/uncontrolled value via createControllableSignal, and disabled state. 8 tests passing.
2026-03-29 07:50:21 +07:00
Mats Bosson
46cc41221d Fix TextField ARIA attributes 2026-03-29 07:47:38 +07:00
Mats Bosson
fce03b7531 TextField component
Headless TextField with Label, Input, Description, and ErrorMessage parts. Supports invalid, disabled, and required states with full ARIA wiring (aria-invalid, aria-required, aria-describedby, aria-errormessage). 7 tests passing.
2026-03-29 07:42:05 +07:00
Mats Bosson
c5b7260e6d Fix Progress zero value bug 2026-03-29 07:39:35 +07:00
Mats Bosson
21a7991562 Progress component
- Headless progress bar component with support for determinate and indeterminate states
- Exposes aria-valuemin, aria-valuemax, aria-valuenow, and aria-valuetext for accessibility
- Supports custom value label via getValueLabel function
- All tests passing (8/8), full suite passing (88/88), types check, biome compliant
2026-03-29 07:25:07 +07:00