@cjlapao/ui-kit 0.2.8 → 0.2.9

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/markdown.js CHANGED
@@ -1589,6 +1589,9 @@ function getLocalizedParseNames(locale, catalog) {
1589
1589
  // ../common/i18n/builtIn/de.ts
1590
1590
  var DE_KIT_CATALOG = {
1591
1591
  kit: {
1592
+ connectionFlowConnection: {
1593
+ label: "Verbindung von {source} zu {target}"
1594
+ },
1592
1595
  connectionFlowEdit: {
1593
1596
  connected: "Verbindung angefordert",
1594
1597
  add: "Knoten {side} von {label} hinzuf\xFCgen",
@@ -1716,7 +1719,9 @@ var DE_KIT_CATALOG = {
1716
1719
  acceptsFrom: "Nimmt Karten an aus",
1717
1720
  acceptsAny: "Nichts ausgew\xE4hlt: jede Spalte.",
1718
1721
  save: "Speichern",
1719
- cancel: "Abbrechen"
1722
+ cancel: "Abbrechen",
1723
+ maxItems: "Max. Karten",
1724
+ maxItemsHint: "Leer nutzt den Board-Standard."
1720
1725
  },
1721
1726
  help: {
1722
1727
  show: "Hilfe anzeigen",
@@ -1999,6 +2004,9 @@ var DE_KIT_CATALOG = {
1999
2004
  // ../common/i18n/builtIn/en.ts
2000
2005
  var EN_KIT_CATALOG = {
2001
2006
  kit: {
2007
+ connectionFlowConnection: {
2008
+ label: "Connection from {source} to {target}"
2009
+ },
2002
2010
  connectionFlowEdit: {
2003
2011
  connected: "Connection requested",
2004
2012
  add: "Add a node {side} {label}",
@@ -2126,7 +2134,9 @@ var EN_KIT_CATALOG = {
2126
2134
  acceptsFrom: "Accepts cards from",
2127
2135
  acceptsAny: "None ticked: any column.",
2128
2136
  save: "Save",
2129
- cancel: "Cancel"
2137
+ cancel: "Cancel",
2138
+ maxItems: "Max items",
2139
+ maxItemsHint: "Empty uses the board default."
2130
2140
  },
2131
2141
  help: {
2132
2142
  show: "Show help",
@@ -2409,6 +2419,9 @@ var EN_KIT_CATALOG = {
2409
2419
  // ../common/i18n/builtIn/es.ts
2410
2420
  var ES_KIT_CATALOG = {
2411
2421
  kit: {
2422
+ connectionFlowConnection: {
2423
+ label: "Conexi\xF3n de {source} a {target}"
2424
+ },
2412
2425
  connectionFlowEdit: {
2413
2426
  connected: "Conexi\xF3n solicitada",
2414
2427
  add: "A\xF1adir un nodo {side} de {label}",
@@ -2536,7 +2549,9 @@ var ES_KIT_CATALOG = {
2536
2549
  acceptsFrom: "Acepta tarjetas de",
2537
2550
  acceptsAny: "Ninguna marcada: cualquier columna.",
2538
2551
  save: "Guardar",
2539
- cancel: "Cancelar"
2552
+ cancel: "Cancelar",
2553
+ maxItems: "M\xE1x. tarjetas",
2554
+ maxItemsHint: "Vac\xEDo usa el valor del tablero."
2540
2555
  },
2541
2556
  help: {
2542
2557
  show: "Mostrar ayuda",
@@ -2819,6 +2834,9 @@ var ES_KIT_CATALOG = {
2819
2834
  // ../common/i18n/builtIn/fr.ts
2820
2835
  var FR_KIT_CATALOG = {
2821
2836
  kit: {
2837
+ connectionFlowConnection: {
2838
+ label: "Connexion de {source} vers {target}"
2839
+ },
2822
2840
  connectionFlowEdit: {
2823
2841
  connected: "Connexion demand\xE9e",
2824
2842
  add: "Ajouter un n\u0153ud {side} de {label}",
@@ -2946,7 +2964,9 @@ var FR_KIT_CATALOG = {
2946
2964
  acceptsFrom: "Accepte les cartes de",
2947
2965
  acceptsAny: "Aucune coch\xE9e : toutes les colonnes.",
2948
2966
  save: "Enregistrer",
2949
- cancel: "Annuler"
2967
+ cancel: "Annuler",
2968
+ maxItems: "Cartes max.",
2969
+ maxItemsHint: "Vide : valeur du tableau."
2950
2970
  },
2951
2971
  help: {
2952
2972
  show: "Afficher l\\'aide",
@@ -3229,6 +3249,9 @@ var FR_KIT_CATALOG = {
3229
3249
  // ../common/i18n/builtIn/pt.ts
3230
3250
  var PT_KIT_CATALOG = {
3231
3251
  kit: {
3252
+ connectionFlowConnection: {
3253
+ label: "Liga\xE7\xE3o de {source} para {target}"
3254
+ },
3232
3255
  connectionFlowEdit: {
3233
3256
  connected: "Liga\xE7\xE3o solicitada",
3234
3257
  add: "Adicionar um n\xF3 {side} de {label}",
@@ -3356,7 +3379,9 @@ var PT_KIT_CATALOG = {
3356
3379
  acceptsFrom: "Aceita cart\xF5es de",
3357
3380
  acceptsAny: "Nenhuma marcada: qualquer coluna.",
3358
3381
  save: "Salvar",
3359
- cancel: "Cancelar"
3382
+ cancel: "Cancelar",
3383
+ maxItems: "M\xE1x. de cart\xF5es",
3384
+ maxItemsHint: "Vazio usa o padr\xE3o do quadro."
3360
3385
  },
3361
3386
  help: {
3362
3387
  show: "Mostrar ajuda",
@@ -8891,6 +8916,7 @@ var TooltipWrapper = ({
8891
8916
  const tooltipRef = useRef(null);
8892
8917
  const triggerRectRef = useRef(null);
8893
8918
  const [visible, setVisible] = useState(false);
8919
+ const [colorScheme, setColorScheme] = useState(null);
8894
8920
  const [placement, setPlacement] = useState(null);
8895
8921
  useEffect(() => {
8896
8922
  return () => {
@@ -8952,6 +8978,9 @@ var TooltipWrapper = ({
8952
8978
  const show = useCallback(
8953
8979
  (e) => {
8954
8980
  if (text) {
8981
+ setColorScheme(
8982
+ e.currentTarget.closest("[data-color-scheme]")?.getAttribute("data-color-scheme") ?? null
8983
+ );
8955
8984
  triggerRectRef.current = e.currentTarget.getBoundingClientRect();
8956
8985
  setPlacement(null);
8957
8986
  timerRef.current = setTimeout(() => setVisible(true), delay);
@@ -9003,6 +9032,7 @@ var TooltipWrapper = ({
9003
9032
  ref: tooltipRef,
9004
9033
  id: tooltipId,
9005
9034
  role: "tooltip",
9035
+ "data-color-scheme": colorScheme ?? void 0,
9006
9036
  "data-side": side,
9007
9037
  style: {
9008
9038
  position: "fixed",
@@ -9013,7 +9043,8 @@ var TooltipWrapper = ({
9013
9043
  },
9014
9044
  className: classNames2(
9015
9045
  "pointer-events-none max-w-xs rounded-md px-2.5 py-1.5 text-xs leading-snug",
9016
- tokens.box
9046
+ tokens.box,
9047
+ colorScheme === "dark" && "dark"
9017
9048
  ),
9018
9049
  children: [
9019
9050
  text,
@@ -10610,6 +10641,7 @@ var BAR_BASE = "absolute select-none touch-none opacity-100 transition-opacity d
10610
10641
  var THUMB_BASE = "absolute left-0 top-0 cursor-grab rounded-full bg-neutral-300 transition-colors active:cursor-grabbing dark:bg-neutral-600 hover:bg-neutral-400 dark:hover:bg-neutral-500";
10611
10642
  var FITTING_THUMB = { size: 0, offset: 0, ratio: 0 };
10612
10643
  var ScrollArea = ({
10644
+ virtualScroll,
10613
10645
  variant = "auto",
10614
10646
  mask = false,
10615
10647
  horizontal = true,
@@ -10621,6 +10653,7 @@ var ScrollArea = ({
10621
10653
  className = "",
10622
10654
  ...rest
10623
10655
  }) => {
10656
+ horizontal = horizontal && !virtualScroll;
10624
10657
  const viewportId = useId2();
10625
10658
  const viewportRef = useRef3(null);
10626
10659
  const setViewportRef = useCallback3(
@@ -10644,36 +10677,36 @@ var ScrollArea = ({
10644
10677
  const dragging = useRef3(null);
10645
10678
  const thumb = useCallback3(
10646
10679
  (viewport, track, axis) => {
10647
- const viewportSize = axis === "y" ? viewport.clientHeight : viewport.clientWidth;
10648
- const contentSize = axis === "y" ? viewport.scrollHeight : viewport.scrollWidth;
10680
+ const viewportSize = axis === "y" && virtualScroll ? virtualScroll.viewportSize : axis === "y" ? viewport.clientHeight : viewport.clientWidth;
10681
+ const contentSize = axis === "y" && virtualScroll ? virtualScroll.contentSize : axis === "y" ? viewport.scrollHeight : viewport.scrollWidth;
10649
10682
  const trackSize = (track ? axis === "y" ? track.clientHeight : track.clientWidth : viewportSize) || 1;
10650
10683
  const scrollable = contentSize - viewportSize;
10651
- if (scrollable <= 1) return FITTING_THUMB;
10684
+ if (scrollable <= (virtualScroll ? 0 : 1)) return FITTING_THUMB;
10652
10685
  const size = Math.max(
10653
10686
  MIN_THUMB,
10654
10687
  viewportSize / contentSize * trackSize
10655
10688
  );
10656
- const position = axis === "y" ? viewport.scrollTop : viewport.scrollLeft;
10689
+ const position = axis === "y" && virtualScroll ? virtualScroll.offset : axis === "y" ? viewport.scrollTop : viewport.scrollLeft;
10657
10690
  return {
10658
10691
  size,
10659
10692
  offset: position / scrollable * (trackSize - size),
10660
10693
  ratio: position / scrollable
10661
10694
  };
10662
10695
  },
10663
- []
10696
+ [virtualScroll]
10664
10697
  );
10665
10698
  const update = useCallback3(() => {
10666
10699
  const viewport = viewportRef.current;
10667
10700
  if (!viewport) return;
10668
10701
  setOverflow({
10669
10702
  x: horizontal && viewport.scrollWidth - viewport.clientWidth > 1,
10670
- y: viewport.scrollHeight - viewport.clientHeight > 1
10703
+ y: virtualScroll ? virtualScroll.contentSize > virtualScroll.viewportSize : viewport.scrollHeight - viewport.clientHeight > 1
10671
10704
  });
10672
10705
  setThumbY(thumb(viewport, yTrackRef.current, "y"));
10673
10706
  setThumbX(
10674
10707
  horizontal ? thumb(viewport, xTrackRef.current, "x") : FITTING_THUMB
10675
10708
  );
10676
- }, [thumb, horizontal]);
10709
+ }, [thumb, horizontal, virtualScroll]);
10677
10710
  useEffect3(() => {
10678
10711
  update();
10679
10712
  let observer;
@@ -10699,6 +10732,18 @@ var ScrollArea = ({
10699
10732
  SCROLL_LINGER_MS
10700
10733
  );
10701
10734
  };
10735
+ const previousVirtualOffset = useRef3(virtualScroll?.offset);
10736
+ useEffect3(() => {
10737
+ if (previousVirtualOffset.current === virtualScroll?.offset) return;
10738
+ previousVirtualOffset.current = virtualScroll?.offset;
10739
+ if (!virtualScroll) return;
10740
+ setScrolling(true);
10741
+ window.clearTimeout(lingerTimer.current);
10742
+ lingerTimer.current = window.setTimeout(
10743
+ () => setScrolling(false),
10744
+ SCROLL_LINGER_MS
10745
+ );
10746
+ }, [virtualScroll]);
10702
10747
  const visible = (overflows) => {
10703
10748
  if (!overflows || variant === "hidden") return false;
10704
10749
  if (variant === "always") return true;
@@ -10716,11 +10761,11 @@ var ScrollArea = ({
10716
10761
  const track = axis === "y" ? yTrackRef.current : xTrackRef.current;
10717
10762
  const metrics = axis === "y" ? thumbY : thumbX;
10718
10763
  const travel = (track ? axis === "y" ? track.clientHeight : track.clientWidth : 0) - metrics.size;
10719
- const scrollable = (axis === "y" ? viewport.scrollHeight : viewport.scrollWidth) - (axis === "y" ? viewport.clientHeight : viewport.clientWidth);
10764
+ const scrollable = axis === "y" && virtualScroll ? virtualScroll.contentSize - virtualScroll.viewportSize : (axis === "y" ? viewport.scrollHeight : viewport.scrollWidth) - (axis === "y" ? viewport.clientHeight : viewport.clientWidth);
10720
10765
  dragging.current = {
10721
10766
  axis,
10722
10767
  pointer: axis === "y" ? event.clientY : event.clientX,
10723
- scroll: axis === "y" ? viewport.scrollTop : viewport.scrollLeft,
10768
+ scroll: axis === "y" && virtualScroll ? virtualScroll.offset : axis === "y" ? viewport.scrollTop : viewport.scrollLeft,
10724
10769
  ratio: travel > 0 ? scrollable / travel : 0
10725
10770
  };
10726
10771
  };
@@ -10730,7 +10775,17 @@ var ScrollArea = ({
10730
10775
  if (!drag || !viewport) return;
10731
10776
  const pointer = drag.axis === "y" ? event.clientY : event.clientX;
10732
10777
  const delta = (pointer - drag.pointer) * drag.ratio;
10733
- if (drag.axis === "y") viewport.scrollTop = drag.scroll + delta;
10778
+ if (drag.axis === "y" && virtualScroll)
10779
+ virtualScroll.onScroll(
10780
+ Math.max(
10781
+ 0,
10782
+ Math.min(
10783
+ virtualScroll.contentSize - virtualScroll.viewportSize,
10784
+ drag.scroll + delta
10785
+ )
10786
+ )
10787
+ );
10788
+ else if (drag.axis === "y") viewport.scrollTop = drag.scroll + delta;
10734
10789
  else viewport.scrollLeft = drag.scroll + delta;
10735
10790
  };
10736
10791
  const endDrag = (event) => {
@@ -10784,6 +10839,7 @@ var ScrollArea = ({
10784
10839
  onScroll: handleScroll,
10785
10840
  style: {
10786
10841
  ...maskStyle(),
10842
+ ...virtualScroll ? { overflow: "hidden" } : null,
10787
10843
  ...horizontal ? null : { overflowX: "hidden" }
10788
10844
  },
10789
10845
  className: classNames9(
@@ -10801,7 +10857,10 @@ var ScrollArea = ({
10801
10857
  {
10802
10858
  ref: contentRef,
10803
10859
  "data-slot": "scrollarea-content",
10804
- className: classNames9("table min-w-full", contentClassName),
10860
+ className: classNames9(
10861
+ virtualScroll ? "h-full min-w-full" : "table min-w-full",
10862
+ contentClassName
10863
+ ),
10805
10864
  children
10806
10865
  }
10807
10866
  )
@@ -11400,42 +11459,58 @@ var Tabs = ({
11400
11459
  isGlass && isActive && glassActiveRing
11401
11460
  );
11402
11461
  const showDividerAfter = shouldShowDividers && index < items.length - 1;
11462
+ const tabButton = /* @__PURE__ */ jsxs62(
11463
+ "button",
11464
+ {
11465
+ type: "button",
11466
+ role: "tab",
11467
+ id: `tab-${item.id}`,
11468
+ "aria-selected": isActive,
11469
+ "aria-controls": item.panel !== void 0 ? controlsId : void 0,
11470
+ disabled: isDisabled,
11471
+ className: classNames11(
11472
+ baseClassesForItem,
11473
+ Boolean(item.trailingAction) && "pr-10"
11474
+ ),
11475
+ onClick: () => selectTab(item),
11476
+ tabIndex: isActive ? 0 : -1,
11477
+ ref: (node) => {
11478
+ tabRefs.current.set(item.id, node);
11479
+ },
11480
+ children: [
11481
+ isGlass && glassSpecular ? /* @__PURE__ */ jsx160(
11482
+ "div",
11483
+ {
11484
+ "aria-hidden": "true",
11485
+ className: classNames11(
11486
+ "pointer-events-none absolute inset-0 rounded-[inherit]",
11487
+ glassSpecular
11488
+ )
11489
+ }
11490
+ ) : null,
11491
+ renderTabIcon(item.icon),
11492
+ /* @__PURE__ */ jsxs62("span", { className: "flex min-w-0 flex-col text-left", children: [
11493
+ /* @__PURE__ */ jsx160("span", { className: "truncate", children: item.label }),
11494
+ item.description ? /* @__PURE__ */ jsx160("span", { className: "mt-1 text-xs opacity-70", children: item.description }) : null
11495
+ ] }),
11496
+ item.badge ? /* @__PURE__ */ jsx160(Badge_default, { count: item.badge, tone: item.badgeColor }) : null
11497
+ ]
11498
+ }
11499
+ );
11403
11500
  return /* @__PURE__ */ jsxs62(React12.Fragment, { children: [
11404
- /* @__PURE__ */ jsxs62(
11405
- "button",
11501
+ item.trailingAction ? /* @__PURE__ */ jsxs62(
11502
+ "div",
11406
11503
  {
11407
- type: "button",
11408
- role: "tab",
11409
- id: `tab-${item.id}`,
11410
- "aria-selected": isActive,
11411
- "aria-controls": item.panel !== void 0 ? controlsId : void 0,
11412
- disabled: isDisabled,
11413
- className: baseClassesForItem,
11414
- onClick: () => selectTab(item),
11415
- tabIndex: isActive ? 0 : -1,
11416
- ref: (node) => {
11417
- tabRefs.current.set(item.id, node);
11418
- },
11504
+ className: classNames11(
11505
+ "relative inline-flex shrink-0",
11506
+ fullWidth && "flex-1"
11507
+ ),
11419
11508
  children: [
11420
- isGlass && glassSpecular ? /* @__PURE__ */ jsx160(
11421
- "div",
11422
- {
11423
- "aria-hidden": "true",
11424
- className: classNames11(
11425
- "pointer-events-none absolute inset-0 rounded-[inherit]",
11426
- glassSpecular
11427
- )
11428
- }
11429
- ) : null,
11430
- renderTabIcon(item.icon),
11431
- /* @__PURE__ */ jsxs62("span", { className: "flex min-w-0 flex-col text-left", children: [
11432
- /* @__PURE__ */ jsx160("span", { className: "truncate", children: item.label }),
11433
- item.description ? /* @__PURE__ */ jsx160("span", { className: "mt-1 text-xs opacity-70", children: item.description }) : null
11434
- ] }),
11435
- item.badge ? /* @__PURE__ */ jsx160(Badge_default, { count: item.badge, tone: item.badgeColor }) : null
11509
+ tabButton,
11510
+ /* @__PURE__ */ jsx160("span", { className: "absolute right-1 top-1/2 -translate-y-1/2", children: item.trailingAction })
11436
11511
  ]
11437
11512
  }
11438
- ),
11513
+ ) : tabButton,
11439
11514
  showDividerAfter ? /* @__PURE__ */ jsx160(
11440
11515
  "span",
11441
11516
  {