@trops/dash-react 1.0.50 → 1.0.52
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/dist/index.js +431 -52
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as SolidIcons from '@fortawesome/free-solid-svg-icons';
|
|
|
3
3
|
import { faCheck } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
export * from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
import * as BrandIcons from '@fortawesome/free-brands-svg-icons';
|
|
6
|
-
import React, { createContext, useContext, useState, useCallback, useMemo,
|
|
6
|
+
import React, { createContext, useContext, useState, useCallback, useMemo, useRef, useEffect, createElement, Fragment, Children } from 'react';
|
|
7
7
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
8
8
|
import { Dialog, Transition } from '@headlessui/react';
|
|
9
9
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
@@ -30,27 +30,28 @@ var ThemeContext = /*#__PURE__*/createContext({
|
|
|
30
30
|
rawThemes: null
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
+
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
33
34
|
function _typeof$K(o) { "@babel/helpers - typeof"; return _typeof$K = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$K(o); }
|
|
34
35
|
function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
36
|
function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty$F(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
37
|
function _defineProperty$F(e, r, t) { return (r = _toPropertyKey$J(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
37
38
|
function _toPropertyKey$J(t) { var i = _toPrimitive$J(t, "string"); return "symbol" == _typeof$K(i) ? i : i + ""; }
|
|
38
39
|
function _toPrimitive$J(t, r) { if ("object" != _typeof$K(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$K(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
39
|
-
function _slicedToArray$
|
|
40
|
-
function _nonIterableRest$
|
|
41
|
-
function _unsupportedIterableToArray$
|
|
42
|
-
function _arrayLikeToArray$
|
|
43
|
-
function _iterableToArrayLimit$
|
|
44
|
-
function _arrayWithHoles$
|
|
40
|
+
function _slicedToArray$f(r, e) { return _arrayWithHoles$f(r) || _iterableToArrayLimit$f(r, e) || _unsupportedIterableToArray$j(r, e) || _nonIterableRest$f(); }
|
|
41
|
+
function _nonIterableRest$f() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
42
|
+
function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$j(r, a) : void 0; } }
|
|
43
|
+
function _arrayLikeToArray$j(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
44
|
+
function _iterableToArrayLimit$f(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
45
|
+
function _arrayWithHoles$f(r) { if (Array.isArray(r)) return r; }
|
|
45
46
|
var ThemePreviewProvider = function ThemePreviewProvider(_ref) {
|
|
46
47
|
var children = _ref.children;
|
|
47
48
|
var parentCtx = useContext(ThemeContext);
|
|
48
49
|
var _useState = useState(null),
|
|
49
|
-
_useState2 = _slicedToArray$
|
|
50
|
+
_useState2 = _slicedToArray$f(_useState, 2),
|
|
50
51
|
previewTheme = _useState2[0],
|
|
51
52
|
setPreviewThemeState = _useState2[1];
|
|
52
53
|
var _useState3 = useState(true),
|
|
53
|
-
_useState4 = _slicedToArray$
|
|
54
|
+
_useState4 = _slicedToArray$f(_useState3, 2),
|
|
54
55
|
showPreview = _useState4[0],
|
|
55
56
|
setShowPreview = _useState4[1];
|
|
56
57
|
var isPreview = previewTheme !== null && showPreview;
|
|
@@ -76,6 +77,70 @@ var ThemePreviewProvider = function ThemePreviewProvider(_ref) {
|
|
|
76
77
|
});
|
|
77
78
|
}, [parentCtx, isPreview, previewTheme]);
|
|
78
79
|
|
|
80
|
+
// Inject CSS custom properties when the active theme has a
|
|
81
|
+
// `cssVars` map. ThemeModel emits this for themes with
|
|
82
|
+
// arbitrary-color (hex) channels — see PRD
|
|
83
|
+
// `arbitrary-color-themes.md`, FR-003. Tracks which variables we
|
|
84
|
+
// wrote so a transition theme-with-cssVars → theme-without
|
|
85
|
+
// cleanly removes them (no flash: we set the new set before
|
|
86
|
+
// removing the stale ones).
|
|
87
|
+
var writtenVarsRef = useRef(new Set());
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
var _ctxValue$currentThem;
|
|
90
|
+
var cssVars = ctxValue === null || ctxValue === void 0 || (_ctxValue$currentThem = ctxValue.currentTheme) === null || _ctxValue$currentThem === void 0 ? void 0 : _ctxValue$currentThem.cssVars;
|
|
91
|
+
var root = typeof document !== "undefined" ? document.documentElement : null;
|
|
92
|
+
if (!root) return undefined;
|
|
93
|
+
var newSet = new Set();
|
|
94
|
+
if (cssVars && _typeof$K(cssVars) === "object") {
|
|
95
|
+
for (var _i = 0, _Object$entries = Object.entries(cssVars); _i < _Object$entries.length; _i++) {
|
|
96
|
+
var _Object$entries$_i = _slicedToArray$f(_Object$entries[_i], 2),
|
|
97
|
+
varName = _Object$entries$_i[0],
|
|
98
|
+
value = _Object$entries$_i[1];
|
|
99
|
+
root.style.setProperty(varName, value);
|
|
100
|
+
newSet.add(varName);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Remove any vars from a prior theme that aren't in the new set.
|
|
104
|
+
var _iterator = _createForOfIteratorHelper$2(writtenVarsRef.current),
|
|
105
|
+
_step;
|
|
106
|
+
try {
|
|
107
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
108
|
+
var _varName = _step.value;
|
|
109
|
+
if (!newSet.has(_varName)) {
|
|
110
|
+
root.style.removeProperty(_varName);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} catch (err) {
|
|
114
|
+
_iterator.e(err);
|
|
115
|
+
} finally {
|
|
116
|
+
_iterator.f();
|
|
117
|
+
}
|
|
118
|
+
writtenVarsRef.current = newSet;
|
|
119
|
+
return undefined;
|
|
120
|
+
}, [ctxValue]);
|
|
121
|
+
|
|
122
|
+
// Final cleanup on unmount — remove any vars still attached to
|
|
123
|
+
// :root so the theme system leaves no stylesheet residue.
|
|
124
|
+
useEffect(function () {
|
|
125
|
+
return function () {
|
|
126
|
+
var root = typeof document !== "undefined" ? document.documentElement : null;
|
|
127
|
+
if (!root) return;
|
|
128
|
+
var _iterator2 = _createForOfIteratorHelper$2(writtenVarsRef.current),
|
|
129
|
+
_step2;
|
|
130
|
+
try {
|
|
131
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
132
|
+
var varName = _step2.value;
|
|
133
|
+
root.style.removeProperty(varName);
|
|
134
|
+
}
|
|
135
|
+
} catch (err) {
|
|
136
|
+
_iterator2.e(err);
|
|
137
|
+
} finally {
|
|
138
|
+
_iterator2.f();
|
|
139
|
+
}
|
|
140
|
+
writtenVarsRef.current = new Set();
|
|
141
|
+
};
|
|
142
|
+
}, []);
|
|
143
|
+
|
|
79
144
|
// Preview control bag — passed to render-prop children and available via useThemePreview
|
|
80
145
|
var previewControls = useMemo(function () {
|
|
81
146
|
return {
|
|
@@ -508,12 +573,12 @@ var styleClassNames = {
|
|
|
508
573
|
|
|
509
574
|
var _themeObjects$BUTTON, _themeObjects$BUTTON_, _themeObjects$BUTTON_2, _themeObjects$BUTTON_3, _themeObjects$BUTTON_4, _themeObjects$BUTTON_5, _themeObjects$MENU_IT, _themeObjects$TABS_TR, _colorMap;
|
|
510
575
|
function _typeof$J(o) { "@babel/helpers - typeof"; return _typeof$J = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$J(o); }
|
|
511
|
-
function _toConsumableArray$5(r) { return _arrayWithoutHoles$5(r) || _iterableToArray$5(r) || _unsupportedIterableToArray$
|
|
576
|
+
function _toConsumableArray$5(r) { return _arrayWithoutHoles$5(r) || _iterableToArray$5(r) || _unsupportedIterableToArray$i(r) || _nonIterableSpread$5(); }
|
|
512
577
|
function _nonIterableSpread$5() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
513
|
-
function _unsupportedIterableToArray$
|
|
578
|
+
function _unsupportedIterableToArray$i(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$i(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$i(r, a) : void 0; } }
|
|
514
579
|
function _iterableToArray$5(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
515
|
-
function _arrayWithoutHoles$5(r) { if (Array.isArray(r)) return _arrayLikeToArray$
|
|
516
|
-
function _arrayLikeToArray$
|
|
580
|
+
function _arrayWithoutHoles$5(r) { if (Array.isArray(r)) return _arrayLikeToArray$i(r); }
|
|
581
|
+
function _arrayLikeToArray$i(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
517
582
|
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
518
583
|
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty$E(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
519
584
|
function _defineProperty$E(e, r, t) { return (r = _toPropertyKey$I(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -919,6 +984,252 @@ var getDefaultStylesForItem = function getDefaultStylesForItem(itemName) {
|
|
|
919
984
|
return itemName in colorMap ? _objectSpread$D({}, colorMap[itemName]) : {};
|
|
920
985
|
};
|
|
921
986
|
|
|
987
|
+
function _slicedToArray$e(r, e) { return _arrayWithHoles$e(r) || _iterableToArrayLimit$e(r, e) || _unsupportedIterableToArray$h(r, e) || _nonIterableRest$e(); }
|
|
988
|
+
function _nonIterableRest$e() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
989
|
+
function _unsupportedIterableToArray$h(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$h(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$h(r, a) : void 0; } }
|
|
990
|
+
function _arrayLikeToArray$h(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
991
|
+
function _iterableToArrayLimit$e(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
992
|
+
function _arrayWithHoles$e(r) { if (Array.isArray(r)) return r; }
|
|
993
|
+
/**
|
|
994
|
+
* colorMath — pure-function helpers for working with hex colors.
|
|
995
|
+
*
|
|
996
|
+
* Used by the theme system to support arbitrary-color themes (PRD:
|
|
997
|
+
* `dash-electron/docs/requirements/prd/arbitrary-color-themes.md`).
|
|
998
|
+
* Standalone — no React, no dependencies beyond JavaScript primitives.
|
|
999
|
+
*
|
|
1000
|
+
* Exports:
|
|
1001
|
+
* - isHexColor(value) → boolean
|
|
1002
|
+
* - normalizeHex(input) → "#rrggbb" or null
|
|
1003
|
+
* - hexToRgb(hex) → { r, g, b } or null
|
|
1004
|
+
* - rgbToHex({r,g,b}) → "#rrggbb"
|
|
1005
|
+
* - rgbToHsl({r,g,b}) → { h, s, l } (h 0..360, s/l 0..1)
|
|
1006
|
+
* - hslToRgb({h,s,l}) → { r, g, b } (0..255)
|
|
1007
|
+
* - deriveShades(hex) → { 50, 100, 200, ..., 950 } hex map
|
|
1008
|
+
* - contrastRatio(hexA, hexB) → 1..21
|
|
1009
|
+
*/
|
|
1010
|
+
|
|
1011
|
+
var HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
1012
|
+
function isHexColor(value) {
|
|
1013
|
+
return typeof value === "string" && HEX_REGEX.test(value.trim());
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Normalize a user-supplied hex string. Accepts `4A154B`, `#4A154B`,
|
|
1018
|
+
* `#abc`, `#abcd`, `#aabbccdd`. Returns lowercase `#rrggbb` (alpha
|
|
1019
|
+
* dropped) or null if invalid.
|
|
1020
|
+
*/
|
|
1021
|
+
function normalizeHex(input) {
|
|
1022
|
+
if (typeof input !== "string") return null;
|
|
1023
|
+
var s = input.trim().toLowerCase();
|
|
1024
|
+
if (!s.startsWith("#")) s = "#".concat(s);
|
|
1025
|
+
if (!HEX_REGEX.test(s)) return null;
|
|
1026
|
+
if (s.length === 4) {
|
|
1027
|
+
// #rgb → #rrggbb
|
|
1028
|
+
s = "#".concat(s[1]).concat(s[1]).concat(s[2]).concat(s[2]).concat(s[3]).concat(s[3]);
|
|
1029
|
+
} else if (s.length === 5) {
|
|
1030
|
+
// #rgba → #rrggbb (drop alpha)
|
|
1031
|
+
s = "#".concat(s[1]).concat(s[1]).concat(s[2]).concat(s[2]).concat(s[3]).concat(s[3]);
|
|
1032
|
+
} else if (s.length === 9) {
|
|
1033
|
+
// #rrggbbaa → #rrggbb
|
|
1034
|
+
s = s.slice(0, 7);
|
|
1035
|
+
}
|
|
1036
|
+
return s;
|
|
1037
|
+
}
|
|
1038
|
+
function hexToRgb(hex) {
|
|
1039
|
+
var normalized = normalizeHex(hex);
|
|
1040
|
+
if (!normalized) return null;
|
|
1041
|
+
var n = parseInt(normalized.slice(1), 16);
|
|
1042
|
+
return {
|
|
1043
|
+
r: n >> 16 & 0xff,
|
|
1044
|
+
g: n >> 8 & 0xff,
|
|
1045
|
+
b: n & 0xff
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
function rgbToHex(_ref) {
|
|
1049
|
+
var r = _ref.r,
|
|
1050
|
+
g = _ref.g,
|
|
1051
|
+
b = _ref.b;
|
|
1052
|
+
var clamp = function clamp(v) {
|
|
1053
|
+
return Math.max(0, Math.min(255, Math.round(v)));
|
|
1054
|
+
};
|
|
1055
|
+
var toHex = function toHex(v) {
|
|
1056
|
+
return clamp(v).toString(16).padStart(2, "0");
|
|
1057
|
+
};
|
|
1058
|
+
return "#".concat(toHex(r)).concat(toHex(g)).concat(toHex(b));
|
|
1059
|
+
}
|
|
1060
|
+
function rgbToHsl(_ref2) {
|
|
1061
|
+
var r = _ref2.r,
|
|
1062
|
+
g = _ref2.g,
|
|
1063
|
+
b = _ref2.b;
|
|
1064
|
+
var R = r / 255;
|
|
1065
|
+
var G = g / 255;
|
|
1066
|
+
var B = b / 255;
|
|
1067
|
+
var max = Math.max(R, G, B);
|
|
1068
|
+
var min = Math.min(R, G, B);
|
|
1069
|
+
var l = (max + min) / 2;
|
|
1070
|
+
var h = 0;
|
|
1071
|
+
var s = 0;
|
|
1072
|
+
if (max !== min) {
|
|
1073
|
+
var d = max - min;
|
|
1074
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
1075
|
+
switch (max) {
|
|
1076
|
+
case R:
|
|
1077
|
+
h = (G - B) / d + (G < B ? 6 : 0);
|
|
1078
|
+
break;
|
|
1079
|
+
case G:
|
|
1080
|
+
h = (B - R) / d + 2;
|
|
1081
|
+
break;
|
|
1082
|
+
default:
|
|
1083
|
+
h = (R - G) / d + 4;
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
h *= 60;
|
|
1087
|
+
}
|
|
1088
|
+
return {
|
|
1089
|
+
h: h,
|
|
1090
|
+
s: s,
|
|
1091
|
+
l: l
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
function hslToRgb(_ref3) {
|
|
1095
|
+
var h = _ref3.h,
|
|
1096
|
+
s = _ref3.s,
|
|
1097
|
+
l = _ref3.l;
|
|
1098
|
+
if (s === 0) {
|
|
1099
|
+
var v = l * 255;
|
|
1100
|
+
return {
|
|
1101
|
+
r: v,
|
|
1102
|
+
g: v,
|
|
1103
|
+
b: v
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
var c = (1 - Math.abs(2 * l - 1)) * s;
|
|
1107
|
+
var x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
1108
|
+
var m = l - c / 2;
|
|
1109
|
+
var rp;
|
|
1110
|
+
var gp;
|
|
1111
|
+
var bp;
|
|
1112
|
+
if (h < 60) {
|
|
1113
|
+
rp = c;
|
|
1114
|
+
gp = x;
|
|
1115
|
+
bp = 0;
|
|
1116
|
+
} else if (h < 120) {
|
|
1117
|
+
rp = x;
|
|
1118
|
+
gp = c;
|
|
1119
|
+
bp = 0;
|
|
1120
|
+
} else if (h < 180) {
|
|
1121
|
+
rp = 0;
|
|
1122
|
+
gp = c;
|
|
1123
|
+
bp = x;
|
|
1124
|
+
} else if (h < 240) {
|
|
1125
|
+
rp = 0;
|
|
1126
|
+
gp = x;
|
|
1127
|
+
bp = c;
|
|
1128
|
+
} else if (h < 300) {
|
|
1129
|
+
rp = x;
|
|
1130
|
+
gp = 0;
|
|
1131
|
+
bp = c;
|
|
1132
|
+
} else {
|
|
1133
|
+
rp = c;
|
|
1134
|
+
gp = 0;
|
|
1135
|
+
bp = x;
|
|
1136
|
+
}
|
|
1137
|
+
return {
|
|
1138
|
+
r: (rp + m) * 255,
|
|
1139
|
+
g: (gp + m) * 255,
|
|
1140
|
+
b: (bp + m) * 255
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Derive an 11-shade Tailwind-like palette from a base hex.
|
|
1146
|
+
*
|
|
1147
|
+
* Returns `{ "50": "#…", "100": "#…", …, "900": "#…", "950": "#…" }`.
|
|
1148
|
+
*
|
|
1149
|
+
* Strategy: keep the input's hue + saturation; vary lightness across
|
|
1150
|
+
* fixed targets that approximate Tailwind's stock palette structure.
|
|
1151
|
+
* Shade `500` preserves the user's lightness (so picking a known
|
|
1152
|
+
* Tailwind hex like `#3b82f6` produces a `500` close to Tailwind
|
|
1153
|
+
* `blue-500`). Lighter shades approach white; darker approach black.
|
|
1154
|
+
*
|
|
1155
|
+
* For very dark (`l < 0.20`) or very light (`l > 0.80`) inputs we
|
|
1156
|
+
* snap shade `500` to `0.50` so the ramp stays balanced — otherwise
|
|
1157
|
+
* the input might land at e.g. shade `900` and produce no visible
|
|
1158
|
+
* darker steps.
|
|
1159
|
+
*/
|
|
1160
|
+
function deriveShades(hex) {
|
|
1161
|
+
var rgb = hexToRgb(hex);
|
|
1162
|
+
if (!rgb) return null;
|
|
1163
|
+
var _rgbToHsl = rgbToHsl(rgb),
|
|
1164
|
+
h = _rgbToHsl.h,
|
|
1165
|
+
s = _rgbToHsl.s,
|
|
1166
|
+
l = _rgbToHsl.l;
|
|
1167
|
+
var baseL = l < 0.2 || l > 0.8 ? 0.5 : l;
|
|
1168
|
+
var targets = {
|
|
1169
|
+
50: 0.96,
|
|
1170
|
+
100: 0.9,
|
|
1171
|
+
200: 0.8,
|
|
1172
|
+
300: 0.68,
|
|
1173
|
+
400: 0.55,
|
|
1174
|
+
500: baseL,
|
|
1175
|
+
600: 0.42,
|
|
1176
|
+
700: 0.32,
|
|
1177
|
+
800: 0.22,
|
|
1178
|
+
900: 0.13,
|
|
1179
|
+
950: 0.08
|
|
1180
|
+
};
|
|
1181
|
+
// Slight saturation curve: lighter shades fade saturation toward
|
|
1182
|
+
// white-ish; darker shades fade toward black-ish. Mirrors how
|
|
1183
|
+
// Tailwind's stock palette feels.
|
|
1184
|
+
var satFor = function satFor(targetL) {
|
|
1185
|
+
if (targetL > 0.85) return s * 0.4;
|
|
1186
|
+
if (targetL < 0.15) return s * 0.7;
|
|
1187
|
+
return s;
|
|
1188
|
+
};
|
|
1189
|
+
var out = {};
|
|
1190
|
+
for (var _i = 0, _Object$entries = Object.entries(targets); _i < _Object$entries.length; _i++) {
|
|
1191
|
+
var _Object$entries$_i = _slicedToArray$e(_Object$entries[_i], 2),
|
|
1192
|
+
shade = _Object$entries$_i[0],
|
|
1193
|
+
targetL = _Object$entries$_i[1];
|
|
1194
|
+
var rgbOut = hslToRgb({
|
|
1195
|
+
h: h,
|
|
1196
|
+
s: satFor(targetL),
|
|
1197
|
+
l: targetL
|
|
1198
|
+
});
|
|
1199
|
+
out[shade] = rgbToHex(rgbOut);
|
|
1200
|
+
}
|
|
1201
|
+
return out;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* WCAG-relative luminance (0..1). Used by `contrastRatio`.
|
|
1206
|
+
*/
|
|
1207
|
+
function relativeLuminance(_ref4) {
|
|
1208
|
+
var r = _ref4.r,
|
|
1209
|
+
g = _ref4.g,
|
|
1210
|
+
b = _ref4.b;
|
|
1211
|
+
var channel = function channel(v) {
|
|
1212
|
+
var sRGB = v / 255;
|
|
1213
|
+
return sRGB <= 0.03928 ? sRGB / 12.92 : Math.pow((sRGB + 0.055) / 1.055, 2.4);
|
|
1214
|
+
};
|
|
1215
|
+
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* WCAG contrast ratio between two hex colors. Returns a value in
|
|
1220
|
+
* [1, 21]. WCAG AA target is 4.5 for normal text; AAA is 7.
|
|
1221
|
+
*/
|
|
1222
|
+
function contrastRatio(hexA, hexB) {
|
|
1223
|
+
var rgbA = hexToRgb(hexA);
|
|
1224
|
+
var rgbB = hexToRgb(hexB);
|
|
1225
|
+
if (!rgbA || !rgbB) return null;
|
|
1226
|
+
var lA = relativeLuminance(rgbA);
|
|
1227
|
+
var lB = relativeLuminance(rgbB);
|
|
1228
|
+
var lighter = Math.max(lA, lB);
|
|
1229
|
+
var darker = Math.min(lA, lB);
|
|
1230
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
922
1233
|
function _typeof$I(o) { "@babel/helpers - typeof"; return _typeof$I = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$I(o); }
|
|
923
1234
|
/**
|
|
924
1235
|
* deepCopy
|
|
@@ -1062,18 +1373,18 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
1062
1373
|
};
|
|
1063
1374
|
|
|
1064
1375
|
function _typeof$H(o) { "@babel/helpers - typeof"; return _typeof$H = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$H(o); }
|
|
1065
|
-
var _excluded$C = ["children", "border", "className", "padding", "defaultPadding", "direction"],
|
|
1376
|
+
var _excluded$C = ["children", "border", "className", "padding", "defaultPadding", "rounded", "direction"],
|
|
1066
1377
|
_excluded2$f = ["children", "scrollable", "className", "onClick", "defaultPadding", "padding"],
|
|
1067
|
-
_excluded3$f = ["children", "className", "defaultPadding", "padding"],
|
|
1068
|
-
_excluded4$3 = ["horizontal", "children", "onClick", "width", "height", "padding", "scrollable", "grow", "className", "direction", "defaultPadding", "border"],
|
|
1069
|
-
_excluded5$3 = ["children", "border", "className", "padding", "defaultPadding", "direction"],
|
|
1378
|
+
_excluded3$f = ["children", "className", "defaultPadding", "padding", "rounded"],
|
|
1379
|
+
_excluded4$3 = ["horizontal", "children", "onClick", "width", "height", "padding", "scrollable", "grow", "className", "direction", "defaultPadding", "border", "rounded"],
|
|
1380
|
+
_excluded5$3 = ["children", "border", "className", "padding", "defaultPadding", "rounded", "direction"],
|
|
1070
1381
|
_excluded6$3 = ["children", "scrollable", "className", "onClick", "defaultPadding", "padding", "height", "width"],
|
|
1071
|
-
_excluded7$3 = ["children", "className", "defaultPadding", "padding"],
|
|
1072
|
-
_excluded8$3 = ["horizontal", "children", "onClick", "width", "height", "padding", "scrollable", "className", "direction", "grow", "defaultPadding", "border"],
|
|
1073
|
-
_excluded9$3 = ["children", "border", "className", "padding", "defaultPadding", "direction"],
|
|
1382
|
+
_excluded7$3 = ["children", "className", "defaultPadding", "padding", "rounded"],
|
|
1383
|
+
_excluded8$3 = ["horizontal", "children", "onClick", "width", "height", "padding", "scrollable", "className", "direction", "grow", "defaultPadding", "border", "rounded"],
|
|
1384
|
+
_excluded9$3 = ["children", "border", "className", "padding", "defaultPadding", "rounded", "direction"],
|
|
1074
1385
|
_excluded0$2 = ["children", "scrollable", "className", "space", "onClick", "defaultPadding", "padding", "height", "width"],
|
|
1075
|
-
_excluded1$2 = ["children", "className", "padding", "defaultPadding"],
|
|
1076
|
-
_excluded10$2 = ["horizontal", "children", "onClick", "width", "height", "padding", "scrollable", "className", "grow", "defaultPadding", "border"];
|
|
1386
|
+
_excluded1$2 = ["children", "className", "padding", "defaultPadding", "rounded"],
|
|
1387
|
+
_excluded10$2 = ["horizontal", "children", "onClick", "width", "height", "padding", "scrollable", "className", "grow", "defaultPadding", "border", "rounded"];
|
|
1077
1388
|
function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1078
1389
|
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty$D(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1079
1390
|
function _defineProperty$D(e, r, t) { return (r = _toPropertyKey$H(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -1091,6 +1402,8 @@ var PanelHeader = function PanelHeader(_ref) {
|
|
|
1091
1402
|
padding = _ref$padding === void 0 ? true : _ref$padding,
|
|
1092
1403
|
_ref$defaultPadding = _ref.defaultPadding,
|
|
1093
1404
|
defaultPadding = _ref$defaultPadding === void 0 ? "p-6" : _ref$defaultPadding,
|
|
1405
|
+
_ref$rounded = _ref.rounded,
|
|
1406
|
+
rounded = _ref$rounded === void 0 ? "rounded-t" : _ref$rounded,
|
|
1094
1407
|
_ref$direction = _ref.direction,
|
|
1095
1408
|
direction = _ref$direction === void 0 ? "horizontal" : _ref$direction,
|
|
1096
1409
|
props = _objectWithoutProperties$C(_ref, _excluded$C);
|
|
@@ -1105,7 +1418,7 @@ var PanelHeader = function PanelHeader(_ref) {
|
|
|
1105
1418
|
var id = getUUID$1("", "panel-header");
|
|
1106
1419
|
return /*#__PURE__*/jsx("div", {
|
|
1107
1420
|
id: id,
|
|
1108
|
-
className: "flex ".concat(direction === "horizontal" ? "flex-row" : "flex-col", " rounded
|
|
1421
|
+
className: "flex ".concat(direction === "horizontal" ? "flex-row" : "flex-col", " ").concat(rounded, " ").concat(border === true ? "border-b" : "", " justify-between items-center ").concat(padding === true ? defaultPadding : "p-0", " ").concat(className, " ").concat(styles.string),
|
|
1109
1422
|
children: children
|
|
1110
1423
|
});
|
|
1111
1424
|
};
|
|
@@ -1150,6 +1463,8 @@ var PanelFooter = function PanelFooter(_ref3) {
|
|
|
1150
1463
|
defaultPadding = _ref3$defaultPadding === void 0 ? "p-6" : _ref3$defaultPadding,
|
|
1151
1464
|
_ref3$padding = _ref3.padding,
|
|
1152
1465
|
padding = _ref3$padding === void 0 ? true : _ref3$padding,
|
|
1466
|
+
_ref3$rounded = _ref3.rounded,
|
|
1467
|
+
rounded = _ref3$rounded === void 0 ? "rounded-b" : _ref3$rounded,
|
|
1153
1468
|
props = _objectWithoutProperties$C(_ref3, _excluded3$f);
|
|
1154
1469
|
var _useContext4 = useContext(ThemeContext),
|
|
1155
1470
|
currentTheme = _useContext4.currentTheme;
|
|
@@ -1158,7 +1473,7 @@ var PanelFooter = function PanelFooter(_ref3) {
|
|
|
1158
1473
|
grow: false
|
|
1159
1474
|
}));
|
|
1160
1475
|
return /*#__PURE__*/jsx("div", {
|
|
1161
|
-
className: "flex flex-row rounded
|
|
1476
|
+
className: "flex flex-row ".concat(rounded, " justify-between items-center ").concat(className, " ").concat(styles.string, " ").concat(padding === true ? defaultPadding : "p-0"),
|
|
1162
1477
|
children: children
|
|
1163
1478
|
});
|
|
1164
1479
|
};
|
|
@@ -1185,6 +1500,8 @@ var Panel = function Panel(_ref4) {
|
|
|
1185
1500
|
defaultPadding = _ref4$defaultPadding === void 0 ? "p-6" : _ref4$defaultPadding,
|
|
1186
1501
|
_ref4$border = _ref4.border,
|
|
1187
1502
|
border = _ref4$border === void 0 ? true : _ref4$border,
|
|
1503
|
+
_ref4$rounded = _ref4.rounded,
|
|
1504
|
+
rounded = _ref4$rounded === void 0 ? "rounded-lg" : _ref4$rounded,
|
|
1188
1505
|
props = _objectWithoutProperties$C(_ref4, _excluded4$3);
|
|
1189
1506
|
// Fetch the Styles from the utility
|
|
1190
1507
|
var _useContext5 = useContext(ThemeContext),
|
|
@@ -1199,7 +1516,7 @@ var Panel = function Panel(_ref4) {
|
|
|
1199
1516
|
return /*#__PURE__*/jsx(LayoutContainer, {
|
|
1200
1517
|
prefix: "panel",
|
|
1201
1518
|
direction: horizontal === true ? "row" : "col",
|
|
1202
|
-
className: "".concat(className, " ").concat(styles.string, " ").concat(height, " ").concat(width, " rounded
|
|
1519
|
+
className: "".concat(className, " ").concat(styles.string, " ").concat(height, " ").concat(width, " ").concat(rounded, " ").concat(border === true ? "border" : "", " ").concat(padding === true ? defaultPadding : "p-0"),
|
|
1203
1520
|
onClick: onClick,
|
|
1204
1521
|
scrollable: scrollable // must include this here as we separated props
|
|
1205
1522
|
,
|
|
@@ -1228,6 +1545,8 @@ var PanelHeader2 = function PanelHeader2(_ref5) {
|
|
|
1228
1545
|
padding = _ref5$padding === void 0 ? true : _ref5$padding,
|
|
1229
1546
|
_ref5$defaultPadding = _ref5.defaultPadding,
|
|
1230
1547
|
defaultPadding = _ref5$defaultPadding === void 0 ? "p-4" : _ref5$defaultPadding,
|
|
1548
|
+
_ref5$rounded = _ref5.rounded,
|
|
1549
|
+
rounded = _ref5$rounded === void 0 ? "rounded-t" : _ref5$rounded,
|
|
1231
1550
|
_ref5$direction = _ref5.direction,
|
|
1232
1551
|
direction = _ref5$direction === void 0 ? "horizontal" : _ref5$direction,
|
|
1233
1552
|
props = _objectWithoutProperties$C(_ref5, _excluded5$3);
|
|
@@ -1238,7 +1557,7 @@ var PanelHeader2 = function PanelHeader2(_ref5) {
|
|
|
1238
1557
|
grow: false
|
|
1239
1558
|
}));
|
|
1240
1559
|
return /*#__PURE__*/jsx("div", {
|
|
1241
|
-
className: "flex ".concat(direction === "horizontal" ? "flex-row" : "flex-col", " rounded
|
|
1560
|
+
className: "flex ".concat(direction === "horizontal" ? "flex-row" : "flex-col", " ").concat(rounded, " ").concat(border === true ? "border-b" : "", " justify-between items-center ").concat(padding === true ? defaultPadding : "p-0", " ").concat(className, " ").concat(styles.string),
|
|
1242
1561
|
children: children
|
|
1243
1562
|
});
|
|
1244
1563
|
};
|
|
@@ -1282,6 +1601,8 @@ var PanelFooter2 = function PanelFooter2(_ref7) {
|
|
|
1282
1601
|
defaultPadding = _ref7$defaultPadding === void 0 ? "p-4" : _ref7$defaultPadding,
|
|
1283
1602
|
_ref7$padding = _ref7.padding,
|
|
1284
1603
|
padding = _ref7$padding === void 0 ? true : _ref7$padding,
|
|
1604
|
+
_ref7$rounded = _ref7.rounded,
|
|
1605
|
+
rounded = _ref7$rounded === void 0 ? "rounded-b" : _ref7$rounded,
|
|
1285
1606
|
props = _objectWithoutProperties$C(_ref7, _excluded7$3);
|
|
1286
1607
|
var _useContext8 = useContext(ThemeContext),
|
|
1287
1608
|
currentTheme = _useContext8.currentTheme;
|
|
@@ -1290,7 +1611,7 @@ var PanelFooter2 = function PanelFooter2(_ref7) {
|
|
|
1290
1611
|
grow: false
|
|
1291
1612
|
}));
|
|
1292
1613
|
return /*#__PURE__*/jsx("div", {
|
|
1293
|
-
className: "flex flex-row rounded
|
|
1614
|
+
className: "flex flex-row ".concat(rounded, " justify-between items-center ").concat(className, " ").concat(styles.string, " ").concat(padding === true ? defaultPadding : "p-0"),
|
|
1294
1615
|
children: children
|
|
1295
1616
|
});
|
|
1296
1617
|
};
|
|
@@ -1316,6 +1637,8 @@ var Panel2 = function Panel2(_ref8) {
|
|
|
1316
1637
|
defaultPadding = _ref8$defaultPadding === void 0 ? "p-4" : _ref8$defaultPadding,
|
|
1317
1638
|
_ref8$border = _ref8.border,
|
|
1318
1639
|
border = _ref8$border === void 0 ? true : _ref8$border,
|
|
1640
|
+
_ref8$rounded = _ref8.rounded,
|
|
1641
|
+
rounded = _ref8$rounded === void 0 ? "rounded-md" : _ref8$rounded,
|
|
1319
1642
|
props = _objectWithoutProperties$C(_ref8, _excluded8$3);
|
|
1320
1643
|
var _useContext9 = useContext(ThemeContext),
|
|
1321
1644
|
currentTheme = _useContext9.currentTheme;
|
|
@@ -1328,7 +1651,7 @@ var Panel2 = function Panel2(_ref8) {
|
|
|
1328
1651
|
}));
|
|
1329
1652
|
return /*#__PURE__*/jsx(LayoutContainer, _objectSpread$C(_objectSpread$C({
|
|
1330
1653
|
direction: horizontal === true ? "row" : "col",
|
|
1331
|
-
className: "".concat(className, " ").concat(styles.string, " ").concat(height, " ").concat(width, " rounded
|
|
1654
|
+
className: "".concat(className, " ").concat(styles.string, " ").concat(height, " ").concat(width, " ").concat(rounded, " ").concat(border === true ? "border" : "", " ").concat(padding === true ? defaultPadding : "p-0"),
|
|
1332
1655
|
onClick: onClick,
|
|
1333
1656
|
scrollable: scrollable,
|
|
1334
1657
|
space: false
|
|
@@ -1356,6 +1679,8 @@ var PanelHeader3 = function PanelHeader3(_ref9) {
|
|
|
1356
1679
|
padding = _ref9$padding === void 0 ? true : _ref9$padding,
|
|
1357
1680
|
_ref9$defaultPadding = _ref9.defaultPadding,
|
|
1358
1681
|
defaultPadding = _ref9$defaultPadding === void 0 ? "p-2" : _ref9$defaultPadding,
|
|
1682
|
+
_ref9$rounded = _ref9.rounded,
|
|
1683
|
+
rounded = _ref9$rounded === void 0 ? "rounded-t" : _ref9$rounded,
|
|
1359
1684
|
_ref9$direction = _ref9.direction,
|
|
1360
1685
|
direction = _ref9$direction === void 0 ? "horizontal" : _ref9$direction,
|
|
1361
1686
|
props = _objectWithoutProperties$C(_ref9, _excluded9$3);
|
|
@@ -1366,7 +1691,7 @@ var PanelHeader3 = function PanelHeader3(_ref9) {
|
|
|
1366
1691
|
grow: false
|
|
1367
1692
|
}));
|
|
1368
1693
|
return /*#__PURE__*/jsx("div", {
|
|
1369
|
-
className: "flex ".concat(direction === "horizontal" ? "flex-row" : "flex-col", " rounded
|
|
1694
|
+
className: "flex ".concat(direction === "horizontal" ? "flex-row" : "flex-col", " ").concat(rounded, " ").concat(border === true ? "border-b" : "", " justify-between items-center ").concat(padding === true ? defaultPadding : "p-0", " ").concat(className, " ").concat(styles.string),
|
|
1370
1695
|
children: children
|
|
1371
1696
|
});
|
|
1372
1697
|
};
|
|
@@ -1419,6 +1744,8 @@ var PanelFooter3 = function PanelFooter3(_ref1) {
|
|
|
1419
1744
|
padding = _ref1$padding === void 0 ? true : _ref1$padding,
|
|
1420
1745
|
_ref1$defaultPadding = _ref1.defaultPadding,
|
|
1421
1746
|
defaultPadding = _ref1$defaultPadding === void 0 ? "p-2" : _ref1$defaultPadding,
|
|
1747
|
+
_ref1$rounded = _ref1.rounded,
|
|
1748
|
+
rounded = _ref1$rounded === void 0 ? "rounded-b" : _ref1$rounded,
|
|
1422
1749
|
props = _objectWithoutProperties$C(_ref1, _excluded1$2);
|
|
1423
1750
|
var _useContext10 = useContext(ThemeContext),
|
|
1424
1751
|
currentTheme = _useContext10.currentTheme;
|
|
@@ -1427,7 +1754,7 @@ var PanelFooter3 = function PanelFooter3(_ref1) {
|
|
|
1427
1754
|
grow: false
|
|
1428
1755
|
}));
|
|
1429
1756
|
return /*#__PURE__*/jsx("div", {
|
|
1430
|
-
className: "flex flex-row rounded
|
|
1757
|
+
className: "flex flex-row ".concat(rounded, " justify-between items-center ").concat(padding === true ? defaultPadding : "p-0", " ").concat(className, " ").concat(styles.string),
|
|
1431
1758
|
children: children
|
|
1432
1759
|
});
|
|
1433
1760
|
};
|
|
@@ -1452,6 +1779,8 @@ var Panel3 = function Panel3(_ref10) {
|
|
|
1452
1779
|
defaultPadding = _ref10$defaultPadding === void 0 ? "p-2" : _ref10$defaultPadding,
|
|
1453
1780
|
_ref10$border = _ref10.border,
|
|
1454
1781
|
border = _ref10$border === void 0 ? true : _ref10$border,
|
|
1782
|
+
_ref10$rounded = _ref10.rounded,
|
|
1783
|
+
rounded = _ref10$rounded === void 0 ? "rounded" : _ref10$rounded,
|
|
1455
1784
|
props = _objectWithoutProperties$C(_ref10, _excluded10$2);
|
|
1456
1785
|
var _useContext11 = useContext(ThemeContext),
|
|
1457
1786
|
currentTheme = _useContext11.currentTheme;
|
|
@@ -1465,7 +1794,7 @@ var Panel3 = function Panel3(_ref10) {
|
|
|
1465
1794
|
}));
|
|
1466
1795
|
return /*#__PURE__*/jsx(LayoutContainer, _objectSpread$C(_objectSpread$C({
|
|
1467
1796
|
direction: horizontal === true ? "row" : "col",
|
|
1468
|
-
className: "".concat(className, " ").concat(styles.string, " ").concat(height, " ").concat(width, " rounded ").concat(border === true ? "border" : "", " ").concat(padding === true ? defaultPadding : "p-0"),
|
|
1797
|
+
className: "".concat(className, " ").concat(styles.string, " ").concat(height, " ").concat(width, " ").concat(rounded, " ").concat(border === true ? "border" : "", " ").concat(padding === true ? defaultPadding : "p-0"),
|
|
1469
1798
|
onClick: onClick,
|
|
1470
1799
|
scrollable: scrollable,
|
|
1471
1800
|
space: false
|
|
@@ -2192,6 +2521,10 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
2192
2521
|
grow = _ref$grow === void 0 ? false : _ref$grow,
|
|
2193
2522
|
_ref$className = _ref.className,
|
|
2194
2523
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
2524
|
+
_ref$padding = _ref.padding,
|
|
2525
|
+
padding = _ref$padding === void 0 ? "px-3 py-2" : _ref$padding,
|
|
2526
|
+
_ref$rounded = _ref.rounded,
|
|
2527
|
+
rounded = _ref$rounded === void 0 ? "rounded-md" : _ref$rounded,
|
|
2195
2528
|
id = _ref.id;
|
|
2196
2529
|
var _useContext = useContext(ThemeContext),
|
|
2197
2530
|
currentTheme = _useContext.currentTheme;
|
|
@@ -2210,7 +2543,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
2210
2543
|
return /*#__PURE__*/jsx("div", {
|
|
2211
2544
|
id: uuid,
|
|
2212
2545
|
onClick: onClick,
|
|
2213
|
-
className: "flex flex-row ".concat(styles.string, " ").concat(border === true && "border-4", "
|
|
2546
|
+
className: "flex flex-row ".concat(styles.string, " ").concat(border === true && "border-4", " ").concat(padding, " ").concat(rounded, " items-center space-x-2 text-sm transition-colors duration-150 focus-visible:outline-none ").concat(className),
|
|
2214
2547
|
children: children
|
|
2215
2548
|
});
|
|
2216
2549
|
};
|
|
@@ -2240,6 +2573,10 @@ var MenuItem2 = function MenuItem2(_ref2) {
|
|
|
2240
2573
|
className = _ref2$className === void 0 ? "" : _ref2$className,
|
|
2241
2574
|
_ref2$grow = _ref2.grow,
|
|
2242
2575
|
grow = _ref2$grow === void 0 ? false : _ref2$grow,
|
|
2576
|
+
_ref2$padding = _ref2.padding,
|
|
2577
|
+
padding = _ref2$padding === void 0 ? "px-3 py-1.5" : _ref2$padding,
|
|
2578
|
+
_ref2$rounded = _ref2.rounded,
|
|
2579
|
+
rounded = _ref2$rounded === void 0 ? "rounded-md" : _ref2$rounded,
|
|
2243
2580
|
id = _ref2.id;
|
|
2244
2581
|
var _useContext2 = useContext(ThemeContext),
|
|
2245
2582
|
currentTheme = _useContext2.currentTheme;
|
|
@@ -2254,7 +2591,7 @@ var MenuItem2 = function MenuItem2(_ref2) {
|
|
|
2254
2591
|
selected: selected,
|
|
2255
2592
|
grow: grow
|
|
2256
2593
|
});
|
|
2257
|
-
var baseStyles = "".concat(onClick && "cursor-pointer", "
|
|
2594
|
+
var baseStyles = "".concat(onClick && "cursor-pointer", " ").concat(padding, " ").concat(rounded, " items-center space-x-2 ").concat(border === true && "border-2");
|
|
2258
2595
|
var baseTextStyles = "text-sm font-medium";
|
|
2259
2596
|
var uuid = getUUID$1(id, "menu-item");
|
|
2260
2597
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -2292,6 +2629,10 @@ var MenuItem3 = function MenuItem3(_ref3) {
|
|
|
2292
2629
|
className = _ref3$className === void 0 ? "" : _ref3$className,
|
|
2293
2630
|
_ref3$grow = _ref3.grow,
|
|
2294
2631
|
grow = _ref3$grow === void 0 ? false : _ref3$grow,
|
|
2632
|
+
_ref3$padding = _ref3.padding,
|
|
2633
|
+
padding = _ref3$padding === void 0 ? "px-3 py-1.5" : _ref3$padding,
|
|
2634
|
+
_ref3$rounded = _ref3.rounded,
|
|
2635
|
+
rounded = _ref3$rounded === void 0 ? "rounded-md" : _ref3$rounded,
|
|
2295
2636
|
id = _ref3.id;
|
|
2296
2637
|
_ref3.type;
|
|
2297
2638
|
var _useContext3 = useContext(ThemeContext),
|
|
@@ -2307,7 +2648,7 @@ var MenuItem3 = function MenuItem3(_ref3) {
|
|
|
2307
2648
|
selected: selected,
|
|
2308
2649
|
grow: grow
|
|
2309
2650
|
});
|
|
2310
|
-
var baseStyles = "".concat(onClick && "cursor-pointer", "
|
|
2651
|
+
var baseStyles = "".concat(onClick && "cursor-pointer", " ").concat(padding, " ").concat(rounded, " items-center space-x-2 ").concat(border === true && "border-2");
|
|
2311
2652
|
var baseTextStyles = "text-sm font-normal";
|
|
2312
2653
|
var uuid = getUUID$1(id, "menu-item");
|
|
2313
2654
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -3087,7 +3428,7 @@ var Breadcrumbs3 = function Breadcrumbs3(props) {
|
|
|
3087
3428
|
};
|
|
3088
3429
|
|
|
3089
3430
|
function _typeof$A(o) { "@babel/helpers - typeof"; return _typeof$A = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$A(o); }
|
|
3090
|
-
var _excluded$t = ["title", "message", "children", "onClose", "className"];
|
|
3431
|
+
var _excluded$t = ["title", "message", "children", "onClose", "className", "padding", "rounded", "divider"];
|
|
3091
3432
|
function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3092
3433
|
function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty$w(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3093
3434
|
function _defineProperty$w(e, r, t) { return (r = _toPropertyKey$A(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -3106,6 +3447,12 @@ var Alert = function Alert(_ref) {
|
|
|
3106
3447
|
onClose = _ref$onClose === void 0 ? null : _ref$onClose,
|
|
3107
3448
|
_ref$className = _ref.className,
|
|
3108
3449
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
3450
|
+
_ref$padding = _ref.padding,
|
|
3451
|
+
padding = _ref$padding === void 0 ? "p-4" : _ref$padding,
|
|
3452
|
+
_ref$rounded = _ref.rounded,
|
|
3453
|
+
rounded = _ref$rounded === void 0 ? "rounded-md" : _ref$rounded,
|
|
3454
|
+
_ref$divider = _ref.divider,
|
|
3455
|
+
divider = _ref$divider === void 0 ? true : _ref$divider,
|
|
3109
3456
|
props = _objectWithoutProperties$t(_ref, _excluded$t);
|
|
3110
3457
|
var _useContext = useContext(ThemeContext),
|
|
3111
3458
|
currentTheme = _useContext.currentTheme;
|
|
@@ -3116,7 +3463,7 @@ var Alert = function Alert(_ref) {
|
|
|
3116
3463
|
var uuid = getUUID$1("", "alert");
|
|
3117
3464
|
return /*#__PURE__*/jsx("div", {
|
|
3118
3465
|
id: uuid,
|
|
3119
|
-
className: "border border-l-4 ".concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " rounded
|
|
3466
|
+
className: "border ".concat(divider ? "border-l-4" : "", " ").concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " ").concat(rounded, " ").concat(padding, " text-base ").concat(className),
|
|
3120
3467
|
role: "alert",
|
|
3121
3468
|
children: /*#__PURE__*/jsxs("div", {
|
|
3122
3469
|
className: "flex items-start justify-between",
|
|
@@ -3140,16 +3487,20 @@ var Alert = function Alert(_ref) {
|
|
|
3140
3487
|
});
|
|
3141
3488
|
};
|
|
3142
3489
|
var Alert2 = function Alert2(props) {
|
|
3490
|
+
var _props$padding, _props$rounded;
|
|
3143
3491
|
var _useContext2 = useContext(ThemeContext),
|
|
3144
3492
|
currentTheme = _useContext2.currentTheme;
|
|
3145
3493
|
var styles = getStylesForItem(themeObjects.ALERT_2, currentTheme, _objectSpread$v(_objectSpread$v({}, props), {}, {
|
|
3146
3494
|
scrollable: false,
|
|
3147
3495
|
grow: false
|
|
3148
3496
|
}));
|
|
3497
|
+
var padding = (_props$padding = props.padding) !== null && _props$padding !== void 0 ? _props$padding : "p-3";
|
|
3498
|
+
var rounded = (_props$rounded = props.rounded) !== null && _props$rounded !== void 0 ? _props$rounded : "rounded-md";
|
|
3499
|
+
var divider = props.divider !== false;
|
|
3149
3500
|
var uuid = getUUID$1("", "alert-2");
|
|
3150
3501
|
return /*#__PURE__*/jsx("div", {
|
|
3151
3502
|
id: uuid,
|
|
3152
|
-
className: "border border-l-4 ".concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " rounded
|
|
3503
|
+
className: "border ".concat(divider ? "border-l-4" : "", " ").concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " ").concat(rounded, " ").concat(padding, " text-sm ").concat(props.className || ""),
|
|
3153
3504
|
role: "alert",
|
|
3154
3505
|
children: /*#__PURE__*/jsxs("div", {
|
|
3155
3506
|
className: "flex items-start justify-between",
|
|
@@ -3173,16 +3524,20 @@ var Alert2 = function Alert2(props) {
|
|
|
3173
3524
|
});
|
|
3174
3525
|
};
|
|
3175
3526
|
var Alert3 = function Alert3(props) {
|
|
3527
|
+
var _props$padding2, _props$rounded2;
|
|
3176
3528
|
var _useContext3 = useContext(ThemeContext),
|
|
3177
3529
|
currentTheme = _useContext3.currentTheme;
|
|
3178
3530
|
var styles = getStylesForItem(themeObjects.ALERT_3, currentTheme, _objectSpread$v(_objectSpread$v({}, props), {}, {
|
|
3179
3531
|
scrollable: false,
|
|
3180
3532
|
grow: false
|
|
3181
3533
|
}));
|
|
3534
|
+
var padding = (_props$padding2 = props.padding) !== null && _props$padding2 !== void 0 ? _props$padding2 : "p-2";
|
|
3535
|
+
var rounded = (_props$rounded2 = props.rounded) !== null && _props$rounded2 !== void 0 ? _props$rounded2 : "rounded-md";
|
|
3536
|
+
var divider = props.divider !== false;
|
|
3182
3537
|
var uuid = getUUID$1("", "alert-3");
|
|
3183
3538
|
return /*#__PURE__*/jsx("div", {
|
|
3184
3539
|
id: uuid,
|
|
3185
|
-
className: "border border-l-4 ".concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " rounded
|
|
3540
|
+
className: "border ".concat(divider ? "border-l-4" : "", " ").concat(styles.backgroundColor, " ").concat(styles.borderColor, " ").concat(styles.textColor, " ").concat(rounded, " ").concat(padding, " text-sm ").concat(props.className || ""),
|
|
3186
3541
|
role: "alert",
|
|
3187
3542
|
children: /*#__PURE__*/jsxs("div", {
|
|
3188
3543
|
className: "flex items-start justify-between",
|
|
@@ -3760,7 +4115,7 @@ function dispatchInputChange(handler, event) {
|
|
|
3760
4115
|
}
|
|
3761
4116
|
|
|
3762
4117
|
function _typeof$v(o) { "@babel/helpers - typeof"; return _typeof$v = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$v(o); }
|
|
3763
|
-
var _excluded$o = ["label", "value", "onChange", "placeholder", "type", "id", "className", "inputClassName", "autoFocus", "disabled", "backgroundColor", "textColor", "borderColor", "placeholderTextColor", "focusRingColor", "focusBorderColor"];
|
|
4118
|
+
var _excluded$o = ["label", "value", "onChange", "placeholder", "type", "id", "className", "inputClassName", "autoFocus", "disabled", "backgroundColor", "textColor", "borderColor", "placeholderTextColor", "focusRingColor", "focusBorderColor", "height", "padding"];
|
|
3764
4119
|
function ownKeys$q(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3765
4120
|
function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty$r(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3766
4121
|
function _defineProperty$r(e, r, t) { return (r = _toPropertyKey$v(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -3801,6 +4156,10 @@ var InputText = function InputText(_ref) {
|
|
|
3801
4156
|
focusRingColor = _ref$focusRingColor === void 0 ? null : _ref$focusRingColor,
|
|
3802
4157
|
_ref$focusBorderColor = _ref.focusBorderColor,
|
|
3803
4158
|
focusBorderColor = _ref$focusBorderColor === void 0 ? null : _ref$focusBorderColor,
|
|
4159
|
+
_ref$height = _ref.height,
|
|
4160
|
+
height = _ref$height === void 0 ? "h-10" : _ref$height,
|
|
4161
|
+
_ref$padding = _ref.padding,
|
|
4162
|
+
padding = _ref$padding === void 0 ? "px-3 py-2" : _ref$padding,
|
|
3804
4163
|
htmlProps = _objectWithoutProperties$o(_ref, _excluded$o);
|
|
3805
4164
|
var _useContext = useContext(ThemeContext),
|
|
3806
4165
|
currentTheme = _useContext.currentTheme;
|
|
@@ -3836,13 +4195,13 @@ var InputText = function InputText(_ref) {
|
|
|
3836
4195
|
placeholder: placeholder,
|
|
3837
4196
|
disabled: disabled,
|
|
3838
4197
|
autoFocus: autoFocus,
|
|
3839
|
-
className: "w-full
|
|
4198
|
+
className: "w-full ".concat(height, " border shadow-sm ").concat(padding, " ").concat(styles.string, " focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-0 ").concat(styles.focusRingColor || "", " ").concat(inputClassName)
|
|
3840
4199
|
}))]
|
|
3841
4200
|
});
|
|
3842
4201
|
};
|
|
3843
4202
|
|
|
3844
4203
|
function _typeof$u(o) { "@babel/helpers - typeof"; return _typeof$u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$u(o); }
|
|
3845
|
-
var _excluded$n = ["label", "value", "onChange", "placeholder", "rows", "id", "className", "inputClassName", "disabled", "backgroundColor", "textColor", "borderColor", "placeholderTextColor", "focusRingColor", "focusBorderColor"];
|
|
4204
|
+
var _excluded$n = ["label", "value", "onChange", "placeholder", "rows", "id", "className", "inputClassName", "disabled", "backgroundColor", "textColor", "borderColor", "placeholderTextColor", "focusRingColor", "focusBorderColor", "padding"];
|
|
3846
4205
|
function ownKeys$p(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3847
4206
|
function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), !0).forEach(function (r) { _defineProperty$q(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3848
4207
|
function _defineProperty$q(e, r, t) { return (r = _toPropertyKey$u(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -3881,6 +4240,8 @@ var TextArea = function TextArea(_ref) {
|
|
|
3881
4240
|
focusRingColor = _ref$focusRingColor === void 0 ? null : _ref$focusRingColor,
|
|
3882
4241
|
_ref$focusBorderColor = _ref.focusBorderColor,
|
|
3883
4242
|
focusBorderColor = _ref$focusBorderColor === void 0 ? null : _ref$focusBorderColor,
|
|
4243
|
+
_ref$padding = _ref.padding,
|
|
4244
|
+
padding = _ref$padding === void 0 ? "px-3 py-2" : _ref$padding,
|
|
3884
4245
|
htmlProps = _objectWithoutProperties$n(_ref, _excluded$n);
|
|
3885
4246
|
var _useContext = useContext(ThemeContext),
|
|
3886
4247
|
currentTheme = _useContext.currentTheme;
|
|
@@ -3915,7 +4276,7 @@ var TextArea = function TextArea(_ref) {
|
|
|
3915
4276
|
},
|
|
3916
4277
|
placeholder: placeholder,
|
|
3917
4278
|
disabled: disabled,
|
|
3918
|
-
className: "w-full border
|
|
4279
|
+
className: "w-full border ".concat(padding, " ").concat(styles.string, " focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-0 ").concat(styles.focusRingColor || "", " ").concat(inputClassName)
|
|
3919
4280
|
}))]
|
|
3920
4281
|
});
|
|
3921
4282
|
};
|
|
@@ -5161,9 +5522,9 @@ var CodeRenderer = function CodeRenderer(_ref) {
|
|
|
5161
5522
|
};
|
|
5162
5523
|
|
|
5163
5524
|
function _typeof$i(o) { "@babel/helpers - typeof"; return _typeof$i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$i(o); }
|
|
5164
|
-
var _excluded$c = ["text", "textSize", "onClick", "className", "children"],
|
|
5165
|
-
_excluded2$5 = ["text", "textSize", "onClick", "className", "active", "children"],
|
|
5166
|
-
_excluded3$5 = ["text", "textSize", "onClick", "className", "children"];
|
|
5525
|
+
var _excluded$c = ["text", "textSize", "onClick", "className", "children", "padding", "rounded", "border"],
|
|
5526
|
+
_excluded2$5 = ["text", "textSize", "onClick", "className", "active", "children", "padding", "rounded", "border"],
|
|
5527
|
+
_excluded3$5 = ["text", "textSize", "onClick", "className", "children", "padding", "rounded", "border"];
|
|
5167
5528
|
function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5168
5529
|
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty$f(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5169
5530
|
function _defineProperty$f(e, r, t) { return (r = _toPropertyKey$i(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -5180,18 +5541,24 @@ var Tag = function Tag(_ref) {
|
|
|
5180
5541
|
_ref$className = _ref.className,
|
|
5181
5542
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
5182
5543
|
children = _ref.children,
|
|
5544
|
+
_ref$padding = _ref.padding,
|
|
5545
|
+
padding = _ref$padding === void 0 ? "px-3 py-1.5" : _ref$padding,
|
|
5546
|
+
_ref$rounded = _ref.rounded,
|
|
5547
|
+
rounded = _ref$rounded === void 0 ? "rounded" : _ref$rounded,
|
|
5548
|
+
_ref$border = _ref.border,
|
|
5549
|
+
border = _ref$border === void 0 ? true : _ref$border,
|
|
5183
5550
|
props = _objectWithoutProperties$c(_ref, _excluded$c);
|
|
5184
5551
|
var _useContext = useContext(ThemeContext),
|
|
5185
5552
|
currentTheme = _useContext.currentTheme;
|
|
5186
5553
|
var styles = getStylesForItem(themeObjects.TAG, currentTheme, _objectSpread$e(_objectSpread$e({}, props), {}, {
|
|
5187
5554
|
grow: false
|
|
5188
5555
|
}));
|
|
5189
|
-
var stylesCalculated = "".concat(styles.string, " font-medium rounded border ").concat(onClick !== null ? "cursor-pointer" : "", " ").concat(textSize, " ").concat(className);
|
|
5556
|
+
var stylesCalculated = "".concat(styles.string, " font-medium ").concat(rounded, " ").concat(border ? "border" : "", " ").concat(onClick !== null ? "cursor-pointer" : "", " ").concat(textSize, " ").concat(className);
|
|
5190
5557
|
var uuid = getUUID$1("", "tag");
|
|
5191
5558
|
return /*#__PURE__*/jsx("span", {
|
|
5192
5559
|
id: uuid,
|
|
5193
5560
|
onClick: onClick,
|
|
5194
|
-
className: "flex flex-row w-fit ".concat(stylesCalculated, "
|
|
5561
|
+
className: "flex flex-row w-fit ".concat(stylesCalculated, " ").concat(padding, " whitespace-nowrap items-center justify-center transition-colors duration-150"),
|
|
5195
5562
|
children: children !== undefined ? children : text
|
|
5196
5563
|
});
|
|
5197
5564
|
};
|
|
@@ -5206,6 +5573,12 @@ var Tag2 = function Tag2(_ref2) {
|
|
|
5206
5573
|
_ref2$active = _ref2.active,
|
|
5207
5574
|
active = _ref2$active === void 0 ? false : _ref2$active,
|
|
5208
5575
|
children = _ref2.children,
|
|
5576
|
+
_ref2$padding = _ref2.padding,
|
|
5577
|
+
padding = _ref2$padding === void 0 ? "px-2 py-1" : _ref2$padding,
|
|
5578
|
+
_ref2$rounded = _ref2.rounded,
|
|
5579
|
+
rounded = _ref2$rounded === void 0 ? "rounded" : _ref2$rounded,
|
|
5580
|
+
_ref2$border = _ref2.border,
|
|
5581
|
+
border = _ref2$border === void 0 ? true : _ref2$border,
|
|
5209
5582
|
props = _objectWithoutProperties$c(_ref2, _excluded2$5);
|
|
5210
5583
|
var _useContext2 = useContext(ThemeContext),
|
|
5211
5584
|
currentTheme = _useContext2.currentTheme;
|
|
@@ -5213,12 +5586,12 @@ var Tag2 = function Tag2(_ref2) {
|
|
|
5213
5586
|
grow: false
|
|
5214
5587
|
}));
|
|
5215
5588
|
var colorClasses = active ? "".concat(styles.activeBackgroundColor || styles.backgroundColor || "", " ").concat(styles.activeTextColor || styles.textColor || "") : "".concat(styles.backgroundColor || "", " ").concat(styles.textColor || "", " ").concat(styles.hoverBackgroundColor || "", " ").concat(styles.hoverTextColor || "");
|
|
5216
|
-
var stylesCalculated = "".concat(colorClasses, " ").concat(styles.borderColor || "", " font-medium rounded border ").concat(onClick !== null ? "cursor-pointer" : "", " ").concat(textSize, " ").concat(className);
|
|
5589
|
+
var stylesCalculated = "".concat(colorClasses, " ").concat(styles.borderColor || "", " font-medium ").concat(rounded, " ").concat(border ? "border" : "", " ").concat(onClick !== null ? "cursor-pointer" : "", " ").concat(textSize, " ").concat(className);
|
|
5217
5590
|
var uuid = getUUID$1("", "tag-2");
|
|
5218
5591
|
return /*#__PURE__*/jsx("span", {
|
|
5219
5592
|
id: uuid,
|
|
5220
5593
|
onClick: onClick,
|
|
5221
|
-
className: "flex flex-row w-fit ".concat(stylesCalculated, "
|
|
5594
|
+
className: "flex flex-row w-fit ".concat(stylesCalculated, " ").concat(padding, " whitespace-nowrap items-center justify-center transition-colors duration-150"),
|
|
5222
5595
|
children: children !== undefined ? children : text
|
|
5223
5596
|
});
|
|
5224
5597
|
};
|
|
@@ -5231,18 +5604,24 @@ var Tag3 = function Tag3(_ref3) {
|
|
|
5231
5604
|
_ref3$className = _ref3.className,
|
|
5232
5605
|
className = _ref3$className === void 0 ? "" : _ref3$className,
|
|
5233
5606
|
children = _ref3.children,
|
|
5607
|
+
_ref3$padding = _ref3.padding,
|
|
5608
|
+
padding = _ref3$padding === void 0 ? "px-1.5 py-0.5" : _ref3$padding,
|
|
5609
|
+
_ref3$rounded = _ref3.rounded,
|
|
5610
|
+
rounded = _ref3$rounded === void 0 ? "rounded" : _ref3$rounded,
|
|
5611
|
+
_ref3$border = _ref3.border,
|
|
5612
|
+
border = _ref3$border === void 0 ? true : _ref3$border,
|
|
5234
5613
|
props = _objectWithoutProperties$c(_ref3, _excluded3$5);
|
|
5235
5614
|
var _useContext3 = useContext(ThemeContext),
|
|
5236
5615
|
currentTheme = _useContext3.currentTheme;
|
|
5237
5616
|
var styles = getStylesForItem(themeObjects.TAG_3, currentTheme, _objectSpread$e(_objectSpread$e({}, props), {}, {
|
|
5238
5617
|
grow: false
|
|
5239
5618
|
}));
|
|
5240
|
-
var stylesCalculated = "".concat(styles.string, " font-normal rounded border ").concat(onClick !== null ? "cursor-pointer" : "", " ").concat(textSize, " ").concat(className);
|
|
5619
|
+
var stylesCalculated = "".concat(styles.string, " font-normal ").concat(rounded, " ").concat(border ? "border" : "", " ").concat(onClick !== null ? "cursor-pointer" : "", " ").concat(textSize, " ").concat(className);
|
|
5241
5620
|
var uuid = getUUID$1("", "tag-3");
|
|
5242
5621
|
return /*#__PURE__*/jsx("span", {
|
|
5243
5622
|
id: uuid,
|
|
5244
5623
|
onClick: onClick,
|
|
5245
|
-
className: "flex flex-row w-fit ".concat(stylesCalculated, "
|
|
5624
|
+
className: "flex flex-row w-fit ".concat(stylesCalculated, " ").concat(padding, " whitespace-nowrap items-center justify-center transition-colors duration-150"),
|
|
5246
5625
|
children: children !== undefined ? children : text
|
|
5247
5626
|
});
|
|
5248
5627
|
};
|
|
@@ -10312,5 +10691,5 @@ if (process.env.NODE_ENV !== "development") {
|
|
|
10312
10691
|
console.log = function () {};
|
|
10313
10692
|
}
|
|
10314
10693
|
|
|
10315
|
-
export { Accordion, Accordion2, Accordion3, Alert, Alert2, Alert3, AlertBanner, AlgoliaRefinementList, AlgoliaSearchBox, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Button, Button2, Button3, ButtonIcon, ButtonIcon2, ButtonIcon3, Caption, Caption2, Caption3, Card, Card2, Card3, Checkbox, Code, Code2, Code3, CodeEditorInline, CodeEditorVS, CodeRenderer, CommandPalette, ConfirmationModal, Container, DashPanel, DashPanel2, DashPanel3, DataList, Divider, Divider2, Divider3, DragComponent, Drawer, DropComponent, DropdownPanel, DropdownPanel2, DropdownPanel3, EmptyState, ErrorMessage, FormField, FormLabel, Heading, Heading2, Heading3, Icon, Icon2, Icon3, InputText, LayoutContainer, MainSection, Menu, Menu2, Menu3, MenuItem, MenuItem2, MenuItem3, MockAlgolia, MockLayout, MockWrapper, Modal, Navbar, PalettePreviewPane, Panel, Panel2, Panel3, Paragraph, Paragraph2, Paragraph3, ProgressBar, ProgressBar2, ProgressBar3, RadioGroup, RichText, SLACK_QUICK_REACTION_SHORTCODES, SearchInput, SelectInput, SelectMenu, SelectableCard, SettingsModal, Sidebar, Skeleton, Slider, StatCard, StatusBadge, Stepper, SubHeading, SubHeading2, SubHeading3, Switch, TabbedNavbar, Table, Table2, Table3, Tabs, Tabs2, Tabs3, Tag, Tag2, Tag3, TextArea, ThemeContext, ThemeFromUrlPane, ThemePreviewBanner, ThemePreviewContext, ThemePreviewProvider, Toast, Toast2, Toast3, Toggle, Toggle2, Toggle3, Tooltip, WS_STATES, WebSocketStatus, WidgetChrome, WidgetContext, capitalizeFirstLetter, colorNames, colorTypes, deepCopy, getCSSStyleForClassname, getClassForObjectType, getDefaultStylesForItem, getRandomInt, getStyleName, getStylesForItem, getUUID$1 as getUUID, isObject, mock, mockText, objectTypes, shades, slackEmojiForName, styleClassNames, tailwindHeightFractions, themeObjects, themeVariants, useLazyEnrichment, useSidebar, useThemePreview, withRouter };
|
|
10694
|
+
export { Accordion, Accordion2, Accordion3, Alert, Alert2, Alert3, AlertBanner, AlgoliaRefinementList, AlgoliaSearchBox, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Button, Button2, Button3, ButtonIcon, ButtonIcon2, ButtonIcon3, Caption, Caption2, Caption3, Card, Card2, Card3, Checkbox, Code, Code2, Code3, CodeEditorInline, CodeEditorVS, CodeRenderer, CommandPalette, ConfirmationModal, Container, DashPanel, DashPanel2, DashPanel3, DataList, Divider, Divider2, Divider3, DragComponent, Drawer, DropComponent, DropdownPanel, DropdownPanel2, DropdownPanel3, EmptyState, ErrorMessage, FormField, FormLabel, Heading, Heading2, Heading3, Icon, Icon2, Icon3, InputText, LayoutContainer, MainSection, Menu, Menu2, Menu3, MenuItem, MenuItem2, MenuItem3, MockAlgolia, MockLayout, MockWrapper, Modal, Navbar, PalettePreviewPane, Panel, Panel2, Panel3, Paragraph, Paragraph2, Paragraph3, ProgressBar, ProgressBar2, ProgressBar3, RadioGroup, RichText, SLACK_QUICK_REACTION_SHORTCODES, SearchInput, SelectInput, SelectMenu, SelectableCard, SettingsModal, Sidebar, Skeleton, Slider, StatCard, StatusBadge, Stepper, SubHeading, SubHeading2, SubHeading3, Switch, TabbedNavbar, Table, Table2, Table3, Tabs, Tabs2, Tabs3, Tag, Tag2, Tag3, TextArea, ThemeContext, ThemeFromUrlPane, ThemePreviewBanner, ThemePreviewContext, ThemePreviewProvider, Toast, Toast2, Toast3, Toggle, Toggle2, Toggle3, Tooltip, WS_STATES, WebSocketStatus, WidgetChrome, WidgetContext, capitalizeFirstLetter, colorNames, colorTypes, contrastRatio, deepCopy, deriveShades, getCSSStyleForClassname, getClassForObjectType, getDefaultStylesForItem, getRandomInt, getStyleName, getStylesForItem, getUUID$1 as getUUID, hexToRgb, hslToRgb, isHexColor, isObject, mock, mockText, normalizeHex, objectTypes, rgbToHex, rgbToHsl, shades, slackEmojiForName, styleClassNames, tailwindHeightFractions, themeObjects, themeVariants, useLazyEnrichment, useSidebar, useThemePreview, withRouter };
|
|
10316
10695
|
//# sourceMappingURL=index.js.map
|