Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9328feed19 | ||
|
|
2542354d5c |
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
contact_links:
|
contact_links:
|
||||||
- name: Feature Requests
|
- name: Feature Requests
|
||||||
url: https://github.com/shoelace-style/webawesome-alpha/discussions/categories/ideas
|
url: https://github.com/shoelace-style/shoelace/discussions/categories/ideas
|
||||||
about: All requests for new features should go here.
|
about: All requests for new features should go here.
|
||||||
- name: Help & Support
|
- name: Help & Support
|
||||||
url: https://github.com/shoelace-style/webawesome-alpha/discussions/categories/help-support
|
url: https://github.com/shoelace-style/shoelace/discussions/categories/help
|
||||||
about: Please don't create issues for personal help requests. Instead, ask your question on the discussion forum.
|
about: Please don't create issues for personal help requests. Instead, ask your question on the discussion forum.
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [next]
|
branches: [next]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
client_test:
|
client_test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -31,17 +30,10 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run prettier
|
run: npm run prettier
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build:alpha
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
|
|
||||||
- name: Install Playwright
|
- name: Install Playwright
|
||||||
run: npx playwright install --with-deps
|
run: npx playwright install --with-deps
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
|
|
||||||
- name: Run CSR tests
|
- name: Run CSR tests
|
||||||
# FAIL_FAST to fail on first failing test.
|
# FAIL_FAST to fail on first failing test.
|
||||||
run: FAIL_FAST="true" CSR_ONLY="true" npm run test
|
run: FAIL_FAST="true" CSR_ONLY="true" npm run test
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
@@ -26,17 +26,17 @@ jobs:
|
|||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
# Just lint here too. Save some GH Action minutes and not need to use "depends_on" or anything.
|
||||||
|
- name: Lint
|
||||||
|
run: npm run prettier
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build:alpha
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
|
|
||||||
- name: Install Playwright
|
- name: Install Playwright
|
||||||
run: npx playwright install --with-deps
|
run: npx playwright install --with-deps
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
|
|
||||||
- name: Run SSR tests
|
- name: Run SSR tests
|
||||||
# FAIL_FAST to fail on first failing test.
|
# FAIL_FAST to fail on first failing test.
|
||||||
run: FAIL_FAST="true" SSR_ONLY="true" npm run test
|
run: FAIL_FAST="true" SSR_ONLY="true" npm run test
|
||||||
working-directory: ./packages/webawesome
|
|
||||||
|
|
||||||
10
.gitignore
vendored
@@ -1,12 +1,12 @@
|
|||||||
_site
|
_site
|
||||||
.cache
|
.cache
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
dist/
|
dist/
|
||||||
dist-cdn/
|
dist-cdn/
|
||||||
|
docs/public/pagefind
|
||||||
node_modules
|
node_modules
|
||||||
packages/**/*/src/react
|
src/react
|
||||||
|
.astro
|
||||||
cdn/
|
cdn/
|
||||||
yarn.lock
|
|
||||||
_bundle_
|
|
||||||
/packages/webawesome-pro
|
|
||||||
/packages/webawesome-app
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
*.hbs
|
*.hbs
|
||||||
*.md
|
*.md
|
||||||
!docs/docs/patterns/**/*.md
|
|
||||||
docs/docs/patterns/blog-news/post-list.md
|
|
||||||
.cache
|
.cache
|
||||||
.github
|
.github
|
||||||
cspell.json
|
cspell.json
|
||||||
|
|||||||
39
README.md
@@ -31,30 +31,6 @@ If that's not what you're trying to do, the [documentation website](https://weba
|
|||||||
|
|
||||||
Components are built with [LitElement](https://lit-element.polymer-project.org/), a custom elements base class that provides an intuitive API and reactive data binding. The build is a custom script with bundling powered by [esbuild](https://esbuild.github.io/).
|
Components are built with [LitElement](https://lit-element.polymer-project.org/), a custom elements base class that provides an intuitive API and reactive data binding. The build is a custom script with bundling powered by [esbuild](https://esbuild.github.io/).
|
||||||
|
|
||||||
### Understanding the Web Awesome monorepo
|
|
||||||
|
|
||||||
Web Awesome uses [NPM workspaces](https://docs.npmjs.com/cli/v11/using-npm/workspaces) for its monorepo structure and is fairly minimal in what it provides.
|
|
||||||
|
|
||||||
By using a NPM workspaces and a monorepo structure, we can get consistent builds, shared configurations, and reduced duplication across repositories which reduces regressions and forces consistency across `webawesome`, `webawesome-pro`, and `webawesome-app`.
|
|
||||||
|
|
||||||
Generally, if you plan to only work with the free version of `webawesome` it is easiest to go to `packages/webawesome` and run all commands from there.
|
|
||||||
|
|
||||||
### Where do NPM dependencies go?
|
|
||||||
|
|
||||||
Any dependencies intended to be used across all packages (IE: `prettier`, `eslint`) that are _NOT_ used at runtime should be in the root `devDependencies` of `package.json`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install -D -w prettier
|
|
||||||
```
|
|
||||||
|
|
||||||
Any dependencies that will be used at runtime by a package should be part of the specific package's `"dependencies"` such as `lit`. This is required because if that dependency is not in the `packages/*/package.json`, it will not be installed when used via NPM.
|
|
||||||
|
|
||||||
Individual packages are also free to install devDependencies as needed as long as they are specific to that package only.
|
|
||||||
|
|
||||||
To do install a package specific to a package, change your working directory to that package's root
|
|
||||||
|
|
||||||
IE: `cd packages/webawesome && npm install <package-name>`
|
|
||||||
|
|
||||||
### Forking the Repo
|
### Forking the Repo
|
||||||
|
|
||||||
Start by [forking the repo](https://github.com/shoelace-style/webawesome/fork) on GitHub, then clone it locally and install dependencies.
|
Start by [forking the repo](https://github.com/shoelace-style/webawesome/fork) on GitHub, then clone it locally and install dependencies.
|
||||||
@@ -67,10 +43,9 @@ npm install
|
|||||||
|
|
||||||
### Developing
|
### Developing
|
||||||
|
|
||||||
Once you've cloned the repo, run the following command from the respective directory within `packages/*`
|
Once you've cloned the repo, run the following command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd packages/webawesome
|
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -81,7 +56,6 @@ This will spin up the dev server. After the initial build, a browser will open a
|
|||||||
To generate a production build, run the following command.
|
To generate a production build, run the following command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd packages/webawesome
|
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -92,24 +66,15 @@ You can also run `npm run build:serve` to start an [`http-server`](https://www.n
|
|||||||
To scaffold a new component, run the following command, replacing `wa-tag-name` with the desired tag name.
|
To scaffold a new component, run the following command, replacing `wa-tag-name` with the desired tag name.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd packages/webawesome
|
|
||||||
npm run create wa-tag-name
|
npm run create wa-tag-name
|
||||||
```
|
```
|
||||||
|
|
||||||
This will generate a source file, a stylesheet, and a docs page for you. When you start the dev server, you'll find the new component in the "Components" section of the sidebar.
|
This will generate a source file, a stylesheet, and a docs page for you. When you start the dev server, you'll find the new component in the "Components" section of the sidebar.
|
||||||
|
|
||||||
### Adding additional packages
|
|
||||||
|
|
||||||
Right now the only additional packages are in private repositories.
|
|
||||||
|
|
||||||
To add additional packages from other repositories, run: `git clone <url> packages/<package-name>` to clone your repo into `packages/`.
|
|
||||||
|
|
||||||
Make sure to run `npm install` at the root of the monorepo after adding your package!
|
|
||||||
|
|
||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
Web Awesome is an open source project and contributions are encouraged! If you're interesting in contributing, please review the [contribution guidelines](CONTRIBUTING.md) first.
|
Web Awesome is an open source project and contributions are encouraged! If you're interesting in contributing, please review the [contribution guidelines](CONTRIBUTING.md) first.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Web Awesome is available under the terms of the MIT license.
|
Web Awesome is available under the terms of the MIT license.
|
||||||
|
|||||||
@@ -15,19 +15,16 @@
|
|||||||
"autoloading",
|
"autoloading",
|
||||||
"autoplay",
|
"autoplay",
|
||||||
"bezier",
|
"bezier",
|
||||||
"Blockquotes",
|
|
||||||
"boxicons",
|
"boxicons",
|
||||||
"CACHEABLE",
|
"CACHEABLE",
|
||||||
"callout",
|
"callout",
|
||||||
"callouts",
|
"callouts",
|
||||||
"canvastext",
|
|
||||||
"chatbubble",
|
"chatbubble",
|
||||||
"checkmark",
|
"checkmark",
|
||||||
"Clippy",
|
"Clippy",
|
||||||
"codebases",
|
"codebases",
|
||||||
"codepen",
|
"codepen",
|
||||||
"colocated",
|
"colocated",
|
||||||
"colorjs",
|
|
||||||
"colour",
|
"colour",
|
||||||
"combobox",
|
"combobox",
|
||||||
"Commonmark",
|
"Commonmark",
|
||||||
@@ -61,8 +58,6 @@
|
|||||||
"exportmaps",
|
"exportmaps",
|
||||||
"exportparts",
|
"exportparts",
|
||||||
"fieldsets",
|
"fieldsets",
|
||||||
"focusin",
|
|
||||||
"focusout",
|
|
||||||
"fontawesome",
|
"fontawesome",
|
||||||
"formaction",
|
"formaction",
|
||||||
"formdata",
|
"formdata",
|
||||||
@@ -72,7 +67,6 @@
|
|||||||
"formtarget",
|
"formtarget",
|
||||||
"FOUC",
|
"FOUC",
|
||||||
"FOUCE",
|
"FOUCE",
|
||||||
"Frontmatter",
|
|
||||||
"fullscreen",
|
"fullscreen",
|
||||||
"gestern",
|
"gestern",
|
||||||
"giga",
|
"giga",
|
||||||
@@ -134,7 +128,6 @@
|
|||||||
"petabit",
|
"petabit",
|
||||||
"Preact",
|
"Preact",
|
||||||
"preconnect",
|
"preconnect",
|
||||||
"prerendered",
|
|
||||||
"prismjs",
|
"prismjs",
|
||||||
"progressbar",
|
"progressbar",
|
||||||
"radiogroup",
|
"radiogroup",
|
||||||
@@ -155,7 +148,6 @@
|
|||||||
"scrollbars",
|
"scrollbars",
|
||||||
"scrollend",
|
"scrollend",
|
||||||
"scroller",
|
"scroller",
|
||||||
"Scrollers",
|
|
||||||
"Segoe",
|
"Segoe",
|
||||||
"semibold",
|
"semibold",
|
||||||
"shadowrootmode",
|
"shadowrootmode",
|
||||||
|
|||||||
@@ -4,11 +4,8 @@ import { customElementVsCodePlugin } from 'custom-element-vs-code-integration';
|
|||||||
import { parse } from 'comment-parser';
|
import { parse } from 'comment-parser';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { pascalCase } from 'pascal-case';
|
import { pascalCase } from 'pascal-case';
|
||||||
import * as url from 'url';
|
|
||||||
import * as path from "node:path"
|
|
||||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
||||||
|
|
||||||
const packageData = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
|
const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
||||||
const { name, description, version, author, homepage, license } = packageData;
|
const { name, description, version, author, homepage, license } = packageData;
|
||||||
const outdir = 'dist-cdn';
|
const outdir = 'dist-cdn';
|
||||||
|
|
||||||
@@ -186,4 +183,3 @@ export default {
|
|||||||
// })
|
// })
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import * as fs from "node:fs"
|
|
||||||
import { anchorHeadingsPlugin } from './_utils/anchor-headings.js';
|
import { anchorHeadingsPlugin } from './_utils/anchor-headings.js';
|
||||||
import { codeExamplesPlugin } from './_utils/code-examples.js';
|
import { codeExamplesPlugin } from './_utils/code-examples.js';
|
||||||
import { copyCodePlugin } from './_utils/copy-code.js';
|
import { copyCodePlugin } from './_utils/copy-code.js';
|
||||||
import { currentLink } from './_utils/current-link.js';
|
import { currentLink } from './_utils/current-link.js';
|
||||||
import { highlightCodePlugin } from './_utils/highlight-code.js';
|
import { highlightCodePlugin } from './_utils/highlight-code.js';
|
||||||
import { markdown } from './_utils/markdown.js';
|
import { markdown } from './_utils/markdown.js';
|
||||||
|
import { removeDataAlphaElements } from './_utils/remove-data-alpha-elements.js';
|
||||||
// import { formatCodePlugin } from './_utils/format-code.js';
|
// import { formatCodePlugin } from './_utils/format-code.js';
|
||||||
// import litPlugin from '@lit-labs/eleventy-plugin-lit';
|
// import litPlugin from '@lit-labs/eleventy-plugin-lit';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
@@ -22,10 +22,12 @@ import * as url from 'url';
|
|||||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
||||||
|
|
||||||
const packageData = JSON.parse(await readFile(path.join(__dirname, '..', 'package.json'), 'utf-8'));
|
const packageData = JSON.parse(await readFile(path.join(__dirname, '..', 'package.json'), 'utf-8'));
|
||||||
|
const isAlpha = process.argv.includes('--alpha');
|
||||||
const isDev = process.argv.includes('--develop');
|
const isDev = process.argv.includes('--develop');
|
||||||
|
|
||||||
const globalData = {
|
const globalData = {
|
||||||
package: packageData,
|
package: packageData,
|
||||||
|
isAlpha,
|
||||||
layout: 'page.njk',
|
layout: 'page.njk',
|
||||||
server: {
|
server: {
|
||||||
head: '',
|
head: '',
|
||||||
@@ -34,21 +36,31 @@ const globalData = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (eleventyConfig) {
|
export default function (eleventyConfig) {
|
||||||
/**
|
/**
|
||||||
* If you plan to add or remove any of these extensions, make sure to let either Konnor or Cory know as these passthrough extensions
|
* If you plan to add or remove any of these extensions, make sure to let either Konnor or Cory know as these passthrough extensions
|
||||||
* will also need to be updated in the Web Awesome App.
|
* will also need to be updated in the Web Awesome App.
|
||||||
*/
|
*/
|
||||||
const passThroughExtensions = ['js', 'css', 'png', 'svg', 'jpg', 'mp4'];
|
const passThroughExtensions = ['js', 'css', 'png', 'svg', 'jpg', 'mp4'];
|
||||||
|
|
||||||
const docsDir = path.join(process.env.BASE_DIR || ".", 'docs');
|
const baseDir = process.env.BASE_DIR || 'docs';
|
||||||
const passThrough = [...passThroughExtensions.map(ext => path.join(docsDir, '**/*.' + ext))];
|
const passThrough = [...passThroughExtensions.map(ext => path.join(baseDir, '**/*.' + ext))];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the guard we use for now to make sure our final built files dont need a 2nd pass by the server. This keeps us able to still deploy the bare HTML files on Vercel until the app is ready.
|
* This is the guard we use for now to make sure our final built files dont need a 2nd pass by the server. This keeps us able to still deploy the bare HTML files on Vercel until the app is ready.
|
||||||
*/
|
*/
|
||||||
const serverBuild = process.env.WEBAWESOME_SERVER === 'true';
|
const serverBuild = process.env.WEBAWESOME_SERVER === 'true';
|
||||||
|
|
||||||
|
// NOTE - alpha setting removes certain pages
|
||||||
|
if (isAlpha) {
|
||||||
|
eleventyConfig.ignores.add('**/experimental/**');
|
||||||
|
eleventyConfig.ignores.add('**/layout/**');
|
||||||
|
eleventyConfig.ignores.add('**/patterns/**');
|
||||||
|
eleventyConfig.ignores.add('**/style-utilities/**');
|
||||||
|
eleventyConfig.ignores.add('**/components/code-demo.md');
|
||||||
|
eleventyConfig.ignores.add('**/components/viewport-demo.md');
|
||||||
|
}
|
||||||
|
|
||||||
// Add template data
|
// Add template data
|
||||||
for (let name in globalData) {
|
for (let name in globalData) {
|
||||||
eleventyConfig.addGlobalData(name, globalData[name]);
|
eleventyConfig.addGlobalData(name, globalData[name]);
|
||||||
@@ -103,6 +115,9 @@ export default async function (eleventyConfig) {
|
|||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
|
// Remove elements that have [data-alpha="remove"]
|
||||||
|
eleventyConfig.addPlugin(removeDataAlphaElements({ isAlpha }));
|
||||||
|
|
||||||
// Use our own markdown instance
|
// Use our own markdown instance
|
||||||
eleventyConfig.setLibrary('md', markdown);
|
eleventyConfig.setLibrary('md', markdown);
|
||||||
|
|
||||||
@@ -172,9 +187,9 @@ export default async function (eleventyConfig) {
|
|||||||
// eleventyConfig.addPlugin(formatCodePlugin());
|
// eleventyConfig.addPlugin(formatCodePlugin());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
eleventyConfig.addPassthroughCopy({
|
||||||
let assetsDir = path.join(process.env.BASE_DIR || "docs", "assets")
|
'docs/assets': 'assets',
|
||||||
fs.cpSync(assetsDir, path.join(eleventyConfig.directories.output, "assets"), { recursive: true })
|
});
|
||||||
|
|
||||||
for (let glob of passThrough) {
|
for (let glob of passThrough) {
|
||||||
eleventyConfig.addPassthroughCopy(glob);
|
eleventyConfig.addPassthroughCopy(glob);
|
||||||
@@ -204,16 +219,14 @@ export default async function (eleventyConfig) {
|
|||||||
// componentModules,
|
// componentModules,
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
return {
|
||||||
|
markdownTemplateEngine: 'njk',
|
||||||
|
dir: {
|
||||||
|
input: 'docs',
|
||||||
|
includes: '_includes',
|
||||||
|
layouts: '_layouts',
|
||||||
|
},
|
||||||
|
templateFormats: ['njk', 'md'],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const config = {
|
|
||||||
markdownTemplateEngine: 'njk',
|
|
||||||
dir: {
|
|
||||||
input: 'docs',
|
|
||||||
includes: '_includes',
|
|
||||||
layouts: '_layouts',
|
|
||||||
},
|
|
||||||
templateFormats: ['njk', 'md'],
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,15 +2,12 @@
|
|||||||
* @module components Fetches components from custom-elements.json and exposes them in a saner format.
|
* @module components Fetches components from custom-elements.json and exposes them in a saner format.
|
||||||
*/
|
*/
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { join, dirname, resolve } from 'path';
|
import { dirname, resolve } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
const customElementsJSON = process.env.DIST_DIR
|
|
||||||
? join(process.env.DIST_DIR, "custom-elements.json")
|
|
||||||
: resolve(__dirname, '../../dist/custom-elements.json')
|
|
||||||
|
|
||||||
const manifest = JSON.parse(readFileSync(customElementsJSON), 'utf-8');
|
const manifest = JSON.parse(readFileSync(resolve(__dirname, '../../dist/custom-elements.json'), 'utf-8'));
|
||||||
|
|
||||||
const components = manifest.modules.flatMap(module => {
|
const components = manifest.modules.flatMap(module => {
|
||||||
return module.declarations
|
return module.declarations
|
||||||
@@ -76,4 +73,3 @@ components.sort((a, b) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export default components;
|
export default components;
|
||||||
|
|
||||||
1
docs/_data/hueRanges.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { hueRanges as default } from '../assets/scripts/tweak/data.js';
|
||||||
@@ -5,11 +5,11 @@
|
|||||||
<meta name="theme-color" content="#f36944">
|
<meta name="theme-color" content="#f36944">
|
||||||
|
|
||||||
<script type="module" src="/assets/scripts/code-examples.js"></script>
|
<script type="module" src="/assets/scripts/code-examples.js"></script>
|
||||||
|
|
||||||
<script type="module" src="/assets/scripts/scroll.js"></script>
|
<script type="module" src="/assets/scripts/scroll.js"></script>
|
||||||
<script type="module" src="/assets/scripts/turbo.js"></script>
|
<script type="module" src="/assets/scripts/turbo.js"></script>
|
||||||
<script type="module" src="/assets/scripts/search.js"></script>
|
<script type="module" src="/assets/scripts/search.js"></script>
|
||||||
<script type="module" src="/assets/scripts/outline.js"></script>
|
<script type="module" src="/assets/scripts/outline.js"></script>
|
||||||
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar.js"></script>{% endif %}
|
|
||||||
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar-tweaks.js"></script>{% endif %}
|
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar-tweaks.js"></script>{% endif %}
|
||||||
<script defer data-domain="backers.webawesome.com" src="https://plausible.io/js/script.js"></script>
|
<script defer data-domain="backers.webawesome.com" src="https://plausible.io/js/script.js"></script>
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="description" content="{{ description }}">
|
<meta name="description" content="{{ description }}">
|
||||||
{% if noindex or unlisted %}<meta name="robots" content="noindex">{% endif %}
|
{% if noindex %}<meta name="robots" content="noindex">{% endif %}
|
||||||
|
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
|
|
||||||
@@ -30,25 +30,9 @@
|
|||||||
{# Web Awesome #}
|
{# Web Awesome #}
|
||||||
<script type="module" src="/dist/webawesome.loader.js"></script>
|
<script type="module" src="/dist/webawesome.loader.js"></script>
|
||||||
|
|
||||||
{# Fallback loading when using the free repo #}
|
|
||||||
<link rel="preconnect" href="https://early.webawesome.com">
|
|
||||||
<script type="module">
|
|
||||||
document.addEventListener("wa-discovery-complete", loadLayout)
|
|
||||||
function loadLayout () {
|
|
||||||
if (!customElements.get("wa-page")) {
|
|
||||||
import("https://early.webawesome.com/webawesome@3.0.0-alpha.13/dist/components/page/page.js")
|
|
||||||
.catch((e) => {
|
|
||||||
console.error(e)
|
|
||||||
// known errors with dual registration. This is only a thing in the free repo.
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="module" src="/assets/scripts/theme-picker.js"></script>
|
<script type="module" src="/assets/scripts/theme-picker.js"></script>
|
||||||
{# Preset Theme #}
|
{# Preset Theme #}
|
||||||
{% if noTheme %}
|
{% if forceTheme %}
|
||||||
{% elif forceTheme %}
|
|
||||||
<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/{{ forceTheme }}.css" render="blocking" fetchpriority="high" />
|
<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/{{ forceTheme }}.css" render="blocking" fetchpriority="high" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<noscript><link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/default.css" render="blocking" fetchpriority="high" /></noscript>
|
<noscript><link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/default.css" render="blocking" fetchpriority="high" /></noscript>
|
||||||
@@ -63,6 +47,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<link rel="stylesheet" href="/dist/styles/webawesome.css" />
|
<link rel="stylesheet" href="/dist/styles/webawesome.css" />
|
||||||
|
<link id="color-stylesheet" rel="stylesheet" href="/dist/styles/utilities.css" />
|
||||||
|
<link rel="stylesheet" href="/dist/styles/forms.css" />
|
||||||
|
|
||||||
{# Used by Web Awesome App to inject other assets into the head. #}
|
{# Used by Web Awesome App to inject other assets into the head. #}
|
||||||
{% server "head" %}
|
{% server "head" %}
|
||||||
|
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -1,5 +1,5 @@
|
|||||||
{%- if not page.data.unlisted -%}
|
{%- if not page.data.unlisted -%}
|
||||||
{% if page.url %}<a href="{{ page.url }}"{{ page.data.keywords | attr('data-keywords') }}>{% endif %}
|
<a href="{{ page.url }}"{{ page.data.keywords | attr('data-keywords') }}>
|
||||||
<wa-card with-header>
|
<wa-card with-header>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
{% include "svgs/" + (page.data.icon or "thumbnail-placeholder") + ".njk" ignore missing %}
|
{% include "svgs/" + (page.data.icon or "thumbnail-placeholder") + ".njk" ignore missing %}
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
<div class="wa-caption-s">{{ pageSubtitle }}</div>
|
<div class="wa-caption-s">{{ pageSubtitle }}</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</wa-card>
|
</wa-card>
|
||||||
{% if page.url %}</a>{% endif %}
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div id="page_slots_demo">
|
<div id="page_slots_demo">
|
||||||
<link rel="stylesheet" href="/docs/components/page/demo.css">
|
<link rel="stylesheet" href="./demo.css">
|
||||||
{% set slots = components.page.slots %}
|
{% set slots = components.page.slots %}
|
||||||
|
|
||||||
<fieldset id="page_slots_fieldset">
|
<fieldset id="page_slots_fieldset">
|
||||||
@@ -22,5 +22,5 @@
|
|||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
const cacheBust = new Date().toString()
|
const cacheBust = new Date().toString()
|
||||||
import(`/docs/components/page/demo.js?${cacheBust}`)
|
import(`./demo.js?${cacheBust}`)
|
||||||
</script>
|
</script>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<wa-select appearance="filled" size="small" value="default" pill class="preset-theme-selector">
|
<wa-select appearance="filled" size="small" value="default" pill class="preset-theme-selector">
|
||||||
<wa-icon slot="prefix" name="paintbrush" variant="regular"></wa-icon>
|
<wa-icon slot="prefix" name="paintbrush" variant="regular"></wa-icon>
|
||||||
{% for theme in collections.theme | sort %}
|
{% for theme in collections.theme | sort %}
|
||||||
<wa-option value="{{ theme.page.fileSlug }}">
|
<wa-option value="{{ theme.page.fileSlug }}"{{ ' data-alpha="remove"' if theme.noAlpha }}>
|
||||||
{{ theme.data.title }}
|
{{ theme.data.title }}
|
||||||
</wa-option>
|
</wa-option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<wa-dialog id="site-search" without-header light-dismiss>
|
<wa-dialog id="site-search" no-header light-dismiss>
|
||||||
<div id="site-search-container">
|
<div id="site-search-container">
|
||||||
{# Header #}
|
{# Header #}
|
||||||
<header>
|
<header>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
type="search"
|
type="search"
|
||||||
appearance="filled"
|
appearance="filled"
|
||||||
size="large"
|
size="large"
|
||||||
with-clear
|
clearable
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
autofocus
|
autofocus
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
23
docs/_includes/sidebar-group.njk
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{# Some collections (like "patterns") will not have any items in the alpha build for example. So this checks to make sure the collection exists. #}
|
||||||
|
{% if collections[tag] -%}
|
||||||
|
{% set groupUrl %}/docs/{{ tag }}/{% endset %}
|
||||||
|
{% set groupItem = groupUrl | getCollectionItemFromUrl %}
|
||||||
|
{% set children = groupItem.data.children if groupItem.data.children.length > 0 else (collections[tag] | sort) %}
|
||||||
|
|
||||||
|
<wa-details {{ ((tag in (tags or [])) or (groupUrl in page.url)) | attr('open') }}>
|
||||||
|
<h2 slot="summary">
|
||||||
|
{% if groupItem %}
|
||||||
|
<a href="{{ groupUrl }}" title="Overview">{{ title or (tag | capitalize) }}
|
||||||
|
<wa-icon name="grid-2"></wa-icon>
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
{{ title or (tag | capitalize) }}
|
||||||
|
{% endif %}
|
||||||
|
</h2>
|
||||||
|
<ul>
|
||||||
|
{% for page in children %}
|
||||||
|
{% include 'sidebar-link.njk' %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</wa-details>
|
||||||
|
{%- endif %}
|
||||||
16
docs/_includes/sidebar-link.njk
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{% if page | show -%}
|
||||||
|
<li>
|
||||||
|
<a href="{{ page.url }}">{{ page.data.title }}</a>
|
||||||
|
{% if page.data.status == 'experimental' %}<wa-icon name="flask"></wa-icon>{% endif %}
|
||||||
|
{% if page.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
|
||||||
|
|
||||||
|
{% set children = page.data.children %}
|
||||||
|
{% if children.length > 0 %}
|
||||||
|
<ul>
|
||||||
|
{% for page in children %}
|
||||||
|
{% include 'sidebar-link.njk' %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{%- endif %}
|
||||||
33
docs/_includes/sidebar.njk
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{# Getting started #}
|
||||||
|
<h2>Getting Started</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/docs/">Installation</a></li>
|
||||||
|
<li><a href="/docs/usage">Usage</a></li>
|
||||||
|
<li><a href="/docs/customizing">Customizing</a></li>
|
||||||
|
<li><a href="/docs/form-controls">Form Controls</a></li>
|
||||||
|
<li><a href="/docs/localization">Localization</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{# Resources #}
|
||||||
|
<h2>Resources</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/shoelace-style/webawesome-alpha/discussions" target="_blank">Help & Support</a></li>
|
||||||
|
<li><a href="/docs/resources/community">Community</a></li>
|
||||||
|
<li><a href="/docs/resources/accessibility">Accessibility</a></li>
|
||||||
|
<li><a href="/docs/resources/contributing">Contributing</a></li>
|
||||||
|
<li><a href="/docs/resources/changelog">Changelog</a></li>
|
||||||
|
<li><a href="/docs/resources/visual-tests">Visual Tests</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{% for tag, title in {
|
||||||
|
'themes': 'Themes',
|
||||||
|
'components': 'Components',
|
||||||
|
'native': 'Native Styles',
|
||||||
|
'utilities': 'Style Utilities',
|
||||||
|
'layout': 'Layout',
|
||||||
|
'patterns': 'Patterns',
|
||||||
|
'palettes': 'Color Palettes',
|
||||||
|
'tokens': 'Design Tokens'
|
||||||
|
} %}
|
||||||
|
{% include 'sidebar-group.njk' %}
|
||||||
|
{% endfor %}
|
||||||
@@ -3,7 +3,12 @@
|
|||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{%- if status %}
|
{%- if status %}
|
||||||
{%- if status == "experimental" %}
|
{%- if status == "wip" %}
|
||||||
|
<wa-badge variant="danger">
|
||||||
|
<wa-icon name="pickaxe"></wa-icon>
|
||||||
|
Work In Progress
|
||||||
|
</wa-badge>
|
||||||
|
{%- elif status == "experimental" %}
|
||||||
<wa-badge variant="warning">
|
<wa-badge variant="warning">
|
||||||
<wa-icon name="flask"></wa-icon>
|
<wa-icon name="flask"></wa-icon>
|
||||||
Experimental
|
Experimental
|
||||||
|
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
|
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 670 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 420 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
|
Before Width: | Height: | Size: 718 B After Width: | Height: | Size: 718 B |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 614 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 883 B After Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 540 B |
|
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 596 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 697 B After Width: | Height: | Size: 697 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |