UNPKG

@grafana/ui

Version:
25 lines (20 loc) 1.07 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var Button = require('../Button/Button.cjs'); var Input = require('../Input/Input.cjs'); var Stack = require('../Layout/Stack/Stack.cjs'); "use strict"; const CONFIGURED_TEXT = "configured"; const RESET_BUTTON_TEXT = "Reset"; const SecretInput = ({ isConfigured, onReset, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Stack.Stack, { children: [ !isConfigured && /* @__PURE__ */ jsxRuntime.jsx(Input.Input, { ...props, type: "password" }), isConfigured && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [ /* @__PURE__ */ jsxRuntime.jsx(Input.Input, { ...props, type: "text", disabled: true, value: CONFIGURED_TEXT }), /* @__PURE__ */ jsxRuntime.jsx(Button.Button, { onClick: onReset, variant: "secondary", children: RESET_BUTTON_TEXT }) ] }) ] }); exports.CONFIGURED_TEXT = CONFIGURED_TEXT; exports.RESET_BUTTON_TEXT = RESET_BUTTON_TEXT; exports.SecretInput = SecretInput; //# sourceMappingURL=SecretInput.cjs.map