@primer/react
Version:
An implementation of GitHub's Primer Design System using React
120 lines (117 loc) • 3.18 kB
JavaScript
import { c } from 'react-compiler-runtime';
import { clsx } from 'clsx';
import classes from './FilteredActionList.module.css.js';
import { jsx } from 'react/jsx-runtime';
import TextInput from '../TextInput/TextInput.js';
function FilteredActionListInput(t0) {
const $ = c(28);
let className;
let fullScreenOnNarrow;
let inputDescriptionTextId;
let inputRef;
let listId;
let loading;
let onInputChange;
let onInputKeyDown;
let onInputKeyPress;
let placeholderText;
let restTextInputProps;
let value;
if ($[0] !== t0) {
({
inputRef,
value,
onInputChange,
onInputKeyPress,
onInputKeyDown,
placeholderText,
listId,
inputDescriptionTextId,
loading,
fullScreenOnNarrow,
className,
...restTextInputProps
} = t0);
$[0] = t0;
$[1] = className;
$[2] = fullScreenOnNarrow;
$[3] = inputDescriptionTextId;
$[4] = inputRef;
$[5] = listId;
$[6] = loading;
$[7] = onInputChange;
$[8] = onInputKeyDown;
$[9] = onInputKeyPress;
$[10] = placeholderText;
$[11] = restTextInputProps;
$[12] = value;
} else {
className = $[1];
fullScreenOnNarrow = $[2];
inputDescriptionTextId = $[3];
inputRef = $[4];
listId = $[5];
loading = $[6];
onInputChange = $[7];
onInputKeyDown = $[8];
onInputKeyPress = $[9];
placeholderText = $[10];
restTextInputProps = $[11];
value = $[12];
}
let t1;
if ($[13] !== className || $[14] !== fullScreenOnNarrow) {
t1 = clsx(className, {
[classes.FullScreenTextInput]: fullScreenOnNarrow
});
$[13] = className;
$[14] = fullScreenOnNarrow;
$[15] = t1;
} else {
t1 = $[15];
}
let t2;
if ($[16] !== inputDescriptionTextId || $[17] !== inputRef || $[18] !== listId || $[19] !== loading || $[20] !== onInputChange || $[21] !== onInputKeyDown || $[22] !== onInputKeyPress || $[23] !== placeholderText || $[24] !== restTextInputProps || $[25] !== t1 || $[26] !== value) {
t2 = /*#__PURE__*/jsx("div", {
className: classes.Header,
"data-component": "FilteredActionList.Header",
children: /*#__PURE__*/jsx(TextInput, {
ref: inputRef,
block: true,
width: "auto",
color: "fg.default",
value: value,
onChange: onInputChange,
onKeyPress: onInputKeyPress,
onKeyDown: onInputKeyDown,
placeholder: placeholderText,
role: "combobox",
"aria-expanded": "true",
"aria-autocomplete": "list",
"aria-controls": listId,
"aria-label": placeholderText,
"aria-describedby": inputDescriptionTextId,
loaderPosition: "leading",
loading: loading,
className: t1,
...restTextInputProps
})
});
$[16] = inputDescriptionTextId;
$[17] = inputRef;
$[18] = listId;
$[19] = loading;
$[20] = onInputChange;
$[21] = onInputKeyDown;
$[22] = onInputKeyPress;
$[23] = placeholderText;
$[24] = restTextInputProps;
$[25] = t1;
$[26] = value;
$[27] = t2;
} else {
t2 = $[27];
}
return t2;
}
export { FilteredActionListInput };