UNPKG

@formant/ava-react

Version:

React components of AVA.

46 lines 2.59 kB
import styled from 'styled-components'; import { getFontSize, getLineHeight } from "../theme"; import { NTV_PREFIX_CLS } from "../constants"; var BULLET_PADDING_LEFT = 24; export var Bullet = styled.div.withConfig({ displayName: "Bullet", componentId: "ava-react-d63f__sc-1184ijz-0" })(["padding-left:", ";font-family:PingFangSC,sans-serif;color:var(--color-text-secondary);font-size:", ";margin-bottom:8px;line-height:", ";"], "".concat(BULLET_PADDING_LEFT, "px"), function (_ref) { var size = _ref.size; return getFontSize(size); }, function (_ref2) { var size = _ref2.size; return getLineHeight(size); }); export var Ol = styled(Bullet).withConfig({ displayName: "Ol", componentId: "ava-react-d63f__sc-1184ijz-1" })(["list-style-type:decimal;max-height:100px;overflow:auto;&::-webkit-scrollbar{background:transparent;width:0.5rem;height:0.5rem;}&::-webkit-scrollbar-thumb{background:#bac4e2;border-radius:0.25rem;-webkit-border-radius:0.25rem;-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.75);}&::-webkit-scrollbar-corner{background:#bac4e2;}"]); export var Ul = styled(Bullet).withConfig({ displayName: "Ul", componentId: "ava-react-d63f__sc-1184ijz-2" })(["list-style-type:disc;"]); var SWITCHER_ICON_TOP = '24px'; export var Li = styled.li.withConfig({ displayName: "Li", componentId: "ava-react-d63f__sc-1184ijz-3" })(["list-style:inherit;color:var(--color-text-secondary);font-size:", ";line-height:", ";position:relative;transform:", ";::marker{margin-right:-8px;}> .", "-switcher-icon{position:absolute;left:", ";top:0px;cursor:pointer;color:#979797;}::before{content:'';position:absolute;left:", ";top:", ";width:1px;height:", ";border-right:", ";box-sizing:border-box;}"], function (_ref3) { var size = _ref3.size; return getFontSize(size); }, function (_ref4) { var size = _ref4.size; return getLineHeight(size); }, function (_ref5) { var collapsible = _ref5.collapsible, size = _ref5.size; return collapsible ? "translateX(".concat(size === 'small' ? '12px' : '16px', ")") : undefined; }, NTV_PREFIX_CLS, function (_ref6) { var size = _ref6.size; return size === 'small' ? "".concat(-BULLET_PADDING_LEFT - 8, "px") : "".concat(-BULLET_PADDING_LEFT - 12, "px"); }, function (_ref7) { var size = _ref7.size; return size === 'small' ? "".concat(-BULLET_PADDING_LEFT - 2, "px") : "".concat(-BULLET_PADDING_LEFT - 6, "px"); }, SWITCHER_ICON_TOP, "calc(100% - ".concat(SWITCHER_ICON_TOP, ")"), function (_ref8) { var showBulletsLine = _ref8.showBulletsLine; return showBulletsLine ? '0.8px solid rgba(31, 3, 82, 0.2)' : undefined; });