@docsplain-kit/core 0.0.57 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/div/div.js +2 -19
- package/div/div.js.map +1 -1
- package/modal/modal-theme.d.ts +0 -4
- package/modal/modal-theme.js +1 -8
- package/modal/modal-theme.js.map +1 -1
- package/modal/modal.d.ts +1 -1
- package/modal/modal.js +5 -4
- package/modal/modal.js.map +1 -1
- package/package.json +1 -1
- package/popper/popper-content/popper-content.d.ts +1 -1
- package/popper/popper-content/popper-content.js +2 -20
- package/popper/popper-content/popper-content.js.map +1 -1
- package/popper/popper-content/popper-content.props.d.ts +2 -0
- package/popper/popper-theme.d.ts +0 -8
- package/popper/popper-theme.js +1 -15
- package/popper/popper-theme.js.map +1 -1
- package/theme/color-class.d.ts +1 -0
- package/theme/color-class.js +23 -0
- package/theme/color-class.js.map +1 -0
package/div/div.js
CHANGED
|
@@ -5,27 +5,10 @@ exports.Div = void 0;
|
|
|
5
5
|
var tslib_1 = require("tslib");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
7
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
8
|
-
var
|
|
9
|
-
if (!color) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
return color
|
|
13
|
-
.trim()
|
|
14
|
-
.replace(/^!?(bg|border)-/, '')
|
|
15
|
-
.replace(/\./g, '-');
|
|
16
|
-
};
|
|
17
|
-
var getColorClass = function (type, color) {
|
|
18
|
-
var colorToken = normalizeColorToken(color);
|
|
19
|
-
if (!colorToken) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
return type === 'bg'
|
|
23
|
-
? "bg-[var(--dpc-bg-color)] dpc-bg-".concat(colorToken)
|
|
24
|
-
: "border-[var(--dpc-border-color)] dpc-border-".concat(colorToken);
|
|
25
|
-
};
|
|
8
|
+
var color_class_1 = require("../theme/color-class");
|
|
26
9
|
exports.Div = (0, react_1.forwardRef)(function Div(props, ref) {
|
|
27
10
|
var children = props.children, style = props.style, onClick = props.onClick, dangerouslySetInnerHTML = props.dangerouslySetInnerHTML, dataTestId = props.dataTestId, role = props.role, className = props.className, id = props.id, onMouseOver = props.onMouseOver, onMouseLeave = props.onMouseLeave, bgColor = props.bgColor, borderColor = props.borderColor, rest = tslib_1.__rest(props, ["children", "style", "onClick", "dangerouslySetInnerHTML", "dataTestId", "role", "className", "id", "onMouseOver", "onMouseLeave", "bgColor", "borderColor"]);
|
|
28
|
-
return (react_1["default"].createElement("div", tslib_1.__assign({ "data-testid": dataTestId, id: id, role: role, className: (0, tailwind_merge_config_1.twMerge)('flex flex-row', getColorClass('bg', bgColor), getColorClass('border', borderColor), className), dangerouslySetInnerHTML: dangerouslySetInnerHTML, onClick: onClick, style: style, ref: ref, onMouseOver: onMouseOver, onMouseLeave: onMouseLeave }, rest), children));
|
|
11
|
+
return (react_1["default"].createElement("div", tslib_1.__assign({ "data-testid": dataTestId, id: id, role: role, className: (0, tailwind_merge_config_1.twMerge)('flex flex-row', (0, color_class_1.getColorClass)('bg', bgColor), (0, color_class_1.getColorClass)('border', borderColor), className), dangerouslySetInnerHTML: dangerouslySetInnerHTML, onClick: onClick, style: style, ref: ref, onMouseOver: onMouseOver, onMouseLeave: onMouseLeave }, rest), children));
|
|
29
12
|
});
|
|
30
13
|
exports["default"] = exports.Div;
|
|
31
14
|
//# sourceMappingURL=div.js.map
|
package/div/div.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"div.js","sourceRoot":"","sources":["../../div/div.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAA0C;AAE1C,kEAAmD;
|
|
1
|
+
{"version":3,"file":"div.js","sourceRoot":"","sources":["../../div/div.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAA0C;AAE1C,kEAAmD;AACnD,oDAAqD;AAExC,QAAA,GAAG,GAAG,IAAA,kBAAU,EAAgB,SAAS,GAAG,CAAC,KAAK,EAAE,GAAG;IAC1D,IAAA,QAAQ,GAAyI,KAAK,SAA9I,EAAE,KAAK,GAAkI,KAAK,MAAvI,EAAE,OAAO,GAAyH,KAAK,QAA9H,EAAE,uBAAuB,GAAgG,KAAK,wBAArG,EAAE,UAAU,GAAoF,KAAK,WAAzF,EAAE,IAAI,GAA8E,KAAK,KAAnF,EAAE,SAAS,GAAmE,KAAK,UAAxE,EAAE,EAAE,GAA+D,KAAK,GAApE,EAAE,WAAW,GAAkD,KAAK,YAAvD,EAAE,YAAY,GAAoC,KAAK,aAAzC,EAAE,OAAO,GAA2B,KAAK,QAAhC,EAAE,WAAW,GAAc,KAAK,YAAnB,EAAK,IAAI,kBAAK,KAAK,EAAxJ,6JAAgJ,CAAF,CAAW;IAE/J,OAAO,CACL,0EACe,UAAU,EACvB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAA,+BAAO,EAChB,eAAe,EACf,IAAA,2BAAa,EAAC,IAAI,EAAE,OAAO,CAAC,EAC5B,IAAA,2BAAa,EAAC,QAAQ,EAAE,WAAW,CAAC,EACpC,SAAS,CACV,EACD,uBAAuB,EAAE,uBAAuB,EAChD,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,IACtB,IAAI,GAEP,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAe,WAAG,CAAC"}
|
package/modal/modal-theme.d.ts
CHANGED
package/modal/modal-theme.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.getModalSecondaryTextColor = exports.getModalTextColor = exports.getModalBackdrop =
|
|
4
|
-
/**
|
|
5
|
-
* Get modal background color based on theme
|
|
6
|
-
*/
|
|
7
|
-
var getModalBackground = function (theme) {
|
|
8
|
-
return theme === 'dark' ? 'bg-gray-900' : 'bg-white';
|
|
9
|
-
};
|
|
10
|
-
exports.getModalBackground = getModalBackground;
|
|
3
|
+
exports.getModalSecondaryTextColor = exports.getModalTextColor = exports.getModalBackdrop = void 0;
|
|
11
4
|
/**
|
|
12
5
|
* Get modal backdrop color based on theme
|
|
13
6
|
*/
|
package/modal/modal-theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-theme.js","sourceRoot":"","sources":["../../modal/modal-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,
|
|
1
|
+
{"version":3,"file":"modal-theme.js","sourceRoot":"","sources":["../../modal/modal-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,gBAAgB,GAAG,UAAC,KAAY;IAC3C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEF;;GAEG;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAY;IAC5C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;GAEG;AACI,IAAM,0BAA0B,GAAG,UAAC,KAAY;IACrD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,0BAA0B,8BAErC"}
|
package/modal/modal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ModalProps } from './modal.props';
|
|
3
|
-
export declare const Modal: ({ open, position, children, onClose, className, wrapperClassName }: ModalProps) => React.JSX.Element | null;
|
|
3
|
+
export declare const Modal: ({ open, position, children, onClose, className, wrapperClassName, bgColor }: ModalProps) => React.JSX.Element | null;
|
|
4
4
|
export default Modal;
|
package/modal/modal.js
CHANGED
|
@@ -7,6 +7,7 @@ var react_1 = tslib_1.__importStar(require("react"));
|
|
|
7
7
|
var div_1 = tslib_1.__importDefault(require("../div"));
|
|
8
8
|
var react_2 = require("motion/react");
|
|
9
9
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
10
|
+
var color_class_1 = require("../theme/color-class");
|
|
10
11
|
var modal_theme_1 = require("./modal-theme");
|
|
11
12
|
var SafeAnimatePresence = function (_a) {
|
|
12
13
|
var children = _a.children;
|
|
@@ -22,7 +23,7 @@ catch (_a) {
|
|
|
22
23
|
// Provider not available, use default
|
|
23
24
|
}
|
|
24
25
|
var Modal = function (_a) {
|
|
25
|
-
var open = _a.open, _b = _a.position, position = _b === void 0 ? 'float' : _b, children = _a.children, onClose = _a.onClose, className = _a.className, wrapperClassName = _a.wrapperClassName;
|
|
26
|
+
var open = _a.open, _b = _a.position, position = _b === void 0 ? 'float' : _b, children = _a.children, onClose = _a.onClose, className = _a.className, wrapperClassName = _a.wrapperClassName, _c = _a.bgColor, bgColor = _c === void 0 ? 'bg-whtie' : _c;
|
|
26
27
|
var escFunction = (0, react_1.useCallback)(function (event) {
|
|
27
28
|
if (event.key === 'Escape' && typeof onClose === 'function') {
|
|
28
29
|
event.preventDefault();
|
|
@@ -50,18 +51,18 @@ var Modal = function (_a) {
|
|
|
50
51
|
try {
|
|
51
52
|
theme = useThemeSafe();
|
|
52
53
|
}
|
|
53
|
-
catch (
|
|
54
|
+
catch (_d) {
|
|
54
55
|
// Not in provider, use default
|
|
55
56
|
}
|
|
56
57
|
if (position === 'float') {
|
|
57
58
|
return (react_1["default"].createElement(SafeAnimatePresence, null, open && (react_1["default"].createElement(react_2.motion.div, { key: "float", exit: { opacity: 0, transition: { duration: 0.6 } }, initial: { opacity: 0 }, animate: { opacity: 100, transition: { duration: 0.2 } }, className: (0, tailwind_merge_config_1.twMerge)("flex justify-center items-center backdrop-blur-sm fixed top-0 left-0 right-0 z-[1300] w-full h-dvh", (0, modal_theme_1.getModalBackdrop)(theme), className) },
|
|
58
59
|
react_1["default"].createElement(div_1["default"], { className: "-z-10 w-screen h-dvh absolute", onClick: onClose }),
|
|
59
|
-
react_1["default"].createElement(react_2.motion.div, { className: (0, tailwind_merge_config_1.twMerge)('relative w-11/12 md:w-2/3 md:max-w-[800px] md:h-auto h-3/4 z-40 rounded-lg md:p-6 pt-2 px-2 pb-0 flex flex-col justify-center items-center self-center gap-8', (0,
|
|
60
|
+
react_1["default"].createElement(react_2.motion.div, { className: (0, tailwind_merge_config_1.twMerge)('relative w-11/12 md:w-2/3 md:max-w-[800px] md:h-auto h-3/4 z-40 rounded-lg md:p-6 pt-2 px-2 pb-0 flex flex-col justify-center items-center self-center gap-8', (0, color_class_1.getColorClass)('bg', bgColor), wrapperClassName), exit: { translateY: 2000, transition: { duration: 0.6 } }, initial: { translateY: 2000 }, animate: { translateY: 0, transition: { duration: 0.5 } } }, children)))));
|
|
60
61
|
}
|
|
61
62
|
if (position === 'bottom') {
|
|
62
63
|
return (react_1["default"].createElement(SafeAnimatePresence, null, open && (react_1["default"].createElement(react_2.motion.div, { key: "bottom", exit: { opacity: 0, transition: { duration: 0.6 } }, initial: { opacity: 0 }, animate: { opacity: 100, transition: { duration: 0.2 } }, className: (0, tailwind_merge_config_1.twMerge)("flex w-full h-dvh justify-center backdrop-blur-sm fixed top-0 left-0 right-0 z-[1300] items-end", (0, modal_theme_1.getModalBackdrop)(theme), className) },
|
|
63
64
|
react_1["default"].createElement(div_1["default"], { onClick: onClose, className: '-z-10 w-screen h-dvh absolute' }),
|
|
64
|
-
react_1["default"].createElement(react_2.motion.div, { exit: { translateY: 2000, transition: { duration: 0.6 } }, initial: { translateY: 2000 }, animate: { translateY: 0, transition: { duration: 0.5 } }, className: (0, tailwind_merge_config_1.twMerge)('w-full h-auto rounded-tr-2xl rounded-tl-2xl justify-center overflow-hidden', (0,
|
|
65
|
+
react_1["default"].createElement(react_2.motion.div, { exit: { translateY: 2000, transition: { duration: 0.6 } }, initial: { translateY: 2000 }, animate: { translateY: 0, transition: { duration: 0.5 } }, className: (0, tailwind_merge_config_1.twMerge)('w-full h-auto rounded-tr-2xl rounded-tl-2xl justify-center overflow-hidden', (0, color_class_1.getColorClass)('bg', bgColor), wrapperClassName) }, children)))));
|
|
65
66
|
}
|
|
66
67
|
return null;
|
|
67
68
|
};
|
package/modal/modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../modal/modal.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAAsD;AAEtD,uDAAyB;AACzB,sCAAuD;AACvD,kEAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../modal/modal.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAAsD;AAEtD,uDAAyB;AACzB,sCAAuD;AACvD,kEAAmD;AACnD,oDAAqD;AACrD,6CAAiD;AAEjD,IAAM,mBAAmB,GAAG,UAAC,EAA2C;QAAzC,QAAQ,cAAA;IACrC,aAAa;IACb,OAAO,iCAAC,uBAAe,QAAE,QAAQ,CAAyC,CAAC;AAC7E,CAAC,CAAC;AAEF,IAAI,YAAY,GAA2B,cAAM,OAAA,OAAO,EAAP,CAAO,CAAC;AACzD,IAAI;IACM,IAAA,QAAQ,GAAK,OAAO,CAAC,aAAa,CAAC,SAA3B,CAA4B;IAC5C,YAAY,GAAG,QAAQ,CAAC;CACzB;AAAC,WAAM;IACN,sCAAsC;CACvC;AAEM,IAAM,KAAK,GAAG,UAAC,EAA8G;QAA5G,IAAI,UAAA,EAAE,gBAAkB,EAAlB,QAAQ,mBAAG,OAAO,KAAA,EAAE,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,SAAS,eAAA,EAAE,gBAAgB,sBAAA,EAAE,e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EAAE,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EACxD,SAAS,EAAE,IAAA,+BAAO,EAChB,iGAAiG,EACjG,IAAA,8BAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,CACV;YAED,iCAAC,gBAAG,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,+BAA+B,GAAG;YACpE,iCAAC,cAAM,CAAC,GAAG,IACT,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EACzD,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAC7B,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EACzD,SAAS,EAAE,IAAA,+BAAO,EAChB,4EAA4E,EAC5E,IAAA,2BAAa,EAAC,IAAI,EAAE,OAAO,CAAC,EAC5B,gBAAgB,CACjB,IAEA,QAAQ,CACE,CACF,CACd,CACmB,CACvB,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AArGW,QAAA,KAAK,SAqGhB;AAEF,qBAAe,aAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopperContentProps } from './popper-content.props';
|
|
3
3
|
declare const PopperContent: {
|
|
4
|
-
({ className, children, ref }: PopperContentProps): React.JSX.Element;
|
|
4
|
+
({ className, children, ref, bgColor, borderColor }: PopperContentProps): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default PopperContent;
|
|
@@ -4,27 +4,9 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
var div_1 = tslib_1.__importDefault(require("../../div"));
|
|
6
6
|
var tailwind_merge_config_1 = require("../../tailwind-merge-config");
|
|
7
|
-
var popper_theme_1 = require("../popper-theme");
|
|
8
|
-
// Try to import the theme provider, but make it optional
|
|
9
|
-
var useThemeSafe = function () { return 'light'; };
|
|
10
|
-
try {
|
|
11
|
-
var useTheme = require('../../provider').useTheme;
|
|
12
|
-
useThemeSafe = useTheme;
|
|
13
|
-
}
|
|
14
|
-
catch (_a) {
|
|
15
|
-
// Provider not available, use default
|
|
16
|
-
}
|
|
17
7
|
var PopperContent = function (_a) {
|
|
18
|
-
var className = _a.className, children = _a.children, ref = _a.ref;
|
|
19
|
-
|
|
20
|
-
var theme = 'light';
|
|
21
|
-
try {
|
|
22
|
-
theme = useThemeSafe();
|
|
23
|
-
}
|
|
24
|
-
catch (_b) {
|
|
25
|
-
// Not in provider, use default
|
|
26
|
-
}
|
|
27
|
-
return (react_1["default"].createElement(div_1["default"], { ref: ref, className: (0, tailwind_merge_config_1.twMerge)('h-auto w-full rounded-lg shadow-lg', (0, popper_theme_1.getPopperBackground)(theme), (0, popper_theme_1.getPopperBorder)(theme), 'border', className) }, children));
|
|
8
|
+
var className = _a.className, children = _a.children, ref = _a.ref, _b = _a.bgColor, bgColor = _b === void 0 ? 'bg-white' : _b, _c = _a.borderColor, borderColor = _c === void 0 ? 'border-control-200' : _c;
|
|
9
|
+
return (react_1["default"].createElement(div_1["default"], { ref: ref, bgColor: bgColor, borderColor: borderColor, className: (0, tailwind_merge_config_1.twMerge)('h-auto w-full rounded-lg shadow-lg border', className) }, children));
|
|
28
10
|
};
|
|
29
11
|
PopperContent.displayName = 'PopperContent';
|
|
30
12
|
exports["default"] = PopperContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popper-content.js","sourceRoot":"","sources":["../../../popper/popper-content/popper-content.tsx"],"names":[],"mappings":";;;AAAA,wDAA0B;AAE1B,0DAA4B;AAC5B,qEAAsD;
|
|
1
|
+
{"version":3,"file":"popper-content.js","sourceRoot":"","sources":["../../../popper/popper-content/popper-content.tsx"],"names":[],"mappings":";;;AAAA,wDAA0B;AAE1B,0DAA4B;AAC5B,qEAAsD;AAEtD,IAAM,aAAa,GAAG,UAAC,EAA0G;QAAxG,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAE,GAAG,SAAA,EAAE,eAAoB,EAApB,OAAO,mBAAG,UAAU,KAAA,EAAE,mBAAkC,EAAlC,WAAW,mBAAG,oBAAoB,KAAA;IACzG,OAAO,CACL,iCAAC,gBAAG,IACF,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,IAAA,+BAAO,EAChB,2CAA2C,EAC3C,SAAS,CACV,IAEA,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,qBAAe,aAAa,CAAC"}
|
package/popper/popper-theme.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { Theme } from '../provider';
|
|
2
|
-
/**
|
|
3
|
-
* Get popper content background color based on theme
|
|
4
|
-
*/
|
|
5
|
-
export declare const getPopperBackground: (theme: Theme) => string;
|
|
6
|
-
/**
|
|
7
|
-
* Get popper content border color based on theme
|
|
8
|
-
*/
|
|
9
|
-
export declare const getPopperBorder: (theme: Theme) => string;
|
|
10
2
|
/**
|
|
11
3
|
* Get popper content text color based on theme
|
|
12
4
|
*/
|
package/popper/popper-theme.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.getPopperHoverBackground = exports.getPopperSecondaryTextColor = exports.getPopperTextColor =
|
|
4
|
-
/**
|
|
5
|
-
* Get popper content background color based on theme
|
|
6
|
-
*/
|
|
7
|
-
var getPopperBackground = function (theme) {
|
|
8
|
-
return theme === 'dark' ? 'bg-gray-800' : 'bg-white';
|
|
9
|
-
};
|
|
10
|
-
exports.getPopperBackground = getPopperBackground;
|
|
11
|
-
/**
|
|
12
|
-
* Get popper content border color based on theme
|
|
13
|
-
*/
|
|
14
|
-
var getPopperBorder = function (theme) {
|
|
15
|
-
return theme === 'dark' ? 'border-gray-700' : 'border-gray-200';
|
|
16
|
-
};
|
|
17
|
-
exports.getPopperBorder = getPopperBorder;
|
|
3
|
+
exports.getPopperHoverBackground = exports.getPopperSecondaryTextColor = exports.getPopperTextColor = void 0;
|
|
18
4
|
/**
|
|
19
5
|
* Get popper content text color based on theme
|
|
20
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popper-theme.js","sourceRoot":"","sources":["../../popper/popper-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,
|
|
1
|
+
{"version":3,"file":"popper-theme.js","sourceRoot":"","sources":["../../popper/popper-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,kBAAkB,GAAG,UAAC,KAAY;IAC7C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEF;;GAEG;AACI,IAAM,2BAA2B,GAAG,UAAC,KAAY;IACtD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,2BAA2B,+BAEtC;AAEF;;GAEG;AACI,IAAM,wBAAwB,GAAG,UAAC,KAAY;IACnD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC;AACtE,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getColorClass: (type: 'bg' | 'border', color?: string) => string | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getColorClass = void 0;
|
|
4
|
+
var normalizeColorToken = function (color) {
|
|
5
|
+
if (!color) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
return color
|
|
9
|
+
.trim()
|
|
10
|
+
.replace(/^!?(bg|border)-/, '')
|
|
11
|
+
.replace(/./g, '-');
|
|
12
|
+
};
|
|
13
|
+
var getColorClass = function (type, color) {
|
|
14
|
+
var colorToken = normalizeColorToken(color);
|
|
15
|
+
if (!colorToken) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return type === 'bg'
|
|
19
|
+
? "bg-[var(--dpc-bg-color)] dpc-bg-".concat(colorToken)
|
|
20
|
+
: "border-[var(--dpc-border-color)] dpc-border-".concat(colorToken);
|
|
21
|
+
};
|
|
22
|
+
exports.getColorClass = getColorClass;
|
|
23
|
+
//# sourceMappingURL=color-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-class.js","sourceRoot":"","sources":["../../theme/color-class.ts"],"names":[],"mappings":";;;AAAA,IAAM,mBAAmB,GAAG,UAAC,KAAc;IACzC,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,KAAK;SACT,IAAI,EAAE;SACN,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;SAC9B,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACxB,CAAC,CAAC;AAEK,IAAM,aAAa,GAAG,UAAC,IAAqB,EAAE,KAAc;IACjE,IAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAE9C,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,IAAI,KAAK,IAAI;QAClB,CAAC,CAAC,0CAAmC,UAAU,CAAE;QACjD,CAAC,CAAC,sDAA+C,UAAU,CAAE,CAAC;AAClE,CAAC,CAAC;AAVW,QAAA,aAAa,iBAUxB"}
|