@backstage/ui 0.17.2-next.0 → 0.18.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/analytics/useAnalytics.esm.js +5 -5
- package/dist/analytics/useAnalytics.esm.js.map +1 -1
- package/dist/components/Accordion/definition.esm.js +3 -1
- package/dist/components/Accordion/definition.esm.js.map +1 -1
- package/dist/components/Alert/definition.esm.js +3 -1
- package/dist/components/Alert/definition.esm.js.map +1 -1
- package/dist/components/Avatar/definition.esm.js +3 -1
- package/dist/components/Avatar/definition.esm.js.map +1 -1
- package/dist/components/Badge/definition.esm.js +3 -1
- package/dist/components/Badge/definition.esm.js.map +1 -1
- package/dist/components/Box/definition.esm.js +3 -1
- package/dist/components/Box/definition.esm.js.map +1 -1
- package/dist/components/Button/definition.esm.js +3 -1
- package/dist/components/Button/definition.esm.js.map +1 -1
- package/dist/components/ButtonIcon/definition.esm.js +3 -1
- package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
- package/dist/components/ButtonLink/ButtonLink.esm.js +39 -23
- package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
- package/dist/components/ButtonLink/definition.esm.js +4 -1
- package/dist/components/ButtonLink/definition.esm.js.map +1 -1
- package/dist/components/Card/Card.esm.js +2 -1
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Card/definition.esm.js +3 -1
- package/dist/components/Card/definition.esm.js.map +1 -1
- package/dist/components/Checkbox/definition.esm.js +3 -1
- package/dist/components/Checkbox/definition.esm.js.map +1 -1
- package/dist/components/CheckboxGroup/definition.esm.js +3 -1
- package/dist/components/CheckboxGroup/definition.esm.js.map +1 -1
- package/dist/components/Combobox/ComboboxItem.esm.js +37 -11
- package/dist/components/Combobox/ComboboxItem.esm.js.map +1 -1
- package/dist/components/Combobox/definition.esm.js +4 -1
- package/dist/components/Combobox/definition.esm.js.map +1 -1
- package/dist/components/Container/definition.esm.js +3 -1
- package/dist/components/Container/definition.esm.js.map +1 -1
- package/dist/components/DatePicker/definition.esm.js +3 -1
- package/dist/components/DatePicker/definition.esm.js.map +1 -1
- package/dist/components/DateRangePicker/definition.esm.js +3 -1
- package/dist/components/DateRangePicker/definition.esm.js.map +1 -1
- package/dist/components/Dialog/definition.esm.js +3 -1
- package/dist/components/Dialog/definition.esm.js.map +1 -1
- package/dist/components/FieldError/definition.esm.js +3 -1
- package/dist/components/FieldError/definition.esm.js.map +1 -1
- package/dist/components/FieldLabel/definition.esm.js +3 -1
- package/dist/components/FieldLabel/definition.esm.js.map +1 -1
- package/dist/components/Flex/definition.esm.js +3 -1
- package/dist/components/Flex/definition.esm.js.map +1 -1
- package/dist/components/FullPage/definition.esm.js +3 -1
- package/dist/components/FullPage/definition.esm.js.map +1 -1
- package/dist/components/Grid/definition.esm.js +3 -1
- package/dist/components/Grid/definition.esm.js.map +1 -1
- package/dist/components/Header/HeaderMetadataStatus.esm.js +3 -1
- package/dist/components/Header/HeaderMetadataStatus.esm.js.map +1 -1
- package/dist/components/Header/HeaderMetadataUsers.esm.js +3 -1
- package/dist/components/Header/HeaderMetadataUsers.esm.js.map +1 -1
- package/dist/components/Header/HeaderNav.esm.js +67 -24
- package/dist/components/Header/HeaderNav.esm.js.map +1 -1
- package/dist/components/Header/HeaderNavDefinition.esm.js +4 -1
- package/dist/components/Header/HeaderNavDefinition.esm.js.map +1 -1
- package/dist/components/Header/definition.esm.js +3 -1
- package/dist/components/Header/definition.esm.js.map +1 -1
- package/dist/components/Link/Link.esm.js +64 -23
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Link/definition.esm.js +4 -1
- package/dist/components/Link/definition.esm.js.map +1 -1
- package/dist/components/List/List.esm.js +3 -2
- package/dist/components/List/List.esm.js.map +1 -1
- package/dist/components/List/definition.esm.js +3 -1
- package/dist/components/List/definition.esm.js.map +1 -1
- package/dist/components/Menu/Menu.esm.js +48 -14
- package/dist/components/Menu/Menu.esm.js.map +1 -1
- package/dist/components/Menu/definition.esm.js +5 -1
- package/dist/components/Menu/definition.esm.js.map +1 -1
- package/dist/components/NumberField/definition.esm.js +3 -1
- package/dist/components/NumberField/definition.esm.js.map +1 -1
- package/dist/components/PasswordField/definition.esm.js +3 -1
- package/dist/components/PasswordField/definition.esm.js.map +1 -1
- package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js +3 -1
- package/dist/components/PluginHeader/PluginHeaderBreadcrumbs.esm.js.map +1 -1
- package/dist/components/PluginHeader/definition.esm.js +3 -1
- package/dist/components/PluginHeader/definition.esm.js.map +1 -1
- package/dist/components/Popover/definition.esm.js +3 -1
- package/dist/components/Popover/definition.esm.js.map +1 -1
- package/dist/components/RadioGroup/definition.esm.js +3 -1
- package/dist/components/RadioGroup/definition.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js +23 -5
- package/dist/components/SearchAutocomplete/SearchAutocomplete.esm.js.map +1 -1
- package/dist/components/SearchAutocomplete/definition.esm.js +4 -1
- package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
- package/dist/components/SearchField/definition.esm.js +3 -1
- package/dist/components/SearchField/definition.esm.js.map +1 -1
- package/dist/components/Select/SelectItem.esm.js +17 -3
- package/dist/components/Select/SelectItem.esm.js.map +1 -1
- package/dist/components/Select/definition.esm.js +4 -1
- package/dist/components/Select/definition.esm.js.map +1 -1
- package/dist/components/Skeleton/definition.esm.js +3 -1
- package/dist/components/Skeleton/definition.esm.js.map +1 -1
- package/dist/components/Slider/definition.esm.js +3 -1
- package/dist/components/Slider/definition.esm.js.map +1 -1
- package/dist/components/Switch/definition.esm.js +3 -1
- package/dist/components/Switch/definition.esm.js.map +1 -1
- package/dist/components/Table/components/Row.esm.js +9 -9
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/TableBodySkeleton.esm.js +3 -1
- package/dist/components/Table/components/TableBodySkeleton.esm.js.map +1 -1
- package/dist/components/Table/components/TableRoot.esm.js +3 -2
- package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
- package/dist/components/Table/definition.esm.js +3 -2
- package/dist/components/Table/definition.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +3 -1
- 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 +38 -15
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Tabs/definition.esm.js +4 -1
- package/dist/components/Tabs/definition.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.esm.js +12 -12
- package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
- package/dist/components/TagGroup/definition.esm.js +3 -2
- package/dist/components/TagGroup/definition.esm.js.map +1 -1
- package/dist/components/Text/definition.esm.js +3 -1
- package/dist/components/Text/definition.esm.js.map +1 -1
- package/dist/components/TextAreaField/definition.esm.js +3 -1
- package/dist/components/TextAreaField/definition.esm.js.map +1 -1
- package/dist/components/TextField/definition.esm.js +3 -1
- package/dist/components/TextField/definition.esm.js.map +1 -1
- package/dist/components/ToggleButton/definition.esm.js +3 -1
- package/dist/components/ToggleButton/definition.esm.js.map +1 -1
- package/dist/components/ToggleButtonGroup/definition.esm.js +3 -1
- package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
- package/dist/components/Tooltip/definition.esm.js +3 -1
- package/dist/components/Tooltip/definition.esm.js.map +1 -1
- package/dist/components/VisuallyHidden/definition.esm.js +3 -1
- package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
- package/dist/hooks/useDefinition/useDefinition.esm.js +8 -13
- package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
- package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js +50 -0
- package/dist/hooks/useDefinition/useDefinitionNavigation.esm.js.map +1 -0
- package/dist/index.d.ts +32 -8
- package/dist/navigation/BUIRoutingProvider.esm.js +44 -0
- package/dist/navigation/BUIRoutingProvider.esm.js.map +1 -0
- package/dist/navigation/useNavigation.esm.js +130 -0
- package/dist/navigation/useNavigation.esm.js.map +1 -0
- package/dist/navigation/useRouting.esm.js +27 -0
- package/dist/navigation/useRouting.esm.js.map +1 -0
- package/dist/provider/BUIContext.esm.js +6 -0
- package/dist/provider/BUIContext.esm.js.map +1 -0
- package/dist/provider/BUIProvider.esm.js +5 -13
- package/dist/provider/BUIProvider.esm.js.map +1 -1
- package/dist/utils/linkUtils.esm.js +6 -12
- package/dist/utils/linkUtils.esm.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @backstage/ui
|
|
2
2
|
|
|
3
|
+
## 0.18.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d07e99e: Updated BUI links to use the hosting application's client-side router, including relative destinations and the application's configured router base path, while preserving native browser navigation where required.
|
|
8
|
+
|
|
9
|
+
**BREAKING**: Anchor-based components no longer accept the React Aria `render` prop. BUI now owns the underlying anchor so routing behavior remains consistent across application and plugin package versions.
|
|
10
|
+
|
|
11
|
+
ListRow, Tag, and table Row now retain client-side navigation when application and plugin packages load separate React Aria copies. Their existing modifier-key, target, download, and link-metadata behavior is unchanged.
|
|
12
|
+
|
|
13
|
+
**Migration:**
|
|
14
|
+
|
|
15
|
+
Remove `render` props from ButtonLink, ComboboxItem, Link, MenuItem, MenuListBoxItem, SearchAutocompleteItem, SelectItem, and Tab. BUI now selects and renders the appropriate anchor or router link automatically.
|
|
16
|
+
|
|
17
|
+
**Affected components:** ButtonLink, Card, ComboboxItem, Header, Link, ListRow, MenuItem, MenuListBoxItem, Row, SearchAutocompleteItem, SelectItem, Tab, Tag
|
|
18
|
+
|
|
3
19
|
## 0.17.2-next.0
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { useContext, useRef } from 'react';
|
|
2
|
+
import { BUIContext } from '../provider/BUIContext.esm.js';
|
|
3
3
|
|
|
4
4
|
const noopTracker = {
|
|
5
5
|
captureEvent: () => {
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
const noopUseAnalytics = () => noopTracker;
|
|
9
|
-
const BUIContext = createVersionedContext("bui");
|
|
10
9
|
function useAnalytics() {
|
|
11
|
-
const
|
|
10
|
+
const context = useContext(BUIContext);
|
|
11
|
+
const ctx = context?.atVersion(2) ?? context?.atVersion(1);
|
|
12
12
|
const impl = ctx?.useAnalytics ?? noopUseAnalytics;
|
|
13
13
|
if (process.env.NODE_ENV !== "production") {
|
|
14
14
|
const prevImpl = useRef(impl);
|
|
@@ -22,5 +22,5 @@ function useAnalytics() {
|
|
|
22
22
|
return impl();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export {
|
|
25
|
+
export { noopTracker, useAnalytics };
|
|
26
26
|
//# sourceMappingURL=useAnalytics.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnalytics.esm.js","sources":["../../src/analytics/useAnalytics.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 { useRef } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"useAnalytics.esm.js","sources":["../../src/analytics/useAnalytics.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 { useContext, useRef } from 'react';\nimport type { AnalyticsTracker, UseAnalyticsFn } from './types';\nimport { BUIContext } from '../provider/BUIContext';\n\n/** @internal */\nexport const noopTracker: AnalyticsTracker = {\n captureEvent: () => {},\n};\n\nconst noopUseAnalytics: UseAnalyticsFn = () => noopTracker;\n\n/**\n * Returns an AnalyticsTracker for capturing analytics events.\n *\n * By default returns a noop tracker. When a `BUIProvider` is present\n * in the tree, returns the tracker provided by the consumer's hook.\n *\n * @public\n */\nexport function useAnalytics(): AnalyticsTracker {\n const context = useContext(BUIContext);\n const ctx = context?.atVersion(2) ?? context?.atVersion(1);\n const impl = ctx?.useAnalytics ?? noopUseAnalytics;\n\n if (process.env.NODE_ENV !== 'production') {\n const prevImpl = useRef(impl);\n if (\n (prevImpl.current === noopUseAnalytics) !==\n (impl === noopUseAnalytics)\n ) {\n throw new Error(\n '@backstage/ui: The analytics hook changed between a noop and a real ' +\n 'implementation. Ensure <BUIProvider> wraps all BUI components from first render.',\n );\n }\n prevImpl.current = impl;\n }\n\n return impl();\n}\n"],"names":[],"mappings":";;;AAqBO,MAAM,WAAA,GAAgC;AAAA,EAC3C,cAAc,MAAM;AAAA,EAAC;AACvB;AAEA,MAAM,mBAAmC,MAAM,WAAA;AAUxC,SAAS,YAAA,GAAiC;AAC/C,EAAA,MAAM,OAAA,GAAU,WAAW,UAAU,CAAA;AACrC,EAAA,MAAM,MAAM,OAAA,EAAS,SAAA,CAAU,CAAC,CAAA,IAAK,OAAA,EAAS,UAAU,CAAC,CAAA;AACzD,EAAA,MAAM,IAAA,GAAO,KAAK,YAAA,IAAgB,gBAAA;AAElC,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,EAAc;AACzC,IAAA,MAAM,QAAA,GAAW,OAAO,IAAI,CAAA;AAC5B,IAAA,IACG,QAAA,CAAS,OAAA,KAAY,gBAAA,MACrB,IAAA,KAAS,gBAAA,CAAA,EACV;AACA,MAAA,MAAM,IAAI,KAAA;AAAA,QACR;AAAA,OAEF;AAAA,IACF;AACA,IAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AAAA,EACrB;AAEA,EAAA,OAAO,IAAA,EAAK;AACd;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Accordion.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Accordion/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 AccordionOwnProps,\n AccordionTriggerOwnProps,\n AccordionPanelOwnProps,\n AccordionGroupOwnProps,\n} from './types';\nimport styles from './Accordion.module.css';\n\n/**\n * Component definition for Accordion\n * @public\n */\nexport const AccordionDefinition = defineComponent<AccordionOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Accordion',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true, default: 'neutral' },\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for AccordionTrigger\n * @public\n */\nexport const AccordionTriggerDefinition =\n defineComponent<AccordionTriggerOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AccordionTrigger',\n button: 'bui-AccordionTriggerButton',\n title: 'bui-AccordionTriggerTitle',\n subtitle: 'bui-AccordionTriggerSubtitle',\n icon: 'bui-AccordionTriggerIcon',\n },\n propDefs: {\n className: {},\n title: {},\n subtitle: {},\n children: {},\n },\n });\n\n/**\n * Component definition for AccordionPanel\n * @public\n */\nexport const AccordionPanelDefinition =\n defineComponent<AccordionPanelOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AccordionPanel',\n },\n propDefs: {\n className: {},\n },\n });\n\n/**\n * Component definition for AccordionGroup\n * @public\n */\nexport const AccordionGroupDefinition =\n defineComponent<AccordionGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AccordionGroup',\n },\n propDefs: {\n className: {},\n allowsMultiple: { default: false },\n },\n });\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Accordion/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 AccordionOwnProps,\n AccordionTriggerOwnProps,\n AccordionPanelOwnProps,\n AccordionGroupOwnProps,\n} from './types';\nimport styles from './Accordion.module.css';\n\n/**\n * Component definition for Accordion\n * @public\n */\nexport const AccordionDefinition = defineComponent<AccordionOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Accordion',\n },\n bg: 'provider',\n propDefs: {\n bg: { dataAttribute: true, default: 'neutral' },\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for AccordionTrigger\n * @public\n */\nexport const AccordionTriggerDefinition =\n defineComponent<AccordionTriggerOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AccordionTrigger',\n button: 'bui-AccordionTriggerButton',\n title: 'bui-AccordionTriggerTitle',\n subtitle: 'bui-AccordionTriggerSubtitle',\n icon: 'bui-AccordionTriggerIcon',\n },\n propDefs: {\n className: {},\n title: {},\n subtitle: {},\n children: {},\n },\n });\n\n/**\n * Component definition for AccordionPanel\n * @public\n */\nexport const AccordionPanelDefinition =\n defineComponent<AccordionPanelOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AccordionPanel',\n },\n propDefs: {\n className: {},\n },\n });\n\n/**\n * Component definition for AccordionGroup\n * @public\n */\nexport const AccordionGroupDefinition =\n defineComponent<AccordionGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AccordionGroup',\n },\n propDefs: {\n className: {},\n allowsMultiple: { default: false },\n },\n });\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BO,MAAM,mBAAA,GAAsB,iBAAmC,CAAE;AAAA,EACtE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IAC9C,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,0BAAA,GACX,iBAA0C,CAAE;AAAA,EAC1C,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,sBAAA;AAAA,IACN,MAAA,EAAQ,4BAAA;AAAA,IACR,KAAA,EAAO,2BAAA;AAAA,IACP,QAAA,EAAU,8BAAA;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,UAAU;AAAC;AAEf,CAAC;AAMI,MAAM,wBAAA,GACX,iBAAwC,CAAE;AAAA,EACxC,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;AAMI,MAAM,wBAAA,GACX,iBAAwC,CAAE;AAAA,EACxC,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,cAAA,EAAgB,EAAE,OAAA,EAAS,KAAA;AAAM;AAErC,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Alert.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Alert/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 { AlertOwnProps } from './types';\nimport styles from './Alert.module.css';\n\n/**\n * Component definition for Alert\n * @public\n */\nexport const AlertDefinition = defineComponent<AlertOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Alert',\n contentWrapper: 'bui-AlertContentWrapper',\n content: 'bui-AlertContent',\n title: 'bui-AlertTitle',\n description: 'bui-AlertDescription',\n icon: 'bui-AlertIcon',\n spinner: 'bui-AlertSpinner',\n actions: 'bui-AlertActions',\n },\n propDefs: {\n status: { dataAttribute: true, default: 'info' },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n icon: {},\n customActions: {},\n title: {},\n description: {},\n className: {},\n style: {},\n },\n utilityProps: ['m', 'mb', 'ml', 'mr', 'mt', 'mx', 'my'],\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Alert/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 { AlertOwnProps } from './types';\nimport styles from './Alert.module.css';\n\n/**\n * Component definition for Alert\n * @public\n */\nexport const AlertDefinition = defineComponent<AlertOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Alert',\n contentWrapper: 'bui-AlertContentWrapper',\n content: 'bui-AlertContent',\n title: 'bui-AlertTitle',\n description: 'bui-AlertDescription',\n icon: 'bui-AlertIcon',\n spinner: 'bui-AlertSpinner',\n actions: 'bui-AlertActions',\n },\n propDefs: {\n status: { dataAttribute: true, default: 'info' },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n icon: {},\n customActions: {},\n title: {},\n description: {},\n className: {},\n style: {},\n },\n utilityProps: ['m', 'mb', 'ml', 'mr', 'mt', 'mx', 'my'],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,eAAA,GAAkB,iBAA+B,CAAE;AAAA,EAC9D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,WAAA;AAAA,IACN,cAAA,EAAgB,yBAAA;AAAA,IAChB,OAAA,EAAS,kBAAA;AAAA,IACT,KAAA,EAAO,gBAAA;AAAA,IACP,WAAA,EAAa,sBAAA;AAAA,IACb,IAAA,EAAM,eAAA;AAAA,IACN,OAAA,EAAS,kBAAA;AAAA,IACT,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAA,EAAQ,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,MAAA,EAAO;AAAA,IAC/C,SAAA,EAAW,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IACjC,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC/B,MAAM,EAAC;AAAA,IACP,eAAe,EAAC;AAAA,IAChB,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc,CAAC,GAAA,EAAK,IAAA,EAAM,MAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI;AACxD,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Avatar.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Avatar/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 { AvatarOwnProps } from './types';\nimport styles from './Avatar.module.css';\n\n/**\n * Component definition for Avatar\n * @public\n */\nexport const AvatarDefinition = defineComponent<AvatarOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AvatarRoot',\n image: 'bui-AvatarImage',\n fallback: 'bui-AvatarFallback',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'medium' },\n purpose: { default: 'informative' },\n src: {},\n name: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Avatar/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 { AvatarOwnProps } from './types';\nimport styles from './Avatar.module.css';\n\n/**\n * Component definition for Avatar\n * @public\n */\nexport const AvatarDefinition = defineComponent<AvatarOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AvatarRoot',\n image: 'bui-AvatarImage',\n fallback: 'bui-AvatarFallback',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'medium' },\n purpose: { default: 'informative' },\n src: {},\n name: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,KAAA,EAAO,iBAAA;AAAA,IACP,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,QAAA,EAAS;AAAA,IAC/C,OAAA,EAAS,EAAE,OAAA,EAAS,aAAA,EAAc;AAAA,IAClC,KAAK,EAAC;AAAA,IACN,MAAM,EAAC;AAAA,IACP,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Badge.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Badge/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 { BadgeOwnProps } from './types';\nimport styles from './Badge.module.css';\n\n/**\n * Component definition for Badge\n * @public\n */\nexport const BadgeDefinition = defineComponent<BadgeOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Badge',\n icon: 'bui-BadgeIcon',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Badge/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 { BadgeOwnProps } from './types';\nimport styles from './Badge.module.css';\n\n/**\n * Component definition for Badge\n * @public\n */\nexport const BadgeDefinition = defineComponent<BadgeOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Badge',\n icon: 'bui-BadgeIcon',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,eAAA,GAAkB,iBAA+B,CAAE;AAAA,EAC9D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,WAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Box.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Box/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 { BoxOwnProps } from './types';\nimport styles from './Box.module.css';\n\n/**\n * Component definition for Box\n * @public\n */\nexport const BoxDefinition = defineComponent<BoxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Box',\n },\n bg: 'provider',\n propDefs: {\n as: { default: 'div' },\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'position',\n 'display',\n 'grow',\n 'shrink',\n 'basis',\n 'width',\n 'minWidth',\n 'maxWidth',\n 'height',\n 'minHeight',\n 'maxHeight',\n ],\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Box/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 { BoxOwnProps } from './types';\nimport styles from './Box.module.css';\n\n/**\n * Component definition for Box\n * @public\n */\nexport const BoxDefinition = defineComponent<BoxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Box',\n },\n bg: 'provider',\n propDefs: {\n as: { default: 'div' },\n bg: { dataAttribute: true },\n children: {},\n className: {},\n style: {},\n },\n utilityProps: [\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'position',\n 'display',\n 'grow',\n 'shrink',\n 'basis',\n 'width',\n 'minWidth',\n 'maxWidth',\n 'height',\n 'minHeight',\n 'maxHeight',\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,aAAA,GAAgB,iBAA6B,CAAE;AAAA,EAC1D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,EAAE,OAAA,EAAS,KAAA,EAAM;AAAA,IACrB,EAAA,EAAI,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC1B,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Button.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Button/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 { ButtonOwnProps } from './types';\nimport styles from './Button.module.css';\n\n/**\n * Component definition for Button\n * @public\n */\nexport const ButtonDefinition = defineComponent<ButtonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Button',\n content: 'bui-ButtonContent',\n spinner: 'bui-ButtonSpinner',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n destructive: { dataAttribute: true },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Button/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 { ButtonOwnProps } from './types';\nimport styles from './Button.module.css';\n\n/**\n * Component definition for Button\n * @public\n */\nexport const ButtonDefinition = defineComponent<ButtonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Button',\n content: 'bui-ButtonContent',\n spinner: 'bui-ButtonSpinner',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n destructive: { dataAttribute: true },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\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,OAAA,EAAS;AAAA,GACX;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACnD,WAAA,EAAa,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IACnC,SAAA,EAAW,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IACjC,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC/B,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './ButtonIcon.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonIcon/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 { ButtonIconOwnProps } from './types';\nimport styles from './ButtonIcon.module.css';\n\n/**\n * Component definition for ButtonIcon\n * @public\n */\nexport const ButtonIconDefinition = defineComponent<ButtonIconOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonIcon',\n content: 'bui-ButtonIconContent',\n spinner: 'bui-ButtonIconSpinner',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n icon: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonIcon/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 { ButtonIconOwnProps } from './types';\nimport styles from './ButtonIcon.module.css';\n\n/**\n * Component definition for ButtonIcon\n * @public\n */\nexport const ButtonIconDefinition = defineComponent<ButtonIconOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonIcon',\n content: 'bui-ButtonIconContent',\n spinner: 'bui-ButtonIconSpinner',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n icon: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS,uBAAA;AAAA,IACT,OAAA,EAAS;AAAA,GACX;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACnD,SAAA,EAAW,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IACjC,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAC/B,MAAM,EAAC;AAAA,IACP,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -4,34 +4,50 @@ import { Link } from 'react-aria-components';
|
|
|
4
4
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
5
5
|
import { ButtonLinkDefinition } from './definition.esm.js';
|
|
6
6
|
import { getNodeText } from '../../analytics/getNodeText.esm.js';
|
|
7
|
+
import { getReactAriaAnchorProps } from '../../navigation/useNavigation.esm.js';
|
|
7
8
|
|
|
9
|
+
function ButtonLinkView({
|
|
10
|
+
definitionResult,
|
|
11
|
+
navigation,
|
|
12
|
+
forwardedRef
|
|
13
|
+
}) {
|
|
14
|
+
const { ownProps, restProps, dataAttributes, analytics } = definitionResult;
|
|
15
|
+
const { classes, iconStart, iconEnd, children } = ownProps;
|
|
16
|
+
const navigationProps = restProps.isDisabled ? { href: void 0, routerOptions: void 0, render: void 0 } : getReactAriaAnchorProps(navigation, restProps);
|
|
17
|
+
const handlePress = (e) => {
|
|
18
|
+
restProps.onPress?.(e);
|
|
19
|
+
const text = restProps["aria-label"] ?? getNodeText(children) ?? String(restProps.href ?? "");
|
|
20
|
+
analytics.captureEvent("click", text, {
|
|
21
|
+
attributes: { to: String(restProps.href ?? "") }
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
Link,
|
|
26
|
+
{
|
|
27
|
+
className: classes.root,
|
|
28
|
+
ref: forwardedRef,
|
|
29
|
+
...dataAttributes,
|
|
30
|
+
...restProps,
|
|
31
|
+
...navigationProps,
|
|
32
|
+
onPress: handlePress,
|
|
33
|
+
children: /* @__PURE__ */ jsxs("span", { className: classes.content, children: [
|
|
34
|
+
iconStart,
|
|
35
|
+
children,
|
|
36
|
+
iconEnd
|
|
37
|
+
] })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
8
41
|
const ButtonLink = forwardRef(
|
|
9
42
|
(props, ref) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
props
|
|
13
|
-
);
|
|
14
|
-
const { classes, iconStart, iconEnd, children } = ownProps;
|
|
15
|
-
const handlePress = (e) => {
|
|
16
|
-
restProps.onPress?.(e);
|
|
17
|
-
const text = restProps["aria-label"] ?? getNodeText(children) ?? String(restProps.href ?? "");
|
|
18
|
-
analytics.captureEvent("click", text, {
|
|
19
|
-
attributes: { to: String(restProps.href ?? "") }
|
|
20
|
-
});
|
|
21
|
-
};
|
|
43
|
+
const definitionResult = useDefinition(ButtonLinkDefinition, props);
|
|
44
|
+
const Navigation = definitionResult.navigation;
|
|
22
45
|
return /* @__PURE__ */ jsx(
|
|
23
|
-
|
|
46
|
+
Navigation,
|
|
24
47
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...restProps,
|
|
29
|
-
onPress: handlePress,
|
|
30
|
-
children: /* @__PURE__ */ jsxs("span", { className: classes.content, children: [
|
|
31
|
-
iconStart,
|
|
32
|
-
children,
|
|
33
|
-
iconEnd
|
|
34
|
-
] })
|
|
48
|
+
props: definitionResult.restProps,
|
|
49
|
+
view: ButtonLinkView,
|
|
50
|
+
viewProps: { definitionResult, forwardedRef: ref }
|
|
35
51
|
}
|
|
36
52
|
);
|
|
37
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLink.esm.js","sources":["../../../src/components/ButtonLink/ButtonLink.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, Ref } from 'react';\nimport { Link as RALink } from 'react-aria-components';\nimport type { ButtonLinkProps } from './types';\nimport {
|
|
1
|
+
{"version":3,"file":"ButtonLink.esm.js","sources":["../../../src/components/ButtonLink/ButtonLink.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, Ref } from 'react';\nimport { Link as RALink } from 'react-aria-components';\nimport type { ButtonLinkProps } from './types';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport { ButtonLinkDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype ButtonLinkViewProps = {\n definitionResult: UseDefinitionResult<\n typeof ButtonLinkDefinition,\n ButtonLinkProps\n >;\n navigation: AnchorNavigation;\n forwardedRef: Ref<HTMLAnchorElement>;\n};\n\nfunction ButtonLinkView({\n definitionResult,\n navigation,\n forwardedRef,\n}: ButtonLinkViewProps) {\n const { ownProps, restProps, dataAttributes, analytics } = definitionResult;\n const { classes, iconStart, iconEnd, children } = ownProps;\n const navigationProps = restProps.isDisabled\n ? { href: undefined, routerOptions: undefined, render: undefined }\n : getReactAriaAnchorProps(navigation, restProps);\n\n const handlePress: typeof restProps.onPress = e => {\n restProps.onPress?.(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 <RALink\n className={classes.root}\n ref={forwardedRef}\n {...dataAttributes}\n {...restProps}\n {...navigationProps}\n onPress={handlePress}\n >\n <span className={classes.content}>\n {iconStart}\n {children}\n {iconEnd}\n </span>\n </RALink>\n );\n}\n\n/**\n * A button-styled anchor element for navigation, supporting optional start and end icon slots and analytics event tracking.\n *\n * @public\n */\nexport const ButtonLink = forwardRef(\n (props: ButtonLinkProps, ref: Ref<HTMLAnchorElement>) => {\n const definitionResult = useDefinition(ButtonLinkDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={ButtonLinkView}\n viewProps={{ definitionResult, forwardedRef: ref }}\n />\n );\n },\n);\n\nButtonLink.displayName = 'ButtonLink';\n"],"names":["RALink"],"mappings":";;;;;;;;AAuCA,SAAS,cAAA,CAAe;AAAA,EACtB,gBAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAAwB;AACtB,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,WAAU,GAAI,gBAAA;AAC3D,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAW,OAAA,EAAS,UAAS,GAAI,QAAA;AAClD,EAAA,MAAM,eAAA,GAAkB,SAAA,CAAU,UAAA,GAC9B,EAAE,IAAA,EAAM,MAAA,EAAW,aAAA,EAAe,MAAA,EAAW,MAAA,EAAQ,MAAA,EAAU,GAC/D,uBAAA,CAAwB,YAAY,SAAS,CAAA;AAEjD,EAAA,MAAM,cAAwC,CAAA,CAAA,KAAK;AACjD,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,IAACA,IAAA;AAAA,IAAA;AAAA,MACC,WAAW,OAAA,CAAQ,IAAA;AAAA,MACnB,GAAA,EAAK,YAAA;AAAA,MACJ,GAAG,cAAA;AAAA,MACH,GAAG,SAAA;AAAA,MACH,GAAG,eAAA;AAAA,MACJ,OAAA,EAAS,WAAA;AAAA,MAET,QAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,OAAA,CAAQ,OAAA,EACtB,QAAA,EAAA;AAAA,QAAA,SAAA;AAAA,QACA,QAAA;AAAA,QACA;AAAA,OAAA,EACH;AAAA;AAAA,GACF;AAEJ;AAOO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,gBAAA,GAAmB,aAAA,CAAc,oBAAA,EAAsB,KAAK,CAAA;AAClE,IAAA,MAAM,aAAa,gBAAA,CAAiB,UAAA;AAEpC,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAO,gBAAA,CAAiB,SAAA;AAAA,QACxB,IAAA,EAAM,cAAA;AAAA,QACN,SAAA,EAAW,EAAE,gBAAA,EAAkB,YAAA,EAAc,GAAA;AAAI;AAAA,KACnD;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './ButtonLink.module.css.esm.js';
|
|
10
12
|
|
|
@@ -16,6 +18,7 @@ const ButtonLinkDefinition = defineComponent()({
|
|
|
16
18
|
},
|
|
17
19
|
bg: "consumer",
|
|
18
20
|
analytics: true,
|
|
21
|
+
navigation: { type: "anchor" },
|
|
19
22
|
propDefs: {
|
|
20
23
|
noTrack: {},
|
|
21
24
|
size: { dataAttribute: true, default: "small" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonLink/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 { ButtonLinkOwnProps } from './types';\nimport styles from './ButtonLink.module.css';\n\n/**\n * Component definition for ButtonLink\n * @public\n */\nexport const ButtonLinkDefinition = defineComponent<ButtonLinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonLink',\n content: 'bui-ButtonLinkContent',\n },\n bg: 'consumer',\n analytics: true,\n propDefs: {\n noTrack: {},\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonLink/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 { ButtonLinkOwnProps } from './types';\nimport styles from './ButtonLink.module.css';\n\n/**\n * Component definition for ButtonLink\n * @public\n */\nexport const ButtonLinkDefinition = defineComponent<ButtonLinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonLink',\n content: 'bui-ButtonLinkContent',\n },\n bg: 'consumer',\n analytics: true,\n navigation: { type: 'anchor' },\n propDefs: {\n noTrack: {},\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n iconStart: {},\n iconEnd: {},\n children: {},\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,EAAA,EAAI,UAAA;AAAA,EACJ,SAAA,EAAW,IAAA;AAAA,EACX,UAAA,EAAY,EAAE,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,QAAA,EAAU;AAAA,IACR,SAAS,EAAC;AAAA,IACV,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACnD,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.esm.js","sources":["../../../src/components/Card/Card.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, useCallback, useRef } from 'react';\nimport { Button as RAButton } from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\nimport { Link } from '../Link';\n\nconst INTERACTIVE_ELEMENT_SELECTOR =\n 'a[href],button,input,select,textarea,[role=\"button\"],[role=\"link\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, utilityStyle } = useDefinition(\n CardDefinition,\n props,\n );\n const {\n classes,\n children,\n onPress,\n href,\n label,\n target: linkTarget,\n rel,\n download,\n } = ownProps;\n const isInteractive = !!(onPress || href);\n\n const triggerRef = useRef<HTMLAnchorElement | HTMLButtonElement>(null);\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (!isInteractive || !triggerRef.current) return;\n\n // Don't delegate if the click target is the trigger itself\n if (triggerRef.current.contains(e.target as Node)) return;\n\n // Don't delegate if the user clicked a nested interactive element\n const targetNode = e.target as Node | null;\n const targetElement =\n targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;\n\n // Don't delegate if the user is selecting text\n if (window.getSelection()?.toString()) return;\n\n triggerRef.current.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n }),\n );\n },\n [isInteractive],\n );\n\n return (\n <Box\n as=\"article\"\n bg=\"neutral\"\n ref={ref}\n className={classes.root}\n data-interactive={isInteractive || undefined}\n {...dataAttributes}\n {...restProps}\n onClick={isInteractive ? handleClick : undefined}\n style={{ ...utilityStyle, ...ownProps.style }}\n >\n {href && (\n <Link\n ref={triggerRef as React.Ref<HTMLAnchorElement>}\n className={classes.trigger}\n href={href}\n target={linkTarget}\n rel={rel}\n download={download}\n aria-label={label}\n />\n )}\n {onPress && !href && (\n <RAButton\n ref={triggerRef as React.Ref<HTMLButtonElement>}\n className={classes.trigger}\n onPress={onPress}\n aria-label={label}\n />\n )}\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n"],"names":["RAButton"],"mappings":";;;;;;;;;AAkCA,MAAM,4BAAA,GACJ,oGAAA;AAOK,MAAM,IAAA,GAAO,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,cAAa,GAAI,aAAA;AAAA,IAC5D,cAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA,EAAQ,UAAA;AAAA,IACR,GAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AACJ,EAAA,MAAM,aAAA,GAAgB,CAAC,EAAE,OAAA,IAAW,IAAA,CAAA;AAEpC,EAAA,MAAM,UAAA,GAAa,OAA8C,IAAI,CAAA;AAErE,EAAA,MAAM,WAAA,GAAc,WAAA;AAAA,IAClB,CAAC,CAAA,KAAwC;AACvC,MAAA,IAAI,CAAC,aAAA,IAAiB,CAAC,UAAA,CAAW,OAAA,EAAS;AAG3C,MAAA,IAAI,UAAA,CAAW,OAAA,CAAQ,QAAA,CAAS,CAAA,CAAE,MAAc,CAAA,EAAG;AAGnD,MAAA,MAAM,aAAa,CAAA,CAAE,MAAA;AACrB,MAAA,MAAM,aAAA,GACJ,UAAA,YAAsB,OAAA,GAAU,UAAA,GAAa,UAAA,EAAY,aAAA;AAC3D,MAAA,IAAI,aAAA,EAAe,OAAA,CAAQ,4BAA4B,CAAA,EAAG;AAG1D,MAAA,IAAI,MAAA,CAAO,YAAA,EAAa,EAAG,QAAA,EAAS,EAAG;AAEvC,MAAA,UAAA,CAAW,OAAA,CAAQ,aAAA;AAAA,QACjB,IAAI,WAAW,OAAA,EAAS;AAAA,UACtB,OAAA,EAAS,IAAA;AAAA,UACT,UAAA,EAAY,IAAA;AAAA,UACZ,SAAS,CAAA,CAAE,OAAA;AAAA,UACX,SAAS,CAAA,CAAE,OAAA;AAAA,UACX,UAAU,CAAA,CAAE;AAAA,
|
|
1
|
+
{"version":3,"file":"Card.esm.js","sources":["../../../src/components/Card/Card.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, useCallback, useRef } from 'react';\nimport { Button as RAButton } from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\nimport { Link } from '../Link';\n\nconst INTERACTIVE_ELEMENT_SELECTOR =\n 'a[href],button,input,select,textarea,[role=\"button\"],[role=\"link\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, utilityStyle } = useDefinition(\n CardDefinition,\n props,\n );\n const {\n classes,\n children,\n onPress,\n href,\n label,\n target: linkTarget,\n rel,\n download,\n } = ownProps;\n const isInteractive = !!(onPress || href);\n\n const triggerRef = useRef<HTMLAnchorElement | HTMLButtonElement>(null);\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (!isInteractive || !triggerRef.current) return;\n\n // Don't delegate if the click target is the trigger itself\n if (triggerRef.current.contains(e.target as Node)) return;\n\n // Don't delegate if the user clicked a nested interactive element\n const targetNode = e.target as Node | null;\n const targetElement =\n targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;\n\n // Don't delegate if the user is selecting text\n if (window.getSelection()?.toString()) return;\n\n triggerRef.current.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n altKey: e.altKey,\n }),\n );\n },\n [isInteractive],\n );\n\n return (\n <Box\n as=\"article\"\n bg=\"neutral\"\n ref={ref}\n className={classes.root}\n data-interactive={isInteractive || undefined}\n {...dataAttributes}\n {...restProps}\n onClick={isInteractive ? handleClick : undefined}\n style={{ ...utilityStyle, ...ownProps.style }}\n >\n {href && (\n <Link\n ref={triggerRef as React.Ref<HTMLAnchorElement>}\n className={classes.trigger}\n href={href}\n target={linkTarget}\n rel={rel}\n download={download}\n aria-label={label}\n />\n )}\n {onPress && !href && (\n <RAButton\n ref={triggerRef as React.Ref<HTMLButtonElement>}\n className={classes.trigger}\n onPress={onPress}\n aria-label={label}\n />\n )}\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n"],"names":["RAButton"],"mappings":";;;;;;;;;AAkCA,MAAM,4BAAA,GACJ,oGAAA;AAOK,MAAM,IAAA,GAAO,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,cAAa,GAAI,aAAA;AAAA,IAC5D,cAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA,EAAQ,UAAA;AAAA,IACR,GAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AACJ,EAAA,MAAM,aAAA,GAAgB,CAAC,EAAE,OAAA,IAAW,IAAA,CAAA;AAEpC,EAAA,MAAM,UAAA,GAAa,OAA8C,IAAI,CAAA;AAErE,EAAA,MAAM,WAAA,GAAc,WAAA;AAAA,IAClB,CAAC,CAAA,KAAwC;AACvC,MAAA,IAAI,CAAC,aAAA,IAAiB,CAAC,UAAA,CAAW,OAAA,EAAS;AAG3C,MAAA,IAAI,UAAA,CAAW,OAAA,CAAQ,QAAA,CAAS,CAAA,CAAE,MAAc,CAAA,EAAG;AAGnD,MAAA,MAAM,aAAa,CAAA,CAAE,MAAA;AACrB,MAAA,MAAM,aAAA,GACJ,UAAA,YAAsB,OAAA,GAAU,UAAA,GAAa,UAAA,EAAY,aAAA;AAC3D,MAAA,IAAI,aAAA,EAAe,OAAA,CAAQ,4BAA4B,CAAA,EAAG;AAG1D,MAAA,IAAI,MAAA,CAAO,YAAA,EAAa,EAAG,QAAA,EAAS,EAAG;AAEvC,MAAA,UAAA,CAAW,OAAA,CAAQ,aAAA;AAAA,QACjB,IAAI,WAAW,OAAA,EAAS;AAAA,UACtB,OAAA,EAAS,IAAA;AAAA,UACT,UAAA,EAAY,IAAA;AAAA,UACZ,SAAS,CAAA,CAAE,OAAA;AAAA,UACX,SAAS,CAAA,CAAE,OAAA;AAAA,UACX,UAAU,CAAA,CAAE,QAAA;AAAA,UACZ,QAAQ,CAAA,CAAE;AAAA,SACX;AAAA,OACH;AAAA,IACF,CAAA;AAAA,IACA,CAAC,aAAa;AAAA,GAChB;AAEA,EAAA,uBACE,IAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAG,SAAA;AAAA,MACH,EAAA,EAAG,SAAA;AAAA,MACH,GAAA;AAAA,MACA,WAAW,OAAA,CAAQ,IAAA;AAAA,MACnB,oBAAkB,aAAA,IAAiB,MAAA;AAAA,MAClC,GAAG,cAAA;AAAA,MACH,GAAG,SAAA;AAAA,MACJ,OAAA,EAAS,gBAAgB,WAAA,GAAc,MAAA;AAAA,MACvC,OAAO,EAAE,GAAG,YAAA,EAAc,GAAG,SAAS,KAAA,EAAM;AAAA,MAE3C,QAAA,EAAA;AAAA,QAAA,IAAA,oBACC,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,UAAA;AAAA,YACL,WAAW,OAAA,CAAQ,OAAA;AAAA,YACnB,IAAA;AAAA,YACA,MAAA,EAAQ,UAAA;AAAA,YACR,GAAA;AAAA,YACA,QAAA;AAAA,YACA,YAAA,EAAY;AAAA;AAAA,SACd;AAAA,QAED,OAAA,IAAW,CAAC,IAAA,oBACX,GAAA;AAAA,UAACA,MAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,UAAA;AAAA,YACL,WAAW,OAAA,CAAQ,OAAA;AAAA,YACnB,OAAA;AAAA,YACA,YAAA,EAAY;AAAA;AAAA,SACd;AAAA,QAED;AAAA;AAAA;AAAA,GACH;AAEJ,CAAC;AAED,IAAA,CAAK,WAAA,GAAc,MAAA;AAOZ,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,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAOlB,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,oBAAoB,KAAK,CAAA;AACvE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA;AAOhB,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,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Card.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Card/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 CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n trigger: 'bui-CardTrigger',\n },\n propDefs: {\n children: {},\n className: {},\n onPress: {},\n href: {},\n label: {},\n target: {},\n rel: {},\n download: {},\n style: {},\n },\n utilityProps: ['grow', 'shrink', 'basis'],\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Card/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 CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n trigger: 'bui-CardTrigger',\n },\n propDefs: {\n children: {},\n className: {},\n onPress: {},\n href: {},\n label: {},\n target: {},\n rel: {},\n download: {},\n style: {},\n },\n utilityProps: ['grow', 'shrink', 'basis'],\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,UAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,KAAK,EAAC;AAAA,IACN,UAAU,EAAC;AAAA,IACX,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc,CAAC,MAAA,EAAQ,QAAA,EAAU,OAAO;AAC1C,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './Checkbox.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Checkbox/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 { CheckboxOwnProps } from './types';\nimport styles from './Checkbox.module.css';\n\n/**\n * Component definition for Checkbox\n * @public\n */\nexport const CheckboxDefinition = defineComponent<CheckboxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Checkbox',\n indicator: 'bui-CheckboxIndicator',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Checkbox/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 { CheckboxOwnProps } from './types';\nimport styles from './Checkbox.module.css';\n\n/**\n * Component definition for Checkbox\n * @public\n */\nexport const CheckboxDefinition = defineComponent<CheckboxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Checkbox',\n indicator: 'bui-CheckboxIndicator',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,cAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACb;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -3,8 +3,10 @@ import 'clsx';
|
|
|
3
3
|
import '../../hooks/useBreakpoint.esm.js';
|
|
4
4
|
import '../../hooks/useBg.esm.js';
|
|
5
5
|
import '../../hooks/useDefinition/helpers.esm.js';
|
|
6
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import '../../provider/BUIContext.esm.js';
|
|
7
8
|
import 'react-router-dom';
|
|
9
|
+
import '@backstage/version-bridge';
|
|
8
10
|
import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
|
|
9
11
|
import styles from './CheckboxGroup.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/CheckboxGroup/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 { CheckboxGroupOwnProps } from './types';\nimport styles from './CheckboxGroup.module.css';\n\n/**\n * Component definition for CheckboxGroup\n * @public\n */\nexport const CheckboxGroupDefinition = defineComponent<CheckboxGroupOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-CheckboxGroup',\n content: 'bui-CheckboxGroupContent',\n },\n propDefs: {\n className: {},\n children: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n orientation: {},\n },\n },\n);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/CheckboxGroup/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 { CheckboxGroupOwnProps } from './types';\nimport styles from './CheckboxGroup.module.css';\n\n/**\n * Component definition for CheckboxGroup\n * @public\n */\nexport const CheckboxGroupDefinition = defineComponent<CheckboxGroupOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-CheckboxGroup',\n content: 'bui-CheckboxGroupContent',\n },\n propDefs: {\n className: {},\n children: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n orientation: {},\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,OAAA,EAAS;AAAA,KACX;AAAA,IACA,QAAA,EAAU;AAAA,MACR,WAAW,EAAC;AAAA,MACZ,UAAU,EAAC;AAAA,MACX,OAAO,EAAC;AAAA,MACR,gBAAgB,EAAC;AAAA,MACjB,aAAa,EAAC;AAAA,MACd,YAAY,EAAC;AAAA,MACb,aAAa;AAAC;AAChB;AAEJ;;;;"}
|
|
@@ -5,20 +5,46 @@ import { Avatar } from '../Avatar/Avatar.esm.js';
|
|
|
5
5
|
import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
|
|
6
6
|
import '../Avatar/Avatar.module.css.esm.js';
|
|
7
7
|
import { ComboboxItemDefinition, ComboboxItemProfileDefinition, ComboboxItemTextDefinition } from './definition.esm.js';
|
|
8
|
+
import { getReactAriaAnchorProps } from '../../navigation/useNavigation.esm.js';
|
|
8
9
|
|
|
9
|
-
function
|
|
10
|
-
|
|
10
|
+
function ComboboxItemView({
|
|
11
|
+
definitionResult,
|
|
12
|
+
navigation
|
|
13
|
+
}) {
|
|
14
|
+
const { ownProps, restProps } = definitionResult;
|
|
11
15
|
const { classes, children, textValue, showSelectionIndicator } = ownProps;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
const navigationProps = getReactAriaAnchorProps(navigation, restProps);
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
ListBoxItem,
|
|
19
|
+
{
|
|
20
|
+
...restProps,
|
|
21
|
+
className: classes.root,
|
|
22
|
+
textValue,
|
|
23
|
+
...navigationProps,
|
|
24
|
+
children: (values) => {
|
|
25
|
+
const content = typeof children === "function" ? children(values) : children;
|
|
26
|
+
if (!showSelectionIndicator) {
|
|
27
|
+
return content;
|
|
28
|
+
}
|
|
29
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: classes.indicator, children: /* @__PURE__ */ jsx(RiCheckLine, { "aria-hidden": "true" }) }),
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: classes.content, children: content })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function ComboboxItem(props) {
|
|
38
|
+
const definitionResult = useDefinition(ComboboxItemDefinition, props);
|
|
39
|
+
const Navigation = definitionResult.navigation;
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
Navigation,
|
|
42
|
+
{
|
|
43
|
+
props: definitionResult.restProps,
|
|
44
|
+
view: ComboboxItemView,
|
|
45
|
+
viewProps: { definitionResult }
|
|
16
46
|
}
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */ jsx("div", { className: classes.indicator, children: /* @__PURE__ */ jsx(RiCheckLine, { "aria-hidden": "true" }) }),
|
|
19
|
-
/* @__PURE__ */ jsx("div", { className: classes.content, children: content })
|
|
20
|
-
] });
|
|
21
|
-
} });
|
|
47
|
+
);
|
|
22
48
|
}
|
|
23
49
|
function ComboboxItemText(props) {
|
|
24
50
|
const { ownProps, restProps } = useDefinition(
|