@backstage/ui 0.0.0-nightly-20251116024311 → 0.0.0-nightly-20251118024419

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 (158) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/README.md +23 -0
  3. package/dist/components/Accordion/Accordion.esm.js +5 -4
  4. package/dist/components/Accordion/Accordion.esm.js.map +1 -1
  5. package/dist/components/Accordion/definition.esm.js +15 -0
  6. package/dist/components/Accordion/definition.esm.js.map +1 -0
  7. package/dist/components/Avatar/Avatar.esm.js +9 -5
  8. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  9. package/dist/components/Avatar/definition.esm.js +13 -0
  10. package/dist/components/Avatar/definition.esm.js.map +1 -0
  11. package/dist/components/Box/Box.esm.js +2 -1
  12. package/dist/components/Box/Box.esm.js.map +1 -1
  13. package/dist/components/Box/definition.esm.js +32 -0
  14. package/dist/components/Box/definition.esm.js.map +1 -0
  15. package/dist/components/Button/Button.esm.js +9 -5
  16. package/dist/components/Button/Button.esm.js.map +1 -1
  17. package/dist/components/Button/definition.esm.js +15 -0
  18. package/dist/components/Button/definition.esm.js.map +1 -0
  19. package/dist/components/ButtonIcon/ButtonIcon.esm.js +11 -6
  20. package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -1
  21. package/dist/components/ButtonIcon/definition.esm.js +10 -0
  22. package/dist/components/ButtonIcon/definition.esm.js.map +1 -0
  23. package/dist/components/ButtonLink/ButtonLink.esm.js +11 -6
  24. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -1
  25. package/dist/components/ButtonLink/definition.esm.js +8 -0
  26. package/dist/components/ButtonLink/definition.esm.js.map +1 -0
  27. package/dist/components/Card/Card.esm.js +5 -4
  28. package/dist/components/Card/Card.esm.js.map +1 -1
  29. package/dist/components/Card/definition.esm.js +11 -0
  30. package/dist/components/Card/definition.esm.js.map +1 -0
  31. package/dist/components/Checkbox/Checkbox.esm.js +2 -1
  32. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  33. package/dist/components/Checkbox/definition.esm.js +12 -0
  34. package/dist/components/Checkbox/definition.esm.js.map +1 -0
  35. package/dist/components/Container/Container.esm.js +2 -1
  36. package/dist/components/Container/Container.esm.js.map +1 -1
  37. package/dist/components/Container/definition.esm.js +9 -0
  38. package/dist/components/Container/definition.esm.js.map +1 -0
  39. package/dist/components/Dialog/Dialog.esm.js +5 -4
  40. package/dist/components/Dialog/Dialog.esm.js.map +1 -1
  41. package/dist/components/Dialog/definition.esm.js +13 -0
  42. package/dist/components/Dialog/definition.esm.js.map +1 -0
  43. package/dist/components/FieldError/FieldError.esm.js +2 -1
  44. package/dist/components/FieldError/FieldError.esm.js.map +1 -1
  45. package/dist/components/FieldError/definition.esm.js +8 -0
  46. package/dist/components/FieldError/definition.esm.js.map +1 -0
  47. package/dist/components/FieldLabel/FieldLabel.esm.js +2 -1
  48. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  49. package/dist/components/FieldLabel/definition.esm.js +11 -0
  50. package/dist/components/FieldLabel/definition.esm.js.map +1 -0
  51. package/dist/components/Flex/Flex.esm.js +2 -1
  52. package/dist/components/Flex/Flex.esm.js.map +1 -1
  53. package/dist/components/Flex/definition.esm.js +28 -0
  54. package/dist/components/Flex/definition.esm.js.map +1 -0
  55. package/dist/components/Grid/Grid.esm.js +3 -2
  56. package/dist/components/Grid/Grid.esm.js.map +1 -1
  57. package/dist/components/Grid/definition.esm.js +32 -0
  58. package/dist/components/Grid/definition.esm.js.map +1 -0
  59. package/dist/components/Header/Header.esm.js +2 -1
  60. package/dist/components/Header/Header.esm.js.map +1 -1
  61. package/dist/components/Header/HeaderToolbar.esm.js +2 -1
  62. package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
  63. package/dist/components/Header/definition.esm.js +14 -0
  64. package/dist/components/Header/definition.esm.js.map +1 -0
  65. package/dist/components/HeaderPage/HeaderPage.esm.js +2 -1
  66. package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
  67. package/dist/components/HeaderPage/definition.esm.js +12 -0
  68. package/dist/components/HeaderPage/definition.esm.js.map +1 -0
  69. package/dist/components/Link/Link.esm.js +10 -6
  70. package/dist/components/Link/Link.esm.js.map +1 -1
  71. package/dist/components/Link/definition.esm.js +14 -0
  72. package/dist/components/Link/definition.esm.js.map +1 -0
  73. package/dist/components/Menu/Menu.esm.js +10 -9
  74. package/dist/components/Menu/Menu.esm.js.map +1 -1
  75. package/dist/components/Menu/definition.esm.js +23 -0
  76. package/dist/components/Menu/definition.esm.js.map +1 -0
  77. package/dist/components/Popover/definition.esm.js +8 -0
  78. package/dist/components/Popover/definition.esm.js.map +1 -0
  79. package/dist/components/RadioGroup/RadioGroup.esm.js +3 -2
  80. package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -1
  81. package/dist/components/RadioGroup/definition.esm.js +10 -0
  82. package/dist/components/RadioGroup/definition.esm.js.map +1 -0
  83. package/dist/components/SearchField/SearchField.esm.js +2 -1
  84. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  85. package/dist/components/SearchField/definition.esm.js +16 -0
  86. package/dist/components/SearchField/definition.esm.js.map +1 -0
  87. package/dist/components/Select/Select.esm.js +11 -6
  88. package/dist/components/Select/Select.esm.js.map +1 -1
  89. package/dist/components/Select/SelectContent.esm.js +2 -1
  90. package/dist/components/Select/SelectContent.esm.js.map +1 -1
  91. package/dist/components/Select/SelectListBox.esm.js +3 -2
  92. package/dist/components/Select/SelectListBox.esm.js.map +1 -1
  93. package/dist/components/Select/SelectTrigger.esm.js +2 -1
  94. package/dist/components/Select/SelectTrigger.esm.js.map +1 -1
  95. package/dist/components/Select/definition.esm.js +23 -0
  96. package/dist/components/Select/definition.esm.js.map +1 -0
  97. package/dist/components/Skeleton/Skeleton.esm.js +2 -1
  98. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  99. package/dist/components/Skeleton/definition.esm.js +8 -0
  100. package/dist/components/Skeleton/definition.esm.js.map +1 -0
  101. package/dist/components/Switch/Switch.esm.js +2 -1
  102. package/dist/components/Switch/Switch.esm.js.map +1 -1
  103. package/dist/components/Switch/definition.esm.js +9 -0
  104. package/dist/components/Switch/definition.esm.js.map +1 -0
  105. package/dist/components/Table/components/Cell.esm.js +2 -1
  106. package/dist/components/Table/components/Cell.esm.js.map +1 -1
  107. package/dist/components/Table/components/CellProfile.esm.js +5 -7
  108. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  109. package/dist/components/Table/components/Column.esm.js +2 -4
  110. package/dist/components/Table/components/Column.esm.js.map +1 -1
  111. package/dist/components/Table/components/Row.esm.js +2 -4
  112. package/dist/components/Table/components/Row.esm.js.map +1 -1
  113. package/dist/components/Table/components/Table.esm.js +2 -4
  114. package/dist/components/Table/components/Table.esm.js.map +1 -1
  115. package/dist/components/Table/components/TableBody.esm.js +2 -4
  116. package/dist/components/Table/components/TableBody.esm.js.map +1 -1
  117. package/dist/components/Table/components/TableHeader.esm.js +2 -4
  118. package/dist/components/Table/components/TableHeader.esm.js.map +1 -1
  119. package/dist/components/Table/definition.esm.js +24 -0
  120. package/dist/components/Table/definition.esm.js.map +1 -0
  121. package/dist/components/TablePagination/TablePagination.esm.js +2 -1
  122. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  123. package/dist/components/TablePagination/definition.esm.js +11 -0
  124. package/dist/components/TablePagination/definition.esm.js.map +1 -0
  125. package/dist/components/Tabs/Tabs.esm.js +5 -4
  126. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  127. package/dist/components/Tabs/TabsIndicators.esm.js +2 -1
  128. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
  129. package/dist/components/Tabs/definition.esm.js +14 -0
  130. package/dist/components/Tabs/definition.esm.js.map +1 -0
  131. package/dist/components/TagGroup/TagGroup.esm.js +3 -2
  132. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  133. package/dist/components/TagGroup/definition.esm.js +12 -0
  134. package/dist/components/TagGroup/definition.esm.js.map +1 -0
  135. package/dist/components/Text/Text.esm.js +10 -6
  136. package/dist/components/Text/Text.esm.js.map +1 -1
  137. package/dist/components/Text/definition.esm.js +14 -0
  138. package/dist/components/Text/definition.esm.js.map +1 -0
  139. package/dist/components/TextField/TextField.esm.js +2 -1
  140. package/dist/components/TextField/TextField.esm.js.map +1 -1
  141. package/dist/components/TextField/definition.esm.js +17 -0
  142. package/dist/components/TextField/definition.esm.js.map +1 -0
  143. package/dist/components/Tooltip/Tooltip.esm.js +2 -1
  144. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
  145. package/dist/components/Tooltip/definition.esm.js +9 -0
  146. package/dist/components/Tooltip/definition.esm.js.map +1 -0
  147. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +5 -1
  148. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -1
  149. package/dist/components/VisuallyHidden/definition.esm.js +8 -0
  150. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -0
  151. package/dist/hooks/useStyles.esm.js +1 -3
  152. package/dist/hooks/useStyles.esm.js.map +1 -1
  153. package/dist/index.d.ts +455 -362
  154. package/dist/index.esm.js +30 -1
  155. package/dist/index.esm.js.map +1 -1
  156. package/package.json +2 -2
  157. package/dist/utils/componentDefinitions.esm.js +0 -406
  158. package/dist/utils/componentDefinitions.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @backstage/ui
2
2
 
3
- ## 0.0.0-nightly-20251116024311
3
+ ## 0.0.0-nightly-20251118024419
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -84,6 +84,17 @@
84
84
  ```
85
85
 
86
86
  - 134151f: Fixing styles on SearchField in Backstage UI after migration to CSS modules. `SearchField` has now its own set of class names. We previously used class names from `TextField` but this approach was creating some confusion so going forward in your theme you'll be able to theme `TextField` and `SearchField` separately.
87
+ - a67670d: **BREAKING**: Removed central `componentDefinitions` object and related type utilities (`ComponentDefinitionName`, `ComponentClassNames`).
88
+
89
+ Component definitions are primarily intended for documenting the CSS class API for theming purposes, not for programmatic use in JavaScript/TypeScript.
90
+
91
+ **Migration Guide:**
92
+
93
+ If you were using component definitions or class names to build custom components, we recommend migrating to either:
94
+
95
+ - Use Backstage UI components directly as building blocks, or
96
+ - Duplicate the component CSS in your own stylesheets instead of relying on internal class names
97
+
87
98
  - b78fc45: **BREAKING**: Changed className prop behavior to augment default styles instead of being ignored or overriding them.
88
99
 
89
100
  Affected components:
package/README.md CHANGED
@@ -16,3 +16,26 @@ yarn add @backstage/ui
16
16
  - [Backstage UI Documentation](https://ui.backstage.io)
17
17
  - [Backstage Readme](https://github.com/backstage/backstage/blob/master/README.md)
18
18
  - [Backstage Documentation](https://backstage.io/docs)
19
+
20
+ ## Writing Changesets for Components
21
+
22
+ When creating changesets for component-specific changes, add component metadata to help maintain documentation:
23
+
24
+ ```markdown
25
+ ---
26
+ '@backstage/ui': patch
27
+ ---
28
+
29
+ Fixed size prop handling for Avatar component.
30
+
31
+ Affected components: Avatar
32
+ ```
33
+
34
+ **Guidelines:**
35
+
36
+ - **Component names**: Use PascalCase as they appear in imports (Avatar, ButtonIcon, SearchField)
37
+ - **Multiple components**: `Affected components: Button, ButtonLink, ButtonIcon`
38
+ - **General changes**: Omit the metadata line (build changes, package-level updates)
39
+ - **Placement**: The line can appear anywhere in the description
40
+
41
+ The changelog sync tool will parse these tags and update the documentation site automatically.
@@ -4,11 +4,12 @@ import { Disclosure, Heading, Button, DisclosurePanel, DisclosureGroup } from 'r
4
4
  import { RiArrowDownSLine } from '@remixicon/react';
5
5
  import clsx from 'clsx';
6
6
  import { useStyles } from '../../hooks/useStyles.esm.js';
7
+ import { AccordionDefinition } from './definition.esm.js';
7
8
  import styles from './Accordion.module.css.esm.js';
8
9
  import { Flex } from '../Flex/Flex.esm.js';
9
10
 
10
11
  const Accordion = forwardRef(({ className, ...props }, ref) => {
11
- const { classNames, cleanedProps } = useStyles("Accordion", props);
12
+ const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);
12
13
  return /* @__PURE__ */ jsx(
13
14
  Disclosure,
14
15
  {
@@ -20,7 +21,7 @@ const Accordion = forwardRef(({ className, ...props }, ref) => {
20
21
  });
21
22
  Accordion.displayName = "Accordion";
22
23
  const AccordionTrigger = forwardRef(({ className, title, subtitle, children, ...props }, ref) => {
23
- const { classNames, cleanedProps } = useStyles("Accordion", props);
24
+ const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);
24
25
  return /* @__PURE__ */ jsx(
25
26
  Heading,
26
27
  {
@@ -80,7 +81,7 @@ const AccordionTrigger = forwardRef(({ className, title, subtitle, children, ...
80
81
  });
81
82
  AccordionTrigger.displayName = "AccordionTrigger";
82
83
  const AccordionPanel = forwardRef(({ className, ...props }, ref) => {
83
- const { classNames, cleanedProps } = useStyles("Accordion", props);
84
+ const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);
84
85
  return /* @__PURE__ */ jsx(
85
86
  DisclosurePanel,
86
87
  {
@@ -92,7 +93,7 @@ const AccordionPanel = forwardRef(({ className, ...props }, ref) => {
92
93
  });
93
94
  AccordionPanel.displayName = "AccordionPanel";
94
95
  const AccordionGroup = forwardRef(({ className, allowsMultiple = false, ...props }, ref) => {
95
- const { classNames, cleanedProps } = useStyles("Accordion", props);
96
+ const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);
96
97
  return /* @__PURE__ */ jsx(
97
98
  DisclosureGroup,
98
99
  {
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.esm.js","sources":["../../../src/components/Accordion/Accordion.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 Disclosure as RADisclosure,\n Button as RAButton,\n DisclosurePanel as RADisclosurePanel,\n DisclosureGroup as RADisclosureGroup,\n Heading as RAHeading,\n} from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport type {\n AccordionProps,\n AccordionTriggerProps,\n AccordionPanelProps,\n AccordionGroupProps,\n} from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Accordion.module.css';\nimport { Flex } from '../Flex';\n\n/** @public */\nexport const Accordion = forwardRef<\n React.ElementRef<typeof RADisclosure>,\n AccordionProps\n>(({ className, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RADisclosure\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordion.displayName = 'Accordion';\n\n/** @public */\nexport const AccordionTrigger = forwardRef<\n React.ElementRef<typeof RAHeading>,\n AccordionTriggerProps\n>(({ className, title, subtitle, children, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RAHeading\n ref={ref}\n className={clsx(\n classNames.trigger,\n styles[classNames.trigger],\n className,\n )}\n {...cleanedProps}\n >\n <RAButton\n slot=\"trigger\"\n className={clsx(\n classNames.triggerButton,\n styles[classNames.triggerButton],\n )}\n >\n {children ? (\n children\n ) : (\n <Flex gap=\"2\" align=\"center\">\n <span\n className={clsx(\n classNames.triggerTitle,\n styles[classNames.triggerTitle],\n )}\n >\n {title}\n </span>\n {subtitle && (\n <span\n className={clsx(\n classNames.triggerSubtitle,\n styles[classNames.triggerSubtitle],\n )}\n >\n {subtitle}\n </span>\n )}\n </Flex>\n )}\n\n <RiArrowDownSLine\n className={clsx(\n classNames.triggerIcon,\n styles[classNames.triggerIcon],\n )}\n size={16}\n />\n </RAButton>\n </RAHeading>\n );\n});\n\nAccordionTrigger.displayName = 'AccordionTrigger';\n\n/** @public */\nexport const AccordionPanel = forwardRef<\n React.ElementRef<typeof RADisclosurePanel>,\n AccordionPanelProps\n>(({ className, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RADisclosurePanel\n ref={ref}\n className={clsx(classNames.panel, styles[classNames.panel], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordionPanel.displayName = 'AccordionPanel';\n\n/** @public */\nexport const AccordionGroup = forwardRef<\n React.ElementRef<typeof RADisclosureGroup>,\n AccordionGroupProps\n>(({ className, allowsMultiple = false, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RADisclosureGroup\n ref={ref}\n allowsMultipleExpanded={allowsMultiple}\n className={clsx(classNames.group, styles[classNames.group], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordionGroup.displayName = 'AccordionGroup';\n"],"names":["RADisclosure","RAHeading","RAButton","RADisclosurePanel","RADisclosureGroup"],"mappings":";;;;;;;;;AAqCO,MAAM,SAAA,GAAY,WAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,KAAQ;AAClC,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,aAAa,KAAK,CAAA;AAEjE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,SAAA,CAAU,WAAA,GAAc,WAAA;AAGjB,MAAM,gBAAA,GAAmB,UAAA,CAG9B,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,QAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,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ACF;AAAA,GACF;AAEJ,CAAC;AAED,gBAAA,CAAiB,WAAA,GAAc,kBAAA;AAGxB,MAAM,cAAA,GAAiB,WAG5B,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,KAAQ;AAClC,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,aAAa,KAAK,CAAA;AAEjE,EAAA,uBACE,GAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,KAAA,EAAO,OAAO,UAAA,CAAW,KAAK,GAAG,SAAS,CAAA;AAAA,MACpE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,cAAA,CAAe,WAAA,GAAc,gBAAA;AAGtB,MAAM,cAAA,GAAiB,UAAA,CAG5B,CAAC,EAAE,SAAA,EAAW,iBAAiB,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,aAAa,KAAK,CAAA;AAEjE,EAAA,uBACE,GAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,sBAAA,EAAwB,cAAA;AAAA,MACxB,SAAA,EAAW,KAAK,UAAA,CAAW,KAAA,EAAO,OAAO,UAAA,CAAW,KAAK,GAAG,SAAS,CAAA;AAAA,MACpE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,cAAA,CAAe,WAAA,GAAc,gBAAA;;;;"}
1
+ {"version":3,"file":"Accordion.esm.js","sources":["../../../src/components/Accordion/Accordion.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 Disclosure as RADisclosure,\n Button as RAButton,\n DisclosurePanel as RADisclosurePanel,\n DisclosureGroup as RADisclosureGroup,\n Heading as RAHeading,\n} from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport type {\n AccordionProps,\n AccordionTriggerProps,\n AccordionPanelProps,\n AccordionGroupProps,\n} from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { AccordionDefinition } from './definition';\nimport styles from './Accordion.module.css';\nimport { Flex } from '../Flex';\n\n/** @public */\nexport const Accordion = forwardRef<\n React.ElementRef<typeof RADisclosure>,\n AccordionProps\n>(({ className, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);\n\n return (\n <RADisclosure\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordion.displayName = 'Accordion';\n\n/** @public */\nexport const AccordionTrigger = forwardRef<\n React.ElementRef<typeof RAHeading>,\n AccordionTriggerProps\n>(({ className, title, subtitle, children, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);\n\n return (\n <RAHeading\n ref={ref}\n className={clsx(\n classNames.trigger,\n styles[classNames.trigger],\n className,\n )}\n {...cleanedProps}\n >\n <RAButton\n slot=\"trigger\"\n className={clsx(\n classNames.triggerButton,\n styles[classNames.triggerButton],\n )}\n >\n {children ? (\n children\n ) : (\n <Flex gap=\"2\" align=\"center\">\n <span\n className={clsx(\n classNames.triggerTitle,\n styles[classNames.triggerTitle],\n )}\n >\n {title}\n </span>\n {subtitle && (\n <span\n className={clsx(\n classNames.triggerSubtitle,\n styles[classNames.triggerSubtitle],\n )}\n >\n {subtitle}\n </span>\n )}\n </Flex>\n )}\n\n <RiArrowDownSLine\n className={clsx(\n classNames.triggerIcon,\n styles[classNames.triggerIcon],\n )}\n size={16}\n />\n </RAButton>\n </RAHeading>\n );\n});\n\nAccordionTrigger.displayName = 'AccordionTrigger';\n\n/** @public */\nexport const AccordionPanel = forwardRef<\n React.ElementRef<typeof RADisclosurePanel>,\n AccordionPanelProps\n>(({ className, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);\n\n return (\n <RADisclosurePanel\n ref={ref}\n className={clsx(classNames.panel, styles[classNames.panel], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordionPanel.displayName = 'AccordionPanel';\n\n/** @public */\nexport const AccordionGroup = forwardRef<\n React.ElementRef<typeof RADisclosureGroup>,\n AccordionGroupProps\n>(({ className, allowsMultiple = false, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles(AccordionDefinition, props);\n\n return (\n <RADisclosureGroup\n ref={ref}\n allowsMultipleExpanded={allowsMultiple}\n className={clsx(classNames.group, styles[classNames.group], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordionGroup.displayName = 'AccordionGroup';\n"],"names":["RADisclosure","RAHeading","RAButton","RADisclosurePanel","RADisclosureGroup"],"mappings":";;;;;;;;;;AAsCO,MAAM,SAAA,GAAY,WAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,KAAQ;AAClC,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,qBAAqB,KAAK,CAAA;AAEzE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,SAAA,CAAU,WAAA,GAAc,WAAA;AAGjB,MAAM,gBAAA,GAAmB,UAAA,CAG9B,CAAC,EAAE,SAAA,EAAW,KA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ordionTriggerButton",
6
+ triggerTitle: "bui-AccordionTriggerTitle",
7
+ triggerSubtitle: "bui-AccordionTriggerSubtitle",
8
+ triggerIcon: "bui-AccordionTriggerIcon",
9
+ panel: "bui-AccordionPanel",
10
+ group: "bui-AccordionGroup"
11
+ }
12
+ };
13
+
14
+ export { AccordionDefinition };
15
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Accordion/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 Accordion\n * @public\n */\nexport const AccordionDefinition = {\n classNames: {\n root: 'bui-Accordion',\n trigger: 'bui-AccordionTrigger',\n triggerButton: 'bui-AccordionTriggerButton',\n triggerTitle: 'bui-AccordionTriggerTitle',\n triggerSubtitle: 'bui-AccordionTriggerSubtitle',\n triggerIcon: 'bui-AccordionTriggerIcon',\n panel: 'bui-AccordionPanel',\n group: 'bui-AccordionGroup',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,mBAAA,GAAsB;AAAA,EACjC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAA;AAAA,IACN,OAAA,EAAS,sBAAA;AAAA,IACT,aAAA,EAAe,4BAAA;AAAA,IACf,YAAA,EAAc,2BAAA;AAAA,IACd,eAAA,EAAiB,8BAAA;AAAA,IACjB,WAAA,EAAa,0BAAA;AAAA,IACb,KAAA,EAAO,oBAAA;AAAA,IACP,KAAA,EAAO;AAAA;AAEX;;;;"}
@@ -2,14 +2,18 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef, useState, useEffect } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
5
+ import { AvatarDefinition } from './definition.esm.js';
5
6
  import styles from './Avatar.module.css.esm.js';
6
7
 
7
8
  const Avatar = forwardRef((props, ref) => {
8
- const { classNames, dataAttributes, cleanedProps } = useStyles("Avatar", {
9
- size: "medium",
10
- purpose: "informative",
11
- ...props
12
- });
9
+ const { classNames, dataAttributes, cleanedProps } = useStyles(
10
+ AvatarDefinition,
11
+ {
12
+ size: "medium",
13
+ purpose: "informative",
14
+ ...props
15
+ }
16
+ );
13
17
  const { className, src, name, purpose, ...rest } = cleanedProps;
14
18
  const [imageStatus, setImageStatus] = useState("loading");
15
19
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.esm.js","sources":["../../../src/components/Avatar/Avatar.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, useState, useEffect } from 'react';\nimport clsx from 'clsx';\nimport { AvatarProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Avatar.module.css';\n\n/** @public */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles('Avatar', {\n size: 'medium',\n purpose: 'informative',\n ...props,\n });\n\n const { className, src, name, purpose, ...rest } = cleanedProps;\n\n const [imageStatus, setImageStatus] = useState<\n 'loading' | 'loaded' | 'error'\n >('loading');\n\n useEffect(() => {\n setImageStatus('loading');\n const img = new Image();\n img.onload = () => setImageStatus('loaded');\n img.onerror = () => setImageStatus('error');\n img.src = src;\n\n return () => {\n img.onload = null;\n img.onerror = null;\n };\n }, [src]);\n\n const initialsCount = ['x-small', 'small'].includes(cleanedProps.size)\n ? 1\n : 2;\n\n const initials = name\n .split(' ')\n .map(word => word[0])\n .join('')\n .toLocaleUpperCase('en-US')\n .slice(0, initialsCount);\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={purpose === 'informative' ? name : undefined}\n aria-hidden={purpose === 'decoration' ? true : undefined}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...rest}\n >\n {imageStatus === 'loaded' ? (\n <img\n src={src}\n alt=\"\"\n className={clsx(classNames.image, styles[classNames.image])}\n />\n ) : (\n <div\n aria-hidden=\"true\"\n className={clsx(classNames.fallback, styles[classNames.fallback])}\n >\n {initials}\n </div>\n )}\n </div>\n );\n});\n\nAvatar.displayName = 'Avatar';\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,QAAA;AAAA,IACN,OAAA,EAAS,aAAA;AAAA,IACT,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM,EAAE,SAAA,EAAW,GAAA,EAAK,MAAM,OAAA,EAAS,GAAG,MAAK,GAAI,YAAA;AAEnD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAEpC,SAAS,CAAA;AAEX,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,cAAA,CAAe,SAAS,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,IAAI,KAAA,EAAM;AACtB,IAAA,GAAA,CAAI,MAAA,GAAS,MAAM,cA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mBAEA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAY,MAAA;AAAA,UACZ,WAAW,IAAA,CAAK,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,QAAQ,CAAC,CAAA;AAAA,UAE/D,QAAA,EAAA;AAAA;AAAA;AACH;AAAA,GAEJ;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
1
+ {"version":3,"file":"Avatar.esm.js","sources":["../../../src/components/Avatar/Avatar.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, useState, useEffect } from 'react';\nimport clsx from 'clsx';\nimport { AvatarProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { AvatarDefinition } from './definition';\nimport styles from './Avatar.module.css';\n\n/** @public */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles(\n AvatarDefinition,\n {\n size: 'medium',\n purpose: 'informative',\n ...props,\n },\n );\n\n const { className, src, name, purpose, ...rest } = cleanedProps;\n\n const [imageStatus, setImageStatus] = useState<\n 'loading' | 'loaded' | 'error'\n >('loading');\n\n useEffect(() => {\n setImageStatus('loading');\n const img = new Image();\n img.onload = () => setImageStatus('loaded');\n img.onerror = () => setImageStatus('error');\n img.src = src;\n\n return () => {\n img.onload = null;\n img.onerror = null;\n };\n }, [src]);\n\n const initialsCount = ['x-small', 'small'].includes(cleanedProps.size)\n ? 1\n : 2;\n\n const initials = name\n .split(' ')\n .map(word => word[0])\n .join('')\n .toLocaleUpperCase('en-US')\n .slice(0, initialsCount);\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={purpose === 'informative' ? name : undefined}\n aria-hidden={purpose === 'decoration' ? true : undefined}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...rest}\n >\n {imageStatus === 'loaded' ? (\n <img\n src={src}\n alt=\"\"\n className={clsx(classNames.image, styles[classNames.image])}\n />\n ) : (\n <div\n aria-hidden=\"true\"\n className={clsx(classNames.fallback, styles[classNames.fallback])}\n >\n {initials}\n </div>\n )}\n </div>\n );\n});\n\nAvatar.displayName = 'Avatar';\n"],"names":[],"mappings":";;;;;;;AAwBO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,SAAA;AAAA,IACnD,gBAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,QAAA;AAAA,MACN,OAAA,EAAS,aAAA;AAAA,MACT,GAAG;AAAA;AACL,GACF;AAEA,EAAA,MAAM,EAAE,SAAA,EAAW,GAAA,EAAK,MAAM,OAAA,EAAS,GAAG,MAAK,GAAI,YAAA;AAEnD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAEpC,SAAS,CAAA;AAEX,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,cAAA,CAAe,SAAS,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,IAAI,KAAA,EAAM;AACtB,IAAA,GAAA,CAAI,MAAA,GAAS,MAAM,cAAA,CAAe,QAAQ,CAAA;AAC1C,IAAA,GAAA,CAAI,OAAA,GAAU,MAAM,cAAA,CAAe,OAAO,CAAA;AAC1C,IAAA,GAAA,CAAI,GAAA,GAAM,GAAA;AAEV,IAAA,OAAO,MAAM;AACX,MAAA,GAAA,CAAI,MAAA,GAAS,IAAA;AACb,MAAA,GAAA,C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;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
@@ -0,0 +1,13 @@
1
+ const AvatarDefinition = {
2
+ classNames: {
3
+ root: "bui-AvatarRoot",
4
+ image: "bui-AvatarImage",
5
+ fallback: "bui-AvatarFallback"
6
+ },
7
+ dataAttributes: {
8
+ size: ["small", "medium", "large"]
9
+ }
10
+ };
11
+
12
+ export { AvatarDefinition };
13
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Avatar/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 Avatar\n * @public\n */\nexport const AvatarDefinition = {\n classNames: {\n root: 'bui-AvatarRoot',\n image: 'bui-AvatarImage',\n fallback: 'bui-AvatarFallback',\n },\n dataAttributes: {\n size: ['small', 'medium', 'large'] as const,\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,gBAAA,GAAmB;AAAA,EAC9B,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,KAAA,EAAO,iBAAA;AAAA,IACP,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,CAAC,OAAA,EAAS,QAAA,EAAU,OAAO;AAAA;AAErC;;;;"}
@@ -2,10 +2,11 @@ import { forwardRef, createElement } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { useStyles } from '../../hooks/useStyles.esm.js';
4
4
  import styles from './Box.module.css.esm.js';
5
+ import { BoxDefinition } from './definition.esm.js';
5
6
 
6
7
  const Box = forwardRef((props, ref) => {
7
8
  const { classNames, utilityClasses, style, cleanedProps } = useStyles(
8
- "Box",
9
+ BoxDefinition,
9
10
  props
10
11
  );
11
12
  const { as = "div", children, className, ...rest } = cleanedProps;
@@ -1 +1 @@
1
- {"version":3,"file":"Box.esm.js","sources":["../../../src/components/Box/Box.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 { createElement, forwardRef } from 'react';\nimport { BoxProps } from './types';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Box.module.css';\n\n/** @public */\nexport const Box = forwardRef<HTMLDivElement, BoxProps>((props, ref) => {\n const { classNames, utilityClasses, style, cleanedProps } = useStyles(\n 'Box',\n props,\n );\n\n const { as = 'div', children, className, ...rest } = cleanedProps;\n\n return createElement(\n as,\n {\n ref,\n className: clsx(\n classNames.root,\n styles[classNames.root],\n utilityClasses,\n className,\n ),\n style,\n ...rest,\n },\n children,\n );\n});\n\nBox.displayName = 'Box';\n"],"names":[],"mappings":";;;;;AAuBO,MAAM,GAAA,GAAM,UAAA,CAAqC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACtE,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,KAAA,EAAO,cAAa,GAAI,SAAA;AAAA,IAC1D,KAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,EAAE,EAAA,GAAK,KAAA,EAAO,UAAU,SAAA,EAAW,GAAG,MAAK,GAAI,YAAA;AAErD,EAAA,OAAO,aAAA;AAAA,IACL,EAAA;AAAA,IACA;AAAA,MACE,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,IAAA;AAAA,QACX,MAAA,CAAO,WAAW,IAAI,CAAA;AAAA,QACtB,cAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,KAAA;AAAA,MACA,GAAG;AAAA,KACL;AAAA,IACA;AAAA,GACF;AACF,CAAC;AAED,GAAA,CAAI,WAAA,GAAc,KAAA;;;;"}
1
+ {"version":3,"file":"Box.esm.js","sources":["../../../src/components/Box/Box.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 { createElement, forwardRef } from 'react';\nimport { BoxProps } from './types';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Box.module.css';\nimport { BoxDefinition } from './definition';\n\n/** @public */\nexport const Box = forwardRef<HTMLDivElement, BoxProps>((props, ref) => {\n const { classNames, utilityClasses, style, cleanedProps } = useStyles(\n BoxDefinition,\n props,\n );\n\n const { as = 'div', children, className, ...rest } = cleanedProps;\n\n return createElement(\n as,\n {\n ref,\n className: clsx(\n classNames.root,\n styles[classNames.root],\n utilityClasses,\n className,\n ),\n style,\n ...rest,\n },\n children,\n );\n});\n\nBox.displayName = 'Box';\n"],"names":[],"mappings":";;;;;;AAwBO,MAAM,GAAA,GAAM,UAAA,CAAqC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACtE,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,KAAA,EAAO,cAAa,GAAI,SAAA;AAAA,IAC1D,aAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,EAAE,EAAA,GAAK,KAAA,EAAO,UAAU,SAAA,EAAW,GAAG,MAAK,GAAI,YAAA;AAErD,EAAA,OAAO,aAAA;AAAA,IACL,EAAA;AAAA,IACA;AAAA,MACE,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,IAAA;AAAA,QACX,MAAA,CAAO,WAAW,IAAI,CAAA;AAAA,QACtB,cAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,KAAA;AAAA,MACA,GAAG;AAAA,KACL;AAAA,IACA;AAAA,GACF;AACF,CAAC;AAED,GAAA,CAAI,WAAA,GAAc,KAAA;;;;"}
@@ -0,0 +1,32 @@
1
+ const BoxDefinition = {
2
+ classNames: {
3
+ root: "bui-Box"
4
+ },
5
+ utilityProps: [
6
+ "m",
7
+ "mb",
8
+ "ml",
9
+ "mr",
10
+ "mt",
11
+ "mx",
12
+ "my",
13
+ "p",
14
+ "pb",
15
+ "pl",
16
+ "pr",
17
+ "pt",
18
+ "px",
19
+ "py",
20
+ "position",
21
+ "display",
22
+ "width",
23
+ "minWidth",
24
+ "maxWidth",
25
+ "height",
26
+ "minHeight",
27
+ "maxHeight"
28
+ ]
29
+ };
30
+
31
+ export { BoxDefinition };
32
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Box/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 Box\n * @public\n */\nexport const BoxDefinition = {\n classNames: {\n root: 'bui-Box',\n },\n utilityProps: [\n 'm',\n 'mb',\n 'ml',\n 'mr',\n 'mt',\n 'mx',\n 'my',\n 'p',\n 'pb',\n 'pl',\n 'pr',\n 'pt',\n 'px',\n 'py',\n 'position',\n 'display',\n 'width',\n 'minWidth',\n 'maxWidth',\n 'height',\n 'minHeight',\n 'maxHeight',\n ],\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,aAAA,GAAgB;AAAA,EAC3B,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA,GACR;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA;AAEJ;;;;"}
@@ -4,15 +4,19 @@ import { forwardRef } from 'react';
4
4
  import { Button as Button$1, ProgressBar } from 'react-aria-components';
5
5
  import { RiLoader4Line } from '@remixicon/react';
6
6
  import { useStyles } from '../../hooks/useStyles.esm.js';
7
+ import { ButtonDefinition } from './definition.esm.js';
7
8
  import stylesButton from './Button.module.css.esm.js';
8
9
 
9
10
  const Button = forwardRef(
10
11
  (props, ref) => {
11
- const { classNames, dataAttributes, cleanedProps } = useStyles("Button", {
12
- size: "small",
13
- variant: "primary",
14
- ...props
15
- });
12
+ const { classNames, dataAttributes, cleanedProps } = useStyles(
13
+ ButtonDefinition,
14
+ {
15
+ size: "small",
16
+ variant: "primary",
17
+ ...props
18
+ }
19
+ );
16
20
  const { children, className, iconStart, iconEnd, loading, ...rest } = cleanedProps;
17
21
  return /* @__PURE__ */ jsx(
18
22
  Button$1,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.esm.js","sources":["../../../src/components/Button/Button.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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { Button as RAButton, ProgressBar } from 'react-aria-components';\nimport { RiLoader4Line } from '@remixicon/react';\nimport type { ButtonProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Button.module.css';\n\n/** @public */\nexport const Button = forwardRef(\n (props: ButtonProps, ref: Ref<HTMLButtonElement>) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles('Button', {\n size: 'small',\n variant: 'primary',\n ...props,\n });\n\n const { children, className, iconStart, iconEnd, loading, ...rest } =\n cleanedProps;\n\n return (\n <RAButton\n className={clsx(classNames.root, styles[classNames.root], className)}\n ref={ref}\n isPending={loading}\n {...dataAttributes}\n {...rest}\n >\n {({ isPending }) => (\n <>\n <span\n className={clsx(classNames.content, styles[classNames.content])}\n >\n {iconStart}\n {children}\n {iconEnd}\n </span>\n\n {isPending && (\n <ProgressBar\n aria-label=\"Loading\"\n isIndeterminate\n className={clsx(classNames.spinner, styles[classNames.spinner])}\n >\n <RiLoader4Line aria-hidden=\"true\" />\n </ProgressBar>\n )}\n </>\n )}\n </RAButton>\n );\n },\n);\n\n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,aAAA,EAAY,MAAA,EAAO;AAAA;AAAA;AACpC,SAAA,EAEJ;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
1
+ {"version":3,"file":"Button.esm.js","sources":["../../../src/components/Button/Button.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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { Button as RAButton, ProgressBar } from 'react-aria-components';\nimport { RiLoader4Line } from '@remixicon/react';\nimport type { ButtonProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { ButtonDefinition } from './definition';\nimport styles from './Button.module.css';\n\n/** @public */\nexport const Button = forwardRef(\n (props: ButtonProps, ref: Ref<HTMLButtonElement>) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles(\n ButtonDefinition,\n {\n size: 'small',\n variant: 'primary',\n ...props,\n },\n );\n\n const { children, className, iconStart, iconEnd, loading, ...rest } =\n cleanedProps;\n\n return (\n <RAButton\n className={clsx(classNames.root, styles[classNames.root], className)}\n ref={ref}\n isPending={loading}\n {...dataAttributes}\n {...rest}\n >\n {({ isPending }) => (\n <>\n <span\n className={clsx(classNames.content, styles[classNames.content])}\n >\n {iconStart}\n {children}\n {iconEnd}\n </span>\n\n {isPending && (\n <ProgressBar\n aria-label=\"Loading\"\n isIndeterminate\n className={clsx(classNames.spinner, styles[classNames.spinner])}\n >\n <RiLoader4Line aria-hidden=\"true\" />\n </ProgressBar>\n )}\n </>\n )}\n </RAButton>\n );\n },\n);\n\n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aAAA,EAAA,EAAc,aAAA,EAAY,MAAA,EAAO;AAAA;AAAA;AACpC,SAAA,EAEJ;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
@@ -0,0 +1,15 @@
1
+ const ButtonDefinition = {
2
+ classNames: {
3
+ root: "bui-Button",
4
+ content: "bui-ButtonContent",
5
+ spinner: "bui-ButtonSpinner"
6
+ },
7
+ dataAttributes: {
8
+ size: ["small", "medium", "large"],
9
+ variant: ["primary", "secondary", "tertiary"],
10
+ loading: [true, false]
11
+ }
12
+ };
13
+
14
+ export { ButtonDefinition };
15
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Button/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 Button\n * @public\n */\nexport const ButtonDefinition = {\n classNames: {\n root: 'bui-Button',\n content: 'bui-ButtonContent',\n spinner: 'bui-ButtonSpinner',\n },\n dataAttributes: {\n size: ['small', 'medium', 'large'] as const,\n variant: ['primary', 'secondary', 'tertiary'] as const,\n loading: [true, false] as const,\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,gBAAA,GAAmB;AAAA,EAC9B,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,OAAA,EAAS,mBAAA;AAAA,IACT,OAAA,EAAS;AAAA,GACX;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,CAAC,OAAA,EAAS,QAAA,EAAU,OAAO,CAAA;AAAA,IACjC,OAAA,EAAS,CAAC,SAAA,EAAW,WAAA,EAAa,UAAU,CAAA;AAAA,IAC5C,OAAA,EAAS,CAAC,IAAA,EAAM,KAAK;AAAA;AAEzB;;;;"}
@@ -4,17 +4,22 @@ import { forwardRef } from 'react';
4
4
  import { Button, ProgressBar } from 'react-aria-components';
5
5
  import { RiLoader4Line } from '@remixicon/react';
6
6
  import { useStyles } from '../../hooks/useStyles.esm.js';
7
+ import { ButtonDefinition } from '../Button/definition.esm.js';
8
+ import { ButtonIconDefinition } from './definition.esm.js';
7
9
  import stylesButtonIcon from './ButtonIcon.module.css.esm.js';
8
10
  import stylesButton from '../Button/Button.module.css.esm.js';
9
11
 
10
12
  const ButtonIcon = forwardRef(
11
13
  (props, ref) => {
12
- const { classNames, dataAttributes, cleanedProps } = useStyles("Button", {
13
- size: "small",
14
- variant: "primary",
15
- ...props
16
- });
17
- const { classNames: classNamesButtonIcon } = useStyles("ButtonIcon");
14
+ const { classNames, dataAttributes, cleanedProps } = useStyles(
15
+ ButtonDefinition,
16
+ {
17
+ size: "small",
18
+ variant: "primary",
19
+ ...props
20
+ }
21
+ );
22
+ const { classNames: classNamesButtonIcon } = useStyles(ButtonIconDefinition);
18
23
  const { className, icon, loading, ...rest } = cleanedProps;
19
24
  return /* @__PURE__ */ jsx(
20
25
  Button,
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonIcon.esm.js","sources":["../../../src/components/ButtonIcon/ButtonIcon.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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { Button as RAButton, ProgressBar } from 'react-aria-components';\nimport { RiLoader4Line } from '@remixicon/react';\nimport type { ButtonIconProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport stylesButtonIcon from './ButtonIcon.module.css';\nimport stylesButton from '../Button/Button.module.css';\n\n/** @public */\nexport const ButtonIcon = forwardRef(\n (props: ButtonIconProps, ref: Ref<HTMLButtonElement>) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles('Button', {\n size: 'small',\n variant: 'primary',\n ...props,\n });\n\n const { classNames: classNamesButtonIcon } = useStyles('ButtonIcon');\n\n const { className, icon, loading, ...rest } = cleanedProps;\n\n return (\n <RAButton\n className={clsx(\n classNames.root,\n classNamesButtonIcon.root,\n stylesButton[classNames.root],\n stylesButtonIcon[classNamesButtonIcon.root],\n className,\n )}\n ref={ref}\n isPending={loading}\n {...dataAttributes}\n {...rest}\n >\n {({ isPending }) => (\n <>\n <span\n className={clsx(\n classNames.content,\n classNamesButtonIcon.content,\n stylesButton[classNames.content],\n stylesButtonIcon[classNamesButtonIcon.content],\n className,\n )}\n >\n {icon}\n </span>\n\n {isPending && (\n <ProgressBar\n aria-label=\"Loading\"\n isIndeterminate\n className={clsx(\n classNames.spinner,\n classNamesButtonIcon.spinner,\n stylesButton[classNames.spinner],\n stylesButtonIcon[classNamesButtonIcon.spinner],\n className,\n )}\n >\n <RiLoader4Line aria-hidden=\"true\" />\n </ProgressBar>\n )}\n </>\n )}\n </RAButton>\n );\n },\n);\n\nButtonIcon.displayName = 'ButtonIcon';\n"],"names":["RAButton"],"mappings":";;;;;;;;;AA0BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,MACvE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O,CAAA;AAAA,gBAC/B,gBAAA,CAAiB,qBAAqB,OAAO,CAAA;AAAA,gBAC7C;AAAA,eACF;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,aAAA,EAAY,MAAA,EAAO;AAAA;AAAA;AACpC,SAAA,EAEJ;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
1
+ {"version":3,"file":"ButtonIcon.esm.js","sources":["../../../src/components/ButtonIcon/ButtonIcon.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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { Button as RAButton, ProgressBar } from 'react-aria-components';\nimport { RiLoader4Line } from '@remixicon/react';\nimport type { ButtonIconProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { ButtonDefinition } from '../Button/definition';\nimport { ButtonIconDefinition } from './definition';\nimport stylesButtonIcon from './ButtonIcon.module.css';\nimport stylesButton from '../Button/Button.module.css';\n\n/** @public */\nexport const ButtonIcon = forwardRef(\n (props: ButtonIconProps, ref: Ref<HTMLButtonElement>) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles(\n ButtonDefinition,\n {\n size: 'small',\n variant: 'primary',\n ...props,\n },\n );\n\n const { classNames: classNamesButtonIcon } =\n useStyles(ButtonIconDefinition);\n\n const { className, icon, loading, ...rest } = cleanedProps;\n\n return (\n <RAButton\n className={clsx(\n classNames.root,\n classNamesButtonIcon.root,\n stylesButton[classNames.root],\n stylesButtonIcon[classNamesButtonIcon.root],\n className,\n )}\n ref={ref}\n isPending={loading}\n {...dataAttributes}\n {...rest}\n >\n {({ isPending }) => (\n <>\n <span\n className={clsx(\n classNames.content,\n classNamesButtonIcon.content,\n stylesButton[classNames.content],\n stylesButtonIcon[classNamesButtonIcon.content],\n className,\n )}\n >\n {icon}\n </span>\n\n {isPending && (\n <ProgressBar\n aria-label=\"Loading\"\n isIndeterminate\n className={clsx(\n classNames.spinner,\n classNamesButtonIcon.spinner,\n stylesButton[classNames.spinner],\n stylesButtonIcon[classNamesButtonIcon.spinner],\n className,\n )}\n >\n <RiLoader4Line aria-hidden=\"true\" />\n </ProgressBar>\n )}\n </>\n )}\n </RAButton>\n );\n },\n);\n\nButtonIcon.displayName = 'ButtonIcon';\n"],"names":["RAButton"],"mappings":";;;;;;;;;;;AA4BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,SAAA;AAAA,MACnD,gBAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,OAAA;AAAA,QACN,OAAA,EAAS,SAAA;AAAA,QACT,GAAG;AAAA;AACL,KACF;AAEA,IAAA,MAAM,EAAE,UAAA,EAAY,oBAAA,EAAqB,GACvC,UAAU,oBAAoB,CAAA;AAEhC,IAAA,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,OAAA,EAAS,GAAG,MAAK,GAAI,YAAA;AAE9C,IAAA,uBACE,GAAA;AAAA,MAACA,MAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,IAAA;AAAA,UACX,oBAAA,CAAqB,IAAA;AAAA,UACrB,YAAA,CAAa,WAAW,IAAI,CAAA;AAAA,UAC5B,gBAAA,CAAiB,qBAAqB,IAAI,CAAA;AAAA,UAC1C;AAAA,SACF;AAAA,QACA,GAAA;AAAA,QACA,SAAA,EAAW,OAAA;AAAA,QACV,GAAG,cAAA;AAAA,QACH,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA,CAAC,EAAE,SAAA,EAAU,qBACZ,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,IAAA;AAAA,gBACT,UAAA,CAAW,OAAA;AAAA,gBACX,oBAAA,CAAqB,OAAA;AAAA,gBACrB,YAAA,CAAa,WAAW,OAAO,CAAA;AAAA,gBAC/B,gBAAA,CAAiB,qBAAqB,OAAO,CAAA;AAAA,gBAC7C;AAAA,eACF;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA,WACH;AAAA,UAEC,SAAA,oBACC,GAAA;AAAA,YAAC,WAAA;AAAA,YAAA;AAAA,cACC,YAAA,EAAW,SAAA;AAAA,cACX,eAAA,EAAe,IAAA;AAAA,cACf,SAAA,EAAW,IAAA;AAAA,gBACT,UAAA,CAAW,OAAA;AAAA,gBACX,oBAAA,CAAqB,OAAA;AAAA,gBACrB,YAAA,CAAa,WAAW,OAAO,CAAA;AAAA,gBAC/B,gBAAA,CAAiB,qBAAqB,OAAO,CAAA;AAAA,gBAC7C;AAAA,eACF;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,aAAA,EAAY,MAAA,EAAO;AAAA;AAAA;AACpC,SAAA,EAEJ;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
@@ -0,0 +1,10 @@
1
+ const ButtonIconDefinition = {
2
+ classNames: {
3
+ root: "bui-ButtonIcon",
4
+ content: "bui-ButtonIconContent",
5
+ spinner: "bui-ButtonIconSpinner"
6
+ }
7
+ };
8
+
9
+ export { ButtonIconDefinition };
10
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/ButtonIcon/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 ButtonIcon\n * @public\n */\nexport const ButtonIconDefinition = {\n classNames: {\n root: 'bui-ButtonIcon',\n content: 'bui-ButtonIconContent',\n spinner: 'bui-ButtonIconSpinner',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAA,GAAuB;AAAA,EAClC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,gBAAA;AAAA,IACN,OAAA,EAAS,uBAAA;AAAA,IACT,OAAA,EAAS;AAAA;AAEb;;;;"}
@@ -4,18 +4,23 @@ import { forwardRef } from 'react';
4
4
  import { Link, RouterProvider } from 'react-aria-components';
5
5
  import { useNavigate, useHref } from 'react-router-dom';
6
6
  import { useStyles } from '../../hooks/useStyles.esm.js';
7
+ import { ButtonDefinition } from '../Button/definition.esm.js';
8
+ import { ButtonLinkDefinition } from './definition.esm.js';
7
9
  import { isExternalLink } from '../../utils/isExternalLink.esm.js';
8
10
  import stylesButton from '../Button/Button.module.css.esm.js';
9
11
 
10
12
  const ButtonLink = forwardRef(
11
13
  (props, ref) => {
12
14
  const navigate = useNavigate();
13
- const { classNames, dataAttributes, cleanedProps } = useStyles("Button", {
14
- size: "small",
15
- variant: "primary",
16
- ...props
17
- });
18
- const { classNames: classNamesButtonLink } = useStyles("ButtonLink");
15
+ const { classNames, dataAttributes, cleanedProps } = useStyles(
16
+ ButtonDefinition,
17
+ {
18
+ size: "small",
19
+ variant: "primary",
20
+ ...props
21
+ }
22
+ );
23
+ const { classNames: classNamesButtonLink } = useStyles(ButtonLinkDefinition);
19
24
  const { children, className, iconStart, iconEnd, href, ...rest } = cleanedProps;
20
25
  const isExternal = isExternalLink(href);
21
26
  const linkButton = /* @__PURE__ */ jsx(
@@ -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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { Link as RALink, RouterProvider } from 'react-aria-components';\nimport { useNavigate, useHref } from 'react-router-dom';\nimport type { ButtonLinkProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { isExternalLink } from '../../utils/isExternalLink';\nimport stylesButton from '../Button/Button.module.css';\n\n/** @public */\nexport const ButtonLink = forwardRef(\n (props: ButtonLinkProps, ref: Ref<HTMLAnchorElement>) => {\n const navigate = useNavigate();\n\n const { classNames, dataAttributes, cleanedProps } = useStyles('Button', {\n size: 'small',\n variant: 'primary',\n ...props,\n });\n\n const { classNames: classNamesButtonLink } = useStyles('ButtonLink');\n\n const { children, className, iconStart, iconEnd, href, ...rest } =\n cleanedProps;\n\n const isExternal = isExternalLink(href);\n\n const linkButton = (\n <RALink\n className={clsx(\n classNames.root,\n classNamesButtonLink.root,\n stylesButton[classNames.root],\n className,\n )}\n ref={ref}\n {...dataAttributes}\n href={href}\n {...rest}\n >\n <span\n className={clsx(classNames.content, stylesButton[classNames.content])}\n >\n {iconStart}\n {children}\n {iconEnd}\n </span>\n </RALink>\n );\n\n // If it's an external link, render RALink without RouterProvider\n if (isExternal) {\n return linkButton;\n }\n\n // For internal links, use RouterProvider\n return (\n <RouterProvider navigate={navigate} useHref={useHref}>\n {linkButton}\n </RouterProvider>\n );\n },\n);\n\nButtonLink.displayName = 'ButtonLink';\n"],"names":["RALink"],"mappings":";;;;;;;;;AA0BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,MACvE,IAAA,EAAM,OAAA;AAAA,MACN,OAAA,EAAS,SAAA;AAAA,MACT,GAAG;AAAA,KACJ,CAAA;AAED,IAAA,MAAM,EAAE,UAAA,EAAY,oBAAA,EAAqB,GAAI,UAAU,YAAY,CAAA;AAEnE,IAAA,MAAM,EAAE,UAAU,SAAA,EAAW,SAAA,EAAW,SAAS,IAAA,EAAM,GAAG,MAAK,GAC7D,YAAA;AAEF,IAAA,MAAM,UAAA,GAAa,eAAe,IAAI,CAAA;AAEtC,IAAA,MAAM,UAAA,mBACJ,GAAA;AAAA,MAACA,IAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,IAAA;AAAA,UACX,oBAAA,CAAqB,IAAA;AAAA,UACrB,YAAA,CAAa,WAAW,IAAI,CAAA;AAAA,UAC5B;AAAA,SACF;AAAA,QACA,GAAA;AAAA,QACC,GAAG,cAAA;AAAA,QACJ,IAAA;AAAA,QACC,GAAG,IAAA;AAAA,QAEJ,QAAA,kBAAA,IAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,YAAA,CAAa,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,YAEnE,QAAA,EAAA;AAAA,cAAA,SAAA;AAAA,cACA,QAAA;AAAA,cACA;AAAA;AAAA;AAAA;AACH;AAAA,KACF;AAIF,IAAA,IAAI,UAAA,EAAY;AACd,MAAA,OAAO,UAAA;AAAA,IACT;AAGA,IAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EACjC,QAAA,EAAA,UAAA,EACH,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 clsx from 'clsx';\nimport { forwardRef, Ref } from 'react';\nimport { Link as RALink, RouterProvider } from 'react-aria-components';\nimport { useNavigate, useHref } from 'react-router-dom';\nimport type { ButtonLinkProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { ButtonDefinition } from '../Button/definition';\nimport { ButtonLinkDefinition } from './definition';\nimport { isExternalLink } from '../../utils/isExternalLink';\nimport stylesButton from '../Button/Button.module.css';\n\n/** @public */\nexport const ButtonLink = forwardRef(\n (props: ButtonLinkProps, ref: Ref<HTMLAnchorElement>) => {\n const navigate = useNavigate();\n\n const { classNames, dataAttributes, cleanedProps } = useStyles(\n ButtonDefinition,\n {\n size: 'small',\n variant: 'primary',\n ...props,\n },\n );\n\n const { classNames: classNamesButtonLink } =\n useStyles(ButtonLinkDefinition);\n\n const { children, className, iconStart, iconEnd, href, ...rest } =\n cleanedProps;\n\n const isExternal = isExternalLink(href);\n\n const linkButton = (\n <RALink\n className={clsx(\n classNames.root,\n classNamesButtonLink.root,\n stylesButton[classNames.root],\n className,\n )}\n ref={ref}\n {...dataAttributes}\n href={href}\n {...rest}\n >\n <span\n className={clsx(classNames.content, stylesButton[classNames.content])}\n >\n {iconStart}\n {children}\n {iconEnd}\n </span>\n </RALink>\n );\n\n // If it's an external link, render RALink without RouterProvider\n if (isExternal) {\n return linkButton;\n }\n\n // For internal links, use RouterProvider\n return (\n <RouterProvider navigate={navigate} useHref={useHref}>\n {linkButton}\n </RouterProvider>\n );\n },\n);\n\nButtonLink.displayName = 'ButtonLink';\n"],"names":["RALink"],"mappings":";;;;;;;;;;;AA4BO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAgC;AACvD,IAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,IAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,SAAA;AAAA,MACnD,gBAAA;AAAA,MACA;AAAA,QACE,IAAA,EAAM,OAAA;AAAA,QACN,OAAA,EAAS,SAAA;AAAA,QACT,GAAG;AAAA;AACL,KACF;AAEA,IAAA,MAAM,EAAE,UAAA,EAAY,oBAAA,EAAqB,GACvC,UAAU,oBAAoB,CAAA;AAEhC,IAAA,MAAM,EAAE,UAAU,SAAA,EAAW,SAAA,EAAW,SAAS,IAAA,EAAM,GAAG,MAAK,GAC7D,YAAA;AAEF,IAAA,MAAM,UAAA,GAAa,eAAe,IAAI,CAAA;AAEtC,IAAA,MAAM,UAAA,mBACJ,GAAA;AAAA,MAACA,IAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,IAAA;AAAA,UACX,oBAAA,CAAqB,IAAA;AAAA,UACrB,YAAA,CAAa,WAAW,IAAI,CAAA;AAAA,UAC5B;AAAA,SACF;AAAA,QACA,GAAA;AAAA,QACC,GAAG,cAAA;AAAA,QACJ,IAAA;AAAA,QACC,GAAG,IAAA;AAAA,QAEJ,QAAA,kBAAA,IAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,YAAA,CAAa,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,YAEnE,QAAA,EAAA;AAAA,cAAA,SAAA;AAAA,cACA,QAAA;AAAA,cACA;AAAA;AAAA;AAAA;AACH;AAAA,KACF;AAIF,IAAA,IAAI,UAAA,EAAY;AACd,MAAA,OAAO,UAAA;AAAA,IACT;AAGA,IAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EACjC,QAAA,EAAA,UAAA,EACH,CAAA;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
@@ -0,0 +1,8 @@
1
+ const ButtonLinkDefinition = {
2
+ classNames: {
3
+ root: "bui-ButtonLink"
4
+ }
5
+ };
6
+
7
+ export { ButtonLinkDefinition };
8
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +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 type { ComponentDefinition } from '../../types';\n\n/**\n * Component definition for ButtonLink\n * @public\n */\nexport const ButtonLinkDefinition = {\n classNames: {\n root: 'bui-ButtonLink',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,oBAAA,GAAuB;AAAA,EAClC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA;AAEV;;;;"}
@@ -2,10 +2,11 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
5
+ import { CardDefinition } from './definition.esm.js';
5
6
  import styles from './Card.module.css.esm.js';
6
7
 
7
8
  const Card = forwardRef((props, ref) => {
8
- const { classNames, cleanedProps } = useStyles("Card", props);
9
+ const { classNames, cleanedProps } = useStyles(CardDefinition, props);
9
10
  const { className, ...rest } = cleanedProps;
10
11
  return /* @__PURE__ */ jsx(
11
12
  "div",
@@ -18,7 +19,7 @@ const Card = forwardRef((props, ref) => {
18
19
  });
19
20
  const CardHeader = forwardRef(
20
21
  (props, ref) => {
21
- const { classNames, cleanedProps } = useStyles("Card", props);
22
+ const { classNames, cleanedProps } = useStyles(CardDefinition, props);
22
23
  const { className, ...rest } = cleanedProps;
23
24
  return /* @__PURE__ */ jsx(
24
25
  "div",
@@ -36,7 +37,7 @@ const CardHeader = forwardRef(
36
37
  );
37
38
  const CardBody = forwardRef(
38
39
  (props, ref) => {
39
- const { classNames, cleanedProps } = useStyles("Card", props);
40
+ const { classNames, cleanedProps } = useStyles(CardDefinition, props);
40
41
  const { className, ...rest } = cleanedProps;
41
42
  return /* @__PURE__ */ jsx(
42
43
  "div",
@@ -50,7 +51,7 @@ const CardBody = forwardRef(
50
51
  );
51
52
  const CardFooter = forwardRef(
52
53
  (props, ref) => {
53
- const { classNames, cleanedProps } = useStyles("Card", props);
54
+ const { classNames, cleanedProps } = useStyles(CardDefinition, props);
54
55
  const { className, ...rest } = cleanedProps;
55
56
  return /* @__PURE__ */ jsx(
56
57
  "div",
@@ -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 clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { classNames, cleanedProps } = useStyles('Card', props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n />\n );\n});\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles('Card', props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.header,\n styles[classNames.header],\n className,\n )}\n {...rest}\n />\n );\n },\n);\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles('Card', props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(classNames.body, styles[classNames.body], className)}\n {...rest}\n />\n );\n },\n);\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles('Card', props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.footer,\n styles[classNames.footer],\n className,\n )}\n {...rest}\n />\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AAgCO,MAAM,IAAA,GAAO,UAAA,C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IAAI,GAAG,SAAS,CAAA;AAAA,QAClE,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAOO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,QAAQ,KAAK,CAAA;AAC5D,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,MAAA;AAAA,UACX,MAAA,CAAO,WAAW,MAAM,CAAA;AAAA,UACxB;AAAA,SACF;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;;;;"}
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 clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport { CardDefinition } from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { classNames, cleanedProps } = useStyles(CardDefinition, props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n />\n );\n});\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles(CardDefinition, props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.header,\n styles[classNames.header],\n className,\n )}\n {...rest}\n />\n );\n },\n);\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles(CardDefinition, props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(classNames.body, styles[classNames.body], className)}\n {...rest}\n />\n );\n },\n);\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles(CardDefinition, props);\n const { className, ...rest } = cleanedProps;\n\n return (\n <div\n ref={ref}\n className={clsx(\n classNames.footer,\n styles[classNames.footer],\n className,\n )}\n {...rest}\n />\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;AAiCO,MAAM,IAAA,GAAO,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,gBAAgB,KAAK,CAAA;AACpE,EAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAK,GAAI,YAAA;AAE/B,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAOM,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,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,MAAM,CAAA;AAAA,UACxB;AAAA,SACF;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,11 @@
1
+ const CardDefinition = {
2
+ classNames: {
3
+ root: "bui-Card",
4
+ header: "bui-CardHeader",
5
+ body: "bui-CardBody",
6
+ footer: "bui-CardFooter"
7
+ }
8
+ };
9
+
10
+ export { CardDefinition };
11
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +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 type { ComponentDefinition } from '../../types';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = {\n classNames: {\n root: 'bui-Card',\n header: 'bui-CardHeader',\n body: 'bui-CardBody',\n footer: 'bui-CardFooter',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,cAAA,GAAiB;AAAA,EAC5B,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,UAAA;AAAA,IACN,MAAA,EAAQ,gBAAA;AAAA,IACR,IAAA,EAAM,cAAA;AAAA,IACN,MAAA,EAAQ;AAAA;AAEZ;;;;"}
@@ -2,13 +2,14 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { Checkbox as Checkbox$1 } from 'react-aria-components';
4
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
5
+ import { CheckboxDefinition } from './definition.esm.js';
5
6
  import clsx from 'clsx';
6
7
  import styles from './Checkbox.module.css.esm.js';
7
8
  import { RiCheckLine } from '@remixicon/react';
8
9
 
9
10
  const Checkbox = forwardRef(
10
11
  (props, ref) => {
11
- const { classNames } = useStyles("Checkbox");
12
+ const { classNames } = useStyles(CheckboxDefinition);
12
13
  const { className, children, ...rest } = props;
13
14
  return /* @__PURE__ */ jsxs(
14
15
  Checkbox$1,