UNPKG

@react-md/app-bar

Version:

This small package implments the AppBar spec in material design.

41 lines 2.4 kB
"use strict"; 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; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppBarAction = void 0; var jsx_runtime_1 = require("react/jsx-runtime"); var react_1 = require("react"); var button_1 = require("@react-md/button"); var useActionClassName_1 = require("./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. */ exports.AppBarAction = (0, react_1.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 ((0, jsx_runtime_1.jsx)(button_1.Button, __assign({}, props, { theme: theme, buttonType: buttonType, floating: floating, ref: ref, className: (0, useActionClassName_1.useActionClassName)({ first: first, last: last, inheritColor: inheritColor, className: className }) }, { children: children }))); }); //# sourceMappingURL=AppBarAction.js.map