Replace classnames with clsx (#2759)
* Replace classnames with clsx * Add clsx to package.json * Remove classnames * Remove classnames types * Restrict classnames in eslint rules
This commit is contained in:
parent
d2496679c0
commit
347e32ef4a
91 changed files with 216 additions and 261 deletions
|
@ -190,7 +190,7 @@
|
||||||
"no-restricted-imports": [
|
"no-restricted-imports": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
"paths": ["lodash", "@material-ui/icons/Delete"]
|
"paths": ["lodash", "@material-ui/icons/Delete", "classnames"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
27
package-lock.json
generated
27
package-lock.json
generated
|
@ -31,7 +31,7 @@
|
||||||
"@uiw/react-color-material": "^0.1.0",
|
"@uiw/react-color-material": "^0.1.0",
|
||||||
"@uiw/react-color-saturation": "0.0.34",
|
"@uiw/react-color-saturation": "0.0.34",
|
||||||
"apollo-upload-client": "^17.0.0",
|
"apollo-upload-client": "^17.0.0",
|
||||||
"classnames": "^2.2.6",
|
"clsx": "^1.2.1",
|
||||||
"color-convert": "^2.0.1",
|
"color-convert": "^2.0.1",
|
||||||
"crc-32": "^1.2.0",
|
"crc-32": "^1.2.0",
|
||||||
"currency-codes": "^2.1.0",
|
"currency-codes": "^2.1.0",
|
||||||
|
@ -113,7 +113,6 @@
|
||||||
"@testing-library/react": "^12.1.5",
|
"@testing-library/react": "^12.1.5",
|
||||||
"@testing-library/react-hooks": "^8.0.1",
|
"@testing-library/react-hooks": "^8.0.1",
|
||||||
"@types/apollo-upload-client": "^17.0.0",
|
"@types/apollo-upload-client": "^17.0.0",
|
||||||
"@types/classnames": "^2.2.9",
|
|
||||||
"@types/color-convert": "^2.0.0",
|
"@types/color-convert": "^2.0.0",
|
||||||
"@types/enzyme": "^3.10.8",
|
"@types/enzyme": "^3.10.8",
|
||||||
"@types/fuzzaldrin": "^2.1.2",
|
"@types/fuzzaldrin": "^2.1.2",
|
||||||
|
@ -8247,12 +8246,6 @@
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/classnames": {
|
|
||||||
"version": "2.2.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.2.11.tgz",
|
|
||||||
"integrity": "sha512-2koNhpWm3DgWRp5tpkiJ8JGc1xTn2q0l+jUNUE7oMKXUf5NpI9AIdC4kbjGNFBdHtcxBD18LAksoudAVhFKCjw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/@types/color-convert": {
|
"node_modules/@types/color-convert": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.0.tgz",
|
||||||
|
@ -13863,9 +13856,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/clsx": {
|
"node_modules/clsx": {
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
|
||||||
"integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==",
|
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
|
@ -45989,12 +45982,6 @@
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/classnames": {
|
|
||||||
"version": "2.2.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.2.11.tgz",
|
|
||||||
"integrity": "sha512-2koNhpWm3DgWRp5tpkiJ8JGc1xTn2q0l+jUNUE7oMKXUf5NpI9AIdC4kbjGNFBdHtcxBD18LAksoudAVhFKCjw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"@types/color-convert": {
|
"@types/color-convert": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.0.tgz",
|
||||||
|
@ -50701,9 +50688,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"clsx": {
|
"clsx": {
|
||||||
"version": "1.1.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
|
||||||
"integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA=="
|
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg=="
|
||||||
},
|
},
|
||||||
"co": {
|
"co": {
|
||||||
"version": "4.6.0",
|
"version": "4.6.0",
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
"@uiw/react-color-material": "^0.1.0",
|
"@uiw/react-color-material": "^0.1.0",
|
||||||
"@uiw/react-color-saturation": "0.0.34",
|
"@uiw/react-color-saturation": "0.0.34",
|
||||||
"apollo-upload-client": "^17.0.0",
|
"apollo-upload-client": "^17.0.0",
|
||||||
"classnames": "^2.2.6",
|
"clsx": "^1.2.1",
|
||||||
"color-convert": "^2.0.1",
|
"color-convert": "^2.0.1",
|
||||||
"crc-32": "^1.2.0",
|
"crc-32": "^1.2.0",
|
||||||
"currency-codes": "^2.1.0",
|
"currency-codes": "^2.1.0",
|
||||||
|
@ -120,7 +120,6 @@
|
||||||
"@testing-library/react": "^12.1.5",
|
"@testing-library/react": "^12.1.5",
|
||||||
"@testing-library/react-hooks": "^8.0.1",
|
"@testing-library/react-hooks": "^8.0.1",
|
||||||
"@types/apollo-upload-client": "^17.0.0",
|
"@types/apollo-upload-client": "^17.0.0",
|
||||||
"@types/classnames": "^2.2.9",
|
|
||||||
"@types/color-convert": "^2.0.0",
|
"@types/color-convert": "^2.0.0",
|
||||||
"@types/enzyme": "^3.10.8",
|
"@types/enzyme": "^3.10.8",
|
||||||
"@types/fuzzaldrin": "^2.1.2",
|
"@types/fuzzaldrin": "^2.1.2",
|
||||||
|
|
|
@ -10,7 +10,7 @@ import Skeleton from "@saleor/components/Skeleton";
|
||||||
import { AppFetchMutation, AppInstallMutation } from "@saleor/graphql";
|
import { AppFetchMutation, AppInstallMutation } from "@saleor/graphql";
|
||||||
import { SubmitPromise } from "@saleor/hooks/useForm";
|
import { SubmitPromise } from "@saleor/hooks/useForm";
|
||||||
import { buttonMessages } from "@saleor/intl";
|
import { buttonMessages } from "@saleor/intl";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -60,10 +60,7 @@ export const AppInstallPage: React.FC<AppInstallPageProps> = ({
|
||||||
) : (
|
) : (
|
||||||
<div className={classes.installAppContainer}>
|
<div className={classes.installAppContainer}>
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={clsx(classes.installIcon, classes.installSaleorIcon)}
|
||||||
classes.installIcon,
|
|
||||||
classes.installSaleorIcon,
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<img src={saleorDarkLogoSmall} alt="" />
|
<img src={saleorDarkLogoSmall} alt="" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import Grid from "@saleor/components/Grid";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
import { AppQuery } from "@saleor/graphql";
|
import { AppQuery } from "@saleor/graphql";
|
||||||
import { sectionNames } from "@saleor/intl";
|
import { sectionNames } from "@saleor/intl";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -44,10 +44,7 @@ export const AppPage: React.FC<AppPageProps> = ({
|
||||||
<div className={classes.breadcrumbContainer}>
|
<div className={classes.breadcrumbContainer}>
|
||||||
<div className={classes.breadcrumbs}>
|
<div className={classes.breadcrumbs}>
|
||||||
<Typography
|
<Typography
|
||||||
className={classNames(
|
className={clsx(classes.breadcrumb, classes.breadcrumbDisabled)}
|
||||||
classes.breadcrumb,
|
|
||||||
classes.breadcrumbDisabled,
|
|
||||||
)}
|
|
||||||
variant="h5"
|
variant="h5"
|
||||||
>
|
>
|
||||||
{data?.name}
|
{data?.name}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
TooltipMountWrapper,
|
TooltipMountWrapper,
|
||||||
} from "@saleor/macaw-ui";
|
} from "@saleor/macaw-ui";
|
||||||
import { renderCollection } from "@saleor/misc";
|
import { renderCollection } from "@saleor/misc";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -58,10 +58,7 @@ const AppsInProgress: React.FC<AppsInProgressProps> = ({
|
||||||
</TableCell>
|
</TableCell>
|
||||||
{status === JobStatusEnum.PENDING && (
|
{status === JobStatusEnum.PENDING && (
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(
|
className={clsx(classes.colAction, classes.colInstallAction)}
|
||||||
classes.colAction,
|
|
||||||
classes.colInstallAction,
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<Typography variant="body2" className={classes.text}>
|
<Typography variant="body2" className={classes.text}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
@ -77,10 +74,7 @@ const AppsInProgress: React.FC<AppsInProgressProps> = ({
|
||||||
)}
|
)}
|
||||||
{status === JobStatusEnum.FAILED && (
|
{status === JobStatusEnum.FAILED && (
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(
|
className={clsx(classes.colAction, classes.colInstallAction)}
|
||||||
classes.colAction,
|
|
||||||
classes.colInstallAction,
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<Typography variant="body2" className={classes.error}>
|
<Typography variant="body2" className={classes.error}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { DragIcon, makeStyles } from "@saleor/macaw-ui";
|
import { DragIcon, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { SortableHandle as SortableHandleHoc } from "react-sortable-hoc";
|
import { SortableHandle as SortableHandleHoc } from "react-sortable-hoc";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ const SortableHandle = SortableHandleHoc((props: SortableHandleProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DragIcon
|
<DragIcon
|
||||||
className={classNames(classes.drag, className)}
|
className={clsx(classes.drag, className)}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Typography } from "@material-ui/core";
|
||||||
import AddIcon from "@material-ui/icons/Add";
|
import AddIcon from "@material-ui/icons/Add";
|
||||||
import RemoveIcon from "@material-ui/icons/Remove";
|
import RemoveIcon from "@material-ui/icons/Remove";
|
||||||
import { IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { IconButton, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Hr from "../Hr";
|
import Hr from "../Hr";
|
||||||
|
@ -54,7 +54,7 @@ const Accordion: React.FC<AccordionProps> = ({
|
||||||
const [expanded, setExpanded] = React.useState(!!initialExpand);
|
const [expanded, setExpanded] = React.useState(!!initialExpand);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(classes.root, className)} {...props}>
|
<div className={clsx(classes.root, className)} {...props}>
|
||||||
<div className={classes.title}>
|
<div className={classes.title}>
|
||||||
<Typography className={classes.titleText}>{title}</Typography>
|
<Typography className={classes.titleText}>{title}</Typography>
|
||||||
<div className={classes.expandButton}>
|
<div className={classes.expandButton}>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
useTheme,
|
useTheme,
|
||||||
} from "@saleor/macaw-ui";
|
} from "@saleor/macaw-ui";
|
||||||
import { isDarkTheme } from "@saleor/misc";
|
import { isDarkTheme } from "@saleor/misc";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
import useRouter from "use-react-router";
|
import useRouter from "use-react-router";
|
||||||
|
@ -212,7 +212,7 @@ const AppLayout: React.FC<AppLayoutProps> = ({
|
||||||
</Container>
|
</Container>
|
||||||
</div>
|
</div>
|
||||||
<main
|
<main
|
||||||
className={classNames(classes.view, {
|
className={clsx(classes.view, {
|
||||||
[classes.viewMargins]: !fullSize,
|
[classes.viewMargins]: !fullSize,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -24,7 +24,7 @@ import useSearchQuery from "@saleor/hooks/useSearchQuery";
|
||||||
import { ConfirmButtonTransitionState, makeStyles } from "@saleor/macaw-ui";
|
import { ConfirmButtonTransitionState, makeStyles } from "@saleor/macaw-ui";
|
||||||
import { maybe, renderCollection } from "@saleor/misc";
|
import { maybe, renderCollection } from "@saleor/misc";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import InfiniteScroll from "react-infinite-scroll-component";
|
import InfiniteScroll from "react-infinite-scroll-component";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
@ -212,7 +212,7 @@ const AssignAttributeDialog: React.FC<AssignAttributeDialogProps> = ({
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
)}
|
)}
|
||||||
<DialogActions
|
<DialogActions
|
||||||
className={classNames(classes.actions, {
|
className={clsx(classes.actions, {
|
||||||
[classes.dropShadow]: !isScrolledToBottom(anchor, position),
|
[classes.dropShadow]: !isScrolledToBottom(anchor, position),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { FormsetAtomicData } from "@saleor/hooks/useFormset";
|
||||||
import { ChevronIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { ChevronIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import { RichTextGetters } from "@saleor/utils/richText/useMultipleRichText";
|
import { RichTextGetters } from "@saleor/utils/richText/useMultipleRichText";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ const Attributes: React.FC<AttributesProps> = ({
|
||||||
data-test-id="attributes-expand"
|
data-test-id="attributes-expand"
|
||||||
>
|
>
|
||||||
<ChevronIcon
|
<ChevronIcon
|
||||||
className={classNames(classes.expansionBarButtonIcon, {
|
className={clsx(classes.expansionBarButtonIcon, {
|
||||||
[classes.rotate]: expanded,
|
[classes.rotate]: expanded,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Typography } from "@material-ui/core";
|
||||||
import HelpOutline from "@material-ui/icons/HelpOutline";
|
import HelpOutline from "@material-ui/icons/HelpOutline";
|
||||||
import Grid from "@saleor/components/Grid";
|
import Grid from "@saleor/components/Grid";
|
||||||
import { Tooltip } from "@saleor/macaw-ui";
|
import { Tooltip } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { useBasicAttributeStyles } from "./styles";
|
import { useBasicAttributeStyles } from "./styles";
|
||||||
|
@ -38,7 +38,7 @@ const BasicAttributeRow: React.FC<BasicAttributeRowProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
data-test-id="attribute-value"
|
data-test-id="attribute-value"
|
||||||
className={classNames(classes.value, {
|
className={clsx(classes.value, {
|
||||||
[classes.flex]: flexValueContainer,
|
[classes.flex]: flexValueContainer,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
Typography,
|
Typography,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { IconButtonProps, makeStyles, SettingsIcon } from "@saleor/macaw-ui";
|
import { IconButtonProps, makeStyles, SettingsIcon } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ const CardMenu: React.FC<CardMenuProps> = props => {
|
||||||
button
|
button
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={classNames(className, {
|
className={clsx(className, {
|
||||||
[classes.loadingContent]: isWithLoading,
|
[classes.loadingContent]: isWithLoading,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -6,7 +6,7 @@ import RadioSwitchField from "@saleor/components/RadioSwitchField";
|
||||||
import useCurrentDate from "@saleor/hooks/useCurrentDate";
|
import useCurrentDate from "@saleor/hooks/useCurrentDate";
|
||||||
import useDateLocalize from "@saleor/hooks/useDateLocalize";
|
import useDateLocalize from "@saleor/hooks/useDateLocalize";
|
||||||
import { getFormErrors, getProductErrorMessage } from "@saleor/utils/errors";
|
import { getFormErrors, getProductErrorMessage } from "@saleor/utils/errors";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ const ChannelContent: React.FC<ChannelContentProps> = ({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
label={
|
label={
|
||||||
<>
|
<>
|
||||||
<p className={classNames(classes.label, classes.listingLabel)}>
|
<p className={clsx(classes.label, classes.listingLabel)}>
|
||||||
{intl.formatMessage(availabilityItemMessages.hideInListings)}
|
{intl.formatMessage(availabilityItemMessages.hideInListings)}
|
||||||
</p>
|
</p>
|
||||||
<span className={classes.secondLabel}>
|
<span className={classes.secondLabel}>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Typography } from "@material-ui/core";
|
||||||
import { alpha } from "@material-ui/core/styles";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import CloseIcon from "@material-ui/icons/Close";
|
import CloseIcon from "@material-ui/icons/Close";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export interface ChipProps {
|
export interface ChipProps {
|
||||||
|
@ -38,7 +38,7 @@ const Chip: React.FC<ChipProps> = props => {
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(classes.root, className)}>
|
<div className={clsx(classes.root, className)}>
|
||||||
<Typography className={classes.label} variant="caption">
|
<Typography className={classes.label} variant="caption">
|
||||||
{label}
|
{label}
|
||||||
{onClose && (
|
{onClose && (
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { alpha } from "@material-ui/core/styles";
|
||||||
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
|
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
|
||||||
import { Button } from "@saleor/components/Button";
|
import { Button } from "@saleor/components/Button";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ const ColumnPickerButton: React.FC<ColumnPickerButtonProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
className={classNames(classes.root, className, {
|
className={clsx(classes.root, className, {
|
||||||
[classes.rootActive]: active,
|
[classes.rootActive]: active,
|
||||||
})}
|
})}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
|
@ -54,7 +54,7 @@ const ColumnPickerButton: React.FC<ColumnPickerButtonProps> = props => {
|
||||||
description="select visible columns button"
|
description="select visible columns button"
|
||||||
/>
|
/>
|
||||||
<ArrowDropDownIcon
|
<ArrowDropDownIcon
|
||||||
className={classNames(classes.icon, {
|
className={clsx(classes.icon, {
|
||||||
[classes.rotate]: active,
|
[classes.rotate]: active,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Card, CardContent } from "@material-ui/core";
|
import { Card, CardContent } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import CardTitle from "../CardTitle";
|
import CardTitle from "../CardTitle";
|
||||||
|
@ -27,7 +27,7 @@ const CompanyAddressInput: React.FC<CompanyAddressInputProps> = props => {
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className={classNames(classes.root, className)}>
|
<Card className={clsx(classes.root, className)}>
|
||||||
<CardTitle title={header} />
|
<CardTitle title={header} />
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<CompanyAddressForm {...formProps} />
|
<CompanyAddressForm {...formProps} />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -31,7 +31,7 @@ export const Container: React.FC<ContainerProps> = props => {
|
||||||
|
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return <div className={classNames(classes.root, className)} {...rest} />;
|
return <div className={clsx(classes.root, className)} {...rest} />;
|
||||||
};
|
};
|
||||||
Container.displayName = "Container";
|
Container.displayName = "Container";
|
||||||
export default Container;
|
export default Container;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Skeleton from "@saleor/components/Skeleton";
|
||||||
import TableRowLink from "@saleor/components/TableRowLink";
|
import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { CountryFragment } from "@saleor/graphql";
|
import { CountryFragment } from "@saleor/graphql";
|
||||||
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -110,9 +110,7 @@ const CountryList: React.FC<CountryListProps> = props => {
|
||||||
<ResponsiveTable>
|
<ResponsiveTable>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
<TableRowLink className={classes.pointer} onClick={toggleCollapse}>
|
<TableRowLink className={classes.pointer} onClick={toggleCollapse}>
|
||||||
<TableCell
|
<TableCell className={clsx(classes.wideColumn, classes.toLeft)}>
|
||||||
className={classNames(classes.wideColumn, classes.toLeft)}
|
|
||||||
>
|
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="62Ywh2"
|
id="62Ywh2"
|
||||||
defaultMessage="{number} Countries"
|
defaultMessage="{number} Countries"
|
||||||
|
@ -122,13 +120,11 @@ const CountryList: React.FC<CountryListProps> = props => {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell className={clsx(classes.textRight, classes.iconCell)}>
|
||||||
className={classNames(classes.textRight, classes.iconCell)}
|
|
||||||
>
|
|
||||||
<IconButton variant="secondary">
|
<IconButton variant="secondary">
|
||||||
<ArrowDropDownIcon
|
<ArrowDropDownIcon
|
||||||
data-test-id="countries-drop-down-icon"
|
data-test-id="countries-drop-down-icon"
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.rotate]: !isCollapsed,
|
[classes.rotate]: !isCollapsed,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
@ -158,7 +154,7 @@ const CountryList: React.FC<CountryListProps> = props => {
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.textRight, classes.iconCell)}
|
className={clsx(classes.textRight, classes.iconCell)}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
data-test-id="delete-icon"
|
data-test-id="delete-icon"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export interface Step<T> {
|
export interface Step<T> {
|
||||||
|
@ -60,7 +60,7 @@ function makeCreatorSteps<T extends string | number>() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.tab, {
|
className={clsx(classes.tab, {
|
||||||
[classes.tabActive]: step.value === currentStep,
|
[classes.tabActive]: step.value === currentStep,
|
||||||
[classes.tabVisited]: visitedStep,
|
[classes.tabVisited]: visitedStep,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import DataEditor, {
|
||||||
import { Card, CardContent, Typography } from "@material-ui/core";
|
import { Card, CardContent, Typography } from "@material-ui/core";
|
||||||
import { usePreventHistoryBack } from "@saleor/hooks/usePreventHistoryBack";
|
import { usePreventHistoryBack } from "@saleor/hooks/usePreventHistoryBack";
|
||||||
import { MoreHorizontalIcon, useTheme } from "@saleor/macaw-ui";
|
import { MoreHorizontalIcon, useTheme } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import range from "lodash/range";
|
import range from "lodash/range";
|
||||||
import throttle from "lodash/throttle";
|
import throttle from "lodash/throttle";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -268,12 +268,12 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
||||||
}}
|
}}
|
||||||
rightElement={
|
rightElement={
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.rowActionBar, {
|
className={clsx(classes.rowActionBar, {
|
||||||
[classes.rowActionBarScrolledToRight]: scrolledToRight,
|
[classes.rowActionBarScrolledToRight]: scrolledToRight,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.rowActionBarShadow, {
|
className={clsx(classes.rowActionBarShadow, {
|
||||||
[classes.rowActionBarShadowActive]: !scrolledToRight,
|
[classes.rowActionBarShadowActive]: !scrolledToRight,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
@ -297,7 +297,7 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
||||||
</div>
|
</div>
|
||||||
{hasColumnGroups && (
|
{hasColumnGroups && (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.rowAction, {
|
className={clsx(classes.rowAction, {
|
||||||
[classes.rowActionScrolledToRight]: scrolledToRight,
|
[classes.rowActionScrolledToRight]: scrolledToRight,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
@ -306,7 +306,7 @@ export const Datagrid: React.FC<DatagridProps> = ({
|
||||||
.fill(0)
|
.fill(0)
|
||||||
.map((_, index) => (
|
.map((_, index) => (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.rowAction, {
|
className={clsx(classes.rowAction, {
|
||||||
[classes.rowActionSelected]: selection?.rows.hasIndex(
|
[classes.rowActionSelected]: selection?.rows.hasIndex(
|
||||||
index,
|
index,
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import FullScreenIcon from "@saleor/icons/FullScreenIcon";
|
import FullScreenIcon from "@saleor/icons/FullScreenIcon";
|
||||||
import { Button, makeStyles, PlusSmallIcon } from "@saleor/macaw-ui";
|
import { Button, makeStyles, PlusSmallIcon } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React, { FC, PropsWithChildren } from "react";
|
import React, { FC, PropsWithChildren } from "react";
|
||||||
|
|
||||||
import CardTitle from "../CardTitle";
|
import CardTitle from "../CardTitle";
|
||||||
|
@ -46,7 +46,7 @@ const ButtonFullScreen: FC<PropsWithChildren<ButtonFullScreenProps>> = ({
|
||||||
onClick={onToggle}
|
onClick={onToggle}
|
||||||
>
|
>
|
||||||
<FullScreenIcon
|
<FullScreenIcon
|
||||||
className={classNames(classes.fullScreenIcon, {
|
className={clsx(classes.fullScreenIcon, {
|
||||||
[classes.fullScreenIconClose]: isOpen,
|
[classes.fullScreenIconClose]: isOpen,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
import { TextFieldProps } from "@material-ui/core/TextField";
|
import { TextFieldProps } from "@material-ui/core/TextField";
|
||||||
import useForm from "@saleor/hooks/useForm";
|
import useForm from "@saleor/hooks/useForm";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -77,7 +77,7 @@ export const EditableTableCell: React.FC<EditableTableCellProps> = props => {
|
||||||
const disable = () => setOpenStatus(false);
|
const disable = () => setOpenStatus(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableCell className={classNames(classes.container, className)}>
|
<TableCell className={clsx(classes.container, className)}>
|
||||||
{opened && <div className={classes.overlay} onClick={disable} />}
|
{opened && <div className={classes.overlay} onClick={disable} />}
|
||||||
<Typography variant="caption" onClick={enable} className={classes.text}>
|
<Typography variant="caption" onClick={enable} className={classes.text}>
|
||||||
{value || defaultValue}
|
{value || defaultValue}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Card, CardContent, Typography } from "@material-ui/core";
|
import { Card, CardContent, Typography } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
interface ErrorNoticeBarProps {
|
interface ErrorNoticeBarProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -23,7 +23,7 @@ const ErrorNoticeBar: React.FC<ErrorNoticeBarProps> = props => {
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className={classNames(classes.root, className)}>
|
<Card className={clsx(classes.root, className)}>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Typography variant="body1">{message}</Typography>
|
<Typography variant="body1">{message}</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Divider } from "@material-ui/core";
|
import { Divider } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -80,13 +80,13 @@ const ExtendedPageHeader: React.FC<ExtendedPageHeaderProps> = props => {
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
data-test-id={testId}
|
data-test-id={testId}
|
||||||
className={classNames(classes.root, className, {
|
className={clsx(classes.root, className, {
|
||||||
[classes.block]: !inline,
|
[classes.block]: !inline,
|
||||||
[classes.underline]: underline,
|
[classes.underline]: underline,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div className={classes.titleRow}>{title}</div>
|
<div className={classes.titleRow}>{title}</div>
|
||||||
<div className={classNames(classes.action, childrenWrapperClassName)}>
|
<div className={clsx(classes.action, childrenWrapperClassName)}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ClickAwayListener, Grow, Popper, Typography } from "@material-ui/core";
|
import { ClickAwayListener, Grow, Popper, Typography } from "@material-ui/core";
|
||||||
import { alpha } from "@material-ui/core/styles";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { Button, makeStyles } from "@saleor/macaw-ui";
|
import { Button, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ const Filter: React.FC<FilterProps> = props => {
|
||||||
>
|
>
|
||||||
<div ref={anchor}>
|
<div ref={anchor}>
|
||||||
<Button
|
<Button
|
||||||
className={classNames(classes.filterButton, {
|
className={clsx(classes.filterButton, {
|
||||||
[classes.addFilterButtonActive]:
|
[classes.addFilterButtonActive]:
|
||||||
isFilterMenuOpened || isFilterActive,
|
isFilterMenuOpened || isFilterActive,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { useCommonStyles } from "@saleor/components/Filter/FilterContent/utils";
|
||||||
import { MultiAutocompleteChoiceType } from "@saleor/components/MultiAutocompleteSelectField";
|
import { MultiAutocompleteChoiceType } from "@saleor/components/MultiAutocompleteSelectField";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import FilterAutocompleteField, {
|
import FilterAutocompleteField, {
|
||||||
|
@ -133,7 +133,7 @@ const FilterContentBody = <K extends string = string>({
|
||||||
{isFilterType(filter, FieldType.boolean) &&
|
{isFilterType(filter, FieldType.boolean) &&
|
||||||
filter.options.map(option => (
|
filter.options.map(option => (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.option, classes.optionRadio)}
|
className={clsx(classes.option, classes.optionRadio)}
|
||||||
key={option.value}
|
key={option.value}
|
||||||
>
|
>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { FormControlLabel, Radio } from "@material-ui/core";
|
import { FormControlLabel, Radio } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { toggle } from "@saleor/utils/lists";
|
import { toggle } from "@saleor/utils/lists";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Checkbox from "../Checkbox";
|
import Checkbox from "../Checkbox";
|
||||||
|
@ -44,7 +44,7 @@ const FilterOptionField: React.FC<FilterFieldBaseProps<
|
||||||
<div className={classes.root} {...rest}>
|
<div className={classes.root} {...rest}>
|
||||||
{filter.options.map(option => (
|
{filter.options.map(option => (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.option, {
|
className={clsx(classes.option, {
|
||||||
[classes.optionRadio]: !filter.multiple,
|
[classes.optionRadio]: !filter.multiple,
|
||||||
})}
|
})}
|
||||||
key={option.value}
|
key={option.value}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export type GridVariant = "default" | "inverted" | "uniform";
|
export type GridVariant = "default" | "inverted" | "uniform";
|
||||||
|
@ -46,7 +46,7 @@ export const Grid: React.FC<GridProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(className, classes.root, {
|
className={clsx(className, classes.root, {
|
||||||
[classes.default]: variant === "default",
|
[classes.default]: variant === "default",
|
||||||
[classes.inverted]: variant === "inverted",
|
[classes.inverted]: variant === "inverted",
|
||||||
[classes.uniform]: variant === "uniform",
|
[classes.uniform]: variant === "uniform",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
interface HrProps {
|
interface HrProps {
|
||||||
|
@ -25,7 +25,7 @@ export const Hr: React.FC<HrProps> = props => {
|
||||||
|
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return <hr className={classNames(classes.root, className)} />;
|
return <hr className={clsx(classes.root, className)} />;
|
||||||
};
|
};
|
||||||
Hr.displayName = "Hr";
|
Hr.displayName = "Hr";
|
||||||
export default Hr;
|
export default Hr;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TableCell } from "@material-ui/core";
|
import { TableCell } from "@material-ui/core";
|
||||||
import { IconButton, ICONBUTTON_SIZE, makeStyles } from "@saleor/macaw-ui";
|
import { IconButton, ICONBUTTON_SIZE, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { stopPropagation } from "../../misc";
|
import { stopPropagation } from "../../misc";
|
||||||
|
@ -30,7 +30,7 @@ const IconButtonTableCell: React.FC<IconButtonTableCellProps> = props => {
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableCell className={classNames(classes.root, className)}>
|
<TableCell className={clsx(classes.root, className)}>
|
||||||
<IconButton
|
<IconButton
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { alpha } from "@material-ui/core/styles";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { ImageIcon, makeStyles } from "@saleor/macaw-ui";
|
import { ImageIcon, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -78,14 +78,14 @@ export const ImageUpload: React.FC<ImageUploadProps> = props => {
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
{...getRootProps()}
|
{...getRootProps()}
|
||||||
className={classNames(className, classes.photosIconContainer, {
|
className={clsx(className, classes.photosIconContainer, {
|
||||||
[classes.backdrop]: isDragActive,
|
[classes.backdrop]: isDragActive,
|
||||||
[isActiveClassName]: isDragActive,
|
[isActiveClassName]: isDragActive,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{!hideUploadIcon && (
|
{!hideUploadIcon && (
|
||||||
<div
|
<div
|
||||||
className={classNames(iconContainerClassName, {
|
className={clsx(iconContainerClassName, {
|
||||||
[iconContainerActiveClassName]: isDragActive,
|
[iconContainerActiveClassName]: isDragActive,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link, LinkProps } from "react-router-dom";
|
import { Link, LinkProps } from "react-router-dom";
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import { useStyles } from "./styles";
|
||||||
export const InternalLink: React.FC<LinkProps> = ({ className, ...props }) => {
|
export const InternalLink: React.FC<LinkProps> = ({ className, ...props }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
return <Link className={classNames(classes.root, className)} {...props} />;
|
return <Link className={clsx(classes.root, className)} {...props} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default InternalLink;
|
export default InternalLink;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
import ArrowDropDown from "@material-ui/icons/ArrowDropDown";
|
import ArrowDropDown from "@material-ui/icons/ArrowDropDown";
|
||||||
import { LanguageCodeEnum, LanguageFragment } from "@saleor/graphql";
|
import { LanguageCodeEnum, LanguageFragment } from "@saleor/graphql";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
@ -71,7 +71,7 @@ const LanguageSwitch: React.FC<LanguageSwitchProps> = props => {
|
||||||
>
|
>
|
||||||
<Typography>{currentLanguage}</Typography>
|
<Typography>{currentLanguage}</Typography>
|
||||||
<ArrowDropDown
|
<ArrowDropDown
|
||||||
className={classNames(classes.arrow, {
|
className={clsx(classes.arrow, {
|
||||||
[classes.rotate]: isExpanded,
|
[classes.rotate]: isExpanded,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Typography } from "@material-ui/core";
|
||||||
import { TypographyProps } from "@material-ui/core/Typography";
|
import { TypographyProps } from "@material-ui/core/Typography";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { isExternalURL } from "@saleor/utils/urls";
|
import { isExternalURL } from "@saleor/utils/urls";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link as RouterLink } from "react-router-dom";
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ const Link: React.FC<LinkProps> = props => {
|
||||||
const opensNewTab = target === "_blank";
|
const opensNewTab = target === "_blank";
|
||||||
|
|
||||||
const commonLinkProps = {
|
const commonLinkProps = {
|
||||||
className: classNames(className, {
|
className: clsx(className, {
|
||||||
[classes.root]: true,
|
[classes.root]: true,
|
||||||
[classes[color]]: true,
|
[classes[color]]: true,
|
||||||
[classes.underline]: underline,
|
[classes.underline]: underline,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ClickAwayListener, MenuItem, Paper, Popper } from "@material-ui/core";
|
import { ClickAwayListener, MenuItem, Paper, Popper } from "@material-ui/core";
|
||||||
import { FormChange } from "@saleor/hooks/useForm";
|
import { FormChange } from "@saleor/hooks/useForm";
|
||||||
import ArrowDropdown from "@saleor/icons/ArrowDropdown";
|
import ArrowDropdown from "@saleor/icons/ArrowDropdown";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import { codes } from "keycode";
|
import { codes } from "keycode";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ const LinkChoice: React.FC<LinkChoiceProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className={classNames(classes.root, className)}
|
className={clsx(classes.root, className)}
|
||||||
ref={anchor}
|
ref={anchor}
|
||||||
onKeyDown={handleKeyPress}
|
onKeyDown={handleKeyPress}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
|
@ -74,7 +74,7 @@ const LinkChoice: React.FC<LinkChoiceProps> = ({
|
||||||
<Link onClick={() => setOpen(open => !open)}>
|
<Link onClick={() => setOpen(open => !open)}>
|
||||||
{current.label}
|
{current.label}
|
||||||
<ArrowDropdown
|
<ArrowDropdown
|
||||||
className={classNames(classes.arrow, {
|
className={clsx(classes.arrow, {
|
||||||
[classes.rotate]: open,
|
[classes.rotate]: open,
|
||||||
})}
|
})}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -96,7 +96,7 @@ const LinkChoice: React.FC<LinkChoiceProps> = ({
|
||||||
<Paper className={classes.paper}>
|
<Paper className={classes.paper}>
|
||||||
{choices.map((choice, choiceIndex) => (
|
{choices.map((choice, choiceIndex) => (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
className={classNames(classes.menuItem, {
|
className={clsx(classes.menuItem, {
|
||||||
[classes.highlighted]: highlightedIndex === choiceIndex,
|
[classes.highlighted]: highlightedIndex === choiceIndex,
|
||||||
})}
|
})}
|
||||||
selected={choice.value === value}
|
selected={choice.value === value}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { BaseListItemProps, ListItem, makeStyles } from "@saleor/macaw-ui";
|
import { BaseListItemProps, ListItem, makeStyles } from "@saleor/macaw-ui";
|
||||||
import clsx from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Link from "../Link";
|
import Link from "../Link";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { CircularProgress } from "@material-ui/core";
|
import { CircularProgress } from "@material-ui/core";
|
||||||
import { IconButton } from "@saleor/components/IconButton";
|
import { IconButton } from "@saleor/components/IconButton";
|
||||||
import { DeleteIcon, EditIcon, makeStyles } from "@saleor/macaw-ui";
|
import { DeleteIcon, EditIcon, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -103,7 +103,7 @@ const MediaTile: React.FC<MediaTileProps> = props => {
|
||||||
return (
|
return (
|
||||||
<div className={classes.mediaContainer} data-test-id="product-image">
|
<div className={classes.mediaContainer} data-test-id="product-image">
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.mediaOverlay, {
|
className={clsx(classes.mediaOverlay, {
|
||||||
[classes.mediaOverlayShadow]: loading,
|
[classes.mediaOverlayShadow]: loading,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -14,7 +14,7 @@ import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { MetadataInput } from "@saleor/graphql";
|
import { MetadataInput } from "@saleor/graphql";
|
||||||
import { FormChange } from "@saleor/hooks/useForm";
|
import { FormChange } from "@saleor/hooks/useForm";
|
||||||
import { DeleteIcon, ExpandIcon, IconButton } from "@saleor/macaw-ui";
|
import { DeleteIcon, ExpandIcon, IconButton } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ const MetadataCard: React.FC<MetadataCardProps> = ({
|
||||||
description: "header",
|
description: "header",
|
||||||
})}
|
})}
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classNames(classes.expandBtn, {
|
className={clsx(classes.expandBtn, {
|
||||||
[classes.rotate]: expanded,
|
[classes.rotate]: expanded,
|
||||||
})}
|
})}
|
||||||
hoverOutline={false}
|
hoverOutline={false}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import CloseIcon from "@material-ui/icons/Close";
|
||||||
import Debounce, { DebounceProps } from "@saleor/components/Debounce";
|
import Debounce, { DebounceProps } from "@saleor/components/Debounce";
|
||||||
import { ChevronIcon, IconButton } from "@saleor/macaw-ui";
|
import { ChevronIcon, IconButton } from "@saleor/macaw-ui";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import Downshift, { ControllerStateAndHelpers } from "downshift";
|
import Downshift, { ControllerStateAndHelpers } from "downshift";
|
||||||
import { filter } from "fuzzaldrin";
|
import { filter } from "fuzzaldrin";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -157,7 +157,7 @@ const MultiAutocompleteSelectFieldComponent: React.FC<MultiAutocompleteSelectFie
|
||||||
handleToggleMenu();
|
handleToggleMenu();
|
||||||
handleFocus();
|
handleFocus();
|
||||||
}}
|
}}
|
||||||
className={classNames(classes.adornment, {
|
className={clsx(classes.adornment, {
|
||||||
[classes.adornmentRotate]: isOpen,
|
[classes.adornmentRotate]: isOpen,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -13,7 +13,7 @@ import useElementScroll, {
|
||||||
} from "@saleor/hooks/useElementScroll";
|
} from "@saleor/hooks/useElementScroll";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import { GetItemPropsOptions } from "downshift";
|
import { GetItemPropsOptions } from "downshift";
|
||||||
import React, { ReactNode } from "react";
|
import React, { ReactNode } from "react";
|
||||||
import SVG from "react-inlinesvg";
|
import SVG from "react-inlinesvg";
|
||||||
|
@ -337,7 +337,7 @@ const MultiAutocompleteSelectFieldContent: React.FC<MultiAutocompleteSelectField
|
||||||
{choices.length > maxMenuItems && (
|
{choices.length > maxMenuItems && (
|
||||||
<div className={classes.arrowContainer}>
|
<div className={classes.arrowContainer}>
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.arrowInnerContainer, {
|
className={clsx(classes.arrowInnerContainer, {
|
||||||
// Needs to be explicitely compared to false because
|
// Needs to be explicitely compared to false because
|
||||||
// scrolledToBottom can be either true, false or undefined
|
// scrolledToBottom can be either true, false or undefined
|
||||||
[classes.hide]: scrolledToBottom !== false,
|
[classes.hide]: scrolledToBottom !== false,
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Grow, Paper, Popper } from "@material-ui/core";
|
||||||
import { IconButtonProps } from "@material-ui/core/IconButton";
|
import { IconButtonProps } from "@material-ui/core/IconButton";
|
||||||
import { LayoutButton, makeStyles, NavigatorIcon } from "@saleor/macaw-ui";
|
import { LayoutButton, makeStyles, NavigatorIcon } from "@saleor/macaw-ui";
|
||||||
import { triangle } from "@saleor/styles/mixins";
|
import { triangle } from "@saleor/styles/mixins";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ const NavigatorButton: React.FC<NavigatorButtonProps> = ({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LayoutButton
|
<LayoutButton
|
||||||
className={classNames(className, classes.root)}
|
className={clsx(className, classes.root)}
|
||||||
data-test-id="navigator"
|
data-test-id="navigator"
|
||||||
onMouseEnter={setHelper}
|
onMouseEnter={setHelper}
|
||||||
onMouseLeave={clearHelper}
|
onMouseLeave={clearHelper}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
Radio,
|
Radio,
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ export const RadioGroupField: React.FC<RadioGroupFieldProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl
|
<FormControl
|
||||||
className={classNames(classes.root, className, {
|
className={clsx(classes.root, className, {
|
||||||
[classes.rootNoLabel]: !label,
|
[classes.rootNoLabel]: !label,
|
||||||
})}
|
})}
|
||||||
error={error}
|
error={error}
|
||||||
|
@ -66,7 +66,7 @@ export const RadioGroupField: React.FC<RadioGroupFieldProps> = props => {
|
||||||
name={name}
|
name={name}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.radioGroupInline]: variant === "inline",
|
[classes.radioGroupInline]: variant === "inline",
|
||||||
[innerContainerClassName]: !!innerContainerClassName,
|
[innerContainerClassName]: !!innerContainerClassName,
|
||||||
})}
|
})}
|
||||||
|
@ -76,7 +76,7 @@ export const RadioGroupField: React.FC<RadioGroupFieldProps> = props => {
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
disabled={choice.disabled}
|
disabled={choice.disabled}
|
||||||
value={choice.value}
|
value={choice.value}
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.radioLabel]: variant !== "inline",
|
[classes.radioLabel]: variant !== "inline",
|
||||||
[classes.radioLabelInline]: variant === "inline",
|
[classes.radioLabelInline]: variant === "inline",
|
||||||
})}
|
})}
|
||||||
|
@ -85,7 +85,7 @@ export const RadioGroupField: React.FC<RadioGroupFieldProps> = props => {
|
||||||
}}
|
}}
|
||||||
control={
|
control={
|
||||||
<Radio
|
<Radio
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.alignTop]: alignTop,
|
[classes.alignTop]: alignTop,
|
||||||
})}
|
})}
|
||||||
color="secondary"
|
color="secondary"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
RadioGroup,
|
RadioGroup,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -71,7 +71,7 @@ export const RadioSwitchField: React.FC<RadioSwitchFieldProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl
|
<FormControl
|
||||||
className={classNames(classes.formControl, className)}
|
className={clsx(classes.formControl, className)}
|
||||||
error={error}
|
error={error}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
|
@ -83,20 +83,14 @@ export const RadioSwitchField: React.FC<RadioSwitchFieldProps> = props => {
|
||||||
>
|
>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="true"
|
value="true"
|
||||||
className={classNames(
|
className={clsx(classes.radioLabel, overrideClasses?.radioLabel)}
|
||||||
classes.radioLabel,
|
|
||||||
overrideClasses?.radioLabel,
|
|
||||||
)}
|
|
||||||
control={<Radio color="secondary" />}
|
control={<Radio color="secondary" />}
|
||||||
label={firstOptionLabel}
|
label={firstOptionLabel}
|
||||||
name={name}
|
name={name}
|
||||||
/>
|
/>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
value="false"
|
value="false"
|
||||||
className={classNames(
|
className={clsx(classes.radioLabel, overrideClasses?.radioLabel)}
|
||||||
classes.radioLabel,
|
|
||||||
overrideClasses?.radioLabel,
|
|
||||||
)}
|
|
||||||
control={<Radio color="secondary" />}
|
control={<Radio color="secondary" />}
|
||||||
label={secondOptionLabel}
|
label={secondOptionLabel}
|
||||||
name={name}
|
name={name}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Table } from "@material-ui/core";
|
import { Table } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -34,7 +34,7 @@ const ResponsiveTable: React.FC<ResponsiveTableProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<Table className={classNames(classes.table, className)}>{children}</Table>
|
<Table className={clsx(classes.table, className)}>{children}</Table>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { LogLevels, OutputData } from "@editorjs/editorjs";
|
||||||
import { FormControl, FormHelperText, InputLabel } from "@material-ui/core";
|
import { FormControl, FormHelperText, InputLabel } from "@material-ui/core";
|
||||||
import { useId } from "@reach/auto-id";
|
import { useId } from "@reach/auto-id";
|
||||||
import { Props as ReactEditorJSProps } from "@react-editor-js/core";
|
import { Props as ReactEditorJSProps } from "@react-editor-js/core";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { createReactEditorJS } from "react-editor-js";
|
import { createReactEditorJS } from "react-editor-js";
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id={id}
|
id={id}
|
||||||
className={classNames(classes.editor, classes.root, {
|
className={clsx(classes.editor, classes.root, {
|
||||||
[classes.rootActive]: isFocused,
|
[classes.rootActive]: isFocused,
|
||||||
[classes.rootDisabled]: disabled,
|
[classes.rootDisabled]: disabled,
|
||||||
[classes.rootError]: error,
|
[classes.rootError]: error,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { LogLevels } from "@editorjs/editorjs";
|
import { LogLevels } from "@editorjs/editorjs";
|
||||||
import { useId } from "@reach/auto-id";
|
import { useId } from "@reach/auto-id";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { createReactEditorJS } from "react-editor-js";
|
import { createReactEditorJS } from "react-editor-js";
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ const RichTextEditorContent: React.FC<RichTextEditorContentProps> = ({
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id={id}
|
id={id}
|
||||||
className={classNames(classes.editor, classes.rootStatic, className)}
|
className={clsx(classes.editor, classes.rootStatic, className)}
|
||||||
/>
|
/>
|
||||||
</ReactEditorJS>
|
</ReactEditorJS>
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { getFieldError, getProductErrorMessage } from "@saleor/utils/errors";
|
import { getFieldError, getProductErrorMessage } from "@saleor/utils/errors";
|
||||||
import getPageErrorMessage from "@saleor/utils/errors/page";
|
import getPageErrorMessage from "@saleor/utils/errors/page";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
|
||||||
import slugify from "slugify";
|
import slugify from "slugify";
|
||||||
|
@ -179,9 +179,7 @@ const SeoForm: React.FC<SeoFormProps> = props => {
|
||||||
/>
|
/>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
{shouldDisplayHelperText && (
|
{shouldDisplayHelperText && (
|
||||||
<Typography
|
<Typography className={clsx({ [classes.helperText]: expanded })}>
|
||||||
className={classNames({ [classes.helperText]: expanded })}
|
|
||||||
>
|
|
||||||
{helperText}
|
{helperText}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { InputProps } from "@material-ui/core/Input";
|
||||||
import { ExtendedFormHelperTextProps } from "@saleor/channels/components/ChannelForm/types";
|
import { ExtendedFormHelperTextProps } from "@saleor/channels/components/ChannelForm/types";
|
||||||
import { ChevronIcon } from "@saleor/macaw-ui";
|
import { ChevronIcon } from "@saleor/macaw-ui";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import Downshift from "downshift";
|
import Downshift from "downshift";
|
||||||
import { filter } from "fuzzaldrin";
|
import { filter } from "fuzzaldrin";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -189,7 +189,7 @@ const SingleAutocompleteSelectFieldComponent: React.FC<SingleAutocompleteSelectF
|
||||||
handleToggleMenu();
|
handleToggleMenu();
|
||||||
handleFocus();
|
handleFocus();
|
||||||
}}
|
}}
|
||||||
className={classNames(classes.adornment, {
|
className={clsx(classes.adornment, {
|
||||||
[classes.adornmentRotate]: isOpen,
|
[classes.adornmentRotate]: isOpen,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
@ -214,7 +214,7 @@ const SingleAutocompleteSelectFieldComponent: React.FC<SingleAutocompleteSelectF
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={clsx(
|
||||||
classes.container,
|
classes.container,
|
||||||
"click-outside-ignore",
|
"click-outside-ignore",
|
||||||
className,
|
className,
|
||||||
|
|
|
@ -11,7 +11,7 @@ import useElementScroll, {
|
||||||
} from "@saleor/hooks/useElementScroll";
|
} from "@saleor/hooks/useElementScroll";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { FetchMoreProps } from "@saleor/types";
|
import { FetchMoreProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import { GetItemPropsOptions } from "downshift";
|
import { GetItemPropsOptions } from "downshift";
|
||||||
import React, { ReactElement } from "react";
|
import React, { ReactElement } from "react";
|
||||||
import SVG from "react-inlinesvg";
|
import SVG from "react-inlinesvg";
|
||||||
|
@ -206,7 +206,7 @@ const SingleAutocompleteSelectFieldContent: React.FC<SingleAutocompleteSelectFie
|
||||||
return (
|
return (
|
||||||
<Paper
|
<Paper
|
||||||
// click-outside-ignore is used by glide-datagrid
|
// click-outside-ignore is used by glide-datagrid
|
||||||
className={classNames("click-outside-ignore", classes.root)}
|
className={clsx("click-outside-ignore", classes.root)}
|
||||||
elevation={8}
|
elevation={8}
|
||||||
style={style}
|
style={style}
|
||||||
>
|
>
|
||||||
|
@ -323,7 +323,7 @@ const SingleAutocompleteSelectFieldContent: React.FC<SingleAutocompleteSelectFie
|
||||||
{choices.length > maxMenuItems && (
|
{choices.length > maxMenuItems && (
|
||||||
<div className={classes.arrowContainer}>
|
<div className={classes.arrowContainer}>
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.arrowInnerContainer, {
|
className={clsx(classes.arrowInnerContainer, {
|
||||||
// Needs to be explicitly compared to false because
|
// Needs to be explicitly compared to false because
|
||||||
// scrolledToBottom can be either true, false or undefined
|
// scrolledToBottom can be either true, false or undefined
|
||||||
[classes.hide]: scrolledToBottom !== false,
|
[classes.hide]: scrolledToBottom !== false,
|
||||||
|
|
|
@ -9,7 +9,6 @@ import {
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { SelectProps } from "@material-ui/core/Select";
|
import { SelectProps } from "@material-ui/core/Select";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
@ -91,7 +90,7 @@ export const SingleSelectField: React.FC<SingleSelectFieldProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl
|
<FormControl
|
||||||
className={classNames(classes.formControl, className)}
|
className={clsx(classes.formControl, className)}
|
||||||
error={error}
|
error={error}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
|
@ -114,7 +113,7 @@ export const SingleSelectField: React.FC<SingleSelectFieldProps> = props => {
|
||||||
{...InputProps}
|
{...InputProps}
|
||||||
classes={{
|
classes={{
|
||||||
...(InputProps?.classes || {}),
|
...(InputProps?.classes || {}),
|
||||||
input: classNames(InputProps?.classes?.input, {
|
input: clsx(InputProps?.classes?.input, {
|
||||||
[classes.noLabel]: !label,
|
[classes.noLabel]: !label,
|
||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -43,7 +43,7 @@ const Skeleton: React.FC<SkeletonProps> = props => {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
data-test-id="skeleton"
|
data-test-id="skeleton"
|
||||||
className={classNames(classes.skeleton, className, {
|
className={clsx(classes.skeleton, className, {
|
||||||
[classes.primary]: primary,
|
[classes.primary]: primary,
|
||||||
})}
|
})}
|
||||||
style={style}
|
style={style}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import CloseIcon from "@material-ui/icons/Close";
|
import CloseIcon from "@material-ui/icons/Close";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { SortableElement, SortableElementProps } from "react-sortable-hoc";
|
import { SortableElement, SortableElementProps } from "react-sortable-hoc";
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ const SortableChip = SortableElement((props: SortableChipProps) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(classes.root, className)}>
|
<div className={clsx(classes.root, className)}>
|
||||||
<div className={classes.content}>
|
<div className={classes.content}>
|
||||||
<SortableHandle
|
<SortableHandle
|
||||||
className={classes.sortableHandle}
|
className={classes.sortableHandle}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { DragIcon, makeStyles } from "@saleor/macaw-ui";
|
import { DragIcon, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { SortableHandle as SortableHandleHoc } from "react-sortable-hoc";
|
import { SortableHandle as SortableHandleHoc } from "react-sortable-hoc";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ const SortableHandle = SortableHandleHoc((props: SortableHandleProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DragIcon
|
<DragIcon
|
||||||
className={classNames(classes.drag, className)}
|
className={clsx(classes.drag, className)}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { alpha } from "@material-ui/core/styles";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -51,7 +51,7 @@ export function Tab<T>(value: T) {
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
data-test-id={testId}
|
data-test-id={testId}
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.root]: true,
|
[classes.root]: true,
|
||||||
[classes.active]: isActive,
|
[classes.active]: isActive,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Avatar as MuiAvatar } from "@material-ui/core";
|
import { Avatar as MuiAvatar } from "@material-ui/core";
|
||||||
import { ImageIcon, makeStyles } from "@saleor/macaw-ui";
|
import { ImageIcon, makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export const AVATAR_MARGIN = 40;
|
export const AVATAR_MARGIN = 40;
|
||||||
|
@ -57,18 +57,18 @@ const Avatar: React.FC<AvatarProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.content, {
|
className={clsx(classes.content, {
|
||||||
[classes.alignRight]: alignRight,
|
[classes.alignRight]: alignRight,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{badge}
|
{badge}
|
||||||
{!thumbnail ? (
|
{!thumbnail ? (
|
||||||
<MuiAvatar className={classNames(classes.avatar, avatarProps)}>
|
<MuiAvatar className={clsx(classes.avatar, avatarProps)}>
|
||||||
<ImageIcon color="primary" data-test-id="imageIcon" />
|
<ImageIcon color="primary" data-test-id="imageIcon" />
|
||||||
</MuiAvatar>
|
</MuiAvatar>
|
||||||
) : (
|
) : (
|
||||||
<MuiAvatar
|
<MuiAvatar
|
||||||
className={classNames(classes.avatar, avatarProps)}
|
className={clsx(classes.avatar, avatarProps)}
|
||||||
src={thumbnail}
|
src={thumbnail}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { TableCell } from "@material-ui/core";
|
import { TableCell } from "@material-ui/core";
|
||||||
import { TableCellProps } from "@material-ui/core/TableCell";
|
import { TableCellProps } from "@material-ui/core/TableCell";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Avatar, { AvatarProps } from "./Avatar";
|
import Avatar, { AvatarProps } from "./Avatar";
|
||||||
|
@ -32,7 +32,7 @@ const TableCellAvatar: React.FC<TableCellAvatarProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.root, className)}
|
className={clsx(classes.root, className)}
|
||||||
data-test-id="table-cell-avatar"
|
data-test-id="table-cell-avatar"
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { TableCell } from "@material-ui/core";
|
import { TableCell } from "@material-ui/core";
|
||||||
import { TableCellProps } from "@material-ui/core/TableCell";
|
import { TableCellProps } from "@material-ui/core/TableCell";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import ArrowSort from "../../icons/ArrowSort";
|
import ArrowSort from "../../icons/ArrowSort";
|
||||||
|
@ -88,13 +88,13 @@ const TableCellHeader = React.forwardRef<unknown, TableCellHeaderProps>(
|
||||||
onClick(e);
|
onClick(e);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
className={classNames(classes.root, className, {
|
className={clsx(classes.root, className, {
|
||||||
[classes.disabled]: disabled,
|
[classes.disabled]: disabled,
|
||||||
[classes.notSortable]: !onClick,
|
[classes.notSortable]: !onClick,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.labelContainer, {
|
className={clsx(classes.labelContainer, {
|
||||||
[classes.labelContainerActive]: !!direction && !!arrowPosition,
|
[classes.labelContainerActive]: !!direction && !!arrowPosition,
|
||||||
[classes.labelContainerCenter]: textAlign === "center",
|
[classes.labelContainerCenter]: textAlign === "center",
|
||||||
[classes.labelContainerRight]: textAlign === "right",
|
[classes.labelContainerRight]: textAlign === "right",
|
||||||
|
@ -102,7 +102,7 @@ const TableCellHeader = React.forwardRef<unknown, TableCellHeaderProps>(
|
||||||
>
|
>
|
||||||
{!!direction && arrowPosition === "left" && (
|
{!!direction && arrowPosition === "left" && (
|
||||||
<ArrowSort
|
<ArrowSort
|
||||||
className={classNames(classes.arrow, classes.arrowLeft, {
|
className={clsx(classes.arrow, classes.arrowLeft, {
|
||||||
[classes.arrowUp]: direction === "asc",
|
[classes.arrowUp]: direction === "asc",
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
@ -110,7 +110,7 @@ const TableCellHeader = React.forwardRef<unknown, TableCellHeaderProps>(
|
||||||
<div className={classes.label}>{children}</div>
|
<div className={classes.label}>{children}</div>
|
||||||
{!!direction && arrowPosition === "right" && (
|
{!!direction && arrowPosition === "right" && (
|
||||||
<ArrowSort
|
<ArrowSort
|
||||||
className={classNames(classes.arrow, {
|
className={clsx(classes.arrow, {
|
||||||
[classes.arrowUp]: direction === "asc",
|
[classes.arrowUp]: direction === "asc",
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Tab } from "@material-ui/core";
|
import { Tab } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -46,7 +46,7 @@ export const FilterTab: React.FC<FilterTabProps> = props => {
|
||||||
label={label}
|
label={label}
|
||||||
classes={{
|
classes={{
|
||||||
root: classes.tabRoot,
|
root: classes.tabRoot,
|
||||||
wrapper: classNames(classes.tabLabel, {
|
wrapper: clsx(classes.tabLabel, {
|
||||||
[classes.selectedTabLabel]: selected,
|
[classes.selectedTabLabel]: selected,
|
||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
import { TableHeadProps as MuiTableHeadProps } from "@material-ui/core/TableHead";
|
import { TableHeadProps as MuiTableHeadProps } from "@material-ui/core/TableHead";
|
||||||
import TableRowLink from "@saleor/components/TableRowLink";
|
import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ const TableHead: React.FC<TableHeadProps> = props => {
|
||||||
{(items === undefined || items.length > 0) && (
|
{(items === undefined || items.length > 0) && (
|
||||||
<TableCell
|
<TableCell
|
||||||
padding="checkbox"
|
padding="checkbox"
|
||||||
className={classNames(classes.cell, {
|
className={clsx(classes.cell, {
|
||||||
[classes.dragRows]: dragRows,
|
[classes.dragRows]: dragRows,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
@ -104,7 +104,7 @@ const TableHead: React.FC<TableHeadProps> = props => {
|
||||||
{selected ? (
|
{selected ? (
|
||||||
<>
|
<>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.cell, classes.root)}
|
className={clsx(classes.cell, classes.root)}
|
||||||
colSpan={getColSpan(colSpan, dragRows)}
|
colSpan={getColSpan(colSpan, dragRows)}
|
||||||
>
|
>
|
||||||
<div className={classes.container}>
|
<div className={classes.container}>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import ArrowLeft from "@material-ui/icons/ArrowLeft";
|
||||||
import ArrowRight from "@material-ui/icons/ArrowRight";
|
import ArrowRight from "@material-ui/icons/ArrowRight";
|
||||||
import { IconButton, makeStyles, useTheme } from "@saleor/macaw-ui";
|
import { IconButton, makeStyles, useTheme } from "@saleor/macaw-ui";
|
||||||
import { isDarkTheme } from "@saleor/misc";
|
import { isDarkTheme } from "@saleor/misc";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -79,10 +79,10 @@ export const TablePaginationActions: React.FC<TablePaginationActionsProps> = pro
|
||||||
const isDark = isDarkTheme(themeType);
|
const isDark = isDarkTheme(themeType);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(classes.root, className)} {...other}>
|
<div className={clsx(classes.root, className)} {...other}>
|
||||||
<IconButton
|
<IconButton
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
className={classNames(classes.iconButton, {
|
className={clsx(classes.iconButton, {
|
||||||
[classes.dark]: isDark,
|
[classes.dark]: isDark,
|
||||||
[classes.disabled]: !hasPreviousPage,
|
[classes.disabled]: !hasPreviousPage,
|
||||||
})}
|
})}
|
||||||
|
@ -94,7 +94,7 @@ export const TablePaginationActions: React.FC<TablePaginationActionsProps> = pro
|
||||||
{direction === "rtl" ? <ArrowRight /> : <ArrowLeft />}
|
{direction === "rtl" ? <ArrowRight /> : <ArrowLeft />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classNames(classes.iconButton, {
|
className={clsx(classes.iconButton, {
|
||||||
[classes.dark]: isDark,
|
[classes.dark]: isDark,
|
||||||
[classes.disabled]: !hasNextPage,
|
[classes.disabled]: !hasNextPage,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { TableRow, TableRowTypeMap } from "@material-ui/core";
|
import { TableRow, TableRowTypeMap } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { isExternalURL } from "@saleor/utils/urls";
|
import { isExternalURL } from "@saleor/utils/urls";
|
||||||
import clsx from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import SingleSelectField, {
|
||||||
Choices,
|
Choices,
|
||||||
} from "@saleor/components/SingleSelectField";
|
} from "@saleor/components/SingleSelectField";
|
||||||
import { ChangeEvent, FormChange } from "@saleor/hooks/useForm";
|
import { ChangeEvent, FormChange } from "@saleor/hooks/useForm";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { useStyles } from "./styles";
|
import { useStyles } from "./styles";
|
||||||
|
@ -99,7 +99,7 @@ const TextWithSelectField: React.FC<TextWithSelectFieldProps> = ({
|
||||||
min: textFieldMinValue,
|
min: textFieldMinValue,
|
||||||
}}
|
}}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
className: classNames(classes.textField, {
|
className: clsx(classes.textField, {
|
||||||
[classes.textFieldCentered]: !textFieldLabel,
|
[classes.textFieldCentered]: !textFieldLabel,
|
||||||
}),
|
}),
|
||||||
endAdornment: (
|
endAdornment: (
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { ChangeEvent } from "@saleor/hooks/useForm";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { UserError } from "@saleor/types";
|
import { UserError } from "@saleor/types";
|
||||||
import { getFieldError } from "@saleor/utils/errors";
|
import { getFieldError } from "@saleor/utils/errors";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -279,9 +279,7 @@ export const VisibilityCard: React.FC<VisibilityCardProps> = props => {
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
label={
|
label={
|
||||||
<>
|
<>
|
||||||
<p
|
<p className={clsx(classes.label, classes.listingLabel)}>
|
||||||
className={classNames(classes.label, classes.listingLabel)}
|
|
||||||
>
|
|
||||||
{intl.formatMessage(visibilityCardMessages.hideInListings)}
|
{intl.formatMessage(visibilityCardMessages.hideInListings)}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import AddressFormatter from "@saleor/components/AddressFormatter";
|
||||||
import { AddressFragment } from "@saleor/graphql";
|
import { AddressFragment } from "@saleor/graphql";
|
||||||
import { commonMessages } from "@saleor/intl";
|
import { commonMessages } from "@saleor/intl";
|
||||||
import { EditIcon } from "@saleor/macaw-ui";
|
import { EditIcon } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ const CustomerAddressChoiceCard: React.FC<CustomerAddressChoiceCardProps> = prop
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
className={classNames(classes.card, {
|
className={clsx(classes.card, {
|
||||||
[classes.cardSelected]: selected,
|
[classes.cardSelected]: selected,
|
||||||
[classes.selectableCard]: !editable && !selected,
|
[classes.selectableCard]: !editable && !selected,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { maybe, renderCollection } from "@saleor/misc";
|
import { maybe, renderCollection } from "@saleor/misc";
|
||||||
import { ChannelProps, ListActions, ListProps, SortPage } from "@saleor/types";
|
import { ChannelProps, ListActions, ListProps, SortPage } from "@saleor/types";
|
||||||
import { getArrowDirection } from "@saleor/utils/sort";
|
import { getArrowDirection } from "@saleor/utils/sort";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ const SaleList: React.FC<SaleListProps> = props => {
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.colName, classes.textOverflow)}
|
className={clsx(classes.colName, classes.textOverflow)}
|
||||||
>
|
>
|
||||||
{maybe<React.ReactNode>(() => sale.name, <Skeleton />)}
|
{maybe<React.ReactNode>(() => sale.name, <Skeleton />)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { maybe, renderCollection } from "@saleor/misc";
|
import { maybe, renderCollection } from "@saleor/misc";
|
||||||
import { ChannelProps, ListActions, ListProps, SortPage } from "@saleor/types";
|
import { ChannelProps, ListActions, ListProps, SortPage } from "@saleor/types";
|
||||||
import { getArrowDirection } from "@saleor/utils/sort";
|
import { getArrowDirection } from "@saleor/utils/sort";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ const VoucherList: React.FC<VoucherListProps> = props => {
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.colName, classes.textOverflow)}
|
className={clsx(classes.colName, classes.textOverflow)}
|
||||||
>
|
>
|
||||||
{voucher?.code ?? <Skeleton />}
|
{voucher?.code ?? <Skeleton />}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { CircularProgress } from "@material-ui/core";
|
import { CircularProgress } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
interface ContentWithProgressProps {
|
interface ContentWithProgressProps {
|
||||||
|
@ -30,7 +30,7 @@ const ContentWithProgress: React.FC<ContentWithProgressProps> = ({
|
||||||
return children ? (
|
return children ? (
|
||||||
<>{children}</>
|
<>{children}</>
|
||||||
) : (
|
) : (
|
||||||
<div className={classNames(classes.container, containerClassName)}>
|
<div className={clsx(classes.container, containerClassName)}>
|
||||||
<CircularProgress />
|
<CircularProgress />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Typography } from "@material-ui/core";
|
||||||
import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer";
|
import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer";
|
||||||
import CardSpacer from "@saleor/components/CardSpacer";
|
import CardSpacer from "@saleor/components/CardSpacer";
|
||||||
import Money from "@saleor/components/Money";
|
import Money from "@saleor/components/Money";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -24,9 +24,7 @@ const GiftCardUpdateDetailsBalanceSection: React.FC = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div className={clsx(classes.labelsContainer, classes.wideContainer)}>
|
||||||
className={classNames(classes.labelsContainer, classes.wideContainer)}
|
|
||||||
>
|
|
||||||
<Typography>{intl.formatMessage(messages.cardBalanceLabel)}</Typography>
|
<Typography>{intl.formatMessage(messages.cardBalanceLabel)}</Typography>
|
||||||
<Typography className={classes.labelsContainer}>
|
<Typography className={classes.labelsContainer}>
|
||||||
<Money money={currentBalance} />
|
<Money money={currentBalance} />
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { HomeQuery } from "@saleor/graphql";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { productVariantEditUrl } from "@saleor/products/urls";
|
import { productVariantEditUrl } from "@saleor/products/urls";
|
||||||
import { RelayToFlat } from "@saleor/types";
|
import { RelayToFlat } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ export const HomeProductList: React.FC<HomeProductListProps> = props => {
|
||||||
<TableRowLink
|
<TableRowLink
|
||||||
key={variant ? variant.id : "skeleton"}
|
key={variant ? variant.id : "skeleton"}
|
||||||
hover={!!variant}
|
hover={!!variant}
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.tableRow]: !!variant,
|
[classes.tableRow]: !!variant,
|
||||||
})}
|
})}
|
||||||
href={productVariantEditUrl(variant.product.id, variant.id)}
|
href={productVariantEditUrl(variant.product.id, variant.id)}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
useTheme,
|
useTheme,
|
||||||
} from "@saleor/macaw-ui";
|
} from "@saleor/macaw-ui";
|
||||||
import { RecursiveMenuItem } from "@saleor/navigation/types";
|
import { RecursiveMenuItem } from "@saleor/navigation/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import SortableTree, { NodeRendererProps } from "react-sortable-tree";
|
import SortableTree, { NodeRendererProps } from "react-sortable-tree";
|
||||||
|
@ -152,12 +152,12 @@ const Node: React.FC<NodeRendererProps<TreeItemProps>> = props => {
|
||||||
} = props;
|
} = props;
|
||||||
const classes = useStyles(props);
|
const classes = useStyles(props);
|
||||||
|
|
||||||
const draggedClassName = classNames(
|
const draggedClassName = clsx(
|
||||||
classes.rowContainer,
|
classes.rowContainer,
|
||||||
classes.rowContainerDragged,
|
classes.rowContainerDragged,
|
||||||
);
|
);
|
||||||
const defaultClassName = isDragging ? draggedClassName : classes.rowContainer;
|
const defaultClassName = isDragging ? draggedClassName : classes.rowContainer;
|
||||||
const placeholderClassName = classNames(
|
const placeholderClassName = clsx(
|
||||||
classes.rowContainer,
|
classes.rowContainer,
|
||||||
classes.rowContainerPlaceholder,
|
classes.rowContainerPlaceholder,
|
||||||
);
|
);
|
||||||
|
@ -244,7 +244,7 @@ const MenuItems: React.FC<MenuItemsProps> = props => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.container, {
|
className={clsx(classes.container, {
|
||||||
[classes.darkContainer]: themeType === "dark",
|
[classes.darkContainer]: themeType === "dark",
|
||||||
})}
|
})}
|
||||||
style={{
|
style={{
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
} from "@saleor/graphql";
|
} from "@saleor/graphql";
|
||||||
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
||||||
import { OrderLineDiscountContextConsumerProps } from "@saleor/products/components/OrderDiscountProviders/OrderLineDiscountProvider";
|
import { OrderLineDiscountContextConsumerProps } from "@saleor/products/components/OrderDiscountProviders/OrderLineDiscountProvider";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React, { useRef } from "react";
|
import React, { useRef } from "react";
|
||||||
|
|
||||||
import { maybe } from "../../../misc";
|
import { maybe } from "../../../misc";
|
||||||
|
@ -106,7 +106,7 @@ const TableLine: React.FC<TableLineProps> = ({
|
||||||
return (
|
return (
|
||||||
<TableRowLink key={id}>
|
<TableRowLink key={id}>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.colStatusEmpty]: !alerts.length,
|
[classes.colStatusEmpty]: !alerts.length,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
getWarehouseStock,
|
getWarehouseStock,
|
||||||
OrderFulfillLineFormData,
|
OrderFulfillLineFormData,
|
||||||
} from "@saleor/orders/utils/data";
|
} from "@saleor/orders/utils/data";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ export const OrderFulfillLine: React.FC<OrderFulfillLineProps> = props => {
|
||||||
<TextField
|
<TextField
|
||||||
type="number"
|
type="number"
|
||||||
inputProps={{
|
inputProps={{
|
||||||
className: classNames(classes.quantityInnerInput, {
|
className: clsx(classes.quantityInnerInput, {
|
||||||
[classes.quantityInnerInputNoRemaining]: !line.variant
|
[classes.quantityInnerInputNoRemaining]: !line.variant
|
||||||
?.trackInventory,
|
?.trackInventory,
|
||||||
}),
|
}),
|
||||||
|
@ -169,7 +169,7 @@ export const OrderFulfillLine: React.FC<OrderFulfillLineProps> = props => {
|
||||||
) : (
|
) : (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={onWarehouseChange}
|
onClick={onWarehouseChange}
|
||||||
className={classNames(
|
className={clsx(
|
||||||
classes.warehouseButton,
|
classes.warehouseButton,
|
||||||
"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiOutlinedInput-adornedEnd",
|
"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiOutlinedInput-adornedEnd",
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -42,7 +42,7 @@ import {
|
||||||
getToFulfillOrderLines,
|
getToFulfillOrderLines,
|
||||||
OrderFulfillLineFormData,
|
OrderFulfillLineFormData,
|
||||||
} from "@saleor/orders/utils/data";
|
} from "@saleor/orders/utils/data";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ const OrderFulfillPage: React.FC<OrderFulfillPageProps> = props => {
|
||||||
<FormattedMessage {...messages.sku} />
|
<FormattedMessage {...messages.sku} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(
|
className={clsx(
|
||||||
classes.colQuantity,
|
classes.colQuantity,
|
||||||
classes.colQuantityHeader,
|
classes.colQuantityHeader,
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { TableCell, Typography } from "@material-ui/core";
|
||||||
import TableRowLink from "@saleor/components/TableRowLink";
|
import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { FulfillmentStatus, OrderDetailsFragment } from "@saleor/graphql";
|
import { FulfillmentStatus, OrderDetailsFragment } from "@saleor/graphql";
|
||||||
import { getStringOrPlaceholder } from "@saleor/misc";
|
import { getStringOrPlaceholder } from "@saleor/misc";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const ExtraInfoLines: React.FC<ExtraInfoLinesProps> = ({ fulfillment }) => {
|
||||||
: extraInfoMessages.fulfilled,
|
: extraInfoMessages.fulfilled,
|
||||||
)}
|
)}
|
||||||
<Typography
|
<Typography
|
||||||
className={classNames(classes.infoLabel, {
|
className={clsx(classes.infoLabel, {
|
||||||
[classes.infoLabelWithMargin]: !!trackingNumber,
|
[classes.infoLabelWithMargin]: !!trackingNumber,
|
||||||
})}
|
})}
|
||||||
color="textPrimary"
|
color="textPrimary"
|
||||||
|
|
|
@ -14,7 +14,7 @@ import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { InvoiceFragment } from "@saleor/graphql";
|
import { InvoiceFragment } from "@saleor/graphql";
|
||||||
import { buttonMessages } from "@saleor/intl";
|
import { buttonMessages } from "@saleor/intl";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ const OrderInvoiceList: React.FC<OrderInvoiceListProps> = props => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<CardContent
|
<CardContent
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.cardContentTable]: generatedInvoices?.length,
|
[classes.cardContentTable]: generatedInvoices?.length,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Money, { IMoney } from "@saleor/components/Money";
|
import Money, { IMoney } from "@saleor/components/Money";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import reduce from "lodash/reduce";
|
import reduce from "lodash/reduce";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, useIntl } from "react-intl";
|
import { defineMessages, useIntl } from "react-intl";
|
||||||
|
@ -121,7 +121,7 @@ const OrderRefundAmountValues: React.FC<OrderRefundAmountValuesProps> = props =>
|
||||||
<div className={classes.container}>
|
<div className={classes.container}>
|
||||||
{items.map(({ key, data, highlighted }) => (
|
{items.map(({ key, data, highlighted }) => (
|
||||||
<div
|
<div
|
||||||
className={classNames(classes.row, {
|
className={clsx(classes.row, {
|
||||||
[classes.highlightedRow]: highlighted,
|
[classes.highlightedRow]: highlighted,
|
||||||
})}
|
})}
|
||||||
key={key}
|
key={key}
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {
|
||||||
RelayToFlat,
|
RelayToFlat,
|
||||||
SearchPageProps,
|
SearchPageProps,
|
||||||
} from "@saleor/types";
|
} from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import InfiniteScroll from "react-infinite-scroll-component";
|
import InfiniteScroll from "react-infinite-scroll-component";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
@ -303,7 +303,7 @@ const AssignMembersDialog: React.FC<AssignMembersDialogProps> = ({
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions
|
<DialogActions
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.dropShadow]: dropShadow,
|
[classes.dropShadow]: dropShadow,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { sortMembers } from "@saleor/permissionGroups/sort";
|
||||||
import { MembersListUrlSortField } from "@saleor/permissionGroups/urls";
|
import { MembersListUrlSortField } from "@saleor/permissionGroups/urls";
|
||||||
import { ListActions, SortPage } from "@saleor/types";
|
import { ListActions, SortPage } from "@saleor/types";
|
||||||
import { getArrowDirection } from "@saleor/utils/sort";
|
import { getArrowDirection } from "@saleor/utils/sort";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ const PermissionGroupMemberList: React.FC<PermissionGroupProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRowLink
|
<TableRowLink
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.tableRow]: !!user,
|
[classes.tableRow]: !!user,
|
||||||
})}
|
})}
|
||||||
hover={!!user}
|
hover={!!user}
|
||||||
|
|
|
@ -38,7 +38,7 @@ import TDisplayColumn, {
|
||||||
DisplayColumnProps,
|
DisplayColumnProps,
|
||||||
} from "@saleor/utils/columns/DisplayColumn";
|
} from "@saleor/utils/columns/DisplayColumn";
|
||||||
import { getArrowDirection } from "@saleor/utils/sort";
|
import { getArrowDirection } from "@saleor/utils/sort";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ export const ProductList: React.FC<ProductListProps> = props => {
|
||||||
<TableCellHeader
|
<TableCellHeader
|
||||||
data-test-id="col-name-header"
|
data-test-id="col-name-header"
|
||||||
arrowPosition="right"
|
arrowPosition="right"
|
||||||
className={classNames(classes.colName, {
|
className={clsx(classes.colName, {
|
||||||
[classes.colNameFixed]: settings.columns.length > 4,
|
[classes.colNameFixed]: settings.columns.length > 4,
|
||||||
})}
|
})}
|
||||||
direction={
|
direction={
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import { ProductMediaPopper } from "@saleor/products/components/ProductMediaPopper/ProductMediaPopper";
|
import { ProductMediaPopper } from "@saleor/products/components/ProductMediaPopper/ProductMediaPopper";
|
||||||
import { ReorderAction } from "@saleor/types";
|
import { ReorderAction } from "@saleor/types";
|
||||||
import createMultiFileUploadHandler from "@saleor/utils/handlers/multiFileUploadHandler";
|
import createMultiFileUploadHandler from "@saleor/utils/handlers/multiFileUploadHandler";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, useIntl } from "react-intl";
|
import { defineMessages, useIntl } from "react-intl";
|
||||||
import { SortableContainer, SortableElement } from "react-sortable-hoc";
|
import { SortableContainer, SortableElement } from "react-sortable-hoc";
|
||||||
|
@ -280,7 +280,7 @@ const ProductMedia: React.FC<ProductMediaProps> = props => {
|
||||||
media={media}
|
media={media}
|
||||||
preview={imagesToUpload}
|
preview={imagesToUpload}
|
||||||
onSortEnd={onImageReorder}
|
onSortEnd={onImageReorder}
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.root]: true,
|
[classes.root]: true,
|
||||||
[classes.rootDragActive]: isDragActive,
|
[classes.rootDragActive]: isDragActive,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Card, CardContent } from "@material-ui/core";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { defineMessages, useIntl } from "react-intl";
|
import { defineMessages, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ const ProductMediaNavigation: React.FC<ProductMediaNavigationProps> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.imageContainer]: true,
|
[classes.imageContainer]: true,
|
||||||
[classes.highlightedImageContainer]:
|
[classes.highlightedImageContainer]:
|
||||||
mediaObj.id === highlighted,
|
mediaObj.id === highlighted,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
import BackButton from "@saleor/components/BackButton";
|
import BackButton from "@saleor/components/BackButton";
|
||||||
import { ProductMediaFragment } from "@saleor/graphql";
|
import { ProductMediaFragment } from "@saleor/graphql";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ const ProductVariantMediaSelectDialog: React.FC<ProductVariantImageSelectDialogP
|
||||||
parsedMediaOembedData?.thumbnail_url || mediaObj.url;
|
parsedMediaOembedData?.thumbnail_url || mediaObj.url;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames([
|
className={clsx([
|
||||||
classes.imageContainer,
|
classes.imageContainer,
|
||||||
{
|
{
|
||||||
[classes.selectedImageContainer]:
|
[classes.selectedImageContainer]:
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
productVariantEditUrl,
|
productVariantEditUrl,
|
||||||
} from "@saleor/products/urls";
|
} from "@saleor/products/urls";
|
||||||
import { ReorderAction } from "@saleor/types";
|
import { ReorderAction } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ const ProductVariantNavigation: React.FC<ProductVariantNavigationProps> = props
|
||||||
hover={!!variant}
|
hover={!!variant}
|
||||||
key={variant ? variant.id : "skeleton"}
|
key={variant ? variant.id : "skeleton"}
|
||||||
index={variantIndex || 0}
|
index={variantIndex || 0}
|
||||||
className={classNames(classes.link, {
|
className={clsx(classes.link, {
|
||||||
[classes.rowActive]: isActive,
|
[classes.rowActive]: isActive,
|
||||||
})}
|
})}
|
||||||
href={
|
href={
|
||||||
|
@ -109,7 +109,7 @@ const ProductVariantNavigation: React.FC<ProductVariantNavigationProps> = props
|
||||||
<TableRowLink>
|
<TableRowLink>
|
||||||
<TableCellAvatar
|
<TableCellAvatar
|
||||||
alignRight
|
alignRight
|
||||||
className={classNames(
|
className={clsx(
|
||||||
classes.colAvatar,
|
classes.colAvatar,
|
||||||
classes.rowActive,
|
classes.rowActive,
|
||||||
classes.noHandle,
|
classes.noHandle,
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
import ArrowDropdown from "@saleor/icons/ArrowDropdown";
|
import ArrowDropdown from "@saleor/icons/ArrowDropdown";
|
||||||
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
||||||
import { renderCollection } from "@saleor/misc";
|
import { renderCollection } from "@saleor/misc";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ const ShippingZonePostalCodes: React.FC<ShippingZonePostalCodesProps> = ({
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<CardContent className={classNames(classes.radioContainer)}>
|
<CardContent className={clsx(classes.radioContainer)}>
|
||||||
<RadioGroupField
|
<RadioGroupField
|
||||||
alignTop
|
alignTop
|
||||||
choices={[
|
choices={[
|
||||||
|
@ -204,7 +204,7 @@ const ShippingZonePostalCodes: React.FC<ShippingZonePostalCodesProps> = ({
|
||||||
onClick={() => setExpanded(!expanded)}
|
onClick={() => setExpanded(!expanded)}
|
||||||
>
|
>
|
||||||
<ArrowDropdown
|
<ArrowDropdown
|
||||||
className={classNames(classes.arrow, {
|
className={clsx(classes.arrow, {
|
||||||
[classes.arrowRotate]: expanded,
|
[classes.arrowRotate]: expanded,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
} from "@saleor/staff/urls";
|
} from "@saleor/staff/urls";
|
||||||
import { ListProps, RelayToFlat, SortPage } from "@saleor/types";
|
import { ListProps, RelayToFlat, SortPage } from "@saleor/types";
|
||||||
import { getArrowDirection } from "@saleor/utils/sort";
|
import { getArrowDirection } from "@saleor/utils/sort";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ const StaffList: React.FC<StaffListProps> = props => {
|
||||||
staffMembers,
|
staffMembers,
|
||||||
staffMember => (
|
staffMember => (
|
||||||
<TableRowLink
|
<TableRowLink
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.tableRow]: !!staffMember,
|
[classes.tableRow]: !!staffMember,
|
||||||
})}
|
})}
|
||||||
hover={!!staffMember}
|
hover={!!staffMember}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { List, ListHeader, ListItem, ListItemCell } from "@saleor/macaw-ui";
|
||||||
import { taxesMessages } from "@saleor/taxes/messages";
|
import { taxesMessages } from "@saleor/taxes/messages";
|
||||||
import { taxConfigurationListUrl } from "@saleor/taxes/urls";
|
import { taxConfigurationListUrl } from "@saleor/taxes/urls";
|
||||||
import { isLastElement } from "@saleor/taxes/utils/utils";
|
import { isLastElement } from "@saleor/taxes/utils/utils";
|
||||||
import clsx from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {
|
||||||
productVariantUrl,
|
productVariantUrl,
|
||||||
TranslatableEntities,
|
TranslatableEntities,
|
||||||
} from "@saleor/translations/urls";
|
} from "@saleor/translations/urls";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ const ProductContextSwitcher: React.FC<ProductContextSwitcherProps> = ({
|
||||||
{items.find(({ value }) => value === selectedId)?.label || "-"}
|
{items.find(({ value }) => value === selectedId)?.label || "-"}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ArrowDropDown
|
<ArrowDropDown
|
||||||
className={classNames(classes.arrow, {
|
className={clsx(classes.arrow, {
|
||||||
[classes.rotate]: isExpanded,
|
[classes.rotate]: isExpanded,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
TranslationFieldType,
|
TranslationFieldType,
|
||||||
} from "@saleor/translations/types";
|
} from "@saleor/translations/types";
|
||||||
import { ListProps } from "@saleor/types";
|
import { ListProps } from "@saleor/types";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ const TranslationFields: React.FC<TranslationFieldsProps> = props => {
|
||||||
onClick={() => setExpandedState(!expanded)}
|
onClick={() => setExpandedState(!expanded)}
|
||||||
>
|
>
|
||||||
<ArrowIcon
|
<ArrowIcon
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.rotate]: expanded,
|
[classes.rotate]: expanded,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import Skeleton from "@saleor/components/Skeleton";
|
||||||
import { TablePaginationWithContext } from "@saleor/components/TablePagination";
|
import { TablePaginationWithContext } from "@saleor/components/TablePagination";
|
||||||
import TableRowLink from "@saleor/components/TableRowLink";
|
import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ const TranslationsEntitiesList: React.FC<TranslationsEntitiesListProps> = props
|
||||||
entities,
|
entities,
|
||||||
entity => (
|
entity => (
|
||||||
<TableRowLink
|
<TableRowLink
|
||||||
className={classNames({
|
className={clsx({
|
||||||
[classes.tableRow]: !!entity,
|
[classes.tableRow]: !!entity,
|
||||||
})}
|
})}
|
||||||
hover={!!entity}
|
hover={!!entity}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { DeleteIcon, IconButton, Pill } from "@saleor/macaw-ui";
|
||||||
import { renderCollection, stopPropagation } from "@saleor/misc";
|
import { renderCollection, stopPropagation } from "@saleor/misc";
|
||||||
import { webhookPath } from "@saleor/webhooks/urls";
|
import { webhookPath } from "@saleor/webhooks/urls";
|
||||||
import { isUnnamed } from "@saleor/webhooks/utils";
|
import { isUnnamed } from "@saleor/webhooks/utils";
|
||||||
import classNames from "classnames";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
|
@ -63,9 +63,7 @@ const WebhooksList: React.FC<WebhooksListProps> = ({
|
||||||
<TableCellHeader>
|
<TableCellHeader>
|
||||||
{intl.formatMessage(commonMessages.status)}
|
{intl.formatMessage(commonMessages.status)}
|
||||||
</TableCellHeader>
|
</TableCellHeader>
|
||||||
<TableCell
|
<TableCell className={clsx(classes.colAction, classes.colRight)}>
|
||||||
className={classNames(classes.colAction, classes.colRight)}
|
|
||||||
>
|
|
||||||
<FormattedMessage {...messages.action} />
|
<FormattedMessage {...messages.action} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRowLink>
|
</TableRowLink>
|
||||||
|
@ -81,7 +79,7 @@ const WebhooksList: React.FC<WebhooksListProps> = ({
|
||||||
key={webhook ? webhook.id : "skeleton"}
|
key={webhook ? webhook.id : "skeleton"}
|
||||||
>
|
>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.colName, {
|
className={clsx(classes.colName, {
|
||||||
[classes.colNameUnnamed]: isUnnamed(webhook),
|
[classes.colNameUnnamed]: isUnnamed(webhook),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
@ -106,7 +104,7 @@ const WebhooksList: React.FC<WebhooksListProps> = ({
|
||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell
|
<TableCell
|
||||||
className={classNames(classes.colAction, classes.colRight)}
|
className={clsx(classes.colAction, classes.colRight)}
|
||||||
>
|
>
|
||||||
<TableButtonWrapper>
|
<TableButtonWrapper>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|
Loading…
Reference in a new issue