@primer/react 38.47.0-rc.cdd1ab1f0 → 39.0.0-rc.00628b8df
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 +11 -1
- package/dist/ActionList/List.js +43 -50
- package/dist/AnchoredOverlay/AnchoredOverlay.js +1 -10
- package/dist/ButtonGroup/ButtonGroup.js +20 -27
- package/dist/Checkbox/Checkbox.js +47 -61
- package/dist/Dialog/Dialog.js +4 -10
- package/dist/FeatureFlags/DefaultFeatureFlags.js +0 -2
- package/dist/FilteredActionList/FilteredActionList.js +17 -36
- package/dist/PageHeader/PageHeader.js +31 -41
- package/dist/PageLayout/usePaneWidth.js +27 -25
- package/dist/TextInput/TextInput.js +107 -114
- package/dist/Timeline/Timeline.d.ts +3 -3
- package/dist/Timeline/Timeline.js +61 -140
- package/dist/TooltipV2/Tooltip.js +76 -87
- package/dist/TreeView/useTreeRovingTabIndex.js +11 -10
- package/dist/experimental/Tabs/useTabList.js +14 -21
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +46 -54
- package/dist/hooks/useRefObjectAsForwardedRef.js +2 -2
- package/dist/hooks/useSyncedState.js +15 -9
- package/package.json +4 -5
|
@@ -10,8 +10,6 @@ import { getCharacterCountState } from "../utils/character-counter.js";
|
|
|
10
10
|
import { AriaStatus } from "../live-region/AriaStatus.js";
|
|
11
11
|
import Text_default from "../Text/Text.js";
|
|
12
12
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
13
|
-
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
14
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
15
13
|
import React, { useId, useRef, useState } from "react";
|
|
16
14
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
17
15
|
import { clsx } from "clsx";
|
|
@@ -20,18 +18,14 @@ import { AlertFillIcon } from "@primer/octicons-react";
|
|
|
20
18
|
// src/TextInput/TextInput.tsx
|
|
21
19
|
const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
22
20
|
var _counter$isOverLimit;
|
|
23
|
-
const $ = c(
|
|
21
|
+
const $ = c(79);
|
|
24
22
|
const { icon: IconComponent, leadingVisual: LeadingVisual, trailingVisual: TrailingVisual, trailingAction, block, className, contrast, disabled, loading, loaderPosition: t1, loaderText: t2, monospace, validationStatus, size: sizeProp, onFocus, onBlur, variant: variantProp, width: widthProp, minWidth: minWidthProp, maxWidth: maxWidthProp, type: t3, required, characterLimit, onChange, value, defaultValue, "data-component": dataComponent, ...inputProps } = t0;
|
|
25
23
|
const loaderPosition = t1 === void 0 ? "auto" : t1;
|
|
26
24
|
const loaderText = t2 === void 0 ? "Loading" : t2;
|
|
27
25
|
const type = t3 === void 0 ? "text" : t3;
|
|
28
26
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
29
|
-
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
30
27
|
const inputRef = useRef(null);
|
|
31
28
|
const mergedRef = useMergedRefs(inputRef, ref);
|
|
32
|
-
const providedOrCreatedRef = useProvidedRefOrCreate(ref);
|
|
33
|
-
const readRef = mergedRefEnabled ? inputRef : providedOrCreatedRef;
|
|
34
|
-
const appliedRef = mergedRefEnabled ? mergedRef : providedOrCreatedRef;
|
|
35
29
|
const isControlled = value !== void 0;
|
|
36
30
|
let t4;
|
|
37
31
|
if ($[0] !== defaultValue) {
|
|
@@ -54,53 +48,52 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
54
48
|
const showTrailingLoadingIndicator = loading && (loaderPosition === "trailing" || Boolean(loaderPosition === "auto" && !LeadingVisual));
|
|
55
49
|
const isSegmentedInputType = type === "date" || type === "time" || type === "datetime-local";
|
|
56
50
|
let t6;
|
|
57
|
-
if ($[4] !== isSegmentedInputType
|
|
51
|
+
if ($[4] !== isSegmentedInputType) {
|
|
58
52
|
t6 = (e) => {
|
|
59
|
-
if (e.target !==
|
|
60
|
-
var
|
|
61
|
-
(
|
|
53
|
+
if (e.target !== inputRef.current || !isSegmentedInputType) {
|
|
54
|
+
var _inputRef$current;
|
|
55
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
62
56
|
}
|
|
63
57
|
};
|
|
64
58
|
$[4] = isSegmentedInputType;
|
|
65
|
-
$[5] =
|
|
66
|
-
|
|
67
|
-
} else t6 = $[6];
|
|
59
|
+
$[5] = t6;
|
|
60
|
+
} else t6 = $[5];
|
|
68
61
|
const focusInput = t6;
|
|
69
62
|
const leadingVisualId = useId();
|
|
70
63
|
const trailingVisualId = useId();
|
|
71
64
|
const loadingId = useId();
|
|
72
65
|
const inputDescribedBy = clsx(inputProps["aria-describedby"], LeadingVisual && leadingVisualId, TrailingVisual && trailingVisualId, loading && loadingId) || void 0;
|
|
73
66
|
let t7;
|
|
74
|
-
if ($[
|
|
67
|
+
if ($[6] !== onFocus) {
|
|
75
68
|
t7 = (e_0) => {
|
|
76
69
|
setIsInputFocused(true);
|
|
77
70
|
onFocus && onFocus(e_0);
|
|
78
71
|
};
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
} else t7 = $[
|
|
72
|
+
$[6] = onFocus;
|
|
73
|
+
$[7] = t7;
|
|
74
|
+
} else t7 = $[7];
|
|
82
75
|
const handleInputFocus = t7;
|
|
83
76
|
let t8;
|
|
84
|
-
if ($[
|
|
77
|
+
if ($[8] !== onBlur) {
|
|
85
78
|
t8 = (e_1) => {
|
|
86
79
|
setIsInputFocused(false);
|
|
87
80
|
onBlur && onBlur(e_1);
|
|
88
81
|
};
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
} else t8 = $[
|
|
82
|
+
$[8] = onBlur;
|
|
83
|
+
$[9] = t8;
|
|
84
|
+
} else t8 = $[9];
|
|
92
85
|
const handleInputBlur = t8;
|
|
93
86
|
let t9;
|
|
94
|
-
if ($[
|
|
87
|
+
if ($[10] !== characterLimit || $[11] !== isControlled || $[12] !== onChange) {
|
|
95
88
|
t9 = (e_2) => {
|
|
96
89
|
if (characterLimit && !isControlled) setUncontrolledLength(e_2.target.value.length);
|
|
97
90
|
onChange === null || onChange === void 0 || onChange(e_2);
|
|
98
91
|
};
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
} else t9 = $[
|
|
92
|
+
$[10] = characterLimit;
|
|
93
|
+
$[11] = isControlled;
|
|
94
|
+
$[12] = onChange;
|
|
95
|
+
$[13] = t9;
|
|
96
|
+
} else t9 = $[13];
|
|
104
97
|
const handleInputChange = t9;
|
|
105
98
|
const characterCountId = useId();
|
|
106
99
|
const characterCountStaticMessageId = useId();
|
|
@@ -110,23 +103,23 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
110
103
|
const t12 = Boolean(trailingAction);
|
|
111
104
|
const t13 = Boolean(loading);
|
|
112
105
|
let t14;
|
|
113
|
-
if ($[
|
|
106
|
+
if ($[14] !== IconComponent) {
|
|
114
107
|
t14 = IconComponent && /* @__PURE__ */ jsx(IconComponent, {
|
|
115
108
|
className: "TextInput-icon",
|
|
116
109
|
"data-component": "TextInput.Icon"
|
|
117
110
|
});
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
} else t14 = $[
|
|
111
|
+
$[14] = IconComponent;
|
|
112
|
+
$[15] = t14;
|
|
113
|
+
} else t14 = $[15];
|
|
121
114
|
const t15 = typeof loading === "boolean";
|
|
122
115
|
let t16;
|
|
123
|
-
if ($[
|
|
116
|
+
if ($[16] !== LeadingVisual) {
|
|
124
117
|
t16 = typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /* @__PURE__ */ jsx(LeadingVisual, {}) : LeadingVisual;
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
} else t16 = $[
|
|
118
|
+
$[16] = LeadingVisual;
|
|
119
|
+
$[17] = t16;
|
|
120
|
+
} else t16 = $[17];
|
|
128
121
|
let t17;
|
|
129
|
-
if ($[
|
|
122
|
+
if ($[18] !== leadingVisualId || $[19] !== showLeadingLoadingIndicator || $[20] !== t15 || $[21] !== t16) {
|
|
130
123
|
t17 = /* @__PURE__ */ jsx(TextInputInnerVisualSlot, {
|
|
131
124
|
visualPosition: "leading",
|
|
132
125
|
showLoadingIndicator: showLeadingLoadingIndicator,
|
|
@@ -134,26 +127,26 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
134
127
|
id: leadingVisualId,
|
|
135
128
|
children: t16
|
|
136
129
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
} else t17 = $[
|
|
130
|
+
$[18] = leadingVisualId;
|
|
131
|
+
$[19] = showLeadingLoadingIndicator;
|
|
132
|
+
$[20] = t15;
|
|
133
|
+
$[21] = t16;
|
|
134
|
+
$[22] = t17;
|
|
135
|
+
} else t17 = $[22];
|
|
143
136
|
const t18 = isValid === "error" ? "true" : void 0;
|
|
144
137
|
let t19;
|
|
145
|
-
if ($[
|
|
138
|
+
if ($[23] !== characterCountStaticMessageId || $[24] !== characterLimit || $[25] !== inputDescribedBy) {
|
|
146
139
|
t19 = characterLimit ? [characterCountStaticMessageId, inputDescribedBy].filter(Boolean).join(" ") || void 0 : inputDescribedBy;
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
} else t19 = $[
|
|
140
|
+
$[23] = characterCountStaticMessageId;
|
|
141
|
+
$[24] = characterLimit;
|
|
142
|
+
$[25] = inputDescribedBy;
|
|
143
|
+
$[26] = t19;
|
|
144
|
+
} else t19 = $[26];
|
|
152
145
|
const t20 = dataComponent !== null && dataComponent !== void 0 ? dataComponent : "input";
|
|
153
146
|
let t21;
|
|
154
|
-
if ($[
|
|
147
|
+
if ($[27] !== defaultValue || $[28] !== disabled || $[29] !== handleInputBlur || $[30] !== handleInputChange || $[31] !== handleInputFocus || $[32] !== inputProps || $[33] !== mergedRef || $[34] !== required || $[35] !== t18 || $[36] !== t19 || $[37] !== t20 || $[38] !== type || $[39] !== value) {
|
|
155
148
|
t21 = /* @__PURE__ */ jsx(UnstyledTextInput, {
|
|
156
|
-
ref:
|
|
149
|
+
ref: mergedRef,
|
|
157
150
|
disabled,
|
|
158
151
|
onFocus: handleInputFocus,
|
|
159
152
|
onBlur: handleInputBlur,
|
|
@@ -167,41 +160,41 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
167
160
|
"aria-describedby": t19,
|
|
168
161
|
"data-component": t20
|
|
169
162
|
});
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
} else t21 = $[
|
|
163
|
+
$[27] = defaultValue;
|
|
164
|
+
$[28] = disabled;
|
|
165
|
+
$[29] = handleInputBlur;
|
|
166
|
+
$[30] = handleInputChange;
|
|
167
|
+
$[31] = handleInputFocus;
|
|
168
|
+
$[32] = inputProps;
|
|
169
|
+
$[33] = mergedRef;
|
|
170
|
+
$[34] = required;
|
|
171
|
+
$[35] = t18;
|
|
172
|
+
$[36] = t19;
|
|
173
|
+
$[37] = t20;
|
|
174
|
+
$[38] = type;
|
|
175
|
+
$[39] = value;
|
|
176
|
+
$[40] = t21;
|
|
177
|
+
} else t21 = $[40];
|
|
185
178
|
let t22;
|
|
186
|
-
if ($[
|
|
179
|
+
if ($[41] !== loaderText || $[42] !== loading || $[43] !== loadingId) {
|
|
187
180
|
t22 = loading && /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
188
181
|
id: loadingId,
|
|
189
182
|
children: loaderText
|
|
190
183
|
});
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else t22 = $[
|
|
184
|
+
$[41] = loaderText;
|
|
185
|
+
$[42] = loading;
|
|
186
|
+
$[43] = loadingId;
|
|
187
|
+
$[44] = t22;
|
|
188
|
+
} else t22 = $[44];
|
|
196
189
|
const t23 = typeof loading === "boolean";
|
|
197
190
|
let t24;
|
|
198
|
-
if ($[
|
|
191
|
+
if ($[45] !== TrailingVisual) {
|
|
199
192
|
t24 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /* @__PURE__ */ jsx(TrailingVisual, {}) : TrailingVisual;
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
} else t24 = $[
|
|
193
|
+
$[45] = TrailingVisual;
|
|
194
|
+
$[46] = t24;
|
|
195
|
+
} else t24 = $[46];
|
|
203
196
|
let t25;
|
|
204
|
-
if ($[
|
|
197
|
+
if ($[47] !== showTrailingLoadingIndicator || $[48] !== t23 || $[49] !== t24 || $[50] !== trailingVisualId) {
|
|
205
198
|
t25 = /* @__PURE__ */ jsx(TextInputInnerVisualSlot, {
|
|
206
199
|
visualPosition: "trailing",
|
|
207
200
|
showLoadingIndicator: showTrailingLoadingIndicator,
|
|
@@ -210,14 +203,14 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
210
203
|
"data-testid": "text-input-trailing-visual",
|
|
211
204
|
children: t24
|
|
212
205
|
});
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
} else t25 = $[
|
|
206
|
+
$[47] = showTrailingLoadingIndicator;
|
|
207
|
+
$[48] = t23;
|
|
208
|
+
$[49] = t24;
|
|
209
|
+
$[50] = trailingVisualId;
|
|
210
|
+
$[51] = t25;
|
|
211
|
+
} else t25 = $[51];
|
|
219
212
|
let t26;
|
|
220
|
-
if ($[
|
|
213
|
+
if ($[52] !== block || $[53] !== contrast || $[54] !== disabled || $[55] !== focusInput || $[56] !== isInputFocused || $[57] !== isValid || $[58] !== maxWidthProp || $[59] !== minWidthProp || $[60] !== monospace || $[61] !== sizeProp || $[62] !== t10 || $[63] !== t11 || $[64] !== t12 || $[65] !== t13 || $[66] !== t14 || $[67] !== t17 || $[68] !== t21 || $[69] !== t22 || $[70] !== t25 || $[71] !== trailingAction || $[72] !== variantProp || $[73] !== widthProp || $[74] !== wrapperClasses) {
|
|
221
214
|
t26 = /* @__PURE__ */ jsxs(TextInputWrapper, {
|
|
222
215
|
block,
|
|
223
216
|
className: wrapperClasses,
|
|
@@ -245,31 +238,31 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
245
238
|
trailingAction
|
|
246
239
|
]
|
|
247
240
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else t26 = $[
|
|
241
|
+
$[52] = block;
|
|
242
|
+
$[53] = contrast;
|
|
243
|
+
$[54] = disabled;
|
|
244
|
+
$[55] = focusInput;
|
|
245
|
+
$[56] = isInputFocused;
|
|
246
|
+
$[57] = isValid;
|
|
247
|
+
$[58] = maxWidthProp;
|
|
248
|
+
$[59] = minWidthProp;
|
|
249
|
+
$[60] = monospace;
|
|
250
|
+
$[61] = sizeProp;
|
|
251
|
+
$[62] = t10;
|
|
252
|
+
$[63] = t11;
|
|
253
|
+
$[64] = t12;
|
|
254
|
+
$[65] = t13;
|
|
255
|
+
$[66] = t14;
|
|
256
|
+
$[67] = t17;
|
|
257
|
+
$[68] = t21;
|
|
258
|
+
$[69] = t22;
|
|
259
|
+
$[70] = t25;
|
|
260
|
+
$[71] = trailingAction;
|
|
261
|
+
$[72] = variantProp;
|
|
262
|
+
$[73] = widthProp;
|
|
263
|
+
$[74] = wrapperClasses;
|
|
264
|
+
$[75] = t26;
|
|
265
|
+
} else t26 = $[75];
|
|
273
266
|
const t27 = characterLimit && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
274
267
|
/* @__PURE__ */ jsx(AriaStatus, {
|
|
275
268
|
announceOnShow: false,
|
|
@@ -296,12 +289,12 @@ const TextInput = /*#__PURE__*/ React.forwardRef((t0, ref) => {
|
|
|
296
289
|
})
|
|
297
290
|
] });
|
|
298
291
|
let t28;
|
|
299
|
-
if ($[
|
|
292
|
+
if ($[76] !== t26 || $[77] !== t27) {
|
|
300
293
|
t28 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t26, t27] });
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
} else t28 = $[
|
|
294
|
+
$[76] = t26;
|
|
295
|
+
$[77] = t27;
|
|
296
|
+
$[78] = t28;
|
|
297
|
+
} else t28 = $[78];
|
|
305
298
|
return t28;
|
|
306
299
|
});
|
|
307
300
|
TextInput.displayName = "TextInput";
|
|
@@ -34,8 +34,8 @@ type TimelineActionsProps = {
|
|
|
34
34
|
type TimelineAvatarProps = {
|
|
35
35
|
/** Class name for custom styling */className?: string;
|
|
36
36
|
} & React.ComponentPropsWithoutRef<'div'>;
|
|
37
|
-
declare const _default: React.ForwardRefExoticComponent<StyledTimelineProps & Omit<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref">, "role"> & React.RefAttributes<
|
|
38
|
-
Item: React.ForwardRefExoticComponent<StyledTimelineItemProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<
|
|
37
|
+
declare const _default: React.ForwardRefExoticComponent<StyledTimelineProps & Omit<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref">, "role"> & React.RefAttributes<HTMLOListElement>> & {
|
|
38
|
+
Item: React.ForwardRefExoticComponent<StyledTimelineItemProps & Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
39
39
|
Avatar: React.ForwardRefExoticComponent<{
|
|
40
40
|
/** Class name for custom styling */className?: string;
|
|
41
41
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -52,7 +52,7 @@ declare const _default: React.ForwardRefExoticComponent<StyledTimelineProps & Om
|
|
|
52
52
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
53
53
|
Break: React.ForwardRefExoticComponent<{
|
|
54
54
|
/** Class name for custom styling */className?: string;
|
|
55
|
-
} & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref">, "role"> & React.RefAttributes<
|
|
55
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref">, "role"> & React.RefAttributes<HTMLLIElement>>;
|
|
56
56
|
Actions: React.ForwardRefExoticComponent<{
|
|
57
57
|
/** Class name for custom styling */className?: string;
|
|
58
58
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
-
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
|
3
2
|
import Timeline_module_css_default from "./Timeline.module.css.js";
|
|
4
3
|
import React from "react";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -10,7 +9,7 @@ function resolveClipSidebar(clipSidebar) {
|
|
|
10
9
|
if (clipSidebar === "start" || clipSidebar === "end") return clipSidebar;
|
|
11
10
|
}
|
|
12
11
|
const Timeline = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
13
|
-
const $ = c(
|
|
12
|
+
const $ = c(13);
|
|
14
13
|
let className;
|
|
15
14
|
let clipSidebar;
|
|
16
15
|
let props;
|
|
@@ -25,7 +24,6 @@ const Timeline = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
25
24
|
clipSidebar = $[2];
|
|
26
25
|
props = $[3];
|
|
27
26
|
}
|
|
28
|
-
const useListSemantics = useFeatureFlag("primer_react_timeline_list_semantics");
|
|
29
27
|
let t1;
|
|
30
28
|
if ($[4] !== clipSidebar) {
|
|
31
29
|
t1 = resolveClipSidebar(clipSidebar);
|
|
@@ -33,58 +31,32 @@ const Timeline = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
33
31
|
$[5] = t1;
|
|
34
32
|
} else t1 = $[5];
|
|
35
33
|
const resolvedClipSidebar = t1;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} else t2 = $[7];
|
|
43
|
-
const t3 = forwardRef;
|
|
44
|
-
let t4;
|
|
45
|
-
if ($[8] !== props || $[9] !== resolvedClipSidebar || $[10] !== t2 || $[11] !== t3) {
|
|
46
|
-
t4 = /* @__PURE__ */ jsx("ol", {
|
|
47
|
-
...props,
|
|
48
|
-
role: "list",
|
|
49
|
-
className: t2,
|
|
50
|
-
ref: t3,
|
|
51
|
-
"data-clip-sidebar": resolvedClipSidebar
|
|
52
|
-
});
|
|
53
|
-
$[8] = props;
|
|
54
|
-
$[9] = resolvedClipSidebar;
|
|
55
|
-
$[10] = t2;
|
|
56
|
-
$[11] = t3;
|
|
57
|
-
$[12] = t4;
|
|
58
|
-
} else t4 = $[12];
|
|
59
|
-
return t4;
|
|
60
|
-
}
|
|
61
|
-
const t2 = props;
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[6] !== className) {
|
|
36
|
+
t2 = clsx(className, Timeline_module_css_default.Timeline);
|
|
37
|
+
$[6] = className;
|
|
38
|
+
$[7] = t2;
|
|
39
|
+
} else t2 = $[7];
|
|
62
40
|
let t3;
|
|
63
|
-
if ($[
|
|
64
|
-
t3 =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
let t5;
|
|
70
|
-
if ($[15] !== resolvedClipSidebar || $[16] !== t2 || $[17] !== t3 || $[18] !== t4) {
|
|
71
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
72
|
-
...t2,
|
|
73
|
-
className: t3,
|
|
74
|
-
ref: t4,
|
|
41
|
+
if ($[8] !== forwardRef || $[9] !== props || $[10] !== resolvedClipSidebar || $[11] !== t2) {
|
|
42
|
+
t3 = /* @__PURE__ */ jsx("ol", {
|
|
43
|
+
...props,
|
|
44
|
+
role: "list",
|
|
45
|
+
className: t2,
|
|
46
|
+
ref: forwardRef,
|
|
75
47
|
"data-clip-sidebar": resolvedClipSidebar
|
|
76
48
|
});
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
} else
|
|
83
|
-
return
|
|
49
|
+
$[8] = forwardRef;
|
|
50
|
+
$[9] = props;
|
|
51
|
+
$[10] = resolvedClipSidebar;
|
|
52
|
+
$[11] = t2;
|
|
53
|
+
$[12] = t3;
|
|
54
|
+
} else t3 = $[12];
|
|
55
|
+
return t3;
|
|
84
56
|
});
|
|
85
57
|
Timeline.displayName = "Timeline";
|
|
86
58
|
const TimelineItem = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
87
|
-
const $ = c(
|
|
59
|
+
const $ = c(11);
|
|
88
60
|
let className;
|
|
89
61
|
let condensed;
|
|
90
62
|
let props;
|
|
@@ -99,55 +71,28 @@ const TimelineItem = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
99
71
|
condensed = $[2];
|
|
100
72
|
props = $[3];
|
|
101
73
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
ref: t2,
|
|
117
|
-
"data-condensed": t3
|
|
118
|
-
});
|
|
119
|
-
$[6] = props;
|
|
120
|
-
$[7] = t1;
|
|
121
|
-
$[8] = t2;
|
|
122
|
-
$[9] = t3;
|
|
123
|
-
$[10] = t4;
|
|
124
|
-
} else t4 = $[10];
|
|
125
|
-
return t4;
|
|
126
|
-
}
|
|
127
|
-
const t1 = props;
|
|
128
|
-
let t2;
|
|
129
|
-
if ($[11] !== className) {
|
|
130
|
-
t2 = clsx(className, "Timeline-Item", Timeline_module_css_default.TimelineItem);
|
|
131
|
-
$[11] = className;
|
|
132
|
-
$[12] = t2;
|
|
133
|
-
} else t2 = $[12];
|
|
134
|
-
const t3 = forwardRef;
|
|
135
|
-
const t4 = condensed ? "" : void 0;
|
|
136
|
-
let t5;
|
|
137
|
-
if ($[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4) {
|
|
138
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
139
|
-
...t1,
|
|
140
|
-
className: t2,
|
|
141
|
-
ref: t3,
|
|
142
|
-
"data-condensed": t4
|
|
74
|
+
let t1;
|
|
75
|
+
if ($[4] !== className) {
|
|
76
|
+
t1 = clsx(className, "Timeline-Item", Timeline_module_css_default.TimelineItem);
|
|
77
|
+
$[4] = className;
|
|
78
|
+
$[5] = t1;
|
|
79
|
+
} else t1 = $[5];
|
|
80
|
+
const t2 = condensed ? "" : void 0;
|
|
81
|
+
let t3;
|
|
82
|
+
if ($[6] !== forwardRef || $[7] !== props || $[8] !== t1 || $[9] !== t2) {
|
|
83
|
+
t3 = /* @__PURE__ */ jsx("li", {
|
|
84
|
+
...props,
|
|
85
|
+
className: t1,
|
|
86
|
+
ref: forwardRef,
|
|
87
|
+
"data-condensed": t2
|
|
143
88
|
});
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
} else
|
|
150
|
-
return
|
|
89
|
+
$[6] = forwardRef;
|
|
90
|
+
$[7] = props;
|
|
91
|
+
$[8] = t1;
|
|
92
|
+
$[9] = t2;
|
|
93
|
+
$[10] = t3;
|
|
94
|
+
} else t3 = $[10];
|
|
95
|
+
return t3;
|
|
151
96
|
});
|
|
152
97
|
TimelineItem.displayName = "TimelineItem";
|
|
153
98
|
const TimelineBadge = (t0) => {
|
|
@@ -225,7 +170,7 @@ const TimelineBody = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
225
170
|
});
|
|
226
171
|
TimelineBody.displayName = "TimelineBody";
|
|
227
172
|
const TimelineBreak = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
228
|
-
const $ = c(
|
|
173
|
+
const $ = c(9);
|
|
229
174
|
let className;
|
|
230
175
|
let props;
|
|
231
176
|
if ($[0] !== t0) {
|
|
@@ -237,50 +182,26 @@ const TimelineBreak = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|
|
|
237
182
|
className = $[1];
|
|
238
183
|
props = $[2];
|
|
239
184
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
} else t1 = $[4];
|
|
247
|
-
const t2 = forwardRef;
|
|
248
|
-
let t3;
|
|
249
|
-
if ($[5] !== props || $[6] !== t1 || $[7] !== t2) {
|
|
250
|
-
t3 = /* @__PURE__ */ jsx("li", {
|
|
251
|
-
...props,
|
|
252
|
-
className: t1,
|
|
253
|
-
ref: t2,
|
|
254
|
-
role: "presentation"
|
|
255
|
-
});
|
|
256
|
-
$[5] = props;
|
|
257
|
-
$[6] = t1;
|
|
258
|
-
$[7] = t2;
|
|
259
|
-
$[8] = t3;
|
|
260
|
-
} else t3 = $[8];
|
|
261
|
-
return t3;
|
|
262
|
-
}
|
|
263
|
-
const t1 = props;
|
|
185
|
+
let t1;
|
|
186
|
+
if ($[3] !== className) {
|
|
187
|
+
t1 = clsx(className, Timeline_module_css_default.TimelineBreak);
|
|
188
|
+
$[3] = className;
|
|
189
|
+
$[4] = t1;
|
|
190
|
+
} else t1 = $[4];
|
|
264
191
|
let t2;
|
|
265
|
-
if ($[
|
|
266
|
-
t2 =
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
let t4;
|
|
272
|
-
if ($[11] !== t1 || $[12] !== t2 || $[13] !== t3) {
|
|
273
|
-
t4 = /* @__PURE__ */ jsx("div", {
|
|
274
|
-
...t1,
|
|
275
|
-
className: t2,
|
|
276
|
-
ref: t3
|
|
192
|
+
if ($[5] !== forwardRef || $[6] !== props || $[7] !== t1) {
|
|
193
|
+
t2 = /* @__PURE__ */ jsx("li", {
|
|
194
|
+
...props,
|
|
195
|
+
className: t1,
|
|
196
|
+
ref: forwardRef,
|
|
197
|
+
role: "presentation"
|
|
277
198
|
});
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
} else
|
|
283
|
-
return
|
|
199
|
+
$[5] = forwardRef;
|
|
200
|
+
$[6] = props;
|
|
201
|
+
$[7] = t1;
|
|
202
|
+
$[8] = t2;
|
|
203
|
+
} else t2 = $[8];
|
|
204
|
+
return t2;
|
|
284
205
|
});
|
|
285
206
|
TimelineBreak.displayName = "TimelineBreak";
|
|
286
207
|
const TimelineActions = /*#__PURE__*/ React.forwardRef((t0, forwardRef) => {
|