UNPKG

@smart-react-components/ui

Version:
56 lines (51 loc) 4.38 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div")); const styled_components_1 = __importDefault(require("styled-components")); exports.default = (0, styled_components_1.default)(Div_1.default).attrs({ getDropdownListSize: (v, t) => ` padding: ${t.$.size.dropdown[v].padding.y} 0; > div, > a { font-size: ${t.$.size.dropdown[v].fontSize}; margin: ${t.$.size.dropdown[v].margin.y} ${t.$.size.dropdown[v].margin.x}; padding: ${t.$.size.dropdown[v].padding.y} ${t.$.size.dropdown[v].padding.x}; } `, })(({ theme, isOutline, isSoft, palette }) => { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13; return ` border-radius: ${theme.$.radius.dropdown}; box-shadow: 0 0 10px 1px ${(_b = (_a = theme.$.palette[palette].dropdown) === null || _a === void 0 ? void 0 : _a.shadow) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.shadow}; font-family: ${theme.$.fontFamily.dropdown}; height: inherit; overflow: auto; user-select: none; width: inherit; -webkit-overflow-scrolling: touch; > div, > a { word-break: break-word; word-wrap: break-word; } > a { color: inherit; display: block; text-decoration: none; } ${!isOutline ? ` background: ${!isSoft ? ((_d = (_c = theme.$.palette[palette].dropdown) === null || _c === void 0 ? void 0 : _c.background) !== null && _d !== void 0 ? _d : theme.$.palette[palette].main) : ((_g = (_f = (_e = theme.$.palette[palette].dropdown) === null || _e === void 0 ? void 0 : _e.soft) === null || _f === void 0 ? void 0 : _f.background) !== null && _g !== void 0 ? _g : theme.$.palette[palette].soft)}; color: ${!isSoft ? ((_j = (_h = theme.$.palette[palette].dropdown) === null || _h === void 0 ? void 0 : _h.font) !== null && _j !== void 0 ? _j : theme.$.palette[palette].font) : ((_m = (_l = (_k = theme.$.palette[palette].dropdown) === null || _k === void 0 ? void 0 : _k.soft) === null || _l === void 0 ? void 0 : _l.font) !== null && _m !== void 0 ? _m : theme.$.palette[palette].softFont)}; fill: ${!isSoft ? ((_p = (_o = theme.$.palette[palette].dropdown) === null || _o === void 0 ? void 0 : _o.font) !== null && _p !== void 0 ? _p : theme.$.palette[palette].font) : ((_s = (_r = (_q = theme.$.palette[palette].dropdown) === null || _q === void 0 ? void 0 : _q.soft) === null || _r === void 0 ? void 0 : _r.font) !== null && _s !== void 0 ? _s : theme.$.palette[palette].softFont)}; ` : ` background: ${!isSoft ? ((_v = (_u = (_t = theme.$.palette[palette].dropdown) === null || _t === void 0 ? void 0 : _t.outline) === null || _u === void 0 ? void 0 : _u.background) !== null && _v !== void 0 ? _v : theme.$.color.dynamic.background) : ((_z = (_y = (_x = (_w = theme.$.palette[palette].dropdown) === null || _w === void 0 ? void 0 : _w.soft) === null || _x === void 0 ? void 0 : _x.outline) === null || _y === void 0 ? void 0 : _y.background) !== null && _z !== void 0 ? _z : theme.$.color.dynamic.background)}; color: ${!isSoft ? ((_2 = (_1 = (_0 = theme.$.palette[palette].dropdown) === null || _0 === void 0 ? void 0 : _0.outline) === null || _1 === void 0 ? void 0 : _1.font) !== null && _2 !== void 0 ? _2 : theme.$.color.dynamic.font) : ((_6 = (_5 = (_4 = (_3 = theme.$.palette[palette].dropdown) === null || _3 === void 0 ? void 0 : _3.soft) === null || _4 === void 0 ? void 0 : _4.outline) === null || _5 === void 0 ? void 0 : _5.font) !== null && _6 !== void 0 ? _6 : theme.$.color.dynamic.font)}; fill: ${!isSoft ? ((_9 = (_8 = (_7 = theme.$.palette[palette].dropdown) === null || _7 === void 0 ? void 0 : _7.outline) === null || _8 === void 0 ? void 0 : _8.font) !== null && _9 !== void 0 ? _9 : theme.$.color.dynamic.font) : ((_13 = (_12 = (_11 = (_10 = theme.$.palette[palette].dropdown) === null || _10 === void 0 ? void 0 : _10.soft) === null || _11 === void 0 ? void 0 : _11.outline) === null || _12 === void 0 ? void 0 : _12.font) !== null && _13 !== void 0 ? _13 : theme.$.color.dynamic.font)}; `} `; });