@umriss-ui/core 0.50.0 → 0.52.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/core",
3
- "version": "0.50.0",
3
+ "version": "0.52.0",
4
4
  "description": "React component library for data-dense dashboards and tools - forms, date pickers, overlays, a tree view and a command palette. Precise, quiet, professional.",
5
5
  "license": "MIT",
6
6
  "author": "Roman Händler",
@@ -30,6 +30,7 @@
30
30
  "type": "module",
31
31
  "files": [
32
32
  "dist",
33
+ "API.md",
33
34
  "docs/llms-full.md",
34
35
  "CHANGELOG.md"
35
36
  ],
@@ -91,20 +92,5 @@
91
92
  "typescript": "^5.6.3",
92
93
  "vite": "^6.0.0",
93
94
  "vite-plugin-dts": "^4.3.0"
94
- },
95
- "scripts": {
96
- "props": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/props.ts",
97
- "readme": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/tooling/readmeTable.ts",
98
- "predev": "pnpm run props",
99
- "dev": "vite --config vite.demo.config.ts",
100
- "build": "vite build",
101
- "prebuild:demo": "pnpm run props",
102
- "build:demo": "vite build --config vite.demo.config.ts",
103
- "typecheck": "tsc --noEmit",
104
- "typecheck:demo": "pnpm run props && tsc --noEmit -p tsconfig.demo.json",
105
- "check:site": "pnpm run props -- --check && pnpm run readme && node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/checkReadmeLinks.ts",
106
- "preview:demo": "node ../../scripts/preview.mjs core",
107
- "test:unit": "vitest run",
108
- "check:dist": "node --disable-warning=ExperimentalWarning --experimental-strip-types ../../scripts/check-dist.ts core.js core.css"
109
95
  }
110
96
  }
@@ -1,102 +0,0 @@
1
- function R(t, e, i) {
2
- if (i === "percent") return t.percent(e);
3
- if (i === "count") return t.count(e);
4
- if (i === void 0) return t.number(e);
5
- const { decimals: o, ...m } = i;
6
- return Object.keys(m).length === 0 ? t.number(e, o) : t.numberWith(
7
- e,
8
- o === void 0 ? m : { minimumFractionDigits: o, maximumFractionDigits: o, ...m }
9
- );
10
- }
11
- const w = 10, v = [
12
- ["day", 86400],
13
- ["hour", 3600],
14
- ["minute", 60]
15
- ];
16
- function E(t, e) {
17
- const i = `${t}|${e ?? ""}`;
18
- let o = T.get(i);
19
- if (!o) {
20
- o = M(t, e), T.set(i, o);
21
- for (const m of L) A.add(o[m]);
22
- }
23
- return o;
24
- }
25
- const T = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new WeakSet(), L = ["date", "dateShort", "month", "dateLong", "time", "dateTime", "offset", "timeZoneName"];
26
- function l(t) {
27
- const e = new Intl.Locale(t);
28
- return e.getWeekInfo?.().firstDay ?? e.weekInfo?.firstDay ?? 1;
29
- }
30
- function M(t, e) {
31
- const i = new Intl.DateTimeFormat(t, { timeZone: e, day: "2-digit", month: "2-digit", year: "numeric" }), o = new Intl.DateTimeFormat(t, { timeZone: e, day: "2-digit", month: "2-digit" }), m = new Intl.DateTimeFormat(t, { timeZone: e, month: "long", year: "numeric" }), I = new Intl.DateTimeFormat(t, { month: "long" }), D = new Intl.DateTimeFormat(t, {
32
- timeZone: e,
33
- weekday: "long",
34
- day: "numeric",
35
- month: "long",
36
- year: "numeric"
37
- }), c = { timeZone: e, hour: "2-digit", minute: "2-digit", hour12: !1, hourCycle: "h23" }, f = {
38
- without: new Intl.DateTimeFormat(t, c),
39
- with: new Intl.DateTimeFormat(t, { ...c, second: "2-digit" })
40
- }, d = {
41
- without: new Intl.DateTimeFormat(t, { day: "2-digit", month: "2-digit", year: "numeric", ...c }),
42
- with: new Intl.DateTimeFormat(t, {
43
- day: "2-digit",
44
- month: "2-digit",
45
- year: "numeric",
46
- ...c,
47
- second: "2-digit"
48
- })
49
- }, y = new Intl.DateTimeFormat(t, { timeZone: e, timeZoneName: "shortOffset" }), N = new Intl.DateTimeFormat(t, { timeZone: e, timeZoneName: "shortGeneric" }), F = /* @__PURE__ */ new Map(), u = { signDisplay: "negative" }, g = /* @__PURE__ */ new Map(), b = new Intl.NumberFormat(t, { ...u, notation: "scientific", maximumSignificantDigits: 10 }), p = new Intl.NumberFormat(t, u), S = new Intl.NumberFormat(t, { ...u, style: "percent", maximumFractionDigits: 0 }), k = new Intl.Collator(t), h = new Intl.RelativeTimeFormat(t, { numeric: "auto" });
50
- return {
51
- locale: t,
52
- timeZone: e,
53
- weekStart: l(t),
54
- timeZoneName: (n) => N.formatToParts(n).find((r) => r.type === "timeZoneName")?.value ?? "",
55
- date: (n) => i.format(n),
56
- dateShort: (n) => o.format(n),
57
- month: (n) => m.format(n),
58
- monthName: (n) => I.format(n),
59
- dateLong: (n) => D.format(n),
60
- time: (n, r) => (r ? f.with : f.without).format(n),
61
- dateTime: (n, r) => (r ? d.with : d.without).format(n),
62
- offset: (n) => y.formatToParts(n).find((r) => r.type === "timeZoneName")?.value ?? "",
63
- number: (n, r) => {
64
- if (r === void 0 && n !== 0 && Math.abs(n) < 0.5 * 10 ** -w) return b.format(n);
65
- let a = F.get(r);
66
- return a || (a = new Intl.NumberFormat(t, {
67
- ...u,
68
- minimumFractionDigits: r,
69
- maximumFractionDigits: r ?? w
70
- }), F.set(r, a)), a.format(n);
71
- },
72
- numberWith: (n, r) => {
73
- const a = JSON.stringify(r);
74
- let s = g.get(a);
75
- return s || (s = new Intl.NumberFormat(t, { ...u, ...r }), g.set(a, s)), s.format(n);
76
- },
77
- count: (n) => p.format(n),
78
- percent: (n) => S.format(n),
79
- compareText: (n, r) => k.compare(n, r),
80
- relative: (n) => {
81
- const r = Math.max(0, Math.round(n / 1e3));
82
- for (const [a, s] of v)
83
- if (r >= s) return h.format(-Math.floor(r / s), a);
84
- return h.format(-r, "second");
85
- }
86
- };
87
- }
88
- const x = /* @__PURE__ */ E("en-GB");
89
- function O(t) {
90
- const e = [...t.number(1234.5, 1).replace(/[\d-]/g, "")], i = e[e.length - 1] ?? ".";
91
- return { group: e.length > 1 ? e[0] : "", decimal: i };
92
- }
93
- const P = /* @__PURE__ */ O(x);
94
- export {
95
- x as D,
96
- L as I,
97
- P as a,
98
- A as b,
99
- E as f,
100
- O as s,
101
- R as w
102
- };