53 Commits

Author SHA1 Message Date
Mats Bosson
894df74d7f DatePicker component
Composes Calendar inside a floating dropdown anchored to an input, with Intl locale formatting, controlled/uncontrolled date+open state, createDismiss for outside-click handling, and hidden input for form submission.
2026-03-29 21:20:09 +07:00
Mats Bosson
ea18b5b62c DataTable component 2026-03-29 21:17:56 +07:00
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
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
c0019d57e7 Migrate navigation components to Zod props 2026-03-29 20:41:10 +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
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
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
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
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
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
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
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
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
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
Mats Bosson
3a84dfaac9 Checkbox component 2026-03-29 07:19:39 +07:00
Mats Bosson
5af7dc6cfa Switch component
Also fix Toggle component to properly handle onChange callback and onClick handler binding.
2026-03-29 07:12:11 +07:00
Mats Bosson
d522090872 Toggle component 2026-03-29 07:08:51 +07:00
Mats Bosson
230133415b Separator component 2026-03-29 07:06:29 +07:00
Mats Bosson
7dd8615757 Package entry point and lint fixes
Adds packages/core/src/index.ts as the convenience re-export barrel for
all Dialog parts, Presence, Portal, VisuallyHidden, createFocusTrap,
createScrollLock, and createDismiss. Also resolves pre-existing biome
formatter and noNonNullAssertion violations across five files so CI passes.
2026-03-29 06:01:41 +07:00
Mats Bosson
a25244840b Clean up Dialog test 2026-03-29 05:59:50 +07:00
Mats Bosson
0155749028 Dialog tests
Adds aria and keyboard interaction tests for the Dialog component (10 new tests, 53 total passing). Also fixes DialogContent to render with the `open` attribute so the <dialog> element is accessible in JSDOM.
2026-03-29 05:56:42 +07:00
Mats Bosson
69068fbee9 Dialog component
Implements DialogRoot, Content, Title, Description, Trigger, Close, Portal, and Overlay parts with full context wiring, focus trap, scroll lock, and dismiss. Also fixes pre-existing TS6 exactOptionalPropertyTypes errors in create-disclosure-state and presence, and silences TS6.0 deprecation warnings via ignoreDeprecations.
2026-03-29 05:47:48 +07:00
Mats Bosson
de85abf548 Fix Presence reactivity 2026-03-29 05:28:35 +07:00
Mats Bosson
3374349ef2 Presence animation utility
Implements the Presence utility component with forceMount support and
data-opening/data-closing attribute signals for CSS-driven transitions.
2026-03-29 05:26:01 +07:00
Mats Bosson
be99077306 Dismiss utility with layer stack 2026-03-29 04:41:38 +07:00
Mats Bosson
18f4869b20 Scroll lock utility 2026-03-29 04:41:35 +07:00
Mats Bosson
7e201f6af6 Harden focus trap and add tests 2026-03-29 04:37:45 +07:00
Mats Bosson
5b86cb5650 Focus trap utility 2026-03-29 04:36:00 +07:00
Mats Bosson
697e80ef72 VisuallyHidden and Portal utilities 2026-03-29 03:01:52 +07:00
Mats Bosson
b291ceab50 ID registration primitive 2026-03-29 02:46:51 +07:00