@react95/core
Version:
Windows 95 styleguide
28 lines (27 loc) • 908 B
JavaScript
import React, { forwardRef } from "react";
import cn from "classnames";
import { wrapper, select } from "./Dropdown.css.mjs";
import { Frame } from "../Frame/Frame.mjs";
import { sprinkles } from "../Frame/Frame.css.mjs";
const defaultOptions = [
"",
"C:\\Documents and Settings",
"C:\\Documents and Settings\\Documents",
"iexplorer.exe"
];
const Dropdown = forwardRef(
({ options = defaultOptions, ...rest }, ref) => {
const { style, otherProps, className } = sprinkles(rest);
return /* @__PURE__ */ React.createElement(
Frame,
{
style,
className: cn(wrapper, className, otherProps.className)
},
/* @__PURE__ */ React.createElement("select", { ...otherProps, className: cn(select), ref }, options && options.map((option) => /* @__PURE__ */ React.createElement("option", { key: option, value: option }, option)))
);
}
);
export {
Dropdown
};