@primer/react 0.0.0-20260218182609 → 0.0.0-20260218210324
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 +1 -3
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +182 -591
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +5 -6
- package/dist/UnderlineNav/UnderlineNav-e56ca858.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-e56ca858.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +82 -324
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +4 -11
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +2 -3
- package/dist/UnderlineNav/UnderlineNavItem-db9dc5d0.css +2 -0
- package/dist/UnderlineNav/UnderlineNavItem-db9dc5d0.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +94 -85
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-135d7279.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-135d7279.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 +41 -48
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- 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/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/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import { forwardRef, useRef, useContext } from 'react';
|
|
2
|
+
import { forwardRef, useRef, useContext, useId, useState, useEffect } from 'react';
|
|
3
3
|
import { UnderlineNavContext } from './UnderlineNavContext.js';
|
|
4
|
-
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
5
4
|
import { UnderlineItem } from '../internal/components/UnderlineTabbedInterface.js';
|
|
6
5
|
import classes from './UnderlineNavItem.module.css.js';
|
|
7
6
|
import { jsx } from 'react/jsx-runtime';
|
|
8
7
|
|
|
9
|
-
const UnderlineNavItem = /*#__PURE__*/forwardRef((
|
|
8
|
+
const UnderlineNavItem = /*#__PURE__*/forwardRef((allProps, forwardedRef) => {
|
|
10
9
|
var _leadingVisual;
|
|
11
|
-
const $ = c(
|
|
10
|
+
const $ = c(38);
|
|
12
11
|
let Icon;
|
|
13
12
|
let ariaCurrent;
|
|
14
13
|
let children;
|
|
@@ -16,12 +15,12 @@ const UnderlineNavItem = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
16
15
|
let leadingVisual;
|
|
17
16
|
let onSelect;
|
|
18
17
|
let props;
|
|
18
|
+
let t0;
|
|
19
19
|
let t1;
|
|
20
|
-
|
|
21
|
-
if ($[0] !== t0) {
|
|
20
|
+
if ($[0] !== allProps) {
|
|
22
21
|
({
|
|
23
|
-
as:
|
|
24
|
-
href:
|
|
22
|
+
as: t0,
|
|
23
|
+
href: t1,
|
|
25
24
|
children,
|
|
26
25
|
counter,
|
|
27
26
|
onSelect,
|
|
@@ -29,8 +28,8 @@ const UnderlineNavItem = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
29
28
|
icon: Icon,
|
|
30
29
|
leadingVisual,
|
|
31
30
|
...props
|
|
32
|
-
} =
|
|
33
|
-
$[0] =
|
|
31
|
+
} = allProps);
|
|
32
|
+
$[0] = allProps;
|
|
34
33
|
$[1] = Icon;
|
|
35
34
|
$[2] = ariaCurrent;
|
|
36
35
|
$[3] = children;
|
|
@@ -38,8 +37,8 @@ const UnderlineNavItem = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
38
37
|
$[5] = leadingVisual;
|
|
39
38
|
$[6] = onSelect;
|
|
40
39
|
$[7] = props;
|
|
41
|
-
$[8] =
|
|
42
|
-
$[9] =
|
|
40
|
+
$[8] = t0;
|
|
41
|
+
$[9] = t1;
|
|
43
42
|
} else {
|
|
44
43
|
Icon = $[1];
|
|
45
44
|
ariaCurrent = $[2];
|
|
@@ -48,80 +47,94 @@ const UnderlineNavItem = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
48
47
|
leadingVisual = $[5];
|
|
49
48
|
onSelect = $[6];
|
|
50
49
|
props = $[7];
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
t0 = $[8];
|
|
51
|
+
t1 = $[9];
|
|
53
52
|
}
|
|
54
|
-
const Component =
|
|
55
|
-
const href =
|
|
53
|
+
const Component = t0 === undefined ? "a" : t0;
|
|
54
|
+
const href = t1 === undefined ? "#" : t1;
|
|
56
55
|
const backupRef = useRef(null);
|
|
57
56
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
58
57
|
const {
|
|
59
|
-
setChildrenWidth,
|
|
60
|
-
setNoIconChildrenWidth,
|
|
61
58
|
loadingCounters,
|
|
62
|
-
|
|
59
|
+
registerItem,
|
|
60
|
+
unregisterItem
|
|
63
61
|
} = useContext(UnderlineNavContext);
|
|
62
|
+
const id = useId();
|
|
63
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
64
|
+
let t2;
|
|
64
65
|
let t3;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
const icon = Array.from(ref.current.children).find(_temp);
|
|
71
|
-
const content = Array.from(ref.current.children).find(_temp2);
|
|
72
|
-
const text = content.textContent;
|
|
73
|
-
const iconWidthWithMargin = icon ? icon.getBoundingClientRect().width + Number(getComputedStyle(icon).marginRight.slice(0, -2)) + Number(getComputedStyle(icon).marginLeft.slice(0, -2)) : 0;
|
|
74
|
-
setChildrenWidth({
|
|
75
|
-
text,
|
|
76
|
-
width: domRect.width
|
|
77
|
-
});
|
|
78
|
-
setNoIconChildrenWidth({
|
|
79
|
-
text,
|
|
80
|
-
width: domRect.width - iconWidthWithMargin
|
|
81
|
-
});
|
|
66
|
+
if ($[10] !== allProps || $[11] !== id || $[12] !== ref || $[13] !== registerItem) {
|
|
67
|
+
t2 = () => {
|
|
68
|
+
const element = ref.current;
|
|
69
|
+
if (!element) {
|
|
70
|
+
return;
|
|
82
71
|
}
|
|
72
|
+
const observer = new IntersectionObserver(() => {
|
|
73
|
+
const isOverflowing_0 = element.offsetTop > 0;
|
|
74
|
+
setIsOverflowing(isOverflowing_0);
|
|
75
|
+
registerItem(id, isOverflowing_0 ? allProps : null);
|
|
76
|
+
});
|
|
77
|
+
observer.observe(element);
|
|
78
|
+
return () => observer.disconnect();
|
|
83
79
|
};
|
|
84
|
-
|
|
85
|
-
$[10] =
|
|
86
|
-
$[11] =
|
|
87
|
-
$[12] =
|
|
88
|
-
$[13] =
|
|
89
|
-
$[14] =
|
|
80
|
+
t3 = [ref, registerItem, id, allProps];
|
|
81
|
+
$[10] = allProps;
|
|
82
|
+
$[11] = id;
|
|
83
|
+
$[12] = ref;
|
|
84
|
+
$[13] = registerItem;
|
|
85
|
+
$[14] = t2;
|
|
86
|
+
$[15] = t3;
|
|
90
87
|
} else {
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
t2 = $[14];
|
|
89
|
+
t3 = $[15];
|
|
93
90
|
}
|
|
94
|
-
|
|
91
|
+
useEffect(t2, t3);
|
|
92
|
+
let t4;
|
|
95
93
|
let t5;
|
|
96
|
-
if ($[
|
|
97
|
-
|
|
94
|
+
if ($[16] !== id || $[17] !== unregisterItem) {
|
|
95
|
+
t4 = () => () => unregisterItem(id);
|
|
96
|
+
t5 = [id, unregisterItem];
|
|
97
|
+
$[16] = id;
|
|
98
|
+
$[17] = unregisterItem;
|
|
99
|
+
$[18] = t4;
|
|
100
|
+
$[19] = t5;
|
|
101
|
+
} else {
|
|
102
|
+
t4 = $[18];
|
|
103
|
+
t5 = $[19];
|
|
104
|
+
}
|
|
105
|
+
useEffect(t4, t5);
|
|
106
|
+
let t6;
|
|
107
|
+
if ($[20] !== onSelect) {
|
|
108
|
+
t6 = event => {
|
|
98
109
|
if ((event.key === " " || event.key === "Enter") && !event.defaultPrevented && typeof onSelect === "function") {
|
|
99
110
|
onSelect(event);
|
|
100
111
|
}
|
|
101
112
|
};
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
113
|
+
$[20] = onSelect;
|
|
114
|
+
$[21] = t6;
|
|
104
115
|
} else {
|
|
105
|
-
|
|
116
|
+
t6 = $[21];
|
|
106
117
|
}
|
|
107
|
-
const keyDownHandler =
|
|
108
|
-
let
|
|
109
|
-
if ($[
|
|
110
|
-
|
|
118
|
+
const keyDownHandler = t6;
|
|
119
|
+
let t7;
|
|
120
|
+
if ($[22] !== onSelect) {
|
|
121
|
+
t7 = event_0 => {
|
|
111
122
|
if (!event_0.defaultPrevented && typeof onSelect === "function") {
|
|
112
123
|
onSelect(event_0);
|
|
113
124
|
}
|
|
114
125
|
};
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
126
|
+
$[22] = onSelect;
|
|
127
|
+
$[23] = t7;
|
|
117
128
|
} else {
|
|
118
|
-
|
|
129
|
+
t7 = $[23];
|
|
119
130
|
}
|
|
120
|
-
const clickHandler =
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
const clickHandler = t7;
|
|
132
|
+
const t8 = (_leadingVisual = leadingVisual) !== null && _leadingVisual !== void 0 ? _leadingVisual : Icon;
|
|
133
|
+
const t9 = isOverflowing ? true : allProps["aria-hidden"];
|
|
134
|
+
const t10 = isOverflowing ? -1 : allProps.tabIndex;
|
|
135
|
+
let t11;
|
|
136
|
+
if ($[24] !== Component || $[25] !== ariaCurrent || $[26] !== children || $[27] !== clickHandler || $[28] !== counter || $[29] !== href || $[30] !== keyDownHandler || $[31] !== loadingCounters || $[32] !== props || $[33] !== ref || $[34] !== t10 || $[35] !== t8 || $[36] !== t9) {
|
|
137
|
+
t11 = /*#__PURE__*/jsx("li", {
|
|
125
138
|
className: classes.UnderlineNavItem,
|
|
126
139
|
children: /*#__PURE__*/jsx(UnderlineItem, {
|
|
127
140
|
ref: ref,
|
|
@@ -131,37 +144,33 @@ const UnderlineNavItem = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
131
144
|
onKeyDown: keyDownHandler,
|
|
132
145
|
onClick: clickHandler,
|
|
133
146
|
counter: counter,
|
|
134
|
-
icon:
|
|
147
|
+
icon: t8,
|
|
135
148
|
loadingCounters: loadingCounters,
|
|
136
|
-
iconsVisible: iconsVisible,
|
|
137
149
|
...props,
|
|
150
|
+
"aria-hidden": t9,
|
|
151
|
+
tabIndex: t10,
|
|
138
152
|
children: children
|
|
139
153
|
})
|
|
140
154
|
});
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
155
|
+
$[24] = Component;
|
|
156
|
+
$[25] = ariaCurrent;
|
|
157
|
+
$[26] = children;
|
|
158
|
+
$[27] = clickHandler;
|
|
159
|
+
$[28] = counter;
|
|
160
|
+
$[29] = href;
|
|
161
|
+
$[30] = keyDownHandler;
|
|
162
|
+
$[31] = loadingCounters;
|
|
163
|
+
$[32] = props;
|
|
164
|
+
$[33] = ref;
|
|
165
|
+
$[34] = t10;
|
|
166
|
+
$[35] = t8;
|
|
167
|
+
$[36] = t9;
|
|
168
|
+
$[37] = t11;
|
|
154
169
|
} else {
|
|
155
|
-
|
|
170
|
+
t11 = $[37];
|
|
156
171
|
}
|
|
157
|
-
return
|
|
172
|
+
return t11;
|
|
158
173
|
});
|
|
159
174
|
UnderlineNavItem.displayName = 'UnderlineNavItem';
|
|
160
|
-
function _temp(child) {
|
|
161
|
-
return child.getAttribute("data-component") === "icon";
|
|
162
|
-
}
|
|
163
|
-
function _temp2(child_0) {
|
|
164
|
-
return child_0.getAttribute("data-component") === "text";
|
|
165
|
-
}
|
|
166
175
|
|
|
167
176
|
export { UnderlineNavItem };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-components-UnderlineWrapper-eT-Yj{align-items:flex-start;box-shadow:inset 0 -1px var(--borderColor-muted,var(--color-border-muted));container:underline-wrapper/scroll-state;display:flex;height:var(--control-xlarge-size,48px);justify-content:space-between;padding-inline:var(--stack-padding-normal,1rem);padding-top:var(--base-size-8,.5rem)}.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-UnderlineWrapper-eT-Yj[data-hide-icons=true] [data-component=icon]{display:none}.prc-components-UnderlineItemList-xKlKC{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;overflow:hidden;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,var(--color-fg-default));cursor:pointer;display:inline-flex;font:inherit;font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.4285);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,var(--color-neutral-subtle));-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,var(--color-accent-fg));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,var(--color-accent-fg));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,var(--color-fg-muted));display:inline-flex;margin-inline-end:var(--base-size-8,.5rem)}@container underline-wrapper scroll-state(scrollable: block){.prc-components-UnderlineItem-7fP-n [data-component=icon]{display:none}}.prc-components-UnderlineItem-7fP-n [data-component=text]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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,var(--color-neutral-subtle));border-color:var(--borderColor-default,var(--color-border-default));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-135d7279.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/internal/components/UnderlineTabbedInterface.module.css.js"],"names":[],"mappings":"AAAA,uCAME,sBAAuB,CASvB,0EAAiD,CAPjD,wCAA2C,CAP3C,YAAa,CAUb,sCAAwC,CANxC,6BAA8B,CAF9B,+CAA2C,CAC3C,oCA6BF,CAhBE,qEACE,eACF,CAEA,oEACE,gBACF,CAEA,2DAEE,oBACF,CAEA,mFACE,YACF,CAGF,wCAEE,YAAa,CAOb,cAAe,CADf,OAAQ,CAFR,eAAgB,CAFhB,QAAS,CAOT,eAAgB,CARhB,SAAU,CAEV,kBAOF,CAEA,4EAPE,kBAAmB,CANnB,iBA0CF,CA7BA,oCAiBE,eAAgB,CANhB,4BAA6B,CAC7B,QAAS,CACT,2EAAoE,CANpE,oDAA6B,CAG7B,cAAe,CAPf,mBAAoB,CACpB,YAAa,CACb,8CAAuC,CACvC,qDAAuD,CAQvD,cAAe,CAKf,wCAAiC,CADjC,uCAAkC,CAVlC,iBAAkB,CAClB,4BAAqB,CAArB,oBAoBF,CAPE,qBACE,0CAEE,yEAA8C,CAD9C,4BAAqB,CAArB,oBAAqB,CAErB,yCACF,CACF,CAGF,0CAGE,uEAAiD,CAFjD,6BAQF,CAHE,8DACE,eACF,CAGF,kDAGE,uEAAiD,CAFjD,6BAGF,CAGA,0DAME,0BAA2B,CAL3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAGT,iBAAkB,CADlB,kBAGF,CAEA,0DAGE,kBAAmB,CADnB,gDAA2B,CAD3B,mBAAoB,CAGpB,0CAMF,CAHE,6DAPF,0DAQI,YAEJ,CADE,CAIF,0DACE,eAAgB,CAChB,sBAAuB,CACvB,kBACF,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,yEAA8C,CAC9C,mEAAwC,CAExC,kBAAmB,CAPnB,oBAAqB,CAErB,WAAY,CADZ,YAQF,CAEA,wDACE,GACE,SACF,CAEA,GACE,UACF,CACF","file":"UnderlineTabbedInterface-135d7279.css","sourcesContent":[".UnderlineWrapper {\n display: flex;\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--stack-padding-normal);\n padding-top: var(--base-size-8);\n justify-content: space-between;\n align-items: flex-start;\n /* stylelint-disable-next-line declaration-property-value-no-unknown */\n container: underline-wrapper / scroll-state;\n\n /* make space for the underline */\n 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 &[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 &[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: 8px;\n flex-wrap: wrap;\n /* Allows the menu to clip wrapped items to keep on shrinking */\n overflow: hidden;\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 max-width: 100%;\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 /* Hide via CSS when there's an overflow (for SSR; after initial render will control with React state) */\n @container underline-wrapper scroll-state(scrollable: block) {\n display: none;\n }\n}\n\n/* Only the first item will ever truncate, after all other items wrap */\n.UnderlineItem [data-component='text'] {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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"]}
|
|
@@ -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,EAA0B,KAAK,WAAW,EAAC,MAAM,OAAO,CAAA;AAEtG,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,
|
|
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,EAA0B,KAAK,WAAW,EAAC,MAAM,OAAO,CAAA;AAEtG,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).
|
|
@@ -121,12 +119,11 @@ const LoadingCounter = () => {
|
|
|
121
119
|
return t0;
|
|
122
120
|
};
|
|
123
121
|
const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
124
|
-
const $ = c(
|
|
122
|
+
const $ = c(28);
|
|
125
123
|
let Icon;
|
|
126
124
|
let children;
|
|
127
125
|
let className;
|
|
128
126
|
let counter;
|
|
129
|
-
let iconsVisible;
|
|
130
127
|
let loadingCounters;
|
|
131
128
|
let rest;
|
|
132
129
|
let t0;
|
|
@@ -136,7 +133,6 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
136
133
|
children,
|
|
137
134
|
counter,
|
|
138
135
|
icon: Icon,
|
|
139
|
-
iconsVisible,
|
|
140
136
|
loadingCounters,
|
|
141
137
|
className,
|
|
142
138
|
...rest
|
|
@@ -146,65 +142,62 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
146
142
|
$[2] = children;
|
|
147
143
|
$[3] = className;
|
|
148
144
|
$[4] = counter;
|
|
149
|
-
$[5] =
|
|
150
|
-
$[6] =
|
|
151
|
-
$[7] =
|
|
152
|
-
$[8] = t0;
|
|
145
|
+
$[5] = loadingCounters;
|
|
146
|
+
$[6] = rest;
|
|
147
|
+
$[7] = t0;
|
|
153
148
|
} else {
|
|
154
149
|
Icon = $[1];
|
|
155
150
|
children = $[2];
|
|
156
151
|
className = $[3];
|
|
157
152
|
counter = $[4];
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
t0 = $[8];
|
|
153
|
+
loadingCounters = $[5];
|
|
154
|
+
rest = $[6];
|
|
155
|
+
t0 = $[7];
|
|
162
156
|
}
|
|
163
157
|
const Component = t0 === undefined ? "a" : t0;
|
|
164
158
|
let t1;
|
|
165
|
-
if ($[
|
|
159
|
+
if ($[8] !== children) {
|
|
166
160
|
t1 = getTextContent(children);
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
161
|
+
$[8] = children;
|
|
162
|
+
$[9] = t1;
|
|
169
163
|
} else {
|
|
170
|
-
t1 = $[
|
|
164
|
+
t1 = $[9];
|
|
171
165
|
}
|
|
172
166
|
const textContent = t1;
|
|
173
167
|
let t2;
|
|
174
|
-
if ($[
|
|
168
|
+
if ($[10] !== className) {
|
|
175
169
|
t2 = clsx(classes.UnderlineItem, className);
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
170
|
+
$[10] = className;
|
|
171
|
+
$[11] = t2;
|
|
178
172
|
} else {
|
|
179
|
-
t2 = $[
|
|
173
|
+
t2 = $[11];
|
|
180
174
|
}
|
|
181
175
|
let t3;
|
|
182
|
-
if ($[
|
|
183
|
-
t3 =
|
|
176
|
+
if ($[12] !== Icon) {
|
|
177
|
+
t3 = Icon && /*#__PURE__*/jsx("span", {
|
|
184
178
|
"data-component": "icon",
|
|
185
179
|
children: isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {})
|
|
186
180
|
});
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[15] = t3;
|
|
181
|
+
$[12] = Icon;
|
|
182
|
+
$[13] = t3;
|
|
190
183
|
} else {
|
|
191
|
-
t3 = $[
|
|
184
|
+
t3 = $[13];
|
|
192
185
|
}
|
|
193
186
|
let t4;
|
|
194
|
-
if ($[
|
|
187
|
+
if ($[14] !== children || $[15] !== textContent) {
|
|
195
188
|
t4 = children && /*#__PURE__*/jsx("span", {
|
|
196
189
|
"data-component": "text",
|
|
197
190
|
"data-content": textContent || undefined,
|
|
198
191
|
children: children
|
|
199
192
|
});
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
193
|
+
$[14] = children;
|
|
194
|
+
$[15] = textContent;
|
|
195
|
+
$[16] = t4;
|
|
203
196
|
} else {
|
|
204
|
-
t4 = $[
|
|
197
|
+
t4 = $[16];
|
|
205
198
|
}
|
|
206
199
|
let t5;
|
|
207
|
-
if ($[
|
|
200
|
+
if ($[17] !== counter || $[18] !== loadingCounters) {
|
|
208
201
|
t5 = counter !== undefined ? loadingCounters ? /*#__PURE__*/jsx("span", {
|
|
209
202
|
"data-component": "counter",
|
|
210
203
|
children: /*#__PURE__*/jsx(LoadingCounter, {})
|
|
@@ -214,32 +207,32 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
214
207
|
children: counter
|
|
215
208
|
})
|
|
216
209
|
}) : null;
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
210
|
+
$[17] = counter;
|
|
211
|
+
$[18] = loadingCounters;
|
|
212
|
+
$[19] = t5;
|
|
220
213
|
} else {
|
|
221
|
-
t5 = $[
|
|
214
|
+
t5 = $[19];
|
|
222
215
|
}
|
|
223
216
|
let t6;
|
|
224
|
-
if ($[
|
|
217
|
+
if ($[20] !== Component || $[21] !== ref || $[22] !== rest || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t5) {
|
|
225
218
|
t6 = /*#__PURE__*/jsxs(Component, {
|
|
226
219
|
...rest,
|
|
227
220
|
ref: ref,
|
|
228
221
|
className: t2,
|
|
229
222
|
children: [t3, t4, t5]
|
|
230
223
|
});
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
224
|
+
$[20] = Component;
|
|
225
|
+
$[21] = ref;
|
|
226
|
+
$[22] = rest;
|
|
227
|
+
$[23] = t2;
|
|
228
|
+
$[24] = t3;
|
|
229
|
+
$[25] = t4;
|
|
230
|
+
$[26] = t5;
|
|
231
|
+
$[27] = t6;
|
|
239
232
|
} else {
|
|
240
|
-
t6 = $[
|
|
233
|
+
t6 = $[27];
|
|
241
234
|
}
|
|
242
235
|
return t6;
|
|
243
236
|
});
|
|
244
237
|
|
|
245
|
-
export {
|
|
238
|
+
export { LoadingCounter, UnderlineItem, UnderlineItemList, UnderlineWrapper };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './UnderlineTabbedInterface-
|
|
1
|
+
import './UnderlineTabbedInterface-135d7279.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
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/UnderlineNav/UnderlineNavItem.module.css.js"],"names":[],"mappings":"AAAA,yCAGE,kBAAmB,CAFnB,YAAa,CACb,qBAEF","file":"UnderlineNavItem-b65e8fd3.css","sourcesContent":[".UnderlineNavItem {\n display: flex;\n flex-direction: column;\n align-items: center;\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-components-UnderlineWrapper-eT-Yj{align-items:center;box-shadow:inset 0 -1px var(--borderColor-muted,var(--color-border-muted));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,var(--color-fg-default));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,var(--color-neutral-subtle));-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,var(--color-accent-fg));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,var(--color-accent-fg));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,var(--color-fg-muted));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,var(--color-neutral-subtle));border-color:var(--borderColor-default,var(--color-border-default));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,0EAAiD,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,oDAA6B,CAG7B,cAAe,CAPf,mBAAoB,CACpB,YAAa,CACb,8CAAuC,CACvC,qDAAuD,CAYvD,wCAAiC,CADjC,uCAAkC,CATlC,iBAAkB,CAClB,4BAAqB,CAArB,oBAmBF,CAPE,qBACE,0CAEE,yEAA8C,CAD9C,4BAAqB,CAArB,oBAAqB,CAErB,yCACF,CACF,CAGF,0CAGE,uEAAiD,CAFjD,6BAQF,CAHE,8DACE,eACF,CAGF,kDAGE,uEAAiD,CAFjD,6BAGF,CAGA,0DAME,0BAA2B,CAL3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAGT,iBAAkB,CADlB,kBAGF,CAEA,0DAGE,kBAAmB,CADnB,gDAA2B,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,yEAA8C,CAC9C,mEAAwC,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"]}
|