@backstage/ui 0.8.2 → 0.9.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +120 -7
  2. package/css/styles.css +8 -0
  3. package/dist/components/Avatar/Avatar.esm.js +39 -23
  4. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  5. package/dist/components/Avatar/Avatar.module.css.esm.js +1 -1
  6. package/dist/components/Checkbox/Checkbox.esm.js +16 -18
  7. package/dist/components/Checkbox/Checkbox.esm.js.map +1 -1
  8. package/dist/components/Checkbox/Checkbox.module.css.esm.js +2 -2
  9. package/dist/components/FieldLabel/FieldLabel.esm.js +10 -2
  10. package/dist/components/FieldLabel/FieldLabel.esm.js.map +1 -1
  11. package/dist/components/Header/Header.esm.js +11 -2
  12. package/dist/components/Header/Header.esm.js.map +1 -1
  13. package/dist/components/Header/HeaderToolbar.esm.js +9 -7
  14. package/dist/components/Header/HeaderToolbar.esm.js.map +1 -1
  15. package/dist/components/HeaderPage/HeaderPage.esm.js +56 -50
  16. package/dist/components/HeaderPage/HeaderPage.esm.js.map +1 -1
  17. package/dist/components/Link/Link.esm.js +11 -39
  18. package/dist/components/Link/Link.esm.js.map +1 -1
  19. package/dist/components/Link/Link.module.css.esm.js +3 -3
  20. package/dist/components/Menu/Menu.esm.js +46 -12
  21. package/dist/components/Menu/Menu.esm.js.map +1 -1
  22. package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +1 -1
  23. package/dist/components/SearchField/SearchField.esm.js +17 -33
  24. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  25. package/dist/components/SearchField/SearchField.module.css.esm.js +3 -3
  26. package/dist/components/Skeleton/Skeleton.esm.js +2 -2
  27. package/dist/components/Skeleton/Skeleton.esm.js.map +1 -1
  28. package/dist/components/Switch/Switch.esm.js +2 -2
  29. package/dist/components/Switch/Switch.esm.js.map +1 -1
  30. package/dist/components/Table/Table.module.css.esm.js +2 -2
  31. package/dist/components/Table/components/CellProfile.esm.js +2 -34
  32. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  33. package/dist/components/TablePagination/TablePagination.esm.js +3 -33
  34. package/dist/components/TablePagination/TablePagination.esm.js.map +1 -1
  35. package/dist/components/Tabs/Tabs.esm.js +9 -7
  36. package/dist/components/Tabs/Tabs.esm.js.map +1 -1
  37. package/dist/components/Text/Text.esm.js +3 -3
  38. package/dist/components/Text/Text.esm.js.map +1 -1
  39. package/dist/components/Text/Text.module.css.esm.js +2 -2
  40. package/dist/components/TextField/TextField.esm.js +5 -5
  41. package/dist/components/TextField/TextField.esm.js.map +1 -1
  42. package/dist/components/TextField/TextField.module.css.esm.js +2 -2
  43. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js +19 -0
  44. package/dist/components/VisuallyHidden/VisuallyHidden.esm.js.map +1 -0
  45. package/dist/components/VisuallyHidden/VisuallyHidden.module.css.esm.js +8 -0
  46. package/dist/components/VisuallyHidden/VisuallyHidden.module.css.esm.js.map +1 -0
  47. package/dist/index.d.ts +65 -27
  48. package/dist/index.esm.js +1 -0
  49. package/dist/index.esm.js.map +1 -1
  50. package/dist/utils/componentDefinitions.esm.js +14 -5
  51. package/dist/utils/componentDefinitions.esm.js.map +1 -1
  52. package/package.json +5 -3
package/CHANGELOG.md CHANGED
@@ -1,19 +1,132 @@
1
1
  # @backstage/ui
2
2
 
3
- ## 0.8.2
3
+ ## 0.9.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - 539cf26: **BREAKING**: Migrated Avatar component from Base UI to custom implementation with size changes:
8
+
9
+ - Base UI-specific props are no longer supported
10
+ - Size values have been updated:
11
+ - New `x-small` size added (1.25rem / 20px)
12
+ - `small` size unchanged (1.5rem / 24px)
13
+ - `medium` size unchanged (2rem / 32px, default)
14
+ - `large` size **changed from 3rem to 2.5rem** (40px)
15
+ - New `x-large` size added (3rem / 48px)
16
+
17
+ Migration:
18
+
19
+ ```diff
20
+ # Remove Base UI-specific props
21
+ - <Avatar src="..." name="..." render={...} />
22
+ + <Avatar src="..." name="..." />
23
+
24
+ # Update large size usage to x-large for same visual size
25
+ - <Avatar src="..." name="..." size="large" />
26
+ + <Avatar src="..." name="..." size="x-large" />
27
+ ```
28
+
29
+ Added `purpose` prop for accessibility control (`'informative'` or `'decoration'`).
30
+
31
+ - 134151f: Fixing styles on SearchField in Backstage UI after migration to CSS modules. `SearchField` has now its own set of class names. We previously used class names from `TextField` but this approach was creating some confusion so going forward in your theme you'll be able to theme `TextField` and `SearchField` separately.
32
+
33
+ ### Patch Changes
34
+
35
+ - d01de00: Fix broken external links in Backstage UI Header component.
36
+ - deaa427: Fixed Text component to prevent `truncate` prop from being spread to the underlying DOM element.
37
+ - 1059f95: Improved the Link component structure in Backstage UI.
38
+ - 6874094: Migrated CellProfile component from Base UI Avatar to Backstage UI Avatar component.
39
+ - 719d772: Avatar components in x-small and small sizes now display only one initial instead of two, improving readability at smaller dimensions.
40
+ - 3b18d80: Fixed RadioGroup radio button ellipse distortion by preventing flex shrink and grow.
41
+ - e16ece5: Set the color-scheme property depending on theme
42
+
43
+ ## 0.9.0-next.1
44
+
45
+ ### Minor Changes
46
+
47
+ - 5c614ff: **BREAKING**: Migrated Checkbox component from Base UI to React Aria Components.
48
+
49
+ API changes required:
50
+
51
+ - `checked` → `isSelected`
52
+ - `defaultChecked` → `defaultSelected`
53
+ - `disabled` → `isDisabled`
54
+ - `required` → `isRequired`
55
+ - `label` prop removed - use `children` instead
56
+ - CSS: `bui-CheckboxLabel` class removed
57
+ - Data attribute: `data-checked` → `data-selected`
58
+ - Use without label is no longer supported
59
+
60
+ Migration examples:
61
+
62
+ Before:
63
+
64
+ ```tsx
65
+ <Checkbox label="Accept terms" checked={agreed} onChange={setAgreed} />
66
+ ```
67
+
68
+ After:
69
+
70
+ ```tsx
71
+ <Checkbox isSelected={agreed} onChange={setAgreed}>
72
+ Accept terms
73
+ </Checkbox>
74
+ ```
75
+
76
+ Before:
77
+
78
+ ```tsx
79
+ <Checkbox label="Option" disabled />
80
+ ```
81
+
82
+ After:
83
+
84
+ ```tsx
85
+ <Checkbox isDisabled>Option</Checkbox>
86
+ ```
87
+
88
+ Before:
89
+
90
+ ```tsx
91
+ <Checkbox />
92
+ ```
93
+
94
+ After:
95
+
96
+ ```tsx
97
+ <Checkbox>
98
+ <VisuallyHidden>Accessible label</VisuallyHidden>
99
+ </Checkbox>
100
+ ```
101
+
102
+ - b78fc45: **BREAKING**: Changed className prop behavior to augment default styles instead of being ignored or overriding them.
103
+
104
+ Affected components:
105
+
106
+ - Menu, MenuListBox, MenuAutocomplete, MenuAutocompleteListbox, MenuItem, MenuListBoxItem, MenuSection, MenuSeparator
107
+ - Switch
108
+ - Skeleton
109
+ - FieldLabel
110
+ - Header, HeaderToolbar
111
+ - HeaderPage
112
+ - Tabs, TabList, Tab, TabPanel
113
+
114
+ If you were passing custom className values to any of these components that relied on the previous behavior, you may need to adjust your styles to account for the default classes now being applied alongside your custom classes.
4
115
 
5
116
  ### Patch Changes
6
117
 
7
- - 424a156: Fix CSS layer ordering in Backstage UI to make sure component styles are loaded after tokens and base declarations.
8
- - b5390a5: Fix font smoothing as default in Backstage UI.
118
+ - ff9f0c3: Enable tree-shaking of imports other than `*.css`.
119
+ - 1ef3ca4: Added new VisuallyHidden component for hiding content visually while keeping it accessible to screen readers.
9
120
 
10
- ## 0.8.1
121
+ ## 0.8.2-next.0
11
122
 
12
123
  ### Patch Changes
13
124
 
14
- - 3f9b002: Fix default text color in Backstage UI
15
- - f842c8c: Fix the default font size in Backstage UI.
16
- - 247d799: Fix default font wight and font family in Backstage UI.
125
+ - 26c6a78: Fix default text color in Backstage UI
126
+ - dac851f: Fix the default font size in Backstage UI.
127
+ - 3c0ea67: Fix CSS layer ordering in Backstage UI to make sure component styles are loaded after tokens and base declarations.
128
+ - 4eb455c: Fix font smoothing as default in Backstage UI.
129
+ - 00bfb83: Fix default font wight and font family in Backstage UI.
17
130
 
18
131
  ## 0.8.0
19
132
 
package/css/styles.css CHANGED
@@ -247,6 +247,14 @@
247
247
  -webkit-font-smoothing: antialiased;
248
248
  -moz-osx-font-smoothing: grayscale;
249
249
  }
250
+
251
+ [data-theme-mode="dark"] {
252
+ color-scheme: dark;
253
+ }
254
+
255
+ [data-theme-mode="light"] {
256
+ color-scheme: light;
257
+ }
250
258
  }
251
259
 
252
260
  @layer components;
@@ -1,6 +1,5 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
3
- import { Avatar as Avatar$1 } from '@base-ui-components/react/avatar';
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { forwardRef, useState, useEffect } from 'react';
4
3
  import clsx from 'clsx';
5
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
6
5
  import styles from './Avatar.module.css.esm.js';
@@ -8,36 +7,53 @@ import styles from './Avatar.module.css.esm.js';
8
7
  const Avatar = forwardRef((props, ref) => {
9
8
  const { classNames, dataAttributes, cleanedProps } = useStyles("Avatar", {
10
9
  size: "medium",
10
+ purpose: "informative",
11
11
  ...props
12
12
  });
13
- const { className, src, name, ...rest } = cleanedProps;
14
- return /* @__PURE__ */ jsxs(
15
- Avatar$1.Root,
13
+ const { className, src, name, purpose, ...rest } = cleanedProps;
14
+ const [imageStatus, setImageStatus] = useState("loading");
15
+ useEffect(() => {
16
+ setImageStatus("loading");
17
+ const img = new Image();
18
+ img.onload = () => setImageStatus("loaded");
19
+ img.onerror = () => setImageStatus("error");
20
+ img.src = src;
21
+ return () => {
22
+ img.onload = null;
23
+ img.onerror = null;
24
+ };
25
+ }, [src]);
26
+ const initialsCount = ["x-small", "small"].includes(cleanedProps.size) ? 1 : 2;
27
+ const initials = name.split(" ").map((word) => word[0]).join("").toLocaleUpperCase("en-US").slice(0, initialsCount);
28
+ return /* @__PURE__ */ jsx(
29
+ "div",
16
30
  {
17
31
  ref,
32
+ role: "img",
33
+ "aria-label": purpose === "informative" ? name : void 0,
34
+ "aria-hidden": purpose === "decoration" ? true : void 0,
18
35
  className: clsx(classNames.root, styles[classNames.root], className),
19
36
  ...dataAttributes,
20
37
  ...rest,
21
- children: [
22
- /* @__PURE__ */ jsx(
23
- Avatar$1.Image,
24
- {
25
- className: clsx(classNames.image, styles[classNames.image]),
26
- src
27
- }
28
- ),
29
- /* @__PURE__ */ jsx(
30
- Avatar$1.Fallback,
31
- {
32
- className: clsx(classNames.fallback, styles[classNames.fallback]),
33
- children: (name || "").split(" ").map((word) => word[0]).join("").toLocaleUpperCase("en-US").slice(0, 2)
34
- }
35
- )
36
- ]
38
+ children: imageStatus === "loaded" ? /* @__PURE__ */ jsx(
39
+ "img",
40
+ {
41
+ src,
42
+ alt: "",
43
+ className: clsx(classNames.image, styles[classNames.image])
44
+ }
45
+ ) : /* @__PURE__ */ jsx(
46
+ "div",
47
+ {
48
+ "aria-hidden": "true",
49
+ className: clsx(classNames.fallback, styles[classNames.fallback]),
50
+ children: initials
51
+ }
52
+ )
37
53
  }
38
54
  );
39
55
  });
40
- Avatar.displayName = Avatar$1.Root.displayName;
56
+ Avatar.displayName = "Avatar";
41
57
 
42
58
  export { Avatar };
43
59
  //# sourceMappingURL=Avatar.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.esm.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, ElementRef } from 'react';\nimport { Avatar as AvatarPrimitive } from '@base-ui-components/react/avatar';\nimport clsx from 'clsx';\nimport { AvatarProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Avatar.module.css';\n\n/** @public */\nexport const Avatar = forwardRef<\n ElementRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>((props, ref) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles('Avatar', {\n size: 'medium',\n ...props,\n });\n\n const { className, src, name, ...rest } = cleanedProps;\n\n return (\n <AvatarPrimitive.Root\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...rest}\n >\n <AvatarPrimitive.Image\n className={clsx(classNames.image, styles[classNames.image])}\n src={src}\n />\n <AvatarPrimitive.Fallback\n className={clsx(classNames.fallback, styles[classNames.fallback])}\n >\n {(name || '')\n .split(' ')\n .map(word => word[0])\n .join('')\n .toLocaleUpperCase('en-US')\n .slice(0, 2)}\n </AvatarPrimitive.Fallback>\n </AvatarPrimitive.Root>\n );\n});\n\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n"],"names":["AvatarPrimitive"],"mappings":";;;;;;;AAwBO,MAAM,MAAA,GAAS,UAAA,CAGpB,CAAC,KAAA,EAAO,GAAA,KAAQ;AAChB,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,QAAA;AAAA,IACN,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM,EAAE,SAAA,EAAW,GAAA,EAAK,IAAA,EAAM,GAAG,MAAK,GAAI,YAAA;AAE1C,EAAA,uBACE,IAAA;AAAA,IAACA,QAAA,CAAgB,IAAA;AAAA,IAAhB;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG,cAAA;AAAA,MACH,GAAG,IAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAACA,QAAA,CAAgB,KAAA;AAAA,UAAhB;AAAA,YACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,YAC1D;AAAA;AAAA,SACF;AAAA,wBACA,GAAA;AAAA,UAACA,QAAA,CAAgB,QAAA;AAAA,UAAhB;AAAA,YACC,WAAW,IAAA,CAAK,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,QAAQ,CAAC,CAAA;AAAA,YAE9D,mBAAQ,EAAA,EACP,KAAA,CAAM,GAAG,CAAA,CACT,GAAA,CAAI,UAAQ,IAAA,CAAK,CAAC,CAAC,CAAA,CACnB,IAAA,CAAK,EAAE,CAAA,CACP,iBAAA,CAAkB,OAAO,CAAA,CACzB,KAAA,CAAM,GAAG,CAAC;AAAA;AAAA;AACf;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAcA,SAAgB,IAAA,CAAK,WAAA;;;;"}
1
+ {"version":3,"file":"Avatar.esm.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useState, useEffect } from 'react';\nimport clsx from 'clsx';\nimport { AvatarProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Avatar.module.css';\n\n/** @public */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles('Avatar', {\n size: 'medium',\n purpose: 'informative',\n ...props,\n });\n\n const { className, src, name, purpose, ...rest } = cleanedProps;\n\n const [imageStatus, setImageStatus] = useState<\n 'loading' | 'loaded' | 'error'\n >('loading');\n\n useEffect(() => {\n setImageStatus('loading');\n const img = new Image();\n img.onload = () => setImageStatus('loaded');\n img.onerror = () => setImageStatus('error');\n img.src = src;\n\n return () => {\n img.onload = null;\n img.onerror = null;\n };\n }, [src]);\n\n const initialsCount = ['x-small', 'small'].includes(cleanedProps.size)\n ? 1\n : 2;\n\n const initials = name\n .split(' ')\n .map(word => word[0])\n .join('')\n .toLocaleUpperCase('en-US')\n .slice(0, initialsCount);\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={purpose === 'informative' ? name : undefined}\n aria-hidden={purpose === 'decoration' ? true : undefined}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...rest}\n >\n {imageStatus === 'loaded' ? (\n <img\n src={src}\n alt=\"\"\n className={clsx(classNames.image, styles[classNames.image])}\n />\n ) : (\n <div\n aria-hidden=\"true\"\n className={clsx(classNames.fallback, styles[classNames.fallback])}\n >\n {initials}\n </div>\n )}\n </div>\n );\n});\n\nAvatar.displayName = 'Avatar';\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,QAAA;AAAA,IACN,OAAA,EAAS,aAAA;AAAA,IACT,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM,EAAE,SAAA,EAAW,GAAA,EAAK,MAAM,OAAA,EAAS,GAAG,MAAK,GAAI,YAAA;AAEnD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAEpC,SAAS,CAAA;AAEX,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,cAAA,CAAe,SAAS,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,IAAI,KAAA,EAAM;AACtB,IAAA,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,KAAK,CAAC;AAAA;AAAA,OAC5D,mBAEA,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAY,MAAA;AAAA,UACZ,WAAW,IAAA,CAAK,UAAA,CAAW,UAAU,MAAA,CAAO,UAAA,CAAW,QAAQ,CAAC,CAAA;AAAA,UAE/D,QAAA,EAAA;AAAA;AAAA;AACH;AAAA,GAEJ;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
@@ -1,6 +1,6 @@
1
1
  import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
2
 
3
- var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Avatar-module_bui-AvatarRoot__3BSck {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n user-select: none;\n font-weight: 500;\n color: var(--bui-fg-primary);\n background-color: var(--bui-bg-surface-2);\n font-size: 1rem;\n line-height: 1;\n overflow: hidden;\n height: 2rem;\n width: 2rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='small'] {\n height: 1.5rem;\n width: 1.5rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='medium'] {\n height: 2rem;\n width: 2rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='large'] {\n height: 3rem;\n width: 3rem;\n }\n\n .Avatar-module_bui-AvatarImage__2ehc- {\n object-fit: cover;\n height: 100%;\n width: 100%;\n }\n\n .Avatar-module_bui-AvatarFallback__3qnqR {\n align-items: center;\n display: flex;\n justify-content: center;\n height: 100%;\n width: 100%;\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-regular);\n box-shadow: inset 0 0 0 1px var(--bui-border);\n border-radius: var(--bui-radius-full);\n }\n}\n";
3
+ var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Avatar-module_bui-AvatarRoot__3BSck {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n user-select: none;\n font-weight: 500;\n color: var(--bui-fg-primary);\n background-color: var(--bui-bg-surface-2);\n font-size: 1rem;\n line-height: 1;\n overflow: hidden;\n height: 2rem;\n width: 2rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='x-small'] {\n height: 1.25rem;\n width: 1.25rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='small'] {\n height: 1.5rem;\n width: 1.5rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='medium'] {\n height: 2rem;\n width: 2rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='large'] {\n height: 2.5rem;\n width: 2.5rem;\n }\n\n .Avatar-module_bui-AvatarRoot__3BSck[data-size='x-large'] {\n height: 3rem;\n width: 3rem;\n }\n\n .Avatar-module_bui-AvatarImage__2ehc- {\n object-fit: cover;\n height: 100%;\n width: 100%;\n display: block;\n }\n\n .Avatar-module_bui-AvatarFallback__3qnqR {\n align-items: center;\n display: flex;\n justify-content: center;\n height: 100%;\n width: 100%;\n font-size: var(--bui-font-size-3);\n font-weight: var(--bui-font-weight-regular);\n box-shadow: inset 0 0 0 1px var(--bui-border);\n border-radius: var(--bui-radius-full);\n }\n}\n";
4
4
  var styles = {"bui-AvatarRoot":"Avatar-module_bui-AvatarRoot__3BSck","bui-AvatarImage":"Avatar-module_bui-AvatarImage__2ehc-","bui-AvatarFallback":"Avatar-module_bui-AvatarFallback__3qnqR"};
5
5
  styleInject(css_248z);
6
6
 
@@ -1,6 +1,6 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef } from 'react';
3
- import { Checkbox as Checkbox$1 } from '@base-ui-components/react/checkbox';
3
+ import { Checkbox as Checkbox$1 } from 'react-aria-components';
4
4
  import { useStyles } from '../../hooks/useStyles.esm.js';
5
5
  import clsx from 'clsx';
6
6
  import styles from './Checkbox.module.css.esm.js';
@@ -8,28 +8,26 @@ import { RiCheckLine } from '@remixicon/react';
8
8
 
9
9
  const Checkbox = forwardRef(
10
10
  (props, ref) => {
11
- const { classNames, cleanedProps } = useStyles("Checkbox", props);
12
- const { label, onChange, className, ...rest } = cleanedProps;
13
- const checkboxElement = /* @__PURE__ */ jsx(
14
- Checkbox$1.Root,
11
+ const { classNames } = useStyles("Checkbox");
12
+ const { className, children, ...rest } = props;
13
+ return /* @__PURE__ */ jsxs(
14
+ Checkbox$1,
15
15
  {
16
16
  ref,
17
17
  className: clsx(classNames.root, styles[classNames.root], className),
18
- onCheckedChange: onChange,
19
18
  ...rest,
20
- children: /* @__PURE__ */ jsx(
21
- Checkbox$1.Indicator,
22
- {
23
- className: clsx(classNames.indicator, styles[classNames.indicator]),
24
- children: /* @__PURE__ */ jsx(RiCheckLine, { size: 12 })
25
- }
26
- )
19
+ children: [
20
+ /* @__PURE__ */ jsx(
21
+ "div",
22
+ {
23
+ className: clsx(classNames.indicator, styles[classNames.indicator]),
24
+ children: /* @__PURE__ */ jsx(RiCheckLine, { size: 12 })
25
+ }
26
+ ),
27
+ children
28
+ ]
27
29
  }
28
30
  );
29
- return label ? /* @__PURE__ */ jsxs("label", { className: clsx(classNames.label, styles[classNames.label]), children: [
30
- checkboxElement,
31
- label
32
- ] }) : checkboxElement;
33
31
  }
34
32
  );
35
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui-components/react/checkbox';\nimport type { CheckboxProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport clsx from 'clsx';\nimport styles from './Checkbox.module.css';\nimport { RiCheckLine } from '@remixicon/react';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => {\n const { classNames, cleanedProps } = useStyles('Checkbox', props);\n const { label, onChange, className, ...rest } = cleanedProps;\n\n const checkboxElement = (\n <CheckboxPrimitive.Root\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n onCheckedChange={onChange}\n {...rest}\n >\n <CheckboxPrimitive.Indicator\n className={clsx(classNames.indicator, styles[classNames.indicator])}\n >\n <RiCheckLine size={12} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n return label ? (\n <label className={clsx(classNames.label, styles[classNames.label])}>\n {checkboxElement}\n {label}\n </label>\n ) : (\n checkboxElement\n );\n },\n);\n"],"names":["CheckboxPrimitive"],"mappings":";;;;;;;;AAyBO,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,YAAY,KAAK,CAAA;AAChE,IAAA,MAAM,EAAE,KAAA,EAAO,QAAA,EAAU,SAAA,EAAW,GAAG,MAAK,GAAI,YAAA;AAEhD,IAAA,MAAM,eAAA,mBACJ,GAAA;AAAA,MAACA,UAAA,CAAkB,IAAA;AAAA,MAAlB;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QACnE,eAAA,EAAiB,QAAA;AAAA,QAChB,GAAG,IAAA;AAAA,QAEJ,QAAA,kBAAA,GAAA;AAAA,UAACA,UAAA,CAAkB,SAAA;AAAA,UAAlB;AAAA,YACC,WAAW,IAAA,CAAK,UAAA,CAAW,WAAW,MAAA,CAAO,UAAA,CAAW,SAAS,CAAC,CAAA;AAAA,YAElE,QAAA,kBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAM,EAAA,EAAI;AAAA;AAAA;AACzB;AAAA,KACF;AAGF,IAAA,OAAO,KAAA,mBACL,IAAA,CAAC,OAAA,EAAA,EAAM,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,KAAA,EAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA,EAC9D,QAAA,EAAA;AAAA,MAAA,eAAA;AAAA,MACA;AAAA,KAAA,EACH,CAAA,GAEA,eAAA;AAAA,EAEJ;AACF;;;;"}
1
+ {"version":3,"file":"Checkbox.esm.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport { Checkbox as RACheckbox } from 'react-aria-components';\nimport type { CheckboxProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport clsx from 'clsx';\nimport styles from './Checkbox.module.css';\nimport { RiCheckLine } from '@remixicon/react';\n\n/** @public */\nexport const Checkbox = forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const { classNames } = useStyles('Checkbox');\n const { className, children, ...rest } = props;\n\n return (\n <RACheckbox\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n >\n <div\n className={clsx(classNames.indicator, styles[classNames.indicator])}\n >\n <RiCheckLine size={12} />\n </div>\n {children}\n </RACheckbox>\n );\n },\n);\n"],"names":["RACheckbox"],"mappings":";;;;;;;;AAyBO,MAAM,QAAA,GAAW,UAAA;AAAA,EACtB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,SAAA,CAAU,UAAU,CAAA;AAC3C,IAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,MAAK,GAAI,KAAA;AAEzC,IAAA,uBACE,IAAA;AAAA,MAACA,UAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QAClE,GAAG,IAAA;AAAA,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,CAAA;AAAA,cAElE,QAAA,kBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAM,EAAA,EAAI;AAAA;AAAA,WACzB;AAAA,UACC;AAAA;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -1,7 +1,7 @@
1
1
  import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
2
 
3
- var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Checkbox-module_bui-CheckboxRoot__3-TFM {\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n height: 1rem;\n box-shadow: inset 0 0 0 1px var(--bui-border);\n cursor: pointer;\n border-radius: 2px;\n transition: background-color 0.2s ease-in-out;\n background-color: var(--bui-bg-surface-1);\n padding: 0;\n flex-shrink: 0;\n }\n\n .Checkbox-module_bui-CheckboxRoot__3-TFM:focus-visible {\n transition: none;\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n .Checkbox-module_bui-CheckboxRoot__3-TFM[data-checked] {\n background-color: var(--bui-bg-solid);\n box-shadow: none;\n color: var(--bui-fg-solid);\n }\n\n .Checkbox-module_bui-CheckboxLabel__2sjLA {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n color: var(--bui-fg-primary);\n user-select: none;\n\n &:hover {\n & .Checkbox-module_bui-CheckboxRoot__3-TFM:not([data-checked]) {\n box-shadow: inset 0 0 0 1px var(--bui-border-hover);\n }\n }\n }\n\n .Checkbox-module_bui-CheckboxIndicator__2ZJtl {\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--bui-fg-solid);\n }\n}\n";
4
- var styles = {"bui-CheckboxRoot":"Checkbox-module_bui-CheckboxRoot__3-TFM","bui-CheckboxLabel":"Checkbox-module_bui-CheckboxLabel__2sjLA","bui-CheckboxIndicator":"Checkbox-module_bui-CheckboxIndicator__2ZJtl"};
3
+ var css_248z = "/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@layer tokens, base, components, utilities;\n\n@layer components {\n .Checkbox-module_bui-Checkbox__1Oiwl {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-3);\n font-family: var(--bui-font-regular);\n font-weight: var(--bui-font-weight-regular);\n color: var(--bui-fg-primary);\n user-select: none;\n cursor: pointer;\n }\n\n .Checkbox-module_bui-Checkbox__1Oiwl[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .Checkbox-module_bui-CheckboxIndicator__2ZJtl {\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1rem;\n height: 1rem;\n box-shadow: inset 0 0 0 1px var(--bui-border);\n border-radius: 2px;\n transition: background-color 0.2s ease-in-out;\n background-color: var(--bui-bg-surface-1);\n padding: 0;\n flex-shrink: 0;\n color: var(--bui-fg-solid);\n\n @media (prefers-reduced-motion: reduce) {\n & {\n transition: none;\n }\n }\n }\n\n .Checkbox-module_bui-Checkbox__1Oiwl[data-focus-visible] .Checkbox-module_bui-CheckboxIndicator__2ZJtl {\n transition: none;\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n .Checkbox-module_bui-Checkbox__1Oiwl[data-selected] .Checkbox-module_bui-CheckboxIndicator__2ZJtl {\n background-color: var(--bui-bg-solid);\n box-shadow: none;\n }\n\n .Checkbox-module_bui-Checkbox__1Oiwl[data-hovered]:not([data-selected]) .Checkbox-module_bui-CheckboxIndicator__2ZJtl {\n box-shadow: inset 0 0 0 1px var(--bui-border-hover);\n }\n}\n";
4
+ var styles = {"bui-Checkbox":"Checkbox-module_bui-Checkbox__1Oiwl","bui-CheckboxIndicator":"Checkbox-module_bui-CheckboxIndicator__2ZJtl"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { styles as default };
@@ -8,12 +8,20 @@ import clsx from 'clsx';
8
8
  const FieldLabel = forwardRef(
9
9
  (props, ref) => {
10
10
  const { classNames, cleanedProps } = useStyles("FieldLabel", props);
11
- const { label, secondaryLabel, description, htmlFor, id, ...rest } = cleanedProps;
11
+ const {
12
+ className,
13
+ label,
14
+ secondaryLabel,
15
+ description,
16
+ htmlFor,
17
+ id,
18
+ ...rest
19
+ } = cleanedProps;
12
20
  if (!label) return null;
13
21
  return /* @__PURE__ */ jsxs(
14
22
  "div",
15
23
  {
16
- className: clsx(classNames.root, styles[classNames.root]),
24
+ className: clsx(classNames.root, styles[classNames.root], className),
17
25
  ...rest,
18
26
  ref,
19
27
  children: [
@@ -1 +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';\nimport styles from './FieldLabel.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const FieldLabel = forwardRef<HTMLDivElement, FieldLabelProps>(\n (props: FieldLabelProps, ref) => {\n const { classNames, cleanedProps } = useStyles('FieldLabel', props);\n const { label, secondaryLabel, description, htmlFor, id, ...rest } =\n cleanedProps;\n\n if (!label) return null;\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root])}\n {...rest}\n ref={ref}\n >\n {label && (\n <Label\n className={clsx(classNames.label, styles[classNames.label])}\n htmlFor={htmlFor}\n id={id}\n >\n {label}\n {secondaryLabel && (\n <span\n aria-hidden=\"true\"\n className={clsx(\n classNames.secondaryLabel,\n styles[classNames.secondaryLabel],\n )}\n >\n ({secondaryLabel})\n </span>\n )}\n </Label>\n )}\n {description && (\n <div\n className={clsx(\n classNames.description,\n styles[classNames.description],\n )}\n >\n {description}\n </div>\n )}\n </div>\n );\n },\n);\n\nFieldLabel.displayName = 'FieldLabel';\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAQ;AAC/B,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,cAAc,KAAK,CAAA;AAClE,IAAA,MAAM,EAAE,OAAO,cAAA,EAAgB,WAAA,EAAa,SAAS,EAAA,EAAI,GAAG,MAAK,GAC/D,YAAA;AAEF,IAAA,IAAI,CAAC,OAAO,OAAO,IAAA;AAEnB,IAAA,uBACE,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAW,IAAA,CAAK,UAAA,CAAW,MAAM,MAAA,CAAO,UAAA,CAAW,IAAI,CAAC,CAAA;AAAA,QACvD,GAAG,IAAA;AAAA,QACJ,GAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA,oBACC,IAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,cAC1D,OAAA;AAAA,cACA,EAAA;AAAA,cAEC,QAAA,EAAA;AAAA,gBAAA,KAAA;AAAA,gBACA,cAAA,oBACC,IAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,aAAA,EAAY,MAAA;AAAA,oBACZ,SAAA,EAAW,IAAA;AAAA,sBACT,UAAA,CAAW,cAAA;AAAA,sBACX,MAAA,CAAO,WAAW,cAAc;AAAA,qBAClC;AAAA,oBACD,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,sBACG,cAAA;AAAA,sBAAe;AAAA;AAAA;AAAA;AACnB;AAAA;AAAA,WAEJ;AAAA,UAED,WAAA,oBACC,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,IAAA;AAAA,gBACT,UAAA,CAAW,WAAA;AAAA,gBACX,MAAA,CAAO,WAAW,WAAW;AAAA,eAC/B;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
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';\nimport styles from './FieldLabel.module.css';\nimport clsx from 'clsx';\n\n/** @public */\nexport const FieldLabel = forwardRef<HTMLDivElement, FieldLabelProps>(\n (props: FieldLabelProps, ref) => {\n const { classNames, cleanedProps } = useStyles('FieldLabel', props);\n const {\n className,\n label,\n secondaryLabel,\n description,\n htmlFor,\n id,\n ...rest\n } = cleanedProps;\n\n if (!label) return null;\n\n return (\n <div\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...rest}\n ref={ref}\n >\n {label && (\n <Label\n className={clsx(classNames.label, styles[classNames.label])}\n htmlFor={htmlFor}\n id={id}\n >\n {label}\n {secondaryLabel && (\n <span\n aria-hidden=\"true\"\n className={clsx(\n classNames.secondaryLabel,\n styles[classNames.secondaryLabel],\n )}\n >\n ({secondaryLabel})\n </span>\n )}\n </Label>\n )}\n {description && (\n <div\n className={clsx(\n classNames.description,\n styles[classNames.description],\n )}\n >\n {description}\n </div>\n )}\n </div>\n );\n },\n);\n\nFieldLabel.displayName = 'FieldLabel';\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,UAAA,GAAa,UAAA;AAAA,EACxB,CAAC,OAAwB,GAAA,KAAQ;AAC/B,IAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,cAAc,KAAK,CAAA;AAClE,IAAA,MAAM;AAAA,MACJ,SAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,EAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,YAAA;AAEJ,IAAA,IAAI,CAAC,OAAO,OAAO,IAAA;AAEnB,IAAA,uBACE,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,QAClE,GAAG,IAAA;AAAA,QACJ,GAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,KAAA,oBACC,IAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,cAC1D,OAAA;AAAA,cACA,EAAA;AAAA,cAEC,QAAA,EAAA;AAAA,gBAAA,KAAA;AAAA,gBACA,cAAA,oBACC,IAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,aAAA,EAAY,MAAA;AAAA,oBACZ,SAAA,EAAW,IAAA;AAAA,sBACT,UAAA,CAAW,cAAA;AAAA,sBACX,MAAA,CAAO,WAAW,cAAc;AAAA,qBAClC;AAAA,oBACD,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,sBACG,cAAA;AAAA,sBAAe;AAAA;AAAA;AAAA;AACnB;AAAA;AAAA,WAEJ;AAAA,UAED,WAAA,oBACC,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,IAAA;AAAA,gBACT,UAAA,CAAW,WAAA;AAAA,gBACX,MAAA,CAAO,WAAW,WAAW;AAAA,eAC/B;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA;;;;"}
@@ -7,7 +7,15 @@ import clsx from 'clsx';
7
7
 
8
8
  const Header = (props) => {
9
9
  const { classNames, cleanedProps } = useStyles("Header", props);
10
- const { tabs, icon, title, titleLink, customActions, onTabSelectionChange } = cleanedProps;
10
+ const {
11
+ className,
12
+ tabs,
13
+ icon,
14
+ title,
15
+ titleLink,
16
+ customActions,
17
+ onTabSelectionChange
18
+ } = cleanedProps;
11
19
  const hasTabs = tabs && tabs.length > 0;
12
20
  return /* @__PURE__ */ jsxs(Fragment, { children: [
13
21
  /* @__PURE__ */ jsx(
@@ -25,7 +33,8 @@ const Header = (props) => {
25
33
  {
26
34
  className: clsx(
27
35
  classNames.tabsWrapper,
28
- styles[classNames.tabsWrapper]
36
+ styles[classNames.tabsWrapper],
37
+ className
29
38
  ),
30
39
  children: /* @__PURE__ */ jsx(Tabs, { onSelectionChange: onTabSelectionChange, children: /* @__PURE__ */ jsx(TabList, { children: tabs?.map((tab) => /* @__PURE__ */ jsx(
31
40
  Tab,
@@ -1 +1 @@
1
- {"version":3,"file":"Header.esm.js","sources":["../../../src/components/Header/Header.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 type { HeaderProps } from './types';\nimport { HeaderToolbar } from './HeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { type NavigateOptions } from 'react-router-dom';\nimport styles from './Header.module.css';\nimport clsx from 'clsx';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * A component that renders a toolbar.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const { classNames, cleanedProps } = useStyles('Header', props);\n const { tabs, icon, title, titleLink, customActions, onTabSelectionChange } =\n cleanedProps;\n\n const hasTabs = tabs && tabs.length > 0;\n\n return (\n <>\n <HeaderToolbar\n icon={icon}\n title={title}\n titleLink={titleLink}\n customActions={customActions}\n hasTabs={hasTabs}\n />\n {tabs && (\n <div\n className={clsx(\n classNames.tabsWrapper,\n styles[classNames.tabsWrapper],\n )}\n >\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </TabList>\n </Tabs>\n </div>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAmCO,MAAM,MAAA,GAAS,CAAC,KAAA,KAAuB;AAC5C,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAC9D,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAM,OAAO,SAAA,EAAW,aAAA,EAAe,sBAAqB,GACxE,YAAA;AAEF,EAAA,MAAM,OAAA,GAAU,IAAA,IAAQ,IAAA,CAAK,MAAA,GAAS,CAAA;AAEtC,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,KAAA;AAAA,QACA,SAAA;AAAA,QACA,aAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,IACC,IAAA,oBACC,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,IAAA;AAAA,UACT,UAAA,CAAW,WAAA;AAAA,UACX,MAAA,CAAO,WAAW,WAAW;AAAA,SAC/B;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,QAAK,iBAAA,EAAmB,oBAAA,EACvB,8BAAC,OAAA,EAAA,EACE,QAAA,EAAA,IAAA,EAAM,IAAI,CAAA,GAAA,qBACT,GAAA;AAAA,UAAC,GAAA;AAAA,UAAA;AAAA,YAEC,IAAI,GAAA,CAAI,EAAA;AAAA,YACR,MAAM,GAAA,CAAI,IAAA;AAAA,YACV,eAAe,GAAA,CAAI,aAAA;AAAA,YAElB,QAAA,EAAA,GAAA,CAAI;AAAA,WAAA;AAAA,UALA,GAAA,CAAI;AAAA,SAOZ,GACH,CAAA,EACF;AAAA;AAAA;AACF,GAAA,EAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Header.esm.js","sources":["../../../src/components/Header/Header.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 type { HeaderProps } from './types';\nimport { HeaderToolbar } from './HeaderToolbar';\nimport { Tabs, TabList, Tab } from '../Tabs';\nimport { useStyles } from '../../hooks/useStyles';\nimport { type NavigateOptions } from 'react-router-dom';\nimport styles from './Header.module.css';\nimport clsx from 'clsx';\n\ndeclare module 'react-aria-components' {\n interface RouterConfig {\n routerOptions: NavigateOptions;\n }\n}\n\n/**\n * A component that renders a toolbar.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const { classNames, cleanedProps } = useStyles('Header', props);\n const {\n className,\n tabs,\n icon,\n title,\n titleLink,\n customActions,\n onTabSelectionChange,\n } = cleanedProps;\n\n const hasTabs = tabs && tabs.length > 0;\n\n return (\n <>\n <HeaderToolbar\n icon={icon}\n title={title}\n titleLink={titleLink}\n customActions={customActions}\n hasTabs={hasTabs}\n />\n {tabs && (\n <div\n className={clsx(\n classNames.tabsWrapper,\n styles[classNames.tabsWrapper],\n className,\n )}\n >\n <Tabs onSelectionChange={onTabSelectionChange}>\n <TabList>\n {tabs?.map(tab => (\n <Tab\n key={tab.id}\n id={tab.id}\n href={tab.href}\n matchStrategy={tab.matchStrategy}\n >\n {tab.label}\n </Tab>\n ))}\n </TabList>\n </Tabs>\n </div>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAmCO,MAAM,MAAA,GAAS,CAAC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 'react-aria-components';
2
+ import { Link } from 'react-aria-components';
3
3
  import { useStyles } from '../../hooks/useStyles.esm.js';
4
4
  import { useRef } from 'react';
5
5
  import { RiShapesLine } from '@remixicon/react';
6
6
  import { Text } from '../Text/Text.esm.js';
7
- import { useNavigate, useHref } from 'react-router-dom';
8
7
  import styles from './Header.module.css.esm.js';
9
8
  import clsx from 'clsx';
10
9
 
11
10
  const HeaderToolbar = (props) => {
12
11
  const { classNames, cleanedProps } = useStyles("Header", props);
13
- const { icon, title, titleLink, customActions, hasTabs } = cleanedProps;
14
- let navigate = useNavigate();
12
+ const { className, icon, title, titleLink, customActions, hasTabs } = cleanedProps;
15
13
  const toolbarWrapperRef = useRef(null);
16
14
  const toolbarContentRef = useRef(null);
17
15
  const toolbarControlsRef = useRef(null);
@@ -25,10 +23,14 @@ const HeaderToolbar = (props) => {
25
23
  ),
26
24
  /* @__PURE__ */ jsx(Text, { variant: "body-medium", children: title || "Your plugin" })
27
25
  ] });
28
- return /* @__PURE__ */ jsx(RouterProvider, { navigate, useHref, children: /* @__PURE__ */ jsx(
26
+ return /* @__PURE__ */ jsx(
29
27
  "div",
30
28
  {
31
- className: clsx(classNames.toolbar, styles[classNames.toolbar]),
29
+ className: clsx(
30
+ classNames.toolbar,
31
+ styles[classNames.toolbar],
32
+ className
33
+ ),
32
34
  "data-has-tabs": hasTabs,
33
35
  children: /* @__PURE__ */ jsxs(
34
36
  "div",
@@ -84,7 +86,7 @@ const HeaderToolbar = (props) => {
84
86
  }
85
87
  )
86
88
  }
87
- ) });
89
+ );
88
90
  };
89
91
 
90
92
  export { HeaderToolbar };
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderToolbar.esm.js","sources":["../../../src/components/Header/HeaderToolbar.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 { Link, RouterProvider } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { useRef } from 'react';\nimport { RiShapesLine } from '@remixicon/react';\nimport type { HeaderToolbarProps } from './types';\nimport { Text } from '../Text';\nimport { useNavigate, useHref } from 'react-router-dom';\nimport styles from './Header.module.css';\nimport clsx from 'clsx';\n\n/**\n * A component that renders a toolbar.\n *\n * @internal\n */\nexport const HeaderToolbar = (props: HeaderToolbarProps) => {\n const { classNames, cleanedProps } = useStyles('Header', props);\n const { icon, title, titleLink, customActions, hasTabs } = cleanedProps;\n let navigate = useNavigate();\n\n // Refs for collision detection\n const toolbarWrapperRef = useRef<HTMLDivElement>(null);\n const toolbarContentRef = useRef<HTMLDivElement>(null);\n const toolbarControlsRef = useRef<HTMLDivElement>(null);\n\n const titleContent = (\n <>\n <div\n className={clsx(classNames.toolbarIcon, styles[classNames.toolbarIcon])}\n >\n {icon || <RiShapesLine />}\n </div>\n <Text variant=\"body-medium\">{title || 'Your plugin'}</Text>\n </>\n );\n\n return (\n <RouterProvider navigate={navigate} useHref={useHref}>\n <div\n className={clsx(classNames.toolbar, styles[classNames.toolbar])}\n data-has-tabs={hasTabs}\n >\n <div\n className={clsx(\n classNames.toolbarWrapper,\n styles[classNames.toolbarWrapper],\n )}\n ref={toolbarWrapperRef}\n >\n <div\n className={clsx(\n classNames.toolbarContent,\n styles[classNames.toolbarContent],\n )}\n ref={toolbarContentRef}\n >\n <Text as=\"h1\" variant=\"body-medium\">\n {titleLink ? (\n <Link\n className={clsx(\n classNames.toolbarName,\n styles[classNames.toolbarName],\n )}\n href={titleLink}\n >\n {titleContent}\n </Link>\n ) : (\n <div\n className={clsx(\n classNames.toolbarName,\n styles[classNames.toolbarName],\n )}\n >\n {titleContent}\n </div>\n )}\n </Text>\n </div>\n <div\n className={clsx(\n classNames.toolbarControls,\n styles[classNames.toolbarControls],\n )}\n ref={toolbarControlsRef}\n >\n {customActions}\n </div>\n </div>\n </div>\n </RouterProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA+BO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAC9D,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAO,SAAA,EAAW,aAAA,EAAe,SAAQ,GAAI,YAAA;AAC3D,EAAA,IAAI,WAAW,WAAA,EAAY;AAG3B,EAAA,MAAM,iBAAA,GAAoB,OAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,iBAAA,GAAoB,OAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,kBAAA,GAAqB,OAAuB,IAAI,CAAA;AAEtD,EAAA,MAAM,+BACJ,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAW,IAAA,CAAK,UAAA,CAAW,aAAa,MAAA,CAAO,UAAA,CAAW,WAAW,CAAC,CAAA;AAAA,QAErE,QAAA,EAAA,IAAA,wBAAS,YAAA,EAAA,EAAa;AAAA;AAAA,KACzB;AAAA,oBACA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,aAAA,EAAe,mBAAS,aAAA,EAAc;AAAA,GAAA,EACtD,CAAA;AAGF,EAAA,uBACE,GAAA,CAAC,cAAA,EAAA,EAAe,QAAA,EAAoB,OAAA,EAClC,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAW,IAAA,CAAK,UAAA,CAAW,SAAS,MAAA,CAAO,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,MAC9D,eAAA,EAAe,OAAA;AAAA,MA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;;;"}
1
+ {"version":3,"file":"HeaderToolbar.esm.js","sources":["../../../src/components/Header/HeaderToolbar.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 { Link } from 'react-aria-components';\nimport { useStyles } from '../../hooks/useStyles';\nimport { useRef } from 'react';\nimport { RiShapesLine } from '@remixicon/react';\nimport type { HeaderToolbarProps } from './types';\nimport { Text } from '../Text';\nimport styles from './Header.module.css';\nimport clsx from 'clsx';\n\n/**\n * A component that renders a toolbar.\n *\n * @internal\n */\nexport const HeaderToolbar = (props: HeaderToolbarProps) => {\n const { classNames, cleanedProps } = useStyles('Header', props);\n const { className, icon, title, titleLink, customActions, hasTabs } =\n cleanedProps;\n\n // Refs for collision detection\n const toolbarWrapperRef = useRef<HTMLDivElement>(null);\n const toolbarContentRef = useRef<HTMLDivElement>(null);\n const toolbarControlsRef = useRef<HTMLDivElement>(null);\n\n const titleContent = (\n <>\n <div\n className={clsx(classNames.toolbarIcon, styles[classNames.toolbarIcon])}\n >\n {icon || <RiShapesLine />}\n </div>\n <Text variant=\"body-medium\">{title || 'Your plugin'}</Text>\n </>\n );\n\n return (\n <div\n className={clsx(\n classNames.toolbar,\n styles[classNames.toolbar],\n className,\n )}\n data-has-tabs={hasTabs}\n >\n <div\n className={clsx(\n classNames.toolbarWrapper,\n styles[classNames.toolbarWrapper],\n )}\n ref={toolbarWrapperRef}\n >\n <div\n className={clsx(\n classNames.toolbarContent,\n styles[classNames.toolbarContent],\n )}\n ref={toolbarContentRef}\n >\n <Text as=\"h1\" variant=\"body-medium\">\n {titleLink ? (\n <Link\n className={clsx(\n classNames.toolbarName,\n styles[classNames.toolbarName],\n )}\n href={titleLink}\n >\n {titleContent}\n </Link>\n ) : (\n <div\n className={clsx(\n classNames.toolbarName,\n styles[classNames.toolbarName],\n )}\n >\n {titleContent}\n </div>\n )}\n </Text>\n </div>\n <div\n className={clsx(\n classNames.toolbarControls,\n styles[classNames.toolbarControls],\n )}\n ref={toolbarControlsRef}\n >\n {customActions}\n </div>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA8B;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,UAAU,KAAK,CAAA;AAC9D,EAAA,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,OAAO,SAAA,EAAW,aAAA,EAAe,SAAQ,GAChE,YAAA;AAGF,EAAA,MAAM,iBAAA,GAAoB,OAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,iBAAA,GAAoB,OAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,kBAAA,GAAqB,OAAuB,IAAI,CAAA;AAEtD,EAAA,MAAM,+BACJ,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAW,IAAA,CAAK,UAAA,CAAW,aAAa,MAAA,CAAO,UAAA,CAAW,WAAW,CAAC,CAAA;AAAA,QAErE,QAAA,EAAA,IAAA,wBAAS,YAAA,EAAA,EAAa;AAAA;AAAA,KACzB;AAAA,oBACA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,aAAA,EAAe,mBAAS,aAAA,EAAc;AAAA,GAAA,EACtD,CAAA;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,OAAA;AAAA,QACX,MAAA,CAAO,W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