Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
4004f91
Proof-of-concept using CSS Variables and PostCSS
kmonahan Jan 31, 2023
d08d0d9
Add variables and story for colors
kmonahan Feb 3, 2023
4b8aa7c
Add box shadows story
kmonahan Feb 9, 2023
be778b6
Add text styles
kmonahan Feb 9, 2023
68cf0d8
Add plugin for responsive font sizes
kmonahan Feb 10, 2023
cf38f4b
Replace autoprefixer with postcss-preset-env
kmonahan Feb 10, 2023
7321291
Follow existing Gesso directory names
kmonahan Feb 10, 2023
facb653
Refactor existing components to use CSS instead of Emotion
kmonahan Feb 10, 2023
c368ad6
Remove Emotion packages
kmonahan Feb 10, 2023
7c52ae8
added initial files for duration, easing and spacing variable stories
Feb 13, 2023
4759793
fixed linting errors
Feb 13, 2023
2d44bd9
Remove Emotion theme config
kmonahan Feb 14, 2023
6b73a1a
Use newer media query syntax and add max-width default queries
kmonahan Feb 14, 2023
85fcafa
implemented KJs suggestions
Feb 14, 2023
1d1c532
Merge pull request #10 from forumone/duration-easing-space
kmonahan Feb 15, 2023
1d47dfe
Port accessibility mixins from Gesso
kmonahan Feb 15, 2023
ed7835d
Merge branch 'gesso-for-react' of github.com:forumone/nextjs-project …
kmonahan Feb 15, 2023
f01aef2
Port over and update button mixin and example story
kmonahan Feb 15, 2023
71330d7
Port clearfix mixin from Gesso
kmonahan Feb 15, 2023
ba94336
Grid mixins and story
kmonahan Feb 16, 2023
557c3a8
Add image replace mixins
kmonahan Feb 16, 2023
90b5c02
Add list mixins and support multiple writing directions
kmonahan Feb 17, 2023
707c514
Move over mod-selectors mixin and some initial HTML elements
kmonahan Feb 17, 2023
32598ea
htmlelements
Feb 17, 2023
a901bdf
blockquote change
Feb 17, 2023
3e88d68
merged in gesso-for-react branch
Feb 17, 2023
6f274d4
merged in gesso-for-react branch
Feb 17, 2023
d2bafd9
added new elements
Feb 17, 2023
b8c2862
Remove Emotion renderer and reference in tsconfig
kmonahan Feb 21, 2023
a726630
Fix cascade layers breaking Storybook displays
kmonahan Feb 21, 2023
59c7088
in progress work
Feb 21, 2023
ea856f6
Merge branch 'gesso-for-react' into htmlelements
Feb 21, 2023
3b5e444
Set up heading styles for composing elsewhere
kmonahan Feb 21, 2023
d9a8649
Port layout components from Gesso
kmonahan Feb 21, 2023
d32cb95
Theme Storybook to match Gesso/F1 branding
kmonahan Feb 21, 2023
14abbf1
Port sidebar layout from Gesso
kmonahan Feb 22, 2023
48197ed
Migrate a few initial components
kmonahan Feb 22, 2023
abc1712
Standardize story types and format
kmonahan Feb 22, 2023
41a593b
more styling and components
Feb 22, 2023
f6153d7
merged in KJs work
Feb 23, 2023
0737bcb
fixed some linting errors
Feb 23, 2023
4312199
fixed some errors
Feb 23, 2023
c6e9efd
Add Icon component for loading SVG icons
kmonahan Feb 23, 2023
1818f77
some fixes
Feb 23, 2023
a15fdb6
Add Back to Top component
kmonahan Feb 23, 2023
8c1a842
refactoring, added typographic scale story
Feb 24, 2023
cfd2132
Merge branch 'gesso-for-react' into htmlelements
Feb 24, 2023
8877e95
Port Breadcrumb component
kmonahan Feb 24, 2023
aff6295
Merge htmlelements and fix type errors
kmonahan Feb 24, 2023
5da8734
Migrate ButtonGroup component
kmonahan Feb 24, 2023
f615451
Replace a lot of code with a regex
kmonahan Feb 24, 2023
bb5afb2
Migrate Card and fix Storybook controls
kmonahan Feb 27, 2023
18a44fc
Update to forked postcss-advanced-variables
kmonahan Feb 28, 2023
df03981
Replace repetitive link var setting with new mixin
kmonahan Feb 28, 2023
7a5559e
Allow img elements in placeholder story content
kmonahan Feb 28, 2023
7e3ff30
Port Details component and fix background images in Storybook
kmonahan Mar 1, 2023
c58545d
Switch some additional CSS rules to logical properties
kmonahan Mar 1, 2023
db0bc0e
Port Fieldset component
kmonahan Mar 1, 2023
56c17dc
Migrate Figure component
kmonahan Mar 6, 2023
99c0466
Standardize layer names
kmonahan Mar 6, 2023
6281636
Migrate Hero components
kmonahan Mar 6, 2023
fc193a2
Migrate Image Teaser component
kmonahan Mar 6, 2023
53ff577
Add alt text to placeholder image
kmonahan Mar 6, 2023
98fe010
Migrate Form Items
kmonahan Mar 7, 2023
4eae57e
Initial work on porting menus
kmonahan Mar 10, 2023
e0a03a2
Merge branch 'main' into gesso-for-react
kmonahan Mar 13, 2023
82538b7
Update to use Next 13 Link behavior
kmonahan Mar 13, 2023
6e72521
Add Overlay Menu
kmonahan Apr 10, 2023
ea13a8b
Add example responsive menu
kmonahan Apr 10, 2023
12fc79e
Create example page templates
kmonahan Apr 17, 2023
ce07d04
Add Stylelint and fix CSS linting issues
kmonahan Apr 17, 2023
6621e28
Add Storybook a11y add-on and fix accessibility violations
kmonahan Apr 24, 2023
85b3465
Add React Select and styling
kmonahan Apr 24, 2023
c1af473
Set up example NextJS pages
kmonahan May 1, 2023
3a295e8
Update to Storybook 7 and CSF 3
kmonahan May 2, 2023
845bb61
Update Storybook command for ddev
kmonahan May 8, 2023
c345ba0
Fix page name for About page
kmonahan May 8, 2023
f024f2b
Update README files
kmonahan May 13, 2023
111d0e7
Remove unneeded passHref
kmonahan Jun 2, 2023
72b90dd
simplified mixins call, added mdx doc file
Jun 12, 2023
65f64fa
Merge pull request #21 from forumone/advanced-variables-tweaks
kmonahan Jun 17, 2023
eb7d765
Remove deprecated package and a lingering reference to Emotion
kmonahan Jun 17, 2023
965d177
Revert "Merge pull request #21 from forumone/advanced-variables-tweaks"
kmonahan Jun 17, 2023
254f59e
Initial work refactoring icons to remove lazy loading
kmonahan Jun 19, 2023
626a31f
Build icons via command line
kmonahan Jun 23, 2023
5ce3688
Revert "Revert "Merge pull request #21 from forumone/advanced-variabl…
kmonahan Jun 23, 2023
b571030
Merge branch 'advanced-variables-tweaks' into gesso-for-react
kmonahan Jun 23, 2023
635016e
Merge branch 'gesso-for-react' into 22-fix-back-to-top
kmonahan Jun 23, 2023
17c34c5
Add story for icons
kmonahan Jun 23, 2023
af6ecf2
Document icons
kmonahan Jun 23, 2023
e9c8f35
Clean up
kmonahan Jun 23, 2023
6a81bed
Pass mainId down from page props
kmonahan Jun 24, 2023
a236b56
Use absolute path for importPaths
kmonahan Jun 24, 2023
96bae82
Overrides semver version to fix security issue.
kmonahan Jul 3, 2023
a39a4b3
Merge branch 'gesso-for-react' into 23-fix-main-id
kmonahan Jul 3, 2023
b649d61
Switch mainId to constant
kmonahan Jul 3, 2023
39a8c85
Remove errant prop
kmonahan Jul 3, 2023
e981130
Remove no longer needed conditional
kmonahan Jul 3, 2023
486e496
Merge pull request #28 from forumone/23-fix-main-id
kmonahan Jul 3, 2023
9140547
Merge branch 'gesso-for-react' into 22-fix-back-to-top
kmonahan Jul 3, 2023
3c42698
Merge pull request #27 from forumone/22-fix-back-to-top
kmonahan Jul 3, 2023
86b004e
Update packages and fix additional instance of mainId
kmonahan Jul 3, 2023
e70dd10
Update to Storybook 7.0.26 and switch to default export for preview.js
kmonahan Jul 5, 2023
93bb0f7
adds each as an ignored @ rule since it can be used
Jul 11, 2023
769f13f
Merge pull request #31 from forumone/add-each-to-ignore-rules
kmonahan Jul 12, 2023
84f0c22
Merge pull request #29 from forumone/fix-storybook-error
kmonahan Jul 12, 2023
4aa33c9
Fix syntax error in ddev command
kmonahan Jul 12, 2023
09038e3
Merge pull request #32 from forumone/ddev-error
coreylafferty Jul 12, 2023
235da94
Update version number to 1.0.1
kmonahan Jul 12, 2023
e1dfb32
Merge pull request #33 from forumone/1.x-RC
kmonahan Jul 12, 2023
ab2cc4f
moved grid styles in sidebar layout css into media queries to match f…
Jul 14, 2023
542b40e
added landing page template story
Jul 14, 2023
d8b29b1
adds spacing utility classes
Jul 14, 2023
9ae903b
Merge pull request #36 from forumone/sidebar-layout-mq
kmonahan Jul 15, 2023
e24c19a
Merge pull request #37 from forumone/landing-page-story
kmonahan Jul 15, 2023
f61f479
Update version number to 1.0.2
kmonahan Jul 19, 2023
8ff36f7
Merge pull request #39 from forumone/1.0.2-version-bump
kmonahan Jul 19, 2023
df1d5c3
Merge pull request #40 from forumone/1.x-RC
kmonahan Jul 19, 2023
92c2ae3
adding missing file (doh!)
coreylafferty Jul 19, 2023
54b2bec
Switch to shorthand properties to test tsc
kmonahan Jul 22, 2023
df1346a
Simplify template stories
kmonahan Jul 22, 2023
d7fb088
Update to Storybook 7.1.0
kmonahan Jul 22, 2023
a3aeeab
Merge pull request #41 from forumone/simplify-template-stories
kmonahan Jul 26, 2023
14a7fdb
Merge pull request #42 from forumone/storybook-710
kmonahan Jul 26, 2023
d8d20bd
added linkclasses to menu story
coreylafferty Jul 26, 2023
6541f1a
Merge pull request #38 from forumone/spacing-utility
kmonahan Jul 26, 2023
3a36916
Bump version number to 1.0.3
kmonahan Jul 26, 2023
b102353
Merge pull request #45 from forumone/1.x-RC
kmonahan Jul 26, 2023
73ad3ad
refactored constrain to be a component
coreylafferty Jul 26, 2023
4e0ff70
added default link class to css
coreylafferty Jul 26, 2023
d9371ed
added default link class to menu-footer css
coreylafferty Jul 26, 2023
fec6b27
switched var name to isHidden
coreylafferty Jul 26, 2023
3f93c00
Merge pull request #44 from forumone/add-linkclasses
kmonahan Aug 1, 2023
a48291b
Merge pull request #46 from forumone/constrain-refactor
kmonahan Aug 1, 2023
595b6cc
Fix typing on StyledSelect
kmonahan Aug 1, 2023
5fcacf3
Update to node 18
kmonahan Aug 1, 2023
f54f12f
Merge pull request #49 from forumone/update-node-18
kmonahan Aug 8, 2023
2dfcee6
Adjust Option generic to extend DropdownOption
kmonahan Aug 8, 2023
1910083
Adds a comment at the top of each icon component.
kmonahan Aug 8, 2023
2741e95
Merge pull request #50 from forumone/add-icon-comment
kmonahan Aug 8, 2023
1dea2aa
Version bump to 1.0.4
kmonahan Aug 9, 2023
7dcd0de
Merge pull request #51 from forumone/1.x-RC
kmonahan Aug 9, 2023
4309aac
adds clearfix as a utility class and adds it to wysiwyg component
coreylafferty Aug 10, 2023
e8b0cbe
merged in 1.x-RC
coreylafferty Aug 10, 2023
b345ad0
Merge pull request #52 from forumone/add-clearfix-class
kmonahan Aug 15, 2023
299d166
Bump version number
kmonahan Aug 15, 2023
e559b3c
Merge pull request #53 from forumone/1.x-RC
kmonahan Aug 15, 2023
77d8705
Merge pull request #48 from forumone/fix-styled-select
kmonahan Aug 29, 2023
e72daec
Version bump to 1.0.6
kmonahan Aug 29, 2023
b5ae698
Merge pull request #54 from forumone/1.x-RC
kmonahan Aug 29, 2023
a466600
Update version number in package-lock files too
kmonahan Aug 31, 2023
85d7a10
Merge branch '1.x-RC' into 1.x
kmonahan Aug 31, 2023
610fb65
Move app files down to base of repo. Remove services/app structure.
mdrayer Sep 19, 2023
7096c85
Keep name placeholder.
mdrayer Sep 19, 2023
0569be6
Merge pull request #58 from forumone/47-move-app-files
kmonahan Sep 22, 2023
5be1f62
Update html-react-parser to latest version
coreylafferty Oct 10, 2023
56a2d01
Merge pull request #60 from forumone/update-html-react-parser
coreylafferty Oct 10, 2023
b00bbb1
Update version to 1.0.7
kmonahan Oct 20, 2023
70bce90
Merge pull request #62 from forumone/1.x-RC
kmonahan Oct 20, 2023
40406dd
Update to Node 18.18
kmonahan Oct 20, 2023
f00327c
Update to Storybook 7.5.1
kmonahan Oct 20, 2023
733dc92
Replace @storybook/addon-styling with @storybook/addon-styling-webpack
kmonahan Oct 20, 2023
6582711
Remove new styling addon
kmonahan Oct 20, 2023
a62eb2b
Adds the accordion component based on the 'Gesso for Drupal' version
SirJohn96 Sep 19, 2023
05d730e
Adds missing comment and new line
SirJohn96 Sep 19, 2023
93b94d8
Updates the component to be more inline with React standards
SirJohn96 Sep 26, 2023
c5f45cc
Adjusts keydown functionality to use React API
SirJohn96 Oct 23, 2023
caa1ecd
Removes unnecessary class
SirJohn96 Oct 23, 2023
5cbabc4
adds focus for radio items
coreylafferty Oct 24, 2023
050fd3a
updated manager file
coreylafferty Oct 26, 2023
8e6ff63
added barHoverColor to SB theme
coreylafferty Oct 26, 2023
de50178
Merge pull request #57 from forumone/feature-component-accordion
kmonahan Nov 1, 2023
1f2b08e
Merge pull request #63 from forumone/update-storybook
kmonahan Nov 1, 2023
42d48d2
Merge pull request #64 from forumone/radio-focus-fix
kmonahan Nov 1, 2023
e9d2d3f
Fix type errors
kmonahan Nov 1, 2023
f23db88
Merge pull request #65 from forumone/tsc-fixes
kmonahan Nov 1, 2023
59690f8
Merge pull request #66 from forumone/1.x-RC
kmonahan Nov 1, 2023
5ed77bb
removed minor version from nvmrc
coreylafferty Nov 15, 2023
6a20564
Merge pull request #67 from forumone/node-remove-minor-version
kmonahan Dec 11, 2023
d2873f7
Update version number to 1.0.9
kmonahan Dec 13, 2023
b28a2d1
Merge pull request #70 from forumone/1.x-RC
kmonahan Dec 13, 2023
2689d17
Add renovate.json
renovate[bot] Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

4 changes: 2 additions & 2 deletions .buildkite/pipeline-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
ECR_NAMESPACE: "${IMAGE_REPOSITORY}:${BUILDKITE_PIPELINE_SLUG}"

# Define service directory were the Dockerfile is used
DOCKERFILE_LOCATION: "./services/app"
DOCKERFILE_LOCATION: "./"
steps:
- label: ":hammer: :docker: Building Docker Image"
key: "build-image"
Expand All @@ -45,7 +45,7 @@ steps:
- *ecr
- seek-oss/aws-sm#v2.0.0:
file:
- path: services/app/.env
- path: .env
secret-id: [NEED THIS CONFIGURED]

# Wait for images to finish building.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ case $1 in
prettier:write)
npm run prettier:write
;;
icons)
npm run build-icons
;;
"")
echo "Usage: nextjs install|build|deploy|watch|(some other command in the theme service)"
;;
*)
"$@"
;;
esac
esac
1 change: 1 addition & 0 deletions .ddev/config.mutagen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mutagen_enabled: true
10 changes: 5 additions & 5 deletions services/app/.ddev/config.yaml → .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mutagen_enabled: false
use_dns_when_possible: true
composer_version: "2"
web_environment: []
nodejs_version: "16"
nodejs_version: "18"
hooks:
post-start:
# Detects to see if the node_modules folder exists
Expand All @@ -29,7 +29,7 @@ hooks:
- exec: pm2 start --name app node_modules/.bin/next -- dev
service: web
# pm2 does not live in the node path, so have to call binary directly
- exec: pm2 start --name storybook node_modules/.bin/start-storybook -- -p 6006
- exec: pm2 start --name storybook node_modules/.bin/storybook -- dev -p 6006
service: web

# Key features of ddev's config.yaml:
Expand Down Expand Up @@ -188,9 +188,9 @@ hooks:
# https://ngrok.com/docs#http or run "ngrok http -h"

# disable_settings_management: false
# If true, ddev will not create CMS-specific settings files like
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
# In this case the user must provide all such settings.
# If true, ddev will not create CMS-specific meta files like
# Drupal's meta.php/meta.ddev.php or TYPO3's AdditionalConfiguration.php
# In this case the user must provide all such meta.

# You can inject environment variables into the web container with:
# web_environment:
Expand Down
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"prettier"
],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"ignoreRestSiblings": true,
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-empty-interface": [
"error",
{
"allowSingleExtends": true
}
],
"prettier/prettier": "error"
},
"overrides": [
{
"files": ["**/*.stories.tsx"],
"rules": {
"@next/next/no-img-element": "off"
}
},
{
"files": ["next.config.js", ".storybook/**/*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["source/03-components/Icon/icons/*.tsx"],
"rules": {
"prettier/prettier": "off"
}
}
]
}
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/app
working-directory: ./

strategy:
matrix:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/app
working-directory: ./

strategy:
matrix:
Expand Down
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem
.idea

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# TypeScript
tsconfig.tsbuildinfo

# Storybook build files
storybook-static/
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run test command in the app service.
cd services/app
# Run test command
npm test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.12
18
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source/01-global/icon/**/*.svg
source/01-global/icon/**/*.tsx
12 changes: 10 additions & 2 deletions services/app/.prettierrc → .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
"useTabs": false,
"overrides": [
{
"files": ["source/01-global/icon/**/*.tsx"],
"options": {
"organizeImportsSkipDestructiveCodeActions": true
}
}
]
}
54 changes: 54 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const path = require('path');
const StylelintWebpackPlugin = require('stylelint-webpack-plugin');
const YAML = require('yaml');

module.exports = {
staticDirs: ['../public'],
stories: ['../source/**/*.stories.@(js|jsx|ts|tsx)', '../source/**/*.mdx'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
webpackFinal: async config => {
config.plugins.push(
new StylelintWebpackPlugin({
exclude: ['node_modules', 'storybook', '.next'],
}),
);
config.module.rules.find(
rule => rule.test && rule.test.toString().includes('svg'),
).exclude = /Icon\/icons\/.*\.svg$/i;
config.module.rules.push({
test: /Icon\/icons\/.*\.svg$/i,
use: [
{
loader: '@svgr/webpack',
options: {
svgo: true,
svgoConfig: {
plugins: ['removeDimensions'],
},
replaceAttrValues: {
'#000': 'currentColor',
},
titleProp: true,
},
},
],
});
config.module.rules.push({
test: /\.ya?ml$/i,
type: 'json',
parser: {
parse: YAML.parse,
},
});
return config;
},
};
3 changes: 3 additions & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@100;400;700&display=swap" rel="stylesheet" crossorigin>
6 changes: 6 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api';
import theme from './theme';

addons.setConfig({
theme,
});
3 changes: 3 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&display=swap" rel="stylesheet" crossorigin>
77 changes: 77 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import '../source/00-config/index.css';
import '../source/01-global/index.css';
import '../source/06-utility/index.css';

const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
layout: 'fullscreen',
options: {
storySort: {
method: 'alphabetical',
order: [
'Global',
['Color Palette', '*'],
'Layouts',
'Components',
'Templates',
'Pages',
],
includeName: true,
},
},
};

// Toolbar to test multiple writing directions.
// See https://storybook.js.org/docs/react/essentials/toolbars-and-globals#advanced-usage
// for an example of using specific locales rather than general page orientations.
const globalTypes = {
direction: {
name: 'Direction',
description: 'Writing direction',
defaultValue: 'ltr',
toolbar: {
icon: 'compass',
items: [
{ value: 'ltr', title: 'Left-to-right' },
{ value: 'rtl', title: 'Right-to-left' },
{ value: 'vrl', title: 'Vertical right-to-left' },
{ value: 'vlr', title: 'Vertical left-to-right' },
],
},
},
};

const withWritingDirection = (Story, context) => {
const { direction } = context.globals;
return (
<div
dir={direction === 'rtl' || direction === 'vrl' ? 'rtl' : 'ltr'}
style={{
writingMode:
direction === 'vrl'
? 'vertical-rl'
: direction === 'vlr'
? 'vertical-lr'
: 'horizontal-tb',
}}
>
<Story />
</div>
);
};

const decorators = [withWritingDirection];

const preview = {
parameters,
globalTypes,
decorators,
};

export default preview;
20 changes: 20 additions & 0 deletions .storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { create } from '@storybook/theming';

const storybookTheme = create({
appBg: '#F8F8F8',
appContentBg: '#fff',
barBg: '#19013A',
barSelectedColor: '#EE2737',
barHoverColor: '#EE2737',
barTextColor: '#fff',
base: 'light',
brandTitle: 'Forum One',
brandUrl: 'https://forumone.com',
brandImage: 'images/forumone.svg',
colorPrimary: '#3E2A5E',
colorSecondary: '#EE2737',
fontBase: '"Barlow", sans-serif',
textColor: '#3f3f3f',
});

export default storybookTheme;
Loading