@backstage/ui 0.14.0-next.0 → 0.14.0-next.2
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 +57 -0
- package/dist/components/Accordion/Accordion.esm.js.map +1 -1
- package/dist/components/Accordion/definition.esm.js +1 -0
- package/dist/components/Accordion/definition.esm.js.map +1 -1
- package/dist/components/Alert/definition.esm.js +1 -0
- package/dist/components/Alert/definition.esm.js.map +1 -1
- package/dist/components/Avatar/Avatar.esm.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.css.esm.js +2 -2
- package/dist/components/Avatar/definition.esm.js +1 -0
- package/dist/components/Avatar/definition.esm.js.map +1 -1
- package/dist/components/Badge/Badge.esm.js +19 -0
- package/dist/components/Badge/Badge.esm.js.map +1 -0
- package/dist/components/Badge/Badge.module.css.esm.js +8 -0
- package/dist/components/Badge/Badge.module.css.esm.js.map +1 -0
- package/dist/components/Badge/definition.esm.js +27 -0
- package/dist/components/Badge/definition.esm.js.map +1 -0
- package/dist/components/Box/Box.esm.js.map +1 -1
- package/dist/components/Box/definition.esm.js +1 -0
- package/dist/components/Box/definition.esm.js.map +1 -1
- package/dist/components/Button/definition.esm.js +1 -0
- package/dist/components/Button/definition.esm.js.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
- package/dist/components/ButtonIcon/definition.esm.js +1 -0
- package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
- package/dist/components/ButtonLink/definition.esm.js +2 -0
- package/dist/components/ButtonLink/definition.esm.js.map +1 -1
- package/dist/components/Card/definition.esm.js +2 -0
- package/dist/components/Card/definition.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
- package/dist/components/Checkbox/definition.esm.js +1 -0
- package/dist/components/Checkbox/definition.esm.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.esm.js +63 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.esm.js.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.module.css.esm.js +8 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.module.css.esm.js.map +1 -0
- package/dist/components/CheckboxGroup/definition.esm.js +31 -0
- package/dist/components/CheckboxGroup/definition.esm.js.map +1 -0
- package/dist/components/Container/Container.esm.js.map +1 -1
- package/dist/components/Container/definition.esm.js +1 -0
- package/dist/components/Container/definition.esm.js.map +1 -1
- package/dist/components/Dialog/Dialog.esm.js.map +1 -1
- package/dist/components/Dialog/definition.esm.js +1 -0
- package/dist/components/Dialog/definition.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.esm.js.map +1 -1
- package/dist/components/FieldError/definition.esm.js +1 -0
- package/dist/components/FieldError/definition.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.esm.js +10 -2
- package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
- package/dist/components/FieldLabel/definition.esm.js +2 -0
- package/dist/components/FieldLabel/definition.esm.js.map +1 -1
- package/dist/components/Flex/Flex.esm.js.map +1 -1
- package/dist/components/Flex/definition.esm.js +1 -0
- package/dist/components/Flex/definition.esm.js.map +1 -1
- package/dist/components/FullPage/definition.esm.js +1 -0
- package/dist/components/FullPage/definition.esm.js.map +1 -1
- package/dist/components/Grid/definition.esm.js +1 -0
- package/dist/components/Grid/definition.esm.js.map +1 -1
- package/dist/components/Header/Header.esm.js +1 -1
- package/dist/components/Header/HeaderNav.esm.js +41 -15
- package/dist/components/Header/HeaderNav.esm.js.map +1 -1
- package/dist/components/Header/HeaderNav.module.css.esm.js +2 -2
- package/dist/components/Header/HeaderNavDefinition.esm.js +10 -2
- package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -1
- package/dist/components/Header/definition.esm.js +1 -0
- package/dist/components/Header/definition.esm.js.map +1 -1
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Link/definition.esm.js +2 -0
- package/dist/components/Link/definition.esm.js.map +1 -1
- package/dist/components/List/definition.esm.js +2 -0
- package/dist/components/List/definition.esm.js.map +1 -1
- package/dist/components/Menu/Menu.esm.js +2 -2
- package/dist/components/Menu/Menu.esm.js.map +1 -1
- package/dist/components/Menu/definition.esm.js +3 -0
- package/dist/components/Menu/definition.esm.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.esm.js.map +1 -1
- package/dist/components/PasswordField/definition.esm.js +1 -0
- package/dist/components/PasswordField/definition.esm.js.map +1 -1
- package/dist/components/PluginHeader/definition.esm.js +1 -0
- package/dist/components/PluginHeader/definition.esm.js.map +1 -1
- package/dist/components/Popover/definition.esm.js +1 -0
- package/dist/components/Popover/definition.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
- package/dist/components/RadioGroup/definition.esm.js +1 -0
- package/dist/components/RadioGroup/definition.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/definition.esm.js +2 -0
- package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.esm.js.map +1 -1
- package/dist/components/SearchField/definition.esm.js +1 -0
- package/dist/components/SearchField/definition.esm.js.map +1 -1
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Select/definition.esm.js +1 -0
- package/dist/components/Select/definition.esm.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
- package/dist/components/Skeleton/definition.esm.js +1 -0
- package/dist/components/Skeleton/definition.esm.js.map +1 -1
- package/dist/components/Slider/Slider.esm.js +76 -0
- package/dist/components/Slider/Slider.esm.js.map +1 -0
- package/dist/components/Slider/Slider.module.css.esm.js +8 -0
- package/dist/components/Slider/Slider.module.css.esm.js.map +1 -0
- package/dist/components/Slider/definition.esm.js +31 -0
- package/dist/components/Slider/definition.esm.js.map +1 -0
- package/dist/components/Switch/Switch.esm.js.map +1 -1
- package/dist/components/Switch/definition.esm.js +1 -0
- package/dist/components/Switch/definition.esm.js.map +1 -1
- package/dist/components/Table/components/Cell.esm.js.map +1 -1
- package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
- package/dist/components/Table/components/CellText.esm.js.map +1 -1
- package/dist/components/Table/components/Column.esm.js.map +1 -1
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/Table.esm.js +2 -1
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/components/TableBody.esm.js.map +1 -1
- package/dist/components/Table/components/TableBodySkeleton.esm.js +1 -0
- package/dist/components/Table/components/TableBodySkeleton.esm.js.map +1 -1
- package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
- package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
- package/dist/components/Table/definition.esm.js +4 -0
- package/dist/components/Table/definition.esm.js.map +1 -1
- package/dist/components/Table/hooks/useCompletePagination.esm.js +10 -5
- package/dist/components/Table/hooks/useCompletePagination.esm.js.map +1 -1
- package/dist/components/Table/hooks/useTable.esm.js +28 -22
- package/dist/components/Table/hooks/useTable.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +6 -4
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/TablePagination/definition.esm.js +3 -1
- package/dist/components/TablePagination/definition.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.esm.js +4 -4
- package/dist/components/Tabs/Tabs.module.css.esm.js +2 -2
- package/dist/components/Tabs/TabsIndicators.esm.js +5 -1
- package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
- package/dist/components/Tabs/definition.esm.js +2 -0
- package/dist/components/Tabs/definition.esm.js.map +1 -1
- package/dist/components/TagGroup/definition.esm.js +2 -0
- package/dist/components/TagGroup/definition.esm.js.map +1 -1
- package/dist/components/Text/Text.esm.js.map +1 -1
- package/dist/components/Text/definition.esm.js +1 -0
- package/dist/components/Text/definition.esm.js.map +1 -1
- package/dist/components/TextField/TextField.esm.js.map +1 -1
- package/dist/components/TextField/definition.esm.js +1 -0
- package/dist/components/TextField/definition.esm.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.esm.js.map +1 -1
- package/dist/components/ToggleButton/definition.esm.js +1 -0
- package/dist/components/ToggleButton/definition.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/definition.esm.js +1 -0
- package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
- package/dist/components/Tooltip/definition.esm.js +1 -0
- package/dist/components/Tooltip/definition.esm.js.map +1 -1
- package/dist/components/VisuallyHidden/definition.esm.js +1 -0
- package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
- package/dist/hooks/useDefinition/useDefinition.esm.js +12 -1
- package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
- package/dist/index.d.ts +436 -54
- package/dist/index.esm.js +6 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNavDefinition.esm.js","sources":["../../../src/components/Header/HeaderNavDefinition.ts"],"sourcesContent":["/*\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 { defineComponent } from '../../hooks/useDefinition';\nimport type { HeaderNavTabItem } from './types';\nimport styles from './HeaderNav.module.css';\n\n/** @public */\nexport const HeaderNavDefinition = defineComponent<{\n
|
|
1
|
+
{"version":3,"file":"HeaderNavDefinition.esm.js","sources":["../../../src/components/Header/HeaderNavDefinition.ts"],"sourcesContent":["/*\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 { defineComponent } from '../../hooks/useDefinition';\nimport type { HeaderNavTabItem, HeaderNavLinkProps } from './types';\nimport styles from './HeaderNav.module.css';\n\n/** @public */\nexport const HeaderNavDefinition = defineComponent<{\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n children?: React.ReactNode;\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNav',\n list: 'bui-HeaderNavList',\n active: 'bui-HeaderNavActive',\n hovered: 'bui-HeaderNavHovered',\n },\n propDefs: {\n tabs: {},\n activeTabId: {},\n children: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavItemDefinition = defineComponent<HeaderNavLinkProps>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavItem',\n },\n analytics: true,\n resolveHref: true,\n propDefs: {\n noTrack: {},\n id: {},\n label: {},\n href: {},\n active: {},\n registerRef: {},\n onHighlight: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavGroupDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavGroup',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAqBO,MAAM,mBAAA,GAAsB,iBAKhC,CAAE;AAAA,EACH,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,IAAA,EAAM,mBAAA;AAAA,IACN,MAAA,EAAQ,qBAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAGM,MAAM,uBAAA,GAA0B,iBAAoC,CAAE;AAAA,EAC3E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW,IAAA;AAAA,EACX,WAAA,EAAa,IAAA;AAAA,EACb,QAAA,EAAU;AAAA,IACR,SAAS,EAAC;AAAA,IACV,IAAI,EAAC;AAAA,IACL,OAAO,EAAC;AAAA,IACR,MAAM,EAAC;AAAA,IACP,QAAQ,EAAC;AAAA,IACT,aAAa,EAAC;AAAA,IACd,aAAa,EAAC;AAAA,IACd,WAAW;AAAC;AAEhB,CAAC;AAGM,MAAM,wBAAA,GAA2B,iBAErC,CAAE;AAAA,EACH,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './Header.module.css.esm.js';
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Header/definition.ts"],"sourcesContent":["/*\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 { HeaderOwnProps } from './types';\nimport styles from './Header.module.css';\n\n/**\n * Component definition for Header\n * @public\n */\nexport const HeaderDefinition = defineComponent<HeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Header',\n content: 'bui-HeaderContent',\n breadcrumbs: 'bui-HeaderBreadcrumbs',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n controls: 'bui-HeaderControls',\n },\n propDefs: {\n title: {},\n customActions: {},\n tabs: {},\n activeTabId: {},\n breadcrumbs: {},\n className: {},\n },\n});\n\n/**\n * @public\n * @deprecated Use {@link HeaderDefinition} instead.\n */\nexport const HeaderPageDefinition = HeaderDefinition;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Header/definition.ts"],"sourcesContent":["/*\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 { HeaderOwnProps } from './types';\nimport styles from './Header.module.css';\n\n/**\n * Component definition for Header\n * @public\n */\nexport const HeaderDefinition = defineComponent<HeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Header',\n content: 'bui-HeaderContent',\n breadcrumbs: 'bui-HeaderBreadcrumbs',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n controls: 'bui-HeaderControls',\n },\n propDefs: {\n title: {},\n customActions: {},\n tabs: {},\n activeTabId: {},\n breadcrumbs: {},\n className: {},\n },\n});\n\n/**\n * @public\n * @deprecated Use {@link HeaderDefinition} instead.\n */\nexport const HeaderPageDefinition = HeaderDefinition;\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,OAAA,EAAS,mBAAA;AAAA,IACT,WAAA,EAAa,uBAAA;AAAA,IACb,WAAA,EAAa,uBAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,eAAe,EAAC;AAAA,IAChB,MAAM,EAAC;AAAA,IACP,aAAa,EAAC;AAAA,IACd,aAAa,EAAC;AAAA,IACd,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,oBAAA,GAAuB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.esm.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["/*\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, useRef } from 'react';\nimport { useLink } from 'react-aria';\nimport type { LinkProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { LinkDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\n\nconst LinkInternal = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n LinkDefinition,\n props,\n );\n const { classes, title, children } = ownProps;\n\n const internalRef = useRef<HTMLAnchorElement>(null);\n const linkRef = (ref || internalRef) as React.RefObject<HTMLAnchorElement>;\n\n const { linkProps } = useLink(restProps, linkRef);\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n linkProps.onClick?.(e);\n const text =\n restProps['aria-label'] ??\n getNodeText(children) ??\n String(restProps.href ?? '');\n analytics.captureEvent('click', text, {\n attributes: { to: String(restProps.href ?? '') },\n });\n };\n\n return (\n <a\n {...linkProps}\n {...dataAttributes}\n {...(restProps as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={linkRef}\n title={title}\n className={classes.root}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n});\n\nLinkInternal.displayName = 'LinkInternal';\n\n
|
|
1
|
+
{"version":3,"file":"Link.esm.js","sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["/*\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, useRef } from 'react';\nimport { useLink } from 'react-aria';\nimport type { LinkProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { LinkDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\n\nconst LinkInternal = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n LinkDefinition,\n props,\n );\n const { classes, title, children } = ownProps;\n\n const internalRef = useRef<HTMLAnchorElement>(null);\n const linkRef = (ref || internalRef) as React.RefObject<HTMLAnchorElement>;\n\n const { linkProps } = useLink(restProps, linkRef);\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n linkProps.onClick?.(e);\n const text =\n restProps['aria-label'] ??\n getNodeText(children) ??\n String(restProps.href ?? '');\n analytics.captureEvent('click', text, {\n attributes: { to: String(restProps.href ?? '') },\n });\n };\n\n return (\n <a\n {...linkProps}\n {...dataAttributes}\n {...(restProps as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={linkRef}\n title={title}\n className={classes.root}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n});\n\nLinkInternal.displayName = 'LinkInternal';\n\n/**\n * A styled anchor element that supports analytics event tracking on click.\n *\n * @public\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n return <LinkInternal {...props} ref={ref} />;\n});\n\nLink.displayName = 'Link';\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,YAAA,GAAe,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,WAAU,GAAI,aAAA;AAAA,IACzD,cAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,QAAA,EAAS,GAAI,QAAA;AAErC,EAAA,MAAM,WAAA,GAAc,OAA0B,IAAI,CAAA;AAClD,EAAA,MAAM,UAAW,GAAA,IAAO,WAAA;AAExB,EAAA,MAAM,EAAE,SAAA,EAAU,GAAI,OAAA,CAAQ,WAAW,OAAO,CAAA;AAEhD,EAAA,MAAM,WAAA,GAAc,CAAC,CAAA,KAA2C;AAC9D,IAAA,SAAA,CAAU,UAAU,CAAC,CAAA;AACrB,IAAA,MAAM,IAAA,GACJ,SAAA,CAAU,YAAY,CAAA,IACtB,WAAA,CAAY,QAAQ,CAAA,IACpB,MAAA,CAAO,SAAA,CAAU,IAAA,IAAQ,EAAE,CAAA;AAC7B,IAAA,SAAA,CAAU,YAAA,CAAa,SAAS,IAAA,EAAM;AAAA,MACpC,YAAY,EAAE,EAAA,EAAI,OAAO,SAAA,CAAU,IAAA,IAAQ,EAAE,CAAA;AAAE,KAChD,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACE,GAAG,SAAA;AAAA,MACH,GAAG,cAAA;AAAA,MACH,GAAI,SAAA;AAAA,MACL,GAAA,EAAK,OAAA;AAAA,MACL,KAAA;AAAA,MACA,WAAW,OAAA,CAAQ,IAAA;AAAA,MACnB,OAAA,EAAS,WAAA;AAAA,MAER;AAAA;AAAA,GACH;AAEJ,CAAC,CAAA;AAED,YAAA,CAAa,WAAA,GAAc,cAAA;AAOpB,MAAM,IAAA,GAAO,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC3E,EAAA,uBAAO,GAAA,CAAC,YAAA,EAAA,EAAc,GAAG,KAAA,EAAO,GAAA,EAAU,CAAA;AAC5C,CAAC;AAED,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './Link.module.css.esm.js';
|
|
9
10
|
|
|
@@ -13,6 +14,7 @@ const LinkDefinition = defineComponent()({
|
|
|
13
14
|
root: "bui-Link"
|
|
14
15
|
},
|
|
15
16
|
analytics: true,
|
|
17
|
+
resolveHref: true,
|
|
16
18
|
propDefs: {
|
|
17
19
|
noTrack: {},
|
|
18
20
|
variant: { dataAttribute: true, default: "body-medium" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Link/definition.ts"],"sourcesContent":["/*\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 { LinkOwnProps } from './types';\nimport styles from './Link.module.css';\n\n/**\n * Component definition for Link\n * @public\n */\nexport const LinkDefinition = defineComponent<LinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Link',\n },\n analytics: true,\n propDefs: {\n noTrack: {},\n variant: { dataAttribute: true, default: 'body-medium' },\n weight: { dataAttribute: true, default: 'regular' },\n color: { dataAttribute: true, default: 'primary' },\n truncate: { dataAttribute: true },\n standalone: { dataAttribute: true },\n title: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Link/definition.ts"],"sourcesContent":["/*\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 { LinkOwnProps } from './types';\nimport styles from './Link.module.css';\n\n/**\n * Component definition for Link\n * @public\n */\nexport const LinkDefinition = defineComponent<LinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Link',\n },\n analytics: true,\n resolveHref: true,\n propDefs: {\n noTrack: {},\n variant: { dataAttribute: true, default: 'body-medium' },\n weight: { dataAttribute: true, default: 'regular' },\n color: { dataAttribute: true, default: 'primary' },\n truncate: { dataAttribute: true },\n standalone: { dataAttribute: true },\n title: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW,IAAA;AAAA,EACX,WAAA,EAAa,IAAA;AAAA,EACb,QAAA,EAAU;AAAA,IACR,SAAS,EAAC;AAAA,IACV,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,aAAA,EAAc;AAAA,IACvD,MAAA,EAAQ,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IAClD,KAAA,EAAO,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACjD,QAAA,EAAU,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAChC,UAAA,EAAY,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAClC,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './List.module.css.esm.js';
|
|
9
10
|
|
|
@@ -22,6 +23,7 @@ const ListDefinition = defineComponent()({
|
|
|
22
23
|
const ListRowDefinition = defineComponent()({
|
|
23
24
|
styles,
|
|
24
25
|
bg: "consumer",
|
|
26
|
+
resolveHref: true,
|
|
25
27
|
classNames: {
|
|
26
28
|
root: "bui-ListRow",
|
|
27
29
|
check: "bui-ListRowCheck",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/List/definition.ts"],"sourcesContent":["/*\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 { defineComponent } from '../../hooks/useDefinition';\nimport type { ListOwnProps, ListRowOwnProps } from './types';\nimport styles from './List.module.css';\n\n/**\n * Component definition for List\n * @public\n */\nexport const ListDefinition = defineComponent<ListOwnProps>()({\n styles,\n classNames: {\n root: 'bui-List',\n },\n propDefs: {\n items: {},\n children: {},\n renderEmptyState: {},\n className: {},\n },\n});\n\n/**\n * Component definition for ListRow\n * @public\n */\nexport const ListRowDefinition = defineComponent<ListRowOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-ListRow',\n check: 'bui-ListRowCheck',\n icon: 'bui-ListRowIcon',\n label: 'bui-ListRowLabel',\n description: 'bui-ListRowDescription',\n actions: 'bui-ListRowActions',\n },\n propDefs: {\n children: {},\n description: {},\n icon: {},\n menuItems: {},\n customActions: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/List/definition.ts"],"sourcesContent":["/*\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 { defineComponent } from '../../hooks/useDefinition';\nimport type { ListOwnProps, ListRowOwnProps } from './types';\nimport styles from './List.module.css';\n\n/**\n * Component definition for List\n * @public\n */\nexport const ListDefinition = defineComponent<ListOwnProps>()({\n styles,\n classNames: {\n root: 'bui-List',\n },\n propDefs: {\n items: {},\n children: {},\n renderEmptyState: {},\n className: {},\n },\n});\n\n/**\n * Component definition for ListRow\n * @public\n */\nexport const ListRowDefinition = defineComponent<ListRowOwnProps>()({\n styles,\n bg: 'consumer',\n resolveHref: true,\n classNames: {\n root: 'bui-ListRow',\n check: 'bui-ListRowCheck',\n icon: 'bui-ListRowIcon',\n label: 'bui-ListRowLabel',\n description: 'bui-ListRowDescription',\n actions: 'bui-ListRowActions',\n },\n propDefs: {\n children: {},\n description: {},\n icon: {},\n menuItems: {},\n customActions: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,kBAAkB,EAAC;AAAA,IACnB,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,WAAA,EAAa,IAAA;AAAA,EACb,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,IAAA,EAAM,iBAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,WAAA,EAAa,wBAAA;AAAA,IACb,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,aAAa,EAAC;AAAA,IACd,MAAM,EAAC;AAAA,IACP,WAAW,EAAC;AAAA,IACZ,eAAe,EAAC;AAAA,IAChB,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { Menu as Menu$1, Popover, Virtualizer, ListLayout, useFilter, Autocomplete, SearchField, Input, Button, ListBox, MenuItem as MenuItem$1, ListBoxItem, MenuSection as MenuSection$1, Header, Separator, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1 } from 'react-aria-components';
|
|
3
3
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
4
|
-
import { MenuDefinition,
|
|
4
|
+
import { MenuDefinition, MenuAutocompleteDefinition, MenuAutocompleteListboxDefinition, MenuItemDefinition, MenuListBoxDefinition, MenuListBoxItemDefinition, MenuSectionDefinition, MenuSeparatorDefinition, MenuEmptyStateDefinition } from './definition.esm.js';
|
|
5
5
|
import { RiCloseCircleLine, RiArrowRightSLine, RiCheckLine } from '@remixicon/react';
|
|
6
6
|
import { isInternalLink } from '../../utils/linkUtils.esm.js';
|
|
7
7
|
import { getNodeText } from '../../analytics/getNodeText.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.esm.js","sources":["../../../src/components/Menu/Menu.tsx"],"sourcesContent":["/*\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 MenuTrigger as RAMenuTrigger,\n Popover as RAPopover,\n MenuItem as RAMenuItem,\n Menu as RAMenu,\n MenuSection as RAMenuSection,\n Header as RAMenuHeader,\n Separator as RAMenuSeparator,\n SubmenuTrigger as RAMenuSubmenuTrigger,\n Autocomplete as RAAutocomplete,\n SearchField as RASearchField,\n Input as RAInput,\n Button as RAButton,\n ListBox as RAListBox,\n ListBoxItem as RAListBoxItem,\n useFilter,\n Virtualizer,\n ListLayout,\n} from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n MenuDefinition,\n MenuListBoxDefinition,\n MenuAutocompleteDefinition,\n MenuAutocompleteListboxDefinition,\n MenuItemDefinition,\n MenuListBoxItemDefinition,\n MenuSectionDefinition,\n MenuSeparatorDefinition,\n MenuEmptyStateDefinition,\n} from './definition';\nimport type {\n MenuTriggerProps,\n SubmenuTriggerProps,\n MenuProps,\n MenuAutocompleteProps,\n MenuItemProps,\n MenuSectionProps,\n MenuSeparatorProps,\n MenuListBoxProps,\n MenuListBoxItemProps,\n MenuAutocompleteListBoxProps,\n} from './types';\nimport {\n RiArrowRightSLine,\n RiCheckLine,\n RiCloseCircleLine,\n} from '@remixicon/react';\nimport { isInternalLink } from '../../utils/linkUtils';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n// The height will be used for virtualized menus. It should match the size set in CSS for each menu item.\nconst rowHeight = 32;\n\nconst MenuEmptyState = () => {\n const { ownProps } = useDefinition(MenuEmptyStateDefinition, {});\n\n return <div className={ownProps.classes.root}>No results found.</div>;\n};\n\n/** @public */\nexport const MenuTrigger = (props: MenuTriggerProps) => {\n return <RAMenuTrigger {...props} />;\n};\n\n/** @public */\nexport const SubmenuTrigger = (props: SubmenuTriggerProps) => {\n return <RAMenuSubmenuTrigger {...props} />;\n};\n\n/** @public */\nexport const Menu = (props: MenuProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuDefinition, props);\n const { classes, placement, virtualized, maxWidth, maxHeight, style } =\n ownProps;\n\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuListBox = (props: MenuListBoxProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuListBoxDefinition, props);\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n } = ownProps;\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocomplete = (props: MenuAutocompleteProps<object>) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteDefinition,\n props,\n );\n const {\n classes,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocompleteListbox = (\n props: MenuAutocompleteListBoxProps<object>,\n) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteListboxDefinition,\n props,\n );\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuItem = (props: MenuItemProps) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n MenuItemDefinition,\n props,\n );\n const { classes, iconStart, children, href } = ownProps;\n\n const isExternal = href && !isInternalLink(href);\n\n return (\n <RAMenuItem\n className={classes.root}\n {...dataAttributes}\n href={href}\n target={isExternal ? '_blank' : undefined}\n rel={isExternal ? 'noopener noreferrer' : undefined}\n textValue={typeof children === 'string' ? children : undefined}\n {...restProps}\n onAction={() => {\n restProps.onAction?.();\n if (href) {\n const text =\n restProps['aria-label'] ?? getNodeText(children) ?? String(href);\n analytics.captureEvent('click', text, {\n attributes: { to: String(href) },\n });\n }\n }}\n >\n <div className={classes.itemContent}>\n {iconStart}\n {children}\n </div>\n <div className={classes.itemArrow}>\n <RiArrowRightSLine />\n </div>\n </RAMenuItem>\n );\n};\n\n/** @public */\nexport const MenuListBoxItem = (props: MenuListBoxItemProps) => {\n const { ownProps, restProps } = useDefinition(\n MenuListBoxItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <RAListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>\n <div className={classes.check}>\n <RiCheckLine />\n </div>\n {children}\n </div>\n </RAListBoxItem>\n );\n};\n\n/** @public */\nexport const MenuSection = (props: MenuSectionProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuSectionDefinition, props);\n const { classes, children, title } = ownProps;\n\n return (\n <RAMenuSection className={classes.root} {...restProps}>\n <RAMenuHeader className={classes.header}>{title}</RAMenuHeader>\n {children}\n </RAMenuSection>\n );\n};\n\n/** @public */\nexport const MenuSeparator = (props: MenuSeparatorProps) => {\n const { ownProps, restProps } = useDefinition(MenuSeparatorDefinition, props);\n\n return <RAMenuSeparator className={ownProps.classes.root} {...restProps} />;\n};\n"],"names":["RAMenuTrigger","RAMenuSubmenuTrigger","RAMenu","RAPopover","RAListBox","RAAutocomplete","RASearchField","RAInput","RAButton","RAMenuItem","RAListBoxItem","RAMenuSection","RAMenuHeader","RAMenuSeparator"],"mappings":";;;;;;;;;;;AAsEA,MAAM,SAAA,GAAY,EAAA;AAElB,MAAM,iBAAiB,MAAM;AAC3B,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,wBAAA,EAA0B,EAAE,CAAA;AAE/D,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,MAAM,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACjE,CAAA;AAGO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,uBAAO,GAAA,CAACA,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACnC;AAGO,MAAM,cAAA,GAAiB,CAAC,KAAA,KAA+B;AAC5D,EAAA,uBAAO,GAAA,CAACC,gBAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAGO,MAAM,IAAA,GAAO,CAAC,KAAA,KAA6B;AAChD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,gBAAgB,KAAK,CAAA;AACnE,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAW,aAAa,QAAA,EAAU,SAAA,EAAW,OAAM,GAClE,QAAA;AAEF,EAAA,IAAI,WAAA,GAAc,QAAA,KAAa,WAAA,GAAc,OAAA,GAAU,WAAA,CAAA;AAEvD,EAAA,MAAM,WAAA,mBACJ,GAAA;AAAA,IAACC,MAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAA,CAAQ,OAAA;AAAA,MACnB,gBAAA,EAAkB,sBAAM,GAAA,CAAC,cAAA,EAAA,EAAe,CAAA;AAAA,MACxC,OAAO,EAAE,KAAA,EAAO,WAAA,EAAa,SAAA,EAAW,GAAG,K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AA,KAA8B;AAC1D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,yBAAyB,KAAK,CAAA;AAE5E,EAAA,2BAAQC,SAAA,EAAA,EAAgB,SAAA,EAAW,SAAS,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAAW,CAAA;AAC3E;;;;"}
|
|
1
|
+
{"version":3,"file":"Menu.esm.js","sources":["../../../src/components/Menu/Menu.tsx"],"sourcesContent":["/*\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 MenuTrigger as RAMenuTrigger,\n Popover as RAPopover,\n MenuItem as RAMenuItem,\n Menu as RAMenu,\n MenuSection as RAMenuSection,\n Header as RAMenuHeader,\n Separator as RAMenuSeparator,\n SubmenuTrigger as RAMenuSubmenuTrigger,\n Autocomplete as RAAutocomplete,\n SearchField as RASearchField,\n Input as RAInput,\n Button as RAButton,\n ListBox as RAListBox,\n ListBoxItem as RAListBoxItem,\n useFilter,\n Virtualizer,\n ListLayout,\n} from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n MenuDefinition,\n MenuListBoxDefinition,\n MenuAutocompleteDefinition,\n MenuAutocompleteListboxDefinition,\n MenuItemDefinition,\n MenuListBoxItemDefinition,\n MenuSectionDefinition,\n MenuSeparatorDefinition,\n MenuEmptyStateDefinition,\n} from './definition';\nimport type {\n MenuTriggerProps,\n SubmenuTriggerProps,\n MenuProps,\n MenuAutocompleteProps,\n MenuItemProps,\n MenuSectionProps,\n MenuSeparatorProps,\n MenuListBoxProps,\n MenuListBoxItemProps,\n MenuAutocompleteListBoxProps,\n} from './types';\nimport {\n RiArrowRightSLine,\n RiCheckLine,\n RiCloseCircleLine,\n} from '@remixicon/react';\nimport { isInternalLink } from '../../utils/linkUtils';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n// The height will be used for virtualized menus. It should match the size set in CSS for each menu item.\nconst rowHeight = 32;\n\nconst MenuEmptyState = () => {\n const { ownProps } = useDefinition(MenuEmptyStateDefinition, {});\n\n return <div className={ownProps.classes.root}>No results found.</div>;\n};\n\n/**\n * A wrapper that connects a trigger element to a dropdown menu, controlling its open and close state.\n *\n * @public\n */\nexport const MenuTrigger = (props: MenuTriggerProps) => {\n return <RAMenuTrigger {...props} />;\n};\n\n/** @public */\nexport const SubmenuTrigger = (props: SubmenuTriggerProps) => {\n return <RAMenuSubmenuTrigger {...props} />;\n};\n\n/** @public */\nexport const Menu = (props: MenuProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuDefinition, props);\n const { classes, placement, virtualized, maxWidth, maxHeight, style } =\n ownProps;\n\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuListBox = (props: MenuListBoxProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuListBoxDefinition, props);\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n } = ownProps;\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocomplete = (props: MenuAutocompleteProps<object>) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteDefinition,\n props,\n );\n const {\n classes,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const menuContent = (\n <RAMenu\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {menuContent}\n </Virtualizer>\n ) : (\n menuContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuAutocompleteListbox = (\n props: MenuAutocompleteListBoxProps<object>,\n) => {\n const { ownProps, restProps } = useDefinition(\n MenuAutocompleteListboxDefinition,\n props,\n );\n const {\n classes,\n selectionMode,\n placement,\n virtualized,\n maxWidth,\n maxHeight,\n style,\n placeholder,\n } = ownProps;\n const { contains } = useFilter({ sensitivity: 'base' });\n let newMaxWidth = maxWidth || (virtualized ? '260px' : 'undefined');\n\n const listBoxContent = (\n <RAListBox\n className={classes.content}\n renderEmptyState={() => <MenuEmptyState />}\n selectionMode={selectionMode}\n style={{ width: newMaxWidth, maxHeight, ...style }}\n {...restProps}\n />\n );\n\n return (\n <RAPopover className={classes.root} placement={placement}>\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <RAAutocomplete filter={contains}>\n <RASearchField\n className={classes.searchField}\n aria-label={placeholder || 'Search'}\n >\n <RAInput\n className={classes.searchFieldInput}\n placeholder={placeholder || 'Search...'}\n />\n <RAButton className={classes.searchFieldClear}>\n <RiCloseCircleLine />\n </RAButton>\n </RASearchField>\n {virtualized ? (\n <Virtualizer\n layout={ListLayout}\n layoutOptions={{\n rowHeight,\n }}\n >\n {listBoxContent}\n </Virtualizer>\n ) : (\n listBoxContent\n )}\n </RAAutocomplete>\n </Box>\n </BgReset>\n </RAPopover>\n );\n};\n\n/** @public */\nexport const MenuItem = (props: MenuItemProps) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n MenuItemDefinition,\n props,\n );\n const { classes, iconStart, children, href } = ownProps;\n\n const isExternal = href && !isInternalLink(href);\n\n return (\n <RAMenuItem\n className={classes.root}\n {...dataAttributes}\n href={href}\n target={isExternal ? '_blank' : undefined}\n rel={isExternal ? 'noopener noreferrer' : undefined}\n textValue={typeof children === 'string' ? children : undefined}\n {...restProps}\n onAction={() => {\n restProps.onAction?.();\n if (href) {\n const text =\n restProps['aria-label'] ?? getNodeText(children) ?? String(href);\n analytics.captureEvent('click', text, {\n attributes: { to: String(href) },\n });\n }\n }}\n >\n <div className={classes.itemContent}>\n {iconStart}\n {children}\n </div>\n <div className={classes.itemArrow}>\n <RiArrowRightSLine />\n </div>\n </RAMenuItem>\n );\n};\n\n/** @public */\nexport const MenuListBoxItem = (props: MenuListBoxItemProps) => {\n const { ownProps, restProps } = useDefinition(\n MenuListBoxItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <RAListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>\n <div className={classes.check}>\n <RiCheckLine />\n </div>\n {children}\n </div>\n </RAListBoxItem>\n );\n};\n\n/** @public */\nexport const MenuSection = (props: MenuSectionProps<object>) => {\n const { ownProps, restProps } = useDefinition(MenuSectionDefinition, props);\n const { classes, children, title } = ownProps;\n\n return (\n <RAMenuSection className={classes.root} {...restProps}>\n <RAMenuHeader className={classes.header}>{title}</RAMenuHeader>\n {children}\n </RAMenuSection>\n );\n};\n\n/** @public */\nexport const MenuSeparator = (props: MenuSeparatorProps) => {\n const { ownProps, restProps } = useDefinition(MenuSeparatorDefinition, props);\n\n return <RAMenuSeparator className={ownProps.classes.root} {...restProps} />;\n};\n"],"names":["RAMenuTrigger","RAMenuSubmenuTrigger","RAMenu","RAPopover","RAListBox","RAAutocomplete","RASearchField","RAInput","RAButton","RAMenuItem","RAListBoxItem","RAMenuSection","RAMenuHeader","RAMenuSeparator"],"mappings":";;;;;;;;;;;AAsEA,MAAM,SAAA,GAAY,EAAA;AAElB,MAAM,iBAAiB,MAAM;AAC3B,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,wBAAA,EAA0B,EAAE,CAAA;AAE/D,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,MAAM,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACjE,CAAA;AAOO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,uBAAO,GAAA,CAACA,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACnC;AAGO,MAAM,cAAA,GAAiB,CAAC,KAAA,KAA+B;AAC5D,EAAA,uBAAO,GAAA,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EACtB,QAAA,kBAAA,GAAA,CAAC,eAAY,CAAA,EACf,CAAA;AAAA,QACC;AAAA,OAAA,EACH;AAAA;AAAA,GACF;AAEJ;AAGO,MAAM,WAAA,GAAc,CAAC,KAAA,KAAoC;AAC9D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,uBAAuB,KAAK,CAAA;AAC1E,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,KAAA,EAAM,GAAI,QAAA;AAErC,EAAA,4BACGC,aAAA,EAAA,EAAc,SAAA,EAAW,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAC1C,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACC,MAAA,EAAA,EAAa,SAAA,EAAW,OAAA,CAAQ,MAAA,EAAS,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IAC/C;AAAA,GAAA,EACH,CAAA;AAEJ;AAGO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,yBAAyB,KAAK,CAAA;AAE5E,EAAA,2BAAQC,SAAA,EAAA,EAAgB,SAAA,EAAW,SAAS,OAAA,CAAQ,IAAA,EAAO,GAAG,SAAA,EAAW,CAAA;AAC3E;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './Menu.module.css.esm.js';
|
|
9
10
|
|
|
@@ -64,6 +65,7 @@ const MenuItemDefinition = defineComponent()({
|
|
|
64
65
|
itemArrow: "bui-MenuItemArrow"
|
|
65
66
|
},
|
|
66
67
|
analytics: true,
|
|
68
|
+
resolveHref: true,
|
|
67
69
|
propDefs: {
|
|
68
70
|
iconStart: {},
|
|
69
71
|
children: {},
|
|
@@ -75,6 +77,7 @@ const MenuItemDefinition = defineComponent()({
|
|
|
75
77
|
});
|
|
76
78
|
const MenuListBoxItemDefinition = defineComponent()({
|
|
77
79
|
styles,
|
|
80
|
+
resolveHref: true,
|
|
78
81
|
classNames: {
|
|
79
82
|
root: "bui-MenuItemListBox",
|
|
80
83
|
itemContent: "bui-MenuItemContent",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Menu/definition.ts"],"sourcesContent":["/*\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 MenuOwnProps,\n MenuListBoxOwnProps,\n MenuAutocompleteOwnProps,\n MenuAutocompleteListBoxOwnProps,\n MenuItemOwnProps,\n MenuListBoxItemOwnProps,\n MenuSectionOwnProps,\n MenuSeparatorOwnProps,\n} from './types';\nimport styles from './Menu.module.css';\n\n// Shared classNames for all popover-based menu variants\nconst menuPopoverClassNames = {\n root: 'bui-MenuPopover',\n inner: 'bui-MenuInner',\n content: 'bui-MenuContent',\n} as const;\n\n// Shared classNames for autocomplete menu variants\nconst menuAutocompleteClassNames = {\n ...menuPopoverClassNames,\n searchField: 'bui-MenuSearchField',\n searchFieldInput: 'bui-MenuSearchFieldInput',\n searchFieldClear: 'bui-MenuSearchFieldClear',\n} as const;\n\n// Shared propDefs for all popover-based menu variants\nconst menuPopoverPropDefs = {\n placement: { default: 'bottom start' },\n virtualized: { default: false },\n maxWidth: {},\n maxHeight: {},\n style: {},\n className: {},\n} as const;\n\n/**\n * Component definition for Menu\n * @public\n */\nexport const MenuDefinition = defineComponent<MenuOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: menuPopoverPropDefs,\n});\n\n/** @internal */\nexport const MenuListBoxDefinition = defineComponent<MenuListBoxOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n selectionMode: { default: 'single' },\n },\n});\n\n/** @internal */\nexport const MenuAutocompleteDefinition =\n defineComponent<MenuAutocompleteOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n },\n });\n\n/** @internal */\nexport const MenuAutocompleteListboxDefinition =\n defineComponent<MenuAutocompleteListBoxOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n selectionMode: { default: 'single' },\n },\n });\n\n/** @internal */\nexport const MenuItemDefinition = defineComponent<MenuItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuItem',\n itemContent: 'bui-MenuItemContent',\n itemArrow: 'bui-MenuItemArrow',\n },\n analytics: true,\n propDefs: {\n iconStart: {},\n children: {},\n color: { dataAttribute: true, default: 'primary' },\n href: {},\n noTrack: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const MenuListBoxItemDefinition =\n defineComponent<MenuListBoxItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuItemListBox',\n itemContent: 'bui-MenuItemContent',\n check: 'bui-MenuItemListBoxCheck',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n\n/** @internal */\nexport const MenuSectionDefinition = defineComponent<MenuSectionOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuSection',\n header: 'bui-MenuSectionHeader',\n },\n propDefs: {\n title: {},\n children: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const MenuSeparatorDefinition = defineComponent<MenuSeparatorOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-MenuSeparator',\n },\n propDefs: {\n className: {},\n },\n },\n);\n\n/** @internal */\nexport const MenuEmptyStateDefinition = defineComponent<{}>()({\n styles,\n classNames: {\n root: 'bui-MenuEmptyState',\n },\n propDefs: {},\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Menu/definition.ts"],"sourcesContent":["/*\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 MenuOwnProps,\n MenuListBoxOwnProps,\n MenuAutocompleteOwnProps,\n MenuAutocompleteListBoxOwnProps,\n MenuItemOwnProps,\n MenuListBoxItemOwnProps,\n MenuSectionOwnProps,\n MenuSeparatorOwnProps,\n} from './types';\nimport styles from './Menu.module.css';\n\n// Shared classNames for all popover-based menu variants\nconst menuPopoverClassNames = {\n root: 'bui-MenuPopover',\n inner: 'bui-MenuInner',\n content: 'bui-MenuContent',\n} as const;\n\n// Shared classNames for autocomplete menu variants\nconst menuAutocompleteClassNames = {\n ...menuPopoverClassNames,\n searchField: 'bui-MenuSearchField',\n searchFieldInput: 'bui-MenuSearchFieldInput',\n searchFieldClear: 'bui-MenuSearchFieldClear',\n} as const;\n\n// Shared propDefs for all popover-based menu variants\nconst menuPopoverPropDefs = {\n placement: { default: 'bottom start' },\n virtualized: { default: false },\n maxWidth: {},\n maxHeight: {},\n style: {},\n className: {},\n} as const;\n\n/**\n * Component definition for Menu\n * @public\n */\nexport const MenuDefinition = defineComponent<MenuOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: menuPopoverPropDefs,\n});\n\n/** @internal */\nexport const MenuListBoxDefinition = defineComponent<MenuListBoxOwnProps>()({\n styles,\n classNames: menuPopoverClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n selectionMode: { default: 'single' },\n },\n});\n\n/** @internal */\nexport const MenuAutocompleteDefinition =\n defineComponent<MenuAutocompleteOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n },\n });\n\n/** @internal */\nexport const MenuAutocompleteListboxDefinition =\n defineComponent<MenuAutocompleteListBoxOwnProps>()({\n styles,\n classNames: menuAutocompleteClassNames,\n propDefs: {\n ...menuPopoverPropDefs,\n placeholder: {},\n selectionMode: { default: 'single' },\n },\n });\n\n/** @internal */\nexport const MenuItemDefinition = defineComponent<MenuItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuItem',\n itemContent: 'bui-MenuItemContent',\n itemArrow: 'bui-MenuItemArrow',\n },\n analytics: true,\n resolveHref: true,\n propDefs: {\n iconStart: {},\n children: {},\n color: { dataAttribute: true, default: 'primary' },\n href: {},\n noTrack: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const MenuListBoxItemDefinition =\n defineComponent<MenuListBoxItemOwnProps>()({\n styles,\n resolveHref: true,\n classNames: {\n root: 'bui-MenuItemListBox',\n itemContent: 'bui-MenuItemContent',\n check: 'bui-MenuItemListBoxCheck',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n\n/** @internal */\nexport const MenuSectionDefinition = defineComponent<MenuSectionOwnProps>()({\n styles,\n classNames: {\n root: 'bui-MenuSection',\n header: 'bui-MenuSectionHeader',\n },\n propDefs: {\n title: {},\n children: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const MenuSeparatorDefinition = defineComponent<MenuSeparatorOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-MenuSeparator',\n },\n propDefs: {\n className: {},\n },\n },\n);\n\n/** @internal */\nexport const MenuEmptyStateDefinition = defineComponent<{}>()({\n styles,\n classNames: {\n root: 'bui-MenuEmptyState',\n },\n propDefs: {},\n});\n"],"names":[],"mappings":";;;;;;;;;;AA8BA,MAAM,qBAAA,GAAwB;AAAA,EAC5B,IAAA,EAAM,iBAAA;AAAA,EACN,KAAA,EAAO,eAAA;AAAA,EACP,OAAA,EAAS;AACX,CAAA;AAGA,MAAM,0BAAA,GAA6B;AAAA,EACjC,GAAG,qBAAA;AAAA,EACH,WAAA,EAAa,qBAAA;AAAA,EACb,gBAAA,EAAkB,0BAAA;AAAA,EAClB,gBAAA,EAAkB;AACpB,CAAA;AAGA,MAAM,mBAAA,GAAsB;AAAA,EAC1B,SAAA,EAAW,EAAE,OAAA,EAAS,cAAA,EAAe;AAAA,EACrC,WAAA,EAAa,EAAE,OAAA,EAAS,KAAA,EAAM;AAAA,EAC9B,UAAU,EAAC;AAAA,EACX,WAAW,EAAC;AAAA,EACZ,OAAO,EAAC;AAAA,EACR,WAAW;AACb,CAAA;AAMO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY,qBAAA;AAAA,EACZ,QAAA,EAAU;AACZ,CAAC;AAGM,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY,qBAAA;AAAA,EACZ,QAAA,EAAU;AAAA,IACR,GAAG,mBAAA;AAAA,IACH,aAAA,EAAe,EAAE,OAAA,EAAS,QAAA;AAAS;AAEvC,CAAC;AAGM,MAAM,0BAAA,GACX,iBAA0C,CAAE;AAAA,EAC1C,MAAA;AAAA,EACA,UAAA,EAAY,0BAAA;AAAA,EACZ,QAAA,EAAU;AAAA,IACR,GAAG,mBAAA;AAAA,IACH,aAAa;AAAC;AAElB,CAAC;AAGI,MAAM,iCAAA,GACX,iBAAiD,CAAE;AAAA,EACjD,MAAA;A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,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,KACR;AAAA,IACA,QAAA,EAAU;AAAA,MACR,WAAW;AAAC;AACd;AAEJ;AAGO,MAAM,wBAAA,GAA2B,iBAAoB,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,UAAU;AACZ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.esm.js","sources":["../../../src/components/PasswordField/PasswordField.tsx"],"sourcesContent":["/*\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, useState } from 'react';\nimport {\n Input,\n TextField as AriaTextField,\n Button as RAButton,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\n\nimport type { PasswordFieldProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PasswordFieldDefinition } from './definition';\nimport { RiEyeLine, RiEyeOffLine } from '@remixicon/react';\n\n
|
|
1
|
+
{"version":3,"file":"PasswordField.esm.js","sources":["../../../src/components/PasswordField/PasswordField.tsx"],"sourcesContent":["/*\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, useState } from 'react';\nimport {\n Input,\n TextField as AriaTextField,\n Button as RAButton,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\n\nimport type { PasswordFieldProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PasswordFieldDefinition } from './definition';\nimport { RiEyeLine, RiEyeOffLine } from '@remixicon/react';\n\n/**\n * A text input for password entry with a toggleable visibility button, integrated label, and inline error display.\n *\n * @public\n */\nexport const PasswordField = forwardRef<HTMLDivElement, PasswordFieldProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n PasswordFieldDefinition,\n props,\n );\n const { classes, label, icon, secondaryLabel, placeholder, description } =\n ownProps;\n\n useEffect(() => {\n if (!label && !restProps['aria-label'] && !restProps['aria-labelledby']) {\n console.warn(\n 'PasswordField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, restProps['aria-label'], restProps['aria-labelledby']]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (restProps.isRequired ? 'Required' : null);\n\n // Manage secret visibility toggle\n const [isVisible, setIsVisible] = useState(false);\n\n return (\n <AriaTextField\n className={classes.root}\n {...dataAttributes}\n type=\"password\"\n {...restProps}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={classes.inputWrapper}\n data-size={dataAttributes['data-size']}\n >\n {icon && (\n <div\n className={classes.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon}\n </div>\n )}\n <Input\n className={classes.input}\n {...(icon && { 'data-icon': true })}\n placeholder={placeholder}\n type={isVisible ? 'text' : 'password'}\n />\n <RAButton\n data-size={dataAttributes['data-size']}\n data-variant={'tertiary'}\n aria-label={isVisible ? 'Hide value' : 'Show value'}\n aria-controls={isVisible ? 'text' : 'password'}\n aria-expanded={isVisible}\n onPress={() => setIsVisible(v => !v)}\n className={classes.inputVisibility}\n >\n {isVisible ? <RiEyeLine /> : <RiEyeOffLine />}\n </RAButton>\n </div>\n <FieldError />\n </AriaTextField>\n );\n },\n);\n\nPasswordField.displayName = 'PasswordField';\n"],"names":["AriaTextField","RAButton"],"mappings":";;;;;;;;;;;AAmCO,MAAM,aAAA,GAAgB,UAAA;AAAA,EAC3B,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,MAC9C,uBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,EAAE,OAAA,EAAS,KAAA,EAAO,MAAM,cAAA,EAAgB,WAAA,EAAa,aAAY,GACrE,QAAA;AAEF,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,SAAS,CAAC,SAAA,CAAU,YAAY,CAAA,IAAK,CAAC,SAAA,CAAU,iBAAiB,CAAA,EAAG;AACvE,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,CAAU,YAAY,CAAA,EAAG,SAAA,CAAU,iBAAiB,CAAC,CAAC,CAAA;AAGjE,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,SAAA,CAAU,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAGzD,IAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,IAAA,uBACE,IAAA;AAAA,MAACA,SAAA;AAAA,MAAA;AAAA,QACC,WAAW,OAAA,CAAQ,IAAA;AAAA,QAClB,GAAG,cAAA;AAAA,QACJ,IAAA,EAAK,UAAA;AAAA,QACJ,GAAG,SAAA;AAAA,QACJ,GAAA;AAAA,QAEA,QAAA,EAAA;AAAA,0BAAA,GAAA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AA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,aAAA,CAAc,WAAA,GAAc,eAAA;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './PasswordField.module.css.esm.js';
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/PasswordField/definition.ts"],"sourcesContent":["/*\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 { PasswordFieldOwnProps } from './types';\nimport styles from './PasswordField.module.css';\n\n/**\n * Component definition for PasswordField\n * @public\n */\nexport const PasswordFieldDefinition = defineComponent<PasswordFieldOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-PasswordField',\n inputWrapper: 'bui-PasswordFieldInputWrapper',\n input: 'bui-PasswordFieldInput',\n inputIcon: 'bui-PasswordFieldIcon',\n inputVisibility: 'bui-PasswordFieldVisibility',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: {},\n label: {},\n description: {},\n secondaryLabel: {},\n },\n },\n);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/PasswordField/definition.ts"],"sourcesContent":["/*\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 { PasswordFieldOwnProps } from './types';\nimport styles from './PasswordField.module.css';\n\n/**\n * Component definition for PasswordField\n * @public\n */\nexport const PasswordFieldDefinition = defineComponent<PasswordFieldOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-PasswordField',\n inputWrapper: 'bui-PasswordFieldInputWrapper',\n input: 'bui-PasswordFieldInput',\n inputIcon: 'bui-PasswordFieldIcon',\n inputVisibility: 'bui-PasswordFieldVisibility',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: {},\n label: {},\n description: {},\n secondaryLabel: {},\n },\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,YAAA,EAAc,+BAAA;AAAA,MACd,KAAA,EAAO,wBAAA;AAAA,MACP,SAAA,EAAW,uBAAA;AAAA,MACX,eAAA,EAAiB;AAAA,KACnB;AAAA,IACA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,MAC9C,WAAW,EAAC;AAAA,MACZ,MAAM,EAAC;AAAA,MACP,aAAa,EAAC;AAAA,MACd,OAAO,EAAC;AAAA,MACR,aAAa,EAAC;AAAA,MACd,gBAAgB;AAAC;AACnB;AAEJ;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './PluginHeader.module.css.esm.js';
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/PluginHeader/definition.ts"],"sourcesContent":["/*\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 { PluginHeaderOwnProps } from './types';\nimport styles from './PluginHeader.module.css';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = defineComponent<PluginHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-PluginHeader',\n toolbar: 'bui-PluginHeaderToolbar',\n toolbarContent: 'bui-PluginHeaderToolbarContent',\n toolbarControls: 'bui-PluginHeaderToolbarControls',\n toolbarIcon: 'bui-PluginHeaderToolbarIcon',\n toolbarName: 'bui-PluginHeaderToolbarName',\n tabs: 'bui-PluginHeaderTabsWrapper',\n },\n propDefs: {\n icon: {},\n title: {},\n titleLink: {},\n customActions: {},\n tabs: {},\n onTabSelectionChange: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/PluginHeader/definition.ts"],"sourcesContent":["/*\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 { PluginHeaderOwnProps } from './types';\nimport styles from './PluginHeader.module.css';\n\n/**\n * Component definition for PluginHeader\n * @public\n */\nexport const PluginHeaderDefinition = defineComponent<PluginHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-PluginHeader',\n toolbar: 'bui-PluginHeaderToolbar',\n toolbarContent: 'bui-PluginHeaderToolbarContent',\n toolbarControls: 'bui-PluginHeaderToolbarControls',\n toolbarIcon: 'bui-PluginHeaderToolbarIcon',\n toolbarName: 'bui-PluginHeaderToolbarName',\n tabs: 'bui-PluginHeaderTabsWrapper',\n },\n propDefs: {\n icon: {},\n title: {},\n titleLink: {},\n customActions: {},\n tabs: {},\n onTabSelectionChange: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,OAAA,EAAS,yBAAA;AAAA,IACT,cAAA,EAAgB,gCAAA;AAAA,IAChB,eAAA,EAAiB,iCAAA;AAAA,IACjB,WAAA,EAAa,6BAAA;AAAA,IACb,WAAA,EAAa,6BAAA;AAAA,IACb,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,eAAe,EAAC;AAAA,IAChB,MAAM,EAAC;AAAA,IACP,sBAAsB,EAAC;AAAA,IACvB,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './Popover.module.css.esm.js';
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Popover/definition.ts"],"sourcesContent":["/*\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"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Popover/definition.ts"],"sourcesContent":["/*\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"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,iBAAA,GAAoB,iBAAiC,CAAE;AAAA,EAClE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,aAAA;AAAA,IACN,KAAA,EAAO,kBAAA;AAAA,IACP,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\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 {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { RadioGroupDefinition, RadioDefinition } from './definition';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n
|
|
1
|
+
{"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\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 {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { RadioGroupDefinition, RadioDefinition } from './definition';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n/**\n * A group of radio buttons for selecting a single option from a set, with an integrated label, description, and error display.\n *\n * @public\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioGroupDefinition, props);\n const {\n classes,\n label,\n secondaryLabel,\n description,\n isRequired,\n children,\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 'RadioGroup requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaRadioGroup className={classes.root} {...restProps} ref={ref}>\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div className={classes.content}>{children}</div>\n <FieldError />\n </AriaRadioGroup>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/**\n * A single radio button for use within a RadioGroup.\n *\n * @public\n */\nexport const Radio = forwardRef<HTMLLabelElement, RadioProps>((props, ref) => {\n const { ownProps, restProps } = useDefinition(RadioDefinition, props);\n\n return (\n <AriaRadio className={ownProps.classes.root} {...restProps} ref={ref} />\n );\n});\n\nRadio.displayName = 'Radio';\n"],"names":["AriaRadioGroup","AriaRadio"],"mappings":";;;;;;;;;;AAiCO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,GAAI,QAAA;AAEJ,IAAA,MAAM,SAAA,GAAY,UAAU,YAAY,CAAA;AACxC,IAAA,MAAM,cAAA,GAAiB,UAAU,iBAAiB,CAAA;AAElD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAGrC,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAE/C,IAAA,4BACGA,YAAA,EAAA,EAAe,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EACtD,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,KAAA;AAAA,UACA,cAAA,EAAgB,kBAAA;AAAA,UAChB;AAAA;AAAA,OACF;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,SAAU,QAAA,EAAS,CAAA;AAAA,0BAC1C,UAAA,EAAA,EAAW;AAAA,KAAA,EACd,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAOlB,MAAM,KAAA,GAAQ,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,iBAAiB,KAAK,CAAA;AAEpE,EAAA,uBACE,GAAA,CAACC,WAAU,SAAA,EAAW,QAAA,CAAS,QAAQ,IAAA,EAAO,GAAG,WAAW,GAAA,EAAU,CAAA;AAE1E,CAAC;AAED,KAAA,CAAM,WAAA,GAAc,OAAA;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './RadioGroup.module.css.esm.js';
|
|
9
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/RadioGroup/definition.ts"],"sourcesContent":["/*\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 { RadioGroupOwnProps, RadioOwnProps } from './types';\nimport styles from './RadioGroup.module.css';\n\n/**\n * Component definition for RadioGroup\n * @public\n */\nexport const RadioGroupDefinition = defineComponent<RadioGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n },\n propDefs: {\n children: {},\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n\n/**\n * Component definition for Radio\n * @public\n */\nexport const RadioDefinition = defineComponent<RadioOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Radio',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/RadioGroup/definition.ts"],"sourcesContent":["/*\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 { RadioGroupOwnProps, RadioOwnProps } from './types';\nimport styles from './RadioGroup.module.css';\n\n/**\n * Component definition for RadioGroup\n * @public\n */\nexport const RadioGroupDefinition = defineComponent<RadioGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-RadioGroup',\n content: 'bui-RadioGroupContent',\n },\n propDefs: {\n children: {},\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n\n/**\n * Component definition for Radio\n * @public\n */\nexport const RadioDefinition = defineComponent<RadioOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Radio',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;AAMM,MAAM,eAAA,GAAkB,iBAA+B,CAAE;AAAA,EAC9D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchAutocomplete.esm.js","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.tsx"],"sourcesContent":["/*\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 { Children, useRef } from 'react';\nimport { useInteractOutside } from '@react-aria/interactions';\nimport {\n Autocomplete,\n SearchField as RASearchField,\n Input,\n Button as RAButton,\n Popover as RAPopover,\n ListBox,\n ListBoxItem,\n OverlayTriggerStateContext,\n} from 'react-aria-components';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SearchAutocompleteDefinition,\n SearchAutocompleteItemDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport type {\n SearchAutocompleteProps,\n SearchAutocompleteItemProps,\n} from './types';\n\nconst SearchAutocompleteEmptyState = () => {\n const { ownProps } = useDefinition(SearchAutocompleteDefinition, {});\n return <div className={ownProps.classes.emptyState}>No results found.</div>;\n};\n\n/** @public */\nexport function SearchAutocomplete(props: SearchAutocompleteProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SearchAutocompleteDefinition,\n props,\n );\n const {\n classes,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n inputValue,\n onInputChange,\n placeholder,\n popoverWidth,\n popoverPlacement = 'bottom start',\n children,\n isLoading,\n defaultOpen,\n style,\n } = ownProps;\n\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const hasValue = !!inputValue;\n const hasChildren = Children.count(children) > 0;\n\n let liveMessage = '';\n if (isLoading) {\n liveMessage = 'Searching';\n } else if (hasValue && !hasChildren) {\n liveMessage = 'No results found';\n }\n const overlayState = useOverlayTriggerState({ defaultOpen });\n\n // Close on interact outside — same pattern as ComboBox.\n // isNonModal disables useOverlay's built-in useInteractOutside,\n // so we add our own that filters out clicks on the trigger.\n useInteractOutside({\n ref: popoverRef,\n onInteractOutside: e => {\n const target = e.target as Element;\n if (triggerRef.current?.contains(target)) {\n return;\n }\n overlayState.close();\n },\n isDisabled: !overlayState.isOpen,\n });\n\n return (\n <OverlayTriggerStateContext.Provider value={overlayState}>\n <Autocomplete\n inputValue={inputValue}\n onInputChange={value => {\n onInputChange?.(value);\n if (value) {\n overlayState.open();\n } else {\n overlayState.close();\n }\n }}\n >\n <RASearchField\n className={classes.searchField}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : placeholder)}\n aria-labelledby={ariaLabelledBy}\n data-size={dataAttributes['data-size']}\n onKeyDown={e => {\n if (e.key === 'Enter' && !overlayState.isOpen && hasValue) {\n e.preventDefault();\n overlayState.open();\n }\n }}\n >\n <div\n ref={triggerRef}\n className={classes.root}\n {...dataAttributes}\n style={style}\n >\n <div aria-hidden=\"true\">\n <RiSearch2Line />\n </div>\n <Input\n className={classes.searchFieldInput}\n placeholder={placeholder}\n />\n <RAButton\n className={classes.searchFieldClear}\n style={{ visibility: hasValue ? 'visible' : 'hidden' }}\n >\n <RiCloseCircleLine />\n </RAButton>\n </div>\n </RASearchField>\n {/* isNonModal keeps the page interactive while the popover is open,\n required for virtual focus (aria-activedescendant) to work correctly */}\n <RAPopover\n ref={popoverRef}\n className={classes.popover}\n triggerRef={triggerRef}\n isNonModal\n placement={popoverPlacement}\n {...(popoverWidth ? { style: { width: popoverWidth } } : {})}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <ListBox\n className={classes.listBox}\n autoFocus=\"first\"\n shouldFocusOnHover\n aria-busy={isLoading || undefined}\n data-stale={isLoading || undefined}\n renderEmptyState={() =>\n isLoading ? (\n <div className={classes.loadingState}>Searching...</div>\n ) : (\n <SearchAutocompleteEmptyState />\n )\n }\n onAction={() => {\n overlayState.close();\n }}\n >\n {children}\n </ListBox>\n </Box>\n </BgReset>\n </RAPopover>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {liveMessage}\n </VisuallyHidden>\n </Autocomplete>\n </OverlayTriggerStateContext.Provider>\n );\n}\n\n/** @public */\nexport function SearchAutocompleteItem(props: SearchAutocompleteItemProps) {\n const { ownProps, restProps } = useDefinition(\n SearchAutocompleteItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <ListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>{children}</div>\n </ListBoxItem>\n );\n}\n"],"names":["RASearchField","RAButton","RAPopover"],"mappings":";;;;;;;;;;;;;;AA4CA,MAAM,+BAA+B,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,4BAAA,EAA8B,EAAE,CAAA;AACnE,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,YAAY,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACvE,CAAA;AAGO,SAAS,mBAAmB,KAAA,EAAgC;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,cAAA,EAAe,GAAI,aAAA;AAAA,IACnC,4BAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA,GAAmB,cAAA;AAAA,IACnB,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AAEJ,EAAA,MAAM,UAAA,GAAa,OAA8B,IAAI,CAAA;AACrD,EAAA,MAAM,UAAA,GAAa,OAA2B,IAAI,CAAA;AAClD,EAAA,MAAM,QAAA,GAAW,CAAC,CAAC,UAAA;AACnB,EAAA,MAAM,WAAA,GAAc,QAAA,CAAS,KAAA,CAAM,QAAQ,CAAA,GAAI,CAAA;AAE/C,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,WAAA,GAAc,WAAA;AAAA,EAChB,CAAA,MAAA,IAAW,QAAA,IAAY,CAAC,WAAA,EAAa;AACnC,IAAA,WAAA,GAAc,kBAAA;AAAA,EAChB;AACA,EAAA,M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AAU,OAAA;AAAA,gBACV,kBAAA,EAAkB,IAAA;AAAA,gBAClB,aAAW,SAAA,IAAa,MAAA;AAAA,gBACxB,cAAY,SAAA,IAAa,MAAA;AAAA,gBACzB,gBAAA,EAAkB,MAChB,SAAA,mBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,YAAA,EAAc,QAAA,EAAA,cAAA,EAAY,CAAA,mBAElD,GAAA,CAAC,4BAAA,EAAA,EAA6B,CAAA;AAAA,gBAGlC,UAAU,MAAM;AACd,kBAAA,YAAA,CAAa,KAAA,EAAM;AAAA,gBACrB,CAAA;AAAA,gBAEC;AAAA;AAAA,eAEL,CAAA,EACF;AAAA;AAAA,SACF;AAAA,4BACC,cAAA,EAAA,EAAe,WAAA,EAAU,QAAA,EAAS,aAAA,EAAY,QAC5C,QAAA,EAAA,WAAA,EACH;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;AAGO,SAAS,uBAAuB,KAAA,EAAoC;AACzE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA;AAAA,IAC9B,gCAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,MACrD,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAS;AAAA;AAAA,GACjD;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"SearchAutocomplete.esm.js","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.tsx"],"sourcesContent":["/*\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 { Children, useRef } from 'react';\nimport { useInteractOutside } from '@react-aria/interactions';\nimport {\n Autocomplete,\n SearchField as RASearchField,\n Input,\n Button as RAButton,\n Popover as RAPopover,\n ListBox,\n ListBoxItem,\n OverlayTriggerStateContext,\n} from 'react-aria-components';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SearchAutocompleteDefinition,\n SearchAutocompleteItemDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { VisuallyHidden } from '../VisuallyHidden';\n\nimport type {\n SearchAutocompleteProps,\n SearchAutocompleteItemProps,\n} from './types';\n\nconst SearchAutocompleteEmptyState = () => {\n const { ownProps } = useDefinition(SearchAutocompleteDefinition, {});\n return <div className={ownProps.classes.emptyState}>No results found.</div>;\n};\n\n/**\n * A search input that shows a dropdown list of suggestions as the user types, with loading and empty states.\n *\n * @public\n */\nexport function SearchAutocomplete(props: SearchAutocompleteProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SearchAutocompleteDefinition,\n props,\n );\n const {\n classes,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n inputValue,\n onInputChange,\n placeholder,\n popoverWidth,\n popoverPlacement = 'bottom start',\n children,\n isLoading,\n defaultOpen,\n style,\n } = ownProps;\n\n const triggerRef = useRef<HTMLDivElement | null>(null);\n const popoverRef = useRef<HTMLElement | null>(null);\n const hasValue = !!inputValue;\n const hasChildren = Children.count(children) > 0;\n\n let liveMessage = '';\n if (isLoading) {\n liveMessage = 'Searching';\n } else if (hasValue && !hasChildren) {\n liveMessage = 'No results found';\n }\n const overlayState = useOverlayTriggerState({ defaultOpen });\n\n // Close on interact outside — same pattern as ComboBox.\n // isNonModal disables useOverlay's built-in useInteractOutside,\n // so we add our own that filters out clicks on the trigger.\n useInteractOutside({\n ref: popoverRef,\n onInteractOutside: e => {\n const target = e.target as Element;\n if (triggerRef.current?.contains(target)) {\n return;\n }\n overlayState.close();\n },\n isDisabled: !overlayState.isOpen,\n });\n\n return (\n <OverlayTriggerStateContext.Provider value={overlayState}>\n <Autocomplete\n inputValue={inputValue}\n onInputChange={value => {\n onInputChange?.(value);\n if (value) {\n overlayState.open();\n } else {\n overlayState.close();\n }\n }}\n >\n <RASearchField\n className={classes.searchField}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : placeholder)}\n aria-labelledby={ariaLabelledBy}\n data-size={dataAttributes['data-size']}\n onKeyDown={e => {\n if (e.key === 'Enter' && !overlayState.isOpen && hasValue) {\n e.preventDefault();\n overlayState.open();\n }\n }}\n >\n <div\n ref={triggerRef}\n className={classes.root}\n {...dataAttributes}\n style={style}\n >\n <div aria-hidden=\"true\">\n <RiSearch2Line />\n </div>\n <Input\n className={classes.searchFieldInput}\n placeholder={placeholder}\n />\n <RAButton\n className={classes.searchFieldClear}\n style={{ visibility: hasValue ? 'visible' : 'hidden' }}\n >\n <RiCloseCircleLine />\n </RAButton>\n </div>\n </RASearchField>\n {/* isNonModal keeps the page interactive while the popover is open,\n required for virtual focus (aria-activedescendant) to work correctly */}\n <RAPopover\n ref={popoverRef}\n className={classes.popover}\n triggerRef={triggerRef}\n isNonModal\n placement={popoverPlacement}\n {...(popoverWidth ? { style: { width: popoverWidth } } : {})}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.inner}>\n <ListBox\n className={classes.listBox}\n autoFocus=\"first\"\n shouldFocusOnHover\n aria-busy={isLoading || undefined}\n data-stale={isLoading || undefined}\n renderEmptyState={() =>\n isLoading ? (\n <div className={classes.loadingState}>Searching...</div>\n ) : (\n <SearchAutocompleteEmptyState />\n )\n }\n onAction={() => {\n overlayState.close();\n }}\n >\n {children}\n </ListBox>\n </Box>\n </BgReset>\n </RAPopover>\n <VisuallyHidden aria-live=\"polite\" aria-atomic=\"true\">\n {liveMessage}\n </VisuallyHidden>\n </Autocomplete>\n </OverlayTriggerStateContext.Provider>\n );\n}\n\n/**\n * An individual option item within a SearchAutocomplete dropdown.\n *\n * @public\n */\nexport function SearchAutocompleteItem(props: SearchAutocompleteItemProps) {\n const { ownProps, restProps } = useDefinition(\n SearchAutocompleteItemDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <ListBoxItem\n textValue={typeof children === 'string' ? children : undefined}\n className={classes.root}\n {...restProps}\n >\n <div className={classes.itemContent}>{children}</div>\n </ListBoxItem>\n );\n}\n"],"names":["RASearchField","RAButton","RAPopover"],"mappings":";;;;;;;;;;;;;;AA4CA,MAAM,+BAA+B,MAAM;AACzC,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,CAAc,4BAAA,EAA8B,EAAE,CAAA;AACnE,EAAA,2BAAQ,KAAA,EAAA,EAAI,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,YAAY,QAAA,EAAA,mBAAA,EAAiB,CAAA;AACvE,CAAA;AAOO,SAAS,mBAAmB,KAAA,EAAgC;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,cAAA,EAAe,GAAI,aAAA;AAAA,IACnC,4BAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA,GAAmB,cAAA;AAAA,IACnB,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA;AAA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QAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,MACrD,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,SAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAc,QAAA,EAAS;AAAA;AAAA,GACjD;AAEJ;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './SearchAutocomplete.module.css.esm.js';
|
|
9
10
|
|
|
@@ -39,6 +40,7 @@ const SearchAutocompleteDefinition = defineComponent()({
|
|
|
39
40
|
});
|
|
40
41
|
const SearchAutocompleteItemDefinition = defineComponent()({
|
|
41
42
|
styles,
|
|
43
|
+
resolveHref: true,
|
|
42
44
|
classNames: {
|
|
43
45
|
root: "bui-SearchAutocompleteItem",
|
|
44
46
|
itemContent: "bui-SearchAutocompleteItemContent"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchAutocomplete/definition.ts"],"sourcesContent":["/*\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 { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SearchAutocompleteOwnProps,\n SearchAutocompleteItemOwnProps,\n} from './types';\nimport styles from './SearchAutocomplete.module.css';\n\n/**\n * Component definition for SearchAutocomplete.\n * @public\n */\nexport const SearchAutocompleteDefinition =\n defineComponent<SearchAutocompleteOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-SearchAutocomplete',\n searchField: 'bui-SearchAutocompleteSearchField',\n searchFieldInput: 'bui-SearchAutocompleteInput',\n searchFieldClear: 'bui-SearchAutocompleteClear',\n popover: 'bui-SearchAutocompletePopover',\n inner: 'bui-SearchAutocompleteInner',\n listBox: 'bui-SearchAutocompleteListBox',\n loadingState: 'bui-SearchAutocompleteLoadingState',\n emptyState: 'bui-SearchAutocompleteEmptyState',\n },\n propDefs: {\n 'aria-label': {},\n 'aria-labelledby': {},\n size: { dataAttribute: true, default: 'small' },\n placeholder: { default: 'Search' },\n inputValue: {},\n onInputChange: {},\n popoverWidth: {},\n popoverPlacement: {},\n children: {},\n isLoading: {},\n defaultOpen: {},\n className: {},\n style: {},\n },\n });\n\n/** @internal */\nexport const SearchAutocompleteItemDefinition =\n defineComponent<SearchAutocompleteItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchAutocompleteItem',\n itemContent: 'bui-SearchAutocompleteItemContent',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchAutocomplete/definition.ts"],"sourcesContent":["/*\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 { defineComponent } from '../../hooks/useDefinition';\nimport type {\n SearchAutocompleteOwnProps,\n SearchAutocompleteItemOwnProps,\n} from './types';\nimport styles from './SearchAutocomplete.module.css';\n\n/**\n * Component definition for SearchAutocomplete.\n * @public\n */\nexport const SearchAutocompleteDefinition =\n defineComponent<SearchAutocompleteOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n root: 'bui-SearchAutocomplete',\n searchField: 'bui-SearchAutocompleteSearchField',\n searchFieldInput: 'bui-SearchAutocompleteInput',\n searchFieldClear: 'bui-SearchAutocompleteClear',\n popover: 'bui-SearchAutocompletePopover',\n inner: 'bui-SearchAutocompleteInner',\n listBox: 'bui-SearchAutocompleteListBox',\n loadingState: 'bui-SearchAutocompleteLoadingState',\n emptyState: 'bui-SearchAutocompleteEmptyState',\n },\n propDefs: {\n 'aria-label': {},\n 'aria-labelledby': {},\n size: { dataAttribute: true, default: 'small' },\n placeholder: { default: 'Search' },\n inputValue: {},\n onInputChange: {},\n popoverWidth: {},\n popoverPlacement: {},\n children: {},\n isLoading: {},\n defaultOpen: {},\n className: {},\n style: {},\n },\n });\n\n/** @internal */\nexport const SearchAutocompleteItemDefinition =\n defineComponent<SearchAutocompleteItemOwnProps>()({\n styles,\n resolveHref: true,\n classNames: {\n root: 'bui-SearchAutocompleteItem',\n itemContent: 'bui-SearchAutocompleteItemContent',\n },\n propDefs: {\n children: {},\n className: {},\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,4BAAA,GACX,iBAA4C,CAAE;AAAA,EAC5C,MAAA;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,wBAAA;AAAA,IACN,WAAA,EAAa,mCAAA;AAAA,IACb,gBAAA,EAAkB,6BAAA;AAAA,IAClB,gBAAA,EAAkB,6BAAA;AAAA,IAClB,OAAA,EAAS,+BAAA;AAAA,IACT,KAAA,EAAO,6BAAA;AAAA,IACP,OAAA,EAAS,+BAAA;AAAA,IACT,YAAA,EAAc,oCAAA;AAAA,IACd,UAAA,EAAY;AAAA,GACd;AAAA,EACA,QAAA,EAAU;AAAA,IACR,cAAc,EAAC;AAAA,IACf,mBAAmB,EAAC;AAAA,IACpB,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,YAAY,EAAC;AAAA,IACb,eAAe,EAAC;AAAA,IAChB,cAAc,EAAC;AAAA,IACf,kBAAkB,EAAC;AAAA,IACnB,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,aAAa,EAAC;AAAA,IACd,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;AAGI,MAAM,gCAAA,GACX,iBAAgD,CAAE;AAAA,EAChD,MAAA;AAAA,EACA,WAAA,EAAa,IAAA;AAAA,EACb,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,4BAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\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, useState, useRef } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SearchFieldDefinition } from './definition';\n\nimport type { SearchFieldProps } from './types';\n\n
|
|
1
|
+
{"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\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, useState, useRef } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SearchFieldDefinition } from './definition';\n\nimport type { SearchFieldProps } from './types';\n\n/**\n * A text input optimized for search queries, with a built-in clear button, optional icon, and support for a collapsible mode.\n *\n * @public\n */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SearchFieldDefinition,\n props,\n );\n const {\n classes,\n label,\n icon,\n secondaryLabel,\n placeholder,\n startCollapsed,\n description,\n } = ownProps;\n\n useEffect(() => {\n if (!label && !restProps['aria-label'] && !restProps['aria-labelledby']) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, restProps['aria-label'], restProps['aria-labelledby']]);\n\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (restProps.isRequired ? 'Required' : null);\n\n const handleFocusChange = (isFocused: boolean) => {\n restProps.onFocusChange?.(isFocused);\n setIsFocused(isFocused);\n };\n\n const handleContainerClick = () => {\n inputRef.current?.focus();\n };\n\n const hasInputRef = !!inputRef.current;\n const hasValue = !!inputRef.current?.value;\n\n const isCollapsed = hasInputRef\n ? startCollapsed && !hasValue && !isFocused\n : startCollapsed &&\n !restProps.value &&\n !restProps.defaultValue &&\n !isFocused;\n\n return (\n <AriaSearchField\n className={classes.root}\n {...dataAttributes}\n data-collapsed={isCollapsed}\n {...restProps}\n onFocusChange={handleFocusChange}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={classes.inputWrapper}\n data-size={dataAttributes['data-size']}\n onClick={handleContainerClick}\n >\n {icon !== false && (\n <div\n className={classes.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n ref={inputRef}\n className={classes.input}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={classes.clear}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["isFocused","AriaSearchField"],"mappings":";;;;;;;;;;;AAmCO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,MAC9C,qBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM;AAAA,MACJ,OAAA;AAAA,MACA,KAAA;AAAA,MACA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;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../hooks/useBreakpoint.esm.js';
|
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
6
|
import '../../analytics/useAnalytics.esm.js';
|
|
7
|
+
import 'react-router-dom';
|
|
7
8
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
8
9
|
import styles from './SearchField.module.css.esm.js';
|
|
9
10
|
|