@sproutsocial/seeds-react-panel 1.0.11 → 1.1.2

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/dist/index.js CHANGED
@@ -42,10 +42,8 @@ __export(index_exports, {
42
42
  });
43
43
  module.exports = __toCommonJS(index_exports);
44
44
 
45
- // src/Panel.tsx
46
- var React6 = __toESM(require("react"));
47
- var import_seeds_react_drawer2 = __toESM(require("@sproutsocial/seeds-react-drawer"));
48
- var import_seeds_react_hooks = require("@sproutsocial/seeds-react-hooks");
45
+ // src/PanelHybrid.tsx
46
+ var import_seeds_react_system_props4 = require("@sproutsocial/seeds-react-system-props");
49
47
 
50
48
  // src/PanelContext.tsx
51
49
  var React = __toESM(require("react"));
@@ -63,6 +61,7 @@ var usePanelContext = () => {
63
61
  // src/PanelHeader.tsx
64
62
  var import_seeds_react_box = __toESM(require("@sproutsocial/seeds-react-box"));
65
63
  var import_seeds_react_text = __toESM(require("@sproutsocial/seeds-react-text"));
64
+ var import_seeds_react_system_props = require("@sproutsocial/seeds-react-system-props");
66
65
 
67
66
  // src/PanelCloseButton.tsx
68
67
  var React2 = require("react");
@@ -87,45 +86,173 @@ var PanelCloseButton = (props) => {
87
86
  };
88
87
  PanelCloseButton.displayName = "Panel.CloseButton";
89
88
 
89
+ // src/PanelShared.tsx
90
+ var React3 = __toESM(require("react"));
91
+ var import_seeds_react_hooks = require("@sproutsocial/seeds-react-hooks");
92
+ function cn(...inputs) {
93
+ const classes = [];
94
+ for (const input of inputs) {
95
+ if (!input) continue;
96
+ if (typeof input === "string") {
97
+ classes.push(input);
98
+ } else if (typeof input === "object") {
99
+ for (const [key, value] of Object.entries(input)) {
100
+ if (value) {
101
+ classes.push(key);
102
+ }
103
+ }
104
+ }
105
+ }
106
+ return classes.join(" ");
107
+ }
108
+ var getPanelContainerStyle = (direction, width, gap, isPanelOpen) => {
109
+ const gapValue = isPanelOpen && gap ? `${gap}px` : "0px";
110
+ const style = {
111
+ flexBasis: isPanelOpen ? `${width}px` : "0px"
112
+ };
113
+ if (direction === "bottom") {
114
+ style.width = "100%";
115
+ } else {
116
+ style.alignSelf = "stretch";
117
+ }
118
+ if (direction === "right") {
119
+ style.marginLeft = gapValue;
120
+ } else if (direction === "left") {
121
+ style.marginRight = gapValue;
122
+ } else {
123
+ style.marginTop = gapValue;
124
+ }
125
+ return style;
126
+ };
127
+ var getPanelInnerStyle = (direction, width) => direction === "bottom" ? { minHeight: `${width}px`, width: "100%" } : { minWidth: `${width}px`, height: "100%" };
128
+ var usePanelShell = (props) => {
129
+ const {
130
+ children,
131
+ closeButtonLabel,
132
+ header,
133
+ headerless = false,
134
+ footer,
135
+ title,
136
+ titleId,
137
+ direction = "right",
138
+ width = 384,
139
+ gap = 4,
140
+ mobileBreakpoint,
141
+ zIndex,
142
+ id,
143
+ snapPoints,
144
+ defaultSnapPoint,
145
+ snapPoint,
146
+ onSnapPointChange,
147
+ snapToSequentialPoints,
148
+ actions,
149
+ actionsInHeader,
150
+ "aria-labelledby": ariaLabelledByProp,
151
+ "aria-label": ariaLabel,
152
+ ...rest
153
+ } = props;
154
+ const panelContext = usePanelContext();
155
+ const { isPanelOpen, closePanel } = panelContext;
156
+ const isMobile = (0, import_seeds_react_hooks.useIsMobile)(mobileBreakpoint);
157
+ const enrichedValue = React3.useMemo(
158
+ () => ({ ...panelContext, closeButtonLabel, headerless }),
159
+ [panelContext, closeButtonLabel, headerless]
160
+ );
161
+ const prevChildrenRef = React3.useRef(null);
162
+ if (isPanelOpen) {
163
+ prevChildrenRef.current = children;
164
+ }
165
+ const renderedChildren = isPanelOpen ? children : prevChildrenRef.current;
166
+ const effectiveAriaLabelledBy = ariaLabelledByProp ?? (!headerless && header == null ? titleId : void 0);
167
+ return {
168
+ rest,
169
+ children,
170
+ closeButtonLabel,
171
+ header,
172
+ headerless,
173
+ footer,
174
+ title,
175
+ titleId,
176
+ direction,
177
+ width,
178
+ gap,
179
+ zIndex,
180
+ id,
181
+ snapPoints,
182
+ defaultSnapPoint,
183
+ snapPoint,
184
+ onSnapPointChange,
185
+ snapToSequentialPoints,
186
+ actions,
187
+ actionsInHeader,
188
+ ariaLabel,
189
+ isPanelOpen,
190
+ closePanel,
191
+ isMobile,
192
+ enrichedValue,
193
+ renderedChildren,
194
+ effectiveAriaLabelledBy
195
+ };
196
+ };
197
+
90
198
  // src/PanelHeader.tsx
91
199
  var import_jsx_runtime2 = require("react/jsx-runtime");
92
- var PanelHeader = ({
200
+ var PanelHeaderStyled = ({
201
+ title = "",
202
+ id = void 0,
203
+ children,
204
+ render,
205
+ ...rest
206
+ }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
207
+ import_seeds_react_box.default,
208
+ {
209
+ display: "flex",
210
+ flex: "0 0 auto",
211
+ justifyContent: "space-between",
212
+ alignItems: "center",
213
+ p: 400,
214
+ borderBottom: "1px solid",
215
+ borderColor: "container.border.base",
216
+ ...rest,
217
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
218
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.default.Headline, { id, children: title }),
219
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PanelCloseButton, {})
220
+ ] })
221
+ }
222
+ );
223
+ var PanelHeaderTailwind = ({
93
224
  title = "",
94
225
  id = void 0,
95
226
  children,
96
227
  render,
97
228
  ...rest
98
229
  }) => {
230
+ const { className, ...domRest } = rest;
231
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("seeds-panel-header", className), ...domRest, children: children || /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
232
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.default.Headline, { id, children: title }),
233
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PanelCloseButton, {})
234
+ ] }) });
235
+ };
236
+ var PanelHeader = (props) => {
99
237
  const panelContext = usePanelContext();
100
- if (render) {
101
- return render(panelContext);
238
+ if (props.render) {
239
+ return props.render(panelContext);
102
240
  }
103
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
104
- import_seeds_react_box.default,
105
- {
106
- display: "flex",
107
- flex: "0 0 auto",
108
- justifyContent: "space-between",
109
- alignItems: "center",
110
- p: 400,
111
- borderBottom: "1px solid",
112
- borderColor: "container.border.base",
113
- ...rest,
114
- children: children || /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
115
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.default.Headline, { id, children: title }),
116
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PanelCloseButton, {})
117
- ] })
118
- }
119
- );
241
+ const { title, id, children, render, ...rest } = props;
242
+ if ((0, import_seeds_react_system_props.needsStyledComponents)(rest)) {
243
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PanelHeaderStyled, { ...props });
244
+ }
245
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PanelHeaderTailwind, { ...props });
120
246
  };
121
247
  PanelHeader.displayName = "Panel.Header";
122
248
 
123
249
  // src/PanelContent.tsx
124
- var React3 = require("react");
250
+ var React4 = require("react");
251
+ var import_seeds_react_system_props3 = require("@sproutsocial/seeds-react-system-props");
125
252
 
126
253
  // src/styles.ts
127
254
  var import_styled_components = __toESM(require("styled-components"));
128
- var import_seeds_react_system_props = require("@sproutsocial/seeds-react-system-props");
255
+ var import_seeds_react_system_props2 = require("@sproutsocial/seeds-react-system-props");
129
256
  var import_unitless = require("@sproutsocial/seeds-motion/unitless");
130
257
  var import_seeds_react_box2 = __toESM(require("@sproutsocial/seeds-react-box"));
131
258
  var gapSide = (direction) => {
@@ -150,7 +277,7 @@ var PanelContainer = import_styled_components.default.aside`
150
277
  align-self: stretch;
151
278
  `}
152
279
 
153
- ${import_seeds_react_system_props.COMMON}
280
+ ${import_seeds_react_system_props2.COMMON}
154
281
  `;
155
282
  var PanelInner = import_styled_components.default.div`
156
283
  ${(props) => props.$direction === "bottom" ? import_styled_components.css`
@@ -193,7 +320,7 @@ var Footer = (0, import_styled_components.default)(import_seeds_react_box2.defau
193
320
 
194
321
  // src/PanelContent.tsx
195
322
  var import_jsx_runtime3 = require("react/jsx-runtime");
196
- var PanelContent = ({ children, ...rest }) => {
323
+ var PanelContentStyled = ({ children, ...rest }) => {
197
324
  const { headerless } = usePanelContext();
198
325
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
199
326
  Content,
@@ -209,157 +336,188 @@ var PanelContent = ({ children, ...rest }) => {
209
336
  }
210
337
  );
211
338
  };
339
+ var PanelContentTailwind = ({ children, ...rest }) => {
340
+ const { headerless } = usePanelContext();
341
+ const scroll = !headerless;
342
+ const { className, style, ...domRest } = rest;
343
+ const contentStyle = {
344
+ overflowY: scroll ? "auto" : "hidden"
345
+ };
346
+ if (!scroll) {
347
+ contentStyle.display = "flex";
348
+ contentStyle.flexDirection = "column";
349
+ }
350
+ Object.assign(contentStyle, style);
351
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
352
+ "div",
353
+ {
354
+ className: cn(
355
+ "seeds-panel-content",
356
+ { "seeds-panel-content--headerless": !!headerless },
357
+ className
358
+ ),
359
+ style: contentStyle,
360
+ "data-panel-content": "",
361
+ ...domRest,
362
+ children
363
+ }
364
+ );
365
+ };
366
+ var PanelContent = (props) => {
367
+ const { children, ...rest } = props;
368
+ if ((0, import_seeds_react_system_props3.needsStyledComponents)(rest)) {
369
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PanelContentStyled, { ...props });
370
+ }
371
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PanelContentTailwind, { ...props });
372
+ };
212
373
  PanelContent.displayName = "Panel.Content";
213
374
 
214
- // src/PanelFooter.tsx
215
- var React4 = require("react");
216
- var import_jsx_runtime4 = require("react/jsx-runtime");
217
- var PanelFooter = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Footer, { p: 450, "data-panel-footer": "", ...rest, children });
218
- PanelFooter.displayName = "Panel.Footer";
375
+ // src/PanelMobile.tsx
376
+ var React6 = require("react");
377
+ var import_seeds_react_drawer2 = __toESM(require("@sproutsocial/seeds-react-drawer"));
219
378
 
220
379
  // src/PanelMobileActionsHeader.tsx
221
380
  var React5 = require("react");
222
- var import_seeds_react_box3 = __toESM(require("@sproutsocial/seeds-react-box"));
223
381
  var import_seeds_react_button2 = __toESM(require("@sproutsocial/seeds-react-button"));
224
382
  var import_seeds_react_drawer = __toESM(require("@sproutsocial/seeds-react-drawer"));
225
383
  var import_seeds_react_icon2 = __toESM(require("@sproutsocial/seeds-react-icon"));
226
384
  var import_seeds_react_text2 = __toESM(require("@sproutsocial/seeds-react-text"));
227
- var import_jsx_runtime5 = require("react/jsx-runtime");
385
+ var import_jsx_runtime4 = require("react/jsx-runtime");
228
386
  var PanelMobileActionsHeader = ({
229
387
  title,
230
388
  titleId,
231
389
  actions
232
- }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
390
+ }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
233
391
  import_seeds_react_drawer.default.Header,
234
392
  {
235
- render: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
236
- import_seeds_react_box3.default,
237
- {
238
- display: "flex",
239
- alignItems: "center",
240
- justifyContent: "space-between",
241
- pt: 400,
242
- px: 450,
243
- flex: "0 0 auto",
244
- children: [
245
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
246
- import_seeds_react_text2.default,
247
- {
248
- as: "h2",
249
- fontSize: 400,
250
- fontWeight: "semibold",
251
- color: "text.headline",
252
- id: titleId,
253
- children: title
254
- }
255
- ),
256
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_seeds_react_box3.default, { display: "flex", alignItems: "center", gap: 200, children: [
257
- actions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
258
- import_seeds_react_button2.default,
259
- {
260
- appearance: "pill",
261
- "aria-label": action["aria-label"],
262
- onClick: action.onClick,
263
- disabled: action.disabled,
264
- children: action.iconName && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_seeds_react_icon2.default, { "aria-hidden": true, name: action.iconName })
265
- },
266
- i
267
- )),
268
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
269
- import_seeds_react_button2.default,
270
- {
271
- appearance: "pill",
272
- "aria-label": ctx.closeButtonLabel,
273
- onClick: ctx.onClose,
274
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_seeds_react_icon2.default, { "aria-hidden": true, name: "x-outline" })
275
- }
276
- )
277
- ] })
278
- ]
279
- }
280
- )
393
+ render: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "seeds-panel-mobile-actions-header", children: [
394
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
395
+ import_seeds_react_text2.default,
396
+ {
397
+ as: "h2",
398
+ fontSize: 400,
399
+ fontWeight: "semibold",
400
+ color: "text.headline",
401
+ id: titleId,
402
+ children: title
403
+ }
404
+ ),
405
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "seeds-panel-mobile-actions-buttons", children: [
406
+ actions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
407
+ import_seeds_react_button2.default,
408
+ {
409
+ appearance: "pill",
410
+ "aria-label": action["aria-label"],
411
+ onClick: action.onClick,
412
+ disabled: action.disabled,
413
+ children: action.iconName && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_icon2.default, { "aria-hidden": true, name: action.iconName })
414
+ },
415
+ i
416
+ )),
417
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
418
+ import_seeds_react_button2.default,
419
+ {
420
+ appearance: "pill",
421
+ "aria-label": ctx.closeButtonLabel,
422
+ onClick: ctx.onClose,
423
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_icon2.default, { "aria-hidden": true, name: "x-outline" })
424
+ }
425
+ )
426
+ ] })
427
+ ] })
281
428
  }
282
429
  );
283
430
  PanelMobileActionsHeader.displayName = "PanelMobileActionsHeader";
284
431
 
285
- // src/Panel.tsx
286
- var import_jsx_runtime6 = require("react/jsx-runtime");
287
- var PanelComponent = ({
288
- children,
289
- closeButtonLabel,
290
- header,
291
- headerless = false,
292
- footer,
293
- title,
294
- titleId,
295
- direction = "right",
296
- width = 384,
297
- gap = 4,
298
- mobileBreakpoint,
299
- zIndex,
300
- id,
301
- snapPoints,
302
- defaultSnapPoint,
303
- snapPoint,
304
- onSnapPointChange,
305
- snapToSequentialPoints,
306
- actions,
307
- actionsInHeader,
308
- "aria-labelledby": ariaLabelledByProp,
309
- "aria-label": ariaLabel,
310
- ...rest
311
- }) => {
312
- const panelContext = usePanelContext();
313
- const { isPanelOpen, closePanel } = panelContext;
314
- const isMobile = (0, import_seeds_react_hooks.useIsMobile)(mobileBreakpoint);
315
- const enrichedValue = React6.useMemo(
316
- () => ({ ...panelContext, closeButtonLabel, headerless }),
317
- [panelContext, closeButtonLabel, headerless]
318
- );
319
- const prevChildrenRef = React6.useRef(null);
320
- if (isPanelOpen) {
321
- prevChildrenRef.current = children;
322
- }
323
- const renderedChildren = isPanelOpen ? children : prevChildrenRef.current;
324
- const effectiveAriaLabelledBy = ariaLabelledByProp ?? (!headerless && header == null ? titleId : void 0);
325
- if (isMobile) {
326
- const shouldRenderActionsHeader = !headerless && header == null && actionsInHeader === true && !!actions && actions.length > 0;
327
- let defaultMobileHeader = null;
328
- if (!headerless) {
329
- defaultMobileHeader = shouldRenderActionsHeader ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
330
- PanelMobileActionsHeader,
331
- {
332
- title,
333
- titleId,
334
- actions
335
- }
336
- ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_seeds_react_drawer2.default.Header, { title, id: titleId });
337
- }
338
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelContext.Provider, { value: enrichedValue, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
339
- import_seeds_react_drawer2.default,
432
+ // src/PanelMobile.tsx
433
+ var import_jsx_runtime5 = require("react/jsx-runtime");
434
+ var PanelMobile = ({ shell }) => {
435
+ const {
436
+ rest,
437
+ children,
438
+ closeButtonLabel,
439
+ header,
440
+ headerless,
441
+ footer,
442
+ title,
443
+ titleId,
444
+ zIndex,
445
+ snapPoints,
446
+ defaultSnapPoint,
447
+ snapPoint,
448
+ onSnapPointChange,
449
+ snapToSequentialPoints,
450
+ actions,
451
+ actionsInHeader,
452
+ ariaLabel,
453
+ isPanelOpen,
454
+ closePanel,
455
+ enrichedValue,
456
+ effectiveAriaLabelledBy
457
+ } = shell;
458
+ const shouldRenderActionsHeader = !headerless && header == null && actionsInHeader === true && !!actions && actions.length > 0;
459
+ let defaultMobileHeader = null;
460
+ if (!headerless) {
461
+ defaultMobileHeader = shouldRenderActionsHeader ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
462
+ PanelMobileActionsHeader,
340
463
  {
341
- ...rest,
342
- open: isPanelOpen,
343
- onClose: closePanel,
344
- direction: "bottom",
345
- closeButtonLabel,
346
- zIndex,
347
- snapPoints,
348
- defaultSnapPoint,
349
- snapPoint,
350
- onSnapPointChange,
351
- snapToSequentialPoints,
352
- actions,
353
- actionsInHeader,
354
- "aria-labelledby": effectiveAriaLabelledBy,
355
- "aria-label": ariaLabel,
356
- children: [
357
- header ?? defaultMobileHeader,
358
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelContent, { children }),
359
- footer
360
- ]
464
+ title,
465
+ titleId,
466
+ actions
361
467
  }
362
- ) });
468
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_seeds_react_drawer2.default.Header, { title, id: titleId });
469
+ }
470
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelContext.Provider, { value: enrichedValue, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
471
+ import_seeds_react_drawer2.default,
472
+ {
473
+ ...rest,
474
+ open: isPanelOpen,
475
+ onClose: closePanel,
476
+ direction: "bottom",
477
+ closeButtonLabel,
478
+ zIndex,
479
+ snapPoints,
480
+ defaultSnapPoint,
481
+ snapPoint,
482
+ onSnapPointChange,
483
+ snapToSequentialPoints,
484
+ actions,
485
+ actionsInHeader,
486
+ "aria-labelledby": effectiveAriaLabelledBy,
487
+ "aria-label": ariaLabel,
488
+ children: [
489
+ header ?? defaultMobileHeader,
490
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelContent, { children }),
491
+ footer
492
+ ]
493
+ }
494
+ ) });
495
+ };
496
+
497
+ // src/PanelStyled.tsx
498
+ var import_jsx_runtime6 = require("react/jsx-runtime");
499
+ var PanelStyled = (props) => {
500
+ const shell = usePanelShell(props);
501
+ const {
502
+ rest,
503
+ header,
504
+ headerless,
505
+ footer,
506
+ title,
507
+ titleId,
508
+ direction,
509
+ width,
510
+ gap,
511
+ id,
512
+ ariaLabel,
513
+ isPanelOpen,
514
+ isMobile,
515
+ enrichedValue,
516
+ renderedChildren,
517
+ effectiveAriaLabelledBy
518
+ } = shell;
519
+ if (isMobile) {
520
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelMobile, { shell });
363
521
  }
364
522
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelContext.Provider, { value: enrichedValue, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
365
523
  PanelContainer,
@@ -381,6 +539,126 @@ var PanelComponent = ({
381
539
  }
382
540
  ) });
383
541
  };
542
+
543
+ // src/PanelTailwind.tsx
544
+ var React7 = require("react");
545
+ var import_jsx_runtime7 = require("react/jsx-runtime");
546
+ var PanelTailwind = (props) => {
547
+ const shell = usePanelShell(props);
548
+ const {
549
+ rest,
550
+ header,
551
+ headerless,
552
+ footer,
553
+ title,
554
+ titleId,
555
+ direction,
556
+ width,
557
+ gap,
558
+ id,
559
+ ariaLabel,
560
+ isPanelOpen,
561
+ isMobile,
562
+ enrichedValue,
563
+ renderedChildren,
564
+ effectiveAriaLabelledBy
565
+ } = shell;
566
+ if (isMobile) {
567
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PanelMobile, { shell });
568
+ }
569
+ const { className, style, ...domRest } = rest;
570
+ const containerStyle = getPanelContainerStyle(
571
+ direction,
572
+ width,
573
+ gap,
574
+ isPanelOpen
575
+ );
576
+ const innerStyle = getPanelInnerStyle(direction, width);
577
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PanelContext.Provider, { value: enrichedValue, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
578
+ "aside",
579
+ {
580
+ ...domRest,
581
+ className: cn("seeds-panel", className),
582
+ style: { ...containerStyle, ...style },
583
+ "data-qa-panel": id,
584
+ "data-qa-panel-isopen": isPanelOpen,
585
+ "aria-labelledby": effectiveAriaLabelledBy,
586
+ "aria-label": ariaLabel,
587
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "seeds-panel-inner", style: innerStyle, children: [
588
+ header ?? (headerless ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PanelHeader, { title, id: titleId })),
589
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PanelContent, { children: renderedChildren }),
590
+ footer
591
+ ] })
592
+ }
593
+ ) });
594
+ };
595
+
596
+ // src/PanelHybrid.tsx
597
+ var import_jsx_runtime8 = require("react/jsx-runtime");
598
+ var PanelHybrid = (props) => {
599
+ const {
600
+ children,
601
+ closeButtonLabel,
602
+ header,
603
+ headerless,
604
+ footer,
605
+ title,
606
+ titleId,
607
+ direction,
608
+ width,
609
+ gap,
610
+ mobileBreakpoint,
611
+ zIndex,
612
+ id,
613
+ snapPoints,
614
+ defaultSnapPoint,
615
+ snapPoint,
616
+ onSnapPointChange,
617
+ snapToSequentialPoints,
618
+ actions,
619
+ actionsInHeader,
620
+ "aria-labelledby": ariaLabelledBy,
621
+ "aria-label": ariaLabel,
622
+ ...rest
623
+ } = props;
624
+ if ((0, import_seeds_react_system_props4.needsStyledComponents)(rest)) {
625
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PanelStyled, { ...props });
626
+ }
627
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PanelTailwind, { ...props });
628
+ };
629
+ PanelHybrid.displayName = "Panel";
630
+
631
+ // src/PanelFooter.tsx
632
+ var React8 = require("react");
633
+ var import_seeds_react_system_props5 = require("@sproutsocial/seeds-react-system-props");
634
+ var import_jsx_runtime9 = require("react/jsx-runtime");
635
+ var PanelFooterStyled = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Footer, { p: 450, "data-panel-footer": "", ...rest, children });
636
+ var PanelFooterTailwind = ({ children, ...rest }) => {
637
+ const { className, style, ...domRest } = rest;
638
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
639
+ "div",
640
+ {
641
+ className: cn("seeds-panel-footer", className),
642
+ style: { marginBottom: "var(--bleed, 0px)", ...style },
643
+ "data-panel-footer": "",
644
+ ...domRest,
645
+ children
646
+ }
647
+ );
648
+ };
649
+ var PanelFooter = (props) => {
650
+ const { children, ...rest } = props;
651
+ if ((0, import_seeds_react_system_props5.needsStyledComponents)(rest)) {
652
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PanelFooterStyled, { ...props });
653
+ }
654
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PanelFooterTailwind, { ...props });
655
+ };
656
+ PanelFooter.displayName = "Panel.Footer";
657
+
658
+ // src/Panel.tsx
659
+ var import_jsx_runtime10 = require("react/jsx-runtime");
660
+ var PanelComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PanelHybrid, { ...props });
661
+ PanelComponent.displayName = "Panel";
384
662
  PanelComponent.Header = PanelHeader;
385
663
  PanelComponent.Content = PanelContent;
386
664
  PanelComponent.CloseButton = PanelCloseButton;
@@ -388,39 +666,39 @@ PanelComponent.Footer = PanelFooter;
388
666
  var Panel_default = PanelComponent;
389
667
 
390
668
  // src/PanelProvider.tsx
391
- var React7 = __toESM(require("react"));
392
- var import_jsx_runtime7 = require("react/jsx-runtime");
669
+ var React9 = __toESM(require("react"));
670
+ var import_jsx_runtime11 = require("react/jsx-runtime");
393
671
  var PanelProvider = ({
394
672
  children,
395
673
  defaultOpen = false,
396
674
  open: controlledOpen,
397
675
  onOpenChange
398
676
  }) => {
399
- const [internalOpen, setInternalOpen] = React7.useState(defaultOpen);
677
+ const [internalOpen, setInternalOpen] = React9.useState(defaultOpen);
400
678
  const isControlled = controlledOpen !== void 0;
401
679
  const isPanelOpen = isControlled ? controlledOpen : internalOpen;
402
- const setOpen = React7.useCallback(
680
+ const setOpen = React9.useCallback(
403
681
  (next) => {
404
682
  if (!isControlled) setInternalOpen(next);
405
683
  onOpenChange?.(next);
406
684
  },
407
685
  [isControlled, onOpenChange]
408
686
  );
409
- const openPanel = React7.useCallback(() => setOpen(true), [setOpen]);
410
- const closePanel = React7.useCallback(() => setOpen(false), [setOpen]);
411
- const togglePanel = React7.useCallback(
687
+ const openPanel = React9.useCallback(() => setOpen(true), [setOpen]);
688
+ const closePanel = React9.useCallback(() => setOpen(false), [setOpen]);
689
+ const togglePanel = React9.useCallback(
412
690
  () => setOpen(!isPanelOpen),
413
691
  [setOpen, isPanelOpen]
414
692
  );
415
- const value = React7.useMemo(
693
+ const value = React9.useMemo(
416
694
  () => ({ isPanelOpen, openPanel, closePanel, togglePanel }),
417
695
  [isPanelOpen, openPanel, closePanel, togglePanel]
418
696
  );
419
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PanelContext.Provider, { value, children });
697
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PanelContext.Provider, { value, children });
420
698
  };
421
699
 
422
700
  // src/PanelTypes.ts
423
- var React8 = require("react");
701
+ var React10 = require("react");
424
702
 
425
703
  // src/index.ts
426
704
  var index_default = Panel_default;