Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] Web: Add outline-info Alert.tsx + move navigation code for general use #37697

Merged
merged 1 commit into from Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions web/packages/design/src/Alert/Alert.jsx
Expand Up @@ -21,6 +21,7 @@ import styled from 'styled-components';
import PropTypes from 'prop-types';

import { space, color, width } from 'design/system';
import { fade } from 'design/theme/utils/colorManipulator';

const kind = props => {
const { kind, theme } = props;
Expand All @@ -45,6 +46,14 @@ const kind = props => {
background: theme.colors.success.main,
color: theme.colors.text.primaryInverse,
};
case 'outline-info':
return {
background: fade(theme.colors.link, 0.1),
border: `${theme.radii[1]}px solid ${theme.colors.link}`,
borderRadius: `${theme.radii[3]}px`,
boxShadow: 'none',
justifyContent: 'normal',
};
default:
return {
background: theme.colors.error.main,
Expand All @@ -57,7 +66,7 @@ const Alert = styled.div`
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border-radius: ${p => p.theme.radii[1]}px;
box-sizing: border-box;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
margin: 0 0 24px 0;
Expand All @@ -76,7 +85,13 @@ const Alert = styled.div`
`;

Alert.propTypes = {
kind: PropTypes.oneOf(['danger', 'info', 'warning', 'success']),
kind: PropTypes.oneOf([
'danger',
'info',
'warning',
'success',
'outline-info',
]),
...color.propTypes,
...space.propTypes,
...width.propTypes,
Expand All @@ -93,3 +108,4 @@ export const Danger = props => <Alert kind="danger" {...props} />;
export const Info = props => <Alert kind="info" {...props} />;
export const Warning = props => <Alert kind="warning" {...props} />;
export const Success = props => <Alert kind="success" {...props} />;
export const OutlineInfo = props => <Alert kind="outline-info" {...props} />;
1 change: 1 addition & 0 deletions web/packages/design/src/Alert/Alert.story.js
Expand Up @@ -32,5 +32,6 @@ export const Alerts = () => (
<Alert kind="warning">Some warning message</Alert>
<Alert kind="info">Some informational message</Alert>
<Alert kind="success">This is success</Alert>
<Alert kind="outline-info">Text align it yourself</Alert>
</Box>
);
21 changes: 13 additions & 8 deletions web/packages/teleport/src/Discover/Discover.tsx
Expand Up @@ -21,16 +21,16 @@ import React from 'react';
import { Prompt } from 'react-router-dom';
import { Box } from 'design';

import { Navigation } from 'teleport/components/Wizard/Navigation';
import { FeatureBox } from 'teleport/components/Layout';

import { Navigation } from 'teleport/Discover/Navigation/Navigation';
import { SelectResource } from 'teleport/Discover/SelectResource/SelectResource';
import cfg from 'teleport/config';
import { findViewAtIndex } from 'teleport/components/Wizard/flow';

import { EViewConfigs } from './types';
import { findViewAtIndex } from './flow';

import { DiscoverProvider, useDiscover } from './useDiscover';
import { DiscoverIcon } from './SelectResource/icons';

function DiscoverContent() {
const {
Expand Down Expand Up @@ -63,11 +63,16 @@ function DiscoverContent() {
<>
<FeatureBox>
{hasSelectedResource && (
<Navigation
currentStep={currentStep}
views={indexedViews}
selectedResource={agentProps.resourceSpec}
/>
<Box mt={2} mb={7}>
<Navigation
currentStep={currentStep}
views={indexedViews}
startWithIcon={{
title: agentProps.resourceSpec.name,
component: <DiscoverIcon name={agentProps.resourceSpec.icon} />,
}}
/>
</Box>
)}
<Box>{content}</Box>
</FeatureBox>
Expand Down
58 changes: 0 additions & 58 deletions web/packages/teleport/src/Discover/Navigation/Navigation.tsx

This file was deleted.

117 changes: 0 additions & 117 deletions web/packages/teleport/src/Discover/Navigation/StepItem.tsx

This file was deleted.