import classNames from 'classnames' import * as React from 'react' import { Repeater, RichText, types } from 'react-bricks/rsc' import { backgroundWithImageBgSideGroup, highlightTextEditProps, LayoutProps, paddingBordersSideGroup, sectionDefaults, textGradientEditProps, } from '../../LayoutSideProps' import blockNames from '../../blockNames' import { bgColors, buttonColors, gradients, highlightTextColors, textColors, } from '../../colors' import Container from '../../shared/components/Container' import Section from '../../shared/components/Section' import { ButtonProps } from '../../shared/bricks/Button' export interface HeroUnitProps extends LayoutProps { textGradient: keyof typeof gradients highlightTextColor: { color: string; className: string } title: types.TextValue text: types.TextValue buttons: types.RepeaterItems badge: types.RepeaterItems } const HeroUnit2: types.Brick = ({ backgroundColor, backgroundImage, borderTop, borderBottom, paddingTop, paddingBottom, textGradient, highlightTextColor, title, text, buttons, badge, }: HeroUnitProps) => { const titleColor = textColors.GRAY_800 const textColor = textColors.GRAY_700 const titleStyle = textGradient !== gradients.NONE.value ? { WebkitTextFillColor: 'transparent' } : {} return (
{items}
} />
(

{props.children}

)} allowedFeatures={[types.RichTextFeatures.Highlight]} placeholder="Type a title..." renderHighlight={({ children }) => ( {children} )} />
(

{props.children}

)} placeholder="Type a text..." allowedFeatures={[types.RichTextFeatures.Bold]} /> (
{items}
)} />
) } HeroUnit2.schema = { name: blockNames.HeroUnit2, label: 'Horizontal Hero', category: 'hero sections', tags: ['hero unit', 'horizontal hero', 'title'], playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-app/src/heroSections/HeroUnit2/HeroUnit2.tsx', previewImageUrl: `/bricks-preview-images/${blockNames.HeroUnit2}.png`, getDefaultProps: () => ({ ...sectionDefaults, paddingTop: '20', paddingBottom: '16', textGradient: gradients.NONE.value, highlightTextColor: highlightTextColors.PINK.value, title: [ { type: 'paragraph', children: [ { text: 'We develop ', }, { text: 'beautiful', highlight: true, }, { text: ' web applications', }, ], }, ], text: "We are a hi-tech web development company committed to deliver great products on time. We love to understand our customers' needs and exceed expectations.", buttons: [ { type: 'link', text: 'Get Started now', href: '', isTargetBlank: false, buttonType: 'submit', buttonColor: buttonColors.SKY.value, variant: 'solid', padding: 'normal', simpleAnchorLink: false, }, { type: 'link', text: 'Watch demo', href: '', isTargetBlank: false, buttonType: 'submit', buttonColor: buttonColors.SKY.value, variant: 'outline', padding: 'normal', simpleAnchorLink: false, }, ], }), repeaterItems: [ { name: 'badge', itemType: blockNames.Badge, itemLabel: 'Badge', min: 0, max: 1, }, { name: 'buttons', itemType: blockNames.Button, itemLabel: 'Button', min: 0, max: 2, }, ], sideEditProps: [ { groupName: 'Title', defaultOpen: true, props: [textGradientEditProps, highlightTextEditProps], }, backgroundWithImageBgSideGroup, paddingBordersSideGroup, ], stories: [ { id: 'horizontal-hero-dark', name: 'Horizontal Hero Dark', showAsBrick: true, previewImageUrl: `/bricks-preview-images/horizontal-hero-dark.png`, props: { ...sectionDefaults, paddingTop: '20', paddingBottom: '16', backgroundColor: bgColors.DARK_GRAY.value, textGradient: gradients.NONE.value, highlightTextColor: highlightTextColors.LIME.value, title: [ { type: 'paragraph', children: [ { text: 'Great ', }, { text: 'DX', highlight: true, }, { text: ' for Developers, great ', }, { text: 'UX', highlight: true, }, { text: ' for Content editors.', }, ], }, ], text: "Forget grey fields, welcome visual editing. Forget going back and forth between the CMS and your editor: it's just React. Enterprise-ready.", buttons: [ { type: 'link', text: 'Tutorial', href: 'https://reactbricks.com/learn', isTargetBlank: true, buttonType: 'submit', buttonColor: buttonColors.SKY.value, variant: 'solid', padding: 'normal', simpleAnchorLink: false, }, { type: 'link', text: 'View the Docs', href: 'https://docs.reactbricks.com/', isTargetBlank: true, buttonType: 'submit', buttonColor: buttonColors.SKY.value, variant: 'outline', padding: 'normal', simpleAnchorLink: false, }, ], }, }, ], } export default HeroUnit2