@adamjanicki/ui 1.1.4 → 1.1.5
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.
|
@@ -24,6 +24,10 @@ type Props = React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElemen
|
|
|
24
24
|
* @default "rounded"
|
|
25
25
|
*/
|
|
26
26
|
corners?: CornerType;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the select element for accessibility purposes
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
27
31
|
};
|
|
28
32
|
declare const _default: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
29
33
|
export default _default;
|
|
@@ -25,7 +25,7 @@ import { forwardRef } from "react";
|
|
|
25
25
|
import { classNames } from "../../utils/util";
|
|
26
26
|
var identity = function (x) { return x; };
|
|
27
27
|
var Select = function (_a, ref) {
|
|
28
|
-
var className = _a.className, options = _a.options, _b = _a.getOptionValue, getOptionValue = _b === void 0 ? identity : _b, _c = _a.getOptionLabel, getOptionLabel = _c === void 0 ? identity : _c, _d = _a.corners, corners = _d === void 0 ? "rounded" : _d, props = __rest(_a, ["className", "options", "getOptionValue", "getOptionLabel", "corners"]);
|
|
29
|
-
return (_jsx("select", __assign({}, props, { ref: ref, className: classNames("ajui-select-base corners--".concat(corners), className), children: options.map(function (option, index) { return (_jsx("option", { value: getOptionValue(option), children: getOptionLabel(option) }, index)); }) })));
|
|
28
|
+
var className = _a.className, options = _a.options, _b = _a.getOptionValue, getOptionValue = _b === void 0 ? identity : _b, _c = _a.getOptionLabel, getOptionLabel = _c === void 0 ? identity : _c, _d = _a.corners, corners = _d === void 0 ? "rounded" : _d, name = _a.name, props = __rest(_a, ["className", "options", "getOptionValue", "getOptionLabel", "corners", "name"]);
|
|
29
|
+
return (_jsx("select", __assign({}, props, { ref: ref, className: classNames("ajui-select-base corners--".concat(corners), className), "aria-label": name, children: options.map(function (option, index) { return (_jsx("option", { value: getOptionValue(option), children: getOptionLabel(option) }, index)); }) })));
|
|
30
30
|
};
|
|
31
31
|
export default forwardRef(Select);
|