@primer/react 0.0.0-20260526182004 → 0.0.0-20260526185655
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 +7 -11
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +4 -0
- package/dist/UnderlineNav/UnderlineNav-4c80468c.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-4c80468c.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +1 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +41 -484
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +0 -1
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +1 -2
- package/dist/UnderlineNav/UnderlineNavItem.d.ts +1 -3
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +41 -23
- package/dist/UnderlineNav/index.d.ts +1 -1
- package/dist/UnderlineNav/types.d.ts +5 -1
- package/dist/UnderlineNav/types.d.ts.map +1 -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.js +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-7317470b.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-7317470b.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 +2 -2
- package/package.json +1 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;qBACb,OAAO;
|
|
1
|
+
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB;qBACb,OAAO;EAGxB,CAAA"}
|
|
@@ -43,7 +43,5 @@ export type UnderlineNavItemProps = {
|
|
|
43
43
|
*/
|
|
44
44
|
counter?: number | string;
|
|
45
45
|
} & LinkProps;
|
|
46
|
-
declare const
|
|
47
|
-
export declare const UnderlineNavItem: typeof UnderlineNavItemImpl;
|
|
48
|
-
export {};
|
|
46
|
+
export declare const UnderlineNavItem: PolymorphicForwardRefComponent<"a", UnderlineNavItemProps>;
|
|
49
47
|
//# sourceMappingURL=UnderlineNavItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavItem.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnderlineNavItem.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAC3D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACjF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAExG;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;IAE5F;;;OAGG;IAEH,IAAI,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAEnE;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAElC;;QAEI;IACJ,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAA;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,GAAG,SAAS,CAAA;AAsBb,eAAO,MAAM,gBAAgB,EA8DvB,8BAA8B,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAA"}
|
|
@@ -2,24 +2,40 @@ import React, { forwardRef, useRef, useContext } from 'react';
|
|
|
2
2
|
import { UnderlineNavContext } from './UnderlineNavContext.js';
|
|
3
3
|
import { UnderlineItem } from '../internal/components/UnderlineTabbedInterface.js';
|
|
4
4
|
import classes from './UnderlineNavItem.module.css.js';
|
|
5
|
+
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
5
6
|
import { jsx } from 'react/jsx-runtime';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
8
|
+
function scrollIntoViewHorizontally(container, descendant) {
|
|
9
|
+
// Walk up the offset parent chain to get the true left offset relative to `container`
|
|
10
|
+
let offsetLeft = 0;
|
|
11
|
+
let el = descendant;
|
|
12
|
+
while (el && el !== container) {
|
|
13
|
+
offsetLeft += el.offsetLeft;
|
|
14
|
+
el = el.offsetParent;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// scrollIntoView would be more convenient but would scroll the entire page unless we pass `options.container`,
|
|
18
|
+
// for which browser support is very limited
|
|
19
|
+
const descendantLeft = offsetLeft - container.scrollLeft;
|
|
20
|
+
const descendantRight = descendantLeft + descendant.offsetWidth;
|
|
21
|
+
const containerWidth = container.clientWidth;
|
|
22
|
+
if (descendantLeft < 0) container.scrollLeft += descendantLeft;else if (descendantRight > containerWidth) container.scrollLeft += descendantRight - containerWidth;
|
|
23
|
+
}
|
|
24
|
+
const UnderlineNavItem = /*#__PURE__*/forwardRef((allProps, forwardedRef) => {
|
|
25
|
+
const {
|
|
26
|
+
as: Component = 'a',
|
|
27
|
+
href = '#',
|
|
28
|
+
children,
|
|
29
|
+
counter,
|
|
30
|
+
onSelect,
|
|
31
|
+
'aria-current': ariaCurrent,
|
|
32
|
+
icon: Icon,
|
|
33
|
+
leadingVisual,
|
|
34
|
+
...props
|
|
35
|
+
} = allProps;
|
|
36
|
+
const ref = useRef(null);
|
|
20
37
|
const {
|
|
21
|
-
loadingCounters
|
|
22
|
-
iconsVisible
|
|
38
|
+
loadingCounters
|
|
23
39
|
} = useContext(UnderlineNavContext);
|
|
24
40
|
const keyDownHandler = React.useCallback(event => {
|
|
25
41
|
if ((event.key === ' ' || event.key === 'Enter') && !event.defaultPrevented && typeof onSelect === 'function') {
|
|
@@ -31,11 +47,18 @@ const UnderlineNavItemImpl = /*#__PURE__*/forwardRef(({
|
|
|
31
47
|
onSelect(event);
|
|
32
48
|
}
|
|
33
49
|
}, [onSelect]);
|
|
50
|
+
useIsomorphicLayoutEffect(() => {
|
|
51
|
+
if (ariaCurrent && ariaCurrent !== 'false' && ref.current) {
|
|
52
|
+
const scrollContainer = ref.current.closest('[data-component="underlinenav-scrollcontainer"]');
|
|
53
|
+
if (!(scrollContainer instanceof HTMLElement)) return;
|
|
54
|
+
scrollIntoViewHorizontally(scrollContainer, ref.current);
|
|
55
|
+
}
|
|
56
|
+
}, [ariaCurrent]);
|
|
34
57
|
return /*#__PURE__*/jsx("li", {
|
|
35
58
|
className: classes.UnderlineNavItem,
|
|
36
|
-
|
|
59
|
+
ref: ref,
|
|
37
60
|
children: /*#__PURE__*/jsx(UnderlineItem, {
|
|
38
|
-
ref:
|
|
61
|
+
ref: forwardedRef,
|
|
39
62
|
as: Component,
|
|
40
63
|
href: href,
|
|
41
64
|
"aria-current": ariaCurrent,
|
|
@@ -44,16 +67,11 @@ const UnderlineNavItemImpl = /*#__PURE__*/forwardRef(({
|
|
|
44
67
|
counter: counter,
|
|
45
68
|
icon: leadingVisual !== null && leadingVisual !== void 0 ? leadingVisual : Icon,
|
|
46
69
|
loadingCounters: loadingCounters,
|
|
47
|
-
iconsVisible: iconsVisible,
|
|
48
70
|
...props,
|
|
49
71
|
children: children
|
|
50
72
|
})
|
|
51
73
|
});
|
|
52
74
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// Memoized so that re-renders of UnderlineNav (e.g. when overflow state changes)
|
|
56
|
-
// do not re-render every item when the consumer-provided children haven't changed.
|
|
57
|
-
const UnderlineNavItem = /*#__PURE__*/React.memo(UnderlineNavItemImpl);
|
|
75
|
+
UnderlineNavItem.displayName = 'UnderlineNavItem';
|
|
58
76
|
|
|
59
77
|
export { UnderlineNavItem };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnderlineNavProps } from './UnderlineNav';
|
|
2
2
|
import type { UnderlineNavItemProps } from './UnderlineNavItem';
|
|
3
|
-
declare const UnderlineNav: import("react").ForwardRefExoticComponent<UnderlineNavProps & import("react").RefAttributes<
|
|
3
|
+
declare const UnderlineNav: import("react").ForwardRefExoticComponent<UnderlineNavProps & import("react").RefAttributes<HTMLElement>> & {
|
|
4
4
|
Item: import("../utils/polymorphic").ForwardRefComponent<"a", UnderlineNavItemProps>;
|
|
5
5
|
};
|
|
6
6
|
export { UnderlineNav };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type ChildSize = {
|
|
2
|
+
text: string;
|
|
3
|
+
width: number;
|
|
4
|
+
};
|
|
5
|
+
export type ChildWidthArray = Array<ChildSize>;
|
|
2
6
|
export type ResponsiveProps = {
|
|
3
7
|
items: Array<React.ReactElement<any>>;
|
|
4
8
|
menuItems: Array<React.ReactElement<any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;AAC9C,MAAM,MAAM,eAAe,GAAG;IAE5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAA;IAErC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAA;CAC1C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/experimental/UnderlinePanels/UnderlinePanels.module.css.js"],"names":[],"mappings":"AAAA,kDAEE,eAAgB,CAChB,iBAAkB,CAFlB,UAAW,CAGX,+BACF","file":"UnderlinePanels-162f9aed.css","sourcesContent":[".StyledUnderlineWrapper {\n width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: auto;\n}\n"]}
|
|
@@ -94,7 +94,7 @@ const UnderlinePanels = ({
|
|
|
94
94
|
children: [/*#__PURE__*/jsx(UnderlineWrapper, {
|
|
95
95
|
ref: wrapperRef,
|
|
96
96
|
slot: "tablist-wrapper",
|
|
97
|
-
"data-icons
|
|
97
|
+
"data-hide-icons": !iconsVisible,
|
|
98
98
|
className: clsx(className, classes.StyledUnderlineWrapper),
|
|
99
99
|
...props,
|
|
100
100
|
children: /*#__PURE__*/jsx(UnderlineItemList, {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-components-UnderlineWrapper-eT-Yj{align-items:flex-start;box-shadow:inset 0 -1px var(--borderColor-muted,#d1d9e0b3);display:flex;justify-content:flex-start;min-height:var(--control-xlarge-size,3rem);padding-top:var(--base-size-8,.5rem);padding-inline:var(--stack-padding-normal,1rem);width:100%}.prc-components-UnderlineWrapper-eT-Yj[data-variant=flush]{padding-inline:unset}.prc-components-UnderlineWrapper-eT-Yj[data-hide-icons=true] [data-component=icon]{display:none}.prc-components-UnderlineItemList-xKlKC{display:flex;gap:var(--stack-gap-condensed,.5rem);list-style:none;margin:0;padding:0;white-space:nowrap}.prc-components-UnderlineItem-7fP-n,.prc-components-UnderlineItemList-xKlKC{align-items:center;position:relative}.prc-components-UnderlineItem-7fP-n{appearance:none;background-color:transparent;border:0;border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,#1f2328);cursor:pointer;display:inline-flex;font:inherit;font-size:var(--text-body-size-medium,.875rem);height:32px;line-height:var(--text-body-lineHeight-medium,1.4285);margin-bottom:var(--base-size-8,.5rem);max-width:100%;padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.prc-components-UnderlineItem-7fP-n:hover{background-color:var(--bgColor-neutral-muted,#818b981f);-webkit-text-decoration:none;text-decoration:none;transition:background-color .12s ease-out}}.prc-components-UnderlineItem-7fP-n:focus{box-shadow:inset 0 0 0 2px var(--fgColor-accent,#0969da);outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n:focus:not(:focus-visible){box-shadow:none}.prc-components-UnderlineItem-7fP-n:focus-visible{box-shadow:inset 0 0 0 2px var(--fgColor-accent,#0969da);outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n [data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;visibility:hidden;white-space:nowrap}.prc-components-UnderlineItem-7fP-n [data-component=icon]{align-items:center;color:var(--fgColor-muted,#59636e);display:inline-flex;margin-inline-end:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n [data-component=counter]{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n:after{background-color:transparent;content:"";height:2px;inset:auto 0 0;margin-bottom:calc(var(--base-size-8,.5rem)*-1);pointer-events:none;position:absolute}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]) [data-component=text],.prc-components-UnderlineItem-7fP-n[aria-selected=true] [data-component=text]{font-weight:var(--base-text-weight-semibold,600)}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73))}@media (forced-colors:active){.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:LinkText}}.prc-components-LoadingCounter-dBuLy{animation:prc-components-loadingCounterKeyFrames-8tMlf 1.2s ease-in-out infinite alternate;background-color:var(--bgColor-neutral-muted,#818b981f);border-color:var(--borderColor-default,#d1d9e0);border-radius:20px;display:inline-block;height:1rem;width:1.5rem}@keyframes prc-components-loadingCounterKeyFrames-8tMlf{0%{opacity:1}to{opacity:.2}}
|
|
2
|
+
/*# sourceMappingURL=UnderlineTabbedInterface-7317470b.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/components/UnderlineTabbedInterface.module.css.js"],"names":[],"mappings":"AAAA,uCAME,sBAAuB,CAQvB,0DAAiD,CAbjD,YAAa,CAIb,0BAA2B,CAK3B,0CAAsC,CARtC,oCAA+B,CAE/B,+CAA2C,CAG3C,UAiBF,CARE,2DAEE,oBACF,CAEA,mFACE,YACF,CAGF,wCAEE,YAAa,CAMb,oCAA+B,CAF/B,eAAgB,CAFhB,QAAS,CADT,SAAU,CAEV,kBAIF,CAEA,4EAJE,kBAAmB,CANnB,iBAyCF,CA/BA,oCAmBE,eAAgB,CARhB,4BAA6B,CAC7B,QAAS,CACT,gDAAyC,CANzC,oCAA6B,CAG7B,cAAe,CAPf,mBAAoB,CACpB,YAAa,CACb,8CAAuC,CAWvC,WAAY,CAVZ,qDAAuD,CASvD,sCAAiC,CADjC,cAAe,CAOf,wCAAiC,CADjC,uCAAkC,CAZlC,iBAAkB,CAClB,4BAAqB,CAArB,oBAsBF,CAPE,qBACE,0CAEE,uDAA8C,CAD9C,4BAAqB,CAArB,oBAAqB,CAErB,yCACF,CACF,CAGF,0CAGE,wDAAiD,CAFjD,6BAQF,CAHE,8DACE,eACF,CAGF,kDAGE,wDAAiD,CAFjD,6BAGF,CAGA,0DAME,0BAA2B,CAL3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAGT,iBAAkB,CADlB,kBAGF,CAEA,0DAGE,kBAAmB,CADnB,kCAA2B,CAD3B,mBAAoB,CAGpB,0CACF,CAEA,6DAGE,kBAAmB,CADnB,YAAa,CADb,4CAGF,CAEA,0CAOE,4BAA6B,CAD7B,UAAW,CAFX,UAAW,CAFX,cAAe,CACf,+CAA4C,CAE5C,mBAAoB,CAJpB,iBAOF,CAEA,gLAEE,gDACF,CAEA,gJAGE,iGAMF,CAJE,8BALF,gJAOI,yBAEJ,CADE,CAGF,qCASE,0FAAsE,CAJtE,uDAA8C,CAC9C,+CAAwC,CAExC,kBAAmB,CAPnB,oBAAqB,CAErB,WAAY,CADZ,YAQF,CAEA,wDACE,GACE,SACF,CAEA,GACE,UACF,CACF","file":"UnderlineTabbedInterface-7317470b.css","sourcesContent":[".UnderlineWrapper {\n display: flex;\n padding-top: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--stack-padding-normal);\n justify-content: flex-start;\n align-items: flex-start;\n width: 100%;\n\n /* make space for the underline */\n min-height: var(--control-xlarge-size);\n\n /* using a box-shadow instead of a border to accommodate 'overflow-y: hidden' on UnderlinePanels */\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 -1px var(--borderColor-muted);\n\n &[data-variant='flush'] {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: unset;\n }\n\n &[data-hide-icons='true'] [data-component='icon'] {\n display: none;\n }\n}\n\n.UnderlineItemList {\n position: relative;\n display: flex;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n list-style: none;\n align-items: center;\n gap: var(--stack-gap-condensed);\n}\n\n.UnderlineItem {\n /* underline tab specific styles */\n position: relative;\n display: inline-flex;\n font: inherit;\n font-size: var(--text-body-size-medium);\n line-height: var(--text-body-lineHeight-medium, 1.4285);\n color: var(--fgColor-default);\n text-align: center;\n text-decoration: none;\n cursor: pointer;\n background-color: transparent;\n border: 0;\n border-radius: var(--borderRadius-medium);\n max-width: 100%;\n margin-bottom: var(--base-size-8);\n height: 32px;\n\n /* button resets */\n appearance: none;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n align-items: center;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: none;\n background-color: var(--bgColor-neutral-muted);\n transition: background-color 0.12s ease-out;\n }\n }\n}\n\n.UnderlineItem:focus {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n\n /* where focus-visible is supported, remove the focus box-shadow */\n &:not(:focus-visible) {\n box-shadow: none;\n }\n}\n\n.UnderlineItem:focus-visible {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n}\n\n/* renders a visibly hidden \"copy\" of the label in bold, reserving box space for when label becomes bold on selected */\n.UnderlineItem [data-content]::before {\n display: block;\n height: 0;\n font-weight: var(--base-text-weight-semibold);\n white-space: nowrap;\n visibility: hidden;\n content: attr(data-content);\n}\n\n.UnderlineItem [data-component='icon'] {\n display: inline-flex;\n color: var(--fgColor-muted);\n align-items: center;\n margin-inline-end: var(--base-size-8);\n}\n\n.UnderlineItem [data-component='counter'] {\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n}\n\n.UnderlineItem::after {\n position: absolute;\n inset: auto 0 0;\n margin-bottom: calc(-1 * var(--base-size-8));\n height: 2px;\n pointer-events: none;\n content: '';\n background-color: transparent;\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false']) [data-component='text'],\n.UnderlineItem[aria-selected='true'] [data-component='text'] {\n font-weight: var(--base-text-weight-semibold);\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false'])::after,\n.UnderlineItem[aria-selected='true']::after {\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 Window Force Color Mode https://learn.microsoft.com/en-us/fluent-ui/web-components/design-system/high-contrast */\n background-color: LinkText;\n }\n}\n\n.LoadingCounter {\n display: inline-block;\n width: 1.5rem;\n height: 1rem;\n /* 16px */\n background-color: var(--bgColor-neutral-muted);\n border-color: var(--borderColor-default);\n /* stylelint-disable-next-line primer/borders */\n border-radius: 20px;\n animation: loadingCounterKeyFrames 1.2s ease-in-out infinite alternate;\n}\n\n@keyframes loadingCounterKeyFrames {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0.2;\n }\n}\n"]}
|
|
@@ -15,7 +15,6 @@ export declare const LoadingCounter: () => React.JSX.Element;
|
|
|
15
15
|
export type UnderlineItemProps<As extends React.ElementType> = {
|
|
16
16
|
as?: As | 'a' | 'button';
|
|
17
17
|
className?: string;
|
|
18
|
-
iconsVisible?: boolean;
|
|
19
18
|
loadingCounters?: boolean;
|
|
20
19
|
counter?: number | string;
|
|
21
20
|
icon?: FC<IconProps> | React.ReactElement<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineTabbedInterface.d.ts","sourceRoot":"","sources":["../../../src/internal/components/UnderlineTabbedInterface.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAgC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"UnderlineTabbedInterface.d.ts","sourceRoot":"","sources":["../../../src/internal/components/UnderlineTabbedInterface.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAgC,KAAK,EAAE,EAAE,KAAK,WAAW,EAAC,MAAM,OAAO,CAAA;AAE9E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,yBAAyB,CAAA;AAMlG,eAAO,MAAM,GAAG,IAAI,CAAA;AAgBpB,KAAK,qBAAqB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAYvB,8BAA8B,CAAC,WAAW,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAA;AAErF,eAAO,MAAM,iBAAiB,EAMxB,8BAA8B,CAAC,IAAI,CAAC,CAAA;AAE1C,eAAO,MAAM,cAAc,yBAE1B,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IAC7D,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,QAAQ,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEzB,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;CACzB,GAAG,KAAK,CAAC,wBAAwB,CAAC,EAAE,SAAS,GAAG,GAAG,GAAG,GAAG,EAAE,SAAS,QAAQ,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAA;AAE9F,eAAO,MAAM,aAAa,EAwBpB,8BAA8B,CAAC,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAA"}
|
|
@@ -6,8 +6,6 @@ import { clsx } from 'clsx';
|
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
import CounterLabel from '../../CounterLabel/CounterLabel.js';
|
|
8
8
|
|
|
9
|
-
const GAP = 8;
|
|
10
|
-
|
|
11
9
|
// Helper to extract direct text content from children for the data-content attribute.
|
|
12
10
|
// This is used by CSS to reserve space for bold text (preventing layout shift).
|
|
13
11
|
// Only extracts strings/numbers, not text from nested React elements (e.g., Popovers).
|
|
@@ -75,37 +73,50 @@ const UnderlineWrapper = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
75
73
|
return t3;
|
|
76
74
|
});
|
|
77
75
|
const UnderlineItemList = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
78
|
-
const $ = c(
|
|
76
|
+
const $ = c(11);
|
|
79
77
|
let children;
|
|
78
|
+
let className;
|
|
80
79
|
let rest;
|
|
81
80
|
if ($[0] !== t0) {
|
|
82
81
|
({
|
|
83
82
|
children,
|
|
83
|
+
className,
|
|
84
84
|
...rest
|
|
85
85
|
} = t0);
|
|
86
86
|
$[0] = t0;
|
|
87
87
|
$[1] = children;
|
|
88
|
-
$[2] =
|
|
88
|
+
$[2] = className;
|
|
89
|
+
$[3] = rest;
|
|
89
90
|
} else {
|
|
90
91
|
children = $[1];
|
|
91
|
-
|
|
92
|
+
className = $[2];
|
|
93
|
+
rest = $[3];
|
|
92
94
|
}
|
|
93
95
|
let t1;
|
|
94
|
-
if ($[
|
|
95
|
-
t1 =
|
|
96
|
-
|
|
96
|
+
if ($[4] !== className) {
|
|
97
|
+
t1 = clsx(className, classes.UnderlineItemList);
|
|
98
|
+
$[4] = className;
|
|
99
|
+
$[5] = t1;
|
|
100
|
+
} else {
|
|
101
|
+
t1 = $[5];
|
|
102
|
+
}
|
|
103
|
+
let t2;
|
|
104
|
+
if ($[6] !== children || $[7] !== forwardedRef || $[8] !== rest || $[9] !== t1) {
|
|
105
|
+
t2 = /*#__PURE__*/jsx("ul", {
|
|
106
|
+
className: t1,
|
|
97
107
|
ref: forwardedRef,
|
|
98
108
|
...rest,
|
|
99
109
|
children: children
|
|
100
110
|
});
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
111
|
+
$[6] = children;
|
|
112
|
+
$[7] = forwardedRef;
|
|
113
|
+
$[8] = rest;
|
|
114
|
+
$[9] = t1;
|
|
115
|
+
$[10] = t2;
|
|
105
116
|
} else {
|
|
106
|
-
|
|
117
|
+
t2 = $[10];
|
|
107
118
|
}
|
|
108
|
-
return
|
|
119
|
+
return t2;
|
|
109
120
|
});
|
|
110
121
|
const LoadingCounter = () => {
|
|
111
122
|
const $ = c(1);
|
|
@@ -121,12 +132,11 @@ const LoadingCounter = () => {
|
|
|
121
132
|
return t0;
|
|
122
133
|
};
|
|
123
134
|
const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
124
|
-
const $ = c(
|
|
135
|
+
const $ = c(28);
|
|
125
136
|
let Icon;
|
|
126
137
|
let children;
|
|
127
138
|
let className;
|
|
128
139
|
let counter;
|
|
129
|
-
let iconsVisible;
|
|
130
140
|
let loadingCounters;
|
|
131
141
|
let rest;
|
|
132
142
|
let t0;
|
|
@@ -136,7 +146,6 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
136
146
|
children,
|
|
137
147
|
counter,
|
|
138
148
|
icon: Icon,
|
|
139
|
-
iconsVisible,
|
|
140
149
|
loadingCounters,
|
|
141
150
|
className,
|
|
142
151
|
...rest
|
|
@@ -146,65 +155,62 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
146
155
|
$[2] = children;
|
|
147
156
|
$[3] = className;
|
|
148
157
|
$[4] = counter;
|
|
149
|
-
$[5] =
|
|
150
|
-
$[6] =
|
|
151
|
-
$[7] =
|
|
152
|
-
$[8] = t0;
|
|
158
|
+
$[5] = loadingCounters;
|
|
159
|
+
$[6] = rest;
|
|
160
|
+
$[7] = t0;
|
|
153
161
|
} else {
|
|
154
162
|
Icon = $[1];
|
|
155
163
|
children = $[2];
|
|
156
164
|
className = $[3];
|
|
157
165
|
counter = $[4];
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
t0 = $[8];
|
|
166
|
+
loadingCounters = $[5];
|
|
167
|
+
rest = $[6];
|
|
168
|
+
t0 = $[7];
|
|
162
169
|
}
|
|
163
170
|
const Component = t0 === undefined ? "a" : t0;
|
|
164
171
|
let t1;
|
|
165
|
-
if ($[
|
|
172
|
+
if ($[8] !== children) {
|
|
166
173
|
t1 = getTextContent(children);
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
174
|
+
$[8] = children;
|
|
175
|
+
$[9] = t1;
|
|
169
176
|
} else {
|
|
170
|
-
t1 = $[
|
|
177
|
+
t1 = $[9];
|
|
171
178
|
}
|
|
172
179
|
const textContent = t1;
|
|
173
180
|
let t2;
|
|
174
|
-
if ($[
|
|
181
|
+
if ($[10] !== className) {
|
|
175
182
|
t2 = clsx(classes.UnderlineItem, className);
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
183
|
+
$[10] = className;
|
|
184
|
+
$[11] = t2;
|
|
178
185
|
} else {
|
|
179
|
-
t2 = $[
|
|
186
|
+
t2 = $[11];
|
|
180
187
|
}
|
|
181
188
|
let t3;
|
|
182
|
-
if ($[
|
|
183
|
-
t3 =
|
|
189
|
+
if ($[12] !== Icon) {
|
|
190
|
+
t3 = Icon && /*#__PURE__*/jsx("span", {
|
|
184
191
|
"data-component": "icon",
|
|
185
192
|
children: isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {})
|
|
186
193
|
});
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[15] = t3;
|
|
194
|
+
$[12] = Icon;
|
|
195
|
+
$[13] = t3;
|
|
190
196
|
} else {
|
|
191
|
-
t3 = $[
|
|
197
|
+
t3 = $[13];
|
|
192
198
|
}
|
|
193
199
|
let t4;
|
|
194
|
-
if ($[
|
|
200
|
+
if ($[14] !== children || $[15] !== textContent) {
|
|
195
201
|
t4 = children && /*#__PURE__*/jsx("span", {
|
|
196
202
|
"data-component": "text",
|
|
197
203
|
"data-content": textContent || undefined,
|
|
198
204
|
children: children
|
|
199
205
|
});
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
206
|
+
$[14] = children;
|
|
207
|
+
$[15] = textContent;
|
|
208
|
+
$[16] = t4;
|
|
203
209
|
} else {
|
|
204
|
-
t4 = $[
|
|
210
|
+
t4 = $[16];
|
|
205
211
|
}
|
|
206
212
|
let t5;
|
|
207
|
-
if ($[
|
|
213
|
+
if ($[17] !== counter || $[18] !== loadingCounters) {
|
|
208
214
|
t5 = counter !== undefined ? loadingCounters ? /*#__PURE__*/jsx("span", {
|
|
209
215
|
"data-component": "counter",
|
|
210
216
|
children: /*#__PURE__*/jsx(LoadingCounter, {})
|
|
@@ -214,32 +220,32 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
214
220
|
children: counter
|
|
215
221
|
})
|
|
216
222
|
}) : null;
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
223
|
+
$[17] = counter;
|
|
224
|
+
$[18] = loadingCounters;
|
|
225
|
+
$[19] = t5;
|
|
220
226
|
} else {
|
|
221
|
-
t5 = $[
|
|
227
|
+
t5 = $[19];
|
|
222
228
|
}
|
|
223
229
|
let t6;
|
|
224
|
-
if ($[
|
|
230
|
+
if ($[20] !== Component || $[21] !== ref || $[22] !== rest || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t5) {
|
|
225
231
|
t6 = /*#__PURE__*/jsxs(Component, {
|
|
226
232
|
...rest,
|
|
227
233
|
ref: ref,
|
|
228
234
|
className: t2,
|
|
229
235
|
children: [t3, t4, t5]
|
|
230
236
|
});
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
237
|
+
$[20] = Component;
|
|
238
|
+
$[21] = ref;
|
|
239
|
+
$[22] = rest;
|
|
240
|
+
$[23] = t2;
|
|
241
|
+
$[24] = t3;
|
|
242
|
+
$[25] = t4;
|
|
243
|
+
$[26] = t5;
|
|
244
|
+
$[27] = t6;
|
|
239
245
|
} else {
|
|
240
|
-
t6 = $[
|
|
246
|
+
t6 = $[27];
|
|
241
247
|
}
|
|
242
248
|
return t6;
|
|
243
249
|
});
|
|
244
250
|
|
|
245
|
-
export {
|
|
251
|
+
export { LoadingCounter, UnderlineItem, UnderlineItemList, UnderlineWrapper };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './UnderlineTabbedInterface-
|
|
1
|
+
import './UnderlineTabbedInterface-7317470b.css';
|
|
2
2
|
|
|
3
3
|
var classes = {"UnderlineWrapper":"prc-components-UnderlineWrapper-eT-Yj","UnderlineItemList":"prc-components-UnderlineItemList-xKlKC","UnderlineItem":"prc-components-UnderlineItem-7fP-n","LoadingCounter":"prc-components-LoadingCounter-dBuLy","loadingCounterKeyFrames":"prc-components-loadingCounterKeyFrames-8tMlf"};
|
|
4
4
|
|
|
@@ -8881,11 +8881,11 @@
|
|
|
8881
8881
|
},
|
|
8882
8882
|
{
|
|
8883
8883
|
"id": "components-underlinenav-features--overflow-template",
|
|
8884
|
-
"code": "({ initialSelectedIndex = 1 }: { initialSelectedIndex?: number }) => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(\n initialSelectedIndex,\n )\n return (\n <UnderlineNav
|
|
8884
|
+
"code": "({ initialSelectedIndex = 1 }: { initialSelectedIndex?: number }) => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(\n initialSelectedIndex,\n )\n return (\n <UnderlineNav aria-label=\"Repository\">\n {items.map((item, index) => (\n <UnderlineNav.Item\n key={item.navigation}\n leadingVisual={item.icon}\n aria-current={index === selectedIndex ? 'page' : undefined}\n // Set so that navigation in interaction tests does not cause the\n // page to load the storybook iframe URL and instead keeps the test in\n // the local preview\n target=\"_self\"\n onSelect={(event) => {\n event.preventDefault()\n setSelectedIndex(index)\n }}\n counter={item.counter}\n href={item.href}\n >\n {item.navigation}\n </UnderlineNav.Item>\n ))}\n </UnderlineNav>\n )\n}"
|
|
8885
8885
|
},
|
|
8886
8886
|
{
|
|
8887
8887
|
"id": "components-underlinenav-features--overflow-on-narrow-screen",
|
|
8888
|
-
"code": "() => {\n return <OverflowTemplate initialSelectedIndex={1} />\n}"
|
|
8888
|
+
"code": "() => {\n return <OverflowTemplate initialSelectedIndex={items.length - 1} />\n}"
|
|
8889
8889
|
},
|
|
8890
8890
|
{
|
|
8891
8891
|
"id": "components-underlinenav-features--counters-loading-state",
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-UnderlineNav-MenuItemContent-3J7gB{align-items:center;display:flex;justify-content:space-between}.prc-UnderlineNav-MoreButton-Y8soj{background:transparent;border:0;box-shadow:none;font-weight:var(--base-text-weight-normal,400);margin:0;padding:var(--base-size-4,.25rem) var(--base-size-8,.5rem)}.prc-UnderlineNav-MoreButton-Y8soj>[data-component=trailingVisual]{margin-left:0}
|
|
2
|
-
/*# sourceMappingURL=UnderlineNav-4344d9b0.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/UnderlineNav/UnderlineNav.module.css.js"],"names":[],"mappings":"AAAA,wCAEE,kBAAmB,CADnB,YAAa,CAEb,6BACF,CAGA,mCAGE,sBAAuB,CADvB,QAAS,CAGT,eAAgB,CADhB,8CAA2C,CAH3C,QAAS,CAQT,0DAKF,CAHE,mEACE,aACF","file":"UnderlineNav-4344d9b0.css","sourcesContent":[".MenuItemContent {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n/* More button styles migrated from styles.ts (was moreBtnStyles) */\n.MoreButton {\n margin: 0; /* reset Safari extra margin */\n border: 0;\n background: transparent;\n font-weight: var(--base-text-weight-normal);\n box-shadow: none;\n padding-top: var(--base-size-4);\n padding-bottom: var(--base-size-4);\n padding-left: var(--base-size-8);\n padding-right: var(--base-size-8);\n\n & > [data-component='trailingVisual'] {\n margin-left: 0;\n }\n}\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const dividerStyles: {
|
|
2
|
-
display: string;
|
|
3
|
-
borderLeft: string;
|
|
4
|
-
width: string;
|
|
5
|
-
borderLeftColor: string;
|
|
6
|
-
marginRight: string;
|
|
7
|
-
height: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const menuItemStyles: {
|
|
10
|
-
'& > span': {
|
|
11
|
-
display: string;
|
|
12
|
-
};
|
|
13
|
-
textDecoration: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const baseMenuMinWidth = 192;
|
|
16
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;CAO1B,CAAA;AAED,eAAO,MAAM,gBAAgB,MAAM,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const dividerStyles = {
|
|
2
|
-
display: 'inline-block',
|
|
3
|
-
borderLeft: '1px solid',
|
|
4
|
-
width: '1px',
|
|
5
|
-
borderLeftColor: 'var(--borderColor-muted)',
|
|
6
|
-
marginRight: 'var(--base-size-4)',
|
|
7
|
-
height: '24px' // The height of the divider - reference from Figma
|
|
8
|
-
};
|
|
9
|
-
const menuItemStyles = {
|
|
10
|
-
// This is needed to hide the selected check icon on the menu item. https://github.com/primer/react/tree/main/packages/react/src/ActionList/Selection.tsx#L32
|
|
11
|
-
'& > span': {
|
|
12
|
-
display: 'none'
|
|
13
|
-
},
|
|
14
|
-
// To reset the style when the menu items are rendered as react router links
|
|
15
|
-
textDecoration: 'none'
|
|
16
|
-
};
|
|
17
|
-
const baseMenuMinWidth = 192;
|
|
18
|
-
|
|
19
|
-
export { baseMenuMinWidth, dividerStyles, menuItemStyles };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-UnderlinePanels-StyledUnderlineWrapper-aiLna{overflow-x:auto;overflow-y:hidden;width:100%;-webkit-overflow-scrolling:auto}.prc-UnderlinePanels-StyledUnderlineWrapper-aiLna[data-icons-visible=false] [data-component=icon]{display:none}
|
|
2
|
-
/*# sourceMappingURL=UnderlinePanels-e4b325b9.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/experimental/UnderlinePanels/UnderlinePanels.module.css.js"],"names":[],"mappings":"AAAA,kDAEE,eAAgB,CAChB,iBAAkB,CAFlB,UAAW,CAGX,+BACF,CAEA,kGACE,YACF","file":"UnderlinePanels-e4b325b9.css","sourcesContent":[".StyledUnderlineWrapper {\n width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: auto;\n}\n\n.StyledUnderlineWrapper[data-icons-visible='false'] [data-component='icon'] {\n display: none;\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-components-UnderlineWrapper-eT-Yj{align-items:center;box-shadow:inset 0 -1px var(--borderColor-muted,#d1d9e0b3);display:flex;justify-content:flex-start;min-height:var(--control-xlarge-size,48px);overflow:visible;padding-inline:var(--stack-padding-normal,1rem)}.prc-components-UnderlineWrapper-eT-Yj[data-overflow-measured=false]{overflow:hidden}.prc-components-UnderlineWrapper-eT-Yj[data-overflow-measured=true]{overflow:visible}.prc-components-UnderlineWrapper-eT-Yj[data-variant=flush]{padding-inline:unset}.prc-components-UnderlineItemList-xKlKC{display:flex;gap:8px;list-style:none;margin:0;padding:0;white-space:nowrap}.prc-components-UnderlineItem-7fP-n,.prc-components-UnderlineItemList-xKlKC{align-items:center;position:relative}.prc-components-UnderlineItem-7fP-n{appearance:none;background-color:transparent;border:0;border-radius:var(--borderRadius-medium,var(--borderRadius-small,.1875rem));color:var(--fgColor-default,#1f2328);cursor:pointer;display:inline-flex;font:inherit;font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.4285);padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.prc-components-UnderlineItem-7fP-n:hover{background-color:var(--bgColor-neutral-muted,#818b981f);-webkit-text-decoration:none;text-decoration:none;transition:background-color .12s ease-out}}.prc-components-UnderlineItem-7fP-n:focus{box-shadow:inset 0 0 0 2px var(--fgColor-accent,#0969da);outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n:focus:not(:focus-visible){box-shadow:none}.prc-components-UnderlineItem-7fP-n:focus-visible{box-shadow:inset 0 0 0 2px var(--fgColor-accent,#0969da);outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n [data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;visibility:hidden;white-space:nowrap}.prc-components-UnderlineItem-7fP-n [data-component=icon]{align-items:center;color:var(--fgColor-muted,#59636e);display:inline-flex;margin-inline-end:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n [data-component=counter]{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n:after{background-color:transparent;border-radius:0;bottom:calc(50% - var(--control-xlarge-size, var(--base-size-48,3rem))/2 - 1px);content:"";height:2px;pointer-events:none;position:absolute;right:50%;transform:translate(50%,-50%);width:100%}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]) [data-component=text],.prc-components-UnderlineItem-7fP-n[aria-selected=true] [data-component=text]{font-weight:var(--base-text-weight-semibold,600)}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73))}@media (forced-colors:active){.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:LinkText}}.prc-components-LoadingCounter-dBuLy{animation:prc-components-loadingCounterKeyFrames-8tMlf 1.2s ease-in-out infinite alternate;background-color:var(--bgColor-neutral-muted,#818b981f);border-color:var(--borderColor-default,#d1d9e0);border-radius:20px;display:inline-block;height:1rem;width:1.5rem}@keyframes prc-components-loadingCounterKeyFrames-8tMlf{0%{opacity:1}to{opacity:.2}}
|
|
2
|
-
/*# sourceMappingURL=UnderlineTabbedInterface-4197ee28.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/internal/components/UnderlineTabbedInterface.module.css.js"],"names":[],"mappings":"AAAA,uCAKE,kBAAmB,CAOnB,0DAAiD,CAXjD,YAAa,CAGb,0BAA2B,CAI3B,0CAA4C,CAO5C,gBAAiB,CAZjB,+CA0BF,CAZE,qEACE,eACF,CAEA,oEACE,gBACF,CAEA,2DAEE,oBACF,CAGF,wCAEE,YAAa,CAMb,OAAQ,CAFR,eAAgB,CAFhB,QAAS,CADT,SAAU,CAEV,kBAIF,CAEA,4EAJE,kBAAmB,CANnB,iBAsCF,CA5BA,oCAgBE,eAAgB,CALhB,4BAA6B,CAC7B,QAAS,CACT,2EAAoE,CANpE,oCAA6B,CAG7B,cAAe,CAPf,mBAAoB,CACpB,YAAa,CACb,8CAAuC,CACvC,qDAAuD,CAYvD,wCAAiC,CADjC,uCAAkC,CATlC,iBAAkB,CAClB,4BAAqB,CAArB,oBAmBF,CAPE,qBACE,0CAEE,uDAA8C,CAD9C,4BAAqB,CAArB,oBAAqB,CAErB,yCACF,CACF,CAGF,0CAGE,wDAAiD,CAFjD,6BAQF,CAHE,8DACE,eACF,CAGF,kDAGE,wDAAiD,CAFjD,6BAGF,CAGA,0DAME,0BAA2B,CAL3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAGT,iBAAkB,CADlB,kBAGF,CAEA,0DAGE,kBAAmB,CADnB,kCAA2B,CAD3B,mBAAoB,CAGpB,0CACF,CAEA,6DAGE,kBAAmB,CADnB,YAAa,CADb,4CAGF,CAEA,0CAaE,4BAA6B,CAC7B,eAAgB,CANhB,+EAAmF,CAInF,UAAW,CAFX,UAAW,CACX,mBAAoB,CAVpB,iBAAkB,CAClB,SAAU,CAaV,6BAA+B,CAN/B,UAOF,CAEA,gLAEE,gDACF,CAEA,gJAGE,iGAMF,CAJE,8BALF,gJAOI,yBAEJ,CADE,CAGF,qCASE,0FAAsE,CAJtE,uDAA8C,CAC9C,+CAAwC,CAExC,kBAAmB,CAPnB,oBAAqB,CAErB,WAAY,CADZ,YAQF,CAEA,wDACE,GACE,SACF,CAEA,GACE,UACF,CACF","file":"UnderlineTabbedInterface-4197ee28.css","sourcesContent":[".UnderlineWrapper {\n display: flex;\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--stack-padding-normal);\n justify-content: flex-start;\n align-items: center;\n\n /* make space for the underline */\n min-height: var(--control-xlarge-size, 48px);\n\n /* using a box-shadow instead of a border to accommodate 'overflow-y: hidden' on UnderlinePanels */\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 -1px var(--borderColor-muted);\n\n /* Hide overflow until calculation is complete to prevent CLS */\n overflow: visible;\n\n &[data-overflow-measured='false'] {\n overflow: hidden;\n }\n\n &[data-overflow-measured='true'] {\n overflow: visible;\n }\n\n &[data-variant='flush'] {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: unset;\n }\n}\n\n.UnderlineItemList {\n position: relative;\n display: flex;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n list-style: none;\n align-items: center;\n gap: 8px;\n}\n\n.UnderlineItem {\n /* underline tab specific styles */\n position: relative;\n display: inline-flex;\n font: inherit;\n font-size: var(--text-body-size-medium);\n line-height: var(--text-body-lineHeight-medium, 1.4285);\n color: var(--fgColor-default);\n text-align: center;\n text-decoration: none;\n cursor: pointer;\n background-color: transparent;\n border: 0;\n border-radius: var(--borderRadius-medium, var(--borderRadius-small));\n\n /* button resets */\n appearance: none;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n align-items: center;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: none;\n background-color: var(--bgColor-neutral-muted);\n transition: background-color 0.12s ease-out;\n }\n }\n}\n\n.UnderlineItem:focus {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n\n /* where focus-visible is supported, remove the focus box-shadow */\n &:not(:focus-visible) {\n box-shadow: none;\n }\n}\n\n.UnderlineItem:focus-visible {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n}\n\n/* renders a visibly hidden \"copy\" of the label in bold, reserving box space for when label becomes bold on selected */\n.UnderlineItem [data-content]::before {\n display: block;\n height: 0;\n font-weight: var(--base-text-weight-semibold);\n white-space: nowrap;\n visibility: hidden;\n content: attr(data-content);\n}\n\n.UnderlineItem [data-component='icon'] {\n display: inline-flex;\n color: var(--fgColor-muted);\n align-items: center;\n margin-inline-end: var(--base-size-8);\n}\n\n.UnderlineItem [data-component='counter'] {\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n}\n\n.UnderlineItem::after {\n position: absolute;\n right: 50%;\n\n /* TODO: see if we can simplify this positioning */\n\n /* 48px total height / 2 (24px) + 1px */\n /* stylelint-disable-next-line primer/spacing */\n bottom: calc(50% - calc(var(--control-xlarge-size, var(--base-size-48)) / 2 + 1px));\n width: 100%;\n height: 2px;\n pointer-events: none;\n content: '';\n background-color: transparent;\n border-radius: 0;\n transform: translate(50%, -50%);\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false']) [data-component='text'],\n.UnderlineItem[aria-selected='true'] [data-component='text'] {\n font-weight: var(--base-text-weight-semibold);\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false'])::after,\n.UnderlineItem[aria-selected='true']::after {\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 Window Force Color Mode https://learn.microsoft.com/en-us/fluent-ui/web-components/design-system/high-contrast */\n background-color: LinkText;\n }\n}\n\n.LoadingCounter {\n display: inline-block;\n width: 1.5rem;\n height: 1rem;\n /* 16px */\n background-color: var(--bgColor-neutral-muted);\n border-color: var(--borderColor-default);\n /* stylelint-disable-next-line primer/borders */\n border-radius: 20px;\n animation: loadingCounterKeyFrames 1.2s ease-in-out infinite alternate;\n}\n\n@keyframes loadingCounterKeyFrames {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0.2;\n }\n}\n"]}
|