UNPKG

@react-md/app-bar

Version:

This small package implments the AppBar spec in material design.

38 lines 2.23 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import { jsx as _jsx } from "react/jsx-runtime"; import { forwardRef } from "react"; import { Button } from "@react-md/button"; import { useActionClassName } from "./useActionClassName"; /** * This component is really just a simple wrapper for the `Button` component * that adds a few additional styles to prevent the button from shrinking when * an `AppBar` has a lot of content. It also will automatically add spacing * either before or after this button when the `first` or `last` props are * provided. */ export var AppBarAction = forwardRef(function AppBarAction(_a, ref) { var className = _a.className, _b = _a.first, first = _b === void 0 ? false : _b, _c = _a.last, last = _c === void 0 ? false : _c, children = _a.children, inheritColor = _a.inheritColor, floating = _a.floating, _d = _a.theme, theme = _d === void 0 ? floating ? "secondary" : "clear" : _d, _e = _a.buttonType, buttonType = _e === void 0 ? "icon" : _e, props = __rest(_a, ["className", "first", "last", "children", "inheritColor", "floating", "theme", "buttonType"]); return (_jsx(Button, __assign({}, props, { theme: theme, buttonType: buttonType, floating: floating, ref: ref, className: useActionClassName({ first: first, last: last, inheritColor: inheritColor, className: className }) }, { children: children }))); }); //# sourceMappingURL=AppBarAction.js.map