@backstage/ui 0.6.0 → 0.7.0-next.0

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 (132) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/css/styles.css +92 -138
  3. package/dist/components/Avatar/Avatar.esm.js +29 -0
  4. package/dist/components/Avatar/Avatar.esm.js.map +1 -0
  5. package/dist/components/Box/Box.esm.js +34 -0
  6. package/dist/components/Box/Box.esm.js.map +1 -0
  7. package/dist/components/Box/Box.props.esm.js +7 -0
  8. package/dist/components/Box/Box.props.esm.js.map +1 -0
  9. package/dist/components/Button/Button.esm.js +41 -0
  10. package/dist/components/Button/Button.esm.js.map +1 -0
  11. package/dist/components/ButtonIcon/ButtonIcon.esm.js +37 -0
  12. package/dist/components/ButtonIcon/ButtonIcon.esm.js.map +1 -0
  13. package/dist/components/ButtonLink/ButtonLink.esm.js +42 -0
  14. package/dist/components/ButtonLink/ButtonLink.esm.js.map +1 -0
  15. package/dist/components/Card/Card.esm.js +53 -0
  16. package/dist/components/Card/Card.esm.js.map +1 -0
  17. package/dist/components/Checkbox/Checkbox.esm.js +74 -0
  18. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -0
  19. package/dist/components/Collapsible/Collapsible.esm.js +50 -0
  20. package/dist/components/Collapsible/Collapsible.esm.js.map +1 -0
  21. package/dist/components/Container/Container.esm.js +35 -0
  22. package/dist/components/Container/Container.esm.js.map +1 -0
  23. package/dist/components/DataTable/DataTable.esm.js +26 -0
  24. package/dist/components/DataTable/DataTable.esm.js.map +1 -0
  25. package/dist/components/DataTable/Pagination/DataTablePagination.esm.js +84 -0
  26. package/dist/components/DataTable/Pagination/DataTablePagination.esm.js.map +1 -0
  27. package/dist/components/DataTable/Root/DataTableRoot.esm.js +24 -0
  28. package/dist/components/DataTable/Root/DataTableRoot.esm.js.map +1 -0
  29. package/dist/components/DataTable/Table/DataTableTable.esm.js +64 -0
  30. package/dist/components/DataTable/Table/DataTableTable.esm.js.map +1 -0
  31. package/dist/components/FieldError/FieldError.esm.js +22 -0
  32. package/dist/components/FieldError/FieldError.esm.js.map +1 -0
  33. package/dist/components/FieldLabel/FieldLabel.esm.js +27 -0
  34. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -0
  35. package/dist/components/Flex/Flex.esm.js +26 -0
  36. package/dist/components/Flex/Flex.esm.js.map +1 -0
  37. package/dist/components/Flex/Flex.props.esm.js +31 -0
  38. package/dist/components/Flex/Flex.props.esm.js.map +1 -0
  39. package/dist/components/Grid/Grid.esm.js +43 -0
  40. package/dist/components/Grid/Grid.esm.js.map +1 -0
  41. package/dist/components/Grid/Grid.props.esm.js +58 -0
  42. package/dist/components/Grid/Grid.props.esm.js.map +1 -0
  43. package/dist/components/Header/Header.esm.js +46 -0
  44. package/dist/components/Header/Header.esm.js.map +1 -0
  45. package/dist/components/Header/HeaderToolbar.esm.js +132 -0
  46. package/dist/components/Header/HeaderToolbar.esm.js.map +1 -0
  47. package/dist/components/HeaderPage/HeaderPage.esm.js +57 -0
  48. package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -0
  49. package/dist/components/Icon/Icon.esm.js +29 -0
  50. package/dist/components/Icon/Icon.esm.js.map +1 -0
  51. package/dist/components/Icon/context.esm.js +10 -0
  52. package/dist/components/Icon/context.esm.js.map +1 -0
  53. package/dist/components/Icon/icons.esm.js +63 -0
  54. package/dist/components/Icon/icons.esm.js.map +1 -0
  55. package/dist/components/Icon/provider.esm.js +12 -0
  56. package/dist/components/Icon/provider.esm.js.map +1 -0
  57. package/dist/components/Link/Link.esm.js +67 -0
  58. package/dist/components/Link/Link.esm.js.map +1 -0
  59. package/dist/components/Menu/Combobox.esm.js +212 -0
  60. package/dist/components/Menu/Combobox.esm.js.map +1 -0
  61. package/dist/components/Menu/Menu.esm.js +224 -0
  62. package/dist/components/Menu/Menu.esm.js.map +1 -0
  63. package/dist/components/RadioGroup/RadioGroup.esm.js +71 -0
  64. package/dist/components/RadioGroup/RadioGroup.esm.js.map +1 -0
  65. package/dist/components/ScrollArea/ScrollArea.esm.js +63 -0
  66. package/dist/components/ScrollArea/ScrollArea.esm.js.map +1 -0
  67. package/dist/components/SearchField/SearchField.esm.js +107 -0
  68. package/dist/components/SearchField/SearchField.esm.js.map +1 -0
  69. package/dist/components/Select/Select.esm.js +89 -0
  70. package/dist/components/Select/Select.esm.js.map +1 -0
  71. package/dist/components/Select/Select.styles.css.esm.js +7 -0
  72. package/dist/components/Select/Select.styles.css.esm.js.map +1 -0
  73. package/dist/components/Skeleton/Skeleton.esm.js +22 -0
  74. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -0
  75. package/dist/components/Switch/Switch.esm.js +18 -0
  76. package/dist/components/Switch/Switch.esm.js.map +1 -0
  77. package/dist/components/Table/Table.esm.js +68 -0
  78. package/dist/components/Table/Table.esm.js.map +1 -0
  79. package/dist/components/Table/TableCell/TableCell.esm.js +13 -0
  80. package/dist/components/Table/TableCell/TableCell.esm.js.map +1 -0
  81. package/dist/components/Table/TableCellLink/TableCellLink.esm.js +28 -0
  82. package/dist/components/Table/TableCellLink/TableCellLink.esm.js.map +1 -0
  83. package/dist/components/Table/TableCellProfile/TableCellProfile.esm.js +40 -0
  84. package/dist/components/Table/TableCellProfile/TableCellProfile.esm.js.map +1 -0
  85. package/dist/components/Table/TableCellText/TableCellText.esm.js +27 -0
  86. package/dist/components/Table/TableCellText/TableCellText.esm.js.map +1 -0
  87. package/dist/components/Tabs/Tabs.esm.js +139 -0
  88. package/dist/components/Tabs/Tabs.esm.js.map +1 -0
  89. package/dist/components/Tabs/TabsIndicators.esm.js +140 -0
  90. package/dist/components/Tabs/TabsIndicators.esm.js.map +1 -0
  91. package/dist/components/Text/Text.esm.js +40 -0
  92. package/dist/components/Text/Text.esm.js.map +1 -0
  93. package/dist/components/TextField/TextField.esm.js +88 -0
  94. package/dist/components/TextField/TextField.esm.js.map +1 -0
  95. package/dist/components/Tooltip/Tooltip.esm.js +34 -0
  96. package/dist/components/Tooltip/Tooltip.esm.js.map +1 -0
  97. package/dist/hooks/useBreakpoint.esm.js +43 -0
  98. package/dist/hooks/useBreakpoint.esm.js.map +1 -0
  99. package/dist/hooks/useIsomorphicLayoutEffect.esm.js +6 -0
  100. package/dist/hooks/useIsomorphicLayoutEffect.esm.js.map +1 -0
  101. package/dist/hooks/useMediaQuery.esm.js +44 -0
  102. package/dist/hooks/useMediaQuery.esm.js.map +1 -0
  103. package/dist/hooks/useStyles.esm.js +46 -0
  104. package/dist/hooks/useStyles.esm.js.map +1 -0
  105. package/dist/index.d.ts +1410 -0
  106. package/dist/index.esm.js +39 -0
  107. package/dist/index.esm.js.map +1 -0
  108. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
  109. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
  110. package/dist/props/display.props.esm.js +12 -0
  111. package/dist/props/display.props.esm.js.map +1 -0
  112. package/dist/props/gap-props.esm.js +15 -0
  113. package/dist/props/gap-props.esm.js.map +1 -0
  114. package/dist/props/height.props.esm.js +23 -0
  115. package/dist/props/height.props.esm.js.map +1 -0
  116. package/dist/props/margin.props.esm.js +54 -0
  117. package/dist/props/margin.props.esm.js.map +1 -0
  118. package/dist/props/padding.props.esm.js +54 -0
  119. package/dist/props/padding.props.esm.js.map +1 -0
  120. package/dist/props/position.props.esm.js +18 -0
  121. package/dist/props/position.props.esm.js.map +1 -0
  122. package/dist/props/prop-def.esm.js +4 -0
  123. package/dist/props/prop-def.esm.js.map +1 -0
  124. package/dist/props/spacing.props.esm.js +28 -0
  125. package/dist/props/spacing.props.esm.js.map +1 -0
  126. package/dist/props/width.props.esm.js +23 -0
  127. package/dist/props/width.props.esm.js.map +1 -0
  128. package/dist/utils/componentDefinitions.esm.js +272 -0
  129. package/dist/utils/componentDefinitions.esm.js.map +1 -0
  130. package/dist/utils/extractProps.esm.js +49 -0
  131. package/dist/utils/extractProps.esm.js.map +1 -0
  132. package/package.json +11 -3
@@ -0,0 +1,74 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { Checkbox as Checkbox$1 } from '@base-ui-components/react/checkbox';
4
+ import '../Icon/context.esm.js';
5
+ import '../Box/Box.esm.js';
6
+ import '../Grid/Grid.esm.js';
7
+ import '../Flex/Flex.esm.js';
8
+ import '../Container/Container.esm.js';
9
+ import '../Avatar/Avatar.esm.js';
10
+ import '../Button/Button.esm.js';
11
+ import '../Card/Card.esm.js';
12
+ import '../Collapsible/Collapsible.esm.js';
13
+ import '../DataTable/DataTable.esm.js';
14
+ import '../FieldLabel/FieldLabel.esm.js';
15
+ import 'react-aria-components';
16
+ import { useStyles } from '../../hooks/useStyles.esm.js';
17
+ import '@remixicon/react';
18
+ import '../ButtonIcon/ButtonIcon.esm.js';
19
+ import '../Menu/Menu.esm.js';
20
+ import '../Text/Text.esm.js';
21
+ import 'motion/react';
22
+ import 'react-router-dom';
23
+ import '../Tabs/Tabs.esm.js';
24
+ import { Icon } from '../Icon/Icon.esm.js';
25
+ import '../ButtonLink/ButtonLink.esm.js';
26
+ import '../RadioGroup/RadioGroup.esm.js';
27
+ import '../Table/Table.esm.js';
28
+ import '../TextField/TextField.esm.js';
29
+ import '../Tooltip/Tooltip.esm.js';
30
+ import '../ScrollArea/ScrollArea.esm.js';
31
+ import '../SearchField/SearchField.esm.js';
32
+ import '../Link/Link.esm.js';
33
+ import '../Select/Select.esm.js';
34
+ import '../Switch/Switch.esm.js';
35
+ import clsx from 'clsx';
36
+
37
+ const Checkbox = forwardRef(
38
+ (props, ref) => {
39
+ const {
40
+ label,
41
+ checked,
42
+ onChange,
43
+ disabled,
44
+ required,
45
+ className,
46
+ name,
47
+ value,
48
+ style
49
+ } = props;
50
+ const { classNames } = useStyles("Checkbox");
51
+ const checkboxElement = /* @__PURE__ */ jsx(
52
+ Checkbox$1.Root,
53
+ {
54
+ ref,
55
+ className: clsx(classNames.root, className),
56
+ checked,
57
+ onCheckedChange: onChange,
58
+ disabled,
59
+ required,
60
+ name,
61
+ value,
62
+ style,
63
+ children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, { className: classNames.indicator, children: /* @__PURE__ */ jsx(Icon, { name: "check", size: 12 }) })
64
+ }
65
+ );
66
+ return label ? /* @__PURE__ */ jsxs("label", { className: classNames.label, children: [
67
+ checkboxElement,
68
+ label
69
+ ] }) : checkboxElement;
70
+ }
71
+ );
72
+
73
+ export { Checkbox };
74
+ //# sourceMappingURL=Checkbox.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui-components/react/checkbox';\nimport { Icon } from '../..';\nimport type { CheckboxProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport clsx from 'clsx';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => {\n const {\n label,\n checked,\n onChange,\n disabled,\n required,\n className,\n name,\n value,\n style,\n } = props;\n\n const { classNames } = useStyles('Checkbox');\n\n const checkboxElement = (\n <CheckboxPrimitive.Root\n ref={ref}\n className={clsx(classNames.root, className)}\n checked={checked}\n onCheckedChange={onChange}\n disabled={disabled}\n required={required}\n name={name}\n value={value}\n style={style}\n >\n <CheckboxPrimitive.Indicator className={classNames.indicator}>\n <Icon name=\"check\" size={12} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n return label ? (\n <label className={classNames.label}>\n {checkboxElement}\n {label}\n </label>\n ) : (\n checkboxElement\n );\n },\n);\n"],"names":["CheckboxPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,QAAW,GAAA,UAAA;AAAA,EACtB,CAAC,OAAO,GAAQ,KAAA;AACd,IAAM,MAAA;AAAA,MACJ,KAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA;AAAA,KACE,GAAA,KAAA;AAEJ,IAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,UAAU,CAAA;AAE3C,IAAA,MAAM,eACJ,mBAAA,GAAA;AAAA,MAACA,UAAkB,CAAA,IAAA;AAAA,MAAlB;AAAA,QACC,GAAA;AAAA,QACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,QAC1C,OAAA;AAAA,QACA,eAAiB,EAAA,QAAA;AAAA,QACjB,QAAA;AAAA,QACA,QAAA;AAAA,QACA,IAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,QAEA,QAAC,kBAAA,GAAA,CAAAA,UAAA,CAAkB,SAAlB,EAAA,EAA4B,SAAW,EAAA,UAAA,CAAW,SACjD,EAAA,QAAA,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAK,OAAQ,EAAA,IAAA,EAAM,IAAI,CAC/B,EAAA;AAAA;AAAA,KACF;AAGF,IAAA,OAAO,KACL,mBAAA,IAAA,CAAC,OAAM,EAAA,EAAA,SAAA,EAAW,WAAW,KAC1B,EAAA,QAAA,EAAA;AAAA,MAAA,eAAA;AAAA,MACA;AAAA,KAAA,EACH,CAEA,GAAA,eAAA;AAAA;AAGN;;;;"}
@@ -0,0 +1,50 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { Collapsible as Collapsible$1 } from '@base-ui-components/react/collapsible';
4
+ import clsx from 'clsx';
5
+ import { useStyles } from '../../hooks/useStyles.esm.js';
6
+
7
+ const CollapsibleRoot = forwardRef(({ className, ...props }, ref) => {
8
+ const { classNames } = useStyles("Collapsible");
9
+ return /* @__PURE__ */ jsx(
10
+ Collapsible$1.Root,
11
+ {
12
+ ref,
13
+ className: clsx(classNames.root, className),
14
+ ...props
15
+ }
16
+ );
17
+ });
18
+ CollapsibleRoot.displayName = Collapsible$1.Root.displayName;
19
+ const CollapsibleTrigger = forwardRef(({ className, ...props }, ref) => {
20
+ const { classNames } = useStyles("Collapsible");
21
+ return /* @__PURE__ */ jsx(
22
+ Collapsible$1.Trigger,
23
+ {
24
+ ref,
25
+ className: clsx(classNames.trigger, className),
26
+ ...props
27
+ }
28
+ );
29
+ });
30
+ CollapsibleTrigger.displayName = Collapsible$1.Trigger.displayName;
31
+ const CollapsiblePanel = forwardRef(({ className, ...props }, ref) => {
32
+ const { classNames } = useStyles("Collapsible");
33
+ return /* @__PURE__ */ jsx(
34
+ Collapsible$1.Panel,
35
+ {
36
+ ref,
37
+ className: clsx(classNames.panel, className),
38
+ ...props
39
+ }
40
+ );
41
+ });
42
+ CollapsiblePanel.displayName = Collapsible$1.Panel.displayName;
43
+ const Collapsible = {
44
+ Root: CollapsibleRoot,
45
+ Trigger: CollapsibleTrigger,
46
+ Panel: CollapsiblePanel
47
+ };
48
+
49
+ export { Collapsible };
50
+ //# sourceMappingURL=Collapsible.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collapsible.esm.js","sources":["../../../src/components/Collapsible/Collapsible.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 { Collapsible as CollapsiblePrimitive } from '@base-ui-components/react/collapsible';\nimport clsx from 'clsx';\nimport { useStyles } from '../../hooks/useStyles';\n\nconst CollapsibleRoot = forwardRef<\n React.ElementRef<typeof CollapsiblePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { classNames } = useStyles('Collapsible');\n\n return (\n <CollapsiblePrimitive.Root\n ref={ref}\n className={clsx(classNames.root, className)}\n {...props}\n />\n );\n});\nCollapsibleRoot.displayName = CollapsiblePrimitive.Root.displayName;\n\nconst CollapsibleTrigger = forwardRef<\n React.ElementRef<typeof CollapsiblePrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>\n>(({ className, ...props }, ref) => {\n const { classNames } = useStyles('Collapsible');\n\n return (\n <CollapsiblePrimitive.Trigger\n ref={ref}\n className={clsx(classNames.trigger, className)}\n {...props}\n />\n );\n});\nCollapsibleTrigger.displayName = CollapsiblePrimitive.Trigger.displayName;\n\nconst CollapsiblePanel = forwardRef<\n React.ElementRef<typeof CollapsiblePrimitive.Panel>,\n React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Panel>\n>(({ className, ...props }, ref) => {\n const { classNames } = useStyles('Collapsible');\n\n return (\n <CollapsiblePrimitive.Panel\n ref={ref}\n className={clsx(classNames.panel, className)}\n {...props}\n />\n );\n});\nCollapsiblePanel.displayName = CollapsiblePrimitive.Panel.displayName;\n\n/**\n * Collapsible is a component that allows you to collapse and expand content.\n * It is a wrapper around the CollapsiblePrimitive component from base-ui-components.\n *\n * @public\n */\nexport const Collapsible = {\n Root: CollapsibleRoot,\n Trigger: CollapsibleTrigger,\n Panel: CollapsiblePanel,\n};\n"],"names":["CollapsiblePrimitive"],"mappings":";;;;;;AAqBA,MAAM,eAAA,GAAkB,WAGtB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAQ,KAAA;AAClC,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,aAAa,CAAA;AAE9C,EACE,uBAAA,GAAA;AAAA,IAACA,aAAqB,CAAA,IAAA;AAAA,IAArB;AAAA,MACC,GAAA;AAAA,MACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,MACzC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC,CAAA;AACD,eAAgB,CAAA,WAAA,GAAcA,cAAqB,IAAK,CAAA,WAAA;AAExD,MAAM,kBAAA,GAAqB,WAGzB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAQ,KAAA;AAClC,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,aAAa,CAAA;AAE9C,EACE,uBAAA,GAAA;AAAA,IAACA,aAAqB,CAAA,OAAA;AAAA,IAArB;AAAA,MACC,GAAA;AAAA,MACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,OAAA,EAAS,SAAS,CAAA;AAAA,MAC5C,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC,CAAA;AACD,kBAAmB,CAAA,WAAA,GAAcA,cAAqB,OAAQ,CAAA,WAAA;AAE9D,MAAM,gBAAA,GAAmB,WAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAQ,KAAA;AAClC,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,aAAa,CAAA;AAE9C,EACE,uBAAA,GAAA;AAAA,IAACA,aAAqB,CAAA,KAAA;AAAA,IAArB;AAAA,MACC,GAAA;AAAA,MACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,KAAA,EAAO,SAAS,CAAA;AAAA,MAC1C,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC,CAAA;AACD,gBAAiB,CAAA,WAAA,GAAcA,cAAqB,KAAM,CAAA,WAAA;AAQnD,MAAM,WAAc,GAAA;AAAA,EACzB,IAAM,EAAA,eAAA;AAAA,EACN,OAAS,EAAA,kBAAA;AAAA,EACT,KAAO,EAAA;AACT;;;;"}
@@ -0,0 +1,35 @@
1
+ import { forwardRef, createElement } from 'react';
2
+ import clsx from 'clsx';
3
+ import { displayPropDefs } from '../../props/display.props.esm.js';
4
+ import { extractProps } from '../../utils/extractProps.esm.js';
5
+ import { spacingPropDefs } from '../../props/spacing.props.esm.js';
6
+ import { useStyles } from '../../hooks/useStyles.esm.js';
7
+
8
+ const Container = forwardRef(
9
+ (props, ref) => {
10
+ const { children } = props;
11
+ const { classNames } = useStyles("Container");
12
+ const containerSpacingProps = {
13
+ my: spacingPropDefs.my,
14
+ mt: spacingPropDefs.mt,
15
+ mb: spacingPropDefs.mb,
16
+ py: spacingPropDefs.py,
17
+ pt: spacingPropDefs.pt,
18
+ pb: spacingPropDefs.pb
19
+ };
20
+ const propDefs = {
21
+ ...displayPropDefs,
22
+ ...containerSpacingProps
23
+ };
24
+ const { className, style } = extractProps(props, propDefs);
25
+ return createElement("div", {
26
+ ref,
27
+ className: clsx(classNames.root, className),
28
+ style,
29
+ children
30
+ });
31
+ }
32
+ );
33
+
34
+ export { Container };
35
+ //# sourceMappingURL=Container.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.esm.js","sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createElement, forwardRef } from 'react';\nimport { ContainerProps } from './types';\nimport clsx from 'clsx';\nimport { displayPropDefs } from '../../props/display.props';\nimport { extractProps } from '../../utils/extractProps';\nimport { spacingPropDefs } from '../../props/spacing.props';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (props, ref) => {\n const { children } = props;\n\n const { classNames } = useStyles('Container');\n\n // Create a subset of spacing props that match the interface\n const containerSpacingProps = {\n my: spacingPropDefs.my,\n mt: spacingPropDefs.mt,\n mb: spacingPropDefs.mb,\n py: spacingPropDefs.py,\n pt: spacingPropDefs.pt,\n pb: spacingPropDefs.pb,\n };\n\n const propDefs = {\n ...displayPropDefs,\n ...containerSpacingProps,\n };\n const { className, style } = extractProps(props, propDefs);\n\n return createElement('div', {\n ref,\n className: clsx(classNames.root, className),\n style,\n children,\n });\n },\n);\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,SAAY,GAAA,UAAA;AAAA,EACvB,CAAC,OAAO,GAAQ,KAAA;AACd,IAAM,MAAA,EAAE,UAAa,GAAA,KAAA;AAErB,IAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,WAAW,CAAA;AAG5C,IAAA,MAAM,qBAAwB,GAAA;AAAA,MAC5B,IAAI,eAAgB,CAAA,EAAA;AAAA,MACpB,IAAI,eAAgB,CAAA,EAAA;AAAA,MACpB,IAAI,eAAgB,CAAA,EAAA;AAAA,MACpB,IAAI,eAAgB,CAAA,EAAA;AAAA,MACpB,IAAI,eAAgB,CAAA,EAAA;AAAA,MACpB,IAAI,eAAgB,CAAA;AAAA,KACtB;AAEA,IAAA,MAAM,QAAW,GAAA;AAAA,MACf,GAAG,eAAA;AAAA,MACH,GAAG;AAAA,KACL;AACA,IAAA,MAAM,EAAE,SAAW,EAAA,KAAA,EAAU,GAAA,YAAA,CAAa,OAAO,QAAQ,CAAA;AAEzD,IAAA,OAAO,cAAc,KAAO,EAAA;AAAA,MAC1B,GAAA;AAAA,MACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,MAC1C,KAAA;AAAA,MACA;AAAA,KACD,CAAA;AAAA;AAEL;;;;"}
@@ -0,0 +1,26 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { Table } from '../Table/Table.esm.js';
4
+ import { DataTableRoot } from './Root/DataTableRoot.esm.js';
5
+ import { DataTablePagination } from './Pagination/DataTablePagination.esm.js';
6
+ import { DataTableTable } from './Table/DataTableTable.esm.js';
7
+
8
+ const TableRoot = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Table.Root, { ref, ...props }));
9
+ TableRoot.displayName = Table.Root.displayName;
10
+ const DataTable = {
11
+ Root: DataTableRoot,
12
+ Pagination: DataTablePagination,
13
+ Table: DataTableTable,
14
+ TableRoot,
15
+ TableHeader: Table.Header,
16
+ TableBody: Table.Body,
17
+ TableRow: Table.Row,
18
+ TableCell: Table.Cell,
19
+ TableCellText: Table.CellText,
20
+ TableCellLink: Table.CellLink,
21
+ TableCellProfile: Table.CellProfile,
22
+ TableHead: Table.Head
23
+ };
24
+
25
+ export { DataTable };
26
+ //# sourceMappingURL=DataTable.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.esm.js","sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Table } from '../Table';\nimport { DataTableRoot } from './Root/DataTableRoot';\nimport { DataTablePagination } from './Pagination/DataTablePagination';\nimport { Table as TanstackTable } from '@tanstack/react-table';\nimport { DataTableTable } from './Table/DataTableTable';\n\nconst TableRoot = forwardRef<\n React.ElementRef<typeof Table.Root>,\n React.ComponentPropsWithoutRef<typeof Table.Root>\n>(({ className, ...props }, ref) => <Table.Root ref={ref} {...props} />);\nTableRoot.displayName = Table.Root.displayName;\n\n/**\n * DataTable component for displaying tabular data with pagination\n * @public\n */\nexport const DataTable = {\n Root: DataTableRoot as <TData>(\n props: {\n table: TanstackTable<TData>;\n } & React.HTMLAttributes<HTMLDivElement>,\n ) => JSX.Element,\n Pagination: DataTablePagination,\n Table: DataTableTable,\n TableRoot: TableRoot,\n TableHeader: Table.Header,\n TableBody: Table.Body,\n TableRow: Table.Row,\n TableCell: Table.Cell,\n TableCellText: Table.CellText,\n TableCellLink: Table.CellLink,\n TableCellProfile: Table.CellProfile,\n TableHead: Table.Head,\n};\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,YAAY,UAGhB,CAAA,CAAC,EAAE,SAAA,EAAW,GAAG,KAAM,EAAA,EAAG,GAAQ,qBAAA,GAAA,CAAC,MAAM,IAAN,EAAA,EAAW,GAAW,EAAA,GAAG,OAAO,CAAE,CAAA;AACvE,SAAU,CAAA,WAAA,GAAc,MAAM,IAAK,CAAA,WAAA;AAM5B,MAAM,SAAY,GAAA;AAAA,EACvB,IAAM,EAAA,aAAA;AAAA,EAKN,UAAY,EAAA,mBAAA;AAAA,EACZ,KAAO,EAAA,cAAA;AAAA,EACP,SAAA;AAAA,EACA,aAAa,KAAM,CAAA,MAAA;AAAA,EACnB,WAAW,KAAM,CAAA,IAAA;AAAA,EACjB,UAAU,KAAM,CAAA,GAAA;AAAA,EAChB,WAAW,KAAM,CAAA,IAAA;AAAA,EACjB,eAAe,KAAM,CAAA,QAAA;AAAA,EACrB,eAAe,KAAM,CAAA,QAAA;AAAA,EACrB,kBAAkB,KAAM,CAAA,WAAA;AAAA,EACxB,WAAW,KAAM,CAAA;AACnB;;;;"}
@@ -0,0 +1,84 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { Text } from '../../Text/Text.esm.js';
4
+ import { ButtonIcon } from '../../ButtonIcon/ButtonIcon.esm.js';
5
+ import clsx from 'clsx';
6
+ import { Select } from '../../Select/Select.esm.js';
7
+ import { useDataTable } from '../Root/DataTableRoot.esm.js';
8
+ import '@remixicon/react';
9
+ import { Icon } from '../../Icon/Icon.esm.js';
10
+ import '../../Icon/context.esm.js';
11
+
12
+ const DataTablePagination = forwardRef(
13
+ (props, ref) => {
14
+ const { className, ...rest } = props;
15
+ const { table } = useDataTable();
16
+ const pageIndex = table?.getState().pagination.pageIndex;
17
+ const pageSize = table?.getState().pagination.pageSize;
18
+ const rowCount = table?.getRowCount();
19
+ const fromCount = (pageIndex ?? 0) * (pageSize ?? 10) + 1;
20
+ const toCount = Math.min(
21
+ ((pageIndex ?? 0) + 1) * (pageSize ?? 10),
22
+ rowCount
23
+ );
24
+ return /* @__PURE__ */ jsxs(
25
+ "div",
26
+ {
27
+ ref,
28
+ style: { minWidth: table?.getTotalSize() },
29
+ className: clsx("bui-DataTablePagination", className),
30
+ ...rest,
31
+ children: [
32
+ /* @__PURE__ */ jsx("div", { className: "bui-DataTablePagination--left", children: !table.options.manualPagination && /* @__PURE__ */ jsx(
33
+ Select,
34
+ {
35
+ name: "pageSize",
36
+ size: "small",
37
+ placeholder: "Show 10 results",
38
+ options: [
39
+ { label: "Show 5 results", value: "5" },
40
+ { label: "Show 10 results", value: "10" },
41
+ { label: "Show 20 results", value: "20" },
42
+ { label: "Show 30 results", value: "30" },
43
+ { label: "Show 40 results", value: "40" },
44
+ { label: "Show 50 results", value: "50" }
45
+ ],
46
+ selectedKey: pageSize?.toString(),
47
+ onSelectionChange: (value) => {
48
+ table?.setPageSize(Number(value));
49
+ },
50
+ className: "bui-DataTablePagination--select"
51
+ }
52
+ ) }),
53
+ /* @__PURE__ */ jsxs("div", { className: "bui-DataTablePagination--right", children: [
54
+ /* @__PURE__ */ jsx(Text, { variant: "body-medium", children: `${fromCount} - ${toCount} of ${rowCount}` }),
55
+ /* @__PURE__ */ jsx(
56
+ ButtonIcon,
57
+ {
58
+ variant: "secondary",
59
+ size: "small",
60
+ onClick: () => table?.previousPage(),
61
+ isDisabled: !table?.getCanPreviousPage(),
62
+ icon: /* @__PURE__ */ jsx(Icon, { name: "chevron-left" })
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsx(
66
+ ButtonIcon,
67
+ {
68
+ variant: "secondary",
69
+ size: "small",
70
+ onClick: () => table?.nextPage(),
71
+ isDisabled: !table?.getCanNextPage(),
72
+ icon: /* @__PURE__ */ jsx(Icon, { name: "chevron-right" })
73
+ }
74
+ )
75
+ ] })
76
+ ]
77
+ }
78
+ );
79
+ }
80
+ );
81
+ DataTablePagination.displayName = "DataTablePagination";
82
+
83
+ export { DataTablePagination };
84
+ //# sourceMappingURL=DataTablePagination.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTablePagination.esm.js","sources":["../../../../src/components/DataTable/Pagination/DataTablePagination.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Text } from '../../Text';\nimport { DataTablePaginationProps } from './types';\nimport { ButtonIcon } from '../../ButtonIcon';\nimport clsx from 'clsx';\nimport { Select } from '../../Select';\nimport { useDataTable } from '../Root/DataTableRoot';\nimport { Icon } from '../../Icon';\n\n/** @public */\nconst DataTablePagination = forwardRef(\n (\n props: DataTablePaginationProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n ) => {\n const { className, ...rest } = props;\n const { table } = useDataTable();\n const pageIndex = table?.getState().pagination.pageIndex;\n const pageSize = table?.getState().pagination.pageSize;\n const rowCount = table?.getRowCount();\n const fromCount = (pageIndex ?? 0) * (pageSize ?? 10) + 1;\n const toCount = Math.min(\n ((pageIndex ?? 0) + 1) * (pageSize ?? 10),\n rowCount,\n );\n\n return (\n <div\n ref={ref}\n style={{ minWidth: table?.getTotalSize() }}\n className={clsx('bui-DataTablePagination', className)}\n {...rest}\n >\n <div className=\"bui-DataTablePagination--left\">\n {!table.options.manualPagination && (\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 table?.setPageSize(Number(value));\n }}\n className=\"bui-DataTablePagination--select\"\n />\n )}\n </div>\n <div className=\"bui-DataTablePagination--right\">\n <Text variant=\"body-medium\">{`${fromCount} - ${toCount} of ${rowCount}`}</Text>\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={() => table?.previousPage()}\n isDisabled={!table?.getCanPreviousPage()}\n icon={<Icon name=\"chevron-left\" />}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={() => table?.nextPage()}\n isDisabled={!table?.getCanNextPage()}\n icon={<Icon name=\"chevron-right\" />}\n />\n </div>\n </div>\n );\n },\n);\n\nDataTablePagination.displayName = 'DataTablePagination';\n\nexport { DataTablePagination };\n"],"names":[],"mappings":";;;;;;;;;;;AA0BA,MAAM,mBAAsB,GAAA,UAAA;AAAA,EAC1B,CACE,OACA,GACG,KAAA;AACH,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAS,GAAA,KAAA;AAC/B,IAAM,MAAA,EAAE,KAAM,EAAA,GAAI,YAAa,EAAA;AAC/B,IAAA,MAAM,SAAY,GAAA,KAAA,EAAO,QAAS,EAAA,CAAE,UAAW,CAAA,SAAA;AAC/C,IAAA,MAAM,QAAW,GAAA,KAAA,EAAO,QAAS,EAAA,CAAE,UAAW,CAAA,QAAA;AAC9C,IAAM,MAAA,QAAA,GAAW,OAAO,WAAY,EAAA;AACpC,IAAA,MAAM,SAAa,GAAA,CAAA,SAAA,IAAa,CAAM,KAAA,QAAA,IAAY,EAAM,CAAA,GAAA,CAAA;AACxD,IAAA,MAAM,UAAU,IAAK,CAAA,GAAA;AAAA,MACjB,CAAA,CAAA,SAAA,IAAa,CAAK,IAAA,CAAA,KAAM,QAAY,IAAA,EAAA,CAAA;AAAA,MACtC;AAAA,KACF;AAEA,IACE,uBAAA,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,KAAO,EAAA,EAAE,QAAU,EAAA,KAAA,EAAO,cAAe,EAAA;AAAA,QACzC,SAAA,EAAW,IAAK,CAAA,yBAAA,EAA2B,SAAS,CAAA;AAAA,QACnD,GAAG,IAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,SAAI,SAAU,EAAA,+BAAA,EACZ,QAAC,EAAA,CAAA,KAAA,CAAM,QAAQ,gBACd,oBAAA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,IAAK,EAAA,UAAA;AAAA,cACL,IAAK,EAAA,OAAA;AAAA,cACL,WAAY,EAAA,iBAAA;AAAA,cACZ,OAAS,EAAA;AAAA,gBACP,EAAE,KAAA,EAAO,gBAAkB,EAAA,KAAA,EAAO,GAAI,EAAA;AAAA,gBACtC,EAAE,KAAA,EAAO,iBAAmB,EAAA,KAAA,EAAO,IAAK,EAAA;AAAA,gBACxC,EAAE,KAAA,EAAO,iBAAmB,EAAA,KAAA,EAAO,IAAK,EAAA;AAAA,gBACxC,EAAE,KAAA,EAAO,iBAAmB,EAAA,KAAA,EAAO,IAAK,EAAA;AAAA,gBACxC,EAAE,KAAA,EAAO,iBAAmB,EAAA,KAAA,EAAO,IAAK,EAAA;AAAA,gBACxC,EAAE,KAAA,EAAO,iBAAmB,EAAA,KAAA,EAAO,IAAK;AAAA,eAC1C;AAAA,cACA,WAAA,EAAa,UAAU,QAAS,EAAA;AAAA,cAChC,mBAAmB,CAAS,KAAA,KAAA;AAC1B,gBAAO,KAAA,EAAA,WAAA,CAAY,MAAO,CAAA,KAAK,CAAC,CAAA;AAAA,eAClC;AAAA,cACA,SAAU,EAAA;AAAA;AAAA,WAGhB,EAAA,CAAA;AAAA,0BACA,IAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAU,gCACb,EAAA,QAAA,EAAA;AAAA,4BAAC,GAAA,CAAA,IAAA,EAAA,EAAK,SAAQ,aAAe,EAAA,QAAA,EAAA,CAAA,EAAG,SAAS,CAAM,GAAA,EAAA,OAAO,CAAO,IAAA,EAAA,QAAQ,CAAG,CAAA,EAAA,CAAA;AAAA,4BACxE,GAAA;AAAA,cAAC,UAAA;AAAA,cAAA;AAAA,gBACC,OAAQ,EAAA,WAAA;AAAA,gBACR,IAAK,EAAA,OAAA;AAAA,gBACL,OAAA,EAAS,MAAM,KAAA,EAAO,YAAa,EAAA;AAAA,gBACnC,UAAA,EAAY,CAAC,KAAA,EAAO,kBAAmB,EAAA;AAAA,gBACvC,IAAM,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAK,cAAe,EAAA;AAAA;AAAA,aAClC;AAAA,4BACA,GAAA;AAAA,cAAC,UAAA;AAAA,cAAA;AAAA,gBACC,OAAQ,EAAA,WAAA;AAAA,gBACR,IAAK,EAAA,OAAA;AAAA,gBACL,OAAA,EAAS,MAAM,KAAA,EAAO,QAAS,EAAA;AAAA,gBAC/B,UAAA,EAAY,CAAC,KAAA,EAAO,cAAe,EAAA;AAAA,gBACnC,IAAM,kBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAK,eAAgB,EAAA;AAAA;AAAA;AACnC,WACF,EAAA;AAAA;AAAA;AAAA,KACF;AAAA;AAGN;AAEA,mBAAA,CAAoB,WAAc,GAAA,qBAAA;;;;"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { createContext, forwardRef, useContext } from 'react';
3
+ import clsx from 'clsx';
4
+
5
+ const DataTableContext = createContext(
6
+ null
7
+ );
8
+ const DataTableRoot = forwardRef(
9
+ (props, ref) => {
10
+ const { className, table, ...rest } = props;
11
+ return /* @__PURE__ */ jsx(DataTableContext.Provider, { value: { table }, children: /* @__PURE__ */ jsx("div", { ref, className: clsx("bui-DataTable", className), ...rest }) });
12
+ }
13
+ );
14
+ DataTableRoot.displayName = "DataTableRoot";
15
+ function useDataTable() {
16
+ const context = useContext(DataTableContext);
17
+ if (!context) {
18
+ throw new Error("useDataTable must be used within a DataTableRoot");
19
+ }
20
+ return context;
21
+ }
22
+
23
+ export { DataTableContext, DataTableRoot, useDataTable };
24
+ //# sourceMappingURL=DataTableRoot.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTableRoot.esm.js","sources":["../../../../src/components/DataTable/Root/DataTableRoot.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, createContext, useContext } from 'react';\nimport clsx from 'clsx';\nimport { DataTableRootProps } from './types';\nimport { Table } from '@tanstack/react-table';\n\ntype DataTableContextType<TData> = {\n table: Table<TData>;\n};\n\n/** @public */\nexport const DataTableContext = createContext<DataTableContextType<any> | null>(\n null,\n);\n\n/** @public */\nconst DataTableRoot = forwardRef(\n <TData,>(\n props: DataTableRootProps<TData>,\n ref: React.ForwardedRef<HTMLDivElement>,\n ) => {\n const { className, table, ...rest } = props;\n\n return (\n <DataTableContext.Provider value={{ table }}>\n <div ref={ref} className={clsx('bui-DataTable', className)} {...rest} />\n </DataTableContext.Provider>\n );\n },\n);\n\nDataTableRoot.displayName = 'DataTableRoot';\n\nexport { DataTableRoot };\n\n/** @public */\nexport function useDataTable<TData>() {\n const context = useContext(DataTableContext);\n if (!context) {\n throw new Error('useDataTable must be used within a DataTableRoot');\n }\n return context as DataTableContextType<TData>;\n}\n"],"names":[],"mappings":";;;;AA0BO,MAAM,gBAAmB,GAAA,aAAA;AAAA,EAC9B;AACF;AAGA,MAAM,aAAgB,GAAA,UAAA;AAAA,EACpB,CACE,OACA,GACG,KAAA;AACH,IAAA,MAAM,EAAE,SAAA,EAAW,KAAO,EAAA,GAAG,MAAS,GAAA,KAAA;AAEtC,IAAA,2BACG,gBAAiB,CAAA,QAAA,EAAjB,EAA0B,KAAO,EAAA,EAAE,OAClC,EAAA,QAAA,kBAAA,GAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAU,WAAW,IAAK,CAAA,eAAA,EAAiB,SAAS,CAAI,EAAA,GAAG,MAAM,CACxE,EAAA,CAAA;AAAA;AAGN;AAEA,aAAA,CAAc,WAAc,GAAA,eAAA;AAKrB,SAAS,YAAsB,GAAA;AACpC,EAAM,MAAA,OAAA,GAAU,WAAW,gBAAgB,CAAA;AAC3C,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,kDAAkD,CAAA;AAAA;AAEpE,EAAO,OAAA,OAAA;AACT;;;;"}
@@ -0,0 +1,64 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import clsx from 'clsx';
4
+ import { Table } from '../../Table/Table.esm.js';
5
+ import { useDataTable } from '../Root/DataTableRoot.esm.js';
6
+ import { flexRender } from '@tanstack/react-table';
7
+
8
+ const DataTableTable = forwardRef(
9
+ (props, ref) => {
10
+ const { className, ...rest } = props;
11
+ const { table } = useDataTable();
12
+ return /* @__PURE__ */ jsxs(
13
+ Table.Root,
14
+ {
15
+ ref,
16
+ style: { minWidth: table.getTotalSize() },
17
+ className: clsx(className),
18
+ ...rest,
19
+ children: [
20
+ /* @__PURE__ */ jsx(Table.Header, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(Table.Row, { children: headerGroup.headers.map((header) => {
21
+ return /* @__PURE__ */ jsx(
22
+ Table.Head,
23
+ {
24
+ style: { width: header.getSize() },
25
+ children: header.isPlaceholder ? null : flexRender(
26
+ header.column.columnDef.header,
27
+ header.getContext()
28
+ )
29
+ },
30
+ header.id
31
+ );
32
+ }) }, headerGroup.id)) }),
33
+ /* @__PURE__ */ jsx(Table.Body, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
34
+ Table.Row,
35
+ {
36
+ "data-state": row.getIsSelected() && "selected",
37
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(
38
+ Table.Cell,
39
+ {
40
+ style: { width: cell.column.getSize() },
41
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
42
+ },
43
+ cell.id
44
+ ))
45
+ },
46
+ row.id
47
+ )) : /* @__PURE__ */ jsx(Table.Row, { children: /* @__PURE__ */ jsx(
48
+ Table.Cell,
49
+ {
50
+ colSpan: table.getAllColumns().length,
51
+ className: "h-24 text-center",
52
+ style: { width: table.getTotalSize() },
53
+ children: "No results."
54
+ }
55
+ ) }) })
56
+ ]
57
+ }
58
+ );
59
+ }
60
+ );
61
+ DataTableTable.displayName = "DataTableRoot";
62
+
63
+ export { DataTableTable };
64
+ //# sourceMappingURL=DataTableTable.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTableTable.esm.js","sources":["../../../../src/components/DataTable/Table/DataTableTable.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport clsx from 'clsx';\nimport { DataTableTableProps } from './types';\nimport { Table } from '../../Table';\nimport { useDataTable } from '../Root/DataTableRoot';\nimport { flexRender } from '@tanstack/react-table';\n\n/** @public */\nconst DataTableTable = forwardRef(\n (props: DataTableTableProps, ref: React.ForwardedRef<HTMLTableElement>) => {\n const { className, ...rest } = props;\n const { table } = useDataTable();\n\n return (\n <Table.Root\n ref={ref}\n style={{ minWidth: table.getTotalSize() }}\n className={clsx(className)}\n {...rest}\n >\n <Table.Header>\n {table.getHeaderGroups().map(headerGroup => (\n <Table.Row key={headerGroup.id}>\n {headerGroup.headers.map(header => {\n return (\n <Table.Head\n key={header.id}\n style={{ width: header.getSize() }}\n >\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext(),\n )}\n </Table.Head>\n );\n })}\n </Table.Row>\n ))}\n </Table.Header>\n <Table.Body>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map(row => (\n <Table.Row\n key={row.id}\n data-state={row.getIsSelected() && 'selected'}\n >\n {row.getVisibleCells().map(cell => (\n <Table.Cell\n key={cell.id}\n style={{ width: cell.column.getSize() }}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </Table.Cell>\n ))}\n </Table.Row>\n ))\n ) : (\n <Table.Row>\n <Table.Cell\n colSpan={table.getAllColumns().length}\n className=\"h-24 text-center\"\n style={{ width: table.getTotalSize() }}\n >\n No results.\n </Table.Cell>\n </Table.Row>\n )}\n </Table.Body>\n </Table.Root>\n );\n },\n);\n\nDataTableTable.displayName = 'DataTableRoot';\n\nexport { DataTableTable };\n"],"names":[],"mappings":";;;;;;;AAwBA,MAAM,cAAiB,GAAA,UAAA;AAAA,EACrB,CAAC,OAA4B,GAA8C,KAAA;AACzE,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAS,GAAA,KAAA;AAC/B,IAAM,MAAA,EAAE,KAAM,EAAA,GAAI,YAAa,EAAA;AAE/B,IACE,uBAAA,IAAA;AAAA,MAAC,KAAM,CAAA,IAAA;AAAA,MAAN;AAAA,QACC,GAAA;AAAA,QACA,KAAO,EAAA,EAAE,QAAU,EAAA,KAAA,CAAM,cAAe,EAAA;AAAA,QACxC,SAAA,EAAW,KAAK,SAAS,CAAA;AAAA,QACxB,GAAG,IAAA;AAAA,QAEJ,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,KAAM,CAAA,MAAA,EAAN,EACE,QAAA,EAAA,KAAA,CAAM,iBAAkB,CAAA,GAAA,CAAI,CAC3B,WAAA,qBAAA,GAAA,CAAC,MAAM,GAAN,EAAA,EACE,QAAY,EAAA,WAAA,CAAA,OAAA,CAAQ,IAAI,CAAU,MAAA,KAAA;AACjC,YACE,uBAAA,GAAA;AAAA,cAAC,KAAM,CAAA,IAAA;AAAA,cAAN;AAAA,gBAEC,KAAO,EAAA,EAAE,KAAO,EAAA,MAAA,CAAO,SAAU,EAAA;AAAA,gBAEhC,QAAA,EAAA,MAAA,CAAO,gBACJ,IACA,GAAA,UAAA;AAAA,kBACE,MAAA,CAAO,OAAO,SAAU,CAAA,MAAA;AAAA,kBACxB,OAAO,UAAW;AAAA;AACpB,eAAA;AAAA,cARC,MAAO,CAAA;AAAA,aASd;AAAA,WAEH,CAAA,EAAA,EAfa,WAAY,CAAA,EAgB5B,CACD,CACH,EAAA,CAAA;AAAA,0BACC,GAAA,CAAA,KAAA,CAAM,IAAN,EAAA,EACE,gBAAM,WAAY,EAAA,CAAE,IAAM,EAAA,MAAA,GACzB,KAAM,CAAA,WAAA,EAAc,CAAA,IAAA,CAAK,IAAI,CAC3B,GAAA,qBAAA,GAAA;AAAA,YAAC,KAAM,CAAA,GAAA;AAAA,YAAN;AAAA,cAEC,YAAA,EAAY,GAAI,CAAA,aAAA,EAAmB,IAAA,UAAA;AAAA,cAElC,QAAI,EAAA,GAAA,CAAA,eAAA,EAAkB,CAAA,GAAA,CAAI,CACzB,IAAA,qBAAA,GAAA;AAAA,gBAAC,KAAM,CAAA,IAAA;AAAA,gBAAN;AAAA,kBAEC,OAAO,EAAE,KAAA,EAAO,IAAK,CAAA,MAAA,CAAO,SAAU,EAAA;AAAA,kBAErC,qBAAW,IAAK,CAAA,MAAA,CAAO,UAAU,IAAM,EAAA,IAAA,CAAK,YAAY;AAAA,iBAAA;AAAA,gBAHpD,IAAK,CAAA;AAAA,eAKb;AAAA,aAAA;AAAA,YAVI,GAAI,CAAA;AAAA,WAYZ,CAAA,mBAEA,GAAA,CAAA,KAAA,CAAM,KAAN,EACC,QAAA,kBAAA,GAAA;AAAA,YAAC,KAAM,CAAA,IAAA;AAAA,YAAN;AAAA,cACC,OAAA,EAAS,KAAM,CAAA,aAAA,EAAgB,CAAA,MAAA;AAAA,cAC/B,SAAU,EAAA,kBAAA;AAAA,cACV,KAAO,EAAA,EAAE,KAAO,EAAA,KAAA,CAAM,cAAe,EAAA;AAAA,cACtC,QAAA,EAAA;AAAA;AAAA,aAGH,CAEJ,EAAA;AAAA;AAAA;AAAA,KACF;AAAA;AAGN;AAEA,cAAA,CAAe,WAAc,GAAA,eAAA;;;;"}
@@ -0,0 +1,22 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { FieldError as FieldError$1 } from 'react-aria-components';
4
+ import clsx from 'clsx';
5
+
6
+ const FieldError = forwardRef(
7
+ (props, ref) => {
8
+ const { className, ...rest } = props;
9
+ return /* @__PURE__ */ jsx(
10
+ FieldError$1,
11
+ {
12
+ className: clsx("bui-FieldError", className),
13
+ ref,
14
+ ...rest
15
+ }
16
+ );
17
+ }
18
+ );
19
+ FieldError.displayName = "FieldError";
20
+
21
+ export { FieldError };
22
+ //# sourceMappingURL=FieldError.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldError.esm.js","sources":["../../../src/components/FieldError/FieldError.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport {\n FieldError as AriaFieldError,\n type FieldErrorProps,\n} from 'react-aria-components';\nimport clsx from 'clsx';\n\n/** @public */\nexport const FieldError = forwardRef<HTMLDivElement, FieldErrorProps>(\n (props: FieldErrorProps, ref) => {\n const { className, ...rest } = props;\n\n return (\n <AriaFieldError\n className={clsx('bui-FieldError', className)}\n ref={ref}\n {...rest}\n />\n );\n },\n);\n\nFieldError.displayName = 'FieldError';\n"],"names":["AriaFieldError"],"mappings":";;;;;AAwBO,MAAM,UAAa,GAAA,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAQ,KAAA;AAC/B,IAAA,MAAM,EAAE,SAAA,EAAW,GAAG,IAAA,EAAS,GAAA,KAAA;AAE/B,IACE,uBAAA,GAAA;AAAA,MAACA,YAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAK,CAAA,gBAAA,EAAkB,SAAS,CAAA;AAAA,QAC3C,GAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA;AAGN;AAEA,UAAA,CAAW,WAAc,GAAA,YAAA;;;;"}
@@ -0,0 +1,27 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Label } from 'react-aria-components';
3
+ import { forwardRef } from 'react';
4
+ import { useStyles } from '../../hooks/useStyles.esm.js';
5
+
6
+ const FieldLabel = forwardRef(
7
+ (props, ref) => {
8
+ const { label, secondaryLabel, description, htmlFor, id, ...rest } = props;
9
+ const { classNames } = useStyles("FieldLabel");
10
+ if (!label) return null;
11
+ return /* @__PURE__ */ jsxs("div", { className: classNames.root, ...rest, ref, children: [
12
+ label && /* @__PURE__ */ jsxs(Label, { className: classNames.label, htmlFor, id, children: [
13
+ label,
14
+ secondaryLabel && /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: classNames.secondaryLabel, children: [
15
+ "(",
16
+ secondaryLabel,
17
+ ")"
18
+ ] })
19
+ ] }),
20
+ description && /* @__PURE__ */ jsx("div", { className: classNames.description, children: description })
21
+ ] });
22
+ }
23
+ );
24
+ FieldLabel.displayName = "FieldLabel";
25
+
26
+ export { FieldLabel };
27
+ //# sourceMappingURL=FieldLabel.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldLabel.esm.js","sources":["../../../src/components/FieldLabel/FieldLabel.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 */\nimport { Label } from 'react-aria-components';\nimport { forwardRef } from 'react';\nimport type { FieldLabelProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const FieldLabel = forwardRef<HTMLDivElement, FieldLabelProps>(\n (props: FieldLabelProps, ref) => {\n const { label, secondaryLabel, description, htmlFor, id, ...rest } = props;\n\n const { classNames } = useStyles('FieldLabel');\n\n if (!label) return null;\n\n return (\n <div className={classNames.root} {...rest} ref={ref}>\n {label && (\n <Label className={classNames.label} htmlFor={htmlFor} id={id}>\n {label}\n {secondaryLabel && (\n <span aria-hidden=\"true\" className={classNames.secondaryLabel}>\n ({secondaryLabel})\n </span>\n )}\n </Label>\n )}\n {description && (\n <div className={classNames.description}>{description}</div>\n )}\n </div>\n );\n },\n);\n\nFieldLabel.displayName = 'FieldLabel';\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,UAAa,GAAA,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAQ,KAAA;AAC/B,IAAM,MAAA,EAAE,OAAO,cAAgB,EAAA,WAAA,EAAa,SAAS,EAAI,EAAA,GAAG,MAAS,GAAA,KAAA;AAErE,IAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,YAAY,CAAA;AAE7C,IAAI,IAAA,CAAC,OAAc,OAAA,IAAA;AAEnB,IAAA,4BACG,KAAI,EAAA,EAAA,SAAA,EAAW,WAAW,IAAO,EAAA,GAAG,MAAM,GACxC,EAAA,QAAA,EAAA;AAAA,MAAA,KAAA,yBACE,KAAM,EAAA,EAAA,SAAA,EAAW,UAAW,CAAA,KAAA,EAAO,SAAkB,EACnD,EAAA,QAAA,EAAA;AAAA,QAAA,KAAA;AAAA,QACA,kCACE,IAAA,CAAA,MAAA,EAAA,EAAK,eAAY,MAAO,EAAA,SAAA,EAAW,WAAW,cAAgB,EAAA,QAAA,EAAA;AAAA,UAAA,GAAA;AAAA,UAC3D,cAAA;AAAA,UAAe;AAAA,SACnB,EAAA;AAAA,OAEJ,EAAA,CAAA;AAAA,MAED,+BACE,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,UAAA,CAAW,aAAc,QAAY,EAAA,WAAA,EAAA;AAAA,KAEzD,EAAA,CAAA;AAAA;AAGN;AAEA,UAAA,CAAW,WAAc,GAAA,YAAA;;;;"}
@@ -0,0 +1,26 @@
1
+ import { forwardRef, createElement } from 'react';
2
+ import clsx from 'clsx';
3
+ import { flexPropDefs } from './Flex.props.esm.js';
4
+ import { extractProps } from '../../utils/extractProps.esm.js';
5
+ import { gapPropDefs } from '../../props/gap-props.esm.js';
6
+ import { spacingPropDefs } from '../../props/spacing.props.esm.js';
7
+ import { useStyles } from '../../hooks/useStyles.esm.js';
8
+
9
+ const Flex = forwardRef((props, ref) => {
10
+ const propDefs = {
11
+ ...gapPropDefs,
12
+ ...flexPropDefs,
13
+ ...spacingPropDefs
14
+ };
15
+ const { classNames } = useStyles("Flex");
16
+ const { className, style } = extractProps(props, propDefs);
17
+ return createElement("div", {
18
+ ref,
19
+ className: clsx(classNames.root, className),
20
+ style,
21
+ children: props.children
22
+ });
23
+ });
24
+
25
+ export { Flex };
26
+ //# sourceMappingURL=Flex.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.esm.js","sources":["../../../src/components/Flex/Flex.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createElement, forwardRef } from 'react';\nimport { FlexProps } from './types';\nimport clsx from 'clsx';\nimport { flexPropDefs } from './Flex.props';\nimport { extractProps } from '../../utils/extractProps';\nimport { gapPropDefs } from '../../props/gap-props';\nimport { spacingPropDefs } from '../../props/spacing.props';\nimport { useStyles } from '../../hooks/useStyles';\n\n/** @public */\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>((props, ref) => {\n const propDefs = {\n ...gapPropDefs,\n ...flexPropDefs,\n ...spacingPropDefs,\n };\n\n const { classNames } = useStyles('Flex');\n const { className, style } = extractProps(props, propDefs);\n\n return createElement('div', {\n ref,\n className: clsx(classNames.root, className),\n style,\n children: props.children,\n });\n});\n"],"names":[],"mappings":";;;;;;;;AA0BO,MAAM,IAAO,GAAA,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAQ,KAAA;AACxE,EAAA,MAAM,QAAW,GAAA;AAAA,IACf,GAAG,WAAA;AAAA,IACH,GAAG,YAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,MAAM,CAAA;AACvC,EAAA,MAAM,EAAE,SAAW,EAAA,KAAA,EAAU,GAAA,YAAA,CAAa,OAAO,QAAQ,CAAA;AAEzD,EAAA,OAAO,cAAc,KAAO,EAAA;AAAA,IAC1B,GAAA;AAAA,IACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,IAC1C,KAAA;AAAA,IACA,UAAU,KAAM,CAAA;AAAA,GACjB,CAAA;AACH,CAAC;;;;"}
@@ -0,0 +1,31 @@
1
+ const alignValues = ["start", "center", "end", "baseline", "stretch"];
2
+ const directionValues = [
3
+ "row",
4
+ "column",
5
+ "row-reverse",
6
+ "column-reverse"
7
+ ];
8
+ const justifyValues = ["start", "center", "end", "between"];
9
+ const flexPropDefs = {
10
+ align: {
11
+ type: "enum",
12
+ className: "bui-align",
13
+ values: alignValues,
14
+ responsive: true
15
+ },
16
+ direction: {
17
+ type: "enum",
18
+ className: "bui-fd",
19
+ values: directionValues,
20
+ responsive: true
21
+ },
22
+ justify: {
23
+ type: "enum",
24
+ className: "bui-jc",
25
+ values: justifyValues,
26
+ responsive: true
27
+ }
28
+ };
29
+
30
+ export { flexPropDefs };
31
+ //# sourceMappingURL=Flex.props.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.props.esm.js","sources":["../../../src/components/Flex/Flex.props.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 type { PropDef, GetPropDefTypes } from '../../props/prop-def';\n\nconst alignValues = ['start', 'center', 'end', 'baseline', 'stretch'] as const;\nconst directionValues = [\n 'row',\n 'column',\n 'row-reverse',\n 'column-reverse',\n] as const;\nconst justifyValues = ['start', 'center', 'end', 'between'] as const;\n\n/** @public */\nconst flexPropDefs = {\n align: {\n type: 'enum',\n className: 'bui-align',\n values: alignValues,\n responsive: true,\n },\n direction: {\n type: 'enum',\n className: 'bui-fd',\n values: directionValues,\n responsive: true,\n },\n justify: {\n type: 'enum',\n className: 'bui-jc',\n values: justifyValues,\n responsive: true,\n },\n} satisfies {\n align: PropDef<(typeof alignValues)[number]>;\n direction: PropDef<(typeof directionValues)[number]>;\n justify: PropDef<(typeof justifyValues)[number]>;\n};\n\n/** @public */\ntype FlexOwnProps = GetPropDefTypes<typeof flexPropDefs>;\n\nexport { flexPropDefs };\nexport type { FlexOwnProps };\n"],"names":[],"mappings":"AAkBA,MAAM,cAAc,CAAC,OAAA,EAAS,QAAU,EAAA,KAAA,EAAO,YAAY,SAAS,CAAA;AACpE,MAAM,eAAkB,GAAA;AAAA,EACtB,KAAA;AAAA,EACA,QAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA;AACA,MAAM,aAAgB,GAAA,CAAC,OAAS,EAAA,QAAA,EAAU,OAAO,SAAS,CAAA;AAG1D,MAAM,YAAe,GAAA;AAAA,EACnB,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,SAAW,EAAA,WAAA;AAAA,IACX,MAAQ,EAAA,WAAA;AAAA,IACR,UAAY,EAAA;AAAA,GACd;AAAA,EACA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,IACN,SAAW,EAAA,QAAA;AAAA,IACX,MAAQ,EAAA,eAAA;AAAA,IACR,UAAY,EAAA;AAAA,GACd;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,MAAA;AAAA,IACN,SAAW,EAAA,QAAA;AAAA,IACX,MAAQ,EAAA,aAAA;AAAA,IACR,UAAY,EAAA;AAAA;AAEhB;;;;"}
@@ -0,0 +1,43 @@
1
+ import { forwardRef, createElement } from 'react';
2
+ import { gapPropDefs } from '../../props/gap-props.esm.js';
3
+ import { extractProps } from '../../utils/extractProps.esm.js';
4
+ import { gridPropDefs, gridItemPropDefs } from './Grid.props.esm.js';
5
+ import clsx from 'clsx';
6
+ import { spacingPropDefs } from '../../props/spacing.props.esm.js';
7
+ import { useStyles } from '../../hooks/useStyles.esm.js';
8
+
9
+ const GridRoot = forwardRef((props, ref) => {
10
+ const propDefs = {
11
+ ...gapPropDefs,
12
+ ...gridPropDefs,
13
+ ...spacingPropDefs
14
+ };
15
+ const { classNames } = useStyles("Grid");
16
+ const { className, style } = extractProps(props, propDefs);
17
+ return createElement("div", {
18
+ ref,
19
+ className: clsx(classNames.root, className),
20
+ style,
21
+ children: props.children
22
+ });
23
+ });
24
+ const GridItem = forwardRef((props, ref) => {
25
+ const propDefs = {
26
+ ...gridItemPropDefs
27
+ };
28
+ const { classNames } = useStyles("Grid");
29
+ const { className, style } = extractProps(props, propDefs);
30
+ return createElement("div", {
31
+ ref,
32
+ className: clsx(classNames.item, className),
33
+ style,
34
+ children: props.children
35
+ });
36
+ });
37
+ const Grid = {
38
+ Root: GridRoot,
39
+ Item: GridItem
40
+ };
41
+
42
+ export { Grid };
43
+ //# sourceMappingURL=Grid.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.esm.js","sources":["../../../src/components/Grid/Grid.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createElement, forwardRef } from 'react';\nimport { gapPropDefs } from '../../props/gap-props';\nimport { extractProps } from '../../utils/extractProps';\nimport { gridItemPropDefs, gridPropDefs } from './Grid.props';\nimport clsx from 'clsx';\nimport type { GridItemProps, GridProps } from './types';\nimport { spacingPropDefs } from '../../props/spacing.props';\nimport { useStyles } from '../../hooks/useStyles';\n\nconst GridRoot = forwardRef<HTMLDivElement, GridProps>((props, ref) => {\n const propDefs = {\n ...gapPropDefs,\n ...gridPropDefs,\n ...spacingPropDefs,\n };\n\n const { classNames } = useStyles('Grid');\n\n const { className, style } = extractProps(props, propDefs);\n\n return createElement('div', {\n ref,\n className: clsx(classNames.root, className),\n style,\n children: props.children,\n });\n});\n\nconst GridItem = forwardRef<HTMLDivElement, GridItemProps>((props, ref) => {\n const propDefs = {\n ...gridItemPropDefs,\n };\n\n const { classNames } = useStyles('Grid');\n const { className, style } = extractProps(props, propDefs);\n\n return createElement('div', {\n ref,\n className: clsx(classNames.item, className),\n style,\n children: props.children,\n });\n});\n\n/** @public */\nexport const Grid = {\n Root: GridRoot,\n Item: GridItem,\n};\n"],"names":[],"mappings":";;;;;;;;AAyBA,MAAM,QAAW,GAAA,UAAA,CAAsC,CAAC,KAAA,EAAO,GAAQ,KAAA;AACrE,EAAA,MAAM,QAAW,GAAA;AAAA,IACf,GAAG,WAAA;AAAA,IACH,GAAG,YAAA;AAAA,IACH,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,MAAM,CAAA;AAEvC,EAAA,MAAM,EAAE,SAAW,EAAA,KAAA,EAAU,GAAA,YAAA,CAAa,OAAO,QAAQ,CAAA;AAEzD,EAAA,OAAO,cAAc,KAAO,EAAA;AAAA,IAC1B,GAAA;AAAA,IACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,IAC1C,KAAA;AAAA,IACA,UAAU,KAAM,CAAA;AAAA,GACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,QAAW,GAAA,UAAA,CAA0C,CAAC,KAAA,EAAO,GAAQ,KAAA;AACzE,EAAA,MAAM,QAAW,GAAA;AAAA,IACf,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,EAAE,UAAA,EAAe,GAAA,SAAA,CAAU,MAAM,CAAA;AACvC,EAAA,MAAM,EAAE,SAAW,EAAA,KAAA,EAAU,GAAA,YAAA,CAAa,OAAO,QAAQ,CAAA;AAEzD,EAAA,OAAO,cAAc,KAAO,EAAA;AAAA,IAC1B,GAAA;AAAA,IACA,SAAW,EAAA,IAAA,CAAK,UAAW,CAAA,IAAA,EAAM,SAAS,CAAA;AAAA,IAC1C,KAAA;AAAA,IACA,UAAU,KAAM,CAAA;AAAA,GACjB,CAAA;AACH,CAAC,CAAA;AAGM,MAAM,IAAO,GAAA;AAAA,EAClB,IAAM,EAAA,QAAA;AAAA,EACN,IAAM,EAAA;AACR;;;;"}