Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[pull] master from segmentio:master #59

Merged
merged 53 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
23389eb
README updates for the main repo, and a light overview on the docs su…
akleiner2 May 18, 2021
a2048b7
Fixup path generation for in-progress pattern components (#1203)
akleiner2 May 18, 2021
fadc437
v6.0.1
kamebkj May 18, 2021
40b0a43
update readme hero image on github (#1204)
kamebkj May 18, 2021
9beb4d4
update doc to use evergreen-ui ^6.0.0 (#1206)
kamebkj May 20, 2021
872eee8
Fix layout inconsistency for removeable alert's X button (#1210)
May 22, 2021
3dbaad9
Fix Select Menu + deselect example (#1213)
akleiner2 May 24, 2021
95e9bfd
Bring back icon search in the docs (#1227)
akleiner2 Jun 9, 2021
607458a
Updates to lint infra and DX to make things a bit smoother (#1229)
akleiner2 Jun 9, 2021
c15d2e7
Add Position to code sandbox import regex (#1230)
WarrenGreen Jun 9, 2021
6d21921
Lint staged fix (#1231)
kamebkj Jun 9, 2021
99af9f7
New pattern - Empty States (#1238)
kamebkj Jun 30, 2021
736b278
v6.1.0
kamebkj Jun 30, 2021
ca36db0
include yarnhook in devDeps so it doesnt fail when not globally insta…
Jul 14, 2021
ea07334
Remove circle CI in favor of solely running GH Actions (#1249)
akleiner2 Jul 14, 2021
d555fc0
fix storybook globs constantly rebuilding (#1250)
Jul 14, 2021
086f040
Eslint cleanup (#1251)
Jul 14, 2021
bbae505
Bump ua-parser-js from 0.7.17 to 0.7.28 in /examples/ssr-next (#1177)
dependabot[bot] Jul 14, 2021
54dd233
Bump lodash from 4.17.19 to 4.17.21 in /examples/ssr-next (#1184)
dependabot[bot] Jul 14, 2021
0e51140
Bump lodash from 4.17.19 to 4.17.21 in /codemods (#1190)
dependabot[bot] Jul 14, 2021
09c50dc
Bump postcss from 7.0.35 to 7.0.36 in /docs (#1232)
dependabot[bot] Jul 14, 2021
a916c43
Bump trim-newlines from 3.0.0 to 3.0.1 (#1228)
dependabot[bot] Jul 14, 2021
09377b8
Bump hosted-git-info from 2.5.0 to 2.8.9 in /examples/ssr-next (#1185)
dependabot[bot] Jul 14, 2021
f2f258b
Bump ws from 7.2.5 to 7.5.3 in /codemods (#1252)
dependabot[bot] Jul 14, 2021
8ebc7f5
Bump browserslist from 4.2.1 to 4.16.6 in /examples/ssr-next (#1214)
dependabot[bot] Jul 14, 2021
fac51b2
Bump hosted-git-info from 2.8.8 to 2.8.9 in /codemods (#1191)
dependabot[bot] Jul 14, 2021
2328e47
Bump set-getter from 0.1.0 to 0.1.1 in /examples/ssr-next (#1237)
dependabot[bot] Jul 14, 2021
c404bdf
Bump postcss from 7.0.35 to 7.0.36 (#1240)
dependabot[bot] Jul 14, 2021
42bc22b
Bump ws from 7.4.5 to 7.5.3 (#1253)
dependabot[bot] Jul 14, 2021
3261399
Bump ini from 1.3.5 to 1.3.8 in /examples/ssr-next (#1254)
dependabot[bot] Jul 14, 2021
8a9d650
Bump y18n from 4.0.0 to 4.0.3 in /examples/ssr-next (#1255)
dependabot[bot] Jul 14, 2021
72ee3ee
fix deselect/select on multiple select menus, optimize perf, remove b…
Jul 14, 2021
87e5fba
rm unused ava tests (#1262)
Jul 15, 2021
41e7a8f
rm enzyme (#1263)
Jul 16, 2021
a8288d0
Upgrade deps (#1261)
Jul 16, 2021
4db6667
update ssr example dir (#1266)
Jul 16, 2021
952ad21
Bump css-what from 5.0.0 to 5.0.1 (#1264)
dependabot[bot] Jul 17, 2021
6d03cc4
fix Transition nodeRef in Positioner component (#1271)
Jul 17, 2021
fc3ad76
update node engine to 12+, move react-is to peerDep matching react ve…
Jul 18, 2021
8cb9e95
chore: upgrade rollup (#1068)
g1eny0ung Jul 22, 2021
965735a
Performance tuning (#1274)
Jul 22, 2021
e96f05b
include ReactIs as global since it needs to be a peer dep
mshwery Jul 22, 2021
e656505
v6.2.0-0
mshwery Jul 22, 2021
3911c25
v6.2.0
mshwery Jul 22, 2021
8c6347d
upgrade EG in the docs (#1278)
Jul 22, 2021
f6ade5f
remove css-nil classes from glamor (#1280)
Jul 28, 2021
432cfea
v6.2.1
mshwery Jul 29, 2021
082f7f8
React 17 support (#1281)
Jul 29, 2021
f1db5f8
v6.3.0
mshwery Jul 29, 2021
915c39d
Empty state fix (#1286)
kamebkj Aug 9, 2021
1d380c5
Use EvergreenLink for text link in doc (#1293)
kamebkj Aug 10, 2021
366bb39
v6.4.0
kamebkj Aug 11, 2021
674d9a1
Empty state doc (#1290)
kamebkj Aug 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Empty state fix (segmentio#1286)
* Fix title color to be N700 instead of N900

* Remove secondary button from Empty State

* Remove secondaryCta prop from Empty State

* Fix typo for anchorCta

Co-authored-by: Allen Kleiner <[email protected]>
  • Loading branch information
kamebkj and akleiner2 committed Aug 9, 2021
commit 915c39df2f74080832ec1a6870565d6b6fea1d1c
5 changes: 1 addition & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -979,15 +979,12 @@ export interface EmptyStateOwnProps {
background?: 'light' | 'dark'
/** the primary cta of the empty state */
primaryCta?: React.ReactNode
/** the secondary cta of the empty state */
annchorCta?: React.ReactNode
/** the link cta of the empty state */
secondaryCta?: React.ReactNode
anchorCta?: React.ReactNode
}

export declare const EmptyState: React.FC<EmptyStateOwnProps> & {
PrimaryButton: typeof Button
SecondaryButton: typeof Button
LinkButton: typeof Link
}

Expand Down
12 changes: 0 additions & 12 deletions src/empty-states/__tests__/EmptyState.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@ describe('Empty States', () => {
expect(getByRole('button', { name: 'Primary Action' })).toBeVisible()
})

it('should render secondary button when passed in', () => {
const { getByRole } = render(
<EmptyState
title="My Empty States"
icon={<LockIcon color={defaultTheme.tokens.colors.gray500} />}
iconBgColor={defaultTheme.tokens.colors.gray200}
secondaryCta={<EmptyState.SecondaryButton>Secondary Action</EmptyState.SecondaryButton>}
/>
)
expect(getByRole('button', { name: 'Secondary Action' })).toBeVisible()
})

it('should render link button when passed in', () => {
const { getByRole } = render(
<EmptyState
Expand Down
1 change: 0 additions & 1 deletion src/empty-states/fixtures/BasicExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const BasicExample = () => {
iconBgColor={colors.orange100}
description="If you believe you should have accesss to this page, please check with your Workspace Owner or request access below."
primaryCta={<EmptyState.PrimaryButton>Request Access</EmptyState.PrimaryButton>}
secondaryCta={<EmptyState.SecondaryButton>Do Something Else</EmptyState.SecondaryButton>}
/>
</Pane>
)
Expand Down
30 changes: 10 additions & 20 deletions src/empty-states/src/EmptyState.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ const HorizontalOrientation = memo(function HorizontalOrientation({
icon,
iconBgColor,
primaryCta,
secondaryCta,
title
}) {
const hasFooter = primaryCta || secondaryCta || anchorCta
const hasFooter = primaryCta || anchorCta
const { colors } = useTheme()

const backgroundColor = background === 'light' ? 'white' : colors.gray75
Expand Down Expand Up @@ -48,20 +47,19 @@ const HorizontalOrientation = memo(function HorizontalOrientation({
</Pane>
</Pane>
<Pane display="flex" flexDirection="column" paddingRight={majorScale(6)}>
<Heading size={500}>{title}</Heading>
<Heading size={500} color={colors.gray700}>
{title}
</Heading>
{description && (
<Paragraph color="muted" marginTop={majorScale(2)}>
{description}
</Paragraph>
)}
{hasFooter && (
<Pane marginTop={majorScale(5)} display="flex">
{primaryCta && React.cloneElement(primaryCta, { marginRight: majorScale(2) })}
{secondaryCta}
{(primaryCta || secondaryCta) &&
anchorCta &&
React.cloneElement(anchorCta, { marginLeft: majorScale(2) })}
{!primaryCta && !secondaryCta && anchorCta}
{primaryCta}
{primaryCta && anchorCta && React.cloneElement(anchorCta, { marginLeft: majorScale(4) })}
{!primaryCta && anchorCta}
</Pane>
)}
</Pane>
Expand Down Expand Up @@ -109,10 +107,10 @@ const VerticalOrientation = memo(function VerticalOrientation({
>
{React.cloneElement(icon, { size: majorScale(3) })}
</Pane>
<Heading marginTop={majorScale(2)} textAlign="center">
<Heading marginTop={majorScale(2)} textAlign="center" color={colors.gray700}>
{title}
</Heading>
<Paragraph marginTop={majorScale(2)} textAlign="center">
<Paragraph marginTop={majorScale(2)} textAlign="center" color={colors.gray700}>
{description}
</Paragraph>
{primaryCta && React.cloneElement(primaryCta, { marginTop: minorScale(5) })}
Expand All @@ -125,10 +123,6 @@ const PrimaryButton = props => {
return <Button appearance="primary" {...props} />
}

const SecondaryButton = props => {
return <Button appearance="minimal" {...props} />
}

const LinkButton = props => {
return <Link {...props} size={300} lineHeight="34px" />
}
Expand All @@ -141,7 +135,6 @@ const EmptyState = memo(function EmptyState({
iconBgColor,
orientation = 'horizontal',
primaryCta,
secondaryCta,
title
}) {
if (orientation === 'vertical') {
Expand All @@ -164,15 +157,13 @@ const EmptyState = memo(function EmptyState({
background={background}
description={description}
primaryCta={primaryCta}
secondaryCta={secondaryCta}
anchorCta={anchorCta}
/>
)
}
})

EmptyState.PrimaryButton = PrimaryButton
EmptyState.SecondaryButton = SecondaryButton
EmptyState.LinkButton = LinkButton

EmptyState.propTypes = {
Expand All @@ -183,8 +174,7 @@ EmptyState.propTypes = {
description: PropTypes.string,
background: PropTypes.oneOf(['light', 'dark']),
primaryCta: PropTypes.element,
anchorCta: PropTypes.element,
secondaryCta: PropTypes.element
anchorCta: PropTypes.element
}

export default EmptyState