Accounts 1.7.0 + @crosscode/ui 0.2.0: brand style, the church's fonts and footer, church.update
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Font licences
|
||||
|
||||
Every font in `files/` is from the [Fontsource](https://fontsource.org) packages pinned in
|
||||
`packages/ui/package.json` and is licensed under the **SIL Open Font License 1.1**: free to use,
|
||||
bundle and self-host, not to be sold on its own. Each package's `LICENSE` has the full text and the
|
||||
copyright holders.
|
||||
|
||||
- Lora: `@fontsource-variable/lora`
|
||||
- Source Sans 3: `@fontsource-variable/source-sans-3`
|
||||
- EB Garamond: `@fontsource-variable/eb-garamond`
|
||||
- Playfair Display: `@fontsource-variable/playfair-display`
|
||||
- Inter: `@fontsource-variable/inter`
|
||||
- Oswald: `@fontsource-variable/oswald`
|
||||
- Outfit: `@fontsource-variable/outfit`
|
||||
- DM Sans: `@fontsource-variable/dm-sans`
|
||||
- Nunito: `@fontsource-variable/nunito`
|
||||
- Fraunces: `@fontsource-variable/fraunces`
|
||||
- Nunito Sans: `@fontsource-variable/nunito-sans`
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,60 @@
|
||||
/* Generated by packages/ui/scripts/fonts.mjs from @fontsource-variable (SIL Open Font License 1.1,
|
||||
see fonts/LICENSES.md) and Capsize metrics. Don't edit: run `npm run fonts -w packages/ui`. */
|
||||
|
||||
@font-face { font-family: 'CC Lora'; font-style: normal; font-display: swap; font-weight: 400 700; src: url(./files/lora-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/lora-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Lora'; font-style: normal; font-display: swap; font-weight: 400 700; src: url(./files/lora-latin-wght-normal.woff2) format('woff2-variations'), url(./files/lora-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Lora Fallback"; src: local('Georgia'); ascent-override: 95.8281%; descent-override: 26.1003%; size-adjust: 104.9796%; }
|
||||
@font-face { font-family: 'CC Source Sans 3'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(./files/source-sans-3-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/source-sans-3-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Source Sans 3'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(./files/source-sans-3-latin-wght-normal.woff2) format('woff2-variations'), url(./files/source-sans-3-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: 'CC Source Sans 3'; font-style: italic; font-display: swap; font-weight: 200 900; src: url(./files/source-sans-3-latin-ext-wght-italic.woff2) format('woff2-variations'), url(./files/source-sans-3-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Source Sans 3'; font-style: italic; font-display: swap; font-weight: 200 900; src: url(./files/source-sans-3-latin-wght-italic.woff2) format('woff2-variations'), url(./files/source-sans-3-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Source Sans 3 Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 109.2105%; descent-override: 42.6604%; line-gap-override: 0%; size-adjust: 93.7639%; }
|
||||
@font-face { font-family: 'CC EB Garamond'; font-style: normal; font-display: swap; font-weight: 400 800; src: url(./files/eb-garamond-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/eb-garamond-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC EB Garamond'; font-style: normal; font-display: swap; font-weight: 400 800; src: url(./files/eb-garamond-latin-wght-normal.woff2) format('woff2-variations'), url(./files/eb-garamond-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: 'CC EB Garamond'; font-style: italic; font-display: swap; font-weight: 400 800; src: url(./files/eb-garamond-latin-ext-wght-italic.woff2) format('woff2-variations'), url(./files/eb-garamond-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC EB Garamond'; font-style: italic; font-display: swap; font-weight: 400 800; src: url(./files/eb-garamond-latin-wght-italic.woff2) format('woff2-variations'), url(./files/eb-garamond-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC EB Garamond Fallback"; src: local('Georgia'); ascent-override: 116.603%; descent-override: 34.5061%; size-adjust: 86.3614%; }
|
||||
@font-face { font-family: 'CC Playfair Display'; font-style: normal; font-display: swap; font-weight: 400 900; src: url(./files/playfair-display-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/playfair-display-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Playfair Display'; font-style: normal; font-display: swap; font-weight: 400 900; src: url(./files/playfair-display-latin-wght-normal.woff2) format('woff2-variations'), url(./files/playfair-display-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Playfair Display Fallback"; src: local('Georgia'); ascent-override: 106.716%; descent-override: 24.7558%; size-adjust: 101.3906%; }
|
||||
@font-face { font-family: 'CC Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(./files/inter-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(./files/inter-latin-wght-normal.woff2) format('woff2-variations'), url(./files/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: 'CC Inter'; font-style: italic; font-display: swap; font-weight: 100 900; src: url(./files/inter-latin-ext-wght-italic.woff2) format('woff2-variations'), url(./files/inter-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Inter'; font-style: italic; font-display: swap; font-weight: 100 900; src: url(./files/inter-latin-wght-italic.woff2) format('woff2-variations'), url(./files/inter-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Inter Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 90.4365%; descent-override: 22.518%; line-gap-override: 0%; size-adjust: 107.1194%; }
|
||||
@font-face { font-family: 'CC Oswald'; font-style: normal; font-display: swap; font-weight: 200 700; src: url(./files/oswald-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/oswald-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Oswald'; font-style: normal; font-display: swap; font-weight: 200 700; src: url(./files/oswald-latin-wght-normal.woff2) format('woff2-variations'), url(./files/oswald-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Oswald Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 146.5125%; descent-override: 35.4921%; line-gap-override: 0%; size-adjust: 81.4265%; }
|
||||
@font-face { font-family: 'CC Outfit'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(./files/outfit-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/outfit-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Outfit'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(./files/outfit-latin-wght-normal.woff2) format('woff2-variations'), url(./files/outfit-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Outfit Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 100.18%; descent-override: 26.0468%; line-gap-override: 0%; size-adjust: 99.8204%; }
|
||||
@font-face { font-family: 'CC DM Sans'; font-style: normal; font-display: swap; font-weight: 100 1000; src: url(./files/dm-sans-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/dm-sans-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC DM Sans'; font-style: normal; font-display: swap; font-weight: 100 1000; src: url(./files/dm-sans-latin-wght-normal.woff2) format('woff2-variations'), url(./files/dm-sans-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: 'CC DM Sans'; font-style: italic; font-display: swap; font-weight: 100 1000; src: url(./files/dm-sans-latin-ext-wght-italic.woff2) format('woff2-variations'), url(./files/dm-sans-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC DM Sans'; font-style: italic; font-display: swap; font-weight: 100 1000; src: url(./files/dm-sans-latin-wght-italic.woff2) format('woff2-variations'), url(./files/dm-sans-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC DM Sans Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 94.9001%; descent-override: 29.6563%; line-gap-override: 0%; size-adjust: 104.531%; }
|
||||
@font-face { font-family: 'CC Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/nunito-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-latin-wght-normal.woff2) format('woff2-variations'), url(./files/nunito-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: 'CC Nunito'; font-style: italic; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-latin-ext-wght-italic.woff2) format('woff2-variations'), url(./files/nunito-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Nunito'; font-style: italic; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-latin-wght-italic.woff2) format('woff2-variations'), url(./files/nunito-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Nunito Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 99.7134%; descent-override: 34.8159%; line-gap-override: 0%; size-adjust: 101.3906%; }
|
||||
@font-face { font-family: 'CC Fraunces'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(./files/fraunces-latin-ext-soft-normal.woff2) format('woff2-variations'), url(./files/fraunces-latin-ext-soft-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Fraunces'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(./files/fraunces-latin-soft-normal.woff2) format('woff2-variations'), url(./files/fraunces-latin-soft-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Fraunces Fallback"; src: local('Georgia'); ascent-override: 92.9623%; descent-override: 24.2386%; size-adjust: 105.2039%; }
|
||||
@font-face { font-family: 'CC Nunito Sans'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-sans-latin-ext-wght-normal.woff2) format('woff2-variations'), url(./files/nunito-sans-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Nunito Sans'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-sans-latin-wght-normal.woff2) format('woff2-variations'), url(./files/nunito-sans-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: 'CC Nunito Sans'; font-style: italic; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-sans-latin-ext-wght-italic.woff2) format('woff2-variations'), url(./files/nunito-sans-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
|
||||
@font-face { font-family: 'CC Nunito Sans'; font-style: italic; font-display: swap; font-weight: 200 1000; src: url(./files/nunito-sans-latin-wght-italic.woff2) format('woff2-variations'), url(./files/nunito-sans-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
|
||||
@font-face { font-family: "CC Nunito Sans Fallback"; src: local('Arial'), local('ArialMT'); ascent-override: 99.7134%; descent-override: 34.8159%; line-gap-override: 0%; size-adjust: 101.3906%; }
|
||||
|
||||
[data-cc-fonts="classic"] { --cc-font-heading: "CC Lora", "CC Lora Fallback", Georgia, serif; --cc-font-body: "CC Source Sans 3", "CC Source Sans 3 Fallback", Arial, sans-serif; --cc-heading-variation: normal; }
|
||||
[data-cc-fonts="scholarly"] { --cc-font-heading: "CC EB Garamond", "CC EB Garamond Fallback", Georgia, serif; --cc-font-body: "CC EB Garamond", "CC EB Garamond Fallback", Georgia, serif; --cc-heading-variation: normal; }
|
||||
[data-cc-fonts="editorial"] { --cc-font-heading: "CC Playfair Display", "CC Playfair Display Fallback", Georgia, serif; --cc-font-body: "CC Inter", "CC Inter Fallback", Arial, sans-serif; --cc-heading-variation: normal; }
|
||||
[data-cc-fonts="impact"] { --cc-font-heading: "CC Oswald", "CC Oswald Fallback", Arial, sans-serif; --cc-font-body: "CC Source Sans 3", "CC Source Sans 3 Fallback", Arial, sans-serif; --cc-heading-variation: normal; }
|
||||
[data-cc-fonts="contemporary"] { --cc-font-heading: "CC Outfit", "CC Outfit Fallback", Arial, sans-serif; --cc-font-body: "CC DM Sans", "CC DM Sans Fallback", Arial, sans-serif; --cc-heading-variation: normal; }
|
||||
[data-cc-fonts="friendly"] { --cc-font-heading: "CC Nunito", "CC Nunito Fallback", Arial, sans-serif; --cc-font-body: "CC Nunito", "CC Nunito Fallback", Arial, sans-serif; --cc-heading-variation: normal; }
|
||||
[data-cc-fonts="warm"] { --cc-font-heading: "CC Fraunces", "CC Fraunces Fallback", Georgia, serif; --cc-font-body: "CC Nunito Sans", "CC Nunito Sans Fallback", Arial, sans-serif; --cc-heading-variation: "SOFT" 100, "WONK" 0; }
|
||||
[data-cc-fonts="modern"] { --cc-font-heading: "CC Inter", "CC Inter Fallback", Arial, sans-serif; --cc-font-body: "CC Inter", "CC Inter Fallback", Arial, sans-serif; --cc-heading-variation: normal; }
|
||||
[data-cc-corners="sharp"] { --cc-radius: 0; --cc-radius-sm: 0; --cc-radius-button: 0; }
|
||||
[data-cc-corners="soft"] { --cc-radius: 1rem; --cc-radius-sm: 0.5rem; --cc-radius-button: 0.5rem; }
|
||||
[data-cc-corners="round"] { --cc-radius: 1.25rem; --cc-radius-sm: 0.75rem; --cc-radius-button: 9999px; }
|
||||
@@ -1,11 +1,42 @@
|
||||
{
|
||||
"name": "@crosscode/ui",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"private": true,
|
||||
"description": "Shared UI for the church's sign-in pages, Website and App: the branded shell, forms and buttons (Tailwind; apps compile the source with transpilePackages)",
|
||||
"description": "Shared UI for the church's sign-in pages, Website and App: the branded shell, forms and buttons, the church's fonts and footer (Tailwind; apps compile the source with transpilePackages)",
|
||||
"main": "src/index.tsx",
|
||||
"types": "src/index.tsx",
|
||||
"exports": {
|
||||
".": "./src/index.tsx",
|
||||
"./fonts.css": "./fonts/fonts.css",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"fonts"
|
||||
],
|
||||
"scripts": {
|
||||
"fonts": "node scripts/fonts.mjs",
|
||||
"test": "node scripts/fonts.mjs --check"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=19"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource-variable/dm-sans": "5.3.0",
|
||||
"@fontsource-variable/eb-garamond": "5.3.0",
|
||||
"@fontsource-variable/fraunces": "5.3.0",
|
||||
"@fontsource-variable/inter": "5.3.0",
|
||||
"@fontsource-variable/lora": "5.3.0",
|
||||
"@fontsource-variable/nunito": "5.3.0",
|
||||
"@fontsource-variable/nunito-sans": "5.3.0",
|
||||
"@fontsource-variable/oswald": "5.3.0",
|
||||
"@fontsource-variable/outfit": "5.3.0",
|
||||
"@fontsource-variable/playfair-display": "5.3.0",
|
||||
"@fontsource-variable/source-sans-3": "5.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@crosscode/contracts": "*",
|
||||
"@capsizecss/core": "4.1.3",
|
||||
"@capsizecss/metrics": "4.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
// Builds the church fonts (WEBSITE-1.0-PLAN §3 "Font pairings", contracts FONT_PAIRINGS) into
|
||||
// packages/ui/fonts/: the woff2 files each pairing needs (Latin and Latin Extended only) copied
|
||||
// from the pinned @fontsource-variable packages, and fonts.css with
|
||||
// - an @font-face per file (unicode-range from Fontsource, so a page only downloads what it uses),
|
||||
// - a size-matched fallback face per font (Capsize metrics on Arial or Georgia), so the swap
|
||||
// from the fallback to the font doesn't move the layout,
|
||||
// - [data-cc-fonts="<id>"] → --cc-font-heading / --cc-font-body / --cc-heading-variation (for
|
||||
// Fraunces's soft axis: apply it as font-variation-settings on headings), and
|
||||
// - [data-cc-corners="<id>"] → --cc-radius (and --cc-radius-sm, --cc-radius-button).
|
||||
//
|
||||
// node scripts/fonts.mjs write fonts/
|
||||
// node scripts/fonts.mjs --check fail if fonts/ is out of date (run by `npm test`)
|
||||
//
|
||||
// The output is committed, so the apps' builds don't depend on this script or Capsize.
|
||||
import fs from "node:fs";
|
||||
import process from "node:process";
|
||||
import { Buffer } from "node:buffer";
|
||||
import console from "node:console";
|
||||
import path from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { createFontStack } from "@capsizecss/core";
|
||||
import { CORNERS, FONT_PAIRINGS } from "@crosscode/contracts";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
const OUT = path.join(here, "..", "fonts");
|
||||
const SUBSETS = ["latin-ext", "latin"]; // Fontsource's order: the later block wins where ranges overlap.
|
||||
const BUDGET = 160 * 1024; // per pairing, for an English page (Latin): heading + body + body italic.
|
||||
|
||||
const slug = (family) => family.toLowerCase().replace(/\s+/g, "-");
|
||||
const camel = (family) => slug(family).replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
|
||||
const cssName = (family) => `CC ${family}`;
|
||||
/** Fonts that use another Fontsource axis file than plain weight, and the setting that turns it on. */
|
||||
const AXES = { Fraunces: { file: "soft", variation: '"SOFT" 100, "WONK" 0' } };
|
||||
const metrics = (name) => require(`@capsizecss/metrics/${name}`).default ?? require(`@capsizecss/metrics/${name}`);
|
||||
|
||||
/** family → { category, styles } from the pairings: body fonts need italic, headings don't. */
|
||||
function families() {
|
||||
const out = new Map();
|
||||
for (const p of Object.values(FONT_PAIRINGS)) {
|
||||
for (const [role, face] of [["heading", p.heading], ["body", p.body]]) {
|
||||
const f = out.get(face.family) ?? { category: face.category, styles: new Set(["normal"]) };
|
||||
if (role === "body") f.styles.add("italic");
|
||||
out.set(face.family, f);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** The @font-face blocks Fontsource has for a family's style, by subset. */
|
||||
function fontsourceFaces(family, style) {
|
||||
const pkg = path.dirname(require.resolve(`@fontsource-variable/${slug(family)}/package.json`));
|
||||
const axis = AXES[family]?.file ?? "wght";
|
||||
const css = fs.readFileSync(path.join(pkg, style === "italic" ? `${axis}-italic.css` : `${axis}.css`), "utf8");
|
||||
const faces = {};
|
||||
for (const m of css.matchAll(/\/\* ([a-z0-9-]+) \*\/\s*@font-face \{([^}]*)\}/g)) {
|
||||
const subset = SUBSETS.find((s) => m[1] === `${slug(family)}-${s}-${axis}-${style}`);
|
||||
if (!subset) continue;
|
||||
const body = m[2];
|
||||
faces[subset] = {
|
||||
weight: /font-weight:\s*([^;]+);/.exec(body)[1].trim(),
|
||||
range: /unicode-range:\s*([^;]+);/.exec(body)[1].trim(),
|
||||
file: path.join(pkg, "files", `${m[1]}.woff2`),
|
||||
};
|
||||
}
|
||||
for (const s of SUBSETS) if (!faces[s]) throw new Error(`${family} ${style}: no ${s} face in Fontsource`);
|
||||
return faces;
|
||||
}
|
||||
|
||||
const fallbackFor = (category) => (category === "serif" ? { name: "Georgia", metrics: metrics("georgia"), generic: "serif" } : { name: "Arial", metrics: metrics("arial"), generic: "sans-serif" });
|
||||
|
||||
export function build() {
|
||||
const files = new Map(); // name in fonts/files → source path
|
||||
const css = [
|
||||
"/* Generated by packages/ui/scripts/fonts.mjs from @fontsource-variable (SIL Open Font License 1.1,",
|
||||
" see fonts/LICENSES.md) and Capsize metrics. Don't edit: run `npm run fonts -w packages/ui`. */",
|
||||
"",
|
||||
];
|
||||
const stacks = {};
|
||||
const sizes = {};
|
||||
for (const [family, f] of families()) {
|
||||
for (const style of f.styles) {
|
||||
for (const [subset, face] of Object.entries(fontsourceFaces(family, style))) {
|
||||
const name = path.basename(face.file);
|
||||
files.set(name, face.file);
|
||||
if (subset === "latin") sizes[`${family}/${style}`] = fs.statSync(face.file).size;
|
||||
css.push(`@font-face { font-family: '${cssName(family)}'; font-style: ${style}; font-display: swap; font-weight: ${face.weight}; src: url(./files/${name}) format('woff2-variations'), url(./files/${name}) format('woff2'); unicode-range: ${face.range}; }`);
|
||||
}
|
||||
}
|
||||
const fb = fallbackFor(f.category);
|
||||
const own = { ...metrics(camel(family)), familyName: cssName(family) };
|
||||
const { fontFamily, fontFaces } = createFontStack([own, fb.metrics], { fontFaceFormat: "styleString" });
|
||||
css.push(fontFaces.replace(/\s+/g, " ").replace(/\} ?@/g, "}\n@").trim());
|
||||
stacks[family] = `${fontFamily}, ${fb.generic}`;
|
||||
}
|
||||
css.push("");
|
||||
for (const [id, p] of Object.entries(FONT_PAIRINGS)) {
|
||||
css.push(`[data-cc-fonts="${id}"] { --cc-font-heading: ${stacks[p.heading.family]}; --cc-font-body: ${stacks[p.body.family]}; --cc-heading-variation: ${AXES[p.heading.family]?.variation ?? "normal"}; }`);
|
||||
const used = new Set([`${p.heading.family}/normal`, `${p.body.family}/normal`, `${p.body.family}/italic`]);
|
||||
const total = [...used].reduce((n, k) => n + sizes[k], 0);
|
||||
if (total > BUDGET) throw new Error(`${id} needs ${Math.round(total / 1024)} KB of fonts for an English page; the budget is ${BUDGET / 1024} KB`);
|
||||
}
|
||||
const RADII = { sharp: ["0", "0", "0"], soft: ["1rem", "0.5rem", "0.5rem"], round: ["1.25rem", "0.75rem", "9999px"] };
|
||||
if (Object.keys(RADII).join() !== CORNERS.join()) throw new Error("A corner style without a radius");
|
||||
for (const [id, [r, sm, button]] of Object.entries(RADII)) css.push(`[data-cc-corners="${id}"] { --cc-radius: ${r}; --cc-radius-sm: ${sm}; --cc-radius-button: ${button}; }`);
|
||||
return { css: css.join("\n") + "\n", files };
|
||||
}
|
||||
|
||||
const LICENCES = (families) => `# Font licences
|
||||
|
||||
Every font in \`files/\` is from the [Fontsource](https://fontsource.org) packages pinned in
|
||||
\`packages/ui/package.json\` and is licensed under the **SIL Open Font License 1.1**: free to use,
|
||||
bundle and self-host, not to be sold on its own. Each package's \`LICENSE\` has the full text and the
|
||||
copyright holders.
|
||||
|
||||
${[...families].map((f) => `- ${f}: \`@fontsource-variable/${slug(f)}\``).join("\n")}
|
||||
`;
|
||||
|
||||
const isMain = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
||||
if (isMain) {
|
||||
const check = process.argv.includes("--check");
|
||||
const { css, files } = build();
|
||||
const want = new Map([["fonts.css", Buffer.from(css)], ["LICENSES.md", Buffer.from(LICENCES(families().keys()))]]);
|
||||
for (const [name, src] of files) want.set(`files/${name}`, fs.readFileSync(src));
|
||||
const have = fs.existsSync(OUT) ? fs.readdirSync(OUT, { recursive: true }).map(String).map((p) => p.replace(/\\/g, "/")).filter((p) => fs.statSync(path.join(OUT, p)).isFile()) : [];
|
||||
const stale = [...want].filter(([p, buf]) => !fs.existsSync(path.join(OUT, p)) || !fs.readFileSync(path.join(OUT, p)).equals(buf)).map(([p]) => p);
|
||||
const extra = have.filter((p) => !want.has(p));
|
||||
if (check) {
|
||||
if (stale.length || extra.length) {
|
||||
console.error(`fonts/ is out of date (${[...stale, ...extra].slice(0, 5).join(", ")}): run \`npm run fonts -w packages/ui\``);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(`fonts/ is up to date (${files.size} font files)`);
|
||||
} else {
|
||||
fs.mkdirSync(path.join(OUT, "files"), { recursive: true });
|
||||
for (const p of extra) fs.rmSync(path.join(OUT, p));
|
||||
for (const [p, buf] of want) fs.writeFileSync(path.join(OUT, p), buf);
|
||||
console.log(`Wrote fonts/ (${files.size} font files)`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* The church's brand style and footer, shared by Accounts, Cross Events' public pages, the Website
|
||||
* and later the App (WEBSITE-1.0-PLAN §3 and §9, contracts 1.17.0).
|
||||
*
|
||||
* Fonts: import `@crosscode/ui/fonts.css` once (it holds every pairing's @font-face; a browser only
|
||||
* downloads the files a page uses), then put `brandAttributes(style)` on `<html>`. The page's CSS
|
||||
* uses `var(--cc-font-body, <its own font>)`, `var(--cc-font-heading, …)` and
|
||||
* `font-variation-settings: var(--cc-heading-variation, normal)` on headings, and the components
|
||||
* here use `--cc-radius`, so a church without a pairing keeps the app's own fonts.
|
||||
*/
|
||||
import React from "react";
|
||||
|
||||
const cx = (...c: (string | false | null | undefined)[]) => c.filter(Boolean).join(" ");
|
||||
|
||||
/** `branding.style` from `crosscode.church/1` (structural, so this package needn't depend on the contracts). */
|
||||
export type BrandStyle = { fontPairing?: string | null; corners?: string | null } | null | undefined;
|
||||
|
||||
/** Attributes for `<html>`: the pairing (only when the church picked one) and the corners (`soft` by default). */
|
||||
export function brandAttributes(style: BrandStyle): Record<string, string> {
|
||||
const out: Record<string, string> = { "data-cc-corners": style?.corners || "soft" };
|
||||
if (style?.fontPairing) out["data-cc-fonts"] = style.fontPairing;
|
||||
return out;
|
||||
}
|
||||
|
||||
const DAYS: Record<string, string> = { monday: "Mondays", tuesday: "Tuesdays", wednesday: "Wednesdays", thursday: "Thursdays", friday: "Fridays", saturday: "Saturdays", sunday: "Sundays" };
|
||||
const NETWORKS: Record<string, string> = { facebook: "Facebook", instagram: "Instagram", youtube: "YouTube", tiktok: "TikTok", x: "X", spotify: "Spotify", "whatsapp-channel": "WhatsApp channel", other: "Link" };
|
||||
|
||||
/** What the footer needs from `crosscode.church/1`. */
|
||||
export type FooterChurch = {
|
||||
name: string;
|
||||
branding: { logoUrl: string | null };
|
||||
serviceTimes?: { day: string; time: string; label: string | null }[];
|
||||
contact?: {
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
whatsapp: string | null;
|
||||
address: { line1: string; line2: string | null; suburb: string | null; city: string; postalCode: string | null } | null;
|
||||
};
|
||||
social?: { network: string; url: string }[];
|
||||
links: { website: string | null; events: string | null; app: string | null; accounts: string };
|
||||
};
|
||||
|
||||
export type FooterProduct = "website" | "events" | "app" | "accounts";
|
||||
|
||||
const PRODUCT_LINKS: { key: FooterProduct; label: string }[] = [
|
||||
{ key: "website", label: "Website" },
|
||||
{ key: "events", label: "Events" },
|
||||
{ key: "app", label: "App" },
|
||||
{ key: "accounts", label: "Your account" },
|
||||
];
|
||||
|
||||
/** The church's other sites, for a product's header: each that exists except this one. */
|
||||
export function productLinks(links: FooterChurch["links"], current: FooterProduct): { label: string; href: string }[] {
|
||||
return PRODUCT_LINKS.filter((p) => p.key !== current && p.key !== "accounts" && links[p.key]).map((p) => ({ label: p.label, href: links[p.key]! }));
|
||||
}
|
||||
|
||||
/**
|
||||
* One footer for every product: the church's name and logo, service times, address and contact,
|
||||
* social links, links to its other sites, and the privacy notice. Sections without data are left
|
||||
* out. `className` lets a Website template restyle it.
|
||||
*/
|
||||
export function ChurchFooter({ church, current, privacyUrl, className }: { church: FooterChurch; current: FooterProduct; privacyUrl?: string | null; className?: string }) {
|
||||
const times = church.serviceTimes ?? [];
|
||||
const contact = church.contact;
|
||||
const address = contact?.address;
|
||||
const social = church.social ?? [];
|
||||
const sites = PRODUCT_LINKS.filter((p) => p.key !== current && church.links[p.key]);
|
||||
const tel = (n: string) => `tel:${n.replace(/\s+/g, "")}`;
|
||||
const heading = "mb-2 text-sm font-semibold text-gray-900 [font-family:var(--cc-font-heading,inherit)] [font-variation-settings:var(--cc-heading-variation,normal)]";
|
||||
return (
|
||||
<footer className={cx("border-t border-brand/15 bg-white/80 text-sm text-gray-700", className)}>
|
||||
<div className="mx-auto grid max-w-5xl gap-8 px-4 py-10 sm:grid-cols-2 lg:grid-cols-4">
|
||||
<div>
|
||||
{church.branding.logoUrl
|
||||
? <img src={church.branding.logoUrl} alt={church.name} className="mb-3 h-10 w-auto max-w-[10rem] object-contain" />
|
||||
: <p className={cx(heading, "text-base")}>{church.name}</p>}
|
||||
{address && (
|
||||
<address className="not-italic leading-relaxed">
|
||||
{address.line1}{address.line2 && <>, {address.line2}</>}<br />
|
||||
{[address.suburb, address.city, address.postalCode].filter(Boolean).join(", ")}
|
||||
</address>
|
||||
)}
|
||||
</div>
|
||||
{times.length > 0 && (
|
||||
<div>
|
||||
<h2 className={heading}>Service times</h2>
|
||||
<ul className="space-y-1">
|
||||
{times.map((t, i) => <li key={i}>{DAYS[t.day] ?? t.day} {t.time}{t.label && <span className="text-gray-500"> · {t.label}</span>}</li>)}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
{contact && (contact.email || contact.phone || contact.whatsapp || social.length > 0) && (
|
||||
<div>
|
||||
<h2 className={heading}>Contact</h2>
|
||||
<ul className="space-y-1">
|
||||
{contact.phone && <li><a className="hover:text-brand hover:underline" href={tel(contact.phone)}>{contact.phone}</a></li>}
|
||||
{contact.whatsapp && <li><a className="hover:text-brand hover:underline" href={`https://wa.me/${contact.whatsapp.replace(/\D/g, "")}`}>WhatsApp {contact.whatsapp}</a></li>}
|
||||
{contact.email && <li><a className="break-all hover:text-brand hover:underline" href={`mailto:${contact.email}`}>{contact.email}</a></li>}
|
||||
{social.map((s) => <li key={s.url}><a className="hover:text-brand hover:underline" href={s.url} rel="me noopener">{NETWORKS[s.network] ?? s.network}</a></li>)}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
{(sites.length > 0 || privacyUrl) && (
|
||||
<nav aria-label={`${church.name}'s sites`}>
|
||||
<h2 className={heading}>Our sites</h2>
|
||||
<ul className="space-y-1">
|
||||
{sites.map((s) => <li key={s.key}><a className="hover:text-brand hover:underline" href={church.links[s.key]!}>{s.label}</a></li>)}
|
||||
{privacyUrl && <li><a className="hover:text-brand hover:underline" href={privacyUrl}>Privacy notice</a></li>}
|
||||
</ul>
|
||||
</nav>
|
||||
)}
|
||||
</div>
|
||||
<p className="px-4 pb-6 text-center text-xs text-gray-500">© {new Date().getFullYear()} {church.name}</p>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
+18
-13
@@ -4,6 +4,8 @@
|
||||
*/
|
||||
import React from "react";
|
||||
|
||||
export * from "./brand";
|
||||
|
||||
const cx = (...c: (string | false | null | undefined)[]) => c.filter(Boolean).join(" ");
|
||||
|
||||
export type Branding = { name: string; shortName?: string | null; logoUrl?: string | null };
|
||||
@@ -12,8 +14,8 @@ export type Branding = { name: string; shortName?: string | null; logoUrl?: stri
|
||||
/** The church's logo, or its first letter on its colour while it has none. */
|
||||
export function ChurchMark({ branding, size = "md" }: { branding: Branding; size?: "md" | "lg" }) {
|
||||
const box = size === "lg" ? "h-14 w-14 text-2xl" : "h-10 w-10 text-lg";
|
||||
if (branding.logoUrl) return <img src={branding.logoUrl} alt="" className={cx(size === "lg" ? "h-14" : "h-10", "w-auto max-w-[12rem] rounded-xl object-contain")} />;
|
||||
return <span className={cx(box, "flex shrink-0 items-center justify-center rounded-xl bg-brand font-semibold text-white")} aria-hidden>{(branding.shortName || branding.name || "?").trim().charAt(0).toUpperCase()}</span>;
|
||||
if (branding.logoUrl) return <img src={branding.logoUrl} alt="" className={cx(size === "lg" ? "h-14" : "h-10", "w-auto max-w-[12rem] rounded-[var(--cc-radius-sm,0.75rem)] object-contain")} />;
|
||||
return <span className={cx(box, "flex shrink-0 items-center justify-center rounded-[var(--cc-radius-sm,0.75rem)] bg-brand font-semibold text-white")} aria-hidden>{(branding.shortName || branding.name || "?").trim().charAt(0).toUpperCase()}</span>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,35 +23,38 @@ export function ChurchMark({ branding, size = "md" }: { branding: Branding; size
|
||||
* name across the top, the content in a centred column, and a quiet footer. `wide` for the account
|
||||
* and admin pages; otherwise a sign-in column.
|
||||
*/
|
||||
export function Shell({ branding, children, wide = false, aside }: { branding: Branding; children: React.ReactNode; wide?: boolean; aside?: React.ReactNode }) {
|
||||
/** `footer` replaces the quiet line at the bottom (Accounts 1.7.0 passes the `ChurchFooter`). */
|
||||
export function Shell({ branding, children, wide = false, aside, footer }: { branding: Branding; children: React.ReactNode; wide?: boolean; aside?: React.ReactNode; footer?: React.ReactNode }) {
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col bg-gradient-to-br from-brand/10 via-white to-brand/5">
|
||||
<header className="border-b border-brand/10 bg-white/90 backdrop-blur">
|
||||
<div className="mx-auto flex max-w-5xl items-center gap-3 px-4 py-3">
|
||||
<ChurchMark branding={branding} />
|
||||
<span className="text-lg font-semibold text-brand-dark">{branding.name}</span>
|
||||
<span className="text-lg font-semibold text-brand-dark [font-family:var(--cc-font-heading,inherit)] [font-variation-settings:var(--cc-heading-variation,normal)]">{branding.name}</span>
|
||||
{aside && <div className="ml-auto">{aside}</div>}
|
||||
</div>
|
||||
</header>
|
||||
<main className={cx("mx-auto w-full flex-1 px-4", wide ? "max-w-5xl py-8" : "max-w-md py-10 sm:py-16")}>{children}</main>
|
||||
<footer className="px-4 py-6 text-center text-xs text-gray-500">
|
||||
{branding.name} · your church account, for all its sites and apps
|
||||
</footer>
|
||||
{footer ?? (
|
||||
<footer className="px-4 py-6 text-center text-xs text-gray-500">
|
||||
{branding.name} · your church account, for all its sites and apps
|
||||
</footer>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function Card({ children, className }: { children: React.ReactNode; className?: string }) {
|
||||
return <div className={cx("rounded-2xl border border-gray-200 border-t-4 border-t-brand bg-white p-6 shadow-sm sm:p-8", className)}>{children}</div>;
|
||||
return <div className={cx("rounded-[var(--cc-radius,1rem)] border border-gray-200 border-t-4 border-t-brand bg-white p-6 shadow-sm sm:p-8", className)}>{children}</div>;
|
||||
}
|
||||
|
||||
/** A page's title, with an optional icon in a tile of the church's colour (as on the church's other sites). */
|
||||
export function Heading({ children, sub, icon }: { children: React.ReactNode; sub?: React.ReactNode; icon?: React.ReactNode }) {
|
||||
return (
|
||||
<div className="mb-6 flex items-start gap-3">
|
||||
{icon && <span className="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-brand/10 text-brand" aria-hidden>{icon}</span>}
|
||||
{icon && <span className="flex h-11 w-11 shrink-0 items-center justify-center rounded-[var(--cc-radius-sm,0.75rem)] bg-brand/10 text-brand" aria-hidden>{icon}</span>}
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-gray-900">{children}</h1>
|
||||
<h1 className="text-xl font-semibold text-gray-900 [font-family:var(--cc-font-heading,inherit)] [font-variation-settings:var(--cc-heading-variation,normal)]">{children}</h1>
|
||||
{sub && <p className="mt-1 text-sm text-gray-600">{sub}</p>}
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,7 +71,7 @@ export function Button({ variant = "primary", busy, className, children, disable
|
||||
link: "text-brand underline px-0 py-0",
|
||||
}[variant];
|
||||
return (
|
||||
<button {...rest} disabled={disabled || busy} className={cx("rounded-lg px-4 py-2.5 text-sm font-medium transition disabled:opacity-50", styles, className)}>
|
||||
<button {...rest} disabled={disabled || busy} className={cx("rounded-[var(--cc-radius-button,0.5rem)] px-4 py-2.5 text-sm font-medium transition disabled:opacity-50", styles, className)}>
|
||||
{busy ? "Please wait…" : children}
|
||||
</button>
|
||||
);
|
||||
@@ -83,7 +88,7 @@ export function Field({ label, error, hint, id, className, ...rest }: FieldProps
|
||||
id={fieldId}
|
||||
aria-invalid={!!error}
|
||||
aria-describedby={error ? `${fieldId}-error` : undefined}
|
||||
className={cx("w-full rounded-lg border px-3 py-2.5 text-base focus:outline-none focus:ring-2 focus:ring-brand/50", error ? "border-red-500" : "border-gray-300")}
|
||||
className={cx("w-full rounded-[var(--cc-radius-sm,0.5rem)] border px-3 py-2.5 text-base focus:outline-none focus:ring-2 focus:ring-brand/50", error ? "border-red-500" : "border-gray-300")}
|
||||
{...rest}
|
||||
/>
|
||||
{hint && !error && <p className="mt-1 text-xs text-gray-500">{hint}</p>}
|
||||
@@ -106,5 +111,5 @@ export function Checkbox({ label, hint, ...rest }: React.InputHTMLAttributes<HTM
|
||||
|
||||
export function Notice({ tone = "info", children }: { tone?: "info" | "error" | "success" | "warning"; children: React.ReactNode }) {
|
||||
const styles = { info: "bg-blue-50 text-blue-900 border-blue-200", error: "bg-red-50 text-red-800 border-red-200", success: "bg-green-50 text-green-800 border-green-200", warning: "bg-amber-50 text-amber-900 border-amber-200" }[tone];
|
||||
return <div role={tone === "error" ? "alert" : "status"} className={cx("mb-4 rounded-lg border px-4 py-3 text-sm", styles)}>{children}</div>;
|
||||
return <div role={tone === "error" ? "alert" : "status"} className={cx("mb-4 rounded-[var(--cc-radius-sm,0.5rem)] border px-4 py-3 text-sm", styles)}>{children}</div>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user