@formant/ava-react
Version:
React components of AVA.
113 lines (107 loc) • 3.93 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/NarrativeTextVis/styled/bullet.tsx
var bullet_exports = {};
__export(bullet_exports, {
Bullet: () => Bullet,
Li: () => Li,
Ol: () => Ol,
Ul: () => Ul
});
module.exports = __toCommonJS(bullet_exports);
var import_styled_components = __toESM(require("styled-components"));
var import_theme = require("../theme");
var import_constants = require("../constants");
var BULLET_PADDING_LEFT = 24;
var Bullet = import_styled_components.default.div`
padding-left: ${`${BULLET_PADDING_LEFT}px`};
font-family: PingFangSC, sans-serif;
color: var(--color-text-secondary);
font-size: ${({ size }) => (0, import_theme.getFontSize)(size)};
margin-bottom: 8px;
line-height: ${({ size }) => (0, import_theme.getLineHeight)(size)};
`;
var Ol = (0, import_styled_components.default)(Bullet)`
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;
}
`;
var Ul = (0, import_styled_components.default)(Bullet)`
list-style-type: disc;
`;
var SWITCHER_ICON_TOP = "24px";
var Li = import_styled_components.default.li`
list-style: inherit;
color: var(--color-text-secondary);
font-size: ${({ size }) => (0, import_theme.getFontSize)(size)};
line-height: ${({ size }) => (0, import_theme.getLineHeight)(size)};
position: relative;
transform: ${({ collapsible, size }) => collapsible ? `translateX(${size === "small" ? "12px" : "16px"})` : void 0};
::marker {
margin-right: -8px;
}
> .${import_constants.NTV_PREFIX_CLS}-switcher-icon {
position: absolute;
left: ${({ size }) => size === "small" ? `${-BULLET_PADDING_LEFT - 8}px` : `${-BULLET_PADDING_LEFT - 12}px`};
top: 0px;
cursor: pointer;
color: #979797;
}
// 折叠线
::before {
content: '';
position: absolute;
left: ${({ size }) => size === "small" ? `${-BULLET_PADDING_LEFT - 2}px` : `${-BULLET_PADDING_LEFT - 6}px`};
top: ${SWITCHER_ICON_TOP};
width: 1px;
height: ${`calc(100% - ${SWITCHER_ICON_TOP})`};
border-right: ${({ showBulletsLine }) => showBulletsLine ? "0.8px solid rgba(31, 3, 82, 0.2)" : void 0};
box-sizing: border-box;
}
`;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Bullet,
Li,
Ol,
Ul
});