@backstage/ui 0.12.0 → 0.13.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/components/Accordion/Accordion.esm.js +4 -2
  3. package/dist/components/Accordion/Accordion.esm.js.map +1 -1
  4. package/dist/components/Accordion/Accordion.module.css.esm.js +2 -2
  5. package/dist/components/Accordion/definition.esm.js +4 -2
  6. package/dist/components/Accordion/definition.esm.js.map +1 -1
  7. package/dist/components/Alert/definition.esm.js +1 -1
  8. package/dist/components/Avatar/Avatar.esm.js +8 -28
  9. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  10. package/dist/components/Avatar/definition.esm.js +17 -4
  11. package/dist/components/Avatar/definition.esm.js.map +1 -1
  12. package/dist/components/Box/definition.esm.js +1 -1
  13. package/dist/components/Button/definition.esm.js +2 -3
  14. package/dist/components/Button/definition.esm.js.map +1 -1
  15. package/dist/components/ButtonIcon/definition.esm.js +2 -3
  16. package/dist/components/ButtonIcon/definition.esm.js.map +1 -1
  17. package/dist/components/ButtonLink/definition.esm.js +2 -3
  18. package/dist/components/ButtonLink/definition.esm.js.map +1 -1
  19. package/dist/components/Card/Card.esm.js +1 -1
  20. package/dist/components/Card/Card.esm.js.map +1 -1
  21. package/dist/components/Card/definition.esm.js +1 -1
  22. package/dist/components/Checkbox/Checkbox.esm.js +10 -17
  23. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  24. package/dist/components/Checkbox/definition.esm.js +16 -5
  25. package/dist/components/Checkbox/definition.esm.js.map +1 -1
  26. package/dist/components/Container/Container.esm.js +8 -13
  27. package/dist/components/Container/Container.esm.js.map +1 -1
  28. package/dist/components/Container/Container.module.css.esm.js +2 -2
  29. package/dist/components/Container/definition.esm.js +16 -2
  30. package/dist/components/Container/definition.esm.js.map +1 -1
  31. package/dist/components/Dialog/Dialog.esm.js +26 -59
  32. package/dist/components/Dialog/Dialog.esm.js.map +1 -1
  33. package/dist/components/Dialog/Dialog.module.css.esm.js +2 -2
  34. package/dist/components/Dialog/definition.esm.js +52 -8
  35. package/dist/components/Dialog/definition.esm.js.map +1 -1
  36. package/dist/components/FieldError/FieldError.esm.js +4 -13
  37. package/dist/components/FieldError/FieldError.esm.js.map +1 -1
  38. package/dist/components/FieldError/definition.esm.js +14 -2
  39. package/dist/components/FieldError/definition.esm.js.map +1 -1
  40. package/dist/components/FieldLabel/FieldLabel.esm.js +14 -59
  41. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  42. package/dist/components/FieldLabel/definition.esm.js +19 -2
  43. package/dist/components/FieldLabel/definition.esm.js.map +1 -1
  44. package/dist/components/Flex/Flex.esm.js +11 -22
  45. package/dist/components/Flex/Flex.esm.js.map +1 -1
  46. package/dist/components/Flex/definition.esm.js +19 -13
  47. package/dist/components/Flex/definition.esm.js.map +1 -1
  48. package/dist/components/FullPage/FullPage.esm.js +4 -13
  49. package/dist/components/FullPage/FullPage.esm.js.map +1 -1
  50. package/dist/components/FullPage/definition.esm.js +14 -2
  51. package/dist/components/FullPage/definition.esm.js.map +1 -1
  52. package/dist/components/Grid/Grid.esm.js +19 -40
  53. package/dist/components/Grid/Grid.esm.js.map +1 -1
  54. package/dist/components/Grid/definition.esm.js +30 -26
  55. package/dist/components/Grid/definition.esm.js.map +1 -1
  56. package/dist/components/HeaderPage/HeaderPage.esm.js +38 -60
  57. package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
  58. package/dist/components/HeaderPage/definition.esm.js +18 -2
  59. package/dist/components/HeaderPage/definition.esm.js.map +1 -1
  60. package/dist/components/Link/Link.esm.js +6 -34
  61. package/dist/components/Link/Link.esm.js.map +1 -1
  62. package/dist/components/Link/definition.esm.js +20 -15
  63. package/dist/components/Link/definition.esm.js.map +1 -1
  64. package/dist/components/Menu/Menu.esm.js +162 -343
  65. package/dist/components/Menu/Menu.esm.js.map +1 -1
  66. package/dist/components/Menu/Menu.module.css.esm.js +2 -2
  67. package/dist/components/Menu/definition.esm.js +113 -17
  68. package/dist/components/Menu/definition.esm.js.map +1 -1
  69. package/dist/components/PasswordField/PasswordField.esm.js +17 -52
  70. package/dist/components/PasswordField/PasswordField.esm.js.map +1 -1
  71. package/dist/components/PasswordField/PasswordField.module.css.esm.js +2 -2
  72. package/dist/components/PasswordField/definition.esm.js +28 -11
  73. package/dist/components/PasswordField/definition.esm.js.map +1 -1
  74. package/dist/components/PluginHeader/PluginHeader.esm.js +33 -46
  75. package/dist/components/PluginHeader/PluginHeader.esm.js.map +1 -1
  76. package/dist/components/PluginHeader/PluginHeader.module.css.esm.js +2 -2
  77. package/dist/components/PluginHeader/definition.esm.js +21 -3
  78. package/dist/components/PluginHeader/definition.esm.js.map +1 -1
  79. package/dist/components/Popover/Popover.esm.js +24 -32
  80. package/dist/components/Popover/Popover.esm.js.map +1 -1
  81. package/dist/components/Popover/Popover.module.css.esm.js +2 -2
  82. package/dist/components/Popover/definition.esm.js +16 -2
  83. package/dist/components/Popover/definition.esm.js.map +1 -1
  84. package/dist/components/RadioGroup/RadioGroup.esm.js +25 -44
  85. package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
  86. package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +2 -2
  87. package/dist/components/RadioGroup/definition.esm.js +30 -5
  88. package/dist/components/RadioGroup/definition.esm.js.map +1 -1
  89. package/dist/components/SearchField/SearchField.esm.js +25 -45
  90. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  91. package/dist/components/SearchField/SearchField.module.css.esm.js +2 -2
  92. package/dist/components/SearchField/definition.esm.js +20 -5
  93. package/dist/components/SearchField/definition.esm.js.map +1 -1
  94. package/dist/components/Select/Select.esm.js +14 -23
  95. package/dist/components/Select/Select.esm.js.map +1 -1
  96. package/dist/components/Select/Select.module.css.esm.js +2 -2
  97. package/dist/components/Select/SelectContent.esm.js +8 -31
  98. package/dist/components/Select/SelectContent.esm.js.map +1 -1
  99. package/dist/components/Select/SelectListBox.esm.js +21 -44
  100. package/dist/components/Select/SelectListBox.esm.js.map +1 -1
  101. package/dist/components/Select/SelectTrigger.esm.js +8 -14
  102. package/dist/components/Select/SelectTrigger.esm.js.map +1 -1
  103. package/dist/components/Select/definition.esm.js +67 -17
  104. package/dist/components/Select/definition.esm.js.map +1 -1
  105. package/dist/components/Skeleton/Skeleton.esm.js +9 -13
  106. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  107. package/dist/components/Skeleton/definition.esm.js +18 -2
  108. package/dist/components/Skeleton/definition.esm.js.map +1 -1
  109. package/dist/components/Switch/Switch.esm.js +7 -22
  110. package/dist/components/Switch/Switch.esm.js.map +1 -1
  111. package/dist/components/Switch/definition.esm.js +15 -2
  112. package/dist/components/Switch/definition.esm.js.map +1 -1
  113. package/dist/components/Table/components/Cell.esm.js +4 -17
  114. package/dist/components/Table/components/Cell.esm.js.map +1 -1
  115. package/dist/components/Table/components/CellProfile.esm.js +12 -41
  116. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  117. package/dist/components/Table/components/CellText.esm.js +39 -73
  118. package/dist/components/Table/components/CellText.esm.js.map +1 -1
  119. package/dist/components/Table/components/Column.esm.js +8 -36
  120. package/dist/components/Table/components/Column.esm.js.map +1 -1
  121. package/dist/components/Table/components/Row.esm.js +9 -19
  122. package/dist/components/Table/components/Row.esm.js.map +1 -1
  123. package/dist/components/Table/components/Table.esm.js +7 -0
  124. package/dist/components/Table/components/Table.esm.js.map +1 -1
  125. package/dist/components/Table/components/TableBody.esm.js +4 -12
  126. package/dist/components/Table/components/TableBody.esm.js.map +1 -1
  127. package/dist/components/Table/components/TableHeader.esm.js +19 -29
  128. package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
  129. package/dist/components/Table/components/TableRoot.esm.js +5 -7
  130. package/dist/components/Table/components/TableRoot.esm.js.map +1 -1
  131. package/dist/components/Table/definition.esm.js +97 -21
  132. package/dist/components/Table/definition.esm.js.map +1 -1
  133. package/dist/components/TablePagination/TablePagination.esm.js +24 -32
  134. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  135. package/dist/components/TablePagination/definition.esm.js +32 -2
  136. package/dist/components/TablePagination/definition.esm.js.map +1 -1
  137. package/dist/components/Tabs/Tabs.esm.js +40 -63
  138. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  139. package/dist/components/Tabs/TabsIndicators.esm.js +6 -18
  140. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
  141. package/dist/components/Tabs/definition.esm.js +62 -10
  142. package/dist/components/Tabs/definition.esm.js.map +1 -1
  143. package/dist/components/TagGroup/TagGroup.esm.js +36 -63
  144. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  145. package/dist/components/TagGroup/definition.esm.js +35 -8
  146. package/dist/components/TagGroup/definition.esm.js.map +1 -1
  147. package/dist/components/Text/Text.esm.js +6 -13
  148. package/dist/components/Text/Text.esm.js.map +1 -1
  149. package/dist/components/Text/definition.esm.js +18 -14
  150. package/dist/components/Text/definition.esm.js.map +1 -1
  151. package/dist/components/TextField/TextField.esm.js +16 -41
  152. package/dist/components/TextField/TextField.esm.js.map +1 -1
  153. package/dist/components/TextField/definition.esm.js +19 -6
  154. package/dist/components/TextField/definition.esm.js.map +1 -1
  155. package/dist/components/ToggleButton/ToggleButton.esm.js +11 -23
  156. package/dist/components/ToggleButton/ToggleButton.esm.js.map +1 -1
  157. package/dist/components/ToggleButton/definition.esm.js +17 -4
  158. package/dist/components/ToggleButton/definition.esm.js.map +1 -1
  159. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js +5 -18
  160. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.esm.js.map +1 -1
  161. package/dist/components/ToggleButtonGroup/definition.esm.js +14 -4
  162. package/dist/components/ToggleButtonGroup/definition.esm.js.map +1 -1
  163. package/dist/components/Tooltip/Tooltip.esm.js +24 -30
  164. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
  165. package/dist/components/Tooltip/Tooltip.module.css.esm.js +2 -2
  166. package/dist/components/Tooltip/definition.esm.js +16 -2
  167. package/dist/components/Tooltip/definition.esm.js.map +1 -1
  168. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +4 -12
  169. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -1
  170. package/dist/components/VisuallyHidden/definition.esm.js +14 -2
  171. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -1
  172. package/dist/css/styles.css +2 -4
  173. package/dist/hooks/useBg.esm.js +11 -2
  174. package/dist/hooks/useBg.esm.js.map +1 -1
  175. package/dist/hooks/useBreakpoint.esm.js +67 -27
  176. package/dist/hooks/useBreakpoint.esm.js.map +1 -1
  177. package/dist/hooks/useDefinition/helpers.esm.js +24 -1
  178. package/dist/hooks/useDefinition/helpers.esm.js.map +1 -1
  179. package/dist/hooks/useDefinition/useDefinition.esm.js +12 -22
  180. package/dist/hooks/useDefinition/useDefinition.esm.js.map +1 -1
  181. package/dist/index.d.ts +860 -273
  182. package/dist/index.esm.js +2 -2
  183. package/package.json +6 -4
  184. package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js +0 -94
  185. package/dist/components/PluginHeader/PluginHeaderToolbar.esm.js.map +0 -1
  186. package/dist/hooks/useMediaQuery.esm.js +0 -47
  187. package/dist/hooks/useMediaQuery.esm.js.map +0 -1
  188. package/dist/hooks/useStyles.esm.js +0 -53
  189. package/dist/hooks/useStyles.esm.js.map +0 -1
@@ -1,13 +1,24 @@
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 { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
7
+ import styles from './Checkbox.module.css.esm.js';
8
+
9
+ const CheckboxDefinition = defineComponent()({
10
+ styles,
2
11
  classNames: {
3
12
  root: "bui-Checkbox",
4
13
  indicator: "bui-CheckboxIndicator"
5
14
  },
6
- dataAttributes: {
7
- selected: [true, false],
8
- indeterminate: [true, false]
15
+ propDefs: {
16
+ selected: { dataAttribute: true },
17
+ indeterminate: { dataAttribute: true },
18
+ children: {},
19
+ className: {}
9
20
  }
10
- };
21
+ });
11
22
 
12
23
  export { CheckboxDefinition };
13
24
  //# 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,23 @@
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 { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
7
+ import styles from './Container.module.css.esm.js';
8
+
9
+ const ContainerDefinition = defineComponent()({
10
+ styles,
2
11
  classNames: {
3
12
  root: "bui-Container"
4
13
  },
14
+ propDefs: {
15
+ children: {},
16
+ className: {},
17
+ style: {}
18
+ },
5
19
  utilityProps: ["my", "mt", "mb", "py", "pt", "pb", "display"]
6
- };
20
+ });
7
21
 
8
22
  export { ContainerDefinition };
9
23
  //# 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
 
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.esm.js","sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport {\n Dialog as RADialog,\n DialogTrigger as RADialogTrigger,\n Modal,\n Heading,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport type {\n DialogTriggerProps,\n DialogHeaderProps,\n DialogProps,\n DialogBodyProps,\n} from './types';\nimport { RiCloseLine } from '@remixicon/react';\nimport { Button } from '../Button';\nimport { useStyles } from '../../hooks/useStyles';\nimport { DialogDefinition } from './definition';\nimport { Flex } from '../Flex';\nimport styles from './Dialog.module.css';\n\n/** @public */\nexport const DialogTrigger = (props: DialogTriggerProps) => {\n return <RADialogTrigger {...props} />;\n};\n\n/** @public */\nexport const Dialog = forwardRef<React.ElementRef<typeof Modal>, DialogProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles(DialogDefinition, props);\n const { className, children, width, height, style, ...rest } = cleanedProps;\n\n return (\n <Modal\n ref={ref}\n className={clsx(classNames.overlay, styles[classNames.overlay])}\n isDismissable\n isKeyboardDismissDisabled={false}\n {...rest}\n >\n <RADialog\n className={clsx(\n classNames.dialog,\n styles[classNames.dialog],\n className,\n )}\n style={{\n ['--bui-dialog-min-width' as keyof React.CSSProperties]:\n typeof width === 'number' ? `${width}px` : width || '400px',\n ['--bui-dialog-min-height' as keyof React.CSSProperties]: height\n ? typeof height === 'number'\n ? `${height}px`\n : height\n : 'auto',\n ...style,\n }}\n >\n {children}\n </RADialog>\n </Modal>\n );\n },\n);\n\nDialog.displayName = 'Dialog';\n\n/** @public */\nexport const DialogHeader = forwardRef<\n React.ElementRef<'div'>,\n DialogHeaderProps\n>((props, ref) => {\n const { classNames, cleanedProps } = useStyles(DialogDefinition, props);\n const { className, children, ...rest } = cleanedProps;\n\n return (\n <Flex\n ref={ref}\n className={clsx(classNames.header, styles[classNames.header], className)}\n {...rest}\n >\n <Heading\n slot=\"title\"\n className={clsx(classNames.headerTitle, styles[classNames.headerTitle])}\n >\n {children}\n </Heading>\n <Button name=\"close\" aria-label=\"Close\" variant=\"tertiary\" slot=\"close\">\n <RiCloseLine />\n </Button>\n </Flex>\n );\n});\nDialogHeader.displayName = 'DialogHeader';\n\n/** @public */\nexport const DialogBody = forwardRef<React.ElementRef<'div'>, DialogBodyProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles(DialogDefinition, props);\n const { className, children, ...rest } = cleanedProps;\n\n return (\n <div\n className={clsx(classNames.body, styles[classNames.body], className)}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\n\nDialogBody.displayName = 'DialogBody';\n\n/** @public */\nexport const DialogFooter = forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>((props, ref) => {\n const { classNames, cleanedProps } = useStyles(DialogDefinition, props);\n const { className, children, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(classNames.footer, styles[classNames.footer], className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\nDialogFooter.displayName = 'DialogFooter';\n"],"names":["RADialogTrigger","RADialog"],"mappings":";;;;;;;;;;;;;;AAsCO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,uBAAO,GAAA,CAACA,eAAA,EAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACrC;AAGO,MAAM,MAAA,GAAS,UAAA;AAAA,EACpB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,kBAAkB,KAAK,CAAA;AACtE,IAAA,MAAM,EAAE,WAAW,QAAA,EAAU,KAAA,EAAO,QAAQ,KAAA,EAAO,GAAG,MAAK,GAAI,YAAA;AAE/D,IAAA,uBACE,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,QAC9D,aAAA,EAAa,IAAA;AAAA,QACb,yBAAA,EAA2B,KAAA;AAAA,QAC1B,GAAG,IAAA;AAAA,QAEJ,QAAA,kBAAA,GAAA;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3,"file":"Dialog.esm.js","sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport {\n Dialog as RADialog,\n DialogTrigger as RADialogTrigger,\n Modal,\n Heading,\n} from 'react-aria-components';\nimport type {\n DialogTriggerProps,\n DialogHeaderProps,\n DialogProps,\n DialogBodyProps,\n DialogFooterProps,\n} from './types';\nimport { RiCloseLine } from '@remixicon/react';\nimport { Button } from '../Button';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n DialogDefinition,\n DialogHeaderDefinition,\n DialogBodyDefinition,\n DialogFooterDefinition,\n} from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\nimport { Flex } from '../Flex';\n\n/** @public */\nexport const DialogTrigger = (props: DialogTriggerProps) => {\n return <RADialogTrigger {...props} />;\n};\n\n/** @public */\nexport const Dialog = forwardRef<React.ElementRef<typeof Modal>, DialogProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(DialogDefinition, props, {\n classNameTarget: 'dialog',\n });\n const { classes, children, width, height, style } = ownProps;\n\n return (\n <Modal\n ref={ref}\n className={classes.root}\n isDismissable\n isKeyboardDismissDisabled={false}\n {...restProps}\n >\n <RADialog\n className={classes.dialog}\n style={{\n ['--bui-dialog-min-width' as keyof React.CSSProperties]:\n typeof width === 'number' ? `${width}px` : width || '400px',\n ['--bui-dialog-min-height' as keyof React.CSSProperties]: height\n ? typeof height === 'number'\n ? `${height}px`\n : height\n : 'auto',\n ...style,\n }}\n >\n <BgReset>\n <Box bg=\"neutral\" className={classes.content}>\n {children}\n </Box>\n </BgReset>\n </RADialog>\n </Modal>\n );\n },\n);\n\nDialog.displayName = 'Dialog';\n\n/** @public */\nexport const DialogHeader = forwardRef<\n React.ElementRef<'div'>,\n DialogHeaderProps\n>((props, ref) => {\n const { ownProps, restProps } = useDefinition(DialogHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <Flex ref={ref} className={classes.root} {...restProps}>\n <Heading slot=\"title\" className={classes.title}>\n {children}\n </Heading>\n <Button name=\"close\" aria-label=\"Close\" variant=\"tertiary\" slot=\"close\">\n <RiCloseLine />\n </Button>\n </Flex>\n );\n});\nDialogHeader.displayName = 'DialogHeader';\n\n/** @public */\nexport const DialogBody = forwardRef<React.ElementRef<'div'>, DialogBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(DialogBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div className={classes.root} ref={ref} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nDialogBody.displayName = 'DialogBody';\n\n/** @public */\nexport const DialogFooter = forwardRef<\n React.ElementRef<'div'>,\n DialogFooterProps\n>((props, ref) => {\n const { ownProps, restProps } = useDefinition(DialogFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n});\nDialogFooter.displayName = 'DialogFooter';\n"],"names":["RADialogTrigger","RADialog"],"mappings":";;;;;;;;;;;;;;AA4CO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,uBAAO,GAAA,CAACA,eAAA,EAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACrC;AAGO,MAAM,MAAA,GAAS,UAAA;AAAA,EACpB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,kBAAkB,KAAA,EAAO;AAAA,MACrE,eAAA,EAAiB;AAAA,KAClB,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.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 .Dialog_bui-DialogOverlay__c76e5a4658 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: color-mix(in srgb, var(--bui-bg-neutral-2) 80%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n\n [data-theme='dark'] .Dialog_bui-Dialog__c76e5a4658 {\n background: rgba(0, 0, 0, 0.5);\n }\n\n .Dialog_bui-DialogOverlay__c76e5a4658[data-entering] {\n animation: Dialog_fade-in__c76e5a4658 200ms ease-out forwards;\n }\n\n .Dialog_bui-DialogOverlay__c76e5a4658[data-exiting] {\n animation: Dialog_fade-out__c76e5a4658 150ms ease-out forwards;\n }\n\n .Dialog_bui-Dialog__c76e5a4658 {\n background: var(--bui-bg-popover);\n border-radius: 0.5rem;\n border: 1px solid var(--bui-border-1);\n color: var(--bui-fg-primary);\n position: relative;\n width: min(var(--bui-dialog-min-width, 400px), calc(100vw - 3rem));\n max-width: calc(100vw - 3rem);\n height: min(var(--bui-dialog-min-height, auto), calc(100vh - 3rem));\n max-height: calc(100vh - 3rem);\n display: flex;\n flex-direction: column;\n outline: none;\n }\n\n /* Dialog entering animation */\n .Dialog_bui-DialogOverlay__c76e5a4658[data-entering] .Dialog_bui-Dialog__c76e5a4658 {\n animation: Dialog_dialog-enter__c76e5a4658 150ms ease-out forwards;\n }\n\n /* Dialog exiting animation */\n .Dialog_bui-DialogOverlay__c76e5a4658[data-exiting] .Dialog_bui-Dialog__c76e5a4658 {\n animation: Dialog_dialog-exit__c76e5a4658 150ms ease-out forwards;\n }\n\n .Dialog_bui-DialogHeader__c76e5a4658 {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-2);\n border-bottom: 1px solid var(--bui-border-1);\n }\n\n .Dialog_bui-DialogHeaderTitle__c76e5a4658 {\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-bold);\n margin: 0;\n }\n\n .Dialog_bui-DialogFooter__c76e5a4658 {\n display: flex;\n align-items: center;\n justify-content: end;\n gap: var(--bui-space-2);\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-3);\n border-top: 1px solid var(--bui-border-1);\n }\n\n .Dialog_bui-DialogBody__c76e5a4658 {\n padding: var(--bui-space-3);\n flex: 1;\n overflow-y: auto;\n }\n\n /* Keyframe animations */\n @keyframes Dialog_fade-in__c76e5a4658 {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes Dialog_fade-out__c76e5a4658 {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n\n @keyframes Dialog_dialog-enter__c76e5a4658 {\n from {\n opacity: 0.5;\n transform: scale(0.8);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes Dialog_dialog-exit__c76e5a4658 {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n }\n}\n";
4
- var styles = {"bui-DialogOverlay":"Dialog_bui-DialogOverlay__c76e5a4658","bui-Dialog":"Dialog_bui-Dialog__c76e5a4658","fade-in":"Dialog_fade-in__c76e5a4658","fade-out":"Dialog_fade-out__c76e5a4658","dialog-enter":"Dialog_dialog-enter__c76e5a4658","dialog-exit":"Dialog_dialog-exit__c76e5a4658","bui-DialogHeader":"Dialog_bui-DialogHeader__c76e5a4658","bui-DialogHeaderTitle":"Dialog_bui-DialogHeaderTitle__c76e5a4658","bui-DialogFooter":"Dialog_bui-DialogFooter__c76e5a4658","bui-DialogBody":"Dialog_bui-DialogBody__c76e5a4658"};
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 .Dialog_bui-DialogOverlay__dedd12875c {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: color-mix(in srgb, var(--bui-bg-neutral-2) 80%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n\n [data-theme='dark'] .Dialog_bui-Dialog__dedd12875c {\n background: rgba(0, 0, 0, 0.5);\n }\n\n .Dialog_bui-DialogOverlay__dedd12875c[data-entering] {\n animation: Dialog_fade-in__dedd12875c 200ms ease-out forwards;\n }\n\n .Dialog_bui-DialogOverlay__dedd12875c[data-exiting] {\n animation: Dialog_fade-out__dedd12875c 150ms ease-out forwards;\n }\n\n .Dialog_bui-Dialog__dedd12875c {\n --dialog-border-radius: 0.5rem;\n background: var(--bui-bg-app);\n box-shadow: var(--bui-shadow);\n border-radius: var(--dialog-border-radius);\n border: 1px solid var(--bui-border-1);\n color: var(--bui-fg-primary);\n position: relative;\n width: min(var(--bui-dialog-min-width, 400px), calc(100vw - 3rem));\n max-width: calc(100vw - 3rem);\n height: min(var(--bui-dialog-min-height, auto), calc(100vh - 3rem));\n max-height: calc(100vh - 3rem);\n outline: none;\n }\n\n .Dialog_bui-DialogContent__dedd12875c {\n display: flex;\n flex-direction: column;\n border-radius: var(--dialog-border-radius);\n height: 100%;\n }\n\n /* Dialog entering animation */\n .Dialog_bui-DialogOverlay__dedd12875c[data-entering] .Dialog_bui-Dialog__dedd12875c {\n animation: Dialog_dialog-enter__dedd12875c 150ms ease-out forwards;\n }\n\n /* Dialog exiting animation */\n .Dialog_bui-DialogOverlay__dedd12875c[data-exiting] .Dialog_bui-Dialog__dedd12875c {\n animation: Dialog_dialog-exit__dedd12875c 150ms ease-out forwards;\n }\n\n .Dialog_bui-DialogHeader__dedd12875c {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-2);\n border-bottom: 1px solid var(--bui-border-1);\n }\n\n .Dialog_bui-DialogHeaderTitle__dedd12875c {\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-bold);\n margin: 0;\n }\n\n .Dialog_bui-DialogFooter__dedd12875c {\n display: flex;\n align-items: center;\n justify-content: end;\n gap: var(--bui-space-2);\n padding-inline: var(--bui-space-3);\n padding-block: var(--bui-space-3);\n border-top: 1px solid var(--bui-border-1);\n }\n\n .Dialog_bui-DialogBody__dedd12875c {\n padding: var(--bui-space-3);\n flex: 1;\n overflow-y: auto;\n }\n\n /* Keyframe animations */\n @keyframes Dialog_fade-in__dedd12875c {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes Dialog_fade-out__dedd12875c {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n\n @keyframes Dialog_dialog-enter__dedd12875c {\n from {\n opacity: 0.5;\n transform: scale(0.8);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n @keyframes Dialog_dialog-exit__dedd12875c {\n from {\n opacity: 1;\n transform: scale(1);\n }\n to {\n opacity: 0;\n transform: scale(0.95);\n }\n }\n}\n";
4
+ var styles = {"bui-DialogOverlay":"Dialog_bui-DialogOverlay__dedd12875c","bui-Dialog":"Dialog_bui-Dialog__dedd12875c","fade-in":"Dialog_fade-in__dedd12875c","fade-out":"Dialog_fade-out__dedd12875c","bui-DialogContent":"Dialog_bui-DialogContent__dedd12875c","dialog-enter":"Dialog_dialog-enter__dedd12875c","dialog-exit":"Dialog_dialog-exit__dedd12875c","bui-DialogHeader":"Dialog_bui-DialogHeader__dedd12875c","bui-DialogHeaderTitle":"Dialog_bui-DialogHeaderTitle__dedd12875c","bui-DialogFooter":"Dialog_bui-DialogFooter__dedd12875c","bui-DialogBody":"Dialog_bui-DialogBody__dedd12875c"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { styles as default };
@@ -1,13 +1,57 @@
1
- const DialogDefinition = {
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 { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
7
+ import styles from './Dialog.module.css.esm.js';
8
+
9
+ const DialogDefinition = defineComponent()({
10
+ styles,
2
11
  classNames: {
3
- overlay: "bui-DialogOverlay",
12
+ root: "bui-DialogOverlay",
4
13
  dialog: "bui-Dialog",
5
- header: "bui-DialogHeader",
6
- headerTitle: "bui-DialogHeaderTitle",
7
- body: "bui-DialogBody",
8
- footer: "bui-DialogFooter"
14
+ content: "bui-DialogContent"
15
+ },
16
+ propDefs: {
17
+ children: {},
18
+ className: {},
19
+ width: {},
20
+ height: {},
21
+ style: {}
22
+ }
23
+ });
24
+ const DialogHeaderDefinition = defineComponent()({
25
+ styles,
26
+ classNames: {
27
+ root: "bui-DialogHeader",
28
+ title: "bui-DialogHeaderTitle"
29
+ },
30
+ propDefs: {
31
+ children: {},
32
+ className: {}
33
+ }
34
+ });
35
+ const DialogBodyDefinition = defineComponent()({
36
+ styles,
37
+ classNames: {
38
+ root: "bui-DialogBody"
39
+ },
40
+ propDefs: {
41
+ children: {},
42
+ className: {}
43
+ }
44
+ });
45
+ const DialogFooterDefinition = defineComponent()({
46
+ styles,
47
+ classNames: {
48
+ root: "bui-DialogFooter"
49
+ },
50
+ propDefs: {
51
+ children: {},
52
+ className: {}
9
53
  }
10
- };
54
+ });
11
55
 
12
- export { DialogDefinition };
56
+ export { DialogBodyDefinition, DialogDefinition, DialogFooterDefinition, DialogHeaderDefinition };
13
57
  //# sourceMappingURL=definition.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Dialog/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 Dialog\n * @public\n */\nexport const DialogDefinition = {\n classNames: {\n overlay: 'bui-DialogOverlay',\n dialog: 'bui-Dialog',\n header: 'bui-DialogHeader',\n headerTitle: 'bui-DialogHeaderTitle',\n body: 'bui-DialogBody',\n footer: 'bui-DialogFooter',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,gBAAA,GAAmB;AAAA,EAC9B,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,mBAAA;AAAA,IACT,MAAA,EAAQ,YAAA;AAAA,IACR,MAAA,EAAQ,kBAAA;AAAA,IACR,WAAA,EAAa,uBAAA;AAAA,IACb,IAAA,EAAM,gBAAA;AAAA,IACN,MAAA,EAAQ;AAAA;AAEZ;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Dialog/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 DialogOwnProps,\n DialogHeaderOwnProps,\n DialogBodyOwnProps,\n DialogFooterOwnProps,\n} from './types';\nimport styles from './Dialog.module.css';\n\n/**\n * Component definition for Dialog\n * @public\n */\nexport const DialogDefinition = defineComponent<DialogOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogOverlay',\n dialog: 'bui-Dialog',\n content: 'bui-DialogContent',\n },\n propDefs: {\n children: {},\n className: {},\n width: {},\n height: {},\n style: {},\n },\n});\n\n/**\n * Component definition for DialogHeader\n * @public\n */\nexport const DialogHeaderDefinition = defineComponent<DialogHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogHeader',\n title: 'bui-DialogHeaderTitle',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for DialogBody\n * @public\n */\nexport const DialogBodyDefinition = defineComponent<DialogBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for DialogFooter\n * @public\n */\nexport const DialogFooterDefinition = defineComponent<DialogFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-DialogFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;AA6BO,MAAM,gBAAA,GAAmB,iBAAgC,CAAE;AAAA,EAChE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,mBAAA;AAAA,IACN,MAAA,EAAQ,YAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,UAAU,EAAC;AAAA,IACX,WAAW,EAAC;AAAA,IACZ,OAAO,EAAC;AAAA,IACR,QAAQ,EAAC;AAAA,IACT,OAAO;AAAC;AAEZ,CAAC;AAMM,MAAM,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,kBAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;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,sBAAA,GAAyB,iBAAsC,CAAE;AAAA,EAC5E,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,23 +1,14 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { FieldError as FieldError$1 } from 'react-aria-components';
4
- import clsx from 'clsx';
5
- import styles from './FieldError.module.css.esm.js';
6
- import { useStyles } from '../../hooks/useStyles.esm.js';
4
+ import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
7
5
  import { FieldErrorDefinition } from './definition.esm.js';
8
6
 
9
7
  const FieldError = forwardRef(
10
8
  (props, ref) => {
11
- const { classNames, cleanedProps } = useStyles(FieldErrorDefinition, props);
12
- const { className, ...rest } = cleanedProps;
13
- return /* @__PURE__ */ jsx(
14
- FieldError$1,
15
- {
16
- className: clsx(classNames.root, styles[classNames.root], className),
17
- ref,
18
- ...rest
19
- }
20
- );
9
+ const { ownProps, restProps } = useDefinition(FieldErrorDefinition, props);
10
+ const { classes } = ownProps;
11
+ return /* @__PURE__ */ jsx(FieldError$1, { className: classes.root, ref, ...restProps });
21
12
  }
22
13
  );
23
14
  FieldError.displayName = "FieldError";
@@ -1 +1 @@
1
- {"version":3,"file":"FieldError.esm.js","sources":["../../../src/components/FieldError/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport {\n FieldError as AriaFieldError,\n type FieldErrorProps,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport styles from './FieldError.module.css';\nimport { useStyles } from '../../hooks/useStyles';\nimport { FieldErrorDefinition } from './definition';\n\n/** @public */\nexport const FieldError = forwardRef<HTMLDivElement, FieldErrorProps>(\n (props: FieldErrorProps, ref) => {\n const { classNames, cleanedProps } = useStyles(FieldErrorDefinition, props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <AriaFieldError\n className={clsx(classNames.root, styles[classNames.root], className)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\n\nFieldError.displayName = 'FieldError';\n"],"names":["AriaFieldError"],"mappings":";;;;;;;;AA2BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAQ;AAC/B,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,sBAAsB,KAAK,CAAA;AAC1E,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,IAAA,uBACE,GAAA;AAAA,MAACA,YAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QACnE,GAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
1
+ {"version":3,"file":"FieldError.esm.js","sources":["../../../src/components/FieldError/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { FieldError as AriaFieldError } from 'react-aria-components';\nimport type { FieldErrorProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { FieldErrorDefinition } from './definition';\n\n/** @public */\nexport const FieldError = forwardRef<HTMLDivElement, FieldErrorProps>(\n (props: FieldErrorProps, ref) => {\n const { ownProps, restProps } = useDefinition(FieldErrorDefinition, props);\n const { classes } = ownProps;\n\n return <AriaFieldError className={classes.root} ref={ref} {...restProps} />;\n },\n);\n\nFieldError.displayName = 'FieldError';\n"],"names":["AriaFieldError"],"mappings":";;;;;;AAuBO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAQ;AAC/B,IAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAU,GAAI,aAAA,CAAc,sBAAsB,KAAK,CAAA;AACzE,IAAA,MAAM,EAAE,SAAQ,GAAI,QAAA;AAEpB,IAAA,2BAAQA,YAAA,EAAA,EAAe,SAAA,EAAW,QAAQ,IAAA,EAAM,GAAA,EAAW,GAAG,SAAA,EAAW,CAAA;AAAA,EAC3E;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
@@ -1,8 +1,20 @@
1
- const FieldErrorDefinition = {
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 { defineComponent } from '../../hooks/useDefinition/defineComponent.esm.js';
7
+ import styles from './FieldError.module.css.esm.js';
8
+
9
+ const FieldErrorDefinition = defineComponent()({
10
+ styles,
2
11
  classNames: {
3
12
  root: "bui-FieldError"
13
+ },
14
+ propDefs: {
15
+ className: {}
4
16
  }
5
- };
17
+ });
6
18
 
7
19
  export { FieldErrorDefinition };
8
20
  //# sourceMappingURL=definition.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.esm.js","sources":["../../../src/components/FieldError/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 FieldError\n * @public\n */\nexport const FieldErrorDefinition = {\n classNames: {\n root: 'bui-FieldError',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAA,GAAuB;AAAA,EAClC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA;AAEV;;;;"}
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/FieldError/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 { FieldErrorOwnProps } from './types';\nimport styles from './FieldError.module.css';\n\n/**\n * Component definition for FieldError\n * @public\n */\nexport const FieldErrorDefinition = defineComponent<FieldErrorOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldError',\n },\n propDefs: {\n className: {},\n },\n});\n"],"names":[],"mappings":";;;;;;;;AAwBO,MAAM,oBAAA,GAAuB,iBAAoC,CAAE;AAAA,EACxE,MAAA;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,WAAW;AAAC;AAEhB,CAAC;;;;"}
@@ -1,70 +1,25 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Label } from 'react-aria-components';
3
3
  import { forwardRef } from 'react';
4
- import { useStyles } from '../../hooks/useStyles.esm.js';
4
+ import { useDefinition } from '../../hooks/useDefinition/useDefinition.esm.js';
5
5
  import { FieldLabelDefinition } from './definition.esm.js';
6
- import styles from './FieldLabel.module.css.esm.js';
7
- import clsx from 'clsx';
8
6
 
9
7
  const FieldLabel = forwardRef(
10
8
  (props, ref) => {
11
- const { classNames, cleanedProps } = useStyles(FieldLabelDefinition, props);
12
- const {
13
- className,
14
- label,
15
- secondaryLabel,
16
- description,
17
- htmlFor,
18
- id,
19
- ...rest
20
- } = cleanedProps;
9
+ const { ownProps, restProps } = useDefinition(FieldLabelDefinition, props);
10
+ const { classes, label, secondaryLabel, description, htmlFor, id } = ownProps;
21
11
  if (!label) return null;
22
- return /* @__PURE__ */ jsxs(
23
- "div",
24
- {
25
- className: clsx(classNames.root, styles[classNames.root], className),
26
- ...rest,
27
- ref,
28
- children: [
29
- label && /* @__PURE__ */ jsxs(
30
- Label,
31
- {
32
- className: clsx(classNames.label, styles[classNames.label]),
33
- htmlFor,
34
- id,
35
- children: [
36
- label,
37
- secondaryLabel && /* @__PURE__ */ jsxs(
38
- "span",
39
- {
40
- "aria-hidden": "true",
41
- className: clsx(
42
- classNames.secondaryLabel,
43
- styles[classNames.secondaryLabel]
44
- ),
45
- children: [
46
- "(",
47
- secondaryLabel,
48
- ")"
49
- ]
50
- }
51
- )
52
- ]
53
- }
54
- ),
55
- description && /* @__PURE__ */ jsx(
56
- "div",
57
- {
58
- className: clsx(
59
- classNames.description,
60
- styles[classNames.description]
61
- ),
62
- children: description
63
- }
64
- )
65
- ]
66
- }
67
- );
12
+ return /* @__PURE__ */ jsxs("div", { className: classes.root, ...restProps, ref, children: [
13
+ label && /* @__PURE__ */ jsxs(Label, { className: classes.label, htmlFor, id, children: [
14
+ label,
15
+ secondaryLabel && /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: classes.secondaryLabel, children: [
16
+ "(",
17
+ secondaryLabel,
18
+ ")"
19
+ ] })
20
+ ] }),
21
+ description && /* @__PURE__ */ jsx("div", { className: classes.description, children: description })
22
+ ] });
68
23
  }
69
24
  );
70
25
  FieldLabel.displayName = "FieldLabel";