@primer/react 38.42.0-rc.ebd425836 → 38.42.0
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 +10 -0
- package/dist/ActionBar/ActionBar.js +498 -162
- package/dist/ActionBar/index.d.ts +2 -2
- package/dist/ActionList/Group.js +4 -5
- package/dist/ActionList/Item.js +2 -2
- package/dist/Banner/Banner.js +3 -5
- package/dist/Button/ButtonBase.js +3 -2
- package/dist/Button/IconButton.js +3 -4
- package/dist/Button/types.d.ts +2 -2
- package/dist/Card/Card.js +1 -2
- package/dist/Checkbox/Checkbox.js +145 -41
- package/dist/CounterLabel/CounterLabel.js +80 -18
- package/dist/Details/Details.js +2 -4
- package/dist/FeatureFlags/FeatureFlagScope.js +1 -0
- package/dist/FilteredActionList/constants.js +2 -0
- package/dist/FilteredActionList/useAnnouncements.js +148 -81
- package/dist/FormControl/FormControlLabel.js +1 -2
- package/dist/InlineMessage/InlineMessage.js +1 -2
- package/dist/NavList/NavList.js +3 -4
- package/dist/Overlay/Overlay.js +299 -64
- package/dist/PageLayout/usePaneWidth.js +2 -2
- package/dist/Popover/Popover.js +3 -5
- package/dist/ProgressBar/ProgressBar.js +1 -2
- package/dist/SegmentedControl/SegmentedControlButton.js +1 -2
- package/dist/Select/Select.js +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts +1 -1
- package/dist/SelectPanel/SelectPanel.js +1 -1
- package/dist/Spinner/Spinner.js +1 -2
- package/dist/TextInput/TextInput.js +242 -87
- package/dist/Textarea/Textarea.d.ts +2 -2
- package/dist/ToggleSwitch/ToggleSwitch.js +2 -3
- package/dist/Tooltip/Tooltip.js +98 -17
- package/dist/TooltipV2/Tooltip.js +295 -138
- package/dist/TopicTag/TopicTag.js +1 -2
- package/dist/Truncate/Truncate.js +87 -14
- package/dist/UnderlineNav/UnderlineNavItem.js +2 -4
- package/dist/deprecated/ActionList/List.js +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +1 -1
- package/dist/internal/components/InputLabel.js +1 -2
- package/dist/internal/components/TextInputInnerAction.js +1 -2
- package/dist/internal/components/TextInputWrapper.d.ts +3 -0
- package/dist/internal/hooks/useThemeProvider.js +3 -3
- package/generated/components.json +22 -20
- package/package.json +12 -13
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { reactMajorVersion } from "../utils/environment.js";
|
|
2
3
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
3
4
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
@@ -13,7 +14,7 @@ import { KeybindingHint } from "../KeybindingHint/KeybindingHint.js";
|
|
|
13
14
|
import { getAccessibleKeybindingHintString } from "../KeybindingHint/utils.js";
|
|
14
15
|
import useSafeTimeout from "../hooks/useSafeTimeout.js";
|
|
15
16
|
import { TooltipContext } from "./TooltipContext.js";
|
|
16
|
-
import React, { Children, useEffect,
|
|
17
|
+
import React, { Children, useEffect, useRef, useState } from "react";
|
|
17
18
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
18
19
|
import { clsx } from "clsx";
|
|
19
20
|
import { getAnchoredPosition } from "@primer/behaviors";
|
|
@@ -80,7 +81,48 @@ const isInteractive = (element) => {
|
|
|
80
81
|
return interactiveElements.some((selector) => element.matches(selector)) || element.hasAttribute("role") && element.getAttribute("role") === "button";
|
|
81
82
|
};
|
|
82
83
|
const emptyKeybindingHints = [];
|
|
83
|
-
const Tooltip = /*#__PURE__*/ React.forwardRef((
|
|
84
|
+
const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
85
|
+
const $ = c(58);
|
|
86
|
+
let children;
|
|
87
|
+
let className;
|
|
88
|
+
let id;
|
|
89
|
+
let rest;
|
|
90
|
+
let t1;
|
|
91
|
+
let t2;
|
|
92
|
+
let t3;
|
|
93
|
+
let t4;
|
|
94
|
+
let t5;
|
|
95
|
+
let text;
|
|
96
|
+
if ($[0] !== t0) {
|
|
97
|
+
({direction: t1, text, type: t2, children, id, className, keybindingHint: t3, delay: t4, _privateDisableTooltip: t5, ...rest} = t0);
|
|
98
|
+
$[0] = t0;
|
|
99
|
+
$[1] = children;
|
|
100
|
+
$[2] = className;
|
|
101
|
+
$[3] = id;
|
|
102
|
+
$[4] = rest;
|
|
103
|
+
$[5] = t1;
|
|
104
|
+
$[6] = t2;
|
|
105
|
+
$[7] = t3;
|
|
106
|
+
$[8] = t4;
|
|
107
|
+
$[9] = t5;
|
|
108
|
+
$[10] = text;
|
|
109
|
+
} else {
|
|
110
|
+
children = $[1];
|
|
111
|
+
className = $[2];
|
|
112
|
+
id = $[3];
|
|
113
|
+
rest = $[4];
|
|
114
|
+
t1 = $[5];
|
|
115
|
+
t2 = $[6];
|
|
116
|
+
t3 = $[7];
|
|
117
|
+
t4 = $[8];
|
|
118
|
+
t5 = $[9];
|
|
119
|
+
text = $[10];
|
|
120
|
+
}
|
|
121
|
+
const direction = t1 === void 0 ? "s" : t1;
|
|
122
|
+
const type = t2 === void 0 ? "description" : t2;
|
|
123
|
+
const keybindingHint = t3 === void 0 ? emptyKeybindingHints : t3;
|
|
124
|
+
const delay = t4 === void 0 ? "short" : t4;
|
|
125
|
+
const _privateDisableTooltip = t5 === void 0 ? false : t5;
|
|
84
126
|
const tooltipId = useId$1(id);
|
|
85
127
|
const child = Children.only(children);
|
|
86
128
|
const isFragmentTrigger = /*#__PURE__*/ React.isValidElement(child) && child.type === React.Fragment;
|
|
@@ -98,155 +140,270 @@ const Tooltip = /*#__PURE__*/ React.forwardRef(({ direction = "s", text, type =
|
|
|
98
140
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
99
141
|
const openTimeoutRef = React.useRef(null);
|
|
100
142
|
const { safeSetTimeout, safeClearTimeout } = useSafeTimeout();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
143
|
+
let t6;
|
|
144
|
+
if ($[11] !== _privateDisableTooltip || $[12] !== direction || $[13] !== readTriggerRef) {
|
|
145
|
+
t6 = () => {
|
|
146
|
+
try {
|
|
147
|
+
if (tooltipElRef.current && readTriggerRef.current instanceof HTMLElement && tooltipElRef.current.hasAttribute("popover") && !tooltipElRef.current.matches(":popover-open") && !_privateDisableTooltip) {
|
|
148
|
+
const tooltip = tooltipElRef.current;
|
|
149
|
+
const trigger = readTriggerRef.current;
|
|
150
|
+
tooltip.showPopover();
|
|
151
|
+
setIsPopoverOpen(true);
|
|
152
|
+
const settings = {
|
|
153
|
+
side: directionToPosition[direction].side,
|
|
154
|
+
align: directionToPosition[direction].align
|
|
155
|
+
};
|
|
156
|
+
const { top, left, anchorAlign, anchorSide } = getAnchoredPosition(tooltip, trigger, settings);
|
|
157
|
+
const calculatedDirection_0 = positionToDirection[`${anchorSide}-${anchorAlign}`];
|
|
158
|
+
setCalculatedDirection(calculatedDirection_0);
|
|
159
|
+
tooltip.style.top = `${top}px`;
|
|
160
|
+
tooltip.style.left = `${left}px`;
|
|
161
|
+
}
|
|
162
|
+
} catch (t7) {
|
|
163
|
+
const error = t7;
|
|
164
|
+
if (error && typeof error === "object" && "message" in error && typeof error.message === "string" && error.message.includes("not a valid selector")) {} else throw error;
|
|
117
165
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
};
|
|
167
|
+
$[11] = _privateDisableTooltip;
|
|
168
|
+
$[12] = direction;
|
|
169
|
+
$[13] = readTriggerRef;
|
|
170
|
+
$[14] = t6;
|
|
171
|
+
} else t6 = $[14];
|
|
172
|
+
const openTooltip = t6;
|
|
173
|
+
let t7;
|
|
174
|
+
if ($[15] !== readTriggerRef || $[16] !== safeClearTimeout) {
|
|
175
|
+
t7 = () => {
|
|
176
|
+
if (openTimeoutRef.current) {
|
|
177
|
+
safeClearTimeout(openTimeoutRef.current);
|
|
178
|
+
openTimeoutRef.current = null;
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
if (tooltipElRef.current && readTriggerRef.current && tooltipElRef.current.hasAttribute("popover") && tooltipElRef.current.matches(":popover-open")) {
|
|
182
|
+
tooltipElRef.current.hidePopover();
|
|
183
|
+
setIsPopoverOpen(false);
|
|
184
|
+
} else setIsPopoverOpen(false);
|
|
185
|
+
} catch (t8) {
|
|
186
|
+
const error_0 = t8;
|
|
187
|
+
if (error_0 && typeof error_0 === "object" && "message" in error_0 && typeof error_0.message === "string" && error_0.message.includes("not a valid selector")) {} else throw error_0;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
$[15] = readTriggerRef;
|
|
191
|
+
$[16] = safeClearTimeout;
|
|
192
|
+
$[17] = t7;
|
|
193
|
+
} else t7 = $[17];
|
|
194
|
+
const closeTooltip = t7;
|
|
195
|
+
let t8;
|
|
196
|
+
if ($[18] !== tooltipId) {
|
|
197
|
+
t8 = { tooltipId };
|
|
198
|
+
$[18] = tooltipId;
|
|
199
|
+
$[19] = t8;
|
|
200
|
+
} else t8 = $[19];
|
|
201
|
+
const value = t8;
|
|
202
|
+
let t9;
|
|
203
|
+
if ($[20] !== readTriggerRef || $[21] !== type) {
|
|
204
|
+
t9 = () => {
|
|
205
|
+
if (!tooltipElRef.current || !readTriggerRef.current) return;
|
|
206
|
+
const trigger_0 = readTriggerRef.current;
|
|
207
|
+
const isInvalidTrigger = !(trigger_0 instanceof HTMLElement);
|
|
208
|
+
warning(isInvalidTrigger, "The `Tooltip` component expects its trigger ref to resolve to an HTML element. Ensure the trigger forwards its ref to a single interactive element instead of a React Fragment.");
|
|
209
|
+
if (isInvalidTrigger) return;
|
|
210
|
+
const isTriggerInteractive = isInteractive(trigger_0);
|
|
211
|
+
const triggerChildren = trigger_0.childNodes;
|
|
212
|
+
const hasInteractiveDescendant = Array.from(triggerChildren).some(_temp2);
|
|
213
|
+
!(isTriggerInteractive || hasInteractiveDescendant) && invariant(false, "The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead.");
|
|
214
|
+
if (type === "label") {
|
|
215
|
+
const hasAriaLabel = trigger_0.hasAttribute("aria-label");
|
|
216
|
+
const hasAriaLabelInChildren = Array.from(trigger_0.childNodes).some(_temp3);
|
|
217
|
+
warning(hasAriaLabel || hasAriaLabelInChildren, "The label type `Tooltip` is going to be used here to label the trigger element. Please remove the aria-label from the trigger element.");
|
|
218
|
+
}
|
|
219
|
+
if (typeof window !== "undefined") {
|
|
220
|
+
if (!isSupported()) apply();
|
|
221
|
+
}
|
|
222
|
+
tooltipElRef.current.setAttribute("popover", "auto");
|
|
223
|
+
};
|
|
224
|
+
$[20] = readTriggerRef;
|
|
225
|
+
$[21] = type;
|
|
226
|
+
$[22] = t9;
|
|
227
|
+
} else t9 = $[22];
|
|
228
|
+
let t10;
|
|
229
|
+
if ($[23] !== direction || $[24] !== readTriggerRef || $[25] !== type) {
|
|
230
|
+
t10 = [
|
|
231
|
+
tooltipElRef,
|
|
232
|
+
readTriggerRef,
|
|
233
|
+
direction,
|
|
234
|
+
type
|
|
235
|
+
];
|
|
236
|
+
$[23] = direction;
|
|
237
|
+
$[24] = readTriggerRef;
|
|
238
|
+
$[25] = type;
|
|
239
|
+
$[26] = t10;
|
|
240
|
+
} else t10 = $[26];
|
|
241
|
+
useEffect(t9, t10);
|
|
242
|
+
let t11;
|
|
243
|
+
if ($[27] !== closeTooltip || $[28] !== isPopoverOpen) {
|
|
244
|
+
t11 = (event) => {
|
|
245
|
+
if (isPopoverOpen) {
|
|
246
|
+
event.stopImmediatePropagation();
|
|
247
|
+
event.preventDefault();
|
|
248
|
+
closeTooltip();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
$[27] = closeTooltip;
|
|
252
|
+
$[28] = isPopoverOpen;
|
|
253
|
+
$[29] = t11;
|
|
254
|
+
} else t11 = $[29];
|
|
255
|
+
let t12;
|
|
256
|
+
if ($[30] !== isPopoverOpen) {
|
|
257
|
+
t12 = [isPopoverOpen];
|
|
258
|
+
$[30] = isPopoverOpen;
|
|
259
|
+
$[31] = t12;
|
|
260
|
+
} else t12 = $[31];
|
|
261
|
+
useOnEscapePress(t11, t12);
|
|
171
262
|
const platform = usePlatform();
|
|
172
|
-
const
|
|
173
|
-
|
|
263
|
+
const hasAriaLabel_0 = "aria-label" in rest;
|
|
264
|
+
let t13;
|
|
265
|
+
if ($[32] !== keybindingHint) {
|
|
266
|
+
t13 = Array.isArray(keybindingHint) ? keybindingHint : [keybindingHint];
|
|
267
|
+
$[32] = keybindingHint;
|
|
268
|
+
$[33] = t13;
|
|
269
|
+
} else t13 = $[33];
|
|
270
|
+
const keybindingHints = t13;
|
|
174
271
|
if (isFragmentTrigger) return child;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"aria-describedby"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
onBlur
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
onFocus
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
272
|
+
const t14 = TooltipContext;
|
|
273
|
+
const t15 = /*#__PURE__*/ React.isValidElement(child) && /*#__PURE__*/ React.cloneElement(child, {
|
|
274
|
+
ref: appliedTriggerRef,
|
|
275
|
+
"aria-describedby": (() => {
|
|
276
|
+
if (type !== "description") return child.props["aria-describedby"];
|
|
277
|
+
const existingDescribedBy = child.props["aria-describedby"];
|
|
278
|
+
if (existingDescribedBy) return `${existingDescribedBy} ${tooltipId}`;
|
|
279
|
+
return tooltipId;
|
|
280
|
+
})(),
|
|
281
|
+
"aria-labelledby": type === "label" ? tooltipId : child.props["aria-labelledby"],
|
|
282
|
+
onBlur: (event_0) => {
|
|
283
|
+
var _child$props$onBlur, _child$props;
|
|
284
|
+
closeTooltip();
|
|
285
|
+
(_child$props$onBlur = (_child$props = child.props).onBlur) === null || _child$props$onBlur === void 0 || _child$props$onBlur.call(_child$props, event_0);
|
|
286
|
+
},
|
|
287
|
+
onTouchEnd: (event_1) => {
|
|
288
|
+
var _child$props$onTouchE, _child$props2;
|
|
289
|
+
(_child$props$onTouchE = (_child$props2 = child.props).onTouchEnd) === null || _child$props$onTouchE === void 0 || _child$props$onTouchE.call(_child$props2, event_1);
|
|
290
|
+
safeSetTimeout(() => closeTooltip(), 10);
|
|
291
|
+
},
|
|
292
|
+
onFocus: (event_2) => {
|
|
293
|
+
var _child$props$onFocus, _child$props3;
|
|
294
|
+
try {
|
|
295
|
+
if (!event_2.target.matches(":focus-visible")) return;
|
|
296
|
+
} catch (t16) {}
|
|
297
|
+
openTooltip();
|
|
298
|
+
(_child$props$onFocus = (_child$props3 = child.props).onFocus) === null || _child$props$onFocus === void 0 || _child$props$onFocus.call(_child$props3, event_2);
|
|
299
|
+
},
|
|
300
|
+
onMouseOverCapture: (event_3) => {
|
|
301
|
+
const delayTime = delayTimeMap[delay] || 50;
|
|
302
|
+
openTimeoutRef.current = safeSetTimeout(() => {
|
|
303
|
+
var _child$props$onMouseE, _child$props4;
|
|
304
|
+
if (!openTimeoutRef.current) return;
|
|
201
305
|
openTooltip();
|
|
202
|
-
(_child$props$
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
306
|
+
(_child$props$onMouseE = (_child$props4 = child.props).onMouseEnter) === null || _child$props$onMouseE === void 0 || _child$props$onMouseE.call(_child$props4, event_3);
|
|
307
|
+
}, delayTime);
|
|
308
|
+
},
|
|
309
|
+
onMouseLeave: (event_4) => {
|
|
310
|
+
var _child$props$onMouseL, _child$props5;
|
|
311
|
+
closeTooltip();
|
|
312
|
+
(_child$props$onMouseL = (_child$props5 = child.props).onMouseLeave) === null || _child$props$onMouseL === void 0 || _child$props$onMouseL.call(_child$props5, event_4);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
let t17;
|
|
316
|
+
if ($[34] !== className) {
|
|
317
|
+
t17 = clsx(className, Tooltip_module_css_default.Tooltip);
|
|
318
|
+
$[34] = className;
|
|
319
|
+
$[35] = t17;
|
|
320
|
+
} else t17 = $[35];
|
|
321
|
+
const t18 = type === "description" ? "tooltip" : void 0;
|
|
322
|
+
const t19 = hasAriaLabel_0 || keybindingHints.length === 0 ? tooltipId : void 0;
|
|
323
|
+
let t20;
|
|
324
|
+
if ($[36] !== hasAriaLabel_0 || $[37] !== keybindingHints || $[38] !== platform || $[39] !== text || $[40] !== tooltipId) {
|
|
325
|
+
t20 = keybindingHints.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("span", {
|
|
326
|
+
id: hasAriaLabel_0 ? void 0 : tooltipId,
|
|
327
|
+
children: [text, /* @__PURE__ */ jsxs(VisuallyHidden, { children: [
|
|
328
|
+
"(",
|
|
329
|
+
keybindingHints.map((hint) => getAccessibleKeybindingHintString(hint, platform)).join(" or "),
|
|
330
|
+
")"
|
|
331
|
+
] })]
|
|
218
332
|
}), /* @__PURE__ */ jsx("span", {
|
|
219
|
-
className: clsx(
|
|
333
|
+
className: clsx(Tooltip_module_css_default.KeybindingHintContainer, text && Tooltip_module_css_default.HasTextBefore, keybindingHints.length > 1 && Tooltip_module_css_default.HasMultipleHints),
|
|
334
|
+
"aria-hidden": true,
|
|
335
|
+
"data-component": "Tooltip.KeybindingHintContainer",
|
|
336
|
+
children: keybindingHints.map(_temp4)
|
|
337
|
+
})] }) : text;
|
|
338
|
+
$[36] = hasAriaLabel_0;
|
|
339
|
+
$[37] = keybindingHints;
|
|
340
|
+
$[38] = platform;
|
|
341
|
+
$[39] = text;
|
|
342
|
+
$[40] = tooltipId;
|
|
343
|
+
$[41] = t20;
|
|
344
|
+
} else t20 = $[41];
|
|
345
|
+
let t21;
|
|
346
|
+
if ($[42] !== calculatedDirection || $[43] !== closeTooltip || $[44] !== openTooltip || $[45] !== rest || $[46] !== t17 || $[47] !== t18 || $[48] !== t19 || $[49] !== t20) {
|
|
347
|
+
t21 = /* @__PURE__ */ jsx("span", {
|
|
348
|
+
className: t17,
|
|
220
349
|
ref: tooltipElRef,
|
|
221
350
|
"data-direction": calculatedDirection,
|
|
222
351
|
"data-component": "Tooltip",
|
|
223
352
|
...rest,
|
|
224
|
-
role:
|
|
353
|
+
role: t18,
|
|
225
354
|
"aria-hidden": true,
|
|
226
355
|
onMouseEnter: openTooltip,
|
|
227
356
|
onMouseLeave: closeTooltip,
|
|
228
|
-
id:
|
|
229
|
-
children:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
357
|
+
id: t19,
|
|
358
|
+
children: t20
|
|
359
|
+
});
|
|
360
|
+
$[42] = calculatedDirection;
|
|
361
|
+
$[43] = closeTooltip;
|
|
362
|
+
$[44] = openTooltip;
|
|
363
|
+
$[45] = rest;
|
|
364
|
+
$[46] = t17;
|
|
365
|
+
$[47] = t18;
|
|
366
|
+
$[48] = t19;
|
|
367
|
+
$[49] = t20;
|
|
368
|
+
$[50] = t21;
|
|
369
|
+
} else t21 = $[50];
|
|
370
|
+
let t22;
|
|
371
|
+
if ($[51] !== t15 || $[52] !== t21) {
|
|
372
|
+
t22 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t15, t21] });
|
|
373
|
+
$[51] = t15;
|
|
374
|
+
$[52] = t21;
|
|
375
|
+
$[53] = t22;
|
|
376
|
+
} else t22 = $[53];
|
|
377
|
+
let t23;
|
|
378
|
+
if ($[54] !== t14.Provider || $[55] !== t22 || $[56] !== value) {
|
|
379
|
+
t23 = /* @__PURE__ */ jsx(t14.Provider, {
|
|
380
|
+
value,
|
|
381
|
+
children: t22
|
|
382
|
+
});
|
|
383
|
+
$[54] = t14.Provider;
|
|
384
|
+
$[55] = t22;
|
|
385
|
+
$[56] = value;
|
|
386
|
+
$[57] = t23;
|
|
387
|
+
} else t23 = $[57];
|
|
388
|
+
return t23;
|
|
249
389
|
});
|
|
250
390
|
Tooltip.__SLOT__ = Symbol("Tooltip");
|
|
391
|
+
function _temp(grandChild) {
|
|
392
|
+
return grandChild instanceof HTMLElement && isInteractive(grandChild);
|
|
393
|
+
}
|
|
394
|
+
function _temp2(child_0) {
|
|
395
|
+
return child_0 instanceof HTMLElement && isInteractive(child_0) || Array.from(child_0.childNodes).some(_temp);
|
|
396
|
+
}
|
|
397
|
+
function _temp3(child_1) {
|
|
398
|
+
return child_1 instanceof HTMLElement && child_1.hasAttribute("aria-label");
|
|
399
|
+
}
|
|
400
|
+
function _temp4(hint_0, i) {
|
|
401
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [i > 0 && " or ", /* @__PURE__ */ jsx(KeybindingHint, {
|
|
402
|
+
keys: hint_0,
|
|
403
|
+
format: "condensed",
|
|
404
|
+
variant: "onEmphasis",
|
|
405
|
+
size: "small"
|
|
406
|
+
})] }, `${i}-${hint_0}`);
|
|
407
|
+
}
|
|
251
408
|
//#endregion
|
|
252
409
|
export { Tooltip };
|
|
@@ -4,7 +4,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
5
|
//#region src/TopicTag/TopicTag.tsx
|
|
6
6
|
function TopicTag(t0) {
|
|
7
|
-
var _as;
|
|
8
7
|
const $ = c(12);
|
|
9
8
|
let as;
|
|
10
9
|
let children;
|
|
@@ -23,7 +22,7 @@ function TopicTag(t0) {
|
|
|
23
22
|
className = $[3];
|
|
24
23
|
rest = $[4];
|
|
25
24
|
}
|
|
26
|
-
const BaseComponent =
|
|
25
|
+
const BaseComponent = as !== null && as !== void 0 ? as : "a";
|
|
27
26
|
let t1;
|
|
28
27
|
if ($[5] !== className) {
|
|
29
28
|
t1 = clsx(className, TopicTag_module_css_default.TopicTag);
|
|
@@ -1,24 +1,97 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
2
3
|
import Truncate_module_css_default from "./Truncate.module.css.js";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { clsx } from "clsx";
|
|
5
6
|
//#region src/Truncate/Truncate.tsx
|
|
6
7
|
function Truncate(props, ref) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const $ = c(29);
|
|
9
|
+
let children;
|
|
10
|
+
let className;
|
|
11
|
+
let expandable;
|
|
12
|
+
let inline;
|
|
13
|
+
let rest;
|
|
14
|
+
let style;
|
|
15
|
+
let t0;
|
|
16
|
+
let t1;
|
|
17
|
+
let title;
|
|
18
|
+
if ($[0] !== props) {
|
|
19
|
+
({as: t0, children, className, title, inline, expandable, maxWidth: t1, style, ...rest} = props);
|
|
20
|
+
$[0] = props;
|
|
21
|
+
$[1] = children;
|
|
22
|
+
$[2] = className;
|
|
23
|
+
$[3] = expandable;
|
|
24
|
+
$[4] = inline;
|
|
25
|
+
$[5] = rest;
|
|
26
|
+
$[6] = style;
|
|
27
|
+
$[7] = t0;
|
|
28
|
+
$[8] = t1;
|
|
29
|
+
$[9] = title;
|
|
30
|
+
} else {
|
|
31
|
+
children = $[1];
|
|
32
|
+
className = $[2];
|
|
33
|
+
expandable = $[3];
|
|
34
|
+
inline = $[4];
|
|
35
|
+
rest = $[5];
|
|
36
|
+
style = $[6];
|
|
37
|
+
t0 = $[7];
|
|
38
|
+
t1 = $[8];
|
|
39
|
+
title = $[9];
|
|
40
|
+
}
|
|
41
|
+
const Component = t0 === void 0 ? "div" : t0;
|
|
42
|
+
const maxWidth = t1 === void 0 ? 125 : t1;
|
|
43
|
+
let t2;
|
|
44
|
+
if ($[10] !== Component || $[11] !== inline) {
|
|
45
|
+
t2 = typeof Component === "string" ? {} : { inline };
|
|
46
|
+
$[10] = Component;
|
|
47
|
+
$[11] = inline;
|
|
48
|
+
$[12] = t2;
|
|
49
|
+
} else t2 = $[12];
|
|
50
|
+
const passthroughProps = t2;
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[13] !== className) {
|
|
53
|
+
t3 = clsx(className, Truncate_module_css_default.Truncate);
|
|
54
|
+
$[13] = className;
|
|
55
|
+
$[14] = t3;
|
|
56
|
+
} else t3 = $[14];
|
|
57
|
+
const t4 = typeof maxWidth === "number" ? `${maxWidth}px` : typeof maxWidth === "string" ? maxWidth : void 0;
|
|
58
|
+
let t5;
|
|
59
|
+
if ($[15] !== style || $[16] !== t4) {
|
|
60
|
+
t5 = {
|
|
17
61
|
...style,
|
|
18
|
-
[
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
62
|
+
["--truncate-max-width"]: t4
|
|
63
|
+
};
|
|
64
|
+
$[15] = style;
|
|
65
|
+
$[16] = t4;
|
|
66
|
+
$[17] = t5;
|
|
67
|
+
} else t5 = $[17];
|
|
68
|
+
const t6 = t5;
|
|
69
|
+
let t7;
|
|
70
|
+
if ($[18] !== Component || $[19] !== children || $[20] !== expandable || $[21] !== inline || $[22] !== passthroughProps || $[23] !== ref || $[24] !== rest || $[25] !== t3 || $[26] !== t6 || $[27] !== title) {
|
|
71
|
+
t7 = /* @__PURE__ */ jsx(Component, {
|
|
72
|
+
...passthroughProps,
|
|
73
|
+
...rest,
|
|
74
|
+
ref,
|
|
75
|
+
className: t3,
|
|
76
|
+
"data-expandable": expandable,
|
|
77
|
+
"data-inline": inline,
|
|
78
|
+
title,
|
|
79
|
+
style: t6,
|
|
80
|
+
children
|
|
81
|
+
});
|
|
82
|
+
$[18] = Component;
|
|
83
|
+
$[19] = children;
|
|
84
|
+
$[20] = expandable;
|
|
85
|
+
$[21] = inline;
|
|
86
|
+
$[22] = passthroughProps;
|
|
87
|
+
$[23] = ref;
|
|
88
|
+
$[24] = rest;
|
|
89
|
+
$[25] = t3;
|
|
90
|
+
$[26] = t6;
|
|
91
|
+
$[27] = title;
|
|
92
|
+
$[28] = t7;
|
|
93
|
+
} else t7 = $[28];
|
|
94
|
+
return t7;
|
|
22
95
|
}
|
|
23
96
|
Truncate.displayName = "Truncate";
|
|
24
97
|
var Truncate_default = fixedForwardRef(Truncate);
|
|
@@ -8,7 +8,6 @@ import { forwardRef, useContext, useRef } from "react";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/UnderlineNav/UnderlineNavItem.tsx
|
|
10
10
|
const UnderlineNavItem = /*#__PURE__*/ forwardRef((allProps, forwardedRef) => {
|
|
11
|
-
var _leadingVisual;
|
|
12
11
|
const $ = c(33);
|
|
13
12
|
let Icon;
|
|
14
13
|
let ariaCurrent;
|
|
@@ -45,8 +44,7 @@ const UnderlineNavItem = /*#__PURE__*/ forwardRef((allProps, forwardedRef) => {
|
|
|
45
44
|
const Component = t0 === void 0 ? "a" : t0;
|
|
46
45
|
let t1;
|
|
47
46
|
if ($[10] !== Component || $[11] !== href) {
|
|
48
|
-
|
|
49
|
-
t1 = Component === "a" ? { href: (_href = href) !== null && _href !== void 0 ? _href : "#" } : href === void 0 ? {} : { href };
|
|
47
|
+
t1 = Component === "a" ? { href: href !== null && href !== void 0 ? href : "#" } : href === void 0 ? {} : { href };
|
|
50
48
|
$[10] = Component;
|
|
51
49
|
$[11] = href;
|
|
52
50
|
$[12] = t1;
|
|
@@ -75,7 +73,7 @@ const UnderlineNavItem = /*#__PURE__*/ forwardRef((allProps, forwardedRef) => {
|
|
|
75
73
|
} else t3 = $[16];
|
|
76
74
|
const clickHandler = t3;
|
|
77
75
|
const t4 = isOverflowing ? true : allProps["aria-hidden"];
|
|
78
|
-
const t5 =
|
|
76
|
+
const t5 = leadingVisual !== null && leadingVisual !== void 0 ? leadingVisual : Icon;
|
|
79
77
|
const t6 = isOverflowing ? -1 : allProps.tabIndex;
|
|
80
78
|
let t7;
|
|
81
79
|
if ($[17] !== Component || $[18] !== ariaCurrent || $[19] !== children || $[20] !== clickHandler || $[21] !== counter || $[22] !== forwardedRef || $[23] !== hrefProps || $[24] !== keyDownHandler || $[25] !== loadingCounters || $[26] !== props || $[27] !== t5 || $[28] !== t6) {
|
|
@@ -86,7 +86,7 @@ const List = /*#__PURE__*/ React.forwardRef((props, forwardedRef) => {
|
|
|
86
86
|
for (const itemProps_0 of restProps.items) {
|
|
87
87
|
var _group$items$length, _group$items, _group$items2;
|
|
88
88
|
const group = groupMap.get(itemProps_0.groupId);
|
|
89
|
-
const itemIndex_0 = (_group$items$length = group === null || group === void 0
|
|
89
|
+
const itemIndex_0 = (_group$items$length = group === null || group === void 0 || (_group$items = group.items) === null || _group$items === void 0 ? void 0 : _group$items.length) !== null && _group$items$length !== void 0 ? _group$items$length : 0;
|
|
90
90
|
groupMap.set(itemProps_0.groupId, {
|
|
91
91
|
...group,
|
|
92
92
|
items: [...(_group$items2 = group === null || group === void 0 ? void 0 : group.items) !== null && _group$items2 !== void 0 ? _group$items2 : [], renderItem({
|
|
@@ -52,7 +52,7 @@ type SelectPanelMessageProps = {
|
|
|
52
52
|
declare const SelectPanel: React.FC<SelectPanelProps> & {
|
|
53
53
|
Button: WithSlotMarker<React.ForwardRefExoticComponent<{
|
|
54
54
|
alignContent?: AlignContent;
|
|
55
|
-
icon?: React.
|
|
55
|
+
icon?: React.ReactNode | React.ComponentType<import("@primer/octicons-react").IconProps> | React.ExoticComponent<import("@primer/octicons-react").IconProps>;
|
|
56
56
|
leadingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
57
57
|
trailingVisual?: React.ElementType | React.ReactElement<any> | null;
|
|
58
58
|
trailingAction?: React.ElementType | null;
|