Skip to content

Commit

Permalink
Merge branch 'master' into auto-inc-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Sep 22, 2020
2 parents 3df97cc + f617e39 commit 330dc69
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 189 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-lemons-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystonejs/file-adapters": patch
---

Updated dependency `aws-sdk` to `^2.757.0`.
5 changes: 5 additions & 0 deletions .changeset/tricky-feet-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystonejs/keystone": patch
---

Updated dependency `apollo-server-express` to `^2.18.0`. This brings in some [changes related to apollo reporting](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md#v2180), which maybe of interested to users who use this feature.
73 changes: 40 additions & 33 deletions design-system/packages/button/src/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx jsx */

import { ReactNode, useContext } from 'react';
import { jsx } from '@keystone-ui/core';
import { forwardRefWithAs, jsx } from '@keystone-ui/core';
import { LoadingDots } from '@keystone-ui/loading';

import { ButtonContext } from './context';
Expand Down Expand Up @@ -32,36 +32,43 @@ const loadingContainerStyles = {
transform: 'translateX(-50%)',
} as const;

export const Button = ({
children,
isDisabled,
isLoading,
size,
tone,
weight,
onPress,
type = 'button',
...otherProps
}: ButtonProps) => {
const { useButtonStyles, useButtonTokens, defaults } = useContext(ButtonContext);
const tokens = useButtonTokens({
tone: tone || defaults.tone,
size: size || defaults.size,
weight: weight || defaults.weight,
});
const styles = useButtonStyles({
isDisabled,
tokens,
});
export const Button = forwardRefWithAs<'button', ButtonProps>(
(
{
as: Tag = 'button',
children,
isDisabled,
isLoading,
size,
tone,
weight,
onPress,
type = 'button',
...otherProps
},
ref
) => {
const { useButtonStyles, useButtonTokens, defaults } = useContext(ButtonContext);
const tokens = useButtonTokens({
tone: tone || defaults.tone,
size: size || defaults.size,
weight: weight || defaults.weight,
});
const styles = useButtonStyles({
isDisabled,
tokens,
});
const typeProp = Tag === 'button' ? type : undefined;

return (
<button type={type} css={styles} onClick={onPress} {...otherProps}>
<span css={isLoading ? { opacity: 0 } : null}>{children}</span>
{isLoading && (
<span css={loadingContainerStyles}>
<LoadingDots size={size || defaults.size} label="Button loading indicator" />
</span>
)}
</button>
);
};
return (
<Tag type={typeProp} css={styles} onClick={onPress} ref={ref} {...otherProps}>
<span css={isLoading ? { opacity: 0 } : null}>{children}</span>
{isLoading && (
<span css={loadingContainerStyles}>
<LoadingDots size={size || defaults.size} label="Button loading indicator" />
</span>
)}
</Tag>
);
}
);
14 changes: 12 additions & 2 deletions packages-next/admin-ui/src/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import { jsx } from '@emotion/core';
import { Button } from '@keystone-ui/button';
import { Box, Stack, useTheme } from '@keystone-ui/core';
import { Box, Stack, Inline, useTheme } from '@keystone-ui/core';
import { GithubIcon } from '@keystone-ui/icons/icons/GithubIcon';
import { DatabaseIcon } from '@keystone-ui/icons/icons/DatabaseIcon';
import Link from 'next/link';
import { useRouter } from 'next/router';
import type { FunctionComponent, ReactNode } from 'react';
Expand Down Expand Up @@ -82,7 +84,7 @@ export const Navigation: FunctionComponent = () => {
}}
>
<Box paddingY="medium">
You're logged in as <strong>{authenticatedItem.label}</strong>
Hello <strong>{authenticatedItem.label}</strong>
</Box>
<Button size="small">log out</Button>
</div>
Expand All @@ -101,6 +103,14 @@ export const Navigation: FunctionComponent = () => {
);
})}
</Stack>
<Inline gap="medium">
<Button as="a" target="_blank" href="/api/graphql">
<DatabaseIcon />
</Button>
<Button as="a" target="_blank" href="https://github.com/keystonejs/keystone">
<GithubIcon />
</Button>
</Inline>
</Stack>
</Box>
);
Expand Down
65 changes: 33 additions & 32 deletions packages-next/admin-ui/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,39 @@ const ListCard = ({ listKey, count }: ListCardProps) => {
const { colors, palette, shadow, spacing, radii } = useTheme();
const list = useList(listKey);
return (
<div>
<Link href={list.path} passHref>
<a
css={{
backgroundColor: colors.background,
borderWidth: 1,
borderColor: palette.neutral200,
borderRadius: radii.medium,
boxShadow: shadow.s100,
textDecoration: 'none',
display: 'inline-block',
padding: spacing.large,
marginRight: spacing.large,
minWidth: 280,
':hover': {
borderColor: palette.blue400,
},
}}
>
<h3 css={{ margin: 0 }}>{list.label} </h3>
{count.type === 'success' ? (
<span css={{ color: colors.foreground, textDecoration: 'none' }}>
{count.count} item{count.count !== 1 ? 's' : ''}
</span>
) : count.type === 'error' ? (
count.message
) : (
'No access'
)}
</a>
</Link>
</div>
<Link href={list.path} passHref>
<a
css={{
backgroundColor: colors.background,
borderWidth: 1,
borderColor: palette.neutral200,
borderRadius: radii.medium,
boxShadow: shadow.s100,
textDecoration: 'none',
display: 'inline-block',
padding: spacing.large,
marginRight: spacing.large,
minWidth: 280,
':hover': {
borderColor: palette.blue400,
},
':hover h3': {
textDecoration: 'underline',
},
}}
>
<h3 css={{ margin: `0 0 ${spacing.small}px 0` }}>{list.label} </h3>
{count.type === 'success' ? (
<span css={{ color: colors.foreground, textDecoration: 'none' }}>
{count.count} item{count.count !== 1 ? 's' : ''}
</span>
) : count.type === 'error' ? (
count.message
) : (
'No access'
)}
</a>
</Link>
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages-next/keystone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/prettier": "^2.1.1",
"@types/source-map-support": "^0.5.3",
"@types/uid-safe": "^2.1.2",
"apollo-server-express": "^2.17.0",
"apollo-server-express": "^2.18.0",
"cookie": "^0.4.1",
"express": "^4.17.1",
"fast-glob": "^3.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/arch/packages/day-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"chrono-node": "^1.4.8",
"date-fns": "^2.16.1",
"intersection-observer": "^0.11.0",
"moment": "^2.28.0",
"moment": "^2.29.0",
"react-window": "^1.8.5"
},
"module": "dist/day-picker.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/file-adapters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"node": ">=10.0.0"
},
"dependencies": {
"aws-sdk": "^2.753.0",
"aws-sdk": "^2.757.0",
"cloudinary": "^1.23.0",
"mkdirp": "^1.0.4",
"url-join": "^4.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/keystone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@keystonejs/session": "^8.1.1",
"@keystonejs/utils": "^5.4.3",
"apollo-errors": "^1.9.0",
"apollo-server-express": "^2.17.0",
"apollo-server-express": "^2.18.0",
"arg": "^4.1.3",
"chalk": "^4.1.0",
"ci-info": "^2.0.0",
Expand Down
Loading

0 comments on commit 330dc69

Please sign in to comment.