@backstage/ui 0.17.1 → 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 +22 -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/Badge.module.css.esm.js +2 -2
- 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/Button.module.css.esm.js +2 -2
- 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/ButtonLink.module.css.esm.js +2 -2
- 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/Card.module.css.esm.js +2 -2
- package/dist/components/Card/definition.esm.js +3 -1
- package/dist/components/Card/definition.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.esm.js +2 -2
- 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/Combobox.module.css.esm.js +2 -2
- 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/DatePicker.module.css.esm.js +2 -2
- package/dist/components/DatePicker/definition.esm.js +3 -1
- package/dist/components/DatePicker/definition.esm.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.module.css.esm.js +2 -2
- package/dist/components/DateRangePicker/definition.esm.js +3 -1
- package/dist/components/DateRangePicker/definition.esm.js.map +1 -1
- package/dist/components/Dialog/Dialog.module.css.esm.js +2 -2
- package/dist/components/Dialog/definition.esm.js +3 -1
- package/dist/components/Dialog/definition.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.module.css.esm.js +2 -2
- package/dist/components/FieldError/definition.esm.js +3 -1
- package/dist/components/FieldError/definition.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.module.css.esm.js +2 -2
- 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/HeaderNav.module.css.esm.js +2 -2
- 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/List.module.css.esm.js +2 -2
- 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/Menu.module.css.esm.js +2 -2
- package/dist/components/Menu/definition.esm.js +5 -1
- package/dist/components/Menu/definition.esm.js.map +1 -1
- package/dist/components/NumberField/NumberField.module.css.esm.js +2 -2
- package/dist/components/NumberField/definition.esm.js +3 -1
- package/dist/components/NumberField/definition.esm.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.module.css.esm.js +2 -2
- 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/RadioGroup.module.css.esm.js +2 -2
- 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/SearchAutocomplete.module.css.esm.js +2 -2
- package/dist/components/SearchAutocomplete/definition.esm.js +4 -1
- package/dist/components/SearchAutocomplete/definition.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.module.css.esm.js +2 -2
- package/dist/components/SearchField/definition.esm.js +3 -1
- package/dist/components/SearchField/definition.esm.js.map +1 -1
- package/dist/components/Select/Select.module.css.esm.js +2 -2
- 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/Slider.module.css.esm.js +2 -2
- package/dist/components/Slider/definition.esm.js +3 -1
- package/dist/components/Slider/definition.esm.js.map +1 -1
- package/dist/components/Switch/Switch.module.css.esm.js +2 -2
- package/dist/components/Switch/definition.esm.js +3 -1
- package/dist/components/Switch/definition.esm.js.map +1 -1
- package/dist/components/Table/Table.module.css.esm.js +2 -2
- 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/Table.esm.js +5 -3
- package/dist/components/Table/components/Table.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/Tabs.module.css.esm.js +2 -2
- 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/TagGroup.module.css.esm.js +2 -2
- 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/TextField.module.css.esm.js +2 -2
- package/dist/components/TextField/definition.esm.js +3 -1
- package/dist/components/TextField/definition.esm.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.module.css.esm.js +2 -2
- 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/Tooltip.module.css.esm.js +2 -2
- 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/css/styles.css +4 -7
- 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 +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchField/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 { SearchFieldOwnProps } from './types';\nimport styles from './SearchField.module.css';\n\n/**\n * Component definition for SearchField\n * @public\n */\nexport const SearchFieldDefinition = defineComponent<SearchFieldOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchField',\n clear: 'bui-SearchFieldClear',\n inputWrapper: 'bui-SearchFieldInputWrapper',\n input: 'bui-SearchFieldInput',\n inputIcon: 'bui-SearchFieldInputIcon',\n },\n bg: 'consumer',\n propDefs: {\n startCollapsed: { dataAttribute: true, default: false },\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: { default: 'Search' },\n label: {},\n description: {},\n secondaryLabel: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/SearchField/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 { SearchFieldOwnProps } from './types';\nimport styles from './SearchField.module.css';\n\n/**\n * Component definition for SearchField\n * @public\n */\nexport const SearchFieldDefinition = defineComponent<SearchFieldOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SearchField',\n clear: 'bui-SearchFieldClear',\n inputWrapper: 'bui-SearchFieldInputWrapper',\n input: 'bui-SearchFieldInput',\n inputIcon: 'bui-SearchFieldInputIcon',\n },\n bg: 'consumer',\n propDefs: {\n startCollapsed: { dataAttribute: true, default: false },\n size: { dataAttribute: true, default: 'small' },\n className: {},\n icon: {},\n placeholder: { default: 'Search' },\n label: {},\n description: {},\n secondaryLabel: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,qBAAA,GAAwB,iBAAqC,CAAE;AAAA,EAC1E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,iBAAA;AAAA,IACN,KAAA,EAAO,sBAAA;AAAA,IACP,YAAA,EAAc,6BAAA;AAAA,IACd,KAAA,EAAO,sBAAA;AAAA,IACP,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IACtD,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,WAAW,EAAC;AAAA,IACZ,MAAM,EAAC;AAAA,IACP,WAAA,EAAa,EAAE,OAAA,EAAS,QAAA,EAAS;AAAA,IACjC,OAAO,EAAC;AAAA,IACR,aAAa,EAAC;AAAA,IACd,gBAAgB;AAAC;AAErB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Select_bui-
|
|
4
|
-
var styles = {"bui-Select":"Select_bui-
|
|
3
|
+
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Select_bui-Select__927d98c492,\n .Select_bui-SelectPopover__927d98c492 {\n &[data-size='small'] {\n --select-item-height: 2rem;\n }\n\n &[data-size='medium'] {\n --select-item-height: 2.5rem;\n }\n }\n\n .Select_bui-Select__927d98c492 {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1;\n }\n\n .Select_bui-SelectPopover__927d98c492 {\n min-width: var(--trigger-width);\n\n .bui-PopoverContent {\n padding: 0;\n display: grid;\n grid-template-rows: minmax(0, 1fr);\n overflow: hidden;\n }\n }\n\n .Select_bui-SelectTrigger__927d98c492 {\n box-sizing: border-box;\n border-radius: var(--bui-radius-3);\n border: none;\n outline: none;\n background-color: var(--bui-bg-neutral-1);\n transition: box-shadow 0.2s ease-in-out;\n\n &[data-on-bg='neutral-1'] {\n background-color: var(--bui-bg-neutral-2);\n }\n\n &[data-on-bg='neutral-2'] {\n background-color: var(--bui-bg-neutral-3);\n }\n\n &[data-on-bg='neutral-3'] {\n background-color: var(--bui-bg-neutral-4);\n }\n\n .Select_bui-Select__927d98c492[data-focused] & {\n box-shadow: inset 0 0 0 1px var(--bui-ring);\n }\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n gap: var(--bui-space-2);\n width: 100%;\n height: var(--select-item-height);\n\n .Select_bui-Select__927d98c492[data-size='small'] & {\n padding-inline: var(--bui-space-3) 0;\n }\n\n .Select_bui-Select__927d98c492[data-size='medium'] & {\n padding-inline: var(--bui-space-4) 0;\n }\n\n & svg {\n flex-shrink: 0;\n color: var(--bui-fg-secondary);\n\n .Select_bui-Select__927d98c492[data-size='small'] & {\n width: 1rem;\n height: 1rem;\n }\n\n .Select_bui-Select__927d98c492[data-size='medium'] & {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n .Select_bui-Select__927d98c492[data-invalid] & {\n box-shadow: inset 0 0 0 1px var(--bui-border-danger);\n }\n\n &[disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select_bui-SelectTriggerChevron__927d98c492 {\n display: grid;\n place-content: center;\n width: var(--select-item-height);\n height: var(--select-item-height);\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n .Select_bui-SelectValue__927d98c492 {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n line-height: 1.15;\n color: var(--bui-fg-primary);\n text-align: left;\n\n & .Select_bui-SelectItemIndicator__927d98c492 {\n display: none;\n }\n\n &[disabled] {\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select_bui-SelectList__927d98c492 {\n padding-block: var(--bui-space-1);\n padding-inline: var(--bui-space-1);\n transition: opacity 0.2s ease-in-out;\n\n &[data-stale] {\n opacity: 0.6;\n }\n\n &[data-focus-visible] {\n /* Remove default focus-visible outline because React Aria\n * triggers it on mouse click open of the list for some reason.\n * On keyboard use, the top item receives the focus style,\n * so it's not needed anyway. */\n outline: none;\n }\n }\n\n .Select_bui-SelectItem__927d98c492 {\n box-sizing: border-box;\n position: relative;\n display: block;\n min-height: var(--select-item-height);\n padding-block: var(--bui-space-1);\n padding-left: var(--bui-space-3);\n padding-right: var(--bui-space-4);\n color: var(--bui-fg-primary);\n cursor: pointer;\n user-select: none;\n font-size: var(--bui-font-size-3);\n line-height: 1.15;\n outline: none;\n border-radius: var(--bui-radius-2);\n\n &:has(> .Select_bui-SelectItemIndicator__927d98c492) {\n display: grid;\n grid-template-areas: 'icon text';\n grid-template-columns: 1rem 1fr;\n align-items: center;\n gap: var(--bui-space-2);\n }\n\n &[data-focused] {\n background-color: var(--bui-bg-neutral-2);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n &[data-selected] .Select_bui-SelectItemIndicator__927d98c492 {\n opacity: 1;\n }\n }\n\n .Select_bui-SelectItemIndicator__927d98c492 {\n grid-area: icon;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n }\n\n .Select_bui-SelectItemLabel__927d98c492 {\n flex: 1;\n grid-area: text;\n }\n\n .Select_bui-SelectItemContent__927d98c492 {\n grid-area: text;\n display: flex;\n align-items: center;\n gap: var(--bui-space-2);\n min-width: 0;\n }\n\n .Select_bui-SelectItemLeadingIcon__927d98c492 {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1em;\n height: 1em;\n flex-shrink: 0;\n\n & > svg {\n width: 1em;\n height: 1em;\n }\n }\n\n .Select_bui-SelectItemAvatar__927d98c492 {\n flex-shrink: 0;\n }\n\n .Select_bui-SelectItemTextContent__927d98c492 {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n\n .Select_bui-SelectItemTitle__927d98c492,\n .Select_bui-SelectItemDescription__927d98c492 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .Select_bui-SelectItemDescription__927d98c492 {\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-secondary);\n }\n\n .Select_bui-SelectSearchWrapper__927d98c492 {\n flex-shrink: 0;\n margin-bottom: var(--bui-space-1);\n display: flex;\n align-items: center;\n padding-inline: var(--bui-space-3) 0;\n border-bottom: 1px solid var(--bui-border-2);\n }\n\n .Select_bui-SelectContent__927d98c492 {\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n min-height: 0;\n }\n\n .Select_bui-SelectResults__927d98c492 {\n grid-row: 2;\n min-height: 0;\n overflow: auto;\n }\n\n .Select_bui-SelectSearch__927d98c492 {\n border: none;\n background-color: transparent;\n padding: 0;\n color: var(--bui-fg-primary);\n flex: 1;\n outline: none;\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n height: var(--select-item-height);\n line-height: var(--select-item-height);\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n /* Hide native browser clear button */\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n }\n\n .Select_bui-SelectSearchClear__927d98c492 {\n flex: 0 0 auto;\n display: grid;\n place-content: center;\n background-color: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n color: var(--bui-fg-secondary);\n transition: color 0.2s ease-in-out;\n width: var(--select-item-height);\n height: var(--select-item-height);\n\n input:placeholder-shown + & {\n display: none;\n }\n\n &:hover {\n color: var(--bui-fg-primary);\n }\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Select_bui-SelectSection__927d98c492 {\n &:first-child .Select_bui-SelectSectionHeader__927d98c492 {\n padding-top: 0;\n }\n }\n\n .Select_bui-SelectSectionHeader__927d98c492 {\n height: 2rem;\n display: flex;\n align-items: center;\n padding-top: var(--bui-space-3);\n padding-left: var(--bui-space-3);\n color: var(--bui-fg-primary);\n font-size: var(--bui-font-size-1);\n line-height: 1.15;\n font-weight: bold;\n letter-spacing: 0.05rem;\n text-transform: uppercase;\n }\n\n .Select_bui-SelectNoResults__927d98c492 {\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-2);\n color: var(--bui-fg-secondary);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n line-height: 1.15;\n }\n\n .Select_bui-SelectLoading__927d98c492 {\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n .Select_bui-SelectLoadingRow__927d98c492 {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n min-height: var(--select-item-height);\n padding-block: var(--bui-space-1);\n padding-left: calc(var(--bui-space-3) + 1rem + var(--bui-space-2));\n padding-right: var(--bui-space-4);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Select":"Select_bui-Select__927d98c492","bui-SelectPopover":"Select_bui-SelectPopover__927d98c492","bui-SelectTrigger":"Select_bui-SelectTrigger__927d98c492","bui-SelectTriggerChevron":"Select_bui-SelectTriggerChevron__927d98c492","bui-SelectValue":"Select_bui-SelectValue__927d98c492","bui-SelectItemIndicator":"Select_bui-SelectItemIndicator__927d98c492","bui-SelectList":"Select_bui-SelectList__927d98c492","bui-SelectItem":"Select_bui-SelectItem__927d98c492","bui-SelectItemLabel":"Select_bui-SelectItemLabel__927d98c492","bui-SelectItemContent":"Select_bui-SelectItemContent__927d98c492","bui-SelectItemLeadingIcon":"Select_bui-SelectItemLeadingIcon__927d98c492","bui-SelectItemAvatar":"Select_bui-SelectItemAvatar__927d98c492","bui-SelectItemTextContent":"Select_bui-SelectItemTextContent__927d98c492","bui-SelectItemTitle":"Select_bui-SelectItemTitle__927d98c492","bui-SelectItemDescription":"Select_bui-SelectItemDescription__927d98c492","bui-SelectSearchWrapper":"Select_bui-SelectSearchWrapper__927d98c492","bui-SelectContent":"Select_bui-SelectContent__927d98c492","bui-SelectResults":"Select_bui-SelectResults__927d98c492","bui-SelectSearch":"Select_bui-SelectSearch__927d98c492","bui-SelectSearchClear":"Select_bui-SelectSearchClear__927d98c492","bui-SelectSection":"Select_bui-SelectSection__927d98c492","bui-SelectSectionHeader":"Select_bui-SelectSectionHeader__927d98c492","bui-SelectNoResults":"Select_bui-SelectNoResults__927d98c492","bui-SelectLoading":"Select_bui-SelectLoading__927d98c492","bui-SelectLoadingRow":"Select_bui-SelectLoadingRow__927d98c492"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -5,11 +5,13 @@ 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 { SelectItemDefinition, SelectItemProfileDefinition, SelectItemTextDefinition } from './definition.esm.js';
|
|
8
|
+
import { getReactAriaAnchorProps } from '../../navigation/useNavigation.esm.js';
|
|
8
9
|
|
|
9
|
-
function
|
|
10
|
-
const { ownProps, restProps } =
|
|
10
|
+
function SelectItemView({ definitionResult, navigation }) {
|
|
11
|
+
const { ownProps, restProps } = definitionResult;
|
|
11
12
|
const { classes, children, showSelectionIndicator } = ownProps;
|
|
12
|
-
|
|
13
|
+
const navigationProps = getReactAriaAnchorProps(navigation, restProps);
|
|
14
|
+
return /* @__PURE__ */ jsx(ListBoxItem, { className: classes.root, ...restProps, ...navigationProps, children: (values) => {
|
|
13
15
|
const content = typeof children === "function" ? children(values) : children;
|
|
14
16
|
if (!showSelectionIndicator) {
|
|
15
17
|
return content;
|
|
@@ -20,6 +22,18 @@ function SelectItem(props) {
|
|
|
20
22
|
] });
|
|
21
23
|
} });
|
|
22
24
|
}
|
|
25
|
+
function SelectItem(props) {
|
|
26
|
+
const definitionResult = useDefinition(SelectItemDefinition, props);
|
|
27
|
+
const Navigation = definitionResult.navigation;
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
Navigation,
|
|
30
|
+
{
|
|
31
|
+
props: definitionResult.restProps,
|
|
32
|
+
view: SelectItemView,
|
|
33
|
+
viewProps: { definitionResult }
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
23
37
|
function SelectItemText(props) {
|
|
24
38
|
const { ownProps, restProps } = useDefinition(
|
|
25
39
|
SelectItemTextDefinition,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItem.esm.js","sources":["../../../src/components/Select/SelectItem.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 { RiCheckLine } from '@remixicon/react';\nimport { ListBoxItem, Text } from 'react-aria-components';\nimport { Avatar } from '../Avatar';\nimport {
|
|
1
|
+
{"version":3,"file":"SelectItem.esm.js","sources":["../../../src/components/Select/SelectItem.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 { RiCheckLine } from '@remixicon/react';\nimport { ListBoxItem, Text } from 'react-aria-components';\nimport { Avatar } from '../Avatar';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n SelectItemDefinition,\n SelectItemProfileDefinition,\n SelectItemTextDefinition,\n} from './definition';\nimport type {\n SelectItemProfileProps,\n SelectItemProps,\n SelectItemTextProps,\n} from './types';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype SelectItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof SelectItemDefinition,\n SelectItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction SelectItemView({ definitionResult, navigation }: SelectItemViewProps) {\n const { ownProps, restProps } = definitionResult;\n const { classes, children, showSelectionIndicator } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <ListBoxItem className={classes.root} {...restProps} {...navigationProps}>\n {values => {\n const content =\n typeof children === 'function' ? children(values) : children;\n\n if (!showSelectionIndicator) {\n return content;\n }\n\n return (\n <>\n <div className={classes.indicator}>\n <RiCheckLine aria-hidden=\"true\" />\n </div>\n <div className={classes.content}>{content}</div>\n </>\n );\n }}\n </ListBoxItem>\n );\n}\n\n/**\n * A low-level Select item wrapper for custom item content.\n *\n * @public\n */\nexport function SelectItem<T extends object = object>(\n props: SelectItemProps<T>,\n) {\n const definitionResult = useDefinition(SelectItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={SelectItemView}\n viewProps={{ definitionResult }}\n />\n );\n}\n\n/**\n * A Select item preset with a title and optional supporting content.\n *\n * @public\n */\nexport function SelectItemText<T extends object = object>(\n props: SelectItemTextProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemTextDefinition,\n props,\n );\n const { classes, title, description, leadingIcon } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={title}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n {leadingIcon && (\n <div className={classes.leadingIcon}>{leadingIcon}</div>\n )}\n <div className={classes.text}>\n <Text slot=\"label\" className={classes.title}>\n {title}\n </Text>\n {description && (\n <Text slot=\"description\" className={classes.description}>\n {description}\n </Text>\n )}\n </div>\n </div>\n </SelectItem>\n );\n}\n\n/**\n * A Select item preset for a person or other named profile.\n *\n * @public\n */\nexport function SelectItemProfile<T extends object = object>(\n props: SelectItemProfileProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemProfileDefinition,\n props,\n );\n const { classes, name, src } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={name}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n <div className={classes.avatar}>\n <Avatar\n src={src ?? ''}\n name={name}\n size=\"x-small\"\n purpose=\"decoration\"\n />\n </div>\n <Text slot=\"label\" className={classes.name}>\n {name}\n </Text>\n </div>\n </SelectItem>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA8CA,SAAS,cAAA,CAAe,EAAE,gBAAA,EAAkB,UAAA,EAAW,EAAwB;AAC7E,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,gBAAA;AAChC,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,sBAAA,EAAuB,GAAI,QAAA;AACtD,EAAA,MAAM,eAAA,GAAkB,uBAAA,CAAwB,UAAA,EAAY,SAAS,CAAA;AAErE,EAAA,uBACE,GAAA,CAAC,eAAY,SAAA,EAAW,OAAA,CAAQ,MAAO,GAAG,SAAA,EAAY,GAAG,eAAA,EACtD,QAAA,EAAA,CAAA,MAAA,KAAU;AACT,IAAA,MAAM,UACJ,OAAO,QAAA,KAAa,UAAA,GAAa,QAAA,CAAS,MAAM,CAAA,GAAI,QAAA;AAEtD,IAAA,IAAI,CAAC,sBAAA,EAAwB;A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IAAA,EAAA,EAAK,IAAA,EAAK,SAAQ,SAAA,EAAW,OAAA,CAAQ,MACnC,QAAA,EAAA,IAAA,EACH;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -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 './Select.module.css.esm.js';
|
|
10
12
|
|
|
@@ -103,6 +105,7 @@ const SelectItemDefinition = defineComponent()({
|
|
|
103
105
|
indicator: "bui-SelectItemIndicator",
|
|
104
106
|
content: "bui-SelectItemContent"
|
|
105
107
|
},
|
|
108
|
+
navigation: { type: "anchor" },
|
|
106
109
|
propDefs: {
|
|
107
110
|
children: {},
|
|
108
111
|
showSelectionIndicator: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/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 SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectItemOwnProps,\n SelectItemProfileOwnProps,\n SelectItemTextOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/** @public */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n items: {},\n children: {},\n dependencies: {},\n search: {},\n loading: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/** @public */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectContent',\n searchWrapper: 'bui-SelectSearchWrapper',\n results: 'bui-SelectResults',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n search: {},\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n visibleIds: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n noResults: 'bui-SelectNoResults',\n loading: 'bui-SelectLoading',\n loadingRow: 'bui-SelectLoadingRow',\n },\n propDefs: {\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxItemDefinition =\n defineComponent<SelectListBoxItemOwnProps>()({\n styles,\n classNames: {\n label: 'bui-SelectItemLabel',\n },\n propDefs: {},\n });\n\n/** @public */\nexport const SelectItemDefinition = defineComponent<SelectItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItem',\n indicator: 'bui-SelectItemIndicator',\n content: 'bui-SelectItemContent',\n },\n propDefs: {\n children: {},\n showSelectionIndicator: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectItemTextDefinition =\n defineComponent<SelectItemTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemText',\n content: 'bui-SelectItemContent',\n leadingIcon: 'bui-SelectItemLeadingIcon',\n text: 'bui-SelectItemTextContent',\n title: 'bui-SelectItemTitle',\n description: 'bui-SelectItemDescription',\n },\n propDefs: {\n title: {},\n description: {},\n leadingIcon: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectItemProfileDefinition =\n defineComponent<SelectItemProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemProfile',\n content: 'bui-SelectItemContent',\n avatar: 'bui-SelectItemAvatar',\n name: 'bui-SelectItemTitle',\n },\n propDefs: {\n name: {},\n src: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectSectionDefinition = defineComponent<SelectSectionOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSection',\n header: 'bui-SelectSectionHeader',\n },\n propDefs: {},\n },\n);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/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 SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectItemOwnProps,\n SelectItemProfileOwnProps,\n SelectItemTextOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/** @public */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n items: {},\n children: {},\n dependencies: {},\n search: {},\n loading: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/** @public */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectContent',\n searchWrapper: 'bui-SelectSearchWrapper',\n results: 'bui-SelectResults',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n search: {},\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n visibleIds: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n noResults: 'bui-SelectNoResults',\n loading: 'bui-SelectLoading',\n loadingRow: 'bui-SelectLoadingRow',\n },\n propDefs: {\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxItemDefinition =\n defineComponent<SelectListBoxItemOwnProps>()({\n styles,\n classNames: {\n label: 'bui-SelectItemLabel',\n },\n propDefs: {},\n });\n\n/** @public */\nexport const SelectItemDefinition = defineComponent<SelectItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItem',\n indicator: 'bui-SelectItemIndicator',\n content: 'bui-SelectItemContent',\n },\n navigation: { type: 'anchor' },\n propDefs: {\n children: {},\n showSelectionIndicator: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectItemTextDefinition =\n defineComponent<SelectItemTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemText',\n content: 'bui-SelectItemContent',\n leadingIcon: 'bui-SelectItemLeadingIcon',\n text: 'bui-SelectItemTextContent',\n title: 'bui-SelectItemTitle',\n description: 'bui-SelectItemDescription',\n },\n propDefs: {\n title: {},\n description: {},\n leadingIcon: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectItemProfileDefinition =\n defineComponent<SelectItemProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemProfile',\n content: 'bui-SelectItemContent',\n avatar: 'bui-SelectItemAvatar',\n name: 'bui-SelectItemTitle',\n },\n propDefs: {\n name: {},\n src: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectSectionDefinition = defineComponent<SelectSectionOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSection',\n header: 'bui-SelectSectionHeader',\n },\n propDefs: {},\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;;AA+BO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,SAAS,EAAC;AAAA,IACV,OAAO,EAAC;AAAA,IACR,UAAU,EAAC;AAAA,IACX,cAAc,EAAC;AAAA,IACf,QAAQ,EAA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A,EAAU;AAAA,IACR,MAAM,EAAC;AAAA,IACP,KAAK,EAAC;AAAA,IACN,WAAW;AAAC;AAEhB,CAAC;AAGI,MAAM,0BAA0B,eAAA,EAAuC;AAAA,EAC5E;AAAA,IACE,MAAA;AAAA,IACA,UAAA,EAAY;AAAA,MACV,IAAA,EAAM,mBAAA;AAAA,MACN,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,UAAU;AAAC;AAEf;;;;"}
|
|
@@ -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 './Skeleton.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/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 { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n bg: 'consumer',\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/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 { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n bg: 'consumer',\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACrB,MAAA,EAAQ,EAAE,OAAA,EAAS,EAAA,EAAG;AAAA,IACtB,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,KAAA,EAAM;AAAA,IAC/C,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Slider_bui-
|
|
4
|
-
var styles = {"bui-Slider":"Slider_bui-
|
|
3
|
+
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Slider_bui-Slider__2f81b53870 {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-2);\n width: 100%;\n color: var(--bui-fg-primary);\n\n &[data-orientation='vertical'] {\n height: 200px;\n width: auto;\n }\n }\n\n .Slider_bui-SliderHeader__2f81b53870 {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: var(--bui-space-3);\n }\n\n .Slider_bui-SliderOutput__2f81b53870 {\n font-size: var(--bui-font-size-2);\n line-height: 1.15;\n font-weight: var(--bui-font-weight-medium);\n color: var(--bui-fg-secondary);\n white-space: nowrap;\n }\n\n .Slider_bui-SliderTrack__2f81b53870 {\n position: relative;\n height: 4px;\n width: 100%;\n background: var(--bui-bg-neutral-3);\n border-radius: var(--bui-radius-sm);\n cursor: pointer;\n\n &[data-disabled] {\n cursor: not-allowed;\n }\n\n /* Vertical orientation */\n [data-orientation='vertical'] & {\n width: 4px;\n height: 100%;\n }\n }\n\n .Slider_bui-SliderTrackFill__2f81b53870 {\n position: absolute;\n top: 0;\n height: 100%;\n background: var(--bui-bg-solid);\n border-radius: var(--bui-radius-sm);\n pointer-events: none;\n\n /* Vertical orientation */\n [data-orientation='vertical'] & {\n width: 100%;\n height: auto;\n left: 0;\n right: 0;\n top: auto;\n }\n }\n\n .Slider_bui-SliderThumb__2f81b53870 {\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: var(--bui-bg-solid);\n border: 2px solid var(--bui-bg-solid);\n box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n cursor: grab;\n transition: transform 200ms;\n\n /* Fix: Ensure thumb is vertically centered on track */\n top: 50%;\n transform: translateY(-50%);\n\n &[data-focus-visible] {\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n &[data-dragging] {\n cursor: grabbing;\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),\n 0 2px 4px -2px rgb(0 0 0 / 0.1);\n transform: translateY(-50%) scale(1.1);\n }\n\n /* Hover effect */\n &:hover:not([data-disabled]) {\n transform: translateY(-50%) scale(1.1);\n }\n }\n\n /* Improved disabled state */\n .Slider_bui-Slider__2f81b53870[data-disabled] {\n opacity: 0.6;\n cursor: not-allowed;\n\n & .Slider_bui-SliderTrack__2f81b53870 {\n background: var(--bui-bg-neutral-2);\n }\n\n & .Slider_bui-SliderTrackFill__2f81b53870 {\n background: var(--bui-bg-neutral-4);\n }\n\n & .Slider_bui-SliderThumb__2f81b53870 {\n cursor: not-allowed;\n background: var(--bui-bg-neutral-4);\n border-color: var(--bui-border-neutral);\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Slider":"Slider_bui-Slider__2f81b53870","bui-SliderHeader":"Slider_bui-SliderHeader__2f81b53870","bui-SliderOutput":"Slider_bui-SliderOutput__2f81b53870","bui-SliderTrack":"Slider_bui-SliderTrack__2f81b53870","bui-SliderTrackFill":"Slider_bui-SliderTrackFill__2f81b53870","bui-SliderThumb":"Slider_bui-SliderThumb__2f81b53870"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 './Slider.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Slider/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 { SliderOwnProps } from './types';\nimport styles from './Slider.module.css';\n\n/**\n * Component definition for Slider\n * @public\n */\nexport const SliderDefinition = defineComponent<SliderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Slider',\n header: 'bui-SliderHeader',\n track: 'bui-SliderTrack',\n trackFill: 'bui-SliderTrackFill',\n thumb: 'bui-SliderThumb',\n output: 'bui-SliderOutput',\n },\n propDefs: {\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Slider/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 { SliderOwnProps } from './types';\nimport styles from './Slider.module.css';\n\n/**\n * Component definition for Slider\n * @public\n */\nexport const SliderDefinition = defineComponent<SliderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Slider',\n header: 'bui-SliderHeader',\n track: 'bui-SliderTrack',\n trackFill: 'bui-SliderTrackFill',\n thumb: 'bui-SliderThumb',\n output: 'bui-SliderOutput',\n },\n propDefs: {\n className: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\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,MAAA,EAAQ,kBAAA;AAAA,IACR,KAAA,EAAO,iBAAA;AAAA,IACP,SAAA,EAAW,qBAAA;AAAA,IACX,KAAA,EAAO,iBAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,gBAAgB,EAAC;AAAA,IACjB,aAAa,EAAC;AAAA,IACd,YAAY;AAAC;AAEjB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Switch_bui-
|
|
4
|
-
var styles = {"bui-Switch":"Switch_bui-
|
|
3
|
+
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Switch_bui-Switch__ffb4027f0e {\n --switch-indicator-bg: var(--bui-gray-4);\n\n [data-theme-mode='dark'] & {\n --switch-indicator-bg: var(--bui-gray-6);\n }\n\n display: flex;\n /* This is needed so the HiddenInput is positioned correctly */\n position: relative;\n align-items: center;\n gap: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n line-height: 1.15;\n color: var(--bui-fg-primary);\n cursor: pointer;\n\n &[data-disabled] {\n --switch-thumb-bg: var(--bui-gray-3);\n\n &[data-on-bg='neutral-1'] {\n --switch-thumb-bg: var(--bui-gray-2);\n }\n\n &[data-on-bg='neutral-2'] {\n --switch-thumb-bg: var(--bui-gray-3);\n }\n\n &[data-on-bg='neutral-3'] {\n --switch-thumb-bg: var(--bui-gray-2);\n }\n\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n [data-theme-mode='dark'] &[data-disabled] {\n --switch-thumb-bg: var(--bui-gray-5);\n }\n\n &[data-selected] {\n .Switch_bui-SwitchIndicator__ffb4027f0e {\n background: var(--bui-accent-bg);\n\n &:before {\n background: var(--bui-accent-fg);\n transform: translateX(100%);\n }\n }\n\n &[data-disabled] {\n .Switch_bui-SwitchIndicator__ffb4027f0e {\n background: var(--bui-accent-bg-disabled);\n\n &:before {\n background: var(--bui-accent-fg-disabled);\n }\n }\n }\n\n &[data-pressed] {\n .Switch_indicator__ffb4027f0e {\n background: var(--bui-bg-neutral-3);\n }\n }\n }\n\n &[data-focus-visible] .Switch_bui-SwitchIndicator__ffb4027f0e {\n outline: 2px solid;\n outline-offset: 2px;\n }\n }\n\n .Switch_bui-SwitchIndicator__ffb4027f0e {\n width: 2rem;\n height: 1.143rem;\n border: 2px;\n background: var(--switch-indicator-bg);\n border-radius: 1.143rem;\n transition: all 200ms;\n\n &:before {\n content: '';\n display: block;\n margin: 0.143rem;\n width: 0.857rem;\n height: 0.857rem;\n background: var(--switch-thumb-bg, var(--bui-accent-fg));\n border-radius: 16px;\n transition: all 200ms;\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Switch":"Switch_bui-Switch__ffb4027f0e","bui-SwitchIndicator":"Switch_bui-SwitchIndicator__ffb4027f0e","indicator":"Switch_indicator__ffb4027f0e"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -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 './Switch.module.css.esm.js';
|
|
10
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Switch/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 { SwitchOwnProps } from './types';\nimport styles from './Switch.module.css';\n\n/**\n * Component definition for Switch\n * @public\n */\nexport const SwitchDefinition = defineComponent<SwitchOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n bg: 'consumer',\n propDefs: {\n label: {},\n className: {},\n },\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.esm.js","sources":["../../../src/components/Switch/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 { SwitchOwnProps } from './types';\nimport styles from './Switch.module.css';\n\n/**\n * Component definition for Switch\n * @public\n */\nexport const SwitchDefinition = defineComponent<SwitchOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n bg: 'consumer',\n propDefs: {\n label: {},\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,SAAA,EAAW;AAAA,GACb;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,OAAO,EAAC;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Table_bui-
|
|
4
|
-
var styles = {"bui-TableWrapper":"Table_bui-
|
|
3
|
+
var css_248z = "/*\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\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Table_bui-TableWrapper__e750c02f4b {\n display: flex;\n flex-direction: column;\n }\n\n .Table_bui-TableResizableContainer__e750c02f4b {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n overflow: auto;\n }\n\n .Table_bui-TableScrollContainer__e750c02f4b {\n overflow: auto;\n flex: 1;\n min-height: 0;\n }\n\n .Table_bui-Table__e750c02f4b {\n /* Establishes containing block for react-aria's absolutely positioned hidden checkbox inputs, preventing them from escaping to a distant ancestor and creating phantom scroll height. */\n position: relative;\n width: 100%;\n caption-side: bottom;\n border-collapse: collapse;\n table-layout: fixed;\n transition: opacity 0.2s ease-in-out;\n\n &[data-stale='true'],\n &[data-ispending='true'] {\n opacity: 0.6;\n }\n }\n\n .Table_bui-TableHeader__e750c02f4b {\n border-bottom: 1px solid var(--bui-border-2);\n transition: color 0.2s ease-in-out;\n }\n\n .Table_bui-TableHead__e750c02f4b {\n text-align: left;\n padding: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n line-height: 1.15;\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableHeadSelection__e750c02f4b {\n width: 40px;\n }\n\n .Table_bui-TableHeadContent__e750c02f4b {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-1);\n }\n\n .Table_bui-TableHeadLabel__e750c02f4b {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n }\n\n .Table_bui-TableHeadSortButton__e750c02f4b {\n cursor: pointer;\n user-select: none;\n display: inline-flex;\n align-items: center;\n gap: var(--bui-space-1);\n opacity: 0;\n transition: opacity 0.1s ease-in-out;\n color: var(--bui-fg-secondary);\n\n .Table_bui-TableHead__e750c02f4b:hover &,\n [data-sort-direction='ascending'] &,\n [data-sort-direction='descending'] & {\n opacity: 1;\n }\n\n & svg {\n transition: transform 0.1s ease-in-out;\n }\n [data-sort-direction='descending'] & svg {\n transform: rotate(180deg);\n }\n }\n\n .Table_bui-TableBody__e750c02f4b {\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableRow__e750c02f4b {\n border-bottom: 1px solid var(--bui-border-2);\n transition: color 0.2s ease-in-out;\n cursor: default;\n\n &:hover {\n background-color: var(--bui-bg-neutral-1-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-1-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-1-pressed);\n }\n\n &[data-on-bg='neutral-1'] {\n &:hover {\n background-color: var(--bui-bg-neutral-2-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-2-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-2-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-2-disabled);\n }\n }\n\n &[data-on-bg='neutral-2'] {\n &:hover {\n background-color: var(--bui-bg-neutral-3-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-3-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-3-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-3-disabled);\n }\n }\n\n &[data-on-bg='neutral-3'] {\n &:hover {\n background-color: var(--bui-bg-neutral-4-hover);\n }\n\n &[data-selected] {\n background-color: var(--bui-bg-neutral-4-pressed);\n }\n\n &[data-pressed] {\n background-color: var(--bui-bg-neutral-4-pressed);\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-4-disabled);\n }\n }\n\n &[data-href],\n &[data-selection-mode],\n &[data-react-aria-pressable='true'] {\n cursor: pointer;\n }\n\n &[data-disabled] {\n background-color: var(--bui-bg-neutral-1-disabled);\n cursor: not-allowed;\n }\n }\n\n .Table_bui-TableCell__e750c02f4b {\n padding: var(--bui-space-3);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n line-height: 1.15;\n min-width: 0;\n overflow: hidden;\n }\n\n .Table_bui-TableCellSelection__e750c02f4b {\n width: 40px;\n }\n\n .Table_bui-TableCellContentWrapper__e750c02f4b {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n min-width: 0;\n width: 100%;\n max-width: 100%;\n }\n\n .Table_bui-TableCellIcon__e750c02f4b,\n .Table_bui-TableCellIcon__e750c02f4b svg {\n display: inline-flex;\n align-items: center;\n color: var(--bui-fg-primary);\n }\n\n .Table_bui-TableCellContent__e750c02f4b {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-0_5);\n min-width: 0;\n flex: 1;\n overflow: hidden;\n max-width: 100%;\n }\n\n .Table_bui-TableCellContent__e750c02f4b > * {\n min-width: 0;\n max-width: 100%;\n }\n\n .Table_bui-TableCellProfile__e750c02f4b {\n display: flex;\n flex-direction: row;\n gap: var(--bui-space-2);\n align-items: center;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-TableWrapper":"Table_bui-TableWrapper__e750c02f4b","bui-TableResizableContainer":"Table_bui-TableResizableContainer__e750c02f4b","bui-TableScrollContainer":"Table_bui-TableScrollContainer__e750c02f4b","bui-Table":"Table_bui-Table__e750c02f4b","bui-TableHeader":"Table_bui-TableHeader__e750c02f4b","bui-TableHead":"Table_bui-TableHead__e750c02f4b","bui-TableHeadSelection":"Table_bui-TableHeadSelection__e750c02f4b","bui-TableHeadContent":"Table_bui-TableHeadContent__e750c02f4b","bui-TableHeadLabel":"Table_bui-TableHeadLabel__e750c02f4b","bui-TableHeadSortButton":"Table_bui-TableHeadSortButton__e750c02f4b","bui-TableBody":"Table_bui-TableBody__e750c02f4b","bui-TableRow":"Table_bui-TableRow__e750c02f4b","bui-TableCell":"Table_bui-TableCell__e750c02f4b","bui-TableCellSelection":"Table_bui-TableCellSelection__e750c02f4b","bui-TableCellContentWrapper":"Table_bui-TableCellContentWrapper__e750c02f4b","bui-TableCellIcon":"Table_bui-TableCellIcon__e750c02f4b","bui-TableCellContent":"Table_bui-TableCellContent__e750c02f4b","bui-TableCellProfile":"Table_bui-TableCellProfile__e750c02f4b"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { styles as default };
|
|
@@ -14,11 +14,12 @@ function Row(props) {
|
|
|
14
14
|
RowDefinition,
|
|
15
15
|
props
|
|
16
16
|
);
|
|
17
|
-
const { classes, columns, children
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
17
|
+
const { classes, columns, children } = ownProps;
|
|
18
|
+
const rawHref = restProps.href;
|
|
19
|
+
const isExternal = isExternalLink(rawHref);
|
|
20
|
+
const hasInternalHref = !!rawHref && !isExternal;
|
|
21
|
+
const hasExternalHref = !!rawHref && isExternal;
|
|
22
|
+
const hasInteraction = !!restProps.onAction || !!rawHref;
|
|
22
23
|
const effectiveTarget = hasExternalHref ? "_blank" : restProps.target;
|
|
23
24
|
const effectiveRel = effectiveTarget === "_blank" ? [
|
|
24
25
|
.../* @__PURE__ */ new Set([
|
|
@@ -29,9 +30,9 @@ function Row(props) {
|
|
|
29
30
|
].join(" ") : restProps.rel;
|
|
30
31
|
const handlePress = hasInteraction ? () => {
|
|
31
32
|
restProps.onAction?.();
|
|
32
|
-
if (
|
|
33
|
-
analytics.captureEvent("click",
|
|
34
|
-
attributes: { to: String(
|
|
33
|
+
if (rawHref) {
|
|
34
|
+
analytics.captureEvent("click", rawHref, {
|
|
35
|
+
attributes: { to: String(rawHref) }
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
} : void 0;
|
|
@@ -43,7 +44,6 @@ function Row(props) {
|
|
|
43
44
|
return /* @__PURE__ */ jsx(
|
|
44
45
|
Row$1,
|
|
45
46
|
{
|
|
46
|
-
href,
|
|
47
47
|
...restProps,
|
|
48
48
|
...dataAttributes,
|
|
49
49
|
target: effectiveTarget,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.esm.js","sources":["../../../../src/components/Table/components/Row.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 Row as ReactAriaRow,\n useTableOptions,\n Cell as ReactAriaCell,\n Collection,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { RowDefinition } from '../definition';\nimport type { RowProps } from '../types';\nimport { isExternalLink } from '../../../utils/linkUtils';\nimport clsx from 'clsx';\nimport { Flex } from '../../Flex';\n\n/**\n * A table row that can optionally act as a navigation link or trigger an action when clicked, with analytics tracking.\n *\n * @public\n */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n RowDefinition,\n props,\n );\n const { classes, columns, children
|
|
1
|
+
{"version":3,"file":"Row.esm.js","sources":["../../../../src/components/Table/components/Row.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 Row as ReactAriaRow,\n useTableOptions,\n Cell as ReactAriaCell,\n Collection,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { RowDefinition } from '../definition';\nimport type { RowProps } from '../types';\nimport { isExternalLink } from '../../../utils/linkUtils';\nimport clsx from 'clsx';\nimport { Flex } from '../../Flex';\n\n/**\n * A table row that can optionally act as a navigation link or trigger an action when clicked, with analytics tracking.\n *\n * @public\n */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n RowDefinition,\n props,\n );\n const { classes, columns, children } = ownProps;\n const rawHref = restProps.href;\n const isExternal = isExternalLink(rawHref);\n const hasInternalHref = !!rawHref && !isExternal;\n const hasExternalHref = !!rawHref && isExternal;\n const hasInteraction = !!restProps.onAction || !!rawHref;\n\n // Derive the effective target, defaulting to _blank for external links.\n const effectiveTarget = hasExternalHref ? '_blank' : restProps.target;\n // Always include noopener noreferrer when target=_blank, merging any\n // consumer-provided rel tokens to avoid reverse-tabnabbing risk.\n const effectiveRel =\n effectiveTarget === '_blank'\n ? [\n ...new Set([\n 'noopener',\n 'noreferrer',\n ...(restProps.rel?.split(/\\s+/).filter(Boolean) ?? []),\n ]),\n ].join(' ')\n : restProps.rel;\n\n const handlePress = hasInteraction\n ? () => {\n restProps.onAction?.();\n if (rawHref) {\n analytics.captureEvent('click', rawHref, {\n attributes: { to: String(rawHref) },\n });\n }\n }\n : undefined;\n\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <ReactAriaCell className={clsx(classes.cell, classes.cellSelection)}>\n <Flex justify=\"center\" align=\"center\">\n <Checkbox slot=\"selection\" aria-label=\"Select row\" />\n </Flex>\n </ReactAriaCell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n return (\n <ReactAriaRow\n {...restProps}\n {...dataAttributes}\n target={effectiveTarget}\n rel={effectiveRel}\n className={clsx(classes.root, restProps.className)}\n data-react-aria-pressable={hasInternalHref ? 'true' : undefined}\n onAction={handlePress}\n >\n {content}\n </ReactAriaRow>\n );\n}\n"],"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IAAI,EAAE,iBAAA,EAAmB,aAAA,EAAc,GAAI,eAAA,EAAgB;AAE3D,EAAA,MAAM,0BACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,iBAAA,KAAsB,QAAA,IAAY,aAAA,KAAkB,UAAA,oBACnD,GAAA,CAACA,IAAA,EAAA,EAAc,WAAW,IAAA,CAAK,OAAA,CAAQ,IAAA,EAAM,OAAA,CAAQ,aAAa,CAAA,EAChE,8BAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,QAAA,EAAS,KAAA,EAAM,QAAA,EAC3B,QAAA,kBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,WAAA,EAAY,YAAA,EAAW,YAAA,EAAa,CAAA,EACrD,CAAA,EACF,CAAA;AAAA,oBAEF,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS;AAAA,GAAA,EACxC,CAAA;AAGF,EAAA,uBACE,GAAA;AAAA,IAACC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,SAAA;AAAA,MACH,GAAG,cAAA;AAAA,MACJ,MAAA,EAAQ,eAAA;AAAA,MACR,GAAA,EAAK,YAAA;AAAA,MACL,SAAA,EAAW,IAAA,CAAK,OAAA,CAAQ,IAAA,EAAM,UAAU,SAAS,CAAA;AAAA,MACjD,2BAAA,EAA2B,kBAAkB,MAAA,GAAS,MAAA;AAAA,MACtD,QAAA,EAAU,WAAA;AAAA,MAET,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useId } from 'react-aria';
|
|
3
3
|
import { ResizableTableContainer, Virtualizer } from 'react-aria-components';
|
|
4
4
|
import { TableLayout } from 'react-stately';
|
|
@@ -17,6 +17,8 @@ import '../../VisuallyHidden/VisuallyHidden.module.css.esm.js';
|
|
|
17
17
|
import { Flex } from '../../Flex/Flex.esm.js';
|
|
18
18
|
import '../../Flex/Flex.module.css.esm.js';
|
|
19
19
|
import { TableBodySkeleton } from './TableBodySkeleton.esm.js';
|
|
20
|
+
import { Text } from '../../Text/Text.esm.js';
|
|
21
|
+
import '../../Text/Text.module.css.esm.js';
|
|
20
22
|
|
|
21
23
|
function isRowRenderFn(rowConfig) {
|
|
22
24
|
return typeof rowConfig === "function";
|
|
@@ -93,10 +95,10 @@ function Table({
|
|
|
93
95
|
} = selection || {};
|
|
94
96
|
const isInitialLoading = pending && !data;
|
|
95
97
|
if (error) {
|
|
96
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ jsx("div", { className: classes.root, style, children: /* @__PURE__ */ jsxs(Text, { variant: "body-medium", children: [
|
|
97
99
|
"Error: ",
|
|
98
100
|
error.message
|
|
99
|
-
] });
|
|
101
|
+
] }) });
|
|
100
102
|
}
|
|
101
103
|
const liveRegionLabel = useLiveRegionLabel(
|
|
102
104
|
pagination,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.esm.js","sources":["../../../../src/components/Table/components/Table.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 { useId } from 'react-aria';\nimport {\n type Key,\n ResizableTableContainer,\n Virtualizer,\n} from 'react-aria-components';\nimport { TableLayout } from 'react-stately';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableWrapperDefinition } from '../definition';\nimport { TableRoot } from './TableRoot';\nimport { TableHeader } from './TableHeader';\nimport { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Column } from './Column';\nimport { TablePagination } from '../../TablePagination';\nimport type {\n TableProps,\n TableItem,\n RowConfig,\n RowRenderFn,\n TablePaginationType,\n} from '../types';\nimport { useMemo } from 'react';\nimport { VisuallyHidden } from '../../VisuallyHidden';\nimport { Flex } from '../../Flex';\nimport { TableBodySkeleton } from './TableBodySkeleton';\n\nfunction isRowRenderFn<T extends TableItem>(\n rowConfig: RowConfig<T> | RowRenderFn<T> | undefined,\n): rowConfig is RowRenderFn<T> {\n return typeof rowConfig === 'function';\n}\n\nfunction useDisabledRows<T extends TableItem>({\n data,\n rowConfig,\n}: Pick<TableProps<T>, 'data' | 'rowConfig'>): Set<Key> | undefined {\n return useMemo(() => {\n if (!data || typeof rowConfig === 'function' || !rowConfig?.getIsDisabled) {\n return;\n }\n\n return data.reduce<Set<Key>>((set, item) => {\n const isDisabled = rowConfig.getIsDisabled?.(item);\n if (isDisabled) {\n set.add(String(item.id));\n }\n return set;\n }, new Set<Key>());\n }, [data, rowConfig]);\n}\n\nfunction useLiveRegionLabel(\n pagination: TablePaginationType,\n isStale: boolean,\n isLoading: boolean,\n hasData: boolean,\n): string {\n if (isLoading) {\n return 'Loading table data.';\n }\n\n if (!hasData || pagination.type === 'none') {\n return '';\n }\n\n const { pageSize, offset, totalCount, getLabel } = pagination;\n\n if (isStale) {\n return 'Loading table data.';\n }\n\n let liveRegionLabel = 'Table page loaded. ';\n\n if (getLabel) {\n liveRegionLabel += getLabel({ pageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + pageSize, totalCount ?? 0);\n liveRegionLabel += `Showing ${fromCount} to ${toCount} of ${totalCount}`;\n }\n return liveRegionLabel;\n}\n\n/**\n * A full-featured data table with built-in pagination, sorting, row selection, loading and error states, and optional virtualization.\n * Pair with `useTable` to manage data fetching and state, or pass `data`, `columnConfig`, and `pagination` directly for manual control.\n *\n * @public\n */\nexport function Table<T extends TableItem>({\n columnConfig,\n data,\n isPending = false,\n loading = false,\n isStale = false,\n error,\n pagination,\n sort,\n rowConfig,\n selection,\n emptyState,\n className,\n style,\n virtualized,\n}: TableProps<T>) {\n const pending = isPending || loading;\n const {\n ownProps: { classes },\n } = useDefinition(TableWrapperDefinition, { className });\n const liveRegionId = useId();\n\n const visibleColumns = useMemo(\n () => columnConfig.filter(col => !col.isHidden),\n [columnConfig],\n );\n const disabledRows = useDisabledRows({ data, rowConfig });\n\n const {\n mode: selectionMode,\n selected: selectedKeys,\n behavior: selectionBehavior,\n onSelectionChange,\n } = selection || {};\n\n const isInitialLoading = pending && !data;\n\n if (error) {\n return (\n <div className={classes.root} style={style}>\n Error: {error.message}\n </div>\n );\n }\n\n const liveRegionLabel = useLiveRegionLabel(\n pagination,\n isStale,\n isInitialLoading,\n data !== undefined,\n );\n\n const manualColumnSizing = columnConfig.some(\n col =>\n col.width != null ||\n col.minWidth != null ||\n col.maxWidth != null ||\n col.defaultWidth != null,\n );\n\n const wrapResizable = manualColumnSizing\n ? (elem: React.ReactNode) => (\n <ResizableTableContainer className={classes.resizableContainer}>\n {elem}\n </ResizableTableContainer>\n )\n : (elem: React.ReactNode) => <>{elem}</>;\n\n const layoutOptions =\n typeof virtualized === 'object' ? virtualized : undefined;\n\n const wrapVirtualized = (elem: React.ReactNode) =>\n virtualized ? (\n <Virtualizer layout={TableLayout} layoutOptions={layoutOptions}>\n {elem}\n </Virtualizer>\n ) : (\n elem\n );\n\n const wrapScrollContainer = (elem: React.ReactNode) => (\n <div className={classes.scrollContainer}>{elem}</div>\n );\n\n return (\n <div className={classes.root} style={style}>\n <VisuallyHidden aria-live=\"polite\" id={liveRegionId}>\n {liveRegionLabel}\n </VisuallyHidden>\n {wrapResizable(\n wrapScrollContainer(\n wrapVirtualized(\n <TableRoot\n {...(isInitialLoading\n ? {}\n : {\n selectionMode,\n selectionBehavior,\n selectedKeys,\n onSelectionChange,\n })}\n sortDescriptor={sort?.descriptor ?? undefined}\n onSortChange={sort?.onSortChange}\n disabledKeys={disabledRows}\n stale={isStale}\n isPending={isInitialLoading}\n aria-describedby={liveRegionId}\n >\n <TableHeader columns={visibleColumns}>\n {column =>\n column.header ? (\n column.header()\n ) : (\n <Column\n id={column.id}\n isRowHeader={column.isRowHeader}\n allowsSorting={column.isSortable}\n width={column.width}\n defaultWidth={column.defaultWidth}\n minWidth={column.minWidth}\n maxWidth={column.maxWidth}\n >\n {column.label}\n </Column>\n )\n }\n </TableHeader>\n {isInitialLoading ? (\n <TableBodySkeleton columns={visibleColumns} />\n ) : (\n <TableBody\n items={data}\n dependencies={[visibleColumns]}\n renderEmptyState={\n emptyState\n ? () => <Flex p=\"3\">{emptyState}</Flex>\n : undefined\n }\n >\n {item => {\n const itemIndex = data?.indexOf(item) ?? -1;\n\n if (isRowRenderFn(rowConfig)) {\n return rowConfig({\n item,\n index: itemIndex,\n });\n }\n\n return (\n <Row\n id={String(item.id)}\n columns={visibleColumns}\n href={rowConfig?.getHref?.(item)}\n onAction={\n rowConfig?.onClick\n ? () => rowConfig?.onClick?.(item)\n : undefined\n }\n >\n {column => column.cell(item)}\n </Row>\n );\n }}\n </TableBody>\n )}\n </TableRoot>,\n ),\n ),\n )}\n {pagination.type === 'page' && (\n <TablePagination\n pageSize={pagination.pageSize}\n pageSizeOptions={pagination.pageSizeOptions}\n offset={pagination.offset}\n totalCount={pagination.totalCount}\n hasNextPage={pagination.hasNextPage}\n hasPreviousPage={pagination.hasPreviousPage}\n onNextPage={pagination.onNextPage}\n onPreviousPage={pagination.onPreviousPage}\n onPageSizeChange={pagination.onPageSizeChange}\n showPageSizeOptions={pagination.showPageSizeOptions}\n getLabel={pagination.getLabel}\n showPaginationLabel={pagination.showPaginationLabel}\n />\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,SAAS,cACP,SAAA,EAC6B;AAC7B,EAAA,OAAO,OAAO,SAAA,KAAc,UAAA;AAC9B;AAEA,SAAS,eAAA,CA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AA;AAAA,QAC7B,qBAAqB,UAAA,CAAW,mBAAA;AAAA,QAChC,UAAU,UAAA,CAAW,QAAA;AAAA,QACrB,qBAAqB,UAAA,CAAW;AAAA;AAAA;AAClC,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Table.esm.js","sources":["../../../../src/components/Table/components/Table.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 { useId } from 'react-aria';\nimport {\n type Key,\n ResizableTableContainer,\n Virtualizer,\n} from 'react-aria-components';\nimport { TableLayout } from 'react-stately';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableWrapperDefinition } from '../definition';\nimport { TableRoot } from './TableRoot';\nimport { TableHeader } from './TableHeader';\nimport { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Column } from './Column';\nimport { TablePagination } from '../../TablePagination';\nimport type {\n TableProps,\n TableItem,\n RowConfig,\n RowRenderFn,\n TablePaginationType,\n} from '../types';\nimport { useMemo } from 'react';\nimport { VisuallyHidden } from '../../VisuallyHidden';\nimport { Flex } from '../../Flex';\nimport { TableBodySkeleton } from './TableBodySkeleton';\nimport { Text } from '../../Text';\n\nfunction isRowRenderFn<T extends TableItem>(\n rowConfig: RowConfig<T> | RowRenderFn<T> | undefined,\n): rowConfig is RowRenderFn<T> {\n return typeof rowConfig === 'function';\n}\n\nfunction useDisabledRows<T extends TableItem>({\n data,\n rowConfig,\n}: Pick<TableProps<T>, 'data' | 'rowConfig'>): Set<Key> | undefined {\n return useMemo(() => {\n if (!data || typeof rowConfig === 'function' || !rowConfig?.getIsDisabled) {\n return;\n }\n\n return data.reduce<Set<Key>>((set, item) => {\n const isDisabled = rowConfig.getIsDisabled?.(item);\n if (isDisabled) {\n set.add(String(item.id));\n }\n return set;\n }, new Set<Key>());\n }, [data, rowConfig]);\n}\n\nfunction useLiveRegionLabel(\n pagination: TablePaginationType,\n isStale: boolean,\n isLoading: boolean,\n hasData: boolean,\n): string {\n if (isLoading) {\n return 'Loading table data.';\n }\n\n if (!hasData || pagination.type === 'none') {\n return '';\n }\n\n const { pageSize, offset, totalCount, getLabel } = pagination;\n\n if (isStale) {\n return 'Loading table data.';\n }\n\n let liveRegionLabel = 'Table page loaded. ';\n\n if (getLabel) {\n liveRegionLabel += getLabel({ pageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + pageSize, totalCount ?? 0);\n liveRegionLabel += `Showing ${fromCount} to ${toCount} of ${totalCount}`;\n }\n return liveRegionLabel;\n}\n\n/**\n * A full-featured data table with built-in pagination, sorting, row selection, loading and error states, and optional virtualization.\n * Pair with `useTable` to manage data fetching and state, or pass `data`, `columnConfig`, and `pagination` directly for manual control.\n *\n * @public\n */\nexport function Table<T extends TableItem>({\n columnConfig,\n data,\n isPending = false,\n loading = false,\n isStale = false,\n error,\n pagination,\n sort,\n rowConfig,\n selection,\n emptyState,\n className,\n style,\n virtualized,\n}: TableProps<T>) {\n const pending = isPending || loading;\n const {\n ownProps: { classes },\n } = useDefinition(TableWrapperDefinition, { className });\n const liveRegionId = useId();\n\n const visibleColumns = useMemo(\n () => columnConfig.filter(col => !col.isHidden),\n [columnConfig],\n );\n const disabledRows = useDisabledRows({ data, rowConfig });\n\n const {\n mode: selectionMode,\n selected: selectedKeys,\n behavior: selectionBehavior,\n onSelectionChange,\n } = selection || {};\n\n const isInitialLoading = pending && !data;\n\n if (error) {\n return (\n <div className={classes.root} style={style}>\n <Text variant=\"body-medium\">Error: {error.message}</Text>\n </div>\n );\n }\n\n const liveRegionLabel = useLiveRegionLabel(\n pagination,\n isStale,\n isInitialLoading,\n data !== undefined,\n );\n\n const manualColumnSizing = columnConfig.some(\n col =>\n col.width != null ||\n col.minWidth != null ||\n col.maxWidth != null ||\n col.defaultWidth != null,\n );\n\n const wrapResizable = manualColumnSizing\n ? (elem: React.ReactNode) => (\n <ResizableTableContainer className={classes.resizableContainer}>\n {elem}\n </ResizableTableContainer>\n )\n : (elem: React.ReactNode) => <>{elem}</>;\n\n const layoutOptions =\n typeof virtualized === 'object' ? virtualized : undefined;\n\n const wrapVirtualized = (elem: React.ReactNode) =>\n virtualized ? (\n <Virtualizer layout={TableLayout} layoutOptions={layoutOptions}>\n {elem}\n </Virtualizer>\n ) : (\n elem\n );\n\n const wrapScrollContainer = (elem: React.ReactNode) => (\n <div className={classes.scrollContainer}>{elem}</div>\n );\n\n return (\n <div className={classes.root} style={style}>\n <VisuallyHidden aria-live=\"polite\" id={liveRegionId}>\n {liveRegionLabel}\n </VisuallyHidden>\n {wrapResizable(\n wrapScrollContainer(\n wrapVirtualized(\n <TableRoot\n {...(isInitialLoading\n ? {}\n : {\n selectionMode,\n selectionBehavior,\n selectedKeys,\n onSelectionChange,\n })}\n sortDescriptor={sort?.descriptor ?? undefined}\n onSortChange={sort?.onSortChange}\n disabledKeys={disabledRows}\n stale={isStale}\n isPending={isInitialLoading}\n aria-describedby={liveRegionId}\n >\n <TableHeader columns={visibleColumns}>\n {column =>\n column.header ? (\n column.header()\n ) : (\n <Column\n id={column.id}\n isRowHeader={column.isRowHeader}\n allowsSorting={column.isSortable}\n width={column.width}\n defaultWidth={column.defaultWidth}\n minWidth={column.minWidth}\n maxWidth={column.maxWidth}\n >\n {column.label}\n </Column>\n )\n }\n </TableHeader>\n {isInitialLoading ? (\n <TableBodySkeleton columns={visibleColumns} />\n ) : (\n <TableBody\n items={data}\n dependencies={[visibleColumns]}\n renderEmptyState={\n emptyState\n ? () => <Flex p=\"3\">{emptyState}</Flex>\n : undefined\n }\n >\n {item => {\n const itemIndex = data?.indexOf(item) ?? -1;\n\n if (isRowRenderFn(rowConfig)) {\n return rowConfig({\n item,\n index: itemIndex,\n });\n }\n\n return (\n <Row\n id={String(item.id)}\n columns={visibleColumns}\n href={rowConfig?.getHref?.(item)}\n onAction={\n rowConfig?.onClick\n ? () => rowConfig?.onClick?.(item)\n : undefined\n }\n >\n {column => column.cell(item)}\n </Row>\n );\n }}\n </TableBody>\n )}\n </TableRoot>,\n ),\n ),\n )}\n {pagination.type === 'page' && (\n <TablePagination\n pageSize={pagination.pageSize}\n pageSizeOptions={pagination.pageSizeOptions}\n offset={pagination.offset}\n totalCount={pagination.totalCount}\n hasNextPage={pagination.hasNextPage}\n hasPreviousPage={pagination.hasPreviousPage}\n onNextPage={pagination.onNextPage}\n onPreviousPage={pagination.onPreviousPage}\n onPageSizeChange={pagination.onPageSizeChange}\n showPageSizeOptions={pagination.showPageSizeOptions}\n getLabel={pagination.getLabel}\n showPaginationLabel={pagination.showPaginationLabel}\n />\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,SAAS,cACP,SAAA,EAC6B;AAC7B,EAAA,OAAO,OAAO,SAAA,KAAc,UAAA;AAC9B;AAEA,SAAS,eAAA,CAAqC;AAAA,EAC5C,IAAA;AAAA,EACA;AACF,CAAA,EAAoE;AAClE,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,IAAI,CAAC,IAAA,IAAQ,OAAO,cAAc,UAAA,IAAc,CAAC,WAAW,aAAA,EAAe;AACzE,MAAA;AAAA,IACF;AAEA,IAAA,OAAO,IAAA,CAAK,MAAA,CAAiB,CAAC,GAAA,EAAK,IAAA,KAAS;AAC1C,MAAA,MAAM,UAAA,GAAa,SAAA,CAAU,aAAA,GAAgB,IAAI,CAAA;AACjD,MAAA,IAAI,UAAA,EAAY;AACd,QAAA,GAAA,CAAI,GAAA,CAAI,MAAA,CAAO,IAAA,CAAK,EAAE,CAAC,CAAA;AAAA,MACzB;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A,wBAAC,GAAA;AAAA,wBAAA;AAAA,0BACC,EAAA,EAAI,MAAA,CAAO,IAAA,CAAK,EAAE,CAAA;AAAA,0BAClB,OAAA,EAAS,cAAA;AAAA,0BACT,IAAA,EAAM,SAAA,EAAW,OAAA,GAAU,IAAI,CAAA;AAAA,0BAC/B,UACE,SAAA,EAAW,OAAA,GACP,MAAM,SAAA,EAAW,OAAA,GAAU,IAAI,CAAA,GAC/B,MAAA;AAAA,0BAGL,QAAA,EAAA,CAAA,MAAA,KAAU,MAAA,CAAO,IAAA,CAAK,IAAI;AAAA;AAAA,uBAC7B;AAAA,oBAEJ;AAAA;AAAA;AACF;AAAA;AAAA;AAEJ;AACF;AACF,KACF;AAAA,IACC,UAAA,CAAW,SAAS,MAAA,oBACnB,GAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,UAAU,UAAA,CAAW,QAAA;AAAA,QACrB,iBAAiB,UAAA,CAAW,eAAA;AAAA,QAC5B,QAAQ,UAAA,CAAW,MAAA;AAAA,QACnB,YAAY,UAAA,CAAW,UAAA;AAAA,QACvB,aAAa,UAAA,CAAW,WAAA;AAAA,QACxB,iBAAiB,UAAA,CAAW,eAAA;AAAA,QAC5B,YAAY,UAAA,CAAW,UAAA;AAAA,QACvB,gBAAgB,UAAA,CAAW,cAAA;AAAA,QAC3B,kBAAkB,UAAA,CAAW,gBAAA;AAAA,QAC7B,qBAAqB,UAAA,CAAW,mBAAA;AAAA,QAChC,UAAU,UAAA,CAAW,QAAA;AAAA,QACrB,qBAAqB,UAAA,CAAW;AAAA;AAAA;AAClC,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -7,8 +7,10 @@ import 'clsx';
|
|
|
7
7
|
import '../../../hooks/useBreakpoint.esm.js';
|
|
8
8
|
import '../../../hooks/useBg.esm.js';
|
|
9
9
|
import '../../../hooks/useDefinition/helpers.esm.js';
|
|
10
|
-
import '
|
|
10
|
+
import 'react';
|
|
11
|
+
import '../../../provider/BUIContext.esm.js';
|
|
11
12
|
import 'react-router-dom';
|
|
13
|
+
import '@backstage/version-bridge';
|
|
12
14
|
import '../../Skeleton/Skeleton.module.css.esm.js';
|
|
13
15
|
|
|
14
16
|
const SKELETON_ROW_COUNT = 5;
|