@umriss-ui/core 0.1.0 → 0.3.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/de.d.ts CHANGED
@@ -1,3 +1,45 @@
1
+ /** Everything the library knows about formatting. */
2
+ declare interface Formats {
3
+ /** Date as displayed: 17/03/2026 */
4
+ date: (d: Date) => string;
5
+ /** Short form without the year, in the range footer: 17/03 */
6
+ dateShort: (d: Date) => string;
7
+ /** The calendar's month header: March 2026 */
8
+ month: (d: Date) => string;
9
+ /** Accessible name of a calendar cell: Tuesday, 17 March 2026 */
10
+ dateLong: (d: Date) => string;
11
+ /** Time of day, optionally with seconds: 09:05 or 09:05:03 */
12
+ time: (d: Date, withSeconds: boolean) => string;
13
+ /** Date and time together: 17/03/2026, 09:05 */
14
+ dateTime: (d: Date, withSeconds: boolean) => string;
15
+ /** Short form of the UTC offset: GMT+2 */
16
+ offset: (d: Date) => string;
17
+ /**
18
+ * A number in the set's notation. Without a digit count the value stands to
19
+ * the tenth decimal place; with one it is padded and rounded to exactly that
20
+ * many places.
21
+ */
22
+ number: (n: number, decimals?: number) => string;
23
+ /**
24
+ * A count. Kept apart from `number` because it makes a different promise: a
25
+ * count is whole, and Intl's default (at most three decimal places) is right
26
+ * for it and wrong for a measurement.
27
+ */
28
+ count: (n: number) => string;
29
+ /** A share from 0 to 1 as whole per cent: 74 % */
30
+ percent: (share: number) => string;
31
+ /** The ordering of two texts by the set's collation. */
32
+ compareText: (a: string, b: string) => number;
33
+ /** An elapsed duration as a phrase: "3 minutes ago".
34
+ The amount comes in milliseconds, counted back from now. */
35
+ relative: (ms: number) => string;
36
+ }
37
+
38
+ /** The German notation: 17.03.2026, 09:05, 1.204,5, "vor 3 Minuten" - and
39
+ German collation, which files Ä with A. The clock is 24-hour here as it is
40
+ in the default; that never was a question of language. */
41
+ export declare const GERMAN_FORMATS: Formats;
42
+
1
43
  /** The German instance. Complete, because it is typed `Wording`. */
2
44
  export declare const GERMAN_WORDING: Wording;
3
45
 
@@ -299,6 +341,31 @@ declare interface Wording {
299
341
  remove: string;
300
342
  /** The cross on a tag with text content. */
301
343
  removeTag: (beschriftung: string) => string;
344
+ /** The two findings, named on the ghost of a drag. */
345
+ scheduleOverlap: string;
346
+ scheduleLateTransport: string;
347
+ /** The new times on the ghost: "08:15–10:00" - the times come from the
348
+ formats. */
349
+ scheduleGhostTimes: (from: string, to: string) => string;
350
+ /** The parts of a subtask and a transport, named in the tooltip. */
351
+ scheduleSetup: string;
352
+ scheduleTeardown: string;
353
+ scheduleTransport: string;
354
+ /** "A-2041-1 → A-2041-2": where a transport goes. */
355
+ scheduleRoute: (from: string, to: string) => string;
356
+ /** "Overlap with A-2043-2" - the other subtask on the lane. */
357
+ scheduleOverlapWith: (other: string) => string;
358
+ /** "Late transport, 15 min short" - the amount from `minutesShort`. */
359
+ scheduleLateBy: (amount: string) => string;
360
+ /** On the ghost of a drag over a lane the subtask may not go to. */
361
+ scheduleLaneRefused: string;
362
+ /** The chevron of a lane group's header, which folds it into one row and
363
+ unfolds it again. The group's own label stands beside the button, so the
364
+ name is what the ACTION is, not which group it acts on. */
365
+ scheduleFoldGroup: string;
366
+ scheduleUnfoldGroup: string;
367
+ /** How many lanes a group holds, beside its name in the header. */
368
+ scheduleLaneCount: (count: number) => string;
302
369
  }
303
370
 
304
371
  export { }
@@ -0,0 +1,65 @@
1
+ const y = [
2
+ ["day", 86400],
3
+ ["hour", 3600],
4
+ ["minute", 60]
5
+ ];
6
+ function D(e) {
7
+ const r = new Intl.DateTimeFormat(e, { day: "2-digit", month: "2-digit", year: "numeric" }), a = new Intl.DateTimeFormat(e, { day: "2-digit", month: "2-digit" }), f = new Intl.DateTimeFormat(e, { month: "long", year: "numeric" }), F = new Intl.DateTimeFormat(e, {
8
+ weekday: "long",
9
+ day: "numeric",
10
+ month: "long",
11
+ year: "numeric"
12
+ }), m = { hour: "2-digit", minute: "2-digit", hour12: !1, hourCycle: "h23" }, i = {
13
+ without: new Intl.DateTimeFormat(e, m),
14
+ with: new Intl.DateTimeFormat(e, { ...m, second: "2-digit" })
15
+ }, s = {
16
+ without: new Intl.DateTimeFormat(e, { day: "2-digit", month: "2-digit", year: "numeric", ...m }),
17
+ with: new Intl.DateTimeFormat(e, {
18
+ day: "2-digit",
19
+ month: "2-digit",
20
+ year: "numeric",
21
+ ...m,
22
+ second: "2-digit"
23
+ })
24
+ }, h = new Intl.DateTimeFormat(e, { timeZoneName: "shortOffset" }), u = /* @__PURE__ */ new Map(), g = new Intl.NumberFormat(e), w = new Intl.NumberFormat(e, { style: "percent", maximumFractionDigits: 0 }), T = new Intl.Collator(e), c = new Intl.RelativeTimeFormat(e, { numeric: "auto" });
25
+ return {
26
+ date: (t) => r.format(t),
27
+ dateShort: (t) => a.format(t),
28
+ month: (t) => f.format(t),
29
+ dateLong: (t) => F.format(t),
30
+ time: (t, n) => (n ? i.with : i.without).format(t),
31
+ dateTime: (t, n) => (n ? s.with : s.without).format(t),
32
+ offset: (t) => {
33
+ var n;
34
+ return ((n = h.formatToParts(t).find((o) => o.type === "timeZoneName")) == null ? void 0 : n.value) ?? "";
35
+ },
36
+ number: (t, n) => {
37
+ let o = u.get(n);
38
+ return o || (o = new Intl.NumberFormat(e, {
39
+ minimumFractionDigits: n,
40
+ maximumFractionDigits: n ?? 10
41
+ }), u.set(n, o)), o.format(t);
42
+ },
43
+ count: (t) => g.format(t),
44
+ percent: (t) => w.format(t),
45
+ compareText: (t, n) => T.compare(t, n),
46
+ relative: (t) => {
47
+ const n = Math.max(0, Math.round(t / 1e3));
48
+ for (const [o, d] of y)
49
+ if (n >= d) return c.format(-Math.floor(n / d), o);
50
+ return c.format(-n, "second");
51
+ }
52
+ };
53
+ }
54
+ const I = D("en-GB");
55
+ function p(e) {
56
+ const r = [...e.number(1234.5, 1).replace(/[\d-]/g, "")], a = r[r.length - 1] ?? ".";
57
+ return { group: r.length > 1 ? r[0] : "", decimal: a };
58
+ }
59
+ const S = p(I);
60
+ export {
61
+ I as D,
62
+ S as a,
63
+ D as f,
64
+ p as s
65
+ };
package/dist/index.d.ts CHANGED
@@ -316,6 +316,37 @@ export declare interface ConfirmDialogProps {
316
316
  loading?: boolean;
317
317
  }
318
318
 
319
+ /**
320
+ * A menu that opens at a point instead of under a trigger – for a right-click
321
+ * on something that is not a button: a canvas, a row, a subtask.
322
+ *
323
+ * It hangs from an invisible anchor that stands at the point, so the one
324
+ * popover does the placing, the dismissal and the portal. The focus goes to
325
+ * the first entry and, on closing, back to where it was when the menu opened.
326
+ */
327
+ export declare function ContextMenu({ open, onOpenChange, position, ariaLabel, children }: ContextMenuProps): JSX.Element;
328
+
329
+ export declare interface ContextMenuProps {
330
+ /** Whether the menu stands. Controlled, like `Popover`: a right-click
331
+ opens it only because the caller says so. */
332
+ open: boolean;
333
+ /** Reports every wish to change the state – an entry chosen, Escape, an
334
+ outside click. */
335
+ onOpenChange: (open: boolean) => void;
336
+ /** Where the menu opens, in client coordinates – typically `clientX` and
337
+ `clientY` of the event that asked for it. At a window edge the panel
338
+ flips and clamps as every popover does. */
339
+ position: {
340
+ x: number;
341
+ y: number;
342
+ };
343
+ /** Accessible name of the menu: what it acts on. A context menu has no
344
+ trigger whose label could name it. */
345
+ ariaLabel: string;
346
+ /** The entries – `MenuItem` and `MenuSeparator`, as in `Menu`. */
347
+ children: ReactNode;
348
+ }
349
+
319
350
  /** The cross that clears a field. Six times in the set, identical. */
320
351
  export declare const CrossGlyph: ForwardRefExoticComponent<Omit<GlyphProps, "ref"> & RefAttributes<SVGSVGElement>>;
321
352
 
@@ -494,6 +525,8 @@ export declare interface DateTimeRangePickerProps {
494
525
  presets?: RangePreset[];
495
526
  }
496
527
 
528
+ /** The instance shipped by default: English notation on a 24-hour clock
529
+ (ADR-0024). German is `GERMAN_FORMATS` in `@umriss-ui/core/wording/de`. */
497
530
  export declare const DEFAULT_FORMATS: Formats;
498
531
 
499
532
  export declare const DEFAULT_LANGUAGE: Language;
@@ -501,6 +534,9 @@ export declare const DEFAULT_LANGUAGE: Language;
501
534
  /** The same time spans with the preset labels. */
502
535
  export declare const DEFAULT_PRESETS: RangePreset[];
503
536
 
537
+ /** The separators of the default notation. */
538
+ export declare const DEFAULT_SEPARATORS: Separators;
539
+
504
540
  /** The instance shipped by default. English; German is `GERMAN_WORDING` in
505
541
  `@umriss-ui/core/wording/de` (ADR-0019). */
506
542
  export declare const DEFAULT_WORDING: Wording;
@@ -640,23 +676,23 @@ export declare interface FlatteningEntry<K, S extends Key = string> {
640
676
 
641
677
  /** Everything the library knows about formatting. */
642
678
  export declare interface Formats {
643
- /** Date as displayed: 17.03.2026 */
679
+ /** Date as displayed: 17/03/2026 */
644
680
  date: (d: Date) => string;
645
- /** Short form without the year, in the range footer: 17.03. */
681
+ /** Short form without the year, in the range footer: 17/03 */
646
682
  dateShort: (d: Date) => string;
647
- /** The calendar's month header: März 2026 */
683
+ /** The calendar's month header: March 2026 */
648
684
  month: (d: Date) => string;
649
- /** Accessible name of a calendar cell: Dienstag, 17. März 2026 */
685
+ /** Accessible name of a calendar cell: Tuesday, 17 March 2026 */
650
686
  dateLong: (d: Date) => string;
651
687
  /** Time of day, optionally with seconds: 09:05 or 09:05:03 */
652
688
  time: (d: Date, withSeconds: boolean) => string;
653
- /** Date and time together: 17.03.2026, 09:05 */
689
+ /** Date and time together: 17/03/2026, 09:05 */
654
690
  dateTime: (d: Date, withSeconds: boolean) => string;
655
691
  /** Short form of the UTC offset: GMT+2 */
656
692
  offset: (d: Date) => string;
657
693
  /**
658
- * A number in German notation. Without a digit count the value stands to the
659
- * tenth decimal place; with one it is padded and rounded to exactly that
694
+ * A number in the set's notation. Without a digit count the value stands to
695
+ * the tenth decimal place; with one it is padded and rounded to exactly that
660
696
  * many places.
661
697
  */
662
698
  number: (n: number, decimals?: number) => string;
@@ -668,9 +704,9 @@ export declare interface Formats {
668
704
  count: (n: number) => string;
669
705
  /** A share from 0 to 1 as whole per cent: 74 % */
670
706
  percent: (share: number) => string;
671
- /** The ordering of two texts by German collation. */
707
+ /** The ordering of two texts by the set's collation. */
672
708
  compareText: (a: string, b: string) => number;
673
- /** An elapsed duration as a phrase: "vor 3 Minuten".
709
+ /** An elapsed duration as a phrase: "3 minutes ago".
674
710
  The amount comes in milliseconds, counted back from now. */
675
711
  relative: (ms: number) => string;
676
712
  }
@@ -1319,6 +1355,25 @@ export declare interface SelectProps extends SelectHTMLAttributes<HTMLSelectElem
1319
1355
  onClear?: () => void;
1320
1356
  }
1321
1357
 
1358
+ /** The two characters a notation separates with. */
1359
+ export declare interface Separators {
1360
+ /** Between thousands: "," in English, "." in German, empty where a notation
1361
+ does not group. */
1362
+ readonly group: string;
1363
+ /** Before the decimals: "." in English, "," in German. */
1364
+ readonly decimal: string;
1365
+ }
1366
+
1367
+ /** The separators a set of formats writes, read off the formats themselves.
1368
+
1369
+ A field that formats a number must be able to read its own output back, and
1370
+ an application may have replaced `number` with anything (ADR-0024 moved the
1371
+ default from German to English, which is how this came up). So the
1372
+ separators are not declared a second time but measured: one number with one
1373
+ decimal place, digits struck out, and what remains is the notation's own
1374
+ punctuation. */
1375
+ export declare function separatorsOf(formats: Formats): Separators;
1376
+
1322
1377
  export declare function setActive<S extends Key>(snapshot: TreeSnapshot<S>, key: S | null): TreeSnapshot<S>;
1323
1378
 
1324
1379
  export declare function setAnchor<S extends Key>(snapshot: TreeSnapshot<S>, key: S | null): TreeSnapshot<S>;
@@ -1551,8 +1606,6 @@ declare type TextTracking = "normal" | "tight" | "display" | "caps";
1551
1606
 
1552
1607
  export declare type TextWeight = "regular" | "medium" | "semibold";
1553
1608
 
1554
- export declare type Theme = "light" | "dark" | "system";
1555
-
1556
1609
  export declare interface ToastConfig {
1557
1610
  /** Display duration in ms, where the individual toast names none. */
1558
1611
  duration?: number;
@@ -1753,7 +1806,6 @@ export declare interface TreeViewProps<K, S extends Key = string> extends Omit<H
1753
1806
  export declare function typeaheadTarget<K, S extends Key = string>(flattening: readonly FlatteningEntry<K, S>[], prefix: string, active: S | null): S | null;
1754
1807
 
1755
1808
  export declare interface UmrissConfig {
1756
- theme?: Theme;
1757
1809
  density: Density;
1758
1810
  portalTarget: PortalTarget;
1759
1811
  toast: ToastConfig;
@@ -1766,23 +1818,14 @@ export declare interface UmrissConfig {
1766
1818
  * component; whoever needs only wording can still use `LanguageProvider` on its
1767
1819
  * own.
1768
1820
  */
1769
- export declare function UmrissProvider({ theme, density, portalTarget, toast, language, children, }: UmrissProviderProps): JSX.Element;
1821
+ export declare function UmrissProvider({ density, portalTarget, toast, language, children, }: UmrissProviderProps): JSX.Element;
1770
1822
 
1771
1823
  export declare interface UmrissProviderProps {
1772
1824
  /**
1773
- * Sets `data-theme` at the root - the attribute the token layers already
1774
- * listen to; nothing changes about the tokens themselves. "system" means
1775
- * subscribe: a change at runtime is taken along. Without a value the provider
1776
- * does not touch the attribute, so that an application setting its own theme
1777
- * is left undisturbed.
1778
- */
1779
- theme?: Theme;
1780
- /**
1781
- * Sets `data-density` at the root and is the default for the `density` of
1782
- * every component that reads it with `useDensityFor` - in @umriss-ui/table
1783
- * `Table` and `AlarmList` ("comfortable" means "regular"). Without a value
1784
- * the provider touches neither the attribute nor a component: one that is
1785
- * compact of its own accord stays compact.
1825
+ * The default for the `density` of every component that reads it with
1826
+ * `useDensityFor` - in @umriss-ui/table `Table` and `AlarmList`
1827
+ * ("comfortable" means "regular"). Without a value the provider touches no
1828
+ * component: one that is compact of its own accord stays compact.
1786
1829
  */
1787
1830
  density?: Density;
1788
1831
  /**
@@ -2256,6 +2299,31 @@ export declare interface Wording {
2256
2299
  remove: string;
2257
2300
  /** The cross on a tag with text content. */
2258
2301
  removeTag: (beschriftung: string) => string;
2302
+ /** The two findings, named on the ghost of a drag. */
2303
+ scheduleOverlap: string;
2304
+ scheduleLateTransport: string;
2305
+ /** The new times on the ghost: "08:15–10:00" - the times come from the
2306
+ formats. */
2307
+ scheduleGhostTimes: (from: string, to: string) => string;
2308
+ /** The parts of a subtask and a transport, named in the tooltip. */
2309
+ scheduleSetup: string;
2310
+ scheduleTeardown: string;
2311
+ scheduleTransport: string;
2312
+ /** "A-2041-1 → A-2041-2": where a transport goes. */
2313
+ scheduleRoute: (from: string, to: string) => string;
2314
+ /** "Overlap with A-2043-2" - the other subtask on the lane. */
2315
+ scheduleOverlapWith: (other: string) => string;
2316
+ /** "Late transport, 15 min short" - the amount from `minutesShort`. */
2317
+ scheduleLateBy: (amount: string) => string;
2318
+ /** On the ghost of a drag over a lane the subtask may not go to. */
2319
+ scheduleLaneRefused: string;
2320
+ /** The chevron of a lane group's header, which folds it into one row and
2321
+ unfolds it again. The group's own label stands beside the button, so the
2322
+ name is what the ACTION is, not which group it acts on. */
2323
+ scheduleFoldGroup: string;
2324
+ scheduleUnfoldGroup: string;
2325
+ /** How many lanes a group holds, beside its name in the header. */
2326
+ scheduleLaneCount: (count: number) => string;
2259
2327
  }
2260
2328
 
2261
2329
  export { }
@@ -1,4 +1,5 @@
1
- const i = {
1
+ import { f as r } from "../formats-DrB9TuzO.js";
2
+ const a = r("de-DE"), l = {
2
3
  clearInput: "Eingabe leeren",
3
4
  clearSelection: "Auswahl leeren",
4
5
  decreaseValue: "Wert verringern",
@@ -190,8 +191,22 @@ const i = {
190
191
  hide: "Ausblenden",
191
192
  moreActions: "Weitere Aktionen",
192
193
  remove: "Entfernen",
193
- removeTag: (e) => `${e} entfernen`
194
+ removeTag: (e) => `${e} entfernen`,
195
+ scheduleOverlap: "Überschneidung",
196
+ scheduleLateTransport: "Transport verspätet",
197
+ scheduleGhostTimes: (e, n) => `${e}–${n}`,
198
+ scheduleSetup: "Rüsten",
199
+ scheduleTeardown: "Abrüsten",
200
+ scheduleTransport: "Transport",
201
+ scheduleRoute: (e, n) => `${e} → ${n}`,
202
+ scheduleOverlapWith: (e) => `Überschneidung mit ${e}`,
203
+ scheduleLateBy: (e) => `Transport verspätet, ${e} zu knapp`,
204
+ scheduleLaneRefused: "Nicht hierher",
205
+ scheduleFoldGroup: "Gruppe einklappen",
206
+ scheduleUnfoldGroup: "Gruppe ausklappen",
207
+ scheduleLaneCount: (e) => e === 1 ? "1 Bahn" : `${e} Bahnen`
194
208
  };
195
209
  export {
196
- i as GERMAN_WORDING
210
+ a as GERMAN_FORMATS,
211
+ l as GERMAN_WORDING
197
212
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/core",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "A React component library for data-dense applications - precise, quiet, professional.",
5
5
  "license": "MIT",
6
6
  "author": "Roman Händler",
@@ -73,6 +73,7 @@
73
73
  "pretypecheck": "pnpm run props && pnpm run readme",
74
74
  "typecheck": "tsc --noEmit",
75
75
  "preview:demo": "vite preview --config vite.demo.config.ts --port 4173 --strictPort",
76
- "test:unit": "vitest run"
76
+ "test:unit": "vitest run",
77
+ "check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts core.js core.css"
77
78
  }
78
79
  }