sellmate-design-system-react 9.0.0-beta.55 → 9.0.0-beta.56
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/AGENTS.md +79 -26
- package/dist/components/SIcon/icons.gen.d.ts +5 -0
- package/dist/index.cjs +342 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +342 -17
- package/dist/index.js.map +1 -1
- package/dist/lib/global-overlay.d.ts +5 -0
- package/dist/lib/inert.d.ts +11 -0
- package/dist/llms-full.txt +79 -26
- package/dist/llms.txt +79 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -343,6 +343,43 @@ var Icon_alert = (p) => {
|
|
|
343
343
|
}
|
|
344
344
|
);
|
|
345
345
|
};
|
|
346
|
+
var Icon_alignCenter = (p) => {
|
|
347
|
+
const { size = 24, ...rest } = p;
|
|
348
|
+
return /* @__PURE__ */ jsxs(
|
|
349
|
+
"svg",
|
|
350
|
+
{
|
|
351
|
+
width: size,
|
|
352
|
+
height: size,
|
|
353
|
+
viewBox: "0 0 24 24",
|
|
354
|
+
fill: "none",
|
|
355
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
356
|
+
...rest,
|
|
357
|
+
children: [
|
|
358
|
+
/* @__PURE__ */ jsx(
|
|
359
|
+
"path",
|
|
360
|
+
{
|
|
361
|
+
d: "M20 16.25C20.4142 16.25 20.75 16.5858 20.75 17C20.75 17.4142 20.4142 17.75 20 17.75H4C3.58579 17.75 3.25 17.4142 3.25 17C3.25 16.5858 3.58579 16.25 4 16.25H20Z",
|
|
362
|
+
fill: "currentColor"
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ jsx(
|
|
366
|
+
"path",
|
|
367
|
+
{
|
|
368
|
+
d: "M16 11.25C16.4142 11.25 16.75 11.5858 16.75 12C16.75 12.4142 16.4142 12.75 16 12.75H7C6.58579 12.75 6.25 12.4142 6.25 12C6.25 11.5858 6.58579 11.25 7 11.25H16Z",
|
|
369
|
+
fill: "currentColor"
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ jsx(
|
|
373
|
+
"path",
|
|
374
|
+
{
|
|
375
|
+
d: "M21.4004 6.25C21.8144 6.25021 22.1504 6.58592 22.1504 7C22.1504 7.41408 21.8144 7.74979 21.4004 7.75H3C2.58579 7.75 2.25 7.41421 2.25 7C2.25 6.58579 2.58579 6.25 3 6.25H21.4004Z",
|
|
376
|
+
fill: "currentColor"
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
};
|
|
346
383
|
var Icon_alignKorean = (p) => {
|
|
347
384
|
const { size = 24, ...rest } = p;
|
|
348
385
|
return /* @__PURE__ */ jsxs(
|
|
@@ -382,6 +419,147 @@ var Icon_alignKorean = (p) => {
|
|
|
382
419
|
}
|
|
383
420
|
);
|
|
384
421
|
};
|
|
422
|
+
var Icon_alignLeft = (p) => {
|
|
423
|
+
const { size = 24, ...rest } = p;
|
|
424
|
+
return /* @__PURE__ */ jsxs(
|
|
425
|
+
"svg",
|
|
426
|
+
{
|
|
427
|
+
width: size,
|
|
428
|
+
height: size,
|
|
429
|
+
viewBox: "0 0 24 24",
|
|
430
|
+
fill: "none",
|
|
431
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
432
|
+
...rest,
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ jsx(
|
|
435
|
+
"path",
|
|
436
|
+
{
|
|
437
|
+
d: "M19 16.25C19.4142 16.25 19.75 16.5858 19.75 17C19.75 17.4142 19.4142 17.75 19 17.75H3C2.58579 17.75 2.25 17.4142 2.25 17C2.25 16.5858 2.58579 16.25 3 16.25H19Z",
|
|
438
|
+
fill: "currentColor"
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
/* @__PURE__ */ jsx(
|
|
442
|
+
"path",
|
|
443
|
+
{
|
|
444
|
+
d: "M12 11.25C12.4142 11.25 12.75 11.5858 12.75 12C12.75 12.4142 12.4142 12.75 12 12.75H3C2.58579 12.75 2.25 12.4142 2.25 12C2.25 11.5858 2.58579 11.25 3 11.25H12Z",
|
|
445
|
+
fill: "currentColor"
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
/* @__PURE__ */ jsx(
|
|
449
|
+
"path",
|
|
450
|
+
{
|
|
451
|
+
d: "M21.4004 6.25C21.8144 6.25021 22.1504 6.58592 22.1504 7C22.1504 7.41408 21.8144 7.74979 21.4004 7.75H3C2.58579 7.75 2.25 7.41421 2.25 7C2.25 6.58579 2.58579 6.25 3 6.25H21.4004Z",
|
|
452
|
+
fill: "currentColor"
|
|
453
|
+
}
|
|
454
|
+
)
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
var Icon_alignMiddle = (p) => {
|
|
460
|
+
const { size = 24, ...rest } = p;
|
|
461
|
+
return /* @__PURE__ */ jsxs(
|
|
462
|
+
"svg",
|
|
463
|
+
{
|
|
464
|
+
width: size,
|
|
465
|
+
height: size,
|
|
466
|
+
viewBox: "0 0 24 24",
|
|
467
|
+
fill: "none",
|
|
468
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
469
|
+
...rest,
|
|
470
|
+
children: [
|
|
471
|
+
/* @__PURE__ */ jsx(
|
|
472
|
+
"path",
|
|
473
|
+
{
|
|
474
|
+
d: "M11.4844 13.9551C11.7735 13.6819 12.2265 13.6819 12.5156 13.9551L15.5156 16.79C15.8165 17.0746 15.8294 17.5496 15.5449 17.8506C15.2604 18.1515 14.7854 18.1653 14.4844 17.8809L12.75 16.2422V20.5C12.75 20.9142 12.4142 21.25 12 21.25C11.5858 21.25 11.25 20.9142 11.25 20.5V16.2422L9.51562 17.8809C9.21463 18.1653 8.73961 18.1515 8.45508 17.8506C8.17061 17.5496 8.18347 17.0746 8.48438 16.79L11.4844 13.9551Z",
|
|
475
|
+
fill: "currentColor"
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
/* @__PURE__ */ jsx(
|
|
479
|
+
"path",
|
|
480
|
+
{
|
|
481
|
+
d: "M21.2002 11.25C21.6142 11.2502 21.9502 11.5859 21.9502 12C21.9502 12.4141 21.6142 12.7498 21.2002 12.75H2.7998C2.38568 12.7499 2.0498 12.4142 2.0498 12C2.0498 11.5858 2.38568 11.2501 2.7998 11.25H21.2002Z",
|
|
482
|
+
fill: "currentColor"
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
/* @__PURE__ */ jsx(
|
|
486
|
+
"path",
|
|
487
|
+
{
|
|
488
|
+
d: "M12 2.75C12.4142 2.75 12.75 3.08579 12.75 3.5V7.75781L14.4844 6.11914C14.7854 5.83467 15.2604 5.8485 15.5449 6.14941C15.8294 6.45041 15.8165 6.92543 15.5156 7.20996L12.5156 10.0449C12.2265 10.3182 11.7735 10.3182 11.4844 10.0449L8.48438 7.20996C8.18347 6.92543 8.17061 6.45041 8.45508 6.14941C8.73961 5.8485 9.21463 5.83467 9.51562 6.11914L11.25 7.75781V3.5C11.25 3.08579 11.5858 2.75 12 2.75Z",
|
|
489
|
+
fill: "currentColor"
|
|
490
|
+
}
|
|
491
|
+
)
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
);
|
|
495
|
+
};
|
|
496
|
+
var Icon_alignRight = (p) => {
|
|
497
|
+
const { size = 24, ...rest } = p;
|
|
498
|
+
return /* @__PURE__ */ jsxs(
|
|
499
|
+
"svg",
|
|
500
|
+
{
|
|
501
|
+
width: size,
|
|
502
|
+
height: size,
|
|
503
|
+
viewBox: "0 0 24 24",
|
|
504
|
+
fill: "none",
|
|
505
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
506
|
+
...rest,
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ jsx(
|
|
509
|
+
"path",
|
|
510
|
+
{
|
|
511
|
+
d: "M21 16.25C21.4142 16.25 21.75 16.5858 21.75 17C21.75 17.4142 21.4142 17.75 21 17.75H5C4.58579 17.75 4.25 17.4142 4.25 17C4.25 16.5858 4.58579 16.25 5 16.25H21Z",
|
|
512
|
+
fill: "currentColor"
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
/* @__PURE__ */ jsx(
|
|
516
|
+
"path",
|
|
517
|
+
{
|
|
518
|
+
d: "M21 11.25C21.4142 11.25 21.75 11.5858 21.75 12C21.75 12.4142 21.4142 12.75 21 12.75H12C11.5858 12.75 11.25 12.4142 11.25 12C11.25 11.5858 11.5858 11.25 12 11.25H21Z",
|
|
519
|
+
fill: "currentColor"
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ jsx(
|
|
523
|
+
"path",
|
|
524
|
+
{
|
|
525
|
+
d: "M21.4004 6.25C21.8144 6.25021 22.1504 6.58592 22.1504 7C22.1504 7.41408 21.8144 7.74979 21.4004 7.75H3C2.58579 7.75 2.25 7.41421 2.25 7C2.25 6.58579 2.58579 6.25 3 6.25H21.4004Z",
|
|
526
|
+
fill: "currentColor"
|
|
527
|
+
}
|
|
528
|
+
)
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
};
|
|
533
|
+
var Icon_alignTop = (p) => {
|
|
534
|
+
const { size = 24, ...rest } = p;
|
|
535
|
+
return /* @__PURE__ */ jsxs(
|
|
536
|
+
"svg",
|
|
537
|
+
{
|
|
538
|
+
width: size,
|
|
539
|
+
height: size,
|
|
540
|
+
viewBox: "0 0 24 24",
|
|
541
|
+
fill: "none",
|
|
542
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
543
|
+
...rest,
|
|
544
|
+
children: [
|
|
545
|
+
/* @__PURE__ */ jsx(
|
|
546
|
+
"path",
|
|
547
|
+
{
|
|
548
|
+
d: "M12 6.1499C12.2017 6.1499 12.3951 6.23132 12.5361 6.37549L18.5361 12.519C18.8254 12.8153 18.8204 13.2901 18.5244 13.5796C18.2281 13.869 17.7533 13.8631 17.4639 13.5669L12.75 8.7417V19.8999C12.75 20.3141 12.4142 20.6499 12 20.6499C11.5858 20.6499 11.25 20.3141 11.25 19.8999V8.7417L6.53613 13.5669C6.24671 13.8631 5.77189 13.869 5.47559 13.5796C5.1796 13.2901 5.17456 12.8153 5.46387 12.519L11.4639 6.37549C11.6049 6.23132 11.7983 6.1499 12 6.1499Z",
|
|
549
|
+
fill: "currentColor"
|
|
550
|
+
}
|
|
551
|
+
),
|
|
552
|
+
/* @__PURE__ */ jsx(
|
|
553
|
+
"path",
|
|
554
|
+
{
|
|
555
|
+
d: "M21.2002 3.24951C21.6142 3.24972 21.9502 3.58641 21.9502 4.00049C21.9499 4.41435 21.6141 4.75028 21.2002 4.75049H2.7998C2.38584 4.75039 2.05007 4.41442 2.0498 4.00049C2.0498 3.58634 2.38568 3.24961 2.7998 3.24951H21.2002Z",
|
|
556
|
+
fill: "currentColor"
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
};
|
|
385
563
|
var Icon_archive = (p) => {
|
|
386
564
|
const { size = 24, ...rest } = p;
|
|
387
565
|
return /* @__PURE__ */ jsx(
|
|
@@ -3400,7 +3578,12 @@ var ICONS = {
|
|
|
3400
3578
|
account: Icon_account,
|
|
3401
3579
|
add: Icon_add,
|
|
3402
3580
|
alert: Icon_alert,
|
|
3581
|
+
alignCenter: Icon_alignCenter,
|
|
3403
3582
|
alignKorean: Icon_alignKorean,
|
|
3583
|
+
alignLeft: Icon_alignLeft,
|
|
3584
|
+
alignMiddle: Icon_alignMiddle,
|
|
3585
|
+
alignRight: Icon_alignRight,
|
|
3586
|
+
alignTop: Icon_alignTop,
|
|
3404
3587
|
archive: Icon_archive,
|
|
3405
3588
|
arrowDown: Icon_arrowDown,
|
|
3406
3589
|
arrowLeft: Icon_arrowLeft,
|
|
@@ -6165,6 +6348,13 @@ function SDraggableListInner({
|
|
|
6165
6348
|
);
|
|
6166
6349
|
}
|
|
6167
6350
|
var SDraggableList = /* @__PURE__ */ forwardRef(SDraggableListInner);
|
|
6351
|
+
function useInertRef(inert) {
|
|
6352
|
+
const ref = useRef(null);
|
|
6353
|
+
useEffect(() => {
|
|
6354
|
+
ref.current?.toggleAttribute("inert", inert);
|
|
6355
|
+
}, [inert]);
|
|
6356
|
+
return ref;
|
|
6357
|
+
}
|
|
6168
6358
|
var SExpansionItemDescendantContext = /* @__PURE__ */ createContext(
|
|
6169
6359
|
null
|
|
6170
6360
|
);
|
|
@@ -6196,6 +6386,7 @@ var SExpansionItem = /* @__PURE__ */ forwardRef(
|
|
|
6196
6386
|
const [hovered, setHovered] = useState(false);
|
|
6197
6387
|
const parentDescendantContext = useContext(SExpansionItemDescendantContext);
|
|
6198
6388
|
const isExpanded = expanded ?? internalExpanded;
|
|
6389
|
+
const bodyRef = useInertRef(!isExpanded);
|
|
6199
6390
|
const isSelected = isExpanded && (selected || expandedDescendantCount === 0);
|
|
6200
6391
|
const hasChevronInteraction = interaction === "chevron";
|
|
6201
6392
|
const showInteractionChevron = hasChevronInteraction && !disabled && (isSelected || hovered);
|
|
@@ -6319,6 +6510,7 @@ var SExpansionItem = /* @__PURE__ */ forwardRef(
|
|
|
6319
6510
|
"div",
|
|
6320
6511
|
{
|
|
6321
6512
|
id,
|
|
6513
|
+
ref: bodyRef,
|
|
6322
6514
|
"aria-hidden": !isExpanded,
|
|
6323
6515
|
className: cn(
|
|
6324
6516
|
"grid overflow-hidden bg-(--cmp-listExpansionItem-body-bg) transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
@@ -6764,11 +6956,29 @@ function TreeConnector({
|
|
|
6764
6956
|
] })
|
|
6765
6957
|
] });
|
|
6766
6958
|
}
|
|
6959
|
+
function TreeBranch({ expanded, children }) {
|
|
6960
|
+
const branchRef = useInertRef(!expanded);
|
|
6961
|
+
return /* @__PURE__ */ jsx(
|
|
6962
|
+
"div",
|
|
6963
|
+
{
|
|
6964
|
+
ref: branchRef,
|
|
6965
|
+
"aria-hidden": !expanded,
|
|
6966
|
+
className: cn(
|
|
6967
|
+
"grid w-full overflow-hidden transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
6968
|
+
expanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
6969
|
+
),
|
|
6970
|
+
children: /* @__PURE__ */ jsx("div", { className: "min-h-0 overflow-hidden", children })
|
|
6971
|
+
}
|
|
6972
|
+
);
|
|
6973
|
+
}
|
|
6767
6974
|
function STreeAllItem({
|
|
6768
6975
|
selected,
|
|
6769
6976
|
indeterminate,
|
|
6770
6977
|
border,
|
|
6771
6978
|
size,
|
|
6979
|
+
rowId,
|
|
6980
|
+
tabIndex,
|
|
6981
|
+
onKeyDown,
|
|
6772
6982
|
onSelect
|
|
6773
6983
|
}) {
|
|
6774
6984
|
const checkboxValue = indeterminate ? null : selected;
|
|
@@ -6780,6 +6990,9 @@ function STreeAllItem({
|
|
|
6780
6990
|
role: "treeitem",
|
|
6781
6991
|
"aria-level": 1,
|
|
6782
6992
|
"aria-selected": selected,
|
|
6993
|
+
"data-tree-row": rowId,
|
|
6994
|
+
tabIndex,
|
|
6995
|
+
onKeyDown,
|
|
6783
6996
|
onClick: onSelect,
|
|
6784
6997
|
className: cn(
|
|
6785
6998
|
"group/tree-item box-border flex w-full cursor-pointer items-center overflow-hidden bg-(--cmp-tree-item-bg-default) px-(--cmp-tree-item-paddingX) text-left hover:bg-(--cmp-tree-item-bg-hover)",
|
|
@@ -6965,6 +7178,34 @@ var STreeImpl = /* @__PURE__ */ forwardRef(function STree({
|
|
|
6965
7178
|
const someSelected = selectableIds.some((id) => selectedSet.has(id));
|
|
6966
7179
|
const allIndeterminate = someSelected && !allSelected;
|
|
6967
7180
|
const showAllItem = selectable && showSelectAll;
|
|
7181
|
+
const visibleRows = useMemo(() => {
|
|
7182
|
+
const rows = [];
|
|
7183
|
+
if (showAllItem) {
|
|
7184
|
+
rows.push({ id: TREE_ALL_NODE.id, node: TREE_ALL_NODE, parentId: null, expanded: false });
|
|
7185
|
+
}
|
|
7186
|
+
const walk = (nodes, parentId) => {
|
|
7187
|
+
nodes.forEach((node) => {
|
|
7188
|
+
const expanded = !!node.children?.length && expandedSet.has(node.id);
|
|
7189
|
+
rows.push({ id: node.id, node, parentId, expanded });
|
|
7190
|
+
if (expanded) walk(node.children, node.id);
|
|
7191
|
+
});
|
|
7192
|
+
};
|
|
7193
|
+
walk(items, null);
|
|
7194
|
+
return rows;
|
|
7195
|
+
}, [items, expandedSet, showAllItem]);
|
|
7196
|
+
const [focusedId, setFocusedId] = useState(null);
|
|
7197
|
+
const activeRowId = focusedId != null && visibleRows.some((row) => row.id === focusedId) ? focusedId : visibleRows[0]?.id ?? null;
|
|
7198
|
+
const treeRef = useRef(null);
|
|
7199
|
+
const focusRow = (id) => {
|
|
7200
|
+
setFocusedId(id);
|
|
7201
|
+
const rows = treeRef.current?.querySelectorAll("[data-tree-row]") ?? [];
|
|
7202
|
+
for (const row of rows) {
|
|
7203
|
+
if (row.dataset.treeRow === id) {
|
|
7204
|
+
row.focus();
|
|
7205
|
+
return;
|
|
7206
|
+
}
|
|
7207
|
+
}
|
|
7208
|
+
};
|
|
6968
7209
|
const updateExpanded = (node) => {
|
|
6969
7210
|
const next = new Set(currentExpandedIds);
|
|
6970
7211
|
if (next.has(node.id)) next.delete(node.id);
|
|
@@ -6998,6 +7239,59 @@ var STreeImpl = /* @__PURE__ */ forwardRef(function STree({
|
|
|
6998
7239
|
if (value === void 0) setInternalValue(orderedIds);
|
|
6999
7240
|
onValueChange?.(orderedIds, TREE_ALL_NODE);
|
|
7000
7241
|
};
|
|
7242
|
+
const handleTreeKeyDown = (event) => {
|
|
7243
|
+
const target = event.target;
|
|
7244
|
+
const rowId = target.dataset?.treeRow;
|
|
7245
|
+
if (rowId == null) return;
|
|
7246
|
+
const index = visibleRows.findIndex((row2) => row2.id === rowId);
|
|
7247
|
+
if (index < 0) return;
|
|
7248
|
+
const row = visibleRows[index];
|
|
7249
|
+
const hasChildren = !!row.node.children?.length;
|
|
7250
|
+
switch (event.key) {
|
|
7251
|
+
case "ArrowDown": {
|
|
7252
|
+
const next = visibleRows[index + 1];
|
|
7253
|
+
if (next) focusRow(next.id);
|
|
7254
|
+
break;
|
|
7255
|
+
}
|
|
7256
|
+
case "ArrowUp": {
|
|
7257
|
+
const prev = visibleRows[index - 1];
|
|
7258
|
+
if (prev) focusRow(prev.id);
|
|
7259
|
+
break;
|
|
7260
|
+
}
|
|
7261
|
+
case "ArrowRight": {
|
|
7262
|
+
if (!hasChildren || row.node.disabled) return;
|
|
7263
|
+
if (!row.expanded) updateExpanded(row.node);
|
|
7264
|
+
else if (visibleRows[index + 1]) focusRow(visibleRows[index + 1].id);
|
|
7265
|
+
break;
|
|
7266
|
+
}
|
|
7267
|
+
case "ArrowLeft": {
|
|
7268
|
+
if (hasChildren && row.expanded && !row.node.disabled) updateExpanded(row.node);
|
|
7269
|
+
else if (row.parentId != null) focusRow(row.parentId);
|
|
7270
|
+
else return;
|
|
7271
|
+
break;
|
|
7272
|
+
}
|
|
7273
|
+
case "Home": {
|
|
7274
|
+
if (visibleRows[0]) focusRow(visibleRows[0].id);
|
|
7275
|
+
break;
|
|
7276
|
+
}
|
|
7277
|
+
case "End": {
|
|
7278
|
+
const last = visibleRows[visibleRows.length - 1];
|
|
7279
|
+
if (last) focusRow(last.id);
|
|
7280
|
+
break;
|
|
7281
|
+
}
|
|
7282
|
+
case "Enter":
|
|
7283
|
+
case " ": {
|
|
7284
|
+
if (row.id === TREE_ALL_NODE.id) updateAllSelected();
|
|
7285
|
+
else if (selectable) updateSelected(row.node);
|
|
7286
|
+
else if (hasChildren && !row.node.disabled) updateExpanded(row.node);
|
|
7287
|
+
else return;
|
|
7288
|
+
break;
|
|
7289
|
+
}
|
|
7290
|
+
default:
|
|
7291
|
+
return;
|
|
7292
|
+
}
|
|
7293
|
+
event.preventDefault();
|
|
7294
|
+
};
|
|
7001
7295
|
const renderNodes = (nodes, depth = 1, ancestorLast = []) => nodes.map((node, index) => {
|
|
7002
7296
|
const isLast = index === nodes.length - 1;
|
|
7003
7297
|
const isExpanded = expandedSet.has(node.id);
|
|
@@ -7006,6 +7300,9 @@ var STreeImpl = /* @__PURE__ */ forwardRef(function STree({
|
|
|
7006
7300
|
/* @__PURE__ */ jsx(
|
|
7007
7301
|
STreeItem2,
|
|
7008
7302
|
{
|
|
7303
|
+
"data-tree-row": node.id,
|
|
7304
|
+
tabIndex: activeRowId === node.id ? 0 : -1,
|
|
7305
|
+
onKeyDown: handleTreeKeyDown,
|
|
7009
7306
|
node,
|
|
7010
7307
|
depth,
|
|
7011
7308
|
last: isLast,
|
|
@@ -7023,30 +7320,31 @@ var STreeImpl = /* @__PURE__ */ forwardRef(function STree({
|
|
|
7023
7320
|
onTreeSelect: updateSelected
|
|
7024
7321
|
}
|
|
7025
7322
|
),
|
|
7026
|
-
node.children?.length ? /* @__PURE__ */ jsx(
|
|
7027
|
-
"div",
|
|
7028
|
-
{
|
|
7029
|
-
"aria-hidden": !isExpanded,
|
|
7030
|
-
className: cn(
|
|
7031
|
-
"grid w-full overflow-hidden transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",
|
|
7032
|
-
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
7033
|
-
),
|
|
7034
|
-
children: /* @__PURE__ */ jsx("div", { className: "min-h-0 overflow-hidden", children: renderNodes(node.children, depth + 1, [...ancestorLast, isLast]) })
|
|
7035
|
-
}
|
|
7036
|
-
) : null
|
|
7323
|
+
node.children?.length ? /* @__PURE__ */ jsx(TreeBranch, { expanded: isExpanded, children: renderNodes(node.children, depth + 1, [...ancestorLast, isLast]) }) : null
|
|
7037
7324
|
] }, node.id);
|
|
7038
7325
|
});
|
|
7039
7326
|
return /* @__PURE__ */ jsxs(
|
|
7040
7327
|
"div",
|
|
7041
7328
|
{
|
|
7042
|
-
ref
|
|
7329
|
+
ref: (node) => {
|
|
7330
|
+
treeRef.current = node;
|
|
7331
|
+
if (typeof ref === "function") ref(node);
|
|
7332
|
+
else if (ref) ref.current = node;
|
|
7333
|
+
},
|
|
7043
7334
|
role: "tree",
|
|
7044
7335
|
className: cn("flex w-full flex-col items-start bg-(--cmp-tree-item-bg-default)", className),
|
|
7336
|
+
onFocus: (event) => {
|
|
7337
|
+
const rowId = event.target.closest?.("[data-tree-row]")?.getAttribute("data-tree-row");
|
|
7338
|
+
if (rowId != null) setFocusedId(rowId);
|
|
7339
|
+
},
|
|
7045
7340
|
...rest,
|
|
7046
7341
|
children: [
|
|
7047
7342
|
showAllItem && /* @__PURE__ */ jsx(
|
|
7048
7343
|
STreeAllItem,
|
|
7049
7344
|
{
|
|
7345
|
+
rowId: TREE_ALL_NODE.id,
|
|
7346
|
+
tabIndex: activeRowId === TREE_ALL_NODE.id ? 0 : -1,
|
|
7347
|
+
onKeyDown: handleTreeKeyDown,
|
|
7050
7348
|
selected: allSelected,
|
|
7051
7349
|
indeterminate: allIndeterminate,
|
|
7052
7350
|
border,
|
|
@@ -7816,10 +8114,11 @@ var SLinearProgress = /* @__PURE__ */ forwardRef(
|
|
|
7816
8114
|
// src/lib/global-overlay.ts
|
|
7817
8115
|
var GLOBAL_OVERLAY_ATTR = "data-s-global-overlay";
|
|
7818
8116
|
var globalOverlayProps = { [GLOBAL_OVERLAY_ATTR]: "" };
|
|
8117
|
+
var ELEMENT_NODE = 1;
|
|
7819
8118
|
function isFromGlobalOverlay(event) {
|
|
7820
8119
|
const detail = event.detail;
|
|
7821
8120
|
const target = detail?.originalEvent?.target ?? event.target;
|
|
7822
|
-
const element = target
|
|
8121
|
+
const element = target == null ? null : target.nodeType === ELEMENT_NODE ? target : target.parentElement ?? null;
|
|
7823
8122
|
return !!element?.closest(`[${GLOBAL_OVERLAY_ATTR}]`);
|
|
7824
8123
|
}
|
|
7825
8124
|
var SLoadingContainer = /* @__PURE__ */ forwardRef(
|
|
@@ -14246,6 +14545,9 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
14246
14545
|
const [open, setOpen] = useState(false);
|
|
14247
14546
|
const [pendingOpen, setPendingOpen] = useState(false);
|
|
14248
14547
|
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
14548
|
+
const baseId = useId();
|
|
14549
|
+
const listboxId = `${baseId}-listbox`;
|
|
14550
|
+
const activeOptionId = `${baseId}-active-option`;
|
|
14249
14551
|
const [win, setWin] = useState({ start: 0, end: 0, top: 0, bottom: 0 });
|
|
14250
14552
|
const winRef = useRef(win);
|
|
14251
14553
|
winRef.current = win;
|
|
@@ -14331,13 +14633,15 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
14331
14633
|
setPendingOpen(false);
|
|
14332
14634
|
commitOpen(true);
|
|
14333
14635
|
}, [insideModal, pendingOpen, portalContainer]);
|
|
14636
|
+
const requestOpenRef = useRef(requestOpen);
|
|
14637
|
+
requestOpenRef.current = requestOpen;
|
|
14334
14638
|
useImperativeHandle(
|
|
14335
14639
|
ref,
|
|
14336
14640
|
() => ({
|
|
14337
14641
|
focus: () => triggerRef.current?.focus(),
|
|
14338
|
-
open: () =>
|
|
14642
|
+
open: () => requestOpenRef.current(true)
|
|
14339
14643
|
}),
|
|
14340
|
-
[
|
|
14644
|
+
[]
|
|
14341
14645
|
);
|
|
14342
14646
|
useFormField({
|
|
14343
14647
|
name,
|
|
@@ -14675,6 +14979,8 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
14675
14979
|
disabled: effectiveDisabled,
|
|
14676
14980
|
"aria-haspopup": "listbox",
|
|
14677
14981
|
"aria-expanded": open,
|
|
14982
|
+
"aria-controls": open ? listboxId : void 0,
|
|
14983
|
+
"aria-activedescendant": open && focusedIndex >= 0 ? activeOptionId : void 0,
|
|
14678
14984
|
onClick: () => requestOpen(!open),
|
|
14679
14985
|
onKeyDown: handleKeyDown,
|
|
14680
14986
|
className: "flex h-full w-full cursor-pointer items-center justify-between gap-[8px] bg-transparent px-[12px] text-left text-[12px] leading-[20px] outline-none disabled:cursor-not-allowed",
|
|
@@ -14801,7 +15107,9 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
14801
15107
|
onValueChange: setSearch,
|
|
14802
15108
|
onKeyDown: handleKeyDown,
|
|
14803
15109
|
placeholder: "\uAC80\uC0C9",
|
|
14804
|
-
clearable: true
|
|
15110
|
+
clearable: true,
|
|
15111
|
+
"aria-controls": listboxId,
|
|
15112
|
+
"aria-activedescendant": focusedIndex >= 0 ? activeOptionId : void 0
|
|
14805
15113
|
}
|
|
14806
15114
|
)
|
|
14807
15115
|
}
|
|
@@ -14809,6 +15117,8 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
14809
15117
|
hasItems ? /* @__PURE__ */ jsx(
|
|
14810
15118
|
ItemList,
|
|
14811
15119
|
{
|
|
15120
|
+
listboxId,
|
|
15121
|
+
activeOptionId,
|
|
14812
15122
|
items: visibleItems,
|
|
14813
15123
|
indexOffset: windowStart,
|
|
14814
15124
|
topSpacer: win.top,
|
|
@@ -14857,6 +15167,8 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
14857
15167
|
});
|
|
14858
15168
|
var SSelect2 = /* @__PURE__ */ withDisplayName(SSelectImpl, "SSelect");
|
|
14859
15169
|
function ItemList({
|
|
15170
|
+
listboxId,
|
|
15171
|
+
activeOptionId,
|
|
14860
15172
|
items,
|
|
14861
15173
|
indexOffset,
|
|
14862
15174
|
topSpacer,
|
|
@@ -14882,12 +15194,13 @@ function ItemList({
|
|
|
14882
15194
|
"disabled:cursor-not-allowed disabled:text-[color:var(--cmp-listBoxItem-content-disabled)]"
|
|
14883
15195
|
);
|
|
14884
15196
|
const activeClass = "hover:bg-[var(--cmp-listBoxItem-bg-hover)] hover:text-[color:var(--cmp-listBoxItem-content-hover)] focus-visible:bg-[var(--cmp-listBoxItem-bg-hover)] focus-visible:text-[color:var(--cmp-listBoxItem-content-hover)]";
|
|
14885
|
-
return /* @__PURE__ */ jsxs("div", { role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
15197
|
+
return /* @__PURE__ */ jsxs("div", { id: listboxId, role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
14886
15198
|
showSelectAll && /* @__PURE__ */ jsxs(
|
|
14887
15199
|
"button",
|
|
14888
15200
|
{
|
|
14889
15201
|
type: "button",
|
|
14890
15202
|
"data-select-all-row": true,
|
|
15203
|
+
id: focusedValue === "__select_all__" ? activeOptionId : void 0,
|
|
14891
15204
|
"data-select-focused": focusedValue === "__select_all__" ? "true" : void 0,
|
|
14892
15205
|
"data-select-active": focusedValue === "__select_all__" ? "true" : void 0,
|
|
14893
15206
|
className: cn(
|
|
@@ -14929,6 +15242,7 @@ function ItemList({
|
|
|
14929
15242
|
type: "button",
|
|
14930
15243
|
"data-select-row": true,
|
|
14931
15244
|
"data-index": idx,
|
|
15245
|
+
id: groupFocused ? activeOptionId : void 0,
|
|
14932
15246
|
role: "option",
|
|
14933
15247
|
"aria-selected": groupState === true,
|
|
14934
15248
|
disabled: groupDisabled,
|
|
@@ -15002,6 +15316,7 @@ function ItemList({
|
|
|
15002
15316
|
type: "button",
|
|
15003
15317
|
"data-select-row": true,
|
|
15004
15318
|
"data-index": idx,
|
|
15319
|
+
id: focusedValue === o.value ? activeOptionId : void 0,
|
|
15005
15320
|
disabled: o.disabled,
|
|
15006
15321
|
role: "option",
|
|
15007
15322
|
"aria-selected": isSelected,
|
|
@@ -24027,6 +24342,8 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
24027
24342
|
}, ref) {
|
|
24028
24343
|
const autoId = useId();
|
|
24029
24344
|
const resolvedName = name ?? autoId;
|
|
24345
|
+
const listboxId = `${autoId}-listbox`;
|
|
24346
|
+
const activeOptionId = `${autoId}-active-option`;
|
|
24030
24347
|
const [inputValue, setInputValue] = useState("");
|
|
24031
24348
|
const [focused, setFocused] = useState(false);
|
|
24032
24349
|
const [hovered, setHovered] = useState(false);
|
|
@@ -24249,6 +24566,11 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
24249
24566
|
ref: inputRef,
|
|
24250
24567
|
name: resolvedName,
|
|
24251
24568
|
size: 1,
|
|
24569
|
+
role: "combobox",
|
|
24570
|
+
"aria-expanded": showDropdown,
|
|
24571
|
+
"aria-controls": showDropdown ? listboxId : void 0,
|
|
24572
|
+
"aria-activedescendant": showDropdown && activeIndex >= 0 ? activeOptionId : void 0,
|
|
24573
|
+
"aria-autocomplete": "list",
|
|
24252
24574
|
className: cn(
|
|
24253
24575
|
"s-chip-input__input col-start-1 row-start-1 w-full border-0 bg-transparent p-0 font-normal text-(--cmp-chip-content-focus) outline-none placeholder:text-(--cmp-chipInput-text-placeholder) disabled:cursor-not-allowed",
|
|
24254
24576
|
AUTOFILL_RESET_CLASS,
|
|
@@ -24362,6 +24684,7 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
24362
24684
|
children: /* @__PURE__ */ jsxs(
|
|
24363
24685
|
"div",
|
|
24364
24686
|
{
|
|
24687
|
+
id: listboxId,
|
|
24365
24688
|
role: "listbox",
|
|
24366
24689
|
className: "s-chip-input__suggestions flex w-full flex-col outline-none",
|
|
24367
24690
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -24373,6 +24696,7 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
24373
24696
|
return /* @__PURE__ */ jsx(
|
|
24374
24697
|
"div",
|
|
24375
24698
|
{
|
|
24699
|
+
id: active ? activeOptionId : void 0,
|
|
24376
24700
|
role: "option",
|
|
24377
24701
|
"aria-selected": selected || active,
|
|
24378
24702
|
className: "rounded-full",
|
|
@@ -24391,6 +24715,7 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
24391
24715
|
return /* @__PURE__ */ jsxs(
|
|
24392
24716
|
"div",
|
|
24393
24717
|
{
|
|
24718
|
+
id: active ? activeOptionId : void 0,
|
|
24394
24719
|
role: "option",
|
|
24395
24720
|
"aria-selected": selected || active,
|
|
24396
24721
|
className: cn(
|