@backstage/ui 0.0.0-nightly-20250819024000 → 0.0.0-nightly-20250904023803
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# @backstage/ui
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20250904023803
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7307930: Add missing class for flex: baseline
|
|
8
|
+
- 89da341: Fix Select component to properly attach aria-label and aria-labelledby props to the rendered element for improved accessibility.
|
|
9
|
+
|
|
10
|
+
## 0.7.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
6
13
|
|
package/css/styles.css
CHANGED
|
@@ -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 { Icon } from '../Icon';\nimport { FieldError } from '../FieldError';\n\n/** @public */\nexport const Select = forwardRef<HTMLDivElement, SelectProps>((props, ref) => {\n const {\n className,\n label,\n description,\n options,\n placeholder = 'Select an option',\n size = 'small',\n icon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n isRequired,\n secondaryLabel,\n style,\n ...rest\n } = props;\n\n const { classNames: popoverClassNames } = useStyles('Popover');\n const { classNames, dataAttributes } = useStyles('Select', {\n size,\n });\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, className)}\n {...dataAttributes}\n ref={ref}\n {...rest}\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n />\n <Button\n className={classNames.trigger}\n data-size={dataAttributes['data-size']}\n >\n {icon}\n <SelectValue className={classNames.value} />\n <Icon aria-hidden=\"true\" name=\"chevron-down\" />\n </Button>\n <FieldError />\n <Popover className={popoverClassNames.root}>\n <ListBox className={classNames.list}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n className={classNames.item}\n >\n <div className={classNames.itemIndicator}>\n <Icon name=\"check\" />\n </div>\n <Text slot=\"label\" className={classNames.itemLabel}>\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;;;;AAkCO,MAAM,MAAA,GAAS,UAAA,CAAwC,CAAC,KAAA,EAAO,GAAA,KAAQ;AAC5E,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,KAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA,GAAc,kBAAA;AAAA,IACd,IAAA,GAAO,OAAA;AAAA,IACP,IAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,iBAAA,EAAmB,cAAA;AAAA,IACnB,UAAA;AAAA,IACA,cAAA;AAAA,IACA,KAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,UAAA,EAAY,iBAAA,EAAkB,GAAI,UAAU,SAAS,CAAA;AAC7D,EAAA,MAAM,EAAE,UAAA,EAAY,cAAA,EAAe,GAAI,UAAU,QAAA,EAAU;AAAA,IACzD;AAAA,GACD,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,KAAA,IAAS,CAAC,SAAA,IAAa,CAAC,cAAA,EAAgB;AAC3C,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA,EAAG,CAAC,KAAA,EAAO,SAAA,EAAW,cAAc,CAAC,CAAA;AAGrC,EAAA,MAAM,kBAAA,GAAqB,cAAA,KAAmB,UAAA,GAAa,UAAA,GAAa,IAAA,CAAA;AAExE,EAAA,uBACE,IAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,SAAS,CAAA;AAAA,MACzC,GAAG,cAAA;AAAA,MACJ,GAAA;AAAA,
|
|
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 { Icon } from '../Icon';\nimport { FieldError } from '../FieldError';\n\n/** @public */\nexport const Select = forwardRef<HTMLDivElement, SelectProps>((props, ref) => {\n const {\n className,\n label,\n description,\n options,\n placeholder = 'Select an option',\n size = 'small',\n icon,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n isRequired,\n secondaryLabel,\n style,\n ...rest\n } = props;\n\n const { classNames: popoverClassNames } = useStyles('Popover');\n const { classNames, dataAttributes } = useStyles('Select', {\n size,\n });\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, 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={classNames.trigger}\n data-size={dataAttributes['data-size']}\n >\n {icon}\n <SelectValue className={classNames.value} />\n <Icon aria-hidden=\"true\" name=\"chevron-down\" />\n </Button>\n <FieldError />\n <Popover className={popoverClassNames.root}>\n <ListBox className={classNames.list}>\n {options?.map(option => (\n <ListBoxItem\n key={option.value}\n id={option.value}\n className={classNames.item}\n >\n <div className={classNames.itemIndicator}>\n <Icon name=\"check\" />\n </div>\n <Text slot=\"label\" className={classNames.itemLabel}>\n {option.label}\n </Text>\n </ListBoxItem>\n ))}\n </ListBox>\n </Popover>\n </AriaSelect>\n );\n});\n\nSelect.displayName = 'Select';\n"],"names":["AriaSelect"],"mappings":";;;;;;;;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 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/ui",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20250904023803",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react-aria-components": "^1.10.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@backstage/cli": "0.0.0-nightly-
|
|
49
|
+
"@backstage/cli": "0.0.0-nightly-20250904023803",
|
|
50
50
|
"@storybook/react": "^8.6.12",
|
|
51
51
|
"@types/react": "^18.0.0",
|
|
52
52
|
"@types/react-dom": "^18.0.0",
|