@primer/react 0.0.0-20260625122952 → 0.0.0-20260625143049
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 +2 -32
- package/dist/ButtonGroup/ButtonGroup-54ba293b.css +2 -0
- package/dist/ButtonGroup/ButtonGroup-54ba293b.css.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +0 -1
- package/dist/ButtonGroup/ButtonGroup.module.css.js +2 -2
- package/dist/Checkbox/Checkbox-edc5dc3e.css +2 -0
- package/dist/Checkbox/Checkbox-edc5dc3e.css.map +1 -0
- package/dist/Checkbox/Checkbox.module.css.js +1 -1
- package/dist/ConfirmationDialog/useConfirm.d.ts.map +1 -1
- package/dist/ConfirmationDialog/useConfirm.js +8 -4
- package/dist/DataTable/Pagination-b6f8418c.css +2 -0
- package/dist/DataTable/Pagination-b6f8418c.css.map +1 -0
- package/dist/DataTable/Pagination.module.css.js +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
- package/dist/NavList/NavList-5dc067e3.css +2 -0
- package/dist/NavList/NavList-5dc067e3.css.map +1 -0
- package/dist/NavList/NavList.d.ts +4 -13
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/NavList/NavList.js +70 -238
- package/dist/NavList/NavList.module.css.js +2 -2
- package/dist/Radio/Radio.d.ts.map +1 -1
- package/dist/Radio/Radio.js +1 -2
- package/dist/RadioGroup/RadioGroup.js +0 -1
- package/dist/RelativeTime/RelativeTime.js +0 -1
- package/dist/ScrollableRegion/ScrollableRegion.d.ts.map +1 -1
- package/dist/ScrollableRegion/ScrollableRegion.js +0 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +0 -1
- package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +0 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.js +0 -1
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Select/Select.js +2 -6
- package/dist/SideNav.d.ts.map +1 -1
- package/dist/SideNav.js +0 -2
- package/dist/Skeleton/SkeletonBox.d.ts +0 -1
- package/dist/Skeleton/SkeletonBox.d.ts.map +1 -1
- package/dist/Skeleton/SkeletonBox.js +47 -54
- package/dist/SkeletonText/SkeletonText.d.ts.map +1 -1
- package/dist/SkeletonText/SkeletonText.js +2 -2
- package/dist/Spinner/Spinner.js +0 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +68 -27
- package/dist/Textarea/Textarea.d.ts.map +1 -1
- package/dist/Textarea/Textarea.js +186 -158
- package/dist/ThemeProvider.d.ts +1 -1
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +143 -67
- 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/_VisuallyHidden.js +2 -2
- package/dist/_VisuallyHidden.module.css.js +2 -2
- 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/dist/live-region/Announce.d.ts.map +1 -1
- package/dist/live-region/Announce.js +36 -51
- package/dist/utils/character-counter.d.ts +21 -16
- package/dist/utils/character-counter.d.ts.map +1 -1
- package/dist/utils/character-counter.js +59 -23
- package/generated/components.json +5 -44
- package/generated/hooks.json +1 -1
- package/package.json +2 -2
- package/dist/ButtonGroup/ButtonGroup-be1c1123.css +0 -2
- package/dist/ButtonGroup/ButtonGroup-be1c1123.css.map +0 -1
- package/dist/Checkbox/Checkbox-7476a7ba.css +0 -2
- package/dist/Checkbox/Checkbox-7476a7ba.css.map +0 -1
- package/dist/DataTable/Pagination-aebe86e8.css +0 -2
- package/dist/DataTable/Pagination-aebe86e8.css.map +0 -1
- package/dist/NavList/NavList-b50d982b.css +0 -2
- package/dist/NavList/NavList-b50d982b.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/ThemeProvider.js
CHANGED
|
@@ -5,7 +5,9 @@ import deepmerge from 'deepmerge';
|
|
|
5
5
|
import { useSyncedState } from './hooks/useSyncedState.js';
|
|
6
6
|
import { ThemeContext } from './ThemeContext.js';
|
|
7
7
|
import { useTheme } from './useTheme.js';
|
|
8
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
import { useFeatureFlag } from './FeatureFlags/useFeatureFlag.js';
|
|
10
|
+
import { useId } from './hooks/useId.js';
|
|
9
11
|
|
|
10
12
|
const defaultColorMode = 'day';
|
|
11
13
|
const defaultDayScheme = 'light';
|
|
@@ -13,9 +15,32 @@ const defaultNightScheme = 'dark';
|
|
|
13
15
|
|
|
14
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
17
|
|
|
18
|
+
// inspired from __NEXT_DATA__, we use application/json to avoid CSRF policy with inline scripts
|
|
19
|
+
const serverHandoffCache = new Map();
|
|
20
|
+
const emptyHandoff = {};
|
|
21
|
+
const getServerHandoff = id => {
|
|
22
|
+
if (typeof document === 'undefined') return emptyHandoff;
|
|
23
|
+
const cached = serverHandoffCache.get(id);
|
|
24
|
+
if (cached !== undefined) return cached;
|
|
25
|
+
try {
|
|
26
|
+
var _document$getElementB;
|
|
27
|
+
const serverData = (_document$getElementB = document.getElementById(`__PRIMER_DATA_${id}__`)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.textContent;
|
|
28
|
+
if (serverData) {
|
|
29
|
+
const parsed = JSON.parse(serverData);
|
|
30
|
+
serverHandoffCache.set(id, parsed);
|
|
31
|
+
return parsed;
|
|
32
|
+
}
|
|
33
|
+
} catch (_error) {
|
|
34
|
+
// if document/element does not exist or JSON is invalid, suppress error
|
|
35
|
+
}
|
|
36
|
+
const empty = {};
|
|
37
|
+
serverHandoffCache.set(id, empty);
|
|
38
|
+
return empty;
|
|
39
|
+
};
|
|
40
|
+
const emptySubscribe = () => () => {};
|
|
16
41
|
const ThemeProvider = t0 => {
|
|
17
42
|
var _ref, _props$colorMode, _ref2, _props$dayScheme, _ref3, _props$nightScheme;
|
|
18
|
-
const $ = c(
|
|
43
|
+
const $ = c(47);
|
|
19
44
|
let children;
|
|
20
45
|
let props;
|
|
21
46
|
if ($[0] !== t0) {
|
|
@@ -37,42 +62,71 @@ const ThemeProvider = t0 => {
|
|
|
37
62
|
nightScheme: fallbackNightScheme
|
|
38
63
|
} = useTheme();
|
|
39
64
|
const theme$1 = fallbackTheme !== null && fallbackTheme !== void 0 ? fallbackTheme : theme;
|
|
65
|
+
const removeSSRHandoff = useFeatureFlag("primer_react_theme_provider_remove_ssr_handoff");
|
|
66
|
+
const uniqueDataId = useId();
|
|
40
67
|
const [colorMode, setColorMode] = useSyncedState((_ref = (_props$colorMode = props.colorMode) !== null && _props$colorMode !== void 0 ? _props$colorMode : fallbackColorMode) !== null && _ref !== void 0 ? _ref : defaultColorMode);
|
|
41
68
|
const [dayScheme, setDayScheme] = useSyncedState((_ref2 = (_props$dayScheme = props.dayScheme) !== null && _props$dayScheme !== void 0 ? _props$dayScheme : fallbackDayScheme) !== null && _ref2 !== void 0 ? _ref2 : defaultDayScheme);
|
|
42
69
|
const [nightScheme, setNightScheme] = useSyncedState((_ref3 = (_props$nightScheme = props.nightScheme) !== null && _props$nightScheme !== void 0 ? _props$nightScheme : fallbackNightScheme) !== null && _ref3 !== void 0 ? _ref3 : defaultNightScheme);
|
|
43
70
|
const systemColorMode = useSystemColorMode();
|
|
44
|
-
let resolvedColorMode;
|
|
45
71
|
let t1;
|
|
46
|
-
if ($[3] !== colorMode || $[4] !==
|
|
47
|
-
|
|
48
|
-
t1 = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
|
|
72
|
+
if ($[3] !== colorMode || $[4] !== systemColorMode) {
|
|
73
|
+
t1 = resolveColorMode(colorMode, systemColorMode);
|
|
49
74
|
$[3] = colorMode;
|
|
50
|
-
$[4] =
|
|
51
|
-
$[5] =
|
|
52
|
-
$[6] = systemColorMode;
|
|
53
|
-
$[7] = resolvedColorMode;
|
|
54
|
-
$[8] = t1;
|
|
75
|
+
$[4] = systemColorMode;
|
|
76
|
+
$[5] = t1;
|
|
55
77
|
} else {
|
|
56
|
-
|
|
57
|
-
t1 = $[8];
|
|
78
|
+
t1 = $[5];
|
|
58
79
|
}
|
|
59
|
-
const
|
|
80
|
+
const clientColorMode = t1;
|
|
60
81
|
let t2;
|
|
61
|
-
if ($[
|
|
62
|
-
t2 =
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
|
|
82
|
+
if ($[6] !== clientColorMode) {
|
|
83
|
+
t2 = () => clientColorMode;
|
|
84
|
+
$[6] = clientColorMode;
|
|
85
|
+
$[7] = t2;
|
|
86
|
+
} else {
|
|
87
|
+
t2 = $[7];
|
|
88
|
+
}
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[8] !== clientColorMode || $[9] !== uniqueDataId) {
|
|
91
|
+
t3 = () => {
|
|
92
|
+
var _getServerHandoff$res;
|
|
93
|
+
return (_getServerHandoff$res = getServerHandoff(uniqueDataId).resolvedServerColorMode) !== null && _getServerHandoff$res !== void 0 ? _getServerHandoff$res : clientColorMode;
|
|
94
|
+
};
|
|
95
|
+
$[8] = clientColorMode;
|
|
96
|
+
$[9] = uniqueDataId;
|
|
97
|
+
$[10] = t3;
|
|
98
|
+
} else {
|
|
99
|
+
t3 = $[10];
|
|
100
|
+
}
|
|
101
|
+
const ssrResolvedColorMode = React.useSyncExternalStore(emptySubscribe, t2, t3);
|
|
102
|
+
const resolvedColorMode = removeSSRHandoff ? clientColorMode : ssrResolvedColorMode;
|
|
103
|
+
let t4;
|
|
104
|
+
if ($[11] !== dayScheme || $[12] !== nightScheme || $[13] !== resolvedColorMode) {
|
|
105
|
+
t4 = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
|
|
106
|
+
$[11] = dayScheme;
|
|
107
|
+
$[12] = nightScheme;
|
|
108
|
+
$[13] = resolvedColorMode;
|
|
109
|
+
$[14] = t4;
|
|
66
110
|
} else {
|
|
67
|
-
|
|
111
|
+
t4 = $[14];
|
|
112
|
+
}
|
|
113
|
+
const colorScheme = t4;
|
|
114
|
+
let t5;
|
|
115
|
+
if ($[15] !== colorScheme || $[16] !== theme$1) {
|
|
116
|
+
t5 = applyColorScheme(theme$1, colorScheme);
|
|
117
|
+
$[15] = colorScheme;
|
|
118
|
+
$[16] = theme$1;
|
|
119
|
+
$[17] = t5;
|
|
120
|
+
} else {
|
|
121
|
+
t5 = $[17];
|
|
68
122
|
}
|
|
69
123
|
const {
|
|
70
124
|
resolvedTheme,
|
|
71
125
|
resolvedColorScheme
|
|
72
|
-
} =
|
|
73
|
-
let
|
|
74
|
-
if ($[
|
|
75
|
-
|
|
126
|
+
} = t5;
|
|
127
|
+
let t6;
|
|
128
|
+
if ($[18] !== colorMode || $[19] !== colorScheme || $[20] !== dayScheme || $[21] !== nightScheme || $[22] !== resolvedColorMode || $[23] !== resolvedColorScheme || $[24] !== resolvedTheme || $[25] !== setColorMode || $[26] !== setDayScheme || $[27] !== setNightScheme) {
|
|
129
|
+
t6 = {
|
|
76
130
|
theme: resolvedTheme,
|
|
77
131
|
colorScheme,
|
|
78
132
|
colorMode,
|
|
@@ -84,66 +138,88 @@ const ThemeProvider = t0 => {
|
|
|
84
138
|
setDayScheme,
|
|
85
139
|
setNightScheme
|
|
86
140
|
};
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
141
|
+
$[18] = colorMode;
|
|
142
|
+
$[19] = colorScheme;
|
|
143
|
+
$[20] = dayScheme;
|
|
144
|
+
$[21] = nightScheme;
|
|
145
|
+
$[22] = resolvedColorMode;
|
|
146
|
+
$[23] = resolvedColorScheme;
|
|
147
|
+
$[24] = resolvedTheme;
|
|
148
|
+
$[25] = setColorMode;
|
|
149
|
+
$[26] = setDayScheme;
|
|
150
|
+
$[27] = setNightScheme;
|
|
151
|
+
$[28] = t6;
|
|
98
152
|
} else {
|
|
99
|
-
|
|
153
|
+
t6 = $[28];
|
|
100
154
|
}
|
|
101
|
-
const contextValue =
|
|
155
|
+
const contextValue = t6;
|
|
156
|
+
let t7;
|
|
157
|
+
if ($[29] !== props.preventSSRMismatch || $[30] !== removeSSRHandoff || $[31] !== resolvedColorMode || $[32] !== uniqueDataId) {
|
|
158
|
+
t7 = !removeSSRHandoff && props.preventSSRMismatch ? /*#__PURE__*/jsx("script", {
|
|
159
|
+
type: "application/json",
|
|
160
|
+
id: `__PRIMER_DATA_${uniqueDataId}__`,
|
|
161
|
+
dangerouslySetInnerHTML: {
|
|
162
|
+
__html: JSON.stringify({
|
|
163
|
+
resolvedServerColorMode: resolvedColorMode
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
}) : null;
|
|
167
|
+
$[29] = props.preventSSRMismatch;
|
|
168
|
+
$[30] = removeSSRHandoff;
|
|
169
|
+
$[31] = resolvedColorMode;
|
|
170
|
+
$[32] = uniqueDataId;
|
|
171
|
+
$[33] = t7;
|
|
172
|
+
} else {
|
|
173
|
+
t7 = $[33];
|
|
174
|
+
}
|
|
175
|
+
const ssrHandoffScript = t7;
|
|
102
176
|
if (props.contextOnly) {
|
|
103
|
-
let
|
|
104
|
-
if ($[
|
|
105
|
-
|
|
177
|
+
let t8;
|
|
178
|
+
if ($[34] !== children || $[35] !== contextValue || $[36] !== ssrHandoffScript) {
|
|
179
|
+
t8 = /*#__PURE__*/jsxs(ThemeContext.Provider, {
|
|
106
180
|
value: contextValue,
|
|
107
|
-
children: children
|
|
181
|
+
children: [children, ssrHandoffScript]
|
|
108
182
|
});
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
183
|
+
$[34] = children;
|
|
184
|
+
$[35] = contextValue;
|
|
185
|
+
$[36] = ssrHandoffScript;
|
|
186
|
+
$[37] = t8;
|
|
112
187
|
} else {
|
|
113
|
-
|
|
188
|
+
t8 = $[37];
|
|
114
189
|
}
|
|
115
|
-
return
|
|
190
|
+
return t8;
|
|
116
191
|
}
|
|
117
|
-
const
|
|
118
|
-
let
|
|
119
|
-
if ($[
|
|
120
|
-
|
|
121
|
-
"data-color-mode":
|
|
192
|
+
const t8 = colorMode === "auto" ? "auto" : colorScheme.includes("dark") ? "dark" : "light";
|
|
193
|
+
let t9;
|
|
194
|
+
if ($[38] !== children || $[39] !== dayScheme || $[40] !== nightScheme || $[41] !== ssrHandoffScript || $[42] !== t8) {
|
|
195
|
+
t9 = /*#__PURE__*/jsxs("div", {
|
|
196
|
+
"data-color-mode": t8,
|
|
122
197
|
"data-light-theme": dayScheme,
|
|
123
198
|
"data-dark-theme": nightScheme,
|
|
124
|
-
children: children
|
|
199
|
+
children: [children, ssrHandoffScript]
|
|
125
200
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
201
|
+
$[38] = children;
|
|
202
|
+
$[39] = dayScheme;
|
|
203
|
+
$[40] = nightScheme;
|
|
204
|
+
$[41] = ssrHandoffScript;
|
|
205
|
+
$[42] = t8;
|
|
206
|
+
$[43] = t9;
|
|
131
207
|
} else {
|
|
132
|
-
|
|
208
|
+
t9 = $[43];
|
|
133
209
|
}
|
|
134
|
-
let
|
|
135
|
-
if ($[
|
|
136
|
-
|
|
210
|
+
let t10;
|
|
211
|
+
if ($[44] !== contextValue || $[45] !== t9) {
|
|
212
|
+
t10 = /*#__PURE__*/jsx(ThemeContext.Provider, {
|
|
137
213
|
value: contextValue,
|
|
138
|
-
children:
|
|
214
|
+
children: t9
|
|
139
215
|
});
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
216
|
+
$[44] = contextValue;
|
|
217
|
+
$[45] = t9;
|
|
218
|
+
$[46] = t10;
|
|
143
219
|
} else {
|
|
144
|
-
|
|
220
|
+
t10 = $[46];
|
|
145
221
|
}
|
|
146
|
-
return
|
|
222
|
+
return t10;
|
|
147
223
|
};
|
|
148
224
|
function subscribeToSystemColorMode(callback) {
|
|
149
225
|
var _window, _window$matchMedia;
|
|
@@ -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"}
|