@cjlapao/ui-kit 0.2.32 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeBlock-Dm0yAxf-.d.cts → CodeBlock-QDW3hqU0.d.cts} +1 -1
- package/dist/{CodeBlock-Dm0yAxf-.d.ts → CodeBlock-QDW3hqU0.d.ts} +1 -1
- package/dist/index.cjs +546 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +675 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +122 -6
- package/dist/index.d.ts +122 -6
- package/dist/index.js +529 -107
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +102 -3
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +102 -3
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8036,6 +8036,13 @@ function getLocalizedParseNames(locale, catalog) {
|
|
|
8036
8036
|
// ../common/i18n/builtIn/de.ts
|
|
8037
8037
|
var DE_KIT_CATALOG = {
|
|
8038
8038
|
kit: {
|
|
8039
|
+
codeBlock: {
|
|
8040
|
+
code: "Code",
|
|
8041
|
+
edit: "Code bearbeiten",
|
|
8042
|
+
copy: "Code kopieren",
|
|
8043
|
+
copied: "Kopiert",
|
|
8044
|
+
copyFailed: "Kopieren fehlgeschlagen. Code ausw\xE4hlen und manuell kopieren."
|
|
8045
|
+
},
|
|
8039
8046
|
knowledge: {
|
|
8040
8047
|
"library": "Erinnerungsbibliothek",
|
|
8041
8048
|
"map": "Wissenskarte",
|
|
@@ -8308,6 +8315,20 @@ var DE_KIT_CATALOG = {
|
|
|
8308
8315
|
progressspinner: {
|
|
8309
8316
|
loading: "Wird geladen"
|
|
8310
8317
|
},
|
|
8318
|
+
filterbar: {
|
|
8319
|
+
filters: "Filter",
|
|
8320
|
+
search: "Suchen",
|
|
8321
|
+
empty: "Keine Filter angewendet",
|
|
8322
|
+
add: "Filter hinzuf\xFCgen",
|
|
8323
|
+
filterBy: "Filtern nach",
|
|
8324
|
+
back: "Zur\xFCck",
|
|
8325
|
+
clear: "Leeren",
|
|
8326
|
+
done: "Fertig",
|
|
8327
|
+
clearAll: "Alle l\xF6schen",
|
|
8328
|
+
items: "Eintr\xE4ge",
|
|
8329
|
+
summary: "{filtered} von {total} {items}",
|
|
8330
|
+
remove: "Filter {label} entfernen"
|
|
8331
|
+
},
|
|
8311
8332
|
searchbar: {
|
|
8312
8333
|
clearAria: "Suche l\xF6schen",
|
|
8313
8334
|
placeholder: "Suchen..."
|
|
@@ -8811,6 +8832,20 @@ var EN_KIT_CATALOG = {
|
|
|
8811
8832
|
progressspinner: {
|
|
8812
8833
|
loading: "Loading"
|
|
8813
8834
|
},
|
|
8835
|
+
filterbar: {
|
|
8836
|
+
filters: "Filters",
|
|
8837
|
+
search: "Search",
|
|
8838
|
+
empty: "No filters applied",
|
|
8839
|
+
add: "Add filter",
|
|
8840
|
+
filterBy: "Filter by",
|
|
8841
|
+
back: "Back",
|
|
8842
|
+
clear: "Clear",
|
|
8843
|
+
done: "Done",
|
|
8844
|
+
clearAll: "Clear all",
|
|
8845
|
+
items: "items",
|
|
8846
|
+
summary: "{filtered} of {total} {items}",
|
|
8847
|
+
remove: "Remove {label} filter"
|
|
8848
|
+
},
|
|
8814
8849
|
searchbar: {
|
|
8815
8850
|
clearAria: "Clear search",
|
|
8816
8851
|
placeholder: "Search..."
|
|
@@ -9035,6 +9070,13 @@ var EN_KIT_CATALOG = {
|
|
|
9035
9070
|
// ../common/i18n/builtIn/es.ts
|
|
9036
9071
|
var ES_KIT_CATALOG = {
|
|
9037
9072
|
kit: {
|
|
9073
|
+
codeBlock: {
|
|
9074
|
+
code: "C\xF3digo",
|
|
9075
|
+
edit: "Editar c\xF3digo",
|
|
9076
|
+
copy: "Copiar c\xF3digo",
|
|
9077
|
+
copied: "Copiado",
|
|
9078
|
+
copyFailed: "No se pudo copiar. Selecciona y copia el c\xF3digo manualmente."
|
|
9079
|
+
},
|
|
9038
9080
|
knowledge: {
|
|
9039
9081
|
"library": "Biblioteca de memorias",
|
|
9040
9082
|
"map": "Mapa de conocimiento",
|
|
@@ -9307,6 +9349,20 @@ var ES_KIT_CATALOG = {
|
|
|
9307
9349
|
progressspinner: {
|
|
9308
9350
|
loading: "Cargando"
|
|
9309
9351
|
},
|
|
9352
|
+
filterbar: {
|
|
9353
|
+
filters: "Filtros",
|
|
9354
|
+
search: "Buscar",
|
|
9355
|
+
empty: "Sin filtros aplicados",
|
|
9356
|
+
add: "A\xF1adir filtro",
|
|
9357
|
+
filterBy: "Filtrar por",
|
|
9358
|
+
back: "Volver",
|
|
9359
|
+
clear: "Limpiar",
|
|
9360
|
+
done: "Listo",
|
|
9361
|
+
clearAll: "Borrar todos",
|
|
9362
|
+
items: "elementos",
|
|
9363
|
+
summary: "{filtered} de {total} {items}",
|
|
9364
|
+
remove: "Eliminar filtro {label}"
|
|
9365
|
+
},
|
|
9310
9366
|
searchbar: {
|
|
9311
9367
|
clearAria: "Borrar b\xFAsqueda",
|
|
9312
9368
|
placeholder: "Buscar..."
|
|
@@ -9531,6 +9587,13 @@ var ES_KIT_CATALOG = {
|
|
|
9531
9587
|
// ../common/i18n/builtIn/fr.ts
|
|
9532
9588
|
var FR_KIT_CATALOG = {
|
|
9533
9589
|
kit: {
|
|
9590
|
+
codeBlock: {
|
|
9591
|
+
code: "Code",
|
|
9592
|
+
edit: "Modifier le code",
|
|
9593
|
+
copy: "Copier le code",
|
|
9594
|
+
copied: "Copi\xE9",
|
|
9595
|
+
copyFailed: "Copie impossible. S\xE9lectionnez et copiez le code manuellement."
|
|
9596
|
+
},
|
|
9534
9597
|
knowledge: {
|
|
9535
9598
|
"library": "Biblioth\xE8que de m\xE9moires",
|
|
9536
9599
|
"map": "Carte des connaissances",
|
|
@@ -9803,6 +9866,20 @@ var FR_KIT_CATALOG = {
|
|
|
9803
9866
|
progressspinner: {
|
|
9804
9867
|
loading: "Chargement"
|
|
9805
9868
|
},
|
|
9869
|
+
filterbar: {
|
|
9870
|
+
filters: "Filtres",
|
|
9871
|
+
search: "Rechercher",
|
|
9872
|
+
empty: "Aucun filtre appliqu\xE9",
|
|
9873
|
+
add: "Ajouter un filtre",
|
|
9874
|
+
filterBy: "Filtrer par",
|
|
9875
|
+
back: "Retour",
|
|
9876
|
+
clear: "Effacer",
|
|
9877
|
+
done: "Termin\xE9",
|
|
9878
|
+
clearAll: "Tout effacer",
|
|
9879
|
+
items: "\xE9l\xE9ments",
|
|
9880
|
+
summary: "{filtered} sur {total} {items}",
|
|
9881
|
+
remove: "Supprimer le filtre {label}"
|
|
9882
|
+
},
|
|
9806
9883
|
searchbar: {
|
|
9807
9884
|
clearAria: "Effacer la recherche",
|
|
9808
9885
|
placeholder: "Rechercher..."
|
|
@@ -10027,6 +10104,13 @@ var FR_KIT_CATALOG = {
|
|
|
10027
10104
|
// ../common/i18n/builtIn/pt.ts
|
|
10028
10105
|
var PT_KIT_CATALOG = {
|
|
10029
10106
|
kit: {
|
|
10107
|
+
codeBlock: {
|
|
10108
|
+
code: "C\xF3digo",
|
|
10109
|
+
edit: "Editar c\xF3digo",
|
|
10110
|
+
copy: "Copiar c\xF3digo",
|
|
10111
|
+
copied: "Copiado",
|
|
10112
|
+
copyFailed: "N\xE3o foi poss\xEDvel copiar. Selecione e copie o c\xF3digo manualmente."
|
|
10113
|
+
},
|
|
10030
10114
|
knowledge: {
|
|
10031
10115
|
"library": "Biblioteca de mem\xF3rias",
|
|
10032
10116
|
"map": "Mapa de conhecimento",
|
|
@@ -10299,6 +10383,20 @@ var PT_KIT_CATALOG = {
|
|
|
10299
10383
|
progressspinner: {
|
|
10300
10384
|
loading: "Carregando"
|
|
10301
10385
|
},
|
|
10386
|
+
filterbar: {
|
|
10387
|
+
filters: "Filtros",
|
|
10388
|
+
search: "Pesquisar",
|
|
10389
|
+
empty: "Nenhum filtro aplicado",
|
|
10390
|
+
add: "Adicionar filtro",
|
|
10391
|
+
filterBy: "Filtrar por",
|
|
10392
|
+
back: "Voltar",
|
|
10393
|
+
clear: "Limpar",
|
|
10394
|
+
done: "Conclu\xEDdo",
|
|
10395
|
+
clearAll: "Limpar todos",
|
|
10396
|
+
items: "itens",
|
|
10397
|
+
summary: "{filtered} de {total} {items}",
|
|
10398
|
+
remove: "Remover filtro {label}"
|
|
10399
|
+
},
|
|
10302
10400
|
searchbar: {
|
|
10303
10401
|
clearAria: "Limpar busca",
|
|
10304
10402
|
placeholder: "Buscar..."
|
|
@@ -11640,7 +11738,7 @@ var Panel = React10.forwardRef(function Panel2({
|
|
|
11640
11738
|
if (specularHighlight === false) return "none";
|
|
11641
11739
|
return "classic";
|
|
11642
11740
|
})();
|
|
11643
|
-
const effectiveHoverColor = hoverColor ?? (
|
|
11741
|
+
const effectiveHoverColor = hoverColor ?? (resolvedTone !== "none" && resolvedTone !== "neutral" ? resolvedTone : void 0);
|
|
11644
11742
|
const hoverColorName = effectiveHoverColor ? effectiveHoverColor : void 0;
|
|
11645
11743
|
const borderPalette = borderColor ? getPanelToneStyles(borderColor) : void 0;
|
|
11646
11744
|
const effectiveBorderClass = borderPalette?.border;
|
|
@@ -15225,7 +15323,7 @@ var ExpandableButton = forwardRef152(
|
|
|
15225
15323
|
fadeDuration,
|
|
15226
15324
|
labelGap,
|
|
15227
15325
|
labelSlide,
|
|
15228
|
-
elevate =
|
|
15326
|
+
elevate = false,
|
|
15229
15327
|
iconMotion = "pop-tilt",
|
|
15230
15328
|
squish = true,
|
|
15231
15329
|
labelPlacement = "after",
|
|
@@ -18234,6 +18332,7 @@ var Combobox = React30.forwardRef(
|
|
|
18234
18332
|
leadingIcon,
|
|
18235
18333
|
visibleRows = 6,
|
|
18236
18334
|
panelVariant = "auto",
|
|
18335
|
+
panelTone = "auto",
|
|
18237
18336
|
panelCorner = "auto",
|
|
18238
18337
|
className,
|
|
18239
18338
|
listClassName,
|
|
@@ -18379,7 +18478,7 @@ var Combobox = React30.forwardRef(
|
|
|
18379
18478
|
Panel_default,
|
|
18380
18479
|
{
|
|
18381
18480
|
variant: resolvedPanelVariant,
|
|
18382
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
18481
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
18383
18482
|
corner: panelCorner,
|
|
18384
18483
|
padding: "none",
|
|
18385
18484
|
scrollable: false,
|
|
@@ -18616,6 +18715,7 @@ var Picker = ({
|
|
|
18616
18715
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
18617
18716
|
validationStatus = "none",
|
|
18618
18717
|
panelVariant = "auto",
|
|
18718
|
+
panelTone = "auto",
|
|
18619
18719
|
panelCorner = "auto",
|
|
18620
18720
|
disabled = false,
|
|
18621
18721
|
multi = false,
|
|
@@ -18846,7 +18946,7 @@ var Picker = ({
|
|
|
18846
18946
|
Panel_default,
|
|
18847
18947
|
{
|
|
18848
18948
|
variant: resolvedPanelVariant,
|
|
18849
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
18949
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
18850
18950
|
corner: panelCorner,
|
|
18851
18951
|
padding: "none",
|
|
18852
18952
|
scrollable: false,
|
|
@@ -18948,14 +19048,19 @@ var Picker = ({
|
|
|
18948
19048
|
}
|
|
18949
19049
|
)
|
|
18950
19050
|
] }),
|
|
18951
|
-
multi &&
|
|
19051
|
+
multi && /* @__PURE__ */ jsxs86(
|
|
18952
19052
|
"button",
|
|
18953
19053
|
{
|
|
18954
19054
|
type: "button",
|
|
19055
|
+
disabled: effectiveSelectedIds.length === 0,
|
|
18955
19056
|
onMouseDown: (e) => e.preventDefault(),
|
|
18956
19057
|
onClick: handleClearMulti,
|
|
18957
19058
|
className: classNames38(
|
|
18958
|
-
|
|
19059
|
+
// Always rendered: mounting it on the first pick pushed the
|
|
19060
|
+
// list down and resized the popup (flicker). Hidden, not
|
|
19061
|
+
// removed, while nothing is selected.
|
|
19062
|
+
"flex w-full select-none items-center justify-between border-b border-black/5 px-4 py-1.5 text-xs dark:border-white/10",
|
|
19063
|
+
effectiveSelectedIds.length > 0 ? "cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800/60" : "invisible",
|
|
18959
19064
|
popupText.muted
|
|
18960
19065
|
),
|
|
18961
19066
|
children: [
|
|
@@ -19542,6 +19647,7 @@ var TagPicker = ({
|
|
|
19542
19647
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
19543
19648
|
validationStatus = "none",
|
|
19544
19649
|
panelVariant = "auto",
|
|
19650
|
+
panelTone = "auto",
|
|
19545
19651
|
panelCorner = "auto",
|
|
19546
19652
|
tagLimit = 3,
|
|
19547
19653
|
highlightNew = true,
|
|
@@ -19725,7 +19831,7 @@ var TagPicker = ({
|
|
|
19725
19831
|
const idx = filtered.findIndex((item) => selectedSet.has(item.id));
|
|
19726
19832
|
setFocusedIndex(idx >= 0 ? idx : multi || filtered.length === 0 ? -1 : 0);
|
|
19727
19833
|
}, [open]);
|
|
19728
|
-
const
|
|
19834
|
+
const normalize2 = useCallback10(
|
|
19729
19835
|
(v) => normalizeValue ? normalizeValue(v) : v,
|
|
19730
19836
|
[normalizeValue]
|
|
19731
19837
|
);
|
|
@@ -19735,7 +19841,7 @@ var TagPicker = ({
|
|
|
19735
19841
|
filtered.findIndex((candidate) => candidate.id === item.id)
|
|
19736
19842
|
);
|
|
19737
19843
|
setCursorByKeyboard(fromKeyboard);
|
|
19738
|
-
const id =
|
|
19844
|
+
const id = normalize2(item.id);
|
|
19739
19845
|
if (!multi) {
|
|
19740
19846
|
onChange([id]);
|
|
19741
19847
|
setOpen(false);
|
|
@@ -19748,14 +19854,14 @@ var TagPicker = ({
|
|
|
19748
19854
|
onChange([...value, id]);
|
|
19749
19855
|
}
|
|
19750
19856
|
},
|
|
19751
|
-
[multi,
|
|
19857
|
+
[multi, normalize2, onChange, selectedSet, value, filtered]
|
|
19752
19858
|
);
|
|
19753
19859
|
const handleRemove = useCallback10(
|
|
19754
19860
|
(v) => onChange(value.filter((x) => x !== v)),
|
|
19755
19861
|
[onChange, value]
|
|
19756
19862
|
);
|
|
19757
19863
|
const handleCreate = useCallback10(() => {
|
|
19758
|
-
const label =
|
|
19864
|
+
const label = normalize2(query.trim());
|
|
19759
19865
|
if (!label) return;
|
|
19760
19866
|
if (onCreateItem) {
|
|
19761
19867
|
onCreateItem(label);
|
|
@@ -19766,7 +19872,7 @@ var TagPicker = ({
|
|
|
19766
19872
|
}
|
|
19767
19873
|
if (!multi) setOpen(false);
|
|
19768
19874
|
setQuery("");
|
|
19769
|
-
}, [query,
|
|
19875
|
+
}, [query, normalize2, onCreateItem, multi, onChange, value]);
|
|
19770
19876
|
const handleKeyDown = (e) => {
|
|
19771
19877
|
if (e.key === "ArrowDown") {
|
|
19772
19878
|
e.preventDefault();
|
|
@@ -19802,7 +19908,7 @@ var TagPicker = ({
|
|
|
19802
19908
|
Panel_default,
|
|
19803
19909
|
{
|
|
19804
19910
|
variant: resolvedPanelVariant,
|
|
19805
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
19911
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
19806
19912
|
corner: panelCorner,
|
|
19807
19913
|
padding: "none",
|
|
19808
19914
|
scrollable: false,
|
|
@@ -21520,8 +21626,8 @@ function StackCarousel({
|
|
|
21520
21626
|
setExpanded(true);
|
|
21521
21627
|
}, Math.max(0, Number.isFinite(hoverExpandDelay) ? hoverExpandDelay : 2e3));
|
|
21522
21628
|
};
|
|
21523
|
-
const
|
|
21524
|
-
const index =
|
|
21629
|
+
const normalize2 = useCallback12((value) => loop ? wrap(value, items.length) : Math.max(0, Math.min(items.length - 1, Math.trunc(value))), [loop, items.length]);
|
|
21630
|
+
const index = normalize2(Number.isFinite(activeIndex ?? internalIndex) ? activeIndex ?? internalIndex : 0);
|
|
21525
21631
|
const layers = Math.min(loop ? items.length : items.length - index, Math.max(1, Math.min(3, Math.trunc(visibleCount) || 1)));
|
|
21526
21632
|
const offset = Math.max(0, Number.isFinite(stackOffset) ? stackOffset : 12);
|
|
21527
21633
|
const rootRef = useRef18(null);
|
|
@@ -21539,14 +21645,14 @@ function StackCarousel({
|
|
|
21539
21645
|
}, [isExpanded]);
|
|
21540
21646
|
const navigate = useCallback12((next, focus = false) => {
|
|
21541
21647
|
if (items.length < 2) return;
|
|
21542
|
-
const normalized =
|
|
21648
|
+
const normalized = normalize2(next);
|
|
21543
21649
|
if (normalized === index) return;
|
|
21544
21650
|
if (focus || measureRef.current?.contains(document.activeElement)) {
|
|
21545
21651
|
rootRef.current?.focus({ preventScroll: true });
|
|
21546
21652
|
}
|
|
21547
21653
|
if (activeIndex === void 0) setInternalIndex(normalized);
|
|
21548
21654
|
onActiveIndexChange?.(normalized);
|
|
21549
|
-
}, [items.length, index, activeIndex, onActiveIndexChange,
|
|
21655
|
+
}, [items.length, index, activeIndex, onActiveIndexChange, normalize2]);
|
|
21550
21656
|
useLayoutEffect8(() => {
|
|
21551
21657
|
const old = previousIndex.current;
|
|
21552
21658
|
previousIndex.current = index;
|
|
@@ -21609,7 +21715,7 @@ function StackCarousel({
|
|
|
21609
21715
|
root.addEventListener("wheel", handleWheel, { passive: false });
|
|
21610
21716
|
return () => root.removeEventListener("wheel", handleWheel);
|
|
21611
21717
|
}, [wheel, isExpanded, items.length, index, navigate, canScrollInside]);
|
|
21612
|
-
const visible = isExpanded ? items.map((_, i) => i) : Array.from({ length: layers }, (_, rank) =>
|
|
21718
|
+
const visible = isExpanded ? items.map((_, i) => i) : Array.from({ length: layers }, (_, rank) => normalize2(index + rank));
|
|
21613
21719
|
const rendered = [...visible];
|
|
21614
21720
|
const transitionFrom = previousIndex.current !== index ? previousIndex.current : outgoing;
|
|
21615
21721
|
if (!isExpanded && transitionFrom !== null && transitionFrom < items.length && !rendered.includes(transitionFrom)) rendered.push(transitionFrom);
|
|
@@ -40175,7 +40281,7 @@ var HelpButton = ({
|
|
|
40175
40281
|
window.removeEventListener("resize", recompute);
|
|
40176
40282
|
};
|
|
40177
40283
|
}, [open, recompute]);
|
|
40178
|
-
const palette = getPanelToneStyles(
|
|
40284
|
+
const palette = getPanelToneStyles(tone);
|
|
40179
40285
|
const surfaceText = getSurfaceTextTokens(variant);
|
|
40180
40286
|
const isMarkdown = typeof content === "string";
|
|
40181
40287
|
return /* @__PURE__ */ jsxs140("span", { className: classNames69("inline-flex items-center", className), children: [
|
|
@@ -42280,7 +42386,7 @@ var Popover = ({
|
|
|
42280
42386
|
"aria-hidden": "true",
|
|
42281
42387
|
className: classNames73(
|
|
42282
42388
|
"absolute block h-4 w-4 rotate-45",
|
|
42283
|
-
ARROW_SIDE_BORDERS[position.placement.side],
|
|
42389
|
+
variant !== "none" && ARROW_SIDE_BORDERS[position.placement.side],
|
|
42284
42390
|
chrome.border,
|
|
42285
42391
|
chrome.fill,
|
|
42286
42392
|
chrome.backdrop
|
|
@@ -42306,7 +42412,8 @@ var Popover = ({
|
|
|
42306
42412
|
"aria-hidden": "true",
|
|
42307
42413
|
"data-popover-bubble": true,
|
|
42308
42414
|
className: classNames73(
|
|
42309
|
-
"pointer-events-none absolute z-20 block rounded-full
|
|
42415
|
+
"pointer-events-none absolute z-20 block rounded-full",
|
|
42416
|
+
variant !== "none" && "border",
|
|
42310
42417
|
chrome.border,
|
|
42311
42418
|
chrome.fill,
|
|
42312
42419
|
chrome.backdrop
|
|
@@ -45781,6 +45888,7 @@ var SideMenuCtaCard = ({
|
|
|
45781
45888
|
);
|
|
45782
45889
|
};
|
|
45783
45890
|
var SideMenuDetailPanel = ({
|
|
45891
|
+
variant,
|
|
45784
45892
|
items,
|
|
45785
45893
|
tone,
|
|
45786
45894
|
menuTone,
|
|
@@ -45819,11 +45927,11 @@ var SideMenuDetailPanel = ({
|
|
|
45819
45927
|
},
|
|
45820
45928
|
item.slug
|
|
45821
45929
|
));
|
|
45822
|
-
if (glass) {
|
|
45930
|
+
if (glass || variant) {
|
|
45823
45931
|
return /* @__PURE__ */ jsx266(
|
|
45824
45932
|
Panel_default,
|
|
45825
45933
|
{
|
|
45826
|
-
variant: "glass",
|
|
45934
|
+
variant: variant ?? "glass",
|
|
45827
45935
|
tone,
|
|
45828
45936
|
corner: "rounded-sm",
|
|
45829
45937
|
padding: "none",
|
|
@@ -45866,6 +45974,7 @@ var SideMenu = ({
|
|
|
45866
45974
|
ctas,
|
|
45867
45975
|
footerDetails,
|
|
45868
45976
|
footerDetailsTone,
|
|
45977
|
+
footerDetailsVariant,
|
|
45869
45978
|
noise = false,
|
|
45870
45979
|
noiseScale,
|
|
45871
45980
|
loading = false,
|
|
@@ -46442,6 +46551,7 @@ var SideMenu = ({
|
|
|
46442
46551
|
!contentCollapsed2 && footerDetails && footerDetails.length > 0 && /* @__PURE__ */ jsx266("div", { className: "shrink-0 px-3 pb-1", children: /* @__PURE__ */ jsx266(
|
|
46443
46552
|
SideMenuDetailPanel,
|
|
46444
46553
|
{
|
|
46554
|
+
variant: footerDetailsVariant,
|
|
46445
46555
|
items: footerDetails,
|
|
46446
46556
|
tone: footerDetailsTone ?? "none",
|
|
46447
46557
|
menuTone: color2,
|
|
@@ -51509,7 +51619,7 @@ var SplitView = ({
|
|
|
51509
51619
|
const border = headerProps.border ?? true;
|
|
51510
51620
|
const detailsVariant = headerDetails?.variant ?? headerDetails?.variants ?? "subtle";
|
|
51511
51621
|
const detailsDecoration = headerDetails?.decoration ?? headerDetails?.decorations ?? "none";
|
|
51512
|
-
const detailsTone = headerDetails?.tone ?? "
|
|
51622
|
+
const detailsTone = headerDetails?.tone ?? "none";
|
|
51513
51623
|
const hasCustomHeaderBody = headerDetails?.headerBody !== void 0 && headerDetails?.headerBody !== null;
|
|
51514
51624
|
const hasHeaderDetailsContent = Boolean(
|
|
51515
51625
|
hasCustomHeaderBody || headerDetails?.title || headerDetails?.subtitle || headerDetails?.description || headerDetails?.tags
|
|
@@ -52460,6 +52570,7 @@ var VariablePicker = ({
|
|
|
52460
52570
|
tone = "blue",
|
|
52461
52571
|
size = "md",
|
|
52462
52572
|
variant = "elevated",
|
|
52573
|
+
panelTone = "auto",
|
|
52463
52574
|
corner = "auto",
|
|
52464
52575
|
initialSearch = "",
|
|
52465
52576
|
title,
|
|
@@ -52535,7 +52646,7 @@ var VariablePicker = ({
|
|
|
52535
52646
|
Panel_default,
|
|
52536
52647
|
{
|
|
52537
52648
|
variant,
|
|
52538
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
52649
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
52539
52650
|
corner,
|
|
52540
52651
|
padding: "none",
|
|
52541
52652
|
scrollable: false,
|
|
@@ -52633,6 +52744,7 @@ var SmartInput = ({
|
|
|
52633
52744
|
gradientTo,
|
|
52634
52745
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
52635
52746
|
panelVariant = "auto",
|
|
52747
|
+
panelTone = "auto",
|
|
52636
52748
|
panelCorner = "auto",
|
|
52637
52749
|
defaultViewMode = "token",
|
|
52638
52750
|
autocomplete = true,
|
|
@@ -52963,6 +53075,7 @@ var SmartInput = ({
|
|
|
52963
53075
|
tone,
|
|
52964
53076
|
size,
|
|
52965
53077
|
variant: resolvedPanelVariant,
|
|
53078
|
+
panelTone,
|
|
52966
53079
|
corner: panelCorner,
|
|
52967
53080
|
initialSearch: pickerFilter,
|
|
52968
53081
|
onSelect: handleSelect,
|
|
@@ -77001,6 +77114,7 @@ function MenuSurface({ state, children, root = false }) {
|
|
|
77001
77114
|
transparency: props.transparency,
|
|
77002
77115
|
vibrancy: props.vibrancy,
|
|
77003
77116
|
specularMode: props.specularMode,
|
|
77117
|
+
style: root ? props.style : void 0,
|
|
77004
77118
|
className: classNames144(
|
|
77005
77119
|
root ? props.className : void 0,
|
|
77006
77120
|
(!root || props.popup || props.trigger || props.anchorRef) && "backdrop-blur-xl"
|
|
@@ -77502,7 +77616,7 @@ function IdentityPicker({
|
|
|
77502
77616
|
});
|
|
77503
77617
|
const previewClass = classNames146("flex shrink-0 items-center justify-center overflow-hidden border border-neutral-200 dark:border-neutral-600", density.preview, getSurfaceCornerClass(surface.corner ?? "rounded-md"), tokens.bg);
|
|
77504
77618
|
const preview = selected?.type === "image" ? /* @__PURE__ */ jsx349(ImagePreview, { file: selected.file, src: selected.src, alt: labels.preview, className: "h-full w-full object-contain" }) : /* @__PURE__ */ jsx349("span", { style: { fontFamily }, "aria-hidden": "true", children: selected?.type === "emoji" ? selected.emoji : selected?.type === "monogram" ? selected.text : automatic });
|
|
77505
|
-
return /* @__PURE__ */ jsxs220(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone, padding: surface.padding ?? (compact2 ? "xs" : "sm"), className, "aria-busy": loading || void 0, children: [
|
|
77619
|
+
return /* @__PURE__ */ jsxs220(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone: surface.tone ?? "none", padding: surface.padding ?? (compact2 ? "xs" : "sm"), className, "aria-busy": loading || void 0, children: [
|
|
77506
77620
|
/* @__PURE__ */ jsxs220("div", { className: classNames146("flex items-start", density.headerGap), children: [
|
|
77507
77621
|
/* @__PURE__ */ jsx349("div", { className: previewClass, role: selected?.type === "image" ? void 0 : "img", "aria-label": selected?.type === "image" ? void 0 : `${labels.preview}: ${selected?.type === "emoji" ? selected.emoji : selected?.type === "monogram" ? selected.text : automatic}`, children: preview }),
|
|
77508
77622
|
/* @__PURE__ */ jsxs220("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -77576,7 +77690,7 @@ function IdentityPicker({
|
|
|
77576
77690
|
embedded: true,
|
|
77577
77691
|
compact: compact2,
|
|
77578
77692
|
variant: surface.variant,
|
|
77579
|
-
tone,
|
|
77693
|
+
tone: surface.tone ?? "none",
|
|
77580
77694
|
corner: surface.corner,
|
|
77581
77695
|
padding: "none",
|
|
77582
77696
|
size,
|
|
@@ -78594,19 +78708,326 @@ function CodeBlock({
|
|
|
78594
78708
|
] }) });
|
|
78595
78709
|
}
|
|
78596
78710
|
|
|
78711
|
+
// src/components/FilterBar.tsx
|
|
78712
|
+
import { useEffect as useEffect88, useId as useId53, useLayoutEffect as useLayoutEffect36, useRef as useRef90, useState as useState109 } from "react";
|
|
78713
|
+
import classNames149 from "classnames";
|
|
78714
|
+
import { Fragment as Fragment62, jsx as jsx359, jsxs as jsxs230 } from "react/jsx-runtime";
|
|
78715
|
+
function normalize(filters, value) {
|
|
78716
|
+
return Object.assign(/* @__PURE__ */ Object.create(null), Object.fromEntries(filters.flatMap((filter) => {
|
|
78717
|
+
const selected = new Set(Object.prototype.hasOwnProperty.call(value, filter.id) ? value[filter.id] : []);
|
|
78718
|
+
const values = filter.options.filter((option) => selected.has(option.value)).map((option) => option.value);
|
|
78719
|
+
return values.length ? [[filter.id, values]] : [];
|
|
78720
|
+
})));
|
|
78721
|
+
}
|
|
78722
|
+
function FilterBar({
|
|
78723
|
+
searchProps,
|
|
78724
|
+
filters,
|
|
78725
|
+
value,
|
|
78726
|
+
defaultValue = {},
|
|
78727
|
+
onChange,
|
|
78728
|
+
filteredCount,
|
|
78729
|
+
totalCount,
|
|
78730
|
+
itemLabel,
|
|
78731
|
+
size = "md",
|
|
78732
|
+
color: color2 = "blue",
|
|
78733
|
+
showSearch = true,
|
|
78734
|
+
showFilterLabel = true,
|
|
78735
|
+
showEmptyState = true,
|
|
78736
|
+
showClearAll = true,
|
|
78737
|
+
showResultCount = true,
|
|
78738
|
+
showMenuCounts = true,
|
|
78739
|
+
variant = "outlined",
|
|
78740
|
+
tone = "neutral",
|
|
78741
|
+
corner = "rounded-sm",
|
|
78742
|
+
padding = "xs",
|
|
78743
|
+
transparency,
|
|
78744
|
+
glassOpacity = "frosted",
|
|
78745
|
+
vibrancy = "medium",
|
|
78746
|
+
buttonVariant = "outline",
|
|
78747
|
+
secondaryButtonVariant = "ghost",
|
|
78748
|
+
applyButtonVariant = "solid",
|
|
78749
|
+
buttonTone = color2,
|
|
78750
|
+
buttonSize = size,
|
|
78751
|
+
buttonCorner,
|
|
78752
|
+
buttonWeight = "normal",
|
|
78753
|
+
buttonDashed = true,
|
|
78754
|
+
menuVariant = "outlined",
|
|
78755
|
+
menuTone = "none",
|
|
78756
|
+
menuCorner,
|
|
78757
|
+
menuPadding: menuPadding2,
|
|
78758
|
+
chipVariant = "soft",
|
|
78759
|
+
chipTone = color2,
|
|
78760
|
+
spring = "snappy",
|
|
78761
|
+
disabled = false,
|
|
78762
|
+
className,
|
|
78763
|
+
"aria-label": ariaLabel
|
|
78764
|
+
}) {
|
|
78765
|
+
const t = useKitT();
|
|
78766
|
+
const buttonStyle = buttonCorner === void 0 ? void 0 : { borderRadius: getSurfaceCornerRem(buttonCorner) };
|
|
78767
|
+
const actionStyle = { color: buttonTone, size: buttonSize, weight: buttonWeight, style: buttonStyle };
|
|
78768
|
+
const surfaceClasses = getSurfaceVariantClasses(variant, tone, {
|
|
78769
|
+
transparency,
|
|
78770
|
+
liquidExtras: classNames149(getGlassVibrancyClass(vibrancy), getSurfaceGlassFillClass(tone, glassOpacity))
|
|
78771
|
+
});
|
|
78772
|
+
const [internal, setInternal] = useState109(defaultValue);
|
|
78773
|
+
const applied = normalize(filters, value ?? internal);
|
|
78774
|
+
const [open, setOpen] = useState109(false);
|
|
78775
|
+
const [category, setCategory] = useState109(null);
|
|
78776
|
+
const [draft, setDraft] = useState109([]);
|
|
78777
|
+
const anchor = useRef90(null);
|
|
78778
|
+
const searchRegion = useRef90(null);
|
|
78779
|
+
const searchId = useId53();
|
|
78780
|
+
const [expanded, setExpanded] = useState109(Boolean(searchProps.initialValue));
|
|
78781
|
+
const searchDisabled = disabled || searchProps.disabled;
|
|
78782
|
+
const active = filters.find((filter) => filter.id === category);
|
|
78783
|
+
const motion = CONTROL_SPRING_TOKENS[spring];
|
|
78784
|
+
const style = { "--fb-duration": `${motion.duration}ms`, "--fb-easing": motion.easing };
|
|
78785
|
+
const commit = (next) => {
|
|
78786
|
+
const normalized = normalize(filters, next);
|
|
78787
|
+
if (value === void 0) setInternal(normalized);
|
|
78788
|
+
onChange?.(normalized);
|
|
78789
|
+
};
|
|
78790
|
+
const close = (restore = false) => {
|
|
78791
|
+
setOpen(false);
|
|
78792
|
+
setCategory(null);
|
|
78793
|
+
setDraft([]);
|
|
78794
|
+
if (restore) anchor.current?.focus();
|
|
78795
|
+
};
|
|
78796
|
+
const edit = (filter) => {
|
|
78797
|
+
setDraft([...applied[filter.id] ?? []]);
|
|
78798
|
+
setCategory(filter.id);
|
|
78799
|
+
setOpen(true);
|
|
78800
|
+
};
|
|
78801
|
+
const previouslyExpanded = useRef90(expanded);
|
|
78802
|
+
useLayoutEffect36(() => {
|
|
78803
|
+
if (showSearch && expanded && !previouslyExpanded.current && !searchDisabled) searchRegion.current?.querySelector("input")?.focus();
|
|
78804
|
+
previouslyExpanded.current = expanded;
|
|
78805
|
+
}, [expanded, searchDisabled, showSearch]);
|
|
78806
|
+
useEffect88(() => {
|
|
78807
|
+
if (disabled || category !== null && (!active || active.disabled)) {
|
|
78808
|
+
setOpen(false);
|
|
78809
|
+
setCategory(null);
|
|
78810
|
+
setDraft([]);
|
|
78811
|
+
}
|
|
78812
|
+
}, [disabled, category, active]);
|
|
78813
|
+
const items = active ? active.options.map((option) => ({
|
|
78814
|
+
id: option.value,
|
|
78815
|
+
label: option.label,
|
|
78816
|
+
type: "checkbox",
|
|
78817
|
+
checked: draft.includes(option.value),
|
|
78818
|
+
disabled: option.disabled,
|
|
78819
|
+
badge: showMenuCounts ? option.count : void 0,
|
|
78820
|
+
onCheckedChange: (checked) => setDraft((current) => checked ? [.../* @__PURE__ */ new Set([...current, option.value])] : current.filter((entry) => entry !== option.value))
|
|
78821
|
+
})) : filters.map((filter) => ({
|
|
78822
|
+
id: filter.id,
|
|
78823
|
+
label: filter.label,
|
|
78824
|
+
badge: showMenuCounts ? filter.count ?? filter.options.length : void 0,
|
|
78825
|
+
disabled: filter.disabled,
|
|
78826
|
+
trailing: /* @__PURE__ */ jsx359(CustomIcon_default, { icon: "ChevronRight", size: "sm" }),
|
|
78827
|
+
closeOnSelect: false,
|
|
78828
|
+
command: () => edit(filter)
|
|
78829
|
+
}));
|
|
78830
|
+
const chips = filters.filter((filter) => applied[filter.id]?.length).map((filter) => ({
|
|
78831
|
+
id: filter.id,
|
|
78832
|
+
label: `${filter.label}: ${filter.options.filter((option) => applied[filter.id].includes(option.value)).map((option) => option.label).join(", ")}`,
|
|
78833
|
+
disabled: disabled || filter.disabled,
|
|
78834
|
+
edit: () => edit(filter),
|
|
78835
|
+
remove: () => {
|
|
78836
|
+
const next = { ...applied };
|
|
78837
|
+
delete next[filter.id];
|
|
78838
|
+
commit(next);
|
|
78839
|
+
anchor.current?.focus();
|
|
78840
|
+
}
|
|
78841
|
+
}));
|
|
78842
|
+
return /* @__PURE__ */ jsxs230(
|
|
78843
|
+
"div",
|
|
78844
|
+
{
|
|
78845
|
+
role: "group",
|
|
78846
|
+
"aria-label": ariaLabel ?? t("kit.filterbar.filters"),
|
|
78847
|
+
className: classNames149("kit-filter-bar flex min-w-0 flex-wrap items-center gap-2 text-sm", surfaceClasses, getSurfaceCornerClass(corner), getSurfacePaddingClass(padding), className),
|
|
78848
|
+
style,
|
|
78849
|
+
onBlurCapture: (event) => {
|
|
78850
|
+
const menu = event.target.closest("[data-menu-owner]");
|
|
78851
|
+
const next = event.relatedTarget;
|
|
78852
|
+
if (open && menu && !menu.contains(next) && !event.currentTarget.contains(next)) close();
|
|
78853
|
+
},
|
|
78854
|
+
onKeyDownCapture: (event) => {
|
|
78855
|
+
if (open && active && event.key === "Tab") event.stopPropagation();
|
|
78856
|
+
if (open && category && event.key === "ArrowLeft") {
|
|
78857
|
+
event.preventDefault();
|
|
78858
|
+
event.stopPropagation();
|
|
78859
|
+
setCategory(null);
|
|
78860
|
+
setDraft([]);
|
|
78861
|
+
}
|
|
78862
|
+
if (open && event.key === "Escape") {
|
|
78863
|
+
event.preventDefault();
|
|
78864
|
+
event.stopPropagation();
|
|
78865
|
+
close(true);
|
|
78866
|
+
}
|
|
78867
|
+
},
|
|
78868
|
+
children: [
|
|
78869
|
+
/* @__PURE__ */ jsxs230(
|
|
78870
|
+
"div",
|
|
78871
|
+
{
|
|
78872
|
+
ref: searchRegion,
|
|
78873
|
+
className: "fb-search",
|
|
78874
|
+
"data-expanded": expanded,
|
|
78875
|
+
hidden: !showSearch,
|
|
78876
|
+
inert: !showSearch,
|
|
78877
|
+
onBlur: (event) => {
|
|
78878
|
+
if (!event.currentTarget.contains(event.relatedTarget) && !event.currentTarget.querySelector("input")?.value) setExpanded(false);
|
|
78879
|
+
},
|
|
78880
|
+
children: [
|
|
78881
|
+
/* @__PURE__ */ jsx359(
|
|
78882
|
+
Button_default,
|
|
78883
|
+
{
|
|
78884
|
+
...actionStyle,
|
|
78885
|
+
variant: "icon",
|
|
78886
|
+
leadingIcon: "Search",
|
|
78887
|
+
"aria-label": t("kit.filterbar.search"),
|
|
78888
|
+
"aria-expanded": expanded,
|
|
78889
|
+
"aria-controls": searchId,
|
|
78890
|
+
disabled: searchDisabled,
|
|
78891
|
+
className: "fb-search-trigger",
|
|
78892
|
+
hidden: expanded,
|
|
78893
|
+
onClick: () => setExpanded(true)
|
|
78894
|
+
}
|
|
78895
|
+
),
|
|
78896
|
+
/* @__PURE__ */ jsx359("div", { id: searchId, className: "fb-search-input", inert: !expanded, "aria-hidden": !expanded, children: /* @__PURE__ */ jsx359(SearchBar_default, { size, color: color2, ...searchProps, disabled: searchDisabled }) })
|
|
78897
|
+
]
|
|
78898
|
+
}
|
|
78899
|
+
),
|
|
78900
|
+
showSearch && (showFilterLabel || chips.length > 0 || showEmptyState) && /* @__PURE__ */ jsx359("span", { "aria-hidden": "true", className: "h-5 border-l border-neutral-200 dark:border-neutral-700" }),
|
|
78901
|
+
showFilterLabel && /* @__PURE__ */ jsxs230("span", { className: "flex items-center gap-1.5 text-neutral-600 dark:text-neutral-300", children: [
|
|
78902
|
+
/* @__PURE__ */ jsx359("svg", { "aria-hidden": "true", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", children: /* @__PURE__ */ jsx359("path", { d: "M3 4h18l-7 8v8l-4-2v-6Z" }) }),
|
|
78903
|
+
t("kit.filterbar.filters")
|
|
78904
|
+
] }),
|
|
78905
|
+
/* @__PURE__ */ jsx359(FilterChips, { chips, color: chipTone, variant: chipVariant, size, buttonTone, buttonStyle, removeLabel: (label) => t("kit.filterbar.remove", { label }) }),
|
|
78906
|
+
showEmptyState && !chips.length && /* @__PURE__ */ jsx359("span", { className: "text-neutral-400", children: t("kit.filterbar.empty") }),
|
|
78907
|
+
/* @__PURE__ */ jsxs230("div", { className: "flex flex-1 flex-wrap items-center justify-end gap-2", children: [
|
|
78908
|
+
/* @__PURE__ */ jsx359(
|
|
78909
|
+
Button_default,
|
|
78910
|
+
{
|
|
78911
|
+
...actionStyle,
|
|
78912
|
+
ref: anchor,
|
|
78913
|
+
variant: buttonVariant,
|
|
78914
|
+
leadingIcon: "Add",
|
|
78915
|
+
disabled: disabled || !filters.length,
|
|
78916
|
+
className: classNames149(buttonCorner === void 0 && "rounded-full", buttonDashed && buttonVariant === "outline" && "border-dashed"),
|
|
78917
|
+
"aria-haspopup": "menu",
|
|
78918
|
+
"aria-expanded": open,
|
|
78919
|
+
onClick: () => {
|
|
78920
|
+
if (open) close();
|
|
78921
|
+
else {
|
|
78922
|
+
setCategory(null);
|
|
78923
|
+
setOpen(true);
|
|
78924
|
+
}
|
|
78925
|
+
},
|
|
78926
|
+
onKeyDown: (event) => {
|
|
78927
|
+
if (event.key === "ArrowDown") {
|
|
78928
|
+
event.preventDefault();
|
|
78929
|
+
setCategory(null);
|
|
78930
|
+
setOpen(true);
|
|
78931
|
+
}
|
|
78932
|
+
},
|
|
78933
|
+
children: t("kit.filterbar.add")
|
|
78934
|
+
}
|
|
78935
|
+
),
|
|
78936
|
+
showClearAll && chips.length > 0 && /* @__PURE__ */ jsx359(Button_default, { ...actionStyle, variant: secondaryButtonVariant, disabled, onClick: () => {
|
|
78937
|
+
commit({});
|
|
78938
|
+
anchor.current?.focus();
|
|
78939
|
+
}, children: t("kit.filterbar.clearAll") }),
|
|
78940
|
+
showResultCount && /* @__PURE__ */ jsx359("span", { className: "border-l border-neutral-200 pl-2 text-neutral-400 dark:border-neutral-700", role: "status", children: t("kit.filterbar.summary", { filtered: filteredCount, total: totalCount, items: itemLabel ?? t("kit.filterbar.items") }) })
|
|
78941
|
+
] }),
|
|
78942
|
+
/* @__PURE__ */ jsx359(
|
|
78943
|
+
Menu,
|
|
78944
|
+
{
|
|
78945
|
+
popup: true,
|
|
78946
|
+
anchorRef: anchor,
|
|
78947
|
+
open: open && !disabled,
|
|
78948
|
+
onOpenChange: (next) => {
|
|
78949
|
+
if (!next) close();
|
|
78950
|
+
},
|
|
78951
|
+
items,
|
|
78952
|
+
width: 320,
|
|
78953
|
+
size,
|
|
78954
|
+
variant: menuVariant,
|
|
78955
|
+
tone: menuTone,
|
|
78956
|
+
corner: menuCorner,
|
|
78957
|
+
padding: menuPadding2,
|
|
78958
|
+
className: "fb-menu",
|
|
78959
|
+
style,
|
|
78960
|
+
"aria-label": active?.label ?? t("kit.filterbar.filterBy"),
|
|
78961
|
+
renderItem: active ? (item) => /* @__PURE__ */ jsxs230(Fragment62, { children: [
|
|
78962
|
+
/* @__PURE__ */ jsx359("span", { "aria-hidden": "true", className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600", children: item.checked && /* @__PURE__ */ jsx359(CustomIcon_default, { icon: "Check", size: "xs" }) }),
|
|
78963
|
+
/* @__PURE__ */ jsx359("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
78964
|
+
item.badge != null && /* @__PURE__ */ jsx359("span", { className: "shrink-0 text-xs text-neutral-400", children: item.badge })
|
|
78965
|
+
] }) : void 0,
|
|
78966
|
+
header: active ? /* @__PURE__ */ jsx359(Button_default, { ...actionStyle, variant: secondaryButtonVariant, leadingIcon: "ChevronLeft", onClick: () => {
|
|
78967
|
+
setCategory(null);
|
|
78968
|
+
setDraft([]);
|
|
78969
|
+
}, "aria-label": t("kit.filterbar.back"), children: /* @__PURE__ */ jsx359("span", { className: "uppercase tracking-wide", children: active.label }) }) : /* @__PURE__ */ jsx359("span", { className: "px-3 text-xs uppercase tracking-wide text-neutral-400", children: t("kit.filterbar.filterBy") }),
|
|
78970
|
+
footer: active ? /* @__PURE__ */ jsxs230("div", { className: "flex items-center justify-between", children: [
|
|
78971
|
+
/* @__PURE__ */ jsx359(Button_default, { ...actionStyle, variant: secondaryButtonVariant, onClick: () => setDraft((current) => current.filter((entry) => active.options.some((option) => option.value === entry && option.disabled))), children: t("kit.filterbar.clear") }),
|
|
78972
|
+
/* @__PURE__ */ jsx359(Button_default, { ...actionStyle, variant: applyButtonVariant, onClick: () => {
|
|
78973
|
+
commit({ ...applied, [active.id]: draft });
|
|
78974
|
+
close(true);
|
|
78975
|
+
}, children: t("kit.filterbar.done") })
|
|
78976
|
+
] }) : void 0
|
|
78977
|
+
},
|
|
78978
|
+
category ?? "categories"
|
|
78979
|
+
)
|
|
78980
|
+
]
|
|
78981
|
+
}
|
|
78982
|
+
);
|
|
78983
|
+
}
|
|
78984
|
+
function FilterChips({ chips, color: color2, variant, size, buttonTone, buttonStyle, removeLabel }) {
|
|
78985
|
+
const [visible, setVisible] = useState109(chips);
|
|
78986
|
+
const region = useRef90(null);
|
|
78987
|
+
const positions = useRef90(/* @__PURE__ */ new Map());
|
|
78988
|
+
const signature = chips.map((chip) => chip.id).join("\0");
|
|
78989
|
+
useEffect88(() => {
|
|
78990
|
+
const timer = setTimeout(() => setVisible((current) => current.filter((chip) => signature.split("\0").includes(chip.id))), 900);
|
|
78991
|
+
return () => clearTimeout(timer);
|
|
78992
|
+
}, [signature]);
|
|
78993
|
+
useLayoutEffect36(() => {
|
|
78994
|
+
setVisible((current) => [...chips, ...current.filter((chip) => !chips.some((next) => next.id === chip.id))]);
|
|
78995
|
+
}, [signature]);
|
|
78996
|
+
useLayoutEffect36(() => {
|
|
78997
|
+
if (typeof matchMedia === "undefined" || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
78998
|
+
const next = /* @__PURE__ */ new Map();
|
|
78999
|
+
region.current?.querySelectorAll("[data-chip]").forEach((element) => {
|
|
79000
|
+
const key = element.dataset.chip;
|
|
79001
|
+
const left = element.getBoundingClientRect().left;
|
|
79002
|
+
const previous = positions.current.get(key);
|
|
79003
|
+
if (previous !== void 0 && previous !== left) element.animate?.([{ transform: `translateX(${previous - left}px)` }, { transform: "translateX(0)" }], { duration: 320, easing: "ease-out" });
|
|
79004
|
+
next.set(key, left);
|
|
79005
|
+
});
|
|
79006
|
+
positions.current = next;
|
|
79007
|
+
});
|
|
79008
|
+
return /* @__PURE__ */ jsx359("div", { ref: region, className: "contents", children: visible.map((old) => {
|
|
79009
|
+
const chip = chips.find((current) => current.id === old.id);
|
|
79010
|
+
const entry = chip ?? old;
|
|
79011
|
+
return /* @__PURE__ */ jsx359("span", { "data-chip": entry.id, className: "fb-chip", "data-exiting": !chip, inert: !chip, "aria-hidden": !chip, children: /* @__PURE__ */ jsx359(Badge_default, { tone: color2, variant, size, ring: false, className: "max-w-full py-1", children: /* @__PURE__ */ jsxs230("span", { className: "flex min-w-0 items-center gap-1", children: [
|
|
79012
|
+
/* @__PURE__ */ jsx359("button", { type: "button", disabled: entry.disabled, className: "min-w-0 truncate rounded-full px-1 py-1 focus-visible:outline focus-visible:outline-2 disabled:opacity-50", onClick: entry.edit, children: entry.label }),
|
|
79013
|
+
/* @__PURE__ */ jsx359(Button_default, { variant: "icon", size: "xs", color: buttonTone, style: buttonStyle, leadingIcon: "Close", disabled: entry.disabled, "aria-label": removeLabel(entry.label), onClick: entry.remove })
|
|
79014
|
+
] }) }) }, entry.id);
|
|
79015
|
+
}) });
|
|
79016
|
+
}
|
|
79017
|
+
|
|
78597
79018
|
// src/contexts/BottomSheetContext.tsx
|
|
78598
79019
|
import {
|
|
78599
79020
|
createContext as createContext10,
|
|
78600
79021
|
useCallback as useCallback58,
|
|
78601
79022
|
useContext as useContext10,
|
|
78602
|
-
useEffect as
|
|
79023
|
+
useEffect as useEffect89,
|
|
78603
79024
|
useMemo as useMemo75,
|
|
78604
|
-
useRef as
|
|
78605
|
-
useState as
|
|
79025
|
+
useRef as useRef91,
|
|
79026
|
+
useState as useState110
|
|
78606
79027
|
} from "react";
|
|
78607
79028
|
import { createPortal as createPortal21 } from "react-dom";
|
|
78608
|
-
import
|
|
78609
|
-
import { jsx as
|
|
79029
|
+
import classNames150 from "classnames";
|
|
79030
|
+
import { jsx as jsx360, jsxs as jsxs231 } from "react/jsx-runtime";
|
|
78610
79031
|
var BottomSheetContext = createContext10(null);
|
|
78611
79032
|
var TRANSITION_MS2 = 260;
|
|
78612
79033
|
var renderSlot = (slot, controls) => {
|
|
@@ -78618,9 +79039,9 @@ var renderSlot = (slot, controls) => {
|
|
|
78618
79039
|
var BottomSheetProvider = ({
|
|
78619
79040
|
children
|
|
78620
79041
|
}) => {
|
|
78621
|
-
const [sheet, setSheet] =
|
|
78622
|
-
const [isVisible, setIsVisible] =
|
|
78623
|
-
const pendingCloseRef =
|
|
79042
|
+
const [sheet, setSheet] = useState110(null);
|
|
79043
|
+
const [isVisible, setIsVisible] = useState110(false);
|
|
79044
|
+
const pendingCloseRef = useRef91(null);
|
|
78624
79045
|
const dismissSheet = useCallback58(() => {
|
|
78625
79046
|
setIsVisible(false);
|
|
78626
79047
|
}, []);
|
|
@@ -78637,7 +79058,7 @@ var BottomSheetProvider = ({
|
|
|
78637
79058
|
setTimeout(animateIn, 0);
|
|
78638
79059
|
}
|
|
78639
79060
|
}, []);
|
|
78640
|
-
|
|
79061
|
+
useEffect89(() => {
|
|
78641
79062
|
if (!isVisible && sheet) {
|
|
78642
79063
|
pendingCloseRef.current = setTimeout(() => {
|
|
78643
79064
|
sheet.onClose?.();
|
|
@@ -78652,7 +79073,7 @@ var BottomSheetProvider = ({
|
|
|
78652
79073
|
}
|
|
78653
79074
|
return void 0;
|
|
78654
79075
|
}, [isVisible, sheet]);
|
|
78655
|
-
|
|
79076
|
+
useEffect89(
|
|
78656
79077
|
() => () => {
|
|
78657
79078
|
if (pendingCloseRef.current) {
|
|
78658
79079
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -78676,11 +79097,11 @@ var BottomSheetProvider = ({
|
|
|
78676
79097
|
[presentSheet, dismissSheet, sheet, isVisible]
|
|
78677
79098
|
);
|
|
78678
79099
|
const overlayNode = typeof document !== "undefined" && sheet ? createPortal21(
|
|
78679
|
-
/* @__PURE__ */
|
|
78680
|
-
/* @__PURE__ */
|
|
79100
|
+
/* @__PURE__ */ jsxs231("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
|
|
79101
|
+
/* @__PURE__ */ jsx360(
|
|
78681
79102
|
"div",
|
|
78682
79103
|
{
|
|
78683
|
-
className:
|
|
79104
|
+
className: classNames150(
|
|
78684
79105
|
"absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
|
|
78685
79106
|
isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
78686
79107
|
),
|
|
@@ -78690,24 +79111,24 @@ var BottomSheetProvider = ({
|
|
|
78690
79111
|
}
|
|
78691
79112
|
}
|
|
78692
79113
|
),
|
|
78693
|
-
/* @__PURE__ */
|
|
79114
|
+
/* @__PURE__ */ jsx360("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs231(
|
|
78694
79115
|
"section",
|
|
78695
79116
|
{
|
|
78696
79117
|
role: "dialog",
|
|
78697
79118
|
"aria-modal": "true",
|
|
78698
|
-
className:
|
|
79119
|
+
className: classNames150(
|
|
78699
79120
|
"pointer-events-auto ml-auto flex w-full flex-col rounded-t-3xl border border-slate-200 bg-white shadow-2xl transition-transform duration-300 dark:border-slate-700 dark:bg-slate-900",
|
|
78700
79121
|
sheet.className,
|
|
78701
79122
|
isVisible ? "translate-y-0" : "translate-y-full"
|
|
78702
79123
|
),
|
|
78703
79124
|
style: { minHeight: "25vh", maxHeight: "85vh" },
|
|
78704
79125
|
children: [
|
|
78705
|
-
/* @__PURE__ */
|
|
78706
|
-
/* @__PURE__ */
|
|
78707
|
-
sheet.title && /* @__PURE__ */
|
|
78708
|
-
sheet.description && /* @__PURE__ */
|
|
79126
|
+
/* @__PURE__ */ jsxs231("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
79127
|
+
/* @__PURE__ */ jsxs231("div", { className: "space-y-1", children: [
|
|
79128
|
+
sheet.title && /* @__PURE__ */ jsx360("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
|
|
79129
|
+
sheet.description && /* @__PURE__ */ jsx360("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
|
|
78709
79130
|
] }),
|
|
78710
|
-
(sheet.showCloseButton ?? true) && /* @__PURE__ */
|
|
79131
|
+
(sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx360(
|
|
78711
79132
|
IconButton_default,
|
|
78712
79133
|
{
|
|
78713
79134
|
icon: "Close",
|
|
@@ -78719,15 +79140,15 @@ var BottomSheetProvider = ({
|
|
|
78719
79140
|
}
|
|
78720
79141
|
)
|
|
78721
79142
|
] }),
|
|
78722
|
-
/* @__PURE__ */
|
|
78723
|
-
sheet.actions && /* @__PURE__ */
|
|
79143
|
+
/* @__PURE__ */ jsx360("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx360("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
|
|
79144
|
+
sheet.actions && /* @__PURE__ */ jsx360("div", { className: "flex flex-wrap items-center justify-end gap-3 border-t border-slate-200 px-6 py-4 dark:border-slate-800", children: renderSlot(sheet.actions, controls) })
|
|
78724
79145
|
]
|
|
78725
79146
|
}
|
|
78726
79147
|
) })
|
|
78727
79148
|
] }),
|
|
78728
79149
|
document.body
|
|
78729
79150
|
) : null;
|
|
78730
|
-
return /* @__PURE__ */
|
|
79151
|
+
return /* @__PURE__ */ jsxs231(BottomSheetContext.Provider, { value: contextValue, children: [
|
|
78731
79152
|
children,
|
|
78732
79153
|
overlayNode
|
|
78733
79154
|
] });
|
|
@@ -79367,8 +79788,8 @@ var SYSTEM_VARIABLES = [
|
|
|
79367
79788
|
];
|
|
79368
79789
|
|
|
79369
79790
|
// src/components/MetricBar.tsx
|
|
79370
|
-
import
|
|
79371
|
-
import { jsx as
|
|
79791
|
+
import classNames151 from "classnames";
|
|
79792
|
+
import { jsx as jsx361 } from "react/jsx-runtime";
|
|
79372
79793
|
var MetricBar = ({
|
|
79373
79794
|
label,
|
|
79374
79795
|
value,
|
|
@@ -79378,7 +79799,7 @@ var MetricBar = ({
|
|
|
79378
79799
|
size = "sm",
|
|
79379
79800
|
className,
|
|
79380
79801
|
...rest
|
|
79381
|
-
}) => /* @__PURE__ */
|
|
79802
|
+
}) => /* @__PURE__ */ jsx361(
|
|
79382
79803
|
Progress_default,
|
|
79383
79804
|
{
|
|
79384
79805
|
...rest,
|
|
@@ -79388,13 +79809,13 @@ var MetricBar = ({
|
|
|
79388
79809
|
formatValue: value !== void 0 ? () => String(value) : void 0,
|
|
79389
79810
|
size,
|
|
79390
79811
|
color: tone ?? color2 ?? "blue",
|
|
79391
|
-
className:
|
|
79812
|
+
className: classNames151("w-full", className)
|
|
79392
79813
|
}
|
|
79393
79814
|
);
|
|
79394
79815
|
MetricBar.displayName = "MetricBar";
|
|
79395
79816
|
|
|
79396
79817
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
79397
|
-
import { useEffect as
|
|
79818
|
+
import { useEffect as useEffect91, useId as useId54, useMemo as useMemo76, useRef as useRef93, useState as useState112 } from "react";
|
|
79398
79819
|
|
|
79399
79820
|
// src/components/NetworkGraph/model.ts
|
|
79400
79821
|
var CELL = 64;
|
|
@@ -79538,16 +79959,16 @@ function findNetworkPath(edges, source, target) {
|
|
|
79538
79959
|
}
|
|
79539
79960
|
|
|
79540
79961
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
79541
|
-
import { useCallback as useCallback59, useEffect as
|
|
79962
|
+
import { useCallback as useCallback59, useEffect as useEffect90, useRef as useRef92, useState as useState111 } from "react";
|
|
79542
79963
|
function useNetworkCanvas(options) {
|
|
79543
|
-
const canvasRef =
|
|
79544
|
-
const view =
|
|
79545
|
-
const size =
|
|
79546
|
-
const latest =
|
|
79547
|
-
const frame =
|
|
79548
|
-
const [zoom, setZoom] =
|
|
79549
|
-
const colors3 =
|
|
79550
|
-
const textColor =
|
|
79964
|
+
const canvasRef = useRef92(null);
|
|
79965
|
+
const view = useRef92({ x: 0, y: 0, zoom: 1 });
|
|
79966
|
+
const size = useRef92({ width: 1, height: 1 });
|
|
79967
|
+
const latest = useRef92(options);
|
|
79968
|
+
const frame = useRef92(null);
|
|
79969
|
+
const [zoom, setZoom] = useState111(1);
|
|
79970
|
+
const colors3 = useRef92(/* @__PURE__ */ new Map());
|
|
79971
|
+
const textColor = useRef92("#737373");
|
|
79551
79972
|
const draw = useCallback59(() => {
|
|
79552
79973
|
const canvas = canvasRef.current;
|
|
79553
79974
|
const ctx = canvas?.getContext("2d");
|
|
@@ -79688,14 +80109,14 @@ function useNetworkCanvas(options) {
|
|
|
79688
80109
|
},
|
|
79689
80110
|
[update]
|
|
79690
80111
|
);
|
|
79691
|
-
|
|
80112
|
+
useEffect90(() => {
|
|
79692
80113
|
latest.current = options;
|
|
79693
80114
|
requestDraw();
|
|
79694
80115
|
}, [options, requestDraw]);
|
|
79695
|
-
|
|
80116
|
+
useEffect90(() => {
|
|
79696
80117
|
fit();
|
|
79697
80118
|
}, [options.model, fit]);
|
|
79698
|
-
|
|
80119
|
+
useEffect90(() => {
|
|
79699
80120
|
const canvas = canvasRef.current;
|
|
79700
80121
|
if (!canvas) return;
|
|
79701
80122
|
const measure = () => {
|
|
@@ -79748,7 +80169,7 @@ function useNetworkCanvas(options) {
|
|
|
79748
80169
|
}
|
|
79749
80170
|
|
|
79750
80171
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
79751
|
-
import { jsx as
|
|
80172
|
+
import { jsx as jsx362, jsxs as jsxs232 } from "react/jsx-runtime";
|
|
79752
80173
|
var NO_COMMUNITIES = [];
|
|
79753
80174
|
var NO_HIGHLIGHTS = [];
|
|
79754
80175
|
function NetworkGraph({
|
|
@@ -79780,11 +80201,11 @@ function NetworkGraph({
|
|
|
79780
80201
|
}) {
|
|
79781
80202
|
const tone = getSurfaceAccentColor(surfaceTone);
|
|
79782
80203
|
const t = useKitT();
|
|
79783
|
-
const helpId =
|
|
79784
|
-
const layoutRef =
|
|
79785
|
-
const [hasLegendSpace, setHasLegendSpace] =
|
|
80204
|
+
const helpId = useId54();
|
|
80205
|
+
const layoutRef = useRef93(null);
|
|
80206
|
+
const [hasLegendSpace, setHasLegendSpace] = useState112(true);
|
|
79786
80207
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
79787
|
-
|
|
80208
|
+
useEffect91(() => {
|
|
79788
80209
|
const element = layoutRef.current;
|
|
79789
80210
|
if (!element || legendPosition !== "auto") return;
|
|
79790
80211
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -79797,12 +80218,12 @@ function NetworkGraph({
|
|
|
79797
80218
|
() => buildNetwork(nodes, edges, communities),
|
|
79798
80219
|
[nodes, edges, communities]
|
|
79799
80220
|
);
|
|
79800
|
-
const [internalSelected, setInternalSelected] =
|
|
80221
|
+
const [internalSelected, setInternalSelected] = useState112(
|
|
79801
80222
|
defaultSelectedNodeId
|
|
79802
80223
|
);
|
|
79803
|
-
const [hidden, setHidden] =
|
|
79804
|
-
const [focused, setFocused] =
|
|
79805
|
-
const [query, setQuery] =
|
|
80224
|
+
const [hidden, setHidden] = useState112(() => /* @__PURE__ */ new Set());
|
|
80225
|
+
const [focused, setFocused] = useState112(null);
|
|
80226
|
+
const [query, setQuery] = useState112("");
|
|
79806
80227
|
const enabled = useMemo76(
|
|
79807
80228
|
() => new Set(
|
|
79808
80229
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
@@ -79844,7 +80265,7 @@ function NetworkGraph({
|
|
|
79844
80265
|
onViewportChange
|
|
79845
80266
|
});
|
|
79846
80267
|
const locked = disabled || loading;
|
|
79847
|
-
const drag =
|
|
80268
|
+
const drag = useRef93(null);
|
|
79848
80269
|
const select = (id) => {
|
|
79849
80270
|
if (locked) return;
|
|
79850
80271
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -79860,7 +80281,7 @@ function NetworkGraph({
|
|
|
79860
80281
|
);
|
|
79861
80282
|
onVisibleCommunitiesChange?.(ids);
|
|
79862
80283
|
};
|
|
79863
|
-
|
|
80284
|
+
useEffect91(() => {
|
|
79864
80285
|
const element = canvas.canvasRef.current;
|
|
79865
80286
|
if (!element || locked) return;
|
|
79866
80287
|
const wheel = (event) => {
|
|
@@ -79915,7 +80336,7 @@ function NetworkGraph({
|
|
|
79915
80336
|
}, [visibleNodes, query]);
|
|
79916
80337
|
const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
|
|
79917
80338
|
const resolvedLegendTone = legendTone === "auto" ? surfaceTone : legendTone;
|
|
79918
|
-
const legendContent = /* @__PURE__ */
|
|
80339
|
+
const legendContent = /* @__PURE__ */ jsxs232(
|
|
79919
80340
|
"fieldset",
|
|
79920
80341
|
{
|
|
79921
80342
|
disabled: locked,
|
|
@@ -79924,8 +80345,8 @@ function NetworkGraph({
|
|
|
79924
80345
|
maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
|
|
79925
80346
|
},
|
|
79926
80347
|
children: [
|
|
79927
|
-
/* @__PURE__ */
|
|
79928
|
-
/* @__PURE__ */
|
|
80348
|
+
/* @__PURE__ */ jsx362("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
|
|
80349
|
+
/* @__PURE__ */ jsx362(
|
|
79929
80350
|
Checkbox_default,
|
|
79930
80351
|
{
|
|
79931
80352
|
size: "sm",
|
|
@@ -79936,8 +80357,8 @@ function NetworkGraph({
|
|
|
79936
80357
|
onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
|
|
79937
80358
|
}
|
|
79938
80359
|
),
|
|
79939
|
-
model.groups.map((group) => /* @__PURE__ */
|
|
79940
|
-
/* @__PURE__ */
|
|
80360
|
+
model.groups.map((group) => /* @__PURE__ */ jsxs232("div", { className: "flex items-center justify-between gap-2", children: [
|
|
80361
|
+
/* @__PURE__ */ jsx362(
|
|
79941
80362
|
Checkbox_default,
|
|
79942
80363
|
{
|
|
79943
80364
|
size: "sm",
|
|
@@ -79949,12 +80370,12 @@ function NetworkGraph({
|
|
|
79949
80370
|
)
|
|
79950
80371
|
}
|
|
79951
80372
|
),
|
|
79952
|
-
/* @__PURE__ */
|
|
80373
|
+
/* @__PURE__ */ jsx362("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
|
|
79953
80374
|
] }, group.id))
|
|
79954
80375
|
]
|
|
79955
80376
|
}
|
|
79956
80377
|
);
|
|
79957
|
-
return /* @__PURE__ */
|
|
80378
|
+
return /* @__PURE__ */ jsx362(
|
|
79958
80379
|
Panel_default,
|
|
79959
80380
|
{
|
|
79960
80381
|
...panelProps,
|
|
@@ -79965,7 +80386,7 @@ function NetworkGraph({
|
|
|
79965
80386
|
loading,
|
|
79966
80387
|
clickable: false,
|
|
79967
80388
|
scrollable: false,
|
|
79968
|
-
children: /* @__PURE__ */
|
|
80389
|
+
children: /* @__PURE__ */ jsxs232(
|
|
79969
80390
|
"div",
|
|
79970
80391
|
{
|
|
79971
80392
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -79973,7 +80394,7 @@ function NetworkGraph({
|
|
|
79973
80394
|
"aria-label": ariaLabel ?? t("kit.networkGraph.name"),
|
|
79974
80395
|
"aria-disabled": locked || void 0,
|
|
79975
80396
|
children: [
|
|
79976
|
-
showControls && /* @__PURE__ */
|
|
80397
|
+
showControls && /* @__PURE__ */ jsx362("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx362("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx362(
|
|
79977
80398
|
Combobox_default,
|
|
79978
80399
|
{
|
|
79979
80400
|
size: "sm",
|
|
@@ -79995,7 +80416,7 @@ function NetworkGraph({
|
|
|
79995
80416
|
}
|
|
79996
80417
|
}
|
|
79997
80418
|
) }) }),
|
|
79998
|
-
/* @__PURE__ */
|
|
80419
|
+
/* @__PURE__ */ jsxs232(
|
|
79999
80420
|
"div",
|
|
80000
80421
|
{
|
|
80001
80422
|
ref: layoutRef,
|
|
@@ -80003,13 +80424,13 @@ function NetworkGraph({
|
|
|
80003
80424
|
style: { flexDirection: legendOnRight ? "row" : "column" },
|
|
80004
80425
|
"data-legend-position": legendOnRight ? "right" : "bottom",
|
|
80005
80426
|
children: [
|
|
80006
|
-
/* @__PURE__ */
|
|
80427
|
+
/* @__PURE__ */ jsxs232(
|
|
80007
80428
|
"div",
|
|
80008
80429
|
{
|
|
80009
80430
|
className: "relative min-w-0 flex-1",
|
|
80010
80431
|
style: { height: graphHeight, minHeight: graphHeight },
|
|
80011
80432
|
children: [
|
|
80012
|
-
/* @__PURE__ */
|
|
80433
|
+
/* @__PURE__ */ jsx362(
|
|
80013
80434
|
"canvas",
|
|
80014
80435
|
{
|
|
80015
80436
|
ref: canvas.canvasRef,
|
|
@@ -80078,11 +80499,11 @@ function NetworkGraph({
|
|
|
80078
80499
|
}
|
|
80079
80500
|
}
|
|
80080
80501
|
),
|
|
80081
|
-
showControls && /* @__PURE__ */
|
|
80082
|
-
/* @__PURE__ */
|
|
80502
|
+
showControls && /* @__PURE__ */ jsxs232("div", { className: "absolute bottom-3 right-3 z-10 flex items-center gap-0.5 rounded-lg border border-neutral-200 bg-white/90 p-1 shadow-sm backdrop-blur dark:border-neutral-700 dark:bg-neutral-900/90", children: [
|
|
80503
|
+
/* @__PURE__ */ jsx362(
|
|
80083
80504
|
IconButton_default,
|
|
80084
80505
|
{
|
|
80085
|
-
icon: /* @__PURE__ */
|
|
80506
|
+
icon: /* @__PURE__ */ jsxs232(
|
|
80086
80507
|
"svg",
|
|
80087
80508
|
{
|
|
80088
80509
|
viewBox: "0 0 24 24",
|
|
@@ -80093,10 +80514,10 @@ function NetworkGraph({
|
|
|
80093
80514
|
strokeLinejoin: "round",
|
|
80094
80515
|
"aria-hidden": "true",
|
|
80095
80516
|
children: [
|
|
80096
|
-
/* @__PURE__ */
|
|
80097
|
-
/* @__PURE__ */
|
|
80098
|
-
/* @__PURE__ */
|
|
80099
|
-
/* @__PURE__ */
|
|
80517
|
+
/* @__PURE__ */ jsx362("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
|
|
80518
|
+
/* @__PURE__ */ jsx362("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
|
|
80519
|
+
/* @__PURE__ */ jsx362("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
|
|
80520
|
+
/* @__PURE__ */ jsx362("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
|
|
80100
80521
|
]
|
|
80101
80522
|
}
|
|
80102
80523
|
),
|
|
@@ -80109,10 +80530,10 @@ function NetworkGraph({
|
|
|
80109
80530
|
onClick: canvas.fit
|
|
80110
80531
|
}
|
|
80111
80532
|
),
|
|
80112
|
-
/* @__PURE__ */
|
|
80533
|
+
/* @__PURE__ */ jsx362(
|
|
80113
80534
|
IconButton_default,
|
|
80114
80535
|
{
|
|
80115
|
-
icon: /* @__PURE__ */
|
|
80536
|
+
icon: /* @__PURE__ */ jsx362(
|
|
80116
80537
|
"svg",
|
|
80117
80538
|
{
|
|
80118
80539
|
viewBox: "0 0 24 24",
|
|
@@ -80121,7 +80542,7 @@ function NetworkGraph({
|
|
|
80121
80542
|
strokeWidth: 2,
|
|
80122
80543
|
strokeLinecap: "round",
|
|
80123
80544
|
"aria-hidden": "true",
|
|
80124
|
-
children: /* @__PURE__ */
|
|
80545
|
+
children: /* @__PURE__ */ jsx362("path", { d: "M6 12h12" })
|
|
80125
80546
|
}
|
|
80126
80547
|
),
|
|
80127
80548
|
size: "xs",
|
|
@@ -80133,7 +80554,7 @@ function NetworkGraph({
|
|
|
80133
80554
|
onClick: () => canvas.zoomBy(0.8)
|
|
80134
80555
|
}
|
|
80135
80556
|
),
|
|
80136
|
-
/* @__PURE__ */
|
|
80557
|
+
/* @__PURE__ */ jsxs232(
|
|
80137
80558
|
"span",
|
|
80138
80559
|
{
|
|
80139
80560
|
className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
|
|
@@ -80144,7 +80565,7 @@ function NetworkGraph({
|
|
|
80144
80565
|
]
|
|
80145
80566
|
}
|
|
80146
80567
|
),
|
|
80147
|
-
/* @__PURE__ */
|
|
80568
|
+
/* @__PURE__ */ jsx362(
|
|
80148
80569
|
IconButton_default,
|
|
80149
80570
|
{
|
|
80150
80571
|
icon: "Add",
|
|
@@ -80157,7 +80578,7 @@ function NetworkGraph({
|
|
|
80157
80578
|
onClick: () => canvas.zoomBy(1.25)
|
|
80158
80579
|
}
|
|
80159
80580
|
),
|
|
80160
|
-
/* @__PURE__ */
|
|
80581
|
+
/* @__PURE__ */ jsx362(
|
|
80161
80582
|
IconButton_default,
|
|
80162
80583
|
{
|
|
80163
80584
|
icon: "Reset",
|
|
@@ -80175,18 +80596,18 @@ function NetworkGraph({
|
|
|
80175
80596
|
}
|
|
80176
80597
|
)
|
|
80177
80598
|
] }),
|
|
80178
|
-
!visibleNodes.length && /* @__PURE__ */
|
|
80599
|
+
!visibleNodes.length && /* @__PURE__ */ jsx362("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
|
|
80179
80600
|
]
|
|
80180
80601
|
}
|
|
80181
80602
|
),
|
|
80182
|
-
showCommunities && model.groups.length > 0 && /* @__PURE__ */
|
|
80603
|
+
showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx362(
|
|
80183
80604
|
"div",
|
|
80184
80605
|
{
|
|
80185
80606
|
className: "min-w-0 shrink-0",
|
|
80186
80607
|
style: {
|
|
80187
80608
|
width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
|
|
80188
80609
|
},
|
|
80189
|
-
children: legendPanel ? /* @__PURE__ */
|
|
80610
|
+
children: legendPanel ? /* @__PURE__ */ jsx362(
|
|
80190
80611
|
Panel_default,
|
|
80191
80612
|
{
|
|
80192
80613
|
variant: legendVariant === "auto" ? variant : legendVariant,
|
|
@@ -80205,8 +80626,8 @@ function NetworkGraph({
|
|
|
80205
80626
|
]
|
|
80206
80627
|
}
|
|
80207
80628
|
),
|
|
80208
|
-
/* @__PURE__ */
|
|
80209
|
-
/* @__PURE__ */
|
|
80629
|
+
/* @__PURE__ */ jsx362("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
|
|
80630
|
+
/* @__PURE__ */ jsx362(
|
|
80210
80631
|
"p",
|
|
80211
80632
|
{
|
|
80212
80633
|
role: "status",
|
|
@@ -80353,6 +80774,7 @@ export {
|
|
|
80353
80774
|
FR_KIT_CATALOG,
|
|
80354
80775
|
FUNNEL_MAX_STAGES,
|
|
80355
80776
|
FileUpload,
|
|
80777
|
+
FilterBar,
|
|
80356
80778
|
FormField_default as FormField,
|
|
80357
80779
|
FormLayout_default as FormLayout,
|
|
80358
80780
|
FormSection_default as FormSection,
|