diff --git a/.size-limit b/.size-limit index 0fd57b774..c475c47fd 100644 --- a/.size-limit +++ b/.size-limit @@ -3,6 +3,6 @@ name: "Fundamental-React Size", webpack: true, path: "lib/index.js", - limit: "195 KB" + limit: "199 KB" } ] diff --git a/package-lock.json b/package-lock.json index 6b7508106..fb10e7d0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10950,28 +10950,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "resolved": false, "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "resolved": false, "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "resolved": false, "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, @@ -10982,14 +10982,14 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, @@ -11000,42 +11000,42 @@ }, "chownr": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", + "resolved": false, "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "resolved": false, "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "optional": true, @@ -11045,28 +11045,28 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "resolved": false, "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "resolved": false, "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "resolved": false, "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "resolved": false, "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "dev": true, "optional": true, @@ -11076,14 +11076,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "resolved": false, "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -11100,7 +11100,7 @@ }, "glob": { "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "resolved": false, "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "optional": true, @@ -11115,14 +11115,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "resolved": false, "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "resolved": false, "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "optional": true, @@ -11132,7 +11132,7 @@ }, "ignore-walk": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "resolved": false, "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", "dev": true, "optional": true, @@ -11142,7 +11142,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -11153,21 +11153,21 @@ }, "inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "resolved": false, "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "resolved": false, "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, @@ -11177,14 +11177,14 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "resolved": false, "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, @@ -11194,14 +11194,14 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "optional": true }, "minipass": { "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "resolved": false, "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "dev": true, "optional": true, @@ -11212,7 +11212,7 @@ }, "minizlib": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "resolved": false, "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "dev": true, "optional": true, @@ -11222,7 +11222,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "optional": true, @@ -11232,14 +11232,14 @@ }, "ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "resolved": false, "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "optional": true }, "needle": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz", + "resolved": false, "integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==", "dev": true, "optional": true, @@ -11251,7 +11251,7 @@ }, "node-pre-gyp": { "version": "0.14.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz", + "resolved": false, "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", "dev": true, "optional": true, @@ -11270,7 +11270,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "resolved": false, "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -11281,7 +11281,7 @@ }, "npm-bundled": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "resolved": false, "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", "dev": true, "optional": true, @@ -11291,14 +11291,14 @@ }, "npm-normalize-package-bin": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "resolved": false, "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.7", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz", + "resolved": false, "integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==", "dev": true, "optional": true, @@ -11309,7 +11309,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "resolved": false, "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -11322,21 +11322,21 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "resolved": false, "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "optional": true, @@ -11346,21 +11346,21 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "resolved": false, "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -11371,21 +11371,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "resolved": false, "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "resolved": false, "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, @@ -11398,7 +11398,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": false, "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -11407,7 +11407,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": false, "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -11423,7 +11423,7 @@ }, "rimraf": { "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "resolved": false, "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "optional": true, @@ -11433,49 +11433,49 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "resolved": false, "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "resolved": false, "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "resolved": false, "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "resolved": false, "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "resolved": false, "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "resolved": false, "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, @@ -11487,7 +11487,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": false, "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -11497,7 +11497,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "optional": true, @@ -11507,14 +11507,14 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "resolved": false, "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "resolved": false, "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "dev": true, "optional": true, @@ -11530,14 +11530,14 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": false, "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "resolved": false, "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, @@ -11547,14 +11547,14 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "optional": true }, "yallist": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "resolved": false, "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "optional": true @@ -11602,9 +11602,9 @@ "dev": true }, "fundamental-styles": { - "version": "0.8.2-rc.0", - "resolved": "https://registry.npmjs.org/fundamental-styles/-/fundamental-styles-0.8.2-rc.0.tgz", - "integrity": "sha512-RVmnZKtLFNp+XbMtmJAd6as3bdZt8is0xFURBYDO0OzxGWpUlsSc48k2WClDbPS7ee0G9HLy+wF5Aag6TCRRwA==" + "version": "0.10.0-rc.1", + "resolved": "https://registry.npmjs.org/fundamental-styles/-/fundamental-styles-0.10.0-rc.1.tgz", + "integrity": "sha512-YcQHR+xLrF8eNnys44H5XXQeCqrUtAxsgUZT7lC5ZbGh6rdPM817KdR583sn3SAi/JKRaLfacS+Pr25nypJNhQ==" }, "fuse.js": { "version": "3.6.1", diff --git a/package.json b/package.json index bf5ecba8d..58b18866e 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@babel/runtime": "^7.8.0", "chain-function": "^1.0.1", "classnames": "^2.2.6", - "fundamental-styles": "0.8.2-rc.0", + "fundamental-styles": "0.10.0-rc.1", "keycode": "^2.2.0", "moment": "^2.24.0", "prop-types": "^15.7.1", diff --git a/src/Avatar/Avatar.js b/src/Avatar/Avatar.js new file mode 100644 index 000000000..039cb90c5 --- /dev/null +++ b/src/Avatar/Avatar.js @@ -0,0 +1,99 @@ +import { AVATAR_SIZES } from '../utils/constants'; +import classnames from 'classnames'; +import CustomPropTypes from '../utils/CustomPropTypes/CustomPropTypes'; +import PropTypes from 'prop-types'; +import React, { useEffect } from 'react'; + +/** An **Avatar** is a visual presentation option around using an icon or user initials. */ + +const Avatar = React.forwardRef(({ glyph, size, circle, transparent, border, color, label, backgroundImageUrl, children, className, disableStyles, role, placeholder, tile, zoom, ...props }, ref) => { + + useEffect(() => { + if (!disableStyles) { + require('fundamental-styles/dist/icon.css'); + require('fundamental-styles/dist/helpers.css'); + require('fundamental-styles/dist/avatar.css'); + } + }, []); + + const styles = { + backgroundImage: `url(${backgroundImageUrl})` + }; + const avatarClasses = classnames( + 'fd-avatar', + { + [`fd-avatar--${size}`]: !!size, + [`sap-icon--${glyph}`]: !!glyph, + [`fd-has-background-color-accent-${color}`]: !!color, + 'fd-avatar--thumbnail': backgroundImageUrl, + 'fd-avatar--placeholder': placeholder, + 'fd-avatar--tile': tile, + 'fd-avatar--circle': circle, + 'fd-avatar--transparent': transparent, + 'fd-avatar--border': border + }, + className + ); + + let ariaRole; + if (role) { + ariaRole = role; + } else { + ariaRole = !children ? 'presentation' : ''; + } + + return ( + + {zoom && } + {children} + + ); +}); + +Avatar.displayName = 'Avatar'; + +Avatar.propTypes = { + /** Image URL */ + backgroundImageUrl: PropTypes.string, + /** Set to **true** to include a border */ + border: PropTypes.bool, + /** Node(s) to render within the component */ + children: PropTypes.node, + /** Apply circl style to Avatar */ + circle: PropTypes.bool, + /** CSS class(es) to add to the element */ + className: PropTypes.string, + /** Applies a background color */ + color: CustomPropTypes.range(1, 9), + /** Internal use only */ + disableStyles: PropTypes.bool, + /** The icon to include. See the icon page for the list of icons */ + glyph: PropTypes.string, + /** Localized text for label */ + label: PropTypes.string, + /** Set to **true** to apply placeholder background color */ + placeholder: PropTypes.bool, + /** Applies an aria-role. Set to button if Avatar opens a Popover or Dialog */ + role: PropTypes.string, + /** Size of the component: + 'xs', + 's', + 'm', + 'l', + 'xl' */ + size: PropTypes.oneOf(AVATAR_SIZES), + /** Set to **true** to apply tile background color */ + tile: PropTypes.bool, + /** Set to **true** to use transparent background */ + transparent: PropTypes.bool, + /** Set to **true** to include a zoom icon */ + zoom: PropTypes.bool +}; + +export default Avatar; diff --git a/src/Identifier/Identifier.test.js b/src/Avatar/Avatar.test.js similarity index 67% rename from src/Identifier/Identifier.test.js rename to src/Avatar/Avatar.test.js index d18c1e141..c7aaf6145 100644 --- a/src/Identifier/Identifier.test.js +++ b/src/Avatar/Avatar.test.js @@ -1,11 +1,11 @@ -import Identifier from './Identifier'; +import Avatar from './Avatar'; import { mount } from 'enzyme'; import React from 'react'; -describe('', () => { +describe('', () => { describe('Prop spreading', () => { - test('should allow props to be spread to the Identifier component', () => { - const element = mount(); + test('should allow props to be spread to the Avatar component', () => { + const element = mount(); expect( element.getDOMNode().attributes['data-sample'].value @@ -14,7 +14,7 @@ describe('', () => { }); describe('Roles', () => { test('should have role of presentation by default', () => { - const element = mount(); + const element = mount(); expect( element.getDOMNode().attributes.role.value @@ -22,7 +22,7 @@ describe('', () => { }); test('should have empty role if children prop is passed', () => { - const element = mount(); + const element = mount(); expect( element.getDOMNode().attributes.role.value @@ -37,10 +37,10 @@ describe('', () => { super(props); ref = React.createRef(); } - render = () => ; + render = () => ; } mount(); expect(ref.current.tagName).toEqual('SPAN'); - expect(ref.current.className).toEqual('fd-identifier'); + expect(ref.current.className).toEqual('fd-avatar'); }); }); diff --git a/src/Avatar/__stories__/Avatar.stories.js b/src/Avatar/__stories__/Avatar.stories.js new file mode 100644 index 000000000..d5fe9aaa8 --- /dev/null +++ b/src/Avatar/__stories__/Avatar.stories.js @@ -0,0 +1,156 @@ +/* eslint-disable react/no-multi-comp */ +import Avatar from '../Avatar'; +import React from 'react'; + +export default { + title: 'Component API/Avatar', + component: Avatar +}; + +export const primary = () => (); + +export const sizes = () => ( +
+ + + + + +
+); + +export const initials = () => ( +
+ WW + WW + WW + WW + WW +
+); + +export const circle = () => ( +
+ + + + + +
+); + +export const backgroundImage = () => ( +
+ + + + + +
+); + +export const transparent = () => ( +
+ WW + +
+); + +export const tile = () => ( +
+ + + + + +
+); + +export const placeholder = () => ( +
+ + + + + +
+); + +export const zoom = () => ( +
+ + + + + +
+); + +export const border = () => ( +
+ + + + + +
+); + + +export const accentColors = () => ( +
+ + + + + + + + + +
+); diff --git a/src/Avatar/__stories__/__snapshots__/Avatar.visual.storyshot b/src/Avatar/__stories__/__snapshots__/Avatar.visual.storyshot new file mode 100644 index 000000000..868bd178e --- /dev/null +++ b/src/Avatar/__stories__/__snapshots__/Avatar.visual.storyshot @@ -0,0 +1,346 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Visual Avatar 1`] = ` +
+
+ +
+
+
+ + + + + +
+
+
+
+ + WW + + + WW + + + WW + + + WW + + + WW + +
+
+
+
+ + + + + +
+
+
+
+ + + + + +
+
+
+
+ + WW + + +
+
+
+
+ + + + + +
+
+
+
+ + + + + +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ + + + + +
+
+
+
+ + + + + + + + + +
+
+
+`; diff --git a/src/Identifier/Identifier.js b/src/Identifier/Identifier.js deleted file mode 100644 index 14a2582da..000000000 --- a/src/Identifier/Identifier.js +++ /dev/null @@ -1,85 +0,0 @@ -import classnames from 'classnames'; -import CustomPropTypes from '../utils/CustomPropTypes/CustomPropTypes'; -import PropTypes from 'prop-types'; -import { IDENTIFIER_MODIFIERS, IDENTIFIER_SIZES } from '../utils/constants'; -import React, { useEffect } from 'react'; - -/** An **Identifier** is a visual presentation option around using an icon or user initials. */ - -const Identifier = React.forwardRef(({ glyph, size, modifier, color, label, backgroundImageUrl, children, className, disableStyles, role, ...props }, ref) => { - - useEffect(() => { - if (!disableStyles) { - require('fundamental-styles/dist/icon.css'); - require('fundamental-styles/dist/helpers.css'); - require('fundamental-styles/dist/identifier.css'); - } - }, []); - - const styles = { - backgroundImage: `url(${backgroundImageUrl})` - }; - const identifierClasses = classnames( - 'fd-identifier', - { - [`fd-identifier--${size}`]: !!size, - [`sap-icon--${glyph}`]: !!glyph, - [`fd-identifier--${modifier}`]: !!modifier, - [`fd-has-background-color-accent-${color}`]: !!color, - 'fd-identifier--thumbnail': backgroundImageUrl - }, - className - ); - - let ariaRole; - if (role) { - ariaRole = role; - } else { - ariaRole = !children ? 'presentation' : ''; - } - - return ( - - {children} - - ); -}); - -Identifier.displayName = 'Identifier'; - -Identifier.propTypes = { - /** Image URL */ - backgroundImageUrl: PropTypes.string, - /** Node(s) to render within the component */ - children: PropTypes.node, - /** CSS class(es) to add to the element */ - className: PropTypes.string, - /** Applies a background color */ - color: CustomPropTypes.range(1, 9), - /** Internal use only */ - disableStyles: PropTypes.bool, - /** The icon to include. See the icon page for the list of icons */ - glyph: PropTypes.string, - /** Localized text for label */ - label: PropTypes.string, - /** Sets a style variation for a modified appearance: 'circle', 'transparent' */ - modifier: PropTypes.oneOf(IDENTIFIER_MODIFIERS), - /** Applies an aria-role. Set to button if Identifier opens a Popover or Dialog */ - role: PropTypes.string, - /** Size of the component: 'xxs', - 'xs', - 's', - 'm', - 'l', - 'xl', - 'xxl' */ - size: PropTypes.oneOf(IDENTIFIER_SIZES) -}; - -export default Identifier; diff --git a/src/Identifier/__stories__/Identifier.stories.js b/src/Identifier/__stories__/Identifier.stories.js deleted file mode 100644 index 3b95f97f0..000000000 --- a/src/Identifier/__stories__/Identifier.stories.js +++ /dev/null @@ -1,103 +0,0 @@ -/* eslint-disable react/no-multi-comp */ -import Identifier from '../Identifier'; -import React from 'react'; - -export default { - title: 'Component API/Identifier', - component: Identifier -}; - -export const primary = () => (); - -export const sizes = () => ( -
- - - - - - - -
-); - -export const initials = () => ( -
- WW - WW - WW - WW - WW - WW - WW -
-); - -export const circle = () => ( -
- - - - - - - -
-); - -export const backgroundImage = () => ( -
- - - - - - - -
-); -export const transparent = () => ( -
- WW - -
-); - -export const accentColors = () => ( -
- - - - - - - - - -
-); diff --git a/src/Identifier/__stories__/__snapshots__/Identifier.visual.storyshot b/src/Identifier/__stories__/__snapshots__/Identifier.visual.storyshot deleted file mode 100644 index 5e3fe8604..000000000 --- a/src/Identifier/__stories__/__snapshots__/Identifier.visual.storyshot +++ /dev/null @@ -1,265 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Storyshots Visual Identifier 1`] = ` -
-
- -
-
-
- - - - - - - -
-
-
-
- - WW - - - WW - - - WW - - - WW - - - WW - - - WW - - - WW - -
-
-
-
- - - - - - - -
-
-
-
- - - - - - - -
-
-
-
- - WW - - -
-
-
-
- - - - - - - - - -
-
-
-`; diff --git a/src/Image/Image.js b/src/Image/Image.js deleted file mode 100644 index 119810eef..000000000 --- a/src/Image/Image.js +++ /dev/null @@ -1,51 +0,0 @@ -import classnames from 'classnames'; -import PropTypes from 'prop-types'; -import { IMAGE_SIZES, IMAGE_TYPES } from '../utils/constants'; -import React, { useEffect } from 'react'; - -/** Use an **Image** component to display images. */ - -const Image = React.forwardRef(({ size, type, photo, className, disableStyles, ...props }, ref) => { - - useEffect(() => { - if (!disableStyles) { - require('fundamental-styles/dist/image.css'); - } - }, []); - - const imageClasses = classnames( - { - [`fd-image--${size}`]: !!size, - [`fd-image--${type}`]: !!type - }, - className - ); - return ( - - ); -}); - -Image.displayName = 'Image'; - -Image.propTypes = { - /** Picture URL */ - photo: PropTypes.string.isRequired, - /** Size of the component: 's', 'm', 'l' */ - size: PropTypes.oneOf(IMAGE_SIZES).isRequired, - /** CSS class(es) to add to the element */ - className: PropTypes.string, - /** Internal use only */ - disableStyles: PropTypes.bool, - /** Sets the variation of the component. Primarily used for styling: 'circle' */ - type: PropTypes.oneOf(IMAGE_TYPES) -}; - -Image.defaultProps = { - size: 'm' -}; - -export default Image; diff --git a/src/Image/Image.test.js b/src/Image/Image.test.js deleted file mode 100644 index 49ac87fe3..000000000 --- a/src/Image/Image.test.js +++ /dev/null @@ -1,35 +0,0 @@ -import Image from './Image'; -import { mount } from 'enzyme'; -import React from 'react'; - -describe('', () => { - describe('Prop spreading', () => { - test('should allow props to be spread to the Image component', () => { - const element = mount( - - ); - - expect( - element.getDOMNode().attributes['data-sample'].value - ).toBe('Sample'); - }); - }); - - test('forwards the ref', () => { - let ref; - class Test extends React.Component { - constructor(props) { - super(props); - ref = React.createRef(); - } - render = () => (); - } - mount(); - expect(ref.current.tagName).toEqual('SPAN'); - expect(ref.current.className).toEqual('fd-image--m'); - }); -}); diff --git a/src/Image/__stories__/Image.stories.js b/src/Image/__stories__/Image.stories.js deleted file mode 100644 index 929e1d861..000000000 --- a/src/Image/__stories__/Image.stories.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable react/no-multi-comp */ -import Image from '../Image'; -import React from 'react'; - -export default { - title: 'Component API/Image', - component: Image -}; - -export const primary = () => ( - -); - -export const sizes = () => ( -
- - - -
-); - -export const shapes = () => ( -
- - - -
-); diff --git a/src/Image/__stories__/__snapshots__/Image.visual.storyshot b/src/Image/__stories__/__snapshots__/Image.visual.storyshot deleted file mode 100644 index 0b11ce3a5..000000000 --- a/src/Image/__stories__/__snapshots__/Image.visual.storyshot +++ /dev/null @@ -1,78 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Storyshots Visual Image 1`] = ` -
-
- -
-
-
- - - -
-
-
-
- - - -
-
-
-`; diff --git a/src/Link/Link.js b/src/Link/Link.js index c40cbb0b7..ba12885d1 100644 --- a/src/Link/Link.js +++ b/src/Link/Link.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import React, { useEffect } from 'react'; /** Use an **Link** component to display a link. */ -const Link = React.forwardRef(({ className, children, disabled, disableStyles, ...props }, ref) => { +const Link = React.forwardRef(({ className, children, disabled, disableStyles, subtle, ...props }, ref) => { useEffect(() => { if (!disableStyles) { @@ -13,7 +13,10 @@ const Link = React.forwardRef(({ className, children, disabled, disableStyles, . const imageClasses = classnames( 'fd-link', - { 'is-disabled': !!disabled }, + { + 'is-disabled': !!disabled, + 'fd-link--subtle': subtle + }, className ); return ( @@ -36,7 +39,9 @@ Link.propTypes = { className: PropTypes.string, /** Set to **true** to mark component as disabled and make it non-interactive */ disabled: PropTypes.bool, - disableStyles: PropTypes.bool + disableStyles: PropTypes.bool, + /** Set to **true** to apply subtle styling */ + subtle: PropTypes.bool }; export default Link; diff --git a/src/Link/__stories__/Link.stories.js b/src/Link/__stories__/Link.stories.js index f2cb97a6e..1d86fcff3 100644 --- a/src/Link/__stories__/Link.stories.js +++ b/src/Link/__stories__/Link.stories.js @@ -12,3 +12,7 @@ export const primary = () => (Default); export const disabled = () => ( Disabled ); + +export const subtle = () => ( + Subtle +); diff --git a/src/Link/__stories__/__snapshots__/Link.visual.storyshot b/src/Link/__stories__/__snapshots__/Link.visual.storyshot index b3d8fe8b3..d444d0cd0 100644 --- a/src/Link/__stories__/__snapshots__/Link.visual.storyshot +++ b/src/Link/__stories__/__snapshots__/Link.visual.storyshot @@ -21,5 +21,13 @@ exports[`Storyshots Visual Link 1`] = ` Disabled + `; diff --git a/src/List/List.js b/src/List/List.js index 51d262a92..45d71537f 100644 --- a/src/List/List.js +++ b/src/List/List.js @@ -1,8 +1,10 @@ import classnames from 'classnames'; +import ListByline from './_ListByline'; import ListFooter from './_ListFooter'; import ListHeader from './_ListHeader'; import ListIcon from './_ListIcon'; import ListItem from './_ListItem'; +import ListSelection from './_ListSelection'; import ListText from './_ListText'; import PropTypes from 'prop-types'; import React, { useEffect } from 'react'; @@ -15,7 +17,10 @@ const List = React.forwardRef(({ className, compact, disableStyles, + hasByline, + navigation, noBorder, + partialNavigation, ...props }, ref) => { @@ -29,7 +34,10 @@ const List = React.forwardRef(({ 'fd-list', { 'fd-list--compact': compact, - 'fd-list--no-border': noBorder + 'fd-list--no-border': noBorder, + 'fd-list--byline': hasByline, + 'fd-list--navigation': navigation || partialNavigation, + 'fd-list--navigation-indication': navigation || partialNavigation }, className ); @@ -37,7 +45,7 @@ const List = React.forwardRef(({ return (
    - {children} + { React.Children.map(children, child => React.cloneElement(child, { hasByline, navigation, partialNavigation })) }
); }); @@ -53,8 +61,14 @@ List.propTypes = { compact: PropTypes.bool, /** Internal use only */ disableStyles: PropTypes.bool, + /** Set to **true** if any list item has a byline. */ + hasByline: PropTypes.bool, + /** Set to **true** if all list items are links */ + navigation: PropTypes.bool, /** Set to **true** to remove borders from the List component. */ - noBorder: PropTypes.bool + noBorder: PropTypes.bool, + /** Set to **true** if any list item is a link, but not all */ + partialNavigation: PropTypes.bool }; @@ -63,5 +77,7 @@ List.Header = ListHeader; List.Item = ListItem; List.Icon = ListIcon; List.Text = ListText; +List.Byline = ListByline; +List.Selection = ListSelection; export default List; diff --git a/src/List/ListByline.test.js b/src/List/ListByline.test.js new file mode 100644 index 000000000..97dae75ce --- /dev/null +++ b/src/List/ListByline.test.js @@ -0,0 +1,15 @@ +import List from './List'; +import { mount } from 'enzyme'; +import React from 'react'; + +describe('', () => { + describe('Prop spreading', () => { + test('should allow props to be spread to the ListByline component', () => { + const element = mount(); + + expect( + element.getDOMNode().attributes['data-sample'].value + ).toBe('Sample'); + }); + }); +}); diff --git a/src/List/ListItem.test.js b/src/List/ListItem.test.js index 5fe88ea3b..f97d4334c 100644 --- a/src/List/ListItem.test.js +++ b/src/List/ListItem.test.js @@ -4,7 +4,7 @@ import React from 'react'; describe('', () => { describe('onClick callback', () => { - test('should call onClick callback after click', () => { + test('should call onClick callback after click if link', () => { const click = jest.fn(); let wrapper = mount(Test); wrapper diff --git a/src/List/ListSelection.test.js b/src/List/ListSelection.test.js new file mode 100644 index 000000000..05f15a324 --- /dev/null +++ b/src/List/ListSelection.test.js @@ -0,0 +1,15 @@ +import List from './List'; +import { mount } from 'enzyme'; +import React from 'react'; + +describe('', () => { + describe('Prop spreading', () => { + test('should allow props to be spread to the ListSelection component', () => { + const element = mount(); + + expect( + element.getDOMNode().attributes['data-sample'].value + ).toBe('Sample'); + }); + }); +}); diff --git a/src/List/_ListByline.js b/src/List/_ListByline.js new file mode 100644 index 000000000..d33235d0c --- /dev/null +++ b/src/List/_ListByline.js @@ -0,0 +1,44 @@ +import classnames from 'classnames'; +import PropTypes from 'prop-types'; +import React from 'react'; + +const ListByline = ({ + className, + children, + twoColumns, + ...props +}) => { + + const ListBylineClasses = classnames( + 'fd-list__byline', + { + 'fd-list__byline--2-col': twoColumns + }, + className + ); + + + return ( +
+ {children} +
+ ); +}; + + +ListByline.displayName = 'List.Byline'; + +ListByline.propTypes = { + /** Node(s) to render within the component */ + children: PropTypes.node, + /** CSS class(es) to add to the element */ + className: PropTypes.string, + /** Set to **true** if two List.Text bylines will be passed as children. */ + twoColumns: PropTypes.bool +}; + +ListByline.defaultProps = { + twoColumns: false +}; + +export default ListByline; diff --git a/src/List/_ListItem.js b/src/List/_ListItem.js index d557a6189..c8c82dcb7 100644 --- a/src/List/_ListItem.js +++ b/src/List/_ListItem.js @@ -1,39 +1,82 @@ import classnames from 'classnames'; import PropTypes from 'prop-types'; -import React, { useState } from 'react'; +import React from 'react'; const ListItem = ({ + action, + buttonProps, className, children, + hasByline, onClick, + navigation, + partialNavigation, selected, + url, ...props }) => { - let [isSelected, setIsSelected] = useState(selected); - const handleClick = (e) => { - setIsSelected(!isSelected); onClick(e); }; + const isLink = navigation || (partialNavigation && url); + const ListItemClasses = classnames( 'fd-list__item', { - 'is-selected': isSelected + 'fd-list__item--link': isLink, + 'fd-list__item--action': action }, className ); + let content; + + if (hasByline) { + content = ( +
+ {children} +
+ ); + } else if (isLink) { + const linkClassNames = classnames( + 'fd-list__link', + { + 'fd-list__link--navigation-indicator': partialNavigation, + 'is-selected': isLink && selected + } + ); + + content = ( + + {children} + + ); + } else if (action) { + content = ( + + ); + } else { + content = children; + } + + const disableListItemOnClick = isLink || action; + return (
  • - {children} + onClick={disableListItemOnClick ? null : handleClick} + tabIndex={isLink ? '-1' : '0'}> + {content}
  • ); @@ -42,13 +85,25 @@ const ListItem = ({ ListItem.displayName = 'List.Item'; ListItem.propTypes = { + /** Set to true if list item is a button that will trigger an action */ + action: PropTypes.bool, + /** Props to pass to the action button */ + buttonProps: PropTypes.object, /** Node(s) to render within the component */ children: PropTypes.node, /** CSS class(es) to add to the element */ className: PropTypes.string, - /** Set to **true** to set state of the list item to "selected". */ + /** Internal use only */ + hasByline: PropTypes.bool, + /** Internal use only */ + navigation: PropTypes.bool, + /** Interal use only */ + partialNavigation: PropTypes.bool, + /** Set to **true** if list item is currently selected (only supported for links) */ selected: PropTypes.bool, - /** Callback function when user clicks on the component*/ + /** URL to navigate to if list item is a link */ + url: PropTypes.string, + /** Callback function when user clicks on the component (not supported for links) */ onClick: PropTypes.func }; diff --git a/src/List/_ListSelection.js b/src/List/_ListSelection.js new file mode 100644 index 000000000..2d1c29d24 --- /dev/null +++ b/src/List/_ListSelection.js @@ -0,0 +1,40 @@ +import Checkbox from '../Forms/Checkbox'; +import classnames from 'classnames'; +import PropTypes from 'prop-types'; +import React from 'react'; + +const ListSelection = ({ + className, + children, + onChange, + ...props +}) => { + + const ListSelectionClasses = classnames( + 'fd-form-item', + 'fd-list__form-item', + className + ); + + return ( + <> +
    + +
    + {children} + + ); +}; + +ListSelection.displayName = 'List.Selection'; + +ListSelection.propTypes = { + /** Node(s) to render within the component */ + children: PropTypes.node, + /** CSS class(es) to add to the element */ + className: PropTypes.string, + /** Callback function when the change event fires on the Checkbox component */ + onChange: PropTypes.func +}; + +export default ListSelection; diff --git a/src/List/_ListText.js b/src/List/_ListText.js index 8c6eedacf..7bf4bca9b 100644 --- a/src/List/_ListText.js +++ b/src/List/_ListText.js @@ -3,19 +3,27 @@ import PropTypes from 'prop-types'; import React from 'react'; const ListText = ({ - className, children, + className, + left, noWrap, + right, secondary, ...props }) => { - const type = secondary ? 'secondary' : 'title'; + let type = 'title'; + + if (secondary) { + type = 'secondary'; + } const listTextClasses = classnames( - [`fd-list__${type}`], { - [`fd-list__${type}--no-wrap`]: noWrap + [`fd-list__${type}`]: !left && !right, + [`fd-list__${type}--no-wrap`]: noWrap, + 'fd-list__byline-left': left, + 'fd-list__byline-right': right }, className ); @@ -35,8 +43,12 @@ ListText.propTypes = { children: PropTypes.node, /** CSS class(es) to add to the element */ className: PropTypes.string, + /** Set to **true** if there are two bylines to left align the text. */ + left: PropTypes.bool, /** Text is wrapped by default, set to **true** to prevent the text from wrapping */ noWrap: PropTypes.bool, + /** Set to **true** if there are two bylines to right align the text. */ + right: PropTypes.bool, /** Set to **true** to right align the text in the list */ secondary: PropTypes.bool }; diff --git a/src/List/__stories__/List.stories.js b/src/List/__stories__/List.stories.js index c40abcf3a..3ad6f4ff4 100644 --- a/src/List/__stories__/List.stories.js +++ b/src/List/__stories__/List.stories.js @@ -189,6 +189,116 @@ export const dev = () => ( ); +export const byline = () => ( + + List Header + + List Item 1 + Byline + + + List Item 2 + Byline + + + List Item 3 + Byline + + + List Item 4 + + Left byline + Right byline + + + List Footer + +); + +export const selection = () => ( + + List Header + + + List Item 1 + + + + + List Item 2 + + + + + List Item 3 + + + + + List Item 4 + + + List Footer + +); + +export const partialNavigation = () => ( + + List Header + + List Item 1 + + + List Item 2 + + + List Item 3 + + + List Item 4 + + List Footer + +); + +export const navigationList = () => ( + + List Header + + List Item 1 + + + List Item 2 + + + List Item 3 + + + List Item 4 + + List Footer + +); + +export const actionList = () => ( + + List Header + + List Item 1 + + + List Item 2 + + + List Item 3 + + + List Item 4 + + List Footer + +); + dev.story = { parameters: { docs: { disable: true } } }; diff --git a/src/List/__stories__/__snapshots__/List.visual.storyshot b/src/List/__stories__/__snapshots__/List.visual.storyshot index ff8873daa..4b3d4d8df 100644 --- a/src/List/__stories__/__snapshots__/List.visual.storyshot +++ b/src/List/__stories__/__snapshots__/List.visual.storyshot @@ -9,10 +9,8 @@ exports[`Storyshots Visual List 1`] = ` className="fd-list" >
  • +
    +
      +
    • + List Header +
    • +
    • +
      + + List Item 1 + +
      + Byline +
      +
      +
    • +
    • +
      + + List Item 2 + +
      + Byline +
      +
      +
    • +
    • +
      + + List Item 3 + +
      + Byline +
      +
      +
    • +
    • +
      + + List Item 4 + +
      + + Left byline + + + Right byline + +
      +
      +
    • +
    • + List Footer +
    • +
    +
    +
    +
      +
    • + List Header +
    • +
    • +
      +
      + +
      +
      + + List Item 1 + +
    • +
    • +
      +
      + +
      +
      + + List Item 2 + +
    • +
    • +
      +
      + +
      +
      + + List Item 3 + +
    • +
    • +
      +
      + +
      +
      + + List Item 4 + +
    • +
    • + List Footer +
    • +
    +
    +
    + +
    +
    + +
    +
    +
      +
    • + List Header +
    • +
    • + + List Item 1 + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + List Footer +
    • +
    +
    `; diff --git a/src/Menu/_MenuItem.js b/src/Menu/_MenuItem.js index fb7d68252..274bf4bc8 100644 --- a/src/Menu/_MenuItem.js +++ b/src/Menu/_MenuItem.js @@ -47,7 +47,8 @@ const MenuItem = ({ return ( + onClick={onclick} + role='menuitem'> {addonBefore && } {children} {addonAfter && } @@ -75,7 +76,8 @@ const MenuItem = ({ } else if (children) { return ( + onClick={onclick} + role='menuitem'> {addonBefore && } {children} {addonAfter && } @@ -90,7 +92,10 @@ const MenuItem = ({ return ( -
  • +
  • {renderLink()}
  • {separator && } diff --git a/src/Menu/_MenuList.js b/src/Menu/_MenuList.js index 1fcec9152..e2be49fd7 100644 --- a/src/Menu/_MenuList.js +++ b/src/Menu/_MenuList.js @@ -9,7 +9,10 @@ const MenuList = ({ children, className, ...props }) => { ); return ( -
      +
        {children}
      ); diff --git a/src/Menu/__stories__/Menu.stories.js b/src/Menu/__stories__/Menu.stories.js index 468d3247b..6f19f8780 100644 --- a/src/Menu/__stories__/Menu.stories.js +++ b/src/Menu/__stories__/Menu.stories.js @@ -1,5 +1,4 @@ /* eslint-disable react/no-multi-comp */ -import Link from '../../Link/Link'; import Menu from '../Menu'; import MenuItem from '../_MenuItem'; import MenuList from '../_MenuList'; @@ -30,17 +29,17 @@ export const primary = () => ( export const separator = () => ( - - Option 1 + + Option 1 - - Option 2 + + Option 2 - - Option 3 + + Option 3 - - Option 4 + + Option 4 @@ -58,17 +57,17 @@ separator.story = { export const states = () => ( - - Option 1 + + Option 1 - - Option 2 + + Option 2 - - Option 3 + + Option 3 - - Option 4 + + Option 4 @@ -86,17 +85,20 @@ states.story = { export const addOns = () => ( - - Option 1 + + Option 1 - - Option 2 + + Option 2 - - Option 3 + + Option 3 - - Option 4 + + Option 4 diff --git a/src/Menu/__stories__/__snapshots__/Menu.visual.storyshot b/src/Menu/__stories__/__snapshots__/Menu.visual.storyshot index cec961bf3..77c7387b5 100644 --- a/src/Menu/__stories__/__snapshots__/Menu.visual.storyshot +++ b/src/Menu/__stories__/__snapshots__/Menu.visual.storyshot @@ -10,13 +10,16 @@ exports[`Storyshots Visual Menu 1`] = ` >
            • (
              - +

              Tile Description

              diff --git a/src/Panel/__stories__/__snapshots__/Panel.visual.storyshot b/src/Panel/__stories__/__snapshots__/Panel.visual.storyshot index ad3cfd2de..d745a06d2 100644 --- a/src/Panel/__stories__/__snapshots__/Panel.visual.storyshot +++ b/src/Panel/__stories__/__snapshots__/Panel.visual.storyshot @@ -105,7 +105,7 @@ exports[`Storyshots Visual Panel 1`] = ` className="fd-popover__control" >
              - ) : ( - '' - )} - +
              - ) : ( - '' - )} -
              + glyph='navigation-down-arrow' + onClick={this._onDown} + option='transparent' /> + ); } } @@ -251,11 +291,12 @@ TimeItem.displayName = 'TimeItem'; TimeItem.propTypes = { localizedText: PropTypes.object.isRequired, + active: PropTypes.string, arialabel: PropTypes.string, /** Set to **true** to mark component as disabled and make it non-interactive */ disabled: PropTypes.bool, - /** Internal use only */ disableStyles: PropTypes.bool, + /** Internal use only */ downButtonProps: PropTypes.object, format12Hours: PropTypes.bool, /** Additional props to be spread to the `` element */ @@ -264,14 +305,14 @@ TimeItem.propTypes = { name: PropTypes.string, /** Localized placeholder text of the input */ placeholder: PropTypes.string, - spinners: PropTypes.bool, - style: PropTypes.string, time: PropTypes.object, - /** Sets the variation of the component. Primarily used for styling */ - type: PropTypes.string, upButtonProps: PropTypes.object, + /* Internal use only */ + updateActiveColumn: PropTypes.func, updateTime: PropTypes.func, - value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]) + value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), + /* Internal use only */ + onCollapsedClick: PropTypes.func }; TimeItem.defaultProps = { diff --git a/src/Time/__stories__/Time.stories.js b/src/Time/__stories__/Time.stories.js index e8cc06e77..156dbd750 100644 --- a/src/Time/__stories__/Time.stories.js +++ b/src/Time/__stories__/Time.stories.js @@ -14,7 +14,6 @@ export const meridiemTime = () =>
              @@ -116,108 +182,175 @@ exports[`Storyshots Visual Time 1`] = `
              -
              -
              - +
              +
              -
              -
              - +
              +
              -
              -
              - +
              +
              @@ -225,117 +358,180 @@ exports[`Storyshots Visual Time 1`] = `
              -
              -
              - +
              +
              -
              -
              - +
              +
              -
              -
              - +
              +
              @@ -343,108 +539,175 @@ exports[`Storyshots Visual Time 1`] = `
              -
              -
              - +
              +
              -
              -
              - +
              +
              -
              -
              - +
              +