@nimbus-ds/components 5.18.0 → 5.19.0

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
@@ -1775,6 +1775,7 @@ export interface ModalSprinkle {
1775
1775
  declare const modal: {
1776
1776
  classnames: {
1777
1777
  overlay: string;
1778
+ overlayScoped: string;
1778
1779
  container: string;
1779
1780
  container__close: string;
1780
1781
  container__footer: string;
@@ -2132,7 +2133,9 @@ declare const sidebar: {
2132
2133
  };
2133
2134
  classnames: {
2134
2135
  overlay: string;
2136
+ overlayScoped: string;
2135
2137
  container: string;
2138
+ containerScoped: string;
2136
2139
  container__header: string;
2137
2140
  container__body: string;
2138
2141
  container__footer: string;
@@ -3278,6 +3281,7 @@ export interface CollapsibleProperties {
3278
3281
  }
3279
3282
  export type CollapsibleBaseProps = CollapsibleProperties & Omit<HTMLAttributes<HTMLElement>, "onChange">;
3280
3283
  export declare const Collapsible: React.FC<CollapsibleProperties> & CollapsibleComponents;
3284
+ export type CloseOnOutsidePress = (event: PointerEvent | MouseEvent) => boolean;
3281
3285
  export interface ModalBodyProperties {
3282
3286
  /**
3283
3287
  * The content of the modal body.
@@ -3348,13 +3352,33 @@ export interface ModalProperties extends ModalSprinkle {
3348
3352
  * Id to be embedded in the portal element
3349
3353
  */
3350
3354
  portalId?: string;
3355
+ /**
3356
+ * Controls whether clicking/pressing outside should close the modal.
3357
+ * - boolean: enable/disable dismissal on outside press
3358
+ * - function: receive the DOM event and return true to allow closing, false to ignore
3359
+ *
3360
+ * Defaults to true.
3361
+ */
3362
+ closeOnOutsidePress?: boolean | CloseOnOutsidePress;
3363
+ /**
3364
+ * The attribute name to ignore when checking for outside clicks. Useful to
3365
+ * mark regions (e.g., a chat) that should not close the modal when clicked.
3366
+ * @default "data-nimbus-outside-press-ignore"
3367
+ */
3368
+ ignoreAttributeName?: string;
3351
3369
  /**
3352
3370
  * The padding properties are used to generate space around an modal's content area.
3353
3371
  * @default base
3354
3372
  */
3355
3373
  padding?: keyof typeof modal.properties.padding;
3356
3374
  }
3357
- export type ModalProps = ModalProperties & HTMLAttributes<HTMLDivElement>;
3375
+ export type ModalProps = ModalProperties & {
3376
+ /**
3377
+ * Root element where the portal should be mounted. When provided and not null,
3378
+ * the portal renders inside this element; when null/undefined, the default root is used.
3379
+ */
3380
+ root?: HTMLElement | null;
3381
+ } & HTMLAttributes<HTMLDivElement>;
3358
3382
  export declare const Modal: React.FC<ModalProps> & ModalComponents;
3359
3383
  export interface PaginationItemData {
3360
3384
  pageNumber: number | string;
@@ -3552,8 +3576,27 @@ export interface SidebarProperties extends SidebarSprinkle {
3552
3576
  * @default true
3553
3577
  */
3554
3578
  needRemoveScroll?: boolean;
3579
+ /**
3580
+ * Controls whether clicking/pressing outside should close the sidebar.
3581
+ * - boolean: enable/disable dismissal on outside press
3582
+ * - function: receive the DOM event and return true to allow closing, false to ignore
3583
+ *
3584
+ * Defaults to true for backward compatibility.
3585
+ */
3586
+ closeOnOutsidePress?: boolean | CloseOnOutsidePress;
3587
+ /**
3588
+ * The attribute name to ignore when checking for outside clicks.
3589
+ * @default "data-nimbus-outside-press-ignore"
3590
+ */
3591
+ ignoreAttributeName?: string;
3555
3592
  }
3556
- export type SidebarProps = SidebarProperties & HTMLAttributes<HTMLDivElement>;
3593
+ export type SidebarProps = SidebarProperties & {
3594
+ /**
3595
+ * Root element where the portal should be mounted. When provided and not null,
3596
+ * the portal renders inside this element; when null/undefined, the default root is used.
3597
+ */
3598
+ root?: HTMLElement | null;
3599
+ } & HTMLAttributes<HTMLDivElement>;
3557
3600
  export declare const Sidebar: React.FC<SidebarProps> & SidebarComponents;
3558
3601
  /**
3559
3602
  * Represents the visual state of a step