@tensor_1/react 2.34.0 → 2.35.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/dist/index.d.cts CHANGED
@@ -734,6 +734,12 @@ interface SchedulingCalendarEntry {
734
734
  allDay?: boolean;
735
735
  /** `false` keeps this entry where it is when the grid allows moves (`canMove`). */
736
736
  movable?: boolean;
737
+ /**
738
+ * Draws the item with more or less weight than its neighbours, for example the partners of
739
+ * the item the user picked (`'highlight'`) against everything else (`'dim'`). It is a line
740
+ * weight and a quieter text colour, never a hue.
741
+ */
742
+ emphasis?: 'highlight' | 'dim';
737
743
  }
738
744
  interface SchedulingCalendarOverlay {
739
745
  id: string;
@@ -760,7 +766,11 @@ interface SchedulingCalendarDay {
760
766
  count: number;
761
767
  /** The "+N" of the cell. 0 shows none. */
762
768
  overflowCount: number;
763
- /** The accessible text of the count, e.g. "7 items, 2 need review". */
769
+ /**
770
+ * The accessible text of the count, e.g. "7 items, 2 need review". The day's button is named
771
+ * with the date and this text (`labels.dayName`), so a screen reader hears the date, the count
772
+ * and the highest signal in one go.
773
+ */
764
774
  label?: string;
765
775
  markers?: SchedulingMarker[];
766
776
  }
@@ -830,6 +840,8 @@ interface SchedulingCalendarLabels {
830
840
  moreSpans?: string;
831
841
  /** Accessible name of that control. `{count}` and `{date}` (the first day with a hidden span). */
832
842
  moreSpansLabel?: string;
843
+ /** The name of a day's button when `days[date].label` is given. `{date}` and `{label}` placeholders; use `'{label}'` if your labels already say the date. */
844
+ dayName?: string;
833
845
  /** The accessible text of a day's count when `days[date].label` is not given. `{count}` placeholder. */
834
846
  dayCount?: string;
835
847
  states: Record<SchedulingEntryState, string>;
@@ -2742,9 +2754,16 @@ declare function CollapsibleSection(props: CollapsibleSectionProps): react.JSX.E
2742
2754
 
2743
2755
  interface ListProps extends HTMLAttributes<HTMLDivElement> {
2744
2756
  children?: ReactNode;
2757
+ /**
2758
+ * Makes the list one tab stop: ArrowUp and ArrowDown move between its `ListItem`s, Home and
2759
+ * End go to the first and last, Enter and Space activate the focused item (its `onClick`).
2760
+ * Focus stays on the same item across re-renders with the same keys. A roving list is a
2761
+ * client component; without `roving` the list stays server-renderable.
2762
+ */
2763
+ roving?: boolean;
2745
2764
  }
2746
2765
  /** Bordered, rounded list container over `.uix-list`. */
2747
- declare function List({ children, className, ...props }: ListProps): react.JSX.Element;
2766
+ declare function List({ children, className, roving, ...props }: ListProps): react.JSX.Element;
2748
2767
  interface ListItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
2749
2768
  title?: ReactNode;
2750
2769
  meta?: ReactNode;
package/dist/index.d.ts CHANGED
@@ -90,7 +90,7 @@ export { JsonPrimitive, JsonValue } from './json-value.js';
90
90
  export { DEFAULT_RULE_BUILDER_LABELS, RuleActionDefinition, RuleBuilder, RuleBuilderLabels, RuleBuilderProps, RuleFieldDefinition, RuleOperatorDefinition, RuleValueEditorProps } from './components/RuleBuilder.js';
91
91
  export { DEFAULT_RULE_SUMMARY_WORDS, DEFAULT_RULE_VALIDATION_MESSAGES, RuleAction, RuleCheck, RuleCondition, RuleDefinition, RuleGroup, RuleSummaryWords, RuleValidationIssue, RuleValidationOptions, appendRuleNode, findRuleNodeDepth, isRuleGroup, mapRuleGroup, moveRuleNode, removeRuleNode, ruleDepth, setRuleCombinator, summarizeRule, validateRuleDefinition } from './rule-builder-model.js';
92
92
  export { BuilderCanvas, BuilderCanvasItem, BuilderCanvasLabels, BuilderCanvasProps, BuilderPaletteItem, DEFAULT_BUILDER_CANVAS_LABELS } from './components/BuilderCanvas.js';
93
- export { D as DEFAULT_SCHEDULING_CALENDAR_LABELS, S as SchedulingAgendaGroup, a as SchedulingBand, b as SchedulingCalendar, c as SchedulingCalendarDay, d as SchedulingCalendarEntry, e as SchedulingCalendarLabels, f as SchedulingCalendarOverlay, g as SchedulingCalendarProps, h as SchedulingCalendarView, i as SchedulingDatePart, j as SchedulingEntryState, k as SchedulingLegendItem, l as SchedulingMarker, m as SchedulingMarkerEmphasis, n as SchedulingOverlayKind, o as SchedulingOverlayPattern, p as SchedulingStatus, T as TimeGridEntryContext } from './SchedulingCalendar-DSLQ6AY5.js';
93
+ export { D as DEFAULT_SCHEDULING_CALENDAR_LABELS, S as SchedulingAgendaGroup, a as SchedulingBand, b as SchedulingCalendar, c as SchedulingCalendarDay, d as SchedulingCalendarEntry, e as SchedulingCalendarLabels, f as SchedulingCalendarOverlay, g as SchedulingCalendarProps, h as SchedulingCalendarView, i as SchedulingDatePart, j as SchedulingEntryState, k as SchedulingLegendItem, l as SchedulingMarker, m as SchedulingMarkerEmphasis, n as SchedulingOverlayKind, o as SchedulingOverlayPattern, p as SchedulingStatus, T as TimeGridEntryContext } from './SchedulingCalendar-B6TakO2h.js';
94
94
  export { DaySpanLayout, LayoutMonthSpansOptions, MonthSpanGroup, MonthSpanInput, MonthSpanLayout, MoveProposal, PlacedDaySpan, PlacedMonthSpan, TOP_LANE_CROSS_MIDNIGHT_MINUTES, TimeGridDayLayout, TimeGridEntryInput, TimeGridPart, TimeGridSegment, itemDaySpan, layoutDaySpans, layoutMonthSpans, layoutTimeGridDay, placesInTopLane, proposeMove, schedulingGridDays } from './scheduling-calendar-model.js';
95
95
  export { DEFAULT_SCHEDULING_TIMELINE_LABELS, SchedulingTimeline, SchedulingTimelineItem, SchedulingTimelineLabels, SchedulingTimelineLane, SchedulingTimelineMarker, SchedulingTimelineOverlay, SchedulingTimelineOverlayKind, SchedulingTimelineProps } from './components/SchedulingTimeline.js';
96
96
  export { DAY, HOUR, PlacedSpan, TimelineRange, TimelineScale, TimelineSpan, TimelineTick, defaultTimelineStep, layoutLane, pixelsToMs, placeSpan, shiftSpan, snapToStep, timelineTicks } from './scheduling-timeline-model.js';
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { PaginationLabels } from './components/Pagination.js';
4
- import { e as SchedulingCalendarLabels } from './SchedulingCalendar-DSLQ6AY5.js';
4
+ import { e as SchedulingCalendarLabels } from './SchedulingCalendar-B6TakO2h.js';
5
5
  import { DateRangePickerLabels } from './components/DateRangePicker.js';
6
6
  import { SchedulingTimelineLabels } from './components/SchedulingTimeline.js';
7
7
  import { TextDiffLabels } from './components/TextDiff.js';
@@ -0,0 +1,15 @@
1
+ interface RovingStop {
2
+ /** The element that holds the tab stop. */
3
+ node: HTMLElement | null;
4
+ /** Its place, so the stop survives when that element is removed. */
5
+ index: number;
6
+ }
7
+ /**
8
+ * Makes one of `all` the tab stop and takes the others out of the tab order. The stop is
9
+ * `next` when given, else the element that held it, else the element now in its place.
10
+ */
11
+ declare function syncRovingStop(all: readonly HTMLElement[], stop: RovingStop, next?: HTMLElement): RovingStop;
12
+ /** Where ArrowUp, ArrowDown, Home or End goes from `from` in `all`, or `null` for any other key. */
13
+ declare function rovingStep(all: readonly HTMLElement[], from: HTMLElement, key: string): HTMLElement | null;
14
+
15
+ export { type RovingStop, rovingStep, syncRovingStop };
package/dist/roving.js ADDED
@@ -0,0 +1,17 @@
1
+ function syncRovingStop(all, stop, next) {
2
+ if (all.length === 0) return { node: null, index: 0 };
3
+ const kept = stop.node && all.includes(stop.node) ? stop.node : all[Math.min(stop.index, all.length - 1)];
4
+ const current = next && all.includes(next) ? next : kept;
5
+ for (const element of all) element.tabIndex = element === current ? 0 : -1;
6
+ return { node: current, index: all.indexOf(current) };
7
+ }
8
+ function rovingStep(all, from, key) {
9
+ const index = all.indexOf(from);
10
+ if (index === -1) return null;
11
+ const target = key === "ArrowDown" ? index + 1 : key === "ArrowUp" ? index - 1 : key === "Home" ? 0 : key === "End" ? all.length - 1 : null;
12
+ return target === null ? null : all[Math.max(0, Math.min(all.length - 1, target))] ?? null;
13
+ }
14
+ export {
15
+ rovingStep,
16
+ syncRovingStop
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tensor_1/react",
3
- "version": "2.34.0",
3
+ "version": "2.35.0",
4
4
  "description": "Thin React wrappers over the UIx v2 CSS component library.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",