@alfadocs/ui-kit 1.41.1 → 1.43.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 (32) hide show
  1. package/dist/_chunks/{calendar-workspace-Bx8xxvic.js → calendar-workspace-DhXqqu-D.js} +1981 -1968
  2. package/dist/_chunks/control-room-rail-Cv7GpMqX.js +354 -0
  3. package/dist/_chunks/{marketplace-app-shell-D_g9BaDI.js → marketplace-app-shell-DdwPj03y.js} +3 -3
  4. package/dist/_chunks/{notes-panel-Daq5T_cS.js → notes-panel-CRAovkjx.js} +84 -68
  5. package/dist/_chunks/{sidebar-ClTY9lLI.js → sidebar-DbZXLl8h.js} +2 -2
  6. package/dist/_chunks/tab-bar-Cw9UK18Z.js +228 -0
  7. package/dist/_chunks/{tool-rail-D89USYE6.js → tool-rail-CCFqDfAn.js} +282 -276
  8. package/dist/_chunks/use-edge-resize-BHesP0kg.js +149 -0
  9. package/dist/_chunks/use-scroll-overflow-UbLrUfBo.js +72 -0
  10. package/dist/agent-catalog.json +1 -1
  11. package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
  12. package/dist/components/control-room-rail/index.js +1 -1
  13. package/dist/components/notes-panel/index.js +1 -1
  14. package/dist/components/notes-panel/notes-panel.d.ts +32 -0
  15. package/dist/components/sidebar/index.js +1 -1
  16. package/dist/components/tab-bar/index.js +1 -1
  17. package/dist/components/tool-rail/index.js +1 -1
  18. package/dist/components/tool-rail/tool-rail.d.ts +16 -0
  19. package/dist/hooks/index.d.ts +2 -0
  20. package/dist/hooks/index.js +35 -32
  21. package/dist/hooks/use-edge-resize.d.ts +13 -1
  22. package/dist/index.js +6 -6
  23. package/dist/patterns/calendar/calendar.journey.d.ts +11 -0
  24. package/dist/patterns/calendar/calendar.sheets.d.ts +20 -0
  25. package/dist/patterns/calendar/index.js +1 -1
  26. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  27. package/dist/tokens.css +1 -1
  28. package/package.json +1 -1
  29. package/dist/_chunks/control-room-rail-CnNZusR5.js +0 -337
  30. package/dist/_chunks/tab-bar-rDkLiaA6.js +0 -268
  31. package/dist/_chunks/use-edge-resize-ZnGG7gyO.js +0 -139
  32. package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +0 -32
@@ -1,139 +0,0 @@
1
- import { useState as X, useRef as T, useCallback as o } from "react";
2
- import { useTranslation as B } from "react-i18next";
3
- import { u as L } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
4
- const S = 16, Y = 64;
5
- function O({
6
- edge: I,
7
- targetRef: e,
8
- cssProperty: d,
9
- minSize: i,
10
- maxSize: p,
11
- defaultSize: C,
12
- disabled: c = !1,
13
- onResize: n
14
- }) {
15
- const { t: b } = B(), [f, E] = X(null), [x, P] = X(!1), h = T(null), m = T(null);
16
- L(() => {
17
- const t = e.current;
18
- if (!t) return;
19
- const r = t.getBoundingClientRect().width;
20
- r > 0 && (h.current = r);
21
- });
22
- const y = o(
23
- (t) => Math.min(p, Math.max(i, t)),
24
- [i, p]
25
- ), s = o(() => {
26
- if (f !== null) return f;
27
- const t = e.current;
28
- if (t) {
29
- const r = t.getBoundingClientRect().width;
30
- if (r > 0)
31
- return h.current = r, r;
32
- }
33
- return h.current ?? C;
34
- }, [f, C, e]), a = o(
35
- (t) => {
36
- var u;
37
- const r = y(t);
38
- return E(r), (u = e.current) == null || u.style.setProperty(d, `${r}px`), r;
39
- },
40
- [y, d, e]
41
- ), w = o(() => {
42
- var t;
43
- E(null), (t = e.current) == null || t.style.removeProperty(d), h.current = null, n == null || n(null);
44
- }, [d, n, e]), g = o(() => {
45
- const t = e.current, r = t ? getComputedStyle(t).direction === "rtl" : !1;
46
- return (I === "inline-end" ? 1 : -1) * (r ? -1 : 1);
47
- }, [I, e]), A = o(
48
- (t) => {
49
- c || !t.isPrimary || (t.currentTarget.setPointerCapture(t.pointerId), m.current = {
50
- pointerId: t.pointerId,
51
- startX: t.clientX,
52
- startSize: s(),
53
- sign: g()
54
- }, P(!0));
55
- },
56
- [c, s, g]
57
- ), K = o(
58
- (t) => {
59
- const r = m.current;
60
- !r || t.pointerId !== r.pointerId || a(r.startSize + r.sign * (t.clientX - r.startX));
61
- },
62
- [a]
63
- ), k = o(
64
- (t) => {
65
- const r = m.current;
66
- if (!r || t.pointerId !== r.pointerId) return;
67
- t.currentTarget.releasePointerCapture(t.pointerId), m.current = null, P(!1);
68
- const u = a(
69
- r.startSize + r.sign * (t.clientX - r.startX)
70
- );
71
- n == null || n(u);
72
- },
73
- [a, n]
74
- ), M = o(
75
- (t) => {
76
- if (c) return;
77
- const r = t.shiftKey ? Y : S, u = g();
78
- let l = null;
79
- switch (t.key) {
80
- case "ArrowRight":
81
- l = s() + u * r;
82
- break;
83
- case "ArrowLeft":
84
- l = s() - u * r;
85
- break;
86
- case "Home":
87
- l = i;
88
- break;
89
- case "End":
90
- l = p;
91
- break;
92
- case "Enter":
93
- t.preventDefault(), w();
94
- return;
95
- default:
96
- return;
97
- }
98
- if (l === null) return;
99
- t.preventDefault();
100
- const _ = a(l);
101
- n == null || n(_);
102
- },
103
- [
104
- a,
105
- s,
106
- c,
107
- p,
108
- i,
109
- n,
110
- w,
111
- g
112
- ]
113
- ), D = Math.round(s());
114
- return {
115
- separatorProps: {
116
- role: "separator",
117
- tabIndex: c ? -1 : 0,
118
- "aria-orientation": "vertical",
119
- "aria-valuemin": i,
120
- "aria-valuemax": p,
121
- "aria-valuenow": D,
122
- "aria-valuetext": b("resizable.widthAnnounce", { width: D }),
123
- "aria-disabled": c || void 0,
124
- onPointerDown: A,
125
- onPointerMove: K,
126
- onPointerUp: k,
127
- onPointerCancel: k,
128
- onKeyDown: M,
129
- onDoubleClick: w
130
- },
131
- isResizing: x,
132
- isResized: f !== null,
133
- reset: w
134
- };
135
- }
136
- export {
137
- O as u
138
- };
139
- //# sourceMappingURL=use-edge-resize-ZnGG7gyO.js.map
@@ -1,32 +0,0 @@
1
- import { useRef as a, useState as m, useCallback as O } from "react";
2
- import { u as h } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
3
- function b(r = !0) {
4
- const u = a(null), [e, v] = m(null), R = O(
5
- (t) => {
6
- r && v(t);
7
- },
8
- [r]
9
- ), [d, c] = m(!1), o = a(null);
10
- return h(() => {
11
- if (!r) {
12
- o.current = null, c((n) => n && !1);
13
- return;
14
- }
15
- const t = u.current;
16
- if (!t) return;
17
- const i = () => {
18
- e && (o.current = e.scrollWidth);
19
- const n = o.current;
20
- if (n == null) return;
21
- const f = n - t.clientWidth > 1;
22
- c((l) => l === f ? l : f);
23
- };
24
- if (i(), typeof ResizeObserver > "u") return;
25
- const s = new ResizeObserver(i);
26
- return s.observe(t), e && s.observe(e), () => s.disconnect();
27
- }, [r, e]), { containerRef: u, contentRef: R, isOverflowing: d };
28
- }
29
- export {
30
- b as u
31
- };
32
- //# sourceMappingURL=use-overflow-collapse-BIOzKbni.js.map