@techdocs/cli 1.10.8-next.0 → 1.11.0-next.1
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 -0
- package/dist/commands/generate/generate.cjs.js +2 -0
- package/dist/commands/generate/generate.cjs.js.map +1 -1
- package/dist/commands/index.cjs.js +4 -0
- package/dist/commands/index.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +85 -85
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/{1659.d3caa6c5.chunk.js → 1659.d55e1e7e.chunk.js} +2 -2
- package/dist/embedded-app/static/{1659.d3caa6c5.chunk.js.map → 1659.d55e1e7e.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1749.1749.9bd71ea7.css +2 -0
- package/dist/embedded-app/static/1749.1749.9bd71ea7.css.map +1 -0
- package/dist/embedded-app/static/1749.3363c017.chunk.js +2 -0
- package/dist/embedded-app/static/1749.3363c017.chunk.js.map +1 -0
- package/dist/embedded-app/static/1994.1994.c97915be.css +2 -0
- package/dist/embedded-app/static/1994.1994.c97915be.css.map +1 -0
- package/dist/embedded-app/static/1994.807cdf9c.chunk.js +2 -0
- package/dist/embedded-app/static/1994.807cdf9c.chunk.js.map +1 -0
- package/dist/embedded-app/static/2295.2295.a6e701d5.css +2 -0
- package/dist/embedded-app/static/2295.2295.a6e701d5.css.map +1 -0
- package/dist/embedded-app/static/2295.affbb231.chunk.js +5 -0
- package/dist/embedded-app/static/2295.affbb231.chunk.js.map +1 -0
- package/dist/embedded-app/static/{4587.e2b4e8d1.chunk.js → 4587.5bdade78.chunk.js} +2 -2
- package/dist/embedded-app/static/{4587.e2b4e8d1.chunk.js.map → 4587.5bdade78.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4648.4648.5cd21ea2.css +2 -0
- package/dist/embedded-app/static/4648.4648.5cd21ea2.css.map +1 -0
- package/dist/embedded-app/static/4648.f4e33ba3.chunk.js +2 -0
- package/dist/embedded-app/static/4648.f4e33ba3.chunk.js.map +1 -0
- package/dist/embedded-app/static/6138.6138.22c5a34e.css +2 -0
- package/dist/embedded-app/static/6138.6138.22c5a34e.css.map +1 -0
- package/dist/embedded-app/static/6138.9f69a7c7.chunk.js +2 -0
- package/dist/embedded-app/static/6138.9f69a7c7.chunk.js.map +1 -0
- package/dist/embedded-app/static/7203.68fb62b5.chunk.js +2 -0
- package/dist/embedded-app/static/7203.68fb62b5.chunk.js.map +1 -0
- package/dist/embedded-app/static/7203.7203.a1eea317.css +2 -0
- package/dist/embedded-app/static/7203.7203.a1eea317.css.map +1 -0
- package/dist/embedded-app/static/9050.5b9e5c7b.chunk.js +2 -0
- package/dist/embedded-app/static/9050.5b9e5c7b.chunk.js.map +1 -0
- package/dist/embedded-app/static/9050.9050.0395ba44.css +2 -0
- package/dist/embedded-app/static/9050.9050.0395ba44.css.map +1 -0
- package/dist/embedded-app/static/9230.306648d7.chunk.js +2 -0
- package/dist/embedded-app/static/9230.306648d7.chunk.js.map +1 -0
- package/dist/embedded-app/static/9230.9230.219d1ca0.css +2 -0
- package/dist/embedded-app/static/9230.9230.219d1ca0.css.map +1 -0
- package/dist/embedded-app/static/main.b226bb87.css +2 -0
- package/dist/embedded-app/static/main.b226bb87.css.map +1 -0
- package/dist/embedded-app/static/main.bf467822.js +523 -0
- package/dist/embedded-app/static/main.bf467822.js.map +1 -0
- package/dist/embedded-app/static/module-react-aria-components.92fb2156.js +2 -0
- package/dist/embedded-app/static/{module-react-aria-components.d7b73980.js.map → module-react-aria-components.92fb2156.js.map} +1 -1
- package/dist/embedded-app/static/{module-react-aria.ee611fa4.js → module-react-aria.e3e38de1.js} +2 -2
- package/dist/embedded-app/static/{module-react-aria.ee611fa4.js.map → module-react-aria.e3e38de1.js.map} +1 -1
- package/dist/embedded-app/static/module-remixicon.341273f1.js.map +1 -1
- package/dist/embedded-app/static/{runtime.c1e06c6b.js → runtime.4ae6f2de.js} +2 -2
- package/dist/embedded-app/static/{runtime.c1e06c6b.js.map → runtime.4ae6f2de.js.map} +1 -1
- package/dist/embedded-app/static/vendor.d9ce079c.js +16 -0
- package/dist/embedded-app/static/vendor.d9ce079c.js.map +1 -0
- package/dist/package.json.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/1749.1749.8baddcfb.css +0 -2
- package/dist/embedded-app/static/1749.1749.8baddcfb.css.map +0 -1
- package/dist/embedded-app/static/1749.be57cbd0.chunk.js +0 -2
- package/dist/embedded-app/static/1749.be57cbd0.chunk.js.map +0 -1
- package/dist/embedded-app/static/1994.1994.ffd8676b.css +0 -2
- package/dist/embedded-app/static/1994.1994.ffd8676b.css.map +0 -1
- package/dist/embedded-app/static/1994.2981f452.chunk.js +0 -2
- package/dist/embedded-app/static/1994.2981f452.chunk.js.map +0 -1
- package/dist/embedded-app/static/2295.2295.936ed793.css +0 -2
- package/dist/embedded-app/static/2295.2295.936ed793.css.map +0 -1
- package/dist/embedded-app/static/2295.ee548019.chunk.js +0 -5
- package/dist/embedded-app/static/2295.ee548019.chunk.js.map +0 -1
- package/dist/embedded-app/static/4648.07315500.chunk.js +0 -2
- package/dist/embedded-app/static/4648.07315500.chunk.js.map +0 -1
- package/dist/embedded-app/static/4648.4648.c470d11c.css +0 -2
- package/dist/embedded-app/static/4648.4648.c470d11c.css.map +0 -1
- package/dist/embedded-app/static/6138.6138.e2289b5d.css +0 -2
- package/dist/embedded-app/static/6138.6138.e2289b5d.css.map +0 -1
- package/dist/embedded-app/static/6138.ba8a0164.chunk.js +0 -2
- package/dist/embedded-app/static/6138.ba8a0164.chunk.js.map +0 -1
- package/dist/embedded-app/static/7203.6919bbc3.chunk.js +0 -2
- package/dist/embedded-app/static/7203.6919bbc3.chunk.js.map +0 -1
- package/dist/embedded-app/static/7203.7203.cefa9a1b.css +0 -2
- package/dist/embedded-app/static/7203.7203.cefa9a1b.css.map +0 -1
- package/dist/embedded-app/static/9050.164f67fc.chunk.js +0 -2
- package/dist/embedded-app/static/9050.164f67fc.chunk.js.map +0 -1
- package/dist/embedded-app/static/9050.9050.90aa6155.css +0 -2
- package/dist/embedded-app/static/9050.9050.90aa6155.css.map +0 -1
- package/dist/embedded-app/static/9230.18c2fa11.chunk.js +0 -2
- package/dist/embedded-app/static/9230.18c2fa11.chunk.js.map +0 -1
- package/dist/embedded-app/static/9230.9230.a84ae986.css +0 -2
- package/dist/embedded-app/static/9230.9230.a84ae986.css.map +0 -1
- package/dist/embedded-app/static/main.c8ae213c.js +0 -523
- package/dist/embedded-app/static/main.c8ae213c.js.map +0 -1
- package/dist/embedded-app/static/main.f9ce547f.css +0 -2
- package/dist/embedded-app/static/main.f9ce547f.css.map +0 -1
- package/dist/embedded-app/static/module-react-aria-components.d7b73980.js +0 -2
- package/dist/embedded-app/static/vendor.4c22115e.js +0 -6
- package/dist/embedded-app/static/vendor.4c22115e.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/9230.18c2fa11.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/OverflowTooltip/OverflowTooltip.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Select/static/ClosedDropdown.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Select/static/OpenedDropdown.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Select/Select.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Table/Filters.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Table/TableLoadingBody.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Table/Table.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonIcon/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonIcon/ButtonIcon.module.css?cd9c","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonIcon/ButtonIcon.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Cell.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/CellText.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Column.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableRoot.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Checkbox/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Checkbox/Checkbox.module.css?40f4","webpack://techdocs-cli-embedded-app/../ui/src/components/Checkbox/Checkbox.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableHeader.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableBody.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Row.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/Select.module.css?4ca6","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Popover/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Popover/Popover.module.css?5c0e","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldLabel/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldLabel/FieldLabel.module.css?90c3","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldLabel/FieldLabel.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldError/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldError/FieldError.module.css?1045","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldError/FieldError.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectTrigger.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectListBox.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectContent.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/Select.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/TablePagination/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/TablePagination/TablePagination.module.css?4197","webpack://techdocs-cli-embedded-app/../ui/src/components/TablePagination/TablePagination.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Skeleton/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Skeleton/Skeleton.module.css?994a","webpack://techdocs-cli-embedded-app/../ui/src/components/Skeleton/Skeleton.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableBodySkeleton.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Table.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/Table.module.css?cce8","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useQueryState.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useStableCallback.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/getEffectivePageSize.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/usePageCache.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useDebouncedReload.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useTable.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useCompletePagination.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useOffsetPagination.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useCursorPagination.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/apis/EntityPresentationApi/entityPresentationSnapshot.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityDataTable/columnFactories.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityDataTable/presets.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityDataTable/EntityDataTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityRelationCard/EntityRelationCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/columns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/presets.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/EntityTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/TitleColumn.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useRelatedEntities.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependsOnResourcesCard/DependsOnResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\n\ntype Props = {\n text?: string | undefined;\n title?: TooltipProps['title'];\n line?: number | undefined;\n placement?: TooltipProps['placement'];\n tooltipClasses?: TooltipProps['classes'];\n};\n\nexport type OverflowTooltipClassKey = 'container';\n\nconst useStyles = makeStyles(\n {\n container: {\n overflow: 'visible !important',\n },\n typo: {\n fontSize: 'inherit',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': ({ line }: Props) => line || 1,\n '-webkit-box-orient': 'vertical',\n },\n },\n { name: 'BackstageOverflowTooltip' },\n);\n\nexport function OverflowTooltip(props: Props) {\n const classes = useStyles(props);\n\n return (\n <Tooltip\n title={props.title ?? (props.text || '')}\n placement={props.placement}\n classes={props.tooltipClasses}\n >\n <Typography className={classes.typo} variant=\"inherit\">\n {props.text}\n </Typography>\n </Tooltip>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { makeStyles, createStyles } from '@material-ui/core/styles';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\n/** @public */\nexport type ClosedDropdownClassKey = 'icon';\n\nconst useStyles = makeStyles(\n theme =>\n createStyles({\n icon: {\n position: 'absolute',\n right: theme.spacing(0.5),\n pointerEvents: 'none',\n color: '#616161',\n },\n }),\n { name: 'BackstageClosedDropdown' },\n);\n\nconst ClosedDropdown = () => {\n const classes = useStyles();\n return (\n <SvgIcon\n className={classes.icon}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n );\n};\n\nexport default ClosedDropdown;\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { makeStyles, createStyles } from '@material-ui/core/styles';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\nexport type OpenedDropdownClassKey = 'icon';\n\nconst useStyles = makeStyles(\n theme =>\n createStyles({\n icon: {\n position: 'absolute',\n right: theme.spacing(0.5),\n pointerEvents: 'none',\n color: '#616161',\n },\n }),\n { name: 'BackstageOpenedDropdown' },\n);\n\nconst OpenedDropdown = () => {\n const classes = useStyles();\n return (\n <SvgIcon\n className={classes.icon}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n );\n};\n\nexport default OpenedDropdown;\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Chip from '@material-ui/core/Chip';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputBase from '@material-ui/core/InputBase';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport {\n createStyles,\n makeStyles,\n Theme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport { ChangeEvent, useEffect, useState } from 'react';\n\nimport ClosedDropdown from './static/ClosedDropdown';\nimport OpenedDropdown from './static/OpenedDropdown';\n\n/** @public */\nexport type SelectInputBaseClassKey = 'root' | 'input';\n\nconst BootstrapInput = withStyles(\n (theme: Theme) =>\n createStyles({\n root: {\n 'label + &': {\n marginTop: theme.spacing(3),\n },\n '&.Mui-focused > div[role=button]': {\n borderColor: theme.palette.primary.main,\n },\n },\n input: {\n borderRadius: theme.shape.borderRadius,\n position: 'relative',\n backgroundColor: theme.palette.background.paper,\n border: '1px solid #ced4da',\n fontSize: theme.typography.body1.fontSize,\n padding: theme.spacing(1.25, 3.25, 1.25, 1.5),\n transition: theme.transitions.create(['border-color', 'box-shadow']),\n '&:focus': {\n background: theme.palette.background.paper,\n borderRadius: theme.shape.borderRadius,\n },\n },\n }),\n { name: 'BackstageSelectInputBase' },\n)(InputBase);\n\n/** @public */\nexport type SelectClassKey =\n | 'formControl'\n | 'label'\n | 'chips'\n | 'chip'\n | 'checkbox'\n | 'root';\n\nconst useStyles = makeStyles(\n (theme: Theme) =>\n createStyles({\n formControl: {\n margin: theme.spacing(1, 0),\n },\n label: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n formLabel: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n chips: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n chip: {\n margin: 2,\n },\n checkbox: {},\n\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n }),\n { name: 'BackstageSelect' },\n);\n\n/** @public */\nexport type SelectItem = {\n label: string;\n value: string | number;\n};\n\n/** @public */\nexport type SelectedItems = string | string[] | number | number[];\n\nexport type SelectProps = {\n multiple?: boolean;\n items: SelectItem[];\n label: string;\n placeholder?: string;\n selected?: SelectedItems;\n onChange: (arg: SelectedItems) => void;\n triggerReset?: boolean;\n native?: boolean;\n disabled?: boolean;\n margin?: 'dense' | 'none';\n 'data-testid'?: string;\n};\n\n/** @public */\nexport function SelectComponent(props: SelectProps) {\n const {\n multiple,\n items,\n label,\n placeholder,\n selected,\n onChange,\n triggerReset,\n native = false,\n disabled = false,\n margin,\n 'data-testid': dataTestId = 'select',\n } = props;\n const classes = useStyles();\n const [value, setValue] = useState<SelectedItems>(\n selected || (multiple ? [] : ''),\n );\n const [isOpen, setOpen] = useState(false);\n\n useEffect(() => {\n setValue(multiple ? [] : '');\n }, [triggerReset, multiple]);\n\n useEffect(() => {\n setValue(selected || (multiple ? [] : ''));\n }, [selected, multiple]);\n\n const handleChange = (event: ChangeEvent<{ value: unknown }>) => {\n setValue(event.target.value as SelectedItems);\n onChange(event.target.value as SelectedItems);\n };\n\n const handleOpen = (event: ChangeEvent<any>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n setOpen(previous => {\n if (multiple && !(event.target instanceof HTMLElement)) {\n return true;\n }\n return !previous;\n });\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleDelete = (selectedValue: string | number) => () => {\n const newValue = (value as any[]).filter(chip => chip !== selectedValue);\n setValue(newValue);\n onChange(newValue);\n };\n\n return (\n <Box className={classes.root}>\n <FormControl className={classes.formControl}>\n <InputLabel className={classes.formLabel}>{label}</InputLabel>\n <Select\n aria-label={label}\n value={value}\n native={native}\n disabled={disabled}\n data-testid={dataTestId}\n displayEmpty\n multiple={multiple}\n margin={margin}\n onChange={handleChange}\n open={isOpen}\n onOpen={handleOpen}\n onClose={handleClose}\n input={<BootstrapInput />}\n label={label}\n renderValue={s =>\n multiple && (value as any[]).length !== 0 ? (\n <Box className={classes.chips}>\n {(s as string[]).map(selectedValue => {\n const item = items.find(el => el.value === selectedValue);\n return item ? (\n <Chip\n data-testid=\"chip\"\n key={item?.value}\n label={item?.label}\n clickable\n deleteIcon={\n <CancelIcon\n data-testid=\"cancel-icon\"\n onMouseDown={event => event.stopPropagation()}\n />\n }\n onDelete={handleDelete(selectedValue)}\n className={classes.chip}\n />\n ) : (\n false\n );\n })}\n </Box>\n ) : (\n <Typography>\n {(value as any[]).length === 0\n ? placeholder || ''\n : items.find(el => el.value === s)?.label}\n </Typography>\n )\n }\n IconComponent={() =>\n !isOpen ? <ClosedDropdown /> : <OpenedDropdown />\n }\n MenuProps={{\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'left',\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'left',\n },\n getContentAnchorEl: null,\n }}\n >\n {!!placeholder && !multiple && (\n <MenuItem value={[]}>{placeholder}</MenuItem>\n )}\n {native\n ? items &&\n items.map(item => (\n <option value={item.value} key={item.value}>\n {item.label}\n </option>\n ))\n : items &&\n items.map(item => (\n <MenuItem key={item.value} value={item.value}>\n {multiple && (\n <Checkbox\n color=\"primary\"\n checked={(value as any[]).includes(item.value) || false}\n className={classes.checkbox}\n />\n )}\n {item.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEffect, useState } from 'react';\n\nimport { Select } from '../Select';\nimport { SelectProps } from '../Select/Select';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport type TableFiltersClassKey = 'root' | 'value' | 'heder' | 'filters';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n height: '100%',\n width: '315px',\n display: 'flex',\n flexDirection: 'column',\n marginRight: theme.spacing(3),\n },\n value: {\n fontWeight: 'bold',\n fontSize: 18,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n height: theme.spacing(7.5),\n justifyContent: 'space-between',\n borderBottom: `1px solid ${theme.palette.grey[500]}`,\n },\n filters: {\n display: 'flex',\n flexDirection: 'column',\n '& > *': {\n marginTop: theme.spacing(2),\n },\n },\n }),\n { name: 'BackstageTableFilters' },\n);\n\nexport type Without<T, K> = Pick<T, Exclude<keyof T, K>>;\n\nexport type Filter = {\n type: 'select' | 'multiple-select';\n element: Without<SelectProps, 'onChange'>;\n};\n\nexport type SelectedFilters = {\n [key: string]: string | string[];\n};\n\ntype Props = {\n filters: Filter[];\n selectedFilters?: SelectedFilters;\n onChangeFilters: (arg: any) => any;\n};\n\nexport const Filters = (props: Props) => {\n const classes = useFilterStyles();\n\n const { onChangeFilters } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [selectedFilters, setSelectedFilters] = useState<SelectedFilters>({\n ...props.selectedFilters,\n });\n const [reset, triggerReset] = useState(false);\n\n // Trigger re-rendering\n const handleClick = () => {\n setSelectedFilters({});\n triggerReset(el => !el);\n };\n\n useEffect(() => {\n onChangeFilters(selectedFilters);\n }, [selectedFilters, onChangeFilters]);\n\n // As material table doesn't provide a way to add a column filter tab we will make our own filter logic\n return (\n <Box className={classes.root}>\n <Box className={classes.header}>\n <Box className={classes.value}>{t('table.filter.title')}</Box>\n <Button color=\"primary\" onClick={handleClick}>\n {t('table.filter.clearAll')}\n </Button>\n </Box>\n <Box className={classes.filters}>\n {props.filters?.length &&\n props.filters.map(filter => (\n <Select\n triggerReset={reset}\n key={filter.element.label}\n {...(filter.element as SelectProps)}\n selected={selectedFilters[filter.element.label]}\n onChange={el =>\n setSelectedFilters({\n ...selectedFilters,\n [filter.element.label]: el as any,\n })\n }\n />\n ))}\n </Box>\n </Box>\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport CircularProgress from '@material-ui/core/CircularProgress';\n\n/**\n * @internal\n */\nexport function TableLoadingBody(props: { colSpan?: number }) {\n return (\n <tbody data-testid=\"loading-indicator\">\n <tr>\n <td colSpan={props.colSpan}>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%',\n minHeight: '15rem',\n }}\n >\n <CircularProgress size=\"5rem\" />\n </Box>\n </td>\n </tr>\n </tbody>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport MTable, {\n Column,\n Icons,\n MaterialTableProps,\n MTableBody,\n MTableHeader,\n MTableToolbar,\n Options,\n} from '@material-table/core';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport {\n makeStyles,\n Theme,\n useTheme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport AddBox from '@material-ui/icons/AddBox';\nimport ArrowUpward from '@material-ui/icons/ArrowUpward';\nimport Check from '@material-ui/icons/Check';\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\nimport ChevronRight from '@material-ui/icons/ChevronRight';\nimport Clear from '@material-ui/icons/Clear';\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\nimport Edit from '@material-ui/icons/Edit';\nimport FilterList from '@material-ui/icons/FilterList';\nimport Search from '@material-ui/icons/Search';\nimport FirstPage from '@material-ui/icons/FirstPage';\nimport LastPage from '@material-ui/icons/LastPage';\nimport Remove from '@material-ui/icons/Remove';\nimport SaveAlt from '@material-ui/icons/SaveAlt';\nimport ViewColumn from '@material-ui/icons/ViewColumn';\nimport { isEqual, transform } from 'lodash';\nimport {\n CSSProperties,\n forwardRef,\n MutableRefObject,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { SelectProps } from '../Select/Select';\nimport { Filter, Filters, SelectedFilters, Without } from './Filters';\nimport { TableLoadingBody } from './TableLoadingBody';\n\n// Material-table is not using the standard icons available in in material-ui. https://github.com/mbrn/material-table/issues/51\nconst tableIcons: Icons = {\n Add: forwardRef<SVGSVGElement>((props, ref) => (\n <AddBox {...props} ref={ref} />\n )),\n Check: forwardRef<SVGSVGElement>((props, ref) => (\n <Check {...props} ref={ref} />\n )),\n Clear: forwardRef<SVGSVGElement>((props, ref) => (\n <Clear {...props} ref={ref} />\n )),\n Delete: forwardRef<SVGSVGElement>((props, ref) => (\n <DeleteOutline {...props} ref={ref} />\n )),\n DetailPanel: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n Edit: forwardRef<SVGSVGElement>((props, ref) => (\n <Edit {...props} ref={ref} />\n )),\n Export: forwardRef<SVGSVGElement>((props, ref) => (\n <SaveAlt {...props} ref={ref} />\n )),\n Filter: forwardRef<SVGSVGElement>((props, ref) => (\n <FilterList {...props} ref={ref} />\n )),\n FirstPage: forwardRef<SVGSVGElement>((props, ref) => (\n <FirstPage {...props} ref={ref} />\n )),\n LastPage: forwardRef<SVGSVGElement>((props, ref) => (\n <LastPage {...props} ref={ref} />\n )),\n NextPage: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n PreviousPage: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronLeft {...props} ref={ref} />\n )),\n ResetSearch: forwardRef<SVGSVGElement>((props, ref) => (\n <Clear {...props} ref={ref} />\n )),\n Search: forwardRef<SVGSVGElement>((props, ref) => (\n <Search {...props} ref={ref} />\n )),\n SortArrow: forwardRef<SVGSVGElement>((props, ref) => (\n <ArrowUpward {...props} ref={ref} />\n )),\n ThirdStateCheck: forwardRef<SVGSVGElement>((props, ref) => (\n <Remove {...props} ref={ref} />\n )),\n ViewColumn: forwardRef<SVGSVGElement>((props, ref) => (\n <ViewColumn {...props} ref={ref} />\n )),\n};\n\n// TODO: Material table might already have such a function internally that we can use?\nfunction extractValueByField(data: any, field: string): any | undefined {\n const path = field.split('.');\n let value = data[path[0]];\n\n for (let i = 1; i < path.length; ++i) {\n if (value === undefined) {\n return value;\n }\n\n const f = path[i];\n value = value[f];\n }\n\n return value;\n}\n\nexport type TableHeaderClassKey = 'header';\n\nconst StyledMTableHeader = withStyles(\n theme => ({\n header: {\n padding: theme.spacing(1, 2, 1, 2.5),\n borderTop: `1px solid ${theme.palette.grey.A100}`,\n borderBottom: `1px solid ${theme.palette.grey.A100}`,\n // withStyles hasn't a generic overload for theme\n fontWeight: theme.typography.fontWeightBold,\n position: 'static',\n wordBreak: 'normal',\n textTransform: 'uppercase',\n },\n }),\n { name: 'BackstageTableHeader' },\n)(MTableHeader);\n\nexport type TableToolbarClassKey = 'root' | 'title' | 'searchField';\n\nconst StyledMTableToolbar = withStyles(\n theme => ({\n root: {\n padding: theme.spacing(3, 0, 2.5, 2.5),\n },\n title: {\n '& > h6': {\n fontWeight: theme.typography.fontWeightBold,\n },\n },\n searchField: {\n paddingRight: theme.spacing(2),\n },\n }),\n { name: 'BackstageTableToolbar' },\n)(MTableToolbar);\n\n/** @public */\nexport type FiltersContainerClassKey = 'root' | 'filterControls' | 'title';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n },\n filterControls: {\n display: 'flex',\n alignItems: 'center',\n },\n title: {\n fontWeight: theme.typography.fontWeightBold,\n fontSize: 18,\n whiteSpace: 'nowrap',\n },\n }),\n { name: 'BackstageTableFiltersContainer' },\n);\n\nexport type TableClassKey = 'root';\n\nconst useTableStyles = makeStyles(\n () => ({\n root: {\n display: 'flex',\n alignItems: 'start',\n },\n }),\n { name: 'BackstageTable' },\n);\n\nfunction convertColumns<T extends object>(\n columns: TableColumn<T>[],\n theme: Theme,\n): TableColumn<T>[] {\n return columns.map(column => {\n const headerStyle: CSSProperties = column.headerStyle ?? {};\n\n let cellStyle = column.cellStyle || {};\n\n if (column.highlight) {\n headerStyle.color = theme.palette.textContrast;\n\n if (typeof cellStyle === 'object') {\n (cellStyle as CSSProperties).fontWeight =\n theme.typography.fontWeightBold;\n } else {\n const cellStyleFn = cellStyle as (\n data: any,\n rowData: T,\n column?: Column<T>,\n ) => CSSProperties;\n cellStyle = (data, rowData, rowColumn) => {\n const style = cellStyleFn(data, rowData, rowColumn);\n return { ...style, fontWeight: theme.typography.fontWeightBold };\n };\n }\n }\n\n return {\n ...column,\n headerStyle,\n cellStyle,\n };\n });\n}\n\nfunction removeDefaultValues(state: any, defaultState: any): any {\n return transform(state, (result, value, key) => {\n if (!isEqual(value, defaultState[key])) {\n result[key] = value;\n }\n });\n}\n\nconst defaultInitialState = {\n search: '',\n filtersOpen: false,\n filters: {},\n};\n\nexport interface TableColumn<T extends object = {}> extends Column<T> {\n highlight?: boolean;\n width?: string;\n}\n\nexport type TableFilter = {\n column: string;\n type: 'select' | 'multiple-select';\n};\n\nexport type TableState = {\n search?: string;\n filtersOpen?: boolean;\n filters?: SelectedFilters;\n};\n\nexport interface TableProps<T extends object = {}>\n extends MaterialTableProps<T> {\n columns: TableColumn<T>[];\n subtitle?: string;\n filters?: TableFilter[];\n initialState?: TableState;\n emptyContent?: ReactNode;\n isLoading?: boolean;\n onStateChange?: (state: TableState) => any;\n}\n\nexport interface TableOptions<T extends object = {}> extends Options<T> {}\n\nexport function TableToolbar(toolbarProps: {\n toolbarRef: MutableRefObject<any>;\n setSearch: (value: string) => void;\n onSearchChanged: (value: string) => void;\n toggleFilters: () => void;\n hasFilters: boolean;\n selectedFiltersLength: number;\n}) {\n const {\n toolbarRef,\n setSearch,\n hasFilters,\n selectedFiltersLength,\n toggleFilters,\n } = toolbarProps;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const filtersClasses = useFilterStyles();\n const onSearchChanged = useCallback(\n (searchText: string) => {\n toolbarProps.onSearchChanged(searchText);\n setSearch(searchText);\n },\n [toolbarProps, setSearch],\n );\n\n if (hasFilters) {\n return (\n <Box className={filtersClasses.root}>\n <Box className={filtersClasses.filterControls}>\n <IconButton onClick={toggleFilters} aria-label=\"filter list\">\n <FilterList />\n </IconButton>\n <Typography className={filtersClasses.title}>\n {t('table.filter.title')} ({selectedFiltersLength})\n </Typography>\n </Box>\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n </Box>\n );\n }\n\n return (\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n );\n}\n\n/**\n * @public\n */\nexport function Table<T extends object = {}>(props: TableProps<T>) {\n const {\n data,\n columns,\n emptyContent,\n options,\n title,\n subtitle,\n localization,\n filters,\n initialState,\n onStateChange,\n components,\n isLoading: loading,\n style,\n ...restProps\n } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const tableClasses = useTableStyles();\n\n const theme = useTheme();\n\n const calculatedInitialState = { ...defaultInitialState, ...initialState };\n\n const [filtersOpen, setFiltersOpen] = useState(\n calculatedInitialState.filtersOpen,\n );\n const toggleFilters = useCallback(\n () => setFiltersOpen(v => !v),\n [setFiltersOpen],\n );\n\n const [selectedFilters, setSelectedFilters] = useState(\n calculatedInitialState.filters,\n );\n\n const [search, setSearch] = useState(calculatedInitialState.search);\n\n useEffect(() => {\n if (onStateChange) {\n const state = removeDefaultValues(\n {\n search,\n filtersOpen,\n filters: selectedFilters,\n },\n defaultInitialState,\n );\n\n onStateChange(state);\n }\n }, [search, filtersOpen, selectedFilters, onStateChange]);\n\n const getFieldByTitle = useCallback(\n (titleValue: string | keyof T) =>\n columns.find(el => el.title === titleValue)?.field,\n [columns],\n );\n\n const tableData = useMemo(() => {\n if (typeof data === 'function' || !selectedFilters) {\n return data;\n }\n\n const selectedFiltersArray = Object.values(selectedFilters);\n if (data && selectedFiltersArray.flat().length) {\n const newData = (data as any[]).filter(\n el =>\n !!Object.entries(selectedFilters)\n .filter(([, value]) => !!(value as { length?: number }).length)\n .every(([key, filterValue]) => {\n const fieldValue = extractValueByField(\n el,\n getFieldByTitle(key) as string,\n );\n\n if (Array.isArray(fieldValue) && Array.isArray(filterValue)) {\n return fieldValue.some(v => filterValue.includes(v));\n } else if (Array.isArray(fieldValue)) {\n return fieldValue.includes(filterValue);\n } else if (Array.isArray(filterValue)) {\n return filterValue.includes(fieldValue);\n }\n\n return fieldValue === filterValue;\n }),\n );\n return newData;\n }\n return data;\n }, [data, selectedFilters, getFieldByTitle]);\n\n const selectedFiltersLength = Object.values(selectedFilters).flat().length;\n\n const hasFilters = !!filters?.length;\n const Toolbar = useCallback(\n (toolbarProps: any /* no type for this in material-table */) => {\n return (\n <TableToolbar\n setSearch={setSearch}\n hasFilters={hasFilters}\n selectedFiltersLength={selectedFiltersLength}\n toggleFilters={toggleFilters}\n {...toolbarProps}\n />\n );\n },\n [toggleFilters, hasFilters, selectedFiltersLength, setSearch],\n );\n\n const hasNoRows = typeof data !== 'function' && data.length === 0;\n const columnCount = columns.length;\n const Body = useMemo(\n () => makeBody({ hasNoRows, emptyContent, columnCount, loading }),\n [hasNoRows, emptyContent, columnCount, loading],\n );\n\n return (\n <Box className={tableClasses.root}>\n {filtersOpen && data && typeof data !== 'function' && filters?.length && (\n <Filters\n filters={constructFilters(filters, data as any[], columns, t)}\n selectedFilters={selectedFilters}\n onChangeFilters={setSelectedFilters}\n />\n )}\n <MTable<T>\n components={{\n Header: StyledMTableHeader,\n Body,\n Toolbar,\n ...components,\n }}\n options={options}\n columns={convertColumns(columns, theme)}\n icons={tableIcons}\n title={\n <>\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n {subtitle && (\n <Typography color=\"textSecondary\" variant=\"body1\">\n {subtitle}\n </Typography>\n )}\n </>\n }\n data={tableData}\n style={{ width: '100%', ...style }}\n localization={{\n ...localization,\n body: {\n emptyDataSourceMessage: t('table.body.emptyDataSourceMessage'),\n ...localization?.body,\n },\n pagination: {\n firstTooltip: t('table.pagination.firstTooltip'),\n labelDisplayedRows: t('table.pagination.labelDisplayedRows'),\n labelRowsSelect: t('table.pagination.labelRowsSelect'),\n lastTooltip: t('table.pagination.lastTooltip'),\n nextTooltip: t('table.pagination.nextTooltip'),\n previousTooltip: t('table.pagination.previousTooltip'),\n ...localization?.pagination,\n },\n header: {\n actions: t('table.header.actions'),\n ...localization?.header,\n },\n toolbar: {\n searchPlaceholder: t('table.toolbar.search'),\n searchTooltip: t('table.toolbar.search'),\n ...localization?.toolbar,\n },\n }}\n {...restProps}\n />\n </Box>\n );\n}\n\nTable.icons = Object.freeze(tableIcons);\n\nfunction makeBody({\n columnCount,\n emptyContent,\n hasNoRows,\n loading,\n}: {\n hasNoRows: boolean;\n emptyContent: ReactNode;\n columnCount: number;\n loading?: boolean;\n}) {\n return (bodyProps: any /* no type for this in material-table */) => {\n if (loading) {\n return <TableLoadingBody colSpan={columnCount} />;\n }\n\n if (emptyContent && hasNoRows) {\n return (\n <tbody>\n <tr>\n <td colSpan={columnCount}>{emptyContent}</td>\n </tr>\n </tbody>\n );\n }\n\n return <MTableBody {...bodyProps} />;\n };\n}\n\nfunction constructFilters<T extends object>(\n filterConfig: TableFilter[],\n dataValue: any[] | undefined,\n columns: TableColumn<T>[],\n t: TranslationFunction<typeof coreComponentsTranslationRef.T>,\n): Filter[] {\n const extractDistinctValues = (field: string | keyof T): Set<any> => {\n const distinctValues = new Set<any>();\n const addValue = (value: any) => {\n if (value !== undefined && value !== null) {\n distinctValues.add(value);\n }\n };\n\n if (dataValue) {\n dataValue.forEach(el => {\n const value = extractValueByField(\n el,\n columns.find(c => c.title === field)?.field as string,\n );\n\n if (Array.isArray(value)) {\n (value as []).forEach(addValue);\n } else {\n addValue(value);\n }\n });\n }\n\n return distinctValues;\n };\n\n const constructSelect = (\n filter: TableFilter,\n ): Without<SelectProps, 'onChange'> => {\n return {\n placeholder: t('table.filter.placeholder'),\n label: filter.column,\n multiple: filter.type === 'multiple-select',\n items: [...extractDistinctValues(filter.column)].sort().map(value => ({\n label: value,\n value,\n })),\n };\n };\n\n return filterConfig.map(filter => ({\n type: filter.type,\n element: constructSelect(filter),\n }));\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ButtonIconOwnProps } from './types';\nimport styles from './ButtonIcon.module.css';\n\n/**\n * Component definition for ButtonIcon\n * @public\n */\nexport const ButtonIconDefinition = defineComponent<ButtonIconOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonIcon',\n content: 'bui-ButtonIconContent',\n spinner: 'bui-ButtonIconSpinner',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n icon: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-ButtonIcon\":\"oswl8eimGwGMv65g\",\"bui-ButtonIconContent\":\"nupI988ZoWQXN2ow\",\"bui-ButtonIconSpinner\":\"S0ip8O7B0EhQCtAt\",\"bui-spin\":\"wvp018_1ftcIUJUQ\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, Ref } from 'react';\nimport { Button as RAButton, ProgressBar } from 'react-aria-components';\nimport { RiLoader4Line } from '@remixicon/react';\nimport type { ButtonIconProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ButtonIconDefinition } from './definition';\n\n/**\n * An icon-only button that supports a loading state and requires an accessible label.\n *\n * @public\n */\nexport const ButtonIcon = forwardRef(\n (props: ButtonIconProps, ref: Ref<HTMLButtonElement>) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n ButtonIconDefinition,\n // Merge deprecated `loading` into `isPending` so data attributes and\n // internal logic only need to check a single prop.\n {\n ...props,\n isPending:\n props.isPending || props.loading\n ? true\n : props.isPending ?? props.loading,\n },\n );\n const { classes, icon, isPending } = ownProps;\n\n return (\n <RAButton\n className={classes.root}\n ref={ref}\n isPending={isPending}\n {...dataAttributes}\n {...restProps}\n >\n {({ isPending }) => (\n <>\n <span className={classes.content}>{icon}</span>\n\n {isPending && (\n <ProgressBar\n aria-label=\"Loading\"\n isIndeterminate\n className={classes.spinner}\n >\n <RiLoader4Line aria-hidden=\"true\" />\n </ProgressBar>\n )}\n </>\n )}\n </RAButton>\n );\n },\n);\n\nButtonIcon.displayName = 'ButtonIcon';\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport type { CellProps } from '../types';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { CellDefinition } from '../definition';\n\n/**\n * A low-level table cell primitive for building custom cell content.\n * For standard use cases, prefer `CellText` or `CellProfile`.\n *\n * @public\n */\nconst Cell = (props: CellProps) => {\n const { ownProps, restProps } = useDefinition(CellDefinition, props);\n\n return <ReactAriaCell className={ownProps.classes.root} {...restProps} />;\n};\n\nCell.displayName = 'Cell';\n\nexport { Cell };\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Text } from '../../Text';\nimport { Link } from '../../Link';\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport type { CellTextProps } from '../types';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { CellTextDefinition } from '../definition';\n\n/**\n * A table cell that renders a primary text title with an optional secondary description, leading icon, and link.\n *\n * @public\n */\nconst CellText = (props: CellTextProps) => {\n const { ownProps, restProps } = useDefinition(CellTextDefinition, props);\n const { classes, title, description, color, leadingIcon, href } = ownProps;\n\n return (\n <ReactAriaCell className={classes.root} {...restProps}>\n <div className={classes.cellContentWrapper}>\n {leadingIcon && <div className={classes.cellIcon}>{leadingIcon}</div>}\n <div className={classes.cellContent}>\n {href ? (\n <Link\n href={href}\n variant=\"body-medium\"\n color={color}\n truncate\n title={title}\n >\n {title}\n </Link>\n ) : (\n <Text\n as=\"p\"\n variant=\"body-medium\"\n color={color}\n truncate\n title={title}\n >\n {title}\n </Text>\n )}\n {description && (\n <Text\n variant=\"body-medium\"\n color=\"secondary\"\n truncate\n title={description}\n >\n {description}\n </Text>\n )}\n </div>\n </div>\n </ReactAriaCell>\n );\n};\n\nCellText.displayName = 'CellText';\n\nexport { CellText };\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Column as ReactAriaColumn } from 'react-aria-components';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { ColumnDefinition } from '../definition';\nimport { ColumnProps } from '../types';\nimport { RiArrowUpLine } from '@remixicon/react';\n\n/**\n * A table column header cell with an optional sort toggle and support for resizable widths.\n *\n * @public\n */\nexport const Column = (props: ColumnProps) => {\n const { ownProps, restProps } = useDefinition(ColumnDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <ReactAriaColumn className={classes.root} {...restProps}>\n {({ allowsSorting }) => (\n <div className={classes.headContent}>\n <span className={classes.headLabel}>{children}</span>\n {allowsSorting && (\n <span aria-hidden=\"true\" className={classes.headSortButton}>\n <RiArrowUpLine size={16} />\n </span>\n )}\n </div>\n )}\n </ReactAriaColumn>\n );\n};\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableDefinition } from '../definition';\nimport { Table as ReactAriaTable } from 'react-aria-components';\nimport { TableRootProps } from '../types';\n\n/**\n * The low-level table root element for building custom table layouts from atomic components.\n * For most use cases, prefer the `Table` convenience wrapper.\n *\n * @public\n */\nexport const TableRoot = (props: TableRootProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n TableDefinition,\n // Merge deprecated `loading` into `isPending` so data attributes and\n // internal logic only need to check a single prop.\n {\n ...props,\n isPending:\n props.isPending || props.loading\n ? true\n : props.isPending ?? props.loading,\n },\n );\n\n return (\n <ReactAriaTable\n className={ownProps.classes.root}\n aria-label=\"Data table\"\n aria-busy={ownProps.stale || ownProps.isPending}\n {...dataAttributes}\n {...restProps}\n />\n );\n};\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { CheckboxOwnProps } from './types';\nimport styles from './Checkbox.module.css';\n\n/**\n * Component definition for Checkbox\n * @public\n */\nexport const CheckboxDefinition = defineComponent<CheckboxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Checkbox',\n indicator: 'bui-CheckboxIndicator',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Checkbox\":\"hJtmqCNU8SMp97Lu\",\"bui-CheckboxIndicator\":\"AsCZ8LTTAs5lRnNR\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport { Checkbox as RACheckbox } from 'react-aria-components';\nimport type { CheckboxProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { CheckboxDefinition } from './definition';\nimport { RiCheckLine, RiSubtractLine } from '@remixicon/react';\n\n/**\n * A form checkbox input with support for indeterminate state and accessible labeling.\n *\n * @public\n */\nexport const Checkbox = forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n CheckboxDefinition,\n props,\n );\n const { classes, children } = ownProps;\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Checkbox requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACheckbox\n ref={ref}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n >\n {({ isIndeterminate }) => (\n <>\n <div className={classes.indicator} aria-hidden=\"true\">\n {isIndeterminate ? (\n <RiSubtractLine size={12} />\n ) : (\n <RiCheckLine size={12} />\n )}\n </div>\n {children != null && <div>{children}</div>}\n </>\n )}\n </RACheckbox>\n );\n },\n);\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n TableHeader as ReactAriaTableHeader,\n Collection,\n useTableOptions,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { Column } from './Column';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableHeaderDefinition } from '../definition';\nimport type { TableHeaderProps } from '../types';\nimport { Flex } from '../../Flex';\n\n/**\n * The header row of a table, rendering column labels and an optional select-all checkbox for toggle selection mode.\n *\n * @public\n */\nexport const TableHeader = <T extends object>(props: TableHeaderProps<T>) => {\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const { ownProps, restProps } = useDefinition(TableHeaderDefinition, props);\n const { classes, columns, children } = ownProps;\n\n return (\n <ReactAriaTableHeader className={classes.root} {...restProps}>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <Column\n width={40}\n minWidth={40}\n maxWidth={40}\n className={classes.headSelection}\n >\n <Flex justify=\"center\" align=\"center\" aria-label=\"Row selection\">\n <Checkbox slot=\"selection\" aria-label=\"Select all\" />\n </Flex>\n </Column>\n )}\n <Collection items={columns}>{children}</Collection>\n </ReactAriaTableHeader>\n );\n};\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TableBody as ReactAriaTableBody } from 'react-aria-components';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableBodyDefinition } from '../definition';\nimport type { TableBodyProps } from '../types';\n\n/**\n * The body section of a table that renders data rows from the provided items collection.\n *\n * @public\n */\nexport const TableBody = <T extends object>(props: TableBodyProps<T>) => {\n const { ownProps, restProps } = useDefinition(TableBodyDefinition, props);\n\n return (\n <ReactAriaTableBody className={ownProps.classes.root} {...restProps} />\n );\n};\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Row as ReactAriaRow,\n useTableOptions,\n Cell as ReactAriaCell,\n Collection,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { RowDefinition } from '../definition';\nimport type { RowProps } from '../types';\nimport { isExternalLink } from '../../../utils/linkUtils';\nimport clsx from 'clsx';\nimport { Flex } from '../../Flex';\n\n/**\n * A table row that can optionally act as a navigation link or trigger an action when clicked, with analytics tracking.\n *\n * @public\n */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n RowDefinition,\n props,\n );\n const { classes, columns, children, href } = ownProps;\n const isExternal = isExternalLink(href);\n const hasInternalHref = !!href && !isExternal;\n const hasExternalHref = !!href && isExternal;\n const hasInteraction = !!restProps.onAction || !!href;\n\n // Derive the effective target, defaulting to _blank for external links.\n const effectiveTarget = hasExternalHref ? '_blank' : restProps.target;\n // Always include noopener noreferrer when target=_blank, merging any\n // consumer-provided rel tokens to avoid reverse-tabnabbing risk.\n const effectiveRel =\n effectiveTarget === '_blank'\n ? [\n ...new Set([\n 'noopener',\n 'noreferrer',\n ...(restProps.rel?.split(/\\s+/).filter(Boolean) ?? []),\n ]),\n ].join(' ')\n : restProps.rel;\n\n const handlePress = hasInteraction\n ? () => {\n restProps.onAction?.();\n if (href) {\n analytics.captureEvent('click', href, {\n attributes: { to: String(href) },\n });\n }\n }\n : undefined;\n\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <ReactAriaCell className={clsx(classes.cell, classes.cellSelection)}>\n <Flex justify=\"center\" align=\"center\">\n <Checkbox slot=\"selection\" aria-label=\"Select row\" />\n </Flex>\n </ReactAriaCell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n return (\n <ReactAriaRow\n href={href}\n {...restProps}\n {...dataAttributes}\n target={effectiveTarget}\n rel={effectiveRel}\n className={clsx(classes.root, restProps.className)}\n data-react-aria-pressable={hasInternalHref ? 'true' : undefined}\n onAction={handlePress}\n >\n {content}\n </ReactAriaRow>\n );\n}\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Select\":\"fl_o2cRttX8vIo5j\",\"bui-SelectPopover\":\"xRoZ59Ta50wTyFbP\",\"bui-SelectTrigger\":\"f6xSegNfnDAA591f\",\"bui-SelectTriggerChevron\":\"hey3g7_Ll4EtTJdE\",\"bui-SelectValue\":\"EOuke6Cxn9cos7ok\",\"bui-SelectItemIndicator\":\"LiF4f9w5zcb_V5q_\",\"bui-SelectList\":\"wCPzC0hbf30wVMOp\",\"bui-SelectItem\":\"Mn7kwp0_L8g4rWcf\",\"bui-SelectItemLabel\":\"sG8NrKzlnq4NyoHP\",\"bui-SelectSearchWrapper\":\"af0jN5t2MnkzSKwM\",\"bui-SelectSearch\":\"MAcGzHfmHVw4bkcS\",\"bui-SelectSearchClear\":\"Qm0LMYJXqDozSs4J\",\"bui-SelectNoResults\":\"mai_FHtvkacjqFtg\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/**\n * Component definition for Select\n * @public\n */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/**\n * Component definition for SelectTrigger\n * @internal\n */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/**\n * Component definition for SelectContent\n * @internal\n */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSearchWrapper',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n searchable: {},\n searchPlaceholder: { default: 'Search...' },\n options: {},\n },\n },\n);\n\n/**\n * Component definition for SelectListBox\n * @internal\n */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n item: 'bui-SelectItem',\n itemIndicator: 'bui-SelectItemIndicator',\n itemLabel: 'bui-SelectItemLabel',\n noResults: 'bui-SelectNoResults',\n },\n propDefs: {\n options: {},\n },\n },\n);\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { PopoverOwnProps } from './types';\nimport styles from './Popover.module.css';\n\n/**\n * Component definition for Popover\n * @public\n */\nexport const PopoverDefinition = defineComponent<PopoverOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Popover',\n arrow: 'bui-PopoverArrow',\n content: 'bui-PopoverContent',\n },\n propDefs: {\n children: {},\n hideArrow: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Popover\":\"c6K43dAXzUIQYTPO\",\"bui-PopoverArrow\":\"nWNOVN9SSAkDCJc4\",\"bui-PopoverContent\":\"ndXnur8atSwrX9tW\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { FieldLabelOwnProps } from './types';\nimport styles from './FieldLabel.module.css';\n\n/**\n * Component definition for FieldLabel\n * @public\n */\nexport const FieldLabelDefinition = defineComponent<FieldLabelOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldLabelWrapper',\n label: 'bui-FieldLabel',\n secondaryLabel: 'bui-FieldSecondaryLabel',\n description: 'bui-FieldDescription',\n },\n propDefs: {\n label: {},\n secondaryLabel: {},\n description: {},\n htmlFor: {},\n id: {},\n descriptionId: {},\n descriptionSlot: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-FieldLabelWrapper\":\"QCxpyIls6to9Bn5w\",\"bui-FieldLabel\":\"qjnrgCeKosN0HGNG\",\"bui-FieldSecondaryLabel\":\"VAD8KU3Enrs4kH_k\",\"bui-FieldDescription\":\"KsFBKeDCTE86ZANx\"};","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Label, Text } from 'react-aria-components';\nimport { forwardRef } from 'react';\nimport type { FieldLabelProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { FieldLabelDefinition } from './definition';\n\n/**\n * Renders a label for a form field with optional secondary label and description text.\n *\n * @public\n */\nexport const FieldLabel = forwardRef<HTMLDivElement, FieldLabelProps>(\n (props: FieldLabelProps, ref) => {\n const { ownProps, restProps } = useDefinition(FieldLabelDefinition, props);\n const {\n classes,\n label,\n secondaryLabel,\n description,\n htmlFor,\n id,\n descriptionId,\n descriptionSlot,\n } = ownProps;\n\n if (!label) return null;\n\n return (\n <div className={classes.root} {...restProps} ref={ref}>\n {label && (\n <Label className={classes.label} htmlFor={htmlFor} id={id}>\n {label}\n {secondaryLabel && (\n <span aria-hidden=\"true\" className={classes.secondaryLabel}>\n ({secondaryLabel})\n </span>\n )}\n </Label>\n )}\n {description && (\n <Text\n slot={descriptionSlot}\n className={classes.description}\n elementType=\"div\"\n id={descriptionId}\n >\n {description}\n </Text>\n )}\n </div>\n );\n },\n);\n\nFieldLabel.displayName = 'FieldLabel';\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { FieldErrorOwnProps } from './types';\nimport styles from './FieldError.module.css';\n\n/**\n * Component definition for FieldError\n * @public\n */\nexport const FieldErrorDefinition = defineComponent<FieldErrorOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldError',\n },\n propDefs: {\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-FieldError\":\"Ai9iNkHuNwQ8kqsz\"};","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { FieldError as AriaFieldError } from 'react-aria-components';\nimport type { FieldErrorProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { FieldErrorDefinition } from './definition';\n\n/**\n * Displays a validation error message associated with a form field.\n *\n * @public\n */\nexport const FieldError = forwardRef<HTMLDivElement, FieldErrorProps>(\n (props: FieldErrorProps, ref) => {\n const { ownProps, restProps } = useDefinition(FieldErrorDefinition, props);\n const { classes } = ownProps;\n\n return <AriaFieldError className={classes.root} ref={ref} {...restProps} />;\n },\n);\n\nFieldError.displayName = 'FieldError';\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport { Button, SelectValue } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectTriggerDefinition } from './definition';\n\ninterface SelectTriggerProps {\n icon?: ReactNode;\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SelectTriggerDefinition,\n props,\n );\n const { classes, icon } = ownProps;\n\n return (\n <Button className={classes.root} {...dataAttributes}>\n {icon}\n <SelectValue className={classes.value} />\n <div className={classes.chevron}>\n <RiArrowDownSLine aria-hidden=\"true\" />\n </div>\n </Button>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ListBox, ListBoxItem, Text } from 'react-aria-components';\nimport { RiCheckLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectListBoxDefinition } from './definition';\nimport type { Option } from './types';\n\ninterface SelectListBoxProps {\n options?: Array<Option>;\n}\n\nconst NoResults = () => {\n const { ownProps } = useDefinition(SelectListBoxDefinition, {});\n const { classes } = ownProps;\n\n return <div className={classes.noResults}>No results found.</div>;\n};\n\nexport function SelectListBox(props: SelectListBoxProps) {\n const { ownProps } = useDefinition(SelectListBoxDefinition, props);\n const { classes, options } = ownProps;\n\n return (\n <ListBox className={classes.root} renderEmptyState={() => <NoResults />}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n textValue={option.label}\n className={classes.item}\n isDisabled={option.disabled}\n >\n <div className={classes.itemIndicator}>\n <RiCheckLine />\n </div>\n <Text slot=\"label\" className={classes.itemLabel}>\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Input,\n SearchField,\n Autocomplete,\n Button,\n} from 'react-aria-components';\nimport { useFilter } from 'react-aria';\nimport { RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectContentDefinition } from './definition';\nimport { SelectListBox } from './SelectListBox';\nimport type { Option } from './types';\n\ninterface SelectContentProps {\n searchable?: boolean;\n searchPlaceholder?: string;\n options?: Array<Option>;\n}\n\nexport function SelectContent(props: SelectContentProps) {\n const { contains } = useFilter({ sensitivity: 'base' });\n const { ownProps } = useDefinition(SelectContentDefinition, props);\n const { classes, searchable, searchPlaceholder, options } = ownProps;\n\n if (!searchable) {\n return <SelectListBox options={options} />;\n }\n\n return (\n <Autocomplete filter={contains}>\n <SearchField\n autoFocus\n className={classes.root}\n aria-label={searchPlaceholder}\n >\n <Input placeholder={searchPlaceholder} className={classes.search} />\n <Button className={classes.searchClear}>\n <RiCloseCircleLine />\n </Button>\n </SearchField>\n <SelectListBox options={options} />\n </Autocomplete>\n );\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport { Select as AriaSelect, Popover } from 'react-aria-components';\nimport { SelectProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectDefinition } from './definition';\nimport { PopoverDefinition } from '../Popover/definition';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { SelectTrigger } from './SelectTrigger';\nimport { SelectContent } from './SelectContent';\n\n/**\n * A dropdown picker for selecting one or multiple options from a list, with optional search filtering and inline error display.\n *\n * @public\n */\nexport const Select = forwardRef<\n HTMLDivElement,\n SelectProps<'single' | 'multiple'>\n>((props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SelectDefinition,\n {\n placeholder: 'Select an option',\n ...props,\n },\n );\n const { ownProps: popoverOwnProps } = useDefinition(PopoverDefinition, {});\n\n const {\n classes,\n label,\n description,\n options,\n icon,\n searchable,\n searchPlaceholder,\n isRequired,\n secondaryLabel,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaSelect\n className={classes.root}\n {...dataAttributes}\n ref={ref}\n {...restProps}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <SelectTrigger icon={icon} />\n <FieldError />\n <Popover\n className={clsx(popoverOwnProps.classes.root, classes.popover)}\n {...dataAttributes}\n >\n <SelectContent\n searchable={searchable}\n searchPlaceholder={searchPlaceholder}\n options={options}\n />\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TablePaginationOwnProps, PageSizeOption } from './types';\nimport styles from './TablePagination.module.css';\n\nconst DEFAULT_PAGE_SIZE_OPTIONS: PageSizeOption[] = [\n { label: 'Show 5 results', value: 5 },\n { label: 'Show 10 results', value: 10 },\n { label: 'Show 20 results', value: 20 },\n { label: 'Show 30 results', value: 30 },\n { label: 'Show 40 results', value: 40 },\n { label: 'Show 50 results', value: 50 },\n];\n\n/**\n * Component definition for TablePagination\n * @public\n */\nexport const TablePaginationDefinition =\n defineComponent<TablePaginationOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TablePagination',\n left: 'bui-TablePaginationLeft',\n right: 'bui-TablePaginationRight',\n select: 'bui-TablePaginationSelect',\n },\n propDefs: {\n pageSize: {},\n pageSizeOptions: { default: DEFAULT_PAGE_SIZE_OPTIONS },\n offset: {},\n totalCount: {},\n hasNextPage: {},\n hasPreviousPage: {},\n onNextPage: {},\n onPreviousPage: {},\n onPageSizeChange: {},\n showPageSizeOptions: { default: true },\n getLabel: {},\n showPaginationLabel: { default: true },\n },\n });\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-TablePagination\":\"Z_Iagacz0F1YYG04\",\"bui-TablePaginationLeft\":\"N_pRbW6lVsY4Hdgf\",\"bui-TablePaginationRight\":\"qXYnm03BkEcKl1FA\",\"bui-TablePaginationSelect\":\"plzZlLJyZhc3wn3s\"};","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useId } from 'react-aria';\nimport { Text } from '../Text';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Select } from '../Select';\nimport type { TablePaginationProps, PageSizeOption } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { TablePaginationDefinition } from './definition';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\nimport { useMemo } from 'react';\n\nfunction getOptionValue(option: number | PageSizeOption): number {\n return typeof option === 'number' ? option : option.value;\n}\n\nfunction isNumberArray(\n options: number[] | PageSizeOption[],\n): options is number[] {\n return options.length > 0 && typeof options[0] === 'number';\n}\n\nfunction normalizePageSizeOptions(\n options: number[] | PageSizeOption[],\n): PageSizeOption[] {\n if (isNumberArray(options)) {\n return options.map(value => ({\n label: `Show ${value} results`,\n value,\n }));\n }\n return options;\n}\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { ownProps } = useDefinition(TablePaginationDefinition, props);\n const {\n classes,\n pageSize,\n pageSizeOptions,\n offset,\n totalCount,\n hasNextPage,\n hasPreviousPage,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n } = ownProps;\n\n const labelId = useId();\n const normalizedOptions = useMemo(\n () => normalizePageSizeOptions(pageSizeOptions),\n [pageSizeOptions],\n );\n\n const effectivePageSize = useMemo(() => {\n const isValid = pageSizeOptions.some(\n opt => getOptionValue(opt) === pageSize,\n );\n if (isValid) {\n return pageSize;\n }\n const firstValue = getOptionValue(pageSizeOptions[0]);\n console.warn(\n `TablePagination: pageSize ${pageSize} is not in pageSizeOptions, using ${firstValue} instead`,\n );\n return firstValue;\n }, [pageSize, pageSizeOptions]);\n\n const hasItems = totalCount !== undefined && totalCount !== 0;\n\n const showLabel = hasItems && showPaginationLabel !== false;\n\n let label = `${totalCount} items`;\n if (getLabel) {\n label = getLabel({ pageSize: effectivePageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + effectivePageSize, totalCount ?? 0);\n label = `${fromCount} - ${toCount} of ${totalCount}`;\n }\n\n return (\n <div className={classes.root}>\n <div className={classes.left}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n aria-label=\"Select table page size\"\n options={normalizedOptions.map(opt => ({\n label: opt.label,\n value: String(opt.value),\n }))}\n defaultValue={effectivePageSize.toString()}\n onChange={value => {\n const newPageSize = Number(value);\n onPageSizeChange?.(newPageSize);\n }}\n className={classes.select}\n />\n )}\n </div>\n <div className={classes.right}>\n {showLabel && (\n <Text as=\"p\" variant=\"body-medium\" id={labelId}>\n {label}\n </Text>\n )}\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onPreviousPage}\n isDisabled={!hasPreviousPage}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onNextPage}\n isDisabled={!hasNextPage}\n icon={<RiArrowRightSLine />}\n aria-label=\"Next table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n </div>\n </div>\n );\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Skeleton\":\"dQdXlDCvsLk1w8Z3\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SkeletonProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SkeletonDefinition } from './definition';\n\n/**\n * A placeholder shape displayed while content is loading, matching the size and layout of the content it replaces.\n *\n * @public\n */\nexport const Skeleton = (props: SkeletonProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SkeletonDefinition,\n props,\n );\n const { classes, width, height, style } = ownProps;\n\n return (\n <div\n className={classes.root}\n {...dataAttributes}\n style={{\n width,\n height,\n ...style,\n }}\n {...restProps}\n />\n );\n};\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Cell } from './Cell';\nimport { Skeleton } from '../../Skeleton';\n\nconst SKELETON_ROW_COUNT = 5;\nconst SKELETON_WIDTHS = ['75%', '50%', '60%', '45%', '70%'];\n\nconst skeletonItems = Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => ({\n id: `skeleton-${i}`,\n index: i,\n}));\n\n/**\n * A table body that renders animated skeleton rows as a loading placeholder.\n *\n * @remarks\n * Accepts any column array whose items have an `id` property, making it\n * compatible with both `ColumnConfig` and custom column types.\n *\n * @public\n */\nexport function TableBodySkeleton<T extends { id: string }>({\n columns,\n}: {\n columns: readonly T[];\n}) {\n return (\n <TableBody items={skeletonItems} dependencies={[columns]}>\n {item => {\n const rowIndex = item.index;\n return (\n <Row id={item.id} columns={columns}>\n {column => (\n <Cell key={column.id} aria-hidden=\"true\">\n <Skeleton\n width={\n SKELETON_WIDTHS[\n (rowIndex + columns.indexOf(column)) %\n SKELETON_WIDTHS.length\n ]\n }\n />\n </Cell>\n )}\n </Row>\n );\n }}\n </TableBody>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useId } from 'react-aria';\nimport {\n type Key,\n ResizableTableContainer,\n Virtualizer,\n} from 'react-aria-components';\nimport { TableLayout } from 'react-stately';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableWrapperDefinition } from '../definition';\nimport { TableRoot } from './TableRoot';\nimport { TableHeader } from './TableHeader';\nimport { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Column } from './Column';\nimport { TablePagination } from '../../TablePagination';\nimport type {\n TableProps,\n TableItem,\n RowConfig,\n RowRenderFn,\n TablePaginationType,\n} from '../types';\nimport { useMemo } from 'react';\nimport { VisuallyHidden } from '../../VisuallyHidden';\nimport { Flex } from '../../Flex';\nimport { TableBodySkeleton } from './TableBodySkeleton';\n\nfunction isRowRenderFn<T extends TableItem>(\n rowConfig: RowConfig<T> | RowRenderFn<T> | undefined,\n): rowConfig is RowRenderFn<T> {\n return typeof rowConfig === 'function';\n}\n\nfunction useDisabledRows<T extends TableItem>({\n data,\n rowConfig,\n}: Pick<TableProps<T>, 'data' | 'rowConfig'>): Set<Key> | undefined {\n return useMemo(() => {\n if (!data || typeof rowConfig === 'function' || !rowConfig?.getIsDisabled) {\n return;\n }\n\n return data.reduce<Set<Key>>((set, item) => {\n const isDisabled = rowConfig.getIsDisabled?.(item);\n if (isDisabled) {\n set.add(String(item.id));\n }\n return set;\n }, new Set<Key>());\n }, [data, rowConfig]);\n}\n\nfunction useLiveRegionLabel(\n pagination: TablePaginationType,\n isStale: boolean,\n isLoading: boolean,\n hasData: boolean,\n): string {\n if (isLoading) {\n return 'Loading table data.';\n }\n\n if (!hasData || pagination.type === 'none') {\n return '';\n }\n\n const { pageSize, offset, totalCount, getLabel } = pagination;\n\n if (isStale) {\n return 'Loading table data.';\n }\n\n let liveRegionLabel = 'Table page loaded. ';\n\n if (getLabel) {\n liveRegionLabel += getLabel({ pageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + pageSize, totalCount ?? 0);\n liveRegionLabel += `Showing ${fromCount} to ${toCount} of ${totalCount}`;\n }\n return liveRegionLabel;\n}\n\n/**\n * A full-featured data table with built-in pagination, sorting, row selection, loading and error states, and optional virtualization.\n * Pair with `useTable` to manage data fetching and state, or pass `data`, `columnConfig`, and `pagination` directly for manual control.\n *\n * @public\n */\nexport function Table<T extends TableItem>({\n columnConfig,\n data,\n isPending = false,\n loading = false,\n isStale = false,\n error,\n pagination,\n sort,\n rowConfig,\n selection,\n emptyState,\n className,\n style,\n virtualized,\n}: TableProps<T>) {\n const pending = isPending || loading;\n const {\n ownProps: { classes },\n } = useDefinition(TableWrapperDefinition, { className });\n const liveRegionId = useId();\n\n const visibleColumns = useMemo(\n () => columnConfig.filter(col => !col.isHidden),\n [columnConfig],\n );\n const disabledRows = useDisabledRows({ data, rowConfig });\n\n const {\n mode: selectionMode,\n selected: selectedKeys,\n behavior: selectionBehavior,\n onSelectionChange,\n } = selection || {};\n\n const isInitialLoading = pending && !data;\n\n if (error) {\n return (\n <div className={classes.root} style={style}>\n Error: {error.message}\n </div>\n );\n }\n\n const liveRegionLabel = useLiveRegionLabel(\n pagination,\n isStale,\n isInitialLoading,\n data !== undefined,\n );\n\n const manualColumnSizing = columnConfig.some(\n col =>\n col.width != null ||\n col.minWidth != null ||\n col.maxWidth != null ||\n col.defaultWidth != null,\n );\n\n const wrapResizable = manualColumnSizing\n ? (elem: React.ReactNode) => (\n <ResizableTableContainer className={classes.resizableContainer}>\n {elem}\n </ResizableTableContainer>\n )\n : (elem: React.ReactNode) => <>{elem}</>;\n\n const layoutOptions =\n typeof virtualized === 'object' ? virtualized : undefined;\n\n const wrapVirtualized = (elem: React.ReactNode) =>\n virtualized ? (\n <Virtualizer layout={TableLayout} layoutOptions={layoutOptions}>\n {elem}\n </Virtualizer>\n ) : (\n elem\n );\n\n return (\n <div className={classes.root} style={style}>\n <VisuallyHidden aria-live=\"polite\" id={liveRegionId}>\n {liveRegionLabel}\n </VisuallyHidden>\n {wrapResizable(\n wrapVirtualized(\n <TableRoot\n {...(isInitialLoading\n ? {}\n : {\n selectionMode,\n selectionBehavior,\n selectedKeys,\n onSelectionChange,\n })}\n sortDescriptor={sort?.descriptor ?? undefined}\n onSortChange={sort?.onSortChange}\n disabledKeys={disabledRows}\n stale={isStale}\n isPending={isInitialLoading}\n aria-describedby={liveRegionId}\n >\n <TableHeader columns={visibleColumns}>\n {column =>\n column.header ? (\n column.header()\n ) : (\n <Column\n id={column.id}\n isRowHeader={column.isRowHeader}\n allowsSorting={column.isSortable}\n width={column.width}\n defaultWidth={column.defaultWidth}\n minWidth={column.minWidth}\n maxWidth={column.maxWidth}\n >\n {column.label}\n </Column>\n )\n }\n </TableHeader>\n {isInitialLoading ? (\n <TableBodySkeleton columns={visibleColumns} />\n ) : (\n <TableBody\n items={data}\n dependencies={[visibleColumns]}\n renderEmptyState={\n emptyState ? () => <Flex p=\"3\">{emptyState}</Flex> : undefined\n }\n >\n {item => {\n const itemIndex = data?.indexOf(item) ?? -1;\n\n if (isRowRenderFn(rowConfig)) {\n return rowConfig({\n item,\n index: itemIndex,\n });\n }\n\n return (\n <Row\n id={String(item.id)}\n columns={visibleColumns}\n href={rowConfig?.getHref?.(item)}\n onAction={\n rowConfig?.onClick\n ? () => rowConfig?.onClick?.(item)\n : undefined\n }\n >\n {column => column.cell(item)}\n </Row>\n );\n }}\n </TableBody>\n )}\n </TableRoot>,\n ),\n )}\n {pagination.type === 'page' && (\n <TablePagination\n pageSize={pagination.pageSize}\n pageSizeOptions={pagination.pageSizeOptions}\n offset={pagination.offset}\n totalCount={pagination.totalCount}\n hasNextPage={pagination.hasNextPage}\n hasPreviousPage={pagination.hasPreviousPage}\n onNextPage={pagination.onNextPage}\n onPreviousPage={pagination.onPreviousPage}\n onPageSizeChange={pagination.onPageSizeChange}\n showPageSizeOptions={pagination.showPageSizeOptions}\n getLabel={pagination.getLabel}\n showPaginationLabel={pagination.showPaginationLabel}\n />\n )}\n </div>\n );\n}\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-TableWrapper\":\"v8W8N2dqiE5cGNxm\",\"bui-TableResizableContainer\":\"Q3dVWKchqFEGDxNm\",\"bui-Table\":\"kHZPXvGYPYAGYFhf\",\"bui-TableHeader\":\"oifZQr6gC_QyhRzd\",\"bui-TableHead\":\"X8xcDL8E6rIYbeSR\",\"bui-TableHeadSelection\":\"ae9pE72Zc07f8L6W\",\"bui-TableHeadContent\":\"d_1Lwe7cMab7Y7x8\",\"bui-TableHeadLabel\":\"c2mE5YTadTwCB9Cv\",\"bui-TableHeadSortButton\":\"U0p16BfATSMI0pZa\",\"bui-TableBody\":\"RevIL7d7UeIjyBcV\",\"bui-TableRow\":\"kPJhRwYa5RAAhwxF\",\"bui-TableCell\":\"lBJ1evBwz18CSuEb\",\"bui-TableCellSelection\":\"waN8m81er3MmoNwQ\",\"bui-TableCellContentWrapper\":\"AQrmv2_3dWQm8mkC\",\"bui-TableCellIcon\":\"pZfxgqebmIQNGPFo\",\"bui-TableCellContent\":\"VL_PIHABTKklOpWr\",\"bui-TableCellProfile\":\"qco3EFeJwhQRop02\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n TableRootOwnProps,\n TableHeaderOwnProps,\n TableBodyOwnProps,\n RowOwnProps,\n ColumnOwnProps,\n CellOwnProps,\n CellTextOwnProps,\n CellProfileOwnProps,\n} from './types';\nimport styles from './Table.module.css';\n\n/** @internal */\nexport const TableWrapperDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-TableWrapper',\n resizableContainer: 'bui-TableResizableContainer',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for Table\n * @public\n */\nexport const TableDefinition = defineComponent<TableRootOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Table',\n },\n propDefs: {\n stale: { dataAttribute: true },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n },\n});\n\n/**\n * Component definition for TableHeader\n * @internal\n */\nexport const TableHeaderDefinition = defineComponent<TableHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHeader',\n headSelection: 'bui-TableHeadSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n },\n});\n\n/**\n * Component definition for TableBody\n * @internal\n */\nexport const TableBodyDefinition = defineComponent<TableBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableBody',\n },\n propDefs: {},\n});\n\n/**\n * Component definition for Row\n * @internal\n */\nexport const RowDefinition = defineComponent<RowOwnProps>()({\n styles,\n analytics: true,\n bg: 'consumer',\n classNames: {\n root: 'bui-TableRow',\n cell: 'bui-TableCell',\n cellSelection: 'bui-TableCellSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n href: {},\n noTrack: {},\n },\n});\n\n/**\n * Component definition for Column\n * @internal\n */\nexport const ColumnDefinition = defineComponent<ColumnOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHead',\n headContent: 'bui-TableHeadContent',\n headLabel: 'bui-TableHeadLabel',\n headSortButton: 'bui-TableHeadSortButton',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for Cell\n * @internal\n */\nexport const CellDefinition = defineComponent<CellOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for CellText\n * @internal\n */\nexport const CellTextDefinition = defineComponent<CellTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n },\n propDefs: {\n title: {},\n description: {},\n color: { default: 'primary' },\n leadingIcon: {},\n href: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CellProfile\n * @internal\n */\nexport const CellProfileDefinition = defineComponent<CellProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n },\n propDefs: {\n src: {},\n name: {},\n href: {},\n description: {},\n color: { default: 'primary' },\n className: {},\n },\n});\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMemo, useState, useCallback } from 'react';\nimport type { QueryOptions, QueryState } from './types';\n\nfunction useControlledStateHelper<T, TControlled = T, TInitial = TControlled>(\n initialValue: TInitial,\n controlledValue: TControlled | undefined,\n onChange: ((value: T) => void) | undefined,\n) {\n const [internalValue, setInternalValue] = useState<TInitial>(initialValue);\n\n const value = controlledValue !== undefined ? controlledValue : internalValue;\n\n const setValue = useCallback(\n (newValue: T) => {\n if (controlledValue === undefined) {\n setInternalValue(newValue as unknown as TInitial);\n }\n if (onChange) {\n onChange(newValue);\n }\n },\n [controlledValue, onChange],\n );\n\n return [value, setValue] as const;\n}\n\n/** @internal */\nexport function useQueryState<TFilter>(\n options: QueryOptions<TFilter>,\n): QueryState<TFilter> {\n const [sort, setSort] = useControlledStateHelper(\n options.initialSort ?? null,\n options.sort,\n options.onSortChange,\n );\n const [filter, setFilter] = useControlledStateHelper(\n options.initialFilter,\n options.filter,\n options.onFilterChange,\n );\n const [search, setSearch] = useControlledStateHelper(\n options.initialSearch ?? '',\n options.search,\n options.onSearchChange,\n );\n\n return useMemo(\n () => ({ sort, setSort, filter, setFilter, search, setSearch }),\n [sort, setSort, filter, setFilter, search, setSearch],\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useRef, useCallback } from 'react';\n\n/**\n * Returns a stable callback reference that always calls the latest version\n * of the provided function. Useful for callbacks passed as props that may\n * change on every render but shouldn't trigger effect re-runs.\n *\n * @internal\n */\nexport function useStableCallback<T extends (...args: any[]) => any>(fn: T): T {\n const ref = useRef(fn);\n ref.current = fn;\n\n return useCallback((...args: Parameters<T>) => ref.current(...args), []) as T;\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PageSizeOption } from '../../TablePagination/types';\nimport type { PaginationOptions } from './types';\n\nconst DEFAULT_PAGE_SIZE = 20;\n\nfunction getOptionValue(option: number | PageSizeOption): number {\n return typeof option === 'number' ? option : option.value;\n}\n\n/** @internal */\nexport function getEffectivePageSize(\n paginationOptions: PaginationOptions,\n): number {\n const { pageSize, pageSizeOptions } = paginationOptions;\n\n if (!pageSizeOptions) {\n return pageSize ?? DEFAULT_PAGE_SIZE;\n }\n\n const firstValue = getOptionValue(pageSizeOptions[0]);\n\n if (pageSize === undefined) {\n return firstValue;\n }\n\n const isValid = pageSizeOptions.some(opt => getOptionValue(opt) === pageSize);\n\n if (isValid) {\n return pageSize;\n }\n\n console.warn(\n `useTable: pageSize ${pageSize} is not in pageSizeOptions, using ${firstValue} instead`,\n );\n return firstValue;\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useCallback, useRef, useEffect } from 'react';\n\nconst FIRST_PAGE_CURSOR = Symbol('firstPage');\n\ntype CursorType = string | number;\n\ntype InternalCursor<TCursor extends CursorType> =\n | TCursor\n | typeof FIRST_PAGE_CURSOR;\n\ninterface PageEntry<T, TCursor extends CursorType> {\n data: T[] | undefined;\n nextCursor: InternalCursor<TCursor> | undefined;\n prevCursor: InternalCursor<TCursor> | undefined;\n}\n\ninterface GetDataResult<T, TCursor extends CursorType> {\n data: T[];\n nextCursor?: TCursor;\n prevCursor?: TCursor;\n totalCount?: number;\n}\n\n/** @internal */\nexport interface UsePageCacheOptions<T, TCursor extends CursorType = string> {\n getData: (params: {\n cursor: TCursor | undefined;\n signal: AbortSignal;\n }) => Promise<GetDataResult<T, TCursor>>;\n initialCurrentCursor?: TCursor;\n}\n\n/** @internal */\nexport interface UsePageCacheResult<T, TCursor extends CursorType = string> {\n isPending: boolean;\n error: Error | undefined;\n data: T[] | undefined;\n totalCount: number | undefined;\n currentCursor: TCursor | undefined;\n hasPreviousPage: boolean;\n onPreviousPage: () => void;\n hasNextPage: boolean;\n onNextPage: () => void;\n reload: (options?: { keepCurrentCursor?: boolean }) => void;\n}\n\ntype Direction = 'mount' | 'reset' | 'refresh' | 'next' | 'prev';\n\nclass PageCacheStore<T, TCursor extends CursorType> {\n private cache = new Map<InternalCursor<TCursor>, PageEntry<T, TCursor>>();\n\n get(cursor: InternalCursor<TCursor>): PageEntry<T, TCursor> | undefined {\n return this.cache.get(cursor);\n }\n\n getOrCreate(cursor: InternalCursor<TCursor>): PageEntry<T, TCursor> {\n const existing = this.cache.get(cursor);\n if (existing) {\n return existing;\n }\n const entry: PageEntry<T, TCursor> = {\n data: undefined,\n nextCursor: undefined,\n prevCursor: undefined,\n };\n this.cache.set(cursor, entry);\n return entry;\n }\n\n clear() {\n this.cache.clear();\n }\n\n getTargetCursor(\n direction: Direction,\n currentCursor: InternalCursor<TCursor>,\n initialCurrentCursor: TCursor | undefined,\n ): InternalCursor<TCursor> | undefined {\n if (direction === 'mount') {\n return toInternalCursor(initialCurrentCursor);\n }\n if (direction === 'reset') {\n return FIRST_PAGE_CURSOR;\n }\n if (direction === 'refresh') {\n return currentCursor;\n }\n const currentEntry = this.cache.get(currentCursor);\n\n if (!currentEntry) {\n return;\n }\n\n return direction === 'next'\n ? currentEntry.nextCursor\n : currentEntry.prevCursor;\n }\n\n linkEntryToSource(\n entry: PageEntry<T, TCursor>,\n direction: Direction,\n currentCursor: InternalCursor<TCursor>,\n ) {\n if (direction === 'next') {\n entry.prevCursor = currentCursor;\n } else if (direction === 'prev') {\n entry.nextCursor = currentCursor;\n }\n }\n}\n\nfunction toInternalCursor<TCursor extends CursorType>(\n cursor: TCursor | undefined,\n): InternalCursor<TCursor> {\n return cursor === undefined ? FIRST_PAGE_CURSOR : cursor;\n}\n\nfunction toExternalCursor<TCursor extends CursorType>(\n cursor: InternalCursor<TCursor>,\n): TCursor | undefined {\n return cursor === FIRST_PAGE_CURSOR ? undefined : cursor;\n}\n\n/** @internal */\nexport function usePageCache<T, TCursor extends CursorType = string>(\n options: UsePageCacheOptions<T, TCursor>,\n): UsePageCacheResult<T, TCursor> {\n const { getData, initialCurrentCursor } = options;\n\n const [currentCursor, setCurrentCursor] = useState<InternalCursor<TCursor>>(\n () => toInternalCursor(initialCurrentCursor),\n );\n\n const cacheStore = useRef(new PageCacheStore<T, TCursor>()).current;\n\n const [isPending, setIsPending] = useState(true);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [totalCount, setTotalCount] = useState<number | undefined>(undefined);\n\n const abortControllerRef = useRef<AbortController | null>(null);\n\n const currentPage = cacheStore.get(currentCursor);\n const data = currentPage?.data;\n const hasNextPage = currentPage?.nextCursor !== undefined;\n const hasPreviousPage = currentPage?.prevCursor !== undefined;\n\n const goToPage = useCallback(\n async (direction: Direction) => {\n const targetCursor = cacheStore.getTargetCursor(\n direction,\n currentCursor,\n initialCurrentCursor,\n );\n\n if (!targetCursor) {\n return;\n }\n\n const existingEntry = cacheStore.get(targetCursor);\n if (existingEntry?.data !== undefined) {\n setCurrentCursor(targetCursor);\n return;\n }\n\n const entry = cacheStore.getOrCreate(targetCursor);\n cacheStore.linkEntryToSource(entry, direction, currentCursor);\n setCurrentCursor(targetCursor);\n\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n\n setIsPending(true);\n setError(undefined);\n\n try {\n const result = await getData({\n cursor: toExternalCursor(targetCursor),\n signal: abortController.signal,\n });\n\n if (abortController.signal.aborted) {\n return;\n }\n\n entry.data = result.data;\n\n if (entry.nextCursor === undefined && result.nextCursor !== undefined) {\n entry.nextCursor = result.nextCursor;\n }\n if (entry.prevCursor === undefined && result.prevCursor !== undefined) {\n entry.prevCursor = result.prevCursor;\n }\n\n if (result.totalCount !== undefined) {\n setTotalCount(result.totalCount);\n }\n\n setIsPending(false);\n } catch (err) {\n if (abortController.signal.aborted) {\n return;\n }\n\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsPending(false);\n }\n },\n [getData, initialCurrentCursor, currentCursor, cacheStore],\n );\n\n useEffect(() => {\n goToPage('mount');\n\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n\n const onNextPage = useCallback(() => {\n if (isPending) return;\n const page = cacheStore.get(currentCursor);\n if (!page?.nextCursor) return;\n goToPage('next');\n }, [isPending, currentCursor, goToPage, cacheStore]);\n\n const onPreviousPage = useCallback(() => {\n if (isPending) return;\n const page = cacheStore.get(currentCursor);\n if (!page?.prevCursor) return;\n goToPage('prev');\n }, [isPending, currentCursor, goToPage, cacheStore]);\n\n const reload = useCallback(\n (reloadOptions?: { keepCurrentCursor?: boolean }) => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n cacheStore.clear();\n\n goToPage(reloadOptions?.keepCurrentCursor ? 'refresh' : 'reset');\n },\n [goToPage, cacheStore],\n );\n\n return {\n isPending,\n error,\n data,\n totalCount,\n currentCursor: toExternalCursor(currentCursor),\n hasPreviousPage,\n onPreviousPage,\n hasNextPage,\n onNextPage,\n reload,\n };\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useRef } from 'react';\nimport type { QueryState } from './types';\n\n/**\n * Triggers a debounced reload when query or pageSize changes.\n * Debouncing reduces backend load during rapid changes (e.g., typing in search).\n */\n/** @internal */\nexport function useDebouncedReload<TFilter>(\n query: QueryState<TFilter>,\n pageSize: number,\n reload: () => void,\n delay: number = 200,\n): void {\n const prevDepsRef = useRef({ query, pageSize });\n\n useEffect(() => {\n const prev = prevDepsRef.current;\n if (prev.query !== query || prev.pageSize !== pageSize) {\n prevDepsRef.current = { query, pageSize };\n const timer = setTimeout(reload, delay);\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [query, pageSize, reload, delay]);\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useMemo, useRef } from 'react';\nimport type { SortState, TableItem, TableProps } from '../types';\nimport type {\n PaginationResult,\n UseTableCompleteOptions,\n UseTableCursorOptions,\n UseTableOffsetOptions,\n UseTableOptions,\n UseTableResult,\n} from './types';\nimport { useQueryState } from './useQueryState';\nimport { useCompletePagination } from './useCompletePagination';\nimport { useCursorPagination } from './useCursorPagination';\nimport { useOffsetPagination } from './useOffsetPagination';\n\nfunction useTableProps<T extends TableItem>(\n paginationResult: PaginationResult<T>,\n sortState: SortState,\n paginationOptions: UseTableCompleteOptions<T>['paginationOptions'] = {},\n): Omit<\n TableProps<T>,\n 'columnConfig' | 'rowConfig' | 'selection' | 'emptyState'\n> {\n const {\n showPageSizeOptions = true,\n pageSizeOptions,\n onPageSizeChange: onPageSizeChangeCallback,\n onNextPage: onNextPageCallback,\n onPreviousPage: onPreviousPageCallback,\n getLabel,\n showPaginationLabel,\n } = paginationOptions;\n\n const previousDataRef = useRef(paginationResult.data);\n if (paginationResult.data) {\n previousDataRef.current = paginationResult.data;\n }\n\n const displayData = paginationResult.data ?? previousDataRef.current;\n const isStale = paginationResult.isPending && displayData !== undefined;\n\n const pagination = useMemo(() => {\n if (paginationOptions.type === 'none') {\n return { type: 'none' as const };\n }\n return {\n type: 'page' as const,\n pageSize: paginationResult.pageSize,\n pageSizeOptions,\n offset: paginationResult.offset,\n totalCount: paginationResult.totalCount,\n hasNextPage: paginationResult.hasNextPage,\n hasPreviousPage: paginationResult.hasPreviousPage,\n onNextPage: () => {\n paginationResult.onNextPage();\n onNextPageCallback?.();\n },\n onPreviousPage: () => {\n paginationResult.onPreviousPage();\n onPreviousPageCallback?.();\n },\n onPageSizeChange: (size: number) => {\n paginationResult.onPageSizeChange(size);\n onPageSizeChangeCallback?.(size);\n },\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n };\n }, [\n paginationOptions.type,\n paginationResult.pageSize,\n pageSizeOptions,\n paginationResult.offset,\n paginationResult.totalCount,\n paginationResult.hasNextPage,\n paginationResult.hasPreviousPage,\n paginationResult.onNextPage,\n paginationResult.onPreviousPage,\n paginationResult.onPageSizeChange,\n onNextPageCallback,\n onPreviousPageCallback,\n onPageSizeChangeCallback,\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n ]);\n\n return useMemo(\n () => ({\n data: displayData,\n isPending: paginationResult.isPending,\n loading: paginationResult.isPending,\n isStale,\n error: paginationResult.error,\n pagination,\n sort: sortState,\n }),\n [\n displayData,\n paginationResult.isPending,\n isStale,\n paginationResult.error,\n pagination,\n sortState,\n ],\n );\n}\n\n/**\n * A hook that manages table data fetching, pagination, sorting, search, and filtering.\n * Supports three modes: `complete` for client-side data, `offset` for server-side offset pagination, and `cursor` for server-side cursor pagination.\n *\n * @public\n */\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableCompleteOptions<T, TFilter>,\n): UseTableResult<T, TFilter>;\n/** @public */\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableOffsetOptions<T, TFilter>,\n): UseTableResult<T, TFilter>;\n/** @public */\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableCursorOptions<T, TFilter>,\n): UseTableResult<T, TFilter>;\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableOptions<T, TFilter>,\n): UseTableResult<T, TFilter> {\n const query = useQueryState<TFilter>(options);\n\n const initialModeRef = useRef(options.mode);\n if (initialModeRef.current !== options.mode) {\n throw new Error(\n `useTable mode cannot change from '${initialModeRef.current}' to '${options.mode}'. ` +\n `The mode must remain stable for the lifetime of the component.`,\n );\n }\n\n let pagination: PaginationResult<T> & { reload: () => void };\n\n if (options.mode === 'complete') {\n pagination = useCompletePagination(options, query);\n } else if (options.mode === 'offset') {\n pagination = useOffsetPagination(options, query);\n } else if (options.mode === 'cursor') {\n pagination = useCursorPagination(options, query);\n } else {\n throw new Error('Invalid mode');\n }\n\n const sortState: SortState = useMemo(\n () => ({ descriptor: query.sort, onSortChange: query.setSort }),\n [query.sort, query.setSort],\n );\n\n const tableProps = useTableProps(\n pagination,\n sortState,\n options.paginationOptions ?? {},\n );\n\n return {\n tableProps,\n reload: pagination.reload,\n filter: { value: query.filter, onChange: query.setFilter },\n search: { value: query.search, onChange: query.setSearch },\n };\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useCallback, useMemo, useEffect, useRef } from 'react';\nimport type { TableItem } from '../types';\nimport type {\n PaginationResult,\n QueryState,\n UseTableCompleteOptions,\n} from './types';\nimport { useStableCallback } from './useStableCallback';\nimport { getEffectivePageSize } from './getEffectivePageSize';\n\n/** @internal */\nexport function useCompletePagination<T extends TableItem, TFilter>(\n options: UseTableCompleteOptions<T, TFilter>,\n query: QueryState<TFilter>,\n): PaginationResult<T> & { reload: () => void } {\n const {\n data,\n getData: getDataProp = () => [],\n paginationOptions = {},\n sortFn,\n filterFn,\n searchFn,\n } = options;\n const hasGetData = 'getData' in options;\n const noPagination = paginationOptions.type === 'none';\n const { initialOffset = 0 } = paginationOptions;\n const defaultPageSize = noPagination\n ? Infinity\n : getEffectivePageSize(paginationOptions);\n\n const getData = useStableCallback(getDataProp);\n const { sort, filter, search } = query;\n\n const [items, setItems] = useState<T[] | undefined>(undefined);\n const [isPending, setIsPending] = useState(!data);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [loadCount, setLoadCount] = useState(0);\n\n const [offset, setOffset] = useState(initialOffset);\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n // Sync pageSize when the caller changes paginationOptions.pageSize\n useEffect(() => {\n setPageSize(defaultPageSize);\n setOffset(0);\n }, [defaultPageSize]);\n\n // Load data on mount and when loadCount changes (reload trigger)\n useEffect(() => {\n if (data) {\n setIsPending(false);\n return;\n }\n\n if (!hasGetData) {\n return;\n }\n\n let cancelled = false;\n setIsPending(true);\n setError(undefined);\n\n (async () => {\n try {\n const result = getData();\n const resolvedData = result instanceof Promise ? await result : result;\n if (!cancelled) {\n setItems(resolvedData);\n setIsPending(false);\n }\n } catch (err) {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsPending(false);\n }\n }\n })();\n\n return () => {\n cancelled = true;\n };\n }, [data, getData, hasGetData, loadCount]);\n\n // Reset offset when query changes (query object is memoized)\n const prevQueryRef = useRef(query);\n useEffect(() => {\n if (prevQueryRef.current !== query) {\n prevQueryRef.current = query;\n setOffset(0);\n }\n }, [query]);\n\n const resolvedItems = useMemo(() => data ?? items, [data, items]);\n\n // Process data client-side (filter, search, sort)\n const processedData = useMemo(() => {\n if (!resolvedItems) {\n return undefined;\n }\n let result = [...resolvedItems];\n if (filter !== undefined && filterFn) {\n result = filterFn(result, filter);\n }\n if (search && searchFn) {\n result = searchFn(result, search);\n }\n if (sort && sortFn) {\n result = sortFn(result, sort);\n }\n return result;\n }, [resolvedItems, sort, filter, search, filterFn, searchFn, sortFn]);\n\n const totalCount = processedData?.length ?? 0;\n\n // Paginate the processed data\n const paginatedData = useMemo(\n () =>\n noPagination\n ? processedData\n : processedData?.slice(offset, offset + pageSize),\n [processedData, offset, pageSize, noPagination],\n );\n\n const hasNextPage = !noPagination && offset + pageSize < totalCount;\n const hasPreviousPage = !noPagination && offset > 0;\n\n const onNextPage = useCallback(() => {\n if (offset + pageSize < totalCount) {\n setOffset(offset + pageSize);\n }\n }, [offset, pageSize, totalCount]);\n\n const onPreviousPage = useCallback(() => {\n if (offset > 0) {\n setOffset(Math.max(0, offset - pageSize));\n }\n }, [offset, pageSize]);\n\n const onPageSizeChange = useCallback((newSize: number) => {\n setPageSize(newSize);\n setOffset(0);\n }, []);\n\n const reload = useCallback(() => {\n setOffset(0);\n setLoadCount(c => c + 1);\n }, []);\n\n return {\n data: paginatedData,\n isPending: isPending,\n error,\n totalCount,\n offset,\n pageSize,\n hasNextPage,\n hasPreviousPage,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n reload,\n };\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useCallback } from 'react';\nimport type { TableItem } from '../types';\nimport type {\n UseTableOffsetOptions,\n OffsetParams,\n QueryState,\n PaginationResult,\n} from './types';\nimport { usePageCache } from './usePageCache';\nimport { useStableCallback } from './useStableCallback';\nimport { useDebouncedReload } from './useDebouncedReload';\nimport { getEffectivePageSize } from './getEffectivePageSize';\n\nexport function useOffsetPagination<T extends TableItem, TFilter>(\n options: UseTableOffsetOptions<T, TFilter>,\n query: QueryState<TFilter>,\n): PaginationResult<T> & { reload: () => void } {\n const { getData: getDataProp, paginationOptions = {} } = options;\n const { initialOffset = 0 } = paginationOptions;\n const defaultPageSize = getEffectivePageSize(paginationOptions);\n\n const getData = useStableCallback(getDataProp);\n const { sort, filter, search } = query;\n\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n const wrappedGetData = useCallback(\n async ({\n cursor,\n signal,\n }: {\n cursor: number | undefined;\n signal: AbortSignal;\n }) => {\n const currentOffset = cursor ?? 0;\n\n const params: OffsetParams<TFilter> = {\n offset: currentOffset,\n pageSize,\n sort,\n filter,\n search,\n signal,\n };\n\n const response = await getData(params);\n\n const prevCursor =\n currentOffset > 0 ? Math.max(0, currentOffset - pageSize) : undefined;\n const nextCursor =\n currentOffset + pageSize < response.totalCount\n ? currentOffset + pageSize\n : undefined;\n\n return {\n data: response.data,\n prevCursor,\n nextCursor,\n totalCount: response.totalCount,\n };\n },\n [getData, pageSize, sort, filter, search],\n );\n\n const cache = usePageCache<T, number>({\n getData: wrappedGetData,\n initialCurrentCursor: initialOffset > 0 ? initialOffset : undefined,\n });\n\n useDebouncedReload(query, pageSize, cache.reload);\n\n const onPageSizeChange = useCallback(\n (newSize: number) => setPageSize(newSize),\n [],\n );\n\n return {\n data: cache.data,\n isPending: cache.isPending,\n error: cache.error,\n totalCount: cache.totalCount,\n offset: cache.currentCursor ?? 0,\n pageSize,\n hasNextPage: cache.hasNextPage,\n hasPreviousPage: cache.hasPreviousPage,\n onNextPage: cache.onNextPage,\n onPreviousPage: cache.onPreviousPage,\n onPageSizeChange,\n reload: cache.reload,\n };\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useCallback } from 'react';\nimport type { TableItem } from '../types';\nimport type {\n UseTableCursorOptions,\n CursorParams,\n QueryState,\n PaginationResult,\n} from './types';\nimport { usePageCache } from './usePageCache';\nimport { useStableCallback } from './useStableCallback';\nimport { useDebouncedReload } from './useDebouncedReload';\nimport { getEffectivePageSize } from './getEffectivePageSize';\n\nexport function useCursorPagination<T extends TableItem, TFilter>(\n options: UseTableCursorOptions<T, TFilter>,\n query: QueryState<TFilter>,\n): PaginationResult<T> & { reload: () => void } {\n const { getData: getDataProp, paginationOptions = {} } = options;\n const defaultPageSize = getEffectivePageSize(paginationOptions);\n\n const getData = useStableCallback(getDataProp);\n const { sort, filter, search } = query;\n\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n const wrappedGetData = useCallback(\n async ({\n cursor,\n signal,\n }: {\n cursor: string | undefined;\n signal: AbortSignal;\n }) => {\n const params: CursorParams<TFilter> = {\n cursor,\n pageSize,\n sort,\n filter,\n search,\n signal,\n };\n\n const response = await getData(params);\n\n return {\n data: response.data,\n prevCursor: response.prevCursor,\n nextCursor: response.nextCursor,\n totalCount: response.totalCount,\n };\n },\n [getData, pageSize, sort, filter, search],\n );\n\n const cache = usePageCache<T, string>({ getData: wrappedGetData });\n\n useDebouncedReload(query, pageSize, cache.reload);\n\n const onPageSizeChange = useCallback(\n (newSize: number) => setPageSize(newSize),\n [],\n );\n\n return {\n data: cache.data,\n isPending: cache.isPending,\n error: cache.error,\n totalCount: cache.totalCount,\n offset: undefined,\n pageSize,\n hasNextPage: cache.hasNextPage,\n hasPreviousPage: cache.hasPreviousPage,\n onNextPage: cache.onNextPage,\n onPreviousPage: cache.onPreviousPage,\n onPageSizeChange,\n reload: cache.reload,\n };\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n EntityPresentationApi,\n EntityRefPresentationSnapshot,\n} from './EntityPresentationApi';\nimport { defaultEntityPresentation } from './defaultEntityPresentation';\n\n/**\n * Returns a synchronous presentation snapshot for an entity in non-React\n * contexts.\n *\n * @remarks\n *\n * This is the synchronous, non-React counterpart to\n * {@link useEntityPresentation}. It handles `Entity`, `CompoundEntityRef`,\n * and string ref inputs uniformly, using the provided\n * {@link EntityPresentationApi} when available and falling back to\n * {@link defaultEntityPresentation} otherwise.\n *\n * Because this function is synchronous, it uses cached data from the\n * presentation API (via `.snapshot`). If the entity has been seen before,\n * the snapshot will contain the full resolved title; otherwise it falls\n * back to what can be extracted from the ref alone. This is the correct\n * trade-off for sort comparators, column factories, filter callbacks, and\n * data mappers where a synchronous return value is required.\n *\n * In async contexts such as data loaders where you can `await`, prefer\n * using the {@link EntityPresentationApi} directly via\n * `forEntity().promise` for the richest possible presentation.\n *\n * @public\n * @param entityOrRef - An entity, a compound entity ref, or a string entity ref.\n * @param context - Optional context that may affect the presentation.\n * @param entityPresentationApi - Optional presentation API instance. When not\n * provided, falls back to {@link defaultEntityPresentation}.\n */\nexport function entityPresentationSnapshot(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: { defaultKind?: string; defaultNamespace?: string },\n entityPresentationApi?: EntityPresentationApi,\n): EntityRefPresentationSnapshot {\n if (entityPresentationApi) {\n const ref =\n typeof entityOrRef === 'string' || 'metadata' in entityOrRef\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n return entityPresentationApi.forEntity(ref, context).snapshot;\n }\n return defaultEntityPresentation(entityOrRef, context);\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { Cell, CellText, Column, ColumnConfig, TableItem } from '@backstage/ui';\nimport { EntityRefLink, EntityRefLinks } from '../EntityRefLink';\nimport {\n entityPresentationSnapshot,\n EntityPresentationApi,\n} from '@backstage/plugin-catalog-react';\nimport { EntityTableColumnTitle } from '../EntityTable/TitleColumn';\nimport { getEntityRelations } from '../../utils';\n\n/** @public */\nexport type EntityRow = Entity & TableItem;\n\n/** @public */\nexport interface EntityColumnConfig extends ColumnConfig<EntityRow> {\n sortValue?: (entity: EntityRow) => string;\n}\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn(options: {\n defaultKind?: string;\n isRowHeader?: boolean;\n entityPresentationApi?: EntityPresentationApi;\n }): EntityColumnConfig {\n const isRowHeader = options.isRowHeader ?? true;\n return {\n id: 'name',\n label: 'Name',\n header: () => (\n <Column id=\"name\" isRowHeader={isRowHeader} allowsSorting>\n <EntityTableColumnTitle translationKey=\"name\" />\n </Column>\n ),\n isRowHeader,\n isSortable: true,\n cell: entity => (\n <Cell>\n <EntityRefLink\n entityRef={entity}\n defaultKind={options.defaultKind}\n title={entity.metadata?.title}\n />\n </Cell>\n ),\n sortValue: entity =>\n entityPresentationSnapshot(\n entity,\n { defaultKind: options.defaultKind },\n options.entityPresentationApi,\n ).primaryTitle,\n };\n },\n\n createEntityRelationColumn(options: {\n id: string;\n translationKey: 'owner' | 'system' | 'domain';\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n entityPresentationApi?: EntityPresentationApi;\n }): EntityColumnConfig {\n return {\n id: options.id,\n label: options.id.charAt(0).toUpperCase() + options.id.slice(1),\n header: () => (\n <Column id={options.id} allowsSorting>\n <EntityTableColumnTitle translationKey={options.translationKey} />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <Cell>\n <EntityRefLinks\n entityRefs={getEntityRelations(\n entity,\n options.relation,\n options.filter,\n )}\n defaultKind={options.defaultKind}\n />\n </Cell>\n ),\n sortValue: entity =>\n getEntityRelations(entity, options.relation, options.filter)\n .map(\n r =>\n entityPresentationSnapshot(\n r,\n { defaultKind: options.defaultKind },\n options.entityPresentationApi,\n ).primaryTitle,\n )\n .join(', '),\n };\n },\n\n createOwnerColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'owner',\n translationKey: 'owner',\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n\n createSystemColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'system',\n translationKey: 'system',\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: { kind: 'system' },\n });\n },\n\n createDomainColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'domain',\n translationKey: 'domain',\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: { kind: 'domain' },\n });\n },\n\n createMetadataDescriptionColumn(): EntityColumnConfig {\n return {\n id: 'description',\n label: 'Description',\n header: () => (\n <Column id=\"description\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"description\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => <CellText title={entity.metadata.description ?? ''} />,\n sortValue: entity => entity.metadata.description ?? '',\n };\n },\n\n createSpecTypeColumn(): EntityColumnConfig {\n return {\n id: 'type',\n label: 'Type',\n header: () => (\n <Column id=\"type\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"type\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <CellText\n title={\n (entity.spec as Record<string, string> | undefined)?.type ?? ''\n }\n />\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.type ?? '',\n };\n },\n\n createSpecLifecycleColumn(): EntityColumnConfig {\n return {\n id: 'lifecycle',\n label: 'Lifecycle',\n header: () => (\n <Column id=\"lifecycle\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"lifecycle\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <CellText\n title={\n (entity.spec as Record<string, string> | undefined)?.lifecycle ?? ''\n }\n />\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.lifecycle ?? '',\n };\n },\n});\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { columnFactories, EntityColumnConfig } from './columnFactories';\n\n/** @alpha */\nexport const entityColumnPresets = {\n component: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component',\n },\n resource: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'resource' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource',\n },\n system: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system',\n },\n domain: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'domain' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain',\n },\n} as const;\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { Table, useTable } from '@backstage/ui';\nimport { useCallback, useMemo, ReactNode } from 'react';\nimport { EntityRow, EntityColumnConfig } from './columnFactories';\nimport { SortDescriptor } from '@backstage/ui';\n\n/** @public */\nexport interface EntityDataTableProps {\n columnConfig: EntityColumnConfig[];\n data: Entity[];\n loading?: boolean;\n error?: Error;\n emptyState?: ReactNode;\n}\n\n/** @public */\nexport function EntityDataTable(props: EntityDataTableProps) {\n const { columnConfig, data, loading, error, emptyState } = props;\n\n const tableData: EntityRow[] = useMemo(\n () =>\n data.map(entity => ({\n ...entity,\n id: stringifyEntityRef(entity),\n })),\n [data],\n );\n\n const sortFn = useCallback(\n (items: EntityRow[], sort: SortDescriptor) => {\n const column = columnConfig.find(c => c.id === sort.column);\n if (!column?.sortValue) {\n return items;\n }\n const getValue = column.sortValue;\n const direction = sort.direction === 'descending' ? -1 : 1;\n return [...items].sort(\n (a, b) => getValue(a).localeCompare(getValue(b)) * direction,\n );\n },\n [columnConfig],\n );\n\n const { tableProps } = useTable({\n mode: 'complete',\n data: tableData,\n sortFn,\n paginationOptions: { type: 'none' },\n });\n\n return (\n <Table\n columnConfig={columnConfig}\n {...tableProps}\n loading={loading}\n error={error}\n emptyState={emptyState}\n />\n );\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Alert, Link, Text } from '@backstage/ui';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { EntityInfoCard } from '../EntityInfoCard';\nimport { EntityDataTable } from '../EntityDataTable';\nimport { EntityColumnConfig } from '../EntityDataTable/columnFactories';\nimport { useEntity, useRelatedEntities } from '../../hooks';\nimport { catalogReactTranslationRef } from '../../translation';\n\n/** @public */\nexport interface EntityRelationCardProps {\n title: string;\n relationType: string;\n entityKind?: string;\n columnConfig: EntityColumnConfig[];\n emptyState?: {\n message: string;\n helpLink?: string;\n };\n className?: string;\n}\n\n/** @public */\nexport function EntityRelationCard(props: EntityRelationCardProps) {\n const {\n title,\n relationType,\n entityKind,\n columnConfig,\n emptyState,\n className,\n } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n return (\n <EntityInfoCard title={title} className={className}>\n {error ? (\n <Alert status=\"warning\" icon title={error.message} role=\"status\" />\n ) : (\n <EntityDataTable\n columnConfig={columnConfig}\n data={entities ?? []}\n loading={loading}\n emptyState={\n emptyState && (\n <Text as=\"p\">\n {emptyState.message}{' '}\n {emptyState.helpLink && (\n <Link\n href={emptyState.helpLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"body-medium\"\n >\n {t('entityRelationCard.emptyHelpLinkTitle')}\n </Link>\n )}\n </Text>\n )\n }\n />\n )}\n </EntityInfoCard>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n CompoundEntityRef,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { getEntityRelations } from '../../utils';\nimport { EntityRefLink, EntityRefLinks } from '../EntityRefLink';\nimport { entityPresentationSnapshot, EntityPresentationApi } from '../../apis';\nimport { EntityTableColumnTitle } from './TitleColumn';\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn<T extends Entity>(options: {\n defaultKind?: string;\n entityPresentationApi?: EntityPresentationApi;\n }): TableColumn<T> {\n const { defaultKind, entityPresentationApi } = options;\n function formatContent(entity: T): string {\n return entityPresentationSnapshot(\n entity,\n { defaultKind },\n entityPresentationApi,\n ).primaryTitle;\n }\n\n return {\n title: <EntityTableColumnTitle translationKey=\"name\" />,\n highlight: true,\n customFilterAndSearch(filter, entity) {\n // TODO: We could implement this more efficiently, like searching over\n // each field that is displayed individually (kind, namespace, name).\n // but that might confuse the user as it will behave different than a\n // simple text search.\n // Another alternative would be to cache the values. But writing them\n // into the entity feels bad too.\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={defaultKind}\n title={entity.metadata?.title}\n />\n ),\n };\n },\n createEntityRelationColumn<T extends Entity>(options: {\n title: string | JSX.Element;\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n entityPresentationApi?: EntityPresentationApi;\n }): TableColumn<T> {\n const {\n title,\n relation,\n defaultKind,\n filter: entityFilter,\n entityPresentationApi,\n } = options;\n\n function getRelations(entity: T): CompoundEntityRef[] {\n return getEntityRelations(entity, relation, entityFilter);\n }\n\n function formatContent(entity: T): string {\n return getRelations(entity)\n .map(\n r =>\n entityPresentationSnapshot(\n r,\n { defaultKind },\n entityPresentationApi,\n ).primaryTitle,\n )\n .join(', ');\n }\n\n return {\n title,\n customFilterAndSearch(filter, entity) {\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => {\n return (\n <EntityRefLinks\n entityRefs={getRelations(entity)}\n defaultKind={defaultKind}\n />\n );\n },\n };\n },\n createOwnerColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"owner\" />,\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n createDomainColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"domain\" />,\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: {\n kind: 'domain',\n },\n });\n },\n createSystemColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"system\" />,\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: {\n kind: 'system',\n },\n });\n },\n createMetadataDescriptionColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"description\" />,\n field: 'metadata.description',\n render: entity => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n line={2}\n />\n ),\n };\n },\n createSpecLifecycleColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"lifecycle\" />,\n field: 'spec.lifecycle',\n };\n },\n createSpecTypeColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"type\" />,\n field: 'spec.type',\n };\n },\n});\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentEntity, SystemEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createDomainColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CSSProperties, ReactNode } from 'react';\nimport { columnFactories } from './columns';\nimport { componentEntityColumns, systemEntityColumns } from './presets';\nimport {\n InfoCardVariants,\n Table,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTable}.\n *\n * @public\n */\nexport interface EntityTableProps<T extends Entity> {\n title: string;\n variant?: InfoCardVariants;\n entities: T[];\n emptyContent?: ReactNode;\n columns: TableColumn<T>[];\n tableOptions?: TableOptions;\n}\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\n/**\n * A general entity table component, that can be used for composing more\n * specific entity tables.\n *\n * @public\n */\nexport const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {\n const {\n entities,\n title,\n emptyContent,\n variant = 'gridItem',\n columns,\n tableOptions = {},\n } = props;\n\n const classes = useStyles();\n const tableStyle: CSSProperties = {\n minWidth: '0',\n width: '100%',\n };\n\n if (variant === 'gridItem') {\n tableStyle.height = 'calc(100% - 10px)';\n }\n\n return (\n <Table<T>\n columns={columns}\n title={title}\n style={tableStyle}\n emptyContent={\n emptyContent && <div className={classes.empty}>{emptyContent}</div>\n }\n options={{\n // TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;\n search: false,\n paging: false,\n actionsColumnIndex: -1,\n padding: 'dense',\n draggable: false,\n ...tableOptions,\n }}\n data={entities}\n />\n );\n};\n\nEntityTable.columns = columnFactories;\n\nEntityTable.systemEntityColumns = systemEntityColumns;\n\nEntityTable.componentEntityColumns = componentEntityColumns;\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogReactTranslationRef } from '../../translation';\n\n/**\n * @alpha\n */\nexport type EntityTableColumnTitleProps = {\n translationKey:\n | 'name'\n | 'system'\n | 'owner'\n | 'type'\n | 'lifecycle'\n | 'namespace'\n | 'description'\n | 'tags'\n | 'targets'\n | 'title'\n | 'label'\n | 'domain';\n};\n\n/**\n * @alpha\n */\nexport const EntityTableColumnTitle = ({\n translationKey,\n}: EntityTableColumnTitleProps) => {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return t(`entityTableColumnTitle.${translationKey}`);\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, parseEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../api';\n\n/**\n * Fetches all entities that appear in the entity's relations, optionally\n * filtered by relation type and kind.\n *\n * @public\n */\nexport function useRelatedEntities(\n entity: Entity,\n relationFilter: { type?: string; kind?: string },\n): {\n entities: Entity[] | undefined;\n loading: boolean;\n error: Error | undefined;\n} {\n const filterByTypeLower = relationFilter?.type?.toLocaleLowerCase('en-US');\n const filterByKindLower = relationFilter?.kind?.toLocaleLowerCase('en-US');\n const catalogApi = useApi(catalogApiRef);\n\n const {\n loading,\n value: entities,\n error,\n } = useAsync(async () => {\n const relations = entity.relations?.filter(\n r =>\n (!filterByTypeLower ||\n r.type.toLocaleLowerCase('en-US') === filterByTypeLower) &&\n (!filterByKindLower ||\n parseEntityRef(r.targetRef).kind === filterByKindLower),\n );\n\n if (!relations?.length) {\n return [];\n }\n\n const { items } = await catalogApi.getEntitiesByRefs({\n entityRefs: relations.map(r => r.targetRef),\n });\n\n return items.filter((x): x is Entity => Boolean(x));\n }, [entity, filterByTypeLower, filterByKindLower]);\n\n return {\n entities,\n loading,\n error,\n };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RELATION_DEPENDS_ON, ResourceEntity } from '@backstage/catalog-model';\nimport {\n InfoCardVariants,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n entityColumnPresets,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n asResourceEntities,\n componentEntityHelpLink as legacyHelpLink,\n resourceEntityColumns,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport interface DependsOnResourcesCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link DependsOnResourcesCardProps} instead.\n * @public\n */\nexport interface DependsOnResourcesCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ResourceEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: DependsOnResourcesCardProps | DependsOnResourcesCardLegacyProps,\n): props is DependsOnResourcesCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nexport function DependsOnResourcesCard(\n props: DependsOnResourcesCardProps | DependsOnResourcesCardLegacyProps,\n) {\n const { t } = useTranslationRef(catalogTranslationRef);\n\n if (isLegacyProps(props)) {\n const {\n variant = 'gridItem',\n title = t('dependsOnResourcesCard.title'),\n columns = resourceEntityColumns,\n tableOptions = {},\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_DEPENDS_ON}\n columns={columns}\n emptyMessage={t('dependsOnResourcesCard.emptyMessage')}\n emptyHelpLink={legacyHelpLink}\n asRenderableEntities={asResourceEntities}\n tableOptions={tableOptions}\n />\n );\n }\n\n const {\n title = t('dependsOnResourcesCard.title'),\n columnConfig = entityColumnPresets.resource.columns,\n } = props;\n return (\n <EntityRelationCard\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_DEPENDS_ON}\n columnConfig={columnConfig}\n emptyState={{\n message: t('dependsOnResourcesCard.emptyMessage'),\n helpLink: entityColumnPresets.component.helpLink,\n }}\n />\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport {\n asComponentEntities,\n asDomainEntities,\n asResourceEntities,\n asSystemEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n domainEntityColumns,\n domainEntityHelpLink,\n resourceEntityColumns,\n resourceEntityHelpLink,\n systemEntityColumns,\n systemEntityHelpLink,\n} from './presets';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @deprecated Use {@link @backstage/plugin-catalog-react/alpha#EntityRelationCard} instead.\n * @public\n */\nexport const RelatedEntitiesCard = <T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) => {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink} externalLinkIcon>\n {t('relatedEntitiesCard.emptyHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\n />\n );\n};\n\nRelatedEntitiesCard.componentEntityColumns = componentEntityColumns;\nRelatedEntitiesCard.componentEntityHelpLink = componentEntityHelpLink;\nRelatedEntitiesCard.asComponentEntities = asComponentEntities;\nRelatedEntitiesCard.resourceEntityColumns = resourceEntityColumns;\nRelatedEntitiesCard.resourceEntityHelpLink = resourceEntityHelpLink;\nRelatedEntitiesCard.asResourceEntities = asResourceEntities;\nRelatedEntitiesCard.systemEntityColumns = systemEntityColumns;\nRelatedEntitiesCard.systemEntityHelpLink = systemEntityHelpLink;\nRelatedEntitiesCard.asSystemEntities = asSystemEntities;\nRelatedEntitiesCard.domainEntityColums = domainEntityColumns;\nRelatedEntitiesCard.domainEntityHelpLink = domainEntityHelpLink;\nRelatedEntitiesCard.asDomainEntities = asDomainEntities;\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ComponentEntity,\n DomainEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n\nexport const domainEntityColumns: TableColumn<DomainEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'domain' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const domainEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain';\nexport const asDomainEntities = (entities: Entity[]): DomainEntity[] =>\n entities as DomainEntity[];\n"],"names":["useStyles","makeStyles","line","OverflowTooltip","props","classes","Tooltip","Typography","theme","createStyles","SvgIcon","BootstrapInput","withStyles","InputBase","SelectComponent","multiple","items","label","placeholder","selected","onChange","triggerReset","native","disabled","margin","dataTestId","value","setValue","useState","isOpen","setOpen","useEffect","Box","FormControl","InputLabel","Select","event","previous","HTMLElement","s","selectedValue","item","el","Chip","CancelIcon","newValue","chip","OpenedDropdown","ClosedDropdown","MenuItem","Checkbox","useFilterStyles","Filters","onChangeFilters","t","useTranslationRef","coreComponentsTranslationRef","selectedFilters","setSelectedFilters","reset","Button","filter","TableLoadingBody","CircularProgress","tableIcons","forwardRef","ref","AddBox","Check","Clear","DeleteOutline","ChevronRight","Edit","SaveAlt","FilterList","FirstPage","LastPage","ChevronLeft","Search","ArrowUpward","Remove","ViewColumn","extractValueByField","data","field","path","i","undefined","StyledMTableHeader","MTableHeader","StyledMTableToolbar","MTableToolbar","useTableStyles","defaultInitialState","TableToolbar","toolbarProps","toolbarRef","setSearch","hasFilters","selectedFiltersLength","toggleFilters","filtersClasses","onSearchChanged","useCallback","searchText","IconButton","Table","filterConfig","dataValue","columns","emptyContent","options","title","subtitle","localization","filters","initialState","onStateChange","components","loading","style","restProps","tableClasses","useTheme","calculatedInitialState","filtersOpen","setFiltersOpen","v","search","state","transform","result","key","isEqual","defaultState","getFieldByTitle","titleValue","tableData","useMemo","selectedFiltersArray","Object","filterValue","fieldValue","Array","Toolbar","hasNoRows","columnCount","Body","makeBody","bodyProps","MTableBody","distinctValues","addValue","Set","c","MTable","column","headerStyle","cellStyle","cellStyleFn","rowData","rowColumn","ButtonIconDefinition","defineComponent","styles","ButtonIcon","ownProps","dataAttributes","useDefinition","icon","isPending","RAButton","ProgressBar","RiLoader4Line","Cell","CellDefinition","ReactAriaCell","CellText","CellTextDefinition","description","color","leadingIcon","href","Link","Text","Column","ColumnDefinition","children","ReactAriaColumn","allowsSorting","RiArrowUpLine","TableRoot","TableDefinition","ReactAriaTable","CheckboxDefinition","ariaLabel","ariaLabelledBy","console","RACheckbox","isIndeterminate","RiSubtractLine","RiCheckLine","TableHeader","selectionBehavior","selectionMode","useTableOptions","TableHeaderDefinition","ReactAriaTableHeader","Flex","Collection","TableBody","TableBodyDefinition","ReactAriaTableBody","Row","analytics","RowDefinition","isExternal","isExternalLink","hasInternalHref","hasExternalHref","hasInteraction","effectiveTarget","effectiveRel","Boolean","handlePress","String","content","clsx","ReactAriaRow","SelectDefinition","SelectTriggerDefinition","SelectContentDefinition","SelectListBoxDefinition","PopoverDefinition","FieldLabelDefinition","FieldLabel","secondaryLabel","htmlFor","id","descriptionId","descriptionSlot","Label","FieldErrorDefinition","FieldError","AriaFieldError","SelectTrigger","SelectValue","RiArrowDownSLine","NoResults","SelectListBox","ListBox","option","ListBoxItem","SelectContent","contains","useFilter","searchable","searchPlaceholder","Autocomplete","SearchField","Input","RiCloseCircleLine","popoverOwnProps","isRequired","AriaSelect","Popover","TablePaginationDefinition","getOptionValue","TablePagination","pageSize","pageSizeOptions","offset","totalCount","hasNextPage","hasPreviousPage","onNextPage","onPreviousPage","onPageSizeChange","showPageSizeOptions","getLabel","showPaginationLabel","labelId","useId","normalizedOptions","effectivePageSize","opt","firstValue","showLabel","hasItems","fromCount","toCount","Math","newPageSize","Number","RiArrowLeftSLine","RiArrowRightSLine","SkeletonDefinition","Skeleton","width","height","SKELETON_WIDTHS","skeletonItems","_","TableBodySkeleton","rowIndex","columnConfig","isStale","error","pagination","sort","rowConfig","selection","emptyState","className","virtualized","elem","TableWrapperDefinition","liveRegionId","visibleColumns","col","disabledRows","useDisabledRows","set","isDisabled","selectedKeys","onSelectionChange","isInitialLoading","pending","liveRegionLabel","useLiveRegionLabel","isLoading","hasData","wrapResizable","manualColumnSizing","ResizableTableContainer","VisuallyHidden","itemIndex","Virtualizer","TableLayout","useControlledStateHelper","initialValue","controlledValue","internalValue","setInternalValue","useStableCallback","fn","useRef","args","getEffectivePageSize","paginationOptions","FIRST_PAGE_CURSOR","Symbol","PageCacheStore","Map","cursor","existing","entry","direction","currentCursor","initialCurrentCursor","toInternalCursor","currentEntry","toExternalCursor","usePageCache","getData","setCurrentCursor","cacheStore","setIsPending","setError","setTotalCount","abortControllerRef","currentPage","goToPage","targetCursor","existingEntry","abortController","AbortController","err","Error","page","reload","reloadOptions","useDebouncedReload","query","delay","prevDepsRef","prev","timer","setTimeout","clearTimeout","useTable","useQueryState","setSort","setFilter","initialModeRef","useCompletePagination","getDataProp","sortFn","filterFn","searchFn","hasGetData","noPagination","initialOffset","defaultPageSize","Infinity","setItems","loadCount","setLoadCount","setOffset","setPageSize","cancelled","resolvedData","Promise","prevQueryRef","resolvedItems","processedData","paginatedData","newSize","useOffsetPagination","cache","signal","currentOffset","response","prevCursor","nextCursor","useCursorPagination","tableProps","useTableProps","paginationResult","sortState","onPageSizeChangeCallback","onNextPageCallback","onPreviousPageCallback","previousDataRef","displayData","size","entityPresentationSnapshot","entityOrRef","context","entityPresentationApi","stringifyEntityRef","defaultEntityPresentation","columnFactories","isRowHeader","EntityTableColumnTitle","entity","EntityRefLink","EntityRefLinks","getEntityRelations","r","RELATION_OWNED_BY","RELATION_PART_OF","entityColumnPresets","EntityDataTable","getValue","a","b","EntityRelationCard","relationType","entityKind","catalogReactTranslationRef","useEntity","entities","useRelatedEntities","EntityInfoCard","Alert","defaultKind","formatContent","entity1","entity2","relation","entityFilter","getRelations","systemEntityColumns","componentEntityColumns","EntityTable","variant","tableOptions","tableStyle","translationKey","relationFilter","filterByTypeLower","filterByKindLower","catalogApi","useApi","catalogApiRef","useAsync","relations","parseEntityRef","x","DependsOnResourcesCard","catalogTranslationRef","resourceEntityColumns","RelatedEntitiesCard","RELATION_DEPENDS_ON","legacyHelpLink","asResourceEntities","emptyMessage","emptyHelpLink","asRenderableEntities","InfoCard","Progress","ResponseErrorPanel","componentEntityHelpLink","asComponentEntities","resourceEntityHelpLink","systemEntityHelpLink","asSystemEntities","domainEntityColumns","domainEntityHelpLink","asDomainEntities"],"mappings":"uMA8BA,IAAMA,EAAYC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAChB,CACE,UAAW,CACT,SAAU,oBACZ,EACA,KAAM,CACJ,SAAU,UACV,SAAU,SACV,aAAc,WACd,QAAS,cACT,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