@kingsimba/nc-ui 0.1.10 → 0.1.12

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
@@ -1,8 +1,10 @@
1
1
  import { ClassValue } from 'clsx';
2
2
  import { default as default_2 } from 'react';
3
+ import { ForwardRefExoticComponent } from 'react';
3
4
  import { i18n } from 'node_modules/i18next';
4
5
  import { JSX as JSX_2 } from 'react/jsx-runtime';
5
6
  import { ReactNode } from 'react';
7
+ import { RefAttributes } from 'react';
6
8
 
7
9
  /**
8
10
  * ActivityIndicator - A spinning loading indicator.
@@ -427,6 +429,59 @@ export declare interface ContextMenuProps {
427
429
  */
428
430
  export declare function createAppI18nFactory(resources: AppI18nResources): i18n;
429
431
 
432
+ /** Cursor position info emitted by `onCursorChange`. Lines and columns are 1-based. */
433
+ export declare interface CsvCursorPosition {
434
+ /** 1-based line number */
435
+ line: number;
436
+ /** 1-based column (tab-separated index) number */
437
+ column: number;
438
+ /** 1-based character position within that column */
439
+ character: number;
440
+ /** Absolute 0-based character offset in the entire text */
441
+ offset: number;
442
+ }
443
+
444
+ /**
445
+ * A textarea-like component that renders tab-separated text
446
+ * with different colors for each column.
447
+ *
448
+ * Uses a transparent `<textarea>` layered on top of a colored
449
+ * `<pre>` backdrop so that editing works natively while the
450
+ * user sees syntax-highlighted columns.
451
+ *
452
+ * Supports an optional line-number gutter (`showLineNumbers`) and
453
+ * cursor-position tracking (`onCursorChange`). Use a ref to access
454
+ * the imperative `goToLine(line)` method.
455
+ */
456
+ export declare const CsvTextArea: ForwardRefExoticComponent<CsvTextAreaProps & RefAttributes<CsvTextAreaHandle>>;
457
+
458
+ /** Imperative handle exposed via `ref` on CsvTextArea. */
459
+ export declare interface CsvTextAreaHandle {
460
+ /** Move the cursor to the beginning of the given 1-based line and scroll it into view. */
461
+ goToLine: (line: number) => void;
462
+ /** Move the cursor to a specific line, column, and character (all 1-based) */
463
+ goToPosition: (line: number, column: number, character: number) => void;
464
+ }
465
+
466
+ export declare interface CsvTextAreaProps {
467
+ /** The raw tab-separated text */
468
+ value: string;
469
+ /** Called when the text changes */
470
+ onChange: (value: string) => void;
471
+ /** Placeholder text shown when the textarea is empty */
472
+ placeholder?: string;
473
+ /** Additional CSS class name(s) */
474
+ className?: string;
475
+ /** Inline styles applied to the container element */
476
+ style?: React.CSSProperties;
477
+ /** Show a line-number gutter on the left side. Defaults to `false`. */
478
+ showLineNumbers?: boolean;
479
+ /** Called whenever the cursor position changes (click, arrow keys, typing). */
480
+ onCursorChange?: (position: CsvCursorPosition) => void;
481
+ /** 1-based line number to highlight with a background band. The line is scrolled into view automatically. */
482
+ highlightLine?: number;
483
+ }
484
+
430
485
  /**
431
486
  * A reusable modal dialog component with overlay.
432
487
  * Renders in a portal to ensure proper z-index stacking.
@@ -923,7 +978,7 @@ export declare interface TabPanelsProps {
923
978
  style?: default_2.CSSProperties;
924
979
  }
925
980
 
926
- export declare function Tabs({ tabs, active, onChange, className, toolbar, multiline, orientation, style }: TabsProps): JSX_2.Element;
981
+ export declare function Tabs({ tabs, active, onChange, onClose, permanentTabs, className, toolbar, multiline, orientation, style }: TabsProps): JSX_2.Element;
927
982
 
928
983
  export declare interface TabsProps {
929
984
  /** Array of tab labels */
@@ -932,6 +987,10 @@ export declare interface TabsProps {
932
987
  active: string;
933
988
  /** Callback when a tab is selected */
934
989
  onChange: (tab: string) => void;
990
+ /** Callback when a tab's close button is clicked. When provided, each tab shows a close button. */
991
+ onClose?: (tab: string) => void;
992
+ /** Tabs that cannot be closed. These tabs won't show a close button even when onClose is provided. */
993
+ permanentTabs?: string[];
935
994
  /** Additional CSS class name for the container */
936
995
  className?: string;
937
996
  /** Optional toolbar content rendered at the end of the tab bar */