diff --git a/packages/web/.storybook/preview.js b/packages/web/.storybook/preview.js index d7478763b..2f79d986a 100644 --- a/packages/web/.storybook/preview.js +++ b/packages/web/.storybook/preview.js @@ -33,7 +33,7 @@ export const decorators = [ __html: getCssText(), }} /> -
+
diff --git a/packages/web/components/elements/Button.tsx b/packages/web/components/elements/Button.tsx index cdc14dac6..d6f24321b 100644 --- a/packages/web/components/elements/Button.tsx +++ b/packages/web/components/elements/Button.tsx @@ -87,6 +87,19 @@ export const Button = styled('button', { cursor: 'pointer', '&:focus': { outline: 'none' }, }, + ctaModal: { + height: '32px', + verticalAlign: 'middle', + color: '$textDefault', + backgroundColor: '$grayBase', + fontWeight: '600', + padding: '0px 12px', + fontSize: '16px', + border: '1px solid $grayBorder', + cursor: 'pointer', + borderRadius: '8px', + '&:focus': { outline: 'none' }, + }, ctaSecondary: { color: '$grayText', border: 'none', diff --git a/packages/web/components/elements/ModalPrimitives.tsx b/packages/web/components/elements/ModalPrimitives.tsx index 3827e020b..1a641bbae 100644 --- a/packages/web/components/elements/ModalPrimitives.tsx +++ b/packages/web/components/elements/ModalPrimitives.tsx @@ -10,6 +10,8 @@ const overlayShow = keyframes({ export const ModalOverlay = styled(Overlay, { backgroundColor: '$overlay', + width: '100vw', + height: '100vh', position: 'fixed', inset: 0, '@media (prefers-reduced-motion: no-preference)': { @@ -37,7 +39,6 @@ export const ModalContent = styled(Modal, { width: '90vw', maxWidth: '600px', maxHeight: '85vh', - p: '$1', '@media (prefers-reduced-motion: no-preference)': { animation: `${contentShow} 150ms cubic-bezier(0.16, 1, 0.3, 1)`, willChange: 'transform', diff --git a/packages/web/components/elements/StyledText.tsx b/packages/web/components/elements/StyledText.tsx index 0df5f3b3b..f5113ffb3 100644 --- a/packages/web/components/elements/StyledText.tsx +++ b/packages/web/components/elements/StyledText.tsx @@ -50,6 +50,24 @@ const textVariants = { color: '$grayText', margin: 0, }, + modalTitle: { + fontSize: '29px', + lineHeight: '37.7px', + color: '$textDefault', + margin: 0, + }, + boldText: { + fontWeight: '600', + fontSize: '16px', + lineHeight: '1', + color: '$textDefault', + }, + shareHighlightModalAnnotation: { + fontSize: '18px', + lineHeight: '23.4px', + color: '$textSubtle', + m: 0, + }, footnote: { fontSize: '$1', }, @@ -81,12 +99,13 @@ const textVariants = { lineHeight: '1.5', cursor: 'pointer', }, - highlightAuthor: { - fontSize: '14px', - fontWeight: '600', - lineHeight: '1.5', + highlightTitleAndAuthor: { + fontSize: '18px', + fontStyle: 'italic', + lineHeight: '22.5px', + letterSpacing: '0.01em', margin: '0px', - color: '$omnivoreGray', + color: '$textSubtle', }, highlightTitle: { fontSize: '14px', diff --git a/packages/web/components/elements/images/CloseIcon.tsx b/packages/web/components/elements/images/CloseIcon.tsx new file mode 100644 index 000000000..0b62251f8 --- /dev/null +++ b/packages/web/components/elements/images/CloseIcon.tsx @@ -0,0 +1,19 @@ +type CloseIconProps = { + size: number + strokeColor: string +} + +export function CloseIcon(props: CloseIconProps): JSX.Element { + return ( + + + + + ) +} diff --git a/packages/web/components/patterns/HighlightView.tsx b/packages/web/components/patterns/HighlightView.tsx index ce2ce746d..2534048ca 100644 --- a/packages/web/components/patterns/HighlightView.tsx +++ b/packages/web/components/patterns/HighlightView.tsx @@ -15,20 +15,25 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { () => props.highlight.quote.split('\n'), [props.highlight.quote] ) + const annotation = props.highlight.annotation ?? ''; const StyledQuote = styled(Blockquote, { - margin: '0px 0px 24px 0px', - fontSize: '14px', - lineHeight: '1.5', - fontFamily: 'Inter', - color: '$omnivoreGray', + margin: '0px 24px 16px 24px', + fontSize: '18px', + lineHeight: '27px', + color: '$textDefault', }) return ( - + + {annotation && ( + + {annotation} + ) + } {props.highlight.prefix} - + {lines.map((line: string, index: number) => ( {line} @@ -43,11 +48,10 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { {props.highlight.suffix} - - {props.author && ( - {props.author} + + {props.author && props.title &&( + {props.title + props.author} )} - {props.title} ) diff --git a/packages/web/components/templates/article/ShareHighlightModal.tsx b/packages/web/components/templates/article/ShareHighlightModal.tsx index 446a07a74..b07433fab 100644 --- a/packages/web/components/templates/article/ShareHighlightModal.tsx +++ b/packages/web/components/templates/article/ShareHighlightModal.tsx @@ -18,7 +18,7 @@ export function ShareHighlightModal( { + setSwitchOn(!switchOn); + } + const iconColor = theme.colors.grayText.toString() + return ( @@ -37,56 +43,84 @@ export function ShareModalLayout( onPointerDownOutside={(event) => { event.preventDefault() }} - css={{ overflow: 'auto', p: '0' }} + css={{ overflow: 'auto', p: '0px', border: '1px solid $grayBorder', boxShadow: 'none'}} > - {props.modalTitle} + {props.modalTitle} {props.children} - SHARE - + Secret URL + + - - - - - - - + + + {switchOn && } + + + + + + + + + + + diff --git a/packages/web/components/tokens/stitches.config.ts b/packages/web/components/tokens/stitches.config.ts index 80a87e59f..0fa83c52c 100644 --- a/packages/web/components/tokens/stitches.config.ts +++ b/packages/web/components/tokens/stitches.config.ts @@ -149,6 +149,12 @@ export const { styled, css, theme, getCssText, globalCss, keyframes, config } = labelButtonsBg: '#F5F5F4', tooltipIcons: '#FDFAEC', + + //utility + textDefault: 'rgba(10, 8, 6, 0.8)', + textSubtle: 'rgba(10, 8, 6, 0.65)', + textNonEssential: 'rgba(10, 8, 6, 0.4)', + overlay: 'rgba(63, 62, 60, 0.2)', }, }, media: { @@ -195,6 +201,13 @@ const darkThemeSpec = { avatarBg: '#000000', avatarFont: 'rgba(255, 255, 255, 0.8)', + + //utility + textDefault: 'rgba(255, 255, 255, 0.8)', + textSubtle: 'rgba(255, 255, 255, 0.65)', + textNonEssential: 'rgba(10, 8, 6, 0.4)', + overlay: 'rgba(10, 8, 6, 0.65)', + labelButtonsBg: '#5F5E58', }, shadows: { diff --git a/packages/web/stories/ShareHighlightModal.stories.tsx b/packages/web/stories/ShareHighlightModal.stories.tsx new file mode 100644 index 000000000..593a2f55b --- /dev/null +++ b/packages/web/stories/ShareHighlightModal.stories.tsx @@ -0,0 +1,97 @@ +import { ComponentStory, ComponentMeta } from '@storybook/react' +import {ShareHighlightModal} from '../components/templates/article/ShareHighlightModal'; +import { Highlight } from '../lib/networking/fragments/highlightFragment'; +import { updateThemeLocally } from '../lib/themeUpdater'; +import { ThemeId } from '../components/tokens/stitches.config'; + +export default { + title: 'Components/ShareHighlightModal', + parameters: { + previewTabs: { + 'storybook/docs/panel': { hidden: true } + }, + viewMode: 'canvas', + }, + component: ShareHighlightModal, + argTypes: { + author: {control: 'text'}, + title: {control: 'text'}, + }, +} as ComponentMeta + +const Template = (props: {highlight: Highlight, handleOpenChange: () => void, title: string, author: string}) => { + return ( + props.handleOpenChange()} + /> +)} + +const highlight: Highlight = { + id: "nnnnn", + shortId: "shortId", + quote: "children not only participate in herding work, but are also encouraged to act independently in most other areas of life. They have a say in deciding when to eat, when to sleep, and what to wear, even at temperatures of -30C (-22F).", + patch: "patchhhhhhy", + createdByMe: true, + updatedAt: '123', + sharedAt: '123', + prefix: "Among the Sami, an indigenous people spread across the northernmost regions of Norway, Sweden, Finland and Russia's Kola Peninsula,", + suffix: ' To outsiders, that independence can be surprising. Missionaries who visited the Arctic in the 18th Century and later, wrote in their diaries that it seemed like Sámi children could do whatever they liked, and that they lacked discipline altogether.', +} + +const highlightWithAnnotation: Highlight = { + ...highlight, + annotation: "Okay… this is wild! I love this independence. Wondering how I can reponsibly instill this type of indepence in my own kids…", +} + +export const LightShareHightlightModal: ComponentStory = (args: any) => { + updateThemeLocally(ThemeId.Light); + highlight.annotation = undefined; + return ( +