@joewinke/jatui 0.41.1 → 0.43.0

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.
Files changed (75) hide show
  1. package/CLAUDE.md +32 -6
  2. package/THIRD_PARTY_NOTICES.md +14 -0
  3. package/dist/actions/dismissOutside.d.ts +52 -0
  4. package/dist/actions/dismissOutside.js +80 -0
  5. package/dist/components/BookingScheduler.svelte +412 -0
  6. package/dist/components/BookingScheduler.svelte.d.ts +66 -0
  7. package/dist/components/CalendarPicker.svelte +190 -205
  8. package/dist/components/CalendarPicker.svelte.d.ts +19 -1
  9. package/dist/components/DatePicker.svelte +419 -0
  10. package/dist/components/DatePicker.svelte.d.ts +44 -0
  11. package/dist/components/DateRangePicker.svelte +471 -5
  12. package/dist/components/DateRangePicker.svelte.d.ts +32 -3
  13. package/dist/components/EventCalendar.svelte +1324 -0
  14. package/dist/components/EventCalendar.svelte.d.ts +101 -0
  15. package/dist/components/FileDropzone.svelte +165 -3
  16. package/dist/components/FileDropzone.svelte.d.ts +9 -0
  17. package/dist/components/TextInput.svelte +71 -20
  18. package/dist/components/TextInput.svelte.d.ts +7 -0
  19. package/dist/components/ThumbnailGrid.svelte +106 -1
  20. package/dist/components/ThumbnailGrid.svelte.d.ts +7 -0
  21. package/dist/components/TimeSlotPicker.svelte +174 -108
  22. package/dist/components/TimeSlotPicker.svelte.d.ts +27 -0
  23. package/dist/components/basic/Alert.svelte +113 -16
  24. package/dist/components/basic/Alert.svelte.d.ts +17 -1
  25. package/dist/components/basic/Checkbox.svelte +53 -1
  26. package/dist/components/basic/Checkbox.svelte.d.ts +6 -0
  27. package/dist/components/basic/RadioGroup.svelte +59 -3
  28. package/dist/components/basic/RadioGroup.svelte.d.ts +15 -0
  29. package/dist/components/basic/Slider.svelte +257 -9
  30. package/dist/components/basic/Slider.svelte.d.ts +14 -2
  31. package/dist/components/basic/sliderMath.d.ts +29 -0
  32. package/dist/components/basic/sliderMath.js +64 -0
  33. package/dist/components/calendar/CalendarHeader.svelte +98 -0
  34. package/dist/components/calendar/CalendarHeader.svelte.d.ts +24 -0
  35. package/dist/components/calendar/MonthGrid.svelte +361 -0
  36. package/dist/components/calendar/MonthGrid.svelte.d.ts +55 -0
  37. package/dist/components/calendar/calendarGrid.d.ts +219 -0
  38. package/dist/components/calendar/calendarGrid.js +494 -0
  39. package/dist/components/calendar/createCalendarGrid.d.ts +25 -0
  40. package/dist/components/calendar/createCalendarGrid.js +57 -0
  41. package/dist/components/calendar/dayOverlap.d.ts +92 -0
  42. package/dist/components/calendar/dayOverlap.js +147 -0
  43. package/dist/components/calendar/eventCalendar.d.ts +75 -0
  44. package/dist/components/calendar/eventCalendar.js +187 -0
  45. package/dist/components/calendar/index.d.ts +32 -0
  46. package/dist/components/calendar/index.js +25 -0
  47. package/dist/components/calendar/monthPacking.d.ts +97 -0
  48. package/dist/components/calendar/monthPacking.js +254 -0
  49. package/dist/components/calendar/timeSlots.d.ts +57 -0
  50. package/dist/components/calendar/timeSlots.js +163 -0
  51. package/dist/components/field/FieldHint.svelte +29 -0
  52. package/dist/components/field/FieldHint.svelte.d.ts +17 -0
  53. package/dist/components/field/FieldLabel.svelte +100 -0
  54. package/dist/components/field/FieldLabel.svelte.d.ts +29 -0
  55. package/dist/components/form-cards/CheckGlyph.svelte +138 -0
  56. package/dist/components/form-cards/CheckGlyph.svelte.d.ts +29 -0
  57. package/dist/components/form-cards/CheckboxCard.svelte +120 -0
  58. package/dist/components/form-cards/CheckboxCard.svelte.d.ts +33 -0
  59. package/dist/components/form-cards/ChoiceCard.svelte +156 -0
  60. package/dist/components/form-cards/ChoiceCard.svelte.d.ts +42 -0
  61. package/dist/components/form-cards/SwitchCard.svelte +114 -0
  62. package/dist/components/form-cards/SwitchCard.svelte.d.ts +28 -0
  63. package/dist/components/toast/ToastHost.svelte +56 -3
  64. package/dist/components/toast/ToastHost.svelte.d.ts +9 -1
  65. package/dist/components/toast/ToastItem.svelte +75 -23
  66. package/dist/components/toast/ToastItem.svelte.d.ts +2 -0
  67. package/dist/components/uploadProgress.d.ts +30 -0
  68. package/dist/components/uploadProgress.js +47 -0
  69. package/dist/index.d.ts +29 -2
  70. package/dist/index.js +22 -1
  71. package/dist/stores/toast.d.ts +35 -0
  72. package/dist/stores/toast.js +15 -1
  73. package/dist/styles/motion.css +72 -0
  74. package/dist/styles/rail.css +51 -0
  75. package/package.json +6 -1
package/CLAUDE.md CHANGED
@@ -21,7 +21,8 @@ Then import:
21
21
 
22
22
  | Component | Purpose | Key Props |
23
23
  |-----------|---------|-----------|
24
- | `TextInput` | Text input with label, error, icon slots | `label`, `value` (bindable), `placeholder`, `error`, `disabled` |
24
+ | `TextInput` | Text input with label, error, help, count, floating label. `leading`/`trailing` snippets put an icon or addon ("https://", "kg", a clear button) inside the field — the DaisyUI `input` skin moves to a wrapper and the error shake follows it. `labelTooltip` adds an info button after the label (shared `use:tooltip`). Label and help/error lines are the exported `FieldLabel` / `FieldHint`. | `label`, `value` (bindable), `placeholder`, `error`, `helpText`, `disabled`, `leading?`/`trailing?` (snippets), `labelTooltip?`, `floatingLabel?` |
25
+ | `FieldLabel` / `FieldHint` | The label row and help/error line TextInput uses, exported so custom controls (selects, PhoneInput, your own) line up identically. FieldLabel: `required` asterisk, `tooltip` info button (24px target, keyboard-focusable, rendered outside the `<label>` so it never focuses the input); with no tooltip it renders the exact bare `<label class="label">` TextInput always had. FieldHint: `error` → error tone + `role="alert"`. | FieldLabel: `for`, `text`, `required?`, `tooltip?`, `tooltipLabel?`, `children?` · FieldHint: `id`, `text`, `error?` |
25
26
  | `TextArea` | Multiline text input. Auto-grow (`autoResize`, or implied by `maxRows`) grows a whole line at a time from `minRows` (default `rows`) to `maxRows`, then scrolls — CSS `field-sizing: content` where supported, row-quantized JS fallback (`textareaRowsHeight`) elsewhere. | `label`, `value` (bindable), `placeholder`, `rows`, `minRows?`, `maxRows?`, `autoResize?`, `error`, `maxlength` |
26
27
  | `SelectInput` | Dropdown select | `label`, `value` (bindable), `options: SelectOption[]`, `placeholder` |
27
28
  | `SegmentedControl` | Single-select toggle group that SETS A VALUE (Tabs switch panels): `role="radiogroup"` + `role="radio"`, roving tabindex, arrows move AND select, Home/End, disabled options skipped; sliding thumb on motion tokens (jumps under reduced motion). `solid` (track + raised thumb) or `plain`. Options may be plain strings. | `options: (SegmentedOption \| string)[]`, `value` (bindable), `size?` (`xs\|sm\|md`), `variant?`, `fullWidth?`, `disabled?`, `ariaLabel?`, `option?` (snippet), `onChange?` |
@@ -38,21 +39,33 @@ Then import:
38
39
  | `IconSelector` | Searchable, paged icon picker — icon set is fully prop-driven (any component accepting `{ size, class }`, e.g. lucide-svelte), so no icon-library dependency; optional `icon` snippet for custom rendering. Keyboard: arrows move, Enter selects, Home/End, PgUp/PgDn page, Esc closes. | `icons: IconSelectorOption[]`, `selectedIcon` (bindable), `onSelect`, `label`, `colorClass`, `compact`, `columns`, `perPage`, `icon` |
39
40
  | `ImageUpload` | Drag-drop image upload | `value` (bindable), `accept`, `maxSize` |
40
41
  | `SmartImageEditor` | AI-powered image upload with background removal and multi-variant processing pipeline. **Preferred over `ImageUpload` in editor contexts.** Two modes: simple (drop-in replacement, outputs blob URL) and editor (POST multipart to backend → variant grid). | `value` (bindable), `spec?: ImageProcessingSpec`, `uploadEndpoint?`, `onComplete?`, `accept?`, `maxSizeMb?` |
41
- | `FileDropzone` | Multi-file/folder/ZIP drag-drop upload zone. Handles FileSystem API folder recursion, MIME/size validation, and shows a pending-file grid. Calls `onFilesSelected(files, errors)` with validated `File[]`. Accepts already-uploaded files via `uploadedFiles: FileDropzoneFile[]` for post-upload display. | `accept?: string[]`, `maxSize?`, `maxFiles?`, `multiple?`, `uploadedFiles?`, `isUploading?`, `isExtracting?`, `dropLabel?`, `dropSubtext?`, `onFilesSelected?` |
42
+ | `FileDropzone` | Multi-file/folder/ZIP drag-drop upload zone. Handles FileSystem API folder recursion, MIME/size validation, and shows a pending-file grid. Calls `onFilesSelected(files, errors)` with validated `File[]`. Accepts already-uploaded files via `uploadedFiles: FileDropzoneFile[]` for post-upload display. Pass `progress` (0–100) to draw upload progress on the zone's own border (dashed border cross-fades into a primary stroke that fills clockwise, plus a sliding `%` badge; `role="progressbar"`, no layout shift, reduced-motion/calm gated). | `accept?: string[]`, `maxSize?`, `maxFiles?`, `multiple?`, `uploadedFiles?`, `isUploading?`, `isExtracting?`, `progress?`, `progressLabel?`, `dropLabel?`, `dropSubtext?`, `onFilesSelected?` |
42
43
  | `FileThumbnail` | File thumbnail with MIME-aware icon fallback. Shows an `<img>` for image files (with loading/error states) and typed icons for PDF, ZIP, CAD, and generic files. Size variants: `sm`, `md`, `lg`, `xl`. | `name`, `mimeType`, `url?`, `size?` |
44
+ | `Checkbox` | Native checkbox with label, indeterminate, variants and a 24px target. `animated` draws the box with the shared `CheckGlyph` and draws the tick on (`--motion-fast` × `--motion-glide`, `pathLength=1` dashoffset) when the user checks it — never on load; the native input stays in the DOM, visually hidden. | `checked` (bindable), `label`, `size`, `variant`, `indeterminate`, `animated?`, `onchange` |
45
+ | `CheckboxCard` | Whole-card checkbox: title + description (+ `icon` snippet) on a `ChoiceCard`, animated `CheckGlyph` tick, description wired as `aria-describedby`. Selected = primary border + 6% tint, flat at rest. | `checked` (bindable), `title`, `description?`, `icon?`, `indeterminate?`, `disabled?`, `name?`, `value?`, `size?` (`sm`\|`md`), `variant?`, `controlPosition?` (`start`), `animated?` (true), `onchange?` |
46
+ | `SwitchCard` | Settings row where the whole card toggles a `role="switch"` (DaisyUI `toggle`, motion-token spring). No selected tint — on/off is a setting, not a pick. | `checked` (bindable), `title`, `description?`, `icon?`, `disabled?`, `size?`, `variant?`, `controlPosition?` (`end`), `onchange?` |
47
+ | `RadioGroup` | Native radio group (arrow keys rove natively). `display="card"` renders each option as a `ChoiceCard` with `description`/`icon` per option; `label` names the group. | `value` (bindable), `options: RadioOption[]` (`{value, label, description?, icon?, disabled?}`), `name`, `display?` (`default`\|`card`), `orientation?`, `label?`, `controlPosition?`, `variant`, `size` |
48
+ | `ChoiceCard` / `CheckGlyph` | The shared pieces: ChoiceCard is the `<label>` card shell (pass any native control as the `control` snippet; checked/focus/disabled styling reads the control via `:has()`); CheckGlyph is the presentational box + draw-on tick (`aria-hidden` — pair it with a real input). | ChoiceCard: `title`, `description?`, `control` (snippet), `icon?`, `for?`, `descriptionId?`, `selectedTint?`, `controlPosition?`, `size?` · CheckGlyph: `checked`, `indeterminate`, `animate`, `size`, `variant` |
49
+ | `Slider` | DaisyUI range. Pass a number for one thumb (unchanged markup) or a `[lo, hi]` pair for two thumbs — two stacked native ranges over one drawn track, so native keys + AT work; thumbs can't cross (`minGap`). `bubble` (`always`\|`drag`\|`none`) shows a value bubble that tracks each thumb; `formatValue` feeds the bubble, `showValue` and `aria-valuetext`. Pure helpers exported (`snapToStep`, `moveThumb`, `normalizePair`, `percentOf`, `bubbleLeft`). | `value` (bindable `number \| [number, number]`), `min`, `max`, `step`, `bubble?`, `formatValue?`, `label?`, `thumbLabels?`, `minGap?`, `showValue?`, `onchange?`, `onvaluechange?` |
43
50
  | `SignaturePad` | Draw signature on canvas (mouse + touch). Emits base64 PNG on each stroke-end via bindable `signatureData` or `onSignatureChange(data)`. Exposes `clear()`/`isEmpty()`. Pass `disabled` for a dimmed, non-interactive preview. | `signatureData` (bindable), `onSignatureChange`, `label`, `width`, `height`, `disabled`, `required` |
44
51
 
45
52
  ### Scheduling & Time
46
53
 
47
54
  | Component | Purpose | Key Props |
48
55
  |-----------|---------|-----------|
49
- | `CalendarPicker` | Month calendar with day selection | `selectedDate` (bindable), `availabilityCounts`, `onDateSelect` |
50
- | `DateRangePicker` | Start/end date range | `selectedRange` (bindable), `onRangeChange` |
51
- | `TimeSlotPicker` | Time slot grid selector | `slots: TimeSlot[]`, `selectedSlot` (bindable), `onSlotSelect` |
56
+ | `CalendarPicker` | Booking month calendar on the shared grid: `role="grid"` with APG keys (arrows, Home/End, PageUp/PageDown, Shift+Page = year), availability dots in status tokens (announced in each day's name), booking-window rules, static accent map. Six-week `getAvailability` range as before. | `onSelect`, `selectedDate` (bindable), `getAvailability`, `isDateEnabled`, `maxDaysInAdvance` (90), `minNoticeHours` (24), `weekdaysOnly` (true), `accentColor`, `weekStart?` (0 \| 'locale'), `locale?`, `showLegend?`, `size?` |
57
+ | `DatePicker` | Date field replacing `<input type="date">`: trigger + `use:floating` popover grid, typed entry in the LOCALE's order (MM/DD/YYYY en-US, DD/MM/YYYY en-GB — commits on Enter/blur, reverts on Esc or unreadable input), Today, optional pending/Apply step. `name` posts the ISO value; `required` validates natively. | `value` (bindable `YYYY-MM-DD \| null`), `open` (bindable), `onChange(value, date)`, `label`, `name`, `min`/`max` (ISO or Date), `isDateEnabled`, `weekdaysOnly`, `weekStart` ('locale'), `locale`, `format`, `commit` ('instant' \| 'apply'), `typed`, `clearable`, `error`, `size` |
58
+ | `DateRangePicker` | Two modes. `presets` (default, unchanged): the filter-bar dropdown with string presets + native From/To. `mode="calendar"`: two-month range calendar — preset sidebar (Today … Last year + All time), hover/keyboard preview band, typed Start/End, "N days selected", Apply/Cancel. Calendar mode still calls `onRangeChange(presetId \| 'custom', from, to)`. | `selectedRange`, `customFrom`/`customTo`, `onRangeChange`, `compact` · calendar: `mode`, `value` (bindable `{start,end}` ISO), `onChange(range, presetId)`, `presets: RangePreset[]`, `months` (1\|2), `commit` ('apply'), `min`/`max`, `isDateEnabled`, `weekStart`, `nameStart`/`nameEnd` |
59
+ | `TimeSlotPicker` | Slots grouped morning/afternoon/evening as one `role="radiogroup"` (`role="radio"` + `aria-checked`, full spoken date+time): roving arrows skip unavailable slots, Up/Down jump a visual row, Home/End, Space/Enter choose. Times and grouping follow `timeZone`'s wall clock. | `slots: TimeSlot[]`, `onSelect`, `selectedSlot`, `loading`, `accentColor`, `hourCycle?` ('h12' \| 'h23'), `timeZone?` (IANA), `locale?`, `selectOnFocus?`, `timezone?` (snippet row above the slots) |
60
+ | `BookingScheduler` | Calendly-shaped composition over `CalendarPicker` + `TimeSlotPicker`: details pane (host, duration, location, zone), time-zone select + 12h/24h toggle, slot list, Confirm. Container-query layout (3 panes → 2 → 1). Host supplies data; nothing is booked here. | `getSlots(date, timeZone)` (sync/async, stale responses dropped), `getAvailability?`, `selectedDate`/`selectedSlot`/`timeZone`/`hourCycle` (bindable), `title`, `durationMinutes`, `hostName`, `location`, `description`, `details?` (snippet), `onConfirm(slot, {timeZone})`, `confirming` |
61
+ | `EventCalendar` | Month / week / day / agenda event calendar, engine upstreamed from MOS `CalendarGrid`: one lane allocator per month row (`packWeek`/`computeVisibility`, measured lane capacity), "+N more" expands the week IN PLACE, week/day time grid with side-by-side overlap layout (`layoutDay`) + all-day bar row + now-line, agenda list, month-switcher pill (the shared month panel), details popover snippet, HTML5 drag-to-move, drag- or Shift+arrow range select. Event colours from `--jatui-event-N{,-bg,-fg}`. Generic over your event type. | `events: CalendarEventItem[]` (`{id,title,start,end?,allDay?,color?: 1-6 \| semantic,…}`), `view`/`date` (bindable), `views`, `weekStart`, `locale`, `hourCycle`, `dayStartHour`/`dayEndHour`, `hourHeight`, `height`, `eventDetails?`/`eventContent?`/`toolbarEnd?` (snippets), `moreAction`, `onEventClick`, `onDayClick`, `onCreate(date, hour?)`, `onEventMove(ev, {date, hour?, allDay})`, `onRangeSelect`, `onRangeChange(range, view)` |
62
+ | `CalendarMonthGrid` | The shared month panel every picker uses — exported for custom surfaces. `<table role="grid">`, roving tabindex, range band that bridges cell gaps and rounds at week edges, disabled days stay focusable (`aria-disabled`), `day` snippet + `describeDay` for extra per-day content/name. Pair with `createCalendarGrid()`. | `month`, `focusedDate`, `onFocusDate`, `onSelect`, `selected?`, `range?`, `isDisabled?`, `min`/`max`, `weekStart`, `locale`, `showOutsideDays`, `fixedWeeks`, `size`, `onHover?`, `day?`, `describeDay?` |
52
63
  | `AvailabilityModal` | Date override editor (modal) | `date`, `overrides`, `onSave`, `onClose` |
53
64
  | `BookingForm` | Guest info form for booking | `onSubmit`, `submitting`, `requirePhone`, `accentColor`, `showAttendeeOption` |
54
65
  | `CountdownTimer` | Countdown to target date | `targetDate: Date`, `label` |
55
66
 
67
+ **Calendar core (`jatui/calendar`, also on the root).** Plain `Date` + `Intl`, no date library. `createCalendarGrid({ initial?, min?, max?, months? })` (getters) → reactive `viewMonth`, `panels`, `focusedDate`, `canPrev`/`canNext`, `focus(date)` (panels follow), `shift(n)`, `reset(date)`. Pure helpers: `buildMonthMatrix(month, weekStart, fixedWeeks?)`, `nextFocusDate(date, key, {weekStart, min, max, rtl, shiftKey})` (the APG key map), `weekStartForLocale` (`Intl.Locale#getWeekInfo` + CLDR fallback), `parseTypedDate`/`formatTypedDate`/`datePlaceholder` (locale field order), `toIsoDate`/`parseIsoDate` (local days, never UTC-shifted), ranges (`pickRangeDate`, `rangeCellState`, `rangeDayCount`, `formatRangeLabel`), presets (`defaultRangePresets()`, `RangePreset = {id, label, range: IsoDateRange \| (now) => IsoDateRange}`, `matchPreset`), time slots (`formatSlotTime`, `groupSlotsByDayPart`, `nextSlotIndex`, `localeHourCycle`, `commonTimeZones`, `timeZoneOffsetLabel`), and the MOS event engine with its tests (`packWeek`, `computeVisibility`, `layoutDay`, `eventInterval` — generic over any `PackableEvent {id, title, start, end?, allDay?}`, so MOS's `CalendarEvent` fits as-is). Demos: `/components/date-picker`, `date-range-picker`, `calendar-picker`, `time-slot-picker`, `booking-scheduler`, `event-calendar`, `calendar-month-grid`.
68
+
56
69
  ### Display & Feedback
57
70
 
58
71
  | Component | Purpose | Key Props |
@@ -62,6 +75,8 @@ Then import:
62
75
  | `CloseButton` | The one ✕ for dialogs, drawers, sheets, toasts and lightboxes — an IconButton with a built-in X whose stroke is a true CSS pixel at every size. Modal, Drawer, BottomSheet and MediaLightbox use it. | `label?` ('Close'), `size?` ('sm'), `variant?`, `shape?` ('circle'), `tooltip?`, `onclick` |
63
76
  | `LinkButton` | Text action styled as a link: `<a>` with `href`, `<button>` without; underline on hover (or always). `external` adds new-tab + rel=noopener + an SR hint. | `href?`, `tone?` (inherit\|primary\|muted\|error), `size?`, `underline?`, `external?`, `disabled?`, `onclick?`, `children` |
64
77
  | `ProgressButton` | Multi-phase async submit button (upstreamed from the JAT IDE): walks through the **named phases** of the work (`phases: [{key,label}]` in order) instead of a blank spinner — spinner + current phase label with shimmer, a fill bar that advances to `(index+1)/N`, disabled while busy, green check-flash on `success`. Caller owns the state machine (`phase` / `success`). Renders through the shared `Button`, so `class` composes with join patterns. | `phase?` (null = idle), `phases?: Phase[]`, `idleLabel?`, `success?`, `successLabel?`, `variant?`, `size?`, `disabled?`, `type?`, `class?`, `onclick?`, `children` |
78
+ | `Alert` | Contextual feedback (info/success/warning/error). Optional `dismissible` × button (real `<button>`, `dismissLabel`) — exits on `motionScale`, then `onClose` fires; `action` snippet for a CTA; `introDelay` (ms) enters after surrounding UI settles (reduced motion: waits, then appears instantly); `variant="card"` = vertical sidebar density (icon on top, title, text, full-width CTA). | `type`, `title`, `dismissible?`, `onClose?`, `action?` (snippet), `introDelay?`, `variant?` ('default'\|'card'), `children` |
79
+ | `ToastHost` | Toast mount point — place once at app root; `showToast()` renders into it. `position` = `bottom-end` (default) \| `bottom-start` \| `bottom-center` \| `top-end` \| `top-start` \| `top-center` (logical start/end; top positions stack newest nearest the edge). Toasts keep pause-on-hover, drag-to-dismiss, undo countdown, collapsible `details`; add an optional `title`, `avatar` or `icon`, several `actions` (`{label, onClick, variant?: 'primary'\|'ghost'}` — legacy single `action` still works), and `showProgress` (countdown bar that pauses with the timer). Enter/exit blur is off under `data-motion="calm"` and reduced motion. `showToast({ type?, message, title?, icon?, avatar?, actions?, action?, details?, meta?, durationMs?, onUndo?, showProgress? })`. | `position?` |
65
80
  | `Badge` | Status/label badge | `variant`, `size`, `children` (snippet) |
66
81
  | `AnimatedNumber` | Number that animates to its new value. `mode='roll'` (default) is the per-digit odometer; `mode='tween'` counts from the previous value (`svelte/motion` Tween, `--motion-move` duration scaled by `data-motion`, instant under reduced motion; screen readers get the final value only). | `value`, `format?: Intl.NumberFormatOptions`, `mode?`, `duration?` (ms) |
67
82
  | `StatCard` | KPI tile: label, a value that tweens to its new number, delta chip toned by sign (success/error/neutral tokens; `invertDelta` for metrics where down is good), caption, icon tile (`tone`), info tooltip, inline SVG sparkline (no d3). `variant='footer'` moves caption + delta into a footer band; `href` makes the card a link; `loading` skeleton. A numeric `delta` is a FRACTION (0.125 → "+12.5%"). | `label`, `value`, `format?`, `animate?` (`tween\|roll\|false`), `delta?`, `deltaFormat?`, `deltaTone?`, `invertDelta?`, `caption?`, `info?`, `sparkline?: number[]`, `variant?`, `tone?`, `size?`, `href?`, `loading?`, `icon?`/`children?` (snippets) |
@@ -158,7 +173,7 @@ Item-by-item review surfaces (MOS review-ux, design mos-z8vgx). One `VerdictOpti
158
173
 
159
174
  | Component | Purpose | Key Props |
160
175
  |-----------|---------|-----------|
161
- | `ThumbnailGrid` | Generic thumbnail strip (chimaro port) — image tiles with text-tile fallback, +N overflow counter, remove/add affordances. Decoupled from any media library: pass `{id, url, alt}` items, or a `cell` snippet for full control of tile contents. `removeMode` — `'hover'` (default) reveals the × on hover/focus and keeps it visible on coarse (touch) pointers (ContextMenuTrigger pattern); `'always'` pins it for touch-first flows. `gridCols` (e.g. `'grid-cols-2 sm:grid-cols-4'`) switches the strip to a responsive CSS grid with column-filling tiles. | `items: ThumbnailItem[]`, `max`, `size` (`xs\|sm\|md\|lg`), `removable`+`onRemove`, `removeMode` (`hover\|always`), `addable`+`onAdd`, `onSelect`, `gridCols`, `class`, `cell` snippet |
176
+ | `ThumbnailGrid` | Generic thumbnail strip (chimaro port) — image tiles with text-tile fallback, +N overflow counter, remove/add affordances. Decoupled from any media library: pass `{id, url, alt}` items, or a `cell` snippet for full control of tile contents. `removeMode` — `'hover'` (default) reveals the × on hover/focus and keeps it visible on coarse (touch) pointers (ContextMenuTrigger pattern); `'always'` pins it for touch-first flows. `gridCols` (e.g. `'grid-cols-2 sm:grid-cols-4'`) switches the strip to a responsive CSS grid with column-filling tiles. Items take optional `progress` (0–100): an upload ring draws around the tile and a tiny % occupies the remove-× corner, cross-fading into the × at 100 (same slot, no layout shift; per-tile `role="progressbar"`). | `items: ThumbnailItem[]` (`{id, url?, alt, progress?}`), `max`, `size` (`xs\|sm\|md\|lg`), `removable`+`onRemove`, `removeMode` (`hover\|always`), `addable`+`onAdd`, `onSelect`, `gridCols`, `class`, `cell` snippet |
162
177
  | `MediaWorkbench` | Full-featured image editor modal — upload, AI generate, AI edit, background removal, annotation canvas. **Preferred over `SmartImageEditor` for new image fields.** Two-column modal: preview left, 4 action tabs right (Generate, Edit, Remove BG, Annotate). Save uploads blob to `uploadEndpoint` or emits `onComplete`. Requires proxy endpoints from jst-23w1l.2. | `value` (bindable `string \| null`), `uploadEndpoint?` (default `/api/media`), `onComplete?`, `accept?` |
163
178
  | `MediaLightbox` | Full-screen media preview — z-9040 backdrop, arrow-key paging when given an array, `+/-/0` zoom, download action, Escape/backdrop close. **Use this for the general "just show it big" case** — replaces hand-rolled `fixed inset-0 z-[9040]` modals. For annotated / markup-overlaid image previews, use `ImageLightbox` instead. | `src?`, `filename?`, `kind?: 'image' \| 'video'`, `downloadUrl?`, `items?: MediaItem[]`, `initialIndex?`, `onClose?`, `zIndex?` |
164
179
  | `VideoPlayer` | **The default video surface — reach for this over a bare `<video controls>`.** One timeline band carrying a waveform-envelope scrubber, chapter flags (top edge), bookmark diamonds (bottom edge), diarized speaker colouring and scroll-to-zoom, plus an optional transcript pane (click to seek, active line auto-scroll, solo/skip per speaker, `Shift+T` toggle) and a "Talk time" legend (2+ speakers only; one voice gets no legend and no per-row name). **`kind="audio"` renders no stage**, and **`transport="band"`** (the audio default) drops the native `<video controls>` bar for a transport row on the band (play/pause, `now / total`, speed, mute + volume, fullscreen for video), so the band is the ONE timeline. **Every intelligence prop is optional** — a bare mp4 still gets the scrubber, hover-time card, wheel volume and the full keyboard map (Space/K, arrows/J/L, vol/mute, −/= speed + Backspace reset, </> frame step, [/] chapters, B bookmark, t theater, ? help overlay), and each pane lights up as its data arrives (nothing shifts layout when diarization lands late). Wheel means volume over the video (shift = seek, alt = speed; a wheel/keyboard volume change also flashes a clear volume OSD — glyph, level bar and %, "Muted" at 0, opacity-only fade) and zoom over the band; Shift+wheel over the transcript steps line by line (a plain wheel over the transcript scrolls the pane natively — the page is never trapped). Internals live in `src/lib/video/` (band/keys/rate/deepLink/settings + contracts for audio/night/presence — see that README; gap audit vs the extension: `VIDEO-PLAYER-GAP-AUDIT.md`). | `src`, `kind?` (`'video' \| 'audio'`), `transport?` (`'native' \| 'band'`), `chapters?`, `speakers?`, `transcript?`, `bookmarks?`, `waveform?`, `talkTime?`, `startAt?`, `poster?`, `captionsSrc?`, `crossorigin?` (`'anonymous'` — what frame-reading features need), `syncUrlTime?` (`?t=` deep-link, opt-in), `transcriptPosition?` (`'below' \| 'side'`), `transcriptMaxHeight?` (pane bound — default `min(40vh, 28rem)` below, the player's height beside; the active-line follow scrolls only the pane; only a gesture that actually moves the PANE pauses it — a wheel that scrolls the page doesn't — behind a "Resume following" pill, and it resumes by itself on seek / line or chapter click / play after pause / `followResumeMs` (6000) idle while playing; a hovered chapter fills its whole span in the theme accent with full-height edges), `followResumeMs?`, `theater?` (bindable — theater mode, NOT fullscreen: control-bar button + `t`, the HOST lays the page out full-width; a side transcript moves below; remembered per viewer as the `player.theater` setting via `settingsStore`, else guarded localStorage), `theaterButton?` (true), `onTheaterChange?`, `onTimeUpdate?`, `onAddBookmark?`, `onBookmarkContext?` |
@@ -478,9 +493,20 @@ if (await showConfirm({ title: "Delete?", body: warnBody, danger: true })) { ...
478
493
 
479
494
  `text-2xs` — 11px / 16px line-height / +0.01em tracking. Ships in `styles/rail.css` (already imported by JST). Standardizes the ~13 sites of `text-[10px]` / `text-[0.7rem]` micro-captions across JST routes (timestamps, hint text, footnotes). Sits between Tailwind's `text-xs` (12px) and browser-min legibility.
480
495
 
496
+ **Type ramp** (same file): composite utilities that set size + line-height + tracking + weight in one class — `text-jatui-caption` (12/16), `text-jatui-label` (11/16, uppercase, +0.08em, 600 — the instrument label), `text-jatui-body` (14/20), `text-jatui-body-strong` (14/20, 600), `text-jatui-title` (18/24, 600), `text-jatui-display` (30/36, 700). Use one instead of stacking `text-xs font-medium tracking-wide`; colour stays with the caller.
497
+
498
+ **Motion utilities** (`styles/motion.css`, all on the tokens): `.jatui-check-draw` (SVG stroke with `pathLength="1"` draws on), `.jatui-row-exit` (row slides aside then collapses — remove it on `animationend`; set `--jatui-row-h` for tall rows), `.jatui-label-out` / `.jatui-label-in` (button label swap).
499
+
481
500
  ## Utilities
482
501
 
483
502
  ```typescript
503
+ // Outside-press dismissal (BoardUI wave 5). Capture-phase pointerdown outside the
504
+ // node AND every `refs` element (trigger, portalled panel) calls onDismiss; Escape
505
+ // too unless defaultPrevented. `enabled: false` disarms. Core is DOM-injectable.
506
+ import { dismissOutside, createDismissOutside, isInsidePath } from "jatui"
507
+ // <div use:dismissOutside={{ onDismiss: (e, reason) => (open = false), refs: [triggerEl], enabled: open }}>
508
+ import type { DismissOutsideOptions, DismissReason } from "jatui"
509
+
484
510
  // Streaming-transcript auto-scroll (upstreamed from the JAT IDE — jatui-rl7w6.3).
485
511
  // Reader-aware follow: follows the live edge ONLY while the reader is at it;
486
512
  // upward scroll/wheel/keys/selection suspend following; coalesces sticks per
@@ -80,3 +80,17 @@ follow ideas from BoardUI's free items:
80
80
  `BarList` and `ActivityHeatmap` follow BoardUI Pro ideas built from public
81
81
  behaviour only; no Pro source was read or copied. No BoardUI images, logos or
82
82
  palettes are included.
83
+
84
+ ### Wave 5 — form polish (jatui-bns3w)
85
+
86
+ Written fresh for Svelte 5 / DaisyUI after the behaviour of these BoardUI items:
87
+
88
+ - `checkbox-glyph`, `checkbox-card` → `CheckGlyph`, `CheckboxCard`, `Checkbox animated`
89
+ - `switch-card` → `SwitchCard`; `radio-card` → `RadioGroup display="card"`; shared shell `ChoiceCard`
90
+ - `slider` (two thumbs, value bubbles) → `Slider`
91
+ - `input` / `label` / `hint-text` → `FieldLabel`, `FieldHint`, `TextInput` addons
92
+ - `file-upload` (perimeter progress) → `FileDropzone progress`, `ThumbnailGrid` item progress
93
+ - `notification` → toast `title` / `actions` / `avatar` / `ToastHost position`
94
+ - `announcement` → `Alert` `dismissible` / `action` / `variant="card"`
95
+ - `utils/use-dismiss-on-outside-press` → `dismissOutside`
96
+ - `styles/typography.css`, `styles/globals.css` (`check-draw`) → `text-jatui-*` ramp, motion utilities
@@ -0,0 +1,52 @@
1
+ /**
2
+ * dismissOutside — close a popover / menu / panel when the user presses
3
+ * outside it.
4
+ *
5
+ * <div use:dismissOutside={{ onDismiss: close, refs: [triggerEl] }}>…</div>
6
+ *
7
+ * - Listens to `pointerdown` in the CAPTURE phase on the document, so a
8
+ * child that stops propagation can't hide the outside press, and the panel
9
+ * closes before the pressed element's own click runs.
10
+ * - "Inside" is the node plus every element in `refs` (a trigger button, a
11
+ * portalled sub-panel…). It is tested with `composedPath()`, so presses
12
+ * inside shadow roots and elements removed during the press still count.
13
+ * - `escape: true` (default) also dismisses on Escape, unless something
14
+ * earlier already called `preventDefault()` on that keydown.
15
+ * - `enabled: false` disarms it without tearing it down (bind it to `open`).
16
+ *
17
+ * The core is `createDismissOutside()`, framework-free and DOM-injectable
18
+ * for tests and non-Svelte callers.
19
+ *
20
+ * Idea after BoardUI's use-dismiss-on-outside-press (MIT © 2026 Mertcan
21
+ * Dundar Esmergul); the RAC-specific trigger-toggle half is not ported.
22
+ */
23
+ export type DismissReason = 'outside' | 'escape';
24
+ export interface DismissOutsideOptions {
25
+ /** Called on an outside press (or Escape). */
26
+ onDismiss: (event: Event, reason: DismissReason) => void;
27
+ /** More elements that count as inside — a getter is re-read per event. */
28
+ refs?: Array<Element | null | undefined> | (() => Array<Element | null | undefined>);
29
+ /** Default true. */
30
+ enabled?: boolean;
31
+ /** Also dismiss on Escape. Default true. */
32
+ escape?: boolean;
33
+ /** Which pointer event counts as a press. Default `pointerdown`. */
34
+ event?: 'pointerdown' | 'mousedown' | 'click';
35
+ }
36
+ interface EventTargetLike {
37
+ addEventListener(type: string, fn: (e: Event) => void, opts?: boolean | AddEventListenerOptions): void;
38
+ removeEventListener(type: string, fn: (e: Event) => void, opts?: boolean | EventListenerOptions): void;
39
+ }
40
+ export interface DismissOutsideController {
41
+ update(next: DismissOutsideOptions): void;
42
+ destroy(): void;
43
+ }
44
+ /** True when the event's path passes through any of `roots`. */
45
+ export declare function isInsidePath(event: Event, roots: readonly Element[]): boolean;
46
+ export declare function createDismissOutside(getRoot: () => Element | null | undefined, initial: DismissOutsideOptions, doc?: EventTargetLike | undefined): DismissOutsideController;
47
+ /** Svelte action form. */
48
+ export declare function dismissOutside(node: Element, options: DismissOutsideOptions): {
49
+ update: (next: DismissOutsideOptions) => void;
50
+ destroy: () => void;
51
+ };
52
+ export {};
@@ -0,0 +1,80 @@
1
+ /**
2
+ * dismissOutside — close a popover / menu / panel when the user presses
3
+ * outside it.
4
+ *
5
+ * <div use:dismissOutside={{ onDismiss: close, refs: [triggerEl] }}>…</div>
6
+ *
7
+ * - Listens to `pointerdown` in the CAPTURE phase on the document, so a
8
+ * child that stops propagation can't hide the outside press, and the panel
9
+ * closes before the pressed element's own click runs.
10
+ * - "Inside" is the node plus every element in `refs` (a trigger button, a
11
+ * portalled sub-panel…). It is tested with `composedPath()`, so presses
12
+ * inside shadow roots and elements removed during the press still count.
13
+ * - `escape: true` (default) also dismisses on Escape, unless something
14
+ * earlier already called `preventDefault()` on that keydown.
15
+ * - `enabled: false` disarms it without tearing it down (bind it to `open`).
16
+ *
17
+ * The core is `createDismissOutside()`, framework-free and DOM-injectable
18
+ * for tests and non-Svelte callers.
19
+ *
20
+ * Idea after BoardUI's use-dismiss-on-outside-press (MIT © 2026 Mertcan
21
+ * Dundar Esmergul); the RAC-specific trigger-toggle half is not ported.
22
+ */
23
+ function readRefs(refs) {
24
+ const list = typeof refs === 'function' ? refs() : (refs ?? []);
25
+ return list.filter((el) => !!el);
26
+ }
27
+ /** True when the event's path passes through any of `roots`. */
28
+ export function isInsidePath(event, roots) {
29
+ const path = typeof event.composedPath === 'function' ? event.composedPath() : [];
30
+ if (path.length)
31
+ return roots.some((r) => path.includes(r));
32
+ const target = event.target;
33
+ return !!target && roots.some((r) => r === target || r.contains(target));
34
+ }
35
+ export function createDismissOutside(getRoot, initial, doc = typeof document !== 'undefined' ? document : undefined) {
36
+ let opts = initial;
37
+ const onPress = (e) => {
38
+ if (opts.enabled === false)
39
+ return;
40
+ const root = getRoot();
41
+ const roots = [...(root ? [root] : []), ...readRefs(opts.refs)];
42
+ if (isInsidePath(e, roots))
43
+ return;
44
+ opts.onDismiss(e, 'outside');
45
+ };
46
+ const onKey = (e) => {
47
+ if (opts.enabled === false || opts.escape === false)
48
+ return;
49
+ const ke = e;
50
+ if (ke.key !== 'Escape' || ke.defaultPrevented || ke.isComposing)
51
+ return;
52
+ opts.onDismiss(e, 'escape');
53
+ };
54
+ let pressType = opts.event ?? 'pointerdown';
55
+ doc?.addEventListener(pressType, onPress, true);
56
+ doc?.addEventListener('keydown', onKey);
57
+ return {
58
+ update(next) {
59
+ const nextType = next.event ?? 'pointerdown';
60
+ if (nextType !== pressType) {
61
+ doc?.removeEventListener(pressType, onPress, true);
62
+ doc?.addEventListener(nextType, onPress, true);
63
+ pressType = nextType;
64
+ }
65
+ opts = next;
66
+ },
67
+ destroy() {
68
+ doc?.removeEventListener(pressType, onPress, true);
69
+ doc?.removeEventListener('keydown', onKey);
70
+ }
71
+ };
72
+ }
73
+ /** Svelte action form. */
74
+ export function dismissOutside(node, options) {
75
+ const ctl = createDismissOutside(() => node, options);
76
+ return {
77
+ update: (next) => ctl.update(next),
78
+ destroy: () => ctl.destroy()
79
+ };
80
+ }