@flamingo-stack/openframe-frontend-core 0.0.717 → 0.0.718
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/{chunk-3MJPCKB6.js → chunk-45F7PXUI.js} +2 -2
- package/dist/{chunk-TYVS64YN.js → chunk-67QBMN4R.js} +1 -1
- package/dist/{chunk-3RKBJT6K.cjs → chunk-6A43ZDWV.cjs} +2 -2
- package/dist/chunk-A6P6DHEZ.cjs +130 -0
- package/dist/{chunk-M2A5SC6H.cjs → chunk-BOTM373R.cjs} +2 -2
- package/dist/{chunk-X3RVDBXU.cjs → chunk-BWIN42ZA.cjs} +15 -15
- package/dist/{chunk-6MZI5SQ4.js → chunk-DCD5WZUF.js} +3 -3
- package/dist/{chunk-2EK7PA73.js → chunk-DEZDMTBM.js} +4 -4
- package/dist/{chunk-NB6EWUDE.cjs → chunk-DXCBOZVT.cjs} +13 -13
- package/dist/{chunk-J3Q53TWW.cjs → chunk-EZC2F5OT.cjs} +22 -22
- package/dist/{chunk-2AI2E3O2.cjs → chunk-GN4A7PMB.cjs} +27 -27
- package/dist/{chunk-6T3BTD6Q.js → chunk-IWCPXJEE.js} +201 -327
- package/dist/{chunk-2X2P3VHF.js → chunk-JIWMBIVZ.js} +4 -4
- package/dist/{chunk-NPAQSMRY.js → chunk-LOYPRJWA.js} +1053 -357
- package/dist/{chunk-U3TP4UGA.cjs → chunk-MIQLUUVF.cjs} +6 -6
- package/dist/{chunk-FGKSAQR3.js → chunk-MM7MCIXL.js} +4 -4
- package/dist/{chunk-B5XU6KOA.js → chunk-N2PF5CFX.js} +4836 -5424
- package/dist/{chunk-LANNTTKP.cjs → chunk-NDZ5ZXOQ.cjs} +6 -6
- package/dist/{chunk-WH5GJSID.js → chunk-PQ6HBLZ7.js} +3 -3
- package/dist/{chunk-FROXS52D.cjs → chunk-QBCDSTLE.cjs} +2 -2
- package/dist/{chunk-NQWJAOHO.js → chunk-QXZCLQNV.js} +1 -1
- package/dist/{chunk-3QAMMWV2.cjs → chunk-S2FUFMLW.cjs} +20 -20
- package/dist/{chunk-PD4W2VMH.js → chunk-SGFTTJKO.js} +1 -1
- package/dist/{chunk-E6FLX4TX.js → chunk-TBCZCRQ5.js} +5 -5
- package/dist/{chunk-OHLBO4LM.cjs → chunk-WALCXC7J.cjs} +3 -3
- package/dist/{chunk-VZI5BA4L.js → chunk-XGHGGBM3.js} +1 -1
- package/dist/{chunk-VYKFM2NB.cjs → chunk-YC5COB5V.cjs} +32 -32
- package/dist/{chunk-47FISYO5.js → chunk-YEMCCYIF.js} +2 -2
- package/dist/chunk-YYYVS7CX.js +130 -0
- package/dist/{chunk-5MF3NMYC.cjs → chunk-Z3CVSPO3.cjs} +581 -1169
- package/dist/{chunk-PPXR22YC.cjs → chunk-Z5UWW3Z2.cjs} +707 -11
- package/dist/{chunk-JO5TLJPM.cjs → chunk-ZXCZYMN4.cjs} +37 -163
- package/dist/{cloud-tenants-KDWTVHSI.cjs → cloud-tenants-PFDF7O5U.cjs} +5 -4
- package/dist/{cloud-tenants-LNC26WY2.js → cloud-tenants-TAKOWXLD.js} +4 -3
- package/dist/components/case-studies/index.cjs +13 -12
- package/dist/components/case-studies/index.js +5 -4
- package/dist/components/contact/index.cjs +6 -5
- package/dist/components/contact/index.js +5 -4
- package/dist/components/docs/index.cjs +8 -7
- package/dist/components/docs/index.js +7 -6
- package/dist/components/embeds/index.cjs +6 -5
- package/dist/components/embeds/index.js +5 -4
- package/dist/components/faq/index.cjs +6 -5
- package/dist/components/faq/index.js +5 -4
- package/dist/components/features/index.cjs +9 -4
- package/dist/components/features/index.js +8 -3
- package/dist/components/features/remote-session/index.d.ts +2 -0
- package/dist/components/features/remote-session/index.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-session-keep-modals.d.ts +3 -3
- package/dist/components/features/remote-session/remote-session-keep-modals.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-session-ticket-modals.d.ts +29 -0
- package/dist/components/features/remote-session/remote-session-ticket-modals.d.ts.map +1 -0
- package/dist/components/help-center-pages/index.cjs +48 -47
- package/dist/components/help-center-pages/index.js +14 -13
- package/dist/components/index.cjs +30 -25
- package/dist/components/index.js +19 -14
- package/dist/components/meeting-scheduler/index.cjs +25 -24
- package/dist/components/meeting-scheduler/index.js +4 -3
- package/dist/components/navigation/index.cjs +6 -5
- package/dist/components/navigation/index.js +5 -4
- package/dist/components/onboarding-guides/index.cjs +8 -7
- package/dist/components/onboarding-guides/index.js +7 -6
- package/dist/components/product-demo/index.cjs +7 -7
- package/dist/components/product-demo/index.js +7 -7
- package/dist/components/tickets/index.cjs +8 -7
- package/dist/components/tickets/index.js +7 -6
- package/dist/components/ui/autocomplete.d.ts +6 -0
- package/dist/components/ui/autocomplete.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +7 -6
- package/dist/components/ui/index.js +6 -5
- package/dist/{devices-ATHYJUVQ.cjs → devices-KRCGZMGA.cjs} +6 -5
- package/dist/{devices-NYCRQ3PG.js → devices-LHEX7O5T.js} +4 -3
- package/dist/hooks/index.cjs +6 -4
- package/dist/hooks/index.js +5 -3
- package/dist/index.cjs +14 -8
- package/dist/index.js +15 -9
- package/dist/{knowledge-EHNRYT7U.cjs → knowledge-KLVPVEYZ.cjs} +5 -4
- package/dist/{knowledge-DEKYJXBS.js → knowledge-RZSFNR33.js} +4 -3
- package/dist/{logs-Q7YFIVYI.js → logs-E5DOV5JO.js} +4 -3
- package/dist/{logs-3V765P7O.cjs → logs-OX3XTVL2.cjs} +13 -12
- package/dist/{policies-TXU5AIXS.cjs → policies-FOSCIZGK.cjs} +9 -8
- package/dist/{policies-BTIENK5A.js → policies-MC2S4S5G.js} +4 -3
- package/dist/{remote-session-R6VAFESR.cjs → remote-session-DRFE5XZE.cjs} +4 -3
- package/dist/{remote-session-GSGZOFDX.js → remote-session-JQ2BPIE3.js} +2 -1
- package/dist/{software-update-SW2HOBHW.js → software-update-D4OEIH65.js} +6 -4
- package/dist/{software-update-MINTICZY.cjs → software-update-HOBSTWVO.cjs} +11 -9
- package/package.json +1 -1
- package/src/components/features/remote-session/index.ts +2 -0
- package/src/components/features/remote-session/remote-session-keep-modals.tsx +4 -4
- package/src/components/features/remote-session/remote-session-ticket-modals.tsx +140 -0
- package/src/components/ui/autocomplete.tsx +18 -4
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
var _chunkA6P6DHEZcjs = require('./chunk-A6P6DHEZ.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
|
|
@@ -51,6 +55,8 @@ var _chunkLLSUVPQCcjs = require('./chunk-LLSUVPQC.cjs');
|
|
|
51
55
|
|
|
52
56
|
|
|
53
57
|
|
|
58
|
+
|
|
59
|
+
|
|
54
60
|
|
|
55
61
|
|
|
56
62
|
|
|
@@ -82,8 +88,63 @@ var _chunkCPA2CKRZcjs = require('./chunk-CPA2CKRZ.cjs');
|
|
|
82
88
|
|
|
83
89
|
var _chunk3ATAYP36cjs = require('./chunk-3ATAYP36.cjs');
|
|
84
90
|
|
|
85
|
-
// src/components/ui/
|
|
91
|
+
// src/components/ui/hidden-tags-popup.tsx
|
|
92
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
86
93
|
var _jsxruntime = require('react/jsx-runtime');
|
|
94
|
+
var HiddenTagsPopup = _react.forwardRef.call(void 0, function HiddenTagsPopupImpl({ items, onRemove, disabled, className, style }, ref) {
|
|
95
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
ref,
|
|
99
|
+
style,
|
|
100
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
101
|
+
// Base positioning is neutral (left-anchored); consumers override via
|
|
102
|
+
// `style.left` (search-input, tag-search-input) or `className` (autocomplete).
|
|
103
|
+
"absolute left-0 top-full z-50 mt-1 min-w-[200px]",
|
|
104
|
+
"rounded-[6px] border border-ods-border bg-ods-card shadow-lg",
|
|
105
|
+
"duration-150 animate-in fade-in-0 zoom-in-95",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
112
|
+
"flex h-11 items-center justify-between gap-3 px-3 md:h-12",
|
|
113
|
+
"border-b border-ods-border last:border-b-0"
|
|
114
|
+
),
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
className: "min-w-0 flex-1 truncate uppercase text-ods-text-primary text-h5",
|
|
120
|
+
title: typeof item.label === "string" ? item.label : void 0,
|
|
121
|
+
children: item.label
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
!disabled && onRemove && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
onClick: (e) => {
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
onRemove(item.value);
|
|
131
|
+
},
|
|
132
|
+
className: "shrink-0 text-ods-text-secondary transition-colors hover:text-ods-text-primary",
|
|
133
|
+
"aria-label": `Remove ${String(item.label)}`,
|
|
134
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVX4E6YSBcjs.XmarkCircleIcon, { size: 20 })
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
String(item.value)
|
|
140
|
+
))
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
HiddenTagsPopup.displayName = "HiddenTagsPopup";
|
|
145
|
+
|
|
146
|
+
// src/components/ui/truncate-text.tsx
|
|
147
|
+
|
|
87
148
|
var VARIANT_CLASS = {
|
|
88
149
|
h1: "text-h1",
|
|
89
150
|
h2: "text-h2",
|
|
@@ -145,10 +206,555 @@ function TruncateText({
|
|
|
145
206
|
);
|
|
146
207
|
}
|
|
147
208
|
|
|
209
|
+
// src/components/ui/autocomplete.tsx
|
|
210
|
+
var _reactpopover = require('@radix-ui/react-popover'); var PopoverPrimitive = _interopRequireWildcard(_reactpopover);
|
|
211
|
+
var _reactscrollarea = require('@radix-ui/react-scroll-area'); var ScrollAreaPrimitive = _interopRequireWildcard(_reactscrollarea);
|
|
212
|
+
var _lucidereact = require('lucide-react');
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
var innerInputStyles = _chunk3ATAYP36cjs.cn.call(void 0,
|
|
223
|
+
"min-w-[60px] flex-1 border-none bg-transparent outline-none",
|
|
224
|
+
"text-h4",
|
|
225
|
+
"text-ods-text-primary placeholder:text-ods-text-secondary",
|
|
226
|
+
// Disabled - match Input exactly (value greys out, placeholder dims further)
|
|
227
|
+
"disabled:cursor-not-allowed disabled:text-ods-text-disabled disabled:placeholder:text-ods-border"
|
|
228
|
+
);
|
|
229
|
+
function AutocompleteInner(props, ref) {
|
|
230
|
+
const {
|
|
231
|
+
options,
|
|
232
|
+
disabled = false,
|
|
233
|
+
startAdornment,
|
|
234
|
+
showClearAll = true,
|
|
235
|
+
className,
|
|
236
|
+
dropdownClassName,
|
|
237
|
+
freeSolo = false,
|
|
238
|
+
label,
|
|
239
|
+
labelVariant,
|
|
240
|
+
error,
|
|
241
|
+
filterOptions,
|
|
242
|
+
renderOption,
|
|
243
|
+
invalid = false,
|
|
244
|
+
noOptionsText = "No options",
|
|
245
|
+
inputValue: inputValueProp,
|
|
246
|
+
onInputChange,
|
|
247
|
+
loading = false,
|
|
248
|
+
loadingText = "Loading...",
|
|
249
|
+
creatable = false,
|
|
250
|
+
onCreateOption,
|
|
251
|
+
maxCreateLength,
|
|
252
|
+
onDeleteOption,
|
|
253
|
+
isDeletingOption = false,
|
|
254
|
+
disableClientFilter = false,
|
|
255
|
+
showChevron = true,
|
|
256
|
+
clearOnOpen = true
|
|
257
|
+
} = props;
|
|
258
|
+
const multiple = _nullishCoalesce(props.multiple, () => ( false));
|
|
259
|
+
const placeholder = _nullishCoalesce(props.placeholder, () => ( (multiple ? "Add More..." : "Select...")));
|
|
260
|
+
const maxItems = multiple ? props.maxItems : void 0;
|
|
261
|
+
const renderTag = multiple ? props.renderTag : void 0;
|
|
262
|
+
const wrapTags = multiple && (_nullishCoalesce(props.wrapTags, () => ( false)));
|
|
263
|
+
const limitTagsProp = multiple ? _nullishCoalesce(props.limitTags, () => ( "auto")) : "auto";
|
|
264
|
+
const getLimitTagsText = multiple ? _nullishCoalesce(props.getLimitTagsText, () => ( ((more) => `+${more}`))) : (more) => `+${more}`;
|
|
265
|
+
const valueArray = _react.useMemo.call(void 0,
|
|
266
|
+
() => multiple ? props.value : props.value != null ? [props.value] : [],
|
|
267
|
+
[multiple, props.value]
|
|
268
|
+
);
|
|
269
|
+
const [internalInputValue, setInternalInputValue] = _react.useState.call(void 0, "");
|
|
270
|
+
const isInputControlled = inputValueProp !== void 0;
|
|
271
|
+
const inputValue = isInputControlled ? inputValueProp : internalInputValue;
|
|
272
|
+
const updateInputValue = (value, reason) => {
|
|
273
|
+
if (!isInputControlled) {
|
|
274
|
+
setInternalInputValue(value);
|
|
275
|
+
}
|
|
276
|
+
_optionalChain([onInputChange, 'optionalCall', _ => _(value, reason)]);
|
|
277
|
+
};
|
|
278
|
+
const [isOpen, setIsOpen] = _react.useState.call(void 0, false);
|
|
279
|
+
const [highlightedIndex, setHighlightedIndex] = _react.useState.call(void 0, -1);
|
|
280
|
+
const keyboardPadding = _chunkA6P6DHEZcjs.useKeyboardCollisionPadding.call(void 0, );
|
|
281
|
+
const containerRef = _react.useRef.call(void 0, null);
|
|
282
|
+
const hiddenTagsPopupRef = _react.useRef.call(void 0, null);
|
|
283
|
+
const isInvalid = invalid || !!error;
|
|
284
|
+
_react.useImperativeHandle.call(void 0, ref, () => containerRef.current);
|
|
285
|
+
const selectedOptions = _react.useMemo.call(void 0, () => {
|
|
286
|
+
return valueArray.map((v) => _nullishCoalesce(options.find((opt) => opt.value === v), () => ( { label: String(v), value: v })));
|
|
287
|
+
}, [valueArray, options]);
|
|
288
|
+
const selectedOption = !multiple && selectedOptions.length > 0 ? selectedOptions[0] : null;
|
|
289
|
+
const resolvedStartAdornment = _nullishCoalesce(_nullishCoalesce(startAdornment, () => ( _optionalChain([selectedOption, 'optionalAccess', _2 => _2.icon]))), () => ( null));
|
|
290
|
+
const inputPlaceholder = multiple ? valueArray.length === 0 ? placeholder : "Add More..." : placeholder;
|
|
291
|
+
const {
|
|
292
|
+
visibleCount: autoVisibleCount,
|
|
293
|
+
middleRef,
|
|
294
|
+
measureRef,
|
|
295
|
+
textMeasureRef,
|
|
296
|
+
badgeRef,
|
|
297
|
+
inputRef
|
|
298
|
+
} = _chunkA6P6DHEZcjs.useAutoLimitTags.call(void 0, {
|
|
299
|
+
count: multiple ? selectedOptions.length : 0,
|
|
300
|
+
limitTags: multiple ? wrapTags ? selectedOptions.length : limitTagsProp : 0,
|
|
301
|
+
placeholder: inputPlaceholder
|
|
302
|
+
});
|
|
303
|
+
const visibleCount = multiple ? autoVisibleCount : 0;
|
|
304
|
+
const visibleTags = multiple ? selectedOptions.slice(0, visibleCount) : [];
|
|
305
|
+
const hiddenTags = multiple ? selectedOptions.slice(visibleCount) : [];
|
|
306
|
+
const hiddenTagsCount = multiple ? selectedOptions.length - visibleCount : 0;
|
|
307
|
+
const [showHiddenTags, setShowHiddenTags] = _react.useState.call(void 0, false);
|
|
308
|
+
const hiddenTagsRef = _react.useRef.call(void 0, null);
|
|
309
|
+
_react.useEffect.call(void 0, () => {
|
|
310
|
+
if (!showHiddenTags) return void 0;
|
|
311
|
+
const handleClick = (e) => {
|
|
312
|
+
const target = e.target;
|
|
313
|
+
const inButton = _optionalChain([hiddenTagsRef, 'access', _3 => _3.current, 'optionalAccess', _4 => _4.contains, 'call', _5 => _5(target)]);
|
|
314
|
+
const inPopup = _optionalChain([hiddenTagsPopupRef, 'access', _6 => _6.current, 'optionalAccess', _7 => _7.contains, 'call', _8 => _8(target)]);
|
|
315
|
+
if (!inButton && !inPopup) {
|
|
316
|
+
setShowHiddenTags(false);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
document.addEventListener("mousedown", handleClick);
|
|
320
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
321
|
+
}, [showHiddenTags]);
|
|
322
|
+
const openDropdown = () => {
|
|
323
|
+
if (!multiple && !clearOnOpen && selectedOption) {
|
|
324
|
+
updateInputValue(selectedOption.label, "reset");
|
|
325
|
+
}
|
|
326
|
+
setShowHiddenTags(false);
|
|
327
|
+
setIsOpen(true);
|
|
328
|
+
};
|
|
329
|
+
const inputDisplayValue = !multiple && !isOpen && selectedOption ? selectedOption.label : inputValue;
|
|
330
|
+
const filteredOptions = _react.useMemo.call(void 0, () => {
|
|
331
|
+
if (disableClientFilter) {
|
|
332
|
+
return options;
|
|
333
|
+
}
|
|
334
|
+
if (filterOptions) {
|
|
335
|
+
return filterOptions(options, inputValue);
|
|
336
|
+
}
|
|
337
|
+
if (!inputValue.trim()) {
|
|
338
|
+
return options;
|
|
339
|
+
}
|
|
340
|
+
const lowerInput = inputValue.toLowerCase();
|
|
341
|
+
return options.filter((opt) => opt.label.toLowerCase().includes(lowerInput));
|
|
342
|
+
}, [options, inputValue, filterOptions, disableClientFilter]);
|
|
343
|
+
const showCreateOption = creatable && inputValue.trim().length > 0 && filteredOptions.length === 0;
|
|
344
|
+
const isCreateTooLong = maxCreateLength != null && inputValue.trim().length > maxCreateLength;
|
|
345
|
+
const handleCreate = () => {
|
|
346
|
+
const trimmed = inputValue.trim();
|
|
347
|
+
if (!trimmed || maxCreateLength != null && trimmed.length > maxCreateLength) return;
|
|
348
|
+
const newValue = trimmed;
|
|
349
|
+
if (multiple) {
|
|
350
|
+
if (maxItems && valueArray.length >= maxItems) return;
|
|
351
|
+
props.onChange([...valueArray, newValue]);
|
|
352
|
+
} else {
|
|
353
|
+
props.onChange(newValue);
|
|
354
|
+
}
|
|
355
|
+
updateInputValue("", "reset");
|
|
356
|
+
setIsOpen(false);
|
|
357
|
+
_optionalChain([onCreateOption, 'optionalCall', _9 => _9(trimmed)]);
|
|
358
|
+
};
|
|
359
|
+
const [highlightedFor, setHighlightedFor] = _react.useState.call(void 0, filteredOptions.length);
|
|
360
|
+
if (highlightedFor !== filteredOptions.length) {
|
|
361
|
+
setHighlightedFor(filteredOptions.length);
|
|
362
|
+
setHighlightedIndex(-1);
|
|
363
|
+
}
|
|
364
|
+
const handleInputChange = (e) => {
|
|
365
|
+
updateInputValue(e.target.value, "input");
|
|
366
|
+
if (!isOpen) {
|
|
367
|
+
setIsOpen(true);
|
|
368
|
+
}
|
|
369
|
+
setHighlightedIndex(-1);
|
|
370
|
+
};
|
|
371
|
+
const handleSelect = (option) => {
|
|
372
|
+
if (multiple) {
|
|
373
|
+
const isSelected = valueArray.includes(option.value);
|
|
374
|
+
if (isSelected) {
|
|
375
|
+
props.onChange(valueArray.filter((v) => v !== option.value));
|
|
376
|
+
} else {
|
|
377
|
+
if (maxItems && valueArray.length >= maxItems) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
props.onChange([...valueArray, option.value]);
|
|
381
|
+
}
|
|
382
|
+
updateInputValue("", "reset");
|
|
383
|
+
_optionalChain([inputRef, 'access', _10 => _10.current, 'optionalAccess', _11 => _11.focus, 'call', _12 => _12()]);
|
|
384
|
+
} else {
|
|
385
|
+
props.onChange(option.value);
|
|
386
|
+
updateInputValue(clearOnOpen ? "" : option.label, "reset");
|
|
387
|
+
setIsOpen(false);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
const handleClearAll = (e) => {
|
|
391
|
+
e.stopPropagation();
|
|
392
|
+
e.preventDefault();
|
|
393
|
+
if (multiple) {
|
|
394
|
+
props.onChange([]);
|
|
395
|
+
} else {
|
|
396
|
+
props.onChange(null);
|
|
397
|
+
}
|
|
398
|
+
if (!isInputControlled) {
|
|
399
|
+
setInternalInputValue("");
|
|
400
|
+
}
|
|
401
|
+
_optionalChain([onInputChange, 'optionalCall', _13 => _13("", "clear")]);
|
|
402
|
+
setIsOpen(false);
|
|
403
|
+
};
|
|
404
|
+
const handleKeyDown = (e) => {
|
|
405
|
+
switch (e.key) {
|
|
406
|
+
case "ArrowDown":
|
|
407
|
+
e.preventDefault();
|
|
408
|
+
if (!isOpen) {
|
|
409
|
+
openDropdown();
|
|
410
|
+
}
|
|
411
|
+
setHighlightedIndex((prev) => prev < filteredOptions.length - 1 ? prev + 1 : 0);
|
|
412
|
+
break;
|
|
413
|
+
case "ArrowUp":
|
|
414
|
+
e.preventDefault();
|
|
415
|
+
setHighlightedIndex((prev) => prev > 0 ? prev - 1 : filteredOptions.length - 1);
|
|
416
|
+
break;
|
|
417
|
+
case "Enter":
|
|
418
|
+
e.preventDefault();
|
|
419
|
+
if (showCreateOption) {
|
|
420
|
+
handleCreate();
|
|
421
|
+
} else if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {
|
|
422
|
+
handleSelect(filteredOptions[highlightedIndex]);
|
|
423
|
+
} else if (freeSolo && inputValue.trim()) {
|
|
424
|
+
const newOption = {
|
|
425
|
+
label: inputValue.trim(),
|
|
426
|
+
value: inputValue.trim()
|
|
427
|
+
};
|
|
428
|
+
handleSelect(newOption);
|
|
429
|
+
}
|
|
430
|
+
break;
|
|
431
|
+
case "Escape": {
|
|
432
|
+
const resetValue = !multiple && !clearOnOpen && selectedOption ? selectedOption.label : "";
|
|
433
|
+
updateInputValue(resetValue, "reset");
|
|
434
|
+
setIsOpen(false);
|
|
435
|
+
setHighlightedIndex(-1);
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
case "Backspace":
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
const handleOpenChange = (open) => {
|
|
443
|
+
if (open) {
|
|
444
|
+
openDropdown();
|
|
445
|
+
} else {
|
|
446
|
+
const resetValue = !multiple && !clearOnOpen && selectedOption ? selectedOption.label : "";
|
|
447
|
+
updateInputValue(resetValue, "reset");
|
|
448
|
+
setIsOpen(false);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
const canAddMore = multiple ? !maxItems || valueArray.length < maxItems : true;
|
|
452
|
+
const hasValue = valueArray.length > 0;
|
|
453
|
+
const popover = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, PopoverPrimitive.Root, { open: isOpen, onOpenChange: handleOpenChange, modal: false, children: [
|
|
454
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PopoverPrimitive.Anchor, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
455
|
+
"div",
|
|
456
|
+
{
|
|
457
|
+
"data-invalid": isInvalid || void 0,
|
|
458
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
459
|
+
// Layout — single line, no wrapping
|
|
460
|
+
"flex min-h-11 cursor-text items-center rounded-[6px] border md:min-h-12",
|
|
461
|
+
"focus-within:outline-none",
|
|
462
|
+
"transition-colors duration-200",
|
|
463
|
+
"border-ods-border bg-ods-card",
|
|
464
|
+
"group",
|
|
465
|
+
!disabled && "hover:border-ods-border-hover hover:bg-ods-bg-hover active:border-ods-border-active active:bg-ods-bg-active",
|
|
466
|
+
disabled && "!cursor-not-allowed bg-ods-bg",
|
|
467
|
+
// Adornments / chevron carry their own colour — grey them with the
|
|
468
|
+
// value so a disabled field reads as one flat colour. Scoped to the
|
|
469
|
+
// DIRECT span child (the start adornment) on purpose: as a descendant
|
|
470
|
+
// rule it also hit the selected `Tag` chips in the middle zone, whose
|
|
471
|
+
// label is a span, and they went invisible against their own fill in
|
|
472
|
+
// the light theme. Anything nested inside the adornment that sets its
|
|
473
|
+
// own colour keeps it; anything that doesn't inherits the grey.
|
|
474
|
+
"has-[:disabled]:[&>span]:text-ods-text-disabled has-[:disabled]:[&_svg]:text-ods-text-disabled",
|
|
475
|
+
isOpen && !isInvalid && "border-ods-accent hover:border-ods-accent",
|
|
476
|
+
isInvalid && "border-ods-error hover:border-ods-error"
|
|
477
|
+
),
|
|
478
|
+
onClick: () => {
|
|
479
|
+
if (!disabled) {
|
|
480
|
+
_optionalChain([inputRef, 'access', _14 => _14.current, 'optionalAccess', _15 => _15.focus, 'call', _16 => _16()]);
|
|
481
|
+
openDropdown();
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
children: [
|
|
485
|
+
resolvedStartAdornment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
486
|
+
"span",
|
|
487
|
+
{
|
|
488
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
489
|
+
// Images are sized alongside svgs: an entity adornment is
|
|
490
|
+
// usually a flag or a crest, and an unconstrained <img> lays
|
|
491
|
+
// out at 0x0 inside this flex row.
|
|
492
|
+
"flex-shrink-0 pl-3 text-ods-text-secondary transition-colors duration-200",
|
|
493
|
+
"[&_img]:size-4 [&_img]:object-contain md:[&_img]:size-6 [&_svg]:size-4 md:[&_svg]:size-6",
|
|
494
|
+
isOpen && !isInvalid && "text-ods-accent",
|
|
495
|
+
isInvalid && "text-ods-error"
|
|
496
|
+
),
|
|
497
|
+
children: resolvedStartAdornment
|
|
498
|
+
}
|
|
499
|
+
),
|
|
500
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
501
|
+
"div",
|
|
502
|
+
{
|
|
503
|
+
ref: middleRef,
|
|
504
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
505
|
+
"flex min-w-0 flex-1 items-center gap-2 px-2",
|
|
506
|
+
wrapTags ? "flex-wrap py-[var(--spacing-system-xsf)]" : "overflow-hidden"
|
|
507
|
+
),
|
|
508
|
+
children: [
|
|
509
|
+
multiple && visibleTags.map((option) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
510
|
+
_chunkF5BPGWGTcjs.Tag,
|
|
511
|
+
{
|
|
512
|
+
variant: "outline",
|
|
513
|
+
className: wrapTags ? "max-w-full" : void 0,
|
|
514
|
+
labelClassName: wrapTags ? "truncate" : "max-w-[90px] truncate",
|
|
515
|
+
label: renderTag ? renderTag(option) : option.label,
|
|
516
|
+
onClose: !disabled ? () => {
|
|
517
|
+
props.onChange(valueArray.filter((v) => v !== option.value));
|
|
518
|
+
} : void 0
|
|
519
|
+
},
|
|
520
|
+
String(option.value)
|
|
521
|
+
)),
|
|
522
|
+
multiple && hiddenTagsCount > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: hiddenTagsRef, className: "shrink-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
523
|
+
"button",
|
|
524
|
+
{
|
|
525
|
+
ref: badgeRef,
|
|
526
|
+
type: "button",
|
|
527
|
+
onClick: (e) => {
|
|
528
|
+
e.stopPropagation();
|
|
529
|
+
setShowHiddenTags((prev) => {
|
|
530
|
+
if (!prev) setIsOpen(false);
|
|
531
|
+
return !prev;
|
|
532
|
+
});
|
|
533
|
+
},
|
|
534
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
535
|
+
"flex h-8 items-center px-2",
|
|
536
|
+
"rounded-[6px] border border-ods-border bg-ods-card",
|
|
537
|
+
"text-ods-text-secondary text-h5",
|
|
538
|
+
"cursor-pointer transition-colors hover:bg-ods-bg-hover"
|
|
539
|
+
),
|
|
540
|
+
children: getLimitTagsText(hiddenTagsCount)
|
|
541
|
+
}
|
|
542
|
+
) }),
|
|
543
|
+
canAddMore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
544
|
+
"input",
|
|
545
|
+
{
|
|
546
|
+
ref: inputRef,
|
|
547
|
+
type: "text",
|
|
548
|
+
value: inputDisplayValue,
|
|
549
|
+
onChange: handleInputChange,
|
|
550
|
+
onKeyDown: handleKeyDown,
|
|
551
|
+
onFocus: () => openDropdown(),
|
|
552
|
+
placeholder: inputPlaceholder,
|
|
553
|
+
disabled,
|
|
554
|
+
className: innerInputStyles
|
|
555
|
+
}
|
|
556
|
+
)
|
|
557
|
+
]
|
|
558
|
+
}
|
|
559
|
+
),
|
|
560
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex shrink-0 items-center gap-1 pr-3", children: [
|
|
561
|
+
showClearAll && (hasValue || inputValue.length > 0) && !disabled && isOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
562
|
+
"button",
|
|
563
|
+
{
|
|
564
|
+
type: "button",
|
|
565
|
+
onClick: handleClearAll,
|
|
566
|
+
className: "flex items-center justify-center transition-opacity hover:opacity-70",
|
|
567
|
+
"aria-label": "Clear all",
|
|
568
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVX4E6YSBcjs.XmarkCircleIcon, { className: "size-4 text-ods-text-secondary md:size-6" })
|
|
569
|
+
}
|
|
570
|
+
),
|
|
571
|
+
loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
572
|
+
_lucidereact.Loader2,
|
|
573
|
+
{
|
|
574
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
575
|
+
"size-4 animate-spin md:size-6",
|
|
576
|
+
isInvalid ? "text-ods-error" : isOpen ? "text-ods-accent" : "text-ods-text-secondary"
|
|
577
|
+
)
|
|
578
|
+
}
|
|
579
|
+
) : showChevron && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
+
_chunkVX4E6YSBcjs.Chevron02DownIcon,
|
|
581
|
+
{
|
|
582
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
583
|
+
"size-4 transition-all duration-200 md:size-6",
|
|
584
|
+
"text-ods-text-secondary",
|
|
585
|
+
isOpen && "rotate-180",
|
|
586
|
+
isOpen && !isInvalid && "text-ods-accent",
|
|
587
|
+
isInvalid && "text-ods-error"
|
|
588
|
+
)
|
|
589
|
+
}
|
|
590
|
+
)
|
|
591
|
+
] })
|
|
592
|
+
]
|
|
593
|
+
}
|
|
594
|
+
) }),
|
|
595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
596
|
+
PopoverPrimitive.Content,
|
|
597
|
+
{
|
|
598
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
599
|
+
"z-50 mt-1 w-[var(--radix-popover-trigger-width)]",
|
|
600
|
+
"rounded-[4px] border border-ods-border bg-ods-card",
|
|
601
|
+
"flex max-h-[var(--radix-popper-available-height)] flex-col overflow-hidden",
|
|
602
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
603
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
604
|
+
dropdownClassName
|
|
605
|
+
),
|
|
606
|
+
sideOffset: 4,
|
|
607
|
+
align: "start",
|
|
608
|
+
collisionPadding: { bottom: keyboardPadding },
|
|
609
|
+
onOpenAutoFocus: (e) => {
|
|
610
|
+
e.preventDefault();
|
|
611
|
+
_optionalChain([inputRef, 'access', _17 => _17.current, 'optionalAccess', _18 => _18.focus, 'call', _19 => _19()]);
|
|
612
|
+
},
|
|
613
|
+
onInteractOutside: (e) => {
|
|
614
|
+
if (_optionalChain([containerRef, 'access', _20 => _20.current, 'optionalAccess', _21 => _21.contains, 'call', _22 => _22(e.target)])) {
|
|
615
|
+
e.preventDefault();
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, ScrollAreaPrimitive.Root, { className: "flex min-h-0 flex-col overflow-hidden", children: [
|
|
619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScrollAreaPrimitive.Viewport, { className: "max-h-[240px] min-h-0 w-full [&>div]:!block", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { role: "listbox", children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-3 py-2 text-ods-text-secondary text-h6", children: loadingText }) : filteredOptions.length === 0 ? showCreateOption ? isCreateTooLong ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-11 min-w-0 items-center px-[var(--spacing-system-mf)] text-ods-error text-h5 md:h-12", children: [
|
|
620
|
+
"Maximum ",
|
|
621
|
+
maxCreateLength,
|
|
622
|
+
" characters"
|
|
623
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
624
|
+
"div",
|
|
625
|
+
{
|
|
626
|
+
role: "option",
|
|
627
|
+
"aria-selected": false,
|
|
628
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
629
|
+
"flex h-11 min-w-0 cursor-pointer items-center px-[var(--spacing-system-mf)] transition-colors md:h-12",
|
|
630
|
+
"text-ods-accent text-h4",
|
|
631
|
+
"hover:bg-ods-bg-hover"
|
|
632
|
+
),
|
|
633
|
+
onClick: handleCreate,
|
|
634
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TruncateText, { className: "text-current", children: `+ Create "${inputValue.trim()}"` })
|
|
635
|
+
}
|
|
636
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-3 py-2 text-ods-text-secondary text-h6", children: freeSolo && inputValue.trim() ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
637
|
+
'Press Enter to add "',
|
|
638
|
+
inputValue,
|
|
639
|
+
'"'
|
|
640
|
+
] }) : noOptionsText }) : filteredOptions.map((option, index) => {
|
|
641
|
+
const isSelected = valueArray.includes(option.value);
|
|
642
|
+
const isHighlighted = index === highlightedIndex;
|
|
643
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
644
|
+
"div",
|
|
645
|
+
{
|
|
646
|
+
role: "option",
|
|
647
|
+
"aria-selected": isSelected,
|
|
648
|
+
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
649
|
+
// `min-h` rather than a fixed height: an option may carry
|
|
650
|
+
// a second line, and a clipped one is worse than a taller row.
|
|
651
|
+
"group/item flex min-h-11 cursor-pointer items-center border-b border-ods-border px-[var(--spacing-system-mf)] py-[var(--spacing-system-xsf)] transition-colors last:border-b-0 md:min-h-12",
|
|
652
|
+
"text-h4",
|
|
653
|
+
isHighlighted && "bg-ods-bg-surface",
|
|
654
|
+
isSelected ? "text-ods-accent" : "text-ods-text-primary",
|
|
655
|
+
!isHighlighted && "hover:bg-ods-bg-hover"
|
|
656
|
+
),
|
|
657
|
+
onClick: () => handleSelect(option),
|
|
658
|
+
onMouseEnter: () => setHighlightedIndex(index),
|
|
659
|
+
children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full min-w-0 items-center justify-between gap-[var(--spacing-system-xsf)]", children: [
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 items-center gap-[var(--spacing-system-xsf)]", children: [
|
|
661
|
+
option.icon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "flex size-5 shrink-0 items-center justify-center overflow-hidden [&_img]:size-full [&_img]:object-contain [&_svg]:size-full", children: option.icon }),
|
|
662
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TruncateText, { className: "text-current", children: option.label }),
|
|
664
|
+
typeof option.description === "string" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TruncateText, { tone: "secondary", variant: "h6", children: option.description }) : option.description
|
|
665
|
+
] })
|
|
666
|
+
] }),
|
|
667
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex shrink-0 items-center gap-[var(--spacing-system-xsf)]", children: [
|
|
668
|
+
isSelected && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVX4E6YSBcjs.CheckIcon, { className: "text-ods-accent", size: 20 }),
|
|
669
|
+
onDeleteOption && !isSelected && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
670
|
+
"button",
|
|
671
|
+
{
|
|
672
|
+
type: "button",
|
|
673
|
+
"aria-label": `Delete ${option.label}`,
|
|
674
|
+
onClick: (e) => {
|
|
675
|
+
e.stopPropagation();
|
|
676
|
+
onDeleteOption(option.value);
|
|
677
|
+
},
|
|
678
|
+
disabled: isDeletingOption,
|
|
679
|
+
className: "opacity-0 transition-opacity focus-visible:opacity-100 disabled:pointer-events-none disabled:opacity-50 group-hover/item:opacity-100",
|
|
680
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVX4E6YSBcjs.TrashIcon, { className: "size-4 text-ods-error" })
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
] })
|
|
684
|
+
] })
|
|
685
|
+
},
|
|
686
|
+
String(option.value)
|
|
687
|
+
);
|
|
688
|
+
}) }) }),
|
|
689
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScrollAreaPrimitive.Scrollbar, { className: "hidden", orientation: "vertical", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScrollAreaPrimitive.Thumb, {}) })
|
|
690
|
+
] })
|
|
691
|
+
}
|
|
692
|
+
)
|
|
693
|
+
] });
|
|
694
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
695
|
+
_chunkXXBLN4BPcjs.FieldWrapper,
|
|
696
|
+
{
|
|
697
|
+
label,
|
|
698
|
+
labelVariant,
|
|
699
|
+
error,
|
|
700
|
+
errorSlot: "error" in props,
|
|
701
|
+
className,
|
|
702
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative", ref: containerRef, children: [
|
|
703
|
+
popover,
|
|
704
|
+
multiple && showHiddenTags && hiddenTagsCount > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
705
|
+
HiddenTagsPopup,
|
|
706
|
+
{
|
|
707
|
+
ref: hiddenTagsPopupRef,
|
|
708
|
+
items: hiddenTags,
|
|
709
|
+
disabled,
|
|
710
|
+
className: "left-auto right-0 max-w-full",
|
|
711
|
+
onRemove: (value) => {
|
|
712
|
+
const newValue = valueArray.filter((v) => v !== value);
|
|
713
|
+
props.onChange(newValue);
|
|
714
|
+
if (typeof limitTagsProp === "number" && newValue.length <= limitTagsProp) setShowHiddenTags(false);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
multiple && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
719
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
720
|
+
"span",
|
|
721
|
+
{
|
|
722
|
+
ref: textMeasureRef,
|
|
723
|
+
"aria-hidden": "true",
|
|
724
|
+
className: "pointer-events-none invisible absolute left-0 top-0 -z-10 whitespace-nowrap text-h4",
|
|
725
|
+
children: inputPlaceholder
|
|
726
|
+
}
|
|
727
|
+
),
|
|
728
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
729
|
+
"div",
|
|
730
|
+
{
|
|
731
|
+
ref: measureRef,
|
|
732
|
+
"aria-hidden": "true",
|
|
733
|
+
className: "pointer-events-none invisible absolute left-0 top-0 -z-10 flex gap-2",
|
|
734
|
+
children: selectedOptions.map((option) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
735
|
+
_chunkF5BPGWGTcjs.Tag,
|
|
736
|
+
{
|
|
737
|
+
variant: "outline",
|
|
738
|
+
labelClassName: "max-w-[90px] truncate",
|
|
739
|
+
label: renderTag ? renderTag(option) : option.label,
|
|
740
|
+
onClose: () => {
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
`m-${String(option.value)}`
|
|
744
|
+
))
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
] })
|
|
748
|
+
] })
|
|
749
|
+
}
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
var Autocomplete = _react.forwardRef.call(void 0, AutocompleteInner);
|
|
753
|
+
|
|
148
754
|
// src/components/ui/select.tsx
|
|
149
755
|
var _reactselect = require('@radix-ui/react-select'); var SelectPrimitive = _interopRequireWildcard(_reactselect);
|
|
150
|
-
|
|
151
|
-
|
|
756
|
+
|
|
757
|
+
|
|
152
758
|
|
|
153
759
|
var Select = SelectPrimitive.Root;
|
|
154
760
|
var SelectGroup = SelectPrimitive.Group;
|
|
@@ -507,7 +1113,7 @@ function IconButtonsVariant({
|
|
|
507
1113
|
}) {
|
|
508
1114
|
const desktopActions = actions.filter((a) => !a.showOnlyMobile);
|
|
509
1115
|
const hasMenuActions = !!menuActions && menuActions.some((g) => g.items.length > 0);
|
|
510
|
-
const isSingleAction = actions.length === 1 && !_optionalChain([actions, 'access',
|
|
1116
|
+
const isSingleAction = actions.length === 1 && !_optionalChain([actions, 'access', _23 => _23[0], 'access', _24 => _24.submenu, 'optionalAccess', _25 => _25.length]);
|
|
511
1117
|
const singleAction = isSingleAction ? actions[0] : null;
|
|
512
1118
|
const useSingleActionMobile = isSingleAction && !hasMenuActions;
|
|
513
1119
|
const mobileMenuGroups = [{ items: actions.flatMap(actionToMenuItems) }, ..._nullishCoalesce(menuActions, () => ( []))];
|
|
@@ -1052,7 +1658,7 @@ function RemoteAccessRequestCard({
|
|
|
1052
1658
|
}) {
|
|
1053
1659
|
const { organizationName } = party;
|
|
1054
1660
|
const siteUrl = _nullishCoalesce(party.organizationSiteUrl, () => ( void 0));
|
|
1055
|
-
const openableSite = _optionalChain([siteUrl, 'optionalAccess',
|
|
1661
|
+
const openableSite = _optionalChain([siteUrl, 'optionalAccess', _26 => _26.startsWith, 'call', _27 => _27("https://")]) ? siteUrl : void 0;
|
|
1056
1662
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-[var(--spacing-system-l)] rounded-md border border-ods-border bg-ods-card p-[var(--spacing-system-xl)]", children: [
|
|
1057
1663
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h1", { className: "w-full text-ods-text-primary text-h2", children: "Your IT support team is requesting remote access" }),
|
|
1058
1664
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full items-center gap-[var(--spacing-system-m)] rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-m)]", children: [
|
|
@@ -1873,7 +2479,7 @@ function ReleaseKeepingModal({
|
|
|
1873
2479
|
keptBy,
|
|
1874
2480
|
keptOn,
|
|
1875
2481
|
reason,
|
|
1876
|
-
|
|
2482
|
+
tickets = [],
|
|
1877
2483
|
expiresOn,
|
|
1878
2484
|
dueOn,
|
|
1879
2485
|
isPending = false,
|
|
@@ -1892,9 +2498,9 @@ function ReleaseKeepingModal({
|
|
|
1892
2498
|
reason,
|
|
1893
2499
|
"."
|
|
1894
2500
|
] }),
|
|
1895
|
-
|
|
2501
|
+
tickets.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { children: [
|
|
1896
2502
|
"Ticket: ",
|
|
1897
|
-
|
|
2503
|
+
tickets.join(", ")
|
|
1898
2504
|
] })
|
|
1899
2505
|
] }),
|
|
1900
2506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, KeepNotice, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVX4E6YSBcjs.HourglassIcon, { size: 24, color: "currentColor" }), title: `It will expire on ${expiresOn}`, children: dueOn ? `It was due to expire on ${dueOn}. Releasing gives it 3 days' grace, and it shows amber until then. Whoever placed the Keep is reminded the day before it goes. Nothing is deleted now.` : "Nothing is deleted now." }),
|
|
@@ -1906,6 +2512,92 @@ function ReleaseKeepingModal({
|
|
|
1906
2512
|
] });
|
|
1907
2513
|
}
|
|
1908
2514
|
|
|
2515
|
+
// src/components/features/remote-session/remote-session-ticket-modals.tsx
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
function AssignTicketModal({
|
|
2519
|
+
isOpen,
|
|
2520
|
+
onClose,
|
|
2521
|
+
options,
|
|
2522
|
+
onSearch,
|
|
2523
|
+
loading = false,
|
|
2524
|
+
isPending = false,
|
|
2525
|
+
onConfirm
|
|
2526
|
+
}) {
|
|
2527
|
+
const [ticketIds, setTicketIds] = _react.useState.call(void 0, []);
|
|
2528
|
+
const [titles, setTitles] = _react.useState.call(void 0, {});
|
|
2529
|
+
const [seededOpen, setSeededOpen] = _react.useState.call(void 0, isOpen);
|
|
2530
|
+
if (seededOpen !== isOpen) {
|
|
2531
|
+
setSeededOpen(isOpen);
|
|
2532
|
+
if (isOpen) {
|
|
2533
|
+
setTicketIds([]);
|
|
2534
|
+
setTitles({});
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
const handleChange = (ids) => {
|
|
2538
|
+
setTicketIds(ids);
|
|
2539
|
+
setTitles((prev) => {
|
|
2540
|
+
const next = {};
|
|
2541
|
+
for (const id of ids) next[id] = _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'access', _28 => _28.find, 'call', _29 => _29((option) => option.value === id), 'optionalAccess', _30 => _30.label]), () => ( prev[id])), () => ( id));
|
|
2542
|
+
return next;
|
|
2543
|
+
});
|
|
2544
|
+
};
|
|
2545
|
+
const handleAssign = () => {
|
|
2546
|
+
if (ticketIds.length === 0 || isPending) return;
|
|
2547
|
+
onConfirm(ticketIds);
|
|
2548
|
+
};
|
|
2549
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDC4RTYWKcjs.Modal, { isOpen, onClose: isPending ? () => {
|
|
2550
|
+
} : onClose, className: "text-left md:max-w-[600px]", children: [
|
|
2551
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDC4RTYWKcjs.ModalHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDC4RTYWKcjs.ModalTitle, { children: "Assign Ticket" }) }),
|
|
2552
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2553
|
+
Autocomplete,
|
|
2554
|
+
{
|
|
2555
|
+
multiple: true,
|
|
2556
|
+
wrapTags: true,
|
|
2557
|
+
label: "Tickets",
|
|
2558
|
+
labelVariant: "large",
|
|
2559
|
+
options,
|
|
2560
|
+
value: ticketIds,
|
|
2561
|
+
onChange: handleChange,
|
|
2562
|
+
renderTag: (option) => _nullishCoalesce(titles[option.value], () => ( option.label)),
|
|
2563
|
+
onInputChange: onSearch ? (value, reason) => reason === "input" && onSearch(value) : void 0,
|
|
2564
|
+
disableClientFilter: Boolean(onSearch),
|
|
2565
|
+
loading,
|
|
2566
|
+
noOptionsText: "No tickets found",
|
|
2567
|
+
disabled: isPending
|
|
2568
|
+
}
|
|
2569
|
+
),
|
|
2570
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDC4RTYWKcjs.ModalFooter, { children: [
|
|
2571
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDFQYAYBHcjs.Button, { type: "button", variant: "outline", onClick: onClose, disabled: isPending, className: "flex-1 md:hidden", children: "Cancel" }),
|
|
2572
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hidden flex-1 md:block" }),
|
|
2573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2574
|
+
_chunkDFQYAYBHcjs.Button,
|
|
2575
|
+
{
|
|
2576
|
+
type: "button",
|
|
2577
|
+
variant: "accent",
|
|
2578
|
+
onClick: handleAssign,
|
|
2579
|
+
loading: isPending,
|
|
2580
|
+
disabled: ticketIds.length === 0,
|
|
2581
|
+
className: "flex-1",
|
|
2582
|
+
children: "Assign"
|
|
2583
|
+
}
|
|
2584
|
+
)
|
|
2585
|
+
] })
|
|
2586
|
+
] });
|
|
2587
|
+
}
|
|
2588
|
+
function UnassignTicketModal({ isOpen, onClose, isPending = false, onConfirm }) {
|
|
2589
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDC4RTYWKcjs.Modal, { isOpen, onClose: isPending ? () => {
|
|
2590
|
+
} : onClose, className: "text-left md:max-w-[600px]", children: [
|
|
2591
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDC4RTYWKcjs.ModalHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDC4RTYWKcjs.ModalTitle, { children: "Unassign Ticket" }) }),
|
|
2592
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "w-full text-ods-text-primary text-h4", children: "This Ticket will no longer be linked to this remote session. The ticket itself stays as it is, and you can assign it again anytime." }),
|
|
2593
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDC4RTYWKcjs.ModalFooter, { children: [
|
|
2594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDFQYAYBHcjs.Button, { type: "button", variant: "outline", onClick: onClose, disabled: isPending, className: "flex-1 md:hidden", children: "Cancel" }),
|
|
2595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hidden flex-1 md:block" }),
|
|
2596
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDFQYAYBHcjs.Button, { type: "button", variant: "destructive", onClick: onConfirm, loading: isPending, className: "flex-1", children: "Unassign" })
|
|
2597
|
+
] })
|
|
2598
|
+
] });
|
|
2599
|
+
}
|
|
2600
|
+
|
|
1909
2601
|
// src/components/features/remote-session/remote-session-events.tsx
|
|
1910
2602
|
|
|
1911
2603
|
function formatRemoteSessionOffset(offsetMs) {
|
|
@@ -1923,7 +2615,7 @@ function RemoteSessionEventList({ events, activeEventId, onSelect, className })
|
|
|
1923
2615
|
{
|
|
1924
2616
|
type: "button",
|
|
1925
2617
|
"aria-current": event.id === activeEventId || void 0,
|
|
1926
|
-
onClick: () => _optionalChain([onSelect, 'optionalCall',
|
|
2618
|
+
onClick: () => _optionalChain([onSelect, 'optionalCall', _31 => _31(event)]),
|
|
1927
2619
|
className: _chunk3ATAYP36cjs.cn.call(void 0,
|
|
1928
2620
|
"flex w-full items-start gap-[var(--spacing-system-xxs)] rounded-md p-[var(--spacing-system-xxs)] text-left outline-none transition-colors",
|
|
1929
2621
|
"hover:bg-ods-bg-hover focus-visible:ring-2 focus-visible:ring-ods-focus",
|
|
@@ -1956,7 +2648,7 @@ function RemoteSessionTimelineMarkers({
|
|
|
1956
2648
|
type: "button",
|
|
1957
2649
|
"aria-label": label,
|
|
1958
2650
|
title: label,
|
|
1959
|
-
onClick: () => _optionalChain([onSelect, 'optionalCall',
|
|
2651
|
+
onClick: () => _optionalChain([onSelect, 'optionalCall', _32 => _32(event)]),
|
|
1960
2652
|
style: { left: `${share * 100}%` },
|
|
1961
2653
|
className: "absolute top-0 h-4 w-1 -translate-x-1/2 rounded-md bg-ods-text-secondary outline-none transition-colors hover:bg-ods-text-primary focus-visible:ring-2 focus-visible:ring-ods-focus"
|
|
1962
2654
|
},
|
|
@@ -2084,4 +2776,8 @@ function RemoteSessionStorageAlert({ scope, capacity, className }) {
|
|
|
2084
2776
|
|
|
2085
2777
|
|
|
2086
2778
|
|
|
2087
|
-
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
|
|
2782
|
+
|
|
2783
|
+
exports.HiddenTagsPopup = HiddenTagsPopup; exports.TruncateText = TruncateText; exports.Autocomplete = Autocomplete; exports.Select = Select; exports.SelectGroup = SelectGroup; exports.SelectValue = SelectValue; exports.SelectTrigger = SelectTrigger; exports.SelectScrollUpButton = SelectScrollUpButton; exports.SelectScrollDownButton = SelectScrollDownButton; exports.SelectContent = SelectContent; exports.SelectLabel = SelectLabel; exports.SelectItem = SelectItem; exports.SelectSeparator = SelectSeparator; exports.BACK_BUTTON_SKELETON_CLASS = BACK_BUTTON_SKELETON_CLASS; exports.BackButton = BackButton; exports.PageActions = PageActions; exports.usePageActionsBottomPadding = usePageActionsBottomPadding; exports.EntityImage = EntityImage; exports.TITLE_BLOCK_MIN_HEIGHT = TITLE_BLOCK_MIN_HEIGHT; exports.TitleBlock = TitleBlock; exports.PageLayout = PageLayout; exports.RemoteSessionViewers = RemoteSessionViewers; exports.RemoteSessionScope = RemoteSessionScope; exports.RemoteSessionOrgLogo = RemoteSessionOrgLogo; exports.RemoteSessionRecordingTag = RemoteSessionRecordingTag; exports.REMOTE_SESSION_DRAG_HANDLE_CLASS = REMOTE_SESSION_DRAG_HANDLE_CLASS; exports.RemoteSessionDragger = RemoteSessionDragger; exports.formatRemoteSessionElapsed = formatRemoteSessionElapsed; exports.useRemoteSessionTimer = useRemoteSessionTimer; exports.RemoteAccessRequestCard = RemoteAccessRequestCard; exports.RemoteSessionBlockFrame = RemoteSessionBlockFrame; exports.RemoteSessionEndButton = RemoteSessionEndButton; exports.RemoteSessionSummary = RemoteSessionSummary; exports.RemoteSessionMinimizedChip = RemoteSessionMinimizedChip; exports.RemoteSessionChatPanel = RemoteSessionChatPanel; exports.RemoteDesktopChatMessageRow = RemoteDesktopChatMessageRow; exports.REMOTE_DESKTOP_CHAT_END_USER_NAME = REMOTE_DESKTOP_CHAT_END_USER_NAME; exports.RemoteDesktopChatPanel = RemoteDesktopChatPanel; exports.RemoteDesktopFullscreenToolbar = RemoteDesktopFullscreenToolbar; exports.RemoteDesktopView = RemoteDesktopView; exports.RemoteDesktopViewSkeleton = RemoteDesktopViewSkeleton; exports.RemoteSessionDialog = RemoteSessionDialog; exports.RemoteSessionBorder = RemoteSessionBorder; exports.RemoteSessionPill = RemoteSessionPill; exports.REMOTE_SESSION_KEEP_REASON_LABELS = REMOTE_SESSION_KEEP_REASON_LABELS; exports.KeepRecordingModal = KeepRecordingModal; exports.ReleaseKeepingModal = ReleaseKeepingModal; exports.AssignTicketModal = AssignTicketModal; exports.UnassignTicketModal = UnassignTicketModal; exports.formatRemoteSessionOffset = formatRemoteSessionOffset; exports.RemoteSessionEventList = RemoteSessionEventList; exports.RemoteSessionTimelineMarkers = RemoteSessionTimelineMarkers; exports.RemoteSessionStatusTag = RemoteSessionStatusTag; exports.RemoteSessionExpiry = RemoteSessionExpiry; exports.RemoteSessionStorageAlert = RemoteSessionStorageAlert;
|