@sproutsocial/seeds-react-modal 2.4.9 → 2.5.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.
Files changed (36) hide show
  1. package/.turbo/turbo-build.log +27 -27
  2. package/CHANGELOG.md +70 -0
  3. package/dist/{Modal-ki8oiGbC.d.mts → Modal-DTeKLfEI.d.mts} +1 -1
  4. package/dist/{Modal-ki8oiGbC.d.ts → Modal-DTeKLfEI.d.ts} +1 -1
  5. package/dist/{ModalAction-BHG3Zbd9.d.mts → ModalExternalTrigger-BnbJk9zY.d.mts} +85 -3
  6. package/dist/{ModalAction-BHG3Zbd9.d.ts → ModalExternalTrigger-BnbJk9zY.d.ts} +85 -3
  7. package/dist/esm/{chunk-HOGEFGDN.js → chunk-62MRZAJV.js} +32 -10
  8. package/dist/esm/{chunk-HOGEFGDN.js.map → chunk-62MRZAJV.js.map} +1 -1
  9. package/dist/esm/{chunk-IYDY4OPB.js → chunk-72GBDCA2.js} +17 -1
  10. package/dist/esm/chunk-72GBDCA2.js.map +1 -0
  11. package/dist/esm/index.js +10 -4
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/v1/index.js +1 -1
  14. package/dist/esm/v2/index.js +1 -1
  15. package/dist/index.d.mts +3 -3
  16. package/dist/index.d.ts +3 -3
  17. package/dist/index.js +81 -11
  18. package/dist/index.js.map +1 -1
  19. package/dist/v1/index.d.mts +2 -2
  20. package/dist/v1/index.d.ts +2 -2
  21. package/dist/v1/index.js +16 -0
  22. package/dist/v1/index.js.map +1 -1
  23. package/dist/v2/index.d.mts +4 -77
  24. package/dist/v2/index.d.ts +4 -77
  25. package/dist/v2/index.js +31 -9
  26. package/dist/v2/index.js.map +1 -1
  27. package/package.json +7 -7
  28. package/src/Modal.stories.tsx +64 -0
  29. package/src/__tests__/v1/Modal.test.tsx +146 -1
  30. package/src/__tests__/v2/Modal.test.tsx +77 -0
  31. package/src/index.ts +4 -0
  32. package/src/v1/Modal.tsx +30 -0
  33. package/src/v2/ModalTypes.ts +9 -2
  34. package/src/v2/ModalV2.stories.tsx +268 -49
  35. package/src/v2/components/ModalFooter.tsx +15 -4
  36. package/dist/esm/chunk-IYDY4OPB.js.map +0 -1
@@ -3,39 +3,39 @@ $ tsup --dts
3
3
  CLI Building entry: {"index":"src/index.ts","v1/index":"src/v1/index.ts","v2/index":"src/v2/index.ts"}
4
4
  CLI Using tsconfig: tsconfig.json
5
5
  CLI tsup v8.5.0
6
- CLI Using tsup config: /home/runner/work/seeds/seeds/seeds-react/seeds-react-modal/tsup.config.ts
6
+ CLI Using tsup config: /home/runner/_work/seeds/seeds/seeds-react/seeds-react-modal/tsup.config.ts
7
7
  CLI Target: es2022
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
+ CJS dist/index.js 41.30 KB
12
+ CJS dist/v1/index.js 10.31 KB
13
+ CJS dist/v2/index.js 32.84 KB
14
+ CJS dist/index.js.map 81.32 KB
15
+ CJS dist/v1/index.js.map 14.56 KB
16
+ CJS dist/v2/index.js.map 66.44 KB
17
+ CJS ⚡️ Build success in 30ms
18
+ ESM dist/esm/index.js 733.00 B
11
19
  ESM dist/esm/v1/index.js 165.00 B
12
- ESM dist/esm/index.js 583.00 B
20
+ ESM dist/esm/chunk-72GBDCA2.js 7.57 KB
21
+ ESM dist/esm/chunk-62MRZAJV.js 27.81 KB
13
22
  ESM dist/esm/v2/index.js 746.00 B
14
- ESM dist/esm/chunk-IYDY4OPB.js 7.12 KB
15
- ESM dist/esm/chunk-HOGEFGDN.js 27.15 KB
23
+ ESM dist/esm/index.js.map 1.16 KB
16
24
  ESM dist/esm/v1/index.js.map 71.00 B
17
- ESM dist/esm/index.js.map 1.05 KB
25
+ ESM dist/esm/chunk-72GBDCA2.js.map 14.38 KB
26
+ ESM dist/esm/chunk-62MRZAJV.js.map 65.36 KB
18
27
  ESM dist/esm/v2/index.js.map 71.00 B
19
- ESM dist/esm/chunk-IYDY4OPB.js.map 12.85 KB
20
- ESM dist/esm/chunk-HOGEFGDN.js.map 64.13 KB
21
- ESM ⚡️ Build success in 252ms
22
- CJS dist/v1/index.js 9.86 KB
23
- CJS dist/v2/index.js 32.27 KB
24
- CJS dist/index.js 39.35 KB
25
- CJS dist/v2/index.js.map 65.21 KB
26
- CJS dist/v1/index.js.map 13.03 KB
27
- CJS dist/index.js.map 77.93 KB
28
- CJS ⚡️ Build success in 252ms
28
+ ESM ⚡️ Build success in 30ms
29
29
  DTS Build start
30
- DTS ⚡️ Build success in 18424ms
31
- DTS dist/index.d.ts 975.00 B
32
- DTS dist/v1/index.d.ts 413.00 B
33
- DTS dist/v2/index.d.ts 3.72 KB
34
- DTS dist/Modal-ki8oiGbC.d.ts 2.52 KB
35
- DTS dist/ModalAction-BHG3Zbd9.d.ts 20.46 KB
36
- DTS dist/index.d.mts 978.00 B
37
- DTS dist/v1/index.d.mts 415.00 B
38
- DTS dist/v2/index.d.mts 3.72 KB
39
- DTS dist/Modal-ki8oiGbC.d.mts 2.52 KB
40
- DTS dist/ModalAction-BHG3Zbd9.d.mts 20.46 KB
41
- Done in 21.58s.
30
+ DTS ⚡️ Build success in 4194ms
31
+ DTS dist/index.d.ts 1.07 KB
32
+ DTS dist/v1/index.d.ts 413.00 B
33
+ DTS dist/v2/index.d.ts 1.16 KB
34
+ DTS dist/Modal-DTeKLfEI.d.ts 2.52 KB
35
+ DTS dist/ModalExternalTrigger-BnbJk9zY.d.ts 23.41 KB
36
+ DTS dist/index.d.mts 1.08 KB
37
+ DTS dist/v1/index.d.mts 415.00 B
38
+ DTS dist/v2/index.d.mts 1.16 KB
39
+ DTS dist/Modal-DTeKLfEI.d.mts 2.52 KB
40
+ DTS dist/ModalExternalTrigger-BnbJk9zY.d.mts 23.41 KB
41
+ Done in 4.96s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # @sproutsocial/seeds-react-modal
2
2
 
3
+ ## 2.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @sproutsocial/seeds-react-icon@2.2.6
8
+ - @sproutsocial/seeds-react-button@1.4.1
9
+
10
+ ## 2.5.0
11
+
12
+ ### Minor Changes
13
+
14
+ - badefd7: Add `closeOnPrimaryAction` prop to ModalFooter to support async primary actions without auto-closing. Document all Modal V2 close event handlers (`onEscapeKeyDown`, `onInteractOutside`, `closeButtonProps.onClick`, etc.) and convenience props (`disableEscapeKeyClose`, `disableOutsideClickClose`) on the reference site and PropTable.
15
+
16
+ ## 2.4.13
17
+
18
+ ### Patch Changes
19
+
20
+ - 62285b4: Title: Export useModalTriggerProps, useModalExternalTrigger, and ModalExternalTrigger from top-level package; add controlled modal and accessible trigger documentation
21
+
22
+ Description:
23
+
24
+ Exports `useModalTriggerProps`, `useModalExternalTrigger`, `ModalExternalTrigger`, and `ModalExternalTriggerProps` from the main `seeds-react-modal` package entry point so consumers can import them from `@sproutsocial/racine` without reaching into the `/v2` subpath.
25
+
26
+ Updates reference site and Storybook documentation to cover:
27
+
28
+ - Uncontrolled vs controlled modal patterns with clear recommendations
29
+ - `useModalExternalTrigger`, `ModalExternalTrigger`, and `useModalTriggerProps` usage for controlled modals
30
+ - Accessible triggers for Modal V1 using `useModalTriggerProps` as a stopgap before migration
31
+ - Nested Modal V2 stacking with `zIndex` prop
32
+ - Fixes "can not" → "can't" in destructive confirmation example (issue #1973)
33
+
34
+ - Updated dependencies [7d54d67]
35
+ - @sproutsocial/seeds-react-button@1.4.0
36
+
37
+ ## 2.4.12
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [17d4f12]
42
+ - @sproutsocial/seeds-react-theme@3.6.0
43
+ - @sproutsocial/seeds-react-box@1.1.14
44
+ - @sproutsocial/seeds-react-icon@2.2.5
45
+ - @sproutsocial/seeds-react-button@1.3.20
46
+
47
+ ## 2.4.11
48
+
49
+ ### Patch Changes
50
+
51
+ - 2689788: Fix Toast and Modal V1 being unclickable when Modal V2 is open
52
+
53
+ When a Radix Dialog (Modal V2) is open, it sets `pointer-events: none` on `document.body`
54
+ and listens for `pointerdown` on the document to detect outside clicks. This breaks non-Radix
55
+ overlays that portal to body (Toast, Modal V1) — making them unclickable and causing Modal V2
56
+ to dismiss when interacting with them.
57
+
58
+ **Toast**: Wrap `ToastRoot` in Radix `DismissableLayerBranch` with `pointer-events: auto`.
59
+ This registers the toast container as a branch of the dismissable layer system, preventing
60
+ Modal V2 from closing on toast interaction.
61
+
62
+ **Modal V1**: Use react-modal's `contentRef` to set `pointer-events: auto` on the portal node
63
+ and stop `pointerdown` propagation. `DismissableLayerBranch` can't be used here because
64
+ react-modal portals to `document.body`, and Modal V2's `transform` creates a containing block
65
+ that would break V1's `position: fixed` overlay if portaled inside V2.
66
+
67
+ ## 2.4.10
68
+
69
+ ### Patch Changes
70
+
71
+ - @sproutsocial/seeds-react-button@1.3.19
72
+
3
73
  ## 2.4.9
4
74
 
5
75
  ### Patch Changes
@@ -66,4 +66,4 @@ declare const Modal: {
66
66
  };
67
67
  };
68
68
 
69
- export { Modal as M, type TypeModalProps as T, type TypeModalHeaderProps as a, type TypeModalFooterProps as b, type TypeModalContentProps as c, type TypeModalCloseButtonProps as d };
69
+ export { Modal as M, type TypeModalCloseButtonProps as T, type TypeModalContentProps as a, type TypeModalFooterProps as b, type TypeModalHeaderProps as c, type TypeModalProps as d };
@@ -66,4 +66,4 @@ declare const Modal: {
66
66
  };
67
67
  };
68
68
 
69
- export { Modal as M, type TypeModalProps as T, type TypeModalHeaderProps as a, type TypeModalFooterProps as b, type TypeModalContentProps as c, type TypeModalCloseButtonProps as d };
69
+ export { Modal as M, type TypeModalCloseButtonProps as T, type TypeModalContentProps as a, type TypeModalFooterProps as b, type TypeModalHeaderProps as c, type TypeModalProps as d };
@@ -2,9 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import * as styled_components from 'styled-components';
4
4
  import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
5
- import { TypeContainerProps, TypeBoxProps } from '@sproutsocial/seeds-react-box';
5
+ import { TypeBoxProps, TypeContainerProps } from '@sproutsocial/seeds-react-box';
6
6
  import * as Dialog from '@radix-ui/react-dialog';
7
7
  import { TypeIconName } from '@sproutsocial/seeds-react-icon';
8
+ import { TypeButtonProps } from '@sproutsocial/seeds-react-button';
8
9
 
9
10
  /**
10
11
  * Props for ModalHeader component.
@@ -57,7 +58,15 @@ interface TypeModalDescriptionProps extends TypeBoxProps {
57
58
  * Note: This component only supports slots (button props).
58
59
  * For custom footers, use ModalCustomFooter instead.
59
60
  */
60
- type TypeModalFooterProps = TypeBoxProps & ({
61
+ type TypeModalFooterProps = TypeBoxProps & {
62
+ /**
63
+ * Whether clicking the primary button automatically closes the modal.
64
+ * Set to `false` when the primary action is async (e.g., saving data)
65
+ * and the modal should stay open until the operation completes.
66
+ * @default true
67
+ */
68
+ closeOnPrimaryAction?: boolean;
69
+ } & ({
61
70
  /** Primary action button - automatically wrapped in ModalCloseWrapper */
62
71
  primaryButton: React.ReactNode;
63
72
  /** Cancel/secondary button - automatically wrapped in ModalCloseWrapper */
@@ -561,4 +570,77 @@ declare const ModalRail: React.FC<TypeModalRailProps>;
561
570
 
562
571
  declare const ModalAction: React.FC<TypeModalActionProps>;
563
572
 
564
- export { Modal as M, type TypeModalProps as T, ModalDescription as a, ModalHeader as b, ModalFooter as c, ModalBody as d, ModalCloseWrapper as e, ModalRail as f, ModalAction as g, ModalCustomHeader as h, ModalCustomFooter as i, type TypeModalHeaderProps as j, type TypeModalFooterProps as k, type TypeModalBodyProps as l, type TypeModalDescriptionProps as m, type TypeModalRailProps as n, type TypeModalActionProps as o, type ModalCloseWrapperProps as p, useModalExternalTrigger as q, useModalTriggerProps as u };
573
+ /**
574
+ * Props for ModalExternalTrigger component.
575
+ */
576
+ interface ModalExternalTriggerProps extends Omit<TypeButtonProps, "onClick"> {
577
+ /** Callback when button is clicked to trigger modal open */
578
+ onTrigger: () => void;
579
+ /** Whether the modal is currently open (for ARIA expanded state) */
580
+ isOpen: boolean;
581
+ /** Optional modal ID for aria-controls attribute */
582
+ modalId?: string;
583
+ /** Optional onClick handler (called before onTrigger) */
584
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
585
+ }
586
+ /**
587
+ * A Button component pre-configured for triggering modals from outside the Modal component tree.
588
+ *
589
+ * ⚠️ **NOT RECOMMENDED** - Prefer using modalTrigger prop or ModalTrigger component.
590
+ * Use this component ONLY as a last resort when architectural constraints prevent keeping
591
+ * the trigger inside the Modal component tree.
592
+ *
593
+ * This component wraps the Seeds Button with automatic ARIA attributes for modal triggers.
594
+ * However, focus restoration still requires manual handling via onCloseAutoFocus callback
595
+ * due to Radix UI's architectural limitations with external triggers.
596
+ *
597
+ * **Why modalTrigger prop is better:**
598
+ * - Automatic ARIA attributes
599
+ * - Automatic focus restoration (no onCloseAutoFocus needed)
600
+ * - Better touch device support
601
+ * - Follows WAI-ARIA Dialog best practices
602
+ *
603
+ * **When to use ModalExternalTrigger:**
604
+ * - Trigger must live outside Modal component tree (e.g., in a page header)
605
+ * - Using Seeds Button as the trigger
606
+ * - Want automatic ARIA attributes without manual hook usage
607
+ *
608
+ * **Usage pattern with focus restoration:**
609
+ * You must still handle focus restoration manually by passing a ref and implementing
610
+ * onCloseAutoFocus on the Modal component.
611
+ *
612
+ * @example
613
+ * ```tsx
614
+ * const [isOpen, setIsOpen] = useState(false);
615
+ * const triggerRef = useRef<HTMLButtonElement>(null);
616
+ *
617
+ * return (
618
+ * <>
619
+ * <ModalExternalTrigger
620
+ * ref={triggerRef}
621
+ * isOpen={isOpen}
622
+ * onTrigger={() => setIsOpen(true)}
623
+ * appearance="primary"
624
+ * >
625
+ * Open Modal
626
+ * </ModalExternalTrigger>
627
+ *
628
+ * <Modal
629
+ * open={isOpen}
630
+ * onOpenChange={setIsOpen}
631
+ * onCloseAutoFocus={(e) => {
632
+ * e.preventDefault();
633
+ * triggerRef.current?.focus();
634
+ * }}
635
+ * >
636
+ * <ModalBody>Content</ModalBody>
637
+ * </Modal>
638
+ * </>
639
+ * );
640
+ * ```
641
+ *
642
+ * @see useModalExternalTrigger - Hook alternative for non-Button triggers
643
+ */
644
+ declare const ModalExternalTrigger: React.ForwardRefExoticComponent<Omit<ModalExternalTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
645
+
646
+ export { ModalAction as M, type TypeModalActionProps as T, ModalBody as a, ModalCloseWrapper as b, type ModalCloseWrapperProps as c, ModalCustomFooter as d, ModalCustomHeader as e, ModalDescription as f, ModalExternalTrigger as g, type ModalExternalTriggerProps as h, ModalFooter as i, ModalHeader as j, ModalRail as k, Modal as l, type TypeModalRailProps as m, type TypeModalBodyProps as n, type TypeModalDescriptionProps as o, type TypeModalFooterProps as p, type TypeModalHeaderProps as q, type TypeModalProps as r, useModalTriggerProps as s, useModalExternalTrigger as u };
@@ -2,9 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import * as styled_components from 'styled-components';
4
4
  import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
5
- import { TypeContainerProps, TypeBoxProps } from '@sproutsocial/seeds-react-box';
5
+ import { TypeBoxProps, TypeContainerProps } from '@sproutsocial/seeds-react-box';
6
6
  import * as Dialog from '@radix-ui/react-dialog';
7
7
  import { TypeIconName } from '@sproutsocial/seeds-react-icon';
8
+ import { TypeButtonProps } from '@sproutsocial/seeds-react-button';
8
9
 
9
10
  /**
10
11
  * Props for ModalHeader component.
@@ -57,7 +58,15 @@ interface TypeModalDescriptionProps extends TypeBoxProps {
57
58
  * Note: This component only supports slots (button props).
58
59
  * For custom footers, use ModalCustomFooter instead.
59
60
  */
60
- type TypeModalFooterProps = TypeBoxProps & ({
61
+ type TypeModalFooterProps = TypeBoxProps & {
62
+ /**
63
+ * Whether clicking the primary button automatically closes the modal.
64
+ * Set to `false` when the primary action is async (e.g., saving data)
65
+ * and the modal should stay open until the operation completes.
66
+ * @default true
67
+ */
68
+ closeOnPrimaryAction?: boolean;
69
+ } & ({
61
70
  /** Primary action button - automatically wrapped in ModalCloseWrapper */
62
71
  primaryButton: React.ReactNode;
63
72
  /** Cancel/secondary button - automatically wrapped in ModalCloseWrapper */
@@ -561,4 +570,77 @@ declare const ModalRail: React.FC<TypeModalRailProps>;
561
570
 
562
571
  declare const ModalAction: React.FC<TypeModalActionProps>;
563
572
 
564
- export { Modal as M, type TypeModalProps as T, ModalDescription as a, ModalHeader as b, ModalFooter as c, ModalBody as d, ModalCloseWrapper as e, ModalRail as f, ModalAction as g, ModalCustomHeader as h, ModalCustomFooter as i, type TypeModalHeaderProps as j, type TypeModalFooterProps as k, type TypeModalBodyProps as l, type TypeModalDescriptionProps as m, type TypeModalRailProps as n, type TypeModalActionProps as o, type ModalCloseWrapperProps as p, useModalExternalTrigger as q, useModalTriggerProps as u };
573
+ /**
574
+ * Props for ModalExternalTrigger component.
575
+ */
576
+ interface ModalExternalTriggerProps extends Omit<TypeButtonProps, "onClick"> {
577
+ /** Callback when button is clicked to trigger modal open */
578
+ onTrigger: () => void;
579
+ /** Whether the modal is currently open (for ARIA expanded state) */
580
+ isOpen: boolean;
581
+ /** Optional modal ID for aria-controls attribute */
582
+ modalId?: string;
583
+ /** Optional onClick handler (called before onTrigger) */
584
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
585
+ }
586
+ /**
587
+ * A Button component pre-configured for triggering modals from outside the Modal component tree.
588
+ *
589
+ * ⚠️ **NOT RECOMMENDED** - Prefer using modalTrigger prop or ModalTrigger component.
590
+ * Use this component ONLY as a last resort when architectural constraints prevent keeping
591
+ * the trigger inside the Modal component tree.
592
+ *
593
+ * This component wraps the Seeds Button with automatic ARIA attributes for modal triggers.
594
+ * However, focus restoration still requires manual handling via onCloseAutoFocus callback
595
+ * due to Radix UI's architectural limitations with external triggers.
596
+ *
597
+ * **Why modalTrigger prop is better:**
598
+ * - Automatic ARIA attributes
599
+ * - Automatic focus restoration (no onCloseAutoFocus needed)
600
+ * - Better touch device support
601
+ * - Follows WAI-ARIA Dialog best practices
602
+ *
603
+ * **When to use ModalExternalTrigger:**
604
+ * - Trigger must live outside Modal component tree (e.g., in a page header)
605
+ * - Using Seeds Button as the trigger
606
+ * - Want automatic ARIA attributes without manual hook usage
607
+ *
608
+ * **Usage pattern with focus restoration:**
609
+ * You must still handle focus restoration manually by passing a ref and implementing
610
+ * onCloseAutoFocus on the Modal component.
611
+ *
612
+ * @example
613
+ * ```tsx
614
+ * const [isOpen, setIsOpen] = useState(false);
615
+ * const triggerRef = useRef<HTMLButtonElement>(null);
616
+ *
617
+ * return (
618
+ * <>
619
+ * <ModalExternalTrigger
620
+ * ref={triggerRef}
621
+ * isOpen={isOpen}
622
+ * onTrigger={() => setIsOpen(true)}
623
+ * appearance="primary"
624
+ * >
625
+ * Open Modal
626
+ * </ModalExternalTrigger>
627
+ *
628
+ * <Modal
629
+ * open={isOpen}
630
+ * onOpenChange={setIsOpen}
631
+ * onCloseAutoFocus={(e) => {
632
+ * e.preventDefault();
633
+ * triggerRef.current?.focus();
634
+ * }}
635
+ * >
636
+ * <ModalBody>Content</ModalBody>
637
+ * </Modal>
638
+ * </>
639
+ * );
640
+ * ```
641
+ *
642
+ * @see useModalExternalTrigger - Hook alternative for non-Button triggers
643
+ */
644
+ declare const ModalExternalTrigger: React.ForwardRefExoticComponent<Omit<ModalExternalTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
645
+
646
+ export { ModalAction as M, type TypeModalActionProps as T, ModalBody as a, ModalCloseWrapper as b, type ModalCloseWrapperProps as c, ModalCustomFooter as d, ModalCustomHeader as e, ModalDescription as f, ModalExternalTrigger as g, type ModalExternalTriggerProps as h, ModalFooter as i, ModalHeader as j, ModalRail as k, Modal as l, type TypeModalRailProps as m, type TypeModalBodyProps as n, type TypeModalDescriptionProps as o, type TypeModalFooterProps as p, type TypeModalHeaderProps as q, type TypeModalProps as r, useModalTriggerProps as s, useModalExternalTrigger as u };
@@ -486,15 +486,22 @@ var ModalCustomFooter = styled3(Box2)`
486
486
  `;
487
487
  ModalCustomFooter.displayName = "ModalCustomFooter";
488
488
  var ModalFooter = (props) => {
489
- const { cancelButton, primaryButton, leftAction, ...rest } = props;
489
+ const {
490
+ cancelButton,
491
+ primaryButton,
492
+ leftAction,
493
+ closeOnPrimaryAction = true,
494
+ ...rest
495
+ } = props;
490
496
  if (!cancelButton && !primaryButton && !leftAction) {
491
497
  return null;
492
498
  }
499
+ const wrappedPrimaryButton = primaryButton && closeOnPrimaryAction ? /* @__PURE__ */ jsx4(ModalCloseWrapper, { children: primaryButton }) : primaryButton;
493
500
  return /* @__PURE__ */ jsxs2(ModalCustomFooter, { "data-slot": "modal-footer", "data-qa-modal-footer": true, ...rest, children: [
494
501
  leftAction ? leftAction : null,
495
502
  /* @__PURE__ */ jsxs2(Box2, { display: "flex", gap: 300, marginLeft: "auto", children: [
496
503
  cancelButton && /* @__PURE__ */ jsx4(ModalCloseWrapper, { children: cancelButton }),
497
- primaryButton && /* @__PURE__ */ jsx4(ModalCloseWrapper, { children: primaryButton })
504
+ wrappedPrimaryButton
498
505
  ] })
499
506
  ] });
500
507
  };
@@ -607,7 +614,6 @@ import Icon from "@sproutsocial/seeds-react-icon";
607
614
 
608
615
  // ../seeds-react-mixins/dist/esm/index.js
609
616
  import { css } from "styled-components";
610
- import { theme } from "@sproutsocial/seeds-react-theme";
611
617
  var visuallyHidden = css`
612
618
  position: absolute;
613
619
  width: 1px;
@@ -619,11 +625,12 @@ var visuallyHidden = css`
619
625
  border: 0;
620
626
  `;
621
627
  var focusRing = css`
622
- box-shadow: 0 0 0 1px ${theme.colors.button.primary.background.base},
628
+ box-shadow: 0 0 0 1px
629
+ ${({ theme }) => theme.colors.button.primary.background.base},
623
630
  0 0px 0px 4px
624
631
  color-mix(
625
632
  in srgb,
626
- ${theme.colors.button.primary.background.base},
633
+ ${({ theme }) => theme.colors.button.primary.background.base},
627
634
  transparent 70%
628
635
  );
629
636
  outline: none;
@@ -633,15 +640,30 @@ var focusRing = css`
633
640
  }
634
641
  `;
635
642
  var pill = css`
636
- min-width: ${theme.space[600]};
637
- min-height: ${theme.space[600]};
638
- padding: ${theme.space[300]};
639
- border-radius: ${theme.radii.pill};
643
+ min-width: ${({ theme }) => theme.space[600]};
644
+ min-height: ${({ theme }) => theme.space[600]};
645
+ padding: ${({ theme }) => theme.space[300]};
646
+ border-radius: ${({ theme }) => theme.radii.pill};
640
647
  `;
641
648
  var disabled = css`
642
649
  opacity: 0.4;
643
650
  pointer-events: none;
644
651
  `;
652
+ var container = css`
653
+ background: ${({ theme }) => theme.colors.container.background.base};
654
+ border: ${({ theme }) => theme.borders[500]}
655
+ ${({ theme }) => theme.colors.container.border.base};
656
+ border-radius: ${({ theme }) => theme.radii.outer};
657
+ `;
658
+ var divider = css`
659
+ border-bottom: ${({ theme }) => theme.borderWidths[500]} solid
660
+ ${({ theme }) => theme.colors.container.border.base};
661
+ `;
662
+ var truncate = css`
663
+ text-overflow: ellipsis;
664
+ overflow: hidden;
665
+ white-space: nowrap;
666
+ `;
645
667
 
646
668
  // src/v2/components/ModalAction.tsx
647
669
  import { jsx as jsx8 } from "react/jsx-runtime";
@@ -964,4 +986,4 @@ export {
964
986
  useModalExternalTrigger,
965
987
  Modal_default
966
988
  };
967
- //# sourceMappingURL=chunk-HOGEFGDN.js.map
989
+ //# sourceMappingURL=chunk-62MRZAJV.js.map