Skip to content

Commit

Permalink
Merge pull request #13226 from strapi/enh/ds-v2
Browse files Browse the repository at this point in the history
[Enh] DS v2 components
  • Loading branch information
ronronscelestes committed May 11, 2022
2 parents cd023b6 + 93294f8 commit 63ecdae
Show file tree
Hide file tree
Showing 68 changed files with 2,461 additions and 2,365 deletions.
Expand Up @@ -6,7 +6,7 @@ import styled, { keyframes } from 'styled-components';
import { pxToRem } from '@strapi/helper-plugin';
import Clock from '@strapi/icons/Clock';
import Refresh from '@strapi/icons/Refresh';
import { Link } from '@strapi/design-system/Link';
import { Link } from '@strapi/design-system/v2/Link';
import { Box } from '@strapi/design-system/Box';
import { Stack } from '@strapi/design-system/Stack';
import { Flex } from '@strapi/design-system/Flex';
Expand Down Expand Up @@ -72,11 +72,7 @@ const Blocker = ({ displayedIcon, description, title, isOpen }) => {
</Flex>
<Flex justifyContent="center">
<Box paddingTop={2}>
<Link
href="https://docs.strapi.io"
target="_blank"
rel="noopener noreferrer nofollow"
>
<Link href="https://docs.strapi.io" isExternal>
{formatMessage({
id: 'global.documentation',
defaultMessage: 'Read the documentation',
Expand Down
@@ -1,11 +1,10 @@
import React from 'react';
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
import { useGuidedTour, useTracking, LinkButton } from '@strapi/helper-plugin';
import { useIntl } from 'react-intl';
import { Stack } from '@strapi/design-system/Stack';
import { Flex } from '@strapi/design-system/Flex';
import { Box } from '@strapi/design-system/Box';
import { Typography } from '@strapi/design-system/Typography';
import { LinkButton } from '@strapi/design-system/LinkButton';
import { Button } from '@strapi/design-system/Button';
import ArrowRight from '@strapi/icons/ArrowRight';
import StepperHomepage from './components/Stepper';
Expand Down
@@ -1,10 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { pxToRem } from '@strapi/helper-plugin';
import { pxToRem, LinkButton } from '@strapi/helper-plugin';
import { Typography } from '@strapi/design-system/Typography';
import { Button } from '@strapi/design-system/Button';
import { LinkButton } from '@strapi/design-system/LinkButton';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex';
import ArrowRight from '@strapi/icons/ArrowRight';
Expand Down
12 changes: 7 additions & 5 deletions packages/core/admin/admin/src/components/LeftMenu/index.js
Expand Up @@ -2,7 +2,7 @@ import React, { useRef, useState } from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { NavLink as Link } from 'react-router-dom';
import { NavLink as RouterNavLink } from 'react-router-dom';
import { Divider } from '@strapi/design-system/Divider';
import {
MainNav,
Expand All @@ -12,7 +12,7 @@ import {
NavSection,
NavUser,
NavCondense,
} from '@strapi/design-system/MainNav';
} from '@strapi/design-system/v2/MainNav';
import { FocusTrap } from '@strapi/design-system/FocusTrap';
import { Box } from '@strapi/design-system/Box';
import { Typography } from '@strapi/design-system/Typography';
Expand All @@ -29,7 +29,7 @@ const LinkUserWrapper = styled(Box)`
left: ${({ theme }) => theme.spaces[5]};
`;

const LinkUser = styled(Link)`
const LinkUser = styled(RouterNavLink)`
display: flex;
justify-content: space-between;
align-items: center;
Expand Down Expand Up @@ -88,6 +88,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
return (
<MainNav condensed={condensed}>
<NavBrand
as={RouterNavLink}
workplace={formatMessage({
id: 'app.components.LeftMenu.navbrand.workplace',
defaultMessage: 'Workplace',
Expand All @@ -99,7 +100,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
<Divider />

<NavSections>
<NavLink to="/content-manager" icon={<Write />}>
<NavLink as={RouterNavLink} to="/content-manager" icon={<Write />}>
{formatMessage({ id: 'global.content-manager', defaultMessage: 'Content manager' })}
</NavLink>

Expand All @@ -109,7 +110,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
const Icon = link.icon;

return (
<NavLink to={link.to} key={link.to} icon={<Icon />}>
<NavLink as={RouterNavLink} to={link.to} key={link.to} icon={<Icon />}>
{formatMessage(link.intlLabel)}
</NavLink>
);
Expand All @@ -124,6 +125,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {

return (
<NavLink
as={RouterNavLink}
badgeContent={
(link.notificationsCount > 0 && link.notificationsCount.toString()) || undefined
}
Expand Down
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useCallback } from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { Alert } from '@strapi/design-system/Alert';
import { Link } from '@strapi/design-system/Link';
import { Link } from '@strapi/design-system/v2/Link';

const Notification = ({ dispatch, notification }) => {
const { formatMessage } = useIntl();
Expand Down Expand Up @@ -60,7 +60,7 @@ const Notification = ({ dispatch, notification }) => {
<Alert
action={
link ? (
<Link href={link.url} target="_blank">
<Link href={link.url} isExternal>
{formatMessage({
id: link.label?.id || link.label,
defaultMessage: link.label?.defaultMessage || link.label?.id || link.label,
Expand Down
Expand Up @@ -5,7 +5,7 @@ import { useIntl } from 'react-intl';
import { Portal } from '@strapi/design-system/Portal';
import { FocusTrap } from '@strapi/design-system/FocusTrap';
import { IconButton } from '@strapi/design-system/IconButton';
import { LinkButton } from '@strapi/design-system/LinkButton';
import { LinkButton } from '@strapi/design-system/v2/LinkButton';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex';
import { Typography } from '@strapi/design-system/Typography';
Expand Down Expand Up @@ -104,7 +104,11 @@ const UpgradePlanModal = ({ onClose, isOpen }) => {
})}
</Typography>
</Stack>
<LinkButton href="https://strapi.io/pricing-self-hosted" endIcon={<ExternalLink />}>
<LinkButton
href="https://strapi.io/pricing-self-hosted"
isExternal
endIcon={<ExternalLink />}
>
{formatMessage({
id: 'app.components.UpgradePlanModal.button',
defaultMessage: 'Learn more',
Expand Down
@@ -1,15 +1,14 @@
import React, { memo } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { pxToRem, RemoveRoundedButton } from '@strapi/helper-plugin';
import { pxToRem, RemoveRoundedButton, Link } from '@strapi/helper-plugin';
import { useIntl } from 'react-intl';
import { useLocation } from 'react-router-dom';
import has from 'lodash/has';
import isEmpty from 'lodash/isEmpty';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex';
import { Typography } from '@strapi/design-system/Typography';
import { Link } from '@strapi/design-system/Link';
import { getTrad } from '../../utils';

const StyledBullet = styled.div`
Expand Down
@@ -1,21 +1,22 @@
import React, { useCallback, useState, useEffect, useMemo, memo } from 'react';
import PropTypes from 'prop-types';
import {
// FormattedMessage,
useIntl,
} from 'react-intl';
import { useIntl } from 'react-intl';
import { useLocation } from 'react-router-dom';
import { Link } from '@strapi/design-system/Link';
import { Stack } from '@strapi/design-system/Stack';
import { useTheme } from 'styled-components';
import findIndex from 'lodash/findIndex';
import get from 'lodash/get';
import isArray from 'lodash/isArray';
import isEmpty from 'lodash/isEmpty';
import set from 'lodash/set';
import { NotAllowedInput, useCMEditViewDataManager, useQueryParams } from '@strapi/helper-plugin';
import {
NotAllowedInput,
useCMEditViewDataManager,
useQueryParams,
Link,
} from '@strapi/helper-plugin';
import { stringify } from 'qs';
import axios from 'axios';
import { Stack } from '@strapi/design-system/Stack';
import { axiosInstance } from '../../../core/utils';
import { getTrad } from '../../utils';
import Label from './Label';
Expand Down
Expand Up @@ -5,18 +5,19 @@
*/

import React, { useMemo, useState } from 'react';
import { useSelector, shallowEqual } from 'react-redux';
import { useIntl } from 'react-intl';
import matchSorter from 'match-sorter';
import sortBy from 'lodash/sortBy';
import toLower from 'lodash/toLower';
import { NavLink } from 'react-router-dom';
import {
SubNav,
SubNavHeader,
SubNavSection,
SubNavSections,
SubNavLink,
} from '@strapi/design-system/SubNav';
import { useSelector, shallowEqual } from 'react-redux';
import { useIntl } from 'react-intl';
import matchSorter from 'match-sorter';
import sortBy from 'lodash/sortBy';
import toLower from 'lodash/toLower';
} from '@strapi/design-system/v2/SubNav';
import getTrad from '../../../utils/getTrad';
import { makeSelectModelLinks } from '../selectors';

Expand Down Expand Up @@ -111,7 +112,7 @@ const LeftMenu = () => {
const search = link.search ? `?${link.search}` : '';

return (
<SubNavLink key={link.uid} to={`${link.to}${search}`}>
<SubNavLink as={NavLink} key={link.uid} to={`${link.to}${search}`}>
{link.title}
</SubNavLink>
);
Expand Down
@@ -1,8 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from '@strapi/helper-plugin';
import { Box } from '@strapi/design-system/Box';
import { Flex } from '@strapi/design-system/Flex';
import { Link } from '@strapi/design-system/Link';
import { Typography } from '@strapi/design-system/Typography';
import Cog from '@strapi/icons/Cog';
import { useIntl } from 'react-intl';
Expand Down
Expand Up @@ -5,10 +5,9 @@
*/

import React from 'react';
import { useTracking, CheckPermissions } from '@strapi/helper-plugin';
import { useTracking, CheckPermissions, LinkButton } from '@strapi/helper-plugin';
import { useIntl } from 'react-intl';
import get from 'lodash/get';
import { LinkButton } from '@strapi/design-system/LinkButton';
import Pencil from '@strapi/icons/Pencil';
import getTrad from '../../../utils/getTrad';
import useLayoutDnd from '../../../hooks/useLayoutDnd';
Expand Down
Expand Up @@ -9,11 +9,10 @@ import flatMap from 'lodash/flatMap';
import isEqual from 'lodash/isEqual';
import get from 'lodash/get';
import set from 'lodash/set';
import { useNotification, useTracking, ConfirmDialog } from '@strapi/helper-plugin';
import { useNotification, useTracking, ConfirmDialog, Link } from '@strapi/helper-plugin';
import { useHistory } from 'react-router-dom';
import { Main } from '@strapi/design-system/Main';
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
import { Link } from '@strapi/design-system/Link';
import { Button } from '@strapi/design-system/Button';
import { Box } from '@strapi/design-system/Box';
import { Typography } from '@strapi/design-system/Typography';
Expand Down

0 comments on commit 63ecdae

Please sign in to comment.