How to use @elastic/eui - 10 common examples

To help you get started, we’ve selected a few @elastic/eui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / src / legacy / ui / public / accessibility / __tests__ / kbn_accessible_click.js View on Github external
it(`on ENTER keyup`, () => {
      const e = angular.element.Event('keyup'); // eslint-disable-line new-cap
      e.keyCode = keyCodes.ENTER;
      element.trigger(e);
      sinon.assert.calledOnce(scope.handleClick);
    });
github elastic / kibana / src / legacy / ui / public / accessibility / __tests__ / kbn_accessible_click.js View on Github external
it(`on ENTER keyup`, () => {
      const e = angular.element.Event('keyup'); // eslint-disable-line new-cap
      e.keyCode = keyCodes.ENTER;
      element.trigger(e);
      sinon.assert.calledOnce(scope.handleClick);
    });
github elastic / kibana / src / legacy / ui / public / accessibility / __tests__ / kbn_ui_ace_keyboard_mode.js View on Github external
it('should be shown again, when pressing Escape in ace editor', () => {
      const textarea = element.find('textarea');
      const hint = element.find('.kbnUiAceKeyboardHint');
      sinon.spy(hint[0], 'focus');
      const ev = angular.element.Event('keydown'); // eslint-disable-line new-cap
      ev.keyCode = keyCodes.ESCAPE;
      textarea.trigger(ev);
      expect(hint[0].focus.called).to.be(true);
      expect(hint.hasClass('kbnUiAceKeyboardHint-isInactive')).to.be(false);
    });
  });
github elastic / kibana / src / legacy / ui / public / accessibility / __tests__ / kbn_ui_ace_keyboard_mode.js View on Github external
it('should be shown again, when pressing Escape in ace editor', () => {
      const textarea = element.find('textarea');
      const hint = element.find('.kbnUiAceKeyboardHint');
      sinon.spy(hint[0], 'focus');
      const ev = angular.element.Event('keydown'); // eslint-disable-line new-cap
      ev.keyCode = keyCodes.ESCAPE;
      textarea.trigger(ev);
      expect(hint[0].focus.called).to.be(true);
      expect(hint.hasClass('kbnUiAceKeyboardHint-isInactive')).to.be(false);
    });
  });
github elastic / kibana / x-pack / legacy / plugins / code / public / components / diff_page / diff.tsx View on Github external
const CommitId = styled.span`
  display: inline-block;
  padding: 0 ${theme.paddingSizes.xs};
  border: ${theme.euiBorderThin};
`;

const Addition = styled.div`
  padding: ${theme.paddingSizes.xs} ${theme.paddingSizes.s};
  border-radius: ${theme.euiSizeXS};
  color: white;
  margin-right: ${theme.euiSizeS};
  background-color: ${theme.euiColorDanger};
`;

const Deletion = styled(Addition)`
  background-color: ${theme.euiColorVis0};
`;

const Container = styled.div`
  padding: ${theme.paddingSizes.xs} ${theme.paddingSizes.m};
`;

const TopBarContainer = styled.div`
  height: calc(48rem / 14);
  border-bottom: ${theme.euiBorderThin};
  padding: 0 ${theme.paddingSizes.m};
  display: flex;
  flex-direction: row;
  justify-content: space-between;
`;

// @types/styled-components@3.0.1 does not yet support `defaultProps`, which EuiAccordion uses
github elastic / kibana / x-pack / plugins / apm / public / selectors / chartSelectors.ts View on Github external
titleShort: '95th',
      data: p95,
      type: 'linemark',
      color: theme.euiColorVis5
    },
    {
      title: i18n.translate(
        'xpack.apm.transactions.chart.99thPercentileLabel',
        {
          defaultMessage: '99th percentile'
        }
      ),
      titleShort: '99th',
      data: p99,
      type: 'linemark',
      color: theme.euiColorVis7
    }
  ];

  if (anomalyTimeseries) {
    // insert after Avg. series
    series.splice(
      1,
      0,
      getAnomalyBoundariesSeries(anomalyTimeseries.anomalyBoundaries),
      getAnomalyScoreSeries(anomalyTimeseries.anomalyScore)
    );
  }

  return series;
}
github elastic / kibana / x-pack / legacy / plugins / apm / public / selectors / chartSelectors.ts View on Github external
titleShort: '95th',
      data: p95,
      type: 'linemark',
      color: theme.euiColorVis5
    },
    {
      title: i18n.translate(
        'xpack.apm.transactions.chart.99thPercentileLabel',
        {
          defaultMessage: '99th percentile'
        }
      ),
      titleShort: '99th',
      data: p99,
      type: 'linemark',
      color: theme.euiColorVis7
    }
  ];

  if (anomalyTimeseries) {
    // insert after Avg. series
    series.splice(
      1,
      0,
      getAnomalyBoundariesSeries(anomalyTimeseries.anomalyBoundaries),
      getAnomalyScoreSeries(anomalyTimeseries.anomalyScore)
    );
  }

  return series;
}
github elastic / kibana / x-pack / plugins / apm / public / store / selectors / chartSelectors.ts View on Github external
titleShort: '95th',
      data: p95,
      type: 'linemark',
      color: theme.euiColorVis5
    },
    {
      title: i18n.translate(
        'xpack.apm.transactions.chart.99thPercentileLabel',
        {
          defaultMessage: '99th percentile'
        }
      ),
      titleShort: '99th',
      data: p99,
      type: 'linemark',
      color: theme.euiColorVis7
    }
  ];

  if (anomalyTimeseries) {
    // insert after Avg. series
    series.splice(
      1,
      0,
      getAnomalyBoundariesSeries(anomalyTimeseries.anomalyBoundaries),
      getAnomalyScoreSeries(anomalyTimeseries.anomalyScore)
    );
  }

  return series;
}
github elastic / kibana / src / legacy / ui / public / accessibility / kbn_ui_ace_keyboard_mode.js View on Github external
uiAceTextbox.keydown(ev => {
        if (ev.keyCode === keyCodes.ESCAPE) {
          // If the autocompletion context menu is open then we want to let ESC close it but
          // **not** exit out of editing mode.
          if (!isAutoCompleterOpen) {
            ev.preventDefault();
            ev.stopPropagation();
            enableOverlay();
            hint.focus();
          }
        }
      });
github elastic / kibana / x-pack / legacy / plugins / ml / public / jobs / jobs_list / components / job_filter_bar / job_filter_bar.js View on Github external
}, () => {
        // trigger onChange with query for job id to trigger table filter
        const query = EuiSearchBar.Query.parse(selectedId);
        this.onChange({ query });
      });
    }