@umriss-ui/core 0.53.0 → 0.54.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.ts CHANGED
@@ -23,7 +23,7 @@ import { TextareaHTMLAttributes } from 'react';
23
23
 
24
24
  /** Sections behind headers that open and close: one at a time (`single`) or
25
25
  any number (`multiple`). The arrow keys move between the headers. */
26
- export declare function Accordion({ ref, type, value: valueProp, defaultValue, onValueChange, onChange, headingLevel, className, onKeyDown, children, ...rest }: AccordionProps): JSX.Element;
26
+ export declare function Accordion({ ref, type, value: valueProp, defaultValue, onValueChange, headingLevel, className, onKeyDown, children, ...rest }: AccordionProps): JSX.Element;
27
27
 
28
28
  /** One section of an `Accordion`: its header and the content it opens. */
29
29
  export declare function AccordionItem({ ref, value, title, disabled, className, children, ...rest }: AccordionItemProps): JSX.Element;
@@ -51,8 +51,6 @@ export declare interface AccordionProps extends Omit<HTMLAttributes<HTMLDivEleme
51
51
  /** Reports the open sections after a header's click. Controlled, the
52
52
  accordion follows once `value` does; uncontrolled it is a message. */
53
53
  onValueChange?: (value: string[]) => void;
54
- /** The former name of `onValueChange`. @deprecated since 0.53 - use `onValueChange`; it goes in the next minor release. */
55
- onChange?: (value: string[]) => void;
56
54
  /** The level of the heading each header stands in - the one that fits the
57
55
  page's outline. */
58
56
  headingLevel?: 2 | 3 | 4 | 5 | 6;
@@ -1021,6 +1019,16 @@ export declare interface FlatteningEntry<K, S extends Key = string> {
1021
1019
  siblings: number;
1022
1020
  }
1023
1021
 
1022
+ /**
1023
+ * A span as hours and minutes from the wording's short units ("1 hr 30 min").
1024
+ * The span is rounded to the whole minute, so 1 h 29 min 40 s reads as
1025
+ * 1 hr 30 min everywhere; a span of no minutes reads "0 min", a negative one
1026
+ * as its size. With `days` the whole days lead and the hours stay below 24.
1027
+ */
1028
+ export declare function formatDuration(ms: number, wording: Wording, options?: {
1029
+ days?: boolean;
1030
+ }): string;
1031
+
1024
1032
  /** Everything the library knows about formatting. */
1025
1033
  export declare interface Formats {
1026
1034
  /** The language tag the set was built in: "en-GB". */
@@ -1957,7 +1965,7 @@ export declare interface RowPlacement {
1957
1965
  rowHeight: number;
1958
1966
  scrollTop: number;
1959
1967
  viewportHeight: number;
1960
- /** Height of the sticky header; it covers the upper edge. */
1968
+ /** Height of the sticky header; it stands above row 0 and covers the upper edge. */
1961
1969
  headerHeight?: number;
1962
1970
  }
1963
1971
 
@@ -1980,8 +1988,8 @@ export declare interface RowWindow {
1980
1988
  * This is the arithmetic the keyboard handling hangs on: without it the focus
1981
1989
  * moves into a row that is not rendered.
1982
1990
  *
1983
- * The sticky header counts against the upper edge: a row standing exactly at
1984
- * `scrollTop` lies behind it.
1991
+ * The sticky header stands above row 0, so it pushes every row down by its
1992
+ * height, and once scrolled it covers the upper edge of the viewport.
1985
1993
  */
1986
1994
  export declare function scrollForRow(index: number, { rowHeight, scrollTop, viewportHeight, headerHeight }: RowPlacement): number | null;
1987
1995
 
@@ -2220,7 +2228,7 @@ export declare interface SplitButtonProps extends Omit<ButtonProps, "children" |
2220
2228
 
2221
2229
  /** Two panes and the line between them. The line can be dragged, moved with
2222
2230
  the arrow keys, and Enter collapses the first pane and brings it back. */
2223
- export declare function Splitter({ ref, orientation, value: valueProp, defaultValue, onValueChange, onChange, min, max, step, separatorLabel, className, style, onKeyDown, children, ...rest }: SplitterProps): JSX.Element;
2231
+ export declare function Splitter({ ref, orientation, value: valueProp, defaultValue, onValueChange, min, max, step, separatorLabel, className, style, onKeyDown, children, ...rest }: SplitterProps): JSX.Element;
2224
2232
 
2225
2233
  /** The props of `Splitter`. */
2226
2234
  export declare interface SplitterProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children">, RefProp<HTMLDivElement> {
@@ -2233,8 +2241,6 @@ export declare interface SplitterProps extends Omit<HTMLAttributes<HTMLDivElemen
2233
2241
  defaultValue?: number;
2234
2242
  /** Reports every move, by pointer or key, as the first pane's share. */
2235
2243
  onValueChange?: (value: number) => void;
2236
- /** The former name of `onValueChange`. @deprecated since 0.53 - use `onValueChange`; it goes in the next minor release. */
2237
- onChange?: (value: number) => void;
2238
2244
  /** The smallest share of the first pane, and where Enter collapses it to. */
2239
2245
  min?: number;
2240
2246
  /** The largest share of the first pane. */
@@ -2372,7 +2378,7 @@ export declare interface TabProps extends ButtonHTMLAttributes<HTMLButtonElement
2372
2378
 
2373
2379
  /** Tabs: a `TabList` of `Tab`s and one `TabPanel` per value. Controlled
2374
2380
  through `value` and `onValueChange`, or uncontrolled from `defaultValue`. */
2375
- export declare function Tabs({ ref, value, defaultValue, onValueChange, onChange, className, children, ...rest }: TabsProps): JSX.Element;
2381
+ export declare function Tabs({ ref, value, defaultValue, onValueChange, className, children, ...rest }: TabsProps): JSX.Element;
2376
2382
 
2377
2383
  /** The props of `Tabs`. */
2378
2384
  export declare interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue">, RefProp<HTMLDivElement> {
@@ -2385,8 +2391,6 @@ export declare interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>,
2385
2391
  /** Receives the value of the chosen tab. Controlled, the tab switches only
2386
2392
  once `value` follows; uncontrolled it is merely a message. */
2387
2393
  onValueChange?: (value: string) => void;
2388
- /** The former name of `onValueChange`. @deprecated since 0.53 - use `onValueChange`; it goes in the next minor release. */
2389
- onChange?: (value: string) => void;
2390
2394
  }
2391
2395
 
2392
2396
  /** A short label with a tone; with `onRemove` it carries a cross that removes
@@ -2736,16 +2740,6 @@ export declare interface TreeOptions<K, S extends Key = string> {
2736
2740
  onActiveChange?: (next: S | null) => void;
2737
2741
  onAnchorChange?: (next: S | null) => void;
2738
2742
  onSearchChange?: (text: string) => void;
2739
- /** The former name of `onExpandedChange`. @deprecated since 0.53 - use `onExpandedChange`; it goes in the next minor release. */
2740
- onExpanded?: (next: ReadonlySet<S>) => void;
2741
- /** The former name of `onCheckedChange`. @deprecated since 0.53 - use `onCheckedChange`; it goes in the next minor release. */
2742
- onChecked?: (next: ReadonlySet<S>) => void;
2743
- /** The former name of `onActiveChange`. @deprecated since 0.53 - use `onActiveChange`; it goes in the next minor release. */
2744
- onActive?: (next: S | null) => void;
2745
- /** The former name of `onAnchorChange`. @deprecated since 0.53 - use `onAnchorChange`; it goes in the next minor release. */
2746
- onAnchor?: (next: S | null) => void;
2747
- /** The former name of `onSearchChange`. @deprecated since 0.53 - use `onSearchChange`; it goes in the next minor release. */
2748
- onSearch?: (text: string) => void;
2749
2743
  /** Enter on a node, or a click on its label. */
2750
2744
  onActivate?: (node: K) => void;
2751
2745
  /**