/**
 * Copyright © 2019 Johnson & Johnson
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
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 React from 'react';
import flow from 'lodash/flow';
import { Text as BaseText, TextArea as BaseTextArea, RadioGroup as BaseRadioGroup, Radio as BaseRadio, Checkbox as BaseCheckBox, Select as BaseSelect, Option as BaseOption, } from 'informed';
import { Li, Ul, stylable, addClasses, withoutProps, flowIf, hasProp, addProps, removeClasses, addClassesIf, removeClassesIf, flowHoc, } from '@bodiless/fclasses';
import { withChild } from '@bodiless/core';
import './bodiless.index.css';
import 'rc-tooltip/assets/bootstrap.css';
export var Title = stylable('h3');
export var Label = stylable('label');
export var Img = stylable('img');
export var Input = stylable('input');
export var Div = stylable('div');
export var Span = stylable('span');
export var Button = stylable('button');
export var Hr = stylable('hr');
export var Form = stylable('form');
export var Text = stylable(BaseText);
export var TextArea = stylable(BaseTextArea);
export var RadioGroup = stylable(BaseRadioGroup);
export var Radio = stylable(BaseRadio);
export var CheckBox = stylable(BaseCheckBox);
export var Select = stylable(BaseSelect);
export var Option = stylable(BaseOption);
export var Anchor = stylable('a');
export var Icon = flow(addClasses('bl-p-grid-1 bl-material-icons'), withoutProps(['isActive']), flowIf(hasProp('isActive'))(addClasses('bl-bg-primary bl-rounded')), addProps({ 'aria-hidden': true }))(Span);
export var ComponentFormTitle = addClasses('bl-text-lg bl-font-bold bl-text-gray-100 bl-block bl-mb-grid-2 bl-min-w-xl-grid-1')(Title);
export var ComponentFormFieldWrapper = addClasses('bl-mb-grid-3 bl-w-full')(Div);
export var ComponentFormFieldTitle = addClasses('bl-mb-grid-2 bl-font-bold bl-text-gray-100')(Div);
export var ComponentFormDescription = addClasses('bl-text-xs bl-text-gray-100 bl-block bl-mb-grid-2 bl-max-w-xl-grid-1')(Div);
export var ComponentFormListItem = addClasses('first:bl-border-t-0 bl-border-t bl-py-grid-1 bl-px-grid-1 bl-max-w-xl-grid-1')(Li);
export var ComponentFormList = addClasses('bl-list-none bl-max-h-xl-grid-1 bl-overflow-y-scroll')(Ul);
export var ComponentFormLabel = addClasses('bl-text-xs bl-text-gray-100 bl-block')(Label);
export var ComponentFormText = addClasses('bl-text-gray-900 bl-bg-gray-100 bl-text-xs bl-w-full bl-min-w-xl-grid-1 bl-block bl-my-grid-2 bl-p-grid-1')(Text);
export var ComponentFormTextArea = addClasses('bl-text-gray-900 bl-bg-gray-100 bl-text-xs bl-w-full bl-min-w-xl-grid-1 bl-min-h-grid-16 bl-block bl-my-grid-2 bl-p-grid-1 bl-resize-none bl-overflow-auto bl-whitespace-pre')(TextArea);
export var ComponentFormRadioGroup = addClasses('bl-mb-grid-2')(RadioGroup);
export var ComponentFormRadio = addClasses('bl-mr-grid-2 bl-mb-grid-2 bl-align-baseline')(Radio);
export var ComponentFormCheckBox = addClasses('bl-mr-grid-2 bl-mb-grid-2 bl-align-baseline')(CheckBox);
export var ComponentFormSelect = addClasses("bl-text-gray-900 bl-bg-gray-100 bl-text-xs bl-w-full\n  bl-min-w-xl-grid-1 bl-block bl-my-grid-2 bl-p-grid-1")(Select);
export var ComponentFormOption = Option;
export var ComponentFormButton = addClasses('bl-text-gray-200 bl-cursor-pointer')(Button);
export var ComponentFormUnwrapButton = addClasses('bl-absolute bl-bottom-0 bl-left-0 bl-mb-5 bl-ml-3 bl-cursor-pointer bl-underline')(Button);
export var ComponentFormCloseButton = flow(addClasses('hover:bl-text-gray-500 bl-float-right'), withChild(function () { return React.createElement(Icon, { className: "bl-small-icon" }, "highlight_off"); }))(ComponentFormButton);
export var ComponentFormSubmitButton = function (props) { return (React.createElement("div", { className: "bl-flow-root" },
    React.createElement(ComponentFormButton, __assign({ className: "bl-float-right" }, props),
        React.createElement(Icon, { className: "hover:bl-bg-white hover:bl-text-tooltip" }, "check_circle")))); };
export var ComponentFormError = addClasses('bl-block bl-italic')(Div);
export var SubmitButton = function (props) { return React.createElement(ComponentFormButton, __assign({ type: "submit" }, props)); };
export var ToolbarIcon = flow(removeClasses('bl-p-grid-1'), addClasses('bl-w-grid-8 bl-h-grid-8 bl-large-icon'))(Icon);
export var ToolbarButton = flow(withoutProps(['isActive', 'isFirst', 'isDisabled']), addClasses('bl-cursor-pointer bl-mb-3 bl-flex bl-flex-col bl-items-center'), flowIf(hasProp('isDisabled'))(flowHoc(addClasses('bl-text-gray-600'), removeClasses('bl-text-gray-200'))), addProps({ type: 'button' }))(Button);
export var HorizontalToolbarButton = flow(removeClasses('bl-mb-3'), addClasses('bl-mr-grid-2 last:bl-mr-grid-0'))(ToolbarButton);
export var ToolbarButtonLabel = addClasses('bl-text-center bl-text-base')(Span);
var ResizeHandleBar = addClasses('bl-resizable-handle bl-border-solid bl-border-l-2 bl-border-primary bl-h-full')(Div);
export var ResizeHandle = flow(addClasses('bl-flex bl-justify-center bl-w-5 bl-right-rem-1 bl-z-1 bl-h-three-quarters bl-relative bl-top-half bl-transform bl--translate-y-1/2'), withChild(function () { return React.createElement(ResizeHandleBar, null); }))(Div);
export var ResizeHandleRTL = flow(addClasses('bl-left-rem-1'), removeClasses('bl-right-rem-1'))(ResizeHandle);
export var ContextSubMenu = flow(addClasses('bl-flex bl-text-white'), addProps({ role: 'toolbar', 'aria-label': 'Submenu' }))(Div);
export var Warning = flow(addClasses('bl-w-grid-7 bl-text-yellow-500 bl-small-icon'))(function (props) { return (React.createElement(Icon, __assign({}, props), "report_problem_outlined")); });
export var ComponentFormWarning = flow(addClasses('bl-float-left bl-flex bl-items-center'))(function (_a) {
    var children = _a.children, rest = __rest(_a, ["children"]);
    return (React.createElement(Div, __assign({}, rest),
        React.createElement(Warning, null),
        children));
});
var isDisabled = function (props) { return hasProp('disabled')(props); };
export var ComponentFormLink = flow(addClasses('bl-cursor-pointer bl-text-xs bl-block bl-underline'), addClassesIf(isDisabled)('bl-text-gray-600'), removeClassesIf(isDisabled)('bl-cursor-pointer bl-text-gray-100 '))(Anchor);
export var ComponentFormDefaultPanelWidth = addClasses('bl-w-xl-grid-2');
export var ComponentFormDefaultPanelHeight = addClasses('bl-h-xl-grid-1');
export var ComponentFormDefaultPanelSize = flowHoc(ComponentFormDefaultPanelWidth, ComponentFormDefaultPanelHeight);
//# sourceMappingURL=elements.js.map