@backstage/ui 0.0.0-nightly-20251117024228 → 0.0.0-nightly-20251120024358

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 (160) hide show
  1. package/CHANGELOG.md +18 -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/Table/hooks/useTable.esm.js +1 -1
  122. package/dist/components/Table/hooks/useTable.esm.js.map +1 -1
  123. package/dist/components/TablePagination/TablePagination.esm.js +2 -1
  124. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  125. package/dist/components/TablePagination/definition.esm.js +11 -0
  126. package/dist/components/TablePagination/definition.esm.js.map +1 -0
  127. package/dist/components/Tabs/Tabs.esm.js +5 -4
  128. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  129. package/dist/components/Tabs/TabsIndicators.esm.js +2 -1
  130. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -1
  131. package/dist/components/Tabs/definition.esm.js +14 -0
  132. package/dist/components/Tabs/definition.esm.js.map +1 -0
  133. package/dist/components/TagGroup/TagGroup.esm.js +3 -2
  134. package/dist/components/TagGroup/TagGroup.esm.js.map +1 -1
  135. package/dist/components/TagGroup/definition.esm.js +12 -0
  136. package/dist/components/TagGroup/definition.esm.js.map +1 -0
  137. package/dist/components/Text/Text.esm.js +10 -6
  138. package/dist/components/Text/Text.esm.js.map +1 -1
  139. package/dist/components/Text/definition.esm.js +14 -0
  140. package/dist/components/Text/definition.esm.js.map +1 -0
  141. package/dist/components/TextField/TextField.esm.js +2 -1
  142. package/dist/components/TextField/TextField.esm.js.map +1 -1
  143. package/dist/components/TextField/definition.esm.js +17 -0
  144. package/dist/components/TextField/definition.esm.js.map +1 -0
  145. package/dist/components/Tooltip/Tooltip.esm.js +2 -1
  146. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -1
  147. package/dist/components/Tooltip/definition.esm.js +9 -0
  148. package/dist/components/Tooltip/definition.esm.js.map +1 -0
  149. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +5 -1
  150. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -1
  151. package/dist/components/VisuallyHidden/definition.esm.js +8 -0
  152. package/dist/components/VisuallyHidden/definition.esm.js.map +1 -0
  153. package/dist/hooks/useStyles.esm.js +1 -3
  154. package/dist/hooks/useStyles.esm.js.map +1 -1
  155. package/dist/index.d.ts +455 -362
  156. package/dist/index.esm.js +30 -1
  157. package/dist/index.esm.js.map +1 -1
  158. package/package.json +2 -2
  159. package/dist/utils/componentDefinitions.esm.js +0 -406
  160. package/dist/utils/componentDefinitions.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SelectListBox.esm.js","sources":["../../../src/components/Select/SelectListBox.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 { ListBox, ListBoxItem, Text } from 'react-aria-components';\nimport { RiCheckLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Select.module.css';\nimport type { Option } from './types';\n\ninterface SelectListBoxProps {\n options?: Array<Option>;\n}\n\nconst NoResults = () => {\n const { classNames } = useStyles('Select');\n\n return (\n <div className={clsx(classNames.noResults, styles[classNames.noResults])}>\n No results found.\n </div>\n );\n};\n\nexport function SelectListBox({ options, ...props }: SelectListBoxProps) {\n const { classNames } = useStyles('Select', props);\n return (\n <ListBox\n className={clsx(classNames.list, styles[classNames.list])}\n renderEmptyState={() => <NoResults />}\n >\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n textValue={option.label}\n className={clsx(classNames.item, styles[classNames.item])}\n isDisabled={option.disabled}\n >\n <div\n className={clsx(\n classNames.itemIndicator,\n styles[classNames.itemIndicator],\n )}\n >\n <RiCheckLine />\n </div>\n <Text\n slot=\"label\"\n className={clsx(classNames.itemLabel, styles[classNames.itemLabel])}\n >\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n );\n}\n"],"names":[],"mappings":";;;;;;;AA2BA,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,QAAQ,CAAA;AAEzC,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,MAAA,CAAO,UAAA,CAAW,SAAS,CAAC,CAAA,EAAG,QAAA,EAAA,mBAAA,EAE1E,CAAA;AAEJ,CAAA;AAEO,SAAS,aAAA,CAAc,EAAE,OAAA,EAAS,GAAG,OAAM,EAAuB;AACvE,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAChD,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,MACxD,gBAAA,EAAkB,sBAAM,GAAA,CAAC,SAAA,EAAA,EAAU,CAAA;AAAA,MAElC,QAAA,EAAA,OAAA,EAAS,IAAI,CAAA,MAAA,qBACZ,IAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UAEC,IAAI,MAAA,CAAO,KAAA;AAAA,UACX,WAAW,MAAA,CAAO,KAAA;AAAA,UAClB,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,UACxD,YAAY,MAAA,CAAO,QAAA;AAAA,UAEnB,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,IAAA;AAAA,kBACT,UAAA,CAAW,aAAA;AAAA,kBACX,MAAA,CAAO,WAAW,aAAa;AAAA,iBACjC;AAAA,gBAEA,8BAAC,WAAA,EAAA,EAAY;AAAA;AAAA,aACf;AAAA,4BACA,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EAAK,OAAA;AAAA,gBACL,WAAW,IAAA,CAAK,UAAA,CAAW,WAAW,MAAA,CAAO,UAAA,CAAW,SAAS,CAAC,CAAA;AAAA,gBAEjE,QAAA,EAAA,MAAA,CAAO;AAAA;AAAA;AACV;AAAA,SAAA;AAAA,QAnBK,MAAA,CAAO;AAAA,OAqBf;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"SelectListBox.esm.js","sources":["../../../src/components/Select/SelectListBox.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 { ListBox, ListBoxItem, Text } from 'react-aria-components';\nimport { RiCheckLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport { SelectDefinition } from './definition';\nimport styles from './Select.module.css';\nimport type { Option } from './types';\n\ninterface SelectListBoxProps {\n options?: Array<Option>;\n}\n\nconst NoResults = () => {\n const { classNames } = useStyles(SelectDefinition);\n\n return (\n <div className={clsx(classNames.noResults, styles[classNames.noResults])}>\n No results found.\n </div>\n );\n};\n\nexport function SelectListBox({ options, ...props }: SelectListBoxProps) {\n const { classNames } = useStyles(SelectDefinition, props);\n return (\n <ListBox\n className={clsx(classNames.list, styles[classNames.list])}\n renderEmptyState={() => <NoResults />}\n >\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n textValue={option.label}\n className={clsx(classNames.item, styles[classNames.item])}\n isDisabled={option.disabled}\n >\n <div\n className={clsx(\n classNames.itemIndicator,\n styles[classNames.itemIndicator],\n )}\n >\n <RiCheckLine />\n </div>\n <Text\n slot=\"label\"\n className={clsx(classNames.itemLabel, styles[classNames.itemLabel])}\n >\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,gBAAgB,CAAA;AAEjD,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,MAAA,CAAO,UAAA,CAAW,SAAS,CAAC,CAAA,EAAG,QAAA,EAAA,mBAAA,EAE1E,CAAA;AAEJ,CAAA;AAEO,SAAS,aAA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owDownSLine } from '@remixicon/react';
4
4
  import clsx from 'clsx';
5
5
  import { useStyles } from '../../hooks/useStyles.esm.js';
6
+ import { SelectDefinition } from './definition.esm.js';
6
7
  import styles from './Select.module.css.esm.js';
7
8
 
8
9
  function SelectTrigger({ icon }) {
9
- const { classNames } = useStyles("Select");
10
+ const { classNames } = useStyles(SelectDefinition);
10
11
  return /* @__PURE__ */ jsxs(Button, { className: clsx(classNames.trigger, styles[classNames.trigger]), children: [
11
12
  icon,
12
13
  /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTrigger.esm.js","sources":["../../../src/components/Select/SelectTrigger.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 { ReactNode } from 'react';\nimport { Button, SelectValue } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Select.module.css';\n\ninterface SelectTriggerProps {\n icon?: ReactNode;\n}\n\nexport function SelectTrigger({ icon }: SelectTriggerProps) {\n const { classNames } = useStyles('Select');\n\n return (\n <Button className={clsx(classNames.trigger, styles[classNames.trigger])}>\n {icon}\n <SelectValue\n className={clsx(classNames.value, styles[classNames.value])}\n />\n <div className={clsx(classNames.chevron, styles[classNames.chevron])}>\n <RiArrowDownSLine aria-hidden=\"true\" />\n </div>\n </Button>\n );\n}\n"],"names":[],"mappings":";;;;;;;AA2BO,SAAS,aAAA,CAAc,EAAE,IAAA,EAAK,EAAuB;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,QAAQ,CAAA;AAEzC,EAAA,uBACE,IAAA,CAAC,MAAA,EAAA,EAAO,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA,EACnE,QAAA,EAAA;AAAA,IAAA,IAAA;AAAA,oBACD,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC;AAAA;AAAA,KAC5D;AAAA,oBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,IAAA,CAAK,WAAW,OAAA,EAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA,EACjE,QAAA,kBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,aAAA,EAAY,QAAO,CAAA,EACvC;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"SelectTrigger.esm.js","sources":["../../../src/components/Select/SelectTrigger.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 { ReactNode } from 'react';\nimport { Button, SelectValue } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\nimport { SelectDefinition } from './definition';\nimport styles from './Select.module.css';\n\ninterface SelectTriggerProps {\n icon?: ReactNode;\n}\n\nexport function SelectTrigger({ icon }: SelectTriggerProps) {\n const { classNames } = useStyles(SelectDefinition);\n\n return (\n <Button className={clsx(classNames.trigger, styles[classNames.trigger])}>\n {icon}\n <SelectValue\n className={clsx(classNames.value, styles[classNames.value])}\n />\n <div className={clsx(classNames.chevron, styles[classNames.chevron])}>\n <RiArrowDownSLine aria-hidden=\"true\" />\n </div>\n </Button>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4BO,SAAS,aAAA,CAAc,EAAE,IAAA,EAAK,EAAuB;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,gBAAgB,CAAA;AAEjD,EAAA,uBACE,IAAA,CAAC,MAAA,EAAA,EAAO,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA,EACnE,QAAA,EAAA;AAAA,IAAA,IAAA;AAAA,oBACD,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC;AAAA;AAAA,KAC5D;AAAA,oBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,IAAA,CAAK,WAAW,OAAA,EAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA,EACjE,QAAA,kBAAA,GAAA,CAAC,gBAAA,EAAA,EAAiB,aAAA,EAAY,QAAO,CAAA,EACvC;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,23 @@
1
+ const SelectDefinition = {
2
+ classNames: {
3
+ root: "bui-Select",
4
+ popover: "bui-SelectPopover",
5
+ trigger: "bui-SelectTrigger",
6
+ chevron: "bui-SelectTriggerChevron",
7
+ value: "bui-SelectValue",
8
+ list: "bui-SelectList",
9
+ item: "bui-SelectItem",
10
+ itemIndicator: "bui-SelectItemIndicator",
11
+ itemLabel: "bui-SelectItemLabel",
12
+ searchWrapper: "bui-SelectSearchWrapper",
13
+ search: "bui-SelectSearch",
14
+ searchClear: "bui-SelectSearchClear",
15
+ noResults: "bui-SelectNoResults"
16
+ },
17
+ dataAttributes: {
18
+ size: ["small", "medium"]
19
+ }
20
+ };
21
+
22
+ export { SelectDefinition };
23
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Select/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 Select\n * @public\n */\nexport const SelectDefinition = {\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n trigger: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n list: 'bui-SelectList',\n item: 'bui-SelectItem',\n itemIndicator: 'bui-SelectItemIndicator',\n itemLabel: 'bui-SelectItemLabel',\n searchWrapper: 'bui-SelectSearchWrapper',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n noResults: 'bui-SelectNoResults',\n },\n dataAttributes: {\n size: ['small', 'medium'] 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,mBAAA;AAAA,IACT,OAAA,EAAS,0BAAA;AAAA,IACT,KAAA,EAAO,iBAAA;AAAA,IACP,IAAA,EAAM,gBAAA;AAAA,IACN,IAAA,EAAM,gBAAA;AAAA,IACN,aAAA,EAAe,yBAAA;AAAA,IACf,SAAA,EAAW,qBAAA;AAAA,IACX,aAAA,EAAe,yBAAA;AAAA,IACf,MAAA,EAAQ,kBAAA;AAAA,IACR,WAAA,EAAa,uBAAA;AAAA,IACb,SAAA,EAAW;AAAA,GACb;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,CAAC,OAAA,EAAS,QAAQ;AAAA;AAE5B;;;;"}
@@ -1,10 +1,11 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useStyles } from '../../hooks/useStyles.esm.js';
3
+ import { SkeletonDefinition } from './definition.esm.js';
3
4
  import styles from './Skeleton.module.css.esm.js';
4
5
  import clsx from 'clsx';
5
6
 
6
7
  const Skeleton = (props) => {
7
- const { classNames, cleanedProps } = useStyles("Skeleton", {
8
+ const { classNames, cleanedProps } = useStyles(SkeletonDefinition, {
8
9
  width: 80,
9
10
  height: 24,
10
11
  rounded: false,
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.esm.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useStyles } from '../../hooks/useStyles';\nimport { SkeletonProps } from './types';\nimport styles from './Skeleton.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Skeleton = (props: SkeletonProps) => {\n const { classNames, cleanedProps } = useStyles('Skeleton', {\n width: 80,\n height: 24,\n rounded: false,\n ...props,\n });\n const { className, width, height, rounded, style, ...rest } = cleanedProps;\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n data-rounded={rounded}\n style={{\n width,\n height,\n ...style,\n }}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":";;;;;AAsBO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AAChD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,UAAA,EAAY;AAAA,IACzD,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,EAAA;AAAA,IACR,OAAA,EAAS,KAAA;AAAA,IACT,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM,EAAE,WAAW,KAAA,EAAO,MAAA,EAAQ,SAAS,KAAA,EAAO,GAAG,MAAK,GAAI,YAAA;AAE9D,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MACnE,cAAA,EAAc,OAAA;AAAA,MACd,KAAA,EAAO;AAAA,QACL,KAAA;AAAA,QACA,MAAA;AAAA,QACA,GAAG;AAAA,OACL;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
1
+ {"version":3,"file":"Skeleton.esm.js","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useStyles } from '../../hooks/useStyles';\nimport { SkeletonDefinition } from './definition';\nimport { SkeletonProps } from './types';\nimport styles from './Skeleton.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Skeleton = (props: SkeletonProps) => {\n const { classNames, cleanedProps } = useStyles(SkeletonDefinition, {\n width: 80,\n height: 24,\n rounded: false,\n ...props,\n });\n const { className, width, height, rounded, style, ...rest } = cleanedProps;\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n data-rounded={rounded}\n style={{\n width,\n height,\n ...style,\n }}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AAChD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,kBAAA,EAAoB;AAAA,IACjE,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,EAAA;AAAA,IACR,OAAA,EAAS,KAAA;AAAA,IACT,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM,EAAE,WAAW,KAAA,EAAO,MAAA,EAAQ,SAAS,KAAA,EAAO,GAAG,MAAK,GAAI,YAAA;AAE9D,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MACnE,cAAA,EAAc,OAAA;AAAA,MACd,KAAA,EAAO;AAAA,QACL,KAAA;AAAA,QACA,MAAA;AAAA,QACA,GAAG;AAAA,OACL;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
@@ -0,0 +1,8 @@
1
+ const SkeletonDefinition = {
2
+ classNames: {
3
+ root: "bui-Skeleton"
4
+ }
5
+ };
6
+
7
+ export { SkeletonDefinition };
8
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Skeleton/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 Skeleton\n * @public\n */\nexport const SkeletonDefinition = {\n classNames: {\n root: 'bui-Skeleton',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,kBAAA,GAAqB;AAAA,EAChC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA;AAEV;;;;"}
@@ -2,12 +2,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
3
  import { Switch as Switch$1 } from 'react-aria-components';
4
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
5
+ import { SwitchDefinition } from './definition.esm.js';
5
6
  import styles from './Switch.module.css.esm.js';
6
7
  import clsx from 'clsx';
7
8
 
8
9
  const Switch = forwardRef(
9
10
  (props, ref) => {
10
- const { classNames, cleanedProps } = useStyles("Switch", props);
11
+ const { classNames, cleanedProps } = useStyles(SwitchDefinition, props);
11
12
  const { className, label, ...rest } = cleanedProps;
12
13
  return /* @__PURE__ */ jsxs(
13
14
  Switch$1,
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.esm.js","sources":["../../../src/components/Switch/Switch.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 { Switch as AriaSwitch } from 'react-aria-components';\nimport type { SwitchProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Switch.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles('Switch', props);\n const { className, label, ...rest } = cleanedProps;\n\n return (\n <AriaSwitch\n className={clsx(classNames.root, styles[classNames.root], className)}\n ref={ref}\n {...rest}\n >\n <div\n className={clsx(classNames.indicator, styles[classNames.indicator])}\n />\n {label}\n </AriaSwitch>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n"],"names":["AriaSwitch"],"mappings":";;;;;;;AAwBO,MAAM,MAAA,GAAS,UAAA;AAAA,EACpB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAC9D,IAAA,MAAM,EAAE,SAAA,EAAW,KAAA,EAAO,GAAG,MAAK,GAAI,YAAA;AAEtC,IAAA,uBACE,IAAA;AAAA,MAACA,QAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QACnE,GAAA;AAAA,QACC,GAAG,IAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAW,IAAA,CAAK,UAAA,CAAW,WAAW,MAAA,CAAO,UAAA,CAAW,SAAS,CAAC;AAAA;AAAA,WACpE;AAAA,UACC;AAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
1
+ {"version":3,"file":"Switch.esm.js","sources":["../../../src/components/Switch/Switch.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 { Switch as AriaSwitch } from 'react-aria-components';\nimport type { SwitchProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { SwitchDefinition } from './definition';\nimport styles from './Switch.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Switch = forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles(SwitchDefinition, props);\n const { className, label, ...rest } = cleanedProps;\n\n return (\n <AriaSwitch\n className={clsx(classNames.root, styles[classNames.root], className)}\n ref={ref}\n {...rest}\n >\n <div\n className={clsx(classNames.indicator, styles[classNames.indicator])}\n />\n {label}\n </AriaSwitch>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n"],"names":["AriaSwitch"],"mappings":";;;;;;;;AAyBO,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,SAAA,EAAW,KAAA,EAAO,GAAG,MAAK,GAAI,YAAA;AAEtC,IAAA,uBACE,IAAA;AAAA,MAACA,QAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QACnE,GAAA;AAAA,QACC,GAAG,IAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAW,IAAA,CAAK,UAAA,CAAW,WAAW,MAAA,CAAO,UAAA,CAAW,SAAS,CAAC;AAAA;AAAA,WACpE;AAAA,UACC;AAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
@@ -0,0 +1,9 @@
1
+ const SwitchDefinition = {
2
+ classNames: {
3
+ root: "bui-Switch",
4
+ indicator: "bui-SwitchIndicator"
5
+ }
6
+ };
7
+
8
+ export { SwitchDefinition };
9
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Switch/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 Switch\n * @public\n */\nexport const SwitchDefinition = {\n classNames: {\n root: 'bui-Switch',\n indicator: 'bui-SwitchIndicator',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,gBAAA,GAAmB;AAAA,EAC9B,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,YAAA;AAAA,IACN,SAAA,EAAW;AAAA;AAEf;;;;"}
@@ -4,10 +4,11 @@ import { Text } from '../../Text/Text.esm.js';
4
4
  import { Link } from '../../Link/Link.esm.js';
5
5
  import { Cell as Cell$1 } from 'react-aria-components';
6
6
  import { useStyles } from '../../../hooks/useStyles.esm.js';
7
+ import { TableDefinition } from '../definition.esm.js';
7
8
  import styles from '../Table.module.css.esm.js';
8
9
 
9
10
  const Cell = (props) => {
10
- const { classNames, cleanedProps } = useStyles("Table", {
11
+ const { classNames, cleanedProps } = useStyles(TableDefinition, {
11
12
  color: "primary",
12
13
  ...props
13
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.esm.js","sources":["../../../../src/components/Table/components/Cell.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 { Text } from '../../Text';\nimport { Link } from '../../Link';\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport type { CellProps } from '../types';\nimport { useStyles } from '../../../hooks/useStyles';\nimport styles from '../Table.module.css';\n\n/** @public */\nconst Cell = (props: CellProps) => {\n const { classNames, cleanedProps } = useStyles<'Table', CellProps>('Table', {\n color: 'primary',\n ...props,\n });\n const { className, title, description, color, leadingIcon, href, ...rest } =\n cleanedProps;\n\n return (\n <ReactAriaCell\n className={clsx(classNames.cell, styles[classNames.cell], className)}\n {...rest}\n >\n <div\n className={clsx(\n classNames.cellContentWrapper,\n styles[classNames.cellContentWrapper],\n )}\n >\n {leadingIcon && (\n <div\n className={clsx(classNames.cellIcon, styles[classNames.cellIcon])}\n >\n {leadingIcon}\n </div>\n )}\n <div\n className={clsx(\n classNames.cellContent,\n styles[classNames.cellContent],\n )}\n >\n {href ? (\n <Link href={href} variant=\"body-medium\" color={color}>\n {title}\n </Link>\n ) : (\n <Text as=\"p\" variant=\"body-medium\" color={color}>\n {title}\n </Text>\n )}\n {description && (\n <Text variant=\"body-medium\" color=\"secondary\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </ReactA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A,EAAA,KAAA,EACH,CAAA,mBAEA,GAAA,CAAC,QAAK,EAAA,EAAG,GAAA,EAAI,OAAA,EAAQ,aAAA,EAAc,OAChC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,kBAED,+BACC,GAAA,CAAC,IAAA,EAAA,EAAK,SAAQ,aAAA,EAAc,KAAA,EAAM,aAC/B,QAAA,EAAA,WAAA,EACH;AAAA;AAAA;AAAA;AAEJ;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;AAEA,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
1
+ {"version":3,"file":"Cell.esm.js","sources":["../../../../src/components/Table/components/Cell.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 { Text } from '../../Text';\nimport { Link } from '../../Link';\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport type { CellProps } from '../types';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport styles from '../Table.module.css';\n\n/** @public */\nconst Cell = (props: CellProps) => {\n const { classNames, cleanedProps } = useStyles(TableDefinition, {\n color: 'primary' as const,\n ...props,\n });\n const { className, title, description, color, leadingIcon, href, ...rest } =\n cleanedProps;\n\n return (\n <ReactAriaCell\n className={clsx(classNames.cell, styles[classNames.cell], className)}\n {...rest}\n >\n <div\n className={clsx(\n classNames.cellContentWrapper,\n styles[classNames.cellContentWrapper],\n )}\n >\n {leadingIcon && (\n <div\n className={clsx(classNames.cellIcon, styles[classNames.cellIcon])}\n >\n {leadingIcon}\n </div>\n )}\n <div\n className={clsx(\n classNames.cellContent,\n styles[classNames.cellContent],\n )}\n >\n {href ? (\n <Link href={href} variant=\"body-medium\" color={color}>\n {title}\n </Link>\n ) : (\n <Text as=\"p\" variant=\"body-medium\" color={color}>\n {title}\n </Text>\n )}\n {description && (\n <Text variant=\"body-medium\" color=\"secondary\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </ReactAriaCell>\n );\n};\n\nCell.displayName = 'Cell';\n\nexport { Cell };\n"],"names":["ReactAriaCell"],"mappings":";;;;;;;;;AA0BA,MAAM,IAAA,GAAO,CAAC,KAAA,KAAqB;AACjC,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,eAAA,EAAiB;AAAA,IAC9D,KAAA,EAAO,SAAA;AAAA,IACP,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM,EAAE,WAAW,KAAA,EAAO,WAAA,EAAa,OAAO,WAAA,EAAa,IAAA,EAAM,GAAG,IAAA,EAAK,GACvE,YAAA;AAEF,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG,IAAA;AAAA,MAEJ,QAAA,kBAAA,IAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,IAAA;AAAA,YACT,UAAA,CAAW,kBAAA;AAAA,YACX,MAAA,CAAO,WAAW,kBAAkB;AAAA,WACtC;AAAA,UAEC,QAAA,EAAA;AAAA,YAAA,WAAA,oBACC,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,WAAW,IAAA,CAAK,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,QAAQ,CAAC,CAAA;AAAA,gBAE/D,QAAA,EAAA;AAAA;AAAA,aACH;AAAA,4BAEF,IAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,IAAA;AAAA,kBACT,UAAA,CAAW,WAAA;AAAA,kBACX,MAAA,CAAO,WAAW,WAAW;AAAA,iBAC/B;AAAA,gBAEC,QAAA,EAAA;AAAA,kBAAA,IAAA,mBACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAY,OAAA,EAAQ,eAAc,KAAA,EACrC,QAAA,EAAA,KAAA,EACH,CAAA,mBAEA,GAAA,CAAC,QAAK,EAAA,EAAG,GAAA,EAAI,OAAA,EAAQ,aAAA,EAAc,OAChC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,kBAED,+BACC,GAAA,CAAC,IAAA,EAAA,EAAK,SAAQ,aAAA,EAAc,KAAA,EAAM,aAC/B,QAAA,EAAA,WAAA,EACH;AAAA;AAAA;AAAA;AAEJ;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;AAEA,IAAA,CAAK,WAAA,GAAc,MAAA;;;;"}
@@ -4,17 +4,15 @@ import { Text } from '../../Text/Text.esm.js';
4
4
  import { Link } from '../../Link/Link.esm.js';
5
5
  import { Avatar } from '../../Avatar/Avatar.esm.js';
6
6
  import { useStyles } from '../../../hooks/useStyles.esm.js';
7
+ import { TableDefinition } from '../definition.esm.js';
7
8
  import { Cell } from 'react-aria-components';
8
9
  import styles from '../Table.module.css.esm.js';
9
10
 
10
11
  const CellProfile = (props) => {
11
- const { classNames, cleanedProps } = useStyles(
12
- "Table",
13
- {
14
- color: "primary",
15
- ...props
16
- }
17
- );
12
+ const { classNames, cleanedProps } = useStyles(TableDefinition, {
13
+ color: "primary",
14
+ ...props
15
+ });
18
16
  const { className, src, name, href, description, color, ...rest } = cleanedProps;
19
17
  return /* @__PURE__ */ jsx(
20
18
  Cell,
@@ -1 +1 @@
1
- {"version":3,"file":"CellProfile.esm.js","sources":["../../../../src/components/Table/components/CellProfile.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 { CellProfileProps } from '../types';\nimport { Text } from '../../Text/Text';\nimport { Link } from '../../Link/Link';\nimport { Avatar } from '../../Avatar';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport styles from '../Table.module.css';\n\n/** @public */\nexport const CellProfile = (props: CellProfileProps) => {\n const { classNames, cleanedProps } = useStyles<'Table', CellProfileProps>(\n 'Table',\n {\n color: 'primary',\n ...props,\n },\n );\n const { className, src, name, href, description, color, ...rest } =\n cleanedProps;\n\n return (\n <ReactAriaCell\n className={clsx(classNames.cell, styles[classNames.cell], className)}\n {...rest}\n >\n <div\n className={clsx(\n classNames.cellContentWrapper,\n styles[classNames.cellContentWrapper],\n )}\n >\n {src && name && (\n <Avatar src={src} name={name} size=\"x-small\" purpose=\"decoration\" />\n )}\n <div\n className={clsx(\n classNames.cellContent,\n styles[classNames.cellContent],\n )}\n >\n {name && href ? (\n <Link href={href}>{name}</Link>\n ) : (\n <Text as=\"p\" variant=\"body-medium\" color={color}>\n {name}\n </Text>\n )}\n {description && (\n <Text variant=\"body-medium\" color=\"secondary\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </ReactAriaCell>\n );\n};\n"],"names":["ReactAriaCell"],"mappings":";;;;;;;;;AA0BO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA;AAAA,IACnC,OAAA;AAAA,IACA;AAAA,MACE,KAAA,EAAO,SAAA;AAAA,MACP,GAAG;AAAA;AACL,GACF;AACA,EAAA,MAAM,EAAE,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ile.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 { CellProfileProps } from '../types';\nimport { Text } from '../../Text/Text';\nimport { Link } from '../../Link/Link';\nimport { Avatar } from '../../Avatar';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport styles from '../Table.module.css';\n\n/** @public */\nexport const CellProfile = (props: CellProfileProps) => {\n const { classNames, cleanedProps } = useStyles(TableDefinition, {\n color: 'primary' as const,\n ...props,\n });\n const { className, src, name, href, description, color, ...rest } =\n cleanedProps;\n\n return (\n <ReactAriaCell\n className={clsx(classNames.cell, styles[classNames.cell], className)}\n {...rest}\n >\n <div\n className={clsx(\n classNames.cellContentWrapper,\n styles[classNames.cellContentWrapper],\n )}\n >\n {src && name && (\n <Avatar src={src} name={name} size=\"x-small\" purpose=\"decoration\" />\n )}\n <div\n className={clsx(\n classNames.cellContent,\n styles[classNames.cellContent],\n )}\n >\n {name && href ? (\n <Link href={href}>{name}</Link>\n ) : (\n <Text as=\"p\" variant=\"body-medium\" color={color}>\n {name}\n </Text>\n )}\n {description && (\n <Text variant=\"body-medium\" color=\"secondary\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </ReactAriaCell>\n );\n};\n"],"names":["ReactAriaCell"],"mappings":";;;;;;;;;;AA2BO,MAAM,WAAA,GAAc,CAAC,KAAA,KAA4B;AACtD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,eAAA,EAAiB;AAAA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ACF;AAAA,GACF;AAEJ;;;;"}
@@ -1,15 +1,13 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Column as Column$1 } from 'react-aria-components';
3
3
  import { useStyles } from '../../../hooks/useStyles.esm.js';
4
+ import { TableDefinition } from '../definition.esm.js';
4
5
  import styles from '../Table.module.css.esm.js';
5
6
  import clsx from 'clsx';
6
7
  import { RiArrowUpLine, RiArrowDownLine } from '@remixicon/react';
7
8
 
8
9
  const Column = (props) => {
9
- const { classNames, cleanedProps } = useStyles(
10
- "Table",
11
- props
12
- );
10
+ const { classNames, cleanedProps } = useStyles(TableDefinition, props);
13
11
  const { children, ...rest } = cleanedProps;
14
12
  return /* @__PURE__ */ jsx(
15
13
  Column$1,
@@ -1 +1 @@
1
- {"version":3,"file":"Column.esm.js","sources":["../../../../src/components/Table/components/Column.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 { Column as ReactAriaColumn } from 'react-aria-components';\nimport { useStyles } from '../../../hooks/useStyles';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\nimport { ColumnProps } from '../types';\nimport { RiArrowUpLine, RiArrowDownLine } from '@remixicon/react';\n\n/** @public */\nexport const Column = (props: ColumnProps) => {\n const { classNames, cleanedProps } = useStyles<'Table', ColumnProps>(\n 'Table',\n props,\n );\n const { children, ...rest } = cleanedProps;\n\n return (\n <ReactAriaColumn\n className={clsx(classNames.head, styles[classNames.head])}\n {...rest}\n >\n {({ allowsSorting, sortDirection }) => (\n <div\n className={clsx(\n classNames.headContent,\n styles[classNames.headContent],\n )}\n >\n {children}\n {allowsSorting && (\n <span\n aria-hidden=\"true\"\n className={clsx(\n classNames.headSortButton,\n styles[classNames.headSortButton],\n )}\n >\n {sortDirection === 'ascending' ? (\n <RiArrowUpLine size={16} />\n ) : (\n <RiArrowDownLine size={16} />\n )}\n </span>\n )}\n </div>\n )}\n </ReactAriaColumn>\n );\n};\n"],"names":["ReactAriaColumn"],"mappings":";;;;;;;AAwBO,MAAM,MAAA,GAAS,CAAC,KAAA,KAAuB;AAC5C,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA;AAAA,IACnC,OAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,IAAA,EAAK,GAAI,YAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,MACvD,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,CAAC,EAAE,aAAA,EAAe,aAAA,EAAc,qBAC/B,IAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,IAAA;AAAA,YACT,UAAA,CAAW,WAAA;AAAA,YACX,MAAA,CAAO,WAAW,WAAW;AAAA,WAC/B;AAAA,UAEC,QAAA,EAAA;AAAA,YAAA,QAAA;AAAA,YACA,aAAA,oBACC,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAW,IAAA;AAAA,kBACT,UAAA,CAAW,cAAA;AAAA,kBACX,MAAA,CAAO,WAAW,cAAc;AAAA,iBAClC;AAAA,gBAEC,QAAA,EAAA,aAAA,KAAkB,WAAA,mBACjB,GAAA,CAAC,aAAA,EAAA,EAAc,IAAA,EAAM,IAAI,CAAA,mBAEzB,GAAA,CAAC,eAAA,EAAA,EAAgB,IAAA,EAAM,EAAA,EAAI;AAAA;AAAA;AAE/B;AAAA;AAAA;AAEJ;AAAA,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"Column.esm.js","sources":["../../../../src/components/Table/components/Column.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 { Column as ReactAriaColumn } from 'react-aria-components';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\nimport { ColumnProps } from '../types';\nimport { RiArrowUpLine, RiArrowDownLine } from '@remixicon/react';\n\n/** @public */\nexport const Column = (props: ColumnProps) => {\n const { classNames, cleanedProps } = useStyles(TableDefinition, props);\n const { children, ...rest } = cleanedProps;\n\n return (\n <ReactAriaColumn\n className={clsx(classNames.head, styles[classNames.head])}\n {...rest}\n >\n {({ allowsSorting, sortDirection }) => (\n <div\n className={clsx(\n classNames.headContent,\n styles[classNames.headContent],\n )}\n >\n {children}\n {allowsSorting && (\n <span\n aria-hidden=\"true\"\n className={clsx(\n classNames.headSortButton,\n styles[classNames.headSortButton],\n )}\n >\n {sortDirection === 'ascending' ? (\n <RiArrowUpLine size={16} />\n ) : (\n <RiArrowDownLine size={16} />\n )}\n </span>\n )}\n </div>\n )}\n </ReactAriaColumn>\n );\n};\n"],"names":["ReactAriaColumn"],"mappings":";;;;;;;;AAyBO,MAAM,MAAA,GAAS,CAAC,KAAA,KAAuB;AAC5C,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,iBAAiB,KAAK,CAAA;AACrE,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,IAAA,EAAK,GAAI,YAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,MACvD,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,CAAC,EAAE,aAAA,EAAe,aAAA,EAAc,qBAC/B,IAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,IAAA;AAAA,YACT,UAAA,CAAW,WAAA;AAAA,YACX,MAAA,CAAO,WAAW,WAAW;AAAA,WAC/B;AAAA,UAEC,QAAA,EAAA;AAAA,YAAA,QAAA;AAAA,YACA,aAAA,oBACC,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAW,IAAA;AAAA,kBACT,UAAA,CAAW,cAAA;AAAA,kBACX,MAAA,CAAO,WAAW,cAAc;AAAA,iBAClC;AAAA,gBAEC,QAAA,EAAA,aAAA,KAAkB,WAAA,mBACjB,GAAA,CAAC,aAAA,EAAA,EAAc,IAAA,EAAM,IAAI,CAAA,mBAEzB,GAAA,CAAC,eAAA,EAAA,EAAgB,IAAA,EAAM,EAAA,EAAI;AAAA;AAAA;AAE/B;AAAA;AAAA;AAEJ;AAAA,GAEJ;AAEJ;;;;"}
@@ -1,16 +1,14 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useTableOptions, Row as Row$1, RouterProvider, Cell, Checkbox, Collection } from 'react-aria-components';
3
3
  import { useStyles } from '../../../hooks/useStyles.esm.js';
4
+ import { TableDefinition } from '../definition.esm.js';
4
5
  import { useNavigate, useHref } from 'react-router-dom';
5
6
  import { isExternalLink } from '../../../utils/isExternalLink.esm.js';
6
7
  import styles from '../Table.module.css.esm.js';
7
8
  import clsx from 'clsx';
8
9
 
9
10
  function Row(props) {
10
- const { classNames, cleanedProps } = useStyles(
11
- "Table",
12
- props
13
- );
11
+ const { classNames, cleanedProps } = useStyles(TableDefinition, props);
14
12
  const { id, columns, children, href, ...rest } = cleanedProps;
15
13
  const navigate = useNavigate();
16
14
  const isExternal = isExternalLink(href);
@@ -1 +1 @@
1
- {"version":3,"file":"Row.esm.js","sources":["../../../../src/components/Table/components/Row.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 {\n Row as ReactAriaRow,\n RowProps,\n useTableOptions,\n Cell,\n Collection,\n Checkbox,\n RouterProvider,\n} from 'react-aria-components';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { useNavigate } from 'react-router-dom';\nimport { useHref } from 'react-router-dom';\nimport { isExternalLink } from '../../../utils/isExternalLink';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { classNames, cleanedProps } = useStyles<'Table', RowProps<T>>(\n 'Table',\n props,\n );\n const { id, columns, children, href, ...rest } = cleanedProps;\n const navigate = useNavigate();\n const isExternal = isExternalLink(href);\n\n let { selectionBehavior } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && (\n <Cell>\n <Checkbox slot=\"selection\" />\n </Cell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n if (isExternal) {\n return (\n <ReactAriaRow\n id={id}\n href={href}\n className={clsx(classNames.row, styles[classNames.row])}\n {...rest}\n >\n {content}\n </ReactAriaRow>\n );\n }\n\n return (\n <RouterProvider navigate={navigate} useHref={useHref}>\n <ReactAriaRow\n id={id}\n href={href}\n className={clsx(classNames.row, styles[classNames.row])}\n data-react-aria-pressable=\"true\"\n {...rest}\n >\n {content}\n </ReactAriaRow>\n </RouterProvider>\n );\n}\n"],"names":["ReactAriaRow"],"mappings":";;;;;;;;AAiCO,SAAS,IAAsB,KAAA,EAAoB;AACxD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA;AAAA,IACnC,OAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,EAAA,EAAI,OAAA,EAAS,UAAU,IAAA,EAAM,GAAG,MAAK,GAAI,YAAA;AACjD,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,UAAA,GAAa,eAAe,IAAI,CAAA;AAEtC,EAAA,IAAI,EAAE,iBAAA,EAAkB,GAAI,eAAA,EAAgB;AAE5C,EAAA,MAAM,0BACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,iBAAA,KAAsB,4BACrB,GAAA,CAAC,IAAA,EAAA,EACC,8BAAC,QAAA,EAAA,EAAS,IAAA,EAAK,aAAY,CAAA,EAC7B,CAAA;AAAA,oBAEF,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS;AAAA,GAAA,EACxC,CAAA;AAGF,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,uBACE,GAAA;AAAA,MAACA,KAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,IAAA;AAAA,QACA,WAAW,IAAA,CAAK,UAAA,CAAW,KAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAAA,QACrD,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EAClC,QAAA,kBAAA,GAAA;AAAA,IAACA,KAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,IAAA,CAAK,UAAA,CAAW,KAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAAA,MACtD,2BAAA,EAA0B,MAAA;AAAA,MACzB,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Row.esm.js","sources":["../../../../src/components/Table/components/Row.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 {\n Row as ReactAriaRow,\n RowProps,\n useTableOptions,\n Cell,\n Collection,\n Checkbox,\n RouterProvider,\n} from 'react-aria-components';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport { useNavigate } from 'react-router-dom';\nimport { useHref } from 'react-router-dom';\nimport { isExternalLink } from '../../../utils/isExternalLink';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { classNames, cleanedProps } = useStyles(TableDefinition, props);\n const { id, columns, children, href, ...rest } = cleanedProps;\n const navigate = useNavigate();\n const isExternal = isExternalLink(href);\n\n let { selectionBehavior } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && (\n <Cell>\n <Checkbox slot=\"selection\" />\n </Cell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n if (isExternal) {\n return (\n <ReactAriaRow\n id={id}\n href={href}\n className={clsx(classNames.row, styles[classNames.row])}\n {...rest}\n >\n {content}\n </ReactAriaRow>\n );\n }\n\n return (\n <RouterProvider navigate={navigate} useHref={useHref}>\n <ReactAriaRow\n id={id}\n href={href}\n className={clsx(classNames.row, styles[classNames.row])}\n data-react-aria-pressable=\"true\"\n {...rest}\n >\n {content}\n </ReactAriaRow>\n </RouterProvider>\n );\n}\n"],"names":["ReactAriaRow"],"mappings":";;;;;;;;;AAkCO,SAAS,IAAsB,KAAA,EAAoB;AACxD,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,iBAAiB,KAAK,CAAA;AACrE,EAAA,MAAM,EAAE,EAAA,EAAI,OAAA,EAAS,UAAU,IAAA,EAAM,GAAG,MAAK,GAAI,YAAA;AACjD,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,UAAA,GAAa,eAAe,IAAI,CAAA;AAEtC,EAAA,IAAI,EAAE,iBAAA,EAAkB,GAAI,eAAA,EAAgB;AAE5C,EAAA,MAAM,0BACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,iBAAA,KAAsB,4BACrB,GAAA,CAAC,IAAA,EAAA,EACC,8BAAC,QAAA,EAAA,EAAS,IAAA,EAAK,aAAY,CAAA,EAC7B,CAAA;AAAA,oBAEF,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS;AAAA,GAAA,EACxC,CAAA;AAGF,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,uBACE,GAAA;AAAA,MAACA,KAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,IAAA;AAAA,QACA,WAAW,IAAA,CAAK,UAAA,CAAW,KAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAAA,QACrD,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EAClC,QAAA,kBAAA,GAAA;AAAA,IAACA,KAAA;AAAA,IAAA;AAAA,MACC,EAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,IAAA,CAAK,UAAA,CAAW,KAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAC,CAAA;AAAA,MACtD,2BAAA,EAA0B,MAAA;AAAA,MACzB,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;;;;"}
@@ -1,14 +1,12 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useStyles } from '../../../hooks/useStyles.esm.js';
3
+ import { TableDefinition } from '../definition.esm.js';
3
4
  import { Table as Table$1 } from 'react-aria-components';
4
5
  import styles from '../Table.module.css.esm.js';
5
6
  import clsx from 'clsx';
6
7
 
7
8
  const Table = (props) => {
8
- const { classNames, cleanedProps } = useStyles(
9
- "Table",
10
- props
11
- );
9
+ const { classNames, cleanedProps } = useStyles(TableDefinition, props);
12
10
  return /* @__PURE__ */ jsx(
13
11
  Table$1,
14
12
  {
@@ -1 +1 @@
1
- {"version":3,"file":"Table.esm.js","sources":["../../../../src/components/Table/components/Table.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 { useStyles } from '../../../hooks/useStyles';\nimport {\n Table as ReactAriaTable,\n type TableProps,\n} from 'react-aria-components';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Table = (props: TableProps) => {\n const { classNames, cleanedProps } = useStyles<'Table', TableProps>(\n 'Table',\n props,\n );\n\n return (\n <ReactAriaTable\n className={clsx(classNames.table, styles[classNames.table])}\n aria-label=\"Data table\"\n {...cleanedProps}\n />\n );\n};\n"],"names":["ReactAriaTable"],"mappings":";;;;;;AAyBO,MAAM,KAAA,GAAQ,CAAC,KAAA,KAAsB;AAC1C,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA;AAAA,IACnC,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAACA,OAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,MAC1D,YAAA,EAAW,YAAA;AAAA,MACV,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
1
+ {"version":3,"file":"Table.esm.js","sources":["../../../../src/components/Table/components/Table.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 { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport {\n Table as ReactAriaTable,\n type TableProps,\n} from 'react-aria-components';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Table = (props: TableProps) => {\n const { classNames, cleanedProps } = useStyles(TableDefinition, props);\n\n return (\n <ReactAriaTable\n className={clsx(classNames.table, styles[classNames.table])}\n aria-label=\"Data table\"\n {...cleanedProps}\n />\n );\n};\n"],"names":["ReactAriaTable"],"mappings":";;;;;;;AA0BO,MAAM,KAAA,GAAQ,CAAC,KAAA,KAAsB;AAC1C,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,iBAAiB,KAAK,CAAA;AAErE,EAAA,uBACE,GAAA;AAAA,IAACA,OAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,MAC1D,YAAA,EAAW,YAAA;AAAA,MACV,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
@@ -1,14 +1,12 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { TableBody as TableBody$1 } from 'react-aria-components';
3
3
  import { useStyles } from '../../../hooks/useStyles.esm.js';
4
+ import { TableDefinition } from '../definition.esm.js';
4
5
  import styles from '../Table.module.css.esm.js';
5
6
  import clsx from 'clsx';
6
7
 
7
8
  const TableBody = (props) => {
8
- const { classNames, cleanedProps } = useStyles(
9
- "Table",
10
- props
11
- );
9
+ const { classNames, cleanedProps } = useStyles(TableDefinition, props);
12
10
  return /* @__PURE__ */ jsx(
13
11
  TableBody$1,
14
12
  {
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.esm.js","sources":["../../../../src/components/Table/components/TableBody.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 {\n TableBody as ReactAriaTableBody,\n type TableBodyProps,\n} from 'react-aria-components';\nimport { useStyles } from '../../../hooks/useStyles';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const TableBody = <T extends object>(props: TableBodyProps<T>) => {\n const { classNames, cleanedProps } = useStyles<'Table', TableBodyProps<T>>(\n 'Table',\n props,\n );\n\n return (\n <ReactAriaTableBody\n className={clsx(classNames.body, styles[classNames.body])}\n {...cleanedProps}\n />\n );\n};\n"],"names":["ReactAriaTableBody"],"mappings":";;;;;;AAyBO,MAAM,SAAA,GAAY,CAAmB,KAAA,KAA6B;AACvE,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA;AAAA,IACnC,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBACE,GAAA;AAAA,IAACA,WAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
1
+ {"version":3,"file":"TableBody.esm.js","sources":["../../../../src/components/Table/components/TableBody.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 {\n TableBody as ReactAriaTableBody,\n type TableBodyProps,\n} from 'react-aria-components';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const TableBody = <T extends object>(props: TableBodyProps<T>) => {\n const { classNames, cleanedProps } = useStyles(TableDefinition, props);\n\n return (\n <ReactAriaTableBody\n className={clsx(classNames.body, styles[classNames.body])}\n {...cleanedProps}\n />\n );\n};\n"],"names":["ReactAriaTableBody"],"mappings":";;;;;;;AA0BO,MAAM,SAAA,GAAY,CAAmB,KAAA,KAA6B;AACvE,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,iBAAiB,KAAK,CAAA;AAErE,EAAA,uBACE,GAAA;AAAA,IAACA,WAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
@@ -2,15 +2,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useTableOptions, TableHeader as TableHeader$1, Checkbox, Collection } from 'react-aria-components';
3
3
  import { Column } from './Column.esm.js';
4
4
  import { useStyles } from '../../../hooks/useStyles.esm.js';
5
+ import { TableDefinition } from '../definition.esm.js';
5
6
  import styles from '../Table.module.css.esm.js';
6
7
  import clsx from 'clsx';
7
8
 
8
9
  const TableHeader = (props) => {
9
10
  let { selectionBehavior, selectionMode, allowsDragging } = useTableOptions();
10
- const { classNames, cleanedProps } = useStyles(
11
- "Table",
12
- props
13
- );
11
+ const { classNames, cleanedProps } = useStyles(TableDefinition, props);
14
12
  const { columns, children, ...rest } = cleanedProps;
15
13
  return /* @__PURE__ */ jsxs(
16
14
  TableHeader$1,
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeader.esm.js","sources":["../../../../src/components/Table/components/TableHeader.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 {\n TableHeader as ReactAriaTableHeader,\n type TableHeaderProps,\n Checkbox,\n} from 'react-aria-components';\nimport { Collection, useTableOptions } from 'react-aria-components';\nimport { Column } from './Column';\nimport { useStyles } from '../../../hooks/useStyles';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const TableHeader = <T extends object>(props: TableHeaderProps<T>) => {\n let { selectionBehavior, selectionMode, allowsDragging } = useTableOptions();\n\n const { classNames, cleanedProps } = useStyles<'Table', TableHeaderProps<T>>(\n 'Table',\n props,\n );\n const { columns, children, ...rest } = cleanedProps;\n\n return (\n <ReactAriaTableHeader\n className={clsx(classNames.header, styles[classNames.header])}\n {...rest}\n >\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <Column />}\n {selectionBehavior === 'toggle' && (\n <Column>\n {selectionMode === 'multiple' && <Checkbox slot=\"selection\" />}\n </Column>\n )}\n <Collection items={columns}>{children}</Collection>\n </ReactAriaTableHeader>\n );\n};\n"],"names":["ReactAriaTableHeader"],"mappings":";;;;;;;AA4BO,MAAM,WAAA,GAAc,CAAmB,KAAA,KAA+B;AAC3E,EAAA,IAAI,EAAE,iBAAA,EAAmB,aAAA,EAAe,cAAA,KAAmB,eAAA,EAAgB;AAE3E,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA;AAAA,IACnC,OAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,GAAG,MAAK,GAAI,YAAA;AAEvC,EAAA,uBACE,IAAA;AAAA,IAACA,aAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,QAAQ,MAAA,CAAO,UAAA,CAAW,MAAM,CAAC,CAAA;AAAA,MAC3D,GAAG,IAAA;AAAA,MAGH,QAAA,EAAA;AAAA,QAAA,cAAA,wBAAmB,MAAA,EAAA,EAAO,CAAA;AAAA,QAC1B,iBAAA,KAAsB,QAAA,oBACrB,GAAA,CAAC,MAAA,EAAA,EACE,QAAA,EAAA,aAAA,KAAkB,8BAAc,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,WAAA,EAAY,CAAA,EAC9D,CAAA;AAAA,wBAEF,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AAAA,GACxC;AAEJ;;;;"}
1
+ {"version":3,"file":"TableHeader.esm.js","sources":["../../../../src/components/Table/components/TableHeader.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 {\n TableHeader as ReactAriaTableHeader,\n type TableHeaderProps,\n Checkbox,\n} from 'react-aria-components';\nimport { Collection, useTableOptions } from 'react-aria-components';\nimport { Column } from './Column';\nimport { useStyles } from '../../../hooks/useStyles';\nimport { TableDefinition } from '../definition';\nimport styles from '../Table.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const TableHeader = <T extends object>(props: TableHeaderProps<T>) => {\n let { selectionBehavior, selectionMode, allowsDragging } = useTableOptions();\n\n const { classNames, cleanedProps } = useStyles(TableDefinition, props);\n const { columns, children, ...rest } = cleanedProps;\n\n return (\n <ReactAriaTableHeader\n className={clsx(classNames.header, styles[classNames.header])}\n {...rest}\n >\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <Column />}\n {selectionBehavior === 'toggle' && (\n <Column>\n {selectionMode === 'multiple' && <Checkbox slot=\"selection\" />}\n </Column>\n )}\n <Collection items={columns}>{children}</Collection>\n </ReactAriaTableHeader>\n );\n};\n"],"names":["ReactAriaTableHeader"],"mappings":";;;;;;;;AA6BO,MAAM,WAAA,GAAc,CAAmB,KAAA,KAA+B;AAC3E,EAAA,IAAI,EAAE,iBAAA,EAAmB,aAAA,EAAe,cAAA,KAAmB,eAAA,EAAgB;AAE3E,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,iBAAiB,KAAK,CAAA;AACrE,EAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,GAAG,MAAK,GAAI,YAAA;AAEvC,EAAA,uBACE,IAAA;AAAA,IAACA,aAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,QAAQ,MAAA,CAAO,UAAA,CAAW,MAAM,CAAC,CAAA;AAAA,MAC3D,GAAG,IAAA;AAAA,MAGH,QAAA,EAAA;AAAA,QAAA,cAAA,wBAAmB,MAAA,EAAA,EAAO,CAAA;AAAA,QAC1B,iBAAA,KAAsB,QAAA,oBACrB,GAAA,CAAC,MAAA,EAAA,EACE,QAAA,EAAA,aAAA,KAAkB,8BAAc,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAK,WAAA,EAAY,CAAA,EAC9D,CAAA;AAAA,wBAEF,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,OAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AAAA,GACxC;AAEJ;;;;"}
@@ -0,0 +1,24 @@
1
+ const TableDefinition = {
2
+ classNames: {
3
+ table: "bui-Table",
4
+ header: "bui-TableHeader",
5
+ body: "bui-TableBody",
6
+ row: "bui-TableRow",
7
+ head: "bui-TableHead",
8
+ headContent: "bui-TableHeadContent",
9
+ headSortButton: "bui-TableHeadSortButton",
10
+ caption: "bui-TableCaption",
11
+ cell: "bui-TableCell",
12
+ cellContentWrapper: "bui-TableCellContentWrapper",
13
+ cellContent: "bui-TableCellContent",
14
+ cellIcon: "bui-TableCellIcon",
15
+ cellProfileAvatar: "bui-TableCellProfileAvatar",
16
+ cellProfileAvatarImage: "bui-TableCellProfileAvatarImage",
17
+ cellProfileAvatarFallback: "bui-TableCellProfileAvatarFallback",
18
+ cellProfileName: "bui-TableCellProfileName",
19
+ cellProfileLink: "bui-TableCellProfileLink"
20
+ }
21
+ };
22
+
23
+ export { TableDefinition };
24
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/Table/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 Table\n * @public\n */\nexport const TableDefinition = {\n classNames: {\n table: 'bui-Table',\n header: 'bui-TableHeader',\n body: 'bui-TableBody',\n row: 'bui-TableRow',\n head: 'bui-TableHead',\n headContent: 'bui-TableHeadContent',\n headSortButton: 'bui-TableHeadSortButton',\n caption: 'bui-TableCaption',\n cell: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n cellProfileAvatar: 'bui-TableCellProfileAvatar',\n cellProfileAvatarImage: 'bui-TableCellProfileAvatarImage',\n cellProfileAvatarFallback: 'bui-TableCellProfileAvatarFallback',\n cellProfileName: 'bui-TableCellProfileName',\n cellProfileLink: 'bui-TableCellProfileLink',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,eAAA,GAAkB;AAAA,EAC7B,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,WAAA;AAAA,IACP,MAAA,EAAQ,iBAAA;AAAA,IACR,IAAA,EAAM,eAAA;AAAA,IACN,GAAA,EAAK,cAAA;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,WAAA,EAAa,sBAAA;AAAA,IACb,cAAA,EAAgB,yBAAA;AAAA,IAChB,OAAA,EAAS,kBAAA;AAAA,IACT,IAAA,EAAM,eAAA;AAAA,IACN,kBAAA,EAAoB,6BAAA;AAAA,IACpB,WAAA,EAAa,sBAAA;AAAA,IACb,QAAA,EAAU,mBAAA;AAAA,IACV,iBAAA,EAAmB,4BAAA;AAAA,IACnB,sBAAA,EAAwB,iCAAA;AAAA,IACxB,yBAAA,EAA2B,oCAAA;AAAA,IAC3B,eAAA,EAAiB,0BAAA;AAAA,IACjB,eAAA,EAAiB;AAAA;AAErB;;;;"}
@@ -15,7 +15,7 @@ function useTable(config = {}) {
15
15
  showPageSizeOptions = true
16
16
  } = paginationConfig;
17
17
  const isControlled = controlledOffset !== void 0 || controlledPageSize !== void 0;
18
- const rowCount = data?.length ?? providedRowCount ?? 0;
18
+ const rowCount = providedRowCount ?? data?.length ?? 0;
19
19
  const [internalOffset, setInternalOffset] = useState(defaultOffset);
20
20
  const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
21
21
  const currentOffset = controlledOffset ?? internalOffset;
@@ -1 +1 @@
1
- {"version":3,"file":"useTable.esm.js","sources":["../../../../src/components/Table/hooks/useTable.ts"],"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 { useState, useMemo, useCallback } from 'react';\nimport type { TablePaginationProps } from '../../TablePagination/types';\nimport type {\n UseTableConfig,\n UseTableResult,\n UseTablePagination,\n} from './types';\n\n/**\n * Hook for managing table state including pagination and future features like sorting.\n * Supports both controlled and uncontrolled modes using offset/pageSize pattern (Backstage style).\n *\n * @public\n */\nexport function useTable<T = any>(\n config: UseTableConfig<T> = {},\n): UseTableResult<T> {\n const { data, pagination: paginationConfig = {} } = config;\n\n const {\n rowCount: providedRowCount,\n offset: controlledOffset,\n pageSize: controlledPageSize,\n onOffsetChange,\n onPageSizeChange,\n defaultPageSize = 10,\n defaultOffset = 0,\n onNextPage,\n onPreviousPage,\n showPageSizeOptions = true,\n } = paginationConfig;\n\n // Determine if we're in controlled mode\n const isControlled =\n controlledOffset !== undefined || controlledPageSize !== undefined;\n\n // Calculate row count from data or use provided value\n const rowCount = data?.length ?? providedRowCount ?? 0;\n\n // Internal state for uncontrolled mode\n const [internalOffset, setInternalOffset] = useState(defaultOffset);\n const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);\n\n // Calculate current values\n const currentOffset = controlledOffset ?? internalOffset;\n const currentPageSize = controlledPageSize ?? internalPageSize;\n\n // Calculate sliced data if data array is provided\n const currentData = useMemo(() => {\n if (!data) return undefined;\n return data.slice(currentOffset, currentOffset + currentPageSize);\n }, [data, currentOffset, currentPageSize]);\n\n // Update functions\n const setOffset = useCallback(\n (newOffset: number) => {\n if (isControlled) {\n onOffsetChange?.(newOffset);\n } else {\n setInternalOffset(newOffset);\n }\n },\n [isControlled, onOffsetChange],\n );\n\n const setPageSize = useCallback(\n (newPageSize: number) => {\n // When changing page size, reset to first page to avoid showing empty results\n const newOffset = 0;\n\n if (isControlled) {\n onPageSizeChange?.(newPageSize);\n onOffsetChange?.(newOffset);\n } else {\n setInternalPageSize(newPageSize);\n setInternalOffset(newOffset);\n }\n },\n [isControlled, onPageSizeChange, onOffsetChange],\n );\n\n const nextPage = useCallback(() => {\n const nextOffset = currentOffset + currentPageSize;\n if (nextOffset < rowCount) {\n onNextPage?.();\n setOffset(nextOffset);\n }\n }, [currentOffset, currentPageSize, rowCount, onNextPage, setOffset]);\n\n const previousPage = useCallback(() => {\n if (currentOffset > 0) {\n onPreviousPage?.();\n const prevOffset = Math.max(0, currentOffset - currentPageSize);\n setOffset(prevOffset);\n }\n }, [currentOffset, currentPageSize, onPreviousPage, setOffset]);\n\n // Pagination props for TablePagination component\n const paginationProps: TablePaginationProps = useMemo(\n () => ({\n offset: currentOffset,\n pageSize: currentPageSize,\n rowCount,\n setOffset,\n setPageSize,\n onNextPage,\n onPreviousPage,\n showPageSizeOptions,\n }),\n [\n currentOffset,\n currentPageSize,\n rowCount,\n setOffset,\n setPageSize,\n onNextPage,\n onPreviousPage,\n showPageSizeOptions,\n ],\n );\n\n const pagination: UseTablePagination<T> = useMemo(\n () => ({\n paginationProps,\n offset: currentOffset,\n pageSize: currentPageSize,\n data: currentData,\n nextPage,\n previousPage,\n setOffset,\n setPageSize,\n }),\n [\n paginationProps,\n currentOffset,\n currentPageSize,\n currentData,\n nextPage,\n previousPage,\n setOffset,\n setPageSize,\n ],\n );\n\n return {\n data: currentData,\n paginationProps,\n pagination,\n };\n}\n"],"names":[],"mappings":";;AA8BO,SAAS,QAAA,CACd,MAAA,GAA4B,EAAC,EACV;AACnB,EAAA,MAAM,EAAE,IAAA,EAAM,UAAA,EAAY,gBAAA,GAAmB,IAAG,GAAI,MAAA;AAEpD,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,gBAAA;AAAA,IACV,MAAA,EAAQ,gBAAA;AAAA,IACR,QAAA,EAAU,kBAAA;AAAA,IACV,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,eAAA,GAAkB,EAAA;AAAA,IAClB,aAAA,GAAgB,CAAA;AAAA,IAChB,UAAA;AAAA,IACA,cAAA;AAAA,IACA,mBAAA,GAAsB;AAAA,GACxB,GAAI,gBAAA;AAGJ,EAAA,MAAM,YAAA,GACJ,gBAAA,KAAqB,MAAA,IAAa,kBAAA,KAAuB,MAAA;AAG3D,EAAA,MAAM,QAAA,GAAW,IAAA,EAAM,MAAA,IAAU,gBAAA,IAAoB,CAAA;A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;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,WAAA;AAAA,IACN,eAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"useTable.esm.js","sources":["../../../../src/components/Table/hooks/useTable.ts"],"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 { useState, useMemo, useCallback } from 'react';\nimport type { TablePaginationProps } from '../../TablePagination/types';\nimport type {\n UseTableConfig,\n UseTableResult,\n UseTablePagination,\n} from './types';\n\n/**\n * Hook for managing table state including pagination and future features like sorting.\n * Supports both controlled and uncontrolled modes using offset/pageSize pattern (Backstage style).\n *\n * @public\n */\nexport function useTable<T = any>(\n config: UseTableConfig<T> = {},\n): UseTableResult<T> {\n const { data, pagination: paginationConfig = {} } = config;\n\n const {\n rowCount: providedRowCount,\n offset: controlledOffset,\n pageSize: controlledPageSize,\n onOffsetChange,\n onPageSizeChange,\n defaultPageSize = 10,\n defaultOffset = 0,\n onNextPage,\n onPreviousPage,\n showPageSizeOptions = true,\n } = paginationConfig;\n\n // Determine if we're in controlled mode\n const isControlled =\n controlledOffset !== undefined || controlledPageSize !== undefined;\n\n // Use providedRowCount if passed, otherwise fallback to data length\n const rowCount = providedRowCount ?? data?.length ?? 0;\n\n // Internal state for uncontrolled mode\n const [internalOffset, setInternalOffset] = useState(defaultOffset);\n const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);\n\n // Calculate current values\n const currentOffset = controlledOffset ?? internalOffset;\n const currentPageSize = controlledPageSize ?? internalPageSize;\n\n // Calculate sliced data if data array is provided\n const currentData = useMemo(() => {\n if (!data) return undefined;\n return data.slice(currentOffset, currentOffset + currentPageSize);\n }, [data, currentOffset, currentPageSize]);\n\n // Update functions\n const setOffset = useCallback(\n (newOffset: number) => {\n if (isControlled) {\n onOffsetChange?.(newOffset);\n } else {\n setInternalOffset(newOffset);\n }\n },\n [isControlled, onOffsetChange],\n );\n\n const setPageSize = useCallback(\n (newPageSize: number) => {\n // When changing page size, reset to first page to avoid showing empty results\n const newOffset = 0;\n\n if (isControlled) {\n onPageSizeChange?.(newPageSize);\n onOffsetChange?.(newOffset);\n } else {\n setInternalPageSize(newPageSize);\n setInternalOffset(newOffset);\n }\n },\n [isControlled, onPageSizeChange, onOffsetChange],\n );\n\n const nextPage = useCallback(() => {\n const nextOffset = currentOffset + currentPageSize;\n if (nextOffset < rowCount) {\n onNextPage?.();\n setOffset(nextOffset);\n }\n }, [currentOffset, currentPageSize, rowCount, onNextPage, setOffset]);\n\n const previousPage = useCallback(() => {\n if (currentOffset > 0) {\n onPreviousPage?.();\n const prevOffset = Math.max(0, currentOffset - currentPageSize);\n setOffset(prevOffset);\n }\n }, [currentOffset, currentPageSize, onPreviousPage, setOffset]);\n\n // Pagination props for TablePagination component\n const paginationProps: TablePaginationProps = useMemo(\n () => ({\n offset: currentOffset,\n pageSize: currentPageSize,\n rowCount,\n setOffset,\n setPageSize,\n onNextPage,\n onPreviousPage,\n showPageSizeOptions,\n }),\n [\n currentOffset,\n currentPageSize,\n rowCount,\n setOffset,\n setPageSize,\n onNextPage,\n onPreviousPage,\n showPageSizeOptions,\n ],\n );\n\n const pagination: UseTablePagination<T> = useMemo(\n () => ({\n paginationProps,\n offset: currentOffset,\n pageSize: currentPageSize,\n data: currentData,\n nextPage,\n previousPage,\n setOffset,\n setPageSize,\n }),\n [\n paginationProps,\n currentOffset,\n currentPageSize,\n currentData,\n nextPage,\n previousPage,\n setOffset,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,IAC5C,OAAO;AAAA,MACL,MAAA,EAAQ,aAAA;AAAA,MACR,QAAA,EAAU,eAAA;AAAA,MACV,QAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,aAAA;AAAA,MACA,eAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,MAAM,UAAA,GAAoC,OAAA;AAAA,IACxC,OAAO;AAAA,MACL,eAAA;AAAA,MACA,MAAA,EAAQ,aAAA;AAAA,MACR,QAAA,EAAU,eAAA;AAAA,MACV,IAAA,EAAM,WAAA;AAAA,MACN,QAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,eAAA;AAAA,MACA,aAAA;AAAA,MACA,eAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA;AACF,GACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,WAAA;AAAA,IACN,eAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
3
  import { useStyles } from '../../hooks/useStyles.esm.js';
4
+ import { TablePaginationDefinition } from './definition.esm.js';
4
5
  import styles from './TablePagination.module.css.esm.js';
5
6
  import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';
6
7
  import { Select } from '../Select/Select.esm.js';
@@ -8,7 +9,7 @@ import { ButtonIcon } from '../ButtonIcon/ButtonIcon.esm.js';
8
9
  import { Text } from '../Text/Text.esm.js';
9
10
 
10
11
  function TablePagination(props) {
11
- const { classNames, cleanedProps } = useStyles("TablePagination", {
12
+ const { classNames, cleanedProps } = useStyles(TablePaginationDefinition, {
12
13
  showPageSizeOptions: true,
13
14
  ...props
14
15
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TablePagination.esm.js","sources":["../../../src/components/TablePagination/TablePagination.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 clsx from 'clsx';\nimport { Text, ButtonIcon, Select } from '../..';\nimport type { TablePaginationProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './TablePagination.module.css';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { classNames, cleanedProps } = useStyles('TablePagination', {\n showPageSizeOptions: true,\n ...props,\n });\n const {\n className,\n offset,\n pageSize,\n rowCount,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n setOffset,\n setPageSize,\n showPageSizeOptions,\n ...rest\n } = cleanedProps;\n\n const currentOffset = offset ?? 0;\n const currentPageSize = pageSize ?? 10;\n\n const fromCount = currentOffset + 1;\n const toCount = Math.min(currentOffset + currentPageSize, rowCount ?? 0);\n\n const nextPage = () => {\n const totalRows = rowCount ?? 0;\n const nextOffset = currentOffset + currentPageSize;\n\n // Check if there are more items to navigate to\n if (nextOffset < totalRows) {\n onNextPage?.(); // Analytics tracking\n setOffset?.(nextOffset); // Navigate to next page\n }\n };\n\n const previousPage = () => {\n // Check if we can go to previous page\n if (currentOffset > 0) {\n onPreviousPage?.(); // Analytics tracking\n const prevOffset = Math.max(0, currentOffset - currentPageSize);\n setOffset?.(prevOffset); // Navigate to previous page\n }\n };\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n >\n <div className={clsx(classNames.left, styles[classNames.left])}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n placeholder=\"Show 10 results\"\n options={[\n { label: 'Show 5 results', value: '5' },\n { label: 'Show 10 results', value: '10' },\n { label: 'Show 20 results', value: '20' },\n { label: 'Show 30 results', value: '30' },\n { label: 'Show 40 results', value: '40' },\n { label: 'Show 50 results', value: '50' },\n ]}\n selectedKey={pageSize?.toString()}\n onSelectionChange={value => {\n const newPageSize = Number(value);\n setPageSize?.(newPageSize);\n onPageSizeChange?.(newPageSize);\n }}\n className={clsx(classNames.select, styles[classNames.select])}\n />\n )}\n </div>\n <div className={clsx(classNames.right, styles[classNames.right])}>\n <Text\n as=\"p\"\n variant=\"body-medium\"\n >{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={previousPage}\n isDisabled={currentOffset === 0}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous\"\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={nextPage}\n isDisabled={\n rowCount !== undefined &&\n currentOffset + currentPageSize >= rowCount\n }\n icon={<RiArrowRightSLine />}\n aria-label=\"Next\"\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA4BO,SAAS,gBAAgB,KAAA,EAA6B;AAC3D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,iBAAA,EAAmB;AAAA,IAChE,mBAAA,EAAqB,IAAA;AAAA,IACrB,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IAC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AC7C,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,WAAA;AAAA,cACR,IAAA,EAAK,OAAA;AAAA,cACL,OAAA,EAAS,YAAA;AAAA,cACT,YAAY,aAAA,KAAkB,CAAA;AAAA,cAC9B,IAAA,sBAAO,gBAAA,EAAA,EAAiB,CAAA;AAAA,cACxB,YAAA,EAAW;AAAA;AAAA,WACb;AAAA,0BACA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,WAAA;AAAA,cACR,IAAA,EAAK,OAAA;AAAA,cACL,OAAA,EAAS,QAAA;AAAA,cACT,UAAA,EACE,QAAA,KAAa,MAAA,IACb,aAAA,GAAgB,eAAA,IAAmB,QAAA;AAAA,cAErC,IAAA,sBAAO,iBAAA,EAAA,EAAkB,CAAA;AAAA,cACzB,YAAA,EAAW;AAAA;AAAA;AACb,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"TablePagination.esm.js","sources":["../../../src/components/TablePagination/TablePagination.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 clsx from 'clsx';\nimport { Text, ButtonIcon, Select } from '../..';\nimport type { TablePaginationProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { TablePaginationDefinition } from './definition';\nimport styles from './TablePagination.module.css';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { classNames, cleanedProps } = useStyles(TablePaginationDefinition, {\n showPageSizeOptions: true,\n ...props,\n });\n const {\n className,\n offset,\n pageSize,\n rowCount,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n setOffset,\n setPageSize,\n showPageSizeOptions,\n ...rest\n } = cleanedProps;\n\n const currentOffset = offset ?? 0;\n const currentPageSize = pageSize ?? 10;\n\n const fromCount = currentOffset + 1;\n const toCount = Math.min(currentOffset + currentPageSize, rowCount ?? 0);\n\n const nextPage = () => {\n const totalRows = rowCount ?? 0;\n const nextOffset = currentOffset + currentPageSize;\n\n // Check if there are more items to navigate to\n if (nextOffset < totalRows) {\n onNextPage?.(); // Analytics tracking\n setOffset?.(nextOffset); // Navigate to next page\n }\n };\n\n const previousPage = () => {\n // Check if we can go to previous page\n if (currentOffset > 0) {\n onPreviousPage?.(); // Analytics tracking\n const prevOffset = Math.max(0, currentOffset - currentPageSize);\n setOffset?.(prevOffset); // Navigate to previous page\n }\n };\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n >\n <div className={clsx(classNames.left, styles[classNames.left])}>\n {showPageSizeOptions && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n placeholder=\"Show 10 results\"\n options={[\n { label: 'Show 5 results', value: '5' },\n { label: 'Show 10 results', value: '10' },\n { label: 'Show 20 results', value: '20' },\n { label: 'Show 30 results', value: '30' },\n { label: 'Show 40 results', value: '40' },\n { label: 'Show 50 results', value: '50' },\n ]}\n selectedKey={pageSize?.toString()}\n onSelectionChange={value => {\n const newPageSize = Number(value);\n setPageSize?.(newPageSize);\n onPageSizeChange?.(newPageSize);\n }}\n className={clsx(classNames.select, styles[classNames.select])}\n />\n )}\n </div>\n <div className={clsx(classNames.right, styles[classNames.right])}>\n <Text\n as=\"p\"\n variant=\"body-medium\"\n >{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={previousPage}\n isDisabled={currentOffset === 0}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous\"\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={nextPage}\n isDisabled={\n rowCount !== undefined &&\n currentOffset + currentPageSize >= rowCount\n }\n icon={<RiArrowRightSLine />}\n aria-label=\"Next\"\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AA6BO,SAAS,gBAAgB,KAAA,EAA6B;AAC3D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,UAAU,yBAAA,EAA2B;AAAA,IACxE,mBAAA,EAAqB,IAAA;AAAA,IACrB,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,mBAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,YAAA;AAEJ,EAAA,MAAM,gBAAgB,MAAA,IAAU,CAAA;AAChC,EAAA,MAAM,kBAAkB,QAAA,IAAY,EAAA;AAEpC,EAAA,MAAM,YAAY,aAAA,GAAgB,CAAA;AAClC,EAAA,MAAM,UAAU,IAAA,CAAK,GAAA,CAAI,aAAA,GAAgB,eAAA,EAAiB,YAAY,CAAC,CAAA;AAEvE,EAAA,MAAM,WAAW,MAAM;AACrB,IAAA,MAAM,YAAY,QAAA,IAAY,CAAA;AAC9B,IAAA,MAAM,aAAa,aAAA,GAAgB,eAAA;AAGnC,IAAA,IAAI,aAAa,SAAA,EAAW;AAC1B,MAAA,UAAA,IAAa;AACb,MAAA,SAAA,GAAY,UAAU,CAAA;AAAA,IACxB;AAAA,EACF,CAAA;AAEA,EAAA,MAAM,eAAe,MAAM;AAEzB,IAAA,IAAI,gBAAgB,CAAA,EAAG;AACrB,MAAA,cAAA,IAAiB;AACjB,MAA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"bui-TablePaginationLeft",
5
+ right: "bui-TablePaginationRight",
6
+ select: "bui-TablePaginationSelect"
7
+ }
8
+ };
9
+
10
+ export { TablePaginationDefinition };
11
+ //# sourceMappingURL=definition.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.esm.js","sources":["../../../src/components/TablePagination/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 TablePagination\n * @public\n */\nexport const TablePaginationDefinition = {\n classNames: {\n root: 'bui-TablePagination',\n left: 'bui-TablePaginationLeft',\n right: 'bui-TablePaginationRight',\n select: 'bui-TablePaginationSelect',\n },\n} as const satisfies ComponentDefinition;\n"],"names":[],"mappings":"AAsBO,MAAM,yBAAA,GAA4B;AAAA,EACvC,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,qBAAA;AAAA,IACN,IAAA,EAAM,yBAAA;AAAA,IACN,KAAA,EAAO,0BAAA;AAAA,IACP,MAAA,EAAQ;AAAA;AAEZ;;;;"}