@backstage/ui 0.12.1-next.0 → 0.13.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/dist/analytics/BUIProvider.esm.js +18 -0
  3. package/dist/analytics/BUIProvider.esm.js.map +1 -0
  4. package/dist/analytics/getNodeText.esm.js +21 -0
  5. package/dist/analytics/getNodeText.esm.js.map +1 -0
  6. package/dist/analytics/useAnalytics.esm.js +26 -0
  7. package/dist/analytics/useAnalytics.esm.js.map +1 -0
  8. package/dist/components/Accordion/Accordion.esm.js +1 -0
  9. package/dist/components/Accordion/Accordion.esm.js.map +1 -1
  10. package/dist/components/Accordion/definition.esm.js +3 -2
  11. package/dist/components/Accordion/definition.esm.js.map +1 -1
  12. package/dist/components/Alert/definition.esm.js +2 -1
  13. package/dist/components/Alert/definition.esm.js.map +1 -1
  14. package/dist/components/Avatar/Avatar.esm.js +8 -28
  15. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  16. package/dist/components/Avatar/definition.esm.js +18 -4
  17. package/dist/components/Avatar/definition.esm.js.map +1 -1
  18. package/dist/components/Box/definition.esm.js +2 -1
  19. package/dist/components/Box/definition.esm.js.map +1 -1
  20. package/dist/components/Button/definition.esm.js +3 -3
  21. package/dist/components/Button/definition.esm.js.map +1 -1
  22. package/dist/components/ButtonIcon/definition.esm.js +3 -3
  23. package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
  24. package/dist/components/ButtonLink/ButtonLink.esm.js +10 -1
  25. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
  26. package/dist/components/ButtonLink/definition.esm.js +5 -3
  27. package/dist/components/ButtonLink/definition.esm.js.map +1 -1
  28. package/dist/components/Card/Card.esm.js +67 -6
  29. package/dist/components/Card/Card.esm.js.map +1 -1
  30. package/dist/components/Card/Card.module.css.esm.js +2 -2
  31. package/dist/components/Card/definition.esm.js +11 -3
  32. package/dist/components/Card/definition.esm.js.map +1 -1
  33. package/dist/components/Checkbox/Checkbox.esm.js +10 -17
  34. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  35. package/dist/components/Checkbox/definition.esm.js +17 -5
  36. package/dist/components/Checkbox/definition.esm.js.map +1 -1
  37. package/dist/components/Container/Container.esm.js +8 -13
  38. package/dist/components/Container/Container.esm.js.map +1 -1
  39. package/dist/components/Container/Container.module.css.esm.js +2 -2
  40. package/dist/components/Container/definition.esm.js +17 -2
  41. package/dist/components/Container/definition.esm.js.map +1 -1
  42. package/dist/components/Dialog/Dialog.esm.js +26 -59
  43. package/dist/components/Dialog/Dialog.esm.js.map +1 -1
  44. package/dist/components/Dialog/Dialog.module.css.esm.js +2 -2
  45. package/dist/components/Dialog/definition.esm.js +53 -8
  46. package/dist/components/Dialog/definition.esm.js.map +1 -1
  47. package/dist/components/FieldError/FieldError.esm.js +4 -13
  48. package/dist/components/FieldError/FieldError.esm.js.map +1 -1
  49. package/dist/components/FieldError/definition.esm.js +15 -2
  50. package/dist/components/FieldError/definition.esm.js.map +1 -1
  51. package/dist/components/FieldLabel/FieldLabel.esm.js +14 -59
  52. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  53. package/dist/components/FieldLabel/definition.esm.js +20 -2
  54. package/dist/components/FieldLabel/definition.esm.js.map +1 -1
  55. package/dist/components/Flex/Flex.esm.js +12 -22
  56. package/dist/components/Flex/Flex.esm.js.map +1 -1
  57. package/dist/components/Flex/definition.esm.js +20 -13
  58. package/dist/components/Flex/definition.esm.js.map +1 -1
  59. package/dist/components/FullPage/FullPage.esm.js +4 -13
  60. package/dist/components/FullPage/FullPage.esm.js.map +1 -1
  61. package/dist/components/FullPage/definition.esm.js +15 -2
  62. package/dist/components/FullPage/definition.esm.js.map +1 -1
  63. package/dist/components/Grid/Grid.esm.js +21 -40
  64. package/dist/components/Grid/Grid.esm.js.map +1 -1
  65. package/dist/components/Grid/definition.esm.js +31 -26
  66. package/dist/components/Grid/definition.esm.js.map +1 -1
  67. package/dist/components/Header/Header.esm.js +55 -0
  68. package/dist/components/Header/Header.esm.js.map +1 -0
  69. package/dist/components/Header/Header.module.css.esm.js +8 -0
  70. package/dist/components/Header/Header.module.css.esm.js.map +1 -0
  71. package/dist/components/Header/definition.esm.js +30 -0
  72. package/dist/components/Header/definition.esm.js.map +1 -0
  73. package/dist/components/Link/Link.esm.js +15 -34
  74. package/dist/components/Link/Link.esm.js.map +1 -1
  75. package/dist/components/Link/definition.esm.js +23 -15
  76. package/dist/components/Link/definition.esm.js.map +1 -1
  77. package/dist/components/Menu/Menu.esm.js +180 -344
  78. package/dist/components/Menu/Menu.esm.js.map +1 -1
  79. package/dist/components/Menu/Menu.module.css.esm.js +2 -2
  80. package/dist/components/Menu/definition.esm.js +116 -17
  81. package/dist/components/Menu/definition.esm.js.map +1 -1
  82. package/dist/components/PasswordField/PasswordField.esm.js +17 -52
  83. package/dist/components/PasswordField/PasswordField.esm.js.map +1 -1
  84. package/dist/components/PasswordField/PasswordField.module.css.esm.js +2 -2
  85. package/dist/components/PasswordField/definition.esm.js +29 -11
  86. package/dist/components/PasswordField/definition.esm.js.map +1 -1
  87. package/dist/components/PluginHeader/PluginHeader.esm.js +35 -46
  88. package/dist/components/PluginHeader/PluginHeader.esm.js.map +1 -1
  89. package/dist/components/PluginHeader/PluginHeader.module.css.esm.js +2 -2
  90. package/dist/components/PluginHeader/definition.esm.js +22 -3
  91. package/dist/components/PluginHeader/definition.esm.js.map +1 -1
  92. package/dist/components/Popover/Popover.esm.js +24 -32
  93. package/dist/components/Popover/Popover.esm.js.map +1 -1
  94. package/dist/components/Popover/Popover.module.css.esm.js +2 -2
  95. package/dist/components/Popover/definition.esm.js +17 -2
  96. package/dist/components/Popover/definition.esm.js.map +1 -1
  97. package/dist/components/RadioGroup/RadioGroup.esm.js +25 -44
  98. package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
  99. package/dist/components/RadioGroup/definition.esm.js +31 -5
  100. package/dist/components/RadioGroup/definition.esm.js.map +1 -1
  101. package/dist/components/SearchField/SearchField.esm.js +25 -45
  102. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  103. package/dist/components/SearchField/SearchField.module.css.esm.js +2 -2
  104. package/dist/components/SearchField/definition.esm.js +22 -5
  105. package/dist/components/SearchField/definition.esm.js.map +1 -1
  106. package/dist/components/Select/Select.esm.js +14 -23
  107. package/dist/components/Select/Select.esm.js.map +1 -1
  108. package/dist/components/Select/Select.module.css.esm.js +2 -2
  109. package/dist/components/Select/SelectContent.esm.js +8 -31
  110. package/dist/components/Select/SelectContent.esm.js.map +1 -1
  111. package/dist/components/Select/SelectListBox.esm.js +21 -44
  112. package/dist/components/Select/SelectListBox.esm.js.map +1 -1
  113. package/dist/components/Select/SelectTrigger.esm.js +11 -14
  114. package/dist/components/Select/SelectTrigger.esm.js.map +1 -1
  115. package/dist/components/Select/definition.esm.js +69 -17
  116. package/dist/components/Select/definition.esm.js.map +1 -1
  117. package/dist/components/Skeleton/Skeleton.esm.js +9 -13
  118. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  119. package/dist/components/Skeleton/definition.esm.js +19 -2
  120. package/dist/components/Skeleton/definition.esm.js.map +1 -1
  121. package/dist/components/Switch/Switch.esm.js +7 -22
  122. package/dist/components/Switch/Switch.esm.js.map +1 -1
  123. package/dist/components/Switch/definition.esm.js +16 -2
  124. package/dist/components/Switch/definition.esm.js.map +1 -1
  125. package/dist/components/Table/Table.module.css.esm.js +2 -2
  126. package/dist/components/Table/components/Cell.esm.js +4 -17
  127. package/dist/components/Table/components/Cell.esm.js.map +1 -1
  128. package/dist/components/Table/components/CellProfile.esm.js +12 -41
  129. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  130. package/dist/components/Table/components/CellText.esm.js +39 -73
  131. package/dist/components/Table/components/CellText.esm.js.map +1 -1
  132. package/dist/components/Table/components/Column.esm.js +8 -36
  133. package/dist/components/Table/components/Column.esm.js.map +1 -1
  134. package/dist/components/Table/components/Row.esm.js +22 -19
  135. package/dist/components/Table/components/Row.esm.js.map +1 -1
  136. package/dist/components/Table/components/Table.esm.js +8 -0
  137. package/dist/components/Table/components/Table.esm.js.map +1 -1
  138. package/dist/components/Table/components/TableBody.esm.js +4 -12
  139. package/dist/components/Table/components/TableBody.esm.js.map +1 -1
  140. package/dist/components/Table/components/TableHeader.esm.js +19 -29
  141. package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
  142. package/dist/components/Table/components/TableRoot.esm.js +5 -7
  143. package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
  144. package/dist/components/Table/definition.esm.js +101 -21
  145. package/dist/components/Table/definition.esm.js.map +1 -1
  146. package/dist/components/TablePagination/TablePagination.esm.js +24 -32
  147. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  148. package/dist/components/TablePagination/definition.esm.js +33 -2
  149. package/dist/components/TablePagination/definition.esm.js.map +1 -1
  150. package/dist/components/Tabs/Tabs.esm.js +57 -64
  151. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  152. package/dist/components/Tabs/TabsIndicators.esm.js +6 -18
  153. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
  154. package/dist/components/Tabs/definition.esm.js +65 -10
  155. package/dist/components/Tabs/definition.esm.js.map +1 -1
  156. package/dist/components/TagGroup/TagGroup.esm.js +49 -63
  157. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  158. package/dist/components/TagGroup/definition.esm.js +38 -8
  159. package/dist/components/TagGroup/definition.esm.js.map +1 -1
  160. package/dist/components/Text/Text.esm.js +6 -13
  161. package/dist/components/Text/Text.esm.js.map +1 -1
  162. package/dist/components/Text/definition.esm.js +19 -14
  163. package/dist/components/Text/definition.esm.js.map +1 -1
  164. package/dist/components/TextField/TextField.esm.js +16 -41
  165. package/dist/components/TextField/TextField.esm.js.map +1 -1
  166. package/dist/components/TextField/TextField.module.css.esm.js +2 -2
  167. package/dist/components/TextField/definition.esm.js +21 -6
  168. package/dist/components/TextField/definition.esm.js.map +1 -1
  169. package/dist/components/ToggleButton/ToggleButton.esm.js +11 -23
  170. package/dist/components/ToggleButton/ToggleButton.esm.js.map +1 -1
  171. package/dist/components/ToggleButton/definition.esm.js +18 -4
  172. package/dist/components/ToggleButton/definition.esm.js.map +1 -1
  173. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js +5 -18
  174. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js.map +1 -1
  175. package/dist/components/ToggleButtonGroup/definition.esm.js +15 -4
  176. package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
  177. package/dist/components/Tooltip/Tooltip.esm.js +24 -30
  178. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
  179. package/dist/components/Tooltip/Tooltip.module.css.esm.js +2 -2
  180. package/dist/components/Tooltip/definition.esm.js +17 -2
  181. package/dist/components/Tooltip/definition.esm.js.map +1 -1
  182. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +4 -12
  183. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -1
  184. package/dist/components/VisuallyHidden/definition.esm.js +15 -2
  185. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
  186. package/dist/css/styles.css +2 -4
  187. package/dist/hooks/useBg.esm.js +11 -2
  188. package/dist/hooks/useBg.esm.js.map +1 -1
  189. package/dist/hooks/useBreakpoint.esm.js +67 -27
  190. package/dist/hooks/useBreakpoint.esm.js.map +1 -1
  191. package/dist/hooks/useDefinition/defineComponent.esm.js.map +1 -1
  192. package/dist/hooks/useDefinition/useDefinition.esm.js +10 -3
  193. package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
  194. package/dist/index.d.ts +1036 -282
  195. package/dist/index.esm.js +7 -4
  196. package/dist/index.esm.js.map +1 -1
  197. package/package.json +5 -3
  198. package/dist/components/HeaderPage/HeaderPage.esm.js +0 -76
  199. package/dist/components/HeaderPage/HeaderPage.esm.js.map +0 -1
  200. package/dist/components/HeaderPage/HeaderPage.module.css.esm.js +0 -8
  201. package/dist/components/HeaderPage/HeaderPage.module.css.esm.js.map +0 -1
  202. package/dist/components/HeaderPage/definition.esm.js +0 -12
  203. package/dist/components/HeaderPage/definition.esm.js.map +0 -1
  204. package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js +0 -94
  205. package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js.map +0 -1
  206. package/dist/hooks/useMediaQuery.esm.js +0 -47
  207. package/dist/hooks/useMediaQuery.esm.js.map +0 -1
  208. package/dist/hooks/useStyles.esm.js +0 -53
  209. package/dist/hooks/useStyles.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonLink.esm.js","sources":["../../../src/components/ButtonLink/ButtonLink.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, Ref } from 'react';\nimport { Link as RALink } from 'react-aria-components';\nimport type { ButtonLinkProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ButtonLinkDefinition } from './definition';\nimport { InternalLinkProvider } from '../InternalLinkProvider';\n\n/** @public */\nexport const ButtonLink = forwardRef(\n (props: ButtonLinkProps, ref: Ref<HTMLAnchorElement>) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n ButtonLinkDefinition,\n props,\n );\n const { classes, iconStart, iconEnd, children } = ownProps;\n\n return (\n <InternalLinkProvider href={restProps.href}>\n <RALink\n className={classes.root}\n ref={ref}\n {...dataAttributes}\n {...restProps}\n >\n <span className={classes.content}>\n {iconStart}\n {children}\n {iconEnd}\n </span>\n </RALink>\n </InternalLinkProvider>\n );\n },\n);\n\nButtonLink.displayName = 'ButtonLink';\n"],"names":["RALink"],"mappings":";;;;;;;AAwBO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,MAC9C,oBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAW,OAAA,EAAS,UAAS,GAAI,QAAA;AAElD,IAAA,uBACE,GAAA,CAAC,oBAAA,EAAA,EAAqB,IAAA,EAAM,SAAA,CAAU,IAAA,EACpC,QAAA,kBAAA,GAAA;AAAA,MAACA,IAAA;AAAA,MAAA;AAAA,QACC,WAAW,OAAA,CAAQ,IAAA;AAAA,QACnB,GAAA;AAAA,QACC,GAAG,cAAA;AAAA,QACH,GAAG,SAAA;AAAA,QAEJ,QAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,OAAA,CAAQ,OAAA,EACtB,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,UACA,QAAA;AAAA,UACA;AAAA,SAAA,EACH;AAAA;AAAA,KACF,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
1
+ {"version":3,"file":"ButtonLink.esm.js","sources":["../../../src/components/ButtonLink/ButtonLink.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, Ref } from 'react';\nimport { Link as RALink } from 'react-aria-components';\nimport type { ButtonLinkProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ButtonLinkDefinition } from './definition';\nimport { InternalLinkProvider } from '../InternalLinkProvider';\nimport { getNodeText } from '../../analytics/getNodeText';\n\n/** @public */\nexport const ButtonLink = forwardRef(\n (props: ButtonLinkProps, ref: Ref<HTMLAnchorElement>) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n ButtonLinkDefinition,\n props,\n );\n const { classes, iconStart, iconEnd, children } = ownProps;\n\n const handlePress: typeof restProps.onPress = e => {\n restProps.onPress?.(e);\n const text =\n restProps['aria-label'] ??\n getNodeText(children) ??\n String(restProps.href ?? '');\n analytics.captureEvent('click', text, {\n attributes: { to: String(restProps.href ?? '') },\n });\n };\n\n return (\n <InternalLinkProvider href={restProps.href}>\n <RALink\n className={classes.root}\n ref={ref}\n {...dataAttributes}\n {...restProps}\n onPress={handlePress}\n >\n <span className={classes.content}>\n {iconStart}\n {children}\n {iconEnd}\n </span>\n </RALink>\n </InternalLinkProvider>\n );\n },\n);\n\nButtonLink.displayName = 'ButtonLink';\n"],"names":["RALink"],"mappings":";;;;;;;;AAyBO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAgB,WAAU,GAAI,aAAA;AAAA,MACzD,oBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAW,OAAA,EAAS,UAAS,GAAI,QAAA;AAElD,IAAA,MAAM,cAAwC,CAAA,CAAA,KAAK;AACjD,MAAA,SAAA,CAAU,UAAU,CAAC,CAAA;AACrB,MAAA,MAAM,IAAA,GACJ,SAAA,CAAU,YAAY,CAAA,IACtB,WAAA,CAAY,QAAQ,CAAA,IACpB,MAAA,CAAO,SAAA,CAAU,IAAA,IAAQ,EAAE,CAAA;AAC7B,MAAA,SAAA,CAAU,YAAA,CAAa,SAAS,IAAA,EAAM;AAAA,QACpC,YAAY,EAAE,EAAA,EAAI,OAAO,SAAA,CAAU,IAAA,IAAQ,EAAE,CAAA;AAAE,OAChD,CAAA;AAAA,IACH,CAAA;AAEA,IAAA,uBACE,GAAA,CAAC,oBAAA,EAAA,EAAqB,IAAA,EAAM,SAAA,CAAU,IAAA,EACpC,QAAA,kBAAA,GAAA;AAAA,MAACA,IAAA;AAAA,MAAA;AAAA,QACC,WAAW,OAAA,CAAQ,IAAA;AAAA,QACnB,GAAA;AAAA,QACC,GAAG,cAAA;AAAA,QACH,GAAG,SAAA;AAAA,QACJ,OAAA,EAAS,WAAA;AAAA,QAET,QAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,OAAA,CAAQ,OAAA,EACtB,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,UACA,QAAA;AAAA,UACA;AAAA,SAAA,EACH;AAAA;AAAA,KACF,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
@@ -1,8 +1,9 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'clsx';
3
- import 'react';
3
+ import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
+ import '../../analytics/useAnalytics.esm.js';
6
7
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
7
8
  import styles from './ButtonLink.module.css.esm.js';
8
9
 
@@ -13,14 +14,15 @@ const ButtonLinkDefinition = defineComponent()({
13
14
  content: "bui-ButtonLinkContent"
14
15
  },
15
16
  bg: "consumer",
17
+ analytics: true,
16
18
  propDefs: {
19
+ noTrack: {},
17
20
  size: { dataAttribute: true, default: "small" },
18
21
  variant: { dataAttribute: true, default: "primary" },
19
22
  iconStart: {},
20
23
  iconEnd: {},
21
24
  children: {},
22
- className: {},
23
- style: {}
25
+ className: {}
24
26
  }
25
27
  });
26
28
 
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonLink/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ButtonLinkOwnProps } from './types';\nimport styles from './ButtonLink.module.css';\n\n/**\n * Component definition for ButtonLink\n * @public\n */\nexport const ButtonLinkDefinition = defineComponent<ButtonLinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonLink',\n content: 'bui-ButtonLinkContent',\n },\n bg: 'consumer',\n propDefs: {\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n style: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACnD,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC;AAEZ,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonLink/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ButtonLinkOwnProps } from './types';\nimport styles from './ButtonLink.module.css';\n\n/**\n * Component definition for ButtonLink\n * @public\n */\nexport const ButtonLinkDefinition = defineComponent<ButtonLinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonLink',\n content: 'bui-ButtonLinkContent',\n },\n bg: 'consumer',\n analytics: true,\n propDefs: {\n noTrack: {},\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,EAAA,EAAI,UAAA;AAAA,EACJ,SAAA,EAAW,IAAA;AAAA,EACX,QAAA,EAAU;AAAA,IACR,SAAS,EAAC;AAAA,IACV,IAAA,EAAM,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,OAAA,EAAQ;AAAA,IAC9C,OAAA,EAAS,EAAE,aAAA,EAAe,IAAA,EAAM,SAAS,SAAA,EAAU;AAAA,IACnD,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -1,24 +1,85 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { forwardRef, useRef, useCallback } from 'react';
3
+ import { Button } from 'react-aria-components';
3
4
  import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
4
5
  import { CardDefinition, CardHeaderDefinition, CardBodyDefinition, CardFooterDefinition } from './definition.esm.js';
5
6
  import { Box } from '../Box/Box.esm.js';
7
+ import { Link } from '../Link/Link.esm.js';
8
+ import '../Link/Link.module.css.esm.js';
6
9
 
10
+ const INTERACTIVE_ELEMENT_SELECTOR = 'a[href],button,input,select,textarea,[role="button"],[role="link"],[tabindex]:not([tabindex="-1"])';
7
11
  const Card = forwardRef((props, ref) => {
8
12
  const { ownProps, restProps, dataAttributes } = useDefinition(
9
13
  CardDefinition,
10
14
  props
11
15
  );
12
- const { classes, children } = ownProps;
13
- return /* @__PURE__ */ jsx(
16
+ const {
17
+ classes,
18
+ children,
19
+ onPress,
20
+ href,
21
+ label,
22
+ target: linkTarget,
23
+ rel,
24
+ download
25
+ } = ownProps;
26
+ const isInteractive = !!(onPress || href);
27
+ const triggerRef = useRef(null);
28
+ const handleClick = useCallback(
29
+ (e) => {
30
+ if (!isInteractive || !triggerRef.current) return;
31
+ if (triggerRef.current.contains(e.target)) return;
32
+ const targetNode = e.target;
33
+ const targetElement = targetNode instanceof Element ? targetNode : targetNode?.parentElement;
34
+ if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;
35
+ if (window.getSelection()?.toString()) return;
36
+ triggerRef.current.dispatchEvent(
37
+ new MouseEvent("click", {
38
+ bubbles: false,
39
+ cancelable: true,
40
+ ctrlKey: e.ctrlKey,
41
+ metaKey: e.metaKey,
42
+ shiftKey: e.shiftKey
43
+ })
44
+ );
45
+ },
46
+ [isInteractive]
47
+ );
48
+ return /* @__PURE__ */ jsxs(
14
49
  Box,
15
50
  {
16
- bg: "neutral-auto",
51
+ as: "article",
52
+ bg: "neutral",
17
53
  ref,
18
54
  className: classes.root,
55
+ "data-interactive": isInteractive || void 0,
19
56
  ...dataAttributes,
20
57
  ...restProps,
21
- children
58
+ onClick: isInteractive ? handleClick : void 0,
59
+ children: [
60
+ href && /* @__PURE__ */ jsx(
61
+ Link,
62
+ {
63
+ ref: triggerRef,
64
+ className: classes.trigger,
65
+ href,
66
+ target: linkTarget,
67
+ rel,
68
+ download,
69
+ "aria-label": label
70
+ }
71
+ ),
72
+ onPress && !href && /* @__PURE__ */ jsx(
73
+ Button,
74
+ {
75
+ ref: triggerRef,
76
+ className: classes.trigger,
77
+ onPress,
78
+ "aria-label": label
79
+ }
80
+ ),
81
+ children
82
+ ]
22
83
  }
23
84
  );
24
85
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Card.esm.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n CardDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <Box\n bg=\"neutral-auto\"\n ref={ref}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n >\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n"],"names":[],"mappings":";;;;;;AAqCO,MAAM,IAAA,GAAO,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,IAC9C,cAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAG,cAAA;AAAA,MACH,GAAA;AAAA,MACA,WAAW,OAAA,CAAQ,IAAA;AAAA,MAClB,GAAG,cAAA;AAAA,MACH,GAAG,SAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;AAED,IAAA,CAAK,WAAA,GAAc,MAAA;AAOZ,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAOlB,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,oBAAoB,KAAK,CAAA;AACvE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA;AAOhB,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
1
+ {"version":3,"file":"Card.esm.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useCallback, useRef } from 'react';\nimport { Button as RAButton } from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\nimport { Link } from '../Link';\n\nconst INTERACTIVE_ELEMENT_SELECTOR =\n 'a[href],button,input,select,textarea,[role=\"button\"],[role=\"link\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n CardDefinition,\n props,\n );\n const {\n classes,\n children,\n onPress,\n href,\n label,\n target: linkTarget,\n rel,\n download,\n } = ownProps;\n const isInteractive = !!(onPress || href);\n\n const triggerRef = useRef<HTMLAnchorElement | HTMLButtonElement>(null);\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (!isInteractive || !triggerRef.current) return;\n\n // Don't delegate if the click target is the trigger itself\n if (triggerRef.current.contains(e.target as Node)) return;\n\n // Don't delegate if the user clicked a nested interactive element\n const targetNode = e.target as Node | null;\n const targetElement =\n targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;\n\n // Don't delegate if the user is selecting text\n if (window.getSelection()?.toString()) return;\n\n triggerRef.current.dispatchEvent(\n new MouseEvent('click', {\n bubbles: false,\n cancelable: true,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n }),\n );\n },\n [isInteractive],\n );\n\n return (\n <Box\n as=\"article\"\n bg=\"neutral\"\n ref={ref}\n className={classes.root}\n data-interactive={isInteractive || undefined}\n {...dataAttributes}\n {...restProps}\n onClick={isInteractive ? handleClick : undefined}\n >\n {href && (\n <Link\n ref={triggerRef as React.Ref<HTMLAnchorElement>}\n className={classes.trigger}\n href={href}\n target={linkTarget}\n rel={rel}\n download={download}\n aria-label={label}\n />\n )}\n {onPress && !href && (\n <RAButton\n ref={triggerRef as React.Ref<HTMLButtonElement>}\n className={classes.trigger}\n onPress={onPress}\n aria-label={label}\n />\n )}\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n"],"names":["RAButton"],"mappings":";;;;;;;;;AAkCA,MAAM,4BAAA,GACJ,oGAAA;AAOK,MAAM,IAAA,GAAO,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,IAC9C,cAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA,EAAQ,UAAA;AAAA,IACR,GAAA;AAAA,IACA;AAAA,GACF,GAAI,QAAA;AACJ,EAAA,MAAM,aAAA,GAAgB,CAAC,EAAE,OAAA,IAAW,IAAA,CAAA;AAEpC,EAAA,MAAM,UAAA,GAAa,OAA8C,IAAI,CAAA;AAErE,EAAA,MAAM,WAAA,GAAc,WAAA;AAAA,IAClB,CAAC,CAAA,KAAwC;AACvC,MAAA,IAAI,CAAC,aAAA,IAAiB,CAAC,UAAA,CAAW,OAAA,EAAS;AAG3C,MAAA,IAAI,UAAA,CAAW,OAAA,CAAQ,QAAA,CAAS,CAAA,CAAE,MAAc,CAAA,EAAG;AAGnD,MAAA,MAAM,aAAa,CAAA,CAAE,MAAA;AACrB,MAAA,MAAM,aAAA,GACJ,UAAA,YAAsB,OAAA,GAAU,UAAA,GAAa,UAAA,EAAY,aAAA;AAC3D,MAAA,IAAI,aAAA,EAAe,OAAA,CAAQ,4BAA4B,CAAA,EAAG;AAG1D,MAAA,IAAI,MAAA,CAAO,YAAA,EAAa,EAAG,QAAA,EAAS,EAAG;AAEvC,MAAA,UAAA,CAAW,OAAA,CAAQ,aAAA;AAAA,QACjB,IAAI,WAAW,OAAA,EAAS;AAAA,UACtB,OAAA,EAAS,KAAA;AAAA,UACT,UAAA,EAAY,IAAA;AAAA,UACZ,SAAS,CAAA,CAAE,OAAA;AAAA,UACX,SAAS,CAAA,CAAE,OAAA;AAAA,UACX,UAAU,CAAA,CAAE;AAAA,SACb;AAAA,OACH;AAAA,IACF,CAAA;AAAA,IACA,CAAC,aAAa;AAAA,GAChB;AAEA,EAAA,uBACE,IAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAG,SAAA;AAAA,MACH,EAAA,EAAG,SAAA;AAAA,MACH,GAAA;AAAA,MACA,WAAW,OAAA,CAAQ,IAAA;AAAA,MACnB,oBAAkB,aAAA,IAAiB,MAAA;AAAA,MAClC,GAAG,cAAA;AAAA,MACH,GAAG,SAAA;AAAA,MACJ,OAAA,EAAS,gBAAgB,WAAA,GAAc,MAAA;AAAA,MAEtC,QAAA,EAAA;AAAA,QAAA,IAAA,oBACC,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,UAAA;AAAA,YACL,WAAW,OAAA,CAAQ,OAAA;AAAA,YACnB,IAAA;AAAA,YACA,MAAA,EAAQ,UAAA;AAAA,YACR,GAAA;AAAA,YACA,QAAA;AAAA,YACA,YAAA,EAAY;AAAA;AAAA,SACd;AAAA,QAED,OAAA,IAAW,CAAC,IAAA,oBACX,GAAA;AAAA,UAACA,MAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,UAAA;AAAA,YACL,WAAW,OAAA,CAAQ,OAAA;AAAA,YACnB,OAAA;AAAA,YACA,YAAA,EAAY;AAAA;AAAA,SACd;AAAA,QAED;AAAA;AAAA;AAAA,GACH;AAEJ,CAAC;AAED,IAAA,CAAK,WAAA,GAAc,MAAA;AAOZ,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;AAOlB,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,oBAAoB,KAAK,CAAA;AACvE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA;AAOhB,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA,CAAC,SAAI,GAAA,EAAU,SAAA,EAAW,QAAQ,IAAA,EAAO,GAAG,WACzC,QAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
@@ -1,7 +1,7 @@
1
1
  import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
2
 
3
- var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Card_bui-Card__b58d4a84f0 {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-3);\n border-radius: var(--bui-radius-3);\n padding-block: var(--bui-space-3);\n color: var(--bui-fg-primary);\n overflow: hidden;\n min-height: 0;\n width: 100%;\n }\n\n .Card_bui-CardBody__b58d4a84f0 {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding-inline: var(--bui-space-3);\n }\n\n .Card_bui-CardHeader__b58d4a84f0 {\n padding-inline: var(--bui-space-3);\n }\n\n .Card_bui-CardFooter__b58d4a84f0 {\n padding-inline: var(--bui-space-3);\n }\n}\n";
4
- var styles = {"bui-Card":"Card_bui-Card__b58d4a84f0","bui-CardBody":"Card_bui-CardBody__b58d4a84f0","bui-CardHeader":"Card_bui-CardHeader__b58d4a84f0","bui-CardFooter":"Card_bui-CardFooter__b58d4a84f0"};
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 .Card_bui-Card__a35e7cb59d {\n display: flex;\n flex-direction: column;\n border-radius: var(--bui-radius-3);\n color: var(--bui-fg-primary);\n overflow: auto;\n min-height: 0;\n width: 100%;\n position: relative;\n padding: var(--bui-space-3);\n }\n\n .Card_bui-Card__a35e7cb59d[data-bg='neutral-1'] {\n --bui-card-bg: var(--bui-bg-neutral-1);\n }\n\n .Card_bui-Card__a35e7cb59d[data-bg='neutral-2'] {\n --bui-card-bg: var(--bui-bg-neutral-2);\n }\n\n .Card_bui-Card__a35e7cb59d[data-bg='neutral-3'] {\n --bui-card-bg: var(--bui-bg-neutral-3);\n }\n\n .Card_bui-Card__a35e7cb59d:has(.Card_bui-CardHeader__a35e7cb59d, .Card_bui-CardBody__a35e7cb59d, .Card_bui-CardFooter__a35e7cb59d) {\n padding: 0;\n }\n\n /*\n * Cursor and hover tint are applied at the card level so they cover the\n * entire surface.\n */\n .Card_bui-Card__a35e7cb59d[data-interactive] {\n cursor: pointer;\n\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n background: color-mix(in srgb, currentColor 5%, transparent);\n border-radius: inherit;\n pointer-events: none;\n z-index: 3;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n &:hover::after {\n opacity: 1;\n }\n }\n\n .Card_bui-Card__a35e7cb59d[data-interactive]:has(.Card_bui-CardTrigger__a35e7cb59d:focus-visible) {\n outline: 2px solid var(--bui-ring);\n outline-offset: -2px;\n }\n\n .Card_bui-CardTrigger__a35e7cb59d {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(100%);\n white-space: nowrap;\n border: 0;\n }\n\n .Card_bui-CardHeader__a35e7cb59d {\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-3);\n }\n\n .Card_bui-CardBody__a35e7cb59d {\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-3);\n }\n\n @keyframes Card_bui-card-body-shadow__a35e7cb59d {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n .Card_bui-Card__a35e7cb59d:has(.Card_bui-CardHeader__a35e7cb59d) .Card_bui-CardBody__a35e7cb59d {\n padding-block-start: 0;\n\n &::before {\n content: '';\n position: sticky;\n top: 0;\n display: block;\n height: 1.5rem;\n margin-bottom: -1.5rem;\n background: linear-gradient(\n to bottom,\n var(--bui-card-bg),\n rgb(from var(--bui-card-bg) r g b / 0)\n );\n pointer-events: none;\n opacity: 0;\n animation: Card_bui-card-body-shadow__a35e7cb59d linear both;\n animation-timeline: scroll();\n animation-range: 0px 2.5rem;\n }\n }\n\n .Card_bui-Card__a35e7cb59d:has(.Card_bui-CardFooter__a35e7cb59d) .Card_bui-CardBody__a35e7cb59d {\n padding-block-end: 0;\n\n &::after {\n content: '';\n position: sticky;\n bottom: 0;\n display: block;\n height: 1.5rem;\n margin-top: -1.5rem;\n background: linear-gradient(\n to top,\n var(--bui-card-bg),\n rgb(from var(--bui-card-bg) r g b / 0)\n );\n pointer-events: none;\n opacity: 0;\n animation: Card_bui-card-body-shadow__a35e7cb59d linear forwards,\n Card_bui-card-body-shadow__a35e7cb59d linear forwards reverse;\n animation-timeline: scroll(), scroll();\n animation-range: 0px 1px, calc(100% - 2.5rem) 100%;\n }\n }\n\n .Card_bui-CardFooter__a35e7cb59d {\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-3);\n }\n}\n";
4
+ var styles = {"bui-Card":"Card_bui-Card__a35e7cb59d","bui-CardHeader":"Card_bui-CardHeader__a35e7cb59d","bui-CardBody":"Card_bui-CardBody__a35e7cb59d","bui-CardFooter":"Card_bui-CardFooter__a35e7cb59d","bui-CardTrigger":"Card_bui-CardTrigger__a35e7cb59d","bui-card-body-shadow":"Card_bui-card-body-shadow__a35e7cb59d"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { styles as default };
@@ -1,19 +1,27 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'clsx';
3
- import 'react';
3
+ import '../../hooks/useBreakpoint.esm.js';
4
4
  import '../../hooks/useBg.esm.js';
5
5
  import '../../hooks/useDefinition/helpers.esm.js';
6
+ import '../../analytics/useAnalytics.esm.js';
6
7
  import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
7
8
  import styles from './Card.module.css.esm.js';
8
9
 
9
10
  const CardDefinition = defineComponent()({
10
11
  styles,
11
12
  classNames: {
12
- root: "bui-Card"
13
+ root: "bui-Card",
14
+ trigger: "bui-CardTrigger"
13
15
  },
14
16
  propDefs: {
15
17
  children: {},
16
- className: {}
18
+ className: {},
19
+ onPress: {},
20
+ href: {},
21
+ label: {},
22
+ target: {},
23
+ rel: {},
24
+ download: {}
17
25
  }
18
26
  });
19
27
  const CardHeaderDefinition = defineComponent()({
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Card/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;AA6BO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Card/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n trigger: 'bui-CardTrigger',\n },\n propDefs: {\n children: {},\n className: {},\n onPress: {},\n href: {},\n label: {},\n target: {},\n rel: {},\n download: {},\n },\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;AA6BO,MAAM,cAAA,GAAiB,iBAA8B,CAAE;AAAA,EAC5D,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,UAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,SAAS,EAAC;AAAA,IACV,MAAM,EAAC;AAAA,IACP,OAAO,EAAC;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,KAAK,EAAC;AAAA,IACN,UAAU;AAAC;AAEf,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;AAMM,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -1,33 +1,26 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { Checkbox as Checkbox$1 } from 'react-aria-components';
4
- import { useStyles } from '../../hooks/useStyles.esm.js';
4
+ import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
5
5
  import { CheckboxDefinition } from './definition.esm.js';
6
- import clsx from 'clsx';
7
- import styles from './Checkbox.module.css.esm.js';
8
6
  import { RiSubtractLine, RiCheckLine } from '@remixicon/react';
9
7
 
10
8
  const Checkbox = forwardRef(
11
9
  (props, ref) => {
12
- const { classNames } = useStyles(CheckboxDefinition);
13
- const { className, children, ...rest } = props;
10
+ const { ownProps, restProps, dataAttributes } = useDefinition(
11
+ CheckboxDefinition,
12
+ props
13
+ );
14
+ const { classes, children } = ownProps;
14
15
  return /* @__PURE__ */ jsx(
15
16
  Checkbox$1,
16
17
  {
17
18
  ref,
18
- className: clsx(classNames.root, styles[classNames.root], className),
19
- ...rest,
19
+ className: classes.root,
20
+ ...dataAttributes,
21
+ ...restProps,
20
22
  children: ({ isIndeterminate }) => /* @__PURE__ */ jsxs(Fragment, { children: [
21
- /* @__PURE__ */ jsx(
22
- "div",
23
- {
24
- className: clsx(
25
- classNames.indicator,
26
- styles[classNames.indicator]
27
- ),
28
- children: isIndeterminate ? /* @__PURE__ */ jsx(RiSubtractLine, { size: 12 }) : /* @__PURE__ */ jsx(RiCheckLine, { size: 12 })
29
- }
30
- ),
23
+ /* @__PURE__ */ jsx("div", { className: classes.indicator, children: isIndeterminate ? /* @__PURE__ */ jsx(RiSubtractLine, { size: 12 }) : /* @__PURE__ */ jsx(RiCheckLine, { size: 12 }) }),
31
24
  children
32
25
  ] })
33
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.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 } from 'react';\nimport { Checkbox as RACheckbox } from 'react-aria-components';\nimport type { CheckboxProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { CheckboxDefinition } from './definition';\nimport clsx from 'clsx';\nimport styles from './Checkbox.module.css';\nimport { RiCheckLine, RiSubtractLine } from '@remixicon/react';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const { classNames } = useStyles(CheckboxDefinition);\n const { className, children, ...rest } = props;\n\n return (\n <RACheckbox\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n >\n {({ isIndeterminate }) => (\n <>\n <div\n className={clsx(\n classNames.indicator,\n styles[classNames.indicator],\n )}\n >\n {isIndeterminate ? (\n <RiSubtractLine size={12} />\n ) : (\n <RiCheckLine size={12} />\n )}\n </div>\n {children}\n </>\n )}\n </RACheckbox>\n );\n },\n);\n"],"names":["RACheckbox"],"mappings":";;;;;;;;;AA0BO,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,kBAAkB,CAAA;AACnD,IAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,MAAK,GAAI,KAAA;AAEzC,IAAA,uBACE,GAAA;AAAA,MAACA,UAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QAClE,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA,CAAC,EAAE,eAAA,EAAgB,qBAClB,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,IAAA;AAAA,gBACT,UAAA,CAAW,SAAA;AAAA,gBACX,MAAA,CAAO,WAAW,SAAS;AAAA,eAC7B;AAAA,cAEC,QAAA,EAAA,eAAA,uBACE,cAAA,EAAA,EAAe,IAAA,EAAM,IAAI,CAAA,mBAE1B,GAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAM,EAAA,EAAI;AAAA;AAAA,WAE3B;AAAA,UACC;AAAA,SAAA,EACH;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;;;;"}
1
+ {"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.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 } from 'react';\nimport { Checkbox as RACheckbox } from 'react-aria-components';\nimport type { CheckboxProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { CheckboxDefinition } from './definition';\nimport { RiCheckLine, RiSubtractLine } from '@remixicon/react';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n CheckboxDefinition,\n props,\n );\n const { classes, children } = ownProps;\n\n return (\n <RACheckbox\n ref={ref}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n >\n {({ isIndeterminate }) => (\n <>\n <div className={classes.indicator}>\n {isIndeterminate ? (\n <RiSubtractLine size={12} />\n ) : (\n <RiCheckLine size={12} />\n )}\n </div>\n {children}\n </>\n )}\n </RACheckbox>\n );\n },\n);\n"],"names":["RACheckbox"],"mappings":";;;;;;;AAwBO,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,cAAA,EAAe,GAAI,aAAA;AAAA,MAC9C,kBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAS,GAAI,QAAA;AAE9B,IAAA,uBACE,GAAA;AAAA,MAACA,UAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,WAAW,OAAA,CAAQ,IAAA;AAAA,QAClB,GAAG,cAAA;AAAA,QACH,GAAG,SAAA;AAAA,QAEH,QAAA,EAAA,CAAC,EAAE,eAAA,EAAgB,qBAClB,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,SAAA,EACrB,4CACC,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EAAM,EAAA,EAAI,CAAA,mBAE1B,GAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAM,IAAI,CAAA,EAE3B,CAAA;AAAA,UACC;AAAA,SAAA,EACH;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;;;;"}
@@ -1,13 +1,25 @@
1
- const CheckboxDefinition = {
1
+ import 'react/jsx-runtime';
2
+ import 'clsx';
3
+ import '../../hooks/useBreakpoint.esm.js';
4
+ import '../../hooks/useBg.esm.js';
5
+ import '../../hooks/useDefinition/helpers.esm.js';
6
+ import '../../analytics/useAnalytics.esm.js';
7
+ import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
8
+ import styles from './Checkbox.module.css.esm.js';
9
+
10
+ const CheckboxDefinition = defineComponent()({
11
+ styles,
2
12
  classNames: {
3
13
  root: "bui-Checkbox",
4
14
  indicator: "bui-CheckboxIndicator"
5
15
  },
6
- dataAttributes: {
7
- selected: [true, false],
8
- indeterminate: [true, false]
16
+ propDefs: {
17
+ selected: { dataAttribute: true },
18
+ indeterminate: { dataAttribute: true },
19
+ children: {},
20
+ className: {}
9
21
  }
10
- };
22
+ });
11
23
 
12
24
  export { CheckboxDefinition };
13
25
  //# sourceMappingURL=definition.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Checkbox/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ComponentDefinition } from '../../types';\n\n/**\n * Component definition for Checkbox\n * @public\n */\nexport const CheckboxDefinition = {\n classNames: {\n root: 'bui-Checkbox',\n indicator: 'bui-CheckboxIndicator',\n },\n dataAttributes: {\n selected: [true, false] as const,\n indeterminate: [true, false] as const,\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,kBAAA,GAAqB;AAAA,EAChC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,cAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACb;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,QAAA,EAAU,CAAC,IAAA,EAAM,KAAK,CAAA;AAAA,IACtB,aAAA,EAAe,CAAC,IAAA,EAAM,KAAK;AAAA;AAE/B;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Checkbox/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { CheckboxOwnProps } from './types';\nimport styles from './Checkbox.module.css';\n\n/**\n * Component definition for Checkbox\n * @public\n */\nexport const CheckboxDefinition = defineComponent<CheckboxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Checkbox',\n indicator: 'bui-CheckboxIndicator',\n },\n propDefs: {\n selected: { dataAttribute: true },\n indeterminate: { dataAttribute: true },\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;;AAwBO,MAAM,kBAAA,GAAqB,iBAAkC,CAAE;AAAA,EACpE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,cAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACb;AAAA,EACA,QAAA,EAAU;AAAA,IACR,QAAA,EAAU,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IAChC,aAAA,EAAe,EAAE,aAAA,EAAe,IAAA,EAAK;AAAA,IACrC,UAAU,EAAC;AAAA,IACX,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -1,33 +1,28 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
- import clsx from 'clsx';
4
- import { useStyles } from '../../hooks/useStyles.esm.js';
3
+ import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
5
4
  import { ContainerDefinition } from './definition.esm.js';
6
- import styles from './Container.module.css.esm.js';
7
5
 
8
6
  const Container = forwardRef(
9
7
  (props, ref) => {
10
- const { classNames, utilityClasses, style, cleanedProps } = useStyles(
8
+ const { ownProps, restProps, utilityStyle } = useDefinition(
11
9
  ContainerDefinition,
12
10
  props
13
11
  );
14
- const { className, ...rest } = cleanedProps;
12
+ const { classes, children, style } = ownProps;
15
13
  return /* @__PURE__ */ jsx(
16
14
  "div",
17
15
  {
18
16
  ref,
19
- className: clsx(
20
- classNames.root,
21
- utilityClasses,
22
- styles[classNames.root],
23
- className
24
- ),
25
- style,
26
- ...rest
17
+ className: classes.root,
18
+ style: { ...utilityStyle, ...style },
19
+ ...restProps,
20
+ children
27
21
  }
28
22
  );
29
23
  }
30
24
  );
25
+ Container.displayName = "Container";
31
26
 
32
27
  export { Container };
33
28
  //# sourceMappingURL=Container.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Container.esm.js","sources":["../../../src/components/Container/Container.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 } from 'react';\nimport { ContainerProps } from './types';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport { ContainerDefinition } from './definition';\nimport styles from './Container.module.css';\n\n/** @public */\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (props, ref) => {\n const { classNames, utilityClasses, style, cleanedProps } = useStyles(\n ContainerDefinition,\n props,\n );\n\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.root,\n utilityClasses,\n styles[classNames.root],\n className,\n )}\n style={style}\n {...rest}\n />\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;AAwBO,MAAM,SAAA,GAAY,UAAA;AAAA,EACvB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,KAAA,EAAO,cAAa,GAAI,SAAA;AAAA,MAC1D,mBAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,IAAA,uBACE,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,IAAA;AAAA,UACX,cAAA;AAAA,UACA,MAAA,CAAO,WAAW,IAAI,CAAA;AAAA,UACtB;AAAA,SACF;AAAA,QACA,KAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;;;;"}
1
+ {"version":3,"file":"Container.esm.js","sources":["../../../src/components/Container/Container.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 } from 'react';\nimport type { ContainerProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ContainerDefinition } from './definition';\n\n/** @public */\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (props, ref) => {\n const { ownProps, restProps, utilityStyle } = useDefinition(\n ContainerDefinition,\n props,\n );\n const { classes, children, style } = ownProps;\n\n return (\n <div\n ref={ref}\n className={classes.root}\n style={{ ...utilityStyle, ...style }}\n {...restProps}\n >\n {children}\n </div>\n );\n },\n);\n\nContainer.displayName = 'Container';\n"],"names":[],"mappings":";;;;;AAsBO,MAAM,SAAA,GAAY,UAAA;AAAA,EACvB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,YAAA,EAAa,GAAI,aAAA;AAAA,MAC5C,mBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,KAAA,EAAM,GAAI,QAAA;AAErC,IAAA,uBACE,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,WAAW,OAAA,CAAQ,IAAA;AAAA,QACnB,KAAA,EAAO,EAAE,GAAG,YAAA,EAAc,GAAG,KAAA,EAAM;AAAA,QAClC,GAAG,SAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
@@ -1,7 +1,7 @@
1
1
  import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
2
 
3
- var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Container_bui-Container__10ae690c55 {\n max-width: 120rem;\n padding-inline: var(--bui-space-4);\n margin-inline: auto;\n transition: padding 0.2s ease-in-out;\n }\n\n @media (min-width: 640px) {\n .Container_bui-Container__10ae690c55 {\n padding-inline: var(--bui-space-5);\n }\n }\n}\n";
4
- var styles = {"bui-Container":"Container_bui-Container__10ae690c55"};
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 .Container_bui-Container__6b0c367fdf {\n max-width: 120rem;\n padding-inline: var(--bui-space-4);\n margin-inline: auto;\n padding-bottom: var(--bui-space-8);\n }\n\n @media (min-width: 640px) {\n .Container_bui-Container__6b0c367fdf {\n padding-inline: var(--bui-space-5);\n }\n }\n}\n";
4
+ var styles = {"bui-Container":"Container_bui-Container__6b0c367fdf"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { styles as default };
@@ -1,9 +1,24 @@
1
- const ContainerDefinition = {
1
+ import 'react/jsx-runtime';
2
+ import 'clsx';
3
+ import '../../hooks/useBreakpoint.esm.js';
4
+ import '../../hooks/useBg.esm.js';
5
+ import '../../hooks/useDefinition/helpers.esm.js';
6
+ import '../../analytics/useAnalytics.esm.js';
7
+ import { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
8
+ import styles from './Container.module.css.esm.js';
9
+
10
+ const ContainerDefinition = defineComponent()({
11
+ styles,
2
12
  classNames: {
3
13
  root: "bui-Container"
4
14
  },
15
+ propDefs: {
16
+ children: {},
17
+ className: {},
18
+ style: {}
19
+ },
5
20
  utilityProps: ["my", "mt", "mb", "py", "pt", "pb", "display"]
6
- };
21
+ });
7
22
 
8
23
  export { ContainerDefinition };
9
24
  //# sourceMappingURL=definition.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Container/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ComponentDefinition } from '../../types';\n\n/**\n * Component definition for Container\n * @public\n */\nexport const ContainerDefinition = {\n classNames: {\n root: 'bui-Container',\n },\n utilityProps: ['my', 'mt', 'mb', 'py', 'pt', 'pb', 'display'],\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,mBAAA,GAAsB;AAAA,EACjC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,YAAA,EAAc,CAAC,IAAA,EAAM,IAAA,EAAM,MAAM,IAAA,EAAM,IAAA,EAAM,MAAM,SAAS;AAC9D;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Container/definition.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ContainerOwnProps } from './types';\nimport styles from './Container.module.css';\n\n/**\n * Component definition for Container\n * @public\n */\nexport const ContainerDefinition = defineComponent<ContainerOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Container',\n },\n propDefs: {\n children: {},\n className: {},\n style: {},\n },\n utilityProps: ['my', 'mt', 'mb', 'py', 'pt', 'pb', 'display'],\n});\n"],"names":[],"mappings":";;;;;;;;;AAwBO,MAAM,mBAAA,GAAsB,iBAAmC,CAAE;AAAA,EACtE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO;AAAC,GACV;AAAA,EACA,YAAA,EAAc,CAAC,IAAA,EAAM,IAAA,EAAM,MAAM,IAAA,EAAM,IAAA,EAAM,MAAM,SAAS;AAC9D,CAAC;;;;"}
@@ -1,46 +1,44 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { Modal, Dialog as Dialog$1, Heading, DialogTrigger as DialogTrigger$1 } from 'react-aria-components';
4
- import clsx from 'clsx';
5
4
  import { RiCloseLine } from '@remixicon/react';
6
5
  import { Button } from '../Button/Button.esm.js';
7
- import '../../hooks/useBg.esm.js';
8
- import '../../hooks/useDefinition/helpers.esm.js';
6
+ import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
9
7
  import '../Button/Button.module.css.esm.js';
10
- import { useStyles } from '../../hooks/useStyles.esm.js';
11
- import { DialogDefinition } from './definition.esm.js';
8
+ import { DialogDefinition, DialogHeaderDefinition, DialogBodyDefinition, DialogFooterDefinition } from './definition.esm.js';
9
+ import { Box } from '../Box/Box.esm.js';
10
+ import '../Box/Box.module.css.esm.js';
11
+ import { BgReset } from '../../hooks/useBg.esm.js';
12
12
  import { Flex } from '../Flex/Flex.esm.js';
13
- import styles from './Dialog.module.css.esm.js';
13
+ import '../Flex/Flex.module.css.esm.js';
14
14
 
15
15
  const DialogTrigger = (props) => {
16
16
  return /* @__PURE__ */ jsx(DialogTrigger$1, { ...props });
17
17
  };
18
18
  const Dialog = forwardRef(
19
19
  (props, ref) => {
20
- const { classNames, cleanedProps } = useStyles(DialogDefinition, props);
21
- const { className, children, width, height, style, ...rest } = cleanedProps;
20
+ const { ownProps, restProps } = useDefinition(DialogDefinition, props, {
21
+ classNameTarget: "dialog"
22
+ });
23
+ const { classes, children, width, height, style } = ownProps;
22
24
  return /* @__PURE__ */ jsx(
23
25
  Modal,
24
26
  {
25
27
  ref,
26
- className: clsx(classNames.overlay, styles[classNames.overlay]),
28
+ className: classes.root,
27
29
  isDismissable: true,
28
30
  isKeyboardDismissDisabled: false,
29
- ...rest,
31
+ ...restProps,
30
32
  children: /* @__PURE__ */ jsx(
31
33
  Dialog$1,
32
34
  {
33
- className: clsx(
34
- classNames.dialog,
35
- styles[classNames.dialog],
36
- className
37
- ),
35
+ className: classes.dialog,
38
36
  style: {
39
37
  ["--bui-dialog-min-width"]: typeof width === "number" ? `${width}px` : width || "400px",
40
38
  ["--bui-dialog-min-height"]: height ? typeof height === "number" ? `${height}px` : height : "auto",
41
39
  ...style
42
40
  },
43
- children
41
+ children: /* @__PURE__ */ jsx(BgReset, { children: /* @__PURE__ */ jsx(Box, { bg: "neutral", className: classes.content, children }) })
44
42
  }
45
43
  )
46
44
  }
@@ -49,57 +47,26 @@ const Dialog = forwardRef(
49
47
  );
50
48
  Dialog.displayName = "Dialog";
51
49
  const DialogHeader = forwardRef((props, ref) => {
52
- const { classNames, cleanedProps } = useStyles(DialogDefinition, props);
53
- const { className, children, ...rest } = cleanedProps;
54
- return /* @__PURE__ */ jsxs(
55
- Flex,
56
- {
57
- ref,
58
- className: clsx(classNames.header, styles[classNames.header], className),
59
- ...rest,
60
- children: [
61
- /* @__PURE__ */ jsx(
62
- Heading,
63
- {
64
- slot: "title",
65
- className: clsx(classNames.headerTitle, styles[classNames.headerTitle]),
66
- children
67
- }
68
- ),
69
- /* @__PURE__ */ jsx(Button, { name: "close", "aria-label": "Close", variant: "tertiary", slot: "close", children: /* @__PURE__ */ jsx(RiCloseLine, {}) })
70
- ]
71
- }
72
- );
50
+ const { ownProps, restProps } = useDefinition(DialogHeaderDefinition, props);
51
+ const { classes, children } = ownProps;
52
+ return /* @__PURE__ */ jsxs(Flex, { ref, className: classes.root, ...restProps, children: [
53
+ /* @__PURE__ */ jsx(Heading, { slot: "title", className: classes.title, children }),
54
+ /* @__PURE__ */ jsx(Button, { name: "close", "aria-label": "Close", variant: "tertiary", slot: "close", children: /* @__PURE__ */ jsx(RiCloseLine, {}) })
55
+ ] });
73
56
  });
74
57
  DialogHeader.displayName = "DialogHeader";
75
58
  const DialogBody = forwardRef(
76
59
  (props, ref) => {
77
- const { classNames, cleanedProps } = useStyles(DialogDefinition, props);
78
- const { className, children, ...rest } = cleanedProps;
79
- return /* @__PURE__ */ jsx(
80
- "div",
81
- {
82
- className: clsx(classNames.body, styles[classNames.body], className),
83
- ref,
84
- ...rest,
85
- children
86
- }
87
- );
60
+ const { ownProps, restProps } = useDefinition(DialogBodyDefinition, props);
61
+ const { classes, children } = ownProps;
62
+ return /* @__PURE__ */ jsx("div", { className: classes.root, ref, ...restProps, children });
88
63
  }
89
64
  );
90
65
  DialogBody.displayName = "DialogBody";
91
66
  const DialogFooter = forwardRef((props, ref) => {
92
- const { classNames, cleanedProps } = useStyles(DialogDefinition, props);
93
- const { className, children, ...rest } = cleanedProps;
94
- return /* @__PURE__ */ jsx(
95
- "div",
96
- {
97
- ref,
98
- className: clsx(classNames.footer, styles[classNames.footer], className),
99
- ...rest,
100
- children
101
- }
102
- );
67
+ const { ownProps, restProps } = useDefinition(DialogFooterDefinition, props);
68
+ const { classes, children } = ownProps;
69
+ return /* @__PURE__ */ jsx("div", { ref, className: classes.root, ...restProps, children });
103
70
  });
104
71
  DialogFooter.displayName = "DialogFooter";
105
72