@dragunio/fe-libs 0.1.6 → 0.1.8
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/README.md +40 -1
- package/dist/{chunk-NDMLXSI5.mjs → chunk-HM3V3DVO.mjs} +20 -4
- package/dist/icons.d.mts +3 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.js +22 -4
- package/dist/icons.mjs +5 -1
- package/dist/index.d.mts +115 -3
- package/dist/index.d.ts +115 -3
- package/dist/index.js +1194 -304
- package/dist/index.mjs +1183 -306
- package/dist/styles.css +278 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,7 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
Avatar: () => Avatar,
|
|
24
|
+
AvatarGroup: () => AvatarGroup,
|
|
23
25
|
Button: () => Button,
|
|
26
|
+
ButtonBar: () => ButtonBar,
|
|
24
27
|
Checkbox: () => Checkbox,
|
|
25
28
|
ChevronDownIcon: () => ChevronDownIcon,
|
|
26
29
|
ChevronUpIcon: () => ChevronUpIcon,
|
|
@@ -33,6 +36,8 @@ __export(index_exports, {
|
|
|
33
36
|
Loading: () => Loading,
|
|
34
37
|
Message: () => Message,
|
|
35
38
|
Modal: () => Modal,
|
|
39
|
+
MoreHorizontalIcon: () => MoreHorizontalIcon,
|
|
40
|
+
MoreVerticalIcon: () => MoreVerticalIcon,
|
|
36
41
|
NumberInput: () => NumberInput,
|
|
37
42
|
Pagination: () => Pagination,
|
|
38
43
|
PlusIcon: () => PlusIcon,
|
|
@@ -54,6 +59,7 @@ __export(index_exports, {
|
|
|
54
59
|
TableHead: () => TableHead,
|
|
55
60
|
TableHeader: () => TableHeader,
|
|
56
61
|
TableRow: () => TableRow,
|
|
62
|
+
Tabs: () => Tabs,
|
|
57
63
|
TextArea: () => TextArea,
|
|
58
64
|
TextInput: () => TextInput,
|
|
59
65
|
Toggle: () => Toggle,
|
|
@@ -147,6 +153,9 @@ var Button = (0, import_react.forwardRef)(
|
|
|
147
153
|
);
|
|
148
154
|
Button.displayName = "Button";
|
|
149
155
|
|
|
156
|
+
// packages/button-bar/src/index.tsx
|
|
157
|
+
var import_react2 = require("react");
|
|
158
|
+
|
|
150
159
|
// packages/icons/src/svgItems/general.tsx
|
|
151
160
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
152
161
|
var primaryColor = "#101828";
|
|
@@ -201,16 +210,16 @@ var iconProps2 = ({ size, ...props }) => ({
|
|
|
201
210
|
...props
|
|
202
211
|
});
|
|
203
212
|
var chevron_right = (props) => {
|
|
204
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", {
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.39898 5.39898C8.73093 5.06704 9.26912 5.06704 9.60107 5.39898L15.6011 11.399C15.933 11.7309 15.933 12.2691 15.6011 12.6011L9.60107 18.6011C9.26912 18.933 8.73093 18.933 8.39898 18.6011C8.06704 18.2691 8.06704 17.7309 8.39898 17.399L13.7979 12L8.39898 6.60107C8.06704 6.26912 8.06704 5.73093 8.39898 5.39898Z", fill: props.fill }) });
|
|
205
214
|
};
|
|
206
215
|
var chevron_up = (props) => {
|
|
207
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", {
|
|
216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.399 8.39898C11.7309 8.06704 12.2691 8.06704 12.6011 8.39898L18.6011 14.399C18.933 14.7309 18.933 15.2691 18.6011 15.6011C18.2691 15.933 17.7309 15.933 17.399 15.6011L12 10.2021L6.60107 15.6011C6.26912 15.933 5.73093 15.933 5.39898 15.6011C5.06704 15.2691 5.06704 14.7309 5.39898 14.399L11.399 8.39898Z", fill: "#101828" }) });
|
|
208
217
|
};
|
|
209
218
|
var chevron_left = (props) => {
|
|
210
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", {
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.6011 5.39898C15.933 5.73093 15.933 6.26912 15.6011 6.60107L10.2021 12L15.6011 17.399C15.933 17.7309 15.933 18.2691 15.6011 18.6011C15.2691 18.933 14.7309 18.933 14.399 18.6011L8.39898 12.6011C8.06704 12.2691 8.06704 11.7309 8.39898 11.399L14.399 5.39898C14.7309 5.06704 15.2691 5.06704 15.6011 5.39898Z", fill: "#101828" }) });
|
|
211
220
|
};
|
|
212
221
|
var chevron_down = (props) => {
|
|
213
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", {
|
|
222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...iconProps2(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.39898 8.39898C5.73093 8.06704 6.26912 8.06704 6.60107 8.39898L12 13.7979L17.399 8.39898C17.7309 8.06704 18.2691 8.06704 18.6011 8.39898C18.933 8.73093 18.933 9.26912 18.6011 9.60107L12.6011 15.6011C12.2691 15.933 11.7309 15.933 11.399 15.6011L5.39898 9.60107C5.06704 9.26912 5.06704 8.73093 5.39898 8.39898Z", fill: "#101828" }) });
|
|
214
223
|
};
|
|
215
224
|
|
|
216
225
|
// packages/icons/src/svgItems/security.tsx
|
|
@@ -290,6 +299,20 @@ function CloseIcon(props) {
|
|
|
290
299
|
}
|
|
291
300
|
) });
|
|
292
301
|
}
|
|
302
|
+
function MoreHorizontalIcon(props) {
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...iconProps4(props), children: [
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "5", cy: "12", r: "1.75", fill: "currentColor" }),
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "1.75", fill: "currentColor" }),
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "19", cy: "12", r: "1.75", fill: "currentColor" })
|
|
307
|
+
] });
|
|
308
|
+
}
|
|
309
|
+
function MoreVerticalIcon(props) {
|
|
310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...iconProps4(props), children: [
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "5", r: "1.75", fill: "currentColor" }),
|
|
312
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "12", r: "1.75", fill: "currentColor" }),
|
|
313
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "12", cy: "19", r: "1.75", fill: "currentColor" })
|
|
314
|
+
] });
|
|
315
|
+
}
|
|
293
316
|
function SearchIcon(props) {
|
|
294
317
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { ...iconProps4(props), children: [
|
|
295
318
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("circle", { cx: "11", cy: "11", r: "6.5", stroke: "currentColor", strokeWidth: "2" }),
|
|
@@ -305,12 +328,332 @@ function SearchIcon(props) {
|
|
|
305
328
|
] });
|
|
306
329
|
}
|
|
307
330
|
|
|
308
|
-
// packages/
|
|
331
|
+
// packages/button-bar/src/index.tsx
|
|
332
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
309
333
|
var import_react3 = require("react");
|
|
334
|
+
function ButtonBar({
|
|
335
|
+
actions,
|
|
336
|
+
maxVisible = actions.length,
|
|
337
|
+
moreButtonProps,
|
|
338
|
+
moreLabel = "More actions",
|
|
339
|
+
className,
|
|
340
|
+
...props
|
|
341
|
+
}) {
|
|
342
|
+
const [isMoreOpen, setIsMoreOpen] = (0, import_react2.useState)(false);
|
|
343
|
+
const rootRef = (0, import_react2.useRef)(null);
|
|
344
|
+
const moreMenuId = (0, import_react2.useId)();
|
|
345
|
+
const visibleCount = Math.max(0, Math.floor(maxVisible));
|
|
346
|
+
const actionCount = actions.filter(
|
|
347
|
+
(item) => item !== "|"
|
|
348
|
+
).length;
|
|
349
|
+
const hasOverflow = actionCount > visibleCount;
|
|
350
|
+
let visibleActionEndIndex = actions.length;
|
|
351
|
+
if (hasOverflow) {
|
|
352
|
+
visibleActionEndIndex = 0;
|
|
353
|
+
let renderedActionCount = 0;
|
|
354
|
+
while (visibleActionEndIndex < actions.length && renderedActionCount < visibleCount) {
|
|
355
|
+
if (actions[visibleActionEndIndex] !== "|") renderedActionCount += 1;
|
|
356
|
+
visibleActionEndIndex += 1;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
const visibleActions = actions.slice(0, visibleActionEndIndex).filter((item) => item !== "|");
|
|
360
|
+
const overflowItems = actions.slice(visibleActionEndIndex).filter(
|
|
361
|
+
(item, index, items) => item !== "|" || items.slice(0, index).some((candidate) => candidate !== "|") && items.slice(index + 1).some((candidate) => candidate !== "|") && items[index - 1] !== "|"
|
|
362
|
+
);
|
|
363
|
+
const {
|
|
364
|
+
onClick: onMoreClick,
|
|
365
|
+
disabled: moreDisabled,
|
|
366
|
+
"aria-label": moreAriaLabel,
|
|
367
|
+
...moreButtonRestProps
|
|
368
|
+
} = moreButtonProps ?? {};
|
|
369
|
+
(0, import_react2.useEffect)(() => {
|
|
370
|
+
if (!isMoreOpen) return;
|
|
371
|
+
const onPointerDown = (event) => {
|
|
372
|
+
if (!rootRef.current?.contains(event.target)) {
|
|
373
|
+
setIsMoreOpen(false);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
const onKeyDown = (event) => {
|
|
377
|
+
if (event.key === "Escape") setIsMoreOpen(false);
|
|
378
|
+
};
|
|
379
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
380
|
+
document.addEventListener("keydown", onKeyDown);
|
|
381
|
+
return () => {
|
|
382
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
383
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
384
|
+
};
|
|
385
|
+
}, [isMoreOpen]);
|
|
386
|
+
const renderAction = (action, isOverflowAction = false) => {
|
|
387
|
+
const { id, className: className2, onClick, disabled, prefix, ...buttonProps } = action;
|
|
388
|
+
return /* @__PURE__ */ (0, import_react3.createElement)(
|
|
389
|
+
Button,
|
|
390
|
+
{
|
|
391
|
+
...buttonProps,
|
|
392
|
+
className: [className2, isOverflowAction && "fe-button-bar__menu-action"].filter(Boolean).join(" ") || void 0,
|
|
393
|
+
disabled,
|
|
394
|
+
key: id,
|
|
395
|
+
onClick: (event) => {
|
|
396
|
+
onClick?.(event);
|
|
397
|
+
if (isOverflowAction && !disabled) setIsMoreOpen(false);
|
|
398
|
+
},
|
|
399
|
+
prefix: isOverflowAction ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "fe-button-bar__menu-icon", children: prefix }) : prefix
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
};
|
|
403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
404
|
+
"div",
|
|
405
|
+
{
|
|
406
|
+
...props,
|
|
407
|
+
className: ["fe-button-bar", className].filter(Boolean).join(" "),
|
|
408
|
+
ref: rootRef,
|
|
409
|
+
children: [
|
|
410
|
+
visibleActions.map((action) => renderAction(action)),
|
|
411
|
+
hasOverflow && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "fe-button-bar__more", children: [
|
|
412
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
413
|
+
Button,
|
|
414
|
+
{
|
|
415
|
+
hierarchy: "secondary-gray",
|
|
416
|
+
...moreButtonRestProps,
|
|
417
|
+
"aria-controls": moreMenuId,
|
|
418
|
+
"aria-expanded": isMoreOpen,
|
|
419
|
+
"aria-haspopup": "true",
|
|
420
|
+
"aria-label": moreAriaLabel ?? moreLabel,
|
|
421
|
+
disabled: moreDisabled,
|
|
422
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MoreHorizontalIcon, {}),
|
|
423
|
+
iconOnly: true,
|
|
424
|
+
onClick: (event) => {
|
|
425
|
+
onMoreClick?.(event);
|
|
426
|
+
if (!event.defaultPrevented) setIsMoreOpen((open) => !open);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
isMoreOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
"aria-label": moreLabel,
|
|
434
|
+
className: "fe-button-bar__menu",
|
|
435
|
+
id: moreMenuId,
|
|
436
|
+
role: "group",
|
|
437
|
+
children: overflowItems.map(
|
|
438
|
+
(item, index) => item === "|" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
439
|
+
"div",
|
|
440
|
+
{
|
|
441
|
+
"aria-orientation": "horizontal",
|
|
442
|
+
className: "fe-button-bar__menu-divider",
|
|
443
|
+
role: "separator"
|
|
444
|
+
},
|
|
445
|
+
`divider-${index}`
|
|
446
|
+
) : renderAction(item, true)
|
|
447
|
+
)
|
|
448
|
+
}
|
|
449
|
+
)
|
|
450
|
+
] })
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// packages/tabs/src/index.tsx
|
|
457
|
+
var import_react4 = require("react");
|
|
458
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
459
|
+
var hasPanel = (item) => Object.prototype.hasOwnProperty.call(item, "content");
|
|
460
|
+
function findSelectableTab(items, value) {
|
|
461
|
+
return items.find((item) => item.id === value && !item.disabled) ?? items.find((item) => !item.disabled);
|
|
462
|
+
}
|
|
463
|
+
function scrollBehavior() {
|
|
464
|
+
return typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
465
|
+
}
|
|
466
|
+
var Tabs = (0, import_react4.forwardRef)(function Tabs2({
|
|
467
|
+
items,
|
|
468
|
+
value,
|
|
469
|
+
defaultValue,
|
|
470
|
+
onChange,
|
|
471
|
+
variant = "tab",
|
|
472
|
+
scrollButtons = "auto",
|
|
473
|
+
previousScrollLabel = "Scroll tabs backward",
|
|
474
|
+
nextScrollLabel = "Scroll tabs forward",
|
|
475
|
+
className,
|
|
476
|
+
"aria-label": ariaLabel = "Tabs",
|
|
477
|
+
"aria-labelledby": ariaLabelledBy,
|
|
478
|
+
...props
|
|
479
|
+
}, ref) {
|
|
480
|
+
const generatedId = (0, import_react4.useId)();
|
|
481
|
+
const listRef = (0, import_react4.useRef)(null);
|
|
482
|
+
const tabRefs = (0, import_react4.useRef)(/* @__PURE__ */ new Map());
|
|
483
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react4.useState)(
|
|
484
|
+
() => findSelectableTab(items, defaultValue)?.id
|
|
485
|
+
);
|
|
486
|
+
const [scrollState, setScrollState] = (0, import_react4.useState)({
|
|
487
|
+
hasOverflow: false,
|
|
488
|
+
canScrollBackward: false,
|
|
489
|
+
canScrollForward: false
|
|
490
|
+
});
|
|
491
|
+
const activeTab = findSelectableTab(items, value ?? uncontrolledValue);
|
|
492
|
+
const activeIndex = activeTab ? items.findIndex((item) => item.id === activeTab.id) : -1;
|
|
493
|
+
(0, import_react4.useEffect)(() => {
|
|
494
|
+
if (value === void 0 && activeTab?.id !== uncontrolledValue) {
|
|
495
|
+
setUncontrolledValue(activeTab?.id);
|
|
496
|
+
}
|
|
497
|
+
}, [activeTab?.id, uncontrolledValue, value]);
|
|
498
|
+
const updateScrollState = (0, import_react4.useCallback)(() => {
|
|
499
|
+
const list = listRef.current;
|
|
500
|
+
if (!list) return;
|
|
501
|
+
const maxScroll = Math.max(0, list.scrollWidth - list.clientWidth);
|
|
502
|
+
setScrollState({
|
|
503
|
+
hasOverflow: maxScroll > 1,
|
|
504
|
+
canScrollBackward: list.scrollLeft > 1,
|
|
505
|
+
canScrollForward: list.scrollLeft < maxScroll - 1
|
|
506
|
+
});
|
|
507
|
+
}, []);
|
|
508
|
+
(0, import_react4.useEffect)(() => {
|
|
509
|
+
const list = listRef.current;
|
|
510
|
+
if (!list) return;
|
|
511
|
+
updateScrollState();
|
|
512
|
+
list.addEventListener("scroll", updateScrollState, { passive: true });
|
|
513
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(updateScrollState);
|
|
514
|
+
observer?.observe(list);
|
|
515
|
+
window.addEventListener("resize", updateScrollState);
|
|
516
|
+
return () => {
|
|
517
|
+
list.removeEventListener("scroll", updateScrollState);
|
|
518
|
+
observer?.disconnect();
|
|
519
|
+
window.removeEventListener("resize", updateScrollState);
|
|
520
|
+
};
|
|
521
|
+
}, [items, updateScrollState]);
|
|
522
|
+
(0, import_react4.useEffect)(() => {
|
|
523
|
+
const tab = activeTab ? tabRefs.current.get(activeTab.id) : void 0;
|
|
524
|
+
tab?.scrollIntoView?.({
|
|
525
|
+
behavior: scrollBehavior(),
|
|
526
|
+
block: "nearest",
|
|
527
|
+
inline: "nearest"
|
|
528
|
+
});
|
|
529
|
+
}, [activeTab?.id]);
|
|
530
|
+
const selectTab = (item, event) => {
|
|
531
|
+
if (item.disabled || item.id === activeTab?.id) return;
|
|
532
|
+
if (value === void 0) setUncontrolledValue(item.id);
|
|
533
|
+
onChange?.(item.id, item, event);
|
|
534
|
+
};
|
|
535
|
+
const selectFromKeyboard = (item, event) => {
|
|
536
|
+
const enabledItems = items.filter((candidate) => !candidate.disabled);
|
|
537
|
+
const currentIndex = enabledItems.findIndex(
|
|
538
|
+
(candidate) => candidate.id === item.id
|
|
539
|
+
);
|
|
540
|
+
if (currentIndex === -1) return;
|
|
541
|
+
let nextIndex;
|
|
542
|
+
if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
543
|
+
nextIndex = (currentIndex + 1) % enabledItems.length;
|
|
544
|
+
} else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
|
|
545
|
+
nextIndex = (currentIndex - 1 + enabledItems.length) % enabledItems.length;
|
|
546
|
+
} else if (event.key === "Home") {
|
|
547
|
+
nextIndex = 0;
|
|
548
|
+
} else if (event.key === "End") {
|
|
549
|
+
nextIndex = enabledItems.length - 1;
|
|
550
|
+
}
|
|
551
|
+
if (nextIndex === void 0) return;
|
|
552
|
+
event.preventDefault();
|
|
553
|
+
const nextItem = enabledItems[nextIndex];
|
|
554
|
+
if (!nextItem) return;
|
|
555
|
+
tabRefs.current.get(nextItem.id)?.focus();
|
|
556
|
+
selectTab(nextItem, event);
|
|
557
|
+
};
|
|
558
|
+
const scrollTabs = (direction) => {
|
|
559
|
+
const list = listRef.current;
|
|
560
|
+
if (!list) return;
|
|
561
|
+
list.scrollBy({
|
|
562
|
+
left: direction * Math.max(160, Math.round(list.clientWidth * 0.75)),
|
|
563
|
+
behavior: scrollBehavior()
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
const showScrollButtons = scrollButtons === "always" || scrollButtons === "auto" && scrollState.hasOverflow;
|
|
567
|
+
const classes = ["fe-tabs", `fe-tabs--${variant}`, className].filter(Boolean).join(" ");
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ...props, className: classes, ref, children: [
|
|
569
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "fe-tabs__navigation", children: [
|
|
570
|
+
showScrollButtons && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
571
|
+
Button,
|
|
572
|
+
{
|
|
573
|
+
"aria-label": previousScrollLabel,
|
|
574
|
+
className: "fe-tabs__scroll-button",
|
|
575
|
+
disabled: !scrollState.canScrollBackward,
|
|
576
|
+
hierarchy: "tertiary-gray",
|
|
577
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(chevron_left, { size: 18 }),
|
|
578
|
+
iconOnly: true,
|
|
579
|
+
onClick: () => scrollTabs(-1),
|
|
580
|
+
size: "32"
|
|
581
|
+
}
|
|
582
|
+
),
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "fe-tabs__scroller", ref: listRef, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
584
|
+
"div",
|
|
585
|
+
{
|
|
586
|
+
"aria-label": ariaLabelledBy ? void 0 : ariaLabel,
|
|
587
|
+
"aria-labelledby": ariaLabelledBy,
|
|
588
|
+
"aria-orientation": "horizontal",
|
|
589
|
+
className: "fe-tabs__list",
|
|
590
|
+
role: "tablist",
|
|
591
|
+
children: items.map((item, index) => {
|
|
592
|
+
const selected = item.id === activeTab?.id;
|
|
593
|
+
const panelId = `${generatedId}-panel-${index}`;
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
595
|
+
"button",
|
|
596
|
+
{
|
|
597
|
+
"aria-controls": hasPanel(item) ? panelId : void 0,
|
|
598
|
+
"aria-selected": selected,
|
|
599
|
+
className: "fe-tabs__tab",
|
|
600
|
+
disabled: item.disabled,
|
|
601
|
+
id: `${generatedId}-tab-${index}`,
|
|
602
|
+
onClick: (event) => selectTab(item, event),
|
|
603
|
+
onKeyDown: (event) => selectFromKeyboard(item, event),
|
|
604
|
+
ref: (node) => {
|
|
605
|
+
if (node) tabRefs.current.set(item.id, node);
|
|
606
|
+
else tabRefs.current.delete(item.id);
|
|
607
|
+
},
|
|
608
|
+
role: "tab",
|
|
609
|
+
tabIndex: selected ? 0 : -1,
|
|
610
|
+
type: "button",
|
|
611
|
+
children: item.label
|
|
612
|
+
},
|
|
613
|
+
item.id
|
|
614
|
+
);
|
|
615
|
+
})
|
|
616
|
+
}
|
|
617
|
+
) }),
|
|
618
|
+
showScrollButtons && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
619
|
+
Button,
|
|
620
|
+
{
|
|
621
|
+
"aria-label": nextScrollLabel,
|
|
622
|
+
className: "fe-tabs__scroll-button",
|
|
623
|
+
disabled: !scrollState.canScrollForward,
|
|
624
|
+
hierarchy: "tertiary-gray",
|
|
625
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(chevron_right, { size: 18 }),
|
|
626
|
+
iconOnly: true,
|
|
627
|
+
onClick: () => scrollTabs(1),
|
|
628
|
+
size: "32"
|
|
629
|
+
}
|
|
630
|
+
)
|
|
631
|
+
] }),
|
|
632
|
+
items.map(
|
|
633
|
+
(item, index) => hasPanel(item) ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
634
|
+
"div",
|
|
635
|
+
{
|
|
636
|
+
"aria-labelledby": `${generatedId}-tab-${index}`,
|
|
637
|
+
className: "fe-tabs__panel",
|
|
638
|
+
hidden: item.id !== activeTab?.id,
|
|
639
|
+
id: `${generatedId}-panel-${index}`,
|
|
640
|
+
role: "tabpanel",
|
|
641
|
+
tabIndex: 0,
|
|
642
|
+
children: item.content
|
|
643
|
+
},
|
|
644
|
+
item.id
|
|
645
|
+
) : null
|
|
646
|
+
)
|
|
647
|
+
] });
|
|
648
|
+
});
|
|
649
|
+
Tabs.displayName = "Tabs";
|
|
650
|
+
|
|
651
|
+
// packages/table/src/index.tsx
|
|
652
|
+
var import_react6 = require("react");
|
|
310
653
|
|
|
311
654
|
// packages/pagination/src/index.tsx
|
|
312
|
-
var
|
|
313
|
-
var
|
|
655
|
+
var import_react5 = require("react");
|
|
656
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
314
657
|
var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
315
658
|
var range = (start, end) => Array.from({ length: Math.max(0, end - start + 1) }, (_, index) => start + index);
|
|
316
659
|
function getItems(totalPages, page, siblingCount, boundaryCount) {
|
|
@@ -342,9 +685,9 @@ function Pagination({
|
|
|
342
685
|
...props
|
|
343
686
|
}) {
|
|
344
687
|
const safeTotalPages = Math.max(1, Math.floor(totalPages));
|
|
345
|
-
const [uncontrolledPage, setUncontrolledPage] = (0,
|
|
688
|
+
const [uncontrolledPage, setUncontrolledPage] = (0, import_react5.useState)(() => clamp(defaultPage, 1, safeTotalPages));
|
|
346
689
|
const currentPage = clamp(page ?? uncontrolledPage, 1, safeTotalPages);
|
|
347
|
-
const items = (0,
|
|
690
|
+
const items = (0, import_react5.useMemo)(
|
|
348
691
|
() => getItems(safeTotalPages, currentPage, Math.max(0, siblingCount), Math.max(0, boundaryCount)),
|
|
349
692
|
[safeTotalPages, currentPage, siblingCount, boundaryCount]
|
|
350
693
|
);
|
|
@@ -353,9 +696,9 @@ function Pagination({
|
|
|
353
696
|
if (page === void 0) setUncontrolledPage(resolvedPage);
|
|
354
697
|
if (resolvedPage !== currentPage) onPageChange?.(resolvedPage);
|
|
355
698
|
};
|
|
356
|
-
return /* @__PURE__ */ (0,
|
|
357
|
-
/* @__PURE__ */ (0,
|
|
358
|
-
items.map((item, index) => item === "start-ellipsis" || item === "end-ellipsis" ? /* @__PURE__ */ (0,
|
|
699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("nav", { className: ["fe-pagination", className].filter(Boolean).join(" "), "aria-label": "Pagination", ...props, children: [
|
|
700
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "fe-pagination__button fe-pagination__button--control", hierarchy: "secondary-gray", size: "40", iconOnly: true, icon: "\u2039", "aria-label": previousLabel, disabled: disabled || currentPage === 1, onClick: () => selectPage(currentPage - 1) }),
|
|
701
|
+
items.map((item, index) => item === "start-ellipsis" || item === "end-ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "fe-pagination__ellipsis", "aria-hidden": "true", children: "\u2026" }, `${item}-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
359
702
|
Button,
|
|
360
703
|
{
|
|
361
704
|
className: "fe-pagination__button",
|
|
@@ -369,13 +712,13 @@ function Pagination({
|
|
|
369
712
|
},
|
|
370
713
|
item
|
|
371
714
|
)),
|
|
372
|
-
/* @__PURE__ */ (0,
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "fe-pagination__button fe-pagination__button--control", hierarchy: "secondary-gray", size: "40", iconOnly: true, icon: "\u203A", "aria-label": nextLabel, disabled: disabled || currentPage === safeTotalPages, onClick: () => selectPage(currentPage + 1) })
|
|
373
716
|
] });
|
|
374
717
|
}
|
|
375
718
|
|
|
376
719
|
// packages/table/src/index.tsx
|
|
377
|
-
var
|
|
378
|
-
var TableContext = (0,
|
|
720
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
721
|
+
var TableContext = (0, import_react6.createContext)({ striped: false });
|
|
379
722
|
var MIN_COLUMN_WIDTH = 96;
|
|
380
723
|
var MAX_COLUMN_WIDTH = 1200;
|
|
381
724
|
function getColumnCount(headers, data) {
|
|
@@ -384,7 +727,7 @@ function getColumnCount(headers, data) {
|
|
|
384
727
|
function getText(value) {
|
|
385
728
|
if (typeof value === "string" || typeof value === "number") return String(value);
|
|
386
729
|
if (Array.isArray(value)) return value.map(getText).join("");
|
|
387
|
-
if ((0,
|
|
730
|
+
if ((0, import_react6.isValidElement)(value)) return getText(value.props.children);
|
|
388
731
|
return "";
|
|
389
732
|
}
|
|
390
733
|
function autoColumnSize(columnIndex, headers, data) {
|
|
@@ -420,37 +763,37 @@ function DataTable({
|
|
|
420
763
|
}) {
|
|
421
764
|
const columnCount = getColumnCount(headers, data);
|
|
422
765
|
const safeMinWidth = Math.max(1, minColumnWidth);
|
|
423
|
-
const generatedSizes = (0,
|
|
766
|
+
const generatedSizes = (0, import_react6.useMemo)(
|
|
424
767
|
() => getInitialColumnSizes(headers, data, defaultColumnSizes, safeMinWidth),
|
|
425
768
|
[headers, data, defaultColumnSizes, safeMinWidth]
|
|
426
769
|
);
|
|
427
|
-
const [uncontrolledSizes, setUncontrolledSizes] = (0,
|
|
770
|
+
const [uncontrolledSizes, setUncontrolledSizes] = (0, import_react6.useState)(generatedSizes);
|
|
428
771
|
const shouldPaginate = pagination ?? pageSize !== void 0;
|
|
429
772
|
const safePageSize = Math.max(1, Math.floor(pageSize ?? 10));
|
|
430
773
|
const totalPages = Math.max(1, Math.ceil(data.length / safePageSize));
|
|
431
|
-
const [uncontrolledPage, setUncontrolledPage] = (0,
|
|
774
|
+
const [uncontrolledPage, setUncontrolledPage] = (0, import_react6.useState)(() => Math.min(Math.max(1, defaultPage), totalPages));
|
|
432
775
|
const currentPage = Math.min(Math.max(1, page ?? uncontrolledPage), totalPages);
|
|
433
776
|
const pagedData = shouldPaginate ? data.slice((currentPage - 1) * safePageSize, currentPage * safePageSize) : data;
|
|
434
|
-
const resizeState = (0,
|
|
435
|
-
const [isResizing, setIsResizing] = (0,
|
|
777
|
+
const resizeState = (0, import_react6.useRef)();
|
|
778
|
+
const [isResizing, setIsResizing] = (0, import_react6.useState)(false);
|
|
436
779
|
const sizes2 = columnSizes ? getInitialColumnSizes(headers, data, columnSizes, safeMinWidth).map((size) => Math.max(safeMinWidth, size)) : uncontrolledSizes.map((size) => Math.max(safeMinWidth, size));
|
|
437
|
-
(0,
|
|
780
|
+
(0, import_react6.useEffect)(() => {
|
|
438
781
|
if (columnSizes) return;
|
|
439
782
|
setUncontrolledSizes((currentSizes) => {
|
|
440
783
|
const nextSizes = generatedSizes.map((generatedSize, index) => currentSizes[index] ?? generatedSize);
|
|
441
784
|
return sameSizes(currentSizes, nextSizes) ? currentSizes : nextSizes;
|
|
442
785
|
});
|
|
443
786
|
}, [columnSizes, generatedSizes]);
|
|
444
|
-
(0,
|
|
787
|
+
(0, import_react6.useEffect)(() => {
|
|
445
788
|
if (page === void 0 && uncontrolledPage > totalPages) setUncontrolledPage(totalPages);
|
|
446
789
|
}, [page, totalPages, uncontrolledPage]);
|
|
447
|
-
const updateColumnSize = (0,
|
|
790
|
+
const updateColumnSize = (0, import_react6.useCallback)((columnIndex, nextSize) => {
|
|
448
791
|
const clampedSize = Math.min(MAX_COLUMN_WIDTH, Math.max(safeMinWidth, Math.round(nextSize)));
|
|
449
792
|
const nextSizes = sizes2.map((size, index) => index === columnIndex ? clampedSize : size);
|
|
450
793
|
if (!columnSizes) setUncontrolledSizes(nextSizes);
|
|
451
794
|
onColumnResize?.(nextSizes, columnIndex);
|
|
452
795
|
}, [columnSizes, onColumnResize, safeMinWidth, sizes2]);
|
|
453
|
-
(0,
|
|
796
|
+
(0, import_react6.useEffect)(() => {
|
|
454
797
|
const onPointerMove = (event) => {
|
|
455
798
|
const activeResize = resizeState.current;
|
|
456
799
|
if (!activeResize) return;
|
|
@@ -474,14 +817,14 @@ function DataTable({
|
|
|
474
817
|
if (nextPage !== currentPage) onPageChange?.(nextPage);
|
|
475
818
|
};
|
|
476
819
|
const resolvedPaginationPosition = paginationPosition === "middle-bottom" ? "bottom-center" : paginationPosition;
|
|
477
|
-
const paginationControl = shouldPaginate && totalPages > 1 ? /* @__PURE__ */ (0,
|
|
478
|
-
return /* @__PURE__ */ (0,
|
|
820
|
+
const paginationControl = shouldPaginate && totalPages > 1 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `fe-table__pagination fe-table__pagination--${resolvedPaginationPosition}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Pagination, { page: currentPage, totalPages, onPageChange: changePage }) }) : null;
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fe-table", "data-resizing": isResizing || void 0, children: [
|
|
479
822
|
resolvedPaginationPosition === "top-right" && paginationControl,
|
|
480
|
-
/* @__PURE__ */ (0,
|
|
481
|
-
/* @__PURE__ */ (0,
|
|
482
|
-
/* @__PURE__ */ (0,
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
484
|
-
/* @__PURE__ */ (0,
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("table", { className: ["fe-table__table", className].filter(Boolean).join(" "), "data-fe-table": true, "data-striped": striped || void 0, ...props, children: [
|
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("colgroup", { children: sizes2.map((size, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("col", { style: { width: `${size}px` } }, index)) }),
|
|
825
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("tr", { children: Array.from({ length: columnCount }, (_, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("th", { scope: "col", children: [
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fe-table__header-content", children: headers[columnIndex] ?? `Column ${columnIndex + 1}` }),
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
485
828
|
"span",
|
|
486
829
|
{
|
|
487
830
|
className: "fe-table__resize-handle",
|
|
@@ -505,7 +848,7 @@ function DataTable({
|
|
|
505
848
|
}
|
|
506
849
|
)
|
|
507
850
|
] }, columnIndex)) }) }),
|
|
508
|
-
/* @__PURE__ */ (0,
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("tbody", { children: pagedData.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("tr", { children: Array.from({ length: columnCount }, (_, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { children: row[columnIndex] }, columnIndex)) }, shouldPaginate ? (currentPage - 1) * safePageSize + rowIndex : rowIndex)) })
|
|
509
852
|
] }),
|
|
510
853
|
resolvedPaginationPosition !== "top-right" && paginationControl
|
|
511
854
|
] });
|
|
@@ -523,33 +866,33 @@ function Table({
|
|
|
523
866
|
paginationPosition,
|
|
524
867
|
...props
|
|
525
868
|
}) {
|
|
526
|
-
if (headers || data) return /* @__PURE__ */ (0,
|
|
527
|
-
return /* @__PURE__ */ (0,
|
|
869
|
+
if (headers || data) return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DataTable, { headers: headers ?? [], data: data ?? [], striped: striped ?? true, pagination, pageSize, page, defaultPage, onPageChange, paginationPosition, ...props });
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TableContext.Provider, { value: { striped: striped ?? false }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("table", { "data-fe-table": true, "data-striped": striped || void 0, ...props, children }) });
|
|
528
871
|
}
|
|
529
872
|
function TableHead(props) {
|
|
530
|
-
return /* @__PURE__ */ (0,
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("thead", { ...props });
|
|
531
874
|
}
|
|
532
875
|
function TableBody(props) {
|
|
533
|
-
return /* @__PURE__ */ (0,
|
|
876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("tbody", { ...props });
|
|
534
877
|
}
|
|
535
878
|
function TableRow({ children, ...props }) {
|
|
536
|
-
const { striped } = (0,
|
|
537
|
-
return /* @__PURE__ */ (0,
|
|
879
|
+
const { striped } = (0, import_react6.useContext)(TableContext);
|
|
880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("tr", { "data-striped": striped || void 0, ...props, children });
|
|
538
881
|
}
|
|
539
882
|
function TableCell({ children, ...props }) {
|
|
540
|
-
return /* @__PURE__ */ (0,
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("td", { ...props, children });
|
|
541
884
|
}
|
|
542
885
|
function TableHeader({ children, ...props }) {
|
|
543
|
-
return /* @__PURE__ */ (0,
|
|
886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("th", { scope: "col", ...props, children });
|
|
544
887
|
}
|
|
545
888
|
function TableCaption(props) {
|
|
546
|
-
return /* @__PURE__ */ (0,
|
|
889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("caption", { ...props });
|
|
547
890
|
}
|
|
548
891
|
|
|
549
892
|
// packages/toggle/src/index.tsx
|
|
550
|
-
var
|
|
551
|
-
var
|
|
552
|
-
var Toggle = (0,
|
|
893
|
+
var import_react7 = require("react");
|
|
894
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
895
|
+
var Toggle = (0, import_react7.forwardRef)(function Toggle2({
|
|
553
896
|
color = "#16a34a",
|
|
554
897
|
label,
|
|
555
898
|
labelPosition = "right",
|
|
@@ -563,9 +906,9 @@ var Toggle = (0, import_react4.forwardRef)(function Toggle2({
|
|
|
563
906
|
"--fe-toggle-color": color,
|
|
564
907
|
...style
|
|
565
908
|
};
|
|
566
|
-
return /* @__PURE__ */ (0,
|
|
567
|
-
label && labelPosition === "top" && /* @__PURE__ */ (0,
|
|
568
|
-
/* @__PURE__ */ (0,
|
|
909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: classes, style: toggleStyle, children: [
|
|
910
|
+
label && labelPosition === "top" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "fe-toggle__label", children: label }),
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
569
912
|
"input",
|
|
570
913
|
{
|
|
571
914
|
ref,
|
|
@@ -576,18 +919,18 @@ var Toggle = (0, import_react4.forwardRef)(function Toggle2({
|
|
|
576
919
|
...props
|
|
577
920
|
}
|
|
578
921
|
),
|
|
579
|
-
/* @__PURE__ */ (0,
|
|
580
|
-
label && labelPosition === "right" && /* @__PURE__ */ (0,
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "fe-toggle__control", "aria-hidden": "true" }),
|
|
923
|
+
label && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "fe-toggle__label", children: label })
|
|
581
924
|
] });
|
|
582
925
|
});
|
|
583
926
|
Toggle.displayName = "Toggle";
|
|
584
927
|
|
|
585
928
|
// packages/drawer/src/index.tsx
|
|
586
|
-
var
|
|
929
|
+
var import_react8 = require("react");
|
|
587
930
|
var import_react_dom = require("react-dom");
|
|
588
|
-
var
|
|
931
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
589
932
|
function Drawer({ open, onClose, title, footer, side = "right", width = 400, fullScreen = false, children, closeOnBackdropClick = true, className, style, ...props }) {
|
|
590
|
-
(0,
|
|
933
|
+
(0, import_react8.useEffect)(() => {
|
|
591
934
|
if (!open) return;
|
|
592
935
|
const onKeyDown = (event) => {
|
|
593
936
|
if (event.key === "Escape") onClose();
|
|
@@ -597,28 +940,28 @@ function Drawer({ open, onClose, title, footer, side = "right", width = 400, ful
|
|
|
597
940
|
}, [onClose, open]);
|
|
598
941
|
if (!open || typeof document === "undefined") return null;
|
|
599
942
|
const panelStyle = !fullScreen && (side === "left" || side === "right") ? { ...style, width: typeof width === "number" ? `${width}px` : width } : style;
|
|
600
|
-
return (0, import_react_dom.createPortal)(/* @__PURE__ */ (0,
|
|
943
|
+
return (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "fe-drawer-backdrop", role: "presentation", onMouseDown: (event) => {
|
|
601
944
|
if (event.target === event.currentTarget && closeOnBackdropClick) onClose();
|
|
602
|
-
}, children: /* @__PURE__ */ (0,
|
|
603
|
-
/* @__PURE__ */ (0,
|
|
604
|
-
title && /* @__PURE__ */ (0,
|
|
605
|
-
/* @__PURE__ */ (0,
|
|
945
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("aside", { className: ["fe-drawer", `fe-drawer--${side}`, fullScreen && "fe-drawer--full-screen", className].filter(Boolean).join(" "), style: panelStyle, role: "dialog", "aria-modal": "true", "aria-label": typeof title === "string" ? title : "Drawer", ...props, children: [
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("header", { className: "fe-drawer__header", children: [
|
|
947
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { children: title }),
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", "aria-label": "Close drawer", onClick: onClose, children: "\xD7" })
|
|
606
949
|
] }),
|
|
607
|
-
/* @__PURE__ */ (0,
|
|
608
|
-
footer && /* @__PURE__ */ (0,
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "fe-drawer__body", children }),
|
|
951
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("footer", { className: "fe-drawer__footer", children: footer })
|
|
609
952
|
] }) }), document.body);
|
|
610
953
|
}
|
|
611
954
|
|
|
612
955
|
// packages/form-controls/src/controls/TextInput/text-input.tsx
|
|
613
|
-
var
|
|
956
|
+
var import_react10 = require("react");
|
|
614
957
|
|
|
615
958
|
// packages/tooltip/src/index.tsx
|
|
616
|
-
var
|
|
617
|
-
var
|
|
959
|
+
var import_react9 = require("react");
|
|
960
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
618
961
|
function Tooltip({ content, children, placement = "top", disabled, className, ...props }) {
|
|
619
|
-
const [visible, setVisible] = (0,
|
|
620
|
-
const id = (0,
|
|
621
|
-
const trigger = (0,
|
|
962
|
+
const [visible, setVisible] = (0, import_react9.useState)(false);
|
|
963
|
+
const id = (0, import_react9.useId)();
|
|
964
|
+
const trigger = (0, import_react9.cloneElement)(children, { "aria-describedby": visible ? id : void 0, onMouseEnter: (event) => {
|
|
622
965
|
children.props.onMouseEnter?.(event);
|
|
623
966
|
setVisible(true);
|
|
624
967
|
}, onMouseLeave: (event) => {
|
|
@@ -631,14 +974,14 @@ function Tooltip({ content, children, placement = "top", disabled, className, ..
|
|
|
631
974
|
children.props.onBlur?.(event);
|
|
632
975
|
setVisible(false);
|
|
633
976
|
} });
|
|
634
|
-
return /* @__PURE__ */ (0,
|
|
977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: ["fe-tooltip", `fe-tooltip--${placement}`, className].filter(Boolean).join(" "), ...props, children: [
|
|
635
978
|
trigger,
|
|
636
|
-
visible && !disabled && /* @__PURE__ */ (0,
|
|
979
|
+
visible && !disabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { id, role: "tooltip", className: "fe-tooltip__content", children: content })
|
|
637
980
|
] });
|
|
638
981
|
}
|
|
639
982
|
|
|
640
983
|
// packages/form-controls/src/controls/Field/field.tsx
|
|
641
|
-
var
|
|
984
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
642
985
|
function getFieldError(error, errorMessage) {
|
|
643
986
|
if (errorMessage !== void 0 && errorMessage !== null) return errorMessage;
|
|
644
987
|
if (typeof error !== "boolean") return error;
|
|
@@ -655,10 +998,10 @@ function FieldLabel({
|
|
|
655
998
|
isRequired = false
|
|
656
999
|
}) {
|
|
657
1000
|
if (!label) return null;
|
|
658
|
-
return /* @__PURE__ */ (0,
|
|
659
|
-
/* @__PURE__ */ (0,
|
|
660
|
-
isRequired && /* @__PURE__ */ (0,
|
|
661
|
-
description && descriptionDisplay === "tooltip" && /* @__PURE__ */ (0,
|
|
1001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "fe-field__label", children: [
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { id, children: label }),
|
|
1003
|
+
isRequired && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "fe-field__required", "aria-hidden": "true", children: "*" }),
|
|
1004
|
+
description && descriptionDisplay === "tooltip" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Tooltip, { content: description, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
662
1005
|
"span",
|
|
663
1006
|
{
|
|
664
1007
|
className: "fe-field__info",
|
|
@@ -677,7 +1020,7 @@ function FieldMessage({
|
|
|
677
1020
|
descriptionDisplay
|
|
678
1021
|
}) {
|
|
679
1022
|
if (error !== void 0 && error !== false && error !== null)
|
|
680
|
-
return /* @__PURE__ */ (0,
|
|
1023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
681
1024
|
"span",
|
|
682
1025
|
{
|
|
683
1026
|
id,
|
|
@@ -687,13 +1030,13 @@ function FieldMessage({
|
|
|
687
1030
|
}
|
|
688
1031
|
);
|
|
689
1032
|
if (description && descriptionDisplay === "inline")
|
|
690
|
-
return /* @__PURE__ */ (0,
|
|
1033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { id, className: "fe-field__message", children: description });
|
|
691
1034
|
return null;
|
|
692
1035
|
}
|
|
693
1036
|
|
|
694
1037
|
// packages/form-controls/src/controls/TextInput/text-input.tsx
|
|
695
|
-
var
|
|
696
|
-
var TextInput = (0,
|
|
1038
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1039
|
+
var TextInput = (0, import_react10.forwardRef)(
|
|
697
1040
|
function TextInput2({
|
|
698
1041
|
value,
|
|
699
1042
|
defaultValue = "",
|
|
@@ -723,12 +1066,12 @@ var TextInput = (0, import_react7.forwardRef)(
|
|
|
723
1066
|
"aria-labelledby": ariaLabelledBy,
|
|
724
1067
|
...props
|
|
725
1068
|
}, ref) {
|
|
726
|
-
const generatedId = (0,
|
|
1069
|
+
const generatedId = (0, import_react10.useId)();
|
|
727
1070
|
const inputId = id ?? generatedId + "-input";
|
|
728
1071
|
const labelId = generatedId + "-label";
|
|
729
1072
|
const messageId2 = generatedId + "-message";
|
|
730
1073
|
const controlled = value !== void 0;
|
|
731
|
-
const [internalValue, setInternalValue] = (0,
|
|
1074
|
+
const [internalValue, setInternalValue] = (0, import_react10.useState)(defaultValue);
|
|
732
1075
|
const currentValue = controlled ? value : internalValue;
|
|
733
1076
|
const fieldError = getFieldError(error, errorMessage);
|
|
734
1077
|
const hasError = fieldError !== void 0 && fieldError !== false && fieldError !== null;
|
|
@@ -749,7 +1092,7 @@ var TextInput = (0, import_react7.forwardRef)(
|
|
|
749
1092
|
onValueChange?.("");
|
|
750
1093
|
onClear?.();
|
|
751
1094
|
};
|
|
752
|
-
return /* @__PURE__ */ (0,
|
|
1095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
753
1096
|
"div",
|
|
754
1097
|
{
|
|
755
1098
|
className: [
|
|
@@ -758,7 +1101,7 @@ var TextInput = (0, import_react7.forwardRef)(
|
|
|
758
1101
|
className
|
|
759
1102
|
].filter(Boolean).join(" "),
|
|
760
1103
|
children: [
|
|
761
|
-
/* @__PURE__ */ (0,
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
762
1105
|
FieldLabel,
|
|
763
1106
|
{
|
|
764
1107
|
id: labelId,
|
|
@@ -768,10 +1111,10 @@ var TextInput = (0, import_react7.forwardRef)(
|
|
|
768
1111
|
isRequired
|
|
769
1112
|
}
|
|
770
1113
|
),
|
|
771
|
-
/* @__PURE__ */ (0,
|
|
772
|
-
resolvedPrefix && /* @__PURE__ */ (0,
|
|
773
|
-
/* @__PURE__ */ (0,
|
|
774
|
-
/* @__PURE__ */ (0,
|
|
1114
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "fe-text-input__control", children: [
|
|
1115
|
+
resolvedPrefix && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fe-text-input__prefix", children: resolvedPrefix }),
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "fe-text-input__input-wrap", children: [
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
775
1118
|
"input",
|
|
776
1119
|
{
|
|
777
1120
|
ref,
|
|
@@ -793,26 +1136,26 @@ var TextInput = (0, import_react7.forwardRef)(
|
|
|
793
1136
|
...props
|
|
794
1137
|
}
|
|
795
1138
|
),
|
|
796
|
-
isRequired && placeholder && !currentValue && /* @__PURE__ */ (0,
|
|
797
|
-
/* @__PURE__ */ (0,
|
|
798
|
-
/* @__PURE__ */ (0,
|
|
1139
|
+
isRequired && placeholder && !currentValue && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "fe-text-input__placeholder", "aria-hidden": "true", children: [
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: placeholder }),
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fe-field__required", children: "*" })
|
|
799
1142
|
] })
|
|
800
1143
|
] }),
|
|
801
|
-
resolvedSuffix && /* @__PURE__ */ (0,
|
|
802
|
-
clearable && currentValue && !disabled && !readOnly && /* @__PURE__ */ (0,
|
|
1144
|
+
resolvedSuffix && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fe-text-input__suffix", children: resolvedSuffix }),
|
|
1145
|
+
clearable && currentValue && !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
803
1146
|
Button,
|
|
804
1147
|
{
|
|
805
1148
|
hierarchy: "tertiary-gray",
|
|
806
1149
|
size: "24",
|
|
807
1150
|
iconOnly: true,
|
|
808
|
-
icon: /* @__PURE__ */ (0,
|
|
1151
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseIcon, { size: 14 }),
|
|
809
1152
|
"aria-label": clearLabel,
|
|
810
1153
|
onClick: clear,
|
|
811
1154
|
className: "fe-text-input__clear"
|
|
812
1155
|
}
|
|
813
1156
|
)
|
|
814
1157
|
] }),
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
816
1159
|
FieldMessage,
|
|
817
1160
|
{
|
|
818
1161
|
id: messageId2,
|
|
@@ -829,9 +1172,9 @@ var TextInput = (0, import_react7.forwardRef)(
|
|
|
829
1172
|
TextInput.displayName = "TextInput";
|
|
830
1173
|
|
|
831
1174
|
// packages/form-controls/src/controls/TextArea/text-area.tsx
|
|
832
|
-
var
|
|
833
|
-
var
|
|
834
|
-
var TextArea = (0,
|
|
1175
|
+
var import_react11 = require("react");
|
|
1176
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1177
|
+
var TextArea = (0, import_react11.forwardRef)(
|
|
835
1178
|
function TextArea2({
|
|
836
1179
|
value,
|
|
837
1180
|
defaultValue = "",
|
|
@@ -858,13 +1201,13 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
858
1201
|
"aria-labelledby": ariaLabelledBy,
|
|
859
1202
|
...props
|
|
860
1203
|
}, ref) {
|
|
861
|
-
const generatedId = (0,
|
|
1204
|
+
const generatedId = (0, import_react11.useId)();
|
|
862
1205
|
const inputId = id ?? generatedId + "-input";
|
|
863
1206
|
const labelId = generatedId + "-label";
|
|
864
1207
|
const messageId2 = generatedId + "-message";
|
|
865
1208
|
const controlled = value !== void 0;
|
|
866
|
-
const [internalValue, setInternalValue] = (0,
|
|
867
|
-
const textareaRef = (0,
|
|
1209
|
+
const [internalValue, setInternalValue] = (0, import_react11.useState)(defaultValue);
|
|
1210
|
+
const textareaRef = (0, import_react11.useRef)(null);
|
|
868
1211
|
const currentValue = controlled ? value : internalValue;
|
|
869
1212
|
const fieldError = getFieldError(error, errorMessage);
|
|
870
1213
|
const hasError = fieldError !== void 0 && fieldError !== false && fieldError !== null;
|
|
@@ -882,8 +1225,8 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
882
1225
|
textarea.style.height = "auto";
|
|
883
1226
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
884
1227
|
};
|
|
885
|
-
(0,
|
|
886
|
-
(0,
|
|
1228
|
+
(0, import_react11.useImperativeHandle)(ref, () => textareaRef.current, []);
|
|
1229
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
887
1230
|
if (autosize && textareaRef.current) {
|
|
888
1231
|
resizeToContent(textareaRef.current);
|
|
889
1232
|
}
|
|
@@ -893,7 +1236,7 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
893
1236
|
onValueChange?.("");
|
|
894
1237
|
onClear?.();
|
|
895
1238
|
};
|
|
896
|
-
return /* @__PURE__ */ (0,
|
|
1239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
897
1240
|
"div",
|
|
898
1241
|
{
|
|
899
1242
|
className: [
|
|
@@ -903,7 +1246,7 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
903
1246
|
className
|
|
904
1247
|
].filter(Boolean).join(" "),
|
|
905
1248
|
children: [
|
|
906
|
-
/* @__PURE__ */ (0,
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
907
1250
|
FieldLabel,
|
|
908
1251
|
{
|
|
909
1252
|
id: labelId,
|
|
@@ -913,8 +1256,8 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
913
1256
|
isRequired
|
|
914
1257
|
}
|
|
915
1258
|
),
|
|
916
|
-
/* @__PURE__ */ (0,
|
|
917
|
-
/* @__PURE__ */ (0,
|
|
1259
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "fe-text-area__control", children: [
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
918
1261
|
"textarea",
|
|
919
1262
|
{
|
|
920
1263
|
ref: textareaRef,
|
|
@@ -937,24 +1280,24 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
937
1280
|
...props
|
|
938
1281
|
}
|
|
939
1282
|
),
|
|
940
|
-
isRequired && placeholder && !currentValue && /* @__PURE__ */ (0,
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
942
|
-
/* @__PURE__ */ (0,
|
|
1283
|
+
isRequired && placeholder && !currentValue && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "fe-text-area__placeholder", "aria-hidden": "true", children: [
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: placeholder }),
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "fe-field__required", children: "*" })
|
|
943
1286
|
] }),
|
|
944
|
-
clearable && currentValue && !disabled && !readOnly && /* @__PURE__ */ (0,
|
|
1287
|
+
clearable && currentValue && !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
945
1288
|
Button,
|
|
946
1289
|
{
|
|
947
1290
|
hierarchy: "tertiary-gray",
|
|
948
1291
|
size: "24",
|
|
949
1292
|
iconOnly: true,
|
|
950
|
-
icon: /* @__PURE__ */ (0,
|
|
1293
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CloseIcon, { size: 14 }),
|
|
951
1294
|
"aria-label": clearLabel,
|
|
952
1295
|
onClick: clear,
|
|
953
1296
|
className: "fe-text-area__clear"
|
|
954
1297
|
}
|
|
955
1298
|
)
|
|
956
1299
|
] }),
|
|
957
|
-
/* @__PURE__ */ (0,
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
958
1301
|
FieldMessage,
|
|
959
1302
|
{
|
|
960
1303
|
id: messageId2,
|
|
@@ -971,10 +1314,10 @@ var TextArea = (0, import_react8.forwardRef)(
|
|
|
971
1314
|
TextArea.displayName = "TextArea";
|
|
972
1315
|
|
|
973
1316
|
// packages/form-controls/src/controls/Selection/selection.tsx
|
|
974
|
-
var
|
|
1317
|
+
var import_react12 = require("react");
|
|
975
1318
|
var import_react_dom2 = require("react-dom");
|
|
976
|
-
var
|
|
977
|
-
var Selection = (0,
|
|
1319
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1320
|
+
var Selection = (0, import_react12.forwardRef)(
|
|
978
1321
|
function Selection2({
|
|
979
1322
|
className,
|
|
980
1323
|
label,
|
|
@@ -1003,7 +1346,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1003
1346
|
"aria-labelledby": ariaLabelledBy,
|
|
1004
1347
|
...props
|
|
1005
1348
|
}, ref) {
|
|
1006
|
-
const generatedId = (0,
|
|
1349
|
+
const generatedId = (0, import_react12.useId)();
|
|
1007
1350
|
const triggerId = id ?? generatedId + "-trigger";
|
|
1008
1351
|
const listboxId = triggerId + "-listbox";
|
|
1009
1352
|
const labelId = generatedId + "-label";
|
|
@@ -1021,7 +1364,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1021
1364
|
label ? labelId : void 0
|
|
1022
1365
|
);
|
|
1023
1366
|
const isControlled = value !== void 0;
|
|
1024
|
-
const [internalValue, setInternalValue] = (0,
|
|
1367
|
+
const [internalValue, setInternalValue] = (0, import_react12.useState)(
|
|
1025
1368
|
defaultValue ?? (multiple ? [] : "")
|
|
1026
1369
|
);
|
|
1027
1370
|
const selectedValue = isControlled ? value : internalValue;
|
|
@@ -1029,13 +1372,13 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1029
1372
|
const selectedOptions = options.filter(
|
|
1030
1373
|
(option) => selectedValues.some((item) => String(item) === String(option.value))
|
|
1031
1374
|
);
|
|
1032
|
-
const [open, setOpen] = (0,
|
|
1033
|
-
const [query, setQuery] = (0,
|
|
1034
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
1035
|
-
const rootRef = (0,
|
|
1036
|
-
const menuRef = (0,
|
|
1037
|
-
const [menuPosition, setMenuPosition] = (0,
|
|
1038
|
-
(0,
|
|
1375
|
+
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
1376
|
+
const [query, setQuery] = (0, import_react12.useState)("");
|
|
1377
|
+
const [activeIndex, setActiveIndex] = (0, import_react12.useState)(0);
|
|
1378
|
+
const rootRef = (0, import_react12.useRef)(null);
|
|
1379
|
+
const menuRef = (0, import_react12.useRef)(null);
|
|
1380
|
+
const [menuPosition, setMenuPosition] = (0, import_react12.useState)(null);
|
|
1381
|
+
(0, import_react12.useEffect)(() => {
|
|
1039
1382
|
const close = (event) => {
|
|
1040
1383
|
const target = event.target;
|
|
1041
1384
|
if (!rootRef.current?.contains(target) && !menuRef.current?.contains(target))
|
|
@@ -1044,7 +1387,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1044
1387
|
document.addEventListener("mousedown", close);
|
|
1045
1388
|
return () => document.removeEventListener("mousedown", close);
|
|
1046
1389
|
}, []);
|
|
1047
|
-
(0,
|
|
1390
|
+
(0, import_react12.useLayoutEffect)(() => {
|
|
1048
1391
|
if (!open) return;
|
|
1049
1392
|
const updateMenuPosition = () => {
|
|
1050
1393
|
const rect = rootRef.current?.getBoundingClientRect();
|
|
@@ -1121,7 +1464,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1121
1464
|
}
|
|
1122
1465
|
if (event.key === "Escape") setOpen(false);
|
|
1123
1466
|
};
|
|
1124
|
-
return /* @__PURE__ */ (0,
|
|
1467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1125
1468
|
"div",
|
|
1126
1469
|
{
|
|
1127
1470
|
ref,
|
|
@@ -1136,7 +1479,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1136
1479
|
].filter(Boolean).join(" "),
|
|
1137
1480
|
...props,
|
|
1138
1481
|
children: [
|
|
1139
|
-
/* @__PURE__ */ (0,
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1140
1483
|
FieldLabel,
|
|
1141
1484
|
{
|
|
1142
1485
|
id: labelId,
|
|
@@ -1146,8 +1489,8 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1146
1489
|
isRequired
|
|
1147
1490
|
}
|
|
1148
1491
|
),
|
|
1149
|
-
/* @__PURE__ */ (0,
|
|
1150
|
-
name && selectedValues.map((item) => /* @__PURE__ */ (0,
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref: rootRef, className: "fe-selection__control", children: [
|
|
1493
|
+
name && selectedValues.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1151
1494
|
"input",
|
|
1152
1495
|
{
|
|
1153
1496
|
type: "hidden",
|
|
@@ -1156,7 +1499,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1156
1499
|
},
|
|
1157
1500
|
String(item)
|
|
1158
1501
|
)),
|
|
1159
|
-
/* @__PURE__ */ (0,
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1160
1503
|
"button",
|
|
1161
1504
|
{
|
|
1162
1505
|
id: triggerId,
|
|
@@ -1174,7 +1517,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1174
1517
|
onClick: () => setOpen((current) => !current),
|
|
1175
1518
|
onKeyDown: onTriggerKeyDown,
|
|
1176
1519
|
children: [
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
1520
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1178
1521
|
"span",
|
|
1179
1522
|
{
|
|
1180
1523
|
className: [
|
|
@@ -1182,30 +1525,30 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1182
1525
|
!selectedOptions.length && "is-placeholder",
|
|
1183
1526
|
tag && selectedOptions.length > 1 && "is-tags"
|
|
1184
1527
|
].filter(Boolean).join(" "),
|
|
1185
|
-
children: displayLabel ? tag && multiple ? selectedOptions.map((option) => /* @__PURE__ */ (0,
|
|
1528
|
+
children: displayLabel ? tag && multiple ? selectedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1186
1529
|
"span",
|
|
1187
1530
|
{
|
|
1188
1531
|
className: "fe-selection__tag",
|
|
1189
1532
|
children: [
|
|
1190
1533
|
option.label,
|
|
1191
|
-
/* @__PURE__ */ (0,
|
|
1534
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", children: "\xD7" })
|
|
1192
1535
|
]
|
|
1193
1536
|
},
|
|
1194
1537
|
String(option.value)
|
|
1195
|
-
)) : displayLabel.map((item, index) => /* @__PURE__ */ (0,
|
|
1538
|
+
)) : displayLabel.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
|
|
1196
1539
|
item,
|
|
1197
1540
|
index < displayLabel.length - 1 ? ", " : ""
|
|
1198
|
-
] }, index)) : /* @__PURE__ */ (0,
|
|
1199
|
-
/* @__PURE__ */ (0,
|
|
1200
|
-
isRequired && /* @__PURE__ */ (0,
|
|
1541
|
+
] }, index)) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: placeholder }),
|
|
1543
|
+
isRequired && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fe-field__required", "aria-hidden": "true", children: "*" })
|
|
1201
1544
|
] })
|
|
1202
1545
|
}
|
|
1203
1546
|
),
|
|
1204
|
-
/* @__PURE__ */ (0,
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fe-selection__actions", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "fe-selection__chevron", "aria-hidden": "true" }) })
|
|
1205
1548
|
]
|
|
1206
1549
|
}
|
|
1207
1550
|
),
|
|
1208
|
-
clearable && selectedOptions.length > 0 && !disabled && /* @__PURE__ */ (0,
|
|
1551
|
+
clearable && selectedOptions.length > 0 && !disabled && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1209
1552
|
"button",
|
|
1210
1553
|
{
|
|
1211
1554
|
type: "button",
|
|
@@ -1215,7 +1558,7 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1215
1558
|
}
|
|
1216
1559
|
),
|
|
1217
1560
|
open && menuPosition && (0, import_react_dom2.createPortal)(
|
|
1218
|
-
/* @__PURE__ */ (0,
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1219
1562
|
"div",
|
|
1220
1563
|
{
|
|
1221
1564
|
ref: menuRef,
|
|
@@ -1230,9 +1573,9 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1230
1573
|
role: "listbox",
|
|
1231
1574
|
"aria-multiselectable": multiple || void 0,
|
|
1232
1575
|
children: [
|
|
1233
|
-
searchable && /* @__PURE__ */ (0,
|
|
1234
|
-
/* @__PURE__ */ (0,
|
|
1235
|
-
/* @__PURE__ */ (0,
|
|
1576
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "fe-selection__search", children: [
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", children: "\u2315" }),
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1236
1579
|
"input",
|
|
1237
1580
|
{
|
|
1238
1581
|
autoFocus: true,
|
|
@@ -1246,11 +1589,11 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1246
1589
|
}
|
|
1247
1590
|
)
|
|
1248
1591
|
] }),
|
|
1249
|
-
/* @__PURE__ */ (0,
|
|
1592
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "fe-selection__options", children: filteredOptions.length ? filteredOptions.map((option, index) => {
|
|
1250
1593
|
const isSelected = selectedValues.some(
|
|
1251
1594
|
(item) => String(item) === String(option.value)
|
|
1252
1595
|
);
|
|
1253
|
-
return /* @__PURE__ */ (0,
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1254
1597
|
"button",
|
|
1255
1598
|
{
|
|
1256
1599
|
type: "button",
|
|
@@ -1264,8 +1607,8 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1264
1607
|
onMouseMove: () => setActiveIndex(index),
|
|
1265
1608
|
onClick: () => choose(option),
|
|
1266
1609
|
children: [
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1268
|
-
isSelected && /* @__PURE__ */ (0,
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: option.label }),
|
|
1611
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1269
1612
|
"span",
|
|
1270
1613
|
{
|
|
1271
1614
|
className: "fe-selection__check",
|
|
@@ -1277,14 +1620,14 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1277
1620
|
},
|
|
1278
1621
|
String(option.value)
|
|
1279
1622
|
);
|
|
1280
|
-
}) : /* @__PURE__ */ (0,
|
|
1623
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "fe-selection__empty", children: "No matching options" }) })
|
|
1281
1624
|
]
|
|
1282
1625
|
}
|
|
1283
1626
|
),
|
|
1284
1627
|
document.body
|
|
1285
1628
|
)
|
|
1286
1629
|
] }),
|
|
1287
|
-
/* @__PURE__ */ (0,
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1288
1631
|
FieldMessage,
|
|
1289
1632
|
{
|
|
1290
1633
|
id: messageId2,
|
|
@@ -1301,8 +1644,8 @@ var Selection = (0, import_react9.forwardRef)(
|
|
|
1301
1644
|
Selection.displayName = "Selection";
|
|
1302
1645
|
|
|
1303
1646
|
// packages/form-controls/src/controls/NumberInput/number-input.tsx
|
|
1304
|
-
var
|
|
1305
|
-
var
|
|
1647
|
+
var import_react13 = require("react");
|
|
1648
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1306
1649
|
function formatNumber(value, decimals = 2, thousandSeparator = ",", decimalSeparator = ".") {
|
|
1307
1650
|
return new Intl.NumberFormat("en-US", {
|
|
1308
1651
|
minimumFractionDigits: 0,
|
|
@@ -1359,7 +1702,7 @@ function normalizeNumberInput(raw, options) {
|
|
|
1359
1702
|
value
|
|
1360
1703
|
};
|
|
1361
1704
|
}
|
|
1362
|
-
var NumberInput = (0,
|
|
1705
|
+
var NumberInput = (0, import_react13.forwardRef)(
|
|
1363
1706
|
function NumberInput2({
|
|
1364
1707
|
value,
|
|
1365
1708
|
defaultValue = null,
|
|
@@ -1396,14 +1739,14 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1396
1739
|
onKeyDown,
|
|
1397
1740
|
...props
|
|
1398
1741
|
}, ref) {
|
|
1399
|
-
const inputRef = (0,
|
|
1400
|
-
const generatedId = (0,
|
|
1742
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
1743
|
+
const generatedId = (0, import_react13.useId)();
|
|
1401
1744
|
const messageId2 = generatedId + "-message";
|
|
1402
1745
|
const isControlled = value !== void 0;
|
|
1403
|
-
const [internalValue, setInternalValue] = (0,
|
|
1404
|
-
const [focused, setFocused] = (0,
|
|
1746
|
+
const [internalValue, setInternalValue] = (0, import_react13.useState)(defaultValue);
|
|
1747
|
+
const [focused, setFocused] = (0, import_react13.useState)(false);
|
|
1405
1748
|
const actualValue = isControlled ? value ?? null : internalValue;
|
|
1406
|
-
const [text, setText] = (0,
|
|
1749
|
+
const [text, setText] = (0, import_react13.useState)(
|
|
1407
1750
|
actualValue === null ? "" : formatNumber(
|
|
1408
1751
|
actualValue,
|
|
1409
1752
|
decimals,
|
|
@@ -1426,7 +1769,7 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1426
1769
|
);
|
|
1427
1770
|
const resolvedPrefix = prefix ?? Prefix;
|
|
1428
1771
|
const resolvedSuffix = suffix ?? Suffix;
|
|
1429
|
-
(0,
|
|
1772
|
+
(0, import_react13.useEffect)(() => {
|
|
1430
1773
|
if (!focused)
|
|
1431
1774
|
setText(
|
|
1432
1775
|
actualValue === null ? "" : formatNumber(
|
|
@@ -1480,7 +1823,7 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1480
1823
|
const stepIsUsable = Number.isFinite(step) && step > 0;
|
|
1481
1824
|
const disableIncrement = Boolean(props.disabled || props.readOnly) || !stepIsUsable || max !== void 0 && actualValue !== null && actualValue >= max;
|
|
1482
1825
|
const disableDecrement = Boolean(props.disabled || props.readOnly) || !stepIsUsable || min !== void 0 && actualValue !== null && actualValue <= min;
|
|
1483
|
-
return /* @__PURE__ */ (0,
|
|
1826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1484
1827
|
"div",
|
|
1485
1828
|
{
|
|
1486
1829
|
className: [
|
|
@@ -1489,7 +1832,7 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1489
1832
|
className
|
|
1490
1833
|
].filter(Boolean).join(" "),
|
|
1491
1834
|
children: [
|
|
1492
|
-
/* @__PURE__ */ (0,
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1493
1836
|
FieldLabel,
|
|
1494
1837
|
{
|
|
1495
1838
|
id: labelId,
|
|
@@ -1499,10 +1842,10 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1499
1842
|
isRequired
|
|
1500
1843
|
}
|
|
1501
1844
|
),
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1503
|
-
resolvedPrefix && /* @__PURE__ */ (0,
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "fe-number-input__control", children: [
|
|
1846
|
+
resolvedPrefix && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fe-number-input__prefix", children: resolvedPrefix }),
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "fe-number-input__input-wrap", children: [
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1506
1849
|
"input",
|
|
1507
1850
|
{
|
|
1508
1851
|
ref: (node) => {
|
|
@@ -1538,41 +1881,41 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1538
1881
|
"aria-describedby": describedBy
|
|
1539
1882
|
}
|
|
1540
1883
|
),
|
|
1541
|
-
isRequired && placeholder && !text && /* @__PURE__ */ (0,
|
|
1884
|
+
isRequired && placeholder && !text && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1542
1885
|
"span",
|
|
1543
1886
|
{
|
|
1544
1887
|
className: "fe-number-input__placeholder",
|
|
1545
1888
|
"aria-hidden": "true",
|
|
1546
1889
|
children: [
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: placeholder }),
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fe-field__required", children: "*" })
|
|
1549
1892
|
]
|
|
1550
1893
|
}
|
|
1551
1894
|
)
|
|
1552
1895
|
] }),
|
|
1553
|
-
resolvedSuffix && /* @__PURE__ */ (0,
|
|
1896
|
+
resolvedSuffix && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fe-number-input__suffix", children: resolvedSuffix }),
|
|
1554
1897
|
endAdornment,
|
|
1555
|
-
showStepper && /* @__PURE__ */ (0,
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1898
|
+
showStepper && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "fe-number-input__stepper", children: [
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1557
1900
|
Button,
|
|
1558
1901
|
{
|
|
1559
1902
|
hierarchy: "tertiary-gray",
|
|
1560
1903
|
size: "24",
|
|
1561
1904
|
iconOnly: true,
|
|
1562
|
-
icon: /* @__PURE__ */ (0,
|
|
1905
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronUpIcon, { size: 12 }),
|
|
1563
1906
|
"aria-label": incrementLabel,
|
|
1564
1907
|
disabled: disableIncrement,
|
|
1565
1908
|
onMouseDown: (event) => event.preventDefault(),
|
|
1566
1909
|
onClick: () => adjustValue(1)
|
|
1567
1910
|
}
|
|
1568
1911
|
),
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1570
1913
|
Button,
|
|
1571
1914
|
{
|
|
1572
1915
|
hierarchy: "tertiary-gray",
|
|
1573
1916
|
size: "24",
|
|
1574
1917
|
iconOnly: true,
|
|
1575
|
-
icon: /* @__PURE__ */ (0,
|
|
1918
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDownIcon, { size: 12 }),
|
|
1576
1919
|
"aria-label": decrementLabel,
|
|
1577
1920
|
disabled: disableDecrement,
|
|
1578
1921
|
onMouseDown: (event) => event.preventDefault(),
|
|
@@ -1581,7 +1924,7 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1581
1924
|
)
|
|
1582
1925
|
] })
|
|
1583
1926
|
] }),
|
|
1584
|
-
/* @__PURE__ */ (0,
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1585
1928
|
FieldMessage,
|
|
1586
1929
|
{
|
|
1587
1930
|
id: messageId2,
|
|
@@ -1598,8 +1941,8 @@ var NumberInput = (0, import_react10.forwardRef)(
|
|
|
1598
1941
|
NumberInput.displayName = "NumberInput";
|
|
1599
1942
|
|
|
1600
1943
|
// packages/form-controls/src/controls/CurrencyInput/currency-input.tsx
|
|
1601
|
-
var
|
|
1602
|
-
var
|
|
1944
|
+
var import_react14 = require("react");
|
|
1945
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1603
1946
|
function CurrencyInput({
|
|
1604
1947
|
suffix = "VND",
|
|
1605
1948
|
currencies,
|
|
@@ -1610,13 +1953,13 @@ function CurrencyInput({
|
|
|
1610
1953
|
disabled,
|
|
1611
1954
|
...props
|
|
1612
1955
|
}) {
|
|
1613
|
-
const [internalCurrency, setInternalCurrency] = (0,
|
|
1956
|
+
const [internalCurrency, setInternalCurrency] = (0, import_react14.useState)(
|
|
1614
1957
|
defaultCurrency ?? currencies?.[0]?.code ?? ""
|
|
1615
1958
|
);
|
|
1616
1959
|
const selectedCurrency = currency ?? internalCurrency;
|
|
1617
1960
|
const current = currencies?.find((item) => item.code === selectedCurrency);
|
|
1618
1961
|
const currencySuffix = current?.suffix ?? current?.code ?? suffix;
|
|
1619
|
-
const endAdornment = currencies?.length ? /* @__PURE__ */ (0,
|
|
1962
|
+
const endAdornment = currencies?.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1620
1963
|
Selection,
|
|
1621
1964
|
{
|
|
1622
1965
|
className: "fe-currency-input__currency",
|
|
@@ -1635,8 +1978,8 @@ function CurrencyInput({
|
|
|
1635
1978
|
onCurrencyChange?.(next);
|
|
1636
1979
|
}
|
|
1637
1980
|
}
|
|
1638
|
-
) : /* @__PURE__ */ (0,
|
|
1639
|
-
return /* @__PURE__ */ (0,
|
|
1981
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "fe-currency-input__suffix", children: currencySuffix });
|
|
1982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1640
1983
|
NumberInput,
|
|
1641
1984
|
{
|
|
1642
1985
|
...props,
|
|
@@ -1648,8 +1991,8 @@ function CurrencyInput({
|
|
|
1648
1991
|
}
|
|
1649
1992
|
|
|
1650
1993
|
// packages/form-controls/src/controls/DateTimePicker/date-time-picker.tsx
|
|
1651
|
-
var
|
|
1652
|
-
var
|
|
1994
|
+
var import_react15 = require("react");
|
|
1995
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1653
1996
|
var pad = (value) => String(value).padStart(2, "0");
|
|
1654
1997
|
function formatDate(date, format) {
|
|
1655
1998
|
return format.replace(/yyyy/g, String(date.getFullYear())).replace(/MM/g, pad(date.getMonth() + 1)).replace(/dd/g, pad(date.getDate())).replace(/HH/g, pad(date.getHours())).replace(/mm/g, pad(date.getMinutes()));
|
|
@@ -1685,7 +2028,7 @@ function DateTimePicker(props) {
|
|
|
1685
2028
|
"aria-describedby": ariaDescribedBy,
|
|
1686
2029
|
"aria-labelledby": ariaLabelledBy
|
|
1687
2030
|
} = props;
|
|
1688
|
-
const generatedId = (0,
|
|
2031
|
+
const generatedId = (0, import_react15.useId)();
|
|
1689
2032
|
const triggerId = id ?? generatedId + "-trigger";
|
|
1690
2033
|
const labelId = generatedId + "-label";
|
|
1691
2034
|
const messageId2 = generatedId + "-message";
|
|
@@ -1703,28 +2046,28 @@ function DateTimePicker(props) {
|
|
|
1703
2046
|
);
|
|
1704
2047
|
const isRange = mode === "range";
|
|
1705
2048
|
const controlled = props.value !== void 0;
|
|
1706
|
-
const [singleInternal, setSingleInternal] = (0,
|
|
2049
|
+
const [singleInternal, setSingleInternal] = (0, import_react15.useState)(
|
|
1707
2050
|
(!isRange ? props.defaultValue : null) ?? null
|
|
1708
2051
|
);
|
|
1709
|
-
const [rangeInternal, setRangeInternal] = (0,
|
|
2052
|
+
const [rangeInternal, setRangeInternal] = (0, import_react15.useState)(
|
|
1710
2053
|
(isRange ? props.defaultValue : void 0) ?? [null, null]
|
|
1711
2054
|
);
|
|
1712
2055
|
const singleValue = !isRange ? props.value ?? singleInternal : null;
|
|
1713
2056
|
const rangeValue = isRange ? props.value ?? rangeInternal : [null, null];
|
|
1714
|
-
const [open, setOpen] = (0,
|
|
1715
|
-
const [month, setMonth] = (0,
|
|
2057
|
+
const [open, setOpen] = (0, import_react15.useState)(false);
|
|
2058
|
+
const [month, setMonth] = (0, import_react15.useState)(
|
|
1716
2059
|
() => new Date((isRange ? rangeValue[0] : singleValue) ?? /* @__PURE__ */ new Date())
|
|
1717
2060
|
);
|
|
1718
|
-
const [editingEnd, setEditingEnd] = (0,
|
|
1719
|
-
const rootRef = (0,
|
|
1720
|
-
(0,
|
|
2061
|
+
const [editingEnd, setEditingEnd] = (0, import_react15.useState)(false);
|
|
2062
|
+
const rootRef = (0, import_react15.useRef)(null);
|
|
2063
|
+
(0, import_react15.useEffect)(() => {
|
|
1721
2064
|
const onPointerDown = (event) => {
|
|
1722
2065
|
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
|
1723
2066
|
};
|
|
1724
2067
|
document.addEventListener("mousedown", onPointerDown);
|
|
1725
2068
|
return () => document.removeEventListener("mousedown", onPointerDown);
|
|
1726
2069
|
}, []);
|
|
1727
|
-
(0,
|
|
2070
|
+
(0, import_react15.useEffect)(() => {
|
|
1728
2071
|
if (disabled) setOpen(false);
|
|
1729
2072
|
}, [disabled]);
|
|
1730
2073
|
const setSingle = (next) => {
|
|
@@ -1780,7 +2123,7 @@ function DateTimePicker(props) {
|
|
|
1780
2123
|
setRange(editingEnd ? [rangeValue[0], next] : [next, rangeValue[1]]);
|
|
1781
2124
|
else setSingle(next);
|
|
1782
2125
|
};
|
|
1783
|
-
return /* @__PURE__ */ (0,
|
|
2126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1784
2127
|
"div",
|
|
1785
2128
|
{
|
|
1786
2129
|
ref: rootRef,
|
|
@@ -1790,7 +2133,7 @@ function DateTimePicker(props) {
|
|
|
1790
2133
|
className
|
|
1791
2134
|
].filter(Boolean).join(" "),
|
|
1792
2135
|
children: [
|
|
1793
|
-
/* @__PURE__ */ (0,
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1794
2137
|
FieldLabel,
|
|
1795
2138
|
{
|
|
1796
2139
|
id: labelId,
|
|
@@ -1800,7 +2143,7 @@ function DateTimePicker(props) {
|
|
|
1800
2143
|
isRequired
|
|
1801
2144
|
}
|
|
1802
2145
|
),
|
|
1803
|
-
/* @__PURE__ */ (0,
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1804
2147
|
"button",
|
|
1805
2148
|
{
|
|
1806
2149
|
id: triggerId,
|
|
@@ -1814,29 +2157,29 @@ function DateTimePicker(props) {
|
|
|
1814
2157
|
"aria-expanded": open,
|
|
1815
2158
|
onClick: () => setOpen((current) => !current),
|
|
1816
2159
|
children: [
|
|
1817
|
-
/* @__PURE__ */ (0,
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "aria-hidden": "true", children: "\u25F7" }),
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1819
2162
|
"span",
|
|
1820
2163
|
{
|
|
1821
2164
|
className: !shownValue && placeholder ? "fe-datetime-picker__value is-placeholder" : "fe-datetime-picker__value",
|
|
1822
2165
|
children: [
|
|
1823
2166
|
shownValue || placeholder || (isRange ? "Select date range" : "Select date and time"),
|
|
1824
|
-
isRequired && placeholder && !shownValue && /* @__PURE__ */ (0,
|
|
2167
|
+
isRequired && placeholder && !shownValue && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fe-field__required", "aria-hidden": "true", children: "*" })
|
|
1825
2168
|
]
|
|
1826
2169
|
}
|
|
1827
2170
|
)
|
|
1828
2171
|
]
|
|
1829
2172
|
}
|
|
1830
2173
|
),
|
|
1831
|
-
open && /* @__PURE__ */ (0,
|
|
2174
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1832
2175
|
"div",
|
|
1833
2176
|
{
|
|
1834
2177
|
className: "fe-datetime-picker__popper",
|
|
1835
2178
|
role: "dialog",
|
|
1836
2179
|
"aria-label": "Date and time picker",
|
|
1837
2180
|
children: [
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
2181
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "fe-datetime-picker__month", children: [
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1840
2183
|
"button",
|
|
1841
2184
|
{
|
|
1842
2185
|
type: "button",
|
|
@@ -1847,11 +2190,11 @@ function DateTimePicker(props) {
|
|
|
1847
2190
|
children: "\u2039"
|
|
1848
2191
|
}
|
|
1849
2192
|
),
|
|
1850
|
-
/* @__PURE__ */ (0,
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: month.toLocaleDateString(locale, {
|
|
1851
2194
|
month: "long",
|
|
1852
2195
|
year: "numeric"
|
|
1853
2196
|
}) }),
|
|
1854
|
-
/* @__PURE__ */ (0,
|
|
2197
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1855
2198
|
"button",
|
|
1856
2199
|
{
|
|
1857
2200
|
type: "button",
|
|
@@ -1863,12 +2206,12 @@ function DateTimePicker(props) {
|
|
|
1863
2206
|
}
|
|
1864
2207
|
)
|
|
1865
2208
|
] }),
|
|
1866
|
-
/* @__PURE__ */ (0,
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "fe-datetime-picker__weekdays", children: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"].map((day) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: day }, day)) }),
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "fe-datetime-picker__days", children: days.map((day) => {
|
|
1868
2211
|
const inMonth = day.getMonth() === month.getMonth();
|
|
1869
2212
|
const selected = isRange ? sameDay(day, rangeValue[0]) || sameDay(day, rangeValue[1]) : sameDay(day, singleValue);
|
|
1870
2213
|
const inRange = isRange && rangeValue[0] && rangeValue[1] && day > startOfDay(rangeValue[0]) && day < startOfDay(rangeValue[1]);
|
|
1871
|
-
return /* @__PURE__ */ (0,
|
|
2214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1872
2215
|
"button",
|
|
1873
2216
|
{
|
|
1874
2217
|
type: "button",
|
|
@@ -1883,8 +2226,8 @@ function DateTimePicker(props) {
|
|
|
1883
2226
|
day.toISOString()
|
|
1884
2227
|
);
|
|
1885
2228
|
}) }),
|
|
1886
|
-
isRange && /* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
2229
|
+
isRange && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "fe-datetime-picker__range-tabs", children: [
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1888
2231
|
"button",
|
|
1889
2232
|
{
|
|
1890
2233
|
type: "button",
|
|
@@ -1893,7 +2236,7 @@ function DateTimePicker(props) {
|
|
|
1893
2236
|
children: "Start"
|
|
1894
2237
|
}
|
|
1895
2238
|
),
|
|
1896
|
-
/* @__PURE__ */ (0,
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1897
2240
|
"button",
|
|
1898
2241
|
{
|
|
1899
2242
|
type: "button",
|
|
@@ -1903,9 +2246,9 @@ function DateTimePicker(props) {
|
|
|
1903
2246
|
}
|
|
1904
2247
|
)
|
|
1905
2248
|
] }),
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "fe-datetime-picker__time", children: [
|
|
1907
2250
|
"Time",
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1909
2252
|
"input",
|
|
1910
2253
|
{
|
|
1911
2254
|
type: "time",
|
|
@@ -1918,7 +2261,7 @@ function DateTimePicker(props) {
|
|
|
1918
2261
|
]
|
|
1919
2262
|
}
|
|
1920
2263
|
),
|
|
1921
|
-
/* @__PURE__ */ (0,
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1922
2265
|
FieldMessage,
|
|
1923
2266
|
{
|
|
1924
2267
|
id: messageId2,
|
|
@@ -1933,9 +2276,9 @@ function DateTimePicker(props) {
|
|
|
1933
2276
|
}
|
|
1934
2277
|
|
|
1935
2278
|
// packages/form-controls/src/controls/Checkbox/checkbox.tsx
|
|
1936
|
-
var
|
|
1937
|
-
var
|
|
1938
|
-
var Checkbox = (0,
|
|
2279
|
+
var import_react16 = require("react");
|
|
2280
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2281
|
+
var Checkbox = (0, import_react16.forwardRef)(
|
|
1939
2282
|
function Checkbox2({
|
|
1940
2283
|
label,
|
|
1941
2284
|
labelPosition = "right",
|
|
@@ -1951,10 +2294,10 @@ var Checkbox = (0, import_react13.forwardRef)(
|
|
|
1951
2294
|
disabled && "fe-checkbox--disabled",
|
|
1952
2295
|
className
|
|
1953
2296
|
].filter(Boolean).join(" ");
|
|
1954
|
-
return /* @__PURE__ */ (0,
|
|
1955
|
-
label && labelPosition === "top" && /* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
/* @__PURE__ */ (0,
|
|
2297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: classes, style, children: [
|
|
2298
|
+
label && labelPosition === "top" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "fe-checkbox__label", children: label }),
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "fe-checkbox__content", children: [
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1958
2301
|
"input",
|
|
1959
2302
|
{
|
|
1960
2303
|
ref,
|
|
@@ -1965,8 +2308,8 @@ var Checkbox = (0, import_react13.forwardRef)(
|
|
|
1965
2308
|
...props
|
|
1966
2309
|
}
|
|
1967
2310
|
),
|
|
1968
|
-
/* @__PURE__ */ (0,
|
|
1969
|
-
label && labelPosition === "right" && /* @__PURE__ */ (0,
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "fe-checkbox__control", "aria-hidden": "true" }),
|
|
2312
|
+
label && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "fe-checkbox__label", children: label })
|
|
1970
2313
|
] })
|
|
1971
2314
|
] });
|
|
1972
2315
|
}
|
|
@@ -1974,9 +2317,9 @@ var Checkbox = (0, import_react13.forwardRef)(
|
|
|
1974
2317
|
Checkbox.displayName = "Checkbox";
|
|
1975
2318
|
|
|
1976
2319
|
// packages/form-controls/src/controls/RadioButton/radio-button.tsx
|
|
1977
|
-
var
|
|
1978
|
-
var
|
|
1979
|
-
var RadioButton = (0,
|
|
2320
|
+
var import_react17 = require("react");
|
|
2321
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2322
|
+
var RadioButton = (0, import_react17.forwardRef)(
|
|
1980
2323
|
function RadioButton2({
|
|
1981
2324
|
label,
|
|
1982
2325
|
labelPosition = "right",
|
|
@@ -1992,10 +2335,10 @@ var RadioButton = (0, import_react14.forwardRef)(
|
|
|
1992
2335
|
disabled && "fe-radio-button--disabled",
|
|
1993
2336
|
className
|
|
1994
2337
|
].filter(Boolean).join(" ");
|
|
1995
|
-
return /* @__PURE__ */ (0,
|
|
1996
|
-
label && labelPosition === "top" && /* @__PURE__ */ (0,
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
2338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: classes, style, children: [
|
|
2339
|
+
label && labelPosition === "top" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fe-radio-button__label", children: label }),
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "fe-radio-button__content", children: [
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1999
2342
|
"input",
|
|
2000
2343
|
{
|
|
2001
2344
|
ref,
|
|
@@ -2006,8 +2349,8 @@ var RadioButton = (0, import_react14.forwardRef)(
|
|
|
2006
2349
|
...props
|
|
2007
2350
|
}
|
|
2008
2351
|
),
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
label && labelPosition === "right" && /* @__PURE__ */ (0,
|
|
2352
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fe-radio-button__control", "aria-hidden": "true" }),
|
|
2353
|
+
label && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fe-radio-button__label", children: label })
|
|
2011
2354
|
] })
|
|
2012
2355
|
] });
|
|
2013
2356
|
}
|
|
@@ -2015,9 +2358,9 @@ var RadioButton = (0, import_react14.forwardRef)(
|
|
|
2015
2358
|
RadioButton.displayName = "RadioButton";
|
|
2016
2359
|
|
|
2017
2360
|
// packages/form-controls/src/controls/RadioGroup/radio-group.tsx
|
|
2018
|
-
var
|
|
2019
|
-
var
|
|
2020
|
-
var RadioGroup = (0,
|
|
2361
|
+
var import_react18 = require("react");
|
|
2362
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2363
|
+
var RadioGroup = (0, import_react18.forwardRef)(
|
|
2021
2364
|
function RadioGroup2({
|
|
2022
2365
|
label,
|
|
2023
2366
|
labelPosition = "top",
|
|
@@ -2035,7 +2378,7 @@ var RadioGroup = (0, import_react15.forwardRef)(
|
|
|
2035
2378
|
"aria-labelledby": ariaLabelledBy,
|
|
2036
2379
|
...props
|
|
2037
2380
|
}, ref) {
|
|
2038
|
-
const generatedId = (0,
|
|
2381
|
+
const generatedId = (0, import_react18.useId)();
|
|
2039
2382
|
const groupName = name ?? `fe-radio-group-${generatedId}`;
|
|
2040
2383
|
const labelId = `${id ?? generatedId}-label`;
|
|
2041
2384
|
const isControlled = value !== void 0;
|
|
@@ -2049,12 +2392,12 @@ var RadioGroup = (0, import_react15.forwardRef)(
|
|
|
2049
2392
|
const handleChange = (option, event) => {
|
|
2050
2393
|
if (event.target.checked) onChange?.(option.value, option, event);
|
|
2051
2394
|
};
|
|
2052
|
-
return /* @__PURE__ */ (0,
|
|
2053
|
-
label && labelPosition === "top" && /* @__PURE__ */ (0,
|
|
2395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { ref, className: classes, ...props, children: [
|
|
2396
|
+
label && labelPosition === "top" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { id: labelId, className: "fe-radio-group__label", children: [
|
|
2054
2397
|
label,
|
|
2055
|
-
isRequired && /* @__PURE__ */ (0,
|
|
2398
|
+
isRequired && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "fe-radio-group__required", "aria-hidden": "true", children: "*" })
|
|
2056
2399
|
] }),
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2058
2401
|
"div",
|
|
2059
2402
|
{
|
|
2060
2403
|
id,
|
|
@@ -2066,7 +2409,7 @@ var RadioGroup = (0, import_react15.forwardRef)(
|
|
|
2066
2409
|
children: options.map((option) => {
|
|
2067
2410
|
const optionDisabled = disabled || option.disabled;
|
|
2068
2411
|
const optionValue = String(option.value);
|
|
2069
|
-
return /* @__PURE__ */ (0,
|
|
2412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2070
2413
|
RadioButton,
|
|
2071
2414
|
{
|
|
2072
2415
|
name: groupName,
|
|
@@ -2083,9 +2426,9 @@ var RadioGroup = (0, import_react15.forwardRef)(
|
|
|
2083
2426
|
})
|
|
2084
2427
|
}
|
|
2085
2428
|
),
|
|
2086
|
-
label && labelPosition === "right" && /* @__PURE__ */ (0,
|
|
2429
|
+
label && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { id: labelId, className: "fe-radio-group__label", children: [
|
|
2087
2430
|
label,
|
|
2088
|
-
isRequired && /* @__PURE__ */ (0,
|
|
2431
|
+
isRequired && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "fe-radio-group__required", "aria-hidden": "true", children: "*" })
|
|
2089
2432
|
] })
|
|
2090
2433
|
] });
|
|
2091
2434
|
}
|
|
@@ -2093,29 +2436,29 @@ var RadioGroup = (0, import_react15.forwardRef)(
|
|
|
2093
2436
|
RadioGroup.displayName = "RadioGroup";
|
|
2094
2437
|
|
|
2095
2438
|
// packages/expandable-section/src/index.tsx
|
|
2096
|
-
var
|
|
2097
|
-
var
|
|
2439
|
+
var import_react19 = require("react");
|
|
2440
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2098
2441
|
function ExpandableSection({ title, children, expanded, defaultExpanded = false, onExpandedChange, disabled, className, ...props }) {
|
|
2099
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
2442
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react19.useState)(defaultExpanded);
|
|
2100
2443
|
const isExpanded = expanded ?? internalExpanded;
|
|
2101
|
-
const id = (0,
|
|
2444
|
+
const id = (0, import_react19.useId)();
|
|
2102
2445
|
const toggle = () => {
|
|
2103
2446
|
if (disabled) return;
|
|
2104
2447
|
const next = !isExpanded;
|
|
2105
2448
|
if (expanded === void 0) setInternalExpanded(next);
|
|
2106
2449
|
onExpandedChange?.(next);
|
|
2107
2450
|
};
|
|
2108
|
-
return /* @__PURE__ */ (0,
|
|
2109
|
-
/* @__PURE__ */ (0,
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { className: ["fe-expandable-section", isExpanded && "fe-expandable-section--expanded", disabled && "fe-expandable-section--disabled", className].filter(Boolean).join(" "), ...props, children: [
|
|
2452
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("button", { className: "fe-expandable-section__trigger", type: "button", "aria-expanded": isExpanded, "aria-controls": id, disabled, onClick: toggle, children: [
|
|
2453
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: title }),
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fe-expandable-section__chevron", "aria-hidden": "true" })
|
|
2112
2455
|
] }),
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2456
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { id, className: "fe-expandable-section__content", "aria-hidden": !isExpanded, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "fe-expandable-section__content-inner", children }) })
|
|
2114
2457
|
] });
|
|
2115
2458
|
}
|
|
2116
2459
|
|
|
2117
2460
|
// packages/loading/src/index.tsx
|
|
2118
|
-
var
|
|
2461
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2119
2462
|
var sizes = {
|
|
2120
2463
|
small: "16px",
|
|
2121
2464
|
medium: "24px",
|
|
@@ -2128,15 +2471,15 @@ function Loading({ size = "medium", color = "#2878f0", label, className, style,
|
|
|
2128
2471
|
"--fe-loading-color": color,
|
|
2129
2472
|
...style
|
|
2130
2473
|
};
|
|
2131
|
-
return /* @__PURE__ */ (0,
|
|
2132
|
-
/* @__PURE__ */ (0,
|
|
2133
|
-
label && /* @__PURE__ */ (0,
|
|
2134
|
-
!label && /* @__PURE__ */ (0,
|
|
2474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: ["fe-loading", className].filter(Boolean).join(" "), style: loadingStyle, role: "status", ...props, children: [
|
|
2475
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fe-loading__spinner", "aria-hidden": "true" }),
|
|
2476
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fe-loading__label", children: label }),
|
|
2477
|
+
!label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fe-loading__sr-only", children: "Loading" })
|
|
2135
2478
|
] });
|
|
2136
2479
|
}
|
|
2137
2480
|
|
|
2138
2481
|
// packages/skeleton/src/index.tsx
|
|
2139
|
-
var
|
|
2482
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2140
2483
|
var pixels = (value) => typeof value === "number" ? `${value}px` : value;
|
|
2141
2484
|
function SkeletonBase({ variant = "box", shape, width, height, count = 1, animated = true, className, style, ...props }) {
|
|
2142
2485
|
const resolvedVariant = shape ?? variant;
|
|
@@ -2147,7 +2490,7 @@ function SkeletonBase({ variant = "box", shape, width, height, count = 1, animat
|
|
|
2147
2490
|
"--fe-skeleton-height": resolvedHeight,
|
|
2148
2491
|
...style
|
|
2149
2492
|
};
|
|
2150
|
-
return /* @__PURE__ */ (0,
|
|
2493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: Array.from({ length: Math.max(1, count) }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2151
2494
|
"div",
|
|
2152
2495
|
{
|
|
2153
2496
|
className: ["fe-skeleton", `fe-skeleton--${resolvedVariant}`, animated && "fe-skeleton--animated", className].filter(Boolean).join(" "),
|
|
@@ -2159,16 +2502,16 @@ function SkeletonBase({ variant = "box", shape, width, height, count = 1, animat
|
|
|
2159
2502
|
)) });
|
|
2160
2503
|
}
|
|
2161
2504
|
function SkeletonCircle({ size = 40, ...props }) {
|
|
2162
|
-
return /* @__PURE__ */ (0,
|
|
2505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SkeletonBase, { variant: "circle", width: size, height: size, ...props });
|
|
2163
2506
|
}
|
|
2164
2507
|
function SkeletonSquare({ size = 80, ...props }) {
|
|
2165
|
-
return /* @__PURE__ */ (0,
|
|
2508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SkeletonBase, { variant: "box", width: size, height: size, ...props });
|
|
2166
2509
|
}
|
|
2167
2510
|
function SkeletonBox({ width = "100%", height = 80, ...props }) {
|
|
2168
|
-
return /* @__PURE__ */ (0,
|
|
2511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SkeletonBase, { variant: "box", width, height, ...props });
|
|
2169
2512
|
}
|
|
2170
2513
|
function SkeletonLine({ width = "100%", height = 12, ...props }) {
|
|
2171
|
-
return /* @__PURE__ */ (0,
|
|
2514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SkeletonBase, { variant: "line", width, height, ...props });
|
|
2172
2515
|
}
|
|
2173
2516
|
var Skeleton = Object.assign(SkeletonBase, {
|
|
2174
2517
|
Circle: SkeletonCircle,
|
|
@@ -2178,9 +2521,9 @@ var Skeleton = Object.assign(SkeletonBase, {
|
|
|
2178
2521
|
});
|
|
2179
2522
|
|
|
2180
2523
|
// packages/modal/src/index.tsx
|
|
2181
|
-
var
|
|
2524
|
+
var import_react20 = require("react");
|
|
2182
2525
|
var import_react_dom3 = require("react-dom");
|
|
2183
|
-
var
|
|
2526
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2184
2527
|
function Modal({
|
|
2185
2528
|
open,
|
|
2186
2529
|
onClose,
|
|
@@ -2196,9 +2539,9 @@ function Modal({
|
|
|
2196
2539
|
className,
|
|
2197
2540
|
...props
|
|
2198
2541
|
}) {
|
|
2199
|
-
const titleId = (0,
|
|
2200
|
-
const panelRef = (0,
|
|
2201
|
-
(0,
|
|
2542
|
+
const titleId = (0, import_react20.useId)();
|
|
2543
|
+
const panelRef = (0, import_react20.useRef)(null);
|
|
2544
|
+
(0, import_react20.useEffect)(() => {
|
|
2202
2545
|
if (!open) return;
|
|
2203
2546
|
const onKeyDown = (event) => {
|
|
2204
2547
|
if (event.key === "Escape") onClose();
|
|
@@ -2210,9 +2553,9 @@ function Modal({
|
|
|
2210
2553
|
if (!open || typeof document === "undefined") return null;
|
|
2211
2554
|
const hasFooter = footer || actions.length > 0;
|
|
2212
2555
|
return (0, import_react_dom3.createPortal)(
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fe-modal-backdrop", role: "presentation", onMouseDown: (event) => {
|
|
2214
2557
|
if (event.target === event.currentTarget && closeOnBackdropClick) onClose();
|
|
2215
|
-
}, children: /* @__PURE__ */ (0,
|
|
2558
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2216
2559
|
"div",
|
|
2217
2560
|
{
|
|
2218
2561
|
ref: panelRef,
|
|
@@ -2224,17 +2567,17 @@ function Modal({
|
|
|
2224
2567
|
tabIndex: -1,
|
|
2225
2568
|
...props,
|
|
2226
2569
|
children: [
|
|
2227
|
-
(title || description || closeButton) && /* @__PURE__ */ (0,
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2229
|
-
title && /* @__PURE__ */ (0,
|
|
2230
|
-
description && /* @__PURE__ */ (0,
|
|
2570
|
+
(title || description || closeButton) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("header", { className: "fe-modal__header", children: [
|
|
2571
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fe-modal__heading", children: [
|
|
2572
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { id: titleId, children: title }),
|
|
2573
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: description })
|
|
2231
2574
|
] }),
|
|
2232
|
-
closeButton && /* @__PURE__ */ (0,
|
|
2575
|
+
closeButton && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { hierarchy: "tertiary-gray", size: "32", iconOnly: true, icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CloseIcon, {}), "aria-label": closeLabel, onClick: onClose })
|
|
2233
2576
|
] }),
|
|
2234
|
-
/* @__PURE__ */ (0,
|
|
2235
|
-
hasFooter && /* @__PURE__ */ (0,
|
|
2236
|
-
footer && /* @__PURE__ */ (0,
|
|
2237
|
-
actions.length > 0 && /* @__PURE__ */ (0,
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fe-modal__body", children }),
|
|
2578
|
+
hasFooter && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("footer", { className: "fe-modal__footer", children: [
|
|
2579
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fe-modal__footer-content", children: footer }),
|
|
2580
|
+
actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fe-modal__actions", children: actions.map(({ label, ...action }, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { ...action, children: label }, index)) })
|
|
2238
2581
|
] })
|
|
2239
2582
|
]
|
|
2240
2583
|
}
|
|
@@ -2244,7 +2587,7 @@ function Modal({
|
|
|
2244
2587
|
}
|
|
2245
2588
|
|
|
2246
2589
|
// packages/progress/src/index.tsx
|
|
2247
|
-
var
|
|
2590
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2248
2591
|
function ProgressBar({ value, max = 100, label, showValue = true, size = "medium", color = "#2878f0", className, style, "aria-label": ariaLabel, ...props }) {
|
|
2249
2592
|
const indeterminate = value === null || value === void 0;
|
|
2250
2593
|
const percentage = indeterminate ? 0 : Math.min(100, Math.max(0, Number(value) / Math.max(1, max) * 100));
|
|
@@ -2254,17 +2597,17 @@ function ProgressBar({ value, max = 100, label, showValue = true, size = "medium
|
|
|
2254
2597
|
...style
|
|
2255
2598
|
};
|
|
2256
2599
|
const visibleValue = `${Math.round(percentage)}%`;
|
|
2257
|
-
return /* @__PURE__ */ (0,
|
|
2258
|
-
(label || !indeterminate && showValue) && /* @__PURE__ */ (0,
|
|
2259
|
-
label && /* @__PURE__ */ (0,
|
|
2260
|
-
!indeterminate && showValue && /* @__PURE__ */ (0,
|
|
2600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: ["fe-progress", `fe-progress--${size}`, indeterminate && "fe-progress--indeterminate", className].filter(Boolean).join(" "), style: progressStyle, ...props, children: [
|
|
2601
|
+
(label || !indeterminate && showValue) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "fe-progress__meta", children: [
|
|
2602
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fe-progress__label", children: label }),
|
|
2603
|
+
!indeterminate && showValue && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("output", { className: "fe-progress__value", children: visibleValue })
|
|
2261
2604
|
] }),
|
|
2262
|
-
/* @__PURE__ */ (0,
|
|
2605
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "fe-progress__track", role: "progressbar", "aria-label": ariaLabel ?? (typeof label === "string" ? label : "Progress"), "aria-valuemin": indeterminate ? void 0 : 0, "aria-valuemax": indeterminate ? void 0 : max, "aria-valuenow": indeterminate ? void 0 : Number(value), "aria-valuetext": indeterminate ? "Loading" : visibleValue, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fe-progress__indicator" }) })
|
|
2263
2606
|
] });
|
|
2264
2607
|
}
|
|
2265
2608
|
|
|
2266
2609
|
// packages/chip/src/index.tsx
|
|
2267
|
-
var
|
|
2610
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2268
2611
|
var statuses = ["default", "info", "success", "warning", "error", "neutral", "pending", "processing"];
|
|
2269
2612
|
function Chip({ children, status = "default", color, variant = "subtle", dot = false, onRemove, removeLabel = "Remove", className, style, ...props }) {
|
|
2270
2613
|
const usesCustomColor = Boolean(color);
|
|
@@ -2273,16 +2616,16 @@ function Chip({ children, status = "default", color, variant = "subtle", dot = f
|
|
|
2273
2616
|
...style
|
|
2274
2617
|
};
|
|
2275
2618
|
const resolvedStatus = statuses.includes(status) ? status : "default";
|
|
2276
|
-
return /* @__PURE__ */ (0,
|
|
2277
|
-
dot && /* @__PURE__ */ (0,
|
|
2278
|
-
/* @__PURE__ */ (0,
|
|
2279
|
-
onRemove && /* @__PURE__ */ (0,
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: ["fe-chip", `fe-chip--${variant}`, `fe-chip--${usesCustomColor ? "custom" : resolvedStatus}`, className].filter(Boolean).join(" "), style: chipStyle, ...props, children: [
|
|
2620
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fe-chip__dot", "aria-hidden": "true" }),
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fe-chip__content", children }),
|
|
2622
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { hierarchy: "tertiary-gray", size: "24", iconOnly: true, icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CloseIcon, { size: 14 }), "aria-label": removeLabel, onClick: onRemove, className: "fe-chip__remove" })
|
|
2280
2623
|
] });
|
|
2281
2624
|
}
|
|
2282
2625
|
|
|
2283
2626
|
// packages/message/src/index.tsx
|
|
2284
|
-
var
|
|
2285
|
-
var
|
|
2627
|
+
var import_react21 = require("react");
|
|
2628
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2286
2629
|
var messageId = 0;
|
|
2287
2630
|
var entries = [];
|
|
2288
2631
|
var listeners = /* @__PURE__ */ new Set();
|
|
@@ -2315,22 +2658,22 @@ var message = {
|
|
|
2315
2658
|
};
|
|
2316
2659
|
var icons = { success: "\u2713", info: "i", warning: "!", error: "\xD7" };
|
|
2317
2660
|
function Message({ maxCount = 4, closeLabel = "Close notification", className, ...props }) {
|
|
2318
|
-
const [visibleEntries, setVisibleEntries] = (0,
|
|
2319
|
-
(0,
|
|
2661
|
+
const [visibleEntries, setVisibleEntries] = (0, import_react21.useState)(entries);
|
|
2662
|
+
(0, import_react21.useEffect)(() => {
|
|
2320
2663
|
const listener = (nextEntries) => setVisibleEntries(nextEntries);
|
|
2321
2664
|
listeners.add(listener);
|
|
2322
2665
|
return () => {
|
|
2323
2666
|
listeners.delete(listener);
|
|
2324
2667
|
};
|
|
2325
2668
|
}, []);
|
|
2326
|
-
return /* @__PURE__ */ (0,
|
|
2327
|
-
/* @__PURE__ */ (0,
|
|
2328
|
-
/* @__PURE__ */ (0,
|
|
2329
|
-
entry.title && /* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: ["fe-message-viewport", className].filter(Boolean).join(" "), "aria-live": "polite", ...props, children: visibleEntries.slice(-Math.max(1, maxCount)).map((entry) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: `fe-message fe-message--${entry.severity ?? "info"}`, role: entry.severity === "error" ? "alert" : "status", children: [
|
|
2670
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fe-message__icon", "aria-hidden": "true", children: icons[entry.severity ?? "info"] }),
|
|
2671
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fe-message__body", children: [
|
|
2672
|
+
entry.title && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("strong", { className: "fe-message__title", children: entry.title }),
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "fe-message__content", children: entry.content })
|
|
2331
2674
|
] }),
|
|
2332
|
-
entry.action && /* @__PURE__ */ (0,
|
|
2333
|
-
/* @__PURE__ */ (0,
|
|
2675
|
+
entry.action && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fe-message__action", children: entry.action }),
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { className: "fe-message__close", hierarchy: "tertiary-gray", size: "24", iconOnly: true, icon: "\xD7", "aria-label": closeLabel, onClick: () => dismiss(entry.id) })
|
|
2334
2677
|
] }, entry.id)) });
|
|
2335
2678
|
}
|
|
2336
2679
|
((Message2) => {
|
|
@@ -2344,8 +2687,8 @@ function Message({ maxCount = 4, closeLabel = "Close notification", className, .
|
|
|
2344
2687
|
})(Message || (Message = {}));
|
|
2345
2688
|
|
|
2346
2689
|
// packages/snackbar/src/index.tsx
|
|
2347
|
-
var
|
|
2348
|
-
var
|
|
2690
|
+
var import_react22 = require("react");
|
|
2691
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2349
2692
|
function Snackbar({
|
|
2350
2693
|
open,
|
|
2351
2694
|
message: message2,
|
|
@@ -2359,12 +2702,12 @@ function Snackbar({
|
|
|
2359
2702
|
}) {
|
|
2360
2703
|
const vertical = anchorOrigin.vertical ?? "bottom";
|
|
2361
2704
|
const horizontal = anchorOrigin.horizontal ?? "center";
|
|
2362
|
-
(0,
|
|
2705
|
+
(0, import_react22.useEffect)(() => {
|
|
2363
2706
|
if (!open || autoHideDuration === null) return void 0;
|
|
2364
2707
|
const timer = window.setTimeout(() => onClose?.("timeout"), autoHideDuration);
|
|
2365
2708
|
return () => window.clearTimeout(timer);
|
|
2366
2709
|
}, [open, autoHideDuration, onClose]);
|
|
2367
|
-
(0,
|
|
2710
|
+
(0, import_react22.useEffect)(() => {
|
|
2368
2711
|
if (!open) return void 0;
|
|
2369
2712
|
const onKeyDown = (event) => {
|
|
2370
2713
|
if (event.key === "Escape") onClose?.("escapeKeyDown");
|
|
@@ -2373,15 +2716,559 @@ function Snackbar({
|
|
|
2373
2716
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
2374
2717
|
}, [open, onClose]);
|
|
2375
2718
|
if (!open) return null;
|
|
2376
|
-
return /* @__PURE__ */ (0,
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2378
|
-
action && /* @__PURE__ */ (0,
|
|
2379
|
-
onClose && /* @__PURE__ */ (0,
|
|
2719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: ["fe-snackbar", `fe-snackbar--${vertical}`, `fe-snackbar--${horizontal}`, className].filter(Boolean).join(" "), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "fe-snackbar__content", role: "status", "aria-live": "polite", children: [
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fe-snackbar__message", children: message2 }),
|
|
2721
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fe-snackbar__action", children: action }),
|
|
2722
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { className: "fe-snackbar__close", hierarchy: "tertiary-gray", size: "24", iconOnly: true, icon: "\xD7", "aria-label": closeLabel, onClick: () => onClose("closeButton") })
|
|
2380
2723
|
] }) });
|
|
2381
2724
|
}
|
|
2725
|
+
|
|
2726
|
+
// packages/avatar/src/index.tsx
|
|
2727
|
+
var import_react23 = require("react");
|
|
2728
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2729
|
+
var FALLBACK_AVATARS = [
|
|
2730
|
+
{
|
|
2731
|
+
background: "#E0E7FF",
|
|
2732
|
+
skin: "#F6C6A6",
|
|
2733
|
+
hair: "#432818",
|
|
2734
|
+
shirt: "#5B5BD6",
|
|
2735
|
+
accent: "#A5B4FC",
|
|
2736
|
+
hairStyle: 0,
|
|
2737
|
+
expression: 0
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
background: "#FDE68A",
|
|
2741
|
+
skin: "#E7AF87",
|
|
2742
|
+
hair: "#5A3424",
|
|
2743
|
+
shirt: "#D97706",
|
|
2744
|
+
accent: "#FCD34D",
|
|
2745
|
+
hairStyle: 1,
|
|
2746
|
+
expression: 1
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
background: "#CCFBF1",
|
|
2750
|
+
skin: "#F4C7A1",
|
|
2751
|
+
hair: "#1F2937",
|
|
2752
|
+
shirt: "#0F766E",
|
|
2753
|
+
accent: "#5EEAD4",
|
|
2754
|
+
hairStyle: 2,
|
|
2755
|
+
expression: 2
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
background: "#FCE7F3",
|
|
2759
|
+
skin: "#E5A47F",
|
|
2760
|
+
hair: "#6B2D2D",
|
|
2761
|
+
shirt: "#BE185D",
|
|
2762
|
+
accent: "#F9A8D4",
|
|
2763
|
+
hairStyle: 3,
|
|
2764
|
+
expression: 3,
|
|
2765
|
+
glasses: true
|
|
2766
|
+
},
|
|
2767
|
+
{
|
|
2768
|
+
background: "#DBEAFE",
|
|
2769
|
+
skin: "#8B5E3C",
|
|
2770
|
+
hair: "#24130B",
|
|
2771
|
+
shirt: "#2563EB",
|
|
2772
|
+
accent: "#93C5FD",
|
|
2773
|
+
hairStyle: 0,
|
|
2774
|
+
expression: 1
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
background: "#DCFCE7",
|
|
2778
|
+
skin: "#D99B72",
|
|
2779
|
+
hair: "#3F2A20",
|
|
2780
|
+
shirt: "#15803D",
|
|
2781
|
+
accent: "#86EFAC",
|
|
2782
|
+
hairStyle: 1,
|
|
2783
|
+
expression: 2,
|
|
2784
|
+
glasses: true
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
background: "#EDE9FE",
|
|
2788
|
+
skin: "#F3C9AD",
|
|
2789
|
+
hair: "#33221A",
|
|
2790
|
+
shirt: "#7C3AED",
|
|
2791
|
+
accent: "#C4B5FD",
|
|
2792
|
+
hairStyle: 2,
|
|
2793
|
+
expression: 3
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
background: "#FFE4E6",
|
|
2797
|
+
skin: "#9B6547",
|
|
2798
|
+
hair: "#27150D",
|
|
2799
|
+
shirt: "#E11D48",
|
|
2800
|
+
accent: "#FDA4AF",
|
|
2801
|
+
hairStyle: 3,
|
|
2802
|
+
expression: 0
|
|
2803
|
+
},
|
|
2804
|
+
{
|
|
2805
|
+
background: "#FEF3C7",
|
|
2806
|
+
skin: "#F0B88B",
|
|
2807
|
+
hair: "#855F3B",
|
|
2808
|
+
shirt: "#B45309",
|
|
2809
|
+
accent: "#FBBF24",
|
|
2810
|
+
hairStyle: 0,
|
|
2811
|
+
expression: 2,
|
|
2812
|
+
glasses: true
|
|
2813
|
+
},
|
|
2814
|
+
{
|
|
2815
|
+
background: "#D1FAE5",
|
|
2816
|
+
skin: "#F8D0B0",
|
|
2817
|
+
hair: "#593A28",
|
|
2818
|
+
shirt: "#047857",
|
|
2819
|
+
accent: "#6EE7B7",
|
|
2820
|
+
hairStyle: 1,
|
|
2821
|
+
expression: 3
|
|
2822
|
+
},
|
|
2823
|
+
{
|
|
2824
|
+
background: "#E0F2FE",
|
|
2825
|
+
skin: "#CE8D65",
|
|
2826
|
+
hair: "#372015",
|
|
2827
|
+
shirt: "#0369A1",
|
|
2828
|
+
accent: "#7DD3FC",
|
|
2829
|
+
hairStyle: 2,
|
|
2830
|
+
expression: 0
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
background: "#F3E8FF",
|
|
2834
|
+
skin: "#F4C6A3",
|
|
2835
|
+
hair: "#2B1B15",
|
|
2836
|
+
shirt: "#9333EA",
|
|
2837
|
+
accent: "#D8B4FE",
|
|
2838
|
+
hairStyle: 3,
|
|
2839
|
+
expression: 1,
|
|
2840
|
+
glasses: true
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
background: "#FFE4C7",
|
|
2844
|
+
skin: "#A96D4C",
|
|
2845
|
+
hair: "#3A2116",
|
|
2846
|
+
shirt: "#C2410C",
|
|
2847
|
+
accent: "#FDBA74",
|
|
2848
|
+
hairStyle: 0,
|
|
2849
|
+
expression: 3
|
|
2850
|
+
},
|
|
2851
|
+
{
|
|
2852
|
+
background: "#ECFCCB",
|
|
2853
|
+
skin: "#F6CCA9",
|
|
2854
|
+
hair: "#7C5135",
|
|
2855
|
+
shirt: "#4D7C0F",
|
|
2856
|
+
accent: "#BEF264",
|
|
2857
|
+
hairStyle: 1,
|
|
2858
|
+
expression: 0
|
|
2859
|
+
},
|
|
2860
|
+
{
|
|
2861
|
+
background: "#CFFAFE",
|
|
2862
|
+
skin: "#E7A27A",
|
|
2863
|
+
hair: "#1F1814",
|
|
2864
|
+
shirt: "#0E7490",
|
|
2865
|
+
accent: "#67E8F9",
|
|
2866
|
+
hairStyle: 2,
|
|
2867
|
+
expression: 1,
|
|
2868
|
+
glasses: true
|
|
2869
|
+
},
|
|
2870
|
+
{
|
|
2871
|
+
background: "#FAE8FF",
|
|
2872
|
+
skin: "#F5C9AA",
|
|
2873
|
+
hair: "#5F3344",
|
|
2874
|
+
shirt: "#A21CAF",
|
|
2875
|
+
accent: "#F0ABFC",
|
|
2876
|
+
hairStyle: 3,
|
|
2877
|
+
expression: 2
|
|
2878
|
+
},
|
|
2879
|
+
{
|
|
2880
|
+
background: "#E0E7FF",
|
|
2881
|
+
skin: "#CF8F67",
|
|
2882
|
+
hair: "#1E1B18",
|
|
2883
|
+
shirt: "#4338CA",
|
|
2884
|
+
accent: "#A5B4FC",
|
|
2885
|
+
hairStyle: 0,
|
|
2886
|
+
expression: 3,
|
|
2887
|
+
glasses: true
|
|
2888
|
+
},
|
|
2889
|
+
{
|
|
2890
|
+
background: "#FFEDD5",
|
|
2891
|
+
skin: "#F7C9A6",
|
|
2892
|
+
hair: "#4E3326",
|
|
2893
|
+
shirt: "#EA580C",
|
|
2894
|
+
accent: "#FDBA74",
|
|
2895
|
+
hairStyle: 1,
|
|
2896
|
+
expression: 0
|
|
2897
|
+
},
|
|
2898
|
+
{
|
|
2899
|
+
background: "#D9F99D",
|
|
2900
|
+
skin: "#A66A49",
|
|
2901
|
+
hair: "#2B1911",
|
|
2902
|
+
shirt: "#65A30D",
|
|
2903
|
+
accent: "#BEF264",
|
|
2904
|
+
hairStyle: 2,
|
|
2905
|
+
expression: 1
|
|
2906
|
+
},
|
|
2907
|
+
{
|
|
2908
|
+
background: "#FCE7F3",
|
|
2909
|
+
skin: "#E9B08A",
|
|
2910
|
+
hair: "#4A2F24",
|
|
2911
|
+
shirt: "#DB2777",
|
|
2912
|
+
accent: "#F9A8D4",
|
|
2913
|
+
hairStyle: 3,
|
|
2914
|
+
expression: 2,
|
|
2915
|
+
glasses: true
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
background: "#DBEAFE",
|
|
2919
|
+
skin: "#F2C3A1",
|
|
2920
|
+
hair: "#312018",
|
|
2921
|
+
shirt: "#1D4ED8",
|
|
2922
|
+
accent: "#93C5FD",
|
|
2923
|
+
hairStyle: 0,
|
|
2924
|
+
expression: 0
|
|
2925
|
+
},
|
|
2926
|
+
{
|
|
2927
|
+
background: "#CCFBF1",
|
|
2928
|
+
skin: "#9D6244",
|
|
2929
|
+
hair: "#1F130E",
|
|
2930
|
+
shirt: "#0D9488",
|
|
2931
|
+
accent: "#5EEAD4",
|
|
2932
|
+
hairStyle: 1,
|
|
2933
|
+
expression: 1,
|
|
2934
|
+
glasses: true
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
background: "#FEE2E2",
|
|
2938
|
+
skin: "#F6CBAA",
|
|
2939
|
+
hair: "#75452A",
|
|
2940
|
+
shirt: "#DC2626",
|
|
2941
|
+
accent: "#FCA5A5",
|
|
2942
|
+
hairStyle: 2,
|
|
2943
|
+
expression: 2
|
|
2944
|
+
},
|
|
2945
|
+
{
|
|
2946
|
+
background: "#EDE9FE",
|
|
2947
|
+
skin: "#D98E65",
|
|
2948
|
+
hair: "#412720",
|
|
2949
|
+
shirt: "#6D28D9",
|
|
2950
|
+
accent: "#C4B5FD",
|
|
2951
|
+
hairStyle: 3,
|
|
2952
|
+
expression: 3
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
background: "#FEF9C3",
|
|
2956
|
+
skin: "#F5C7A4",
|
|
2957
|
+
hair: "#2B1A12",
|
|
2958
|
+
shirt: "#A16207",
|
|
2959
|
+
accent: "#FDE047",
|
|
2960
|
+
hairStyle: 0,
|
|
2961
|
+
expression: 1,
|
|
2962
|
+
glasses: true
|
|
2963
|
+
},
|
|
2964
|
+
{
|
|
2965
|
+
background: "#DCFCE7",
|
|
2966
|
+
skin: "#B97855",
|
|
2967
|
+
hair: "#291A13",
|
|
2968
|
+
shirt: "#16A34A",
|
|
2969
|
+
accent: "#86EFAC",
|
|
2970
|
+
hairStyle: 1,
|
|
2971
|
+
expression: 2
|
|
2972
|
+
},
|
|
2973
|
+
{
|
|
2974
|
+
background: "#E0F2FE",
|
|
2975
|
+
skin: "#F6C5A2",
|
|
2976
|
+
hair: "#6A4031",
|
|
2977
|
+
shirt: "#0284C7",
|
|
2978
|
+
accent: "#7DD3FC",
|
|
2979
|
+
hairStyle: 2,
|
|
2980
|
+
expression: 3,
|
|
2981
|
+
glasses: true
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
background: "#FAE8FF",
|
|
2985
|
+
skin: "#DE9B72",
|
|
2986
|
+
hair: "#211714",
|
|
2987
|
+
shirt: "#C026D3",
|
|
2988
|
+
accent: "#F0ABFC",
|
|
2989
|
+
hairStyle: 3,
|
|
2990
|
+
expression: 0
|
|
2991
|
+
},
|
|
2992
|
+
{
|
|
2993
|
+
background: "#FFE4E6",
|
|
2994
|
+
skin: "#F7CEAF",
|
|
2995
|
+
hair: "#42291E",
|
|
2996
|
+
shirt: "#E11D48",
|
|
2997
|
+
accent: "#FDA4AF",
|
|
2998
|
+
hairStyle: 0,
|
|
2999
|
+
expression: 2
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
background: "#ECFCCB",
|
|
3003
|
+
skin: "#CE8C65",
|
|
3004
|
+
hair: "#3C2419",
|
|
3005
|
+
shirt: "#3F6212",
|
|
3006
|
+
accent: "#BEF264",
|
|
3007
|
+
hairStyle: 1,
|
|
3008
|
+
expression: 3,
|
|
3009
|
+
glasses: true
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
background: "#CFFAFE",
|
|
3013
|
+
skin: "#F0BE99",
|
|
3014
|
+
hair: "#29201B",
|
|
3015
|
+
shirt: "#0891B2",
|
|
3016
|
+
accent: "#67E8F9",
|
|
3017
|
+
hairStyle: 2,
|
|
3018
|
+
expression: 0
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
background: "#F3E8FF",
|
|
3022
|
+
skin: "#A76B4B",
|
|
3023
|
+
hair: "#241710",
|
|
3024
|
+
shirt: "#7E22CE",
|
|
3025
|
+
accent: "#D8B4FE",
|
|
3026
|
+
hairStyle: 3,
|
|
3027
|
+
expression: 1,
|
|
3028
|
+
glasses: true
|
|
3029
|
+
}
|
|
3030
|
+
];
|
|
3031
|
+
function getInitials(content) {
|
|
3032
|
+
const words = content.trim().split(/\s+/).filter(Boolean);
|
|
3033
|
+
return words.slice(-2).map((word) => Array.from(word)[0] ?? "").join("").toLocaleUpperCase();
|
|
3034
|
+
}
|
|
3035
|
+
function resolveSize(size) {
|
|
3036
|
+
if (typeof size === "number") return `${size}px`;
|
|
3037
|
+
return /^\d+(?:\.\d+)?$/.test(size) ? `${size}px` : size;
|
|
3038
|
+
}
|
|
3039
|
+
function resolveFontSize(size) {
|
|
3040
|
+
const numericSize = typeof size === "number" ? size : Number(size);
|
|
3041
|
+
if (Number.isFinite(numericSize)) {
|
|
3042
|
+
return `${Math.min(28, Math.max(10, numericSize * 0.38))}px`;
|
|
3043
|
+
}
|
|
3044
|
+
return "1em";
|
|
3045
|
+
}
|
|
3046
|
+
function getFallbackIndex(index) {
|
|
3047
|
+
if (!Number.isFinite(index)) return 0;
|
|
3048
|
+
return Math.abs(Math.trunc(index)) % FALLBACK_AVATARS.length;
|
|
3049
|
+
}
|
|
3050
|
+
function AvatarFallbackIcon({ avatar }) {
|
|
3051
|
+
const {
|
|
3052
|
+
accent,
|
|
3053
|
+
background,
|
|
3054
|
+
expression,
|
|
3055
|
+
glasses,
|
|
3056
|
+
hair,
|
|
3057
|
+
hairStyle,
|
|
3058
|
+
shirt,
|
|
3059
|
+
skin
|
|
3060
|
+
} = avatar;
|
|
3061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3062
|
+
"svg",
|
|
3063
|
+
{
|
|
3064
|
+
className: "fe-avatar__fallback-icon",
|
|
3065
|
+
viewBox: "0 0 24 24",
|
|
3066
|
+
focusable: "false",
|
|
3067
|
+
"aria-hidden": "true",
|
|
3068
|
+
children: [
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("rect", { width: "24", height: "24", fill: background }),
|
|
3070
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3071
|
+
"path",
|
|
3072
|
+
{
|
|
3073
|
+
d: "M3 24c.52-3.79 3.58-6.25 9-6.25S20.48 20.21 21 24",
|
|
3074
|
+
fill: shirt
|
|
3075
|
+
}
|
|
3076
|
+
),
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3078
|
+
"path",
|
|
3079
|
+
{
|
|
3080
|
+
d: "M8.1 17.65h7.8l1.05 2.05H7.05l1.05-2.05Z",
|
|
3081
|
+
fill: accent,
|
|
3082
|
+
opacity: ".72"
|
|
3083
|
+
}
|
|
3084
|
+
),
|
|
3085
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("circle", { cx: "12", cy: "10.25", r: "5.25", fill: skin }),
|
|
3086
|
+
hairStyle === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3087
|
+
"path",
|
|
3088
|
+
{
|
|
3089
|
+
d: "M6.75 10.25C6.75 6.34 9.02 4 12.15 4c3.22 0 5.1 2.33 5.1 5.54-1.6-1.41-3.46-2.1-5.59-2.1-1.63 0-3.27.56-4.91 1.68Z",
|
|
3090
|
+
fill: hair
|
|
3091
|
+
}
|
|
3092
|
+
),
|
|
3093
|
+
hairStyle === 1 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3094
|
+
"path",
|
|
3095
|
+
{
|
|
3096
|
+
d: "M6.6 10.1c.16-3.93 2.57-6.2 5.62-6.2 3.57 0 5.3 2.75 5.08 6.32-1.42-1.23-2.91-1.82-4.48-1.82-2.4 0-3.9.65-6.22 1.7Z",
|
|
3097
|
+
fill: hair
|
|
3098
|
+
}
|
|
3099
|
+
),
|
|
3100
|
+
hairStyle === 2 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3101
|
+
"path",
|
|
3102
|
+
{
|
|
3103
|
+
d: "M6.8 10.55C6.8 6.28 9.43 4 12.2 4c3.46 0 5.13 2.83 4.93 6.38-1.38-1.58-3.03-2.38-4.92-2.38-1.81 0-3.61.85-5.41 2.55Z",
|
|
3104
|
+
fill: hair
|
|
3105
|
+
}
|
|
3106
|
+
),
|
|
3107
|
+
hairStyle === 3 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3108
|
+
"path",
|
|
3109
|
+
{
|
|
3110
|
+
d: "M6.66 10.1C6.94 6.12 9.18 4 12.1 4c3.77 0 5.2 2.95 5.18 6.21-1.5-1.07-3.1-1.6-4.8-1.6-2.18 0-3.98.5-5.82 1.49Z",
|
|
3111
|
+
fill: hair
|
|
3112
|
+
}
|
|
3113
|
+
),
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("circle", { cx: "10.05", cy: "10.65", r: ".48", fill: "#3B2924" }),
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("circle", { cx: "13.95", cy: "10.65", r: ".48", fill: "#3B2924" }),
|
|
3116
|
+
expression === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3117
|
+
"path",
|
|
3118
|
+
{
|
|
3119
|
+
d: "M10.25 13.2c1.08.66 2.42.66 3.5 0",
|
|
3120
|
+
fill: "none",
|
|
3121
|
+
stroke: "#A94F4F",
|
|
3122
|
+
strokeWidth: ".7",
|
|
3123
|
+
strokeLinecap: "round"
|
|
3124
|
+
}
|
|
3125
|
+
),
|
|
3126
|
+
expression === 1 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3127
|
+
"path",
|
|
3128
|
+
{
|
|
3129
|
+
d: "M10.5 13.2h3",
|
|
3130
|
+
fill: "none",
|
|
3131
|
+
stroke: "#A94F4F",
|
|
3132
|
+
strokeWidth: ".7",
|
|
3133
|
+
strokeLinecap: "round"
|
|
3134
|
+
}
|
|
3135
|
+
),
|
|
3136
|
+
expression === 2 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3137
|
+
"path",
|
|
3138
|
+
{
|
|
3139
|
+
d: "M10.6 13.38c.84-.44 1.96-.44 2.8 0",
|
|
3140
|
+
fill: "none",
|
|
3141
|
+
stroke: "#A94F4F",
|
|
3142
|
+
strokeWidth: ".7",
|
|
3143
|
+
strokeLinecap: "round"
|
|
3144
|
+
}
|
|
3145
|
+
),
|
|
3146
|
+
expression === 3 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("circle", { cx: "12", cy: "13.2", r: ".82", fill: "#B95A5A" }),
|
|
3147
|
+
glasses && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("g", { fill: "none", stroke: "#3C4355", strokeWidth: ".65", children: [
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("circle", { cx: "10", cy: "10.55", r: "1.45" }),
|
|
3149
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("circle", { cx: "14", cy: "10.55", r: "1.45" }),
|
|
3150
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M11.45 10.55h1.1M8.55 10.55H7.5m9 0h-1.05" })
|
|
3151
|
+
] })
|
|
3152
|
+
]
|
|
3153
|
+
}
|
|
3154
|
+
);
|
|
3155
|
+
}
|
|
3156
|
+
function Avatar({
|
|
3157
|
+
src,
|
|
3158
|
+
content,
|
|
3159
|
+
alt,
|
|
3160
|
+
size = 40,
|
|
3161
|
+
shape = "circle",
|
|
3162
|
+
fallbackIndex,
|
|
3163
|
+
className,
|
|
3164
|
+
style,
|
|
3165
|
+
role,
|
|
3166
|
+
"aria-label": ariaLabel,
|
|
3167
|
+
...props
|
|
3168
|
+
}) {
|
|
3169
|
+
const [generatedFallbackIndex] = (0, import_react23.useState)(
|
|
3170
|
+
() => Math.floor(Math.random() * FALLBACK_AVATARS.length)
|
|
3171
|
+
);
|
|
3172
|
+
const [failedImageSrc, setFailedImageSrc] = (0, import_react23.useState)();
|
|
3173
|
+
const imageSrc = src?.trim();
|
|
3174
|
+
const trimmedContent = content?.trim() ?? "";
|
|
3175
|
+
const showImage = Boolean(imageSrc && failedImageSrc !== imageSrc);
|
|
3176
|
+
const initials = trimmedContent ? getInitials(trimmedContent) : "";
|
|
3177
|
+
const selectedFallback = FALLBACK_AVATARS[getFallbackIndex(fallbackIndex ?? generatedFallbackIndex)];
|
|
3178
|
+
const avatarStyle = {
|
|
3179
|
+
"--fe-avatar-size": resolveSize(size),
|
|
3180
|
+
"--fe-avatar-font-size": resolveFontSize(size),
|
|
3181
|
+
...style
|
|
3182
|
+
};
|
|
3183
|
+
const fallbackLabel = (alt ?? trimmedContent) || "Avatar";
|
|
3184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3185
|
+
"span",
|
|
3186
|
+
{
|
|
3187
|
+
className: ["fe-avatar", `fe-avatar--${shape}`, className].filter(Boolean).join(" "),
|
|
3188
|
+
style: avatarStyle,
|
|
3189
|
+
role: showImage ? role : role ?? "img",
|
|
3190
|
+
"aria-label": showImage ? ariaLabel : ariaLabel ?? fallbackLabel,
|
|
3191
|
+
...props,
|
|
3192
|
+
children: [
|
|
3193
|
+
showImage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3194
|
+
"img",
|
|
3195
|
+
{
|
|
3196
|
+
className: "fe-avatar__image",
|
|
3197
|
+
src: imageSrc,
|
|
3198
|
+
alt: alt ?? trimmedContent,
|
|
3199
|
+
onError: () => setFailedImageSrc(imageSrc)
|
|
3200
|
+
}
|
|
3201
|
+
),
|
|
3202
|
+
!showImage && initials && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fe-avatar__initials", "aria-hidden": "true", children: initials }),
|
|
3203
|
+
!showImage && !initials && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AvatarFallbackIcon, { avatar: selectedFallback })
|
|
3204
|
+
]
|
|
3205
|
+
}
|
|
3206
|
+
);
|
|
3207
|
+
}
|
|
3208
|
+
function AvatarGroup({
|
|
3209
|
+
children,
|
|
3210
|
+
maxCount,
|
|
3211
|
+
className,
|
|
3212
|
+
style,
|
|
3213
|
+
role,
|
|
3214
|
+
...props
|
|
3215
|
+
}) {
|
|
3216
|
+
const avatars = import_react23.Children.toArray(children).filter(import_react23.isValidElement);
|
|
3217
|
+
const hasMaxCount = typeof maxCount === "number" && Number.isFinite(maxCount) && maxCount > 0;
|
|
3218
|
+
const itemLimit = hasMaxCount ? Math.floor(maxCount) : avatars.length;
|
|
3219
|
+
const hasOverflow = avatars.length > itemLimit;
|
|
3220
|
+
const visibleCount = hasOverflow ? Math.max(0, itemLimit - 1) : itemLimit;
|
|
3221
|
+
const visibleAvatars = avatars.slice(0, visibleCount);
|
|
3222
|
+
const overflowCount = avatars.length - visibleAvatars.length;
|
|
3223
|
+
const firstAvatarSize = avatars[0]?.props.size ?? 40;
|
|
3224
|
+
const overflowStyle = {
|
|
3225
|
+
"--fe-avatar-size": resolveSize(firstAvatarSize),
|
|
3226
|
+
"--fe-avatar-font-size": resolveFontSize(firstAvatarSize)
|
|
3227
|
+
};
|
|
3228
|
+
const singleContent = avatars.length === 1 ? avatars[0]?.props.content?.trim() ?? "" : "";
|
|
3229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3230
|
+
"div",
|
|
3231
|
+
{
|
|
3232
|
+
className: ["fe-avatar-group", className].filter(Boolean).join(" "),
|
|
3233
|
+
style,
|
|
3234
|
+
role: role ?? "group",
|
|
3235
|
+
...props,
|
|
3236
|
+
children: [
|
|
3237
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fe-avatar-group__items", children: [
|
|
3238
|
+
visibleAvatars.map((avatar, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3239
|
+
"span",
|
|
3240
|
+
{
|
|
3241
|
+
className: "fe-avatar-group__item",
|
|
3242
|
+
style: { zIndex: visibleAvatars.length - index },
|
|
3243
|
+
children: avatar
|
|
3244
|
+
},
|
|
3245
|
+
avatar.key ?? index
|
|
3246
|
+
)),
|
|
3247
|
+
hasOverflow && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3248
|
+
"span",
|
|
3249
|
+
{
|
|
3250
|
+
className: "fe-avatar-group__more",
|
|
3251
|
+
style: overflowStyle,
|
|
3252
|
+
role: "img",
|
|
3253
|
+
"aria-label": `${overflowCount} more avatars`,
|
|
3254
|
+
children: [
|
|
3255
|
+
"+",
|
|
3256
|
+
overflowCount
|
|
3257
|
+
]
|
|
3258
|
+
}
|
|
3259
|
+
)
|
|
3260
|
+
] }),
|
|
3261
|
+
singleContent && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fe-avatar-group__content", children: singleContent })
|
|
3262
|
+
]
|
|
3263
|
+
}
|
|
3264
|
+
);
|
|
3265
|
+
}
|
|
2382
3266
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2383
3267
|
0 && (module.exports = {
|
|
3268
|
+
Avatar,
|
|
3269
|
+
AvatarGroup,
|
|
2384
3270
|
Button,
|
|
3271
|
+
ButtonBar,
|
|
2385
3272
|
Checkbox,
|
|
2386
3273
|
ChevronDownIcon,
|
|
2387
3274
|
ChevronUpIcon,
|
|
@@ -2394,6 +3281,8 @@ function Snackbar({
|
|
|
2394
3281
|
Loading,
|
|
2395
3282
|
Message,
|
|
2396
3283
|
Modal,
|
|
3284
|
+
MoreHorizontalIcon,
|
|
3285
|
+
MoreVerticalIcon,
|
|
2397
3286
|
NumberInput,
|
|
2398
3287
|
Pagination,
|
|
2399
3288
|
PlusIcon,
|
|
@@ -2415,6 +3304,7 @@ function Snackbar({
|
|
|
2415
3304
|
TableHead,
|
|
2416
3305
|
TableHeader,
|
|
2417
3306
|
TableRow,
|
|
3307
|
+
Tabs,
|
|
2418
3308
|
TextArea,
|
|
2419
3309
|
TextInput,
|
|
2420
3310
|
Toggle,
|