@sproutsocial/seeds-react-panel 0.3.7
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/.eslintrc.js +4 -0
- package/.turbo/turbo-build.log +21 -0
- package/CHANGELOG.md +139 -0
- package/dist/esm/index.js +366 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +178 -0
- package/dist/index.d.ts +178 -0
- package/dist/index.js +410 -0
- package/dist/index.js.map +1 -0
- package/jest.config.js +9 -0
- package/package.json +49 -0
- package/src/Panel.stories.tsx +376 -0
- package/src/Panel.tsx +139 -0
- package/src/PanelCloseButton.tsx +26 -0
- package/src/PanelContent.tsx +18 -0
- package/src/PanelContext.tsx +14 -0
- package/src/PanelFooter.tsx +11 -0
- package/src/PanelHeader.tsx +41 -0
- package/src/PanelMobileActionsHeader.tsx +73 -0
- package/src/PanelProvider.tsx +38 -0
- package/src/PanelTypes.ts +166 -0
- package/src/__tests__/Panel.test.tsx +354 -0
- package/src/__tests__/Panel.typetest.tsx +50 -0
- package/src/index.ts +11 -0
- package/src/styles.ts +71 -0
- package/tsconfig.json +15 -0
- package/tsup.config.ts +12 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
yarn run v1.22.22
|
|
2
|
+
$ tsup --dts
|
|
3
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
4
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
5
|
+
[34mCLI[39m tsup v8.5.0
|
|
6
|
+
[34mCLI[39m Using tsup config: /home/runner/_work/seeds/seeds/seeds-react/seeds-react-panel/tsup.config.ts
|
|
7
|
+
[34mCLI[39m Target: es2022
|
|
8
|
+
[34mCLI[39m Cleaning output folder
|
|
9
|
+
[34mCJS[39m Build start
|
|
10
|
+
[34mESM[39m Build start
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m13.98 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m25.98 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 63ms
|
|
14
|
+
[32mESM[39m [1mdist/esm/index.js [22m[32m10.33 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/esm/index.js.map [22m[32m25.64 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 63ms
|
|
17
|
+
[34mDTS[39m Build start
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 3708ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m8.35 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m8.35 KB[39m
|
|
21
|
+
Done in 5.00s.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# @sproutsocial/seeds-react-panel
|
|
2
|
+
|
|
3
|
+
## 0.3.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [69c9d02]
|
|
8
|
+
- @sproutsocial/seeds-react-icon@2.4.0
|
|
9
|
+
- @sproutsocial/seeds-react-button@2.2.1
|
|
10
|
+
- @sproutsocial/seeds-react-drawer@2.2.7
|
|
11
|
+
|
|
12
|
+
## 0.3.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [67caa51]
|
|
17
|
+
- Updated dependencies [edc1819]
|
|
18
|
+
- @sproutsocial/seeds-react-drawer@2.2.6
|
|
19
|
+
- @sproutsocial/seeds-react-text@1.4.3
|
|
20
|
+
|
|
21
|
+
## 0.3.5
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [456a20f]
|
|
26
|
+
- Updated dependencies [5892f44]
|
|
27
|
+
- @sproutsocial/seeds-react-button@2.2.0
|
|
28
|
+
- @sproutsocial/seeds-react-system-props@3.1.1
|
|
29
|
+
- @sproutsocial/seeds-react-drawer@2.2.5
|
|
30
|
+
- @sproutsocial/seeds-react-box@1.1.21
|
|
31
|
+
- @sproutsocial/seeds-react-icon@2.3.13
|
|
32
|
+
- @sproutsocial/seeds-react-text@1.4.2
|
|
33
|
+
|
|
34
|
+
## 0.3.4
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [5114a32]
|
|
39
|
+
- Updated dependencies [a0fe3d3]
|
|
40
|
+
- @sproutsocial/seeds-react-theme@4.1.0
|
|
41
|
+
- @sproutsocial/seeds-react-button@2.1.3
|
|
42
|
+
- @sproutsocial/seeds-react-box@1.1.20
|
|
43
|
+
- @sproutsocial/seeds-react-drawer@2.2.4
|
|
44
|
+
- @sproutsocial/seeds-react-hooks@3.2.2
|
|
45
|
+
- @sproutsocial/seeds-react-icon@2.3.12
|
|
46
|
+
|
|
47
|
+
## 0.3.3
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [cb27f07]
|
|
52
|
+
- @sproutsocial/seeds-react-button@2.1.2
|
|
53
|
+
- @sproutsocial/seeds-react-drawer@2.2.3
|
|
54
|
+
|
|
55
|
+
## 0.3.2
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [40d2dfe]
|
|
60
|
+
- @sproutsocial/seeds-react-button@2.1.1
|
|
61
|
+
- @sproutsocial/seeds-react-drawer@2.2.2
|
|
62
|
+
|
|
63
|
+
## 0.3.1
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [132ef9d]
|
|
68
|
+
- Updated dependencies [132ef9d]
|
|
69
|
+
- Updated dependencies [132ef9d]
|
|
70
|
+
- @sproutsocial/seeds-react-button@2.1.0
|
|
71
|
+
- @sproutsocial/seeds-react-theme@4.0.0
|
|
72
|
+
- @sproutsocial/seeds-react-system-props@3.1.0
|
|
73
|
+
- @sproutsocial/seeds-react-drawer@2.2.1
|
|
74
|
+
- @sproutsocial/seeds-react-box@1.1.19
|
|
75
|
+
- @sproutsocial/seeds-react-hooks@3.2.1
|
|
76
|
+
- @sproutsocial/seeds-react-icon@2.3.11
|
|
77
|
+
- @sproutsocial/seeds-react-text@1.4.1
|
|
78
|
+
|
|
79
|
+
## 0.3.0
|
|
80
|
+
|
|
81
|
+
### Minor Changes
|
|
82
|
+
|
|
83
|
+
- 1b8cf30: Add a floating action rail to the mobile bottom-sheet `Drawer`. New `Drawer`
|
|
84
|
+
props:
|
|
85
|
+
|
|
86
|
+
- `actions?: TypeDrawerActionProps[]` — pill buttons rendered in a horizontal
|
|
87
|
+
rail above the popup on mobile, matching the ModalV2 mobile pattern. The
|
|
88
|
+
rail owns the close button, so the default `Drawer.Header` omits its
|
|
89
|
+
built-in close affordance when actions are provided.
|
|
90
|
+
- `actionsInHeader?: boolean` — opt out of the rail and render actions inside
|
|
91
|
+
the header instead. Use this for nested bottom sheets and snap-point
|
|
92
|
+
layouts where a rail above the popup would collide with surrounding UI or
|
|
93
|
+
fall off-screen at the highest snap point.
|
|
94
|
+
|
|
95
|
+
`Panel` and `PeekIn` forward both props to the underlying `Drawer`. `PeekIn`'s
|
|
96
|
+
existing `actions`/`panelToggle` now render in the rail by default on mobile;
|
|
97
|
+
opt into the prior in-header behavior with `actionsInHeader`. The
|
|
98
|
+
`WithSnapPoints` `PeekIn` story has been updated to set `actionsInHeader` so
|
|
99
|
+
nested-drawer header layout is preserved.
|
|
100
|
+
|
|
101
|
+
Internal: new `ActionRail` and `ActionRailButton` primitives are exported from
|
|
102
|
+
`@sproutsocial/seeds-react-drawer` for use elsewhere in the design system.
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 1b8cf30: Fix `Panel` silently dropping `actions` when `actionsInHeader={true}` on mobile.
|
|
107
|
+
When the consumer opts out of the floating rail and doesn't supply a custom
|
|
108
|
+
`header`, `Panel` now auto-composes a mobile header that renders the title,
|
|
109
|
+
the forwarded `actions` as pill buttons, and a close-button pill — matching
|
|
110
|
+
the pattern used by `PeekIn`. Consumers that pass their own `header` retain
|
|
111
|
+
full control and are responsible for rendering the actions inline themselves.
|
|
112
|
+
- Updated dependencies [1b8cf30]
|
|
113
|
+
- Updated dependencies [1b8cf30]
|
|
114
|
+
- @sproutsocial/seeds-react-drawer@2.2.0
|
|
115
|
+
- @sproutsocial/seeds-react-icon@2.3.10
|
|
116
|
+
- @sproutsocial/seeds-react-button@2.0.8
|
|
117
|
+
|
|
118
|
+
## 0.2.0
|
|
119
|
+
|
|
120
|
+
### Minor Changes
|
|
121
|
+
|
|
122
|
+
- b961e75: Add `seeds-react-panel` — an inline (push-content) sidebar panel, exposed through Racine as `Panel`, `PanelProvider`, and `usePanelContext`.
|
|
123
|
+
|
|
124
|
+
- Renders inline on desktop and pushes sibling content via `flex-basis`. Supports `direction="left" | "right" | "bottom"` and a configurable `width`.
|
|
125
|
+
- Below the mobile breakpoint, automatically switches to an overlay bottom sheet by delegating to `seeds-react-drawer`.
|
|
126
|
+
- Compound API mirrors `Drawer`: `Panel.Header`, `Panel.Content`, `Panel.CloseButton`.
|
|
127
|
+
- Context-driven open state via `PanelProvider` (supports both controlled `open` / `onOpenChange` and uncontrolled `defaultOpen`).
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- Updated dependencies [b961e75]
|
|
132
|
+
- Updated dependencies [47c62b3]
|
|
133
|
+
- Updated dependencies [b961e75]
|
|
134
|
+
- @sproutsocial/seeds-react-drawer@2.1.0
|
|
135
|
+
- @sproutsocial/seeds-react-theme@3.7.1
|
|
136
|
+
- @sproutsocial/seeds-react-hooks@3.2.0
|
|
137
|
+
- @sproutsocial/seeds-react-box@1.1.18
|
|
138
|
+
- @sproutsocial/seeds-react-icon@2.3.9
|
|
139
|
+
- @sproutsocial/seeds-react-button@2.0.7
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// src/Panel.tsx
|
|
2
|
+
import * as React6 from "react";
|
|
3
|
+
import Drawer2 from "@sproutsocial/seeds-react-drawer";
|
|
4
|
+
import { useIsMobile } from "@sproutsocial/seeds-react-hooks";
|
|
5
|
+
|
|
6
|
+
// src/PanelContext.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
var PanelContext = React.createContext(null);
|
|
9
|
+
var usePanelContext = () => {
|
|
10
|
+
const ctx = React.useContext(PanelContext);
|
|
11
|
+
if (!ctx) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
"usePanelContext must be used within a <PanelProvider>. Wrap the consuming tree in <PanelProvider> to provide isPanelOpen / togglePanel."
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
return ctx;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// src/PanelHeader.tsx
|
|
20
|
+
import Box from "@sproutsocial/seeds-react-box";
|
|
21
|
+
import Text from "@sproutsocial/seeds-react-text";
|
|
22
|
+
|
|
23
|
+
// src/PanelCloseButton.tsx
|
|
24
|
+
import "react";
|
|
25
|
+
import Button from "@sproutsocial/seeds-react-button";
|
|
26
|
+
import Icon from "@sproutsocial/seeds-react-icon";
|
|
27
|
+
import { jsx } from "react/jsx-runtime";
|
|
28
|
+
var PanelCloseButton = (props) => {
|
|
29
|
+
const panelContext = usePanelContext();
|
|
30
|
+
if (props.render) {
|
|
31
|
+
return props.render(panelContext) ?? null;
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
Button,
|
|
35
|
+
{
|
|
36
|
+
appearance: "pill",
|
|
37
|
+
"aria-label": panelContext.closeButtonLabel,
|
|
38
|
+
onClick: panelContext.closePanel,
|
|
39
|
+
...props,
|
|
40
|
+
children: props.children || /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, name: "x-outline" })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
PanelCloseButton.displayName = "Panel.CloseButton";
|
|
45
|
+
|
|
46
|
+
// src/PanelHeader.tsx
|
|
47
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
48
|
+
var PanelHeader = ({
|
|
49
|
+
title = "",
|
|
50
|
+
id = void 0,
|
|
51
|
+
children,
|
|
52
|
+
render,
|
|
53
|
+
...rest
|
|
54
|
+
}) => {
|
|
55
|
+
const panelContext = usePanelContext();
|
|
56
|
+
if (render) {
|
|
57
|
+
return render(panelContext);
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsx2(
|
|
60
|
+
Box,
|
|
61
|
+
{
|
|
62
|
+
display: "flex",
|
|
63
|
+
flex: "0 0 auto",
|
|
64
|
+
justifyContent: "space-between",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
p: 400,
|
|
67
|
+
borderBottom: "1px solid",
|
|
68
|
+
borderColor: "container.border.base",
|
|
69
|
+
...rest,
|
|
70
|
+
children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx2(Text.Headline, { id, children: title }),
|
|
72
|
+
/* @__PURE__ */ jsx2(PanelCloseButton, {})
|
|
73
|
+
] })
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
PanelHeader.displayName = "Panel.Header";
|
|
78
|
+
|
|
79
|
+
// src/PanelContent.tsx
|
|
80
|
+
import "react";
|
|
81
|
+
|
|
82
|
+
// src/styles.ts
|
|
83
|
+
import styled, { css } from "styled-components";
|
|
84
|
+
import { COMMON } from "@sproutsocial/seeds-react-system-props";
|
|
85
|
+
import { MOTION_DURATION_MEDIUM } from "@sproutsocial/seeds-motion/unitless";
|
|
86
|
+
import Box2 from "@sproutsocial/seeds-react-box";
|
|
87
|
+
var gapSide = (direction) => {
|
|
88
|
+
if (direction === "right") return "left";
|
|
89
|
+
if (direction === "left") return "right";
|
|
90
|
+
return "top";
|
|
91
|
+
};
|
|
92
|
+
var PanelContainer = styled.aside`
|
|
93
|
+
background: ${(props) => props.theme.colors.container.background.base};
|
|
94
|
+
flex-grow: 0;
|
|
95
|
+
flex-shrink: 0;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
transition: flex-basis ${MOTION_DURATION_MEDIUM}s ease-in-out,
|
|
98
|
+
margin ${MOTION_DURATION_MEDIUM}s ease-in-out;
|
|
99
|
+
flex-basis: ${(props) => props.$isOpen ? `${props.$width}px` : "0px"};
|
|
100
|
+
margin-${(props) => gapSide(props.$direction)}: ${(props) => props.$isOpen && props.$gap ? `${props.$gap}px` : "0px"};
|
|
101
|
+
border-radius: ${({ theme }) => theme.radii[800]};
|
|
102
|
+
|
|
103
|
+
${(props) => props.$direction === "bottom" ? css`
|
|
104
|
+
width: 100%;
|
|
105
|
+
` : css`
|
|
106
|
+
height: 100%;
|
|
107
|
+
`}
|
|
108
|
+
|
|
109
|
+
${COMMON}
|
|
110
|
+
`;
|
|
111
|
+
var PanelInner = styled.div`
|
|
112
|
+
${(props) => props.$direction === "bottom" ? css`
|
|
113
|
+
min-height: ${props.$width}px;
|
|
114
|
+
width: 100%;
|
|
115
|
+
` : css`
|
|
116
|
+
min-width: ${props.$width}px;
|
|
117
|
+
height: 100%;
|
|
118
|
+
`}
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
`;
|
|
123
|
+
var Content = styled(Box2)`
|
|
124
|
+
overflow-y: auto;
|
|
125
|
+
`;
|
|
126
|
+
var Footer = styled(Box2)`
|
|
127
|
+
flex: 0 0 auto;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
// src/PanelContent.tsx
|
|
132
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
133
|
+
var PanelContent = ({ children, ...rest }) => /* @__PURE__ */ jsx3(
|
|
134
|
+
Content,
|
|
135
|
+
{
|
|
136
|
+
flex: "1 1 auto",
|
|
137
|
+
minHeight: "0",
|
|
138
|
+
p: 450,
|
|
139
|
+
color: "text.body",
|
|
140
|
+
"data-panel-content": "",
|
|
141
|
+
...rest,
|
|
142
|
+
children
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
PanelContent.displayName = "Panel.Content";
|
|
146
|
+
|
|
147
|
+
// src/PanelFooter.tsx
|
|
148
|
+
import "react";
|
|
149
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
150
|
+
var PanelFooter = ({ children, ...rest }) => /* @__PURE__ */ jsx4(Footer, { p: 450, "data-panel-footer": "", ...rest, children });
|
|
151
|
+
PanelFooter.displayName = "Panel.Footer";
|
|
152
|
+
|
|
153
|
+
// src/PanelMobileActionsHeader.tsx
|
|
154
|
+
import "react";
|
|
155
|
+
import Box3 from "@sproutsocial/seeds-react-box";
|
|
156
|
+
import Button2 from "@sproutsocial/seeds-react-button";
|
|
157
|
+
import Drawer from "@sproutsocial/seeds-react-drawer";
|
|
158
|
+
import Icon2 from "@sproutsocial/seeds-react-icon";
|
|
159
|
+
import Text2 from "@sproutsocial/seeds-react-text";
|
|
160
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
161
|
+
var PanelMobileActionsHeader = ({
|
|
162
|
+
title,
|
|
163
|
+
titleId,
|
|
164
|
+
actions
|
|
165
|
+
}) => /* @__PURE__ */ jsx5(
|
|
166
|
+
Drawer.Header,
|
|
167
|
+
{
|
|
168
|
+
render: (ctx) => /* @__PURE__ */ jsxs2(
|
|
169
|
+
Box3,
|
|
170
|
+
{
|
|
171
|
+
display: "flex",
|
|
172
|
+
alignItems: "center",
|
|
173
|
+
justifyContent: "space-between",
|
|
174
|
+
pt: 400,
|
|
175
|
+
px: 450,
|
|
176
|
+
flex: "0 0 auto",
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ jsx5(
|
|
179
|
+
Text2,
|
|
180
|
+
{
|
|
181
|
+
as: "h2",
|
|
182
|
+
fontSize: 400,
|
|
183
|
+
fontWeight: "semibold",
|
|
184
|
+
color: "text.headline",
|
|
185
|
+
id: titleId,
|
|
186
|
+
children: title
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ jsxs2(Box3, { display: "flex", alignItems: "center", gap: 200, children: [
|
|
190
|
+
actions.map((action, i) => /* @__PURE__ */ jsx5(
|
|
191
|
+
Button2,
|
|
192
|
+
{
|
|
193
|
+
appearance: "pill",
|
|
194
|
+
"aria-label": action["aria-label"],
|
|
195
|
+
onClick: action.onClick,
|
|
196
|
+
disabled: action.disabled,
|
|
197
|
+
children: action.iconName && /* @__PURE__ */ jsx5(Icon2, { "aria-hidden": true, name: action.iconName })
|
|
198
|
+
},
|
|
199
|
+
i
|
|
200
|
+
)),
|
|
201
|
+
/* @__PURE__ */ jsx5(
|
|
202
|
+
Button2,
|
|
203
|
+
{
|
|
204
|
+
appearance: "pill",
|
|
205
|
+
"aria-label": ctx.closeButtonLabel,
|
|
206
|
+
onClick: ctx.onClose,
|
|
207
|
+
children: /* @__PURE__ */ jsx5(Icon2, { "aria-hidden": true, name: "x-outline" })
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
] })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
PanelMobileActionsHeader.displayName = "PanelMobileActionsHeader";
|
|
217
|
+
|
|
218
|
+
// src/Panel.tsx
|
|
219
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
220
|
+
var PanelComponent = ({
|
|
221
|
+
children,
|
|
222
|
+
closeButtonLabel,
|
|
223
|
+
header,
|
|
224
|
+
footer,
|
|
225
|
+
title,
|
|
226
|
+
titleId,
|
|
227
|
+
direction = "right",
|
|
228
|
+
width = 384,
|
|
229
|
+
gap = 4,
|
|
230
|
+
mobileBreakpoint,
|
|
231
|
+
zIndex,
|
|
232
|
+
id,
|
|
233
|
+
snapPoints,
|
|
234
|
+
defaultSnapPoint,
|
|
235
|
+
snapPoint,
|
|
236
|
+
onSnapPointChange,
|
|
237
|
+
snapToSequentialPoints,
|
|
238
|
+
actions,
|
|
239
|
+
actionsInHeader,
|
|
240
|
+
"aria-labelledby": ariaLabelledByProp,
|
|
241
|
+
"aria-label": ariaLabel,
|
|
242
|
+
...rest
|
|
243
|
+
}) => {
|
|
244
|
+
const panelContext = usePanelContext();
|
|
245
|
+
const { isPanelOpen, closePanel } = panelContext;
|
|
246
|
+
const isMobile = useIsMobile(mobileBreakpoint);
|
|
247
|
+
const enrichedValue = React6.useMemo(
|
|
248
|
+
() => ({ ...panelContext, closeButtonLabel }),
|
|
249
|
+
[panelContext, closeButtonLabel]
|
|
250
|
+
);
|
|
251
|
+
const prevChildrenRef = React6.useRef(null);
|
|
252
|
+
if (isPanelOpen) {
|
|
253
|
+
prevChildrenRef.current = children;
|
|
254
|
+
}
|
|
255
|
+
const renderedChildren = isPanelOpen ? children : prevChildrenRef.current;
|
|
256
|
+
const effectiveAriaLabelledBy = ariaLabelledByProp ?? (header == null ? titleId : void 0);
|
|
257
|
+
if (isMobile) {
|
|
258
|
+
const shouldRenderActionsHeader = header == null && actionsInHeader === true && !!actions && actions.length > 0;
|
|
259
|
+
return /* @__PURE__ */ jsx6(PanelContext.Provider, { value: enrichedValue, children: /* @__PURE__ */ jsxs3(
|
|
260
|
+
Drawer2,
|
|
261
|
+
{
|
|
262
|
+
...rest,
|
|
263
|
+
open: isPanelOpen,
|
|
264
|
+
onClose: closePanel,
|
|
265
|
+
direction: "bottom",
|
|
266
|
+
closeButtonLabel,
|
|
267
|
+
zIndex,
|
|
268
|
+
snapPoints,
|
|
269
|
+
defaultSnapPoint,
|
|
270
|
+
snapPoint,
|
|
271
|
+
onSnapPointChange,
|
|
272
|
+
snapToSequentialPoints,
|
|
273
|
+
actions,
|
|
274
|
+
actionsInHeader,
|
|
275
|
+
"aria-labelledby": effectiveAriaLabelledBy,
|
|
276
|
+
"aria-label": ariaLabel,
|
|
277
|
+
children: [
|
|
278
|
+
header ?? (shouldRenderActionsHeader ? /* @__PURE__ */ jsx6(
|
|
279
|
+
PanelMobileActionsHeader,
|
|
280
|
+
{
|
|
281
|
+
title,
|
|
282
|
+
titleId,
|
|
283
|
+
actions
|
|
284
|
+
}
|
|
285
|
+
) : /* @__PURE__ */ jsx6(Drawer2.Header, { title, id: titleId })),
|
|
286
|
+
children,
|
|
287
|
+
footer
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
) });
|
|
291
|
+
}
|
|
292
|
+
return /* @__PURE__ */ jsx6(PanelContext.Provider, { value: enrichedValue, children: /* @__PURE__ */ jsx6(
|
|
293
|
+
PanelContainer,
|
|
294
|
+
{
|
|
295
|
+
...rest,
|
|
296
|
+
$isOpen: isPanelOpen,
|
|
297
|
+
$direction: direction,
|
|
298
|
+
$width: width,
|
|
299
|
+
$gap: gap,
|
|
300
|
+
"data-qa-panel": id,
|
|
301
|
+
"data-qa-panel-isopen": isPanelOpen,
|
|
302
|
+
"aria-labelledby": effectiveAriaLabelledBy,
|
|
303
|
+
"aria-label": ariaLabel,
|
|
304
|
+
children: /* @__PURE__ */ jsxs3(PanelInner, { $direction: direction, $width: width, children: [
|
|
305
|
+
header ?? /* @__PURE__ */ jsx6(PanelHeader, { title, id: titleId }),
|
|
306
|
+
renderedChildren,
|
|
307
|
+
footer
|
|
308
|
+
] })
|
|
309
|
+
}
|
|
310
|
+
) });
|
|
311
|
+
};
|
|
312
|
+
PanelComponent.Header = PanelHeader;
|
|
313
|
+
PanelComponent.Content = PanelContent;
|
|
314
|
+
PanelComponent.CloseButton = PanelCloseButton;
|
|
315
|
+
PanelComponent.Footer = PanelFooter;
|
|
316
|
+
var Panel_default = PanelComponent;
|
|
317
|
+
|
|
318
|
+
// src/PanelProvider.tsx
|
|
319
|
+
import * as React7 from "react";
|
|
320
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
321
|
+
var PanelProvider = ({
|
|
322
|
+
children,
|
|
323
|
+
defaultOpen = false,
|
|
324
|
+
open: controlledOpen,
|
|
325
|
+
onOpenChange
|
|
326
|
+
}) => {
|
|
327
|
+
const [internalOpen, setInternalOpen] = React7.useState(defaultOpen);
|
|
328
|
+
const isControlled = controlledOpen !== void 0;
|
|
329
|
+
const isPanelOpen = isControlled ? controlledOpen : internalOpen;
|
|
330
|
+
const setOpen = React7.useCallback(
|
|
331
|
+
(next) => {
|
|
332
|
+
if (!isControlled) setInternalOpen(next);
|
|
333
|
+
onOpenChange?.(next);
|
|
334
|
+
},
|
|
335
|
+
[isControlled, onOpenChange]
|
|
336
|
+
);
|
|
337
|
+
const openPanel = React7.useCallback(() => setOpen(true), [setOpen]);
|
|
338
|
+
const closePanel = React7.useCallback(() => setOpen(false), [setOpen]);
|
|
339
|
+
const togglePanel = React7.useCallback(
|
|
340
|
+
() => setOpen(!isPanelOpen),
|
|
341
|
+
[setOpen, isPanelOpen]
|
|
342
|
+
);
|
|
343
|
+
const value = React7.useMemo(
|
|
344
|
+
() => ({ isPanelOpen, openPanel, closePanel, togglePanel }),
|
|
345
|
+
[isPanelOpen, openPanel, closePanel, togglePanel]
|
|
346
|
+
);
|
|
347
|
+
return /* @__PURE__ */ jsx7(PanelContext.Provider, { value, children });
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
// src/PanelTypes.ts
|
|
351
|
+
import "react";
|
|
352
|
+
|
|
353
|
+
// src/index.ts
|
|
354
|
+
var index_default = Panel_default;
|
|
355
|
+
export {
|
|
356
|
+
Panel_default as Panel,
|
|
357
|
+
PanelCloseButton,
|
|
358
|
+
PanelContent,
|
|
359
|
+
PanelContext,
|
|
360
|
+
PanelFooter,
|
|
361
|
+
PanelHeader,
|
|
362
|
+
PanelProvider,
|
|
363
|
+
index_default as default,
|
|
364
|
+
usePanelContext
|
|
365
|
+
};
|
|
366
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Panel.tsx","../../src/PanelContext.tsx","../../src/PanelHeader.tsx","../../src/PanelCloseButton.tsx","../../src/PanelContent.tsx","../../src/styles.ts","../../src/PanelFooter.tsx","../../src/PanelMobileActionsHeader.tsx","../../src/PanelProvider.tsx","../../src/PanelTypes.ts","../../src/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport Drawer from \"@sproutsocial/seeds-react-drawer\";\nimport { useIsMobile } from \"@sproutsocial/seeds-react-hooks\";\nimport { usePanelContext, PanelContext } from \"./PanelContext\";\nimport { PanelHeader } from \"./PanelHeader\";\nimport { PanelContent } from \"./PanelContent\";\nimport { PanelCloseButton } from \"./PanelCloseButton\";\nimport { PanelFooter } from \"./PanelFooter\";\nimport { PanelMobileActionsHeader } from \"./PanelMobileActionsHeader\";\nimport { PanelContainer, PanelInner } from \"./styles\";\nimport type { TypePanelProps, TypePanelContext } from \"./PanelTypes\";\n\nconst PanelComponent = ({\n children,\n closeButtonLabel,\n header,\n footer,\n title,\n titleId,\n direction = \"right\",\n width = 384,\n gap = 4,\n mobileBreakpoint,\n zIndex,\n id,\n snapPoints,\n defaultSnapPoint,\n snapPoint,\n onSnapPointChange,\n snapToSequentialPoints,\n actions,\n actionsInHeader,\n \"aria-labelledby\": ariaLabelledByProp,\n \"aria-label\": ariaLabel,\n ...rest\n}: TypePanelProps) => {\n const panelContext = usePanelContext();\n const { isPanelOpen, closePanel } = panelContext;\n const isMobile = useIsMobile(mobileBreakpoint);\n\n // Expose closeButtonLabel through context so PanelCloseButton can read it\n // without prop drilling — same pattern as DrawerContext.\n const enrichedValue = React.useMemo<TypePanelContext>(\n () => ({ ...panelContext, closeButtonLabel }),\n [panelContext, closeButtonLabel]\n );\n\n // Freeze the last-rendered children during the collapse so consumers that\n // conditionally render content don't produce an empty panel shell while the\n // flex-basis animation runs.\n const prevChildrenRef = React.useRef<React.ReactNode>(null);\n if (isPanelOpen) {\n prevChildrenRef.current = children;\n }\n const renderedChildren = isPanelOpen ? children : prevChildrenRef.current;\n\n // When the consumer relies on the default header, its title element renders\n // with `id={titleId}`. Auto-wire `aria-labelledby` so the dialog/aside has an\n // accessible name without forcing every caller to repeat the id.\n const effectiveAriaLabelledBy =\n ariaLabelledByProp ?? (header == null ? titleId : undefined);\n\n if (isMobile) {\n // With `actionsInHeader`, Drawer suppresses the floating rail and expects\n // the consumer to render the actions inside a custom header. Auto-compose\n // one (title + action pills + close pill) when the consumer hasn't\n // supplied their own header; otherwise we'd drop `actions` on the floor.\n const shouldRenderActionsHeader =\n header == null &&\n actionsInHeader === true &&\n !!actions &&\n actions.length > 0;\n\n return (\n <PanelContext.Provider value={enrichedValue}>\n <Drawer\n {...rest}\n open={isPanelOpen}\n onClose={closePanel}\n direction=\"bottom\"\n closeButtonLabel={closeButtonLabel}\n zIndex={zIndex}\n snapPoints={snapPoints}\n defaultSnapPoint={defaultSnapPoint}\n snapPoint={snapPoint}\n onSnapPointChange={onSnapPointChange}\n snapToSequentialPoints={snapToSequentialPoints}\n actions={actions}\n actionsInHeader={actionsInHeader}\n aria-labelledby={effectiveAriaLabelledBy}\n aria-label={ariaLabel}\n >\n {header ??\n (shouldRenderActionsHeader ? (\n <PanelMobileActionsHeader\n title={title}\n titleId={titleId}\n actions={actions!}\n />\n ) : (\n <Drawer.Header title={title} id={titleId} />\n ))}\n {children}\n {footer}\n </Drawer>\n </PanelContext.Provider>\n );\n }\n\n return (\n <PanelContext.Provider value={enrichedValue}>\n <PanelContainer\n {...rest}\n $isOpen={isPanelOpen}\n $direction={direction}\n $width={width}\n $gap={gap}\n data-qa-panel={id}\n data-qa-panel-isopen={isPanelOpen}\n aria-labelledby={effectiveAriaLabelledBy}\n aria-label={ariaLabel}\n >\n <PanelInner $direction={direction} $width={width}>\n {header ?? <PanelHeader title={title} id={titleId} />}\n {renderedChildren}\n {footer}\n </PanelInner>\n </PanelContainer>\n </PanelContext.Provider>\n );\n};\n\nPanelComponent.Header = PanelHeader;\nPanelComponent.Content = PanelContent;\nPanelComponent.CloseButton = PanelCloseButton;\nPanelComponent.Footer = PanelFooter;\n\nexport const Panel = PanelComponent;\nexport default PanelComponent;\n","import * as React from \"react\";\nimport type { TypePanelContext } from \"./PanelTypes\";\n\nexport const PanelContext = React.createContext<TypePanelContext | null>(null);\n\nexport const usePanelContext = (): TypePanelContext => {\n const ctx = React.useContext(PanelContext);\n if (!ctx) {\n throw new Error(\n \"usePanelContext must be used within a <PanelProvider>. Wrap the consuming tree in <PanelProvider> to provide isPanelOpen / togglePanel.\"\n );\n }\n return ctx;\n};\n","import Box from \"@sproutsocial/seeds-react-box\";\nimport Text from \"@sproutsocial/seeds-react-text\";\nimport { usePanelContext } from \"./PanelContext\";\nimport { PanelCloseButton } from \"./PanelCloseButton\";\nimport type { TypePanelHeaderProps } from \"./PanelTypes\";\n\nexport const PanelHeader = ({\n title = \"\",\n id = undefined,\n children,\n render,\n ...rest\n}: TypePanelHeaderProps) => {\n const panelContext = usePanelContext();\n\n if (render) {\n return render(panelContext);\n }\n\n return (\n <Box\n display=\"flex\"\n flex=\"0 0 auto\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n p={400}\n borderBottom=\"1px solid\"\n borderColor=\"container.border.base\"\n {...rest}\n >\n {children || (\n <>\n <Text.Headline id={id}>{title}</Text.Headline>\n <PanelCloseButton />\n </>\n )}\n </Box>\n );\n};\n\nPanelHeader.displayName = \"Panel.Header\";\n","import * as React from \"react\";\nimport Button from \"@sproutsocial/seeds-react-button\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\nimport { usePanelContext } from \"./PanelContext\";\nimport type { TypePanelCloseButtonProps } from \"./PanelTypes\";\n\nexport const PanelCloseButton = (props: TypePanelCloseButtonProps) => {\n const panelContext = usePanelContext();\n\n if (props.render) {\n return props.render(panelContext) ?? null;\n }\n\n return (\n <Button\n appearance=\"pill\"\n aria-label={panelContext.closeButtonLabel}\n onClick={panelContext.closePanel}\n {...props}\n >\n {props.children || <Icon aria-hidden name=\"x-outline\" />}\n </Button>\n );\n};\n\nPanelCloseButton.displayName = \"Panel.CloseButton\";\n","import * as React from \"react\";\nimport { Content } from \"./styles\";\nimport type { TypePanelContentProps } from \"./PanelTypes\";\n\nexport const PanelContent = ({ children, ...rest }: TypePanelContentProps) => (\n <Content\n flex=\"1 1 auto\"\n minHeight=\"0\"\n p={450}\n color=\"text.body\"\n data-panel-content=\"\"\n {...rest}\n >\n {children}\n </Content>\n);\n\nPanelContent.displayName = \"Panel.Content\";\n","import styled, { css } from \"styled-components\";\nimport { COMMON } from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeSystemCommonProps } from \"@sproutsocial/seeds-react-system-props\";\nimport { MOTION_DURATION_MEDIUM } from \"@sproutsocial/seeds-motion/unitless\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport type { PanelDirection } from \"./PanelTypes\";\n\ninterface PanelContainerProps extends TypeSystemCommonProps {\n $isOpen: boolean;\n $direction: PanelDirection;\n $width: number;\n $gap: number;\n}\n\nconst gapSide = (direction: PanelDirection): \"left\" | \"right\" | \"top\" => {\n if (direction === \"right\") return \"left\";\n if (direction === \"left\") return \"right\";\n return \"top\";\n};\n\nexport const PanelContainer = styled.aside<PanelContainerProps>`\n background: ${(props) => props.theme.colors.container.background.base};\n flex-grow: 0;\n flex-shrink: 0;\n overflow: hidden;\n transition: flex-basis ${MOTION_DURATION_MEDIUM}s ease-in-out,\n margin ${MOTION_DURATION_MEDIUM}s ease-in-out;\n flex-basis: ${(props) => (props.$isOpen ? `${props.$width}px` : \"0px\")};\n margin-${(props) => gapSide(props.$direction)}: ${(props) =>\n props.$isOpen && props.$gap ? `${props.$gap}px` : \"0px\"};\n border-radius: ${({ theme }) => theme.radii[800]};\n\n ${(props) =>\n props.$direction === \"bottom\"\n ? css`\n width: 100%;\n `\n : css`\n height: 100%;\n `}\n\n ${COMMON}\n`;\n\nexport const PanelInner = styled.div<{\n $direction: PanelDirection;\n $width: number;\n}>`\n ${(props) =>\n props.$direction === \"bottom\"\n ? css`\n min-height: ${props.$width}px;\n width: 100%;\n `\n : css`\n min-width: ${props.$width}px;\n height: 100%;\n `}\n display: flex;\n flex-direction: column;\n overflow: hidden;\n`;\n\nexport const Content = styled(Box)`\n overflow-y: auto;\n`;\n\nexport const Footer = styled(Box)`\n flex: 0 0 auto;\n overflow: hidden;\n`;\n","import * as React from \"react\";\nimport { Footer } from \"./styles\";\nimport type { TypePanelFooterProps } from \"./PanelTypes\";\n\nexport const PanelFooter = ({ children, ...rest }: TypePanelFooterProps) => (\n <Footer p={450} data-panel-footer=\"\" {...rest}>\n {children}\n </Footer>\n);\n\nPanelFooter.displayName = \"Panel.Footer\";\n","import * as React from \"react\";\nimport Box from \"@sproutsocial/seeds-react-box\";\nimport Button from \"@sproutsocial/seeds-react-button\";\nimport Drawer from \"@sproutsocial/seeds-react-drawer\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\n// eslint-disable-next-line import/no-deprecated\nimport Text from \"@sproutsocial/seeds-react-text\";\nimport type { TypeDrawerActionProps } from \"@sproutsocial/seeds-react-drawer\";\n\ninterface TypePanelMobileActionsHeaderProps {\n title?: string;\n titleId?: string;\n actions: TypeDrawerActionProps[];\n}\n\n/**\n * Mobile bottom-sheet header used by Panel when `actionsInHeader` is set and\n * no custom `header` is provided. Renders the title on the left and the\n * forwarded actions plus a close button as pills on the right — mirrors the\n * pattern in `seeds-react-peek-in/PeekIn.tsx`. The Drawer's floating rail is\n * suppressed in this combination (`actionsInHeader` opts out), so without this\n * header the actions would render nowhere.\n */\nexport const PanelMobileActionsHeader = ({\n title,\n titleId,\n actions,\n}: TypePanelMobileActionsHeaderProps) => (\n <Drawer.Header\n render={(ctx) => (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n pt={400}\n px={450}\n flex=\"0 0 auto\"\n >\n <Text\n as=\"h2\"\n fontSize={400}\n fontWeight=\"semibold\"\n color=\"text.headline\"\n id={titleId}\n >\n {title}\n </Text>\n <Box display=\"flex\" alignItems=\"center\" gap={200}>\n {actions.map((action, i) => (\n <Button\n key={i}\n appearance=\"pill\"\n aria-label={action[\"aria-label\"]}\n onClick={action.onClick}\n disabled={action.disabled}\n >\n {action.iconName && <Icon aria-hidden name={action.iconName} />}\n </Button>\n ))}\n <Button\n appearance=\"pill\"\n aria-label={ctx.closeButtonLabel}\n onClick={ctx.onClose}\n >\n <Icon aria-hidden name=\"x-outline\" />\n </Button>\n </Box>\n </Box>\n )}\n />\n);\n\nPanelMobileActionsHeader.displayName = \"PanelMobileActionsHeader\";\n","import * as React from \"react\";\nimport { PanelContext } from \"./PanelContext\";\nimport type { TypePanelContext, TypePanelProviderProps } from \"./PanelTypes\";\n\nexport const PanelProvider = ({\n children,\n defaultOpen = false,\n open: controlledOpen,\n onOpenChange,\n}: TypePanelProviderProps) => {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const isPanelOpen = isControlled ? controlledOpen : internalOpen;\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange]\n );\n\n const openPanel = React.useCallback(() => setOpen(true), [setOpen]);\n const closePanel = React.useCallback(() => setOpen(false), [setOpen]);\n const togglePanel = React.useCallback(\n () => setOpen(!isPanelOpen),\n [setOpen, isPanelOpen]\n );\n\n const value = React.useMemo<TypePanelContext>(\n () => ({ isPanelOpen, openPanel, closePanel, togglePanel }),\n [isPanelOpen, openPanel, closePanel, togglePanel]\n );\n\n return (\n <PanelContext.Provider value={value}>{children}</PanelContext.Provider>\n );\n};\n","import * as React from \"react\";\nimport type {\n TypeSystemCommonProps,\n TypeStyledComponentsCommonProps,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport type { TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport type { TypeButtonProps } from \"@sproutsocial/seeds-react-button\";\nimport type {\n TypeDrawerSnapPoint,\n TypeDrawerActionProps,\n} from \"@sproutsocial/seeds-react-drawer\";\n\nexport type { TypeDrawerActionProps as TypePanelActionProps };\n\nexport type PanelDirection = \"left\" | \"right\" | \"bottom\";\n\nexport interface TypePanelContext {\n isPanelOpen: boolean;\n togglePanel: () => void;\n openPanel: () => void;\n closePanel: () => void;\n closeButtonLabel?: string;\n}\n\nexport interface TypePanelProviderProps {\n children: React.ReactNode;\n /** Initial open state for uncontrolled usage. */\n defaultOpen?: boolean;\n /** Controlled open state. When provided, the provider becomes controlled. */\n open?: boolean;\n /** Called whenever the open state changes. Required for controlled usage. */\n onOpenChange?: (open: boolean) => void;\n}\n\nexport interface TypePanelProps\n extends TypeStyledComponentsCommonProps,\n TypeSystemCommonProps,\n Omit<React.ComponentPropsWithoutRef<\"div\">, \"color\"> {\n children: React.ReactNode;\n\n /** Label for the close button. Usually \"Close\". */\n closeButtonLabel: string;\n\n /**\n * Custom header content. When provided, replaces the auto-rendered default\n * header entirely — `title` and `titleId` are ignored.\n */\n header?: React.ReactNode;\n\n /** Custom footer content. Not rendered when omitted. */\n footer?: React.ReactNode;\n\n /** Title shown in the auto-rendered default header. Ignored when `header` is provided. */\n title?: string;\n\n /**\n * Sets the `id` on the title element of the auto-rendered header. When the\n * default header is used, Panel automatically wires `aria-labelledby` to this\n * id so the dialog/aside has an accessible name. Pass an explicit\n * `aria-labelledby` to override (e.g. when pointing at a different element).\n * Ignored when `header` is provided — supply your own `aria-labelledby` in\n * that case.\n */\n titleId?: string;\n\n /** Side the panel anchors to on desktop. Defaults to \"right\". */\n direction?: PanelDirection;\n\n /**\n * Width (px) when direction is \"left\" or \"right\", or height (px) when\n * direction is \"bottom\". Defaults to 384 to match the existing web-app-core\n * Panel.\n */\n width?: number;\n\n /**\n * Visual gap (px) between the panel and the adjacent content. Applied as\n * margin on the side facing the content (left when direction=\"right\",\n * right when direction=\"left\", top when direction=\"bottom\"). Animates with\n * the panel's open/close transition and collapses to 0 when closed so the\n * gap does not remain visible alongside a zero-width panel. Defaults to 0.\n */\n gap?: number;\n\n /**\n * Forwarded to `useIsMobile`. Accepts a px number or any CSS media-query\n * length. Below this width, the panel renders as an overlay bottom sheet\n * (via seeds-react-drawer). Defaults to the theme's `breakpoints.sm`.\n */\n mobileBreakpoint?: number | string;\n\n /** Applies only to the mobile bottom-sheet rendering. */\n zIndex?: number;\n\n /** Optional id used for data-qa-panel attributes. */\n id?: string;\n\n /**\n * Snap points the panel can rest at when rendered as a mobile bottom sheet.\n * Numbers 0–1 are viewport-height fractions; numbers > 1 are pixels; strings\n * accept `px`/`rem` (e.g. `\"480px\"`, `\"30rem\"`). Order matters — the last\n * entry is the \"expanded\" state. Ignored on the desktop side-panel rendering.\n */\n snapPoints?: TypeDrawerSnapPoint[];\n\n /** Initial snap point for uncontrolled use. Mobile only. */\n defaultSnapPoint?: TypeDrawerSnapPoint | null;\n\n /** Controlled active snap point. Pair with `onSnapPointChange`. Mobile only. */\n snapPoint?: TypeDrawerSnapPoint | null;\n\n /** Fires when the active snap point changes. Mobile only. */\n onSnapPointChange?: (snapPoint: TypeDrawerSnapPoint | null) => void;\n\n /**\n * When true, fast swipes can't skip past adjacent snap points. Mobile only.\n */\n snapToSequentialPoints?: boolean;\n\n /**\n * Action buttons shown in a floating rail above the panel on mobile (the\n * bottom-sheet rendering). Ignored on desktop side-panel rendering — pass\n * actions through `header`/`footer` slots there. The rail owns the close\n * button so the default header omits its built-in close affordance.\n */\n actions?: TypeDrawerActionProps[];\n\n /**\n * Opt out of the floating mobile rail and render the `actions` inline in the\n * header as pill buttons instead. Useful for nested bottom sheets and\n * snap-point layouts where the floating rail would collide with surrounding\n * UI. Defaults to `false`.\n *\n * When `header` is omitted, Panel auto-composes a mobile header that renders\n * the title, the `actions` as pills, and a close-button pill. When `header`\n * is provided, the consumer is responsible for rendering the actions inside\n * their own header — `actions` is forwarded for context only.\n */\n actionsInHeader?: boolean;\n}\n\nexport interface TypePanelHeaderProps extends TypeBoxProps {\n title?: string;\n /**\n * When children are provided, `<Panel.CloseButton />` is NOT rendered\n * automatically. Include it yourself to preserve keyboard accessibility.\n */\n children?: React.ReactNode;\n /** Render-prop override that receives the parent panel context. */\n render?: React.FC<TypePanelContext>;\n}\n\nexport interface TypePanelContentProps extends TypeBoxProps {\n children?: React.ReactNode;\n}\n\nexport interface TypePanelFooterProps extends TypeBoxProps {\n children?: React.ReactNode;\n}\n\nexport interface TypePanelCloseButtonProps\n extends Omit<TypeButtonProps, \"children\"> {\n /** Render-prop override that receives the parent panel context. */\n render?: React.FC<TypePanelContext>;\n children?: React.ReactNode;\n}\n","import Panel from \"./Panel\";\n\nexport default Panel;\nexport { Panel };\nexport { PanelContext, usePanelContext } from \"./PanelContext\";\nexport { PanelProvider } from \"./PanelProvider\";\nexport { PanelHeader } from \"./PanelHeader\";\nexport { PanelContent } from \"./PanelContent\";\nexport { PanelCloseButton } from \"./PanelCloseButton\";\nexport { PanelFooter } from \"./PanelFooter\";\nexport * from \"./PanelTypes\";\n"],"mappings":";AAAA,YAAYA,YAAW;AACvB,OAAOC,aAAY;AACnB,SAAS,mBAAmB;;;ACF5B,YAAY,WAAW;AAGhB,IAAM,eAAqB,oBAAuC,IAAI;AAEtE,IAAM,kBAAkB,MAAwB;AACrD,QAAM,MAAY,iBAAW,YAAY;AACzC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;;;ACbA,OAAO,SAAS;AAChB,OAAO,UAAU;;;ACDjB,OAAuB;AACvB,OAAO,YAAY;AACnB,OAAO,UAAU;AAkBQ;AAdlB,IAAM,mBAAmB,CAAC,UAAqC;AACpE,QAAM,eAAe,gBAAgB;AAErC,MAAI,MAAM,QAAQ;AAChB,WAAO,MAAM,OAAO,YAAY,KAAK;AAAA,EACvC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX,cAAY,aAAa;AAAA,MACzB,SAAS,aAAa;AAAA,MACrB,GAAG;AAAA,MAEH,gBAAM,YAAY,oBAAC,QAAK,eAAW,MAAC,MAAK,aAAY;AAAA;AAAA,EACxD;AAEJ;AAEA,iBAAiB,cAAc;;;ADMvB,mBACE,OAAAC,MADF;AAzBD,IAAM,cAAc,CAAC;AAAA,EAC1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