@slotted/react 0.1.0-beta.16 → 0.1.0-beta.18
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/{app-shell-CJwXBvE5.js → app-shell-CXlO6z0w.js} +90 -73
- package/dist/app-shell.js +1 -1
- package/dist/dashboard-grid-z3nKqvN8.js +1149 -0
- package/dist/dashboard-grid.js +1 -1
- package/dist/{description-list-KjUs1muC.js → description-list-BbWLehw0.js} +18 -16
- package/dist/description-list.js +1 -1
- package/dist/{detail-panel-BNfYQJfv.js → detail-panel-DYe_D46K.js} +2 -2
- package/dist/detail-panel.js +1 -1
- package/dist/docs/alert.json +1 -1
- package/dist/docs/alert.md +1 -1
- package/dist/docs/app-shell.json +19 -2
- package/dist/docs/app-shell.md +3 -1
- package/dist/docs/dashboard-grid.json +5 -5
- package/dist/docs/dashboard-grid.md +4 -4
- package/dist/docs/description-list.json +10 -2
- package/dist/docs/description-list.md +2 -1
- package/dist/docs/guidelines/composition.md +12 -0
- package/dist/docs/guidelines/errors-and-conflicts.md +7 -6
- package/dist/docs/guidelines/index.md +3 -0
- package/dist/docs/guidelines/layout-alignment.md +2 -2
- package/dist/docs/guidelines/overviews.md +21 -1
- package/dist/docs/guidelines/reading-permissions.md +2 -2
- package/dist/docs/guidelines/reports.md +1 -1
- package/dist/docs/index.md +2 -2
- package/dist/docs/inline-message.json +5 -4
- package/dist/docs/inline-message.md +6 -5
- package/dist/docs/page.json +2 -2
- package/dist/docs/page.md +1 -1
- package/dist/docs/skills/compose-screen/SKILL.md +10 -1
- package/dist/docs/skills/review-screen/SKILL.md +22 -20
- package/dist/docs/stat-card.json +7 -4
- package/dist/docs/stat-card.md +4 -4
- package/dist/index.js +63 -63
- package/dist/{page-CwYmBoZQ.js → page-CzqbnTnU.js} +56 -56
- package/dist/{page-header-BgYXPEbd.js → page-header-TejJ-BTC.js} +1 -1
- package/dist/page-header.js +1 -1
- package/dist/page.js +2 -2
- package/dist/{side-navigation-DRLWTlJ4.js → side-navigation-CvIGfGjZ.js} +1 -1
- package/dist/side-navigation.js +1 -1
- package/dist/stat-card-Dv9oJAbF.js +252 -0
- package/dist/stat-card.js +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/dashboard-grid.css +1 -1
- package/dist/styles/description-list.css +1 -1
- package/dist/styles/index.css +4 -4
- package/dist/styles/side-navigation.css +1 -1
- package/dist/styles/stat-card.css +3 -1
- package/dist/styles/top-navigation.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{top-navigation-B_oQgy56.js → top-navigation-D_Jt0jNw.js} +1 -1
- package/dist/top-navigation.js +1 -1
- package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
- package/dist/types/chart/chart.d.ts +2 -2
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/chart/chart.types.d.ts +10 -6
- package/dist/types/chart/chart.types.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid-context.d.ts +14 -1
- package/dist/types/dashboard-grid/dashboard-grid-context.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.types.d.ts +6 -2
- package/dist/types/dashboard-grid/dashboard-grid.types.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
- package/dist/types/dashboard-grid/use-persisted-dashboard-layout.d.ts +2 -1
- package/dist/types/dashboard-grid/use-persisted-dashboard-layout.d.ts.map +1 -1
- package/dist/types/description-list/description-list-defaults.d.ts.map +1 -1
- package/dist/types/description-list/description-list.d.ts +1 -1
- package/dist/types/description-list/description-list.d.ts.map +1 -1
- package/dist/types/description-list/description-list.types.d.ts +7 -0
- package/dist/types/description-list/description-list.types.d.ts.map +1 -1
- package/dist/types/description-list/index.d.ts +1 -1
- package/dist/types/description-list/index.d.ts.map +1 -1
- package/dist/types/inline-message/inline-message.d.ts +2 -2
- package/dist/types/inline-message/inline-message.types.d.ts +2 -2
- package/dist/types/page/index.d.ts +1 -1
- package/dist/types/page/index.d.ts.map +1 -1
- package/dist/types/page/page.d.ts +6 -0
- package/dist/types/page/page.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-parts.d.ts +7 -3
- package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/dashboard-grid-ByThIV_n.js +0 -1066
- package/dist/stat-card-CUISfM36.js +0 -247
|
@@ -32,73 +32,73 @@ function _({ children: e, ...t }) {
|
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/page/page.tsx
|
|
35
|
-
var v = "--slotted-page-sticky-bottom";
|
|
36
|
-
function
|
|
37
|
-
let
|
|
38
|
-
e.style.getPropertyValue(
|
|
35
|
+
var v = "--slotted-page-sticky-bottom", y = "--slotted-page-scrollport-block-size";
|
|
36
|
+
function b(e, t, n) {
|
|
37
|
+
let r = `${n}px`;
|
|
38
|
+
e.style.getPropertyValue(t) !== r && e.style.setProperty(t, r);
|
|
39
39
|
}
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
return a(
|
|
40
|
+
var x = i(void 0);
|
|
41
|
+
function S() {
|
|
42
|
+
return a(x);
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let
|
|
47
|
-
ground:
|
|
48
|
-
inset:
|
|
44
|
+
var C = typeof document > "u" ? o : s;
|
|
45
|
+
function w({ children: t, className: n, fill: i, footer: a, ground: s, inset: c, landmark: p, loading: h, messages: _, ref: S, render: w, scroll: D, style: O, width: k, ...A }) {
|
|
46
|
+
let j = g(), M = e(m, _), N = s ?? j.ground, P = c ?? j.inset, F = p ?? j.landmark, I = D ?? j.scroll, L = k ?? j.width, R = {
|
|
47
|
+
ground: N,
|
|
48
|
+
inset: P,
|
|
49
49
|
loading: h === !0,
|
|
50
|
-
scroll:
|
|
51
|
-
t:
|
|
52
|
-
width:
|
|
53
|
-
}, [
|
|
54
|
-
o(() => {}, [
|
|
55
|
-
if (
|
|
56
|
-
let e =
|
|
57
|
-
let
|
|
58
|
-
|
|
50
|
+
scroll: I,
|
|
51
|
+
t: M,
|
|
52
|
+
width: L
|
|
53
|
+
}, [z, B] = l(null);
|
|
54
|
+
o(() => {}, [z]), C(() => {
|
|
55
|
+
if (z === null || typeof ResizeObserver > "u") return;
|
|
56
|
+
let e = T(z) ?? z.ownerDocument.documentElement, t = (I === "self" ? z.querySelector(":scope > [data-part=\"scroll\"]") : null) ?? e, n = new ResizeObserver(() => {
|
|
57
|
+
let n = z.querySelector(":scope > [data-part=\"footer\"]"), r = I === "self" ? 0 : n?.offsetHeight ?? 0;
|
|
58
|
+
b(e, v, r), b(e, y, t.clientHeight);
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
let
|
|
62
|
-
return
|
|
60
|
+
n.observe(z), n.observe(t);
|
|
61
|
+
let r = z.querySelector(":scope > [data-part=\"footer\"]");
|
|
62
|
+
return r !== null && n.observe(r), () => n.disconnect();
|
|
63
63
|
}, [
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
z,
|
|
65
|
+
I,
|
|
66
66
|
a !== void 0
|
|
67
|
-
]),
|
|
68
|
-
if (
|
|
69
|
-
let e =
|
|
67
|
+
]), C(() => {
|
|
68
|
+
if (z === null) return;
|
|
69
|
+
let e = T(z) ?? z.ownerDocument.documentElement;
|
|
70
70
|
return () => {
|
|
71
|
-
e.style.removeProperty(v);
|
|
71
|
+
e.style.removeProperty(v), e.style.removeProperty(y);
|
|
72
72
|
};
|
|
73
|
-
}, [
|
|
74
|
-
let
|
|
75
|
-
...
|
|
73
|
+
}, [z]);
|
|
74
|
+
let V = r({
|
|
75
|
+
...A,
|
|
76
76
|
children: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", {
|
|
77
77
|
"data-part": "scroll",
|
|
78
78
|
"data-part-scroll": "",
|
|
79
79
|
children: t
|
|
80
|
-
}), /* @__PURE__ */ d(
|
|
80
|
+
}), /* @__PURE__ */ d(E, { children: a })] }),
|
|
81
81
|
className: n,
|
|
82
82
|
...i === !0 ? { "data-fill": "" } : {},
|
|
83
|
-
"data-ground":
|
|
83
|
+
"data-ground": N,
|
|
84
84
|
...h === !0 ? { "data-loading": "" } : {},
|
|
85
85
|
"data-part": "root",
|
|
86
|
-
"data-scroll":
|
|
86
|
+
"data-scroll": I,
|
|
87
87
|
"data-ui": "page",
|
|
88
|
-
"data-width":
|
|
89
|
-
style:
|
|
90
|
-
}),
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
return /* @__PURE__ */ d(
|
|
94
|
-
value:
|
|
95
|
-
children:
|
|
96
|
-
...
|
|
97
|
-
ref:
|
|
98
|
-
}) :
|
|
88
|
+
"data-width": L,
|
|
89
|
+
style: O
|
|
90
|
+
}), H = (e) => {
|
|
91
|
+
B(e), typeof S == "function" ? S(e) : S != null && (S.current = e);
|
|
92
|
+
}, U = F === "main" ? "main" : "div";
|
|
93
|
+
return /* @__PURE__ */ d(x.Provider, {
|
|
94
|
+
value: R,
|
|
95
|
+
children: w === void 0 ? /* @__PURE__ */ d(U, {
|
|
96
|
+
...V,
|
|
97
|
+
ref: H
|
|
98
|
+
}) : w(V)
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function T(e) {
|
|
102
102
|
let t = e.ownerDocument.defaultView, n = e.parentElement;
|
|
103
103
|
for (; t !== null && n !== null && n !== e.ownerDocument.body;) {
|
|
104
104
|
let e = t.getComputedStyle(n).overflowY;
|
|
@@ -107,7 +107,7 @@ function w(e) {
|
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function E({ children: e }) {
|
|
111
111
|
let t = e != null && e !== !1, [n, r] = l(t ? "open" : "unmounted"), i = c(e);
|
|
112
112
|
t && (i.current = e);
|
|
113
113
|
let a = c(p({
|
|
@@ -120,7 +120,7 @@ function T({ children: e }) {
|
|
|
120
120
|
}, [t]), o(() => {
|
|
121
121
|
let e = a.current;
|
|
122
122
|
return () => e.stop();
|
|
123
|
-
}, []), n === "unmounted" ? null : /* @__PURE__ */ d(
|
|
123
|
+
}, []), n === "unmounted" ? null : /* @__PURE__ */ d(D.Provider, {
|
|
124
124
|
value: {
|
|
125
125
|
status: n,
|
|
126
126
|
setNode: a.current.setNode
|
|
@@ -128,12 +128,12 @@ function T({ children: e }) {
|
|
|
128
128
|
children: t ? e : i.current
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
var
|
|
131
|
+
var D = i({
|
|
132
132
|
status: "open",
|
|
133
133
|
setNode: () => {}
|
|
134
134
|
});
|
|
135
|
-
function
|
|
136
|
-
let l =
|
|
135
|
+
function O({ children: e, className: i, ref: a, render: o, style: s, ...c }) {
|
|
136
|
+
let l = S(), u = r({
|
|
137
137
|
...c,
|
|
138
138
|
...l?.loading ? { "aria-busy": !0 } : {},
|
|
139
139
|
children: /* @__PURE__ */ d(t, {
|
|
@@ -150,8 +150,8 @@ function D({ children: e, className: i, ref: a, render: o, style: s, ...c }) {
|
|
|
150
150
|
ref: a
|
|
151
151
|
}) : o(u);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
let f =
|
|
153
|
+
function k({ "aria-label": n, children: i, className: o, ref: s, render: c, style: l, ...u }) {
|
|
154
|
+
let f = S(), p = e(m), h = f?.t ?? p, { setNode: g, status: _ } = a(D), v = r({
|
|
155
155
|
...u,
|
|
156
156
|
"aria-label": n ?? h("footer"),
|
|
157
157
|
children: /* @__PURE__ */ d(t, {
|
|
@@ -176,4 +176,4 @@ function O({ "aria-label": n, children: i, className: o, ref: s, render: c, styl
|
|
|
176
176
|
}) : c(v);
|
|
177
177
|
}
|
|
178
178
|
//#endregion
|
|
179
|
-
export {
|
|
179
|
+
export { v as a, g as c, y as i, O as n, S as o, k as r, _ as s, w as t };
|
|
@@ -3,7 +3,7 @@ import { n as t, t as n } from "./icon-D04-_QFA.js";
|
|
|
3
3
|
import { n as r, o as i } from "./progress-indicator-D0acshNn.js";
|
|
4
4
|
import { t as a } from "./skeleton-DeEOmm1y.js";
|
|
5
5
|
import { n as o } from "./container-WoYiHo50.js";
|
|
6
|
-
import {
|
|
6
|
+
import { o as s } from "./page-CzqbnTnU.js";
|
|
7
7
|
import { definedProps as c, keyedProps as l } from "@slotted/core/selector-key";
|
|
8
8
|
import { createControllable as u } from "@slotted/core/state";
|
|
9
9
|
import { createContext as d, useContext as f, useEffect as p, useId as m, useImperativeHandle as h, useLayoutEffect as g, useRef as _, useState as v } from "react";
|
package/dist/page-header.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as e, S as t, T as n, _ as r, a as i, b as a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as v, t as y, u as b, v as x, w as S, x as C, y as w } from "./page-header-
|
|
1
|
+
import { C as e, S as t, T as n, _ as r, a as i, b as a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as v, t as y, u as b, v as x, w as S, x as C, y as w } from "./page-header-TejJ-BTC.js";
|
|
2
2
|
export { t as PageHeader, y as PageHeaderActions, m as PageHeaderArea, _ as PageHeaderBack, d as PageHeaderBreadcrumbs, i as PageHeaderContent, h as PageHeaderControls, S as PageHeaderDefaultsProvider, v as PageHeaderDescription, o as PageHeaderFigure, f as PageHeaderHeading, b as PageHeaderMarks, s as PageHeaderNav, c as PageHeaderNavigation, g as PageHeaderPin, p as PageHeaderProgress, u as PageHeaderSubheading, l as PageHeaderTabs, r as PageHeaderTitle, x as PageHeaderTitleArea, w as PageHeaderTitleRow, a as PageHeaderToggle, C as PageHeaderVisual, e as usePageHeader, n as usePageHeaderDefaults };
|
package/dist/page.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./page-CzqbnTnU.js";
|
|
2
|
+
export { s as Page, r as PageBody, o as PageDefaultsProvider, a as PageFooter, n as SCROLLPORT_BLOCK_SIZE_PROPERTY, e as STICKY_BOTTOM_PROPERTY, i as usePage, t as usePageDefaults };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as e } from "./i18n-D7xXDd8-.js";
|
|
2
2
|
import { n as t, t as n } from "./icon-D04-_QFA.js";
|
|
3
|
-
import { i as r } from "./app-shell-
|
|
3
|
+
import { i as r } from "./app-shell-CXlO6z0w.js";
|
|
4
4
|
import { a as i, i as a, n as o, r as s } from "./tooltip-DrFiRlH8.js";
|
|
5
5
|
import { i as c } from "./skeleton-DeEOmm1y.js";
|
|
6
6
|
import { definedProps as l, keyedProps as u, withSelectorKey as d } from "@slotted/core/selector-key";
|
package/dist/side-navigation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./side-navigation-
|
|
1
|
+
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./side-navigation-CvIGfGjZ.js";
|
|
2
2
|
export { r as SIDE_NAVIGATION_FALLBACK, t as SIDE_NAVIGATION_ROW_SELECTOR, y as SideNavigation, _ as SideNavigationActions, f as SideNavigationCount, b as SideNavigationDefaultsProvider, h as SideNavigationDescription, l as SideNavigationDivider, n as SideNavigationEnd, p as SideNavigationGroup, g as SideNavigationIcon, i as SideNavigationItem, u as SideNavigationLabel, v as SideNavigationLink, a as SideNavigationList, o as SideNavigationSection, m as SideNavigationSectionLabel, d as SideNavigationSkeleton, c as SideNavigationTrigger, x as useSideNavigation, e as useSideNavigationDefaults, s as useSideNavigationItem };
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { n as e, r as t } from "./i18n-D7xXDd8-.js";
|
|
2
|
+
import { n, t as r } from "./icon-D04-_QFA.js";
|
|
3
|
+
import { i } from "./skeleton-DeEOmm1y.js";
|
|
4
|
+
import { t as a } from "./visually-hidden-BUSrFZ1_.js";
|
|
5
|
+
import { n as o, r as s } from "./sparkline-CYU4_lCD.js";
|
|
6
|
+
import { keyedProps as c } from "@slotted/core/selector-key";
|
|
7
|
+
import { createContext as l, useContext as u, useId as d, useMemo as f } from "react";
|
|
8
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { statCardMessages as g } from "@slotted/core/i18n";
|
|
10
|
+
//#region src/stat-card/stat-card-context.tsx
|
|
11
|
+
var _ = l(null), v = _.Provider;
|
|
12
|
+
function y() {
|
|
13
|
+
let e = u(_);
|
|
14
|
+
if (e === null) throw Error("A stat-card part must be rendered inside <StatCard>.");
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
function b(e) {
|
|
18
|
+
return e === void 0 || Number.isNaN(e) || e === 0 ? "flat" : e > 0 ? "up" : "down";
|
|
19
|
+
}
|
|
20
|
+
function x(e, t) {
|
|
21
|
+
return e === "flat" || t === "none" ? "neutral" : e === "up" == (t === "up") ? "success" : "danger";
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/stat-card/stat-card-defaults.tsx
|
|
25
|
+
var S = l({});
|
|
26
|
+
function C() {
|
|
27
|
+
return u(S);
|
|
28
|
+
}
|
|
29
|
+
function w({ children: e, ...t }) {
|
|
30
|
+
let n = C();
|
|
31
|
+
return /* @__PURE__ */ m(S.Provider, {
|
|
32
|
+
value: {
|
|
33
|
+
fill: t.fill ?? n.fill,
|
|
34
|
+
formatOptions: t.formatOptions ?? n.formatOptions,
|
|
35
|
+
goodWhen: t.goodWhen ?? n.goodWhen,
|
|
36
|
+
layout: t.layout ?? n.layout,
|
|
37
|
+
size: t.size ?? n.size
|
|
38
|
+
},
|
|
39
|
+
children: e
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/stat-card/stat-card.tsx
|
|
44
|
+
function T({ children: n, delta: r, fill: i, formatOptions: a, goodWhen: o, layout: s, loading: l = !1, locale: u, messages: p, render: h, size: _, status: y = "ready", tone: S, ...w }) {
|
|
45
|
+
let T = C(), E = e(), D = t(g, p), O = d(), k = {
|
|
46
|
+
fill: i ?? T.fill ?? "outline",
|
|
47
|
+
goodWhen: o ?? T.goodWhen ?? "up",
|
|
48
|
+
layout: s ?? T.layout ?? "inline",
|
|
49
|
+
size: _ ?? T.size ?? "md",
|
|
50
|
+
locale: u ?? E,
|
|
51
|
+
formatOptions: a ?? T.formatOptions
|
|
52
|
+
}, A = S ?? (r === void 0 ? void 0 : x(b(r), k.goodWhen)), j = f(() => ({
|
|
53
|
+
delta: r,
|
|
54
|
+
formatOptions: k.formatOptions,
|
|
55
|
+
goodWhen: k.goodWhen,
|
|
56
|
+
labelId: O,
|
|
57
|
+
loading: l,
|
|
58
|
+
locale: k.locale,
|
|
59
|
+
t: D,
|
|
60
|
+
size: k.size,
|
|
61
|
+
status: y,
|
|
62
|
+
tone: A
|
|
63
|
+
}), [
|
|
64
|
+
r,
|
|
65
|
+
k.formatOptions,
|
|
66
|
+
k.goodWhen,
|
|
67
|
+
O,
|
|
68
|
+
l,
|
|
69
|
+
k.locale,
|
|
70
|
+
D,
|
|
71
|
+
k.size,
|
|
72
|
+
y,
|
|
73
|
+
A
|
|
74
|
+
]), M = c({
|
|
75
|
+
"aria-labelledby": O,
|
|
76
|
+
...w,
|
|
77
|
+
"aria-busy": l || void 0,
|
|
78
|
+
children: /* @__PURE__ */ m(v, {
|
|
79
|
+
value: j,
|
|
80
|
+
children: /* @__PURE__ */ m("div", {
|
|
81
|
+
"data-part": "body",
|
|
82
|
+
"data-part-body": "",
|
|
83
|
+
children: n
|
|
84
|
+
})
|
|
85
|
+
}),
|
|
86
|
+
"data-fill": k.fill,
|
|
87
|
+
"data-good-when": k.goodWhen,
|
|
88
|
+
"data-layout": k.layout,
|
|
89
|
+
"data-loading": l || void 0,
|
|
90
|
+
"data-part": "root",
|
|
91
|
+
"data-size": k.size,
|
|
92
|
+
"data-status": y,
|
|
93
|
+
"data-tone": A,
|
|
94
|
+
"data-ui": "stat-card",
|
|
95
|
+
role: "group"
|
|
96
|
+
});
|
|
97
|
+
return h === void 0 ? /* @__PURE__ */ m("div", { ...M }) : h(M);
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/stat-card/stat-card-delta.tsx
|
|
101
|
+
function E({ children: e, format: t = "percent", formatOptions: o, goodWhen: s, render: l, tone: u, value: d, ...g }) {
|
|
102
|
+
let _ = y(), v = d ?? _.delta, S = b(v), C = u ?? x(S, s ?? _.goodWhen), w = f(() => {
|
|
103
|
+
if (typeof v == "number") return new Intl.NumberFormat(_.locale, {
|
|
104
|
+
signDisplay: "exceptZero",
|
|
105
|
+
...t === "percent" ? {
|
|
106
|
+
style: "percent",
|
|
107
|
+
maximumFractionDigits: 1
|
|
108
|
+
} : {},
|
|
109
|
+
..._.formatOptions,
|
|
110
|
+
...o
|
|
111
|
+
}).format(v);
|
|
112
|
+
}, [
|
|
113
|
+
v,
|
|
114
|
+
_.locale,
|
|
115
|
+
_.formatOptions,
|
|
116
|
+
t,
|
|
117
|
+
o
|
|
118
|
+
]);
|
|
119
|
+
if (_.loading) {
|
|
120
|
+
let e = c({
|
|
121
|
+
...g,
|
|
122
|
+
children: /* @__PURE__ */ m(i, { inlineSize: "3.5em" }),
|
|
123
|
+
"data-part": "delta",
|
|
124
|
+
"data-tone": "neutral",
|
|
125
|
+
"data-trend": "flat"
|
|
126
|
+
});
|
|
127
|
+
return l === void 0 ? /* @__PURE__ */ m("span", { ...e }) : l(e);
|
|
128
|
+
}
|
|
129
|
+
if (_.status !== "ready" || e === void 0 && w === void 0) return null;
|
|
130
|
+
let T = c({
|
|
131
|
+
...g,
|
|
132
|
+
children: /* @__PURE__ */ h(p, { children: [
|
|
133
|
+
/* @__PURE__ */ m("span", {
|
|
134
|
+
"aria-hidden": "true",
|
|
135
|
+
"data-part": "indicator",
|
|
136
|
+
"data-part-indicator": "",
|
|
137
|
+
children: /* @__PURE__ */ m(r, {
|
|
138
|
+
directional: S !== "flat",
|
|
139
|
+
children: /* @__PURE__ */ m(n, { name: S === "flat" ? "minus" : "trending-up" })
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ h(a, { children: [_.t(S), " "] }),
|
|
143
|
+
e ?? w
|
|
144
|
+
] }),
|
|
145
|
+
"data-part": "delta",
|
|
146
|
+
"data-tone": C,
|
|
147
|
+
"data-trend": S
|
|
148
|
+
});
|
|
149
|
+
return l === void 0 ? /* @__PURE__ */ m("span", { ...T }) : l(T);
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/stat-card/stat-card-parts.tsx
|
|
153
|
+
function D({ render: e, ...t }) {
|
|
154
|
+
let n = c({
|
|
155
|
+
...t,
|
|
156
|
+
"data-part": "header"
|
|
157
|
+
});
|
|
158
|
+
return e === void 0 ? /* @__PURE__ */ m("div", { ...n }) : e(n);
|
|
159
|
+
}
|
|
160
|
+
function O({ children: e, render: t, ...n }) {
|
|
161
|
+
let { labelId: r, loading: a } = y(), o = c({
|
|
162
|
+
id: r,
|
|
163
|
+
...n,
|
|
164
|
+
children: a && e === void 0 ? /* @__PURE__ */ m(i, { inlineSize: "8em" }) : e,
|
|
165
|
+
"data-part": "label"
|
|
166
|
+
});
|
|
167
|
+
return t === void 0 ? /* @__PURE__ */ m("span", { ...o }) : t(o);
|
|
168
|
+
}
|
|
169
|
+
function k({ render: e, ...t }) {
|
|
170
|
+
let n = c({
|
|
171
|
+
...t,
|
|
172
|
+
"data-part": "status"
|
|
173
|
+
});
|
|
174
|
+
return e === void 0 ? /* @__PURE__ */ m("span", { ...n }) : e(n);
|
|
175
|
+
}
|
|
176
|
+
function A({ render: e, ...t }) {
|
|
177
|
+
let n = c({
|
|
178
|
+
...t,
|
|
179
|
+
"data-part": "action"
|
|
180
|
+
});
|
|
181
|
+
return e === void 0 ? /* @__PURE__ */ m("span", { ...n }) : e(n);
|
|
182
|
+
}
|
|
183
|
+
function j({ render: e, ...t }) {
|
|
184
|
+
let n = c({
|
|
185
|
+
...t,
|
|
186
|
+
"data-part": "figure"
|
|
187
|
+
});
|
|
188
|
+
return e === void 0 ? /* @__PURE__ */ m("div", { ...n }) : e(n);
|
|
189
|
+
}
|
|
190
|
+
function M({ render: e, ...t }) {
|
|
191
|
+
let n = c({
|
|
192
|
+
...t,
|
|
193
|
+
"data-part": "unit"
|
|
194
|
+
});
|
|
195
|
+
return e === void 0 ? /* @__PURE__ */ m("span", { ...n }) : e(n);
|
|
196
|
+
}
|
|
197
|
+
function N({ children: e, render: t, ...n }) {
|
|
198
|
+
let { loading: r, status: a } = y();
|
|
199
|
+
if (!r && a !== "ready") return null;
|
|
200
|
+
let o = c({
|
|
201
|
+
...n,
|
|
202
|
+
children: r ? /* @__PURE__ */ m(i, { inlineSize: "10em" }) : e,
|
|
203
|
+
"data-part": "comparison"
|
|
204
|
+
});
|
|
205
|
+
return t === void 0 ? /* @__PURE__ */ m("p", { ...o }) : t(o);
|
|
206
|
+
}
|
|
207
|
+
function P({ render: e, ...t }) {
|
|
208
|
+
let n = c({
|
|
209
|
+
...t,
|
|
210
|
+
"data-part": "period"
|
|
211
|
+
});
|
|
212
|
+
return e === void 0 ? /* @__PURE__ */ m("span", { ...n }) : e(n);
|
|
213
|
+
}
|
|
214
|
+
function F({ children: e, render: t, ...n }) {
|
|
215
|
+
let { loading: r, status: a } = y(), l = s();
|
|
216
|
+
if (!r && a !== "ready") return null;
|
|
217
|
+
let u = c({
|
|
218
|
+
...n,
|
|
219
|
+
children: r ? /* @__PURE__ */ m(i, { shape: "block" }) : /* @__PURE__ */ m(o, {
|
|
220
|
+
area: l.area ?? !0,
|
|
221
|
+
curve: l.curve ?? "monotone",
|
|
222
|
+
children: e
|
|
223
|
+
}),
|
|
224
|
+
"data-part": "trend"
|
|
225
|
+
});
|
|
226
|
+
return t === void 0 ? /* @__PURE__ */ m("div", { ...u }) : t(u);
|
|
227
|
+
}
|
|
228
|
+
function I({ render: e, ...t }) {
|
|
229
|
+
let { loading: n, status: r } = y();
|
|
230
|
+
if (n || r === "ready") return null;
|
|
231
|
+
let i = c({
|
|
232
|
+
...t,
|
|
233
|
+
"data-part": "message"
|
|
234
|
+
});
|
|
235
|
+
return e === void 0 ? /* @__PURE__ */ m("p", { ...i }) : e(i);
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/stat-card/stat-card-value.tsx
|
|
239
|
+
function L({ children: e, formatOptions: t, render: n, value: r, ...a }) {
|
|
240
|
+
let o = y(), s = t ?? o.formatOptions, l = f(() => typeof r == "number" ? new Intl.NumberFormat(o.locale, s).format(r) : r, [
|
|
241
|
+
r,
|
|
242
|
+
o.locale,
|
|
243
|
+
s
|
|
244
|
+
]), u = o.loading ? /* @__PURE__ */ m(i, { inlineSize: "5ch" }) : o.status === "ready" ? e ?? l : o.t("empty"), d = c({
|
|
245
|
+
...a,
|
|
246
|
+
children: u,
|
|
247
|
+
"data-part": "value"
|
|
248
|
+
});
|
|
249
|
+
return n === void 0 ? /* @__PURE__ */ m("span", { ...d }) : n(d);
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
export { b as _, D as a, P as c, M as d, E as f, x as g, C as h, j as i, k as l, w as m, A as n, O as o, T as p, N as r, I as s, L as t, F as u, y as v };
|
package/dist/stat-card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _ } from "./stat-card-
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _ } from "./stat-card-Dv9oJAbF.js";
|
|
2
2
|
export { f as StatCard, u as StatCardAction, p as StatCardComparison, l as StatCardDefaultsProvider, i as StatCardDelta, s as StatCardFigure, t as StatCardHeader, d as StatCardLabel, m as StatCardMessage, n as StatCardPeriod, c as StatCardStatus, g as StatCardTrend, r as StatCardUnit, h as StatCardValue, a as toneOf, e as trendOf, _ as useStatCard, o as useStatCardDefaults };
|