@devtron-labs/devtron-fe-common-lib 0.0.18-beta-1 → 0.0.18-beta-2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './Toggle.scss';
|
|
3
|
-
declare const Toggle: ({ selected, onSelect, color, rootClassName, disabled, dataTestId, Icon, ...props }: {
|
|
3
|
+
declare const Toggle: ({ selected, onSelect, color, rootClassName, disabled, dataTestId, Icon, iconClass, ...props }: {
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
selected?: boolean;
|
|
6
6
|
onSelect?: any;
|
|
@@ -9,5 +9,6 @@ declare const Toggle: ({ selected, onSelect, color, rootClassName, disabled, dat
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
dataTestId?: string;
|
|
11
11
|
Icon?: any;
|
|
12
|
+
iconClass?: string;
|
|
12
13
|
}) => JSX.Element;
|
|
13
14
|
export default Toggle;
|
package/dist/index.js
CHANGED
|
@@ -22680,8 +22680,8 @@ styleInject(css_248z$2);
|
|
|
22680
22680
|
|
|
22681
22681
|
var Toggle = function (_a) {
|
|
22682
22682
|
var _b;
|
|
22683
|
-
var _c = _a.selected, selected = _c === void 0 ? false : _c, _d = _a.onSelect, onSelect = _d === void 0 ? null : _d, _e = _a.color, color = _e === void 0 ? '#36b37e' : _e, _f = _a.rootClassName, rootClassName = _f === void 0 ? '' : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.dataTestId, dataTestId = _h === void 0 ? 'handle-toggle-button' : _h, _j = _a.Icon, Icon = _j === void 0 ? null : _j, props = __rest(_a, ["selected", "onSelect", "color", "rootClassName", "disabled", "dataTestId", "Icon"]);
|
|
22684
|
-
var
|
|
22683
|
+
var _c = _a.selected, selected = _c === void 0 ? false : _c, _d = _a.onSelect, onSelect = _d === void 0 ? null : _d, _e = _a.color, color = _e === void 0 ? '#36b37e' : _e, _f = _a.rootClassName, rootClassName = _f === void 0 ? '' : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.dataTestId, dataTestId = _h === void 0 ? 'handle-toggle-button' : _h, _j = _a.Icon, Icon = _j === void 0 ? null : _j, _k = _a.iconClass, iconClass = _k === void 0 ? '' : _k, props = __rest(_a, ["selected", "onSelect", "color", "rootClassName", "disabled", "dataTestId", "Icon", "iconClass"]);
|
|
22684
|
+
var _l = __read(React.useState(selected), 2), active = _l[0], setActive = _l[1];
|
|
22685
22685
|
useEffectAfterMount(function () {
|
|
22686
22686
|
if (typeof onSelect === 'function') {
|
|
22687
22687
|
if (active !== selected) {
|
|
@@ -22697,7 +22697,7 @@ var Toggle = function (_a) {
|
|
|
22697
22697
|
setActive(function (active) { return !active; });
|
|
22698
22698
|
}
|
|
22699
22699
|
}
|
|
22700
|
-
return (jsxRuntime.jsxs("label", __assign({}, props, { className: "".concat(rootClassName, " toggle__switch ").concat(disabled ? 'disabled' : ''), style: (_b = {}, _b['--color'] = color, _b) }, { children: [jsxRuntime.jsx("input", { type: "checkbox", checked: !!active, onChange: handleClick, className: "toggle__input" }), jsxRuntime.jsx("span", __assign({ className: "toggle__slider ".concat(Icon ? 'with-icon br-4 dc__border' : 'round'), "data-testid": dataTestId }, { children: Icon && jsxRuntime.jsx(Icon, { className: "icon-dim-20 br-4 p-2" }) }))] })));
|
|
22700
|
+
return (jsxRuntime.jsxs("label", __assign({}, props, { className: "".concat(rootClassName, " toggle__switch ").concat(disabled ? 'disabled' : ''), style: (_b = {}, _b['--color'] = color, _b) }, { children: [jsxRuntime.jsx("input", { type: "checkbox", checked: !!active, onChange: handleClick, className: "toggle__input" }), jsxRuntime.jsx("span", __assign({ className: "toggle__slider ".concat(Icon ? 'with-icon br-4 dc__border' : 'round'), "data-testid": dataTestId }, { children: Icon && jsxRuntime.jsx(Icon, { className: "icon-dim-20 br-4 p-2 ".concat(iconClass) }) }))] })));
|
|
22701
22701
|
};
|
|
22702
22702
|
|
|
22703
22703
|
var css_248z$1 = ".modal-body--scan-details {\n position: fixed;\n top: 0;\n right: 0;\n background: var(--N000);\n width: 800px;\n}\n\n.security-tab__table {\n width: 100%;\n}\n\n.security-tab__table-header {\n border-bottom: solid 1px var(--N200);\n}\n\n.security-cell-header {\n font-size: 12px;\n font-weight: 600;\n line-height: 1.5;\n letter-spacing: normal;\n text-transform: uppercase;\n color: var(--N500);\n}\n\n.dc__security-tab__table-row {\n font-size: 13px;\n font-weight: normal;\n line-height: 1.54;\n letter-spacing: normal;\n color: var(--N900);\n box-shadow: inset 0 -1px 0 0 #f5f5f5;\n}\n\n.security-tab__cell-cve,\n.security-tab__cell-severity,\n.security-tab__cell-package,\n.security-tab__cell-current-ver,\n.security-tab__cell-fixed-ver,\n.security-tab__cell-policy {\n padding: 10px;\n}\n\n.security-tab__cell-cve {\n padding-left: 0px;\n text-align: left;\n width: 20%;\n}\n\n.security-tab__cell-policy {\n padding-right: 0px;\n}\n\n.security-tab__cell-policy--whitelist,\n.security-tab__cell-policy--whitelisted {\n color: var(--G500);\n text-transform: capitalize;\n}\n\n.security-tab__cell-policy--block {\n color: var(--R500);\n text-transform: capitalize;\n}\n\n.scanned-object__results {\n margin: 0 20px;\n}";
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ const Toggle = ({
|
|
|
10
10
|
disabled = false,
|
|
11
11
|
dataTestId = 'handle-toggle-button',
|
|
12
12
|
Icon = null,
|
|
13
|
+
iconClass= '',
|
|
13
14
|
...props
|
|
14
15
|
}) => {
|
|
15
16
|
const [active, setActive] = React.useState(selected)
|
|
@@ -40,7 +41,7 @@ const Toggle = ({
|
|
|
40
41
|
>
|
|
41
42
|
<input type="checkbox" checked={!!active} onChange={handleClick} className="toggle__input" />
|
|
42
43
|
<span className={`toggle__slider ${Icon ? 'with-icon br-4 dc__border' : 'round'}`} data-testid={dataTestId}>
|
|
43
|
-
{Icon && <Icon className=
|
|
44
|
+
{Icon && <Icon className={`icon-dim-20 br-4 p-2 ${iconClass}`} />}
|
|
44
45
|
</span>
|
|
45
46
|
</label>
|
|
46
47
|
)
|