@rebasepro/ui 0.17.2 → 0.17.3-canary.g6aa77f5
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/dist/components/Select.d.ts +9 -0
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Select.tsx +11 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.3-canary.g6aa77f5",
|
|
5
5
|
"description": "Rebase design system — React components and design tokens built on Radix UI, Tailwind CSS and lucide-react",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -45,6 +45,15 @@ export type SelectProps<T extends SelectValue = string> = {
|
|
|
45
45
|
children?: React.ReactNode;
|
|
46
46
|
dataType?: "string" | "number" | "boolean";
|
|
47
47
|
portalContainer?: HTMLElement | null; // Explicitly added to props type if missing
|
|
48
|
+
/**
|
|
49
|
+
* Accessible name for the trigger, for a select whose `label` is a node
|
|
50
|
+
* rather than a string — or which shows no label at all.
|
|
51
|
+
*
|
|
52
|
+
* Without it such a select announces the literal fallback "Select an
|
|
53
|
+
* option", which is indistinguishable from every other unlabelled select
|
|
54
|
+
* on the screen.
|
|
55
|
+
*/
|
|
56
|
+
"aria-label"?: string;
|
|
48
57
|
};
|
|
49
58
|
|
|
50
59
|
export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
@@ -73,6 +82,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
|
73
82
|
children,
|
|
74
83
|
dataType = "string",
|
|
75
84
|
portalContainer: manualContainer, // Rename to avoid confusion
|
|
85
|
+
"aria-label": ariaLabel,
|
|
76
86
|
...props
|
|
77
87
|
}, ref) => {
|
|
78
88
|
|
|
@@ -158,7 +168,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
|
158
168
|
id={id}
|
|
159
169
|
asChild={false}
|
|
160
170
|
type="button"
|
|
161
|
-
aria-label={typeof label === "string" ? label : (typeof renderValue === "string" ? renderValue : "Select an option")}
|
|
171
|
+
aria-label={ariaLabel ?? (typeof label === "string" ? label : (typeof renderValue === "string" ? renderValue : "Select an option"))}
|
|
162
172
|
aria-invalid={error || undefined}
|
|
163
173
|
className={cls(
|
|
164
174
|
"h-full",
|