@sfgov/design-system 0.0.0-2b1f226
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/babel.config.js +16 -0
- package/css/.eslintrc.js +26 -0
- package/css/babel.config.js +6 -0
- package/css/lib/tailwind/details.js +14 -0
- package/css/package-lock.json +35561 -0
- package/css/src/base.css +26 -0
- package/css/src/components/button.css +61 -0
- package/css/src/components/details.css +10 -0
- package/css/src/components/grid.css +12 -0
- package/css/src/components/index.css +4 -0
- package/css/src/components/kbd.css +5 -0
- package/css/src/components.css +1 -0
- package/css/src/fonts.css +1 -0
- package/css/src/icons.css +7 -0
- package/css/src/overrides.css +3 -0
- package/css/src/sfds.css +6 -0
- package/css/src/theme.js +104 -0
- package/css/src/tokens/breakpoints.js +5 -0
- package/css/src/tokens/colors.js +116 -0
- package/css/src/tokens/index.js +8 -0
- package/css/src/tokens/spacing.js +27 -0
- package/css/src/tokens/typography.js +66 -0
- package/css/src/tokens/widths.js +11 -0
- package/css/src/typography.css +103 -0
- package/css/src/utilities.css +1 -0
- package/dist/css/base.css +2 -0
- package/dist/css/base.css.map +1 -0
- package/dist/css/components.css +2 -0
- package/dist/css/components.css.map +1 -0
- package/dist/css/fonts.css +2 -0
- package/dist/css/fonts.css.map +1 -0
- package/dist/css/icons.css +2 -0
- package/dist/css/icons.css.map +1 -0
- package/dist/css/overrides.css +2 -0
- package/dist/css/overrides.css.map +1 -0
- package/dist/css/sfds.css +2 -0
- package/dist/css/sfds.css.map +1 -0
- package/dist/css/typography.css +2 -0
- package/dist/css/typography.css.map +1 -0
- package/dist/css/utilities.css +2 -0
- package/dist/css/utilities.css.map +1 -0
- package/dist/css/utilities.json +7350 -0
- package/dist/elements/index.d.mts +30 -0
- package/dist/elements/index.d.mts.map +1 -0
- package/dist/elements/index.d.ts +30 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/index.js +1 -0
- package/dist/elements/index.mjs +1 -0
- package/dist/manifest.json +45 -0
- package/dist/react/index.d.mts +5725 -0
- package/dist/react/index.d.mts.map +1 -0
- package/dist/react/index.d.ts +5725 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +1 -0
- package/dist/react/index.mjs +1 -0
- package/elements/.eslintrc.js +6 -0
- package/elements/index.js +1 -0
- package/elements/index.mjs +1 -0
- package/elements/src/index.js +7 -0
- package/elements/src/sfgov-icon.js +109 -0
- package/icons/.eslintrc.js +23 -0
- package/icons/index.json +439 -0
- package/icons/svg/accessibility.svg +4 -0
- package/icons/svg/alert.svg +5 -0
- package/icons/svg/archive.svg +4 -0
- package/icons/svg/arrow-down.svg +3 -0
- package/icons/svg/arrow-left.svg +3 -0
- package/icons/svg/arrow-right.svg +3 -0
- package/icons/svg/arrow-up.svg +3 -0
- package/icons/svg/building.svg +7 -0
- package/icons/svg/calendar.svg +3 -0
- package/icons/svg/caution.svg +3 -0
- package/icons/svg/chart.svg +6 -0
- package/icons/svg/check.svg +3 -0
- package/icons/svg/chevron-down.svg +3 -0
- package/icons/svg/chevron-left.svg +3 -0
- package/icons/svg/chevron-right.svg +3 -0
- package/icons/svg/chevron-up.svg +3 -0
- package/icons/svg/clock.svg +4 -0
- package/icons/svg/close.svg +3 -0
- package/icons/svg/document.svg +3 -0
- package/icons/svg/globe.svg +3 -0
- package/icons/svg/hamburger-button.svg +5 -0
- package/icons/svg/index.json +346 -0
- package/icons/svg/info.svg +5 -0
- package/icons/svg/location.svg +4 -0
- package/icons/svg/mail.svg +3 -0
- package/icons/svg/minus.svg +3 -0
- package/icons/svg/pencil.svg +3 -0
- package/icons/svg/phone.svg +3 -0
- package/icons/svg/plus.svg +3 -0
- package/icons/svg/question.svg +4 -0
- package/icons/svg/search.svg +3 -0
- package/icons/svg/wip.svg +3 -0
- package/lib/markdownlint/frontmatter.js +51 -0
- package/lib/markdownlint/no-empty.js +19 -0
- package/package.json +352 -0
- package/postcss.config.js +17 -0
- package/react/README.md +36 -0
- package/react/index.js +1 -0
- package/react/index.mjs +1 -0
- package/react/scripts/wrap-icons.mjs +25 -0
- package/react/src/components/Box.tsx +6 -0
- package/react/src/components/Button.tsx +94 -0
- package/react/src/components/Container.tsx +19 -0
- package/react/src/components/Flex.tsx +16 -0
- package/react/src/components/GlobalStyle.tsx +35 -0
- package/react/src/components/GoogleFonts.tsx +67 -0
- package/react/src/components/Grid.tsx +15 -0
- package/react/src/components/SSRStyle.tsx +47 -0
- package/react/src/components/SVGIcon.tsx +42 -0
- package/react/src/components/Text.tsx +78 -0
- package/react/src/components/Tile.tsx +93 -0
- package/react/src/components/index.ts +11 -0
- package/react/src/components/page/AboutSection.tsx +90 -0
- package/react/src/components/page/AgencyHeader.tsx +56 -0
- package/react/src/components/page/ArchiveInformation.tsx +43 -0
- package/react/src/components/page/ContactSection.tsx +92 -0
- package/react/src/components/page/Section.tsx +53 -0
- package/react/src/components/page/Spotlight.tsx +70 -0
- package/react/src/components/page/index.ts +6 -0
- package/react/src/constants.ts +48 -0
- package/react/src/icons/IconAccessibility.jsx +3 -0
- package/react/src/icons/IconAlert.jsx +3 -0
- package/react/src/icons/IconArchive.jsx +3 -0
- package/react/src/icons/IconArrowDown.jsx +3 -0
- package/react/src/icons/IconArrowLeft.jsx +3 -0
- package/react/src/icons/IconArrowRight.jsx +3 -0
- package/react/src/icons/IconArrowUp.jsx +3 -0
- package/react/src/icons/IconBuilding.jsx +3 -0
- package/react/src/icons/IconCalendar.jsx +3 -0
- package/react/src/icons/IconCaution.jsx +3 -0
- package/react/src/icons/IconChart.jsx +3 -0
- package/react/src/icons/IconCheck.jsx +3 -0
- package/react/src/icons/IconChevronDown.jsx +3 -0
- package/react/src/icons/IconChevronLeft.jsx +3 -0
- package/react/src/icons/IconChevronRight.jsx +3 -0
- package/react/src/icons/IconChevronUp.jsx +3 -0
- package/react/src/icons/IconClock.jsx +3 -0
- package/react/src/icons/IconClose.jsx +3 -0
- package/react/src/icons/IconDocument.jsx +3 -0
- package/react/src/icons/IconGlobe.jsx +3 -0
- package/react/src/icons/IconHamburgerButton.jsx +3 -0
- package/react/src/icons/IconInfo.jsx +3 -0
- package/react/src/icons/IconLocation.jsx +3 -0
- package/react/src/icons/IconMail.jsx +3 -0
- package/react/src/icons/IconMinus.jsx +3 -0
- package/react/src/icons/IconPencil.jsx +3 -0
- package/react/src/icons/IconPhone.jsx +3 -0
- package/react/src/icons/IconPlus.jsx +3 -0
- package/react/src/icons/IconQuestion.jsx +3 -0
- package/react/src/icons/IconSearch.jsx +3 -0
- package/react/src/icons/IconWIP.jsx +3 -0
- package/react/src/icons/index.js +31 -0
- package/react/src/icons/index.json +346 -0
- package/react/src/icons.tsx +34 -0
- package/react/src/index.ts +4 -0
- package/react/src/stitches.config.ts +85 -0
- package/react/src/theme/breakpoints.ts +14 -0
- package/react/src/theme/colors.ts +34 -0
- package/react/src/theme/index.tsx +31 -0
- package/react/src/theme/space.ts +16 -0
- package/react/src/theme/typography.ts +136 -0
- package/react/src/types.ts +31 -0
- package/react/src/utils.tsx +25 -0
- package/rollup.config.mjs +72 -0
- package/svgo.config.js +27 -0
- package/tailwind.config.js +5 -0
- package/tailwind.preset.js +128 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { styled } from '../stitches.config'
|
|
2
|
+
import { Box } from './Box'
|
|
3
|
+
import type { VariantProps } from '../utils'
|
|
4
|
+
|
|
5
|
+
export const Grid = styled(Box, {
|
|
6
|
+
display: 'grid',
|
|
7
|
+
gridTemplateColumns: 'repeat(6, minmax(0, 1fr))',
|
|
8
|
+
gap: 20,
|
|
9
|
+
'@md': {
|
|
10
|
+
gridTemplateColumns: 'repeat(12, minmax(0, 1fr))',
|
|
11
|
+
gap: 28
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export type GridProps = VariantProps<typeof Grid>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { ComponentProps } from 'react'
|
|
2
|
+
import { getGooglePreloadLinks, GoogleFontsPreloadStyles } from './GoogleFonts'
|
|
3
|
+
import { getCssText, reset } from '../stitches.config'
|
|
4
|
+
import type { GlobalCSSProps } from '../types'
|
|
5
|
+
|
|
6
|
+
export type SSRStyleProps = Omit<ComponentProps<'style'>, 'dangerouslySetInnerHTML'> & GlobalCSSProps
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The SSR (Server Side Render) styles component is necessary for avoiding
|
|
10
|
+
* the FOUC (Flash of Unstyled Content) when rendering server-side then
|
|
11
|
+
* hydrating on the client. It does a couple of things:
|
|
12
|
+
*
|
|
13
|
+
* 1. It adds all of the requisite <link> elements to preload Google Fonts
|
|
14
|
+
* 2. It collects any "critical path" CSS rendered by our Stitches instance
|
|
15
|
+
* (since the last call to reset(), which prevents accumulation of CSS
|
|
16
|
+
* from other pages when running in a server that renders multiple pages
|
|
17
|
+
* in the same process.
|
|
18
|
+
* 3. It renders a <style> element with the critical path CSS and passes
|
|
19
|
+
* along any additional props.
|
|
20
|
+
*
|
|
21
|
+
* The objects can also be used to generate static HTML outside of React.
|
|
22
|
+
* @param props
|
|
23
|
+
* @returns a fragment suitable for use in <head>, Helmet, next/head, etc.
|
|
24
|
+
*/
|
|
25
|
+
export function SSRStyle ({ fonts, ...rest }: SSRStyleProps) {
|
|
26
|
+
const css = getCssText()
|
|
27
|
+
reset()
|
|
28
|
+
return <>
|
|
29
|
+
<GoogleFontsPreloadStyles fonts={fonts} />
|
|
30
|
+
<style id='sfgov-ssr-css' {...rest} dangerouslySetInnerHTML={{ __html: css }} />
|
|
31
|
+
</>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* This function returns an array of <link> element attributes (or React props)
|
|
36
|
+
* that should be included in the <head> of server-rendered documents to preload
|
|
37
|
+
* Google Fonts CSS for optimal performance and display.
|
|
38
|
+
*
|
|
39
|
+
* @param props An optional object containing a Google Fonts spec in `googleFonts`
|
|
40
|
+
* listing the fonts to be loaded.
|
|
41
|
+
* @returns an array of <link> attribute/props objects
|
|
42
|
+
*/
|
|
43
|
+
export function getPreloadLinks (props?: SSRStyleProps) {
|
|
44
|
+
return [
|
|
45
|
+
...getGooglePreloadLinks(props?.fonts)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentType } from 'react'
|
|
2
|
+
import { styled } from '../stitches.config'
|
|
3
|
+
import { withFixedProps } from '../utils'
|
|
4
|
+
|
|
5
|
+
export type SVGProps = ComponentProps<'svg'>
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SVGIcon is the vehicle for SVG icon styles without the content.
|
|
9
|
+
* To render a specific SVG icon, pass it to the `as` prop as a component.
|
|
10
|
+
*/
|
|
11
|
+
export const SVGIcon = styled('svg', {
|
|
12
|
+
fill: 'currentcolor',
|
|
13
|
+
'[stroke-width]': {
|
|
14
|
+
stroke: 'currentcolor'
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export type SVGIconProps = SVGProps & {
|
|
19
|
+
as: ComponentType<SVGProps>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Size = { width: number, height: number }
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create a styled icon component from an unstyled SVG component by wrapping it
|
|
26
|
+
* in a function that renders `<SVGIcon>` with `as={component}`.
|
|
27
|
+
*
|
|
28
|
+
* @param IconComponent the SVG component to render
|
|
29
|
+
* @param viewBox an optional array of numbers representing the visual bounding box
|
|
30
|
+
* of the SVG, e.g. `[0, 0, 20, 20]`. This sets the default `width` prop, which
|
|
31
|
+
* establishes a proportional height according to browser intrinsic aspect ratio rules.
|
|
32
|
+
*/
|
|
33
|
+
export function createStyledIcon (IconComponent: ComponentType<SVGProps>, size?: Size) {
|
|
34
|
+
const Icon = withFixedProps(SVGIcon, { as: IconComponent })
|
|
35
|
+
return Object.assign(Icon, {
|
|
36
|
+
displayName: IconComponent.displayName || IconComponent.name,
|
|
37
|
+
size,
|
|
38
|
+
defaultProps: size
|
|
39
|
+
? { width: size.width }
|
|
40
|
+
: {}
|
|
41
|
+
})
|
|
42
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentType } from 'react'
|
|
2
|
+
import { textStyles } from '../theme/typography'
|
|
3
|
+
import { CSS, styled } from '../stitches.config'
|
|
4
|
+
import { withFixedProps, VariantProps } from '../utils'
|
|
5
|
+
|
|
6
|
+
export type TextVariant =
|
|
7
|
+
'body' | 'small' | 'bigDesc' |
|
|
8
|
+
'titleXs' | 'titleSm' | 'titleMd' | 'titleLg' | 'titleXl' |
|
|
9
|
+
'displaySm' | 'displayLg' | 'mono'
|
|
10
|
+
|
|
11
|
+
export const Text = styled('div', {
|
|
12
|
+
m: 0,
|
|
13
|
+
// Chinese text should be rendered in Noto Sans TC,
|
|
14
|
+
// with bold font weights at 500 (not 600)
|
|
15
|
+
'&:lang(zh)': {
|
|
16
|
+
fontFamily: '$chinese',
|
|
17
|
+
$fontWeights$bold: '$fontWeights$boldChinese',
|
|
18
|
+
letterSpacing: '0 !important'
|
|
19
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
body: textStyles.body,
|
|
23
|
+
small: textStyles.small,
|
|
24
|
+
bigDesc: {
|
|
25
|
+
...textStyles.bigDesc,
|
|
26
|
+
'@lg': textStyles.bigDescDesktop
|
|
27
|
+
},
|
|
28
|
+
titleXs: textStyles.titleXs,
|
|
29
|
+
titleSm: textStyles.titleSm,
|
|
30
|
+
titleMd: {
|
|
31
|
+
...textStyles.titleMd,
|
|
32
|
+
'@lg': textStyles.titleMdDesktop
|
|
33
|
+
},
|
|
34
|
+
titleLg: {
|
|
35
|
+
...textStyles.titleLg,
|
|
36
|
+
'@lg': textStyles.titleLgDesktop
|
|
37
|
+
},
|
|
38
|
+
titleXl: {
|
|
39
|
+
...textStyles.titleXl,
|
|
40
|
+
'@lg': textStyles.titleXlDesktop
|
|
41
|
+
},
|
|
42
|
+
displaySm: {
|
|
43
|
+
...textStyles.displaySm,
|
|
44
|
+
'@lg': textStyles.displaySmDesktop
|
|
45
|
+
},
|
|
46
|
+
displayLg: {
|
|
47
|
+
...textStyles.displayLg,
|
|
48
|
+
'@lg': textStyles.displayLgDesktop
|
|
49
|
+
},
|
|
50
|
+
mono: {
|
|
51
|
+
...textStyles.body,
|
|
52
|
+
fontFamily: '$monospace'
|
|
53
|
+
}
|
|
54
|
+
} as Record<TextVariant, CSS>
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
variant: 'body'
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
export type TextProps = VariantProps<ComponentProps<typeof Text>>
|
|
62
|
+
type TextPropsNoVariant = Omit<TextProps, 'variant'>
|
|
63
|
+
|
|
64
|
+
export const BodyText = createVariant('body')
|
|
65
|
+
export const SmallText = createVariant('small')
|
|
66
|
+
export const BigDesc = createVariant('bigDesc')
|
|
67
|
+
export const TitleXs = createVariant('titleXs')
|
|
68
|
+
export const TitleSm = createVariant('titleSm')
|
|
69
|
+
export const TitleMd = createVariant('titleMd')
|
|
70
|
+
export const TitleLg = createVariant('titleLg')
|
|
71
|
+
export const TitleXl = createVariant('titleXl')
|
|
72
|
+
export const DisplaySm = createVariant('displaySm')
|
|
73
|
+
export const DisplayLg = createVariant('displayLg')
|
|
74
|
+
export const Monospace = createVariant('mono')
|
|
75
|
+
|
|
76
|
+
function createVariant (variant: TextVariant) {
|
|
77
|
+
return withFixedProps(Text, { variant }) as ComponentType<TextPropsNoVariant>
|
|
78
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react'
|
|
2
|
+
import { Flex } from './Flex'
|
|
3
|
+
import { Grid } from './Grid'
|
|
4
|
+
import { SmallText, TitleLg, TitleMd, TitleXs } from './Text'
|
|
5
|
+
import { styled } from '../stitches.config'
|
|
6
|
+
import { IconArrowRight, IconCalendar, IconDocument } from '../icons'
|
|
7
|
+
|
|
8
|
+
type TileProps = {
|
|
9
|
+
title: string;
|
|
10
|
+
body: string;
|
|
11
|
+
href: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
interface EventTileProps extends TileProps {
|
|
15
|
+
imgSrc?: string;
|
|
16
|
+
eventType: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const TileSection = styled(Grid, {
|
|
20
|
+
mb: 60,
|
|
21
|
+
gridTemplateColumns: 'repeat(1, minmax(0, 1fr))',
|
|
22
|
+
'@md': {
|
|
23
|
+
gridTemplateColumns: 'repeat(3, minmax(0, 1fr))'
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const TileContainer = styled(Flex, {
|
|
28
|
+
justifyContent: 'space-between',
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
flexDirection: 'column',
|
|
31
|
+
color: '$slateL3',
|
|
32
|
+
textDecorationLine: 'none',
|
|
33
|
+
'@md': {
|
|
34
|
+
flexDirection: 'row'
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const ContentWrapper = styled('div', {
|
|
39
|
+
p: 20
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const TileTitle = styled(TitleXs, {
|
|
43
|
+
mb: 20
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const BaseTile = ({ href, children }) => (
|
|
47
|
+
<TileContainer as='a' href={href}>
|
|
48
|
+
<ContentWrapper>{children}</ContentWrapper>
|
|
49
|
+
</TileContainer>
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
export const NewsTile = ({ title, body, href }: TileProps) => (
|
|
53
|
+
<BaseTile href={href}>
|
|
54
|
+
<TileTitle>{title}</TileTitle>
|
|
55
|
+
<div>{body}</div>
|
|
56
|
+
</BaseTile>
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
export const ContentTile = ({ title, body, href }: TileProps) => (
|
|
60
|
+
<BaseTile href={href}>
|
|
61
|
+
<TileTitle>{title}</TileTitle>
|
|
62
|
+
<div>{body}</div>
|
|
63
|
+
<IconArrowRight />
|
|
64
|
+
</BaseTile>
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
export const QuickLink = ({ title, body, href }: TileProps) => (
|
|
68
|
+
<BaseTile href={href}>
|
|
69
|
+
<IconDocument />
|
|
70
|
+
<TitleLg css={{ my: 12 }}>{title}</TitleLg>
|
|
71
|
+
<div>{body}</div>
|
|
72
|
+
<IconArrowRight />
|
|
73
|
+
</BaseTile>
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
export const EventTile = ({
|
|
77
|
+
title,
|
|
78
|
+
body,
|
|
79
|
+
href,
|
|
80
|
+
imgSrc,
|
|
81
|
+
eventType
|
|
82
|
+
}: EventTileProps) => (
|
|
83
|
+
<BaseTile href={href}>
|
|
84
|
+
{/* <img src={imgSrc ? imgSrc : placeholder} /> */}
|
|
85
|
+
<div>an image will go here</div>
|
|
86
|
+
<Flex>
|
|
87
|
+
<IconCalendar />
|
|
88
|
+
<SmallText>{eventType}</SmallText>
|
|
89
|
+
</Flex>
|
|
90
|
+
<TitleMd css={{ my: 12 }}>{title}</TitleMd>
|
|
91
|
+
<div>{body}</div>
|
|
92
|
+
</BaseTile>
|
|
93
|
+
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './Box'
|
|
2
|
+
export * from './Button'
|
|
3
|
+
export * from './Container'
|
|
4
|
+
export * from './Flex'
|
|
5
|
+
export * from './GlobalStyle'
|
|
6
|
+
export * from './Grid'
|
|
7
|
+
export * from './page'
|
|
8
|
+
export * from './SVGIcon'
|
|
9
|
+
export * from './SSRStyle'
|
|
10
|
+
export * from './Text'
|
|
11
|
+
export * from './Tile'
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react'
|
|
2
|
+
import { Flex } from '../Flex'
|
|
3
|
+
import { Grid } from '../Grid'
|
|
4
|
+
import { Section, SectionTitle } from './Section'
|
|
5
|
+
import { SmallText, TitleLg, TitleMd, TitleXs } from '../Text'
|
|
6
|
+
import { styled } from '../../stitches.config'
|
|
7
|
+
|
|
8
|
+
interface RelatedBodiesType {
|
|
9
|
+
id: number;
|
|
10
|
+
href: string;
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AboutSectionProps = {
|
|
15
|
+
about: string;
|
|
16
|
+
ctaTitle: string;
|
|
17
|
+
ctaComponent: React.ReactNode | string;
|
|
18
|
+
divisions?: RelatedBodiesType[];
|
|
19
|
+
relatedDivisions?: RelatedBodiesType[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const AboutContainer = styled(Flex, {
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
flexDirection: 'column',
|
|
25
|
+
marginBottom: 60,
|
|
26
|
+
gap: 60,
|
|
27
|
+
'@md': {
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
'& > *': {
|
|
30
|
+
width: '50%'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const FlexColumn = styled(Flex, {
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
gap: 40
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const BodiesSection = ({ sectionTitle, divisions }) => (
|
|
41
|
+
<div>
|
|
42
|
+
<TitleXs>{sectionTitle}</TitleXs>
|
|
43
|
+
<Flex css={{ flexWrap: 'wrap', gap: 28, marginTop: 20 }}>
|
|
44
|
+
{divisions.map((division) => (
|
|
45
|
+
<a key={division.id} href={division.href}>
|
|
46
|
+
{division.title}
|
|
47
|
+
</a>
|
|
48
|
+
))}
|
|
49
|
+
</Flex>
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
export const AboutSection = (args: AboutSectionProps) => (
|
|
54
|
+
<Section>
|
|
55
|
+
<SectionTitle title='About' />
|
|
56
|
+
<AboutContent {...args} />
|
|
57
|
+
</Section>
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
const AboutContent = ({
|
|
61
|
+
about,
|
|
62
|
+
ctaTitle,
|
|
63
|
+
ctaComponent,
|
|
64
|
+
divisions,
|
|
65
|
+
relatedDivisions
|
|
66
|
+
}: AboutSectionProps) => (
|
|
67
|
+
<AboutContainer>
|
|
68
|
+
<FlexColumn>
|
|
69
|
+
<TitleXs>{about}</TitleXs>
|
|
70
|
+
<div>
|
|
71
|
+
<TitleXs>{ctaTitle}</TitleXs>
|
|
72
|
+
{/*
|
|
73
|
+
For the call to action below, we should probably define
|
|
74
|
+
a series of variants (e.g. Button | SignUp | ...) to choose
|
|
75
|
+
from that are implemented in this component. We'll need to
|
|
76
|
+
know possible values from the CMS, then an API can be designed on our end.
|
|
77
|
+
*/}
|
|
78
|
+
{ctaComponent}
|
|
79
|
+
</div>
|
|
80
|
+
</FlexColumn>
|
|
81
|
+
<FlexColumn>
|
|
82
|
+
{!!divisions?.length && (
|
|
83
|
+
<BodiesSection sectionTitle='Divisions' divisions={divisions} />
|
|
84
|
+
)}
|
|
85
|
+
{!!relatedDivisions?.length && (
|
|
86
|
+
<BodiesSection sectionTitle='Related' divisions={relatedDivisions} />
|
|
87
|
+
)}
|
|
88
|
+
</FlexColumn>
|
|
89
|
+
</AboutContainer>
|
|
90
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Container } from '../Container'
|
|
3
|
+
import { Flex } from '../Flex'
|
|
4
|
+
import { TitleXl } from '../Text'
|
|
5
|
+
import { IconLocation, IconPhone } from '../../icons'
|
|
6
|
+
|
|
7
|
+
interface ParentAgencyFragment {
|
|
8
|
+
id: number;
|
|
9
|
+
title: string;
|
|
10
|
+
href: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ContactFragment {
|
|
14
|
+
address: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type AgencyHeaderProps = {
|
|
19
|
+
title: string;
|
|
20
|
+
subtitle: string;
|
|
21
|
+
parentAgencies?: ParentAgencyFragment[];
|
|
22
|
+
contact: ContactFragment;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const AgencyHeader = ({
|
|
26
|
+
title,
|
|
27
|
+
subtitle,
|
|
28
|
+
parentAgencies,
|
|
29
|
+
contact
|
|
30
|
+
}: AgencyHeaderProps) => (
|
|
31
|
+
<Container css={{ px: 20, '@md': { px: 96 } }}>
|
|
32
|
+
<TitleXl>{title}</TitleXl>
|
|
33
|
+
<div>{subtitle}</div>
|
|
34
|
+
{!!parentAgencies && (
|
|
35
|
+
<div>
|
|
36
|
+
Part of{' '}
|
|
37
|
+
{parentAgencies.map((agency, i) => [
|
|
38
|
+
i > 0 && ', ',
|
|
39
|
+
<a key={agency.id} href='#'>
|
|
40
|
+
{agency.title}
|
|
41
|
+
</a>
|
|
42
|
+
])}
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
<Flex>
|
|
46
|
+
<div>
|
|
47
|
+
<IconLocation />
|
|
48
|
+
{contact.address}
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<IconPhone />
|
|
52
|
+
{contact.phone}
|
|
53
|
+
</div>
|
|
54
|
+
</Flex>
|
|
55
|
+
</Container>
|
|
56
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Container } from '../Container'
|
|
3
|
+
import { Flex } from '../Flex'
|
|
4
|
+
import { TitleMd } from '../Text'
|
|
5
|
+
|
|
6
|
+
export type ArchiveInformationProps = {
|
|
7
|
+
agencyName: string;
|
|
8
|
+
email: string;
|
|
9
|
+
archiveURL: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const ArchiveInformation = ({
|
|
13
|
+
agencyName,
|
|
14
|
+
email,
|
|
15
|
+
archiveURL
|
|
16
|
+
}: ArchiveInformationProps) => (
|
|
17
|
+
<Container css={{ bg: '$greyL1', p: 40 }}>
|
|
18
|
+
<Flex css={{ gap: 20 }}>
|
|
19
|
+
<div>
|
|
20
|
+
<TitleMd>Request public record</TitleMd>
|
|
21
|
+
<p>
|
|
22
|
+
<a href={ `mailto:${email}` }>
|
|
23
|
+
Email {email}
|
|
24
|
+
</a>{' '}
|
|
25
|
+
to submit a request to {agencyName}
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
<div>
|
|
29
|
+
<TitleMd>Archived website</TitleMd>
|
|
30
|
+
<p>
|
|
31
|
+
<a
|
|
32
|
+
target='_blank'
|
|
33
|
+
href={archiveURL}
|
|
34
|
+
rel='noreferrer'
|
|
35
|
+
>
|
|
36
|
+
See previous website
|
|
37
|
+
</a>{' '}
|
|
38
|
+
archived August 2022.
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
</Flex>
|
|
42
|
+
</Container>
|
|
43
|
+
)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Flex } from '../Flex'
|
|
3
|
+
import { Section, SectionTitle } from './Section'
|
|
4
|
+
import { styled } from '../../stitches.config'
|
|
5
|
+
import { IconGlobe, IconLocation, IconMail, IconPhone } from '../../icons'
|
|
6
|
+
import { TitleXs } from '../Text'
|
|
7
|
+
|
|
8
|
+
type ContactContentProps = {
|
|
9
|
+
// TODO: Refine these types when we get more clarity on a JSON object model
|
|
10
|
+
address?: any;
|
|
11
|
+
phone?: any;
|
|
12
|
+
email?: any;
|
|
13
|
+
social?: any;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const ContactSection = (args) => (
|
|
17
|
+
<Section>
|
|
18
|
+
<SectionTitle title='Contact' />
|
|
19
|
+
<ContactContent {...args} />
|
|
20
|
+
</Section>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const InnerSectionTitle = styled(Flex, {
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
gap: 8,
|
|
26
|
+
marginBottom: 30
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const ContactContent = ({
|
|
30
|
+
address,
|
|
31
|
+
phone,
|
|
32
|
+
email,
|
|
33
|
+
social
|
|
34
|
+
}: ContactContentProps) => (
|
|
35
|
+
<Flex css={{ justifyContent: 'space-between' }}>
|
|
36
|
+
{address && (
|
|
37
|
+
<div>
|
|
38
|
+
<InnerSectionTitle>
|
|
39
|
+
<IconLocation />
|
|
40
|
+
<TitleXs>Visit</TitleXs>
|
|
41
|
+
</InnerSectionTitle>
|
|
42
|
+
<div>
|
|
43
|
+
<div>{address.address_line1}</div>
|
|
44
|
+
<div>{address.address_line2}</div>
|
|
45
|
+
<div>{`${address.locality}, ${address.administrative_area} ${address.postal_code}`}</div>
|
|
46
|
+
<a
|
|
47
|
+
href='https://www.google.com/maps/dir/?api=1&destination=1+Dr.+Carlton+B.+Goodlett+Place%2CCity+Hall+Room+362%2C+San+Francisco%2CCA+94102'
|
|
48
|
+
target='_blank'
|
|
49
|
+
rel='noreferrer'
|
|
50
|
+
>
|
|
51
|
+
Get directions
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
{!!phone?.length && (
|
|
57
|
+
<div>
|
|
58
|
+
<InnerSectionTitle>
|
|
59
|
+
<IconPhone />
|
|
60
|
+
<TitleXs>Call</TitleXs>
|
|
61
|
+
</InnerSectionTitle>
|
|
62
|
+
{phone.map((p) => (
|
|
63
|
+
<div key={p.tel}>
|
|
64
|
+
{p.owner && <div>{p.owner}</div>}
|
|
65
|
+
<a href={`tel:${p.tel}`}>{p.tel}</a>
|
|
66
|
+
</div>
|
|
67
|
+
))}
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
{email && (
|
|
71
|
+
<div>
|
|
72
|
+
<InnerSectionTitle>
|
|
73
|
+
<IconMail />
|
|
74
|
+
<TitleXs>Email</TitleXs>
|
|
75
|
+
</InnerSectionTitle>
|
|
76
|
+
<div>
|
|
77
|
+
{email.owner && <div>{email.owner}</div>}
|
|
78
|
+
<a href={`mailto:${email.email}`}>{email.email}</a>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
)}
|
|
82
|
+
{social && (
|
|
83
|
+
<div>
|
|
84
|
+
<InnerSectionTitle>
|
|
85
|
+
<IconGlobe />
|
|
86
|
+
<TitleXs>Social</TitleXs>
|
|
87
|
+
</InnerSectionTitle>
|
|
88
|
+
<div>{/* TODO */}</div>
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
</Flex>
|
|
92
|
+
)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Container } from '../Container'
|
|
3
|
+
import { Flex } from '../Flex'
|
|
4
|
+
import { TitleXs, TitleXl } from '../Text'
|
|
5
|
+
import { styled } from '../../stitches.config'
|
|
6
|
+
import { IconChevronRight } from '../../icons'
|
|
7
|
+
|
|
8
|
+
type SectionTitleProps = {
|
|
9
|
+
title: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
hasMore?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const SectionTitle = ({ title, type, hasMore }: SectionTitleProps) => (
|
|
15
|
+
<Flex
|
|
16
|
+
css={{
|
|
17
|
+
paddingBottom: 16,
|
|
18
|
+
marginBottom: 32,
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
alignItems: 'flex-end',
|
|
21
|
+
borderBottom: '1px solid $slateL3'
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
<TitleXl>{title}</TitleXl>
|
|
25
|
+
{hasMore && (
|
|
26
|
+
<Flex as='a' css={{ color: '$slateL3' }}>
|
|
27
|
+
<TitleXs>More {type}</TitleXs>
|
|
28
|
+
<IconChevronRight />
|
|
29
|
+
</Flex>
|
|
30
|
+
)}
|
|
31
|
+
</Flex>
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
const SectionContainer = styled('section', {
|
|
35
|
+
py: 80,
|
|
36
|
+
backgroundColor: '$white',
|
|
37
|
+
color: '$slateL3',
|
|
38
|
+
variants: {
|
|
39
|
+
variant: {
|
|
40
|
+
grey: {
|
|
41
|
+
backgroundColor: '$greyL1'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export const Section = ({ children, ...props }) => (
|
|
48
|
+
<SectionContainer {...props}>
|
|
49
|
+
<Container>{children}</Container>
|
|
50
|
+
</SectionContainer>
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
export type SectionProps = React.PropsWithRef<typeof Section>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Button } from '../Button'
|
|
3
|
+
import { Container } from '../Container'
|
|
4
|
+
import { TitleLg } from '../Text'
|
|
5
|
+
import { styled } from '../../stitches.config'
|
|
6
|
+
|
|
7
|
+
export type SpotlightProps = {
|
|
8
|
+
title: string;
|
|
9
|
+
body: string;
|
|
10
|
+
buttonContent: string;
|
|
11
|
+
image: string;
|
|
12
|
+
isFullWidth?: boolean;
|
|
13
|
+
isTitleFirst?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const SpotlightContainer = styled(Container, {
|
|
17
|
+
bg: '$greyL1',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
marginBottom: 60,
|
|
21
|
+
gap: 12,
|
|
22
|
+
'@md': {
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
'& > *': {
|
|
26
|
+
width: '50%'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
variants: {
|
|
30
|
+
full: {
|
|
31
|
+
true: {
|
|
32
|
+
'@md': {
|
|
33
|
+
flexWrap: 'wrap',
|
|
34
|
+
'& > *': { width: '100%' },
|
|
35
|
+
'& > img': { maxHeight: '300px' }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
reverse: {
|
|
40
|
+
true: {
|
|
41
|
+
flexDirection: 'column-reverse',
|
|
42
|
+
'@md': {
|
|
43
|
+
flexDirection: 'row-reverse'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const SpotlightImage = styled('img', {
|
|
51
|
+
objectFit: 'cover'
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
export const Spotlight = ({
|
|
55
|
+
title,
|
|
56
|
+
body,
|
|
57
|
+
buttonContent,
|
|
58
|
+
image,
|
|
59
|
+
isFullWidth = false,
|
|
60
|
+
isTitleFirst = false
|
|
61
|
+
}: SpotlightProps) => (
|
|
62
|
+
<SpotlightContainer full={isFullWidth} reverse={isTitleFirst}>
|
|
63
|
+
<SpotlightImage src={image} />
|
|
64
|
+
<div>
|
|
65
|
+
<TitleLg>{title}</TitleLg>
|
|
66
|
+
<div>{body}</div>
|
|
67
|
+
<Button>{buttonContent}</Button>
|
|
68
|
+
</div>
|
|
69
|
+
</SpotlightContainer>
|
|
70
|
+
)
|