<commit_before>/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */

// Implements the [Trial Bar design pattern](https://lightningdesignsystem.com/components/trial-bar/) in React.
// Based on SLDS v2.4.5
import React from 'react';
import PropTypes from 'prop-types';

import { TRIAL_BAR } from '../../utilities/constants';

const propTypes = {
	/**
	 * Renders the labels in the trial bar.
	 */
	labels: PropTypes.shape({
		/** Amount of time left in trial, e.g. `30` */
		timeLeft: PropTypes.string,
		/** Unit of the amount of time left, e.g. `days` */
		timeLeftUnit: PropTypes.string,
	}),
	/**
	 * Provide children of the types `<TrialBarButton />` or `<TrialBarDropdown />` to define the structure of the trial bar.
	 * ```
	 * <TrialBar>
	 *   <TrialBarButton />
	 *   <TrialBarDropdown />
	 * </TrialBar>
	 * ```
	 */
	children: PropTypes.node,
	/**
	 * Customs styles to be applied to the component.
	 */
	style: PropTypes.object,
	/**
	 * CSS classes to be added to the component. Uses `classNames` [API](https://github.com/JedWatson/classnames).
	 */
	className: PropTypes.oneOfType([
		PropTypes.array,
		PropTypes.object,
		PropTypes.string,
	]),
	/**
	 * Renders the actions section of the trial bar.
	 */
	onRenderActions: PropTypes.func,
};

const defaultProps = {};

/**
 * Trial bar components are used to provide an interactive and educational prospect experience for setup.
 */
class TrialBar extends React.Component {
	render() {
		return (
			<div className="slds-trial-header slds-grid">
				<div className="slds-grid">{this.props.children}</div>
				<div className="slds-grid slds-grid_vertical-align-center slds-col_bump-left">
					<span className="slds-box slds-box_xx-small slds-theme_default">
						{this.props.labels.timeLeft}<commit_msg>Trial Bar: fix deepscan issues<commit_after>/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */

// Implements the [Trial Bar design pattern](https://lightningdesignsystem.com/components/trial-bar/) in React.
// Based on SLDS v2.4.5
import React from 'react';
import PropTypes from 'prop-types';

import { TRIAL_BAR } from '../../utilities/constants';
import classNames from 'classnames';

const propTypes = {
	/**
	 * Renders the labels in the trial bar.
	 */
	labels: PropTypes.shape({
		/** Amount of time left in trial, e.g. `30` */
		timeLeft: PropTypes.string,
		/** Unit of the amount of time left, e.g. `days` */
		timeLeftUnit: PropTypes.string,
	}),
	/**
	 * Provide children of the types `<TrialBarButton />` or `<TrialBarDropdown />` to define the structure of the trial bar.
	 * ```
	 * <TrialBar>
	 *   <TrialBarButton />
	 *   <TrialBarDropdown />
	 * </TrialBar>
	 * ```
	 */
	children: PropTypes.node,
	/**
	 * Customs styles to be applied to the component.
	 */
	style: PropTypes.object,
	/**
	 * CSS classes to be added to the component. Uses `classNames` [API](https://github.com/JedWatson/classnames).
	 */
	className: PropTypes.oneOfType([
		PropTypes.array,
		PropTypes.object,
		PropTypes.string,
	]),
	/**
	 * Renders the actions section of the trial bar.
	 */
	onRenderActions: PropTypes.func,
};

const defaultProps = {};

/**
 * Trial bar components are used to provide an interactive and educational prospect experience for setup.
 */
class TrialBar extends React.Component {
	render() {
		return (
			<div
				className={classNames(
					'slds-trial-header slds-grid',
					this.props.className
				)}
				style={this.props.style}
			>
				<div className="slds-grid">{this.props.children}</div>
				<div className="slds-grid slds-grid_vertical-align-center slds-col_bump-left">
					<span className="slds-box slds-box_xx-small slds-theme_default">
						{this.props.labels.timeLeft}
{'fraction_non_alphanumeric': 0.14083053907660562, 'fraction_numerical': 0.005158627805003869, 'mean_word_length': 3.432, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1981752', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1238, 'n_words': 346}