@nimbus-ds/components 5.18.0 → 5.20.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.
@@ -6,7 +6,7 @@ import { HTMLAttributes, ReactNode } from 'react';
6
6
  export type Cursor = "auto" | "pointer" | "not-allowed" | "grab" | "inherit";
7
7
  declare const icon: {
8
8
  sprinkle: ((props: {
9
- color?: "currentColor" | "primary-interactive" | "primary-surface" | "primary-textLow" | "success-textLow" | "success-surface" | "warning-interactive" | "warning-surface" | "warning-textLow" | "danger-interactive" | "danger-surface" | "danger-textLow" | "neutral-background" | "neutral-interactive" | "neutral-surface" | "neutral-textLow" | "success-interactive" | "primary-textHigh" | "success-textHigh" | "warning-textHigh" | "danger-textHigh" | "neutral-textDisabled" | "neutral-textHigh" | "ai-generative" | undefined;
9
+ color?: "currentColor" | "primary-interactive" | "primary-surface" | "primary-textLow" | "success-textLow" | "success-surface" | "warning-interactive" | "warning-surface" | "warning-textLow" | "danger-interactive" | "danger-surface" | "danger-textLow" | "neutral-background" | "neutral-interactive" | "neutral-surface" | "neutral-textLow" | "success-interactive" | "ai-generative" | "primary-textHigh" | "success-textHigh" | "warning-textHigh" | "danger-textHigh" | "neutral-textDisabled" | "neutral-textHigh" | undefined;
10
10
  cursor?: Cursor | undefined;
11
11
  }) => string) & {
12
12
  properties: Set<"color" | "cursor">;
@@ -32,6 +32,7 @@ export interface ModalSprinkle {
32
32
  declare const modal: {
33
33
  classnames: {
34
34
  overlay: string;
35
+ overlayScoped: string;
35
36
  container: string;
36
37
  container__close: string;
37
38
  container__footer: string;
@@ -128,6 +129,7 @@ declare const modal: {
128
129
  };
129
130
  };
130
131
  };
132
+ export type CloseOnOutsidePress = (event: PointerEvent | MouseEvent) => boolean;
131
133
  export interface ModalBodyProperties {
132
134
  /**
133
135
  * The content of the modal body.
@@ -198,13 +200,33 @@ export interface ModalProperties extends ModalSprinkle {
198
200
  * Id to be embedded in the portal element
199
201
  */
200
202
  portalId?: string;
203
+ /**
204
+ * Controls whether clicking/pressing outside should close the modal.
205
+ * - boolean: enable/disable dismissal on outside press
206
+ * - function: receive the DOM event and return true to allow closing, false to ignore
207
+ *
208
+ * Defaults to true.
209
+ */
210
+ closeOnOutsidePress?: boolean | CloseOnOutsidePress;
211
+ /**
212
+ * The attribute name to ignore when checking for outside clicks. Useful to
213
+ * mark regions (e.g., a chat) that should not close the modal when clicked.
214
+ * @default "data-nimbus-outside-press-ignore"
215
+ */
216
+ ignoreAttributeName?: string;
201
217
  /**
202
218
  * The padding properties are used to generate space around an modal's content area.
203
219
  * @default base
204
220
  */
205
221
  padding?: keyof typeof modal.properties.padding;
206
222
  }
207
- export type ModalProps = ModalProperties & HTMLAttributes<HTMLDivElement>;
223
+ export type ModalProps = ModalProperties & {
224
+ /**
225
+ * Root element where the portal should be mounted. When provided and not null,
226
+ * the portal renders inside this element; when null/undefined, the default root is used.
227
+ */
228
+ root?: HTMLElement | null;
229
+ } & HTMLAttributes<HTMLDivElement>;
208
230
  export declare const Modal: React.FC<ModalProps> & ModalComponents;
209
231
 
210
232
  export {};