UNPKG

fannypack-v5

Version:

An accessible, composable, and friendly React UI Kit

183 lines (150 loc) 6.45 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 { borderRadius, palette, altitude, theme, space, fontSize, fontWeight } 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 _templateObject10() { var data = _taggedTemplateLiteralLoose(["\n max-width: 600px;\n width: 100%;\n\n ", ";\n\n & .fp-DialogContent {\n max-height: 70vh;\n overflow-y: ", ";\n }\n\n & {\n ", ";\n }\n"]); _templateObject10 = function _templateObject10() { return data; }; return data; } function _templateObject9() { var data = _taggedTemplateLiteralLoose(["\n margin-right: ", "rem;\n\n & .fp-Icon {\n vertical-align: -0.125em;\n }\n & .fp-CalloutContent .fp-Icon {\n font-size: 1.25em;\n }\n\n & {\n ", ";\n }\n"]); _templateObject9 = function _templateObject9() { return data; }; return data; } function _templateObject8() { var data = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: ", "rem;\n right: ", "rem;\n\n & {\n ", ";\n }\n"]); _templateObject8 = function _templateObject8() { return data; }; return data; } function _templateObject7() { var data = _taggedTemplateLiteralLoose(["\n justify-content: flex-end;\n "]); _templateObject7 = function _templateObject7() { return data; }; return data; } function _templateObject6() { var data = _taggedTemplateLiteralLoose(["\n justify-content: space-between;\n "]); _templateObject6 = function _templateObject6() { return data; }; return data; } function _templateObject5() { var data = _taggedTemplateLiteralLoose(["\n align-items: center;\n background-color: ", ";\n display: flex;\n padding: ", "rem ", "rem;\n\n ", ";\n\n ", ";\n\n & {\n ", ";\n }\n"]); _templateObject5 = function _templateObject5() { return data; }; return data; } function _templateObject4() { var data = _taggedTemplateLiteralLoose(["\n font-size: ", "em;\n font-weight: ", ";\n\n & {\n ", ";\n }\n"]); _templateObject4 = function _templateObject4() { return data; }; return data; } function _templateObject3() { var data = _taggedTemplateLiteralLoose(["\n margin-bottom: ", "rem;\n\n & {\n ", ";\n }\n"]); _templateObject3 = function _templateObject3() { return data; }; return data; } function _templateObject2() { var data = _taggedTemplateLiteralLoose(["\n display: flex;\n padding: ", "rem;\n\n & {\n ", ";\n }\n"]); _templateObject2 = function _templateObject2() { return data; }; return data; } function _templateObject() { var data = _taggedTemplateLiteralLoose(["\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n position: relative;\n\n ", ";\n\n & {\n ", ";\n }\n"]); _templateObject = function _templateObject() { return data; }; return data; } var Dialog = function Dialog(styleProps) { return css(_templateObject(), borderRadius('default')(styleProps), palette('background')(styleProps), altitude('100')(styleProps), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogContent = function DialogContent(styleProps) { return css(_templateObject2(), space(3, 'major')(styleProps), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogHeader = function DialogHeader(styleProps) { return css(_templateObject3(), space(2, 'major')(styleProps), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogTitle = function DialogTitle(styleProps) { return css(_templateObject4(), fontSize('300')(styleProps), fontWeight('semibold')(styleProps), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogFooter = function DialogFooter(styleProps) { return css(_templateObject5(), palette('white600')(styleProps), space(5, 'minor')(styleProps), space(6, 'minor')(styleProps), styleProps.showActionButtons && styleProps.footer && css$1(_templateObject6()), styleProps.showActionButtons && !styleProps.footer && css$1(_templateObject7()), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogClose = function DialogClose(styleProps) { return css(_templateObject8(), space(2, 'major')(styleProps), space(2, 'major')(styleProps), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogIconWrapper = function DialogIconWrapper(styleProps) { return css(_templateObject9(), space(2, 'major')(styleProps), theme(styleProps.themeKey, "css.root")(styleProps)); }; var DialogModal = function DialogModal(styleProps) { return css(_templateObject10(), altitude('400')(styleProps), styleProps.hasScroll ? 'scroll' : 'visible', theme(styleProps.themeKey, "css.root")(styleProps)); }; var styles = /*#__PURE__*/Object.freeze({ Dialog: Dialog, DialogContent: DialogContent, DialogHeader: DialogHeader, DialogTitle: DialogTitle, DialogFooter: DialogFooter, DialogClose: DialogClose, DialogIconWrapper: DialogIconWrapper, DialogModal: DialogModal }); export { Dialog as D, DialogContent as a, DialogHeader as b, DialogTitle as c, DialogFooter as d, DialogClose as e, DialogIconWrapper as f, DialogModal as g, styles as s };