@slotted/react 0.1.0-beta.4 → 0.1.0-beta.6

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.
Files changed (185) hide show
  1. package/README.md +16 -1
  2. package/dist/{action-bar-OACchRZw.js → action-bar-ti3e6FK1.js} +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/{app-shell-CmYvnu_7.js → app-shell-nnSP44OO.js} +271 -267
  5. package/dist/app-shell.js +1 -1
  6. package/dist/bin/slotted-agent-docs.mjs +297 -0
  7. package/dist/{cascader-D1AhTyBL.js → cascader-Cn2Acpcv.js} +227 -210
  8. package/dist/cascader.js +1 -1
  9. package/dist/chart-04i6NZQA.js +968 -0
  10. package/dist/chart.js +1 -1
  11. package/dist/{checkbox-DfxFHZaU.js → checkbox-B4Sb1eXj.js} +3 -3
  12. package/dist/{checkbox-group-9sDgrV5Z.js → checkbox-group-LpGMuq9w.js} +2 -2
  13. package/dist/checkbox-group.js +1 -1
  14. package/dist/checkbox.js +1 -1
  15. package/dist/{code-block-CFHf8uTm.js → code-block-CTNiyt0U.js} +1 -1
  16. package/dist/code-block.js +1 -1
  17. package/dist/{color-picker-CwbWzCKg.js → color-picker-BcRCeISx.js} +4 -4
  18. package/dist/color-picker.js +1 -1
  19. package/dist/{column-manager-CTtizVhm.js → column-manager-BtkYLs5G.js} +4 -4
  20. package/dist/column-manager.js +1 -1
  21. package/dist/{combobox-BVMI9lg8.js → combobox-C1D5doWM.js} +227 -198
  22. package/dist/combobox.js +1 -1
  23. package/dist/{context-menu-BuST6W94.js → context-menu-B00UIBVC.js} +1 -1
  24. package/dist/context-menu.js +1 -1
  25. package/dist/{currency-field-DD9A5U3D.js → currency-field-Dti9JFu0.js} +1 -1
  26. package/dist/currency-field.js +1 -1
  27. package/dist/{dashboard-grid-CBMP_-JV.js → dashboard-grid-CoLKLvYL.js} +1 -1
  28. package/dist/dashboard-grid.js +1 -1
  29. package/dist/{data-grid-Eb-a4jg3.js → data-grid-DX95Y7mY.js} +18 -18
  30. package/dist/data-grid.js +1 -1
  31. package/dist/{data-list-oICmxGkA.js → data-list-CWYTPNm-.js} +2 -2
  32. package/dist/data-list.js +1 -1
  33. package/dist/{date-field-Hr-OCU-H.js → date-field-BxEpqAPg.js} +1 -1
  34. package/dist/date-field.js +1 -1
  35. package/dist/date-picker-DRk9SZp1.js +308 -0
  36. package/dist/date-picker.js +1 -1
  37. package/dist/date-range-picker-6Yz7avTS.js +483 -0
  38. package/dist/date-range-picker.js +1 -1
  39. package/dist/{datetime-field-B8TrmsDK.js → datetime-field-D2f9u6im.js} +1 -1
  40. package/dist/datetime-field.js +1 -1
  41. package/dist/datetime-picker-STqSWMkH.js +645 -0
  42. package/dist/datetime-picker.js +1 -1
  43. package/dist/datetime-range-picker-DQNQwr3K.js +1000 -0
  44. package/dist/datetime-range-picker.js +1 -1
  45. package/dist/{detail-panel-CW53lUjp.js → detail-panel-z6WGleP4.js} +1 -1
  46. package/dist/detail-panel.js +1 -1
  47. package/dist/docs/AGENTS.snippet.md +2 -0
  48. package/dist/docs/app-shell.examples.md +1 -1
  49. package/dist/docs/app-shell.json +4 -4
  50. package/dist/docs/app-shell.md +2 -2
  51. package/dist/docs/guidelines/README.md +2 -2
  52. package/dist/docs/guidelines/index.md +1 -1
  53. package/dist/docs/guidelines/own-elements.md +1 -1
  54. package/dist/docs/page-header.json +1 -0
  55. package/dist/docs/page-header.md +1 -1
  56. package/dist/docs/segmented-control.json +7 -11
  57. package/dist/docs/segmented-control.md +1 -1
  58. package/dist/docs/skills/build-own-element/SKILL.md +6 -6
  59. package/dist/docs/skills/compose-screen/SKILL.md +6 -6
  60. package/dist/docs/skills/review-screen/SKILL.md +6 -6
  61. package/dist/docs/skills/theme-app/SKILL.md +1 -1
  62. package/dist/docs/skills/waiting-states/SKILL.md +2 -2
  63. package/dist/docs/tabs.json +16 -3
  64. package/dist/docs/tabs.md +3 -2
  65. package/dist/{entity-picker-Dn1T7JCq.js → entity-picker-BdySwW8F.js} +274 -256
  66. package/dist/entity-picker.js +1 -1
  67. package/dist/{event-calendar-CnF3iIZD.js → event-calendar-CiphPXdV.js} +4 -4
  68. package/dist/event-calendar.js +1 -1
  69. package/dist/{field-NJaCxl2h.js → field-BxQFpOXS.js} +1 -1
  70. package/dist/{field-group-hAzVa2O9.js → field-group-DcN_hiZN.js} +1 -1
  71. package/dist/field-group.js +1 -1
  72. package/dist/field.js +1 -1
  73. package/dist/{filter-bar-CHyy1o--.js → filter-bar-C_dXljI_.js} +10 -10
  74. package/dist/filter-bar.js +1 -1
  75. package/dist/{hover-card-BJE5dtaQ.js → hover-card-DpVzwvDJ.js} +1 -1
  76. package/dist/hover-card.js +1 -1
  77. package/dist/{import-export-center-jF37b909.js → import-export-center-BQnMJz4g.js} +3 -3
  78. package/dist/import-export-center.js +1 -1
  79. package/dist/index.js +63 -63
  80. package/dist/{listbox-Dv856z9I.js → listbox-D0MJcAMm.js} +1 -1
  81. package/dist/listbox.js +1 -1
  82. package/dist/{markdown-CeG8mUbI.js → markdown-IiVoh6yi.js} +2 -2
  83. package/dist/markdown.js +1 -1
  84. package/dist/menu-parts-D6v_mz6O.js +809 -0
  85. package/dist/menu.js +1 -1
  86. package/dist/{menubar-b2CruimJ.js → menubar-DApIg1eR.js} +1 -1
  87. package/dist/menubar.js +1 -1
  88. package/dist/{multi-select-DQ5ds0fX.js → multi-select-B8z6ApgW.js} +286 -257
  89. package/dist/multi-select.js +1 -1
  90. package/dist/{notification-center-C1iWWl5Y.js → notification-center-CGEEHcRA.js} +2 -2
  91. package/dist/notification-center.js +1 -1
  92. package/dist/{number-field-BFIAmv-z.js → number-field-DXk1TAXA.js} +1 -1
  93. package/dist/number-field.js +1 -1
  94. package/dist/{otp-input-BNQhuKaT.js → otp-input-CI-kdNgx.js} +1 -1
  95. package/dist/otp-input.js +1 -1
  96. package/dist/{popover-Be7JWbGJ.js → popover-DEp8Bf3e.js} +186 -166
  97. package/dist/popover.js +1 -1
  98. package/dist/{prompt-composer-BxpdkTpZ.js → prompt-composer-DdcU3S3L.js} +1 -1
  99. package/dist/prompt-composer.js +1 -1
  100. package/dist/{radio-group-BaVIP9UH.js → radio-group-D8csBZ8Z.js} +2 -2
  101. package/dist/radio-group.js +1 -1
  102. package/dist/{rating-DYBQBzwB.js → rating-rI3b5zII.js} +1 -1
  103. package/dist/rating.js +1 -1
  104. package/dist/{saved-views-DlE_--Z9.js → saved-views-B3brBTD9.js} +4 -4
  105. package/dist/saved-views.js +1 -1
  106. package/dist/scroll-area-DQ_ansLu.js +112 -0
  107. package/dist/scroll-area.js +1 -1
  108. package/dist/{segmented-control-DmuOGiu6.js → segmented-control-C-PzkTtg.js} +2 -2
  109. package/dist/segmented-control.js +1 -1
  110. package/dist/{select-M7Io4UL9.js → select-BUylPwpb.js} +241 -203
  111. package/dist/select.js +1 -1
  112. package/dist/{side-navigation-CBLtCzuJ.js → side-navigation-Bm-BZma1.js} +156 -140
  113. package/dist/side-navigation.js +1 -1
  114. package/dist/{slider-DTes4HLF.js → slider-fp7kyg-6.js} +1 -1
  115. package/dist/slider.js +1 -1
  116. package/dist/{split-button-CPgHiy9G.js → split-button-DKRm0j5c.js} +1 -1
  117. package/dist/split-button.js +1 -1
  118. package/dist/styles.css +1 -1
  119. package/dist/{switch-DQzuIhPX.js → switch-aVoc4C2F.js} +1 -1
  120. package/dist/switch.js +1 -1
  121. package/dist/{table-U9eJYCuB.js → table-BYEvFr4P.js} +276 -275
  122. package/dist/table.js +1 -1
  123. package/dist/{tabs-BtHmjlnM.js → tabs-HWmvOKM4.js} +109 -102
  124. package/dist/tabs.js +1 -1
  125. package/dist/{tags-input-CcOkm0AW.js → tags-input-pbv6x1Pi.js} +1 -1
  126. package/dist/tags-input.js +1 -1
  127. package/dist/{text-field-DLfIZ0fk.js → text-field-CbQ6UCAP.js} +1 -1
  128. package/dist/text-field.js +1 -1
  129. package/dist/{textarea-CBJBJBi6.js → textarea-DJSfhrXH.js} +1 -1
  130. package/dist/textarea.js +1 -1
  131. package/dist/{time-field-DrhiCtUl.js → time-field-BI9n607q.js} +1 -1
  132. package/dist/time-field.js +1 -1
  133. package/dist/time-picker-D6SlQWNF.js +402 -0
  134. package/dist/time-picker.js +1 -1
  135. package/dist/time-range-picker-CcV3_45h.js +751 -0
  136. package/dist/time-range-picker.js +1 -1
  137. package/dist/{toggle-group-7iBR9Rn1.js → toggle-group-i7JPO8BM.js} +1 -1
  138. package/dist/toggle-group.js +1 -1
  139. package/dist/{toolbar-DDZpEftQ.js → toolbar-B9knmgHA.js} +1 -1
  140. package/dist/toolbar.js +1 -1
  141. package/dist/tooltip-CgjIROUy.js +410 -0
  142. package/dist/tooltip.js +1 -1
  143. package/dist/{top-navigation-e-tWMGNr.js → top-navigation-DiG2PF5W.js} +2 -2
  144. package/dist/top-navigation.js +1 -1
  145. package/dist/{transfer-CqZOTLMP.js → transfer--UOQVeKE.js} +5 -5
  146. package/dist/transfer.js +1 -1
  147. package/dist/types/app-shell/app-shell-parts.d.ts +6 -4
  148. package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
  149. package/dist/types/app-shell/app-shell.d.ts.map +1 -1
  150. package/dist/types/cascader/cascader.d.ts.map +1 -1
  151. package/dist/types/chart/chart.d.ts.map +1 -1
  152. package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
  153. package/dist/types/date-picker/date-picker.d.ts.map +1 -1
  154. package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
  155. package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
  156. package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
  157. package/dist/types/entity-picker/entity-picker-popup.d.ts.map +1 -1
  158. package/dist/types/menu/menu-parts.d.ts.map +1 -1
  159. package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
  160. package/dist/types/popover/popover-parts.d.ts.map +1 -1
  161. package/dist/types/scroll-area/scroll-area.d.ts.map +1 -1
  162. package/dist/types/select/select-parts.d.ts.map +1 -1
  163. package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
  164. package/dist/types/stat-card/stat-card.types.d.ts +2 -2
  165. package/dist/types/stat-card/stat-card.types.d.ts.map +1 -1
  166. package/dist/types/table/table-content.d.ts.map +1 -1
  167. package/dist/types/tabs/tabs-parts.d.ts +2 -4
  168. package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
  169. package/dist/types/tabs/tabs.d.ts.map +1 -1
  170. package/dist/types/time-picker/time-picker.d.ts.map +1 -1
  171. package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
  172. package/dist/types/tooltip/tooltip-parts.d.ts.map +1 -1
  173. package/dist/{upload-DjnlVR8y.js → upload-CLX5cURk.js} +1 -1
  174. package/dist/upload.js +1 -1
  175. package/package.json +10 -7
  176. package/dist/chart-O0ZhkzJe.js +0 -966
  177. package/dist/date-picker-D3-y2Jxw.js +0 -295
  178. package/dist/date-range-picker-y3b82Wmf.js +0 -471
  179. package/dist/datetime-picker-CIRHVLQp.js +0 -629
  180. package/dist/datetime-range-picker-DM-1m98z.js +0 -994
  181. package/dist/menu-parts-W58pVNUt.js +0 -786
  182. package/dist/scroll-area-BriwmvYY.js +0 -111
  183. package/dist/time-picker-CRQsMJbQ.js +0 -396
  184. package/dist/time-range-picker-DlZJsj1e.js +0 -745
  185. package/dist/tooltip-DbKTPe_i.js +0 -392
@@ -1,966 +0,0 @@
1
- import { n as e, t } from "./icon-T9Yt4tnm.js";
2
- import { n, r } from "./i18n-DpW8lqJ1.js";
3
- /* empty css */
4
- /* empty css */
5
- /* empty css */
6
- import { createControllable as i } from "@slotted/core/state";
7
- import { Fragment as a, createContext as o, createElement as s, useCallback as c, useContext as l, useEffect as u, useId as ee, useImperativeHandle as te, useLayoutEffect as ne, useMemo as re, useRef as d, useState as f } from "react";
8
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { collapseState as ie } from "@slotted/core/overflow";
10
- import { chartMessages as ae } from "@slotted/core/i18n";
11
- import { getLiveAnnouncer as oe } from "@slotted/core/live-announcer";
12
- import { FULL_ZOOM as se, TOOLTIP_DOCK_WIDTH as ce, cachedChartTheme as le, categoryIndex as ue, chartKeyAction as de, chartTable as fe, chartToCsv as pe, createChartModel as me, createLatestAnnouncer as he, defaultTrigger as ge, describeChart as _e, describePoint as ve, describeZoom as ye, firstPoint as be, isDrawn as g, isFullZoom as xe, observeChartTheme as Se, placeLayer as Ce, placeTooltip as we, readChartTheme as Te, sameTheme as Ee, seriesOf as _, toggleHidden as De, tooltipContext as Oe, trackModality as ke } from "@slotted/core/chart";
13
- import { mountChartEngine as Ae, preloadChartEngine as je } from "@slotted/core/chart-echarts";
14
- //#region src/chart/chart-defaults.tsx
15
- var Me = o({});
16
- function Ne() {
17
- return l(Me);
18
- }
19
- function Pe({ children: e, ...t }) {
20
- let n = Ne(), r = { ...n };
21
- for (let [e, n] of Object.entries(t)) n !== void 0 && (r[e] = n);
22
- return r.tooltip = {
23
- ...n.tooltip,
24
- ...t.tooltip
25
- }, /* @__PURE__ */ m(Me.Provider, {
26
- value: r,
27
- children: e
28
- });
29
- }
30
- //#endregion
31
- //#region src/chart/chart.tsx
32
- var Fe = Object.freeze([]), Ie = (e, t) => e === t || e !== null && t !== null && e.series === t.series && e.key === t.key, Le = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), Re = (e, t) => e.start === t.start && e.end === t.end, v = (e) => typeof e == "object" && !!e && Object.getPrototypeOf(e) === Object.prototype;
33
- function y(e, t) {
34
- if (Object.is(e, t)) return !0;
35
- if (Array.isArray(e)) return Array.isArray(t) && e.length === t.length && e.every((e, n) => y(e, t[n]));
36
- if (!v(e) || !v(t)) return !1;
37
- let n = Object.keys(e);
38
- return n.length === Object.keys(t).length && n.every((n) => Object.hasOwn(t, n) && y(e[n], t[n]));
39
- }
40
- function ze(e) {
41
- let t = d(e);
42
- return y(t.current, e) || (t.current = e), t.current;
43
- }
44
- function b(e, t, n, r) {
45
- let [a, o] = f(t), s = e === void 0 ? a : e, l = d({
46
- controlled: e,
47
- value: s,
48
- onChange: n
49
- });
50
- return l.current = {
51
- controlled: e,
52
- value: s,
53
- onChange: n
54
- }, [s, c((e, t, n) => {
55
- let a = l.current;
56
- i({
57
- controlled: a.controlled,
58
- initial: a.value,
59
- equals: r,
60
- onRequest: (e) => a.onChange?.(e.value, e)
61
- }).request(e, t, n) && o(e);
62
- }, [r])];
63
- }
64
- var Be = {
65
- crosshair: null,
66
- markers: [],
67
- tooltip: null,
68
- docked: !1
69
- };
70
- function Ve(e) {
71
- try {
72
- return e.matches(":focus-visible");
73
- } catch {
74
- return !1;
75
- }
76
- }
77
- function He(e) {
78
- for (let t = e.length - 1; t >= 0; --t) if (e[t] !== null) return t;
79
- return -1;
80
- }
81
- function Ue(e) {
82
- return e.type === "slot" ? { "data-slot": String(e.slot) } : e.type === "tone" ? { "data-tone": e.tone } : { "data-overflow": "" };
83
- }
84
- function We(e) {
85
- return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, `${t}px`]));
86
- }
87
- function Ge(e, t = !0) {
88
- let n = d(null), r = d(null), [i, a] = f(!1), o = (i) => {
89
- let o = i.newState === "open";
90
- a(o);
91
- let s = r.current, c = n.current;
92
- if (s && c) {
93
- if (o) {
94
- let n = s.getBoundingClientRect(), r = Ce({
95
- anchor: c.getBoundingClientRect(),
96
- size: {
97
- width: n.width,
98
- height: n.height
99
- },
100
- viewport: {
101
- width: window.innerWidth,
102
- height: window.innerHeight
103
- },
104
- align: e,
105
- dir: getComputedStyle(c).direction === "rtl" ? "rtl" : "ltr"
106
- });
107
- s.style.setProperty("--slotted-chart-x", `${r.x}px`), s.style.setProperty("--slotted-chart-y", `${r.y}px`), t && s.querySelector("button")?.focus();
108
- } else (s.contains(document.activeElement) || document.activeElement === document.body) && c.focus();
109
- }
110
- }, s = (e) => {
111
- let t = [...e.currentTarget.querySelectorAll("button")].filter((e) => !e.hidden), n = t.indexOf(document.activeElement), r = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0, i;
112
- r && (i = t[(n + r + t.length) % t.length]), e.key === "Home" && (i = t[0]), e.key === "End" && (i = t[t.length - 1]), i && (e.preventDefault(), i.focus());
113
- };
114
- return {
115
- open: i,
116
- close: () => r.current?.hidePopover?.(),
117
- controlProps: {
118
- ref: n,
119
- "aria-expanded": i,
120
- ...i ? { "data-open": "" } : {},
121
- onClick: () => r.current?.togglePopover?.()
122
- },
123
- layerProps: {
124
- ref: r,
125
- popover: "auto",
126
- onToggle: o,
127
- onKeyDown: s
128
- }
129
- };
130
- }
131
- function x() {
132
- let e = d(null), t = d(null);
133
- return u(() => {
134
- if (!e.current) return;
135
- let n = ke(e.current);
136
- return t.current = n, () => n.destroy();
137
- }, []), [e, () => t.current?.read() ?? "programmatic"];
138
- }
139
- function Ke(e, t) {
140
- typeof e == "function" ? e(t) : e && typeof e == "object" && (e.current = t);
141
- }
142
- function qe({ context: e, model: t, totalLabel: n, indicator: r }) {
143
- return /* @__PURE__ */ h(p, { children: [
144
- /* @__PURE__ */ m("div", {
145
- "data-part": "tooltip-title",
146
- children: e.title
147
- }),
148
- e.notes.map((e) => /* @__PURE__ */ m("div", {
149
- "data-part": "tooltip-note",
150
- children: e
151
- }, e)),
152
- e.items.map((n) => {
153
- let i = _(t, n.series), a = r === "line" || n.kind === "line" ? "line" : n.kind === "scatter" ? "scatter" : "bar";
154
- return /* @__PURE__ */ s("div", {
155
- "data-part": "tooltip-item",
156
- ...e.items.length > 1 && n.current ? { "data-current": "" } : {},
157
- ...Ue(n.color),
158
- key: `${n.series}-${n.label}`
159
- }, r === "none" ? null : /* @__PURE__ */ m("span", {
160
- "data-kind": a,
161
- "data-part": "tooltip-marker",
162
- ...i && i.stroke !== "solid" ? { "data-stroke": i.stroke } : {}
163
- }), /* @__PURE__ */ m("span", {
164
- "data-part": "tooltip-label",
165
- children: n.label
166
- }), /* @__PURE__ */ m("span", {
167
- "data-part": "tooltip-value",
168
- children: n.share ? `${n.share} · ${n.formatted}` : n.formatted
169
- }));
170
- }),
171
- e.total ? /* @__PURE__ */ h("div", {
172
- "data-part": "tooltip-total",
173
- children: [/* @__PURE__ */ m("span", { children: n }), /* @__PURE__ */ m("span", {
174
- "data-part": "tooltip-value",
175
- children: e.total.formatted
176
- })]
177
- }) : null
178
- ] });
179
- }
180
- function Je(i) {
181
- let { data: o, series: c, x: l, y: Ce, orientation: ke, stackMode: je, annotations: Me, recordKey: Pe, locale: v, title: y, description: x, help: Je, actions: C, messages: et, size: tt, variant: nt, palette: rt, toolbar: it, grid: at, texture: ot, renderer: st, sampling: ct, animate: lt, legend: ut, legendInteractive: dt, legendValues: ft, legendOverflow: pt, trigger: mt, tooltip: ht, zoomable: w, selectable: gt, loading: _t, error: vt, onRetry: yt, hidden: bt, defaultHidden: xt, onHiddenChange: St, activePoint: Ct, defaultActivePoint: wt, onActivePointChange: Tt, selection: Et, defaultSelection: Dt, onSelectionChange: Ot, zoom: kt, defaultZoom: At, onZoomChange: jt, tableOpen: Mt, defaultTableOpen: Nt, onTableOpenChange: Pt, fullscreen: Ft, defaultFullscreen: It, onFullscreenChange: Lt, renderTooltip: Rt, renderLegendItem: zt, renderCenter: Bt, renderEmpty: Vt, renderError: Ht, render: Ut, extendOption: Wt, handleRef: Gt, ref: Kt, ...qt } = i, T = Ne(), E = ee(), D = r(ae, et), Jt = n(), O = {
182
- size: tt ?? T.size ?? "md",
183
- variant: nt ?? T.variant ?? "plain",
184
- palette: rt ?? T.palette ?? "categorical",
185
- toolbar: it ?? T.toolbar ?? "visible",
186
- renderer: st ?? T.renderer ?? "auto",
187
- grid: at ?? T.grid,
188
- legendOverflow: pt ?? T.legendOverflow ?? "collapse",
189
- animate: lt ?? T.animate ?? !0,
190
- tooltip: {
191
- ...T.tooltip,
192
- ...ht
193
- }
194
- }, [Yt, Xt] = b(bt, xt ?? Fe, St, Le), [k, A] = b(Ct, wt ?? null, Tt, Ie), [j, Zt] = b(Et, Dt ?? null, Ot, Ie), [M, N] = b(kt, At ?? se, jt, Re), [P, Qt] = b(Mt, Nt ?? !1, Pt, Object.is), [F, $t] = b(Ft, It ?? !1, Lt, Object.is), en = ze(c), tn = ze(l), nn = ze(Ce), rn = ze(Me), an = re(() => ({
195
- data: o,
196
- series: en,
197
- x: tn,
198
- y: nn,
199
- orientation: ke,
200
- stackMode: je,
201
- annotations: rn,
202
- recordKey: Pe,
203
- locale: v ?? Jt
204
- }), [
205
- o,
206
- en,
207
- tn,
208
- nn,
209
- ke,
210
- je,
211
- rn,
212
- Pe,
213
- v,
214
- Jt
215
- ]), on = re(() => {
216
- try {
217
- return {
218
- model: me(an, { hidden: Yt }),
219
- failure: null
220
- };
221
- } catch (e) {
222
- return {
223
- model: null,
224
- failure: e
225
- };
226
- }
227
- }, [an, Yt]), I = on.model, [sn, cn] = f(null), L = !!vt || on.failure !== null || sn !== null, R = !!_t, z = !(!I || R || L || I.empty), B = !(!I || R || L || I.empty === "no-data"), V = I ? mt ?? ge(I) : "none", H = d(null), U = d(null), ln = d(null), un = d(null), dn = d(null), W = d(null), [fn, pn] = f(null), [G, mn] = f(Be), K = re(() => he((e) => oe().announce(e)), []), hn = (e) => oe().announce(e);
228
- u(() => {
229
- let e = U.current;
230
- if (!e) return;
231
- let t = e.ownerDocument.defaultView, n = (e) => pn((t) => Ee(t, e) ? t : e), r = () => n(Te(e)), i = le(e), a = 0;
232
- i ? n(i) : t && (a = t.requestAnimationFrame(() => {
233
- a = 0, r();
234
- }));
235
- let o = Se(e, r);
236
- return () => {
237
- o(), a && t?.cancelAnimationFrame(a);
238
- };
239
- }, [
240
- O.palette,
241
- O.variant,
242
- F
243
- ]);
244
- let q = d({
245
- onPointer: () => {},
246
- onPress: () => {},
247
- onZoom: () => {},
248
- onRender: () => {}
249
- });
250
- u(() => {
251
- let e = ln.current;
252
- if (!e) return;
253
- let t = Ae(e, {
254
- onPointer: (e, t) => q.current.onPointer(e, t),
255
- onPress: (e, t) => q.current.onPress(e, t),
256
- onZoom: (e, t) => q.current.onZoom(e, t),
257
- onRender: () => q.current.onRender(),
258
- onError: (e) => cn(e)
259
- });
260
- return W.current = t, () => {
261
- t.dispose(), W.current = null;
262
- };
263
- }, []), u(() => {
264
- W.current && fn && I && z && W.current.update({
265
- model: I,
266
- theme: fn,
267
- selection: j,
268
- zoom: M,
269
- zoomable: !!w,
270
- grid: O.grid,
271
- texture: !!ot,
272
- renderer: O.renderer,
273
- sampling: ct,
274
- trigger: V,
275
- animate: O.animate,
276
- extendOption: Wt
277
- });
278
- }, [
279
- I,
280
- fn,
281
- z,
282
- j,
283
- M,
284
- w,
285
- O.grid,
286
- ot,
287
- O.renderer,
288
- ct,
289
- V,
290
- O.animate,
291
- Wt
292
- ]);
293
- let gn = () => {
294
- let e = W.current, t = U.current;
295
- if (!e || !t || !I || !z || P) {
296
- mn(Be);
297
- return;
298
- }
299
- let n = [];
300
- if (j && g(I, j) && I.shape === "cartesian") {
301
- let t = _(I, j.series), r = e.locate(j);
302
- t && t.kind !== "bar" && r && n.push({
303
- key: `selected-${t.id}`,
304
- color: t.color,
305
- at: r,
306
- selected: !0,
307
- current: !1
308
- });
309
- }
310
- I.shape === "pie" && e.emphasize(k && g(I, k) ? k.key : null);
311
- let r = k && g(I, k) ? e.locate(k) : null;
312
- if (!k || !r) {
313
- mn({
314
- crosshair: null,
315
- markers: n,
316
- tooltip: null,
317
- docked: !1
318
- });
319
- return;
320
- }
321
- let i = I.series.some((e) => e.visible && e.kind === "bar"), a = I.shape === "cartesian" && V === "axis" ? {
322
- ...r,
323
- isBand: i && I.xType === "category"
324
- } : null;
325
- if (I.shape === "cartesian") {
326
- let t = ue(I, k.key), r = V === "axis" ? I.series.filter((e) => e.visible && e.kind !== "bar" && e.values[t] !== null) : [_(I, k.series)].filter((e) => !!(e && e.kind !== "bar"));
327
- for (let t of r) {
328
- let r = e.locate({
329
- series: t.id,
330
- key: k.key
331
- });
332
- r && n.push({
333
- key: t.id,
334
- color: t.color,
335
- at: r,
336
- selected: !1,
337
- current: t.id === k.series
338
- });
339
- }
340
- }
341
- let o = V === "none" ? null : Oe(I, k, {
342
- trigger: V,
343
- sort: O.tooltip.sort,
344
- total: O.tooltip.total
345
- });
346
- mn({
347
- crosshair: a,
348
- markers: n,
349
- tooltip: o,
350
- docked: t.clientWidth < ce
351
- });
352
- };
353
- ne(() => {
354
- gn();
355
- }, [
356
- k,
357
- j,
358
- I,
359
- z,
360
- P,
361
- V
362
- ]);
363
- let J = d(!1);
364
- ne(() => {
365
- let e = un.current, t = U.current;
366
- if (!e || !t) return;
367
- if (!G.tooltip || !k) {
368
- J.current = !1;
369
- return;
370
- }
371
- let n = W.current?.locate(k);
372
- if (!n) return;
373
- J.current || (e.style.transition = "none");
374
- let r = we({
375
- anchor: {
376
- x: n.x,
377
- y: n.y
378
- },
379
- size: {
380
- width: e.offsetWidth,
381
- height: e.offsetHeight
382
- },
383
- bounds: {
384
- width: t.clientWidth,
385
- height: t.clientHeight
386
- },
387
- dir: H.current && getComputedStyle(H.current).direction === "rtl" ? "rtl" : "ltr"
388
- });
389
- e.style.setProperty("--slotted-chart-x", `${r.x}px`), e.style.setProperty("--slotted-chart-y", `${r.y}px`), J.current || requestAnimationFrame(() => e.style.transition = ""), J.current = !0;
390
- }, [G, k]), q.current = {
391
- onPointer: (e, t) => {
392
- e ? A(e, "pointer", t) : document.activeElement !== U.current && A(null, "pointer", t);
393
- },
394
- onPress: (e, t) => {
395
- gt && e && Zt(Ie(j, e) ? null : e, "pointer", t);
396
- },
397
- onZoom: (e, t) => N(e, "pointer", t),
398
- onRender: () => gn()
399
- };
400
- let _n = (e) => {
401
- if (!I || !z || P) return;
402
- let t = de(I, {
403
- active: k,
404
- selection: j,
405
- zoom: M,
406
- zoomable: !!w,
407
- selectable: !!gt
408
- }, e.key);
409
- if (t !== null) {
410
- e.preventDefault();
411
- for (let n of t) n.type === "active" ? (A(n.point, n.reason, e.nativeEvent), n.point ? K.say(ve(I, n.point, j, D)) : K.cancel()) : n.type === "select" ? (Zt(n.point, "keyboard", e.nativeEvent), n.point && K.say(ve(I, n.point, n.point, D))) : (N(n.zoom, n.reason, e.nativeEvent), hn(ye(I, n.zoom, D)));
412
- }
413
- }, vn = (e) => {
414
- if (!I || !z || P || k || !Ve(e.currentTarget)) return;
415
- let t = be(I);
416
- t && (A(t, "keyboard", e.nativeEvent), K.say(ve(I, t, j, D)));
417
- }, yn = (e, t) => {
418
- let n = !F;
419
- $t(n, e, t);
420
- let r = H.current;
421
- r && (n && Ft === void 0 && document.fullscreenEnabled && e !== "programmatic" && r.requestFullscreen?.().catch(() => {}), !n && document.fullscreenElement === r && document.exitFullscreen().catch(() => {}));
422
- };
423
- u(() => {
424
- let e = H.current;
425
- if (!e) return;
426
- let t = !1, n = () => {
427
- document.fullscreenElement === e ? t = !0 : t && (t = !1, bn.current(!1, "escape"));
428
- };
429
- return document.addEventListener("fullscreenchange", n), () => document.removeEventListener("fullscreenchange", n);
430
- }, []);
431
- let bn = d($t);
432
- bn.current = $t, u(() => {
433
- let e = H.current;
434
- !F && e && document.fullscreenElement === e && document.exitFullscreen().catch(() => {});
435
- }, [F]);
436
- let xn = (e) => {
437
- qt.onKeyDown?.(e), !e.defaultPrevented && e.key === "Escape" && F && (e.preventDefault(), yn("escape", e.nativeEvent));
438
- }, [Y, Sn] = f([]), Cn = d(/* @__PURE__ */ new Map()), [wn, Tn] = f(null), En = dt ?? !0, X = I?.legend ?? [], Dn = () => {
439
- let e = dn.current;
440
- if (!e || !I) return;
441
- if (O.legendOverflow === "wrap") {
442
- Sn((e) => e.length ? [] : e);
443
- return;
444
- }
445
- let t = [...e.querySelectorAll(":scope > [data-part=\"legend-item\"]")];
446
- for (let e of t) e.hidden || Cn.current.set(e.dataset.key ?? "", e.getBoundingClientRect().width);
447
- let n = Number.parseFloat(getComputedStyle(e).columnGap) || 0, r = e.querySelector(":scope > [data-part=\"legend-more\"]"), i = r && !r.hidden ? r.getBoundingClientRect().width : 40, a = ie({
448
- units: X.map((e) => ({
449
- size: Cn.current.get(e.key) ?? 0,
450
- collapsible: !0
451
- })),
452
- available: e.clientWidth,
453
- gap: n,
454
- triggerSize: i
455
- });
456
- Sn((e) => e.length === a.collapsed.length && e.every((e, t) => e === a.collapsed[t]) ? e : a.collapsed);
457
- };
458
- ne(() => {
459
- Dn();
460
- }, [
461
- X,
462
- O.legendOverflow,
463
- ft,
464
- k
465
- ]), u(() => {
466
- let e = dn.current;
467
- if (!e || typeof ResizeObserver > "u") return;
468
- let t = new ResizeObserver(() => On.current());
469
- return t.observe(e), () => t.disconnect();
470
- }, []);
471
- let On = d(Dn);
472
- On.current = Dn;
473
- let kn = (e, t, n, r) => {
474
- let i = X.map((e) => e.key), a = De(i, Yt, e.key, t);
475
- Tn(e.key), Xt(a, n, r), hn(D(a.includes(e.key) ? "hidden" : "shown", { series: e.label }));
476
- }, Z = k && I && g(I, k) ? k.key : null, An = (e) => {
477
- if (!I) return "";
478
- let t = I.shape === "pie" ? I.series[0] : _(I, e.key);
479
- if (!t) return "";
480
- let n = I.shape === "pie" ? ue(I, e.key) : Z ? ue(I, Z) : He(t.values), r = n >= 0 ? t.values[n] : null;
481
- return r == null ? "" : t.format(r);
482
- }, jn = Ge("start"), Mn = X.filter((e, t) => !Y.includes(t)).map((e) => e.key), Nn = wn && Mn.includes(wn) ? wn : Mn[0] ?? null, Pn = (e, t, n) => {
483
- let r = I?.shape === "pie" ? I.series[0] : I ? _(I, e.key) : void 0, i = I?.shape === "pie" ? e.key === Z : k?.series === e.key && Z !== null, o = !n && Y.includes(t), c = /* @__PURE__ */ h(p, { children: [
484
- /* @__PURE__ */ m("span", {
485
- "data-kind": e.kind === "area" || e.kind === "bar" || e.kind === "pie" ? "bar" : e.kind,
486
- "data-part": "legend-marker",
487
- ...r && r.stroke !== "solid" ? { "data-stroke": r.stroke } : {}
488
- }),
489
- /* @__PURE__ */ m("span", {
490
- "data-part": "legend-label",
491
- title: e.label,
492
- children: e.label
493
- }),
494
- ft ? /* @__PURE__ */ m("span", {
495
- "data-part": "legend-value",
496
- children: An(e)
497
- }) : null
498
- ] }), l = {
499
- "data-part": "legend-item",
500
- "data-key": e.key,
501
- ...Ue(e.color),
502
- ...i ? { "data-current": "" } : {},
503
- hidden: o,
504
- onPointerEnter: () => e.visible && W.current?.emphasize(e.key),
505
- onPointerLeave: () => W.current?.emphasize(null)
506
- }, u = En ? /* @__PURE__ */ s(Ye, {
507
- ...l,
508
- entry: e,
509
- focused: n || Nn === e.key,
510
- key: `${n ? "layer" : "row"}-${e.key}`,
511
- onActivate: (t, n, r) => kn(e, t, n, r),
512
- onFocusEntry: () => {
513
- n || Tn(e.key), e.visible && W.current?.emphasize(e.key);
514
- },
515
- onBlurEntry: () => W.current?.emphasize(null)
516
- }, c) : /* @__PURE__ */ s("span", {
517
- ...l,
518
- key: `${n ? "layer" : "row"}-${e.key}`,
519
- role: "listitem"
520
- }, c);
521
- return zt ? /* @__PURE__ */ m(a, { children: zt(e, l, u) }, `${n ? "layer" : "row"}-${e.key}`) : u;
522
- }, Fn = (e) => {
523
- let t = e.target;
524
- if (t.closest("[data-part=\"menu\"]")) return;
525
- let n = [...e.currentTarget.querySelectorAll(":scope > button:not([hidden])")], r = n.indexOf(t);
526
- if (r === -1) return;
527
- let i = H.current ? getComputedStyle(H.current).direction === "rtl" : !1, a = e.key === "ArrowRight" ? i ? -1 : 1 : e.key === "ArrowLeft" ? i ? 1 : -1 : 0, o;
528
- a && (o = n[(r + a + n.length) % n.length]), e.key === "Home" && (o = n[0]), e.key === "End" && (o = n[n.length - 1]), o && (e.preventDefault(), Tn(o.dataset.key ?? "__more"), o.focus());
529
- }, Q = Ge("end"), In = Ge("start", !1), Ln = (e, t) => {
530
- let n = document.createElement("a");
531
- n.href = t, n.download = e, document.body.append(n), n.click(), n.remove();
532
- }, Rn = typeof y == "string" ? y : "chart";
533
- te(Gt, () => ({
534
- focus: () => U.current?.focus(),
535
- resetZoom: () => N(se, "programmatic"),
536
- toDataURL: () => W.current?.toDataURL() ?? null,
537
- toCsv: () => I ? pe(I, D) : ""
538
- }), [
539
- I,
540
- D,
541
- N
542
- ]);
543
- let zn = R ? D("loading") : L ? D("error") : I ? _e(I, D) : "", Bn = `${E}-title`, Vn = `${E}-description`, Hn = `${E}-summary`, Un = an.series.some((e) => e.kind === "pie") ? "pie" : an.series.every((e) => e.kind === "line" || e.kind === "area") ? "line" : "bar", $ = P && B && I ? fe(I, D) : null, Wn = () => {
544
- cn(null), yt?.();
545
- }, Gn = y !== void 0 || x !== void 0 || C !== void 0 || O.toolbar !== "none" ? /* @__PURE__ */ h("figcaption", {
546
- "data-part": "header",
547
- children: [
548
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("div", { children: [y === void 0 ? null : /* @__PURE__ */ m("span", {
549
- "data-part": "title",
550
- id: Bn,
551
- children: y
552
- }), Je === void 0 ? null : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
553
- ...In.controlProps,
554
- "aria-controls": `${E}-help`,
555
- "aria-label": D("help"),
556
- "data-part": "help",
557
- type: "button",
558
- children: /* @__PURE__ */ m(t, { children: /* @__PURE__ */ m(e, { name: "circle-info" }) })
559
- }), /* @__PURE__ */ m("div", {
560
- ...In.layerProps,
561
- "data-part": "help-content",
562
- id: `${E}-help`,
563
- role: "note",
564
- children: Je
565
- })] })] }), x === void 0 ? null : /* @__PURE__ */ m("span", {
566
- "data-part": "description",
567
- id: Vn,
568
- children: x
569
- })] }),
570
- C === void 0 ? null : /* @__PURE__ */ m("div", {
571
- "data-part": "actions",
572
- children: C
573
- }),
574
- O.toolbar === "none" ? null : /* @__PURE__ */ h("div", {
575
- "aria-hidden": !B || void 0,
576
- "aria-label": B ? D("toolbar") : void 0,
577
- "data-part": "toolbar",
578
- "data-waiting": B ? void 0 : "",
579
- inert: !B,
580
- role: B ? "toolbar" : void 0,
581
- children: [
582
- I && w && !xe(M) && I.shape === "cartesian" ? /* @__PURE__ */ m(Xe, {
583
- label: D("resetZoom"),
584
- onPress: (e, t) => {
585
- N(se, "clear", t), hn(ye(I, se, D)), U.current?.focus();
586
- },
587
- glyph: "rotate-ccw",
588
- part: "zoom-reset"
589
- }) : null,
590
- /* @__PURE__ */ m(Xe, {
591
- label: D("tableView"),
592
- onPress: (e, t) => Qt(!P, e, t),
593
- glyph: "file-spreadsheet",
594
- part: "view-toggle",
595
- pressed: P
596
- }),
597
- /* @__PURE__ */ m(Xe, {
598
- label: D(F ? "exitFullscreen" : "fullscreen"),
599
- glyph: F ? "minimize" : "maximize",
600
- onPress: (e, t) => yn(e, t),
601
- part: "fullscreen-toggle"
602
- }),
603
- /* @__PURE__ */ m("button", {
604
- ...Q.controlProps,
605
- "aria-haspopup": "menu",
606
- "aria-label": D("more"),
607
- "data-part": "menu-trigger",
608
- title: D("more"),
609
- type: "button",
610
- children: /* @__PURE__ */ m(t, { children: /* @__PURE__ */ m(e, { name: "ellipsis" }) })
611
- }),
612
- /* @__PURE__ */ h("div", {
613
- ...Q.layerProps,
614
- "aria-label": D("more"),
615
- "data-part": "menu",
616
- role: "menu",
617
- children: [
618
- /* @__PURE__ */ m(S, {
619
- action: "view",
620
- label: D("tableView"),
621
- onPress: (e, t) => {
622
- Q.close(), Qt(!P, e, t);
623
- }
624
- }),
625
- /* @__PURE__ */ m(S, {
626
- action: "fullscreen",
627
- label: D(F ? "exitFullscreen" : "fullscreen"),
628
- onPress: (e, t) => {
629
- Q.close(), yn(e, t);
630
- }
631
- }),
632
- /* @__PURE__ */ m(S, {
633
- action: "csv",
634
- label: D("downloadCsv"),
635
- onPress: () => {
636
- Q.close(), I && Ln(`${Rn}.csv`, `data:text/csv;charset=utf-8,${encodeURIComponent(pe(I, D))}`);
637
- }
638
- }),
639
- /* @__PURE__ */ m(S, {
640
- action: "image",
641
- label: D("downloadImage"),
642
- onPress: () => {
643
- Q.close();
644
- let e = W.current?.toDataURL();
645
- e && Ln(`${Rn}.${e.startsWith("data:image/svg") ? "svg" : "png"}`, e);
646
- }
647
- })
648
- ]
649
- })
650
- ]
651
- })
652
- ]
653
- }) : null, Kn = ut === !1 ? null : /* @__PURE__ */ m("div", {
654
- "aria-label": R && (!I || I.shape === "pie") ? void 0 : D("legend"),
655
- "data-part": "legend",
656
- onKeyDown: Fn,
657
- ref: dn,
658
- role: R && (!I || I.shape === "pie") ? void 0 : En ? "toolbar" : "list",
659
- children: R && (!I || I.shape === "pie") ? /* @__PURE__ */ h(p, { children: [
660
- /* @__PURE__ */ m(Ze, {}),
661
- /* @__PURE__ */ m(Ze, {}),
662
- /* @__PURE__ */ m(Ze, {})
663
- ] }) : /* @__PURE__ */ h(p, { children: [
664
- X.map((e, t) => Pn(e, t, !1)),
665
- /* @__PURE__ */ m("button", {
666
- ...jn.controlProps,
667
- "aria-haspopup": "true",
668
- "aria-label": D("legendMore", { series: new Intl.ListFormat(v ?? Jt, { type: "unit" }).format(Y.map((e) => X[e]?.label ?? "")) }),
669
- "data-part": "legend-more",
670
- hidden: Y.length === 0,
671
- tabIndex: Nn === null ? 0 : -1,
672
- type: "button",
673
- children: D("moreSeries", { count: Y.length })
674
- }),
675
- /* @__PURE__ */ m("div", {
676
- ...jn.layerProps,
677
- "aria-label": D("legend"),
678
- "data-part": "menu",
679
- role: "group",
680
- children: Y.map((e) => {
681
- let t = X[e];
682
- return t ? Pn(t, e, !0) : null;
683
- })
684
- })
685
- ] })
686
- }), qn = {
687
- ...qt,
688
- "data-ui": "chart",
689
- "data-part": "root",
690
- "data-size": O.size,
691
- "data-variant": O.variant,
692
- "data-palette": O.palette,
693
- "data-toolbar": O.toolbar,
694
- "data-legend-overflow": O.legendOverflow,
695
- ...R ? { "data-loading": "" } : {},
696
- ...F ? { "data-fullscreen": "" } : {},
697
- onKeyDown: xn,
698
- ref: (e) => {
699
- H.current = e, Ke(Kt, e);
700
- },
701
- children: /* @__PURE__ */ h(p, { children: [
702
- Gn,
703
- Kn,
704
- /* @__PURE__ */ h("div", {
705
- "aria-busy": R || void 0,
706
- "aria-describedby": x === void 0 ? Hn : `${Vn} ${Hn}`,
707
- "aria-label": y === void 0 ? qt["aria-label"] ?? D("roledescription") : void 0,
708
- "aria-labelledby": y === void 0 ? void 0 : Bn,
709
- "aria-roledescription": D("roledescription"),
710
- "data-part": "plot",
711
- onBlur: (e) => A(null, "blur", e.nativeEvent),
712
- onFocus: vn,
713
- onKeyDown: _n,
714
- ref: U,
715
- role: "group",
716
- tabIndex: 0,
717
- children: [
718
- /* @__PURE__ */ m("div", {
719
- "data-part": "crosshair",
720
- hidden: !G.crosshair,
721
- ...G.crosshair?.isBand ? { "data-band": "" } : {},
722
- "data-orientation": I?.orientation ?? "vertical",
723
- style: G.crosshair ? We({
724
- "--slotted-chart-x": G.crosshair.x,
725
- "--slotted-chart-y": G.crosshair.y,
726
- "--slotted-chart-band-start": G.crosshair.band.start,
727
- "--slotted-chart-band-size": G.crosshair.band.size,
728
- "--slotted-chart-frame-start": G.crosshair.frame.start,
729
- "--slotted-chart-frame-size": G.crosshair.frame.size
730
- }) : void 0
731
- }),
732
- /* @__PURE__ */ m("div", {
733
- "aria-hidden": "true",
734
- "data-part": "canvas",
735
- hidden: !z,
736
- ref: ln
737
- }),
738
- G.markers.map((e) => /* @__PURE__ */ m("div", {
739
- "aria-hidden": "true",
740
- "data-part": "marker",
741
- ...Ue(e.color),
742
- ...e.selected ? { "data-selected": "" } : {},
743
- ...e.current ? { "data-current": "" } : {},
744
- style: We({
745
- "--slotted-chart-x": e.at.x,
746
- "--slotted-chart-y": e.at.y
747
- })
748
- }, e.key)),
749
- /* @__PURE__ */ m("div", {
750
- "aria-hidden": "true",
751
- "data-part": "tooltip",
752
- ref: un,
753
- ...G.tooltip ? { "data-open": "" } : {},
754
- ...G.docked ? { "data-docked": "" } : {},
755
- children: G.tooltip && I ? Rt?.(G.tooltip, I) ?? /* @__PURE__ */ m(qe, {
756
- context: G.tooltip,
757
- indicator: O.tooltip.indicator,
758
- model: I,
759
- totalLabel: D("total")
760
- }) : null
761
- }),
762
- z && I?.shape === "pie" && (I.series[0]?.innerRadius ?? 0) > 0 ? /* @__PURE__ */ m("div", {
763
- "aria-hidden": "true",
764
- "data-part": "center",
765
- children: Bt?.(I) ?? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
766
- "data-part": "center-value",
767
- children: I.series[0].format(I.total)
768
- }), /* @__PURE__ */ m("span", {
769
- "data-part": "center-label",
770
- children: D("total")
771
- })] })
772
- }) : null,
773
- $ ? /* @__PURE__ */ m("div", {
774
- "aria-labelledby": y === void 0 ? void 0 : Bn,
775
- "data-part": "table-region",
776
- role: "region",
777
- tabIndex: 0,
778
- children: /* @__PURE__ */ h("table", {
779
- "data-part": "table",
780
- children: [
781
- /* @__PURE__ */ m("caption", { children: $.omitted ? typeof y == "string" ? D("truncatedCaption", {
782
- title: y,
783
- shown: $.rows.length,
784
- count: $.rows.length + $.omitted
785
- }) : D("truncated", {
786
- shown: $.rows.length,
787
- count: $.rows.length + $.omitted
788
- }) : typeof y == "string" ? y : null }),
789
- /* @__PURE__ */ m("thead", { children: /* @__PURE__ */ m("tr", { children: $.columns.map((e, t) => /* @__PURE__ */ s("th", {
790
- ...t > 0 ? { "data-numeric": "" } : {},
791
- key: e.key,
792
- scope: "col"
793
- }, e.label)) }) }),
794
- /* @__PURE__ */ m("tbody", { children: $.rows.map((e) => /* @__PURE__ */ s("tr", {
795
- ...e.key === Z ? { "data-current": "" } : {},
796
- key: e.key
797
- }, e.cells.map((e, t) => t === 0 ? /* @__PURE__ */ m("th", {
798
- scope: "row",
799
- children: e.text
800
- }, "category") : /* @__PURE__ */ m("td", {
801
- "data-numeric": "",
802
- children: e.text
803
- }, t)))) })
804
- ]
805
- })
806
- }) : null,
807
- R ? /* @__PURE__ */ m(Qe, { kind: Un }) : null,
808
- !R && L ? /* @__PURE__ */ m("div", {
809
- "data-part": "error",
810
- children: Ht?.() ?? /* @__PURE__ */ m($e, {
811
- action: yt || sn ? D("retry") : void 0,
812
- onAction: Wn,
813
- status: "error",
814
- text: D("error")
815
- })
816
- }) : null,
817
- !R && !L && I?.empty ? /* @__PURE__ */ m("div", {
818
- "data-part": "empty",
819
- children: Vt?.(I.empty) ?? /* @__PURE__ */ m($e, {
820
- action: I.empty === "all-hidden" ? D("showAll") : void 0,
821
- onAction: (e) => Xt(Fe, "pointer", e),
822
- status: I.empty === "all-hidden" ? "no-results" : "empty",
823
- text: I.empty === "all-hidden" ? D("allHidden") : D("noData")
824
- })
825
- }) : null,
826
- /* @__PURE__ */ m("p", {
827
- "data-part": "summary",
828
- id: Hn,
829
- children: zn
830
- })
831
- ]
832
- })
833
- ] })
834
- };
835
- return Ut ? Ut(qn) : /* @__PURE__ */ m("figure", { ...qn });
836
- }
837
- function Ye({ children: e, entry: t, focused: n, onActivate: r, onFocusEntry: i, onBlurEntry: a, ...o }) {
838
- let [s, c] = x();
839
- return /* @__PURE__ */ m("button", {
840
- ...o,
841
- "aria-pressed": t.visible,
842
- ...t.visible ? { "data-pressed": "" } : {},
843
- onBlur: a,
844
- onClick: (e) => r(e.shiftKey ? "isolate" : "toggle", c(), e.nativeEvent),
845
- onFocus: i,
846
- onKeyDown: (e) => {
847
- e.key === "Enter" && e.shiftKey && (e.preventDefault(), r("isolate", "keyboard", e.nativeEvent));
848
- },
849
- ref: s,
850
- tabIndex: n ? 0 : -1,
851
- type: "button",
852
- children: e
853
- });
854
- }
855
- function Xe({ glyph: n, label: r, onPress: i, part: a, pressed: o }) {
856
- let [s, c] = x();
857
- return /* @__PURE__ */ m("button", {
858
- "aria-label": r,
859
- ...o === void 0 ? {} : {
860
- "aria-pressed": o,
861
- ...o ? { "data-pressed": "" } : {}
862
- },
863
- "data-part": a,
864
- onClick: (e) => i(c(), e.nativeEvent),
865
- ref: s,
866
- title: r,
867
- type: "button",
868
- children: /* @__PURE__ */ m(t, { children: /* @__PURE__ */ m(e, { name: n }) })
869
- });
870
- }
871
- function S({ action: e, label: t, onPress: n }) {
872
- let [r, i] = x();
873
- return /* @__PURE__ */ m("button", {
874
- "data-action": e,
875
- "data-part": "menu-item",
876
- onClick: (e) => n(i(), e.nativeEvent),
877
- ref: r,
878
- role: "menuitem",
879
- type: "button",
880
- children: t
881
- });
882
- }
883
- function C({ shape: e = "block" }) {
884
- return /* @__PURE__ */ m("span", {
885
- "aria-hidden": "true",
886
- "data-animation": "shimmer",
887
- "data-loading": "",
888
- "data-part": "root",
889
- "data-shape": e,
890
- "data-size": "md",
891
- "data-ui": "skeleton"
892
- });
893
- }
894
- function Ze() {
895
- return /* @__PURE__ */ m(C, {});
896
- }
897
- function Qe({ kind: e }) {
898
- let t = (e) => Array.from({ length: e }, (e, t) => /* @__PURE__ */ m(C, {}, t));
899
- return /* @__PURE__ */ m("div", {
900
- "aria-hidden": "true",
901
- "data-kind": e,
902
- "data-part": "skeleton",
903
- children: /* @__PURE__ */ m("div", {
904
- "data-animation": "shimmer",
905
- "data-loading": "",
906
- "data-part": "region",
907
- "data-ui": "skeleton",
908
- children: e === "pie" ? /* @__PURE__ */ m(C, { shape: "circle" }) : /* @__PURE__ */ h(p, { children: [
909
- /* @__PURE__ */ m("div", {
910
- "data-skeleton": "y",
911
- children: t(5)
912
- }),
913
- /* @__PURE__ */ m("div", {
914
- "data-skeleton": "marks",
915
- children: t(e === "bar" ? 7 : 2)
916
- }),
917
- /* @__PURE__ */ m("div", {
918
- "data-skeleton": "x",
919
- children: t(6)
920
- })
921
- ] })
922
- })
923
- });
924
- }
925
- function $e({ action: e, onAction: t, status: n, text: r }) {
926
- return /* @__PURE__ */ h("section", {
927
- "data-align": "center",
928
- "data-live": "polite",
929
- "data-part": "root",
930
- "data-reach": "section",
931
- "data-status": n,
932
- "data-ui": "result-state",
933
- children: [
934
- /* @__PURE__ */ m("div", {
935
- "aria-hidden": "true",
936
- "data-part": "media"
937
- }),
938
- /* @__PURE__ */ m("div", {
939
- "data-part": "content",
940
- role: "status",
941
- children: /* @__PURE__ */ m("div", {
942
- "data-part": "title",
943
- children: r
944
- })
945
- }),
946
- e ? /* @__PURE__ */ m("div", {
947
- "data-part": "actions",
948
- children: /* @__PURE__ */ m("button", {
949
- "data-part": "root",
950
- "data-size": "sm",
951
- "data-tone": "secondary",
952
- "data-ui": "button",
953
- "data-variant": "outline",
954
- onClick: (e) => t(e.nativeEvent),
955
- type: "button",
956
- children: /* @__PURE__ */ m("span", {
957
- "data-part": "label",
958
- children: e
959
- })
960
- })
961
- }) : null
962
- ]
963
- });
964
- }
965
- //#endregion
966
- export { Ne as a, Pe as i, Je as n, qe as r, je as t };