diff --git a/.gitignore b/.gitignore
index b096194c35..446181f1f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,10 +6,6 @@
**/package-lock.json
/examples/*/yarn.lock
-/examples/cdn/js/*
-/examples/cdn/css/*
-/examples/cdn/fonts/*
-
# Code editors
*.sublime-*
diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js
index c102b06d83..2a6658898a 100644
--- a/.storybook/webpack.config.js
+++ b/.storybook/webpack.config.js
@@ -73,6 +73,10 @@ module.exports = async ({ config }) => {
__dirname,
'../packages/design-system/src/styles/'
),
+ react: 'preact/compat',
+ 'react-dom/test-utils': 'preact/test-utils',
+ 'react-dom': 'preact/compat', // Must be below test-utils
+ 'react/jsx-runtime': 'preact/jsx-runtime',
};
return config;
diff --git a/examples/cdn-preact/README.md b/examples/cdn-preact/README.md
new file mode 100644
index 0000000000..1d29638c16
--- /dev/null
+++ b/examples/cdn-preact/README.md
@@ -0,0 +1,15 @@
+## Example: Consuming assets from the CDN
+
+This shows the usage of CMS design system preact components from the CDN:
+
+- Include the core CSS bundle and theme
+- Include the JS vendor files and bundle
+- Use CSS layout, utility, and component classes
+- Render Preact components from our library
+
+See also: https://reactjs.org/docs/add-react-to-a-website.html
+
+## Getting started
+
+1. Serve the root of this directory from a webserver, with `npx http-server`
+2. View it in a browser by visiting http://localhost:8080
diff --git a/examples/cdn-preact/copy.sh b/examples/cdn-preact/copy.sh
new file mode 100644
index 0000000000..e8dc957d77
--- /dev/null
+++ b/examples/cdn-preact/copy.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+mkdir -p dist/js
+cp -R ../../packages/design-system/dist/js/. dist/js/
\ No newline at end of file
diff --git a/examples/cdn-preact/index.html b/examples/cdn-preact/index.html
new file mode 100644
index 0000000000..271b954def
--- /dev/null
+++ b/examples/cdn-preact/index.html
@@ -0,0 +1,65 @@
+
+
+
+
+ CDN Example
+
+
+
+
+
+
+
+
+
+
+
+
+ ExampleWebsite.gov
+
+
+
+
+
+
CDN Example
+
+ This is an example showing how to use the CDN. Some elements are simple and can be easily
+ created by applying a CSS class from the Design System. Some components are more complex
+ or are interactive. Our React-based component library is here for those more complex
+ cases.
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/cdn-preact/style.css b/examples/cdn-preact/style.css
new file mode 100644
index 0000000000..a3c84f0ef8
--- /dev/null
+++ b/examples/cdn-preact/style.css
@@ -0,0 +1,4 @@
+body {
+ margin: 0;
+ padding: 0;
+}
\ No newline at end of file
diff --git a/examples/cdn-web-components/README.md b/examples/cdn-web-components/README.md
new file mode 100644
index 0000000000..42e9ec377d
--- /dev/null
+++ b/examples/cdn-web-components/README.md
@@ -0,0 +1,15 @@
+## Example: Consuming assets from the CDN
+
+This shows the usage of CMS design system web components from the CDN:
+
+- Include the core CSS bundle and theme
+- Include the JS vendor files and bundle
+- Use CSS layout, utility, and component classes
+- Render web components from our library
+
+See also: https://reactjs.org/docs/add-react-to-a-website.html
+
+## Getting started
+
+1. Serve the root of this directory from a webserver, with `npx http-server`
+2. View it in a browser by visiting http://localhost:8080
diff --git a/examples/cdn-web-components/copy.sh b/examples/cdn-web-components/copy.sh
new file mode 100644
index 0000000000..e8dc957d77
--- /dev/null
+++ b/examples/cdn-web-components/copy.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+mkdir -p dist/js
+cp -R ../../packages/design-system/dist/js/. dist/js/
\ No newline at end of file
diff --git a/examples/cdn-web-components/index.html b/examples/cdn-web-components/index.html
new file mode 100644
index 0000000000..5eb47709e2
--- /dev/null
+++ b/examples/cdn-web-components/index.html
@@ -0,0 +1,44 @@
+
+
+
+
+ CDN Example
+
+
+
+
+
+
+
+ ExampleWebsite.gov
+ Hello world
+
+
+
+
+
+
CDN Example
+
+ This is an example showing how to use the CDN and our library of interactive web
+ components.
+
+
+
+ Weeeeeee!!!
+
+
+ I'm a button
+
+
+
+
+
+
diff --git a/examples/cdn-web-components/style.css b/examples/cdn-web-components/style.css
new file mode 100644
index 0000000000..a3c84f0ef8
--- /dev/null
+++ b/examples/cdn-web-components/style.css
@@ -0,0 +1,4 @@
+body {
+ margin: 0;
+ padding: 0;
+}
\ No newline at end of file
diff --git a/examples/preact-app/Gulpfile.js b/examples/preact-app/Gulpfile.js
new file mode 100644
index 0000000000..4212166338
--- /dev/null
+++ b/examples/preact-app/Gulpfile.js
@@ -0,0 +1,18 @@
+const gulp = require('gulp');
+
+/**
+ * Copy the static assets from the design system, such as the fonts and images.
+ * We could do this manually, but why not automate it so it's easy to do
+ * as things are updated :)
+ */
+gulp.task('copy-design-system', function () {
+ return gulp
+ .src([
+ 'node_modules/@cmsgov/design-system/dist/**/fonts/*',
+ 'node_modules/@cmsgov/design-system/dist/**/images/*',
+ 'node_modules/@cmsgov/design-system/dist/css/*.css',
+ ])
+ .pipe(gulp.dest('./dist/'));
+});
+
+gulp.task('default', gulp.series('copy-design-system'));
diff --git a/examples/preact-app/README.md b/examples/preact-app/README.md
new file mode 100644
index 0000000000..2b5c6b3d28
--- /dev/null
+++ b/examples/preact-app/README.md
@@ -0,0 +1,9 @@
+## Example: react-app
+
+This example shows how you can incorporate the design system into a Preact application. It uses [Webpack](https://webpack.js.org) to bundle and optimize JavaScript files, [Babel](https://babeljs.io/) to transpile JSX, and [Gulp](http://gulpjs.com/) to copy static assets from the design system.
+
+## Getting started
+
+1. Install packages: `npm install` or `yarn install`
+1. Compile and bundle assets: `npm run build` or `yarn run build`
+1. Open `index.html` in a browser.
diff --git a/examples/preact-app/babel.config.js b/examples/preact-app/babel.config.js
new file mode 100644
index 0000000000..30d757e5dd
--- /dev/null
+++ b/examples/preact-app/babel.config.js
@@ -0,0 +1,26 @@
+module.exports = function (api) {
+ api.cache(true);
+
+ const presets = [
+ [
+ '@babel/preset-env',
+ {
+ useBuiltIns: 'entry',
+ corejs: '3.0.0',
+ },
+ ],
+ ];
+
+ return {
+ presets,
+ plugins: [
+ [
+ '@babel/plugin-transform-react-jsx',
+ {
+ pragma: 'h',
+ pragmaFrag: 'Fragment',
+ },
+ ],
+ ],
+ };
+};
diff --git a/examples/preact-app/index.html b/examples/preact-app/index.html
new file mode 100644
index 0000000000..fb2d038d6f
--- /dev/null
+++ b/examples/preact-app/index.html
@@ -0,0 +1,24 @@
+
+
+
+
+ Design System
+
+
+
+
+
+
Build assets before viewing
+
Seeing this message in the browser? Make sure to run the following command first:
+
+ yarn run build
+
+ or
+
+ npm run build
+
+
+
+
+
+
diff --git a/examples/preact-app/package.json b/examples/preact-app/package.json
new file mode 100644
index 0000000000..2f3a08df4e
--- /dev/null
+++ b/examples/preact-app/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "react-app-example",
+ "version": "1.0.0",
+ "private": true,
+ "dependencies": {
+ "@cmsgov/design-system": "^6.0.0",
+ "preact": "^10.11.3"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.20.12",
+ "@babel/plugin-transform-react-jsx": "7.20.13",
+ "@babel/preset-env": "^7.20.2",
+ "babel-loader": "^8.0.0",
+ "gulp": "^4.0.2",
+ "http-server": "14.1.1",
+ "webpack": "^5.75.0",
+ "webpack-cli": "^5.0.1"
+ },
+ "sideEffects": false,
+ "scripts": {
+ "build": "webpack --mode production --progress && gulp",
+ "serve": "http-server"
+ }
+}
diff --git a/examples/preact-app/src/scripts/index.js b/examples/preact-app/src/scripts/index.js
new file mode 100644
index 0000000000..b94ead3954
--- /dev/null
+++ b/examples/preact-app/src/scripts/index.js
@@ -0,0 +1,50 @@
+/* eslint-disable react/react-in-jsx-scope */
+
+// Named import from main entry file. This example has been configured to use Webpack's tree shaking
+// to only bundle imported components. Without this optimization, all components will be imported
+// your build process.
+
+import { Alert, Button, Drawer, UsaBanner } from '@cmsgov/design-system';
+import { render } from 'preact';
+import { useState } from 'preact/hooks';
+
+const Example = function () {
+ const [open, setOpen] = useState(false);
+ return (
+