diff --git a/.eslintignore b/.eslintignore index e1311fb1..f623800d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,2 @@ -/.docz/** /dist/** .eslintrc.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 3e68164a..2f74cc21 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,25 +1,72 @@ +/** + * Copyright (c) 2013-present, creativeLabs Lukasz Holeczek. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict' + module.exports = { - parser: '@typescript-eslint/parser', // Specifies the ESLint parser + root: true, // So parent files don't get applied + env: { + es6: true, + browser: true, + node: true, + }, + extends: [ + 'plugin:react/recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + 'plugin:unicorn/recommended', + ], + parser: '@typescript-eslint/parser', parserOptions: { - ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features - sourceType: 'module', // Allows for the use of imports + ecmaVersion: 2020, + sourceType: 'module', ecmaFeatures: { - jsx: true, // Allows for the parsing of JSX + jsx: true, }, }, + plugins: ['@typescript-eslint', 'react', 'react-hooks'], settings: { react: { - version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use + pragma: 'React', + version: 'detect', }, }, - extends: [ - 'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react - 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin - 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. - ], - plugins: ['jsdoc', '@typescript-eslint', 'react', 'react-hooks'], rules: { - // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs - // e.g. "@typescript-eslint/explicit-function-return-type": "off", + 'unicorn/filename-case': 'off', + 'unicorn/no-array-for-each': 'off', + 'unicorn/no-null': 'off', + 'unicorn/prefer-dom-node-append': 'off', + 'unicorn/prefer-export-from': 'off', + 'unicorn/prefer-query-selector': 'off', + 'unicorn/prevent-abbreviations': 'off', }, + overrides: [ + { + files: ['packages/docs/build/**'], + env: { + browser: false, + node: true, + }, + parserOptions: { + sourceType: 'script', + }, + rules: { + '@typescript-eslint/no-var-requires': 'off', + 'no-console': 'off', + 'unicorn/prefer-module': 'off', + 'unicorn/prefer-top-level-await': 'off', + }, + }, + { + files: ['packages/docs/**'], + rules: { + '@typescript-eslint/no-var-requires': 'off', + 'unicorn/prefer-module': 'off', + }, + }, + ], } diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index ddf49052..544d42d2 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,4 @@ # These are supported funding model platforms -custom: "https://coreui.io/pro/" +custom: "https://coreui.io/pricing/?support=true" +open_collective: coreui diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9be6f82b..87980fbc 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,7 +11,7 @@ Before opening: - [Search for duplicate or closed issues](https://github.com/coreui/coreui-react/issues?utf8=%E2%9C%93&q=is%3Aissue) - [Validate](https://html5.validator.nu/) any HTML to avoid common problems -- Read the [contributing guidelines](https://github.com/coreui/coreui-react/blob/v4-dev/.github/CONTRIBUTING.md) +- Read the [contributing guidelines](https://github.com/coreui/coreui-react/blob/main/.github/CONTRIBUTING.md) Bug reports must include: diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index 3d3cbbe5..9d4da715 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -6,4 +6,4 @@ See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports. For general troubleshooting or help getting started: -- Join [the official community](https://community.coreui.io/). +- Join [GitHub Discussions](https://github.com/coreui/coreui-react/discussions/). diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..ae659d2c --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,27 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '18 14 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions' + stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' diff --git a/.gitignore b/.gitignore index a2c0383b..70f24f47 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,32 @@ coverage/ dist/ node_modules/ -public/ \ No newline at end of file +public/ +yarn.lock + +# IDEs and editors +.idea/ + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# System files +.DS_Store +Thumbs.db + +# Numerous always-ignore extensions +*.diff +*.err +*.log +*.orig +*.rej +*.swo +*.swp +*.vi +*.zip +*~ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..d6139f86 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,8 @@ +[submodule "packages/coreui-react-chartjs"] + path = packages/coreui-react-chartjs + url = https://github.com/coreui/coreui-react-chartjs.git + branch = main +[submodule "packages/coreui-icons-react"] + path = packages/coreui-icons-react + url = https://github.com/coreui/coreui-icons-react.git + branch = main diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 7552ce55..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,451 +0,0 @@ -### Changelog - -#### [4.0.0-alpha.0](https://github.com/coreui/coreui-react/compare/3.4.3...4.0.0-alpha.0) - -> 14 April 2021 - -- Initial release for CoreUI 4 for React.js -#### [3.4.4](https://github.com/coreui/coreui-react/compare/3.4.3...3.4.4) - -> 19 January 2021 - -- test(CModal): update test, snapshots and story [`c797328`](https://github.com/coreui/coreui-react/commit/c7973286896a7e354ba64ee7b81a78fbf35e19e4) -- chore: dependencies update [`852c9c8`](https://github.com/coreui/coreui-react/commit/852c9c830108c303796ea677b890a614cdb38270) -- added scrollable prop to CModal - uses modal-dialog-scrollable from Bootstrap [`1b3a019`](https://github.com/coreui/coreui-react/commit/1b3a019f12561b625567e805f4d489b3e79a1da1) -- fix(CModal): add missing modal-dialog-scrollable - thanks @ljuborados [`9d480af`](https://github.com/coreui/coreui-react/commit/9d480afbe6d619c51abd152fc332b3c09974b2da) - -#### [3.4.3](https://github.com/coreui/coreui-react/compare/3.4.2...3.4.3) - -> 22 December 2020 - -- fix(CDataTable): correct itemsPerPageSelect padding [`#171`](https://github.com/coreui/coreui-react/pull/171) -- fix(CDataTable): tableFilter and cleaner minor cleanup [`1b5079f`](https://github.com/coreui/coreui-react/commit/1b5079f76020d579d2edc00da20edec0956521bf) -- chore(release): 3.4.3 [`72497b6`](https://github.com/coreui/coreui-react/commit/72497b696f8f90694fc953c5d047511c14c351d1) - -#### [3.4.2](https://github.com/coreui/coreui-react/compare/3.4.1...3.4.2) - -> 18 December 2020 - -- fix(CToast): add missing color prop [`f48c98c`](https://github.com/coreui/coreui-react/commit/f48c98cf7f66ed3089730fbb37da5d0c4a975563) -- chore(release): 3.4.2 [`939098f`](https://github.com/coreui/coreui-react/commit/939098f265dc9fe8d908995db369bae3f3c65ef9) - -#### [3.4.1](https://github.com/coreui/coreui-react/compare/3.4.0...3.4.1) - -> 18 December 2020 - -- fix(index.d.ts): CDropdownDivider and CDropdownHeader not defined [`#170`](https://github.com/coreui/coreui-react/issues/170) -- chore(release): 3.4.1 [`cdb9aa7`](https://github.com/coreui/coreui-react/commit/cdb9aa7e247fbfb7053a7ad1e9ca2917b2c6640b) -- chore: dependencies update [`4ae0d80`](https://github.com/coreui/coreui-react/commit/4ae0d80405a4093bd8d1545a1ea7006f33665f9e) - -#### [3.4.0](https://github.com/coreui/coreui-react/compare/3.4.0-beta.0...3.4.0) - -> 11 December 2020 - -- chore: 3.4.0 version release for React 17 [`ddaea52`](https://github.com/coreui/coreui-react/commit/ddaea52b12d05825e56f79275e30132b14b8db2b) -- fix(CWidgetBrand): addHeaderClass bad PropTypes [`d2c102b`](https://github.com/coreui/coreui-react/commit/d2c102b50f0b15a89a2a66334923798b267ddeea) -- chore: dependencies update [`8b7abe8`](https://github.com/coreui/coreui-react/commit/8b7abe8716aec3aa3757a1e25067931253c14c6f) - -#### [3.4.0-beta.0](https://github.com/coreui/coreui-react/compare/3.3.6...3.4.0-beta.0) - -> 10 December 2020 - -- test: enzyme-adapter-react-17 temp fix [`9a93f26`](https://github.com/coreui/coreui-react/commit/9a93f2610254f5584eb5e8f70b34a8456b3a2dc8) -- chore: update to React 17 and dependencies [`dc7e219`](https://github.com/coreui/coreui-react/commit/dc7e219546b6c2a41a060042ce619e84fb1140ae) -- test(CToast): use act() from react-dom/test-utils [`fce83f8`](https://github.com/coreui/coreui-react/commit/fce83f810768ed67a27acc2f9b10c4e845d91092) -- fix(stories): className [`ab3348a`](https://github.com/coreui/coreui-react/commit/ab3348a5aac8eb008c23a5cc6292a7836353a311) -- test(CDataTable): snap update className fix [`d6e58d5`](https://github.com/coreui/coreui-react/commit/d6e58d5003426184e632071d9a8fe2e38b73baad) -- fix(CWidgetBrand): addHeaderClass bad PropTypes [`937a713`](https://github.com/coreui/coreui-react/commit/937a71394614d8bd66524900fdd415d8dc6f5918) - -#### [3.3.6](https://github.com/coreui/coreui-react/compare/3.3.5...3.3.6) - -> 10 December 2020 - -- fix(CWidgetBrand): addHeaderClass bad PropTypes [`d2c102b`](https://github.com/coreui/coreui-react/commit/d2c102b50f0b15a89a2a66334923798b267ddeea) -- 3.3.6 version release [`7fc09a3`](https://github.com/coreui/coreui-react/commit/7fc09a343da9b623548ebc99cddd5fe9bf40c956) -- fix(stories): className [`ab3348a`](https://github.com/coreui/coreui-react/commit/ab3348a5aac8eb008c23a5cc6292a7836353a311) - -#### [3.3.5](https://github.com/coreui/coreui-react/compare/3.3.4...3.3.5) - -> 9 December 2020 - -- test: add github actions project check [`552a1fd`](https://github.com/coreui/coreui-react/commit/552a1fd7a7dfe5273f55ed1445e98651df80928e) -- 3.3.5 version release [`757f523`](https://github.com/coreui/coreui-react/commit/757f523cdac052fab1735d7ada274fc417d8021f) -- fix(CDataTable): missing select perPageItems initial value [`eaca895`](https://github.com/coreui/coreui-react/commit/eaca8955913fafe0f6100952e98ebf7afd34c32b) -- chore: dependencies update [`41f3899`](https://github.com/coreui/coreui-react/commit/41f38999bb2e32c80d23a425c66cb79bca3ec363) - -#### [3.3.4](https://github.com/coreui/coreui-react/compare/3.3.3...3.3.4) - -> 26 November 2020 - -- chore: dependencies update [`7ded326`](https://github.com/coreui/coreui-react/commit/7ded3260c88bae4fda149cf2037c4f0cb5f75d9f) -- chore: update changelog [`86cec07`](https://github.com/coreui/coreui-react/commit/86cec0727dc56160eadc71fb82b97dc5a460659b) -- chore: 3.3.4 version release [`dea91fc`](https://github.com/coreui/coreui-react/commit/dea91fcac3e890c8ed3deeee5b386cf8d25547b4) - -#### [3.3.3](https://github.com/coreui/coreui-react/compare/3.3.2...3.3.3) - -> 4 November 2020 - -- chore: dependencies update [`a53dbdc`](https://github.com/coreui/coreui-react/commit/a53dbdce08a200aacb52ab935b43dc480d85d327) -- fix(Modal): missing className prop [`7bbc5fd`](https://github.com/coreui/coreui-react/commit/7bbc5fdd06d9a3de4cc56ac57e80dc4c4ef8fa45) -- chore: 3.3.3 version release [`0022dc8`](https://github.com/coreui/coreui-react/commit/0022dc81ddf306aefdec0023d3c2f2c0cc8e7000) - -#### [3.3.2](https://github.com/coreui/coreui-react/compare/3.3.1...3.3.2) - -> 24 October 2020 - -- chore: 3.3.2 version release [`fbf5379`](https://github.com/coreui/coreui-react/commit/fbf537971f7e83729832939ec979818d9a608dfe) -- chore: dependencies update [`b3b5410`](https://github.com/coreui/coreui-react/commit/b3b54105bfc31cd60c84ce7418f5e1dced19ad6c) -- test: fix test configuration, update snapshots [`81a4d7f`](https://github.com/coreui/coreui-react/commit/81a4d7f5f38cbee457ca4368fb1e40cbffb09cf8) -- test: update tabs tests [`39b4284`](https://github.com/coreui/coreui-react/commit/39b4284b98cb507c6a83860f218f42a559d99532) -- chore: delete test snapshots from es build [`b40c300`](https://github.com/coreui/coreui-react/commit/b40c300261b91c440543fbb477fc8ed6738cc2a9) -- test: fix tooltip tests [`44839c9`](https://github.com/coreui/coreui-react/commit/44839c97fab34d645e424f33cec5e6bd18d525e3) -- test: comment out some broken tests as todo [`64f7387`](https://github.com/coreui/coreui-react/commit/64f73871ff1c33f07adffc058c161e517db29167) -- fix: CTabPane: fix 'active' prop, refactor component [`7fa04f8`](https://github.com/coreui/coreui-react/commit/7fa04f8311b7820e2b50a657d538f8d5a18c188e) -- chore: exclude test files from es build [`cf34f54`](https://github.com/coreui/coreui-react/commit/cf34f549844d842d67e95da0f8ce98adc1e32549) -- chore: update changelog [`edd558a`](https://github.com/coreui/coreui-react/commit/edd558a05dcbe7219cfdbff18b793c70b586147d) -- chore: Merge branch 'dev-tests' into dev [`b47d3d5`](https://github.com/coreui/coreui-react/commit/b47d3d57de935dc753ed6b991828db067bdabcce) -- chore: Merge branch 'dev-storybook' into dev [`27c4629`](https://github.com/coreui/coreui-react/commit/27c462980c3845d204c48f14eece0618b2021430) - -#### [3.3.1](https://github.com/coreui/coreui-react/compare/3.3.0...3.3.1) - -> 15 October 2020 - -- chore: 3.3.1 version release [`abbe01f`](https://github.com/coreui/coreui-react/commit/abbe01f61b1c38cd764bb3e4ebbfa11ec10127a3) -- chore: dependencies update [`93397ae`](https://github.com/coreui/coreui-react/commit/93397ae968cd4e11c6780b2ed7a00cacea74e2e9) -- fix(CSidebar): onShowChange callback behavior overwritten for overlaid [`c463ea5`](https://github.com/coreui/coreui-react/commit/c463ea566e3b997d3926781f13273fcd66bf7065) -- fix(CSidebar): add missing xxl breakpoint [`9c84573`](https://github.com/coreui/coreui-react/commit/9c84573511feeff615bee105a5cb2a0ced8fc5a6) - -#### [3.3.0](https://github.com/coreui/coreui-react/compare/3.2.3...3.3.0) - -> 4 September 2020 - -- fix: CSidebarNavItem/CSidebarNavDropdown: accessibility fixes #141 [`#141`](https://github.com/coreui/coreui-react/issues/141) -- chore: 3.3.0 version release - update dependencies [`b3be47d`](https://github.com/coreui/coreui-react/commit/b3be47da28c8813e273bc00af73f552589c7e52f) -- refactor: CSidebar: clearify component [`02b6b0d`](https://github.com/coreui/coreui-react/commit/02b6b0d3b3d60635f51cb6340200d88ca8610f93) -- feat: CSidebar: close mobile/overlaid sidebar on 'esc' #141 [`4e35ed8`](https://github.com/coreui/coreui-react/commit/4e35ed83c9d14737e10fb732984f0f5f8ca4da49) -- fix: CSidebar: close sidebar when click on `Item` in overlaid mode [`59d31b7`](https://github.com/coreui/coreui-react/commit/59d31b7a315c115891ef0be371decddd6d0af68d) -- chore: update changelog [`5f71c83`](https://github.com/coreui/coreui-react/commit/5f71c8306e86fdea0097483a57475b5ddb7e43b5) -- feat: CSidebarNavItem: allow passing nodes to 'name' prop #140 [`074c7e7`](https://github.com/coreui/coreui-react/commit/074c7e775543efc3a87c904f4c8704883127edb5) -- fix: CSidebar: disable 'useCapture' in overlaid sidebar closing [`30e7004`](https://github.com/coreui/coreui-react/commit/30e7004dd8edb8e947048188911b8a20049375e8) -- fix: CDataTable: add space in 'noItemsText' [`1d41870`](https://github.com/coreui/coreui-react/commit/1d41870ca606e0c628fc89854ad3aad6490cb839) - -#### [3.2.3](https://github.com/coreui/coreui-react/compare/3.2.2...3.2.3) - -> 11 August 2020 - -- chore: 3.2.3 version release - update dependencies [`f238624`](https://github.com/coreui/coreui-react/commit/f23862495a8a3d7e394108361dbee2d61dcb94fb) -- chore: update changelog [`77a9487`](https://github.com/coreui/coreui-react/commit/77a94872ebdfcf235b29de8e7a3712db0bceb19c) -- fix: CDataTable: fix wrong class assignment in itemsPerPageSelect #138 [`8425052`](https://github.com/coreui/coreui-react/commit/8425052d2c7cb4a431a1611977da98cc0f21b64c) - -#### [3.2.2](https://github.com/coreui/coreui-react/compare/3.2.1...3.2.2) - -> 31 July 2020 - -- chore: 3.2.2 release: update dependencies [`895f454`](https://github.com/coreui/coreui-react/commit/895f4545e0de72c103e1e20b082161c1f9fab1e5) -- fix: CDataTable component fixes [`9dae2ab`](https://github.com/coreui/coreui-react/commit/9dae2ab32fc9dcc730b1214ecb777776f5346bf9) -- fix: CSidebarNavDropdown: add possibility of component as `icon` [`03c4c32`](https://github.com/coreui/coreui-react/commit/03c4c3239f42b174c703f0ee5b0eef45761ceb9f) -- chore: update changelog [`df6d3b9`](https://github.com/coreui/coreui-react/commit/df6d3b9664c72690a542a1804fcff9164cc80f42) - -#### [3.2.1](https://github.com/coreui/coreui-react/compare/3.2.0...3.2.1) - -> 30 July 2020 - -- chore: 3.2.1 release: update dependencies [`40bba4d`](https://github.com/coreui/coreui-react/commit/40bba4db24b2c83416397c0b6e269a70df626641) -- chore: update chengelog [`cebb691`](https://github.com/coreui/coreui-react/commit/cebb69100d950948baa9e305a865a0ac95bf89a4) -- fix: CDataTable: fix isSortable method [`581e5a2`](https://github.com/coreui/coreui-react/commit/581e5a20019f8c4981e1a9ad1e9be30f46297789) - -#### [3.2.0](https://github.com/coreui/coreui-react/compare/3.1.0...3.2.0) - -> 28 July 2020 - -- chore: fix changelog [`0c6b6cb`](https://github.com/coreui/coreui-react/commit/0c6b6cbb2ef18e5c48be345bdace9ba51595a0f0) -- chore: add postinstall script [`acde502`](https://github.com/coreui/coreui-react/commit/acde5021d1925e901926171b3381a34809f8cea5) -- feat: CDataTable: add cleaner prop [`d0dba67`](https://github.com/coreui/coreui-react/commit/d0dba670cc49817e18f388fa80326d8b2141f6a7) -- refactor: CDataTable: disable filtering and sorting on non data columns [`2b134aa`](https://github.com/coreui/coreui-react/commit/2b134aa0d388b99ab33ea574748814d4effba32e) -- chore: 3.2.0 release: update dependencies [`9c8e377`](https://github.com/coreui/coreui-react/commit/9c8e37729073471c9a48e532e830782dec5ae1a6) -- feat: CModal: add autofucus and `esc` key support [`ecc4920`](https://github.com/coreui/coreui-react/commit/ecc4920a6dc72b5b7a34cd71a08ccdae5d3ca156) -- refactor: CDataTable: small refactors [`407201e`](https://github.com/coreui/coreui-react/commit/407201eddf3ce77591484dd78d2faa8d81a526e5) -- feat: CDrodownMenu: hide menu on `esc` [`c4fea1c`](https://github.com/coreui/coreui-react/commit/c4fea1c72777ff63a62cf9c04cbb59f90cee882c) -- chore: update changelog [`f3d83c3`](https://github.com/coreui/coreui-react/commit/f3d83c3286f4db4ad6b2b18bc8203b2944381d61) -- fix: CDataTable disable auto removing columnFilter [`a745c28`](https://github.com/coreui/coreui-react/commit/a745c286c60bdbb7b75c7db263c303c860865508) -- fix: CBreadcrumbRouter: display route only if it has 'name' key [`e4d743d`](https://github.com/coreui/coreui-react/commit/e4d743da43a51584ddf34a54746b9bd9208df44e) -- fix: CSidebarNavItem: do not render `icon` if prop is undefined #133 [`5fd72b0`](https://github.com/coreui/coreui-react/commit/5fd72b05def832894f9c6b1b166182d984b5068b) - -#### [3.1.0](https://github.com/coreui/coreui-react/compare/3.0.6...3.1.0) - -> 23 July 2020 - -- chore: modify library build [`62194bb`](https://github.com/coreui/coreui-react/commit/62194bb147e9327037778f951936663c14dc28e3) -- refactor: add full propTypes to className prop in components [`cd9c98a`](https://github.com/coreui/coreui-react/commit/cd9c98a890c9717db3a882e39ac3ccde9a711db6) -- chore: 3.1.0 release: update dependencies [`174370e`](https://github.com/coreui/coreui-react/commit/174370e754abf484bc47fba0641b7a3732e16de0) -- fix: delete disabled string type from 'innerRef' prop [`5c91a7f`](https://github.com/coreui/coreui-react/commit/5c91a7f3fe705738508c9c79cb7edfd0694444fd) -- chore: refactor typings [`7c584e4`](https://github.com/coreui/coreui-react/commit/7c584e4da250d7405080c59bc4721d0d4042bc16) -- fix: make components using Transition component use new API #127 [`eba59c2`](https://github.com/coreui/coreui-react/commit/eba59c22abf28c55dc433e5cf5e8715cba9d12e0) -- chore: add missing dependency [`0bb44f8`](https://github.com/coreui/coreui-react/commit/0bb44f8f9a406857c8652ce0fa548b458249a59e) -- chore: update changelog [`14b0c52`](https://github.com/coreui/coreui-react/commit/14b0c52cbc3562792df5b73d6b58e668971111d8) -- fix: CTabPane: fix passing innerRef [`7fa5601`](https://github.com/coreui/coreui-react/commit/7fa5601bd389078f7312b81c26962f2502dd6a87) -- fix: CAlert: add innerRef prop [`c1022a8`](https://github.com/coreui/coreui-react/commit/c1022a8cc83b1a898bd18e774751597210108177) -- feat: CSidebarNavItem: add possibility of passing icon as node [`520dc49`](https://github.com/coreui/coreui-react/commit/520dc49c2d1d1b39871ab864e64a8da18cef4273) -- fix: CModal: fix deprecation warning [`ad88025`](https://github.com/coreui/coreui-react/commit/ad8802576a22fa612883e3d928087f234c402d60) -- fix: CDropdownToggle: add role attribute in case of non-button tag [`4de6508`](https://github.com/coreui/coreui-react/commit/4de6508bbfdb128c07042b4c08e2bccc8b731988) - -#### [3.0.6](https://github.com/coreui/coreui-react/compare/3.0.5...3.0.6) - -> 15 July 2020 - -- chore: 3.0.6 release - update dependencies [`86cdba4`](https://github.com/coreui/coreui-react/commit/86cdba439efcc0eba1dc795579e0f7c32c8475fa) -- chore: dependencies update [`b49a95d`](https://github.com/coreui/coreui-react/commit/b49a95d19584356ef69cc174c6ba01a2f9144ee2) -- chore: CCol: add 'xxl' breakpoint, clean component #128 [`4dd4704`](https://github.com/coreui/coreui-react/commit/4dd4704433e8bb3ab875a9db52cc31f67c010d27) -- chore: Changelog update [`f1c00e8`](https://github.com/coreui/coreui-react/commit/f1c00e822644f9ea75fad7e11d014d9d78558fc6) - -#### [3.0.5](https://github.com/coreui/coreui-react/compare/3.0.4...3.0.5) - -> 30 June 2020 - -- chore: 3.0.5 version release: update [`422a4ce`](https://github.com/coreui/coreui-react/commit/422a4ce75b65760781daac9a0ec0971607cb74cb) -- fix: CModal: fix animation when rendered through portal [`dd28a8d`](https://github.com/coreui/coreui-react/commit/dd28a8de426842684cbcd70e038b8dad7aa72bd1) - -#### [3.0.4](https://github.com/coreui/coreui-react/compare/3.0.3...3.0.4) - -> 22 June 2020 - -- fix: CBreadcrumbRouter: fix assigning paths to items #118 [`7e2c87b`](https://github.com/coreui/coreui-react/commit/7e2c87bfeec6ee03661a5bb891bfe439fe26c0f4) -- chore: 3.0.4 version release: update dependencies [`5eac06b`](https://github.com/coreui/coreui-react/commit/5eac06b6f6ee1cffaf02a7e2e3696b517f324e56) - -#### [3.0.3](https://github.com/coreui/coreui-react/compare/3.0.2...3.0.3) - -> 17 June 2020 - -- chore: add auto-changelog [`dd56a22`](https://github.com/coreui/coreui-react/commit/dd56a22df2479371b33abc3802fb4f0406525fe1) -- chore: 3.0.3 version release: update dependencies and changelog [`293c637`](https://github.com/coreui/coreui-react/commit/293c63726e1a477af657d6b13fa619cba3ecde2f) -- fix: CModal: fix animations [`7740fce`](https://github.com/coreui/coreui-react/commit/7740fcee3583d0fd9324f23d1cd12f0c9914b19a) -- fix: CBreadcrumbRouter: add route parameters support #118 [`6d8b59b`](https://github.com/coreui/coreui-react/commit/6d8b59b9cfa145a30f4e54832941ce28ef514e29) -- feat: CDataTable: add footerSlot prop [`4d68dc8`](https://github.com/coreui/coreui-react/commit/4d68dc8f31ac724b79a003d2c6240b6f064e6cd4) - -#### [3.0.2](https://github.com/coreui/coreui-react/compare/3.0.1...3.0.2) - -> 8 June 2020 - -- chore: 3.0.2 version release [`780509e`](https://github.com/coreui/coreui-react/commit/780509ec5dac4ae2f4ca8a6f58bb2a719c286fcb) -- refactor: CPopover: delete style import [`c24553d`](https://github.com/coreui/coreui-react/commit/c24553d8fe907dc29a98f36fcae36f4b4e4f8612) - -#### [3.0.1](https://github.com/coreui/coreui-react/compare/3.0.0...3.0.1) - -> 3 June 2020 - -- chore: fix typings [`09ca1a5`](https://github.com/coreui/coreui-react/commit/09ca1a5915c16ce37cf43cb63e04adb59065e52e) -- chore: 3.0.1 version release [`5bea981`](https://github.com/coreui/coreui-react/commit/5bea9814e56224b7ac01dd0749b85a822e2fbafb) - -#### [3.0.0](https://github.com/coreui/coreui-react/compare/3.0.0-rc.2...3.0.0) - -> 1 June 2020 - -- fix: delete excessive components - CListGroupItemHeading/Text [`3681ad2`](https://github.com/coreui/coreui-react/commit/3681ad24225078f338d2b3d646ca71bf70de4095) -- chore: 3.0.0 release [`aec0f09`](https://github.com/coreui/coreui-react/commit/aec0f093e08d92d38a3e633623e61971d7e93d67) -- fix: prevent breaking change in CListGroupItemHeading/Text [`8299524`](https://github.com/coreui/coreui-react/commit/829952493cbd84ebc607ec748617fb9d666354d2) -- feat: CSidebarNavItem: add color prop [`12c2ba3`](https://github.com/coreui/coreui-react/commit/12c2ba3b26d8cdc3aa6e9937f9ad3333a13e7788) -- fix: CFade: assign nodeRef to Transition to prevent warning [`907e59a`](https://github.com/coreui/coreui-react/commit/907e59a6297a2221567aab5cba8548ec28e204e5) - -#### [3.0.0-rc.2](https://github.com/coreui/coreui-react/compare/v2.5.8...3.0.0-rc.2) - -> 29 May 2020 - -- Breadcrumb rewrite, BuuttonGroup & ButtonToolbar refactor [`#2`](https://github.com/coreui/coreui-react/pull/2) -- fix: CAlert: component refactor [`#1`](https://github.com/coreui/coreui-react/pull/1) -- CoreUI v3.0.0-alpha.0 for React - demo update WIP [`c8905a3`](https://github.com/coreui/coreui-react/commit/c8905a3d86731d2a494fba52abed062a400a0830) -- chore: delete demo [`5ef9a37`](https://github.com/coreui/coreui-react/commit/5ef9a375a1ecdaf509c57a72fffe76054c1dd69f) -- chore: update dependencies add package-lock.json to github [`d37cc9b`](https://github.com/coreui/coreui-react/commit/d37cc9bb61aa726b21bc645050bf78bf4bebb6fb) -- CoreUI v3.0.0-alpha.0 for React - initial commit [`9113dbd`](https://github.com/coreui/coreui-react/commit/9113dbd668d66556ddbf2c2154763fab388832e9) -- chore: 3.0.0-beta.3 release - update dependencies and clean docs [`7a71431`](https://github.com/coreui/coreui-react/commit/7a7143183efe0846fdaad5a49750f2fd5ac31968) -- chore: 3.0.0-beta.4 release [`f8c1a8b`](https://github.com/coreui/coreui-react/commit/f8c1a8b712316882855b5411847b2886bc551fab) -- chore: 3.0.0-beta.1 release [`99dd67f`](https://github.com/coreui/coreui-react/commit/99dd67f60ef5d46b150bb20bb4940f9c9ec9557a) -- chore: delete legacy components [`ab3aa58`](https://github.com/coreui/coreui-react/commit/ab3aa58f3cccf2a62f6035bb0fdc6b0fda8f1b40) -- feat: add typings [`54dc1c6`](https://github.com/coreui/coreui-react/commit/54dc1c6dc2f868b00e694f16c0a4245cc5bccf49) -- fix: CDataTable: many fixes and API changes [`a6085ce`](https://github.com/coreui/coreui-react/commit/a6085cef91fb9989a883e2771e35ace582e3f269) -- - update: merge with new tooltip/popover (based on tipy.js) [`11a09d1`](https://github.com/coreui/coreui-react/commit/11a09d1da26fb196fae3722b153af2be4717ed15) -- refactor: remove cssModules functionality [`df8c4c0`](https://github.com/coreui/coreui-react/commit/df8c4c0592de7a57f1c5f6844266eeaf378be1de) -- update: popper update try, error with ver. 2.1: [`ef92bac`](https://github.com/coreui/coreui-react/commit/ef92bac50a4fbf35319740b9eac9d69f539726f8) -- fix: CCarousel: rewrite components [`4e8ac70`](https://github.com/coreui/coreui-react/commit/4e8ac7086f266fb86ae9aff89a75f9401bef91d1) -- fix: form components refactor: [`a3b3ccc`](https://github.com/coreui/coreui-react/commit/a3b3ccc7e9ebd0f612bf57f9b834a82d56448ff7) -- refactor: extract CIcons, CCharts, minor changes [`a4c5e8c`](https://github.com/coreui/coreui-react/commit/a4c5e8c1a0865b9f5328818ace0a194f61515dda) -- chore: 3.0.0-beta.2 release [`f6160fc`](https://github.com/coreui/coreui-react/commit/f6160fcb82dd645e7e8b557987473dd923357dda) -- fix: Sidebar components rewrite: make them similar to Vue version [`8706cf0`](https://github.com/coreui/coreui-react/commit/8706cf077ccf6ac89fb0010d538c3babcd18607d) -- fix: leave one state of CCarousel definition [`db633c8`](https://github.com/coreui/coreui-react/commit/db633c8cbaa988ef1fa120e16a26fb957be0c6ea) -- fix: CModal component rewrite - simplify component [`55ceeef`](https://github.com/coreui/coreui-react/commit/55ceeef186fbe3f487d750e0e347728aa717e330) -- refactor: change project folder architecture [`dcb2fd8`](https://github.com/coreui/coreui-react/commit/dcb2fd88be9593b89930570753d5dc0faba73114) -- chore: cleanup [`4bbe3d3`](https://github.com/coreui/coreui-react/commit/4bbe3d3ac426902dc345e63c629a30470953c0c6) -- fix: CDropdown: component rewrite: [`14c2675`](https://github.com/coreui/coreui-react/commit/14c26757d0abf34675a5d1125cd8109c83f98888) -- fix: components cleanup [`f25cf59`](https://github.com/coreui/coreui-react/commit/f25cf590c24452e620b2e51c94164ea92c0fa1f6) -- fix: refactor CToast components: [`4741e67`](https://github.com/coreui/coreui-react/commit/4741e6707afd8f86d15e83f80f76e440b61898d6) -- fix: Breadcrumb components rewrite [`6d0e7fa`](https://github.com/coreui/coreui-react/commit/6d0e7fa293392f80dfb8a600f5f6f75d37d35e0b) -- fix: delete unneeded components [`99586ab`](https://github.com/coreui/coreui-react/commit/99586ab3e5fb409105ac6d4570605583ca53362d) -- fix: rewrite Brand components - make Brands simple wrappers [`ce4fdeb`](https://github.com/coreui/coreui-react/commit/ce4fdeb2ebbf90d9b36c16535800367927769c44) -- fix: CPagination: component rewrite according to Vue functionality [`097d359`](https://github.com/coreui/coreui-react/commit/097d359c4fd72480d211b83fc5188a82ca62133c) -- fix: merge CCollapse components, delete 'custom' and 'toggle' props [`63ba549`](https://github.com/coreui/coreui-react/commit/63ba54920d972ddd778216409f4134d3dd9fdcf0) -- - update: warnings removed [`aa50395`](https://github.com/coreui/coreui-react/commit/aa503958be9a290379f1561a042e1ece7c22062d) -- chore: delete dead code [`f6d2210`](https://github.com/coreui/coreui-react/commit/f6d2210586593a935c27f37daf36d442ae3b4d1c) -- docs: changelog cleanup [`c6c3b39`](https://github.com/coreui/coreui-react/commit/c6c3b39a6795169119c24e27ce1ef7216a04089d) -- fix: fix typings [`4631662`](https://github.com/coreui/coreui-react/commit/4631662660531fa847ec8211779027f215081a4a) -- fix: components cleanup [`7108882`](https://github.com/coreui/coreui-react/commit/71088829915be675fc66ea99345f47a44bfdb899) -- fix: CProgress: rewrite component similar to Vue version [`0781c4a`](https://github.com/coreui/coreui-react/commit/0781c4a939c4bf1a18ae17dd556022eb92e132dd) -- feat: improve Tab activation mechanism, fix bugs [`625c04b`](https://github.com/coreui/coreui-react/commit/625c04b256fccfa9428271b26bad4c57f2487c88) -- fix: CSidebar wrapper components fixes [`d17c8ff`](https://github.com/coreui/coreui-react/commit/d17c8ff8c55b8d367b55cbdd99fd4fa408dcb86c) -- refactor: clean components with fade functionality [`e23dd3f`](https://github.com/coreui/coreui-react/commit/e23dd3fc8b785ec7730ae072d21170a25af4bd4e) -- - fix: CSidebar - merge with Krzysiek [`a47bca1`](https://github.com/coreui/coreui-react/commit/a47bca1ec0a4fad34342229a2a44fbd0fb0b1cce) -- fix: CSwitch component fixes: [`4f7e74b`](https://github.com/coreui/coreui-react/commit/4f7e74b84ce2d5a37081ee3c8b1e6d15dda34669) -- - fix: CDropdownMenu: component rewrite [`9ce0f00`](https://github.com/coreui/coreui-react/commit/9ce0f00d8a0c054f557a46dbaede4ab409dbe956) -- fix: CDropdownToggle: component rewrite [`137965e`](https://github.com/coreui/coreui-react/commit/137965ed782b04e51d28e0803e98d96e78efacdf) -- chore: CListGroupItemHeading, CListGroupItemText - clean components [`118fa2a`](https://github.com/coreui/coreui-react/commit/118fa2a1f7e2e8926c2635bcbd27bcedb4a41925) -- fix: CEmbed refactor: [`ee82fa0`](https://github.com/coreui/coreui-react/commit/ee82fa0d63539eafa813876cf65d12e4a8a54bfe) -- fix: CDropdownItem, CDropdownHeader, CDropdownDivider: [`d0d000e`](https://github.com/coreui/coreui-react/commit/d0d000ec5ee88416365ec094f288afa86365fddc) -- fix: CMedia: reduce components to basic functionality [`d175ad5`](https://github.com/coreui/coreui-react/commit/d175ad590d84dfc627efbeb5270145357e148871) -- fix: CCardBody, CCardHeader, CCardFooter: add misiing props [`4171551`](https://github.com/coreui/coreui-react/commit/41715510539bd596e5550c4335f7ed54c1d1f98b) -- refactor: CCard: Reduce column, deck, group components to CCardGroup [`707b3f8`](https://github.com/coreui/coreui-react/commit/707b3f84c4909320ab19ad606b88778ce5f548c7) -- fix: turn CHeader sub-components to simple wrappers without props [`ddf287e`](https://github.com/coreui/coreui-react/commit/ddf287e3d86e7b34cdad5795dc8a15b4c4363858) -- - update: custom is true by default [`4827eb9`](https://github.com/coreui/coreui-react/commit/4827eb9a5ea5d947fde443e8c6b9d8afdf85b43d) -- fix: peerDependencies [`bd0903a`](https://github.com/coreui/coreui-react/commit/bd0903aa1e3939bda2863b015e140841b653a3b9) -- - update: react-popper v 2.1 added [`d043f6c`](https://github.com/coreui/coreui-react/commit/d043f6c7f0fc6fc5175cce4e1e33d558730cbca0) -- feat: add CElementCover component [`9a254db`](https://github.com/coreui/coreui-react/commit/9a254db32c82ec664db18394cdb10b0aa4a6573f) -- chore: delete CCustomInput component [`54f6aef`](https://github.com/coreui/coreui-react/commit/54f6aefe653842ffabbf099b7015a48ef5b78ec6) -- fix: CWidgetBrand: fix wrong texts diplay, clean the component [`3431017`](https://github.com/coreui/coreui-react/commit/343101714259843a8be8219f33b4bfed80c9ef45) -- fix: CLink: component refactor [`61859ed`](https://github.com/coreui/coreui-react/commit/61859ed4a72b3989d2cf64b8d6760fea6a426d94) -- fix: CWidgetIcon: component API fix [`ea43b6b`](https://github.com/coreui/coreui-react/commit/ea43b6ba002b90e4ab171f8d1508ef59baf3e375) -- feat: added internal CScrollbar component allowing menu animation [`50f8661`](https://github.com/coreui/coreui-react/commit/50f8661c1698302e70c55b96d541e83427287c32) -- fix: CButton: component refactor [`5770132`](https://github.com/coreui/coreui-react/commit/5770132be29a73f25b7fe36b9a0ae7ac920aceb6) -- chore: change Shared folder name to utils [`7cd4900`](https://github.com/coreui/coreui-react/commit/7cd4900406a1cbbff0d7590147064cb84e9ed0b2) -- chore: delete obsolete CPopoverBody and CPopoverHeader components [`775f0fa`](https://github.com/coreui/coreui-react/commit/775f0fa97ea36e992dafd45a11592decd8b154a7) -- fix: CListGroup, CListGroupItem fixes: [`950fab5`](https://github.com/coreui/coreui-react/commit/950fab53f15d1dbf9af4e2d4c793964ca733cf83) -- fix: rename CHeaderSubheader to CSubheader, clean component [`302dd82`](https://github.com/coreui/coreui-react/commit/302dd82dcda686a2bdba7ae5b546ded6c15f5983) -- fix: CWidgetSimple: component API fix [`abfb1d1`](https://github.com/coreui/coreui-react/commit/abfb1d1d023889bcc9685f95df0dd3c6fdadeee2) -- fix: CWidgetProgressIcon: component API fix [`2b17cd7`](https://github.com/coreui/coreui-react/commit/2b17cd7b5d6ea4bf49e7efa1dba8c6fea98fb2bc) -- fix: remove possibility of inheriting advanced transition options [`97ea903`](https://github.com/coreui/coreui-react/commit/97ea903a309b6acc8e82a6b6d56a86cc3802490e) -- fix: CWidgetProgress: component API fix [`a80ec4a`](https://github.com/coreui/coreui-react/commit/a80ec4a0d87bc2ac0b21943ff3107f4d7d6d8680) -- fix: CCollapse: fix component [`1aa4b69`](https://github.com/coreui/coreui-react/commit/1aa4b69e900c60f6eb00f6384a92e6735cf08f6f) -- chore: CPortal: disable using component until it is well tested [`98ad19d`](https://github.com/coreui/coreui-react/commit/98ad19d3f393a2d651dbd8516a7148c6610f362c) -- fix: CCard: delete 'custom' and corelating props [`e0f9c06`](https://github.com/coreui/coreui-react/commit/e0f9c0687f4f85d0ada02ffbf09c4b5bb0fea292) -- fix: CSidebarMinimizer: component refactor [`b933237`](https://github.com/coreui/coreui-react/commit/b9332372f8ab0e1dbb681f887e4c0dc4a7fe0e8e) -- fix: CTable: simplify to simple wrapper [`549d954`](https://github.com/coreui/coreui-react/commit/549d954db092496b45fb8d4605485153143dce98) -- fix: CModalHeader: simplify component: [`145fb7a`](https://github.com/coreui/coreui-react/commit/145fb7a8e7abb769ab28ad636ac367fd7a3308e9) -- - fix: CDataTable component - now with Vue Scoped Slots prop equivalent [`abd9ff1`](https://github.com/coreui/coreui-react/commit/abd9ff104f215350045b69479f7b68d9d241330e) -- fix: CWidgetDropdown: fix bugs: [`0aa4c8b`](https://github.com/coreui/coreui-react/commit/0aa4c8ba5f5bd746e9b52357bb55ba5ce66f1795) -- fix: fix modal animation mechanism [`3165af9`](https://github.com/coreui/coreui-react/commit/3165af9228ffe4a50d6a34401530362be5a58c64) -- fix: CToggler: delete 'custom' and 'type' props, clear component [`de0e368`](https://github.com/coreui/coreui-react/commit/de0e368cbe56cdcc539e93d579f99584831188dd) -- - update: innerRef value set [`6a01afc`](https://github.com/coreui/coreui-react/commit/6a01afc05488573c8ab2100f0d8ed10790be688e) -- fix: CSpinner: component refactor [`5066958`](https://github.com/coreui/coreui-react/commit/50669580ea8af68ed059790ba16bce00c1961783) -- refactor: CTooltip: limit main props to essential [`3d36c5c`](https://github.com/coreui/coreui-react/commit/3d36c5cfeca9eb8a61027261aa8eb516b96b40ac) -- fix: CNavItem: delete custom prop and correlated functionalities [`540e8c2`](https://github.com/coreui/coreui-react/commit/540e8c204c0c67139f3f54d8bd75048fc462dd5f) -- - fix: CDataTable sorting [`80d6e20`](https://github.com/coreui/coreui-react/commit/80d6e20e333285d8945109bc041fafc126e8b176) -- fix: CCardImg: Inherit CImg functionalities, change placemnt to variant [`fe1800e`](https://github.com/coreui/coreui-react/commit/fe1800e0850301cb01237487a8f4fbfbbccf0769) -- chore: CImg: clean component [`032fc29`](https://github.com/coreui/coreui-react/commit/032fc29aaf1db4393a5c8dd3a34a967e86d5006a) -- docs: README update [`18b1384`](https://github.com/coreui/coreui-react/commit/18b13848194550bd717eb5836f91ddd40829e7be) -- fix: fix memory leaks in components using timeouts [`129bb59`](https://github.com/coreui/coreui-react/commit/129bb59afb52e9425dd19a77b0d00181534e6af4) -- refactor: CNavLink: concise component [`a4634fb`](https://github.com/coreui/coreui-react/commit/a4634fbac11df253fe7af8c7a437592834057f72) -- fix: CNav: delete 'horizontal' prop, clear component [`f5f4dd1`](https://github.com/coreui/coreui-react/commit/f5f4dd16bb86b3c35f5cd22b8a62afd465b0c7a5) -- refactor: CCardLink: optimize definition [`8c65f88`](https://github.com/coreui/coreui-react/commit/8c65f882b54516b0441b99d160cc433f31618053) -- fix: CButtonClose: component refactor [`a24f91c`](https://github.com/coreui/coreui-react/commit/a24f91c8ab021b6e1514f57cbf29e0c8d45ded77) -- feat: add CModalTitle component [`c1c3033`](https://github.com/coreui/coreui-react/commit/c1c303319b2a47c60ddeef4a36824e5ff58360d2) -- fix: CBadge: allow inheriting CLink functionality, smaller fixes [`35c3df6`](https://github.com/coreui/coreui-react/commit/35c3df6537b22425b48272a6cb1d23c13684ae5e) -- fix: CNavbar: change sticky prop to bool, small fixes, clean code [`c6fbff2`](https://github.com/coreui/coreui-react/commit/c6fbff22474ad8a6336b13a131e5cd8c4f83b8cf) -- fix: missing helper exports, minor fixes [`fb4d8e3`](https://github.com/coreui/coreui-react/commit/fb4d8e3c868a386fa34e04e83880facac31eb5e7) -- fix: CButtonToolbar: component refactor: [`3bda5f7`](https://github.com/coreui/coreui-react/commit/3bda5f73ca43a1152fbce051243961eb6ad7a7b3) -- fix: CButtonGroup: delete 'tag', add default role attribute [`688eb3b`](https://github.com/coreui/coreui-react/commit/688eb3b7041535402658ddd2e63c24455f6f8c4e) -- fix: CLink: add 'disabled' prop: [`20db7d8`](https://github.com/coreui/coreui-react/commit/20db7d86c85e2f439aa6b61bd8bcdd8e10e3b318) -- feat: add CSelect component [`57468e7`](https://github.com/coreui/coreui-react/commit/57468e74b12c98ce1ed6f1d60ec8e818f683efe4) -- fix: move fade functionality from CTabs to CTabContent [`4f96e17`](https://github.com/coreui/coreui-react/commit/4f96e174bf8eb5706ec52fbdb20ad7fa5d7d8c7f) -- fix: CInput rename elementSize/size to size/sizeHtml [`95e3f29`](https://github.com/coreui/coreui-react/commit/95e3f294394035957717e6967485f93654982e96) -- feat: CCreateElement: add posibility of pasing component tag as string [`e294b4b`](https://github.com/coreui/coreui-react/commit/e294b4b6df619e75496676a41d3aeceb91e2cf42) -- fix: CTabs: add fade prop inherited by CTabPane component [`33b78e7`](https://github.com/coreui/coreui-react/commit/33b78e7b8f2c1fa071bb40cb8b444cbef8a0b0bb) -- fix: CCallout: delete tag prop, clean generating class [`5bacd2b`](https://github.com/coreui/coreui-react/commit/5bacd2b71c400f7c9af7d158ce77fbade1694d57) -- fix: CFooter: set fixed to false by default, clean component [`8e4e30c`](https://github.com/coreui/coreui-react/commit/8e4e30cd03604b6856d279cb6b9ed5ea184c22b3) -- fix: CSidebarNavDropdown: fix default closing mechanism [`c824fa7`](https://github.com/coreui/coreui-react/commit/c824fa799225494b811d85e833c379df2f7c9930) -- fix: React.Fragment backward compatible [`9ee4493`](https://github.com/coreui/coreui-react/commit/9ee44938dfee86de9691d046897be15867b0ff54) -- refactor: minor refactors [`fc2af86`](https://github.com/coreui/coreui-react/commit/fc2af866478b486379eafa4ec4c7b982af6ae94c) -- chore: clean code (linter warnings) [`79f2325`](https://github.com/coreui/coreui-react/commit/79f2325c14c91b4f3592d868336825fe555eb649) -- refactor: delete checked and onCheckedChange props [`be2f00b`](https://github.com/coreui/coreui-react/commit/be2f00b8ae5be74d5f9baf552e2fd6d3a5e59a72) -- refactor: CAlert: delete transition prop [`96e98fe`](https://github.com/coreui/coreui-react/commit/96e98fe28e6c21153d831a45e6494fb6949e6be1) -- refactor: change trigger props names to on{...}Change [`8f910c1`](https://github.com/coreui/coreui-react/commit/8f910c16554d7f805569543e24130e51c84b89c3) -- feat: add CCreateElement component [`0cee7b0`](https://github.com/coreui/coreui-react/commit/0cee7b0b4d3e306813bd86bed4e1399eb50fa25c) -- fix: CNavbarText: change default tag to 'div', clean component [`9977be0`](https://github.com/coreui/coreui-react/commit/9977be0c00ed546ac20e4a01f752981e3d3d9728) -- feat: CLink: add default rel attribute when target="_blank" [`79dad26`](https://github.com/coreui/coreui-react/commit/79dad26e4b8940304be904bc94c1cb66e58348f2) -- chore: clean components [`ef444f0`](https://github.com/coreui/coreui-react/commit/ef444f0166b395fe33217cc95eced48b5a28cb6b) -- fix: CNavBarNav: delete wrong class 'nav', clean component [`9962cdd`](https://github.com/coreui/coreui-react/commit/9962cdd6547e9ab12338bc721c7e2adec4bf7b39) -- fix: CSidebar, CSidebarNavDropdown: add default dropdown mode [`f677f5a`](https://github.com/coreui/coreui-react/commit/f677f5ae34026fb11696a90bb32900364b21d168) -- fix: update CIcon imports [`16647ba`](https://github.com/coreui/coreui-react/commit/16647ba650c73a17e68423f9d07e69f157ff6e98) -- - update: ... [`2132022`](https://github.com/coreui/coreui-react/commit/2132022438b18b31cdb844439a0c54d577925d0e) -- fix: CImg: delete 'active' and 'alt' props, smaller refactors [`78255d4`](https://github.com/coreui/coreui-react/commit/78255d4e7b4e50c2a37d3298ddeffe26b6cd25e6) -- Ship: 3.0.0-alpha.10 [`f77a972`](https://github.com/coreui/coreui-react/commit/f77a972af3b9cac1a5e19fb3056a660fba7c8c74) -- fix: minor cleanup [`4cd82cb`](https://github.com/coreui/coreui-react/commit/4cd82cb6a0474718909521675783ae8a0dc7c159) -- fix: CBreadcrumbRouter: generate path only if routes are passed [`79875db`](https://github.com/coreui/coreui-react/commit/79875dbd9595e36250255288d372d624031e0ad3) -- fix: demo cleanup [`7bd82c8`](https://github.com/coreui/coreui-react/commit/7bd82c8587f96d1ca81a69835311dda7885e06db) -- fix: CToast: correct behavior when fade is set to false [`1c73ce4`](https://github.com/coreui/coreui-react/commit/1c73ce48d2fadc8c851d7f32e3cab33532dc603d) -- Ship: 3.0.0-alpha.12 [`c440f29`](https://github.com/coreui/coreui-react/commit/c440f29454aff171b7eef40c7c52d893da96e717) -- chore: dependencies update [`09511b1`](https://github.com/coreui/coreui-react/commit/09511b156a83e2e60bed4de4d7e67825031cbe9b) -- chore: 3.0.0-rc.1 release [`6b7819e`](https://github.com/coreui/coreui-react/commit/6b7819e4ec69f91ed24bef2dfdd56ab71d58f2a3) -- - fix: default values for custom=true by default components set [`1c0a95e`](https://github.com/coreui/coreui-react/commit/1c0a95e2eeb4b28f9b681522d579c6d63dd5e67c) -- - fix: CSlot render now null instead of '' (in some cases generate warnings) [`f00913e`](https://github.com/coreui/coreui-react/commit/f00913e6da18eb412a57c5a1be3621515996438d) -- chore: change CIcon imports to CIconRaw imports [`0a18a61`](https://github.com/coreui/coreui-react/commit/0a18a61e9949b7e72e5749d9d0d0d22f6fab655c) -- fix: CDataTable restore loading functionality: [`b8f2aaa`](https://github.com/coreui/coreui-react/commit/b8f2aaa3ba91e4c0e1c10cce633b097788e9c4fa) -- refactor: CAlert: add CButtonClose component instead off html button [`91e7254`](https://github.com/coreui/coreui-react/commit/91e725437a42001ebda51addfdc570c2924f3599) -- fix: Attempted import error: '@coreui/icons-react' does not contain a default export (imported as 'CIcon') [`f107c35`](https://github.com/coreui/coreui-react/commit/f107c3506cbc31e1fad031d6d3c414e8a90b568f) -- fix: CDataTable: make recalculation mechanism 100% safe [`a6bc1df`](https://github.com/coreui/coreui-react/commit/a6bc1df75f1018e869150c59eb1106cd52178d94) -- Ship: 3.0.0-alpha.1 [`c17a4be`](https://github.com/coreui/coreui-react/commit/c17a4be596669e351d2f501bd5abf84b642bdfb0) -- chore: dependencies update and module fix [`86c4295`](https://github.com/coreui/coreui-react/commit/86c429579caeba2dbd3c9174d5fc260050e20551) -- chore: 3.0.0-beta.6 release [`ef24ff2`](https://github.com/coreui/coreui-react/commit/ef24ff2e7840497852ef52c0532d18e490fcc254) -- fix: CDataTable: fix bugs, protect against non-array 'items' prop [`c081868`](https://github.com/coreui/coreui-react/commit/c0818681f8766077f7fa6f445125d3856c258f1f) -- fix: fix passing refs to components [`2752af4`](https://github.com/coreui/coreui-react/commit/2752af44a5cc56749fc60c686576e2aa4c8ee1e1) -- fix: small fixes [`a00cc4f`](https://github.com/coreui/coreui-react/commit/a00cc4f7f3c597dfa3ad7a90ef34006c3b014967) -- fix(CSwitch): A component is changing an uncontrolled input of type checkbox to be controlled [`955370e`](https://github.com/coreui/coreui-react/commit/955370e600fd19ec25bdffaea4ca37be9ad981a2) -- - fix: link to Icon changed from dir to @ [`466c8f5`](https://github.com/coreui/coreui-react/commit/466c8f56439d082fdfe1a762b8e9d3d89d59d6f7) -- refactor: replace CFormFeedback with CValidFeedback and CInvalidFeedback [`1e9f0b1`](https://github.com/coreui/coreui-react/commit/1e9f0b161fb985f4d52f1ba81819fad2c13d5c8a) -- - link to navlink [`294d642`](https://github.com/coreui/coreui-react/commit/294d642a6aaa8a5b7af09c1ccfce775c6fa4c09c) -- refactor: CBadge: clean component [`b33d2a3`](https://github.com/coreui/coreui-react/commit/b33d2a35f887c437ea9622868a8535fa380e1b35) -- fix: CCreateElement: fix passing children [`51ad5f4`](https://github.com/coreui/coreui-react/commit/51ad5f41824f392710d523377271cfdedf0f8c0d) -- chore: dependencies update [`b22e1ae`](https://github.com/coreui/coreui-react/commit/b22e1ae40cd54d758b893c400d2792de11157fc2) -- fix: CSidebarNavItem: add innerRef prop [`dde7f1c`](https://github.com/coreui/coreui-react/commit/dde7f1c5b319edc554cdd3602e7603987295c818) -- - fix: CCard default custom value set to true [`5c86a3a`](https://github.com/coreui/coreui-react/commit/5c86a3afca48ac606ed8abcd9615aa48c759dc21) -- update: unused vars removed from CToastHeader [`2209f71`](https://github.com/coreui/coreui-react/commit/2209f71d2d9d139bf04e37201ce15aba8d5a7580) -- chore: 3.0.0-beta.7 release [`5c3b022`](https://github.com/coreui/coreui-react/commit/5c3b022b92122504f9d77025606500430862299d) -- fix: CSidebarNavDropdown: place useLocation hook in try/catch block [`2365228`](https://github.com/coreui/coreui-react/commit/236522882f5a60c189c4f380fa7ac2a12627412a) -- fix: CSidebar: emit onShowChange only on close [`6be35c6`](https://github.com/coreui/coreui-react/commit/6be35c6918ef5465510fed0132b757c122224e2a) -- fix: CSidebar: fix updating sidebar state [`7217997`](https://github.com/coreui/coreui-react/commit/7217997d3b67a669e054b149a76ebccda2d7c3b0) -- chore: dependencies update [`0dec2d4`](https://github.com/coreui/coreui-react/commit/0dec2d48294d39795db98c1ef2c6af020e0f48d9) -- fix: CMediaBody, CMediaFooter: minor fixes [`08b7460`](https://github.com/coreui/coreui-react/commit/08b74606fb6bf7eac834ca096e920f024979a2a3) -- chore: dependencies update and cleanup [`ea1736d`](https://github.com/coreui/coreui-react/commit/ea1736d554933ad67ceab6628a8d2127cf99567a) -- fix: CScrollbar: fix rtl mode [`fa66112`](https://github.com/coreui/coreui-react/commit/fa66112b0d81e0c9610f1e2d846970cc8b4f45e3) -- Ship: 3.0.0-alpha.11 [`278d97b`](https://github.com/coreui/coreui-react/commit/278d97bd8f607fc191578a109abeb7b517d58f2c) -- fix: restore footer slot to CWidgetIcon component [`5b18abd`](https://github.com/coreui/coreui-react/commit/5b18abd657639e7d29149d2475596f2021caaeb9) -- fix: CBreadcrumb: fix cssModules [`eb1623f`](https://github.com/coreui/coreui-react/commit/eb1623f6a16c15c60277bdca5a211a1c5d08a77d) -- chore: 3.0.0-rc.2 version release [`c30698c`](https://github.com/coreui/coreui-react/commit/c30698cfaed8282d045b2ee4d9dd51b72ea3b5fc) -- fix: CSidebarNavDropdown: fix default mode for nested dropdowns [`c5922ca`](https://github.com/coreui/coreui-react/commit/c5922ca941b7393a02ff31770ea0d9b2ba42fceb) -- chore: dependencies update [`080e634`](https://github.com/coreui/coreui-react/commit/080e6341afb00bae2e20d4db38cd0d5fd6d0f8d3) -- refactor(CSidebarNavDroprdown): add console.warn on undefined pathname [`b127ecf`](https://github.com/coreui/coreui-react/commit/b127ecffb1d993b334e79e4cff57784522a2d081) -- chore: 3.0.0-beta.5 release [`bcec1de`](https://github.com/coreui/coreui-react/commit/bcec1deb5dce3d5070a87e769c10cfeae8b0fd90) -- fix: isObject typo [`97bf646`](https://github.com/coreui/coreui-react/commit/97bf64695d18dda40b3c5c4ed0d1ce16ccde733f) -- fix: CSpinner: fix aria attributes [`7dd7aae`](https://github.com/coreui/coreui-react/commit/7dd7aaece47be51fa9c9d7cdd7759efc2a9ddd00) -- fix: CPagination: add disabled prop to inactive links [`af9a1c2`](https://github.com/coreui/coreui-react/commit/af9a1c25ffa93173529686421f1e2c622a960a3e) -- fix: CTabPane: fix tab assignment [`3d9f041`](https://github.com/coreui/coreui-react/commit/3d9f0415128ea8890ec97bddde109377fb1a6f3d) -- fix: CDropdown: add specific arrow class [`9c937b5`](https://github.com/coreui/coreui-react/commit/9c937b51885a94e8f29d845bec850320b416b0b5) -- Ship: 3.0.0-alpha.7 [`88f054c`](https://github.com/coreui/coreui-react/commit/88f054c84fcb23abffffe32909c5a33fda6c5e56) -- fix: CBreadcrumbRouter: add key to items [`bd0fbd4`](https://github.com/coreui/coreui-react/commit/bd0fbd4d60261e1fa5a9483d68c5839355d5adc4) -- chore: add CSelect component to exports [`4c25748`](https://github.com/coreui/coreui-react/commit/4c2574800e0c88a19cc00aaec693aa4d334f90b6) -- - fix: custom by default true for CNavItem [`29e24cf`](https://github.com/coreui/coreui-react/commit/29e24cf5b7288fde16fd8e6a93713b748f09b042) -- fix: CDropdown: delete development console.log [`e64c1ef`](https://github.com/coreui/coreui-react/commit/e64c1ef025396cec530283ea431c13827754e0c9) -- fix: CDropdown: add missing 'show' and 'dropdown' classes [`71e9122`](https://github.com/coreui/coreui-react/commit/71e91225854acdf35d56aaae3c95e413cd8c2a6c) -- refactor: cleanup [`d88bcb3`](https://github.com/coreui/coreui-react/commit/d88bcb339f0e5564fb5439dd3c2d66eeb8fb1eec) -- fix: fix modules in package.json [`c7ad9a5`](https://github.com/coreui/coreui-react/commit/c7ad9a546f1fb8797838842a828b2b8fd891ecfe) -- fix: CLink: stop passing false to rel attribute [`7b7d9c6`](https://github.com/coreui/coreui-react/commit/7b7d9c6022acfa8c8505d55044b851ab2575f0c8) -- fix: CProgressBar: fix striped state [`f1817f5`](https://github.com/coreui/coreui-react/commit/f1817f5d606fc1fdaf618b9974d700606be40a1e) -- fix: CTabPane: fix error occuring when context is not passed [`ee952af`](https://github.com/coreui/coreui-react/commit/ee952af324f343bd923b90fb3f21e46d1841fdad) -- fix: CDropdownToggle: allow caret in link toggle [`c7f6eba`](https://github.com/coreui/coreui-react/commit/c7f6ebabc82b9c542e78d75f376755ed19651df7) -- Ship: 3.0.0-alpha.9 [`6d9a3f3`](https://github.com/coreui/coreui-react/commit/6d9a3f31abc2d4383711ee5caee796f4219944ee) -- Ship: 3.0.0-alpha.8 [`c408665`](https://github.com/coreui/coreui-react/commit/c408665ba4c787872526de1f961708169232112e) -- fix: change default 'fixed' value to true [`7c824c4`](https://github.com/coreui/coreui-react/commit/7c824c45e762eac6987688d50b2eb28514358ef6) -- chore: enable library rapid development and installing from gh [`543dffd`](https://github.com/coreui/coreui-react/commit/543dffda4d492df82b42f6433b0734fb50ab5978) -- Ship: 3.0.0-alpha.6 [`a64f06e`](https://github.com/coreui/coreui-react/commit/a64f06ec42e7f4dda9d9ccb21fba85f1cf57065b) -- fix: es module [`5790081`](https://github.com/coreui/coreui-react/commit/5790081227b21ab79b85343a9eec1d6e2df7a4a3) -- chore: import from source instead of module [`d09a4b8`](https://github.com/coreui/coreui-react/commit/d09a4b86ea7b595d3f28f3632b2145c69530ac26) -- fix: CProgress: fix 'height' propType [`511c2a2`](https://github.com/coreui/coreui-react/commit/511c2a2fb351d9dea7afee34f1de93e26157c6bb) -- - fix: CNavbar classes [`3e9994a`](https://github.com/coreui/coreui-react/commit/3e9994a4f2b214b7fd94b36770318717fea20c4d) -- fix(CSidebarNavItem): Invalid argument supplied to to oneOfType [`d7f38e1`](https://github.com/coreui/coreui-react/commit/d7f38e1b81fc9617430a2cc38b7941e3997a5bf7) -- - console.log removed [`5a0b08a`](https://github.com/coreui/coreui-react/commit/5a0b08a511e97012fd429bf0a8f1ac27e0448106) -- fix: CSidebarNav: remove obsolete styles [`dbe7dc4`](https://github.com/coreui/coreui-react/commit/dbe7dc464941c5ff1b6e05c63d44dfc5a0ad12dc) diff --git a/LICENSE b/LICENSE index c3f8e99e..027b8813 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 creativeLabs Łukasz Holeczek +Copyright (c) 2023 creativeLabs Łukasz Holeczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 5eb2fdcb..e7c25be4 100644 --- a/README.md +++ b/README.md @@ -8,35 +8,36 @@

-

CoreUI

+

CoreUI for React.js

React.js Components Library built on top of Bootstrap 5 and TypeScript.
- Explore CoreUI docs » + Explore CoreUI for React.js docs »

Report bug · Request feature · - Community - · - Blog + Blog

## Table of contents - [Quick start](#quick-start) +- [Components](#components) - [Status](#status) -- [What's included](#whats-included) - [Bugs and feature requests](#bugs-and-feature-requests) - [Documentation](#documentation) +- [Frameworks](#frameworks) +- [Templates](#templates) - [Contributing](#contributing) - [Community](#community) - [Versioning](#versioning) - [Creators](#creators) +- [Support CoreUI Development](#support-coreui-development) - [Copyright and license](#copyright-and-license) ## Quick start @@ -45,29 +46,35 @@ Several quick start options are available: -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.0.0-alpha.0.zip) +- [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.11.1.zip) - Clone the repo: `git clone https://github.com/coreui/coreui-react.git` -- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react@next` -- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react@next` +- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react` +- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react` -Read the [Getting started page](https://coreui.io/react/docs/4.0/getting-started/introduction/) for information on the framework contents, templates and examples, and more. +Read the [Getting started page](https://coreui.io/react/docs/getting-started/introduction/) for information on the framework contents, templates and examples, and more. ### Stylesheets -React components are styled using `@coreui/coreui` CSS library, but you can use them also with bootstrap CSS library. That is possible because `@coreui/coreui` library is compatible with bootstrap, it just extends its functionalities. The only exception is custom CoreUI components, which don't exist in the Bootstrap ecosystem. +React components are styled using `@coreui/coreui` CSS library, but you can use them also with bootstrap CSS library. That is possible because `@coreui/coreui` library is compatible with bootstrap, it just extends its functionalities. The only exception are custom CoreUI components, which don't exist in the Bootstrap ecosystem. #### CoreUI CSS files ##### Installation ```bash -npm install @coreui/coreui@next +yarn add @coreui/coreui +``` + +or + +```bash +npm install @coreui/coreui --save ``` ##### Basic usage ```js -import "@coreui/dist/css/coreui.min.css"; +import '@coreui/coreui/dist/css/coreui.min.css' ``` #### Bootstrap CSS files @@ -75,7 +82,13 @@ import "@coreui/dist/css/coreui.min.css"; ##### Installation ```bash -npm install bootstrap@next +yarn add bootstrap +``` + +or + +```bash +npm install bootstrap ``` ##### Basic usage @@ -84,41 +97,103 @@ npm install bootstrap@next import "bootstrap/dist/css/bootstrap.min.css"; ``` +## Components + +- [React Accordion](https://coreui.io/react/docs/components/accordion/) +- [React Alert](https://coreui.io/react/docs/components/alert/) +- [React Avatar](https://coreui.io/react/docs/components/avatar/) +- [React Badge](https://coreui.io/react/docs/components/badge/) +- [React Breadcrumb](https://coreui.io/react/docs/components/breadcrumb/) +- [React Button](https://coreui.io/react/docs/components/button/) +- [React Button Group](https://coreui.io/react/docs/components/button-group/) +- [React Callout](https://coreui.io/react/docs/components/callout/) +- [React Card](https://coreui.io/react/docs/components/card/) +- [React Carousel](https://coreui.io/react/docs/components/carousel/) +- [React Checkbox](https://coreui.io/react/docs/forms/checkbox/) +- [React Close Button](https://coreui.io/react/docs/components/close-button/) +- [React Collapse](https://coreui.io/react/docs/components/collapse/) +- [React Date Picker](https://coreui.io/react/docs/forms/date-picker/) **PRO** +- [React Date Range Picker](https://coreui.io/react/docs/forms/date-range-picker/) **PRO** +- [React Dropdown](https://coreui.io/react/docs/components/dropdown/) +- [React Floating Labels](https://coreui.io/react/docs/forms/floating-labels/) +- [React Footer](https://coreui.io/react/docs/components/footer/) +- [React Header](https://coreui.io/react/docs/components/header/) +- [React Image](https://coreui.io/react/docs/components/image/) +- [React Input](https://coreui.io/react/docs/forms/input/) +- [React Input Group](https://coreui.io/react/docs/forms/input-group/) +- [React List Group](https://coreui.io/react/docs/components/list-group/) +- [React Loading Button](https://coreui.io/react/docs/components/loading-button/) **PRO** +- [React Modal](https://coreui.io/react/docs/components/modal/) +- [React Multi Select](https://coreui.io/react/docs/forms/multi-select/) **PRO** +- [React Navs & Tabs](https://coreui.io/react/docs/components/navs-tabs/) +- [React Navbar](https://coreui.io/react/docs/components/navbar/) +- [React Offcanvas](https://coreui.io/react/docs/components/offcanvas/) +- [React Pagination](https://coreui.io/react/docs/components/pagination/) +- [React Placeholder](https://coreui.io/react/docs/components/placeholder/) +- [React Popover](https://coreui.io/react/docs/components/popover/) +- [React Progress](https://coreui.io/react/docs/components/progress/) +- [React Radio](https://coreui.io/react/docs/forms/radio/) +- [React Range](https://coreui.io/react/docs/forms/range/) +- [React Select](https://coreui.io/react/docs/forms/select/) +- [React Sidebar](https://coreui.io/react/docs/components/sidebar/) +- [React Smart Pagination](https://coreui.io/react/docs/components/smart-pagination/) **PRO** +- [React Smart Table](https://coreui.io/react/docs/components/smart-table/) **PRO** +- [React Spinner](https://coreui.io/react/docs/components/spinner/) +- [React Switch](https://coreui.io/react/docs/forms/switch/) +- [React Table](https://coreui.io/react/docs/components/table/) +- [React Textarea](https://coreui.io/react/docs/forms/textarea/) +- [React Time Picker](https://coreui.io/react/docs/forms/time-picker/) **PRO** +- [React Toast](https://coreui.io/react/docs/components/toast/) +- [React Tooltip](https://coreui.io/react/docs/components/tooltip/) + ## Status -[![Build Status](https://github.com/coreui/coreui-react/workflows/JS%20Tests/badge.svg?branch=main)](https://github.com/coreui/coreui-react/actions?query=workflow%3AJS+Tests+branch%3Amain) [![npm version](https://img.shields.io/npm/v/@coreui/react)](https://www.npmjs.com/package/@coreui/react) -[![peerDependencies Status](https://img.shields.io/david/peer/coreui/coreui)](https://david-dm.org/coreui/coreui?type=peer) -[![devDependency Status](https://img.shields.io/david/dev/coreui/coreui)](https://david-dm.org/coreui/coreui?type=dev) -[![Coverage Status](https://img.shields.io/coveralls/github/coreui/coreui-react/v4-dev)](https://coveralls.io/github/coreui/coreui-react?branch=v4-dev) ## Bugs and feature requests -Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/coreui/coreui-react/blob/v4-dev/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/coreui/coreui-react/issues/new). +Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/coreui/coreui-react/blob/v4/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/coreui/coreui-react/issues/new). ## Documentation -The documentation for the CoreUI & CoreUI PRO is hosted at our website [CoreUI for React](https://coreui.io/react/docs/4.0/getting-started/introduction) +The documentation for the CoreUI & CoreUI PRO is hosted at our website [CoreUI for React](https://coreui.io/react/docs/getting-started/introduction) ### Running documentation locally -1. Run `yarn install` to install the Node.js dependencies, including Hugo (the site builder). -2. Run `yarn docz:build` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets. -3. From the root directory, run `yarn docz:serve` in the command line. -4. Open `http://localhost:3000/` in your browser, and voilà. +1. Run `yarn install` or `npm install` to install the Node.js dependencies. +2. Run `yarn bootstrap` or `npm run bootstrap` to link local packages together and install remaining package dependencies. +3. From the root directory, run `yarn docs:dev` or `npm run docs:dev` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets. +4. Open `http://localhost:8000/` in your browser, and voilà. + +## Frameworks + +CoreUI supports most popular frameworks. + +- [CoreUI for Angular](https://github.com/coreui/coreui-angular) +- [CoreUI for Bootstrap (Vanilla JS)](https://github.com/coreui/coreui) +- [CoreUI for React](https://github.com/coreui/coreui-react) +- [CoreUI for Vue](https://github.com/coreui/coreui-vue) + +## Templates + +Fully featured, out-of-the-box, templates for your application based on CoreUI. + +- [Angular Admin Template](https://coreui.io/angular) +- [Bootstrap Admin Template](https://coreui.io/) +- [React Admin Template](https://coreui.io/react) +- [Vue Admin Template](https://coreui.io/vue) ## Contributing -Please read through our [contributing guidelines](https://github.com/coreui/coreui-react/blob/v4-dev/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. +Please read through our [contributing guidelines](https://github.com/coreui/coreui-react/blob/v4/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. -Editor preferences are available in the [editor config](https://github.com/coreui/coreui-react/blob/v4-dev/.editorconfig) for easy use in common text editors. Read more and download plugins at . +Editor preferences are available in the [editor config](https://github.com/coreui/coreui-react/blob/v4/.editorconfig) for easy use in common text editors. Read more and download plugins at . ## Community Stay up to date on the development of CoreUI and reach out to the community with these helpful resources. - Read and subscribe to [The Official CoreUI Blog](https://coreui.io/blog/). -- Join [the official Community](https://community.coreui.io/). You can also follow [@core_ui on Twitter](https://twitter.com/core_ui). @@ -139,6 +214,48 @@ See [the Releases section of our project](https://github.com/coreui/coreui-react - +**The CoreUI Team** + +- + +## Support CoreUI Development + +CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing. You can support development by buying the [CoreUI PRO](https://coreui.io/pricing/) or by becoming a sponsor via [Open Collective](https://opencollective.com/coreui/). + + + +### Platinum Sponsors + +Support this project by [becoming a Platinum Sponsor](https://opencollective.com/coreui/contribute/platinum-sponsor-40959/). A large company logo will be added here with a link to your website. + + + +### Gold Sponsors + +Support this project by [becoming a Gold Sponsor](https://opencollective.com/coreui/contribute/gold-sponsor-40960/). A big company logo will be added here with a link to your website. + + + +### Silver Sponsors + +Support this project by [becoming a Silver Sponsor](https://opencollective.com/coreui/contribute/silver-sponsor-40967/). A medium company logo will be added here with a link to your website. + + + +### Bronze Sponsors + +Support this project by [becoming a Bronze Sponsor](https://opencollective.com/coreui/contribute/bronze-sponsor-40966/). The company avatar will show up here with a link to your OpenCollective Profile. + + + +### Backers + +Thanks to all the backers and sponsors! Support this project by [becoming a backer](https://opencollective.com/coreui/contribute/backer-40965/). + + + + + ## Copyright and license -Copyright 2021 creativeLabs Łukasz Holeczek. Code released under the [MIT License](https://github.com/coreui/coreui-react/blob/v4-dev/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/). +Copyright 2023 creativeLabs Łukasz Holeczek. Code released under the [MIT License](https://github.com/coreui/coreui-react/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/). \ No newline at end of file diff --git a/build/.eslintrc.json b/build/.eslintrc.json deleted file mode 100644 index 40605483..00000000 --- a/build/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "env": { - "browser": false, - "node": true - }, - "parserOptions": { - "sourceType": "script" - }, - "extends": "../.eslintrc.js", - "rules": { - "no-console": "off", - "strict": "error" - } -} \ No newline at end of file diff --git a/build/api.js b/build/api.js deleted file mode 100644 index 178140f5..00000000 --- a/build/api.js +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable @typescript-eslint/no-var-requires */ -'use strict' - -const docgen = require('react-docgen-typescript') -const fs = require('fs').promises -const path = require('path') -const globby = require('globby') -const pkg = require('../package.json') - -const GLOB = ['src/components/**/*.tsx'] -const GLOBBY_OPTIONS = { - cwd: path.join(__dirname, '..'), - gitignore: true, - ignore: ['**/__tests__/**'], -} -const EXCLUDED_FILES = [] - -const options = { - savePropValueAsString: true, -} - -async function createMdx(file, filename, name, props) { - if (typeof props === 'undefined') return - - let content = ` -\`\`\`jsx -import { ${name} } from '@coreui/react' -// or -import ${name} from '@coreui/react/${file.replace('.tsx', '')}' -\`\`\`\n -` - - content += `| Property | Description | Type | Default |\n` - content += `| --- | --- | --- | --- |\n` - - for (const [key, value] of Object.entries(props).sort()) { - if ( - value.parent.fileName !== 'react/node_modules/@types/react/index.d.ts' && - !value['description'].includes('@ignore') - ) { - const name = value.name || '' - const description = - value.description.replaceAll('\n', '
').replaceAll(' [docs]', '') || '-' - const type = value.type - ? value.type.name.includes('ReactElement') - ? 'ReactElement' - : value.type.name - : '' - const defaultValue = value.defaultValue - ? value.defaultValue.value.replace('undefined', '-') - : '-' - const types = [] - type.split(' | ').map((element) => { - types.push(`\`${element.replace(/"/g, "'")}\``) - }) - - // content += `| **${name}** | ${description} | \`${type - // .replace(/"/g, "'")\` | ${defaultValue} |\n` - content += `| **${name}** | ${description} | ${types.join(' \\| ')} | ${defaultValue} |\n` - console.log(`${filename} - ${key}`) - } - } - - await fs - .writeFile(`docs/${pkg.config.version_short}/api/${filename}.api.mdx`, content, { - encoding: 'utf8', - }) - .then(() => { - console.log(`File created: ${filename}.api.mdx`) - }) -} - -async function main() { - try { - const files = await globby(GLOB, GLOBBY_OPTIONS, EXCLUDED_FILES) - - await Promise.all( - files.map((file) => { - const props = docgen.parse(file, options) - if (props && typeof props[0] !== 'undefined') { - const filename = path.basename(file, '.tsx') - createMdx(file, filename, props[0].displayName, props[0].props) - } - }), - ) - } catch (error) { - console.error(error) - process.exit(1) - } -} - -main() diff --git a/docs/4.0/api/CFormInput.api.mdx b/docs/4.0/api/CFormInput.api.mdx deleted file mode 100644 index 27de8141..00000000 --- a/docs/4.0/api/CFormInput.api.mdx +++ /dev/null @@ -1,19 +0,0 @@ - -```jsx -import { CFormInput } from '@coreui/react' -// or -import CFormInput from '@coreui/react/src/components/form/CFormInput' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **className** | A string of all className you want applied to the component. | `string` | - | -| **disabled** | Toggle the disabled state for the component. | `boolean` | - | -| **invalid** | Set component validation state to invalid. | `boolean` | - | -| **onChange** | Method called immediately after the `value` prop changes. | `ChangeEventHandler` | - | -| **plainText** | Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly` | `boolean` | - | -| **readOnly** | Toggle the readonly state for the component. | `boolean` | - | -| **size** | Size the component small or large. | `'sm'` \| `'lg'` | - | -| **type** | Specifies the type of component. | `string` | text | -| **valid** | Set component validation state to valid. | `boolean` | - | -| **value** | The `value` attribute of component.
@controllable onChange | `string` \| `number` \| `string[]` | - | diff --git a/docs/4.0/api/CFormSelect.api.mdx b/docs/4.0/api/CFormSelect.api.mdx deleted file mode 100644 index 4cf8e5c0..00000000 --- a/docs/4.0/api/CFormSelect.api.mdx +++ /dev/null @@ -1,16 +0,0 @@ - -```jsx -import { CFormSelect } from '@coreui/react' -// or -import CFormSelect from '@coreui/react/src/components/form/CFormSelect' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **className** | A string of all className you want applied to the component. | `string` | - | -| **htmlSize** | Specifies the number of visible options in a drop-down list. | `number` | - | -| **invalid** | Set component validation state to invalid. | `boolean` | - | -| **onChange** | Method called immediately after the `value` prop changes. | `ChangeEventHandler` | - | -| **size** | Size the component small or large. | `'sm'` \| `'lg'` | - | -| **valid** | Set component validation state to valid. | `boolean` | - | -| **value** | The `value` attribute of component.
@controllable onChange | `string` \| `number` \| `string[]` | - | diff --git a/docs/4.0/api/CFormTextarea.api.mdx b/docs/4.0/api/CFormTextarea.api.mdx deleted file mode 100644 index e3356fb9..00000000 --- a/docs/4.0/api/CFormTextarea.api.mdx +++ /dev/null @@ -1,17 +0,0 @@ - -```jsx -import { CFormTextarea } from '@coreui/react' -// or -import CFormTextarea from '@coreui/react/src/components/form/CFormTextarea' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **className** | A string of all className you want applied to the component. | `string` | - | -| **disabled** | Toggle the disabled state for the component. | `boolean` | - | -| **invalid** | Set component validation state to invalid. | `boolean` | - | -| **onChange** | Method called immediately after the `value` prop changes. | `ChangeEventHandler` | - | -| **plainText** | Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`. | `boolean` | - | -| **readOnly** | Toggle the readonly state for the component. | `boolean` | - | -| **valid** | Set component validation state to valid. | `boolean` | - | -| **value** | The `value` attribute of component.
@controllable onChange | `string` \| `number` \| `string[]` | - | diff --git a/docs/4.0/api/CPopover.api.mdx b/docs/4.0/api/CPopover.api.mdx deleted file mode 100644 index df5aeb3e..00000000 --- a/docs/4.0/api/CPopover.api.mdx +++ /dev/null @@ -1,17 +0,0 @@ - -```jsx -import { CPopover } from '@coreui/react' -// or -import CPopover from '@coreui/react/src/components/popover/CPopover' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **content** | Content node for your component. | `ReactNode` | - | -| **offset** | Offset of the popover relative to its target. | `[number, number]` | [0, 8] | -| **onHide** | Callback fired when the component requests to be hidden. | `() => void` | - | -| **onShow** | Callback fired when the component requests to be shown. | `() => void` | - | -| **placement** | Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property. | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | top | -| **title** | Title node for your component. | `ReactNode` | - | -| **trigger** | Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them. | `'hover'` \| `'focus'` \| `'click'` | click | -| **visible** | Toggle the visibility of popover component. | `boolean` | - | diff --git a/docs/4.0/api/CPopoverContent.api.mdx b/docs/4.0/api/CPopoverContent.api.mdx deleted file mode 100644 index 95186a3f..00000000 --- a/docs/4.0/api/CPopoverContent.api.mdx +++ /dev/null @@ -1,24 +0,0 @@ - -```jsx -import { CPopoverContent } from '@coreui/react' -// or -import CPopoverContent from '@coreui/react/src/components/popover/CPopoverContent' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **arrowProps** | - | `PopperArrowProps` | - | -| **content** | Content node for your component. | `ReactNode` | - | -| **forceUpdate** | - | `() => Partial` | - | -| **hasPopperEscaped** | - | `boolean` | - | -| **isReferenceHidden** | - | `boolean` | - | -| **offset** | Offset of the popover relative to its target. | `[number, number]` | - | -| **onHide** | Callback fired when the component requests to be hidden. | `() => void` | - | -| **onShow** | Callback fired when the component requests to be shown. | `() => void` | - | -| **placement** | - | `Placement` | - | -| **placementClassNamePostfix** | - | `string` | - | -| **style** | - | `CSSProperties` | - | -| **title** | Title node for your component. | `ReactNode` | - | -| **transitionClass** | - | `string` | - | -| **update** | - | `() => Promise>` | - | -| **visible** | Toggle the visibility of popover component. | `boolean` | - | diff --git a/docs/4.0/api/CTable.api.mdx b/docs/4.0/api/CTable.api.mdx deleted file mode 100644 index b2b8e716..00000000 --- a/docs/4.0/api/CTable.api.mdx +++ /dev/null @@ -1,20 +0,0 @@ - -```jsx -import { CTable } from '@coreui/react' -// or -import CTable from '@coreui/react/src/components/table/CTable' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **align** | Set the vertical aligment. | `'bottom'` \| `'middle'` \| `'top'` | - | -| **borderColor** | Sets the border color of the component to one of CoreUI’s themed colors. | `'primary'` \| `'secondary'` \| `'success'` \| `'danger'` \| `'warning'` \| `'info'` \| `'dark'` \| `'light'` \| `string` | - | -| **bordered** | Add borders on all sides of the table and cells. | `boolean` | - | -| **borderless** | Remove borders on all sides of the table and cells. | `boolean` | - | -| **caption** | Put the `` on the top of the table. | `'top'` | - | -| **className** | A string of all className you want applied to the component. | `string` | - | -| **color** | Sets the color context of the component to one of CoreUI’s themed colors. | `'primary'` \| `'secondary'` \| `'success'` \| `'danger'` \| `'warning'` \| `'info'` \| `'dark'` \| `'light'` \| `string` | - | -| **hover** | Enable a hover state on table rows within a ``. | `boolean` | - | -| **responsive** | Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to. | `boolean` \| `'sm'` \| `'md'` \| `'lg'` \| `'xl'` \| `'xxl'` | - | -| **small** | Make table more compact by cutting all cell `padding` in half. | `boolean` | - | -| **striped** | Add zebra-striping to any table row within the ``. | `boolean` | - | diff --git a/docs/4.0/api/CToastClose.api.mdx b/docs/4.0/api/CToastClose.api.mdx deleted file mode 100644 index c1357d7a..00000000 --- a/docs/4.0/api/CToastClose.api.mdx +++ /dev/null @@ -1,13 +0,0 @@ - -```jsx -import { CToastClose } from '@coreui/react' -// or -import CToastClose from '@coreui/react/src/components/toast/CToastClose' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **className** | A string of all className you want applied to the base component. | `string` | - | -| **component** | Component used for the root node. Either a string to use a HTML element or a component. | `string` \| `ComponentClass` \| `FunctionComponent` | - | -| **disabled** | Toggle the disabled state for the component. | `boolean` | - | -| **white** | Change the default color to white. | `boolean` | - | diff --git a/docs/4.0/api/CTooltip.api.mdx b/docs/4.0/api/CTooltip.api.mdx deleted file mode 100644 index 58b8d112..00000000 --- a/docs/4.0/api/CTooltip.api.mdx +++ /dev/null @@ -1,15 +0,0 @@ - -```jsx -import { CTooltip } from '@coreui/react' -// or -import CTooltip from '@coreui/react/src/components/tooltip/CTooltip' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **content** | Content node for your component. | `ReactNode` | - | -| **onHide** | Callback fired when the component requests to be hidden. | `() => void` | - | -| **onShow** | Callback fired when the component requests to be shown. | `() => void` | - | -| **placement** | Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property. | `'top'` \| `'right'` \| `'bottom'` \| `'left'` | top | -| **trigger** | Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them. | `'hover'` \| `'focus'` \| `'click'` | hover | -| **visible** | Toggle the visibility of popover component. | `boolean` | - | diff --git a/docs/4.0/api/CTooltipContent.api.mdx b/docs/4.0/api/CTooltipContent.api.mdx deleted file mode 100644 index e9b5ef91..00000000 --- a/docs/4.0/api/CTooltipContent.api.mdx +++ /dev/null @@ -1,22 +0,0 @@ - -```jsx -import { CTooltipContent } from '@coreui/react' -// or -import CTooltipContent from '@coreui/react/src/components/tooltip/CTooltipContent' -``` - -| Property | Description | Type | Default | -| --- | --- | --- | --- | -| **arrowProps** | - | `PopperArrowProps` | - | -| **content** | Content node for your component. | `ReactNode` | - | -| **forceUpdate** | - | `() => Partial` | - | -| **hasPopperEscaped** | - | `boolean` | - | -| **isReferenceHidden** | - | `boolean` | - | -| **onHide** | Callback fired when the component requests to be hidden. | `() => void` | - | -| **onShow** | Callback fired when the component requests to be shown. | `() => void` | - | -| **placement** | - | `Placement` | - | -| **placementClassNamePostfix** | - | `string` | - | -| **style** | - | `CSSProperties` | - | -| **transitionClass** | - | `string` | - | -| **update** | - | `() => Promise>` | - | -| **visible** | Toggle the visibility of popover component. | `boolean` | - | diff --git a/docs/4.0/components/accordion.mdx b/docs/4.0/components/accordion.mdx deleted file mode 100644 index 86a1b165..00000000 --- a/docs/4.0/components/accordion.mdx +++ /dev/null @@ -1,308 +0,0 @@ ---- -title: React Accordion Component -name: Accordion -description: Build vertically collapsing accordions in combination with our React Collapse component. -menu: Components -route: /components/accordion ---- - -import { useState } from 'react' - -import { - CAccordion, - CAccordionBody, - CAccordionCollapse, - CAccordionHeader, - CAccordionItem -} from './../../../src/index.ts' - - -## Examples - -Click the accordions below to expand/collapse the accordion content. - - - - - - Accordion Item #1 - - - This is the first item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #2 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #3 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - -```jsx - - - - Accordion Item #1 - - - This is the first item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #2 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #3 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - -``` - -### Flush - -Add `flush` to remove the default `background-color`, some borders, and some rounded corners to render accordions edge-to-edge with their parent container. - - - - - - Accordion Item #1 - - - This is the first item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #2 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #3 - - - This is the third item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - -```jsx - - - - Accordion Item #1 - - - This is the first item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #2 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #3 - - - This is the third item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - -``` - -### Always open - -Add `alwaysOpen` property to make accordion items stay open when another item is opened. - - - - - - Accordion Item #1 - - - This is the first item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #2 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #3 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - -```jsx - - - - Accordion Item #1 - - - This is the first item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #2 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - - - Accordion Item #3 - - - This is the second item's accordion body. It is hidden by default, - until the collapse plugin adds the appropriate classes that we use to style each - element. These classes control the overall appearance, as well as the showing and - hiding via CSS transitions. You can modify any of this with custom CSS or overriding - our default variables. It's also worth noting that just about any HTML can go within - the .accordion-body, though the transition does limit overflow. - - - -``` - -## API - -### CAccordion -`markdown:CAccordion.api.mdx` - -### CAccordionBody -`markdown:CAccordionBody.api.mdx` - -### CAccordionHeader -`markdown:CAccordionHeader.api.mdx` - -### CAccordionItem -`markdown:CAccordionItem.api.mdx` diff --git a/docs/4.0/components/alert.mdx b/docs/4.0/components/alert.mdx deleted file mode 100644 index 98f1444d..00000000 --- a/docs/4.0/components/alert.mdx +++ /dev/null @@ -1,349 +0,0 @@ ---- -title: React Alert Component -name: Alert -description: React alert component gives contextual feedback information for common user operations. The alert component is delivered with a bunch of usable and adjustable alert messages. -menu: Components -route: /components/alert ---- - -import { useState } from 'react' -import { - CAlert, - CAlertHeading, - CAlertLink, - CButton, - CCallout, -} from './../../../src/index.ts' - -import CIcon from '@coreui/icons-react' - -import { cilBurn, cilCheckCircle, cilInfo, cilWarning } from '@coreui/icons' - -## Examples - -React Alert is prepared for any length of text, as well as an optional close button. For a styling, use one of the **required** contextual `color` props (e.g., `primary`). For inline dismissal, use the [dismissing prop](#dismissing). - - - - A simple primary alert—check it out! - - - A simple secondary alert—check it out! - - - A simple success alert—check it out! - - - A simple danger alert—check it out! - - - A simple warning alert—check it out! - - - A simple info alert—check it out! - - - A simple light alert—check it out! - - - A simple dark alert—check it out! - - - -```jsx - - A simple primary alert—check it out! - - - A simple secondary alert—check it out! - - - A simple success alert—check it out! - - - A simple danger alert—check it out! - - - A simple warning alert—check it out! - - - A simple info alert—check it out! - - - A simple light alert—check it out! - - - A simple dark alert—check it out! - -``` - - -
Conveying meaning to assistive technologies
-

- Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the `.visually-hidden` class. -

-
- -### Live example - -Click the button below to show an alert (hidden with inline styles to start), then dismiss (and destroy) it with the built-in close button. - -export const LiveExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(false)}>A simple primary alert—check it out! - setVisible(true)}>Show live alert - - ) -} - - - - - -```jsx -const [visible, setVisible] = useState(false) -return ( - <> - setVisible(false)}>A simple primary alert—check it out! - setVisible(true)}>Show live alert - -) -``` - -### Link color - -Use the `` component to immediately give matching colored links inside any alert. - - - - A simple primary alert with an example link. Give it a click if you like. - - - A simple secondary alert with an example link. Give it a click if you like. - - - A simple success alert with an example link. Give it a click if you like. - - - A simple danger alert with an example link. Give it a click if you like. - - - A simple warning alert with an example link. Give it a click if you like. - - - A simple info alert with an example link. Give it a click if you like. - - - A simple light alert with an example link. Give it a click if you like. - - - A simple dark alert with an example link. Give it a click if you like. - - - -```jsx - - A simple primary alert with an example link. Give it a click if you like. - - - A simple secondary alert with an example link. Give it a click if you like. - - - A simple success alert with an example link. Give it a click if you like. - - - A simple danger alert with an example link. Give it a click if you like. - - - A simple warning alert with an example link. Give it a click if you like. - - - A simple info alert with an example link. Give it a click if you like. - - - A simple light alert with an example link. Give it a click if you like. - - - A simple dark alert with an example link. Give it a click if you like. - -``` - -### Additional content - -Alert can also incorporate supplementary components & elements like heading, paragraph, and divider. - - - - Well done! -

Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.

-
-

Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

-
-
- -```jsx - - Well done! -

Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.

-
-

Whenever you need to, be sure to use margin utilities to keep things nice and tidy.

-
-``` - -### Icons - -Similarly, you can use [flexbox utilities](https//coreui.io/docs/4.0/utilities/flex") and [CoreUI Icons](https://icons.coreui.io) to create alerts with icons. Depending on your icons and content, you may want to add more utilities or custom styles. - - - - - - -
- An example alert with an icon -
-
-
- -```jsx - - - - -
- An example alert with an icon -
-
-``` - -Need more than one icon for your alerts? Consider using [CoreUI Icons](https://icons.coreui.io). - - - - -
- An example alert with an icon -
-
- - -
- An example success alert with an icon -
-
- - -
- An example warning alert with an icon -
-
- - -
- An example danger alert with an icon -
-
-
- -```jsx - - -
- An example alert with an icon -
-
- - -
- An example success alert with an icon -
-
- - -
- An example warning alert with an icon -
-
- - -
- An example danger alert with an icon -
-
-``` - -### Solid - -Use `variant="solid"` to change contextual colors to solid. - - - A simple solid primary alert—check it out! - A simple solid secondary alert—check it out! - A simple solid success alert—check it out! - A simple solid danger alert—check it out! - A simple solid warning alert—check it out! - A simple solid info alert—check it out! - A simple solid light alert—check it out! - A simple solid dark alert—check it out! - - -```jsx -A simple solid primary alert—check it out! -A simple solid secondary alert—check it out! -A simple solid success alert—check it out! -A simple solid danger alert—check it out! -A simple solid warning alert—check it out! -A simple solid info alert—check it out! -A simple solid light alert—check it out! -A simple solid dark alert—check it out! -``` - -### Dismissing - -Alerts can also be easily dismissed. Just add the `dismissible` prop. - - - { - alert("👋 Well, hi there! Thanks for dismissing me."); - }} - > - Go right ahead and click that dimiss over there on the right. - - - -```jsx - { - alert("👋 Well, hi there! Thanks for dismissing me."); - }} -> - Go right ahead and click that dimiss over there on the right. - -``` - - -

- When an alert is dismissed, the element is completely removed from the page structure. If a keyboard user dismisses the alert using the close button, their focus will suddenly be lost and, depending on the browser, reset to the start of the page/document. -

-
- -## API - -### CAlert - -`markdown:CAlert.api.mdx` - -### CAlertHeading - -`markdown:CAlertHeading.api.mdx` - -### CAlertLink - -`markdown:CAlertLink.api.mdx` \ No newline at end of file diff --git a/docs/4.0/components/avatar.mdx b/docs/4.0/components/avatar.mdx deleted file mode 100644 index 6bcf867c..00000000 --- a/docs/4.0/components/avatar.mdx +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: React Avatar Component -name: Avatar -description: React avatar component can be used to display circular user profile pictures. Avatar can be used to portray people or objects. It supports images, icons, or letters. - -menu: Components -route: /components/avatar ---- - -import { CAvatar } from './../../../src/index.ts' - -import Avatar1 from './../assets/images/avatars/1.jpg' -import Avatar2 from './../assets/images/avatars/2.jpg' -import Avatar3 from './../assets/images/avatars/3.jpg' - -## Image avatars - - - - - - - -```jsx - - - -``` - -## Letter avatars - - - - CUI - - CUI - - CUI - - - - -```jsx -CUI -CUI -CUI -``` - -## Rounded avatars - -Use the `shape="rounded"` prop to make avatars squared with rounded corners. - - - - CUI - - - CUI - - - CUI - - - -```jsx -CUI -CUI -CUI -``` - -## Square avatars - -Use the `shape="rounded-0"` prop to make avatars squared. - - - - CUI - - - CUI - - - CUI - - - -```jsx -CUI -CUI -CUI -``` - -## Sizes - -Fancy larger or smaller avatar? Add `size="xl"`, `size="lg"` or `size="sm"` for additional sizes. - - - - CUI - - - CUI - - CUI - - CUI - - - -```jsx -CUI -CUI -CUI -CUI -``` - -## Avatars with status - - - - - CUI - - - -```jsx - -CUI -``` - -## API - -### CAvatar - -`markdown:CAvatar.api.mdx` - diff --git a/docs/4.0/components/badge.mdx b/docs/4.0/components/badge.mdx deleted file mode 100644 index c4590b10..00000000 --- a/docs/4.0/components/badge.mdx +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: React Badge Component -name: Badge -description: React badge component is small count and labeling component. - -menu: Components -route: /components/badge ---- - -import { CBadge, CButton } from './../../../src/index.ts' - -## Example - -Badge component scales to suit the size of the parent element by using relative font sizing and `em` units. - -### Basic usage - - -

Example heading New

-

Example heading New

-

Example heading New

-

Example heading New

-
Example heading New
-
Example heading New
-
- -```jsx -

Example heading New

-

Example heading New

-

Example heading New

-

Example heading New

-
Example heading New
-
Example heading New
-``` - -Badges can be used as part of links or buttons to provide a counter. - - - - Notifications 4 - - - -```jsx - - Notifications 4 - -``` - -Remark that depending on how you use them, badges may be complicated for users of screen readers and related assistive technologies. - -Unless the context is clear, consider including additional context with a visually hidden piece of additional text. - - - - Profile 9 - unread messages - - - -```jsx - - Profile 9 - unread messages - -``` - -### Positioned - -Use `position` prop to modify a component and position it in the corner of a link or button. - - - - Profile - - 99+ unread messages - - - - Profile - - 99+ unread messages - - -
- - Profile - - 99+ unread messages - - - - Profile - - 99+ unread messages - - -
- -```jsx - - Profile - - 99+ unread messages - - - - Profile - - 99+ unread messages - - - - Profile - - 99+ unread messages - - - - Profile - - 99+ unread messages - - -``` - -You can also create more generic indicators without a counter using a few more utilities. - - - - Profile - - New alerts - - - - -```jsx - - Profile - - New alerts - - -``` - -## Contextual variations - -Add any of the below-mentioned `color` props to modify the presentation of a badge. - - - primary - success - danger - warning - info - light - dark - - -```jsx -primary -success -danger -warning -info -light -dark -``` - -## Pill badges - -Apply the `shape="rounded-pill"` prop to make badges rounded. - - - primary - success - danger - warning - info - light - dark - - -```jsx -primary -success -danger -warning -info -light -dark -``` - -## API - -### CBadge - -`markdown:CBadge.api.mdx` \ No newline at end of file diff --git a/docs/4.0/components/button-group.mdx b/docs/4.0/components/button-group.mdx deleted file mode 100644 index 81571020..00000000 --- a/docs/4.0/components/button-group.mdx +++ /dev/null @@ -1,658 +0,0 @@ ---- -title: React Button Group Component -name: Button group -description: React button group component allows to group a series of buttons and power them with JavaScript. -menu: Components -route: /components/button-group ---- - -import { - CButtonGroup, - CButtonToolbar, - CButton, - CDropdown, - CDropdownDivider, - CDropdownHeader, - CDropdownItem, - CDropdownItemPlain, - CDropdownMenu, - CDropdownToggle, - CFormCheck, - CFormInput, - CInputGroup, - CInputGroupText, -} from './../../../src/index.ts' - -## Basic example - -Wrap a series of `` components in ``. - - - - Left - Middle - Right - - - -```jsx - - Left - Middle - Right - -``` - -##### Ensure the correct `role` and provide a label - -For assistive technologies (ex. screen readers) to communicate that a series of buttons are grouped, a proper `role` attribute has to be provided. For button groups, this should be `role="group"`, while toolbars should have a `role="toolbar"`. - -Besides, groups and toolbars should be provided an understandable label, as most assistive technologies will otherwise not declare them, despite the appearance of the specific role attribute. In the following examples provided here, we apply `aria-label`, but options such as `aria-labelledby` can also be used. - -These classes can also be added to groups of links, as an alternative to the `` components. - - - - - Active link - - - Link - - - Link - - - - -```jsx - - - Active link - - - Link - - - Link - - -``` - -## Mixed styles - - - - Left - Middle - Right - - - -```jsx - - Left - Middle - Right - -``` - -## Outlined styles - - - - - Left - - - Middle - - - Right - - - - -```jsx - - - Left - - - Middle - - - Right - - -``` - -## Checkbox and radio button groups - -Combine button-like checkbox and radio toggle buttons into a seamless looking button group. - - - - - - - - - -```jsx - - - - - -``` - - - - - - - - - -```jsx - - - - - -``` - -## Button toolbar - -Join sets of button groups into button toolbars for more complicated components. Use utility classes as needed to space out groups, buttons, and more. - - - - - 1 - 2 - 3 - 4 - - - 5 - 6 - 7 - - - 8 - - - - -```jsx - - - 1 - 2 - 3 - 4 - - - 5 - 6 - 7 - - - 8 - - -``` - -Feel free to combine input groups with button groups in your toolbars. Similar to the example above, you’ll likely need some utilities through to space items correctly. - - - - - - 1 - - - 2 - - - 3 - - - 4 - - - - @ - - - - - - - 1 - - - 2 - - - 3 - - - 4 - - - - @ - - - - - -```jsx - - - 1 - 2 - 3 - 4 - - - @ - - - - - - 1 - 2 - 3 - 4 - - - @ - - - -``` - -## Sizing - -Alternatively, of implementing button sizing classes to each button in a group, set `size` property to all ``'s, including each one when nesting multiple groups. - - - - - Left - - - Middle - - - Right - - -
- - - Left - - - Middle - - - Right - - -
- - - Left - - - Middle - - - Right - - -
- -```jsx - - Left - Middle - Right - -
- - Left - Middle - Right - -
- - Left - Middle - Right - -``` - -## Nesting - -Put a `` inside another `` when you need dropdown menus combined with a series of buttons. - - - - 1 - 2 - - Dropdown - - Action - Another action - Something else here - - Separated link - - - - - -```jsx - - 1 - 2 - - Dropdown - - Action - Another action - Something else here - - Separated link - - - -``` - -## Vertical variation - -Create a set of buttons that appear vertically stacked rather than horizontally. **Split button dropdowns are not supported here.** - - - - Button - Button - Button - Button - Button - Button - Button - - - -```jsx - - Button - Button - Button - Button - Button - Button - Button - -``` - - - - Button - Button - - Dropdown - - Action - Another action - Something else here - - Separated link - - - Button - Button - - Dropdown - - Action - Another action - Something else here - - Separated link - - - - Dropdown - - Action - Another action - Something else here - - Separated link - - - - Dropdown - - Action - Another action - Something else here - - Separated link - - - - - -```jsx - - Button - Button - - Dropdown - - Action - Another action - Something else here - - Separated link - - - Button - Button - - Dropdown - - Action - Another action - Something else here - - Separated link - - - - Dropdown - - Action - Another action - Something else here - - Separated link - - - - Dropdown - - Action - Another action - Something else here - - Separated link - - - -``` - - - - - - - - - -```jsx - - - - - -``` - -## API - -### CButtonGroup - -`markdown:CButtonGroup.api.mdx` - -### CButtonToolbar - -`markdown:CButtonToolbar.api.mdx` diff --git a/docs/4.0/components/callout.mdx b/docs/4.0/components/callout.mdx deleted file mode 100644 index 5f66152f..00000000 --- a/docs/4.0/components/callout.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: React Callout Component -name: Callout -description: React callout component provides presentation of content in a visually distinct manner. Includes a heading, icon and typically text-based content. -menu: Components -route: /components/callout ---- - -import { CCallout } from './../../../src/index.ts' - -## Examples - -Callout component is prepared for any length of text, as well as an optional elements like icons, headings, etc. For a styling, use one of the **required** contextual props (e.g., `color="success"`). - - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - -```jsx - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - - - New to or unfamiliar with flexbox? Read this CSS Tricks flexbox guide for background, - terminology, guidelines, and code snippets. - -``` - - -
Conveying meaning to assistive technologies
-

- Using color to add meaning only provides a visual indication, which will not be conveyed to - users of assistive technologies – such as screen readers. Ensure that information denoted by the - color is either obvious from the content itself (e.g. the visible text), or is included through - alternative means, such as additional text hidden with the `.visually-hidden` class. -

-
- -## API - -### CCallout - -`markdown:CCallout.api.mdx` diff --git a/docs/4.0/components/image.mdx b/docs/4.0/components/image.mdx deleted file mode 100644 index 1c668b43..00000000 --- a/docs/4.0/components/image.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: React Image Component -name: Image -description: React image component with responsive behavior (so it's never become larger than their parent element) and special styles. -menu: Components -route: /components/image ---- - -import { CImage } from './../../../src/index.ts' - -import ReactImg from './../assets/images/react.jpg' -import React400Img from './../assets/images/react400.jpg' - -## Responsive images - -Images in CoreUI for React.js are made responsive with `fluid` property. This applies `max-width: 100%;` and `height: auto;` to the image so that it scales with the parent element. - - - - - -```jsx - -``` - -## Image thumbnails - -In addition to our [border-radius utilities](https://coreui.io/docs/4.0/utilities/borders), you can use prop`thumbnail` to give an image a rounded 1px border appearance. - - - - - -```jsx - -``` - -## Aligning images - -Align images with the `align` property. - - -
- - -
-
- -```jsx -
- - -
-``` - - -
- -
-
- -```jsx -
- -
-``` - - -
- -
-
- -```jsx -
- -
-``` - -## API - -### CImage - -`markdown:CImage.api.mdx` diff --git a/docs/4.0/components/popover.mdx b/docs/4.0/components/popover.mdx deleted file mode 100644 index 83e688df..00000000 --- a/docs/4.0/components/popover.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: React Popover Component -name: Popover -description: Documentation and examples for adding React popovers, like those found in iOS, to any element on your site. - -menu: Components -route: /components/popover ---- - -import { CPopover, CButton } from './../../../src/index.ts' - -## Example - - - - - Click to toggle popover - - - - -```jsx - - - Click to toggle popover - - -``` - -### Four directions - -Four options are available: top, right, bottom, and left aligned. Directions are mirrored when using CoreUI for React in RTL. - - - - Popover on top - - - Popover on right - - - Popover on bottom - - - Popover on left - - - -```jsx - - Popover on top - - - Popover on right - - - Popover on bottom - - - Popover on left - -``` - -## API - -### CPopover - -`markdown:CPopover.api.mdx` diff --git a/docs/4.0/components/progress.mdx b/docs/4.0/components/progress.mdx deleted file mode 100644 index babc71b6..00000000 --- a/docs/4.0/components/progress.mdx +++ /dev/null @@ -1,222 +0,0 @@ ---- -title: React Progress Component -name: Progress -description: Documentation and examples for using React progress bars featuring support for stacked bars, animated backgrounds, and text labels. - -menu: Components -route: /components/progress ---- - -import { CProgress, CProgressBar, CButton } from './../../../src/index.ts' - -## Example - -Progress components are built with two HTML elements, some CSS to set the width, and a few attributes. We don't use [the HTML5 `` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress), ensuring you can stack progress bars, animate them, and place text labels over them. - -## Basic usage - - - - - - - - - - - - - - - - - - - -```jsx - - - - - - - - - - - - - - - -``` - -## Labels - -Add labels to your progress bars by placing text within the ``. - - - - 25% - - - -```jsx - - 25% - -``` - -## Height - -We only set a `height` value on the ``, so if you change that value the inner `` will automatically resize accordingly. - - - - - - - - - - -```jsx - - - - - - -``` - -## Backgrounds - -Use `color` prop to change the appearance of individual progress bars. - - - - - - - - - - - - - - - - -```jsx - - - - - - - - - - - - -``` - -## Multiple bars - -Include multiple progress bars in a progress component if you need. - - - - - - - - - -```jsx - - - - - -``` - -## Striped - -Add `variant="striped"` to any `` to apply a stripe via CSS gradient over the progress bar's background color. - - - - - - - - - - - - - - - - -```jsx - - - - - - - - - - - - -``` - -## Animated stripes - -The striped gradient can also be animated. Add `animated` property to `` to animate the stripes right to left via CSS3 animations. - - - - - - - - - - - - - - - - -```jsx - - - - - - - - - - - - -``` - -## API - -### CProgress - -`markdown:CProgress.api.mdx` - -### CProgressBar - -`markdown:CProgressBar.api.mdx` diff --git a/docs/4.0/components/spinner.mdx b/docs/4.0/components/spinner.mdx deleted file mode 100644 index 084c171d..00000000 --- a/docs/4.0/components/spinner.mdx +++ /dev/null @@ -1,155 +0,0 @@ ---- -title: React Spinner Component -name: Spinner -description: Indicate the loading state of a component or page with CoreUI spinners, built entirely with HTML, CSS, and no JavaScript. -menu: Components -route: /components/spinner ---- - -import { CSpinner, CButton } from './../../../src/index.ts' - -## About - -CoreUI "spinners" can be used to show the loading state in your projects. They're built only with HTML and CSS, meaning you don't need any JavaScript to create them. You will, however, need some custom JavaScript to toggle their visibility. Their appearance, alignment, and sizing can be easily customized with our amazing utility classes. - -For accessibility purposes, each loader here includes `role="status"` and a nested `Loading...`. - -## Border spinner - -Use the border spinners for a lightweight loading indicator. - -## Basic usage - - - - - -```jsx - -``` - -### Colors - -The border spinner uses `currentColor` for its `border-color`. You can use any of our text color utilities on the standard spinner. - - - - - - - - - - - - -```jsx - - - - - - - - -``` - -## Growing spinner - -If you don't fancy a border spinner, switch to the grow spinner. While it doesn't technically spin, it does repeatedly grow! - - - - - -```jsx - -``` - -Once again, this spinner is built with `currentColor`, so you can easily change its appearance. Here it is in blue, along with the supported variants. - - - - - - - - - - - - -```jsx - - - - - - - - -``` - -## Size - -Add `size="sm"`property` to make a smaller spinner that can quickly be used within other components. - - - - - - -```jsx - - -``` - -## Buttons - -Use spinners within buttons to indicate an action is currently processing or taking place. You may also swap the text out of the spinner element and utilize button text as needed. - - - - - - - - -```jsx - - - - -``` - - - - - - - - -```jsx - - - - -``` - -## API - -### CSpinner - -`markdown:CSpinner.api.mdx` \ No newline at end of file diff --git a/docs/4.0/components/table.mdx b/docs/4.0/components/table.mdx deleted file mode 100644 index 44061975..00000000 --- a/docs/4.0/components/table.mdx +++ /dev/null @@ -1,2366 +0,0 @@ ---- -title: React Table Component -name: Table -description: Documentation and examples for opt-in styling of tables. -menu: Components -route: /components/table ---- - -import { - CTable, - CTableBody, - CTableCaption, - CTableDataCell, - CTableFoot, - CTableHead, - CTableHeaderCell, - CTableRow, -} from './../../../src/index.ts' - -## Overview - -Due to the widespread use of `` elements across third-party widgets like calendars and date pickers, CoreUI's tables are **opt-in**. All table styles are not inherited in CoreUI, meaning any nested tables can be styled independent from the parent. - -Using the most basic table CoreUI, here's how ``-based tables look in CoreUI. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -## Variants - -Use contextual classes to color tables, table rows or individual cells. - - - - - - Class - Heading - Heading - - - - - Default - Cell - Cell - - - Primary - Cell - Cell - - - Secondary - Cell - Cell - - - Success - Cell - Cell - - - Danger - Cell - Cell - - - Warning - Cell - Cell - - - Info - Cell - Cell - - - Light - Cell - Cell - - - Dark - Cell - Cell - - - - - -```jsx - - - - Class - Heading - Heading - - - - - Default - Cell - Cell - - - Primary - Cell - Cell - - - Secondary - Cell - Cell - - - Success - Cell - Cell - - - Danger - Cell - Cell - - - Warning - Cell - Cell - - - Info - Cell - Cell - - - Light - Cell - Cell - - - Dark - Cell - Cell - - - -``` - -## Accented tables - -### striped rows - -Use `striped` property to add zebra-striping to any table row within the ``. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -These classes can also be added to table variants: - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -### Hoverable rows - -Use `hover` property to enable a hover state on table rows within a ``. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -These hoverable rows can also be combined with the striped variant: - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -### Active tables - -Highlight a table row or cell by adding a `active` property. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - - Larry the Bird - - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - - Larry the Bird - - @twitter - - - -``` - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - - Larry the Bird - - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - - Larry the Bird - - @twitter - - - -``` - -## Table borders - -### Bordered tables - -Add `bordered` property for borders on all sides of the table and cells. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -[Border color utilities](https://coreui.io/docs/4.0/utilities/borders#border-color) can be added to change colors: - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -### Tables without borders - -Add `borderless` property for a table without borders. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -## Small tables - -Add `small` property to make any `` more compact by cutting all cell `padding` in half. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -## Vertical alignment - -Table cells of `` are always vertical aligned to the bottom. Table cells in `` inherit their alignment from `` and are aligned to the the top by default. Use the align property to re-align where needed. - - - - - - - Heading 1 - - - Heading 2 - - - Heading 3 - - - Heading 4 - - - - - - - This cell inherits vertical-align: middle; from the table - - - This cell inherits vertical-align: middle; from the table - - - This cell inherits vertical-align: middle; from the table - - - This here is some placeholder text, intended to take up quite a bit of vertical space, to - demonsCTableRowate how the vertical alignment works in the preceding cells. - - - - - This cell inherits vertical-align: bottom; from the table row - - - This cell inherits vertical-align: bottom; from the table row - - - This cell inherits vertical-align: bottom; from the table row - - - This here is some placeholder text, intended to take up quite a bit of vertical space, to - demonsCTableRowate how the vertical alignment works in the preceding cells. - - - - - This cell inherits vertical-align: middle; from the table - - - This cell inherits vertical-align: middle; from the table - - This cell is aligned to the top. - - This here is some placeholder text, intended to take up quite a bit of vertical space, to - demonsCTableRowate how the vertical alignment works in the preceding cells. - - - - - - -```jsx - - - - - Heading 1 - - - Heading 2 - - - Heading 3 - - - Heading 4 - - - - - - - This cell inherits vertical-align: middle; from the table - - - This cell inherits vertical-align: middle; from the table - - - This cell inherits vertical-align: middle; from the table - - - This here is some placeholder text, intended to take up quite a bit of vertical space, to - demonsCTableRowate how the vertical alignment works in the preceding cells. - - - - - This cell inherits vertical-align: bottom; from the table row - - - This cell inherits vertical-align: bottom; from the table row - - - This cell inherits vertical-align: bottom; from the table row - - - This here is some placeholder text, intended to take up quite a bit of vertical space, to - demonsCTableRowate how the vertical alignment works in the preceding cells. - - - - - This cell inherits vertical-align: middle; from the table - - - This cell inherits vertical-align: middle; from the table - - This cell is aligned to the top. - - This here is some placeholder text, intended to take up quite a bit of vertical space, to - demonsCTableRowate how the vertical alignment works in the preceding cells. - - - - -``` - -## Nesting - -Border styles, active styles, and table variants are not inherited by nested tables. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - - - - - Header - Header - Header - - - - - A - First - Last - - - B - First - Last - - - C - First - Last - - - - - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - - - - - Header - Header - Header - - - - - A - First - Last - - - B - First - Last - - - C - First - Last - - - - - - - 3 - Larry the Bird - @twitter - - - -``` - -## Anatomy - -### Table head - -Similar to tables and dark tables, use the modifier prop `color="light"` or `color="dark"` to make ``s appear light or dark gray. - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - -``` - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - -``` - -### Table foot - - - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - Footer - Footer - Footer - Footer - - - - - -```jsx - - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry the Bird - @twitter - - - - - Footer - Footer - Footer - Footer - - - -``` - -### Captions - -A `` functions like a heading for a table. It helps users with screen readers to find a table and understand what it's about and decide if they want to read it. - - - - List of users - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - - - -```jsx - - List of users - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - -``` - -You can also put the `` on the top of the table with `caption="top"`. - - - - List of users - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - - - -```jsx - - List of users - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - -``` - -## Responsive tables - -Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by adding a `responsive` property. Or, pick a maximum breakpoint with which to have a responsive table up to by using `responsive="{-sm|-md|-lg|-xl|-xxl}"`. - - - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - - - -```jsx - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - -``` - - - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - - - -```jsx - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - -``` - - - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - - - -```jsx - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - -``` - - - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - - - -```jsx - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - -``` - - - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - - - -```jsx - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - -``` - - - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - - - -```jsx - - - - # - Heading - Heading - Heading - Heading - Heading - Heading - Heading - Heading - - - - - 1 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 2 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - 3 - Cell - Cell - Cell - Cell - Cell - Cell - Cell - Cell - - - -``` - -## API - -### CTable - -`markdown:CTable.api.mdx` - -### CTableBody - -`markdown:CTableBody.api.mdx` - -### CTableDataCell - -`markdown:CTableDataCell.api.mdx` - -### CTableFoot - -`markdown:CTableFoot.api.mdx` - -### CTableHead - -`markdown:CTableHead.api.mdx` - -### CTableHeaderCell - -`markdown:CTableHeaderCell.api.mdx` - -### CTableRow - -`markdown:CTableRow.api.mdx` diff --git a/docs/4.0/components/tooltip.mdx b/docs/4.0/components/tooltip.mdx deleted file mode 100644 index 022749b4..00000000 --- a/docs/4.0/components/tooltip.mdx +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: React Tooltip Component -name: Tooltip -description: Documentation and examples for adding React Tooltips. - -menu: Components -route: /components/tooltip ---- - -import { CTooltip, CButton, CLink } from './../../../src/index.ts' - -## Examples - -Hover over the links below to see tooltips: - - -

- Tight pants next level keffiyeh - - you probably - - haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. - Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel - - have a - - terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu - biodiesel williamsburg marfa, four loko mcsweeney''s cleanse vegan chambray. A really ironic - artisan - - whatever keytar - - scenester farm-to-table banksy Austin - - twitter handle - - freegan cred raw denim single-origin coffee viral. -

-
- -```jsx -

- Tight pants next level keffiyeh - - you probably - - haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. - Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel - - have a - - terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu - biodiesel williamsburg marfa, four loko mcsweeney''s cleanse vegan chambray. A really ironic - artisan - - whatever keytar - - scenester farm-to-table banksy Austin - - twitter handle - - freegan cred raw denim single-origin coffee viral. -

-``` - -Hover over the buttons below to see the four tooltips directions: top, right, bottom, and left. Directions are mirrored when using CoreUI in RTL. - - - - Tooltip on top - - - Tooltip on right - - - Tooltip on bottom - - - Tooltip on left - - - -```jsx - - Tooltip on top - - - Tooltip on right - - - Tooltip on bottom - - - Tooltip on left - -``` - -## API - -### CTooltip - -`markdown:CTooltip.api.mdx` diff --git a/docs/4.0/forms/floating-labels.mdx b/docs/4.0/forms/floating-labels.mdx deleted file mode 100644 index 93a45bef..00000000 --- a/docs/4.0/forms/floating-labels.mdx +++ /dev/null @@ -1,201 +0,0 @@ ---- -title: React Floating labels -name: Floating labels -description: React floating label component. Create beautifully simple form labels that float over your input fields. -menu: Forms -route: /forms/floating-labels ---- - -import { - CButton, - CForm, - CFormFloating, - CFormInput, - CFormLabel, - CFormSelect, - CFormTextarea, - CCol, - CRow -} from './../../../src/index.ts' - -## Example - -Wrap a pair of `` and `` elements in `CFormFloating` to enable floating labels with textual form fields. A `placeholder` is required on each `` as our method of CSS-only floating labels uses the `:placeholder-shown` pseudo-element. Also note that the `` must come first so we can utilize a sibling selector (e.g., `~`). - - - - - Email address - - - - Password - - - -```jsx - - - Email address - - - - Password - -``` - -When there's a `value` already defined, ``s will automatically adjust to their floated position. - - - - - Input with value - - - -```jsx - - - Input with value - -``` - -## Textareas - -By default, ``s will be the same height as ``s. - - - - - Comments - - - -```jsx - - - Comments - -``` - -To set a custom height on your ``, do not use the `rows` attribute. Instead, set an explicit `height` (either inline or via custom CSS). - - - - - Comments - - - -```jsx - - - Comments - -``` - -## Selects - -Other than ``, floating labels are only available on ``s. They work in the same way, but unlike ``s, they'll always show the `` in its floated state. **Selects with `size` and `multiple` are not supported.** - - - - - - - - - - Works with selects - - - -```jsx - - - - - - - - Works with selects - -``` - -## Layout - -When working with the CoreUI for Bootstrap grid system, be sure to place form elements within column classes. - - - - - - - Email address - - - - - - - - - - - Works with selects - - - - - -```jsx - - - - - Email address - - - - - - - - - - - Works with selects - - - -``` - -## API - -### CFormFloating - -`markdown:CFormFloating.api.mdx` \ No newline at end of file diff --git a/docs/4.0/forms/range.mdx b/docs/4.0/forms/range.mdx deleted file mode 100644 index b92450a0..00000000 --- a/docs/4.0/forms/range.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: React Range Component -name: Range -description: React range component. Use our custom range inputs for consistent cross-browser styling and built-in customization. -menu: Forms -route: /forms/range ---- - -import { CForm, CFormLabel, CFormRange } from './../../../src/index.ts' - -## Overview - -Create custom `` controls with ``. The track (the background) and thumb (the value) are both styled to appear the same across browsers. As only Edge Legacy and Firefox supports "filling" their track from the left or right of the thumb as a means to visually indicate progress, we do not currently support it. - - - Example range - - - -```jsx -Example range - -``` - -## Disabled - -Add the `disabled` boolean attribute on an input to give it a grayed out appearance and remove pointer events. - - - Disabled range - - - -```jsx -Disabled range - -``` - -## Min and max - -Range inputs have implicit values for `min` and `max`—`0` and `100`, respectively. You may specify new values for those using the `min` and `max` attributes. - - - Example range - - - -```jsx -Example range - -``` - -## Steps - -By default, range inputs "snap" to integer values. To change this, you can specify a `step` value. In the example below, we double the number of steps by using `step="0.5"`. - - - Example range - - - -```jsx -Example range - -``` - -## API - -### CFormRange - -`markdown:CFormRange.api.mdx` diff --git a/docs/4.0/forms/validation.mdx b/docs/4.0/forms/validation.mdx deleted file mode 100644 index 8eb71378..00000000 --- a/docs/4.0/forms/validation.mdx +++ /dev/null @@ -1,790 +0,0 @@ ---- -title: React Form Validation -name: Validation -description: Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript. -menu: Forms -route: /forms/validation ---- - -import { useState } from 'react' - -import { - CButton, - CDropdown, - CDropdownDivider, - CDropdownHeader, - CDropdownItem, - CDropdownItemPlain, - CDropdownMenu, - CDropdownToggle, - CForm, - CFormCheck, - CFormInput, - CFormFeedback, - CFormLabel, - CFormSelect, - CInputGroup, - CInputGroupText, - CCol, - CRow, -} from './../../../src/index.ts' - - - -## Custom styles - -For custom CoreUI form validation messages, you'll need to add the `noValidate` boolean property to your ``. This disables the browser default feedback tooltips, but still provides access to the form validation APIs in JavaScript. Try to submit the form below; our JavaScript will intercept the submit button and relay feedback to you. When attempting to submit, you'll see the `:invalid` and `:valid` styles applied to your form controls. - -Custom feedback styles apply custom colors, borders, focus styles, and background icons to better communicate feedback. - -export const CustomStylesExample = () => { - const [validated, setValidated] = useState(false) - const handleSubmit = (event) => { - const form = event.currentTarget - if (form.checkValidity() === false) { - event.preventDefault() - event.stopPropagation() - } - setValidated(true) - } - return ( - - - Email - - Looks good! - - - Email - - Looks good! - - - Username - - @ - - Please choose a username. - - - - City - - Please provide a valid city. - - - City - - - - - Please provide a valid city. - - - City - - Please provide a valid zip. - - - - You must agree before submitting. - - - - Submit form - - - - ) -} - - - - - -```jsx -const [validated, setValidated] = useState(false) -const handleSubmit = (event) => { - const form = event.currentTarget - if (form.checkValidity() === false) { - event.preventDefault() - event.stopPropagation() - } - setValidated(true) -} -return ( - - - Email - - Looks good! - - - Email - - Looks good! - - - Username - - @ - - Please choose a username. - - - - City - - Please provide a valid city. - - - City - - - - - Please provide a valid city. - - - City - - Please provide a valid zip. - - - - You must agree before submitting. - - - - Submit form - - - -) -``` - -## Browser defaults - -Not interested in custom validation feedback messages or writing JavaScript to change form behaviors? All good, you can use the browser defaults. Try submitting the form below. Depending on your browser and OS, you'll see a slightly different style of feedback. - -While these feedback styles cannot be styled with CSS, you can still customize the feedback text through JavaScript. - -export const BrowserDefaultsExample = () => { - const [validated, setValidated] = useState(false) - const handleSubmit = (event) => { - const form = event.currentTarget - if (form.checkValidity() === false) { - event.preventDefault() - event.stopPropagation() - } - setValidated(true) - } - return ( - - - Email - - Looks good! - - - Email - - Looks good! - - - Username - - @ - - Please choose a username. - - - - City - - Please provide a valid city. - - - City - - - - - Please provide a valid city. - - - City - - Please provide a valid zip. - - - - You must agree before submitting. - - - - Submit form - - - - ) -} - - - - - -```jsx -const [validated, setValidated] = useState(false) -const handleSubmit = (event) => { - const form = event.currentTarget - if (form.checkValidity() === false) { - event.preventDefault() - event.stopPropagation() - } - setValidated(true) -} -return ( - - - Email - - Looks good! - - - Email - - Looks good! - - - Username - - @ - - Please choose a username. - - - - City - - Please provide a valid city. - - - City - - - - - Please provide a valid city. - - - City - - Please provide a valid zip. - - - - You must agree before submitting. - - - - Submit form - - - -) -``` - -## Server side - -We recommend using client-side validation, but in case you require server-side validation, you can indicate invalid and valid form fields with `invalid` and `valid` boolean properties. - -For invalid fields, ensure that the invalid feedback/error message is associated with the relevant form field using `aria-describedby` (noting that this attribute allows more than one `id` to be referenced, in case the field already points to additional form text). - - - - - Email - - Looks good! - - - Email - - Looks good! - - - Username - - @ - - Please choose a username. - - - - City - - Please provide a valid city. - - - City - - - - - Please provide a valid city. - - - City - - Please provide a valid zip. - - - - You must agree before submitting. - - - - Submit form - - - - - -```jsx - - - Email - - Looks good! - - - Email - - Looks good! - - - Username - - @ - - Please choose a username. - - - - City - - Please provide a valid city. - - - City - - - - - Please provide a valid city. - - - City - - Please provide a valid zip. - - - - You must agree before submitting. - - - - Submit form - - - -``` - -## Supported elements - -Validation styles are available for the following form controls and components: - -- ``s -- ``s -- ``s -- ``s - - - -
- - Textarea - - - Please enter a message in the textarea. -
- - Example invalid feedback text - - - More example invalid feedback text -
- - - - - - - Example invalid select feedback -
-
- - Example invalid form file feedback -
-
- - Submit form - -
-
-
- -```jsx - -
- - Textarea - - - Please enter a message in the textarea. -
- - - Example invalid feedback text - - - - - More example invalid feedback text - -
- - - - - - - Example invalid select feedback -
- -
- - Example invalid form file feedback -
- -
- - Submit form - -
-
-``` - -## Tooltips - -If your form layout allows it, you can swap the text for the tooltip to display validation feedback in a styled tooltip. Be sure to have a parent with `position: relative` on it for tooltip positioning. In the example below, our column classes have this already, but your project may require an alternative setup. - -export const TooltipsExample = () => { - const [validated, setValidated] = useState(false) - const handleSubmit = (event) => { - const form = event.currentTarget - if (form.checkValidity() === false) { - event.preventDefault() - event.stopPropagation() - } - setValidated(true) - } - return ( - - - Email - - - Looks good! - - - - Email - - - Looks good! - - - - Username - - @ - - - Please choose a username. - - - - - City - - - Please provide a valid city. - - - - City - - - - - - Please provide a valid city. - - - - City - - - Please provide a valid zip. - - - - - Submit form - - - - ) -} - - - - - -```jsx -const [validated, setValidated] = useState(false) -const handleSubmit = (event) => { - const form = event.currentTarget - if (form.checkValidity() === false) { - event.preventDefault() - event.stopPropagation() - } - setValidated(true) -} -return ( - - - Email - - - Looks good! - - - - Email - - - Looks good! - - - - Username - - @ - - - Please choose a username. - - - - - City - - - Please provide a valid city. - - - - City - - - - - - Please provide a valid city. - - - - City - - - Please provide a valid zip. - - - - - Submit form - - - -) -``` diff --git a/docs/4.0/layout/containers.mdx b/docs/4.0/layout/containers.mdx deleted file mode 100644 index 57743d64..00000000 --- a/docs/4.0/layout/containers.mdx +++ /dev/null @@ -1,176 +0,0 @@ ---- -name: Containers -title: Containers -description: Containers are a fundamental building block of CoreUI for React.js that contain, pad, and align your content within a given device or viewport. -menu: Layout -route: "/layout/containers" ---- - -import { CCol, CContainer, CRow } from './../../../src/index.ts' - -## How they work - -Containers are the most basic layout element in CoreUI for React.js and are **required when using our default grid system**. Containers are used to contain, pad, and (sometimes) center the content within them. While containers *can* be nested, most layouts do not require a nested container. - -CoreUI for React.js comes with three different containers: - -- ``, which sets a `max-width` at each responsive breakpoint -- ``, which is `width: 100%` at all breakpoints -- ``, which is `width: 100%` until the specified breakpoint - -The table below illustrates how each container's `max-width` compares to the original `` and `` across each breakpoint. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Extra small
- <576px -
- Small
- ≥576px -
- Medium
- ≥768px -
- Large
- ≥992px -
- X-Large
- ≥1200px -
- XX-Large
- ≥1400px -
<CContainer>100%540px720px960px1140px1320px
<CContainer sm>100%540px720px960px1140px1320px
<CContainer md>100%100%720px960px1140px1320px
<CContainer lg>100%100%100%960px1140px1320px
<CContainer xl>100%100%100%100%1140px1320px
<CContainer xxl>100%100%100%100%100%1320px
<CContainer fluid>100%100%100%100%100%100%
- -## Default container - -Our default `` class is a responsive, fixed-width container, meaning its `max-width` changes at each breakpoint. - - - - Content here - - - -```jsx - - Content here - -``` - -## Responsive containers - -Responsive containers allow you to specify a class that is 100% wide until the specified breakpoint is reached, after which we apply `max-width`s for each of the higher breakpoints. For example, `` is 100% wide to start until the `sm` breakpoint is reached, where it will scale up with `md`, `lg`, `xl`, and `xxl`. - - - 100% wide until small breakpoint - 100% wide until medium breakpoint - 100% wide until large breakpoint - 100% wide until extra large breakpoint - 100% wide until extra extra large breakpoint - - -```jsx -100% wide until small breakpoint -100% wide until medium breakpoint -100% wide until large breakpoint -100% wide until extra large breakpoint -100% wide until extra extra large breakpoint -``` - -## Fluid containers - -Use `` for a full width container, spanning the entire width of the viewport. - - - - Content here - - - -```jsx - - Content here - -``` - -## API - -### CContainer - -`markdown:CContainer.api.mdx` diff --git a/docs/4.0/layout/gutters.mdx b/docs/4.0/layout/gutters.mdx deleted file mode 100644 index f4172899..00000000 --- a/docs/4.0/layout/gutters.mdx +++ /dev/null @@ -1,277 +0,0 @@ ---- -name: Gutters -title: Gutters -description: Gutters are the padding between your columns, used to responsively space and align content in the CoreUI for React.js grid system. -menu: Layout -route: "/layout/gutters" ---- - -import { CCol, CContainer, CRow } from './../../../src/index.ts' - -## How they work - -- **Gutters are the gaps between column content, created by horizontal `padding`.** We set `padding-right` and `padding-left` on each column, and use negative `margin` to offset that at the start and end of each row to align content. - -- **Gutters start at `1.5rem` (`24px`) wide.** This allows us to match our grid to the [padding and margin spacers](https://coreui.io/docs/utilities/spacing) scale. - -- **Gutters can be responsively adjusted.** Use breakpoint-specific gutter props to modify horizontal gutters, vertical gutters, and all gutters. - -## Horizontal gutters - -`{breakpoint}={{ gutterX: * }}` props can be used to control the horizontal gutter widths. The `` or `` parent may need to be adjusted if larger gutters are used too to avoid unwanted overflow, using a matching padding utility. For example, in the following example we've increased the padding with `.px-4`: - - - - - -
Custom column padding
-
- -
Custom column padding
-
-
-
-
- -```jsx - - - -
Custom column padding
-
- -
Custom column padding
-
-
-
-``` - -An alternative solution is to add a wrapper around the `` with the `.overflow-hidden` class: - - - - - -
Custom column padding
-
- -
Custom column padding
-
-
-
-
- -```jsx - - - -
Custom column padding
-
- -
Custom column padding
-
-
-
-``` - -## Vertical gutters - -`{breakpoint}={{ gutterY: * }}` props can be used to control the vertical gutter widths. Like the horizontal gutters, the vertical gutters can cause some overflow below the `` at the end of a page. If this occurs, you add a wrapper around `` with the `.overflow-hidden` class: - - - - - -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
-
-
-
- -```jsx - - - -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
-
-
-``` - -## Horizontal & vertical gutters - -`{breakpoint}={{ gutter: * }}` props can be used to control the horizontal gutter widths, for the following example we use a smaller gutter width, so there won't be a need to add the `.overflow-hidden` wrapper class. - - - - - -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
-
-
-
- -```jsx - - - -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
- -
Custom column padding
-
-
-
-``` - -## Row columns gutters - -Gutter props can also be added to [row columns](../layout/grid#row-columns). In the following example, we use responsive row columns and responsive gutter props. - - - - - -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
-
-
-
- -```jsx - - - -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
- -
Row column
-
-
-
-``` - -## No gutters - -The gutters between columns in our predefined grid props can be removed with `{breakpoint}={{ gutter: 0 }}`. This removes the negative `margin`s from `` and the horizontal `padding` from all immediate children columns. - -**Need an edge-to-edge design?** Drop the parent `` or ``. - -In practice, here's how it looks. Note you can continue to use this with all other predefined grid props (including column widths, responsive tiers, reorders, and more). - - -
- - .col-sm-6 .col-md-8 - .col-6 .col-md-4 - -
-
- -```jsx -
- - .col-sm-6 .col-md-8 - .col-6 .col-md-4 - -
-``` - -## API - -### CContainer - -`markdown:CContainer.api.mdx` - -### CRow - -`markdown:CRow.api.mdx` - -### CCol - -`markdown:CCol.api.mdx` diff --git a/docs/4.0/migration/Docs.tsx b/docs/4.0/migration/Docs.tsx deleted file mode 100644 index 41c2c35e..00000000 --- a/docs/4.0/migration/Docs.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import React, { FC, useState } from 'react' -import PropTypes from 'prop-types' -import Helmet from 'react-helmet' -import { graphql } from 'gatsby' -import { MDXProvider } from '@mdx-js/react' -import { MDXRenderer } from 'gatsby-plugin-mdx' -import { CodeBlock, Example, Footer, Header, Seo, Sidebar, Toc } from './../components/' -import { CCol, CContainer, CRow, CTable } from '../../index' -import './../styles/styles.scss' - -interface ContextProps { - sidebarVisible: boolean | undefined - setSidebarVisible: React.Dispatch> -} - -export const myContext = React.createContext({} as ContextProps) - -const components = { - // eslint-disable-next-line react/display-name - pre: (props) => , - // eslint-disable-next-line react/display-name - table: (props) => , - Example, -} - -const DocsLayout: FC = ({ data: { mdx } }) => { - const [sidebarVisible, setSidebarVisible] = useState() - return ( - <> - - - + )} ) } export default SEO -SEO.propTypes = { - title: PropTypes.string, - description: PropTypes.string, - image: PropTypes.string, - article: PropTypes.bool, -} - -SEO.defaultProps = { - title: null, - description: null, - image: null, - article: false, -} - const query = graphql` query SEO { site { @@ -79,6 +95,7 @@ const query = graphql` defaultImage: image twitterUsername } + pathPrefix } } ` diff --git a/packages/docs/src/components/Sidebar.tsx b/packages/docs/src/components/Sidebar.tsx new file mode 100644 index 00000000..26326fcf --- /dev/null +++ b/packages/docs/src/components/Sidebar.tsx @@ -0,0 +1,77 @@ +import React, { FC } from 'react' + +import { + CDropdown, + CDropdownToggle, + CDropdownMenu, + CDropdownItem, + CSidebar, + CSidebarBrand, +} from '@coreui/react/src' +import { SidebarNav } from '.' + +import { AppContext } from './../AppContext' + +import items from './../nav' + +interface SidebarProps { + currentRoute: string +} + +const Sidebar: FC = ({ ...props }) => { + return ( + + {(context) => ( + { + context.setSidebarVisible && context.setSidebarVisible(value) + }} + > + + + + + + + + + + + + +
Framework:
+ + + React.js + + + + Angular + + + JavaScript / Vanilla JS + + + Vue.js + + + + +
+ )} +
+ ) +} + +Sidebar.displayName = 'Sidebar' + +export default Sidebar diff --git a/src/docs/components/SidebarNav.tsx b/packages/docs/src/components/SidebarNav.tsx similarity index 85% rename from src/docs/components/SidebarNav.tsx rename to packages/docs/src/components/SidebarNav.tsx index 6496a364..040470ca 100644 --- a/src/docs/components/SidebarNav.tsx +++ b/packages/docs/src/components/SidebarNav.tsx @@ -1,8 +1,7 @@ -import React, { ElementType, ReactNode } from 'react' -import PropTypes from 'prop-types' +import React, { ReactNode } from 'react' import { Link } from 'gatsby' -import { CBadge, CNavGroup, CNavItem, CSidebarNav } from '../../index' +import { CBadge, CNavGroup, CNavItem, CSidebarNav } from '@coreui/react/src/index' import CIcon from '@coreui/icons-react' export type Badge = { @@ -46,6 +45,7 @@ export const SidebarNav = ({ items, currentRoute }: SidebarNavProps) => { ) } + const navGroup = (item: NavItem, index: number) => { const { name, icon, to, ...rest } = item return ( @@ -73,8 +73,3 @@ export const SidebarNav = ({ items, currentRoute }: SidebarNavProps) => { ) } - -SidebarNav.propTypes = { - items: PropTypes.arrayOf(PropTypes.any).isRequired, - currentRoute: PropTypes.string.isRequired, -} diff --git a/src/docs/components/Toc.tsx b/packages/docs/src/components/Toc.tsx similarity index 67% rename from src/docs/components/Toc.tsx rename to packages/docs/src/components/Toc.tsx index 9ece9c70..27cedff2 100644 --- a/src/docs/components/Toc.tsx +++ b/packages/docs/src/components/Toc.tsx @@ -1,10 +1,18 @@ -import React from 'react' -import { CNav } from './../../index' +import React, { FC } from 'react' +import { CNav } from '@coreui/react/src/index' -const Toc: FC = (props) => { - const { items } = props +type TocItem = { + url: string + title: string + items: TocItem[] +} + +interface TocProps { + items: TocItem[] +} - const toc = (items) => { +const Toc: FC = ({ items }) => { + const toc = (items: TocItem[]) => { return ( items && items.map((item, index) => { @@ -26,10 +34,10 @@ const Toc: FC = (props) => { } return ( -
+
On this page -
    {toc(items.items)}
+
    {toc(items)}
) diff --git a/packages/docs/src/components/index.ts b/packages/docs/src/components/index.ts new file mode 100644 index 00000000..fe8398f8 --- /dev/null +++ b/packages/docs/src/components/index.ts @@ -0,0 +1,27 @@ +import Ads from './Ads' +import Banner from './Banner' +import Callout from './Callout' +import CodeBlock from './CodeBlock' +import Example from './Example' +import Footer from './Footer' +import Header from './Header' +import ScssDocs from './ScssDocs' +import Seo from './Seo' +import Sidebar from './Sidebar' +import { SidebarNav } from './SidebarNav' +import Toc from './Toc' + +export { + Ads, + Banner, + Callout, + CodeBlock, + Example, + Footer, + Header, + ScssDocs, + Seo, + Sidebar, + SidebarNav, + Toc, +} diff --git a/packages/docs/src/data/other_frameworks.json b/packages/docs/src/data/other_frameworks.json new file mode 100644 index 00000000..32046bbd --- /dev/null +++ b/packages/docs/src/data/other_frameworks.json @@ -0,0 +1,241 @@ +{ + "accordion": { + "angular": "https://coreui.io/angular/docs/components/accordion", + "bootstrap": "https://coreui.io/docs/components/accordion/", + "react": "https://coreui.io/react/docs/components/accordion/", + "vue": "https://coreui.io/vue/docs/components/accordion.html" + }, + "alert": { + "angular": "https://coreui.io/angular/docs/components/alert", + "bootstrap": "https://coreui.io/docs/components/alerts/", + "react": "https://coreui.io/react/docs/components/alert/", + "vue": "https://coreui.io/vue/docs/components/alert.html" + }, + "avatar": { + "angular": "https://coreui.io/angular/docs/components/avatar", + "bootstrap": "https://coreui.io/docs/components/avatar/", + "react": "https://coreui.io/react/docs/components/avatar/", + "vue": "https://coreui.io/vue/docs/components/avatar.html" + }, + "badge": { + "angular": "https://coreui.io/angular/docs/components/badge", + "bootstrap": "https://coreui.io/docs/components/badge/", + "react": "https://coreui.io/react/docs/components/badge/", + "vue": "https://coreui.io/vue/docs/components/badge.html" + }, + "breadcrumb": { + "angular": "https://coreui.io/angular/docs/components/breadcrumb", + "bootstrap": "https://coreui.io/docs/components/breadcrumb/", + "react": "https://coreui.io/react/docs/components/breadcrumb/", + "vue": "https://coreui.io/vue/docs/components/breadcrumb.html" + }, + "button": { + "angular": "https://coreui.io/angular/docs/components/button", + "bootstrap": "https://coreui.io/docs/components/buttons/", + "react": "https://coreui.io/react/docs/components/button/", + "vue": "https://coreui.io/vue/docs/components/button.html" + }, + "button-group": { + "angular": "https://coreui.io/angular/docs/components/button-group", + "bootstrap": "https://coreui.io/docs/components/button-group/", + "react": "https://coreui.io/react/docs/components/button-group/", + "vue": "https://coreui.io/vue/docs/components/button-group.html" + }, + "callout": { + "angular": "https://coreui.io/angular/docs/components/callout", + "bootstrap": "https://coreui.io/docs/components/callout/", + "react": "https://coreui.io/react/docs/components/callout/", + "vue": "https://coreui.io/vue/docs/components/callout.html" + }, + "card": { + "angular": "https://coreui.io/angular/docs/components/card", + "bootstrap": "https://coreui.io/docs/components/card/", + "react": "https://coreui.io/react/docs/components/card/", + "vue": "https://coreui.io/vue/docs/components/card.html" + }, + "carousel": { + "angular": "https://coreui.io/angular/docs/components/carousel", + "bootstrap": "https://coreui.io/docs/components/carousel/", + "react": "https://coreui.io/react/docs/components/carousel/", + "vue": "https://coreui.io/vue/docs/components/carousel.html" + }, + "checkbox": { + "angular": "https://coreui.io/angular/docs/forms/checks-radios", + "bootstrap": "https://coreui.io/docs/forms/checks-radios/", + "react": "https://coreui.io/react/docs/forms/checkbox/", + "vue": "https://coreui.io/vue/docs/forms/checkbox.html" + }, + "close-button": { + "angular": "https://coreui.io/angular/docs/components/close-button", + "bootstrap": "https://coreui.io/docs/components/close-button/", + "react": "https://coreui.io/react/docs/components/close-button/", + "vue": "https://coreui.io/vue/docs/components/close-button.html" + }, + "collapse": { + "angular": "https://coreui.io/angular/docs/components/collapse", + "bootstrap": "https://coreui.io/docs/components/collapse/", + "react": "https://coreui.io/react/docs/components/collapse/", + "vue": "https://coreui.io/vue/docs/components/collapse.html" + }, + "dropdown": { + "angular": "https://coreui.io/angular/docs/components/dropdown", + "bootstrap": "https://coreui.io/docs/components/dropdowns/", + "react": "https://coreui.io/react/docs/components/dropdown/", + "vue": "https://coreui.io/vue/docs/components/dropdown.html" + }, + "footer": { + "angular": "https://coreui.io/angular/docs/components/footer", + "bootstrap": "https://coreui.io/docs/components/footer/", + "react": "https://coreui.io/react/docs/components/footer/", + "vue": "https://coreui.io/vue/docs/components/footer.html" + }, + "header": { + "angular": "https://coreui.io/angular/docs/components/header", + "bootstrap": "https://coreui.io/docs/components/header/", + "react": "https://coreui.io/react/docs/components/header/", + "vue": "https://coreui.io/vue/docs/components/header.html" + }, + "icon": { + "angular": "https://coreui.io/angular/docs/components/icon", + "bootstrap": "https://coreui.io/docs/components/icon/", + "react": "https://coreui.io/react/docs/components/icon/", + "vue": "https://coreui.io/vue/docs/components/icon.html" + }, + "image": { + "angular": "https://coreui.io/angular/docs/components/image", + "bootstrap": "https://coreui.io/docs/content/images/", + "react": "https://coreui.io/react/docs/components/image/", + "vue": "https://coreui.io/vue/docs/components/image.html" + }, + "input": { + "angular": "https://coreui.io/angular/docs/forms/input", + "bootstrap": "https://coreui.io/docs/forms/form-control/", + "react": "https://coreui.io/react/docs/forms/input/", + "vue": "https://coreui.io/vue/docs/forms/input.html" + }, + "input-group": { + "angular": "https://coreui.io/angular/docs/forms/input-group", + "bootstrap": "https://coreui.io/docs/forms/input-group/", + "react": "https://coreui.io/react/docs/forms/input-group/", + "vue": "https://coreui.io/vue/docs/forms/input-group.html" + }, + "floating-labels": { + "angular": "https://coreui.io/angular/docs/forms/floating-labels", + "bootstrap": "https://coreui.io/docs/forms/floating-labels/", + "react": "https://coreui.io/react/docs/forms/floating-labels/", + "vue": "https://coreui.io/vue/docs/forms/floating-labels.html" + }, + "list-group": { + "angular": "https://coreui.io/angular/docs/components/list-group", + "bootstrap": "https://coreui.io/docs/components/list-group/", + "react": "https://coreui.io/react/docs/components/list-group/", + "vue": "https://coreui.io/vue/docs/components/list-group.html" + }, + "modal": { + "angular": "https://coreui.io/angular/docs/components/modal", + "bootstrap": "https://coreui.io/docs/components/modal/", + "react": "https://coreui.io/react/docs/components/modal/", + "vue": "https://coreui.io/vue/docs/components/modal.html" + }, + "navbar": { + "bootstrap": "https://coreui.io/docs/components/navbar/", + "react": "https://coreui.io/react/docs/components/navbar/", + "vue": "https://coreui.io/vue/docs/components/navbar.html" + }, + "navs-tabs": { + "angular": "https://coreui.io/angular/docs/components/nav", + "bootstrap": "https://coreui.io/docs/components/navs-tabs/", + "react": "https://coreui.io/react/docs/components/navs-tabs/", + "vue": "https://coreui.io/vue/docs/components/navs-tabs.html" + }, + "offcanvas": { + "angular": "https://coreui.io/angular/docs/components/offcanvas", + "bootstrap": "https://coreui.io/docs/components/offcanvas/", + "react": "https://coreui.io/react/docs/components/offcanvas/", + "vue": "https://coreui.io/vue/docs/components/offcanvas.html" + }, + "pagination": { + "angular": "https://coreui.io/angular/docs/components/pagination", + "bootstrap": "https://coreui.io/docs/components/pagination/", + "react": "https://coreui.io/react/docs/components/pagination/", + "vue": "https://coreui.io/vue/docs/components/pagination.html" + }, + "placeholder": { + "angular": "https://coreui.io/angular/docs/components/placeholder", + "bootstrap": "https://coreui.io/docs/components/placeholders/", + "react": "https://coreui.io/react/docs/components/placeholder/", + "vue": "https://coreui.io/vue/docs/components/placeholder.html" + }, + "popover": { + "angular": "https://coreui.io/angular/docs/components/popover", + "bootstrap": "https://coreui.io/docs/components/popovers/", + "react": "https://coreui.io/react/docs/components/popover/", + "vue": "https://coreui.io/vue/docs/components/popover.html" + }, + "progress": { + "angular": "https://coreui.io/angular/docs/components/progress", + "bootstrap": "https://coreui.io/docs/components/progress/", + "react": "https://coreui.io/react/docs/components/progress/", + "vue": "https://coreui.io/vue/docs/components/progress.html" + }, + "radio": { + "angular": "https://coreui.io/angular/docs/forms/checks-radios", + "bootstrap": "https://coreui.io/docs/forms/checks-radios/", + "react": "https://coreui.io/react/docs/forms/radio/", + "vue": "https://coreui.io/vue/docs/forms/radio.html" + }, + "range": { + "angular": "https://coreui.io/angular/docs/forms/range", + "bootstrap": "https://coreui.io/docs/forms/range/", + "react": "https://coreui.io/react/docs/forms/range/", + "vue": "https://coreui.io/vue/docs/forms/range.html" + }, + "select": { + "angular": "https://coreui.io/angular/docs/forms/select", + "bootstrap": "https://coreui.io/docs/forms/select/", + "react": "https://coreui.io/react/docs/forms/select/", + "vue": "https://coreui.io/vue/docs/forms/select.html" + }, + "sidebar": { + "angular": "https://coreui.io/angular/docs/components/sidebar", + "bootstrap": "https://coreui.io/docs/components/sidebar/", + "react": "https://coreui.io/react/docs/components/sidebar/", + "vue": "https://coreui.io/vue/docs/components/sidebar.html" + }, + "spinner": { + "angular": "https://coreui.io/angular/docs/components/spinner", + "bootstrap": "https://coreui.io/docs/components/spinners/", + "react": "https://coreui.io/react/docs/components/spinner/", + "vue": "https://coreui.io/vue/docs/components/spinner.html" + }, + "switch": { + "angular": "https://coreui.io/angular/docs/forms/checks-radios", + "bootstrap": "https://coreui.io/docs/forms/checks-radios/", + "react": "https://coreui.io/react/docs/forms/switch/", + "vue": "https://coreui.io/vue/docs/forms/switch.html" + }, + "table": { + "angular": "https://coreui.io/angular/docs/components/table", + "bootstrap": "https://coreui.io/docs/content/tables/", + "react": "https://coreui.io/react/docs/components/table/", + "vue": "https://coreui.io/vue/docs/components/table.html" + }, + "textarea": { + "angular": "https://coreui.io/angular/docs/forms/form-control", + "bootstrap": "https://coreui.io/docs/forms/form-control/", + "react": "https://coreui.io/react/docs/forms/textarea/", + "vue": "https://coreui.io/vue/docs/forms/textarea.html" + }, + "toast": { + "angular": "https://coreui.io/angular/docs/components/toast", + "bootstrap": "https://coreui.io/docs/components/toasts/", + "react": "https://coreui.io/react/docs/components/toast/", + "vue": "https://coreui.io/vue/docs/components/toast.html" + }, + "tooltip": { + "angular": "https://coreui.io/angular/docs/components/tooltip", + "bootstrap": "https://coreui.io/docs/components/tooltips/", + "react": "https://coreui.io/react/docs/components/tooltip/", + "vue": "https://coreui.io/vue/docs/components/tooltip.html" + } +} diff --git a/packages/docs/src/images/gatsby-astronaut.png b/packages/docs/src/images/gatsby-astronaut.png new file mode 100644 index 00000000..da58ece0 Binary files /dev/null and b/packages/docs/src/images/gatsby-astronaut.png differ diff --git a/packages/docs/src/images/gatsby-icon.png b/packages/docs/src/images/gatsby-icon.png new file mode 100644 index 00000000..908bc78a Binary files /dev/null and b/packages/docs/src/images/gatsby-icon.png differ diff --git a/src/docs/index.ts b/packages/docs/src/index.ts similarity index 100% rename from src/docs/index.ts rename to packages/docs/src/index.ts diff --git a/src/docs/nav.tsx b/packages/docs/src/nav.tsx similarity index 64% rename from src/docs/nav.tsx rename to packages/docs/src/nav.tsx index bb0f7d60..d9ea08ee 100644 --- a/src/docs/nav.tsx +++ b/packages/docs/src/nav.tsx @@ -21,6 +21,39 @@ const nav = [ name: 'Introduction', to: '/getting-started/introduction/', }, + { + name: 'Accessibility', + to: '/getting-started/accessibility/', + }, + ], + }, + { + name: 'Customize', + to: '/customize/', + icon: ( + ', + ]} + width={64} + height={64} + /> + ), + items: [ + { + name: 'Sass', + to: '/customize/sass/', + }, + { + name: 'Options', + to: '/customize/options/', + }, + { + name: 'CSS Variables', + to: '/customize/css-variables/', + }, ], }, { @@ -55,7 +88,7 @@ const nav = [ to: '/layout/columns/', }, { - name: 'Gutter', + name: 'Gutters', to: '/layout/gutters/', }, ], @@ -76,28 +109,40 @@ const nav = [ ), items: [ { - name: 'Overview', - to: '/forms/overview/', + name: 'Checkbox', + to: '/forms/checkbox/', }, { - name: 'Form Control', - to: '/forms/form-control/', + name: 'Input', + to: '/forms/input/', }, { - name: 'Select', - to: '/forms/select/', + name: 'Input Mask', + to: '/forms/input-mask/', }, { - name: 'Checks & Radios', - to: '/forms/checks-radios/', + name: 'Input Group', + to: '/forms/input-group/', + }, + { + name: 'Radio', + to: '/forms/radio/', }, { name: 'Range', to: '/forms/range/', }, { - name: 'Input Group', - to: '/forms/input-group/', + name: 'Select', + to: '/forms/select/', + }, + { + name: 'Switch', + to: '/forms/switch/', + }, + { + name: 'Textarea', + to: '/forms/textarea/', }, { name: 'Floating Labels', @@ -168,6 +213,10 @@ const nav = [ name: 'Carousel', to: '/components/carousel/', }, + { + name: 'Chart', + to: '/components/chart/', + }, { name: 'Close Button', to: '/components/close-button/', @@ -188,6 +237,10 @@ const nav = [ name: 'Header', to: '/components/header/', }, + { + name: 'Icon', + to: '/components/icon/', + }, { name: 'Image', to: '/components/image/', @@ -200,14 +253,14 @@ const nav = [ name: 'Modal', to: '/components/modal/', }, - { - name: 'Navs & Tabs', - to: '/components/navs-tabs/', - }, { name: 'Navbar', to: '/components/navbar/', }, + { + name: 'Navs & Tabs', + to: '/components/navs-tabs/', + }, { name: 'Offcanvas', to: '/components/offcanvas/', @@ -217,13 +270,8 @@ const nav = [ to: '/components/pagination/', }, { - name: 'Placeholders', - to: '/components/placeholders/', - disabled: true, - badge: { - color: 'warning', - text: 'WIP v4.1', - }, + name: 'Placeholder', + to: '/components/placeholder/', }, { name: 'Popover', @@ -259,6 +307,47 @@ const nav = [ }, ], }, + { + name: 'Templates', + to: '/templates/', + icon: ( + ', + ]} + width={64} + height={64} + /> + ), + items: [ + { + name: 'Admin & Dashboard', + to: '/templates/admin-dashboard/', + badge: { + color: 'success', + text: 'New', + }, + }, + { + name: 'Download', + to: '/templates/download/', + }, + { + name: 'Installation', + to: '/templates/installation/', + }, + { + name: 'Customize', + to: '/templates/customize/', + }, + { + name: 'Contents', + to: '/templates/contents/', + }, + ], + }, { name: 'Migration', to: '/migration/', diff --git a/src/pages/404.tsx b/packages/docs/src/pages/404.tsx similarity index 73% rename from src/pages/404.tsx rename to packages/docs/src/pages/404.tsx index d8f11ef2..7d15b270 100644 --- a/src/pages/404.tsx +++ b/packages/docs/src/pages/404.tsx @@ -1,20 +1,19 @@ import * as React from 'react' import { graphql, useStaticQuery } from 'gatsby' +import { CButton } from '@coreui/react/src/index' -import DefaultLayout from './../docs/templates/Layout' -import Seo from './../docs/components/Seo' -import { CButton } from '../components/button/CButton' +import Seo from './../components/Seo' const NotFoundPage = () => { const { site } = useStaticQuery(query) const { siteUrl } = site.siteMetadata return ( - + <>

404: Not Found

You just hit a route that doesn't exist... the sadness.

Go to documentation -
+ ) } diff --git a/packages/docs/src/styles/_ads.scss b/packages/docs/src/styles/_ads.scss new file mode 100644 index 00000000..575db8b0 --- /dev/null +++ b/packages/docs/src/styles/_ads.scss @@ -0,0 +1,38 @@ +// stylelint-disable declaration-no-important, selector-max-id + +// +// Carbon ads +// + +#carbonads { + position: static; + display: block; + max-width: 400px; + padding: 15px 15px 15px 160px; + margin: 2rem 0; + overflow: hidden; + @include font-size(.8125rem); + line-height: 1.4; + text-align: left; + background-color: var(--cui-tertiary-bg); + + a { + color: var(--cui-body-color); + text-decoration: none; + } + + @include media-breakpoint-up(sm) { + @include border-radius(.5rem); + } +} + +.carbon-img { + float: left; + margin-left: -145px; +} + +.carbon-poweredby { + display: block; + margin-top: .75rem; + color: var(--cui-body-color) !important; +} diff --git a/src/docs/styles/_anchor.scss b/packages/docs/src/styles/_anchor.scss similarity index 100% rename from src/docs/styles/_anchor.scss rename to packages/docs/src/styles/_anchor.scss diff --git a/packages/docs/src/styles/_callouts.scss b/packages/docs/src/styles/_callouts.scss new file mode 100644 index 00000000..a0dc566c --- /dev/null +++ b/packages/docs/src/styles/_callouts.scss @@ -0,0 +1,39 @@ +// +// Callouts +// + +.docs-callout { + --#{$prefix}link-color-rgb: var(--cd-callout-link); + --#{$prefix}code-color: var(--cd-callout-code-color); + + padding: 1.25rem; + margin-top: 1.25rem; + margin-bottom: 1.25rem; + background-color: var(--cd-callout-bg, var(--cui-gray-100)); + border-left: .25rem solid var(--cd-callout-border, var(--cui-gray-300)); + + h4 { + margin-bottom: .25rem; + } + + > :last-child { + margin-bottom: 0; + } + + + .docs-callout { + margin-top: -.25rem; + } + + .highlight { + background-color: rgba($black, .05); + } +} + +// Variations +@each $variant in $cd-callout-variants { + .docs-callout-#{$variant} { + --cd-callout-color: var(--cui-#{$variant}-text-emphasis); + --cd-callout-bg: rgba(var(--cui-#{$variant}-rgb), .1); + --cd-callout-border: var(--cui-#{$variant}); + } +} diff --git a/packages/docs/src/styles/_component-examples.scss b/packages/docs/src/styles/_component-examples.scss new file mode 100644 index 00000000..84abfc90 --- /dev/null +++ b/packages/docs/src/styles/_component-examples.scss @@ -0,0 +1,426 @@ +// +// Docs examples +// + +.docs-example-snippet { + border: solid var(--cui-border-color); + border-width: 1px 0; + + @include media-breakpoint-up(md) { + border-width: 1px; + } +} + +.docs-example { + --cd-example-padding: 1rem; + + position: relative; + padding: var(--cd-example-padding); + margin: 0 ($cd-gutter-x * -.5); + border: solid var(--cui-border-color); + border-width: 1px 0; + @include clearfix(); + + @include media-breakpoint-up(md) { + --cd-example-padding: 1.5rem; + + margin-right: 0; + margin-left: 0; + border-width: 1px; + @include border-top-radius(var(--cui-border-radius)); + } + + + .docs-code-snippet { + @include border-top-radius(0); + border: solid var(--cui-border-color); + border-width: 0 1px 1px; + } + + + p { + margin-top: 2rem; + } + + > .form-control { + + .form-control { + margin-top: .5rem; + } + } + + > .nav + .nav, + > .alert + .alert, + > .navbar + .navbar, + > .progress + .progress { + margin-top: $spacer; + } + + > .dropdown-menu { + position: static; + display: block; + } + + > :last-child, + > nav:last-child .breadcrumb { + margin-bottom: 0; + } + + > hr:last-child { + margin-bottom: $spacer; + } + + // Images + > svg + svg, + > img + img { + margin-left: .5rem; + } + + // Buttons + > .btn, + > .btn-group { + margin: .25rem .125rem; + } + > .btn-toolbar + .btn-toolbar { + margin-top: .5rem; + } + + // List groups + > .list-group { + max-width: 400px; + } + + > [class*="list-group-horizontal"] { + max-width: 100%; + } + + // Navbars + .fixed-top, + .sticky-top { + position: static; + margin: calc(var(--cd-example-padding) * -1) calc(var(--cd-example-padding) * -1) var(--cd-example-padding); // stylelint-disable-line function-disallowed-list + } + + .fixed-bottom, + .sticky-bottom { + position: static; + margin: var(--cd-example-padding) calc(var(--cd-example-padding) * -1) calc(var(--cd-example-padding) * -1); // stylelint-disable-line function-disallowed-list + + } + + // Pagination + .pagination { + margin-bottom: 0; + } + + // Spinners + > .spinner-grow + .spinner-border, + > .spinner-border + .spinner-grow, + > .spinner-border + .spinner-border, + > .spinner-grow + .spinner-grow { + margin-left: .25rem; + } +} + +// +// Grid examples +// + +.docs-example-row [class^="col"], +.docs-example-cols [class^="col"] > *, +.docs-example-cssgrid [class*="grid"] > * { + padding-top: .75rem; + padding-bottom: .75rem; + background-color: rgba(var(--cd-violet-rgb), .15); + border: 1px solid rgba(var(--cd-violet-rgb), .3); +} + +.docs-example-row .row + .row, +.docs-example-cssgrid .grid + .grid { + margin-top: 1rem; +} + +.docs-example-row-flex-cols .row { + min-height: 10rem; + background-color: rgba(var(--cd-violet-rgb), .15); +} + +.docs-example-flex div:not(.vr) { + background-color: rgba(var(--cd-violet-rgb), .15); + border: 1px solid rgba(var(--cd-violet-rgb), .3); +} + +// Grid mixins +.example-container { + width: 800px; + @include make-container(); +} + +.example-row { + @include make-row(); +} + +.example-content-main { + @include make-col-ready(); + + @include media-breakpoint-up(sm) { + @include make-col(6); + } + + @include media-breakpoint-up(lg) { + @include make-col(8); + } +} + +.example-content-secondary { + @include make-col-ready(); + + @include media-breakpoint-up(sm) { + @include make-col(6); + } + + @include media-breakpoint-up(lg) { + @include make-col(4); + } +} + +// Ratio helpers +.docs-example-ratios { + .ratio { + display: inline-block; + width: 10rem; + color: var(--cui-secondary-color); + background-color: var(--cui-tertiary-bg); + border: var(--cui-border-width) solid var(--cui-border-color); + + > div { + display: flex; + align-items: center; + justify-content: center; + } + } +} +.docs-example-ratios-breakpoint { + .ratio-4x3 { + width: 16rem; + + @include media-breakpoint-up(md) { + --cui-aspect-ratio: 50%; // 2x1 + } + } +} + +.docs-example-offcanvas { + .offcanvas { + position: static; + display: block; + height: 200px; + visibility: visible; + transform: translate(0); + } +} + +// Tooltips +.tooltip-demo { + a { + white-space: nowrap; + } + + .btn { + margin: .25rem .125rem; + } +} + +// scss-docs-start custom-tooltip +.custom-tooltip { + --cui-tooltip-bg: var(--cui-primary); +} +// scss-docs-end custom-tooltip + +// scss-docs-start custom-popovers +.custom-popover { + --cui-popover-max-width: 200px; + --cui-popover-border-color: var(--cui-primary); + --cui-popover-header-bg: var(--cui-primary); + --cui-popover-header-color: var(--cui-white); + --cui-popover-body-padding-x: 1rem; + --cui-popover-body-padding-y: .5rem; +} +// scss-docs-end custom-popovers + +// Scrollspy demo on fixed height div +.scrollspy-example { + height: 200px; + margin-top: .5rem; + overflow: auto; +} + +.scrollspy-example-2 { + height: 350px; + overflow: auto; +} + +.simple-list-example-scrollspy { + .active { + background-color: rgba(var(--cd-violet-rgb), .15); + } +} + +.docs-example-border-utils { + [class^="border"] { + display: inline-block; + width: 5rem; + height: 5rem; + margin: .25rem; + background-color: var(--cui-tertiary-bg); + } +} + +.docs-example-rounded-utils { + [class*="rounded"] { + margin: .25rem; + } +} + +.docs-example-position-utils { + position: relative; + padding: 2rem; + + .position-relative { + height: 200px; + background-color: var(--cui-tertiary-bg); + } + + .position-absolute { + width: 2rem; + height: 2rem; + background-color: var(--cui-body-color); + @include border-radius(); + } +} + +.docs-example-position-examples { + &::after { + content: none; + } +} + +// Placeholders +.docs-example-placeholder-cards { + &::after { + display: none; + } + + .card { + width: 18rem; + } +} + +// Toasts +.docs-example-toasts { + min-height: 240px; +} + +.docs-example-zindex-levels { + min-height: 15rem; + + > div { + color: var(--cui-body-bg); + background-color: var(--cd-violet); + border: 1px solid var(--cd-purple); + + > span { + position: absolute; + right: 5px; + bottom: 0; + } + } + + > :nth-child(2) { + top: 3rem; + left: 3rem; + } + > :nth-child(3) { + top: 4.5rem; + left: 4.5rem; + } + > :nth-child(4) { + top: 6rem; + left: 6rem; + } + > :nth-child(5) { + top: 7.5rem; + left: 7.5rem; + } +} + +// +// Code snippets +// + +.highlight { + position: relative; + padding: .75rem ($cd-gutter-x * .5); + margin-bottom: 1rem; + border: 1px solid var(--cui-border-color); + background-color: var(--cd-pre-bg); + + @include media-breakpoint-up(md) { + padding: .75rem 1.25rem; + @include border-radius(var(--cui-border-radius)); + } + + pre { + padding: .25rem 0 .875rem; + margin-top: .8125rem; + margin-right: 1.875rem; + margin-bottom: 0; + overflow: overlay; + white-space: pre; + background-color: transparent; + border: 0; + } + + pre code { + @include font-size(inherit); + color: var(--cui-body-color); // Effectively the base text color + word-wrap: normal; + } +} + +.docs-code-snippet { + margin: 0 ($cd-gutter-x * -.5) $spacer; + + .highlight { + margin-bottom: 0; + } + + .docs-example ~ .highlight { + border: solid var(--cui-border-color); + border-width: 1px 0 0; + @include border-top-radius(0); + } + + .docs-example { + margin: 0; + border: 0; + } + + @include media-breakpoint-up(md) { + margin-right: 0; + margin-left: 0; + @include border-radius($border-radius); + } +} + +.highlight-toolbar { + background-color: var(--cd-pre-bg); +} + +.docs-scss-docs { + .highlight-toolbar { + @include border-top-radius(calc(var(--cui-border-radius) + 1px)); + } +} + +.docs-example + .highlight { + border-top-width: 0; + @include border-top-radius(0); +} diff --git a/packages/docs/src/styles/_footer.scss b/packages/docs/src/styles/_footer.scss new file mode 100644 index 00000000..7544a17b --- /dev/null +++ b/packages/docs/src/styles/_footer.scss @@ -0,0 +1,19 @@ +// +// Footer +// + +.footer { + --cui-footer-bg: var(--cui-tertiary-bg); + @include font-size(.875rem); + + a { + color: var(--#{$prefix}tertiary-color); + text-decoration: none; + + &:hover, + &:focus { + color: var(--cui-link-hover-color); + text-decoration: underline; + } + } +} diff --git a/src/docs/styles/_layout.scss b/packages/docs/src/styles/_layout.scss similarity index 100% rename from src/docs/styles/_layout.scss rename to packages/docs/src/styles/_layout.scss diff --git a/src/docs/styles/_prism.scss b/packages/docs/src/styles/_prism.scss similarity index 52% rename from src/docs/styles/_prism.scss rename to packages/docs/src/styles/_prism.scss index 69270e30..21bfa2c9 100644 --- a/src/docs/styles/_prism.scss +++ b/packages/docs/src/styles/_prism.scss @@ -6,18 +6,32 @@ https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+cli * @author Rose Pritchard */ +:root { + // --base00: #fff; + // --base01: #f5f5f5; + --base02: #c8c8fa; + --base03: #565c64; + --base04: #666; + --base05: #333; + --base06: #fff; + --base07: #{$teal-700}; // #9a6700 + --base08: #{mix($red-500, $red-600, 50%)}; // #bc4c00 + --base09: #{$cyan-700}; // #087990 + --base0A: #{$purple-500}; // #795da3 + --base0B: #{$blue-700}; // #183691 + --base0C: #{$blue-700}; // #183691 + --base0D: #{$purple-500}; // #795da3 + --base0E: #{$pink-600}; // #a71d5d + --base0F: #333; +} + code[class*='language-'], pre[class*='language-'] { - color: #ccc; background: none; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-family: var(--cui-font-monospace); font-size: .875em; text-align: left; white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; -moz-tab-size: 4; -o-tab-size: 4; @@ -29,23 +43,9 @@ pre[class*='language-'] { hyphens: none; } -/* Code blocks */ -pre[class*='language-'] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; -} - -:not(pre) > code[class*='language-'], -pre[class*='language-'] { - background: #2d2d2d; -} - -/* Inline code */ -:not(pre) > code[class*='language-'] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; +pre[class*='language-']:not(.language-sass):not(.language-scss):not(.language-text):not(.language-css) { + overflow: scroll; + max-height: 500px; } .token.comment, @@ -53,35 +53,42 @@ pre[class*='language-'] { .token.prolog, .token.doctype, .token.cdata { - color: #999; + color: var(--base03); } -.token.punctuation { - color: #ccc; +.token.tag { + color: var(--base08); } -.token.tag, .token.attr-name, .token.namespace, .token.deleted { - color: #e2777a; + color: var(--base0A); +} + +.token.punctuation { + color: var(--base05); } .token.function-name { - color: #6196cc; + color: var(--base0A); } .token.boolean, .token.number, .token.function { - color: #f08d49; + color: var(--base09); } -.token.property, .token.class-name, +.token.maybe-class-name { + color: var(--base08); +} + +.token.property, .token.constant, .token.symbol { - color: #f8c555; + color: var(--base0A); } .token.selector, @@ -89,7 +96,7 @@ pre[class*='language-'] { .token.atrule, .token.keyword, .token.builtin { - color: #cc99cd; + color: var(--base0E); } .token.string, @@ -97,13 +104,13 @@ pre[class*='language-'] { .token.attr-value, .token.regex, .token.variable { - color: #7ec699; + color: var(--base0C); } .token.operator, .token.entity, .token.url { - color: #67cdcc; + color: var(--base05); } .token.important, @@ -122,22 +129,17 @@ pre[class*='language-'] { color: green; } -.line-no { - position: relative; - display: inline-block; - text-align: center; - width: 4em; - margin-right: 1em; - margin-left: -1em; - user-select: none; - color: #9e9e9e; - - &:after { - position: absolute; - top: -50%; - right: 0; - content: ""; - height: 200%; - border-right: 1px solid rgba(0, 0, 0, 0.66); +.language-bash, +.language-sh { + .token-line::before { + color: var(--base03); + content: "$ "; + user-select: none; } +} + +.language-powershell::before { + color: var(--base0C); + content: "PM> "; + user-select: none; } \ No newline at end of file diff --git a/packages/docs/src/styles/_scrolling.scss b/packages/docs/src/styles/_scrolling.scss new file mode 100644 index 00000000..20179600 --- /dev/null +++ b/packages/docs/src/styles/_scrolling.scss @@ -0,0 +1,13 @@ +// When navigating with the keyboard, prevent focus from landing behind the sticky header + +main { + a, + button, + h2, + h3, + h4, + [tabindex="0"] { + scroll-margin-top: 80px; + scroll-margin-bottom: 100px; + } +} diff --git a/packages/docs/src/styles/_search.scss b/packages/docs/src/styles/_search.scss new file mode 100644 index 00000000..8b19708c --- /dev/null +++ b/packages/docs/src/styles/_search.scss @@ -0,0 +1,132 @@ +// stylelint-disable selector-class-pattern + +:root { + --docsearch-primary-color: var(--cui-primary); + --docsearch-logo-color: var(--cui-primary); +} + +.DocSearch-Container { + --docsearch-muted-color: var(--cui-secondary-color); + --docsearch-hit-shadow: none; + + z-index: 2000; // Make sure to be over all components showcased in the documentation + cursor: auto; // Needed because of [role="button"] in Algolia search modal. Remove once https://github.com/algolia/docsearch/issues/1370 is tackled. + + @include media-breakpoint-up(lg) { + padding-top: 4rem; + } +} + +.DocSearch-Button { + --docsearch-searchbox-background: #{rgba($black, .1)}; + // --docsearch-searchbox-color: #{$white}; + --docsearch-searchbox-focus-background: #{rgba($black, .25)}; + // --docsearch-searchbox-shadow: #{0 0 0 .25rem rgba($bd-accent, .4)}; + // --docsearch-text-color: #{$white}; + // --docsearch-muted-color: #{rgba($white, .65)}; + + min-width: 200px; + min-height: 38px; + font-family: $input-font-family; + font-weight: $input-font-weight; + line-height: $input-line-height; + @include font-size($input-font-size); + color: $input-color; + background-color: $input-bg; + background-clip: padding-box; + border: $input-border-width solid $input-border-color; + + // Note: This has no effect on `s in CSS. + @include border-radius($btn-border-radius); + + @include box-shadow($input-box-shadow); + @include transition($input-transition); + + &:focus { + color: $input-focus-color; + background-color: $input-focus-bg; + border-color: $input-focus-border-color; + outline: 0; + @if $enable-shadows { + @include box-shadow($input-box-shadow, $input-focus-box-shadow); + } @else { + // Avoid using mixin so we can pass custom focus shadow properly + box-shadow: $input-focus-box-shadow; + } + } + + &:hover:not(:disabled):not([readonly])::file-selector-button { + background-color: $form-file-button-hover-bg; + } + + .DocSearch-Search-Icon { + opacity: .65; + } +} + + +.DocSearch-Button-Keys { + min-width: 0; + padding: 0 .25rem; + background: rgba($black, .125); + @include border-radius(.25rem); +} + +.DocSearch-Button-Key { + top: 0; + width: auto; + height: 1.5rem; + padding: 0 .125rem; + margin-right: 0; + font-size: .875rem; + background: none; + box-shadow: none; +} + +.DocSearch-Commands-Key { + padding-left: 1px; + font-size: .875rem; + background-color: rgba($black, .1); + background-image: none; + box-shadow: none; +} + +.DocSearch-Form { + @include border-radius(var(--cui-border-radius)); +} + +.DocSearch-Hits { + mark { + padding: 0; + } +} + +.DocSearch-Hit { + padding-bottom: 0; + @include border-radius(0); + + a { + @include border-radius(0); + border: solid var(--cui-border-color); + border-width: 0 1px 1px; + } + + &:first-child a { + @include border-top-radius(var(--cui-border-radius)); + border-top-width: 1px; + } + &:last-child a { + @include border-bottom-radius(var(--cui-border-radius)); + } +} + +.DocSearch-Hit-icon { + display: flex; + align-items: center; +} + +// Fix --docsearch-logo-color that doesn't do anything +.DocSearch-Logo svg .cls-1, +.DocSearch-Logo svg .cls-2 { + fill: var(--docsearch-logo-color); +} diff --git a/packages/docs/src/styles/_sidebar.scss b/packages/docs/src/styles/_sidebar.scss new file mode 100644 index 00000000..0c32f102 --- /dev/null +++ b/packages/docs/src/styles/_sidebar.scss @@ -0,0 +1,16 @@ +.docs-sidebar { + --cui-sidebar-bg: var(--cui-tertiary-bg); + --cui-sidebar-brand-bg: transparent; + --cui-sidebar-brand-color: var(--cui-body-color); + --cui-sidebar-nav-link-color: var(--cui-body-color); + --cui-sidebar-nav-link-active-bg: transparent; + --cui-sidebar-nav-link-active-color: var(--cui-primary); + --cui-sidebar-nav-link-hover-bg: transparent; + --cui-sidebar-nav-link-hover-color: var(--cui-primary); + --cui-sidebar-nav-group-bg: transparent; + --cui-sidebar-nav-group-toggle-show-color: var(--cui-primary); + + .nav-group-items { + --cui-sidebar-nav-link-color: var(--cui-body-color); + } +} diff --git a/src/docs/styles/_table-api.scss b/packages/docs/src/styles/_table-api.scss similarity index 86% rename from src/docs/styles/_table-api.scss rename to packages/docs/src/styles/_table-api.scss index dbc1e986..9e430366 100644 --- a/src/docs/styles/_table-api.scss +++ b/packages/docs/src/styles/_table-api.scss @@ -1,5 +1,4 @@ .table-api { - --cui-table-striped-bg: #{rgba(#f0f4f7, .25)}; tr td { padding-top: 1rem; padding-bottom: 1rem; diff --git a/src/docs/styles/_toc.scss b/packages/docs/src/styles/_toc.scss similarity index 100% rename from src/docs/styles/_toc.scss rename to packages/docs/src/styles/_toc.scss diff --git a/packages/docs/src/styles/_variables.scss b/packages/docs/src/styles/_variables.scss new file mode 100644 index 00000000..f60159f9 --- /dev/null +++ b/packages/docs/src/styles/_variables.scss @@ -0,0 +1,26 @@ +// stylelint-disable scss/dollar-variable-default + +// Local docs variables +$cd-purple: #4c0bce; +$cd-violet: lighten(saturate($cd-purple, 5%), 15%); // stylelint-disable-line function-disallowed-list +$cd-accent: #ffe484; + +$cd-gutter-x: 3rem; +$cd-callout-variants: info, warning, danger !default; + +:root { + --cui-tertiary-bg: #f0f4f7; + --cd-purple: #{$cd-purple}; + --cd-violet: #{$cd-violet}; + --cd-accent: #{$cd-accent}; + --cd-violet-rgb: #{to-rgb($cd-violet)}; + --cd-accent-rgb: #{to-rgb($cd-accent)}; + --cd-pink-rgb: #{to-rgb($pink-500)}; + --cd-teal-rgb: #{to-rgb($teal-500)}; + --cd-violet-bg: var(--cd-violet); + --cd-toc-color: var(--cd-violet); + --cd-sidebar-link-bg: rgba(var(--cd-violet-rgb), .1); + --cd-callout-link: #{to-rgb($blue-600)}; + --cd-callout-code-color: #{$pink-600}; + --cd-pre-bg: var(--cui-tertiary-bg); +} diff --git a/src/docs/styles/styles.scss b/packages/docs/src/styles/styles.scss similarity index 67% rename from src/docs/styles/styles.scss rename to packages/docs/src/styles/styles.scss index c18dff95..d90d130a 100644 --- a/src/docs/styles/styles.scss +++ b/packages/docs/src/styles/styles.scss @@ -2,13 +2,17 @@ // Import Chart.js custom tooltips styles @import "@coreui/chartjs/scss/coreui-chartjs"; -@import "prismjs/themes/prism-solarizedlight.css"; +@import "variables"; +@import "ads"; @import "anchor"; -@import "example"; +@import "callouts"; +@import "component-examples"; @import "footer"; @import "layout"; @import "prism"; +@import "scrolling"; +@import "search"; @import "sidebar"; @import "table-api"; @import "toc"; diff --git a/packages/docs/src/templates/DefaultLayout.tsx b/packages/docs/src/templates/DefaultLayout.tsx new file mode 100644 index 00000000..643cc254 --- /dev/null +++ b/packages/docs/src/templates/DefaultLayout.tsx @@ -0,0 +1,75 @@ +import React, { FC, useState } from 'react' +import { Footer, Header, Sidebar, Seo } from '../components' +import { CContainer } from '@coreui/react/src/' +import DocsLayout from './DocsLayout' + +import { AppContext } from '../AppContext' +import { Script } from 'gatsby' + +interface DefaultLayoutProps { + children: any // eslint-disable-line @typescript-eslint/no-explicit-any + data: any // eslint-disable-line @typescript-eslint/no-explicit-any + pageContext: any // eslint-disable-line @typescript-eslint/no-explicit-any + path: any // eslint-disable-line @typescript-eslint/no-explicit-any +} + +const DefaultLayout: FC = ({ children, data, pageContext, path }) => { + const [sidebarVisible, setSidebarVisible] = useState() + + const title = pageContext.frontmatter ? pageContext.frontmatter.title : '' + const description = pageContext.frontmatter ? pageContext.frontmatter.description : '' + const name = pageContext.frontmatter ? pageContext.frontmatter.name : '' + const route = pageContext.frontmatter ? pageContext.frontmatter.route : '' + + return ( + + + +
+
+
+ {path === '/404/' ? ( + {children} + ) : ( + + {children} + + )} +
+
+
+ +
+ ) +} + +DefaultLayout.displayName = 'DefaultLayout' + +export default DefaultLayout diff --git a/packages/docs/src/templates/DocsLayout.tsx b/packages/docs/src/templates/DocsLayout.tsx new file mode 100644 index 00000000..8c260651 --- /dev/null +++ b/packages/docs/src/templates/DocsLayout.tsx @@ -0,0 +1,88 @@ +import React, { FC } from 'react' +import { Ads, Banner, Seo, Toc } from '../components' +import { CCol, CContainer, CRow } from '@coreui/react/src/' + +interface DocsLayoutProps { + children: any // eslint-disable-line @typescript-eslint/no-explicit-any + data: any // eslint-disable-line @typescript-eslint/no-explicit-any + pageContext: any // eslint-disable-line @typescript-eslint/no-explicit-any +} + +// @ts-expect-error json file +import jsonData from './../data/other_frameworks.json' + +const humanize = (text: string) => { + const string = text + .split('-') + .reduce( + (accumulator, currentValue) => + accumulator + ' ' + currentValue[0].toUpperCase() + currentValue.slice(1), + ) + return string[0].toUpperCase() + string.slice(1) +} + +const DocsLayout: FC = ({ children, data, pageContext }) => { + const title = pageContext.frontmatter ? pageContext.frontmatter.title : '' + const description = pageContext.frontmatter ? pageContext.frontmatter.description : '' + const name = pageContext.frontmatter ? pageContext.frontmatter.name : '' + const other_frameworks = pageContext.frontmatter ? pageContext.frontmatter.other_frameworks : '' + const pro_component = pageContext.frontmatter ? pageContext.frontmatter.pro_component : '' + const route = pageContext.frontmatter ? pageContext.frontmatter.route : '' + const frameworks = other_frameworks ? other_frameworks.split(', ') : false + const otherFrameworks = JSON.parse(JSON.stringify(jsonData)) + + return ( + <> + + +
+ + + +

{title}

+

{description}

+ + {frameworks && ( + <> +

Other frameworks

+

+ CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and + Vue components. To learn more please visit the following pages. +

+ + + )} + {children} +
+ {data && data.mdx && ( + + + + )} +
+
+
+ + ) +} + +DocsLayout.displayName = 'DocsLayout' + +export default DocsLayout diff --git a/packages/docs/src/templates/MdxLayout.tsx b/packages/docs/src/templates/MdxLayout.tsx new file mode 100644 index 00000000..cfe62f86 --- /dev/null +++ b/packages/docs/src/templates/MdxLayout.tsx @@ -0,0 +1,91 @@ +import React, { FC } from 'react' +import { graphql } from 'gatsby' +import { MDXProvider } from '@mdx-js/react' +import { CBadge, CTable } from '@coreui/react/src/index' +import { Callout, CodeBlock, Example, ScssDocs } from '../components' + +interface MdxLayoutProps { + data: any // eslint-disable-line @typescript-eslint/no-explicit-any + children: any // eslint-disable-line @typescript-eslint/no-explicit-any +} + +const MdxLayout: FC = ({ children }) => { + return ( + , + // eslint-disable-next-line @typescript-eslint/no-explicit-any + strong: (props: any) => { + if (props.children.type == 'em') { + const color = props.children.props.children.includes('Deprecated') + ? 'warning' + : 'primary' + return ( + <> +
+ + + ) + } else { + return {props.children} + } + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + pre: (props: any) => , + // eslint-disable-next-line @typescript-eslint/no-explicit-any + table: (props: any) => { + // TODO: find better soultion + const isApiTable = + props.children[0].props.children.props.children[0].props.children && + props.children[0].props.children.props.children[0].props.children.includes('Property') + return ( + + ) + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Callout: (props: any) => { + const { children, title, ...rest } = props + return ( + + {title &&
{title}
} + {children} +
+ ) + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Example: (props: any) => { + const { children, ...rest } = props + return ( + + {React.Children.map(children, (child) => { + if (React.isValidElement(child)) { + return React.cloneElement(child) + } + return + })} + + ) + }, + }} + > + {children} +
+ ) +} + +MdxLayout.displayName = 'MdxLayout' + +export default MdxLayout + +export const pageQuery = graphql` + query BlogPostQuery($id: String) { + mdx(id: { eq: $id }) { + tableOfContents(maxDepth: 3) + } + } +` diff --git a/static/index.html b/packages/docs/static/index.html similarity index 100% rename from static/index.html rename to packages/docs/static/index.html diff --git a/src/docs/plugins/gatsby-remark-import-markdown/index.js b/packages/gatsby-remark-import-markdown/index.js similarity index 60% rename from src/docs/plugins/gatsby-remark-import-markdown/index.js rename to packages/gatsby-remark-import-markdown/index.js index 4f04c824..398ce941 100755 --- a/src/docs/plugins/gatsby-remark-import-markdown/index.js +++ b/packages/gatsby-remark-import-markdown/index.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ 'use strict' const fs = require('fs') @@ -5,13 +6,11 @@ const normalizePath = require('normalize-path') const visit = require('unist-util-visit') const unified = require('unified') const parse = require('remark-parse') +const remarkGfm = require('remark-gfm') const html = require('remark-html') -module.exports = function (_ref, _temp) { - var markdownAST = _ref.markdownAST - - let _ref2 = _temp === void 0 ? {} : _temp, - directory = _ref2.directory +module.exports = ({ markdownAST }, pluginOptions = {}) => { + const directory = pluginOptions.directory if (!directory) { throw Error(`Required option \"directory\" not specified`) @@ -21,7 +20,7 @@ module.exports = function (_ref, _temp) { directory += '/' } - visit(markdownAST, 'inlineCode', function (node, index, parent) { + visit(markdownAST, 'inlineCode', (node, _, parent) => { const value = node.value if (value.startsWith('markdown:')) { @@ -33,16 +32,21 @@ module.exports = function (_ref, _temp) { } const code = fs.readFileSync(path, 'utf8') - - const markdown = unified().use(parse).use(html, {sanitize: false}) - - try { - parent.value = `
${markdown.processSync(code)}
` - parent.type = 'html' - } catch (e) { - throw Error(`${e.message} \nFile: ${file}`) - } + const markdown = unified() + .use(parse) + .use(remarkGfm) + .use(html, { sanitize: false }) + .parse(code) + + parent.type = 'div' + parent.children = [] + + markdown.children.forEach((child) => { + delete child.position + parent.children.push(child) + }) } }) + return markdownAST } diff --git a/packages/gatsby-remark-import-markdown/package.json b/packages/gatsby-remark-import-markdown/package.json new file mode 100644 index 00000000..84f9c71d --- /dev/null +++ b/packages/gatsby-remark-import-markdown/package.json @@ -0,0 +1,31 @@ +{ + "name": "gatsby-remark-import-markdown", + "license": "MIT", + "version": "1.0.0", + "author": "Łukasz Holeczek ", + "repository": "", + "keywords": [ + "markdown", + "embed", + "gatsby", + "gatsby-plugin", + "remark" + ], + "description": "Gatsby plugin to embed markdown fragments within markdown", + "dependencies": { + "normalize-path": "^2.1.1", + "unist-util-map": "^1.0.3", + "unist-util-visit": "^2.0.3", + "unified": "^9.2.1", + "remark-gfm": "^1.0.0", + "remark-html": "^13.0.2", + "remark-parse": "^9.0.0", + "remark-rehype": "^8.1.0", + "rehype-stringify": "^8.0.0" + }, + "scripts": {}, + "peerDependencies": { + "gatsby": ">=5.0.0" + }, + "main": "index.js" +} diff --git a/packages/gatsby-remark-jsx-preview/index.js b/packages/gatsby-remark-jsx-preview/index.js new file mode 100755 index 00000000..f2219dba --- /dev/null +++ b/packages/gatsby-remark-jsx-preview/index.js @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +'use strict' + +const acorn = require('acorn') +const fromMarkdown = require('mdast-util-from-markdown') +const mdxJsx = require('mdast-util-mdx-jsx') +const mdxMd = require('micromark-extension-mdx-md') +const syntax = require('micromark-extension-mdx-jsx') +const visit = require('unist-util-visit') + +module.exports = ({ markdownAST }) => { + visit(markdownAST, 'code', (node) => { + if (node.meta && node.meta.includes('preview')) { + const value = node.value + const className = /className="(.*)"/.test(node.meta) ? RegExp.$1 : '' + const tree = fromMarkdown(value.replace(/(\r\n|\n|\r)/gm, ''), { + extensions: [syntax({ acorn: acorn, addResult: true }), mdxMd], + mdastExtensions: [mdxJsx.fromMarkdown], + }) + + delete node.value + delete node.position + delete node.lang + delete node.meta + + node.type = 'div' + node.data = { hProperties: { className: ['docs-example-snippet docs-code-snippet'] } } + node.children = [ + { + type: 'mdxJsxFlowElement', + name: 'Example', + attributes: [{ type: 'mdxJsxAttribute', name: 'className', value: className }], + children: + tree.children[0].type === 'paragraph' + ? tree.children[0].children.map((child) => child) + : tree.children.map((child) => child), + }, + { + type: 'code', + lang: 'jsx', + value: value, + }, + ] + } + }) + + return markdownAST +} diff --git a/packages/gatsby-remark-jsx-preview/package.json b/packages/gatsby-remark-jsx-preview/package.json new file mode 100644 index 00000000..f21a9d2f --- /dev/null +++ b/packages/gatsby-remark-jsx-preview/package.json @@ -0,0 +1,26 @@ +{ + "name": "gatsby-remark-jsx-preview", + "license": "MIT", + "version": "1.0.0", + "author": "Łukasz Holeczek ", + "repository": "", + "keywords": [ + "code", + "jsx", + "gatsby", + "gatsby-plugin", + "remark" + ], + "description": "Gatsby plugin to embed jsx code preview", + "dependencies": { + "mdast-util-from-markdown": "^0.8.5", + "micromark-extension-mdx-jsx": "^0.3.3", + "micromark-extension-mdx-md": "^0.1.1", + "mdast-util-mdx-jsx": "^0.1.4", + "unist-util-visit": "^2.0.3" + }, + "peerDependencies": { + "gatsby": ">=5.0.0" + }, + "main": "index.js" +} diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index 08896aa5..00000000 --- a/rollup.config.js +++ /dev/null @@ -1,33 +0,0 @@ -import commonjs from '@rollup/plugin-commonjs' -import external from 'rollup-plugin-peer-deps-external' -import resolve from '@rollup/plugin-node-resolve' -import typescript from '@rollup/plugin-typescript' -import pkg from './package.json' -export default { - input: 'src/index.ts', - output: [ - { - file: pkg.main, - format: 'cjs', - exports: 'named', - sourcemap: true, - }, - { - file: pkg.module, - format: 'es', - exports: 'named', - sourcemap: true, - }, - ], - plugins: [ - external(), - resolve(), - typescript({ - exclude: ['**/__tests__/**'], - tsconfig: './tsconfig.json', - }), - commonjs({ - include: ['node_modules/**'], - }), - ], -} diff --git a/src/components/Types.tsx b/src/components/Types.tsx deleted file mode 100644 index 93270c3d..00000000 --- a/src/components/Types.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import PropTypes from 'prop-types' - -export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - -export type Colors = - | 'primary' - | 'secondary' - | 'success' - | 'danger' - | 'warning' - | 'info' - | 'dark' - | 'light' - | string - -export const colorPropType = PropTypes.oneOfType([ - PropTypes.oneOf([ - 'primary', - 'secondary', - 'success', - 'danger', - 'warning', - 'info', - 'dark', - 'light', - ]), - PropTypes.string, -]) - -export type Placements = - | 'auto' - | 'auto-start' - | 'auto-end' - | 'top-end' - | 'top' - | 'top-start' - | 'bottom-end' - | 'bottom' - | 'bottom-start' - | 'right-start' - | 'right' - | 'right-end' - | 'left-start' - | 'left' - | 'left-end' - | undefined - -export const placementPropType = PropTypes.oneOf([ - 'auto', - 'auto-start', - 'auto-end', - 'top-end', - 'top', - 'top-start', - 'bottom-end', - 'bottom', - 'bottom-start', - 'right-start', - 'right', - 'right-end', - 'left-start', - 'left', - 'left-end', -]) - -export type Shapes = - | 'rounded' - | 'rounded-top' - | 'rounded-end' - | 'rounded-bottom' - | 'rounded-start' - | 'rounded-circle' - | 'rounded-pill' - | 'rounded-0' - | 'rounded-1' - | 'rounded-2' - | 'rounded-3' - | string - -export const shapePropType = PropTypes.oneOfType([ - PropTypes.oneOf([ - 'rounded', - 'rounded-top', - 'rounded-end', - 'rounded-bottom', - 'rounded-start', - 'rounded-circle', - 'rounded-pill', - 'rounded-0', - 'rounded-1', - 'rounded-2', - 'rounded-3', - ]), - PropTypes.string, -]) - -export type TextColors = - | Colors - | 'white' - | 'muted' - | 'high-emphasis' - | 'medium-emphasis' - | 'disabled' - | 'high-emphasis-inverse' - | 'medium-emphasis-inverse' - | 'disabled-inverse' - | string - -export const textColorsPropType = PropTypes.oneOfType([ - colorPropType, - PropTypes.oneOf(['white', 'muted']), - PropTypes.string, -]) - -export type Triggers = 'hover' | 'focus' | 'click' - -export const triggerPropType = PropTypes.oneOf(['hover', 'focus', 'click']) diff --git a/src/components/accordion/CAccordionCollapse.tsx b/src/components/accordion/CAccordionCollapse.tsx deleted file mode 100644 index bf08ac1c..00000000 --- a/src/components/accordion/CAccordionCollapse.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React, { forwardRef } from 'react' -import PropTypes from 'prop-types' -import { CCollapse, CCollapseProps } from '../collapse/CCollapse' - -export const CAccordionCollapse = forwardRef( - ({ children, ...props }, ref) => { - return ( - - {children} - - ) - }, -) - -CAccordionCollapse.propTypes = { - children: PropTypes.node, -} - -CAccordionCollapse.displayName = 'CAccordionCollapse' diff --git a/src/components/accordion/__tests__/CAccordionCollapse.spec.tsx b/src/components/accordion/__tests__/CAccordionCollapse.spec.tsx deleted file mode 100644 index 60908759..00000000 --- a/src/components/accordion/__tests__/CAccordionCollapse.spec.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom/extend-expect' -import { CAccordionCollapse } from '../../../index' - -test('loads and displays CAccordionCollapse component', async () => { - const { container } = render(Test) - expect(container.firstChild).toHaveClass('accordion-collapse') - expect(container).toMatchSnapshot() -}) diff --git a/src/components/accordion/__tests__/__snapshots__/CAccordionCollapse.spec.tsx.snap b/src/components/accordion/__tests__/__snapshots__/CAccordionCollapse.spec.tsx.snap deleted file mode 100644 index 52fca839..00000000 --- a/src/components/accordion/__tests__/__snapshots__/CAccordionCollapse.spec.tsx.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`loads and displays CAccordionCollapse component 1`] = ` -
-
- Test -
-
-`; diff --git a/src/components/dropdown/CDropdown.tsx b/src/components/dropdown/CDropdown.tsx deleted file mode 100644 index e78e9a99..00000000 --- a/src/components/dropdown/CDropdown.tsx +++ /dev/null @@ -1,217 +0,0 @@ -import React, { - createContext, - ElementType, - forwardRef, - HTMLAttributes, - useEffect, - useRef, - useState, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Manager } from 'react-popper' - -import { Placements, placementPropType } from '../Types' -import { useForkedRef } from '../../utils/hooks' - -export type Directions = 'start' | 'end' - -export type Breakpoints = - | { xs: Directions } - | { sm: Directions } - | { md: Directions } - | { lg: Directions } - | { xl: Directions } - | { xxl: Directions } - -export type Alignments = Directions | Breakpoints - -export interface CDropdownProps extends HTMLAttributes { - /** - * Set aligment of dropdown menu. - * - * @type 'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'} - */ - alignment?: Alignments - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - component?: string | ElementType - /** - * Sets a darker color scheme to match a dark navbar. - */ - dark?: boolean - /** - * Sets a specified direction and location of the dropdown menu. - * - * @type 'dropup' | 'dropend' | 'dropstart' - */ - direction?: 'dropup' | 'dropend' | 'dropstart' - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property. - * - * @type 'auto' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end' - */ - placement?: Placements - /** - * If you want to disable dynamic positioning set this property to `true`. - */ - popper?: boolean - /** - * Set the dropdown variant to an btn-group, dropdown, input-group, and nav-item. - */ - variant?: 'btn-group' | 'dropdown' | 'input-group' | 'nav-item' - /** - * Toggle the visibility of dropdown menu component. - */ - visible?: boolean -} - -interface ContextProps extends CDropdownProps { - setVisible: React.Dispatch> -} - -export const CDropdownContext = createContext({} as ContextProps) - -export const CDropdown = forwardRef( - ( - { - children, - alignment, - className, - dark, - direction, - onHide, - onShow, - placement = 'bottom-start', - popper = true, - variant = 'btn-group', - component = 'div', - visible = false, - ...rest - }, - ref, - ) => { - const [_visible, setVisible] = useState(visible) - const dropdownRef = useRef(null) - const forkedRef = useForkedRef(ref, dropdownRef) - - const Component = variant === 'nav-item' ? 'li' : component - - // Disable popper if responsive aligment is set. - if (typeof alignment === 'object') { - popper = false - } - - const contextValues = { - alignment, - dark, - direction: direction, - placement: placement, - popper, - variant, - visible: _visible, - setVisible, - } - - const _className = classNames( - variant === 'nav-item' ? 'nav-item dropdown' : variant, - { - show: _visible, - }, - direction, - className, - ) - - useEffect(() => { - window.addEventListener('click', handleClickOutside) - window.addEventListener('keyup', handleKeyup) - - return () => { - window.removeEventListener('click', handleClickOutside) - window.removeEventListener('keyup', handleKeyup) - } - }) - - useEffect(() => { - setVisible(visible) - }, [visible]) - - useEffect(() => { - _visible && onShow && onShow() - !_visible && onHide && onHide() - }, [_visible]) - - const handleKeyup = (event: Event) => { - if (!dropdownRef.current?.contains(event.target as HTMLElement)) { - setVisible(false) - } - } - const handleClickOutside = (event: Event) => { - if (!dropdownRef.current?.contains(event.target as HTMLElement)) { - setVisible(false) - } - } - - return popper ? ( - - - {/* TODO: find solution how to handle click outside */} - {variant === 'input-group' ? ( - <>{children} - ) : ( - - {children} - - )} - - - ) : ( - - - {children} - - - ) - }, -) - -const alignmentDirection = PropTypes.oneOf(['start', 'end']) - -CDropdown.propTypes = { - // @ts-expect-error TODO: we have to find a solution - alignment: PropTypes.oneOfType([ - alignmentDirection, - PropTypes.shape({ xs: alignmentDirection }), - PropTypes.shape({ sm: alignmentDirection }), - PropTypes.shape({ md: alignmentDirection }), - PropTypes.shape({ lg: alignmentDirection }), - PropTypes.shape({ xl: alignmentDirection }), - PropTypes.shape({ xxl: alignmentDirection }), - ]), - children: PropTypes.node, - className: PropTypes.string, - component: PropTypes.elementType, - dark: PropTypes.bool, - direction: PropTypes.oneOf(['dropup', 'dropend', 'dropstart']), - onHide: PropTypes.func, - onShow: PropTypes.func, - placement: placementPropType, - popper: PropTypes.bool, - variant: PropTypes.oneOf(['btn-group', 'dropdown', 'input-group', 'nav-item']), - visible: PropTypes.bool, -} - -CDropdown.displayName = 'CDropdown' diff --git a/src/components/dropdown/CDropdownMenu.tsx b/src/components/dropdown/CDropdownMenu.tsx deleted file mode 100644 index 0855240b..00000000 --- a/src/components/dropdown/CDropdownMenu.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import PropTypes from 'prop-types' -import React, { ElementType, FC, HTMLAttributes, useContext } from 'react' -import classNames from 'classnames' -import { Popper, PopperChildrenProps } from 'react-popper' - -import { Placements } from '../Types' -import { Alignments, CDropdownContext } from './CDropdown' - -export interface CDropdownMenuProps - extends HTMLAttributes, - Omit< - PopperChildrenProps, - | 'arrowProps' - | 'forceUpdate' - | 'hasPopperEscaped' - | 'isReferenceHidden' - | 'placement' - | 'ref' - | 'style' - | 'update' - > { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - component?: string | ElementType -} - -export const CDropdownMenu: FC = ({ - children, - className, - component: Component = 'ul', - ...rest -}) => { - const { alignment, dark, direction, placement, popper, visible } = useContext(CDropdownContext) - - let _placement: Placements = placement - - if (direction === 'dropup') { - _placement = 'top-start' - } - if (direction === 'dropend') { - _placement = 'right-start' - } - if (direction === 'dropstart') { - _placement = 'left-start' - } - if (alignment === 'end') { - _placement = 'bottom-end' - } - - const alignmentClassNames = (alignment: Alignments) => { - const classNames: string[] = [] - if (typeof alignment === 'object') { - Object.keys(alignment).map((key) => { - classNames.push(`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key]}`) - }) - } - - if (typeof alignment === 'string') { - classNames.push(`dropdown-menu-${alignment}`) - } - - return classNames - } - - const _className = classNames( - 'dropdown-menu', - { - 'dropdown-menu-dark': dark, - show: visible, - }, - alignment && alignmentClassNames(alignment), - className, - ) - - const dropdownMenuComponent = (style?: React.CSSProperties, ref?: React.Ref) => { - return ( - - {Component === 'ul' - ? React.Children.map(children, (child, index) => { - if (React.isValidElement(child)) { - return
  • {React.cloneElement(child)}
  • - } - return - }) - : children} -
    - ) - } - - return popper && visible ? ( - {({ ref, style }) => dropdownMenuComponent(style, ref)} - ) : ( - dropdownMenuComponent() - ) -} - -CDropdownMenu.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - component: PropTypes.elementType, -} - -CDropdownMenu.displayName = 'CDropdownMenu' diff --git a/src/components/form/CFormCheck.tsx b/src/components/form/CFormCheck.tsx deleted file mode 100644 index dd26c00e..00000000 --- a/src/components/form/CFormCheck.tsx +++ /dev/null @@ -1,151 +0,0 @@ -import React, { forwardRef, InputHTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { Colors, Shapes } from '../Types' - -import { CFormLabel } from './CFormLabel' - -export type ButtonObject = { - /** - * Sets the color context of the component to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - */ - color?: Colors - /** - * Select the shape of the component. - * - * @type 'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string - */ - shape?: Shapes - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' - /** - * Set the button variant to an outlined button or a ghost button. - */ - variant?: 'outline' | 'ghost' -} - -export interface CFormCheckProps extends InputHTMLAttributes { - /** - * Create button-like checkboxes and radio buttons. - */ - button?: ButtonObject - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Sets hit area to the full area of the component. - */ - hitArea?: 'full' - /** - * The id global attribute defines an identifier (ID) that must be unique in the whole document. - */ - id?: string - /** - * Group checkboxes or radios on the same horizontal row by adding. - */ - inline?: boolean - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * The element represents a caption for a component. - */ - label?: string | ReactNode - /** - * Specifies the type of component. - */ - type?: 'checkbox' | 'radio' - /** - * Set component validation state to valid. - */ - valid?: boolean -} - -export const CFormCheck = forwardRef( - ( - { className, button, hitArea, id, inline, invalid, label, type = 'checkbox', valid, ...rest }, - ref, - ) => { - const _className = classNames( - 'form-check', - { - 'form-check-inline': inline, - 'is-invalid': invalid, - 'is-valid': valid, - }, - className, - ) - - const inputClassName = classNames(button ? 'btn-check' : 'form-check-input', { - 'is-invalid': invalid, - 'is-valid': valid, - 'me-2': hitArea, - }) - const labelClassName = classNames( - button - ? classNames( - 'btn', - button.variant ? `btn-${button.variant}-${button.color}` : `btn-${button.color}`, - { - [`btn-${button.size}`]: button.size, - }, - `${button.shape}`, - ) - : 'form-check-label', - ) - - const formControl = () => { - return - } - - const formLabel = () => { - return ( - - {label} - - ) - } - - return button ? ( - <> - {formControl()} - {label && formLabel()} - - ) : label ? ( - hitArea ? ( - - {formControl()} - {label} - - ) : ( -
    - {formControl()} - {formLabel()} -
    - ) - ) : ( - formControl() - ) - }, -) - -CFormCheck.propTypes = { - button: PropTypes.object, - className: PropTypes.string, - hitArea: PropTypes.oneOf(['full']), - id: PropTypes.string, - inline: PropTypes.bool, - invalid: PropTypes.bool, - label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - type: PropTypes.oneOf(['checkbox', 'radio']), - valid: PropTypes.bool, -} - -CFormCheck.displayName = 'CFormCheck' diff --git a/src/components/form/CFormInput.tsx b/src/components/form/CFormInput.tsx deleted file mode 100644 index 0f899578..00000000 --- a/src/components/form/CFormInput.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import React, { ChangeEventHandler, forwardRef, InputHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -// import { CFormLabel } from './CFormLabel' - -export interface CFormInputProps extends Omit, 'size'> { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * Method called immediately after the `value` prop changes. - */ - onChange?: ChangeEventHandler - /** - * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly` [docs] - */ - plainText?: boolean - /** - * Toggle the readonly state for the component. - */ - readOnly?: boolean - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' - /** - * Specifies the type of component. - */ - type?: 'color' | 'file' | 'text' | string - /** - * Set component validation state to valid. - */ - valid?: boolean - /** - * The `value` attribute of component. - * - * @controllable onChange - * */ - value?: string | string[] | number -} - -export const CFormInput = forwardRef( - ({ children, className, invalid, plainText, size, type = 'text', valid, ...rest }, ref) => { - const _className = classNames( - plainText ? 'form-control-plaintext' : 'form-control', - { - [`form-control-${size}`]: size, - 'form-control-color': type === 'color', - 'is-invalid': invalid, - 'is-valid': valid, - }, - className, - ) - return ( - - {children} - - ) - }, -) - -CFormInput.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - invalid: PropTypes.bool, - plainText: PropTypes.bool, - size: PropTypes.oneOf(['sm', 'lg']), - type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]), - valid: PropTypes.bool, -} - -CFormInput.displayName = 'CFormInput' diff --git a/src/components/form/CFormSelect.tsx b/src/components/form/CFormSelect.tsx deleted file mode 100644 index 6591c9c8..00000000 --- a/src/components/form/CFormSelect.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React, { ChangeEventHandler, forwardRef, InputHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CFormSelectProps extends Omit, 'size'> { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Specifies the number of visible options in a drop-down list. - */ - htmlSize?: number - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * Method called immediately after the `value` prop changes. - */ - onChange?: ChangeEventHandler - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' - /** - * Set component validation state to valid. - */ - valid?: boolean - /** - * The `value` attribute of component. - * - * @controllable onChange - * */ - value?: string | string[] | number -} - -export const CFormSelect = forwardRef( - ({ children, className, htmlSize, invalid, size, valid, ...rest }, ref) => { - const _className = classNames( - 'form-select', - { - [`form-select-${size}`]: size, - 'is-invalid': invalid, - 'is-valid': valid, - }, - className, - ) - return ( - - ) - }, -) - -CFormSelect.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - htmlSize: PropTypes.number, - invalid: PropTypes.bool, - size: PropTypes.oneOf(['sm', 'lg']), - valid: PropTypes.bool, -} - -CFormSelect.displayName = 'CFormSelect' diff --git a/src/components/form/CFormTextarea.tsx b/src/components/form/CFormTextarea.tsx deleted file mode 100644 index 3cbd454a..00000000 --- a/src/components/form/CFormTextarea.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { ChangeEventHandler, forwardRef, InputHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CFormTextareaProps extends InputHTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * Method called immediately after the `value` prop changes. - */ - onChange?: ChangeEventHandler - /** - * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`. - */ - plainText?: boolean - /** - * Toggle the readonly state for the component. - */ - readOnly?: boolean - /** - * Set component validation state to valid. - */ - valid?: boolean - /** - * The `value` attribute of component. - * - * @controllable onChange - * */ - value?: string | string[] | number -} - -export const CFormTextarea = forwardRef( - ({ children, className, invalid, plainText, valid, ...rest }, ref) => { - const _className = classNames( - plainText ? 'form-control-plaintext' : 'form-control', - { - 'is-invalid': invalid, - 'is-valid': valid, - }, - className, - ) - return ( - - ) - }, -) - -CFormTextarea.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - invalid: PropTypes.bool, - plainText: PropTypes.bool, - valid: PropTypes.bool, -} - -CFormTextarea.displayName = 'CFormTextarea' diff --git a/src/components/index.ts b/src/components/index.ts deleted file mode 100644 index 8d0038a0..00000000 --- a/src/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './widgets' diff --git a/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap b/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap deleted file mode 100644 index 97a4e773..00000000 --- a/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModal customize 1`] = ` -
    -
    -
    -`; - -exports[`loads and displays CModal component 1`] = ` -
    -
    -
    -`; diff --git a/src/components/popover/CPopover.tsx b/src/components/popover/CPopover.tsx deleted file mode 100644 index 31a7d106..00000000 --- a/src/components/popover/CPopover.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import React, { FC, ReactElement, ReactNode, useState } from 'react' -import { createPortal } from 'react-dom' -import PropTypes from 'prop-types' -import { Manager, Popper, Reference } from 'react-popper' -import { Transition } from 'react-transition-group' - -import { CPopoverContent } from './CPopoverContent' -import { Triggers, triggerPropType } from '../Types' - -export interface CPopoverProps { - children: ReactElement - /** - * Content node for your component. - */ - content: ReactNode - /** - * Offset of the popover relative to its target. - */ - offset?: [number, number] - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Title node for your component. - */ - title?: ReactNode - /** - * Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them. - * - * @type 'hover' | 'focus' | 'click' - */ - trigger?: Triggers | Triggers[] - /** - * Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property. - */ - placement?: 'top' | 'right' | 'bottom' | 'left' - /** - * Toggle the visibility of popover component. - */ - visible?: boolean -} - -export const CPopover: FC = ({ - children, - placement = 'top', - offset = [0, 8], - onHide, - onShow, - trigger = 'click', - visible, - ...rest -}) => { - const [_visible, setVisible] = useState(visible) - - const getTransitionClass = (state: string) => { - return state === 'entering' - ? 'fade' - : state === 'entered' - ? 'fade show' - : state === 'exiting' - ? 'fade' - : 'fade' - } - - return ( - - - {({ ref }) => - React.cloneElement(children, { - ref: ref, - ...((trigger === 'click' || trigger.includes('click')) && { - onClick: () => setVisible(!_visible), - }), - ...((trigger === 'focus' || trigger.includes('focus')) && { - onFocus: () => setVisible(true), - onBlur: () => setVisible(false), - }), - ...((trigger === 'hover' || trigger.includes('hover')) && { - onMouseEnter: () => setVisible(true), - onMouseLeave: () => setVisible(false), - }), - }) - } - - {typeof window !== 'undefined' && - createPortal( - - {(state) => { - const transitionClass = getTransitionClass(state) - return ( - - {(p) => ( - - )} - - ) - }} - , - document.body, - )} - - ) -} - -CPopover.propTypes = { - children: PropTypes.any, - placement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), - offset: PropTypes.any, // TODO: find good proptype - onHide: PropTypes.func, - onShow: PropTypes.func, - trigger: triggerPropType, - visible: PropTypes.bool, -} - -CPopover.displayName = 'CPopover' diff --git a/src/components/popover/CPopoverContent.tsx b/src/components/popover/CPopoverContent.tsx deleted file mode 100644 index f7bdaf87..00000000 --- a/src/components/popover/CPopoverContent.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React, { CSSProperties, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { CPopoverProps } from './CPopover' -import { PopperChildrenProps } from 'react-popper' - -interface CPopoverContentProps - extends Omit, - Omit { - transitionClass?: string - style?: CSSProperties - placementClassNamePostfix?: string -} - -export const CPopoverContent = forwardRef( - ({ content, title, placementClassNamePostfix, arrowProps, style, transitionClass }, ref) => ( - <> -
    -
    -
    {title}
    -
    {content}
    -
    - - ), -) - -CPopoverContent.propTypes = { - arrowProps: PropTypes.any, - content: PropTypes.node, - placementClassNamePostfix: PropTypes.string, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), - title: PropTypes.string, - transitionClass: PropTypes.string, -} - -CPopoverContent.displayName = 'CPopoverContent' diff --git a/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap b/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap deleted file mode 100644 index 6a83ceb6..00000000 --- a/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap +++ /dev/null @@ -1,43 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CPopover customize 1`] = ` - - -