@alfadocs/ui-kit-debug 1.11.0 → 1.12.4
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/_chunks/{actions-cell-renderer-xfSYiTXQ.js → actions-cell-renderer-BCEjn3-f.js} +2 -2
- package/dist/_chunks/{actions-cell-renderer-xfSYiTXQ.js.map → actions-cell-renderer-BCEjn3-f.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-d44s_whc.js → anamnesis-summary-rows-BfhxWPO3.js} +1421 -1418
- package/dist/_chunks/anamnesis-summary-rows-BfhxWPO3.js.map +1 -0
- package/dist/_chunks/appointment-card-Dzr3GeVz.js.map +1 -1
- package/dist/_chunks/appointment-timeline-DCn0Jx55.js +403 -0
- package/dist/_chunks/appointment-timeline-DCn0Jx55.js.map +1 -0
- package/dist/_chunks/{balance-badge-cell-C_Qz76x7.js → balance-badge-cell-BrlikHfT.js} +317 -290
- package/dist/_chunks/balance-badge-cell-BrlikHfT.js.map +1 -0
- package/dist/_chunks/{chart-Bkr1Sh4o.js → chart-C6eHTxkO.js} +2 -2
- package/dist/_chunks/{chart-Bkr1Sh4o.js.map → chart-C6eHTxkO.js.map} +1 -1
- package/dist/_chunks/{control-room-rail-Cj2iX9h_.js → control-room-rail-iO_BCaq1.js} +2 -2
- package/dist/_chunks/{control-room-rail-Cj2iX9h_.js.map → control-room-rail-iO_BCaq1.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-zLf_bXvL.js → editable-currency-cell-renderer-B7TVZ5ZJ.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-zLf_bXvL.js.map → editable-currency-cell-renderer-B7TVZ5ZJ.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BfDi4YkW.js → face-scheme-CZaKm6fG.js} +2 -2
- package/dist/_chunks/{face-scheme-BfDi4YkW.js.map → face-scheme-CZaKm6fG.js.map} +1 -1
- package/dist/_chunks/{file-manager-Df6hyUYg.js → file-manager-Moc7sUFj.js} +3 -3
- package/dist/_chunks/{file-manager-Df6hyUYg.js.map → file-manager-Moc7sUFj.js.map} +1 -1
- package/dist/_chunks/{header-settings-CVC_davE.js → header-settings-J-ZCAfir.js} +2 -2
- package/dist/_chunks/{header-settings-CVC_davE.js.map → header-settings-J-ZCAfir.js.map} +1 -1
- package/dist/_chunks/{icon-button-group-D6SVMteH.js → icon-button-group-VCCod3Hz.js} +154 -145
- package/dist/_chunks/icon-button-group-VCCod3Hz.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-Cp2MSlJl.js → link-cell-renderer-CenJx-_7.js} +197 -181
- package/dist/_chunks/link-cell-renderer-CenJx-_7.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-Chfdia7m.js → marketplace-app-shell-DDQXQ8hX.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-Chfdia7m.js.map → marketplace-app-shell-DDQXQ8hX.js.map} +1 -1
- package/dist/_chunks/{notes-panel-e9cJWVRg.js → notes-panel-CymneXtl.js} +93 -91
- package/dist/_chunks/notes-panel-CymneXtl.js.map +1 -0
- package/dist/_chunks/{signature-request-CW30B77U.js → signature-request-DVDTKLjM.js} +2 -2
- package/dist/_chunks/{signature-request-CW30B77U.js.map → signature-request-DVDTKLjM.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-DuMhQNFS.js → theme-toggle-uEwoKjl3.js} +2 -2
- package/dist/_chunks/{theme-toggle-DuMhQNFS.js.map → theme-toggle-uEwoKjl3.js.map} +1 -1
- package/dist/_chunks/{tool-rail-CHyUmulN.js → tool-rail-8Scslq3X.js} +2 -2
- package/dist/_chunks/tool-rail-8Scslq3X.js.map +1 -0
- package/dist/_chunks/{whatsapp-button-Ca9towA4.js → whatsapp-button-CuFIHJzG.js} +27 -19
- package/dist/_chunks/{whatsapp-button-Ca9towA4.js.map → whatsapp-button-CuFIHJzG.js.map} +1 -1
- package/dist/agent-catalog.json +2 -2
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts.map +1 -1
- package/dist/components/appointment-timeline/appointment-timeline.agent.d.ts.map +1 -1
- package/dist/components/appointment-timeline/appointment-timeline.d.ts +8 -0
- package/dist/components/appointment-timeline/appointment-timeline.d.ts.map +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/data-table/filters/date-range-filter.d.ts +22 -0
- package/dist/components/data-table/filters/date-range-filter.d.ts.map +1 -1
- package/dist/components/data-table/index.js +3 -3
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.agent.d.ts.map +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +6 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/patient-table/columns.d.ts.map +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/components/whatsapp-button/index.js +1 -1
- package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -1
- package/dist/host-compat.css +7 -1
- package/dist/index.js +16 -16
- package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-compile.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-config.d.ts +18 -7
- package/dist/patterns/anamnesis/anamnesis-config.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-types.d.ts +8 -0
- package/dist/patterns/anamnesis/anamnesis-types.d.ts.map +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/anamnesis-summary-rows-d44s_whc.js.map +0 -1
- package/dist/_chunks/appointment-timeline-0mwtpErq.js +0 -388
- package/dist/_chunks/appointment-timeline-0mwtpErq.js.map +0 -1
- package/dist/_chunks/balance-badge-cell-C_Qz76x7.js.map +0 -1
- package/dist/_chunks/icon-button-group-D6SVMteH.js.map +0 -1
- package/dist/_chunks/link-cell-renderer-Cp2MSlJl.js.map +0 -1
- package/dist/_chunks/notes-panel-e9cJWVRg.js.map +0 -1
- package/dist/_chunks/tool-rail-CHyUmulN.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { I as
|
|
6
|
-
import { D as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { E as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as a, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Se, useState as W, useCallback as H, useRef as F, Children as be, isValidElement as _, useEffect as ve, cloneElement as ye } from "react";
|
|
3
|
+
import { c as Be } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Ke } from "react-i18next";
|
|
5
|
+
import { I as he } from "./icon-button-DA2CAGHZ.js";
|
|
6
|
+
import { D as k } from "./dropdown-menu-DU-Hrf33.js";
|
|
7
|
+
import { u as Pe } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
8
|
+
import { u as Te } from "./use-priority-overflow-c9SjxZkZ.js";
|
|
9
|
+
import { E as we } from "./ellipsis-dRo9ouSU.js";
|
|
10
|
+
const ke = Be(
|
|
11
11
|
[
|
|
12
12
|
"ds:inline-flex ds:isolate",
|
|
13
13
|
// Hairline border around the group unifies the children into one
|
|
@@ -52,16 +52,16 @@ const ye = ze(
|
|
|
52
52
|
orientation: "horizontal"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
),
|
|
56
|
-
(d,
|
|
55
|
+
), Ie = "ds:absolute ds:start-0 ds:top-0 ds:invisible ds:pointer-events-none", _e = Se(
|
|
56
|
+
(d, y) => {
|
|
57
57
|
const {
|
|
58
58
|
size: m,
|
|
59
|
-
orientation:
|
|
59
|
+
orientation: c = "horizontal",
|
|
60
60
|
role: i = "group",
|
|
61
61
|
mode: n = "momentary",
|
|
62
62
|
disabled: q = !1,
|
|
63
63
|
intent: S = "outline",
|
|
64
|
-
overflow:
|
|
64
|
+
overflow: Ce = "none",
|
|
65
65
|
className: J,
|
|
66
66
|
children: Q,
|
|
67
67
|
"aria-label": X,
|
|
@@ -69,11 +69,11 @@ const ye = ze(
|
|
|
69
69
|
// Controlled-value props are consumed via `props as …` below; strip them
|
|
70
70
|
// here so they never spread onto the root <div> (React would warn that
|
|
71
71
|
// `onValueChange` is an unknown DOM event handler).
|
|
72
|
-
value:
|
|
73
|
-
defaultValue:
|
|
74
|
-
onValueChange:
|
|
72
|
+
value: Me,
|
|
73
|
+
defaultValue: Oe,
|
|
74
|
+
onValueChange: $e,
|
|
75
75
|
...Z
|
|
76
|
-
} = d, { t:
|
|
76
|
+
} = d, { t: Re } = Ke(), h = Ce === "menu" && c !== "vertical", [ee, oe] = W(
|
|
77
77
|
() => n === "toggle-single" ? d.defaultValue ?? "" : n === "toggle-multi" ? d.defaultValue ?? [] : ""
|
|
78
78
|
), g = (() => {
|
|
79
79
|
if (n === "toggle-single") {
|
|
@@ -85,7 +85,7 @@ const ye = ze(
|
|
|
85
85
|
return e.value !== void 0 ? e.value : ee;
|
|
86
86
|
}
|
|
87
87
|
return "";
|
|
88
|
-
})(),
|
|
88
|
+
})(), I = H(
|
|
89
89
|
(e) => {
|
|
90
90
|
var o, r;
|
|
91
91
|
if (n === "toggle-single") {
|
|
@@ -97,194 +97,203 @@ const ye = ze(
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
[n, d]
|
|
100
|
-
), b = i === "toolbar" || i === "radiogroup",
|
|
100
|
+
), b = i === "toolbar" || i === "radiogroup", x = F([]), [v, A] = W(0), te = H(
|
|
101
101
|
(e, o) => {
|
|
102
|
-
|
|
102
|
+
x.current[e] = o;
|
|
103
103
|
},
|
|
104
104
|
[]
|
|
105
|
-
), re =
|
|
106
|
-
|
|
105
|
+
), re = F(null), [G, xe] = W(!1);
|
|
106
|
+
Pe(() => {
|
|
107
107
|
if (typeof window > "u") return;
|
|
108
108
|
const e = re.current;
|
|
109
109
|
if (!e) return;
|
|
110
110
|
const o = window.getComputedStyle(e).direction;
|
|
111
|
-
|
|
111
|
+
xe(o === "rtl");
|
|
112
112
|
}, []);
|
|
113
|
-
const
|
|
113
|
+
const M = H(
|
|
114
114
|
(e) => {
|
|
115
|
-
var
|
|
115
|
+
var P;
|
|
116
116
|
if (!b) return;
|
|
117
|
-
const o =
|
|
117
|
+
const o = x.current.filter(Boolean).length;
|
|
118
118
|
if (o === 0) return;
|
|
119
|
-
const r =
|
|
119
|
+
const r = c === "vertical" ? "ArrowDown" : G ? "ArrowLeft" : "ArrowRight", t = c === "vertical" ? "ArrowUp" : G ? "ArrowRight" : "ArrowLeft";
|
|
120
120
|
let s = null;
|
|
121
|
-
if (e.key === r ? s = (
|
|
122
|
-
const
|
|
123
|
-
let
|
|
124
|
-
for (;
|
|
125
|
-
const f =
|
|
121
|
+
if (e.key === r ? s = (v + 1) % o : e.key === t ? s = (v - 1 + o) % o : e.key === "Home" ? s = 0 : e.key === "End" && (s = o - 1), s === null) return;
|
|
122
|
+
const N = o;
|
|
123
|
+
let R = 0, u = s;
|
|
124
|
+
for (; R < N; ) {
|
|
125
|
+
const f = x.current[u];
|
|
126
126
|
if (f && f.getAttribute("aria-disabled") !== "true" && !f.disabled)
|
|
127
127
|
break;
|
|
128
|
-
|
|
128
|
+
u = e.key === t || e.key === "End" ? (u - 1 + o) % o : (u + 1) % o, R += 1;
|
|
129
129
|
}
|
|
130
|
-
if (e.preventDefault(),
|
|
131
|
-
const f = se.current[
|
|
130
|
+
if (e.preventDefault(), A(u), (P = x.current[u]) == null || P.focus(), i === "radiogroup" && n === "toggle-single") {
|
|
131
|
+
const f = se.current[u];
|
|
132
132
|
if (f && typeof f == "object" && "props" in f) {
|
|
133
|
-
const
|
|
134
|
-
|
|
133
|
+
const j = f.props.value;
|
|
134
|
+
j && j !== g && I(j);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
[
|
|
139
139
|
b,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
c,
|
|
141
|
+
G,
|
|
142
|
+
v,
|
|
143
143
|
i,
|
|
144
144
|
n,
|
|
145
|
-
|
|
145
|
+
I,
|
|
146
146
|
g
|
|
147
147
|
]
|
|
148
|
-
),
|
|
148
|
+
), D = h ? be.toArray(Q).filter(_) : [], B = (e) => {
|
|
149
149
|
const o = e.props["aria-label"];
|
|
150
150
|
return typeof o == "string" ? o : typeof e.props.tooltip == "string" ? e.props.tooltip : null;
|
|
151
151
|
};
|
|
152
|
-
|
|
153
|
-
const
|
|
152
|
+
F(!1);
|
|
153
|
+
const Ae = D.map((e) => {
|
|
154
154
|
const o = e.props["data-overflow-pin"] !== void 0, r = B(e) !== null;
|
|
155
155
|
return o || !r;
|
|
156
|
-
}), { containerRef:
|
|
157
|
-
enabled:
|
|
158
|
-
count:
|
|
159
|
-
pinned:
|
|
160
|
-
}), ie =
|
|
161
|
-
|
|
162
|
-
const se =
|
|
163
|
-
se.current =
|
|
164
|
-
const
|
|
165
|
-
(e) =>
|
|
156
|
+
}), { containerRef: De, fullRowRef: Ve, triggerProbeRef: Le, visible: ne, overflowing: V } = Te({
|
|
157
|
+
enabled: h,
|
|
158
|
+
count: D.length,
|
|
159
|
+
pinned: Ae
|
|
160
|
+
}), ie = F(null), w = h ? D.filter((e, o) => ne[o]) : be.toArray(Q);
|
|
161
|
+
h && (x.current.length = w.length + (V ? 1 : 0));
|
|
162
|
+
const se = F([]);
|
|
163
|
+
se.current = w;
|
|
164
|
+
const O = i === "radiogroup" && n === "toggle-single" ? w.findIndex(
|
|
165
|
+
(e) => _(e) && e.props.value === g
|
|
166
166
|
) : -1;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}, [
|
|
170
|
-
const
|
|
171
|
-
|
|
167
|
+
ve(() => {
|
|
168
|
+
O >= 0 && A(O);
|
|
169
|
+
}, [O]);
|
|
170
|
+
const C = w.length;
|
|
171
|
+
ve(() => {
|
|
172
172
|
var o;
|
|
173
|
-
if (!b || !
|
|
174
|
-
const e =
|
|
175
|
-
e > 0 &&
|
|
173
|
+
if (!b || !h) return;
|
|
174
|
+
const e = C + (V ? 1 : 0);
|
|
175
|
+
e > 0 && v >= e && (A(e - 1), document.activeElement === document.body && ((o = ie.current) == null || o.focus()));
|
|
176
176
|
}, [
|
|
177
177
|
b,
|
|
178
|
-
|
|
178
|
+
h,
|
|
179
|
+
C,
|
|
179
180
|
V,
|
|
180
|
-
|
|
181
|
-
h
|
|
181
|
+
v
|
|
182
182
|
]);
|
|
183
|
-
const ae =
|
|
184
|
-
if (!
|
|
183
|
+
const ae = (e) => {
|
|
184
|
+
if (!_(e)) return !1;
|
|
185
|
+
const o = e.props;
|
|
186
|
+
return o.disabled === !0 || o.loading === !0;
|
|
187
|
+
}, le = w.findIndex((e) => !ae(e)), de = ae(w[v]) ? le !== -1 ? le : (
|
|
188
|
+
/* Every visible child is disabled: the overflow trigger is the
|
|
189
|
+
only thing left that can hold focus. Without this the group
|
|
190
|
+
has no tab stop at all and the menu is unreachable. */
|
|
191
|
+
V ? C : v
|
|
192
|
+
) : v, ce = w.map((e, o) => {
|
|
193
|
+
if (!_(e))
|
|
185
194
|
return e;
|
|
186
|
-
const r = e, t = r.props.value, { ariaPressed: s, ariaChecked:
|
|
195
|
+
const r = e, t = r.props.value, { ariaPressed: s, ariaChecked: N } = Ge(
|
|
187
196
|
n,
|
|
188
197
|
i,
|
|
189
198
|
t,
|
|
190
199
|
g
|
|
191
|
-
),
|
|
192
|
-
var l,
|
|
193
|
-
if (
|
|
200
|
+
), R = q === !0, u = r.props.disabled === !0, P = (p) => {
|
|
201
|
+
var l, z;
|
|
202
|
+
if (R) {
|
|
194
203
|
p.preventDefault(), p.stopPropagation();
|
|
195
204
|
return;
|
|
196
205
|
}
|
|
197
|
-
if ((
|
|
206
|
+
if ((z = (l = r.props).onClick) == null || z.call(l, p), !p.defaultPrevented && t) {
|
|
198
207
|
if (n === "toggle-single") {
|
|
199
208
|
if (g === t) return;
|
|
200
|
-
|
|
209
|
+
I(t);
|
|
201
210
|
} else if (n === "toggle-multi") {
|
|
202
|
-
const
|
|
203
|
-
|
|
211
|
+
const U = g, ze = U.includes(t) ? U.filter((Fe) => Fe !== t) : [...U, t];
|
|
212
|
+
I(ze);
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
215
|
}, f = (p) => {
|
|
207
216
|
te(o, p);
|
|
208
217
|
const l = r.ref;
|
|
209
218
|
typeof l == "function" ? l(p) : l != null && typeof l == "object" && (l.current = p);
|
|
210
|
-
},
|
|
219
|
+
}, j = R && !u ? !0 : void 0, Ne = n !== "momentary" || R, je = {
|
|
211
220
|
intent: r.props.intent ?? S,
|
|
212
221
|
size: r.props.size ?? m,
|
|
213
|
-
disabled:
|
|
214
|
-
"aria-disabled":
|
|
215
|
-
onClick:
|
|
222
|
+
disabled: u,
|
|
223
|
+
"aria-disabled": j,
|
|
224
|
+
onClick: Ne ? P : r.props.onClick,
|
|
216
225
|
"aria-pressed": s,
|
|
217
|
-
"aria-checked":
|
|
226
|
+
"aria-checked": N,
|
|
218
227
|
// When the group is a radiogroup, children must be `role="radio"`
|
|
219
228
|
// so screen readers announce them as radio buttons and so
|
|
220
229
|
// `getByRole('radio')` works in tests. The button element is
|
|
221
230
|
// re-purposed as a radio; `aria-checked` above carries the state.
|
|
222
231
|
role: i === "radiogroup" ? "radio" : void 0,
|
|
223
|
-
tabIndex: b ? o ===
|
|
232
|
+
tabIndex: b ? o === de ? 0 : -1 : void 0,
|
|
224
233
|
onFocus: (p) => {
|
|
225
|
-
var l,
|
|
226
|
-
b &&
|
|
234
|
+
var l, z;
|
|
235
|
+
b && A(o), (z = (l = r.props).onFocus) == null || z.call(l, p);
|
|
227
236
|
},
|
|
228
237
|
ref: f
|
|
229
238
|
};
|
|
230
|
-
return
|
|
231
|
-
}),
|
|
232
|
-
re.current = e, typeof
|
|
239
|
+
return ye(r, je);
|
|
240
|
+
}), ue = (e) => {
|
|
241
|
+
re.current = e, typeof y == "function" ? y(e) : y && typeof y == "object" && (y.current = e);
|
|
233
242
|
};
|
|
234
|
-
if (!
|
|
243
|
+
if (!h)
|
|
235
244
|
return /* @__PURE__ */ a(
|
|
236
245
|
"div",
|
|
237
246
|
{
|
|
238
|
-
ref:
|
|
247
|
+
ref: ue,
|
|
239
248
|
role: i,
|
|
240
249
|
"aria-label": X,
|
|
241
250
|
"aria-labelledby": Y,
|
|
242
|
-
"aria-orientation": i === "toolbar" ?
|
|
243
|
-
onKeyDown:
|
|
244
|
-
className:
|
|
251
|
+
"aria-orientation": i === "toolbar" ? c : void 0,
|
|
252
|
+
onKeyDown: M,
|
|
253
|
+
className: ke({ orientation: c, className: J }),
|
|
245
254
|
"data-component": "icon-button-group",
|
|
246
255
|
...Z,
|
|
247
|
-
children:
|
|
256
|
+
children: ce
|
|
248
257
|
}
|
|
249
258
|
);
|
|
250
|
-
const
|
|
251
|
-
let
|
|
252
|
-
n === "toggle-single" ?
|
|
253
|
-
|
|
259
|
+
const fe = Re("buttonGroup.more", "More options"), L = q === !0, $ = D.map((e, o) => ({ childEl: e, i: o })).filter(({ i: e }) => !ne[e]);
|
|
260
|
+
let K = null;
|
|
261
|
+
n === "toggle-single" ? K = /* @__PURE__ */ a(
|
|
262
|
+
k.RadioGroup,
|
|
254
263
|
{
|
|
255
264
|
value: g,
|
|
256
265
|
onValueChange: (e) => {
|
|
257
|
-
!
|
|
266
|
+
!L && e !== g && I(e);
|
|
258
267
|
},
|
|
259
|
-
children:
|
|
260
|
-
|
|
268
|
+
children: $.map(({ childEl: e, i: o }) => /* @__PURE__ */ a(
|
|
269
|
+
k.RadioItem,
|
|
261
270
|
{
|
|
262
271
|
value: e.props.value ?? "",
|
|
263
|
-
disabled:
|
|
272
|
+
disabled: L || e.props.disabled === !0,
|
|
264
273
|
children: B(e)
|
|
265
274
|
},
|
|
266
275
|
e.key ?? o
|
|
267
276
|
))
|
|
268
277
|
}
|
|
269
|
-
) : n === "toggle-multi" ?
|
|
278
|
+
) : n === "toggle-multi" ? K = $.map(({ childEl: e, i: o }) => {
|
|
270
279
|
const r = e.props.value, t = g, s = r ? t.includes(r) : !1;
|
|
271
280
|
return /* @__PURE__ */ a(
|
|
272
|
-
|
|
281
|
+
k.CheckboxItem,
|
|
273
282
|
{
|
|
274
283
|
checked: s,
|
|
275
|
-
disabled:
|
|
284
|
+
disabled: L || e.props.disabled === !0,
|
|
276
285
|
onCheckedChange: () => {
|
|
277
|
-
|
|
286
|
+
L || !r || I(s ? t.filter((N) => N !== r) : [...t, r]);
|
|
278
287
|
},
|
|
279
288
|
children: B(e)
|
|
280
289
|
},
|
|
281
290
|
e.key ?? o
|
|
282
291
|
);
|
|
283
|
-
}) :
|
|
284
|
-
|
|
292
|
+
}) : K = $.map(({ childEl: e, i: o }) => /* @__PURE__ */ a(
|
|
293
|
+
k.Item,
|
|
285
294
|
{
|
|
286
295
|
startIcon: e.props.icon,
|
|
287
|
-
disabled:
|
|
296
|
+
disabled: L || e.props.disabled === !0,
|
|
288
297
|
onSelect: (r) => {
|
|
289
298
|
var t, s;
|
|
290
299
|
(s = (t = e.props).onClick) == null || s.call(
|
|
@@ -296,57 +305,57 @@ const ye = ze(
|
|
|
296
305
|
},
|
|
297
306
|
e.key ?? o
|
|
298
307
|
));
|
|
299
|
-
const
|
|
300
|
-
/* @__PURE__ */ a(
|
|
301
|
-
|
|
308
|
+
const pe = V ? /* @__PURE__ */ T(k.Root, { children: [
|
|
309
|
+
/* @__PURE__ */ a(k.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
|
|
310
|
+
he,
|
|
302
311
|
{
|
|
303
|
-
icon: /* @__PURE__ */ a(
|
|
312
|
+
icon: /* @__PURE__ */ a(we, {}),
|
|
304
313
|
intent: S,
|
|
305
314
|
size: m,
|
|
306
|
-
"aria-label":
|
|
315
|
+
"aria-label": fe,
|
|
307
316
|
ref: (e) => {
|
|
308
|
-
ie.current = e, te(
|
|
317
|
+
ie.current = e, te(C, e);
|
|
309
318
|
},
|
|
310
|
-
tabIndex: b ?
|
|
311
|
-
onFocus: b ? () =>
|
|
319
|
+
tabIndex: b ? de === C ? 0 : -1 : void 0,
|
|
320
|
+
onFocus: b ? () => A(C) : void 0
|
|
312
321
|
}
|
|
313
322
|
) }),
|
|
314
|
-
/* @__PURE__ */ a(
|
|
315
|
-
] }) : null,
|
|
323
|
+
/* @__PURE__ */ a(k.Content, { align: "end", children: K })
|
|
324
|
+
] }) : null, ge = ke({ orientation: c }), E = i !== "radiogroup", me = /* @__PURE__ */ T(
|
|
316
325
|
"div",
|
|
317
326
|
{
|
|
318
327
|
role: i,
|
|
319
328
|
"aria-label": X,
|
|
320
329
|
"aria-labelledby": Y,
|
|
321
|
-
"aria-orientation": i === "toolbar" ?
|
|
322
|
-
onKeyDown:
|
|
323
|
-
className: `${
|
|
330
|
+
"aria-orientation": i === "toolbar" ? c : void 0,
|
|
331
|
+
onKeyDown: E ? M : void 0,
|
|
332
|
+
className: `${ge} ds:max-w-full`,
|
|
324
333
|
children: [
|
|
325
|
-
|
|
326
|
-
|
|
334
|
+
ce,
|
|
335
|
+
E ? pe : null
|
|
327
336
|
]
|
|
328
337
|
}
|
|
329
338
|
);
|
|
330
339
|
return /* @__PURE__ */ a(
|
|
331
340
|
"div",
|
|
332
341
|
{
|
|
333
|
-
ref:
|
|
342
|
+
ref: ue,
|
|
334
343
|
"data-component": "icon-button-group",
|
|
335
344
|
className: [
|
|
336
345
|
"ds:relative ds:block ds:w-full ds:min-w-0 ds:overflow-x-clip",
|
|
337
346
|
J ?? ""
|
|
338
347
|
].join(" ").trim(),
|
|
339
348
|
...Z,
|
|
340
|
-
children: /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ T("div", { ref: De, className: "ds:block ds:w-full ds:min-w-0", children: [
|
|
341
350
|
/* @__PURE__ */ a(
|
|
342
351
|
"div",
|
|
343
352
|
{
|
|
344
|
-
ref:
|
|
353
|
+
ref: Ve,
|
|
345
354
|
"aria-hidden": "true",
|
|
346
355
|
inert: !0,
|
|
347
|
-
className: `${
|
|
348
|
-
children:
|
|
349
|
-
(e, o) =>
|
|
356
|
+
className: `${Ie} ${ge}`,
|
|
357
|
+
children: D.map(
|
|
358
|
+
(e, o) => ye(e, {
|
|
350
359
|
key: e.key ?? o,
|
|
351
360
|
intent: e.props.intent ?? S,
|
|
352
361
|
size: e.props.size ?? m,
|
|
@@ -359,32 +368,32 @@ const ye = ze(
|
|
|
359
368
|
/* @__PURE__ */ a(
|
|
360
369
|
"span",
|
|
361
370
|
{
|
|
362
|
-
ref:
|
|
371
|
+
ref: Le,
|
|
363
372
|
"aria-hidden": "true",
|
|
364
373
|
inert: !0,
|
|
365
|
-
className:
|
|
374
|
+
className: Ie,
|
|
366
375
|
children: /* @__PURE__ */ a(
|
|
367
|
-
|
|
376
|
+
he,
|
|
368
377
|
{
|
|
369
|
-
icon: /* @__PURE__ */ a(
|
|
378
|
+
icon: /* @__PURE__ */ a(we, {}),
|
|
370
379
|
intent: S,
|
|
371
380
|
size: m,
|
|
372
|
-
"aria-label":
|
|
381
|
+
"aria-label": fe,
|
|
373
382
|
tabIndex: -1
|
|
374
383
|
}
|
|
375
384
|
)
|
|
376
385
|
}
|
|
377
386
|
),
|
|
378
|
-
|
|
387
|
+
E ? me : (
|
|
379
388
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- non-focusable wrapper; arrow-key roving bubbles up from the focusable IconButtons in the strip and the overflow trigger
|
|
380
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ T(
|
|
381
390
|
"div",
|
|
382
391
|
{
|
|
383
392
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
384
|
-
onKeyDown:
|
|
393
|
+
onKeyDown: M,
|
|
385
394
|
children: [
|
|
386
|
-
|
|
387
|
-
|
|
395
|
+
me,
|
|
396
|
+
pe
|
|
388
397
|
]
|
|
389
398
|
}
|
|
390
399
|
)
|
|
@@ -394,13 +403,13 @@ const ye = ze(
|
|
|
394
403
|
);
|
|
395
404
|
}
|
|
396
405
|
);
|
|
397
|
-
|
|
398
|
-
function
|
|
406
|
+
_e.displayName = "IconButtonGroup";
|
|
407
|
+
function Ge(d, y, m, c) {
|
|
399
408
|
if (d === "momentary" || !m) return {};
|
|
400
|
-
const i = d === "toggle-multi" ?
|
|
401
|
-
return
|
|
409
|
+
const i = d === "toggle-multi" ? c.includes(m) : c === m;
|
|
410
|
+
return y === "radiogroup" ? { ariaChecked: i } : { ariaPressed: i };
|
|
402
411
|
}
|
|
403
412
|
export {
|
|
404
|
-
|
|
413
|
+
_e as I
|
|
405
414
|
};
|
|
406
|
-
//# sourceMappingURL=icon-button-group-
|
|
415
|
+
//# sourceMappingURL=icon-button-group-VCCod3Hz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button-group-VCCod3Hz.js","sources":["../../src/components/icon-button-group/icon-button-group.tsx"],"sourcesContent":["import {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Ellipsis } from 'lucide-react';\nimport { IconButton, type IconButtonProps } from '../button/icon-button';\nimport type { ButtonProps } from '../button/button';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { usePriorityOverflow } from '../../hooks/use-priority-overflow';\n\ntype ButtonIntent = NonNullable<ButtonProps['intent']>;\n\n// Intentionally does NOT compose `@radix-ui/react-toggle-group`. Radix\n// ToggleGroup's render shape makes it hard to layer shared-border chrome\n// across children (first-child / last-child / internal-divider CSS), and\n// the three-mode + three-role matrix (group / toolbar / radiogroup × momentary\n// / toggle-single / toggle-multi) is broader than Radix's single / multi\n// contract. The roving-tabindex implementation below mirrors Radix's pattern\n// so keyboard semantics stay consistent. See 05-accessibility.mdx for the\n// WAI-ARIA toolbar / radiogroup references.\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst iconButtonGroupVariants = cva(\n [\n 'ds:inline-flex ds:isolate',\n // Hairline border around the group unifies the children into one\n // visual unit. Internal child dividers are drawn via the per-child\n // class list below.\n 'ds:border ds:border-border',\n 'ds:rounded-[var(--radius-md)]',\n // Ensure the focus ring of a pressed child sits above its siblings.\n 'ds:[&>*]:relative ds:[&>*:focus-visible]:z-10',\n ].join(' '),\n {\n variants: {\n orientation: {\n horizontal: [\n 'ds:flex-row',\n // Flatten internal corners on children so the outer radius owns\n // the rounded edges.\n 'ds:[&>*:not(:first-child)]:rounded-s-none',\n 'ds:[&>*:not(:last-child)]:rounded-e-none',\n // Internal divider — logical so it flips in RTL.\n 'ds:[&>*:not(:first-child)]:border-s',\n 'ds:[&>*:not(:first-child)]:border-border',\n // The children already own an outer border (from IconButton's\n // own border in secondary/outline variants). Collapse the doubled\n // border so we don't get a 2px seam.\n 'ds:[&>*]:border-0',\n ].join(' '),\n vertical: [\n 'ds:flex-col',\n // Vertical groups flow block-wise. Reading direction doesn't\n // invert vertical stacks in any locale this DS targets, so the\n // physical `rounded-t/b` is intentional.\n 'ds:[&>*:not(:first-child)]:rounded-t-none',\n 'ds:[&>*:not(:last-child)]:rounded-b-none',\n 'ds:[&>*:not(:first-child)]:border-t',\n 'ds:[&>*:not(:first-child)]:border-border',\n 'ds:[&>*]:border-0',\n ].join(' '),\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n },\n);\n\n// Hidden measurement rows: laid out (so widths are real) but invisible,\n// non-interactive and out of the a11y tree. Never display:none.\nconst MEASURE_ROW_CLASSES =\n 'ds:absolute ds:start-0 ds:top-0 ds:invisible ds:pointer-events-none';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type IconButtonGroupRole = 'group' | 'toolbar' | 'radiogroup';\nexport type IconButtonGroupMode =\n | 'momentary'\n | 'toggle-single'\n | 'toggle-multi';\n\ntype SharedPropsBase = {\n /** Forwarded to every child that does not set its own `size`. */\n size?: 'sm' | 'md' | 'lg';\n orientation?: 'horizontal' | 'vertical';\n /** Disables every child. Uses `aria-disabled` on children (not the HTML\n * attribute) so each child still takes focus — matches WAI-ARIA toolbar\n * guidance. Visual disabled styling picks up the `aria-disabled:*`\n * variant declared on the Button base class. */\n disabled?: boolean;\n /** Intent applied to every child that does not set its own `intent`.\n * Defaults to `outline` — grouped icon buttons are peers, not a row\n * of solid-primary CTAs. */\n intent?: ButtonIntent;\n /** `'menu'` keeps the strip on one line whatever the container width:\n * children that stop fitting move into a dropdown behind an ellipsis\n * trigger, preserving toggle semantics (radio / checkbox items). The\n * group then fills its container's inline size. Horizontal only.\n * Children set `data-overflow-pin` to always stay in the strip. */\n overflow?: 'none' | 'menu';\n children: ReactNode;\n};\n\n// At least one of `aria-label` / `aria-labelledby` must be present. This\n// discriminated pair makes the TypeScript compiler reject a group with\n// neither — see the a11y acceptance criteria in the user story.\ntype AccessibleNameProps =\n | { 'aria-label': string; 'aria-labelledby'?: never }\n | { 'aria-label'?: never; 'aria-labelledby': string };\n\ntype SharedProps = SharedPropsBase & AccessibleNameProps;\n\n// Role + mode combinations are not all valid. Encoded via a discriminated\n// union so the compiler rejects nonsensical pairings (e.g. a multi-select\n// radiogroup).\ntype GroupRoleProps =\n | { role?: 'group'; mode?: 'momentary' | 'toggle-single' | 'toggle-multi' }\n | { role: 'toolbar'; mode?: 'momentary' | 'toggle-single' | 'toggle-multi' }\n | { role: 'radiogroup'; mode: 'toggle-single' };\n\ntype MomentaryProps = SharedProps & {\n mode?: 'momentary';\n value?: never;\n defaultValue?: never;\n onValueChange?: never;\n};\n\ntype ToggleSingleProps = SharedProps & {\n mode: 'toggle-single';\n value?: string;\n defaultValue?: string;\n onValueChange?: (next: string) => void;\n};\n\ntype ToggleMultiProps = SharedProps & {\n mode: 'toggle-multi';\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (next: string[]) => void;\n};\n\nexport type IconButtonGroupProps = (\n | MomentaryProps\n | ToggleSingleProps\n | ToggleMultiProps\n) &\n GroupRoleProps &\n Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'onChange' | 'children'> &\n VariantProps<typeof iconButtonGroupVariants>;\n\n/* ------------------------------------------------------------------ */\n/* IconButtonGroup */\n/* ------------------------------------------------------------------ */\n\nexport const IconButtonGroup = forwardRef<HTMLDivElement, IconButtonGroupProps>(\n (props, ref) => {\n const {\n size,\n orientation = 'horizontal',\n role = 'group',\n mode = 'momentary',\n disabled = false,\n intent = 'outline',\n overflow = 'none',\n className,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n // Controlled-value props are consumed via `props as …` below; strip them\n // here so they never spread onto the root <div> (React would warn that\n // `onValueChange` is an unknown DOM event handler).\n value: _value,\n defaultValue: _defaultValue,\n onValueChange: _onValueChange,\n ...rest\n } = props as IconButtonGroupProps & { className?: string };\n const { t } = useTranslation();\n\n if (import.meta.env.DEV && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'IconButtonGroup: `aria-label` or `aria-labelledby` is required for accessibility.',\n );\n }\n if (\n import.meta.env.DEV &&\n overflow === 'menu' &&\n orientation === 'vertical'\n ) {\n console.warn(\n 'IconButtonGroup: overflow=\"menu\" is horizontal-only; falling back to overflow=\"none\".',\n );\n }\n const overflowEnabled = overflow === 'menu' && orientation !== 'vertical';\n\n /* ---- Controlled / uncontrolled value for toggle modes --------- */\n const [internalValue, setInternalValue] = useState<string | string[]>(\n () => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n return p.defaultValue ?? '';\n }\n if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n return p.defaultValue ?? [];\n }\n return '';\n },\n );\n\n const resolvedValue: string | string[] = (() => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n return p.value !== undefined ? p.value : internalValue;\n }\n if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n return p.value !== undefined ? p.value : internalValue;\n }\n return '';\n })();\n\n const commitValue = useCallback(\n (next: string | string[]) => {\n if (mode === 'toggle-single') {\n const p = props as ToggleSingleProps;\n if (p.value === undefined) setInternalValue(next as string);\n p.onValueChange?.(next as string);\n } else if (mode === 'toggle-multi') {\n const p = props as ToggleMultiProps;\n if (p.value === undefined) setInternalValue(next as string[]);\n p.onValueChange?.(next as string[]);\n }\n },\n [mode, props],\n );\n\n /* ---- Roving tabindex state — only active in toolbar / radiogroup - */\n const rovingTabindex = role === 'toolbar' || role === 'radiogroup';\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const [focusIndex, setFocusIndex] = useState(0);\n\n const registerIndex = useCallback(\n (index: number, el: HTMLButtonElement | null) => {\n buttonsRef.current[index] = el;\n },\n [],\n );\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [isRTL, setIsRTL] = useState(false);\n // `useLayoutEffect` so the direction is correct BEFORE the first paint\n // (otherwise a user pressing an arrow key on the first frame after mount\n // would hit the default-LTR mapping even in an RTL document).\n useIsomorphicLayoutEffect(() => {\n if (typeof window === 'undefined') return;\n const node = rootRef.current;\n if (!node) return;\n // Read the computed direction from the group's own wrapper so a\n // scoped `dir='rtl'` on any ancestor (not just <html>) flips arrow\n // navigation. `getComputedStyle` walks up automatically.\n const dir = window.getComputedStyle(node).direction;\n setIsRTL(dir === 'rtl');\n }, []);\n\n /* ---- Arrow-key navigation for roving tabindex ----------------- */\n const handleRootKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (!rovingTabindex) return;\n const count = buttonsRef.current.filter(Boolean).length;\n if (count === 0) return;\n\n const forwardKey =\n orientation === 'vertical'\n ? 'ArrowDown'\n : isRTL\n ? 'ArrowLeft'\n : 'ArrowRight';\n const backwardKey =\n orientation === 'vertical'\n ? 'ArrowUp'\n : isRTL\n ? 'ArrowRight'\n : 'ArrowLeft';\n\n let next: number | null = null;\n if (event.key === forwardKey) next = (focusIndex + 1) % count;\n else if (event.key === backwardKey)\n next = (focusIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n\n if (next === null) return;\n // Skip over disabled children.\n const maxAttempts = count;\n let attempts = 0;\n let candidate = next;\n while (attempts < maxAttempts) {\n const el = buttonsRef.current[candidate];\n if (\n el &&\n el.getAttribute('aria-disabled') !== 'true' &&\n !el.disabled\n ) {\n break;\n }\n candidate =\n event.key === backwardKey || event.key === 'End'\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n // WAI-ARIA radiogroup pattern: arrow keys MOVE focus AND CHANGE\n // the selected radio in one action. toolbar pattern (and plain\n // group) only moves focus.\n if (role === 'radiogroup' && mode === 'toggle-single') {\n const child = childArrayRef.current[candidate];\n if (child && typeof child === 'object' && 'props' in child) {\n const cValue = (child as ReactElement<{ value?: string }>).props\n .value;\n // Same guard as the click path: re-committing the already\n // selected value is a no-op, so Home/End on the selected radio\n // never fires a spurious onValueChange.\n if (cValue && cValue !== resolvedValue) commitValue(cValue);\n }\n }\n },\n [\n rovingTabindex,\n orientation,\n isRTL,\n focusIndex,\n role,\n mode,\n commitValue,\n resolvedValue,\n ],\n );\n\n /* ---- Overflow bookkeeping (menu mode only) --------------------- */\n type OverflowChildProps = IconButtonProps & {\n value?: string;\n 'data-overflow-pin'?: boolean | 'true' | '';\n };\n const allElements = overflowEnabled\n ? (Children.toArray(children).filter(isValidElement) as Array<\n ReactElement<OverflowChildProps>\n >)\n : [];\n const mirrorLabel = (child: ReactElement<OverflowChildProps>) => {\n const aria = child.props['aria-label'];\n if (typeof aria === 'string') return aria;\n return typeof child.props.tooltip === 'string'\n ? child.props.tooltip\n : null;\n };\n const warnedRef = useRef(false);\n const pinnedFlags = allElements.map((child) => {\n const explicit = child.props['data-overflow-pin'] !== undefined;\n const mirrorable = mirrorLabel(child) !== null;\n if (\n import.meta.env.DEV &&\n !explicit &&\n !mirrorable &&\n !warnedRef.current\n ) {\n warnedRef.current = true;\n console.warn(\n 'IconButtonGroup: a child without aria-label / tooltip cannot move into the overflow menu — it stays pinned in the strip.',\n );\n }\n return explicit || !mirrorable;\n });\n\n const { containerRef, fullRowRef, triggerProbeRef, visible, overflowing } =\n usePriorityOverflow({\n enabled: overflowEnabled,\n count: allElements.length,\n pinned: pinnedFlags,\n });\n\n const triggerNodeRef = useRef<HTMLButtonElement | null>(null);\n\n /* ---- Build enhanced children ---------------------------------- */\n const childArray = overflowEnabled\n ? allElements.filter((_, i) => visible[i])\n : Children.toArray(children);\n if (overflowEnabled) {\n buttonsRef.current.length = childArray.length + (overflowing ? 1 : 0);\n }\n // Mirror into a ref so the keydown handler (referenced from Memo deps)\n // can read the latest child list without inflating the dep array.\n const childArrayRef = useRef<ReturnType<typeof Children.toArray>>([]);\n childArrayRef.current = childArray;\n\n // APG radiogroup pattern: Tab must land on the CHECKED radio, not the\n // first one. Keep the roving tab stop pinned to the selected child —\n // covers initial mount (checked child not first) and controlled value\n // changes. Arrow/click interactions already align focusIndex with the\n // selection, so this effect is a no-op for them.\n const checkedIndex =\n role === 'radiogroup' && mode === 'toggle-single'\n ? childArray.findIndex(\n (child) =>\n isValidElement(child) &&\n (child as ReactElement<{ value?: string }>).props.value ===\n resolvedValue,\n )\n : -1;\n useEffect(() => {\n if (checkedIndex >= 0) setFocusIndex(checkedIndex);\n }, [checkedIndex]);\n\n const visibleCount = childArray.length;\n // Clamp the roving focus when items move into the menu; hand real focus\n // to the trigger only when the focused node was the one that left.\n useEffect(() => {\n if (!rovingTabindex || !overflowEnabled) return;\n const total = visibleCount + (overflowing ? 1 : 0);\n if (total > 0 && focusIndex >= total) {\n setFocusIndex(total - 1);\n if (document.activeElement === document.body) {\n triggerNodeRef.current?.focus();\n }\n }\n }, [\n rovingTabindex,\n overflowEnabled,\n visibleCount,\n overflowing,\n focusIndex,\n ]);\n\n /* The roving tabindex seeds at 0, but an HTML-disabled child takes\n no tabindex at all — if the first children are disabled (a Save\n that is not yet committable, say) Tab could not enter the group\n and its remaining buttons became unreachable. Seed on the first\n child that can actually hold focus; the arrow keys already skip\n disabled children the same way. */\n /* `loading` counts: Button renders `disabled={disabled || loading}`,\n so a leading loading child takes no tab stop either. */\n const childIsDisabled = (child: unknown): boolean => {\n if (!isValidElement(child)) return false;\n const props = (\n child as ReactElement<{\n disabled?: boolean;\n loading?: boolean;\n }>\n ).props;\n return props.disabled === true || props.loading === true;\n };\n const firstFocusable = childArray.findIndex((c) => !childIsDisabled(c));\n const effectiveFocusIndex = !childIsDisabled(childArray[focusIndex])\n ? focusIndex\n : firstFocusable !== -1\n ? firstFocusable\n : /* Every visible child is disabled: the overflow trigger is the\n only thing left that can hold focus. Without this the group\n has no tab stop at all and the menu is unreachable. */\n overflowing\n ? visibleCount\n : focusIndex;\n\n const enhanced = childArray.map((child, index) => {\n if (!isValidElement(child)) {\n if (import.meta.env.DEV) {\n console.warn(\n 'IconButtonGroup: children should be <IconButton> elements.',\n );\n }\n return child;\n }\n\n const childEl = child as ReactElement<\n IconButtonProps & {\n value?: string;\n asChild?: boolean;\n children?: ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n }\n >;\n\n // DEV-time sanity: warn if we got something that isn't an IconButton.\n // `React.cloneElement` would still work, but IconButton-specific\n // props (::before target size, forwarded tooltip) wouldn't apply.\n // `asChild` wrappers (e.g. DropdownMenu.Trigger) are fine when they\n // Slot-merge the cloned props onto their own IconButton child, as are\n // components that declare a static `rendersIconButton` marker (the\n // DataTable toolbar leaves — each renders one IconButton trigger and\n // forwards ref/tabIndex/onFocus to it).\n if (import.meta.env.DEV && childEl.type !== IconButton) {\n const slotChild =\n childEl.props.asChild === true ? childEl.props.children : null;\n const wrapsIconButton =\n isValidElement(slotChild) && slotChild.type === IconButton;\n const rendersIconButton =\n (childEl.type as { rendersIconButton?: boolean })\n .rendersIconButton === true;\n if (!wrapsIconButton && !rendersIconButton) {\n console.warn(\n 'IconButtonGroup: each child should be a DS <IconButton>. Other elements break target-size + focus-ring contracts.',\n );\n }\n }\n\n const childValue = childEl.props.value;\n\n // Compute aria-pressed / aria-checked for toggle modes.\n const { ariaPressed, ariaChecked } = computeToggleAria(\n mode,\n role,\n childValue,\n resolvedValue,\n );\n\n const groupDisabled = disabled === true;\n const childDisabled = childEl.props.disabled === true;\n\n // Click handling — wrap so aria-disabled (group-level) blocks\n // activation, then forward to the child's own onClick.\n const wrappedOnClick: React.MouseEventHandler<HTMLButtonElement> = (\n event,\n ) => {\n // aria-disabled is advisory; the native click still fires. Block\n // it explicitly when the GROUP (not the child) is disabled.\n if (groupDisabled) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n // Forward to the child's own handler first so consumers can run\n // analytics / preventDefault.\n childEl.props.onClick?.(event);\n if (event.defaultPrevented) return;\n if (!childValue) return;\n if (mode === 'toggle-single') {\n // Contract: exactly one pressed. Clicking the pressed one is a\n // no-op. This matches Radix ToggleGroup type='single' and the\n // radiogroup pattern.\n if (resolvedValue === childValue) return;\n commitValue(childValue);\n } else if (mode === 'toggle-multi') {\n const list = resolvedValue as string[];\n const next = list.includes(childValue)\n ? list.filter((v) => v !== childValue)\n : [...list, childValue];\n commitValue(next);\n }\n };\n\n // cloneElement's typed overload rejects `ref` as a prop, so we\n // build the override bag as `unknown` and cast to the element's\n // prop type. React at runtime routes `ref` via its usual channel.\n const setMergedRef = (node: HTMLButtonElement | null) => {\n registerIndex(index, node);\n const originalRef = (\n childEl as unknown as { ref?: React.Ref<HTMLButtonElement> }\n ).ref;\n if (typeof originalRef === 'function') originalRef(node);\n else if (\n originalRef !== null &&\n originalRef !== undefined &&\n typeof originalRef === 'object'\n ) {\n (\n originalRef as React.MutableRefObject<HTMLButtonElement | null>\n ).current = node;\n }\n };\n\n // Per the user story: group-level disabled injects `aria-disabled`\n // so the child stays focusable; child-level `disabled` still uses\n // the HTML attribute (child's own contract). When both are true\n // we leave the HTML disabled in place (strictest cue wins).\n const ariaDisabled = groupDisabled && !childDisabled ? true : undefined;\n\n // If the group is disabled OR we are in a toggle mode, we need the\n // wrapped click handler. In pure momentary mode with no group\n // disable, the child's own onClick is passed through unchanged.\n const needsWrappedClick = mode !== 'momentary' || groupDisabled;\n\n const overrides = {\n intent: childEl.props.intent ?? intent,\n size: childEl.props.size ?? size,\n disabled: childDisabled,\n 'aria-disabled': ariaDisabled,\n onClick: needsWrappedClick ? wrappedOnClick : childEl.props.onClick,\n 'aria-pressed': ariaPressed,\n 'aria-checked': ariaChecked,\n // When the group is a radiogroup, children must be `role=\"radio\"`\n // so screen readers announce them as radio buttons and so\n // `getByRole('radio')` works in tests. The button element is\n // re-purposed as a radio; `aria-checked` above carries the state.\n role: role === 'radiogroup' ? 'radio' : undefined,\n tabIndex: rovingTabindex\n ? index === effectiveFocusIndex\n ? 0\n : -1\n : undefined,\n onFocus: (ev: React.FocusEvent<HTMLButtonElement>) => {\n if (rovingTabindex) setFocusIndex(index);\n childEl.props.onFocus?.(ev);\n },\n ref: setMergedRef,\n } as unknown as Partial<IconButtonProps>;\n\n return cloneElement(childEl, overrides);\n });\n\n const mergedRootRef = (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref && typeof ref === 'object') {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n };\n\n if (!overflowEnabled) {\n return (\n <div\n ref={mergedRootRef}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-orientation={role === 'toolbar' ? orientation : undefined}\n onKeyDown={handleRootKeyDown}\n className={iconButtonGroupVariants({ orientation, className })}\n data-component=\"icon-button-group\"\n {...rest}\n >\n {enhanced}\n </div>\n );\n }\n\n /* ---- Menu path: measurement rows + strip + ellipsis trigger ---- */\n const moreLabel = t('buttonGroup.more', 'More options');\n const groupDisabled = disabled === true;\n const overflowItems = allElements\n .map((childEl, i) => ({ childEl, i }))\n .filter(({ i }) => !visible[i]);\n\n let menuContent: ReactNode = null;\n if (mode === 'toggle-single') {\n menuContent = (\n <DropdownMenu.RadioGroup\n value={resolvedValue as string}\n onValueChange={(v) => {\n if (!groupDisabled && v !== resolvedValue) commitValue(v);\n }}\n >\n {overflowItems.map(({ childEl, i }) => (\n <DropdownMenu.RadioItem\n key={childEl.key ?? i}\n value={childEl.props.value ?? ''}\n disabled={groupDisabled || childEl.props.disabled === true}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n );\n } else if (mode === 'toggle-multi') {\n menuContent = overflowItems.map(({ childEl, i }) => {\n const v = childEl.props.value;\n const list = resolvedValue as string[];\n const checked = v ? list.includes(v) : false;\n return (\n <DropdownMenu.CheckboxItem\n key={childEl.key ?? i}\n checked={checked}\n disabled={groupDisabled || childEl.props.disabled === true}\n onCheckedChange={() => {\n if (groupDisabled || !v) return;\n commitValue(checked ? list.filter((x) => x !== v) : [...list, v]);\n }}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.CheckboxItem>\n );\n });\n } else {\n menuContent = overflowItems.map(({ childEl, i }) => (\n <DropdownMenu.Item\n key={childEl.key ?? i}\n startIcon={childEl.props.icon}\n disabled={groupDisabled || childEl.props.disabled === true}\n onSelect={(event) => {\n childEl.props.onClick?.(\n event as unknown as React.MouseEvent<HTMLButtonElement>,\n );\n }}\n >\n {mirrorLabel(childEl)}\n </DropdownMenu.Item>\n ));\n }\n\n const trigger = overflowing ? (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n icon={<Ellipsis />}\n intent={intent}\n size={size}\n aria-label={moreLabel}\n ref={(node: HTMLButtonElement | null) => {\n triggerNodeRef.current = node;\n registerIndex(visibleCount, node);\n }}\n tabIndex={\n rovingTabindex\n ? effectiveFocusIndex === visibleCount\n ? 0\n : -1\n : undefined\n }\n onFocus={\n rovingTabindex ? () => setFocusIndex(visibleCount) : undefined\n }\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">{menuContent}</DropdownMenu.Content>\n </DropdownMenu.Root>\n ) : null;\n\n const stripClasses = iconButtonGroupVariants({ orientation });\n // A radiogroup may own only radios, so its trigger sits beside the strip;\n // toolbar / group keep the trigger inside as the last joined control.\n const triggerInside = role !== 'radiogroup';\n const stripDiv = (\n <div\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-orientation={role === 'toolbar' ? orientation : undefined}\n onKeyDown={triggerInside ? handleRootKeyDown : undefined}\n className={`${stripClasses} ds:max-w-full`}\n >\n {enhanced}\n {triggerInside ? trigger : null}\n </div>\n );\n\n return (\n <div\n ref={mergedRootRef}\n data-component=\"icon-button-group\"\n className={[\n 'ds:relative ds:block ds:w-full ds:min-w-0 ds:overflow-x-clip',\n className ?? '',\n ]\n .join(' ')\n .trim()}\n {...rest}\n >\n <div ref={containerRef} className=\"ds:block ds:w-full ds:min-w-0\">\n <div\n ref={fullRowRef}\n aria-hidden=\"true\"\n inert\n className={`${MEASURE_ROW_CLASSES} ${stripClasses}`}\n >\n {allElements.map((childEl, i) =>\n cloneElement(childEl, {\n key: childEl.key ?? i,\n intent: childEl.props.intent ?? intent,\n size: childEl.props.size ?? size,\n tabIndex: -1,\n ref: null,\n } as Partial<OverflowChildProps>),\n )}\n </div>\n <span\n ref={triggerProbeRef}\n aria-hidden=\"true\"\n inert\n className={MEASURE_ROW_CLASSES}\n >\n <IconButton\n icon={<Ellipsis />}\n intent={intent}\n size={size}\n aria-label={moreLabel}\n tabIndex={-1}\n />\n </span>\n {triggerInside ? (\n stripDiv\n ) : (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- non-focusable wrapper; arrow-key roving bubbles up from the focusable IconButtons in the strip and the overflow trigger\n <div\n className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n onKeyDown={handleRootKeyDown}\n >\n {stripDiv}\n {trigger}\n </div>\n )}\n </div>\n </div>\n );\n },\n);\n\nIconButtonGroup.displayName = 'IconButtonGroup';\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction computeToggleAria(\n mode: IconButtonGroupMode,\n role: IconButtonGroupRole,\n childValue: string | undefined,\n resolvedValue: string | string[],\n): { ariaPressed?: boolean; ariaChecked?: boolean } {\n if (mode === 'momentary' || !childValue) return {};\n\n const isActive =\n mode === 'toggle-multi'\n ? (resolvedValue as string[]).includes(childValue)\n : resolvedValue === childValue;\n\n // radiogroup uses aria-checked; toolbar/group use aria-pressed.\n if (role === 'radiogroup') {\n return { ariaChecked: isActive };\n }\n return { ariaPressed: isActive };\n}\n"],"names":["iconButtonGroupVariants","cva","MEASURE_ROW_CLASSES","IconButtonGroup","forwardRef","props","ref","size","orientation","role","mode","disabled","intent","overflow","className","children","ariaLabel","ariaLabelledBy","_value","_defaultValue","_onValueChange","rest","t","useTranslation","overflowEnabled","internalValue","setInternalValue","useState","resolvedValue","p","commitValue","useCallback","next","_a","_b","rovingTabindex","buttonsRef","useRef","focusIndex","setFocusIndex","registerIndex","index","el","rootRef","isRTL","setIsRTL","useIsomorphicLayoutEffect","node","dir","handleRootKeyDown","event","count","forwardKey","backwardKey","maxAttempts","attempts","candidate","child","childArrayRef","cValue","allElements","Children","isValidElement","mirrorLabel","aria","pinnedFlags","explicit","mirrorable","containerRef","fullRowRef","triggerProbeRef","visible","overflowing","usePriorityOverflow","triggerNodeRef","childArray","_","i","checkedIndex","useEffect","visibleCount","total","childIsDisabled","firstFocusable","c","effectiveFocusIndex","enhanced","childEl","childValue","ariaPressed","ariaChecked","computeToggleAria","groupDisabled","childDisabled","wrappedOnClick","list","v","setMergedRef","originalRef","ariaDisabled","needsWrappedClick","overrides","ev","cloneElement","mergedRootRef","jsx","moreLabel","overflowItems","menuContent","DropdownMenu","checked","x","trigger","jsxs","IconButton","Ellipsis","stripClasses","triggerInside","stripDiv","isActive"],"mappings":";;;;;;;;;AAsCA,MAAMA,KAA0BC;AAAA,EAC9B;AAAA,IACE;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,YAAY;AAAA,UACV;AAAA;AAAA;AAAA,UAGA;AAAA,UACA;AAAA;AAAA,UAEA;AAAA,UACA;AAAA;AAAA;AAAA;AAAA,UAIA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,UAAU;AAAA,UACR;AAAA;AAAA;AAAA;AAAA,UAIA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB;AAAA,MACf,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAIMC,KACJ,uEAqFWC,KAAkBC;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,MAAAC;AAAA,MACA,aAAAC,IAAc;AAAA,MACd,MAAAC,IAAO;AAAA,MACP,MAAAC,IAAO;AAAA,MACP,UAAAC,IAAW;AAAA,MACX,QAAAC,IAAS;AAAA,MACT,UAAAC,KAA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