From d29fba6435b308c8581c8c2475308b16b8f8de2e Mon Sep 17 00:00:00 2001 From: cchaos Date: Mon, 6 Aug 2018 15:43:44 -0400 Subject: [PATCH] Addressing PR comments --- .../src/components/guide_section/guide_section.js | 12 ++++++++---- src-docs/src/views/steps/status.js | 10 +++++----- src-docs/src/views/steps/steps_example.js | 11 ++++++++--- .../form/switch/__snapshots__/switch.test.js.snap | 11 ++--------- src/components/icon/__snapshots__/icon.test.js.snap | 11 ++--------- src/components/icon/assets/check.svg | 7 +------ .../steps/__snapshots__/step_number.test.js.snap | 11 ++--------- .../__snapshots__/steps_horizontal.test.js.snap | 11 ++--------- src/components/steps/_step_number.scss | 3 ++- src/components/steps/step.js | 3 ++- src/components/steps/step_horizontal.js | 4 +++- .../__snapshots__/global_toast_list.test.js.snap | 11 ++--------- 12 files changed, 39 insertions(+), 66 deletions(-) diff --git a/src-docs/src/components/guide_section/guide_section.js b/src-docs/src/components/guide_section/guide_section.js index 7c6efd3464f..28fc04832e3 100644 --- a/src-docs/src/components/guide_section/guide_section.js +++ b/src-docs/src/components/guide_section/guide_section.js @@ -162,24 +162,28 @@ export class GuideSection extends Component { } = props[propName]; let humanizedName = ( - {propName} + {propName} ); if (required) { humanizedName = ( - {humanizedName} (required) + {humanizedName} (required) ); } const humanizedType = humanizeType(type); - const typeMarkup = markup(humanizedType); + const typeMarkup = ({markup(humanizedType)}); const descriptionMarkup = markup(propDescription); let defaultValueMarkup = ''; if (defaultValue) { - defaultValueMarkup = [ {defaultValue.value} ]; + defaultValueMarkup = [( + + {defaultValue.value} + + )]; if (defaultValue.comment) { defaultValueMarkup.push(`(${defaultValue.comment})`); } diff --git a/src-docs/src/views/steps/status.js b/src-docs/src/views/steps/status.js index 89a1c2f8fe5..1164cf95c30 100644 --- a/src-docs/src/views/steps/status.js +++ b/src-docs/src/views/steps/status.js @@ -22,7 +22,7 @@ export default class extends Component { this.handleComplete = this.handleComplete.bind(this); this.handleWarning = this.handleWarning.bind(this); this.handleDanger = this.handleDanger.bind(this); - this.handleUncomplete = this.handleUncomplete.bind(this); + this.makeIncomplete = this.makeIncomplete.bind(this); } handleComplete() { @@ -43,7 +43,7 @@ export default class extends Component { }); } - handleUncomplete() { + makeIncomplete() { this.setState({ status: 'incomplete', }); @@ -58,7 +58,7 @@ export default class extends Component { ); } else { completeButton = ( - Reset + Reset ); } @@ -69,7 +69,7 @@ export default class extends Component { ); } else { warningButton = ( - Reset + Reset ); } @@ -80,7 +80,7 @@ export default class extends Component { ); } else { dangerButton = ( - Reset + Reset ); } diff --git a/src-docs/src/views/steps/steps_example.js b/src-docs/src/views/steps/steps_example.js index 280a563ae7d..618ba2f6505 100644 --- a/src-docs/src/views/steps/steps_example.js +++ b/src-docs/src/views/steps/steps_example.js @@ -14,6 +14,10 @@ import { EuiStepsHorizontal, } from '../../../../src/components'; +import { + EuiStepHorizontal, +} from '../../../../src/components/steps/step_horizontal'; + import Steps from './steps'; const stepsSource = require('!!raw-loader!./steps'); const stepsHtml = renderToHtml(Steps); @@ -106,8 +110,9 @@ export const StepsExample = { }], text: (

- Steps can optionally include status prop with - a value of incomplete, complete, warning or danger. + Steps can optionally include status prop that will alter the look of the number prefix. + The options + are incomplete, complete, warning and danger. This is used mostly as a final step when you need to make some sort of final check.

), @@ -126,6 +131,6 @@ export const StepsExample = {

For use when forms/setup instructions can and should be split into multiple pages.

), demo: , - props: { EuiStepsHorizontal }, + props: { EuiStepsHorizontal, EuiStepHorizontal }, }], }; diff --git a/src/components/form/switch/__snapshots__/switch.test.js.snap b/src/components/form/switch/__snapshots__/switch.test.js.snap index ff45824f418..c4f178c0c99 100644 --- a/src/components/form/switch/__snapshots__/switch.test.js.snap +++ b/src/components/form/switch/__snapshots__/switch.test.js.snap @@ -45,17 +45,10 @@ exports[`EuiSwitch is rendered 1`] = ` height="16" viewBox="0 0 16 16" width="16" - xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" > - - - - diff --git a/src/components/icon/__snapshots__/icon.test.js.snap b/src/components/icon/__snapshots__/icon.test.js.snap index 8bee34caa7c..7c41b9fbe61 100644 --- a/src/components/icon/__snapshots__/icon.test.js.snap +++ b/src/components/icon/__snapshots__/icon.test.js.snap @@ -765,17 +765,10 @@ exports[`EuiIcon props type check is rendered 1`] = ` height="16" viewBox="0 0 16 16" width="16" - xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" > - - - - `; diff --git a/src/components/icon/assets/check.svg b/src/components/icon/assets/check.svg index 61cdad5fdef..7e747e5085c 100644 --- a/src/components/icon/assets/check.svg +++ b/src/components/icon/assets/check.svg @@ -1,8 +1,3 @@ - - - - - - + diff --git a/src/components/steps/__snapshots__/step_number.test.js.snap b/src/components/steps/__snapshots__/step_number.test.js.snap index a9d5c742cb4..a10762193de 100644 --- a/src/components/steps/__snapshots__/step_number.test.js.snap +++ b/src/components/steps/__snapshots__/step_number.test.js.snap @@ -25,17 +25,10 @@ exports[`EuiStepNumber props status complete is rendered 1`] = ` title="complete" viewBox="0 0 16 16" width="16" - xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" > - - - - diff --git a/src/components/steps/__snapshots__/steps_horizontal.test.js.snap b/src/components/steps/__snapshots__/steps_horizontal.test.js.snap index 84b8dd609fe..960fec12695 100644 --- a/src/components/steps/__snapshots__/steps_horizontal.test.js.snap +++ b/src/components/steps/__snapshots__/steps_horizontal.test.js.snap @@ -30,17 +30,10 @@ exports[`EuiStepsHorizontal is rendered 1`] = ` title="complete" viewBox="0 0 16 16" width="16" - xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" > - - - - diff --git a/src/components/steps/_step_number.scss b/src/components/steps/_step_number.scss index 5775e04c116..9959489e4b5 100644 --- a/src/components/steps/_step_number.scss +++ b/src/components/steps/_step_number.scss @@ -7,7 +7,8 @@ } &--complete { - .euiStepNumber__icon path { + // Thicken the checkmark but adding a slight stroke. + .euiStepNumber__icon { stroke: currentColor; stroke-width: .5px; } diff --git a/src/components/steps/step.js b/src/components/steps/step.js index 9b1960531f5..f0976663392 100644 --- a/src/components/steps/step.js +++ b/src/components/steps/step.js @@ -56,7 +56,8 @@ export const EuiStep = ({ EuiStep.propTypes = { children: PropTypes.node.isRequired, /** - * Will replace the number provided in props.step with alternate styling + * Will replace the number provided in props.step with alternate styling. + * Options: `complete`, `incomplete`, `warning`, `danger`, `disabled` */ status: PropTypes.oneOf(STATUS), /** diff --git a/src/components/steps/step_horizontal.js b/src/components/steps/step_horizontal.js index f83ed5e94ab..b4b9e122a96 100644 --- a/src/components/steps/step_horizontal.js +++ b/src/components/steps/step_horizontal.js @@ -87,7 +87,9 @@ EuiStepHorizontal.propTypes = { className: PropTypes.string, disabled: PropTypes.bool, /** - * Will replace the number provided in props.step with alternate styling + * Will replace the number provided in props.step with alternate styling. + * Options: `complete`, `incomplete`, `warning`, `danger`, `disabled`. + * The `isSelected`, `isComplete`, and `disabled` props will override these. */ status: PropTypes.oneOf(STATUS), }; diff --git a/src/components/toast/__snapshots__/global_toast_list.test.js.snap b/src/components/toast/__snapshots__/global_toast_list.test.js.snap index 20b88a26cdb..5677671d573 100644 --- a/src/components/toast/__snapshots__/global_toast_list.test.js.snap +++ b/src/components/toast/__snapshots__/global_toast_list.test.js.snap @@ -34,17 +34,10 @@ exports[`EuiGlobalToastList props toasts is rendered 1`] = ` height="16" viewBox="0 0 16 16" width="16" - xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" > - - - -