UNPKG

@carbon/ibm-cloud-cognitive-cdai

Version:
86 lines (85 loc) 4.62 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; function ownKeys(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; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // // Copyright IBM Corp. 2020, 2020 // // This source code is licensed under the Apache-2.0 license found in the // LICENSE file in the root directory of this source tree. // import React from 'react'; export var coreConfigFunc = function coreConfigFunc() { var customProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ open: true, heading: 'Generate an API key', labelText: 'API key generation', descriptionText: 'Optional description text. To connect securely to {{product}}, your application or tool needs an API key with permission to access the cluster and resources.', generatingLabelText: 'Generating API key', apiKey: '123456-abcdef-12345678-abcdef', apiKeyLabelText: 'API key', isAPIKeyVisible: true, apiKeyVisibilityToggleAltText: 'Show/hide API key visibility.', apiKeySecret: '', apiKeySecretLabelText: 'API key secret', apiKeySecretVisibilityToggleAltText: 'Show/hide API key secret visibility.', copyLabelText: 'Copy', closeLabelText: 'Close', apiKeyHelperText: 'This is your unique API key and is non-recoverable. If you lose this API key, you will have to reset it.', downloadLinkText: 'Download as JSON', onCopyAPIKeyData: function onCopyAPIKeyData() {}, onClose: function onClose() {}, onDownload: function onDownload() {} }, customProps); }; export var coreTextProps = ['labelText', 'heading', 'descriptionText', 'generatingLabelText', 'apiKey', 'apiKeyLabelText', 'apiKeyVisibilityToggleAltText', 'apiKeySecret', 'apiKeySecretLabelText', 'apiKeySecretVisibilityToggleAltText', 'apiKeyHelperText', 'downloadLinkText']; export var coreActionProps = ['onDownload', 'onClose', 'onCopyAPIKeyData']; export var descriptiveNameStepConfigFunc = function descriptiveNameStepConfigFunc() { var customDescriptiveNameStepProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return { generateLabelText: 'Generate', descriptiveNameStep: _objectSpread({ isRequired: true, heading: 'Provide a descriptive name to identify your API key', descriptionText: 'A descriptive name identifies the API key in the IAM registry.', labelText: 'Descriptive name', placeholder: 'Name of application', invalid: false, onChange: function onChange() {} }, customDescriptiveNameStepProps) }; }; export var descriptiveNameStepTextProps = ['value', 'heading', 'descriptionText', 'labelText', 'helperText', 'placeholder']; export var customStepsConfigFunc = function customStepsConfigFunc() { var customProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _objectSpread({ nextLabelText: 'Next', backLabelText: 'Back', generateLabelText: 'Generate', isAPIKeyGenerating: true, customSteps: [{ stepId: 'CustomStep1', stepHeading: 'Custom step 1 of 3', nextButtonDisabled: false, renderStep: function renderStep() { return /*#__PURE__*/React.createElement("div", null, "Rendering step 1. This is custom content."); } }, { stepId: 'CustomStep2', stepHeading: 'Custom step 2 of 3', descriptionText: 'Optional description text for step 2 of 3. ', nextButtonDisabled: false, renderStep: function renderStep() { return /*#__PURE__*/React.createElement("div", null, "Rendering step 2. This is custom content with a description."); } }, { stepId: 'CustomStep3', nextButtonDisabled: false, renderStep: function renderStep() { return /*#__PURE__*/React.createElement("div", null, "Rendering step 3. This is custom content with a default heading."); } }] }, customProps); }; export var stepTextProps = ['stepHeading']; export var customStepsActionProps = ['onNext', 'onBack'];