@nimbus-ds/components 5.13.0 → 5.14.0-rc.1

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
@@ -3321,6 +3321,90 @@ export interface PaginationProperties {
3321
3321
  }
3322
3322
  export type PaginationProps = PaginationProperties & HTMLAttributes<HTMLElement>;
3323
3323
  export declare const Pagination: React.FC<PaginationProps>;
3324
+ export interface ScrollPaneItemProperties {
3325
+ /**
3326
+ * The content to be rendered inside the scroll pane item
3327
+ */
3328
+ children: ReactNode;
3329
+ /**
3330
+ * Custom class name for styling
3331
+ */
3332
+ className?: string;
3333
+ /**
3334
+ * Custom inline styles
3335
+ */
3336
+ style?: React.CSSProperties;
3337
+ /**
3338
+ * Callback fired when the item is clicked
3339
+ */
3340
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
3341
+ }
3342
+ export type ScrollPaneItemProps = ScrollPaneItemProperties & Omit<BoxProps, "children">;
3343
+ export type ScrollPaneArrowProperties = {
3344
+ children: ReactNode;
3345
+ };
3346
+ export type ScrollPaneArrowVerticalEndProperties = ScrollPaneArrowProperties;
3347
+ export type ScrollPaneArrowVerticalStartProperties = ScrollPaneArrowProperties;
3348
+ export type ScrollPaneArrowHorizontalEndProperties = ScrollPaneArrowProperties;
3349
+ export type ScrollPaneArrowHorizontalStartProperties = ScrollPaneArrowProperties;
3350
+ export interface ScrollPaneComponents {
3351
+ Item: React.FC<ScrollPaneItemProps>;
3352
+ ArrowHorizontalStart: React.FC<ScrollPaneArrowHorizontalStartProperties>;
3353
+ ArrowHorizontalEnd: React.FC<ScrollPaneArrowHorizontalEndProperties>;
3354
+ ArrowVerticalStart: React.FC<ScrollPaneArrowVerticalStartProperties>;
3355
+ ArrowVerticalEnd: React.FC<ScrollPaneArrowVerticalEndProperties>;
3356
+ }
3357
+ export interface ScrollPaneProperties {
3358
+ /**
3359
+ * The content to be rendered inside the scroll pane
3360
+ */
3361
+ children: ReactNode;
3362
+ /**
3363
+ * Whether to show gradient overlays when content overflows
3364
+ * @default true
3365
+ */
3366
+ showGradients?: boolean;
3367
+ /**
3368
+ * Whether to show navigation arrows for scrolling
3369
+ * @default false
3370
+ */
3371
+ showArrows?: boolean;
3372
+ /**
3373
+ * Whether to show the scrollbar
3374
+ * @default true
3375
+ */
3376
+ showScrollbar?: boolean;
3377
+ /**
3378
+ * The direction of the scroll (horizontal or vertical)
3379
+ * @default "horizontal"
3380
+ */
3381
+ direction?: "horizontal" | "vertical";
3382
+ /**
3383
+ * Whether items should scroll into view when clicked
3384
+ * @default true
3385
+ */
3386
+ scrollToItemOnClick?: boolean;
3387
+ /**
3388
+ * Custom arrow component to render at the start of the scroll area
3389
+ */
3390
+ scrollPaneArrowStart?: React.ReactNode;
3391
+ /**
3392
+ * Custom arrow component to render at the end of the scroll area
3393
+ */
3394
+ scrollPaneArrowEnd?: React.ReactNode;
3395
+ }
3396
+ export type ScrollPaneProps = ScrollPaneProperties & Omit<BoxProps, "children">;
3397
+ /**
3398
+ * ScrollPane component handles responsive scrolls in lists that are overflowing inside a container.
3399
+ * It provides gradient overlays, optional navigation arrows, and scroll-to-item functionality.
3400
+ *
3401
+ * @example
3402
+ * <ScrollPane showArrows showGradients showScrollbar>
3403
+ * <ScrollPane.Item>Item 1</ScrollPane.Item>
3404
+ * <ScrollPane.Item>Item 2</ScrollPane.Item>
3405
+ * </ScrollPane>
3406
+ */
3407
+ export declare const ScrollPane: React.FC<ScrollPaneProps> & ScrollPaneComponents;
3324
3408
  export interface SidebarBodyProperties {
3325
3409
  /**
3326
3410
  * The content of the sidebar body.
@@ -3650,14 +3734,14 @@ export interface SegmentedControlButtonSkeletonProps {
3650
3734
  }
3651
3735
  export type SegmentedControlButtonProperties = PropsWithChildren<{
3652
3736
  /**
3653
- * Label of the segment.
3737
+ * Unique identifier for the segment button.
3738
+ * Required for proper state management and accessibility.
3654
3739
  */
3655
- label: string;
3740
+ id: string;
3656
3741
  /**
3657
- * Determines if segment is active.
3658
- * @default false
3742
+ * Label of the segment used for accessibility.
3659
3743
  */
3660
- selected?: boolean;
3744
+ label?: string;
3661
3745
  /**
3662
3746
  * Determines if segment spans all available width.
3663
3747
  * @default false
@@ -3673,9 +3757,9 @@ declare const SegmentedControlButtonSkeleton: React.FC<SegmentedControlButtonSke
3673
3757
  export interface SegmentedControlBaseProps {
3674
3758
  /**
3675
3759
  * The content of the segmented control.
3676
- * @TJS-type ReactElement<SegmentedControlButtonProps | SegmentedControlButtonSkeletonProps>[];
3760
+ * Should contain SegmentedControlButton components with unique id props.
3677
3761
  */
3678
- children: ReactElement<SegmentedControlButtonProps | SegmentedControlButtonSkeletonProps>[];
3762
+ children: ReactNode;
3679
3763
  /**
3680
3764
  * Determines if segments span all available width.
3681
3765
  * @default false
@@ -3691,15 +3775,15 @@ export interface SegmentedControlComponents {
3691
3775
  }
3692
3776
  export interface ControlledSegmentedControlProperties extends SegmentedControlBaseProps {
3693
3777
  /**
3694
- * The currently selected segment indices.
3778
+ * The currently selected segment IDs.
3695
3779
  * Allows for single or multiple selection.
3696
3780
  */
3697
- selectedSegments: number[];
3781
+ selectedSegments: string[];
3698
3782
  /**
3699
3783
  * Callback fired when the selected segments change.
3700
- * This will only be called if the change results in at least one selected segment.
3784
+ * @param selectedIds Array of selected segment IDs
3701
3785
  */
3702
- onSegmentsSelect: (indices: number[]) => void;
3786
+ onSegmentsSelect: (selectedIds: string[]) => void;
3703
3787
  }
3704
3788
  /**
3705
3789
  * Props for the SegmentedControl component, supporting both controlled and uncontrolled modes
@@ -3709,5 +3793,36 @@ export type SegmentedControlProps = (SegmentedControlBaseProps | ControlledSegme
3709
3793
  * SegmentedControl component for grouped selection controls
3710
3794
  */
3711
3795
  export declare const SegmentedControl: React.FC<SegmentedControlProps> & SegmentedControlComponents;
3796
+ export interface SegmentedControlContextValue {
3797
+ /**
3798
+ * Register a button with its unique identifier
3799
+ * @param id The unique identifier for the button
3800
+ */
3801
+ registerButton: (id: string) => void;
3802
+ /**
3803
+ * Unregister a button by its identifier
3804
+ * @param id The identifier of the button to unregister
3805
+ */
3806
+ unregisterButton: (id: string) => void;
3807
+ /**
3808
+ * Toggle a segment's state by ID
3809
+ * @param id The unique identifier of the segment to toggle
3810
+ */
3811
+ toggleSegment: (id: string) => void;
3812
+ /**
3813
+ * Check if a segment is currently selected by ID
3814
+ * @param id The unique identifier of the segment to check
3815
+ */
3816
+ isSelected: (id: string) => boolean;
3817
+ /**
3818
+ * Whether buttons should span full width
3819
+ */
3820
+ fullWidth: boolean;
3821
+ }
3822
+ /**
3823
+ * Hook to use SegmentedControl context with error if not found
3824
+ * @throws Error if not within a SegmentedControl
3825
+ */
3826
+ export declare const useSegmentedControlContext: () => SegmentedControlContextValue;
3712
3827
 
3713
3828
  export {};