Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cx-templates, cx-flowcontainer): Add generic template (#1483)
* WIP on generic template * Fix issue with nested tokens (#1455) * Clean template & start shadow * Cleanup and renaming * Some cleanup, remove hero flow container. * Add gutter to content region * add copyright * Fix broken styleguide tokens. * fix some issues after merge * Fix lint * move wrapper * 8512: Add design keys for testing identifiers * 8541 Add Breadcrumb placeholder & style * AESQ-8536 add border to demonstrate contentregion * 8543 Fix lint & add tailwind * Correct name of footer styleguide page. * 8537 * 8549 & 8550 * fix build error * Add tailwind to cx-flowcontainer * remove dup of generic template & header/footer * fix build error * Single Constrained Flow container & fragments * Move SiteContraint from Wrapper -> container * Move breadcrumb over hero/top * comment out cypress Co-authored-by: hvanyo <hvanyo@its.jnj.com> Co-authored-by: tmiraniuk <tmiraniu@its.jnj.com>
- Loading branch information
1 parent
806b41d
commit d1c1e46
Showing
87 changed files
with
1,404 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
packages/__cxstarter__/src/shadow/@bodiless/cx-elements/Typography.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
/** | ||
* Copyright © 2022 Johnson & Johnson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { asElementToken, cxTypographyBase } from '@bodiless/cx-elements'; | ||
import { addProps } from '@bodiless/fclasses'; | ||
|
||
export default { | ||
...cxTypographyBase, | ||
H1: asElementToken(cxTypographyBase.H1, { | ||
Theme: { | ||
_: addProps({ 'data-shadowed-by': '__cxstarter__' }), | ||
_: addProps({ 'data-shadowed-by': '__cxstarter__:Typography' }), | ||
}, | ||
}), | ||
}; |
30 changes: 30 additions & 0 deletions
30
packages/__cxstarter__/src/shadow/@bodiless/cx-flowcontainer/FlowContainer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright © 2022 Johnson & Johnson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { asFluidToken } from '@bodiless/cx-elements'; | ||
import { cxFlowContainerBase } from '@bodiless/cx-flowcontainer'; | ||
import { addProps } from '@bodiless/fclasses'; | ||
|
||
const Default = asFluidToken({ | ||
...cxFlowContainerBase.Default, | ||
Spacing: { | ||
...cxFlowContainerBase.Default.Spacing, | ||
_: addProps({ 'data-shadowed-by': '__cxstarter__FlowContainer' }), | ||
} | ||
}); | ||
|
||
export default { | ||
...cxFlowContainerBase, | ||
Default, | ||
}; |
76 changes: 76 additions & 0 deletions
76
packages/__cxstarter__/src/styleguide/Page/StyleGuideTemplate/FlowContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Copyright © 2019 Johnson & Johnson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { withNodeKey } from '@bodiless/core'; | ||
import { | ||
flowHoc, | ||
as, | ||
replaceWith, | ||
} from '@bodiless/fclasses'; | ||
import { cxFlowContainer, FlowContainerClean } from '@bodiless/cx-flowcontainer'; | ||
|
||
import { asStyleGuideTemplateToken, cxStyleGuideTemplate } from '@bodiless/cx-templates'; | ||
|
||
const DefaultFlowContainer = as( | ||
cxFlowContainer.Default, | ||
withNodeKey('defaultcontainer'), | ||
)(FlowContainerClean); | ||
|
||
const FullFlowContainer = as( | ||
cxFlowContainer.Default, | ||
cxFlowContainer.WithFullWidthConstraint, | ||
withNodeKey('fullwidthcontainer'), | ||
)(FlowContainerClean); | ||
|
||
const SingleContainer = as( | ||
cxFlowContainer.Default, | ||
cxFlowContainer.WithSingleConstraint, | ||
withNodeKey('singlecontainer'), | ||
)(FlowContainerClean); | ||
|
||
const OneThirdContainer = as( | ||
cxFlowContainer.Default, | ||
cxFlowContainer.WithTabletOneThirdConstraint, | ||
withNodeKey('onethirdcontainer'), | ||
)(FlowContainerClean); | ||
|
||
const ContentRegionContainer = as( | ||
cxFlowContainer.ContentRegion, | ||
withNodeKey('contentregioncontainer'), | ||
)(FlowContainerClean); | ||
|
||
const Examples = (props: any) => ( | ||
<> | ||
<DefaultFlowContainer /> | ||
<hr /> | ||
<SingleContainer /> | ||
<hr /> | ||
<FullFlowContainer /> | ||
<hr /> | ||
<OneThirdContainer /> | ||
<hr /> | ||
<div className="border-2"> | ||
<ContentRegionContainer /> | ||
</div> | ||
</> | ||
); | ||
|
||
export const FlowContainer = asStyleGuideTemplateToken(cxStyleGuideTemplate.Default, { | ||
Meta: flowHoc.meta.term('Token')('FlowContainer'), | ||
Content: { | ||
Title: replaceWith(() => <>FlowContainer</>), | ||
Examples: replaceWith(Examples), | ||
}, | ||
}); |
6 changes: 4 additions & 2 deletions
6
packages/__cxstarter__/src/styleguide/Page/StyleGuideTemplate/Footer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import React from 'react'; | ||
import { asStyleGuideTemplateToken, cxStyleGuideTemplate } from '@bodiless/cx-templates'; | ||
import { flowHoc, replaceWith } from '@bodiless/fclasses'; | ||
import { flowHoc, on, replaceWith } from '@bodiless/fclasses'; | ||
import { FooterClean, cxFooter } from '@bodiless/cx-layout'; | ||
|
||
export const Footer = asStyleGuideTemplateToken(cxStyleGuideTemplate.FooterOnly, { | ||
export const Footer = asStyleGuideTemplateToken(cxStyleGuideTemplate.NoLayout, { | ||
Meta: flowHoc.meta.term('Token')('Footer'), | ||
Content: { | ||
Title: replaceWith(() => <>Footer</>), | ||
Examples: on(FooterClean)(cxFooter.Default), | ||
}, | ||
}); |
55 changes: 55 additions & 0 deletions
55
packages/__cxstarter__/src/styleguide/Page/StyleGuideTemplate/Images.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright © 2019 Johnson & Johnson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { withNodeKey } from '@bodiless/core'; | ||
import { | ||
flowHoc, | ||
as, | ||
replaceWith, | ||
Img, | ||
} from '@bodiless/fclasses'; | ||
import { cxImage } from '@bodiless/cx-image'; | ||
import { asStyleGuideTemplateToken, cxStyleGuideTemplate } from '@bodiless/cx-templates'; | ||
|
||
const DefaultImage = as( | ||
cxImage.Default, | ||
withNodeKey('defaultimage'), | ||
)(Img); | ||
|
||
const DefaultLandscapeImage = as( | ||
cxImage.Default, | ||
cxImage.WithLandscapePlaceholder, | ||
withNodeKey('defaultlandscapeimage'), | ||
)(Img); | ||
|
||
/* @todo | ||
* Rendered only the two types of images available in flow container as separate components. | ||
* To do is provide all variations we want tested individually. | ||
*/ | ||
const Examples = (props: any) => ( | ||
<> | ||
<DefaultImage /> | ||
<hr className="my-4" /> | ||
<DefaultLandscapeImage /> | ||
</> | ||
); | ||
|
||
export const Images = asStyleGuideTemplateToken(cxStyleGuideTemplate.Default, { | ||
Meta: flowHoc.meta.term('Token')('Images'), | ||
Content: { | ||
Title: replaceWith(() => <>Images</>), | ||
Examples: replaceWith(Examples), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.