@cjlapao/ui-kit 0.2.30 → 0.2.31

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/index.js CHANGED
@@ -78287,6 +78287,62 @@ function KnowledgeExplorer({
78287
78287
  ] });
78288
78288
  }
78289
78289
 
78290
+ // src/components/ContentActions.tsx
78291
+ import classNames148 from "classnames";
78292
+
78293
+ // ../common/components/contentActions.ts
78294
+ var CONTENT_ACTIONS_GAPS = {
78295
+ xs: "gap-1",
78296
+ sm: "gap-2",
78297
+ md: "gap-3",
78298
+ lg: "gap-4",
78299
+ xl: "gap-6"
78300
+ };
78301
+ var CONTENT_ACTIONS_ALIGN = {
78302
+ start: "items-start",
78303
+ center: "items-center",
78304
+ end: "items-end"
78305
+ };
78306
+
78307
+ // src/components/ContentActions.tsx
78308
+ import { jsx as jsx357, jsxs as jsxs228 } from "react/jsx-runtime";
78309
+ function ContentActions({
78310
+ children,
78311
+ actions,
78312
+ gap = "md",
78313
+ align = "start",
78314
+ contentClassName,
78315
+ actionsClassName,
78316
+ className,
78317
+ ...rest
78318
+ }) {
78319
+ const hasActions = actions != null && typeof actions !== "boolean";
78320
+ return /* @__PURE__ */ jsxs228(
78321
+ "div",
78322
+ {
78323
+ ...rest,
78324
+ "data-slot": "content-actions",
78325
+ className: classNames148("flex min-w-0 flex-nowrap", CONTENT_ACTIONS_ALIGN[align], CONTENT_ACTIONS_GAPS[gap], className),
78326
+ children: [
78327
+ /* @__PURE__ */ jsx357("div", { "data-slot": "content-actions-content", className: classNames148("min-w-0 flex-1", contentClassName), children }),
78328
+ hasActions && /* @__PURE__ */ jsx357(
78329
+ "div",
78330
+ {
78331
+ "data-slot": "content-actions-actions",
78332
+ className: classNames148(
78333
+ "flex min-w-0 flex-initial flex-nowrap items-center overflow-x-auto [&>*]:shrink-0",
78334
+ CONTENT_ACTIONS_GAPS[gap],
78335
+ actionsClassName
78336
+ ),
78337
+ children: actions
78338
+ }
78339
+ )
78340
+ ]
78341
+ }
78342
+ );
78343
+ }
78344
+ var ContentActions_default = ContentActions;
78345
+
78290
78346
  // src/contexts/BottomSheetContext.tsx
78291
78347
  import {
78292
78348
  createContext as createContext10,
@@ -78298,8 +78354,8 @@ import {
78298
78354
  useState as useState108
78299
78355
  } from "react";
78300
78356
  import { createPortal as createPortal21 } from "react-dom";
78301
- import classNames148 from "classnames";
78302
- import { jsx as jsx357, jsxs as jsxs228 } from "react/jsx-runtime";
78357
+ import classNames149 from "classnames";
78358
+ import { jsx as jsx358, jsxs as jsxs229 } from "react/jsx-runtime";
78303
78359
  var BottomSheetContext = createContext10(null);
78304
78360
  var TRANSITION_MS2 = 260;
78305
78361
  var renderSlot = (slot, controls) => {
@@ -78369,11 +78425,11 @@ var BottomSheetProvider = ({
78369
78425
  [presentSheet, dismissSheet, sheet, isVisible]
78370
78426
  );
78371
78427
  const overlayNode = typeof document !== "undefined" && sheet ? createPortal21(
78372
- /* @__PURE__ */ jsxs228("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
78373
- /* @__PURE__ */ jsx357(
78428
+ /* @__PURE__ */ jsxs229("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
78429
+ /* @__PURE__ */ jsx358(
78374
78430
  "div",
78375
78431
  {
78376
- className: classNames148(
78432
+ className: classNames149(
78377
78433
  "absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
78378
78434
  isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
78379
78435
  ),
@@ -78383,24 +78439,24 @@ var BottomSheetProvider = ({
78383
78439
  }
78384
78440
  }
78385
78441
  ),
78386
- /* @__PURE__ */ jsx357("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs228(
78442
+ /* @__PURE__ */ jsx358("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs229(
78387
78443
  "section",
78388
78444
  {
78389
78445
  role: "dialog",
78390
78446
  "aria-modal": "true",
78391
- className: classNames148(
78447
+ className: classNames149(
78392
78448
  "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",
78393
78449
  sheet.className,
78394
78450
  isVisible ? "translate-y-0" : "translate-y-full"
78395
78451
  ),
78396
78452
  style: { minHeight: "25vh", maxHeight: "85vh" },
78397
78453
  children: [
78398
- /* @__PURE__ */ jsxs228("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
78399
- /* @__PURE__ */ jsxs228("div", { className: "space-y-1", children: [
78400
- sheet.title && /* @__PURE__ */ jsx357("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
78401
- sheet.description && /* @__PURE__ */ jsx357("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
78454
+ /* @__PURE__ */ jsxs229("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
78455
+ /* @__PURE__ */ jsxs229("div", { className: "space-y-1", children: [
78456
+ sheet.title && /* @__PURE__ */ jsx358("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
78457
+ sheet.description && /* @__PURE__ */ jsx358("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
78402
78458
  ] }),
78403
- (sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx357(
78459
+ (sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx358(
78404
78460
  IconButton_default,
78405
78461
  {
78406
78462
  icon: "Close",
@@ -78412,15 +78468,15 @@ var BottomSheetProvider = ({
78412
78468
  }
78413
78469
  )
78414
78470
  ] }),
78415
- /* @__PURE__ */ jsx357("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx357("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
78416
- sheet.actions && /* @__PURE__ */ jsx357("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) })
78471
+ /* @__PURE__ */ jsx358("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx358("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
78472
+ sheet.actions && /* @__PURE__ */ jsx358("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) })
78417
78473
  ]
78418
78474
  }
78419
78475
  ) })
78420
78476
  ] }),
78421
78477
  document.body
78422
78478
  ) : null;
78423
- return /* @__PURE__ */ jsxs228(BottomSheetContext.Provider, { value: contextValue, children: [
78479
+ return /* @__PURE__ */ jsxs229(BottomSheetContext.Provider, { value: contextValue, children: [
78424
78480
  children,
78425
78481
  overlayNode
78426
78482
  ] });
@@ -79060,8 +79116,8 @@ var SYSTEM_VARIABLES = [
79060
79116
  ];
79061
79117
 
79062
79118
  // src/components/MetricBar.tsx
79063
- import classNames149 from "classnames";
79064
- import { jsx as jsx358 } from "react/jsx-runtime";
79119
+ import classNames150 from "classnames";
79120
+ import { jsx as jsx359 } from "react/jsx-runtime";
79065
79121
  var MetricBar = ({
79066
79122
  label,
79067
79123
  value,
@@ -79071,7 +79127,7 @@ var MetricBar = ({
79071
79127
  size = "sm",
79072
79128
  className,
79073
79129
  ...rest
79074
- }) => /* @__PURE__ */ jsx358(
79130
+ }) => /* @__PURE__ */ jsx359(
79075
79131
  Progress_default,
79076
79132
  {
79077
79133
  ...rest,
@@ -79081,7 +79137,7 @@ var MetricBar = ({
79081
79137
  formatValue: value !== void 0 ? () => String(value) : void 0,
79082
79138
  size,
79083
79139
  color: tone ?? color2 ?? "blue",
79084
- className: classNames149("w-full", className)
79140
+ className: classNames150("w-full", className)
79085
79141
  }
79086
79142
  );
79087
79143
  MetricBar.displayName = "MetricBar";
@@ -79441,7 +79497,7 @@ function useNetworkCanvas(options) {
79441
79497
  }
79442
79498
 
79443
79499
  // src/components/NetworkGraph/NetworkGraph.tsx
79444
- import { jsx as jsx359, jsxs as jsxs229 } from "react/jsx-runtime";
79500
+ import { jsx as jsx360, jsxs as jsxs230 } from "react/jsx-runtime";
79445
79501
  var NO_COMMUNITIES = [];
79446
79502
  var NO_HIGHLIGHTS = [];
79447
79503
  function NetworkGraph({
@@ -79607,7 +79663,7 @@ function NetworkGraph({
79607
79663
  }, [visibleNodes, query]);
79608
79664
  const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
79609
79665
  const resolvedLegendTone = legendTone === "auto" ? tone : legendTone;
79610
- const legendContent = /* @__PURE__ */ jsxs229(
79666
+ const legendContent = /* @__PURE__ */ jsxs230(
79611
79667
  "fieldset",
79612
79668
  {
79613
79669
  disabled: locked,
@@ -79616,8 +79672,8 @@ function NetworkGraph({
79616
79672
  maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
79617
79673
  },
79618
79674
  children: [
79619
- /* @__PURE__ */ jsx359("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
79620
- /* @__PURE__ */ jsx359(
79675
+ /* @__PURE__ */ jsx360("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
79676
+ /* @__PURE__ */ jsx360(
79621
79677
  Checkbox_default,
79622
79678
  {
79623
79679
  size: "sm",
@@ -79628,8 +79684,8 @@ function NetworkGraph({
79628
79684
  onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
79629
79685
  }
79630
79686
  ),
79631
- model.groups.map((group) => /* @__PURE__ */ jsxs229("div", { className: "flex items-center justify-between gap-2", children: [
79632
- /* @__PURE__ */ jsx359(
79687
+ model.groups.map((group) => /* @__PURE__ */ jsxs230("div", { className: "flex items-center justify-between gap-2", children: [
79688
+ /* @__PURE__ */ jsx360(
79633
79689
  Checkbox_default,
79634
79690
  {
79635
79691
  size: "sm",
@@ -79641,12 +79697,12 @@ function NetworkGraph({
79641
79697
  )
79642
79698
  }
79643
79699
  ),
79644
- /* @__PURE__ */ jsx359("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
79700
+ /* @__PURE__ */ jsx360("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
79645
79701
  ] }, group.id))
79646
79702
  ]
79647
79703
  }
79648
79704
  );
79649
- return /* @__PURE__ */ jsx359(
79705
+ return /* @__PURE__ */ jsx360(
79650
79706
  Panel_default,
79651
79707
  {
79652
79708
  ...panelProps,
@@ -79657,7 +79713,7 @@ function NetworkGraph({
79657
79713
  loading,
79658
79714
  clickable: false,
79659
79715
  scrollable: false,
79660
- children: /* @__PURE__ */ jsxs229(
79716
+ children: /* @__PURE__ */ jsxs230(
79661
79717
  "div",
79662
79718
  {
79663
79719
  className: "flex min-w-0 flex-col gap-3",
@@ -79665,7 +79721,7 @@ function NetworkGraph({
79665
79721
  "aria-label": ariaLabel ?? t("kit.networkGraph.name"),
79666
79722
  "aria-disabled": locked || void 0,
79667
79723
  children: [
79668
- showControls && /* @__PURE__ */ jsx359("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx359("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx359(
79724
+ showControls && /* @__PURE__ */ jsx360("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx360("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx360(
79669
79725
  Combobox_default,
79670
79726
  {
79671
79727
  size: "sm",
@@ -79687,7 +79743,7 @@ function NetworkGraph({
79687
79743
  }
79688
79744
  }
79689
79745
  ) }) }),
79690
- /* @__PURE__ */ jsxs229(
79746
+ /* @__PURE__ */ jsxs230(
79691
79747
  "div",
79692
79748
  {
79693
79749
  ref: layoutRef,
@@ -79695,13 +79751,13 @@ function NetworkGraph({
79695
79751
  style: { flexDirection: legendOnRight ? "row" : "column" },
79696
79752
  "data-legend-position": legendOnRight ? "right" : "bottom",
79697
79753
  children: [
79698
- /* @__PURE__ */ jsxs229(
79754
+ /* @__PURE__ */ jsxs230(
79699
79755
  "div",
79700
79756
  {
79701
79757
  className: "relative min-w-0 flex-1",
79702
79758
  style: { height: graphHeight, minHeight: graphHeight },
79703
79759
  children: [
79704
- /* @__PURE__ */ jsx359(
79760
+ /* @__PURE__ */ jsx360(
79705
79761
  "canvas",
79706
79762
  {
79707
79763
  ref: canvas.canvasRef,
@@ -79770,11 +79826,11 @@ function NetworkGraph({
79770
79826
  }
79771
79827
  }
79772
79828
  ),
79773
- showControls && /* @__PURE__ */ jsxs229("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: [
79774
- /* @__PURE__ */ jsx359(
79829
+ showControls && /* @__PURE__ */ jsxs230("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: [
79830
+ /* @__PURE__ */ jsx360(
79775
79831
  IconButton_default,
79776
79832
  {
79777
- icon: /* @__PURE__ */ jsxs229(
79833
+ icon: /* @__PURE__ */ jsxs230(
79778
79834
  "svg",
79779
79835
  {
79780
79836
  viewBox: "0 0 24 24",
@@ -79785,10 +79841,10 @@ function NetworkGraph({
79785
79841
  strokeLinejoin: "round",
79786
79842
  "aria-hidden": "true",
79787
79843
  children: [
79788
- /* @__PURE__ */ jsx359("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
79789
- /* @__PURE__ */ jsx359("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
79790
- /* @__PURE__ */ jsx359("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
79791
- /* @__PURE__ */ jsx359("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
79844
+ /* @__PURE__ */ jsx360("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
79845
+ /* @__PURE__ */ jsx360("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
79846
+ /* @__PURE__ */ jsx360("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
79847
+ /* @__PURE__ */ jsx360("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
79792
79848
  ]
79793
79849
  }
79794
79850
  ),
@@ -79801,10 +79857,10 @@ function NetworkGraph({
79801
79857
  onClick: canvas.fit
79802
79858
  }
79803
79859
  ),
79804
- /* @__PURE__ */ jsx359(
79860
+ /* @__PURE__ */ jsx360(
79805
79861
  IconButton_default,
79806
79862
  {
79807
- icon: /* @__PURE__ */ jsx359(
79863
+ icon: /* @__PURE__ */ jsx360(
79808
79864
  "svg",
79809
79865
  {
79810
79866
  viewBox: "0 0 24 24",
@@ -79813,7 +79869,7 @@ function NetworkGraph({
79813
79869
  strokeWidth: 2,
79814
79870
  strokeLinecap: "round",
79815
79871
  "aria-hidden": "true",
79816
- children: /* @__PURE__ */ jsx359("path", { d: "M6 12h12" })
79872
+ children: /* @__PURE__ */ jsx360("path", { d: "M6 12h12" })
79817
79873
  }
79818
79874
  ),
79819
79875
  size: "xs",
@@ -79825,7 +79881,7 @@ function NetworkGraph({
79825
79881
  onClick: () => canvas.zoomBy(0.8)
79826
79882
  }
79827
79883
  ),
79828
- /* @__PURE__ */ jsxs229(
79884
+ /* @__PURE__ */ jsxs230(
79829
79885
  "span",
79830
79886
  {
79831
79887
  className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
@@ -79836,7 +79892,7 @@ function NetworkGraph({
79836
79892
  ]
79837
79893
  }
79838
79894
  ),
79839
- /* @__PURE__ */ jsx359(
79895
+ /* @__PURE__ */ jsx360(
79840
79896
  IconButton_default,
79841
79897
  {
79842
79898
  icon: "Add",
@@ -79849,7 +79905,7 @@ function NetworkGraph({
79849
79905
  onClick: () => canvas.zoomBy(1.25)
79850
79906
  }
79851
79907
  ),
79852
- /* @__PURE__ */ jsx359(
79908
+ /* @__PURE__ */ jsx360(
79853
79909
  IconButton_default,
79854
79910
  {
79855
79911
  icon: "Reset",
@@ -79867,18 +79923,18 @@ function NetworkGraph({
79867
79923
  }
79868
79924
  )
79869
79925
  ] }),
79870
- !visibleNodes.length && /* @__PURE__ */ jsx359("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
79926
+ !visibleNodes.length && /* @__PURE__ */ jsx360("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
79871
79927
  ]
79872
79928
  }
79873
79929
  ),
79874
- showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx359(
79930
+ showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx360(
79875
79931
  "div",
79876
79932
  {
79877
79933
  className: "min-w-0 shrink-0",
79878
79934
  style: {
79879
79935
  width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
79880
79936
  },
79881
- children: legendPanel ? /* @__PURE__ */ jsx359(
79937
+ children: legendPanel ? /* @__PURE__ */ jsx360(
79882
79938
  Panel_default,
79883
79939
  {
79884
79940
  variant: legendVariant === "auto" ? variant : legendVariant,
@@ -79897,8 +79953,8 @@ function NetworkGraph({
79897
79953
  ]
79898
79954
  }
79899
79955
  ),
79900
- /* @__PURE__ */ jsx359("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
79901
- /* @__PURE__ */ jsx359(
79956
+ /* @__PURE__ */ jsx360("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
79957
+ /* @__PURE__ */ jsx360(
79902
79958
  "p",
79903
79959
  {
79904
79960
  role: "status",
@@ -79993,6 +80049,7 @@ export {
79993
80049
  ConnectionFlowNodeBody_default as ConnectionFlowNodeBody,
79994
80050
  ConnectionFlowSkeleton_default as ConnectionFlowSkeleton,
79995
80051
  ConnectionFlowSvg_default as ConnectionFlowSvg,
80052
+ ContentActions_default as ContentActions,
79996
80053
  CustomIcon_default as CustomIcon,
79997
80054
  DATEPICKER_APPEND_TO,
79998
80055
  DATEPICKER_SELECTION_MODES,