fannypack-v5
Version:
An accessible, composable, and friendly React UI Kit
153 lines (126 loc) • 6.05 kB
JavaScript
import 'react';
import '../Provider/ThemeContext.js';
import 'classnames';
import { css } from 'emotion';
import { css as css$1 } from '@emotion/core';
import 'emotion-theming';
import '@emotion/styled';
import '../utils/useTheme.js';
import { a as _taggedTemplateLiteralLoose } from '../chunk-0c448560.js';
import 'lodash/kebabCase';
import 'tinycolor2';
import '../utils/isFunction.js';
import '../utils/get.js';
import { theme, palette, borderRadius, fontSize } from '../utils/theme.js';
import '../utils/omit.js';
import '../utils/pick.js';
import '../utils/cssProps.js';
import '../utils/useLocalStorage.js';
import '../Provider/ColorModeContext.js';
import '../utils/useColorMode.js';
import '../utils/useStyle.js';
import '../utils/omitBy.js';
import '../utils/useDefaultProps.js';
import '../utils/useDebounce.js';
import 'lodash/uniq';
import '../utils/useClassName.js';
import '../utils/useBreakpoint.js';
import '../utils/uniqueId.js';
import '../utils/times.js';
import '../utils/parseIcons.js';
import '../utils/colors.js';
import '../utils/palette.js';
import '../utils/mergeRefs.js';
import 'deepmerge';
import 'lodash/set';
import '../utils/applyTheme.js';
import '../utils/bindFns.js';
import '../utils/createComponent.js';
import '../utils/createElement.js';
import '../utils/createHook.js';
import '../utils/forwardRefWithUse.js';
import '../utils/fieldAdaptors.js';
import '@emotion/is-prop-valid';
import '../utils/htmlProps.js';
import '../utils/OutsideClickHandler.js';
function _templateObject8() {
var data = _taggedTemplateLiteralLoose(["\n font-size: ", "rem;\n\n & {\n ", ";\n }\n "]);
_templateObject8 = function _templateObject8() {
return data;
};
return data;
}
function _templateObject7() {
var data = _taggedTemplateLiteralLoose(["\n font-size: ", "rem;\n\n & {\n ", ";\n }\n "]);
_templateObject7 = function _templateObject7() {
return data;
};
return data;
}
function _templateObject6() {
var data = _taggedTemplateLiteralLoose(["\n & {\n ", ";\n }\n "]);
_templateObject6 = function _templateObject6() {
return data;
};
return data;
}
function _templateObject5() {
var data = _taggedTemplateLiteralLoose(["\n font-size: ", "rem;\n\n & {\n ", ";\n }\n "]);
_templateObject5 = function _templateObject5() {
return data;
};
return data;
}
function _templateObject4() {
var data = _taggedTemplateLiteralLoose(["\n & {\n ", ";\n }\n"]);
_templateObject4 = function _templateObject4() {
return data;
};
return data;
}
function _templateObject3() {
var data = _taggedTemplateLiteralLoose(["\n & {\n border-color: ", ";\n box-shadow: ", " 0px 0px 0px 3px !important;\n }\n "]);
_templateObject3 = function _templateObject3() {
return data;
};
return data;
}
function _templateObject2() {
var data = _taggedTemplateLiteralLoose(["\n -webkit-appearance: none;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 100%;\n padding: 0.4em 0.8em;\n transition: box-shadow 0.1s ease-in-out 0s, border-color 0.1s, background-color 0.1s;\n\n &[disabled] {\n background-color: ", ";\n box-shadow: unset;\n cursor: not-allowed;\n\n & {\n ", ";\n }\n }\n\n &:not([disabled]):hover {\n box-shadow: ", " 0px 0px 0px 2px !important;\n border-color: ", ";\n }\n\n &:focus {\n outline: unset;\n z-index: 2;\n border-color: ", ";\n box-shadow: ", " 0px 0px 0px 3px !important;\n\n & {\n ", ";\n }\n }\n\n &::placeholder {\n opacity: 0.6;\n\n & {\n ", ";\n }\n }\n\n ", "\n\n & {\n ", ";\n }\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = _taggedTemplateLiteralLoose(["\n align-items: center;\n position: relative;\n width: 100%;\n\n ", ";\n\n & {\n ", ";\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var TextareaWrapper = function TextareaWrapper(styleProps) {
return css(_templateObject(), styleProps.size && wrapperSizeProperties(styleProps), theme(styleProps.themeKey, "css.root")(styleProps));
};
var Textarea = function Textarea(styleProps) {
return css(_templateObject2(), palette('white900')(styleProps), borderRadius('default')(styleProps), palette('white700')(styleProps), theme(styleProps.themeKey, "css.disabled")(styleProps), palette((styleProps.state || 'primary') + "Tint")(styleProps), palette((styleProps.state || 'primary') + "100")(styleProps), palette('primary')(styleProps), palette('primaryTint')(styleProps), theme(styleProps.themeKey, "css.focus")(styleProps), theme(styleProps.themeKey, "css.placeholder")(styleProps), styleProps.state && css$1(_templateObject3(), palette("" + styleProps.state)(styleProps), palette(styleProps.state + "Tint")(styleProps)), theme(styleProps.themeKey, "css.root")(styleProps));
};
var TextareaField = function TextareaField(styleProps) {
return css(_templateObject4(), theme(styleProps.themeKey, "css.root")(styleProps));
};
function wrapperSizeProperties(styleProps) {
var properties = {
small: css$1(_templateObject5(), fontSize('150')(styleProps), theme(styleProps.themeKey, "css.sizes.small")(styleProps)),
default: css$1(_templateObject6(), theme(styleProps.themeKey, "css.sizes.default")(styleProps)),
medium: css$1(_templateObject7(), fontSize('300')(styleProps), theme(styleProps.themeKey, "css.sizes.medium")(styleProps)),
large: css$1(_templateObject8(), fontSize('400')(styleProps), theme(styleProps.themeKey, "css.sizes.large")(styleProps))
};
return properties[styleProps.size];
}
var styles = /*#__PURE__*/Object.freeze({
TextareaWrapper: TextareaWrapper,
Textarea: Textarea,
TextareaField: TextareaField,
wrapperSizeProperties: wrapperSizeProperties
});
export { TextareaWrapper as T, Textarea as a, TextareaField as b, styles as s, wrapperSizeProperties as w };