@backstage/ui 0.0.0-nightly-20251104024434 → 0.0.0-nightly-20251106024432

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 (31) hide show
  1. package/CHANGELOG.md +84 -1
  2. package/css/styles.css +8 -0
  3. package/dist/components/Accordion/Accordion.esm.js +109 -0
  4. package/dist/components/Accordion/Accordion.esm.js.map +1 -0
  5. package/dist/components/Accordion/Accordion.module.css.esm.js +8 -0
  6. package/dist/components/Accordion/Accordion.module.css.esm.js.map +1 -0
  7. package/dist/components/Avatar/Avatar.esm.js +2 -1
  8. package/dist/components/Avatar/Avatar.esm.js.map +1 -1
  9. package/dist/components/Popover/Popover.module.css.esm.js +1 -1
  10. package/dist/components/RadioGroup/RadioGroup.module.css.esm.js +1 -1
  11. package/dist/components/SearchField/SearchField.esm.js +17 -33
  12. package/dist/components/SearchField/SearchField.esm.js.map +1 -1
  13. package/dist/components/SearchField/SearchField.module.css.esm.js +3 -3
  14. package/dist/components/Select/Select.esm.js +3 -1
  15. package/dist/components/Select/Select.esm.js.map +1 -1
  16. package/dist/components/Select/Select.module.css.esm.js +2 -2
  17. package/dist/components/Table/Table.module.css.esm.js +2 -2
  18. package/dist/components/Table/components/CellProfile.esm.js +2 -34
  19. package/dist/components/Table/components/CellProfile.esm.js.map +1 -1
  20. package/dist/components/TextField/TextField.esm.js +5 -5
  21. package/dist/components/TextField/TextField.esm.js.map +1 -1
  22. package/dist/components/TextField/TextField.module.css.esm.js +2 -2
  23. package/dist/index.d.ts +61 -19
  24. package/dist/index.esm.js +1 -1
  25. package/dist/utils/componentDefinitions.esm.js +17 -8
  26. package/dist/utils/componentDefinitions.esm.js.map +1 -1
  27. package/package.json +2 -2
  28. package/dist/components/Collapsible/Collapsible.esm.js +0 -55
  29. package/dist/components/Collapsible/Collapsible.esm.js.map +0 -1
  30. package/dist/components/Collapsible/Collapsible.module.css.esm.js +0 -8
  31. package/dist/components/Collapsible/Collapsible.module.css.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @backstage/ui
2
2
 
3
- ## 0.0.0-nightly-20251104024434
3
+ ## 0.0.0-nightly-20251106024432
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -83,6 +83,7 @@
83
83
  </Checkbox>
84
84
  ```
85
85
 
86
+ - 134151f: Fixing styles on SearchField in Backstage UI after migration to CSS modules. `SearchField` has now its own set of class names. We previously used class names from `TextField` but this approach was creating some confusion so going forward in your theme you'll be able to theme `TextField` and `SearchField` separately.
86
87
  - b78fc45: **BREAKING**: Changed className prop behavior to augment default styles instead of being ignored or overriding them.
87
88
 
88
89
  Affected components:
@@ -97,18 +98,100 @@
97
98
 
98
99
  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.
99
100
 
101
+ - 83c100e: **BREAKING**: Removed `Collapsible` component. Migrate to `Accordion` or use React Aria `Disclosure`.
102
+
103
+ ## Migration Path 1: Accordion (Opinionated Styled Component)
104
+
105
+ Accordion provides preset styling with a similar component structure.
106
+
107
+ ```diff
108
+ - import { Collapsible } from '@backstage/ui';
109
+ + import { Accordion, AccordionTrigger, AccordionPanel } from '@backstage/ui';
110
+
111
+ - <Collapsible.Root>
112
+ - <Collapsible.Trigger render={(props) => <Button {...props}>Toggle</Button>} />
113
+ - <Collapsible.Panel>Content</Collapsible.Panel>
114
+ - </Collapsible.Root>
115
+
116
+ + <Accordion>
117
+ + <AccordionTrigger title="Toggle" />
118
+ + <AccordionPanel>Content</AccordionPanel>
119
+ + </Accordion>
120
+ ```
121
+
122
+ CSS classes: `.bui-CollapsibleRoot` → `.bui-Accordion`, `.bui-CollapsibleTrigger` → `.bui-AccordionTrigger` (now on heading element), `.bui-CollapsiblePanel` → `.bui-AccordionPanel`
123
+
124
+ ## Migration Path 2: React Aria Disclosure (Full Customization)
125
+
126
+ For custom styling without preset styles:
127
+
128
+ ```tsx
129
+ import { Disclosure, Button, DisclosurePanel } from 'react-aria-components';
130
+
131
+ <Disclosure>
132
+ <Button slot="trigger">Toggle</Button>
133
+ <DisclosurePanel>Content</DisclosurePanel>
134
+ </Disclosure>;
135
+ ```
136
+
100
137
  ### Patch Changes
101
138
 
102
139
  - d01de00: Fix broken external links in Backstage UI Header component.
140
+ - 35a3614: Fixed CSS issues in Select component including popover width constraints, focus outline behavior, and overflow handling.
103
141
  - 26c6a78: Fix default text color in Backstage UI
142
+ - deaa427: Fixed Text component to prevent `truncate` prop from being spread to the underlying DOM element.
104
143
  - 1059f95: Improved the Link component structure in Backstage UI.
144
+ - 6874094: Migrated CellProfile component from Base UI Avatar to Backstage UI Avatar component.
145
+ - 719d772: Avatar components in x-small and small sizes now display only one initial instead of two, improving readability at smaller dimensions.
105
146
  - dac851f: Fix the default font size in Backstage UI.
106
147
  - 3c0ea67: Fix CSS layer ordering in Backstage UI to make sure component styles are loaded after tokens and base declarations.
148
+ - 3b18d80: Fixed RadioGroup radio button ellipse distortion by preventing flex shrink and grow.
107
149
  - 4eb455c: Fix font smoothing as default in Backstage UI.
108
150
  - ff9f0c3: Enable tree-shaking of imports other than `*.css`.
151
+ - e16ece5: Set the color-scheme property depending on theme
109
152
  - 1ef3ca4: Added new VisuallyHidden component for hiding content visually while keeping it accessible to screen readers.
110
153
  - 00bfb83: Fix default font wight and font family in Backstage UI.
111
154
 
155
+ ## 0.9.0-next.2
156
+
157
+ ### Minor Changes
158
+
159
+ - 539cf26: **BREAKING**: Migrated Avatar component from Base UI to custom implementation with size changes:
160
+
161
+ - Base UI-specific props are no longer supported
162
+ - Size values have been updated:
163
+ - New `x-small` size added (1.25rem / 20px)
164
+ - `small` size unchanged (1.5rem / 24px)
165
+ - `medium` size unchanged (2rem / 32px, default)
166
+ - `large` size **changed from 3rem to 2.5rem** (40px)
167
+ - New `x-large` size added (3rem / 48px)
168
+
169
+ Migration:
170
+
171
+ ```diff
172
+ # Remove Base UI-specific props
173
+ - <Avatar src="..." name="..." render={...} />
174
+ + <Avatar src="..." name="..." />
175
+
176
+ # Update large size usage to x-large for same visual size
177
+ - <Avatar src="..." name="..." size="large" />
178
+ + <Avatar src="..." name="..." size="x-large" />
179
+ ```
180
+
181
+ Added `purpose` prop for accessibility control (`'informative'` or `'decoration'`).
182
+
183
+ - 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.
184
+
185
+ ### Patch Changes
186
+
187
+ - d01de00: Fix broken external links in Backstage UI Header component.
188
+ - deaa427: Fixed Text component to prevent `truncate` prop from being spread to the underlying DOM element.
189
+ - 1059f95: Improved the Link component structure in Backstage UI.
190
+ - 6874094: Migrated CellProfile component from Base UI Avatar to Backstage UI Avatar component.
191
+ - 719d772: Avatar components in x-small and small sizes now display only one initial instead of two, improving readability at smaller dimensions.
192
+ - 3b18d80: Fixed RadioGroup radio button ellipse distortion by preventing flex shrink and grow.
193
+ - e16ece5: Set the color-scheme property depending on theme
194
+
112
195
  ## 0.9.0-next.1
113
196
 
114
197
  ### Minor Changes
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;
@@ -0,0 +1,109 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { Disclosure, Heading, Button, DisclosurePanel, DisclosureGroup } from 'react-aria-components';
4
+ import { RiArrowDownSLine } from '@remixicon/react';
5
+ import clsx from 'clsx';
6
+ import { useStyles } from '../../hooks/useStyles.esm.js';
7
+ import styles from './Accordion.module.css.esm.js';
8
+ import { Flex } from '../Flex/Flex.esm.js';
9
+
10
+ const Accordion = forwardRef(({ className, ...props }, ref) => {
11
+ const { classNames, cleanedProps } = useStyles("Accordion", props);
12
+ return /* @__PURE__ */ jsx(
13
+ Disclosure,
14
+ {
15
+ ref,
16
+ className: clsx(classNames.root, styles[classNames.root], className),
17
+ ...cleanedProps
18
+ }
19
+ );
20
+ });
21
+ Accordion.displayName = "Accordion";
22
+ const AccordionTrigger = forwardRef(({ className, title, subtitle, children, ...props }, ref) => {
23
+ const { classNames, cleanedProps } = useStyles("Accordion", props);
24
+ return /* @__PURE__ */ jsx(
25
+ Heading,
26
+ {
27
+ ref,
28
+ className: clsx(
29
+ classNames.trigger,
30
+ styles[classNames.trigger],
31
+ className
32
+ ),
33
+ ...cleanedProps,
34
+ children: /* @__PURE__ */ jsxs(
35
+ Button,
36
+ {
37
+ slot: "trigger",
38
+ className: clsx(
39
+ classNames.triggerButton,
40
+ styles[classNames.triggerButton]
41
+ ),
42
+ children: [
43
+ children ? children : /* @__PURE__ */ jsxs(Flex, { gap: "2", align: "center", children: [
44
+ /* @__PURE__ */ jsx(
45
+ "span",
46
+ {
47
+ className: clsx(
48
+ classNames.triggerTitle,
49
+ styles[classNames.triggerTitle]
50
+ ),
51
+ children: title
52
+ }
53
+ ),
54
+ subtitle && /* @__PURE__ */ jsx(
55
+ "span",
56
+ {
57
+ className: clsx(
58
+ classNames.triggerSubtitle,
59
+ styles[classNames.triggerSubtitle]
60
+ ),
61
+ children: subtitle
62
+ }
63
+ )
64
+ ] }),
65
+ /* @__PURE__ */ jsx(
66
+ RiArrowDownSLine,
67
+ {
68
+ className: clsx(
69
+ classNames.triggerIcon,
70
+ styles[classNames.triggerIcon]
71
+ ),
72
+ size: 16
73
+ }
74
+ )
75
+ ]
76
+ }
77
+ )
78
+ }
79
+ );
80
+ });
81
+ AccordionTrigger.displayName = "AccordionTrigger";
82
+ const AccordionPanel = forwardRef(({ className, ...props }, ref) => {
83
+ const { classNames, cleanedProps } = useStyles("Accordion", props);
84
+ return /* @__PURE__ */ jsx(
85
+ DisclosurePanel,
86
+ {
87
+ ref,
88
+ className: clsx(classNames.panel, styles[classNames.panel], className),
89
+ ...cleanedProps
90
+ }
91
+ );
92
+ });
93
+ AccordionPanel.displayName = "AccordionPanel";
94
+ const AccordionGroup = forwardRef(({ className, allowsMultiple = false, ...props }, ref) => {
95
+ const { classNames, cleanedProps } = useStyles("Accordion", props);
96
+ return /* @__PURE__ */ jsx(
97
+ DisclosureGroup,
98
+ {
99
+ ref,
100
+ allowsMultipleExpanded: allowsMultiple,
101
+ className: clsx(classNames.group, styles[classNames.group], className),
102
+ ...cleanedProps
103
+ }
104
+ );
105
+ });
106
+ AccordionGroup.displayName = "AccordionGroup";
107
+
108
+ export { Accordion, AccordionGroup, AccordionPanel, AccordionTrigger };
109
+ //# sourceMappingURL=Accordion.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.esm.js","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport {\n Disclosure as RADisclosure,\n Button as RAButton,\n DisclosurePanel as RADisclosurePanel,\n DisclosureGroup as RADisclosureGroup,\n Heading as RAHeading,\n} from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport clsx from 'clsx';\nimport type {\n AccordionProps,\n AccordionTriggerProps,\n AccordionPanelProps,\n AccordionGroupProps,\n} from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Accordion.module.css';\nimport { Flex } from '../Flex';\n\n/** @public */\nexport const Accordion = forwardRef<\n React.ElementRef<typeof RADisclosure>,\n AccordionProps\n>(({ className, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RADisclosure\n ref={ref}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordion.displayName = 'Accordion';\n\n/** @public */\nexport const AccordionTrigger = forwardRef<\n React.ElementRef<typeof RAHeading>,\n AccordionTriggerProps\n>(({ className, title, subtitle, children, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RAHeading\n ref={ref}\n className={clsx(\n classNames.trigger,\n styles[classNames.trigger],\n className,\n )}\n {...cleanedProps}\n >\n <RAButton\n slot=\"trigger\"\n className={clsx(\n classNames.triggerButton,\n styles[classNames.triggerButton],\n )}\n >\n {children ? (\n children\n ) : (\n <Flex gap=\"2\" align=\"center\">\n <span\n className={clsx(\n classNames.triggerTitle,\n styles[classNames.triggerTitle],\n )}\n >\n {title}\n </span>\n {subtitle && (\n <span\n className={clsx(\n classNames.triggerSubtitle,\n styles[classNames.triggerSubtitle],\n )}\n >\n {subtitle}\n </span>\n )}\n </Flex>\n )}\n\n <RiArrowDownSLine\n className={clsx(\n classNames.triggerIcon,\n styles[classNames.triggerIcon],\n )}\n size={16}\n />\n </RAButton>\n </RAHeading>\n );\n});\n\nAccordionTrigger.displayName = 'AccordionTrigger';\n\n/** @public */\nexport const AccordionPanel = forwardRef<\n React.ElementRef<typeof RADisclosurePanel>,\n AccordionPanelProps\n>(({ className, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RADisclosurePanel\n ref={ref}\n className={clsx(classNames.panel, styles[classNames.panel], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordionPanel.displayName = 'AccordionPanel';\n\n/** @public */\nexport const AccordionGroup = forwardRef<\n React.ElementRef<typeof RADisclosureGroup>,\n AccordionGroupProps\n>(({ className, allowsMultiple = false, ...props }, ref) => {\n const { classNames, cleanedProps } = useStyles('Accordion', props);\n\n return (\n <RADisclosureGroup\n ref={ref}\n allowsMultipleExpanded={allowsMultiple}\n className={clsx(classNames.group, styles[classNames.group], className)}\n {...cleanedProps}\n />\n );\n});\n\nAccordionGroup.displayName = 'AccordionGroup';\n"],"names":["RADisclosure","RAHeading","RAButton","RADisclosurePanel","RADisclosureGroup"],"mappings":";;;;;;;;;AAqCO,MAAM,SAAA,GAAY,WAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,KAAQ;AAClC,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,aAAa,KAAK,CAAA;AAEjE,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,SAAA,CAAU,WAAA,GAAc,WAAA;AAGjB,MAAM,gBAAA,GAAmB,UAAA,CAG9B,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,QAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,aAAa,KAAK,CAAA;AAEjE,EAAA,uBACE,GAAA;AAAA,IAACC,OAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACT,UAAA,CAAW,OAAA;AAAA,QACX,MAAA,CAAO,WAAW,OAAO,CAAA;AAAA,QACzB;AAAA,OACF;AAAA,MACC,GAAG,YAAA;AAAA,MAEJ,QAAA,kBAAA,IAAA;AAAA,QAACC,MAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,SAAA;AAAA,UACL,SAAA,EAAW,IAAA;AAAA,YACT,UAAA,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AAG,SAAS,CAAA;AAAA,MACpE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,cAAA,CAAe,WAAA,GAAc,gBAAA;AAGtB,MAAM,cAAA,GAAiB,UAAA,CAG5B,CAAC,EAAE,SAAA,EAAW,iBAAiB,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC1D,EAAA,MAAM,EAAE,UAAA,EAAY,YAAA,EAAa,GAAI,SAAA,CAAU,aAAa,KAAK,CAAA;AAEjE,EAAA,uBACE,GAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,sBAAA,EAAwB,cAAA;AAAA,MACxB,SAAA,EAAW,KAAK,UAAA,CAAW,KAAA,EAAO,OAAO,UAAA,CAAW,KAAK,GAAG,SAAS,CAAA;AAAA,MACpE,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AAED,cAAA,CAAe,WAAA,GAAc,gBAAA;;;;"}
@@ -0,0 +1,8 @@
1
+ import styleInject from '../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
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 .Accordion-module_bui-Accordion__wEbQl {\n width: 100%;\n background-color: var(--bui-bg-surface-1);\n border-radius: var(--bui-radius-3);\n padding: var(--bui-space-3);\n }\n\n .Accordion-module_bui-AccordionTrigger__1fPAs {\n all: unset;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .Accordion-module_bui-AccordionTriggerButton__3RF1r {\n all: unset;\n width: 100%;\n color: var(--bui-fg-primary);\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n text-align: left;\n\n &:focus-visible {\n outline: none;\n transition: none;\n box-shadow: inset 0 0 0 2px var(--bui-ring);\n }\n\n &[data-disabled='true'] {\n background-color: transparent;\n color: var(--bui-fg-disabled);\n cursor: not-allowed;\n }\n }\n\n .Accordion-module_bui-AccordionTriggerTitle__3DOpr {\n font-size: var(--bui-font-size-4);\n font-weight: var(--bui-font-weight-bold);\n line-height: 140%;\n }\n\n .Accordion-module_bui-AccordionTriggerSubtitle__jU446 {\n font-size: var(--bui-font-size-2);\n line-height: 140%;\n color: var(--bui-fg-secondary);\n }\n\n .Accordion-module_bui-AccordionTriggerIcon__1953s {\n transition: transform 150ms ease-out;\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n\n [data-expanded='true'] & {\n transform: rotate(180deg);\n }\n }\n\n .Accordion-module_bui-AccordionPanel__1bJFQ {\n [data-expanded='true'] & {\n padding-top: var(--bui-space-1);\n }\n }\n\n .Accordion-module_bui-AccordionGroup__3bll0 {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-3);\n width: 100%;\n }\n}\n";
4
+ var styles = {"bui-Accordion":"Accordion-module_bui-Accordion__wEbQl","bui-AccordionTrigger":"Accordion-module_bui-AccordionTrigger__1fPAs","bui-AccordionTriggerButton":"Accordion-module_bui-AccordionTriggerButton__3RF1r","bui-AccordionTriggerTitle":"Accordion-module_bui-AccordionTriggerTitle__3DOpr","bui-AccordionTriggerSubtitle":"Accordion-module_bui-AccordionTriggerSubtitle__jU446","bui-AccordionTriggerIcon":"Accordion-module_bui-AccordionTriggerIcon__1953s","bui-AccordionPanel":"Accordion-module_bui-AccordionPanel__1bJFQ","bui-AccordionGroup":"Accordion-module_bui-AccordionGroup__3bll0"};
5
+ styleInject(css_248z);
6
+
7
+ export { styles as default };
8
+ //# sourceMappingURL=Accordion.module.css.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -23,7 +23,8 @@ const Avatar = forwardRef((props, ref) => {
23
23
  img.onerror = null;
24
24
  };
25
25
  }, [src]);
26
- const initials = name.split(" ").map((word) => word[0]).join("").toLocaleUpperCase("en-US").slice(0, 2);
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);
27
28
  return /* @__PURE__ */ jsx(
28
29
  "div",
29
30
  {
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.esm.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useState, useEffect } from 'react';\nimport clsx from 'clsx';\nimport { AvatarProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './Avatar.module.css';\n\n/** @public */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const { classNames, dataAttributes, cleanedProps } = useStyles('Avatar', {\n size: 'medium',\n purpose: 'informative',\n ...props,\n });\n\n const { className, src, name, purpose, ...rest } = cleanedProps;\n\n const [imageStatus, setImageStatus] = useState<\n 'loading' | 'loaded' | 'error'\n >('loading');\n\n useEffect(() => {\n setImageStatus('loading');\n const img = new Image();\n img.onload = () => setImageStatus('loaded');\n img.onerror = () => setImageStatus('error');\n img.src = src;\n\n return () => {\n img.onload = null;\n img.onerror = null;\n };\n }, [src]);\n\n const initials = name\n .split(' ')\n .map(word => word[0])\n .join('')\n .toLocaleUpperCase('en-US')\n .slice(0, 2);\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={purpose === 'informative' ? name : undefined}\n aria-hidden={purpose === 'decoration' ? true : undefined}\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n {...rest}\n >\n {imageStatus === 'loaded' ? (\n <img\n src={src}\n alt=\"\"\n className={clsx(classNames.image, styles[classNames.image])}\n />\n ) : (\n <div\n aria-hidden=\"true\"\n className={clsx(classNames.fallback, styles[classNames.fallback])}\n >\n {initials}\n </div>\n )}\n </div>\n );\n});\n\nAvatar.displayName = 'Avatar';\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,QAAA;AAAA,IACN,OAAA,EAAS,aAAA;AAAA,IACT,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM,EAAE,SAAA,EAAW,GAAA,EAAK,MAAM,OAAA,EAAS,GAAG,MAAK,GAAI,YAAA;AAEnD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAEpC,SAAS,CAAA;AAEX,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,cAAA,CAAe,SAAS,CAAA;AACxB,IAAA,MAAM,GAAA,GAAM,IAAI,KAAA,EAAM;AACtB,IAAA,GAAA,CAAI,MAAA,GAAS,MAAM,cAAA,CAAe,QAAQ,CAAA;AAC1C,IAAA,GAAA,CAAI,OAAA,GAAU,MAAM,cAAA,CAAe,OAAO,CAAA;AAC1C,IAAA,GAAA,CAAI,GAAA,GAAM,GAAA;AAEV,IAAA,OAAO,MAAM;AACX,MAAA,GAAA,CAAI,MAAA,GAAS,IAAA;AACb,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ar.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>\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AA,CACzB,KAAA,CAAM,GAAG,aAAa,CAAA;AAEzB,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,IAAA,EAAK,KAAA;AAAA,MACL,YAAA,EAAY,OAAA,KAAY,aAAA,GAAgB,IAAA,GAAO,MAAA;AAAA,MAC/C,aAAA,EAAa,OAAA,KAAY,YAAA,GAAe,IAAA,GAAO,MAAA;AAAA,MAC/C,SAAA,EAAW,KAAK,UAAA,CAAW,IAAA,EAAM,OAAO,UAAA,CAAW,IAAI,GAAG,SAAS,CAAA;AAAA,MAClE,GAAG,cAAA;AAAA,MACH,GAAG,IAAA;AAAA,MAEH,0BAAgB,QAAA,mBACf,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,GAAA;AAAA,UACA,GAAA,EAAI,EAAA;AAAA,UACJ,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,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 .Popover-module_bui-Popover__100-n {\n margin-right: 12px;\n overflow: scroll;\n background-color: var(--bui-bg-surface-1);\n border: 1px solid var(--bui-border);\n border-radius: var(--bui-radius-3);\n padding-block: var(--bui-space-1);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\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 .Popover-module_bui-Popover__100-n {\n margin-right: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n background-color: var(--bui-bg-surface-1);\n border: 1px solid var(--bui-border);\n border-radius: var(--bui-radius-3);\n padding-block: var(--bui-space-1);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n }\n}\n";
4
4
  var stylesPopover = {"bui-Popover":"Popover-module_bui-Popover__100-n"};
5
5
  styleInject(css_248z);
6
6
 
@@ -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 .RadioGroup-module_bui-RadioGroup__v70Qu {\n display: flex;\n flex-direction: column;\n color: var(--bui-fg-primary);\n }\n\n .RadioGroup-module_bui-RadioGroup__v70Qu[data-orientation='horizontal'] .RadioGroup-module_bui-RadioGroupContent__1rG0a {\n flex-direction: row;\n gap: var(--bui-space-4);\n }\n\n .RadioGroup-module_bui-RadioGroupContent__1rG0a {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-2);\n }\n\n .RadioGroup-module_bui-Radio__1769d {\n display: flex;\n /* This is needed so the HiddenInput is positioned correctly */\n position: relative;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-primary);\n forced-color-adjust: none;\n\n &:before {\n content: '';\n display: block;\n width: 1rem;\n height: 1rem;\n box-sizing: border-box;\n border: 0.125rem solid var(--bui-border);\n background: var(--bui-gray-1);\n border-radius: var(--bui-radius-full);\n transition: all 200ms;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-border);\n }\n\n &[data-selected] {\n &:before {\n border-color: var(--bui-bg-solid);\n border-width: 0.25rem;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-bg-solid);\n }\n }\n\n &[data-focus-visible]:before {\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n\n &:before {\n border-color: var(--bui-border-disabled);\n background: var(--bui-bg-disabled);\n }\n\n &[data-selected]:before {\n border-color: var(--bui-border-disabled);\n }\n }\n\n &[data-invalid]:before {\n border-color: var(--bui-border-danger);\n }\n\n &[data-invalid][data-selected]:before {\n border-color: var(--bui-border-danger);\n }\n\n /* Ensure disabled state prevails over invalid state */\n &[data-disabled][data-invalid] {\n color: var(--bui-fg-disabled);\n\n &:before {\n border-color: var(--bui-border-disabled);\n background: var(--bui-bg-disabled);\n }\n\n &[data-selected]:before {\n border-color: var(--bui-border-disabled);\n }\n }\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 .RadioGroup-module_bui-RadioGroup__v70Qu {\n display: flex;\n flex-direction: column;\n color: var(--bui-fg-primary);\n }\n\n .RadioGroup-module_bui-RadioGroup__v70Qu[data-orientation='horizontal'] .RadioGroup-module_bui-RadioGroupContent__1rG0a {\n flex-direction: row;\n gap: var(--bui-space-4);\n }\n\n .RadioGroup-module_bui-RadioGroupContent__1rG0a {\n display: flex;\n flex-direction: column;\n gap: var(--bui-space-2);\n }\n\n .RadioGroup-module_bui-Radio__1769d {\n display: flex;\n /* This is needed so the HiddenInput is positioned correctly */\n position: relative;\n align-items: center;\n gap: var(--bui-space-2);\n font-size: var(--bui-font-size-2);\n color: var(--bui-fg-primary);\n forced-color-adjust: none;\n\n &:before {\n content: '';\n display: block;\n width: 1rem;\n height: 1rem;\n box-sizing: border-box;\n border: 0.125rem solid var(--bui-border);\n background: var(--bui-gray-1);\n border-radius: var(--bui-radius-full);\n transition: all 200ms;\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-border);\n }\n\n &[data-selected] {\n &:before {\n border-color: var(--bui-bg-solid);\n border-width: 0.25rem;\n }\n\n &[data-pressed]:before {\n border-color: var(--bui-bg-solid);\n }\n }\n\n &[data-focus-visible]:before {\n outline: 2px solid var(--bui-ring);\n outline-offset: 2px;\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n\n &:before {\n border-color: var(--bui-border-disabled);\n background: var(--bui-bg-disabled);\n }\n\n &[data-selected]:before {\n border-color: var(--bui-border-disabled);\n }\n }\n\n &[data-invalid]:before {\n border-color: var(--bui-border-danger);\n }\n\n &[data-invalid][data-selected]:before {\n border-color: var(--bui-border-danger);\n }\n\n /* Ensure disabled state prevails over invalid state */\n &[data-disabled][data-invalid] {\n color: var(--bui-fg-disabled);\n\n &:before {\n border-color: var(--bui-border-disabled);\n background: var(--bui-bg-disabled);\n }\n\n &[data-selected]:before {\n border-color: var(--bui-border-disabled);\n }\n }\n }\n}\n";
4
4
  var styles = {"bui-RadioGroup":"RadioGroup-module_bui-RadioGroup__v70Qu","bui-RadioGroupContent":"RadioGroup-module_bui-RadioGroupContent__1rG0a","bui-Radio":"RadioGroup-module_bui-Radio__1769d"};
5
5
  styleInject(css_248z);
6
6
 
@@ -6,8 +6,7 @@ import { FieldLabel } from '../FieldLabel/FieldLabel.esm.js';
6
6
  import { FieldError } from '../FieldError/FieldError.esm.js';
7
7
  import { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';
8
8
  import { useStyles } from '../../hooks/useStyles.esm.js';
9
- import stylesSearchField from './SearchField.module.css.esm.js';
10
- import stylesTextField from '../TextField/TextField.module.css.esm.js';
9
+ import styles from './SearchField.module.css.esm.js';
11
10
 
12
11
  const SearchField = forwardRef(
13
12
  (props, ref) => {
@@ -25,18 +24,15 @@ const SearchField = forwardRef(
25
24
  );
26
25
  }
27
26
  }, [label, ariaLabel, ariaLabelledBy]);
28
- const { classNames: textFieldClassNames } = useStyles("TextField");
29
- const {
30
- classNames: searchFieldClassNames,
31
- dataAttributes,
32
- style,
33
- cleanedProps
34
- } = useStyles("SearchField", {
35
- size: "small",
36
- placeholder: "Search",
37
- startCollapsed: false,
38
- ...props
39
- });
27
+ const { classNames, dataAttributes, style, cleanedProps } = useStyles(
28
+ "SearchField",
29
+ {
30
+ size: "small",
31
+ placeholder: "Search",
32
+ startCollapsed: false,
33
+ ...props
34
+ }
35
+ );
40
36
  const {
41
37
  className,
42
38
  description,
@@ -69,13 +65,7 @@ const SearchField = forwardRef(
69
65
  return /* @__PURE__ */ jsxs(
70
66
  SearchField$1,
71
67
  {
72
- className: clsx(
73
- textFieldClassNames.root,
74
- searchFieldClassNames.root,
75
- stylesTextField[textFieldClassNames.root],
76
- stylesSearchField[searchFieldClassNames.root],
77
- className
78
- ),
68
+ className: clsx(classNames.root, styles[classNames.root], className),
79
69
  ...dataAttributes,
80
70
  "aria-label": ariaLabel,
81
71
  "aria-labelledby": ariaLabelledBy,
@@ -98,8 +88,8 @@ const SearchField = forwardRef(
98
88
  "div",
99
89
  {
100
90
  className: clsx(
101
- textFieldClassNames.inputWrapper,
102
- stylesTextField[textFieldClassNames.inputWrapper]
91
+ classNames.inputWrapper,
92
+ styles[classNames.inputWrapper]
103
93
  ),
104
94
  "data-size": dataAttributes["data-size"],
105
95
  children: [
@@ -107,8 +97,8 @@ const SearchField = forwardRef(
107
97
  "div",
108
98
  {
109
99
  className: clsx(
110
- textFieldClassNames.inputIcon,
111
- stylesTextField[textFieldClassNames.inputIcon]
100
+ classNames.inputIcon,
101
+ styles[classNames.inputIcon]
112
102
  ),
113
103
  "data-size": dataAttributes["data-size"],
114
104
  "aria-hidden": "true",
@@ -118,10 +108,7 @@ const SearchField = forwardRef(
118
108
  /* @__PURE__ */ jsx(
119
109
  Input,
120
110
  {
121
- className: clsx(
122
- textFieldClassNames.input,
123
- stylesTextField[textFieldClassNames.input]
124
- ),
111
+ className: clsx(classNames.input, styles[classNames.input]),
125
112
  ...icon !== false && { "data-icon": true },
126
113
  placeholder
127
114
  }
@@ -129,10 +116,7 @@ const SearchField = forwardRef(
129
116
  /* @__PURE__ */ jsx(
130
117
  Button,
131
118
  {
132
- className: clsx(
133
- searchFieldClassNames.clear,
134
- stylesSearchField[searchFieldClassNames.clear]
135
- ),
119
+ className: clsx(classNames.clear, styles[classNames.clear]),
136
120
  "data-size": dataAttributes["data-size"],
137
121
  children: /* @__PURE__ */ jsx(RiCloseCircleLine, {})
138
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SearchField.esm.js","sources":["../../../src/components/SearchField/SearchField.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, useEffect, useState } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useStyles } from '../../hooks/useStyles';\nimport stylesSearchField from './SearchField.module.css';\nimport stylesTextField from '../TextField/TextField.module.css';\n\nimport type { SearchFieldProps } from './types';\n\n/** @public */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const {\n label,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n } = props;\n\n const [isCollapsed, setIsCollapsed] = useState(false);\n const [shouldCollapse, setShouldCollapse] = useState(true);\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const { classNames: textFieldClassNames } = useStyles('TextField');\n\n const {\n classNames: searchFieldClassNames,\n dataAttributes,\n style,\n cleanedProps,\n } = useStyles('SearchField', {\n size: 'small',\n placeholder: 'Search',\n startCollapsed: false,\n ...props,\n });\n\n const {\n className,\n description,\n icon,\n isRequired,\n secondaryLabel,\n placeholder,\n startCollapsed,\n ...rest\n } = cleanedProps;\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n const handleClick = (isFocused: boolean) => {\n props.onFocusChange?.(isFocused);\n if (shouldCollapse) {\n if (isFocused) {\n setIsCollapsed(true);\n } else {\n setIsCollapsed(false);\n }\n }\n };\n\n const handleChange = (value: string) => {\n props.onChange?.(value);\n if (value.length > 0) {\n setShouldCollapse(false);\n } else {\n setShouldCollapse(true);\n }\n };\n\n return (\n <AriaSearchField\n className={clsx(\n textFieldClassNames.root,\n searchFieldClassNames.root,\n stylesTextField[textFieldClassNames.root],\n stylesSearchField[searchFieldClassNames.root],\n className,\n )}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-collapsed={isCollapsed}\n onFocusChange={handleClick}\n onChange={handleChange}\n style={style}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={clsx(\n textFieldClassNames.inputWrapper,\n stylesTextField[textFieldClassNames.inputWrapper],\n )}\n data-size={dataAttributes['data-size']}\n >\n {icon !== false && (\n <div\n className={clsx(\n textFieldClassNames.inputIcon,\n stylesTextField[textFieldClassNames.inputIcon],\n )}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n className={clsx(\n textFieldClassNames.input,\n stylesTextField[textFieldClassNames.input],\n )}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={clsx(\n searchFieldClassNames.clear,\n stylesSearchField[searchFieldClassNames.clear],\n )}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["AriaSearchField"],"mappings":";;;;;;;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yright 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, useEffect, useState } from 'react';\nimport {\n Input,\n SearchField as AriaSearchField,\n Button,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { RiSearch2Line, RiCloseCircleLine } from '@remixicon/react';\nimport { useStyles } from '../../hooks/useStyles';\nimport styles from './SearchField.module.css';\n\nimport type { SearchFieldProps } from './types';\n\n/** @public */\nexport const SearchField = forwardRef<HTMLDivElement, SearchFieldProps>(\n (props, ref) => {\n const {\n label,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n } = props;\n\n const [isCollapsed, setIsCollapsed] = useState(false);\n const [shouldCollapse, setShouldCollapse] = useState(true);\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'SearchField requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const { classNames, dataAttributes, style, cleanedProps } = useStyles(\n 'SearchField',\n {\n size: 'small',\n placeholder: 'Search',\n startCollapsed: false,\n ...props,\n },\n );\n\n const {\n className,\n description,\n icon,\n isRequired,\n secondaryLabel,\n placeholder,\n startCollapsed,\n ...rest\n } = cleanedProps;\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText =\n secondaryLabel || (isRequired ? 'Required' : null);\n\n const handleClick = (isFocused: boolean) => {\n props.onFocusChange?.(isFocused);\n if (shouldCollapse) {\n if (isFocused) {\n setIsCollapsed(true);\n } else {\n setIsCollapsed(false);\n }\n }\n };\n\n const handleChange = (value: string) => {\n props.onChange?.(value);\n if (value.length > 0) {\n setShouldCollapse(false);\n } else {\n setShouldCollapse(true);\n }\n };\n\n return (\n <AriaSearchField\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-collapsed={isCollapsed}\n onFocusChange={handleClick}\n onChange={handleChange}\n style={style}\n {...rest}\n ref={ref}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <div\n className={clsx(\n classNames.inputWrapper,\n styles[classNames.inputWrapper],\n )}\n data-size={dataAttributes['data-size']}\n >\n {icon !== false && (\n <div\n className={clsx(\n classNames.inputIcon,\n styles[classNames.inputIcon],\n )}\n data-size={dataAttributes['data-size']}\n aria-hidden=\"true\"\n >\n {icon || <RiSearch2Line />}\n </div>\n )}\n <Input\n className={clsx(classNames.input, styles[classNames.input])}\n {...(icon !== false && { 'data-icon': true })}\n placeholder={placeholder}\n />\n <Button\n className={clsx(classNames.clear, styles[classNames.clear])}\n data-size={dataAttributes['data-size']}\n >\n <RiCloseCircleLine />\n </Button>\n </div>\n <FieldError />\n </AriaSearchField>\n );\n },\n);\n\nSearchField.displayName = 'searchField';\n"],"names":["AriaSearchField"],"mappings":";;;;;;;;;;AAgCO,MAAM,WAAA,GAAc,UAAA;AAAA,EACzB,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,KAAA;AAAA,MACA,YAAA,EAAc,SAAA;AAAA,MACd,iBAAA,EAAmB;AAAA,KACrB,GAAI,KAAA;AAEJ,IAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA;AACpD,IAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAS,IAAI,CAAA;AAEzD,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,CAAC,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,CAAA;AAAA,oBACzD,GAAI,IAAA,KAAS,KAAA,IAAS,EAAE,aAAa,IAAA,EAAK;AAAA,oBAC3C;AAAA;AAAA,iBACF;AAAA,gCACA,GAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,WAAW,IAAA,CAAK,UAAA,CAAW,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAC,CAAA;AAAA,oBAC1D,WAAA,EAAW,eAAe,WAAW,CAAA;AAAA,oBAErC,8BAAC,iBAAA,EAAA,EAAkB;AAAA;AAAA;AACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW;AAAA;AAAA;AAAA,KACd;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;"}
@@ -1,8 +1,8 @@
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 .SearchField-module_bui-SearchField__2TyT_ {\n flex: 1;\n flex-shrink: 0;\n\n &[data-empty] {\n .SearchField-module_bui-InputClear__JCu80 {\n display: none;\n }\n }\n\n &[data-startCollapsed='true'] {\n transition: flex-basis 0.3s ease-in-out;\n padding: 0;\n flex: 0 1 auto;\n\n &[data-collapsed='true'] {\n flex-basis: 200px;\n }\n\n &[data-collapsed='false'] {\n cursor: pointer;\n\n &[data-size='medium'] {\n flex-basis: 2.5rem;\n height: 2.5rem;\n }\n\n &[data-size='small'] {\n flex-basis: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] .SearchField-module_bui-Input__FcOCK {\n &::placeholder {\n opacity: 0;\n }\n }\n\n &[data-size='small'] .SearchField-module_bui-Input__FcOCK {\n &::placeholder {\n opacity: 0;\n }\n }\n\n .SearchField-module_bui-InputWrapper__2WERV {\n .SearchField-module_bui-Input__FcOCK[data-icon] {\n padding-right: 0px;\n }\n }\n }\n }\n }\n\n .SearchField-module_bui-SearchField__2TyT_ .SearchField-module_bui-Input__FcOCK {\n transition: padding 0.3s ease-in-out, border-color 0.2s ease-in-out,\n outline-color 0.2s ease-in-out;\n\n &[data-hovered] {\n border-color: var(--bui-border-hover);\n }\n\n &[data-focused] {\n border-color: var(--bui-border-pressed);\n outline-width: 0px;\n }\n }\n\n .SearchField-module_bui-SearchField__2TyT_ .SearchField-module_bui-InputWrapper__2WERV {\n .SearchField-module_bui-Input__FcOCK[data-icon] {\n padding-right: var(--bui-space-6);\n }\n }\n\n .SearchField-module_bui-SearchField__2TyT_ .SearchField-module_bui-InputIcon__37FbR {\n left: 0;\n display: flex;\n justify-content: center;\n\n &[data-size='small'] {\n width: var(--bui-space-8);\n }\n\n &[data-size='medium'] {\n width: var(--bui-space-10);\n }\n }\n\n .SearchField-module_bui-InputClear__JCu80 {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n color: var(--bui-fg-secondary);\n transition: color 0.2s ease-in-out;\n }\n\n .SearchField-module_bui-InputClear__JCu80:hover {\n color: var(--bui-fg-primary);\n }\n\n .SearchField-module_bui-InputClear__JCu80[data-size='small'] {\n width: 2rem;\n height: 2rem;\n }\n\n .SearchField-module_bui-InputClear__JCu80[data-size='medium'] {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n .SearchField-module_bui-InputClear__JCu80 svg {\n width: 1rem;\n height: 1rem;\n }\n}\n";
4
- var stylesSearchField = {"bui-SearchField":"SearchField-module_bui-SearchField__2TyT_","bui-InputClear":"SearchField-module_bui-InputClear__JCu80","bui-Input":"SearchField-module_bui-Input__FcOCK","bui-InputWrapper":"SearchField-module_bui-InputWrapper__2WERV","bui-InputIcon":"SearchField-module_bui-InputIcon__37FbR"};
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 .SearchField-module_bui-SearchField__2TyT_ {\n display: flex;\n flex-direction: column;\n font-family: var(--bui-font-regular);\n width: 100%;\n flex: 1;\n flex-shrink: 0;\n\n &[data-empty] {\n .SearchField-module_bui-SearchFieldClear__1gJQc {\n display: none;\n }\n }\n\n &[data-startCollapsed='true'] {\n transition: flex-basis 0.3s ease-in-out;\n padding: 0;\n flex: 0 1 auto;\n\n &[data-collapsed='true'] {\n flex-basis: 200px;\n }\n\n &[data-collapsed='false'] {\n cursor: pointer;\n\n &[data-size='medium'] {\n flex-basis: 2.5rem;\n height: 2.5rem;\n }\n\n &[data-size='small'] {\n flex-basis: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] .SearchField-module_bui-SearchFieldInput__3Opoj {\n &::placeholder {\n opacity: 0;\n }\n }\n\n &[data-size='small'] .SearchField-module_bui-SearchFieldInput__3Opoj {\n &::placeholder {\n opacity: 0;\n }\n }\n\n .SearchField-module_bui-SearchFieldWrapper__37bMg {\n .SearchField-module_bui-SearchFieldInput__3Opoj[data-icon] {\n padding-right: 0px;\n }\n }\n }\n }\n }\n\n .SearchField-module_bui-SearchFieldWrapper__37bMg {\n position: relative;\n\n .SearchField-module_bui-SearchFieldInput__3Opoj[data-icon] {\n padding-right: var(--bui-space-6);\n }\n\n &[data-size='small'] .SearchField-module_bui-SearchFieldInput__3Opoj {\n height: 2rem;\n }\n\n &[data-size='medium'] .SearchField-module_bui-SearchFieldInput__3Opoj {\n height: 2.5rem;\n }\n\n &[data-size='small'] .SearchField-module_bui-SearchFieldInput__3Opoj[data-icon] {\n padding-left: var(--bui-space-8);\n }\n\n &[data-size='medium'] .SearchField-module_bui-SearchFieldInput__3Opoj[data-icon] {\n padding-left: var(--bui-space-9);\n }\n }\n\n .SearchField-module_bui-SearchFieldInputIcon__EA0t9 {\n position: absolute;\n display: flex;\n justify-content: center;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--bui-space-1);\n color: var(--bui-fg-primary);\n pointer-events: none;\n /* To animate the icon when the input is collapsed */\n transition: left 0.2s ease-in-out;\n\n &[data-size='small'] {\n width: 2rem;\n }\n\n &[data-size='medium'] {\n width: 2.5rem;\n }\n\n &[data-size='small'] svg {\n width: 1rem;\n height: 1rem;\n }\n\n &[data-size='medium'] svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n }\n\n .SearchField-module_bui-SearchFieldInput__3Opoj {\n display: flex;\n align-items: center;\n padding: 0 var(--bui-space-3);\n border-radius: var(--bui-radius-2);\n border: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\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 transition: padding 0.3s ease-in-out, border-color 0.2s ease-in-out,\n outline-color 0.2s ease-in-out;\n width: 100%;\n height: 100%;\n cursor: inherit;\n\n &::-webkit-search-cancel-button,\n &::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n &[data-focused] {\n outline-color: var(--bui-border-pressed);\n outline-width: 0px;\n }\n\n &[data-hovered] {\n border-color: var(--bui-border-hover);\n }\n\n &[data-focused] {\n border-color: var(--bui-border-pressed);\n outline-width: 0px;\n }\n\n &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n\n &[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n border: 1px solid var(--bui-border-disabled);\n }\n }\n\n .SearchField-module_bui-SearchFieldClear__1gJQc {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: transparent;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n color: var(--bui-fg-secondary);\n transition: color 0.2s ease-in-out;\n\n &:hover {\n color: var(--bui-fg-primary);\n }\n\n &[data-size='small'] {\n width: 2rem;\n height: 2rem;\n }\n\n &[data-size='medium'] {\n width: 2.5rem;\n height: 2.5rem;\n }\n\n & svg {\n width: 1rem;\n height: 1rem;\n }\n }\n}\n";
4
+ var styles = {"bui-SearchField":"SearchField-module_bui-SearchField__2TyT_","bui-SearchFieldClear":"SearchField-module_bui-SearchFieldClear__1gJQc","bui-SearchFieldInput":"SearchField-module_bui-SearchFieldInput__3Opoj","bui-SearchFieldWrapper":"SearchField-module_bui-SearchFieldWrapper__37bMg","bui-SearchFieldInputIcon":"SearchField-module_bui-SearchFieldInputIcon__EA0t9"};
5
5
  styleInject(css_248z);
6
6
 
7
- export { stylesSearchField as default };
7
+ export { styles as default };
8
8
  //# sourceMappingURL=SearchField.module.css.esm.js.map
@@ -80,7 +80,9 @@ const Select = forwardRef((props, ref) => {
80
80
  {
81
81
  className: clsx(
82
82
  popoverClassNames.root,
83
- stylesPopover[popoverClassNames.root]
83
+ stylesPopover[popoverClassNames.root],
84
+ classNames.popover,
85
+ styles[classNames.popover]
84
86
  ),
85
87
  children: /* @__PURE__ */ jsx(ListBox, { className: clsx(classNames.list, styles[classNames.list]), children: options?.map((option) => /* @__PURE__ */ jsxs(
86
88
  ListBoxItem,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.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, useEffect } from 'react';\nimport {\n Select as AriaSelect,\n SelectValue,\n Button,\n Popover,\n ListBox,\n ListBoxItem,\n Text,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { SelectProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport styles from './Select.module.css';\nimport stylesPopover from '../Popover/Popover.module.css';\nimport { RiArrowDownSLine, RiCheckLine } from '@remixicon/react';\n\n/** @public */\nexport const Select = forwardRef<HTMLDivElement, SelectProps>((props, ref) => {\n const { classNames: popoverClassNames } = useStyles('Popover');\n const { classNames, dataAttributes, cleanedProps } = useStyles('Select', {\n size: 'small',\n placeholder: 'Select an option',\n ...props,\n });\n\n const {\n className,\n label,\n description,\n options,\n placeholder,\n size,\n icon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n isRequired,\n secondaryLabel,\n style,\n ...rest\n } = cleanedProps;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaSelect\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...rest}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <Button\n className={clsx(classNames.trigger, styles[classNames.trigger])}\n data-size={dataAttributes['data-size']}\n >\n {icon}\n <SelectValue\n className={clsx(classNames.value, styles[classNames.value])}\n />\n <RiArrowDownSLine aria-hidden=\"true\" />\n </Button>\n <FieldError />\n <Popover\n className={clsx(\n popoverClassNames.root,\n stylesPopover[popoverClassNames.root],\n )}\n >\n <ListBox className={clsx(classNames.list, styles[classNames.list])}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n className={clsx(classNames.item, styles[classNames.item])}\n >\n <div\n className={clsx(\n classNames.itemIndicator,\n styles[classNames.itemIndicator],\n )}\n >\n <RiCheckLine />\n </div>\n <Text\n slot=\"label\"\n className={clsx(\n classNames.itemLabel,\n styles[classNames.itemLabel],\n )}\n >\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;AAoCO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,iBAAA,EAAkB,GAAI,UAAU,SAAS,CAAA;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,OAAA;AAAA,IACN,WAAA,EAAa,kBAAA;AAAA,IACb,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,cAAA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c,QAAA;;;;"}
1
+ {"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.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, useEffect } from 'react';\nimport {\n Select as AriaSelect,\n SelectValue,\n Button,\n Popover,\n ListBox,\n ListBoxItem,\n Text,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { SelectProps } from './types';\nimport { useStyles } from '../../hooks/useStyles';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport styles from './Select.module.css';\nimport stylesPopover from '../Popover/Popover.module.css';\nimport { RiArrowDownSLine, RiCheckLine } from '@remixicon/react';\n\n/** @public */\nexport const Select = forwardRef<HTMLDivElement, SelectProps>((props, ref) => {\n const { classNames: popoverClassNames } = useStyles('Popover');\n const { classNames, dataAttributes, cleanedProps } = useStyles('Select', {\n size: 'small',\n placeholder: 'Select an option',\n ...props,\n });\n\n const {\n className,\n label,\n description,\n options,\n placeholder,\n size,\n icon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n isRequired,\n secondaryLabel,\n style,\n ...rest\n } = cleanedProps;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n // If a secondary label is provided, use it. Otherwise, use 'Required' if the field is required.\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n\n return (\n <AriaSelect\n className={clsx(classNames.root, styles[classNames.root], className)}\n {...dataAttributes}\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...rest}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <Button\n className={clsx(classNames.trigger, styles[classNames.trigger])}\n data-size={dataAttributes['data-size']}\n >\n {icon}\n <SelectValue\n className={clsx(classNames.value, styles[classNames.value])}\n />\n <RiArrowDownSLine aria-hidden=\"true\" />\n </Button>\n <FieldError />\n <Popover\n className={clsx(\n popoverClassNames.root,\n stylesPopover[popoverClassNames.root],\n classNames.popover,\n styles[classNames.popover],\n )}\n >\n <ListBox className={clsx(classNames.list, styles[classNames.list])}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n className={clsx(classNames.item, styles[classNames.item])}\n >\n <div\n className={clsx(\n classNames.itemIndicator,\n styles[classNames.itemIndicator],\n )}\n >\n <RiCheckLine />\n </div>\n <Text\n slot=\"label\"\n className={clsx(\n classNames.itemLabel,\n styles[classNames.itemLabel],\n )}\n >\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;AAoCO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAY,iBAAA,EAAkB,GAAI,UAAU,SAAS,CAAA;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAgB,YAAA,EAAa,GAAI,UAAU,QAAA,EAAU;AAAA,IACvE,IAAA,EAAM,OAAA;AAAA,IACN,WAAA,EAAa,kBAAA;AAAA,IACb,GAAG;AAAA,GACJ,CAAA;AAED,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA;AAAA,I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,QAAA,EAAA,MAAA,CAAO;AAAA;AAAA;AACV;AAAA,eAAA;AAAA,cApBK,MAAA,CAAO;AAAA,aAsBf,CAAA,EACH;AAAA;AAAA;AACF;AAAA;AAAA,GACF;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
@@ -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 .Select-module_bui-Select__LDZ15[data-invalid] {\n & .Select-module_bui-SelectTrigger__3kJBt {\n border-color: var(--bui-fg-danger);\n }\n }\n\n .Select-module_bui-SelectTrigger__3kJBt {\n box-sizing: border-box;\n border-radius: var(--bui-radius-3);\n border: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n gap: var(--bui-space-2);\n width: 100%;\n\n & svg {\n flex-shrink: 0;\n color: var(--bui-fg-secondary);\n }\n\n &[data-size='small'] {\n height: 2rem;\n padding-inline: var(--bui-space-3);\n }\n\n &[data-size='medium'] {\n height: 3rem;\n padding-inline: var(--bui-space-4);\n }\n\n &[data-size='small'] svg {\n width: 1rem;\n height: 1rem;\n }\n\n &[data-size='medium'] svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n &:hover {\n transition: border-color 0.2s ease-in-out, outline-color 0.2s ease-in-out;\n border-color: var(--bui-border-hover);\n }\n\n &:focus-visible {\n border-color: var(--bui-border-pressed);\n outline: 0;\n }\n\n &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n &[data-invalid]:hover {\n border-width: 2px;\n }\n\n &[data-invalid]:focus-visible {\n border-width: 2px;\n }\n\n &[disabled] {\n cursor: not-allowed;\n border-color: var(--bui-border-disabled);\n color: var(--bui-fg-disabled);\n }\n\n &[disabled] .Select-module_bui-SelectValue__jdoc- {\n color: var(--bui-fg-disabled);\n }\n\n &[data-popup-open] .Select-module_bui-SelectIcon__e97yW {\n transform: rotate(180deg);\n }\n }\n\n .Select-module_bui-SelectValue__jdoc- {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\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 text-align: left;\n\n & .Select-module_bui-SelectItemIndicator__1y7zW {\n display: none;\n }\n\n &[disabled] {\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select-module_bui-SelectItem__145pz {\n position: relative;\n width: var(--anchor-width);\n display: grid;\n grid-template-areas: 'icon text';\n grid-template-columns: 1rem 1fr;\n align-items: center;\n padding-block: var(--bui-space-2);\n padding-left: var(--bui-space-3);\n padding-right: var(--bui-space-4);\n color: var(--bui-fg-primary);\n border-radius: var(--bui-radius-3);\n cursor: pointer;\n user-select: none;\n font-size: var(--bui-font-size-3);\n gap: var(--bui-space-1);\n outline: none;\n\n &[data-focused] {\n z-index: 0;\n position: relative;\n color: var(--bui-fg-primary);\n }\n\n &[data-focused]::before {\n content: '';\n z-index: -1;\n position: absolute;\n inset-block: 0;\n inset-inline: 0.25rem;\n border-radius: 0.25rem;\n background-color: var(--bui-bg-tint-hover);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n &[data-selected] .Select-module_bui-SelectItemIndicator__1y7zW {\n opacity: 1;\n }\n }\n\n .Select-module_bui-SelectItemIndicator__1y7zW {\n grid-area: icon;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n }\n\n .Select-module_bui-SelectItemLabel__1N_y- {\n flex: 1;\n grid-area: text;\n }\n}\n";
4
- var styles = {"bui-Select":"Select-module_bui-Select__LDZ15","bui-SelectTrigger":"Select-module_bui-SelectTrigger__3kJBt","bui-SelectValue":"Select-module_bui-SelectValue__jdoc-","bui-SelectIcon":"Select-module_bui-SelectIcon__e97yW","bui-SelectItemIndicator":"Select-module_bui-SelectItemIndicator__1y7zW","bui-SelectItem":"Select-module_bui-SelectItem__145pz","bui-SelectItemLabel":"Select-module_bui-SelectItemLabel__1N_y-"};
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 .Select-module_bui-SelectPopover__1vFLn {\n min-width: var(--trigger-width);\n }\n\n .Select-module_bui-SelectTrigger__3kJBt {\n box-sizing: border-box;\n border-radius: var(--bui-radius-3);\n border: 1px solid var(--bui-border);\n background-color: var(--bui-bg-surface-1);\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n gap: var(--bui-space-2);\n width: 100%;\n\n & svg {\n flex-shrink: 0;\n color: var(--bui-fg-secondary);\n }\n\n &[data-size='small'] {\n height: 2rem;\n padding-inline: var(--bui-space-3);\n }\n\n &[data-size='medium'] {\n height: 3rem;\n padding-inline: var(--bui-space-4);\n }\n\n &[data-size='small'] svg {\n width: 1rem;\n height: 1rem;\n }\n\n &[data-size='medium'] svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n &::placeholder {\n color: var(--bui-fg-secondary);\n }\n\n &:hover {\n transition: border-color 0.2s ease-in-out, outline-color 0.2s ease-in-out;\n border-color: var(--bui-border-hover);\n }\n\n &:focus-visible {\n border-color: var(--bui-border-pressed);\n outline: 0;\n }\n\n .Select-module_bui-Select__LDZ15[data-invalid] &,\n &[data-invalid] {\n border-color: var(--bui-fg-danger);\n }\n &[data-invalid]:hover {\n border-width: 2px;\n }\n\n &[data-invalid]:focus-visible {\n border-width: 2px;\n }\n\n &[disabled] {\n cursor: not-allowed;\n border-color: var(--bui-border-disabled);\n color: var(--bui-fg-disabled);\n }\n\n &[disabled] .Select-module_bui-SelectValue__jdoc- {\n color: var(--bui-fg-disabled);\n }\n\n &[data-popup-open] .Select-module_bui-SelectIcon__e97yW {\n transform: rotate(180deg);\n }\n }\n\n .Select-module_bui-SelectValue__jdoc- {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\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 text-align: left;\n\n & .Select-module_bui-SelectItemIndicator__1y7zW {\n display: none;\n }\n\n &[disabled] {\n color: var(--bui-fg-disabled);\n }\n }\n\n .Select-module_bui-SelectList__2Cgmr:focus-visible {\n /* Remove default focus-visible outline because React Aria\n * triggers it on mouse click open of the list for some reason.\n * On keyboard use, the top item receives the focus style,\n * so it's not needed anyway. */\n outline: none;\n }\n\n .Select-module_bui-SelectItem__145pz {\n position: relative;\n width: var(--anchor-width);\n display: grid;\n grid-template-areas: 'icon text';\n grid-template-columns: 1rem 1fr;\n align-items: center;\n padding-block: var(--bui-space-2);\n padding-left: var(--bui-space-3);\n padding-right: var(--bui-space-4);\n color: var(--bui-fg-primary);\n border-radius: var(--bui-radius-3);\n cursor: pointer;\n user-select: none;\n font-size: var(--bui-font-size-3);\n gap: var(--bui-space-1);\n outline: none;\n\n &[data-focused] {\n z-index: 0;\n position: relative;\n color: var(--bui-fg-primary);\n }\n\n &[data-focused]::before {\n content: '';\n z-index: -1;\n position: absolute;\n inset-block: 0;\n inset-inline: 0.25rem;\n border-radius: 0.25rem;\n background-color: var(--bui-bg-tint-hover);\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n color: var(--bui-fg-disabled);\n }\n\n &[data-selected] .Select-module_bui-SelectItemIndicator__1y7zW {\n opacity: 1;\n }\n }\n\n .Select-module_bui-SelectItemIndicator__1y7zW {\n grid-area: icon;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n }\n\n .Select-module_bui-SelectItemLabel__1N_y- {\n flex: 1;\n grid-area: text;\n }\n}\n";
4
+ var styles = {"bui-SelectPopover":"Select-module_bui-SelectPopover__1vFLn","bui-SelectTrigger":"Select-module_bui-SelectTrigger__3kJBt","bui-Select":"Select-module_bui-Select__LDZ15","bui-SelectValue":"Select-module_bui-SelectValue__jdoc-","bui-SelectIcon":"Select-module_bui-SelectIcon__e97yW","bui-SelectItemIndicator":"Select-module_bui-SelectItemIndicator__1y7zW","bui-SelectList":"Select-module_bui-SelectList__2Cgmr","bui-SelectItem":"Select-module_bui-SelectItem__145pz","bui-SelectItemLabel":"Select-module_bui-SelectItemLabel__1N_y-"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { styles as default };