@primer/react 38.30.0-rc.dc0369509 → 38.30.1-rc.2d1806208
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 +18 -0
- package/dist/ActionBar/ActionBar.d.ts +24 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +96 -4
- package/dist/ActionBar/index.d.ts +21 -1
- package/dist/ActionBar/index.d.ts.map +1 -1
- package/dist/ActionBar/index.js +2 -1
- package/dist/Heading/Heading.js +69 -19
- package/dist/Link/Link.js +81 -25
- package/dist/NavList/NavList-b50d982b.css +2 -0
- package/dist/NavList/NavList-b50d982b.css.map +1 -0
- package/dist/NavList/NavList.d.ts +13 -4
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/NavList/NavList.js +238 -70
- package/dist/NavList/NavList.module.css.js +2 -2
- package/dist/Pagehead/Pagehead.js +45 -11
- package/dist/SelectPanel/SelectPanel.d.ts +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +4 -1
- package/dist/SideNav.js +112 -41
- package/dist/UnderlineNav/UnderlineNav-47547980.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-47547980.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +1 -2
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +91 -331
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +1 -11
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +1 -4
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css +2 -0
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItem.d.ts +1 -44
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +33 -38
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts +51 -0
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.js +8 -0
- package/dist/UnderlineNav/index.d.ts +1 -1
- package/dist/UnderlineNav/index.d.ts.map +1 -1
- package/dist/UnderlineNav/utils.d.ts +2 -0
- package/dist/UnderlineNav/utils.d.ts.map +1 -1
- package/dist/UnderlineNav/utils.js +2 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css +2 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css.map +1 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +8 -11
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.d.ts +0 -1
- package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
- package/dist/internal/components/UnderlineTabbedInterface.js +66 -60
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/generated/components.json +72 -5
- package/package.json +1 -1
- package/dist/NavList/NavList-5dc067e3.css +0 -2
- package/dist/NavList/NavList-5dc067e3.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +0 -2
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +0 -1
- package/dist/UnderlineNav/styles.d.ts +0 -16
- package/dist/UnderlineNav/styles.d.ts.map +0 -1
- package/dist/UnderlineNav/styles.js +0 -19
- package/dist/UnderlineNav/types.d.ts +0 -10
- package/dist/UnderlineNav/types.d.ts.map +0 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +0 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
package/dist/SideNav.js
CHANGED
|
@@ -1,51 +1,122 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import classes from './SideNav.module.css.js';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
import Link from './Link/Link.js';
|
|
5
6
|
|
|
6
|
-
function SideNav({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
function SideNav(t0) {
|
|
8
|
+
const $ = c(10);
|
|
9
|
+
const {
|
|
10
|
+
as: t1,
|
|
11
|
+
variant: t2,
|
|
12
|
+
className,
|
|
13
|
+
bordered,
|
|
14
|
+
children,
|
|
15
|
+
"aria-label": ariaLabel
|
|
16
|
+
} = t0;
|
|
17
|
+
const Component = t1 === undefined ? "nav" : t1;
|
|
18
|
+
const variant = t2 === undefined ? "normal" : t2;
|
|
19
|
+
const variantClassName = variant === "lightweight" ? "lightweight" : "normal";
|
|
20
|
+
const t3 = classes[`SideNavVariant--${variantClassName}`];
|
|
21
|
+
const t4 = `variant-${variantClassName}`;
|
|
22
|
+
let t5;
|
|
23
|
+
if ($[0] !== bordered || $[1] !== className || $[2] !== t3 || $[3] !== t4) {
|
|
24
|
+
t5 = clsx(classes.SideNav, t3, "sidenav", t4, className, {
|
|
25
|
+
[classes.SideNavBordered]: bordered
|
|
26
|
+
});
|
|
27
|
+
$[0] = bordered;
|
|
28
|
+
$[1] = className;
|
|
29
|
+
$[2] = t3;
|
|
30
|
+
$[3] = t4;
|
|
31
|
+
$[4] = t5;
|
|
32
|
+
} else {
|
|
33
|
+
t5 = $[4];
|
|
34
|
+
}
|
|
35
|
+
const newClassName = t5;
|
|
36
|
+
let t6;
|
|
37
|
+
if ($[5] !== Component || $[6] !== ariaLabel || $[7] !== children || $[8] !== newClassName) {
|
|
38
|
+
t6 = /*#__PURE__*/jsx(Component, {
|
|
39
|
+
className: newClassName,
|
|
40
|
+
"aria-label": ariaLabel,
|
|
41
|
+
"data-component": "SideNav",
|
|
42
|
+
children: children
|
|
43
|
+
});
|
|
44
|
+
$[5] = Component;
|
|
45
|
+
$[6] = ariaLabel;
|
|
46
|
+
$[7] = children;
|
|
47
|
+
$[8] = newClassName;
|
|
48
|
+
$[9] = t6;
|
|
49
|
+
} else {
|
|
50
|
+
t6 = $[9];
|
|
51
|
+
}
|
|
52
|
+
return t6;
|
|
24
53
|
}
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
const SideNavLink = t0 => {
|
|
55
|
+
const $ = c(15);
|
|
56
|
+
let children;
|
|
57
|
+
let className;
|
|
58
|
+
let rest;
|
|
59
|
+
let selected;
|
|
60
|
+
let to;
|
|
61
|
+
let variant;
|
|
62
|
+
if ($[0] !== t0) {
|
|
63
|
+
({
|
|
64
|
+
selected,
|
|
65
|
+
to,
|
|
66
|
+
variant,
|
|
67
|
+
className,
|
|
68
|
+
children,
|
|
69
|
+
...rest
|
|
70
|
+
} = t0);
|
|
71
|
+
$[0] = t0;
|
|
72
|
+
$[1] = children;
|
|
73
|
+
$[2] = className;
|
|
74
|
+
$[3] = rest;
|
|
75
|
+
$[4] = selected;
|
|
76
|
+
$[5] = to;
|
|
77
|
+
$[6] = variant;
|
|
78
|
+
} else {
|
|
79
|
+
children = $[1];
|
|
80
|
+
className = $[2];
|
|
81
|
+
rest = $[3];
|
|
82
|
+
selected = $[4];
|
|
83
|
+
to = $[5];
|
|
84
|
+
variant = $[6];
|
|
85
|
+
}
|
|
86
|
+
const isReactRouter = typeof to === "string";
|
|
87
|
+
const t1 = variant === "full";
|
|
88
|
+
let t2;
|
|
89
|
+
if ($[7] !== className || $[8] !== t1) {
|
|
90
|
+
t2 = clsx(classes.SideNavLink, className, {
|
|
91
|
+
[classes.SideNavLinkFull]: t1
|
|
92
|
+
});
|
|
93
|
+
$[7] = className;
|
|
94
|
+
$[8] = t1;
|
|
95
|
+
$[9] = t2;
|
|
96
|
+
} else {
|
|
97
|
+
t2 = $[9];
|
|
98
|
+
}
|
|
99
|
+
const newClassName = t2;
|
|
100
|
+
const t3 = isReactRouter || selected ? "page" : undefined;
|
|
101
|
+
let t4;
|
|
102
|
+
if ($[10] !== children || $[11] !== newClassName || $[12] !== rest || $[13] !== t3) {
|
|
103
|
+
t4 = /*#__PURE__*/jsx(Link, {
|
|
104
|
+
"aria-current": t3,
|
|
105
|
+
className: newClassName,
|
|
106
|
+
...rest,
|
|
107
|
+
"data-component": "SideNav.Link",
|
|
108
|
+
children: children
|
|
109
|
+
});
|
|
110
|
+
$[10] = children;
|
|
111
|
+
$[11] = newClassName;
|
|
112
|
+
$[12] = rest;
|
|
113
|
+
$[13] = t3;
|
|
114
|
+
$[14] = t4;
|
|
115
|
+
} else {
|
|
116
|
+
t4 = $[14];
|
|
117
|
+
}
|
|
118
|
+
return t4;
|
|
47
119
|
};
|
|
48
|
-
SideNavLink.displayName = "SideNavLink";
|
|
49
120
|
SideNavLink.displayName = 'SideNav.Link';
|
|
50
121
|
/** @deprecated Use [NavList](https://primer.style/react/NavList) instead */
|
|
51
122
|
var SideNav_default = Object.assign(SideNav, {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-UnderlineNav-UnderlineWrapper-GWONT{animation:prc-UnderlineNav-detect-overflow-6HuSH linear;animation-timeline:scroll(self block);--UnderlineNav_moreButton-visibility:hidden;--UnderlineNav_icons-display:inline}.prc-UnderlineNav-UnderlineWrapper-GWONT[data-hide-icons=true]{--UnderlineNav_icons-display:none}.prc-UnderlineNav-UnderlineWrapper-GWONT[data-has-overflow=true]{--UnderlineNav_moreButton-visibility:visible}@keyframes prc-UnderlineNav-detect-overflow-6HuSH{0%,to{--UnderlineNav_moreButton-visibility:visible;--UnderlineNav_icons-display:none}}.prc-UnderlineNav-ItemsList-oj8gN [data-component=icon]{display:var(--UnderlineNav_icons-display)}.prc-UnderlineNav-MoreButtonContainer-Dnrq6{align-items:center;display:flex;visibility:var(--UnderlineNav_moreButton-visibility)}.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-47547980.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/UnderlineNav/UnderlineNav.module.css.js"],"names":[],"mappings":"AAAA,yCAIE,uDAAiC,CACjC,qCAAsC,CAEtC,2CAA4C,CAC5C,mCASF,CAPE,+DACE,iCACF,CAEA,iEACE,4CACF,CAGF,kDACE,MAEE,4CAA6C,CAC7C,iCACF,CACF,CAEA,wDACE,yCACF,CAEA,4CAGE,kBAAmB,CAFnB,YAAa,CACb,oDAEF,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-47547980.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\n --UnderlineNav_moreButton-visibility: hidden;\n --UnderlineNav_icons-display: inline;\n\n &[data-hide-icons='true'] {\n --UnderlineNav_icons-display: none;\n }\n\n &[data-has-overflow='true'] {\n --UnderlineNav_moreButton-visibility: visible;\n }\n}\n\n@keyframes detect-overflow {\n 0%,\n 100% {\n --UnderlineNav_moreButton-visibility: visible;\n --UnderlineNav_icons-display: none;\n }\n}\n\n.ItemsList [data-component='icon'] {\n display: var(--UnderlineNav_icons-display);\n}\n\n.MoreButtonContainer {\n display: flex;\n visibility: var(--UnderlineNav_moreButton-visibility);\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"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
export type UnderlineNavProps = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
@@ -15,6 +15,5 @@ export type UnderlineNavProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
variant?: 'inset' | 'flush';
|
|
17
17
|
};
|
|
18
|
-
export declare const MORE_BTN_WIDTH = 86;
|
|
19
18
|
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
|
|
20
19
|
//# sourceMappingURL=UnderlineNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,YAAY,mFAsIxB,CAAA"}
|