@salilvnair/dui 1.0.9 → 1.0.11

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.
@@ -38,6 +38,17 @@ export interface LoadingStateViewProps {
38
38
  label: string;
39
39
  onClick: () => void;
40
40
  };
41
+ /**
42
+ * How wide the message is allowed to run.
43
+ *
44
+ * Defaults to `52ch`, which is the right measure for a sentence inside a
45
+ * list or a modal. A loader that owns a whole panel is a different problem:
46
+ * the same 52ch sits as a narrow column in the middle of a large empty
47
+ * space, wrapping a short message onto three lines while the screen around
48
+ * it is blank. Widen it there, in `ch` so it stays a measure rather than a
49
+ * pixel guess.
50
+ */
51
+ messageWidth?: number | string;
41
52
  /** Shown under the message: what is being fetched, step by step. */
42
53
  hints?: {
43
54
  key: ReactNode;
@@ -58,4 +69,4 @@ export interface LoadingStateViewProps {
58
69
  * Three things it does that a spinner cannot: it names the subject, it changes
59
70
  * its mind after a while, and it eventually offers a way out.
60
71
  */
61
- export declare function LoadingStateView({ icon, title, message, accentColor, compact, medallionSize, slowAfterSeconds, slowMessage, action, hints, className, style, }: LoadingStateViewProps): import("react").JSX.Element;
72
+ export declare function LoadingStateView({ icon, title, message, accentColor, compact, medallionSize, slowAfterSeconds, slowMessage, action, messageWidth, hints, className, style, }: LoadingStateViewProps): import("react").JSX.Element;
@@ -1,5 +1,23 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { DuiSize, DuiRadius } from '../../core/DuiTypes';
3
+ /**
4
+ * How many characters the value field has to hold.
5
+ *
6
+ * ── Why this is not a function of the height ──
7
+ *
8
+ * It was: the field was `height * 1.4`, which is 37px at every size — room for
9
+ * two digits. A stepper bounded at 300 therefore displayed its own maximum as
10
+ * `3(`, clipped mid-glyph, and no caller could widen it because the width was
11
+ * computed inside.
12
+ *
13
+ * A stepper knows its range. The longest thing it can ever show is the longer
14
+ * of its two bounds, sign and decimals included, so that is what it makes room
15
+ * for — and a range with no bounds gets enough for a number somebody would
16
+ * plausibly type.
17
+ *
18
+ * Exported so the rule can be held to by a test rather than by looking at it.
19
+ */
20
+ export declare function stepperValueChars(min: number, max: number, step?: number): number;
3
21
  export interface StepperInputViewProps {
4
22
  /**
5
23
  * A stable hook for tests and automation.
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salilvnair/dui",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Daakia UI component library — shared across ck8t and daakia",
5
5
  "type": "module",
6
6
  "license": "MIT",