@primer/react 38.32.0-rc.68e0ffa22 → 38.32.0-rc.85de10233
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 +12 -0
- package/dist/ActionBar/ActionBar.js +130 -424
- package/dist/ActionList/{ActionList-65f7daac.css → ActionList-1ff5220c.css} +2 -2
- package/dist/ActionList/ActionList-1ff5220c.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/Breadcrumbs/{Breadcrumbs-54395fc6.css → Breadcrumbs-16d81430.css} +2 -2
- package/dist/Breadcrumbs/{Breadcrumbs-54395fc6.css.map → Breadcrumbs-16d81430.css.map} +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -0
- package/dist/Breadcrumbs/Breadcrumbs.module.css.js +2 -2
- package/dist/FilteredActionList/FilteredActionList.js +66 -155
- package/dist/FilteredActionList/useAnnouncements.js +66 -138
- package/dist/LabelGroup/LabelGroup.js +76 -110
- package/dist/Overlay/Overlay.js +45 -169
- package/dist/PageHeader/PageHeader-b12247c8.css +2 -0
- package/dist/PageHeader/PageHeader-b12247c8.css.map +1 -0
- package/dist/PageHeader/PageHeader.js +64 -23
- package/dist/PageHeader/PageHeader.module.css.js +1 -1
- package/dist/SegmentedControl/SegmentedControl-a004561f.css +2 -0
- package/dist/SegmentedControl/SegmentedControl-a004561f.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -1
- package/dist/TextInput/TextInput.js +7 -7
- package/dist/ToggleSwitch/ToggleSwitch.js +167 -186
- package/dist/TreeView/TreeView.js +309 -814
- package/dist/UnderlineNav/UnderlineNav-a06bbc74.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-a06bbc74.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +5 -0
- package/dist/UnderlineNav/UnderlineNav.js +136 -129
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -1
- package/dist/experimental/SelectPanel2/SelectPanel-917fdaef.css +2 -0
- package/dist/experimental/SelectPanel2/{SelectPanel-608e207e.css.map → SelectPanel-917fdaef.css.map} +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +38 -95
- package/dist/hooks/useControllableState.js +3 -3
- package/dist/hooks/useMedia.js +44 -43
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/dist/internal/components/ValidationAnimationContainer.js +40 -34
- package/package.json +3 -1
- package/dist/ActionList/ActionList-65f7daac.css.map +0 -1
- package/dist/PageHeader/PageHeader-5e969745.css +0 -2
- package/dist/PageHeader/PageHeader-5e969745.css.map +0 -1
- package/dist/SegmentedControl/SegmentedControl-622e61a4.css +0 -2
- package/dist/SegmentedControl/SegmentedControl-622e61a4.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-47547980.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-47547980.css.map +0 -1
- package/dist/experimental/SelectPanel2/SelectPanel-608e207e.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-UnderlineNav-UnderlineWrapper-GWONT{animation:prc-UnderlineNav-detect-overflow-6HuSH linear;animation-timeline:scroll(self block);container-type:inline-size;--UnderlineNav_moreButton-display:none}.prc-UnderlineNav-UnderlineWrapper-GWONT[data-has-overflow=true]{--UnderlineNav_moreButton-display:flex}@keyframes prc-UnderlineNav-detect-overflow-6HuSH{0%,to{--UnderlineNav_moreButton-display:flex}}@container (width < 20rem){.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons-breakpoint=xsmall] .prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:none}}@container (width < 34rem){.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons-breakpoint=small] .prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:none}}@container (width < 48rem){.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons-breakpoint=medium] .prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:none}}@container (width < 63.25rem){.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons-breakpoint=large] .prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:none}}@container (width < 80rem){.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons-breakpoint=xlarge] .prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:none}}@container (width < 87.5rem){.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons-breakpoint=xxlarge] .prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:none}}.prc-UnderlineNav-WrapSpacer--aLgz{margin-inline-end:calc(var(--stack-gap-condensed,.5rem)*-1)}.prc-UnderlineNav-MoreButtonContainer-Dnrq6{align-items:center;display:var(--UnderlineNav_moreButton-display,flex)}.prc-UnderlineNav-OverflowMenuItem-7SG7M [aria-current]{position:relative}.prc-UnderlineNav-OverflowMenuItem-7SG7M [aria-current] .prc-UnderlineNav-OverflowMenuItemLabel-F80v6{font-weight:var(--base-text-weight-semibold,600)}.prc-UnderlineNav-OverflowMenuItem-7SG7M [aria-current]:after{background:var(--underlineNav-borderColor-active,#fd8c73);content:"";inset:var(--base-size-2,.125rem) auto var(--base-size-2,.125rem) 0;position:absolute;width:var(--base-size-2,.125rem)}.prc-UnderlineNav-MoreButtonDivider-dN0a-{border-left:var(--borderWidth-thin,.0625rem) solid var(--borderColor-muted,#d1d9e0b3);display:inline-block;height:var(--base-size-24,1.5rem);margin-inline:var(--base-size-4,.25rem);width:0}.prc-UnderlineNav-MoreButton-Y8soj{font-weight:var(--base-text-weight-normal,400);margin:0;position:relative}.prc-UnderlineNav-MoreButton-Y8soj>[data-component=trailingVisual]{margin-left:0}.prc-UnderlineNav-MoreButton-Y8soj[data-current=true]{font-weight:var(--base-text-weight-semibold,600)}.prc-UnderlineNav-MoreButton-Y8soj[data-current=true]:after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73));content:"";height:2px;inset:auto 0 0;margin-bottom:calc((var(--base-size-8,.5rem) + var(--borderWidth-thin,.0625rem))*-1);pointer-events:none;position:absolute}@media (forced-colors:active){.prc-UnderlineNav-MoreButton-Y8soj[data-current=true]:after{background-color:LinkText}}
|
|
2
|
+
/*# sourceMappingURL=UnderlineNav-a06bbc74.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/UnderlineNav/UnderlineNav.module.css.js"],"names":[],"mappings":"AAAA,yCAIE,uDAAiC,CACjC,qCAAsC,CACtC,0BAA2B,CAE3B,sCAKF,CAHE,iEACE,sCACF,CAIF,kDACE,MAEE,sCACF,CACF,CAGE,2BACE,oIACE,YACF,CACF,CAIA,2BACE,mIACE,YACF,CACF,CAIA,2BACE,oIACE,YACF,CACF,CAIA,8BACE,mIACE,YACF,CACF,CAIA,2BACE,oIACE,YACF,CACF,CAIA,6BACE,qIACE,YACF,CACF,CAGF,mCAGE,2DACF,CAEA,4CAEE,kBAAmB,CADnB,mDAEF,CAEA,wDACE,iBAcF,CAZE,sGACE,gDACF,CAEA,8DAME,yDAAkD,CALlD,UAAW,CAGX,kEAAmD,CADnD,iBAAkB,CADlB,gCAKF,CAGF,0CAEE,qFAAmE,CADnE,oBAAqB,CAIrB,iCAA2B,CAD3B,uCAAiC,CADjC,OAGF,CAEA,mCAEE,8CAA2C,CAD3C,QAAS,CAET,iBA6BF,CA3BE,mEACE,aACF,CAIA,sDACE,gDAmBF,CAjBE,4DAUE,iGAAoG,CAFpG,UAAW,CAFX,UAAW,CAJX,cAAe,CAGf,oFAAwE,CAExE,mBAAoB,CANpB,iBAeF,CAJE,8BAZF,4DAcI,yBAEJ,CADE","file":"UnderlineNav-a06bbc74.css","sourcesContent":[".UnderlineWrapper {\n /* Progressive enhancement: Detect overflow using scroll-based animations.\n The idiomatic way would be a scroll-state container query but browser support\n is slightly better for animations. */\n animation: detect-overflow linear;\n animation-timeline: scroll(self block);\n container-type: inline-size;\n\n --UnderlineNav_moreButton-display: none;\n\n &[data-has-overflow='true'] {\n --UnderlineNav_moreButton-display: flex;\n }\n}\n\n/* Set overflow button visibility with pure CSS to avoid a layout shift on hydration */\n@keyframes detect-overflow {\n 0%,\n 100% {\n --UnderlineNav_moreButton-display: flex;\n }\n}\n\n.UnderlineWrapper[data-hide-icons-breakpoint='xsmall'] {\n @container (width < 20rem) {\n .ItemsList [data-component='icon'] {\n display: none;\n }\n }\n}\n\n.UnderlineWrapper[data-hide-icons-breakpoint='small'] {\n @container (width < 34rem) {\n .ItemsList [data-component='icon'] {\n display: none;\n }\n }\n}\n\n.UnderlineWrapper[data-hide-icons-breakpoint='medium'] {\n @container (width < 48rem) {\n .ItemsList [data-component='icon'] {\n display: none;\n }\n }\n}\n\n.UnderlineWrapper[data-hide-icons-breakpoint='large'] {\n @container (width < 63.25rem) {\n .ItemsList [data-component='icon'] {\n display: none;\n }\n }\n}\n\n.UnderlineWrapper[data-hide-icons-breakpoint='xlarge'] {\n @container (width < 80rem) {\n .ItemsList [data-component='icon'] {\n display: none;\n }\n }\n}\n\n.UnderlineWrapper[data-hide-icons-breakpoint='xxlarge'] {\n @container (width < 87.5rem) {\n .ItemsList [data-component='icon'] {\n display: none;\n }\n }\n}\n\n.WrapSpacer {\n /* Cancel out the flex gap so the first real item has no leading gap */\n /* stylelint-disable-next-line primer/spacing -- negative margin required to cancel the flex gap from the list */\n margin-inline-end: calc(-1 * var(--stack-gap-condensed));\n}\n\n.MoreButtonContainer {\n display: var(--UnderlineNav_moreButton-display, flex);\n align-items: center;\n}\n\n.OverflowMenuItem [aria-current] {\n position: relative;\n\n .OverflowMenuItemLabel {\n font-weight: var(--base-text-weight-semibold);\n }\n\n &::after {\n content: '';\n width: var(--base-size-2);\n position: absolute;\n inset: var(--base-size-2) auto var(--base-size-2) 0;\n /* stylelint-disable-next-line primer/colors */\n background: var(--underlineNav-borderColor-active);\n }\n}\n\n.MoreButtonDivider {\n display: inline-block;\n border-left: var(--borderWidth-thin) solid var(--borderColor-muted);\n width: 0;\n margin-inline: var(--base-size-4);\n height: var(--base-size-24);\n}\n\n.MoreButton {\n margin: 0; /* reset Safari extra margin */\n font-weight: var(--base-text-weight-normal);\n position: relative;\n\n & > [data-component='trailingVisual'] {\n margin-left: 0;\n }\n\n /* When the current item has overflowed into the menu, style the overflow\n anchor so it looks like the current item (semibold text + active underline). */\n &[data-current='true'] {\n font-weight: var(--base-text-weight-semibold);\n\n &::after {\n position: absolute;\n inset: auto 0 0;\n /* Pull down same amount as the item-level decoration, plus the border width of the button */\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: calc(-1 * (var(--base-size-8) + var(--borderWidth-thin)));\n height: 2px;\n pointer-events: none;\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--underlineNav-borderColor-active, var(--color-primer-border-active, #fd8c73));\n\n @media (forced-colors: active) {\n /* Support for Windows Forced Color Mode https://learn.microsoft.com/en-us/fluent-ui/web-components/design-system/high-contrast */\n background-color: LinkText;\n }\n }\n }\n}\n"]}
|
|
@@ -16,6 +16,11 @@ type UnderlineNavProps = {
|
|
|
16
16
|
* Setting this to `flush` will remove the horizontal padding on the items.
|
|
17
17
|
*/
|
|
18
18
|
variant?: 'inset' | 'flush';
|
|
19
|
+
/**
|
|
20
|
+
* Customize when the icons are hidden to save space. Set to `null` to always show icons.
|
|
21
|
+
* Defaults to `xxlarge`; if you know there won't be very many tabs you might set this to a smaller value.
|
|
22
|
+
*/
|
|
23
|
+
hideIconsBreakpoint?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | null;
|
|
19
24
|
};
|
|
20
25
|
//#endregion
|
|
21
26
|
export { UnderlineNavProps };
|
|
@@ -18,143 +18,150 @@ import { forwardRef, useRef, useState } from "react";
|
|
|
18
18
|
//#region src/UnderlineNav/UnderlineNav.tsx
|
|
19
19
|
const UnderlineNav = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
|
|
20
20
|
const $ = c(52);
|
|
21
|
-
const { as: t1, "aria-label": ariaLabel, loadingCounters: t2, variant: t3, className, children } = t0;
|
|
21
|
+
const { as: t1, "aria-label": ariaLabel, loadingCounters: t2, variant: t3, className, children, hideIconsBreakpoint: t4 } = t0;
|
|
22
22
|
const as = t1 === void 0 ? "nav" : t1;
|
|
23
23
|
const loadingCounters = t2 === void 0 ? false : t2;
|
|
24
24
|
const variant = t3 === void 0 ? "inset" : t3;
|
|
25
|
+
const hideIconsBreakpoint = t4 === void 0 ? "xxlarge" : t4;
|
|
25
26
|
const backupRef = useRef(null);
|
|
26
27
|
const navRef = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
27
28
|
const listRef = useRef(null);
|
|
28
|
-
const [hasEverOverflowed, setHasOverflowed] = useState(false);
|
|
29
29
|
const [registeredItems, setRegisteredItems] = UnderlineNavItemsRegistry.useRegistryState();
|
|
30
30
|
let isOverflowing;
|
|
31
31
|
let overflowMenuItems;
|
|
32
|
-
let
|
|
33
|
-
if ($[0] !==
|
|
32
|
+
let t5;
|
|
33
|
+
if ($[0] !== registeredItems) {
|
|
34
34
|
var _registeredItems$entr;
|
|
35
35
|
overflowMenuItems = Array.from((_registeredItems$entr = registeredItems === null || registeredItems === void 0 ? void 0 : registeredItems.entries()) !== null && _registeredItems$entr !== void 0 ? _registeredItems$entr : []).filter(_temp);
|
|
36
36
|
isOverflowing = overflowMenuItems.length > 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
$[
|
|
40
|
-
$[
|
|
41
|
-
$[
|
|
42
|
-
$[3] = overflowMenuItems;
|
|
43
|
-
$[4] = t4;
|
|
37
|
+
t5 = overflowMenuItems.some(_temp2);
|
|
38
|
+
$[0] = registeredItems;
|
|
39
|
+
$[1] = isOverflowing;
|
|
40
|
+
$[2] = overflowMenuItems;
|
|
41
|
+
$[3] = t5;
|
|
44
42
|
} else {
|
|
45
|
-
isOverflowing = $[
|
|
46
|
-
overflowMenuItems = $[
|
|
47
|
-
|
|
43
|
+
isOverflowing = $[1];
|
|
44
|
+
overflowMenuItems = $[2];
|
|
45
|
+
t5 = $[3];
|
|
48
46
|
}
|
|
49
|
-
const overflowingCurrentItem =
|
|
50
|
-
let t5;
|
|
51
|
-
if ($[5] !== children) {
|
|
52
|
-
t5 = getValidChildren(children);
|
|
53
|
-
$[5] = children;
|
|
54
|
-
$[6] = t5;
|
|
55
|
-
} else t5 = $[6];
|
|
56
|
-
const validChildren = t5;
|
|
47
|
+
const overflowingCurrentItem = t5;
|
|
57
48
|
let t6;
|
|
49
|
+
if ($[4] !== children) {
|
|
50
|
+
t6 = getValidChildren(children);
|
|
51
|
+
$[4] = children;
|
|
52
|
+
$[5] = t6;
|
|
53
|
+
} else t6 = $[5];
|
|
54
|
+
const validChildren = t6;
|
|
58
55
|
let t7;
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
let t8;
|
|
57
|
+
if ($[6] !== ariaLabel || $[7] !== validChildren) {
|
|
58
|
+
t7 = () => {
|
|
61
59
|
!(validChildren.filter(_temp3).length <= 1) && invariant(false, "Only one current element is allowed");
|
|
62
60
|
!ariaLabel && invariant(false, "Use the `aria-label` prop to provide an accessible label for assistive technology");
|
|
63
61
|
};
|
|
64
|
-
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
62
|
+
t8 = [validChildren, ariaLabel];
|
|
63
|
+
$[6] = ariaLabel;
|
|
64
|
+
$[7] = validChildren;
|
|
65
|
+
$[8] = t7;
|
|
66
|
+
$[9] = t8;
|
|
69
67
|
} else {
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
t7 = $[8];
|
|
69
|
+
t8 = $[9];
|
|
72
70
|
}
|
|
73
|
-
useDevOnlyEffect(
|
|
74
|
-
let
|
|
75
|
-
if ($[
|
|
76
|
-
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
} else
|
|
80
|
-
const contextValue =
|
|
71
|
+
useDevOnlyEffect(t7, t8);
|
|
72
|
+
let t9;
|
|
73
|
+
if ($[10] !== loadingCounters) {
|
|
74
|
+
t9 = { loadingCounters };
|
|
75
|
+
$[10] = loadingCounters;
|
|
76
|
+
$[11] = t9;
|
|
77
|
+
} else t9 = $[11];
|
|
78
|
+
const contextValue = t9;
|
|
81
79
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
82
80
|
if (menuOpen && !isOverflowing) setMenuOpen(false);
|
|
83
|
-
let
|
|
84
|
-
if ($[
|
|
85
|
-
|
|
81
|
+
let t10;
|
|
82
|
+
if ($[12] !== ariaLabel) {
|
|
83
|
+
t10 = ariaLabel && /*#__PURE__*/ jsx(VisuallyHidden, {
|
|
86
84
|
as: "h2",
|
|
87
85
|
children: `${ariaLabel} navigation`
|
|
88
86
|
});
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
} else
|
|
92
|
-
let
|
|
93
|
-
if ($[
|
|
94
|
-
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
} else
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
let
|
|
87
|
+
$[12] = ariaLabel;
|
|
88
|
+
$[13] = t10;
|
|
89
|
+
} else t10 = $[13];
|
|
90
|
+
let t11;
|
|
91
|
+
if ($[14] !== className) {
|
|
92
|
+
t11 = clsx(UnderlineNav_module_css_default.UnderlineWrapper, className);
|
|
93
|
+
$[14] = className;
|
|
94
|
+
$[15] = t11;
|
|
95
|
+
} else t11 = $[15];
|
|
96
|
+
const t12 = hideIconsBreakpoint !== null && hideIconsBreakpoint !== void 0 ? hideIconsBreakpoint : void 0;
|
|
97
|
+
const t13 = isOverflowing ? "true" : void 0;
|
|
98
|
+
let t14;
|
|
99
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
|
+
t14 = /*#__PURE__*/ jsx("li", {
|
|
101
|
+
role: "presentation",
|
|
102
|
+
"aria-hidden": true,
|
|
103
|
+
className: UnderlineNav_module_css_default.WrapSpacer
|
|
104
|
+
});
|
|
105
|
+
$[16] = t14;
|
|
106
|
+
} else t14 = $[16];
|
|
107
|
+
let t15;
|
|
101
108
|
if ($[17] !== children || $[18] !== setRegisteredItems) {
|
|
102
|
-
|
|
109
|
+
t15 = /*#__PURE__*/ jsx(UnderlineNavItemsRegistry.Provider, {
|
|
103
110
|
setRegistry: setRegisteredItems,
|
|
104
111
|
children
|
|
105
112
|
});
|
|
106
113
|
$[17] = children;
|
|
107
114
|
$[18] = setRegisteredItems;
|
|
108
|
-
$[19] =
|
|
109
|
-
} else
|
|
110
|
-
let
|
|
111
|
-
if ($[20] !== navRef || $[21] !==
|
|
112
|
-
|
|
115
|
+
$[19] = t15;
|
|
116
|
+
} else t15 = $[19];
|
|
117
|
+
let t16;
|
|
118
|
+
if ($[20] !== navRef || $[21] !== t15) {
|
|
119
|
+
t16 = /*#__PURE__*/ jsxs(UnderlineItemList, {
|
|
113
120
|
ref: listRef,
|
|
114
121
|
role: "list",
|
|
115
122
|
className: UnderlineNav_module_css_default.ItemsList,
|
|
116
|
-
children: /*#__PURE__*/ jsx(OverflowObserverProvider, {
|
|
123
|
+
children: [t14, /*#__PURE__*/ jsx(OverflowObserverProvider, {
|
|
117
124
|
rootRef: navRef,
|
|
118
|
-
children:
|
|
119
|
-
})
|
|
125
|
+
children: t15
|
|
126
|
+
})]
|
|
120
127
|
});
|
|
121
128
|
$[20] = navRef;
|
|
122
|
-
$[21] =
|
|
123
|
-
$[22] =
|
|
124
|
-
} else
|
|
125
|
-
let
|
|
129
|
+
$[21] = t15;
|
|
130
|
+
$[22] = t16;
|
|
131
|
+
} else t16 = $[22];
|
|
132
|
+
let t17;
|
|
126
133
|
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
127
|
-
|
|
128
|
-
$[23] =
|
|
129
|
-
} else
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
let
|
|
134
|
+
t17 = /*#__PURE__*/ jsx("div", { className: UnderlineNav_module_css_default.MoreButtonDivider });
|
|
135
|
+
$[23] = t17;
|
|
136
|
+
} else t17 = $[23];
|
|
137
|
+
const t18 = overflowingCurrentItem ? "true" : void 0;
|
|
138
|
+
const t19 = overflowingCurrentItem ? "More items, including current item" : void 0;
|
|
139
|
+
let t20;
|
|
133
140
|
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
134
|
-
|
|
141
|
+
t20 = /*#__PURE__*/ jsxs("span", { children: ["More", /*#__PURE__*/ jsx(VisuallyHidden, {
|
|
135
142
|
as: "span",
|
|
136
143
|
children: " items"
|
|
137
144
|
})] });
|
|
138
|
-
$[24] =
|
|
139
|
-
} else
|
|
140
|
-
let
|
|
141
|
-
if ($[25] !==
|
|
142
|
-
|
|
145
|
+
$[24] = t20;
|
|
146
|
+
} else t20 = $[24];
|
|
147
|
+
let t21;
|
|
148
|
+
if ($[25] !== t18 || $[26] !== t19) {
|
|
149
|
+
t21 = /*#__PURE__*/ jsx(ActionMenu.Button, {
|
|
143
150
|
className: UnderlineNav_module_css_default.MoreButton,
|
|
144
151
|
variant: "invisible",
|
|
145
152
|
"data-component": "overflow-menu-button",
|
|
146
|
-
"data-current":
|
|
147
|
-
"aria-label":
|
|
148
|
-
children:
|
|
153
|
+
"data-current": t18,
|
|
154
|
+
"aria-label": t19,
|
|
155
|
+
children: t20
|
|
149
156
|
});
|
|
150
|
-
$[25] =
|
|
151
|
-
$[26] =
|
|
152
|
-
$[27] =
|
|
153
|
-
} else
|
|
154
|
-
let
|
|
157
|
+
$[25] = t18;
|
|
158
|
+
$[26] = t19;
|
|
159
|
+
$[27] = t21;
|
|
160
|
+
} else t21 = $[27];
|
|
161
|
+
let t22;
|
|
155
162
|
if ($[28] !== loadingCounters || $[29] !== overflowMenuItems || $[30] !== registeredItems) {
|
|
156
|
-
|
|
157
|
-
const [key, allProps] =
|
|
163
|
+
t22 = registeredItems === void 0 ? /*#__PURE__*/ jsx(ActionList.Item, { children: /*#__PURE__*/ jsx(SkeletonText, {}) }) : overflowMenuItems.map((t23) => {
|
|
164
|
+
const [key, allProps] = t23;
|
|
158
165
|
const { children: menuItemChildren, counter, onSelect, ...menuItemProps } = allProps;
|
|
159
166
|
return /*#__PURE__*/ jsxs(ActionList.LinkItem, {
|
|
160
167
|
onClick: (event) => onSelect === null || onSelect === void 0 ? void 0 : onSelect(event),
|
|
@@ -172,65 +179,65 @@ const UnderlineNav = /*#__PURE__*/ forwardRef((t0, forwardedRef) => {
|
|
|
172
179
|
$[28] = loadingCounters;
|
|
173
180
|
$[29] = overflowMenuItems;
|
|
174
181
|
$[30] = registeredItems;
|
|
175
|
-
$[31] =
|
|
176
|
-
} else
|
|
177
|
-
let
|
|
178
|
-
if ($[32] !==
|
|
179
|
-
|
|
180
|
-
$[32] =
|
|
181
|
-
$[33] =
|
|
182
|
-
} else
|
|
183
|
-
let
|
|
184
|
-
if ($[34] !== menuOpen || $[35] !==
|
|
185
|
-
|
|
182
|
+
$[31] = t22;
|
|
183
|
+
} else t22 = $[31];
|
|
184
|
+
let t23;
|
|
185
|
+
if ($[32] !== t22) {
|
|
186
|
+
t23 = /*#__PURE__*/ jsx(ActionMenu.Overlay, { children: /*#__PURE__*/ jsx(ActionList, { children: t22 }) });
|
|
187
|
+
$[32] = t22;
|
|
188
|
+
$[33] = t23;
|
|
189
|
+
} else t23 = $[33];
|
|
190
|
+
let t24;
|
|
191
|
+
if ($[34] !== menuOpen || $[35] !== t21 || $[36] !== t23) {
|
|
192
|
+
t24 = /*#__PURE__*/ jsxs("div", {
|
|
186
193
|
className: UnderlineNav_module_css_default.MoreButtonContainer,
|
|
187
|
-
children: [
|
|
194
|
+
children: [t17, /*#__PURE__*/ jsxs(ActionMenu, {
|
|
188
195
|
open: menuOpen,
|
|
189
196
|
onOpenChange: setMenuOpen,
|
|
190
|
-
children: [
|
|
197
|
+
children: [t21, t23]
|
|
191
198
|
})]
|
|
192
199
|
});
|
|
193
200
|
$[34] = menuOpen;
|
|
194
|
-
$[35] =
|
|
195
|
-
$[36] =
|
|
196
|
-
$[37] =
|
|
197
|
-
} else
|
|
198
|
-
let
|
|
199
|
-
if ($[38] !== ariaLabel || $[39] !== as || $[40] !== navRef || $[41] !==
|
|
200
|
-
|
|
201
|
+
$[35] = t21;
|
|
202
|
+
$[36] = t23;
|
|
203
|
+
$[37] = t24;
|
|
204
|
+
} else t24 = $[37];
|
|
205
|
+
let t25;
|
|
206
|
+
if ($[38] !== ariaLabel || $[39] !== as || $[40] !== navRef || $[41] !== t11 || $[42] !== t12 || $[43] !== t13 || $[44] !== t16 || $[45] !== t24 || $[46] !== variant) {
|
|
207
|
+
t25 = /*#__PURE__*/ jsxs(UnderlineWrapper, {
|
|
201
208
|
as,
|
|
202
209
|
"aria-label": ariaLabel,
|
|
203
|
-
className:
|
|
210
|
+
className: t11,
|
|
204
211
|
ref: navRef,
|
|
205
212
|
"data-variant": variant,
|
|
206
213
|
"data-overflow-mode": "wrap",
|
|
207
|
-
"data-hide-icons":
|
|
208
|
-
"data-has-overflow":
|
|
209
|
-
children: [
|
|
214
|
+
"data-hide-icons-breakpoint": t12,
|
|
215
|
+
"data-has-overflow": t13,
|
|
216
|
+
children: [t16, t24]
|
|
210
217
|
});
|
|
211
218
|
$[38] = ariaLabel;
|
|
212
219
|
$[39] = as;
|
|
213
220
|
$[40] = navRef;
|
|
214
|
-
$[41] =
|
|
215
|
-
$[42] =
|
|
216
|
-
$[43] =
|
|
217
|
-
$[44] =
|
|
218
|
-
$[45] =
|
|
221
|
+
$[41] = t11;
|
|
222
|
+
$[42] = t12;
|
|
223
|
+
$[43] = t13;
|
|
224
|
+
$[44] = t16;
|
|
225
|
+
$[45] = t24;
|
|
219
226
|
$[46] = variant;
|
|
220
|
-
$[47] =
|
|
221
|
-
} else
|
|
222
|
-
let
|
|
223
|
-
if ($[48] !== contextValue || $[49] !==
|
|
224
|
-
|
|
227
|
+
$[47] = t25;
|
|
228
|
+
} else t25 = $[47];
|
|
229
|
+
let t26;
|
|
230
|
+
if ($[48] !== contextValue || $[49] !== t10 || $[50] !== t25) {
|
|
231
|
+
t26 = /*#__PURE__*/ jsxs(UnderlineNavContext.Provider, {
|
|
225
232
|
value: contextValue,
|
|
226
|
-
children: [
|
|
233
|
+
children: [t10, t25]
|
|
227
234
|
});
|
|
228
235
|
$[48] = contextValue;
|
|
229
|
-
$[49] =
|
|
230
|
-
$[50] =
|
|
231
|
-
$[51] =
|
|
232
|
-
} else
|
|
233
|
-
return
|
|
236
|
+
$[49] = t10;
|
|
237
|
+
$[50] = t25;
|
|
238
|
+
$[51] = t26;
|
|
239
|
+
} else t26 = $[51];
|
|
240
|
+
return t26;
|
|
234
241
|
});
|
|
235
242
|
UnderlineNav.displayName = "UnderlineNav";
|
|
236
243
|
function _temp(entry) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./UnderlineNav-
|
|
1
|
+
import "./UnderlineNav-a06bbc74.css";
|
|
2
2
|
//#region src/UnderlineNav/UnderlineNav.module.css.js
|
|
3
3
|
var UnderlineNav_module_css_default = {
|
|
4
4
|
"UnderlineWrapper": "prc-UnderlineNav-UnderlineWrapper-GWONT",
|
|
5
5
|
"detect-overflow": "prc-UnderlineNav-detect-overflow-6HuSH",
|
|
6
6
|
"ItemsList": "prc-UnderlineNav-ItemsList-oj8gN",
|
|
7
|
+
"WrapSpacer": "prc-UnderlineNav-WrapSpacer--aLgz",
|
|
7
8
|
"MoreButtonContainer": "prc-UnderlineNav-MoreButtonContainer-Dnrq6",
|
|
8
9
|
"OverflowMenuItem": "prc-UnderlineNav-OverflowMenuItem-7SG7M",
|
|
9
10
|
"OverflowMenuItemLabel": "prc-UnderlineNav-OverflowMenuItemLabel-F80v6",
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-SelectPanel2-Overlay--Q-FI{border:none;color:var(--fgColor-default,#1f2328);padding:0;--max-height:0;--position-top:0;--position-left:0}.prc-SelectPanel2-Overlay--Q-FI:where([open]){display:flex}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=anchored]),.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=full-screen]){left:var(--position-left);margin:0;top:var(--position-top)}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=anchored])::backdrop{background-color:transparent}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=full-screen])::backdrop{background-color:transparent}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=modal]){bottom:0;left:0;right:0;top:0}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=modal])::backdrop{background-color:var(--overlay-backdrop-bgColor,#c8d1da66)}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=full-screen]){border-radius:unset;height:100%;left:0;margin:0;max-height:100vh;max-width:100vw;top:0;width:100%}.prc-SelectPanel2-Overlay--Q-FI:where([data-variant=bottom-sheet]){border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:0;left:0;margin:0;max-height:calc(100vh - 64px);max-width:100vw;top:auto;width:100%}.prc-SelectPanel2-Form-bZ9HS{width:100%}.prc-SelectPanel2-Container-e5e6-,.prc-SelectPanel2-Form-bZ9HS{display:flex;flex-direction:column}.prc-SelectPanel2-Container-e5e6-{flex-grow:1;flex-shrink:1;justify-content:space-between;overflow:hidden}.prc-SelectPanel2-Container-e5e6- ul{flex-grow:1;overflow-y:auto}.prc-SelectPanel2-Container-e5e6- li:not(:focus,[data-is-active-descendant],[data-active]){contain-intrinsic-size:auto 32px;content-visibility:auto}.prc-SelectPanel2-HeaderContent-MsaAS{align-items:center;display:flex;justify-content:space-between;margin-bottom:0}.prc-SelectPanel2-HeaderContent-MsaAS:where([data-description]){align-items:flex-start}.prc-SelectPanel2-HeaderContent-MsaAS:where([data-search-input]){margin-bottom:var(--base-size-8,.5rem)}.prc-SelectPanel2-TitleWrapper-HzPu3{margin-left:var(--base-size-8,.5rem);margin-top:0}.prc-SelectPanel2-TitleWrapper-HzPu3:where([data-description]){margin-top:2px}.prc-SelectPanel2-TitleWrapper-HzPu3:where([data-on-back]){margin-left:var(--base-size-4,.25rem)}.prc-SelectPanel2-TextInput-lHH1n{padding-left:var(--base-size-8,.5rem)!important}.prc-SelectPanel2-TextInput-lHH1n input:placeholder-shown~.TextInput-action{display:none}.prc-SelectPanel2-Checkbox-AYR38{margin-top:0}.prc-SelectPanel2-FlexBox-gWPRg{display:flex}.prc-SelectPanel2-Title-T-h3f{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600)}.prc-SelectPanel2-Description-qTXfi{display:block;font-size:var(--text-body-size-small,.75rem)}.prc-SelectPanel2-ClearAction-tQj-f,.prc-SelectPanel2-Description-qTXfi{color:var(--fgColor-muted,#59636e)}.prc-SelectPanel2-ClearAction-tQj-f{background:none}.prc-SelectPanel2-Footer-TibV0{align-items:center;border-top:var(--borderWidth-thin,.0625rem) solid;border-top-color:var(--borderColor-default,#d1d9e0);display:flex;flex-shrink:0;justify-content:space-between;min-height:44px;padding:var(--base-size-16,1rem)}.prc-SelectPanel2-Footer-TibV0:where([data-hide-primary-actions]){padding:var(--base-size-8,.5rem)}.prc-SelectPanel2-FooterContent-UjAOM{flex-grow:0}.prc-SelectPanel2-FooterContent-UjAOM:where([data-hide-primary-actions]){flex-grow:1}.prc-SelectPanel2-FooterActions-T6yQR,.prc-SelectPanel2-SecondaryCheckbox-omkf-{display:flex;gap:var(--stack-gap-condensed,.5rem)}.prc-SelectPanel2-SecondaryCheckbox-omkf-{align-items:center}.prc-SelectPanel2-SmallText-c42ay{font-size:var(--text-body-size-small,.75rem)}.prc-SelectPanel2-SelectPanelLoading-mtyhD{align-items:center;display:flex;flex-direction:column;gap:var(--stack-gap-normal,1rem);height:100%;justify-content:center;min-height:min(calc(var(--max-height) - 150px),324px)}.prc-SelectPanel2-LoadingText-DB0wN{color:var(--fgColor-muted,#59636e);font-size:var(--text-body-size-medium,.875rem)}.prc-SelectPanel2-MessageFull-nY-qF{align-items:center;display:flex;flex-direction:column;flex-grow:1;gap:var(--base-size-4,.25rem);height:100%;justify-content:center;min-height:min(calc(var(--max-height) - 150px),324px);padding-left:var(--base-size-24,1.5rem);padding-right:var(--base-size-24,1.5rem);text-align:center}.prc-SelectPanel2-MessageFull-nY-qF a{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.prc-SelectPanel2-Octicon-zt-zU{margin-bottom:var(--base-size-8,.5rem)}.prc-SelectPanel2-Octicon-zt-zU.prc-SelectPanel2-Error-ZrZQQ{color:var(--fgColor-danger,#d1242f)}.prc-SelectPanel2-Octicon-zt-zU.prc-SelectPanel2-Warning-PDsVF{color:var(--fgColor-attention,#9a6700)}.prc-SelectPanel2-MessageTitle-T7v9d{font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-medium,500)}.prc-SelectPanel2-MessageContent-UZ9vY{align-items:center;color:var(--fgColor-muted,#59636e);flex-direction:column;font-size:var(--text-body-size-medium,.875rem)}.prc-SelectPanel2-MessageContent-UZ9vY,.prc-SelectPanel2-MessageInline-sErQf{display:flex;gap:var(--stack-gap-condensed,.5rem)}.prc-SelectPanel2-MessageInline-sErQf{border-bottom:var(--borderWidth-thin,.0625rem) solid;font-size:var(--text-body-size-small,.75rem);padding:var(--base-size-12,.75rem) var(--base-size-16,1rem)}.prc-SelectPanel2-MessageInline-sErQf a{color:inherit;-webkit-text-decoration:underline;text-decoration:underline}.prc-SelectPanel2-MessageInline-sErQf:where([data-variant=error]){background-color:var(--bgColor-danger-muted,#ffebe9);border-color:var(--borderColor-danger-muted,#ff818266);color:var(--fgColor-danger,#d1242f)}.prc-SelectPanel2-MessageInline-sErQf:where([data-variant=warning]){background-color:var(--bgColor-attention-muted,#fff8c5);border-color:var(--borderColor-attention-muted,#d4a72c66);color:var(--fgColor-attention,#9a6700)}.prc-SelectPanel2-Header-LKyEJ{border-bottom:var(--borderWidth-thin,.0625rem) solid;border-bottom-color:var(--borderColor-default,#d1d9e0);display:flex;flex-direction:column;padding:var(--base-size-8,.5rem)}
|
|
2
|
+
/*# sourceMappingURL=SelectPanel-917fdaef.css.map */
|
package/dist/experimental/SelectPanel2/{SelectPanel-608e207e.css.map → SelectPanel-917fdaef.css.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/experimental/SelectPanel2/SelectPanel.module.css.js"],"names":[],"mappings":"AAAA,gCAGE,WAAY,CADZ,oCAA6B,CAD7B,SAAU,CAKV,cAAe,CACf,gBAAiB,CACjB,iBAoDF,CAlDE,8CACE,YACF,CAEA,iIAKE,yBAA0B,CAC1B,QAAS,CAHT,uBAQF,CAHE,yEACE,4BACF,CAFA,4EACE,4BACF,CAGF,4DAIE,QAAS,CAFT,MAAO,CACP,OAAQ,CAFR,KAIF,CAEA,sEACE,0DACF,CAEA,kEAQE,mBAAoB,CAHpB,WAAY,CAHZ,MAAO,CAKP,QAAS,CADT,gBAAiB,CAFjB,eAAgB,CAHhB,KAAM,CAEN,UAMF,CAEA,mEASE,2BAA4B,CAD5B,4BAA6B,CAN7B,QAAS,CACT,MAAO,CAIP,QAAS,CADT,6BAA8B,CAD9B,eAAgB,CAJhB,QAAS,CAGT,UAMF,CAGF,6BAEE,UAEF,CAEA,+DALE,YAAa,CAEb,qBAwBF,CArBA,kCAKE,WAAY,CADZ,aAAc,CAEd,6BAA8B,CAJ9B,eAmBF,CAbE,qCAEE,WAAY,CADZ,eAEF,CAMA,2FAEE,gCAAiC,CADjC,uBAEF,CAGF,sCAGE,kBAAmB,CAFnB,YAAa,CACb,6BAA8B,CAE9B,eASF,CAPE,gEACE,sBACF,CAEA,iEACE,sCACF,CAGF,qCAEE,oCAA+B,CAD/B,YAWF,CARE,+DAEE,cACF,CAEA,2DACE,qCACF,CAGF,kCACE,+
|
|
1
|
+
{"version":3,"sources":["../../src/experimental/SelectPanel2/SelectPanel.module.css.js"],"names":[],"mappings":"AAAA,gCAGE,WAAY,CADZ,oCAA6B,CAD7B,SAAU,CAKV,cAAe,CACf,gBAAiB,CACjB,iBAoDF,CAlDE,8CACE,YACF,CAEA,iIAKE,yBAA0B,CAC1B,QAAS,CAHT,uBAQF,CAHE,yEACE,4BACF,CAFA,4EACE,4BACF,CAGF,4DAIE,QAAS,CAFT,MAAO,CACP,OAAQ,CAFR,KAIF,CAEA,sEACE,0DACF,CAEA,kEAQE,mBAAoB,CAHpB,WAAY,CAHZ,MAAO,CAKP,QAAS,CADT,gBAAiB,CAFjB,eAAgB,CAHhB,KAAM,CAEN,UAMF,CAEA,mEASE,2BAA4B,CAD5B,4BAA6B,CAN7B,QAAS,CACT,MAAO,CAIP,QAAS,CADT,6BAA8B,CAD9B,eAAgB,CAJhB,QAAS,CAGT,UAMF,CAGF,6BAEE,UAEF,CAEA,+DALE,YAAa,CAEb,qBAwBF,CArBA,kCAKE,WAAY,CADZ,aAAc,CAEd,6BAA8B,CAJ9B,eAmBF,CAbE,qCAEE,WAAY,CADZ,eAEF,CAMA,2FAEE,gCAAiC,CADjC,uBAEF,CAGF,sCAGE,kBAAmB,CAFnB,YAAa,CACb,6BAA8B,CAE9B,eASF,CAPE,gEACE,sBACF,CAEA,iEACE,sCACF,CAGF,qCAEE,oCAA+B,CAD/B,YAWF,CARE,+DAEE,cACF,CAEA,2DACE,qCACF,CAGF,kCACE,+CASF,CAHE,4EACE,YACF,CAGF,iCACE,YACF,CAEA,gCACE,YACF,CAEA,8BACE,8CAAuC,CACvC,gDACF,CAEA,oCACE,aAAc,CACd,4CAEF,CAEA,wEAHE,kCAMF,CAHA,oCAEE,eACF,CAEA,+BAOE,kBAAmB,CAHnB,iDAAyC,CACzC,mDAA4C,CAJ5C,YAAa,CAOb,aAAc,CAFd,6BAA8B,CAJ9B,eAAgB,CAChB,gCAUF,CAHE,kEACE,gCACF,CAGF,sCACE,WAKF,CAHE,yEACE,WACF,CAQF,gFAJE,YAAa,CACb,oCAOF,CAJA,0CAEE,kBAEF,CAEA,kCACE,4CACF,CAEA,2CAQE,kBAAmB,CAPnB,YAAa,CAKb,qBAAsB,CAGtB,gCAA4B,CAP5B,WAAY,CAKZ,sBAAuB,CAFvB,qDAKF,CAEA,oCAEE,kCAA2B,CAD3B,8CAEF,CAEA,oCAWE,kBAAmB,CAVnB,YAAa,CAQb,qBAAsB,CAGtB,WAAY,CACZ,6BAAuB,CAXvB,WAAY,CAQZ,sBAAuB,CALvB,qDAAuD,CAEvD,uCAAiC,CADjC,wCAAkC,CAElC,iBAWF,CAJE,sCACE,aAAc,CACd,iCAA0B,CAA1B,yBACF,CAGF,gCACE,sCASF,CAPE,6DACE,mCACF,CAEA,+DACE,sCACF,CAGF,qCACE,8CAAuC,CACvC,8CACF,CAEA,uCAME,kBAAmB,CAHnB,kCAA2B,CAC3B,qBAAsB,CAFtB,8CAKF,CAEA,6EARE,YAAa,CAIb,oCA8BF,CA1BA,sCAOE,oDAA4C,CAD5C,4CAAsC,CADtC,2DAqBF,CAhBE,wCACE,aAAc,CACd,iCAA0B,CAA1B,yBACF,CAEA,kEAEE,oDAA6C,CAC7C,sDAA6C,CAF7C,mCAGF,CAEA,oEAEE,uDAAgD,CAChD,yDAAgD,CAFhD,sCAGF,CAGF,+BAIE,oDAA4C,CAC5C,sDAA+C,CAJ/C,YAAa,CAEb,qBAAsB,CADtB,gCAIF","file":"SelectPanel-917fdaef.css","sourcesContent":[".Overlay {\n padding: 0;\n color: var(--fgColor-default);\n border: none;\n\n /* CSS variables values are passed in via styles */\n --max-height: 0;\n --position-top: 0;\n --position-left: 0;\n\n &:where([open]) {\n display: flex; /* to fit children */\n }\n\n &:where([data-variant='anchored']),\n &:where([data-variant='full-screen']) {\n /* stylelint-disable-next-line primer/spacing */\n top: var(--position-top);\n /* stylelint-disable-next-line primer/spacing */\n left: var(--position-left);\n margin: 0;\n\n &::backdrop {\n background-color: transparent;\n }\n }\n\n &:where([data-variant='modal']) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n &:where([data-variant='modal'])::backdrop {\n background-color: var(--overlay-backdrop-bgColor);\n }\n\n &:where([data-variant='full-screen']) {\n top: 0;\n left: 0;\n width: 100%;\n max-width: 100vw;\n height: 100%;\n max-height: 100vh;\n margin: 0;\n border-radius: unset;\n }\n\n &:where([data-variant='bottom-sheet']) {\n top: auto;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: 100vw;\n max-height: calc(100vh - 64px);\n margin: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n\n.Form {\n display: flex;\n width: 100%;\n flex-direction: column;\n}\n\n.Container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n flex-shrink: 1;\n flex-grow: 1;\n justify-content: space-between;\n\n ul {\n overflow-y: auto;\n flex-grow: 1;\n }\n\n /* Allow the browser to skip rendering for off-screen items, reducing style recalc and layout costs in long lists.\n Exclude items that show the active indicator line, as content-visibility: auto applies paint containment\n which clips the absolutely-positioned ::after pseudo-element that renders outside the item bounds. */\n /* stylelint-disable-next-line selector-no-qualifying-type */\n li:not(:focus, [data-is-active-descendant], [data-active]) {\n content-visibility: auto;\n contain-intrinsic-size: auto 32px;\n }\n}\n\n.HeaderContent {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0;\n\n &:where([data-description]) {\n align-items: flex-start;\n }\n\n &:where([data-search-input]) {\n margin-bottom: var(--base-size-8);\n }\n}\n\n.TitleWrapper {\n margin-top: 0;\n margin-left: var(--base-size-8);\n\n &:where([data-description]) {\n /* stylelint-disable-next-line primer/spacing */\n margin-top: 2px;\n }\n\n &:where([data-on-back]) {\n margin-left: var(--base-size-4);\n }\n}\n\n.TextInput {\n padding-left: var(--base-size-8) !important;\n\n /* Hide the trailing action while the input is empty (showing its placeholder). Uses a\n forward sibling selector on the input instead of `:has()` to avoid Safari's `:has()`\n invalidation cost; `input` and `.TextInput-action` are siblings inside the wrapper. */\n /* stylelint-disable-next-line selector-class-pattern */\n & input:placeholder-shown ~ :global(.TextInput-action) {\n display: none;\n }\n}\n\n.Checkbox {\n margin-top: 0;\n}\n\n.FlexBox {\n display: flex;\n}\n\n.Title {\n font-size: var(--text-body-size-medium);\n font-weight: var(--base-text-weight-semibold);\n}\n\n.Description {\n display: block;\n font-size: var(--text-body-size-small);\n color: var(--fgColor-muted);\n}\n\n.ClearAction {\n color: var(--fgColor-muted);\n background: none;\n}\n\n.Footer {\n display: flex;\n min-height: 44px;\n padding: var(--base-size-16);\n border-top: var(--borderWidth-thin) solid;\n border-top-color: var(--borderColor-default);\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n\n &:where([data-hide-primary-actions]) {\n padding: var(--base-size-8);\n }\n}\n\n.FooterContent {\n flex-grow: 0;\n\n &:where([data-hide-primary-actions]) {\n flex-grow: 1;\n }\n}\n\n.FooterActions {\n display: flex;\n gap: var(--stack-gap-condensed);\n}\n\n.SecondaryCheckbox {\n display: flex;\n align-items: center;\n gap: var(--stack-gap-condensed);\n}\n\n.SmallText {\n font-size: var(--text-body-size-small);\n}\n\n.SelectPanelLoading {\n display: flex;\n height: 100%;\n\n /* maxHeight of dialog - (header & footer) */\n min-height: min(calc(var(--max-height) - 150px), 324px);\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: var(--stack-gap-normal);\n}\n\n.LoadingText {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n}\n\n.MessageFull {\n display: flex;\n height: 100%;\n\n /* maxHeight of dialog - (header & footer) */\n min-height: min(calc(var(--max-height) - 150px), 324px);\n padding-right: var(--base-size-24);\n padding-left: var(--base-size-24);\n text-align: center;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n gap: var(--base-size-4);\n\n a {\n color: inherit;\n text-decoration: underline;\n }\n}\n\n.Octicon {\n margin-bottom: var(--base-size-8);\n\n &.Error {\n color: var(--fgColor-danger);\n }\n\n &.Warning {\n color: var(--fgColor-attention);\n }\n}\n\n.MessageTitle {\n font-size: var(--text-body-size-medium);\n font-weight: var(--base-text-weight-medium);\n}\n\n.MessageContent {\n display: flex;\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex-direction: column;\n gap: var(--stack-gap-condensed);\n align-items: center;\n}\n\n.MessageInline {\n display: flex;\n padding-top: var(--base-size-12);\n padding-right: var(--base-size-16);\n padding-bottom: var(--base-size-12);\n padding-left: var(--base-size-16);\n font-size: var(--text-body-size-small);\n border-bottom: var(--borderWidth-thin) solid;\n gap: var(--stack-gap-condensed);\n\n a {\n color: inherit;\n text-decoration: underline;\n }\n\n &:where([data-variant='error']) {\n color: var(--fgColor-danger);\n background-color: var(--bgColor-danger-muted);\n border-color: var(--borderColor-danger-muted);\n }\n\n &:where([data-variant='warning']) {\n color: var(--fgColor-attention);\n background-color: var(--bgColor-attention-muted);\n border-color: var(--borderColor-attention-muted);\n }\n}\n\n.Header {\n display: flex;\n padding: var(--base-size-8);\n flex-direction: column;\n border-bottom: var(--borderWidth-thin) solid;\n border-bottom-color: var(--borderColor-default);\n}\n"]}
|
|
@@ -6,7 +6,6 @@ import { isSlot } from "../../utils/is-slot.js";
|
|
|
6
6
|
import { createComponent } from "../../utils/create-component.js";
|
|
7
7
|
import { UnderlineItem, UnderlineItemList, UnderlineWrapper } from "../../internal/components/UnderlineTabbedInterface.js";
|
|
8
8
|
import UnderlinePanels_module_css_default from "./UnderlinePanels.module.css.js";
|
|
9
|
-
import { c } from "react-compiler-runtime";
|
|
10
9
|
import { clsx } from "clsx";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
11
|
import React, { Children, cloneElement, createContext, isValidElement, useContext, useMemo, useRef, useState } from "react";
|
|
@@ -22,7 +21,7 @@ const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabel
|
|
|
22
21
|
const wrapperRef = useRef(null);
|
|
23
22
|
const listRef = useRef(null);
|
|
24
23
|
const parentId = useId$1(props.id);
|
|
25
|
-
const [
|
|
24
|
+
const [tabs, tabPanels, tabsHaveIcons] = useMemo(() => {
|
|
26
25
|
let tabIndex = 0;
|
|
27
26
|
let panelIndex = 0;
|
|
28
27
|
const childrenWithProps = Children.map(children, (child) => {
|
|
@@ -32,10 +31,10 @@ const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabel
|
|
|
32
31
|
});
|
|
33
32
|
const tabs = [];
|
|
34
33
|
const tabPanels = [];
|
|
35
|
-
for (const
|
|
36
|
-
if (!/*#__PURE__*/ isValidElement(
|
|
37
|
-
if (
|
|
38
|
-
else if (
|
|
34
|
+
for (const child of Children.toArray(childrenWithProps)) {
|
|
35
|
+
if (!/*#__PURE__*/ isValidElement(child)) continue;
|
|
36
|
+
if (child.type === Tab || isSlot(child, Tab)) tabs.push(child);
|
|
37
|
+
else if (child.type === Panel || isSlot(child, Panel)) tabPanels.push(child);
|
|
39
38
|
}
|
|
40
39
|
return [
|
|
41
40
|
tabs,
|
|
@@ -53,20 +52,20 @@ const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabel
|
|
|
53
52
|
}, [iconsVisible]);
|
|
54
53
|
const listWidthRef = useRef(0);
|
|
55
54
|
useResizeObserver((entries) => {
|
|
56
|
-
if (!
|
|
55
|
+
if (!tabsHaveIcons) return;
|
|
57
56
|
if (!iconsVisibleRef.current) return;
|
|
58
57
|
listWidthRef.current = entries[0].contentRect.width;
|
|
59
58
|
}, listRef, []);
|
|
60
59
|
useResizeObserver((resizeObserverEntries) => {
|
|
61
|
-
if (!
|
|
60
|
+
if (!tabsHaveIcons) return;
|
|
62
61
|
const wrapperWidth = resizeObserverEntries[0].contentRect.width;
|
|
63
62
|
setIconsVisible(wrapperWidth > listWidthRef.current);
|
|
64
63
|
}, wrapperRef, []);
|
|
65
|
-
!(
|
|
66
|
-
const ariaSelected = /*#__PURE__*/ React.isValidElement(
|
|
64
|
+
!(tabs.filter((tab) => {
|
|
65
|
+
const ariaSelected = /*#__PURE__*/ React.isValidElement(tab) && tab.props["aria-selected"];
|
|
67
66
|
return ariaSelected === true || ariaSelected === "true";
|
|
68
67
|
}).length <= 1) && invariant(false, "Only one tab can be selected at a time.");
|
|
69
|
-
!(
|
|
68
|
+
!(tabs.length === tabPanels.length) && invariant(false, `The number of tabs and panels must be equal. Counted ${tabs.length} tabs and ${tabPanels.length} panels.`);
|
|
70
69
|
return /*#__PURE__*/ jsx(UnderlinePanelsContext.Provider, {
|
|
71
70
|
value: contextValue,
|
|
72
71
|
children: /*#__PURE__*/ jsxs(TabContainerComponent, { children: [/*#__PURE__*/ jsx(UnderlineWrapper, {
|
|
@@ -80,100 +79,44 @@ const UnderlinePanels = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabel
|
|
|
80
79
|
"aria-label": ariaLabel,
|
|
81
80
|
"aria-labelledby": ariaLabelledBy,
|
|
82
81
|
role: "tablist",
|
|
83
|
-
children:
|
|
82
|
+
children: tabs
|
|
84
83
|
})
|
|
85
|
-
}),
|
|
84
|
+
}), tabPanels] })
|
|
86
85
|
});
|
|
87
86
|
};
|
|
88
87
|
UnderlinePanels.displayName = "UnderlinePanels";
|
|
89
|
-
const TabImpl = (
|
|
90
|
-
const $ = c(15);
|
|
91
|
-
let ariaSelected;
|
|
92
|
-
let onSelect;
|
|
93
|
-
let props;
|
|
94
|
-
if ($[0] !== t0) {
|
|
95
|
-
({"aria-selected": ariaSelected, onSelect, ...props} = t0);
|
|
96
|
-
$[0] = t0;
|
|
97
|
-
$[1] = ariaSelected;
|
|
98
|
-
$[2] = onSelect;
|
|
99
|
-
$[3] = props;
|
|
100
|
-
} else {
|
|
101
|
-
ariaSelected = $[1];
|
|
102
|
-
onSelect = $[2];
|
|
103
|
-
props = $[3];
|
|
104
|
-
}
|
|
88
|
+
const TabImpl = ({ "aria-selected": ariaSelected, onSelect, ...props }) => {
|
|
105
89
|
const { loadingCounters } = useContext(UnderlinePanelsContext);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
const keyDownHandler = t2;
|
|
124
|
-
const t3 = ariaSelected ? 0 : -1;
|
|
125
|
-
let t4;
|
|
126
|
-
if ($[8] !== ariaSelected || $[9] !== clickHandler || $[10] !== keyDownHandler || $[11] !== loadingCounters || $[12] !== props || $[13] !== t3) {
|
|
127
|
-
t4 = /*#__PURE__*/ jsx(UnderlineItem, {
|
|
128
|
-
as: "button",
|
|
129
|
-
role: "tab",
|
|
130
|
-
tabIndex: t3,
|
|
131
|
-
"aria-selected": ariaSelected,
|
|
132
|
-
type: "button",
|
|
133
|
-
onClick: clickHandler,
|
|
134
|
-
onKeyDown: keyDownHandler,
|
|
135
|
-
loadingCounters,
|
|
136
|
-
...props
|
|
137
|
-
});
|
|
138
|
-
$[8] = ariaSelected;
|
|
139
|
-
$[9] = clickHandler;
|
|
140
|
-
$[10] = keyDownHandler;
|
|
141
|
-
$[11] = loadingCounters;
|
|
142
|
-
$[12] = props;
|
|
143
|
-
$[13] = t3;
|
|
144
|
-
$[14] = t4;
|
|
145
|
-
} else t4 = $[14];
|
|
146
|
-
return t4;
|
|
90
|
+
const clickHandler = React.useCallback((event) => {
|
|
91
|
+
if (!event.defaultPrevented && typeof onSelect === "function") onSelect(event);
|
|
92
|
+
}, [onSelect]);
|
|
93
|
+
const keyDownHandler = React.useCallback((event) => {
|
|
94
|
+
if ((event.key === " " || event.key === "Enter") && !event.defaultPrevented && typeof onSelect === "function") onSelect(event);
|
|
95
|
+
}, [onSelect]);
|
|
96
|
+
return /*#__PURE__*/ jsx(UnderlineItem, {
|
|
97
|
+
as: "button",
|
|
98
|
+
role: "tab",
|
|
99
|
+
tabIndex: ariaSelected ? 0 : -1,
|
|
100
|
+
"aria-selected": ariaSelected,
|
|
101
|
+
type: "button",
|
|
102
|
+
onClick: clickHandler,
|
|
103
|
+
onKeyDown: keyDownHandler,
|
|
104
|
+
loadingCounters,
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
147
107
|
};
|
|
108
|
+
TabImpl.displayName = "TabImpl";
|
|
148
109
|
TabImpl.displayName = "UnderlinePanels.Tab";
|
|
149
110
|
const Tab = /*#__PURE__*/ React.memo(TabImpl);
|
|
150
111
|
Tab.displayName = "UnderlinePanels.Tab";
|
|
151
|
-
const Panel = (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
$[0] = t0;
|
|
158
|
-
$[1] = children;
|
|
159
|
-
$[2] = rest;
|
|
160
|
-
} else {
|
|
161
|
-
children = $[1];
|
|
162
|
-
rest = $[2];
|
|
163
|
-
}
|
|
164
|
-
let t1;
|
|
165
|
-
if ($[3] !== children || $[4] !== rest) {
|
|
166
|
-
t1 = /*#__PURE__*/ jsx("div", {
|
|
167
|
-
role: "tabpanel",
|
|
168
|
-
...rest,
|
|
169
|
-
children
|
|
170
|
-
});
|
|
171
|
-
$[3] = children;
|
|
172
|
-
$[4] = rest;
|
|
173
|
-
$[5] = t1;
|
|
174
|
-
} else t1 = $[5];
|
|
175
|
-
return t1;
|
|
112
|
+
const Panel = ({ children, ...rest }) => {
|
|
113
|
+
return /*#__PURE__*/ jsx("div", {
|
|
114
|
+
role: "tabpanel",
|
|
115
|
+
...rest,
|
|
116
|
+
children
|
|
117
|
+
});
|
|
176
118
|
};
|
|
119
|
+
Panel.displayName = "Panel";
|
|
177
120
|
Panel.displayName = "UnderlinePanels.Panel";
|
|
178
121
|
var UnderlinePanels_default = Object.assign(UnderlinePanels, {
|
|
179
122
|
Panel,
|