@useinsider/ab-components 0.0.99 → 0.0.100

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.d.ts CHANGED
@@ -460,6 +460,11 @@ export declare interface CascadingListItem {
460
460
  id: string;
461
461
  label: string;
462
462
  subtitle?: string;
463
+ /**
464
+ * Trailing metadata rendered on the right side of the row (e.g. a remaining
465
+ * count). Inherits the row text color so it tracks selected/hover states.
466
+ */
467
+ meta?: string;
463
468
  testId?: string;
464
469
  disabled?: boolean;
465
470
  }
@@ -472,6 +477,7 @@ subItemId: string;
472
477
  "update:open": (value: boolean) => any;
473
478
  "item-click": (itemId: string) => any;
474
479
  "item-expand": (itemId: string) => any;
480
+ "update:search-query": (value: string) => any;
475
481
  }, string, PublicProps, Readonly<CascadingMenuProps> & Readonly<{
476
482
  onSelect?: ((payload: {
477
483
  itemId: string;
@@ -480,14 +486,26 @@ subItemId: string;
480
486
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
481
487
  "onItem-click"?: ((itemId: string) => any) | undefined;
482
488
  "onItem-expand"?: ((itemId: string) => any) | undefined;
489
+ "onUpdate:search-query"?: ((value: string) => any) | undefined;
483
490
  }>, {
484
491
  width: number;
492
+ searchable: boolean;
485
493
  listStyle: CSSProperties;
486
494
  menuStyle: CSSProperties;
487
495
  listWidth: number;
488
496
  listMaxHeight: number;
497
+ menuMaxHeight: number;
489
498
  loadingText: string;
490
499
  teleportTarget: string | HTMLElement;
500
+ submenuPlacement: "right" | "left";
501
+ searchPlaceholder: string;
502
+ emptySearchText: string;
503
+ loading: boolean;
504
+ selectedItemId: string | null;
505
+ selectedSubItemId: string | null;
506
+ menuTestId: string;
507
+ listTestId: string;
508
+ searchInputId: string;
491
509
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
492
510
  menuRef: HTMLDivElement;
493
511
  listRef: HTMLDivElement;
@@ -517,6 +535,11 @@ export declare interface CascadingMenuProps {
517
535
  width?: number;
518
536
  listWidth?: number;
519
537
  listMaxHeight?: number;
538
+ /**
539
+ * Optional max-height (in px) for the parent panel. Useful when the menu
540
+ * shows a long flat search result list and should scroll inside the panel.
541
+ */
542
+ menuMaxHeight?: number;
520
543
  loadingText?: string;
521
544
  menuStyle?: CSSProperties;
522
545
  listStyle?: CSSProperties;
@@ -528,6 +551,50 @@ export declare interface CascadingMenuProps {
528
551
  * instead so the menu's DOM is not a direct child of `body`.
529
552
  */
530
553
  teleportTarget?: string | HTMLElement;
554
+ /**
555
+ * Which side the child sub-list panel opens on, relative to the active
556
+ * parent item. Defaults to `'right'`. The opposite side is used as the
557
+ * floating-ui flip fallback so the sub-list still appears when the chosen
558
+ * side has no room.
559
+ */
560
+ submenuPlacement?: 'right' | 'left';
561
+ /**
562
+ * When true, a search input is rendered at the top of the parent panel
563
+ * and typing produces a flat, parent-grouped result list that filters
564
+ * across ALL sub-lists. The per-sub-list `searchable` flag is ignored
565
+ * while this mode is active.
566
+ */
567
+ searchable?: boolean;
568
+ searchPlaceholder?: string;
569
+ emptySearchText?: string;
570
+ /**
571
+ * Top-level loading flag — shown in the parent panel (covers async
572
+ * fetches that populate every sub-list at once). Independent from the
573
+ * per-sub-list `loading` flag, which still drives the child panel.
574
+ */
575
+ loading?: boolean;
576
+ /**
577
+ * Highlights a parent menu row as the currently-selected category.
578
+ */
579
+ selectedItemId?: string | null;
580
+ /**
581
+ * Highlights a sub-list row as the currently-selected entry. Applies to
582
+ * both the child panel and the global flat search results.
583
+ */
584
+ selectedSubItemId?: string | null;
585
+ /**
586
+ * Optional `data-testid` for the parent menu root and the child list root.
587
+ * Use these instead of relying on internal CSS class names from E2E tests.
588
+ */
589
+ menuTestId?: string;
590
+ listTestId?: string;
591
+ /**
592
+ * Stable id for the parent search `<input>` element. When set, the input's
593
+ * `id` attribute uses this value verbatim — useful when E2E tests need to
594
+ * `fill('#my-stable-id', ...)` the input. The child sub-list search input
595
+ * uses `${searchInputId}-child` if a value is provided.
596
+ */
597
+ searchInputId?: string;
531
598
  }
532
599
 
533
600
  export declare interface CascadingSelectPayload {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/ab-components",
3
- "version": "0.0.99",
3
+ "version": "0.0.100",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"