@nimbus-ds/components 5.12.1 → 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
@@ -2646,6 +2646,11 @@ export interface PopoverProperties extends PopoverSprinkle {
2646
2646
  * @default 10
2647
2647
  */
2648
2648
  offset?: number;
2649
+ /**
2650
+ * When enabled, renders an invisible overlay that prevents accidental clicks on elements behind the popover.
2651
+ * @default false
2652
+ */
2653
+ renderOverlay?: boolean;
2649
2654
  }
2650
2655
  export type PopoverProps = PopoverProperties & Omit<HTMLAttributes<HTMLDivElement>, "children" | "content">;
2651
2656
  export declare const Popover: React.FC<PopoverProps>;
@@ -3316,6 +3321,90 @@ export interface PaginationProperties {
3316
3321
  }
3317
3322
  export type PaginationProps = PaginationProperties & HTMLAttributes<HTMLElement>;
3318
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;
3319
3408
  export interface SidebarBodyProperties {
3320
3409
  /**
3321
3410
  * The content of the sidebar body.
@@ -3645,14 +3734,14 @@ export interface SegmentedControlButtonSkeletonProps {
3645
3734
  }
3646
3735
  export type SegmentedControlButtonProperties = PropsWithChildren<{
3647
3736
  /**
3648
- * Label of the segment.
3737
+ * Unique identifier for the segment button.
3738
+ * Required for proper state management and accessibility.
3649
3739
  */
3650
- label: string;
3740
+ id: string;
3651
3741
  /**
3652
- * Determines if segment is active.
3653
- * @default false
3742
+ * Label of the segment used for accessibility.
3654
3743
  */
3655
- selected?: boolean;
3744
+ label?: string;
3656
3745
  /**
3657
3746
  * Determines if segment spans all available width.
3658
3747
  * @default false
@@ -3668,9 +3757,9 @@ declare const SegmentedControlButtonSkeleton: React.FC<SegmentedControlButtonSke
3668
3757
  export interface SegmentedControlBaseProps {
3669
3758
  /**
3670
3759
  * The content of the segmented control.
3671
- * @TJS-type ReactElement<SegmentedControlButtonProps | SegmentedControlButtonSkeletonProps>[];
3760
+ * Should contain SegmentedControlButton components with unique id props.
3672
3761
  */
3673
- children: ReactElement<SegmentedControlButtonProps | SegmentedControlButtonSkeletonProps>[];
3762
+ children: ReactNode;
3674
3763
  /**
3675
3764
  * Determines if segments span all available width.
3676
3765
  * @default false
@@ -3686,15 +3775,15 @@ export interface SegmentedControlComponents {
3686
3775
  }
3687
3776
  export interface ControlledSegmentedControlProperties extends SegmentedControlBaseProps {
3688
3777
  /**
3689
- * The currently selected segment indices.
3778
+ * The currently selected segment IDs.
3690
3779
  * Allows for single or multiple selection.
3691
3780
  */
3692
- selectedSegments: number[];
3781
+ selectedSegments: string[];
3693
3782
  /**
3694
3783
  * Callback fired when the selected segments change.
3695
- * This will only be called if the change results in at least one selected segment.
3784
+ * @param selectedIds Array of selected segment IDs
3696
3785
  */
3697
- onSegmentsSelect: (indices: number[]) => void;
3786
+ onSegmentsSelect: (selectedIds: string[]) => void;
3698
3787
  }
3699
3788
  /**
3700
3789
  * Props for the SegmentedControl component, supporting both controlled and uncontrolled modes
@@ -3704,5 +3793,36 @@ export type SegmentedControlProps = (SegmentedControlBaseProps | ControlledSegme
3704
3793
  * SegmentedControl component for grouped selection controls
3705
3794
  */
3706
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;
3707
3827
 
3708
3828
  export {};