@dcs-tech/ui 0.7.0 → 0.8.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.
Files changed (38) hide show
  1. package/README.md +16 -0
  2. package/dist/{ChartImageMenu-C6MwKKjc.js → ChartImageMenu-AsfvmdTH.js} +60 -55
  3. package/dist/{ChartView-nS4f4EU_.js → ChartView-CW3m4Z_1.js} +1 -1
  4. package/dist/{SummaryChart-CVg6i2mx.js → SummaryChart-CxRjK_HU.js} +2 -2
  5. package/dist/{SummaryImage-OHJHjCqe.js → SummaryImage-DeYs2Jgj.js} +2 -2
  6. package/dist/{SummarySeeAll-BYrvXSJ6.js → SummarySeeAll-CrmROhBv.js} +5 -5
  7. package/dist/{columnValue-K98ElfJc.js → columnValue-DwUqueZ6.js} +1 -1
  8. package/dist/{exportContext-CJaIv8R-.js → exportContext-BKFnNQ0q.js} +1 -1
  9. package/dist/{exportEngine-S8JHzYbS.js → exportEngine-CZ22cX7a.js} +1 -1
  10. package/dist/{geometry-ChwYB45B.js → geometry-yZmKN662.js} +11 -2
  11. package/dist/index.js +6758 -6426
  12. package/dist/scrollArea-Dd2dNMV4.js +236 -0
  13. package/dist/style.css +1 -1
  14. package/dist/{summaryChartData-pNvzaEHp.js → summaryChartData-CARqGRUl.js} +1 -1
  15. package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  16. package/dist/types/components/DataTable/layout/useFillHeight.d.ts +1 -0
  17. package/dist/types/components/DataTable/rows/RowActions.d.ts +5 -2
  18. package/dist/types/components/DataTable/types.d.ts +1 -0
  19. package/dist/types/components/Dialog/dialogOpen.d.ts +7 -0
  20. package/dist/types/components/Dialog/index.d.ts +1 -0
  21. package/dist/types/components/Fields/Field.d.ts +1 -1
  22. package/dist/types/components/Fields/hooks/useFieldBlur.d.ts +1 -1
  23. package/dist/types/components/Popover/floatingPosition.d.ts +11 -1
  24. package/dist/types/components/Scroll/ScrollStrip.d.ts +4 -2
  25. package/dist/types/components/Sidebar/Sidebar.d.ts +12 -3
  26. package/dist/types/components/Sidebar/index.d.ts +1 -1
  27. package/dist/types/components/UIProvider/UILabelsContext.d.ts +9 -0
  28. package/dist/types/core/logic/index.d.ts +1 -0
  29. package/dist/types/core/logic/popover.logic.d.ts +2 -0
  30. package/dist/types/core/logic/standardSchema.logic.d.ts +9 -0
  31. package/dist/types/core/types/fields.types.d.ts +2 -0
  32. package/dist/types/core/types/index.d.ts +1 -0
  33. package/dist/types/core/types/standardSchema.types.d.ts +30 -0
  34. package/dist/types/core/types/suggest.types.d.ts +1 -0
  35. package/dist/types/core/types/tooltip.types.d.ts +2 -0
  36. package/dist/types/index.d.ts +5 -2
  37. package/package.json +5 -2
  38. package/dist/scrollArea-DAlVT5U7.js +0 -214
@@ -0,0 +1,236 @@
1
+ "use client";
2
+ import { Nn as e, wn as t } from "./geometry-yZmKN662.js";
3
+ import { n, t as r } from "./labels-CnqqTrne.js";
4
+ import { createContext as i, useCallback as ee, useContext as a, useEffect as o, useId as te, useMemo as s, useRef as c, useState as l } from "react";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
+ import { createPortal as ne } from "react-dom";
7
+ // src/components/Dialog/dialogOpen.tsx
8
+ var f = i(null), p = i(0), m = ({ children: e }) => {
9
+ let [t, n] = l(0), r = s(() => () => {
10
+ n((e) => e + 1);
11
+ let e = !1;
12
+ return () => {
13
+ e || (e = !0, n((e) => e - 1));
14
+ };
15
+ }, []);
16
+ return /* @__PURE__ */ u(f.Provider, {
17
+ value: r,
18
+ children: /* @__PURE__ */ u(p.Provider, {
19
+ value: t,
20
+ children: e
21
+ })
22
+ });
23
+ };
24
+ function h(e) {
25
+ let t = a(f);
26
+ o(() => e && t ? t() : void 0, [e, t]);
27
+ }
28
+ var g = () => a(p), _ = () => a(p) > 0, v = {
29
+ root: "_root_1rswg_7",
30
+ nonModal: "_nonModal_1rswg_30",
31
+ panel: "_panel_1rswg_3",
32
+ center: "_center_1rswg_41",
33
+ right: "_right_1rswg_42",
34
+ left: "_left_1rswg_43",
35
+ top: "_top_1rswg_44",
36
+ bottom: "_bottom_1rswg_45",
37
+ sm: "_sm_1rswg_86",
38
+ md: "_md_1rswg_87",
39
+ lg: "_lg_1rswg_88",
40
+ xl: "_xl_1rswg_89",
41
+ full: "_full_1rswg_90",
42
+ header: "_header_1rswg_96",
43
+ headText: "_headText_1rswg_106",
44
+ title: "_title_1rswg_108",
45
+ subtitle: "_subtitle_1rswg_114",
46
+ body: "_body_1rswg_120",
47
+ flush: "_flush_1rswg_128",
48
+ footer: "_footer_1rswg_130",
49
+ close: "_close_1rswg_141",
50
+ dialogPop: "_dialogPop_1rswg_1",
51
+ slideFromRight: "_slideFromRight_1rswg_1",
52
+ slideFromLeft: "_slideFromLeft_1rswg_1",
53
+ slideFromTop: "_slideFromTop_1rswg_1",
54
+ slideFromBottom: "_slideFromBottom_1rswg_1",
55
+ backdropIn: "_backdropIn_1rswg_1",
56
+ closing: "_closing_1rswg_168"
57
+ }, y = 0, b = null, x = (e) => {
58
+ if (typeof document < "u") {
59
+ if (y === 0) {
60
+ let t = document.body;
61
+ b = {
62
+ overflow: t.style.overflow,
63
+ paddingRight: t.style.paddingRight
64
+ };
65
+ let n = window.innerWidth - document.documentElement.clientWidth;
66
+ if (e && n > 0) {
67
+ let e = parseFloat(window.getComputedStyle(t).paddingRight) || 0;
68
+ t.style.paddingRight = `${e + n}px`;
69
+ }
70
+ t.style.overflow = "hidden";
71
+ }
72
+ y += 1;
73
+ }
74
+ }, re = () => {
75
+ typeof document < "u" && (y = Math.max(0, y - 1), y === 0 && b && (document.body.style.overflow = b.overflow, document.body.style.paddingRight = b.paddingRight, b = null));
76
+ }, ie = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, S = /* @__PURE__ */ d("svg", {
77
+ width: "16",
78
+ height: "16",
79
+ viewBox: "0 0 24 24",
80
+ fill: "none",
81
+ stroke: "currentColor",
82
+ strokeWidth: "2",
83
+ strokeLinecap: "round",
84
+ "aria-hidden": "true",
85
+ children: [/* @__PURE__ */ u("line", {
86
+ x1: "18",
87
+ y1: "6",
88
+ x2: "6",
89
+ y2: "18"
90
+ }), /* @__PURE__ */ u("line", {
91
+ x1: "6",
92
+ y1: "6",
93
+ x2: "18",
94
+ y2: "18"
95
+ })]
96
+ }), ae = 0, C = ({ open: n, onClose: r, onBeforeClose: i, onEscKeyDown: a, onOverlayClick: s, onAnimationEnd: f, children: p, title: m, subtitle: g, footer: _, modal: y = !0, placement: b = "center", size: C = "md", closeOnBackdrop: w = !0, closeOnEscape: T = !0, showCloseButton: E = !0, closeIcon: D, closeIconId: O, blockScroll: k = !0, reserveScrollBarGap: A = !0, initialFocusRef: j, container: oe, animationDuration: se = 200, padded: ce = !0, classNames: M = {}, styleSlots: N = {}, className: P = "", style: F, role: I = "dialog", id: L, "aria-label": R, "aria-labelledby": z, "aria-describedby": B }) => {
97
+ let V = e(), H = c(null), [U, W] = l(null), G = te(), [K, q] = l(n), [le, J] = l(!1), Y = c(null), X = ie() ? 0 : se;
98
+ h(K), o(() => {
99
+ n ? (Y.current &&= (clearTimeout(Y.current), null), J(!1), q(!0)) : K && (J(!0), Y.current = setTimeout(() => {
100
+ H.current?.close(), q(!1), J(!1), f?.();
101
+ }, X));
102
+ }, [n]), o(() => () => {
103
+ Y.current && clearTimeout(Y.current);
104
+ }, []);
105
+ let Z = ee(() => {
106
+ i && i() === !1 || r?.();
107
+ }, [i, r]);
108
+ o(() => {
109
+ let e = H.current;
110
+ if (e && K && (e.open || (y && (e.dataset.modalOrder = String(++ae)), y ? e.showModal() : e.show(), j?.current && j.current.focus({ focusVisible: !0 })), k && y)) return x(A), () => re();
111
+ }, [
112
+ K,
113
+ y,
114
+ k,
115
+ A,
116
+ j
117
+ ]), o(() => {
118
+ let e = H.current;
119
+ if (!e || !K) return;
120
+ let t = (e) => {
121
+ e.preventDefault(), a?.(e), T && Z();
122
+ };
123
+ return e.addEventListener("cancel", t), () => e.removeEventListener("cancel", t);
124
+ }, [
125
+ K,
126
+ T,
127
+ Z,
128
+ a
129
+ ]);
130
+ let Q = c(!1), ue = (e) => {
131
+ Q.current = e.target === H.current;
132
+ }, de = (e) => {
133
+ let t = Q.current && e.target === H.current;
134
+ Q.current = !1, t && (s?.(e), w && Z());
135
+ };
136
+ if (!K) return null;
137
+ let fe = m !== void 0 || g !== void 0 || E, pe = z ?? (m !== void 0 && !R ? G : void 0), me = /* @__PURE__ */ u("dialog", {
138
+ ref: (e) => {
139
+ H.current = e, W(e);
140
+ },
141
+ id: L,
142
+ "data-modal": y ? "" : void 0,
143
+ className: [
144
+ v.root,
145
+ v[b],
146
+ v[C],
147
+ y ? "" : v.nonModal,
148
+ le ? v.closing : "",
149
+ M.root,
150
+ P
151
+ ].filter(Boolean).join(" "),
152
+ style: {
153
+ "--dialog-anim": `${X}ms`,
154
+ ...N.root,
155
+ ...F
156
+ },
157
+ role: I,
158
+ "aria-label": R,
159
+ "aria-labelledby": pe,
160
+ "aria-describedby": B,
161
+ "aria-modal": y || void 0,
162
+ onPointerDown: ue,
163
+ onPointerUp: de,
164
+ children: /* @__PURE__ */ u(t.Provider, {
165
+ value: U,
166
+ children: /* @__PURE__ */ d("div", {
167
+ className: [v.panel, M.panel].filter(Boolean).join(" "),
168
+ style: N.panel,
169
+ children: [
170
+ fe && /* @__PURE__ */ d("div", {
171
+ className: [v.header, M.header].filter(Boolean).join(" "),
172
+ style: N.header,
173
+ children: [/* @__PURE__ */ d("span", {
174
+ className: v.headText,
175
+ children: [m !== void 0 && /* @__PURE__ */ u("span", {
176
+ className: v.title,
177
+ id: G,
178
+ children: m
179
+ }), g !== void 0 && /* @__PURE__ */ u("span", {
180
+ className: v.subtitle,
181
+ children: g
182
+ })]
183
+ }), E && /* @__PURE__ */ u("button", {
184
+ type: "button",
185
+ id: O,
186
+ className: [v.close, M.closeButton].filter(Boolean).join(" "),
187
+ style: N.closeButton,
188
+ onClick: Z,
189
+ "aria-label": V.dialog.close,
190
+ children: D ?? S
191
+ })]
192
+ }),
193
+ p !== void 0 && /* @__PURE__ */ u("div", {
194
+ className: [
195
+ v.body,
196
+ ce ? "scroll-fade-y scroll-gutter" : `${v.flush} scroll-fade-y`,
197
+ M.body
198
+ ].filter(Boolean).join(" "),
199
+ style: N.body,
200
+ children: p
201
+ }),
202
+ _ !== void 0 && /* @__PURE__ */ u("div", {
203
+ className: [v.footer, M.footer].filter(Boolean).join(" "),
204
+ style: N.footer,
205
+ children: _
206
+ })
207
+ ]
208
+ })
209
+ })
210
+ }), $ = oe ?? (typeof document > "u" ? null : document.body);
211
+ return $ ? ne(me, $) : null;
212
+ };
213
+ C.displayName = "Dialog";
214
+ var w = i({
215
+ authorize: () => !0,
216
+ exportOptions: {},
217
+ serverMode: !1,
218
+ labels: r,
219
+ format: n(),
220
+ text: {
221
+ yes: r.yes,
222
+ no: r.no
223
+ }
224
+ });
225
+ function T() {
226
+ return a(w);
227
+ }
228
+ function E() {
229
+ return a(w).labels;
230
+ }
231
+ function D(e, t, n) {
232
+ return !e || e(t, n) !== !1;
233
+ }
234
+ // src/components/DataTable/layout/scrollArea.ts
235
+ var O = "dt-scroll-area scroll-fade-y scroll-gutter", k = "dt-scroll-area scroll-fade-x scroll-fade-y scroll-gutter";
236
+ export { E as a, m as c, D as i, _ as l, O as n, T as o, w as r, C as s, k as t, g as u };