@overdoser/react-toolkit 0.15.0 → 0.16.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.
package/llms.txt CHANGED
@@ -720,9 +720,33 @@ Element: `<div>` wrapping `<input>` (forwards ref to the input) + stepper button
720
720
 
721
721
  ### DatePicker
722
722
  Import: `import { DatePicker } from '@overdoser/react-toolkit'`
723
- Element: `<div>` wrapping a read-only `<input>` (forwards ref) + a calendar popover. Single date; binds in `FormField` (`value: Date | null`).
723
+ Element: `<div>` wrapping a read-only `<input>` (forwards ref) + a calendar popover. Single date, day granularity (the time part of the value is discarded); binds in `FormField` (`value: Date | null`). Need a time too? Use `DateTimePicker`.
724
+
725
+ `DatePickerProps`: `value?: Date | null`, `defaultValue?`, `onChange?(date)`, `min?: Date`, `max?: Date`, `disabledDate?(date): boolean`, `weekStartsOn?: number` (0 = Sun), `locale?: string`, `format?(date): string`, `placeholder?` (default `'Select date'`), `inputSize?: 'sm'|'md'|'lg'`, `error?`, `disabled?`, `portal?` (default true), `classes?` = `{ root, input, icon, popover, header, nav, grid, day, daySelected, dayToday, dayOutside }`. Keyboard: arrows move days, PageUp/Down change month, Home/End week ends, Enter selects, Esc closes. The month and year in the header are buttons: month opens a 12-month grid, year opens a scrollable year list (both keyboard-navigable, gated by `min`/`max`) for long jumps.
726
+
727
+ ### DateTimePicker
728
+ Import: `import { DateTimePicker } from '@overdoser/react-toolkit'`
729
+ Element: `<div>` (forwards ref to it) holding a row of editable segments (`role="group"` of `spinbutton`s — `YYYY-MM-DD HH:mm:ss` by default) + a calendar icon that opens a popover with the `DatePicker` calendar on the left and scrollable hours / minutes (/ seconds / AM-PM) columns on the right (MUI desktop layout). Binds in `FormField` (`value: Date | null`). Picking a day keeps the current time and leaves the popover open; every day/time edit commits immediately; "Done", Esc or click-outside closes.
730
+
731
+ `DateTimePickerProps`: everything from `DatePickerProps` (`value`, `defaultValue`, `onChange`, `min`, `max`, `disabledDate`, `weekStartsOn`, `locale`, `format`, `placeholder` (default `'Select date and time'`), `inputSize`, `error`, `disabled`, `portal`, `classes`) plus:
732
+ - `timeZone?: string` — zone the picker renders and edits in: IANA name (`'America/New_York'`), `'UTC'` (**default**), or `'system'` for the runtime's local zone. The value is always an absolute instant; only the wall clock shown changes (MUI-style). Unknown zone → warning + UTC fallback.
733
+ - `showTimeZone?: boolean` — show the zone as a plain label right after the time (`2026-06-15 14:30:00 UTC`, `2026-06-15 17:30:00 GMT+03:00`; hover shows the IANA name) and in the popover footer. Default **true**; `false` hides it.
734
+ - `timeZoneStyle?: 'longOffset' | 'shortOffset' | 'short' | 'long'` (default `'longOffset'` → `GMT+03:00`; `'shortOffset'` → `GMT+3`; `'short'` → `EEST`; `'long'` → `Eastern European Summer Time`). UTC always reads `UTC`.
735
+ - `fieldFormat?: 'iso' | 'locale'` (default `'iso'` = `YYYY-MM-DD HH:mm:ss`; `'locale'` = the locale's numeric order, e.g. `MM/DD/YYYY, hh:mm:ss AM` for en-US).
736
+ - `hourCycle?: 12 | 24` — default 24 (00–23, no AM/PM). With `fieldFormat="locale"` it defaults to the locale's convention instead (`en-US` → 12 with an AM/PM column; most European locales → 24). `minuteStep?` (default 5 → 00, 05, 10…; an off-grid value is still listed so the selection shows). `showSeconds?` (default **true** — seconds segment + column; `false` hides both). `doneLabel?` (default `'Done'`).
737
+ - `min`/`max` are instants: days outside them are disabled and a time picked outside them on the boundary day clamps to the bound. `disabledDate` receives the calendar day at local midnight (with `timeZone`, the wall-clock day in that zone).
738
+ - `classes` adds `segment`, `timeZone` (the inline zone label), `time`, `column`, `option`, `optionSelected`, `footer` to the `DatePicker` shape (`input` = the segment row).
739
+ Time columns: each is a `listbox` — click an option to select, arrows move the selection (wrapping), the selected option is centred on open. The popover is ~28rem wide; it portals by default so width rarely matters.
740
+ Field editing (no popover needed): click a segment to select it; Up/Down step it (wrapping inside the segment — minute 59 → 00 leaves the hour alone); Left/Right/Home/End move between segments; digits type with auto-advance (`0`,`8` → August; `1`,`9` restarts at 9); `A`/`P` set the period; Backspace/Delete clear to `null`; Alt+ArrowDown opens the popover; Escape closes it. On an empty field the first arrow press (any segment) fills in *now* (seconds zeroed) without stepping; the next press steps. Typing into an empty field also starts from now. Segments are `<span>`s, so mobile keyboards don't pop — touch users use the icon + columns.
741
+ `format` switches the field to a read-only text display (click opens the popover) — only use it when you need custom text; the segments already render a localized numeric date/time.
724
742
 
725
- `DatePickerProps`: `value?: Date | null`, `defaultValue?`, `onChange?(date)`, `min?: Date`, `max?: Date`, `disabledDate?(date): boolean`, `weekStartsOn?: number` (0 = Sun), `locale?: string`, `format?(date): string`, `placeholder?` (default `'Select date'`), `inputSize?: 'sm'|'md'|'lg'`, `error?`, `disabled?`, `portal?` (default true), `classes?` = `{ root, input, icon, popover, header, nav, grid, day, daySelected, dayToday, dayOutside }`. Keyboard: arrows move days, PageUp/Down change month, Home/End week ends, Enter selects, Esc closes.
743
+ ```tsx
744
+ // Defaults: "2026-06-15 14:30:00 UTC", 24h, UTC
745
+ <DateTimePicker value={runAt} onChange={setRunAt} />
746
+ // Customer's zone → "2026-06-15 17:30:00 GMT+03:00"; local zone + locale layout
747
+ <DateTimePicker value={runAt} onChange={setRunAt} timeZone={account.timeZone} />
748
+ <DateTimePicker value={runAt} onChange={setRunAt} timeZone="system" fieldFormat="locale" />
749
+ ```
726
750
 
727
751
  ### Dropzone
728
752
  Import: `import { Dropzone } from '@overdoser/react-toolkit'`
package/manifest.json CHANGED
@@ -1513,7 +1513,7 @@
1513
1513
  "import": "import { DatePicker } from '@overdoser/react-toolkit'",
1514
1514
  "element": "div wrapping a read-only input + calendar popover",
1515
1515
  "forwardsRef": true,
1516
- "notes": "Single date with a pop-up calendar. Binds in FormField (value: Date | null). Keyboard: arrows move days, PageUp/Down change month, Home/End week ends, Enter selects, Esc closes.",
1516
+ "notes": "Single date with a pop-up calendar. Binds in FormField (value: Date | null). Keyboard: arrows move days, PageUp/Down change month, Home/End week ends, Enter selects, Esc closes. Header month/year are buttons opening a month grid / scrollable year list for long jumps.",
1517
1517
  "props": {
1518
1518
  "value": {
1519
1519
  "type": "Date | null",
@@ -1584,6 +1584,132 @@
1584
1584
  }
1585
1585
  }
1586
1586
  },
1587
+ "DateTimePicker": {
1588
+ "import": "import { DateTimePicker } from '@overdoser/react-toolkit'",
1589
+ "element": "div (ref) holding editable segment row (group of spinbuttons) + icon button + popover (calendar beside scrollable time columns)",
1590
+ "forwardsRef": true,
1591
+ "notes": "Date + time in one field. The field is a row of segments, YYYY-MM-DD HH:mm:ss / 24h / UTC by default (fieldFormat='locale' for locale order, timeZone='system' for local): click one, Up/Down steps it, Left/Right moves, digits type with auto-advance, Backspace clears, Alt+ArrowDown opens the popover; empty field starts from now on first edit. The calendar icon opens the MUI-desktop-style popover: calendar left, hours/minutes(/seconds/AM-PM) listbox columns right; picking a day keeps the time and leaves it open; edits commit immediately; Done/Esc/click-outside closes. Binds in FormField (value: Date | null). The value is an absolute instant; timeZone chooses the wall clock it is shown/edited in (UTC by default, 'system' = local), the zone is labelled inline after the time (showTimeZone={false} hides it). Ref \u2192 root div.",
1592
+ "props": {
1593
+ "value": {
1594
+ "type": "Date | null",
1595
+ "notes": "Controlled. Absolute instant."
1596
+ },
1597
+ "defaultValue": {
1598
+ "type": "Date | null"
1599
+ },
1600
+ "onChange": {
1601
+ "type": "(date: Date | null) => void",
1602
+ "notes": "Fires on every day or time change."
1603
+ },
1604
+ "min": {
1605
+ "type": "Date",
1606
+ "notes": "Instant. Earlier days disabled; earlier times on the boundary day clamp up."
1607
+ },
1608
+ "max": {
1609
+ "type": "Date",
1610
+ "notes": "Instant. Mirror of min."
1611
+ },
1612
+ "disabledDate": {
1613
+ "type": "(date: Date) => boolean",
1614
+ "notes": "Receives the calendar day at local midnight (wall-clock day in timeZone)."
1615
+ },
1616
+ "weekStartsOn": {
1617
+ "type": "number",
1618
+ "default": 0,
1619
+ "notes": "0 = Sunday."
1620
+ },
1621
+ "locale": {
1622
+ "type": "string",
1623
+ "notes": "BCP-47; drives names, default format, and default hour cycle."
1624
+ },
1625
+ "timeZone": {
1626
+ "type": "string",
1627
+ "default": "UTC",
1628
+ "notes": "IANA zone, 'UTC', or 'system' (local). Unknown \u2192 warning + UTC."
1629
+ },
1630
+ "showTimeZone": {
1631
+ "type": "boolean",
1632
+ "default": true,
1633
+ "notes": "Inline zone label after the time + popover footer."
1634
+ },
1635
+ "timeZoneStyle": {
1636
+ "type": "'longOffset' | 'shortOffset' | 'short' | 'long'",
1637
+ "default": "longOffset",
1638
+ "notes": "GMT+03:00 / GMT+3 / EEST / long name. UTC always reads 'UTC'."
1639
+ },
1640
+ "fieldFormat": {
1641
+ "type": "'iso' | 'locale'",
1642
+ "default": "iso",
1643
+ "notes": "'iso' = YYYY-MM-DD HH:mm:ss regardless of locale; 'locale' = locale's numeric order."
1644
+ },
1645
+ "hourCycle": {
1646
+ "type": "12 | 24",
1647
+ "default": 24,
1648
+ "notes": "With fieldFormat='locale' defaults to the locale convention. 12 adds an AM/PM segment + column."
1649
+ },
1650
+ "minuteStep": {
1651
+ "type": "number",
1652
+ "default": 5,
1653
+ "notes": "Spacing of minute options; an off-grid value is still listed."
1654
+ },
1655
+ "showSeconds": {
1656
+ "type": "boolean",
1657
+ "default": true
1658
+ },
1659
+ "format": {
1660
+ "type": "(date: Date) => string",
1661
+ "notes": "Switches the field to a read-only text display (click opens popover). Omit to keep editable segments."
1662
+ },
1663
+ "placeholder": {
1664
+ "type": "string",
1665
+ "default": "Select date and time",
1666
+ "notes": "Only used by the read-only display (format set)."
1667
+ },
1668
+ "doneLabel": {
1669
+ "type": "string",
1670
+ "default": "Done"
1671
+ },
1672
+ "inputSize": {
1673
+ "type": "'sm' | 'md' | 'lg'",
1674
+ "default": "md"
1675
+ },
1676
+ "error": {
1677
+ "type": "boolean",
1678
+ "default": false
1679
+ },
1680
+ "disabled": {
1681
+ "type": "boolean",
1682
+ "default": false
1683
+ },
1684
+ "portal": {
1685
+ "type": "boolean",
1686
+ "default": true
1687
+ },
1688
+ "classes": {
1689
+ "type": "Partial<DateTimePickerClasses>",
1690
+ "shape": [
1691
+ "root",
1692
+ "input",
1693
+ "segment",
1694
+ "icon",
1695
+ "timeZone",
1696
+ "popover",
1697
+ "header",
1698
+ "nav",
1699
+ "grid",
1700
+ "day",
1701
+ "daySelected",
1702
+ "dayToday",
1703
+ "dayOutside",
1704
+ "time",
1705
+ "column",
1706
+ "option",
1707
+ "optionSelected",
1708
+ "footer"
1709
+ ]
1710
+ }
1711
+ }
1712
+ },
1587
1713
  "Dropzone": {
1588
1714
  "import": "import { Dropzone } from '@overdoser/react-toolkit'",
1589
1715
  "element": "div[role=button] + hidden file input",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overdoser/react-toolkit",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "homepage": "https://react-toolkit.overdoser.org",
5
5
  "type": "module",
6
6
  "main": "./index.js",