@cjlapao/ui-kit 0.2.31 → 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/{CapsuleBlueprint-DtgCXUPd.d.cts → CodeBlock-QDW3hqU0.d.cts} +43 -9
- package/dist/{CapsuleBlueprint-DtgCXUPd.d.ts → CodeBlock-QDW3hqU0.d.ts} +43 -9
- package/dist/index.cjs +912 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +813 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +186 -103
- package/dist/index.d.ts +186 -103
- package/dist/index.js +901 -224
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +267 -10
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +7 -3
- package/dist/markdown.d.ts +7 -3
- package/dist/markdown.js +264 -9
- package/dist/markdown.js.map +1 -1
- package/package.json +4 -2
package/dist/index.cjs
CHANGED
|
@@ -88,6 +88,7 @@ __export(src_exports, {
|
|
|
88
88
|
Chart: () => Chart,
|
|
89
89
|
Chat: () => Chat_default,
|
|
90
90
|
Checkbox: () => Checkbox_default,
|
|
91
|
+
CodeBlock: () => CodeBlock,
|
|
91
92
|
CollapseChevron: () => CollapseChevron,
|
|
92
93
|
CollapseToggleButton: () => CollapseToggleButton,
|
|
93
94
|
CollapsibleHelpText: () => CollapsibleHelpText_default,
|
|
@@ -153,6 +154,7 @@ __export(src_exports, {
|
|
|
153
154
|
FR_KIT_CATALOG: () => FR_KIT_CATALOG,
|
|
154
155
|
FUNNEL_MAX_STAGES: () => FUNNEL_MAX_STAGES,
|
|
155
156
|
FileUpload: () => FileUpload,
|
|
157
|
+
FilterBar: () => FilterBar,
|
|
156
158
|
FormField: () => FormField_default,
|
|
157
159
|
FormLayout: () => FormLayout_default,
|
|
158
160
|
FormSection: () => FormSection_default,
|
|
@@ -303,6 +305,7 @@ __export(src_exports, {
|
|
|
303
305
|
SURFACE_GLASS_RIM: () => SURFACE_GLASS_RIM,
|
|
304
306
|
SURFACE_GUTTER_AXES: () => SURFACE_GUTTER_AXES,
|
|
305
307
|
SURFACE_PADDINGS: () => SURFACE_PADDINGS,
|
|
308
|
+
SURFACE_TONES: () => SURFACE_TONES,
|
|
306
309
|
SURFACE_TO_BUTTON_VARIANT: () => SURFACE_TO_BUTTON_VARIANT,
|
|
307
310
|
SURFACE_TRANSPARENCIES: () => SURFACE_TRANSPARENCIES,
|
|
308
311
|
SURFACE_VARIANTS: () => SURFACE_VARIANTS,
|
|
@@ -559,6 +562,7 @@ __export(src_exports, {
|
|
|
559
562
|
getStatusSpinnerToneTokens: () => getStatusSpinnerToneTokens,
|
|
560
563
|
getStatusTokens: () => getStatusTokens,
|
|
561
564
|
getStepperTonePalette: () => getStepperTonePalette,
|
|
565
|
+
getSurfaceAccentColor: () => getSurfaceAccentColor,
|
|
562
566
|
getSurfaceCornerClass: () => getSurfaceCornerClass,
|
|
563
567
|
getSurfaceCornerRem: () => getSurfaceCornerRem,
|
|
564
568
|
getSurfaceGutterClass: () => getSurfaceGutterClass,
|
|
@@ -5591,6 +5595,7 @@ var getSurfaceGlassFillClass = (color2, opacity) => {
|
|
|
5591
5595
|
if (opacity === "clear") return 5;
|
|
5592
5596
|
return 15;
|
|
5593
5597
|
})();
|
|
5598
|
+
if (color2 === "none") return `bg-white/${litOpacity} dark:bg-neutral-900/${drkOpacity}`;
|
|
5594
5599
|
const safeBase = GLASS_COLOR_SAFELIST.has(color2) ? color2 : "neutral";
|
|
5595
5600
|
return `bg-${safeBase}-100/${litOpacity} dark:bg-${safeBase}-500/${drkOpacity}`;
|
|
5596
5601
|
};
|
|
@@ -5757,6 +5762,8 @@ var TRUE_COLORS = [
|
|
|
5757
5762
|
"neutral",
|
|
5758
5763
|
"stone"
|
|
5759
5764
|
];
|
|
5765
|
+
var SURFACE_TONES = ["none", ...TRUE_COLORS];
|
|
5766
|
+
var getSurfaceAccentColor = (tone) => tone === "none" ? "neutral" : tone;
|
|
5760
5767
|
var TRUE_COLOR_DOT_CLASSES = {
|
|
5761
5768
|
red: "bg-red-500 dark:bg-red-400",
|
|
5762
5769
|
orange: "bg-orange-500 dark:bg-orange-400",
|
|
@@ -6022,6 +6029,7 @@ var FIELD_STATUS_CLASSES = {
|
|
|
6022
6029
|
success: "border-emerald-500 dark:border-emerald-400 focus-within:border-emerald-500 dark:focus-within:border-emerald-400 focus-within:ring-2 focus-within:ring-inset focus-within:ring-emerald-500/60 dark:focus-within:ring-emerald-400/60"
|
|
6023
6030
|
};
|
|
6024
6031
|
var SURFACE_VARIANTS = [
|
|
6032
|
+
"none",
|
|
6025
6033
|
"elevated",
|
|
6026
6034
|
"outlined",
|
|
6027
6035
|
"subtle",
|
|
@@ -6032,6 +6040,7 @@ var SURFACE_VARIANTS = [
|
|
|
6032
6040
|
"liquid-glass"
|
|
6033
6041
|
];
|
|
6034
6042
|
var SURFACE_TO_BUTTON_VARIANT = {
|
|
6043
|
+
none: "ghost",
|
|
6035
6044
|
elevated: "solid",
|
|
6036
6045
|
outlined: "outline",
|
|
6037
6046
|
subtle: "ghost",
|
|
@@ -6074,7 +6083,7 @@ var surfaceTriggerTokens = Object.fromEntries(
|
|
|
6074
6083
|
}
|
|
6075
6084
|
])
|
|
6076
6085
|
);
|
|
6077
|
-
var getSurfaceTriggerTokens = (color2) => surfaceTriggerTokens[color2] ?? surfaceTriggerTokens.
|
|
6086
|
+
var getSurfaceTriggerTokens = (color2) => surfaceTriggerTokens[getSurfaceAccentColor(color2)] ?? surfaceTriggerTokens.neutral;
|
|
6078
6087
|
var collapsibleHelpToneTokens = Object.fromEntries(
|
|
6079
6088
|
TRUE_COLORS.map((color2) => [
|
|
6080
6089
|
color2,
|
|
@@ -6137,8 +6146,9 @@ var SURFACE_VARIANT_FOR_FIELD = {
|
|
|
6137
6146
|
glass: "glass"
|
|
6138
6147
|
};
|
|
6139
6148
|
var isGlassSurface = (variant) => variant === "glass" || variant === "liquid-glass";
|
|
6140
|
-
var PANEL_TONE_FOR_FIELD = "
|
|
6149
|
+
var PANEL_TONE_FOR_FIELD = "none";
|
|
6141
6150
|
var INPUT_VARIANT_FOR_SURFACE = {
|
|
6151
|
+
none: "flat",
|
|
6142
6152
|
elevated: "flat",
|
|
6143
6153
|
outlined: "flat",
|
|
6144
6154
|
subtle: "ghost",
|
|
@@ -6149,7 +6159,7 @@ var INPUT_VARIANT_FOR_SURFACE = {
|
|
|
6149
6159
|
"liquid-glass": "glass",
|
|
6150
6160
|
plain: "flat"
|
|
6151
6161
|
};
|
|
6152
|
-
var DEFAULT_SURFACE_TONE = "
|
|
6162
|
+
var DEFAULT_SURFACE_TONE = "none";
|
|
6153
6163
|
var CASCADE_EXPAND = {
|
|
6154
6164
|
/** Per-item cascade step, expanding. */
|
|
6155
6165
|
stepMs: 20,
|
|
@@ -6897,6 +6907,7 @@ var getMultiToggleColorTokens = (color2) => currentTheme.multiToggle[color2] ??
|
|
|
6897
6907
|
var getMultiToggleVariantTokens = (color2) => currentTheme.multiToggleVariant[color2] ?? currentTheme.multiToggleVariant.blue;
|
|
6898
6908
|
var getTabsColorTokens = (color2) => currentTheme.tabs[color2] ?? currentTheme.tabs.blue;
|
|
6899
6909
|
var SURFACE_VARIANT_BASE = {
|
|
6910
|
+
none: "",
|
|
6900
6911
|
elevated: "bg-white shadow-xl ring-1 ring-black/5 dark:bg-neutral-900 dark:ring-white/10",
|
|
6901
6912
|
// A real 1px border, not a ring. `ring-1` with no ring colour resolves to
|
|
6902
6913
|
// currentColor, which painted a near-black rule in light mode.
|
|
@@ -6915,10 +6926,12 @@ var TRANSLUCENT_SURFACE_VARIANTS = [
|
|
|
6915
6926
|
"default"
|
|
6916
6927
|
];
|
|
6917
6928
|
var getRawSurfaceVariantClasses = (variant, tone, overrides = {}) => {
|
|
6918
|
-
const palette =
|
|
6929
|
+
const palette = getPanelToneStyles(tone);
|
|
6919
6930
|
const { bgClass, borderClass, liquidExtras } = overrides;
|
|
6920
6931
|
const base = SURFACE_VARIANT_BASE[variant] ?? SURFACE_VARIANT_BASE.elevated;
|
|
6921
6932
|
switch (variant) {
|
|
6933
|
+
case "none":
|
|
6934
|
+
return tone === "none" ? "" : bgClass ?? palette.subtleBg;
|
|
6922
6935
|
case "outlined":
|
|
6923
6936
|
return [base, borderClass ?? palette.outlineBorder].join(" ");
|
|
6924
6937
|
case "subtle":
|
|
@@ -6951,7 +6964,15 @@ var getRawSurfaceVariantClasses = (variant, tone, overrides = {}) => {
|
|
|
6951
6964
|
return [bgClass ?? "", base].join(" ");
|
|
6952
6965
|
}
|
|
6953
6966
|
};
|
|
6954
|
-
var getPanelToneStyles = (tone) =>
|
|
6967
|
+
var getPanelToneStyles = (tone = DEFAULT_SURFACE_TONE) => tone === "none" ? {
|
|
6968
|
+
...currentTheme.panel.neutral,
|
|
6969
|
+
subtleBg: "bg-white dark:bg-neutral-900",
|
|
6970
|
+
tonalBg: "bg-white dark:bg-neutral-900",
|
|
6971
|
+
glassBg: "bg-white/40 dark:bg-neutral-900/20",
|
|
6972
|
+
liquidBg: "bg-white/45 dark:bg-neutral-900/15",
|
|
6973
|
+
decorationShape: "",
|
|
6974
|
+
decorationGradient: ""
|
|
6975
|
+
} : currentTheme.panel[tone] ?? currentTheme.panel.neutral;
|
|
6955
6976
|
var getSurfaceVariantClasses = (variant, tone, overrides = {}) => getSurfaceTransparencyClasses(getRawSurfaceVariantClasses(variant, tone, overrides), variant, overrides.transparency);
|
|
6956
6977
|
var getStepperTonePalette = (tone) => currentTheme.stepper[tone] ?? currentTheme.stepper.blue;
|
|
6957
6978
|
var getBadgeColorClasses = (color2) => currentTheme.badge[color2] ?? currentTheme.badge.blue;
|
|
@@ -8729,6 +8750,13 @@ function getLocalizedParseNames(locale, catalog) {
|
|
|
8729
8750
|
// ../common/i18n/builtIn/de.ts
|
|
8730
8751
|
var DE_KIT_CATALOG = {
|
|
8731
8752
|
kit: {
|
|
8753
|
+
codeBlock: {
|
|
8754
|
+
code: "Code",
|
|
8755
|
+
edit: "Code bearbeiten",
|
|
8756
|
+
copy: "Code kopieren",
|
|
8757
|
+
copied: "Kopiert",
|
|
8758
|
+
copyFailed: "Kopieren fehlgeschlagen. Code ausw\xE4hlen und manuell kopieren."
|
|
8759
|
+
},
|
|
8732
8760
|
knowledge: {
|
|
8733
8761
|
"library": "Erinnerungsbibliothek",
|
|
8734
8762
|
"map": "Wissenskarte",
|
|
@@ -9001,6 +9029,20 @@ var DE_KIT_CATALOG = {
|
|
|
9001
9029
|
progressspinner: {
|
|
9002
9030
|
loading: "Wird geladen"
|
|
9003
9031
|
},
|
|
9032
|
+
filterbar: {
|
|
9033
|
+
filters: "Filter",
|
|
9034
|
+
search: "Suchen",
|
|
9035
|
+
empty: "Keine Filter angewendet",
|
|
9036
|
+
add: "Filter hinzuf\xFCgen",
|
|
9037
|
+
filterBy: "Filtern nach",
|
|
9038
|
+
back: "Zur\xFCck",
|
|
9039
|
+
clear: "Leeren",
|
|
9040
|
+
done: "Fertig",
|
|
9041
|
+
clearAll: "Alle l\xF6schen",
|
|
9042
|
+
items: "Eintr\xE4ge",
|
|
9043
|
+
summary: "{filtered} von {total} {items}",
|
|
9044
|
+
remove: "Filter {label} entfernen"
|
|
9045
|
+
},
|
|
9004
9046
|
searchbar: {
|
|
9005
9047
|
clearAria: "Suche l\xF6schen",
|
|
9006
9048
|
placeholder: "Suchen..."
|
|
@@ -9225,6 +9267,13 @@ var DE_KIT_CATALOG = {
|
|
|
9225
9267
|
// ../common/i18n/builtIn/en.ts
|
|
9226
9268
|
var EN_KIT_CATALOG = {
|
|
9227
9269
|
kit: {
|
|
9270
|
+
codeBlock: {
|
|
9271
|
+
code: "Code",
|
|
9272
|
+
edit: "Edit code",
|
|
9273
|
+
copy: "Copy code",
|
|
9274
|
+
copied: "Copied",
|
|
9275
|
+
copyFailed: "Could not copy code. Select and copy it manually."
|
|
9276
|
+
},
|
|
9228
9277
|
knowledge: {
|
|
9229
9278
|
"library": "Memory library",
|
|
9230
9279
|
"map": "Knowledge map",
|
|
@@ -9497,6 +9546,20 @@ var EN_KIT_CATALOG = {
|
|
|
9497
9546
|
progressspinner: {
|
|
9498
9547
|
loading: "Loading"
|
|
9499
9548
|
},
|
|
9549
|
+
filterbar: {
|
|
9550
|
+
filters: "Filters",
|
|
9551
|
+
search: "Search",
|
|
9552
|
+
empty: "No filters applied",
|
|
9553
|
+
add: "Add filter",
|
|
9554
|
+
filterBy: "Filter by",
|
|
9555
|
+
back: "Back",
|
|
9556
|
+
clear: "Clear",
|
|
9557
|
+
done: "Done",
|
|
9558
|
+
clearAll: "Clear all",
|
|
9559
|
+
items: "items",
|
|
9560
|
+
summary: "{filtered} of {total} {items}",
|
|
9561
|
+
remove: "Remove {label} filter"
|
|
9562
|
+
},
|
|
9500
9563
|
searchbar: {
|
|
9501
9564
|
clearAria: "Clear search",
|
|
9502
9565
|
placeholder: "Search..."
|
|
@@ -9721,6 +9784,13 @@ var EN_KIT_CATALOG = {
|
|
|
9721
9784
|
// ../common/i18n/builtIn/es.ts
|
|
9722
9785
|
var ES_KIT_CATALOG = {
|
|
9723
9786
|
kit: {
|
|
9787
|
+
codeBlock: {
|
|
9788
|
+
code: "C\xF3digo",
|
|
9789
|
+
edit: "Editar c\xF3digo",
|
|
9790
|
+
copy: "Copiar c\xF3digo",
|
|
9791
|
+
copied: "Copiado",
|
|
9792
|
+
copyFailed: "No se pudo copiar. Selecciona y copia el c\xF3digo manualmente."
|
|
9793
|
+
},
|
|
9724
9794
|
knowledge: {
|
|
9725
9795
|
"library": "Biblioteca de memorias",
|
|
9726
9796
|
"map": "Mapa de conocimiento",
|
|
@@ -9993,6 +10063,20 @@ var ES_KIT_CATALOG = {
|
|
|
9993
10063
|
progressspinner: {
|
|
9994
10064
|
loading: "Cargando"
|
|
9995
10065
|
},
|
|
10066
|
+
filterbar: {
|
|
10067
|
+
filters: "Filtros",
|
|
10068
|
+
search: "Buscar",
|
|
10069
|
+
empty: "Sin filtros aplicados",
|
|
10070
|
+
add: "A\xF1adir filtro",
|
|
10071
|
+
filterBy: "Filtrar por",
|
|
10072
|
+
back: "Volver",
|
|
10073
|
+
clear: "Limpiar",
|
|
10074
|
+
done: "Listo",
|
|
10075
|
+
clearAll: "Borrar todos",
|
|
10076
|
+
items: "elementos",
|
|
10077
|
+
summary: "{filtered} de {total} {items}",
|
|
10078
|
+
remove: "Eliminar filtro {label}"
|
|
10079
|
+
},
|
|
9996
10080
|
searchbar: {
|
|
9997
10081
|
clearAria: "Borrar b\xFAsqueda",
|
|
9998
10082
|
placeholder: "Buscar..."
|
|
@@ -10217,6 +10301,13 @@ var ES_KIT_CATALOG = {
|
|
|
10217
10301
|
// ../common/i18n/builtIn/fr.ts
|
|
10218
10302
|
var FR_KIT_CATALOG = {
|
|
10219
10303
|
kit: {
|
|
10304
|
+
codeBlock: {
|
|
10305
|
+
code: "Code",
|
|
10306
|
+
edit: "Modifier le code",
|
|
10307
|
+
copy: "Copier le code",
|
|
10308
|
+
copied: "Copi\xE9",
|
|
10309
|
+
copyFailed: "Copie impossible. S\xE9lectionnez et copiez le code manuellement."
|
|
10310
|
+
},
|
|
10220
10311
|
knowledge: {
|
|
10221
10312
|
"library": "Biblioth\xE8que de m\xE9moires",
|
|
10222
10313
|
"map": "Carte des connaissances",
|
|
@@ -10489,6 +10580,20 @@ var FR_KIT_CATALOG = {
|
|
|
10489
10580
|
progressspinner: {
|
|
10490
10581
|
loading: "Chargement"
|
|
10491
10582
|
},
|
|
10583
|
+
filterbar: {
|
|
10584
|
+
filters: "Filtres",
|
|
10585
|
+
search: "Rechercher",
|
|
10586
|
+
empty: "Aucun filtre appliqu\xE9",
|
|
10587
|
+
add: "Ajouter un filtre",
|
|
10588
|
+
filterBy: "Filtrer par",
|
|
10589
|
+
back: "Retour",
|
|
10590
|
+
clear: "Effacer",
|
|
10591
|
+
done: "Termin\xE9",
|
|
10592
|
+
clearAll: "Tout effacer",
|
|
10593
|
+
items: "\xE9l\xE9ments",
|
|
10594
|
+
summary: "{filtered} sur {total} {items}",
|
|
10595
|
+
remove: "Supprimer le filtre {label}"
|
|
10596
|
+
},
|
|
10492
10597
|
searchbar: {
|
|
10493
10598
|
clearAria: "Effacer la recherche",
|
|
10494
10599
|
placeholder: "Rechercher..."
|
|
@@ -10713,6 +10818,13 @@ var FR_KIT_CATALOG = {
|
|
|
10713
10818
|
// ../common/i18n/builtIn/pt.ts
|
|
10714
10819
|
var PT_KIT_CATALOG = {
|
|
10715
10820
|
kit: {
|
|
10821
|
+
codeBlock: {
|
|
10822
|
+
code: "C\xF3digo",
|
|
10823
|
+
edit: "Editar c\xF3digo",
|
|
10824
|
+
copy: "Copiar c\xF3digo",
|
|
10825
|
+
copied: "Copiado",
|
|
10826
|
+
copyFailed: "N\xE3o foi poss\xEDvel copiar. Selecione e copie o c\xF3digo manualmente."
|
|
10827
|
+
},
|
|
10716
10828
|
knowledge: {
|
|
10717
10829
|
"library": "Biblioteca de mem\xF3rias",
|
|
10718
10830
|
"map": "Mapa de conhecimento",
|
|
@@ -10985,6 +11097,20 @@ var PT_KIT_CATALOG = {
|
|
|
10985
11097
|
progressspinner: {
|
|
10986
11098
|
loading: "Carregando"
|
|
10987
11099
|
},
|
|
11100
|
+
filterbar: {
|
|
11101
|
+
filters: "Filtros",
|
|
11102
|
+
search: "Pesquisar",
|
|
11103
|
+
empty: "Nenhum filtro aplicado",
|
|
11104
|
+
add: "Adicionar filtro",
|
|
11105
|
+
filterBy: "Filtrar por",
|
|
11106
|
+
back: "Voltar",
|
|
11107
|
+
clear: "Limpar",
|
|
11108
|
+
done: "Conclu\xEDdo",
|
|
11109
|
+
clearAll: "Limpar todos",
|
|
11110
|
+
items: "itens",
|
|
11111
|
+
summary: "{filtered} de {total} {items}",
|
|
11112
|
+
remove: "Remover filtro {label}"
|
|
11113
|
+
},
|
|
10988
11114
|
searchbar: {
|
|
10989
11115
|
clearAria: "Limpar busca",
|
|
10990
11116
|
placeholder: "Buscar..."
|
|
@@ -12060,6 +12186,7 @@ function hasInteractiveDescendant(root) {
|
|
|
12060
12186
|
// src/components/Panel.tsx
|
|
12061
12187
|
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
12062
12188
|
var variantBaseStyles = {
|
|
12189
|
+
none: "",
|
|
12063
12190
|
elevated: "bg-white shadow-xl ring-1 ring-black/5 dark:bg-neutral-900 dark:ring-white/10",
|
|
12064
12191
|
// A real 1px border, not a ring. `ring-1` with no ring colour resolves to
|
|
12065
12192
|
// currentColor, which painted a near-black rule in light mode.
|
|
@@ -12077,6 +12204,8 @@ var getPanelEdgeChrome = (variant, tone, glassOpacity = "frosted", vibrancy = "m
|
|
|
12077
12204
|
const palette = getPanelToneStyles(tone);
|
|
12078
12205
|
const chrome = (() => {
|
|
12079
12206
|
switch (variant) {
|
|
12207
|
+
case "none":
|
|
12208
|
+
return { fill: tone === "none" ? "" : palette.subtleBg, border: "", backdrop: "" };
|
|
12080
12209
|
case "outlined":
|
|
12081
12210
|
return {
|
|
12082
12211
|
fill: "bg-white/90 dark:bg-neutral-900/80",
|
|
@@ -12323,7 +12452,7 @@ var Panel = import_react158.default.forwardRef(function Panel2({
|
|
|
12323
12452
|
if (specularHighlight === false) return "none";
|
|
12324
12453
|
return "classic";
|
|
12325
12454
|
})();
|
|
12326
|
-
const effectiveHoverColor = hoverColor ?? (
|
|
12455
|
+
const effectiveHoverColor = hoverColor ?? (resolvedTone !== "none" && resolvedTone !== "neutral" ? resolvedTone : void 0);
|
|
12327
12456
|
const hoverColorName = effectiveHoverColor ? effectiveHoverColor : void 0;
|
|
12328
12457
|
const borderPalette = borderColor ? getPanelToneStyles(borderColor) : void 0;
|
|
12329
12458
|
const effectiveBorderClass = borderPalette?.border;
|
|
@@ -12358,6 +12487,8 @@ var Panel = import_react158.default.forwardRef(function Panel2({
|
|
|
12358
12487
|
const glassFillClass = getSurfaceGlassFillClass(resolvedTone, glassOpacity);
|
|
12359
12488
|
const variantClasses = getSurfaceTransparencyClasses((0, import_classnames7.default)((() => {
|
|
12360
12489
|
switch (variant) {
|
|
12490
|
+
case "none":
|
|
12491
|
+
return resolvedTone === "none" ? "" : palette.subtleBg;
|
|
12361
12492
|
case "outlined":
|
|
12362
12493
|
return (0, import_classnames7.default)(
|
|
12363
12494
|
variantBaseStyles.outlined,
|
|
@@ -12898,8 +13029,8 @@ var ActionPanel = import_react159.default.forwardRef(
|
|
|
12898
13029
|
}, ref) {
|
|
12899
13030
|
const renderIcon2 = useIconRenderer();
|
|
12900
13031
|
const generatedTitleId = (0, import_react159.useId)();
|
|
12901
|
-
const resolvedTone = tone ?? color2 ?? "
|
|
12902
|
-
const resolvedAccent = accentColor ?? resolvedTone;
|
|
13032
|
+
const resolvedTone = tone ?? color2 ?? "none";
|
|
13033
|
+
const resolvedAccent = accentColor ?? getSurfaceAccentColor(resolvedTone);
|
|
12903
13034
|
const palette = getPanelToneStyles(resolvedAccent);
|
|
12904
13035
|
const surfaceText = getSurfaceTextTokens(variant);
|
|
12905
13036
|
const sizeTokens12 = SIZE_TOKENS[size] ?? SIZE_TOKENS.sm;
|
|
@@ -14149,7 +14280,8 @@ var EmptyState = import_react165.default.forwardRef(
|
|
|
14149
14280
|
...rest
|
|
14150
14281
|
}, ref) => {
|
|
14151
14282
|
const titleId = (0, import_react165.useId)();
|
|
14152
|
-
const
|
|
14283
|
+
const surfaceTone = tone ?? color2 ?? "none";
|
|
14284
|
+
const effectiveTone = getSurfaceAccentColor(surfaceTone);
|
|
14153
14285
|
const iconTone = iconColor ?? effectiveTone;
|
|
14154
14286
|
const effectiveSize = size ?? textSize ?? "md";
|
|
14155
14287
|
const sizeToken = SIZE_STYLES3[effectiveSize] ?? SIZE_STYLES3.md;
|
|
@@ -14213,7 +14345,7 @@ var EmptyState = import_react165.default.forwardRef(
|
|
|
14213
14345
|
{
|
|
14214
14346
|
ref,
|
|
14215
14347
|
variant: effectiveVariant,
|
|
14216
|
-
tone:
|
|
14348
|
+
tone: surfaceTone,
|
|
14217
14349
|
corner,
|
|
14218
14350
|
padding,
|
|
14219
14351
|
fullWidth,
|
|
@@ -15359,7 +15491,7 @@ var PanelHero = ({
|
|
|
15359
15491
|
children,
|
|
15360
15492
|
...rest
|
|
15361
15493
|
}) => {
|
|
15362
|
-
const accent = tone ?? color2 ?? "
|
|
15494
|
+
const accent = getSurfaceAccentColor(tone ?? color2 ?? "none");
|
|
15363
15495
|
const effectiveCorner = corner ?? (rounded ? DEFAULT_SURFACE_CORNER : "none");
|
|
15364
15496
|
const showShapes = decoration === "shapes" || decoration === "both";
|
|
15365
15497
|
const showGradient = decoration === "gradient" || decoration === "both";
|
|
@@ -15382,7 +15514,7 @@ var PanelHero = ({
|
|
|
15382
15514
|
{
|
|
15383
15515
|
className: (0, import_classnames22.default)("w-full", className),
|
|
15384
15516
|
variant,
|
|
15385
|
-
tone:
|
|
15517
|
+
tone: tone ?? "none",
|
|
15386
15518
|
corner: effectiveCorner,
|
|
15387
15519
|
padding,
|
|
15388
15520
|
decoration,
|
|
@@ -15431,7 +15563,7 @@ var PanelHero = ({
|
|
|
15431
15563
|
backgroundImage: `linear-gradient(to bottom right, ${stopFrom}, ${stopTo})`
|
|
15432
15564
|
},
|
|
15433
15565
|
"data-variant": "gradient",
|
|
15434
|
-
"data-tone":
|
|
15566
|
+
"data-tone": tone ?? "none",
|
|
15435
15567
|
...rest,
|
|
15436
15568
|
children: [
|
|
15437
15569
|
showShapes && /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(import_jsx_runtime174.Fragment, { children: [
|
|
@@ -15895,7 +16027,7 @@ var ExpandableButton = (0, import_react171.forwardRef)(
|
|
|
15895
16027
|
fadeDuration,
|
|
15896
16028
|
labelGap,
|
|
15897
16029
|
labelSlide,
|
|
15898
|
-
elevate =
|
|
16030
|
+
elevate = false,
|
|
15899
16031
|
iconMotion = "pop-tilt",
|
|
15900
16032
|
squish = true,
|
|
15901
16033
|
labelPlacement = "after",
|
|
@@ -18854,6 +18986,7 @@ var Combobox = import_react184.default.forwardRef(
|
|
|
18854
18986
|
leadingIcon,
|
|
18855
18987
|
visibleRows = 6,
|
|
18856
18988
|
panelVariant = "auto",
|
|
18989
|
+
panelTone = "auto",
|
|
18857
18990
|
panelCorner = "auto",
|
|
18858
18991
|
className,
|
|
18859
18992
|
listClassName,
|
|
@@ -18999,7 +19132,7 @@ var Combobox = import_react184.default.forwardRef(
|
|
|
18999
19132
|
Panel_default,
|
|
19000
19133
|
{
|
|
19001
19134
|
variant: resolvedPanelVariant,
|
|
19002
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
19135
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
19003
19136
|
corner: panelCorner,
|
|
19004
19137
|
padding: "none",
|
|
19005
19138
|
scrollable: false,
|
|
@@ -19159,7 +19292,7 @@ Combobox.displayName = "Combobox";
|
|
|
19159
19292
|
var Combobox_default = Combobox;
|
|
19160
19293
|
|
|
19161
19294
|
// src/components/Picker.tsx
|
|
19162
|
-
var import_react185 = require("react");
|
|
19295
|
+
var import_react185 = __toESM(require("react"), 1);
|
|
19163
19296
|
var import_react_dom5 = require("react-dom");
|
|
19164
19297
|
var import_classnames38 = __toESM(require("classnames"), 1);
|
|
19165
19298
|
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
@@ -19228,12 +19361,14 @@ var Picker = ({
|
|
|
19228
19361
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
19229
19362
|
validationStatus = "none",
|
|
19230
19363
|
panelVariant = "auto",
|
|
19364
|
+
panelTone = "auto",
|
|
19231
19365
|
panelCorner = "auto",
|
|
19232
19366
|
disabled = false,
|
|
19233
19367
|
multi = false,
|
|
19234
19368
|
selectedIds: selectedIdsProp,
|
|
19235
19369
|
onMultiChange,
|
|
19236
19370
|
maxPillsShown = 3,
|
|
19371
|
+
groupSelectable = false,
|
|
19237
19372
|
size = "md",
|
|
19238
19373
|
fullWidth = true,
|
|
19239
19374
|
fullHeight = false
|
|
@@ -19283,10 +19418,21 @@ var Picker = ({
|
|
|
19283
19418
|
);
|
|
19284
19419
|
const filtered = (0, import_react185.useMemo)(() => {
|
|
19285
19420
|
const q = query.trim().toLowerCase();
|
|
19286
|
-
|
|
19287
|
-
return baseItems.filter(
|
|
19421
|
+
const matched = !q ? baseItems : baseItems.filter(
|
|
19288
19422
|
(item) => (item.textValue ?? item.title ?? item.id).toLowerCase().includes(q) || (item.subtitle ?? "").toLowerCase().includes(q) || (item.description ?? "").toLowerCase().includes(q) || (item.tags ?? []).some((t2) => t2.label.toLowerCase().includes(q))
|
|
19289
19423
|
);
|
|
19424
|
+
if (!matched.some((item) => item.group)) return matched;
|
|
19425
|
+
const order = [];
|
|
19426
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
19427
|
+
for (const item of matched) {
|
|
19428
|
+
const key = item.group ?? "";
|
|
19429
|
+
if (!buckets.has(key)) {
|
|
19430
|
+
buckets.set(key, []);
|
|
19431
|
+
order.push(key);
|
|
19432
|
+
}
|
|
19433
|
+
buckets.get(key).push(item);
|
|
19434
|
+
}
|
|
19435
|
+
return order.flatMap((key) => buckets.get(key));
|
|
19290
19436
|
}, [baseItems, query]);
|
|
19291
19437
|
const updatePosition = (0, import_react185.useCallback)(() => {
|
|
19292
19438
|
if (!open || !triggerRef.current || !dropdownRef.current) return;
|
|
@@ -19418,6 +19564,13 @@ var Picker = ({
|
|
|
19418
19564
|
setQuery("");
|
|
19419
19565
|
}
|
|
19420
19566
|
};
|
|
19567
|
+
const handleToggleGroup = (group) => {
|
|
19568
|
+
const ids = filtered.filter((i) => i.group === group).map((i) => i.id);
|
|
19569
|
+
const allOn = ids.every((id) => effectiveSelectedIds.includes(id));
|
|
19570
|
+
onMultiChange?.(
|
|
19571
|
+
allOn ? effectiveSelectedIds.filter((id) => !ids.includes(id)) : [...effectiveSelectedIds, ...ids.filter((id) => !effectiveSelectedIds.includes(id))]
|
|
19572
|
+
);
|
|
19573
|
+
};
|
|
19421
19574
|
const handleClearMulti = () => {
|
|
19422
19575
|
onMultiChange?.([]);
|
|
19423
19576
|
};
|
|
@@ -19439,7 +19592,7 @@ var Picker = ({
|
|
|
19439
19592
|
Panel_default,
|
|
19440
19593
|
{
|
|
19441
19594
|
variant: resolvedPanelVariant,
|
|
19442
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
19595
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
19443
19596
|
corner: panelCorner,
|
|
19444
19597
|
padding: "none",
|
|
19445
19598
|
scrollable: false,
|
|
@@ -19541,14 +19694,19 @@ var Picker = ({
|
|
|
19541
19694
|
}
|
|
19542
19695
|
)
|
|
19543
19696
|
] }),
|
|
19544
|
-
multi &&
|
|
19697
|
+
multi && /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
19545
19698
|
"button",
|
|
19546
19699
|
{
|
|
19547
19700
|
type: "button",
|
|
19701
|
+
disabled: effectiveSelectedIds.length === 0,
|
|
19548
19702
|
onMouseDown: (e) => e.preventDefault(),
|
|
19549
19703
|
onClick: handleClearMulti,
|
|
19550
19704
|
className: (0, import_classnames38.default)(
|
|
19551
|
-
|
|
19705
|
+
// Always rendered: mounting it on the first pick pushed the
|
|
19706
|
+
// list down and resized the popup (flicker). Hidden, not
|
|
19707
|
+
// removed, while nothing is selected.
|
|
19708
|
+
"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",
|
|
19709
|
+
effectiveSelectedIds.length > 0 ? "cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800/60" : "invisible",
|
|
19552
19710
|
popupText.muted
|
|
19553
19711
|
),
|
|
19554
19712
|
children: [
|
|
@@ -19595,12 +19753,77 @@ var Picker = ({
|
|
|
19595
19753
|
"aria-multiselectable": multi || void 0,
|
|
19596
19754
|
children: filtered.map((item, index) => {
|
|
19597
19755
|
const isSelected = effectiveSelectedIds.includes(item.id);
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19756
|
+
const showHeader = !!item.group && item.group !== filtered[index - 1]?.group;
|
|
19757
|
+
let header = null;
|
|
19758
|
+
if (showHeader) {
|
|
19759
|
+
const g = item.group;
|
|
19760
|
+
const members = filtered.filter((i) => i.group === g);
|
|
19761
|
+
const on = members.filter(
|
|
19762
|
+
(i) => effectiveSelectedIds.includes(i.id)
|
|
19763
|
+
).length;
|
|
19764
|
+
const state = on === 0 ? "none" : on === members.length ? "all" : "some";
|
|
19765
|
+
const selectable = multi && groupSelectable;
|
|
19766
|
+
const label = /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_jsx_runtime191.Fragment, { children: [
|
|
19767
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
19768
|
+
"span",
|
|
19769
|
+
{
|
|
19770
|
+
className: (0, import_classnames38.default)(
|
|
19771
|
+
"flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",
|
|
19772
|
+
state === "none" ? "border-neutral-300 dark:border-neutral-600" : (0, import_classnames38.default)(
|
|
19773
|
+
colorTokens.optionSelectedBg,
|
|
19774
|
+
"border-current",
|
|
19775
|
+
colorTokens.optionSelectedIcon
|
|
19776
|
+
)
|
|
19777
|
+
),
|
|
19778
|
+
children: state !== "none" && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
19779
|
+
"svg",
|
|
19780
|
+
{
|
|
19781
|
+
className: "h-3.5 w-3.5",
|
|
19782
|
+
viewBox: "0 0 24 24",
|
|
19783
|
+
fill: "none",
|
|
19784
|
+
stroke: "currentColor",
|
|
19785
|
+
strokeWidth: 2.5,
|
|
19786
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
19787
|
+
"path",
|
|
19788
|
+
{
|
|
19789
|
+
strokeLinecap: "round",
|
|
19790
|
+
strokeLinejoin: "round",
|
|
19791
|
+
d: state === "all" ? "m5 13 4 4L19 7" : "M6 12h12"
|
|
19792
|
+
}
|
|
19793
|
+
)
|
|
19794
|
+
}
|
|
19795
|
+
)
|
|
19796
|
+
}
|
|
19797
|
+
),
|
|
19798
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)("span", { className: "flex-1 truncate text-left", children: g }),
|
|
19799
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)("span", { className: "shrink-0 tabular-nums", children: [
|
|
19800
|
+
on,
|
|
19801
|
+
"/",
|
|
19802
|
+
members.length
|
|
19803
|
+
] })
|
|
19804
|
+
] });
|
|
19805
|
+
const headerClass = (0, import_classnames38.default)(
|
|
19806
|
+
"flex w-full items-center gap-3 px-4 py-1.5 text-[11px] font-semibold uppercase tracking-wide",
|
|
19807
|
+
popupText.muted
|
|
19808
|
+
);
|
|
19809
|
+
header = /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("li", { role: "presentation", className: "m-0 list-none p-0", children: selectable ? /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
19810
|
+
"button",
|
|
19811
|
+
{
|
|
19812
|
+
type: "button",
|
|
19813
|
+
role: "checkbox",
|
|
19814
|
+
"aria-checked": state === "all" ? true : state === "some" ? "mixed" : false,
|
|
19815
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
19816
|
+
onClick: () => handleToggleGroup(g),
|
|
19817
|
+
className: (0, import_classnames38.default)(
|
|
19818
|
+
headerClass,
|
|
19819
|
+
"cursor-pointer border-0 bg-transparent hover:bg-neutral-50 dark:hover:bg-neutral-800/60"
|
|
19820
|
+
),
|
|
19821
|
+
children: label
|
|
19822
|
+
}
|
|
19823
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("div", { className: headerClass, children: label }) });
|
|
19824
|
+
}
|
|
19825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_react185.default.Fragment, { children: [
|
|
19826
|
+
header,
|
|
19604
19827
|
/* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
19605
19828
|
"li",
|
|
19606
19829
|
{
|
|
@@ -19733,10 +19956,9 @@ var Picker = ({
|
|
|
19733
19956
|
ti
|
|
19734
19957
|
)) })
|
|
19735
19958
|
]
|
|
19736
|
-
}
|
|
19737
|
-
item.id
|
|
19959
|
+
}
|
|
19738
19960
|
)
|
|
19739
|
-
);
|
|
19961
|
+
] }, item.id);
|
|
19740
19962
|
})
|
|
19741
19963
|
}
|
|
19742
19964
|
)
|
|
@@ -20063,6 +20285,7 @@ var TagPicker = ({
|
|
|
20063
20285
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
20064
20286
|
validationStatus = "none",
|
|
20065
20287
|
panelVariant = "auto",
|
|
20288
|
+
panelTone = "auto",
|
|
20066
20289
|
panelCorner = "auto",
|
|
20067
20290
|
tagLimit = 3,
|
|
20068
20291
|
highlightNew = true,
|
|
@@ -20246,7 +20469,7 @@ var TagPicker = ({
|
|
|
20246
20469
|
const idx = filtered.findIndex((item) => selectedSet.has(item.id));
|
|
20247
20470
|
setFocusedIndex(idx >= 0 ? idx : multi || filtered.length === 0 ? -1 : 0);
|
|
20248
20471
|
}, [open]);
|
|
20249
|
-
const
|
|
20472
|
+
const normalize2 = (0, import_react186.useCallback)(
|
|
20250
20473
|
(v) => normalizeValue ? normalizeValue(v) : v,
|
|
20251
20474
|
[normalizeValue]
|
|
20252
20475
|
);
|
|
@@ -20256,7 +20479,7 @@ var TagPicker = ({
|
|
|
20256
20479
|
filtered.findIndex((candidate) => candidate.id === item.id)
|
|
20257
20480
|
);
|
|
20258
20481
|
setCursorByKeyboard(fromKeyboard);
|
|
20259
|
-
const id =
|
|
20482
|
+
const id = normalize2(item.id);
|
|
20260
20483
|
if (!multi) {
|
|
20261
20484
|
onChange([id]);
|
|
20262
20485
|
setOpen(false);
|
|
@@ -20269,14 +20492,14 @@ var TagPicker = ({
|
|
|
20269
20492
|
onChange([...value, id]);
|
|
20270
20493
|
}
|
|
20271
20494
|
},
|
|
20272
|
-
[multi,
|
|
20495
|
+
[multi, normalize2, onChange, selectedSet, value, filtered]
|
|
20273
20496
|
);
|
|
20274
20497
|
const handleRemove = (0, import_react186.useCallback)(
|
|
20275
20498
|
(v) => onChange(value.filter((x) => x !== v)),
|
|
20276
20499
|
[onChange, value]
|
|
20277
20500
|
);
|
|
20278
20501
|
const handleCreate = (0, import_react186.useCallback)(() => {
|
|
20279
|
-
const label =
|
|
20502
|
+
const label = normalize2(query.trim());
|
|
20280
20503
|
if (!label) return;
|
|
20281
20504
|
if (onCreateItem) {
|
|
20282
20505
|
onCreateItem(label);
|
|
@@ -20287,7 +20510,7 @@ var TagPicker = ({
|
|
|
20287
20510
|
}
|
|
20288
20511
|
if (!multi) setOpen(false);
|
|
20289
20512
|
setQuery("");
|
|
20290
|
-
}, [query,
|
|
20513
|
+
}, [query, normalize2, onCreateItem, multi, onChange, value]);
|
|
20291
20514
|
const handleKeyDown = (e) => {
|
|
20292
20515
|
if (e.key === "ArrowDown") {
|
|
20293
20516
|
e.preventDefault();
|
|
@@ -20323,7 +20546,7 @@ var TagPicker = ({
|
|
|
20323
20546
|
Panel_default,
|
|
20324
20547
|
{
|
|
20325
20548
|
variant: resolvedPanelVariant,
|
|
20326
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
20549
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
20327
20550
|
corner: panelCorner,
|
|
20328
20551
|
padding: "none",
|
|
20329
20552
|
scrollable: false,
|
|
@@ -21976,7 +22199,7 @@ function StackCarousel({
|
|
|
21976
22199
|
getItemLabel,
|
|
21977
22200
|
emptyState = "No items to display.",
|
|
21978
22201
|
variant = "elevated",
|
|
21979
|
-
tone = "
|
|
22202
|
+
tone: surfaceTone = "none",
|
|
21980
22203
|
corner = "auto",
|
|
21981
22204
|
padding = "sm",
|
|
21982
22205
|
transparency,
|
|
@@ -22024,8 +22247,8 @@ function StackCarousel({
|
|
|
22024
22247
|
setExpanded(true);
|
|
22025
22248
|
}, Math.max(0, Number.isFinite(hoverExpandDelay) ? hoverExpandDelay : 2e3));
|
|
22026
22249
|
};
|
|
22027
|
-
const
|
|
22028
|
-
const index =
|
|
22250
|
+
const normalize2 = (0, import_react190.useCallback)((value) => loop ? wrap(value, items.length) : Math.max(0, Math.min(items.length - 1, Math.trunc(value))), [loop, items.length]);
|
|
22251
|
+
const index = normalize2(Number.isFinite(activeIndex ?? internalIndex) ? activeIndex ?? internalIndex : 0);
|
|
22029
22252
|
const layers = Math.min(loop ? items.length : items.length - index, Math.max(1, Math.min(3, Math.trunc(visibleCount) || 1)));
|
|
22030
22253
|
const offset = Math.max(0, Number.isFinite(stackOffset) ? stackOffset : 12);
|
|
22031
22254
|
const rootRef = (0, import_react190.useRef)(null);
|
|
@@ -22043,14 +22266,14 @@ function StackCarousel({
|
|
|
22043
22266
|
}, [isExpanded]);
|
|
22044
22267
|
const navigate = (0, import_react190.useCallback)((next, focus = false) => {
|
|
22045
22268
|
if (items.length < 2) return;
|
|
22046
|
-
const normalized =
|
|
22269
|
+
const normalized = normalize2(next);
|
|
22047
22270
|
if (normalized === index) return;
|
|
22048
22271
|
if (focus || measureRef.current?.contains(document.activeElement)) {
|
|
22049
22272
|
rootRef.current?.focus({ preventScroll: true });
|
|
22050
22273
|
}
|
|
22051
22274
|
if (activeIndex === void 0) setInternalIndex(normalized);
|
|
22052
22275
|
onActiveIndexChange?.(normalized);
|
|
22053
|
-
}, [items.length, index, activeIndex, onActiveIndexChange,
|
|
22276
|
+
}, [items.length, index, activeIndex, onActiveIndexChange, normalize2]);
|
|
22054
22277
|
(0, import_react190.useLayoutEffect)(() => {
|
|
22055
22278
|
const old = previousIndex.current;
|
|
22056
22279
|
previousIndex.current = index;
|
|
@@ -22113,7 +22336,7 @@ function StackCarousel({
|
|
|
22113
22336
|
root.addEventListener("wheel", handleWheel, { passive: false });
|
|
22114
22337
|
return () => root.removeEventListener("wheel", handleWheel);
|
|
22115
22338
|
}, [wheel, isExpanded, items.length, index, navigate, canScrollInside]);
|
|
22116
|
-
const visible = isExpanded ? items.map((_, i) => i) : Array.from({ length: layers }, (_, rank) =>
|
|
22339
|
+
const visible = isExpanded ? items.map((_, i) => i) : Array.from({ length: layers }, (_, rank) => normalize2(index + rank));
|
|
22117
22340
|
const rendered = [...visible];
|
|
22118
22341
|
const transitionFrom = previousIndex.current !== index ? previousIndex.current : outgoing;
|
|
22119
22342
|
if (!isExpanded && transitionFrom !== null && transitionFrom < items.length && !rendered.includes(transitionFrom)) rendered.push(transitionFrom);
|
|
@@ -22221,7 +22444,7 @@ function StackCarousel({
|
|
|
22221
22444
|
Panel_default,
|
|
22222
22445
|
{
|
|
22223
22446
|
variant,
|
|
22224
|
-
tone,
|
|
22447
|
+
tone: surfaceTone,
|
|
22225
22448
|
corner,
|
|
22226
22449
|
padding,
|
|
22227
22450
|
transparency,
|
|
@@ -23005,7 +23228,7 @@ var TraceGraph = (0, import_react191.forwardRef)(function TraceGraph2({
|
|
|
23005
23228
|
flareSize,
|
|
23006
23229
|
pulseScale,
|
|
23007
23230
|
junctionGlowIntensity = 1,
|
|
23008
|
-
tone = "
|
|
23231
|
+
tone = "none",
|
|
23009
23232
|
variant = "outlined",
|
|
23010
23233
|
corner = "auto",
|
|
23011
23234
|
padding = "none",
|
|
@@ -23314,7 +23537,7 @@ var TraceGraph = (0, import_react191.forwardRef)(function TraceGraph2({
|
|
|
23314
23537
|
style: { position: "fixed", zIndex: 100, width: 300, maxWidth: "calc(100vw - 16px)", visibility: "hidden" },
|
|
23315
23538
|
role: showPopover ? "dialog" : "tooltip",
|
|
23316
23539
|
"aria-label": overlayNode.label ?? overlayNode.id,
|
|
23317
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(Panel_default, { variant: "elevated", tone
|
|
23540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(Panel_default, { variant: "elevated", tone, corner, padding: "xs", scrollable: false, children: [
|
|
23318
23541
|
showPopover && /* @__PURE__ */ (0, import_jsx_runtime198.jsx)("button", { type: "button", className: `${buttonClass} float-right ml-2`, "aria-label": copy("close"), onClick: () => {
|
|
23319
23542
|
setDetailsOpen(false);
|
|
23320
23543
|
hostRef.current?.focus();
|
|
@@ -23330,7 +23553,7 @@ var TraceGraph = (0, import_react191.forwardRef)(function TraceGraph2({
|
|
|
23330
23553
|
{
|
|
23331
23554
|
...panelProps,
|
|
23332
23555
|
variant,
|
|
23333
|
-
tone
|
|
23556
|
+
tone,
|
|
23334
23557
|
backgroundColor: tone === "none" ? "neutral" : panelProps.backgroundColor,
|
|
23335
23558
|
style: tone === "none" && variant === "simple" ? { borderWidth: 0, boxShadow: "none", ...panelProps.style } : panelProps.style,
|
|
23336
23559
|
corner,
|
|
@@ -24798,7 +25021,7 @@ var FormSection = ({
|
|
|
24798
25021
|
className,
|
|
24799
25022
|
padding = "md",
|
|
24800
25023
|
variant = "elevated",
|
|
24801
|
-
tone = "
|
|
25024
|
+
tone = "none",
|
|
24802
25025
|
corner = "rounded-md",
|
|
24803
25026
|
vibrancy,
|
|
24804
25027
|
glassOpacity,
|
|
@@ -25438,6 +25661,8 @@ var Toolbar = ({
|
|
|
25438
25661
|
const palette = getPanelToneStyles(tone);
|
|
25439
25662
|
const variantClasses = getSurfaceTransparencyClasses((() => {
|
|
25440
25663
|
switch (variant) {
|
|
25664
|
+
case "none":
|
|
25665
|
+
return tone === "none" ? "" : palette.subtleBg;
|
|
25441
25666
|
case "outlined":
|
|
25442
25667
|
return (0, import_classnames53.default)(variantBaseStyles.outlined, palette.outlineBorder);
|
|
25443
25668
|
case "subtle":
|
|
@@ -25503,7 +25728,7 @@ var PageHeader = ({
|
|
|
25503
25728
|
children,
|
|
25504
25729
|
variant = "default",
|
|
25505
25730
|
accentColor = "blue",
|
|
25506
|
-
tone = "
|
|
25731
|
+
tone = "none",
|
|
25507
25732
|
glassOpacity,
|
|
25508
25733
|
transparency,
|
|
25509
25734
|
vibrancy,
|
|
@@ -26521,7 +26746,7 @@ var Chat2 = ({
|
|
|
26521
26746
|
renderMessage,
|
|
26522
26747
|
onEvent,
|
|
26523
26748
|
variant = "outlined",
|
|
26524
|
-
tone = "
|
|
26749
|
+
tone: surfaceTone = "none",
|
|
26525
26750
|
padding = "none",
|
|
26526
26751
|
className = "",
|
|
26527
26752
|
style,
|
|
@@ -26930,7 +27155,7 @@ var Chat2 = ({
|
|
|
26930
27155
|
{
|
|
26931
27156
|
...rest,
|
|
26932
27157
|
variant,
|
|
26933
|
-
tone,
|
|
27158
|
+
tone: surfaceTone,
|
|
26934
27159
|
padding,
|
|
26935
27160
|
className: (0, import_classnames57.default)("relative overflow-hidden", className),
|
|
26936
27161
|
style: { ...style, height },
|
|
@@ -27283,12 +27508,13 @@ var ActivityFeed = ({
|
|
|
27283
27508
|
loadMoreLabel = "Load more",
|
|
27284
27509
|
totalCount,
|
|
27285
27510
|
variant = "outlined",
|
|
27286
|
-
tone = "
|
|
27511
|
+
tone: surfaceTone = "none",
|
|
27287
27512
|
padding = "md",
|
|
27288
27513
|
corner,
|
|
27289
27514
|
className = "",
|
|
27290
27515
|
...rest
|
|
27291
27516
|
}) => {
|
|
27517
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
27292
27518
|
const [active, setActive] = (0, import_react202.useState)(defaultFilter);
|
|
27293
27519
|
const options = (0, import_react202.useMemo)(
|
|
27294
27520
|
() => [{ label: "All", value: "all" }, ...filters],
|
|
@@ -27307,7 +27533,7 @@ var ActivityFeed = ({
|
|
|
27307
27533
|
{
|
|
27308
27534
|
...rest,
|
|
27309
27535
|
variant,
|
|
27310
|
-
tone,
|
|
27536
|
+
tone: surfaceTone,
|
|
27311
27537
|
padding,
|
|
27312
27538
|
corner,
|
|
27313
27539
|
className: (0, import_classnames58.default)("w-full", className),
|
|
@@ -38393,7 +38619,7 @@ var BreakdownCard = ({
|
|
|
38393
38619
|
loading = false,
|
|
38394
38620
|
ctaVariant,
|
|
38395
38621
|
variant = "outlined",
|
|
38396
|
-
tone = "
|
|
38622
|
+
tone: surfaceTone = "none",
|
|
38397
38623
|
padding = "md",
|
|
38398
38624
|
corner,
|
|
38399
38625
|
className = "",
|
|
@@ -38405,7 +38631,7 @@ var BreakdownCard = ({
|
|
|
38405
38631
|
{
|
|
38406
38632
|
...rest,
|
|
38407
38633
|
variant,
|
|
38408
|
-
tone,
|
|
38634
|
+
tone: surfaceTone,
|
|
38409
38635
|
padding,
|
|
38410
38636
|
corner,
|
|
38411
38637
|
className: (0, import_classnames59.default)("w-full", className),
|
|
@@ -38963,7 +39189,7 @@ var InfoRow = (props) => {
|
|
|
38963
39189
|
value,
|
|
38964
39190
|
hideIfEmpty = true,
|
|
38965
39191
|
variant = "elevated",
|
|
38966
|
-
tone = "
|
|
39192
|
+
tone = "none",
|
|
38967
39193
|
corner = DEFAULT_SURFACE_CORNER,
|
|
38968
39194
|
loading = false,
|
|
38969
39195
|
error,
|
|
@@ -39004,7 +39230,7 @@ var InfoRow = (props) => {
|
|
|
39004
39230
|
{
|
|
39005
39231
|
...props,
|
|
39006
39232
|
normalised,
|
|
39007
|
-
rowTone: tone,
|
|
39233
|
+
rowTone: getSurfaceAccentColor(tone),
|
|
39008
39234
|
rootProps: rest,
|
|
39009
39235
|
className
|
|
39010
39236
|
}
|
|
@@ -39015,7 +39241,7 @@ var InfoRow = (props) => {
|
|
|
39015
39241
|
{
|
|
39016
39242
|
...rest,
|
|
39017
39243
|
variant,
|
|
39018
|
-
|
|
39244
|
+
tone,
|
|
39019
39245
|
corner,
|
|
39020
39246
|
padding: "none",
|
|
39021
39247
|
scrollable: false,
|
|
@@ -39028,7 +39254,7 @@ var InfoRow = (props) => {
|
|
|
39028
39254
|
{
|
|
39029
39255
|
...props,
|
|
39030
39256
|
normalised,
|
|
39031
|
-
rowTone: tone,
|
|
39257
|
+
rowTone: getSurfaceAccentColor(tone),
|
|
39032
39258
|
className: void 0
|
|
39033
39259
|
}
|
|
39034
39260
|
)
|
|
@@ -39337,7 +39563,7 @@ var PagedPanel = ({
|
|
|
39337
39563
|
error,
|
|
39338
39564
|
emptyState,
|
|
39339
39565
|
emptyMessage,
|
|
39340
|
-
tone = "
|
|
39566
|
+
tone: surfaceTone = "none",
|
|
39341
39567
|
size = "md",
|
|
39342
39568
|
page,
|
|
39343
39569
|
onPageChange,
|
|
@@ -39349,6 +39575,7 @@ var PagedPanel = ({
|
|
|
39349
39575
|
loadingState,
|
|
39350
39576
|
...rest
|
|
39351
39577
|
}) => {
|
|
39578
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
39352
39579
|
const t = useKitT();
|
|
39353
39580
|
const pager = usePager({ count: pages.length, page, onPageChange });
|
|
39354
39581
|
const { page: current, total } = pager;
|
|
@@ -39382,7 +39609,7 @@ var PagedPanel = ({
|
|
|
39382
39609
|
Panel_default,
|
|
39383
39610
|
{
|
|
39384
39611
|
...rest,
|
|
39385
|
-
tone,
|
|
39612
|
+
tone: surfaceTone,
|
|
39386
39613
|
padding: "none",
|
|
39387
39614
|
bodyClassName: total === 0 && !loading ? "h-full" : "",
|
|
39388
39615
|
className: (0, import_classnames63.default)("relative overflow-hidden", rest.className),
|
|
@@ -39885,7 +40112,7 @@ var DetailItemCard = ({
|
|
|
39885
40112
|
expanded,
|
|
39886
40113
|
onToggle,
|
|
39887
40114
|
variant = "plain",
|
|
39888
|
-
tone = "
|
|
40115
|
+
tone: surfaceTone = "none",
|
|
39889
40116
|
corner = DEFAULT_SURFACE_CORNER,
|
|
39890
40117
|
padding = "sm",
|
|
39891
40118
|
glassOpacity,
|
|
@@ -39895,6 +40122,7 @@ var DetailItemCard = ({
|
|
|
39895
40122
|
className,
|
|
39896
40123
|
...rest
|
|
39897
40124
|
}) => {
|
|
40125
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
39898
40126
|
const [internalExpanded, setInternalExpanded] = (0, import_react232.useState)(defaultExpanded);
|
|
39899
40127
|
const isControlled = typeof expanded === "boolean";
|
|
39900
40128
|
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
@@ -39919,7 +40147,7 @@ var DetailItemCard = ({
|
|
|
39919
40147
|
Panel_default,
|
|
39920
40148
|
{
|
|
39921
40149
|
variant,
|
|
39922
|
-
tone,
|
|
40150
|
+
tone: surfaceTone,
|
|
39923
40151
|
corner,
|
|
39924
40152
|
padding,
|
|
39925
40153
|
glassOpacity,
|
|
@@ -40240,7 +40468,7 @@ function ScrollBody({
|
|
|
40240
40468
|
}
|
|
40241
40469
|
function InfiniteScrollPanel({
|
|
40242
40470
|
variant = "plain",
|
|
40243
|
-
tone = "
|
|
40471
|
+
tone: surfaceTone = "none",
|
|
40244
40472
|
corner = DEFAULT_SURFACE_CORNER,
|
|
40245
40473
|
padding = "none",
|
|
40246
40474
|
glassOpacity,
|
|
@@ -40250,6 +40478,7 @@ function InfiniteScrollPanel({
|
|
|
40250
40478
|
className,
|
|
40251
40479
|
...rest
|
|
40252
40480
|
}) {
|
|
40481
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
40253
40482
|
const body = /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(ScrollBody, { tone, padding, ...rest });
|
|
40254
40483
|
if (variant === "plain") {
|
|
40255
40484
|
return /* @__PURE__ */ (0, import_jsx_runtime251.jsx)("div", { className: (0, import_classnames67.default)("h-full min-h-0", className), children: body });
|
|
@@ -40258,7 +40487,7 @@ function InfiniteScrollPanel({
|
|
|
40258
40487
|
Panel_default,
|
|
40259
40488
|
{
|
|
40260
40489
|
variant,
|
|
40261
|
-
tone,
|
|
40490
|
+
tone: surfaceTone,
|
|
40262
40491
|
corner,
|
|
40263
40492
|
glassOpacity,
|
|
40264
40493
|
transparency,
|
|
@@ -40395,7 +40624,7 @@ var CollapsibleHelpText = ({
|
|
|
40395
40624
|
icon = "Help",
|
|
40396
40625
|
children,
|
|
40397
40626
|
className,
|
|
40398
|
-
tone = "
|
|
40627
|
+
tone = "none",
|
|
40399
40628
|
variant = "card",
|
|
40400
40629
|
corner = DEFAULT_SURFACE_CORNER,
|
|
40401
40630
|
padding = "sm",
|
|
@@ -40413,7 +40642,7 @@ var CollapsibleHelpText = ({
|
|
|
40413
40642
|
const sanitized = text2?.trim() ?? "";
|
|
40414
40643
|
const needsTruncation = sanitized.length > maxLength;
|
|
40415
40644
|
const displayText = expanded || !needsTruncation ? sanitized : truncate(sanitized, maxLength);
|
|
40416
|
-
const toneTokens3 = getCollapsibleHelpToneTokens(tone);
|
|
40645
|
+
const toneTokens3 = getCollapsibleHelpToneTokens(getSurfaceAccentColor(tone));
|
|
40417
40646
|
const bare = variant === "plain";
|
|
40418
40647
|
const body = /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
40419
40648
|
HelpBody,
|
|
@@ -40568,6 +40797,7 @@ var HelpButton = ({
|
|
|
40568
40797
|
content,
|
|
40569
40798
|
title,
|
|
40570
40799
|
placement = "auto",
|
|
40800
|
+
tone = "none",
|
|
40571
40801
|
color: color2 = "sky",
|
|
40572
40802
|
variant = "elevated",
|
|
40573
40803
|
corner = DEFAULT_SURFACE_CORNER,
|
|
@@ -40629,7 +40859,7 @@ var HelpButton = ({
|
|
|
40629
40859
|
window.removeEventListener("resize", recompute);
|
|
40630
40860
|
};
|
|
40631
40861
|
}, [open, recompute]);
|
|
40632
|
-
const palette = getPanelToneStyles(
|
|
40862
|
+
const palette = getPanelToneStyles(tone);
|
|
40633
40863
|
const surfaceText = getSurfaceTextTokens(variant);
|
|
40634
40864
|
const isMarkdown = typeof content === "string";
|
|
40635
40865
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)("span", { className: (0, import_classnames69.default)("inline-flex items-center", className), children: [
|
|
@@ -40668,7 +40898,7 @@ var HelpButton = ({
|
|
|
40668
40898
|
Panel_default,
|
|
40669
40899
|
{
|
|
40670
40900
|
variant,
|
|
40671
|
-
tone
|
|
40901
|
+
tone,
|
|
40672
40902
|
corner,
|
|
40673
40903
|
padding: "none",
|
|
40674
40904
|
scrollable: false,
|
|
@@ -42249,7 +42479,7 @@ var Popover = ({
|
|
|
42249
42479
|
children,
|
|
42250
42480
|
placement = "auto",
|
|
42251
42481
|
variant = "elevated",
|
|
42252
|
-
tone = "
|
|
42482
|
+
tone = "none",
|
|
42253
42483
|
corner = DEFAULT_SURFACE_CORNER,
|
|
42254
42484
|
padding = "sm",
|
|
42255
42485
|
maxWidth = 320,
|
|
@@ -42712,7 +42942,7 @@ var Popover = ({
|
|
|
42712
42942
|
"aria-hidden": "true",
|
|
42713
42943
|
className: (0, import_classnames73.default)(
|
|
42714
42944
|
"absolute block h-4 w-4 rotate-45",
|
|
42715
|
-
ARROW_SIDE_BORDERS[position.placement.side],
|
|
42945
|
+
variant !== "none" && ARROW_SIDE_BORDERS[position.placement.side],
|
|
42716
42946
|
chrome.border,
|
|
42717
42947
|
chrome.fill,
|
|
42718
42948
|
chrome.backdrop
|
|
@@ -42738,7 +42968,8 @@ var Popover = ({
|
|
|
42738
42968
|
"aria-hidden": "true",
|
|
42739
42969
|
"data-popover-bubble": true,
|
|
42740
42970
|
className: (0, import_classnames73.default)(
|
|
42741
|
-
"pointer-events-none absolute z-20 block rounded-full
|
|
42971
|
+
"pointer-events-none absolute z-20 block rounded-full",
|
|
42972
|
+
variant !== "none" && "border",
|
|
42742
42973
|
chrome.border,
|
|
42743
42974
|
chrome.fill,
|
|
42744
42975
|
chrome.backdrop
|
|
@@ -43680,7 +43911,7 @@ var AccordionBody = ({
|
|
|
43680
43911
|
const renderIcon2 = useIconRenderer();
|
|
43681
43912
|
const surface = useSurfaceText();
|
|
43682
43913
|
const trigger = getSurfaceTriggerTokens(tone);
|
|
43683
|
-
const chip = getPillColorClasses(tone, "soft");
|
|
43914
|
+
const chip = getPillColorClasses(getSurfaceAccentColor(tone), "soft");
|
|
43684
43915
|
const inset = getSurfacePaddingClass(padding);
|
|
43685
43916
|
const tokens = SIZE_TOKENS4[size] ?? SIZE_TOKENS4.md;
|
|
43686
43917
|
const headerRefs = (0, import_react249.useRef)(/* @__PURE__ */ new Map());
|
|
@@ -43692,7 +43923,7 @@ var AccordionBody = ({
|
|
|
43692
43923
|
dashed: false,
|
|
43693
43924
|
icon: "ViewRows",
|
|
43694
43925
|
title: t("kit.accordion.noItemsTitle"),
|
|
43695
|
-
tone,
|
|
43926
|
+
tone: getSurfaceAccentColor(tone),
|
|
43696
43927
|
size
|
|
43697
43928
|
}
|
|
43698
43929
|
) });
|
|
@@ -43824,7 +44055,7 @@ var AccordionBody = ({
|
|
|
43824
44055
|
item.badge ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
43825
44056
|
Pill_default,
|
|
43826
44057
|
{
|
|
43827
|
-
tone,
|
|
44058
|
+
tone: getSurfaceAccentColor(tone),
|
|
43828
44059
|
variant: "soft",
|
|
43829
44060
|
size: tokens.pill,
|
|
43830
44061
|
className: "flex-none",
|
|
@@ -43911,7 +44142,7 @@ var AccordionBody = ({
|
|
|
43911
44142
|
title: t("kit.accordion.loadingTitle"),
|
|
43912
44143
|
className: "rounded-none",
|
|
43913
44144
|
size: "md",
|
|
43914
|
-
color: tone
|
|
44145
|
+
color: getSurfaceAccentColor(tone)
|
|
43915
44146
|
}
|
|
43916
44147
|
) : null
|
|
43917
44148
|
]
|
|
@@ -44727,7 +44958,7 @@ var Modal = ({
|
|
|
44727
44958
|
container,
|
|
44728
44959
|
corner = DEFAULT_SURFACE_CORNER,
|
|
44729
44960
|
variant = "elevated",
|
|
44730
|
-
tone = "
|
|
44961
|
+
tone = "none",
|
|
44731
44962
|
glassOpacity,
|
|
44732
44963
|
transparency,
|
|
44733
44964
|
vibrancy,
|
|
@@ -46149,8 +46380,8 @@ var SideMenuCtaCard = ({
|
|
|
46149
46380
|
Panel_default,
|
|
46150
46381
|
{
|
|
46151
46382
|
className: cta.onDismiss ? "relative" : void 0,
|
|
46152
|
-
variant: glass ? "glass" : "outlined",
|
|
46153
|
-
tone,
|
|
46383
|
+
variant: cta.variant ?? (glass ? "glass" : "outlined"),
|
|
46384
|
+
tone: cta.surfaceTone ?? "none",
|
|
46154
46385
|
padding: "sm",
|
|
46155
46386
|
mediaPlacement: "top",
|
|
46156
46387
|
media: cta.media,
|
|
@@ -46175,6 +46406,7 @@ var SideMenuCtaCard = ({
|
|
|
46175
46406
|
);
|
|
46176
46407
|
};
|
|
46177
46408
|
var SideMenuDetailPanel = ({
|
|
46409
|
+
variant,
|
|
46178
46410
|
items,
|
|
46179
46411
|
tone,
|
|
46180
46412
|
menuTone,
|
|
@@ -46213,11 +46445,11 @@ var SideMenuDetailPanel = ({
|
|
|
46213
46445
|
},
|
|
46214
46446
|
item.slug
|
|
46215
46447
|
));
|
|
46216
|
-
if (glass) {
|
|
46448
|
+
if (glass || variant) {
|
|
46217
46449
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
46218
46450
|
Panel_default,
|
|
46219
46451
|
{
|
|
46220
|
-
variant: "glass",
|
|
46452
|
+
variant: variant ?? "glass",
|
|
46221
46453
|
tone,
|
|
46222
46454
|
corner: "rounded-sm",
|
|
46223
46455
|
padding: "none",
|
|
@@ -46260,6 +46492,7 @@ var SideMenu = ({
|
|
|
46260
46492
|
ctas,
|
|
46261
46493
|
footerDetails,
|
|
46262
46494
|
footerDetailsTone,
|
|
46495
|
+
footerDetailsVariant,
|
|
46263
46496
|
noise = false,
|
|
46264
46497
|
noiseScale,
|
|
46265
46498
|
loading = false,
|
|
@@ -46836,8 +47069,9 @@ var SideMenu = ({
|
|
|
46836
47069
|
!contentCollapsed2 && footerDetails && footerDetails.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)("div", { className: "shrink-0 px-3 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
46837
47070
|
SideMenuDetailPanel,
|
|
46838
47071
|
{
|
|
47072
|
+
variant: footerDetailsVariant,
|
|
46839
47073
|
items: footerDetails,
|
|
46840
|
-
tone: footerDetailsTone ??
|
|
47074
|
+
tone: footerDetailsTone ?? "none",
|
|
46841
47075
|
menuTone: color2,
|
|
46842
47076
|
glass: surface.idleCopy === "glass",
|
|
46843
47077
|
idleCopy: surface.idleCopy
|
|
@@ -47413,7 +47647,7 @@ var SidePanel = ({
|
|
|
47413
47647
|
transparency,
|
|
47414
47648
|
vibrancy,
|
|
47415
47649
|
specularMode,
|
|
47416
|
-
surfaceTone = "
|
|
47650
|
+
surfaceTone = "none",
|
|
47417
47651
|
size = "md",
|
|
47418
47652
|
side = "right",
|
|
47419
47653
|
overlay = false,
|
|
@@ -47441,7 +47675,7 @@ var SidePanel = ({
|
|
|
47441
47675
|
);
|
|
47442
47676
|
const surface = getSidebarSurfaceTokens(
|
|
47443
47677
|
legacyVariant ? variant : "sidebar",
|
|
47444
|
-
surfaceTone
|
|
47678
|
+
getSurfaceAccentColor(surfaceTone)
|
|
47445
47679
|
);
|
|
47446
47680
|
const surfaceText = getSidePanelTextTokens(variant);
|
|
47447
47681
|
const insetValue = inset ?? surface.offset !== "";
|
|
@@ -48188,6 +48422,7 @@ var ROW_ICON_VARIANT = "ghost";
|
|
|
48188
48422
|
var EDITOR_BUTTON_FOR_SURFACE = {
|
|
48189
48423
|
// `plain` means "the background is unknown". Glass is the treatment built
|
|
48190
48424
|
// for exactly that: a frosted backdrop reads on a white page and on a photo.
|
|
48425
|
+
none: "ghost",
|
|
48191
48426
|
plain: "glass",
|
|
48192
48427
|
elevated: "outline",
|
|
48193
48428
|
outlined: "outline",
|
|
@@ -48592,7 +48827,7 @@ var SmartGridLayout = ({
|
|
|
48592
48827
|
tone,
|
|
48593
48828
|
editThemeColor,
|
|
48594
48829
|
variant = "plain",
|
|
48595
|
-
surfaceTone = "
|
|
48830
|
+
surfaceTone = "none",
|
|
48596
48831
|
size = "md",
|
|
48597
48832
|
controlVariant,
|
|
48598
48833
|
readOnly = false,
|
|
@@ -51575,6 +51810,7 @@ var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
|
51575
51810
|
var import_react263 = require("react");
|
|
51576
51811
|
var SPLIT_VIEW_LOADERS = ["skeleton", "spinner", "progress"];
|
|
51577
51812
|
var SEARCH_VARIANT_FOR_SURFACE = {
|
|
51813
|
+
none: "flat",
|
|
51578
51814
|
elevated: "elevated",
|
|
51579
51815
|
outlined: "flat",
|
|
51580
51816
|
subtle: "ghost",
|
|
@@ -51663,7 +51899,7 @@ var SplitView = ({
|
|
|
51663
51899
|
tone,
|
|
51664
51900
|
color: color2,
|
|
51665
51901
|
variant = "elevated",
|
|
51666
|
-
surfaceTone = "
|
|
51902
|
+
surfaceTone = "none",
|
|
51667
51903
|
searchVariant,
|
|
51668
51904
|
size = "md",
|
|
51669
51905
|
showHighlightIndicator = true,
|
|
@@ -51883,7 +52119,7 @@ var SplitView = ({
|
|
|
51883
52119
|
const border = headerProps.border ?? true;
|
|
51884
52120
|
const detailsVariant = headerDetails?.variant ?? headerDetails?.variants ?? "subtle";
|
|
51885
52121
|
const detailsDecoration = headerDetails?.decoration ?? headerDetails?.decorations ?? "none";
|
|
51886
|
-
const detailsTone = headerDetails?.tone ?? "
|
|
52122
|
+
const detailsTone = headerDetails?.tone ?? "none";
|
|
51887
52123
|
const hasCustomHeaderBody = headerDetails?.headerBody !== void 0 && headerDetails?.headerBody !== null;
|
|
51888
52124
|
const hasHeaderDetailsContent = Boolean(
|
|
51889
52125
|
hasCustomHeaderBody || headerDetails?.title || headerDetails?.subtitle || headerDetails?.description || headerDetails?.tags
|
|
@@ -52826,6 +53062,7 @@ var VariablePicker = ({
|
|
|
52826
53062
|
tone = "blue",
|
|
52827
53063
|
size = "md",
|
|
52828
53064
|
variant = "elevated",
|
|
53065
|
+
panelTone = "auto",
|
|
52829
53066
|
corner = "auto",
|
|
52830
53067
|
initialSearch = "",
|
|
52831
53068
|
title,
|
|
@@ -52901,7 +53138,7 @@ var VariablePicker = ({
|
|
|
52901
53138
|
Panel_default,
|
|
52902
53139
|
{
|
|
52903
53140
|
variant,
|
|
52904
|
-
tone: PANEL_TONE_FOR_FIELD,
|
|
53141
|
+
tone: panelTone === "auto" ? PANEL_TONE_FOR_FIELD : panelTone,
|
|
52905
53142
|
corner,
|
|
52906
53143
|
padding: "none",
|
|
52907
53144
|
scrollable: false,
|
|
@@ -52999,6 +53236,7 @@ var SmartInput = ({
|
|
|
52999
53236
|
gradientTo,
|
|
53000
53237
|
glowIntensity = DEFAULT_GLOW_INTENSITY,
|
|
53001
53238
|
panelVariant = "auto",
|
|
53239
|
+
panelTone = "auto",
|
|
53002
53240
|
panelCorner = "auto",
|
|
53003
53241
|
defaultViewMode = "token",
|
|
53004
53242
|
autocomplete = true,
|
|
@@ -53329,6 +53567,7 @@ var SmartInput = ({
|
|
|
53329
53567
|
tone,
|
|
53330
53568
|
size,
|
|
53331
53569
|
variant: resolvedPanelVariant,
|
|
53570
|
+
panelTone,
|
|
53332
53571
|
corner: panelCorner,
|
|
53333
53572
|
initialSearch: pickerFilter,
|
|
53334
53573
|
onSelect: handleSelect,
|
|
@@ -54092,7 +54331,7 @@ var StatCard = ({
|
|
|
54092
54331
|
iconTone,
|
|
54093
54332
|
trend: trendProp,
|
|
54094
54333
|
size = "md",
|
|
54095
|
-
tone,
|
|
54334
|
+
tone: surfaceTone = "none",
|
|
54096
54335
|
gradient = false,
|
|
54097
54336
|
progress: progressProp = false,
|
|
54098
54337
|
progressType = "spinner",
|
|
@@ -54133,6 +54372,7 @@ var StatCard = ({
|
|
|
54133
54372
|
children,
|
|
54134
54373
|
...rest
|
|
54135
54374
|
}) => {
|
|
54375
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
54136
54376
|
const pager = usePager({
|
|
54137
54377
|
count: pages?.length ?? 0,
|
|
54138
54378
|
page,
|
|
@@ -54201,7 +54441,7 @@ var StatCard = ({
|
|
|
54201
54441
|
Panel_default,
|
|
54202
54442
|
{
|
|
54203
54443
|
variant,
|
|
54204
|
-
tone,
|
|
54444
|
+
tone: surfaceTone,
|
|
54205
54445
|
corner,
|
|
54206
54446
|
padding,
|
|
54207
54447
|
decoration: resolvedDecoration,
|
|
@@ -56276,7 +56516,7 @@ var Stepper = ({
|
|
|
56276
56516
|
completedStepIds,
|
|
56277
56517
|
orientation = "horizontal",
|
|
56278
56518
|
variant = "elevated",
|
|
56279
|
-
tone = "
|
|
56519
|
+
tone: surfaceTone = "none",
|
|
56280
56520
|
size = "md",
|
|
56281
56521
|
nodeCorner = "full",
|
|
56282
56522
|
padding = "md",
|
|
@@ -56306,6 +56546,7 @@ var Stepper = ({
|
|
|
56306
56546
|
className,
|
|
56307
56547
|
...panelRest
|
|
56308
56548
|
}) => {
|
|
56549
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
56309
56550
|
const state = useStepper(steps, {
|
|
56310
56551
|
currentIndex,
|
|
56311
56552
|
currentStepId,
|
|
@@ -56321,7 +56562,7 @@ var Stepper = ({
|
|
|
56321
56562
|
{
|
|
56322
56563
|
className: (0, import_classnames94.default)("w-full", className),
|
|
56323
56564
|
variant,
|
|
56324
|
-
tone,
|
|
56565
|
+
tone: surfaceTone,
|
|
56325
56566
|
padding,
|
|
56326
56567
|
corner,
|
|
56327
56568
|
loaderType: loaderType === "skeleton" ? "spinner" : loaderType,
|
|
@@ -57701,7 +57942,7 @@ function TableComponent({
|
|
|
57701
57942
|
density = "default",
|
|
57702
57943
|
bordered = false,
|
|
57703
57944
|
corner,
|
|
57704
|
-
tone = "
|
|
57945
|
+
tone: surfaceTone = "none",
|
|
57705
57946
|
panelVariant = "auto",
|
|
57706
57947
|
panelTone = "auto",
|
|
57707
57948
|
panelCorner = "auto",
|
|
@@ -57766,6 +58007,7 @@ function TableComponent({
|
|
|
57766
58007
|
storage,
|
|
57767
58008
|
color: color2
|
|
57768
58009
|
}) {
|
|
58010
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
57769
58011
|
const t = useKitT();
|
|
57770
58012
|
const uid = (0, import_react276.useId)();
|
|
57771
58013
|
const getDefaultColumnVisibility = (column) => {
|
|
@@ -57795,7 +58037,7 @@ function TableComponent({
|
|
|
57795
58037
|
};
|
|
57796
58038
|
const controlColor = color2 ?? (tone === "neutral" ? "blue" : tone);
|
|
57797
58039
|
const resolvedPanelVariant = panelVariant === "auto" ? isGlassSurface(variant) ? "default" : variant : panelVariant;
|
|
57798
|
-
const resolvedPanelTone = panelTone === "auto" ?
|
|
58040
|
+
const resolvedPanelTone = panelTone === "auto" ? surfaceTone : panelTone;
|
|
57799
58041
|
const resolvedPanelCorner = panelCorner === "auto" ? corner : panelCorner;
|
|
57800
58042
|
const focusRingClass = `focus-visible:ring-${controlColor}-500 dark:focus-visible:ring-${controlColor}-400`;
|
|
57801
58043
|
const densityTokens = getTableDensityTokens(density);
|
|
@@ -58409,7 +58651,7 @@ function TableComponent({
|
|
|
58409
58651
|
Panel_default,
|
|
58410
58652
|
{
|
|
58411
58653
|
variant,
|
|
58412
|
-
tone,
|
|
58654
|
+
tone: surfaceTone,
|
|
58413
58655
|
padding: "none",
|
|
58414
58656
|
corner,
|
|
58415
58657
|
scrollable: false,
|
|
@@ -59424,7 +59666,7 @@ var AccessMatrix = ({
|
|
|
59424
59666
|
permissions,
|
|
59425
59667
|
limit = 5,
|
|
59426
59668
|
variant = "outlined",
|
|
59427
|
-
tone = "
|
|
59669
|
+
tone: surfaceTone = "none",
|
|
59428
59670
|
density,
|
|
59429
59671
|
bordered = false,
|
|
59430
59672
|
corner,
|
|
@@ -59440,6 +59682,7 @@ var AccessMatrix = ({
|
|
|
59440
59682
|
loaderProgress,
|
|
59441
59683
|
emptyState
|
|
59442
59684
|
}) => {
|
|
59685
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
59443
59686
|
const [expanded, setExpanded] = (0, import_react277.useState)(false);
|
|
59444
59687
|
const [collapsedGroups, setCollapsedGroups] = (0, import_react277.useState)(
|
|
59445
59688
|
/* @__PURE__ */ new Set()
|
|
@@ -59569,7 +59812,7 @@ var AccessMatrix = ({
|
|
|
59569
59812
|
columns,
|
|
59570
59813
|
data: rows,
|
|
59571
59814
|
variant,
|
|
59572
|
-
tone,
|
|
59815
|
+
tone: surfaceTone,
|
|
59573
59816
|
density,
|
|
59574
59817
|
bordered,
|
|
59575
59818
|
corner,
|
|
@@ -59806,7 +60049,7 @@ var KeyValueArrayField = ({
|
|
|
59806
60049
|
disabled = false,
|
|
59807
60050
|
flagDuplicateKeys = true,
|
|
59808
60051
|
variant = "outlined",
|
|
59809
|
-
tone = "
|
|
60052
|
+
tone: surfaceTone = "none",
|
|
59810
60053
|
corner = DEFAULT_SURFACE_CORNER,
|
|
59811
60054
|
padding = "sm",
|
|
59812
60055
|
glassOpacity,
|
|
@@ -59817,6 +60060,7 @@ var KeyValueArrayField = ({
|
|
|
59817
60060
|
size = "sm",
|
|
59818
60061
|
className
|
|
59819
60062
|
}) => {
|
|
60063
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
59820
60064
|
const baseId = (0, import_react278.useId)();
|
|
59821
60065
|
const labelId = `${baseId}-label`;
|
|
59822
60066
|
const errorId = `${baseId}-error`;
|
|
@@ -59913,7 +60157,7 @@ var KeyValueArrayField = ({
|
|
|
59913
60157
|
Panel_default,
|
|
59914
60158
|
{
|
|
59915
60159
|
variant,
|
|
59916
|
-
tone,
|
|
60160
|
+
tone: surfaceTone,
|
|
59917
60161
|
corner,
|
|
59918
60162
|
padding,
|
|
59919
60163
|
glassOpacity,
|
|
@@ -60018,7 +60262,7 @@ var DynamicFormField = ({
|
|
|
60018
60262
|
isVisible = true,
|
|
60019
60263
|
size = "md",
|
|
60020
60264
|
variant = "elevated",
|
|
60021
|
-
tone = "
|
|
60265
|
+
tone: surfaceTone = "none",
|
|
60022
60266
|
corner = DEFAULT_SURFACE_CORNER,
|
|
60023
60267
|
padding = "md",
|
|
60024
60268
|
inputVariant = "auto",
|
|
@@ -60033,6 +60277,7 @@ var DynamicFormField = ({
|
|
|
60033
60277
|
vibrancy,
|
|
60034
60278
|
specularMode
|
|
60035
60279
|
}) => {
|
|
60280
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
60036
60281
|
const t = useKitT();
|
|
60037
60282
|
const generatedId = (0, import_react279.useId)();
|
|
60038
60283
|
const resolvedInputVariant = inputVariant === "auto" ? INPUT_VARIANT_FOR_SURFACE[variant] : inputVariant;
|
|
@@ -60184,7 +60429,7 @@ var DynamicFormField = ({
|
|
|
60184
60429
|
{
|
|
60185
60430
|
className: (0, import_classnames99.default)("w-full", className),
|
|
60186
60431
|
variant,
|
|
60187
|
-
tone,
|
|
60432
|
+
tone: surfaceTone,
|
|
60188
60433
|
corner,
|
|
60189
60434
|
padding,
|
|
60190
60435
|
glassOpacity,
|
|
@@ -60237,6 +60482,7 @@ var NotificationModal = ({
|
|
|
60237
60482
|
onSecondaryAction,
|
|
60238
60483
|
icon,
|
|
60239
60484
|
tone,
|
|
60485
|
+
surfaceTone = "none",
|
|
60240
60486
|
size = "sm",
|
|
60241
60487
|
...rest
|
|
60242
60488
|
}) => {
|
|
@@ -60258,7 +60504,7 @@ var NotificationModal = ({
|
|
|
60258
60504
|
onClose,
|
|
60259
60505
|
title,
|
|
60260
60506
|
size,
|
|
60261
|
-
tone:
|
|
60507
|
+
tone: surfaceTone,
|
|
60262
60508
|
icon: icon ?? config.icon,
|
|
60263
60509
|
actions: /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(Modal_default.Actions, { children: [
|
|
60264
60510
|
secondaryActionLabel && /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
|
|
@@ -61039,7 +61285,7 @@ var TimelinePanel = ({
|
|
|
61039
61285
|
headerAction,
|
|
61040
61286
|
items,
|
|
61041
61287
|
variant = "simple",
|
|
61042
|
-
tone = "
|
|
61288
|
+
tone: surfaceTone = "none",
|
|
61043
61289
|
padding = "sm",
|
|
61044
61290
|
corner = "none",
|
|
61045
61291
|
lineColor,
|
|
@@ -61058,6 +61304,7 @@ var TimelinePanel = ({
|
|
|
61058
61304
|
glassOpacity,
|
|
61059
61305
|
specularMode
|
|
61060
61306
|
}) => {
|
|
61307
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
61061
61308
|
const isDark = useIsDark();
|
|
61062
61309
|
const palette = getPanelToneStyles(tone);
|
|
61063
61310
|
const itemEls = (0, import_react280.useRef)([]);
|
|
@@ -61161,7 +61408,7 @@ var TimelinePanel = ({
|
|
|
61161
61408
|
Panel_default,
|
|
61162
61409
|
{
|
|
61163
61410
|
variant,
|
|
61164
|
-
tone,
|
|
61411
|
+
tone: surfaceTone,
|
|
61165
61412
|
padding,
|
|
61166
61413
|
corner,
|
|
61167
61414
|
className,
|
|
@@ -61622,6 +61869,7 @@ var connectorVisual = (connector) => {
|
|
|
61622
61869
|
};
|
|
61623
61870
|
var GLASS_RIM2 = "stroke-white/50 dark:stroke-white/10";
|
|
61624
61871
|
var NODE_SURFACES = {
|
|
61872
|
+
none: () => ({ fill: "fill-transparent", stroke: "stroke-none", effect: "" }),
|
|
61625
61873
|
elevated: () => ({
|
|
61626
61874
|
fill: "fill-white dark:fill-neutral-900",
|
|
61627
61875
|
stroke: "stroke-black/5 dark:stroke-white/10",
|
|
@@ -65195,7 +65443,7 @@ var ConnectionFlow = import_react285.default.forwardRef(function ConnectionFlow2
|
|
|
65195
65443
|
editMode = false,
|
|
65196
65444
|
onNodeCreate,
|
|
65197
65445
|
variant = "outlined",
|
|
65198
|
-
tone = "
|
|
65446
|
+
tone: surfaceTone = "none",
|
|
65199
65447
|
size = "md",
|
|
65200
65448
|
corner = DEFAULT_SURFACE_CORNER,
|
|
65201
65449
|
edgeStyle = "orthogonal",
|
|
@@ -65240,6 +65488,7 @@ var ConnectionFlow = import_react285.default.forwardRef(function ConnectionFlow2
|
|
|
65240
65488
|
onZoomChange,
|
|
65241
65489
|
renderNode
|
|
65242
65490
|
}, ref) {
|
|
65491
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
65243
65492
|
const editorRef = (0, import_react285.useRef)(null);
|
|
65244
65493
|
const [editBounds, setEditBounds] = (0, import_react285.useState)(null);
|
|
65245
65494
|
const onEditBounds = (0, import_react285.useCallback)((next) => setEditBounds(
|
|
@@ -65786,7 +66035,7 @@ var ConnectionFlow = import_react285.default.forwardRef(function ConnectionFlow2
|
|
|
65786
66035
|
{
|
|
65787
66036
|
className: (0, import_classnames107.default)("flex min-h-0 w-full min-w-0 flex-col", className),
|
|
65788
66037
|
variant,
|
|
65789
|
-
tone,
|
|
66038
|
+
tone: surfaceTone,
|
|
65790
66039
|
corner,
|
|
65791
66040
|
padding: "none",
|
|
65792
66041
|
flexBody: true,
|
|
@@ -68785,7 +69034,7 @@ var resolveLabels = (labelOverrides) => labelOverrides ? {
|
|
|
68785
69034
|
} : DEFAULT_LABELS;
|
|
68786
69035
|
var buildCardProps = ({
|
|
68787
69036
|
variant = "outlined",
|
|
68788
|
-
cardTone = "
|
|
69037
|
+
cardTone = "none",
|
|
68789
69038
|
corner = DEFAULT_SURFACE_CORNER,
|
|
68790
69039
|
glassOpacity = "light",
|
|
68791
69040
|
vibrancy,
|
|
@@ -69635,7 +69884,7 @@ var WorkflowTracker = ({
|
|
|
69635
69884
|
customStatuses,
|
|
69636
69885
|
mutedColor = "neutral",
|
|
69637
69886
|
variant = "outlined",
|
|
69638
|
-
cardTone = "
|
|
69887
|
+
cardTone = "none",
|
|
69639
69888
|
translucentSurfaces,
|
|
69640
69889
|
glassOpacity = "light",
|
|
69641
69890
|
vibrancy,
|
|
@@ -72092,6 +72341,7 @@ function nearestPreset(zoom, presets) {
|
|
|
72092
72341
|
}
|
|
72093
72342
|
var GanttToolbar = ({
|
|
72094
72343
|
variant = "elevated",
|
|
72344
|
+
tone = "none",
|
|
72095
72345
|
zoom,
|
|
72096
72346
|
presets,
|
|
72097
72347
|
onZoomTo,
|
|
@@ -72106,8 +72356,8 @@ var GanttToolbar = ({
|
|
|
72106
72356
|
};
|
|
72107
72357
|
const active = (0, import_react300.useMemo)(() => nearestPreset(zoom, presets), [zoom, presets]);
|
|
72108
72358
|
const chrome = (0, import_react300.useMemo)(
|
|
72109
|
-
() => getSurfaceVariantClasses(variant,
|
|
72110
|
-
[variant]
|
|
72359
|
+
() => getSurfaceVariantClasses(variant, tone),
|
|
72360
|
+
[variant, tone]
|
|
72111
72361
|
);
|
|
72112
72362
|
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(
|
|
72113
72363
|
"div",
|
|
@@ -72531,6 +72781,7 @@ var Gantt = ({
|
|
|
72531
72781
|
height = 520,
|
|
72532
72782
|
color: color2 = "blue",
|
|
72533
72783
|
variant = "elevated",
|
|
72784
|
+
tone = "none",
|
|
72534
72785
|
corner = "rounded-sm",
|
|
72535
72786
|
padding = "none",
|
|
72536
72787
|
vibrancy,
|
|
@@ -73041,6 +73292,7 @@ var Gantt = ({
|
|
|
73041
73292
|
{
|
|
73042
73293
|
ref: rootRef,
|
|
73043
73294
|
variant,
|
|
73295
|
+
tone,
|
|
73044
73296
|
padding,
|
|
73045
73297
|
corner,
|
|
73046
73298
|
vibrancy,
|
|
@@ -73068,7 +73320,7 @@ var Gantt = ({
|
|
|
73068
73320
|
{
|
|
73069
73321
|
className: (0, import_classnames128.default)(
|
|
73070
73322
|
"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",
|
|
73071
|
-
getSurfaceVariantClasses(variant,
|
|
73323
|
+
getSurfaceVariantClasses(variant, tone)
|
|
73072
73324
|
),
|
|
73073
73325
|
children: icon
|
|
73074
73326
|
}
|
|
@@ -73081,6 +73333,7 @@ var Gantt = ({
|
|
|
73081
73333
|
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "ml-auto shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
73082
73334
|
GanttToolbar,
|
|
73083
73335
|
{
|
|
73336
|
+
tone,
|
|
73084
73337
|
variant,
|
|
73085
73338
|
zoom,
|
|
73086
73339
|
presets: GANTT_ZOOM_PRESETS,
|
|
@@ -76791,7 +77044,7 @@ var Terminal = (0, import_react318.forwardRef)(
|
|
|
76791
77044
|
style,
|
|
76792
77045
|
padding = "sm",
|
|
76793
77046
|
variant = "outlined",
|
|
76794
|
-
tone = "
|
|
77047
|
+
tone = "none",
|
|
76795
77048
|
...surface
|
|
76796
77049
|
}, ref) {
|
|
76797
77050
|
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
@@ -76854,7 +77107,7 @@ var TerminalTabs = (0, import_react319.forwardRef)(
|
|
|
76854
77107
|
height = 360,
|
|
76855
77108
|
style,
|
|
76856
77109
|
variant = "outlined",
|
|
76857
|
-
tone = "
|
|
77110
|
+
tone: surfaceTone = "none",
|
|
76858
77111
|
padding = "sm",
|
|
76859
77112
|
readOnly,
|
|
76860
77113
|
scheme,
|
|
@@ -76866,6 +77119,7 @@ var TerminalTabs = (0, import_react319.forwardRef)(
|
|
|
76866
77119
|
emptyState = "No terminal sessions",
|
|
76867
77120
|
...surface
|
|
76868
77121
|
}, ref) {
|
|
77122
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
76869
77123
|
const prefix = (0, import_react319.useId)();
|
|
76870
77124
|
const [selected, setSelected] = (0, import_react319.useState)(defaultValue ?? sessions[0]?.id);
|
|
76871
77125
|
const requested = value ?? selected;
|
|
@@ -76886,7 +77140,7 @@ var TerminalTabs = (0, import_react319.forwardRef)(
|
|
|
76886
77140
|
...surface,
|
|
76887
77141
|
"data-color-scheme": scheme ?? "auto",
|
|
76888
77142
|
className: (0, import_classnames142.default)(surface.className, scheme === "dark" && "dark"),
|
|
76889
|
-
...{ variant, tone, padding },
|
|
77143
|
+
...{ variant, tone: surfaceTone, padding },
|
|
76890
77144
|
flexBody: true,
|
|
76891
77145
|
scrollable: false,
|
|
76892
77146
|
style: {
|
|
@@ -77173,7 +77427,7 @@ function MenuRow({ item, state, depth }) {
|
|
|
77173
77427
|
item.label && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold text-neutral-500 dark:text-neutral-400", children: item.label }),
|
|
77174
77428
|
item.items && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(MenuList, { items: item.disabled ? item.items.map((child) => ({ ...child, disabled: true })) : item.items, state, depth, parentLabel: label, grouped: true })
|
|
77175
77429
|
] });
|
|
77176
|
-
const itemTone2 = item.tone ?? props.itemTone ?? props.tone ?? "
|
|
77430
|
+
const itemTone2 = getSurfaceAccentColor(item.tone ?? props.itemTone ?? props.tone ?? "none");
|
|
77177
77431
|
const itemPadding = item.padding ?? props.itemPadding;
|
|
77178
77432
|
const tokens = getSideMenuItemTokens(itemTone2);
|
|
77179
77433
|
const checkable = item.type === "checkbox" || item.type === "radio";
|
|
@@ -77266,13 +77520,14 @@ function MenuSurface({ state, children, root = false }) {
|
|
|
77266
77520
|
Panel_default,
|
|
77267
77521
|
{
|
|
77268
77522
|
variant: props.variant ?? "outlined",
|
|
77269
|
-
tone: props.tone ?? "
|
|
77523
|
+
tone: props.tone ?? "none",
|
|
77270
77524
|
corner: props.corner,
|
|
77271
77525
|
padding: "none",
|
|
77272
77526
|
glassOpacity: props.glassOpacity,
|
|
77273
77527
|
transparency: props.transparency,
|
|
77274
77528
|
vibrancy: props.vibrancy,
|
|
77275
77529
|
specularMode: props.specularMode,
|
|
77530
|
+
style: root ? props.style : void 0,
|
|
77276
77531
|
className: (0, import_classnames144.default)(
|
|
77277
77532
|
root ? props.className : void 0,
|
|
77278
77533
|
(!root || props.popup || props.trigger || props.anchorRef) && "backdrop-blur-xl"
|
|
@@ -77477,7 +77732,7 @@ function FileUpload({ embedded = false, compact: compact2 = false, value, defaul
|
|
|
77477
77732
|
const files = value ?? internal;
|
|
77478
77733
|
const locked = disabled || loading;
|
|
77479
77734
|
const labels = { ...defaultLabels, ...overrides };
|
|
77480
|
-
const tokens = getSideMenuItemTokens(surface.tone ?? "
|
|
77735
|
+
const tokens = getSideMenuItemTokens(getSurfaceAccentColor(surface.tone ?? "none"));
|
|
77481
77736
|
const change = (next) => {
|
|
77482
77737
|
if (value === void 0) setInternal(next);
|
|
77483
77738
|
onChange?.(next);
|
|
@@ -77532,7 +77787,7 @@ function FileUpload({ embedded = false, compact: compact2 = false, value, defaul
|
|
|
77532
77787
|
choose(Array.from(event.target.files ?? []));
|
|
77533
77788
|
event.target.value = "";
|
|
77534
77789
|
} }),
|
|
77535
|
-
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(Button_default, { size, className: compact2 ? "shrink-0" : void 0, variant: "soft", color: surface.tone ?? "
|
|
77790
|
+
/* @__PURE__ */ (0, import_jsx_runtime348.jsx)(Button_default, { size, className: compact2 ? "shrink-0" : void 0, variant: "soft", color: getSurfaceAccentColor(surface.tone ?? "none"), disabled: locked, loading, onClick: () => input.current?.click(), children: labels.browse })
|
|
77536
77791
|
]
|
|
77537
77792
|
}
|
|
77538
77793
|
),
|
|
@@ -77552,7 +77807,7 @@ function FileUpload({ embedded = false, compact: compact2 = false, value, defaul
|
|
|
77552
77807
|
] }, `${file.name}-${file.lastModified}-${index}`)) }) : !compact2 && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("p", { className: (0, import_classnames145.default)("mt-3 text-neutral-500", density.detail), role: "status", children: labels.empty }),
|
|
77553
77808
|
(error || rejections.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { role: "alert", className: "mt-3 text-xs text-rose-700 dark:text-rose-300", children: error || /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("ul", { children: rejections.map((rejection, i) => /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("li", { children: rejectionMessage?.(rejection) ?? rejection.message }, i)) }) })
|
|
77554
77809
|
] });
|
|
77555
|
-
return embedded ? /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone: surface.tone ?? "
|
|
77810
|
+
return embedded ? /* @__PURE__ */ (0, import_jsx_runtime348.jsx)("div", { className, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime348.jsx)(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone: surface.tone ?? "none", padding: surface.padding ?? "sm", className, children: content });
|
|
77556
77811
|
}
|
|
77557
77812
|
|
|
77558
77813
|
// src/components/IdentityPicker/IdentityPicker.tsx
|
|
@@ -77758,7 +78013,7 @@ function IdentityPicker({
|
|
|
77758
78013
|
const selected = value === void 0 ? internal : value;
|
|
77759
78014
|
const labels = { ...defaults, ...overrides };
|
|
77760
78015
|
const locked = disabled || loading;
|
|
77761
|
-
const tone = surface.tone ?? "
|
|
78016
|
+
const tone = getSurfaceAccentColor(surface.tone ?? "none");
|
|
77762
78017
|
const tokens = getSideMenuItemTokens(tone);
|
|
77763
78018
|
const automatic = initials(name);
|
|
77764
78019
|
const change = (next) => {
|
|
@@ -77774,7 +78029,7 @@ function IdentityPicker({
|
|
|
77774
78029
|
});
|
|
77775
78030
|
const previewClass = (0, import_classnames146.default)("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);
|
|
77776
78031
|
const preview = selected?.type === "image" ? /* @__PURE__ */ (0, import_jsx_runtime349.jsx)(ImagePreview, { file: selected.file, src: selected.src, alt: labels.preview, className: "h-full w-full object-contain" }) : /* @__PURE__ */ (0, import_jsx_runtime349.jsx)("span", { style: { fontFamily }, "aria-hidden": "true", children: selected?.type === "emoji" ? selected.emoji : selected?.type === "monogram" ? selected.text : automatic });
|
|
77777
|
-
return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone, padding: surface.padding ?? (compact2 ? "xs" : "sm"), className, "aria-busy": loading || void 0, children: [
|
|
78032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime349.jsxs)(Panel_default, { ...surface, variant: surface.variant ?? "outlined", tone: surface.tone ?? "none", padding: surface.padding ?? (compact2 ? "xs" : "sm"), className, "aria-busy": loading || void 0, children: [
|
|
77778
78033
|
/* @__PURE__ */ (0, import_jsx_runtime349.jsxs)("div", { className: (0, import_classnames146.default)("flex items-start", density.headerGap), children: [
|
|
77779
78034
|
/* @__PURE__ */ (0, import_jsx_runtime349.jsx)("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 }),
|
|
77780
78035
|
/* @__PURE__ */ (0, import_jsx_runtime349.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -77848,7 +78103,7 @@ function IdentityPicker({
|
|
|
77848
78103
|
embedded: true,
|
|
77849
78104
|
compact: compact2,
|
|
77850
78105
|
variant: surface.variant,
|
|
77851
|
-
tone,
|
|
78106
|
+
tone: surface.tone ?? "none",
|
|
77852
78107
|
corner: surface.corner,
|
|
77853
78108
|
padding: "none",
|
|
77854
78109
|
size,
|
|
@@ -77934,12 +78189,13 @@ function ActivePopover({ trigger, content, options }) {
|
|
|
77934
78189
|
onOpenChange?.(value);
|
|
77935
78190
|
}, children: content });
|
|
77936
78191
|
}
|
|
77937
|
-
function DotStepper({ steps, currentIndex, currentStepId, maxVisible = 5, size = "sm", corner = "full", tone = "
|
|
78192
|
+
function DotStepper({ steps, currentIndex, currentStepId, maxVisible = 5, size = "sm", corner = "full", tone: surfaceTone = "none", variant = "tonal", padding = "none", doneColor = "emerald", nextColor = "neutral", errorColor: errorColor2 = "rose", animated = true, disabled = false, onStepSelect, renderActiveContent, popoverProps, className, style, "aria-label": label = "Workflow progress", ...surface }) {
|
|
78193
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
77938
78194
|
const plan = planDotSteps(steps, currentIndex, currentStepId, maxVisible);
|
|
77939
78195
|
const density = sizes[size];
|
|
77940
78196
|
const fill = (status) => status === "completed" ? getTrueColorDotClass(doneColor) : status === "error" ? getTrueColorDotClass(errorColor2) : status === "active" ? getTrueColorDotClass(tone) : (0, import_classnames147.default)(getTrueColorDotClass(nextColor), "opacity-20 dark:opacity-25");
|
|
77941
78197
|
const overflow = (side, count) => count > 0 && /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(TooltipWrapper_default, { text: `${count} more steps ${side}`, children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { tabIndex: disabled ? -1 : 0, role: "img", "aria-label": `${count} more steps ${side}`, className: (0, import_classnames147.default)("relative inline-flex shrink-0 items-center justify-center rounded-full focus-visible:outline-2 focus-visible:outline-offset-2", density.target), children: /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { "aria-hidden": "true", className: (0, import_classnames147.default)("relative inline-flex items-center", density.stack), children: [0, 1].map((index) => /* @__PURE__ */ (0, import_jsx_runtime350.jsx)("span", { className: (0, import_classnames147.default)("absolute rounded-full", density.dot, fill(overflowStatus(side === "before" ? plan.statuses.slice(0, plan.start) : plan.statuses.slice(plan.end)))), style: { left: index === 0 ? 0 : "35%", transform: "scale(.72)", filter: index === (side === "before" ? 0 : 1) ? "opacity(.55)" : void 0, zIndex: side === "before" ? index : 1 - index } }, index)) }) }) }, side);
|
|
77942
|
-
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(Panel_default, { ...surface, role: "group", "aria-label": label, "aria-disabled": disabled || void 0, variant, tone, corner: corner === "full" ? "none" : corner, padding: "none", className: (0, import_classnames147.default)("align-middle", disabled && "opacity-50", className), style: { width: "max-content", overflow: "visible", ...corner === "full" ? { borderRadius: 9999 } : {}, ...style }, children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { className: (0, import_classnames147.default)("flex w-max items-center", density.gap, getCompactSurfacePaddingClass(padding)), children: [
|
|
78198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime350.jsx)(Panel_default, { ...surface, role: "group", "aria-label": label, "aria-disabled": disabled || void 0, variant, tone: surfaceTone, corner: corner === "full" ? "none" : corner, padding: "none", className: (0, import_classnames147.default)("align-middle", disabled && "opacity-50", className), style: { width: "max-content", overflow: "visible", ...corner === "full" ? { borderRadius: 9999 } : {}, ...style }, children: /* @__PURE__ */ (0, import_jsx_runtime350.jsxs)("div", { className: (0, import_classnames147.default)("flex w-max items-center", density.gap, getCompactSurfacePaddingClass(padding)), children: [
|
|
77943
78199
|
overflow("before", plan.before),
|
|
77944
78200
|
plan.indices.map((index) => {
|
|
77945
78201
|
const step = steps[index];
|
|
@@ -78068,7 +78324,7 @@ function MemoryCard({
|
|
|
78068
78324
|
] })
|
|
78069
78325
|
] })
|
|
78070
78326
|
] });
|
|
78071
|
-
return /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)(Panel_default, { tone: "
|
|
78327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime352.jsxs)(Panel_default, { tone: "none", variant: "outlined", padding: "none", disabled, ...surface, className: `kit-knowledge kit-memory-card ${className}`, "data-layout": layout, "data-selected": selected, "data-highlighted": highlighted, children: [
|
|
78072
78328
|
onSelect ? /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("button", { className: "kit-memory-select", type: "button", disabled, "aria-pressed": selected, onClick: () => onSelect(memory), children: body }) : /* @__PURE__ */ (0, import_jsx_runtime352.jsx)("div", { className: "kit-memory-select", children: body }),
|
|
78073
78329
|
/* @__PURE__ */ (0, import_jsx_runtime352.jsx)(MemoryActionButtons, { memory, disabled, onEdit, onPinChange, onArchive, copy })
|
|
78074
78330
|
] });
|
|
@@ -78205,7 +78461,7 @@ function MemoryLibrary({
|
|
|
78205
78461
|
function changeFilter(key, value) {
|
|
78206
78462
|
setFilters({ ...filters, [key]: value || void 0 });
|
|
78207
78463
|
}
|
|
78208
|
-
return /* @__PURE__ */ (0, import_jsx_runtime353.jsxs)(Panel_default, { tone: "
|
|
78464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime353.jsxs)(Panel_default, { tone: "none", variant: "outlined", padding: "none", loading, disabled, ...surface, className: `kit-knowledge kit-memory-library ${className}`, "aria-busy": loading, children: [
|
|
78209
78465
|
/* @__PURE__ */ (0, import_jsx_runtime353.jsxs)("div", { className: "kit-knowledge-toolbar", children: [
|
|
78210
78466
|
/* @__PURE__ */ (0, import_jsx_runtime353.jsxs)("label", { className: "kit-knowledge-search", children: [
|
|
78211
78467
|
/* @__PURE__ */ (0, import_jsx_runtime353.jsx)("span", { children: copy("search") }),
|
|
@@ -78270,7 +78526,7 @@ function MemoryDetail({
|
|
|
78270
78526
|
...surface
|
|
78271
78527
|
}) {
|
|
78272
78528
|
const copy = useKnowledgeCopy(labels);
|
|
78273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime354.jsx)(Panel_default, { tone: "
|
|
78529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime354.jsx)(Panel_default, { tone: "none", variant: "outlined", padding: "none", disabled, ...surface, className: `kit-knowledge kit-memory-detail ${className}`, children: !memory ? /* @__PURE__ */ (0, import_jsx_runtime354.jsx)("p", { className: "kit-knowledge-empty", children: copy("selectMemory") }) : /* @__PURE__ */ (0, import_jsx_runtime354.jsxs)("div", { className: "kit-memory-detail-body", children: [
|
|
78274
78530
|
/* @__PURE__ */ (0, import_jsx_runtime354.jsxs)("div", { className: "kit-memory-meta", children: [
|
|
78275
78531
|
/* @__PURE__ */ (0, import_jsx_runtime354.jsx)("span", { children: copy(`kinds.${memory.kind}`) }),
|
|
78276
78532
|
/* @__PURE__ */ (0, import_jsx_runtime354.jsx)("span", { children: copy(`statuses.${memory.status ?? "active"}`) }),
|
|
@@ -78520,7 +78776,7 @@ function KnowledgeMap({
|
|
|
78520
78776
|
const matches = (0, import_react328.useMemo)(() => scene.points.filter((point) => (!selectedTopic || point.memory.topic === selectedTopic) && `${point.memory.title} ${point.memory.topic ?? ""}`.toLocaleLowerCase().includes(query.toLocaleLowerCase())), [scene, query, selectedTopic]);
|
|
78521
78777
|
const lastPage = Math.max(0, Math.ceil(matches.length / PAGE_SIZE) - 1), currentPage = Math.min(page, lastPage);
|
|
78522
78778
|
const selectableRelationships = geometry.edges.filter((edge) => edge.source.memoryId === selection || edge.target.memoryId === selection);
|
|
78523
|
-
return /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(Panel_default, { tone: "
|
|
78779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime355.jsxs)(Panel_default, { tone: "none", variant: "outlined", padding: "none", loading, disabled, ...surface, className: `kit-knowledge kit-knowledge-map ${className}`, "aria-busy": loading, children: [
|
|
78524
78780
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "kit-knowledge-toolbar", children: [
|
|
78525
78781
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsx)("strong", { children: copy("map") }),
|
|
78526
78782
|
/* @__PURE__ */ (0, import_jsx_runtime355.jsxs)("div", { className: "kit-knowledge-view", children: [
|
|
@@ -78690,7 +78946,7 @@ function KnowledgeExplorer({
|
|
|
78690
78946
|
] });
|
|
78691
78947
|
return trace && /* @__PURE__ */ (0, import_jsx_runtime356.jsx)(TraceGraph, { ...trace, disabled: disabled || trace.disabled, nodes: traceNodes, selectedNodeId: traceId, onNodeSelect: (node) => selectTrace(node?.id ?? null) });
|
|
78692
78948
|
};
|
|
78693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime356.jsxs)(Panel_default, { tone: "
|
|
78949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime356.jsxs)(Panel_default, { tone: "none", variant: "simple", padding: "none", loading, disabled, ...surface, className: `kit-knowledge kit-knowledge-explorer ${className}`, children: [
|
|
78694
78950
|
/* @__PURE__ */ (0, import_jsx_runtime356.jsx)("div", { className: "kit-knowledge-mobile-nav", role: "group", "aria-label": copy("library"), children: enabled.map((region) => /* @__PURE__ */ (0, import_jsx_runtime356.jsx)("button", { type: "button", "aria-pressed": view === region, onClick: () => setMobileView(region), children: copy(region === "detail" ? "details" : region) }, region)) }),
|
|
78695
78951
|
/* @__PURE__ */ (0, import_jsx_runtime356.jsx)("div", { className: "kit-knowledge-regions", children: enabled.map((region) => /* @__PURE__ */ (0, import_jsx_runtime356.jsx)("section", { className: `kit-knowledge-region kit-knowledge-region-${region}`, "data-mobile-active": view === region, "aria-label": copy(region === "detail" ? "details" : region), children: content(region) }, region)) })
|
|
78696
78952
|
] });
|
|
@@ -78752,12 +79008,432 @@ function ContentActions({
|
|
|
78752
79008
|
}
|
|
78753
79009
|
var ContentActions_default = ContentActions;
|
|
78754
79010
|
|
|
79011
|
+
// src/components/CodeBlock.tsx
|
|
79012
|
+
var import_react330 = __toESM(require("react"), 1);
|
|
79013
|
+
var import_refractor = require("refractor");
|
|
79014
|
+
var import_tsx = __toESM(require("refractor/tsx"), 1);
|
|
79015
|
+
var import_jsx_runtime358 = require("react/jsx-runtime");
|
|
79016
|
+
import_refractor.refractor.register(import_tsx.default);
|
|
79017
|
+
function tokenRuns(nodes, inherited = "") {
|
|
79018
|
+
return nodes.flatMap((node) => {
|
|
79019
|
+
if (node.type === "text") return [{ text: node.value, className: inherited }];
|
|
79020
|
+
if (node.type !== "element") return [];
|
|
79021
|
+
const classes = node.properties.className;
|
|
79022
|
+
const className = [inherited, Array.isArray(classes) ? classes.join(" ") : String(classes ?? "")].filter(Boolean).join(" ");
|
|
79023
|
+
return tokenRuns(node.children, className);
|
|
79024
|
+
});
|
|
79025
|
+
}
|
|
79026
|
+
function renderLines(runs, numbered, value) {
|
|
79027
|
+
const lines = [[]];
|
|
79028
|
+
let key = 0;
|
|
79029
|
+
for (const run of runs) {
|
|
79030
|
+
run.text.split("\n").forEach((text2, index) => {
|
|
79031
|
+
if (index) lines.push([]);
|
|
79032
|
+
if (text2) lines[lines.length - 1].push(/* @__PURE__ */ (0, import_jsx_runtime358.jsx)("span", { className: run.className || void 0, children: text2 }, key++));
|
|
79033
|
+
});
|
|
79034
|
+
}
|
|
79035
|
+
const digits = String(value.split("\n").length).length;
|
|
79036
|
+
return lines.map((line3, index) => /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)(import_react330.default.Fragment, { children: [
|
|
79037
|
+
index > 0 ? "\n" : null,
|
|
79038
|
+
/* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("span", { className: "ui-code-block-line", children: [
|
|
79039
|
+
numbered && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("span", { className: "ui-code-block-line-number", "aria-hidden": "true", "data-line": index + 1, style: { width: `${digits}ch` } }),
|
|
79040
|
+
/* @__PURE__ */ (0, import_jsx_runtime358.jsx)("span", { className: "ui-code-block-line-text", children: line3 })
|
|
79041
|
+
] })
|
|
79042
|
+
] }, index));
|
|
79043
|
+
}
|
|
79044
|
+
function CodeBlock({
|
|
79045
|
+
value,
|
|
79046
|
+
onChange,
|
|
79047
|
+
readOnly = true,
|
|
79048
|
+
language,
|
|
79049
|
+
filename,
|
|
79050
|
+
showTitle = true,
|
|
79051
|
+
showCopy = true,
|
|
79052
|
+
showLineNumbers = false,
|
|
79053
|
+
wrapLines = false,
|
|
79054
|
+
maxHeight,
|
|
79055
|
+
tone = "none",
|
|
79056
|
+
color: color2 = "blue",
|
|
79057
|
+
variant = "subtle",
|
|
79058
|
+
corner = "rounded-md",
|
|
79059
|
+
editorLabel,
|
|
79060
|
+
className,
|
|
79061
|
+
...rest
|
|
79062
|
+
}) {
|
|
79063
|
+
const t = useKitT();
|
|
79064
|
+
const [copyState, setCopyState] = (0, import_react330.useState)("idle");
|
|
79065
|
+
const timer = (0, import_react330.useRef)(void 0);
|
|
79066
|
+
const generation = (0, import_react330.useRef)(0);
|
|
79067
|
+
(0, import_react330.useEffect)(() => {
|
|
79068
|
+
generation.current++;
|
|
79069
|
+
setCopyState("idle");
|
|
79070
|
+
clearTimeout(timer.current);
|
|
79071
|
+
return () => {
|
|
79072
|
+
generation.current++;
|
|
79073
|
+
clearTimeout(timer.current);
|
|
79074
|
+
};
|
|
79075
|
+
}, [value]);
|
|
79076
|
+
const highlighted = (0, import_react330.useMemo)(() => {
|
|
79077
|
+
if (!readOnly || !language) return [{ text: value, className: "" }];
|
|
79078
|
+
try {
|
|
79079
|
+
return tokenRuns(import_refractor.refractor.highlight(value, language.toLowerCase()).children);
|
|
79080
|
+
} catch {
|
|
79081
|
+
return [{ text: value, className: "" }];
|
|
79082
|
+
}
|
|
79083
|
+
}, [value, language, readOnly]);
|
|
79084
|
+
const copy = async () => {
|
|
79085
|
+
const current = ++generation.current;
|
|
79086
|
+
clearTimeout(timer.current);
|
|
79087
|
+
try {
|
|
79088
|
+
await navigator.clipboard.writeText(value);
|
|
79089
|
+
if (current !== generation.current) return;
|
|
79090
|
+
setCopyState("success");
|
|
79091
|
+
} catch {
|
|
79092
|
+
if (current !== generation.current) return;
|
|
79093
|
+
setCopyState("error");
|
|
79094
|
+
}
|
|
79095
|
+
timer.current = setTimeout(() => setCopyState("idle"), 2e3);
|
|
79096
|
+
};
|
|
79097
|
+
const copyLabel = t(copyState === "success" ? "kit.codeBlock.copied" : "kit.codeBlock.copy");
|
|
79098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("div", { ...rest, className: ["ui-code-block relative w-full min-w-0", className].filter(Boolean).join(" "), children: /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)(Panel_default, { className: "ui-code-block-surface", tone, variant, corner, padding: "none", bodyClassName: "min-w-0 overflow-hidden", children: [
|
|
79099
|
+
(showTitle || showCopy) && /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("div", { "data-slot": "code-block-header", className: `relative flex min-w-0 items-center gap-3 px-4 py-2 ${showTitle ? "justify-between border-b border-current/10" : "justify-end"}`, children: [
|
|
79100
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("span", { className: "truncate font-mono text-xs", children: filename || language || t("kit.codeBlock.code") }),
|
|
79101
|
+
showCopy && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)(IconButton_default, { icon: copyState === "success" ? "Check" : "CopyClipboard", color: color2, variant: "ghost", size: "xs", srLabel: copyLabel, tooltip: copyLabel, onClick: copy })
|
|
79102
|
+
] }),
|
|
79103
|
+
/* @__PURE__ */ (0, import_jsx_runtime358.jsx)(
|
|
79104
|
+
ScrollArea_default,
|
|
79105
|
+
{
|
|
79106
|
+
variant: "hover",
|
|
79107
|
+
className: "ui-code-block-scroll",
|
|
79108
|
+
"data-wrap": wrapLines || void 0,
|
|
79109
|
+
style: { maxHeight },
|
|
79110
|
+
tabIndex: readOnly ? 0 : -1,
|
|
79111
|
+
role: "region",
|
|
79112
|
+
"aria-label": filename || t("kit.codeBlock.code"),
|
|
79113
|
+
children: readOnly ? /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("pre", { className: "ui-code-block-source", style: { whiteSpace: wrapLines ? "pre-wrap" : "pre", overflowWrap: wrapLines ? "anywhere" : void 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("code", { className: language ? `language-${language}` : void 0, children: renderLines(highlighted, showLineNumbers, value) }) }) : /* @__PURE__ */ (0, import_jsx_runtime358.jsxs)("div", { className: "ui-code-block-editor-layout", "data-wrap": wrapLines || void 0, children: [
|
|
79114
|
+
/* @__PURE__ */ (0, import_jsx_runtime358.jsx)("pre", { "aria-hidden": "true", className: "ui-code-block-editor-mirror", style: { whiteSpace: wrapLines ? "pre-wrap" : "pre", overflowWrap: wrapLines ? "anywhere" : void 0 }, children: value + "\n" }),
|
|
79115
|
+
/* @__PURE__ */ (0, import_jsx_runtime358.jsx)("textarea", { className: "ui-code-block-editor", "aria-label": editorLabel || t("kit.codeBlock.edit"), value, onChange: (event) => onChange?.(event.target.value), spellCheck: false, autoCapitalize: "off", autoCorrect: "off", wrap: wrapLines ? "soft" : "off" })
|
|
79116
|
+
] })
|
|
79117
|
+
}
|
|
79118
|
+
),
|
|
79119
|
+
/* @__PURE__ */ (0, import_jsx_runtime358.jsx)("span", { className: "sr-only", role: "status", children: copyState === "success" ? t("kit.codeBlock.copied") : copyState === "error" ? t("kit.codeBlock.copyFailed") : "" }),
|
|
79120
|
+
copyState === "error" && /* @__PURE__ */ (0, import_jsx_runtime358.jsx)("p", { className: "px-4 pb-2 text-xs", children: t("kit.codeBlock.copyFailed") })
|
|
79121
|
+
] }) });
|
|
79122
|
+
}
|
|
79123
|
+
|
|
79124
|
+
// src/components/FilterBar.tsx
|
|
79125
|
+
var import_react331 = require("react");
|
|
79126
|
+
var import_classnames149 = __toESM(require("classnames"), 1);
|
|
79127
|
+
var import_jsx_runtime359 = require("react/jsx-runtime");
|
|
79128
|
+
function normalize(filters, value) {
|
|
79129
|
+
return Object.assign(/* @__PURE__ */ Object.create(null), Object.fromEntries(filters.flatMap((filter) => {
|
|
79130
|
+
const selected = new Set(Object.prototype.hasOwnProperty.call(value, filter.id) ? value[filter.id] : []);
|
|
79131
|
+
const values = filter.options.filter((option) => selected.has(option.value)).map((option) => option.value);
|
|
79132
|
+
return values.length ? [[filter.id, values]] : [];
|
|
79133
|
+
})));
|
|
79134
|
+
}
|
|
79135
|
+
function FilterBar({
|
|
79136
|
+
searchProps,
|
|
79137
|
+
filters,
|
|
79138
|
+
value,
|
|
79139
|
+
defaultValue = {},
|
|
79140
|
+
onChange,
|
|
79141
|
+
filteredCount,
|
|
79142
|
+
totalCount,
|
|
79143
|
+
itemLabel,
|
|
79144
|
+
size = "md",
|
|
79145
|
+
color: color2 = "blue",
|
|
79146
|
+
showSearch = true,
|
|
79147
|
+
showFilterLabel = true,
|
|
79148
|
+
showEmptyState = true,
|
|
79149
|
+
showClearAll = true,
|
|
79150
|
+
showResultCount = true,
|
|
79151
|
+
showMenuCounts = true,
|
|
79152
|
+
variant = "outlined",
|
|
79153
|
+
tone = "neutral",
|
|
79154
|
+
corner = "rounded-sm",
|
|
79155
|
+
padding = "xs",
|
|
79156
|
+
transparency,
|
|
79157
|
+
glassOpacity = "frosted",
|
|
79158
|
+
vibrancy = "medium",
|
|
79159
|
+
buttonVariant = "outline",
|
|
79160
|
+
secondaryButtonVariant = "ghost",
|
|
79161
|
+
applyButtonVariant = "solid",
|
|
79162
|
+
buttonTone = color2,
|
|
79163
|
+
buttonSize = size,
|
|
79164
|
+
buttonCorner,
|
|
79165
|
+
buttonWeight = "normal",
|
|
79166
|
+
buttonDashed = true,
|
|
79167
|
+
menuVariant = "outlined",
|
|
79168
|
+
menuTone = "none",
|
|
79169
|
+
menuCorner,
|
|
79170
|
+
menuPadding: menuPadding2,
|
|
79171
|
+
chipVariant = "soft",
|
|
79172
|
+
chipTone = color2,
|
|
79173
|
+
spring = "snappy",
|
|
79174
|
+
disabled = false,
|
|
79175
|
+
className,
|
|
79176
|
+
"aria-label": ariaLabel
|
|
79177
|
+
}) {
|
|
79178
|
+
const t = useKitT();
|
|
79179
|
+
const buttonStyle = buttonCorner === void 0 ? void 0 : { borderRadius: getSurfaceCornerRem(buttonCorner) };
|
|
79180
|
+
const actionStyle = { color: buttonTone, size: buttonSize, weight: buttonWeight, style: buttonStyle };
|
|
79181
|
+
const surfaceClasses = getSurfaceVariantClasses(variant, tone, {
|
|
79182
|
+
transparency,
|
|
79183
|
+
liquidExtras: (0, import_classnames149.default)(getGlassVibrancyClass(vibrancy), getSurfaceGlassFillClass(tone, glassOpacity))
|
|
79184
|
+
});
|
|
79185
|
+
const [internal, setInternal] = (0, import_react331.useState)(defaultValue);
|
|
79186
|
+
const applied = normalize(filters, value ?? internal);
|
|
79187
|
+
const [open, setOpen] = (0, import_react331.useState)(false);
|
|
79188
|
+
const [category, setCategory] = (0, import_react331.useState)(null);
|
|
79189
|
+
const [draft, setDraft] = (0, import_react331.useState)([]);
|
|
79190
|
+
const anchor = (0, import_react331.useRef)(null);
|
|
79191
|
+
const searchRegion = (0, import_react331.useRef)(null);
|
|
79192
|
+
const searchId = (0, import_react331.useId)();
|
|
79193
|
+
const [expanded, setExpanded] = (0, import_react331.useState)(Boolean(searchProps.initialValue));
|
|
79194
|
+
const searchDisabled = disabled || searchProps.disabled;
|
|
79195
|
+
const active = filters.find((filter) => filter.id === category);
|
|
79196
|
+
const motion = CONTROL_SPRING_TOKENS[spring];
|
|
79197
|
+
const style = { "--fb-duration": `${motion.duration}ms`, "--fb-easing": motion.easing };
|
|
79198
|
+
const commit = (next) => {
|
|
79199
|
+
const normalized = normalize(filters, next);
|
|
79200
|
+
if (value === void 0) setInternal(normalized);
|
|
79201
|
+
onChange?.(normalized);
|
|
79202
|
+
};
|
|
79203
|
+
const close = (restore = false) => {
|
|
79204
|
+
setOpen(false);
|
|
79205
|
+
setCategory(null);
|
|
79206
|
+
setDraft([]);
|
|
79207
|
+
if (restore) anchor.current?.focus();
|
|
79208
|
+
};
|
|
79209
|
+
const edit = (filter) => {
|
|
79210
|
+
setDraft([...applied[filter.id] ?? []]);
|
|
79211
|
+
setCategory(filter.id);
|
|
79212
|
+
setOpen(true);
|
|
79213
|
+
};
|
|
79214
|
+
const previouslyExpanded = (0, import_react331.useRef)(expanded);
|
|
79215
|
+
(0, import_react331.useLayoutEffect)(() => {
|
|
79216
|
+
if (showSearch && expanded && !previouslyExpanded.current && !searchDisabled) searchRegion.current?.querySelector("input")?.focus();
|
|
79217
|
+
previouslyExpanded.current = expanded;
|
|
79218
|
+
}, [expanded, searchDisabled, showSearch]);
|
|
79219
|
+
(0, import_react331.useEffect)(() => {
|
|
79220
|
+
if (disabled || category !== null && (!active || active.disabled)) {
|
|
79221
|
+
setOpen(false);
|
|
79222
|
+
setCategory(null);
|
|
79223
|
+
setDraft([]);
|
|
79224
|
+
}
|
|
79225
|
+
}, [disabled, category, active]);
|
|
79226
|
+
const items = active ? active.options.map((option) => ({
|
|
79227
|
+
id: option.value,
|
|
79228
|
+
label: option.label,
|
|
79229
|
+
type: "checkbox",
|
|
79230
|
+
checked: draft.includes(option.value),
|
|
79231
|
+
disabled: option.disabled,
|
|
79232
|
+
badge: showMenuCounts ? option.count : void 0,
|
|
79233
|
+
onCheckedChange: (checked) => setDraft((current) => checked ? [.../* @__PURE__ */ new Set([...current, option.value])] : current.filter((entry) => entry !== option.value))
|
|
79234
|
+
})) : filters.map((filter) => ({
|
|
79235
|
+
id: filter.id,
|
|
79236
|
+
label: filter.label,
|
|
79237
|
+
badge: showMenuCounts ? filter.count ?? filter.options.length : void 0,
|
|
79238
|
+
disabled: filter.disabled,
|
|
79239
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(CustomIcon_default, { icon: "ChevronRight", size: "sm" }),
|
|
79240
|
+
closeOnSelect: false,
|
|
79241
|
+
command: () => edit(filter)
|
|
79242
|
+
}));
|
|
79243
|
+
const chips = filters.filter((filter) => applied[filter.id]?.length).map((filter) => ({
|
|
79244
|
+
id: filter.id,
|
|
79245
|
+
label: `${filter.label}: ${filter.options.filter((option) => applied[filter.id].includes(option.value)).map((option) => option.label).join(", ")}`,
|
|
79246
|
+
disabled: disabled || filter.disabled,
|
|
79247
|
+
edit: () => edit(filter),
|
|
79248
|
+
remove: () => {
|
|
79249
|
+
const next = { ...applied };
|
|
79250
|
+
delete next[filter.id];
|
|
79251
|
+
commit(next);
|
|
79252
|
+
anchor.current?.focus();
|
|
79253
|
+
}
|
|
79254
|
+
}));
|
|
79255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(
|
|
79256
|
+
"div",
|
|
79257
|
+
{
|
|
79258
|
+
role: "group",
|
|
79259
|
+
"aria-label": ariaLabel ?? t("kit.filterbar.filters"),
|
|
79260
|
+
className: (0, import_classnames149.default)("kit-filter-bar flex min-w-0 flex-wrap items-center gap-2 text-sm", surfaceClasses, getSurfaceCornerClass(corner), getSurfacePaddingClass(padding), className),
|
|
79261
|
+
style,
|
|
79262
|
+
onBlurCapture: (event) => {
|
|
79263
|
+
const menu = event.target.closest("[data-menu-owner]");
|
|
79264
|
+
const next = event.relatedTarget;
|
|
79265
|
+
if (open && menu && !menu.contains(next) && !event.currentTarget.contains(next)) close();
|
|
79266
|
+
},
|
|
79267
|
+
onKeyDownCapture: (event) => {
|
|
79268
|
+
if (open && active && event.key === "Tab") event.stopPropagation();
|
|
79269
|
+
if (open && category && event.key === "ArrowLeft") {
|
|
79270
|
+
event.preventDefault();
|
|
79271
|
+
event.stopPropagation();
|
|
79272
|
+
setCategory(null);
|
|
79273
|
+
setDraft([]);
|
|
79274
|
+
}
|
|
79275
|
+
if (open && event.key === "Escape") {
|
|
79276
|
+
event.preventDefault();
|
|
79277
|
+
event.stopPropagation();
|
|
79278
|
+
close(true);
|
|
79279
|
+
}
|
|
79280
|
+
},
|
|
79281
|
+
children: [
|
|
79282
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(
|
|
79283
|
+
"div",
|
|
79284
|
+
{
|
|
79285
|
+
ref: searchRegion,
|
|
79286
|
+
className: "fb-search",
|
|
79287
|
+
"data-expanded": expanded,
|
|
79288
|
+
hidden: !showSearch,
|
|
79289
|
+
inert: !showSearch,
|
|
79290
|
+
onBlur: (event) => {
|
|
79291
|
+
if (!event.currentTarget.contains(event.relatedTarget) && !event.currentTarget.querySelector("input")?.value) setExpanded(false);
|
|
79292
|
+
},
|
|
79293
|
+
children: [
|
|
79294
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(
|
|
79295
|
+
Button_default,
|
|
79296
|
+
{
|
|
79297
|
+
...actionStyle,
|
|
79298
|
+
variant: "icon",
|
|
79299
|
+
leadingIcon: "Search",
|
|
79300
|
+
"aria-label": t("kit.filterbar.search"),
|
|
79301
|
+
"aria-expanded": expanded,
|
|
79302
|
+
"aria-controls": searchId,
|
|
79303
|
+
disabled: searchDisabled,
|
|
79304
|
+
className: "fb-search-trigger",
|
|
79305
|
+
hidden: expanded,
|
|
79306
|
+
onClick: () => setExpanded(true)
|
|
79307
|
+
}
|
|
79308
|
+
),
|
|
79309
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("div", { id: searchId, className: "fb-search-input", inert: !expanded, "aria-hidden": !expanded, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(SearchBar_default, { size, color: color2, ...searchProps, disabled: searchDisabled }) })
|
|
79310
|
+
]
|
|
79311
|
+
}
|
|
79312
|
+
),
|
|
79313
|
+
showSearch && (showFilterLabel || chips.length > 0 || showEmptyState) && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { "aria-hidden": "true", className: "h-5 border-l border-neutral-200 dark:border-neutral-700" }),
|
|
79314
|
+
showFilterLabel && /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("span", { className: "flex items-center gap-1.5 text-neutral-600 dark:text-neutral-300", children: [
|
|
79315
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("svg", { "aria-hidden": "true", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("path", { d: "M3 4h18l-7 8v8l-4-2v-6Z" }) }),
|
|
79316
|
+
t("kit.filterbar.filters")
|
|
79317
|
+
] }),
|
|
79318
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(FilterChips, { chips, color: chipTone, variant: chipVariant, size, buttonTone, buttonStyle, removeLabel: (label) => t("kit.filterbar.remove", { label }) }),
|
|
79319
|
+
showEmptyState && !chips.length && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "text-neutral-400", children: t("kit.filterbar.empty") }),
|
|
79320
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("div", { className: "flex flex-1 flex-wrap items-center justify-end gap-2", children: [
|
|
79321
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(
|
|
79322
|
+
Button_default,
|
|
79323
|
+
{
|
|
79324
|
+
...actionStyle,
|
|
79325
|
+
ref: anchor,
|
|
79326
|
+
variant: buttonVariant,
|
|
79327
|
+
leadingIcon: "Add",
|
|
79328
|
+
disabled: disabled || !filters.length,
|
|
79329
|
+
className: (0, import_classnames149.default)(buttonCorner === void 0 && "rounded-full", buttonDashed && buttonVariant === "outline" && "border-dashed"),
|
|
79330
|
+
"aria-haspopup": "menu",
|
|
79331
|
+
"aria-expanded": open,
|
|
79332
|
+
onClick: () => {
|
|
79333
|
+
if (open) close();
|
|
79334
|
+
else {
|
|
79335
|
+
setCategory(null);
|
|
79336
|
+
setOpen(true);
|
|
79337
|
+
}
|
|
79338
|
+
},
|
|
79339
|
+
onKeyDown: (event) => {
|
|
79340
|
+
if (event.key === "ArrowDown") {
|
|
79341
|
+
event.preventDefault();
|
|
79342
|
+
setCategory(null);
|
|
79343
|
+
setOpen(true);
|
|
79344
|
+
}
|
|
79345
|
+
},
|
|
79346
|
+
children: t("kit.filterbar.add")
|
|
79347
|
+
}
|
|
79348
|
+
),
|
|
79349
|
+
showClearAll && chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: secondaryButtonVariant, disabled, onClick: () => {
|
|
79350
|
+
commit({});
|
|
79351
|
+
anchor.current?.focus();
|
|
79352
|
+
}, children: t("kit.filterbar.clearAll") }),
|
|
79353
|
+
showResultCount && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("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") }) })
|
|
79354
|
+
] }),
|
|
79355
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(
|
|
79356
|
+
Menu,
|
|
79357
|
+
{
|
|
79358
|
+
popup: true,
|
|
79359
|
+
anchorRef: anchor,
|
|
79360
|
+
open: open && !disabled,
|
|
79361
|
+
onOpenChange: (next) => {
|
|
79362
|
+
if (!next) close();
|
|
79363
|
+
},
|
|
79364
|
+
items,
|
|
79365
|
+
width: 320,
|
|
79366
|
+
size,
|
|
79367
|
+
variant: menuVariant,
|
|
79368
|
+
tone: menuTone,
|
|
79369
|
+
corner: menuCorner,
|
|
79370
|
+
padding: menuPadding2,
|
|
79371
|
+
className: "fb-menu",
|
|
79372
|
+
style,
|
|
79373
|
+
"aria-label": active?.label ?? t("kit.filterbar.filterBy"),
|
|
79374
|
+
renderItem: active ? (item) => /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(import_jsx_runtime359.Fragment, { children: [
|
|
79375
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("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__ */ (0, import_jsx_runtime359.jsx)(CustomIcon_default, { icon: "Check", size: "xs" }) }),
|
|
79376
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
79377
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "shrink-0 text-xs text-neutral-400", children: item.badge })
|
|
79378
|
+
] }) : void 0,
|
|
79379
|
+
header: active ? /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: secondaryButtonVariant, leadingIcon: "ChevronLeft", onClick: () => {
|
|
79380
|
+
setCategory(null);
|
|
79381
|
+
setDraft([]);
|
|
79382
|
+
}, "aria-label": t("kit.filterbar.back"), children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "uppercase tracking-wide", children: active.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { className: "px-3 text-xs uppercase tracking-wide text-neutral-400", children: t("kit.filterbar.filterBy") }),
|
|
79383
|
+
footer: active ? /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
79384
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(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") }),
|
|
79385
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { ...actionStyle, variant: applyButtonVariant, onClick: () => {
|
|
79386
|
+
commit({ ...applied, [active.id]: draft });
|
|
79387
|
+
close(true);
|
|
79388
|
+
}, children: t("kit.filterbar.done") })
|
|
79389
|
+
] }) : void 0
|
|
79390
|
+
},
|
|
79391
|
+
category ?? "categories"
|
|
79392
|
+
)
|
|
79393
|
+
]
|
|
79394
|
+
}
|
|
79395
|
+
);
|
|
79396
|
+
}
|
|
79397
|
+
function FilterChips({ chips, color: color2, variant, size, buttonTone, buttonStyle, removeLabel }) {
|
|
79398
|
+
const [visible, setVisible] = (0, import_react331.useState)(chips);
|
|
79399
|
+
const region = (0, import_react331.useRef)(null);
|
|
79400
|
+
const positions = (0, import_react331.useRef)(/* @__PURE__ */ new Map());
|
|
79401
|
+
const signature = chips.map((chip) => chip.id).join("\0");
|
|
79402
|
+
(0, import_react331.useEffect)(() => {
|
|
79403
|
+
const timer = setTimeout(() => setVisible((current) => current.filter((chip) => signature.split("\0").includes(chip.id))), 900);
|
|
79404
|
+
return () => clearTimeout(timer);
|
|
79405
|
+
}, [signature]);
|
|
79406
|
+
(0, import_react331.useLayoutEffect)(() => {
|
|
79407
|
+
setVisible((current) => [...chips, ...current.filter((chip) => !chips.some((next) => next.id === chip.id))]);
|
|
79408
|
+
}, [signature]);
|
|
79409
|
+
(0, import_react331.useLayoutEffect)(() => {
|
|
79410
|
+
if (typeof matchMedia === "undefined" || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
79411
|
+
const next = /* @__PURE__ */ new Map();
|
|
79412
|
+
region.current?.querySelectorAll("[data-chip]").forEach((element) => {
|
|
79413
|
+
const key = element.dataset.chip;
|
|
79414
|
+
const left = element.getBoundingClientRect().left;
|
|
79415
|
+
const previous = positions.current.get(key);
|
|
79416
|
+
if (previous !== void 0 && previous !== left) element.animate?.([{ transform: `translateX(${previous - left}px)` }, { transform: "translateX(0)" }], { duration: 320, easing: "ease-out" });
|
|
79417
|
+
next.set(key, left);
|
|
79418
|
+
});
|
|
79419
|
+
positions.current = next;
|
|
79420
|
+
});
|
|
79421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("div", { ref: region, className: "contents", children: visible.map((old) => {
|
|
79422
|
+
const chip = chips.find((current) => current.id === old.id);
|
|
79423
|
+
const entry = chip ?? old;
|
|
79424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { "data-chip": entry.id, className: "fb-chip", "data-exiting": !chip, inert: !chip, "aria-hidden": !chip, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Badge_default, { tone: color2, variant, size, ring: false, className: "max-w-full py-1", children: /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("span", { className: "flex min-w-0 items-center gap-1", children: [
|
|
79425
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)("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 }),
|
|
79426
|
+
/* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Button_default, { variant: "icon", size: "xs", color: buttonTone, style: buttonStyle, leadingIcon: "Close", disabled: entry.disabled, "aria-label": removeLabel(entry.label), onClick: entry.remove })
|
|
79427
|
+
] }) }) }, entry.id);
|
|
79428
|
+
}) });
|
|
79429
|
+
}
|
|
79430
|
+
|
|
78755
79431
|
// src/contexts/BottomSheetContext.tsx
|
|
78756
|
-
var
|
|
79432
|
+
var import_react332 = require("react");
|
|
78757
79433
|
var import_react_dom21 = require("react-dom");
|
|
78758
|
-
var
|
|
78759
|
-
var
|
|
78760
|
-
var BottomSheetContext = (0,
|
|
79434
|
+
var import_classnames150 = __toESM(require("classnames"), 1);
|
|
79435
|
+
var import_jsx_runtime360 = require("react/jsx-runtime");
|
|
79436
|
+
var BottomSheetContext = (0, import_react332.createContext)(null);
|
|
78761
79437
|
var TRANSITION_MS2 = 260;
|
|
78762
79438
|
var renderSlot = (slot, controls) => {
|
|
78763
79439
|
if (!slot) {
|
|
@@ -78768,13 +79444,13 @@ var renderSlot = (slot, controls) => {
|
|
|
78768
79444
|
var BottomSheetProvider = ({
|
|
78769
79445
|
children
|
|
78770
79446
|
}) => {
|
|
78771
|
-
const [sheet, setSheet] = (0,
|
|
78772
|
-
const [isVisible, setIsVisible] = (0,
|
|
78773
|
-
const pendingCloseRef = (0,
|
|
78774
|
-
const dismissSheet = (0,
|
|
79447
|
+
const [sheet, setSheet] = (0, import_react332.useState)(null);
|
|
79448
|
+
const [isVisible, setIsVisible] = (0, import_react332.useState)(false);
|
|
79449
|
+
const pendingCloseRef = (0, import_react332.useRef)(null);
|
|
79450
|
+
const dismissSheet = (0, import_react332.useCallback)(() => {
|
|
78775
79451
|
setIsVisible(false);
|
|
78776
79452
|
}, []);
|
|
78777
|
-
const presentSheet = (0,
|
|
79453
|
+
const presentSheet = (0, import_react332.useCallback)((options) => {
|
|
78778
79454
|
if (pendingCloseRef.current) {
|
|
78779
79455
|
clearTimeout(pendingCloseRef.current);
|
|
78780
79456
|
pendingCloseRef.current = null;
|
|
@@ -78787,7 +79463,7 @@ var BottomSheetProvider = ({
|
|
|
78787
79463
|
setTimeout(animateIn, 0);
|
|
78788
79464
|
}
|
|
78789
79465
|
}, []);
|
|
78790
|
-
(0,
|
|
79466
|
+
(0, import_react332.useEffect)(() => {
|
|
78791
79467
|
if (!isVisible && sheet) {
|
|
78792
79468
|
pendingCloseRef.current = setTimeout(() => {
|
|
78793
79469
|
sheet.onClose?.();
|
|
@@ -78802,7 +79478,7 @@ var BottomSheetProvider = ({
|
|
|
78802
79478
|
}
|
|
78803
79479
|
return void 0;
|
|
78804
79480
|
}, [isVisible, sheet]);
|
|
78805
|
-
(0,
|
|
79481
|
+
(0, import_react332.useEffect)(
|
|
78806
79482
|
() => () => {
|
|
78807
79483
|
if (pendingCloseRef.current) {
|
|
78808
79484
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -78810,13 +79486,13 @@ var BottomSheetProvider = ({
|
|
|
78810
79486
|
},
|
|
78811
79487
|
[]
|
|
78812
79488
|
);
|
|
78813
|
-
const controls = (0,
|
|
79489
|
+
const controls = (0, import_react332.useMemo)(
|
|
78814
79490
|
() => ({
|
|
78815
79491
|
dismiss: dismissSheet
|
|
78816
79492
|
}),
|
|
78817
79493
|
[dismissSheet]
|
|
78818
79494
|
);
|
|
78819
|
-
const contextValue = (0,
|
|
79495
|
+
const contextValue = (0, import_react332.useMemo)(
|
|
78820
79496
|
() => ({
|
|
78821
79497
|
presentSheet,
|
|
78822
79498
|
dismissSheet,
|
|
@@ -78826,11 +79502,11 @@ var BottomSheetProvider = ({
|
|
|
78826
79502
|
[presentSheet, dismissSheet, sheet, isVisible]
|
|
78827
79503
|
);
|
|
78828
79504
|
const overlayNode = typeof document !== "undefined" && sheet ? (0, import_react_dom21.createPortal)(
|
|
78829
|
-
/* @__PURE__ */ (0,
|
|
78830
|
-
/* @__PURE__ */ (0,
|
|
79505
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
|
|
79506
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsx)(
|
|
78831
79507
|
"div",
|
|
78832
79508
|
{
|
|
78833
|
-
className: (0,
|
|
79509
|
+
className: (0, import_classnames150.default)(
|
|
78834
79510
|
"absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
|
|
78835
79511
|
isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
78836
79512
|
),
|
|
@@ -78840,24 +79516,24 @@ var BottomSheetProvider = ({
|
|
|
78840
79516
|
}
|
|
78841
79517
|
}
|
|
78842
79518
|
),
|
|
78843
|
-
/* @__PURE__ */ (0,
|
|
79519
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ (0, import_jsx_runtime360.jsxs)(
|
|
78844
79520
|
"section",
|
|
78845
79521
|
{
|
|
78846
79522
|
role: "dialog",
|
|
78847
79523
|
"aria-modal": "true",
|
|
78848
|
-
className: (0,
|
|
79524
|
+
className: (0, import_classnames150.default)(
|
|
78849
79525
|
"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",
|
|
78850
79526
|
sheet.className,
|
|
78851
79527
|
isVisible ? "translate-y-0" : "translate-y-full"
|
|
78852
79528
|
),
|
|
78853
79529
|
style: { minHeight: "25vh", maxHeight: "85vh" },
|
|
78854
79530
|
children: [
|
|
78855
|
-
/* @__PURE__ */ (0,
|
|
78856
|
-
/* @__PURE__ */ (0,
|
|
78857
|
-
sheet.title && /* @__PURE__ */ (0,
|
|
78858
|
-
sheet.description && /* @__PURE__ */ (0,
|
|
79531
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
79532
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsxs)("div", { className: "space-y-1", children: [
|
|
79533
|
+
sheet.title && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
|
|
79534
|
+
sheet.description && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
|
|
78859
79535
|
] }),
|
|
78860
|
-
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0,
|
|
79536
|
+
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)(
|
|
78861
79537
|
IconButton_default,
|
|
78862
79538
|
{
|
|
78863
79539
|
icon: "Close",
|
|
@@ -78869,21 +79545,21 @@ var BottomSheetProvider = ({
|
|
|
78869
79545
|
}
|
|
78870
79546
|
)
|
|
78871
79547
|
] }),
|
|
78872
|
-
/* @__PURE__ */ (0,
|
|
78873
|
-
sheet.actions && /* @__PURE__ */ (0,
|
|
79548
|
+
/* @__PURE__ */ (0, import_jsx_runtime360.jsx)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
|
|
79549
|
+
sheet.actions && /* @__PURE__ */ (0, import_jsx_runtime360.jsx)("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) })
|
|
78874
79550
|
]
|
|
78875
79551
|
}
|
|
78876
79552
|
) })
|
|
78877
79553
|
] }),
|
|
78878
79554
|
document.body
|
|
78879
79555
|
) : null;
|
|
78880
|
-
return /* @__PURE__ */ (0,
|
|
79556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime360.jsxs)(BottomSheetContext.Provider, { value: contextValue, children: [
|
|
78881
79557
|
children,
|
|
78882
79558
|
overlayNode
|
|
78883
79559
|
] });
|
|
78884
79560
|
};
|
|
78885
79561
|
var useBottomSheet = () => {
|
|
78886
|
-
const context = (0,
|
|
79562
|
+
const context = (0, import_react332.useContext)(BottomSheetContext);
|
|
78887
79563
|
if (!context) {
|
|
78888
79564
|
throw new Error("useBottomSheet must be used within a BottomSheetProvider");
|
|
78889
79565
|
}
|
|
@@ -79517,8 +80193,8 @@ var SYSTEM_VARIABLES = [
|
|
|
79517
80193
|
];
|
|
79518
80194
|
|
|
79519
80195
|
// src/components/MetricBar.tsx
|
|
79520
|
-
var
|
|
79521
|
-
var
|
|
80196
|
+
var import_classnames151 = __toESM(require("classnames"), 1);
|
|
80197
|
+
var import_jsx_runtime361 = require("react/jsx-runtime");
|
|
79522
80198
|
var MetricBar = ({
|
|
79523
80199
|
label,
|
|
79524
80200
|
value,
|
|
@@ -79528,7 +80204,7 @@ var MetricBar = ({
|
|
|
79528
80204
|
size = "sm",
|
|
79529
80205
|
className,
|
|
79530
80206
|
...rest
|
|
79531
|
-
}) => /* @__PURE__ */ (0,
|
|
80207
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime361.jsx)(
|
|
79532
80208
|
Progress_default,
|
|
79533
80209
|
{
|
|
79534
80210
|
...rest,
|
|
@@ -79538,13 +80214,13 @@ var MetricBar = ({
|
|
|
79538
80214
|
formatValue: value !== void 0 ? () => String(value) : void 0,
|
|
79539
80215
|
size,
|
|
79540
80216
|
color: tone ?? color2 ?? "blue",
|
|
79541
|
-
className: (0,
|
|
80217
|
+
className: (0, import_classnames151.default)("w-full", className)
|
|
79542
80218
|
}
|
|
79543
80219
|
);
|
|
79544
80220
|
MetricBar.displayName = "MetricBar";
|
|
79545
80221
|
|
|
79546
80222
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
79547
|
-
var
|
|
80223
|
+
var import_react334 = require("react");
|
|
79548
80224
|
|
|
79549
80225
|
// src/components/NetworkGraph/model.ts
|
|
79550
80226
|
var CELL = 64;
|
|
@@ -79688,17 +80364,17 @@ function findNetworkPath(edges, source, target) {
|
|
|
79688
80364
|
}
|
|
79689
80365
|
|
|
79690
80366
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
79691
|
-
var
|
|
80367
|
+
var import_react333 = require("react");
|
|
79692
80368
|
function useNetworkCanvas(options) {
|
|
79693
|
-
const canvasRef = (0,
|
|
79694
|
-
const view = (0,
|
|
79695
|
-
const size = (0,
|
|
79696
|
-
const latest = (0,
|
|
79697
|
-
const frame = (0,
|
|
79698
|
-
const [zoom, setZoom] = (0,
|
|
79699
|
-
const colors3 = (0,
|
|
79700
|
-
const textColor = (0,
|
|
79701
|
-
const draw = (0,
|
|
80369
|
+
const canvasRef = (0, import_react333.useRef)(null);
|
|
80370
|
+
const view = (0, import_react333.useRef)({ x: 0, y: 0, zoom: 1 });
|
|
80371
|
+
const size = (0, import_react333.useRef)({ width: 1, height: 1 });
|
|
80372
|
+
const latest = (0, import_react333.useRef)(options);
|
|
80373
|
+
const frame = (0, import_react333.useRef)(null);
|
|
80374
|
+
const [zoom, setZoom] = (0, import_react333.useState)(1);
|
|
80375
|
+
const colors3 = (0, import_react333.useRef)(/* @__PURE__ */ new Map());
|
|
80376
|
+
const textColor = (0, import_react333.useRef)("#737373");
|
|
80377
|
+
const draw = (0, import_react333.useCallback)(() => {
|
|
79702
80378
|
const canvas = canvasRef.current;
|
|
79703
80379
|
const ctx = canvas?.getContext("2d");
|
|
79704
80380
|
if (!canvas || !ctx) return;
|
|
@@ -79798,14 +80474,14 @@ function useNetworkCanvas(options) {
|
|
|
79798
80474
|
}
|
|
79799
80475
|
ctx.globalAlpha = 1;
|
|
79800
80476
|
}, []);
|
|
79801
|
-
const requestDraw = (0,
|
|
80477
|
+
const requestDraw = (0, import_react333.useCallback)(() => {
|
|
79802
80478
|
if (frame.current !== null) return;
|
|
79803
80479
|
frame.current = requestAnimationFrame(() => {
|
|
79804
80480
|
frame.current = null;
|
|
79805
80481
|
draw();
|
|
79806
80482
|
});
|
|
79807
80483
|
}, [draw]);
|
|
79808
|
-
const update = (0,
|
|
80484
|
+
const update = (0, import_react333.useCallback)(
|
|
79809
80485
|
(next) => {
|
|
79810
80486
|
view.current = next;
|
|
79811
80487
|
setZoom(next.zoom);
|
|
@@ -79814,7 +80490,7 @@ function useNetworkCanvas(options) {
|
|
|
79814
80490
|
},
|
|
79815
80491
|
[requestDraw]
|
|
79816
80492
|
);
|
|
79817
|
-
const fit = (0,
|
|
80493
|
+
const fit = (0, import_react333.useCallback)(
|
|
79818
80494
|
() => update(
|
|
79819
80495
|
fitNetwork(
|
|
79820
80496
|
latest.current.nodes,
|
|
@@ -79824,11 +80500,11 @@ function useNetworkCanvas(options) {
|
|
|
79824
80500
|
),
|
|
79825
80501
|
[update]
|
|
79826
80502
|
);
|
|
79827
|
-
const zoomBy = (0,
|
|
80503
|
+
const zoomBy = (0, import_react333.useCallback)(
|
|
79828
80504
|
(factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
|
|
79829
80505
|
[update]
|
|
79830
80506
|
);
|
|
79831
|
-
const focusNode = (0,
|
|
80507
|
+
const focusNode = (0, import_react333.useCallback)(
|
|
79832
80508
|
(node) => {
|
|
79833
80509
|
update({
|
|
79834
80510
|
...view.current,
|
|
@@ -79838,14 +80514,14 @@ function useNetworkCanvas(options) {
|
|
|
79838
80514
|
},
|
|
79839
80515
|
[update]
|
|
79840
80516
|
);
|
|
79841
|
-
(0,
|
|
80517
|
+
(0, import_react333.useEffect)(() => {
|
|
79842
80518
|
latest.current = options;
|
|
79843
80519
|
requestDraw();
|
|
79844
80520
|
}, [options, requestDraw]);
|
|
79845
|
-
(0,
|
|
80521
|
+
(0, import_react333.useEffect)(() => {
|
|
79846
80522
|
fit();
|
|
79847
80523
|
}, [options.model, fit]);
|
|
79848
|
-
(0,
|
|
80524
|
+
(0, import_react333.useEffect)(() => {
|
|
79849
80525
|
const canvas = canvasRef.current;
|
|
79850
80526
|
if (!canvas) return;
|
|
79851
80527
|
const measure = () => {
|
|
@@ -79898,7 +80574,7 @@ function useNetworkCanvas(options) {
|
|
|
79898
80574
|
}
|
|
79899
80575
|
|
|
79900
80576
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
79901
|
-
var
|
|
80577
|
+
var import_jsx_runtime362 = require("react/jsx-runtime");
|
|
79902
80578
|
var NO_COMMUNITIES = [];
|
|
79903
80579
|
var NO_HIGHLIGHTS = [];
|
|
79904
80580
|
function NetworkGraph({
|
|
@@ -79922,18 +80598,19 @@ function NetworkGraph({
|
|
|
79922
80598
|
ariaLabel,
|
|
79923
80599
|
emptyMessage,
|
|
79924
80600
|
onViewportChange,
|
|
79925
|
-
tone = "
|
|
80601
|
+
tone: surfaceTone = "none",
|
|
79926
80602
|
variant = "elevated",
|
|
79927
80603
|
disabled = false,
|
|
79928
80604
|
loading = false,
|
|
79929
80605
|
...panelProps
|
|
79930
80606
|
}) {
|
|
80607
|
+
const tone = getSurfaceAccentColor(surfaceTone);
|
|
79931
80608
|
const t = useKitT();
|
|
79932
|
-
const helpId = (0,
|
|
79933
|
-
const layoutRef = (0,
|
|
79934
|
-
const [hasLegendSpace, setHasLegendSpace] = (0,
|
|
80609
|
+
const helpId = (0, import_react334.useId)();
|
|
80610
|
+
const layoutRef = (0, import_react334.useRef)(null);
|
|
80611
|
+
const [hasLegendSpace, setHasLegendSpace] = (0, import_react334.useState)(true);
|
|
79935
80612
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
79936
|
-
(0,
|
|
80613
|
+
(0, import_react334.useEffect)(() => {
|
|
79937
80614
|
const element = layoutRef.current;
|
|
79938
80615
|
if (!element || legendPosition !== "auto") return;
|
|
79939
80616
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -79942,38 +80619,38 @@ function NetworkGraph({
|
|
|
79942
80619
|
observer.observe(element);
|
|
79943
80620
|
return () => observer.disconnect();
|
|
79944
80621
|
}, [legendPosition, loading]);
|
|
79945
|
-
const model = (0,
|
|
80622
|
+
const model = (0, import_react334.useMemo)(
|
|
79946
80623
|
() => buildNetwork(nodes, edges, communities),
|
|
79947
80624
|
[nodes, edges, communities]
|
|
79948
80625
|
);
|
|
79949
|
-
const [internalSelected, setInternalSelected] = (0,
|
|
80626
|
+
const [internalSelected, setInternalSelected] = (0, import_react334.useState)(
|
|
79950
80627
|
defaultSelectedNodeId
|
|
79951
80628
|
);
|
|
79952
|
-
const [hidden, setHidden] = (0,
|
|
79953
|
-
const [focused, setFocused] = (0,
|
|
79954
|
-
const [query, setQuery] = (0,
|
|
79955
|
-
const enabled = (0,
|
|
80629
|
+
const [hidden, setHidden] = (0, import_react334.useState)(() => /* @__PURE__ */ new Set());
|
|
80630
|
+
const [focused, setFocused] = (0, import_react334.useState)(null);
|
|
80631
|
+
const [query, setQuery] = (0, import_react334.useState)("");
|
|
80632
|
+
const enabled = (0, import_react334.useMemo)(
|
|
79956
80633
|
() => new Set(
|
|
79957
80634
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
79958
80635
|
),
|
|
79959
80636
|
[visibleCommunityIds, model, hidden]
|
|
79960
80637
|
);
|
|
79961
|
-
const visibleNodes = (0,
|
|
80638
|
+
const visibleNodes = (0, import_react334.useMemo)(
|
|
79962
80639
|
() => model.nodes.filter((n) => !n.community || enabled.has(n.community)),
|
|
79963
80640
|
[model, enabled]
|
|
79964
80641
|
);
|
|
79965
|
-
const visible = (0,
|
|
80642
|
+
const visible = (0, import_react334.useMemo)(
|
|
79966
80643
|
() => new Set(visibleNodes.map((n) => n.id)),
|
|
79967
80644
|
[visibleNodes]
|
|
79968
80645
|
);
|
|
79969
80646
|
const selection = selectedNodeId === void 0 ? internalSelected : selectedNodeId;
|
|
79970
80647
|
const selected = selection !== null && visible.has(selection) ? selection : null;
|
|
79971
80648
|
const activeFocus = focused !== null && visible.has(focused) ? focused : null;
|
|
79972
|
-
const highlighted = (0,
|
|
80649
|
+
const highlighted = (0, import_react334.useMemo)(
|
|
79973
80650
|
() => new Set(highlightedEdgeIds),
|
|
79974
80651
|
[highlightedEdgeIds]
|
|
79975
80652
|
);
|
|
79976
|
-
const counts = (0,
|
|
80653
|
+
const counts = (0, import_react334.useMemo)(() => {
|
|
79977
80654
|
const result = /* @__PURE__ */ new Map();
|
|
79978
80655
|
for (const n of model.nodes)
|
|
79979
80656
|
if (n.community)
|
|
@@ -79993,7 +80670,7 @@ function NetworkGraph({
|
|
|
79993
80670
|
onViewportChange
|
|
79994
80671
|
});
|
|
79995
80672
|
const locked = disabled || loading;
|
|
79996
|
-
const drag = (0,
|
|
80673
|
+
const drag = (0, import_react334.useRef)(null);
|
|
79997
80674
|
const select = (id) => {
|
|
79998
80675
|
if (locked) return;
|
|
79999
80676
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -80009,7 +80686,7 @@ function NetworkGraph({
|
|
|
80009
80686
|
);
|
|
80010
80687
|
onVisibleCommunitiesChange?.(ids);
|
|
80011
80688
|
};
|
|
80012
|
-
(0,
|
|
80689
|
+
(0, import_react334.useEffect)(() => {
|
|
80013
80690
|
const element = canvas.canvasRef.current;
|
|
80014
80691
|
if (!element || locked) return;
|
|
80015
80692
|
const wheel = (event) => {
|
|
@@ -80058,13 +80735,13 @@ function NetworkGraph({
|
|
|
80058
80735
|
}
|
|
80059
80736
|
};
|
|
80060
80737
|
const focusedNode = model.byId.get(activeFocus ?? selected ?? "");
|
|
80061
|
-
const matchingNodes = (0,
|
|
80738
|
+
const matchingNodes = (0, import_react334.useMemo)(() => {
|
|
80062
80739
|
const search = query.toLocaleLowerCase();
|
|
80063
80740
|
return visibleNodes.filter((n) => (n.label ?? n.id).toLocaleLowerCase().includes(search)).slice(0, 50).map((n) => ({ value: n.id, label: n.label ?? n.id }));
|
|
80064
80741
|
}, [visibleNodes, query]);
|
|
80065
80742
|
const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
|
|
80066
|
-
const resolvedLegendTone = legendTone === "auto" ?
|
|
80067
|
-
const legendContent = /* @__PURE__ */ (0,
|
|
80743
|
+
const resolvedLegendTone = legendTone === "auto" ? surfaceTone : legendTone;
|
|
80744
|
+
const legendContent = /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80068
80745
|
"fieldset",
|
|
80069
80746
|
{
|
|
80070
80747
|
disabled: locked,
|
|
@@ -80073,24 +80750,24 @@ function NetworkGraph({
|
|
|
80073
80750
|
maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
|
|
80074
80751
|
},
|
|
80075
80752
|
children: [
|
|
80076
|
-
/* @__PURE__ */ (0,
|
|
80077
|
-
/* @__PURE__ */ (0,
|
|
80753
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
|
|
80754
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80078
80755
|
Checkbox_default,
|
|
80079
80756
|
{
|
|
80080
80757
|
size: "sm",
|
|
80081
|
-
tone: resolvedLegendTone,
|
|
80758
|
+
tone: getSurfaceAccentColor(resolvedLegendTone),
|
|
80082
80759
|
label: t("kit.networkGraph.selectAll"),
|
|
80083
80760
|
checked: model.groups.every((g) => enabled.has(g.id)),
|
|
80084
80761
|
indeterminate: model.groups.some((g) => enabled.has(g.id)) && !model.groups.every((g) => enabled.has(g.id)),
|
|
80085
80762
|
onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
|
|
80086
80763
|
}
|
|
80087
80764
|
),
|
|
80088
|
-
model.groups.map((group) => /* @__PURE__ */ (0,
|
|
80089
|
-
/* @__PURE__ */ (0,
|
|
80765
|
+
model.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
80766
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80090
80767
|
Checkbox_default,
|
|
80091
80768
|
{
|
|
80092
80769
|
size: "sm",
|
|
80093
|
-
tone: group.tone ?? resolvedLegendTone,
|
|
80770
|
+
tone: group.tone ?? getSurfaceAccentColor(resolvedLegendTone),
|
|
80094
80771
|
label: group.label,
|
|
80095
80772
|
checked: enabled.has(group.id),
|
|
80096
80773
|
onChange: (event) => filter(
|
|
@@ -80098,23 +80775,23 @@ function NetworkGraph({
|
|
|
80098
80775
|
)
|
|
80099
80776
|
}
|
|
80100
80777
|
),
|
|
80101
|
-
/* @__PURE__ */ (0,
|
|
80778
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
|
|
80102
80779
|
] }, group.id))
|
|
80103
80780
|
]
|
|
80104
80781
|
}
|
|
80105
80782
|
);
|
|
80106
|
-
return /* @__PURE__ */ (0,
|
|
80783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80107
80784
|
Panel_default,
|
|
80108
80785
|
{
|
|
80109
80786
|
...panelProps,
|
|
80110
|
-
tone,
|
|
80787
|
+
tone: surfaceTone,
|
|
80111
80788
|
variant,
|
|
80112
80789
|
padding: "sm",
|
|
80113
80790
|
disabled,
|
|
80114
80791
|
loading,
|
|
80115
80792
|
clickable: false,
|
|
80116
80793
|
scrollable: false,
|
|
80117
|
-
children: /* @__PURE__ */ (0,
|
|
80794
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80118
80795
|
"div",
|
|
80119
80796
|
{
|
|
80120
80797
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -80122,7 +80799,7 @@ function NetworkGraph({
|
|
|
80122
80799
|
"aria-label": ariaLabel ?? t("kit.networkGraph.name"),
|
|
80123
80800
|
"aria-disabled": locked || void 0,
|
|
80124
80801
|
children: [
|
|
80125
|
-
showControls && /* @__PURE__ */ (0,
|
|
80802
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80126
80803
|
Combobox_default,
|
|
80127
80804
|
{
|
|
80128
80805
|
size: "sm",
|
|
@@ -80144,7 +80821,7 @@ function NetworkGraph({
|
|
|
80144
80821
|
}
|
|
80145
80822
|
}
|
|
80146
80823
|
) }) }),
|
|
80147
|
-
/* @__PURE__ */ (0,
|
|
80824
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80148
80825
|
"div",
|
|
80149
80826
|
{
|
|
80150
80827
|
ref: layoutRef,
|
|
@@ -80152,13 +80829,13 @@ function NetworkGraph({
|
|
|
80152
80829
|
style: { flexDirection: legendOnRight ? "row" : "column" },
|
|
80153
80830
|
"data-legend-position": legendOnRight ? "right" : "bottom",
|
|
80154
80831
|
children: [
|
|
80155
|
-
/* @__PURE__ */ (0,
|
|
80832
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80156
80833
|
"div",
|
|
80157
80834
|
{
|
|
80158
80835
|
className: "relative min-w-0 flex-1",
|
|
80159
80836
|
style: { height: graphHeight, minHeight: graphHeight },
|
|
80160
80837
|
children: [
|
|
80161
|
-
/* @__PURE__ */ (0,
|
|
80838
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80162
80839
|
"canvas",
|
|
80163
80840
|
{
|
|
80164
80841
|
ref: canvas.canvasRef,
|
|
@@ -80227,11 +80904,11 @@ function NetworkGraph({
|
|
|
80227
80904
|
}
|
|
80228
80905
|
}
|
|
80229
80906
|
),
|
|
80230
|
-
showControls && /* @__PURE__ */ (0,
|
|
80231
|
-
/* @__PURE__ */ (0,
|
|
80907
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)("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: [
|
|
80908
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80232
80909
|
IconButton_default,
|
|
80233
80910
|
{
|
|
80234
|
-
icon: /* @__PURE__ */ (0,
|
|
80911
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80235
80912
|
"svg",
|
|
80236
80913
|
{
|
|
80237
80914
|
viewBox: "0 0 24 24",
|
|
@@ -80242,10 +80919,10 @@ function NetworkGraph({
|
|
|
80242
80919
|
strokeLinejoin: "round",
|
|
80243
80920
|
"aria-hidden": "true",
|
|
80244
80921
|
children: [
|
|
80245
|
-
/* @__PURE__ */ (0,
|
|
80246
|
-
/* @__PURE__ */ (0,
|
|
80247
|
-
/* @__PURE__ */ (0,
|
|
80248
|
-
/* @__PURE__ */ (0,
|
|
80922
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
|
|
80923
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
|
|
80924
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
|
|
80925
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
|
|
80249
80926
|
]
|
|
80250
80927
|
}
|
|
80251
80928
|
),
|
|
@@ -80258,10 +80935,10 @@ function NetworkGraph({
|
|
|
80258
80935
|
onClick: canvas.fit
|
|
80259
80936
|
}
|
|
80260
80937
|
),
|
|
80261
|
-
/* @__PURE__ */ (0,
|
|
80938
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80262
80939
|
IconButton_default,
|
|
80263
80940
|
{
|
|
80264
|
-
icon: /* @__PURE__ */ (0,
|
|
80941
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80265
80942
|
"svg",
|
|
80266
80943
|
{
|
|
80267
80944
|
viewBox: "0 0 24 24",
|
|
@@ -80270,7 +80947,7 @@ function NetworkGraph({
|
|
|
80270
80947
|
strokeWidth: 2,
|
|
80271
80948
|
strokeLinecap: "round",
|
|
80272
80949
|
"aria-hidden": "true",
|
|
80273
|
-
children: /* @__PURE__ */ (0,
|
|
80950
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("path", { d: "M6 12h12" })
|
|
80274
80951
|
}
|
|
80275
80952
|
),
|
|
80276
80953
|
size: "xs",
|
|
@@ -80282,7 +80959,7 @@ function NetworkGraph({
|
|
|
80282
80959
|
onClick: () => canvas.zoomBy(0.8)
|
|
80283
80960
|
}
|
|
80284
80961
|
),
|
|
80285
|
-
/* @__PURE__ */ (0,
|
|
80962
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsxs)(
|
|
80286
80963
|
"span",
|
|
80287
80964
|
{
|
|
80288
80965
|
className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
|
|
@@ -80293,7 +80970,7 @@ function NetworkGraph({
|
|
|
80293
80970
|
]
|
|
80294
80971
|
}
|
|
80295
80972
|
),
|
|
80296
|
-
/* @__PURE__ */ (0,
|
|
80973
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80297
80974
|
IconButton_default,
|
|
80298
80975
|
{
|
|
80299
80976
|
icon: "Add",
|
|
@@ -80306,7 +80983,7 @@ function NetworkGraph({
|
|
|
80306
80983
|
onClick: () => canvas.zoomBy(1.25)
|
|
80307
80984
|
}
|
|
80308
80985
|
),
|
|
80309
|
-
/* @__PURE__ */ (0,
|
|
80986
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80310
80987
|
IconButton_default,
|
|
80311
80988
|
{
|
|
80312
80989
|
icon: "Reset",
|
|
@@ -80324,18 +81001,18 @@ function NetworkGraph({
|
|
|
80324
81001
|
}
|
|
80325
81002
|
)
|
|
80326
81003
|
] }),
|
|
80327
|
-
!visibleNodes.length && /* @__PURE__ */ (0,
|
|
81004
|
+
!visibleNodes.length && /* @__PURE__ */ (0, import_jsx_runtime362.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
|
|
80328
81005
|
]
|
|
80329
81006
|
}
|
|
80330
81007
|
),
|
|
80331
|
-
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0,
|
|
81008
|
+
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80332
81009
|
"div",
|
|
80333
81010
|
{
|
|
80334
81011
|
className: "min-w-0 shrink-0",
|
|
80335
81012
|
style: {
|
|
80336
81013
|
width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
|
|
80337
81014
|
},
|
|
80338
|
-
children: legendPanel ? /* @__PURE__ */ (0,
|
|
81015
|
+
children: legendPanel ? /* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80339
81016
|
Panel_default,
|
|
80340
81017
|
{
|
|
80341
81018
|
variant: legendVariant === "auto" ? variant : legendVariant,
|
|
@@ -80354,8 +81031,8 @@ function NetworkGraph({
|
|
|
80354
81031
|
]
|
|
80355
81032
|
}
|
|
80356
81033
|
),
|
|
80357
|
-
/* @__PURE__ */ (0,
|
|
80358
|
-
/* @__PURE__ */ (0,
|
|
81034
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
|
|
81035
|
+
/* @__PURE__ */ (0, import_jsx_runtime362.jsx)(
|
|
80359
81036
|
"p",
|
|
80360
81037
|
{
|
|
80361
81038
|
role: "status",
|
|
@@ -80437,6 +81114,7 @@ function NetworkGraph({
|
|
|
80437
81114
|
Chart,
|
|
80438
81115
|
Chat,
|
|
80439
81116
|
Checkbox,
|
|
81117
|
+
CodeBlock,
|
|
80440
81118
|
CollapseChevron,
|
|
80441
81119
|
CollapseToggleButton,
|
|
80442
81120
|
CollapsibleHelpText,
|
|
@@ -80502,6 +81180,7 @@ function NetworkGraph({
|
|
|
80502
81180
|
FR_KIT_CATALOG,
|
|
80503
81181
|
FUNNEL_MAX_STAGES,
|
|
80504
81182
|
FileUpload,
|
|
81183
|
+
FilterBar,
|
|
80505
81184
|
FormField,
|
|
80506
81185
|
FormLayout,
|
|
80507
81186
|
FormSection,
|
|
@@ -80652,6 +81331,7 @@ function NetworkGraph({
|
|
|
80652
81331
|
SURFACE_GLASS_RIM,
|
|
80653
81332
|
SURFACE_GUTTER_AXES,
|
|
80654
81333
|
SURFACE_PADDINGS,
|
|
81334
|
+
SURFACE_TONES,
|
|
80655
81335
|
SURFACE_TO_BUTTON_VARIANT,
|
|
80656
81336
|
SURFACE_TRANSPARENCIES,
|
|
80657
81337
|
SURFACE_VARIANTS,
|
|
@@ -80908,6 +81588,7 @@ function NetworkGraph({
|
|
|
80908
81588
|
getStatusSpinnerToneTokens,
|
|
80909
81589
|
getStatusTokens,
|
|
80910
81590
|
getStepperTonePalette,
|
|
81591
|
+
getSurfaceAccentColor,
|
|
80911
81592
|
getSurfaceCornerClass,
|
|
80912
81593
|
getSurfaceCornerRem,
|
|
80913
81594
|
getSurfaceGutterClass,
|