@backstage/ui 0.0.0-nightly-20251009023727 → 0.0.0-nightly-20251022024054
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 +34 -1
- package/css/styles.css +6581 -8397
- package/dist/components/Avatar/Avatar.esm.js +21 -7
- package/dist/components/Avatar/Avatar.esm.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.css.esm.js +8 -0
- package/dist/components/Avatar/Avatar.module.css.esm.js.map +1 -0
- package/dist/components/Box/Box.esm.js +20 -23
- package/dist/components/Box/Box.esm.js.map +1 -1
- package/dist/components/Box/Box.module.css.esm.js +8 -0
- package/dist/components/Box/Box.module.css.esm.js.map +1 -0
- package/dist/components/Button/Button.esm.js +7 -13
- package/dist/components/Button/Button.esm.js.map +1 -1
- package/dist/components/Button/Button.module.css.esm.js +8 -0
- package/dist/components/Button/Button.module.css.esm.js.map +1 -0
- package/dist/components/ButtonIcon/ButtonIcon.esm.js +14 -12
- package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js +8 -0
- package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js.map +1 -0
- package/dist/components/ButtonLink/ButtonLink.esm.js +8 -13
- package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
- package/dist/components/Card/Card.esm.js +46 -28
- package/dist/components/Card/Card.esm.js.map +1 -1
- package/dist/components/Card/Card.module.css.esm.js +8 -0
- package/dist/components/Card/Card.module.css.esm.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.esm.js +14 -49
- package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.css.esm.js +8 -0
- package/dist/components/Checkbox/Checkbox.module.css.esm.js.map +1 -0
- package/dist/components/Collapsible/Collapsible.esm.js +14 -9
- package/dist/components/Collapsible/Collapsible.esm.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.css.esm.js +8 -0
- package/dist/components/Collapsible/Collapsible.module.css.esm.js.map +1 -0
- package/dist/components/Container/Container.esm.js +22 -25
- package/dist/components/Container/Container.esm.js.map +1 -1
- package/dist/components/Container/Container.module.css.esm.js +8 -0
- package/dist/components/Container/Container.module.css.esm.js.map +1 -0
- package/dist/components/Dialog/Dialog.esm.js +103 -0
- package/dist/components/Dialog/Dialog.esm.js.map +1 -0
- package/dist/components/Dialog/Dialog.module.css.esm.js +8 -0
- package/dist/components/Dialog/Dialog.module.css.esm.js.map +1 -0
- package/dist/components/FieldError/FieldError.esm.js +5 -2
- package/dist/components/FieldError/FieldError.esm.js.map +1 -1
- package/dist/components/FieldError/FieldError.module.css.esm.js +8 -0
- package/dist/components/FieldError/FieldError.module.css.esm.js.map +1 -0
- package/dist/components/FieldLabel/FieldLabel.esm.js +50 -13
- package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
- package/dist/components/FieldLabel/FieldLabel.module.css.esm.js +8 -0
- package/dist/components/FieldLabel/FieldLabel.module.css.esm.js.map +1 -0
- package/dist/components/Flex/Flex.esm.js +22 -18
- package/dist/components/Flex/Flex.esm.js.map +1 -1
- package/dist/components/Flex/Flex.module.css.esm.js +8 -0
- package/dist/components/Flex/Flex.module.css.esm.js.map +1 -0
- package/dist/components/Grid/Grid.esm.js +41 -29
- package/dist/components/Grid/Grid.esm.js.map +1 -1
- package/dist/components/Grid/Grid.module.css.esm.js +8 -0
- package/dist/components/Grid/Grid.module.css.esm.js.map +1 -0
- package/dist/components/Header/Header.esm.js +22 -11
- package/dist/components/Header/Header.esm.js.map +1 -1
- package/dist/components/Header/Header.module.css.esm.js +8 -0
- package/dist/components/Header/Header.module.css.esm.js.map +1 -0
- package/dist/components/Header/HeaderToolbar.esm.js +71 -7
- package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.esm.js +51 -31
- package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
- package/dist/components/HeaderPage/HeaderPage.module.css.esm.js +8 -0
- package/dist/components/HeaderPage/HeaderPage.module.css.esm.js.map +1 -0
- package/dist/components/Link/Link.esm.js +26 -15
- package/dist/components/Link/Link.esm.js.map +1 -1
- package/dist/components/Link/Link.module.css.esm.js +8 -0
- package/dist/components/Link/Link.module.css.esm.js.map +1 -0
- package/dist/components/Menu/Menu.esm.js +376 -118
- package/dist/components/Menu/Menu.esm.js.map +1 -1
- package/dist/components/Menu/Menu.module.css.esm.js +8 -0
- package/dist/components/Menu/Menu.module.css.esm.js.map +1 -0
- package/dist/components/Popover/Popover.module.css.esm.js +8 -0
- package/dist/components/Popover/Popover.module.css.esm.js.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.esm.js +6 -5
- package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +8 -0
- package/dist/components/RadioGroup/RadioGroup.module.css.esm.js.map +1 -0
- package/dist/components/SearchField/SearchField.esm.js +44 -23
- package/dist/components/SearchField/SearchField.esm.js.map +1 -1
- package/dist/components/SearchField/SearchField.module.css.esm.js +8 -0
- package/dist/components/SearchField/SearchField.module.css.esm.js.map +1 -0
- package/dist/components/Select/Select.esm.js +60 -25
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/Select/Select.module.css.esm.js +8 -0
- package/dist/components/Select/Select.module.css.esm.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.esm.js +12 -4
- package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.css.esm.js +8 -0
- package/dist/components/Skeleton/Skeleton.module.css.esm.js.map +1 -0
- package/dist/components/Switch/Switch.esm.js +22 -6
- package/dist/components/Switch/Switch.esm.js.map +1 -1
- package/dist/components/Switch/Switch.module.css.esm.js +8 -0
- package/dist/components/Switch/Switch.module.css.esm.js.map +1 -0
- package/dist/components/Table/Table.module.css.esm.js +8 -0
- package/dist/components/Table/Table.module.css.esm.js.map +1 -0
- package/dist/components/Table/components/Cell.esm.js +44 -17
- package/dist/components/Table/components/Cell.esm.js.map +1 -1
- package/dist/components/Table/components/CellProfile.esm.js +71 -26
- package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
- package/dist/components/Table/components/Column.esm.js +39 -9
- package/dist/components/Table/components/Column.esm.js.map +1 -1
- package/dist/components/Table/components/Row.esm.js +19 -11
- package/dist/components/Table/components/Row.esm.js.map +1 -1
- package/dist/components/Table/components/Table.esm.js +8 -3
- package/dist/components/Table/components/Table.esm.js.map +1 -1
- package/dist/components/Table/components/TableBody.esm.js +13 -2
- package/dist/components/Table/components/TableBody.esm.js.map +1 -1
- package/dist/components/Table/components/TableHeader.esm.js +20 -10
- package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.esm.js +80 -63
- package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
- package/dist/components/TablePagination/TablePagination.module.css.esm.js +8 -0
- package/dist/components/TablePagination/TablePagination.module.css.esm.js.map +1 -0
- package/dist/components/Tabs/Tabs.esm.js +55 -31
- package/dist/components/Tabs/Tabs.esm.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.css.esm.js +8 -0
- package/dist/components/Tabs/Tabs.module.css.esm.js.map +1 -0
- package/dist/components/Tabs/TabsIndicators.esm.js +14 -2
- package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.esm.js +35 -19
- package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.module.css.esm.js +8 -0
- package/dist/components/TagGroup/TagGroup.module.css.esm.js.map +1 -0
- package/dist/components/Text/Text.esm.js +10 -19
- package/dist/components/Text/Text.esm.js.map +1 -1
- package/dist/components/Text/Text.module.css.esm.js +8 -0
- package/dist/components/Text/Text.module.css.esm.js.map +1 -0
- package/dist/components/TextField/TextField.esm.js +29 -16
- package/dist/components/TextField/TextField.esm.js.map +1 -1
- package/dist/components/TextField/TextField.module.css.esm.js +8 -0
- package/dist/components/TextField/TextField.module.css.esm.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.esm.js +19 -7
- package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.css.esm.js +8 -0
- package/dist/components/Tooltip/Tooltip.module.css.esm.js.map +1 -0
- package/dist/hooks/useStyles.esm.js +65 -9
- package/dist/hooks/useStyles.esm.js.map +1 -1
- package/dist/index.d.ts +133 -433
- package/dist/index.esm.js +1 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
- package/dist/utils/componentDefinitions.esm.js +105 -15
- package/dist/utils/componentDefinitions.esm.js.map +1 -1
- package/dist/utils/utilityClassMap.esm.js +189 -0
- package/dist/utils/utilityClassMap.esm.js.map +1 -0
- package/package.json +3 -3
- package/dist/components/Box/Box.props.esm.js +0 -7
- package/dist/components/Box/Box.props.esm.js.map +0 -1
- package/dist/components/Flex/Flex.props.esm.js +0 -31
- package/dist/components/Flex/Flex.props.esm.js.map +0 -1
- package/dist/components/Grid/Grid.props.esm.js +0 -58
- package/dist/components/Grid/Grid.props.esm.js.map +0 -1
- package/dist/components/Icon/Icon.esm.js +0 -29
- package/dist/components/Icon/Icon.esm.js.map +0 -1
- package/dist/components/Icon/context.esm.js +0 -10
- package/dist/components/Icon/context.esm.js.map +0 -1
- package/dist/components/Icon/icons.esm.js +0 -63
- package/dist/components/Icon/icons.esm.js.map +0 -1
- package/dist/components/Icon/provider.esm.js +0 -12
- package/dist/components/Icon/provider.esm.js.map +0 -1
- package/dist/components/ScrollArea/ScrollArea.esm.js +0 -63
- package/dist/components/ScrollArea/ScrollArea.esm.js.map +0 -1
- package/dist/props/display.props.esm.js +0 -12
- package/dist/props/display.props.esm.js.map +0 -1
- package/dist/props/gap-props.esm.js +0 -15
- package/dist/props/gap-props.esm.js.map +0 -1
- package/dist/props/height.props.esm.js +0 -23
- package/dist/props/height.props.esm.js.map +0 -1
- package/dist/props/margin.props.esm.js +0 -54
- package/dist/props/margin.props.esm.js.map +0 -1
- package/dist/props/padding.props.esm.js +0 -54
- package/dist/props/padding.props.esm.js.map +0 -1
- package/dist/props/position.props.esm.js +0 -18
- package/dist/props/position.props.esm.js.map +0 -1
- package/dist/props/prop-def.esm.js +0 -4
- package/dist/props/prop-def.esm.js.map +0 -1
- package/dist/props/spacing.props.esm.js +0 -28
- package/dist/props/spacing.props.esm.js.map +0 -1
- package/dist/props/width.props.esm.js +0 -23
- package/dist/props/width.props.esm.js.map +0 -1
- package/dist/utils/extractProps.esm.js +0 -49
- package/dist/utils/extractProps.esm.js.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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 .Menu-module_bui-MenuPopover__2_pRD {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--bui-border);\n border-radius: var(--bui-radius-2);\n background: var(--bui-bg-surface-1);\n color: var(--bui-fg-primary);\n outline: none;\n transition: transform 200ms, opacity 200ms;\n /* Let React Aria handle height constraints naturally */\n min-height: 0;\n /* Remove overflow from popover since ScrollArea will handle it */\n overflow: hidden;\n\n &[data-entering],\n &[data-exiting] {\n transform: var(--origin);\n opacity: 0;\n }\n\n &[data-placement='top'] {\n --origin: translateY(8px);\n }\n\n &[data-placement='bottom'] {\n --origin: translateY(-8px);\n }\n\n &[data-placement='right'] {\n --origin: translateX(-8px);\n }\n\n &[data-placement='left'] {\n --origin: translateX(8px);\n }\n }\n\n .Menu-module_bui-MenuContent__3DAPp {\n max-height: inherit;\n box-sizing: border-box;\n overflow: auto;\n min-width: 150px;\n box-sizing: border-box;\n outline: none;\n padding-block: var(--bui-space-1);\n }\n\n .Menu-module_bui-MenuItem__2UbNh {\n padding-inline: var(--bui-space-1);\n display: block;\n\n &[data-focused] .Menu-module_bui-MenuItemWrapper__3SEGE {\n background: var(--bui-bg-surface-2);\n color: var(--bui-fg-primary);\n }\n\n &[data-open] .Menu-module_bui-MenuItemWrapper__3SEGE {\n background: var(--bui-bg-surface-2);\n color: var(--bui-fg-primary);\n }\n\n &[data-color='danger'] .Menu-module_bui-MenuItemWrapper__3SEGE {\n color: var(--bui-fg-danger);\n }\n\n &[data-color='danger'][data-focused] .Menu-module_bui-MenuItemWrapper__3SEGE {\n background: var(--bui-bg-danger);\n color: var(--bui-fg-danger);\n }\n\n &[data-has-submenu] {\n & > .Menu-module_bui-MenuItemWrapper__3SEGE > .Menu-module_bui-MenuItemArrow__2Gdal {\n display: block;\n }\n }\n }\n\n .Menu-module_bui-MenuItemWrapper__3SEGE {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 2rem;\n padding-inline: var(--bui-space-2);\n border-radius: var(--bui-radius-2);\n outline: none;\n cursor: default;\n color: var(--bui-fg-primary);\n font-size: var(--bui-font-size-3);\n gap: var(--bui-space-6);\n }\n\n .Menu-module_bui-MenuItemListBox__3OVkY {\n padding-inline: var(--bui-space-1);\n display: block;\n\n &:hover .Menu-module_bui-MenuItemWrapper__3SEGE {\n background: var(--bui-bg-surface-2);\n color: var(--bui-fg-primary);\n }\n\n &[data-selected] .Menu-module_bui-MenuItemListBoxCheck__3flwX {\n & > svg {\n opacity: 1;\n color: var(--bui-fg-primary);\n }\n }\n }\n\n .Menu-module_bui-MenuItemListBoxCheck__3flwX {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n height: 1rem;\n\n & > svg {\n opacity: 0;\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu-module_bui-MenuItemContent__2jc-_ {\n display: flex;\n align-items: center;\n gap: var(--bui-space-2);\n\n & > svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu-module_bui-MenuItemArrow__2Gdal {\n display: none;\n width: 1rem;\n height: 1rem;\n\n & > svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu-module_bui-MenuSection__3OeyZ {\n &:first-child .Menu-module_bui-MenuSectionHeader__yFmfK {\n padding-top: 0;\n }\n }\n\n .Menu-module_bui-MenuSectionHeader__yFmfK {\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 font-weight: bold;\n letter-spacing: 0.05rem;\n text-transform: uppercase;\n }\n\n .Menu-module_bui-MenuSeparator__-EtU8 {\n height: 1px;\n background: var(--bui-border);\n margin-inline: var(--bui-space-1_5);\n margin-block: var(--bui-space-1);\n }\n\n .Menu-module_bui-MenuSearchField__1sNMj {\n position: relative;\n font-family: var(--bui-font-regular);\n width: 100%;\n flex-shrink: 0;\n\n &[data-empty] {\n .Menu-module_bui-MenuSearchFieldClear__3bwIe {\n display: none;\n }\n }\n }\n\n .Menu-module_bui-MenuSearchFieldInput__2jPs5 {\n display: flex;\n align-items: center;\n padding: 0 var(--bui-space-3);\n border: none;\n border-bottom: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n color: var(--bui-fg-primary);\n width: 100%;\n height: 2rem;\n cursor: inherit;\n outline: none;\n\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n }\n\n .Menu-module_bui-MenuSearchFieldClear__3bwIe {\n position: absolute;\n right: var(--bui-space-2);\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-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\n & > svg {\n width: 1rem;\n height: 1rem;\n }\n }\n\n .Menu-module_bui-MenuEmptyState__wPwuq {\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 }\n}\n";
|
|
4
|
+
var styles = {"bui-MenuPopover":"Menu-module_bui-MenuPopover__2_pRD","bui-MenuContent":"Menu-module_bui-MenuContent__3DAPp","bui-MenuItem":"Menu-module_bui-MenuItem__2UbNh","bui-MenuItemWrapper":"Menu-module_bui-MenuItemWrapper__3SEGE","bui-MenuItemArrow":"Menu-module_bui-MenuItemArrow__2Gdal","bui-MenuItemListBox":"Menu-module_bui-MenuItemListBox__3OVkY","bui-MenuItemListBoxCheck":"Menu-module_bui-MenuItemListBoxCheck__3flwX","bui-MenuItemContent":"Menu-module_bui-MenuItemContent__2jc-_","bui-MenuSection":"Menu-module_bui-MenuSection__3OeyZ","bui-MenuSectionHeader":"Menu-module_bui-MenuSectionHeader__yFmfK","bui-MenuSeparator":"Menu-module_bui-MenuSeparator__-EtU8","bui-MenuSearchField":"Menu-module_bui-MenuSearchField__1sNMj","bui-MenuSearchFieldClear":"Menu-module_bui-MenuSearchFieldClear__3bwIe","bui-MenuSearchFieldInput":"Menu-module_bui-MenuSearchFieldInput__2jPs5","bui-MenuEmptyState":"Menu-module_bui-MenuEmptyState__wPwuq"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=Menu.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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 .Popover-module_bui-Popover__100-n {\n margin-right: 12px;\n overflow: scroll;\n background-color: var(--bui-bg-surface-1);\n border: 1px solid var(--bui-border);\n border-radius: var(--bui-radius-3);\n padding-block: var(--bui-space-1);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n }\n}\n";
|
|
4
|
+
var stylesPopover = {"bui-Popover":"Popover-module_bui-Popover__100-n"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { stylesPopover as default };
|
|
8
|
+
//# sourceMappingURL=Popover.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -5,9 +5,11 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { FieldLabel } from '../FieldLabel/FieldLabel.esm.js';
|
|
6
6
|
import { FieldError } from '../FieldError/FieldError.esm.js';
|
|
7
7
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
8
|
+
import styles from './RadioGroup.module.css.esm.js';
|
|
8
9
|
|
|
9
10
|
const RadioGroup = forwardRef(
|
|
10
11
|
(props, ref) => {
|
|
12
|
+
const { classNames, cleanedProps } = useStyles("RadioGroup", props);
|
|
11
13
|
const {
|
|
12
14
|
className,
|
|
13
15
|
label,
|
|
@@ -18,8 +20,7 @@ const RadioGroup = forwardRef(
|
|
|
18
20
|
"aria-labelledby": ariaLabelledBy,
|
|
19
21
|
children,
|
|
20
22
|
...rest
|
|
21
|
-
} =
|
|
22
|
-
const { classNames } = useStyles("RadioGroup");
|
|
23
|
+
} = cleanedProps;
|
|
23
24
|
useEffect(() => {
|
|
24
25
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
25
26
|
console.warn(
|
|
@@ -31,7 +32,7 @@ const RadioGroup = forwardRef(
|
|
|
31
32
|
return /* @__PURE__ */ jsxs(
|
|
32
33
|
RadioGroup$1,
|
|
33
34
|
{
|
|
34
|
-
className: clsx(classNames.root, className),
|
|
35
|
+
className: clsx(classNames.root, styles[classNames.root], className),
|
|
35
36
|
"aria-label": ariaLabel,
|
|
36
37
|
"aria-labelledby": ariaLabelledBy,
|
|
37
38
|
...rest,
|
|
@@ -45,7 +46,7 @@ const RadioGroup = forwardRef(
|
|
|
45
46
|
description
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
/* @__PURE__ */ jsx("div", { className: classNames.content, children }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: clsx(classNames.content, styles[classNames.content]), children }),
|
|
49
50
|
/* @__PURE__ */ jsx(FieldError, {})
|
|
50
51
|
]
|
|
51
52
|
}
|
|
@@ -59,7 +60,7 @@ const Radio = forwardRef((props, ref) => {
|
|
|
59
60
|
return /* @__PURE__ */ jsx(
|
|
60
61
|
Radio$1,
|
|
61
62
|
{
|
|
62
|
-
className: clsx(classNames.radio, className),
|
|
63
|
+
className: clsx(classNames.radio, styles[classNames.radio], className),
|
|
63
64
|
...rest,
|
|
64
65
|
ref
|
|
65
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useStyles } from '../../hooks/useStyles';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n/** @public */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const {\n className,\n label,\n secondaryLabel,\n description,\n isRequired,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n ...rest\n } =
|
|
1
|
+
{"version":3,"file":"RadioGroup.esm.js","sources":["../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n RadioGroup as AriaRadioGroup,\n Radio as AriaRadio,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './RadioGroup.module.css';\n\nimport type { RadioGroupProps, RadioProps } from './types';\n\n/** @public */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles('RadioGroup', props);\n const {\n className,\n label,\n secondaryLabel,\n description,\n isRequired,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n children,\n ...rest\n } = cleanedProps;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'RadioGroup requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaRadioGroup\n className={clsx(classNames.root, styles[classNames.root], className)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div className={clsx(classNames.content, styles[classNames.content])}>\n {children}\n </div>\n <FieldError />\n </AriaRadioGroup>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/** @public */\nexport const Radio = forwardRef<HTMLLabelElement, RadioProps>((props, ref) => {\n const { className, ...rest } = props;\n\n const { classNames } = useStyles('RadioGroup');\n\n return (\n <AriaRadio\n className={clsx(classNames.radio, styles[classNames.radio], className)}\n {...rest}\n ref={ref}\n />\n );\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["AriaRadioGroup","AriaRadio"],"mappings":";;;;;;;;;AA8BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,cAAc,KAAK,CAAA;AAClE,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,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KAAQ;AAC5E,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,KAAA;AAE/B,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,YAAY,CAAA;AAE7C,EAAA,uBACE,GAAA;AAAA,IAACC,OAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,KAAK,UAAA,CAAW,KAAA,EAAO,OAAO,UAAA,CAAW,KAAK,GAAG,SAAS,CAAA;AAAA,MACpE,GAAG,IAAA;AAAA,MACJ;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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 .RadioGroup-module_bui-RadioGroup__v70Qu {\n display: flex;\n flex-direction: column;\n color: var(--bui-fg-primary);\n }\n\n .RadioGroup-module_bui-RadioGroup__v70Qu[data-orientation='horizontal'] .RadioGroup-module_bui-RadioGroupContent__1rG0a {\n flex-direction: row;\n gap: var(--bui-space-4);\n }\n\n .RadioGroup-module_bui-RadioGroupContent__1rG0a {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-2);\n }\n\n .RadioGroup-module_bui-Radio__1769d {\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-2);\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-primary);\n forced-color-adjust: none;\n\n &:before {\n content: '';\n display: block;\n width: 1rem;\n height: 1rem;\n box-sizing: border-box;\n border: 0.125rem solid var(--bui-border);\n background: var(--bui-gray-1);\n border-radius: var(--bui-radius-full);\n transition: all 200ms;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-border);\n }\n\n &[data-selected] {\n &:before {\n border-color: var(--bui-bg-solid);\n border-width: 0.25rem;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-bg-solid);\n }\n }\n\n &[data-focus-visible]:before {\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n\n &:before {\n border-color: var(--bui-border-disabled);\n background: var(--bui-bg-disabled);\n }\n\n &[data-selected]:before {\n border-color: var(--bui-border-disabled);\n }\n }\n\n &[data-invalid]:before {\n border-color: var(--bui-border-danger);\n }\n\n &[data-invalid][data-selected]:before {\n border-color: var(--bui-border-danger);\n }\n\n /* Ensure disabled state prevails over invalid state */\n &[data-disabled][data-invalid] {\n color: var(--bui-fg-disabled);\n\n &:before {\n border-color: var(--bui-border-disabled);\n background: var(--bui-bg-disabled);\n }\n\n &[data-selected]:before {\n border-color: var(--bui-border-disabled);\n }\n }\n }\n}\n";
|
|
4
|
+
var styles = {"bui-RadioGroup":"RadioGroup-module_bui-RadioGroup__v70Qu","bui-RadioGroupContent":"RadioGroup-module_bui-RadioGroupContent__1rG0a","bui-Radio":"RadioGroup-module_bui-Radio__1769d"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=RadioGroup.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -6,23 +6,15 @@ import { FieldLabel } from '../FieldLabel/FieldLabel.esm.js';
|
|
|
6
6
|
import { FieldError } from '../FieldError/FieldError.esm.js';
|
|
7
7
|
import { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';
|
|
8
8
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
9
|
+
import stylesSearchField from './SearchField.module.css.esm.js';
|
|
10
|
+
import stylesTextField from '../TextField/TextField.module.css.esm.js';
|
|
9
11
|
|
|
10
12
|
const SearchField = forwardRef(
|
|
11
13
|
(props, ref) => {
|
|
12
14
|
const {
|
|
13
|
-
className,
|
|
14
|
-
icon,
|
|
15
|
-
size = "small",
|
|
16
15
|
label,
|
|
17
|
-
secondaryLabel,
|
|
18
|
-
description,
|
|
19
|
-
isRequired,
|
|
20
|
-
onChange,
|
|
21
|
-
placeholder = "Search",
|
|
22
|
-
startCollapsed = false,
|
|
23
16
|
"aria-label": ariaLabel,
|
|
24
|
-
"aria-labelledby": ariaLabelledBy
|
|
25
|
-
...rest
|
|
17
|
+
"aria-labelledby": ariaLabelledBy
|
|
26
18
|
} = props;
|
|
27
19
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
28
20
|
const [shouldCollapse, setShouldCollapse] = useState(true);
|
|
@@ -33,13 +25,28 @@ const SearchField = forwardRef(
|
|
|
33
25
|
);
|
|
34
26
|
}
|
|
35
27
|
}, [label, ariaLabel, ariaLabelledBy]);
|
|
36
|
-
const { classNames: textFieldClassNames
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
const { classNames: textFieldClassNames } = useStyles("TextField");
|
|
29
|
+
const {
|
|
30
|
+
classNames: searchFieldClassNames,
|
|
31
|
+
dataAttributes,
|
|
32
|
+
style,
|
|
33
|
+
cleanedProps
|
|
34
|
+
} = useStyles("SearchField", {
|
|
35
|
+
size: "small",
|
|
36
|
+
placeholder: "Search",
|
|
37
|
+
startCollapsed: false,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
const {
|
|
41
|
+
className,
|
|
42
|
+
description,
|
|
43
|
+
icon,
|
|
44
|
+
isRequired,
|
|
45
|
+
secondaryLabel,
|
|
46
|
+
placeholder,
|
|
47
|
+
startCollapsed,
|
|
48
|
+
...rest
|
|
49
|
+
} = cleanedProps;
|
|
43
50
|
const secondaryLabelText = secondaryLabel || (isRequired ? "Required" : null);
|
|
44
51
|
const handleClick = (isFocused) => {
|
|
45
52
|
props.onFocusChange?.(isFocused);
|
|
@@ -65,15 +72,17 @@ const SearchField = forwardRef(
|
|
|
65
72
|
className: clsx(
|
|
66
73
|
textFieldClassNames.root,
|
|
67
74
|
searchFieldClassNames.root,
|
|
75
|
+
stylesTextField[textFieldClassNames.root],
|
|
76
|
+
stylesSearchField[searchFieldClassNames.root],
|
|
68
77
|
className
|
|
69
78
|
),
|
|
70
79
|
...dataAttributes,
|
|
71
80
|
"aria-label": ariaLabel,
|
|
72
81
|
"aria-labelledby": ariaLabelledBy,
|
|
73
|
-
"data-start-collapsed": startCollapsed,
|
|
74
82
|
"data-collapsed": isCollapsed,
|
|
75
83
|
onFocusChange: handleClick,
|
|
76
84
|
onChange: handleChange,
|
|
85
|
+
style,
|
|
77
86
|
...rest,
|
|
78
87
|
ref,
|
|
79
88
|
children: [
|
|
@@ -88,13 +97,19 @@ const SearchField = forwardRef(
|
|
|
88
97
|
/* @__PURE__ */ jsxs(
|
|
89
98
|
"div",
|
|
90
99
|
{
|
|
91
|
-
className:
|
|
100
|
+
className: clsx(
|
|
101
|
+
textFieldClassNames.inputWrapper,
|
|
102
|
+
stylesTextField[textFieldClassNames.inputWrapper]
|
|
103
|
+
),
|
|
92
104
|
"data-size": dataAttributes["data-size"],
|
|
93
105
|
children: [
|
|
94
106
|
icon !== false && /* @__PURE__ */ jsx(
|
|
95
107
|
"div",
|
|
96
108
|
{
|
|
97
|
-
className:
|
|
109
|
+
className: clsx(
|
|
110
|
+
textFieldClassNames.inputIcon,
|
|
111
|
+
stylesTextField[textFieldClassNames.inputIcon]
|
|
112
|
+
),
|
|
98
113
|
"data-size": dataAttributes["data-size"],
|
|
99
114
|
"aria-hidden": "true",
|
|
100
115
|
children: icon || /* @__PURE__ */ jsx(RiSearch2Line, {})
|
|
@@ -103,7 +118,10 @@ const SearchField = forwardRef(
|
|
|
103
118
|
/* @__PURE__ */ jsx(
|
|
104
119
|
Input,
|
|
105
120
|
{
|
|
106
|
-
className:
|
|
121
|
+
className: clsx(
|
|
122
|
+
textFieldClassNames.input,
|
|
123
|
+
stylesTextField[textFieldClassNames.input]
|
|
124
|
+
),
|
|
107
125
|
...icon !== false && { "data-icon": true },
|
|
108
126
|
placeholder
|
|
109
127
|
}
|
|
@@ -111,7 +129,10 @@ const SearchField = forwardRef(
|
|
|
111
129
|
/* @__PURE__ */ jsx(
|
|
112
130
|
Button,
|
|
113
131
|
{
|
|
114
|
-
className:
|
|
132
|
+
className: clsx(
|
|
133
|
+
searchFieldClassNames.clear,
|
|
134
|
+
stylesSearchField[searchFieldClassNames.clear]
|
|
135
|
+
),
|
|
115
136
|
"data-size": dataAttributes["data-size"],
|
|
116
137
|
children: /* @__PURE__ */ jsx(RiCloseCircleLine, {})
|
|
117
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect, useState } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useStyles } from '../../hooks/useStyles';\n\nimport type { SearchFieldProps } from './types';\n\n/** @public */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const {\n
|
|
1
|
+
{"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect, useState } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useStyles } from '../../hooks/useStyles';\nimport stylesSearchField from './SearchField.module.css';\nimport stylesTextField from '../TextField/TextField.module.css';\n\nimport type { SearchFieldProps } from './types';\n\n/** @public */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const {\n label,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n } = props;\n\n const [isCollapsed, setIsCollapsed] = useState(false);\n const [shouldCollapse, setShouldCollapse] = useState(true);\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const { classNames: textFieldClassNames } = useStyles('TextField');\n\n const {\n classNames: searchFieldClassNames,\n dataAttributes,\n style,\n cleanedProps,\n } = useStyles('SearchField', {\n size: 'small',\n placeholder: 'Search',\n startCollapsed: false,\n ...props,\n });\n\n const {\n className,\n description,\n icon,\n isRequired,\n secondaryLabel,\n placeholder,\n startCollapsed,\n ...rest\n } = cleanedProps;\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n const handleClick = (isFocused: boolean) => {\n props.onFocusChange?.(isFocused);\n if (shouldCollapse) {\n if (isFocused) {\n setIsCollapsed(true);\n } else {\n setIsCollapsed(false);\n }\n }\n };\n\n const handleChange = (value: string) => {\n props.onChange?.(value);\n if (value.length > 0) {\n setShouldCollapse(false);\n } else {\n setShouldCollapse(true);\n }\n };\n\n return (\n <AriaSearchField\n className={clsx(\n textFieldClassNames.root,\n searchFieldClassNames.root,\n stylesTextField[textFieldClassNames.root],\n stylesSearchField[searchFieldClassNames.root],\n className,\n )}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-collapsed={isCollapsed}\n onFocusChange={handleClick}\n onChange={handleChange}\n style={style}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={clsx(\n textFieldClassNames.inputWrapper,\n stylesTextField[textFieldClassNames.inputWrapper],\n )}\n data-size={dataAttributes['data-size']}\n >\n {icon !== false && (\n <div\n className={clsx(\n textFieldClassNames.inputIcon,\n stylesTextField[textFieldClassNames.inputIcon],\n )}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n className={clsx(\n textFieldClassNames.input,\n stylesTextField[textFieldClassNames.input],\n )}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={clsx(\n searchFieldClassNames.clear,\n stylesSearchField[searchFieldClassNames.clear],\n )}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["AriaSearchField"],"mappings":";;;;;;;;;;;AAiCO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,KAAA;AAAA,MACA,YAAA,EAAc,SAAA;AAAA,MACd,iBAAA,EAAmB;AAAA,KACrB,GAAI,KAAA;AAEJ,IAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA;AACpD,IAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAS,IAAI,CAAA;AAEzD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAErC,IAAA,MAAM,EAAE,UAAA,EAAY,mBAAA,EAAoB,GAAI,UAAU,WAAW,CAAA;AAEjE,IAAA,MAAM;AAAA,MACJ,UAAA,EAAY,qBAAA;AAAA,MACZ,cAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,KACF,GAAI,UAAU,aAAA,EAAe;AAAA,MAC3B,IAAA,EAAM,OAAA;AAAA,MACN,WAAA,EAAa,QAAA;AAAA,MACb,cAAA,EAAgB,KAAA;AAAA,MAChB,GAAG;AAAA,KACJ,CAAA;AAED,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,WAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,YAAA;AAGJ,IAAA,MAA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EJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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 .SearchField-module_bui-SearchField__2TyT_ {\n flex: 1;\n flex-shrink: 0;\n\n &[data-empty] {\n .SearchField-module_bui-InputClear__JCu80 {\n display: none;\n }\n }\n\n &[data-startCollapsed='true'] {\n transition: flex-basis 0.3s ease-in-out;\n padding: 0;\n flex: 0 1 auto;\n\n &[data-collapsed='true'] {\n flex-basis: 200px;\n }\n\n &[data-collapsed='false'] {\n cursor: pointer;\n\n &[data-size='medium'] {\n flex-basis: 2.5rem;\n height: 2.5rem;\n }\n\n &[data-size='small'] {\n flex-basis: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] .SearchField-module_bui-Input__FcOCK {\n &::placeholder {\n opacity: 0;\n }\n }\n\n &[data-size='small'] .SearchField-module_bui-Input__FcOCK {\n &::placeholder {\n opacity: 0;\n }\n }\n\n .SearchField-module_bui-InputWrapper__2WERV {\n .SearchField-module_bui-Input__FcOCK[data-icon] {\n padding-right: 0px;\n }\n }\n }\n }\n }\n\n .SearchField-module_bui-SearchField__2TyT_ .SearchField-module_bui-Input__FcOCK {\n transition: padding 0.3s ease-in-out, border-color 0.2s ease-in-out,\n outline-color 0.2s ease-in-out;\n\n &[data-hovered] {\n border-color: var(--bui-border-hover);\n }\n\n &[data-focused] {\n border-color: var(--bui-border-pressed);\n outline-width: 0px;\n }\n }\n\n .SearchField-module_bui-SearchField__2TyT_ .SearchField-module_bui-InputWrapper__2WERV {\n .SearchField-module_bui-Input__FcOCK[data-icon] {\n padding-right: var(--bui-space-6);\n }\n }\n\n .SearchField-module_bui-SearchField__2TyT_ .SearchField-module_bui-InputIcon__37FbR {\n left: 0;\n display: flex;\n justify-content: center;\n\n &[data-size='small'] {\n width: var(--bui-space-8);\n }\n\n &[data-size='medium'] {\n width: var(--bui-space-10);\n }\n }\n\n .SearchField-module_bui-InputClear__JCu80 {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-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 }\n\n .SearchField-module_bui-InputClear__JCu80:hover {\n color: var(--bui-fg-primary);\n }\n\n .SearchField-module_bui-InputClear__JCu80[data-size='small'] {\n width: 2rem;\n height: 2rem;\n }\n\n .SearchField-module_bui-InputClear__JCu80[data-size='medium'] {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n .SearchField-module_bui-InputClear__JCu80 svg {\n width: 1rem;\n height: 1rem;\n }\n}\n";
|
|
4
|
+
var stylesSearchField = {"bui-SearchField":"SearchField-module_bui-SearchField__2TyT_","bui-InputClear":"SearchField-module_bui-InputClear__JCu80","bui-Input":"SearchField-module_bui-Input__FcOCK","bui-InputWrapper":"SearchField-module_bui-InputWrapper__2WERV","bui-InputIcon":"SearchField-module_bui-InputIcon__37FbR"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { stylesSearchField as default };
|
|
8
|
+
//# sourceMappingURL=SearchField.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchField.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -4,19 +4,25 @@ import { Select as Select$1, Button, SelectValue, Popover, ListBox, ListBoxItem,
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
6
6
|
import { FieldLabel } from '../FieldLabel/FieldLabel.esm.js';
|
|
7
|
-
import '@remixicon/react';
|
|
8
|
-
import { Icon } from '../Icon/Icon.esm.js';
|
|
9
|
-
import '../Icon/context.esm.js';
|
|
10
7
|
import { FieldError } from '../FieldError/FieldError.esm.js';
|
|
8
|
+
import styles from './Select.module.css.esm.js';
|
|
9
|
+
import stylesPopover from '../Popover/Popover.module.css.esm.js';
|
|
10
|
+
import { RiArrowDownSLine, RiCheckLine } from '@remixicon/react';
|
|
11
11
|
|
|
12
12
|
const Select = forwardRef((props, ref) => {
|
|
13
|
+
const { classNames: popoverClassNames } = useStyles("Popover");
|
|
14
|
+
const { classNames, dataAttributes, cleanedProps } = useStyles("Select", {
|
|
15
|
+
size: "small",
|
|
16
|
+
placeholder: "Select an option",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
13
19
|
const {
|
|
14
20
|
className,
|
|
15
21
|
label,
|
|
16
22
|
description,
|
|
17
23
|
options,
|
|
18
|
-
placeholder
|
|
19
|
-
size
|
|
24
|
+
placeholder,
|
|
25
|
+
size,
|
|
20
26
|
icon,
|
|
21
27
|
"aria-label": ariaLabel,
|
|
22
28
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -24,11 +30,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
24
30
|
secondaryLabel,
|
|
25
31
|
style,
|
|
26
32
|
...rest
|
|
27
|
-
} =
|
|
28
|
-
const { classNames: popoverClassNames } = useStyles("Popover");
|
|
29
|
-
const { classNames, dataAttributes } = useStyles("Select", {
|
|
30
|
-
size
|
|
31
|
-
});
|
|
33
|
+
} = cleanedProps;
|
|
32
34
|
useEffect(() => {
|
|
33
35
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
34
36
|
console.warn(
|
|
@@ -40,7 +42,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
40
42
|
return /* @__PURE__ */ jsxs(
|
|
41
43
|
Select$1,
|
|
42
44
|
{
|
|
43
|
-
className: clsx(classNames.root, className),
|
|
45
|
+
className: clsx(classNames.root, styles[classNames.root], className),
|
|
44
46
|
...dataAttributes,
|
|
45
47
|
ref,
|
|
46
48
|
"aria-label": ariaLabel,
|
|
@@ -58,28 +60,61 @@ const Select = forwardRef((props, ref) => {
|
|
|
58
60
|
/* @__PURE__ */ jsxs(
|
|
59
61
|
Button,
|
|
60
62
|
{
|
|
61
|
-
className: classNames.trigger,
|
|
63
|
+
className: clsx(classNames.trigger, styles[classNames.trigger]),
|
|
62
64
|
"data-size": dataAttributes["data-size"],
|
|
63
65
|
children: [
|
|
64
66
|
icon,
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
66
|
-
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
SelectValue,
|
|
69
|
+
{
|
|
70
|
+
className: clsx(classNames.value, styles[classNames.value])
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(RiArrowDownSLine, { "aria-hidden": "true" })
|
|
67
74
|
]
|
|
68
75
|
}
|
|
69
76
|
),
|
|
70
77
|
/* @__PURE__ */ jsx(FieldError, {}),
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
72
|
-
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Popover,
|
|
73
80
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
className: clsx(
|
|
82
|
+
popoverClassNames.root,
|
|
83
|
+
stylesPopover[popoverClassNames.root]
|
|
84
|
+
),
|
|
85
|
+
children: /* @__PURE__ */ jsx(ListBox, { className: clsx(classNames.list, styles[classNames.list]), children: options?.map((option) => /* @__PURE__ */ jsxs(
|
|
86
|
+
ListBoxItem,
|
|
87
|
+
{
|
|
88
|
+
id: option.value,
|
|
89
|
+
className: clsx(classNames.item, styles[classNames.item]),
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: clsx(
|
|
95
|
+
classNames.itemIndicator,
|
|
96
|
+
styles[classNames.itemIndicator]
|
|
97
|
+
),
|
|
98
|
+
children: /* @__PURE__ */ jsx(RiCheckLine, {})
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
Text,
|
|
103
|
+
{
|
|
104
|
+
slot: "label",
|
|
105
|
+
className: clsx(
|
|
106
|
+
classNames.itemLabel,
|
|
107
|
+
styles[classNames.itemLabel]
|
|
108
|
+
),
|
|
109
|
+
children: option.label
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
option.value
|
|
115
|
+
)) })
|
|
116
|
+
}
|
|
117
|
+
)
|
|
83
118
|
]
|
|
84
119
|
}
|
|
85
120
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n Select as AriaSelect,\n SelectValue,\n Button,\n Popover,\n ListBox,\n ListBoxItem,\n Text,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { SelectProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { FieldLabel } from '../FieldLabel';\nimport {
|
|
1
|
+
{"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useEffect } from 'react';\nimport {\n Select as AriaSelect,\n SelectValue,\n Button,\n Popover,\n ListBox,\n ListBoxItem,\n Text,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { SelectProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport styles from './Select.module.css';\nimport stylesPopover from '../Popover/Popover.module.css';\nimport { RiArrowDownSLine, RiCheckLine } from '@remixicon/react';\n\n/** @public */\nexport const Select = forwardRef<HTMLDivElement, SelectProps>((props, ref) => {\n const { classNames: popoverClassNames } = useStyles('Popover');\n const { classNames, dataAttributes, cleanedProps } = useStyles('Select', {\n size: 'small',\n placeholder: 'Select an option',\n ...props,\n });\n\n const {\n className,\n label,\n description,\n options,\n placeholder,\n size,\n icon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n isRequired,\n secondaryLabel,\n style,\n ...rest\n } = cleanedProps;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaSelect\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...rest}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <Button\n className={clsx(classNames.trigger, styles[classNames.trigger])}\n data-size={dataAttributes['data-size']}\n >\n {icon}\n <SelectValue\n className={clsx(classNames.value, styles[classNames.value])}\n />\n <RiArrowDownSLine aria-hidden=\"true\" />\n </Button>\n <FieldError />\n <Popover\n className={clsx(\n popoverClassNames.root,\n stylesPopover[popoverClassNames.root],\n )}\n >\n <ListBox className={clsx(classNames.list, styles[classNames.list])}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n className={clsx(classNames.item, styles[classNames.item])}\n >\n <div\n className={clsx(\n classNames.itemIndicator,\n styles[classNames.itemIndicator],\n )}\n >\n <RiCheckLine />\n </div>\n <Text\n slot=\"label\"\n className={clsx(\n classNames.itemLabel,\n styles[classNames.itemLabel],\n )}\n >\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;AAoCO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,iBAAA,EAAkB,GAAI,UAAU,SAAS,CAAA;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,OAAA;AAAA,IACN,WAAA,EAAa,kBAAA;AAAA,IACb,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AA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AA;AAAA,cApBK,MAAA,CAAO;AAAA,aAsBf,CAAA,EACH;AAAA;AAAA;AACF;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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-module_bui-Select__LDZ15[data-invalid] {\n & .Select-module_bui-SelectTrigger__3kJBt {\n border-color: var(--bui-fg-danger);\n }\n }\n\n .Select-module_bui-SelectTrigger__3kJBt {\n box-sizing: border-box;\n border-radius: var(--bui-radius-3);\n border: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\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\n & svg {\n flex-shrink: 0;\n color: var(--bui-fg-secondary);\n }\n\n &[data-size='small'] {\n height: 2rem;\n padding-inline: var(--bui-space-3);\n }\n\n &[data-size='medium'] {\n height: 3rem;\n padding-inline: var(--bui-space-4);\n }\n\n &[data-size='small'] svg {\n width: 1rem;\n height: 1rem;\n }\n\n &[data-size='medium'] svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n &:hover {\n transition: border-color 0.2s ease-in-out, outline-color 0.2s ease-in-out;\n border-color: var(--bui-border-hover);\n }\n\n &:focus-visible {\n border-color: var(--bui-border-pressed);\n outline: 0;\n }\n\n &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n &[data-invalid]:hover {\n border-width: 2px;\n }\n\n &[data-invalid]:focus-visible {\n border-width: 2px;\n }\n\n &[disabled] {\n cursor: not-allowed;\n border-color: var(--bui-border-disabled);\n color: var(--bui-fg-disabled);\n }\n\n &[disabled] .Select-module_bui-SelectValue__jdoc- {\n color: var(--bui-fg-disabled);\n }\n\n &[data-popup-open] .Select-module_bui-SelectIcon__e97yW {\n transform: rotate(180deg);\n }\n }\n\n .Select-module_bui-SelectValue__jdoc- {\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 color: var(--bui-fg-primary);\n text-align: left;\n\n & .Select-module_bui-SelectItemIndicator__1y7zW {\n display: none;\n }\n\n &[disabled] {\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select-module_bui-SelectItem__145pz {\n position: relative;\n width: var(--anchor-width);\n display: grid;\n grid-template-areas: 'icon text';\n grid-template-columns: 1rem 1fr;\n align-items: center;\n padding-block: var(--bui-space-2);\n padding-left: var(--bui-space-3);\n padding-right: var(--bui-space-4);\n color: var(--bui-fg-primary);\n border-radius: var(--bui-radius-3);\n cursor: pointer;\n user-select: none;\n font-size: var(--bui-font-size-3);\n gap: var(--bui-space-1);\n outline: none;\n\n &[data-focused] {\n z-index: 0;\n position: relative;\n color: var(--bui-fg-primary);\n }\n\n &[data-focused]::before {\n content: '';\n z-index: -1;\n position: absolute;\n inset-block: 0;\n inset-inline: 0.25rem;\n border-radius: 0.25rem;\n background-color: var(--bui-bg-tint-hover);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n &[data-selected] .Select-module_bui-SelectItemIndicator__1y7zW {\n opacity: 1;\n }\n }\n\n .Select-module_bui-SelectItemIndicator__1y7zW {\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-module_bui-SelectItemLabel__1N_y- {\n flex: 1;\n grid-area: text;\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Select":"Select-module_bui-Select__LDZ15","bui-SelectTrigger":"Select-module_bui-SelectTrigger__3kJBt","bui-SelectValue":"Select-module_bui-SelectValue__jdoc-","bui-SelectIcon":"Select-module_bui-SelectIcon__e97yW","bui-SelectItemIndicator":"Select-module_bui-SelectItemIndicator__1y7zW","bui-SelectItem":"Select-module_bui-SelectItem__145pz","bui-SelectItemLabel":"Select-module_bui-SelectItemLabel__1N_y-"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=Select.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
3
|
+
import styles from './Skeleton.module.css.esm.js';
|
|
4
|
+
import clsx from 'clsx';
|
|
3
5
|
|
|
4
6
|
const Skeleton = (props) => {
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
+
const { classNames, cleanedProps } = useStyles("Skeleton", {
|
|
8
|
+
width: 80,
|
|
9
|
+
height: 24,
|
|
10
|
+
rounded: false,
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
const { width, height, rounded, style, ...rest } = cleanedProps;
|
|
7
14
|
return /* @__PURE__ */ jsx(
|
|
8
15
|
"div",
|
|
9
16
|
{
|
|
10
|
-
className: classNames.root,
|
|
17
|
+
className: clsx(classNames.root, styles[classNames.root]),
|
|
11
18
|
"data-rounded": rounded,
|
|
12
19
|
style: {
|
|
13
20
|
width,
|
|
14
|
-
height
|
|
21
|
+
height,
|
|
22
|
+
...style
|
|
15
23
|
},
|
|
16
24
|
...rest
|
|
17
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.esm.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useStyles } from '../../hooks/useStyles';\nimport { SkeletonProps } from './types';\n\n/** @public */\nexport const Skeleton = (props: SkeletonProps) => {\n const {
|
|
1
|
+
{"version":3,"file":"Skeleton.esm.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useStyles } from '../../hooks/useStyles';\nimport { SkeletonProps } from './types';\nimport styles from './Skeleton.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Skeleton = (props: SkeletonProps) => {\n const { classNames, cleanedProps } = useStyles('Skeleton', {\n width: 80,\n height: 24,\n rounded: false,\n ...props,\n });\n const { width, height, rounded, style, ...rest } = cleanedProps;\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root])}\n data-rounded={rounded}\n style={{\n width,\n height,\n ...style,\n }}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":";;;;;AAsBO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AAChD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,UAAA,EAAY;AAAA,IACzD,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,EAAA;AAAA,IACR,OAAA,EAAS,KAAA;AAAA,IACT,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM,EAAE,KAAA,EAAO,MAAA,EAAQ,SAAS,KAAA,EAAO,GAAG,MAAK,GAAI,YAAA;AAEnD,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,MACxD,cAAA,EAAc,OAAA;AAAA,MACd,KAAA,EAAO;AAAA,QACL,KAAA;AAAA,QACA,MAAA;AAAA,QACA,GAAG;AAAA,OACL;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
|
|
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 .Skeleton-module_bui-Skeleton__10yWY {\n animation: var(--bui-animate-pulse);\n background-color: var(--bui-bg-surface-2);\n border-radius: var(--bui-radius-2);\n }\n\n .Skeleton-module_bui-Skeleton__10yWY[data-rounded='true'] {\n border-radius: var(--bui-radius-full);\n }\n}\n";
|
|
4
|
+
var styles = {"bui-Skeleton":"Skeleton-module_bui-Skeleton__10yWY"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { styles as default };
|
|
8
|
+
//# sourceMappingURL=Skeleton.module.css.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -2,14 +2,30 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { Switch as Switch$1 } from 'react-aria-components';
|
|
4
4
|
import { useStyles } from '../../hooks/useStyles.esm.js';
|
|
5
|
+
import styles from './Switch.module.css.esm.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
5
7
|
|
|
6
8
|
const Switch = forwardRef(
|
|
7
|
-
(
|
|
8
|
-
const { classNames } = useStyles("Switch");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const { classNames, cleanedProps } = useStyles("Switch", props);
|
|
11
|
+
const { label, ...rest } = cleanedProps;
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
Switch$1,
|
|
14
|
+
{
|
|
15
|
+
className: clsx(classNames.root, styles[classNames.root]),
|
|
16
|
+
ref,
|
|
17
|
+
...rest,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: clsx(classNames.indicator, styles[classNames.indicator])
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
label
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
13
29
|
}
|
|
14
30
|
);
|
|
15
31
|
Switch.displayName = "Switch";
|