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

feat(bc-footer): Add Brand.com Footer #1450

Merged
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
22775bb
feature(bc-footer): Add Brand.com Footer
Mar 8, 2022
130129b
Merge branch 'main' into feature/bc-footer
Guilherme-Almeida-Zeni Mar 11, 2022
4ef4a43
feature(bc-footer): Final Styles Adjustments
Mar 11, 2022
c3ba7f4
feature(bc-footer): Copyright as RTE, Add TODO On Social Links AND Re…
Mar 11, 2022
33e8f47
feature(bc-footer): Move Sepator Styles To Its Own Token
Mar 11, 2022
b13f2be
feature(bc-footer): Rename GlobalFooter To Footer
Mar 11, 2022
078e5b9
feature(bc-footer): Address PR Feedback - Batch 1
Mar 12, 2022
5b9cba8
Reorganize menu. (#7)
wodenx Mar 14, 2022
dd33b8c
feature(bc-footer): Update Footer Menu Data
Mar 14, 2022
607adfe
feature(bc-footer): Update Package.Lock
Mar 14, 2022
406445f
feature(bc-footer): Remove Console Log From Menu Separator
Mar 14, 2022
8eeca7c
feature(bc-footer): Improve Footer Structure For Later Static Impleme…
Mar 14, 2022
4847391
feature(bc-footer): Add Todo Comments
Mar 14, 2022
c2892b6
feature(bc-footer): Rename SiteHeader And SiteFooter To Header And Fo…
Mar 14, 2022
10a8d3d
feature(bc-footer): Add Cx Navigation To TSConfig
Mar 14, 2022
1fd9afa
Merge branch 'main' of github.com:Guilherme-Almeida-Zeni/Bodiless-JS …
Mar 14, 2022
c4fcf4a
feature(bc-footer): Rename Remaining SiteHeader And SiteFooter To Hea…
Mar 14, 2022
e77dc99
feature(bc-footer): Adjust Layout After Updates
Mar 14, 2022
5b76db4
Token site constrains (#8)
hvanyo Mar 15, 2022
bc1a234
feature(bc-footer): Add Footer Slots Wrappers
Mar 15, 2022
9ddb477
feature(bc-footer): Refactor Footer Copyright RichText
Mar 15, 2022
57c2330
feature(bc-footer): Update Footer And Copyright Keys
Mar 15, 2022
1b86037
feature(bc-footer): Add Footer Page Example
Mar 15, 2022
47e925d
feature(bc-footer): Feedback Fixes - Batch 2
Mar 15, 2022
a76e723
Merge branch 'main' of github.com:Guilherme-Almeida-Zeni/Bodiless-JS …
Mar 15, 2022
e2b1886
feature(bc-footer): Update Cx Navigation Package Version
Mar 15, 2022
2e6ac77
Merge branch 'main' into feature/bc-footer
Guilherme-Almeida-Zeni Mar 21, 2022
9ff0098
fix(bc-footer): Fix Footer Issues (#10)
Guilherme-Almeida-Zeni Mar 21, 2022
13740a3
Merge branch 'main' of github.com:Guilherme-Almeida-Zeni/Bodiless-JS …
Mar 21, 2022
9642778
feature(bc-footer): Fix issues after main branch update
Mar 21, 2022
cedba7b
Merge branch 'main' of github.com:Guilherme-Almeida-Zeni/Bodiless-JS …
Mar 24, 2022
ae6c900
fix(bc-footer): Fix footer issues (#13)
guilhermegpessoa Mar 25, 2022
67f8d42
Merge branch 'main' of github.com:Guilherme-Almeida-Zeni/Bodiless-JS …
Mar 25, 2022
d3c3f88
Merge branch 'feature/bc-footer' of github.com:Guilherme-Almeida-Zeni…
Mar 25, 2022
278cb18
feature(bc-footer): Update Footer Content
Mar 28, 2022
972af32
bugfix(bc-footer): Fix Footer Menu Issues Issues (#16)
Guilherme-Almeida-Zeni Mar 28, 2022
1d3b40d
bugfix(bc-footer): Fix Mobile Margins Between Submenus (#17)
Guilherme-Almeida-Zeni Mar 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions packages/__cxstarter__/src/components/Footer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* 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.
*/

export { __cxstarter__Footer } from './tokens';
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* 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 { cxFooter, asFooterToken } from '@bodiless/cx-layout';

const Default = asFooterToken({
...cxFooter.Default,
Components: {
...cxFooter.Default.Components,
},
});

export default {
...cxFooter,
Default,
};
17 changes: 17 additions & 0 deletions packages/__cxstarter__/src/components/Footer/tokens/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* 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 __cxstarter__Footer from './__cxstarter__Footer';

export { __cxstarter__Footer };
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
*/

import { cxLayout, asLayoutToken } from '@bodiless/cx-layout';
import { __cxstarter__Footer } from '../../Footer';
import { __cxstarter__Header } from '../../Header';

const Default = asLayoutToken({
...cxLayout.Default,
Components: {
...cxLayout.Default.Components,
SiteHeader: __cxstarter__Header.Default,
Header: __cxstarter__Header.Default,
Footer: __cxstarter__Footer.Default,
},
Compose: {
...cxLayout.Default.Compose,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { asStyleGuideTemplateToken, cxStyleGuideTemplate } from '@bodiless/cx-templates';
import { flowHoc, replaceWith } from '@bodiless/fclasses';

export const Footer = asStyleGuideTemplateToken(cxStyleGuideTemplate.FooterOnly, {
Meta: flowHoc.meta.term('Token')('Footer'),
Content: {
Title: replaceWith(() => <>Footer</>),
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Editors, EditorsMonoFont } from './Editors';
import { Typography } from './Typography';
import { Layout } from './Layout';
import { Header } from './Header';
import { Footer } from './Footer';
import { _default } from './_default';

export const __cxstarter__StyleGuideTemplate = {
Expand All @@ -25,4 +26,5 @@ export const __cxstarter__StyleGuideTemplate = {
Typography,
Layout,
Header,
Footer,
};
2 changes: 2 additions & 0 deletions packages/__cxstarter__/src/styleguide/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const {
Typography,
Layout,
Header,
Footer,
_default
} = __cxstarter__StyleGuideTemplate;

Expand All @@ -36,6 +37,7 @@ const Default = asFluidToken({
Typography,
Layout,
Header,
Footer,
},
});

Expand Down
26 changes: 18 additions & 8 deletions packages/bodiless-core/src/withChild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import omit from 'lodash/omit';

type InsertChildOptions = {
designKey: string,
componentName: string,
mode?: 'append' | 'prepend',
};

Expand All @@ -38,7 +39,7 @@ const insertChild = (Child: CT, options: InsertChildOptions): HOC => (
Component = Fragment,
) => {
type Components = { [Child: string]: CT };
const { designKey, mode } = options;
const { designKey, componentName, mode } = options;
const startComponents: Components = { [designKey]: Child };
const WithChild: FC<any> = (props: PropsWithChildren<DesignableComponentsProps<Components>>) => {
const { components, ...rest } = props;
Expand Down Expand Up @@ -68,7 +69,7 @@ const insertChild = (Child: CT, options: InsertChildOptions): HOC => (
}
};
const applyDesign = extendDesignable(design => omit(design, [designKey]));
return applyDesign(startComponents, designKey)(WithChild) as ComponentType<any>;
return applyDesign(startComponents, componentName)(WithChild) as ComponentType<any>;
};

/**
Expand All @@ -77,6 +78,7 @@ const insertChild = (Child: CT, options: InsertChildOptions): HOC => (
*
* @param Child - Component to add as a child
* @param designKey - Design key to reach the Child component using Design API.
* @param componentName - Optional component namespace for design key data attribute.
*
* @return An HOC which will add the Child to the given Parent.
*
Expand All @@ -97,34 +99,42 @@ const insertChild = (Child: CT, options: InsertChildOptions): HOC => (
* ```
*/
const withChild = <P extends object>(
Child: CT, designKey = 'Child',
): HOC<P> => insertChild(Child, { designKey });
Child: CT,
designKey: string = 'Child',
componentName: string = 'Component',
): HOC<P> => insertChild(Child, { designKey, componentName });

/**
* Utility function to append a Child to the given component
* so that the Child can be altered using Design API.
*
* @param Child - Component to add as a child
* @param designKey - Design key to reach the Child component using Design API.
* @param componentName - Optional component namespace for design key data attribute.
*
* @return An HOC which will append the Child to the given Component.
*/
const withAppendChild = <P extends object>(
Child: CT, designKey: string,
): HOC<P> => insertChild(Child, { designKey, mode: 'append' });
Child: CT,
designKey: string,
componentName: string = 'Component',
): HOC<P> => insertChild(Child, { designKey, componentName, mode: 'append' });

/**
* Utility function to prepend a Child to the given component
* so that the Child can be altered using Design API.
*
* @param Child - Component to add as a child
* @param designKey - Design key to reach the Child component using Design API.
* @param componentName - Optional component namespace for design key data attribute.
*
* @return An HOC which will prepend the Child to the given Component.
*/
const withPrependChild = <P extends object>(
Child: CT, designKey: string,
): HOC<P> => insertChild(Child, { designKey, mode: 'prepend' });
Child: CT,
designKey: string,
componentName: string = 'Component',
): HOC<P> => insertChild(Child, { designKey, componentName, mode: 'prepend' });

export default withChild;
export {
Expand Down
9 changes: 7 additions & 2 deletions packages/bodiless-core/src/withParent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { HOC, DesignableComponentsProps, extendDesignable } from '@bodiless/fcla
*
* @param Parent - Component to add as a Parent
* @param designKey - A Design key to reach the Parent. 'Parent' by default.
* @param componentName - Optional component namespace for design key data attribute.
*
* @return An HOC which will wrap the given Child component with provided Parent.
*
Expand All @@ -39,7 +40,11 @@ import { HOC, DesignableComponentsProps, extendDesignable } from '@bodiless/fcla
* )(Child);
* ```
*/
const withParent = (Parent: ComponentType, designKey: string = 'Parent'): HOC => (
const withParent = (
Parent: ComponentType,
designKey: string = 'Parent',
componentName: string = 'Component',
): HOC => (
Component,
) => {
type Components = { [Parent: string]: ComponentType };
Expand All @@ -55,7 +60,7 @@ const withParent = (Parent: ComponentType, designKey: string = 'Parent'): HOC =>
);
};
const applyDesign = extendDesignable(design => omit(design, [designKey]));
return applyDesign(startComponents, designKey)(WithParent) as ComponentType<any>;
return applyDesign(startComponents, componentName)(WithParent) as ComponentType<any>;
};

export default withParent;
2 changes: 1 addition & 1 deletion packages/bodiless-navigation/src/Menu/MenuTitles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
withDesign, startWith, DesignableComponentsProps,
} from '@bodiless/fclasses';

type MenuTitleComponents = {
export type MenuTitleComponents = {
Link: ComponentType<any>,
Title: ComponentType<any>,
};
Expand Down
7 changes: 6 additions & 1 deletion packages/bodiless-navigation/src/Menu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import asTopNav, {
import { useIsMenuOpen, useMenuContext } from './withMenuContext';
import { useSubmenuContext } from './withMenuItemContext';
import { withListSubMenu, withCardsSubMenu, withColumnSubMenu } from './withSubMenu';
import { withMenuTitleEditors, withDefaultMenuTitleEditors, asMenuTitle } from './MenuTitles';
import MenuTitle, {
withMenuTitleEditors, withDefaultMenuTitleEditors, asMenuTitle,
} from './MenuTitles';
import type { MenuTitleComponents } from './MenuTitles';

export {
asBodilessMenu,
Expand All @@ -42,6 +45,8 @@ export {
isMenuContextNotActive,
withMenuTitleEditors,
withDefaultMenuTitleEditors,
MenuTitle,
MenuTitleComponents,
};

export * from './asAccessibleMenu';
31 changes: 29 additions & 2 deletions packages/cx-editors/src/components/RichText/tokens/cxRichText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ import {
DefaultNormalHref,
} from '@bodiless/components';
import { ifComponentSelector } from '@bodiless/layouts';
import { asCxTokenSpec, cxElement } from '@bodiless/cx-elements';
import {
asCxTokenSpec,
cxColor,
cxElement,
cxFontSize,
} from '@bodiless/cx-elements';
import { LinkClean, cxLink } from '@bodiless/cx-link';

const withLinkDeserializer = withHtmlDeserializer(
Expand Down Expand Up @@ -104,4 +109,26 @@ const Default = asCxTokenSpec()({
},
});

export default { Default, AsFlowContainerItem };
const Copyright = asCxTokenSpec()({
...Default,
Spacing: {
paragraph: 'mx-9 py-9 md:mx-0 md:mb-4 md:p-0 lg:mt-2 lg:mb-0 lg:py-0',
},
Theme: {
paragraph: as(
cxColor.TextPrimaryFooterCopy,
cxFontSize.XS,
'border-white-400 border-t border-b md:border-0 lg:text-m-xs',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'border-white-400 border-t border-b md:border-0 lg:text-m-xs',
'border-white-400 border-t border-b md:border-0',

Copy link
Collaborator

@hvanyo hvanyo Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it looks this copyright editor is also getting cxFontSize.BaseSize from original RTE we need to remove.
2022-03-15_17-56-49

Same thing is happening for Links

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in this PR: Guilherme-Almeida-Zeni#10

),
},
Content: {
_: addProps({ placeholder: 'Insert Copyright' }),
},
Compose: {},
});

export default {
Default,
AsFlowContainerItem,
Copyright,
};
3 changes: 3 additions & 0 deletions packages/cx-elements/bodiless.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"_dir": "/doc"
}