@sproutsocial/seeds-react-modal 1.1.1 → 2.0.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/.turbo/turbo-build.log +23 -23
- package/CHANGELOG.md +182 -0
- package/dist/ModalAction-BB7qJtQj.d.mts +445 -0
- package/dist/ModalAction-BB7qJtQj.d.ts +445 -0
- package/dist/esm/chunk-ETVICNHP.js +1353 -0
- package/dist/esm/chunk-ETVICNHP.js.map +1 -0
- package/dist/esm/index.js +11 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v2/index.js +12 -20
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1154 -546
- package/dist/index.js.map +1 -1
- package/dist/v2/index.d.mts +4 -11
- package/dist/v2/index.d.ts +4 -11
- package/dist/v2/index.js +1152 -545
- package/dist/v2/index.js.map +1 -1
- package/package.json +8 -7
- package/src/index.ts +11 -12
- package/src/shared/constants.ts +11 -7
- package/src/v2/Modal.tsx +169 -0
- package/src/v2/ModalTypes.ts +343 -0
- package/src/v2/ModalV2.stories.tsx +413 -128
- package/src/v2/MotionConfig.ts +185 -0
- package/src/v2/components/ModalAction.tsx +94 -0
- package/src/v2/components/ModalBody.tsx +54 -0
- package/src/v2/components/ModalCloseWrapper.tsx +35 -0
- package/src/v2/components/ModalContent.tsx +288 -11
- package/src/v2/components/ModalDescription.tsx +14 -2
- package/src/v2/components/ModalFooter.tsx +94 -13
- package/src/v2/components/ModalHeader.tsx +77 -34
- package/src/v2/components/ModalOverlay.tsx +52 -0
- package/src/v2/components/ModalRail.tsx +35 -99
- package/src/v2/components/index.ts +11 -7
- package/src/v2/index.ts +13 -16
- package/dist/ModalRail-5PeilhW7.d.mts +0 -186
- package/dist/ModalRail-5PeilhW7.d.ts +0 -186
- package/dist/esm/chunk-4ITF4DBY.js +0 -717
- package/dist/esm/chunk-4ITF4DBY.js.map +0 -1
- package/src/v2/ModalV2.tsx +0 -388
- package/src/v2/ModalV2Styles.tsx +0 -180
- package/src/v2/ModalV2Types.ts +0 -154
- package/src/v2/components/ModalClose.tsx +0 -29
- package/src/v2/components/ModalCloseButton.tsx +0 -100
- package/src/v2/components/ModalTrigger.tsx +0 -39
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[32m58.46 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[32m50.48 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m201.74 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m188.43 KB[39m
|
|
15
16
|
[32mCJS[39m [1mdist/v1/index.js.map [22m[32m13.03 KB[39m
|
|
16
|
-
[32mCJS[39m
|
|
17
|
-
[32mCJS[39m ⚡️ Build success in 270ms
|
|
18
|
-
[32mESM[39m [1mdist/esm/index.js [22m[32m567.00 B[39m
|
|
17
|
+
[32mCJS[39m ⚡️ Build success in 396ms
|
|
19
18
|
[32mESM[39m [1mdist/esm/v1/index.js [22m[32m165.00 B[39m
|
|
20
|
-
[32mESM[39m [1mdist/esm/v2/index.js [22m[
|
|
19
|
+
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m596.00 B[39m
|
|
20
|
+
[32mESM[39m [1mdist/esm/index.js [22m[32m583.00 B[39m
|
|
21
21
|
[32mESM[39m [1mdist/esm/chunk-IYDY4OPB.js [22m[32m7.12 KB[39m
|
|
22
|
-
[32mESM[39m [1mdist/esm/chunk-
|
|
23
|
-
[32mESM[39m [1mdist/esm/index.js.map [22m[32m963.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/esm/chunk-ETVICNHP.js [22m[32m45.64 KB[39m
|
|
24
23
|
[32mESM[39m [1mdist/esm/v1/index.js.map [22m[32m71.00 B[39m
|
|
25
24
|
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m71.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/esm/index.js.map [22m[32m1.05 KB[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-ETVICNHP.js.map [22m[32m187.52 KB[39m
|
|
28
|
+
[32mESM[39m ⚡️ Build success in 400ms
|
|
29
29
|
[34mDTS[39m Build start
|
|
30
|
-
[32mDTS[39m ⚡️ Build success in
|
|
31
|
-
[32mDTS[39m [1mdist/index.d.ts
|
|
32
|
-
[32mDTS[39m [1mdist/v1/index.d.ts
|
|
33
|
-
[32mDTS[39m [1mdist/v2/index.d.ts
|
|
34
|
-
[32mDTS[39m [1mdist/Modal-ki8oiGbC.d.ts
|
|
35
|
-
[32mDTS[39m [1mdist/
|
|
36
|
-
[32mDTS[39m [1mdist/index.d.mts
|
|
37
|
-
[32mDTS[39m [1mdist/v1/index.d.mts
|
|
38
|
-
[32mDTS[39m [1mdist/v2/index.d.mts
|
|
39
|
-
[32mDTS[39m [1mdist/Modal-ki8oiGbC.d.mts
|
|
40
|
-
[32mDTS[39m [1mdist/
|
|
41
|
-
Done in
|
|
30
|
+
[32mDTS[39m ⚡️ Build success in 15203ms
|
|
31
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m975.00 B[39m
|
|
32
|
+
[32mDTS[39m [1mdist/v1/index.d.ts [22m[32m413.00 B[39m
|
|
33
|
+
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m1021.00 B[39m
|
|
34
|
+
[32mDTS[39m [1mdist/Modal-ki8oiGbC.d.ts [22m[32m2.52 KB[39m
|
|
35
|
+
[32mDTS[39m [1mdist/ModalAction-BB7qJtQj.d.ts [22m[32m17.39 KB[39m
|
|
36
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m978.00 B[39m
|
|
37
|
+
[32mDTS[39m [1mdist/v1/index.d.mts [22m[32m415.00 B[39m
|
|
38
|
+
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m1022.00 B[39m
|
|
39
|
+
[32mDTS[39m [1mdist/Modal-ki8oiGbC.d.mts [22m[32m2.52 KB[39m
|
|
40
|
+
[32mDTS[39m [1mdist/ModalAction-BB7qJtQj.d.mts [22m[32m17.39 KB[39m
|
|
41
|
+
Done in 17.65s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,187 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-modal
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @sproutsocial/seeds-react-icon@1.1.6
|
|
8
|
+
- @sproutsocial/seeds-react-button@1.3.2
|
|
9
|
+
|
|
10
|
+
## 2.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- b1c3b44: ## Modal V2 Complete Rewrite
|
|
15
|
+
|
|
16
|
+
Complete architectural overhaul of Modal V2 with improved API, accessibility, animations, and mobile responsiveness.
|
|
17
|
+
|
|
18
|
+
### Breaking Changes
|
|
19
|
+
|
|
20
|
+
#### Component Name Changes
|
|
21
|
+
|
|
22
|
+
- **Root component**: `ModalV2` renamed to `Modal`
|
|
23
|
+
- **Removed components**: `ModalClose`, `ModalCloseButton`, `ModalTrigger`
|
|
24
|
+
- **New components**: `ModalBody`, `ModalCloseWrapper`, `ModalAction`, `ModalCustomHeader`, `ModalCustomFooter`
|
|
25
|
+
|
|
26
|
+
#### Removed Exports
|
|
27
|
+
|
|
28
|
+
- **Removed z-index constants**: `DEFAULT_MODAL_Z_INDEX`, `DEFAULT_OVERLAY_Z_INDEX_OFFSET`, `MODAL_PRIORITY_Z_INDEX`
|
|
29
|
+
- These are no longer needed as Radix UI Dialog handles stacking automatically via portal DOM order
|
|
30
|
+
- If you were using these constants, remove them from your code
|
|
31
|
+
- Stacking is now managed by the order modals are opened (last opened appears on top)
|
|
32
|
+
|
|
33
|
+
#### API Changes
|
|
34
|
+
|
|
35
|
+
- **Modal root**: Now built on Radix UI Dialog primitives with simplified props
|
|
36
|
+
|
|
37
|
+
- Removed children-based header composition
|
|
38
|
+
- Added slot-based API: `title`, `subtitle`, `description` props for common use cases
|
|
39
|
+
- Added `modalTrigger` prop for trigger element
|
|
40
|
+
- Added `draggable` prop for draggable modals
|
|
41
|
+
- Added `showOverlay` prop (defaults to `true`)
|
|
42
|
+
- Added `actions` prop for floating action rail
|
|
43
|
+
- **Removed `priority` prop**: z-index management is no longer needed
|
|
44
|
+
- Added `closeButtonAriaLabel` prop (defaults to "Close")
|
|
45
|
+
|
|
46
|
+
- **ModalHeader**: Converted to slot-based API
|
|
47
|
+
|
|
48
|
+
- Now only supports `title` and `subtitle` props
|
|
49
|
+
- Removed `children` prop
|
|
50
|
+
- For custom headers, use new `ModalCustomHeader` component
|
|
51
|
+
- Automatically becomes draggable handle when `<Modal draggable={true} />`
|
|
52
|
+
|
|
53
|
+
- **ModalFooter**: Converted to slot-based API with automatic button wrapping
|
|
54
|
+
|
|
55
|
+
- `primaryButton`: Main action (auto-closes modal)
|
|
56
|
+
- `cancelButton`: Secondary action (auto-closes modal)
|
|
57
|
+
- `leftAction`: Optional left-aligned action (no auto-close, for destructive actions)
|
|
58
|
+
- For custom footers, use new `ModalCustomFooter` component
|
|
59
|
+
- At least one action prop is required (TypeScript enforced)
|
|
60
|
+
|
|
61
|
+
- **ModalBody**: New component for modal content area
|
|
62
|
+
- Replaces direct content in Modal children
|
|
63
|
+
- Provides proper scrolling behavior and padding
|
|
64
|
+
|
|
65
|
+
#### Type Changes
|
|
66
|
+
|
|
67
|
+
- All types renamed from `TypeModalV2*` to `TypeModal*`
|
|
68
|
+
- `TypeModalV2Props` → `TypeModalProps`
|
|
69
|
+
- `TypeModalV2HeaderProps` → `TypeModalHeaderProps`
|
|
70
|
+
- `TypeModalV2FooterProps` → `TypeModalFooterProps`
|
|
71
|
+
- New types: `TypeModalBodyProps`, `TypeModalDescriptionProps`, `TypeModalRailProps`, `TypeModalActionProps`
|
|
72
|
+
|
|
73
|
+
### New Features
|
|
74
|
+
|
|
75
|
+
#### Draggable Modals
|
|
76
|
+
|
|
77
|
+
- Enable with `draggable={true}` prop
|
|
78
|
+
- Drag from header to reposition modal
|
|
79
|
+
- Constrained to viewport boundaries
|
|
80
|
+
- TypeScript enforces `showOverlay={false}` when draggable (overlay would block interaction)
|
|
81
|
+
- Automatically sets Radix `modal={false}` to allow background interaction
|
|
82
|
+
|
|
83
|
+
#### Floating Action Rail
|
|
84
|
+
|
|
85
|
+
- Always-visible floating close button
|
|
86
|
+
- Support for additional custom actions via `actions` prop
|
|
87
|
+
- Positioned on right side (desktop) or above modal (mobile)
|
|
88
|
+
- Actions defined with `iconName`, `onClick`, `aria-label`
|
|
89
|
+
|
|
90
|
+
#### Mobile Responsiveness (≤780px)
|
|
91
|
+
|
|
92
|
+
- Bottom sheet layout anchored to screen bottom
|
|
93
|
+
- Rounded top corners, flat bottom corners
|
|
94
|
+
- Rail positioned above modal
|
|
95
|
+
- Content height hugs content with scrolling
|
|
96
|
+
- Smooth slide-up animation
|
|
97
|
+
|
|
98
|
+
#### Animation System
|
|
99
|
+
|
|
100
|
+
- Built with Framer Motion `AnimatePresence`
|
|
101
|
+
- Smooth fade + scale animation (desktop)
|
|
102
|
+
- Slide-up animation (mobile)
|
|
103
|
+
- Separate animations for overlay and content
|
|
104
|
+
- Draggable modals use opacity-only animation (no transform conflict)
|
|
105
|
+
|
|
106
|
+
#### Accessibility Improvements
|
|
107
|
+
|
|
108
|
+
- Built on Radix UI Dialog primitives
|
|
109
|
+
- Automatic ARIA attributes and focus management
|
|
110
|
+
- ESC key and outside click to close (when not draggable)
|
|
111
|
+
- Required `aria-label` when no title/subtitle provided (TypeScript enforced)
|
|
112
|
+
- Subtitle automatically wrapped in `Dialog.Description`
|
|
113
|
+
|
|
114
|
+
### Component Details
|
|
115
|
+
|
|
116
|
+
#### ModalCloseWrapper
|
|
117
|
+
|
|
118
|
+
New utility component that wraps any element and makes it close the modal when clicked. Used internally by `ModalFooter` for automatic close behavior.
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<ModalCloseWrapper>
|
|
122
|
+
<Button>Close</Button>
|
|
123
|
+
</ModalCloseWrapper>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### ModalAction
|
|
127
|
+
|
|
128
|
+
Action button component for the floating rail. Supports two types:
|
|
129
|
+
|
|
130
|
+
- `actionType="close"`: Closes modal on click
|
|
131
|
+
- `actionType="button"`: Custom action with onClick handler
|
|
132
|
+
|
|
133
|
+
#### ModalCustomHeader & ModalCustomFooter
|
|
134
|
+
|
|
135
|
+
Base styled components for custom header/footer layouts when slot-based API isn't sufficient. Provides styling and system props support.
|
|
136
|
+
|
|
137
|
+
### Technical Improvements
|
|
138
|
+
|
|
139
|
+
#### Improved Stacking Behavior
|
|
140
|
+
|
|
141
|
+
Modal V2 no longer uses explicit z-index values, relying instead on Radix UI Dialog's portal-based stacking:
|
|
142
|
+
|
|
143
|
+
- **Automatic stacking**: Modal elements are portaled to `<body>` and stack naturally via DOM order
|
|
144
|
+
- **Simpler integration**: No z-index conflicts with other portal-based components (tooltips, popovers, etc.)
|
|
145
|
+
- **Better composability**: Works seamlessly with new popout components and other overlays
|
|
146
|
+
- **Predictable behavior**: Last opened modal always appears on top, regardless of configuration
|
|
147
|
+
|
|
148
|
+
**Migration Note**: If you were using the `priority` prop to control modal stacking, remove it. Modals now stack in the order they're opened, which provides more predictable and intuitive behavior.
|
|
149
|
+
|
|
150
|
+
#### Performance Optimizations
|
|
151
|
+
|
|
152
|
+
- **Split rendering paths**: Non-draggable modals now use lightweight `StaticModalContent` component, avoiding unnecessary drag logic, event listeners, and boundary calculations
|
|
153
|
+
- **Conditional component loading**: Draggable functionality only loads when `draggable={true}`, reducing runtime overhead for 99% of use cases
|
|
154
|
+
- **Optimized re-renders**: Removed drag context overhead from static modals entirely
|
|
155
|
+
|
|
156
|
+
#### Type Safety Enhancements
|
|
157
|
+
|
|
158
|
+
- **Discriminated unions for prop relationships**: TypeScript enforces `showOverlay={false}` when `draggable={true}`, preventing invalid configurations at compile time
|
|
159
|
+
- **Required footer actions**: Footer type system ensures at least one action button is provided, eliminating empty footer states
|
|
160
|
+
- **Removed ambiguous APIs**: Eliminated `children` override props from `ModalHeader` and `ModalFooter`, guiding developers toward the slot-based API while providing explicit `ModalCustomHeader`/`ModalCustomFooter` components for advanced use cases
|
|
161
|
+
|
|
162
|
+
#### Code Quality
|
|
163
|
+
|
|
164
|
+
- Removed redundant `width` styled-system import (already included in LAYOUT)
|
|
165
|
+
- Added POSITION system props to ModalOverlay for better positioning control
|
|
166
|
+
- Created `MotionConfig.ts` for centralized animation variants
|
|
167
|
+
- Split styles into component-specific files for better organization
|
|
168
|
+
- Consistent component naming and structure
|
|
169
|
+
- Updated Storybook stories to use semantic theme tokens instead of raw color scale values
|
|
170
|
+
|
|
171
|
+
### Racine Updates
|
|
172
|
+
|
|
173
|
+
- Export name corrected: `Modal` instead of `ModalV2`
|
|
174
|
+
- All type exports updated to match new names
|
|
175
|
+
- Removed z-index constant exports to match Modal V2 changes
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [b1c3b44]
|
|
180
|
+
- @sproutsocial/seeds-react-theme@3.1.1
|
|
181
|
+
- @sproutsocial/seeds-react-box@1.1.5
|
|
182
|
+
- @sproutsocial/seeds-react-icon@1.1.5
|
|
183
|
+
- @sproutsocial/seeds-react-button@1.3.1
|
|
184
|
+
|
|
3
185
|
## 1.1.1
|
|
4
186
|
|
|
5
187
|
### Patch Changes
|