Skip to content

Commit

Permalink
Release 0.2.0 (#170)
Browse files Browse the repository at this point in the history
* radio group styling

* test: (Button): add loading state tests

* wip

* use token

* Add tests to formik bindings (#97)

* test: added tests for FormikCheckboxInput

* test: adding tests to FormikTextInput

* chore: remove unnecessary lib function

* test: WIP FormikSelectInput tests

* FormikSelectInput tests

* added checkbox onChange test

* wrapping up test for selectInput

* Update src/components/RadioGroup/RadioGroup.jsx

Co-authored-by: Nathan Young <[email protected]>

* test (Button): add loading state tests (#106)

* test: (Button): add loading state tests

* inline the svg to get test to pass in CI

* wip

* Split up title and description, and pass as individual props.

* Fix PropType mismatch. Add no title/description example to storybook.

* adding codecov publish on branch pushes (#109)

* adding codecov publish on branch pushes

* newline

* test (CheckboxInput): update tests to not be concerned with FormLabel details (#96)

Co-authored-by: juanfabrega <[email protected]>

* update pull request job to run on branch pushes too (#110)

* fix: prevent empty class properties appearing in the dom (#111)

* Export RadioGroup.

* Adding missed export of FormikSelectInput in index (#113)

* adding missed export from index

* Update src/components/index.js

Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Nathan Young <[email protected]>

* bumping package version (#114)

* Re-organize props.

* fix (Button): remove duplicate propType definition

failed conflixt resolution

* css vars?

* get build working

* Update variables.scss

* spinner component

* proptype descriptions

* Spinner tests

* add comment to color and size

* test (Button): add tests for button type (#118)

adding this test in case the button markup gets refactored and we forget to assign the html button type. (chrome assigns the default button type as `submit`)

* security: bump codecov from 3.7.0 to 3.7.1 (#119)

* re-styling components

* removing margin

* converting form components to modules WIP

* all done but select

* fix checkbox tests

* get rid of formik warnings

* bumping tokens version

* fixing react-select styling

* global exception to styleline

* improve test coverage

* restructure variable imports

* remove unnecessary ampersand

* add proptypes and types

* cleanup

* fix tests

* fix build

* Spinner stories

* convert color palette stories to css module

* fix tokens

* Create CODEOWNERS (#122)

* make checkboxinput fields required

* update typings file

* examples of component-level variables, and globals

* variables build

* normalizing buttons and form sizes

* merge conflicts + prop update

* import tokens only

* fixing checkbox tests

* fixing build, converting Spinner to TS.

* fixing build utilities

* fixing storybook utilities

* fixing variable exports

* Begin converting to typescript.

* small re-structure and removing unnecessary imports

* removing composes

* Lint tsx files.

* consistent code style

* react-select error styling

* Add line to end of file.

* fix import issues with TS files

* fixed lint issues and ignoring some TS rules on JS files, only default props issues left

* cleanup after merge

* disabling require-default-props for tsx files

* Formatting.

* chore (dep): update palmetto-design-tokens to 0.3.0 (#132)

* docs: chromatic and publish to npm status badges

* docs: link badges

* Css modules (#120)

* test: (Button): add loading state tests

* wip

* use token

* wip

* css vars?

* get build working

* Update variables.scss

* spinner component

* proptype descriptions

* Spinner tests

* re-styling components

* removing margin

* converting form components to modules WIP

* all done but select

* fix checkbox tests

* get rid of formik warnings

* bumping tokens version

* fixing react-select styling

* global exception to styleline

* improve test coverage

* restructure variable imports

* remove unnecessary ampersand

* Spinner stories

* convert color palette stories to css module

* examples of component-level variables, and globals

* variables build

* normalizing buttons and form sizes

* merge conflicts + prop update

* import tokens only

* fixing checkbox tests

* fixing build, converting Spinner to TS.

* fixing build utilities

* fixing storybook utilities

* fixing variable exports

* small re-structure and removing unnecessary imports

* removing composes

* consistent code style

* react-select error styling

* Add line to end of file.

* input spacing

* normalizing button padding

Co-authored-by: Nathan Young <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>

* Re-add import.

* Re-install packages.

* Get lint passing.

* Lint Styles (#131)

* Install extensions and run initial lint.

* Ignore coverage dir; add support for css-modules.

* Remove unnecessary vendor prefixes. Remove extensions from scss imports.

* Ignore select-input vendor scss.

* Fix typo in config.

* Tweak nesting depth.

* New line at end of stylelintnore.

* Cleanup.

* Add scripts for style linting and configure github build.

* Rename.

* Fix failing tests.

Co-authored-by: Jesse Carmine <[email protected]>

* fix (Heading): use font color tokens instead of brand tokens (#133)

* Heading color tests (#134)

* fix (Heading): use font color tokens instead of brand tokens

* test (Heading): update color tests with correct options

* refactor: use brand colors instead of base

* refactor: display color name only

* refactor (Button): use brand colors only

* Style label.

* Begin re-styling.

* selectinput

* remove unnecessary input

* add typing

* Finish styling RadioGroup.

* Enforce camelCase for both class and id selectors.

* refactor: move color stories to docs folder

* docs: add Design Tokens introduction

* Convert all to kebab-case.

* fix per PR and lint issue

* fix tokens typing

* Add disabled state to FormLabel.

* Fix SelectInput styling issues.

* Add disabled state for TextInput and SelectInput labels.

* Re-add disabled class to CheckboxInput.

* Fix failing tests.

* fix: reference correct type name

* change import

* WIP global webpack bundling

* Continue implementing typescript.

* Finalize StoryBook.

* Cleanup classNames.

* fix

* fix (FormLabel): prevent external spacing styles from cascading

fixes #145

* style: stylelint

* Basic state working.

* Add rest of stories to docs.

* Cleanup.

* Break out RadioInput.

* Style option correctly.

* Separate options from function calls in storybook.

* Move styles for input into RadioInput.

* docs: border-radius, breakpoints, font-size, spacing tokens

* Cleanup.

* Fix linting error.

* Add RadioGroup to Formik form.

* Format FormikForm state output.

* docs: move RadioGroup stories to Form Inputs folder

* docs (RadioGroup): add description

* Begin adding testing to RadioInput.

* solve select input global classes

* Begin adding tests.

* Fix Error.

* Begin testing RadioGroup.

* Add missing file.

* Finalize test for RadioInput.

* Interstitial.

* Finish adding tests.

* refactor: tweak layout, use form css variables

- removes extraneous margins
- applies margin to radio input

* style: fix lint

* refactor: remove extra spacing

* Begin adding tests for FormicRadioGroup.

* Finalize tests for FormikRadioGroup.

* Begin organizing storybook.

* Finish documentation.

* build and storybook working

* ts config updates

* bumping tokens to 0.4.0

* Remove vscode files from repo.

* Enforce simi delimiter for TS interface.

* Address issues in RadioGroup MDX.

* re-enabling type checker

* consistent naming

* getting styles right

* EOL

* fixing test after classname changewq

* babelrc + fixing input margins

* removing comments

* Create new mdx file.

* Organize inputs.

* Begin adding stories.

* Update stories for Checkbox Input.

* Delete obsolete file.

* Revert.

* Convert Formik Form to MDX.

* Cleanup CheckboxInput mdx.

* Finalize FormLabel MDX.

* Cleanup Headings.

* Cleanup InputValidationMessage.

* Begin md for SelectInput

* Continue adding to SelectInput docs.

* Complete docs for SelectInput.

* Delete old SelectInput stories.

* Remove stories for sub-components.

* Update docs for TextInput.

* Add custom classes example to all inputs.

* Add custom classes example to Button.

* Add autoprefixer.

* Proofread and corrections.

* Setup theming and swap in Palmetto's logo.

* Flip to dark theme; theme docs.

* Flip back to light theme.

* Consistent Bundling Refactor (#154)

* Create a single/unified webpack.config. Configuration is customized based on env.

* Add comment to top of webpack config describing how the the production and dev builds work.

* remove publish config from storybook builds

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Juan Fabrega <[email protected]>

* fix scss loaders

* Remove bunk rule.

* Consistent bundling (#148)

* WIP global webpack bundling

* solve select input global classes

* build and storybook working

* ts config updates

* re-enabling type checker

* consistent naming

* getting styles right

* EOL

* fixing test after classname changewq

* babelrc + fixing input margins

* removing comments

* Consistent Bundling Refactor (#154)

* Create a single/unified webpack.config. Configuration is customized based on env.

* Add comment to top of webpack config describing how the the production and dev builds work.

* remove publish config from storybook builds

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Juan Fabrega <[email protected]>

* fix scss loaders

* Remove config.js for storybook. Styles being loaded in it were relevant to preview; so added to preview.js.

* switching to ts-loader

* removing babel build config

* re-adding babel-loader

* re-adding babel-loader to storybook

* babel build env for storybook

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>

* Remove config.js; it's useless.

* Fix typo; get storybook build.

* Cleanup CheckboxInput.

* Cleanup.

* Storybook update (#156)

* storybook update + generate proptyoes

* eslintrc update to ignore prop validation

* linter errors

* remove props validation

* take plugins out of conditional check

* remove plugins from custom storybook config

* Declare plugins in module.exports as opposed to assigning them to a variable.

Co-authored-by: Jesse Carmine <[email protected]>

* Update storybook.

* Make CheckboxInput isChecked, and SelectInput value required; update docs.

* bump tokens version to 0.5.0 (#161)

* bump tokens version to 0.5.0

* bump to 0.5.1

* removing unused dependencies (#163)

* removing unused dependencies

* re-instating uuid

* 160 react select props (#165)

* removing unused dependencies

* re-instating uuid

* adding isClearable prop to SelectInput

* bumping package version (#167)

* Master conflicts (#169)

* conflicts

* more conflicts

* Merge 'develop' into master (#116)

* feat (FormikSelectInput): SelectInput formik adapter (#69)

* wip SelectInput Formik adapter

* not sure about this

* update formik story

* Update Formik.stories.jsx

* user defined onChange doesn't work with Formik without higher order function like FormikSelectInput

* fix tests

* Update FormikCheckboxInput.jsx

* custom onChange examples with formik

* comment

* match input error prop name to other components and display validation message

* with SelectInput, setFieldValue set to onChange 😢

* Update Formik.stories.jsx

* fix validation error example

* feat: simulate event for consistent api

* fix isMulti example

Co-authored-by: Juan Fabrega <[email protected]>

* feat: adding maxlength prop on TextINput

* chore: refactor checkbox input API and corresponding components

* docs (Button): document Button, FormLabel using mdx and organize stories into categories (#85)

* docs (Button): document using mdx format

* show a simple code sample in docs

* organize stories

* organize stories

* document FormLabel fixes #26

* convert InputValidationMessage stories to mdx

* test (SelectInput): add tests (#83)

* Begin adding tests to SelectInput.

* Finish adding tests.

* get onChange test to work

need to set our id prop to react-select's inputId prop to target the input

* Fix failing tests.

* Add onChange to each

* Fix failing tests.

* Remove react-select specific tests.

* Additional formatting and cleanup.

* Remove package.json update.

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Nathan Young <[email protected]>

* add codecov (#86)

* feat: codecov WIP

* feat: codecov github action

* fix: remove bad yml key

* fix: let codecov search repo

* fix: adding codecov command to test

* codecov in test job

* typo in variable

* with step inside test job

* update codecov action

* change target coverage file

* testing under codecov threshold

* testing coverage threshold

* reverting test changes

* feat: make label required, add aria-labelledby attribute, add hideLabel option (#84)

* Begin adding tests to SelectInput.

* Finish adding tests.

* get onChange test to work

need to set our id prop to react-select's inputId prop to target the input

* Fix failing tests.

* feat: make label required, add aria-labelledby attribute, add hideLabel option

* update label prop description

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: juanfabrega <[email protected]>

* Add `mutationobserver-shim` as a global test depencency; remove setupTests.js.

* chore: bumping package version 0.1.7

* contribution guidelines (#92)

* contribution guidelines

* Update .github/CONTRIBUTING.md

Co-authored-by: Nathan Young <[email protected]>

Co-authored-by: Nathan Young <[email protected]>

* fixing contributing.md link

* Move props to top.

* adding all files to test coverage report (#94)

* feat (Heading): add default size with each level

* doc (Heading): update to use mdx format

* test (Heading): replace snapshots with unit tests

* className on wrapper element (#101)

* className on wrapper element

* show custom class in story

Co-authored-by: Nathan Young <[email protected]>

* bumping to version 0.1.8 (#102)

* Add tests to formik bindings (#97)

* test: added tests for FormikCheckboxInput

* test: adding tests to FormikTextInput

* chore: remove unnecessary lib function

* test: WIP FormikSelectInput tests

* FormikSelectInput tests

* added checkbox onChange test

* wrapping up test for selectInput

* test (Button): add loading state tests (#106)

* test: (Button): add loading state tests

* inline the svg to get test to pass in CI

* adding codecov publish on branch pushes (#109)

* adding codecov publish on branch pushes

* newline

* test (CheckboxInput): update tests to not be concerned with FormLabel details (#96)

Co-authored-by: juanfabrega <[email protected]>

* update pull request job to run on branch pushes too (#110)

* fix: prevent empty class properties appearing in the dom (#111)

* Adding missed export of FormikSelectInput in index (#113)

* adding missed export from index

* Update src/components/index.js

Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Nathan Young <[email protected]>

* bumping package version (#114)

* fix (Button): remove duplicate propType definition

failed conflixt resolution

Co-authored-by: juanfabrega <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>

* Merge branch 'develop' into master (#117)

* feat (FormikSelectInput): SelectInput formik adapter (#69)

* wip SelectInput Formik adapter

* not sure about this

* update formik story

* Update Formik.stories.jsx

* user defined onChange doesn't work with Formik without higher order function like FormikSelectInput

* fix tests

* Update FormikCheckboxInput.jsx

* custom onChange examples with formik

* comment

* match input error prop name to other components and display validation message

* with SelectInput, setFieldValue set to onChange 😢

* Update Formik.stories.jsx

* fix validation error example

* feat: simulate event for consistent api

* fix isMulti example

Co-authored-by: Juan Fabrega <[email protected]>

* feat: adding maxlength prop on TextINput

* chore: refactor checkbox input API and corresponding components

* docs (Button): document Button, FormLabel using mdx and organize stories into categories (#85)

* docs (Button): document using mdx format

* show a simple code sample in docs

* organize stories

* organize stories

* document FormLabel fixes #26

* convert InputValidationMessage stories to mdx

* test (SelectInput): add tests (#83)

* Begin adding tests to SelectInput.

* Finish adding tests.

* get onChange test to work

need to set our id prop to react-select's inputId prop to target the input

* Fix failing tests.

* Add onChange to each

* Fix failing tests.

* Remove react-select specific tests.

* Additional formatting and cleanup.

* Remove package.json update.

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Nathan Young <[email protected]>

* add codecov (#86)

* feat: codecov WIP

* feat: codecov github action

* fix: remove bad yml key

* fix: let codecov search repo

* fix: adding codecov command to test

* codecov in test job

* typo in variable

* with step inside test job

* update codecov action

* change target coverage file

* testing under codecov threshold

* testing coverage threshold

* reverting test changes

* feat: make label required, add aria-labelledby attribute, add hideLabel option (#84)

* Begin adding tests to SelectInput.

* Finish adding tests.

* get onChange test to work

need to set our id prop to react-select's inputId prop to target the input

* Fix failing tests.

* feat: make label required, add aria-labelledby attribute, add hideLabel option

* update label prop description

Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: juanfabrega <[email protected]>

* Add `mutationobserver-shim` as a global test depencency; remove setupTests.js.

* chore: bumping package version 0.1.7

* contribution guidelines (#92)

* contribution guidelines

* Update .github/CONTRIBUTING.md

Co-authored-by: Nathan Young <[email protected]>

Co-authored-by: Nathan Young <[email protected]>

* fixing contributing.md link

* Move props to top.

* adding all files to test coverage report (#94)

* feat (Heading): add default size with each level

* doc (Heading): update to use mdx format

* test (Heading): replace snapshots with unit tests

* className on wrapper element (#101)

* className on wrapper element

* show custom class in story

Co-authored-by: Nathan Young <[email protected]>

* bumping to version 0.1.8 (#102)

* Add tests to formik bindings (#97)

* test: added tests for FormikCheckboxInput

* test: adding tests to FormikTextInput

* chore: remove unnecessary lib function

* test: WIP FormikSelectInput tests

* FormikSelectInput tests

* added checkbox onChange test

* wrapping up test for selectInput

* test (Button): add loading state tests (#106)

* test: (Button): add loading state tests

* inline the svg to get test to pass in CI

* adding codecov publish on branch pushes (#109)

* adding codecov publish on branch pushes

* newline

* test (CheckboxInput): update tests to not be concerned with FormLabel details (#96)

Co-authored-by: juanfabrega <[email protected]>

* update pull request job to run on branch pushes too (#110)

* fix: prevent empty class properties appearing in the dom (#111)

* Adding missed export of FormikSelectInput in index (#113)

* adding missed export from index

* Update src/components/index.js

Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Nathan Young <[email protected]>

* bumping package version (#114)

* fix (Button): remove duplicate propType definition

failed conflixt resolution

Co-authored-by: juanfabrega <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>

* fixing conflicts

Co-authored-by: Nathan Young <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>

* fixing merge conflicts

Co-authored-by: Nathan Young <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jesse Carmine <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Jon Gamble <[email protected]>
Co-authored-by: Eric Liu <[email protected]>
Co-authored-by: Taylor Blanton <[email protected]>
  • Loading branch information
8 people authored Aug 17, 2020
1 parent b5a184e commit dbd20f0
Show file tree
Hide file tree
Showing 98 changed files with 6,782 additions and 3,777 deletions.
22 changes: 15 additions & 7 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@
"test": {
"presets": [
["@babel/preset-env", { "modules": "cjs" }],
"@babel/preset-react"
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-runtime"
]
},
"build": {
"presets": [
["@babel/preset-env", { "modules": false }],
"@babel/preset-react"
]
}
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"babel-plugin-typescript-to-proptypes"
]
},
"storybook": {
"presets": []
}
}
}
}
88 changes: 82 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"airbnb",
"airbnb/hooks",
"plugin:jest/recommended",
Expand All @@ -8,18 +12,90 @@
"plugins": [
"jsx-a11y",
"jest",
"@typescript-eslint"
],
"env": {
"jest/globals": true,
"browser": true
},
"rules": {
"arrow-parens": ["error", "as-needed"],
"arrow-parens": [
"error",
"as-needed"
],
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": true }
{
"devDependencies": true
}
],
"react/jsx-filename-extension": [
1,
{
"extensions": [
".jsx",
"tsx"
]
}
],
"react/jsx-props-no-spreading": [
0
],
"max-len": [
1,
120
],
"react/jsx-props-no-spreading": [0],
"max-len": [1, 120]
}
}
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"mjs": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"@typescript-eslint/member-delimiter-style": ["error", {
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
}
},
"overrides": [
{
"files": [
"**/*.js"
],
"rules": {
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/explicit-module-boundary-types": 0
}
},
{
"files": [
"**/*.tsx"
],
"rules": {
"react/prop-types": "off"
}
}
]
}
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://help.github.com/en/articles/about-code-owners

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @juanfabrega and @nathanyoung will be requested for
# review when someone opens a pull request.
* @juanfabrega @nathanyoung
29 changes: 22 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
name: lint
lint-js:
name: lint js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -24,9 +24,24 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn install
- name: lint
run: yarn lint
run: yarn
- name: lint js
run: yarn lint-js
lint-styles:
name: lint styles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn
- name: lint styles
run: yarn lint-styles
unit-tests:
name: unit tests
runs-on: ubuntu-latest
Expand All @@ -41,7 +56,7 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn install
run: yarn
- name: unit test
run: |
yarn test
Expand Down Expand Up @@ -70,7 +85,7 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn install
run: yarn
- uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
65 changes: 19 additions & 46 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,31 @@
const scssRules = {
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
// 'postcss-loader', @TODO -- Add postcss config and re-enable loader.
'sass-loader',
{
loader: 'sass-resources-loader',
options: {
// Provide path to the file with resources
resources: [
'./src/styles/variables.scss',
'./src/styles/utilities.scss',
'./src/styles/reset.scss',
],
},
},
],
};
/**
* The majority of the development webpack config comes directly from the @storybook
* default config, since the output is rendered by their platform.
* Webpack.config.js is configured to determine whether or not the env is development/storybook,
* and if so, generate additional config options that will get merged into the storybook config
* in order to process Typescript components and SCSS files appropriately.
*/

const fileLoaderRules = {
test: /\.(png|jpe?g|gif)$/i,
use: [{
loader: 'file-loader',
}, ],
};
const webpackConfig = require('../webpack.config');

module.exports = {
stories: ['../src/**/*.stories.([tj]sx|mdx)'],
stories: ['../src/**/*.stories.@([tj]sx|mdx)'],
addons: [
'@storybook/addon-actions/register',
'@storybook/addon-a11y/register',
'@storybook/addon-docs',
'@storybook/addon-links/register',
// '@storybook/addon-viewport/register',
],
webpackFinal: (config) => {
config.module.rules.push(scssRules);
config.module.rules.push(fileLoaderRules);
const assetRule = config.module.rules.find(({
test
}) => test.test(".svg"));

const assetLoader = {
loader: assetRule.loader,
options: assetRule.options || assetRule.query
};

// Merge our rule with existing assetLoader rules
config.module.rules.unshift({
test: /\.svg$/,
use: ["@svgr/webpack", assetLoader]
});

return config;
return {
...config,
module: {
...config.module,
rules: [
...config.module.rules,
...webpackConfig.module.rules
],
},
}
},
};
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/addons';
import palmettoTheme from './palmettoTheme';

addons.setConfig({
theme: palmettoTheme,
});
37 changes: 37 additions & 0 deletions .storybook/palmettoTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { create } from '@storybook/theming/create';

export default create({
base: 'light',

// colorPrimary: 'hotpink',
// colorSecondary: 'deepskyblue',

// // UI
// appBg: 'white',
// appContentBg: 'silver',
// appBorderColor: 'grey',
// appBorderRadius: 4,

// // Typography
// fontBase: '"Open Sans", sans-serif',
// fontCode: 'monospace',

// // Text colors
// textColor: 'black',
// textInverseColor: 'rgba(255,255,255,0.9)',

// // Toolbar default and active colors
// barTextColor: 'silver',
// barSelectedColor: 'black',
// barBg: 'hotpink',

// // Form colors
// inputBg: 'white',
// inputBorder: 'silver',
// inputTextColor: 'black',
// inputBorderRadius: 4,

brandTitle: 'Palmetto Component Library',
brandUrl: 'https://palmetto.com',
brandImage: 'https://alchemy.palmetto.com/public//default_logo/1541461188.png',
});
13 changes: 13 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { addParameters } from '@storybook/react';
import { themes } from '@storybook/theming';
import palmettoTheme from './palmettoTheme';

import '!style-loader!css-loader!sass-loader!../src/styles/utilities.scss';
import '!style-loader!css-loader!sass-loader!../src/styles/variables/index.scss';
import '!style-loader!css-loader!sass-loader!../src/styles/reset.scss';

addParameters({
options: {
theme: palmettoTheme,
},
});
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage/
dist/
15 changes: 13 additions & 2 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
"extends": "stylelint-config-recommended"
}
"extends": [
"stylelint-config-recommended",
"stylelint-config-sass-guidelines",
"stylelint-config-css-modules",
"stylelint-config-concentric-order"
],
"rules": {
"declaration-property-value-blacklist": null,
"max-nesting-depth": null,
"order/properties-alphabetical-order": null,
"selector-max-compound-selectors": 4
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Publish To NPM](https://github.com/palmetto/palmetto-components/workflows/Publish%20To%20NPM/badge.svg)](https://github.com/palmetto/palmetto-components/actions?query=workflow%3A%22Publish+To+NPM%22)
[![Chromatic](https://github.com/palmetto/palmetto-components/workflows/Chromatic/badge.svg?branch=master)](https://github.com/palmetto/palmetto-components/actions?query=workflow%3AChromatic)

# Palmetto Components
A React component library to power all Palmetto UI.

Expand Down
Loading

0 comments on commit dbd20f0

Please sign in to comment.