UNPKG

antd-color-editor

Version:

An open-source color editor for designing color system

185 lines (163 loc) 5.09 kB
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/styles/index.ts var styles_exports = {}; __export(styles_exports, { CanvasView: () => CanvasView, CodeView: () => CodeView, ColorView: () => ColorView, EditorView: () => EditorView, PanelTitle: () => PanelTitle, PanelView: () => PanelView }); module.exports = __toCommonJS(styles_exports); var import_pro_editor = require("@ant-design/pro-editor"); var import_styled_components = __toESM(require("styled-components")); var EditorView = import_styled_components.default.div` position: relative; overflow: hidden; display: flex; align-items: stretch; height: 100vh; `; var PanelView = (0, import_styled_components.default)(import_pro_editor.DraggablePanel)` position: relative; overflow: hidden; height: 100%; label > svg { stroke: ${({ theme }) => theme.colorBgLayout}; } .studio-collapse-title { margin: 0 8px; font-size: 10px; } .ant-collapse-content-box, .studio-collapse-title { > div { background: transparent !important; } .studio-collapse-title { margin-top: 4px; background: ${({ theme }) => theme.colorFillTertiary} !important; border-radius: 4px !important; > div > div > div > div { border: none !important; } } .studio-divider { border-color: ${({ theme }) => theme.colorBorder} !important; } } div[class^='leva'] { --leva-sizes-controlWidth: 66%; --leva-colors-elevation1: ${({ theme }) => theme.colorFill}; --leva-colors-elevation2: transparent; --leva-colors-elevation3: ${({ theme }) => theme.colorFillSecondary}; --leva-colors-accent1: ${({ theme }) => theme.colorPrimary}; --leva-colors-accent2: ${({ theme }) => theme.colorPrimaryHover}; --leva-colors-accent3: ${({ theme }) => theme.colorPrimaryActive}; --leva-colors-highlight1: ${({ theme }) => theme.colorTextTertiary}; --leva-colors-highlight2: ${({ theme }) => theme.colorTextSecondary}; --leva-colors-highlight3: ${({ theme }) => theme.colorText}; --leva-colors-vivid1: ${({ theme }) => theme.colorWarning}; --leva-shadows-level1: unset; --leva-shadows-level2: unset; } .ant-tabs-nav-list { padding: 1px 24px 2px; } .ant-tabs-tab-btn { font-size: 12px; } .ant-collapse-header { padding: 12px 14px !important; font-size: 10px; font-weight: 700; } .ant-tabs-nav { margin-bottom: 0; } .ant-collapse-content-box { padding: 0 4px 8px !important; } .ant-collapse-item:not(:last-child) { border-bottom: 1px solid ${({ theme }) => theme.colorBorderSecondary}; border-radius: 0 !important; } .ant-tabs { position: relative; overflow: hidden; height: 100%; } .ant-tabs-content-holder { position: relative; overflow-y: auto !important; height: 100%; } `; var CanvasView = import_styled_components.default.div` position: relative; overflow: hidden; flex: 1; height: 100%; `; var ContentView = import_styled_components.default.div` position: relative; overflow-x: hidden; overflow-y: auto; width: 100%; height: calc(100% - 46px); padding: 24px; `; var ColorView = (0, import_styled_components.default)(ContentView)` display: flex; flex-direction: column; gap: 8px; padding-bottom: 48px; `; var CodeView = (0, import_styled_components.default)(ContentView)` pre { background: none !important; } `; var PanelTitle = import_styled_components.default.div` display: flex; align-items: center; > svg { margin-right: 4px; } `; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { CanvasView, CodeView, ColorView, EditorView, PanelTitle, PanelView });