Skip to content

Commit

Permalink
Updated themes.
Browse files Browse the repository at this point in the history
  • Loading branch information
joegl committed Jul 24, 2023
1 parent 566b3a8 commit 443fcbb
Show file tree
Hide file tree
Showing 97 changed files with 13,710 additions and 5,548 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: theme
description: 'Stanford Minimally Branded Theme'
package: Stanford
version: 9.x-1.4-dev
core_version_requirement: ^9
core_version_requirement: ^9 || ^10
base theme: stanford_basic
libraries:
- minimally_branded_subtheme/allpages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Prepares variables for the html.html.twig template.
*/
function minimally_branded_subtheme_preprocess_html(&$variables) {
$variables['stanford_basic_path'] = drupal_get_path('theme', 'stanford_basic');
$variables['stanford_basic_path'] = \Drupal::service('extension.list.theme')->getPath('stanford_basic');
}

/**
Expand All @@ -18,4 +18,4 @@ function minimally_branded_subtheme_theme_suggestions_block_alter(array &$sugges
if (!empty($variables['elements']['#id']) && $variables['elements']['#id'] == 'minimally_branded_subtheme_search') {
$suggestions[] = 'block__stanford_basic_search';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
}
}

.ptype-stanford-entity {
.ptype-stanford-entity,
.paragraph--type--stanford-entity {
.ds-entity--stanford-publication {
.su-card__contents {
> h2 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": false,
"endOfLine": "auto"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Gets size stats for built islands.
*/
const { basename, join } = require('path')
const { green, red, yellow, white } = require('kleur')
const gzipSize = require('gzip-size')
const brotliSize = require('brotli-size')
const prettyBytes = require('pretty-bytes')
const fs = require('fs/promises')

/**
*
* Sauce pulled from here:
* https://github.com/developit/microbundle/blob/ecb0b022912397bcf98550c1a783e9e0534f33e5/src/lib/compressed-size.js
*/
function getPadLeft(str, width, char = ' ') {
return char.repeat(width - str.length)
}

function formatSize(size, filename, suffix, raw) {
const pretty = raw ? `${size} B` : prettyBytes(size)
const color = size < 5000 ? green : size > 40000 ? red : yellow
const indent = getPadLeft(pretty, 13)
return `${indent}${color(pretty)}: ${white(basename(filename))}${suffix}`
}

async function getSizeInfo(path, filename) {
const code = await fs.readFile(path)

const [original, gzip, brotli] = await Promise.all([
fs.stat(path).then((x) => x.size),
gzipSize(code).catch(() => null),
brotliSize.sync(code),
])

const raw = original < 5000

let out = formatSize(original, filename, '', raw)

out += '\n' + formatSize(gzip, filename, '.gz', raw)

if (brotli) {
out += '\n' + formatSize(brotli, filename, '.br', raw)
}

return out
}

class FileSizePlugin {
apply(compiler) {
compiler.hooks.done.tap(
'File Size Plugin',
async (
stats /* stats is passed as an argument when done hook is tapped. */,
) => {
const promises = []
stats.compilation.assetsInfo.forEach((value, key) => {
const filePath = join(stats.compilation.outputOptions.path, key)
promises.push(getSizeInfo(filePath, key))
})

const resolve = await Promise.all(promises)

resolve.map((log) => console.log(log))
},
)
}
}

module.exports = FileSizePlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<html><head><meta charset="utf-8"/><title>Islands</title><meta name="viewport" content="width=device-width,initial-scale=1"/><style>body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI',
Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.preview {
width: 100%;
max-width: 1500px;
margin: 80px auto;
border: 1px dashed rgba(0, 0, 0, 0.2);
position: relative;
}

.preview::before {
content: 'Island';
position: absolute;
display: block;
top: -18px;
font-size: 11px;
color: rgba(0, 0, 0, 0.5);
}</style><script defer="defer" src="/islands/main-menu.island.umd.js"></script></head><body><div class="preview"><div data-island="main-menu-island"></div></div></body></html>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "preact-island-starter",
"version": "1.0.0",
"description": "No configuration starter project for Preact Island",
"license": "MIT",
"author": "Marcus Wood",
"main": "index.js",
"scripts": {
"build": "NODE_ENV=production webpack --env prod",
"codegen": "npx playwright codegen",
"dev": "webpack serve --env dev",
"test": "npx playwright test",
"test-headed": "npx playwright test --headed",
"test-headed-slow": "SLOW=true npx playwright test --headed",
"tsc": "tsc --noEmit -p tsconfig.app.json",
"prettier": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
"prettier-fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\""
},
"dependencies": {
"@preact/preset-vite": "^2.3.0",
"@vanilla-extract/css": "^1.7.2",
"@vanilla-extract/dynamic": "^2.0.2",
"@vanilla-extract/recipes": "^0.2.5",
"@vanilla-extract/sprinkles": "^1.4.1",
"clsx": "^1.2.1",
"jsona": "^1.11.0",
"polished": "^4.2.2",
"preact": "^10.5.7",
"preact-island": "^1.1.0",
"preact-render-to-string": "^5.1.12",
"redaxios": "^0.4.1",
"styled-components": "^5.3.11"
},
"devDependencies": {
"@babel/preset-env": "^7.18.9",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@playwright/test": "^1.25.1",
"@types/webpack": "^5.28.0",
"@vanilla-extract/babel-plugin": "^1.1.7",
"@vanilla-extract/webpack-plugin": "^2.1.11",
"babel-loader": "^8.2.5",
"brotli-size": "^4.0.0",
"css-loader": "^6.7.1",
"dotenv": "^10.0.0",
"glob": "^8.0.3",
"gzip-size": "^6.0.0",
"html-webpack-plugin": "^5.5.0",
"kleur": "^4.1.5",
"prettier": "^2.6.2",
"pretty-bytes": "^5.0.0",
"style-loader": "^3.3.1",
"ts-node": "~10.8.0",
"typescript": "^4.6.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import type { PlaywrightTestConfig } from '@playwright/test'
import { devices } from '@playwright/test'

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './src',
/* Maximum time one test can run for. */
timeout: 20 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
},
webServer: {
command: 'npm run dev',
url: 'http://localhost:7777/',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
},
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://localhost:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
video: 'retain-on-failure',
trace: 'retain-on-failure',

baseURL: 'http://localhost:7777/',
launchOptions: {
slowMo: process.env.SLOW === 'true' ? 3000 : 0,
},
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},

// {
// name: 'firefox',
// use: {
// ...devices['Desktop Firefox'],
// },
// },

// {
// name: 'webkit',
// use: {
// ...devices['Desktop Safari'],
// },
// },

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: {
// ...devices['Pixel 5'],
// },
// },
// {
// name: 'Mobile Safari',
// use: {
// ...devices['iPhone 12'],
// },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: {
// channel: 'msedge',
// },
// },
// {
// name: 'Google Chrome',
// use: {
// channel: 'chrome',
// },
// },
],

/* Folder for test artifacts such as screenshots, videos, traces, etc. */
// outputDir: 'test-results/',

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// port: 3000,
// },
}

export default config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const Caret = ({...props}) => {
return (
<svg role="presentation" width="24" height="24" viewBox="0 0 24 24" fill="none" {...props}>
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.4887 5.41566C24.1363 6.00024 24.1737 6.98449 23.5725 7.61404L13.1725 18.5029C12.8697 18.8199 12.4449 19 12 19C11.5551 19 11.1303 18.8199 10.8275 18.5029L0.427538 7.61404C-0.173746 6.98449 -0.136251 6.00024 0.511286 5.41566C1.15882 4.83108 2.17119 4.86753 2.77248 5.49708L12 15.1584L21.2275 5.49708C21.8288 4.86753 22.8412 4.83108 23.4887 5.41566Z" fill="currentColor"/>
</svg>
)
}
export default Caret;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Close = ({...props}) => {
return (
<svg width="22px" height="26px" viewBox="0 0 24 24" fill="none" {...props}>
<g id="Menu / Close_SM">
<path id="Vector" d="M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</g>
</svg>
)
}
export default Close;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Hamburger = ({...props}) => {
return (
<svg width="30px" height="26px" viewBox="0 0 24 24" fill="none" {...props}>
<path d="M4 18L20 18" stroke="#000000" stroke-width="2" stroke-linecap="round"/>
<path d="M4 12L20 12" stroke="#000000" stroke-width="2" stroke-linecap="round"/>
<path d="M4 6L20 6" stroke="#000000" stroke-width="2" stroke-linecap="round"/>
</svg>
)
}
export default Hamburger;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const MagnifyingGlass = ({...props}) => {
return (

<svg fill="currentColor" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" width="800px" height="800px" viewBox="0 0 390.704 390.704" {...props}>
<g>
<g>
<path d="M379.711,326.556L265.343,212.188c30.826-54.189,23.166-124.495-23.001-170.663c-55.367-55.366-145.453-55.366-200.818,0
c-55.365,55.366-55.366,145.452,0,200.818c46.167,46.167,116.474,53.827,170.663,23.001l114.367,114.369
c14.655,14.655,38.503,14.654,53.157,0C394.367,365.059,394.368,341.212,379.711,326.556z M214.057,214.059
c-39.77,39.771-104.479,39.771-144.25,0c-39.77-39.77-39.77-104.48,0-144.25c39.771-39.77,104.48-39.77,144.25,0
C253.828,109.579,253.827,174.29,214.057,214.059z"/>
</g>
</g>
</svg>
)
}
export default MagnifyingGlass;
Loading

0 comments on commit 443fcbb

Please sign in to comment.