@sproutsocial/seeds-react-modal 1.0.5 → 1.1.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/.turbo/turbo-build.log +15 -15
- package/CHANGELOG.md +13 -0
- package/dist/{ModalRail-OQ8DZ1vH.d.mts → ModalRail-5PeilhW7.d.mts} +12 -4
- package/dist/{ModalRail-OQ8DZ1vH.d.ts → ModalRail-5PeilhW7.d.ts} +12 -4
- package/dist/esm/{chunk-GKQRFPCX.js → chunk-4ITF4DBY.js} +107 -32
- package/dist/esm/chunk-4ITF4DBY.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/v2/index.js +5 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +105 -31
- package/dist/index.js.map +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.js +109 -33
- package/dist/v2/index.js.map +1 -1
- package/package.json +1 -1
- package/src/v2/ModalV2.stories.tsx +273 -2
- package/src/v2/ModalV2.tsx +113 -31
- package/src/v2/ModalV2Styles.tsx +39 -9
- package/src/v2/ModalV2Types.ts +0 -4
- package/src/v2/components/ModalHeader.tsx +10 -2
- package/src/v2/components/ModalRail.tsx +11 -9
- package/src/v2/index.ts +1 -1
- package/dist/esm/chunk-GKQRFPCX.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,34 +8,34 @@ $ tsup --dts
|
|
|
8
8
|
[34mCLI[39m Cleaning output folder
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m32.36 KB[39m
|
|
12
12
|
[32mCJS[39m [1mdist/v1/index.js [22m[32m9.86 KB[39m
|
|
13
|
-
[32mCJS[39m [1mdist/v2/index.js [22m[
|
|
14
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
13
|
+
[32mCJS[39m [1mdist/v2/index.js [22m[32m24.54 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m54.80 KB[39m
|
|
15
15
|
[32mCJS[39m [1mdist/v1/index.js.map [22m[32m13.03 KB[39m
|
|
16
|
-
[32mCJS[39m [1mdist/v2/index.js.map [22m[
|
|
17
|
-
[32mCJS[39m ⚡️ Build success in
|
|
16
|
+
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m41.40 KB[39m
|
|
17
|
+
[32mCJS[39m ⚡️ Build success in 279ms
|
|
18
18
|
[32mESM[39m [1mdist/esm/index.js [22m[32m567.00 B[39m
|
|
19
19
|
[32mESM[39m [1mdist/esm/v1/index.js [22m[32m165.00 B[39m
|
|
20
|
-
[32mESM[39m [1mdist/esm/v2/index.js [22m[
|
|
20
|
+
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m786.00 B[39m
|
|
21
21
|
[32mESM[39m [1mdist/esm/chunk-IYDY4OPB.js [22m[32m7.12 KB[39m
|
|
22
|
-
[32mESM[39m [1mdist/esm/chunk-
|
|
22
|
+
[32mESM[39m [1mdist/esm/chunk-4ITF4DBY.js [22m[32m20.28 KB[39m
|
|
23
23
|
[32mESM[39m [1mdist/esm/index.js.map [22m[32m963.00 B[39m
|
|
24
24
|
[32mESM[39m [1mdist/esm/v1/index.js.map [22m[32m71.00 B[39m
|
|
25
25
|
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m71.00 B[39m
|
|
26
26
|
[32mESM[39m [1mdist/esm/chunk-IYDY4OPB.js.map [22m[32m12.85 KB[39m
|
|
27
|
-
[32mESM[39m [1mdist/esm/chunk-
|
|
28
|
-
[32mESM[39m ⚡️ Build success in
|
|
27
|
+
[32mESM[39m [1mdist/esm/chunk-4ITF4DBY.js.map [22m[32m40.16 KB[39m
|
|
28
|
+
[32mESM[39m ⚡️ Build success in 280ms
|
|
29
29
|
[34mDTS[39m Build start
|
|
30
|
-
[32mDTS[39m ⚡️ Build success in
|
|
30
|
+
[32mDTS[39m ⚡️ Build success in 24663ms
|
|
31
31
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m973.00 B[39m
|
|
32
32
|
[32mDTS[39m [1mdist/v1/index.d.ts [22m[32m413.00 B[39m
|
|
33
|
-
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m1.
|
|
33
|
+
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m1.35 KB[39m
|
|
34
34
|
[32mDTS[39m [1mdist/Modal-ki8oiGbC.d.ts [22m[32m2.52 KB[39m
|
|
35
|
-
[32mDTS[39m [1mdist/ModalRail-
|
|
35
|
+
[32mDTS[39m [1mdist/ModalRail-5PeilhW7.d.ts [22m[32m7.61 KB[39m
|
|
36
36
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m976.00 B[39m
|
|
37
37
|
[32mDTS[39m [1mdist/v1/index.d.mts [22m[32m415.00 B[39m
|
|
38
|
-
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m1.
|
|
38
|
+
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m1.35 KB[39m
|
|
39
39
|
[32mDTS[39m [1mdist/Modal-ki8oiGbC.d.mts [22m[32m2.52 KB[39m
|
|
40
|
-
[32mDTS[39m [1mdist/ModalRail-
|
|
41
|
-
Done in
|
|
40
|
+
[32mDTS[39m [1mdist/ModalRail-5PeilhW7.d.mts [22m[32m7.61 KB[39m
|
|
41
|
+
Done in 27.92s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-modal
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9c64b99: Enhance modal v2 draggable functionality and interaction improvements
|
|
8
|
+
|
|
9
|
+
- **Draggable modal background interaction**: Modals can now interact with background elements when draggable mode is enabled
|
|
10
|
+
- **Improved drag constraints**: Drag context now properly limits dragging to the modal header only, preventing accidental dragging from other areas
|
|
11
|
+
- **Better user experience**: More intuitive drag behavior with proper boundary controls
|
|
12
|
+
- **Mobile friendly**: Modal rail now collapses on mobile devices
|
|
13
|
+
|
|
14
|
+
These improvements make draggable modals more user-friendly and provide better control over modal positioning and interaction.
|
|
15
|
+
|
|
3
16
|
## 1.0.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -35,8 +35,6 @@ interface TypeModalV2HeaderProps extends TypeBoxProps {
|
|
|
35
35
|
subtitle?: string;
|
|
36
36
|
/** Passing children will override the default modal header */
|
|
37
37
|
children?: React.ReactNode;
|
|
38
|
-
/** If you're rendering a custom header, you can use this prop to add a bottom border */
|
|
39
|
-
bordered?: boolean;
|
|
40
38
|
/** Additional props for the Dialog.Title when title is provided */
|
|
41
39
|
titleProps?: Omit<React.ComponentPropsWithoutRef<typeof Dialog.Title>, "asChild" | "children">;
|
|
42
40
|
/** Additional props for the Dialog.Description when subtitle is provided */
|
|
@@ -97,7 +95,6 @@ type TypeModalRailProps = {
|
|
|
97
95
|
offset?: number;
|
|
98
96
|
gap?: number;
|
|
99
97
|
size?: number;
|
|
100
|
-
collapseAt?: number;
|
|
101
98
|
children?: React.ReactNode;
|
|
102
99
|
};
|
|
103
100
|
type ModalActionBase = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
|
|
@@ -114,6 +111,17 @@ type TypeModalActionProps = (ModalActionBase & {
|
|
|
114
111
|
actionType?: "button";
|
|
115
112
|
});
|
|
116
113
|
|
|
114
|
+
interface DragContextValue {
|
|
115
|
+
position: {
|
|
116
|
+
x: number;
|
|
117
|
+
y: number;
|
|
118
|
+
};
|
|
119
|
+
isDragging: boolean;
|
|
120
|
+
onHeaderMouseDown: (e: React.MouseEvent) => void;
|
|
121
|
+
contentRef: React.RefObject<HTMLDivElement>;
|
|
122
|
+
draggable: boolean;
|
|
123
|
+
}
|
|
124
|
+
declare const useDragContext: () => DragContextValue | null;
|
|
117
125
|
/**
|
|
118
126
|
* The modal you want - with Radix UI Dialog
|
|
119
127
|
*
|
|
@@ -175,4 +183,4 @@ declare const ModalAction: React.FC<TypeModalActionProps & {
|
|
|
175
183
|
size?: number;
|
|
176
184
|
}>;
|
|
177
185
|
|
|
178
|
-
export { Modal as M, type TypeModalV2Props as T, ModalTrigger as a, ModalDescription as b, ModalHeader as c, ModalFooter as d, ModalContent as e, ModalCloseButton as f, ModalClose as g, ModalRail as h, ModalAction as i, type TypeModalV2TriggerProps as j, type TypeModalV2CloseButtonProps as k, type TypeModalV2HeaderProps as l, type TypeModalV2FooterProps as m, type TypeModalV2ContentProps as n, type TypeModalV2DescriptionProps as o, type TypeModalRailProps as p, type TypeModalActionProps as q };
|
|
186
|
+
export { Modal as M, type TypeModalV2Props as T, ModalTrigger as a, ModalDescription as b, ModalHeader as c, ModalFooter as d, ModalContent as e, ModalCloseButton as f, ModalClose as g, ModalRail as h, ModalAction as i, type TypeModalV2TriggerProps as j, type TypeModalV2CloseButtonProps as k, type TypeModalV2HeaderProps as l, type TypeModalV2FooterProps as m, type TypeModalV2ContentProps as n, type TypeModalV2DescriptionProps as o, type TypeModalRailProps as p, type TypeModalActionProps as q, useDragContext as u };
|
|
@@ -35,8 +35,6 @@ interface TypeModalV2HeaderProps extends TypeBoxProps {
|
|
|
35
35
|
subtitle?: string;
|
|
36
36
|
/** Passing children will override the default modal header */
|
|
37
37
|
children?: React.ReactNode;
|
|
38
|
-
/** If you're rendering a custom header, you can use this prop to add a bottom border */
|
|
39
|
-
bordered?: boolean;
|
|
40
38
|
/** Additional props for the Dialog.Title when title is provided */
|
|
41
39
|
titleProps?: Omit<React.ComponentPropsWithoutRef<typeof Dialog.Title>, "asChild" | "children">;
|
|
42
40
|
/** Additional props for the Dialog.Description when subtitle is provided */
|
|
@@ -97,7 +95,6 @@ type TypeModalRailProps = {
|
|
|
97
95
|
offset?: number;
|
|
98
96
|
gap?: number;
|
|
99
97
|
size?: number;
|
|
100
|
-
collapseAt?: number;
|
|
101
98
|
children?: React.ReactNode;
|
|
102
99
|
};
|
|
103
100
|
type ModalActionBase = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
|
|
@@ -114,6 +111,17 @@ type TypeModalActionProps = (ModalActionBase & {
|
|
|
114
111
|
actionType?: "button";
|
|
115
112
|
});
|
|
116
113
|
|
|
114
|
+
interface DragContextValue {
|
|
115
|
+
position: {
|
|
116
|
+
x: number;
|
|
117
|
+
y: number;
|
|
118
|
+
};
|
|
119
|
+
isDragging: boolean;
|
|
120
|
+
onHeaderMouseDown: (e: React.MouseEvent) => void;
|
|
121
|
+
contentRef: React.RefObject<HTMLDivElement>;
|
|
122
|
+
draggable: boolean;
|
|
123
|
+
}
|
|
124
|
+
declare const useDragContext: () => DragContextValue | null;
|
|
117
125
|
/**
|
|
118
126
|
* The modal you want - with Radix UI Dialog
|
|
119
127
|
*
|
|
@@ -175,4 +183,4 @@ declare const ModalAction: React.FC<TypeModalActionProps & {
|
|
|
175
183
|
size?: number;
|
|
176
184
|
}>;
|
|
177
185
|
|
|
178
|
-
export { Modal as M, type TypeModalV2Props as T, ModalTrigger as a, ModalDescription as b, ModalHeader as c, ModalFooter as d, ModalContent as e, ModalCloseButton as f, ModalClose as g, ModalRail as h, ModalAction as i, type TypeModalV2TriggerProps as j, type TypeModalV2CloseButtonProps as k, type TypeModalV2HeaderProps as l, type TypeModalV2FooterProps as m, type TypeModalV2ContentProps as n, type TypeModalV2DescriptionProps as o, type TypeModalRailProps as p, type TypeModalActionProps as q };
|
|
186
|
+
export { Modal as M, type TypeModalV2Props as T, ModalTrigger as a, ModalDescription as b, ModalHeader as c, ModalFooter as d, ModalContent as e, ModalCloseButton as f, ModalClose as g, ModalRail as h, ModalAction as i, type TypeModalV2TriggerProps as j, type TypeModalV2CloseButtonProps as k, type TypeModalV2HeaderProps as l, type TypeModalV2FooterProps as m, type TypeModalV2ContentProps as n, type TypeModalV2DescriptionProps as o, type TypeModalRailProps as p, type TypeModalActionProps as q, useDragContext as u };
|
|
@@ -42,6 +42,11 @@ var StyledOverlay = styled(Dialog.Overlay)`
|
|
|
42
42
|
${(props) => props.theme.easing.ease_inout};
|
|
43
43
|
z-index: ${(props) => props.zIndex ? props.zIndex + DEFAULT_OVERLAY_Z_INDEX_OFFSET : 999};
|
|
44
44
|
|
|
45
|
+
/* Allow clicking through overlay when modal is draggable */
|
|
46
|
+
${(props) => props.allowInteraction && `
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
`}
|
|
49
|
+
|
|
45
50
|
${zIndex}
|
|
46
51
|
|
|
47
52
|
&[data-state="open"] {
|
|
@@ -69,15 +74,19 @@ var StyledContent = styled(Dialog.Content)`
|
|
|
69
74
|
filter: blur(0);
|
|
70
75
|
color: ${(props) => props.theme.colors.text.body};
|
|
71
76
|
outline: none;
|
|
72
|
-
max-width:
|
|
77
|
+
max-width: ${(props) => {
|
|
78
|
+
const railSize = props.railSize ?? 44;
|
|
79
|
+
const railOffset = props.railOffset ?? 12;
|
|
80
|
+
const railExtraSpace = railSize + railOffset;
|
|
81
|
+
return `calc(100vw - ${BODY_PADDING} - ${railExtraSpace}px)`;
|
|
82
|
+
}};
|
|
73
83
|
max-height: calc(100vh - ${BODY_PADDING});
|
|
74
84
|
z-index: ${(props) => props.zIndex || 1e3};
|
|
75
85
|
|
|
76
|
-
/*
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
`}
|
|
86
|
+
/* When viewport is <= 400px, rail is above modal, so restore full width */
|
|
87
|
+
@media (max-width: 400px) {
|
|
88
|
+
max-width: calc(100vw - ${BODY_PADDING});
|
|
89
|
+
}
|
|
81
90
|
|
|
82
91
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
83
92
|
height: calc(100vh - ${BODY_PADDING});
|
|
@@ -124,6 +133,12 @@ var Header = styled(Box)`
|
|
|
124
133
|
align-items: center;
|
|
125
134
|
justify-content: space-between;
|
|
126
135
|
flex: 0 0 auto;
|
|
136
|
+
|
|
137
|
+
/* Draggable cursor styling */
|
|
138
|
+
${(props) => props.draggable && `
|
|
139
|
+
cursor: ${props.isDragging ? "grabbing" : "grab"};
|
|
140
|
+
user-select: none;
|
|
141
|
+
`}
|
|
127
142
|
`;
|
|
128
143
|
var Footer = styled(Box)`
|
|
129
144
|
flex: 0 0 auto;
|
|
@@ -238,19 +253,29 @@ var ModalHeader = (props) => {
|
|
|
238
253
|
title,
|
|
239
254
|
subtitle,
|
|
240
255
|
children,
|
|
241
|
-
bordered,
|
|
242
256
|
titleProps = {},
|
|
243
257
|
subtitleProps = {},
|
|
244
258
|
showInlineClose,
|
|
245
259
|
...rest
|
|
246
260
|
} = props;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
const dragContext = useDragContext();
|
|
262
|
+
const isDraggable = dragContext?.draggable ?? false;
|
|
263
|
+
return /* @__PURE__ */ jsx2(
|
|
264
|
+
Header,
|
|
265
|
+
{
|
|
266
|
+
...rest,
|
|
267
|
+
onMouseDown: isDraggable ? dragContext?.onHeaderMouseDown : void 0,
|
|
268
|
+
draggable: isDraggable,
|
|
269
|
+
isDragging: dragContext?.isDragging,
|
|
270
|
+
children: children ? children : /* @__PURE__ */ jsxs(React3.Fragment, { children: [
|
|
271
|
+
/* @__PURE__ */ jsxs(Box2, { children: [
|
|
272
|
+
title && /* @__PURE__ */ jsx2(Dialog3.Title, { asChild: true, ...titleProps, children: /* @__PURE__ */ jsx2(Text.Headline, { children: title }) }),
|
|
273
|
+
subtitle && /* @__PURE__ */ jsx2(Dialog3.Description, { asChild: true, ...subtitleProps, children: /* @__PURE__ */ jsx2(Text, { as: "div", fontSize: 200, children: subtitle }) })
|
|
274
|
+
] }),
|
|
275
|
+
showInlineClose && /* @__PURE__ */ jsx2(Box2, { display: "flex", alignItems: "center", justifyContent: "flex-end", children: /* @__PURE__ */ jsx2(ModalCloseButton, { position: "relative", offset: 0 }) })
|
|
276
|
+
] })
|
|
277
|
+
}
|
|
278
|
+
);
|
|
254
279
|
};
|
|
255
280
|
ModalHeader.displayName = "ModalHeader";
|
|
256
281
|
|
|
@@ -333,13 +358,19 @@ var Rail = styled3.div`
|
|
|
333
358
|
position: absolute;
|
|
334
359
|
top: ${(p) => p.offset}px;
|
|
335
360
|
${(p) => p.side === "right" ? `right: calc(-1 * (${p.size}px + ${p.offset}px));` : `left: calc(-1 * (${p.size}px + ${p.offset}px));`}
|
|
336
|
-
display:
|
|
337
|
-
|
|
361
|
+
display: flex;
|
|
362
|
+
flex-direction: column;
|
|
338
363
|
gap: ${(p) => p.gap}px;
|
|
339
364
|
z-index: 1;
|
|
340
365
|
|
|
341
|
-
@media (max-width:
|
|
342
|
-
|
|
366
|
+
@media (max-width: 400px) {
|
|
367
|
+
/* Move rail above the modal on the right side */
|
|
368
|
+
top: auto;
|
|
369
|
+
bottom: calc(100% + ${(p) => p.offset}px);
|
|
370
|
+
right: ${(p) => p.offset}px;
|
|
371
|
+
left: auto;
|
|
372
|
+
/* Change to horizontal layout with reversed order */
|
|
373
|
+
flex-direction: row-reverse;
|
|
343
374
|
}
|
|
344
375
|
`;
|
|
345
376
|
var RailBtn = styled3.button`
|
|
@@ -378,7 +409,6 @@ var ModalRail = ({
|
|
|
378
409
|
offset = 12,
|
|
379
410
|
gap = 12,
|
|
380
411
|
size = 44,
|
|
381
|
-
collapseAt = 640,
|
|
382
412
|
children
|
|
383
413
|
}) => {
|
|
384
414
|
return /* @__PURE__ */ jsx8(
|
|
@@ -389,7 +419,6 @@ var ModalRail = ({
|
|
|
389
419
|
offset,
|
|
390
420
|
gap,
|
|
391
421
|
size,
|
|
392
|
-
collapseAt,
|
|
393
422
|
"aria-label": "Modal quick actions",
|
|
394
423
|
children: React9.Children.map(
|
|
395
424
|
children,
|
|
@@ -423,6 +452,11 @@ var ModalAction = ({
|
|
|
423
452
|
|
|
424
453
|
// src/v2/ModalV2.tsx
|
|
425
454
|
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
455
|
+
var DragContext = React10.createContext(null);
|
|
456
|
+
var useDragContext = () => {
|
|
457
|
+
const context = React10.useContext(DragContext);
|
|
458
|
+
return context;
|
|
459
|
+
};
|
|
426
460
|
var DraggableModalContent = ({
|
|
427
461
|
children,
|
|
428
462
|
computedWidth,
|
|
@@ -431,12 +465,17 @@ var DraggableModalContent = ({
|
|
|
431
465
|
label,
|
|
432
466
|
dataAttributes,
|
|
433
467
|
draggable,
|
|
434
|
-
rest
|
|
468
|
+
rest,
|
|
469
|
+
railProps
|
|
435
470
|
}) => {
|
|
436
471
|
const [position, setPosition] = React10.useState({ x: 0, y: 0 });
|
|
437
472
|
const [isDragging, setIsDragging] = React10.useState(false);
|
|
438
473
|
const contentRef = React10.useRef(null);
|
|
439
|
-
const
|
|
474
|
+
const railSize = railProps?.size ?? 44;
|
|
475
|
+
const railOffset = railProps?.offset ?? 12;
|
|
476
|
+
const railSide = railProps?.side ?? "right";
|
|
477
|
+
const railExtraSpace = railSize + railOffset;
|
|
478
|
+
const handleHeaderMouseDown = React10.useCallback(
|
|
440
479
|
(e) => {
|
|
441
480
|
if (!draggable) return;
|
|
442
481
|
const target = e.target;
|
|
@@ -453,12 +492,22 @@ var DraggableModalContent = ({
|
|
|
453
492
|
e2.preventDefault();
|
|
454
493
|
const newX = e2.clientX - offsetX;
|
|
455
494
|
const newY = e2.clientY - offsetY;
|
|
495
|
+
const isRailOnSide = window.innerWidth > 400;
|
|
456
496
|
const modalWidth = rect.width;
|
|
457
497
|
const modalHeight = rect.height;
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
498
|
+
let maxX = window.innerWidth - modalWidth;
|
|
499
|
+
let minX = 0;
|
|
500
|
+
let maxY = window.innerHeight - modalHeight;
|
|
501
|
+
let minY = 0;
|
|
502
|
+
if (isRailOnSide) {
|
|
503
|
+
if (railSide === "right") {
|
|
504
|
+
maxX = window.innerWidth - modalWidth - railExtraSpace;
|
|
505
|
+
} else {
|
|
506
|
+
minX = railExtraSpace;
|
|
507
|
+
}
|
|
508
|
+
} else {
|
|
509
|
+
minY = railSize + railOffset;
|
|
510
|
+
}
|
|
462
511
|
const constrainedX = Math.max(minX, Math.min(maxX, newX));
|
|
463
512
|
const constrainedY = Math.max(minY, Math.min(maxY, newY));
|
|
464
513
|
const centerX = window.innerWidth / 2 - modalWidth / 2;
|
|
@@ -476,9 +525,27 @@ var DraggableModalContent = ({
|
|
|
476
525
|
document.addEventListener("mousemove", handleMouseMove);
|
|
477
526
|
document.addEventListener("mouseup", handleMouseUp);
|
|
478
527
|
},
|
|
528
|
+
[draggable, railSide, railExtraSpace]
|
|
529
|
+
);
|
|
530
|
+
const dragContextValue = React10.useMemo(
|
|
531
|
+
() => ({
|
|
532
|
+
position,
|
|
533
|
+
isDragging,
|
|
534
|
+
onHeaderMouseDown: handleHeaderMouseDown,
|
|
535
|
+
contentRef,
|
|
536
|
+
draggable: draggable ?? false
|
|
537
|
+
}),
|
|
538
|
+
[position, isDragging, handleHeaderMouseDown, draggable]
|
|
539
|
+
);
|
|
540
|
+
const handleInteractOutside = React10.useCallback(
|
|
541
|
+
(e) => {
|
|
542
|
+
if (draggable) {
|
|
543
|
+
e.preventDefault();
|
|
544
|
+
}
|
|
545
|
+
},
|
|
479
546
|
[draggable]
|
|
480
547
|
);
|
|
481
|
-
return /* @__PURE__ */ jsx9(
|
|
548
|
+
return /* @__PURE__ */ jsx9(DragContext.Provider, { value: draggable ? dragContextValue : null, children: /* @__PURE__ */ jsx9(
|
|
482
549
|
StyledContent,
|
|
483
550
|
{
|
|
484
551
|
ref: contentRef,
|
|
@@ -488,7 +555,10 @@ var DraggableModalContent = ({
|
|
|
488
555
|
"aria-label": label,
|
|
489
556
|
draggable,
|
|
490
557
|
isDragging,
|
|
491
|
-
|
|
558
|
+
railSize,
|
|
559
|
+
railOffset,
|
|
560
|
+
railSide,
|
|
561
|
+
onInteractOutside: handleInteractOutside,
|
|
492
562
|
style: draggable ? {
|
|
493
563
|
transform: `translate(calc(-50% + ${position.x}px), calc(-50% + ${position.y}px))`,
|
|
494
564
|
transition: isDragging ? "none" : void 0
|
|
@@ -497,7 +567,7 @@ var DraggableModalContent = ({
|
|
|
497
567
|
...rest,
|
|
498
568
|
children
|
|
499
569
|
}
|
|
500
|
-
);
|
|
570
|
+
) });
|
|
501
571
|
};
|
|
502
572
|
var Modal = (props) => {
|
|
503
573
|
const {
|
|
@@ -565,8 +635,11 @@ var Modal = (props) => {
|
|
|
565
635
|
if (onOpenChange) {
|
|
566
636
|
props2.onOpenChange = handleOpenChange;
|
|
567
637
|
}
|
|
638
|
+
if (draggable) {
|
|
639
|
+
props2.modal = false;
|
|
640
|
+
}
|
|
568
641
|
return props2;
|
|
569
|
-
}, [open, defaultOpen, handleOpenChange, onOpenChange]);
|
|
642
|
+
}, [open, defaultOpen, handleOpenChange, onOpenChange, draggable]);
|
|
570
643
|
const triggers = [];
|
|
571
644
|
const content = [];
|
|
572
645
|
if (modalTrigger) {
|
|
@@ -586,7 +659,7 @@ var Modal = (props) => {
|
|
|
586
659
|
return /* @__PURE__ */ jsxs2(Dialog8.Root, { ...dialogRootProps, children: [
|
|
587
660
|
triggers,
|
|
588
661
|
/* @__PURE__ */ jsxs2(Dialog8.Portal, { children: [
|
|
589
|
-
showOverlay && /* @__PURE__ */ jsx9(StyledOverlay, { zIndex: computedZIndex }),
|
|
662
|
+
showOverlay && /* @__PURE__ */ jsx9(StyledOverlay, { zIndex: computedZIndex, allowInteraction: draggable }),
|
|
590
663
|
/* @__PURE__ */ jsxs2(
|
|
591
664
|
DraggableModalContent,
|
|
592
665
|
{
|
|
@@ -597,6 +670,7 @@ var Modal = (props) => {
|
|
|
597
670
|
dataAttributes,
|
|
598
671
|
draggable,
|
|
599
672
|
rest,
|
|
673
|
+
railProps,
|
|
600
674
|
children: [
|
|
601
675
|
/* @__PURE__ */ jsxs2(ModalRail, { ...railProps, children: [
|
|
602
676
|
/* @__PURE__ */ jsx9(
|
|
@@ -637,6 +711,7 @@ export {
|
|
|
637
711
|
ModalClose,
|
|
638
712
|
ModalRail,
|
|
639
713
|
ModalAction,
|
|
714
|
+
useDragContext,
|
|
640
715
|
ModalV2_default
|
|
641
716
|
};
|
|
642
|
-
//# sourceMappingURL=chunk-
|
|
717
|
+
//# sourceMappingURL=chunk-4ITF4DBY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/v2/ModalV2.tsx","../../src/v2/ModalV2Styles.tsx","../../src/shared/constants.ts","../../src/v2/components/ModalHeader.tsx","../../src/v2/components/ModalCloseButton.tsx","../../src/v2/components/ModalFooter.tsx","../../src/v2/components/ModalContent.tsx","../../src/v2/components/ModalDescription.tsx","../../src/v2/components/ModalTrigger.tsx","../../src/v2/components/ModalClose.tsx","../../src/v2/components/ModalRail.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { StyledOverlay, StyledContent } from \"./ModalV2Styles\";\nimport {\n ModalHeader,\n ModalDescription,\n ModalTrigger,\n ModalRail,\n ModalAction,\n} from \"./components\";\nimport {\n DEFAULT_MODAL_WIDTH,\n DEFAULT_MODAL_BG,\n DEFAULT_MODAL_Z_INDEX,\n MODAL_SIZE_PRESETS,\n MODAL_PRIORITY_Z_INDEX,\n} from \"../shared/constants\";\nimport type { TypeModalV2Props } from \"./ModalV2Types\";\n\ninterface DraggableModalContentProps {\n children: React.ReactNode;\n computedWidth: any;\n bg: any;\n computedZIndex: number;\n label?: string;\n dataAttributes: Record<string, string>;\n draggable?: boolean;\n rest: any;\n railProps?: Partial<TypeModalV2Props[\"railProps\"]>;\n}\n\n// Context to share drag state between modal content and header\ninterface DragContextValue {\n position: { x: number; y: number };\n isDragging: boolean;\n onHeaderMouseDown: (e: React.MouseEvent) => void;\n contentRef: React.RefObject<HTMLDivElement>;\n draggable: boolean;\n}\n\nconst DragContext = React.createContext<DragContextValue | null>(null);\n\nexport const useDragContext = () => {\n const context = React.useContext(DragContext);\n return context;\n};\n\nconst DraggableModalContent: React.FC<DraggableModalContentProps> = ({\n children,\n computedWidth,\n bg,\n computedZIndex,\n label,\n dataAttributes,\n draggable,\n rest,\n railProps,\n}) => {\n const [position, setPosition] = React.useState({ x: 0, y: 0 });\n const [isDragging, setIsDragging] = React.useState(false);\n const contentRef = React.useRef<HTMLDivElement>(null);\n\n // Calculate rail dimensions for boundary constraints\n const railSize = railProps?.size ?? 44;\n const railOffset = railProps?.offset ?? 12;\n const railSide = railProps?.side ?? \"right\";\n\n // Total extra space needed on the side with the rail\n // (only when viewport is wider than 400px breakpoint)\n const railExtraSpace = railSize + railOffset;\n\n const handleHeaderMouseDown = React.useCallback(\n (e: React.MouseEvent) => {\n if (!draggable) return;\n\n // Only allow dragging from header (not interactive elements)\n const target = e.target as HTMLElement;\n if (\n target.tagName === \"BUTTON\" ||\n target.tagName === \"INPUT\" ||\n target.closest(\"button\")\n ) {\n return;\n }\n\n e.preventDefault();\n setIsDragging(true);\n\n const rect = contentRef.current?.getBoundingClientRect();\n if (!rect) return;\n\n // Calculate offset from mouse to current modal position\n const offsetX = e.clientX - rect.left;\n const offsetY = e.clientY - rect.top;\n\n const handleMouseMove = (e: MouseEvent) => {\n e.preventDefault();\n\n // Calculate new position based on mouse position minus offset\n const newX = e.clientX - offsetX;\n const newY = e.clientY - offsetY;\n\n // Determine if rail is on the side (viewport > 400px) or above (viewport <= 400px)\n const isRailOnSide = window.innerWidth > 400;\n\n // Constrain to viewport bounds (keeping modal AND rail fully visible)\n const modalWidth = rect.width;\n const modalHeight = rect.height;\n\n // Adjust boundaries to account for rail position\n let maxX = window.innerWidth - modalWidth;\n let minX = 0;\n let maxY = window.innerHeight - modalHeight;\n let minY = 0;\n\n if (isRailOnSide) {\n // Rail is positioned on the side of the modal\n if (railSide === \"right\") {\n // Rail is on the right, so reduce maxX to prevent rail from going off-screen\n maxX = window.innerWidth - modalWidth - railExtraSpace;\n } else {\n // Rail is on the left, so increase minX to prevent rail from going off-screen\n minX = railExtraSpace;\n }\n } else {\n // Rail is positioned above the modal (viewport <= 400px)\n // Account for rail height + offset at the top\n minY = railSize + railOffset;\n }\n\n const constrainedX = Math.max(minX, Math.min(maxX, newX));\n const constrainedY = Math.max(minY, Math.min(maxY, newY));\n\n // Convert to offset from center for our transform\n const centerX = window.innerWidth / 2 - modalWidth / 2;\n const centerY = window.innerHeight / 2 - modalHeight / 2;\n\n setPosition({\n x: constrainedX - centerX,\n y: constrainedY - centerY,\n });\n };\n\n const handleMouseUp = () => {\n setIsDragging(false);\n document.removeEventListener(\"mousemove\", handleMouseMove);\n document.removeEventListener(\"mouseup\", handleMouseUp);\n };\n\n document.addEventListener(\"mousemove\", handleMouseMove);\n document.addEventListener(\"mouseup\", handleMouseUp);\n },\n [draggable, railSide, railExtraSpace]\n );\n\n const dragContextValue = React.useMemo<DragContextValue>(\n () => ({\n position,\n isDragging,\n onHeaderMouseDown: handleHeaderMouseDown,\n contentRef,\n draggable: draggable ?? false,\n }),\n [position, isDragging, handleHeaderMouseDown, draggable]\n );\n\n // Prevent modal from closing on outside interaction when draggable\n const handleInteractOutside = React.useCallback(\n (e: Event) => {\n if (draggable) {\n e.preventDefault();\n }\n },\n [draggable]\n );\n\n return (\n <DragContext.Provider value={draggable ? dragContextValue : null}>\n <StyledContent\n ref={contentRef}\n width={computedWidth}\n bg={bg}\n zIndex={computedZIndex}\n aria-label={label}\n draggable={draggable}\n isDragging={isDragging}\n railSize={railSize}\n railOffset={railOffset}\n railSide={railSide}\n onInteractOutside={handleInteractOutside}\n style={\n draggable\n ? {\n transform: `translate(calc(-50% + ${position.x}px), calc(-50% + ${position.y}px))`,\n transition: isDragging ? \"none\" : undefined,\n }\n : undefined\n }\n {...dataAttributes}\n {...rest}\n >\n {children}\n </StyledContent>\n </DragContext.Provider>\n );\n};\n\n/**\n * The modal you want - with Radix UI Dialog\n *\n * Features:\n * - Built with Radix UI Dialog for superior accessibility\n * - Same API as the original Modal component\n * - Automatic focus management and keyboard navigation\n * - Portal rendering for proper z-index layering\n * - Customizable styling through system props\n * - Optional draggable functionality using react-dnd\n */\nconst Modal = (props: TypeModalV2Props) => {\n const {\n children,\n modalTrigger,\n draggable = false,\n open,\n defaultOpen,\n onOpenChange,\n \"aria-label\": label,\n title,\n subtitle,\n description,\n size,\n priority,\n data = {},\n bg = DEFAULT_MODAL_BG,\n showOverlay = true,\n actions,\n railProps,\n ...rest\n } = props;\n\n const handleOpenChange = React.useCallback(\n (newOpen: boolean) => {\n onOpenChange?.(newOpen);\n },\n [onOpenChange]\n );\n\n // Compute actual width\n const computedWidth = React.useMemo(() => {\n if (size) {\n // Handle preset sizes\n if (typeof size === \"string\" && size in MODAL_SIZE_PRESETS) {\n return MODAL_SIZE_PRESETS[size as keyof typeof MODAL_SIZE_PRESETS];\n }\n // Handle custom size values\n return size;\n }\n // Fall back to default width\n return DEFAULT_MODAL_WIDTH;\n }, [size]);\n\n // Compute actual z-index\n const computedZIndex = React.useMemo(() => {\n if (priority) {\n return MODAL_PRIORITY_Z_INDEX[priority];\n }\n return DEFAULT_MODAL_Z_INDEX;\n }, [priority]);\n\n // Create data attributes object\n const dataAttributes = React.useMemo(() => {\n const attrs: Record<string, string> = {};\n Object.entries(data).forEach(([key, value]) => {\n attrs[`data-${key}`] = String(value);\n });\n attrs[\"data-qa-modal\"] = \"\";\n // Only add open attribute if in controlled mode\n if (open !== undefined) {\n attrs[\"data-qa-modal-open\"] = String(open);\n }\n return attrs;\n }, [data, open]);\n\n // Determine if we should auto-render the header from provided props\n const shouldRenderHeader = Boolean(title || subtitle);\n\n // Build Dialog.Root props conditionally\n const dialogRootProps = React.useMemo(() => {\n const props: any = {};\n\n // If controlled (open prop provided), use it\n if (open !== undefined) {\n props.open = open;\n }\n // If uncontrolled with explicit defaultOpen, use it\n else if (defaultOpen !== undefined) {\n props.defaultOpen = defaultOpen;\n }\n // If completely uncontrolled (neither open nor defaultOpen provided), default to closed\n else {\n props.defaultOpen = false;\n }\n\n // Always add onOpenChange if provided\n if (onOpenChange) {\n props.onOpenChange = handleOpenChange;\n }\n\n // When draggable, prevent modal from closing on outside interaction\n // This allows users to interact with background content\n if (draggable) {\n props.modal = false;\n }\n\n return props;\n }, [open, defaultOpen, handleOpenChange, onOpenChange, draggable]);\n\n // Handle trigger - use modalTrigger prop if provided, otherwise look for ModalTrigger children (backward compatibility)\n const triggers: React.ReactNode[] = [];\n const content: React.ReactNode[] = [];\n\n if (modalTrigger) {\n // New prop-based approach: wrap the provided element with Dialog.Trigger\n triggers.push(\n <Dialog.Trigger key=\"modal-trigger\" asChild>\n {modalTrigger}\n </Dialog.Trigger>\n );\n // All children are content\n content.push(children);\n } else {\n // Legacy approach: separate ModalTrigger children from content children\n React.Children.forEach(children, (child) => {\n if (React.isValidElement(child) && child.type === ModalTrigger) {\n triggers.push(child);\n } else {\n content.push(child);\n }\n });\n }\n\n return (\n <Dialog.Root {...dialogRootProps}>\n {/* Render triggers as direct children of Dialog.Root */}\n {triggers}\n\n <Dialog.Portal>\n {showOverlay && (\n <StyledOverlay zIndex={computedZIndex} allowInteraction={draggable} />\n )}\n <DraggableModalContent\n computedWidth={computedWidth}\n bg={bg}\n computedZIndex={computedZIndex}\n label={label}\n dataAttributes={dataAttributes}\n draggable={draggable}\n rest={rest}\n railProps={railProps}\n >\n {/* Floating actions rail - always show a close by default */}\n <ModalRail {...railProps}>\n <ModalAction\n actionType=\"close\"\n aria-label=\"Close\"\n iconName=\"x-outline\"\n />\n {actions?.map((action, idx) => (\n <ModalAction key={idx} {...action} />\n ))}\n </ModalRail>\n {/* Auto-render header when title or subtitle is provided */}\n {shouldRenderHeader && (\n <ModalHeader title={title} subtitle={subtitle} />\n )}\n\n {/* Auto-render description when provided */}\n {description && <ModalDescription>{description}</ModalDescription>}\n\n {/* Main content (everything except triggers) */}\n {content}\n </DraggableModalContent>\n </Dialog.Portal>\n </Dialog.Root>\n );\n};\n\nexport default Modal;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { width, zIndex } from \"styled-system\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport Box, { type TypeContainerProps } from \"@sproutsocial/seeds-react-box\";\nimport {\n BODY_PADDING,\n DEFAULT_OVERLAY_Z_INDEX_OFFSET,\n} from \"../shared/constants\";\n\ninterface StyledOverlayProps extends TypeContainerProps {\n zIndex?: number;\n allowInteraction?: boolean;\n}\n\nexport const StyledOverlay = styled(Dialog.Overlay)<StyledOverlayProps>`\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: ${(props) => props.theme.colors.overlay.background.base};\n opacity: 0;\n will-change: opacity;\n transition: opacity ${(props) => props.theme.duration.medium}\n ${(props) => props.theme.easing.ease_inout};\n z-index: ${(props) =>\n props.zIndex ? props.zIndex + DEFAULT_OVERLAY_Z_INDEX_OFFSET : 999};\n\n /* Allow clicking through overlay when modal is draggable */\n ${(props) =>\n props.allowInteraction &&\n `\n pointer-events: none;\n `}\n\n ${zIndex}\n\n &[data-state=\"open\"] {\n opacity: 1;\n }\n &[data-state=\"closed\"] {\n opacity: 0;\n }\n`;\n\ninterface StyledContentProps extends TypeContainerProps {\n zIndex?: number;\n isDragging?: boolean;\n draggable?: boolean;\n railSize?: number;\n railOffset?: number;\n railSide?: \"right\" | \"left\";\n}\n\nexport const StyledContent = styled(Dialog.Content)<StyledContentProps>`\n position: fixed;\n ${(props) =>\n props.draggable\n ? `\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n `\n : `\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n `}\n display: flex;\n flex-direction: column;\n border-radius: ${(props) => props.theme.radii[600]};\n box-shadow: ${(props) => props.theme.shadows.medium};\n filter: blur(0);\n color: ${(props) => props.theme.colors.text.body};\n outline: none;\n max-width: ${(props) => {\n // Calculate extra space needed for the rail when it's on the side (viewport > 400px)\n const railSize = props.railSize ?? 44;\n const railOffset = props.railOffset ?? 12;\n const railExtraSpace = railSize + railOffset;\n\n // Account for rail space when positioned on the side\n // At viewport <= 400px, rail is above modal, so no horizontal space needed\n return `calc(100vw - ${BODY_PADDING} - ${railExtraSpace}px)`;\n }};\n max-height: calc(100vh - ${BODY_PADDING});\n z-index: ${(props) => props.zIndex || 1000};\n\n /* When viewport is <= 400px, rail is above modal, so restore full width */\n @media (max-width: 400px) {\n max-width: calc(100vw - ${BODY_PADDING});\n }\n\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n height: calc(100vh - ${BODY_PADDING});\n }\n\n ${width}\n ${COMMON}\n\n /* Enhanced Radix Dialog animations */\n opacity: 0;\n ${(props) =>\n !props.draggable\n ? `\n transform: translate(-50%, -50%) scale(0.95);\n transition: opacity ${props.theme.duration.medium} ${props.theme.easing.ease_inout},\n transform ${props.theme.duration.medium} ${props.theme.easing.ease_inout};\n `\n : `\n transition: opacity ${props.theme.duration.medium} ${props.theme.easing.ease_inout};\n `}\n\n &[data-state=\"open\"] {\n opacity: 1;\n ${(props) =>\n !props.draggable ? `transform: translate(-50%, -50%) scale(1);` : ``}\n }\n &[data-state=\"closed\"] {\n opacity: 0;\n ${(props) =>\n !props.draggable ? `transform: translate(-50%, -50%) scale(0.95);` : ``}\n }\n`;\n\nexport const Content = styled(Box)`\n font-family: ${(props) => props.theme.fontFamily};\n min-height: 80px;\n overflow-y: auto;\n flex: 1 1 auto;\n padding: 0 ${(props) => props.theme.space[300]}\n ${(props) => props.theme.space[300]} ${(props) => props.theme.space[300]};\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n flex-basis: 100%;\n }\n`;\n\ninterface HeaderProps {\n draggable?: boolean;\n isDragging?: boolean;\n}\n\nexport const Header = styled(Box)<HeaderProps>`\n font-family: ${(props) => props.theme.fontFamily};\n padding: ${(props) => props.theme.space[400]}\n ${(props) => props.theme.space[300]};\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex: 0 0 auto;\n\n /* Draggable cursor styling */\n ${(props) =>\n props.draggable &&\n `\n cursor: ${props.isDragging ? \"grabbing\" : \"grab\"};\n user-select: none;\n `}\n`;\n\nexport const Footer = styled(Box)`\n flex: 0 0 auto;\n font-family: ${(props) => props.theme.fontFamily};\n padding: ${(props) => props.theme.space[400]}\n ${(props) => props.theme.space[300]};\n border-bottom-right-radius: ${(props) => props.theme.radii[500]};\n border-bottom-left-radius: ${(props) => props.theme.radii[500]};\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: ${(props) => props.theme.space[100]};\n`;\n\nStyledOverlay.displayName = \"ModalOverlay\";\nStyledContent.displayName = \"ModalContent\";\nContent.displayName = \"ModalContent\";\nHeader.displayName = \"ModalHeader\";\nFooter.displayName = \"ModalFooter\";\n","// Shared constants for both Modal versions\n\n// Default z-index values\nexport const DEFAULT_MODAL_Z_INDEX = 6;\nexport const DEFAULT_OVERLAY_Z_INDEX_OFFSET = -1;\n\n// Default styling values\nexport const DEFAULT_MODAL_WIDTH = \"600px\";\nexport const DEFAULT_MODAL_BG = \"container.background.base\";\nexport const DEFAULT_CLOSE_BUTTON_LABEL = \"Close dialog\";\n\n// Max space allowed between the modal and the edge of the browser\nexport const BODY_PADDING = \"64px\";\n\n// Size presets for simplified API\nexport const MODAL_SIZE_PRESETS = {\n small: \"400px\",\n medium: \"600px\",\n large: \"800px\",\n full: \"90vw\",\n} as const;\n\n// Priority level z-index mappings\nexport const MODAL_PRIORITY_Z_INDEX = {\n low: 100,\n medium: 1000,\n high: 2000,\n} as const;\n","import * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport Text from \"@sproutsocial/seeds-react-text\";\nimport { Header } from \"../ModalV2Styles\";\nimport { ModalCloseButton } from \"./ModalCloseButton\";\nimport type { TypeModalV2HeaderProps } from \"../ModalV2Types\";\nimport { useDragContext } from \"../ModalV2\";\n\nexport const ModalHeader = (props: TypeModalV2HeaderProps) => {\n const {\n title,\n subtitle,\n children,\n titleProps = {},\n subtitleProps = {},\n showInlineClose,\n ...rest\n } = props;\n\n const dragContext = useDragContext();\n const isDraggable = dragContext?.draggable ?? false;\n\n return (\n <Header\n {...rest}\n onMouseDown={isDraggable ? dragContext?.onHeaderMouseDown : undefined}\n draggable={isDraggable}\n isDragging={dragContext?.isDragging}\n >\n {children ? (\n children\n ) : (\n <React.Fragment>\n <Box>\n {title && (\n <Dialog.Title asChild {...titleProps}>\n <Text.Headline>{title}</Text.Headline>\n </Dialog.Title>\n )}\n {subtitle && (\n <Dialog.Description asChild {...subtitleProps}>\n <Text as=\"div\" fontSize={200}>\n {subtitle}\n </Text>\n </Dialog.Description>\n )}\n </Box>\n {showInlineClose && (\n <Box display=\"flex\" alignItems=\"center\" justifyContent=\"flex-end\">\n <ModalCloseButton position=\"relative\" offset={0} />\n </Box>\n )}\n </React.Fragment>\n )}\n </Header>\n );\n};\n\nModalHeader.displayName = \"ModalHeader\";\n","import * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport styled from \"styled-components\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\nimport type { TypeModalV2CloseButtonProps } from \"../ModalV2Types\";\n\nconst CloseButtonWrapper = styled.button<{\n size?: number;\n position?: \"absolute\" | \"relative\";\n side?: \"right\" | \"left\";\n offset?: number;\n}>`\n width: ${(p) => p.size || 44}px;\n height: ${(p) => p.size || 44}px;\n display: inline-grid;\n place-items: center;\n border-radius: 8px;\n border: none;\n background: rgba(22, 32, 32, 0.56);\n color: #ffffff;\n cursor: pointer;\n outline: none;\n transition: all 0.2s ease;\n\n ${(p) =>\n p.position === \"absolute\" &&\n `\n position: absolute;\n top: 0px;\n ${p.side || \"right\"}: ${p.offset || -48}px;\n z-index: 1;\n `}\n\n &:hover {\n background: rgba(22, 32, 32, 0.7);\n transform: translateY(-1px);\n }\n\n &:active {\n transform: translateY(0);\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #205bc3;\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\nexport const ModalCloseButton = (props: TypeModalV2CloseButtonProps) => {\n const {\n children,\n onClick,\n asChild,\n closeButtonLabel = \"Close modal\",\n size = 44,\n position = \"absolute\",\n side = \"right\",\n offset = -48,\n ...rest\n } = props;\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n // Dialog.Close automatically handles closing\n };\n\n if (asChild) {\n return (\n <Dialog.Close asChild>\n {React.cloneElement(children as React.ReactElement, {\n onClick: handleClick,\n ...rest,\n })}\n </Dialog.Close>\n );\n }\n\n return (\n <Dialog.Close asChild>\n <CloseButtonWrapper\n onClick={handleClick}\n size={size}\n position={position}\n side={side}\n offset={offset}\n aria-label={closeButtonLabel}\n title={closeButtonLabel}\n {...rest}\n >\n {children || <Icon name=\"x-outline\" size=\"small\" />}\n </CloseButtonWrapper>\n </Dialog.Close>\n );\n};\n\nModalCloseButton.displayName = \"ModalCloseButton\";\n","import * as React from \"react\";\nimport { Footer } from \"../ModalV2Styles\";\nimport { DEFAULT_MODAL_BG } from \"../../shared/constants\";\nimport type { TypeModalV2FooterProps } from \"../ModalV2Types\";\n\nexport const ModalFooter = (props: TypeModalV2FooterProps) => {\n const { bg = DEFAULT_MODAL_BG, children, ...rest } = props;\n return (\n <Footer\n bg={bg}\n borderTop={500}\n borderColor=\"container.border.base\"\n {...rest}\n >\n {children}\n </Footer>\n );\n};\n\nModalFooter.displayName = \"ModalFooter\";\n","import * as React from \"react\";\nimport { Content } from \"../ModalV2Styles\";\nimport type { TypeModalV2ContentProps } from \"../ModalV2Types\";\n\nexport const ModalContent = React.forwardRef<\n HTMLDivElement,\n TypeModalV2ContentProps\n>(({ children, ...rest }, ref) => {\n return (\n <Content data-qa-modal ref={ref} {...rest}>\n {children}\n </Content>\n );\n});\n\nModalContent.displayName = \"ModalContent\";\n","import * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport type { TypeModalV2DescriptionProps } from \"../ModalV2Types\";\n\nexport const ModalDescription = React.forwardRef<\n HTMLDivElement,\n TypeModalV2DescriptionProps\n>(({ children, descriptionProps = {}, ...rest }, ref) => {\n return (\n <Dialog.Description asChild {...descriptionProps}>\n <Box ref={ref} {...rest}>\n {children}\n </Box>\n </Dialog.Description>\n );\n});\n\nModalDescription.displayName = \"ModalDescription\";\n","import * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport Button from \"@sproutsocial/seeds-react-button\";\nimport type { TypeModalV2TriggerProps } from \"../ModalV2Types\";\n\n/**\n * A trigger button that opens the modal when clicked.\n * Must be used inside a Modal component's Dialog.Root context.\n * Uses Seeds Button by default but supports asChild for custom elements.\n */\nexport const ModalTrigger = (props: TypeModalV2TriggerProps) => {\n const { children, onClick, asChild, ...rest } = props;\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n // Dialog.Trigger automatically handles modal opening\n };\n\n if (asChild) {\n return (\n <Dialog.Trigger asChild>\n {React.cloneElement(children as React.ReactElement, {\n onClick: handleClick,\n ...rest,\n })}\n </Dialog.Trigger>\n );\n }\n\n return (\n <Dialog.Trigger asChild>\n <Button onClick={handleClick} {...rest}>\n {children}\n </Button>\n </Dialog.Trigger>\n );\n};\n\nModalTrigger.displayName = \"ModalTrigger\";\n","import * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\n\nexport interface ModalCloseProps {\n children: React.ReactNode;\n onClick?: (e: React.MouseEvent) => void;\n asChild?: boolean;\n}\n\n/**\n * A component that closes the modal when clicked.\n * Uses asChild pattern like Radix primitives.\n */\nexport const ModalClose = (props: ModalCloseProps) => {\n const { children, onClick, asChild = false, ...rest } = props;\n\n const handleClick = (e: React.MouseEvent) => {\n onClick?.(e);\n // Dialog.Close automatically handles closing\n };\n\n return (\n <Dialog.Close asChild={asChild} onClick={handleClick} {...rest}>\n {children}\n </Dialog.Close>\n );\n};\n\nModalClose.displayName = \"ModalClose\";\n","// components/ModalRail.tsx\nimport * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport styled from \"styled-components\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\nimport type { TypeModalRailProps, TypeModalActionProps } from \"../ModalV2Types\";\n\n// --- styled wrappers ---\nconst Rail = styled.div<{\n side: \"right\" | \"left\";\n offset: number;\n gap: number;\n size: number;\n}>`\n position: absolute;\n top: ${(p) => p.offset}px;\n ${(p) =>\n p.side === \"right\"\n ? `right: calc(-1 * (${p.size}px + ${p.offset}px));`\n : `left: calc(-1 * (${p.size}px + ${p.offset}px));`}\n display: flex;\n flex-direction: column;\n gap: ${(p) => p.gap}px;\n z-index: 1;\n\n @media (max-width: 400px) {\n /* Move rail above the modal on the right side */\n top: auto;\n bottom: calc(100% + ${(p) => p.offset}px);\n right: ${(p) => p.offset}px;\n left: auto;\n /* Change to horizontal layout with reversed order */\n flex-direction: row-reverse;\n }\n`;\n\nconst RailBtn = styled.button<{ size: number }>`\n width: ${(p) => p.size}px;\n height: ${(p) => p.size}px;\n display: inline-grid;\n place-items: center;\n border-radius: 8px;\n border: none;\n background: rgba(22, 32, 32, 0.56);\n color: #ffffff;\n cursor: pointer;\n outline: none;\n transition: all 0.2s ease;\n\n &:hover {\n background: rgba(22, 32, 32, 0.7);\n transform: translateY(-1px);\n }\n\n &:active {\n transform: translateY(0);\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #205bc3;\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n`;\n\n// --- components ---\nexport const ModalRail: React.FC<TypeModalRailProps> = ({\n side = \"right\",\n offset = 12,\n gap = 12,\n size = 44,\n children,\n}) => {\n return (\n <Rail\n data-slot=\"modal-rail\"\n side={side}\n offset={offset}\n gap={gap}\n size={size}\n aria-label=\"Modal quick actions\"\n >\n {React.Children.map(children, (child) =>\n React.isValidElement(child)\n ? React.cloneElement(child as any, { size })\n : child\n )}\n </Rail>\n );\n};\n\nexport const ModalAction: React.FC<\n TypeModalActionProps & { size?: number }\n> = ({\n \"aria-label\": ariaLabel,\n iconName,\n disabled,\n size = 44,\n actionType,\n onClick,\n ...rest\n}) => {\n const Btn = (\n <RailBtn\n size={size}\n aria-label={ariaLabel}\n title={ariaLabel}\n disabled={disabled}\n {...rest}\n >\n {iconName ? <Icon name={iconName} size=\"small\" /> : ariaLabel}\n </RailBtn>\n );\n\n return actionType === \"close\" ? (\n <Dialog.Close asChild>{Btn}</Dialog.Close>\n ) : (\n React.cloneElement(Btn, { onClick })\n );\n};\n"],"mappings":";AAAA,YAAYA,aAAW;AACvB,YAAYC,aAAY;;;ACDxB,OAAkB;AAClB,OAAO,YAAY;AACnB,SAAS,OAAO,cAAc;AAC9B,YAAY,YAAY;AACxB,SAAS,cAAc;AACvB,OAAO,SAAsC;;;ACFtC,IAAM,wBAAwB;AAC9B,IAAM,iCAAiC;AAGvC,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AAIzB,IAAM,eAAe;AAGrB,IAAM,qBAAqB;AAAA,EAChC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AACR;AAGO,IAAM,yBAAyB;AAAA,EACpC,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AACR;;;ADXO,IAAM,gBAAgB,OAAc,cAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAM5B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,WAAW,IAAI;AAAA;AAAA;AAAA,wBAGnD,CAAC,UAAU,MAAM,MAAM,SAAS,MAAM;AAAA,MACxD,CAAC,UAAU,MAAM,MAAM,OAAO,UAAU;AAAA,aACjC,CAAC,UACV,MAAM,SAAS,MAAM,SAAS,iCAAiC,GAAG;AAAA;AAAA;AAAA,IAGlE,CAAC,UACD,MAAM,oBACN;AAAA;AAAA,GAED;AAAA;AAAA,IAEC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O;AACL,gBAAQ,KAAK,KAAK;AAAA,MACpB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SACE,gBAAAC,MAAQ,cAAP,EAAa,GAAG,iBAEd;AAAA;AAAA,IAED,gBAAAA,MAAQ,gBAAP,EACE;AAAA,qBACC,gBAAAD,KAAC,iBAAc,QAAQ,gBAAgB,kBAAkB,WAAW;AAAA,MAEtE,gBAAAC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UAGA;AAAA,4BAAAA,MAAC,aAAW,GAAG,WACb;AAAA,8BAAAD;AAAA,gBAAC;AAAA;AAAA,kBACC,YAAW;AAAA,kBACX,cAAW;AAAA,kBACX,UAAS;AAAA;AAAA,cACX;AAAA,cACC,SAAS,IAAI,CAAC,QAAQ,QACrB,gBAAAA,KAAC,eAAuB,GAAG,UAAT,GAAiB,CACpC;AAAA,eACH;AAAA,YAEC,sBACC,gBAAAA,KAAC,eAAY,OAAc,UAAoB;AAAA,YAIhD,eAAe,gBAAAA,KAAC,oBAAkB,uBAAY;AAAA,YAG9C;AAAA;AAAA;AAAA,MACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,kBAAQ;","names":["React","Dialog","Content","React","Dialog","Box","React","Dialog","styled","jsx","Box","jsx","React","jsx","Content","React","Dialog","Box","jsx","React","Dialog","jsx","Dialog","jsx","React","Dialog","styled","Icon","jsx","jsx","jsxs","e","props"]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/v2/index.js
CHANGED
|
@@ -15,8 +15,9 @@ import {
|
|
|
15
15
|
ModalHeader,
|
|
16
16
|
ModalRail,
|
|
17
17
|
ModalTrigger,
|
|
18
|
-
ModalV2_default
|
|
19
|
-
|
|
18
|
+
ModalV2_default,
|
|
19
|
+
useDragContext
|
|
20
|
+
} from "../chunk-4ITF4DBY.js";
|
|
20
21
|
export {
|
|
21
22
|
BODY_PADDING,
|
|
22
23
|
DEFAULT_MODAL_BG,
|
|
@@ -34,6 +35,7 @@ export {
|
|
|
34
35
|
ModalFooter,
|
|
35
36
|
ModalHeader,
|
|
36
37
|
ModalRail,
|
|
37
|
-
ModalTrigger
|
|
38
|
+
ModalTrigger,
|
|
39
|
+
useDragContext
|
|
38
40
|
};
|
|
39
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as Modal } from './Modal-ki8oiGbC.mjs';
|
|
2
2
|
export { d as TypeModalCloseButtonProps, c as TypeModalContentProps, b as TypeModalFooterProps, a as TypeModalHeaderProps, T as TypeModalProps } from './Modal-ki8oiGbC.mjs';
|
|
3
|
-
export { i as ModalAction, g as ModalClose, f as ModalCloseButton, e as ModalContent, b as ModalDescription, d as ModalFooter, c as ModalHeader, h as ModalRail, a as ModalTrigger, M as ModalV2, q as TypeModalActionProps, p as TypeModalRailProps, k as TypeModalV2CloseButtonProps, n as TypeModalV2ContentProps, o as TypeModalV2DescriptionProps, m as TypeModalV2FooterProps, l as TypeModalV2HeaderProps, T as TypeModalV2Props, j as TypeModalV2TriggerProps } from './ModalRail-
|
|
3
|
+
export { i as ModalAction, g as ModalClose, f as ModalCloseButton, e as ModalContent, b as ModalDescription, d as ModalFooter, c as ModalHeader, h as ModalRail, a as ModalTrigger, M as ModalV2, q as TypeModalActionProps, p as TypeModalRailProps, k as TypeModalV2CloseButtonProps, n as TypeModalV2ContentProps, o as TypeModalV2DescriptionProps, m as TypeModalV2FooterProps, l as TypeModalV2HeaderProps, T as TypeModalV2Props, j as TypeModalV2TriggerProps } from './ModalRail-5PeilhW7.mjs';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-modal';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as Modal } from './Modal-ki8oiGbC.js';
|
|
2
2
|
export { d as TypeModalCloseButtonProps, c as TypeModalContentProps, b as TypeModalFooterProps, a as TypeModalHeaderProps, T as TypeModalProps } from './Modal-ki8oiGbC.js';
|
|
3
|
-
export { i as ModalAction, g as ModalClose, f as ModalCloseButton, e as ModalContent, b as ModalDescription, d as ModalFooter, c as ModalHeader, h as ModalRail, a as ModalTrigger, M as ModalV2, q as TypeModalActionProps, p as TypeModalRailProps, k as TypeModalV2CloseButtonProps, n as TypeModalV2ContentProps, o as TypeModalV2DescriptionProps, m as TypeModalV2FooterProps, l as TypeModalV2HeaderProps, T as TypeModalV2Props, j as TypeModalV2TriggerProps } from './ModalRail-
|
|
3
|
+
export { i as ModalAction, g as ModalClose, f as ModalCloseButton, e as ModalContent, b as ModalDescription, d as ModalFooter, c as ModalHeader, h as ModalRail, a as ModalTrigger, M as ModalV2, q as TypeModalActionProps, p as TypeModalRailProps, k as TypeModalV2CloseButtonProps, n as TypeModalV2ContentProps, o as TypeModalV2DescriptionProps, m as TypeModalV2FooterProps, l as TypeModalV2HeaderProps, T as TypeModalV2Props, j as TypeModalV2TriggerProps } from './ModalRail-5PeilhW7.js';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-modal';
|