@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.
Files changed (186) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/css/styles.css +6581 -8397
  3. package/dist/components/Avatar/Avatar.esm.js +21 -7
  4. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  5. package/dist/components/Avatar/Avatar.module.css.esm.js +8 -0
  6. package/dist/components/Avatar/Avatar.module.css.esm.js.map +1 -0
  7. package/dist/components/Box/Box.esm.js +20 -23
  8. package/dist/components/Box/Box.esm.js.map +1 -1
  9. package/dist/components/Box/Box.module.css.esm.js +8 -0
  10. package/dist/components/Box/Box.module.css.esm.js.map +1 -0
  11. package/dist/components/Button/Button.esm.js +7 -13
  12. package/dist/components/Button/Button.esm.js.map +1 -1
  13. package/dist/components/Button/Button.module.css.esm.js +8 -0
  14. package/dist/components/Button/Button.module.css.esm.js.map +1 -0
  15. package/dist/components/ButtonIcon/ButtonIcon.esm.js +14 -12
  16. package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
  17. package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js +8 -0
  18. package/dist/components/ButtonIcon/ButtonIcon.module.css.esm.js.map +1 -0
  19. package/dist/components/ButtonLink/ButtonLink.esm.js +8 -13
  20. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
  21. package/dist/components/Card/Card.esm.js +46 -28
  22. package/dist/components/Card/Card.esm.js.map +1 -1
  23. package/dist/components/Card/Card.module.css.esm.js +8 -0
  24. package/dist/components/Card/Card.module.css.esm.js.map +1 -0
  25. package/dist/components/Checkbox/Checkbox.esm.js +14 -49
  26. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  27. package/dist/components/Checkbox/Checkbox.module.css.esm.js +8 -0
  28. package/dist/components/Checkbox/Checkbox.module.css.esm.js.map +1 -0
  29. package/dist/components/Collapsible/Collapsible.esm.js +14 -9
  30. package/dist/components/Collapsible/Collapsible.esm.js.map +1 -1
  31. package/dist/components/Collapsible/Collapsible.module.css.esm.js +8 -0
  32. package/dist/components/Collapsible/Collapsible.module.css.esm.js.map +1 -0
  33. package/dist/components/Container/Container.esm.js +22 -25
  34. package/dist/components/Container/Container.esm.js.map +1 -1
  35. package/dist/components/Container/Container.module.css.esm.js +8 -0
  36. package/dist/components/Container/Container.module.css.esm.js.map +1 -0
  37. package/dist/components/Dialog/Dialog.esm.js +103 -0
  38. package/dist/components/Dialog/Dialog.esm.js.map +1 -0
  39. package/dist/components/Dialog/Dialog.module.css.esm.js +8 -0
  40. package/dist/components/Dialog/Dialog.module.css.esm.js.map +1 -0
  41. package/dist/components/FieldError/FieldError.esm.js +5 -2
  42. package/dist/components/FieldError/FieldError.esm.js.map +1 -1
  43. package/dist/components/FieldError/FieldError.module.css.esm.js +8 -0
  44. package/dist/components/FieldError/FieldError.module.css.esm.js.map +1 -0
  45. package/dist/components/FieldLabel/FieldLabel.esm.js +50 -13
  46. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  47. package/dist/components/FieldLabel/FieldLabel.module.css.esm.js +8 -0
  48. package/dist/components/FieldLabel/FieldLabel.module.css.esm.js.map +1 -0
  49. package/dist/components/Flex/Flex.esm.js +22 -18
  50. package/dist/components/Flex/Flex.esm.js.map +1 -1
  51. package/dist/components/Flex/Flex.module.css.esm.js +8 -0
  52. package/dist/components/Flex/Flex.module.css.esm.js.map +1 -0
  53. package/dist/components/Grid/Grid.esm.js +41 -29
  54. package/dist/components/Grid/Grid.esm.js.map +1 -1
  55. package/dist/components/Grid/Grid.module.css.esm.js +8 -0
  56. package/dist/components/Grid/Grid.module.css.esm.js.map +1 -0
  57. package/dist/components/Header/Header.esm.js +22 -11
  58. package/dist/components/Header/Header.esm.js.map +1 -1
  59. package/dist/components/Header/Header.module.css.esm.js +8 -0
  60. package/dist/components/Header/Header.module.css.esm.js.map +1 -0
  61. package/dist/components/Header/HeaderToolbar.esm.js +71 -7
  62. package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
  63. package/dist/components/HeaderPage/HeaderPage.esm.js +51 -31
  64. package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
  65. package/dist/components/HeaderPage/HeaderPage.module.css.esm.js +8 -0
  66. package/dist/components/HeaderPage/HeaderPage.module.css.esm.js.map +1 -0
  67. package/dist/components/Link/Link.esm.js +26 -15
  68. package/dist/components/Link/Link.esm.js.map +1 -1
  69. package/dist/components/Link/Link.module.css.esm.js +8 -0
  70. package/dist/components/Link/Link.module.css.esm.js.map +1 -0
  71. package/dist/components/Menu/Menu.esm.js +376 -118
  72. package/dist/components/Menu/Menu.esm.js.map +1 -1
  73. package/dist/components/Menu/Menu.module.css.esm.js +8 -0
  74. package/dist/components/Menu/Menu.module.css.esm.js.map +1 -0
  75. package/dist/components/Popover/Popover.module.css.esm.js +8 -0
  76. package/dist/components/Popover/Popover.module.css.esm.js.map +1 -0
  77. package/dist/components/RadioGroup/RadioGroup.esm.js +6 -5
  78. package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
  79. package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +8 -0
  80. package/dist/components/RadioGroup/RadioGroup.module.css.esm.js.map +1 -0
  81. package/dist/components/SearchField/SearchField.esm.js +44 -23
  82. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  83. package/dist/components/SearchField/SearchField.module.css.esm.js +8 -0
  84. package/dist/components/SearchField/SearchField.module.css.esm.js.map +1 -0
  85. package/dist/components/Select/Select.esm.js +60 -25
  86. package/dist/components/Select/Select.esm.js.map +1 -1
  87. package/dist/components/Select/Select.module.css.esm.js +8 -0
  88. package/dist/components/Select/Select.module.css.esm.js.map +1 -0
  89. package/dist/components/Skeleton/Skeleton.esm.js +12 -4
  90. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  91. package/dist/components/Skeleton/Skeleton.module.css.esm.js +8 -0
  92. package/dist/components/Skeleton/Skeleton.module.css.esm.js.map +1 -0
  93. package/dist/components/Switch/Switch.esm.js +22 -6
  94. package/dist/components/Switch/Switch.esm.js.map +1 -1
  95. package/dist/components/Switch/Switch.module.css.esm.js +8 -0
  96. package/dist/components/Switch/Switch.module.css.esm.js.map +1 -0
  97. package/dist/components/Table/Table.module.css.esm.js +8 -0
  98. package/dist/components/Table/Table.module.css.esm.js.map +1 -0
  99. package/dist/components/Table/components/Cell.esm.js +44 -17
  100. package/dist/components/Table/components/Cell.esm.js.map +1 -1
  101. package/dist/components/Table/components/CellProfile.esm.js +71 -26
  102. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  103. package/dist/components/Table/components/Column.esm.js +39 -9
  104. package/dist/components/Table/components/Column.esm.js.map +1 -1
  105. package/dist/components/Table/components/Row.esm.js +19 -11
  106. package/dist/components/Table/components/Row.esm.js.map +1 -1
  107. package/dist/components/Table/components/Table.esm.js +8 -3
  108. package/dist/components/Table/components/Table.esm.js.map +1 -1
  109. package/dist/components/Table/components/TableBody.esm.js +13 -2
  110. package/dist/components/Table/components/TableBody.esm.js.map +1 -1
  111. package/dist/components/Table/components/TableHeader.esm.js +20 -10
  112. package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
  113. package/dist/components/TablePagination/TablePagination.esm.js +80 -63
  114. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  115. package/dist/components/TablePagination/TablePagination.module.css.esm.js +8 -0
  116. package/dist/components/TablePagination/TablePagination.module.css.esm.js.map +1 -0
  117. package/dist/components/Tabs/Tabs.esm.js +55 -31
  118. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  119. package/dist/components/Tabs/Tabs.module.css.esm.js +8 -0
  120. package/dist/components/Tabs/Tabs.module.css.esm.js.map +1 -0
  121. package/dist/components/Tabs/TabsIndicators.esm.js +14 -2
  122. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
  123. package/dist/components/TagGroup/TagGroup.esm.js +35 -19
  124. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  125. package/dist/components/TagGroup/TagGroup.module.css.esm.js +8 -0
  126. package/dist/components/TagGroup/TagGroup.module.css.esm.js.map +1 -0
  127. package/dist/components/Text/Text.esm.js +10 -19
  128. package/dist/components/Text/Text.esm.js.map +1 -1
  129. package/dist/components/Text/Text.module.css.esm.js +8 -0
  130. package/dist/components/Text/Text.module.css.esm.js.map +1 -0
  131. package/dist/components/TextField/TextField.esm.js +29 -16
  132. package/dist/components/TextField/TextField.esm.js.map +1 -1
  133. package/dist/components/TextField/TextField.module.css.esm.js +8 -0
  134. package/dist/components/TextField/TextField.module.css.esm.js.map +1 -0
  135. package/dist/components/Tooltip/Tooltip.esm.js +19 -7
  136. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
  137. package/dist/components/Tooltip/Tooltip.module.css.esm.js +8 -0
  138. package/dist/components/Tooltip/Tooltip.module.css.esm.js.map +1 -0
  139. package/dist/hooks/useStyles.esm.js +65 -9
  140. package/dist/hooks/useStyles.esm.js.map +1 -1
  141. package/dist/index.d.ts +133 -433
  142. package/dist/index.esm.js +1 -9
  143. package/dist/index.esm.js.map +1 -1
  144. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
  145. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
  146. package/dist/utils/componentDefinitions.esm.js +105 -15
  147. package/dist/utils/componentDefinitions.esm.js.map +1 -1
  148. package/dist/utils/utilityClassMap.esm.js +189 -0
  149. package/dist/utils/utilityClassMap.esm.js.map +1 -0
  150. package/package.json +3 -3
  151. package/dist/components/Box/Box.props.esm.js +0 -7
  152. package/dist/components/Box/Box.props.esm.js.map +0 -1
  153. package/dist/components/Flex/Flex.props.esm.js +0 -31
  154. package/dist/components/Flex/Flex.props.esm.js.map +0 -1
  155. package/dist/components/Grid/Grid.props.esm.js +0 -58
  156. package/dist/components/Grid/Grid.props.esm.js.map +0 -1
  157. package/dist/components/Icon/Icon.esm.js +0 -29
  158. package/dist/components/Icon/Icon.esm.js.map +0 -1
  159. package/dist/components/Icon/context.esm.js +0 -10
  160. package/dist/components/Icon/context.esm.js.map +0 -1
  161. package/dist/components/Icon/icons.esm.js +0 -63
  162. package/dist/components/Icon/icons.esm.js.map +0 -1
  163. package/dist/components/Icon/provider.esm.js +0 -12
  164. package/dist/components/Icon/provider.esm.js.map +0 -1
  165. package/dist/components/ScrollArea/ScrollArea.esm.js +0 -63
  166. package/dist/components/ScrollArea/ScrollArea.esm.js.map +0 -1
  167. package/dist/props/display.props.esm.js +0 -12
  168. package/dist/props/display.props.esm.js.map +0 -1
  169. package/dist/props/gap-props.esm.js +0 -15
  170. package/dist/props/gap-props.esm.js.map +0 -1
  171. package/dist/props/height.props.esm.js +0 -23
  172. package/dist/props/height.props.esm.js.map +0 -1
  173. package/dist/props/margin.props.esm.js +0 -54
  174. package/dist/props/margin.props.esm.js.map +0 -1
  175. package/dist/props/padding.props.esm.js +0 -54
  176. package/dist/props/padding.props.esm.js.map +0 -1
  177. package/dist/props/position.props.esm.js +0 -18
  178. package/dist/props/position.props.esm.js.map +0 -1
  179. package/dist/props/prop-def.esm.js +0 -4
  180. package/dist/props/prop-def.esm.js.map +0 -1
  181. package/dist/props/spacing.props.esm.js +0 -28
  182. package/dist/props/spacing.props.esm.js.map +0 -1
  183. package/dist/props/width.props.esm.js +0 -23
  184. package/dist/props/width.props.esm.js.map +0 -1
  185. package/dist/utils/extractProps.esm.js +0 -49
  186. 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
- } = props;
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 } = props;\n\n const { classNames } = useStyles('RadioGroup');\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, 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={classNames.content}>{children}</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, className)}\n {...rest}\n ref={ref}\n />\n );\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["AriaRadioGroup","AriaRadio"],"mappings":";;;;;;;;AA6BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,YAAA,EAAc,SAAA;AAAA,MACd,iBAAA,EAAmB,cAAA;AAAA,MACnB,QAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,YAAY,CAAA;AAE7C,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,QAAA,OAAA,CAAQ,IAAA;AAAA,UACN;AAAA,SACF;AAAA,MACF;AAAA,IACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAGrC,IAAA,MAAM,kBAAA,GACJ,cAAA,KAAmB,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAE/C,IAAA,uBACE,IAAA;AAAA,MAACA,YAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,SAAS,CAAA;AAAA,QAC1C,YAAA,EAAY,SAAA;AAAA,QACZ,iBAAA,EAAiB,cAAA;AAAA,QAChB,GAAG,IAAA;AAAA,QACJ,GAAA;AAAA,QAEA,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,KAAA;AAAA,cACA,cAAA,EAAgB,kBAAA;AAAA,cAChB;AAAA;AAAA,WACF;AAAA,0BACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,UAAA,CAAW,SAAU,QAAA,EAAS,CAAA;AAAA,8BAC7C,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAGlB,MAAM,KAAA,GAAQ,UAAA,CAAyC,CAAC,KAAA,EAAO,GAAA,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,IAAA,CAAK,UAAA,CAAW,KAAA,EAAO,SAAS,CAAA;AAAA,MAC1C,GAAG,IAAA;AAAA,MACJ;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
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,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AA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AG,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, dataAttributes } = useStyles(
37
- "TextField",
38
- {
39
- size
40
- }
41
- );
42
- const { classNames: searchFieldClassNames } = useStyles("SearchField", {});
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: textFieldClassNames.inputWrapper,
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: textFieldClassNames.inputIcon,
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: textFieldClassNames.input,
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: searchFieldClassNames.clear,
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 className,\n icon,\n size = 'small',\n label,\n secondaryLabel,\n description,\n isRequired,\n onChange,\n placeholder = 'Search',\n startCollapsed = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\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, dataAttributes } = useStyles(\n 'TextField',\n {\n size,\n },\n );\n\n const { classNames: searchFieldClassNames } = useStyles('SearchField', {});\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 className,\n )}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-start-collapsed={startCollapsed}\n data-collapsed={isCollapsed}\n onFocusChange={handleClick}\n onChange={handleChange}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={textFieldClassNames.inputWrapper}\n data-size={dataAttributes['data-size']}\n >\n {icon !== false && (\n <div\n className={textFieldClassNames.inputIcon}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n className={textFieldClassNames.input}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={searchFieldClassNames.clear}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["AriaSearchField"],"mappings":";;;;;;;;;AA+BO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA,GAAO,OAAA;AAAA,MACP,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA,GAAc,QAAA;AAAA,MACd,cAAA,GAAiB,KAAA;AAAA,MACjB,YAAA,EAAc,SAAA;AAAA,MACd,iBAAA,EAAmB,cAAA;AAAA,MACnB,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA;AACpD,IAAA,MAAM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AW,CAAA;AAAA,oBAErC,8BAAC,iBAAA,EAAA,EAAkB;AAAA;AAAA;AACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;"}
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,M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EAEJ;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 = "Select an option",
19
- size = "small",
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
- } = props;
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(SelectValue, { className: classNames.value }),
66
- /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", name: "chevron-down" })
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(Popover, { className: popoverClassNames.root, children: /* @__PURE__ */ jsx(ListBox, { className: classNames.list, children: options?.map((option) => /* @__PURE__ */ jsxs(
72
- ListBoxItem,
78
+ /* @__PURE__ */ jsx(
79
+ Popover,
73
80
  {
74
- id: option.value,
75
- className: classNames.item,
76
- children: [
77
- /* @__PURE__ */ jsx("div", { className: classNames.itemIndicator, children: /* @__PURE__ */ jsx(Icon, { name: "check" }) }),
78
- /* @__PURE__ */ jsx(Text, { slot: "label", className: classNames.itemLabel, children: option.label })
79
- ]
80
- },
81
- option.value
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 { Icon } from '../Icon';\nimport { FieldError } from '../FieldError';\n\n/** @public */\nexport const Select = forwardRef<HTMLDivElement, SelectProps>((props, ref) => {\n const {\n className,\n label,\n description,\n options,\n placeholder = 'Select an option',\n size = 'small',\n icon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n isRequired,\n secondaryLabel,\n style,\n ...rest\n } = props;\n\n const { classNames: popoverClassNames } = useStyles('Popover');\n const { classNames, dataAttributes } = useStyles('Select', {\n size,\n });\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, 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={classNames.trigger}\n data-size={dataAttributes['data-size']}\n >\n {icon}\n <SelectValue className={classNames.value} />\n <Icon aria-hidden=\"true\" name=\"chevron-down\" />\n </Button>\n <FieldError />\n <Popover className={popoverClassNames.root}>\n <ListBox className={classNames.list}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n className={classNames.item}\n >\n <div className={classNames.itemIndicator}>\n <Icon name=\"check\" />\n </div>\n <Text slot=\"label\" className={classNames.itemLabel}>\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;AAkCO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA,GAAc,kBAAA;AAAA,IACd,IAAA,GAAO,OAAA;AAAA,IACP,IAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,cAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,UAAA,EAAY,iBAAA,EAAkB,GAAI,UAAU,SAAS,CAAA;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAe,GAAI,UAAU,QAAA,EAAU;AAAA,IACzD;AAAA,GACD,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,MAAA,OAAA,CAAQ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UAAC,WAAA;AAAA,UAAA;AAAA,YAEC,IAAI,MAAA,CAAO,KAAA;AAAA,YACX,WAAW,UAAA,CAAW,IAAA;AAAA,YAEtB,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,UAAA,CAAW,aAAA,EACzB,8BAAC,IAAA,EAAA,EAAK,IAAA,EAAK,SAAQ,CAAA,EACrB,CAAA;AAAA,8BACA,GAAA,CAAC,QAAK,IAAA,EAAK,OAAA,EAAQ,WAAW,UAAA,CAAW,SAAA,EACtC,iBAAO,KAAA,EACV;AAAA;AAAA,WAAA;AAAA,UATK,MAAA,CAAO;AAAA,SAWf,GACH,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
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":";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AAC,KAAA;AAAA,oBAAA;AAAA,sBACC,SAAA,EAAW,IAAA;AAAA,wBACT,UAAA,CAAW,aAAA;AAAA,wBACX,MAAA,CAAO,WAAW,aAAa;AAAA,uBACjC;AAAA,sBAEA,8BAAC,WAAA,EAAA,EAAY;AAAA;AAAA,mBACf;AAAA,kCACA,GAAA;AAAA,oBAAC,IAAA;AAAA,oBAAA;AAAA,sBACC,IAAA,EAAK,OAAA;AAAA,sBACL,SAAA,EAAW,IAAA;AAAA,wBACT,UAAA,CAAW,SAAA;AAAA,wBACX,MAAA,CAAO,WAAW,SAAS;AAAA,uBAC7B;AAAA,sBAEC,QAAA,EAAA,MAAA,CAAO;AAAA;AAAA;AACV;AAAA,eAAA;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 { width = 80, height = 24, rounded = false, ...rest } = props;
6
- const { classNames } = useStyles("Skeleton");
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 { width = 80, height = 24, rounded = false, ...rest } = props;\n const { classNames } = useStyles('Skeleton');\n\n return (\n <div\n className={classNames.root}\n data-rounded={rounded}\n style={{\n width,\n height,\n }}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AAChD,EAAA,MAAM,EAAE,QAAQ,EAAA,EAAI,MAAA,GAAS,IAAI,OAAA,GAAU,KAAA,EAAO,GAAG,IAAA,EAAK,GAAI,KAAA;AAC9D,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,UAAU,CAAA;AAE3C,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAW,UAAA,CAAW,IAAA;AAAA,MACtB,cAAA,EAAc,OAAA;AAAA,MACd,KAAA,EAAO;AAAA,QACL,KAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
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
- ({ label, ...props }, ref) => {
8
- const { classNames } = useStyles("Switch");
9
- return /* @__PURE__ */ jsxs(Switch$1, { className: classNames.root, ref, ...props, children: [
10
- /* @__PURE__ */ jsx("div", { className: classNames.indicator }),
11
- label
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";