diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index ebe51d3b..00000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# EditorConfig is awesome: https://EditorConfig.org - -# top-most EditorConfig file -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = false -insert_final_newline = false \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..433332f8 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +test/coverage/ +es/ +lib/ +umd/ +*.test.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..4bfd9014 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,51 @@ +{ + "env": { + "browser": true, + "node": true, + "es6": true + }, + "extends": ["eslint:recommended", "plugin:react/recommended"], + "parser": "babel-eslint", + "parserOptions": { + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "arrowFunctions": true, + "blockBindings": true, + "defaultParams": true, + "destructuring": true, + "forOf": true, + "generators": true, + "objectLiteralComputedProperties": true, + "objectLiteralShorthandMethods": true, + "objectLiteralShorthandProperties": true, + "experimentalObjectRestSpread": true, + "restParams": true, + "spread": true, + "templateStrings": true, + "modules": true, + "classes": true + } + }, + "plugins": [ + "react" + ], + "root": true, + "rules": { + "comma-dangle": 0, + "linebreak-style": 0 + }, + "settings": { + "react": { + "createClass": "createReactClass", // Regex for Component Factory to use, + // default to "createReactClass" + "pragma": "React", // Pragma to use, default to "React" + "version": "16.8", // React version, default to the latest React stable release + "flowVersion": "0.81" // Flow version + }, + "propWrapperFunctions": [ "forbidExtraProps" ] // The names of any functions used to wrap the + // propTypes object, e.g. `forbidExtraProps`. + // If this isn't set, any propTypes wrapped in + // a function will be skipped. + } +} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 205021e4..00000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Enforce Unix newlines -* text=auto eol=lf diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 96e19d0c..37d6ae2a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,178 +1,34 @@ -# Contributing to CoreUI +# Contributing -Looking to contribute something to CoreUI? **Here's how you can help.** +## Usage -Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved. +```bash +# Install dependencies +npm install -Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing -patches and features. +# Build +npm run build -## Using the issue tracker +# Run all tests with lint/jest +npm run test -The [issue tracker](https://github.com/coreui/coreui-react/issues) is -the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) -and [submitting pull requests](#pull-requests), but please respect the following -restrictions: +# Run test in watch mode +npm run test:watch -* Please **do not** use the issue tracker for personal support requests. +# Update test snapshot +npm run test:update -* Please **do not** post comments consisting solely of "+1" or ":thumbsup:". - Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) - instead. +# Run linter +npm run lint -## Bug reports +# Run linter with auto fix +npm run lint:fix +``` +## Workflow -A bug is a _demonstrable problem_ that is caused by the code in the repository. -Good bug reports are extremely helpful, so thanks! - -Guidelines for bug reports: - -0. **Validate and lint your code** — to ensure your problem isn't caused by a simple error in your own code. - -1. **Use the GitHub issue search** — check if the issue has already been reported. - -2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository. - -3. **Isolate the problem** — ideally create a [reduced test case](https://css-tricks.com/reduced-test-cases/) and a live example. [This JS Bin](http://jsbin.com/lefey/1/edit?html,output) is a helpful template. - - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. What is -your environment? What steps will reproduce the issue? What browser(s) and OS -experience the problem? Do other browsers show the bug differently? What -would you expect to be the outcome? All these details will help people to fix -any potential bugs. - -Example: - -> Short and descriptive example bug report title -> -> A summary of the issue and the browser/OS environment in which it occurs. If -> suitable, include the steps required to reproduce the bug. -> -> 1. This is the first step -> 2. This is the second step -> 3. Further steps, etc. -> -> `` - a link to the reduced test case -> -> Any other information you want to share that is relevant to the issue being -> reported. This might include the lines of code that you have identified as -> causing the bug, and potential solutions (and your opinions on their -> merits). - -## Feature requests - -Feature requests are welcome. Before opening a feature request, please take a -moment to find out whether your idea fits with the scope and aims of the -project. It's up to *you* to make a strong case to convince the project's -developers of the merits of this feature. Please provide as much detail -and context as possible. - - -## Pull requests - -Good pull requests—patches, improvements, new features—are a fantastic -help. They should remain focused in scope and avoid containing unrelated -commits. - -**Please ask first** before embarking on any significant pull request (e.g. -implementing features, refactoring code, porting to a different language), -otherwise you risk spending a lot of time working on something that the -project's developers might not want to merge into the project. - -Adhering to the following process is the best way to get your work -included in the project: - -1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, - and configure the remotes: - - ```bash - # Clone your fork of the repo into the current directory - git clone https://github.com//coreui-react.git - # Navigate to the newly cloned directory - cd coreui - # Assign the original repo to a remote called "upstream" - git remote add upstream https://github.com/coreui/coreui-react.git - ``` - -2. If you cloned a while ago, get the latest changes from upstream: - - ```bash - git checkout master - git pull upstream master - ``` - -3. Create a new topic branch (off the main project development branch) to - contain your feature, change, or fix: - - ```bash - git checkout -b - ``` - -4. Commit your changes in logical chunks. Please adhere to these [git commit - message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - or your code is unlikely to be merged into the main project. Use Git's - [interactive rebase](https://help.github.com/articles/interactive-rebase) - feature to tidy up your commits before making them public. - -5. Locally merge (or rebase) the upstream development branch into your topic branch: - - ```bash - git pull [--rebase] upstream master - ``` - -6. Push your topic branch up to your fork: - - ```bash - git push origin - ``` - -7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) - with a clear title and description against the `master` branch. - -**IMPORTANT**: By submitting a patch, you agree to allow the project owners to -license your work under the terms of the [MIT License](LICENSE). - -### Semantic Git commit messages - -Inspired by Sparkbox's awesome article on -[semantic commit messages](http://seesparkbox.com/foundry/semantic_commit_messages). -Please use following commit message format. - -* chore (updating npm tasks etc; no production code change) -> ```git test -m 'chore: commit-message-here'``` -* docs (changes to documentation) -> ```git commit -m 'docs: commit-message-here'``` -* feat (new feature) -> ```git commit -m 'feat: commit-message-here'``` -* fix (bug fix) -> ```git commit -m 'fix: commit-message-here'``` -* refactor (refactoring production code) -> ```git commit -m 'refactor: commit-message-here'``` -* style (formatting, missing semi colons, etc; no code change) -> ```git commit -m 'style: commit-message-here'``` -* test (adding missing tests, refactoring tests; no production code change) -> ```git test -m 'refactor: commit-message-here'``` - -## Code guidelines - -### HTML - -[Adhere to the Code Guide.](http://codeguide.co/#html) - -- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags). -- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`. -- Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility. - -### CSS - -[Adhere to the Code Guide.](http://codeguide.co/#css) - -- When feasible, default color palettes should comply with [WCAG color contrast guidelines](http://www.w3.org/TR/WCAG20/#visual-audio-contrast). -- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](http://a11yproject.com/posts/never-remove-css-outlines) for more details. - -### JS - -- No semicolons (in client-side JS) -- 2 spaces (no tabs) -- strict mode -- "Attractive" -- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](http://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](http://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded. - -## License - -By contributing your code, you agree to license your contribution under the [MIT License](LICENSE). \ No newline at end of file +- Create a component in the src/components folder +- Add tests in the src/components/\_\_tests\_\_ folder +- Register this component in src/index.js +- Run lint and tests before commiting anything +- Commit using [Commit Convention](./COMMIT_CONVENTION.md) +- PR on github diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 544d42d2..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -custom: "https://coreui.io/pricing/?support=true" -open_collective: coreui diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..9e0cfad4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,26 @@ +Before opening an issue: + +- [Search for duplicate or closed issues](https://github.com/coreui/coreui-react/issues?utf8=%E2%9C%93&q=is%3Aissue) +- Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs +- Read the [contributing guidelines](./CONTRIBUTING.md) + +When asking general "how to" questions: + +- Please do not open an issue here +- Post your question here - https://community.coreui.io/c/support/coreui-for-react/15 + +When reporting a bug, include: + +- Operating system and version (Windows, Mac OS X, Android, iOS, etc...) +- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) +- Reduced test cases and potential fixes using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/) + +When suggesting a feature: + +- Please do not open an issue here, +- Post your feature request here - https://community.coreui.io/c/feature-requests/12 +- Include: + - As much detail as possible for what we should add and why it's important to CoreUI for React.js + - Relevant links to prior art, screenshots, or live demos whenever possible + +**Please use GitHub only when reporting a bug, all issues with the general "how to" questions will be automatically closed.** \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 87980fbc..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Bug report -about: Tell us about a bug you may have identified in Bootstrap. -title: '' -labels: '' -assignees: '' - ---- - -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/main/.github/CONTRIBUTING.md) - -Bug reports must include: - -- Operating system and version (Windows, macOS, Android, iOS) -- Browser and version (Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser) -- A [reduced test case](https://css-tricks.com/reduced-test-cases/) or suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index ca4169dc..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for a new feature in CoreUI. -title: '' -labels: feature -assignees: '' - ---- - -Before opening: - -- [Search for duplicate or closed issues](https://github.com/coreui/coreui-react/issues?utf8=%E2%9C%93&q=is%3Aissue) -- Read the [contributing guidelines](https://github.com/coreui/coreui-react/blob/main/.github/CONTRIBUTING.md) - -Feature requests must include: - -- As much detail as possible for what we should add and why it's important to Bootstrap -- Relevant links to prior art, screenshots, or live demos whenever possible diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..af184f85 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,35 @@ + + + + + +**What kind of change does this PR introduce?** (check at least one) + +- [ ] Bugfix +- [ ] Feature +- [ ] Code style update +- [ ] Refactor +- [ ] Build-related changes +- [ ] Other, please describe: + +**Does this PR introduce a breaking change?** (check one) + +- [ ] Yes +- [ ] No + +If yes, please describe the impact and migration path for existing applications: + +**The PR fulfills these requirements:** + +- [ ] It's submitted to the `develop` branch (or to a previous version branch), _not_ the `master` branch +- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number) +- [ ] All tests are passing +- [ ] New/updated tests are included + +If adding a **new feature**, the PR's description includes: +- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it) + +**Other information:** diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md deleted file mode 100644 index 9d4da715..00000000 --- a/.github/SUPPORT.md +++ /dev/null @@ -1,9 +0,0 @@ -### Bug reports - -See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports. - -### How-to - -For general troubleshooting or help getting started: - -- Join [GitHub Discussions](https://github.com/coreui/coreui-react/discussions/). diff --git a/.github/workflows/daily-project-check.yml b/.github/workflows/daily-project-check.yml index 5776ce77..f68d27c9 100644 --- a/.github/workflows/daily-project-check.yml +++ b/.github/workflows/daily-project-check.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [12.x] + node-version: [14.x] os: [ubuntu-latest, windows-latest, macOS-latest] steps: diff --git a/.github/workflows/project-check.yml b/.github/workflows/project-check.yml index 854186a4..0c2f4402 100644 --- a/.github/workflows/project-check.yml +++ b/.github/workflows/project-check.yml @@ -5,8 +5,6 @@ on: branches: - master pull_request: - branches: - - master jobs: build: @@ -15,7 +13,7 @@ jobs: strategy: matrix: - node-version: [12.x] + node-version: [14.x] os: [ubuntu-latest, windows-latest, macOS-latest] steps: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index ae659d2c..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,27 +0,0 @@ -# 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 70f24f47..01612b6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,23 @@ -.cache -coverage/ -dist/ -node_modules/ -public/ -yarn.lock +# See https://help.github.com/ignore-files/ for more about ignoring files. -# IDEs and editors -.idea/ +# dependencies +node_modules +/node_modules +package-lock.json -# Visual Studio Code -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* +# testing +/demo/dist -# System files +# testing +/coverage + +# production +/es +/lib +/umd + +# misc .DS_Store -Thumbs.db +.idea -# Numerous always-ignore extensions -*.diff -*.err -*.log -*.orig -*.rej -*.swo -*.swp -*.vi -*.zip -*~ \ No newline at end of file +npm-debug.log* diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d6139f86..00000000 --- a/.gitmodules +++ /dev/null @@ -1,8 +0,0 @@ -[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/.prettierignore b/.prettierignore deleted file mode 100644 index 849ddff3..00000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 00000000..8aa29d07 --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,32 @@ +var path = require('path') +var webpack = require('webpack') + +module.exports = { + //stories: ['../stories/*.stories.js'], + //stories: ['/stories/*.stories.js'], + // stories: ['../stories/*.stories.js'], + + //stories: ['../stories/TEST.stories.js'], + //stories: ['../src/*.stories.js'] + //stories: ['../src/**/*.stories.js'] + stories: ['../stories/*.stories.js'], + module: { + loaders: [ + { + test: /\.js$/, + loaders: [ 'babel-loader' ], + exclude: /node_modules/, + include: __dirname + }, + { + test: /\.css?$/, + loaders: [ 'style-loader', 'raw-loader' ], + include: __dirname + } + ] + }, + addons: [ + '@storybook/addon-storysource', + '@storybook/addon-knobs', + ], +}; \ No newline at end of file diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 00000000..c6941510 --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,23 @@ +import React from 'react'; +import { addDecorator } from '@storybook/react'; +import '@coreui/coreui/dist/css/coreui.min.css'; +import CRow from '../src/grid/CRow' +import CContainer from '../src/grid/CContainer' +import CCol from '../src/grid/CCol' +import CCard from '../src/card/CCard' +//@import '~@coreui/icons/css/all.css'; + +addDecorator(story => ( + <> + + + + +

CoreUI

+
+
+ {story()} +
+
+ +)); diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js new file mode 100644 index 00000000..acbd10a5 --- /dev/null +++ b/.storybook/webpack.config.js @@ -0,0 +1,13 @@ +const path = require('path'); + +module.exports = { + module: { + rules: [ + { + test: /\.css?$/, + loaders: [ 'style-loader', 'raw-loader' ], + include: path.resolve(__dirname, '../') + } + ] + } +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 27a44689..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "editor.defaultFormatter": "esbenp.prettier-vscode" - } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..58215b58 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,464 @@ +### Changelog + +All notable changes to this project will be documented in this file. Dates are displayed in UTC. + +#### [3.4.6](https://github.com/coreui/coreui-react/compare/3.4.5...3.4.6) + +> 15 March 2021 + +- Fix for custom CPagination props [`9ed2c9f`](https://github.com/coreui/coreui-react/commit/9ed2c9fef09782f44c12cb4b3687fedba1725c1a) +- chore: dependencies update [`82e5c9c`](https://github.com/coreui/coreui-react/commit/82e5c9c41fad851974b4c221ff45247145896e71) +- chore: github workflows update [`147b761`](https://github.com/coreui/coreui-react/commit/147b761a74f6f43db2901c65285e1f7cf4cb969e) + +#### [3.4.5](https://github.com/coreui/coreui-react/compare/3.4.4...3.4.5) + +> 20 January 2021 + +- chore: dependencies update [`136c5ba`](https://github.com/coreui/coreui-react/commit/136c5ba88d9e72c7e1443cf676d952778d6f9427) +- fix(CModal): add scrollable attribute to type definitions - thanks @pehlert [`7d03dfc`](https://github.com/coreui/coreui-react/commit/7d03dfcb8c633951c6466e6022f051c419bd66c7) + +#### [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) +- chore(release): 3.4.4 [`29b2471`](https://github.com/coreui/coreui-react/commit/29b2471f2ac5183f52e612306097bc8a75cf721b) +- 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 fbb053e0..010704f9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 creativeLabs Łukasz Holeczek +Copyright (c) 2020 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 467a62fb..ed84c282 100644 --- a/README.md +++ b/README.md @@ -1,230 +1,76 @@ -

- - CoreUI logo - -

- -

CoreUI for React.js

- -

- React.js Components Library built on top of Bootstrap 5 and TypeScript. -
- Explore CoreUI for React.js docs » -
-
- Report bug - · - Request feature - · - Blog -

- - -## Table of contents - -- [Quick start](#quick-start) -- [Components](#components) -- [Status](#status) -- [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 - -### Instalation - -Several quick start options are available: - -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.7.0.zip) -- Clone the repo: `git clone https://github.com/coreui/coreui-react.git` -- 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/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 are custom CoreUI components, which don't exist in the Bootstrap ecosystem. - -#### CoreUI CSS files - -##### Installation - -```bash -yarn add @coreui/coreui -``` - -or - -```bash -npm install @coreui/coreui --save -``` +# CoreUI React components library -##### Basic usage +[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=CoreUI%20-%20Free%20Vue%20Admin%20Template%20&url=http://coreui.io/react/&hashtags=bootstrap,admin,template,dashboard,panel,free,angular,react,vue) +[![npm_latest][npm-coreui-react-badge-latest]][npm-coreui-react] +[![npm next][npm-coreui-react-badge-next]][npm-coreui-react] +[![NPM downloads][npm-coreui-react-download]][npm-coreui-react] +[![Build](https://github.com/coreui/coreui-react/actions/workflows/project-check.yml/badge.svg)](https://github.com/coreui/coreui-react/actions/workflows/project-check.yml) +[![Daily check](https://github.com/coreui/coreui-react/actions/workflows/daily-project-check.yml/badge.svg)](https://github.com/coreui/coreui-react/actions/workflows/daily-project-check.yml) +[![react](https://img.shields.io/badge/react-^17.0.1-lightgrey.svg?style=flat-square&logo=react)][coreui] -```js -import '@coreui/coreui/dist/css/coreui.min.css' -``` +[npm-coreui-react-download]: https://img.shields.io/npm/dm/@coreui/react.svg?style=flat-square +[npm-coreui-react]: https://www.npmjs.com/package/@coreui/react +[npm-coreui-react-badge-latest]: https://img.shields.io/npm/v/@coreui/react/latest?style=flat-square +[npm-coreui-react-badge-next]: https://img.shields.io/npm/v/@coreui/react/next?style=flat-square +[coreui]: https://coreui.io/react -#### Bootstrap CSS files +##### @coreui/react v3 for [CoreUI 3 for React](https://coreui.io/react/) -##### Installation +###### Over 90 bootstrap based React components and directives -```bash -yarn add bootstrap -``` +##### For library guide please visit our [Documentation site »](https://coreui.io/react/docs) -or +Check out demo of components usage: [CoreUI React Admin Template »](https://coreui.io/react/demo) -```bash -npm install bootstrap -``` +![Template](https://coreui.io/images/github/vue-free-template-3.gif) -##### Basic usage +### Installation -```js -import "bootstrap/dist/css/bootstrap.min.css"; +Before installation you need to install [node and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) on your machine. +```shell +npm install @coreui/react ``` -## 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 Rating](https://coreui.io/react/docs/forms/rating/) -- [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 - -[![npm version](https://img.shields.io/npm/v/@coreui/react)](https://www.npmjs.com/package/@coreui/react) - -## 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/.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/getting-started/introduction) - -### Running documentation locally - -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 +#### Styling -CoreUI supports most popular frameworks. +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 (template components, callout, switch). -- [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) +Styles have to be imported separately! Import [CoreUI](https://github.com/coreui/coreui) CSS library (recommended), or [Bootstrap](https://getbootstrap.com/) library -## 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/.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/.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/). - -You can also follow [@core_ui on Twitter](https://twitter.com/core_ui). - -## Versioning - -For transparency into our release cycle and in striving to maintain backward compatibility, CoreUI is maintained under [the Semantic Versioning guidelines](http://semver.org/). - -See [the Releases section of our project](https://github.com/coreui/coreui-react/releases) for changelogs for each release version. - -## Creators +Installation: +```shell +npm install @coreui/coreui +``` -**Łukasz Holeczek** +Styles usage: +```scss +@import "~@coreui/coreui/scss/coreui"; +``` -* -* +### Changelog +See the GitHub [release history](https://github.com/coreui/coreui-react/releases). -**Andrzej Kopański** +### Contributing +See [CONTRIBUTING.md](https://github.com/coreui/coreui-react/blob/master/CONTRIBUTING.md). -* +### Credits +Some design ideas and solutions in this library inspired by [reactstrap library](https://reactstrap.github.io/) -**CoreUI Team** -* -* -* +--- +- bootstrapped with [nwb](https://github.com/insin/nwb) toolkit -## Support CoreUI Development +#### `npm run` scripts -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/?framework=react&src=github-coreui-react) or by becoming a sponsor via [Open Collective](https://opencollective.com/coreui/). +`package.json` is configured with `"scripts"` we can use with `npm run` while developing the project. -## Copyright and license +Command | Description | +--- | --- +`npm test` | run tests +`npm run test:coverage` | run tests and produce a code coverage report in `coverage/` +`npm run test:watch` | start a test server and re-run tests on every change +`npm run build` | prepare for publishing to npm +`npm run clean` | delete built resources -Copyright 2025 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 +#### see also: +- [Developing React Components and Libraries with nwb](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb) diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..e1bf5250 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,48 @@ +module.exports = { + "presets": [ + [ + "@babel/env", + { + "shippedProposals": true, + "modules": false, + "targets": { + "ie": 11 + } + } + ], + "@babel/react" + ], + "plugins": [ + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-transform-runtime", "@babel/plugin-proposal-object-rest-spread" + ], + "env": { + "esm-dir": { + "presets": [ + [ + "@babel/env", + { + "loose": true, + "shippedProposals": true, + "modules": false, + "targets": { + "ie": 11 + } + } + ], + "@babel/react" + ], + "plugins": [["@babel/plugin-transform-runtime", { "useESModules": true }]] + }, + "test": { + "presets": [ + "@babel/env", "@babel/preset-react" + ], + "plugins": [ + "babel-plugin-dynamic-import-node", + // 'babel-plugin-transform-dynamic-import' + ] + } + } +} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 2498120d..00000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,104 +0,0 @@ -import eslint from '@eslint/js' -import tsParser from '@typescript-eslint/parser' -import eslintPluginUnicorn from 'eslint-plugin-unicorn' -import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' -import eslintPluginReact from 'eslint-plugin-react' -import eslintPluginReactHooks from 'eslint-plugin-react-hooks' -import globals from 'globals' -import typescriptEslint from 'typescript-eslint' - -export default typescriptEslint.config( - { ignores: ['**/*.d.ts', '**/coverage', '**/dist', 'eslint.config.mjs'] }, - { - extends: [ - eslint.configs.recommended, - ...typescriptEslint.configs.recommended, - eslintPluginUnicorn.configs['flat/recommended'], - eslintPluginReact.configs.flat.recommended, - eslintPluginReact.configs.flat['jsx-runtime'], - ], - plugins: { - 'react-hooks': eslintPluginReactHooks, - }, - files: ['packages/**/src/**/*.{js,ts,tsx}'], - languageOptions: { - globals: { - ...globals.browser, - ...globals.node, - }, - parser: tsParser, - ecmaVersion: 'latest', - sourceType: 'module', - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - }, - }, - settings: { - react: { - pragma: 'React', - version: 'detect', - }, - }, - rules: { - ...eslintPluginReactHooks.configs.recommended.rules, - 'no-console': 'off', - 'no-debugger': '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', - 'vue/require-default-prop': 'off', - }, - }, - { - files: ['**/*.mjs'], - languageOptions: { - globals: { - ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), - ...globals.node, - }, - - ecmaVersion: 5, - sourceType: 'module', - }, - }, - { - files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'], - languageOptions: { - globals: { - ...globals.jest, - }, - }, - }, - { - files: ['packages/docs/build/**'], - languageOptions: { - globals: { - ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), - ...globals.node, - }, - - ecmaVersion: 5, - sourceType: 'commonjs', - }, - 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', - }, - }, - eslintPluginPrettierRecommended, -) diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..13ec3945 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,22 @@ +const path = require('path'); + +module.exports = { + rootDir: path.resolve(__dirname, './'), + moduleFileExtensions: ['js', 'json', 'jsx'], + transform: { + '.*\\.js$': '/node_modules/babel-jest', + '.*\\.jsx$': '/node_modules/babel-jest' + }, + moduleNameMapper: { + "\\.(css|less)$": "/src/styleMock.js" + }, + transformIgnorePatterns: [ + "node_modules/(?!(@coreui|tippy.js|perfect-scrollbar)/)" + ], + coverageDirectory: '/coverage', + collectCoverageFrom: [ + 'src/**/*.{js,jsx}', + '!src/index.umd.js', + '!**/node_modules/**' + ] +}; \ No newline at end of file diff --git a/lerna.json b/lerna.json deleted file mode 100644 index e456a603..00000000 --- a/lerna.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmClient": "yarn", - "packages": ["packages/*"], - "version": "5.7.0", - "$schema": "node_modules/lerna/schemas/lerna-schema.json" -} diff --git a/npm-postinstall.js b/npm-postinstall.js new file mode 100644 index 00000000..f5dabcfa --- /dev/null +++ b/npm-postinstall.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node + +const pkg = require(require('path').resolve('./package.json')) + +let packageJson = null +try { + packageJson = require(require('path').resolve('../../../package.json')) +} catch (e) { + +} + +const log = console.log + +const VERSIONS = { + '@coreui/coreui': { + url: 'https://coreui.io/pro/', + name: 'CoreUI CSS library' + }, + '@coreui/angular': { + url: 'https://coreui.io/pro/angular/', + name: 'CoreUI Angular components library', + docs: 'https://coreui.io/angular/docs/' + }, + '@coreui/react': { + url: 'https://coreui.io/pro/react/', + name: 'CoreUI React components library', + docs: 'https://coreui.io/react/docs/introduction' + }, + '@coreui/vue': { + url: 'https://coreui.io/pro/vue/', + name: 'CoreUI Vue components library', + docs: 'https://coreui.io/vue/docs/introduction/' + }, +} + +log('\x1b[32m') +log(`\x1b[1mThank you for using ${VERSIONS[pkg.name].name}! \x1b[22m`) +log(`${VERSIONS[pkg.name].name} is an MIT licensed open source project and ` + +`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 Pro Version: ` + +`\x1b[4m${VERSIONS[pkg.name].url}\x1b[24m]`) +log('\x1b[39m') + +const isFramework = VERSIONS[pkg.name].name !== '@coreui/coreui' +const haveStyles = packageJson && + packageJson.dependencies && + ( + packageJson.dependencies['@coreui/coreui'] || + packageJson.dependencies['@coreui/coreui-pro'] + ) + +if (isFramework && !haveStyles) { + log(`\x1b[1m\x1b[31mError: You don't have '@coreui/coreui' CSS library installed in ` + + `package.json dependencies section. You need to import it in order to style ` + + `CoreUI components. Installation docs: ${VERSIONS[pkg.name].docs} \n \x1b[0m` + ) + // ` \x1b[33m` +} diff --git a/package.json b/package.json index e51bf9e0..818dd43a 100644 --- a/package.json +++ b/package.json @@ -1,46 +1,125 @@ { - "private": true, - "workspaces": [ - "packages/*" + "name": "@coreui/react", + "version": "3.4.6", + "description": "CoreUI React 17 Bootstrap 4 components", + "license": "MIT", + "author": { + "name": "CoreUI", + "url": "https://coreui.io", + "github": "https://github.com/coreui", + "twitter": "https://twitter.com/core_ui" + }, + "contributors": [ + { + "name": "CoreUI Team", + "url": "https://github.com/orgs/coreui/people" + } + ], + "homepage": "https://coreui.io", + "main": "lib/index.js", + "types": "src/index.d.ts", + "module": "es/index.js", + "files": [ + "css/", + "es/", + "lib/", + "src/", + "tests/", + "umd/", + "README.md", + "npm-postinstall.js" ], "scripts": { - "charts:build": "lerna run --scope \"@coreui/react-chartjs\" build --stream", - "charts:test": "lerna run --scope \"@coreui/react-chartjs\" test --stream", - "charts:test:update": "lerna run --scope \"@coreui/react-chartjs\" test:update --stream", - "docs:api": "lerna run --scope \"@coreui/react-docs\" api --stream", - "docs:dev": "lerna run --scope \"@coreui/react-docs\" develop --stream", - "docs:build": "lerna run --scope \"@coreui/react-docs\" build --stream", - "docs:clean": "lerna run --scope \"@coreui/react-docs\" clean", - "icons:build": "lerna run --scope \"@coreui/icons-react\" build --stream", - "icons:test": "lerna run --scope \"@coreui/icons-react\" test --stream", - "icons:test:update": "lerna run --scope \"@coreui/icons-react\" test:update --stream", - "lib:build": "lerna run --scope \"@coreui/react\" build --stream", - "lib:test": "lerna run --scope \"@coreui/react\" test --stream", - "lib:test:update": "lerna run --scope \"@coreui/react\" test:update --stream", - "lint": "eslint \"packages/**/src/**/*.{js,ts,tsx}\"", - "test": "npm-run-all charts:test icons:test lib:test", - "test:update": "npm-run-all charts:test:update icons:test:update lib:test:update" + "clean": "nwb clean-module && nwb clean-demo", + "lint": "eslint src", + "changelog": "auto-changelog --starting-version 3.0.0-rc.2 --commit-limit false --hide-credit", + "build": "npm run build:lib && npm run build:esm", + "build:lib": "rollup --environment BUNDLE:false --c --sourcemap", + "build:esm": "cross-env BABEL_ENV=esm-dir babel src --out-dir es --copy-files && del-cli es/**/tests/**", + "postinstall": "node npm-postinstall", + "storybook": "start-storybook", + "jest:test": "cross-env BABEL_ENV=test jest", + "jest:coverage": "jest --coverage", + "jest:init": "jest init", + "jest:cache": "jest --clearCache" + }, + "dependencies": { + "@babel/runtime": "^7.13.10", + "@coreui/icons": "^2.0.0-rc.0", + "@coreui/icons-react": "^1.1.0", + "@coreui/utils": "~1.3.1", + "@popperjs/core": "^2.9.1", + "classnames": "~2.2.6", + "core-js": "^3.9.1", + "perfect-scrollbar": "~1.5.0", + "prop-types": "~15.7.2", + "react-transition-group": "~4.4.1", + "tippy.js": "^6.3.1" + }, + "peerDependencies": { + "react": "^17.0.1", + "react-dom": "^17.0.1", + "react-router-dom": "^5.2.0" }, "devDependencies": { - "@typescript-eslint/parser": "^8.32.1", - "eslint": "^9.27.0", - "eslint-config-prettier": "^10.1.5", - "eslint-plugin-prettier": "^5.4.0", - "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^5.2.0", - "eslint-plugin-unicorn": "^59.0.1", - "globals": "^16.1.0", - "lerna": "^8.2.2", - "npm-run-all": "^4.1.5", - "prettier": "^3.5.3", - "typescript-eslint": "^8.32.1" + "@babel/cli": "^7.13.10", + "@babel/core": "^7.13.10", + "@babel/plugin-proposal-export-default-from": "^7.12.13", + "@babel/plugin-proposal-export-namespace-from": "^7.12.13", + "@babel/plugin-proposal-object-rest-spread": "^7.13.8", + "@babel/plugin-transform-runtime": "^7.13.10", + "@babel/preset-env": "^7.13.10", + "@babel/preset-react": "^7.12.13", + "@coreui/coreui": "^3.4.0", + "@rollup/plugin-babel": "^5.3.0", + "@rollup/plugin-commonjs": "^17.1.0", + "@rollup/plugin-node-resolve": "^11.2.0", + "@rollup/plugin-replace": "^2.4.1", + "@storybook/addon-knobs": "^6.1.21", + "@storybook/addon-storysource": "^6.1.21", + "@storybook/react": "^6.1.21", + "@wojtekmaj/enzyme-adapter-react-17": "^0.4.1", + "auto-changelog": "~2.2.1", + "babel-eslint": "^10.1.0", + "babel-jest": "^26.6.3", + "babel-loader": "^8.2.2", + "cross-env": "^7.0.3", + "del-cli": "^3.0.1", + "enzyme": "^3.11.0", + "enzyme-to-json": "^3.6.1", + "eslint": "^7.22.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-react": "^7.22.0", + "expect": "^26.6.2", + "jest": "^26.6.3", + "postcss": "^8.2.8", + "react": "^17.0.1", + "react-app-polyfill": "^2.0.0", + "react-dom": "^17.0.1", + "react-router-dom": "^5.2.0", + "react-test-renderer": "^17.0.1", + "rollup": "^2.41.2", + "rollup-plugin-peer-deps-external": "~2.2.4", + "rollup-plugin-postcss": "^4.0.0", + "sinon": "^9.2.4", + "webpack": "^4.46.0" }, - "overrides": { - "gatsby-remark-external-links": { - "unist-util-find": "1.0.2" - } + "repository": { + "type": "git", + "url": "https://github.com/coreui/coreui-react.git" + }, + "bugs": { + "url": "https://github.com/coreui/coreui-react/issues" }, - "resolutions": { - "**/gatsby-remark-external-links/unist-util-find": "1.0.2" - } + "keywords": [ + "coreui", + "react", + "bootstrap", + "framework", + "responsive", + "layout", + "component", + "components", + "library" + ] } diff --git a/packages/coreui-icons-react b/packages/coreui-icons-react deleted file mode 160000 index aad2d31c..00000000 --- a/packages/coreui-icons-react +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aad2d31c3cd8ca4d3ed7457ef02730f60038b6e8 diff --git a/packages/coreui-react-chartjs b/packages/coreui-react-chartjs deleted file mode 160000 index c6077716..00000000 --- a/packages/coreui-react-chartjs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6077716da130a1ba8f97346f2d98c60ea2cca3e diff --git a/packages/coreui-react/LICENSE b/packages/coreui-react/LICENSE deleted file mode 100644 index fbb053e0..00000000 --- a/packages/coreui-react/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/coreui-react/README.md b/packages/coreui-react/README.md deleted file mode 100644 index c98015a2..00000000 --- a/packages/coreui-react/README.md +++ /dev/null @@ -1,262 +0,0 @@ -

- - CoreUI logo - -

- -

CoreUI for React.js

- -

- React.js Components Library built on top of Bootstrap 5 and TypeScript. -
- Explore CoreUI for React.js docs » -
-
- Report bug - · - Request feature - · - Blog -

- - -## Table of contents - -- [Quick start](#quick-start) -- [Components](#components) -- [Status](#status) -- [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 - -### Instalation - -Several quick start options are available: - -- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.7.0.zip) -- Clone the repo: `git clone https://github.com/coreui/coreui-react.git` -- 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/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 are custom CoreUI components, which don't exist in the Bootstrap ecosystem. - -#### CoreUI CSS files - -##### Installation - -```bash -yarn add @coreui/coreui -``` - -or - -```bash -npm install @coreui/coreui --save -``` - -##### Basic usage - -```js -import '@coreui/coreui/dist/css/coreui.min.css' -``` - -#### Bootstrap CSS files - -##### Installation - -```bash -yarn add bootstrap -``` - -or - -```bash -npm install bootstrap -``` - -##### Basic usage - -```js -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 Rating](https://coreui.io/react/docs/forms/rating/) -- [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 - -[![npm version](https://img.shields.io/npm/v/@coreui/react)](https://www.npmjs.com/package/@coreui/react) - -## 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/.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/getting-started/introduction) - -### Running documentation locally - -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/.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/.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/). - -You can also follow [@core_ui on Twitter](https://twitter.com/core_ui). - -## Versioning - -For transparency into our release cycle and in striving to maintain backward compatibility, CoreUI is maintained under [the Semantic Versioning guidelines](http://semver.org/). - -See [the Releases section of our project](https://github.com/coreui/coreui-react/releases) for changelogs for each release version. - -## Creators - -**Łukasz Holeczek** - -- -- - -**Andrzej Kopański** - -- - -**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 2025 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/). diff --git a/packages/coreui-react/jest.config.js b/packages/coreui-react/jest.config.js deleted file mode 100644 index f3aed54d..00000000 --- a/packages/coreui-react/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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 = { - preset: 'ts-jest', - testEnvironment: 'jsdom', - testPathIgnorePatterns: ['dist/'], -} diff --git a/packages/coreui-react/package.json b/packages/coreui-react/package.json deleted file mode 100644 index 6952b2c9..00000000 --- a/packages/coreui-react/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "@coreui/react", - "version": "5.7.0", - "description": "UI Components Library for React.js", - "keywords": [ - "react", - "react-component", - "react component", - "react bootstrap", - "bootstrap react", - "ui library", - "ui components", - "component library", - "components" - ], - "homepage": "https://coreui.io/react/", - "bugs": { - "url": "https://github.com/coreui/coreui-react/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/coreui/coreui-react.git" - }, - "license": "MIT", - "author": "The CoreUI Team (https://github.com/orgs/coreui/people)", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "jsnext:main": "dist/esm/index.js", - "types": "dist/esm/index.d.ts", - "files": [ - "dist/", - "src/" - ], - "sideEffects": false, - "scripts": { - "build": "npm-run-all clean build-*", - "build-cjs": "rollup --environment ESM:false --config", - "build-esm": "rollup --environment ESM:true --config", - "clean": "cross-env-shell \"rm -rf dist\"", - "test": "jest --coverage", - "test:update": "jest --coverage --updateSnapshot" - }, - "dependencies": { - "@coreui/coreui": "^5.4.0", - "@popperjs/core": "^2.11.8", - "prop-types": "^15.8.1" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^28.0.3", - "@rollup/plugin-node-resolve": "^16.0.1", - "@rollup/plugin-typescript": "^12.1.2", - "@testing-library/dom": "^10.4.0", - "@testing-library/jest-dom": "^6.6.3", - "@testing-library/react": "^16.3.0", - "@types/jest": "^29.5.14", - "@types/prop-types": "15.7.14", - "@types/react": "^19.1.4", - "@types/react-dom": "^19.1.5", - "@types/react-transition-group": "^4.4.12", - "classnames": "^2.5.1", - "cross-env": "^7.0.3", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-transition-group": "^4.4.5", - "rollup": "^4.41.0", - "ts-jest": "^29.3.4", - "tslib": "^2.8.1", - "typescript": "^5.8.3" - }, - "peerDependencies": { - "react": ">=17", - "react-dom": ">=17" - } -} diff --git a/packages/coreui-react/rollup.config.mjs b/packages/coreui-react/rollup.config.mjs deleted file mode 100644 index 1b55718e..00000000 --- a/packages/coreui-react/rollup.config.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import commonjs from '@rollup/plugin-commonjs' -import resolve from '@rollup/plugin-node-resolve' -import typescript from '@rollup/plugin-typescript' -import { readFileSync } from 'node:fs' -import { dirname } from 'node:path' - -const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url))) - -const DIR_CJS = dirname(pkg.main) -const DIR_ESM = dirname(pkg.module) -const ESM = process.env.ESM === 'true' - -const plugins = [ - resolve(), - typescript({ - exclude: ['**/__tests__/**'], - tsconfig: './tsconfig.json', - compilerOptions: { - declarationDir: ESM ? DIR_ESM : DIR_CJS, - outDir: ESM ? DIR_ESM : DIR_CJS, - }, - }), - commonjs({ - include: ['../../node_modules/**'], - }), -] - -const external = ['@popperjs/core', 'prop-types', 'react', 'react-dom'] - -const rollupConfig = { - input: 'src/index.ts', - output: { - dir: ESM ? DIR_ESM : DIR_CJS, - format: ESM ? 'esm' : 'cjs', - exports: 'named', - preserveModules: true, - preserveModulesRoot: 'src', - sourcemap: true, - sourcemapPathTransform: (relativeSourcePath) => { - return relativeSourcePath - .replace('../../node_modules/', '../') - .replace('../src/', 'src/') - }, - }, - external, - plugins, -} - -export default rollupConfig diff --git a/packages/coreui-react/src/components/accordion/CAccordion.tsx b/packages/coreui-react/src/components/accordion/CAccordion.tsx deleted file mode 100644 index a3a275ae..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordion.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CAccordionContext } from './CAccordionContext' - -export interface CAccordionProps extends HTMLAttributes { - /** - * The active item key. - */ - activeItemKey?: number | string - /** - * Make accordion items stay open when another item is opened - */ - alwaysOpen?: boolean - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Removes the default background-color, some borders, and some rounded corners to render accordions edge-to-edge with their parent container. - */ - flush?: boolean -} - -export const CAccordion = forwardRef( - ({ children, activeItemKey, alwaysOpen = false, className, flush, ...rest }, ref) => { - const [_activeItemKey, setActiveKey] = useState(activeItemKey) - - return ( -
- - {children} - -
- ) - }, -) - -CAccordion.propTypes = { - activeItemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - alwaysOpen: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - flush: PropTypes.bool, -} - -CAccordion.displayName = 'CAccordion' diff --git a/packages/coreui-react/src/components/accordion/CAccordionBody.tsx b/packages/coreui-react/src/components/accordion/CAccordionBody.tsx deleted file mode 100644 index d98e8c43..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordionBody.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CCollapse } from './../collapse/CCollapse' -import { CAccordionItemContext } from './CAccordionItemContext' - -export interface CAccordionBodyProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CAccordionBody = forwardRef( - ({ children, className, ...rest }, ref) => { - const { id, visible } = useContext(CAccordionItemContext) - - return ( - -
- {children} -
-
- ) - } -) - -CAccordionBody.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CAccordionBody.displayName = 'CAccordionBody' diff --git a/packages/coreui-react/src/components/accordion/CAccordionButton.tsx b/packages/coreui-react/src/components/accordion/CAccordionButton.tsx deleted file mode 100644 index b5e9ca4c..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordionButton.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CAccordionItemContext } from './CAccordionItemContext' - -export interface CAccordionButtonProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CAccordionButton = forwardRef( - ({ children, className, ...rest }, ref) => { - const { id, visible, setVisible } = useContext(CAccordionItemContext) - - return ( - - ) - } -) - -CAccordionButton.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CAccordionButton.displayName = 'CAccordionButton' diff --git a/packages/coreui-react/src/components/accordion/CAccordionContext.ts b/packages/coreui-react/src/components/accordion/CAccordionContext.ts deleted file mode 100644 index 4b5aa46f..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordionContext.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createContext } from 'react' - -export interface CAccordionContextProps { - _activeItemKey?: number | string - alwaysOpen?: boolean - setActiveKey: React.Dispatch> -} - -export const CAccordionContext = createContext({} as CAccordionContextProps) diff --git a/packages/coreui-react/src/components/accordion/CAccordionHeader.tsx b/packages/coreui-react/src/components/accordion/CAccordionHeader.tsx deleted file mode 100644 index b11650f4..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordionHeader.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CAccordionButton } from './CAccordionButton' - -export interface CAccordionHeaderProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CAccordionHeader = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
- {children} -
- ) - }, -) - -CAccordionHeader.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CAccordionHeader.displayName = 'CAccordionHeader' diff --git a/packages/coreui-react/src/components/accordion/CAccordionItem.tsx b/packages/coreui-react/src/components/accordion/CAccordionItem.tsx deleted file mode 100644 index f69fe197..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordionItem.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React, { - forwardRef, - HTMLAttributes, - useContext, - useEffect, - useId, - useRef, - useState, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CAccordionContext } from './CAccordionContext' -import { CAccordionItemContext } from './CAccordionItemContext' - -export interface CAccordionItemProps extends HTMLAttributes { - /** - * The id global attribute defines an identifier (ID) that must be unique in the whole document. - */ - id?: string - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Item key. - */ - itemKey?: number | string -} - -export const CAccordionItem = forwardRef( - ({ children, className, id, itemKey, ...rest }, ref) => { - const uniqueId = useId() - const _id = id ?? uniqueId - const _itemKey = useRef(itemKey ?? _id) - - const { _activeItemKey, alwaysOpen, setActiveKey } = useContext(CAccordionContext) - const [visible, setVisible] = useState(Boolean(_activeItemKey === _itemKey.current)) - - useEffect(() => { - if (!alwaysOpen && visible) { - setActiveKey(_itemKey.current) - } - }, [visible]) - - useEffect(() => { - setVisible(Boolean(_activeItemKey === _itemKey.current)) - }, [_activeItemKey]) - - return ( -
- - {children} - -
- ) - } -) - -CAccordionItem.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - itemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), -} - -CAccordionItem.displayName = 'CAccordionItem' diff --git a/packages/coreui-react/src/components/accordion/CAccordionItemContext.ts b/packages/coreui-react/src/components/accordion/CAccordionItemContext.ts deleted file mode 100644 index bbdeaf74..00000000 --- a/packages/coreui-react/src/components/accordion/CAccordionItemContext.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createContext } from 'react' - -export interface CAccordionItemContextProps { - id: string - setVisible: (a: boolean) => void - visible?: boolean -} - -export const CAccordionItemContext = createContext({} as CAccordionItemContextProps) diff --git a/packages/coreui-react/src/components/accordion/__tests__/CAccordion.spec.tsx b/packages/coreui-react/src/components/accordion/__tests__/CAccordion.spec.tsx deleted file mode 100644 index e1c8e342..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/CAccordion.spec.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react' -import { render, screen } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAccordion } from '../index' - -test('loads and displays CAccordion component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAccordion customize', async () => { - const { container } = render(Test) - expect(container.firstChild).toHaveClass('bazinga') - expect(container).toMatchSnapshot() -}) - -test('CAccordion use case test', async () => { - jest.useFakeTimers() - const { rerender } = render(Test) - expect(screen.getByText('Test')).toHaveClass('accordion') - expect(screen.getByText('Test')).not.toHaveClass('accordion-flush') - rerender(Test) - expect(screen.getByText('Test')).toHaveClass('accordion') - expect(screen.getByText('Test')).toHaveClass('accordion-flush') - jest.runAllTimers() - expect(screen.getByText('Test')).toHaveClass('accordion') - expect(screen.getByText('Test')).toHaveClass('accordion-flush') - rerender(Test) - expect(screen.getByText('Test')).toHaveClass('accordion') - expect(screen.getByText('Test')).not.toHaveClass('accordion-flush') - jest.runAllTimers() - expect(screen.getByText('Test')).toHaveClass('accordion') - expect(screen.getByText('Test')).not.toHaveClass('accordion-flush') - jest.runAllTimers() - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/accordion/__tests__/CAccordionBody.spec.tsx b/packages/coreui-react/src/components/accordion/__tests__/CAccordionBody.spec.tsx deleted file mode 100644 index 795dc1d6..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/CAccordionBody.spec.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAccordionBody } from '../index' - -test('loads and displays CAccordionBody component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAccordionBody customize', async () => { - const { container } = render(Test) - expect(container.firstChild?.firstChild).toHaveClass('accordion-body') - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/accordion/__tests__/CAccordionButton.spec.tsx b/packages/coreui-react/src/components/accordion/__tests__/CAccordionButton.spec.tsx deleted file mode 100644 index 265e06bb..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/CAccordionButton.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAccordionButton } from '../index' - -test('loads and displays CAccordionButton component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAccordionButton customize', async () => { - const { container } = render(Test) - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('accordion-button') - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/accordion/__tests__/CAccordionHeader.spec.tsx b/packages/coreui-react/src/components/accordion/__tests__/CAccordionHeader.spec.tsx deleted file mode 100644 index 44458eae..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/CAccordionHeader.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAccordionHeader } from '../index' - -test('loads and displays CAccordionHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAccordionHeader customize', async () => { - const { container } = render(Test) - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('accordion-header') - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/accordion/__tests__/CAccordionItem.spec.tsx b/packages/coreui-react/src/components/accordion/__tests__/CAccordionItem.spec.tsx deleted file mode 100644 index d32330c5..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/CAccordionItem.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAccordionItem } from '../index' - -test('loads and displays CAccordionItem component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAccordionItem customize', async () => { - const { container } = render(Test) - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('accordion-item') - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordion.spec.tsx.snap b/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordion.spec.tsx.snap deleted file mode 100644 index 237b2c04..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordion.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAccordion customize 1`] = ` -
-
- Test -
-
-`; - -exports[`loads and displays CAccordion component 1`] = ` -
-
- Test -
-
-`; diff --git a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.tsx.snap b/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.tsx.snap deleted file mode 100644 index fa723f46..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionBody.spec.tsx.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAccordionBody customize 1`] = ` -
-
-
- Test -
-
-
-`; - -exports[`loads and displays CAccordionBody component 1`] = ` -
-
-
- Test -
-
-
-`; diff --git a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap b/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap deleted file mode 100644 index dae014eb..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionButton.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAccordionButton customize 1`] = ` -
- -
-`; - -exports[`loads and displays CAccordionButton component 1`] = ` -
- -
-`; diff --git a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap b/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap deleted file mode 100644 index 7491d9d3..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionHeader.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAccordionHeader customize 1`] = ` -
-
- -
-
-`; - -exports[`loads and displays CAccordionHeader component 1`] = ` -
-
- -
-
-`; diff --git a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionItem.spec.tsx.snap b/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionItem.spec.tsx.snap deleted file mode 100644 index 721a013b..00000000 --- a/packages/coreui-react/src/components/accordion/__tests__/__snapshots__/CAccordionItem.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAccordionItem customize 1`] = ` -
-
- Test -
-
-`; - -exports[`loads and displays CAccordionItem component 1`] = ` -
-
- Test -
-
-`; diff --git a/packages/coreui-react/src/components/accordion/index.ts b/packages/coreui-react/src/components/accordion/index.ts deleted file mode 100644 index e1cc95ee..00000000 --- a/packages/coreui-react/src/components/accordion/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CAccordion } from './CAccordion' -import { CAccordionBody } from './CAccordionBody' -import { CAccordionButton } from './CAccordionButton' -import { CAccordionHeader } from './CAccordionHeader' -import { CAccordionItem } from './CAccordionItem' - -export { CAccordion, CAccordionBody, CAccordionButton, CAccordionHeader, CAccordionItem } diff --git a/packages/coreui-react/src/components/alert/CAlert.tsx b/packages/coreui-react/src/components/alert/CAlert.tsx deleted file mode 100644 index 3efdb78f..00000000 --- a/packages/coreui-react/src/components/alert/CAlert.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useEffect, useState, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { CCloseButton } from '../close-button/CCloseButton' - -import { useForkedRef } from '../../hooks' -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CAlertProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * Optionally add a close button to alert and allow it to self dismiss. - */ - dismissible?: boolean - /** - * Callback fired when the component requests to be closed. - */ - onClose?: () => void - /** - * Set the alert variant to a solid. - */ - variant?: 'solid' | string - /** - * Toggle the visibility of component. - */ - visible?: boolean -} - -export const CAlert = forwardRef( - ( - { - children, - className, - color = 'primary', - dismissible, - variant, - visible = true, - onClose, - ...rest - }, - ref, - ) => { - const alertRef = useRef(null) - const forkedRef = useForkedRef(ref, alertRef) - const [_visible, setVisible] = useState(visible) - - useEffect(() => { - setVisible(visible) - }, [visible]) - - return ( - - {(state) => ( -
- {children} - {dismissible && setVisible(false)} />} -
- )} -
- ) - }, -) - -CAlert.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType.isRequired, - dismissible: PropTypes.bool, - onClose: PropTypes.func, - variant: PropTypes.string, - visible: PropTypes.bool, -} - -CAlert.displayName = 'CAlert' diff --git a/packages/coreui-react/src/components/alert/CAlertHeading.tsx b/packages/coreui-react/src/components/alert/CAlertHeading.tsx deleted file mode 100644 index 9f47eb3a..00000000 --- a/packages/coreui-react/src/components/alert/CAlertHeading.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CAlertHeadingProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CAlertHeading: PolymorphicRefForwardingComponent<'h4', CAlertHeadingProps> = - forwardRef( - ({ children, as: Component = 'h4', className, ...rest }, ref) => { - return ( - - {children} - - ) - }, - ) - -CAlertHeading.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CAlertHeading.displayName = 'CAlertHeading' diff --git a/packages/coreui-react/src/components/alert/CAlertLink.tsx b/packages/coreui-react/src/components/alert/CAlertLink.tsx deleted file mode 100644 index dacfa081..00000000 --- a/packages/coreui-react/src/components/alert/CAlertLink.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React, { AnchorHTMLAttributes, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink } from '../link/CLink' - -export interface CAlertLinkProps extends AnchorHTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CAlertLink = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CAlertLink.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CAlertLink.displayName = 'CAlertLink' diff --git a/packages/coreui-react/src/components/alert/__tests__/CAlert.spec.tsx b/packages/coreui-react/src/components/alert/__tests__/CAlert.spec.tsx deleted file mode 100644 index 00e33441..00000000 --- a/packages/coreui-react/src/components/alert/__tests__/CAlert.spec.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import * as React from 'react' -import { act, render, fireEvent } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAlert } from '../index' - -test('loads and displays CAlert component', async () => { - let container: HTMLElement - await act(async () => { - const renderResult = render(Test) - container = renderResult.container - }) - expect(container!).toMatchSnapshot() -}) - -test('CAlert customize', async () => { - let container: HTMLElement - await act(async () => { - const renderResult = render( - - Test - - ) - container = renderResult.container - }) - expect(container!).toMatchSnapshot() - expect(container!.firstChild).toHaveClass('bazinga') - expect(container!.firstChild).toHaveClass('bg-secondary') - expect(container!.firstChild).toHaveClass('text-white') - expect(container!.firstChild).toHaveClass('alert-dismissible') -}) - -test('CAlert click close button', async () => { - jest.useFakeTimers() - - const onClose = jest.fn() - render( - - Test - - ) - - expect(onClose).toHaveBeenCalledTimes(0) - - const btn = document.querySelector('.btn-close') - - if (btn !== null) { - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - } - - expect(onClose).toHaveBeenCalledTimes(1) - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/alert/__tests__/CAlertHeading.spec.tsx b/packages/coreui-react/src/components/alert/__tests__/CAlertHeading.spec.tsx deleted file mode 100644 index cbe90bf8..00000000 --- a/packages/coreui-react/src/components/alert/__tests__/CAlertHeading.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAlertHeading } from '../index' - -test('loads and displays CAlertHeading component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAlertHeading customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('alert-heading') -}) diff --git a/packages/coreui-react/src/components/alert/__tests__/CAlertLink.spec.tsx b/packages/coreui-react/src/components/alert/__tests__/CAlertLink.spec.tsx deleted file mode 100644 index 25c6bc04..00000000 --- a/packages/coreui-react/src/components/alert/__tests__/CAlertLink.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAlertLink } from '../index' - -test('loads and displays CAlertLink component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAlertLink customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('alert-link') -}) diff --git a/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlert.spec.tsx.snap b/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlert.spec.tsx.snap deleted file mode 100644 index 56496343..00000000 --- a/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlert.spec.tsx.snap +++ /dev/null @@ -1,28 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAlert customize 1`] = ` -
- -
-`; - -exports[`loads and displays CAlert component 1`] = ` -
- -
-`; diff --git a/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlertHeading.spec.tsx.snap b/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlertHeading.spec.tsx.snap deleted file mode 100644 index 02417c99..00000000 --- a/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlertHeading.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAlertHeading customize 1`] = ` -
-

- Test -

-
-`; - -exports[`loads and displays CAlertHeading component 1`] = ` -
-

- Test -

-
-`; diff --git a/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlertLink.spec.tsx.snap b/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlertLink.spec.tsx.snap deleted file mode 100644 index 33d4eac7..00000000 --- a/packages/coreui-react/src/components/alert/__tests__/__snapshots__/CAlertLink.spec.tsx.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAlertLink customize 1`] = ` - -`; - -exports[`loads and displays CAlertLink component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/alert/index.ts b/packages/coreui-react/src/components/alert/index.ts deleted file mode 100644 index 7e182023..00000000 --- a/packages/coreui-react/src/components/alert/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CAlert } from './CAlert' -import { CAlertHeading } from './CAlertHeading' -import { CAlertLink } from './CAlertLink' - -export { CAlert, CAlertHeading, CAlertLink } diff --git a/packages/coreui-react/src/components/avatar/CAvatar.tsx b/packages/coreui-react/src/components/avatar/CAvatar.tsx deleted file mode 100644 index facdeec3..00000000 --- a/packages/coreui-react/src/components/avatar/CAvatar.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType, shapePropType, textColorsPropType } from '../../props' -import type { Colors, Shapes, TextColors } from '../../types' - -export interface CAvatarProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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, large, or extra large. - */ - size?: string - /** - * The src attribute for the img element. - */ - src?: string - /** - * Sets the color context of the status indicator to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - */ - status?: Colors - /** - * Sets the text color of the component to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string - */ - textColor?: TextColors -} - -export const CAvatar = forwardRef( - ({ children, className, color, shape, size, src, status, textColor, ...rest }, ref) => { - const statusClassName = status && classNames('avatar-status', `bg-${status}`) - - return ( -
- {src ? : children} - {status && } -
- ) - }, -) - -CAvatar.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - shape: shapePropType, - size: PropTypes.string, - src: PropTypes.string, - status: PropTypes.string, - textColor: textColorsPropType, -} - -CAvatar.displayName = 'CAvatar' diff --git a/packages/coreui-react/src/components/avatar/__tests__/CAvatar.spec.tsx b/packages/coreui-react/src/components/avatar/__tests__/CAvatar.spec.tsx deleted file mode 100644 index 2cc0b298..00000000 --- a/packages/coreui-react/src/components/avatar/__tests__/CAvatar.spec.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CAvatar } from '../index' - -test('loads and displays CAvatar component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CAvatar customize', async () => { - let element - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('avatar') - expect(container.firstChild).toHaveClass('bg-secondary') - expect(container.firstChild).toHaveClass('avatar-xl') - expect(container.firstChild).toHaveClass('text-white') - element = container.getElementsByClassName('avatar-status') - element = element[0] - expect(element).toHaveClass('bg-warning') -}) - -test('CAvatar customize image', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - - const element = container.getElementsByClassName('avatar-img') - expect(element.length).toBe(1) -}) diff --git a/packages/coreui-react/src/components/avatar/__tests__/__snapshots__/CAvatar.spec.tsx.snap b/packages/coreui-react/src/components/avatar/__tests__/__snapshots__/CAvatar.spec.tsx.snap deleted file mode 100644 index 52455e95..00000000 --- a/packages/coreui-react/src/components/avatar/__tests__/__snapshots__/CAvatar.spec.tsx.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CAvatar customize 1`] = ` -
-
- Test - -
-
-`; - -exports[`CAvatar customize image 1`] = ` -
-
- - -
-
-`; - -exports[`loads and displays CAvatar component 1`] = ` -
-
- Test -
-
-`; diff --git a/packages/coreui-react/src/components/avatar/index.ts b/packages/coreui-react/src/components/avatar/index.ts deleted file mode 100644 index 87a58f4b..00000000 --- a/packages/coreui-react/src/components/avatar/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CAvatar } from './CAvatar' - -export { CAvatar } diff --git a/packages/coreui-react/src/components/backdrop/CBackdrop.tsx b/packages/coreui-react/src/components/backdrop/CBackdrop.tsx deleted file mode 100644 index 42060744..00000000 --- a/packages/coreui-react/src/components/backdrop/CBackdrop.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { useForkedRef } from '../../hooks' - -export interface CBackdropProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Toggle the visibility of modal component. - */ - visible?: boolean -} - -export const CBackdrop = forwardRef( - ({ className = 'modal-backdrop', visible, ...rest }, ref) => { - const backdropRef = useRef(null) - const forkedRef = useForkedRef(ref, backdropRef) - - return ( - - {(state) => ( -
- )} - - ) - }, -) - -CBackdrop.propTypes = { - className: PropTypes.string, - visible: PropTypes.bool, -} - -CBackdrop.displayName = 'CBackdrop' diff --git a/packages/coreui-react/src/components/backdrop/__tests__/CBackdrop.spec.tsx b/packages/coreui-react/src/components/backdrop/__tests__/CBackdrop.spec.tsx deleted file mode 100644 index 60cab767..00000000 --- a/packages/coreui-react/src/components/backdrop/__tests__/CBackdrop.spec.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CBackdrop } from '../index' - -test('loads and displays CBackdrop component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CBackdrop customize', async () => { - jest.useFakeTimers() - const { container } = render(Test) - jest.runAllTimers() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('modal-backdrop') - jest.useRealTimers() -}) - -test('CBackdrop customize 2', async () => { - jest.useFakeTimers() - const { container } = render( - - Test - , - ) - jest.runAllTimers() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/backdrop/__tests__/__snapshots__/CBackdrop.spec.tsx.snap b/packages/coreui-react/src/components/backdrop/__tests__/__snapshots__/CBackdrop.spec.tsx.snap deleted file mode 100644 index 2144ce81..00000000 --- a/packages/coreui-react/src/components/backdrop/__tests__/__snapshots__/CBackdrop.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CBackdrop customize 1`] = ` -
- -
-`; - -exports[`CBackdrop customize 2 1`] = ` -
-
- Test -
-
-`; - -exports[`loads and displays CBackdrop component 1`] = `
`; diff --git a/packages/coreui-react/src/components/backdrop/index.ts b/packages/coreui-react/src/components/backdrop/index.ts deleted file mode 100644 index 7bca8a8a..00000000 --- a/packages/coreui-react/src/components/backdrop/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CBackdrop } from './CBackdrop' - -export { CBackdrop } diff --git a/packages/coreui-react/src/components/badge/CBadge.tsx b/packages/coreui-react/src/components/badge/CBadge.tsx deleted file mode 100644 index b96c3220..00000000 --- a/packages/coreui-react/src/components/badge/CBadge.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { colorPropType, shapePropType, textColorsPropType } from '../../props' -import type { Colors, Shapes, TextColors } from '../../types' - -export interface CBadgeProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * Position badge in one of the corners of a link or button. - */ - position?: 'top-start' | 'top-end' | 'bottom-end' | 'bottom-start' - /** - * 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. - */ - size?: 'sm' - /** - * Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - * @since 5.0.0 - */ - textBgColor?: Colors - /** - * Sets the text color of the component to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string - */ - textColor?: TextColors -} -export const CBadge: PolymorphicRefForwardingComponent<'span', CBadgeProps> = forwardRef< - HTMLDivElement | HTMLSpanElement, - CBadgeProps ->( - ( - { - children, - as: Component = 'span', - className, - color, - position, - shape, - size, - textBgColor, - textColor, - ...rest - }, - ref, - ) => { - return ( - - {children} - - ) - }, -) - -CBadge.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - position: PropTypes.oneOf(['top-start', 'top-end', 'bottom-end', 'bottom-start']), - shape: shapePropType, - size: PropTypes.oneOf(['sm']), - textBgColor: colorPropType, - textColor: textColorsPropType, -} - -CBadge.displayName = 'CBadge' diff --git a/packages/coreui-react/src/components/badge/__tests__/CBadge.spec.tsx b/packages/coreui-react/src/components/badge/__tests__/CBadge.spec.tsx deleted file mode 100644 index 1473d6f7..00000000 --- a/packages/coreui-react/src/components/badge/__tests__/CBadge.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CBadge } from '../index' - -test('loads and displays CBadge component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CBadge customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('badge') - expect(container.firstChild).toHaveClass('bg-warning') - expect(container.firstChild).toHaveClass('rounded') -}) diff --git a/packages/coreui-react/src/components/badge/__tests__/__snapshots__/CBadge.spec.tsx.snap b/packages/coreui-react/src/components/badge/__tests__/__snapshots__/CBadge.spec.tsx.snap deleted file mode 100644 index 909bd2b5..00000000 --- a/packages/coreui-react/src/components/badge/__tests__/__snapshots__/CBadge.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CBadge customize 1`] = ` -
-
- Test -
-
-`; - -exports[`loads and displays CBadge component 1`] = ` -
- - Test - -
-`; diff --git a/packages/coreui-react/src/components/badge/index.ts b/packages/coreui-react/src/components/badge/index.ts deleted file mode 100644 index 689638b2..00000000 --- a/packages/coreui-react/src/components/badge/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CBadge } from './CBadge' - -export { CBadge } diff --git a/packages/coreui-react/src/components/breadcrumb/CBreadcrumb.tsx b/packages/coreui-react/src/components/breadcrumb/CBreadcrumb.tsx deleted file mode 100644 index 4802828c..00000000 --- a/packages/coreui-react/src/components/breadcrumb/CBreadcrumb.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CBreadcrumbProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CBreadcrumb = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - ) - }, -) - -CBreadcrumb.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CBreadcrumb.displayName = 'CBreadcrumb' diff --git a/packages/coreui-react/src/components/breadcrumb/CBreadcrumbItem.tsx b/packages/coreui-react/src/components/breadcrumb/CBreadcrumbItem.tsx deleted file mode 100644 index fab4ec69..00000000 --- a/packages/coreui-react/src/components/breadcrumb/CBreadcrumbItem.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink } from '../link/CLink' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CBreadcrumbItemProps extends HTMLAttributes { - /** - * Toggle the active state for the component. - */ - active?: boolean - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - * @since 5.4.0 - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * The `href` attribute for the inner `` component. - */ - href?: string -} - -export const CBreadcrumbItem: PolymorphicRefForwardingComponent<'li', CBreadcrumbItemProps> = - forwardRef( - ({ children, active, as, className, href, ...rest }, ref) => { - return ( -
  • - {href ? ( - - {children} - - ) : ( - children - )} -
  • - ) - }, - ) - -CBreadcrumbItem.propTypes = { - active: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - href: PropTypes.string, -} - -CBreadcrumbItem.displayName = 'CBreadcrumbItem' diff --git a/packages/coreui-react/src/components/breadcrumb/__tests__/CBreadcrumb.spec.tsx b/packages/coreui-react/src/components/breadcrumb/__tests__/CBreadcrumb.spec.tsx deleted file mode 100644 index 9254313c..00000000 --- a/packages/coreui-react/src/components/breadcrumb/__tests__/CBreadcrumb.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CBreadcrumb, CBreadcrumbItem } from '../index' - -test('loads and displays CBreadcrumb component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CBreadcrumb customize', async () => { - const { container } = render( - - Test A - Test B - Test C - , - ) - const ol = container.querySelector('ol') - expect(container).toMatchSnapshot() - expect(ol).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/breadcrumb/__tests__/CBreadcrumbItem.spec.tsx b/packages/coreui-react/src/components/breadcrumb/__tests__/CBreadcrumbItem.spec.tsx deleted file mode 100644 index fff97974..00000000 --- a/packages/coreui-react/src/components/breadcrumb/__tests__/CBreadcrumbItem.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CBreadcrumbItem } from '../index' - -test('loads and displays CBreadcrumbItem component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CBreadcrumbItem customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('breadcrumb-item') - expect(container.firstChild).toHaveClass('active') -}) diff --git a/packages/coreui-react/src/components/breadcrumb/__tests__/__snapshots__/CBreadcrumb.spec.tsx.snap b/packages/coreui-react/src/components/breadcrumb/__tests__/__snapshots__/CBreadcrumb.spec.tsx.snap deleted file mode 100644 index 347521b1..00000000 --- a/packages/coreui-react/src/components/breadcrumb/__tests__/__snapshots__/CBreadcrumb.spec.tsx.snap +++ /dev/null @@ -1,42 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CBreadcrumb customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CBreadcrumb component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/breadcrumb/__tests__/__snapshots__/CBreadcrumbItem.spec.tsx.snap b/packages/coreui-react/src/components/breadcrumb/__tests__/__snapshots__/CBreadcrumbItem.spec.tsx.snap deleted file mode 100644 index 9b5b54cb..00000000 --- a/packages/coreui-react/src/components/breadcrumb/__tests__/__snapshots__/CBreadcrumbItem.spec.tsx.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CBreadcrumbItem customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CBreadcrumbItem component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/breadcrumb/index.ts b/packages/coreui-react/src/components/breadcrumb/index.ts deleted file mode 100644 index d402a910..00000000 --- a/packages/coreui-react/src/components/breadcrumb/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CBreadcrumb } from './CBreadcrumb' -import { CBreadcrumbItem } from './CBreadcrumbItem' - -export { CBreadcrumb, CBreadcrumbItem } diff --git a/packages/coreui-react/src/components/button-group/CButtonGroup.tsx b/packages/coreui-react/src/components/button-group/CButtonGroup.tsx deleted file mode 100644 index 108dcbcd..00000000 --- a/packages/coreui-react/src/components/button-group/CButtonGroup.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CButtonGroupProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' - /** - * Create a set of buttons that appear vertically stacked rather than horizontally. Split button dropdowns are not supported here. - */ - vertical?: boolean -} - -export const CButtonGroup = forwardRef( - ({ children, className, size, vertical, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CButtonGroup.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - size: PropTypes.oneOf(['sm', 'lg']), - vertical: PropTypes.bool, -} - -CButtonGroup.displayName = 'CButtonGroup' diff --git a/packages/coreui-react/src/components/button-group/CButtonToolbar.tsx b/packages/coreui-react/src/components/button-group/CButtonToolbar.tsx deleted file mode 100644 index fe670b85..00000000 --- a/packages/coreui-react/src/components/button-group/CButtonToolbar.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CButtonToolbarProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CButtonToolbar = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CButtonToolbar.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CButtonToolbar.displayName = 'CButtonToolbar' diff --git a/packages/coreui-react/src/components/button-group/__tests__/CButtonGroup.spec.tsx b/packages/coreui-react/src/components/button-group/__tests__/CButtonGroup.spec.tsx deleted file mode 100644 index b7bd6195..00000000 --- a/packages/coreui-react/src/components/button-group/__tests__/CButtonGroup.spec.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CButton } from '../../button/CButton' -import { CButtonGroup } from '../index' - -test('loads and displays CButtonGroup component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CButtonGroup customize', async () => { - const { container } = render( - - Test A - Test B - Test C - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('btn-group') - expect(container.firstChild).toHaveClass('btn-group-lg') -}) - -test('CButtonGroup customize vertical', async () => { - const { container } = render( - - Test A - Test B - Test C - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('btn-group-vertical') - expect(container.firstChild).toHaveClass('btn-group-lg') -}) diff --git a/packages/coreui-react/src/components/button-group/__tests__/CButtonToolbar.spec.tsx b/packages/coreui-react/src/components/button-group/__tests__/CButtonToolbar.spec.tsx deleted file mode 100644 index fd7706b8..00000000 --- a/packages/coreui-react/src/components/button-group/__tests__/CButtonToolbar.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CButton } from '../../button/CButton' -import { CButtonToolbar, CButtonGroup } from '../index' - -test('loads and displays CButtonToolbar component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CButtonToolbar customize', async () => { - const { container } = render( - - - 1 - 2 - 3 - - - A - B - C - - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('btn-toolbar') -}) diff --git a/packages/coreui-react/src/components/button-group/__tests__/__snapshots__/CButtonGroup.spec.tsx.snap b/packages/coreui-react/src/components/button-group/__tests__/__snapshots__/CButtonGroup.spec.tsx.snap deleted file mode 100644 index e6404da6..00000000 --- a/packages/coreui-react/src/components/button-group/__tests__/__snapshots__/CButtonGroup.spec.tsx.snap +++ /dev/null @@ -1,63 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CButtonGroup customize 1`] = ` -
    -
    - - - -
    -
    -`; - -exports[`CButtonGroup customize vertical 1`] = ` -
    -
    - - - -
    -
    -`; - -exports[`loads and displays CButtonGroup component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/button-group/__tests__/__snapshots__/CButtonToolbar.spec.tsx.snap b/packages/coreui-react/src/components/button-group/__tests__/__snapshots__/CButtonToolbar.spec.tsx.snap deleted file mode 100644 index fb8de188..00000000 --- a/packages/coreui-react/src/components/button-group/__tests__/__snapshots__/CButtonToolbar.spec.tsx.snap +++ /dev/null @@ -1,66 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CButtonToolbar customize 1`] = ` -
    -
    -
    - - - -
    -
    - - - -
    -
    -
    -`; - -exports[`loads and displays CButtonToolbar component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/button-group/index.ts b/packages/coreui-react/src/components/button-group/index.ts deleted file mode 100644 index 2168c935..00000000 --- a/packages/coreui-react/src/components/button-group/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CButtonToolbar } from './CButtonToolbar' -import { CButtonGroup } from './CButtonGroup' - -export { CButtonToolbar, CButtonGroup } diff --git a/packages/coreui-react/src/components/button/CButton.tsx b/packages/coreui-react/src/components/button/CButton.tsx deleted file mode 100644 index cbb003d7..00000000 --- a/packages/coreui-react/src/components/button/CButton.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import React, { ElementType, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink, CLinkProps } from '../link/CLink' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { colorPropType } from '../../props' -import type { Colors, Shapes } from '../../types' - -export interface CButtonProps extends Omit { - /** - * Toggle the active state for the component. - */ - active?: boolean - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * The href attribute specifies the URL of the page the link goes to. - */ - href?: string - /** - * The role attribute describes the role of an element in programs that can make use of it, such as screen readers or magnifiers. - */ - role?: string - /** - * 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' - /** - * Specifies the type of button. Always specify the type attribute for the ` -
    -`; diff --git a/packages/coreui-react/src/components/button/index.ts b/packages/coreui-react/src/components/button/index.ts deleted file mode 100644 index ad90d817..00000000 --- a/packages/coreui-react/src/components/button/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CButton } from './CButton' - -export { CButton } diff --git a/packages/coreui-react/src/components/callout/CCallout.tsx b/packages/coreui-react/src/components/callout/CCallout.tsx deleted file mode 100644 index d0f65224..00000000 --- a/packages/coreui-react/src/components/callout/CCallout.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CCalloutProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 -} - -export const CCallout = forwardRef( - ({ children, className, color, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CCallout.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CCallout.displayName = 'CCallout' diff --git a/packages/coreui-react/src/components/callout/__tests__/CCallout.spec.tsx b/packages/coreui-react/src/components/callout/__tests__/CCallout.spec.tsx deleted file mode 100644 index 637727c7..00000000 --- a/packages/coreui-react/src/components/callout/__tests__/CCallout.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCallout } from '../index' - -test('loads and displays CCallout component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCallout customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('callout') - expect(container.firstChild).toHaveClass('callout-primary') -}) diff --git a/packages/coreui-react/src/components/callout/__tests__/__snapshots__/CCallout.spec.tsx.snap b/packages/coreui-react/src/components/callout/__tests__/__snapshots__/CCallout.spec.tsx.snap deleted file mode 100644 index f11a87de..00000000 --- a/packages/coreui-react/src/components/callout/__tests__/__snapshots__/CCallout.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCallout customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CCallout component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/callout/index.ts b/packages/coreui-react/src/components/callout/index.ts deleted file mode 100644 index ebf0d06e..00000000 --- a/packages/coreui-react/src/components/callout/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CCallout } from './CCallout' - -export { CCallout } diff --git a/packages/coreui-react/src/components/card/CCard.tsx b/packages/coreui-react/src/components/card/CCard.tsx deleted file mode 100644 index 7b42223e..00000000 --- a/packages/coreui-react/src/components/card/CCard.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CCardProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Sets the text color context of the component to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string - */ - textColor?: string - /** - * Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - * @since 5.0.0 - */ - textBgColor?: Colors -} - -export const CCard = forwardRef( - ({ children, className, color, textBgColor, textColor, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CCard.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - textBgColor: colorPropType, - textColor: PropTypes.string, -} - -CCard.displayName = 'CCard' diff --git a/packages/coreui-react/src/components/card/CCardBody.tsx b/packages/coreui-react/src/components/card/CCardBody.tsx deleted file mode 100644 index f977e837..00000000 --- a/packages/coreui-react/src/components/card/CCardBody.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CCardBodyProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CCardBody = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CCardBody.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CCardBody.displayName = 'CCardBody' diff --git a/packages/coreui-react/src/components/card/CCardFooter.tsx b/packages/coreui-react/src/components/card/CCardFooter.tsx deleted file mode 100644 index 054f2851..00000000 --- a/packages/coreui-react/src/components/card/CCardFooter.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import PropTypes from 'prop-types' -import React, { forwardRef, HTMLAttributes } from 'react' -import classNames from 'classnames' - -export interface CCardFooterProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CCardFooter = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CCardFooter.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CCardFooter.displayName = 'CCardFooter' diff --git a/packages/coreui-react/src/components/card/CCardGroup.tsx b/packages/coreui-react/src/components/card/CCardGroup.tsx deleted file mode 100644 index 042e6ade..00000000 --- a/packages/coreui-react/src/components/card/CCardGroup.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CCardGroupProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CCardGroup = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CCardGroup.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CCardGroup.displayName = 'CCardGroup' diff --git a/packages/coreui-react/src/components/card/CCardHeader.tsx b/packages/coreui-react/src/components/card/CCardHeader.tsx deleted file mode 100644 index 70b1e114..00000000 --- a/packages/coreui-react/src/components/card/CCardHeader.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CCardHeaderProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CCardHeader: PolymorphicRefForwardingComponent<'div', CCardHeaderProps> = forwardRef< - HTMLDivElement, - CCardHeaderProps ->(({ children, as: Component = 'div', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CCardHeader.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CCardHeader.displayName = 'CCardHeader' diff --git a/packages/coreui-react/src/components/card/CCardImage.tsx b/packages/coreui-react/src/components/card/CCardImage.tsx deleted file mode 100644 index 93462342..00000000 --- a/packages/coreui-react/src/components/card/CCardImage.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React, { ElementType, forwardRef, ImgHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CCardImageProps - extends ImgHTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Optionally orientate the image to the top, bottom, or make it overlaid across the card. - */ - orientation?: 'top' | 'bottom' -} - -export const CCardImage: PolymorphicRefForwardingComponent<'img', CCardImageProps> = forwardRef< - HTMLImageElement | HTMLOrSVGElement | HTMLOrSVGImageElement, - CCardImageProps ->(({ children, as: Component = 'img', className, orientation, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CCardImage.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - orientation: PropTypes.oneOf(['top', 'bottom']), -} - -CCardImage.displayName = 'CCardImage' diff --git a/packages/coreui-react/src/components/card/CCardImageOverlay.tsx b/packages/coreui-react/src/components/card/CCardImageOverlay.tsx deleted file mode 100644 index 7f8ba71a..00000000 --- a/packages/coreui-react/src/components/card/CCardImageOverlay.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CCardImageOverlayProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CCardImageOverlay = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CCardImageOverlay.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CCardImageOverlay.displayName = 'CCardImageOverlay' diff --git a/packages/coreui-react/src/components/card/CCardLink.tsx b/packages/coreui-react/src/components/card/CCardLink.tsx deleted file mode 100644 index 9bf10db0..00000000 --- a/packages/coreui-react/src/components/card/CCardLink.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React, { AnchorHTMLAttributes, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink } from '../link/CLink' - -export interface CCardLinkProps extends AnchorHTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * The href attribute specifies the URL of the page the link goes to. - */ - href?: string -} - -export const CCardLink = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CCardLink.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CCardLink.displayName = 'CCardLink' diff --git a/packages/coreui-react/src/components/card/CCardSubtitle.tsx b/packages/coreui-react/src/components/card/CCardSubtitle.tsx deleted file mode 100644 index 0007ef27..00000000 --- a/packages/coreui-react/src/components/card/CCardSubtitle.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CCardSubtitleProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CCardSubtitle: PolymorphicRefForwardingComponent<'h6', CCardSubtitleProps> = - forwardRef( - ({ children, as: Component = 'h6', className, ...rest }, ref) => { - return ( - - {children} - - ) - }, - ) - -CCardSubtitle.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CCardSubtitle.displayName = 'CCardSubtitle' diff --git a/packages/coreui-react/src/components/card/CCardText.tsx b/packages/coreui-react/src/components/card/CCardText.tsx deleted file mode 100644 index 6e8e03f4..00000000 --- a/packages/coreui-react/src/components/card/CCardText.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CCardTextProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CCardText: PolymorphicRefForwardingComponent<'p', CCardTextProps> = forwardRef< - HTMLParagraphElement, - CCardTextProps ->(({ children, as: Component = 'p', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CCardText.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CCardText.displayName = 'CCardText' diff --git a/packages/coreui-react/src/components/card/CCardTitle.tsx b/packages/coreui-react/src/components/card/CCardTitle.tsx deleted file mode 100644 index 0b9e5ce1..00000000 --- a/packages/coreui-react/src/components/card/CCardTitle.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CCardTitleProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CCardTitle: PolymorphicRefForwardingComponent<'h5', CCardTitleProps> = forwardRef< - HTMLHeadingElement, - CCardTitleProps ->(({ children, as: Component = 'h5', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CCardTitle.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CCardTitle.displayName = 'CCardTitle' diff --git a/packages/coreui-react/src/components/card/__tests__/CCard.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCard.spec.tsx deleted file mode 100644 index 6b4f9b11..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCard.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCard } from '../index' - -test('loads and displays CCard component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCard customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card') - expect(container.firstChild).toHaveClass('bg-primary') - expect(container.firstChild).toHaveClass('text-warning') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardBody.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardBody.spec.tsx deleted file mode 100644 index 0bf1ccd9..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardBody.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardBody } from '../index' - -test('loads and displays CCardBody component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardBody customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-body') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardFooter.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardFooter.spec.tsx deleted file mode 100644 index 991e3c7c..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardFooter.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardFooter } from '../index' - -test('loads and displays CCardFooter component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardFooter customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-footer') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardGroup.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardGroup.spec.tsx deleted file mode 100644 index 239c1fd9..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardGroup.spec.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { - CCard, - CCardBody, - CCardFooter, - CCardHeader, - CCardImage, - CCardLink, - CCardSubtitle, - CCardTitle, - CCardText, - CCardGroup, -} from '../index' - -test('loads and displays CCardGroup component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardGroup customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-group') -}) - -test('CCardGroup full example', async () => { - const { container } = render( - - - Image - Header - - Title - Subtitle - Text - Link - - Footer - - - - Card Title - - - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardHeader.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardHeader.spec.tsx deleted file mode 100644 index 0477b503..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardHeader.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardHeader } from '../index' - -test('loads and displays CCardHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardHeader customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-header') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardImage.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardImage.spec.tsx deleted file mode 100644 index e1214093..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardImage.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardImage } from '../index' - -test('loads and displays CCardImage component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CCardImage customize', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-img-bottom') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardImageOverlay.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardImageOverlay.spec.tsx deleted file mode 100644 index 6574856b..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardImageOverlay.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardImageOverlay } from '../index' - -test('loads and displays CCardImageOverlay component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CCardImageOverlay customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('card-img-overlay') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardLink.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardLink.spec.tsx deleted file mode 100644 index 2373537f..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardLink.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardLink } from '../index' - -test('loads and displays CCardLink component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardLink customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-link') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardSubtitle.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardSubtitle.spec.tsx deleted file mode 100644 index 8a23f9c8..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardSubtitle.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardSubtitle } from '../index' - -test('loads and displays CCardSubtitle component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardSubtitle customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-subtitle') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardText.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardText.spec.tsx deleted file mode 100644 index 3cbb4ab2..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardText.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardText } from '../index' - -test('loads and displays CCardText component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardText customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-text') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/CCardTitle.spec.tsx b/packages/coreui-react/src/components/card/__tests__/CCardTitle.spec.tsx deleted file mode 100644 index 9733a7f4..00000000 --- a/packages/coreui-react/src/components/card/__tests__/CCardTitle.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCardTitle } from '../index' - -test('loads and displays CCardTitle component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCardTitle customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card-title') -}) diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCard.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCard.spec.tsx.snap deleted file mode 100644 index 974a299e..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCard.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCard customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CCard component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardBody.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardBody.spec.tsx.snap deleted file mode 100644 index 9944febc..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardBody.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardBody customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CCardBody component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardFooter.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardFooter.spec.tsx.snap deleted file mode 100644 index 21370454..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardFooter.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardFooter customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CCardFooter component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardGroup.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardGroup.spec.tsx.snap deleted file mode 100644 index ede6c3bb..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardGroup.spec.tsx.snap +++ /dev/null @@ -1,86 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardGroup customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CCardGroup full example 1`] = ` -
    -
    -
    - - Image - -
    - Header -
    -
    -
    - Title -
    -
    - Subtitle -
    -

    - Text -

    - - Link - -
    - -
    -
    -
    -
    - Card Title -
    -
    -
    -
    -
    -`; - -exports[`loads and displays CCardGroup component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardHeader.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardHeader.spec.tsx.snap deleted file mode 100644 index a2a1b231..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardHeader.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardHeader customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`loads and displays CCardHeader component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardImage.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardImage.spec.tsx.snap deleted file mode 100644 index 1d0e0b69..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardImage.spec.tsx.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardImage customize 1`] = ` -
    -
    -
    -`; - -exports[`loads and displays CCardImage component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardImageOverlay.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardImageOverlay.spec.tsx.snap deleted file mode 100644 index 5de8dbbc..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardImageOverlay.spec.tsx.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardImageOverlay customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CCardImageOverlay component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardLink.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardLink.spec.tsx.snap deleted file mode 100644 index 5e588fe2..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardLink.spec.tsx.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardLink customize 1`] = ` - -`; - -exports[`loads and displays CCardLink component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardSubtitle.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardSubtitle.spec.tsx.snap deleted file mode 100644 index 67eddd18..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardSubtitle.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardSubtitle customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`loads and displays CCardSubtitle component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardText.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardText.spec.tsx.snap deleted file mode 100644 index 11805df4..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardText.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardText customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`loads and displays CCardText component 1`] = ` -
    -

    - Test -

    -
    -`; diff --git a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardTitle.spec.tsx.snap b/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardTitle.spec.tsx.snap deleted file mode 100644 index e8ba2c9a..00000000 --- a/packages/coreui-react/src/components/card/__tests__/__snapshots__/CCardTitle.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCardTitle customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`loads and displays CCardTitle component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/card/index.ts b/packages/coreui-react/src/components/card/index.ts deleted file mode 100644 index 21c35dd8..00000000 --- a/packages/coreui-react/src/components/card/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { CCard } from './CCard' -import { CCardBody } from './CCardBody' -import { CCardFooter } from './CCardFooter' -import { CCardGroup } from './CCardGroup' -import { CCardHeader } from './CCardHeader' -import { CCardImage } from './CCardImage' -import { CCardImageOverlay } from './CCardImageOverlay' -import { CCardLink } from './CCardLink' -import { CCardSubtitle } from './CCardSubtitle' -import { CCardText } from './CCardText' -import { CCardTitle } from './CCardTitle' - -export { - CCard, - CCardBody, - CCardFooter, - CCardGroup, - CCardHeader, - CCardImage, - CCardImageOverlay, - CCardLink, - CCardSubtitle, - CCardText, - CCardTitle, -} diff --git a/packages/coreui-react/src/components/carousel/CCarousel.tsx b/packages/coreui-react/src/components/carousel/CCarousel.tsx deleted file mode 100644 index 3d3186d3..00000000 --- a/packages/coreui-react/src/components/carousel/CCarousel.tsx +++ /dev/null @@ -1,304 +0,0 @@ -import React, { - Children, - forwardRef, - HTMLAttributes, - TouchEvent, - useState, - useEffect, - useRef, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { isInViewport } from '../../utils' -import { useForkedRef } from '../../hooks' - -import { CCarouselContext } from './CCarouselContext' - -export interface CCarouselProps extends HTMLAttributes { - /** - * index of the active item. - */ - activeIndex?: number - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Adding in the previous and next controls. - */ - controls?: boolean - /** - * Add darker controls, indicators, and captions. - */ - dark?: boolean - /** - * The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. - */ - interval?: boolean | number - /** - * Adding indicators at the bottom of the carousel for each item. - */ - indicators?: boolean - /** - * Callback fired when a slide transition end. - */ - onSlid?: (active: number, direction: string) => void - /** - * Callback fired when a slide transition starts. - */ - onSlide?: (active: number, direction: string) => void - /** - * If set to 'hover', pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. If set to false, hovering over the carousel won't pause it. - */ - pause?: boolean | 'hover' - /** - * Set whether the carousel should support left/right swipe interactions on touchscreen devices. - * - * @since 4.5.0 - */ - touch?: boolean - /** - * Set type of the transition. - */ - transition?: 'slide' | 'crossfade' - /** - * Set whether the carousel should cycle continuously or have hard stops. - */ - wrap?: boolean -} - -interface DataType { - timeout?: null | ReturnType -} - -export const CCarousel = forwardRef( - ( - { - children, - activeIndex = 0, - className, - controls, - dark, - indicators, - interval = 5000, - onSlid, - onSlide, - pause = 'hover', - touch = true, - transition, - wrap = true, - ...rest - }, - ref - ) => { - const carouselRef = useRef(null) - const forkedRef = useForkedRef(ref, carouselRef) - const data = useRef({}).current - - const [active, setActive] = useState(activeIndex) - const [animating, setAnimating] = useState(false) - const [customInterval, setCustomInterval] = useState() - const [direction, setDirection] = useState('next') - const [itemsNumber, setItemsNumber] = useState(0) - const [touchPosition, setTouchPosition] = useState(null) - const [visible, setVisible] = useState() - - useEffect(() => { - setItemsNumber(Children.toArray(children).length) - }) - - useEffect(() => { - visible && cycle() - }, [visible]) - - useEffect(() => { - !animating && cycle() - !animating && onSlid && onSlid(active, direction) - animating && onSlide && onSlide(active, direction) - }, [animating]) - - useEffect(() => { - window.addEventListener('scroll', handleScroll) - - return () => { - window.removeEventListener('scroll', handleScroll) - } - }) - - const cycle = () => { - _pause() - if (!wrap && active === itemsNumber - 1) { - return - } - - if (typeof interval === 'number') { - data.timeout = setTimeout( - () => nextItemWhenVisible(), - typeof customInterval === 'number' ? customInterval : interval - ) - } - } - const _pause = () => pause && data.timeout && clearTimeout(data.timeout) - - const nextItemWhenVisible = () => { - // Don't call next when the page isn't visible - // or the carousel or its parent isn't visible - if (!document.hidden && carouselRef.current && isInViewport(carouselRef.current)) { - if (animating) { - return - } - handleControlClick('next') - } - } - - const handleControlClick = (direction: string) => { - if (animating) { - return - } - setDirection(direction) - if (direction === 'next') { - active === itemsNumber - 1 ? setActive(0) : setActive(active + 1) - } else { - active === 0 ? setActive(itemsNumber - 1) : setActive(active - 1) - } - } - - const handleIndicatorClick = (index: number) => { - if (active === index) { - return - } - - if (active < index) { - setDirection('next') - setActive(index) - return - } - - if (active > index) { - setDirection('prev') - setActive(index) - } - } - - const handleScroll = () => { - if (!document.hidden && carouselRef.current && isInViewport(carouselRef.current)) { - setVisible(true) - } else { - setVisible(false) - } - } - - const handleTouchMove = (e: TouchEvent) => { - const touchDown = touchPosition - - if (touchDown === null) { - return - } - - const currentTouch = e.touches[0].clientX - const diff = touchDown - currentTouch - - if (diff > 5) { - handleControlClick('next') - } - - if (diff < -5) { - handleControlClick('prev') - } - - setTouchPosition(null) - } - - const handleTouchStart = (e: TouchEvent) => { - const touchDown = e.touches[0].clientX - setTouchPosition(touchDown) - } - - return ( -
    - - {indicators && ( -
    - {Array.from({ length: itemsNumber }, (_, i) => i).map((index) => { - return ( -
    - )} -
    - {Children.map(children, (child, index) => { - if (React.isValidElement(child)) { - return React.cloneElement(child as React.ReactElement, { - active: active === index ? true : false, - direction: direction, - key: index, - }) - } - return - })} -
    - {controls && ( - <> - - - - )} -
    -
    - ) - } -) - -CCarousel.propTypes = { - activeIndex: PropTypes.number, - children: PropTypes.node, - className: PropTypes.string, - controls: PropTypes.bool, - dark: PropTypes.bool, - indicators: PropTypes.bool, - interval: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]), - onSlid: PropTypes.func, - onSlide: PropTypes.func, - pause: PropTypes.oneOf([false, 'hover']), - touch: PropTypes.bool, - transition: PropTypes.oneOf(['slide', 'crossfade']), - wrap: PropTypes.bool, -} - -CCarousel.displayName = 'CCarousel' diff --git a/packages/coreui-react/src/components/carousel/CCarouselCaption.tsx b/packages/coreui-react/src/components/carousel/CCarouselCaption.tsx deleted file mode 100644 index 353a6b1b..00000000 --- a/packages/coreui-react/src/components/carousel/CCarouselCaption.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CCarouselCaptionProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CCarouselCaption = forwardRef( - ({ className, ...rest }, ref) => { - return
    - } -) - -CCarouselCaption.propTypes = { - className: PropTypes.string, -} - -CCarouselCaption.displayName = 'CCarouselCaption' diff --git a/packages/coreui-react/src/components/carousel/CCarouselContext.ts b/packages/coreui-react/src/components/carousel/CCarouselContext.ts deleted file mode 100644 index 6e21932b..00000000 --- a/packages/coreui-react/src/components/carousel/CCarouselContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createContext } from 'react' - -export interface CCarouselContextProps { - setAnimating: (a: boolean) => void - setCustomInterval: (a: boolean | number) => void -} - -export const CCarouselContext = createContext({} as CCarouselContextProps) \ No newline at end of file diff --git a/packages/coreui-react/src/components/carousel/CCarouselItem.tsx b/packages/coreui-react/src/components/carousel/CCarouselItem.tsx deleted file mode 100644 index 90f4f6ca..00000000 --- a/packages/coreui-react/src/components/carousel/CCarouselItem.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext, useEffect, useState, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { useForkedRef } from '../../hooks' - -import { CCarouselContext } from './CCarouselContext' - -export interface CCarouselItemProps extends HTMLAttributes { - /** - * @ignore - */ - active?: boolean - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * @ignore - */ - direction?: string - /** - * The amount of time to delay between automatically cycling an item. - */ - interval?: boolean | number -} - -export const CCarouselItem = forwardRef( - ({ children, className, active, direction, interval = false, ...rest }, ref) => { - const { setAnimating, setCustomInterval } = useContext(CCarouselContext) - const carouselItemRef = useRef(null) - const forkedRef = useForkedRef(ref, carouselItemRef) - - const prevActive = useRef(undefined) - const [directionClassName, setDirectionClassName] = useState() - const [orderClassName, setOrderClassName] = useState() - const [activeClassName, setActiveClassName] = useState(active && 'active') - const [count, setCount] = useState(0) - - useEffect(() => { - if (active) { - setCustomInterval(interval) - if (count !== 0) setOrderClassName(`carousel-item-${direction}`) - } - - if (prevActive.current && !active) { - setActiveClassName('active') - } - - if (active || prevActive.current) { - setTimeout(() => { - if (count !== 0) { - // @ts-expect-error reflow is necessary to proper transition - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const reflow = carouselItemRef.current?.offsetHeight - setDirectionClassName(`carousel-item-${direction === 'next' ? 'start' : 'end'}`) - } - }, 0) - } - - prevActive.current = active - - if (count === 0) setCount(count + 1) - }, [active]) - - useEffect(() => { - carouselItemRef.current?.addEventListener('transitionstart', () => { - active && setAnimating(true) - }) - carouselItemRef.current?.addEventListener('transitionend', () => { - active && setAnimating(false) - setDirectionClassName('') - setOrderClassName('') - if (active) { - setActiveClassName('active') - } - if (!active) { - setActiveClassName('') - } - }) - return () => { - carouselItemRef.current?.removeEventListener('transitionstart', () => { - active && setAnimating(true) - }) - carouselItemRef.current?.removeEventListener('transitionend', () => { - active && setAnimating(false) - setDirectionClassName('') - setOrderClassName('') - if (active) { - setActiveClassName('active') - } - if (!active) { - setActiveClassName('') - } - }) - } - }) - - return ( -
    - {children} -
    - ) - } -) - -CCarouselItem.propTypes = { - active: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - direction: PropTypes.string, - interval: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]), -} - -CCarouselItem.displayName = 'CCarouselItem' diff --git a/packages/coreui-react/src/components/carousel/__tests__/CCarousel.spec.tsx b/packages/coreui-react/src/components/carousel/__tests__/CCarousel.spec.tsx deleted file mode 100644 index c681e5b7..00000000 --- a/packages/coreui-react/src/components/carousel/__tests__/CCarousel.spec.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import React from 'react' -import { render, fireEvent, getByText } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCarousel, CCarouselCaption, CCarouselItem } from '../index' - -test('loads and displays CCarousel component', async () => { - const { container } = render( - - - Item-1 - Caption-1 - - - Item-2 - Caption-2 - - - Item-3 - Caption-3 - - , - ) - - const carousel = document.querySelector('.carousel') - expect(carousel).toHaveClass('slide') - if (carousel === null) { - expect(true).toBe(false) - } else { - expect(carousel.children[0]).toHaveClass('carousel-indicators') - expect(carousel.children[1]).toHaveClass('carousel-inner') - } - - let caption = getByText(container, 'Caption-1') - expect(caption).toHaveClass('carousel-caption') - caption = getByText(container, 'Caption-2') - expect(caption).toHaveClass('carousel-caption') - caption = getByText(container, 'Caption-3') - expect(caption).toHaveClass('carousel-caption') - let item = getByText(container, 'Item-1') - expect(item).toHaveClass('carousel-item') - item = getByText(container, 'Item-2') - expect(item).toHaveClass('carousel-item') - item = getByText(container, 'Item-3') - expect(item).toHaveClass('carousel-item') - - let button = document.querySelector('.carousel-control-next') - if (button === null) { - expect(true).toBe(false) - } else { - expect(button.firstChild).toHaveClass('carousel-control-next-icon') - } - button = document.querySelector('.carousel-control-prev') - if (button === null) { - expect(true).toBe(false) - } else { - expect(button.firstChild).toHaveClass('carousel-control-prev-icon') - } - - expect(container).toMatchSnapshot() -}) - -test('CCarousel click on indicator', async () => { - const { container } = render( - - - Item-1 - Caption-1 - - - Item-2 - Caption-2 - - - Item-3 - Caption-3 - - , - ) - const item1 = getByText(container, 'Item-1') - const item2 = getByText(container, 'Item-2') - - expect(item1).toHaveClass('active') - expect(item1).toHaveClass('carousel-item') - expect(item2).not.toHaveClass('active') - expect(item2).toHaveClass('carousel-item') - - // click - const ci = document.querySelector('.carousel-indicators') - ci && fireEvent.click(ci.children[1]) - fireEvent.transitionEnd(item1) - fireEvent.transitionEnd(item2) - - expect(item1).not.toHaveClass('active') - expect(item2).toHaveClass('active') - - // goback-click - ci && fireEvent.click(ci.children[0]) - fireEvent.transitionEnd(item1) - fireEvent.transitionEnd(item2) - - expect(item1).toHaveClass('active') - expect(item2).not.toHaveClass('active') -}) - -test('CCarousel click on button', async () => { - jest.useFakeTimers() - const { container } = render( - - - Item-1 - Caption-1 - - - Item-2 - Caption-2 - - - Item-3 - Caption-3 - - , - ) - const item1 = getByText(container, 'Item-1') - const item2 = getByText(container, 'Item-2') - - expect(item1).toHaveClass('active') - expect(item1).toHaveClass('carousel-item') - expect(item2).not.toHaveClass('active') - expect(item2).toHaveClass('carousel-item') - - // click - const buttonNext = document.querySelector('.carousel-control-next') - buttonNext && fireEvent.click(buttonNext) - fireEvent.transitionEnd(item1) - fireEvent.transitionEnd(item2) - - expect(item1).not.toHaveClass('active') - expect(item2).toHaveClass('active') - - // goback-click - const buttonPrev = document.querySelector('.carousel-control-prev') - buttonPrev && fireEvent.click(buttonPrev) - fireEvent.transitionEnd(item1) - fireEvent.transitionEnd(item2) - - expect(item1).toHaveClass('active') - expect(item2).not.toHaveClass('active') -}) diff --git a/packages/coreui-react/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap b/packages/coreui-react/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap deleted file mode 100644 index 5d9045b1..00000000 --- a/packages/coreui-react/src/components/carousel/__tests__/__snapshots__/CCarousel.spec.tsx.snap +++ /dev/null @@ -1,80 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`loads and displays CCarousel component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/carousel/index.ts b/packages/coreui-react/src/components/carousel/index.ts deleted file mode 100644 index 7a5e23f5..00000000 --- a/packages/coreui-react/src/components/carousel/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CCarousel } from './CCarousel' -import { CCarouselCaption } from './CCarouselCaption' -import { CCarouselItem } from './CCarouselItem' - -export { CCarousel, CCarouselCaption, CCarouselItem } diff --git a/packages/coreui-react/src/components/close-button/CCloseButton.tsx b/packages/coreui-react/src/components/close-button/CCloseButton.tsx deleted file mode 100644 index 18c49fed..00000000 --- a/packages/coreui-react/src/components/close-button/CCloseButton.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CCloseButtonProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Invert the default color. - */ - dark?: boolean - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * Change the default color to white. - * - * @deprecated 5.0.0 - */ - white?: boolean -} - -export const CCloseButton = forwardRef( - ({ className, dark, disabled, white, ...rest }, ref) => { - return ( -
    -`; - -exports[`loads and displays CCloseButton component 1`] = ` -
    -
    -`; diff --git a/packages/coreui-react/src/components/close-button/index.ts b/packages/coreui-react/src/components/close-button/index.ts deleted file mode 100644 index 27d5574c..00000000 --- a/packages/coreui-react/src/components/close-button/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CCloseButton } from './CCloseButton' - -export { CCloseButton } diff --git a/packages/coreui-react/src/components/collapse/CCollapse.tsx b/packages/coreui-react/src/components/collapse/CCollapse.tsx deleted file mode 100644 index 4cb2773c..00000000 --- a/packages/coreui-react/src/components/collapse/CCollapse.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useRef, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { CSSTransition } from 'react-transition-group' - -import { useForkedRef } from '../../hooks' - -export interface CCollapseProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Set horizontal collapsing to transition the width instead of height. - */ - horizontal?: boolean - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Toggle the visibility of component. - */ - visible?: boolean -} - -export const CCollapse = forwardRef( - ({ children, className, horizontal, onHide, onShow, visible, ...rest }, ref) => { - const collapseRef = useRef(null) - const forkedRef = useForkedRef(ref, collapseRef) - - const [height, setHeight] = useState() - const [width, setWidth] = useState() - - const onEntering = () => { - onShow && onShow() - - if (horizontal) { - collapseRef.current && setWidth(collapseRef.current.scrollWidth) - return - } - collapseRef.current && setHeight(collapseRef.current.scrollHeight) - } - - const onEntered = () => { - if (horizontal) { - setWidth(0) - return - } - setHeight(0) - } - - const onExit = () => { - if (horizontal) { - collapseRef.current && setWidth(collapseRef.current.scrollWidth) - return - } - collapseRef.current && setHeight(collapseRef.current.scrollHeight) - } - - const onExiting = () => { - onHide && onHide() - if (horizontal) { - setWidth(0) - return - } - setHeight(0) - } - - const onExited = () => { - if (horizontal) { - setWidth(0) - return - } - setHeight(0) - } - - return ( - - {(state) => { - const currentHeight = height === 0 ? null : { height } - const currentWidth = width === 0 ? null : { width } - return ( -
    - {children} -
    - ) - }} -
    - ) - }, -) - -CCollapse.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - horizontal: PropTypes.bool, - onHide: PropTypes.func, - onShow: PropTypes.func, - visible: PropTypes.bool, -} - -CCollapse.displayName = 'CCollapse' diff --git a/packages/coreui-react/src/components/collapse/__tests__/CCollapse.spec.tsx b/packages/coreui-react/src/components/collapse/__tests__/CCollapse.spec.tsx deleted file mode 100644 index faee720d..00000000 --- a/packages/coreui-react/src/components/collapse/__tests__/CCollapse.spec.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react' -import { render, screen, act } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCollapse } from '../index' - -test('loads and displays CCollapse component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CCollapse customize', async () => { - const { container } = render(Test) - expect(container.firstChild).toHaveClass('bazinga') - expect(container).toMatchSnapshot() -}) - -test('CCollapse use case test', async () => { - jest.useFakeTimers() - - const { rerender } = render(Test) - - expect(screen.getByText('Test')).toHaveClass('collapse') - expect(screen.getByText('Test')).not.toHaveClass('show') - expect(screen.getByText('Test')).not.toHaveClass('collapsing') - - act(() => { - rerender(Test) - }) - - expect(screen.getByText('Test')).not.toHaveClass('collapse') - expect(screen.getByText('Test')).not.toHaveClass('show') - expect(screen.getByText('Test')).toHaveClass('collapsing') - - act(() => { - jest.runAllTimers() - }) - - expect(screen.getByText('Test')).toHaveClass('collapse') - expect(screen.getByText('Test')).toHaveClass('show') - expect(screen.getByText('Test')).not.toHaveClass('collapsing') - - act(() => { - rerender(Test) - }) - - expect(screen.getByText('Test')).not.toHaveClass('collapse') - expect(screen.getByText('Test')).not.toHaveClass('show') - expect(screen.getByText('Test')).toHaveClass('collapsing') - - act(() => { - jest.runAllTimers() - }) - - expect(screen.getByText('Test')).toHaveClass('collapse') - expect(screen.getByText('Test')).not.toHaveClass('show') - expect(screen.getByText('Test')).not.toHaveClass('collapsing') - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/collapse/__tests__/__snapshots__/CCollapse.spec.tsx.snap b/packages/coreui-react/src/components/collapse/__tests__/__snapshots__/CCollapse.spec.tsx.snap deleted file mode 100644 index b9a9df74..00000000 --- a/packages/coreui-react/src/components/collapse/__tests__/__snapshots__/CCollapse.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCollapse customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CCollapse component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/collapse/index.ts b/packages/coreui-react/src/components/collapse/index.ts deleted file mode 100644 index f277ff21..00000000 --- a/packages/coreui-react/src/components/collapse/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CCollapse } from './CCollapse' - -export { CCollapse } diff --git a/packages/coreui-react/src/components/conditional-portal/CConditionalPortal.tsx b/packages/coreui-react/src/components/conditional-portal/CConditionalPortal.tsx deleted file mode 100644 index ca9bea8c..00000000 --- a/packages/coreui-react/src/components/conditional-portal/CConditionalPortal.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, { FC, ReactNode, useEffect, useState } from 'react' -import { createPortal } from 'react-dom' -import PropTypes from 'prop-types' - -const getContainer = ( - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null, -) => { - if (container) { - return typeof container === 'function' ? container() : container - } - - return document.body -} - -export interface CConditionalPortalProps { - /** - * @ignore - */ - children: ReactNode - /** - * An HTML element or function that returns a single element, with `document.body` as the default. - * - * @since 4.11.0 - */ - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null - /** - * Render some children into a different part of the DOM - */ - portal: boolean -} - -export const CConditionalPortal: FC = ({ - children, - container, - portal, -}) => { - const [_container, setContainer] = useState>(null) - - useEffect(() => { - portal && setContainer(getContainer(container) || document.body) - }, [container, portal]) - - return typeof window !== 'undefined' && portal && _container ? ( - createPortal(children, _container) - ) : ( - <>{children} - ) -} - -CConditionalPortal.propTypes = { - children: PropTypes.node, - container: PropTypes.any, // HTMLElement - portal: PropTypes.bool.isRequired, -} - -CConditionalPortal.displayName = 'CConditionalPortal' diff --git a/packages/coreui-react/src/components/conditional-portal/index.ts b/packages/coreui-react/src/components/conditional-portal/index.ts deleted file mode 100644 index ab6cc3bc..00000000 --- a/packages/coreui-react/src/components/conditional-portal/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CConditionalPortal } from './CConditionalPortal' - -export { CConditionalPortal } diff --git a/packages/coreui-react/src/components/dropdown/CDropdown.tsx b/packages/coreui-react/src/components/dropdown/CDropdown.tsx deleted file mode 100644 index 5b5e35d4..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdown.tsx +++ /dev/null @@ -1,384 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes, useEffect, useRef, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import type { Options } from '@popperjs/core' - -import { CDropdownContext } from './CDropdownContext' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { useForkedRef, usePopper } from '../../hooks' -import { placementPropType } from '../../props' -import type { Placements } from '../../types' -import { getNextActiveElement, isRTL } from '../../utils' - -import type { Alignments, Directions } from './types' -import { getPlacement } from './utils' - -export interface CDropdownProps extends HTMLAttributes { - /** - * Specifies the alignment of the React Dropdown Menu within this React Dropdown. - * - * @example - * // Align dropdown menu to the end on large devices, otherwise start - * - * Toggle dropdown - * - * Action - * Another Action - * - * - * - * @type 'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'} - */ - alignment?: Alignments - - /** - * Determines the root node component (native HTML element or a custom React component) for the React Dropdown. - */ - as?: ElementType - - /** - * Configures automatic closing behavior for the React Dropdown: - * - `true` - Close on clicks inside or outside of the React Dropdown Menu. - * - `false` - Disable auto-close; manually call `hide` or `toggle` (also not closed by `Escape`). - * - `'inside'` - Close only when clicking inside the React Dropdown Menu. - * - `'outside'` - Close only when clicking outside the React Dropdown Menu. - * - * @example - * // Close only when user clicks outside of the menu - * - */ - autoClose?: 'inside' | 'outside' | boolean - - /** - * Adds custom classes to the React Dropdown root element. - */ - className?: string - - /** - * Appends the React Dropdown Menu to a specific element. You can pass an HTML element or a function returning an element. Defaults to `document.body`. - * - * @example - * // Append the menu to a custom container - * const myContainer = document.getElementById('my-container') - * - * - * - * @since 4.11.0 - */ - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null - - /** - * Applies a darker color scheme to the React Dropdown Menu, often used within dark navbars. - */ - dark?: boolean - - /** - * Specifies the direction of the React Dropdown. - */ - direction?: 'center' | 'dropup' | 'dropup-center' | 'dropend' | 'dropstart' - - /** - * Defines x and y offsets ([x, y]) for the React Dropdown Menu relative to its target. - * - * @example - * // Offset the menu 10px in X and 5px in Y direction - * - * ... - * - */ - offset?: [number, number] - - /** - * Callback fired right before the React Dropdown becomes hidden. - * - * @since 4.9.0 - */ - onHide?: () => void - - /** - * Callback fired immediately after the React Dropdown is displayed. - */ - onShow?: () => void - - /** - * Determines the placement of the React Dropdown Menu after Popper.js modifiers. - * - * @type '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' - */ - placement?: Placements - - /** - * Enables or disables dynamic positioning via Popper.js for the React Dropdown Menu. - */ - popper?: boolean - - /** - * Provides a custom Popper.js configuration or a function that returns a modified Popper.js configuration for advanced positioning of the React Dropdown Menu. [Read more](https://popper.js.org/docs/v2/constructors/#options) - * - * @example - * // Providing a custom popper config - * ... - * - * @since 5.5.0 - */ - popperConfig?: Partial | ((defaultPopperConfig: Partial) => Partial) - - /** - * Renders the React Dropdown Menu using a React Portal, allowing it to escape the DOM hierarchy for improved positioning. - * - * @since 4.8.0 - */ - portal?: boolean - - /** - * Defines the visual variant of the React Dropdown - */ - variant?: 'btn-group' | 'dropdown' | 'input-group' | 'nav-item' - - /** - * Controls the visibility of the React Dropdown Menu: - * - `true` - Visible - * - `false` - Hidden - * - * @example - * // Programmatically manage the dropdown visibility - * const [visible, setVisible] = useState(false) - * - * - * ... - * - * - */ - visible?: boolean -} - -export const CDropdown: PolymorphicRefForwardingComponent<'div', CDropdownProps> = forwardRef< - HTMLDivElement | HTMLLIElement, - CDropdownProps ->( - ( - { - children, - alignment, - as = 'div', - autoClose = true, - className, - container, - dark, - direction, - offset = [0, 2], - onHide, - onShow, - placement = 'bottom-start', - popper = true, - popperConfig, - portal = false, - variant = 'btn-group', - visible = false, - ...rest - }, - ref - ) => { - const dropdownRef = useRef(null) - const dropdownToggleRef = useRef(null) - const dropdownMenuRef = useRef(null) - const forkedRef = useForkedRef(ref, dropdownRef) - const [_visible, setVisible] = useState(visible) - const { initPopper, destroyPopper } = usePopper() - - const Component = variant === 'nav-item' ? 'li' : as - - // Disable popper if responsive aligment is set. - if (typeof alignment === 'object') { - popper = false - } - - const contextValues = { - alignment, - container, - dark, - dropdownToggleRef, - dropdownMenuRef, - popper, - portal, - variant, - visible: _visible, - setVisible, - } - - const defaultPopperConfig = { - modifiers: [ - { - name: 'offset', - options: { - offset: offset, - }, - }, - ], - placement: getPlacement(placement, direction, alignment, isRTL(dropdownMenuRef.current)), - } - - const computedPopperConfig: Partial = { - ...defaultPopperConfig, - ...(typeof popperConfig === 'function' ? popperConfig(defaultPopperConfig) : popperConfig), - } - - useEffect(() => { - setVisible(visible) - }, [visible]) - - useEffect(() => { - const toggleElement = dropdownToggleRef.current - const menuElement = dropdownMenuRef.current - - if (_visible && toggleElement && menuElement) { - if (popper) { - initPopper(toggleElement, menuElement, computedPopperConfig) - } - - toggleElement.focus() - toggleElement.addEventListener('keydown', handleKeydown) - menuElement.addEventListener('keydown', handleKeydown) - - window.addEventListener('mouseup', handleMouseUp) - window.addEventListener('keyup', handleKeyup) - - onShow?.() - } - - return () => { - if (popper) { - destroyPopper() - } - - toggleElement?.removeEventListener('keydown', handleKeydown) - menuElement?.removeEventListener('keydown', handleKeydown) - - window.removeEventListener('mouseup', handleMouseUp) - window.removeEventListener('keyup', handleKeyup) - - onHide?.() - } - }, [ - computedPopperConfig, - destroyPopper, - dropdownMenuRef, - dropdownToggleRef, - initPopper, - _visible, - ]) - - const handleKeydown = (event: KeyboardEvent) => { - if ( - _visible && - dropdownMenuRef.current && - (event.key === 'ArrowDown' || event.key === 'ArrowUp') - ) { - event.preventDefault() - const target = event.target as HTMLElement - const items: HTMLElement[] = Array.from( - dropdownMenuRef.current.querySelectorAll('.dropdown-item:not(.disabled):not(:disabled)') - ) - getNextActiveElement(items, target, event.key === 'ArrowDown', true).focus() - } - } - - const handleKeyup = (event: KeyboardEvent) => { - if (autoClose === false) { - return - } - - if (event.key === 'Escape') { - setVisible(false) - } - } - - const handleMouseUp = (event: Event) => { - if (!dropdownToggleRef.current || !dropdownMenuRef.current) { - return - } - - if (dropdownToggleRef.current.contains(event.target as HTMLElement)) { - return - } - - if ( - autoClose === true || - (autoClose === 'inside' && dropdownMenuRef.current.contains(event.target as HTMLElement)) || - (autoClose === 'outside' && !dropdownMenuRef.current.contains(event.target as HTMLElement)) - ) { - setTimeout(() => setVisible(false), 1) - return - } - } - - return ( - - {variant === 'input-group' ? ( - <>{children} - ) : ( - - {children} - - )} - - ) - } -) - -const alignmentDirection = PropTypes.oneOf(['start', 'end']) - -CDropdown.propTypes = { - alignment: PropTypes.oneOfType([ - alignmentDirection, - PropTypes.shape({ xs: alignmentDirection.isRequired }), - PropTypes.shape({ sm: alignmentDirection.isRequired }), - PropTypes.shape({ md: alignmentDirection.isRequired }), - PropTypes.shape({ lg: alignmentDirection.isRequired }), - PropTypes.shape({ xl: alignmentDirection.isRequired }), - PropTypes.shape({ xxl: alignmentDirection.isRequired }), - ]), - as: PropTypes.elementType, - autoClose: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'inside' | 'outside'>(['inside', 'outside']), - ]), - children: PropTypes.node, - className: PropTypes.string, - dark: PropTypes.bool, - direction: PropTypes.oneOf(['center', 'dropup', 'dropup-center', 'dropend', 'dropstart']), - offset: PropTypes.any, // TODO: find good proptype - onHide: PropTypes.func, - onShow: PropTypes.func, - placement: placementPropType, - popper: PropTypes.bool, - popperConfig: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), - portal: PropTypes.bool, - variant: PropTypes.oneOf(['btn-group', 'dropdown', 'input-group', 'nav-item']), - visible: PropTypes.bool, -} - -CDropdown.displayName = 'CDropdown' diff --git a/packages/coreui-react/src/components/dropdown/CDropdownContext.ts b/packages/coreui-react/src/components/dropdown/CDropdownContext.ts deleted file mode 100644 index 81af43aa..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownContext.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createContext, RefObject } from 'react' -import { Alignments } from './types' - -export interface CDropdownContextProps { - alignment?: Alignments - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null - dark?: boolean - // eslint-disable-next-line @typescript-eslint/no-explicit-any - dropdownToggleRef: RefObject - dropdownMenuRef: RefObject - setVisible: React.Dispatch> - popper?: boolean - portal?: boolean - variant?: 'btn-group' | 'dropdown' | 'input-group' | 'nav-item' - visible?: boolean -} - -export const CDropdownContext = createContext({} as CDropdownContextProps) diff --git a/packages/coreui-react/src/components/dropdown/CDropdownDivider.tsx b/packages/coreui-react/src/components/dropdown/CDropdownDivider.tsx deleted file mode 100644 index 57b86e1e..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownDivider.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CDropdownDividerProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CDropdownDivider = forwardRef( - ({ className, ...rest }, ref) => { - return
    - } -) - -CDropdownDivider.propTypes = { - className: PropTypes.string, -} - -CDropdownDivider.displayName = 'CDropdownDivider' diff --git a/packages/coreui-react/src/components/dropdown/CDropdownHeader.tsx b/packages/coreui-react/src/components/dropdown/CDropdownHeader.tsx deleted file mode 100644 index 89e53673..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownHeader.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CDropdownHeaderProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CDropdownHeader: PolymorphicRefForwardingComponent<'h6', CDropdownHeaderProps> = - forwardRef( - ({ children, as: Component = 'h6', className, ...rest }, ref) => { - return ( - - {children} - - ) - } - ) - -CDropdownHeader.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CDropdownHeader.displayName = 'CDropdownHeader' diff --git a/packages/coreui-react/src/components/dropdown/CDropdownItem.tsx b/packages/coreui-react/src/components/dropdown/CDropdownItem.tsx deleted file mode 100644 index 4f58c00f..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownItem.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React, { forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink, CLinkProps } from '../link/CLink' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CDropdownItemProps extends CLinkProps { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CDropdownItem: PolymorphicRefForwardingComponent<'a', CDropdownItemProps> = forwardRef< - HTMLButtonElement | HTMLAnchorElement, - CDropdownItemProps ->(({ children, as = 'a', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CDropdownItem.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CDropdownItem.displayName = 'CDropdownItem' diff --git a/packages/coreui-react/src/components/dropdown/CDropdownItemPlain.tsx b/packages/coreui-react/src/components/dropdown/CDropdownItemPlain.tsx deleted file mode 100644 index bc4ae0bb..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownItemPlain.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CDropdownItemPlainProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CDropdownItemPlain: PolymorphicRefForwardingComponent< - 'span', - CDropdownItemPlainProps -> = forwardRef( - ({ children, as: Component = 'span', className, ...rest }, ref) => { - return ( - - {children} - - ) - } -) - -CDropdownItemPlain.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CDropdownItemPlain.displayName = 'CDropdownItemPlain' diff --git a/packages/coreui-react/src/components/dropdown/CDropdownMenu.tsx b/packages/coreui-react/src/components/dropdown/CDropdownMenu.tsx deleted file mode 100644 index 59442d63..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownMenu.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CConditionalPortal } from '../conditional-portal' -import { CDropdownContext } from './CDropdownContext' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { useForkedRef } from '../../hooks' - -import { getAlignmentClassNames } from './utils' - -export interface CDropdownMenuProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CDropdownMenu: PolymorphicRefForwardingComponent<'ul', CDropdownMenuProps> = - forwardRef( - ({ children, as: Component = 'ul', className, ...rest }, ref) => { - const { alignment, container, dark, dropdownMenuRef, popper, portal, visible } = - useContext(CDropdownContext) - - const forkedRef = useForkedRef(ref, dropdownMenuRef) - - return ( - - - {Component === 'ul' - ? React.Children.map(children, (child, index) => { - if (React.isValidElement(child)) { - return
  • {React.cloneElement(child)}
  • - } - return - }) - : children} -
    -
    - ) - } - ) - -CDropdownMenu.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CDropdownMenu.displayName = 'CDropdownMenu' diff --git a/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx b/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx deleted file mode 100644 index ee8dfe82..00000000 --- a/packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import React, { FC, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CButton, CButtonProps } from '../button/CButton' -import { CDropdownContext } from './CDropdownContext' - -import { triggerPropType } from '../../props' -import type { Triggers } from '../../types' - -export interface CDropdownToggleProps extends Omit { - /** - * Enables pseudo element caret on toggler. - */ - caret?: boolean - /** - * Create a custom toggler which accepts any content. - */ - custom?: boolean - /** - * If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button. - * - * @since 5.0.0 - */ - navLink?: boolean - /** - * Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of `.dropdown-toggle-split` className for proper spacing around the dropdown caret. - */ - split?: boolean - /** - * 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[] -} - -export const CDropdownToggle: FC = ({ - children, - caret = true, - custom, - className, - navLink = true, - split, - trigger = 'click', - ...rest -}) => { - const { dropdownToggleRef, variant, visible, setVisible } = useContext(CDropdownContext) - - const triggers = { - ...((trigger === 'click' || trigger.includes('click')) && { - onClick: (event: React.MouseEvent) => { - event.preventDefault() - setVisible(!visible) - }, - }), - ...((trigger === 'focus' || trigger.includes('focus')) && { - onFocus: () => setVisible(true), - onBlur: () => setVisible(false), - }), - } - - const togglerProps = { - className: classNames( - { - 'nav-link': variant === 'nav-item' && navLink, - 'dropdown-toggle': caret, - 'dropdown-toggle-split': split, - show: visible, - }, - className - ), - 'aria-expanded': visible, - ...(!rest.disabled && { ...triggers }), - } - - const Toggler = () => { - if (custom && React.isValidElement(children)) { - return ( - <> - {React.cloneElement(children as React.ReactElement, { - 'aria-expanded': visible, - ...(!rest.disabled && { ...triggers }), - ref: dropdownToggleRef, - })} - - ) - } - - if (variant === 'nav-item' && navLink) { - return ( - - {children} - - ) - } - - return ( - - {children} - {split && Toggle Dropdown} - - ) - } - - return -} - -CDropdownToggle.propTypes = { - caret: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - custom: PropTypes.bool, - split: PropTypes.bool, - trigger: triggerPropType, -} - -CDropdownToggle.displayName = 'CDropdownToggle' diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdown.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdown.spec.tsx deleted file mode 100644 index 12b6e3cd..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdown.spec.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import * as React from 'react' -import { render, screen, fireEvent, waitFor } from '@testing-library/react' -import '@testing-library/jest-dom' -import { - CDropdown, - CDropdownToggle, - CDropdownMenu, - CDropdownItem, - CDropdownItemPlain, - CDropdownHeader, - CDropdownDivider, -} from '../index' - -test('loads and displays CDropdown component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CDropdown customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('nav-item') - expect(container.firstChild).toHaveClass('dropdown') - expect(container.firstChild).toHaveClass('dropstart') -}) - -// test('CDropdown change visible prop', async () => { -// jest.useFakeTimers() -// const { rerender } = render(Test) -// expect(screen.getByText('Test')).not.toHaveClass('show') -// rerender(Test) -// jest.runAllTimers() -// expect(screen.getByText('Test')).toHaveClass('show') -// rerender(Test) -// expect(screen.getByText('Test')).not.toHaveClass('show') -// jest.runAllTimers() -// jest.useRealTimers() -// }) - -test('CDropdown opens on toggle click and closes on clicking outside', async () => { - render( -
    - {/* External element to simulate clicking outside the dropdown */} -
    External Area
    - - {/* The dropdown component */} - - Test - - A - B - - -
    , - ) - - // Ensure the dropdown is initially closed - const toggleButton = screen.getByText('Test') - expect(toggleButton).toBeInTheDocument() - - // Assuming the 'show' class is applied to the CDropdownMenu - const dropdownMenu = screen.getByRole('menu', { hidden: true }) // Adjust role if different - expect(dropdownMenu).not.toHaveClass('show') - - // Click on the toggle to open the dropdown - fireEvent.click(toggleButton) - - // Wait for the dropdown menu to become visible - await waitFor(() => { - const openedMenu = screen.getByRole('menu') // Adjust role if different - expect(openedMenu).toBeVisible() - expect(openedMenu).toHaveClass('show') - }) - - // Click outside the dropdown to close it - const externalArea = screen.getByTestId('external-area') - fireEvent.mouseUp(externalArea) - - // Wait for the dropdown menu to be hidden - await waitFor(() => { - const closedMenu = screen.getByRole('menu', { hidden: true }) // Adjust role if different - expect(closedMenu).not.toHaveClass('show') - }) -}) - -test('CDropdown example', async () => { - jest.useFakeTimers() - const { container } = render( - - Test - - A - B - C - - D - - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownDivider.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdownDivider.spec.tsx deleted file mode 100644 index 98b9de48..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownDivider.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdownDivider } from '../index' - -test('loads and displays CDropdownDivider component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CDropdownDivider customize', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('dropdown-divider') -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownHeader.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdownHeader.spec.tsx deleted file mode 100644 index 602b8d26..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownHeader.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdownHeader } from '../index' - -test('loads and displays CDropdownHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CDropdownHeader customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('dropdown-header') -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownItem.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdownItem.spec.tsx deleted file mode 100644 index f484cc2f..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownItem.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdownItem } from '../index' - -test('loads and displays CDropdownItem component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CDropdownItem customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('dropdown-item') -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownItemPlain.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdownItemPlain.spec.tsx deleted file mode 100644 index b1aafd07..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownItemPlain.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdownItemPlain } from '../index' - -test('loads and displays CDropdownItemPlain component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CDropdownItemPlain customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('dropdown-item-text') -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownMenu.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdownMenu.spec.tsx deleted file mode 100644 index 8b630833..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownMenu.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdown, CDropdownMenu } from '../index' - -test('loads and displays CDropdownMenu component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CDropdownMenu customize', async () => { - const { container } = render( - - - Test - - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild?.firstChild).toHaveClass('bazinga') - expect(container.firstChild?.firstChild).toHaveClass('dropdown-menu') - expect(container.firstChild?.firstChild).toHaveClass('show') -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownToggle.spec.tsx b/packages/coreui-react/src/components/dropdown/__tests__/CDropdownToggle.spec.tsx deleted file mode 100644 index 341c1048..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/CDropdownToggle.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdownToggle } from '../index' - -test('loads and displays CDropdownToggle component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CDropdownToggle customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('dropdown-toggle') - expect(container.firstChild).toHaveClass('dropdown-toggle-split') -}) diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdown.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdown.spec.tsx.snap deleted file mode 100644 index ed01b1d9..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdown.spec.tsx.snap +++ /dev/null @@ -1,76 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdown customize 1`] = ` -
    - -
    -`; - -exports[`CDropdown example 1`] = ` -
    -
    - - -
    -
    -`; - -exports[`loads and displays CDropdown component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownDivider.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownDivider.spec.tsx.snap deleted file mode 100644 index ed032fe0..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownDivider.spec.tsx.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdownDivider customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CDropdownDivider component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownHeader.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownHeader.spec.tsx.snap deleted file mode 100644 index c17e6a2b..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownHeader.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdownHeader customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CDropdownHeader component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownItem.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownItem.spec.tsx.snap deleted file mode 100644 index 09aa5375..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownItem.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdownItem customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CDropdownItem component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownItemPlain.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownItemPlain.spec.tsx.snap deleted file mode 100644 index 5ea47dd2..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownItemPlain.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdownItemPlain customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CDropdownItemPlain component 1`] = ` -
    - - Test - -
    -`; diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownMenu.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownMenu.spec.tsx.snap deleted file mode 100644 index 71044a09..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownMenu.spec.tsx.snap +++ /dev/null @@ -1,26 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdownMenu customize 1`] = ` -
    -
    - -
    -
    -`; - -exports[`loads and displays CDropdownMenu component 1`] = ` -
    -
    -`; diff --git a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownToggle.spec.tsx.snap b/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownToggle.spec.tsx.snap deleted file mode 100644 index 9486fa02..00000000 --- a/packages/coreui-react/src/components/dropdown/__tests__/__snapshots__/CDropdownToggle.spec.tsx.snap +++ /dev/null @@ -1,30 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CDropdownToggle customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CDropdownToggle component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/dropdown/index.ts b/packages/coreui-react/src/components/dropdown/index.ts deleted file mode 100644 index 0ffdaf0c..00000000 --- a/packages/coreui-react/src/components/dropdown/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CDropdown } from './CDropdown' -import { CDropdownDivider } from './CDropdownDivider' -import { CDropdownHeader } from './CDropdownHeader' -import { CDropdownItem } from './CDropdownItem' -import { CDropdownItemPlain } from './CDropdownItemPlain' -import { CDropdownMenu } from './CDropdownMenu' -import { CDropdownToggle } from './CDropdownToggle' - -export { - CDropdown, - CDropdownDivider, - CDropdownHeader, - CDropdownItem, - CDropdownItemPlain, - CDropdownMenu, - CDropdownToggle, -} diff --git a/packages/coreui-react/src/components/dropdown/types.ts b/packages/coreui-react/src/components/dropdown/types.ts deleted file mode 100644 index 3c68889a..00000000 --- a/packages/coreui-react/src/components/dropdown/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/packages/coreui-react/src/components/dropdown/utils.ts b/packages/coreui-react/src/components/dropdown/utils.ts deleted file mode 100644 index c9659636..00000000 --- a/packages/coreui-react/src/components/dropdown/utils.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { Placement } from '@popperjs/core' -import type { Placements } from '../../types' -import type { Alignments, Breakpoints } from './types' - -export const getAlignmentClassNames = (alignment: Alignments) => { - const classNames: string[] = [] - if (typeof alignment === 'object') { - for (const key in alignment) { - classNames.push( - `dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key as keyof Breakpoints]}`, - ) - } - } - - if (typeof alignment === 'string') { - classNames.push(`dropdown-menu-${alignment}`) - } - - return classNames -} - -export const getPlacement = ( - placement: Placement, - direction: string | undefined, - alignment: Alignments | string | undefined, - isRTL: boolean, -): Placements => { - let _placement = placement - - if (direction === 'dropup') { - _placement = isRTL ? 'top-end' : 'top-start' - } - - if (direction === 'dropup-center') { - _placement = 'top' - } - - if (direction === 'dropend') { - _placement = isRTL ? 'left-start' : 'right-start' - } - - if (direction === 'dropstart') { - _placement = isRTL ? 'right-start' : 'left-start' - } - - if (alignment === 'end') { - _placement = isRTL ? 'bottom-start' : 'bottom-end' - } - - return _placement -} diff --git a/packages/coreui-react/src/components/footer/CFooter.tsx b/packages/coreui-react/src/components/footer/CFooter.tsx deleted file mode 100644 index 5a73788f..00000000 --- a/packages/coreui-react/src/components/footer/CFooter.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CFooterProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Place footer in non-static positions. - */ - position?: 'fixed' | 'sticky' -} - -export const CFooter = forwardRef( - ({ children, className, position, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CFooter.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - position: PropTypes.oneOf(['fixed', 'sticky']), -} - -CFooter.displayName = 'CFooter' diff --git a/packages/coreui-react/src/components/footer/__tests__/CFooter.spec.tsx b/packages/coreui-react/src/components/footer/__tests__/CFooter.spec.tsx deleted file mode 100644 index d9c114ea..00000000 --- a/packages/coreui-react/src/components/footer/__tests__/CFooter.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFooter } from '../index' - -test('loads and displays CFooter component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CFooter customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('footer') - expect(container.firstChild).toHaveClass('footer-fixed') -}) diff --git a/packages/coreui-react/src/components/footer/__tests__/__snapshots__/CFooter.spec.tsx.snap b/packages/coreui-react/src/components/footer/__tests__/__snapshots__/CFooter.spec.tsx.snap deleted file mode 100644 index 95397d70..00000000 --- a/packages/coreui-react/src/components/footer/__tests__/__snapshots__/CFooter.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFooter customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFooter component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/footer/index.ts b/packages/coreui-react/src/components/footer/index.ts deleted file mode 100644 index 4913ac71..00000000 --- a/packages/coreui-react/src/components/footer/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CFooter } from './CFooter' - -export { CFooter } diff --git a/packages/coreui-react/src/components/form/CForm.tsx b/packages/coreui-react/src/components/form/CForm.tsx deleted file mode 100644 index 5bcd7dac..00000000 --- a/packages/coreui-react/src/components/form/CForm.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { forwardRef, FormHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CFormProps extends FormHTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Mark a form as validated. If you set it `true`, all validation styles will be applied to the forms component. - */ - validated?: boolean -} - -export const CForm = forwardRef( - ({ children, className, validated, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CForm.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - validated: PropTypes.bool, -} - -CForm.displayName = 'CForm' diff --git a/packages/coreui-react/src/components/form/CFormCheck.tsx b/packages/coreui-react/src/components/form/CFormCheck.tsx deleted file mode 100644 index 7f770d4f..00000000 --- a/packages/coreui-react/src/components/form/CFormCheck.tsx +++ /dev/null @@ -1,227 +0,0 @@ -import React, { forwardRef, InputHTMLAttributes, ReactNode, useEffect, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CFormControlValidation, CFormControlValidationProps } from './CFormControlValidation' -import { CFormLabel } from './CFormLabel' - -import { useForkedRef } from '../../hooks' -import type { Colors, Shapes } from '../../types' - -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 CFormControlValidationProps, - 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 - /** - * Input Checkbox indeterminate Property. - */ - indeterminate?: boolean - /** - * Group checkboxes or radios on the same horizontal row. - */ - inline?: boolean - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * The element represents a caption for a component. - */ - label?: string | ReactNode - /** - * Put checkboxes or radios on the opposite side. - * - * @sinve 4.7.0 - */ - reverse?: boolean - /** - * Specifies the type of component. - */ - type?: 'checkbox' | 'radio' - /** - * Set component validation state to valid. - */ - valid?: boolean -} - -export const CFormCheck = forwardRef( - ( - { - className, - button, - feedback, - feedbackInvalid, - feedbackValid, - floatingLabel, - tooltipFeedback, - hitArea, - id, - indeterminate, - inline, - invalid, - label, - reverse, - type = 'checkbox', - valid, - ...rest - }, - ref, - ) => { - const inputRef = useRef(null) - const forkedRef = useForkedRef(ref, inputRef) - - useEffect(() => { - if (inputRef.current && indeterminate) { - inputRef.current.indeterminate = indeterminate - } - }, [indeterminate, inputRef.current]) - - const FormControl = () => ( - - ) - - const FormValidation = () => ( - - ) - - const FormLabel = () => ( - - {label} - - ) - - const FormCheck = () => { - if (button) { - return ( - <> - - {label && } - - - ) - } - - if (label) { - return hitArea ? ( - <> - - - {label} - - - - ) : ( -
    - - - -
    - ) - } - - return - } - - return - }, -) - -CFormCheck.propTypes = { - button: PropTypes.object, - className: PropTypes.string, - hitArea: PropTypes.oneOf(['full']), - id: PropTypes.string, - indeterminate: PropTypes.bool, - inline: PropTypes.bool, - label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - reverse: PropTypes.bool, - type: PropTypes.oneOf(['checkbox', 'radio']), - ...CFormControlValidation.propTypes, -} - -CFormCheck.displayName = 'CFormCheck' diff --git a/packages/coreui-react/src/components/form/CFormControlValidation.tsx b/packages/coreui-react/src/components/form/CFormControlValidation.tsx deleted file mode 100644 index d280f9f3..00000000 --- a/packages/coreui-react/src/components/form/CFormControlValidation.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import React, { FC, ReactNode } from 'react' -import PropTypes from 'prop-types' - -import { CFormFeedback } from './CFormFeedback' - -export interface CFormControlValidationProps { - /** - * @ignore - */ - describedby?: string - /** - * Provide valuable, actionable feedback. - * - * @since 4.2.0 - */ - feedback?: ReactNode | string - /** - * Provide valuable, actionable feedback. - * - * @since 4.2.0 - */ - feedbackInvalid?: ReactNode | string - /** - * Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. - * - * @since 4.2.0 - */ - feedbackValid?: ReactNode | string - /** - * Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. - * - * @since 4.2.0 - */ - floatingLabel?: ReactNode | string - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * Display validation feedback in a styled tooltip. - * - * @since 4.2.0 - */ - tooltipFeedback?: boolean - /** - * Set component validation state to valid. - */ - valid?: boolean -} - -export const CFormControlValidation: FC = ({ - describedby, - feedback, - feedbackInvalid, - feedbackValid, - invalid, - tooltipFeedback, - valid, -}) => { - return ( - <> - {feedback && (valid || invalid) && ( - - {feedback} - - )} - {feedbackInvalid && ( - - {feedbackInvalid} - - )} - {feedbackValid && ( - - {feedbackValid} - - )} - - ) -} - -CFormControlValidation.propTypes = { - describedby: PropTypes.string, - feedback: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), - feedbackValid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), - feedbackInvalid: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), - invalid: PropTypes.bool, - tooltipFeedback: PropTypes.bool, - valid: PropTypes.bool, -} - -CFormControlValidation.displayName = 'CFormControlValidation' diff --git a/packages/coreui-react/src/components/form/CFormControlWrapper.tsx b/packages/coreui-react/src/components/form/CFormControlWrapper.tsx deleted file mode 100644 index 01b32351..00000000 --- a/packages/coreui-react/src/components/form/CFormControlWrapper.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React, { FC, ReactNode } from 'react' -import PropTypes from 'prop-types' - -import { CFormControlValidation, CFormControlValidationProps } from './CFormControlValidation' -import { CFormFloating } from './CFormFloating' -import { CFormLabel } from './CFormLabel' -import { CFormText } from './CFormText' - -export interface CFormControlWrapperProps extends CFormControlValidationProps { - /** - * @ignore - */ - children?: ReactNode - /** - * A string of all className you want applied to the floating label wrapper. - * - * @since 4.5.0 - */ - floatingClassName?: string - /** - * Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`. - * - * @since 4.2.0 - */ - floatingLabel?: ReactNode | string - /** - * @ignore - */ - id?: string - /** - * Add a caption for a component. - * - * @since 4.2.0 - */ - label?: ReactNode | string - /** - * Add helper text to the component. - * - * @since 4.2.0 - */ - text?: ReactNode | string -} - -export const CFormControlWrapper: FC = ({ - children, - describedby, - feedback, - feedbackInvalid, - feedbackValid, - floatingClassName, - floatingLabel, - id, - invalid, - label, - text, - tooltipFeedback, - valid, -}) => { - const FormControlValidation = () => ( - - ) - return floatingLabel ? ( - - {children} - {label || floatingLabel} - {text && {text}} - - - ) : ( - <> - {label && {label}} - {children} - {text && {text}} - - - ) -} - -CFormControlWrapper.propTypes = { - children: PropTypes.node, - floatingClassName: PropTypes.string, - floatingLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), - label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), - text: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), - ...CFormControlValidation.propTypes, -} - -CFormControlWrapper.displayName = 'CFormControlWrapper' diff --git a/packages/coreui-react/src/components/form/CFormFeedback.tsx b/packages/coreui-react/src/components/form/CFormFeedback.tsx deleted file mode 100644 index ab7dc7a0..00000000 --- a/packages/coreui-react/src/components/form/CFormFeedback.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CFormFeedbackProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - - /** - * Method called immediately after the `value` prop changes. - */ - invalid?: boolean - /** - * If your form layout allows it, you can display validation feedback in a styled tooltip. - */ - tooltip?: boolean - /** - * Set component validation state to valid. - */ - valid?: boolean -} - -export const CFormFeedback: PolymorphicRefForwardingComponent<'div', CFormFeedbackProps> = - forwardRef( - ({ children, as: Component = 'div', className, invalid, tooltip, valid, ...rest }, ref) => { - return ( - - {children} - - ) - }, - ) - -CFormFeedback.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - invalid: PropTypes.bool, - tooltip: PropTypes.bool, - valid: PropTypes.bool, -} - -CFormFeedback.displayName = 'CFormFeedback' diff --git a/packages/coreui-react/src/components/form/CFormFloating.tsx b/packages/coreui-react/src/components/form/CFormFloating.tsx deleted file mode 100644 index 5d2ec950..00000000 --- a/packages/coreui-react/src/components/form/CFormFloating.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CFormFloatingProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CFormFloating = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CFormFloating.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CFormFloating.displayName = 'CFormFloating' diff --git a/packages/coreui-react/src/components/form/CFormInput.tsx b/packages/coreui-react/src/components/form/CFormInput.tsx deleted file mode 100644 index 82bdc27e..00000000 --- a/packages/coreui-react/src/components/form/CFormInput.tsx +++ /dev/null @@ -1,141 +0,0 @@ -import React, { - ChangeEventHandler, - forwardRef, - InputHTMLAttributes, - useEffect, - useState, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CFormControlWrapper, CFormControlWrapperProps } from './CFormControlWrapper' - -export interface CFormInputProps - extends CFormControlWrapperProps, - Omit, 'size'> { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Delay onChange event while typing. If set to true onChange event will be delayed 500ms, you can also provide the number of milliseconds you want to delay the onChange event. - */ - delay?: boolean | number - /** - * Toggle the disabled state for the component. - */ - disabled?: 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 - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' - /** - * Specifies the type of component. - */ - type?: 'color' | 'file' | 'text' | string - /** - * The `value` attribute of component. - * - * @controllable onChange - * */ - value?: string | string[] | number -} - -export const CFormInput = forwardRef( - ( - { - children, - className, - delay = false, - feedback, - feedbackInvalid, - feedbackValid, - floatingClassName, - floatingLabel, - id, - invalid, - label, - onChange, - plainText, - size, - text, - tooltipFeedback, - type = 'text', - valid, - ...rest - }, - ref, - ) => { - const [value, setValue] = useState>() - - useEffect(() => { - const timeOutId = setTimeout( - () => value && onChange && onChange(value), - typeof delay === 'number' ? delay : 500, - ) - - return () => clearTimeout(timeOutId) - }, [value]) - - return ( - - (delay ? setValue(event) : onChange && onChange(event))} - {...rest} - ref={ref} - > - {children} - - - ) - }, -) - -CFormInput.propTypes = { - className: PropTypes.string, - id: PropTypes.string, - delay: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]), - plainText: PropTypes.bool, - size: PropTypes.oneOf(['sm', 'lg']), - type: PropTypes.oneOfType([PropTypes.oneOf(['color', 'file', 'text']), PropTypes.string]), - ...CFormControlWrapper.propTypes, -} - -CFormInput.displayName = 'CFormInput' diff --git a/packages/coreui-react/src/components/form/CFormLabel.tsx b/packages/coreui-react/src/components/form/CFormLabel.tsx deleted file mode 100644 index 5e8e06f0..00000000 --- a/packages/coreui-react/src/components/form/CFormLabel.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React, { forwardRef, LabelHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CFormLabelProps extends LabelHTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * A string of all className you want to be applied to the component, and override standard className value. - */ - customClassName?: string -} - -export const CFormLabel = forwardRef( - ({ children, className, customClassName, ...rest }, ref) => { - return ( - - ) - }, -) - -CFormLabel.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - customClassName: PropTypes.string, -} - -CFormLabel.displayName = 'CFormLabel' diff --git a/packages/coreui-react/src/components/form/CFormRange.tsx b/packages/coreui-react/src/components/form/CFormRange.tsx deleted file mode 100644 index 583f5713..00000000 --- a/packages/coreui-react/src/components/form/CFormRange.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { ChangeEventHandler, forwardRef, InputHTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CFormLabel } from './CFormLabel' -export interface CFormRangeProps extends InputHTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * Add a caption for a component. - * - * @since 4.2.0 - */ - label?: ReactNode | string - /** - * Specifies the maximum value for the component. - */ - max?: number - /** - * Specifies the minimum value for the component. - */ - min?: number - /** - * Method called immediately after the `value` prop changes. - */ - onChange?: ChangeEventHandler - /** - * Toggle the readonly state for the component. - */ - readOnly?: boolean - /** - * Specifies the interval between legal numbers in the component. - */ - step?: number - /** - * The `value` attribute of component. - * - * @controllable onChange - * */ - value?: string | string[] | number -} - -export const CFormRange = forwardRef( - ({ className, label, ...rest }, ref) => { - return ( - <> - {label && {label}} - - - ) - }, -) - -CFormRange.propTypes = { - className: PropTypes.string, - label: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), -} - -CFormRange.displayName = 'CFormRange' diff --git a/packages/coreui-react/src/components/form/CFormSelect.tsx b/packages/coreui-react/src/components/form/CFormSelect.tsx deleted file mode 100644 index 42527495..00000000 --- a/packages/coreui-react/src/components/form/CFormSelect.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import React, { ChangeEventHandler, forwardRef, InputHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CFormControlWrapper, CFormControlWrapperProps } from './CFormControlWrapper' - -type Option = { - disabled?: boolean - label?: string - selected?: boolean - value?: string -} - -export interface CFormSelectProps - extends CFormControlWrapperProps, - 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 - /** - * Method called immediately after the `value` prop changes. - */ - onChange?: ChangeEventHandler - /** - * Options list of the select component. Available keys: `label`, `value`, `disabled`. - * Examples: - * - `options={[{ value: 'js', label: 'JavaScript' }, { value: 'html', label: 'HTML', disabled: true }]}` - * - `options={['js', 'html']}` - */ - options?: Option[] | string[] - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' - /** - * The `value` attribute of component. - * - * @controllable onChange - */ - value?: string | string[] | number -} - -export const CFormSelect = forwardRef( - ( - { - children, - className, - feedback, - feedbackInvalid, - feedbackValid, - floatingClassName, - floatingLabel, - htmlSize, - id, - invalid, - label, - options, - size, - text, - tooltipFeedback, - valid, - ...rest - }, - ref, - ) => { - return ( - - - - ) - }, -) - -CFormSelect.propTypes = { - className: PropTypes.string, - htmlSize: PropTypes.number, - options: PropTypes.array, - ...CFormControlWrapper.propTypes, -} - -CFormSelect.displayName = 'CFormSelect' diff --git a/packages/coreui-react/src/components/form/CFormSwitch.tsx b/packages/coreui-react/src/components/form/CFormSwitch.tsx deleted file mode 100644 index cbb0e9e4..00000000 --- a/packages/coreui-react/src/components/form/CFormSwitch.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import React, { forwardRef, InputHTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CFormLabel } from './CFormLabel' - -export interface CFormSwitchProps extends Omit, 'size'> { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * The id global attribute defines an identifier (ID) that must be unique in the whole document. - */ - id?: string - /** - * Set component validation state to invalid. - */ - invalid?: boolean - /** - * The element represents a caption for a component. - */ - label?: string | ReactNode - /** - * Put switch on the opposite side. - * - * @sinve 4.7.0 - */ - reverse?: boolean - /** - * Size the component large or extra large. Works only with `switch`. - */ - size?: 'lg' | 'xl' - /** - * Specifies the type of component. - */ - type?: 'checkbox' | 'radio' - /** - * Set component validation state to valid. - */ - valid?: boolean -} - -export const CFormSwitch = forwardRef( - ({ className, id, invalid, label, reverse, size, type = 'checkbox', valid, ...rest }, ref) => { - return ( -
    - - {label && ( - - {label} - - )} -
    - ) - }, -) - -CFormSwitch.propTypes = { - className: PropTypes.string, - id: PropTypes.string, - invalid: PropTypes.bool, - label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - reverse: PropTypes.bool, - size: PropTypes.oneOf(['lg', 'xl']), - type: PropTypes.oneOf(['checkbox', 'radio']), - valid: PropTypes.bool, -} - -CFormSwitch.displayName = 'CFormSwitch' diff --git a/packages/coreui-react/src/components/form/CFormText.tsx b/packages/coreui-react/src/components/form/CFormText.tsx deleted file mode 100644 index 720c3eab..00000000 --- a/packages/coreui-react/src/components/form/CFormText.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CFormTextProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CFormText: PolymorphicRefForwardingComponent<'div', CFormTextProps> = forwardRef< - HTMLDivElement | HTMLSpanElement, - CFormTextProps ->(({ children, as: Component = 'div', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CFormText.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CFormText.displayName = 'CFormText' diff --git a/packages/coreui-react/src/components/form/CFormTextarea.tsx b/packages/coreui-react/src/components/form/CFormTextarea.tsx deleted file mode 100644 index fa47f6e1..00000000 --- a/packages/coreui-react/src/components/form/CFormTextarea.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import React, { ChangeEventHandler, forwardRef, TextareaHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CFormControlWrapper, CFormControlWrapperProps } from './CFormControlWrapper' - -export interface CFormTextareaProps - extends CFormControlWrapperProps, - TextareaHTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Toggle the disabled state for the component. - */ - disabled?: 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 - /** - * The `value` attribute of component. - * - * @controllable onChange - * */ - value?: string | string[] | number -} - -export const CFormTextarea = forwardRef( - ( - { - children, - className, - feedback, - feedbackInvalid, - feedbackValid, - floatingClassName, - floatingLabel, - id, - invalid, - label, - plainText, - text, - tooltipFeedback, - valid, - ...rest - }, - ref, - ) => { - return ( - - - - ) - }, -) - -CFormTextarea.propTypes = { - className: PropTypes.string, - id: PropTypes.string, - plainText: PropTypes.bool, - ...CFormControlWrapper.propTypes, -} - -CFormTextarea.displayName = 'CFormTextarea' diff --git a/packages/coreui-react/src/components/form/CInputGroup.tsx b/packages/coreui-react/src/components/form/CInputGroup.tsx deleted file mode 100644 index eedd5169..00000000 --- a/packages/coreui-react/src/components/form/CInputGroup.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CInputGroupProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' -} - -export const CInputGroup = forwardRef( - ({ children, className, size, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CInputGroup.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - size: PropTypes.oneOf(['sm', 'lg']), -} - -CInputGroup.displayName = 'CInputGroup' diff --git a/packages/coreui-react/src/components/form/CInputGroupText.tsx b/packages/coreui-react/src/components/form/CInputGroupText.tsx deleted file mode 100644 index f56c1620..00000000 --- a/packages/coreui-react/src/components/form/CInputGroupText.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { ElementType, forwardRef, LabelHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CInputGroupTextProps - extends LabelHTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CInputGroupText: PolymorphicRefForwardingComponent<'span', CInputGroupTextProps> = - forwardRef( - ({ children, as: Component = 'span', className, ...rest }, ref) => { - return ( - - {children} - - ) - }, - ) - -CInputGroupText.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CInputGroupText.displayName = 'CInputGroupText' diff --git a/packages/coreui-react/src/components/form/__tests__/CForm.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CForm.spec.tsx deleted file mode 100644 index dd838fc8..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CForm.spec.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CButton } from '../../button' -import { CForm, CFormLabel, CFormInput, CFormText, CFormCheck } from '../index' - -test('loads and displays CForm component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CForm customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('was-validated') -}) - -test('CForm example', async () => { - const { container } = render( - - A - - C - - - E - - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormCheck.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormCheck.spec.tsx deleted file mode 100644 index ac02b114..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormCheck.spec.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormCheck } from '../index' - -test('loads and displays CFormCheck component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormCheck customize button=false', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('form-check') - expect(container.firstChild).toHaveClass('form-check-inline') -}) - -test('CFormCheck customize button=true', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormControl.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormControl.spec.tsx deleted file mode 100644 index 1279dc88..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormControl.spec.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import * as React from 'react' -import { render, fireEvent } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormInput } from '../index' - -test('loads and displays CFormInput component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormInput customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('form-control-plaintext') - expect(container.firstChild).toHaveClass('form-control-color') - expect(container.firstChild).toHaveClass('form-control-lg') -}) - -test('CFormInput change input', async () => { - jest.useFakeTimers() - const onChange = jest.fn() - render() - expect(onChange).toHaveBeenCalledTimes(0) - const input = document.querySelector('input') - if (input !== null) { - fireEvent.change(input, { target: { value: 'bazinga' } }) - } - expect(onChange).toHaveBeenCalledTimes(1) - if (input !== null) { - fireEvent.change(input, { target: { value: '2' } }) - } - expect(onChange).toHaveBeenCalledTimes(2) -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormFeedback.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormFeedback.spec.tsx deleted file mode 100644 index 51a1e3c2..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormFeedback.spec.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormFeedback } from '../index' - -test('loads and displays CFormFeedback component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormFeedback customize one', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('invalid-tooltip') - expect(container.firstChild).toHaveClass('valid-tooltip') - expect(container.firstChild).toHaveClass('bazinga') -}) - -test('CFormFeedback customize two', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('invalid-feedback') - expect(container.firstChild).toHaveClass('valid-feedback') - expect(container.firstChild).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormFloating.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormFloating.spec.tsx deleted file mode 100644 index e56e0c06..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormFloating.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormFloating } from '../index' - -test('loads and displays CFormFloating component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormFloating customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-floating') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormInput.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormInput.spec.tsx deleted file mode 100644 index 0f018b6b..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormInput.spec.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormInput } from '../index' - -test('loads and displays CFormInput component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormInput customize one', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-control') -}) - -test('CFormInput customize two', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-control-lg') - expect(container.firstChild).toHaveClass('form-control-color') - expect(container.firstChild).toHaveClass('is-invalid') - expect(container.firstChild).toHaveClass('is-valid') - expect(container.firstChild).toHaveClass('form-control-plaintext') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveAttribute('value', '#888888') - expect(container.firstChild).toHaveAttribute('type', 'color') - expect(container.firstChild).toHaveAttribute('disabled', '') - expect(container.firstChild).toHaveAttribute('readonly', '') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormLabel.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormLabel.spec.tsx deleted file mode 100644 index 14b518cf..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormLabel.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormLabel } from '../index' - -test('loads and displays CFormLabel component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CFormLabel customize className', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('form-label') - expect(container.firstChild).toHaveTextContent('Test') -}) - -test('CFormLabel customize htmlFor', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveAttribute('for', 'bazinga') - expect(container.firstChild).toHaveClass('form-label') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx deleted file mode 100644 index dcb62bab..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormRange.spec.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormRange } from '../index' - -test('loads and displays CFormRange component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormRange customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-range') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveAttribute('disabled', '') - expect(container.firstChild).toHaveAttribute('max', '150') - expect(container.firstChild).toHaveAttribute('min', '20') - expect(container.firstChild).toHaveAttribute('readonly', '') - expect(container.firstChild).toHaveAttribute('step', '2') - expect(container.firstChild).toHaveAttribute('type', 'range') - expect(container.firstChild).toHaveAttribute('value', '80') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormSelect.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormSelect.spec.tsx deleted file mode 100644 index 5b49e928..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormSelect.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormSelect } from '../index' - -test('loads and displays CFormSelect component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormSelect customize', async () => { - const { container } = render( - - - - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('form-select') - expect(container.firstChild).toHaveClass('form-select-lg') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormSwitch.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormSwitch.spec.tsx deleted file mode 100644 index 77512cd7..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormSwitch.spec.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormSwitch } from '../index' - -test('loads and displays CFormSwitch component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CFormSwitch customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-check') - expect(container.firstChild).toHaveClass('form-switch') - expect(container.firstChild).toHaveClass('form-switch-xl') - expect(container.firstChild).toHaveClass('is-invalid') - expect(container.firstChild).toHaveClass('is-valid') - expect(container.firstChild).toHaveClass('bazinga') - if (container.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('form-check-input') - expect(container.firstChild.firstChild).toHaveClass('is-invalid') - expect(container.firstChild.firstChild).toHaveClass('is-valid') - expect(container.firstChild.firstChild).toHaveAttribute('id', '2') - expect(container.firstChild.firstChild).toHaveAttribute('type', 'radio') - expect(container.firstChild.lastChild).toHaveClass('form-check-label') - expect(container.firstChild.lastChild).toHaveTextContent('Some label') - expect(container.firstChild.lastChild).toHaveAttribute('for', '2') - } -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormText.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormText.spec.tsx deleted file mode 100644 index 80fa5719..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormText.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormText } from '../index' - -test('loads and displays CFormText component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CFormText customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('form-text') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CFormTextarea.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CFormTextarea.spec.tsx deleted file mode 100644 index c864e7c5..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CFormTextarea.spec.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CFormTextarea } from '../index' - -test('loads and displays CFormTextarea component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-control') -}) - -test('CFormTextarea customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('form-control-plaintext') - expect(container.firstChild).toHaveClass('is-invalid') - expect(container.firstChild).toHaveClass('is-valid') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Some value') - expect(container.firstChild).toHaveAttribute('disabled', '') - expect(container.firstChild).toHaveAttribute('readonly', '') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CInputGroup.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CInputGroup.spec.tsx deleted file mode 100644 index e18ebe46..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CInputGroup.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CInputGroup } from '../index' - -test('loads and displays CInputGroup component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CInputGroup customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('input-group') - expect(container.firstChild).toHaveClass('input-group-lg') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/CInputGroupText.spec.tsx b/packages/coreui-react/src/components/form/__tests__/CInputGroupText.spec.tsx deleted file mode 100644 index 5c006c26..00000000 --- a/packages/coreui-react/src/components/form/__tests__/CInputGroupText.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CInputGroupText } from '../index' - -test('loads and displays CInputGroupText component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('renders CInputGroupText component as a label', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() -}) - -test('CInputGroupText customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('input-group-text') -}) diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CForm.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CForm.spec.tsx.snap deleted file mode 100644 index 518a05bf..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CForm.spec.tsx.snap +++ /dev/null @@ -1,60 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CForm customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CForm example 1`] = ` -
    -
    - - -
    - C -
    -
    - - -
    - -
    -
    -`; - -exports[`loads and displays CForm component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormCheck.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormCheck.spec.tsx.snap deleted file mode 100644 index 42a5bac3..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormCheck.spec.tsx.snap +++ /dev/null @@ -1,46 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormCheck customize button=false 1`] = ` -
    -
    - - -
    -
    -`; - -exports[`CFormCheck customize button=true 1`] = ` -
    - - -
    -`; - -exports[`loads and displays CFormCheck component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormControl.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormControl.spec.tsx.snap deleted file mode 100644 index af969a06..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormControl.spec.tsx.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormInput customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFormInput component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormFeedback.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormFeedback.spec.tsx.snap deleted file mode 100644 index ec5c3b48..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormFeedback.spec.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormFeedback customize one 1`] = ` -
    -
    -
    -`; - -exports[`CFormFeedback customize two 1`] = ` -
    -
    -
    -`; - -exports[`loads and displays CFormFeedback component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormFloating.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormFloating.spec.tsx.snap deleted file mode 100644 index 69dc47eb..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormFloating.spec.tsx.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormFloating customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CFormFloating component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormInput.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormInput.spec.tsx.snap deleted file mode 100644 index f73155fa..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormInput.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormInput customize one 1`] = ` -
    - -
    -`; - -exports[`CFormInput customize two 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFormInput component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormLabel.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormLabel.spec.tsx.snap deleted file mode 100644 index 6bc2378d..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormLabel.spec.tsx.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormLabel customize className 1`] = ` -
    - -
    -`; - -exports[`CFormLabel customize htmlFor 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFormLabel component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormRange.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormRange.spec.tsx.snap deleted file mode 100644 index 990ec53a..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormRange.spec.tsx.snap +++ /dev/null @@ -1,26 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormRange customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFormRange component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormSelect.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormSelect.spec.tsx.snap deleted file mode 100644 index 3dd06df6..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormSelect.spec.tsx.snap +++ /dev/null @@ -1,26 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormSelect customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFormSelect component 1`] = ` -
    - - -
    -
    -`; - -exports[`loads and displays CFormSwitch component 1`] = ` -
    -
    - -
    -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormText.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormText.spec.tsx.snap deleted file mode 100644 index 8cdf34a3..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormText.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormText customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`loads and displays CFormText component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormTextarea.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormTextarea.spec.tsx.snap deleted file mode 100644 index d94413db..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CFormTextarea.spec.tsx.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CFormTextarea customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CFormTextarea component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CInputGroup.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CInputGroup.spec.tsx.snap deleted file mode 100644 index 33b1b5e1..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CInputGroup.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CInputGroup customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CInputGroup component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CInputGroupText.spec.tsx.snap b/packages/coreui-react/src/components/form/__tests__/__snapshots__/CInputGroupText.spec.tsx.snap deleted file mode 100644 index 00ae0e56..00000000 --- a/packages/coreui-react/src/components/form/__tests__/__snapshots__/CInputGroupText.spec.tsx.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CInputGroupText customize 1`] = ` -
    - - Test - -
    -`; - -exports[`loads and displays CInputGroupText component 1`] = ` -
    - - Test - -
    -`; - -exports[`renders CInputGroupText component as a label 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/form/index.ts b/packages/coreui-react/src/components/form/index.ts deleted file mode 100644 index 7e609487..00000000 --- a/packages/coreui-react/src/components/form/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { CForm } from './CForm' -import { CFormCheck } from './CFormCheck' -import { CFormControlValidation } from './CFormControlValidation' -import { CFormControlWrapper } from './CFormControlWrapper' -import { CFormFeedback } from './CFormFeedback' -import { CFormFloating } from './CFormFloating' -import { CFormInput } from './CFormInput' -import { CFormLabel } from './CFormLabel' -import { CFormRange } from './CFormRange' -import { CFormSelect } from './CFormSelect' -import { CFormSwitch } from './CFormSwitch' -import { CFormText } from './CFormText' -import { CFormTextarea } from './CFormTextarea' -import { CInputGroup } from './CInputGroup' -import { CInputGroupText } from './CInputGroupText' - -export { - CForm, - CFormCheck, - CFormControlValidation, - CFormControlWrapper, - CFormFeedback, - CFormFloating, - CFormInput, - CFormLabel, - CFormRange, - CFormSelect, - CFormSwitch, - CFormText, - CFormTextarea, - CInputGroup, - CInputGroupText, -} diff --git a/packages/coreui-react/src/components/grid/CCol.tsx b/packages/coreui-react/src/components/grid/CCol.tsx deleted file mode 100644 index 2aad123d..00000000 --- a/packages/coreui-react/src/components/grid/CCol.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -type Span = 'auto' | number | string | boolean | null - -type BPObject = { - span?: Span - offset?: number | string | null - order?: 'first' | 'last' | number | string | null -} - -type Col = Span | BPObject - -export interface CColProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * The number of columns/offset/order on extra small devices (<576px). - * - * @type { 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }} - */ - xs?: Col - /** - * The number of columns/offset/order on small devices (<768px). - * - * @type { 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }} - */ - sm?: Col - /** - * The number of columns/offset/order on medium devices (<992px). - * - * @type { 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }} - */ - md?: Col - /** - * The number of columns/offset/order on large devices (<1200px). - * - * @type { 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }} - */ - lg?: Col - /** - * The number of columns/offset/order on X-Large devices (<1400px). - * - * @type { 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }} - */ - xl?: Col - /** - * The number of columns/offset/order on XX-Large devices (≥1400px). - * - * @type { 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }} - */ - xxl?: Col -} - -const BREAKPOINTS = [ - 'xxl' as const, - 'xl' as const, - 'lg' as const, - 'md' as const, - 'sm' as const, - 'xs' as const, -] - -export const CCol = forwardRef( - ({ children, className, ...rest }, ref) => { - const repsonsiveClassNames: string[] = [] - - BREAKPOINTS.forEach((bp) => { - const breakpoint = rest[bp] - delete rest[bp] - - const infix = bp === 'xs' ? '' : `-${bp}` - - if (typeof breakpoint === 'number' || typeof breakpoint === 'string') { - repsonsiveClassNames.push(`col${infix}-${breakpoint}`) - } - - if (typeof breakpoint === 'boolean') { - repsonsiveClassNames.push(`col${infix}`) - } - - if (breakpoint && typeof breakpoint === 'object') { - if (typeof breakpoint.span === 'number' || typeof breakpoint.span === 'string') { - repsonsiveClassNames.push(`col${infix}-${breakpoint.span}`) - } - - if (typeof breakpoint.span === 'boolean') { - repsonsiveClassNames.push(`col${infix}`) - } - - if (typeof breakpoint.order === 'number' || typeof breakpoint.order === 'string') { - repsonsiveClassNames.push(`order${infix}-${breakpoint.order}`) - } - - if (typeof breakpoint.offset === 'number') { - repsonsiveClassNames.push(`offset${infix}-${breakpoint.offset}`) - } - } - }) - - return ( -
    0 ? repsonsiveClassNames : 'col', - className, - )} - {...rest} - ref={ref} - > - {children} -
    - ) - }, -) - -const span = PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.number, - PropTypes.string, - PropTypes.oneOf(['auto']), -]) - -const col = PropTypes.oneOfType([ - span, - PropTypes.shape({ - span: span, - offset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - order: PropTypes.oneOfType([ - PropTypes.oneOf(['first', 'last']), - PropTypes.number, - PropTypes.string, - ]), - }), -]) - -CCol.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - xs: col, - sm: col, - md: col, - lg: col, - xl: col, - xxl: col, -} - -CCol.displayName = 'CCol' diff --git a/packages/coreui-react/src/components/grid/CContainer.tsx b/packages/coreui-react/src/components/grid/CContainer.tsx deleted file mode 100644 index c665f727..00000000 --- a/packages/coreui-react/src/components/grid/CContainer.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CContainerProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Set container 100% wide until small breakpoint. - */ - sm?: boolean - /** - * Set container 100% wide until medium breakpoint. - */ - md?: boolean - /** - * Set container 100% wide until large breakpoint. - */ - lg?: boolean - /** - * Set container 100% wide until X-large breakpoint. - */ - xl?: boolean - /** - * Set container 100% wide until XX-large breakpoint. - */ - xxl?: boolean - /** - * Set container 100% wide, spanning the entire width of the viewport. - */ - fluid?: boolean -} - -const BREAKPOINTS = [ - 'xxl' as const, - 'xl' as const, - 'lg' as const, - 'md' as const, - 'sm' as const, - 'fluid' as const, -] - -export const CContainer = forwardRef( - ({ children, className, ...rest }, ref) => { - const repsonsiveClassNames: string[] = [] - - BREAKPOINTS.forEach((bp) => { - const breakpoint = rest[bp] - delete rest[bp] - - breakpoint && repsonsiveClassNames.push(`container-${bp}`) - }) - - return ( -
    0 ? repsonsiveClassNames : 'container', - className, - )} - {...rest} - ref={ref} - > - {children} -
    - ) - }, -) - -CContainer.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - sm: PropTypes.bool, - md: PropTypes.bool, - lg: PropTypes.bool, - xl: PropTypes.bool, - xxl: PropTypes.bool, - fluid: PropTypes.bool, -} - -CContainer.displayName = 'CContainer' diff --git a/packages/coreui-react/src/components/grid/CRow.tsx b/packages/coreui-react/src/components/grid/CRow.tsx deleted file mode 100644 index 05a54711..00000000 --- a/packages/coreui-react/src/components/grid/CRow.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export type BPObject = { - cols?: 'auto' | number | string | null - gutter?: number | string | null - gutterX?: number | string | null - gutterY?: number | string | null -} - -export interface CRowProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * The number of columns/offset/order on extra small devices (<576px). - * - * @type {{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }} - */ - xs?: BPObject - /** - * The number of columns/offset/order on small devices (<768px). - * - * @type {{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }} - */ - sm?: BPObject - /** - * The number of columns/offset/order on medium devices (<992px). - * - * @type {{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }} - */ - md?: BPObject - /** - * The number of columns/offset/order on large devices (<1200px). - * - * @type {{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }} - */ - lg?: BPObject - /** - * The number of columns/offset/order on X-Large devices (<1400px). - * - * @type {{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }} - */ - xl?: BPObject - /** - * The number of columns/offset/order on XX-Large devices (≥1400px). - * - * @type {{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }} - */ - xxl?: BPObject -} - -const BREAKPOINTS = [ - 'xxl' as const, - 'xl' as const, - 'lg' as const, - 'md' as const, - 'sm' as const, - 'xs' as const, -] - -export const CRow = forwardRef( - ({ children, className, ...rest }, ref) => { - const repsonsiveClassNames: string[] = [] - - BREAKPOINTS.forEach((bp) => { - const breakpoint = rest[bp] - delete rest[bp] - - const infix = bp === 'xs' ? '' : `-${bp}` - - if (typeof breakpoint === 'object') { - if (breakpoint.cols) { - repsonsiveClassNames.push(`row-cols${infix}-${breakpoint.cols}`) - } - - if (typeof breakpoint.gutter === 'number') { - repsonsiveClassNames.push(`g${infix}-${breakpoint.gutter}`) - } - - if (typeof breakpoint.gutterX === 'number') { - repsonsiveClassNames.push(`gx${infix}-${breakpoint.gutterX}`) - } - - if (typeof breakpoint.gutterY === 'number') { - repsonsiveClassNames.push(`gy${infix}-${breakpoint.gutterY}`) - } - } - }) - - return ( -
    - {children} -
    - ) - }, -) - -const bp = PropTypes.shape({ - cols: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.string]), - gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - gutterX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - gutterY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), -}) - -CRow.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - xs: bp, - sm: bp, - md: bp, - lg: bp, - xl: bp, - xxl: bp, -} - -CRow.displayName = 'CRow' diff --git a/packages/coreui-react/src/components/grid/__tests__/CCol.spec.tsx b/packages/coreui-react/src/components/grid/__tests__/CCol.spec.tsx deleted file mode 100644 index 4136dc58..00000000 --- a/packages/coreui-react/src/components/grid/__tests__/CCol.spec.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CCol } from '../index' - -test('CCol no-breakpoints', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('col') -}) - -test('CCol customize breakpoints are numbers', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('col-1') - expect(container.firstChild).toHaveClass('col-sm-2') - expect(container.firstChild).toHaveClass('col-md-3') - expect(container.firstChild).toHaveClass('col-lg-4') - expect(container.firstChild).toHaveClass('col-xl-5') - expect(container.firstChild).toHaveClass('col-xxl-6') -}) - -test('CCol customize breakpoints are boolean', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('col') - expect(container.firstChild).toHaveClass('col-sm') - expect(container.firstChild).toHaveClass('col-md') - expect(container.firstChild).toHaveClass('col-lg') - expect(container.firstChild).toHaveClass('col-xl') - expect(container.firstChild).toHaveClass('col-xxl') -}) diff --git a/packages/coreui-react/src/components/grid/__tests__/CContainer.spec.tsx b/packages/coreui-react/src/components/grid/__tests__/CContainer.spec.tsx deleted file mode 100644 index 0ed38797..00000000 --- a/packages/coreui-react/src/components/grid/__tests__/CContainer.spec.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CContainer } from '../index' - -test('loads and displays CContainer component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CContainer customize fluid', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('container-fluid') -}) - -test('CContainer customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('container-md') -}) diff --git a/packages/coreui-react/src/components/grid/__tests__/CRow.spec.tsx b/packages/coreui-react/src/components/grid/__tests__/CRow.spec.tsx deleted file mode 100644 index c4e8e798..00000000 --- a/packages/coreui-react/src/components/grid/__tests__/CRow.spec.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CRow } from '../index' - -test('CRow not-customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CRow customize cols', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('row-cols-1') - expect(container.firstChild).toHaveClass('row-cols-sm-2') - expect(container.firstChild).toHaveClass('row-cols-md-3') - expect(container.firstChild).toHaveClass('row-cols-lg-4') - expect(container.firstChild).toHaveClass('row-cols-xl-5') - expect(container.firstChild).toHaveClass('row-cols-xxl-6') -}) - -test('CRow customize gutter single gutter', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('g-7') -}) - -test('CRow customize gutter', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('g-1') - expect(container.firstChild).toHaveClass('g-sm-2') - expect(container.firstChild).toHaveClass('g-md-3') - expect(container.firstChild).toHaveClass('g-lg-4') - expect(container.firstChild).toHaveClass('g-xl-5') - expect(container.firstChild).toHaveClass('g-xxl-6') -}) - -test('CRow customize gutterX', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('gx-1') - expect(container.firstChild).toHaveClass('gx-sm-2') - expect(container.firstChild).toHaveClass('gx-md-3') - expect(container.firstChild).toHaveClass('gx-lg-4') - expect(container.firstChild).toHaveClass('gx-xl-5') - expect(container.firstChild).toHaveClass('gx-xxl-6') -}) - -test('CRow customize gutterY', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('gy-1') - expect(container.firstChild).toHaveClass('gy-sm-2') - expect(container.firstChild).toHaveClass('gy-md-3') - expect(container.firstChild).toHaveClass('gy-lg-4') - expect(container.firstChild).toHaveClass('gy-xl-5') - expect(container.firstChild).toHaveClass('gy-xxl-6') -}) diff --git a/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CCol.spec.tsx.snap b/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CCol.spec.tsx.snap deleted file mode 100644 index 6ecf10d3..00000000 --- a/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CCol.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CCol customize breakpoints are boolean 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CCol customize breakpoints are numbers 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CCol no-breakpoints 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CContainer.spec.tsx.snap b/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CContainer.spec.tsx.snap deleted file mode 100644 index f0de3fa5..00000000 --- a/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CContainer.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CContainer customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CContainer customize fluid 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CContainer component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CRow.spec.tsx.snap b/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CRow.spec.tsx.snap deleted file mode 100644 index 5df4af5e..00000000 --- a/packages/coreui-react/src/components/grid/__tests__/__snapshots__/CRow.spec.tsx.snap +++ /dev/null @@ -1,61 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CRow customize cols 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CRow customize gutter 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CRow customize gutter single gutter 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CRow customize gutterX 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CRow customize gutterY 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`CRow not-customize 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/grid/index.ts b/packages/coreui-react/src/components/grid/index.ts deleted file mode 100644 index c0ed3d8b..00000000 --- a/packages/coreui-react/src/components/grid/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CCol } from './CCol' -import { CContainer } from './CContainer' -import { CRow } from './CRow' - -export { CCol, CContainer, CRow } diff --git a/packages/coreui-react/src/components/header/CHeader.tsx b/packages/coreui-react/src/components/header/CHeader.tsx deleted file mode 100644 index eecd0393..00000000 --- a/packages/coreui-react/src/components/header/CHeader.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CHeaderProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Defines optional container wrapping children elements. - */ - container?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'fluid' - /** - * Place header in non-static positions. - */ - position?: 'fixed' | 'sticky' -} - -export const CHeader = forwardRef( - ({ children, className, container, position, ...rest }, ref) => { - return ( -
    - {container ? ( -
    - {children} -
    - ) : ( - <>{children} - )} -
    - ) - }, -) - -CHeader.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - container: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'fluid'>([ - 'sm', - 'md', - 'lg', - 'xl', - 'xxl', - 'fluid', - ]), - ]), - position: PropTypes.oneOf(['fixed', 'sticky']), -} - -CHeader.displayName = 'CHeader' diff --git a/packages/coreui-react/src/components/header/CHeaderBrand.tsx b/packages/coreui-react/src/components/header/CHeaderBrand.tsx deleted file mode 100644 index cac55004..00000000 --- a/packages/coreui-react/src/components/header/CHeaderBrand.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { ElementType, forwardRef, AnchorHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CHeaderBrandProps - extends AnchorHTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CHeaderBrand: PolymorphicRefForwardingComponent<'a', CHeaderBrandProps> = forwardRef< - HTMLAnchorElement | HTMLSpanElement, - CHeaderBrandProps ->(({ children, as: Component = 'a', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CHeaderBrand.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CHeaderBrand.displayName = 'CHeaderBrand' diff --git a/packages/coreui-react/src/components/header/CHeaderDivider.tsx b/packages/coreui-react/src/components/header/CHeaderDivider.tsx deleted file mode 100644 index bfea9d97..00000000 --- a/packages/coreui-react/src/components/header/CHeaderDivider.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CHeaderDividerProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CHeaderDivider = forwardRef( - ({ className, ...rest }, ref) => { - return
    - }, -) - -CHeaderDivider.propTypes = { - className: PropTypes.string, -} - -CHeaderDivider.displayName = 'CHeaderDivider' diff --git a/packages/coreui-react/src/components/header/CHeaderNav.tsx b/packages/coreui-react/src/components/header/CHeaderNav.tsx deleted file mode 100644 index 9b62c17e..00000000 --- a/packages/coreui-react/src/components/header/CHeaderNav.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CHeaderNavProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CHeaderNav: PolymorphicRefForwardingComponent<'ul', CHeaderNavProps> = forwardRef< - HTMLDivElement | HTMLUListElement, - CHeaderNavProps ->(({ children, as: Component = 'ul', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CHeaderNav.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CHeaderNav.displayName = 'CHeaderNav' diff --git a/packages/coreui-react/src/components/header/CHeaderText.tsx b/packages/coreui-react/src/components/header/CHeaderText.tsx deleted file mode 100644 index 7db38b16..00000000 --- a/packages/coreui-react/src/components/header/CHeaderText.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CHeaderTextProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CHeaderText = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CHeaderText.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CHeaderText.displayName = 'CHeaderText' diff --git a/packages/coreui-react/src/components/header/CHeaderToggler.tsx b/packages/coreui-react/src/components/header/CHeaderToggler.tsx deleted file mode 100644 index d4eec4e9..00000000 --- a/packages/coreui-react/src/components/header/CHeaderToggler.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CHeaderTogglerProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CHeaderToggler = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - ) - }, -) - -CHeaderToggler.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CHeaderToggler.displayName = 'CHeaderToggler' diff --git a/packages/coreui-react/src/components/header/__tests__/CHeader.spec.tsx b/packages/coreui-react/src/components/header/__tests__/CHeader.spec.tsx deleted file mode 100644 index f123f6f2..00000000 --- a/packages/coreui-react/src/components/header/__tests__/CHeader.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CHeader } from '../index' - -test('loads and displays CHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CHeader customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('header') - expect(container.firstChild).toHaveClass('header-sticky') -}) diff --git a/packages/coreui-react/src/components/header/__tests__/CHeaderBrand.spec.tsx b/packages/coreui-react/src/components/header/__tests__/CHeaderBrand.spec.tsx deleted file mode 100644 index eeb6d99d..00000000 --- a/packages/coreui-react/src/components/header/__tests__/CHeaderBrand.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CHeaderBrand } from '../index' - -test('loads and displays CHeaderBrand component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CHeaderBrand customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('header-brand') -}) diff --git a/packages/coreui-react/src/components/header/__tests__/CHeaderDivider.spec.tsx b/packages/coreui-react/src/components/header/__tests__/CHeaderDivider.spec.tsx deleted file mode 100644 index 0491da0a..00000000 --- a/packages/coreui-react/src/components/header/__tests__/CHeaderDivider.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CHeaderDivider } from '../index' - -test('loads and displays CHeaderDivider component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CHeaderDivider customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('header-divider') -}) diff --git a/packages/coreui-react/src/components/header/__tests__/CHeaderNav.spec.tsx b/packages/coreui-react/src/components/header/__tests__/CHeaderNav.spec.tsx deleted file mode 100644 index 67ca01e7..00000000 --- a/packages/coreui-react/src/components/header/__tests__/CHeaderNav.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CHeaderNav } from '../index' - -test('loads and displays CHeaderNav component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CHeaderNav customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('header-nav') -}) diff --git a/packages/coreui-react/src/components/header/__tests__/CHeaderText.spec.tsx b/packages/coreui-react/src/components/header/__tests__/CHeaderText.spec.tsx deleted file mode 100644 index 14d6cd24..00000000 --- a/packages/coreui-react/src/components/header/__tests__/CHeaderText.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CHeaderText } from '../index' - -test('loads and displays CHeaderText component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CHeaderText customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('header-text') -}) diff --git a/packages/coreui-react/src/components/header/__tests__/CHeaderToggler.spec.tsx b/packages/coreui-react/src/components/header/__tests__/CHeaderToggler.spec.tsx deleted file mode 100644 index a48bdd6c..00000000 --- a/packages/coreui-react/src/components/header/__tests__/CHeaderToggler.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CHeaderToggler } from '../index' - -test('loads and displays CHeaderToggler component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CHeaderToggler customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('header-toggler') -}) diff --git a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeader.spec.tsx.snap b/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeader.spec.tsx.snap deleted file mode 100644 index 206dfdc0..00000000 --- a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeader.spec.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CHeader customize 1`] = ` -
    -
    -
    - Test -
    -
    -
    -`; - -exports[`loads and displays CHeader component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderBrand.spec.tsx.snap b/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderBrand.spec.tsx.snap deleted file mode 100644 index b1ee3bf8..00000000 --- a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderBrand.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CHeaderBrand customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`loads and displays CHeaderBrand component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderDivider.spec.tsx.snap b/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderDivider.spec.tsx.snap deleted file mode 100644 index 7a19a2ce..00000000 --- a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderDivider.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CHeaderDivider customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CHeaderDivider component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderNav.spec.tsx.snap b/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderNav.spec.tsx.snap deleted file mode 100644 index e6cfd03c..00000000 --- a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderNav.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CHeaderNav customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CHeaderNav component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderText.spec.tsx.snap b/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderText.spec.tsx.snap deleted file mode 100644 index c28c7920..00000000 --- a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderText.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CHeaderText customize 1`] = ` -
    - - Test - -
    -`; - -exports[`loads and displays CHeaderText component 1`] = ` -
    - - Test - -
    -`; diff --git a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderToggler.spec.tsx.snap b/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderToggler.spec.tsx.snap deleted file mode 100644 index 09acb6a2..00000000 --- a/packages/coreui-react/src/components/header/__tests__/__snapshots__/CHeaderToggler.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CHeaderToggler customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CHeaderToggler component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/header/index.ts b/packages/coreui-react/src/components/header/index.ts deleted file mode 100644 index 26053518..00000000 --- a/packages/coreui-react/src/components/header/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CHeader } from './CHeader' -import { CHeaderBrand } from './CHeaderBrand' -import { CHeaderDivider } from './CHeaderDivider' -import { CHeaderNav } from './CHeaderNav' -import { CHeaderText } from './CHeaderText' -import { CHeaderToggler } from './CHeaderToggler' - -export { CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler } diff --git a/packages/coreui-react/src/components/image/CImage.tsx b/packages/coreui-react/src/components/image/CImage.tsx deleted file mode 100644 index ecce5bdf..00000000 --- a/packages/coreui-react/src/components/image/CImage.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React, { forwardRef, ImgHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CImageProps extends ImgHTMLAttributes { - /** - * Set the horizontal aligment. - */ - align?: 'start' | 'center' | 'end' - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Make image responsive. - */ - fluid?: boolean - /** - * Make image rounded. - */ - rounded?: boolean - /** - * Give an image a rounded 1px border appearance. - */ - thumbnail?: boolean -} - -export const CImage = forwardRef( - ({ align, className, fluid, rounded, thumbnail, ...rest }, ref) => { - return ( - - ) - }, -) - -CImage.propTypes = { - align: PropTypes.oneOf(['start', 'center', 'end']), - className: PropTypes.string, - fluid: PropTypes.bool, - rounded: PropTypes.bool, - thumbnail: PropTypes.bool, -} - -CImage.displayName = 'CImage' diff --git a/packages/coreui-react/src/components/image/__tests__/CImage.spec.tsx b/packages/coreui-react/src/components/image/__tests__/CImage.spec.tsx deleted file mode 100644 index 5844befb..00000000 --- a/packages/coreui-react/src/components/image/__tests__/CImage.spec.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CImage } from '../index' - -test('loads and displays CImage component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CImage customize one', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('float-end') -}) - -test('CImage customize two', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('d-block') - expect(container.firstChild).toHaveClass('mx-auto') - expect(container.firstChild).toHaveClass('img-fluid') - expect(container.firstChild).toHaveClass('rounded') - expect(container.firstChild).toHaveClass('img-thumbnail') - expect(container.firstChild).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/image/__tests__/__snapshots__/CImage.spec.tsx.snap b/packages/coreui-react/src/components/image/__tests__/__snapshots__/CImage.spec.tsx.snap deleted file mode 100644 index 0f302c77..00000000 --- a/packages/coreui-react/src/components/image/__tests__/__snapshots__/CImage.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CImage customize one 1`] = ` -
    - -
    -`; - -exports[`CImage customize two 1`] = ` -
    - -
    -`; - -exports[`loads and displays CImage component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/image/index.ts b/packages/coreui-react/src/components/image/index.ts deleted file mode 100644 index a2bc30ae..00000000 --- a/packages/coreui-react/src/components/image/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CImage } from './CImage' - -export { CImage } diff --git a/packages/coreui-react/src/components/index.ts b/packages/coreui-react/src/components/index.ts deleted file mode 100644 index 0f233ef7..00000000 --- a/packages/coreui-react/src/components/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -export * from './accordion' -export * from './alert' -export * from './avatar' -export * from './backdrop' -export * from './badge' -export * from './breadcrumb' -export * from './button' -export * from './button-group' -export * from './callout' -export * from './card' -export * from './carousel' -export * from './close-button' -export * from './collapse' -export * from './conditional-portal' -export * from './dropdown' -export * from './footer' -export * from './form' -export * from './grid' -export * from './header' -export * from './image' -export * from './link' -export * from './list-group' -export * from './modal' -export * from './nav' -export * from './navbar' -export * from './offcanvas' -export * from './pagination' -export * from './placeholder' -export * from './progress' -export * from './popover' -export * from './sidebar' -export * from './spinner' -export * from './table' -export * from './tabs' -export * from './toast' -export * from './tooltip' -export * from './widgets' diff --git a/packages/coreui-react/src/components/link/CLink.tsx b/packages/coreui-react/src/components/link/CLink.tsx deleted file mode 100644 index 4f6778b9..00000000 --- a/packages/coreui-react/src/components/link/CLink.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React, { AllHTMLAttributes, ElementType, forwardRef, MouseEvent } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CLinkProps - extends Omit, 'as'> { - /** - * Toggle the active state for the component. - */ - active?: boolean - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * The href attribute specifies the URL of the page the link goes to. - */ - href?: string -} - -export const CLink: PolymorphicRefForwardingComponent<'a', CLinkProps> = forwardRef< - HTMLButtonElement | HTMLAnchorElement, - CLinkProps ->(({ children, active, as: Component = 'a', className, disabled, ...rest }, ref) => { - return ( - ` - className={classNames(className, { active, disabled })} - {...(active && { 'aria-current': 'page' })} - {...(Component === 'a' && disabled && { 'aria-disabled': true, tabIndex: -1 })} - {...((Component === 'a' || Component === 'button') && { - onClick: (event: MouseEvent) => { - event.preventDefault - !disabled && rest.onClick && rest.onClick(event) - }, - })} - disabled={disabled} - {...rest} - ref={ref} - > - {children} - - ) -}) - -CLink.propTypes = { - active: PropTypes.bool, - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - disabled: PropTypes.bool, -} - -CLink.displayName = 'CLink' diff --git a/packages/coreui-react/src/components/link/__tests__/CLink.spec.tsx b/packages/coreui-react/src/components/link/__tests__/CLink.spec.tsx deleted file mode 100644 index 2c3a982d..00000000 --- a/packages/coreui-react/src/components/link/__tests__/CLink.spec.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import * as React from 'react' -import { render, fireEvent } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CLink } from '../index' - -test('loads and displays CLink component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CLink customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('active') - expect(container.firstChild).toHaveAttribute('disabled') -}) - -test('CLink click on button', async () => { - const onClick = jest.fn() - render( - - Test - , - ) - expect(onClick).toHaveBeenCalledTimes(0) - const link = document.querySelector('.bazinga') - if (link !== null) { - fireEvent.click(link) - } - expect(onClick).toHaveBeenCalledTimes(1) -}) - -test('CLink click on disabled button', async () => { - const click = jest.fn() - render( - - Test - , - ) - expect(click).toHaveBeenCalledTimes(0) - const link = document.querySelector('.bazinga') - if (link !== null) { - fireEvent.click(link) - } - expect(click).toHaveBeenCalledTimes(0) -}) diff --git a/packages/coreui-react/src/components/link/__tests__/__snapshots__/CLink.spec.tsx.snap b/packages/coreui-react/src/components/link/__tests__/__snapshots__/CLink.spec.tsx.snap deleted file mode 100644 index 0ce3412c..00000000 --- a/packages/coreui-react/src/components/link/__tests__/__snapshots__/CLink.spec.tsx.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CLink customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CLink component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/link/index.ts b/packages/coreui-react/src/components/link/index.ts deleted file mode 100644 index 3b5241b6..00000000 --- a/packages/coreui-react/src/components/link/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CLink } from './CLink' - -export { CLink } diff --git a/packages/coreui-react/src/components/list-group/CListGroup.tsx b/packages/coreui-react/src/components/list-group/CListGroup.tsx deleted file mode 100644 index 1dce9007..00000000 --- a/packages/coreui-react/src/components/list-group/CListGroup.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CListGroupProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Remove some borders and rounded corners to render list group items edge-to-edge in a parent component (e.g., ``). - */ - flush?: boolean - /** - * Specify a layout type. - */ - layout?: - | 'horizontal' - | 'horizontal-sm' - | 'horizontal-md' - | 'horizontal-lg' - | 'horizontal-xl' - | 'horizontal-xxl' -} - -export const CListGroup: PolymorphicRefForwardingComponent<'ul', CListGroupProps> = forwardRef< - HTMLDivElement | HTMLUListElement, - CListGroupProps ->(({ children, as: Component = 'ul', className, flush, layout, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CListGroup.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - flush: PropTypes.bool, - layout: PropTypes.oneOf([ - 'horizontal', - 'horizontal-sm', - 'horizontal-md', - 'horizontal-lg', - 'horizontal-xl', - 'horizontal-xxl', - ]), -} - -CListGroup.displayName = 'CListGroup' diff --git a/packages/coreui-react/src/components/list-group/CListGroupItem.tsx b/packages/coreui-react/src/components/list-group/CListGroupItem.tsx deleted file mode 100644 index 21f5dff2..00000000 --- a/packages/coreui-react/src/components/list-group/CListGroupItem.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { ElementType, AnchorHTMLAttributes, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink } from '../link/CLink' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CListGroupItemProps - extends AnchorHTMLAttributes { - /** - * Toggle the active state for the component. - */ - active?: boolean - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean -} - -export const CListGroupItem: PolymorphicRefForwardingComponent<'li', CListGroupItemProps> = - forwardRef( - ({ children, active, as = 'li', className, disabled, color, ...rest }, ref) => { - const Component = as === 'a' || as === 'button' ? CLink : as - - rest = { - ...((as === 'a' || as === 'button') && { - active, - disabled, - as, - ref: ref, - }), - ...(active && { 'aria-current': true }), - ...(disabled && { 'aria-disabled': true }), - ...rest, - } - - return ( - - {children} - - ) - }, - ) - -CListGroupItem.propTypes = { - active: PropTypes.bool, - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - disabled: PropTypes.bool, -} - -CListGroupItem.displayName = 'CListGroupItem' diff --git a/packages/coreui-react/src/components/list-group/__tests__/CListGroup.spec.tsx b/packages/coreui-react/src/components/list-group/__tests__/CListGroup.spec.tsx deleted file mode 100644 index ecbcd435..00000000 --- a/packages/coreui-react/src/components/list-group/__tests__/CListGroup.spec.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CListGroup, CListGroupItem } from '../index' - -test('loads and displays CListGroup component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CListGroup customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('list-group') - expect(container.firstChild).toHaveClass('list-group-flush') - expect(container.firstChild).toHaveClass('list-group-horizontal-xl') -}) - -test('CListGroup example', async () => { - const { container } = render( - - A - B - C - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/list-group/__tests__/CListGroupItem.spec.tsx b/packages/coreui-react/src/components/list-group/__tests__/CListGroupItem.spec.tsx deleted file mode 100644 index 67460193..00000000 --- a/packages/coreui-react/src/components/list-group/__tests__/CListGroupItem.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CListGroupItem } from '../index' - -test('loads and displays CListGroupItem component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CListGroupItem customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('list-group-item') - expect(container.firstChild).toHaveClass('list-group-item-action') - expect(container.firstChild).toHaveClass('active') - expect(container.firstChild).toHaveClass('disabled') -}) diff --git a/packages/coreui-react/src/components/list-group/__tests__/__snapshots__/CListGroup.spec.tsx.snap b/packages/coreui-react/src/components/list-group/__tests__/__snapshots__/CListGroup.spec.tsx.snap deleted file mode 100644 index 806b3c69..00000000 --- a/packages/coreui-react/src/components/list-group/__tests__/__snapshots__/CListGroup.spec.tsx.snap +++ /dev/null @@ -1,45 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CListGroup customize 1`] = ` -
    -

    - Test -

    -
    -`; - -exports[`CListGroup example 1`] = ` -
    -
      -
    • - A -
    • -
    • - B -
    • -
    • - C -
    • -
    -
    -`; - -exports[`loads and displays CListGroup component 1`] = ` -
    -
      - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/list-group/__tests__/__snapshots__/CListGroupItem.spec.tsx.snap b/packages/coreui-react/src/components/list-group/__tests__/__snapshots__/CListGroupItem.spec.tsx.snap deleted file mode 100644 index 511bdada..00000000 --- a/packages/coreui-react/src/components/list-group/__tests__/__snapshots__/CListGroupItem.spec.tsx.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CListGroupItem customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CListGroupItem component 1`] = ` -
    -
  • - Test -
  • -
    -`; diff --git a/packages/coreui-react/src/components/list-group/index.ts b/packages/coreui-react/src/components/list-group/index.ts deleted file mode 100644 index 802b3330..00000000 --- a/packages/coreui-react/src/components/list-group/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CListGroup } from './CListGroup' -import { CListGroupItem } from './CListGroupItem' - -export { CListGroup, CListGroupItem } diff --git a/packages/coreui-react/src/components/modal/CModal.tsx b/packages/coreui-react/src/components/modal/CModal.tsx deleted file mode 100644 index 1dca6d0a..00000000 --- a/packages/coreui-react/src/components/modal/CModal.tsx +++ /dev/null @@ -1,293 +0,0 @@ -import React, { - forwardRef, - HTMLAttributes, - useEffect, - useLayoutEffect, - useRef, - useState, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { CBackdrop } from '../backdrop' -import { CConditionalPortal } from '../conditional-portal' -import { CModalContent } from './CModalContent' -import { CModalContext } from './CModalContext' -import { CModalDialog } from './CModalDialog' - -import { useForkedRef } from '../../hooks' - -export interface CModalProps extends HTMLAttributes { - /** - * Align the modal in the center or top of the screen. - */ - alignment?: 'top' | 'center' - /** - * Apply a backdrop on body while modal is open. - */ - backdrop?: boolean | 'static' - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Appends the react modal to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`. - * - * @since 5.3.0 - */ - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null - /** - * @ignore - */ - duration?: number - /** - * Puts the focus on the modal when shown. - * - * @since 4.10.0 - */ - focus?: boolean - /** - * Set modal to covers the entire user viewport. - */ - fullscreen?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - /** - * Closes the modal when escape key is pressed. - */ - keyboard?: boolean - /** - * Callback fired when the component requests to be closed. - */ - onClose?: () => void - /** - * Callback fired when the component requests to be closed. - */ - onClosePrevented?: () => void - /** - * Callback fired when the modal is shown, its backdrop is static and a click outside the modal or an escape key press is performed with the keyboard option set to false. - */ - onShow?: () => void - /** - * Generates modal using createPortal. - */ - portal?: boolean - /** - * Create a scrollable modal that allows scrolling the modal body. - */ - scrollable?: boolean - /** - * Size the component small, large, or extra large. - */ - size?: 'sm' | 'lg' | 'xl' - /** - * Remove animation to create modal that simply appear rather than fade in to view. - */ - transition?: boolean - /** - * By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false. - */ - unmountOnClose?: boolean - /** - * Toggle the visibility of modal component. - */ - visible?: boolean -} - -export const CModal = forwardRef( - ( - { - children, - alignment, - backdrop = true, - className, - container, - duration = 150, - focus = true, - fullscreen, - keyboard = true, - onClose, - onClosePrevented, - onShow, - portal = true, - scrollable, - size, - transition = true, - unmountOnClose = true, - visible, - ...rest - }, - ref - ) => { - const activeElementRef = useRef(null) - const modalRef = useRef(null) - const modalContentRef = useRef(null) - const forkedRef = useForkedRef(ref, modalRef) - - const [_visible, setVisible] = useState(visible) - const [staticBackdrop, setStaticBackdrop] = useState(false) - - const contextValues = { - visible: _visible, - setVisible, - } - - useEffect(() => { - setVisible(visible) - }, [visible]) - - useEffect(() => { - if (_visible) { - activeElementRef.current = document.activeElement as HTMLElement | null - document.addEventListener('mouseup', handleClickOutside) - document.addEventListener('keydown', handleKeyDown) - } else { - activeElementRef.current?.focus() - } - - return () => { - document.removeEventListener('mouseup', handleClickOutside) - document.removeEventListener('keydown', handleKeyDown) - } - }, [_visible]) - - const handleDismiss = () => { - if (backdrop === 'static') { - return setStaticBackdrop(true) - } - - setVisible(false) - } - - useLayoutEffect(() => { - onClosePrevented && onClosePrevented() - setTimeout(() => setStaticBackdrop(false), duration) - }, [staticBackdrop]) - - // Set focus to modal after open - useLayoutEffect(() => { - if (_visible) { - document.body.classList.add('modal-open') - - if (backdrop) { - document.body.style.overflow = 'hidden' - document.body.style.paddingRight = '0px' - } - - setTimeout( - () => { - focus && modalRef.current?.focus() - }, - transition ? duration : 0 - ) - } else { - document.body.classList.remove('modal-open') - - if (backdrop) { - document.body.style.removeProperty('overflow') - document.body.style.removeProperty('padding-right') - } - } - - return () => { - document.body.classList.remove('modal-open') - if (backdrop) { - document.body.style.removeProperty('overflow') - document.body.style.removeProperty('padding-right') - } - } - }, [_visible]) - - const handleClickOutside = (event: Event) => { - if (modalRef.current && modalRef.current == event.target) { - handleDismiss() - } - } - - const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === 'Escape' && keyboard) { - handleDismiss() - } - } - - return ( - <> - - {(state) => ( - - -
    - - {children} - -
    -
    -
    - )} -
    - {backdrop && ( - - - - )} - - ) - } -) - -CModal.propTypes = { - alignment: PropTypes.oneOf(['top', 'center']), - backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf<'static'>(['static'])]), - children: PropTypes.node, - className: PropTypes.string, - container: PropTypes.any, // HTMLElement - duration: PropTypes.number, - focus: PropTypes.bool, - fullscreen: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']), - ]), - keyboard: PropTypes.bool, - onClose: PropTypes.func, - onClosePrevented: PropTypes.func, - onShow: PropTypes.func, - portal: PropTypes.bool, - scrollable: PropTypes.bool, - size: PropTypes.oneOf(['sm', 'lg', 'xl']), - transition: PropTypes.bool, - unmountOnClose: PropTypes.bool, - visible: PropTypes.bool, -} - -CModal.displayName = 'CModal' diff --git a/packages/coreui-react/src/components/modal/CModalBody.tsx b/packages/coreui-react/src/components/modal/CModalBody.tsx deleted file mode 100644 index 55de449f..00000000 --- a/packages/coreui-react/src/components/modal/CModalBody.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CModalBodyProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CModalBody = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CModalBody.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CModalBody.displayName = 'CModalBody' diff --git a/packages/coreui-react/src/components/modal/CModalContent.tsx b/packages/coreui-react/src/components/modal/CModalContent.tsx deleted file mode 100644 index 3c9e3db9..00000000 --- a/packages/coreui-react/src/components/modal/CModalContent.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CModalContentProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CModalContent = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CModalContent.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CModalContent.displayName = 'CModalContent' diff --git a/packages/coreui-react/src/components/modal/CModalContext.ts b/packages/coreui-react/src/components/modal/CModalContext.ts deleted file mode 100644 index 0a85cbc0..00000000 --- a/packages/coreui-react/src/components/modal/CModalContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createContext } from 'react' - -export interface CModalContextProps { - visible?: boolean - setVisible: React.Dispatch> -} - -export const CModalContext = createContext({} as CModalContextProps) diff --git a/packages/coreui-react/src/components/modal/CModalDialog.tsx b/packages/coreui-react/src/components/modal/CModalDialog.tsx deleted file mode 100644 index d1c013c9..00000000 --- a/packages/coreui-react/src/components/modal/CModalDialog.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CModalDialogProps extends HTMLAttributes { - /** - * Align the modal in the center or top of the screen. - */ - alignment?: 'top' | 'center' - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Set modal to covers the entire user viewport. - */ - fullscreen?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - /** - * Does the modal dialog itself scroll, or does the whole dialog scroll within the window. - */ - scrollable?: boolean - /** - * Size the component small, large, or extra large. - */ - size?: 'sm' | 'lg' | 'xl' -} - -export const CModalDialog = forwardRef( - ({ children, alignment, className, fullscreen, scrollable, size, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CModalDialog.propTypes = { - alignment: PropTypes.oneOf(['top', 'center']), - children: PropTypes.node, - className: PropTypes.string, - fullscreen: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']), - ]), - scrollable: PropTypes.bool, - size: PropTypes.oneOf(['sm', 'lg', 'xl']), -} - -CModalDialog.displayName = 'CModalDialog' diff --git a/packages/coreui-react/src/components/modal/CModalFooter.tsx b/packages/coreui-react/src/components/modal/CModalFooter.tsx deleted file mode 100644 index 8f925a07..00000000 --- a/packages/coreui-react/src/components/modal/CModalFooter.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CModalFooterProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CModalFooter = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CModalFooter.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CModalFooter.displayName = 'CModalFooter' diff --git a/packages/coreui-react/src/components/modal/CModalHeader.tsx b/packages/coreui-react/src/components/modal/CModalHeader.tsx deleted file mode 100644 index d4aca150..00000000 --- a/packages/coreui-react/src/components/modal/CModalHeader.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CCloseButton } from '../close-button/CCloseButton' -import { CModalContext } from './CModalContext' - -export interface CModalHeaderProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Add a close button component to the header. - */ - closeButton?: boolean -} - -export const CModalHeader = forwardRef( - ({ children, className, closeButton = true, ...rest }, ref) => { - const { setVisible } = useContext(CModalContext) - - return ( -
    - {children} - {closeButton && setVisible(false)} />} -
    - ) - }, -) - -CModalHeader.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - closeButton: PropTypes.bool, -} - -CModalHeader.displayName = 'CModalHeader' diff --git a/packages/coreui-react/src/components/modal/CModalTitle.tsx b/packages/coreui-react/src/components/modal/CModalTitle.tsx deleted file mode 100644 index ec99d09d..00000000 --- a/packages/coreui-react/src/components/modal/CModalTitle.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CModalTitleProps extends HTMLAttributes { - /** - * 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. - */ - as?: ElementType -} - -export const CModalTitle: PolymorphicRefForwardingComponent<'h5', CModalTitleProps> = forwardRef< - HTMLHeadElement, - CModalTitleProps ->(({ children, as: Component = 'h5', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CModalTitle.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CModalTitle.displayName = 'CModalTitle' diff --git a/packages/coreui-react/src/components/modal/__tests__/CModal.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModal.spec.tsx deleted file mode 100644 index 2e0c0b8c..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModal.spec.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import * as React from 'react' -import { render, fireEvent, screen, waitFor } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModal } from '../index' - -test('loads and displays CModal component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModal customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() -}) - -test('CModal dialog close on press ESC', async () => { - const onClose = jest.fn() - render( - - Test - , - ) - expect(onClose).toHaveBeenCalledTimes(0) - - const modal = screen.getByText('Test').closest('.modal') - expect(modal).toBeInTheDocument() - - if (modal !== null) { - fireEvent.keyDown(modal, { - key: 'Escape', - }) - - await waitFor(() => { - expect(onClose).toHaveBeenCalledTimes(1) - }) - } -}) - -// test('CModal dialog closes when clicking outside the modal', async () => { -// const onClose = jest.fn() - -// render( -// -// Test -// , -// ) - -// // Ensure onClose hasn't been called yet -// expect(onClose).not.toHaveBeenCalled() - -// // Optionally, verify that the modal is in the document -// const modal = screen.getByText('Test').closest('.modal') -// expect(modal).toBeInTheDocument() - -// // Simulate a click on the external area (outside the modal) -// fireEvent.mouseDown(document.body) - -// // Wait for onClose to be called once -// await waitFor(() => { -// expect(onClose).toHaveBeenCalledTimes(1) -// }) -// }) diff --git a/packages/coreui-react/src/components/modal/__tests__/CModalBody.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModalBody.spec.tsx deleted file mode 100644 index dbc9cf28..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModalBody.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModalBody } from '../index' - -test('loads and displays CModalBody component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModalBody customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('modal-body') -}) diff --git a/packages/coreui-react/src/components/modal/__tests__/CModalContent.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModalContent.spec.tsx deleted file mode 100644 index e17bb8ef..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModalContent.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModalContent } from '../index' - -test('loads and displays CModalContent component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModalContent customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('modal-content') -}) diff --git a/packages/coreui-react/src/components/modal/__tests__/CModalDialog.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModalDialog.spec.tsx deleted file mode 100644 index a3450d27..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModalDialog.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModalDialog } from '../index' - -test('loads and displays CModalDialog component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModalDialog customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('modal-dialog') - expect(container.firstChild).toHaveClass('modal-dialog-centered') - expect(container.firstChild).toHaveClass('modal-fullscreen-lg-down') - expect(container.firstChild).toHaveClass('modal-dialog-scrollable') - expect(container.firstChild).toHaveClass('modal-xl') -}) diff --git a/packages/coreui-react/src/components/modal/__tests__/CModalFooter.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModalFooter.spec.tsx deleted file mode 100644 index cfba12ed..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModalFooter.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModalFooter } from '../index' - -test('loads and displays CModalFooter component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModalFooter customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('modal-footer') -}) diff --git a/packages/coreui-react/src/components/modal/__tests__/CModalHeader.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModalHeader.spec.tsx deleted file mode 100644 index 4e3177d7..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModalHeader.spec.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModalHeader } from '../index' - -test('loads and displays CModalHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModalHeader customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('modal-header') -}) - -test('CModalHeader has a close button', async () => { - const onDismiss = jest.fn() - render(Test) - expect(onDismiss).toHaveBeenCalledTimes(0) - const btn = document.querySelector('.btn-close') - expect(btn).toBeTruthy() -}) diff --git a/packages/coreui-react/src/components/modal/__tests__/CModalTitle.spec.tsx b/packages/coreui-react/src/components/modal/__tests__/CModalTitle.spec.tsx deleted file mode 100644 index e5b0cae6..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/CModalTitle.spec.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CModalTitle } from '../index' - -test('loads and displays CModalTitle component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CModalTitle customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('modal-title') -}) diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap deleted file mode 100644 index 66995bec..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModal.spec.tsx.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModal customize 1`] = `
    `; - -exports[`loads and displays CModal component 1`] = `
    `; diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalBody.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalBody.spec.tsx.snap deleted file mode 100644 index d1724ab2..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalBody.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModalBody customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CModalBody component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalContent.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalContent.spec.tsx.snap deleted file mode 100644 index a235c501..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalContent.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModalContent customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CModalContent component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalDialog.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalDialog.spec.tsx.snap deleted file mode 100644 index b73b263b..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalDialog.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModalDialog customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CModalDialog component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalFooter.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalFooter.spec.tsx.snap deleted file mode 100644 index 2ea03aea..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalFooter.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModalFooter customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CModalFooter component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalHeader.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalHeader.spec.tsx.snap deleted file mode 100644 index 27af1fa6..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalHeader.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModalHeader customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CModalHeader component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalTitle.spec.tsx.snap b/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalTitle.spec.tsx.snap deleted file mode 100644 index 7332ff34..00000000 --- a/packages/coreui-react/src/components/modal/__tests__/__snapshots__/CModalTitle.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CModalTitle customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CModalTitle component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/modal/index.ts b/packages/coreui-react/src/components/modal/index.ts deleted file mode 100644 index 182bc116..00000000 --- a/packages/coreui-react/src/components/modal/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CModal } from './CModal' -import { CModalBody } from './CModalBody' -import { CModalContent } from './CModalContent' -import { CModalDialog } from './CModalDialog' -import { CModalFooter } from './CModalFooter' -import { CModalHeader } from './CModalHeader' -import { CModalTitle } from './CModalTitle' - -export { CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle } diff --git a/packages/coreui-react/src/components/nav/CNav.tsx b/packages/coreui-react/src/components/nav/CNav.tsx deleted file mode 100644 index f056fbf7..00000000 --- a/packages/coreui-react/src/components/nav/CNav.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CNavProps - extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Specify a layout type for component. - */ - layout?: 'fill' | 'justified' - /** - * Set the nav variant to tabs or pills. - */ - variant?: 'enclosed' | 'enclosed-pills' | 'pills' | 'tabs' | 'underline' | 'underline-border' -} - -export const CNav: PolymorphicRefForwardingComponent<'ul', CNavProps> = forwardRef< - HTMLDivElement | HTMLUListElement | HTMLOListElement, - CNavProps ->(({ children, as: Component = 'ul', className, layout, variant, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CNav.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - layout: PropTypes.oneOf(['fill', 'justified']), - variant: PropTypes.oneOf([ - 'enclosed', - 'enclosed-pills', - 'pills', - 'tabs', - 'underline', - 'underline-border', - ]), -} - -CNav.displayName = 'CNav' diff --git a/packages/coreui-react/src/components/nav/CNavGroup.tsx b/packages/coreui-react/src/components/nav/CNavGroup.tsx deleted file mode 100644 index 4b680896..00000000 --- a/packages/coreui-react/src/components/nav/CNavGroup.tsx +++ /dev/null @@ -1,174 +0,0 @@ -import React, { - CSSProperties, - ElementType, - forwardRef, - HTMLAttributes, - ReactNode, - useContext, - useEffect, - useRef, - useState, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' -import type { TransitionStatus } from 'react-transition-group' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -import { CSidebarNavContext } from '../sidebar/CSidebarNavContext' - -export interface CNavGroupProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - * @since 5.0.0 - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Make nav group more compact by cutting all `padding` in half. - */ - compact?: boolean - /** - * Set group toggler label. - */ - toggler?: string | ReactNode - /** - * Show nav group items. - */ - visible?: boolean - /** - * @ignore - */ - idx?: string -} - -const isInVisibleGroup = (el1: string, el2: string) => { - const array1 = el1.toString().split('.') - const array2 = el2.toString().split('.') - - return array2.every((item, index) => item === array1[index]) -} - -export const CNavGroup: PolymorphicRefForwardingComponent<'li', CNavGroupProps> = forwardRef< - HTMLDivElement | HTMLLIElement, - CNavGroupProps ->(({ children, as: Component = 'li', className, compact, idx, toggler, visible, ...rest }, ref) => { - const [height, setHeight] = useState(0) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const navItemsRef = useRef(null) - - const { visibleGroup, setVisibleGroup } = useContext(CSidebarNavContext) - - const [_visible, setVisible] = useState( - Boolean(visible || (idx && visibleGroup && isInVisibleGroup(visibleGroup, idx))), - ) - - useEffect(() => { - setVisible(Boolean(idx && visibleGroup && isInVisibleGroup(visibleGroup, idx))) - }, [visibleGroup]) - - const handleTogglerOnCLick = (event: React.MouseEvent) => { - event.preventDefault() - setVisibleGroup( - _visible ? (idx?.toString().includes('.') ? idx.slice(0, idx.lastIndexOf('.')) : '') : idx, - ) - setVisible(!_visible) - } - - const style: CSSProperties = { - height: 0, - } - - const onEntering = () => { - navItemsRef.current && setHeight(navItemsRef.current.scrollHeight) - } - - const onEntered = () => { - setHeight('auto') - } - - const onExit = () => { - navItemsRef.current && setHeight(navItemsRef.current.scrollHeight) - } - - const onExiting = () => { - // @ts-expect-error reflow is necessary to get correct height of the element - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const reflow = navItemsRef.current?.offsetHeight - setHeight(0) - } - - const onExited = () => { - setHeight(0) - } - - const transitionStyles = { - entering: { display: 'block', height: height }, - entered: { display: 'block', height: height }, - exiting: { display: 'block', height: height }, - exited: { height: height }, - unmounted: {}, - } - - const NavGroupItemsComponent = Component === 'li' ? 'ul' : 'div' - - return ( - - {toggler && ( - handleTogglerOnCLick(event)} - > - {toggler} - - )} - - {(state) => ( - - {children} - - )} - - - ) -}) - -CNavGroup.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - compact: PropTypes.bool, - idx: PropTypes.string, - toggler: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - visible: PropTypes.bool, -} - -CNavGroup.displayName = 'CNavGroup' diff --git a/packages/coreui-react/src/components/nav/CNavGroupItems.tsx b/packages/coreui-react/src/components/nav/CNavGroupItems.tsx deleted file mode 100644 index 2465250a..00000000 --- a/packages/coreui-react/src/components/nav/CNavGroupItems.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CNavGroupItemsProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - * @since 5.0.0 - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CNavGroupItems: PolymorphicRefForwardingComponent<'ul', CNavGroupItemsProps> = - forwardRef( - ({ children, as: Component = 'ul', className, ...rest }, ref) => { - return ( - - {children} - - ) - }, - ) - -CNavGroupItems.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CNavGroupItems.displayName = 'CNavGroupItems' diff --git a/packages/coreui-react/src/components/nav/CNavItem.tsx b/packages/coreui-react/src/components/nav/CNavItem.tsx deleted file mode 100644 index 14521d6f..00000000 --- a/packages/coreui-react/src/components/nav/CNavItem.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React, { ElementType, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CNavLink, CNavLinkProps } from './CNavLink' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CNavItemProps extends Omit { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - * @since 5.0.0 - */ - as?: ElementType -} - -export const CNavItem: PolymorphicRefForwardingComponent<'li', CNavItemProps> = forwardRef< - HTMLLIElement, - CNavItemProps ->(({ children, as: Component = 'li', className, ...rest }, ref) => { - return ( - - {rest.href || rest.to ? ( - - {children} - - ) : ( - children - )} - - ) -}) - -CNavItem.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CNavItem.displayName = 'CNavItem' diff --git a/packages/coreui-react/src/components/nav/CNavLink.tsx b/packages/coreui-react/src/components/nav/CNavLink.tsx deleted file mode 100644 index 52f50b0f..00000000 --- a/packages/coreui-react/src/components/nav/CNavLink.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { forwardRef, useContext, useEffect, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLinkProps, CLink } from '../link/CLink' -import { CSidebarNavContext } from '../sidebar/CSidebarNavContext' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { useForkedRef } from '../../hooks' - -export interface CNavLinkProps extends Omit { - /** - * @ignore - */ - idx?: string - /** - * @ignore - */ - to?: string -} - -export const CNavLink: PolymorphicRefForwardingComponent<'a', CNavLinkProps> = forwardRef< - HTMLButtonElement | HTMLAnchorElement, - CNavLinkProps ->(({ children, className, idx, ...rest }, ref) => { - const navLinkRef = useRef(null) - const forkedRef = useForkedRef(ref, navLinkRef) - - const { setVisibleGroup } = useContext(CSidebarNavContext) - - useEffect(() => { - rest.active = navLinkRef.current?.classList.contains('active') - idx && rest.active && setVisibleGroup(idx) - }, [rest.active, className]) - - return ( - - {children} - - ) -}) - -CNavLink.propTypes = { - active: PropTypes.bool, - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - disabled: PropTypes.bool, - idx: PropTypes.string, -} - -CNavLink.displayName = 'CNavLink' diff --git a/packages/coreui-react/src/components/nav/CNavTitle.tsx b/packages/coreui-react/src/components/nav/CNavTitle.tsx deleted file mode 100644 index 5aa3e689..00000000 --- a/packages/coreui-react/src/components/nav/CNavTitle.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CNavTitleProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CNavTitle: PolymorphicRefForwardingComponent<'li', CNavTitleProps> = forwardRef< - HTMLLIElement, - CNavTitleProps ->(({ children, as: Component = 'li', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CNavTitle.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CNavTitle.displayName = 'CNavTitle' diff --git a/packages/coreui-react/src/components/nav/__tests__/CNav.spec.tsx b/packages/coreui-react/src/components/nav/__tests__/CNav.spec.tsx deleted file mode 100644 index 1afc468b..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/CNav.spec.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CDropdown, CDropdownItem, CDropdownMenu, CDropdownToggle } from '../../dropdown' -import { CNav, CNavItem, CNavLink } from '../index' - -test('loads and displays CNav component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNav customize', async () => { - const { container } = render( - - Test - - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('nav') - expect(container.firstChild).toHaveClass('nav-justified') - expect(container.firstChild).toHaveClass('nav-pills') - expect(container.firstChild).toHaveClass('bazinga') -}) - -test('CNav example', async () => { - const { container } = render( - - - - Active - - - - Link - - - A - - B - C - D - - - - Link - - - - Disabled - - - - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/nav/__tests__/CNavGroup.spec.tsx b/packages/coreui-react/src/components/nav/__tests__/CNavGroup.spec.tsx deleted file mode 100644 index d55d2a3c..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/CNavGroup.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavGroup } from '../index' - -test('loads and displays CNavGroup component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CNavGroup customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('nav-group') - expect(container.firstChild).toHaveClass('bazinga') - const arr = container.getElementsByClassName('nav-link') - if (arr.length > 0) { - //expect(arr[0].innerText).toHaveTextContent('anchorText') - expect(arr[0].innerHTML).toBe('anchorText') - } else { - expect(true).toBe(false) - } -}) diff --git a/packages/coreui-react/src/components/nav/__tests__/CNavGroupItems.spec.tsx b/packages/coreui-react/src/components/nav/__tests__/CNavGroupItems.spec.tsx deleted file mode 100644 index de24f9c2..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/CNavGroupItems.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavGroupItems } from '../index' - -test('loads and displays CNavGroupItems component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavGroupItems customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('nav-group-items') - expect(container.firstChild).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/nav/__tests__/CNavItem.spec.tsx b/packages/coreui-react/src/components/nav/__tests__/CNavItem.spec.tsx deleted file mode 100644 index 570e95c1..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/CNavItem.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavItem } from '../index' - -test('loads and displays CNavItem component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavItem customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild?.firstChild).toHaveClass('nav-link') - expect(container.firstChild).toHaveClass('nav-item') - expect(container.firstChild).toHaveClass('bazinga') - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/nav/__tests__/CNavLink.spec.tsx b/packages/coreui-react/src/components/nav/__tests__/CNavLink.spec.tsx deleted file mode 100644 index 988716f5..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/CNavLink.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavLink } from '../index' - -test('loads and displays CNavLink component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavLink customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('nav-link') - expect(container.firstChild).toHaveClass('bazinga') -}) - -test('CNavLink witch "to" prop', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/nav/__tests__/CNavTitle.spec.tsx b/packages/coreui-react/src/components/nav/__tests__/CNavTitle.spec.tsx deleted file mode 100644 index 22979044..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/CNavTitle.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavTitle } from '../index' - -test('loads and displays CNavTitle component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavTitle customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('nav-title') - expect(container.firstChild).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap b/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap deleted file mode 100644 index f54524cc..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap +++ /dev/null @@ -1,118 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNav customize 1`] = ` -
    - -
    -`; - -exports[`CNav example 1`] = ` -
    - -
    -`; - -exports[`loads and displays CNav component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavGroup.spec.tsx.snap b/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavGroup.spec.tsx.snap deleted file mode 100644 index 93e75ffa..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavGroup.spec.tsx.snap +++ /dev/null @@ -1,39 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavGroup customize 1`] = ` - -`; - -exports[`loads and displays CNavGroup component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavGroupItems.spec.tsx.snap b/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavGroupItems.spec.tsx.snap deleted file mode 100644 index 0799b190..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavGroupItems.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavGroupItems customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CNavGroupItems component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavItem.spec.tsx.snap b/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavItem.spec.tsx.snap deleted file mode 100644 index da8174ed..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavItem.spec.tsx.snap +++ /dev/null @@ -1,49 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavItem customize 1`] = ` -
    - -
    -`; - -exports[`CNavItem customize 2`] = ` -
    - -
    -`; - -exports[`loads and displays CNavItem component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavLink.spec.tsx.snap b/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavLink.spec.tsx.snap deleted file mode 100644 index 23a2910a..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavLink.spec.tsx.snap +++ /dev/null @@ -1,35 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavLink customize 1`] = ` -
    - -
    -`; - -exports[`CNavLink witch "to" prop 1`] = ` - -`; - -exports[`loads and displays CNavLink component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavTitle.spec.tsx.snap b/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavTitle.spec.tsx.snap deleted file mode 100644 index 887159fc..00000000 --- a/packages/coreui-react/src/components/nav/__tests__/__snapshots__/CNavTitle.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavTitle customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CNavTitle component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/nav/index.ts b/packages/coreui-react/src/components/nav/index.ts deleted file mode 100644 index dc83561a..00000000 --- a/packages/coreui-react/src/components/nav/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CNav } from './CNav' -import { CNavGroupItems } from './CNavGroupItems' -import { CNavGroup } from './CNavGroup' -import { CNavItem } from './CNavItem' -import { CNavLink } from './CNavLink' -import { CNavTitle } from './CNavTitle' - -export { CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle } diff --git a/packages/coreui-react/src/components/navbar/CNavbar.tsx b/packages/coreui-react/src/components/navbar/CNavbar.tsx deleted file mode 100644 index 04446c77..00000000 --- a/packages/coreui-react/src/components/navbar/CNavbar.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CNavbarProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * Sets if the color of text should be colored for a light or dark background. - */ - colorScheme?: 'dark' | 'light' - /** - * Defines optional container wrapping children elements. - */ - container?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'fluid' - /** - * Defines the responsive breakpoint to determine when content collapses. - */ - expand?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - /** - * Place component in non-static positions. - */ - placement?: 'fixed-top' | 'fixed-bottom' | 'sticky-top' -} - -export const CNavbar: PolymorphicRefForwardingComponent<'nav', CNavbarProps> = forwardRef< - HTMLDivElement, - CNavbarProps ->( - ( - { - children, - as: Component = 'nav', - className, - color, - colorScheme, - container, - expand, - placement, - ...rest - }, - ref, - ) => { - return ( - - {container ? ( -
    - {children} -
    - ) : ( - <>{children} - )} -
    - ) - }, -) - -CNavbar.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - colorScheme: PropTypes.oneOf(['dark', 'light']), - container: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'fluid'>([ - 'sm', - 'md', - 'lg', - 'xl', - 'xxl', - 'fluid', - ]), - ]), - expand: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']), - ]), - placement: PropTypes.oneOf(['fixed-top', 'fixed-bottom', 'sticky-top']), -} - -CNavbar.displayName = 'CNavbar' diff --git a/packages/coreui-react/src/components/navbar/CNavbarBrand.tsx b/packages/coreui-react/src/components/navbar/CNavbarBrand.tsx deleted file mode 100644 index 8a52c4e8..00000000 --- a/packages/coreui-react/src/components/navbar/CNavbarBrand.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CNavbarBrandProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * The href attribute specifies the URL of the page the link goes to. - */ - href?: string -} - -export const CNavbarBrand: PolymorphicRefForwardingComponent<'a', CNavbarBrandProps> = forwardRef< - HTMLAnchorElement | HTMLSpanElement, - CNavbarBrandProps ->(({ children, as, className, ...rest }, ref) => { - const Component = as ?? (rest.href ? 'a' : 'span') - - return ( - - {children} - - ) -}) - -CNavbarBrand.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CNavbarBrand.displayName = 'CNavbarBrand' diff --git a/packages/coreui-react/src/components/navbar/CNavbarNav.tsx b/packages/coreui-react/src/components/navbar/CNavbarNav.tsx deleted file mode 100644 index 70ef319b..00000000 --- a/packages/coreui-react/src/components/navbar/CNavbarNav.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CNavbarNavProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CNavbarNav: PolymorphicRefForwardingComponent<'ul', CNavbarNavProps> = forwardRef< - HTMLDivElement | HTMLUListElement, - CNavbarNavProps ->(({ children, as: Component = 'ul', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CNavbarNav.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CNavbarNav.displayName = 'CNavbarNav' diff --git a/packages/coreui-react/src/components/navbar/CNavbarText.tsx b/packages/coreui-react/src/components/navbar/CNavbarText.tsx deleted file mode 100644 index 45752738..00000000 --- a/packages/coreui-react/src/components/navbar/CNavbarText.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CNavbarTextProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CNavbarText = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CNavbarText.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CNavbarText.displayName = 'CNavbarText' diff --git a/packages/coreui-react/src/components/navbar/CNavbarToggler.tsx b/packages/coreui-react/src/components/navbar/CNavbarToggler.tsx deleted file mode 100644 index 296740a3..00000000 --- a/packages/coreui-react/src/components/navbar/CNavbarToggler.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CNavbarTogglerProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CNavbarToggler = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - ) - }, -) - -CNavbarToggler.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CNavbarToggler.displayName = 'CNavbarToggler' diff --git a/packages/coreui-react/src/components/navbar/__tests__/CNavbar.spec.tsx b/packages/coreui-react/src/components/navbar/__tests__/CNavbar.spec.tsx deleted file mode 100644 index 3df2fb9d..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/CNavbar.spec.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavbar } from '../index' - -test('loads and displays CNavbar component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavbar customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('navbar') - expect(container.firstChild).toHaveClass('bg-warning') - expect(container.firstChild).toHaveClass('navbar-expand-lg') - expect(container.firstChild).toHaveClass('fixed-bottom') - expect(container.firstChild).toHaveAttribute('data-coreui-theme', 'dark') - const arrLength = container.getElementsByClassName('container-xl').length - expect(arrLength).toBe(1) -}) - -test('CNavbar customize - container and expand are boolean', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('navbar-expand') - const arrLength = container.getElementsByClassName('container').length - expect(arrLength).toBe(1) -}) diff --git a/packages/coreui-react/src/components/navbar/__tests__/CNavbarBrand.spec.tsx b/packages/coreui-react/src/components/navbar/__tests__/CNavbarBrand.spec.tsx deleted file mode 100644 index 25a6d391..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/CNavbarBrand.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavbarBrand } from '../index' - -test('loads and displays CNavbarBrand component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavbarBrand witch href', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavbarBrand customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('navbar-brand') - expect(container.firstChild).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/navbar/__tests__/CNavbarNav.spec.tsx b/packages/coreui-react/src/components/navbar/__tests__/CNavbarNav.spec.tsx deleted file mode 100644 index 48b464ca..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/CNavbarNav.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavbarNav } from '../index' - -test('loads and displays CNavbarNav component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavbarNav customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('navbar-nav') - expect(container.firstChild).toHaveAttribute('role', 'navigation') -}) diff --git a/packages/coreui-react/src/components/navbar/__tests__/CNavbarText.spec.tsx b/packages/coreui-react/src/components/navbar/__tests__/CNavbarText.spec.tsx deleted file mode 100644 index b6dd3a74..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/CNavbarText.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavbarText } from '../index' - -test('loads and displays CNavbarText component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavbarText customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('navbar-text') - expect(container.firstChild).toHaveClass('bazinga') -}) diff --git a/packages/coreui-react/src/components/navbar/__tests__/CNavbarToggler.spec.tsx b/packages/coreui-react/src/components/navbar/__tests__/CNavbarToggler.spec.tsx deleted file mode 100644 index eaeca9b2..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/CNavbarToggler.spec.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CNavbarToggler } from '../index' - -test('CNavbarToggler witch children', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CNavbarToggler witch no children', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - const arrLength = container.getElementsByClassName('navbar-toggler-icon').length - expect(arrLength).toBe(1) -}) - -test('CNavbarToggler customize', async () => { - const { container } = render() - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('navbar-toggler') -}) diff --git a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap b/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap deleted file mode 100644 index 8540d749..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbar.spec.tsx.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavbar customize - container and expand are boolean 1`] = ` -
    - -
    -`; - -exports[`CNavbar customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CNavbar component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarBrand.spec.tsx.snap b/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarBrand.spec.tsx.snap deleted file mode 100644 index 7dc5581f..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarBrand.spec.tsx.snap +++ /dev/null @@ -1,33 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavbarBrand customize 1`] = ` -
    - -
    -`; - -exports[`CNavbarBrand witch href 1`] = ` - -`; - -exports[`loads and displays CNavbarBrand component 1`] = ` -
    - - Test - -
    -`; diff --git a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarNav.spec.tsx.snap b/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarNav.spec.tsx.snap deleted file mode 100644 index a2c087da..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarNav.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavbarNav customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CNavbarNav component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarText.spec.tsx.snap b/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarText.spec.tsx.snap deleted file mode 100644 index d30324c0..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarText.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavbarText customize 1`] = ` -
    - - Test - -
    -`; - -exports[`loads and displays CNavbarText component 1`] = ` -
    - - Test - -
    -`; diff --git a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarToggler.spec.tsx.snap b/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarToggler.spec.tsx.snap deleted file mode 100644 index 145f8d7f..00000000 --- a/packages/coreui-react/src/components/navbar/__tests__/__snapshots__/CNavbarToggler.spec.tsx.snap +++ /dev/null @@ -1,38 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CNavbarToggler customize 1`] = ` -
    - -
    -`; - -exports[`CNavbarToggler witch children 1`] = ` -
    - -
    -`; - -exports[`CNavbarToggler witch no children 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/navbar/index.ts b/packages/coreui-react/src/components/navbar/index.ts deleted file mode 100644 index 690bc9cc..00000000 --- a/packages/coreui-react/src/components/navbar/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CNavbar } from './CNavbar' -import { CNavbarBrand } from './CNavbarBrand' -import { CNavbarNav } from './CNavbarNav' -import { CNavbarText } from './CNavbarText' -import { CNavbarToggler } from './CNavbarToggler' - -export { CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler } diff --git a/packages/coreui-react/src/components/offcanvas/COffcanvas.tsx b/packages/coreui-react/src/components/offcanvas/COffcanvas.tsx deleted file mode 100644 index 702b27c6..00000000 --- a/packages/coreui-react/src/components/offcanvas/COffcanvas.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useEffect, useRef, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { CBackdrop } from '../backdrop' -import { CConditionalPortal } from '../conditional-portal' - -import { useForkedRef } from '../../hooks' - -export interface COffcanvasProps extends HTMLAttributes { - /** - * Apply a backdrop on body while offcanvas is open. - */ - backdrop?: boolean | 'static' - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Sets a darker color scheme. - */ - dark?: boolean - /** - * Closes the offcanvas when escape key is pressed. - */ - keyboard?: boolean - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Components placement, there’s no default placement. - */ - placement: 'start' | 'end' | 'top' | 'bottom' - /** - * Generates modal using createPortal. - */ - portal?: boolean - /** - * Responsive offcanvas property hide content outside the viewport from a specified breakpoint and down. - * - * @since 4.6.0 - */ - responsive?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - /** - * Allow body scrolling while offcanvas is open - */ - scroll?: boolean - /** - * Toggle the visibility of offcanvas component. - */ - visible?: boolean -} - -export const COffcanvas = forwardRef( - ( - { - children, - backdrop = true, - className, - dark, - keyboard = true, - onHide, - onShow, - placement, - portal = false, - responsive = true, - scroll = false, - visible = false, - ...rest - }, - ref, - ) => { - const [_visible, setVisible] = useState(visible) - const offcanvasRef = useRef(null) - const forkedRef = useForkedRef(ref, offcanvasRef) - - useEffect(() => { - setVisible(visible) - }, [visible]) - - useEffect(() => { - if (_visible && !scroll) { - document.body.style.overflow = 'hidden' - document.body.style.paddingRight = '0px' - return - } - - if (!scroll) { - document.body.style.removeProperty('overflow') - document.body.style.removeProperty('padding-right') - } - }, [_visible]) - - const handleDismiss = () => { - setVisible(false) - } - - const handleBackdropDismiss = () => { - if (backdrop !== 'static') { - setVisible(false) - } - } - - const handleKeyDown = (event: React.KeyboardEvent) => { - if (event.key === 'Escape' && keyboard) { - return handleDismiss() - } - } - - return ( - <> - offcanvasRef.current?.focus()} - onExit={onHide} - timeout={300} - > - {(state) => ( - -
    - {children} -
    -
    - )} -
    - {backdrop && ( - - - - )} - - ) - }, -) - -COffcanvas.propTypes = { - backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf<'static'>(['static'])]), - children: PropTypes.node, - className: PropTypes.string, - dark: PropTypes.bool, - keyboard: PropTypes.bool, - onHide: PropTypes.func, - onShow: PropTypes.func, - placement: PropTypes.oneOf<'start' | 'end' | 'top' | 'bottom'>(['start', 'end', 'top', 'bottom']) - .isRequired, - portal: PropTypes.bool, - responsive: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']), - ]), - scroll: PropTypes.bool, - visible: PropTypes.bool, -} - -COffcanvas.displayName = 'COffcanvas' diff --git a/packages/coreui-react/src/components/offcanvas/COffcanvasBody.tsx b/packages/coreui-react/src/components/offcanvas/COffcanvasBody.tsx deleted file mode 100644 index 0b74fd99..00000000 --- a/packages/coreui-react/src/components/offcanvas/COffcanvasBody.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface COffcanvasBodyProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const COffcanvasBody = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -COffcanvasBody.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -COffcanvasBody.displayName = 'COffcanvasBody' diff --git a/packages/coreui-react/src/components/offcanvas/COffcanvasHeader.tsx b/packages/coreui-react/src/components/offcanvas/COffcanvasHeader.tsx deleted file mode 100644 index 6b9a649c..00000000 --- a/packages/coreui-react/src/components/offcanvas/COffcanvasHeader.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface COffcanvasHeaderProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const COffcanvasHeader = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -COffcanvasHeader.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -COffcanvasHeader.displayName = 'COffcanvasHeader' diff --git a/packages/coreui-react/src/components/offcanvas/COffcanvasTitle.tsx b/packages/coreui-react/src/components/offcanvas/COffcanvasTitle.tsx deleted file mode 100644 index f1c57b24..00000000 --- a/packages/coreui-react/src/components/offcanvas/COffcanvasTitle.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface COffcanvasTitleProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const COffcanvasTitle: PolymorphicRefForwardingComponent<'h5', COffcanvasTitleProps> = - forwardRef( - ({ children, as: Component = 'h5', className, ...rest }, ref) => { - return ( - - {children} - - ) - }, - ) - -COffcanvasTitle.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -COffcanvasTitle.displayName = 'COffcanvasTitle' diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvas.spec.tsx b/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvas.spec.tsx deleted file mode 100644 index a1d8590e..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvas.spec.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import * as React from 'react' -import { render, fireEvent, act } from '@testing-library/react' -import '@testing-library/jest-dom' - -import { COffcanvas } from '../index' - -test('loads and displays COffcanvas component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('COffcanvas customize one', async () => { - const { container } = render( - - Test - - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('offcanvas') - expect(container.firstChild).toHaveClass('offcanvas-start') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) - -test('COffcanvas customize and event on click backdrop', async () => { - jest.useFakeTimers() - - const onHide = jest.fn() - const { container } = render( - - Test - - ) - - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('offcanvas') - expect(container.firstChild).toHaveClass('offcanvas-end') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('show') - expect(container.firstChild).toHaveTextContent('Test') - expect(onHide).toHaveBeenCalledTimes(0) - - const backdrop = document.querySelector('.offcanvas-backdrop') - - if (backdrop !== null) { - act(() => { - fireEvent.click(backdrop) - jest.runAllTimers() - }) - } - - expect(onHide).toHaveBeenCalledTimes(1) - expect(container.firstChild).toHaveClass('show') - expect(container.firstChild).toHaveClass('hiding') - - act(() => { - jest.runAllTimers() - }) - - expect(container.firstChild).not.toHaveClass('show') - - jest.useRealTimers() -}) - -test('COffcanvas customize and event on keypress', async () => { - jest.useFakeTimers() - - const onHide = jest.fn() - const { container } = render( - - Test - - ) - - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('offcanvas') - expect(container.firstChild).toHaveClass('offcanvas-end') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('show') - expect(onHide).toHaveBeenCalledTimes(0) - - const canvas = document.querySelector('.offcanvas') - - if (canvas !== null) { - act(() => { - fireEvent.keyDown(canvas, { - key: 'Escape', - code: 'Escape', - keyCode: 27, - charCode: 27, - }) - jest.runAllTimers() - }) - } - - expect(onHide).toHaveBeenCalledTimes(1) - expect(container.firstChild).toHaveClass('show') - expect(container.firstChild).toHaveClass('hiding') - - act(() => { - jest.runAllTimers() - }) - - expect(container.firstChild).not.toHaveClass('show') - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasBody.spec.tsx b/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasBody.spec.tsx deleted file mode 100644 index 5858af68..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasBody.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { COffcanvasBody } from '../index' - -test('loads and displays COffcanvasBody component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('COffcanvasBody customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('offcanvas-body') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasHeader.spec.tsx b/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasHeader.spec.tsx deleted file mode 100644 index 54d808c3..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasHeader.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { COffcanvasHeader } from '../index' - -test('loads and displays COffcanvasHeader component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('COffcanvasHeader customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('offcanvas-header') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasTitle.spec.tsx b/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasTitle.spec.tsx deleted file mode 100644 index 4bf14bf3..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/COffcanvasTitle.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { COffcanvasTitle } from '../index' - -test('loads and displays COffcanvasTitle component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('COffcanvasTitle customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('offcanvas-title') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.tsx.snap b/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.tsx.snap deleted file mode 100644 index 796fb15f..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvas.spec.tsx.snap +++ /dev/null @@ -1,53 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`COffcanvas customize and event on click backdrop 1`] = ` -
    - -
    -
    -`; - -exports[`COffcanvas customize and event on keypress 1`] = ` -
    - -
    -
    -`; - -exports[`COffcanvas customize one 1`] = ` -
    - -
    -`; - -exports[`loads and displays COffcanvas component 1`] = ` -
    - -`; diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasBody.spec.tsx.snap b/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasBody.spec.tsx.snap deleted file mode 100644 index 4aab05e6..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasBody.spec.tsx.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`COffcanvasBody customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays COffcanvasBody component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasHeader.spec.tsx.snap b/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasHeader.spec.tsx.snap deleted file mode 100644 index cced2188..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasHeader.spec.tsx.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`COffcanvasHeader customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays COffcanvasHeader component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasTitle.spec.tsx.snap b/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasTitle.spec.tsx.snap deleted file mode 100644 index a38e77a1..00000000 --- a/packages/coreui-react/src/components/offcanvas/__tests__/__snapshots__/COffcanvasTitle.spec.tsx.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`COffcanvasTitle customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays COffcanvasTitle component 1`] = ` -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/offcanvas/index.ts b/packages/coreui-react/src/components/offcanvas/index.ts deleted file mode 100644 index c3084cf9..00000000 --- a/packages/coreui-react/src/components/offcanvas/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { COffcanvas } from './COffcanvas' -import { COffcanvasBody } from './COffcanvasBody' -import { COffcanvasHeader } from './COffcanvasHeader' -import { COffcanvasTitle } from './COffcanvasTitle' - -export { COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle } diff --git a/packages/coreui-react/src/components/pagination/CPagination.tsx b/packages/coreui-react/src/components/pagination/CPagination.tsx deleted file mode 100644 index 05e797b5..00000000 --- a/packages/coreui-react/src/components/pagination/CPagination.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CPaginationProps extends HTMLAttributes { - /** - * Set the alignment of pagination components. - */ - align?: 'start' | 'center' | 'end' - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Size the component small or large. - */ - size?: 'sm' | 'lg' -} - -export const CPagination = forwardRef( - ({ children, align, className, size, ...rest }, ref) => { - return ( - - ) - }, -) - -CPagination.propTypes = { - align: PropTypes.oneOf(['start', 'center', 'end']), - children: PropTypes.node, - className: PropTypes.string, - size: PropTypes.oneOf(['sm', 'lg']), -} - -CPagination.displayName = 'CPagination' diff --git a/packages/coreui-react/src/components/pagination/CPaginationItem.tsx b/packages/coreui-react/src/components/pagination/CPaginationItem.tsx deleted file mode 100644 index 87882af0..00000000 --- a/packages/coreui-react/src/components/pagination/CPaginationItem.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CLink } from '../link/CLink' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CPaginationItemProps extends HTMLAttributes { - /** - * Toggle the active state for the component. - */ - active?: boolean - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: string | ElementType - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean -} - -export const CPaginationItem: PolymorphicRefForwardingComponent<'a', CPaginationItemProps> = - forwardRef( - ({ children, as, className, ...rest }, ref) => { - const Component = as ?? (rest.active ? 'span' : 'a') - - return ( -
  • - {Component === 'a' ? ( - - {children} - - ) : ( - - {children} - - )} -
  • - ) - }, - ) - -CPaginationItem.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CPaginationItem.displayName = 'CPaginationItem' diff --git a/packages/coreui-react/src/components/pagination/__tests__/CPagination.spec.tsx b/packages/coreui-react/src/components/pagination/__tests__/CPagination.spec.tsx deleted file mode 100644 index 03f5f572..00000000 --- a/packages/coreui-react/src/components/pagination/__tests__/CPagination.spec.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CPagination, CPaginationItem } from '../index' - -test('loads and displays CPagination component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CPagination customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - let element = container.firstChild - if (element === null) { - expect(true).toBe(false) - } else { - element = element.firstChild - expect(element).toHaveClass('bazinga') - expect(element).toHaveClass('pagination') - expect(element).toHaveClass('pagination-lg') - } -}) - -test('CPagination example', async () => { - const { container } = render( - - A - B - C - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/pagination/__tests__/CPaginationItem.spec.tsx b/packages/coreui-react/src/components/pagination/__tests__/CPaginationItem.spec.tsx deleted file mode 100644 index c93a568b..00000000 --- a/packages/coreui-react/src/components/pagination/__tests__/CPaginationItem.spec.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CPaginationItem } from '../index' - -test('loads and displays CPaginationItem component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CPaginationItem customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('page-item') - expect(container.firstChild).toHaveClass('active') - expect(container.firstChild).toHaveClass('disabled') - let element = container.firstChild - if (element === null) { - expect(true).toBe(false) - } else { - element = element.firstChild - expect(element).toHaveClass('page-link') - } -}) diff --git a/packages/coreui-react/src/components/pagination/__tests__/__snapshots__/CPagination.spec.tsx.snap b/packages/coreui-react/src/components/pagination/__tests__/__snapshots__/CPagination.spec.tsx.snap deleted file mode 100644 index 00d53c98..00000000 --- a/packages/coreui-react/src/components/pagination/__tests__/__snapshots__/CPagination.spec.tsx.snap +++ /dev/null @@ -1,65 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CPagination customize 1`] = ` -
    - -
    -`; - -exports[`CPagination example 1`] = ` -
    - -
    -`; - -exports[`loads and displays CPagination component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/pagination/__tests__/__snapshots__/CPaginationItem.spec.tsx.snap b/packages/coreui-react/src/components/pagination/__tests__/__snapshots__/CPaginationItem.spec.tsx.snap deleted file mode 100644 index a3ba0f37..00000000 --- a/packages/coreui-react/src/components/pagination/__tests__/__snapshots__/CPaginationItem.spec.tsx.snap +++ /dev/null @@ -1,30 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CPaginationItem customize 1`] = ` -
    -
  • - -
  • -
    -`; - -exports[`loads and displays CPaginationItem component 1`] = ` -
    -
  • - - Test - -
  • -
    -`; diff --git a/packages/coreui-react/src/components/pagination/index.ts b/packages/coreui-react/src/components/pagination/index.ts deleted file mode 100644 index 5c09daf0..00000000 --- a/packages/coreui-react/src/components/pagination/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CPagination } from './CPagination' -import { CPaginationItem } from './CPaginationItem' - -export { CPagination, CPaginationItem } diff --git a/packages/coreui-react/src/components/placeholder/CPlaceholder.tsx b/packages/coreui-react/src/components/placeholder/CPlaceholder.tsx deleted file mode 100644 index c5d7ddc0..00000000 --- a/packages/coreui-react/src/components/placeholder/CPlaceholder.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CPlaceholderProps extends HTMLAttributes { - /** - * Set animation type to better convey the perception of something being actively loaded. - */ - animation?: 'glow' | 'wave' - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * Size the component extra small, small, or large. - */ - size?: 'xs' | 'sm' | 'lg' - /** - * The number of columns on extra small devices (<576px). - */ - xs?: number - /** - * The number of columns on small devices (<768px). - */ - sm?: number - /** - * The number of columns on medium devices (<992px). - */ - md?: number - /** - * The number of columns on large devices (<1200px). - */ - lg?: number - /** - * The number of columns on X-Large devices (<1400px). - */ - xl?: number - /** - * The number of columns on XX-Large devices (≥1400px). - */ - xxl?: number -} - -const BREAKPOINTS = [ - 'xxl' as const, - 'xl' as const, - 'lg' as const, - 'md' as const, - 'sm' as const, - 'xs' as const, -] - -export const CPlaceholder: PolymorphicRefForwardingComponent<'span', CPlaceholderProps> = - forwardRef( - ({ children, animation, as: Component = 'span', className, color, size, ...rest }, ref) => { - const repsonsiveClassNames: string[] = [] - - BREAKPOINTS.forEach((bp) => { - const breakpoint = rest[bp] - delete rest[bp] - - const infix = bp === 'xs' ? '' : `-${bp}` - - if (typeof breakpoint === 'number') { - repsonsiveClassNames.push(`col${infix}-${breakpoint}`) - } - - if (typeof breakpoint === 'boolean') { - repsonsiveClassNames.push(`col${infix}`) - } - }) - - return ( - - {children} - - ) - }, - ) - -CPlaceholder.propTypes = { - animation: PropTypes.oneOf(['glow', 'wave']), - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - size: PropTypes.oneOf(['xs', 'sm', 'lg']), -} - -CPlaceholder.displayName = 'CPlaceholder' diff --git a/packages/coreui-react/src/components/placeholder/__tests__/CPlaceholder.spec.tsx b/packages/coreui-react/src/components/placeholder/__tests__/CPlaceholder.spec.tsx deleted file mode 100644 index 3bf5d73e..00000000 --- a/packages/coreui-react/src/components/placeholder/__tests__/CPlaceholder.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CPlaceholder } from '../index' - -test('loads and displays CPlaceholder component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CPlaceholder customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('bg-secondary') - expect(container.firstChild).toHaveClass('col-sm-7') - expect(container.firstChild).toHaveClass('placeholder-lg') - expect(container.firstChild).toHaveClass('placeholder-glow') -}) diff --git a/packages/coreui-react/src/components/placeholder/__tests__/__snapshots__/CPlaceholder.spec.tsx.snap b/packages/coreui-react/src/components/placeholder/__tests__/__snapshots__/CPlaceholder.spec.tsx.snap deleted file mode 100644 index 53def94c..00000000 --- a/packages/coreui-react/src/components/placeholder/__tests__/__snapshots__/CPlaceholder.spec.tsx.snap +++ /dev/null @@ -1,17 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CPlaceholder customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CPlaceholder component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/placeholder/index.ts b/packages/coreui-react/src/components/placeholder/index.ts deleted file mode 100644 index 2d8d709f..00000000 --- a/packages/coreui-react/src/components/placeholder/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CPlaceholder } from './CPlaceholder' - -export { CPlaceholder } diff --git a/packages/coreui-react/src/components/popover/CPopover.tsx b/packages/coreui-react/src/components/popover/CPopover.tsx deleted file mode 100644 index a6355ae3..00000000 --- a/packages/coreui-react/src/components/popover/CPopover.tsx +++ /dev/null @@ -1,319 +0,0 @@ -import React, { - forwardRef, - HTMLAttributes, - ReactNode, - useEffect, - useId, - useRef, - useState, -} from 'react' -import classNames from 'classnames' -import PropTypes from 'prop-types' -import type { Options } from '@popperjs/core' - -import { CConditionalPortal } from '../conditional-portal' -import { useForkedRef, usePopper } from '../../hooks' -import { fallbackPlacementsPropType, triggerPropType } from '../../props' -import type { Placements, Triggers } from '../../types' -import { executeAfterTransition, getRTLPlacement } from '../../utils' - -export interface CPopoverProps extends Omit, 'title' | 'content'> { - /** - * Adds a fade transition animation to the React Popover. - * - * @since 4.9.0 - */ - animation?: boolean - - /** - * Custom class name(s) for additional styling. - */ - className?: string - - /** - * Defines the container element to which the React Popover is appended. - * Accepts: - * - A DOM element (`HTMLElement` or `DocumentFragment`) - * - A function that returns a single element - * - `null` (defaults to `document.body`) - * - * @example - * ... - * - * @default document.body - * @since 4.11.0 - */ - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null - - /** - * Main content of the React Popover. It can be a string or any valid React node. - */ - content: ReactNode | string - - /** - * Delay (in milliseconds) before showing or hiding the React Popover. - * - If a number is provided, that delay applies to both "show" and "hide". - * - If an object is provided, use separate values for "show" and "hide". - * - * @example - * // Delays 300ms on both show and hide - * ... - * - * // Delays 500ms on show and 100ms on hide - * ... - * - * @since 4.9.0 - */ - delay?: number | { show: number; hide: number } - - /** - * Specifies the fallback placements when the preferred `placement` cannot be met. - * - * @type 'top', 'right', 'bottom', 'left' | ('top', 'right', 'bottom', 'left')[] - * @since 4.9.0 - */ - fallbackPlacements?: Placements | Placements[] - - /** - * Offset of the React Popover relative to its toggle element, in the form `[x, y]`. - * - * @example - * // Offset the menu 0px in X and 10px in Y direction - * ... - * - * // Offset the menu 5px in both X and Y direction - * ... - */ - offset?: [number, number] - - /** - * Invoked when the React Popover is about to hide. - */ - onHide?: () => void - - /** - * Invoked when the React Popover is about to show. - */ - onShow?: () => void - - /** - * Placement of the React Popover. Popper.js may override this based on available space. - */ - placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left' - - /** - * Allows customization of the Popper.js configuration for the React Popover. - * Can be an object or a function returning a modified configuration. - * [Learn more](https://popper.js.org/docs/v2/constructors/#options) - * - * @example - * ({ - * ...defaultConfig, - * strategy: 'fixed', - * modifiers: [ - * ...defaultConfig.modifiers, - * { name: 'computeStyles', options: { adaptive: false } }, - * ], - * })} - * >... - * - * @since 5.5.0 - */ - popperConfig?: Partial | ((defaultPopperConfig: Partial) => Partial) - - /** - * Title for the React Popover header. Can be a string or any valid React node. - */ - title?: ReactNode | string - - /** - * Determines which events trigger the visibility of the React Popover. Can be a single trigger or an array of triggers. - * - * @example - * // Hover-only popover - * ... - * - * // Hover + click combined - * ... - * - * @type 'hover' | 'focus' | 'click' | ('hover' | 'focus' | 'click')[] - */ - trigger?: Triggers | Triggers[] - - /** - * Controls the visibility of the React Popover. - * - `true` shows the popover. - * - `false` hides the popover. - */ - visible?: boolean -} - -export const CPopover = forwardRef( - ( - { - children, - animation = true, - className, - container, - content, - delay = 0, - fallbackPlacements = ['top', 'right', 'bottom', 'left'], - offset = [0, 8], - onHide, - onShow, - placement = 'top', - popperConfig, - title, - trigger = 'click', - visible, - ...rest - }, - ref - ) => { - const popoverRef = useRef(null) - const togglerRef = useRef(null) - const forkedRef = useForkedRef(ref, popoverRef) - - const id = `popover${useId()}` - const [mounted, setMounted] = useState(false) - const [_visible, setVisible] = useState(visible) - - const { initPopper, destroyPopper } = usePopper() - - const _delay = typeof delay === 'number' ? { show: delay, hide: delay } : delay - - const defaultPopperConfig: Partial = { - modifiers: [ - { name: 'arrow', options: { element: '.popover-arrow' } }, - { name: 'flip', options: { fallbackPlacements } }, - { name: 'offset', options: { offset } }, - ], - placement: getRTLPlacement(placement, togglerRef.current), - } - - const computedPopperConfig: Partial = { - ...defaultPopperConfig, - ...(typeof popperConfig === 'function' ? popperConfig(defaultPopperConfig) : popperConfig), - } - - useEffect(() => { - if (visible) { - handleShow() - return - } - - handleHide() - }, [visible]) - - useEffect(() => { - if (mounted && togglerRef.current && popoverRef.current) { - initPopper(togglerRef.current, popoverRef.current, computedPopperConfig) - setTimeout(() => { - setVisible(true) - }, _delay.show) - - return - } - - if (!mounted && togglerRef.current && popoverRef.current) { - destroyPopper() - } - }, [mounted]) - - useEffect(() => { - if (!_visible && togglerRef.current && popoverRef.current) { - executeAfterTransition(() => { - setMounted(false) - }, popoverRef.current) - } - }, [_visible]) - - const handleShow = () => { - setMounted(true) - if (onShow) { - onShow() - } - } - - const handleHide = () => { - setTimeout(() => { - setVisible(false) - if (onHide) { - onHide() - } - }, _delay.hide) - } - - return ( - <> - {React.cloneElement(children as React.ReactElement, { - ...(_visible && { - 'aria-describedby': id, - }), - ref: togglerRef, - ...((trigger === 'click' || trigger.includes('click')) && { - onClick: () => (_visible ? handleHide() : handleShow()), - }), - ...((trigger === 'focus' || trigger.includes('focus')) && { - onFocus: () => handleShow(), - onBlur: () => handleHide(), - }), - ...((trigger === 'hover' || trigger.includes('hover')) && { - onMouseEnter: () => handleShow(), - onMouseLeave: () => handleHide(), - }), - })} - - {mounted && ( - - )} - - - ) - } -) - -CPopover.propTypes = { - animation: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - container: PropTypes.any, - content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - delay: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.shape({ - show: PropTypes.number.isRequired, - hide: PropTypes.number.isRequired, - }), - ]), - fallbackPlacements: fallbackPlacementsPropType, - offset: PropTypes.any, // TODO: find good proptype - onHide: PropTypes.func, - onShow: PropTypes.func, - placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']), - popperConfig: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), - title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - trigger: triggerPropType, - visible: PropTypes.bool, -} - -CPopover.displayName = 'CPopover' diff --git a/packages/coreui-react/src/components/popover/__tests__/CPopover.spec.tsx b/packages/coreui-react/src/components/popover/__tests__/CPopover.spec.tsx deleted file mode 100644 index 4adab9ce..00000000 --- a/packages/coreui-react/src/components/popover/__tests__/CPopover.spec.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import * as React from 'react' -import { act, cleanup, render, fireEvent, screen } from '@testing-library/react' -import '@testing-library/jest-dom' - -import { CButton } from '../../button' -import { CPopover } from '../index' - -let container: HTMLDivElement | null = null - -beforeEach(() => { - container = document.createElement('div') - document.body.appendChild(container) -}) - -afterEach(() => { - cleanup() -}) - -test('loads and displays CPopover component', async () => { - const { container } = render( - - Test - - ) - expect(container).toMatchSnapshot() -}) - -test('CPopover customize', async () => { - jest.useFakeTimers() - - render( - - Test - , - { container: container! } - ) - - const btn = screen.getByRole('button', { name: /test/i }) - - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - - expect(document.querySelector('.popover')).toBeInTheDocument() - expect(document.querySelector('.bs-popover-auto')).toBeInTheDocument() - expect(document.querySelector('.popover-arrow')).toBeInTheDocument() - expect(document.querySelector('.popover-header')).toBeInTheDocument() - expect(document.querySelector('.popover-body')).toBeInTheDocument() - - expect(document.querySelector('.popover-header')?.innerHTML).toBe('title') - expect(document.querySelector('.popover-body')?.innerHTML).toBe('content') - - jest.useRealTimers() -}) - -test('CPopover onShow and onHide', async () => { - jest.useFakeTimers() - - render( - - Test - , - { container: container! } - ) - - const onShow = jest.fn() - const onHide = jest.fn() - - const btn = screen.getByRole('button', { name: /test/i }) - - expect(onShow).toHaveBeenCalledTimes(0) - expect(onHide).toHaveBeenCalledTimes(0) - - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - - expect(onShow).toHaveBeenCalledTimes(1) - expect(onHide).toHaveBeenCalledTimes(0) - - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - - expect(onShow).toHaveBeenCalledTimes(1) - expect(onHide).toHaveBeenCalledTimes(1) - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap b/packages/coreui-react/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap deleted file mode 100644 index 22dfe0d2..00000000 --- a/packages/coreui-react/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`loads and displays CPopover component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/popover/index.ts b/packages/coreui-react/src/components/popover/index.ts deleted file mode 100644 index af7ef771..00000000 --- a/packages/coreui-react/src/components/popover/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CPopover } from './CPopover' - -export { CPopover } diff --git a/packages/coreui-react/src/components/progress/CProgress.tsx b/packages/coreui-react/src/components/progress/CProgress.tsx deleted file mode 100644 index 99ab990e..00000000 --- a/packages/coreui-react/src/components/progress/CProgress.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CProgressStackedContext } from './CProgressStackedContext' -import { CProgressBar, CProgressBarProps } from './CProgressBar' - -export interface CProgressProps - extends Omit, 'color'>, - CProgressBarProps { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Sets the height of the component. If you set that value the inner `` will automatically resize accordingly. - */ - height?: number - /** - * A string of all className you want applied to the `` component. - * - * @since 4.9.0 - */ - progressBarClassName?: string - /** - * Makes progress bar thinner. - */ - thin?: boolean - /** - * The percent to progress the ProgressBar (out of 100). - */ - value?: number - /** - * Change the default color to white. - */ - white?: boolean -} - -export const CProgress = forwardRef( - ({ children, className, height, progressBarClassName, thin, value, white, ...rest }, ref) => { - const { stacked } = useContext(CProgressStackedContext) - - return ( -
    - {React.Children.toArray(children).some( - // @ts-expect-error displayName is set in the CProgressBar component - (child) => child.type && child.type.displayName === 'CProgressBar', - ) ? ( - React.Children.map(children, (child) => { - // @ts-expect-error displayName is set in the CProgressBar component - if (React.isValidElement(child) && child.type.displayName === 'CProgressBar') { - return React.cloneElement(child, { - ...(value && { value: value }), - ...rest, - }) - } - - return - }) - ) : ( - - {children} - - )} -
    - ) - }, -) - -CProgress.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - height: PropTypes.number, - progressBarClassName: PropTypes.string, - thin: PropTypes.bool, - value: PropTypes.number, - white: PropTypes.bool, -} - -CProgress.displayName = 'CProgress' diff --git a/packages/coreui-react/src/components/progress/CProgressBar.tsx b/packages/coreui-react/src/components/progress/CProgressBar.tsx deleted file mode 100644 index 70cf5efa..00000000 --- a/packages/coreui-react/src/components/progress/CProgressBar.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -import { CProgressStackedContext } from './CProgressStackedContext' - -export interface CProgressBarProps extends HTMLAttributes { - /** - * Use to animate the stripes right to left via CSS3 animations. - */ - animated?: boolean - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * The percent to progress the ProgressBar. - */ - value?: number - /** - * Set the progress bar variant to optional striped. - */ - variant?: 'striped' -} - -export const CProgressBar = forwardRef( - ({ children, animated, className, color, value = 0, variant, ...rest }, ref) => { - const { stacked } = useContext(CProgressStackedContext) - - return ( -
    - {children} -
    - ) - }, -) -CProgressBar.propTypes = { - animated: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - value: PropTypes.number, - variant: PropTypes.oneOf(['striped']), -} - -CProgressBar.displayName = 'CProgressBar' diff --git a/packages/coreui-react/src/components/progress/CProgressStacked.tsx b/packages/coreui-react/src/components/progress/CProgressStacked.tsx deleted file mode 100644 index 7a7d917f..00000000 --- a/packages/coreui-react/src/components/progress/CProgressStacked.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CProgressStackedContext } from './CProgressStackedContext' - -export interface CProgressStackedProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CProgressStacked = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - - {children} - -
    - ) - } -) - -CProgressStacked.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CProgressStacked.displayName = 'CProgressStacked' diff --git a/packages/coreui-react/src/components/progress/CProgressStackedContext.ts b/packages/coreui-react/src/components/progress/CProgressStackedContext.ts deleted file mode 100644 index a0ec61e9..00000000 --- a/packages/coreui-react/src/components/progress/CProgressStackedContext.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createContext } from 'react' - -export interface CProgressStackedContextProps { - stacked?: boolean -} - -export const CProgressStackedContext = createContext({} as CProgressStackedContextProps) diff --git a/packages/coreui-react/src/components/progress/__tests__/CProgress.spec.tsx b/packages/coreui-react/src/components/progress/__tests__/CProgress.spec.tsx deleted file mode 100644 index ee66e32c..00000000 --- a/packages/coreui-react/src/components/progress/__tests__/CProgress.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CProgress } from '../index' - -test('loads and displays CProgress component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CProgress customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('progress') - expect(container.firstChild).toHaveStyle(`height: 100px`) -}) diff --git a/packages/coreui-react/src/components/progress/__tests__/CProgressBar.spec.tsx b/packages/coreui-react/src/components/progress/__tests__/CProgressBar.spec.tsx deleted file mode 100644 index 1e084a2c..00000000 --- a/packages/coreui-react/src/components/progress/__tests__/CProgressBar.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CProgressBar } from '../index' - -test('loads and displays CProgressBar component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CProgressBar customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('progress-bar') - - expect(container.firstChild).toHaveClass('bg-warning') - expect(container.firstChild).toHaveClass('progress-bar-striped') - expect(container.firstChild).toHaveClass('progress-bar-animated') - expect(container.firstChild).toHaveStyle(`width: 50%`) -}) diff --git a/packages/coreui-react/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap b/packages/coreui-react/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap deleted file mode 100644 index 6d566948..00000000 --- a/packages/coreui-react/src/components/progress/__tests__/__snapshots__/CProgress.spec.tsx.snap +++ /dev/null @@ -1,36 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CProgress customize 1`] = ` -
    -
    -
    - Test -
    -
    -
    -`; - -exports[`loads and displays CProgress component 1`] = ` -
    -
    -
    - Test -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap b/packages/coreui-react/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap deleted file mode 100644 index bd11157d..00000000 --- a/packages/coreui-react/src/components/progress/__tests__/__snapshots__/CProgressBar.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CProgressBar customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CProgressBar component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/progress/index.ts b/packages/coreui-react/src/components/progress/index.ts deleted file mode 100644 index 29b68ae2..00000000 --- a/packages/coreui-react/src/components/progress/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CProgress } from './CProgress' -import { CProgressBar } from './CProgressBar' -import { CProgressStacked } from './CProgressStacked' - -export { CProgress, CProgressBar, CProgressStacked } diff --git a/packages/coreui-react/src/components/sidebar/CSidebar.tsx b/packages/coreui-react/src/components/sidebar/CSidebar.tsx deleted file mode 100644 index 519bc097..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebar.tsx +++ /dev/null @@ -1,244 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes, useEffect, useRef, useState } from 'react' -import { createPortal } from 'react-dom' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CBackdrop } from '../backdrop' - -import { isInViewport } from '../../utils' -import { useForkedRef } from '../../hooks' -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CSidebarProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Sets if the color of text should be colored for a light or dark dark background. - * - * @type 'dark' | 'light' - */ - colorScheme?: 'dark' | 'light' - /** - * Make sidebar narrow. - */ - narrow?: boolean - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Event emitted after visibility of component changed. - */ - onVisibleChange?: (visible: boolean) => void - /** - * Set sidebar to overlaid variant. - */ - overlaid?: boolean - /** - * Components placement, there’s no default placement. - * @type 'start' | 'end' - */ - placement?: 'start' | 'end' - /** - * Place sidebar in non-static positions. - */ - position?: 'fixed' | 'sticky' - /** - * Size the component small, large, or extra large. - */ - size?: 'sm' | 'lg' | 'xl' - /** - * Expand narrowed sidebar on hover. - */ - unfoldable?: boolean - /** - * Toggle the visibility of sidebar component. - */ - visible?: boolean -} - -const isOnMobile = (element: HTMLDivElement) => - Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile')) - -export const CSidebar: PolymorphicRefForwardingComponent<'div', CSidebarProps> = forwardRef< - HTMLDivElement, - CSidebarProps ->( - ( - { - children, - as: Component = 'div', - className, - colorScheme, - narrow, - onHide, - onShow, - onVisibleChange, - overlaid, - placement, - position, - size, - unfoldable, - visible, - ...rest - }, - ref, - ) => { - const sidebarRef = useRef(null) - const forkedRef = useForkedRef(ref, sidebarRef) - - const [inViewport, setInViewport] = useState() - const [mobile, setMobile] = useState(false) - const [visibleMobile, setVisibleMobile] = useState(false) - const [visibleDesktop, setVisibleDesktop] = useState( - visible !== undefined ? visible : overlaid ? false : true, - ) - - useEffect(() => { - sidebarRef.current && setMobile(isOnMobile(sidebarRef.current)) - visible !== undefined && handleVisibleChange(visible) - }, [visible]) - - useEffect(() => { - inViewport !== undefined && onVisibleChange && onVisibleChange(inViewport) - !inViewport && onHide && onHide() - inViewport && onShow && onShow() - }, [inViewport]) - - useEffect(() => { - mobile && setVisibleMobile(false) - }, [mobile]) - - useEffect(() => { - sidebarRef.current && setMobile(isOnMobile(sidebarRef.current)) - sidebarRef.current && setInViewport(isInViewport(sidebarRef.current)) - - window.addEventListener('resize', handleResize) - window.addEventListener('mouseup', handleClickOutside) - window.addEventListener('keyup', handleKeyup) - - sidebarRef.current?.addEventListener('mouseup', handleOnClick) - sidebarRef.current?.addEventListener('transitionend', () => { - sidebarRef.current && setInViewport(isInViewport(sidebarRef.current)) - }) - - return () => { - window.removeEventListener('resize', handleResize) - window.removeEventListener('mouseup', handleClickOutside) - window.removeEventListener('keyup', handleKeyup) - - sidebarRef.current?.removeEventListener('mouseup', handleOnClick) - sidebarRef.current?.removeEventListener('transitionend', () => { - sidebarRef.current && setInViewport(isInViewport(sidebarRef.current)) - }) - } - }) - - const handleVisibleChange = (visible: boolean) => { - if (mobile) { - setVisibleMobile(visible) - return - } - - setVisibleDesktop(visible) - } - - const handleHide = () => { - handleVisibleChange(false) - } - - const handleResize = () => { - sidebarRef.current && setMobile(isOnMobile(sidebarRef.current)) - sidebarRef.current && setInViewport(isInViewport(sidebarRef.current)) - } - - const handleKeyup = (event: Event) => { - if ( - mobile && - sidebarRef.current && - !sidebarRef.current.contains(event.target as HTMLElement) - ) { - handleHide() - } - } - const handleClickOutside = (event: Event) => { - if ( - mobile && - sidebarRef.current && - !sidebarRef.current.contains(event.target as HTMLElement) - ) { - handleHide() - } - } - - const handleOnClick = (event: Event) => { - const target = event.target as HTMLAnchorElement - target && - target.classList.contains('nav-link') && - !target.classList.contains('nav-group-toggle') && - mobile && - handleHide() - } - - return ( - <> - - {children} - - {typeof window !== 'undefined' && - mobile && - createPortal( - , - document.body, - )} - - ) - }, -) - -CSidebar.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, - colorScheme: PropTypes.oneOf(['dark', 'light']), - narrow: PropTypes.bool, - onHide: PropTypes.func, - onShow: PropTypes.func, - onVisibleChange: PropTypes.func, - overlaid: PropTypes.bool, - placement: PropTypes.oneOf(['start', 'end']), - position: PropTypes.oneOf(['fixed', 'sticky']), - size: PropTypes.oneOf(['sm', 'lg', 'xl']), - unfoldable: PropTypes.bool, - visible: PropTypes.bool, -} - -CSidebar.displayName = 'CSidebar' \ No newline at end of file diff --git a/packages/coreui-react/src/components/sidebar/CSidebarBrand.tsx b/packages/coreui-react/src/components/sidebar/CSidebarBrand.tsx deleted file mode 100644 index 597818cd..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebarBrand.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CSidebarBrandProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - * @since 5.0.0 - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CSidebarBrand: PolymorphicRefForwardingComponent<'a', CSidebarBrandProps> = forwardRef< - HTMLAnchorElement | HTMLDivElement, - CSidebarBrandProps ->(({ children, as: Component = 'a', className, ...rest }, ref) => { - return ( - - {children} - - ) -}) - -CSidebarBrand.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CSidebarBrand.displayName = 'CSidebarBrand' diff --git a/packages/coreui-react/src/components/sidebar/CSidebarFooter.tsx b/packages/coreui-react/src/components/sidebar/CSidebarFooter.tsx deleted file mode 100644 index 34e2f15c..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebarFooter.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CSidebarFooterProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CSidebarFooter = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CSidebarFooter.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CSidebarFooter.displayName = 'CSidebarFooter' diff --git a/packages/coreui-react/src/components/sidebar/CSidebarHeader.tsx b/packages/coreui-react/src/components/sidebar/CSidebarHeader.tsx deleted file mode 100644 index a18bfff1..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebarHeader.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CSidebarHeaderProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CSidebarHeader = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CSidebarHeader.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CSidebarHeader.displayName = 'CSidebarHeader' diff --git a/packages/coreui-react/src/components/sidebar/CSidebarNav.tsx b/packages/coreui-react/src/components/sidebar/CSidebarNav.tsx deleted file mode 100644 index 46d07447..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebarNav.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import React, { - ElementType, - forwardRef, - HTMLAttributes, - ReactElement, - ReactNode, - useState, -} from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import type { CNavGroupProps } from '../nav/CNavGroup' -import type { CNavLinkProps } from '../nav/CNavLink' -import type { CNavItemProps } from '../nav/CNavItem' - -import { CSidebarNavContext } from './CSidebarNavContext' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -export interface CSidebarNavProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - * - * @since 5.0.0 - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -const isNavElement = ( - child: ReactNode -): child is ReactElement => { - if (!React.isValidElement(child)) return false - const type = child.type as { displayName?: string } - return ( - type.displayName === 'CNavGroup' || - type.displayName === 'CNavLink' || - type.displayName === 'CNavItem' - ) -} - -const recursiveClone = (children: ReactNode, id?: string, updateId?: boolean): ReactNode => { - return React.Children.map(children, (child, index) => { - if (!isNavElement(child)) { - return child - } - - const _id = id ? (updateId ? `${id}.${index}` : `${id}`) : `${index}` - - if (child.props.children) { - const type = child.type as { displayName?: string } - const shouldUpdateId = type.displayName !== 'CNavItem' - - return React.cloneElement(child, { - idx: _id, - children: recursiveClone(child.props.children, _id, shouldUpdateId), - }) - } - - return React.cloneElement(child, { - idx: _id, - }) - }) -} - -export const CSidebarNav: PolymorphicRefForwardingComponent<'ul', CSidebarNavProps> = forwardRef< - HTMLUListElement, - CSidebarNavProps ->(({ children, as: Component = 'ul', className, ...rest }, ref) => { - const [visibleGroup, setVisibleGroup] = useState('') - const CNavContextValues = { - visibleGroup, - setVisibleGroup, - } - - return ( - - - {recursiveClone(children)} - - - ) -}) - -CSidebarNav.propTypes = { - as: PropTypes.elementType, - children: PropTypes.node, - className: PropTypes.string, -} - -CSidebarNav.displayName = 'CSidebarNav' diff --git a/packages/coreui-react/src/components/sidebar/CSidebarNavContext.ts b/packages/coreui-react/src/components/sidebar/CSidebarNavContext.ts deleted file mode 100644 index a880a648..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebarNavContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createContext } from 'react' - -export interface CSidebarNavContextProps { - visibleGroup: string - setVisibleGroup: React.Dispatch> -} - -export const CSidebarNavContext = createContext({} as CSidebarNavContextProps) diff --git a/packages/coreui-react/src/components/sidebar/CSidebarToggler.tsx b/packages/coreui-react/src/components/sidebar/CSidebarToggler.tsx deleted file mode 100644 index 487275b8..00000000 --- a/packages/coreui-react/src/components/sidebar/CSidebarToggler.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CSidebarTogglerProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string -} - -export const CSidebarToggler = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( - - ) - }, -) - -CSidebarToggler.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CSidebarToggler.displayName = 'CSidebarToggler' diff --git a/packages/coreui-react/src/components/sidebar/__tests__/CSidebar.spec.tsx b/packages/coreui-react/src/components/sidebar/__tests__/CSidebar.spec.tsx deleted file mode 100644 index 5eb802a6..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/CSidebar.spec.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { - CSidebar /* , CSidebarNav, CNavLink, CNavGroup, CNavGroupItems, CNavItem */, -} from '../index' - -test('loads and displays CSidebar component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CSidebar customize show', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('sidebar') - expect(container.firstChild).toHaveClass('sidebar-narrow') - expect(container.firstChild).toHaveClass('sidebar-overlaid') - expect(container.firstChild).toHaveClass('sidebar-fixed') - expect(container.firstChild).toHaveClass('sidebar-narrow-unfoldable') - // expect(container.firstChild).toHaveClass('show') -}) - -test('CSidebar customize hide', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('sidebar') - expect(container.firstChild).toHaveClass('sidebar-sticky') -}) diff --git a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarBrand.spec.tsx b/packages/coreui-react/src/components/sidebar/__tests__/CSidebarBrand.spec.tsx deleted file mode 100644 index 5c16bd3e..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarBrand.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CSidebarBrand } from '../index' - -test('loads and displays CSidebarBrand component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CSidebarBrand customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('sidebar-brand') -}) diff --git a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarFooter.spec.tsx b/packages/coreui-react/src/components/sidebar/__tests__/CSidebarFooter.spec.tsx deleted file mode 100644 index 765fa278..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarFooter.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CSidebarFooter } from '../index' - -test('loads and displays CSidebarFooter component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CSidebarFooter customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('sidebar-footer') -}) diff --git a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarHeader.spec.tsx b/packages/coreui-react/src/components/sidebar/__tests__/CSidebarHeader.spec.tsx deleted file mode 100644 index c41fd9f5..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarHeader.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CSidebarHeader } from '../index' - -test('loads and displays CSidebarHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CSidebarHeader customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('sidebar-header') -}) diff --git a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarNav.spec.tsx b/packages/coreui-react/src/components/sidebar/__tests__/CSidebarNav.spec.tsx deleted file mode 100644 index 086f0dff..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarNav.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CSidebarNav } from '../index' - -test('loads and displays CSidebarNav component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CSidebarNav customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('sidebar-nav') -}) diff --git a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarToggler.spec.tsx b/packages/coreui-react/src/components/sidebar/__tests__/CSidebarToggler.spec.tsx deleted file mode 100644 index d2b69c2a..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/CSidebarToggler.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CSidebarToggler } from '../index' - -test('loads and displays CSidebarToggler component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CSidebarToggler customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('sidebar-toggler') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebar.spec.tsx.snap b/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebar.spec.tsx.snap deleted file mode 100644 index 045e4f95..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebar.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSidebar customize hide 1`] = ` -
    - -
    -`; - -exports[`CSidebar customize show 1`] = ` -
    - -
    -`; - -exports[`loads and displays CSidebar component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarBrand.spec.tsx.snap b/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarBrand.spec.tsx.snap deleted file mode 100644 index a307004e..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarBrand.spec.tsx.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSidebarBrand customize 1`] = ` - -`; - -exports[`loads and displays CSidebarBrand component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarFooter.spec.tsx.snap b/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarFooter.spec.tsx.snap deleted file mode 100644 index fa15ad34..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarFooter.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSidebarFooter customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CSidebarFooter component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarHeader.spec.tsx.snap b/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarHeader.spec.tsx.snap deleted file mode 100644 index 09d19bfd..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarHeader.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSidebarHeader customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CSidebarHeader component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarNav.spec.tsx.snap b/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarNav.spec.tsx.snap deleted file mode 100644 index 4dd9cd96..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarNav.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSidebarNav customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CSidebarNav component 1`] = ` -
    - -
    -`; diff --git a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarToggler.spec.tsx.snap b/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarToggler.spec.tsx.snap deleted file mode 100644 index 269f7b73..00000000 --- a/packages/coreui-react/src/components/sidebar/__tests__/__snapshots__/CSidebarToggler.spec.tsx.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSidebarToggler customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CSidebarToggler component 1`] = ` -
    -
    -`; diff --git a/packages/coreui-react/src/components/sidebar/index.ts b/packages/coreui-react/src/components/sidebar/index.ts deleted file mode 100644 index 12a076d2..00000000 --- a/packages/coreui-react/src/components/sidebar/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSidebar } from './CSidebar' -import { CSidebarBrand } from './CSidebarBrand' -import { CSidebarFooter } from './CSidebarFooter' -import { CSidebarToggler } from './CSidebarToggler' -import { CSidebarHeader } from './CSidebarHeader' -import { CSidebarNav } from './CSidebarNav' - -export { CSidebar, CSidebarBrand, CSidebarFooter, CSidebarToggler, CSidebarHeader, CSidebarNav } diff --git a/packages/coreui-react/src/components/spinner/CSpinner.tsx b/packages/coreui-react/src/components/spinner/CSpinner.tsx deleted file mode 100644 index c158f86f..00000000 --- a/packages/coreui-react/src/components/spinner/CSpinner.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { ElementType, forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { PolymorphicRefForwardingComponent } from '../../helpers' -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CSpinnerProps extends HTMLAttributes { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: ElementType - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * Size the component small. - */ - size?: 'sm' - /** - * Set the button variant to an outlined button or a ghost button. - */ - variant?: 'border' | 'grow' - /** - * Set visually hidden label for accessibility purposes. - */ - visuallyHiddenLabel?: string -} - -export const CSpinner: PolymorphicRefForwardingComponent<'div', CSpinnerProps> = forwardRef< - HTMLDivElement | HTMLSpanElement, - CSpinnerProps ->( - ( - { - as: Component = 'div', - className, - color, - size, - variant = 'border', - visuallyHiddenLabel = 'Loading...', - ...rest - }, - ref, - ) => { - return ( - - {visuallyHiddenLabel} - - ) - }, -) - -CSpinner.propTypes = { - as: PropTypes.string, - className: PropTypes.string, - color: colorPropType, - size: PropTypes.oneOf(['sm']), - variant: PropTypes.oneOf(['border', 'grow']), - visuallyHiddenLabel: PropTypes.string, -} - -CSpinner.displayName = 'CSpinner' diff --git a/packages/coreui-react/src/components/spinner/__tests__/CSpinner.spec.tsx b/packages/coreui-react/src/components/spinner/__tests__/CSpinner.spec.tsx deleted file mode 100644 index 27a8e65b..00000000 --- a/packages/coreui-react/src/components/spinner/__tests__/CSpinner.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CSpinner } from '../index' - -test('loads and displays CSpinner component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CSpinner customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('spinner-grow') - expect(container.firstChild).toHaveClass('text-warning') - expect(container.firstChild).toHaveClass('spinner-grow-sm') -}) diff --git a/packages/coreui-react/src/components/spinner/__tests__/__snapshots__/CSpinner.spec.tsx.snap b/packages/coreui-react/src/components/spinner/__tests__/__snapshots__/CSpinner.spec.tsx.snap deleted file mode 100644 index 44888fc5..00000000 --- a/packages/coreui-react/src/components/spinner/__tests__/__snapshots__/CSpinner.spec.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CSpinner customize 1`] = ` -
    -

    - - Loading... - -

    -
    -`; - -exports[`loads and displays CSpinner component 1`] = ` -
    -
    - - Loading... - -
    -
    -`; diff --git a/packages/coreui-react/src/components/spinner/index.ts b/packages/coreui-react/src/components/spinner/index.ts deleted file mode 100644 index 2c23f866..00000000 --- a/packages/coreui-react/src/components/spinner/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CSpinner } from './CSpinner' - -export { CSpinner } diff --git a/packages/coreui-react/src/components/table/CTable.tsx b/packages/coreui-react/src/components/table/CTable.tsx deleted file mode 100644 index 580b9514..00000000 --- a/packages/coreui-react/src/components/table/CTable.tsx +++ /dev/null @@ -1,267 +0,0 @@ -import React, { forwardRef, TableHTMLAttributes, useMemo } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CTableHead, CTableHeadProps } from './CTableHead' -import { CTableHeaderCell } from './CTableHeaderCell' -import { CTableBody } from './CTableBody' -import { CTableDataCell } from './CTableDataCell' -import { CTableRow } from './CTableRow' -import { CTableFoot, CTableFootProps } from './CTableFoot' -import { CTableCaption } from './CTableCaption' -import { CTableResponsiveWrapper } from './CTableResponsiveWrapper' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' -import { getColumnLabel, getColumnNames } from './utils' -import type { Column, FooterItem, Item } from './types' - -export interface CTableProps extends Omit, 'align'> { - /** - * Set the vertical aligment. - */ - align?: 'bottom' | 'middle' | 'top' | string - /** - * Sets the border color of the component to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - */ - borderColor?: Colors - /** - * Add borders on all sides of the table and cells. - */ - bordered?: boolean - /** - * Remove borders on all sides of the table and cells. - */ - borderless?: boolean - /** - * Put the caption on the top if you set `caption="top"` of the table or set the text of the table caption. - */ - caption?: 'top' | string - /** - * Set the text of the table caption and the caption on the top of the table. - * - * @since 4.3.0 - */ - captionTop?: string - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_props') - * - * In columns prop each array item represents one column. Item might be specified in two ways: - * String: each item define column name equal to item value. - * Object: item is object with following keys available as column configuration: - * - key (required)(String) - define column name equal to item key. - * - label (String) - define visible label of column. If not defined, label will be generated automatically based on column name, by converting kebab-case and snake_case to individual words and capitalization of each word. - * - _props (Object) - adds classes to all cels in column, ex. `_props: { scope: 'col', className: 'custom-class' }`, - * - _style (Object) - adds styles to the column header (useful for defining widths) - * - * @since 4.3.0 - */ - columns?: (string | Column)[] - /** - * 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 - /** - * Array of objects or strings, where each element represents one cell in the table footer. - * - * Example items: - * `['FooterCell', 'FooterCell', 'FooterCell']` - * or - * `[{ label: 'FooterCell', _props: { color: 'success' }, ...]` - * - * @since 4.3.0 - */ - footer?: (FooterItem | string)[] - /** - * Enable a hover state on table rows within a ``. - */ - hover?: boolean - /** - * Array of objects, where each object represents one item - row in table. Additionally, you can add style classes to each row by passing them by '_props' key and to single cell by '_cellProps'. - * - * Example item: - * `{ name: 'John' , age: 12, _props: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}` - * - * @since 4.3.0 - */ - items?: Item[] - /** - * Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to. - */ - responsive?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - /** - * Make table more compact by cutting all cell `padding` in half. - */ - small?: boolean - /** - * Add zebra-striping to any table row within the ``. - */ - striped?: boolean - /** - * Add zebra-striping to any table column. - * - * @since 4.3.0 - */ - stripedColumns?: boolean - /** - * Properties that will be passed to the table footer component. - * - * @link https://coreui.io/react/docs/components/table/#ctablefoot - * @since 4.3.0 - */ - tableFootProps?: CTableFootProps - /** - * Properties that will be passed to the table head component. - * - * @link https://coreui.io/react/docs/components/table/#ctablehead - * @since 4.3.0 - */ - tableHeadProps?: CTableHeadProps -} - -export const CTable = forwardRef( - ( - { - children, - align, - borderColor, - bordered, - borderless, - caption, - captionTop, - className, - color, - columns, - footer, - hover, - items, - responsive, - small, - striped, - stripedColumns, - tableFootProps, - tableHeadProps, - ...rest - }, - ref, - ) => { - const columnNames = useMemo(() => getColumnNames(columns, items), [columns, items]) - - return ( - - - {((caption && caption !== 'top') || captionTop) && ( - {caption || captionTop} - )} - {columns && ( - - - {columns.map((column: Column, index: number) => ( - - {getColumnLabel(column)} - - ))} - - - )} - {items && ( - - {items.map((item: Item, index: number) => ( - - {columnNames && - columnNames.map((colName: string, index: number) => { - // eslint-disable-next-line unicorn/no-negated-condition - return item[colName] !== undefined ? ( - - {item[colName]} - - ) : null - })} - - ))} - - )} - {children} - {footer && ( - - - {footer.map((item: FooterItem | string, index: number) => ( - - {typeof item === 'object' ? item.label : item} - - ))} - - - )} -
    -
    - ) - }, -) - -CTable.propTypes = { - align: PropTypes.oneOf(['bottom', 'middle', 'top']), - borderColor: PropTypes.string, - bordered: PropTypes.bool, - borderless: PropTypes.bool, - caption: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOf(['top'])]), - captionTop: PropTypes.string, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - columns: PropTypes.array, - footer: PropTypes.array, - hover: PropTypes.bool, - items: PropTypes.array, - responsive: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']), - ]), - small: PropTypes.bool, - striped: PropTypes.bool, - stripedColumns: PropTypes.bool, - tableFootProps: PropTypes.shape({ ...CTableFoot.propTypes }), - tableHeadProps: PropTypes.shape({ ...CTableHead.propTypes }), -} - -CTable.displayName = 'CTable' diff --git a/packages/coreui-react/src/components/table/CTableBody.tsx b/packages/coreui-react/src/components/table/CTableBody.tsx deleted file mode 100644 index 893cd5f1..00000000 --- a/packages/coreui-react/src/components/table/CTableBody.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CTableBodyProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 -} - -export const CTableBody = forwardRef( - ({ children, className, color, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CTableBody.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CTableBody.displayName = 'CTableBody' diff --git a/packages/coreui-react/src/components/table/CTableCaption.tsx b/packages/coreui-react/src/components/table/CTableCaption.tsx deleted file mode 100644 index 3d2401f4..00000000 --- a/packages/coreui-react/src/components/table/CTableCaption.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' - -export const CTableCaption = forwardRef< - HTMLTableCaptionElement, - HTMLAttributes ->(({ children, ...props }, ref) => { - return ( - - {children} - - ) -}) - -CTableCaption.propTypes = { - children: PropTypes.node, -} - -CTableCaption.displayName = 'CTableCaption' diff --git a/packages/coreui-react/src/components/table/CTableDataCell.tsx b/packages/coreui-react/src/components/table/CTableDataCell.tsx deleted file mode 100644 index 02a040aa..00000000 --- a/packages/coreui-react/src/components/table/CTableDataCell.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React, { forwardRef, TdHTMLAttributes, ThHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CTableDataCellProps - extends Omit, 'align'>, - Omit, 'align'> { - /** - * Highlight a table row or cell. - */ - active?: boolean - /** - * Set the vertical aligment. - */ - align?: 'bottom' | 'middle' | 'top' | string - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 - /** - * @ignore - */ - colSpan?: number -} - -export const CTableDataCell = forwardRef( - ({ children, active, align, className, color, ...rest }, ref) => { - const Component = rest.scope ? 'th' : 'td' - - return ( - - {children} - - ) - }, -) - -CTableDataCell.propTypes = { - active: PropTypes.bool, - align: PropTypes.oneOf(['bottom', 'middle', 'top']), - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CTableDataCell.displayName = 'CTableDataCell' diff --git a/packages/coreui-react/src/components/table/CTableFoot.tsx b/packages/coreui-react/src/components/table/CTableFoot.tsx deleted file mode 100644 index dbbf8b50..00000000 --- a/packages/coreui-react/src/components/table/CTableFoot.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import PropTypes from 'prop-types' -import React, { forwardRef, HTMLAttributes } from 'react' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CTableFootProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 -} - -export const CTableFoot = forwardRef( - ({ children, className, color, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CTableFoot.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CTableFoot.displayName = 'CTableFoot' diff --git a/packages/coreui-react/src/components/table/CTableHead.tsx b/packages/coreui-react/src/components/table/CTableHead.tsx deleted file mode 100644 index a8cff525..00000000 --- a/packages/coreui-react/src/components/table/CTableHead.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CTableHeadProps extends HTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 -} - -export const CTableHead = forwardRef( - ({ children, className, color, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CTableHead.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CTableHead.displayName = 'CTableHead' diff --git a/packages/coreui-react/src/components/table/CTableHeaderCell.tsx b/packages/coreui-react/src/components/table/CTableHeaderCell.tsx deleted file mode 100644 index cf13571c..00000000 --- a/packages/coreui-react/src/components/table/CTableHeaderCell.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { forwardRef, ThHTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CTableHeaderCellProps extends ThHTMLAttributes { - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 -} - -export const CTableHeaderCell = forwardRef( - ({ children, className, color, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CTableHeaderCell.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CTableHeaderCell.displayName = 'CTableHeaderCell' diff --git a/packages/coreui-react/src/components/table/CTableResponsiveWrapper.tsx b/packages/coreui-react/src/components/table/CTableResponsiveWrapper.tsx deleted file mode 100644 index 321c5d2f..00000000 --- a/packages/coreui-react/src/components/table/CTableResponsiveWrapper.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React, { FC, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' - -export interface CTableResponsiveWrapperProps extends HTMLAttributes { - /** - * Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to. - */ - responsive?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' -} - -export const CTableResponsiveWrapper: FC = ({ - children, - responsive, - ...rest -}) => { - return responsive ? ( -
    - {children} -
    - ) : ( - <>{children} - ) -} - -CTableResponsiveWrapper.propTypes = { - children: PropTypes.node, - responsive: PropTypes.oneOfType([ - PropTypes.bool, - PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']), - ]), -} - -CTableResponsiveWrapper.displayName = 'CTableResponsiveWrapper' diff --git a/packages/coreui-react/src/components/table/CTableRow.tsx b/packages/coreui-react/src/components/table/CTableRow.tsx deleted file mode 100644 index 9130ee17..00000000 --- a/packages/coreui-react/src/components/table/CTableRow.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CTableRowProps extends HTMLAttributes { - /** - * Highlight a table row or cell.. - */ - active?: boolean - /** - * Set the vertical aligment. - */ - align?: 'bottom' | 'middle' | 'top' | string - /** - * A string of all className you want applied to the component. - */ - className?: string - /** - * 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 -} - -export const CTableRow = forwardRef( - ({ children, active, align, className, color, ...rest }, ref) => { - return ( - - {children} - - ) - }, -) - -CTableRow.propTypes = { - active: PropTypes.bool, - align: PropTypes.oneOf(['bottom', 'middle', 'top']), - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, -} - -CTableRow.displayName = 'CTableRow' diff --git a/packages/coreui-react/src/components/table/__tests__/CTable.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTable.spec.tsx deleted file mode 100644 index 6427b3a0..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTable.spec.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { - CTable, - CTableCaption, - CTableHead, - CTableRow, - CTableHeaderCell, - CTableBody, - CTableDataCell, - CTableFoot, -} from '../index' - -test('loads and displays CTable component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('loads and displays CTable component - new way', async () => { - const columns = [ - { - key: 'id', - label: '#', - _props: { scope: 'col' }, - }, - 'class', - { - key: 'heading_1', - label: 'Heading', - _props: { scope: 'col' }, - }, - { - key: 'heading_2', - label: 'Heading', - _props: { scope: 'col' }, - }, - ] - const items = [ - { - id: 1, - class: 'Mark', - heading_1: 'Otto', - heading_2: '@mdo', - _cellProps: { id: { scope: 'row' } }, - }, - { - id: 2, - class: 'Jacob', - heading_1: 'Thornton', - heading_2: '@fat', - _cellProps: { id: { scope: 'row' } }, - }, - { - id: 3, - class: 'Larry the Bird', - heading_2: '@twitter', - _cellProps: { id: { scope: 'row' }, class: { colSpan: 2 } }, - }, - ] - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CTable customize', async () => { - const { container } = render( - - - - Test - - - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('table-responsive-xl') - if (container.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('table') - expect(container.firstChild.firstChild).toHaveClass('align-middle') - expect(container.firstChild.firstChild).toHaveClass('caption-top') - expect(container.firstChild.firstChild).toHaveClass('border-primary') - expect(container.firstChild.firstChild).toHaveClass('table-bordered') - expect(container.firstChild.firstChild).toHaveClass('table-borderless') - expect(container.firstChild.firstChild).toHaveClass('table-info') - expect(container.firstChild.firstChild).toHaveClass('table-hover') - expect(container.firstChild.firstChild).toHaveClass('table-sm') - expect(container.firstChild.firstChild).toHaveClass('table-striped') - expect(container.firstChild.firstChild).toHaveClass('bazinga') - expect(container.firstChild.firstChild).toHaveTextContent('Test') - } -}) - -test('CTable full example test', async () => { - const { container } = render( - - List of users - - - # - Class - Heading - Heading - - - - - 1 - Mark - Otto - @mdo - - - 2 - Jacob - Thornton - @fat - - - 3 - Larry - the Bird - @twitter - - - - - # - Class - Heading - Heading - - - , - ) - expect(container).toMatchSnapshot() -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableBody.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableBody.spec.tsx deleted file mode 100644 index 093e3e0b..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableBody.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableBody, CTableDataCell, CTableRow } from '../index' - -test('loads and displays CTableBody component', async () => { - const table = document.createElement('table') - const { container } = render(, { - container: document.body.appendChild(table), - }) - expect(container).toMatchSnapshot() -}) - -test('CTableBody customize', async () => { - const table = document.createElement('table') - const { container } = render( - - - Test - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('table-info') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableCaption.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableCaption.spec.tsx deleted file mode 100644 index 607244c0..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableCaption.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableCaption } from '../index' - -test('loads and displays CTableCaption component', async () => { - const table = document.createElement('table') - const { container } = render(, { - container: document.body.appendChild(table), - }) - expect(container).toMatchSnapshot() -}) - -test('CTableCaption customize', async () => { - const table = document.createElement('table') - const { container } = render(Test, { - container: document.body.appendChild(table), - }) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableDataCell.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableDataCell.spec.tsx deleted file mode 100644 index 08f0057b..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableDataCell.spec.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableDataCell } from '../index' -import { CTableBody } from '../CTableBody' -import { CTableRow } from '../CTableRow' - -test('loads and displays CTableDataCell component', async () => { - const table = document.createElement('table') - const { container } = render( - - - - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() -}) - -test('CTableDataCell customize', async () => { - const table = document.createElement('table') - const { container } = render( - - - - Test - - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() - expect(container.firstChild?.firstChild?.firstChild).toHaveClass('align-middle') - expect(container.firstChild?.firstChild?.firstChild).toHaveClass('table-active') - expect(container.firstChild?.firstChild?.firstChild).toHaveClass('table-info') - expect(container.firstChild?.firstChild?.firstChild).toHaveClass('bazinga') - expect(container.firstChild?.firstChild?.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableFoot.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableFoot.spec.tsx deleted file mode 100644 index 741d44de..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableFoot.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableFoot, CTableHeaderCell, CTableRow } from '../index' - -test('loads and displays CTableFoot component', async () => { - const table = document.createElement('table') - const { container } = render(, { - container: document.body.appendChild(table), - }) - expect(container).toMatchSnapshot() -}) - -test('CTableFoot customize', async () => { - const table = document.createElement('table') - const { container } = render( - - - Test - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('table-info') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild?.firstChild?.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableHead.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableHead.spec.tsx deleted file mode 100644 index e9c65340..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableHead.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableHead, CTableHeaderCell, CTableRow } from '../index' - -test('loads and displays CTableHead component', async () => { - const table = document.createElement('table') - const { container } = render(, { - container: document.body.appendChild(table), - }) - expect(container).toMatchSnapshot() -}) - -test('CTableHead customize', async () => { - const table = document.createElement('table') - const { container } = render( - - - Test - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('table-info') - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild?.firstChild?.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableHeaderCell.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableHeaderCell.spec.tsx deleted file mode 100644 index 27f409cb..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableHeaderCell.spec.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableHead, CTableHeaderCell, CTableRow } from '../index' - -test('loads and displays CTableHeaderCell component', async () => { - const table = document.createElement('table') - const { container } = render( - - - - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() -}) - -test('CTableHeaderCell customize', async () => { - const table = document.createElement('table') - const { container } = render( - - - - Test - - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() - expect(container.firstChild?.firstChild?.firstChild).toHaveClass('table-info') - expect(container.firstChild?.firstChild?.firstChild).toHaveClass('bazinga') - expect(container.firstChild?.firstChild?.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/CTableRow.spec.tsx b/packages/coreui-react/src/components/table/__tests__/CTableRow.spec.tsx deleted file mode 100644 index 5f462d12..00000000 --- a/packages/coreui-react/src/components/table/__tests__/CTableRow.spec.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CTableBody, CTableHeaderCell, CTableRow } from '../index' - -test('loads and displays CTableRow component', async () => { - const table = document.createElement('table') - const { container } = render( - - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() -}) - -test('CTableRow customize', async () => { - const table = document.createElement('table') - const { container } = render( - - - Test - - , - { - container: document.body.appendChild(table), - }, - ) - expect(container).toMatchSnapshot() - expect(container.firstChild?.firstChild).toHaveClass('align-middle') - expect(container.firstChild?.firstChild).toHaveClass('table-active') - expect(container.firstChild?.firstChild).toHaveClass('table-info') - expect(container.firstChild?.firstChild).toHaveClass('bazinga') - expect(container.firstChild?.firstChild?.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap deleted file mode 100644 index 7ca926fe..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTable.spec.tsx.snap +++ /dev/null @@ -1,197 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTable customize 1`] = ` -
    -
    - - - - - - -
    - Test -
    -
    -
    -`; - -exports[`CTable full example test 1`] = ` -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - List of users -
    - # - - Class - - Heading - - Heading -
    - 1 - - Mark - - Otto - - @mdo -
    - 2 - - Jacob - - Thornton - - @fat -
    - 3 - - Larry - - the Bird - - @twitter -
    - # - - Class - - Heading - - Heading -
    -
    -`; - -exports[`loads and displays CTable component - new way 1`] = ` -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - # - - Class - - Heading - - Heading -
    - 1 - - Mark - - Otto - - @mdo -
    - 2 - - Jacob - - Thornton - - @fat -
    - 3 - - Larry the Bird - - @twitter -
    -
    -`; - -exports[`loads and displays CTable component 1`] = ` -
    - - -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableBody.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableBody.spec.tsx.snap deleted file mode 100644 index 78a587ba..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableBody.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableBody customize 1`] = ` -
    - - - - - -
    - Test -
    -`; - -exports[`loads and displays CTableBody component 1`] = ` - - -
    -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableCaption.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableCaption.spec.tsx.snap deleted file mode 100644 index f18f9542..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableCaption.spec.tsx.snap +++ /dev/null @@ -1,15 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableCaption customize 1`] = ` - - -
    - Test -
    -`; - -exports[`loads and displays CTableCaption component 1`] = ` - -
    -
    -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableDataCell.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableDataCell.spec.tsx.snap deleted file mode 100644 index 980aef89..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableDataCell.spec.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableDataCell customize 1`] = ` - - - - - - -
    - Test -
    -`; - -exports[`loads and displays CTableDataCell component 1`] = ` - - - - - -
    -
    -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableFoot.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableFoot.spec.tsx.snap deleted file mode 100644 index 61e932a2..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableFoot.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableFoot customize 1`] = ` - - - - - - -
    - Test -
    -`; - -exports[`loads and displays CTableFoot component 1`] = ` - - -
    -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableHead.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableHead.spec.tsx.snap deleted file mode 100644 index 40222dad..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableHead.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableHead customize 1`] = ` - - - - - - -
    - Test -
    -`; - -exports[`loads and displays CTableHead component 1`] = ` - - -
    -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableHeaderCell.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableHeaderCell.spec.tsx.snap deleted file mode 100644 index 8db8ce9b..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableHeaderCell.spec.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableHeaderCell customize 1`] = ` - - - - - - -
    - Test -
    -`; - -exports[`loads and displays CTableHeaderCell component 1`] = ` - - - - - -
    -
    -`; diff --git a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableRow.spec.tsx.snap b/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableRow.spec.tsx.snap deleted file mode 100644 index b787bec4..00000000 --- a/packages/coreui-react/src/components/table/__tests__/__snapshots__/CTableRow.spec.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTableRow customize 1`] = ` - - - - - - -
    - Test -
    -`; - -exports[`loads and displays CTableRow component 1`] = ` - - - - -
    -`; diff --git a/packages/coreui-react/src/components/table/index.ts b/packages/coreui-react/src/components/table/index.ts deleted file mode 100644 index 8263b6b5..00000000 --- a/packages/coreui-react/src/components/table/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CTable } from './CTable' -import { CTableBody } from './CTableBody' -import { CTableCaption } from './CTableCaption' -import { CTableDataCell } from './CTableDataCell' -import { CTableFoot } from './CTableFoot' -import { CTableHead } from './CTableHead' -import { CTableHeaderCell } from './CTableHeaderCell' -import { CTableRow } from './CTableRow' - -export { - CTable, - CTableBody, - CTableCaption, - CTableDataCell, - CTableFoot, - CTableHead, - CTableHeaderCell, - CTableRow, -} diff --git a/packages/coreui-react/src/components/table/types.ts b/packages/coreui-react/src/components/table/types.ts deleted file mode 100644 index c8262797..00000000 --- a/packages/coreui-react/src/components/table/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { CTableDataCellProps } from '../table/CTableDataCell' -import { CTableHeaderCellProps } from '../table/CTableHeaderCell' -import { CTableRowProps } from '../table/CTableRow' - -export type Column = { - label?: string - key: string - _style?: any - _props?: CTableHeaderCellProps -} - -export type FooterItem = { - label?: string - _props?: CTableDataCellProps -} - -export type Item = { - [key: string]: number | string | any - _props?: CTableRowProps -} diff --git a/packages/coreui-react/src/components/table/utils.ts b/packages/coreui-react/src/components/table/utils.ts deleted file mode 100644 index 9c55ade1..00000000 --- a/packages/coreui-react/src/components/table/utils.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Column, Item } from './types' - -export const pretifyName = (name: string) => { - return name - .replace(/[-_.]/g, ' ') - .replace(/ +/g, ' ') - .replace(/([a-z0-9])([A-Z])/g, '$1 $2') - .split(' ') - .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(' ') -} - -export const getColumnLabel = (column: Column | string) => - typeof column === 'object' ? column.label ?? pretifyName(column.key) : pretifyName(column) - -export const getColumnNames = (columns: (string | Column)[] | undefined, items?: Item[]) => - columns - ? columns.map((column: Column | string) => { - return typeof column === 'object' ? column.key : column - }) - : items && getColumnNamesFromItems(items) - -export const getColumnNamesFromItems = (items: Item[]) => - Object.keys(items[0] || {}).filter((el) => el.charAt(0) !== '_') diff --git a/packages/coreui-react/src/components/tabs/CTab.tsx b/packages/coreui-react/src/components/tabs/CTab.tsx deleted file mode 100644 index a84e2cc8..00000000 --- a/packages/coreui-react/src/components/tabs/CTab.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useContext } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CTabsContext } from './CTabsContext' - -export interface CTabProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Toggle the disabled state for the component. - */ - disabled?: boolean - /** - * Item key. - */ - itemKey: number | string -} - -export const CTab = forwardRef( - ({ children, className, itemKey, ...rest }, ref) => { - const { _activeItemKey, setActiveItemKey, id } = useContext(CTabsContext) - - const isActive = () => itemKey === _activeItemKey - - return ( - - ) - }, -) - -CTab.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - disabled: PropTypes.bool, - itemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, -} - -CTab.displayName = 'CTab' diff --git a/packages/coreui-react/src/components/tabs/CTabContent.tsx b/packages/coreui-react/src/components/tabs/CTabContent.tsx deleted file mode 100644 index 860ad22c..00000000 --- a/packages/coreui-react/src/components/tabs/CTabContent.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { HTMLAttributes, forwardRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CTabContentProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CTabContent = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CTabContent.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CTabContent.displayName = 'CTabContent' diff --git a/packages/coreui-react/src/components/tabs/CTabList.tsx b/packages/coreui-react/src/components/tabs/CTabList.tsx deleted file mode 100644 index ee7b9fe5..00000000 --- a/packages/coreui-react/src/components/tabs/CTabList.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import React, { forwardRef, HTMLAttributes, KeyboardEvent, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { useForkedRef } from '../../hooks' -import { getNextActiveElement } from '../../utils' - -export interface CTabListProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Specify a layout type for component. - */ - layout?: 'fill' | 'justified' - /** - * Set the nav variant to tabs or pills. - */ - variant?: 'enclosed' | 'enclosed-pills' | 'pills' | 'tabs' | 'underline' | 'underline-border' -} - -export const CTabList = forwardRef( - ({ children, className, layout, variant, ...rest }, ref) => { - const tabListRef = useRef(null) - const forkedRef = useForkedRef(ref, tabListRef) - - const handleKeydown = (event: KeyboardEvent) => { - if ( - tabListRef.current !== null && - (event.key === 'ArrowDown' || - event.key === 'ArrowUp' || - event.key === 'ArrowLeft' || - event.key === 'ArrowRight' || - event.key === 'Home' || - event.key === 'End') - ) { - event.preventDefault() - const target = event.target as HTMLElement - // eslint-disable-next-line unicorn/prefer-spread - const items: HTMLElement[] = Array.from( - tabListRef.current.querySelectorAll('.nav-link:not(.disabled):not(:disabled)') - ) - - let nextActiveElement - - if (event.key === 'Home' || event.key === 'End') { - nextActiveElement = event.key === 'End' ? items.at(-1) : items[0] - } else { - nextActiveElement = getNextActiveElement( - items, - target, - event.key === 'ArrowDown' || event.key === 'ArrowRight', - true - ) - } - - if (nextActiveElement) { - nextActiveElement.focus({ preventScroll: true }) - } - } - } - - return ( -
    - {children} -
    - ) - } -) - -CTabList.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - layout: PropTypes.oneOf(['fill', 'justified']), - variant: PropTypes.oneOf([ - 'enclosed', - 'enclosed-pills', - 'pills', - 'tabs', - 'underline', - 'underline-border', - ]), -} - -CTabList.displayName = 'CTabList' diff --git a/packages/coreui-react/src/components/tabs/CTabPane.tsx b/packages/coreui-react/src/components/tabs/CTabPane.tsx deleted file mode 100644 index 07e9ab42..00000000 --- a/packages/coreui-react/src/components/tabs/CTabPane.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import React, { HTMLAttributes, forwardRef, useRef } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { useForkedRef } from '../../hooks' - -export interface CTabPaneProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Enable fade in and fade out transition. - * - * @since 5.1.0 - */ - transition?: boolean - /** - * Toggle the visibility of component. - */ - visible?: boolean -} - -export const CTabPane = forwardRef( - ({ children, className, onHide, onShow, transition = true, visible, ...rest }, ref) => { - const tabPaneRef = useRef(null) - const forkedRef = useForkedRef(ref, tabPaneRef) - - return ( - - {(state) => ( -
    - {children} -
    - )} -
    - ) - }, -) - -CTabPane.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - onHide: PropTypes.func, - onShow: PropTypes.func, - transition: PropTypes.bool, - visible: PropTypes.bool, -} - -CTabPane.displayName = 'CTabPane' diff --git a/packages/coreui-react/src/components/tabs/CTabPanel.tsx b/packages/coreui-react/src/components/tabs/CTabPanel.tsx deleted file mode 100644 index fe770d6e..00000000 --- a/packages/coreui-react/src/components/tabs/CTabPanel.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import React, { HTMLAttributes, forwardRef, useContext, useEffect, useRef, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { CTabsContext } from './CTabsContext' -import { useForkedRef } from '../../hooks' -import { getTransitionDurationFromElement } from '../../utils' - -export interface CTabPanelProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Item key. - */ - itemKey: number | string - /** - * Callback fired when the component requests to be hidden. - */ - onHide?: () => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: () => void - /** - * Enable fade in and fade out transition. - */ - transition?: boolean - /** - * Toggle the visibility of component. - */ - visible?: boolean -} - -export const CTabPanel = forwardRef( - ({ children, className, itemKey, onHide, onShow, transition = true, visible, ...rest }, ref) => { - const { _activeItemKey, id } = useContext(CTabsContext) - - const tabPaneRef = useRef(null) - const forkedRef = useForkedRef(ref, tabPaneRef) - - const [_visible, setVisible] = useState(visible || _activeItemKey === itemKey) - - useEffect(() => { - visible !== undefined && setVisible(visible) - }, [visible]) - - useEffect(() => { - setVisible(_activeItemKey === itemKey) - }, [_activeItemKey]) - - return ( - - {(state) => ( -
    - {children} -
    - )} -
    - ) - }, -) - -CTabPanel.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - itemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, - onHide: PropTypes.func, - onShow: PropTypes.func, - transition: PropTypes.bool, - visible: PropTypes.bool, -} - -CTabPanel.displayName = 'CTabPanel' diff --git a/packages/coreui-react/src/components/tabs/CTabs.tsx b/packages/coreui-react/src/components/tabs/CTabs.tsx deleted file mode 100644 index bcfcb17e..00000000 --- a/packages/coreui-react/src/components/tabs/CTabs.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useId, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CTabsContext } from './CTabsContext' - -export interface CTabsProps extends Omit, 'onChange'> { - /** - * Controls the currently active tab. - * - * When provided, the component operates in a controlled mode. - * You must handle tab switching manually by updating this prop. - * - * @example - * const [activeTab, setActiveTab] = useState(0); - * - */ - activeItemKey?: number | string - - /** - * A string of all className you want applied to the base component. - */ - className?: string - - /** - * Sets the initially active tab when the component mounts. - * - * After initialization, the component manages active tab changes internally. - * - * Use `defaultActiveItemKey` for uncontrolled usage. - * - * @example - * - */ - defaultActiveItemKey?: number | string - - /** - * Callback fired when the active tab changes. - * - * - In controlled mode (`activeItemKey` provided), you must update `activeItemKey` yourself based on the value received. - * - In uncontrolled mode, this callback is called after internal state updates. - * - * @param value - The newly selected tab key. - * - * @example - * console.log('Tab changed to', key)} /> - */ - onChange?: (value: number | string) => void -} - -export const CTabs = forwardRef( - ({ children, activeItemKey, className, defaultActiveItemKey, onChange }, ref) => { - const id = useId() - const isControlled = activeItemKey !== undefined - const [internalActiveItemKey, setInternalActiveItemKey] = useState( - () => (isControlled ? undefined : defaultActiveItemKey) - ) - - const currentActiveItemKey = isControlled ? activeItemKey : internalActiveItemKey - - const setActiveItemKey = (value: number | string) => { - if (!isControlled) { - setInternalActiveItemKey(value) - } - - onChange?.(value) - } - - return ( - -
    - {children} -
    -
    - ) - } -) - -CTabs.propTypes = { - activeItemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - children: PropTypes.node, - className: PropTypes.string, - defaultActiveItemKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - onChange: PropTypes.func, -} - -CTabs.displayName = 'CTabs' diff --git a/packages/coreui-react/src/components/tabs/CTabsContext.ts b/packages/coreui-react/src/components/tabs/CTabsContext.ts deleted file mode 100644 index 87f0c215..00000000 --- a/packages/coreui-react/src/components/tabs/CTabsContext.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createContext } from 'react' - -export interface CTabsContextProps { - _activeItemKey?: number | string - setActiveItemKey: React.Dispatch> - id?: string -} - -export const CTabsContext = createContext({} as CTabsContextProps) \ No newline at end of file diff --git a/packages/coreui-react/src/components/tabs/__tests__/CTabContent.spec.tsx b/packages/coreui-react/src/components/tabs/__tests__/CTabContent.spec.tsx deleted file mode 100644 index ea0ffcd1..00000000 --- a/packages/coreui-react/src/components/tabs/__tests__/CTabContent.spec.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react' -import { act, render } from '@testing-library/react' -import '@testing-library/jest-dom' - -import { CTabContent } from '../index' - -test('loads and displays CTabContent component', async () => { - let container: HTMLElement - await act(async () => { - const renderResult = render(Test) - container = renderResult.container - }) - expect(container!).toMatchSnapshot() -}) - -test('CTabContent customize', async () => { - let container: HTMLElement - await act(async () => { - const renderResult = render(Test) - container = renderResult.container - }) - expect(container!).toMatchSnapshot() - expect(container!.firstChild).toHaveClass('bazinga') - expect(container!.firstChild).toHaveClass('tab-content') -}) diff --git a/packages/coreui-react/src/components/tabs/__tests__/CTabPane.spec.tsx b/packages/coreui-react/src/components/tabs/__tests__/CTabPane.spec.tsx deleted file mode 100644 index 4d602623..00000000 --- a/packages/coreui-react/src/components/tabs/__tests__/CTabPane.spec.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import * as React from 'react' -import { act, render, screen, waitFor } from '@testing-library/react' -import '@testing-library/jest-dom' - -import { CTabPane, CTabContent } from '../index' - -test('loads and displays CTabPane component', async () => { - let container: HTMLElement - await act(async () => { - const renderResult = render(Test) - container = renderResult.container - }) - expect(container!).toMatchSnapshot() -}) - -test('CTabPane customize', async () => { - let container: HTMLElement - await act(async () => { - const renderResult = render( - - Test - - ) - container = renderResult.container - }) - expect(container!).toMatchSnapshot() -}) - -test('CTabContent use case test', async () => { - jest.useFakeTimers() - - const { rerender } = render( - - Test - - ) - - expect(screen.getByText('Test')).not.toHaveClass('show') - expect(screen.getByText('Test')).not.toHaveClass('active') - - act(() => { - rerender( - - Test - - ) - jest.runAllTimers() - }) - - await waitFor(() => { - expect(screen.getByText('Test')).toHaveClass('active') - expect(screen.getByText('Test')).toHaveClass('show') - }) - - act(() => { - rerender( - - Test - - ) - jest.runAllTimers() - }) - - expect(screen.getByText('Test')).not.toHaveClass('show') - expect(screen.getByText('Test')).not.toHaveClass('active') - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/tabs/__tests__/__snapshots__/CTabContent.spec.tsx.snap b/packages/coreui-react/src/components/tabs/__tests__/__snapshots__/CTabContent.spec.tsx.snap deleted file mode 100644 index b756cf73..00000000 --- a/packages/coreui-react/src/components/tabs/__tests__/__snapshots__/CTabContent.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTabContent customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CTabContent component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/tabs/__tests__/__snapshots__/CTabPane.spec.tsx.snap b/packages/coreui-react/src/components/tabs/__tests__/__snapshots__/CTabPane.spec.tsx.snap deleted file mode 100644 index 7f453cdb..00000000 --- a/packages/coreui-react/src/components/tabs/__tests__/__snapshots__/CTabPane.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CTabPane customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CTabPane component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/tabs/index.ts b/packages/coreui-react/src/components/tabs/index.ts deleted file mode 100644 index 0d2c6e06..00000000 --- a/packages/coreui-react/src/components/tabs/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CTab } from './CTab' -import { CTabContent } from './CTabContent' -import { CTabPane } from './CTabPane' -import { CTabPanel } from './CTabPanel' -import { CTabList } from './CTabList' -import { CTabs } from './CTabs' - -export { CTab, CTabContent, CTabList, CTabPane, CTabPanel, CTabs } diff --git a/packages/coreui-react/src/components/toast/CToast.tsx b/packages/coreui-react/src/components/toast/CToast.tsx deleted file mode 100644 index 0b7fa28a..00000000 --- a/packages/coreui-react/src/components/toast/CToast.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useEffect, useRef, useState } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { Transition } from 'react-transition-group' - -import { CToastContext } from './CToastContext' - -import { useForkedRef } from '../../hooks' -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CToastProps extends Omit, 'title'> { - /** - * Apply a CSS fade transition to the toast. - */ - animation?: boolean - /** - * Auto hide the toast. - */ - autohide?: boolean - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Delay hiding the toast (ms). - */ - delay?: number - /** - * @ignore - */ - index?: number - /** - * @ignore - */ - innerKey?: number | string - /** - * Callback fired when the component requests to be closed. - */ - onClose?: (index: number | null) => void - /** - * Callback fired when the component requests to be shown. - */ - onShow?: (index: number | null) => void - /** - * Toggle the visibility of component. - */ - visible?: boolean -} - -export const CToast = forwardRef( - ( - { - children, - animation = true, - autohide = true, - className, - color, - delay = 5000, - index, - innerKey, - visible = false, - onClose, - onShow, - ...rest - }, - ref - ) => { - const toastRef = useRef(null) - const forkedRef = useForkedRef(ref, toastRef) - const [_visible, setVisible] = useState(false) - const timeout = useRef(undefined) - - useEffect(() => { - setVisible(visible) - }, [visible]) - - const contextValues = { - visible: _visible, - setVisible, - } - - // triggered on mount and destroy - useEffect(() => () => clearTimeout(timeout.current), []) - - useEffect(() => { - _autohide() - }, [_visible]) - - const _autohide = () => { - if (autohide) { - clearTimeout(timeout.current) - timeout.current = window.setTimeout(() => { - setVisible(false) - }, delay) - } - } - - return ( - onShow && onShow(index ?? null)} - onExited={() => onClose && onClose(index ?? null)} - timeout={250} - unmountOnExit - > - {(state) => ( - -
    clearTimeout(timeout.current)} - onMouseLeave={() => _autohide()} - {...rest} - key={innerKey} - ref={forkedRef} - > - {children} -
    -
    - )} -
    - ) - } -) - -CToast.propTypes = { - animation: PropTypes.bool, - autohide: PropTypes.bool, - children: PropTypes.node, - className: PropTypes.string, - color: colorPropType, - delay: PropTypes.number, - index: PropTypes.number, - innerKey: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), - onClose: PropTypes.func, - onShow: PropTypes.func, - visible: PropTypes.bool, -} - -CToast.displayName = 'CToast' diff --git a/packages/coreui-react/src/components/toast/CToastBody.tsx b/packages/coreui-react/src/components/toast/CToastBody.tsx deleted file mode 100644 index 7bd332e7..00000000 --- a/packages/coreui-react/src/components/toast/CToastBody.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -export interface CToastBodyProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string -} - -export const CToastBody = forwardRef( - ({ children, className, ...rest }, ref) => { - return ( -
    - {children} -
    - ) - }, -) - -CToastBody.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -} - -CToastBody.displayName = 'CToastBody' diff --git a/packages/coreui-react/src/components/toast/CToastClose.tsx b/packages/coreui-react/src/components/toast/CToastClose.tsx deleted file mode 100644 index a7f421ee..00000000 --- a/packages/coreui-react/src/components/toast/CToastClose.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { ElementType, forwardRef, useContext } from 'react' -import PropTypes from 'prop-types' - -import { CButtonProps } from '../button/CButton' -import { CCloseButton, CCloseButtonProps } from '../close-button/CCloseButton' -import { CToastContext } from './CToastContext' - -import { PolymorphicRefForwardingComponent } from '../../helpers' - -type CombineButtonProps = CCloseButtonProps & CButtonProps - -export interface CToastCloseProps extends Omit { - /** - * Component used for the root node. Either a string to use a HTML element or a component. - */ - as?: string | ElementType -} - -export const CToastClose: PolymorphicRefForwardingComponent<'button', CToastCloseProps> = - forwardRef(({ children, as: Component, ...rest }, ref) => { - const { setVisible } = useContext(CToastContext) - return Component ? ( - setVisible(false)} {...rest} ref={ref}> - {children} - - ) : ( - setVisible(false)} {...rest} ref={ref} /> - ) - }) - -CToastClose.propTypes = { - ...CCloseButton.propTypes, - as: PropTypes.elementType, -} - -CToastClose.displayName = 'CToastClose' diff --git a/packages/coreui-react/src/components/toast/CToastContext.ts b/packages/coreui-react/src/components/toast/CToastContext.ts deleted file mode 100644 index 3c0144dd..00000000 --- a/packages/coreui-react/src/components/toast/CToastContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createContext } from 'react' - -export interface CToastContextProps { - visible?: boolean - setVisible: React.Dispatch> -} - -export const CToastContext = createContext({} as CToastContextProps) diff --git a/packages/coreui-react/src/components/toast/CToastHeader.tsx b/packages/coreui-react/src/components/toast/CToastHeader.tsx deleted file mode 100644 index 01cb8e84..00000000 --- a/packages/coreui-react/src/components/toast/CToastHeader.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React, { forwardRef, HTMLAttributes } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CToastClose } from './CToastClose' - -export interface CToastHeaderProps extends Omit, 'title'> { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Automatically add a close button to the header. - */ - closeButton?: boolean -} - -export const CToastHeader = forwardRef( - ({ children, className, closeButton, ...rest }, ref) => { - return ( -
    - {children} - {closeButton && } -
    - ) - }, -) - -CToastHeader.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - closeButton: PropTypes.bool, -} - -CToastHeader.displayName = 'CToastHeader' diff --git a/packages/coreui-react/src/components/toast/CToaster.tsx b/packages/coreui-react/src/components/toast/CToaster.tsx deleted file mode 100644 index c10d93c1..00000000 --- a/packages/coreui-react/src/components/toast/CToaster.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import React, { forwardRef, HTMLAttributes, useEffect, useState, useRef, ReactElement } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' -import { CConditionalPortal } from '../conditional-portal' - -import type { CToastProps } from './CToast' - -export interface CToasterProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Describes the placement of your component. - * - * @type 'top-start' | 'top' | 'top-end' | 'middle-start' | 'middle' | 'middle-end' | 'bottom-start' | 'bottom' | 'bottom-end' | string - */ - placement?: - | 'top-start' - | 'top-center' - | 'top-end' - | 'middle-start' - | 'middle-center' - | 'middle-end' - | 'bottom-start' - | 'bottom-center' - | 'bottom-end' - | string - /** - * Adds new `CToast` to `CToaster`. - */ - push?: ReactElement -} - -export const CToaster = forwardRef( - ({ children, className, placement, push, ...rest }, ref) => { - const [toasts, setToasts] = useState[]>([]) - const index = useRef(0) - - useEffect(() => { - index.current++ - if (push) { - addToast(push) - } - }, [push]) - - const addToast = (push: ReactElement) => { - setToasts((state) => [ - ...state, - React.cloneElement(push, { - index: index.current, - innerKey: index.current, - onClose: (index: number) => - setToasts((state) => state.filter((i) => i.props.index !== index)), - }), - ]) - } - - return ( - - {toasts.length > 0 || children ? ( -
    - {children} - {toasts.map((toast, index) => React.cloneElement(toast, { visible: true, key: index }))} -
    - ) : null} -
    - ) - } -) - -CToaster.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - placement: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.oneOf([ - 'top-start', - 'top-center', - 'top-end', - 'middle-start', - 'middle-center', - 'middle-end', - 'bottom-start', - 'bottom-center', - 'bottom-end', - ]), - ]), - push: PropTypes.any, -} - -CToaster.displayName = 'CToaster' diff --git a/packages/coreui-react/src/components/toast/__tests__/CToast.spec.tsx b/packages/coreui-react/src/components/toast/__tests__/CToast.spec.tsx deleted file mode 100644 index 97b3ebfb..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/CToast.spec.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import * as React from 'react' -import { render, fireEvent, waitFor, act } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CToast, CToastBody, CToastHeader } from '../index' - -test('loads and displays CToast component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CToast customize', async () => { - const { container } = render( - - Test - - ) - await waitFor(() => { - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('toast') - expect(container.firstChild).toHaveClass('fade') - expect(container.firstChild).toHaveClass('bg-warning') - expect(container.firstChild).toHaveClass('show') - }) -}) - -test('CToast click on dismiss button', async () => { - jest.useFakeTimers() - - const onClose = jest.fn() - const { container } = render( - - - - - - CoreUI for React.js - 7 min ago - - Hello, world! This is a toast message. - - ) - - await waitFor(() => { - expect(container.firstChild).toHaveClass('show') - }) - - expect(onClose).toHaveBeenCalledTimes(0) - - const btn = document.querySelector('.btn-close') - - if (btn !== null) { - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - } - - await waitFor(() => { - expect(onClose).toHaveBeenCalledTimes(1) - expect(container.firstChild).toBeNull() - }) - - jest.useRealTimers() -}) - -test('CToast test autohide', async () => { - jest.useFakeTimers() - - const { container } = render( - - Test - - ) - - await waitFor(() => { - expect(container.firstChild).toHaveClass('show') - }) - - act(() => { - jest.advanceTimersByTime(1000) - }) - - await waitFor(() => { - expect(container.firstChild).toBeNull() - }) - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/toast/__tests__/CToastBody.spec.tsx b/packages/coreui-react/src/components/toast/__tests__/CToastBody.spec.tsx deleted file mode 100644 index 3b0db757..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/CToastBody.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CToastBody } from '../index' - -test('loads and displays CToastBody component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CToastBody customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('toast-body') -}) diff --git a/packages/coreui-react/src/components/toast/__tests__/CToastHeader.spec.tsx b/packages/coreui-react/src/components/toast/__tests__/CToastHeader.spec.tsx deleted file mode 100644 index 4ba19ff9..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/CToastHeader.spec.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CToastHeader } from '../index' - -test('loads and displays CToastHeader component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CToastHeader customize', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('toast-header') -}) diff --git a/packages/coreui-react/src/components/toast/__tests__/CToaster.spec.tsx b/packages/coreui-react/src/components/toast/__tests__/CToaster.spec.tsx deleted file mode 100644 index fb18c583..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/CToaster.spec.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react' // useState, -import { render, fireEvent } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CButton } from '../../button' -import { CToast, CToaster, CToastBody, CToastHeader } from '../index' - -test('loads and displays CToaster component', async () => { - const { container } = render(Test) - expect(container).toMatchSnapshot() -}) - -test('CToaster customize', async () => { - jest.useFakeTimers() - let toast = <> - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const addToast = function (t: any) { - toast = t - } - const { container } = render( - <> - - - addToast( - <> - - Lorem ipsum - Hello, world! This is a toast message. - - , - ) - } - > - Send a toast - - , - ) - expect(container).toMatchSnapshot() - const btn = document.querySelector('.btn') - if (btn !== null) { - fireEvent.click(btn) - } - jest.runAllTimers() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('toaster') - expect(container.firstChild).toHaveClass('toast-container') - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap b/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap deleted file mode 100644 index 77934504..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToast.spec.tsx.snap +++ /dev/null @@ -1,16 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CToast customize 1`] = ` -
    - -
    -`; - -exports[`loads and displays CToast component 1`] = `
    `; diff --git a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToastBody.spec.tsx.snap b/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToastBody.spec.tsx.snap deleted file mode 100644 index 17be4222..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToastBody.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CToastBody customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CToastBody component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToastHeader.spec.tsx.snap b/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToastHeader.spec.tsx.snap deleted file mode 100644 index d6346d24..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToastHeader.spec.tsx.snap +++ /dev/null @@ -1,21 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CToastHeader customize 1`] = ` -
    -
    - Test -
    -
    -`; - -exports[`loads and displays CToastHeader component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToaster.spec.tsx.snap b/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToaster.spec.tsx.snap deleted file mode 100644 index 2a2f88f5..00000000 --- a/packages/coreui-react/src/components/toast/__tests__/__snapshots__/CToaster.spec.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CToaster customize 1`] = ` -
    -
    - -
    -`; - -exports[`loads and displays CToaster component 1`] = ` -
    -
    - Test -
    -
    -`; diff --git a/packages/coreui-react/src/components/toast/index.ts b/packages/coreui-react/src/components/toast/index.ts deleted file mode 100644 index 8a28699a..00000000 --- a/packages/coreui-react/src/components/toast/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CToast } from './CToast' -import { CToastBody } from './CToastBody' -import { CToastClose } from './CToastClose' -import { CToastHeader } from './CToastHeader' -import { CToaster } from './CToaster' - -export { CToast, CToastBody, CToastClose, CToastHeader, CToaster } diff --git a/packages/coreui-react/src/components/tooltip/CTooltip.tsx b/packages/coreui-react/src/components/tooltip/CTooltip.tsx deleted file mode 100644 index 4e2aad16..00000000 --- a/packages/coreui-react/src/components/tooltip/CTooltip.tsx +++ /dev/null @@ -1,311 +0,0 @@ -import React, { - forwardRef, - HTMLAttributes, - ReactNode, - useEffect, - useId, - useRef, - useState, -} from 'react' -import classNames from 'classnames' -import PropTypes from 'prop-types' -import type { Options } from '@popperjs/core' - -import { CConditionalPortal } from '../conditional-portal' -import { useForkedRef, usePopper } from '../../hooks' -import { fallbackPlacementsPropType, triggerPropType } from '../../props' -import type { Placements, Triggers } from '../../types' -import { executeAfterTransition, getRTLPlacement } from '../../utils' - -export interface CTooltipProps extends Omit, 'content'> { - /** - * Enables or disables the CSS fade transition for the React Tooltip. - * - * @since 4.9.0 - */ - animation?: boolean - - /** - * Adds a custom class name to the React Tooltip container. Useful for overriding default styles or applying additional design choices. - */ - className?: string - - /** - * Appends the React Tooltip to a specific element instead of the default `document.body`. You may pass: - * - A DOM element (`HTMLElement` or `DocumentFragment`) - * - A function that returns a single element - * - `null` - * - * @example - * ... - * - * @default document.body - * @since 4.11.0 - */ - container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null - - /** - * Content to be displayed within the React Tooltip. Can be a string or any valid React node. - */ - content: ReactNode | string - - /** - * The delay (in milliseconds) before showing or hiding the React Tooltip. - * - If provided as a number, the delay is applied to both "show" and "hide". - * - If provided as an object, it should have distinct "show" and "hide" values. - * - * @example - * // Delays 300ms on both show and hide - * ... - * - * // Delays 500ms on show and 100ms on hide - * ... - * - * @since 4.9.0 - */ - delay?: number | { show: number; hide: number } - - /** - * Array of fallback placements for the React Tooltip to use when the preferred placement cannot be achieved. These placements are tried in order. - * - * @type 'top', 'right', 'bottom', 'left' | ('top', 'right', 'bottom', 'left')[] - * @since 4.9.0 - */ - fallbackPlacements?: Placements | Placements[] - - /** - * Adjusts the offset of the React Tooltip relative to its target. Expects a tuple `[x-axis, y-axis]`. - * - * @example - * // Offset the menu 0px in X and 10px in Y direction - * ... - * - * // Offset the menu 5px in both X and Y direction - * ... - */ - offset?: [number, number] - - /** - * Callback fired immediately after the React Tooltip is hidden. - */ - onHide?: () => void - - /** - * Callback fired immediately after the React Tooltip is shown. - */ - onShow?: () => void - - /** - * Initial placement of the React Tooltip. Note that Popper.js modifiers may alter this placement automatically if there's insufficient space in the chosen position. - */ - placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left' - - /** - * Customize the Popper.js configuration used to position the React Tooltip. Pass either an object or a function returning a modified config. [Learn more](https://popper.js.org/docs/v2/constructors/#options) - * - * @example - * ({ - * ...defaultConfig, - * strategy: 'fixed', - * modifiers: [ - * ...defaultConfig.modifiers, - * { name: 'computeStyles', options: { adaptive: false } }, - * ], - * })} - * >... - * - * @since 5.5.0 - */ - popperConfig?: Partial | ((defaultPopperConfig: Partial) => Partial) - - /** - * Determines the events that toggle the visibility of the React Tooltip. Can be a single trigger or an array of triggers. - * - * @example - * // Hover-only tooltip - * ... - * - * // Hover + click combined - * ... - * - * @type 'hover' | 'focus' | 'click' | ('hover' | 'focus' | 'click')[] - */ - trigger?: Triggers | Triggers[] - - /** - * Controls the visibility of the React Tooltip. - * - `true` to show the tooltip. - * - `false` to hide the tooltip. - */ - visible?: boolean -} - -export const CTooltip = forwardRef( - ( - { - children, - animation = true, - className, - container, - content, - delay = 0, - fallbackPlacements = ['top', 'right', 'bottom', 'left'], - offset = [0, 6], - onHide, - onShow, - placement = 'top', - popperConfig, - trigger = ['hover', 'focus'], - visible, - ...rest - }, - ref - ) => { - const tooltipRef = useRef(null) - const togglerRef = useRef(null) - const forkedRef = useForkedRef(ref, tooltipRef) - - const id = `tooltip${useId()}` - const [mounted, setMounted] = useState(false) - const [_visible, setVisible] = useState(visible) - - const { initPopper, destroyPopper, updatePopper } = usePopper() - - const _delay = typeof delay === 'number' ? { show: delay, hide: delay } : delay - - const defaultPopperConfig: Partial = { - modifiers: [ - { name: 'arrow', options: { element: '.tooltip-arrow' } }, - { name: 'flip', options: { fallbackPlacements } }, - { name: 'offset', options: { offset } }, - ], - placement: getRTLPlacement(placement, togglerRef.current), - } - - const computedPopperConfig: Partial = { - ...defaultPopperConfig, - ...(typeof popperConfig === 'function' ? popperConfig(defaultPopperConfig) : popperConfig), - } - - useEffect(() => { - if (visible) { - handleShow() - return - } - - handleHide() - }, [visible]) - - useEffect(() => { - if (mounted && togglerRef.current && tooltipRef.current) { - initPopper(togglerRef.current, tooltipRef.current, computedPopperConfig) - setTimeout(() => { - setVisible(true) - }, _delay.show) - - return - } - - if (!mounted && togglerRef.current && tooltipRef.current) { - destroyPopper() - } - }, [mounted]) - - useEffect(() => { - if (!_visible && togglerRef.current && tooltipRef.current) { - executeAfterTransition(() => { - setMounted(false) - }, tooltipRef.current) - } - }, [_visible]) - - const handleShow = () => { - setMounted(true) - if (onShow) { - onShow() - } - } - - const handleHide = () => { - setTimeout(() => { - setVisible(false) - if (onHide) { - onHide() - } - }, _delay.hide) - } - - useEffect(() => { - updatePopper() - }, [content]) - - return ( - <> - {React.cloneElement(children as React.ReactElement, { - ...(_visible && { - 'aria-describedby': id, - }), - ref: togglerRef, - ...((trigger === 'click' || trigger.includes('click')) && { - onClick: () => (_visible ? handleHide() : handleShow()), - }), - ...((trigger === 'focus' || trigger.includes('focus')) && { - onFocus: () => handleShow(), - onBlur: () => handleHide(), - }), - ...((trigger === 'hover' || trigger.includes('hover')) && { - onMouseEnter: () => handleShow(), - onMouseLeave: () => handleHide(), - }), - })} - - {mounted && ( - - )} - - - ) - } -) - -CTooltip.propTypes = { - animation: PropTypes.bool, - children: PropTypes.node, - container: PropTypes.any, - content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - delay: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.shape({ - show: PropTypes.number.isRequired, - hide: PropTypes.number.isRequired, - }), - ]), - fallbackPlacements: fallbackPlacementsPropType, - offset: PropTypes.any, // TODO: find good proptype - onHide: PropTypes.func, - onShow: PropTypes.func, - placement: PropTypes.oneOf(['auto', 'top', 'right', 'bottom', 'left']), - popperConfig: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), - trigger: triggerPropType, - visible: PropTypes.bool, -} - -CTooltip.displayName = 'CTooltip' diff --git a/packages/coreui-react/src/components/tooltip/__tests__/CTooltip.spec.tsx b/packages/coreui-react/src/components/tooltip/__tests__/CTooltip.spec.tsx deleted file mode 100644 index 31a194b9..00000000 --- a/packages/coreui-react/src/components/tooltip/__tests__/CTooltip.spec.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import * as React from 'react' -import { act, fireEvent, render, screen } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CLink } from '../../link' -import { CTooltip } from '../index' -import { CButton } from '../../button' - -let container: HTMLDivElement | null - -beforeEach(() => { - container = document.createElement('div') - document.body.appendChild(container) -}) - -afterEach(() => { - container && container.remove() - container = null -}) - -test('loads and displays CTooltip component', async () => { - const { container } = render( - - Test - - ) - expect(container).toMatchSnapshot() -}) - -test('CTooltip customize', async () => { - jest.useFakeTimers() - - render( - - Test - - ) - - const link = screen.getByText('Test') - - act(() => { - fireEvent.mouseOver(link) - jest.runAllTimers() - }) - - expect(document.querySelector('.tooltip')).toBeInTheDocument() - - jest.useRealTimers() -}) - -test('CTooltip onShow and onHide', async () => { - jest.useFakeTimers() - - const onShow = jest.fn() - const onHide = jest.fn() - - render( - - Test - - ) - - const btn = screen.getByRole('button', { name: /test/i }) - - expect(onShow).toHaveBeenCalledTimes(0) - expect(onHide).toHaveBeenCalledTimes(0) - - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - - expect(onShow).toHaveBeenCalledTimes(1) - expect(onHide).toHaveBeenCalledTimes(0) - - act(() => { - fireEvent.click(btn) - jest.runAllTimers() - }) - - expect(onShow).toHaveBeenCalledTimes(1) - expect(onHide).toHaveBeenCalledTimes(1) - - jest.useRealTimers() -}) diff --git a/packages/coreui-react/src/components/tooltip/__tests__/__snapshots__/CTooltip.spec.tsx.snap b/packages/coreui-react/src/components/tooltip/__tests__/__snapshots__/CTooltip.spec.tsx.snap deleted file mode 100644 index ee2b49cb..00000000 --- a/packages/coreui-react/src/components/tooltip/__tests__/__snapshots__/CTooltip.spec.tsx.snap +++ /dev/null @@ -1,11 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`loads and displays CTooltip component 1`] = ` - -`; diff --git a/packages/coreui-react/src/components/tooltip/index.ts b/packages/coreui-react/src/components/tooltip/index.ts deleted file mode 100644 index b3af8166..00000000 --- a/packages/coreui-react/src/components/tooltip/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CTooltip } from './CTooltip' - -export { CTooltip } diff --git a/packages/coreui-react/src/components/widgets/CWidgetStatsA.tsx b/packages/coreui-react/src/components/widgets/CWidgetStatsA.tsx deleted file mode 100644 index c19a5023..00000000 --- a/packages/coreui-react/src/components/widgets/CWidgetStatsA.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React, { forwardRef, HTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CCard, CCardBody } from '../card' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CWidgetStatsAProps extends Omit, 'title'> { - /** - * Action node for your component. - */ - action?: ReactNode - /** - * Chart node for your component. - */ - chart?: string | ReactNode - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Title node for your component. - */ - title?: string | ReactNode - /** - * Value node for your component. - */ - value?: string | number | ReactNode -} - -export const CWidgetStatsA = forwardRef( - ({ action, chart, className, color, title, value, ...rest }, ref) => { - return ( - - -
    - {value &&
    {value}
    } - {title &&
    {title}
    } -
    - {action} -
    - {chart} -
    - ) - }, -) - -CWidgetStatsA.propTypes = { - action: PropTypes.node, - chart: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - className: PropTypes.string, - color: colorPropType, - title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - value: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.number]), -} - -CWidgetStatsA.displayName = 'CWidgetStatsA' diff --git a/packages/coreui-react/src/components/widgets/CWidgetStatsB.tsx b/packages/coreui-react/src/components/widgets/CWidgetStatsB.tsx deleted file mode 100644 index 0308c901..00000000 --- a/packages/coreui-react/src/components/widgets/CWidgetStatsB.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import React, { forwardRef, HTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' - -import { CCard, CCardBody } from '../card' -import { CProgress, CProgressProps } from '../progress/CProgress' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CWidgetStatsBProps extends Omit, 'title'> { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Colors have been inverted from their default dark shade. - */ - inverse?: boolean - /** - * Sets the color context of the progress bar to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - */ - progress?: CProgressProps - /** - * Title node for your component. - */ - title?: string | ReactNode - /** - * Helper text for your component. - */ - text?: string - /** - * Value node for your component. - */ - value?: string | number | ReactNode -} - -export const CWidgetStatsB = forwardRef( - ({ className, color, inverse, progress, text, title, value, ...rest }, ref) => { - return ( - - - {value &&
    {value}
    } - {title &&
    {title}
    } - - {text && ( - - {text} - - )} -
    -
    - ) - }, -) - -CWidgetStatsB.propTypes = { - className: PropTypes.string, - color: colorPropType, - inverse: PropTypes.bool, - progress: PropTypes.object, - text: PropTypes.string, - title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - value: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.number]), -} - -CWidgetStatsB.displayName = 'CWidgetCWidgetStatsB' diff --git a/packages/coreui-react/src/components/widgets/CWidgetStatsC.tsx b/packages/coreui-react/src/components/widgets/CWidgetStatsC.tsx deleted file mode 100644 index f8cca9a7..00000000 --- a/packages/coreui-react/src/components/widgets/CWidgetStatsC.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { forwardRef, HTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' - -import { CCard, CCardBody } from '../card' -import { CProgress, CProgressProps } from '../progress/CProgress' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' -import classNames from 'classnames' - -export interface CWidgetStatsCProps extends Omit, 'title'> { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Icon node for your component. - */ - icon?: string | ReactNode - /** - * Colors have been inverted from their default dark shade. - */ - inverse?: boolean - /** - * Sets the color context of the progress bar to one of CoreUI’s themed colors. - * - * @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string - */ - progress?: CProgressProps - /** - * Title node for your component. - */ - title?: string | ReactNode - /** - * Value node for your component. - */ - value?: string | number | ReactNode -} - -export const CWidgetStatsC = forwardRef( - ({ className, color, icon, inverse, progress, title, value, ...rest }, ref) => { - return ( - - - {icon && ( -
    - {icon} -
    - )} - {value &&
    {value}
    } - {title && ( -
    - {title} -
    - )} - -
    -
    - ) - }, -) - -CWidgetStatsC.propTypes = { - className: PropTypes.string, - color: colorPropType, - icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - inverse: PropTypes.bool, - progress: PropTypes.object, - title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - value: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.number]), -} - -CWidgetStatsC.displayName = 'CWidgetStatsCWidgetStatsC' diff --git a/packages/coreui-react/src/components/widgets/CWidgetStatsD.tsx b/packages/coreui-react/src/components/widgets/CWidgetStatsD.tsx deleted file mode 100644 index 44e089a7..00000000 --- a/packages/coreui-react/src/components/widgets/CWidgetStatsD.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { forwardRef, HTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CCard, CCardBody, CCardHeader } from '../card' -import { CCol } from '../grid/CCol' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -type Value = { - title?: string | ReactNode - value?: number | string | ReactNode -} - -export interface CWidgetStatsDProps extends HTMLAttributes { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Chart node for your component. - */ - chart?: string | ReactNode - /** - * 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 - /** - * Icon node for your component. - */ - icon?: string | ReactNode - /** - * Values and titles for your component. - */ - values?: Value[] -} - -export const CWidgetStatsD = forwardRef( - ({ className, chart, color, icon, values, ...rest }, ref) => { - return ( - - - {icon} - {chart} - - - {values && - values.map((value: Value, index: number) => { - return ( - - {index % 2 !== 0 &&
    } - -
    {value.value}
    -
    {value.title}
    -
    -
    - ) - })} -
    -
    - ) - }, -) - -CWidgetStatsD.propTypes = { - chart: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - className: PropTypes.string, - color: colorPropType, - icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - values: PropTypes.arrayOf(PropTypes.any), -} - -CWidgetStatsD.displayName = 'CWidgetStatsD' diff --git a/packages/coreui-react/src/components/widgets/CWidgetStatsE.tsx b/packages/coreui-react/src/components/widgets/CWidgetStatsE.tsx deleted file mode 100644 index 7e04e0c3..00000000 --- a/packages/coreui-react/src/components/widgets/CWidgetStatsE.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import React, { forwardRef, HTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' -import classNames from 'classnames' - -import { CCard, CCardBody } from '../card' - -export interface CWidgetStatsEProps extends Omit, 'title'> { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * Chart node for your component. - */ - chart?: string | ReactNode - /** - * Title node for your component. - */ - title?: string | ReactNode - /** - * Value node for your component. - */ - value?: string | number | ReactNode -} - -export const CWidgetStatsE = forwardRef( - ({ chart, className, title, value, ...rest }, ref) => { - return ( - - - {title && ( -
    {title}
    - )} - {value &&
    {value}
    } - {chart} -
    -
    - ) - }, -) - -CWidgetStatsE.propTypes = { - children: PropTypes.node, - chart: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - className: PropTypes.string, - title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - value: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.number]), -} - -CWidgetStatsE.displayName = 'CWidgetStatsE' diff --git a/packages/coreui-react/src/components/widgets/CWidgetStatsF.tsx b/packages/coreui-react/src/components/widgets/CWidgetStatsF.tsx deleted file mode 100644 index 6684b286..00000000 --- a/packages/coreui-react/src/components/widgets/CWidgetStatsF.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React, { forwardRef, HTMLAttributes, ReactNode } from 'react' -import PropTypes from 'prop-types' - -import { CCard, CCardBody, CCardFooter } from '../card' - -import { colorPropType } from '../../props' -import type { Colors } from '../../types' - -export interface CWidgetStatsFProps extends Omit, 'title'> { - /** - * A string of all className you want applied to the base component. - */ - className?: string - /** - * 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 - /** - * Footer node for your component. - */ - footer?: string | ReactNode - /** - * Icon node for your component. - */ - icon?: string | ReactNode - /** - * Set padding of your component. - */ - padding?: boolean - /** - * Title node for your component. - */ - title?: string | ReactNode - /** - * Value node for your component. - */ - value?: string | number | ReactNode -} - -export const CWidgetStatsF = forwardRef( - ({ className, color, footer, icon, padding = true, title, value, ...rest }, ref) => { - return ( - - -
    {icon}
    -
    -
    {value}
    -
    {title}
    -
    -
    - {footer && {footer}} -
    - ) - }, -) - -CWidgetStatsF.propTypes = { - className: PropTypes.string, - color: colorPropType, - footer: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - padding: PropTypes.bool, - title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - value: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.number]), -} - -CWidgetStatsF.displayName = 'CWidgetStatsF' diff --git a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx b/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx deleted file mode 100644 index 22b080e8..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CWidgetStatsA } from '../index' - -test('loads and displays CWidgetStatsA component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CWidgetStatsA customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bg-info') - expect(container.firstChild).toHaveClass('text-white') - expect(container.firstChild).toHaveClass('bazinga') - if (container.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('pb-0') - expect(container.firstChild.firstChild).toHaveClass('d-flex') - expect(container.firstChild.firstChild).toHaveClass('justify-content-between') - expect(container.firstChild.firstChild).toHaveClass('align-items-start') - if ( - container.firstChild.firstChild === null || - container.firstChild.firstChild.firstChild === null - ) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild.firstChild.firstChild).toHaveClass('fs-4') - expect(container.firstChild.firstChild.firstChild.firstChild).toHaveClass('fw-semibold') - } - } - - //expect(container.firstChild).toHaveTextContent('Test') -}) diff --git a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx b/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx deleted file mode 100644 index fb87296d..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CWidgetStatsB } from '../index' - -test('loads and displays CWidgetStatsB component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CWidgetStatsB customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card') - if (container.firstChild === null || container.firstChild.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('card-body') - expect(container.firstChild.firstChild.firstChild).toHaveClass('fs-4') - expect(container.firstChild.firstChild.firstChild).toHaveClass('fw-semibold') - expect(container.firstChild.firstChild.firstChild).toHaveTextContent('value') - expect(container.firstChild.firstChild.lastChild).toHaveClass('text-white') - expect(container.firstChild.firstChild.lastChild).toHaveTextContent('text') - } -}) diff --git a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx b/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx deleted file mode 100644 index 390dae43..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CWidgetStatsC } from '../index' - -test('loads and displays CWidgetStatsC component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CWidgetStatsC customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card') - expect(container.firstChild).toHaveClass('text-white') - if (container.firstChild === null || container.firstChild.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('card-body') - expect(container.firstChild.firstChild.firstChild).toHaveClass('text-end') - expect(container.firstChild.firstChild.firstChild).toHaveClass('mb-4') - expect(container.firstChild.firstChild.firstChild).toHaveTextContent('icon') - expect(container.firstChild.firstChild.lastChild).toHaveClass('mt-3') - expect(container.firstChild.firstChild.lastChild).toHaveClass('mb-0') - } -}) diff --git a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx b/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx deleted file mode 100644 index 1cbd6f95..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CWidgetStatsD } from '../index' - -test('loads and displays CWidgetStatsD component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CWidgetStatsD customize', async () => { - const { container } = render( - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - if (container.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('position-relative') - expect(container.firstChild.firstChild).toHaveClass('d-flex') - expect(container.firstChild.firstChild).toHaveClass('justify-content-center') - expect(container.firstChild.firstChild).toHaveClass('align-items-center') - expect(container.firstChild.firstChild).toHaveClass('bg-info') - expect(container.firstChild.lastChild).toHaveClass('row') - expect(container.firstChild.lastChild).toHaveClass('text-center') - if ( - container.firstChild.lastChild === null || - container.firstChild.lastChild.firstChild === null - ) { - expect(true).toBe(false) - } else { - expect(container.firstChild.lastChild.firstChild.firstChild).toHaveClass('fs-5') - expect(container.firstChild.lastChild.firstChild.firstChild).toHaveClass('fw-semibold') - expect(container.firstChild.lastChild.firstChild.firstChild).toHaveTextContent('89K') - expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('text-uppercase') - expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('text-body-secondary') - expect(container.firstChild.lastChild.firstChild.lastChild).toHaveClass('small') - expect(container.firstChild.lastChild.firstChild.lastChild).toHaveTextContent('friends') - } - } -}) diff --git a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx b/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx deleted file mode 100644 index f2a7a196..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CWidgetStatsE } from '../index' - -test('loads and displays CWidgetStatsE component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CWidgetStatsE customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card') - if (container.firstChild === null || container.firstChild.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('card-body') - expect(container.firstChild.firstChild.firstChild).toHaveClass('text-body-secondary') - expect(container.firstChild.firstChild.firstChild).toHaveClass('small') - expect(container.firstChild.firstChild.firstChild).toHaveClass('text-uppercase') - expect(container.firstChild.firstChild.firstChild).toHaveClass('fw-semibold') - expect(container.firstChild.firstChild.firstChild).toHaveTextContent('title') - } -}) diff --git a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx b/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx deleted file mode 100644 index d9a00098..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import * as React from 'react' -import { render } from '@testing-library/react' -import '@testing-library/jest-dom' -import { CWidgetStatsF } from '../index' - -test('loads and displays CWidgetStatsF component', async () => { - const { container } = render() - expect(container).toMatchSnapshot() -}) - -test('CWidgetStatsF customize', async () => { - const { container } = render( - - Test - , - ) - expect(container).toMatchSnapshot() - expect(container.firstChild).toHaveClass('bazinga') - expect(container.firstChild).toHaveClass('card') - if (container.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild).toHaveClass('card-body') - expect(container.firstChild.firstChild).toHaveClass('d-flex') - expect(container.firstChild.firstChild).toHaveClass('align-items-center') - if (container.firstChild.firstChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild.firstChild).toHaveClass('me-3') - expect(container.firstChild.firstChild.firstChild).toHaveClass('text-white') - expect(container.firstChild.firstChild.firstChild).toHaveClass('bg-info') - expect(container.firstChild.firstChild.firstChild).toHaveClass('p-3') - expect(container.firstChild.firstChild.firstChild).toHaveTextContent('icon') - if (container.firstChild.firstChild.lastChild === null) { - expect(true).toBe(false) - } else { - expect(container.firstChild.firstChild.lastChild.firstChild).toHaveClass('fs-6') - expect(container.firstChild.firstChild.lastChild.firstChild).toHaveClass('fw-semibold') - expect(container.firstChild.firstChild.lastChild.firstChild).toHaveClass('text-info') - expect(container.firstChild.firstChild.lastChild.firstChild).toHaveTextContent('value') - expect(container.firstChild.firstChild.lastChild.lastChild).toHaveClass( - 'text-body-secondary', - ) - expect(container.firstChild.firstChild.lastChild.lastChild).toHaveClass('text-uppercase') - expect(container.firstChild.firstChild.lastChild.lastChild).toHaveClass('fw-semibold ') - expect(container.firstChild.firstChild.lastChild.lastChild).toHaveClass('small') - expect(container.firstChild.firstChild.lastChild.lastChild).toHaveTextContent('title') - } - } - } -}) diff --git a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap b/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap deleted file mode 100644 index 3fab5bf1..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsA.spec.tsx.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CWidgetStatsA customize 1`] = ` -
    -
    -
    -
    -
    - value -
    -
    - title -
    -
    - action -
    - chart -
    -
    -`; - -exports[`loads and displays CWidgetStatsA component 1`] = ` -
    -
    -
    -
    -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap b/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap deleted file mode 100644 index 3caaf042..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsB.spec.tsx.snap +++ /dev/null @@ -1,62 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CWidgetStatsB customize 1`] = ` -
    -
    -
    -
    - value -
    -
    - title -
    -
    -
    -
    - - text - -
    -
    -
    -`; - -exports[`loads and displays CWidgetStatsB component 1`] = ` -
    -
    -
    -
    -
    -
    -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap b/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap deleted file mode 100644 index fb4f4455..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsC.spec.tsx.snap +++ /dev/null @@ -1,64 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CWidgetStatsC customize 1`] = ` -
    -
    -
    -
    - icon -
    -
    - value -
    -
    - title -
    -
    -
    -
    -
    -
    -
    -`; - -exports[`loads and displays CWidgetStatsC component 1`] = ` -
    -
    -
    -
    -
    -
    -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap b/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap deleted file mode 100644 index e0abfd9c..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsD.spec.tsx.snap +++ /dev/null @@ -1,63 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CWidgetStatsD customize 1`] = ` -
    -
    -
    -
    -
    -
    - 89K -
    -
    - friends -
    -
    -
    -
    -
    - 459 -
    -
    - feeds -
    -
    -
    -
    -
    -`; - -exports[`loads and displays CWidgetStatsD component 1`] = ` -
    -
    -
    -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap b/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap deleted file mode 100644 index 56ad3540..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsE.spec.tsx.snap +++ /dev/null @@ -1,36 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CWidgetStatsE customize 1`] = ` -
    -
    -
    -
    - title -
    -
    - value -
    -
    -
    -
    -`; - -exports[`loads and displays CWidgetStatsE component 1`] = ` -
    -
    -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap b/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap deleted file mode 100644 index 8dab9d52..00000000 --- a/packages/coreui-react/src/components/widgets/__tests__/__snapshots__/CWidgetStatsF.spec.tsx.snap +++ /dev/null @@ -1,60 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CWidgetStatsF customize 1`] = ` -
    -
    -
    -
    - icon -
    -
    -
    - value -
    -
    - title -
    -
    -
    - -
    -
    -`; - -exports[`loads and displays CWidgetStatsF component 1`] = ` -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -`; diff --git a/packages/coreui-react/src/components/widgets/index.ts b/packages/coreui-react/src/components/widgets/index.ts deleted file mode 100644 index 03c85346..00000000 --- a/packages/coreui-react/src/components/widgets/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CWidgetStatsA } from './CWidgetStatsA' -import { CWidgetStatsB } from './CWidgetStatsB' -import { CWidgetStatsC } from './CWidgetStatsC' -import { CWidgetStatsD } from './CWidgetStatsD' -import { CWidgetStatsE } from './CWidgetStatsE' -import { CWidgetStatsF } from './CWidgetStatsF' - -export { CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF } diff --git a/packages/coreui-react/src/helpers/index.ts b/packages/coreui-react/src/helpers/index.ts deleted file mode 100644 index 13ec6191..00000000 --- a/packages/coreui-react/src/helpers/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { PolymorphicRefForwardingComponent } from './polymorphicComponent' - -export { PolymorphicRefForwardingComponent } diff --git a/packages/coreui-react/src/helpers/polymorphicComponent.ts b/packages/coreui-react/src/helpers/polymorphicComponent.ts deleted file mode 100644 index ba82c64c..00000000 --- a/packages/coreui-react/src/helpers/polymorphicComponent.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ComponentPropsWithRef, ElementType, PropsWithChildren, ReactNode } from 'react' - -export type Omit = Pick> - -export type ReplaceProps = Omit, P> & P - -export interface AsProp { - as?: As -} - -export interface Props extends AsProp {} - -export interface PolymorphicRefForwardingComponent { - ( - props: PropsWithChildren & P>>, - context?: any, // eslint-disable-line @typescript-eslint/no-explicit-any - ): ReactNode | null - propTypes?: any // eslint-disable-line @typescript-eslint/no-explicit-any - defaultProps?: Partial

    - displayName?: string -} diff --git a/packages/coreui-react/src/hooks/index.ts b/packages/coreui-react/src/hooks/index.ts deleted file mode 100644 index 701225e6..00000000 --- a/packages/coreui-react/src/hooks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { useClipboard } from './useClipboard' -import { useColorModes } from './useColorModes' -import { useForkedRef } from './useForkedRef' -import { usePopper } from './usePopper' - -export { useClipboard, useColorModes, useForkedRef, usePopper } diff --git a/packages/coreui-react/src/hooks/useClipboard.ts b/packages/coreui-react/src/hooks/useClipboard.ts deleted file mode 100644 index 0b6ad7a2..00000000 --- a/packages/coreui-react/src/hooks/useClipboard.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { useState, useCallback } from 'react' - -/** - * useClipboard Hook - * - * Provides functionality to copy text to the clipboard and track the copy status. - * - * @returns An object containing the copy function, copy status, and any error encountered. - */ -export const useClipboard = () => { - const [isCopied, setIsCopied] = useState(false) - const [error, setError] = useState(null) - - /** - * Copies the provided text to the clipboard. - * - * @param text - The text to be copied to the clipboard. - */ - const copy = useCallback(async (text: string) => { - if (!navigator?.clipboard) { - setError(new Error('Clipboard API is not available')) - return - } - - try { - await navigator.clipboard.writeText(text) - setIsCopied(true) - setError(null) - // Reset the isCopied state after 2 seconds - setTimeout(() => setIsCopied(false), 2000) - } catch (_error) { - setError(_error as Error) - setIsCopied(false) - } - }, []) - - return { copy, isCopied, error } -} diff --git a/packages/coreui-react/src/hooks/useColorModes.ts b/packages/coreui-react/src/hooks/useColorModes.ts deleted file mode 100644 index b6c63a80..00000000 --- a/packages/coreui-react/src/hooks/useColorModes.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Dispatch, SetStateAction, useEffect, useState } from 'react' - -interface UseColorModesOutput { - colorMode: string | undefined - isColorModeSet: () => boolean - setColorMode: Dispatch> -} - -const getStoredTheme = (localStorageItemName: string) => - typeof window !== 'undefined' && localStorage.getItem(localStorageItemName) - -const setStoredTheme = (localStorageItemName: string, colorMode: string) => - localStorage.setItem(localStorageItemName, colorMode) - -const getPreferredColorScheme = (localStorageItemName: string) => { - if (typeof window === 'undefined') { - return 'light' - } - - const storedTheme = getStoredTheme(localStorageItemName) - - if (storedTheme) { - return storedTheme - } - - return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' -} - -const setTheme = (colorMode: string) => { - document.documentElement.dataset.coreuiTheme = - colorMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches - ? 'dark' - : colorMode - - const event = new Event('ColorSchemeChange') - document.documentElement.dispatchEvent(event) -} - -export const useColorModes = ( - localStorageItemName = 'coreui-react-color-scheme', -): UseColorModesOutput => { - const [colorMode, setColorMode] = useState( - getPreferredColorScheme(localStorageItemName), - ) - - useEffect(() => { - if (colorMode) { - setStoredTheme(localStorageItemName, colorMode) - setTheme(colorMode) - } - }, [colorMode]) - - useEffect(() => { - window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { - const storedTheme = getStoredTheme(localStorageItemName) - if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode) { - setTheme(colorMode) - } - }) - }) - - return { - colorMode, - isColorModeSet: () => Boolean(getStoredTheme(localStorageItemName)), - setColorMode, - } -} diff --git a/packages/coreui-react/src/hooks/useForkedRef.ts b/packages/coreui-react/src/hooks/useForkedRef.ts deleted file mode 100644 index 0eb7b77a..00000000 --- a/packages/coreui-react/src/hooks/useForkedRef.ts +++ /dev/null @@ -1,50 +0,0 @@ -// code borrowed from https://github.com/reach/reach-ui -// problem described https://github.com/facebook/react/issues/13029 - -import { useMemo } from 'react' - -export type AssignableRef = - | { - bivarianceHack(instance: ValueType | null): void - }['bivarianceHack'] - | React.MutableRefObject - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function useForkedRef( - ...refs: (AssignableRef | null | undefined)[] -) { - return useMemo(() => { - if (refs.every((ref) => ref == null)) { - return null - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return (node: any) => { - refs.forEach((ref) => { - assignRef(ref, node) - }) - } - }, refs) -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function assignRef( - ref: AssignableRef | null | undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value: any, -) { - if (ref == null) return - if (isFunction(ref)) { - ref(value) - } else { - try { - ref.current = value - } catch { - throw new Error(`Cannot assign value "${value}" to ref "${ref}"`) - } - } -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types -export function isFunction(value: any): value is Function { - return !!(value && {}.toString.call(value) == '[object Function]') -} diff --git a/packages/coreui-react/src/hooks/usePopper.ts b/packages/coreui-react/src/hooks/usePopper.ts deleted file mode 100644 index 69830552..00000000 --- a/packages/coreui-react/src/hooks/usePopper.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { useRef } from 'react' -import { createPopper } from '@popperjs/core' -import type { Instance, Options } from '@popperjs/core' - -interface UsePopperOutput { - popper: Instance | undefined - initPopper: (reference: HTMLElement, popper: HTMLElement, options: Partial) => void - destroyPopper: () => void - updatePopper: (options?: Partial) => void -} - -export const usePopper = (): UsePopperOutput => { - const _popper = useRef(undefined) - const el = useRef(null) - - const initPopper = (reference: HTMLElement, popper: HTMLElement, options: Partial) => { - _popper.current = createPopper(reference, popper, options) - el.current = popper - } - - const destroyPopper = () => { - const popperInstance = _popper.current - - if (popperInstance && el.current) { - popperInstance.destroy() - } - - _popper.current = undefined - } - - const updatePopper = (options?: Partial) => { - const popperInstance = _popper.current - - if (popperInstance && options) { - popperInstance.setOptions(options) - } - - if (popperInstance) { - popperInstance.update() - } - } - - return { - popper: _popper.current, - initPopper, - destroyPopper, - updatePopper, - } -} diff --git a/packages/coreui-react/src/index.ts b/packages/coreui-react/src/index.ts deleted file mode 100644 index 9c5450c8..00000000 --- a/packages/coreui-react/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './components/' -export * from './hooks/' diff --git a/packages/coreui-react/src/props.ts b/packages/coreui-react/src/props.ts deleted file mode 100644 index ccce445a..00000000 --- a/packages/coreui-react/src/props.ts +++ /dev/null @@ -1,68 +0,0 @@ -import PropTypes from 'prop-types' - -import type { Placements, Triggers } from './types' - -export const colorPropType = PropTypes.oneOfType([ - PropTypes.oneOf([ - 'primary', - 'secondary', - 'success', - 'danger', - 'warning', - 'info', - 'dark', - 'light', - ]), - PropTypes.string, -]) - -export const fallbackPlacementsPropType = PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.oneOf(['top', 'bottom', 'right', 'left']).isRequired), - PropTypes.oneOf(['top', 'bottom', 'right', 'left']), -]) - -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 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 const textColorsPropType = PropTypes.oneOfType([ - colorPropType, - PropTypes.oneOf(['white', 'muted']), - PropTypes.string, -]) - -export const triggerPropType = PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.oneOf(['hover', 'focus', 'click']).isRequired), - PropTypes.oneOf(['hover', 'focus', 'click']), -]) diff --git a/packages/coreui-react/src/types.ts b/packages/coreui-react/src/types.ts deleted file mode 100644 index 860fa90c..00000000 --- a/packages/coreui-react/src/types.ts +++ /dev/null @@ -1,65 +0,0 @@ -export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' - -export type Colors = - | 'primary' - | 'secondary' - | 'success' - | 'danger' - | 'warning' - | 'info' - | 'dark' - | 'light' - | 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 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 type TextColors = - | Colors - | 'primary-emphasis' - | 'secondary-emphasis' - | 'success-emphasis' - | 'danger-emphasis' - | 'warning-emphasis' - | 'info-emphasis' - | 'light-emphasis' - | 'body' - | 'body-emphasis' - | 'body-secondary' - | 'body-tertiary' - | 'black' - | 'black-50' - | 'white' - | 'white-50' - | string - -export type Triggers = 'hover' | 'focus' | 'click' diff --git a/packages/coreui-react/src/utils/executeAfterTransition.ts b/packages/coreui-react/src/utils/executeAfterTransition.ts deleted file mode 100644 index 7b0bed80..00000000 --- a/packages/coreui-react/src/utils/executeAfterTransition.ts +++ /dev/null @@ -1,46 +0,0 @@ -import getTransitionDurationFromElement from './getTransitionDurationFromElement' - -const execute = (callback: () => void) => { - if (typeof callback === 'function') { - callback() - } -} - -const triggerTransitionEnd = (element: HTMLElement) => { - element.dispatchEvent(new Event('transitionend')) -} - -const executeAfterTransition = ( - callback: () => void, - transitionElement: HTMLElement, - waitForTransition = true, -) => { - if (!waitForTransition) { - execute(callback) - return - } - - const durationPadding = 5 - const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding - - let called = false - - const handler = ({ target }: { target: any }) => { - if (target !== transitionElement) { - return - } - - called = true - transitionElement.removeEventListener('transitionend', handler) - execute(callback) - } - - transitionElement.addEventListener('transitionend', handler) - setTimeout(() => { - if (!called) { - triggerTransitionEnd(transitionElement) - } - }, emulatedDuration) -} - -export default executeAfterTransition diff --git a/packages/coreui-react/src/utils/getNextActiveElement.ts b/packages/coreui-react/src/utils/getNextActiveElement.ts deleted file mode 100644 index a80293ca..00000000 --- a/packages/coreui-react/src/utils/getNextActiveElement.ts +++ /dev/null @@ -1,23 +0,0 @@ -const getNextActiveElement = ( - list: HTMLElement[], - activeElement: HTMLElement, - shouldGetNext: boolean, - isCycleAllowed: boolean, -) => { - const listLength = list.length - let index = list.indexOf(activeElement) - - if (index === -1) { - return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0] - } - - index += shouldGetNext ? 1 : -1 - - if (isCycleAllowed) { - index = (index + listLength) % listLength - } - - return list[Math.max(0, Math.min(index, listLength - 1))] -} - -export default getNextActiveElement diff --git a/packages/coreui-react/src/utils/getRTLPlacement.ts b/packages/coreui-react/src/utils/getRTLPlacement.ts deleted file mode 100644 index 87c38517..00000000 --- a/packages/coreui-react/src/utils/getRTLPlacement.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Placement } from '@popperjs/core' -import isRTL from './isRTL' - -const getRTLPlacement = (placement: string, element: HTMLDivElement | null): Placement => { - switch (placement) { - case 'right': { - return isRTL(element) ? 'left' : 'right' - } - case 'left': { - return isRTL(element) ? 'right' : 'left' - } - default: { - return placement as Placement - } - } -} - -export default getRTLPlacement diff --git a/packages/coreui-react/src/utils/getTransitionDurationFromElement.ts b/packages/coreui-react/src/utils/getTransitionDurationFromElement.ts deleted file mode 100644 index a62b32fb..00000000 --- a/packages/coreui-react/src/utils/getTransitionDurationFromElement.ts +++ /dev/null @@ -1,24 +0,0 @@ -const getTransitionDurationFromElement = (element: HTMLElement) => { - if (!element) { - return 0 - } - - // Get transition-duration of the element - let { transitionDuration, transitionDelay } = window.getComputedStyle(element) - - const floatTransitionDuration = Number.parseFloat(transitionDuration) - const floatTransitionDelay = Number.parseFloat(transitionDelay) - - // Return 0 if element or transition duration is not found - if (!floatTransitionDuration && !floatTransitionDelay) { - return 0 - } - - // If multiple durations are defined, take the first - transitionDuration = transitionDuration.split(',')[0] - transitionDelay = transitionDelay.split(',')[0] - - return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * 1000 -} - -export default getTransitionDurationFromElement diff --git a/packages/coreui-react/src/utils/index.ts b/packages/coreui-react/src/utils/index.ts deleted file mode 100644 index 9d965598..00000000 --- a/packages/coreui-react/src/utils/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import executeAfterTransition from './executeAfterTransition' -import getNextActiveElement from './getNextActiveElement' -import getRTLPlacement from './getRTLPlacement' -import getTransitionDurationFromElement from './getTransitionDurationFromElement' -import isInViewport from './isInViewport' -import isRTL from './isRTL' -import mergeClassNames from './mergeClassNames' - -export { - executeAfterTransition, - getNextActiveElement, - getRTLPlacement, - getTransitionDurationFromElement, - isInViewport, - isRTL, - mergeClassNames, -} diff --git a/packages/coreui-react/src/utils/isInViewport.ts b/packages/coreui-react/src/utils/isInViewport.ts deleted file mode 100644 index 7aae5391..00000000 --- a/packages/coreui-react/src/utils/isInViewport.ts +++ /dev/null @@ -1,11 +0,0 @@ -const isInViewport = (element: HTMLElement) => { - const rect = element.getBoundingClientRect() - return ( - Math.floor(rect.top) >= 0 && - Math.floor(rect.left) >= 0 && - Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) && - Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth) - ) -} - -export default isInViewport diff --git a/packages/coreui-react/src/utils/isRTL.ts b/packages/coreui-react/src/utils/isRTL.ts deleted file mode 100644 index 17180d80..00000000 --- a/packages/coreui-react/src/utils/isRTL.ts +++ /dev/null @@ -1,13 +0,0 @@ -const isRTL = (element?: HTMLElement | HTMLDivElement | null) => { - if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') { - return true - } - - if (element) { - return element.closest('[dir="rtl"]') !== null - } - - return false -} - -export default isRTL diff --git a/packages/coreui-react/src/utils/mergeClassNames.ts b/packages/coreui-react/src/utils/mergeClassNames.ts deleted file mode 100644 index e2013440..00000000 --- a/packages/coreui-react/src/utils/mergeClassNames.ts +++ /dev/null @@ -1,25 +0,0 @@ -const mergeClassNames = ( - defaultClassNames: T, - customClassNames?: Partial, -): T => { - if (customClassNames === undefined || typeof customClassNames !== 'object') { - return defaultClassNames - } - - const classNames: T = { ...defaultClassNames } - - for (const key in customClassNames) { - if (customClassNames.hasOwnProperty(key)) { - const typedKey = key as keyof T - const customClassName = customClassNames[typedKey]?.toString() - - classNames[typedKey] = customClassName?.startsWith('!') - ? (customClassName.slice(1).trim() as T[keyof T]) - : (`${classNames[typedKey]} ${customClassName}`.trim() as T[keyof T]) - } - } - - return classNames -} - -export default mergeClassNames diff --git a/packages/coreui-react/tsconfig.json b/packages/coreui-react/tsconfig.json deleted file mode 100644 index d8b90788..00000000 --- a/packages/coreui-react/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": ["src/**/*"] -} \ No newline at end of file diff --git a/packages/docs/build/api.mjs b/packages/docs/build/api.mjs deleted file mode 100644 index 5ce20f3c..00000000 --- a/packages/docs/build/api.mjs +++ /dev/null @@ -1,366 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -import { globby } from 'globby' -import { writeFile, mkdir } from 'node:fs/promises' -import path from 'node:path' -import { fileURLToPath } from 'node:url' -import { parse } from 'react-docgen-typescript' -import showdown from 'showdown' - -/** - * Derive __dirname in ESM - */ -const __filename = fileURLToPath(import.meta.url) -const __dirname = path.dirname(__filename) -const converter = new showdown.Converter({ simpleLineBreaks: true }) - -/** - * Glob patterns to locate .tsx files for documentation. - */ -const GLOB_PATTERNS = [ - '**/src/**/*.tsx', - '../node_modules/@coreui/icons-react/src/**/*.tsx', - '../node_modules/@coreui/react-chartjs/src/**/*.tsx', -] - -/** - * Options for globby to control file matching behavior. - */ -const GLOBBY_OPTIONS = { - absolute: true, - cwd: path.join(__dirname, '..', '..'), - gitignore: false, - ignore: ['**/docs/**', '**/__tests__/**'], -} - -/** - * Excluded files list (currently unused). - */ -const EXCLUDED_FILES = [] // Currently unused, but can be utilized if needed - -/** - * Options for react-docgen-typescript parser. - */ -const DOCGEN_OPTIONS = { - shouldIncludePropTagMap: true, -} - -/** - * List of pro components that require special handling. - */ -const PRO_COMPONENTS = [ - 'CCalendar', - 'CDatePicker', - 'CDateRangePicker', - 'CFormMask', - 'CLoadingButton', - 'CMultiSelect', - 'CRating', - 'CRangeSlider', - 'CRating', - 'CSmartPagination', - 'CSmartTable', - 'CTimePicker', - 'CVirtualScroller', -] - -/** - * Text replacements for certain components. - */ -const TEXT_REPLACEMENTS = { - CDatePicker: { - description: [{ 'React Calendar': 'React Date Picker' }], - example: [{ CCalendar: 'CDatePicker' }], - }, - CDateRangePicker: { - description: [{ 'React Calendar': 'React Date Range Picker' }], - example: [{ CCalendar: 'CDateRangePicker' }], - }, - CFormInput: { - example: [{ CFormControlValidation: 'CFormInput' }, { CFormControlWrapper: 'CFormInput' }], - }, - CFormTextarea: { - example: [ - { CFormControlValidation: 'CFormTextarea' }, - { CFormControlWrapper: 'CFormTextarea' }, - ], - }, -} - -/** - * Escapes special characters in text to prevent Markdown rendering issues. - * - * @param {string} text - The text to escape. - * @returns {string} - The escaped text. - */ -const escapeMarkdown = (text) => { - if (typeof text !== 'string') return text - return text - .replaceAll(/(<)/g, String.raw`\$1`) - .replaceAll('\n', '
    ') - .replaceAll(/`([^`]+)`/g, '{`$1`}') -} - -/** - * Generates the relative filename based on the file path. - * - * @param {string} file - The absolute file path. - * @returns {string} - The relative filename. - */ -const getRelativeFilename = (file) => { - let relativePath = file.includes('node_modules') - ? file.split('node_modules/@coreui/')[1] - : path.relative(GLOBBY_OPTIONS.cwd, file).replace('coreui-', '') - - // Remove '-pro' from the filename if not a pro component - const isPro = PRO_COMPONENTS.some((component) => file.includes(component)) - if (!isPro) { - relativePath = relativePath.replace('-pro', '') - } - - return relativePath -} - -/** - * Splits the input string by the '|' character, but only when the '|' is outside of any curly braces {} and parentheses (). - * - * @param {string} input - The string to be split. - * @returns {string[]} An array of split parts, trimmed of whitespace. - * @throws {Error} Throws an error if there are unmatched braces or parentheses in the input. - */ -const splitOutsideBracesAndParentheses = (input) => { - if (input.endsWith('...')) { - return [input] - } - - const parts = [] - let currentPart = '' - let braceDepth = 0 - let parenthesisDepth = 0 - - for (const char of input) { - switch (char) { - case '{': { - braceDepth++ - break - } - case '}': { - braceDepth-- - if (braceDepth < 0) { - throw new Error('Unmatched closing curly brace detected.') - } - break - } - case '(': { - parenthesisDepth++ - break - } - case ')': { - parenthesisDepth-- - if (parenthesisDepth < 0) { - throw new Error('Unmatched closing parenthesis detected.') - } - break - } - case '|': { - // Split only if not inside any braces or parentheses - if (braceDepth === 0 && parenthesisDepth === 0 && currentPart.trim()) { - parts.push(currentPart.trim()) - currentPart = '' - continue - } - break - } - default: { - break - } - } - currentPart += char - } - - if (braceDepth !== 0) { - throw new Error('Unmatched opening curly brace detected.') - } - if (parenthesisDepth !== 0) { - throw new Error('Unmatched opening parenthesis detected.') - } - - if (currentPart.trim()) { - parts.push(currentPart.trim()) - } - - return parts -} - -/** - * Replaces specified text within component documentation. - * - * @param {string} componenName - The name of the component. - * @param {string} keyName - The key of the text replacement (e.g., 'description', 'example'). - * @param {string} text - The text to be replaced. - * @returns {string} The replaced text. - */ -const replaceText = (componenName, keyName, text) => { - const keyNames = Object.keys(TEXT_REPLACEMENTS) - - if (keyNames.includes(componenName) && TEXT_REPLACEMENTS[componenName][keyName]) { - const replacements = TEXT_REPLACEMENTS[componenName][keyName] - for (const replacement of replacements) { - for (const [key, value] of Object.entries(replacement)) { - if (text && key && value) { - return text.replaceAll(key, value) - } - } - } - } else { - return text - } -} - -/** - * Creates an MDX file with the component's API documentation. - * - * @param {string} file - The absolute path to the component file. - * @param {object} component - The component info extracted by react-docgen-typescript. - */ -const createMdx = async (file, component) => { - if (!component) return - - const filename = path.basename(file, '.tsx') - const relativeFilename = getRelativeFilename(file) - - let content = `\n\`\`\`jsx\n` - const importPathParts = relativeFilename.split('/') - if (importPathParts.length > 1) { - content += `import { ${component.displayName} } from '@coreui/${importPathParts[0]}'\n` - } - content += `// or\n` - content += `import ${component.displayName} from '@coreui/${relativeFilename.replace('.tsx', '')}'\n` - content += `\`\`\`\n\n` - - const filteredProps = Object.entries(component.props) - .filter(([_, value]) => { - if (!value.parent?.fileName) return true - return ( - !value.parent.fileName.includes('@types/react/index.d.ts') && - !value.parent.fileName.includes('@types/react/ts5.0/index.d.ts') - ) - }) - .sort(([a], [b]) => a.localeCompare(b)) - - for (const [index, [propName, propInfo]] of filteredProps.entries()) { - if (index === 0) { - content += `

    \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - } - - // Skip props marked to be ignored - if (propInfo.tags?.ignore === '') { - continue - } - - const displayName = propInfo.name || '' - const since = propInfo.tags?.since - ? `${propInfo.tags.since}+` - : '' - const deprecated = propInfo.tags?.deprecated - ? `Deprecated ${propInfo.tags.deprecated}` - : '' - const description = propInfo.description - ? replaceText(component.displayName, 'description', propInfo.description) - : '-' - const type = propInfo.type - ? propInfo.type.name.includes('ReactElement') - ? 'ReactElement' - : propInfo.type.name - : '' - const defaultValue = propInfo.defaultValue ? `\`${propInfo.defaultValue.value}\`` : '-' - const example = propInfo.tags?.example - ? replaceText(component.displayName, 'example', propInfo.tags.example) - : false - - // Format types as inline code - const types = splitOutsideBracesAndParentheses(type) - .map((_type) => `\`${_type.trim().replaceAll('"', "'")}\``) - .join(', ') - - const id = `${component.displayName.toLowerCase()}-${propName.replaceAll(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()}` - const anchor = `#` - - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - content += ` \n` - } - - content += ` \n` - content += `
    PropertyDefaultType
    ${displayName}${anchor}${since}${deprecated}${escapeMarkdown(defaultValue)}${escapeMarkdown(types)}
    \n` - content += ` ${converter - .makeHtml(description) - .replaceAll(/(.*?)<\/code>/g, '{`$1`}') - .replaceAll(/{`<(.*?)>`}<\/code>/g, '{`<$1>`}')}\n` - - if (example) { - content += ` \n` - } - - content += `
    \n` - content += `
    \n` - - const outputDir = path.join('content', 'api') - const outputPath = path.join(outputDir, `${filename}.api.mdx`) - - try { - await mkdir(outputDir, { recursive: true }) - await writeFile(outputPath, content, { encoding: 'utf8' }) - console.log(`File created: ${filename}.api.mdx`) - } catch (error) { - console.error(`Failed to write file ${outputPath}:`, error) - } -} - -/** - * Main execution function. - */ -const main = async () => { - try { - const files = await globby(GLOB_PATTERNS, GLOBBY_OPTIONS) - - for (const file of files) { - console.log(`Processing file: ${file}`) - let components - try { - components = parse(file, DOCGEN_OPTIONS) - } catch (parseError) { - console.error(`Failed to parse ${file}:`, parseError) - continue // Skip to the next file - } - - if (components && components.length > 0) { - for (const component of components) { - await createMdx(file, component) // Sequentially create MDX files - } - } - } - } catch (error) { - console.error('An error occurred:', error) - process.exit(1) - } -} - -// Execute the main function -main() diff --git a/packages/docs/content/api/CAccordion.api.mdx b/packages/docs/content/api/CAccordion.api.mdx deleted file mode 100644 index 296cb12a..00000000 --- a/packages/docs/content/api/CAccordion.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CAccordion } from '@coreui/react' -// or -import CAccordion from '@coreui/react/src/components/accordion/CAccordion' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    activeItemKey#-{`string`}, {`number`}
    -

    The active item key.

    -
    alwaysOpen#{`false`}{`boolean`}
    -

    Make accordion items stay open when another item is opened

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    flush#-{`boolean`}
    -

    Removes the default background-color, some borders, and some rounded corners to render accordions edge-to-edge with their parent container.

    -
    -
    diff --git a/packages/docs/content/api/CAccordionBody.api.mdx b/packages/docs/content/api/CAccordionBody.api.mdx deleted file mode 100644 index fa507a2f..00000000 --- a/packages/docs/content/api/CAccordionBody.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CAccordionBody } from '@coreui/react' -// or -import CAccordionBody from '@coreui/react/src/components/accordion/CAccordionBody' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CAccordionButton.api.mdx b/packages/docs/content/api/CAccordionButton.api.mdx deleted file mode 100644 index 67fb1438..00000000 --- a/packages/docs/content/api/CAccordionButton.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CAccordionButton } from '@coreui/react' -// or -import CAccordionButton from '@coreui/react/src/components/accordion/CAccordionButton' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CAccordionHeader.api.mdx b/packages/docs/content/api/CAccordionHeader.api.mdx deleted file mode 100644 index e3ea183f..00000000 --- a/packages/docs/content/api/CAccordionHeader.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CAccordionHeader } from '@coreui/react' -// or -import CAccordionHeader from '@coreui/react/src/components/accordion/CAccordionHeader' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CAccordionItem.api.mdx b/packages/docs/content/api/CAccordionItem.api.mdx deleted file mode 100644 index 8691cb6b..00000000 --- a/packages/docs/content/api/CAccordionItem.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CAccordionItem } from '@coreui/react' -// or -import CAccordionItem from '@coreui/react/src/components/accordion/CAccordionItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    id#-{`string`}
    -

    The id global attribute defines an identifier (ID) that must be unique in the whole document.

    -
    itemKey#-{`string`}, {`number`}
    -

    Item key.

    -
    -
    diff --git a/packages/docs/content/api/CAlert.api.mdx b/packages/docs/content/api/CAlert.api.mdx deleted file mode 100644 index 3fc61b0f..00000000 --- a/packages/docs/content/api/CAlert.api.mdx +++ /dev/null @@ -1,80 +0,0 @@ - -```jsx -import { CAlert } from '@coreui/react' -// or -import CAlert from '@coreui/react/src/components/alert/CAlert' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#{`primary`}{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    dismissible#-{`boolean`}
    -

    Optionally add a close button to alert and allow it to self dismiss.

    -
    onClose#-{`() => void`}
    -

    Callback fired when the component requests to be closed.

    -
    variant#-{`string`}
    -

    Set the alert variant to a solid.

    -
    visible#{`true`}{`boolean`}
    -

    Toggle the visibility of component.

    -
    -
    diff --git a/packages/docs/content/api/CAlertHeading.api.mdx b/packages/docs/content/api/CAlertHeading.api.mdx deleted file mode 100644 index c0a7e697..00000000 --- a/packages/docs/content/api/CAlertHeading.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CAlertHeading } from '@coreui/react' -// or -import CAlertHeading from '@coreui/react/src/components/alert/CAlertHeading' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'h4')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CAlertLink.api.mdx b/packages/docs/content/api/CAlertLink.api.mdx deleted file mode 100644 index 8130ef08..00000000 --- a/packages/docs/content/api/CAlertLink.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CAlertLink } from '@coreui/react' -// or -import CAlertLink from '@coreui/react/src/components/alert/CAlertLink' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CAvatar.api.mdx b/packages/docs/content/api/CAvatar.api.mdx deleted file mode 100644 index 3b2746fb..00000000 --- a/packages/docs/content/api/CAvatar.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CAvatar } from '@coreui/react' -// or -import CAvatar from '@coreui/react/src/components/avatar/CAvatar' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    shape#-{`'rounded'`}, {`'rounded-top'`}, {`'rounded-end'`}, {`'rounded-bottom'`}, {`'rounded-start'`}, {`'rounded-circle'`}, {`'rounded-pill'`}, {`'rounded-0'`}, {`'rounded-1'`}, {`'rounded-2'`}, {`'rounded-3'`}, {`string`}
    -

    Select the shape of the component.

    -
    size#-{`string`}
    -

    Size the component small, large, or extra large.

    -
    src#-{`string`}
    -

    The src attribute for the img element.

    -
    status#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the status indicator to one of CoreUI’s themed colors.

    -
    textColor#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`'primary-emphasis'`}, {`'secondary-emphasis'`}, {`'success-emphasis'`}, {`'danger-emphasis'`}, {`'warning-emphasis'`}, {`'info-emphasis'`}, {`'light-emphasis'`}, {`'body'`}, {`'body-emphasis'`}, {`'body-secondary'`}, {`'body-tertiary'`}, {`'black'`}, {`'black-50'`}, {`'white'`}, {`'white-50'`}, {`string`}
    -

    Sets the text color of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CBackdrop.api.mdx b/packages/docs/content/api/CBackdrop.api.mdx deleted file mode 100644 index 570bae5a..00000000 --- a/packages/docs/content/api/CBackdrop.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CBackdrop } from '@coreui/react' -// or -import CBackdrop from '@coreui/react/src/components/backdrop/CBackdrop' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#{`modal-backdrop`}{`string`}
    -

    A string of all className you want applied to the base component.

    -
    visible#-{`boolean`}
    -

    Toggle the visibility of modal component.

    -
    -
    diff --git a/packages/docs/content/api/CBadge.api.mdx b/packages/docs/content/api/CBadge.api.mdx deleted file mode 100644 index 3db91f39..00000000 --- a/packages/docs/content/api/CBadge.api.mdx +++ /dev/null @@ -1,100 +0,0 @@ - -```jsx -import { CBadge } from '@coreui/react' -// or -import CBadge from '@coreui/react/src/components/badge/CBadge' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'span')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    position#-{`'top-start'`}, {`'top-end'`}, {`'bottom-end'`}, {`'bottom-start'`}
    -

    Position badge in one of the corners of a link or button.

    -
    shape#-{`'rounded'`}, {`'rounded-top'`}, {`'rounded-end'`}, {`'rounded-bottom'`}, {`'rounded-start'`}, {`'rounded-circle'`}, {`'rounded-pill'`}, {`'rounded-0'`}, {`'rounded-1'`}, {`'rounded-2'`}, {`'rounded-3'`}, {`string`}
    -

    Select the shape of the component.

    -
    size#-{`'sm'`}
    -

    Size the component small.

    -
    textBgColor#5.0.0+-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.

    -
    textColor#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`'primary-emphasis'`}, {`'secondary-emphasis'`}, {`'success-emphasis'`}, {`'danger-emphasis'`}, {`'warning-emphasis'`}, {`'info-emphasis'`}, {`'light-emphasis'`}, {`'body'`}, {`'body-emphasis'`}, {`'body-secondary'`}, {`'body-tertiary'`}, {`'black'`}, {`'black-50'`}, {`'white'`}, {`'white-50'`}, {`string`}
    -

    Sets the text color of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CBreadcrumb.api.mdx b/packages/docs/content/api/CBreadcrumb.api.mdx deleted file mode 100644 index e423b7c4..00000000 --- a/packages/docs/content/api/CBreadcrumb.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CBreadcrumb } from '@coreui/react' -// or -import CBreadcrumb from '@coreui/react/src/components/breadcrumb/CBreadcrumb' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CBreadcrumbItem.api.mdx b/packages/docs/content/api/CBreadcrumbItem.api.mdx deleted file mode 100644 index 1a6c186f..00000000 --- a/packages/docs/content/api/CBreadcrumbItem.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CBreadcrumbItem } from '@coreui/react' -// or -import CBreadcrumbItem from '@coreui/react/src/components/breadcrumb/CBreadcrumbItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#5.4.0+-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'li')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    href#-{`string`}
    -

    The {`href`} attribute for the inner {``} component.

    -
    -
    diff --git a/packages/docs/content/api/CButton.api.mdx b/packages/docs/content/api/CButton.api.mdx deleted file mode 100644 index 47140b1a..00000000 --- a/packages/docs/content/api/CButton.api.mdx +++ /dev/null @@ -1,131 +0,0 @@ - -```jsx -import { CButton } from '@coreui/react' -// or -import CButton from '@coreui/react/src/components/button/CButton' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#{`button`}{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'button')`}, {`(ElementType & 'cite')`}, {`(ElementType & 'data')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    href#-{`string`}
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    role#-{`string`}
    -

    The role attribute describes the role of an element in programs that can make use of it, such as screen readers or magnifiers.

    -
    shape#-{`'rounded'`}, {`'rounded-top'`}, {`'rounded-end'`}, {`'rounded-bottom'`}, {`'rounded-start'`}, {`'rounded-circle'`}, {`'rounded-pill'`}, {`'rounded-0'`}, {`'rounded-1'`}, {`'rounded-2'`}, {`'rounded-3'`}, {`string`}
    -

    Select the shape of the component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    type#{`button`}{`'button'`}, {`'submit'`}, {`'reset'`}
    -

    Specifies the type of button. Always specify the type attribute for the {`

    variant#-{`'outline'`}, {`'ghost'`}
    -

    Set the button variant to an outlined button or a ghost button.

    -
    -
    diff --git a/packages/docs/content/api/CButtonGroup.api.mdx b/packages/docs/content/api/CButtonGroup.api.mdx deleted file mode 100644 index fa96bcc3..00000000 --- a/packages/docs/content/api/CButtonGroup.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CButtonGroup } from '@coreui/react' -// or -import CButtonGroup from '@coreui/react/src/components/button-group/CButtonGroup' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    vertical#-{`boolean`}
    -

    Create a set of buttons that appear vertically stacked rather than horizontally. Split button dropdowns are not supported here.

    -
    -
    diff --git a/packages/docs/content/api/CButtonToolbar.api.mdx b/packages/docs/content/api/CButtonToolbar.api.mdx deleted file mode 100644 index 2bfb6c0d..00000000 --- a/packages/docs/content/api/CButtonToolbar.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CButtonToolbar } from '@coreui/react' -// or -import CButtonToolbar from '@coreui/react/src/components/button-group/CButtonToolbar' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCallout.api.mdx b/packages/docs/content/api/CCallout.api.mdx deleted file mode 100644 index 63e8222e..00000000 --- a/packages/docs/content/api/CCallout.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCallout } from '@coreui/react' -// or -import CCallout from '@coreui/react/src/components/callout/CCallout' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CCard.api.mdx b/packages/docs/content/api/CCard.api.mdx deleted file mode 100644 index 3f342cc4..00000000 --- a/packages/docs/content/api/CCard.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CCard } from '@coreui/react' -// or -import CCard from '@coreui/react/src/components/card/CCard' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    textBgColor#5.0.0+-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.

    -
    textColor#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`'primary-emphasis'`}, {`'secondary-emphasis'`}, {`'success-emphasis'`}, {`'danger-emphasis'`}, {`'warning-emphasis'`}, {`'info-emphasis'`}, {`'light-emphasis'`}, {`'body'`}, {`'body-emphasis'`}, {`'body-secondary'`}, {`'body-tertiary'`}, {`'black'`}, {`'black-50'`}, {`'white'`}, {`'white-50'`}, {`string`}
    -

    Sets the text color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CCardBody.api.mdx b/packages/docs/content/api/CCardBody.api.mdx deleted file mode 100644 index c5c0ee2d..00000000 --- a/packages/docs/content/api/CCardBody.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CCardBody } from '@coreui/react' -// or -import CCardBody from '@coreui/react/src/components/card/CCardBody' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCardFooter.api.mdx b/packages/docs/content/api/CCardFooter.api.mdx deleted file mode 100644 index 8a1b7124..00000000 --- a/packages/docs/content/api/CCardFooter.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CCardFooter } from '@coreui/react' -// or -import CCardFooter from '@coreui/react/src/components/card/CCardFooter' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCardGroup.api.mdx b/packages/docs/content/api/CCardGroup.api.mdx deleted file mode 100644 index 9c71e8cb..00000000 --- a/packages/docs/content/api/CCardGroup.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CCardGroup } from '@coreui/react' -// or -import CCardGroup from '@coreui/react/src/components/card/CCardGroup' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCardHeader.api.mdx b/packages/docs/content/api/CCardHeader.api.mdx deleted file mode 100644 index 4941a94d..00000000 --- a/packages/docs/content/api/CCardHeader.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCardHeader } from '@coreui/react' -// or -import CCardHeader from '@coreui/react/src/components/card/CCardHeader' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'div')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCardImage.api.mdx b/packages/docs/content/api/CCardImage.api.mdx deleted file mode 100644 index 5694d515..00000000 --- a/packages/docs/content/api/CCardImage.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CCardImage } from '@coreui/react' -// or -import CCardImage from '@coreui/react/src/components/card/CCardImage' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'img')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    orientation#-{`'top'`}, {`'bottom'`}
    -

    Optionally orientate the image to the top, bottom, or make it overlaid across the card.

    -
    -
    diff --git a/packages/docs/content/api/CCardImageOverlay.api.mdx b/packages/docs/content/api/CCardImageOverlay.api.mdx deleted file mode 100644 index 779ea0b9..00000000 --- a/packages/docs/content/api/CCardImageOverlay.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CCardImageOverlay } from '@coreui/react' -// or -import CCardImageOverlay from '@coreui/react/src/components/card/CCardImageOverlay' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCardLink.api.mdx b/packages/docs/content/api/CCardLink.api.mdx deleted file mode 100644 index 38164730..00000000 --- a/packages/docs/content/api/CCardLink.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCardLink } from '@coreui/react' -// or -import CCardLink from '@coreui/react/src/components/card/CCardLink' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    -

    A string of all className you want applied to the base component.

    -
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -
    diff --git a/packages/docs/content/api/CCardSubtitle.api.mdx b/packages/docs/content/api/CCardSubtitle.api.mdx deleted file mode 100644 index 9c49fea5..00000000 --- a/packages/docs/content/api/CCardSubtitle.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCardSubtitle } from '@coreui/react' -// or -import CCardSubtitle from '@coreui/react/src/components/card/CCardSubtitle' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'h6')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CCardText.api.mdx b/packages/docs/content/api/CCardText.api.mdx deleted file mode 100644 index ff4ff0d6..00000000 --- a/packages/docs/content/api/CCardText.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCardText } from '@coreui/react' -// or -import CCardText from '@coreui/react/src/components/card/CCardText' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'p')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CCardTitle.api.mdx b/packages/docs/content/api/CCardTitle.api.mdx deleted file mode 100644 index a05940f4..00000000 --- a/packages/docs/content/api/CCardTitle.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCardTitle } from '@coreui/react' -// or -import CCardTitle from '@coreui/react/src/components/card/CCardTitle' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'h5')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CCarousel.api.mdx b/packages/docs/content/api/CCarousel.api.mdx deleted file mode 100644 index 067f171a..00000000 --- a/packages/docs/content/api/CCarousel.api.mdx +++ /dev/null @@ -1,140 +0,0 @@ - -```jsx -import { CCarousel } from '@coreui/react' -// or -import CCarousel from '@coreui/react/src/components/carousel/CCarousel' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    activeIndex#{`0`}{`number`}
    -

    index of the active item.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    controls#-{`boolean`}
    -

    Adding in the previous and next controls.

    -
    dark#-{`boolean`}
    -

    Add darker controls, indicators, and captions.

    -
    indicators#-{`boolean`}
    -

    Adding indicators at the bottom of the carousel for each item.

    -
    interval#{`5000`}{`number`}, {`boolean`}
    -

    The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.

    -
    onSlid#-{`(active: number, direction: string) => void`}
    -

    Callback fired when a slide transition end.

    -
    onSlide#-{`(active: number, direction: string) => void`}
    -

    Callback fired when a slide transition starts.

    -
    pause#{`hover`}{`boolean`}, {`'hover'`}
    -

    If set to 'hover', pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. If set to false, hovering over the carousel won't pause it.

    -
    touch#4.5.0+{`true`}{`boolean`}
    -

    Set whether the carousel should support left/right swipe interactions on touchscreen devices.

    -
    transition#-{`'slide'`}, {`'crossfade'`}
    -

    Set type of the transition.

    -
    wrap#{`true`}{`boolean`}
    -

    Set whether the carousel should cycle continuously or have hard stops.

    -
    -
    diff --git a/packages/docs/content/api/CCarouselCaption.api.mdx b/packages/docs/content/api/CCarouselCaption.api.mdx deleted file mode 100644 index 155f973a..00000000 --- a/packages/docs/content/api/CCarouselCaption.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CCarouselCaption } from '@coreui/react' -// or -import CCarouselCaption from '@coreui/react/src/components/carousel/CCarouselCaption' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CCarouselItem.api.mdx b/packages/docs/content/api/CCarouselItem.api.mdx deleted file mode 100644 index eedb86a1..00000000 --- a/packages/docs/content/api/CCarouselItem.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CCarouselItem } from '@coreui/react' -// or -import CCarouselItem from '@coreui/react/src/components/carousel/CCarouselItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    interval#{`false`}{`number`}, {`boolean`}
    -

    The amount of time to delay between automatically cycling an item.

    -
    -
    diff --git a/packages/docs/content/api/CChart.api.mdx b/packages/docs/content/api/CChart.api.mdx deleted file mode 100644 index 14787f9f..00000000 --- a/packages/docs/content/api/CChart.api.mdx +++ /dev/null @@ -1,170 +0,0 @@ - -```jsx -import { CChart } from '@coreui/react-chartjs' -// or -import CChart from '@coreui/react-chartjs/src/CChart' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    customTooltips#{`true`}{`boolean`}
    -

    Enables custom html based tooltips instead of standard tooltips.

    -
    data#-{`ChartData\`}, {`((canvas: HTMLCanvasElement) => ChartData\<...>)`}
    -

    The data object that is passed into the Chart.js chart (more info).

    -
    fallbackContent#-{`React.ReactNode`}
    -

    A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions.

    -
    getDatasetAtEvent#-{`(dataset: InteractionItem[], event: React.MouseEvent\) => void`}
    -

    Proxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event.

    -
    getElementAtEvent#-{`(element: InteractionItem[], event: React.MouseEvent\) => void`}
    -

    Proxy for Chart.js getElementAtEvent. Calls with single element array and triggering event.

    -
    getElementsAtEvent#-{`(elements: InteractionItem[], event: React.MouseEvent\) => void`}
    -

    Proxy for Chart.js getElementsAtEvent. Calls with element array and triggering event.

    -
    height#{`150`}{`number`}
    -

    Height attribute applied to the rendered canvas.

    -
    id#-{`string`}
    -

    ID attribute applied to the rendered canvas.

    -
    options#-{`_DeepPartialObject\ & ElementChartOptions\ & PluginChartOptions\<...> & DatasetChartOptions\<...> & ScaleChartOptions\<...>>`}
    -

    The options object that is passed into the Chart.js chart.

    -
    plugins#{`[]`}{`Plugin\[]`}
    -

    The plugins array that is passed into the Chart.js chart (more info)

    -
    redraw#{`false`}{`boolean`}
    -

    If true, will tear down and redraw chart on all updates.

    -
    type#{`bar`}{`{'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie' | 'scatter'}`}
    -

    Chart.js chart type.

    -
    width#{`300`}{`number`}
    -

    Width attribute applied to the rendered canvas.

    -
    wrapper#{`true`}{`boolean`}
    -

    Put the chart into the wrapper div element.

    -
    -
    diff --git a/packages/docs/content/api/CCharts.api.mdx b/packages/docs/content/api/CCharts.api.mdx deleted file mode 100644 index 79ff901e..00000000 --- a/packages/docs/content/api/CCharts.api.mdx +++ /dev/null @@ -1,160 +0,0 @@ - -```jsx -import { CChartBar } from '@coreui/react-chartjs' -// or -import CChartBar from '@coreui/react-chartjs/src/CCharts' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    customTooltips#{`true`}{`boolean`}
    -

    Enables custom html based tooltips instead of standard tooltips.

    -
    data#-{`ChartData\`}, {`((canvas: HTMLCanvasElement) => ChartData\<...>)`}
    -

    The data object that is passed into the Chart.js chart (more info).

    -
    fallbackContent#-{`React.ReactNode`}
    -

    A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions.

    -
    getDatasetAtEvent#-{`(dataset: InteractionItem[], event: React.MouseEvent\) => void`}
    -

    Proxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event.

    -
    getElementAtEvent#-{`(element: InteractionItem[], event: React.MouseEvent\) => void`}
    -

    Proxy for Chart.js getElementAtEvent. Calls with single element array and triggering event.

    -
    getElementsAtEvent#-{`(elements: InteractionItem[], event: React.MouseEvent\) => void`}
    -

    Proxy for Chart.js getElementsAtEvent. Calls with element array and triggering event.

    -
    height#{`150`}{`number`}
    -

    Height attribute applied to the rendered canvas.

    -
    id#-{`string`}
    -

    ID attribute applied to the rendered canvas.

    -
    options#-{`_DeepPartialObject\ & ElementChartOptions\ & PluginChartOptions\<...> & DatasetChartOptions\<...> & ScaleChartOptions\<...>>`}
    -

    The options object that is passed into the Chart.js chart.

    -
    plugins#-{`Plugin\[]`}
    -

    The plugins array that is passed into the Chart.js chart (more info)

    -
    redraw#{`false`}{`boolean`}
    -

    If true, will tear down and redraw chart on all updates.

    -
    width#{`300`}{`number`}
    -

    Width attribute applied to the rendered canvas.

    -
    wrapper#{`true`}{`boolean`}
    -

    Put the chart into the wrapper div element.

    -
    -
    diff --git a/packages/docs/content/api/CCloseButton.api.mdx b/packages/docs/content/api/CCloseButton.api.mdx deleted file mode 100644 index 5e87320d..00000000 --- a/packages/docs/content/api/CCloseButton.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CCloseButton } from '@coreui/react' -// or -import CCloseButton from '@coreui/react/src/components/close-button/CCloseButton' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    dark#-{`boolean`}
    -

    Invert the default color.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    white#Deprecated 5.0.0-{`boolean`}
    -

    Change the default color to white.

    -
    -
    diff --git a/packages/docs/content/api/CCol.api.mdx b/packages/docs/content/api/CCol.api.mdx deleted file mode 100644 index a4158913..00000000 --- a/packages/docs/content/api/CCol.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CCol } from '@coreui/react' -// or -import CCol from '@coreui/react/src/components/grid/CCol' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    lg#-{`{ 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }}`}
    -

    The number of columns/offset/order on large devices (<1200px).

    -
    md#-{`{ 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }}`}
    -

    The number of columns/offset/order on medium devices (<992px).

    -
    sm#-{`{ 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }}`}
    -

    The number of columns/offset/order on small devices (<768px).

    -
    xl#-{`{ 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }}`}
    -

    The number of columns/offset/order on X-Large devices (<1400px).

    -
    xs#-{`{ 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }}`}
    -

    The number of columns/offset/order on extra small devices (<576px).

    -
    xxl#-{`{ 'auto' | number | string | boolean | { span: 'auto' | number | string | boolean } | { offset: number | string } | { order: 'first' | 'last' | number | string }}`}
    -

    The number of columns/offset/order on XX-Large devices (≥1400px).

    -
    -
    diff --git a/packages/docs/content/api/CCollapse.api.mdx b/packages/docs/content/api/CCollapse.api.mdx deleted file mode 100644 index c2943464..00000000 --- a/packages/docs/content/api/CCollapse.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CCollapse } from '@coreui/react' -// or -import CCollapse from '@coreui/react/src/components/collapse/CCollapse' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    horizontal#-{`boolean`}
    -

    Set horizontal collapsing to transition the width instead of height.

    -
    onHide#-{`() => void`}
    -

    Callback fired when the component requests to be hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired when the component requests to be shown.

    -
    visible#-{`boolean`}
    -

    Toggle the visibility of component.

    -
    -
    diff --git a/packages/docs/content/api/CConditionalPortal.api.mdx b/packages/docs/content/api/CConditionalPortal.api.mdx deleted file mode 100644 index 9afb8ca0..00000000 --- a/packages/docs/content/api/CConditionalPortal.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CConditionalPortal } from '@coreui/react' -// or -import CConditionalPortal from '@coreui/react/src/components/conditional-portal/CConditionalPortal' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    container#4.11.0+-{`DocumentFragment`}, {`Element`}, {`(() => DocumentFragment | Element)`}
    -

    An HTML element or function that returns a single element, with {`document.body`} as the default.

    -
    portal#-{`boolean`}
    -

    Render some children into a different part of the DOM

    -
    -
    diff --git a/packages/docs/content/api/CContainer.api.mdx b/packages/docs/content/api/CContainer.api.mdx deleted file mode 100644 index 86ab71f8..00000000 --- a/packages/docs/content/api/CContainer.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CContainer } from '@coreui/react' -// or -import CContainer from '@coreui/react/src/components/grid/CContainer' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    fluid#-{`boolean`}
    -

    Set container 100% wide, spanning the entire width of the viewport.

    -
    lg#-{`boolean`}
    -

    Set container 100% wide until large breakpoint.

    -
    md#-{`boolean`}
    -

    Set container 100% wide until medium breakpoint.

    -
    sm#-{`boolean`}
    -

    Set container 100% wide until small breakpoint.

    -
    xl#-{`boolean`}
    -

    Set container 100% wide until X-large breakpoint.

    -
    xxl#-{`boolean`}
    -

    Set container 100% wide until XX-large breakpoint.

    -
    -
    diff --git a/packages/docs/content/api/CDropdown.api.mdx b/packages/docs/content/api/CDropdown.api.mdx deleted file mode 100644 index 765fbd96..00000000 --- a/packages/docs/content/api/CDropdown.api.mdx +++ /dev/null @@ -1,225 +0,0 @@ - -```jsx -import { CDropdown } from '@coreui/react' -// or -import CDropdown from '@coreui/react/src/components/dropdown/CDropdown' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    alignment#-{`'start'`}, {`'end'`}, {`{ xs: 'start' | 'end' }`}, {`{ sm: 'start' | 'end' }`}, {`{ md: 'start' | 'end' }`}, {`{ lg: 'start' | 'end' }`}, {`{ xl: 'start' | 'end'}`}, {`{ xxl: 'start' | 'end'}`}
    -

    Specifies the alignment of the React Dropdown Menu within this React Dropdown.

    - - Toggle dropdown - - Action - Another Action - -`} /> -
    as#{`div`}{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'div')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Determines the root node component (native HTML element or a custom React component) for the React Dropdown.

    -
    autoClose#{`true`}{`boolean`}, {`'inside'`}, {`'outside'`}
    -

    Configures automatic closing behavior for the React Dropdown:

    -
      -
    • {`true`} - Close on clicks inside or outside of the React Dropdown Menu.
    • -
    • {`false`} - Disable auto-close; manually call {`hide`} or {`toggle`} (also not closed by {`Escape`}).
    • -
    • {`'inside'`} - Close only when clicking inside the React Dropdown Menu.
    • -
    • {`'outside'`} - Close only when clicking outside the React Dropdown Menu.
    • -
    - `} /> -
    className#-{`string`}
    -

    Adds custom classes to the React Dropdown root element.

    -
    container#4.11.0+-{`Element`}, {`DocumentFragment`}, {`(() => Element | DocumentFragment)`}
    -

    Appends the React Dropdown Menu to a specific element. You can pass an HTML element or a function returning an element. Defaults to {`document.body`}.

    - `} /> -
    dark#-{`boolean`}
    -

    Applies a darker color scheme to the React Dropdown Menu, often used within dark navbars.

    -
    direction#-{`'center'`}, {`'dropup'`}, {`'dropup-center'`}, {`'dropend'`}, {`'dropstart'`}
    -

    Specifies the direction of the React Dropdown.

    -
    offset#{`[0, 2]`}{`[number, number]`}
    -

    Defines x and y offsets ([x, y]) for the React Dropdown Menu relative to its target.

    - - ... -`} /> -
    onHide#4.9.0+-{`() => void`}
    -

    Callback fired right before the React Dropdown becomes hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired immediately after the React Dropdown is displayed.

    -
    placement#{`bottom-start`}{`'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'`}
    -

    Determines the placement of the React Dropdown Menu after Popper.js modifiers.

    -
    popper#{`true`}{`boolean`}
    -

    Enables or disables dynamic positioning via Popper.js for the React Dropdown Menu.

    -
    popperConfig#5.5.0+-{`Partial\`}, {`((defaultPopperConfig: Partial\) => Partial\)`}
    -

    Provides a custom Popper.js configuration or a function that returns a modified Popper.js configuration for advanced positioning of the React Dropdown Menu. Read more

    - ...`} /> -
    portal#4.8.0+{`false`}{`boolean`}
    -

    Renders the React Dropdown Menu using a React Portal, allowing it to escape the DOM hierarchy for improved positioning.

    -
    variant#{`btn-group`}{`'btn-group'`}, {`'dropdown'`}, {`'input-group'`}, {`'nav-item'`}
    -

    Defines the visual variant of the React Dropdown

    -
    visible#{`false`}{`boolean`}
    -

    Controls the visibility of the React Dropdown Menu:

    -
      -
    • {`true`} - Visible
    • -
    • {`false`} - Hidden
    • -
    - - ... -`} /> -
    -
    diff --git a/packages/docs/content/api/CDropdownDivider.api.mdx b/packages/docs/content/api/CDropdownDivider.api.mdx deleted file mode 100644 index 35021a7c..00000000 --- a/packages/docs/content/api/CDropdownDivider.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CDropdownDivider } from '@coreui/react' -// or -import CDropdownDivider from '@coreui/react/src/components/dropdown/CDropdownDivider' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CDropdownHeader.api.mdx b/packages/docs/content/api/CDropdownHeader.api.mdx deleted file mode 100644 index 60f8423c..00000000 --- a/packages/docs/content/api/CDropdownHeader.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CDropdownHeader } from '@coreui/react' -// or -import CDropdownHeader from '@coreui/react/src/components/dropdown/CDropdownHeader' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'h6')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CDropdownItem.api.mdx b/packages/docs/content/api/CDropdownItem.api.mdx deleted file mode 100644 index 4bcb66a0..00000000 --- a/packages/docs/content/api/CDropdownItem.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CDropdownItem } from '@coreui/react' -// or -import CDropdownItem from '@coreui/react/src/components/dropdown/CDropdownItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#{`a`}{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'a')`}, {`(ElementType & 'cite')`}, {`(ElementType & 'data')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    href#-{`string`}
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -
    diff --git a/packages/docs/content/api/CDropdownItemPlain.api.mdx b/packages/docs/content/api/CDropdownItemPlain.api.mdx deleted file mode 100644 index b4a8456d..00000000 --- a/packages/docs/content/api/CDropdownItemPlain.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CDropdownItemPlain } from '@coreui/react' -// or -import CDropdownItemPlain from '@coreui/react/src/components/dropdown/CDropdownItemPlain' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'span')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CDropdownMenu.api.mdx b/packages/docs/content/api/CDropdownMenu.api.mdx deleted file mode 100644 index 8aa5c1ef..00000000 --- a/packages/docs/content/api/CDropdownMenu.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CDropdownMenu } from '@coreui/react' -// or -import CDropdownMenu from '@coreui/react/src/components/dropdown/CDropdownMenu' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CDropdownToggle.api.mdx b/packages/docs/content/api/CDropdownToggle.api.mdx deleted file mode 100644 index 7ec36a8e..00000000 --- a/packages/docs/content/api/CDropdownToggle.api.mdx +++ /dev/null @@ -1,170 +0,0 @@ - -```jsx -import { CDropdownToggle } from '@coreui/react' -// or -import CDropdownToggle from '@coreui/react/src/components/dropdown/CDropdownToggle' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#-{`ElementType`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    caret#{`true`}{`boolean`}
    -

    Enables pseudo element caret on toggler.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    custom#-{`boolean`}
    -

    Create a custom toggler which accepts any content.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    href#-{`string`}
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -

    If a dropdown {`variant`} is set to {`nav-item`} then render the toggler as a link instead of a button.

    -
    role#-{`string`}
    -

    The role attribute describes the role of an element in programs that can make use of it, such as screen readers or magnifiers.

    -
    shape#-{`'rounded'`}, {`'rounded-top'`}, {`'rounded-end'`}, {`'rounded-bottom'`}, {`'rounded-start'`}, {`'rounded-circle'`}, {`'rounded-pill'`}, {`'rounded-0'`}, {`'rounded-1'`}, {`'rounded-2'`}, {`'rounded-3'`}, {`string`}
    -

    Select the shape of the component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    split#-{`boolean`}
    -

    Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of {`.dropdown-toggle-split`} className for proper spacing around the dropdown caret.

    -
    trigger#{`click`}{`'hover'`}, {`'focus'`}, {`'click'`}
    -

    Sets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them.

    -
    variant#-{`'outline'`}, {`'ghost'`}
    -

    Set the button variant to an outlined button or a ghost button.

    -
    -
    diff --git a/packages/docs/content/api/CFooter.api.mdx b/packages/docs/content/api/CFooter.api.mdx deleted file mode 100644 index a163a037..00000000 --- a/packages/docs/content/api/CFooter.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CFooter } from '@coreui/react' -// or -import CFooter from '@coreui/react/src/components/footer/CFooter' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    position#-{`'fixed'`}, {`'sticky'`}
    -

    Place footer in non-static positions.

    -
    -
    diff --git a/packages/docs/content/api/CForm.api.mdx b/packages/docs/content/api/CForm.api.mdx deleted file mode 100644 index f5ad1ef4..00000000 --- a/packages/docs/content/api/CForm.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CForm } from '@coreui/react' -// or -import CForm from '@coreui/react/src/components/form/CForm' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    validated#-{`boolean`}
    -

    Mark a form as validated. If you set it {`true`}, all validation styles will be applied to the forms component.

    -
    -
    diff --git a/packages/docs/content/api/CFormCheck.api.mdx b/packages/docs/content/api/CFormCheck.api.mdx deleted file mode 100644 index 04c01d5b..00000000 --- a/packages/docs/content/api/CFormCheck.api.mdx +++ /dev/null @@ -1,180 +0,0 @@ - -```jsx -import { CFormCheck } from '@coreui/react' -// or -import CFormCheck from '@coreui/react/src/components/form/CFormCheck' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    button#-{`ButtonObject`}
    -

    Create button-like checkboxes and radio buttons.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    feedback#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackInvalid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackValid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    floatingLabel#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    hitArea#-{`'full'`}
    -

    Sets hit area to the full area of the component.

    -
    id#-{`string`}
    -

    The id global attribute defines an identifier (ID) that must be unique in the whole document.

    -
    indeterminate#-{`boolean`}
    -

    Input Checkbox indeterminate Property.

    -
    inline#-{`boolean`}
    -

    Group checkboxes or radios on the same horizontal row.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    label#-{`ReactNode`}
    -

    The element represents a caption for a component.

    -
    reverse#-{`boolean`}
    -

    Put checkboxes or radios on the opposite side.

    -
    tooltipFeedback#4.2.0+-{`boolean`}
    -

    Display validation feedback in a styled tooltip.

    -
    type#{`checkbox`}{`'checkbox'`}, {`'radio'`}
    -

    Specifies the type of component.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    -
    diff --git a/packages/docs/content/api/CFormControlValidation.api.mdx b/packages/docs/content/api/CFormControlValidation.api.mdx deleted file mode 100644 index a664895d..00000000 --- a/packages/docs/content/api/CFormControlValidation.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CFormControlValidation } from '@coreui/react' -// or -import CFormControlValidation from '@coreui/react/src/components/form/CFormControlValidation' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    feedback#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackInvalid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackValid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    floatingLabel#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    tooltipFeedback#4.2.0+-{`boolean`}
    -

    Display validation feedback in a styled tooltip.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    -
    diff --git a/packages/docs/content/api/CFormControlWrapper.api.mdx b/packages/docs/content/api/CFormControlWrapper.api.mdx deleted file mode 100644 index 6169bf48..00000000 --- a/packages/docs/content/api/CFormControlWrapper.api.mdx +++ /dev/null @@ -1,120 +0,0 @@ - -```jsx -import { CFormControlWrapper } from '@coreui/react' -// or -import CFormControlWrapper from '@coreui/react/src/components/form/CFormControlWrapper' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    feedback#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackInvalid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackValid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    floatingClassName#4.5.0+-{`string`}
    -

    A string of all className you want applied to the floating label wrapper.

    -
    floatingLabel#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    label#4.2.0+-{`ReactNode`}
    -

    Add a caption for a component.

    -
    text#4.2.0+-{`ReactNode`}
    -

    Add helper text to the component.

    -
    tooltipFeedback#4.2.0+-{`boolean`}
    -

    Display validation feedback in a styled tooltip.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    -
    diff --git a/packages/docs/content/api/CFormFeedback.api.mdx b/packages/docs/content/api/CFormFeedback.api.mdx deleted file mode 100644 index 19a38f2d..00000000 --- a/packages/docs/content/api/CFormFeedback.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CFormFeedback } from '@coreui/react' -// or -import CFormFeedback from '@coreui/react/src/components/form/CFormFeedback' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'div')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    invalid#-{`boolean`}
    -

    Method called immediately after the {`value`} prop changes.

    -
    tooltip#-{`boolean`}
    -

    If your form layout allows it, you can display validation feedback in a styled tooltip.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    -
    diff --git a/packages/docs/content/api/CFormFloating.api.mdx b/packages/docs/content/api/CFormFloating.api.mdx deleted file mode 100644 index 4fb9bbc1..00000000 --- a/packages/docs/content/api/CFormFloating.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CFormFloating } from '@coreui/react' -// or -import CFormFloating from '@coreui/react/src/components/form/CFormFloating' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CFormInput.api.mdx b/packages/docs/content/api/CFormInput.api.mdx deleted file mode 100644 index a5dbbbd9..00000000 --- a/packages/docs/content/api/CFormInput.api.mdx +++ /dev/null @@ -1,210 +0,0 @@ - -```jsx -import { CFormInput } from '@coreui/react' -// or -import CFormInput from '@coreui/react/src/components/form/CFormInput' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    delay#{`false`}{`number`}, {`boolean`}
    -

    Delay onChange event while typing. If set to true onChange event will be delayed 500ms, you can also provide the number of milliseconds you want to delay the onChange event.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    feedback#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackInvalid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackValid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    floatingClassName#4.5.0+-{`string`}
    -

    A string of all className you want applied to the floating label wrapper.

    -
    floatingLabel#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    label#4.2.0+-{`ReactNode`}
    -

    Add a caption for a component.

    -
    onChange#-{`ChangeEventHandler\`}
    -

    Method called immediately after the {`value`} prop changes.

    -
    plainText#-{`boolean`}
    -

    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`}.

    -
    readOnly#-{`boolean`}
    -

    Toggle the readonly state for the component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    text#4.2.0+-{`ReactNode`}
    -

    Add helper text to the component.

    -
    tooltipFeedback#4.2.0+-{`boolean`}
    -

    Display validation feedback in a styled tooltip.

    -
    type#{`text`}{`string`}
    -

    Specifies the type of component.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    value#-{`string`}, {`number`}, {`string[]`}
    -

    The {`value`} attribute of component.

    -
    -
    diff --git a/packages/docs/content/api/CFormLabel.api.mdx b/packages/docs/content/api/CFormLabel.api.mdx deleted file mode 100644 index ab70a347..00000000 --- a/packages/docs/content/api/CFormLabel.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CFormLabel } from '@coreui/react' -// or -import CFormLabel from '@coreui/react/src/components/form/CFormLabel' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    customClassName#-{`string`}
    -

    A string of all className you want to be applied to the component, and override standard className value.

    -
    -
    diff --git a/packages/docs/content/api/CFormRange.api.mdx b/packages/docs/content/api/CFormRange.api.mdx deleted file mode 100644 index f60faa87..00000000 --- a/packages/docs/content/api/CFormRange.api.mdx +++ /dev/null @@ -1,110 +0,0 @@ - -```jsx -import { CFormRange } from '@coreui/react' -// or -import CFormRange from '@coreui/react/src/components/form/CFormRange' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    label#4.2.0+-{`ReactNode`}
    -

    Add a caption for a component.

    -
    max#-{`number`}
    -

    Specifies the maximum value for the component.

    -
    min#-{`number`}
    -

    Specifies the minimum value for the component.

    -
    onChange#-{`ChangeEventHandler\`}
    -

    Method called immediately after the {`value`} prop changes.

    -
    readOnly#-{`boolean`}
    -

    Toggle the readonly state for the component.

    -
    step#-{`number`}
    -

    Specifies the interval between legal numbers in the component.

    -
    value#-{`string`}, {`number`}, {`string[]`}
    -

    The {`value`} attribute of component.

    -
    -
    diff --git a/packages/docs/content/api/CFormSelect.api.mdx b/packages/docs/content/api/CFormSelect.api.mdx deleted file mode 100644 index 9b3db1a5..00000000 --- a/packages/docs/content/api/CFormSelect.api.mdx +++ /dev/null @@ -1,185 +0,0 @@ - -```jsx -import { CFormSelect } from '@coreui/react' -// or -import CFormSelect from '@coreui/react/src/components/form/CFormSelect' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    feedback#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackInvalid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackValid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    floatingClassName#4.5.0+-{`string`}
    -

    A string of all className you want applied to the floating label wrapper.

    -
    floatingLabel#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    htmlSize#-{`number`}
    -

    Specifies the number of visible options in a drop-down list.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    label#4.2.0+-{`ReactNode`}
    -

    Add a caption for a component.

    -
    onChange#-{`ChangeEventHandler\`}
    -

    Method called immediately after the {`value`} prop changes.

    -
    options#-{`Option[]`}, {`string[]`}
    -

    Options list of the select component. Available keys: {`label`}, {`value`}, {`disabled`}.
    -Examples:

    -
      -
    • {`options={[{ value: 'js', label: 'JavaScript' }, { value: 'html', label: 'HTML', disabled: true }]}`}
    • -
    • {`options={['js', 'html']}`}
    • -
    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    text#4.2.0+-{`ReactNode`}
    -

    Add helper text to the component.

    -
    tooltipFeedback#4.2.0+-{`boolean`}
    -

    Display validation feedback in a styled tooltip.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    value#-{`string`}, {`number`}, {`string[]`}
    -

    The {`value`} attribute of component.

    -
    -
    diff --git a/packages/docs/content/api/CFormSwitch.api.mdx b/packages/docs/content/api/CFormSwitch.api.mdx deleted file mode 100644 index a53296f0..00000000 --- a/packages/docs/content/api/CFormSwitch.api.mdx +++ /dev/null @@ -1,100 +0,0 @@ - -```jsx -import { CFormSwitch } from '@coreui/react' -// or -import CFormSwitch from '@coreui/react/src/components/form/CFormSwitch' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    id#-{`string`}
    -

    The id global attribute defines an identifier (ID) that must be unique in the whole document.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    label#-{`ReactNode`}
    -

    The element represents a caption for a component.

    -
    reverse#-{`boolean`}
    -

    Put switch on the opposite side.

    -
    size#-{`'lg'`}, {`'xl'`}
    -

    Size the component large or extra large. Works only with {`switch`}.

    -
    type#{`checkbox`}{`'checkbox'`}, {`'radio'`}
    -

    Specifies the type of component.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    -
    diff --git a/packages/docs/content/api/CFormText.api.mdx b/packages/docs/content/api/CFormText.api.mdx deleted file mode 100644 index 913a03b8..00000000 --- a/packages/docs/content/api/CFormText.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CFormText } from '@coreui/react' -// or -import CFormText from '@coreui/react/src/components/form/CFormText' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'div')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CFormTextarea.api.mdx b/packages/docs/content/api/CFormTextarea.api.mdx deleted file mode 100644 index c1f9db42..00000000 --- a/packages/docs/content/api/CFormTextarea.api.mdx +++ /dev/null @@ -1,180 +0,0 @@ - -```jsx -import { CFormTextarea } from '@coreui/react' -// or -import CFormTextarea from '@coreui/react/src/components/form/CFormTextarea' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    feedback#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackInvalid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable feedback.

    -
    feedbackValid#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    floatingClassName#4.5.0+-{`string`}
    -

    A string of all className you want applied to the floating label wrapper.

    -
    floatingLabel#4.2.0+-{`ReactNode`}
    -

    Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, {`:invalid`} and {`:valid`}.

    -
    invalid#-{`boolean`}
    -

    Set component validation state to invalid.

    -
    label#4.2.0+-{`ReactNode`}
    -

    Add a caption for a component.

    -
    onChange#-{`ChangeEventHandler\`}
    -

    Method called immediately after the {`value`} prop changes.

    -
    plainText#-{`boolean`}
    -

    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`}.

    -
    readOnly#-{`boolean`}
    -

    Toggle the readonly state for the component.

    -
    text#4.2.0+-{`ReactNode`}
    -

    Add helper text to the component.

    -
    tooltipFeedback#4.2.0+-{`boolean`}
    -

    Display validation feedback in a styled tooltip.

    -
    valid#-{`boolean`}
    -

    Set component validation state to valid.

    -
    value#-{`string`}, {`number`}, {`string[]`}
    -

    The {`value`} attribute of component.

    -
    -
    diff --git a/packages/docs/content/api/CHeader.api.mdx b/packages/docs/content/api/CHeader.api.mdx deleted file mode 100644 index 44632878..00000000 --- a/packages/docs/content/api/CHeader.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CHeader } from '@coreui/react' -// or -import CHeader from '@coreui/react/src/components/header/CHeader' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    container#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}, {`'fluid'`}
    -

    Defines optional container wrapping children elements.

    -
    position#-{`'fixed'`}, {`'sticky'`}
    -

    Place header in non-static positions.

    -
    -
    diff --git a/packages/docs/content/api/CHeaderBrand.api.mdx b/packages/docs/content/api/CHeaderBrand.api.mdx deleted file mode 100644 index 77a0ecc2..00000000 --- a/packages/docs/content/api/CHeaderBrand.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CHeaderBrand } from '@coreui/react' -// or -import CHeaderBrand from '@coreui/react/src/components/header/CHeaderBrand' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'a')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CHeaderDivider.api.mdx b/packages/docs/content/api/CHeaderDivider.api.mdx deleted file mode 100644 index 1af7b1d8..00000000 --- a/packages/docs/content/api/CHeaderDivider.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CHeaderDivider } from '@coreui/react' -// or -import CHeaderDivider from '@coreui/react/src/components/header/CHeaderDivider' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CHeaderNav.api.mdx b/packages/docs/content/api/CHeaderNav.api.mdx deleted file mode 100644 index 79bb4e92..00000000 --- a/packages/docs/content/api/CHeaderNav.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CHeaderNav } from '@coreui/react' -// or -import CHeaderNav from '@coreui/react/src/components/header/CHeaderNav' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CHeaderText.api.mdx b/packages/docs/content/api/CHeaderText.api.mdx deleted file mode 100644 index dab08603..00000000 --- a/packages/docs/content/api/CHeaderText.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CHeaderText } from '@coreui/react' -// or -import CHeaderText from '@coreui/react/src/components/header/CHeaderText' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CHeaderToggler.api.mdx b/packages/docs/content/api/CHeaderToggler.api.mdx deleted file mode 100644 index 0f15f26b..00000000 --- a/packages/docs/content/api/CHeaderToggler.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CHeaderToggler } from '@coreui/react' -// or -import CHeaderToggler from '@coreui/react/src/components/header/CHeaderToggler' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CIcon.api.mdx b/packages/docs/content/api/CIcon.api.mdx deleted file mode 100644 index 0e5e3056..00000000 --- a/packages/docs/content/api/CIcon.api.mdx +++ /dev/null @@ -1,130 +0,0 @@ - -```jsx -import { CIcon } from '@coreui/icons-react' -// or -import CIcon from '@coreui/icons-react/src/CIcon' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    content#Deprecated 3.0-{`string`}, {`string[]`}
    -

    Use {`icon={...}`} instead of

    -
    customClassName#-{`string`}, {`string[]`}
    -

    Use for replacing default CIcon component classes. Prop is overriding the 'size' prop.

    -
    height#-{`number`}
    -

    The height attribute defines the vertical length of an icon.

    -
    icon#-{`string`}, {`string[]`}
    -

    Name of the icon placed in React object or SVG content.

    -
    name#Deprecated 3.0-{`string`}
    -

    Use {`icon="..."`} instead of

    -
    size#-{`'custom'`}, {`'custom-size'`}, {`'sm'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}, {`'3xl'`}, {`'4xl'`}, {`'5xl'`}, {`'6xl'`}, {`'7xl'`}, {`'8xl'`}, {`'9xl'`}
    -

    Size of the icon. Available sizes: 'sm', 'lg', 'xl', 'xxl', '3xl…9xl', 'custom', 'custom-size'.

    -
    title#-{`string`}
    -

    Title tag content.

    -
    use#-{`string`}
    -

    If defined component will be rendered using 'use' tag.

    -
    viewBox#-{`string`}
    -

    The viewBox attribute defines the position and dimension of an SVG viewport.

    -
    width#-{`number`}
    -

    The width attribute defines the horizontal length of an icon.

    -
    -
    diff --git a/packages/docs/content/api/CIconSvg.api.mdx b/packages/docs/content/api/CIconSvg.api.mdx deleted file mode 100644 index 808446ad..00000000 --- a/packages/docs/content/api/CIconSvg.api.mdx +++ /dev/null @@ -1,80 +0,0 @@ - -```jsx -import { CIconSvg } from '@coreui/icons-react' -// or -import CIconSvg from '@coreui/icons-react/src/CIconSvg' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    customClassName#-{`string`}, {`string[]`}
    -

    Use for replacing default CIcon component classes. Prop is overriding the 'size' prop.

    -
    height#-{`number`}
    -

    The height attribute defines the vertical length of an icon.

    -
    size#-{`'custom'`}, {`'custom-size'`}, {`'sm'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}, {`'3xl'`}, {`'4xl'`}, {`'5xl'`}, {`'6xl'`}, {`'7xl'`}, {`'8xl'`}, {`'9xl'`}
    -

    Size of the icon. Available sizes: 'sm', 'lg', 'xl', 'xxl', '3xl…9xl', 'custom', 'custom-size'.

    -
    title#-{`string`}
    -

    Title tag content.

    -
    width#-{`number`}
    -

    The width attribute defines the horizontal length of an icon.

    -
    -
    diff --git a/packages/docs/content/api/CImage.api.mdx b/packages/docs/content/api/CImage.api.mdx deleted file mode 100644 index de5157c7..00000000 --- a/packages/docs/content/api/CImage.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CImage } from '@coreui/react' -// or -import CImage from '@coreui/react/src/components/image/CImage' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    align#-{`'start'`}, {`'center'`}, {`'end'`}
    -

    Set the horizontal aligment.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    fluid#-{`boolean`}
    -

    Make image responsive.

    -
    rounded#-{`boolean`}
    -

    Make image rounded.

    -
    thumbnail#-{`boolean`}
    -

    Give an image a rounded 1px border appearance.

    -
    -
    diff --git a/packages/docs/content/api/CInputGroup.api.mdx b/packages/docs/content/api/CInputGroup.api.mdx deleted file mode 100644 index ed37df4f..00000000 --- a/packages/docs/content/api/CInputGroup.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CInputGroup } from '@coreui/react' -// or -import CInputGroup from '@coreui/react/src/components/form/CInputGroup' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    -
    diff --git a/packages/docs/content/api/CInputGroupText.api.mdx b/packages/docs/content/api/CInputGroupText.api.mdx deleted file mode 100644 index b067a1e9..00000000 --- a/packages/docs/content/api/CInputGroupText.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CInputGroupText } from '@coreui/react' -// or -import CInputGroupText from '@coreui/react/src/components/form/CInputGroupText' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'span')`}, {`(ElementType & 'form')`}, {`(ElementType & 'slot')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CLink.api.mdx b/packages/docs/content/api/CLink.api.mdx deleted file mode 100644 index 714ce42e..00000000 --- a/packages/docs/content/api/CLink.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CLink } from '@coreui/react' -// or -import CLink from '@coreui/react/src/components/link/CLink' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    -

    Toggle the active state for the component.

    -
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    -

    A string of all className you want applied to the component.

    -
    -

    Toggle the disabled state for the component.

    -
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -
    diff --git a/packages/docs/content/api/CListGroup.api.mdx b/packages/docs/content/api/CListGroup.api.mdx deleted file mode 100644 index 5846f702..00000000 --- a/packages/docs/content/api/CListGroup.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CListGroup } from '@coreui/react' -// or -import CListGroup from '@coreui/react/src/components/list-group/CListGroup' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    flush#-{`boolean`}
    -

    Remove some borders and rounded corners to render list group items edge-to-edge in a parent component (e.g., {``}).

    -
    layout#-{`'horizontal'`}, {`'horizontal-sm'`}, {`'horizontal-md'`}, {`'horizontal-lg'`}, {`'horizontal-xl'`}, {`'horizontal-xxl'`}
    -

    Specify a layout type.

    -
    -
    diff --git a/packages/docs/content/api/CListGroupItem.api.mdx b/packages/docs/content/api/CListGroupItem.api.mdx deleted file mode 100644 index b2effb43..00000000 --- a/packages/docs/content/api/CListGroupItem.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CListGroupItem } from '@coreui/react' -// or -import CListGroupItem from '@coreui/react/src/components/list-group/CListGroupItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#{`li`}{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'li')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    -
    diff --git a/packages/docs/content/api/CModal.api.mdx b/packages/docs/content/api/CModal.api.mdx deleted file mode 100644 index a8e467cd..00000000 --- a/packages/docs/content/api/CModal.api.mdx +++ /dev/null @@ -1,180 +0,0 @@ - -```jsx -import { CModal } from '@coreui/react' -// or -import CModal from '@coreui/react/src/components/modal/CModal' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    alignment#-{`'top'`}, {`'center'`}
    -

    Align the modal in the center or top of the screen.

    -
    backdrop#{`true`}{`boolean`}, {`'static'`}
    -

    Apply a backdrop on body while modal is open.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    container#5.3.0+-{`Element`}, {`DocumentFragment`}, {`(() => Element | DocumentFragment)`}
    -

    Appends the react modal to a specific element. You can pass an HTML element or function that returns a single element. By default {`document.body`}.

    -
    focus#4.10.0+{`true`}{`boolean`}
    -

    Puts the focus on the modal when shown.

    -
    fullscreen#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}
    -

    Set modal to covers the entire user viewport.

    -
    keyboard#{`true`}{`boolean`}
    -

    Closes the modal when escape key is pressed.

    -
    onClose#-{`() => void`}
    -

    Callback fired when the component requests to be closed.

    -
    onClosePrevented#-{`() => void`}
    -

    Callback fired when the component requests to be closed.

    -
    onShow#-{`() => void`}
    -

    Callback fired when the modal is shown, its backdrop is static and a click outside the modal or an escape key press is performed with the keyboard option set to false.

    -
    portal#{`true`}{`boolean`}
    -

    Generates modal using createPortal.

    -
    scrollable#-{`boolean`}
    -

    Create a scrollable modal that allows scrolling the modal body.

    -
    size#-{`'sm'`}, {`'lg'`}, {`'xl'`}
    -

    Size the component small, large, or extra large.

    -
    transition#{`true`}{`boolean`}
    -

    Remove animation to create modal that simply appear rather than fade in to view.

    -
    unmountOnClose#{`true`}{`boolean`}
    -

    By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.

    -
    visible#-{`boolean`}
    -

    Toggle the visibility of modal component.

    -
    -
    diff --git a/packages/docs/content/api/CModalBody.api.mdx b/packages/docs/content/api/CModalBody.api.mdx deleted file mode 100644 index 6f12c3d7..00000000 --- a/packages/docs/content/api/CModalBody.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CModalBody } from '@coreui/react' -// or -import CModalBody from '@coreui/react/src/components/modal/CModalBody' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CModalContent.api.mdx b/packages/docs/content/api/CModalContent.api.mdx deleted file mode 100644 index 0d4c4280..00000000 --- a/packages/docs/content/api/CModalContent.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CModalContent } from '@coreui/react' -// or -import CModalContent from '@coreui/react/src/components/modal/CModalContent' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CModalDialog.api.mdx b/packages/docs/content/api/CModalDialog.api.mdx deleted file mode 100644 index a4d58792..00000000 --- a/packages/docs/content/api/CModalDialog.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CModalDialog } from '@coreui/react' -// or -import CModalDialog from '@coreui/react/src/components/modal/CModalDialog' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    alignment#-{`'top'`}, {`'center'`}
    -

    Align the modal in the center or top of the screen.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    fullscreen#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}
    -

    Set modal to covers the entire user viewport.

    -
    scrollable#-{`boolean`}
    -

    Does the modal dialog itself scroll, or does the whole dialog scroll within the window.

    -
    size#-{`'sm'`}, {`'lg'`}, {`'xl'`}
    -

    Size the component small, large, or extra large.

    -
    -
    diff --git a/packages/docs/content/api/CModalFooter.api.mdx b/packages/docs/content/api/CModalFooter.api.mdx deleted file mode 100644 index 2ac39de7..00000000 --- a/packages/docs/content/api/CModalFooter.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CModalFooter } from '@coreui/react' -// or -import CModalFooter from '@coreui/react/src/components/modal/CModalFooter' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CModalHeader.api.mdx b/packages/docs/content/api/CModalHeader.api.mdx deleted file mode 100644 index 42f592c5..00000000 --- a/packages/docs/content/api/CModalHeader.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CModalHeader } from '@coreui/react' -// or -import CModalHeader from '@coreui/react/src/components/modal/CModalHeader' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    closeButton#{`true`}{`boolean`}
    -

    Add a close button component to the header.

    -
    -
    diff --git a/packages/docs/content/api/CModalTitle.api.mdx b/packages/docs/content/api/CModalTitle.api.mdx deleted file mode 100644 index 8bc445c1..00000000 --- a/packages/docs/content/api/CModalTitle.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CModalTitle } from '@coreui/react' -// or -import CModalTitle from '@coreui/react/src/components/modal/CModalTitle' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'h5')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CNav.api.mdx b/packages/docs/content/api/CNav.api.mdx deleted file mode 100644 index bb8b1ddd..00000000 --- a/packages/docs/content/api/CNav.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CNav } from '@coreui/react' -// or -import CNav from '@coreui/react/src/components/nav/CNav' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    layout#-{`'fill'`}, {`'justified'`}
    -

    Specify a layout type for component.

    -
    variant#-{`'pills'`}, {`'tabs'`}, {`'underline'`}, {`'underline-border'`}
    -

    Set the nav variant to tabs or pills.

    -
    -
    diff --git a/packages/docs/content/api/CNavGroup.api.mdx b/packages/docs/content/api/CNavGroup.api.mdx deleted file mode 100644 index 590fdd74..00000000 --- a/packages/docs/content/api/CNavGroup.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CNavGroup } from '@coreui/react' -// or -import CNavGroup from '@coreui/react/src/components/nav/CNavGroup' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#5.0.0+-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'li')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    compact#-{`boolean`}
    -

    Make nav group more compact by cutting all {`padding`} in half.

    -
    toggler#-{`ReactNode`}
    -

    Set group toggler label.

    -
    visible#-{`boolean`}
    -

    Show nav group items.

    -
    -
    diff --git a/packages/docs/content/api/CNavGroupItems.api.mdx b/packages/docs/content/api/CNavGroupItems.api.mdx deleted file mode 100644 index b3cd73c9..00000000 --- a/packages/docs/content/api/CNavGroupItems.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CNavGroupItems } from '@coreui/react' -// or -import CNavGroupItems from '@coreui/react/src/components/nav/CNavGroupItems' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#5.0.0+-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CNavItem.api.mdx b/packages/docs/content/api/CNavItem.api.mdx deleted file mode 100644 index 9705e93b..00000000 --- a/packages/docs/content/api/CNavItem.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CNavItem } from '@coreui/react' -// or -import CNavItem from '@coreui/react/src/components/nav/CNavItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#5.0.0+-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'li')`}, {`(ElementType & 'cite')`}, {`(ElementType & 'data')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    href#-{`string`}
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -
    diff --git a/packages/docs/content/api/CNavLink.api.mdx b/packages/docs/content/api/CNavLink.api.mdx deleted file mode 100644 index d99db6a8..00000000 --- a/packages/docs/content/api/CNavLink.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CNavLink } from '@coreui/react' -// or -import CNavLink from '@coreui/react/src/components/nav/CNavLink' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    -

    Toggle the active state for the component.

    -
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    -

    A string of all className you want applied to the component.

    -
    -

    Toggle the disabled state for the component.

    -
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -
    diff --git a/packages/docs/content/api/CNavTitle.api.mdx b/packages/docs/content/api/CNavTitle.api.mdx deleted file mode 100644 index b393d3d7..00000000 --- a/packages/docs/content/api/CNavTitle.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CNavTitle } from '@coreui/react' -// or -import CNavTitle from '@coreui/react/src/components/nav/CNavTitle' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'li')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CNavbar.api.mdx b/packages/docs/content/api/CNavbar.api.mdx deleted file mode 100644 index f26f79ea..00000000 --- a/packages/docs/content/api/CNavbar.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CNavbar } from '@coreui/react' -// or -import CNavbar from '@coreui/react/src/components/navbar/CNavbar' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'nav')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    colorScheme#-{`'dark'`}, {`'light'`}
    -

    Sets if the color of text should be colored for a light or dark background.

    -
    container#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}, {`'fluid'`}
    -

    Defines optional container wrapping children elements.

    -
    expand#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}
    -

    Defines the responsive breakpoint to determine when content collapses.

    -
    placement#-{`'fixed-top'`}, {`'fixed-bottom'`}, {`'sticky-top'`}
    -

    Place component in non-static positions.

    -
    -
    diff --git a/packages/docs/content/api/CNavbarBrand.api.mdx b/packages/docs/content/api/CNavbarBrand.api.mdx deleted file mode 100644 index c05b546e..00000000 --- a/packages/docs/content/api/CNavbarBrand.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CNavbarBrand } from '@coreui/react' -// or -import CNavbarBrand from '@coreui/react/src/components/navbar/CNavbarBrand' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'a')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    href#-{`string`}
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    -
    diff --git a/packages/docs/content/api/CNavbarNav.api.mdx b/packages/docs/content/api/CNavbarNav.api.mdx deleted file mode 100644 index 14d1c0e7..00000000 --- a/packages/docs/content/api/CNavbarNav.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CNavbarNav } from '@coreui/react' -// or -import CNavbarNav from '@coreui/react/src/components/navbar/CNavbarNav' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CNavbarText.api.mdx b/packages/docs/content/api/CNavbarText.api.mdx deleted file mode 100644 index 716bc9a8..00000000 --- a/packages/docs/content/api/CNavbarText.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CNavbarText } from '@coreui/react' -// or -import CNavbarText from '@coreui/react/src/components/navbar/CNavbarText' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CNavbarToggler.api.mdx b/packages/docs/content/api/CNavbarToggler.api.mdx deleted file mode 100644 index 94849ee1..00000000 --- a/packages/docs/content/api/CNavbarToggler.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CNavbarToggler } from '@coreui/react' -// or -import CNavbarToggler from '@coreui/react/src/components/navbar/CNavbarToggler' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/COffcanvas.api.mdx b/packages/docs/content/api/COffcanvas.api.mdx deleted file mode 100644 index 57ddbfb8..00000000 --- a/packages/docs/content/api/COffcanvas.api.mdx +++ /dev/null @@ -1,130 +0,0 @@ - -```jsx -import { COffcanvas } from '@coreui/react' -// or -import COffcanvas from '@coreui/react/src/components/offcanvas/COffcanvas' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    backdrop#{`true`}{`boolean`}, {`'static'`}
    -

    Apply a backdrop on body while offcanvas is open.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    dark#-{`boolean`}
    -

    Sets a darker color scheme.

    -
    keyboard#{`true`}{`boolean`}
    -

    Closes the offcanvas when escape key is pressed.

    -
    onHide#-{`() => void`}
    -

    Callback fired when the component requests to be hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired when the component requests to be shown.

    -
    placement#-{`'start'`}, {`'end'`}, {`'top'`}, {`'bottom'`}
    -

    Components placement, there’s no default placement.

    -
    portal#{`false`}{`boolean`}
    -

    Generates modal using createPortal.

    -
    responsive#4.6.0+{`true`}{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}
    -

    Responsive offcanvas property hide content outside the viewport from a specified breakpoint and down.

    -
    scroll#{`false`}{`boolean`}
    -

    Allow body scrolling while offcanvas is open

    -
    visible#{`false`}{`boolean`}
    -

    Toggle the visibility of offcanvas component.

    -
    -
    diff --git a/packages/docs/content/api/COffcanvasBody.api.mdx b/packages/docs/content/api/COffcanvasBody.api.mdx deleted file mode 100644 index 7baef6ab..00000000 --- a/packages/docs/content/api/COffcanvasBody.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { COffcanvasBody } from '@coreui/react' -// or -import COffcanvasBody from '@coreui/react/src/components/offcanvas/COffcanvasBody' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/COffcanvasHeader.api.mdx b/packages/docs/content/api/COffcanvasHeader.api.mdx deleted file mode 100644 index 02b1c5a1..00000000 --- a/packages/docs/content/api/COffcanvasHeader.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { COffcanvasHeader } from '@coreui/react' -// or -import COffcanvasHeader from '@coreui/react/src/components/offcanvas/COffcanvasHeader' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/COffcanvasTitle.api.mdx b/packages/docs/content/api/COffcanvasTitle.api.mdx deleted file mode 100644 index 05b4767e..00000000 --- a/packages/docs/content/api/COffcanvasTitle.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { COffcanvasTitle } from '@coreui/react' -// or -import COffcanvasTitle from '@coreui/react/src/components/offcanvas/COffcanvasTitle' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'h5')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CPagination.api.mdx b/packages/docs/content/api/CPagination.api.mdx deleted file mode 100644 index 22d8773a..00000000 --- a/packages/docs/content/api/CPagination.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CPagination } from '@coreui/react' -// or -import CPagination from '@coreui/react/src/components/pagination/CPagination' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    align#-{`'start'`}, {`'center'`}, {`'end'`}
    -

    Set the alignment of pagination components.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    -
    diff --git a/packages/docs/content/api/CPaginationItem.api.mdx b/packages/docs/content/api/CPaginationItem.api.mdx deleted file mode 100644 index 3587dabe..00000000 --- a/packages/docs/content/api/CPaginationItem.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CPaginationItem } from '@coreui/react' -// or -import CPaginationItem from '@coreui/react/src/components/pagination/CPaginationItem' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#-{`(ElementType & string)`}, {`(ElementType & ComponentClass\)`}, {`(ElementType & FunctionComponent\)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    -
    diff --git a/packages/docs/content/api/CPlaceholder.api.mdx b/packages/docs/content/api/CPlaceholder.api.mdx deleted file mode 100644 index ad81da9e..00000000 --- a/packages/docs/content/api/CPlaceholder.api.mdx +++ /dev/null @@ -1,130 +0,0 @@ - -```jsx -import { CPlaceholder } from '@coreui/react' -// or -import CPlaceholder from '@coreui/react/src/components/placeholder/CPlaceholder' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    animation#-{`'glow'`}, {`'wave'`}
    -

    Set animation type to better convey the perception of something being actively loaded.

    -
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'span')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    lg#-{`number`}
    -

    The number of columns on large devices (<1200px).

    -
    md#-{`number`}
    -

    The number of columns on medium devices (<992px).

    -
    size#-{`'xs'`}, {`'sm'`}, {`'lg'`}
    -

    Size the component extra small, small, or large.

    -
    sm#-{`number`}
    -

    The number of columns on small devices (<768px).

    -
    xl#-{`number`}
    -

    The number of columns on X-Large devices (<1400px).

    -
    xs#-{`number`}
    -

    The number of columns on extra small devices (<576px).

    -
    xxl#-{`number`}
    -

    The number of columns on XX-Large devices (≥1400px).

    -
    -
    diff --git a/packages/docs/content/api/CPopover.api.mdx b/packages/docs/content/api/CPopover.api.mdx deleted file mode 100644 index 1f381f44..00000000 --- a/packages/docs/content/api/CPopover.api.mdx +++ /dev/null @@ -1,202 +0,0 @@ - -```jsx -import { CPopover } from '@coreui/react' -// or -import CPopover from '@coreui/react/src/components/popover/CPopover' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    animation#4.9.0+{`true`}{`boolean`}
    -

    Adds a fade transition animation to the React Popover.

    -
    className#-{`string`}
    -

    Custom class name(s) for additional styling.

    -
    container#4.11.0+{`document.body`}{`Element`}, {`DocumentFragment`}, {`(() => Element | DocumentFragment)`}
    -

    Defines the container element to which the React Popover is appended.
    -Accepts:

    -
      -
    • A DOM element ({`HTMLElement`} or {`DocumentFragment`})
    • -
    • A function that returns a single element
    • -
    • {`null`} (defaults to {`document.body`})
    • -
    - ...`} /> -
    content#-{`ReactNode`}
    -

    Main content of the React Popover. It can be a string or any valid React node.

    -
    delay#4.9.0+{`0`}{`number`}, {`{ show: number; hide: number; }`}
    -

    Delay (in milliseconds) before showing or hiding the React Popover.

    -
      -
    • If a number is provided, that delay applies to both "show" and "hide".
    • -
    • If an object is provided, use separate values for "show" and "hide".
    • -
    - ... - -// Delays 500ms on show and 100ms on hide -...`} /> -
    fallbackPlacements#4.9.0+{`['top', 'right', 'bottom', 'left']`}{`'top', 'right', 'bottom', 'left'`}, {`('top', 'right', 'bottom', 'left')[]`}
    -

    Specifies the fallback placements when the preferred {`placement`} cannot be met.

    -
    offset#{`[0, 8]`}{`[number, number]`}
    -

    Offset of the React Popover relative to its toggle element, in the form {`[x, y]`}.

    - ... - -// Offset the menu 5px in both X and Y direction -...`} /> -
    onHide#-{`() => void`}
    -

    Invoked when the React Popover is about to hide.

    -
    onShow#-{`() => void`}
    -

    Invoked when the React Popover is about to show.

    -
    placement#{`top`}{`'auto'`}, {`'top'`}, {`'bottom'`}, {`'right'`}, {`'left'`}
    -

    Placement of the React Popover. Popper.js may override this based on available space.

    -
    popperConfig#5.5.0+-{`Partial\`}, {`((defaultPopperConfig: Partial\) => Partial\)`}
    -

    Allows customization of the Popper.js configuration for the React Popover.
    -Can be an object or a function returning a modified configuration.
    -Learn more

    - ({ - ...defaultConfig, - strategy: 'fixed', - modifiers: [ - ...defaultConfig.modifiers, - { name: 'computeStyles', options: { adaptive: false } }, - ], - })} ->...`} /> -
    title#-{`ReactNode`}
    -

    Title for the React Popover header. Can be a string or any valid React node.

    -
    trigger#{`click`}{`'hover'`}, {`'focus'`}, {`'click'`}, {`('hover' | 'focus' | 'click')[]`}
    -

    Determines which events trigger the visibility of the React Popover. Can be a single trigger or an array of triggers.

    - ... - -// Hover + click combined -...`} /> -
    visible#-{`boolean`}
    -

    Controls the visibility of the React Popover.

    -
      -
    • {`true`} shows the popover.
    • -
    • {`false`} hides the popover.
    • -
    -
    -
    diff --git a/packages/docs/content/api/CProgress.api.mdx b/packages/docs/content/api/CProgress.api.mdx deleted file mode 100644 index be1efeea..00000000 --- a/packages/docs/content/api/CProgress.api.mdx +++ /dev/null @@ -1,110 +0,0 @@ - -```jsx -import { CProgress } from '@coreui/react' -// or -import CProgress from '@coreui/react/src/components/progress/CProgress' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    animated#-{`boolean`}
    -

    Use to animate the stripes right to left via CSS3 animations.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    height#-{`number`}
    -

    Sets the height of the component. If you set that value the inner {``} will automatically resize accordingly.

    -
    progressBarClassName#4.9.0+-{`string`}
    -

    A string of all className you want applied to the {``} component.

    -
    thin#-{`boolean`}
    -

    Makes progress bar thinner.

    -
    value#-{`number`}
    -

    The percent to progress the ProgressBar (out of 100).

    -
    variant#-{`'striped'`}
    -

    Set the progress bar variant to optional striped.

    -
    white#-{`boolean`}
    -

    Change the default color to white.

    -
    -
    diff --git a/packages/docs/content/api/CProgressBar.api.mdx b/packages/docs/content/api/CProgressBar.api.mdx deleted file mode 100644 index 481b40ba..00000000 --- a/packages/docs/content/api/CProgressBar.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CProgressBar } from '@coreui/react' -// or -import CProgressBar from '@coreui/react/src/components/progress/CProgressBar' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    animated#-{`boolean`}
    -

    Use to animate the stripes right to left via CSS3 animations.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    value#{`0`}{`number`}
    -

    The percent to progress the ProgressBar.

    -
    variant#-{`'striped'`}
    -

    Set the progress bar variant to optional striped.

    -
    -
    diff --git a/packages/docs/content/api/CProgressStacked.api.mdx b/packages/docs/content/api/CProgressStacked.api.mdx deleted file mode 100644 index 0aa39597..00000000 --- a/packages/docs/content/api/CProgressStacked.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CProgressStacked } from '@coreui/react' -// or -import CProgressStacked from '@coreui/react/src/components/progress/CProgressStacked' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CRow.api.mdx b/packages/docs/content/api/CRow.api.mdx deleted file mode 100644 index 578a2184..00000000 --- a/packages/docs/content/api/CRow.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CRow } from '@coreui/react' -// or -import CRow from '@coreui/react/src/components/grid/CRow' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    lg#-{`{{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }}`}
    -

    The number of columns/offset/order on large devices (<1200px).

    -
    md#-{`{{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }}`}
    -

    The number of columns/offset/order on medium devices (<992px).

    -
    sm#-{`{{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }}`}
    -

    The number of columns/offset/order on small devices (<768px).

    -
    xl#-{`{{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }}`}
    -

    The number of columns/offset/order on X-Large devices (<1400px).

    -
    xs#-{`{{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }}`}
    -

    The number of columns/offset/order on extra small devices (<576px).

    -
    xxl#-{`{{ cols: 'auto' | number | string } | { gutter: number | string } | { gutterX: number | string } | { gutterY: number | string }}`}
    -

    The number of columns/offset/order on XX-Large devices (≥1400px).

    -
    -
    diff --git a/packages/docs/content/api/CSidebar.api.mdx b/packages/docs/content/api/CSidebar.api.mdx deleted file mode 100644 index f6ff8f25..00000000 --- a/packages/docs/content/api/CSidebar.api.mdx +++ /dev/null @@ -1,150 +0,0 @@ - -```jsx -import { CSidebar } from '@coreui/react' -// or -import CSidebar from '@coreui/react/src/components/sidebar/CSidebar' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'div')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    colorScheme#-{`'dark'`}, {`'light'`}
    -

    Sets if the color of text should be colored for a light or dark dark background.

    -
    narrow#-{`boolean`}
    -

    Make sidebar narrow.

    -
    onHide#-{`() => void`}
    -

    Callback fired when the component requests to be hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired when the component requests to be shown.

    -
    onVisibleChange#-{`(visible: boolean) => void`}
    -

    Event emitted after visibility of component changed.

    -
    overlaid#-{`boolean`}
    -

    Set sidebar to overlaid variant.

    -
    placement#-{`'start'`}, {`'end'`}
    -

    Components placement, there’s no default placement.

    -
    position#-{`'fixed'`}, {`'sticky'`}
    -

    Place sidebar in non-static positions.

    -
    size#-{`'sm'`}, {`'lg'`}, {`'xl'`}
    -

    Size the component small, large, or extra large.

    -
    unfoldable#-{`boolean`}
    -

    Expand narrowed sidebar on hover.

    -
    visible#-{`boolean`}
    -

    Toggle the visibility of sidebar component.

    -
    -
    diff --git a/packages/docs/content/api/CSidebarBrand.api.mdx b/packages/docs/content/api/CSidebarBrand.api.mdx deleted file mode 100644 index ef80faed..00000000 --- a/packages/docs/content/api/CSidebarBrand.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CSidebarBrand } from '@coreui/react' -// or -import CSidebarBrand from '@coreui/react/src/components/sidebar/CSidebarBrand' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#5.0.0+-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'a')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CSidebarFooter.api.mdx b/packages/docs/content/api/CSidebarFooter.api.mdx deleted file mode 100644 index b381e326..00000000 --- a/packages/docs/content/api/CSidebarFooter.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CSidebarFooter } from '@coreui/react' -// or -import CSidebarFooter from '@coreui/react/src/components/sidebar/CSidebarFooter' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CSidebarHeader.api.mdx b/packages/docs/content/api/CSidebarHeader.api.mdx deleted file mode 100644 index 0b4d9468..00000000 --- a/packages/docs/content/api/CSidebarHeader.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CSidebarHeader } from '@coreui/react' -// or -import CSidebarHeader from '@coreui/react/src/components/sidebar/CSidebarHeader' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CSidebarNav.api.mdx b/packages/docs/content/api/CSidebarNav.api.mdx deleted file mode 100644 index 635ec4d8..00000000 --- a/packages/docs/content/api/CSidebarNav.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CSidebarNav } from '@coreui/react' -// or -import CSidebarNav from '@coreui/react/src/components/sidebar/CSidebarNav' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#5.0.0+-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'ul')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CSidebarToggler.api.mdx b/packages/docs/content/api/CSidebarToggler.api.mdx deleted file mode 100644 index 89f62377..00000000 --- a/packages/docs/content/api/CSidebarToggler.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CSidebarToggler } from '@coreui/react' -// or -import CSidebarToggler from '@coreui/react/src/components/sidebar/CSidebarToggler' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    -
    diff --git a/packages/docs/content/api/CSpinner.api.mdx b/packages/docs/content/api/CSpinner.api.mdx deleted file mode 100644 index 85bef5fe..00000000 --- a/packages/docs/content/api/CSpinner.api.mdx +++ /dev/null @@ -1,80 +0,0 @@ - -```jsx -import { CSpinner } from '@coreui/react' -// or -import CSpinner from '@coreui/react/src/components/spinner/CSpinner' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    as#-{`(ElementType & 'symbol')`}, {`(ElementType & 'object')`}, {`(ElementType & 'div')`}, {`(ElementType & 'slot')`}, {`(ElementType & 'style')`}, {`... 174 more ...`}, {`(ElementType & FunctionComponent\<...>)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    size#-{`'sm'`}
    -

    Size the component small.

    -
    variant#{`border`}{`'border'`}, {`'grow'`}
    -

    Set the button variant to an outlined button or a ghost button.

    -
    visuallyHiddenLabel#{`Loading...`}{`string`}
    -

    Set visually hidden label for accessibility purposes.

    -
    -
    diff --git a/packages/docs/content/api/CTab.api.mdx b/packages/docs/content/api/CTab.api.mdx deleted file mode 100644 index 96b8adf7..00000000 --- a/packages/docs/content/api/CTab.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CTab } from '@coreui/react' -// or -import CTab from '@coreui/react/src/components/tabs/CTab' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    itemKey#-{`string`}, {`number`}
    -

    Item key.

    -
    -
    diff --git a/packages/docs/content/api/CTabContent.api.mdx b/packages/docs/content/api/CTabContent.api.mdx deleted file mode 100644 index 1ed42368..00000000 --- a/packages/docs/content/api/CTabContent.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CTabContent } from '@coreui/react' -// or -import CTabContent from '@coreui/react/src/components/tabs/CTabContent' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CTabList.api.mdx b/packages/docs/content/api/CTabList.api.mdx deleted file mode 100644 index 3d4a2202..00000000 --- a/packages/docs/content/api/CTabList.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CTabList } from '@coreui/react' -// or -import CTabList from '@coreui/react/src/components/tabs/CTabList' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    layout#-{`'fill'`}, {`'justified'`}
    -

    Specify a layout type for component.

    -
    variant#-{`'pills'`}, {`'tabs'`}, {`'underline'`}, {`'underline-border'`}
    -

    Set the nav variant to tabs or pills.

    -
    -
    diff --git a/packages/docs/content/api/CTabPane.api.mdx b/packages/docs/content/api/CTabPane.api.mdx deleted file mode 100644 index caf5c27b..00000000 --- a/packages/docs/content/api/CTabPane.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CTabPane } from '@coreui/react' -// or -import CTabPane from '@coreui/react/src/components/tabs/CTabPane' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    onHide#-{`() => void`}
    -

    Callback fired when the component requests to be hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired when the component requests to be shown.

    -
    transition#5.1.0+{`true`}{`boolean`}
    -

    Enable fade in and fade out transition.

    -
    visible#-{`boolean`}
    -

    Toggle the visibility of component.

    -
    -
    diff --git a/packages/docs/content/api/CTabPanel.api.mdx b/packages/docs/content/api/CTabPanel.api.mdx deleted file mode 100644 index 704ae2af..00000000 --- a/packages/docs/content/api/CTabPanel.api.mdx +++ /dev/null @@ -1,80 +0,0 @@ - -```jsx -import { CTabPanel } from '@coreui/react' -// or -import CTabPanel from '@coreui/react/src/components/tabs/CTabPanel' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    itemKey#-{`string`}, {`number`}
    -

    Item key.

    -
    onHide#-{`() => void`}
    -

    Callback fired when the component requests to be hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired when the component requests to be shown.

    -
    transition#{`true`}{`boolean`}
    -

    Enable fade in and fade out transition.

    -
    visible#-{`boolean`}
    -

    Toggle the visibility of component.

    -
    -
    diff --git a/packages/docs/content/api/CTable.api.mdx b/packages/docs/content/api/CTable.api.mdx deleted file mode 100644 index 26743c37..00000000 --- a/packages/docs/content/api/CTable.api.mdx +++ /dev/null @@ -1,215 +0,0 @@ - -```jsx -import { CTable } from '@coreui/react' -// or -import CTable from '@coreui/react/src/components/table/CTable' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    align#-{`string`}
    -

    Set the vertical aligment.

    -
    borderColor#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the border color of the component to one of CoreUI’s themed colors.

    -
    bordered#-{`boolean`}
    -

    Add borders on all sides of the table and cells.

    -
    borderless#-{`boolean`}
    -

    Remove borders on all sides of the table and cells.

    -
    caption#-{`string`}
    -

    Put the caption on the top if you set {`caption="top"`} of the table or set the text of the table caption.

    -
    captionTop#4.3.0+-{`string`}
    -

    Set the text of the table caption and the caption on the top of the table.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    columns#4.3.0+-{`(string | Column)[]`}
    -

    Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_props')

    -

    In columns prop each array item represents one column. Item might be specified in two ways:
    -String: each item define column name equal to item value.
    -Object: item is object with following keys available as column configuration:

    -
      -
    • key (required)(String) - define column name equal to item key.
    • -
    • label (String) - define visible label of column. If not defined, label will be generated automatically based on column name, by converting kebab-case and snake_case to individual words and capitalization of each word.
    • -
    • _props (Object) - adds classes to all cels in column, ex. {`_props: { scope: 'col', className: 'custom-class' }`},
    • -
    • _style (Object) - adds styles to the column header (useful for defining widths)
    • -
    -
    -

    Array of objects or strings, where each element represents one cell in the table footer.

    -

    Example items:
    -{`['FooterCell', 'FooterCell', 'FooterCell']`}
    -or
    -{`[{ label: 'FooterCell', _props: { color: 'success' }, ...]`}

    -
    hover#-{`boolean`}
    -

    Enable a hover state on table rows within a {``}.

    -
    items#4.3.0+-{`Item[]`}
    -

    Array of objects, where each object represents one item - row in table. Additionally, you can add style classes to each row by passing them by 'props' key and to single cell by 'cellProps'.

    -

    Example item:
    -{`{ name: 'John' , age: 12, _props: { color: 'success' }, _cellProps: { age: { className: 'fw-bold'}}}`}

    -
    responsive#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}
    -

    Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to.

    -
    small#-{`boolean`}
    -

    Make table more compact by cutting all cell {`padding`} in half.

    -
    striped#-{`boolean`}
    -

    Add zebra-striping to any table row within the {``}.

    -
    stripedColumns#4.3.0+-{`boolean`}
    -

    Add zebra-striping to any table column.

    -
    tableFootProps#4.3.0+-{`CTableFootProps`}
    -

    Properties that will be passed to the table footer component.

    -
    tableHeadProps#4.3.0+-{`CTableHeadProps`}
    -

    Properties that will be passed to the table head component.

    -
    -
    diff --git a/packages/docs/content/api/CTableBody.api.mdx b/packages/docs/content/api/CTableBody.api.mdx deleted file mode 100644 index f97cb4dc..00000000 --- a/packages/docs/content/api/CTableBody.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CTableBody } from '@coreui/react' -// or -import CTableBody from '@coreui/react/src/components/table/CTableBody' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CTableCaption.api.mdx b/packages/docs/content/api/CTableCaption.api.mdx deleted file mode 100644 index 73372f90..00000000 --- a/packages/docs/content/api/CTableCaption.api.mdx +++ /dev/null @@ -1,10 +0,0 @@ - -```jsx -import { CTableCaption } from '@coreui/react' -// or -import CTableCaption from '@coreui/react/src/components/table/CTableCaption' -``` - - - -
    diff --git a/packages/docs/content/api/CTableDataCell.api.mdx b/packages/docs/content/api/CTableDataCell.api.mdx deleted file mode 100644 index bd076614..00000000 --- a/packages/docs/content/api/CTableDataCell.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CTableDataCell } from '@coreui/react' -// or -import CTableDataCell from '@coreui/react/src/components/table/CTableDataCell' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Highlight a table row or cell.

    -
    align#-{`string`}
    -

    Set the vertical aligment.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CTableFoot.api.mdx b/packages/docs/content/api/CTableFoot.api.mdx deleted file mode 100644 index 532b8d60..00000000 --- a/packages/docs/content/api/CTableFoot.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CTableFoot } from '@coreui/react' -// or -import CTableFoot from '@coreui/react/src/components/table/CTableFoot' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CTableHead.api.mdx b/packages/docs/content/api/CTableHead.api.mdx deleted file mode 100644 index 3c7b6463..00000000 --- a/packages/docs/content/api/CTableHead.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CTableHead } from '@coreui/react' -// or -import CTableHead from '@coreui/react/src/components/table/CTableHead' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CTableHeaderCell.api.mdx b/packages/docs/content/api/CTableHeaderCell.api.mdx deleted file mode 100644 index 504b445d..00000000 --- a/packages/docs/content/api/CTableHeaderCell.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CTableHeaderCell } from '@coreui/react' -// or -import CTableHeaderCell from '@coreui/react/src/components/table/CTableHeaderCell' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CTableResponsiveWrapper.api.mdx b/packages/docs/content/api/CTableResponsiveWrapper.api.mdx deleted file mode 100644 index 31079177..00000000 --- a/packages/docs/content/api/CTableResponsiveWrapper.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CTableResponsiveWrapper } from '@coreui/react' -// or -import CTableResponsiveWrapper from '@coreui/react/src/components/table/CTableResponsiveWrapper' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    responsive#-{`boolean`}, {`'sm'`}, {`'md'`}, {`'lg'`}, {`'xl'`}, {`'xxl'`}
    -

    Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to.

    -
    -
    diff --git a/packages/docs/content/api/CTableRow.api.mdx b/packages/docs/content/api/CTableRow.api.mdx deleted file mode 100644 index e38e513a..00000000 --- a/packages/docs/content/api/CTableRow.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CTableRow } from '@coreui/react' -// or -import CTableRow from '@coreui/react/src/components/table/CTableRow' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Highlight a table row or cell..

    -
    align#-{`string`}
    -

    Set the vertical aligment.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -
    diff --git a/packages/docs/content/api/CTabs.api.mdx b/packages/docs/content/api/CTabs.api.mdx deleted file mode 100644 index 18290159..00000000 --- a/packages/docs/content/api/CTabs.api.mdx +++ /dev/null @@ -1,72 +0,0 @@ - -```jsx -import { CTabs } from '@coreui/react' -// or -import CTabs from '@coreui/react/src/components/tabs/CTabs' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    activeItemKey#-{`string`}, {`number`}
    -

    Controls the currently active tab.

    -

    When provided, the component operates in a controlled mode.
    -You must handle tab switching manually by updating this prop.

    - `} /> -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    defaultActiveItemKey#-{`string`}, {`number`}
    -

    Sets the initially active tab when the component mounts.

    -

    After initialization, the component manages active tab changes internally.

    -

    Use {`defaultActiveItemKey`} for uncontrolled usage.

    - `} /> -
    onChange#-{`(value: string | number) => void`}
    -

    Callback fired when the active tab changes.

    -
      -
    • In controlled mode ({`activeItemKey`} provided), you must update {`activeItemKey`} yourself based on the value received.
    • -
    • In uncontrolled mode, this callback is called after internal state updates.
    • -
    - console.log('Tab changed to', key)} />`} /> -
    -
    diff --git a/packages/docs/content/api/CToast.api.mdx b/packages/docs/content/api/CToast.api.mdx deleted file mode 100644 index 67c568fa..00000000 --- a/packages/docs/content/api/CToast.api.mdx +++ /dev/null @@ -1,100 +0,0 @@ - -```jsx -import { CToast } from '@coreui/react' -// or -import CToast from '@coreui/react/src/components/toast/CToast' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    animation#{`true`}{`boolean`}
    -

    Apply a CSS fade transition to the toast.

    -
    autohide#{`true`}{`boolean`}
    -

    Auto hide the toast.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    delay#{`5000`}{`number`}
    -

    Delay hiding the toast (ms).

    -
    onClose#-{`(index: number) => void`}
    -

    Callback fired when the component requests to be closed.

    -
    onShow#-{`(index: number) => void`}
    -

    Callback fired when the component requests to be shown.

    -
    visible#{`false`}{`boolean`}
    -

    Toggle the visibility of component.

    -
    -
    diff --git a/packages/docs/content/api/CToastBody.api.mdx b/packages/docs/content/api/CToastBody.api.mdx deleted file mode 100644 index 7227bece..00000000 --- a/packages/docs/content/api/CToastBody.api.mdx +++ /dev/null @@ -1,30 +0,0 @@ - -```jsx -import { CToastBody } from '@coreui/react' -// or -import CToastBody from '@coreui/react/src/components/toast/CToastBody' -``` - -
    - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    -
    diff --git a/packages/docs/content/api/CToastClose.api.mdx b/packages/docs/content/api/CToastClose.api.mdx deleted file mode 100644 index f96a63a0..00000000 --- a/packages/docs/content/api/CToastClose.api.mdx +++ /dev/null @@ -1,131 +0,0 @@ - -```jsx -import { CToastClose } from '@coreui/react' -// or -import CToastClose from '@coreui/react/src/components/toast/CToastClose' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    active#-{`boolean`}
    -

    Toggle the active state for the component.

    -
    as#-{`(ElementType & string)`}, {`(ElementType & ComponentClass\)`}, {`(ElementType & FunctionComponent\)`}
    -

    Component used for the root node. Either a string to use a HTML element or a component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    dark#-{`boolean`}
    -

    Invert the default color.

    -
    disabled#-{`boolean`}
    -

    Toggle the disabled state for the component.

    -
    href#-{`string`}
    -

    The href attribute specifies the URL of the page the link goes to.

    -
    shape#-{`'rounded'`}, {`'rounded-top'`}, {`'rounded-end'`}, {`'rounded-bottom'`}, {`'rounded-start'`}, {`'rounded-circle'`}, {`'rounded-pill'`}, {`'rounded-0'`}, {`'rounded-1'`}, {`'rounded-2'`}, {`'rounded-3'`}, {`string`}
    -

    Select the shape of the component.

    -
    size#-{`'sm'`}, {`'lg'`}
    -

    Size the component small or large.

    -
    type#-{`'button'`}, {`'submit'`}, {`'reset'`}
    -

    Specifies the type of button. Always specify the type attribute for the {`

    variant#-{`'outline'`}, {`'ghost'`}
    -

    Set the button variant to an outlined button or a ghost button.

    -
    white#Deprecated 5.0.0-{`boolean`}
    -

    Change the default color to white.

    -
    -
    diff --git a/packages/docs/content/api/CToastHeader.api.mdx b/packages/docs/content/api/CToastHeader.api.mdx deleted file mode 100644 index b3412e05..00000000 --- a/packages/docs/content/api/CToastHeader.api.mdx +++ /dev/null @@ -1,40 +0,0 @@ - -```jsx -import { CToastHeader } from '@coreui/react' -// or -import CToastHeader from '@coreui/react/src/components/toast/CToastHeader' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    closeButton#-{`boolean`}
    -

    Automatically add a close button to the header.

    -
    -
    diff --git a/packages/docs/content/api/CToaster.api.mdx b/packages/docs/content/api/CToaster.api.mdx deleted file mode 100644 index a0738d3f..00000000 --- a/packages/docs/content/api/CToaster.api.mdx +++ /dev/null @@ -1,50 +0,0 @@ - -```jsx -import { CToaster } from '@coreui/react' -// or -import CToaster from '@coreui/react/src/components/toast/CToaster' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    placement#-{`'top-start'`}, {`'top'`}, {`'top-end'`}, {`'middle-start'`}, {`'middle'`}, {`'middle-end'`}, {`'bottom-start'`}, {`'bottom'`}, {`'bottom-end'`}, {`string`}
    -

    Describes the placement of your component.

    -
    push#-{`ReactElement`}
    -

    Adds new {`CToast`} to {`CToaster`}.

    -
    -
    diff --git a/packages/docs/content/api/CTooltip.api.mdx b/packages/docs/content/api/CTooltip.api.mdx deleted file mode 100644 index 74a7e295..00000000 --- a/packages/docs/content/api/CTooltip.api.mdx +++ /dev/null @@ -1,189 +0,0 @@ - -```jsx -import { CTooltip } from '@coreui/react' -// or -import CTooltip from '@coreui/react/src/components/tooltip/CTooltip' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    animation#4.9.0+{`true`}{`boolean`}
    -

    Enables or disables the CSS fade transition for the React Tooltip.

    -
    className#-{`string`}
    -

    Adds a custom class name to the React Tooltip container. Useful for overriding default styles or applying additional design choices.

    -
    container#4.11.0+{`document.body`}{`Element`}, {`DocumentFragment`}, {`(() => Element | DocumentFragment)`}
    -

    Appends the React Tooltip to a specific element instead of the default {`document.body`}. You may pass:

    -
      -
    • A DOM element ({`HTMLElement`} or {`DocumentFragment`})
    • -
    • A function that returns a single element
    • -
    • {`null`}
    • -
    - ...`} /> -
    content#-{`ReactNode`}
    -

    Content to be displayed within the React Tooltip. Can be a string or any valid React node.

    -
    delay#4.9.0+{`0`}{`number`}, {`{ show: number; hide: number; }`}
    -

    The delay (in milliseconds) before showing or hiding the React Tooltip.

    -
      -
    • If provided as a number, the delay is applied to both "show" and "hide".
    • -
    • If provided as an object, it should have distinct "show" and "hide" values.
    • -
    - ... - -// Delays 500ms on show and 100ms on hide -...`} /> -
    fallbackPlacements#4.9.0+{`['top', 'right', 'bottom', 'left']`}{`'top', 'right', 'bottom', 'left'`}, {`('top', 'right', 'bottom', 'left')[]`}
    -

    Array of fallback placements for the React Tooltip to use when the preferred placement cannot be achieved. These placements are tried in order.

    -
    offset#{`[0, 6]`}{`[number, number]`}
    -

    Adjusts the offset of the React Tooltip relative to its target. Expects a tuple {`[x-axis, y-axis]`}.

    - ... - -// Offset the menu 5px in both X and Y direction -...`} /> -
    onHide#-{`() => void`}
    -

    Callback fired immediately after the React Tooltip is hidden.

    -
    onShow#-{`() => void`}
    -

    Callback fired immediately after the React Tooltip is shown.

    -
    placement#{`top`}{`'auto'`}, {`'top'`}, {`'bottom'`}, {`'right'`}, {`'left'`}
    -

    Initial placement of the React Tooltip. Note that Popper.js modifiers may alter this placement automatically if there's insufficient space in the chosen position.

    -
    popperConfig#5.5.0+-{`Partial\`}, {`((defaultPopperConfig: Partial\) => Partial\)`}
    -

    Customize the Popper.js configuration used to position the React Tooltip. Pass either an object or a function returning a modified config. Learn more

    - ({ - ...defaultConfig, - strategy: 'fixed', - modifiers: [ - ...defaultConfig.modifiers, - { name: 'computeStyles', options: { adaptive: false } }, - ], - })} ->...`} /> -
    trigger#{`['hover', 'focus']`}{`'hover'`}, {`'focus'`}, {`'click'`}, {`('hover' | 'focus' | 'click')[]`}
    -

    Determines the events that toggle the visibility of the React Tooltip. Can be a single trigger or an array of triggers.

    - ... - -// Hover + click combined -...`} /> -
    visible#-{`boolean`}
    -

    Controls the visibility of the React Tooltip.

    -
      -
    • {`true`} to show the tooltip.
    • -
    • {`false`} to hide the tooltip.
    • -
    -
    -
    diff --git a/packages/docs/content/api/CWidgetStatsA.api.mdx b/packages/docs/content/api/CWidgetStatsA.api.mdx deleted file mode 100644 index c67a83f0..00000000 --- a/packages/docs/content/api/CWidgetStatsA.api.mdx +++ /dev/null @@ -1,80 +0,0 @@ - -```jsx -import { CWidgetStatsA } from '@coreui/react' -// or -import CWidgetStatsA from '@coreui/react/src/components/widgets/CWidgetStatsA' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    action#-{`ReactNode`}
    -

    Action node for your component.

    -
    chart#-{`ReactNode`}
    -

    Chart node for your component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    title#-{`ReactNode`}
    -

    Title node for your component.

    -
    value#-{`ReactNode`}
    -

    Value node for your component.

    -
    -
    diff --git a/packages/docs/content/api/CWidgetStatsB.api.mdx b/packages/docs/content/api/CWidgetStatsB.api.mdx deleted file mode 100644 index 87136d52..00000000 --- a/packages/docs/content/api/CWidgetStatsB.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CWidgetCWidgetStatsB } from '@coreui/react' -// or -import CWidgetCWidgetStatsB from '@coreui/react/src/components/widgets/CWidgetStatsB' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    inverse#-{`boolean`}
    -

    Colors have been inverted from their default dark shade.

    -
    progress#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the progress bar to one of CoreUI’s themed colors.

    -
    text#-{`string`}
    -

    Helper text for your component.

    -
    title#-{`ReactNode`}
    -

    Title node for your component.

    -
    value#-{`ReactNode`}
    -

    Value node for your component.

    -
    -
    diff --git a/packages/docs/content/api/CWidgetStatsC.api.mdx b/packages/docs/content/api/CWidgetStatsC.api.mdx deleted file mode 100644 index d0e62bc7..00000000 --- a/packages/docs/content/api/CWidgetStatsC.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CWidgetStatsCWidgetStatsC } from '@coreui/react' -// or -import CWidgetStatsCWidgetStatsC from '@coreui/react/src/components/widgets/CWidgetStatsC' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    icon#-{`ReactNode`}
    -

    Icon node for your component.

    -
    inverse#-{`boolean`}
    -

    Colors have been inverted from their default dark shade.

    -
    progress#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the progress bar to one of CoreUI’s themed colors.

    -
    title#-{`ReactNode`}
    -

    Title node for your component.

    -
    value#-{`ReactNode`}
    -

    Value node for your component.

    -
    -
    diff --git a/packages/docs/content/api/CWidgetStatsD.api.mdx b/packages/docs/content/api/CWidgetStatsD.api.mdx deleted file mode 100644 index dc00f1c8..00000000 --- a/packages/docs/content/api/CWidgetStatsD.api.mdx +++ /dev/null @@ -1,70 +0,0 @@ - -```jsx -import { CWidgetStatsD } from '@coreui/react' -// or -import CWidgetStatsD from '@coreui/react/src/components/widgets/CWidgetStatsD' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    chart#-{`ReactNode`}
    -

    Chart node for your component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    icon#-{`ReactNode`}
    -

    Icon node for your component.

    -
    values#-{`Value[]`}
    -

    Values and titles for your component.

    -
    -
    diff --git a/packages/docs/content/api/CWidgetStatsE.api.mdx b/packages/docs/content/api/CWidgetStatsE.api.mdx deleted file mode 100644 index 01db0735..00000000 --- a/packages/docs/content/api/CWidgetStatsE.api.mdx +++ /dev/null @@ -1,60 +0,0 @@ - -```jsx -import { CWidgetStatsE } from '@coreui/react' -// or -import CWidgetStatsE from '@coreui/react/src/components/widgets/CWidgetStatsE' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    chart#-{`ReactNode`}
    -

    Chart node for your component.

    -
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    title#-{`ReactNode`}
    -

    Title node for your component.

    -
    value#-{`ReactNode`}
    -

    Value node for your component.

    -
    -
    diff --git a/packages/docs/content/api/CWidgetStatsF.api.mdx b/packages/docs/content/api/CWidgetStatsF.api.mdx deleted file mode 100644 index e9caf466..00000000 --- a/packages/docs/content/api/CWidgetStatsF.api.mdx +++ /dev/null @@ -1,90 +0,0 @@ - -```jsx -import { CWidgetStatsF } from '@coreui/react' -// or -import CWidgetStatsF from '@coreui/react/src/components/widgets/CWidgetStatsF' -``` - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDefaultType
    className#-{`string`}
    -

    A string of all className you want applied to the base component.

    -
    color#-{`'primary'`}, {`'secondary'`}, {`'success'`}, {`'danger'`}, {`'warning'`}, {`'info'`}, {`'dark'`}, {`'light'`}, {`string`}
    -

    Sets the color context of the component to one of CoreUI’s themed colors.

    -
    -

    Footer node for your component.

    -
    icon#-{`ReactNode`}
    -

    Icon node for your component.

    -
    padding#{`true`}{`boolean`}
    -

    Set padding of your component.

    -
    title#-{`ReactNode`}
    -

    Title node for your component.

    -
    value#-{`ReactNode`}
    -

    Value node for your component.

    -
    -
    diff --git a/packages/docs/content/components/accordion/accessibility.mdx b/packages/docs/content/components/accordion/accessibility.mdx deleted file mode 100644 index 8dd1f95b..00000000 --- a/packages/docs/content/components/accordion/accessibility.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: React Accordion Component Accesibility -name: Accordion Accesibility -description: Detailed overview of the accessibility features implemented in CoreUI React Accordion, ensuring compliance with WAI-ARIA guidelines. -route: /components/accordion/ ---- - -## Accessible React Accordion - -Accordions are a common UI pattern used to toggle the visibility of content. Ensuring that accordions are accessible is crucial for users who rely on assistive technologies. This guide demonstrates how to create an accessible accordion using CoreUI React components, adhering to the [WAI-ARIA Accordion Design Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/). - -### Semantic Structure - -- **Button Headers**: Each accordion header is rendered as a native ` -``` - -#### Semantic icons - -The description that you must set using the title property will be used by CoreUI React Icon Component to generate alternative text for the semantic icon. - -Thus, if your markup appears as follows: - -```jsx - - - -``` - -CoreUI React Icon Component will make the necessary adjustments so that only screenreaders can "see" the supporting elements that convey the message. - -```html - -``` - -## Available react icons - -The CoreUI React Icons package includes a comprehensive library of more than 1500 icons, available in various formats such as SVG, PNG, and Webfonts. These popular icons are meticulously crafted symbols representing common actions and items. You can utilize them in your digital products, whether they are web or mobile applications, to enhance their visual appeal and user experience. - -By leveraging the capabilities of the React Icons component from CoreUI, you can easily incorporate visually appealing icons into their React applications, allowing for more engaging and intuitive user interfaces. - -export const LinearExample = () => { - const icons = ['cilAccountLogout', 'cilActionRedo', 'cilActionUndo', 'cilAddressBook', 'cilAirplaneModeOff', 'cilAirplaneMode', 'cilAirplay', 'cilAlarm', 'cilAlbum', 'cilAlignCenter', 'cilAlignLeft', 'cilAlignRight', 'cilAmericanFootball', 'cilAnimal', 'cilAperture', 'cilApple', 'cilApplicationsSettings', 'cilApplications', 'cilAppsSettings', 'cilApps', 'cilArrowBottom', 'cilArrowCircleBottom', 'cilArrowCircleLeft', 'cilArrowCircleRight', 'cilArrowCircleTop', 'cilArrowLeft', 'cilArrowRight', 'cilArrowThickBottom', 'cilArrowThickFromBottom', 'cilArrowThickFromLeft', 'cilArrowThickFromRight', 'cilArrowThickFromTop', 'cilArrowThickLeft', 'cilArrowThickRight', 'cilArrowThickToBottom', 'cilArrowThickToLeft', 'cilArrowThickToRight', 'cilArrowThickToTop', 'cilArrowThickTop', 'cilArrowTop', 'cilAssistiveListeningSystem', 'cilAsteriskCircle', 'cilAsterisk', 'cilAt', 'cilAudioDescription', 'cilAudioSpectrum', 'cilAudio', 'cilAvTimer', 'cilBabyCarriage', 'cilBaby', 'cilBackspace', 'cilBadge', 'cilBalanceScale', 'cilBan', 'cilBank', 'cilBarChart', 'cilBarcode', 'cilBaseball', 'cilBasket', 'cilBasketball', 'cilBath', 'cilBathroom', 'cilBattery0', 'cilBattery3', 'cilBattery5', 'cilBatteryAlert', 'cilBatteryEmpty', 'cilBatteryFull', 'cilBatterySlash', 'cilBeachAccess', 'cilBeaker', 'cilBed', 'cilBellExclamation', 'cilBell', 'cilBike', 'cilBirthdayCake', 'cilBlind', 'cilBluetooth', 'cilBlurCircular', 'cilBlurLinear', 'cilBlur', 'cilBoatAlt', 'cilBold', 'cilBoltCircle', 'cilBolt', 'cilBook', 'cilBookmark', 'cilBorderAll', 'cilBorderBottom', 'cilBorderClear', 'cilBorderHorizontal', 'cilBorderInner', 'cilBorderLeft', 'cilBorderOuter', 'cilBorderRight', 'cilBorderStyle', 'cilBorderTop', 'cilBorderVertical', 'cilBowling', 'cilBraille', 'cilBriefcase', 'cilBrightness', 'cilBritishPound', 'cilBrowser', 'cilBrushAlt', 'cilBrush', 'cilBug', 'cilBuilding', 'cilBullhorn', 'cilBurger', 'cilBurn', 'cilBusAlt', 'cilCalculator', 'cilCalendarCheck', 'cilCalendar', 'cilCameraControl', 'cilCameraRoll', 'cilCamera', 'cilCarAlt', 'cilCaretBottom', 'cilCaretLeft', 'cilCaretRight', 'cilCaretTop', 'cilCart', 'cilCash', 'cilCasino', 'cilCast', 'cilCat', 'cilCc', 'cilCenterFocus', 'cilChartLine', 'cilChartPie', 'cilChart', 'cilChatBubble', 'cilCheckAlt', 'cilCheckCircle', 'cilCheck', 'cilChevronBottom', 'cilChevronCircleDownAlt', 'cilChevronCircleLeftAlt', 'cilChevronCircleRightAlt', 'cilChevronCircleUpAlt', 'cilChevronDoubleDown', 'cilChevronDoubleLeft', 'cilChevronDoubleRight', 'cilChevronDoubleUp', 'cilChevronLeft', 'cilChevronRight', 'cilChevronTop', 'cilChildFriendly', 'cilChild', 'cilCircle', 'cilClearAll', 'cilClipboard', 'cilClock', 'cilClone', 'cilClosedCaptioning', 'cilCloudDownload', 'cilCloudUpload', 'cilCloud', 'cilCloudy', 'cilCode', 'cilCoffee', 'cilCog', 'cilColorBorder', 'cilColorFill', 'cilColorPalette', 'cilColumns', 'cilCommand', 'cilCommentBubble', 'cilCommentSquare', 'cilCompass', 'cilCompress', 'cilContact', 'cilContrast', 'cilControl', 'cilCopy', 'cilCouch', 'cilCreditCard', 'cilCropRotate', 'cilCrop', 'cilCursorMove', 'cilCursor', 'cilCut', 'cilDataTransferDown', 'cilDataTransferUp', 'cilDeaf', 'cilDelete', 'cilDescription', 'cilDevices', 'cilDialpad', 'cilDiamond', 'cilDinner', 'cilDisabled', 'cilDog', 'cilDollar', 'cilDoor', 'cilDoubleQuoteSansLeft', 'cilDoubleQuoteSansRight', 'cilDrinkAlcohol', 'cilDrink', 'cilDrop', 'cilEco', 'cilEducation', 'cilElevator', 'cilEnvelopeClosed', 'cilEnvelopeLetter', 'cilEnvelopeOpen', 'cilEqualizer', 'cilEthernet', 'cilEuro', 'cilExcerpt', 'cilExitToApp', 'cilExpandDown', 'cilExpandLeft', 'cilExpandRight', 'cilExpandUp', 'cilExposure', 'cilExternalLink', 'cilEyedropper', 'cilFaceDead', 'cilFace', 'cilFactorySlash', 'cilFactory', 'cilFastfood', 'cilFax', 'cilFeaturedPlaylist', 'cilFile', 'cilFilterFrames', 'cilFilterPhoto', 'cilFilterSquare', 'cilFilterX', 'cilFilter', 'cilFindInPage', 'cilFingerprint', 'cilFire', 'cilFlagAlt', 'cilFlightTakeoff', 'cilFlipToBack', 'cilFlipToFront', 'cilFlip', 'cilFlower', 'cilFolderOpen', 'cilFolder', 'cilFont', 'cilFootball', 'cilFork', 'cilFridge', 'cilFrown', 'cilFullscreenExit', 'cilFullscreen', 'cilFunctionsAlt', 'cilFunctions', 'cilGamepad', 'cilGarage', 'cilGem', 'cilGif', 'cilGift', 'cilGlobeAlt', 'cilGolfAlt', 'cilGolf', 'cilGradient', 'cilGrain', 'cilGraph', 'cilGridSlash', 'cilGrid', 'cilGroup', 'cilHamburgerMenu', 'cilHandPointDown', 'cilHandPointLeft', 'cilHandPointRight', 'cilHandPointUp', 'cilHappy', 'cilHd', 'cilHdr', 'cilHeader', 'cilHeadphones', 'cilHealing', 'cilHeart', 'cilHighlighter', 'cilHighligt', 'cilHistory', 'cilHome', 'cilHospital', 'cilHotTub', 'cilHouse', 'cilHttps', 'cilImageBroken', 'cilImagePlus', 'cilImage', 'cilInbox', 'cilIndentDecrease', 'cilIndentIncrease', 'cilIndustrySlash', 'cilIndustry', 'cilInfinity', 'cilInfo', 'cilInputHdmi', 'cilInputPower', 'cilInput', 'cilInstitution', 'cilItalic', 'cilJustifyCenter', 'cilJustifyLeft', 'cilJustifyRight', 'cilKeyboard', 'cilLan', 'cilLanguage', 'cilLaptop', 'cilLayers', 'cilLeaf', 'cilLemon', 'cilLevelDown', 'cilLevelUp', 'cilLibraryAdd', 'cilLibraryBuilding', 'cilLibrary', 'cilLifeRing', 'cilLightbulb', 'cilLineSpacing', 'cilLineStyle', 'cilLineWeight', 'cilLinkAlt', 'cilLinkBroken', 'cilLink', 'cilListFilter', 'cilListHighPriority', 'cilListLowPriority', 'cilListNumberedRtl', 'cilListNumbered', 'cilListRich', 'cilList', 'cilLocationPin', 'cilLockLocked', 'cilLockUnlocked', 'cilLocomotive', 'cilLoop1', 'cilLoopCircular', 'cilLoop', 'cilLowVision', 'cilMagnifyingGlass', 'cilMap', 'cilMediaEject', 'cilMediaPause', 'cilMediaPlay', 'cilMediaRecord', 'cilMediaSkipBackward', 'cilMediaSkipForward', 'cilMediaStepBackward', 'cilMediaStepForward', 'cilMediaStop', 'cilMedicalCross', 'cilMeh', 'cilMemory', 'cilMenu', 'cilMic', 'cilMicrophone', 'cilMinus', 'cilMobileLandscape', 'cilMobile', 'cilMoney', 'cilMonitor', 'cilMoodBad', 'cilMoodGood', 'cilMoodVeryBad', 'cilMoodVeryGood', 'cilMoon', 'cilMouse', 'cilMouthSlash', 'cilMove', 'cilMovie', 'cilMugTea', 'cilMug', 'cilMusicNote', 'cilNewspaper', 'cilNoteAdd', 'cilNotes', 'cilObjectGroup', 'cilObjectUngroup', 'cilOpacity', 'cilOpentype', 'cilOptions', 'cilPaintBucket', 'cilPaint', 'cilPaperPlane', 'cilPaperclip', 'cilParagraph', 'cilPaw', 'cilPenAlt', 'cilPenNib', 'cilPen', 'cilPencil', 'cilPeople', 'cilPhone', 'cilPin', 'cilPizza', 'cilPlant', 'cilPlaylistAdd', 'cilPlus', 'cilPool', 'cilPowerStandby', 'cilPregnant', 'cilPrint', 'cilPushchair', 'cilPuzzle', 'cilQrCode', 'cilRain', 'cilRectangle', 'cilRecycle', 'cilReload', 'cilReportSlash', 'cilResizeBoth', 'cilResizeHeight', 'cilResizeWidth', 'cilRestaurant', 'cilRoom', 'cilRouter', 'cilRowing', 'cilRss', 'cilRuble', 'cilRunning', 'cilSad', 'cilSatelite', 'cilSave', 'cilSchool', 'cilScreenDesktop', 'cilScreenSmartphone', 'cilScrubber', 'cilSearch', 'cilSend', 'cilSettings', 'cilShareAll', 'cilShareAlt', 'cilShareBoxed', 'cilShare', 'cilShieldAlt', 'cilShortText', 'cilShower', 'cilSignLanguage', 'cilSignalCellular0', 'cilSignalCellular3', 'cilSignalCellular4', 'cilSim', 'cilSitemap', 'cilSmilePlus', 'cilSmile', 'cilSmokeFree', 'cilSmokeSlash', 'cilSmoke', 'cilSmokingRoom', 'cilSnowflake', 'cilSoccer', 'cilSofa', 'cilSortAlphaDown', 'cilSortAlphaUp', 'cilSortAscending', 'cilSortDescending', 'cilSortNumericDown', 'cilSortNumericUp', 'cilSpa', 'cilSpaceBar', 'cilSpeak', 'cilSpeaker', 'cilSpeech', 'cilSpeedometer', 'cilSpreadsheet', 'cilSquare', 'cilStarHalf', 'cilStar', 'cilStorage', 'cilStream', 'cilStrikethrough', 'cilSun', 'cilSwapHorizontal', 'cilSwapVertical', 'cilSwimming', 'cilSync', 'cilTablet', 'cilTag', 'cilTags', 'cilTask', 'cilTaxi', 'cilTennisBall', 'cilTennis', 'cilTerminal', 'cilTerrain', 'cilTextShapes', 'cilTextSize', 'cilTextSquare', 'cilTextStrike', 'cilText', 'cilThumbDown', 'cilThumbUp', 'cilToggleOff', 'cilToggleOn', 'cilToilet', 'cilTouchApp', 'cilTransfer', 'cilTranslate', 'cilTrash', 'cilTriangle', 'cilTruck', 'cilTv', 'cilUnderline', 'cilUsb', 'cilUserFemale', 'cilUserFollow', 'cilUserPlus', 'cilUserUnfollow', 'cilUserX', 'cilUser', 'cilVector', 'cilVerticalAlignBottom', 'cilVerticalAlignCenter', 'cilVerticalAlignTop', 'cilVideo', 'cilVideogame', 'cilViewColumn', 'cilViewModule', 'cilViewQuilt', 'cilViewStream', 'cilVoiceOverRecord', 'cilVoice', 'cilVolumeHigh', 'cilVolumeLow', 'cilVolumeOff', 'cilWalk', 'cilWallet', 'cilWallpaper', 'cilWarning', 'cilWatch', 'cilWc', 'cilWeightlifitng', 'cilWheelchair', 'cilWifiSignal0', 'cilWifiSignal1', 'cilWifiSignal2', 'cilWifiSignal3', 'cilWifiSignal4', 'cilWifiSignalOff', 'cilWindowMaximize', 'cilWindowMinimize', 'cilWindowRestore', 'cilWindow', 'cilWrapText', 'cilXCircle', 'cilX', 'cilYen', 'cilZoomIn', 'cilZoomOut', 'cilZoom'] - return ( - - {icons.map((i, idx) => { - return ( - -
    - -
    -
    {i}
    -
    ) - })} -
    - ) -} - -export const BrandExample = () => { - const icons = ['cib500px5', 'cib500px', 'cibAboutMe', 'cibAbstract', 'cibAcm', 'cibAddthis', 'cibAdguard', 'cibAdobeAcrobatReader', 'cibAdobeAfterEffects', 'cibAdobeAudition', 'cibAdobeCreativeCloud', 'cibAdobeDreamweaver', 'cibAdobeIllustrator', 'cibAdobeIndesign', 'cibAdobeLightroomClassic', 'cibAdobeLightroom', 'cibAdobePhotoshop', 'cibAdobePremiere', 'cibAdobeTypekit', 'cibAdobeXd', 'cibAdobe', 'cibAirbnb', 'cibAlgolia', 'cibAlipay', 'cibAllocine', 'cibAmazonAws', 'cibAmazonPay', 'cibAmazon', 'cibAmd', 'cibAmericanExpress', 'cibAnaconda', 'cibAnalogue', 'cibAndroidAlt', 'cibAndroid', 'cibAngellist', 'cibAngularUniversal', 'cibAngular', 'cibAnsible', 'cibApacheAirflow', 'cibApacheFlink', 'cibApacheSpark', 'cibApache', 'cibAppStoreIos', 'cibAppStore', 'cibAppleMusic', 'cibApplePay', 'cibApplePodcasts', 'cibApple', 'cibAppveyor', 'cibAral', 'cibArchLinux', 'cibArchiveOfOurOwn', 'cibArduino', 'cibArtstation', 'cibArxiv', 'cibAsana', 'cibAtAndT', 'cibAtlassian', 'cibAtom', 'cibAudible', 'cibAurelia', 'cibAuth0', 'cibAutomatic', 'cibAutotask', 'cibAventrix', 'cibAzureArtifacts', 'cibAzureDevops', 'cibAzurePipelines', 'cibBabel', 'cibBaidu', 'cibBamboo', 'cibBancontact', 'cibBandcamp', 'cibBasecamp', 'cibBathasu', 'cibBehance', 'cibBigCartel', 'cibBing', 'cibBit', 'cibBitbucket', 'cibBitcoin', 'cibBitdefender', 'cibBitly', 'cibBlackberry', 'cibBlender', 'cibBloggerB', 'cibBlogger', 'cibBluetoothB', 'cibBluetooth', 'cibBoeing', 'cibBoost', 'cibBootstrap', 'cibBower', 'cibBrandAi', 'cibBrave', 'cibBtc', 'cibBuddy', 'cibBuffer', 'cibBuyMeACoffee', 'cibBuysellads', 'cibBuzzfeed', 'cibC', 'cibCakephp', 'cibCampaignMonitor', 'cibCanva', 'cibCashapp', 'cibCassandra', 'cibCastro', 'cibCcAmazonPay', 'cibCcAmex', 'cibCcApplePay', 'cibCcDinersClub', 'cibCcDiscover', 'cibCcJcb', 'cibCcMastercard', 'cibCcPaypal', 'cibCcStripe', 'cibCcVisa', 'cibCentos', 'cibCevo', 'cibChase', 'cibChef', 'cibChromecast', 'cibCircle', 'cibCircleci', 'cibCirrusci', 'cibCisco', 'cibCivicrm', 'cibClockify', 'cibClojure', 'cibCloudbees', 'cibCloudflare', 'cibCmake', 'cibCoOp', 'cibCodacy', 'cibCodeClimate', 'cibCodecademy', 'cibCodecov', 'cibCodeigniter', 'cibCodepen', 'cibCoderwall', 'cibCodesandbox', 'cibCodeship', 'cibCodewars', 'cibCodio', 'cibCoffeescript', 'cibCommonWorkflowLanguage', 'cibComposer', 'cibCondaForge', 'cibConekta', 'cibConfluence', 'cibCoreuiC', 'cibCoreui', 'cibCoursera', 'cibCoveralls', 'cibCpanel', 'cibCplusplus', 'cibCreativeCommonsBy', 'cibCreativeCommonsNcEu', 'cibCreativeCommonsNcJp', 'cibCreativeCommonsNc', 'cibCreativeCommonsNd', 'cibCreativeCommonsPdAlt', 'cibCreativeCommonsPd', 'cibCreativeCommonsRemix', 'cibCreativeCommonsSa', 'cibCreativeCommonsSamplingPlus', 'cibCreativeCommonsSampling', 'cibCreativeCommonsShare', 'cibCreativeCommonsZero', 'cibCreativeCommons', 'cibCrunchbase', 'cibCrunchyroll', 'cibCss3Shiled', 'cibCss3', 'cibCsswizardry', 'cibD3Js', 'cibDailymotion', 'cibDashlane', 'cibDazn', 'cibDblp', 'cibDebian', 'cibDeepin', 'cibDeezer', 'cibDelicious', 'cibDell', 'cibDeno', 'cibDependabot', 'cibDesignerNews', 'cibDevTo', 'cibDeviantart', 'cibDevrant', 'cibDiaspora', 'cibDigg', 'cibDigitalOcean', 'cibDiscord', 'cibDiscourse', 'cibDiscover', 'cibDisqus', 'cibDisroot', 'cibDjango', 'cibDocker', 'cibDocusign', 'cibDotNet', 'cibDraugiemLv', 'cibDribbble', 'cibDrone', 'cibDropbox', 'cibDrupal', 'cibDtube', 'cibDuckduckgo', 'cibDynatrace', 'cibEbay', 'cibEclipseide', 'cibElasticCloud', 'cibElasticSearch', 'cibElasticStack', 'cibElastic', 'cibElectron', 'cibElementary', 'cibEleventy', 'cibEllo', 'cibElsevier', 'cibEmlakjet', 'cibEmpirekred', 'cibEnvato', 'cibEpicGames', 'cibEpson', 'cibEsea', 'cibEslint', 'cibEthereum', 'cibEtsy', 'cibEventStore', 'cibEventbrite', 'cibEvernote', 'cibEverplaces', 'cibEvry', 'cibExercism', 'cibExpertsExchange', 'cibExpo', 'cibEyeem', 'cibFSecure', 'cibFacebookF', 'cibFacebook', 'cibFaceit', 'cibFandango', 'cibFavro', 'cibFeathub', 'cibFedex', 'cibFedora', 'cibFeedly', 'cibFidoAlliance', 'cibFigma', 'cibFilezilla', 'cibFirebase', 'cibFitbit', 'cibFlask', 'cibFlattr', 'cibFlickr', 'cibFlipboard', 'cibFlutter', 'cibFnac', 'cibFoursquare', 'cibFramer', 'cibFreebsd', 'cibFreecodecamp', 'cibFurAffinity', 'cibFurryNetwork', 'cibGarmin', 'cibGatsby', 'cibGauges', 'cibGenius', 'cibGentoo', 'cibGeocaching', 'cibGerrit', 'cibGg', 'cibGhost', 'cibGimp', 'cibGit', 'cibGitea', 'cibGithub', 'cibGitkraken', 'cibGitlab', 'cibGitpod', 'cibGitter', 'cibGlassdoor', 'cibGlitch', 'cibGmail', 'cibGnuPrivacyGuard', 'cibGnuSocial', 'cibGnu', 'cibGo', 'cibGodotEngine', 'cibGogCom', 'cibGoldenline', 'cibGoodreads', 'cibGoogleAds', 'cibGoogleAllo', 'cibGoogleAnalytics', 'cibGoogleChrome', 'cibGoogleCloud', 'cibGoogleKeep', 'cibGooglePay', 'cibGooglePlay', 'cibGooglePodcasts', 'cibGoogle', 'cibGooglesCholar', 'cibGovUk', 'cibGradle', 'cibGrafana', 'cibGraphcool', 'cibGraphql', 'cibGrav', 'cibGravatar', 'cibGreenkeeper', 'cibGreensock', 'cibGroovy', 'cibGroupon', 'cibGrunt', 'cibGulp', 'cibGumroad', 'cibGumtree', 'cibHabr', 'cibHackaday', 'cibHackerearth', 'cibHackerone', 'cibHackerrank', 'cibHackhands', 'cibHackster', 'cibHappycow', 'cibHashnode', 'cibHaskell', 'cibHatenaBookmark', 'cibHaxe', 'cibHelm', 'cibHere', 'cibHeroku', 'cibHexo', 'cibHighly', 'cibHipchat', 'cibHitachi', 'cibHockeyapp', 'cibHomify', 'cibHootsuite', 'cibHotjar', 'cibHouzz', 'cibHp', 'cibHtml5Shield', 'cibHtml5', 'cibHtmlacademy', 'cibHuawei', 'cibHubspot', 'cibHulu', 'cibHumbleBundle', 'cibIata', 'cibIbm', 'cibIcloud', 'cibIconjar', 'cibIcq', 'cibIdeal', 'cibIfixit', 'cibImdb', 'cibIndeed', 'cibInkscape', 'cibInstacart', 'cibInstagram', 'cibInstapaper', 'cibIntel', 'cibIntellijidea', 'cibIntercom', 'cibInternetExplorer', 'cibInvision', 'cibIonic', 'cibIssuu', 'cibItchIo', 'cibJabber', 'cibJava', 'cibJavascript', 'cibJekyll', 'cibJenkins', 'cibJest', 'cibJet', 'cibJetbrains', 'cibJira', 'cibJoomla', 'cibJquery', 'cibJs', 'cibJsdelivr', 'cibJsfiddle', 'cibJson', 'cibJupyter', 'cibJustgiving', 'cibKaggle', 'cibKaios', 'cibKaspersky', 'cibKentico', 'cibKeras', 'cibKeybase', 'cibKeycdn', 'cibKhanAcademy', 'cibKibana', 'cibKickstarter', 'cibKik', 'cibKirby', 'cibKlout', 'cibKnown', 'cibKoFi', 'cibKodi', 'cibKoding', 'cibKotlin', 'cibKrita', 'cibKubernetes', 'cibLanyrd', 'cibLaravelHorizon', 'cibLaravelNova', 'cibLaravel', 'cibLastFm', 'cibLatex', 'cibLaunchpad', 'cibLeetcode', 'cibLenovo', 'cibLess', 'cibLetsEncrypt', 'cibLetterboxd', 'cibLgtm', 'cibLiberapay', 'cibLibrarything', 'cibLibreoffice', 'cibLine', 'cibLinkedinIn', 'cibLinkedin', 'cibLinuxFoundation', 'cibLinuxMint', 'cibLinux', 'cibLivejournal', 'cibLivestream', 'cibLogstash', 'cibLua', 'cibLumen', 'cibLyft', 'cibMacys', 'cibMagento', 'cibMagisk', 'cibMailRu', 'cibMailchimp', 'cibMakerbot', 'cibManjaro', 'cibMarkdown', 'cibMarketo', 'cibMastercard', 'cibMastodon', 'cibMaterialDesign', 'cibMathworks', 'cibMatrix', 'cibMattermost', 'cibMatternet', 'cibMaxcdn', 'cibMcafee', 'cibMediaTemple', 'cibMediafire', 'cibMediumM', 'cibMedium', 'cibMeetup', 'cibMega', 'cibMendeley', 'cibMessenger', 'cibMeteor', 'cibMicroBlog', 'cibMicrogenetics', 'cibMicrosoftEdge', 'cibMicrosoft', 'cibMinetest', 'cibMinutemailer', 'cibMix', 'cibMixcloud', 'cibMixer', 'cibMojang', 'cibMonero', 'cibMongodb', 'cibMonkeytie', 'cibMonogram', 'cibMonzo', 'cibMoo', 'cibMozillaFirefox', 'cibMozilla', 'cibMusescore', 'cibMxlinux', 'cibMyspace', 'cibMysql', 'cibNativescript', 'cibNec', 'cibNeo4J', 'cibNetflix', 'cibNetlify', 'cibNextJs', 'cibNextcloud', 'cibNextdoor', 'cibNginx', 'cibNim', 'cibNintendo3Ds', 'cibNintendoGamecube', 'cibNintendoSwitch', 'cibNintendo', 'cibNodeJs', 'cibNodeRed', 'cibNodemon', 'cibNokia', 'cibNotion', 'cibNpm', 'cibNucleo', 'cibNuget', 'cibNuxtJs', 'cibNvidia', 'cibOcaml', 'cibOctave', 'cibOctopusDeploy', 'cibOculus', 'cibOdnoklassniki', 'cibOpenAccess', 'cibOpenCollective', 'cibOpenId', 'cibOpenSourceInitiative', 'cibOpenstreetmap', 'cibOpensuse', 'cibOpenvpn', 'cibOpera', 'cibOpsgenie', 'cibOracle', 'cibOrcid', 'cibOrigin', 'cibOsi', 'cibOsmc', 'cibOvercast', 'cibOverleaf', 'cibOvh', 'cibPagekit', 'cibPalantir', 'cibPandora', 'cibPantheon', 'cibPatreon', 'cibPaypal', 'cibPeriscope', 'cibPhp', 'cibPicartoTv', 'cibPinboard', 'cibPingdom', 'cibPingup', 'cibPinterestP', 'cibPinterest', 'cibPivotaltracker', 'cibPlangrid', 'cibPlayerMe', 'cibPlayerfm', 'cibPlaystation', 'cibPlaystation3', 'cibPlaystation4', 'cibPlesk', 'cibPlex', 'cibPluralsight', 'cibPlurk', 'cibPocket', 'cibPostgresql', 'cibPostman', 'cibPostwoman', 'cibPowershell', 'cibPrettier', 'cibPrismic', 'cibProbot', 'cibProcesswire', 'cibProductHunt', 'cibProtoIo', 'cibProtonmail', 'cibProxmox', 'cibPypi', 'cibPython', 'cibPytorch', 'cibQgis', 'cibQiita', 'cibQq', 'cibQualcomm', 'cibQuantcast', 'cibQuantopian', 'cibQuarkus', 'cibQuora', 'cibQwiklabs', 'cibQzone', 'cibR', 'cibRadiopublic', 'cibRails', 'cibRaspberryPi', 'cibReact', 'cibReadTheDocs', 'cibReadme', 'cibRealm', 'cibReason', 'cibRedbubble', 'cibRedditAlt', 'cibReddit', 'cibRedhat', 'cibRedis', 'cibRedux', 'cibRenren', 'cibReverbnation', 'cibRiot', 'cibRipple', 'cibRiseup', 'cibRollupJs', 'cibRoots', 'cibRoundcube', 'cibRss', 'cibRstudio', 'cibRuby', 'cibRubygems', 'cibRunkeeper', 'cibRust', 'cibSafari', 'cibSahibinden', 'cibSalesforce', 'cibSaltstack', 'cibSamsungPay', 'cibSamsung', 'cibSap', 'cibSassAlt', 'cibSass', 'cibSaucelabs', 'cibScala', 'cibScaleway', 'cibScribd', 'cibScrutinizerci', 'cibSeagate', 'cibSega', 'cibSellfy', 'cibSemaphoreci', 'cibSensu', 'cibSentry', 'cibServerFault', 'cibShazam', 'cibShell', 'cibShopify', 'cibShowpad', 'cibSiemens', 'cibSignal', 'cibSinaWeibo', 'cibSitepoint', 'cibSketch', 'cibSkillshare', 'cibSkyliner', 'cibSkype', 'cibSlack', 'cibSlashdot', 'cibSlickpic', 'cibSlides', 'cibSlideshare', 'cibSmashingmagazine', 'cibSnapchat', 'cibSnapcraft', 'cibSnyk', 'cibSociety6', 'cibSocketIo', 'cibSogou', 'cibSolus', 'cibSongkick', 'cibSonos', 'cibSoundcloud', 'cibSourceforge', 'cibSourcegraph', 'cibSpacemacs', 'cibSpacex', 'cibSparkfun', 'cibSparkpost', 'cibSpdx', 'cibSpeakerDeck', 'cibSpectrum', 'cibSpotify', 'cibSpotlight', 'cibSpreaker', 'cibSpring', 'cibSprint', 'cibSquarespace', 'cibStackbit', 'cibStackexchange', 'cibStackoverflow', 'cibStackpath', 'cibStackshare', 'cibStadia', 'cibStatamic', 'cibStaticman', 'cibStatuspage', 'cibSteam', 'cibSteem', 'cibSteemit', 'cibStitcher', 'cibStorify', 'cibStorybook', 'cibStrapi', 'cibStrava', 'cibStripeS', 'cibStripe', 'cibStubhub', 'cibStumbleupon', 'cibStyleshare', 'cibStylus', 'cibSublimeText', 'cibSubversion', 'cibSuperuser', 'cibSvelte', 'cibSvg', 'cibSwagger', 'cibSwarm', 'cibSwift', 'cibSymantec', 'cibSymfony', 'cibSynology', 'cibTMobile', 'cibTableau', 'cibTails', 'cibTapas', 'cibTeamviewer', 'cibTed', 'cibTeespring', 'cibTelegramPlane', 'cibTelegram', 'cibTencentQq', 'cibTencentWeibo', 'cibTensorflow', 'cibTerraform', 'cibTesla', 'cibTheMighty', 'cibTheMovieDatabase', 'cibTidal', 'cibTiktok', 'cibTinder', 'cibTodoist', 'cibToggl', 'cibTopcoder', 'cibToptal', 'cibTor', 'cibToshiba', 'cibTrainerroad', 'cibTrakt', 'cibTravisci', 'cibTreehouse', 'cibTrello', 'cibTripadvisor', 'cibTrulia', 'cibTumblr', 'cibTwilio', 'cibTwitch', 'cibTwitter', 'cibTwoo', 'cibTypescript', 'cibTypo3', 'cibUber', 'cibUbisoft', 'cibUblockOrigin', 'cibUbuntu', 'cibUdacity', 'cibUdemy', 'cibUikit', 'cibUmbraco', 'cibUnity', 'cibUnrealEngine', 'cibUnsplash', 'cibUntappd', 'cibUpwork', 'cibUsb', 'cibV8', 'cibVagrant', 'cibVenmo', 'cibVerizon', 'cibViadeo', 'cibViber', 'cibVim', 'cibVimeoV', 'cibVimeo', 'cibVine', 'cibVirb', 'cibVisa', 'cibVisualStudioCode', 'cibVisualStudio', 'cibVk', 'cibVlc', 'cibVsco', 'cibVueJs', 'cibWattpad', 'cibWeasyl', 'cibWebcomponentsOrg', 'cibWebpack', 'cibWebstorm', 'cibWechat', 'cibWhatsapp', 'cibWhenIWork', 'cibWii', 'cibWiiu', 'cibWikipedia', 'cibWindows', 'cibWire', 'cibWireguard', 'cibWix', 'cibWolframLanguage', 'cibWolframMathematica', 'cibWolfram', 'cibWordpress', 'cibWpengine', 'cibXPack', 'cibXbox', 'cibXcode', 'cibXero', 'cibXiaomi', 'cibXing', 'cibXrp', 'cibXsplit', 'cibYCombinator', 'cibYahoo', 'cibYammer', 'cibYandex', 'cibYarn', 'cibYelp', 'cibYoutube', 'cibZalando', 'cibZapier', 'cibZeit', 'cibZendesk', 'cibZerply', 'cibZillow', 'cibZingat', 'cibZoom', 'cibZorin', 'cibZulip'] - return ( - - {icons.map((i, idx) => { - return ( - -
    - -
    -
    {i}
    -
    ) - })} -
    - ) -} - -export const FlagsExample = () => { - const icons = ['cifAd', 'cifAe', 'cifAf', 'cifAg', 'cifAl', 'cifAm', 'cifAo', 'cifAr', 'cifAt', 'cifAu', 'cifAz', 'cifBa', 'cifBb', 'cifBd', 'cifBe', 'cifBf', 'cifBg', 'cifBh', 'cifBi', 'cifBj', 'cifBn', 'cifBo', 'cifBr', 'cifBs', 'cifBt', 'cifBw', 'cifBy', 'cifBz', 'cifCa', 'cifCd', 'cifCf', 'cifCg', 'cifCh', 'cifCi', 'cifCl', 'cifCm', 'cifCn', 'cifCo', 'cifCr', 'cifCu', 'cifCv', 'cifCy', 'cifCz', 'cifDe', 'cifDj', 'cifDk', 'cifDm', 'cifDo', 'cifDz', 'cifEc', 'cifEe', 'cifEg', 'cifEr', 'cifEs', 'cifEt', 'cifFi', 'cifFj', 'cifFm', 'cifFr', 'cifGa', 'cifGb', 'cifGd', 'cifGe', 'cifGh', 'cifGm', 'cifGn', 'cifGq', 'cifGr', 'cifGt', 'cifGw', 'cifGy', 'cifHk', 'cifHn', 'cifHr', 'cifHt', 'cifHu', 'cifId', 'cifIe', 'cifIl', 'cifIn', 'cifIq', 'cifIr', 'cifIs', 'cifIt', 'cifJm', 'cifJo', 'cifJp', 'cifKe', 'cifKg', 'cifKh', 'cifKi', 'cifKm', 'cifKn', 'cifKp', 'cifKr', 'cifKw', 'cifKz', 'cifLa', 'cifLb', 'cifLc', 'cifLi', 'cifLk', 'cifLr', 'cifLs', 'cifLt', 'cifLu', 'cifLv', 'cifLy', 'cifMa', 'cifMc', 'cifMd', 'cifMe', 'cifMg', 'cifMh', 'cifMk', 'cifMl', 'cifMm', 'cifMn', 'cifMr', 'cifMt', 'cifMu', 'cifMv', 'cifMw', 'cifMx', 'cifMy', 'cifMz', 'cifNa', 'cifNe', 'cifNg', 'cifNi', 'cifNl', 'cifNo', 'cifNp', 'cifNr', 'cifNu', 'cifNz', 'cifOm', 'cifPa', 'cifPe', 'cifPg', 'cifPh', 'cifPk', 'cifPl', 'cifPt', 'cifPw', 'cifPy', 'cifQa', 'cifRo', 'cifRs', 'cifRu', 'cifRw', 'cifSa', 'cifSb', 'cifSc', 'cifSd', 'cifSe', 'cifSg', 'cifSi', 'cifSk', 'cifSl', 'cifSm', 'cifSn', 'cifSo', 'cifSr', 'cifSs', 'cifSt', 'cifSv', 'cifSy', 'cifSz', 'cifTd', 'cifTg', 'cifTh', 'cifTj', 'cifTl', 'cifTm', 'cifTn', 'cifTo', 'cifTr', 'cifTt', 'cifTv', 'cifTw', 'cifTz', 'cifUa', 'cifUg', 'cifUs', 'cifUy', 'cifUz', 'cifVa', 'cifVc', 'cifVe', 'cifVn', 'cifWs', 'cifXk', 'cifYe', 'cifZa', 'cifZm', 'cifZw'] - return ( - - {icons.map((i, idx) => { - return ( - -
    - -
    -
    {i}
    -
    ) - })} -
    - ) -} - -export const TabPanesExample = () => { - const [activeKey, setActiveKey] = useState(1) - return ( - <> - - - { - e.preventDefault() - setActiveKey(1) - }} - > - Linear - - - - { - e.preventDefault() - setActiveKey(2) - }} - > - Brand - - - - { - e.preventDefault() - setActiveKey(3) - }} - > - Flags - - - - - - {activeKey === 1 && } - - - {activeKey === 2 && } - - - {activeKey === 3 && } - - - - ) -} - - - -React Icons also provides a variety of customization options, such as the ability to change the size, color, and style of the icons, as well as the ability to add additional CSS classes to the icons. You can find more information on these customization options in the documentation. - -## Premium icons - -If you find yourself in need of a greater selection of icons, we've got you covered with our [premium icon pack](https://coreui.io/icons/all/). This incredible package boasts an extensive collection of over 4,000 meticulously crafted icons, ensuring that you'll find the perfect representation for any concept or idea. Explore the vast range of options and unlock a world of visual possibilities. - -So if you need more icons our PRO package will be a great choice for you. - -## API - -### CIcon - -`markdown:CIcon.api.mdx` - -### CIconSvg - -`markdown:CIconSvg.api.mdx` \ No newline at end of file diff --git a/packages/docs/content/components/image/api.mdx b/packages/docs/content/components/image/api.mdx deleted file mode 100644 index 816292ef..00000000 --- a/packages/docs/content/components/image/api.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: React Image Component API -name: Image API -description: Explore the API reference for the React Image component and discover how to effectively utilize its props for customization. -route: /components/image/ ---- - -import CImageAPI from '../../api/CImage.api.mdx' - -## CImage - - diff --git a/packages/docs/content/components/image/bootstrap.mdx b/packages/docs/content/components/image/bootstrap.mdx deleted file mode 100644 index e9d09fec..00000000 --- a/packages/docs/content/components/image/bootstrap.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: React Bootstrap Image Component -name: Image with Bootstrap Styling -description: Learn how to use the React Bootstrap Image component from CoreUI to create responsive, aligned, and styled images using Bootstrap-friendly utilities and props. -route: /components/image/ -bootstrap_component: true ---- - -## Responsive React Bootstrap Images - -The React Bootstrap Image component supports responsive behavior using the `fluid` prop. This applies `max-width: 100%` and `height: auto` to ensure images scale with their parent container. - - - -## React Bootstrap Image thumbnails - -Use the `thumbnail` prop to give an image a subtle border and padding, resulting in a thumbnail-style appearance. You can combine it with [border-radius utilities](https://coreui.io/bootstrap/docs/utilities/borders) for rounded corners. - - - -## Aligning React Bootstrap Images - -Use the `align` prop to control image alignment within the container. This allows you to float images left, right, or center them using Bootstrap-aligned values. - - - - - - - -## API reference - -Explore all available props and customization options for the React Bootstrap Image component below: - -- [<CImage />](../api/#cimage) diff --git a/packages/docs/content/components/image/examples/ImageAligning2Example.tsx b/packages/docs/content/components/image/examples/ImageAligning2Example.tsx deleted file mode 100644 index 7ba739a7..00000000 --- a/packages/docs/content/components/image/examples/ImageAligning2Example.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CImage } from '@coreui/react' - -export const ImageAligning2Example = () => { - return ( -
    - -
    - ) -} diff --git a/packages/docs/content/components/image/examples/ImageAligning3Example.tsx b/packages/docs/content/components/image/examples/ImageAligning3Example.tsx deleted file mode 100644 index 200fc959..00000000 --- a/packages/docs/content/components/image/examples/ImageAligning3Example.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CImage } from '@coreui/react' - -export const ImageAligning3Example = () => { - return ( -
    - -
    - ) -} diff --git a/packages/docs/content/components/image/examples/ImageAligningExample.tsx b/packages/docs/content/components/image/examples/ImageAligningExample.tsx deleted file mode 100644 index 3e0ce6bd..00000000 --- a/packages/docs/content/components/image/examples/ImageAligningExample.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CImage } from '@coreui/react' - -export const ImageAligningExample = () => { - return ( -
    - - -
    - ) -} diff --git a/packages/docs/content/components/image/examples/ImageResponsiveExample.tsx b/packages/docs/content/components/image/examples/ImageResponsiveExample.tsx deleted file mode 100644 index 1d8cb4b5..00000000 --- a/packages/docs/content/components/image/examples/ImageResponsiveExample.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CImage } from '@coreui/react' - -export const ImageResponsiveExample = () => { - return -} diff --git a/packages/docs/content/components/image/examples/ImageThumbnailExample.tsx b/packages/docs/content/components/image/examples/ImageThumbnailExample.tsx deleted file mode 100644 index 1e40391b..00000000 --- a/packages/docs/content/components/image/examples/ImageThumbnailExample.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CImage } from '@coreui/react' - -export const ImageThumbnailExample = () => { - return -} diff --git a/packages/docs/content/components/image/index.mdx b/packages/docs/content/components/image/index.mdx deleted file mode 100644 index 4a8b5d25..00000000 --- a/packages/docs/content/components/image/index.mdx +++ /dev/null @@ -1,35 +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. -route: /components/image/ -other_frameworks: image ---- - -## 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. - - - -## Image thumbnails - -In addition to our [border-radius utilities](https://coreui.io/bootstrap/docs/utilities/borders), you can use prop`thumbnail` to give an image a rounded 1px border appearance. - - - -## Aligning images - -Align images with the `align` property. - - - - - - - -## API - -Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here. - -- [<CImage />](./api/#cimage) \ No newline at end of file diff --git a/packages/docs/content/components/list-group/api.mdx b/packages/docs/content/components/list-group/api.mdx deleted file mode 100644 index ba8b36e6..00000000 --- a/packages/docs/content/components/list-group/api.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: React List Group Component API -name: List Group API -description: Explore the API reference for the React List Group component and discover how to effectively utilize its props for customization. -route: /components/list-group/ ---- - -import CListGroupAPI from '../../api/CListGroup.api.mdx' -import CListGroupItemAPI from '../../api/CListGroupItem.api.mdx' - -## CListGroup - - - -## CListGroupItem - - diff --git a/packages/docs/content/components/list-group/bootstrap.mdx b/packages/docs/content/components/list-group/bootstrap.mdx deleted file mode 100644 index 7632d5be..00000000 --- a/packages/docs/content/components/list-group/bootstrap.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: React Bootstrap List Group Component -name: List Group with Bootstrap Styling -description: Learn how to use the React Bootstrap List Group component from CoreUI to display flexible and interactive lists with badges, buttons, contextual styles, and more. -route: /components/list-group/ -bootstrap_component: true ---- - -## Basic usage of React Bootstrap List Group - -The React Bootstrap List Group component allows you to display a list of content using Bootstrap-styled list items. The default setup uses an unordered list with proper classes. - - - -## Active items - -Add the `active` prop to a `` to visually mark it as the selected item. - - - -## Disabled items - -Use the `disabled` prop to disable interaction with a list item. - - - -## List group as links or buttons - -You can use `
    ` or ` -
    -
    -

    React Modal body text goes here.

    -
    -
    - - -
    -
    -
    -
    - - -```jsx - - - React Modal title - - -

    React Modal body text goes here.

    -
    - - Close - Save changes - -
    -``` - -### Live demo - - - -### Static backdrop - - - -### Scrolling long content - - - - - -### Vertically centered modals - - - - -### Tooltips and popovers in modals - - - -### Toggle between modals - - - -### Change modal animation - -Use Sass variables like `$modal-fade-transform` and `$modal-show-transform` to customize animation. For example: - -```scss -$modal-fade-transform: scale(0.8); -``` - -### Remove modal animation - -Disable animation with: - -```jsx -... -``` - -### Accessibility tips - -Use `aria-labelledby` and `aria-describedby` on `` for improved screen reader support. CoreUI adds required roles and aria attributes automatically. - -## React Bootstrap Modal sizes - -Modals come in predefined sizes via the `size` prop. - -| Size | Prop | Max width | -|-------------|----------|-----------| -| Small | `'sm'` | 300px | -| Default | — | 500px | -| Large | `'lg'` | 800px | -| Extra large | `'xl'` | 1140px | - - - -## Fullscreen React Bootstrap Modals - -Use the `fullscreen` prop to make modals expand to full viewport width/height. You can apply it conditionally based on breakpoints. - -| Fullscreen prop | Breakpoint | -|------------------|--------------------| -| `true` | Always | -| `'sm'` | Below 576px | -| `'md'` | Below 768px | -| `'lg'` | Below 992px | -| `'xl'` | Below 1200px | -| `'xxl'` | Below 1400px | - - - -## API reference - -Explore the API for the React Bootstrap Modal component and its related parts: - -- [<CModal />](../api/#cmodal) -- [<CModalBody />](../api/#cmodalbody) -- [<CModalFooter />](../api/#cmodalfooter) -- [<CModalHeader />](../api/#cmodalheader) -- [<CModalTitle />](../api/#cmodaltitle) \ No newline at end of file diff --git a/packages/docs/content/components/modal/examples/ModalFullscreenExample.tsx b/packages/docs/content/components/modal/examples/ModalFullscreenExample.tsx deleted file mode 100644 index 267c0797..00000000 --- a/packages/docs/content/components/modal/examples/ModalFullscreenExample.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalFullscreenExample = () => { - const [visible, setVisible] = useState(false) - const [visibleSm, setVisibleSm] = useState(false) - const [visibleMd, setVisibleMd] = useState(false) - const [visibleLg, setVisibleLg] = useState(false) - const [visibleXL, setVisibleXL] = useState(false) - const [visibleXXL, setVisibleXXL] = useState(false) - return ( - <> - setVisible(!visible)}> - Full screen - - setVisibleSm(!visibleSm)}> - Full screen below sm - - setVisibleMd(!visibleMd)}> - Full screen below md - - setVisibleLg(!visibleLg)}> - Full screen below lg - - setVisibleXL(!visibleXL)}> - Full screen below xl - - setVisibleXXL(!visibleXXL)}> - Full screen below xxl - - setVisible(false)} - aria-labelledby="FullscreenExample1" - > - - Full screen - - ... - - setVisibleSm(false)} - aria-labelledby="FullscreenExample2" - > - - Full screen below sm - - ... - - setVisibleMd(false)} - aria-labelledby="FullscreenExample3" - > - - Full screen below md - - ... - - setVisibleLg(false)} - aria-labelledby="FullscreenExample4" - > - - Full screen below lg - - ... - - setVisibleXL(false)} - aria-labelledby="FullscreenExample5" - > - - Full screen below xl - - ... - - setVisibleXXL(false)} - aria-labelledby="FullscreenExample6" - > - - Full screen below xxl - - ... - - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalLiveDemoExample.tsx b/packages/docs/content/components/modal/examples/ModalLiveDemoExample.tsx deleted file mode 100644 index 3bd28d2f..00000000 --- a/packages/docs/content/components/modal/examples/ModalLiveDemoExample.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalLiveDemoExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Launch demo modal - - setVisible(false)} - aria-labelledby="LiveDemoExampleLabel" - > - - Modal title - - Woohoo, you're reading this text in a modal! - - setVisible(false)}> - Close - - Save changes - - - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalOptionalSizesExample.tsx b/packages/docs/content/components/modal/examples/ModalOptionalSizesExample.tsx deleted file mode 100644 index a082c37a..00000000 --- a/packages/docs/content/components/modal/examples/ModalOptionalSizesExample.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalOptionalSizesExample = () => { - const [visibleXL, setVisibleXL] = useState(false) - const [visibleLg, setVisibleLg] = useState(false) - const [visibleSm, setVisibleSm] = useState(false) - return ( - <> - setVisibleXL(!visibleXL)}> - Extra large modal - - setVisibleLg(!visibleLg)}> - Large modal - - setVisibleSm(!visibleSm)}> - Small modal - - setVisibleXL(false)} - aria-labelledby="OptionalSizesExample1" - > - - Extra large modal - - ... - - setVisibleLg(false)} - aria-labelledby="OptionalSizesExample2" - > - - Large modal - - ... - - setVisibleSm(false)} - aria-labelledby="OptionalSizesExample3" - > - - Small modal - - ... - - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalScrollingLongContent2Example.tsx b/packages/docs/content/components/modal/examples/ModalScrollingLongContent2Example.tsx deleted file mode 100644 index 0e4d9a95..00000000 --- a/packages/docs/content/components/modal/examples/ModalScrollingLongContent2Example.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalScrollingLongContent2Example = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Vertically centered scrollable modal - - setVisible(false)} - aria-labelledby="VerticallyCenteredScrollableExample2" - > - - Modal title - - -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -
    - - setVisible(false)}> - Close - - Save changes - -
    - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalScrollingLongContentExample.tsx b/packages/docs/content/components/modal/examples/ModalScrollingLongContentExample.tsx deleted file mode 100644 index 33ab2119..00000000 --- a/packages/docs/content/components/modal/examples/ModalScrollingLongContentExample.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalScrollingLongContentExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Launch demo modal - - setVisible(false)} - aria-labelledby="ScrollingLongContentExampleLabel" - > - - Modal title - - -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -
    - - setVisible(false)}> - Close - - Save changes - -
    - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalStaticBackdropExample.tsx b/packages/docs/content/components/modal/examples/ModalStaticBackdropExample.tsx deleted file mode 100644 index 859b1d89..00000000 --- a/packages/docs/content/components/modal/examples/ModalStaticBackdropExample.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalStaticBackdropExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Launch static backdrop modal - - setVisible(false)} - aria-labelledby="StaticBackdropExampleLabel" - > - - Modal title - - - I will not close if you click outside me. Don't even try to press escape key. - - - setVisible(false)}> - Close - - Save changes - - - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalToggleBetweenModalsExample.tsx b/packages/docs/content/components/modal/examples/ModalToggleBetweenModalsExample.tsx deleted file mode 100644 index ba6af0ff..00000000 --- a/packages/docs/content/components/modal/examples/ModalToggleBetweenModalsExample.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalToggleBetweenModalsExample = () => { - const [visible, setVisible] = useState(false) - const [visible2, setVisible2] = useState(false) - return ( - <> - setVisible(!visible)}> - Open first modal - - setVisible(false)} - aria-labelledby="ToggleBetweenModalsExample1" - > - - Modal 1 title - - -

    Show a second modal and hide this one with the button below.

    -
    - - { - setVisible(false) - setVisible2(true) - }} - > - Open second modal - - -
    - { - setVisible(true) - setVisible2(false) - }} - aria-labelledby="ToggleBetweenModalsExample2" - > - - Modal 2 title - - -

    Hide this modal and show the first with the button below.

    -
    - - { - setVisible(true) - setVisible2(false) - }} - > - Back to first - - -
    - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalTooltipsAndPopoversExample.tsx b/packages/docs/content/components/modal/examples/ModalTooltipsAndPopoversExample.tsx deleted file mode 100644 index 46d73846..00000000 --- a/packages/docs/content/components/modal/examples/ModalTooltipsAndPopoversExample.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CModal, - CModalBody, - CModalFooter, - CModalHeader, - CModalTitle, - CLink, - CPopover, - CTooltip, -} from '@coreui/react' - -export const ModalTooltipsAndPopoversExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Launch demo modal - - setVisible(false)} - aria-labelledby="TooltipsAndPopoverExample" - > - - Modal title - - -
    Popover in a modal
    -

    - This - - button - {' '} - triggers a popover on click. -

    -
    -
    Tooltips in a modal
    -

    - - This link - {' '} - and - - that link - {' '} - have tooltips on hover. -

    -
    - - setVisible(false)}> - Close - - Save changes - -
    - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalVerticallyCenteredExample.tsx b/packages/docs/content/components/modal/examples/ModalVerticallyCenteredExample.tsx deleted file mode 100644 index f2f43f4e..00000000 --- a/packages/docs/content/components/modal/examples/ModalVerticallyCenteredExample.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalVerticallyCenteredExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Vertically centered modal - - setVisible(false)} - aria-labelledby="VerticallyCenteredExample" - > - - Modal title - - - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. - - - setVisible(false)}> - Close - - Save changes - - - - ) -} diff --git a/packages/docs/content/components/modal/examples/ModalVerticallyCenteredScrollableExample.tsx b/packages/docs/content/components/modal/examples/ModalVerticallyCenteredScrollableExample.tsx deleted file mode 100644 index 0cc92aea..00000000 --- a/packages/docs/content/components/modal/examples/ModalVerticallyCenteredScrollableExample.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useState } from 'react' -import { CButton, CModal, CModalBody, CModalFooter, CModalHeader, CModalTitle } from '@coreui/react' - -export const ModalVerticallyCenteredScrollableExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - setVisible(!visible)}> - Vertically centered scrollable modal - - setVisible(false)} - aria-labelledby="VerticallyCenteredScrollableExample2" - > - - Modal title - - -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -

    - Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel - scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus - auctor fringilla. -

    -

    - Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis - in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. -

    -

    - Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis - lacus vel augue laoreet rutrum faucibus dolor auctor. -

    -
    - - setVisible(false)}> - Close - - Save changes - -
    - - ) -} diff --git a/packages/docs/content/components/modal/index.mdx b/packages/docs/content/components/modal/index.mdx deleted file mode 100644 index 3ff5a3b0..00000000 --- a/packages/docs/content/components/modal/index.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: React Modal Component -name: Modal -description: React Modal component offers a lightweight, multi-purpose popup to add dialogs to yours. Learn how to customize CoreUI React modal components easily. Multiple examples and tutorial. -route: /components/modal/ -other_frameworks: modal ---- - -## How to use React Modal Component? - -### Static modal component example - -Below is a static react modal component example (meaning its `position` and `display` have been overridden). Included are the modal header, modal body (required for `padding`), and modal footer (optional). We ask that you include react modal headers with dismiss actions whenever possible, or provide another explicit dismiss action. - - -
    -
    -
    -
    -
    React Modal title
    - -
    -
    -

    React Modal body text goes here.

    -
    -
    - - -
    -
    -
    -
    -
    -```jsx - - - React Modal title - - -

    React Modal body text goes here.

    -
    - - Close - Save changes - -
    -``` - -### Live demo - -Toggle a working React modal component demo by clicking the button below. It will slide down and fade in from the top of the page. - - - -### Static backdrop - -If you set a `backdrop` to `static`, your React modal component will behave as though the backdrop is static, meaning it will not close when clicking outside it. Click the button below to try it. - - - -### Scrolling long content - -When modals become too long for the user's viewport or device, they scroll independent of the page itself. Try the demo below to see what we mean. - - - -You can also create a scrollable react modal component that allows scroll the modal body by adding `scrollable` prop. - - - -### Vertically centered - -Add `alignment="center` to `` to vertically center the React modal. - - - - - -### Tooltips and popovers - -`` and `` can be placed within react modals as needed. When modal components are closed, any tooltips and popovers within are also automatically dismissed. - - - -### Toggle between modals - -Toggle between multiple modals with some clever placement of the `visible` props. **Please note multiple modals cannot be opened at the same time** — this method simply toggles between two separate modals. - - - -### Change animation - -The variable `$modal-fade-transform` determines the transform state of React Modal component before the modal fade-in animation, whereas the variable `$modal-show-transform` determines the transform state of Modal component after the modal fade-in animation. - -If you want a zoom-in animation, for example, set `$modal-fade-transform: scale(.8)`. - -### Remove animation - -For modals that simply appear rather than fade into view, set `transition` to `false`. - -```jsx -... -``` - -### Accessibility - -Be sure to add `aria-labelledby="..."`, referencing the modal title, to `` Additionally, you may give a description of your modal dialog with `aria-describedby` on ``. Note that you don’t need to add `role="dialog`, `aria-hidden="true"`, and `aria-modal="true"` since we already add it. - -## Optional sizes - -Modals have three optional sizes, available via modifier classes to be placed on a ``. These sizes kick in at certain breakpoints to avoid horizontal scrollbars on narrower viewports. - - -| Size | Property size | Modal max-width | -| ----------- | ------------- | --------------- | -| Small | `'sm'` | `300px` | -| Default | None | `500px` | -| Large | `'lg'` | `800px` | -| Extra large | `'xl'` | `1140px` | - - - -## Fullscreen Modal - -Another override is the option to pop up a React modal component that covers the user viewport, available via property `fullscrean`. - -| Fullscrean | Availability | -| ---------- | -------------- | -| `true` | Always | -| `'sm'` | Below `576px` | -| `'md'` | Below `768px` | -| `'lg'` | Below `992px` | -| `'xl'` | Below `1200px` | -| `'xxl'` | Below `1400px` | - - - -## API - -Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here. - -- [<CModal />](./api/#cmodal) -- [<CModalBody />](./api/#cmodalbody) -- [<CModalFooter />](./api/#cmodalfooter) -- [<CModalHeader />](./api/#cmodalheader) -- [<CModalTitle />](./api/#cmodaltitle) diff --git a/packages/docs/content/components/modal/styling.mdx b/packages/docs/content/components/modal/styling.mdx deleted file mode 100644 index 41200c16..00000000 --- a/packages/docs/content/components/modal/styling.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: React Modal Component Styling -name: Modal Styling -description: Learn how to customize the React Modal component with CSS classes, variables, and SASS for flexible styling and seamless integration into your design. -route: /components/modal/ ---- - -### CSS variables - -React Modal supports CSS variables for easy customization. These variables are set via SASS but allow direct overrides in your stylesheets or inline styles. - - - - - -#### How to use CSS variables - -```jsx -const customVars = { - '--cui-modal-color': '#555', - '--cui-modal-bg': '#efefef', -} - -return {/* Modal content */} -``` - -### SASS variables - - - -### SASS loops - -[Responsive fullscreen modals](#fullscreen-modal) are generated via the `$breakpoints` map and a loop in `scss/_modal.scss`. - - diff --git a/packages/docs/content/components/navbar/api.mdx b/packages/docs/content/components/navbar/api.mdx deleted file mode 100644 index 5170c089..00000000 --- a/packages/docs/content/components/navbar/api.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: React Navbar Component API -name: Navbar API -description: Explore the API reference for the React Navbar component and discover how to effectively utilize its props for customization. -route: /components/navbar/ ---- - -import CNavbarAPI from '../../api/CNavbar.api.mdx' -import CNavbarBrandAPI from '../../api/CNavbarBrand.api.mdx' -import CNavbarNavAPI from '../../api/CNavbarNav.api.mdx' -import CNavbarTextAPI from '../../api/CNavbarText.api.mdx' -import CNavbarTogglerAPI from '../../api/CNavbarToggler.api.mdx' - -## CNavbar - - - -## CNavbarBrand - - - -## CNavbarNav - - - -## CNavbarText - - - -## CNavbarToggler - - diff --git a/packages/docs/content/components/navbar/bootstrap.mdx b/packages/docs/content/components/navbar/bootstrap.mdx deleted file mode 100644 index 7d383817..00000000 --- a/packages/docs/content/components/navbar/bootstrap.mdx +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: React Bootstrap Navbar Component -name: Navbar with Bootstrap Styling -description: Learn how to use the React Bootstrap Navbar component from CoreUI to create responsive navigation headers with branding, dropdowns, collapsible content, and placement options. -route: /components/navbar/ -bootstrap_component: true ---- - -## Supported subcomponents in React Bootstrap Navbar - -The React Bootstrap Navbar component includes flexible subcomponents for building responsive headers: - -- `` – branding/logo. -- `` – navigation links and dropdowns. -- `` – toggles content collapse. -- `` – inline text. -- `` – groups and hides navbar content. - -## Basic usage of React Bootstrap Navbar - - - -### Branding - -Use `` to display your brand name or logo. - - - - - -### Navigation links and dropdowns - -Navigation inside the React Bootstrap Navbar uses ``. - - - - - -### Forms in navbars - -Include inputs, buttons, or entire forms in your navbar layout. - - - - - - -### Text in navbars - -Use `` for inline text blocks. - - - -## React Bootstrap Navbar color schemes - -Use `colorScheme="light"` or `colorScheme="dark"` combined with `.bg-*` utilities for full control of background and text colors. - - - -## Containers - -Wrap your navbar in a `` to center its content or apply spacing. - - - - -## Navbar placement - -Use the `placement` prop to fix navbars to the top or bottom or make them sticky. - - - - - - -## Responsive behaviors in React Bootstrap Navbar - -Use `expand` prop to control when the navbar collapses: - - - - - -### External content - -You can toggle external containers using collapse plugins. - - - -### Offcanvas navbars - -Turn the responsive navbar into an offcanvas drawer with `expand="*"` or `expand="xxl"`. - - - - -## API reference - -Explore the full API for React Bootstrap Navbar components: - -- [<CNavbar />](../api/#cnavbar) -- [<CNavbarBrand />](../api/#cnavbarbrand) -- [<CNavbarNav />](../api/#cnavbarnav) -- [<CNavbarText />](../api/#cnavbartext) -- [<CNavbarToggler />](../api/#cnavbartoggler) diff --git a/packages/docs/content/components/navbar/examples/NavbarBrand2Example.tsx b/packages/docs/content/components/navbar/examples/NavbarBrand2Example.tsx deleted file mode 100644 index 9ebf13c2..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarBrand2Example.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarBrand2Example = () => { - return ( - - - - CoreUI Signet - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarBrand3Example.tsx b/packages/docs/content/components/navbar/examples/NavbarBrand3Example.tsx deleted file mode 100644 index f8668e9d..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarBrand3Example.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react' -import { withPrefix } from 'gatsby' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarBrand3Example = () => { - return ( - - - - CoreUI Signet{' '} - CoreUI - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarBrandExample.tsx b/packages/docs/content/components/navbar/examples/NavbarBrandExample.tsx deleted file mode 100644 index a351cf18..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarBrandExample.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarBrandExample = () => { - return ( - <> - {/* As a link */} - - - Navbar - - - - {/* As a heading */} - - - Navbar - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarColorSchemesExample.tsx b/packages/docs/content/components/navbar/examples/NavbarColorSchemesExample.tsx deleted file mode 100644 index 6c53aca8..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarColorSchemesExample.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCollapse, - CContainer, - CDropdown, - CDropdownDivider, - CDropdownItem, - CDropdownMenu, - CDropdownToggle, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarColorSchemesExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - Navbar - setVisible(!visible)} - /> - - - - - Home - - - - Link - - - Dropdown button - - Action - Another action - - Something else here - - - - - Disabled - - - - - - - Search - - - - - -
    - - - Navbar - setVisible(!visible)} - /> - - - - - Home - - - - Link - - - Dropdown button - - Action - Another action - - Something else here - - - - - Disabled - - - - - - - Search - - - - - -
    - - - Navbar - setVisible(!visible)} - /> - - - - - Home - - - - Link - - - Dropdown button - - Action - Another action - - Something else here - - - - - Disabled - - - - - - - Search - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarContainers2Example.tsx b/packages/docs/content/components/navbar/examples/NavbarContainers2Example.tsx deleted file mode 100644 index ed6e3978..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarContainers2Example.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarContainers2Example = () => { - return ( - - - Navbar - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarContainersExample.tsx b/packages/docs/content/components/navbar/examples/NavbarContainersExample.tsx deleted file mode 100644 index dbe22b98..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarContainersExample.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarContainersExample = () => { - return ( - - - - Navbar - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarExample.tsx b/packages/docs/content/components/navbar/examples/NavbarExample.tsx deleted file mode 100644 index 2376135f..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarExample.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCollapse, - CContainer, - CDropdown, - CDropdownDivider, - CDropdownItem, - CDropdownMenu, - CDropdownToggle, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarExample = () => { - const [visible, setVisible] = useState(false) - return ( - - - Navbar - setVisible(!visible)} /> - - - - - Home - - - - Link - - - Dropdown button - - Action - Another action - - Something else here - - - - - Disabled - - - - - - - Search - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarForms2Example.tsx b/packages/docs/content/components/navbar/examples/NavbarForms2Example.tsx deleted file mode 100644 index 727ff2af..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarForms2Example.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react' -import { CButton, CContainer, CForm, CFormInput, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarForms2Example = () => { - return ( - - - Navbar - - - - Search - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarForms3Example.tsx b/packages/docs/content/components/navbar/examples/NavbarForms3Example.tsx deleted file mode 100644 index 55bbf35f..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarForms3Example.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import { CForm, CFormInput, CInputGroup, CInputGroupText, CNavbar } from '@coreui/react' - -export const NavbarForms3Example = () => { - return ( - - - - @ - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarForms4Example.tsx b/packages/docs/content/components/navbar/examples/NavbarForms4Example.tsx deleted file mode 100644 index cf58e561..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarForms4Example.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react' -import { CButton, CForm, CNavbar } from '@coreui/react' - -export const NavbarForms4Example = () => { - return ( - - - - Main button - - - Smaller button - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarFormsExample.tsx b/packages/docs/content/components/navbar/examples/NavbarFormsExample.tsx deleted file mode 100644 index 2b1e28c6..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarFormsExample.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react' -import { CButton, CContainer, CForm, CFormInput, CNavbar } from '@coreui/react' - -export const NavbarFormsExample = () => { - return ( - - - - - - Search - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarNav2Example.tsx b/packages/docs/content/components/navbar/examples/NavbarNav2Example.tsx deleted file mode 100644 index 55711a87..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarNav2Example.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React, { useState } from 'react' -import { - CCollapse, - CContainer, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavLink, -} from '@coreui/react' - -export const NavbarNav2Example = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - Navbar - setVisible(!visible)} - /> - - - - Home - - Features - Pricing - - Disabled - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarNav3Example.tsx b/packages/docs/content/components/navbar/examples/NavbarNav3Example.tsx deleted file mode 100644 index 680917b9..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarNav3Example.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React, { useState } from 'react' -import { - CCollapse, - CContainer, - CDropdown, - CDropdownDivider, - CDropdownItem, - CDropdownMenu, - CDropdownToggle, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarNav3Example = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - Navbar - setVisible(!visible)} - /> - - - - - Home - - - - Features - - - Pricing - - - Dropdown link - - Action - Another action - - Something else here - - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarNavExample.tsx b/packages/docs/content/components/navbar/examples/NavbarNavExample.tsx deleted file mode 100644 index 2fecb2ae..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarNavExample.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React, { useState } from 'react' -import { - CCollapse, - CContainer, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarNavExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - Navbar - setVisible(!visible)} - /> - - - - - Home - - - - Features - - - Pricing - - - - Disabled - - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarPlacementExample.tsx b/packages/docs/content/components/navbar/examples/NavbarPlacementExample.tsx deleted file mode 100644 index 7c40977e..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarPlacementExample.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarPlacementExample = () => { - return ( - - - Default - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarPlacementFixedBottomExample.tsx b/packages/docs/content/components/navbar/examples/NavbarPlacementFixedBottomExample.tsx deleted file mode 100644 index a7d302f1..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarPlacementFixedBottomExample.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarPlacementFixedBottomExample = () => { - return ( - - - Fixed bottom - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarPlacementFixedTopExample.tsx b/packages/docs/content/components/navbar/examples/NavbarPlacementFixedTopExample.tsx deleted file mode 100644 index 38ad1b61..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarPlacementFixedTopExample.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarPlacementFixedTopExample = () => { - return ( - - - Fixed top - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarPlacementStickyTopExample.tsx b/packages/docs/content/components/navbar/examples/NavbarPlacementStickyTopExample.tsx deleted file mode 100644 index 470ac1a2..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarPlacementStickyTopExample.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarBrand } from '@coreui/react' - -export const NavbarPlacementStickyTopExample = () => { - return ( - - - Sticky top - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarResponsiveExternalContentExample.tsx b/packages/docs/content/components/navbar/examples/NavbarResponsiveExternalContentExample.tsx deleted file mode 100644 index 98e6b7eb..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarResponsiveExternalContentExample.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React, { useState } from 'react' -import { CCollapse, CContainer, CNavbar, CNavbarToggler } from '@coreui/react' - -export const NavbarResponsiveExternalContentExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - -
    -
    Collapsed content
    - Toggleable via the navbar brand. -
    -
    - - - setVisible(!visible)} - /> - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarResponsiveOffcanvas2Example.tsx b/packages/docs/content/components/navbar/examples/NavbarResponsiveOffcanvas2Example.tsx deleted file mode 100644 index 89300d73..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarResponsiveOffcanvas2Example.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCloseButton, - CContainer, - CDropdown, - CDropdownItem, - CDropdownDivider, - CDropdownMenu, - CDropdownToggle, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, - COffcanvas, - COffcanvasBody, - COffcanvasHeader, - COffcanvasTitle, -} from '@coreui/react' - -export const NavbarResponsiveOffcanvas2Example = () => { - const [visible, setVisible] = useState(false) - return ( - - - Offcanvas navbar - setVisible(!visible)} - /> - setVisible(false)} - > - - Offcanvas - setVisible(false)} /> - - - - - - Home - - - - Link - - - Dropdown button - - Action - Another action - - Something else here - - - - - Disabled - - - - - - - Search - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarResponsiveOffcanvasExample.tsx b/packages/docs/content/components/navbar/examples/NavbarResponsiveOffcanvasExample.tsx deleted file mode 100644 index 5017ef5b..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarResponsiveOffcanvasExample.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCloseButton, - CContainer, - CDropdown, - CDropdownItem, - CDropdownDivider, - CDropdownMenu, - CDropdownToggle, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, - COffcanvas, - COffcanvasBody, - COffcanvasHeader, - COffcanvasTitle, -} from '@coreui/react' - -export const NavbarResponsiveOffcanvasExample = () => { - const [visible, setVisible] = useState(false) - return ( - - - Offcanvas navbar - setVisible(!visible)} - /> - setVisible(false)} - > - - Offcanvas - setVisible(false)} /> - - - - - - Home - - - - Link - - - Dropdown button - - Action - Another action - - Something else here - - - - - Disabled - - - - - - - Search - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarResponsiveToggler2Example.tsx b/packages/docs/content/components/navbar/examples/NavbarResponsiveToggler2Example.tsx deleted file mode 100644 index 21d7c752..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarResponsiveToggler2Example.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCollapse, - CContainer, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarResponsiveToggler2Example = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - Navbar - setVisible(!visible)} - /> - - - - - Home - - - - Link - - - - Disabled - - - - - - - Search - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarResponsiveToggler3Example.tsx b/packages/docs/content/components/navbar/examples/NavbarResponsiveToggler3Example.tsx deleted file mode 100644 index df353538..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarResponsiveToggler3Example.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCollapse, - CContainer, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarResponsiveToggler3Example = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - setVisible(!visible)} - /> - Navbar - - - - - Home - - - - Link - - - - Disabled - - - - - - - Search - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarResponsiveTogglerExample.tsx b/packages/docs/content/components/navbar/examples/NavbarResponsiveTogglerExample.tsx deleted file mode 100644 index 21abfd2a..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarResponsiveTogglerExample.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import React, { useState } from 'react' -import { - CButton, - CCollapse, - CContainer, - CForm, - CFormInput, - CNavbar, - CNavbarBrand, - CNavbarNav, - CNavbarToggler, - CNavItem, - CNavLink, -} from '@coreui/react' - -export const NavbarResponsiveTogglerExample = () => { - const [visible, setVisible] = useState(false) - return ( - <> - - - setVisible(!visible)} - /> - - Hidden brand - - - - Home - - - - Link - - - - Disabled - - - - - - - Search - - - - - - - ) -} diff --git a/packages/docs/content/components/navbar/examples/NavbarText.tsx b/packages/docs/content/components/navbar/examples/NavbarText.tsx deleted file mode 100644 index b015c47a..00000000 --- a/packages/docs/content/components/navbar/examples/NavbarText.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { CContainer, CNavbar, CNavbarText } from '@coreui/react' - -export const NavbarText = () => { - return ( - - - Navbar text with an inline element - - - ) -} diff --git a/packages/docs/content/components/navbar/index.mdx b/packages/docs/content/components/navbar/index.mdx deleted file mode 100644 index 6356d37c..00000000 --- a/packages/docs/content/components/navbar/index.mdx +++ /dev/null @@ -1,154 +0,0 @@ ---- -title: React Navbar Component -name: Navbar -description: Documentation and examples for the React navbar powerful, responsive navigation header component. Includes support for branding, links, dropdowns, and more. -route: /components/navbar/ -other_frameworks: navbar ---- - -## Supported content - -`` come with built-in support for a handful of sub-components. Choose from the following as needed: - -- `` for your company, product, or project name. -- `` for a full-height and lightweight navigation (including support for dropdowns). -- `` for use with our collapse plugin and other [navigation toggling](#responsive-behaviors) behaviors. -- Flex and spacing utilities for any form controls and actions. -- `` for adding vertically centered strings of text. -- `` for grouping and hiding navbar contents by a parent breakpoint. - -Here's an example of all the sub-components included in a responsive light-themed navbar that automatically collapses at the `lg` (large) breakpoint. - -## Basic usage - - - -### Brand - -The `` can be applied to most elements, but an anchor works best, as some elements might require utility classes or custom styles. - - - -Adding images to the `` will likely always require custom styles or utilities to properly size. Here are some examples to demonstrate. - - - - - -### Nav - -`` navigation is based on ``. **Navigation in navbars will also grow to occupy as much horizontal space as possible** to keep your navbar contents securely aligned. - - - -And because we use classes for our navs, you can avoid the list-based approach entirely if you like. - - - -You can also use dropdowns in your navbar. Please note that `` component requires `variant="nav-item"`. - - - -### Forms - -Place various form controls and components within a navbar: - - - -Immediate child elements of `` use flex layout and will default to `justify-content: space-between`. Use additional [flex utilities](https://coreui.io/bootstrap/docs/utilities/flex/) as needed to adjust this behavior. - - - -Input groups work, too. If your navbar is an entire form, or mostly a form, you can use the `` element as the container and save some HTML. - - - -Various buttons are supported as part of these navbar forms, too. This is also a great reminder that vertical alignment utilities can be used to align different sized elements. - - - -### Text - -Navbars may contain bits of text with the help of ``. This class adjusts vertical alignment and horizontal spacing for strings of text. - - - -## Color schemes - -Theming the navbar has never been easier thanks to the combination of theming classes and `background-color` utilities. Set `colorScheme="light"` for use with light background colors, or `colorScheme="dark"` for dark background colors. Then, customize with `.bg-*` utilities. - - - -## Containers - -Although it's not required, you can wrap a `` in a `` to center it on a page–though note that an inner container is still required. Or you can add a container inside the `` to only center the contents of a [fixed or static top navbar](#placement). - - - -Use any of the responsive containers to change how wide the content in your navbar is presented. - - - -## Placement - -Use our `placement` properly to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the ``) to prevent overlap with other elements. - -Also note that **`.sticky-top` uses `position: sticky`, which [isn't fully supported in every browser](https://caniuse.com/css-sticky)**. - - - - - - - - - -## Responsive behaviors - -Navbars can use ``, ``, and `expand="{sm|md|lg|xl|xxl}"` property to determine when their content collapses behind a button. In combination with other utilities, you can easily choose when to show or hide particular elements. - -For navbars that never collapse, add the `expand` boolean property on the ``. For navbars that always collapse, don't add any property. - -### Toggler - -Navbar togglers are left-aligned by default, but should they follow a sibling element like a ``, they'll automatically be aligned to the far right. Reversing your markup will reverse the placement of the toggler. Below are examples of different toggle styles. - -With no `` shown at the smallest breakpoint: - - - -With a brand name shown on the left and toggler on the right: - - - -With a toggler on the left and brand name on the right: - - - -### External content - -Sometimes you want to use the collapse plugin to trigger a container element for content that structurally sits outside of the ``. - - - -### Offcanvas - -Transform your expanding and collapsing navbar into an offcanvas drawer with the offcanvas plugin. We extend both the offcanvas default styles and use our `expand="*"` prop to create a dynamic and flexible navigation sidebar. - -In the example below, to create an offcanvas navbar that is always collapsed across all breakpoints, omit the `expand="*"` prop entirely. - - - -To create an offcanvas navbar that expands into a normal navbar at a specific breakpoint like `xxl`, use `expand="xxl"` property. - - - -## API - -Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here. - -- [<CNavbar />](./api/#cnavbar) -- [<CNavbarBrand />](./api/#cnavbarbrand) -- [<CNavbarNav />](./api/#cnavbarnav) -- [<CNavbarText />](./api/#cnavbartext) -- [<CNavbarToggler />](./api/#cnavbartoggler) \ No newline at end of file diff --git a/packages/docs/content/components/navbar/styling.mdx b/packages/docs/content/components/navbar/styling.mdx deleted file mode 100644 index f3f41df9..00000000 --- a/packages/docs/content/components/navbar/styling.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: React Navbar Component Styling -name: Navbar Styling -description: Learn how to customize the React Navbar component with CSS classes, variables, and SASS for flexible styling and seamless integration into your design. -route: /components/navbar/ ---- - -### CSS variables - -React navbars use local CSS variables on `.navbar` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. - - - -Some additional CSS variables are also present on `.navbar-nav`: - - - -Customization through CSS variables can be seen on the `.navbar-dark` class where we override specific values without adding duplicate CSS selectors. - - - -#### How to use CSS variables - -```jsx -const customVars = { - '--cui-navbar-color': '#24e484', - '--cui-navbar-hover-color': '1a1a1a', -} - -return {/* Navbar content */} -``` - -### SASS variables - -Variables for all navbars: - - - -Variables for the [dark navbar](#color-schemes): - - - -### SASS loops - -[Responsive navbar expand/collapse classes](#responsive-behaviors) (e.g., `.navbar-expand-lg`) are combined with the `$breakpoints` map and generated through a loop in `scss/_navbar.scss`. - - diff --git a/packages/docs/content/components/navs-tabs/api.mdx b/packages/docs/content/components/navs-tabs/api.mdx deleted file mode 100644 index 4c78c048..00000000 --- a/packages/docs/content/components/navs-tabs/api.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: React Navs & Tabs Components API -name: Navs & Tabs API -description: Explore the API reference for the React Navs & Tabs components and discover how to effectively utilize its props for customization. -route: /components/navs-tabs/ ---- - -import CNavAPI from '../../api/CNav.api.mdx' -import CNavItemAPI from '../../api/CNavItem.api.mdx' -import CNavLinkAPI from '../../api/CNavLink.api.mdx' -import CTabContentAPI from '../../api/CTabContent.api.mdx' -import CTabPaneAPI from '../../api/CTabPane.api.mdx' - -## CNav - - - -## CNavItem - - - -## CNavLink - - - -## CTabContent - - - -## CTabPane - - diff --git a/packages/docs/content/components/navs-tabs/bootstrap.mdx b/packages/docs/content/components/navs-tabs/bootstrap.mdx deleted file mode 100644 index 655db31b..00000000 --- a/packages/docs/content/components/navs-tabs/bootstrap.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: React Bootstrap Navs and Tabs Component -name: Navs and Tabs with Bootstrap Styling -description: Learn how to use the React Bootstrap Navs and Tabs component from CoreUI to build navigations, tabbed interfaces, dropdowns, and more with responsive and accessible markup. -route: /components/navs-tabs/ -bootstrap_component: true ---- - -## React Bootstrap Base Nav - -The React Bootstrap Navs and Tabs component provides a flexible base for building navigations. The `` component is built with flexbox and supports active, disabled, tabbed, and pill-styled variations. - - - -You can structure navigation with `