@primer/react 0.0.0-20260424043508 → 0.0.0-20260424044536
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 -1
- package/dist/FilteredActionList/FilteredActionList.js +4 -3
- package/dist/FilteredActionList/FilteredActionListInput.d.ts +4 -6
- package/dist/FilteredActionList/FilteredActionListInput.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionListInput.js +51 -56
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -147,6 +147,8 @@ function FilteredActionList({
|
|
|
147
147
|
// Items are measured dynamically via `measureElement`, so this only affects the
|
|
148
148
|
// initial total-height estimate before items scroll into view.
|
|
149
149
|
const DEFAULT_VIRTUAL_ITEM_HEIGHT = 32;
|
|
150
|
+
|
|
151
|
+
// eslint-disable-next-line react-hooks/incompatible-library
|
|
150
152
|
const virtualizer = useVirtualizer({
|
|
151
153
|
count: items.length,
|
|
152
154
|
getScrollElement: () => scrollContainerRef.current,
|
|
@@ -384,11 +386,10 @@ function FilteredActionList({
|
|
|
384
386
|
"data-component": "FilteredActionList",
|
|
385
387
|
children: [/*#__PURE__*/jsx(FilteredActionListInput, {
|
|
386
388
|
inputRef: inputRef,
|
|
387
|
-
|
|
389
|
+
value: filterValue,
|
|
388
390
|
onInputChange: onInputChange,
|
|
389
391
|
onInputKeyPress: onInputKeyPress,
|
|
390
|
-
onInputKeyDown: onInputKeyDown,
|
|
391
|
-
usingRovingTabindex: usingRovingTabindex,
|
|
392
|
+
onInputKeyDown: usingRovingTabindex ? onInputKeyDown : undefined,
|
|
392
393
|
placeholderText: placeholderText,
|
|
393
394
|
listId: listId,
|
|
394
395
|
inputDescriptionTextId: inputDescriptionTextId,
|
|
@@ -2,16 +2,14 @@ import type React from 'react';
|
|
|
2
2
|
import type { TextInputProps } from '../TextInput';
|
|
3
3
|
export interface FilteredActionLsitInputProps extends Partial<Omit<TextInputProps, 'onChange'>> {
|
|
4
4
|
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onInputKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
9
|
-
usingRovingTabindex: boolean;
|
|
5
|
+
onInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
onInputKeyPress?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
7
|
+
onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
10
8
|
placeholderText?: string;
|
|
11
9
|
listId: string;
|
|
12
10
|
inputDescriptionTextId: string;
|
|
13
11
|
loading: boolean;
|
|
14
12
|
fullScreenOnNarrow?: boolean;
|
|
15
13
|
}
|
|
16
|
-
export declare function FilteredActionListInput({ inputRef,
|
|
14
|
+
export declare function FilteredActionListInput({ inputRef, value, onInputChange, onInputKeyPress, onInputKeyDown, placeholderText, listId, inputDescriptionTextId, loading, fullScreenOnNarrow, className, ...restTextInputProps }: FilteredActionLsitInputProps): React.JSX.Element;
|
|
17
15
|
//# sourceMappingURL=FilteredActionListInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteredActionListInput.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionListInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAA;AAGhD,MAAM,WAAW,4BAA6B,SAAQ,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAC7F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAClD,
|
|
1
|
+
{"version":3,"file":"FilteredActionListInput.d.ts","sourceRoot":"","sources":["../../src/FilteredActionList/FilteredActionListInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAA;AAGhD,MAAM,WAAW,4BAA6B,SAAQ,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAC7F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IAClD,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAChE,eAAe,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAC9D,cAAc,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,sBAAsB,EAAE,MAAM,CAAA;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,KAAK,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,eAAe,EACf,MAAM,EACN,sBAAsB,EACtB,OAAO,EACP,kBAAkB,EAClB,SAAS,EACT,GAAG,kBAAkB,EACtB,EAAE,4BAA4B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2BlD"}
|
|
@@ -5,9 +5,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
5
5
|
import TextInput from '../TextInput/TextInput.js';
|
|
6
6
|
|
|
7
7
|
function FilteredActionListInput(t0) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(28);
|
|
9
9
|
let className;
|
|
10
|
-
let filterValue;
|
|
11
10
|
let fullScreenOnNarrow;
|
|
12
11
|
let inputDescriptionTextId;
|
|
13
12
|
let inputRef;
|
|
@@ -18,15 +17,14 @@ function FilteredActionListInput(t0) {
|
|
|
18
17
|
let onInputKeyPress;
|
|
19
18
|
let placeholderText;
|
|
20
19
|
let restTextInputProps;
|
|
21
|
-
let
|
|
20
|
+
let value;
|
|
22
21
|
if ($[0] !== t0) {
|
|
23
22
|
({
|
|
24
23
|
inputRef,
|
|
25
|
-
|
|
24
|
+
value,
|
|
26
25
|
onInputChange,
|
|
27
26
|
onInputKeyPress,
|
|
28
27
|
onInputKeyDown,
|
|
29
|
-
usingRovingTabindex,
|
|
30
28
|
placeholderText,
|
|
31
29
|
listId,
|
|
32
30
|
inputDescriptionTextId,
|
|
@@ -37,48 +35,45 @@ function FilteredActionListInput(t0) {
|
|
|
37
35
|
} = t0);
|
|
38
36
|
$[0] = t0;
|
|
39
37
|
$[1] = className;
|
|
40
|
-
$[2] =
|
|
41
|
-
$[3] =
|
|
42
|
-
$[4] =
|
|
43
|
-
$[5] =
|
|
44
|
-
$[6] =
|
|
45
|
-
$[7] =
|
|
46
|
-
$[8] =
|
|
47
|
-
$[9] =
|
|
48
|
-
$[10] =
|
|
49
|
-
$[11] =
|
|
50
|
-
$[12] =
|
|
51
|
-
$[13] = usingRovingTabindex;
|
|
38
|
+
$[2] = fullScreenOnNarrow;
|
|
39
|
+
$[3] = inputDescriptionTextId;
|
|
40
|
+
$[4] = inputRef;
|
|
41
|
+
$[5] = listId;
|
|
42
|
+
$[6] = loading;
|
|
43
|
+
$[7] = onInputChange;
|
|
44
|
+
$[8] = onInputKeyDown;
|
|
45
|
+
$[9] = onInputKeyPress;
|
|
46
|
+
$[10] = placeholderText;
|
|
47
|
+
$[11] = restTextInputProps;
|
|
48
|
+
$[12] = value;
|
|
52
49
|
} else {
|
|
53
50
|
className = $[1];
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
usingRovingTabindex = $[13];
|
|
51
|
+
fullScreenOnNarrow = $[2];
|
|
52
|
+
inputDescriptionTextId = $[3];
|
|
53
|
+
inputRef = $[4];
|
|
54
|
+
listId = $[5];
|
|
55
|
+
loading = $[6];
|
|
56
|
+
onInputChange = $[7];
|
|
57
|
+
onInputKeyDown = $[8];
|
|
58
|
+
onInputKeyPress = $[9];
|
|
59
|
+
placeholderText = $[10];
|
|
60
|
+
restTextInputProps = $[11];
|
|
61
|
+
value = $[12];
|
|
66
62
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
t2 = clsx(className, {
|
|
63
|
+
let t1;
|
|
64
|
+
if ($[13] !== className || $[14] !== fullScreenOnNarrow) {
|
|
65
|
+
t1 = clsx(className, {
|
|
71
66
|
[classes.FullScreenTextInput]: fullScreenOnNarrow
|
|
72
67
|
});
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
68
|
+
$[13] = className;
|
|
69
|
+
$[14] = fullScreenOnNarrow;
|
|
70
|
+
$[15] = t1;
|
|
76
71
|
} else {
|
|
77
|
-
|
|
72
|
+
t1 = $[15];
|
|
78
73
|
}
|
|
79
|
-
let
|
|
80
|
-
if ($[
|
|
81
|
-
|
|
74
|
+
let t2;
|
|
75
|
+
if ($[16] !== inputDescriptionTextId || $[17] !== inputRef || $[18] !== listId || $[19] !== loading || $[20] !== onInputChange || $[21] !== onInputKeyDown || $[22] !== onInputKeyPress || $[23] !== placeholderText || $[24] !== restTextInputProps || $[25] !== t1 || $[26] !== value) {
|
|
76
|
+
t2 = /*#__PURE__*/jsx("div", {
|
|
82
77
|
className: classes.Header,
|
|
83
78
|
"data-component": "FilteredActionList.Header",
|
|
84
79
|
children: /*#__PURE__*/jsx(TextInput, {
|
|
@@ -86,10 +81,10 @@ function FilteredActionListInput(t0) {
|
|
|
86
81
|
block: true,
|
|
87
82
|
width: "auto",
|
|
88
83
|
color: "fg.default",
|
|
89
|
-
value:
|
|
84
|
+
value: value,
|
|
90
85
|
onChange: onInputChange,
|
|
91
86
|
onKeyPress: onInputKeyPress,
|
|
92
|
-
onKeyDown:
|
|
87
|
+
onKeyDown: onInputKeyDown,
|
|
93
88
|
placeholder: placeholderText,
|
|
94
89
|
role: "combobox",
|
|
95
90
|
"aria-expanded": "true",
|
|
@@ -99,26 +94,26 @@ function FilteredActionListInput(t0) {
|
|
|
99
94
|
"aria-describedby": inputDescriptionTextId,
|
|
100
95
|
loaderPosition: "leading",
|
|
101
96
|
loading: loading,
|
|
102
|
-
className:
|
|
97
|
+
className: t1,
|
|
103
98
|
...restTextInputProps
|
|
104
99
|
})
|
|
105
100
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
101
|
+
$[16] = inputDescriptionTextId;
|
|
102
|
+
$[17] = inputRef;
|
|
103
|
+
$[18] = listId;
|
|
104
|
+
$[19] = loading;
|
|
105
|
+
$[20] = onInputChange;
|
|
106
|
+
$[21] = onInputKeyDown;
|
|
107
|
+
$[22] = onInputKeyPress;
|
|
108
|
+
$[23] = placeholderText;
|
|
109
|
+
$[24] = restTextInputProps;
|
|
110
|
+
$[25] = t1;
|
|
111
|
+
$[26] = value;
|
|
116
112
|
$[27] = t2;
|
|
117
|
-
$[28] = t3;
|
|
118
113
|
} else {
|
|
119
|
-
|
|
114
|
+
t2 = $[27];
|
|
120
115
|
}
|
|
121
|
-
return
|
|
116
|
+
return t2;
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
export { FilteredActionListInput };
|
package/package.json
CHANGED