@docsplain-kit/core 0.0.48 → 0.0.50
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/auto-complete/auto-complete-theme.d.ts +29 -0
- package/auto-complete/auto-complete-theme.js +53 -0
- package/auto-complete/auto-complete-theme.js.map +1 -0
- package/auto-complete/auto-complete.js +23 -3
- package/auto-complete/auto-complete.js.map +1 -1
- package/card/card-body/card-body.js +10 -1
- package/card/card-body/card-body.js.map +1 -1
- package/card/card-theme.d.ts +26 -0
- package/card/card-theme.js +170 -0
- package/card/card-theme.js.map +1 -0
- package/card/card.js +11 -1
- package/card/card.js.map +1 -1
- package/card/card.style.d.ts +3 -79
- package/card/card.style.js +34 -50
- package/card/card.style.js.map +1 -1
- package/divider/divider-theme.d.ts +16 -0
- package/divider/divider-theme.js +82 -0
- package/divider/divider-theme.js.map +1 -0
- package/divider/divider.js +13 -3
- package/divider/divider.js.map +1 -1
- package/label/label-theme.d.ts +17 -0
- package/label/label-theme.js +35 -0
- package/label/label-theme.js.map +1 -0
- package/label/label.js +21 -3
- package/label/label.js.map +1 -1
- package/media/media.js +1 -1
- package/media/media.js.map +1 -1
- package/modal/modal-theme.d.ts +17 -0
- package/modal/modal-theme.js +32 -0
- package/modal/modal-theme.js.map +1 -0
- package/modal/modal.d.ts +1 -1
- package/modal/modal.js +22 -5
- package/modal/modal.js.map +1 -1
- package/mouse-popup/mouse-popup-theme.d.ts +17 -0
- package/mouse-popup/mouse-popup-theme.js +32 -0
- package/mouse-popup/mouse-popup-theme.js.map +1 -0
- package/mouse-popup/mouse-popup.js +19 -1
- package/mouse-popup/mouse-popup.js.map +1 -1
- package/multi-select/index.js.map +1 -1
- package/multi-select/multi-select-theme.d.ts +54 -0
- package/multi-select/multi-select-theme.js +127 -0
- package/multi-select/multi-select-theme.js.map +1 -0
- package/multi-select/multi-select.js +44 -10
- package/multi-select/multi-select.js.map +1 -1
- package/multi-select/multi-select.style.d.ts +97 -1
- package/multi-select/multi-select.style.js +99 -3
- package/multi-select/multi-select.style.js.map +1 -1
- package/package.json +1 -1
- package/popper/popper-content/popper-content.js +19 -1
- package/popper/popper-content/popper-content.js.map +1 -1
- package/popper/popper-theme.d.ts +21 -0
- package/popper/popper-theme.js +39 -0
- package/popper/popper-theme.js.map +1 -0
- package/select/select-theme.d.ts +50 -0
- package/select/select-theme.js +120 -0
- package/select/select-theme.js.map +1 -0
- package/select/select.js +44 -10
- package/select/select.js.map +1 -1
- package/select/select.style.d.ts +48 -16
- package/select/select.style.js +97 -65
- package/select/select.style.js.map +1 -1
- package/skeleton/skeleton-theme.d.ts +16 -0
- package/skeleton/skeleton-theme.js +82 -0
- package/skeleton/skeleton-theme.js.map +1 -0
- package/skeleton/skeleton.js +19 -1
- package/skeleton/skeleton.js.map +1 -1
- package/slider/slider-theme.d.ts +63 -0
- package/slider/slider-theme.js +219 -0
- package/slider/slider-theme.js.map +1 -0
- package/slider/slider.js +26 -8
- package/slider/slider.js.map +1 -1
- package/tab/tab-item/tab-item.style.js +21 -6
- package/tab/tab-item/tab-item.style.js.map +1 -1
- package/tab/tab-theme.d.ts +42 -0
- package/tab/tab-theme.js +242 -0
- package/tab/tab-theme.js.map +1 -0
- package/tab/tab.js +21 -3
- package/tab/tab.js.map +1 -1
- package/text-input/text-input-theme.d.ts +30 -0
- package/text-input/text-input-theme.js +73 -0
- package/text-input/text-input-theme.js.map +1 -0
- package/text-input/text-input.js +26 -4
- package/text-input/text-input.js.map +1 -1
- package/text-input/text-input.style.d.ts +33 -1
- package/text-input/text-input.style.js +34 -2
- package/text-input/text-input.style.js.map +1 -1
- package/textarea/textarea-theme.d.ts +30 -0
- package/textarea/textarea-theme.js +73 -0
- package/textarea/textarea-theme.js.map +1 -0
- package/textarea/textarea.js +26 -4
- package/textarea/textarea.js.map +1 -1
- package/textarea/textarea.style.d.ts +33 -1
- package/textarea/textarea.style.js +34 -2
- package/textarea/textarea.style.js.map +1 -1
package/card/card.style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.style.js","sourceRoot":"","sources":["../../card/card.style.ts"],"names":[],"mappings":";;;AAEa,QAAA,
|
|
1
|
+
{"version":3,"file":"card.style.js","sourceRoot":"","sources":["../../card/card.style.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAA+B;IACtD,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,mBAAmB;IAC9B,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,eAAe;IACtB,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,gBAAgB;IACxB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,EAAE,EAAE,kDAAkD;CACvD,CAAC;AAEW,QAAA,WAAW,GAA+B;IACrD,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,mBAAmB;IAC9B,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE,eAAe;IACtB,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,gBAAgB;IACxB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,cAAc;IACpB,EAAE,EAAE,kDAAkD;CACvD,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,cAAc;CACxB,CAAC;AAEW,QAAA,OAAO,GAAG;IACrB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,cAAc;CACrB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
import { Colors } from '../types';
|
|
3
|
+
type ExtendedColors = Colors | 'tertiary';
|
|
4
|
+
/**
|
|
5
|
+
* Light Theme Divider Colors
|
|
6
|
+
*/
|
|
7
|
+
export declare const DIVIDER_COLORS_LIGHT: Record<ExtendedColors, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Dark Theme Divider Colors
|
|
10
|
+
*/
|
|
11
|
+
export declare const DIVIDER_COLORS_DARK: Record<ExtendedColors, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to get divider colors based on theme
|
|
14
|
+
*/
|
|
15
|
+
export declare const getDividerColors: (theme: Theme, color: Colors) => string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getDividerColors = exports.DIVIDER_COLORS_DARK = exports.DIVIDER_COLORS_LIGHT = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Light Theme Divider Colors
|
|
6
|
+
*/
|
|
7
|
+
exports.DIVIDER_COLORS_LIGHT = {
|
|
8
|
+
primary: 'border-primary-500/75',
|
|
9
|
+
danger: 'border-danger-500/75',
|
|
10
|
+
info: 'border-info-500/75',
|
|
11
|
+
control: 'border-control-200/75',
|
|
12
|
+
success: 'border-success-500/75',
|
|
13
|
+
warning: 'border-warning-500/75',
|
|
14
|
+
tertiary: 'border-tertiary-500/75',
|
|
15
|
+
secondary: 'border-secondary-500/75',
|
|
16
|
+
inherit: 'border-inherit',
|
|
17
|
+
slate: 'border-slate-500/75',
|
|
18
|
+
zinc: 'border-zinc-500/75',
|
|
19
|
+
neutral: 'border-neutral-500/75',
|
|
20
|
+
stone: 'border-stone-500/75',
|
|
21
|
+
red: 'border-red-500/75',
|
|
22
|
+
orange: 'border-orange-500/75',
|
|
23
|
+
amber: 'border-amber-500/75',
|
|
24
|
+
yellow: 'border-yellow-500/75',
|
|
25
|
+
lime: 'border-lime-500/75',
|
|
26
|
+
green: 'border-green-500/75',
|
|
27
|
+
emerald: 'border-emerald-500/75',
|
|
28
|
+
teal: 'border-teal-500/75',
|
|
29
|
+
cyan: 'border-cyan-500/75',
|
|
30
|
+
sky: 'border-sky-500/75',
|
|
31
|
+
blue: 'border-blue-500/75',
|
|
32
|
+
indigo: 'border-indigo-500/75',
|
|
33
|
+
violet: 'border-violet-500/75',
|
|
34
|
+
purple: 'border-purple-500/75',
|
|
35
|
+
fuchsia: 'border-fuchsia-500/75',
|
|
36
|
+
pink: 'border-pink-500/75',
|
|
37
|
+
rose: 'border-rose-500/75'
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Dark Theme Divider Colors
|
|
41
|
+
*/
|
|
42
|
+
exports.DIVIDER_COLORS_DARK = {
|
|
43
|
+
primary: 'border-primary-400/75',
|
|
44
|
+
danger: 'border-danger-400/75',
|
|
45
|
+
info: 'border-info-400/75',
|
|
46
|
+
control: 'border-gray-600/75',
|
|
47
|
+
success: 'border-success-400/75',
|
|
48
|
+
warning: 'border-warning-400/75',
|
|
49
|
+
tertiary: 'border-tertiary-400/75',
|
|
50
|
+
secondary: 'border-secondary-400/75',
|
|
51
|
+
inherit: 'border-inherit',
|
|
52
|
+
slate: 'border-slate-400/75',
|
|
53
|
+
zinc: 'border-zinc-400/75',
|
|
54
|
+
neutral: 'border-neutral-400/75',
|
|
55
|
+
stone: 'border-stone-400/75',
|
|
56
|
+
red: 'border-red-400/75',
|
|
57
|
+
orange: 'border-orange-400/75',
|
|
58
|
+
amber: 'border-amber-400/75',
|
|
59
|
+
yellow: 'border-yellow-400/75',
|
|
60
|
+
lime: 'border-lime-400/75',
|
|
61
|
+
green: 'border-green-400/75',
|
|
62
|
+
emerald: 'border-emerald-400/75',
|
|
63
|
+
teal: 'border-teal-400/75',
|
|
64
|
+
cyan: 'border-cyan-400/75',
|
|
65
|
+
sky: 'border-sky-400/75',
|
|
66
|
+
blue: 'border-blue-400/75',
|
|
67
|
+
indigo: 'border-indigo-400/75',
|
|
68
|
+
violet: 'border-violet-400/75',
|
|
69
|
+
purple: 'border-purple-400/75',
|
|
70
|
+
fuchsia: 'border-fuchsia-400/75',
|
|
71
|
+
pink: 'border-pink-400/75',
|
|
72
|
+
rose: 'border-rose-400/75'
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Helper function to get divider colors based on theme
|
|
76
|
+
*/
|
|
77
|
+
var getDividerColors = function (theme, color) {
|
|
78
|
+
var colorMap = theme === 'dark' ? exports.DIVIDER_COLORS_DARK : exports.DIVIDER_COLORS_LIGHT;
|
|
79
|
+
return colorMap[color] || colorMap['control'];
|
|
80
|
+
};
|
|
81
|
+
exports.getDividerColors = getDividerColors;
|
|
82
|
+
//# sourceMappingURL=divider-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider-theme.js","sourceRoot":"","sources":["../../divider/divider-theme.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACU,QAAA,oBAAoB,GAAmC;IAClE,OAAO,EAAE,uBAAuB;IAChC,MAAM,EAAE,sBAAsB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,uBAAuB;IAChC,QAAQ,EAAE,wBAAwB;IAClC,SAAS,EAAE,yBAAyB;IACpC,OAAO,EAAE,gBAAgB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,uBAAuB;IAChC,KAAK,EAAE,qBAAqB;IAC5B,GAAG,EAAE,mBAAmB;IACxB,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,sBAAsB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,qBAAqB;IAC5B,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,mBAAmB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,MAAM,EAAE,sBAAsB;IAC9B,MAAM,EAAE,sBAAsB;IAC9B,OAAO,E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oBAG3B"}
|
package/divider/divider.js
CHANGED
|
@@ -4,17 +4,27 @@ exports.Divider = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
var divider_styles_1 = require("./divider.styles");
|
|
7
|
+
var divider_theme_1 = require("./divider-theme");
|
|
8
|
+
var provider_1 = require("../provider");
|
|
7
9
|
var div_1 = tslib_1.__importDefault(require("../div"));
|
|
8
10
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
9
11
|
var Divider = function (_a) {
|
|
10
12
|
var children = _a.children, alignContent = _a.alignContent, _b = _a.color, color = _b === void 0 ? 'control' : _b, _c = _a.type, type = _c === void 0 ? 'solid' : _c, _d = _a.vertical, vertical = _d === void 0 ? false : _d, className = _a.className, startAdornmentClassName = _a.startAdornmentClassName, endAdornmentClassName = _a.endAdornmentClassName, rest = tslib_1.__rest(_a, ["children", "alignContent", "color", "type", "vertical", "className", "startAdornmentClassName", "endAdornmentClassName"]);
|
|
13
|
+
// Safe theme detection
|
|
14
|
+
var currentTheme = 'light';
|
|
15
|
+
try {
|
|
16
|
+
currentTheme = (0, provider_1.useTheme)();
|
|
17
|
+
}
|
|
18
|
+
catch (_e) {
|
|
19
|
+
// Provider not found, use default light theme
|
|
20
|
+
}
|
|
11
21
|
if (children) {
|
|
12
22
|
return (react_1["default"].createElement(div_1["default"], tslib_1.__assign({ className: (0, tailwind_merge_config_1.twMerge)('gap-x-3.5 items-center', vertical ? 'flex-col h-full' : 'flex-row w-full', className) }, rest),
|
|
13
|
-
alignContent !== 'start' ? (react_1["default"].createElement("div", { className: (0, tailwind_merge_config_1.twMerge)(vertical ? "h-full border-l" : "w-full border-t",
|
|
23
|
+
alignContent !== 'start' ? (react_1["default"].createElement("div", { className: (0, tailwind_merge_config_1.twMerge)(vertical ? "h-full border-l" : "w-full border-t", (0, divider_theme_1.getDividerColors)(currentTheme, color), divider_styles_1.TYPE[type], startAdornmentClassName) })) : null,
|
|
14
24
|
react_1["default"].createElement(div_1["default"], null, children),
|
|
15
|
-
alignContent !== 'end' ? (react_1["default"].createElement("div", { className: (0, tailwind_merge_config_1.twMerge)(vertical ? "h-full border-l" : "w-full border-t",
|
|
25
|
+
alignContent !== 'end' ? (react_1["default"].createElement("div", { className: (0, tailwind_merge_config_1.twMerge)(vertical ? "h-full border-l" : "w-full border-t", (0, divider_theme_1.getDividerColors)(currentTheme, color), divider_styles_1.TYPE[type], endAdornmentClassName) })) : null));
|
|
16
26
|
}
|
|
17
|
-
return (react_1["default"].createElement("div", tslib_1.__assign({ className: (0, tailwind_merge_config_1.twMerge)(vertical ? "h-full border-l" : "w-full border-t",
|
|
27
|
+
return (react_1["default"].createElement("div", tslib_1.__assign({ className: (0, tailwind_merge_config_1.twMerge)(vertical ? "h-full border-l" : "w-full border-t", (0, divider_theme_1.getDividerColors)(currentTheme, color), divider_styles_1.TYPE[type], className) }, rest)));
|
|
18
28
|
};
|
|
19
29
|
exports.Divider = Divider;
|
|
20
30
|
exports["default"] = exports.Divider;
|
package/divider/divider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../divider/divider.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../divider/divider.tsx"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAE1B,mDAAwC;AACxC,iDAAmD;AACnD,wCAAuC;AACvC,uDAAyB;AACzB,kEAAmD;AAE5C,IAAM,OAAO,GAAG,UAAC,EAAiK;IAA/J,IAAA,QAAQ,cAAA,EAAE,YAAY,kBAAA,EAAE,aAAiB,EAAjB,KAAK,mBAAG,SAAS,KAAA,EAAE,YAAc,EAAd,IAAI,mBAAG,OAAO,KAAA,EAAE,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,SAAS,eAAA,EAAE,uBAAuB,6BAAA,EAA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S,CACV,IACG,IAAI,EACR,CACH,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,OAAO,WA2ClB;AAEF,qBAAe,eAAO,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
/**
|
|
3
|
+
* Get label text color based on theme
|
|
4
|
+
*/
|
|
5
|
+
export declare const getLabelTextColor: (theme: Theme) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Get validation message text color based on theme
|
|
8
|
+
*/
|
|
9
|
+
export declare const getValidationMessageColor: (theme: Theme, validationState: 'error' | 'warning' | 'success' | 'info' | 'none') => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get more info icon hover color based on theme
|
|
12
|
+
*/
|
|
13
|
+
export declare const getMoreInfoIconHoverColor: (theme: Theme) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Get more info popup text color based on theme
|
|
16
|
+
*/
|
|
17
|
+
export declare const getMoreInfoPopupTextColor: (theme: Theme) => string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getMoreInfoPopupTextColor = exports.getMoreInfoIconHoverColor = exports.getValidationMessageColor = exports.getLabelTextColor = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get label text color based on theme
|
|
6
|
+
*/
|
|
7
|
+
var getLabelTextColor = function (theme) {
|
|
8
|
+
return theme === 'dark' ? 'text-control-100' : 'text-control-800';
|
|
9
|
+
};
|
|
10
|
+
exports.getLabelTextColor = getLabelTextColor;
|
|
11
|
+
/**
|
|
12
|
+
* Get validation message text color based on theme
|
|
13
|
+
*/
|
|
14
|
+
var getValidationMessageColor = function (theme, validationState) {
|
|
15
|
+
if (validationState === 'error') {
|
|
16
|
+
return 'danger';
|
|
17
|
+
}
|
|
18
|
+
return theme === 'dark' ? 'control.400' : 'control.600';
|
|
19
|
+
};
|
|
20
|
+
exports.getValidationMessageColor = getValidationMessageColor;
|
|
21
|
+
/**
|
|
22
|
+
* Get more info icon hover color based on theme
|
|
23
|
+
*/
|
|
24
|
+
var getMoreInfoIconHoverColor = function (theme) {
|
|
25
|
+
return theme === 'dark' ? 'hover:text-primary-300 hover:bg-info-900/40' : 'hover:text-primary hover:bg-info';
|
|
26
|
+
};
|
|
27
|
+
exports.getMoreInfoIconHoverColor = getMoreInfoIconHoverColor;
|
|
28
|
+
/**
|
|
29
|
+
* Get more info popup text color based on theme
|
|
30
|
+
*/
|
|
31
|
+
var getMoreInfoPopupTextColor = function (theme) {
|
|
32
|
+
return theme === 'dark' ? 'control.300' : 'control.600';
|
|
33
|
+
};
|
|
34
|
+
exports.getMoreInfoPopupTextColor = getMoreInfoPopupTextColor;
|
|
35
|
+
//# sourceMappingURL=label-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-theme.js","sourceRoot":"","sources":["../../label/label-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAY;IAC5C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY,EAAE,eAAkE;IACxH,IAAI,eAAe,KAAK,OAAO,EAAE;QAC/B,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AAC1D,CAAC,CAAC;AALW,QAAA,yBAAyB,6BAKpC;AAEF;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY;IACpD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,6CAA6C,CAAC,CAAC,CAAC,kCAAkC,CAAC;AAC/G,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEF;;GAEG;AACI,IAAM,yBAAyB,GAAG,UAAC,KAAY;IACpD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC"}
|
package/label/label.js
CHANGED
|
@@ -8,17 +8,35 @@ var text_1 = tslib_1.__importDefault(require("../text"));
|
|
|
8
8
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
9
9
|
var div_1 = tslib_1.__importDefault(require("../div"));
|
|
10
10
|
var mouse_popup_1 = tslib_1.__importDefault(require("../mouse-popup"));
|
|
11
|
+
var label_theme_1 = require("./label-theme");
|
|
12
|
+
// Try to import the theme provider, but make it optional
|
|
13
|
+
var useThemeSafe = function () { return 'light'; };
|
|
14
|
+
try {
|
|
15
|
+
var useTheme = require('../provider').useTheme;
|
|
16
|
+
useThemeSafe = useTheme;
|
|
17
|
+
}
|
|
18
|
+
catch (_a) {
|
|
19
|
+
// Provider not available, use default
|
|
20
|
+
}
|
|
11
21
|
var Label = function (props) {
|
|
12
22
|
var className = props.className, label = props.label, children = props.children, containerRef = props.containerRef, disabled = props.disabled, _a = props.required, required = _a === void 0 ? false : _a, textProps = props.textProps, _b = props.orientation, orientation = _b === void 0 ? 'vertical' : _b, moreInfo = props.moreInfo, _c = props.validationState, validationState = _c === void 0 ? 'none' : _c, validationMessage = props.validationMessage, wrapperClassName = props.wrapperClassName;
|
|
13
23
|
var _d = (0, react_1.useState)(false), show = _d[0], setShow = _d[1];
|
|
24
|
+
// Try to get theme from provider, fallback to 'light'
|
|
25
|
+
var theme = 'light';
|
|
26
|
+
try {
|
|
27
|
+
theme = useThemeSafe();
|
|
28
|
+
}
|
|
29
|
+
catch (_e) {
|
|
30
|
+
// Not in provider, use default
|
|
31
|
+
}
|
|
14
32
|
return (react_1["default"].createElement(div_1["default"], { className: (0, tailwind_merge_config_1.twMerge)('flex-col w-full gap-y-0.5', wrapperClassName) },
|
|
15
33
|
react_1["default"].createElement("label", { className: (0, tailwind_merge_config_1.twMerge)('w-fit flex justify-center gap-1.5', orientation === 'vertical' ? 'flex-col' : 'flex-row', disabled ? 'cursor-not-allowed' : 'cursor-pointer', className), ref: containerRef },
|
|
16
34
|
react_1["default"].createElement(div_1["default"], { className: 'items-center gap-x-1' },
|
|
17
35
|
react_1["default"].createElement(text_1["default"], tslib_1.__assign({ align: 'start', type: 'medium', disabled: disabled, typography: (textProps === null || textProps === void 0 ? void 0 : textProps.typography) || 'sm' }, textProps),
|
|
18
36
|
label,
|
|
19
37
|
required ? react_1["default"].createElement(text_1["default"], { variant: 'span', typography: 'inherit', color: 'danger', className: 'ps-1' }, "*") : null),
|
|
20
|
-
moreInfo ? (react_1["default"].createElement(mouse_popup_1["default"], { show: show, content: react_1["default"].createElement(text_1["default"], { typography: 'sm', color:
|
|
21
|
-
react_1["default"].createElement("div", { onMouseEnter: function () { return setShow(true); }, onMouseLeave: function () { return setShow(false); }, className: '
|
|
38
|
+
moreInfo ? (react_1["default"].createElement(mouse_popup_1["default"], { show: show, content: react_1["default"].createElement(text_1["default"], { typography: 'sm', color: (0, label_theme_1.getMoreInfoPopupTextColor)(theme) }, moreInfo) },
|
|
39
|
+
react_1["default"].createElement("div", { onMouseEnter: function () { return setShow(true); }, onMouseLeave: function () { return setShow(false); }, className: (0, tailwind_merge_config_1.twMerge)('rounded-full', (0, label_theme_1.getMoreInfoIconHoverColor)(theme)) },
|
|
22
40
|
react_1["default"].createElement("svg", { width: "22", height: "22", viewBox: "0 0 22 22", className: 'w-4 h-4 hover:text-white', fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
23
41
|
react_1["default"].createElement("path", { d: "M12 15C12 15.5523 11.5523 16 11 16C10.4477 16 10 15.5523 10 15C10 14.4477 10.4477 14 11 14C11.5523 14 12 14.4477 12 15Z", fill: "currentColor" }),
|
|
24
42
|
react_1["default"].createElement("path", { d: "M11.75 6C11.75 5.58579 11.4142 5.25 11 5.25C10.5858 5.25 10.25 5.58579 10.25 6V12C10.25 12.4142 10.5858 12.75 11 12.75C11.4142 12.75 11.75 12.4142 11.75 12V6Z", fill: "currentColor" }),
|
|
@@ -27,7 +45,7 @@ var Label = function (props) {
|
|
|
27
45
|
validationMessage ? (react_1["default"].createElement(div_1["default"], { className: 'gap-x-1 items-center' },
|
|
28
46
|
react_1["default"].createElement(div_1["default"], { className: 'w-3 h-3 items-center justify-center' },
|
|
29
47
|
react_1["default"].createElement(Icon, { validationState: validationState })),
|
|
30
|
-
react_1["default"].createElement(text_1["default"], { typography: 'xs', color:
|
|
48
|
+
react_1["default"].createElement(text_1["default"], { typography: 'xs', color: (0, label_theme_1.getValidationMessageColor)(theme, validationState), align: 'start' }, validationMessage))) : null));
|
|
31
49
|
};
|
|
32
50
|
exports.Label = Label;
|
|
33
51
|
var Icon = function (_a) {
|
package/label/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../label/label.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAAwC;AAExC,yDAA2B;AAC3B,kEAAmD;AACnD,uDAAyB;AACzB,uEAAwC;
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../label/label.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AAEb,qDAAwC;AAExC,yDAA2B;AAC3B,kEAAmD;AACnD,uDAAyB;AACzB,uEAAwC;AACxC,6CAIuB;AAEvB,yDAAyD;AACzD,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,KAAiB;IAEnC,IAAA,SAAS,GAYP,KAAK,UAZE,EACT,KAAK,GAW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c,GAAE,CAClK,CACP,CAAC;KACH;IAED,OAAO,CACL,0CAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,SAAS,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;QAClK,2CAAM,CAAC,EAAC,yHAAyH,EAAC,IAAI,EAAC,cAAc,GAAE;QACvJ,2CAAM,CAAC,EAAC,gKAAgK,EAAC,IAAI,EAAC,cAAc,GAAE;QAC9L,2CAAM,QAAQ,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAC,CAAC,EAAC,gTAAgT,EAAC,IAAI,EAAC,cAAc,GAAE,CAChX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAe,aAAK,CAAC"}
|
package/media/media.js
CHANGED
|
@@ -7,7 +7,7 @@ var media_style_1 = require("./media.style");
|
|
|
7
7
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
8
8
|
var Media = function (props) {
|
|
9
9
|
var children = props.children, style = props.style, at = props.at, greaterThan = props.greaterThan, lessThan = props.lessThan, between = props.between, className = props.className;
|
|
10
|
-
return (react_1["default"].createElement("div", { style: style, className: (0, tailwind_merge_config_1.twMerge)((0, media_style_1.STYLES)({ at: at, greaterThan: greaterThan, lessThan: lessThan, between: between }), className) }, children));
|
|
10
|
+
return (react_1["default"].createElement("div", { style: style, className: (0, tailwind_merge_config_1.twMerge)('bg-transparent', (0, media_style_1.STYLES)({ at: at, greaterThan: greaterThan, lessThan: lessThan, between: between }), className) }, children));
|
|
11
11
|
};
|
|
12
12
|
exports.Media = Media;
|
|
13
13
|
exports["default"] = exports.Media;
|
package/media/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../media/media.tsx"],"names":[],"mappings":";;;;AAAA,wDA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,QAAQ,CAAO,CACpB,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,KAAK,SAUhB;AAEF,qBAAe,aAAK,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
/**
|
|
3
|
+
* Get modal background color based on theme
|
|
4
|
+
*/
|
|
5
|
+
export declare const getModalBackground: (theme: Theme) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Get modal backdrop color based on theme
|
|
8
|
+
*/
|
|
9
|
+
export declare const getModalBackdrop: (theme: Theme) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get modal text color based on theme
|
|
12
|
+
*/
|
|
13
|
+
export declare const getModalTextColor: (theme: Theme) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Get modal secondary text color based on theme
|
|
16
|
+
*/
|
|
17
|
+
export declare const getModalSecondaryTextColor: (theme: Theme) => string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getModalSecondaryTextColor = exports.getModalTextColor = exports.getModalBackdrop = exports.getModalBackground = void 0;
|
|
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;
|
|
11
|
+
/**
|
|
12
|
+
* Get modal backdrop color based on theme
|
|
13
|
+
*/
|
|
14
|
+
var getModalBackdrop = function (theme) {
|
|
15
|
+
return theme === 'dark' ? 'bg-black/60' : 'bg-black/[0.2]';
|
|
16
|
+
};
|
|
17
|
+
exports.getModalBackdrop = getModalBackdrop;
|
|
18
|
+
/**
|
|
19
|
+
* Get modal text color based on theme
|
|
20
|
+
*/
|
|
21
|
+
var getModalTextColor = function (theme) {
|
|
22
|
+
return theme === 'dark' ? 'text-gray-100' : 'text-gray-900';
|
|
23
|
+
};
|
|
24
|
+
exports.getModalTextColor = getModalTextColor;
|
|
25
|
+
/**
|
|
26
|
+
* Get modal secondary text color based on theme
|
|
27
|
+
*/
|
|
28
|
+
var getModalSecondaryTextColor = function (theme) {
|
|
29
|
+
return theme === 'dark' ? 'text-gray-300' : 'text-gray-600';
|
|
30
|
+
};
|
|
31
|
+
exports.getModalSecondaryTextColor = getModalSecondaryTextColor;
|
|
32
|
+
//# sourceMappingURL=modal-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-theme.js","sourceRoot":"","sources":["../../modal/modal-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,kBAAkB,GAAG,UAAC,KAAY;IAC7C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEF;;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
|
|
3
|
+
export declare const Modal: ({ open, position, children, onClose, className, wrapperClassName }: ModalProps) => React.JSX.Element | null;
|
|
4
4
|
export default Modal;
|
package/modal/modal.js
CHANGED
|
@@ -7,13 +7,22 @@ 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 modal_theme_1 = require("./modal-theme");
|
|
10
11
|
var SafeAnimatePresence = function (_a) {
|
|
11
12
|
var children = _a.children;
|
|
12
13
|
// @ts-ignore
|
|
13
14
|
return react_1["default"].createElement(react_2.AnimatePresence, null, children);
|
|
14
15
|
};
|
|
16
|
+
var useThemeSafe = function () { return 'light'; };
|
|
17
|
+
try {
|
|
18
|
+
var useTheme = require('../provider').useTheme;
|
|
19
|
+
useThemeSafe = useTheme;
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
// Provider not available, use default
|
|
23
|
+
}
|
|
15
24
|
var Modal = function (_a) {
|
|
16
|
-
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
|
|
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;
|
|
17
26
|
var escFunction = (0, react_1.useCallback)(function (event) {
|
|
18
27
|
if (event.key === 'Escape' && typeof onClose === 'function') {
|
|
19
28
|
event.preventDefault();
|
|
@@ -36,15 +45,23 @@ var Modal = function (_a) {
|
|
|
36
45
|
window.removeEventListener('keydown', escFunction, { capture: true });
|
|
37
46
|
};
|
|
38
47
|
}, [open, escFunction]);
|
|
48
|
+
// Try to get theme from provider, fallback to 'light'
|
|
49
|
+
var theme = 'light';
|
|
50
|
+
try {
|
|
51
|
+
theme = useThemeSafe();
|
|
52
|
+
}
|
|
53
|
+
catch (_c) {
|
|
54
|
+
// Not in provider, use default
|
|
55
|
+
}
|
|
39
56
|
if (position === 'float') {
|
|
40
|
-
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
|
|
57
|
+
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) },
|
|
41
58
|
react_1["default"].createElement(div_1["default"], { className: "-z-10 w-screen h-dvh absolute", onClick: onClose }),
|
|
42
|
-
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
|
|
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, modal_theme_1.getModalBackground)(theme), wrapperClassName), exit: { translateY: 2000, transition: { duration: 0.6 } }, initial: { translateY: 2000 }, animate: { translateY: 0, transition: { duration: 0.5 } } }, children)))));
|
|
43
60
|
}
|
|
44
61
|
if (position === 'bottom') {
|
|
45
|
-
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
|
|
62
|
+
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) },
|
|
46
63
|
react_1["default"].createElement(div_1["default"], { onClick: onClose, className: '-z-10 w-screen h-dvh absolute' }),
|
|
47
|
-
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
|
|
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, modal_theme_1.getModalBackground)(theme), wrapperClassName) }, children)))));
|
|
48
65
|
}
|
|
49
66
|
return null;
|
|
50
67
|
};
|
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;
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../modal/modal.tsx"],"names":[],"mappings":";AAAA,YAAY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A,QAAQ,CACE,CACF,CACd,CACmB,CACvB,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AArGW,QAAA,KAAK,SAqGhB;AAEF,qBAAe,aAAK,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
/**
|
|
3
|
+
* Get mouse popup background color based on theme
|
|
4
|
+
*/
|
|
5
|
+
export declare const getMousePopupBackground: (theme: Theme) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Get mouse popup border color based on theme
|
|
8
|
+
*/
|
|
9
|
+
export declare const getMousePopupBorder: (theme: Theme) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get mouse popup text color based on theme
|
|
12
|
+
*/
|
|
13
|
+
export declare const getMousePopupTextColor: (theme: Theme) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Get mouse popup secondary text color based on theme
|
|
16
|
+
*/
|
|
17
|
+
export declare const getMousePopupSecondaryTextColor: (theme: Theme) => string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getMousePopupSecondaryTextColor = exports.getMousePopupTextColor = exports.getMousePopupBorder = exports.getMousePopupBackground = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get mouse popup background color based on theme
|
|
6
|
+
*/
|
|
7
|
+
var getMousePopupBackground = function (theme) {
|
|
8
|
+
return theme === 'dark' ? 'bg-gray-800' : 'bg-white';
|
|
9
|
+
};
|
|
10
|
+
exports.getMousePopupBackground = getMousePopupBackground;
|
|
11
|
+
/**
|
|
12
|
+
* Get mouse popup border color based on theme
|
|
13
|
+
*/
|
|
14
|
+
var getMousePopupBorder = function (theme) {
|
|
15
|
+
return theme === 'dark' ? 'border-gray-700' : 'border-gray-200';
|
|
16
|
+
};
|
|
17
|
+
exports.getMousePopupBorder = getMousePopupBorder;
|
|
18
|
+
/**
|
|
19
|
+
* Get mouse popup text color based on theme
|
|
20
|
+
*/
|
|
21
|
+
var getMousePopupTextColor = function (theme) {
|
|
22
|
+
return theme === 'dark' ? 'text-gray-100' : 'text-gray-900';
|
|
23
|
+
};
|
|
24
|
+
exports.getMousePopupTextColor = getMousePopupTextColor;
|
|
25
|
+
/**
|
|
26
|
+
* Get mouse popup secondary text color based on theme
|
|
27
|
+
*/
|
|
28
|
+
var getMousePopupSecondaryTextColor = function (theme) {
|
|
29
|
+
return theme === 'dark' ? 'text-gray-300' : 'text-gray-600';
|
|
30
|
+
};
|
|
31
|
+
exports.getMousePopupSecondaryTextColor = getMousePopupSecondaryTextColor;
|
|
32
|
+
//# sourceMappingURL=mouse-popup-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse-popup-theme.js","sourceRoot":"","sources":["../../mouse-popup/mouse-popup-theme.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACI,IAAM,uBAAuB,GAAG,UAAC,KAAY;IAClD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC;AAEF;;GAEG;AACI,IAAM,mBAAmB,GAAG,UAAC,KAAY;IAC9C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAClE,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B;AAEF;;GAEG;AACI,IAAM,sBAAsB,GAAG,UAAC,KAAY;IACjD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,sBAAsB,0BAEjC;AAEF;;GAEG;AACI,IAAM,+BAA+B,GAAG,UAAC,KAAY;IAC1D,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,+BAA+B,mCAE1C"}
|
|
@@ -5,6 +5,16 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var div_1 = tslib_1.__importDefault(require("../div"));
|
|
7
7
|
var tailwind_merge_config_1 = require("../tailwind-merge-config");
|
|
8
|
+
var mouse_popup_theme_1 = require("./mouse-popup-theme");
|
|
9
|
+
// Try to import the theme provider, but make it optional
|
|
10
|
+
var useThemeSafe = function () { return 'light'; };
|
|
11
|
+
try {
|
|
12
|
+
var useTheme = require('../provider').useTheme;
|
|
13
|
+
useThemeSafe = useTheme;
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
// Provider not available, use default
|
|
17
|
+
}
|
|
8
18
|
var MousePopup = function (_a) {
|
|
9
19
|
var children = _a.children, content = _a.content, show = _a.show, _b = _a.className, className = _b === void 0 ? '' : _b;
|
|
10
20
|
var _c = (0, react_1.useState)({ x: 0, y: 0 }), mousePosition = _c[0], setMousePosition = _c[1];
|
|
@@ -32,13 +42,21 @@ var MousePopup = function (_a) {
|
|
|
32
42
|
return { x: x, y: y };
|
|
33
43
|
};
|
|
34
44
|
var popupPosition = getPopupPosition();
|
|
45
|
+
// Try to get theme from provider, fallback to 'light'
|
|
46
|
+
var theme = 'light';
|
|
47
|
+
try {
|
|
48
|
+
theme = useThemeSafe();
|
|
49
|
+
}
|
|
50
|
+
catch (_e) {
|
|
51
|
+
// Not in provider, use default
|
|
52
|
+
}
|
|
35
53
|
return (react_1["default"].createElement("div", { onMouseMove: handleMouseMove },
|
|
36
54
|
children,
|
|
37
55
|
show && (react_1["default"].createElement("div", { ref: popupRef, className: (0, tailwind_merge_config_1.twMerge)("fixed z-50 pointer-events-none", className), style: {
|
|
38
56
|
left: "".concat(popupPosition.x, "px"),
|
|
39
57
|
top: "".concat(popupPosition.y, "px")
|
|
40
58
|
} },
|
|
41
|
-
react_1["default"].createElement(div_1["default"], { className:
|
|
59
|
+
react_1["default"].createElement(div_1["default"], { className: (0, tailwind_merge_config_1.twMerge)('rounded-lg shadow-lg p-3 min-w-max', (0, mouse_popup_theme_1.getMousePopupBackground)(theme), (0, mouse_popup_theme_1.getMousePopupBorder)(theme), 'border') }, content)))));
|
|
42
60
|
};
|
|
43
61
|
exports.MousePopup = MousePopup;
|
|
44
62
|
exports["default"] = exports.MousePopup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-popup.js","sourceRoot":"","sources":["../../mouse-popup/mouse-popup.tsx"],"names":[],"mappings":";;;;AAAA,qDAA2D;AAC3D,uDAAyB;AAEzB,kEAAmD;
|
|
1
|
+
{"version":3,"file":"mouse-popup.js","sourceRoot":"","sources":["../../mouse-popup/mouse-popup.tsx"],"names":[],"mappings":";;;;AAAA,qDAA2D;AAC3D,uDAAyB;AAEzB,kEAAmD;AACnD,yDAG6B;AAE7B,yDAAyD;AACzD,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,UAAU,GAAG,UAAC,EAA4D;QAA1D,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,IAAI,UAAA,EAAE,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA;IAC5D,IAAA,KAAoC,IAAA,gBAAQ,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAA3D,aAAa,QAAA,EAAE,gBAAgB,QAA4B,CAAC;IACnE,IAAM,QAAQ,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IACxC,IAAA,KAAwC,IAAA,gBAAQ,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAA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KAAK,GAAG,YAAY,EAAE,CAAC;KACxB;IAAC,WAAM;QACN,+BAA+B;KAChC;IAED,OAAO,CACL,0CAAK,WAAW,EAAE,eAAe;QAC9B,QAAQ;QACR,IAAI,IAAI,CACP,0CACE,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,IAAA,+BAAO,EAAC,gCAAgC,EAAE,SAAS,CAAC,EAC/D,KAAK,EAAE;gBACL,IAAI,EAAE,UAAG,aAAa,CAAC,CAAC,OAAI;gBAC5B,GAAG,EAAE,UAAG,aAAa,CAAC,CAAC,OAAI;aAC5B;YAED,iCAAC,gBAAG,IAAC,SAAS,EAAE,IAAA,+BAAO,EACrB,oCAAoC,EACpC,IAAA,2CAAuB,EAAC,KAAK,CAAC,EAC9B,IAAA,uCAAmB,EAAC,KAAK,CAAC,EAC1B,QAAQ,CACT,IACE,OAAO,CACJ,CACF,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAjEW,QAAA,UAAU,cAiErB;AAEF,qBAAe,kBAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../multi-select/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../multi-select/index.ts"],"names":[],"mappings":";;;AAAA,wEAAyC;AAEzC,qBAAe,yBAAW,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
import { Colors } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Get multi-select background based on theme and variant
|
|
5
|
+
*/
|
|
6
|
+
export declare const getMultiSelectBackground: (theme: Theme, variant: 'outlined' | 'filled' | 'text', color: Colors) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Get multi-select text color based on theme
|
|
9
|
+
*/
|
|
10
|
+
export declare const getMultiSelectTextColor: (theme: Theme) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Get multi-select placeholder color based on theme
|
|
13
|
+
*/
|
|
14
|
+
export declare const getMultiSelectPlaceholderColor: (theme: Theme) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Get multi-select label background based on theme
|
|
17
|
+
*/
|
|
18
|
+
export declare const getMultiSelectLabelBackground: (theme: Theme) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Get multi-select border color based on theme and color
|
|
21
|
+
*/
|
|
22
|
+
export declare const getMultiSelectBorderColor: (theme: Theme, _color: Colors, error: boolean, disabled: boolean) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Get multi-select focus border color based on theme and color
|
|
25
|
+
*/
|
|
26
|
+
export declare const getMultiSelectFocusBorderColor: (theme: Theme, color: Colors) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Get multi-select icon color based on theme
|
|
29
|
+
*/
|
|
30
|
+
export declare const getMultiSelectIconColor: (theme: Theme) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Get dropdown background based on theme
|
|
33
|
+
*/
|
|
34
|
+
export declare const getDropdownBackground: (theme: Theme) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Get dropdown border color based on theme and color
|
|
37
|
+
*/
|
|
38
|
+
export declare const getDropdownBorderColor: (theme: Theme, color: Colors) => string;
|
|
39
|
+
/**
|
|
40
|
+
* Get dropdown item hover background based on theme
|
|
41
|
+
*/
|
|
42
|
+
export declare const getDropdownItemHoverBackground: (theme: Theme, color: Colors) => string;
|
|
43
|
+
/**
|
|
44
|
+
* Get dropdown item selected background based on theme
|
|
45
|
+
*/
|
|
46
|
+
export declare const getDropdownItemSelectedBackground: (theme: Theme) => string;
|
|
47
|
+
/**
|
|
48
|
+
* Get dropdown text color based on theme
|
|
49
|
+
*/
|
|
50
|
+
export declare const getDropdownTextColor: (theme: Theme) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Get dropdown selected text color based on theme
|
|
53
|
+
*/
|
|
54
|
+
export declare const getDropdownSelectedTextColor: (theme: Theme) => string;
|