Macaw UI update (#2512)
Co-authored-by: andrzejewsky <vox3r69@gmail.com> Co-authored-by: timur <timuric@gmail.com> Co-authored-by: Krzysztof Żuraw <9116238+krzysztofzuraw@users.noreply.github.com>
This commit is contained in:
parent
dbe394f2a8
commit
9574e6a92c
67 changed files with 22783 additions and 10608 deletions
|
@ -6106,6 +6106,9 @@
|
||||||
"context": "set balance dialog subtitle",
|
"context": "set balance dialog subtitle",
|
||||||
"string": "What would you like to set cards balance to. When you change the balance both values will be changed"
|
"string": "What would you like to set cards balance to. When you change the balance both values will be changed"
|
||||||
},
|
},
|
||||||
|
"kFkPWB": {
|
||||||
|
"string": "Number"
|
||||||
|
},
|
||||||
"kIXV5V": {
|
"kIXV5V": {
|
||||||
"context": "install with app manifest button",
|
"context": "install with app manifest button",
|
||||||
"string": "Install with App Manifest"
|
"string": "Install with App Manifest"
|
||||||
|
@ -6746,9 +6749,6 @@
|
||||||
"context": "checkbox label description",
|
"context": "checkbox label description",
|
||||||
"string": "Expiration date will be automatically set, once gift card is issued"
|
"string": "Expiration date will be automatically set, once gift card is issued"
|
||||||
},
|
},
|
||||||
"ps0WUQ": {
|
|
||||||
"string": "No. of Order"
|
|
||||||
},
|
|
||||||
"ptPPVk": {
|
"ptPPVk": {
|
||||||
"string": "No languages found"
|
"string": "No languages found"
|
||||||
},
|
},
|
||||||
|
|
19879
package-lock.json
generated
19879
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -25,12 +25,12 @@
|
||||||
"@editorjs/paragraph": "^2.8.0",
|
"@editorjs/paragraph": "^2.8.0",
|
||||||
"@editorjs/quote": "^2.4.0",
|
"@editorjs/quote": "^2.4.0",
|
||||||
"@glideapps/glide-data-grid": "^5.0.0",
|
"@glideapps/glide-data-grid": "^5.0.0",
|
||||||
"@material-ui/core": "^4.11.4",
|
"@material-ui/core": "^4.12.4",
|
||||||
"@material-ui/icons": "^4.11.2",
|
"@material-ui/icons": "^4.11.2",
|
||||||
"@material-ui/lab": "^4.0.0-alpha.58",
|
"@material-ui/lab": "^4.0.0-alpha.61",
|
||||||
"@material-ui/styles": "^4.11.4",
|
"@material-ui/styles": "^4.11.4",
|
||||||
"@reach/auto-id": "^0.16.0",
|
"@reach/auto-id": "^0.16.0",
|
||||||
"@saleor/macaw-ui": "0.6.5",
|
"@saleor/macaw-ui": "0.6.8-0",
|
||||||
"@saleor/sdk": "^0.4.4",
|
"@saleor/sdk": "^0.4.4",
|
||||||
"@sentry/react": "^6.0.0",
|
"@sentry/react": "^6.0.0",
|
||||||
"@types/faker": "^5.1.6",
|
"@types/faker": "^5.1.6",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
|
|
||||||
export const useStyles = makeStyles(
|
export const useStyles = makeStyles(
|
||||||
|
@ -25,7 +25,7 @@ export const useStyles = makeStyles(
|
||||||
right: theme.spacing(1),
|
right: theme.spacing(1),
|
||||||
},
|
},
|
||||||
paper: {
|
paper: {
|
||||||
background: fade(theme.palette.primary.main, 0.05),
|
background: alpha(theme.palette.primary.main, 0.05),
|
||||||
padding: theme.spacing(2, 3),
|
padding: theme.spacing(2, 3),
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
|
|
||||||
export const useStyles = makeStyles(
|
export const useStyles = makeStyles(
|
||||||
|
@ -12,7 +12,7 @@ export const useStyles = makeStyles(
|
||||||
right: theme.spacing(1),
|
right: theme.spacing(1),
|
||||||
},
|
},
|
||||||
paper: {
|
paper: {
|
||||||
background: fade(theme.palette.primary.main, 0.05),
|
background: alpha(theme.palette.primary.main, 0.05),
|
||||||
padding: theme.spacing(2, 3),
|
padding: theme.spacing(2, 3),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -45,6 +45,7 @@ export const useStyles = makeStyles(
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
textAlign: "right",
|
textAlign: "right",
|
||||||
|
gap: theme.spacing(1),
|
||||||
},
|
},
|
||||||
colInstallAction: {
|
colInstallAction: {
|
||||||
"& > *": {
|
"& > *": {
|
||||||
|
|
|
@ -107,7 +107,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
|
||||||
{/* Not using endAdornment as it looks weird with autocomplete */}
|
{/* Not using endAdornment as it looks weird with autocomplete */}
|
||||||
<IconButton
|
<IconButton
|
||||||
className={classes.showPasswordBtn}
|
className={classes.showPasswordBtn}
|
||||||
variant="secondary"
|
variant="ghost"
|
||||||
hoverOutline={false}
|
hoverOutline={false}
|
||||||
onMouseDown={() => setShowPassword(true)}
|
onMouseDown={() => setShowPassword(true)}
|
||||||
onMouseUp={() => setShowPassword(false)}
|
onMouseUp={() => setShowPassword(false)}
|
||||||
|
|
|
@ -36,7 +36,11 @@ const ResetPasswordPage: React.FC<ResetPasswordPageProps> = props => {
|
||||||
<Form initial={{ email: "" }} onSubmit={onSubmit}>
|
<Form initial={{ email: "" }} onSubmit={onSubmit}>
|
||||||
{({ change: handleChange, data, submit: handleSubmit }) => (
|
{({ change: handleChange, data, submit: handleSubmit }) => (
|
||||||
<>
|
<>
|
||||||
<IconButton className={classes.backBtn} href={getAppMountUri()}>
|
<IconButton
|
||||||
|
className={classes.backBtn}
|
||||||
|
href={getAppMountUri()}
|
||||||
|
variant="secondary"
|
||||||
|
>
|
||||||
<ArrowRightIcon className={classes.arrow} />
|
<ArrowRightIcon className={classes.arrow} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Typography variant="h3" className={classes.header}>
|
<Typography variant="h3" className={classes.header}>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { Button } from "@saleor/components/Button";
|
import { Button } from "@saleor/components/Button";
|
||||||
import FormSpacer from "@saleor/components/FormSpacer";
|
import FormSpacer from "@saleor/components/FormSpacer";
|
||||||
import {} from "@saleor/macaw-ui";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { AccordionSummary, Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer";
|
import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer";
|
||||||
import Skeleton from "@saleor/components/Skeleton";
|
import Skeleton from "@saleor/components/Skeleton";
|
||||||
import IconChevronDown from "@saleor/icons/ChevronDown";
|
import { AccordionSummary } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { useHeaderStyles } from "./styles";
|
import { useHeaderStyles } from "./styles";
|
||||||
|
@ -21,7 +21,7 @@ const AssignmentListHeader: React.FC<AssignmentListHeaderProps> = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={container}>
|
<div className={container}>
|
||||||
<AccordionSummary expandIcon={<IconChevronDown />} classes={accordion}>
|
<AccordionSummary className={accordion.root}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<Skeleton className={skeleton} />
|
<Skeleton className={skeleton} />
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -46,13 +46,6 @@ export const useHeaderStyles = makeStyles(
|
||||||
minHeight: 0,
|
minHeight: 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
content: {
|
|
||||||
margin: 0,
|
|
||||||
|
|
||||||
"&$expanded": {
|
|
||||||
margin: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
{ name: "AssignmentListHeader" },
|
{ name: "AssignmentListHeader" },
|
||||||
);
|
);
|
||||||
|
|
|
@ -140,7 +140,7 @@ const AccountPermissions: React.FC<AccountPermissionsProps> = props => {
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
data-test-id="full-access"
|
data-test-id="full-access"
|
||||||
color="primary"
|
color="secondary"
|
||||||
edge="start"
|
edge="start"
|
||||||
checked={data.hasFullAccess}
|
checked={data.hasFullAccess}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
@ -175,7 +175,7 @@ const AccountPermissions: React.FC<AccountPermissionsProps> = props => {
|
||||||
>
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
color="primary"
|
color="secondary"
|
||||||
edge="start"
|
edge="start"
|
||||||
checked={
|
checked={
|
||||||
data.permissions.filter(
|
data.permissions.filter(
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { Card, CardContent, Typography } from "@material-ui/core";
|
import { Card, CardContent, Typography } from "@material-ui/core";
|
||||||
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
|
|
||||||
import { AttributeReference } from "@saleor/attributes/utils/data";
|
import { AttributeReference } from "@saleor/attributes/utils/data";
|
||||||
import CardTitle from "@saleor/components/CardTitle";
|
import CardTitle from "@saleor/components/CardTitle";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
|
@ -13,7 +12,7 @@ import {
|
||||||
ProductErrorWithAttributesFragment,
|
ProductErrorWithAttributesFragment,
|
||||||
} from "@saleor/graphql";
|
} from "@saleor/graphql";
|
||||||
import { FormsetAtomicData } from "@saleor/hooks/useFormset";
|
import { FormsetAtomicData } from "@saleor/hooks/useFormset";
|
||||||
import { 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 classNames from "classnames";
|
||||||
|
@ -75,6 +74,7 @@ const useStyles = makeStyles(
|
||||||
display: "flex",
|
display: "flex",
|
||||||
},
|
},
|
||||||
expansionBarButton: {
|
expansionBarButton: {
|
||||||
|
padding: 4,
|
||||||
marginBottom: theme.spacing(1),
|
marginBottom: theme.spacing(1),
|
||||||
},
|
},
|
||||||
expansionBarButtonIcon: {
|
expansionBarButtonIcon: {
|
||||||
|
@ -148,11 +148,12 @@ const Attributes: React.FC<AttributesProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<IconButton
|
<IconButton
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
|
hoverOutline={false}
|
||||||
className={classes.expansionBarButton}
|
className={classes.expansionBarButton}
|
||||||
onClick={toggleExpansion}
|
onClick={toggleExpansion}
|
||||||
data-test-id="attributes-expand"
|
data-test-id="attributes-expand"
|
||||||
>
|
>
|
||||||
<ArrowDropDownIcon
|
<ChevronIcon
|
||||||
className={classNames(classes.expansionBarButtonIcon, {
|
className={classNames(classes.expansionBarButtonIcon, {
|
||||||
[classes.rotate]: expanded,
|
[classes.rotate]: expanded,
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -139,7 +139,6 @@ const CardMenu: React.FC<CardMenuProps> = props => {
|
||||||
aria-label="More"
|
aria-label="More"
|
||||||
aria-owns={open ? "long-menu" : null}
|
aria-owns={open ? "long-menu" : null}
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
color="primary"
|
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
ref={anchorRef}
|
ref={anchorRef}
|
||||||
onClick={handleToggle}
|
onClick={handleToggle}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Accordion, AccordionSummary, Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { ChannelData } from "@saleor/channels/utils";
|
import { ChannelData } from "@saleor/channels/utils";
|
||||||
import IconChevronDown from "@saleor/icons/ChevronDown";
|
import { Accordion, AccordionSummary, makeStyles } from "@saleor/macaw-ui";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
|
||||||
import Label from "@saleor/orders/components/OrderHistory/Label";
|
import Label from "@saleor/orders/components/OrderHistory/Label";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
@ -45,13 +44,6 @@ const useSummaryStyles = makeStyles(
|
||||||
padding: theme.spacing(2, 0),
|
padding: theme.spacing(2, 0),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
content: {
|
|
||||||
margin: 0,
|
|
||||||
|
|
||||||
"&$expanded": {
|
|
||||||
margin: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
{ name: "ChannelContentWrapperExpanderSummary" },
|
{ name: "ChannelContentWrapperExpanderSummary" },
|
||||||
);
|
);
|
||||||
|
@ -88,10 +80,7 @@ const ChannelContentWrapper: React.FC<ChannelContentWrapperProps> = ({
|
||||||
classes={expanderClasses}
|
classes={expanderClasses}
|
||||||
data-test-id="channel-availability-item"
|
data-test-id="channel-availability-item"
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<AccordionSummary className={summaryClasses.root}>
|
||||||
expandIcon={<IconChevronDown />}
|
|
||||||
classes={summaryClasses}
|
|
||||||
>
|
|
||||||
<div className={classes.container}>
|
<div className={classes.container}>
|
||||||
<Typography>{name}</Typography>
|
<Typography>{name}</Typography>
|
||||||
<Label text={messages.availableDateText} />
|
<Label text={messages.availableDateText} />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
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 classNames from "classnames";
|
||||||
|
@ -23,7 +23,7 @@ const useStyles = makeStyles(
|
||||||
color: theme.palette.common.white,
|
color: theme.palette.common.white,
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
background: fade(theme.palette.primary.main, 0.8),
|
background: alpha(theme.palette.primary.main, 0.8),
|
||||||
borderRadius: 18,
|
borderRadius: 18,
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
marginRight: theme.spacing(2),
|
marginRight: theme.spacing(2),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
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";
|
||||||
|
@ -25,7 +25,7 @@ const useStyles = makeStyles(
|
||||||
paddingRight: theme.spacing(1),
|
paddingRight: theme.spacing(1),
|
||||||
},
|
},
|
||||||
rootActive: {
|
rootActive: {
|
||||||
background: fade(theme.palette.primary.main, 0.1),
|
background: alpha(theme.palette.primary.main, 0.1),
|
||||||
},
|
},
|
||||||
rotate: {
|
rotate: {
|
||||||
transform: "rotate(180deg)",
|
transform: "rotate(180deg)",
|
||||||
|
|
|
@ -42,7 +42,6 @@ export const ControlledSwitch: React.FC<ControlledSwitchProps> = props => {
|
||||||
onChange({ target: { name, value: !checked } } as any)
|
onChange({ target: { name, value: !checked } } as any)
|
||||||
}
|
}
|
||||||
checked={checked}
|
checked={checked}
|
||||||
color="primary"
|
|
||||||
name={name}
|
name={name}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,8 @@ const useStyles = makeStyles(
|
||||||
theme => ({
|
theme => ({
|
||||||
iconCell: {
|
iconCell: {
|
||||||
"&:last-child": {
|
"&:last-child": {
|
||||||
paddingRight: theme.spacing(2),
|
paddingRight: theme.spacing(3),
|
||||||
|
paddingLeft: 0,
|
||||||
},
|
},
|
||||||
width: `calc(48px + ${theme.spacing(4)})`,
|
width: `calc(48px + ${theme.spacing(4)})`,
|
||||||
},
|
},
|
||||||
|
@ -161,7 +162,7 @@ const CountryList: React.FC<CountryListProps> = props => {
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
data-test-id="delete-icon"
|
data-test-id="delete-icon"
|
||||||
color="primary"
|
variant="secondary"
|
||||||
disabled={!country || disabled}
|
disabled={!country || disabled}
|
||||||
onClick={() => onCountryUnassign(country.code)}
|
onClick={() => onCountryUnassign(country.code)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -91,6 +91,7 @@ const useStyles = makeStyles(
|
||||||
boxSizing: "content-box",
|
boxSizing: "content-box",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
paddingBottom: "1px",
|
paddingBottom: "1px",
|
||||||
|
color: "red",
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
position: "relative",
|
position: "relative",
|
||||||
|
@ -194,7 +195,7 @@ export function useDatagridTheme() {
|
||||||
|
|
||||||
const datagridTheme = useMemo(
|
const datagridTheme = useMemo(
|
||||||
(): Partial<Theme> => ({
|
(): Partial<Theme> => ({
|
||||||
accentColor: theme.palette.primary.main,
|
accentColor: theme.palette.secondary.main,
|
||||||
accentLight: theme.palette.background.default,
|
accentLight: theme.palette.background.default,
|
||||||
accentFg: "transparent",
|
accentFg: "transparent",
|
||||||
bgCell: theme.palette.background.paper,
|
bgCell: theme.palette.background.paper,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { ThemeProvider } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import renderer, { ReactTestRendererJSON } from "react-test-renderer";
|
import renderer, { ReactTestRendererJSON } from "react-test-renderer";
|
||||||
|
|
||||||
|
@ -9,27 +10,33 @@ const expectedDate = "Apr 7, 2018";
|
||||||
|
|
||||||
test("Render plain date with timezone GMT-11", () => {
|
test("Render plain date with timezone GMT-11", () => {
|
||||||
const date = renderer.create(
|
const date = renderer.create(
|
||||||
|
<ThemeProvider>
|
||||||
<TimezoneProvider value="Pacific/Midway">
|
<TimezoneProvider value="Pacific/Midway">
|
||||||
<Date date={testDate} plain />
|
<Date date={testDate} plain />
|
||||||
</TimezoneProvider>,
|
</TimezoneProvider>
|
||||||
|
</ThemeProvider>,
|
||||||
);
|
);
|
||||||
expect(date.toJSON()).toEqual(expectedDate);
|
expect(date.toJSON()).toEqual(expectedDate);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Render plain date with timezone GMT+13", () => {
|
test("Render plain date with timezone GMT+13", () => {
|
||||||
const date = renderer.create(
|
const date = renderer.create(
|
||||||
|
<ThemeProvider>
|
||||||
<TimezoneProvider value="Pacific/Tongatapu">
|
<TimezoneProvider value="Pacific/Tongatapu">
|
||||||
<Date date={testDate} plain />
|
<Date date={testDate} plain />
|
||||||
</TimezoneProvider>,
|
</TimezoneProvider>
|
||||||
|
</ThemeProvider>,
|
||||||
);
|
);
|
||||||
expect(date.toJSON()).toEqual(expectedDate);
|
expect(date.toJSON()).toEqual(expectedDate);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Render humanized date with timezone GMT-11", () => {
|
test("Render humanized date with timezone GMT-11", () => {
|
||||||
const date = renderer.create(
|
const date = renderer.create(
|
||||||
|
<ThemeProvider>
|
||||||
<TimezoneProvider value="Pacific/Midway">
|
<TimezoneProvider value="Pacific/Midway">
|
||||||
<Date date={testDate} />
|
<Date date={testDate} />
|
||||||
</TimezoneProvider>,
|
</TimezoneProvider>
|
||||||
|
</ThemeProvider>,
|
||||||
);
|
);
|
||||||
expect((date.toJSON() as ReactTestRendererJSON).props.dateTime).toEqual(
|
expect((date.toJSON() as ReactTestRendererJSON).props.dateTime).toEqual(
|
||||||
testDate,
|
testDate,
|
||||||
|
@ -38,9 +45,11 @@ test("Render humanized date with timezone GMT-11", () => {
|
||||||
|
|
||||||
test("Render humanized date with timezone GMT+13", () => {
|
test("Render humanized date with timezone GMT+13", () => {
|
||||||
const date = renderer.create(
|
const date = renderer.create(
|
||||||
|
<ThemeProvider>
|
||||||
<TimezoneProvider value="Pacific/Tongatapu">
|
<TimezoneProvider value="Pacific/Tongatapu">
|
||||||
<Date date={testDate} />
|
<Date date={testDate} />
|
||||||
</TimezoneProvider>,
|
</TimezoneProvider>
|
||||||
|
</ThemeProvider>,
|
||||||
);
|
);
|
||||||
expect((date.toJSON() as ReactTestRendererJSON).props.dateTime).toEqual(
|
expect((date.toJSON() as ReactTestRendererJSON).props.dateTime).toEqual(
|
||||||
testDate,
|
testDate,
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { Tooltip } from "@material-ui/core";
|
|
||||||
import useDateLocalize from "@saleor/hooks/useDateLocalize";
|
import useDateLocalize from "@saleor/hooks/useDateLocalize";
|
||||||
|
import { Tooltip } from "@saleor/macaw-ui";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { LocaleConsumer } from "../Locale";
|
import { LocaleConsumer } from "../Locale";
|
||||||
import { Consumer } from "./DateContext";
|
import { Consumer } from "./DateContext";
|
||||||
import { useStyles } from "./styles";
|
|
||||||
|
|
||||||
interface DateProps {
|
interface DateProps {
|
||||||
date: string;
|
date: string;
|
||||||
|
@ -13,8 +12,6 @@ interface DateProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Date: React.FC<DateProps> = ({ date, plain }) => {
|
export const Date: React.FC<DateProps> = ({ date, plain }) => {
|
||||||
const classes = useStyles();
|
|
||||||
|
|
||||||
const localizeDate = useDateLocalize();
|
const localizeDate = useDateLocalize();
|
||||||
|
|
||||||
const getHumanized = (value: string, locale: string, currentDate: number) =>
|
const getHumanized = (value: string, locale: string, currentDate: number) =>
|
||||||
|
@ -30,12 +27,7 @@ export const Date: React.FC<DateProps> = ({ date, plain }) => {
|
||||||
plain ? (
|
plain ? (
|
||||||
localizeDate(date)
|
localizeDate(date)
|
||||||
) : (
|
) : (
|
||||||
<Tooltip
|
<Tooltip title={localizeDate(date)}>
|
||||||
title={localizeDate(date)}
|
|
||||||
PopperProps={{
|
|
||||||
className: classes.tooltip,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<time dateTime={date}>
|
<time dateTime={date}>
|
||||||
{getHumanized(date, locale, currentDate)}
|
{getHumanized(date, locale, currentDate)}
|
||||||
</time>
|
</time>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Tooltip } from "@material-ui/core";
|
import { Tooltip } from "@saleor/macaw-ui";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactMoment from "react-moment";
|
import ReactMoment from "react-moment";
|
||||||
|
@ -6,7 +6,6 @@ import ReactMoment from "react-moment";
|
||||||
import { LocaleConsumer } from "../Locale";
|
import { LocaleConsumer } from "../Locale";
|
||||||
import { TimezoneConsumer } from "../Timezone";
|
import { TimezoneConsumer } from "../Timezone";
|
||||||
import { Consumer } from "./DateContext";
|
import { Consumer } from "./DateContext";
|
||||||
import { useStyles } from "./styles";
|
|
||||||
|
|
||||||
interface DateTimeProps {
|
interface DateTimeProps {
|
||||||
date: string;
|
date: string;
|
||||||
|
@ -14,8 +13,6 @@ interface DateTimeProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DateTime: React.FC<DateTimeProps> = ({ date, plain }) => {
|
export const DateTime: React.FC<DateTimeProps> = ({ date, plain }) => {
|
||||||
const classes = useStyles();
|
|
||||||
|
|
||||||
const getTitle = (value: string, locale?: string, tz?: string) => {
|
const getTitle = (value: string, locale?: string, tz?: string) => {
|
||||||
let date = moment(value).locale(locale);
|
let date = moment(value).locale(locale);
|
||||||
if (tz !== undefined) {
|
if (tz !== undefined) {
|
||||||
|
@ -34,12 +31,7 @@ export const DateTime: React.FC<DateTimeProps> = ({ date, plain }) => {
|
||||||
plain ? (
|
plain ? (
|
||||||
getTitle(date, locale, tz)
|
getTitle(date, locale, tz)
|
||||||
) : (
|
) : (
|
||||||
<Tooltip
|
<Tooltip title={getTitle(date, locale, tz)}>
|
||||||
title={getTitle(date, locale, tz)}
|
|
||||||
PopperProps={{
|
|
||||||
className: classes.tooltip,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ReactMoment from={currentDate} locale={locale} tz={tz}>
|
<ReactMoment from={currentDate} locale={locale} tz={tz}>
|
||||||
{date}
|
{date}
|
||||||
</ReactMoment>
|
</ReactMoment>
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
|
||||||
|
|
||||||
export const useStyles = makeStyles(
|
|
||||||
theme => ({
|
|
||||||
tooltip: {
|
|
||||||
"& .MuiTooltip-tooltip": {
|
|
||||||
color: theme.palette.getContrastText(theme.palette.text.primary),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
name: "DateTime",
|
|
||||||
},
|
|
||||||
);
|
|
|
@ -1,12 +1,6 @@
|
||||||
import {
|
import { ClickAwayListener, Grow, Popper, Typography } from "@material-ui/core";
|
||||||
ButtonBase,
|
import { alpha } from "@material-ui/core/styles";
|
||||||
ClickAwayListener,
|
import { Button, makeStyles } from "@saleor/macaw-ui";
|
||||||
Grow,
|
|
||||||
Popper,
|
|
||||||
Typography,
|
|
||||||
} from "@material-ui/core";
|
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
|
@ -34,7 +28,7 @@ const useStyles = makeStyles(
|
||||||
addFilterButton: {
|
addFilterButton: {
|
||||||
"&$filterButton": {
|
"&$filterButton": {
|
||||||
"&:hover, &:focus": {
|
"&:hover, &:focus": {
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.1),
|
backgroundColor: alpha(theme.palette.primary.main, 0.1),
|
||||||
},
|
},
|
||||||
backgroundColor: theme.palette.background.paper,
|
backgroundColor: theme.palette.background.paper,
|
||||||
border: `1px solid ${theme.palette.primary.main}`,
|
border: `1px solid ${theme.palette.primary.main}`,
|
||||||
|
@ -47,7 +41,7 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
addFilterButtonActive: {
|
addFilterButtonActive: {
|
||||||
"&$addFilterButton": {
|
"&$addFilterButton": {
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.1),
|
backgroundColor: alpha(theme.palette.primary.main, 0.1),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
addFilterIcon: {
|
addFilterIcon: {
|
||||||
|
@ -60,16 +54,8 @@ const useStyles = makeStyles(
|
||||||
textTransform: "uppercase",
|
textTransform: "uppercase",
|
||||||
},
|
},
|
||||||
filterButton: {
|
filterButton: {
|
||||||
alignItems: "center",
|
padding: theme.spacing(1, 2),
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.6),
|
marginRight: theme.spacing(2),
|
||||||
borderRadius: "4px",
|
|
||||||
display: "flex",
|
|
||||||
height: 40,
|
|
||||||
justifyContent: "space-around",
|
|
||||||
margin: theme.spacing(2, 1),
|
|
||||||
marginLeft: 0,
|
|
||||||
padding: theme.spacing(0, 2),
|
|
||||||
position: "relative",
|
|
||||||
},
|
},
|
||||||
paper: {
|
paper: {
|
||||||
"& p": {
|
"& p": {
|
||||||
|
@ -89,7 +75,7 @@ const useStyles = makeStyles(
|
||||||
separator: {
|
separator: {
|
||||||
backgroundColor: theme.palette.primary.main,
|
backgroundColor: theme.palette.primary.main,
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
height: 28,
|
height: 14,
|
||||||
margin: theme.spacing(0, 1.5, 0, 1),
|
margin: theme.spacing(0, 1.5, 0, 1),
|
||||||
width: 1,
|
width: 1,
|
||||||
},
|
},
|
||||||
|
@ -141,13 +127,14 @@ const Filter: React.FC<FilterProps> = props => {
|
||||||
mouseEvent="onMouseUp"
|
mouseEvent="onMouseUp"
|
||||||
>
|
>
|
||||||
<div ref={anchor}>
|
<div ref={anchor}>
|
||||||
<ButtonBase
|
<Button
|
||||||
className={classNames(classes.filterButton, classes.addFilterButton, {
|
className={classNames(classes.filterButton, {
|
||||||
[classes.addFilterButtonActive]:
|
[classes.addFilterButtonActive]:
|
||||||
isFilterMenuOpened || isFilterActive,
|
isFilterMenuOpened || isFilterActive,
|
||||||
})}
|
})}
|
||||||
onClick={() => setFilterMenuOpened(!isFilterMenuOpened)}
|
onClick={() => setFilterMenuOpened(!isFilterMenuOpened)}
|
||||||
data-test-id="show-filters-button"
|
data-test-id="show-filters-button"
|
||||||
|
variant="secondary"
|
||||||
>
|
>
|
||||||
<Typography className={classes.addFilterText}>
|
<Typography className={classes.addFilterText}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
@ -174,7 +161,7 @@ const Filter: React.FC<FilterProps> = props => {
|
||||||
</Typography>
|
</Typography>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</ButtonBase>
|
</Button>
|
||||||
<Popper
|
<Popper
|
||||||
className={classes.popover}
|
className={classes.popover}
|
||||||
open={isFilterMenuOpened}
|
open={isFilterMenuOpened}
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
import {
|
import { makeStyles, Paper, Typography } from "@material-ui/core";
|
||||||
Accordion,
|
|
||||||
AccordionSummary,
|
|
||||||
makeStyles,
|
|
||||||
Paper,
|
|
||||||
Typography,
|
|
||||||
} from "@material-ui/core";
|
|
||||||
import CollectionWithDividers from "@saleor/components/CollectionWithDividers";
|
import CollectionWithDividers from "@saleor/components/CollectionWithDividers";
|
||||||
import Hr from "@saleor/components/Hr";
|
import Hr from "@saleor/components/Hr";
|
||||||
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
import useStateFromProps from "@saleor/hooks/useStateFromProps";
|
||||||
import IconChevronDown from "@saleor/icons/ChevronDown";
|
import { Accordion, AccordionSummary } from "@saleor/macaw-ui";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { FilterAutocompleteDisplayValues } from "../FilterAutocompleteField";
|
import { FilterAutocompleteDisplayValues } from "../FilterAutocompleteField";
|
||||||
|
@ -28,7 +22,6 @@ import FilterErrorsList from "./FilterErrorsList";
|
||||||
const useExpanderStyles = makeStyles(
|
const useExpanderStyles = makeStyles(
|
||||||
theme => ({
|
theme => ({
|
||||||
btn: {
|
btn: {
|
||||||
border: "none",
|
|
||||||
marginRight: theme.spacing(1),
|
marginRight: theme.spacing(1),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -66,13 +59,6 @@ const useSummaryStyles = makeStyles(
|
||||||
minHeight: 0,
|
minHeight: 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
content: {
|
|
||||||
margin: 0,
|
|
||||||
|
|
||||||
"&$expanded": {
|
|
||||||
margin: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
{ name: "FilterContentExpanderSummary" },
|
{ name: "FilterContentExpanderSummary" },
|
||||||
);
|
);
|
||||||
|
@ -229,8 +215,7 @@ const FilterContent: React.FC<FilterContentProps> = ({
|
||||||
},
|
},
|
||||||
disableRipple: true,
|
disableRipple: true,
|
||||||
}}
|
}}
|
||||||
expandIcon={<IconChevronDown />}
|
className={summaryClasses.root}
|
||||||
classes={summaryClasses}
|
|
||||||
onClick={() => handleFilterOpen(filter)}
|
onClick={() => handleFilterOpen(filter)}
|
||||||
>
|
>
|
||||||
{currentFilter && (
|
{currentFilter && (
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { FormControlLabel, Radio, TextField } from "@material-ui/core";
|
import { FormControlLabel, Radio, TextField } from "@material-ui/core";
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { FilterDateTimeField } from "@saleor/components/Filter/FilterContent/FilterDateTimeField";
|
import { FilterDateTimeField } from "@saleor/components/Filter/FilterContent/FilterDateTimeField";
|
||||||
import { FilterNumericField } from "@saleor/components/Filter/FilterContent/FilterNumericField";
|
import { FilterNumericField } from "@saleor/components/Filter/FilterContent/FilterNumericField";
|
||||||
import { FilterSingleSelectField } from "@saleor/components/Filter/FilterContent/FilterSingleSelectField";
|
import { FilterSingleSelectField } from "@saleor/components/Filter/FilterContent/FilterSingleSelectField";
|
||||||
|
@ -27,7 +27,7 @@ import {
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
theme => ({
|
theme => ({
|
||||||
filterSettings: {
|
filterSettings: {
|
||||||
background: fade(theme.palette.primary.main, 0.1),
|
background: alpha(theme.palette.primary.main, 0.1),
|
||||||
padding: theme.spacing(2, 3),
|
padding: theme.spacing(2, 3),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ const FilterContentBody = <K extends string = string>({
|
||||||
data-test-id="filter-boolean"
|
data-test-id="filter-boolean"
|
||||||
data-test-is-checked={filter.value[0] === option.value}
|
data-test-is-checked={filter.value[0] === option.value}
|
||||||
checked={filter.value[0] === option.value}
|
checked={filter.value[0] === option.value}
|
||||||
color="primary"
|
color="secondary"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
label={option.label}
|
label={option.label}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { fade, makeStyles } from "@material-ui/core/styles";
|
import { alpha, makeStyles } from "@material-ui/core/styles";
|
||||||
import InlineAlert from "@saleor/components/Alert/InlineAlert";
|
import InlineAlert from "@saleor/components/Alert/InlineAlert";
|
||||||
import errorTracker from "@saleor/services/errorTracking";
|
import errorTracker from "@saleor/services/errorTracking";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -11,7 +11,7 @@ import { FilterElement, FilterErrorMessages, FilterErrors } from "../types";
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
theme => ({
|
theme => ({
|
||||||
container: {
|
container: {
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.1),
|
backgroundColor: alpha(theme.palette.primary.main, 0.1),
|
||||||
padding: theme.spacing(3, 3, 0, 3),
|
padding: theme.spacing(3, 3, 0, 3),
|
||||||
},
|
},
|
||||||
listItemTitle: {
|
listItemTitle: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core";
|
import { alpha } from "@material-ui/core";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
|
@ -10,7 +10,7 @@ const useStyles = makeStyles(
|
||||||
marginRight: theme.spacing(2),
|
marginRight: theme.spacing(2),
|
||||||
},
|
},
|
||||||
filterSettings: {
|
filterSettings: {
|
||||||
background: fade(theme.palette.primary.main, 0.1),
|
background: alpha(theme.palette.primary.main, 0.1),
|
||||||
padding: theme.spacing(2, 3),
|
padding: theme.spacing(2, 3),
|
||||||
},
|
},
|
||||||
inputRange: {
|
inputRange: {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
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 classNames from "classnames";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -21,7 +21,7 @@ interface ImageUploadProps {
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
theme => ({
|
theme => ({
|
||||||
backdrop: {
|
backdrop: {
|
||||||
background: fade(theme.palette.primary.main, 0.1),
|
background: alpha(theme.palette.primary.main, 0.1),
|
||||||
color: theme.palette.primary.main,
|
color: theme.palette.primary.main,
|
||||||
},
|
},
|
||||||
fileField: {
|
fileField: {
|
||||||
|
|
|
@ -22,7 +22,6 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
colName: {
|
colName: {
|
||||||
...colName,
|
...colName,
|
||||||
verticalAlign: "top",
|
|
||||||
},
|
},
|
||||||
colNameHeader: {
|
colNameHeader: {
|
||||||
...colName,
|
...colName,
|
||||||
|
@ -49,6 +48,7 @@ const useStyles = makeStyles(
|
||||||
transition: theme.transitions.create("transform", {
|
transition: theme.transitions.create("transform", {
|
||||||
duration: theme.transitions.duration.shorter,
|
duration: theme.transitions.duration.shorter,
|
||||||
}),
|
}),
|
||||||
|
border: 0,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
"&&": {
|
"&&": {
|
||||||
|
|
|
@ -4,9 +4,12 @@ import React from "react";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
{
|
{
|
||||||
|
root: {
|
||||||
|
fontWeight: 500,
|
||||||
|
},
|
||||||
currency: {
|
currency: {
|
||||||
fontSize: "0.875em",
|
fontSize: "0.87em",
|
||||||
marginRight: "0.5rem",
|
marginRight: "0.2rem",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ name: "Money" },
|
{ name: "Money" },
|
||||||
|
@ -40,10 +43,10 @@ export const Money: React.FC<MoneyProps> = ({ money }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<span className={classes.root}>
|
||||||
<span className={classes.currency}>{money.currency}</span>
|
<span className={classes.currency}>{money.currency}</span>
|
||||||
{amount}
|
{amount}
|
||||||
</>
|
</span>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
|
|
||||||
export const useStyles = makeStyles(
|
export const useStyles = makeStyles(
|
||||||
|
@ -10,6 +10,7 @@ export const useStyles = makeStyles(
|
||||||
height: 32,
|
height: 32,
|
||||||
padding: 0,
|
padding: 0,
|
||||||
width: 32,
|
width: 32,
|
||||||
|
border: 0,
|
||||||
},
|
},
|
||||||
chipContainer: {
|
chipContainer: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
@ -21,7 +22,10 @@ export const useStyles = makeStyles(
|
||||||
color: theme.palette.primary.contrastText,
|
color: theme.palette.primary.contrastText,
|
||||||
},
|
},
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
background: fade(theme.palette.primary.main, 0.8),
|
background:
|
||||||
|
theme.palette.type === "dark"
|
||||||
|
? theme.palette.secondary.main
|
||||||
|
: alpha(theme.palette.primary.main, 0.8),
|
||||||
borderRadius: 18,
|
borderRadius: 18,
|
||||||
color: theme.palette.primary.contrastText,
|
color: theme.palette.primary.contrastText,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
@ -42,7 +46,7 @@ export const useStyles = makeStyles(
|
||||||
color: theme.palette.grey[200],
|
color: theme.palette.grey[200],
|
||||||
},
|
},
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
background: fade(theme.palette.grey[400], 0.8),
|
background: alpha(theme.palette.grey[400], 0.8),
|
||||||
borderRadius: 18,
|
borderRadius: 18,
|
||||||
color: theme.palette.primary.contrastText,
|
color: theme.palette.primary.contrastText,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
|
|
@ -152,9 +152,9 @@ const Navigator: React.FC<NavigatorProps> = ({ visible, setVisibility }) => {
|
||||||
<NavigatorInput
|
<NavigatorInput
|
||||||
mode={mode}
|
mode={mode}
|
||||||
value={query}
|
value={query}
|
||||||
{...getInputProps({
|
{...(getInputProps({
|
||||||
value: query,
|
value: query,
|
||||||
})}
|
}) as React.InputHTMLAttributes<HTMLInputElement>)}
|
||||||
ref={input}
|
ref={input}
|
||||||
/>
|
/>
|
||||||
{hasAnything && <Divider />}
|
{hasAnything && <Divider />}
|
||||||
|
|
|
@ -88,7 +88,7 @@ export const RadioGroupField: React.FC<RadioGroupFieldProps> = props => {
|
||||||
className={classNames({
|
className={classNames({
|
||||||
[classes.alignTop]: alignTop,
|
[classes.alignTop]: alignTop,
|
||||||
})}
|
})}
|
||||||
color="primary"
|
color="secondary"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
label={choice.label}
|
label={choice.label}
|
||||||
|
|
|
@ -87,7 +87,7 @@ export const RadioSwitchField: React.FC<RadioSwitchFieldProps> = props => {
|
||||||
classes.radioLabel,
|
classes.radioLabel,
|
||||||
overrideClasses?.radioLabel,
|
overrideClasses?.radioLabel,
|
||||||
)}
|
)}
|
||||||
control={<Radio color="primary" />}
|
control={<Radio color="secondary" />}
|
||||||
label={firstOptionLabel}
|
label={firstOptionLabel}
|
||||||
name={name}
|
name={name}
|
||||||
/>
|
/>
|
||||||
|
@ -97,7 +97,7 @@ export const RadioSwitchField: React.FC<RadioSwitchFieldProps> = props => {
|
||||||
classes.radioLabel,
|
classes.radioLabel,
|
||||||
overrideClasses?.radioLabel,
|
overrideClasses?.radioLabel,
|
||||||
)}
|
)}
|
||||||
control={<Radio color="primary" />}
|
control={<Radio color="secondary" />}
|
||||||
label={secondOptionLabel}
|
label={secondOptionLabel}
|
||||||
name={name}
|
name={name}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
theme => {
|
theme => {
|
||||||
const hover = {
|
const hover = {
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
background: fade(theme.palette.primary.main, 0.1),
|
background: alpha(theme.palette.primary.main, 0.1),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isDarkMode = theme.palette.type === "dark";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
editor: {
|
editor: {
|
||||||
"& .codex-editor": {
|
"& .codex-editor": {
|
||||||
|
@ -18,7 +20,7 @@ const useStyles = makeStyles(
|
||||||
minHeight: 24,
|
minHeight: 24,
|
||||||
},
|
},
|
||||||
"& .ce-block--selected .ce-block__content": {
|
"& .ce-block--selected .ce-block__content": {
|
||||||
background: `${fade(theme.palette.primary.main, 0.2)} !important`,
|
background: `${alpha(theme.palette.primary.main, 0.2)} !important`,
|
||||||
},
|
},
|
||||||
"& .ce-block__content": {
|
"& .ce-block__content": {
|
||||||
margin: 0,
|
margin: 0,
|
||||||
|
@ -28,7 +30,7 @@ const useStyles = makeStyles(
|
||||||
...hover,
|
...hover,
|
||||||
},
|
},
|
||||||
"& .ce-conversion-tool--focused": {
|
"& .ce-conversion-tool--focused": {
|
||||||
background: `${fade(theme.palette.primary.main, 0.1)} !important`,
|
background: `${alpha(theme.palette.primary.main, 0.1)} !important`,
|
||||||
},
|
},
|
||||||
"& .ce-conversion-tool__icon": {
|
"& .ce-conversion-tool__icon": {
|
||||||
background: "none",
|
background: "none",
|
||||||
|
@ -71,6 +73,17 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
"& .ce-toolbar__plus": {
|
"& .ce-toolbar__plus": {
|
||||||
left: -9,
|
left: -9,
|
||||||
|
color: theme.palette.text.primary,
|
||||||
|
...hover,
|
||||||
|
},
|
||||||
|
"& .ce-popover": {
|
||||||
|
backgroundColor: theme.palette.background.paper,
|
||||||
|
},
|
||||||
|
"& .ce-popover__item": {
|
||||||
|
...hover,
|
||||||
|
},
|
||||||
|
"& .ce-popover__item-icon": {
|
||||||
|
color: theme.palette.saleor.generic.verydark,
|
||||||
},
|
},
|
||||||
"& .ce-toolbox.ce-toolbox--opened": {
|
"& .ce-toolbox.ce-toolbox--opened": {
|
||||||
left: 16,
|
left: 16,
|
||||||
|
@ -83,13 +96,19 @@ const useStyles = makeStyles(
|
||||||
color: theme.palette.primary.light,
|
color: theme.palette.primary.light,
|
||||||
},
|
},
|
||||||
"&:not($rootDisabled):hover": {
|
"&:not($rootDisabled):hover": {
|
||||||
borderColor: theme.palette.primary.main,
|
borderColor: isDarkMode
|
||||||
|
? theme.palette.saleor.main[2]
|
||||||
|
: theme.palette.saleor.main[4],
|
||||||
|
boxShadow: `0 0 0 3px ${
|
||||||
|
isDarkMode
|
||||||
|
? theme.palette.saleor.main[4]
|
||||||
|
: theme.palette.saleor.main[6]
|
||||||
|
}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
border: `1px solid ${fade(theme.palette.text.secondary, 0.4)}`,
|
border: `1px solid ${theme.palette.saleor.main[4]}`,
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
boxShadow: `inset 0 0 0 0 ${theme.palette.primary.main}`,
|
|
||||||
fontSize: theme.typography.body1.fontSize,
|
fontSize: theme.typography.body1.fontSize,
|
||||||
minHeight: 56,
|
minHeight: 56,
|
||||||
padding: theme.spacing(3, 2),
|
padding: theme.spacing(3, 2),
|
||||||
|
@ -99,7 +118,7 @@ const useStyles = makeStyles(
|
||||||
transition: theme.transitions.duration.short + "ms",
|
transition: theme.transitions.duration.short + "ms",
|
||||||
},
|
},
|
||||||
rootActive: {
|
rootActive: {
|
||||||
boxShadow: `inset 0px 0px 0 2px ${theme.palette.primary.main}`,
|
borderColor: theme.palette.saleor.main[1],
|
||||||
},
|
},
|
||||||
rootDisabled: {
|
rootDisabled: {
|
||||||
...theme.overrides.MuiOutlinedInput.root["&$disabled"]["& fieldset"],
|
...theme.overrides.MuiOutlinedInput.root["&$disabled"]["& fieldset"],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {
|
import {
|
||||||
InputBase,
|
InputBase,
|
||||||
|
OutlinedInputProps,
|
||||||
Popper,
|
Popper,
|
||||||
PopperPlacementType,
|
PopperPlacementType,
|
||||||
TextField,
|
TextField,
|
||||||
|
@ -226,10 +227,10 @@ const SingleAutocompleteSelectFieldComponent: React.FC<SingleAutocompleteSelectF
|
||||||
// Downshift doesn't seem to be fully compatible with MUI
|
// Downshift doesn't seem to be fully compatible with MUI
|
||||||
// https://github.com/downshift-js/downshift/issues/718
|
// https://github.com/downshift-js/downshift/issues/718
|
||||||
inputProps={{
|
inputProps={{
|
||||||
...getInputProps({
|
...(getInputProps({
|
||||||
placeholder,
|
placeholder,
|
||||||
onClick: handleToggleMenu,
|
onClick: handleToggleMenu,
|
||||||
}),
|
}) as OutlinedInputProps["inputProps"]),
|
||||||
}}
|
}}
|
||||||
error={error}
|
error={error}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -21,7 +21,7 @@ const useStyles = makeStyles(
|
||||||
color: theme.palette.primary.main,
|
color: theme.palette.primary.main,
|
||||||
},
|
},
|
||||||
borderBottom: "1px solid transparent",
|
borderBottom: "1px solid transparent",
|
||||||
color: fade(theme.palette.text.secondary, 0.6),
|
color: alpha(theme.palette.text.secondary, 0.6),
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
fontWeight: theme.typography.fontWeightRegular,
|
fontWeight: theme.typography.fontWeightRegular,
|
||||||
|
|
|
@ -16,7 +16,7 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
color: theme.typography.caption.color,
|
color: theme.typography.caption.color,
|
||||||
fontSize: theme.typography.body1.fontSize,
|
fontSize: theme.typography.body1.fontSize,
|
||||||
fontWeight: 400,
|
fontWeight: 500,
|
||||||
},
|
},
|
||||||
tabRoot: {
|
tabRoot: {
|
||||||
minWidth: "80px",
|
minWidth: "80px",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import ArrowLeft from "@material-ui/icons/ArrowLeft";
|
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";
|
||||||
|
@ -14,12 +14,12 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
"&$disabled": {
|
"&$disabled": {
|
||||||
"& svg": {
|
"& svg": {
|
||||||
color: fade(theme.palette.primary.main, 0.2),
|
color: alpha(theme.palette.primary.main, 0.2),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"&:focus, &:hover": {
|
"&:focus, &:hover": {
|
||||||
"& > span:first-of-type": {
|
"& > span:first-of-type": {
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.2),
|
backgroundColor: alpha(theme.palette.primary.main, 0.2),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -36,7 +36,7 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
"&:focus, &:hover": {
|
"&:focus, &:hover": {
|
||||||
"& > span:first-of-type": {
|
"& > span:first-of-type": {
|
||||||
backgroundColor: fade(theme.palette.primary.main, 0.2),
|
backgroundColor: alpha(theme.palette.primary.main, 0.2),
|
||||||
},
|
},
|
||||||
backgroundColor: "transparent",
|
backgroundColor: "transparent",
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,13 +18,16 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
button: {
|
button: {
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
|
padding: `7px`,
|
||||||
|
borderTopLeftRadius: 0,
|
||||||
|
borderBottomLeftRadius: 0,
|
||||||
},
|
},
|
||||||
cardActionsExpanded: {
|
cardActionsExpanded: {
|
||||||
maxHeight: theme.spacing(6),
|
maxHeight: theme.spacing(6),
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
"& > div": {
|
"& > div": {
|
||||||
padding: "0 14px",
|
padding: "0 0 0 14px",
|
||||||
},
|
},
|
||||||
"& textarea": {
|
"& textarea": {
|
||||||
"&::placeholder": {
|
"&::placeholder": {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
|
import { Typography } from "@material-ui/core";
|
||||||
import {
|
import {
|
||||||
Accordion,
|
Accordion,
|
||||||
AccordionDetails,
|
AccordionDetails,
|
||||||
AccordionSummary,
|
AccordionSummary,
|
||||||
Typography,
|
makeStyles,
|
||||||
} from "@material-ui/core";
|
} from "@saleor/macaw-ui";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import TimelineEventHeader, { TitleElement } from "./TimelineEventHeader";
|
import TimelineEventHeader, { TitleElement } from "./TimelineEventHeader";
|
||||||
|
@ -15,11 +14,11 @@ const useStyles = makeStyles(
|
||||||
dot: {
|
dot: {
|
||||||
backgroundColor: theme.palette.primary.main,
|
backgroundColor: theme.palette.primary.main,
|
||||||
borderRadius: "100%",
|
borderRadius: "100%",
|
||||||
height: 8,
|
height: 7,
|
||||||
left: -29,
|
left: -28,
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: 6,
|
top: 6,
|
||||||
width: 8,
|
width: 7,
|
||||||
},
|
},
|
||||||
panel: {
|
panel: {
|
||||||
"& .MuiAccordionDetails-root": {
|
"& .MuiAccordionDetails-root": {
|
||||||
|
@ -94,10 +93,7 @@ export const TimelineEvent: React.FC<TimelineEventProps> = props => {
|
||||||
<span className={classes.dot} />
|
<span className={classes.dot} />
|
||||||
{children ? (
|
{children ? (
|
||||||
<Accordion className={classes.panel} elevation={0}>
|
<Accordion className={classes.panel} elevation={0}>
|
||||||
<AccordionSummary
|
<AccordionSummary className={classes.panelExpander}>
|
||||||
className={classes.panelExpander}
|
|
||||||
expandIcon={<ExpandMoreIcon />}
|
|
||||||
>
|
|
||||||
<TimelineEventHeader
|
<TimelineEventHeader
|
||||||
title={title}
|
title={title}
|
||||||
date={date}
|
date={date}
|
||||||
|
|
|
@ -1,25 +1,12 @@
|
||||||
import { FormControlLabel, Switch } from "@material-ui/core";
|
import { FormControlLabel, Switch } from "@material-ui/core";
|
||||||
import { UserFragment } from "@saleor/graphql";
|
import { UserFragment } from "@saleor/graphql";
|
||||||
import { makeStyles, UserChipMenu, UserChipMenuItem } from "@saleor/macaw-ui";
|
import { UserChipMenu, UserChipMenuItem } from "@saleor/macaw-ui";
|
||||||
import { getUserInitials, getUserName } from "@saleor/misc";
|
import { getUserInitials, getUserName } from "@saleor/misc";
|
||||||
import { staffMemberDetailsUrl } from "@saleor/staff/urls";
|
import { staffMemberDetailsUrl } from "@saleor/staff/urls";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
|
||||||
() => ({
|
|
||||||
switch: {
|
|
||||||
"&&:hover": {
|
|
||||||
background: "transparent",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
name: "UserChip",
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
export interface UserChipProps {
|
export interface UserChipProps {
|
||||||
isDarkThemeEnabled: boolean;
|
isDarkThemeEnabled: boolean;
|
||||||
user: UserFragment;
|
user: UserFragment;
|
||||||
|
@ -33,7 +20,6 @@ const UserChip: React.FC<UserChipProps> = ({
|
||||||
onLogout,
|
onLogout,
|
||||||
onThemeToggle,
|
onThemeToggle,
|
||||||
}) => {
|
}) => {
|
||||||
const classes = useStyles({});
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -64,16 +50,7 @@ const UserChip: React.FC<UserChipProps> = ({
|
||||||
data-test-is-dark={isDarkThemeEnabled}
|
data-test-is-dark={isDarkThemeEnabled}
|
||||||
>
|
>
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={<Switch checked={isDarkThemeEnabled} disableRipple />}
|
||||||
<Switch
|
|
||||||
classes={{
|
|
||||||
switchBase: classes.switch,
|
|
||||||
}}
|
|
||||||
checked={isDarkThemeEnabled}
|
|
||||||
color="primary"
|
|
||||||
disableRipple
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
id: "2r4cTE",
|
id: "2r4cTE",
|
||||||
defaultMessage: "Enable Dark Mode",
|
defaultMessage: "Enable Dark Mode",
|
||||||
|
|
|
@ -31,6 +31,7 @@ const useStyles = makeStyles(
|
||||||
gridTemplateColumns: "1fr 3fr",
|
gridTemplateColumns: "1fr 3fr",
|
||||||
padding: theme.spacing(4, 0),
|
padding: theme.spacing(4, 0),
|
||||||
},
|
},
|
||||||
|
|
||||||
configurationItem: {
|
configurationItem: {
|
||||||
[theme.breakpoints.down("md")]: {
|
[theme.breakpoints.down("md")]: {
|
||||||
gridTemplateColumns: "1fr",
|
gridTemplateColumns: "1fr",
|
||||||
|
@ -42,9 +43,7 @@ const useStyles = makeStyles(
|
||||||
configurationLabel: {
|
configurationLabel: {
|
||||||
paddingBottom: 20,
|
paddingBottom: 20,
|
||||||
},
|
},
|
||||||
header: {
|
|
||||||
margin: 0,
|
|
||||||
},
|
|
||||||
link: {
|
link: {
|
||||||
display: "contents",
|
display: "contents",
|
||||||
marginBottom: theme.spacing(4),
|
marginBottom: theme.spacing(4),
|
||||||
|
@ -92,10 +91,7 @@ export const ConfigurationPage: React.FC<ConfigurationPageProps> = props => {
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
{!isSmUp && renderVersionInfo}
|
{!isSmUp && renderVersionInfo}
|
||||||
<PageHeader
|
<PageHeader title={intl.formatMessage(sectionNames.configuration)}>
|
||||||
className={classes.header}
|
|
||||||
title={intl.formatMessage(sectionNames.configuration)}
|
|
||||||
>
|
|
||||||
{isSmUp && renderVersionInfo}
|
{isSmUp && renderVersionInfo}
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
{menus
|
{menus
|
||||||
|
|
|
@ -112,7 +112,7 @@ const CustomerDetailsPage: React.FC<CustomerDetailsPageProps> = ({
|
||||||
title={getUserName(customer, true)}
|
title={getUserName(customer, true)}
|
||||||
cardMenu={
|
cardMenu={
|
||||||
extensionMenuItems.length > 0 && (
|
extensionMenuItems.length > 0 && (
|
||||||
<CardMenu outlined menuItems={extensionMenuItems} />
|
<CardMenu menuItems={extensionMenuItems} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -7413,7 +7413,7 @@ export type TaxClassFragment = { __typename: 'TaxClass', id: string, name: strin
|
||||||
|
|
||||||
export type TimePeriodFragment = { __typename: 'TimePeriod', amount: number, type: TimePeriodTypeEnum };
|
export type TimePeriodFragment = { __typename: 'TimePeriod', amount: number, type: TimePeriodTypeEnum };
|
||||||
|
|
||||||
export type AttributeValueTranslatableFragment = { __typename: 'AttributeValueTranslatableContent', id: string, name: string, plainText: string | null, richText: any | null, attributeValue: { __typename: 'AttributeValue', id: string } | null, attribute: { __typename: 'AttributeTranslatableContent', id: string, name: string }, translation: { __typename: 'AttributeValueTranslation', id: string, name: string, plainText: string | null, richText: any | null, language: { __typename: 'LanguageDisplay', code: LanguageCodeEnum, language: string } } | null };
|
export type AttributeValueTranslatableFragment = { __typename: 'AttributeValueTranslatableContent', id: string, name: string, plainText: string | null, richText: any | null, attributeValue: { __typename: 'AttributeValue', id: string } | null, attribute: { __typename: 'AttributeTranslatableContent', id: string, name: string } | null, translation: { __typename: 'AttributeValueTranslation', id: string, name: string, plainText: string | null, richText: any | null, language: { __typename: 'LanguageDisplay', code: LanguageCodeEnum, language: string } } | null };
|
||||||
|
|
||||||
export type CategoryTranslationFragment = { __typename: 'CategoryTranslatableContent', translation: { __typename: 'CategoryTranslation', id: string, description: any | null, name: string | null, seoDescription: string | null, seoTitle: string | null, language: { __typename: 'LanguageDisplay', language: string } } | null, category: { __typename: 'Category', id: string, name: string, description: any | null, seoDescription: string | null, seoTitle: string | null } | null };
|
export type CategoryTranslationFragment = { __typename: 'CategoryTranslatableContent', translation: { __typename: 'CategoryTranslation', id: string, description: any | null, name: string | null, seoDescription: string | null, seoTitle: string | null, language: { __typename: 'LanguageDisplay', language: string } } | null, category: { __typename: 'Category', id: string, name: string, description: any | null, seoDescription: string | null, seoTitle: string | null } | null };
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,6 @@
|
||||||
import { useTheme } from "@saleor/macaw-ui";
|
import { ChevronIcon } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const ChevronDown: React.FC = () => {
|
const ChevronDown: React.FC = () => <ChevronIcon />;
|
||||||
const { themeType } = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<svg
|
|
||||||
data-test-id="expand-icon"
|
|
||||||
width="10"
|
|
||||||
height="7"
|
|
||||||
viewBox="0 0 10 7"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M1 1L5 5L9 1"
|
|
||||||
stroke={themeType === "dark" ? "#FAFAFA" : "#28234A"}
|
|
||||||
strokeOpacity="0.4"
|
|
||||||
strokeWidth="2"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ChevronDown;
|
export default ChevronDown;
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
import { createSvgIcon } from "@material-ui/core/utils";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const ChevronUp = createSvgIcon(
|
|
||||||
<svg width="10" height="7" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path
|
|
||||||
d="M9 6L5 2L1 6"
|
|
||||||
stroke="#28234A"
|
|
||||||
stroke-opacity="0.4"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
</svg>,
|
|
||||||
"ChevronUp",
|
|
||||||
);
|
|
||||||
|
|
||||||
export default ChevronUp;
|
|
|
@ -64,6 +64,10 @@ const useStyles = makeStyles(
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
marginLeft: theme.spacing(7),
|
marginLeft: theme.spacing(7),
|
||||||
},
|
},
|
||||||
|
nodeActions: {
|
||||||
|
display: "flex",
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
},
|
||||||
root: {
|
root: {
|
||||||
"& .rst__collapseButton": {
|
"& .rst__collapseButton": {
|
||||||
display: "none",
|
display: "none",
|
||||||
|
@ -183,6 +187,7 @@ const Node: React.FC<NodeRendererProps<TreeItemProps>> = props => {
|
||||||
{node.title}
|
{node.title}
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className={classes.spacer} />
|
<div className={classes.spacer} />
|
||||||
|
<div className={classes.nodeActions}>
|
||||||
<Button onClick={node.onClick}>
|
<Button onClick={node.onClick}>
|
||||||
<FormattedMessage {...buttonMessages.show} />
|
<FormattedMessage {...buttonMessages.show} />
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -203,6 +208,7 @@ const Node: React.FC<NodeRendererProps<TreeItemProps>> = props => {
|
||||||
>
|
>
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</div>
|
||||||
</Paper>
|
</Paper>
|
||||||
</div>,
|
</div>,
|
||||||
);
|
);
|
||||||
|
|
|
@ -212,7 +212,6 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
|
||||||
title={<Title order={order} />}
|
title={<Title order={order} />}
|
||||||
cardMenu={
|
cardMenu={
|
||||||
<CardMenu
|
<CardMenu
|
||||||
outlined
|
|
||||||
menuItems={[...selectCardMenuItems, ...extensionMenuItems]}
|
menuItems={[...selectCardMenuItems, ...extensionMenuItems]}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ export const OrderDraftList: React.FC<OrderDraftListProps> = props => {
|
||||||
onClick={() => onSort(OrderDraftListUrlSortField.number)}
|
onClick={() => onSort(OrderDraftListUrlSortField.number)}
|
||||||
className={classes.colNumber}
|
className={classes.colNumber}
|
||||||
>
|
>
|
||||||
<FormattedMessage id="ps0WUQ" defaultMessage="No. of Order" />
|
<FormattedMessage id="kFkPWB" defaultMessage="Number" />
|
||||||
</TableCellHeader>
|
</TableCellHeader>
|
||||||
<TableCellHeader
|
<TableCellHeader
|
||||||
direction={
|
direction={
|
||||||
|
|
|
@ -166,14 +166,14 @@ export const OrderFulfillLine: React.FC<OrderFulfillLineProps> = props => {
|
||||||
<TableCell className={classes.colWarehouse}>
|
<TableCell className={classes.colWarehouse}>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={onWarehouseChange}
|
onClick={onWarehouseChange}
|
||||||
className={classes.warehouseButton}
|
className={classNames(
|
||||||
|
classes.warehouseButton,
|
||||||
|
"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd MuiOutlinedInput-adornedEnd",
|
||||||
|
)}
|
||||||
data-test-id="select-warehouse-button"
|
data-test-id="select-warehouse-button"
|
||||||
>
|
>
|
||||||
<div className={classes.warehouseButtonContent}>
|
<div className={classes.warehouseButtonContent}>
|
||||||
<Typography
|
<Typography className={classes.warehouseButtonContentText}>
|
||||||
color={lineFormWarehouse ? "textPrimary" : "textSecondary"}
|
|
||||||
className={classes.warehouseButtonContentText}
|
|
||||||
>
|
|
||||||
{lineFormWarehouse?.name ??
|
{lineFormWarehouse?.name ??
|
||||||
intl.formatMessage(messages.selectWarehouse)}
|
intl.formatMessage(messages.selectWarehouse)}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
|
@ -50,7 +50,11 @@ export const useStyles = makeStyles(
|
||||||
padding: theme.spacing(1.5),
|
padding: theme.spacing(1.5),
|
||||||
width: "100%",
|
width: "100%",
|
||||||
justifyContent: "right",
|
justifyContent: "right",
|
||||||
border: `1px solid ${theme.palette.divider}`,
|
cursor: "pointer",
|
||||||
|
border: `1px solid ${theme.palette.primary.dark}`,
|
||||||
|
"&:hover": {
|
||||||
|
borderColor: "transparent",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
warehouseButtonContent: {
|
warehouseButtonContent: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
|
|
@ -110,7 +110,7 @@ export const OrderList: React.FC<OrderListProps> = props => {
|
||||||
onClick={() => onSort(OrderListUrlSortField.number)}
|
onClick={() => onSort(OrderListUrlSortField.number)}
|
||||||
className={classes.colNumber}
|
className={classes.colNumber}
|
||||||
>
|
>
|
||||||
<FormattedMessage id="ps0WUQ" defaultMessage="No. of Order" />
|
<FormattedMessage id="kFkPWB" defaultMessage="Number" />
|
||||||
</TableCellHeader>
|
</TableCellHeader>
|
||||||
<TableCellHeader
|
<TableCellHeader
|
||||||
direction={
|
direction={
|
||||||
|
|
|
@ -26,6 +26,7 @@ export const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
titleContainer: {
|
titleContainer: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
supportText: {
|
supportText: {
|
||||||
color: theme.palette.saleor.main[3],
|
color: theme.palette.saleor.main[3],
|
||||||
|
|
|
@ -6,6 +6,7 @@ export const useStyles = makeStyles(
|
||||||
flexDirection: "row-reverse",
|
flexDirection: "row-reverse",
|
||||||
paddingTop: theme.spacing(2),
|
paddingTop: theme.spacing(2),
|
||||||
paddingBottom: theme.spacing(2),
|
paddingBottom: theme.spacing(2),
|
||||||
|
gap: theme.spacing(1),
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
"& td, & th": {
|
"& td, & th": {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Card, TableCell, Tooltip } from "@material-ui/core";
|
import { Card, TableCell } from "@material-ui/core";
|
||||||
import HelpOutline from "@material-ui/icons/HelpOutline";
|
import HelpOutline from "@material-ui/icons/HelpOutline";
|
||||||
import { attributeUrl } from "@saleor/attributes/urls";
|
import { attributeUrl } from "@saleor/attributes/urls";
|
||||||
import { Button } from "@saleor/components/Button";
|
import { Button } from "@saleor/components/Button";
|
||||||
|
@ -14,7 +14,7 @@ import { TableButtonWrapper } from "@saleor/components/TableButtonWrapper/TableB
|
||||||
import TableHead from "@saleor/components/TableHead";
|
import TableHead from "@saleor/components/TableHead";
|
||||||
import TableRowLink from "@saleor/components/TableRowLink";
|
import TableRowLink from "@saleor/components/TableRowLink";
|
||||||
import { ProductAttributeType, ProductTypeDetailsQuery } from "@saleor/graphql";
|
import { ProductAttributeType, ProductTypeDetailsQuery } from "@saleor/graphql";
|
||||||
import { DeleteIcon, IconButton, makeStyles } from "@saleor/macaw-ui";
|
import { DeleteIcon, IconButton, makeStyles, Tooltip } from "@saleor/macaw-ui";
|
||||||
import { maybe, renderCollection } from "@saleor/misc";
|
import { maybe, renderCollection } from "@saleor/misc";
|
||||||
import { ListActions, ReorderAction } from "@saleor/types";
|
import { ListActions, ReorderAction } from "@saleor/types";
|
||||||
import capitalize from "lodash/capitalize";
|
import capitalize from "lodash/capitalize";
|
||||||
|
@ -22,7 +22,7 @@ import React, { useEffect } from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
|
|
||||||
const useStyles = makeStyles(
|
const useStyles = makeStyles(
|
||||||
{
|
theme => ({
|
||||||
colAction: {
|
colAction: {
|
||||||
"&:last-child": {
|
"&:last-child": {
|
||||||
paddingRight: 0,
|
paddingRight: 0,
|
||||||
|
@ -46,7 +46,7 @@ const useStyles = makeStyles(
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
colVariantDisabled: {
|
colVariantDisabled: {
|
||||||
fill: "#28234A",
|
fill: theme.palette.alert.icon.info,
|
||||||
fillOpacity: 0.6,
|
fillOpacity: 0.6,
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
fillOpacity: 1,
|
fillOpacity: 1,
|
||||||
|
@ -58,7 +58,7 @@ const useStyles = makeStyles(
|
||||||
textLeft: {
|
textLeft: {
|
||||||
textAlign: "left",
|
textAlign: "left",
|
||||||
},
|
},
|
||||||
},
|
}),
|
||||||
{ name: "ProductTypeAttributes" },
|
{ name: "ProductTypeAttributes" },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -274,8 +274,9 @@ const ProductTypeVariantAttributes: React.FC<ProductTypeVariantAttributesProps>
|
||||||
<IconButton
|
<IconButton
|
||||||
data-test-id="delete-icon"
|
data-test-id="delete-icon"
|
||||||
onClick={() => onAttributeUnassign(attribute.id)}
|
onClick={() => onAttributeUnassign(attribute.id)}
|
||||||
|
variant="primary"
|
||||||
>
|
>
|
||||||
<DeleteIcon color="primary" />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</TableButtonWrapper>
|
</TableButtonWrapper>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
@ -230,6 +230,7 @@ export const ProductListPage: React.FC<ProductListPageProps> = props => {
|
||||||
onQueryChange={onColumnQueryChange}
|
onQueryChange={onColumnQueryChange}
|
||||||
onFetchMore={onFetchMore}
|
onFetchMore={onFetchMore}
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
|
IconButtonProps={{ variant: "secondary" }}
|
||||||
/>
|
/>
|
||||||
<ButtonWithSelect
|
<ButtonWithSelect
|
||||||
options={extensionCreateButtonItems}
|
options={extensionCreateButtonItems}
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
import {
|
import { CardContent, Typography } from "@material-ui/core";
|
||||||
Accordion,
|
|
||||||
AccordionSummary,
|
|
||||||
CardContent,
|
|
||||||
Typography,
|
|
||||||
} from "@material-ui/core";
|
|
||||||
import IconChevronDown from "@saleor/icons/ChevronDown";
|
import IconChevronDown from "@saleor/icons/ChevronDown";
|
||||||
|
import { Accordion, AccordionSummary } from "@saleor/macaw-ui";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -30,7 +26,7 @@ export const ChannelsList: React.FC<ChannelListProps> = ({
|
||||||
<CardContent className={classes.summaryContent}>
|
<CardContent className={classes.summaryContent}>
|
||||||
<AccordionSummary
|
<AccordionSummary
|
||||||
expandIcon={<IconChevronDown />}
|
expandIcon={<IconChevronDown />}
|
||||||
classes={summaryClasses}
|
className={summaryClasses.root}
|
||||||
data-test-id="channels-variant-availability-summary"
|
data-test-id="channels-variant-availability-summary"
|
||||||
>
|
>
|
||||||
<Typography variant="caption">{summary}</Typography>
|
<Typography variant="caption">{summary}</Typography>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { alpha } from "@material-ui/core/styles";
|
||||||
import { makeStyles } from "@saleor/macaw-ui";
|
import { makeStyles } from "@saleor/macaw-ui";
|
||||||
|
|
||||||
export const useStyles = makeStyles(
|
export const useStyles = makeStyles(
|
||||||
|
@ -10,7 +10,7 @@ export const useStyles = makeStyles(
|
||||||
paddingLeft: 0,
|
paddingLeft: 0,
|
||||||
},
|
},
|
||||||
defaultVariant: {
|
defaultVariant: {
|
||||||
color: fade(theme.palette.text.secondary, 0.6),
|
color: alpha(theme.palette.text.secondary, 0.6),
|
||||||
display: "block",
|
display: "block",
|
||||||
},
|
},
|
||||||
firstVariant: {
|
firstVariant: {
|
||||||
|
|
|
@ -40,7 +40,7 @@ const useStyles = makeStyles(
|
||||||
theme => ({
|
theme => ({
|
||||||
deliveryTimeFields: {
|
deliveryTimeFields: {
|
||||||
display: "grid",
|
display: "grid",
|
||||||
gridColumnGap: theme.spacing(2),
|
gridColumnGap: theme.spacing(1),
|
||||||
gridRowGap: theme.spacing(1),
|
gridRowGap: theme.spacing(1),
|
||||||
gridTemplateColumns: "1fr 1fr 1fr",
|
gridTemplateColumns: "1fr 1fr 1fr",
|
||||||
[theme.breakpoints.down("md")]: {
|
[theme.breakpoints.down("md")]: {
|
||||||
|
|
|
@ -225,6 +225,7 @@ const ShippingZonePostalCodes: React.FC<ShippingZonePostalCodesProps> = ({
|
||||||
<IconButton
|
<IconButton
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
variant="secondary"
|
||||||
onClick={() => onPostalCodeDelete(postalCodeRange)}
|
onClick={() => onPostalCodeDelete(postalCodeRange)}
|
||||||
data-test-id={"delete-postal-code-" + postalCodeRange?.id}
|
data-test-id={"delete-postal-code-" + postalCodeRange?.id}
|
||||||
>
|
>
|
||||||
|
|
|
@ -43,7 +43,7 @@ const useStyles = makeStyles(
|
||||||
},
|
},
|
||||||
avatarDefault: {
|
avatarDefault: {
|
||||||
"& div": {
|
"& div": {
|
||||||
color: "#fff",
|
color: theme.palette.primary.contrastText,
|
||||||
fontSize: 35,
|
fontSize: 35,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
lineHeight: "120px",
|
lineHeight: "120px",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,19 +7,6 @@ const breakpoints = ({
|
||||||
|
|
||||||
const themeOverrides: Partial<Theme> = {
|
const themeOverrides: Partial<Theme> = {
|
||||||
breakpoints,
|
breakpoints,
|
||||||
overrides: {
|
|
||||||
MuiTableCell: {
|
|
||||||
body: {
|
|
||||||
paddingBottom: 8,
|
|
||||||
paddingTop: 8,
|
|
||||||
},
|
|
||||||
root: {
|
|
||||||
height: 56,
|
|
||||||
paddingBottom: 4,
|
|
||||||
paddingTop: 4,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default themeOverrides;
|
export default themeOverrides;
|
||||||
|
|
|
@ -43,6 +43,7 @@ const useStyles = makeStyles(
|
||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
position: "relative",
|
position: "relative",
|
||||||
right: theme.spacing(-1.5),
|
right: theme.spacing(-1.5),
|
||||||
|
gap: theme.spacing(1),
|
||||||
},
|
},
|
||||||
colActions: {
|
colActions: {
|
||||||
textAlign: "right",
|
textAlign: "right",
|
||||||
|
|
Loading…
Reference in a new issue