This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add storybook 6 J=SLAP-2442 TEST=manual checked-out address and ran without errors
- Loading branch information
Showing
35 changed files
with
46,403 additions
and
11,026 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
module.exports = { | ||
extends: [ | ||
'@yext/slapshot/typescript' | ||
] | ||
extends: ["plugin:storybook/recommended", "@yext/eslint-config"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
|
||
name: Percy Snapshots | ||
|
||
on: | ||
on: | ||
push: | ||
branches-ignore: dev/* | ||
pull_request: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Sync Main to Storybook Site Branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
sync-branches: | ||
runs-on: ubuntu-latest | ||
name: Syncing branches | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: mtanzi/action-automerge@v1 | ||
with: | ||
source: "${{ github.event.repository.default_branch }}" | ||
target: "storybook-site" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
legacy-peer-deps=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
stories: ["../tests/**/*.stories.tsx"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
"@storybook/addon-a11y", | ||
{ | ||
name: "@storybook/addon-coverage", | ||
options: { | ||
istanbul: { | ||
include: ["src/components/**"], | ||
}, | ||
}, | ||
}, | ||
], | ||
framework: "@storybook/react", | ||
core: { | ||
builder: "@storybook/builder-vite", | ||
}, | ||
staticDirs: ["./public"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<link rel="icon" href="./yextIcon.svg" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const { addons } = require("@storybook/addons"); | ||
|
||
addons.setConfig({ | ||
theme: require("./yextTheme.cjs"), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { runOnly } from "./wcagConfig"; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
a11y: { | ||
options: { | ||
runOnly, | ||
}, | ||
}, | ||
options: { | ||
storySort: { | ||
order: ["Address"], | ||
}, | ||
}, | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { injectAxe, checkA11y } from "axe-playwright"; | ||
import { Page } from "playwright-core"; | ||
import { runOnly } from "./wcagConfig"; | ||
|
||
/** | ||
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental | ||
* to learn more about the test-runner hooks API. | ||
*/ | ||
const renderFunctions = { | ||
async preRender(page: Page) { | ||
await injectAxe(page); | ||
}, | ||
async postRender(page: Page, context) { | ||
await checkA11y(page, "#root", { | ||
axeOptions: { | ||
runOnly, | ||
rules: { | ||
"color-contrast": { enabled: context.name !== "Loading" }, | ||
}, | ||
}, | ||
detailedReport: true, | ||
detailedReportOptions: { | ||
html: true, | ||
}, | ||
}); | ||
}, | ||
}; | ||
|
||
export default renderFunctions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { axeOptionsConfig } from "axe-playwright"; | ||
|
||
export const runOnly: axeOptionsConfig["axeOptions"]["runOnly"] = { | ||
type: "tag", | ||
values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const { create } = require("@storybook/theming"); | ||
|
||
module.exports = create({ | ||
base: "light", | ||
colorPrimary: "#eeeff0", | ||
colorSecondary: "#2563eb", | ||
|
||
// UI | ||
appBg: "#fafafa", | ||
appContentBg: "white", | ||
appBorderColor: "#eeeff0", | ||
appBorderRadius: 6, | ||
|
||
// Text colors | ||
textColor: "black", | ||
textMutedColor: "#4b5563", | ||
|
||
// Toolbar colors | ||
barTextColor: "#4b5563", | ||
barBg: "#eeeff0", | ||
|
||
// Form | ||
inputBg: "white", | ||
inputTextColor: "black", | ||
inputBorder: "#9ca3af", | ||
inputBorderRadius: 4, | ||
|
||
// Brand logo | ||
brandTitle: "Yext Component Library", | ||
brandUrl: "https://github.com/yext/react-components", | ||
brandImage: "./logo.png", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Needed for es6 imports and TS support in jest | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript', | ||
["@babel/preset-env", { targets: { node: "current" } }], | ||
"@babel/preset-typescript", | ||
], | ||
}; | ||
}; |
Oops, something went wrong.