@primer/react 0.0.0-20260219181613 → 0.0.0-20260219184403
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/CHANGELOG.md +16 -4
- package/dist/ActionList/ActionList-c04a02d6.css +2 -0
- package/dist/ActionList/ActionList-c04a02d6.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +1 -0
- package/dist/Blankslate/{Blankslate-f5a9755a.css → Blankslate-a039d79a.css} +2 -2
- package/dist/Blankslate/Blankslate-a039d79a.css.map +1 -0
- package/dist/Blankslate/Blankslate.module.css.js +1 -1
- package/dist/PageLayout/PageLayout-06f4c069.css +2 -0
- package/dist/PageLayout/PageLayout-06f4c069.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +72 -2
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +497 -44
- package/dist/PageLayout/PageLayout.module.css.js +2 -2
- package/dist/PageLayout/usePaneWidth.d.ts +18 -5
- package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
- package/dist/PageLayout/usePaneWidth.js +125 -111
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +82 -32
- package/dist/SplitPageLayout/SplitPageLayout.d.ts +4 -1
- package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +1 -1
- package/dist/SplitPageLayout/SplitPageLayout.js +54 -2
- package/generated/components.json +188 -2
- package/package.json +1 -1
- package/dist/ActionList/ActionList-f4ac3b54.css +0 -2
- package/dist/ActionList/ActionList-f4ac3b54.css.map +0 -1
- package/dist/Blankslate/Blankslate-f5a9755a.css.map +0 -1
- package/dist/PageLayout/PageLayout-cb491b47.css +0 -2
- package/dist/PageLayout/PageLayout-cb491b47.css.map +0 -1
|
@@ -24,12 +24,18 @@ const PageLayoutContext = /*#__PURE__*/React.createContext({
|
|
|
24
24
|
},
|
|
25
25
|
contentWrapperRef: {
|
|
26
26
|
current: null
|
|
27
|
+
},
|
|
28
|
+
sidebarRef: {
|
|
29
|
+
current: null
|
|
30
|
+
},
|
|
31
|
+
sidebarContentWrapperRef: {
|
|
32
|
+
current: null
|
|
27
33
|
}
|
|
28
34
|
});
|
|
29
35
|
|
|
30
36
|
// TODO: refs
|
|
31
37
|
const Root = t0 => {
|
|
32
|
-
const $ = c(
|
|
38
|
+
const $ = c(24);
|
|
33
39
|
const {
|
|
34
40
|
containerWidth: t1,
|
|
35
41
|
padding: t2,
|
|
@@ -46,11 +52,14 @@ const Root = t0 => {
|
|
|
46
52
|
const columnGap = t4 === undefined ? "normal" : t4;
|
|
47
53
|
const paneRef = useRef(null);
|
|
48
54
|
const contentWrapperRef = useRef(null);
|
|
55
|
+
const sidebarRef = useRef(null);
|
|
56
|
+
const sidebarContentWrapperRef = useRef(null);
|
|
49
57
|
let t5;
|
|
50
58
|
if ($[0] !== slotsConfig) {
|
|
51
59
|
t5 = slotsConfig !== null && slotsConfig !== void 0 ? slotsConfig : {
|
|
52
60
|
header: Header,
|
|
53
|
-
footer: Footer
|
|
61
|
+
footer: Footer,
|
|
62
|
+
sidebar: Sidebar
|
|
54
63
|
};
|
|
55
64
|
$[0] = slotsConfig;
|
|
56
65
|
$[1] = t5;
|
|
@@ -65,7 +74,9 @@ const Root = t0 => {
|
|
|
65
74
|
rowGap,
|
|
66
75
|
columnGap,
|
|
67
76
|
paneRef,
|
|
68
|
-
contentWrapperRef
|
|
77
|
+
contentWrapperRef,
|
|
78
|
+
sidebarRef,
|
|
79
|
+
sidebarContentWrapperRef
|
|
69
80
|
};
|
|
70
81
|
$[2] = columnGap;
|
|
71
82
|
$[3] = padding;
|
|
@@ -75,77 +86,84 @@ const Root = t0 => {
|
|
|
75
86
|
t6 = $[5];
|
|
76
87
|
}
|
|
77
88
|
const memoizedContextValue = t6;
|
|
78
|
-
const t7 = slots.
|
|
79
|
-
|
|
89
|
+
const t7 = !!slots.sidebar;
|
|
90
|
+
const t8 = slots.sidebar;
|
|
91
|
+
const t9 = slots.header;
|
|
92
|
+
let t10;
|
|
80
93
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
81
|
-
|
|
82
|
-
$[6] =
|
|
94
|
+
t10 = clsx(classes.PageLayoutContent);
|
|
95
|
+
$[6] = t10;
|
|
83
96
|
} else {
|
|
84
|
-
|
|
97
|
+
t10 = $[6];
|
|
85
98
|
}
|
|
86
|
-
let
|
|
99
|
+
let t11;
|
|
87
100
|
if ($[7] !== rest) {
|
|
88
|
-
|
|
89
|
-
className:
|
|
101
|
+
t11 = /*#__PURE__*/jsx("div", {
|
|
102
|
+
className: t10,
|
|
90
103
|
children: rest
|
|
91
104
|
});
|
|
92
105
|
$[7] = rest;
|
|
93
|
-
$[8] =
|
|
106
|
+
$[8] = t11;
|
|
94
107
|
} else {
|
|
95
|
-
|
|
108
|
+
t11 = $[8];
|
|
96
109
|
}
|
|
97
|
-
let
|
|
98
|
-
if ($[9] !== containerWidth || $[10] !== slots.footer || $[11] !== slots.header || $[12] !==
|
|
99
|
-
|
|
110
|
+
let t12;
|
|
111
|
+
if ($[9] !== containerWidth || $[10] !== slots.footer || $[11] !== slots.header || $[12] !== t11) {
|
|
112
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
113
|
+
ref: sidebarContentWrapperRef,
|
|
100
114
|
className: classes.PageLayoutWrapper,
|
|
101
115
|
"data-width": containerWidth,
|
|
102
|
-
children: [
|
|
116
|
+
children: [t9, t11, slots.footer]
|
|
103
117
|
});
|
|
104
118
|
$[9] = containerWidth;
|
|
105
119
|
$[10] = slots.footer;
|
|
106
120
|
$[11] = slots.header;
|
|
107
|
-
$[12] =
|
|
108
|
-
$[13] =
|
|
121
|
+
$[12] = t11;
|
|
122
|
+
$[13] = t12;
|
|
109
123
|
} else {
|
|
110
|
-
|
|
124
|
+
t12 = $[13];
|
|
111
125
|
}
|
|
112
|
-
let
|
|
113
|
-
if ($[14] !== className || $[15] !== padding || $[16] !==
|
|
114
|
-
|
|
126
|
+
let t13;
|
|
127
|
+
if ($[14] !== className || $[15] !== padding || $[16] !== slots.sidebar || $[17] !== style || $[18] !== t12 || $[19] !== t7) {
|
|
128
|
+
t13 = /*#__PURE__*/jsxs(RootWrapper, {
|
|
115
129
|
style: style,
|
|
116
130
|
padding: padding,
|
|
117
131
|
className: className,
|
|
118
|
-
|
|
132
|
+
hasSidebar: t7,
|
|
133
|
+
children: [t8, t12]
|
|
119
134
|
});
|
|
120
135
|
$[14] = className;
|
|
121
136
|
$[15] = padding;
|
|
122
|
-
$[16] =
|
|
123
|
-
$[17] =
|
|
124
|
-
$[18] =
|
|
137
|
+
$[16] = slots.sidebar;
|
|
138
|
+
$[17] = style;
|
|
139
|
+
$[18] = t12;
|
|
140
|
+
$[19] = t7;
|
|
141
|
+
$[20] = t13;
|
|
125
142
|
} else {
|
|
126
|
-
|
|
143
|
+
t13 = $[20];
|
|
127
144
|
}
|
|
128
|
-
let
|
|
129
|
-
if ($[
|
|
130
|
-
|
|
145
|
+
let t14;
|
|
146
|
+
if ($[21] !== memoizedContextValue || $[22] !== t13) {
|
|
147
|
+
t14 = /*#__PURE__*/jsx(PageLayoutContext.Provider, {
|
|
131
148
|
value: memoizedContextValue,
|
|
132
|
-
children:
|
|
149
|
+
children: t13
|
|
133
150
|
});
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
151
|
+
$[21] = memoizedContextValue;
|
|
152
|
+
$[22] = t13;
|
|
153
|
+
$[23] = t14;
|
|
137
154
|
} else {
|
|
138
|
-
|
|
155
|
+
t14 = $[23];
|
|
139
156
|
}
|
|
140
|
-
return
|
|
157
|
+
return t14;
|
|
141
158
|
};
|
|
142
159
|
const RootWrapper = /*#__PURE__*/memo(t0 => {
|
|
143
|
-
const $ = c(
|
|
160
|
+
const $ = c(10);
|
|
144
161
|
const {
|
|
145
162
|
style,
|
|
146
163
|
padding,
|
|
147
164
|
children,
|
|
148
|
-
className
|
|
165
|
+
className,
|
|
166
|
+
hasSidebar
|
|
149
167
|
} = t0;
|
|
150
168
|
const t1 = `var(--spacing-${padding})`;
|
|
151
169
|
let t2;
|
|
@@ -169,21 +187,24 @@ const RootWrapper = /*#__PURE__*/memo(t0 => {
|
|
|
169
187
|
} else {
|
|
170
188
|
t4 = $[4];
|
|
171
189
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
190
|
+
const t5 = hasSidebar || undefined;
|
|
191
|
+
let t6;
|
|
192
|
+
if ($[5] !== children || $[6] !== t3 || $[7] !== t4 || $[8] !== t5) {
|
|
193
|
+
t6 = /*#__PURE__*/jsx("div", {
|
|
175
194
|
style: t3,
|
|
176
195
|
className: t4,
|
|
196
|
+
"data-has-sidebar": t5,
|
|
177
197
|
children: children
|
|
178
198
|
});
|
|
179
199
|
$[5] = children;
|
|
180
200
|
$[6] = t3;
|
|
181
201
|
$[7] = t4;
|
|
182
202
|
$[8] = t5;
|
|
203
|
+
$[9] = t6;
|
|
183
204
|
} else {
|
|
184
|
-
|
|
205
|
+
t6 = $[9];
|
|
185
206
|
}
|
|
186
|
-
return
|
|
207
|
+
return t6;
|
|
187
208
|
});
|
|
188
209
|
Root.displayName = 'PageLayout';
|
|
189
210
|
|
|
@@ -314,6 +335,137 @@ const VerticalDivider = /*#__PURE__*/memo(t0 => {
|
|
|
314
335
|
return t5;
|
|
315
336
|
});
|
|
316
337
|
VerticalDivider.displayName = 'VerticalDivider';
|
|
338
|
+
const SidebarDivider = /*#__PURE__*/memo(function SidebarDivider(t0) {
|
|
339
|
+
const $ = c(22);
|
|
340
|
+
const {
|
|
341
|
+
position,
|
|
342
|
+
divider,
|
|
343
|
+
resizable,
|
|
344
|
+
minPaneWidth,
|
|
345
|
+
maxPaneWidth,
|
|
346
|
+
currentWidth,
|
|
347
|
+
currentWidthRef,
|
|
348
|
+
handleRef,
|
|
349
|
+
sidebarRef,
|
|
350
|
+
dragStartClientXRef,
|
|
351
|
+
dragStartWidthRef,
|
|
352
|
+
dragMaxWidthRef,
|
|
353
|
+
getMaxPaneWidth,
|
|
354
|
+
getDefaultWidth,
|
|
355
|
+
saveWidth
|
|
356
|
+
} = t0;
|
|
357
|
+
const {
|
|
358
|
+
columnGap
|
|
359
|
+
} = React.useContext(PageLayoutContext);
|
|
360
|
+
const t1 = resizable ? "line" : divider;
|
|
361
|
+
const t2 = `var(--spacing-${columnGap})`;
|
|
362
|
+
let t3;
|
|
363
|
+
if ($[0] !== t2) {
|
|
364
|
+
t3 = {
|
|
365
|
+
"--spacing": t2
|
|
366
|
+
};
|
|
367
|
+
$[0] = t2;
|
|
368
|
+
$[1] = t3;
|
|
369
|
+
} else {
|
|
370
|
+
t3 = $[1];
|
|
371
|
+
}
|
|
372
|
+
const t4 = t3;
|
|
373
|
+
let t5;
|
|
374
|
+
if ($[2] !== currentWidth || $[3] !== currentWidthRef || $[4] !== dragMaxWidthRef || $[5] !== dragStartClientXRef || $[6] !== dragStartWidthRef || $[7] !== getDefaultWidth || $[8] !== getMaxPaneWidth || $[9] !== handleRef || $[10] !== maxPaneWidth || $[11] !== minPaneWidth || $[12] !== position || $[13] !== resizable || $[14] !== saveWidth || $[15] !== sidebarRef) {
|
|
375
|
+
t5 = resizable ? /*#__PURE__*/jsx(DragHandle, {
|
|
376
|
+
handleRef: handleRef,
|
|
377
|
+
"aria-valuemin": minPaneWidth,
|
|
378
|
+
"aria-valuemax": maxPaneWidth,
|
|
379
|
+
"aria-valuenow": currentWidth,
|
|
380
|
+
onDragStart: clientX => {
|
|
381
|
+
var _sidebarRef$current$g, _sidebarRef$current;
|
|
382
|
+
dragStartClientXRef.current = clientX;
|
|
383
|
+
dragStartWidthRef.current = (_sidebarRef$current$g = (_sidebarRef$current = sidebarRef.current) === null || _sidebarRef$current === void 0 ? void 0 : _sidebarRef$current.getBoundingClientRect().width) !== null && _sidebarRef$current$g !== void 0 ? _sidebarRef$current$g : currentWidthRef.current;
|
|
384
|
+
dragMaxWidthRef.current = getMaxPaneWidth();
|
|
385
|
+
},
|
|
386
|
+
onDrag: (value, isKeyboard) => {
|
|
387
|
+
const maxWidth = isKeyboard ? getMaxPaneWidth() : dragMaxWidthRef.current;
|
|
388
|
+
if (isKeyboard) {
|
|
389
|
+
const delta = position === "end" ? -value : value;
|
|
390
|
+
const newWidth = Math.max(minPaneWidth, Math.min(maxWidth, currentWidthRef.current + delta));
|
|
391
|
+
if (newWidth !== currentWidthRef.current) {
|
|
392
|
+
var _sidebarRef$current2;
|
|
393
|
+
currentWidthRef.current = newWidth;
|
|
394
|
+
(_sidebarRef$current2 = sidebarRef.current) === null || _sidebarRef$current2 === void 0 ? void 0 : _sidebarRef$current2.style.setProperty("--pane-width", `${newWidth}px`);
|
|
395
|
+
updateAriaValues(handleRef.current, {
|
|
396
|
+
current: newWidth,
|
|
397
|
+
max: maxWidth
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
} else {
|
|
401
|
+
if (sidebarRef.current) {
|
|
402
|
+
const deltaX = value - dragStartClientXRef.current;
|
|
403
|
+
const directedDelta = position === "end" ? -deltaX : deltaX;
|
|
404
|
+
const newWidth_0 = dragStartWidthRef.current + directedDelta;
|
|
405
|
+
const clampedWidth = Math.max(minPaneWidth, Math.min(maxWidth, newWidth_0));
|
|
406
|
+
if (Math.round(clampedWidth) !== Math.round(currentWidthRef.current)) {
|
|
407
|
+
sidebarRef.current.style.setProperty("--pane-width", `${clampedWidth}px`);
|
|
408
|
+
currentWidthRef.current = clampedWidth;
|
|
409
|
+
updateAriaValues(handleRef.current, {
|
|
410
|
+
current: Math.round(clampedWidth),
|
|
411
|
+
max: maxWidth
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
onDragEnd: () => {
|
|
418
|
+
saveWidth(currentWidthRef.current);
|
|
419
|
+
},
|
|
420
|
+
onDoubleClick: () => {
|
|
421
|
+
const resetWidth = getDefaultWidth();
|
|
422
|
+
if (sidebarRef.current) {
|
|
423
|
+
sidebarRef.current.style.setProperty("--pane-width", `${resetWidth}px`);
|
|
424
|
+
currentWidthRef.current = resetWidth;
|
|
425
|
+
updateAriaValues(handleRef.current, {
|
|
426
|
+
current: resetWidth
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
saveWidth(resetWidth);
|
|
430
|
+
}
|
|
431
|
+
}) : null;
|
|
432
|
+
$[2] = currentWidth;
|
|
433
|
+
$[3] = currentWidthRef;
|
|
434
|
+
$[4] = dragMaxWidthRef;
|
|
435
|
+
$[5] = dragStartClientXRef;
|
|
436
|
+
$[6] = dragStartWidthRef;
|
|
437
|
+
$[7] = getDefaultWidth;
|
|
438
|
+
$[8] = getMaxPaneWidth;
|
|
439
|
+
$[9] = handleRef;
|
|
440
|
+
$[10] = maxPaneWidth;
|
|
441
|
+
$[11] = minPaneWidth;
|
|
442
|
+
$[12] = position;
|
|
443
|
+
$[13] = resizable;
|
|
444
|
+
$[14] = saveWidth;
|
|
445
|
+
$[15] = sidebarRef;
|
|
446
|
+
$[16] = t5;
|
|
447
|
+
} else {
|
|
448
|
+
t5 = $[16];
|
|
449
|
+
}
|
|
450
|
+
let t6;
|
|
451
|
+
if ($[17] !== position || $[18] !== t1 || $[19] !== t4 || $[20] !== t5) {
|
|
452
|
+
t6 = /*#__PURE__*/jsx(VerticalDivider, {
|
|
453
|
+
variant: t1,
|
|
454
|
+
position: position,
|
|
455
|
+
className: classes.SidebarVerticalDivider,
|
|
456
|
+
style: t4,
|
|
457
|
+
children: t5
|
|
458
|
+
});
|
|
459
|
+
$[17] = position;
|
|
460
|
+
$[18] = t1;
|
|
461
|
+
$[19] = t4;
|
|
462
|
+
$[20] = t5;
|
|
463
|
+
$[21] = t6;
|
|
464
|
+
} else {
|
|
465
|
+
t6 = $[21];
|
|
466
|
+
}
|
|
467
|
+
return t6;
|
|
468
|
+
});
|
|
317
469
|
/**
|
|
318
470
|
* DragHandle - handles all pointer and keyboard interactions for resizing
|
|
319
471
|
* ARIA values are set in JSX for SSR accessibility,
|
|
@@ -1252,6 +1404,305 @@ Pane.displayName = 'PageLayout.Pane';
|
|
|
1252
1404
|
// ----------------------------------------------------------------------------
|
|
1253
1405
|
// PageLayout.Footer
|
|
1254
1406
|
|
|
1407
|
+
// ----------------------------------------------------------------------------
|
|
1408
|
+
// PageLayout.Sidebar
|
|
1409
|
+
|
|
1410
|
+
const Sidebar = /*#__PURE__*/React.forwardRef((t0, forwardRef) => {
|
|
1411
|
+
const $ = c(73);
|
|
1412
|
+
const {
|
|
1413
|
+
"aria-label": label,
|
|
1414
|
+
"aria-labelledby": labelledBy,
|
|
1415
|
+
position: t1,
|
|
1416
|
+
width: t2,
|
|
1417
|
+
minWidth: t3,
|
|
1418
|
+
padding: t4,
|
|
1419
|
+
resizable: t5,
|
|
1420
|
+
widthStorageKey,
|
|
1421
|
+
divider: t6,
|
|
1422
|
+
sticky: t7,
|
|
1423
|
+
responsiveVariant: t8,
|
|
1424
|
+
hidden: t9,
|
|
1425
|
+
children,
|
|
1426
|
+
id,
|
|
1427
|
+
className,
|
|
1428
|
+
style
|
|
1429
|
+
} = t0;
|
|
1430
|
+
const position = t1 === undefined ? "start" : t1;
|
|
1431
|
+
const width = t2 === undefined ? "medium" : t2;
|
|
1432
|
+
const minWidth = t3 === undefined ? 256 : t3;
|
|
1433
|
+
const padding = t4 === undefined ? "none" : t4;
|
|
1434
|
+
const resizable = t5 === undefined ? false : t5;
|
|
1435
|
+
const divider = t6 === undefined ? "none" : t6;
|
|
1436
|
+
const sticky = t7 === undefined ? false : t7;
|
|
1437
|
+
const responsiveVariant = t8 === undefined ? "default" : t8;
|
|
1438
|
+
const responsiveHidden = t9 === undefined ? false : t9;
|
|
1439
|
+
const {
|
|
1440
|
+
columnGap,
|
|
1441
|
+
sidebarRef,
|
|
1442
|
+
sidebarContentWrapperRef
|
|
1443
|
+
} = React.useContext(PageLayoutContext);
|
|
1444
|
+
const handleRef = React.useRef(null);
|
|
1445
|
+
const dragStartClientXRef = React.useRef(0);
|
|
1446
|
+
const dragStartWidthRef = React.useRef(0);
|
|
1447
|
+
const dragMaxWidthRef = React.useRef(0);
|
|
1448
|
+
let t10;
|
|
1449
|
+
if ($[0] !== minWidth || $[1] !== resizable || $[2] !== sidebarContentWrapperRef || $[3] !== sidebarRef || $[4] !== width || $[5] !== widthStorageKey) {
|
|
1450
|
+
t10 = {
|
|
1451
|
+
width,
|
|
1452
|
+
minWidth,
|
|
1453
|
+
resizable,
|
|
1454
|
+
widthStorageKey,
|
|
1455
|
+
paneRef: sidebarRef,
|
|
1456
|
+
handleRef,
|
|
1457
|
+
contentWrapperRef: sidebarContentWrapperRef,
|
|
1458
|
+
constrainToViewport: true
|
|
1459
|
+
};
|
|
1460
|
+
$[0] = minWidth;
|
|
1461
|
+
$[1] = resizable;
|
|
1462
|
+
$[2] = sidebarContentWrapperRef;
|
|
1463
|
+
$[3] = sidebarRef;
|
|
1464
|
+
$[4] = width;
|
|
1465
|
+
$[5] = widthStorageKey;
|
|
1466
|
+
$[6] = t10;
|
|
1467
|
+
} else {
|
|
1468
|
+
t10 = $[6];
|
|
1469
|
+
}
|
|
1470
|
+
const {
|
|
1471
|
+
currentWidth,
|
|
1472
|
+
currentWidthRef,
|
|
1473
|
+
minPaneWidth,
|
|
1474
|
+
maxPaneWidth,
|
|
1475
|
+
getMaxPaneWidth,
|
|
1476
|
+
saveWidth,
|
|
1477
|
+
getDefaultWidth
|
|
1478
|
+
} = usePaneWidth(t10);
|
|
1479
|
+
useRefObjectAsForwardedRef(forwardRef, sidebarRef);
|
|
1480
|
+
const hasOverflow = useOverflow(sidebarRef);
|
|
1481
|
+
const sidebarId = useId(id);
|
|
1482
|
+
let labelProp;
|
|
1483
|
+
if ($[7] !== hasOverflow || $[8] !== label || $[9] !== labelledBy) {
|
|
1484
|
+
labelProp = {};
|
|
1485
|
+
if (hasOverflow) {
|
|
1486
|
+
process.env.NODE_ENV !== "production" ? warning(label === undefined && labelledBy === undefined, "The <PageLayout.Sidebar> has overflow and `aria-label` or `aria-labelledby` has not been set. Please provide `aria-label` or `aria-labelledby` to <PageLayout.Sidebar> in order to label this region.") : void 0;
|
|
1487
|
+
if (labelledBy) {
|
|
1488
|
+
labelProp["aria-labelledby"] = labelledBy;
|
|
1489
|
+
} else {
|
|
1490
|
+
if (label) {
|
|
1491
|
+
labelProp["aria-label"] = label;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
$[7] = hasOverflow;
|
|
1496
|
+
$[8] = label;
|
|
1497
|
+
$[9] = labelledBy;
|
|
1498
|
+
$[10] = labelProp;
|
|
1499
|
+
} else {
|
|
1500
|
+
labelProp = $[10];
|
|
1501
|
+
}
|
|
1502
|
+
let t11;
|
|
1503
|
+
if ($[11] !== className) {
|
|
1504
|
+
t11 = clsx(classes.SidebarWrapper, className);
|
|
1505
|
+
$[11] = className;
|
|
1506
|
+
$[12] = t11;
|
|
1507
|
+
} else {
|
|
1508
|
+
t11 = $[12];
|
|
1509
|
+
}
|
|
1510
|
+
const t12 = `var(--spacing-${columnGap})`;
|
|
1511
|
+
let t13;
|
|
1512
|
+
if ($[13] !== style || $[14] !== t12) {
|
|
1513
|
+
t13 = {
|
|
1514
|
+
"--spacing-column": t12,
|
|
1515
|
+
...style
|
|
1516
|
+
};
|
|
1517
|
+
$[13] = style;
|
|
1518
|
+
$[14] = t12;
|
|
1519
|
+
$[15] = t13;
|
|
1520
|
+
} else {
|
|
1521
|
+
t13 = $[15];
|
|
1522
|
+
}
|
|
1523
|
+
const t14 = t13;
|
|
1524
|
+
let t15;
|
|
1525
|
+
if ($[16] !== responsiveHidden) {
|
|
1526
|
+
t15 = getResponsiveAttributes("is-hidden", responsiveHidden);
|
|
1527
|
+
$[16] = responsiveHidden;
|
|
1528
|
+
$[17] = t15;
|
|
1529
|
+
} else {
|
|
1530
|
+
t15 = $[17];
|
|
1531
|
+
}
|
|
1532
|
+
const t16 = sticky || undefined;
|
|
1533
|
+
const t17 = responsiveVariant !== "default" ? responsiveVariant : undefined;
|
|
1534
|
+
let t18;
|
|
1535
|
+
if ($[18] !== currentWidth || $[19] !== currentWidthRef || $[20] !== divider || $[21] !== getDefaultWidth || $[22] !== getMaxPaneWidth || $[23] !== maxPaneWidth || $[24] !== minPaneWidth || $[25] !== position || $[26] !== resizable || $[27] !== saveWidth || $[28] !== sidebarRef) {
|
|
1536
|
+
t18 = position === "end" && /*#__PURE__*/jsx(SidebarDivider, {
|
|
1537
|
+
position: position,
|
|
1538
|
+
divider: divider,
|
|
1539
|
+
resizable: resizable,
|
|
1540
|
+
minPaneWidth: minPaneWidth,
|
|
1541
|
+
maxPaneWidth: maxPaneWidth,
|
|
1542
|
+
currentWidth: currentWidth,
|
|
1543
|
+
currentWidthRef: currentWidthRef,
|
|
1544
|
+
handleRef: handleRef,
|
|
1545
|
+
sidebarRef: sidebarRef,
|
|
1546
|
+
dragStartClientXRef: dragStartClientXRef,
|
|
1547
|
+
dragStartWidthRef: dragStartWidthRef,
|
|
1548
|
+
dragMaxWidthRef: dragMaxWidthRef,
|
|
1549
|
+
getMaxPaneWidth: getMaxPaneWidth,
|
|
1550
|
+
getDefaultWidth: getDefaultWidth,
|
|
1551
|
+
saveWidth: saveWidth
|
|
1552
|
+
});
|
|
1553
|
+
$[18] = currentWidth;
|
|
1554
|
+
$[19] = currentWidthRef;
|
|
1555
|
+
$[20] = divider;
|
|
1556
|
+
$[21] = getDefaultWidth;
|
|
1557
|
+
$[22] = getMaxPaneWidth;
|
|
1558
|
+
$[23] = maxPaneWidth;
|
|
1559
|
+
$[24] = minPaneWidth;
|
|
1560
|
+
$[25] = position;
|
|
1561
|
+
$[26] = resizable;
|
|
1562
|
+
$[27] = saveWidth;
|
|
1563
|
+
$[28] = sidebarRef;
|
|
1564
|
+
$[29] = t18;
|
|
1565
|
+
} else {
|
|
1566
|
+
t18 = $[29];
|
|
1567
|
+
}
|
|
1568
|
+
const t19 = resizable === true && !!widthStorageKey;
|
|
1569
|
+
let t20;
|
|
1570
|
+
if ($[30] !== hasOverflow) {
|
|
1571
|
+
t20 = hasOverflow ? overflowProps : {};
|
|
1572
|
+
$[30] = hasOverflow;
|
|
1573
|
+
$[31] = t20;
|
|
1574
|
+
} else {
|
|
1575
|
+
t20 = $[31];
|
|
1576
|
+
}
|
|
1577
|
+
let t21;
|
|
1578
|
+
if ($[32] !== id || $[33] !== sidebarId) {
|
|
1579
|
+
t21 = id && {
|
|
1580
|
+
id: sidebarId
|
|
1581
|
+
};
|
|
1582
|
+
$[32] = id;
|
|
1583
|
+
$[33] = sidebarId;
|
|
1584
|
+
$[34] = t21;
|
|
1585
|
+
} else {
|
|
1586
|
+
t21 = $[34];
|
|
1587
|
+
}
|
|
1588
|
+
const t22 = resizable || undefined;
|
|
1589
|
+
const t23 = `var(--spacing-${padding})`;
|
|
1590
|
+
const t24 = isCustomWidthOptions(width) ? width.min : `${minWidth}px`;
|
|
1591
|
+
const t25 = isCustomWidthOptions(width) ? width.max : "calc(100vw - var(--sidebar-max-width-diff))";
|
|
1592
|
+
const t26 = isCustomWidthOptions(width) ? width.default : undefined;
|
|
1593
|
+
const t27 = `var(--pane-width-${isPaneWidth(width) ? width : "custom"})`;
|
|
1594
|
+
const t28 = `${currentWidth}px`;
|
|
1595
|
+
let t29;
|
|
1596
|
+
if ($[35] !== t23 || $[36] !== t24 || $[37] !== t25 || $[38] !== t26 || $[39] !== t27 || $[40] !== t28) {
|
|
1597
|
+
t29 = {
|
|
1598
|
+
"--spacing": t23,
|
|
1599
|
+
"--pane-min-width": t24,
|
|
1600
|
+
"--pane-max-width": t25,
|
|
1601
|
+
"--pane-width-custom": t26,
|
|
1602
|
+
"--pane-width-size": t27,
|
|
1603
|
+
"--pane-width": t28
|
|
1604
|
+
};
|
|
1605
|
+
$[35] = t23;
|
|
1606
|
+
$[36] = t24;
|
|
1607
|
+
$[37] = t25;
|
|
1608
|
+
$[38] = t26;
|
|
1609
|
+
$[39] = t27;
|
|
1610
|
+
$[40] = t28;
|
|
1611
|
+
$[41] = t29;
|
|
1612
|
+
} else {
|
|
1613
|
+
t29 = $[41];
|
|
1614
|
+
}
|
|
1615
|
+
const t30 = t29;
|
|
1616
|
+
let t31;
|
|
1617
|
+
if ($[42] !== children || $[43] !== labelProp || $[44] !== sidebarRef || $[45] !== t19 || $[46] !== t20 || $[47] !== t21 || $[48] !== t22 || $[49] !== t30) {
|
|
1618
|
+
t31 = /*#__PURE__*/jsx("div", {
|
|
1619
|
+
ref: sidebarRef,
|
|
1620
|
+
suppressHydrationWarning: t19,
|
|
1621
|
+
...t20,
|
|
1622
|
+
...labelProp,
|
|
1623
|
+
...t21,
|
|
1624
|
+
className: classes.Sidebar,
|
|
1625
|
+
"data-resizable": t22,
|
|
1626
|
+
style: t30,
|
|
1627
|
+
children: children
|
|
1628
|
+
});
|
|
1629
|
+
$[42] = children;
|
|
1630
|
+
$[43] = labelProp;
|
|
1631
|
+
$[44] = sidebarRef;
|
|
1632
|
+
$[45] = t19;
|
|
1633
|
+
$[46] = t20;
|
|
1634
|
+
$[47] = t21;
|
|
1635
|
+
$[48] = t22;
|
|
1636
|
+
$[49] = t30;
|
|
1637
|
+
$[50] = t31;
|
|
1638
|
+
} else {
|
|
1639
|
+
t31 = $[50];
|
|
1640
|
+
}
|
|
1641
|
+
let t32;
|
|
1642
|
+
if ($[51] !== currentWidth || $[52] !== currentWidthRef || $[53] !== divider || $[54] !== getDefaultWidth || $[55] !== getMaxPaneWidth || $[56] !== maxPaneWidth || $[57] !== minPaneWidth || $[58] !== position || $[59] !== resizable || $[60] !== saveWidth || $[61] !== sidebarRef) {
|
|
1643
|
+
t32 = position === "start" && /*#__PURE__*/jsx(SidebarDivider, {
|
|
1644
|
+
position: position,
|
|
1645
|
+
divider: divider,
|
|
1646
|
+
resizable: resizable,
|
|
1647
|
+
minPaneWidth: minPaneWidth,
|
|
1648
|
+
maxPaneWidth: maxPaneWidth,
|
|
1649
|
+
currentWidth: currentWidth,
|
|
1650
|
+
currentWidthRef: currentWidthRef,
|
|
1651
|
+
handleRef: handleRef,
|
|
1652
|
+
sidebarRef: sidebarRef,
|
|
1653
|
+
dragStartClientXRef: dragStartClientXRef,
|
|
1654
|
+
dragStartWidthRef: dragStartWidthRef,
|
|
1655
|
+
dragMaxWidthRef: dragMaxWidthRef,
|
|
1656
|
+
getMaxPaneWidth: getMaxPaneWidth,
|
|
1657
|
+
getDefaultWidth: getDefaultWidth,
|
|
1658
|
+
saveWidth: saveWidth
|
|
1659
|
+
});
|
|
1660
|
+
$[51] = currentWidth;
|
|
1661
|
+
$[52] = currentWidthRef;
|
|
1662
|
+
$[53] = divider;
|
|
1663
|
+
$[54] = getDefaultWidth;
|
|
1664
|
+
$[55] = getMaxPaneWidth;
|
|
1665
|
+
$[56] = maxPaneWidth;
|
|
1666
|
+
$[57] = minPaneWidth;
|
|
1667
|
+
$[58] = position;
|
|
1668
|
+
$[59] = resizable;
|
|
1669
|
+
$[60] = saveWidth;
|
|
1670
|
+
$[61] = sidebarRef;
|
|
1671
|
+
$[62] = t32;
|
|
1672
|
+
} else {
|
|
1673
|
+
t32 = $[62];
|
|
1674
|
+
}
|
|
1675
|
+
let t33;
|
|
1676
|
+
if ($[63] !== position || $[64] !== t11 || $[65] !== t14 || $[66] !== t15 || $[67] !== t16 || $[68] !== t17 || $[69] !== t18 || $[70] !== t31 || $[71] !== t32) {
|
|
1677
|
+
t33 = /*#__PURE__*/jsxs("div", {
|
|
1678
|
+
className: t11,
|
|
1679
|
+
style: t14,
|
|
1680
|
+
...t15,
|
|
1681
|
+
"data-position": position,
|
|
1682
|
+
"data-sticky": t16,
|
|
1683
|
+
"data-responsive-variant": t17,
|
|
1684
|
+
children: [t18, t31, t32]
|
|
1685
|
+
});
|
|
1686
|
+
$[63] = position;
|
|
1687
|
+
$[64] = t11;
|
|
1688
|
+
$[65] = t14;
|
|
1689
|
+
$[66] = t15;
|
|
1690
|
+
$[67] = t16;
|
|
1691
|
+
$[68] = t17;
|
|
1692
|
+
$[69] = t18;
|
|
1693
|
+
$[70] = t31;
|
|
1694
|
+
$[71] = t32;
|
|
1695
|
+
$[72] = t33;
|
|
1696
|
+
} else {
|
|
1697
|
+
t33 = $[72];
|
|
1698
|
+
}
|
|
1699
|
+
return t33;
|
|
1700
|
+
});
|
|
1701
|
+
Sidebar.displayName = 'PageLayout.Sidebar';
|
|
1702
|
+
|
|
1703
|
+
// ----------------------------------------------------------------------------
|
|
1704
|
+
// PageLayout.Footer
|
|
1705
|
+
|
|
1255
1706
|
const Footer = t0 => {
|
|
1256
1707
|
const $ = c(28);
|
|
1257
1708
|
const {
|
|
@@ -1398,11 +1849,13 @@ const PageLayout = Object.assign(Root, {
|
|
|
1398
1849
|
Header,
|
|
1399
1850
|
Content,
|
|
1400
1851
|
Pane: Pane,
|
|
1852
|
+
Sidebar: Sidebar,
|
|
1401
1853
|
Footer
|
|
1402
1854
|
});
|
|
1403
1855
|
Header.__SLOT__ = Symbol('PageLayout.Header');
|
|
1404
1856
|
Content.__SLOT__ = Symbol('PageLayout.Content');
|
|
1405
1857
|
Pane.__SLOT__ = Symbol('PageLayout.Pane');
|
|
1858
|
+
Sidebar.__SLOT__ = Symbol('PageLayout.Sidebar');
|
|
1406
1859
|
Footer.__SLOT__ = Symbol('PageLayout.Footer');
|
|
1407
1860
|
|
|
1408
1861
|
export { PageLayout };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './PageLayout-
|
|
1
|
+
import './PageLayout-06f4c069.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"paneMaxWidthDiffBreakpoint":"1280","paneMaxWidthDiffDefault":"511","PageLayoutRoot":"prc-PageLayout-PageLayoutRoot--KH-d","PageLayoutWrapper":"prc-PageLayout-PageLayoutWrapper-2BhU2","PageLayoutContent":"prc-PageLayout-PageLayoutContent-BneH9","HorizontalDivider":"prc-PageLayout-HorizontalDivider-JLVqp","VerticalDivider":"prc-PageLayout-VerticalDivider-9QRmK","Header":"prc-PageLayout-Header-0of-R","HeaderContent":"prc-PageLayout-HeaderContent-gdFfN","HeaderHorizontalDivider":"prc-PageLayout-HeaderHorizontalDivider-odAHl","ContentWrapper":"prc-PageLayout-ContentWrapper-gR9eG","Content":"prc-PageLayout-Content-xWL-A","PaneWrapper":"prc-PageLayout-PaneWrapper-pHPop","PaneVerticalDivider":"prc-PageLayout-PaneVerticalDivider-le57g","Pane":"prc-PageLayout-Pane-AyzHK","PaneHorizontalDivider":"prc-PageLayout-PaneHorizontalDivider-9tbnE","FooterWrapper":"prc-PageLayout-FooterWrapper-9cB8y","FooterHorizontalDivider":"prc-PageLayout-FooterHorizontalDivider-W-RaS","FooterContent":"prc-PageLayout-FooterContent-HUS0V","DraggableHandle":"prc-PageLayout-DraggableHandle-9s6B4"};
|
|
3
|
+
var classes = {"paneMaxWidthDiffBreakpoint":"1280","paneMaxWidthDiffDefault":"511","sidebarMaxWidthDiffDefault":"256","PageLayoutRoot":"prc-PageLayout-PageLayoutRoot--KH-d","PageLayoutWrapper":"prc-PageLayout-PageLayoutWrapper-2BhU2","PageLayoutContent":"prc-PageLayout-PageLayoutContent-BneH9","HorizontalDivider":"prc-PageLayout-HorizontalDivider-JLVqp","VerticalDivider":"prc-PageLayout-VerticalDivider-9QRmK","Header":"prc-PageLayout-Header-0of-R","HeaderContent":"prc-PageLayout-HeaderContent-gdFfN","HeaderHorizontalDivider":"prc-PageLayout-HeaderHorizontalDivider-odAHl","ContentWrapper":"prc-PageLayout-ContentWrapper-gR9eG","Content":"prc-PageLayout-Content-xWL-A","PaneWrapper":"prc-PageLayout-PaneWrapper-pHPop","PaneVerticalDivider":"prc-PageLayout-PaneVerticalDivider-le57g","Pane":"prc-PageLayout-Pane-AyzHK","PaneHorizontalDivider":"prc-PageLayout-PaneHorizontalDivider-9tbnE","FooterWrapper":"prc-PageLayout-FooterWrapper-9cB8y","FooterHorizontalDivider":"prc-PageLayout-FooterHorizontalDivider-W-RaS","FooterContent":"prc-PageLayout-FooterContent-HUS0V","DraggableHandle":"prc-PageLayout-DraggableHandle-9s6B4","SidebarWrapper":"prc-PageLayout-SidebarWrapper-kLG4B","Sidebar":"prc-PageLayout-Sidebar-iciWg","SidebarVerticalDivider":"prc-PageLayout-SidebarVerticalDivider-0Rl0V"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|