@mistriwork/ui 1.0.0-rc.31 → 1.0.0-rc.33

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.
@@ -47,6 +47,8 @@ export interface DateFieldProps {
47
47
  max?: string;
48
48
  locale?: string;
49
49
  timezone?: string;
50
+ /** The moment the calendar's today is counted from: the App's clock where it runs as of another day; the real time when absent. */
51
+ now?: Date;
50
52
  firstDay?: number;
51
53
  className?: string;
52
54
  name?: string;
@@ -63,4 +65,4 @@ export interface DateFieldProps {
63
65
  'aria-describedby'?: string;
64
66
  }
65
67
  /** A date field, or a date and a wall-clock time. No input is parsed as an instant or shifted by a timezone. */
66
- export declare function DateField({ id, words, calendarIcon, value, onChange, onBlur, onKeyDown, disabled, required, min, max, locale, timezone, firstDay, className, name, inputRef, placeholder, withTime, popupRef, onOpenChange, 'aria-label': label, 'aria-invalid': invalid, 'aria-describedby': describedBy, }: DateFieldProps): import("react").JSX.Element;
68
+ export declare function DateField({ id, words, calendarIcon, value, onChange, onBlur, onKeyDown, disabled, required, min, max, locale, timezone, now, firstDay, className, name, inputRef, placeholder, withTime, popupRef, onOpenChange, 'aria-label': label, 'aria-invalid': invalid, 'aria-describedby': describedBy, }: DateFieldProps): import("react").JSX.Element;
package/dist/DateField.js CHANGED
@@ -54,7 +54,7 @@ function readDate(text, mask) {
54
54
  return isPickerDate(iso) ? iso : undefined;
55
55
  }
56
56
  /** A date field, or a date and a wall-clock time. No input is parsed as an instant or shifted by a timezone. */
57
- export function DateField({ id, words, calendarIcon, value, onChange, onBlur, onKeyDown, disabled, required, min, max, locale, timezone, firstDay = 1, className = '', name, inputRef, placeholder, withTime = false, popupRef, onOpenChange, 'aria-label': label, 'aria-invalid': invalid, 'aria-describedby': describedBy, }) {
57
+ export function DateField({ id, words, calendarIcon, value, onChange, onBlur, onKeyDown, disabled, required, min, max, locale, timezone, now, firstDay = 1, className = '', name, inputRef, placeholder, withTime = false, popupRef, onOpenChange, 'aria-label': label, 'aria-invalid': invalid, 'aria-describedby': describedBy, }) {
58
58
  // The calendar only ever sees the date; a wall time's clock stays in the box.
59
59
  const datePart = withTime ? (splitDateTime(value)?.date ?? value.slice(0, 10)) : value;
60
60
  // A range facet may temporarily supply an incomplete or reversed bound.
@@ -68,7 +68,7 @@ export function DateField({ id, words, calendarIcon, value, onChange, onBlur, on
68
68
  }
69
69
  }, [min, max, withTime]);
70
70
  const bounds = configuredBounds ?? dateBounds();
71
- const today = todayInZone(new Date(), timezone);
71
+ const today = todayInZone(now ?? new Date(), timezone);
72
72
  const seed = () => clampDate(isPickerDate(datePart) ? datePart : today, bounds);
73
73
  const [active, setActive] = useState(seed);
74
74
  const [open, setOpenState] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/ui",
3
- "version": "1.0.0-rc.31",
3
+ "version": "1.0.0-rc.33",
4
4
  "description": "The standalone React primitives both shells are drawn with: Modal, DropMenu, Dropdown, Typeahead, Button, Field, Icon and DateField over Base UI, Switch, Tabs, Drawer, Popover, Avatar, Pagination, Carousel, Resizable, ScrollArea and Tooltip, the form controls built on them (text, masked, money and sensitive boxes, listboxes, choices, slider, progress and action bar; Preview), the landing hero's blocks (badge, photo tiles, icon rows; Preview), their tokens and stylesheet, and the zoom-aware ruler their popups are placed by.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {