Skip to content

Commit 27c013c

Browse files
Major: New branding (#792)
* Round 3: Updated branding colors (#764) * updating migration docs * minor revisions for readability * upgrading storybook to 9.1.15, fixing docs order, adding @nasa-jpl/explorer-1 version to intro mdx * minor config changes for html rendering * fixing html output rendering * fixing some arg types in stories * fixing css fix for html copy button * improvement documentation in stories * changeset * fixing color themes and ThemeInternal * updating node version * Revert "updating node version" This reverts commit 16eeabd. * fixing BlockText right padding * fixing JSDoc for BaseAccordionItem, BasePill, and BlockText * updating types and jsdoc comments for improved automated docs in storybook * Restoring global tag in html storybook * fixing type errors * updating with new brand colors, keeping aliases for now * adding 'click to copy' color component to Storybook (wip) * adding all colors and updating docs * fixing text contrast of links in internal footer * Branding: Updated Fonts (#786) * WIP updating typefaces * updating the rest of the vue components * small fixes after QA with WWW * adjustments to swimlane component * tweaks after meeting with designers * initial changes to internal nav and footer * finishing internal components * using outline version of tribrand for EDU * removing unnecessary font variant usage * cleaning out unused fonts * fixing some final colors in nav elements * removing semibold weight as it is not supported by Helvetica Now * adjusting workflow to use fonts from action artifact in vue-storybook * adding licensed fonts to html storybook * fixes after design review * addressing fixes after regression testing * adjusting gray-mid-dark color * fixing base audio contrast * changeset
1 parent a6786aa commit 27c013c

File tree

160 files changed

+2539
-621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2539
-621
lines changed

.changeset/little-humans-taste.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@explorer-1/common": major
3+
"@explorer-1/html": major
4+
"@explorer-1/vue": major
5+
"@nasa-jpl/explorer-1": major
6+
"@explorer-1/common-storybook": minor
7+
"@explorer-1/vue-storybook": minor
8+
---
9+
10+
Updating Explorer-1 with JPL's new branding colors and typefaces.

.changeset/sixty-ducks-exercise.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@explorer-1/common-storybook": patch
3+
"@explorer-1/html-storybook": patch
4+
"@explorer-1/vue-storybook": patch
5+
"@explorer-1/vue": patch
6+
"@nasa-jpl/explorer-1": patch
7+
---
8+
9+
Documentation updates, Storybook improvements.

.github/workflows/storybook.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,43 @@ jobs:
3131
with:
3232
fetch-depth: 0
3333

34+
- name: Find Latest Licensed Font Run ID
35+
id: find_run
36+
uses: actions/github-script@v6
37+
with:
38+
github-token: ${{ secrets.EXPLORER_1_FONTS_TOKEN }}
39+
script: |
40+
const { owner, repo } = context.repo;
41+
42+
// Query the private repo for the latest successful workflow run
43+
const runs = await github.rest.actions.listWorkflowRuns({
44+
owner: 'nasa-jpl',
45+
repo: 'explorer-1-fonts',
46+
workflow_id: 'generate-css-artifact.yml',
47+
branch: 'main',
48+
status: 'success',
49+
per_page: 1
50+
});
51+
52+
const runId = runs.data.workflow_runs[0]?.id;
53+
54+
if (!runId) {
55+
core.setFailed("Could not find a successful run for the licensed font workflow.");
56+
return;
57+
}
58+
59+
console.log(`Found Run ID: ${runId}`);
60+
core.setOutput('run_id', runId);
61+
62+
- name: Download Licensed Font Artifact
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: explorer-1-licensed-fonts
66+
repository: nasa-jpl/explorer-1-fonts
67+
path: ./packages/common-storybook/src/
68+
run-id: ${{ steps.find_run.outputs.run_id }}
69+
github-token: ${{ secrets.EXPLORER_1_FONTS_TOKEN }}
70+
3471
- name: Setup pnpm
3572
uses: pnpm/action-setup@v4
3673

@@ -43,8 +80,22 @@ jobs:
4380
- name: Install dependencies 🧱
4481
run: pnpm i
4582

83+
- name: Generate Font Data and Flag Modules (Shell Injection)
84+
run: |
85+
# Ensure the primary shell script is executable
86+
chmod +x packages/common-storybook/src/scripts/inject-fonts-shell.sh
87+
88+
# Execute the shell script, passing all necessary paths as arguments
89+
./packages/common-storybook/src/scripts/inject-fonts-shell.sh \
90+
./packages/common-storybook/src \
91+
./packages/common-storybook/src/licensed-fonts-base64.css \
92+
./packages/common-storybook/src/fonts-data.js \
93+
./packages/common-storybook/src/font-flag.js \
94+
4695
- name: Build Storybook
4796
run: make vue-storybook-build
97+
env:
98+
VITE_CHROMATIC_BUILD: true
4899

49100
- uses: chromaui/action@latest
50101
# Options required for Chromatic's GitHub Action
@@ -59,6 +110,7 @@ jobs:
59110
onlyChanged: true
60111

61112
publish_html:
113+
needs: [publish_vue]
62114
timeout-minutes: 30
63115
runs-on: ubuntu-latest
64116
steps:
@@ -67,6 +119,43 @@ jobs:
67119
with:
68120
fetch-depth: 0
69121

122+
- name: Find Latest Licensed Font Run ID
123+
id: find_run
124+
uses: actions/github-script@v6
125+
with:
126+
github-token: ${{ secrets.EXPLORER_1_FONTS_TOKEN }}
127+
script: |
128+
const { owner, repo } = context.repo;
129+
130+
// Query the private repo for the latest successful workflow run
131+
const runs = await github.rest.actions.listWorkflowRuns({
132+
owner: 'nasa-jpl',
133+
repo: 'explorer-1-fonts',
134+
workflow_id: 'generate-css-artifact.yml',
135+
branch: 'main',
136+
status: 'success',
137+
per_page: 1
138+
});
139+
140+
const runId = runs.data.workflow_runs[0]?.id;
141+
142+
if (!runId) {
143+
core.setFailed("Could not find a successful run for the licensed font workflow.");
144+
return;
145+
}
146+
147+
console.log(`Found Run ID: ${runId}`);
148+
core.setOutput('run_id', runId);
149+
150+
- name: Download Licensed Font Artifact
151+
uses: actions/download-artifact@v4
152+
with:
153+
name: explorer-1-licensed-fonts
154+
repository: nasa-jpl/explorer-1-fonts
155+
path: ./packages/common-storybook/src/
156+
run-id: ${{ steps.find_run.outputs.run_id }}
157+
github-token: ${{ secrets.EXPLORER_1_FONTS_TOKEN }}
158+
70159
- name: Setup pnpm
71160
uses: pnpm/action-setup@v4
72161

@@ -79,8 +168,22 @@ jobs:
79168
- name: Install dependencies 🧱
80169
run: pnpm i
81170

171+
- name: Generate Font Data and Flag Modules (Shell Injection)
172+
run: |
173+
# Ensure the primary shell script is executable
174+
chmod +x packages/common-storybook/src/scripts/inject-fonts-shell.sh
175+
176+
# Execute the shell script, passing all necessary paths as arguments
177+
./packages/common-storybook/src/scripts/inject-fonts-shell.sh \
178+
./packages/common-storybook/src \
179+
./packages/common-storybook/src/licensed-fonts-base64.css \
180+
./packages/common-storybook/src/fonts-data.js \
181+
./packages/common-storybook/src/font-flag.js \
182+
82183
- name: Build HTML Storybook
83184
run: make html-storybook-build
185+
env:
186+
VITE_CHROMATIC_BUILD: true
84187

85188
- uses: chromaui/action@latest
86189
# Options required for Chromatic's GitHub Action

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ storybook_compiled
6868
# Tailwind
6969
dist
7070

71+
# Licensed Fonts
72+
helvetica-now/
73+
7174
# copied assets when preparing builds
7275
apps/**/.storybook/static/dist
7376
packages/**/src/assets/fonts
@@ -78,4 +81,8 @@ packages/**/public/edu/explorer-1/
7881
!public/explorer-1/**/.gitkeep
7982
!packages/common/src/public/explorer-1
8083
apps/vue-storybook/public/fonts
81-
apps/vue-storybook/public/css
84+
apps/vue-storybook/public/css
85+
86+
# ci-generated files
87+
packages/common-storybook/src/fonts-data.js
88+
packages/common-storybook/src/font-flag.js

apps/html-storybook/.storybook/manager-head.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
/* styles for the storybook sidebar */
33
@import 'dist/css/font-face.css';
44

5-
.sidebar-item {
6-
font-family: Metropolis, sans-serif !important;
7-
line-height: 1.2rem !important;
8-
display: flex !important;
9-
align-items: center !important;
10-
}
115
.sidebar-item svg:not([type='document']) {
126
color: inherit !important;
137
}

apps/html-storybook/.storybook/preview-head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
/* styles for docs tab */
2323
/* @import 'dist/css/font-face.css'; */
2424

25-
#storybook-docs
25+
/* #storybook-docs
2626
.sbdocs
2727
.sbdocs-content
2828
*:not(.sbdocs-preview, .sbdocs-preview *, pre, pre *, code, code *) {
2929
font-family: Metropolis, sans-serif !important;
30-
}
30+
} */
3131
/* make docs have full width iframes
3232
** rescopes width to all nested divs, not the container wrapper */
3333
.sbdocs.sbdocs-content {

apps/html-storybook/.storybook/preview.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ import '@explorer-1/common-storybook/src/config/canvas.css'
77
import { withGlobals } from './withGlobals'
88
import beautify from 'js-beautify'
99
import { beautifyHtmlOptions } from '@explorer-1/common-storybook/src/plugins/beautifyHtmlOptions.js'
10-
10+
import { injectLicensedFonts } from '@explorer-1/common-storybook/src/fonts-data.js'
11+
import '@explorer-1/common-storybook/src/font-flag.js'
12+
/* Handle Licensed Fonts in CI */
13+
// @ts-ignore
14+
const IS_CHROMATIC_BUILD = import.meta.env.VITE_CHROMATIC_BUILD === 'true'
15+
// @ts-ignore
16+
if (IS_CHROMATIC_BUILD && window.__IS_LICENSED_FONT_AVAILABLE__) {
17+
console.log('✅ Licensed Fonts loaded.')
18+
injectLicensedFonts()
19+
}
1120
// viewports that match our tailwind config
1221
const customViewports = {
1322
screenSm: {

apps/vue-storybook/.storybook/manager-head.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<style type="text/css">
22
/* styles for the storybook sidebar */
3-
@import 'css/font-face.css';
43

5-
.sidebar-item {
6-
font-family: Metropolis, sans-serif !important;
7-
line-height: 1.2rem !important;
8-
display: flex !important;
9-
align-items: center !important;
10-
}
114
.sidebar-item svg:not([type='document']) {
125
color: inherit !important;
136
}

apps/vue-storybook/.storybook/preview-head.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<style type="text/css">
22
/* styles for docs tab */
3-
/* @import 'dist/css/font-face.css'; */
43

5-
#storybook-docs
6-
.sbdocs
7-
.sbdocs-content
8-
*:not(.sbdocs-preview, .sbdocs-preview *, pre, pre *, code, code *) {
9-
font-family: Metropolis, sans-serif !important;
10-
}
114
/* make docs have full width iframes
125
** rescopes width to all nested divs, not the container wrapper */
136
.sbdocs.sbdocs-content {

apps/vue-storybook/.storybook/preview.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ import '@explorer-1/common-storybook/src/config/canvas.css'
1616
import VueObserveVisibility from 'vue3-observe-visibility'
1717
import beautify from 'js-beautify'
1818
import { beautifyHtmlOptions } from '@explorer-1/common-storybook/src/plugins/beautifyHtmlOptions.js'
19+
import { injectLicensedFonts } from '@explorer-1/common-storybook/src/fonts-data.js'
20+
import '@explorer-1/common-storybook/src/font-flag.js'
21+
/* Handle Licensed Fonts in CI */
22+
// @ts-ignore
23+
const IS_CHROMATIC_BUILD = import.meta.env.VITE_CHROMATIC_BUILD === 'true'
24+
// @ts-ignore
25+
if (IS_CHROMATIC_BUILD && window.__IS_LICENSED_FONT_AVAILABLE__) {
26+
console.log('✅ Licensed Fonts loaded.')
27+
injectLicensedFonts()
28+
}
1929

2030
const pinia = createPinia()
2131
const router = createRouter({

0 commit comments

Comments
 (0)