diff --git a/commitlint.config.js b/commitlint.config.js index b9073061a4..e087795bfb 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -37,6 +37,7 @@ module.exports = { 'ffe-icons', 'ffe-icons-react', 'ffe-lists', + 'ffe-lists-react', 'ffe-message-box', 'ffe-message-box-react', 'ffe-radio-button-react', diff --git a/package.json b/package.json index b8d722101d..f2e5b33c44 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "react": "^16.1.1", "react-dom": "^16.1.1", "react-styleguidist": "^6.0.32", + "style-loader": "^0.19.1", "stylelint-config-prettier": "^2.0.0", "webpack": "^3.8.1" }, diff --git a/packages/ffe-lists-react/.editorconfig b/packages/ffe-lists-react/.editorconfig deleted file mode 100644 index 3b0111c556..0000000000 --- a/packages/ffe-lists-react/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.js] -indent_style = space -indent_size = 2 - -[*.{json,yml}] -indent_style = space -indent_size = 2 diff --git a/packages/ffe-lists-react/.eslintrc b/packages/ffe-lists-react/.eslintrc deleted file mode 100644 index 9397e26d99..0000000000 --- a/packages/ffe-lists-react/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "ffe" -} diff --git a/packages/ffe-lists-react/.gitattributes b/packages/ffe-lists-react/.gitattributes deleted file mode 100644 index 391f0a4e4b..0000000000 --- a/packages/ffe-lists-react/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -* text=auto -*.js text eol=lf diff --git a/packages/ffe-lists-react/.npmrc b/packages/ffe-lists-react/.npmrc index 90d3d2a2fe..9cf9495031 100644 --- a/packages/ffe-lists-react/.npmrc +++ b/packages/ffe-lists-react/.npmrc @@ -1 +1 @@ -git-tag-version=false \ No newline at end of file +package-lock=false \ No newline at end of file diff --git a/packages/ffe-lists-react/build.sh b/packages/ffe-lists-react/build.sh deleted file mode 100755 index 76f7a76402..0000000000 --- a/packages/ffe-lists-react/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -e - -npm install -npm test diff --git a/packages/ffe-lists-react/examples/example.less b/packages/ffe-lists-react/examples/example.less deleted file mode 100644 index 30df940527..0000000000 --- a/packages/ffe-lists-react/examples/example.less +++ /dev/null @@ -1,19 +0,0 @@ -@import "../node_modules/ffe-core/less/ffe.less"; -@import "../node_modules/ffe-lists/less/lists.less"; -@font-url: "../node_modules/ffe-core/fonts"; - -body { - font-family: "MuseoSansRounded-500", arial, sans-serif; -} - -section .ffe-body-text { - max-width: 800px; - margin: 0 auto; -} - -ul, -ol, -dl, -h2 { - margin: 30px 0!important; -} \ No newline at end of file diff --git a/packages/ffe-lists-react/examples/lists.js b/packages/ffe-lists-react/examples/lists.js deleted file mode 100644 index 7ffd9cfb09..0000000000 --- a/packages/ffe-lists-react/examples/lists.js +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import { render } from 'react-dom'; -import BulletList from '../src/BulletList'; -import CheckList from '../src/CheckList'; -import NumberedList from '../src/NumberedList'; -import StylizedNumberedList from '../src/StylizedNumberedList'; -import DescriptionList from '../src/DescriptionList'; -import DescriptionListMultiCol from '../src/DescriptionListMultiCol'; - -require('./example.less'); - -const listDOM = document.createElement('section'); -document.body.appendChild(listDOM); - -render( -
-

Bullet list

- -
  • List item
  • -
  • Another list item
  • -
  • Yet another list item
  • -
    - -
    - -

    Check list

    - -
  • List item
  • -
  • Another list item
  • -
  • Yet another list item
  • -
    - -
    - -

    Check list (bg-sand)

    - -
  • List item
  • -
  • Another list item
  • -
  • Yet another list item
  • -
    - -
    - -

    Numbered list

    - -
  • List item
  • -
  • Another list item
  • -
  • Yet another list item
  • -
    - -
    - -

    Stylized numbered list

    - -
  • List item
  • -
  • Another list item
  • -
  • Yet another list item
  • -
    - -
    - -

    Description list

    - -
    Term
    -
    Description
    - -
    Another term
    -
    Another description
    - -
    Yet another term
    -
    Yet another description
    -
    - -
    - -

    Description list (medium)

    - -
    Term
    -
    Description
    - -
    Another term
    -
    Another description
    - -
    Yet another term
    -
    Yet another description
    -
    - -
    - -

    Description list (large)

    - -
    Term
    -
    Description
    - -
    Another term
    -
    Another description
    - -
    Yet another term
    -
    Yet another description
    -
    - -
    - -

    Description list multicol

    - -
    Term
    -
    Description
    -
    Another term
    -
    Another description
    -
    Yet another term
    -
    Yet another description
    -
    -
    - , listDOM); \ No newline at end of file diff --git a/packages/ffe-lists-react/flow.sh b/packages/ffe-lists-react/flow.sh deleted file mode 100755 index 8085187d6a..0000000000 --- a/packages/ffe-lists-react/flow.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# Makes functions inherit trap ERR -set -E - - -trap 'executionFailed ${LINENO}' ERR - -function main() { - ./build.sh - - if should_publish; then - npm run has-published -s || npm publish - bob ci job build --jobname ffe-design-system_build_deploy - fi -} - -function should_publish() { - [[ $GIT_BRANCH =~ ^(origin/)?master$ ]] -} - -# Fail the build if someone tries to send it parameters since script doesn't handle params at the moment. -if [ $# -ne 0 ] ; then - echo "Failed the build. flow.sh does not support input parameters. Input parameters were '$@'" - exit 1; -fi - -function executionFailed() { - # Called when some command fail execution - local self=$(basename "$0") - local parent_lineno="$1" - local message="$2" - local resultCode="${3:-1}" - if [[ -n "$message" ]]; then - echo "${self}: Error on or near line ${parent_lineno}: ${message}; exiting with status ${resultCode}" - else - echo "${self}: Error on or near line ${parent_lineno}; exiting with status ${resultCode}" - fi - exit "${resultCode}" -} - -main diff --git a/packages/ffe-lists-react/package.json b/packages/ffe-lists-react/package.json index ea10e5f114..ff9f875cb0 100644 --- a/packages/ffe-lists-react/package.json +++ b/packages/ffe-lists-react/package.json @@ -1,66 +1,34 @@ { - "name": "ffe-lists-react", - "version": "2.0.3", - "description": "React implementation of ffe-lists", - "main": "lib/index.js", - "scripts": { - "build": "babel -d lib/. --ignore=*.test.js src/.", - "watch": "onchange 'src/**/*.js' -- npm run build", - "lint": "eslint src/", - "pretest": "npm run lint", - "test": "mocha --require babel-register 'src/**/*.test.js'", - "posttest": "nsp check", - "start": "budo examples/lists.js --open --live --title \"FFE Lists React\" -- -t [ babelify --presets [ es2015 react ] ] -t node-lessify", - "test:watch": "npm test -- -w", - "prepublish": "npm run build", - "has-published": "npm show . versions -s | grep -q ${npm_package_version}", - "postpublish": "git tag ${npm_package_version} && git push --tags" - }, - "devDependencies": { - "babel-cli": "^6.4.5", - "babel-eslint": "^6.0.4", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", - "babel-register": "^6.4.3", - "babelify": "^7.2.0", - "budo": "^9.2.1", - "chai": "^3.5.0", - "enzyme": "^2.3.0", - "eslint": "^3.13.1", - "eslint-config-ffe": "^6.0.0", - "eslint-plugin-import": "^2.2.0", - "eslint-plugin-jsx-a11y": "^3.0.2", - "eslint-plugin-react": "^6.9.0", - "ffe-core": "^9.2.0", - "ffe-lists": "^4.0.0", - "mocha": "^2.5.3", - "node-lessify": "^0.1.4", - "nsp": "^2.2.0", - "onchange": "^2.3.0", - "react": "^15.0.1", - "react-addons-create-fragment": "15.2.0", - "react-addons-test-utils": "^15.1.0", - "react-dom": "^15.0.1" - }, - "publishConfig": { - "registry": "***REMOVED***" - }, - "files": [ - "lib", - "*.js" - ], - "babel": { - "presets": [ - "es2015", - "react" - ] - }, - "peerDependencies": { - "ffe-lists": "3.x - 4.x" - }, - "dependencies": { - "classnames": "^2.2.5", - "nfe-hash": "^1.1.1", - "prop-types": "*" - } + "name": "ffe-lists-react", + "version": "2.0.3", + "description": "React implementation of ffe-lists", + "main": "lib/index.js", + "scripts": { + "build": "babel -d lib/. --ignore=*.test.js src/.", + "lint": "eslint src/", + "test": "npm run test:spec && npm run test:nsp", + "test:spec": "jest", + "test:nsp": "nsp check", + "test:watch": "jest --watch" + }, + "devDependencies": { + "enzyme": "^3.3.0", + "enzyme-adapter-react-16": "^1.1.1", + "ffe-lists": "^4.0.0", + "jest": "^22.1.3", + "nsp": "^2.2.0", + "react": "^16.2.0", + "react-dom": "^16.2.0" + }, + "files": ["lib", "*.js"], + "peerDependencies": { + "ffe-lists": "3.x - 4.x" + }, + "dependencies": { + "classnames": "^2.2.5", + "prop-types": "*" + }, + "jest": { + "setupTestFrameworkScriptFile": "./test-setup.js" + } } diff --git a/packages/ffe-lists-react/src/BulletList.js b/packages/ffe-lists-react/src/BulletList.js index 6c608f48fe..70e3fc5351 100644 --- a/packages/ffe-lists-react/src/BulletList.js +++ b/packages/ffe-lists-react/src/BulletList.js @@ -1,12 +1,16 @@ import React from 'react'; -import { array } from 'prop-types'; +import { node, string } from 'prop-types'; +import classNames from 'classnames'; -export default function BulletList({ children }) { - return ; -} +const BulletList = ({ className, ...rest }) => ( +