UNPKG

fannypack-v5

Version:

An accessible, composable, and friendly React UI Kit

301 lines (229 loc) 10.4 kB
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 { breakpoint, borderRadius, theme } 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 _templateObject23() { var data = _taggedTemplateLiteralLoose(["\n border-left-width: 0;\n "]); _templateObject23 = function _templateObject23() { return data; }; return data; } function _templateObject22() { var data = _taggedTemplateLiteralLoose(["\n border-top-width: 0;\n "]); _templateObject22 = function _templateObject22() { return data; }; return data; } function _templateObject21() { var data = _taggedTemplateLiteralLoose(["\n ", ";\n "]); _templateObject21 = function _templateObject21() { return data; }; return data; } function _templateObject20() { var data = _taggedTemplateLiteralLoose(["\n border-top-width: 0;\n "]); _templateObject20 = function _templateObject20() { return data; }; return data; } function _templateObject19() { var data = _taggedTemplateLiteralLoose(["\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n "]); _templateObject19 = function _templateObject19() { return data; }; return data; } function _templateObject18() { var data = _taggedTemplateLiteralLoose(["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n "]); _templateObject18 = function _templateObject18() { return data; }; return data; } function _templateObject17() { var data = _taggedTemplateLiteralLoose(["\n ", ";\n "]); _templateObject17 = function _templateObject17() { return data; }; return data; } function _templateObject16() { var data = _taggedTemplateLiteralLoose(["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n "]); _templateObject16 = function _templateObject16() { return data; }; return data; } function _templateObject15() { var data = _taggedTemplateLiteralLoose(["\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n border-bottom-left-radius: ", ";\n "]); _templateObject15 = function _templateObject15() { return data; }; return data; } function _templateObject14() { var data = _taggedTemplateLiteralLoose(["\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n "]); _templateObject14 = function _templateObject14() { return data; }; return data; } function _templateObject13() { var data = _taggedTemplateLiteralLoose(["\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n "]); _templateObject13 = function _templateObject13() { return data; }; return data; } function _templateObject12() { var data = _taggedTemplateLiteralLoose(["\n ", ";\n "]); _templateObject12 = function _templateObject12() { return data; }; return data; } function _templateObject11() { var data = _taggedTemplateLiteralLoose(["\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n "]); _templateObject11 = function _templateObject11() { return data; }; return data; } function _templateObject10() { var data = _taggedTemplateLiteralLoose(["\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n "]); _templateObject10 = function _templateObject10() { return data; }; return data; } function _templateObject9() { var data = _taggedTemplateLiteralLoose(["\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n "]); _templateObject9 = function _templateObject9() { return data; }; return data; } function _templateObject8() { var data = _taggedTemplateLiteralLoose(["\n ", ";\n "]); _templateObject8 = function _templateObject8() { return data; }; return data; } function _templateObject7() { var data = _taggedTemplateLiteralLoose(["\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n "]); _templateObject7 = function _templateObject7() { return data; }; return data; } function _templateObject6() { var data = _taggedTemplateLiteralLoose(["\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n "]); _templateObject6 = function _templateObject6() { return data; }; return data; } function _templateObject5() { var data = _taggedTemplateLiteralLoose(["\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n "]); _templateObject5 = function _templateObject5() { return data; }; return data; } function _templateObject4() { var data = _taggedTemplateLiteralLoose(["\n ", ";\n "]); _templateObject4 = function _templateObject4() { return data; }; return data; } function _templateObject3() { var data = _taggedTemplateLiteralLoose(["\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n "]); _templateObject3 = function _templateObject3() { return data; }; return data; } function _templateObject2() { var data = _taggedTemplateLiteralLoose(["\n flex-direction: column;\n "]); _templateObject2 = function _templateObject2() { return data; }; return data; } function _templateObject() { var data = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: ", ";\n\n ", ";\n\n & > * {\n border-radius: ", ";\n ", ";\n }\n\n & input:focus,\n & select:focus {\n z-index: 1;\n position: relative;\n }\n\n & > *:first-child {\n ", "\n\n & input,\n & select {\n ", ";\n }\n\n ", ";\n }\n\n & > *:last-child {\n ", "\n\n ", ";\n\n & input,\n & select {\n ", ";\n }\n\n ", ";\n }\n\n & > *:not(:first-child):not(:last-child),\n & > *:not(:first-child):not(:last-child) > input,\n & > *:not(:first-child):not(:last-child) > select {\n border-radius: 0;\n ", ";\n }\n\n & > *:not(:first-child) {\n ", "\n }\n\n & {\n ", ";\n }\n"]); _templateObject = function _templateObject() { return data; }; return data; } var verticalBreakpoints = { tablet: 'mobile', desktop: 'tablet', widescreen: 'desktop', fullHD: 'widescreen' }; var Group = function Group(styleProps) { return css(_templateObject(), styleProps.orientation === 'vertical' ? 'column' : 'row', breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject2()))(styleProps), borderRadius(styleProps.borderRadius, styleProps.borderRadius)(styleProps), theme(styleProps.themeKey, "Item.css.root")(styleProps), styleProps.orientation === 'vertical' ? css$1(_templateObject3()) : css$1(_templateObject4(), breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject5()), { else: css$1(_templateObject6()) })(styleProps)), styleProps.orientation === 'vertical' ? css$1(_templateObject7()) : css$1(_templateObject8(), breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject9()), { else: css$1(_templateObject10()) })(styleProps)), theme(styleProps.themeKey, "Item.css.first")(styleProps), styleProps.orientation === 'vertical' ? css$1(_templateObject11()) : css$1(_templateObject12(), breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject13()), { else: css$1(_templateObject14()) })(styleProps)), breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject15(), borderRadius(styleProps.borderRadius, styleProps.borderRadius)(styleProps)))(styleProps), styleProps.orientation === 'vertical' ? css$1(_templateObject16()) : css$1(_templateObject17(), breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject18()), { else: css$1(_templateObject19()) })(styleProps)), theme(styleProps.themeKey, "Item.css.last")(styleProps), theme(styleProps.themeKey, "Item.css.middle")(styleProps), styleProps.orientation === 'vertical' ? css$1(_templateObject20()) : css$1(_templateObject21(), breakpoint(styleProps.verticalBelow ? "max-" + verticalBreakpoints[styleProps.verticalBelow] : null, css$1(_templateObject22()), { else: css$1(_templateObject23()) })(styleProps)), theme(styleProps.themeKey, "css.root")(styleProps)); }; var styles = /*#__PURE__*/Object.freeze({ Group: Group }); export { Group as G, styles as s };